@drskillissue/ganko 0.2.83 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{chunk-F5F7F4LG.js → chunk-2VRVUMIE.js} +22864 -36464
- package/dist/chunk-2VRVUMIE.js.map +1 -0
- package/dist/{chunk-NFDA6LAI.js → chunk-TNKZGWOR.js} +91 -79
- package/dist/chunk-TNKZGWOR.js.map +1 -0
- package/dist/eslint-plugin.cjs +2507 -16695
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.d.cts +1 -13
- package/dist/eslint-plugin.d.ts +1 -13
- package/dist/eslint-plugin.js +14 -130
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.cjs +13452 -14046
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1243 -835
- package/dist/index.d.ts +1243 -835
- package/dist/index.js +13412 -305
- package/dist/index.js.map +1 -1
- package/dist/rules-manifest.cjs +90 -78
- package/dist/rules-manifest.cjs.map +1 -1
- package/dist/rules-manifest.d.cts +1 -1
- package/dist/rules-manifest.d.ts +1 -1
- package/dist/rules-manifest.js +1 -1
- package/package.json +5 -2
- package/dist/chunk-F5F7F4LG.js.map +0 -1
- package/dist/chunk-NFDA6LAI.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/runner.ts","../src/cache.ts"],"sourcesContent":["/**\n * Runner - Plugin-agnostic runner for ganko\n *\n * The runner takes a configuration with plugins and runs them against files.\n * It never stores typed graphs - plugins handle their own graph building\n * and rule execution internally via the analyze() method.\n *\n * Rule overrides allow callers (LSP, CLI) to disable rules or remap their\n * severity without modifying rule definitions. The runner intercepts the\n * Emit callback to enforce overrides before diagnostics reach the caller.\n */\nimport type ts from \"typescript\"\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { Plugin, Emit } from \"./graph\"\nimport type { RuleOverrides } from \"@drskillissue/ganko-shared\"\n\n/** Runner configuration */\nexport interface RunnerConfig {\n readonly plugins: readonly Plugin<string>[]\n readonly rules?: RuleOverrides\n readonly program?: ts.Program\n}\n\n/** Runner interface */\nexport interface Runner {\n run(files: readonly string[]): readonly Diagnostic[]\n /** Replace rule overrides. Takes effect on the next run() call. */\n setRuleOverrides(overrides: RuleOverrides): void\n /** Replace the TypeScript program. Takes effect on the next run() call. */\n setProgram(program: ts.Program): void\n}\n\n/**\n * Build an Emit wrapper that enforces rule overrides.\n *\n * @param target - The underlying emit that collects diagnostics\n * @param overrides - Current rule override map\n * @returns Wrapped emit that suppresses/remaps per overrides\n */\nexport function createOverrideEmit(target: Emit, overrides: RuleOverrides): Emit {\n return (d) => {\n const override = overrides[d.rule]\n if (override === undefined) { target(d); return }\n if (override === \"off\") return\n if (override !== d.severity) {\n target({ ...d, severity: override })\n return\n }\n target(d)\n }\n}\n\n/**\n * Create a runner from configuration.\n */\nexport function createRunner(config: RunnerConfig): Runner {\n let overrides: RuleOverrides = config.rules ?? {}\n let program: ts.Program | undefined = config.program\n\n return {\n run(files) {\n const diagnostics: Diagnostic[] = []\n const raw: Emit = (d) => diagnostics.push(d)\n const hasOverrides = Object.keys(overrides).length > 0\n const emit = hasOverrides ? createOverrideEmit(raw, overrides) : raw\n const context = program ? { program } : undefined\n for (const plugin of config.plugins) {\n plugin.analyze(files, emit, context)\n }\n return diagnostics\n },\n\n setRuleOverrides(next) {\n overrides = next\n },\n\n setProgram(next) {\n program = next\n },\n }\n}\n","/**\n * GraphCache — Versioned cache for SolidGraph, CSSGraph, and LayoutGraph instances.\n *\n * Eliminates redundant graph construction in the LSP server by caching\n * per-file SolidGraphs (keyed by path + script version), a single\n * CSSGraph invalidated via a monotonic generation counter, and a\n * LayoutGraph invalidated by Solid/CSS signatures.\n *\n * The cache does not perform I/O or parsing — callers supply builder\n * functions that are invoked only on cache miss.\n */\nimport { canonicalPath, classifyFile, noopLogger, Level } from \"@drskillissue/ganko-shared\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { SolidGraph } from \"./solid/impl\"\nimport type { CSSGraph } from \"./css/impl\"\nimport type { LayoutGraph } from \"./cross-file/layout/graph\"\n\ninterface CachedSolid {\n readonly version: string\n readonly graph: SolidGraph\n}\n\ninterface CachedCSS {\n readonly generation: number\n readonly graph: CSSGraph\n}\n\ninterface CachedLayout {\n readonly solidGeneration: number\n readonly cssGeneration: number\n readonly graph: LayoutGraph\n}\n\ninterface CachedCrossFileResults {\n readonly solidGeneration: number\n readonly cssGeneration: number\n readonly byFile: ReadonlyMap<string, readonly Diagnostic[]>\n}\n\n/**\n * Versioned cache for SolidGraph, CSSGraph, and LayoutGraph instances.\n *\n * SolidGraphs are cached per file path with a version string.\n * The CSSGraph is a single instance covering all CSS files,\n * invalidated via a monotonic generation counter bumped by\n * `invalidate()` or `invalidateAll()`.\n */\nexport class GraphCache {\n private readonly log: Logger\n private readonly solids = new Map<string, CachedSolid>()\n private readonly crossFileDiagnostics = new Map<string, readonly Diagnostic[]>()\n private crossFileResults: CachedCrossFileResults | null = null\n private css: CachedCSS | null = null\n private solidGeneration = 0\n private cssGeneration = 0\n private layout: CachedLayout | null = null\n\n constructor(log?: Logger) {\n this.log = log ?? noopLogger\n }\n\n /**\n * Check if a SolidGraph is cached and current for a file path.\n *\n * Allows callers to skip builder allocation when the cache is warm.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n */\n hasSolidGraph(path: string, version: string): boolean {\n const key = canonicalPath(path)\n const cached = this.solids.get(key)\n const hit = cached !== undefined && cached.version === version\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`hasSolidGraph: ${key} v=${version} cached=${cached?.version ?? \"none\"} hit=${hit} (${this.solids.size} total)`)\n return hit\n }\n\n /**\n * Store a pre-built SolidGraph in the cache.\n *\n * Used by the CLI lint command which builds graphs during single-file\n * analysis and pre-populates the cache for cross-file reuse.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n * @param graph Pre-built SolidGraph\n */\n setSolidGraph(path: string, version: string, graph: SolidGraph): void {\n const key = canonicalPath(path)\n this.solids.set(key, { version, graph })\n this.solidGeneration++\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`setSolidGraph: ${key} v=${version} (${this.solids.size} total) solidGen=${this.solidGeneration}`)\n }\n\n /**\n * Get a cached SolidGraph without building on miss.\n *\n * Returns the cached graph if the version matches, null otherwise.\n * Use when the caller has already confirmed the entry exists via\n * `hasSolidGraph` and wants to avoid allocating a builder closure.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n */\n getCachedSolidGraph(path: string, version: string): SolidGraph | null {\n const key = canonicalPath(path)\n const cached = this.solids.get(key)\n if (cached !== undefined && cached.version === version) {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedSolidGraph HIT: ${key} v=${version}`)\n return cached.graph\n }\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedSolidGraph MISS: ${key} v=${version}`)\n return null\n }\n\n /**\n * Get or build a SolidGraph for a file path.\n *\n * Returns the cached graph if the version matches.\n * Otherwise invokes the builder, caches the result, and returns it.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n * @param build Builder function invoked on cache miss\n */\n getSolidGraph(path: string, version: string, build: () => SolidGraph): SolidGraph {\n const key = canonicalPath(path)\n const cached = this.solids.get(key)\n if (cached !== undefined && cached.version === version) {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph HIT: ${key} v=${version}`)\n return cached.graph\n }\n\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph MISS: ${key} v=${version} (was ${cached?.version ?? \"uncached\"})`)\n const t0 = performance.now()\n const graph = build()\n this.solids.set(key, { version, graph })\n this.solidGeneration++\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph BUILT: ${key} v=${version} in ${performance.now() - t0}ms (${this.solids.size} total) solidGen=${this.solidGeneration}`)\n return graph\n }\n\n /**\n * Get the cached CSSGraph, or rebuild it.\n *\n * Returns the cached graph if the generation matches the current\n * CSS generation counter. Otherwise invokes the builder, caches\n * the result at the current generation, and returns it.\n *\n * @param build Builder function invoked on cache miss\n */\n getCSSGraph(build: () => CSSGraph): CSSGraph {\n if (this.css !== null && this.css.generation === this.cssGeneration) {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph HIT: gen=${this.cssGeneration}`)\n return this.css.graph\n }\n\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph MISS: currentGen=${this.cssGeneration} cachedGen=${this.css?.generation ?? \"none\"}`)\n const t0 = performance.now()\n const graph = build()\n this.css = { generation: this.cssGeneration, graph }\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph BUILT: gen=${this.cssGeneration} in ${performance.now() - t0}ms`)\n return graph\n }\n\n /**\n * Get or build a LayoutGraph for current Solid/CSS cache state.\n *\n * Returns cached LayoutGraph when both Solid signature (path+version)\n * and CSS generation match. Otherwise invokes the builder.\n *\n * @param build Builder function invoked on cache miss\n */\n getLayoutGraph(build: () => LayoutGraph): LayoutGraph {\n const solidGen = this.solidGeneration\n const cssGen = this.cssGeneration\n\n if (\n this.layout !== null\n && this.layout.solidGeneration === solidGen\n && this.layout.cssGeneration === cssGen\n ) {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getLayoutGraph HIT: solidGen=${solidGen} cssGen=${cssGen}`)\n return this.layout.graph\n }\n\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(\n `getLayoutGraph MISS: solidGen=${solidGen} cssGen=${cssGen} `\n + `cached=${this.layout !== null}`,\n )\n\n const t0 = performance.now()\n const graph = build()\n this.layout = {\n solidGeneration: solidGen,\n cssGeneration: cssGen,\n graph,\n }\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getLayoutGraph BUILT: in ${performance.now() - t0}ms`)\n return graph\n }\n\n /**\n * Invalidate cached graphs affected by a file change.\n *\n * Classifies the path and invalidates the appropriate cache:\n * solid files evict their per-file SolidGraph, CSS files bump\n * the CSSGraph generation counter.\n *\n * @param path Absolute file path that changed\n */\n invalidate(path: string): void {\n const key = canonicalPath(path)\n const kind = classifyFile(key)\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate: ${key} kind=${kind} solids=${this.solids.size} hasCrossFileResults=${this.crossFileResults !== null} hasLayout=${this.layout !== null}`)\n if (kind === \"solid\") {\n const had = this.solids.has(key)\n this.solids.delete(key)\n this.crossFileDiagnostics.delete(key)\n this.crossFileResults = null\n this.solidGeneration++\n this.layout = null\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate SOLID: ${key} wasInCache=${had} solids=${this.solids.size} solidGen=${this.solidGeneration}`)\n }\n if (kind === \"css\") {\n this.crossFileDiagnostics.delete(key)\n this.crossFileResults = null\n this.cssGeneration++\n this.css = null\n this.layout = null\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate CSS: ${key} newCssGen=${this.cssGeneration}`)\n }\n }\n\n /**\n * Invalidate all cached graphs.\n *\n * Called on workspace-level events like config changes.\n */\n invalidateAll(): void {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidateAll: solids=${this.solids.size} solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`)\n this.solids.clear()\n this.crossFileDiagnostics.clear()\n this.crossFileResults = null\n this.solidGeneration++\n this.cssGeneration++\n this.css = null\n this.layout = null\n }\n\n /**\n * Get all cached SolidGraphs.\n *\n * Returns a snapshot array of all currently-cached graphs.\n * Used by cross-file analysis which needs all SolidGraphs.\n */\n getAllSolidGraphs(): readonly SolidGraph[] {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getAllSolidGraphs: ${this.solids.size} graphs`)\n const out: SolidGraph[] = new Array(this.solids.size)\n let i = 0\n for (const entry of this.solids.values()) {\n out[i++] = entry.graph\n }\n return out\n }\n\n /**\n * Get the cached CSSGraph, or null if not cached.\n */\n getCachedCSSGraph(): CSSGraph | null {\n return this.css?.graph ?? null\n }\n\n /**\n * Get the cached LayoutGraph, or null if not cached.\n */\n getCachedLayoutGraph(): LayoutGraph | null {\n return this.layout?.graph ?? null\n }\n\n /**\n * Get cached cross-file diagnostics for a file path.\n *\n * Returns the previous cross-file results so single-file-only\n * re-analysis (during typing) can merge them without re-running\n * cross-file rules.\n *\n * @param path Absolute file path\n */\n getCachedCrossFileDiagnostics(path: string): readonly Diagnostic[] {\n return this.crossFileDiagnostics.get(canonicalPath(path)) ?? []\n }\n\n /**\n * Store cross-file diagnostics for a file path.\n *\n * @param path Absolute file path\n * @param diagnostics Cross-file diagnostics for this path\n */\n setCachedCrossFileDiagnostics(path: string, diagnostics: readonly Diagnostic[]): void {\n this.crossFileDiagnostics.set(canonicalPath(path), diagnostics)\n }\n\n /**\n * Get workspace-level cross-file results if the underlying graphs haven't changed.\n *\n * Returns the full per-file map when the solid signature and CSS generation\n * match, meaning no graphs were rebuilt since the last run. Returns null\n * when results are stale and `runCrossFileRules` must re-execute.\n */\n getCachedCrossFileResults(): ReadonlyMap<string, readonly Diagnostic[]> | null {\n if (this.crossFileResults === null) {\n this.log.debug(\"getCachedCrossFileResults: null (no cached results)\")\n return null\n }\n const solidMatch = this.crossFileResults.solidGeneration === this.solidGeneration\n const cssMatch = this.crossFileResults.cssGeneration === this.cssGeneration\n if (solidMatch && cssMatch) {\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedCrossFileResults HIT: ${this.crossFileResults?.byFile.size} files`)\n return this.crossFileResults.byFile\n }\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(\n `getCachedCrossFileResults MISS: solidMatch=${solidMatch} cssMatch=${cssMatch} `\n + `cachedSolidGen=${this.crossFileResults?.solidGeneration} currentSolidGen=${this.solidGeneration} `\n + `cachedCssGen=${this.crossFileResults?.cssGeneration} currentCssGen=${this.cssGeneration}`,\n )\n return null\n }\n\n /**\n * Store workspace-level cross-file results bucketed by file.\n *\n * Called after `runCrossFileRules` completes. Captures the current\n * solid signature and CSS generation so subsequent lookups are O(1)\n * until a graph changes.\n *\n * @param allDiagnostics All cross-file diagnostics from the workspace run\n */\n setCachedCrossFileResults(allDiagnostics: readonly Diagnostic[]): void {\n const byFile = new Map<string, Diagnostic[]>()\n for (let i = 0, len = allDiagnostics.length; i < len; i++) {\n const d = allDiagnostics[i]\n if (!d) continue\n let arr = byFile.get(d.file)\n if (!arr) {\n arr = []\n byFile.set(d.file, arr)\n }\n arr.push(d)\n }\n this.crossFileResults = {\n solidGeneration: this.solidGeneration,\n cssGeneration: this.cssGeneration,\n byFile,\n }\n if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(\n `setCachedCrossFileResults: ${allDiagnostics.length} diags across ${byFile.size} files `\n + `solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`,\n )\n /* Replace the per-file cache used during typing (when cross-file\n analysis is skipped and previous results are reused). Must clear\n first — files that previously had cross-file diagnostics but no\n longer do must not retain stale entries. */\n this.crossFileDiagnostics.clear()\n for (const [file, diagnostics] of byFile) {\n this.crossFileDiagnostics.set(file, diagnostics)\n }\n }\n\n /** Number of cached SolidGraphs. */\n get solidCount(): number {\n return this.solids.size\n }\n\n /** The logger instance used by this cache. */\n get logger(): Logger {\n return this.log\n }\n\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,mBAAmB,QAAc,WAAgC;AAC/E,SAAO,CAAC,MAAM;AACZ,UAAM,WAAW,UAAU,EAAE,IAAI;AACjC,QAAI,aAAa,QAAW;AAAE,aAAO,CAAC;AAAG;AAAA,IAAO;AAChD,QAAI,aAAa,MAAO;AACxB,QAAI,aAAa,EAAE,UAAU;AAC3B,aAAO,EAAE,GAAG,GAAG,UAAU,SAAS,CAAC;AACnC;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV;AACF;AAKO,SAAS,aAAa,QAA8B;AACzD,MAAI,YAA2B,OAAO,SAAS,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e,WAAW,KAAK,aAAa;AAAA,IACjE;AAKA,SAAK,qBAAqB,MAAM;AAChC,eAAW,CAAC,MAAM,WAAW,KAAK,QAAQ;AACxC,WAAK,qBAAqB,IAAI,MAAM,WAAW;AAAA,IACjD;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,aAAqB;AACvB,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA;AAAA,EAGA,IAAI,SAAiB;AACnB,WAAO,KAAK;AAAA,EACd;AAGF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/runner.ts","../src/graph.ts","../src/solid/create-input.ts","../src/solid/plugin.ts","../src/css/plugin.ts","../src/css/tailwind.ts","../src/css/policy.ts","../src/compilation/symbols/class-name.ts","../src/compilation/symbols/selector.ts","../src/compilation/symbols/declaration.ts","../src/compilation/symbols/custom-property.ts","../src/compilation/symbols/keyframes.ts","../src/compilation/symbols/font-face.ts","../src/compilation/symbols/layer.ts","../src/compilation/symbols/container.ts","../src/compilation/symbols/theme-token.ts","../src/compilation/symbols/symbol-table.ts","../src/compilation/incremental/dependency-graph.ts","../src/compilation/binding/element-builder.ts","../src/compilation/binding/signal-builder.ts","../src/css/analysis/cascade.ts","../src/compilation/binding/cascade-binder.ts","../src/compilation/binding/scope-resolver.ts","../src/compilation/analysis/layout-fact.ts","../src/compilation/analysis/alignment.ts","../src/compilation/analysis/cascade-analyzer.ts","../src/compilation/analysis/statefulness.ts","../src/compilation/binding/semantic-model.ts","../src/compilation/core/compilation.ts","../src/compilation/symbols/declaration-table.ts","../src/compilation/providers/plain-css.ts","../src/compilation/incremental/change-propagation.ts","../src/compilation/incremental/tracker.ts","../src/compilation/dispatch/rule.ts","../src/compilation/dispatch/registry.ts","../src/compilation/dispatch/tier-resolver.ts","../src/compilation/dispatch/dispatcher.ts","../src/css/rules/animation/layout-animation-exempt.ts","../src/compilation/dispatch/rules/css-layout-transition-layout-property.ts","../src/compilation/dispatch/rules/css-layout-animation-layout-property.ts","../src/compilation/dispatch/rules/css-layout-font-swap-instability.ts","../src/compilation/dispatch/rules/jsx-no-undefined-css-class.ts","../src/compilation/dispatch/rules/css-no-unreferenced-component-class.ts","../src/compilation/dispatch/rules/jsx-classlist-boolean-values.ts","../src/solid/util/type-flags.ts","../src/compilation/dispatch/rules/jsx-classlist-no-accessor-reference.ts","../src/compilation/dispatch/rules/jsx-classlist-no-constant-literals.ts","../src/compilation/dispatch/rules/jsx-classlist-static-keys.ts","../src/compilation/dispatch/rules/jsx-style-kebab-case-keys.ts","../src/compilation/dispatch/rules/jsx-style-no-function-values.ts","../src/compilation/dispatch/rules/jsx-style-no-unused-custom-prop.ts","../src/compilation/dispatch/rules/jsx-layout-classlist-geometry-toggle.ts","../src/compilation/dispatch/rules/jsx-layout-picture-source-ratio-consistency.ts","../src/compilation/dispatch/rules/jsx-no-duplicate-class-token-class-classlist.ts","../src/compilation/dispatch/rules/jsx-style-policy.ts","../src/compilation/dispatch/rules/jsx-layout-fill-image-parent-must-be-sized.ts","../src/compilation/dispatch/rules/css-layout-unsized-replaced-element.ts","../src/compilation/dispatch/rules/css-layout-dynamic-slot-no-reserved-space.ts","../src/compilation/dispatch/rules/css-layout-overflow-anchor-instability.ts","../src/compilation/dispatch/rules/css-layout-scrollbar-gutter-instability.ts","../src/compilation/dispatch/rules/css-layout-content-visibility-no-intrinsic-size.ts","../src/compilation/dispatch/rules/css-layout-stateful-box-model-shift.ts","../src/compilation/dispatch/rules/jsx-layout-unstable-style-toggle.ts","../src/compilation/dispatch/rules/jsx-layout-policy-touch-target.ts","../src/compilation/dispatch/rules/css-layout-conditional-display-collapse.ts","../src/compilation/dispatch/rules/css-layout-conditional-offset-shift.ts","../src/compilation/dispatch/rules/css-layout-conditional-white-space-wrap-shift.ts","../src/compilation/dispatch/rules/css-layout-overflow-mode-toggle-instability.ts","../src/compilation/dispatch/rules/css-layout-box-sizing-toggle-with-chrome.ts","../src/compilation/dispatch/rules/css-layout-sibling-alignment-outlier.ts","../src/compilation/dispatch/rules/css-no-empty-rule.ts","../src/compilation/dispatch/rules/css-no-id-selectors.ts","../src/compilation/dispatch/rules/css-no-complex-selectors.ts","../src/compilation/dispatch/rules/css-selector-max-specificity.ts","../src/compilation/dispatch/rules/css-selector-max-attribute-and-universal.ts","../src/compilation/dispatch/rules/css-declaration-no-overridden-within-rule.ts","../src/compilation/dispatch/rules/css-no-hardcoded-z-index.ts","../src/compilation/dispatch/rules/css-z-index-requires-positioned-context.ts","../src/compilation/dispatch/rules/css-no-discrete-transition.ts","../src/compilation/dispatch/rules/css-no-transition-all.ts","../src/compilation/dispatch/rules/css-no-legacy-vh-100.ts","../src/compilation/dispatch/rules/css-prefer-logical-properties.ts","../src/compilation/dispatch/rules/css-no-important.ts","../src/compilation/dispatch/rules/css-no-unresolved-custom-properties.ts","../src/compilation/dispatch/rules/css-no-unused-custom-properties.ts","../src/compilation/dispatch/rules/css-no-duplicate-selectors.ts","../src/compilation/dispatch/rules/css-no-empty-keyframes.ts","../src/compilation/dispatch/rules/css-no-unknown-animation-name.ts","../src/compilation/dispatch/rules/css-no-unused-keyframes.ts","../src/compilation/dispatch/rules/css-no-unknown-container-name.ts","../src/compilation/dispatch/rules/css-no-unused-container-name.ts","../src/compilation/dispatch/rules/css-require-reduced-motion-override.ts","../src/compilation/dispatch/rules/css-no-outline-none-without-focus-visible.ts","../src/css/parser/color.ts","../src/compilation/dispatch/rules/css-policy-contrast.ts","../src/compilation/dispatch/rules/css-policy-typography.ts","../src/compilation/dispatch/rules/css-policy-spacing.ts","../src/compilation/dispatch/rules/css-no-layout-property-animation.ts","../src/compilation/dispatch/rules/css-layer-requirement-for-component-rules.ts","../src/compilation/dispatch/rules/css-no-custom-property-cycle.ts","../src/compilation/dispatch/rules/css-no-layer-order-inversion.ts","../src/compilation/dispatch/rules/css-no-redundant-override-pairs.ts","../src/compilation/dispatch/rules/css-media-query-overlap-conflict.ts","../src/compilation/dispatch/rules/css-no-descending-specificity-conflict.ts","../src/compilation/dispatch/rules/index.ts"],"sourcesContent":["/**\n * Runner - Plugin-agnostic runner for ganko\n *\n * The runner takes a configuration with plugins and runs them against files.\n * It never stores typed graphs - plugins handle their own graph building\n * and rule execution internally via the analyze() method.\n *\n * Rule overrides allow callers (LSP, CLI) to disable rules or remap their\n * severity without modifying rule definitions. The runner intercepts the\n * Emit callback to enforce overrides before diagnostics reach the caller.\n */\nimport type ts from \"typescript\"\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { Plugin, Emit } from \"./graph\"\nimport type { RuleOverrides } from \"@drskillissue/ganko-shared\"\n\n/** Runner configuration */\nexport interface RunnerConfig {\n readonly plugins: readonly Plugin<string>[]\n readonly rules?: RuleOverrides\n readonly program?: ts.Program\n}\n\n/** Runner interface */\nexport interface Runner {\n run(files: readonly string[]): readonly Diagnostic[]\n /** Replace rule overrides. Takes effect on the next run() call. */\n setRuleOverrides(overrides: RuleOverrides): void\n /** Replace the TypeScript program. Takes effect on the next run() call. */\n setProgram(program: ts.Program): void\n}\n\n/**\n * Build an Emit wrapper that enforces rule overrides.\n *\n * @param target - The underlying emit that collects diagnostics\n * @param overrides - Current rule override map\n * @returns Wrapped emit that suppresses/remaps per overrides\n */\nexport function createOverrideEmit(target: Emit, overrides: RuleOverrides): Emit {\n return (d) => {\n const override = overrides[d.rule]\n if (override === undefined) { target(d); return }\n if (override === \"off\") return\n if (override !== d.severity) {\n target({ ...d, severity: override })\n return\n }\n target(d)\n }\n}\n\n/**\n * Create a runner from configuration.\n */\nexport function createRunner(config: RunnerConfig): Runner {\n let overrides: RuleOverrides = config.rules ?? {}\n let program: ts.Program | undefined = config.program\n\n return {\n run(files) {\n const diagnostics: Diagnostic[] = []\n const raw: Emit = (d) => diagnostics.push(d)\n const hasOverrides = Object.keys(overrides).length > 0\n const emit = hasOverrides ? createOverrideEmit(raw, overrides) : raw\n const context = program ? { program } : undefined\n for (const plugin of config.plugins) {\n plugin.analyze(files, emit, context)\n }\n return diagnostics\n },\n\n setRuleOverrides(next) {\n overrides = next\n },\n\n setProgram(next) {\n program = next\n },\n }\n}\n","import type ts from \"typescript\"\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { RuleSeverityOverride } from \"@drskillissue/ganko-shared\"\n\n/** Emit callback type for pushing diagnostics */\nexport type Emit = (d: Diagnostic) => void\n\n/** Rule category for grouping in configuration UIs and documentation. */\nexport type RuleCategory =\n | \"reactivity\"\n | \"jsx\"\n | \"solid\"\n | \"correctness\"\n | \"performance\"\n | \"css-a11y\"\n | \"css-animation\"\n | \"css-cascade\"\n | \"css-property\"\n | \"css-selector\"\n | \"css-structure\"\n | \"css-jsx\"\n | \"css-layout\"\n\n/** Metadata shared by all rule types (Solid, CSS, cross-file). */\nexport interface RuleMeta {\n readonly description: string\n readonly fixable: boolean\n readonly category: RuleCategory\n}\n\n/**\n * Base rule interface parameterised on the graph/context type.\n * SolidRule, CSSRule, and CrossRule all satisfy this shape.\n */\nexport interface BaseRule<G> {\n readonly id: string\n readonly severity: RuleSeverityOverride\n readonly messages: Record<string, string>\n readonly meta: RuleMeta\n readonly check: (graph: G, emit: Emit) => void\n}\n\n/**\n * Run all enabled rules against a graph, emitting diagnostics.\n */\nexport function runRules<G>(rules: readonly BaseRule<G>[], graph: G, emit: Emit): void {\n for (const rule of rules) {\n if (rule.severity === \"off\") continue\n rule.check(graph, emit)\n }\n}\n\n/**\n * Base interface for all program graphs.\n * Each graph type extends this with domain-specific properties.\n */\nexport interface Graph {\n readonly kind: string\n}\n\n/**\n * A plugin provides a graph type and its rules.\n *\n * Plugins push data OUT via callbacks. The runner never stores typed graphs.\n * Plugins run their own rules internally via the analyze() method.\n *\n * @typeParam K - The plugin kind string\n */\nexport interface Plugin<K extends string> {\n readonly kind: K\n readonly extensions: readonly string[]\n /** Analyze files and emit diagnostics via callback */\n analyze(files: readonly string[], emit: Emit, context?: { program: ts.Program }): void\n}\n","import type ts from \"typescript\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\nimport type { SolidInput } from \"./input\"\n\nexport function createSolidInput(\n filePath: string,\n program: ts.Program,\n logger?: Logger,\n): SolidInput {\n const sourceFile = program.getSourceFile(filePath)\n if (!sourceFile) {\n throw new Error(`File not found in program: ${filePath}`)\n }\n const input: { -readonly [K in keyof SolidInput]: SolidInput[K] } = {\n file: filePath,\n sourceFile,\n checker: program.getTypeChecker(),\n }\n if (logger !== undefined) input.logger = logger\n return input\n}\n","import type ts from \"typescript\"\nimport type { Emit, Plugin } from \"../graph\"\nimport { runRules } from \"../graph\"\nimport type { SolidInput } from \"./input\"\nimport type { SolidSyntaxTree } from \"../compilation/core/solid-syntax-tree\"\nimport { buildSolidSyntaxTree } from \"./impl\"\nimport { rules } from \"./rules\"\nimport { createSolidInput } from \"./create-input\"\nimport { createSuppressionEmit } from \"../suppression\"\nimport { SOLID_EXTENSIONS, matchesExtension } from \"@drskillissue/ganko-shared\"\n\nexport function analyzeInput(input: SolidInput, emit: Emit): void {\n const tree = buildSolidSyntaxTree(input, \"\")\n runRules(rules, tree, createSuppressionEmit(input.sourceFile, emit, tree.comments))\n}\n\nexport function runSolidRules(tree: SolidSyntaxTree, sourceFile: ts.SourceFile, emit: Emit): void {\n runRules(rules, tree, createSuppressionEmit(sourceFile, emit, tree.comments))\n}\n\nexport const SolidPlugin: Plugin<\"solid\"> = {\n kind: \"solid\",\n extensions: SOLID_EXTENSIONS,\n\n analyze(files: readonly string[], emit: Emit, context?: { program: ts.Program }): void {\n if (!context) {\n throw new Error(\"SolidPlugin.analyze requires a context with ts.Program\")\n }\n const { program } = context\n for (const file of files) {\n if (!matchesExtension(file, SOLID_EXTENSIONS)) continue\n const input = createSolidInput(file, program)\n const tree = buildSolidSyntaxTree(input, \"\")\n runRules(rules, tree, createSuppressionEmit(input.sourceFile, emit, tree.comments))\n }\n },\n}\n","import type { Emit, Plugin } from \"../graph\"\nimport { runRules } from \"../graph\"\nimport type { CSSFile, CSSInput } from \"./input\"\nimport { createCSSInput } from \"./input\"\nimport { buildCSSResult } from \"./impl\"\nimport { rules } from \"./rules\"\nimport { readFileSync } from \"node:fs\"\nimport { CSS_EXTENSIONS, matchesExtension } from \"@drskillissue/ganko-shared\"\n\nexport function analyzeCSSInput(input: CSSInput, emit: Emit): void {\n const { workspace } = buildCSSResult(input)\n runRules(rules, workspace, emit)\n}\n\nexport const CSSPlugin: Plugin<\"css\"> = {\n kind: \"css\",\n extensions: CSS_EXTENSIONS,\n\n analyze(files: readonly string[], emit: Emit): void {\n const cssFiles: CSSFile[] = []\n for (const file of files) {\n if (!matchesExtension(file, CSS_EXTENSIONS)) continue\n const content = readFileSync(file, \"utf-8\")\n cssFiles.push({ path: file, content })\n }\n if (cssFiles.length === 0) return\n const { workspace } = buildCSSResult(createCSSInput(cssFiles))\n runRules(rules, workspace, emit)\n },\n}\n","/**\n * Tailwind CSS v4 Integration\n *\n * Provides a TailwindValidator interface that checks whether a class name\n * is a valid Tailwind utility. Two implementations exist:\n *\n * - LiveValidator: Wraps a Tailwind DesignSystem, uses candidatesToCss()\n * for exact validation. Used in async contexts (LSP, CLI).\n * - StaticValidator: Wraps pre-computed sets of base utilities and variant\n * names, strips variant prefixes recursively. Used in sync contexts (ESLint).\n *\n * Detection scans CSS file content for `@import \"tailwindcss` or `@theme`\n * directives to determine if Tailwind v4 is in use.\n */\nimport { dirname, join, sep } from \"node:path\"\nimport { existsSync } from \"node:fs\"\nimport { spawnSync } from \"node:child_process\"\nimport { Level, getRuntime } from \"@drskillissue/ganko-shared\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\n\n/**\n * Validates whether a CSS class name is a known Tailwind utility.\n *\n * Implementations are provided by callers depending on their execution\n * context (async vs sync). The CSSGraph stores this as an optional field\n * and the undefined-css-class rule falls back to it when `classNameIndex`\n * misses.\n */\nexport interface TailwindValidator {\n has(className: string): boolean\n\n /**\n * Resolves a Tailwind utility class to its generated CSS string.\n *\n * Returns the full CSS rule text (e.g. `.flex { display: flex; }`) or null\n * if the class is not a valid Tailwind utility or resolution is not supported\n * (e.g. in the sync/static validator path).\n */\n resolve(className: string): string | null\n}\n\n/**\n * Subset of Tailwind v4's DesignSystem API used for validation.\n *\n * Defined locally to avoid a hard dependency on `@tailwindcss/node`.\n * Structural typing ensures compatibility without type assertions.\n */\ninterface DesignSystem {\n candidatesToCss(classes: string[]): (string | null)[]\n getClassList(): [string, { modifiers: string[] }][]\n getVariants(): { name: string; values: string[]; hasDash: boolean; isArbitrary: boolean }[]\n}\n\n\n/**\n * Packages that depend on `@tailwindcss/node` and can be used as carriers\n * for transitive resolution when the package is not directly installable.\n *\n * Bun stores transitive dependencies in `.bun/` directories which are not\n * importable via bare specifiers. Resolving from a carrier package's\n * installed location allows `createRequire` to find `@tailwindcss/node`\n * through the carrier's own `node_modules`.\n */\nconst CARRIER_PACKAGES = [\"@tailwindcss/vite\", \"@tailwindcss/postcss\", \"@tailwindcss/cli\"]\n\n/**\n * Walk up from a directory to find the nearest directory containing package.json.\n * Used as fallback when no explicit project root is provided (ESLint plugin path).\n */\nfunction findNearestPackageRoot(startDir: string): string {\n let dir = startDir\n for (;;) {\n if (existsSync(join(dir, \"package.json\"))) return dir\n const parent = dirname(dir)\n if (parent === dir) return startDir\n dir = parent\n }\n}\n\n/** The entry point path within @tailwindcss/node */\nconst TAILWIND_NODE_ENTRY = join(\"@tailwindcss\", \"node\", \"dist\", \"index.js\")\n\n/**\n * Check a single search root for @tailwindcss/node.\n *\n * Tries direct installation first, then transitive installation\n * through each carrier package's own node_modules.\n *\n * @param searchRoot - Directory containing a node_modules folder\n * @returns Absolute path to @tailwindcss/node entry, or null\n */\nfunction probeForTailwindNode(searchRoot: string): string | null {\n const nmDir = join(searchRoot, \"node_modules\")\n\n const direct = join(nmDir, TAILWIND_NODE_ENTRY)\n if (existsSync(direct)) return direct\n\n for (let i = 0; i < CARRIER_PACKAGES.length; i++) {\n const carrier = CARRIER_PACKAGES[i]\n if (!carrier) continue\n const transitive = join(nmDir, carrier.replace(\"/\", sep), \"node_modules\", TAILWIND_NODE_ENTRY)\n if (existsSync(transitive)) return transitive\n }\n\n return null\n}\n\n/**\n * Resolve the absolute path to `@tailwindcss/node` from known workspace roots.\n *\n * Uses direct filesystem existence checks — no `createRequire`, which is\n * broken in Bun-compiled binaries. Searches the project root first, then\n * each workspace package root. Does NOT walk up past the project root.\n *\n * @param rootPath - Project root directory (contains the top-level node_modules)\n * @param workspacePackagePaths - Workspace package directories to search\n * @returns Resolved absolute path to @tailwindcss/node entry, or null\n */\nfunction resolveTailwindNodePath(\n rootPath: string,\n workspacePackagePaths: readonly string[],\n): string | null {\n const fromRoot = probeForTailwindNode(rootPath)\n if (fromRoot !== null) return fromRoot\n\n for (let i = 0; i < workspacePackagePaths.length; i++) {\n const wsPath = workspacePackagePaths[i]\n if (!wsPath) continue\n const fromWs = probeForTailwindNode(wsPath)\n if (fromWs !== null) return fromWs\n }\n\n return null\n}\n\n/**\n * Creates a TailwindValidator backed by a live DesignSystem.\n *\n * Uses `candidatesToCss()` for exact validation — handles arbitrary values,\n * compound variants, and modifier syntax. Results are cached per class name.\n */\nexport function createLiveValidator(design: DesignSystem): TailwindValidator {\n const cache = new Map<string, string | null>()\n\n function resolveFromDesign(className: string): string | null {\n const cached = cache.get(className)\n if (cached !== undefined) return cached\n const result = design.candidatesToCss([className])\n const css = result[0] ?? null\n cache.set(className, css)\n return css\n }\n\n return {\n has(className) {\n return resolveFromDesign(className) !== null\n },\n resolve(className) {\n return resolveFromDesign(className)\n },\n }\n}\n\n/**\n * Creates a TailwindValidator from pre-computed utility and variant sets.\n *\n * Variant-prefixed classes (e.g. `md:flex`, `hover:bg-red-500`) are\n * validated by stripping known variant prefixes and checking the base\n * utility. Handles compound variants (`sm:hover:flex`) via recursion.\n */\nexport function createStaticValidator(\n utilities: ReadonlySet<string>,\n variants: ReadonlySet<string>,\n): TailwindValidator {\n const cache = new Map<string, boolean>()\n\n function check(className: string): boolean {\n const cached = cache.get(className)\n if (cached !== undefined) return cached\n\n if (utilities.has(className)) {\n cache.set(className, true)\n return true\n }\n\n const colon = className.indexOf(\":\")\n if (colon === -1) {\n cache.set(className, false)\n return false\n }\n\n const prefix = className.substring(0, colon)\n const rest = className.substring(colon + 1)\n\n if (!variants.has(prefix)) {\n cache.set(className, false)\n return false\n }\n\n const valid = check(rest)\n cache.set(className, valid)\n return valid\n }\n\n return {\n has: check,\n resolve() {\n /* Static validators cannot resolve CSS — they only have pre-computed\n utility/variant name sets without access to the DesignSystem. CSS\n resolution is only available in async (CLI/LSP) contexts. */\n return null\n },\n }\n}\n\n/** Regex matching Tailwind v4 import directives. */\nconst TAILWIND_IMPORT = /@import\\s+[\"']tailwindcss/\n\n/** Regex matching Tailwind v4 @theme blocks. */\nconst TAILWIND_THEME = /@theme\\s*\\{/\n\n/**\n * Detects the Tailwind CSS v4 entry file from a list of CSS files.\n *\n * Prioritizes files with `@import \"tailwindcss` directives — these are\n * the actual entry points that load the full design system. Falls back\n * to files containing `@theme` blocks only if no import-based entry is\n * found, since `@theme`-only files are typically partials (e.g. colors)\n * that cannot initialize the design system on their own.\n *\n * @param files - CSS files with their content\n * @returns The entry file, or null if no Tailwind markers are found\n */\nexport function detectTailwindEntry(\n files: readonly { path: string; content: string }[],\n): { path: string; content: string } | null {\n let themeOnlyFallback: { path: string; content: string } | null = null\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i]\n if (!file) continue\n if (TAILWIND_IMPORT.test(file.content)) return file\n if (themeOnlyFallback === null && TAILWIND_THEME.test(file.content)) {\n themeOnlyFallback = file\n }\n }\n\n return themeOnlyFallback\n}\n\n/**\n * Resolves a TailwindValidator from CSS files by detecting Tailwind v4\n * and loading the design system via `@tailwindcss/node`.\n *\n * Handles projects where `@tailwindcss/node` is a transitive dependency\n * (e.g. installed via `@tailwindcss/vite`) by resolving through carrier\n * packages when direct import fails.\n *\n * Returns null if:\n * - No Tailwind entry file is detected\n * - `@tailwindcss/node` is not installed (directly or transitively)\n * - The design system fails to load\n */\n/**\n * Preparation result for Tailwind resolution.\n *\n * Contains the data needed by the WorkspaceEvaluator subprocess to load the\n * design system. The caller passes these fields to evaluateWorkspace().\n */\nexport interface TailwindEvalParams {\n readonly modulePath: string\n readonly entryCss: string\n readonly entryBase: string\n}\n\n/**\n * Prepare Tailwind evaluation parameters from CSS files.\n *\n * Detects the Tailwind entry file and resolves the @tailwindcss/node module\n * path. Returns null if no entry is detected or the module is not installed.\n * Does NOT spawn a subprocess — the caller does that via WorkspaceEvaluator.\n *\n * @param files - CSS files with content\n * @param rootPath - Project root for module resolution\n * @param workspacePackagePaths - Workspace package paths for module resolution\n * @param logger - Logger\n * @returns Evaluation parameters, or null\n */\nexport function prepareTailwindEval(\n files: readonly { path: string; content: string }[],\n rootPath: string,\n workspacePackagePaths: readonly string[],\n logger?: Logger,\n): TailwindEvalParams | null {\n const entry = detectTailwindEntry(files)\n if (!entry) {\n logger?.info(\"tailwind: no entry file detected (no @import \\\"tailwindcss\\\" or @theme block found in CSS files)\")\n return null\n }\n\n logger?.info(`tailwind: entry file detected: ${entry.path}`)\n\n const modulePath = resolveTailwindNodePath(rootPath, workspacePackagePaths)\n if (modulePath === null) {\n logger?.warning(`tailwind: @tailwindcss/node not resolvable in project root or workspace packages`)\n return null\n }\n\n logger?.info(`tailwind: @tailwindcss/node resolved to ${modulePath}`)\n return { modulePath, entryCss: entry.content, entryBase: dirname(entry.path) }\n}\n\n/**\n * A TailwindValidator with a preloadable batch cache for arbitrary value classes.\n *\n * The static validator handles known utility/variant combinations.\n * Arbitrary values (min-h-[60vh], max-w-[360px], [&_[data-slot]]:hidden, etc.)\n * are not in the static set. The caller collects all class names that will be\n * checked, sends them to candidatesToCss in one batch via the WorkspaceEvaluator,\n * and preloads the results before rule execution.\n */\nexport interface BatchableTailwindValidator extends TailwindValidator {\n preloadBatch(classNames: readonly string[], results: readonly boolean[]): void\n}\n\n/**\n * Build a TailwindValidator from evaluation results with batch preloading.\n *\n * @param utilities - Utility class names from the design system\n * @param variants - Variant definitions from the design system\n * @param logger - Logger\n * @returns BatchableTailwindValidator\n */\nexport function buildTailwindValidatorFromEval(\n utilities: readonly string[],\n variants: readonly { name: string; values: string[]; hasDash: boolean; isArbitrary: boolean }[],\n logger?: Logger,\n): BatchableTailwindValidator {\n const utilitySet = new Set(utilities)\n const variantSet = expandVariants(variants as { name: string; values: string[]; hasDash: boolean; isArbitrary: boolean }[])\n logger?.info(`tailwind: design system loaded (${utilitySet.size} utilities, ${variantSet.size} variants)`)\n\n const staticValidator = createStaticValidator(utilitySet, variantSet)\n const batchCache = new Map<string, boolean>()\n\n return {\n has(className: string): boolean {\n if (staticValidator.has(className)) return true\n const cached = batchCache.get(className)\n if (cached !== undefined) return cached\n return false\n },\n resolve(): string | null {\n return null\n },\n preloadBatch(classNames: readonly string[], results: readonly boolean[]): void {\n for (let i = 0; i < classNames.length; i++) {\n const name = classNames[i]\n const valid = results[i]\n if (name !== undefined && valid !== undefined) {\n batchCache.set(name, valid)\n }\n }\n if (logger?.isLevelEnabled(Level.Debug)) {\n let validCount = 0\n for (let i = 0; i < results.length; i++) {\n if (results[i]) validCount++\n }\n logger.debug(`tailwind: preloaded ${classNames.length} candidates (${validCount} valid)`)\n }\n },\n }\n}\n\n/**\n * Builds variant name sets from a DesignSystem's getVariants() output.\n *\n * For variants with values (e.g. `aria-checked`, `data-active`), expands\n * them into concrete prefixes: `aria-checked`, `data-active`, etc.\n */\nfunction expandVariants(\n raw: { name: string; values: string[]; hasDash: boolean; isArbitrary: boolean }[],\n): Set<string> {\n const variants = new Set<string>()\n for (let i = 0; i < raw.length; i++) {\n const v = raw[i]\n if (!v) continue\n variants.add(v.name)\n const values = v.values\n for (let j = 0; j < values.length; j++) {\n const val = values[j]\n if (val === undefined) continue\n variants.add(v.hasDash ? v.name + \"-\" + val : v.name + val)\n }\n }\n return variants\n}\n\n/**\n * Resolves a TailwindValidator synchronously by spawning a subprocess.\n *\n * Resolves the absolute path to `@tailwindcss/node` in the parent process\n * (including transitive resolution through carrier packages), then passes\n * that path to the subprocess so it can import from the exact location.\n *\n * Returns null if:\n * - No Tailwind entry file is detected\n * - The subprocess fails\n * - `@tailwindcss/node` is not available (directly or transitively)\n */\n/**\n * Resolve a TailwindValidator synchronously.\n *\n * Prepares the evaluation parameters and delegates to a caller-provided\n * sync evaluator function. The evaluator is responsible for spawning the\n * subprocess — this function handles detection, path resolution, and\n * validator construction.\n *\n * @param files - CSS files with content\n * @param syncEvaluator - Function that evaluates tailwind params and returns utilities/variants\n * @param rootPath - Project root (optional, walks up to package.json if not provided)\n * @param workspacePackagePaths - Workspace package paths (optional)\n * @returns TailwindValidator, or null\n */\n/**\n * Default sync evaluator — spawns a Bun subprocess to load the design system.\n *\n * Used by ESLint plugin and runner paths that don't have access to the\n * WorkspaceEvaluator from the LSP package.\n *\n * @param params - Tailwind evaluation parameters\n * @returns Utilities and variants, or null\n */\nfunction defaultSyncEvaluator(\n params: TailwindEvalParams,\n): { utilities: string[]; variants: { name: string; values: string[]; hasDash: boolean; isArbitrary: boolean }[] } | null {\n const script = [\n `const { __unstable__loadDesignSystem } = await import(${JSON.stringify(params.modulePath)});`,\n `const d = await __unstable__loadDesignSystem(`,\n ` ${JSON.stringify(params.entryCss)},`,\n ` { base: ${JSON.stringify(params.entryBase)} }`,\n `);`,\n `const u = d.getClassList().map(e => e[0]);`,\n `const v = d.getVariants().map(v => ({`,\n ` name: v.name,`,\n ` values: v.values ?? [],`,\n ` hasDash: v.hasDash ?? false,`,\n ` isArbitrary: v.isArbitrary ?? false,`,\n `}));`,\n `process.stdout.write(JSON.stringify({ u, v }));`,\n ].join(\"\\n\")\n\n try {\n const result = spawnSync(getRuntime(), [\"-e\", script], { cwd: params.entryBase, encoding: \"utf-8\", timeout: 30000 })\n if (result.status !== 0) return null\n const text = typeof result.stdout === \"string\" ? result.stdout : String(result.stdout ?? \"\")\n if (text.length === 0) return null\n const data = JSON.parse(text)\n return { utilities: data.u, variants: data.v }\n } catch {\n return null\n }\n}\n\n/**\n * Resolve a TailwindValidator synchronously.\n *\n * Uses the default Bun subprocess evaluator unless a custom one is provided.\n *\n * @param files - CSS files with content\n * @param rootPath - Project root (optional, walks up to package.json if not provided)\n * @param workspacePackagePaths - Workspace package paths (optional)\n * @returns TailwindValidator, or null\n */\nexport function resolveTailwindValidatorSync(\n files: readonly { path: string; content: string }[],\n rootPath?: string,\n workspacePackagePaths?: readonly string[],\n): BatchableTailwindValidator | null {\n const effectiveRoot = rootPath ?? findNearestPackageRoot(dirname(files[0]?.path ?? \".\"))\n const params = prepareTailwindEval(files, effectiveRoot, workspacePackagePaths ?? [])\n if (params === null) return null\n\n const result = defaultSyncEvaluator(params)\n if (result === null) return null\n\n return buildTailwindValidatorFromEval(result.utilities, result.variants)\n}\n","/**\n * Accessibility Policy Templates\n *\n * Predefined bundles of sizing, spacing, and contrast constraints\n * derived from WCAG 2.2, Material Design 3, Apple HIG, and\n * W3C Low Vision Needs.\n */\n\nimport { ACCESSIBILITY_POLICIES, type AccessibilityPolicy } from \"@drskillissue/ganko-shared\"\n\n/** All enforceable thresholds for a single policy template. */\nexport interface PolicyThresholds {\n readonly minBodyFontSize: number\n readonly minCaptionFontSize: number\n readonly minButtonFontSize: number\n readonly minHeadingFontSize: number\n readonly minLineHeight: number\n readonly minHeadingLineHeight: number\n\n readonly minButtonHeight: number\n readonly minButtonWidth: number\n readonly minTouchTarget: number\n readonly minButtonHorizontalPadding: number\n readonly minInputHeight: number\n\n readonly minParagraphSpacing: number\n readonly minLetterSpacing: number\n readonly minWordSpacing: number\n\n readonly minContrastNormalText: number\n readonly minContrastLargeText: number\n readonly minContrastUIComponents: number\n readonly largeTextThreshold: number\n\n readonly minReflowWidth: number\n readonly minTextScaling: number\n}\n\n/** Named policy template identifiers. Re-exported from shared. */\nexport type PolicyName = AccessibilityPolicy\n\n/** WCAG 2.2 Level AA — the legal compliance baseline. */\nconst WCAG_AA: PolicyThresholds = {\n minBodyFontSize: 16,\n minCaptionFontSize: 12,\n minButtonFontSize: 14,\n minHeadingFontSize: 16,\n minLineHeight: 1.5,\n minHeadingLineHeight: 1.2,\n minButtonHeight: 24,\n minButtonWidth: 24,\n minTouchTarget: 24,\n minButtonHorizontalPadding: 8,\n minInputHeight: 24,\n minParagraphSpacing: 2.0,\n minLetterSpacing: 0.12,\n minWordSpacing: 0.16,\n minContrastNormalText: 4.5,\n minContrastLargeText: 3.0,\n minContrastUIComponents: 3.0,\n largeTextThreshold: 24,\n minReflowWidth: 320,\n minTextScaling: 200,\n}\n\n/** WCAG 2.2 Level AAA — enhanced contrast and 44px touch targets. */\nconst WCAG_AAA: PolicyThresholds = {\n minBodyFontSize: 16,\n minCaptionFontSize: 12,\n minButtonFontSize: 14,\n minHeadingFontSize: 16,\n minLineHeight: 1.5,\n minHeadingLineHeight: 1.2,\n minButtonHeight: 44,\n minButtonWidth: 44,\n minTouchTarget: 44,\n minButtonHorizontalPadding: 12,\n minInputHeight: 44,\n minParagraphSpacing: 2.0,\n minLetterSpacing: 0.12,\n minWordSpacing: 0.16,\n minContrastNormalText: 7.0,\n minContrastLargeText: 4.5,\n minContrastUIComponents: 3.0,\n largeTextThreshold: 24,\n minReflowWidth: 320,\n minTextScaling: 200,\n}\n\n/** Touch-optimized mobile — Apple HIG + Material Design 3 48dp targets. */\nconst MOBILE_FIRST: PolicyThresholds = {\n minBodyFontSize: 16,\n minCaptionFontSize: 12,\n minButtonFontSize: 16,\n minHeadingFontSize: 18,\n minLineHeight: 1.5,\n minHeadingLineHeight: 1.3,\n minButtonHeight: 48,\n minButtonWidth: 48,\n minTouchTarget: 48,\n minButtonHorizontalPadding: 16,\n minInputHeight: 48,\n minParagraphSpacing: 2.0,\n minLetterSpacing: 0.12,\n minWordSpacing: 0.16,\n minContrastNormalText: 4.5,\n minContrastLargeText: 3.0,\n minContrastUIComponents: 3.0,\n largeTextThreshold: 24,\n minReflowWidth: 320,\n minTextScaling: 200,\n}\n\n/** Data-dense desktop — dashboards, admin panels, IDEs. */\nconst DENSE_UI: PolicyThresholds = {\n minBodyFontSize: 13,\n minCaptionFontSize: 11,\n minButtonFontSize: 12,\n minHeadingFontSize: 14,\n minLineHeight: 1.4,\n minHeadingLineHeight: 1.15,\n minButtonHeight: 24,\n minButtonWidth: 24,\n minTouchTarget: 24,\n minButtonHorizontalPadding: 4,\n minInputHeight: 24,\n minParagraphSpacing: 1.5,\n minLetterSpacing: 0.05,\n minWordSpacing: 0.08,\n minContrastNormalText: 4.5,\n minContrastLargeText: 3.0,\n minContrastUIComponents: 3.0,\n largeTextThreshold: 24,\n minReflowWidth: 320,\n minTextScaling: 200,\n}\n\n/** Low vision / elderly — exceeds AAA, based on APH large print guidelines. */\nconst LARGE_TEXT: PolicyThresholds = {\n minBodyFontSize: 24,\n minCaptionFontSize: 18,\n minButtonFontSize: 20,\n minHeadingFontSize: 24,\n minLineHeight: 1.8,\n minHeadingLineHeight: 1.5,\n minButtonHeight: 48,\n minButtonWidth: 48,\n minTouchTarget: 48,\n minButtonHorizontalPadding: 20,\n minInputHeight: 48,\n minParagraphSpacing: 2.5,\n minLetterSpacing: 0.16,\n minWordSpacing: 0.24,\n minContrastNormalText: 10.0,\n minContrastLargeText: 7.0,\n minContrastUIComponents: 4.5,\n largeTextThreshold: 24,\n minReflowWidth: 320,\n minTextScaling: 400,\n}\n\n/** All named policy templates. */\nexport const POLICIES: Readonly<Record<PolicyName, PolicyThresholds>> = {\n \"wcag-aa\": WCAG_AA,\n \"wcag-aaa\": WCAG_AAA,\n \"mobile-first\": MOBILE_FIRST,\n \"dense-ui\": DENSE_UI,\n \"large-text\": LARGE_TEXT,\n}\n\n/** Active policy name. Null when no policy is set. */\nlet activePolicyName: PolicyName | null = null\n\n/** Set the active policy for all policy rules. Pass null to disable. */\nexport function setActivePolicy(name: string | null): void {\n if (name === null) {\n activePolicyName = null\n return\n }\n const match = ACCESSIBILITY_POLICIES.find(n => n === name)\n if (match) {\n activePolicyName = match\n }\n}\n\n/** Get the active policy name. Null when no policy is set. */\nexport function getActivePolicyName(): PolicyName | null {\n return activePolicyName\n}\n\n/** Resolve a policy name to its thresholds. Defaults to wcag-aa. */\nexport function resolvePolicy(name: string): PolicyThresholds {\n const match = ACCESSIBILITY_POLICIES.find(n => n === name)\n if (match) return POLICIES[match]\n return WCAG_AA\n}\n\n/** Get the active policy thresholds. Null when no policy is set. */\nexport function getActivePolicy(): PolicyThresholds | null {\n if (activePolicyName === null) return null\n return POLICIES[activePolicyName]\n}\n","import type { SelectorEntity } from \"../../css/entities/selector\"\nimport type {\n TailwindParsedCandidate,\n TailwindResolvedDeclaration,\n TailwindCandidateDiagnostic,\n} from \"../providers/tailwind\"\n\nexport interface CSSClassNameSource {\n readonly kind: \"css\"\n readonly selectors: readonly SelectorEntity[]\n readonly filePaths: readonly string[]\n}\n\nexport interface TailwindClassNameSource {\n readonly kind: \"tailwind\"\n readonly candidate: TailwindParsedCandidate\n readonly resolvedCSS: string | null\n readonly declarations: readonly TailwindResolvedDeclaration[]\n readonly diagnostics: readonly TailwindCandidateDiagnostic[]\n}\n\nexport type ClassNameSource = CSSClassNameSource | TailwindClassNameSource\n\nexport interface ClassNameSymbol {\n readonly symbolKind: \"className\"\n readonly name: string\n readonly filePath: string | null\n readonly source: ClassNameSource\n}\n\nexport function createClassNameSymbol(\n name: string,\n selectors: readonly SelectorEntity[],\n filePaths: readonly string[],\n): ClassNameSymbol {\n return {\n symbolKind: \"className\",\n name,\n filePath: filePaths.length > 0 ? (filePaths[0] ?? null) : null,\n source: {\n kind: \"css\",\n selectors,\n filePaths,\n },\n }\n}\n","/**\n * Selector symbol + compiled matcher.\n *\n * compileSelectorMatcher moved from cross-file/layout/selector-match.ts.\n */\nimport type { SelectorEntity, SelectorAttributeConstraint, SelectorCompound, NthPattern, CombinatorType } from \"../../css/entities/selector\"\nimport { PseudoConstraintKind } from \"../../css/entities\"\n\n// ── Compiled matcher types ───────────────────────────────────────────────\n\ninterface CompoundPseudoConstraints {\n readonly firstChild: boolean\n readonly lastChild: boolean\n readonly onlyChild: boolean\n readonly nthChild: NthPattern | null\n readonly nthLastChild: NthPattern | null\n readonly nthOfType: NthPattern | null\n readonly nthLastOfType: NthPattern | null\n readonly anyOfGroups: readonly (readonly CompiledSelectorCompound[])[]\n readonly noneOfGroups: readonly (readonly CompiledSelectorCompound[])[]\n}\n\ninterface CompiledSelectorCompound {\n readonly tagName: string | null\n readonly idValue: string | null\n readonly classes: readonly string[]\n readonly attributes: readonly SelectorAttributeConstraint[]\n readonly pseudo: CompoundPseudoConstraints\n}\n\nexport interface SelectorSubjectConstraintSummary {\n readonly idValue: string | null\n readonly classes: readonly string[]\n readonly attributeNames: readonly string[]\n readonly hasStructuralPseudo: boolean\n}\n\nexport interface SelectorFeatureRequirements {\n readonly needsClassTokens: boolean\n readonly needsAttributes: boolean\n}\n\nexport interface CompiledSelectorMatcher {\n readonly subjectTag: string | null\n readonly subject: SelectorSubjectConstraintSummary\n readonly requirements: SelectorFeatureRequirements\n readonly compoundsRightToLeft: readonly CompiledSelectorCompound[]\n readonly combinatorsRightToLeft: readonly CombinatorType[]\n}\n\n\n// ── SelectorSymbol ───────────────────────────────────────────────────────\n\nexport interface SelectorSymbol {\n readonly symbolKind: \"selector\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: SelectorEntity\n readonly specificity: readonly [number, number, number]\n readonly dispatchKeys: readonly string[]\n readonly compiledMatcher: CompiledSelectorMatcher | null\n}\n\nexport function createSelectorSymbol(entity: SelectorEntity, filePath: string): SelectorSymbol {\n const matcher = compileSelectorMatcher(entity)\n\n let dispatchKeys: string[]\n if (matcher !== null) {\n const subject = matcher.subject\n const keySet = new Set<string>()\n\n if (subject.idValue !== null) {\n keySet.add(`id:${subject.idValue}`)\n }\n\n const classes = subject.classes\n for (let i = 0; i < classes.length; i++) {\n const cls = classes[i]\n if (cls !== undefined) keySet.add(`class:${cls}`)\n }\n\n const attributeNames = subject.attributeNames\n for (let i = 0; i < attributeNames.length; i++) {\n const attr = attributeNames[i]\n if (attr !== undefined) keySet.add(`attr:${attr}`)\n }\n\n dispatchKeys = Array.from(keySet).toSorted()\n } else {\n dispatchKeys = []\n }\n\n return {\n symbolKind: \"selector\",\n name: entity.raw,\n filePath,\n entity,\n specificity: [entity.specificity[1], entity.specificity[2], entity.specificity[3]],\n dispatchKeys,\n compiledMatcher: matcher,\n }\n}\n\n\n// ── compileSelectorMatcher ───────────────────────────────────────────────\n\nconst STATEFUL_PSEUDO_CLASSES = new Set<string>([\n \"active\", \"checked\", \"default\", \"disabled\", \"enabled\",\n \"focus\", \"focus-visible\", \"focus-within\", \"hover\", \"indeterminate\",\n \"invalid\", \"link\", \"optional\", \"placeholder-shown\", \"read-only\",\n \"read-write\", \"required\", \"target\", \"user-invalid\", \"valid\", \"visited\",\n])\n\nconst EMPTY_PSEUDO: CompoundPseudoConstraints = {\n firstChild: false, lastChild: false, onlyChild: false,\n nthChild: null, nthLastChild: null, nthOfType: null, nthLastOfType: null,\n anyOfGroups: [], noneOfGroups: [],\n}\n\nexport function compileSelectorMatcher(selector: SelectorEntity): CompiledSelectorMatcher | null {\n const selectorCompounds = selector.compounds\n if (selectorCompounds.length === 0) return null\n\n const compoundsLeftToRight: CompiledSelectorCompound[] = []\n\n for (let i = 0; i < selectorCompounds.length; i++) {\n const sc = selectorCompounds[i]\n if (sc === undefined) continue\n const compiled = buildCompiledCompound(sc)\n if (compiled === null) return null\n compoundsLeftToRight.push(compiled)\n }\n\n if (compoundsLeftToRight.length === 0) return null\n\n const subject = compoundsLeftToRight[compoundsLeftToRight.length - 1]\n if (subject === undefined) return null\n\n return {\n subjectTag: subject.tagName,\n subject: {\n idValue: subject.idValue,\n classes: subject.classes,\n attributeNames: collectSubjectAttributeNames(subject),\n hasStructuralPseudo: hasStructuralPseudoConstraints(subject),\n },\n requirements: resolveFeatureRequirements(compoundsLeftToRight),\n compoundsRightToLeft: compoundsLeftToRight.toReversed(),\n combinatorsRightToLeft: selector.combinators.toReversed(),\n }\n}\n\nfunction buildCompiledCompound(sc: SelectorCompound): CompiledSelectorCompound | null {\n const parts = sc.parts\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part) continue\n if (part.type === \"pseudo-element\") return null\n }\n\n const pseudoConstraints = sc.pseudoClasses\n if (pseudoConstraints.length === 0) {\n return {\n tagName: sc.tagName, idValue: sc.idValue, classes: sc.classes,\n attributes: sc.attributes, pseudo: EMPTY_PSEUDO,\n }\n }\n\n let firstChild = false\n let lastChild = false\n let onlyChild = false\n let nthChild: NthPattern | null = null\n let nthLastChild: NthPattern | null = null\n let nthOfType: NthPattern | null = null\n let nthLastOfType: NthPattern | null = null\n const anyOfGroups: (readonly CompiledSelectorCompound[])[] = []\n const noneOfGroups: (readonly CompiledSelectorCompound[])[] = []\n\n for (let i = 0; i < pseudoConstraints.length; i++) {\n const pc = pseudoConstraints[i]\n if (!pc) continue\n if (pc.kind === PseudoConstraintKind.Simple) { if (STATEFUL_PSEUDO_CLASSES.has(pc.name)) return null; continue }\n if (pc.kind === PseudoConstraintKind.FirstChild) { firstChild = true; continue }\n if (pc.kind === PseudoConstraintKind.LastChild) { lastChild = true; continue }\n if (pc.kind === PseudoConstraintKind.OnlyChild) { firstChild = true; lastChild = true; onlyChild = true; continue }\n if (pc.kind === PseudoConstraintKind.NthChild) { if (!pc.nthPattern) return null; nthChild = pc.nthPattern; continue }\n if (pc.kind === PseudoConstraintKind.NthLastChild) { if (!pc.nthPattern) return null; nthLastChild = pc.nthPattern; continue }\n if (pc.kind === PseudoConstraintKind.NthOfType) { if (!pc.nthPattern) return null; nthOfType = pc.nthPattern; continue }\n if (pc.kind === PseudoConstraintKind.NthLastOfType) { if (!pc.nthPattern) return null; nthLastOfType = pc.nthPattern; continue }\n if (pc.kind === PseudoConstraintKind.MatchesAny) {\n if (pc.nestedCompounds && pc.nestedCompounds.length > 0) {\n const group = buildNestedGroup(pc.nestedCompounds)\n if (group === null) return null\n if (group.length > 0) anyOfGroups.push(group)\n }\n continue\n }\n if (pc.kind === PseudoConstraintKind.NoneOf) {\n if (pc.nestedCompounds && pc.nestedCompounds.length > 0) {\n const group = buildNestedGroup(pc.nestedCompounds)\n if (group === null) return null\n if (group.length > 0) noneOfGroups.push(group)\n }\n continue\n }\n }\n\n return {\n tagName: sc.tagName, idValue: sc.idValue, classes: sc.classes, attributes: sc.attributes,\n pseudo: { firstChild, lastChild, onlyChild, nthChild, nthLastChild, nthOfType, nthLastOfType, anyOfGroups, noneOfGroups },\n }\n}\n\nfunction buildNestedGroup(nestedCompounds: readonly SelectorCompound[][]): readonly CompiledSelectorCompound[] | null {\n const out: CompiledSelectorCompound[] = []\n for (let i = 0; i < nestedCompounds.length; i++) {\n const compoundGroup = nestedCompounds[i]\n if (!compoundGroup) continue\n if (compoundGroup.length !== 1) continue\n const sc = compoundGroup[0]\n if (!sc) continue\n const compiled = buildCompiledCompound(sc)\n if (compiled === null) return null\n out.push(compiled)\n }\n return out\n}\n\nfunction collectSubjectAttributeNames(subject: CompiledSelectorCompound): readonly string[] {\n if (subject.attributes.length === 0) return []\n const names = new Set<string>()\n for (let i = 0; i < subject.attributes.length; i++) {\n const attr = subject.attributes[i]\n if (attr === undefined) continue\n names.add(attr.name)\n }\n return [...names]\n}\n\nfunction hasStructuralPseudoConstraints(subject: CompiledSelectorCompound): boolean {\n const pseudo = subject.pseudo\n return pseudo.firstChild || pseudo.lastChild || pseudo.onlyChild\n || pseudo.nthChild !== null || pseudo.nthLastChild !== null\n || pseudo.nthOfType !== null || pseudo.nthLastOfType !== null\n}\n\nfunction resolveFeatureRequirements(compounds: readonly CompiledSelectorCompound[]): SelectorFeatureRequirements {\n let needsClassTokens = false\n let needsAttributes = false\n for (let i = 0; i < compounds.length; i++) {\n const compound = compounds[i]\n if (compound === undefined) continue\n if (!needsClassTokens && compoundNeedsClassTokens(compound)) needsClassTokens = true\n if (!needsAttributes && compoundNeedsAttributes(compound)) needsAttributes = true\n if (needsClassTokens && needsAttributes) break\n }\n return { needsClassTokens, needsAttributes }\n}\n\nfunction compoundNeedsClassTokens(compound: CompiledSelectorCompound): boolean {\n if (compound.classes.length > 0) return true\n const pseudo = compound.pseudo\n if (compoundGroupNeedsClassTokens(pseudo.anyOfGroups)) return true\n if (compoundGroupNeedsClassTokens(pseudo.noneOfGroups)) return true\n return false\n}\n\nfunction compoundGroupNeedsClassTokens(groups: readonly (readonly CompiledSelectorCompound[])[]): boolean {\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i]\n if (group === undefined) continue\n for (let j = 0; j < group.length; j++) {\n const compound = group[j]\n if (compound === undefined) continue\n if (compoundNeedsClassTokens(compound)) return true\n }\n }\n return false\n}\n\nfunction compoundNeedsAttributes(compound: CompiledSelectorCompound): boolean {\n if (compound.idValue !== null) return true\n if (compound.attributes.length > 0) return true\n const pseudo = compound.pseudo\n if (compoundGroupNeedsAttributes(pseudo.anyOfGroups)) return true\n if (compoundGroupNeedsAttributes(pseudo.noneOfGroups)) return true\n return false\n}\n\nfunction compoundGroupNeedsAttributes(groups: readonly (readonly CompiledSelectorCompound[])[]): boolean {\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i]\n if (group === undefined) continue\n for (let j = 0; j < group.length; j++) {\n const compound = group[j]\n if (compound === undefined) continue\n if (compoundNeedsAttributes(compound)) return true\n }\n }\n return false\n}\n","import type { DeclarationEntity } from \"../../css/entities/declaration\"\n\nexport interface DeclarationSymbol {\n readonly symbolKind: \"declaration\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: DeclarationEntity\n readonly sourceOrder: number\n readonly layerOrder: number\n}\n\nexport function createDeclarationSymbol(\n entity: DeclarationEntity,\n filePath: string,\n sourceOrder: number,\n layerOrder: number,\n): DeclarationSymbol {\n return {\n symbolKind: \"declaration\",\n name: entity.property,\n filePath,\n entity,\n sourceOrder,\n layerOrder,\n }\n}\n","import type { VariableEntity, VariableReferenceEntity } from \"../../css/entities/variable\"\nimport { hasFlag, VAR_IS_GLOBAL, VAR_IS_SCSS } from \"../../css/entities\"\n\nexport interface CustomPropertySymbol {\n readonly symbolKind: \"customProperty\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: VariableEntity\n readonly isGlobal: boolean\n readonly isScss: boolean\n readonly references: readonly VariableReferenceEntity[]\n readonly resolvedValue: string | null\n}\n\nexport function createCustomPropertySymbol(\n entity: VariableEntity,\n filePath: string,\n): CustomPropertySymbol {\n return {\n symbolKind: \"customProperty\",\n name: entity.name,\n filePath,\n entity,\n isGlobal: hasFlag(entity._flags, VAR_IS_GLOBAL),\n isScss: hasFlag(entity._flags, VAR_IS_SCSS),\n references: [], // Phase 5+: cross-file reference wiring happens during semantic model binding\n resolvedValue: entity.computedValue ?? null,\n }\n}\n","import type { AtRuleEntity } from \"../../css/entities/at-rule\"\nimport type { DeclarationEntity } from \"../../css/entities/declaration\"\n\nexport interface KeyframeLayoutMutation {\n readonly property: string\n readonly values: readonly string[]\n readonly declarations: readonly DeclarationEntity[]\n}\n\nexport interface KeyframesSymbol {\n readonly symbolKind: \"keyframes\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: AtRuleEntity\n readonly layoutMutations: readonly KeyframeLayoutMutation[]\n}\n\nexport function createKeyframesSymbol(\n entity: AtRuleEntity,\n name: string,\n filePath: string,\n layoutMutations: readonly KeyframeLayoutMutation[],\n): KeyframesSymbol {\n return {\n symbolKind: \"keyframes\",\n name,\n filePath,\n entity,\n layoutMutations,\n }\n}\n","import type { AtRuleEntity } from \"../../css/entities/at-rule\"\n\nexport interface FontFaceSymbol {\n readonly symbolKind: \"fontFace\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: AtRuleEntity\n readonly family: string\n readonly display: string | null\n readonly hasWebFontSource: boolean\n readonly hasEffectiveMetricOverrides: boolean\n}\n\nexport function createFontFaceSymbol(\n entity: AtRuleEntity,\n family: string,\n filePath: string,\n display: string | null,\n hasWebFontSource: boolean,\n hasEffectiveMetricOverrides: boolean,\n): FontFaceSymbol {\n return {\n symbolKind: \"fontFace\",\n name: family,\n filePath,\n entity,\n family,\n display,\n hasWebFontSource,\n hasEffectiveMetricOverrides,\n }\n}\n","import type { AtRuleEntity } from \"../../css/entities/at-rule\"\n\nexport interface LayerSymbol {\n readonly symbolKind: \"layer\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: AtRuleEntity\n readonly order: number\n}\n\nexport function createLayerSymbol(\n entity: AtRuleEntity,\n name: string,\n filePath: string,\n order: number,\n): LayerSymbol {\n return {\n symbolKind: \"layer\",\n name,\n filePath,\n entity,\n order,\n }\n}\n","import type { DeclarationEntity } from \"../../css/entities/declaration\"\nimport type { AtRuleEntity } from \"../../css/entities/at-rule\"\n\nexport interface ContainerSymbol {\n readonly symbolKind: \"container\"\n readonly name: string\n readonly filePath: string | null\n readonly declarations: readonly DeclarationEntity[]\n readonly queries: readonly AtRuleEntity[]\n}\n\nexport function createContainerSymbol(\n name: string,\n declarations: readonly DeclarationEntity[],\n queries: readonly AtRuleEntity[],\n): ContainerSymbol {\n return {\n symbolKind: \"container\",\n name,\n filePath: null, // null because containers span multiple files (declarations and queries may be in different files)\n declarations,\n queries,\n }\n}\n","import type { ThemeTokenEntity } from \"../../css/entities/token\"\n\nexport interface ThemeTokenSymbol {\n readonly symbolKind: \"themeToken\"\n readonly name: string\n readonly filePath: string | null\n readonly entity: ThemeTokenEntity\n readonly category: string\n}\n\nexport function createThemeTokenSymbol(\n entity: ThemeTokenEntity,\n filePath: string,\n): ThemeTokenSymbol {\n return {\n symbolKind: \"themeToken\",\n name: entity.name,\n filePath,\n entity,\n category: entity.category,\n }\n}\n","import type { TailwindValidator } from \"../../css/tailwind\"\nimport type { SelectorEntity } from \"../../css/entities/selector\"\nimport type { DeclarationEntity } from \"../../css/entities/declaration\"\nimport type { RuleEntity } from \"../../css/entities/rule\"\nimport type { AtRuleEntity } from \"../../css/entities/at-rule\"\nimport type { VariableEntity } from \"../../css/entities/variable\"\nimport type { ThemeTokenEntity } from \"../../css/entities/token\"\nimport type { MixinEntity, SCSSFunctionEntity, PlaceholderEntity } from \"../../css/entities/scss\"\nimport type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\nimport type { ClassNameSymbol } from \"./class-name\"\nimport type { SelectorSymbol } from \"./selector\"\nimport type { DeclarationSymbol } from \"./declaration\"\nimport type { CustomPropertySymbol } from \"./custom-property\"\nimport type { KeyframesSymbol, KeyframeLayoutMutation } from \"./keyframes\"\nimport type { FontFaceSymbol } from \"./font-face\"\nimport type { LayerSymbol } from \"./layer\"\nimport type { ContainerSymbol } from \"./container\"\nimport type { ThemeTokenSymbol } from \"./theme-token\"\nimport type { ComponentHostSymbol } from \"./component-host\"\nimport { createClassNameSymbol } from \"./class-name\"\nimport { createSelectorSymbol } from \"./selector\"\nimport { createDeclarationSymbol } from \"./declaration\"\nimport { createCustomPropertySymbol } from \"./custom-property\"\nimport { createKeyframesSymbol } from \"./keyframes\"\nimport { createFontFaceSymbol } from \"./font-face\"\nimport { createLayerSymbol } from \"./layer\"\nimport { createContainerSymbol } from \"./container\"\nimport { createThemeTokenSymbol } from \"./theme-token\"\nimport {\n hasFlag,\n SEL_HAS_ID,\n SEL_HAS_ATTRIBUTE,\n SEL_HAS_UNIVERSAL,\n DECL_IS_IMPORTANT,\n VAR_IS_USED,\n MIXIN_IS_USED,\n SCSSFN_IS_USED,\n PLACEHOLDER_IS_USED,\n} from \"../../css/entities\"\nimport {\n LAYOUT_ANIMATION_MUTATION_PROPERTIES,\n LAYOUT_CLASS_GEOMETRY_PROPERTIES,\n} from \"../../css/layout-taxonomy\"\nimport {\n normalizeAnimationName,\n parseContainerNames,\n parseContainerNamesFromShorthand,\n parseContainerQueryName,\n CSS_WIDE_KEYWORDS,\n splitComma,\n} from \"../../css/parser/value-util\"\nimport { extractKeyframeNames } from \"@drskillissue/ganko-shared\"\n\nexport interface SymbolTable {\n readonly classNames: ReadonlyMap<string, ClassNameSymbol>\n readonly selectors: ReadonlyMap<number, SelectorSymbol>\n readonly customProperties: ReadonlyMap<string, CustomPropertySymbol>\n readonly componentHosts: ReadonlyMap<string, ComponentHostSymbol>\n readonly keyframes: ReadonlyMap<string, KeyframesSymbol>\n readonly fontFaces: ReadonlyMap<string, readonly FontFaceSymbol[]>\n readonly layers: ReadonlyMap<string, LayerSymbol>\n readonly containers: ReadonlyMap<string, ContainerSymbol>\n readonly themeTokens: ReadonlyMap<string, ThemeTokenSymbol>\n\n readonly selectorsByDispatchKey: ReadonlyMap<string, readonly SelectorSymbol[]>\n readonly selectorsBySubjectTag: ReadonlyMap<string, readonly SelectorSymbol[]>\n readonly selectorsWithoutSubjectTag: readonly SelectorSymbol[]\n\n readonly declarationsByProperty: ReadonlyMap<string, readonly DeclarationSymbol[]>\n declarationsForProperties(...properties: string[]): readonly DeclarationEntity[]\n\n readonly duplicateSelectors: ReadonlyMap<string, { readonly selector: string; readonly rules: readonly RuleEntity[] }>\n readonly multiDeclarationProperties: ReadonlyMap<string, readonly DeclarationEntity[]>\n readonly layoutPropertiesByClassToken: ReadonlyMap<string, readonly string[]>\n readonly usedFontFamilies: ReadonlySet<string>\n readonly usedFontFamiliesByRule: ReadonlyMap<number, readonly string[]>\n readonly idSelectors: readonly SelectorEntity[]\n readonly attributeSelectors: readonly SelectorEntity[]\n readonly universalSelectors: readonly SelectorEntity[]\n readonly selectorsTargetingCheckbox: readonly SelectorEntity[]\n readonly selectorsTargetingTableCell: readonly SelectorEntity[]\n readonly importantDeclarations: readonly DeclarationEntity[]\n readonly emptyRules: readonly RuleEntity[]\n readonly emptyKeyframes: readonly AtRuleEntity[]\n readonly deepNestedRules: readonly RuleEntity[]\n readonly overqualifiedSelectors: readonly SelectorEntity[]\n readonly unresolvedAnimationRefs: readonly { readonly declaration: DeclarationEntity; readonly name: string }[]\n readonly unknownContainerQueries: readonly AtRuleEntity[]\n readonly unusedContainerNames: ReadonlyMap<string, readonly DeclarationEntity[]>\n readonly keyframeDeclarations: readonly DeclarationEntity[]\n readonly tokensByCategory: ReadonlyMap<string, readonly ThemeTokenEntity[]>\n readonly mixinsByName: ReadonlyMap<string, MixinEntity>\n readonly functionsByName: ReadonlyMap<string, SCSSFunctionEntity>\n readonly placeholdersByName: ReadonlyMap<string, PlaceholderEntity>\n readonly unusedVariables: readonly VariableEntity[]\n readonly unusedKeyframes: readonly AtRuleEntity[]\n readonly unusedMixins: readonly MixinEntity[]\n readonly unusedFunctions: readonly SCSSFunctionEntity[]\n readonly unusedPlaceholders: readonly PlaceholderEntity[]\n readonly tokenCategories: readonly string[]\n\n hasClassName(name: string): boolean\n getClassName(name: string): ClassNameSymbol | null\n getSelectorsByClassName(name: string): readonly SelectorSymbol[]\n getCustomProperty(name: string): CustomPropertySymbol | null\n getKeyframes(name: string): KeyframesSymbol | null\n getFontFaces(family: string): readonly FontFaceSymbol[]\n getLayerOrder(name: string): number\n}\n\nconst EMPTY_SELECTOR_SYMBOLS: readonly SelectorSymbol[] = []\nconst EMPTY_FONT_FACE_SYMBOLS: readonly FontFaceSymbol[] = []\nconst FONT_LAYOUT_PROPERTIES = [\"font-family\"]\nconst FONT_GENERIC_FAMILIES = new Set([\n \"serif\", \"sans-serif\", \"monospace\", \"cursive\", \"fantasy\",\n \"system-ui\", \"ui-serif\", \"ui-sans-serif\", \"ui-monospace\", \"ui-rounded\",\n \"emoji\", \"math\", \"fangsong\",\n])\nconst WHITESPACE_RE = /\\s+/\n\nfunction normalizeCssValue(value: string): string {\n return value.trim().toLowerCase()\n}\n\nfunction firstDeclaration<T extends { readonly property: string }>(\n declarations: readonly T[],\n property: string,\n): T | null {\n const needle = property.toLowerCase()\n for (let i = 0; i < declarations.length; i++) {\n const decl = declarations[i]\n if (!decl) continue\n if (decl.property.toLowerCase() === needle) return decl\n }\n return null\n}\n\nfunction stripQuotes(value: string): string {\n if (value.length < 2) return value\n const first = value[0]\n const last = value[value.length - 1]\n if (first !== last) return value\n if (first !== \"\\\"\" && first !== \"'\") return value\n return value.slice(1, -1).trim()\n}\n\nfunction collapseWhitespace(value: string): string {\n const parts = value.split(WHITESPACE_RE)\n const out: string[] = []\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part || part.length === 0) continue\n out.push(part)\n }\n return out.join(\" \")\n}\n\nfunction normalizeFontFamily(raw: string): string | null {\n const trimmed = raw.trim()\n if (trimmed.length === 0) return null\n const unquoted = stripQuotes(trimmed)\n if (unquoted.length === 0) return null\n const normalized = collapseWhitespace(unquoted.toLowerCase())\n if (normalized.length === 0) return null\n if (FONT_GENERIC_FAMILIES.has(normalized)) return null\n return normalized\n}\n\nfunction parseFontFamilyList(value: string): readonly string[] {\n const out: string[] = []\n const tokens = splitComma(value)\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (!token) continue\n const family = normalizeFontFamily(token)\n if (!family) continue\n out.push(family)\n }\n return out\n}\n\nfunction firstToken(value: string): string {\n const normalized = value.trim().toLowerCase()\n if (normalized.length === 0) return \"\"\n const parts = normalized.split(WHITESPACE_RE)\n return parts[0] ?? \"\"\n}\n\nfunction isWebFontSource(value: string): boolean {\n return value.toLowerCase().includes(\"url(\")\n}\n\nfunction isEffectiveFontMetricValue(value: string): boolean {\n const normalized = value.trim().toLowerCase()\n if (normalized.length === 0) return false\n return normalized !== \"normal\" && normalized !== \"none\"\n}\n\nfunction hasEffectiveMetricOverrides(\n declarations: readonly { readonly property: string; readonly value: string }[],\n): boolean {\n const sizeAdjust = firstDeclaration(declarations, \"size-adjust\")\n if (sizeAdjust && isEffectiveFontMetricValue(sizeAdjust.value)) return true\n const ascentOverride = firstDeclaration(declarations, \"ascent-override\")\n const descentOverride = firstDeclaration(declarations, \"descent-override\")\n const lineGapOverride = firstDeclaration(declarations, \"line-gap-override\")\n if (!ascentOverride || !descentOverride || !lineGapOverride) return false\n return isEffectiveFontMetricValue(ascentOverride.value)\n && isEffectiveFontMetricValue(descentOverride.value)\n && isEffectiveFontMetricValue(lineGapOverride.value)\n}\n\nfunction buildDedupKey(rule: RuleEntity, selector: string): string {\n let ancestry = \"\"\n let current: RuleEntity[\"parent\"] = rule.parent\n while (current !== null) {\n if (current.kind === \"rule\") {\n ancestry = current.selectorText + \"\\0\" + ancestry\n current = current.parent\n } else {\n ancestry = `@${current.name} ${current.params}\\0` + ancestry\n current = current.parent\n }\n }\n return `${rule.file.path}\\0${ancestry}${selector}`\n}\n\nfunction pushToMapArray<K, V>(map: Map<K, V[]>, key: K, value: V): void {\n const arr = map.get(key)\n if (arr !== undefined) arr.push(value)\n else map.set(key, [value])\n}\n\nexport function buildSymbolTable(trees: readonly CSSSyntaxTree[], tailwindValidator?: TailwindValidator | null): SymbolTable {\n const classNamesMap = new Map<string, { selectors: SelectorEntity[]; filePaths: Set<string> }>()\n const selectorsMap = new Map<number, SelectorSymbol>()\n const customPropertiesMap = new Map<string, CustomPropertySymbol>()\n const layersMap = new Map<string, LayerSymbol>()\n const themeTokensMap = new Map<string, ThemeTokenSymbol>()\n\n const selectorsByDispatchKeyMap = new Map<string, SelectorSymbol[]>()\n const selectorsBySubjectTagMap = new Map<string, SelectorSymbol[]>()\n const selectorsWithoutSubjectTagArr: SelectorSymbol[] = []\n\n const declarationsByPropertyMap = new Map<string, DeclarationSymbol[]>()\n const mergedDeclarationsByProperty = new Map<string, DeclarationEntity[]>()\n\n const selectorDedupIndex = new Map<string, RuleEntity[]>()\n const duplicateSelectorsMap = new Map<string, { selector: string; rules: RuleEntity[] }>()\n\n const idSelectorsArr: SelectorEntity[] = []\n const attributeSelectorsArr: SelectorEntity[] = []\n const universalSelectorsArr: SelectorEntity[] = []\n const selectorsTargetingCheckboxArr: SelectorEntity[] = []\n const selectorsTargetingTableCellArr: SelectorEntity[] = []\n const importantDeclarationsArr: DeclarationEntity[] = []\n const tokensByCategoryMap = new Map<string, ThemeTokenEntity[]>()\n const mixinsByNameMap = new Map<string, MixinEntity>()\n const functionsByNameMap = new Map<string, SCSSFunctionEntity>()\n const placeholdersByNameMap = new Map<string, PlaceholderEntity>()\n\n const allRules: RuleEntity[] = []\n const allSelectors: SelectorEntity[] = []\n const allDeclarations: DeclarationEntity[] = []\n const allVariables: VariableEntity[] = []\n const allAtRules: AtRuleEntity[] = []\n const allKeyframeAtRules: AtRuleEntity[] = []\n const allFontFaceAtRules: AtRuleEntity[] = []\n const allLayerAtRules: AtRuleEntity[] = []\n const allMixins: MixinEntity[] = []\n const allFunctions: SCSSFunctionEntity[] = []\n const allPlaceholders: PlaceholderEntity[] = []\n\n let layerOrderCounter = 0\n\n for (let t = 0; t < trees.length; t++) {\n const tree = trees[t]\n if (!tree) continue\n const filePath = tree.filePath\n\n // Selectors\n const treeSelectors = tree.selectors\n for (let i = 0; i < treeSelectors.length; i++) {\n const entity = treeSelectors[i]\n if (!entity) continue\n allSelectors.push(entity)\n\n const symbol = createSelectorSymbol(entity, filePath)\n selectorsMap.set(entity.id, symbol)\n\n const dispatchKeys = symbol.dispatchKeys\n for (let j = 0; j < dispatchKeys.length; j++) {\n const key = dispatchKeys[j]\n if (!key) continue\n pushToMapArray(selectorsByDispatchKeyMap, key, symbol)\n }\n\n const subjectTag = entity.anchor.subjectTag\n if (subjectTag !== null) {\n pushToMapArray(selectorsBySubjectTagMap, subjectTag, symbol)\n } else {\n selectorsWithoutSubjectTagArr.push(symbol)\n }\n\n const flags = entity.complexity._flags\n if (hasFlag(flags, SEL_HAS_ID)) idSelectorsArr.push(entity)\n if (hasFlag(flags, SEL_HAS_ATTRIBUTE)) attributeSelectorsArr.push(entity)\n if (hasFlag(flags, SEL_HAS_UNIVERSAL)) universalSelectorsArr.push(entity)\n\n if (entity.anchor.targetsCheckbox) selectorsTargetingCheckboxArr.push(entity)\n if (entity.anchor.targetsTableCell) selectorsTargetingTableCellArr.push(entity)\n\n // Class name index\n const compounds = entity.compounds\n for (let ci = 0; ci < compounds.length; ci++) {\n const compound = compounds[ci]\n if (!compound) continue\n const classes = compound.classes\n for (let j = 0; j < classes.length; j++) {\n const cls = classes[j]\n if (!cls) continue\n let entry = classNamesMap.get(cls)\n if (!entry) {\n entry = { selectors: [], filePaths: new Set() }\n classNamesMap.set(cls, entry)\n }\n entry.selectors.push(entity)\n entry.filePaths.add(filePath)\n }\n }\n }\n\n // Rules — duplicate detection + collection\n const treeRules = tree.rules\n for (let i = 0; i < treeRules.length; i++) {\n const rule = treeRules[i]\n if (!rule) continue\n allRules.push(rule)\n\n const selectorText = rule.selectorText\n // Skip keyframe selectors\n let isKeyframeChild = false\n let parent: RuleEntity[\"parent\"] = rule.parent\n while (parent !== null) {\n if (parent.kind === \"keyframes\") { isKeyframeChild = true; break }\n parent = parent.parent\n }\n if (isKeyframeChild) continue\n\n const dedupKey = buildDedupKey(rule, selectorText)\n const dedupExisting = selectorDedupIndex.get(dedupKey)\n if (dedupExisting) {\n dedupExisting.push(rule)\n const dups = duplicateSelectorsMap.get(selectorText)\n if (dups) {\n dups.rules.push(rule)\n } else {\n const first = dedupExisting[0]\n if (!first) continue\n duplicateSelectorsMap.set(selectorText, { selector: selectorText, rules: [first, rule] })\n }\n } else {\n selectorDedupIndex.set(dedupKey, [rule])\n }\n }\n\n // Declarations\n const treeDeclarations = tree.declarations\n for (let i = 0; i < treeDeclarations.length; i++) {\n const entity = treeDeclarations[i]\n if (!entity) continue\n allDeclarations.push(entity)\n\n const sourceOrder = tree.sourceOrderBase + entity.id\n const layerOrder = entity.cascadePosition.layerOrder\n const symbol = createDeclarationSymbol(entity, filePath, sourceOrder, layerOrder)\n pushToMapArray(declarationsByPropertyMap, entity.property, symbol)\n pushToMapArray(mergedDeclarationsByProperty, entity.property, entity)\n\n if (hasFlag(entity._flags, DECL_IS_IMPORTANT) || entity.node.important) {\n importantDeclarationsArr.push(entity)\n }\n }\n\n // Variables\n const treeVariables = tree.variables\n for (let i = 0; i < treeVariables.length; i++) {\n const entity = treeVariables[i]\n if (!entity) continue\n allVariables.push(entity)\n if (!customPropertiesMap.has(entity.name)) {\n customPropertiesMap.set(entity.name, createCustomPropertySymbol(entity, filePath))\n }\n }\n\n // At-rules\n const treeAtRules = tree.atRules\n for (let i = 0; i < treeAtRules.length; i++) {\n const entity = treeAtRules[i]\n if (!entity) continue\n allAtRules.push(entity)\n\n switch (entity.kind) {\n case \"keyframes\":\n allKeyframeAtRules.push(entity)\n break\n case \"font-face\":\n allFontFaceAtRules.push(entity)\n break\n case \"layer\": {\n allLayerAtRules.push(entity)\n const layerName = entity.params.trim()\n if (layerName && !layersMap.has(layerName)) {\n layersMap.set(layerName, createLayerSymbol(entity, layerName, filePath, layerOrderCounter++))\n }\n break\n }\n }\n }\n\n // Tokens\n const treeTokens = tree.tokens\n for (let i = 0; i < treeTokens.length; i++) {\n const entity = treeTokens[i]\n if (!entity) continue\n if (!themeTokensMap.has(entity.name)) {\n themeTokensMap.set(entity.name, createThemeTokenSymbol(entity, filePath))\n }\n pushToMapArray(tokensByCategoryMap, entity.category, entity)\n }\n\n // Mixins\n const treeMixins = tree.mixins\n for (let i = 0; i < treeMixins.length; i++) {\n const mixin = treeMixins[i]\n if (!mixin) continue\n allMixins.push(mixin)\n if (!mixinsByNameMap.has(mixin.name)) mixinsByNameMap.set(mixin.name, mixin)\n }\n\n // Functions\n const treeFunctions = tree.functions\n for (let i = 0; i < treeFunctions.length; i++) {\n const fn = treeFunctions[i]\n if (!fn) continue\n allFunctions.push(fn)\n if (!functionsByNameMap.has(fn.name)) functionsByNameMap.set(fn.name, fn)\n }\n\n // Placeholders\n const treePlaceholders = tree.placeholders\n for (let i = 0; i < treePlaceholders.length; i++) {\n const ph = treePlaceholders[i]\n if (!ph) continue\n allPlaceholders.push(ph)\n if (!placeholdersByNameMap.has(ph.name)) placeholdersByNameMap.set(ph.name, ph)\n }\n }\n\n // Build ClassNameSymbol map\n const classNameSymbols = new Map<string, ClassNameSymbol>()\n for (const [name, entry] of classNamesMap) {\n classNameSymbols.set(name, createClassNameSymbol(name, entry.selectors, [...entry.filePaths]))\n }\n\n const twValidator = tailwindValidator ?? null\n\n // Build keyframe indexes\n const knownKeyframeNames = new Set<string>()\n for (let i = 0; i < allKeyframeAtRules.length; i++) {\n const kf = allKeyframeAtRules[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName\n if (name) knownKeyframeNames.add(name)\n }\n\n const IGNORED_KEYFRAME_NAMES = new Set([...CSS_WIDE_KEYWORDS, \"none\"])\n\n const unresolvedAnimationRefsArr: { declaration: DeclarationEntity; name: string }[] = []\n const animDecls = declarationsForPropertiesImpl(mergedDeclarationsByProperty, \"animation\", \"animation-name\")\n for (let i = 0; i < animDecls.length; i++) {\n const d = animDecls[i]\n if (!d) continue\n const names = extractKeyframeNames(d.value, d.property.toLowerCase())\n for (let j = 0; j < names.length; j++) {\n const name = names[j]\n if (!name) continue\n if (IGNORED_KEYFRAME_NAMES.has(name)) continue\n if (name.includes(\"(\")) continue\n if (knownKeyframeNames.has(name)) continue\n unresolvedAnimationRefsArr.push({ declaration: d, name })\n }\n }\n\n const keyframeDeclarationsArr: DeclarationEntity[] = []\n const byAnimationByProperty = new Map<string, Map<string, { values: Set<string>; declarations: DeclarationEntity[] }>>()\n\n for (let i = 0; i < allDeclarations.length; i++) {\n const d = allDeclarations[i]\n if (!d) continue\n const rule = d.rule\n if (!rule) continue\n const parent = rule.parent\n if (!parent) continue\n if (parent.kind === \"rule\") continue\n if (parent.kind !== \"keyframes\") continue\n keyframeDeclarationsArr.push(d)\n\n const property = d.property.toLowerCase()\n if (!LAYOUT_ANIMATION_MUTATION_PROPERTIES.has(property)) continue\n\n const animationName = normalizeAnimationName(parent.params)\n if (!animationName) continue\n\n let byProperty = byAnimationByProperty.get(animationName)\n if (!byProperty) {\n byProperty = new Map()\n byAnimationByProperty.set(animationName, byProperty)\n }\n\n let bucket = byProperty.get(property)\n if (!bucket) {\n bucket = { values: new Set(), declarations: [] }\n byProperty.set(property, bucket)\n }\n\n bucket.values.add(normalizeCssValue(d.value))\n bucket.declarations.push(d)\n }\n\n const keyframeLayoutMutationsByName = new Map<string, readonly KeyframeLayoutMutation[]>()\n for (const [animationName, byProperty] of byAnimationByProperty) {\n const mutations: KeyframeLayoutMutation[] = []\n for (const [property, bucket] of byProperty) {\n if (bucket.values.size <= 1) continue\n mutations.push({ property, values: [...bucket.values], declarations: bucket.declarations })\n }\n if (mutations.length === 0) continue\n keyframeLayoutMutationsByName.set(animationName, mutations)\n }\n\n // Build KeyframesSymbol map\n const keyframesMap = new Map<string, KeyframesSymbol>()\n for (let i = 0; i < allKeyframeAtRules.length; i++) {\n const kf = allKeyframeAtRules[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName ?? kf.params.trim()\n if (!name) continue\n if (keyframesMap.has(name)) continue\n const mutations = keyframeLayoutMutationsByName.get(name) ?? []\n keyframesMap.set(name, createKeyframesSymbol(kf, name, kf.file.path, mutations))\n }\n\n // Build unused keyframes\n const usedAnimationNames = new Set<string>()\n for (let i = 0; i < animDecls.length; i++) {\n const d = animDecls[i]\n if (!d) continue\n const names = extractKeyframeNames(d.value, d.property.toLowerCase())\n for (let j = 0; j < names.length; j++) {\n const name = names[j]\n if (name) usedAnimationNames.add(name)\n }\n }\n const unusedKeyframesArr: AtRuleEntity[] = []\n for (let i = 0; i < allKeyframeAtRules.length; i++) {\n const kf = allKeyframeAtRules[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName ?? kf.params.trim()\n if (!usedAnimationNames.has(name)) unusedKeyframesArr.push(kf)\n }\n\n // Build container name indexes\n const declaredContainerNames = new Map<string, DeclarationEntity[]>()\n for (let i = 0; i < allDeclarations.length; i++) {\n const d = allDeclarations[i]\n if (!d) continue\n const p = d.property.toLowerCase()\n let names: readonly string[] | null = null\n if (p === \"container-name\") names = parseContainerNames(d.value)\n else if (p === \"container\") names = parseContainerNamesFromShorthand(d.value)\n if (!names) continue\n for (let j = 0; j < names.length; j++) {\n const name = names[j]\n if (!name) continue\n const existing = declaredContainerNames.get(name)\n if (existing) existing.push(d)\n else declaredContainerNames.set(name, [d])\n }\n }\n\n const containerQueryNames = new Map<string, AtRuleEntity[]>()\n for (let i = 0; i < allAtRules.length; i++) {\n const at = allAtRules[i]\n if (!at) continue\n if (at.kind !== \"container\") continue\n const name = at.parsedParams.containerName ?? parseContainerQueryName(at.params)\n if (!name) continue\n const existing = containerQueryNames.get(name)\n if (existing) existing.push(at)\n else containerQueryNames.set(name, [at])\n }\n\n const unusedContainerNamesMap = new Map<string, DeclarationEntity[]>()\n for (const [name, decls] of declaredContainerNames) {\n if (!containerQueryNames.has(name)) unusedContainerNamesMap.set(name, decls)\n }\n\n const unknownContainerQueriesArr: AtRuleEntity[] = []\n for (const [name, atRules] of containerQueryNames) {\n if (!declaredContainerNames.has(name)) {\n for (let i = 0; i < atRules.length; i++) {\n const atRule = atRules[i]\n if (atRule) unknownContainerQueriesArr.push(atRule)\n }\n }\n }\n\n // Build ContainerSymbol map\n const containersMap = new Map<string, ContainerSymbol>()\n for (const [name, decls] of declaredContainerNames) {\n const queries = containerQueryNames.get(name) ?? []\n containersMap.set(name, createContainerSymbol(name, decls, queries))\n }\n for (const [name, queries] of containerQueryNames) {\n if (!containersMap.has(name)) {\n containersMap.set(name, createContainerSymbol(name, [], queries))\n }\n }\n\n // Build multiDeclarationProperties (sort by sourceOrder, keep 2+)\n const multiDeclarationPropertiesMap = new Map<string, readonly DeclarationEntity[]>()\n for (const [property, declarations] of mergedDeclarationsByProperty) {\n declarations.sort((a, b) => a.sourceOrder - b.sourceOrder)\n if (declarations.length >= 2) {\n multiDeclarationPropertiesMap.set(property, declarations)\n }\n }\n\n // Build layoutPropertiesByClassToken\n const layoutByClass = new Map<string, Set<string>>()\n for (let i = 0; i < allSelectors.length; i++) {\n const selector = allSelectors[i]\n if (!selector) continue\n if (selector.anchor.classes.length === 0) continue\n\n const properties = new Set<string>()\n const rule = selector.rule\n const ruleDecls = rule.declarations\n for (let j = 0; j < ruleDecls.length; j++) {\n const decl = ruleDecls[j]\n if (!decl) continue\n const property = decl.property.toLowerCase()\n if (!LAYOUT_CLASS_GEOMETRY_PROPERTIES.has(property)) continue\n properties.add(property)\n }\n if (properties.size === 0) continue\n\n const anchorClasses = selector.anchor.classes\n for (let j = 0; j < anchorClasses.length; j++) {\n const className = anchorClasses[j]\n if (!className) continue\n let existing = layoutByClass.get(className)\n if (!existing) {\n existing = new Set()\n layoutByClass.set(className, existing)\n }\n for (const property of properties) existing.add(property)\n }\n }\n const layoutPropertiesByClassTokenMap = new Map<string, readonly string[]>()\n for (const [className, properties] of layoutByClass) {\n layoutPropertiesByClassTokenMap.set(className, [...properties])\n }\n\n // Build font indexes\n const usedFontFamiliesSet = new Set<string>()\n const usedFontFamiliesByRuleMap = new Map<number, readonly string[]>()\n const fontDecls = declarationsForPropertiesImpl(mergedDeclarationsByProperty, ...FONT_LAYOUT_PROPERTIES)\n for (let i = 0; i < fontDecls.length; i++) {\n const declaration = fontDecls[i]\n if (!declaration) continue\n const rule = declaration.rule\n if (!rule) continue\n const families = parseFontFamilyList(declaration.value)\n if (families.length === 0) continue\n for (let j = 0; j < families.length; j++) {\n const family = families[j]\n if (!family) continue\n usedFontFamiliesSet.add(family)\n }\n const existing = usedFontFamiliesByRuleMap.get(rule.id)\n if (!existing) {\n usedFontFamiliesByRuleMap.set(rule.id, families)\n } else {\n const merged = new Set(existing)\n for (let j = 0; j < families.length; j++) {\n const family = families[j]\n if (!family) continue\n merged.add(family)\n }\n usedFontFamiliesByRuleMap.set(rule.id, [...merged])\n }\n }\n\n // Build FontFaceSymbol map\n const fontFacesMap = new Map<string, FontFaceSymbol[]>()\n for (let i = 0; i < allFontFaceAtRules.length; i++) {\n const fontFace = allFontFaceAtRules[i]\n if (!fontFace) continue\n const familyDeclaration = firstDeclaration(fontFace.declarations, \"font-family\")\n if (!familyDeclaration) continue\n const family = normalizeFontFamily(familyDeclaration.value)\n if (!family) continue\n const displayDeclaration = firstDeclaration(fontFace.declarations, \"font-display\")\n const srcDeclaration = firstDeclaration(fontFace.declarations, \"src\")\n const display = displayDeclaration ? firstToken(displayDeclaration.value) : null\n const hasWebFont = srcDeclaration ? isWebFontSource(srcDeclaration.value) : false\n const hasMetricOverrides = hasEffectiveMetricOverrides(fontFace.declarations)\n const symbol = createFontFaceSymbol(fontFace, family, fontFace.file.path, display, hasWebFont, hasMetricOverrides)\n const existing = fontFacesMap.get(family)\n if (existing) existing.push(symbol)\n else fontFacesMap.set(family, [symbol])\n }\n\n // Build emptyRules\n const emptyRulesArr: RuleEntity[] = []\n for (let i = 0; i < allRules.length; i++) {\n const r = allRules[i]\n if (!r) continue\n if (r.declarations.length === 0 && r.nestedRules.length === 0 && r.nestedAtRules.length === 0) {\n emptyRulesArr.push(r)\n }\n }\n\n // Build emptyKeyframes\n const emptyKeyframesArr: AtRuleEntity[] = []\n for (let i = 0; i < allKeyframeAtRules.length; i++) {\n const kf = allKeyframeAtRules[i]\n if (!kf) continue\n if (!kf.parsedParams.animationName) continue\n if (kf.rules.length === 0) {\n emptyKeyframesArr.push(kf)\n continue\n }\n let hasDeclaration = false\n for (let j = 0; j < kf.rules.length; j++) {\n const kfRule = kf.rules[j]\n if (!kfRule) continue\n if (kfRule.declarations.length > 0) { hasDeclaration = true; break }\n }\n if (!hasDeclaration) emptyKeyframesArr.push(kf)\n }\n\n // Build deepNestedRules\n const deepNestedRulesArr: RuleEntity[] = []\n for (let i = 0; i < allRules.length; i++) {\n const r = allRules[i]\n if (!r) continue\n if (r.depth > 3) deepNestedRulesArr.push(r)\n }\n\n // Build overqualifiedSelectors\n const overqualifiedSelectorsArr: SelectorEntity[] = []\n for (let i = 0; i < idSelectorsArr.length; i++) {\n const sel = idSelectorsArr[i]\n if (!sel) continue\n const compounds = sel.compounds\n if (compounds.length === 0) continue\n const subject = compounds[compounds.length - 1]\n if (!subject) continue\n if (subject.idValue !== null && (subject.tagName !== null || subject.classes.length > 0 || subject.attributes.length > 0)) {\n overqualifiedSelectorsArr.push(sel)\n }\n }\n\n // Build unused indexes\n const unusedVariablesArr: VariableEntity[] = []\n for (let i = 0; i < allVariables.length; i++) {\n const v = allVariables[i]\n if (!v) continue\n if (!hasFlag(v._flags, VAR_IS_USED)) unusedVariablesArr.push(v)\n }\n const unusedMixinsArr: MixinEntity[] = []\n for (let i = 0; i < allMixins.length; i++) {\n const m = allMixins[i]\n if (!m) continue\n if (!hasFlag(m._flags, MIXIN_IS_USED)) unusedMixinsArr.push(m)\n }\n const unusedFunctionsArr: SCSSFunctionEntity[] = []\n for (let i = 0; i < allFunctions.length; i++) {\n const f = allFunctions[i]\n if (!f) continue\n if (!hasFlag(f._flags, SCSSFN_IS_USED)) unusedFunctionsArr.push(f)\n }\n const unusedPlaceholdersArr: PlaceholderEntity[] = []\n for (let i = 0; i < allPlaceholders.length; i++) {\n const p = allPlaceholders[i]\n if (!p) continue\n if (!hasFlag(p._flags, PLACEHOLDER_IS_USED)) unusedPlaceholdersArr.push(p)\n }\n\n // Build selectorsByClassName lookup for getters\n const selectorSymbolsByClassName = new Map<string, SelectorSymbol[]>()\n for (const [, symbol] of selectorsMap) {\n const compounds = symbol.entity.compounds\n for (let ci = 0; ci < compounds.length; ci++) {\n const compound = compounds[ci]\n if (!compound) continue\n const classes = compound.classes\n for (let j = 0; j < classes.length; j++) {\n const cls = classes[j]\n if (!cls) continue\n pushToMapArray(selectorSymbolsByClassName, cls, symbol)\n }\n }\n }\n\n return {\n classNames: classNameSymbols,\n selectors: selectorsMap,\n customProperties: customPropertiesMap,\n componentHosts: new Map<string, ComponentHostSymbol>(), // Phase 6: populated during binding — empty in Phase 2\n keyframes: keyframesMap,\n fontFaces: fontFacesMap,\n layers: layersMap,\n containers: containersMap,\n themeTokens: themeTokensMap,\n\n selectorsByDispatchKey: selectorsByDispatchKeyMap,\n selectorsBySubjectTag: selectorsBySubjectTagMap,\n selectorsWithoutSubjectTag: selectorsWithoutSubjectTagArr,\n\n declarationsByProperty: declarationsByPropertyMap,\n declarationsForProperties(...properties: string[]): readonly DeclarationEntity[] {\n return declarationsForPropertiesImpl(mergedDeclarationsByProperty, ...properties)\n },\n\n duplicateSelectors: duplicateSelectorsMap,\n multiDeclarationProperties: multiDeclarationPropertiesMap,\n layoutPropertiesByClassToken: layoutPropertiesByClassTokenMap,\n usedFontFamilies: usedFontFamiliesSet,\n usedFontFamiliesByRule: usedFontFamiliesByRuleMap,\n idSelectors: idSelectorsArr,\n attributeSelectors: attributeSelectorsArr,\n universalSelectors: universalSelectorsArr,\n selectorsTargetingCheckbox: selectorsTargetingCheckboxArr,\n selectorsTargetingTableCell: selectorsTargetingTableCellArr,\n importantDeclarations: importantDeclarationsArr,\n emptyRules: emptyRulesArr,\n emptyKeyframes: emptyKeyframesArr,\n deepNestedRules: deepNestedRulesArr,\n overqualifiedSelectors: overqualifiedSelectorsArr,\n unresolvedAnimationRefs: unresolvedAnimationRefsArr,\n unknownContainerQueries: unknownContainerQueriesArr,\n unusedContainerNames: unusedContainerNamesMap,\n keyframeDeclarations: keyframeDeclarationsArr,\n tokensByCategory: tokensByCategoryMap,\n mixinsByName: mixinsByNameMap,\n functionsByName: functionsByNameMap,\n placeholdersByName: placeholdersByNameMap,\n unusedVariables: unusedVariablesArr,\n unusedKeyframes: unusedKeyframesArr,\n unusedMixins: unusedMixinsArr,\n unusedFunctions: unusedFunctionsArr,\n unusedPlaceholders: unusedPlaceholdersArr,\n tokenCategories: [...tokensByCategoryMap.keys()],\n\n hasClassName(name: string): boolean {\n return classNameSymbols.has(name) || (twValidator !== null && twValidator.has(name))\n },\n getClassName(name: string): ClassNameSymbol | null {\n return classNameSymbols.get(name) ?? null\n },\n getSelectorsByClassName(name: string): readonly SelectorSymbol[] {\n return selectorSymbolsByClassName.get(name) ?? EMPTY_SELECTOR_SYMBOLS\n },\n getCustomProperty(name: string): CustomPropertySymbol | null {\n return customPropertiesMap.get(name) ?? null\n },\n getKeyframes(name: string): KeyframesSymbol | null {\n return keyframesMap.get(name) ?? null\n },\n getFontFaces(family: string): readonly FontFaceSymbol[] {\n return fontFacesMap.get(family) ?? EMPTY_FONT_FACE_SYMBOLS\n },\n getLayerOrder(name: string): number {\n const layer = layersMap.get(name)\n return layer ? layer.order : -1\n },\n }\n}\n\nfunction declarationsForPropertiesImpl(\n index: ReadonlyMap<string, readonly DeclarationEntity[]>,\n ...properties: string[]\n): readonly DeclarationEntity[] {\n if (properties.length === 1) {\n const prop = properties[0]\n if (!prop) return []\n return index.get(prop) ?? []\n }\n const out: DeclarationEntity[] = []\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i]\n if (!prop) continue\n const list = index.get(prop)\n if (list) {\n for (let j = 0; j < list.length; j++) {\n const item = list[j]\n if (item) out.push(item)\n }\n }\n }\n return out\n}\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { basename, dirname, join, resolve } from \"node:path\"\nimport { CSS_EXTENSIONS, SOLID_EXTENSIONS, canonicalPath, matchesExtension } from \"@drskillissue/ganko-shared\"\nimport { z } from \"zod/v4\"\nimport type { SolidSyntaxTree } from \"../core/solid-syntax-tree\"\nimport type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\n\n// ── Types ────────────────────────────────────────────────────────────────\n\nexport type DependencyEdgeKind =\n | \"js-import\"\n | \"css-import\"\n | \"css-at-import\"\n | \"colocated\"\n | \"global-side-effect\"\n\nexport interface DependencyEdgeInfo {\n readonly target: string\n readonly kind: DependencyEdgeKind\n}\n\nexport interface ComponentImportEdge {\n readonly importerFile: string\n readonly importedName: string\n}\n\nexport interface DependencyGraph {\n getDirectDependencies(filePath: string): readonly DependencyEdgeInfo[]\n getReverseDependencies(filePath: string): readonly string[]\n getCSSScope(solidFilePath: string): readonly string[]\n getComponentImporters(solidFilePath: string): readonly ComponentImportEdge[]\n getTransitivelyAffected(filePath: string): readonly string[]\n isInCSSScope(solidFilePath: string, cssFilePath: string): boolean\n}\n\n// ── Package resolution types ─────────────────────────────────────────────\n\ninterface PackageExportPath {\n readonly kind: \"path\"\n readonly value: string\n}\n\ninterface PackageExportArray {\n readonly kind: \"array\"\n readonly values: readonly PackageExportNode[]\n}\n\ninterface PackageExportMap {\n readonly kind: \"map\"\n readonly fields: ReadonlyMap<string, PackageExportNode>\n}\n\ntype PackageExportNode = PackageExportPath | PackageExportArray | PackageExportMap\n\nexport interface PackageIndexEntry {\n readonly rootPath: string\n readonly name: string\n readonly exportsValue: PackageExportNode | null\n}\n\n// ── Module resolution ────────────────────────────────────────────────────\n\nconst JSON_VALUE_SCHEMA = z.json()\n\nconst packageManifestSchema = z.object({\n name: z.string().min(1),\n exports: JSON_VALUE_SCHEMA.optional(),\n})\n\nconst INTERNAL_CONDITIONS: readonly string[] = [\"import\", \"default\", \"require\"]\n\nconst CSS_COLOCATED_EXTENSIONS: readonly string[] = [\".css\"]\n\nexport function resolveImportPath(input: {\n readonly importerFile: string\n readonly source: string\n readonly availablePaths: ReadonlySet<string>\n readonly extensions: readonly string[]\n readonly packageEntries: readonly PackageIndexEntry[]\n readonly allowPartialFiles: boolean\n}): string | null {\n if (input.source.length === 0) return null\n if (input.source.startsWith(\"http://\")) return null\n if (input.source.startsWith(\"https://\")) return null\n if (input.source.startsWith(\"data:\")) return null\n\n if (input.source.startsWith(\".\") || input.source.startsWith(\"/\")) {\n const basePath = input.source.startsWith(\"/\")\n ? resolve(input.source)\n : resolve(dirname(resolve(input.importerFile)), input.source)\n\n return resolveFromBasePath({\n basePath,\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n }\n\n return resolvePackageImport({\n source: input.source,\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n packageEntries: input.packageEntries,\n allowPartialFiles: input.allowPartialFiles,\n })\n}\n\nfunction resolvePackageImport(input: {\n readonly source: string\n readonly availablePaths: ReadonlySet<string>\n readonly extensions: readonly string[]\n readonly packageEntries: readonly PackageIndexEntry[]\n readonly allowPartialFiles: boolean\n}): string | null {\n const pkg = findBestMatchingPackageEntry(input.source, input.packageEntries)\n if (pkg === null) return null\n\n const subpath = input.source === pkg.name\n ? \".\"\n : `.${input.source.slice(pkg.name.length)}`\n\n const exported = resolveExportTarget(pkg.exportsValue, subpath)\n if (exported !== null) {\n const fromExports = resolveFromBasePath({\n basePath: resolve(pkg.rootPath, exported),\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n if (fromExports !== null) return fromExports\n }\n\n const remainder = input.source.slice(pkg.name.length)\n const trimmed = remainder.startsWith(\"/\") ? remainder.slice(1) : remainder\n\n if (trimmed.length === 0) {\n const fromRoot = resolveFromBasePath({\n basePath: pkg.rootPath,\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n if (fromRoot !== null) return fromRoot\n\n return resolveFromBasePath({\n basePath: resolve(pkg.rootPath, \"src/index\"),\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n }\n\n const direct = resolveFromBasePath({\n basePath: resolve(pkg.rootPath, trimmed),\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n if (direct !== null) return direct\n\n return resolveFromBasePath({\n basePath: resolve(pkg.rootPath, \"src\", trimmed),\n availablePaths: input.availablePaths,\n extensions: input.extensions,\n allowPartialFiles: input.allowPartialFiles,\n })\n}\n\nfunction resolveFromBasePath(input: {\n readonly basePath: string\n readonly availablePaths: ReadonlySet<string>\n readonly extensions: readonly string[]\n readonly allowPartialFiles: boolean\n}): string | null {\n const candidates = collectResolutionCandidates(\n input.basePath,\n input.extensions,\n input.allowPartialFiles,\n )\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i]\n if (!candidate) continue\n if (!input.availablePaths.has(candidate)) continue\n return candidate\n }\n\n return null\n}\n\nfunction collectResolutionCandidates(\n basePath: string,\n extensions: readonly string[],\n allowPartialFiles: boolean,\n): readonly string[] {\n const normalizedBase = resolve(basePath)\n const out: string[] = [normalizedBase]\n const hasSupportedExtension = matchesExtension(normalizedBase, extensions)\n\n if (!hasSupportedExtension) {\n for (let i = 0; i < extensions.length; i++) {\n out.push(normalizedBase + extensions[i])\n }\n\n for (let i = 0; i < extensions.length; i++) {\n out.push(join(normalizedBase, `index${extensions[i]}`))\n }\n }\n\n if (!allowPartialFiles) return out\n\n const partialBase = toPartialPath(normalizedBase)\n if (partialBase === null) return out\n out.push(partialBase)\n\n if (!hasSupportedExtension) {\n for (let i = 0; i < extensions.length; i++) {\n out.push(partialBase + extensions[i])\n }\n }\n\n return out\n}\n\nfunction toPartialPath(path: string): string | null {\n const name = basename(path)\n if (name.length === 0) return null\n if (name.startsWith(\"_\")) return null\n return resolve(dirname(path), `_${name}`)\n}\n\nfunction findBestMatchingPackageEntry(\n source: string,\n packageEntries: readonly PackageIndexEntry[],\n): PackageIndexEntry | null {\n let best: PackageIndexEntry | null = null\n\n for (let i = 0; i < packageEntries.length; i++) {\n const entry = packageEntries[i]\n if (!entry) continue\n const isExact = source === entry.name\n const isSubpath = source.startsWith(`${entry.name}/`)\n if (!isExact && !isSubpath) continue\n if (best === null || entry.name.length > best.name.length) best = entry\n }\n\n return best\n}\n\nfunction resolveExportTarget(\n exportsValue: PackageExportNode | null,\n subpath: string,\n conditions: readonly string[] = INTERNAL_CONDITIONS,\n): string | null {\n if (exportsValue === null) return null\n if (exportsValue.kind === \"path\") return exportsValue.value\n\n if (exportsValue.kind === \"array\") {\n for (let i = 0; i < exportsValue.values.length; i++) {\n const val = exportsValue.values[i]\n if (!val) continue\n const resolved = resolveExportTarget(val, subpath, conditions)\n if (resolved !== null) return resolved\n }\n return null\n }\n\n const exact = exportsValue.fields.get(subpath)\n const exactResolved = resolveExportConditionTarget(exact, conditions)\n if (exactResolved !== null) return exactResolved\n\n const wildcard = resolveWildcardExportTarget(exportsValue.fields, subpath, conditions)\n if (wildcard !== null) return wildcard\n\n if (subpath === \".\") {\n const root = exportsValue.fields.get(\".\")\n const rootResolved = resolveExportConditionTarget(root, conditions)\n if (rootResolved !== null) return rootResolved\n }\n\n return resolveExportConditionTarget(exportsValue, conditions)\n}\n\nfunction resolveWildcardExportTarget(\n fields: ReadonlyMap<string, PackageExportNode>,\n subpath: string,\n conditions: readonly string[],\n): string | null {\n for (const [key, value] of fields) {\n const star = key.indexOf(\"*\")\n if (star < 0) continue\n\n const prefix = key.slice(0, star)\n const suffix = key.slice(star + 1)\n if (!subpath.startsWith(prefix)) continue\n if (!subpath.endsWith(suffix)) continue\n\n const captured = subpath.slice(prefix.length, subpath.length - suffix.length)\n const target = resolveExportConditionTarget(value, conditions)\n if (target === null) continue\n if (!target.includes(\"*\")) return target\n return target.replaceAll(\"*\", captured)\n }\n\n return null\n}\n\nfunction resolveExportConditionTarget(\n value: PackageExportNode | undefined,\n conditions: readonly string[],\n): string | null {\n if (value === undefined) return null\n if (value.kind === \"path\") return value.value\n\n if (value.kind === \"array\") {\n for (let i = 0; i < value.values.length; i++) {\n const val = value.values[i]\n if (!val) continue\n const resolved = resolveExportConditionTarget(val, conditions)\n if (resolved !== null) return resolved\n }\n return null\n }\n\n for (let i = 0; i < conditions.length; i++) {\n const cond = conditions[i]\n if (!cond) continue\n const conditionTarget = resolveExportConditionTarget(value.fields.get(cond), conditions)\n if (conditionTarget !== null) return conditionTarget\n }\n\n for (const next of value.fields.values()) {\n const resolved = resolveExportConditionTarget(next, conditions)\n if (resolved !== null) return resolved\n }\n\n return null\n}\n\nexport function buildPackageIndex(\n solidPaths: ReadonlySet<string>,\n cssPaths: ReadonlySet<string>,\n): readonly PackageIndexEntry[] {\n const packageJsonByPath = new Map<string, PackageIndexEntry>()\n const packageJsonPathByDirectory = new Map<string, string | null>()\n\n const indexPath = (filePath: string): void => {\n const packageJsonPath = findNearestPackageJsonPath(filePath, packageJsonPathByDirectory)\n if (packageJsonPath === null) return\n if (packageJsonByPath.has(packageJsonPath)) return\n\n const packageEntry = readPackageEntry(packageJsonPath)\n if (packageEntry === null) return\n packageJsonByPath.set(packageJsonPath, packageEntry)\n }\n\n for (const path of solidPaths) indexPath(path)\n for (const path of cssPaths) indexPath(path)\n\n return [...packageJsonByPath.values()]\n}\n\nfunction findNearestPackageJsonPath(\n filePath: string,\n cache: Map<string, string | null>,\n): string | null {\n let current = dirname(resolve(filePath))\n const traversed: string[] = []\n\n while (true) {\n const cached = cache.get(current)\n if (cached !== undefined) {\n for (let i = 0; i < traversed.length; i++) {\n const dir = traversed[i]\n if (!dir) continue\n cache.set(dir, cached)\n }\n return cached\n }\n\n traversed.push(current)\n const candidate = join(current, \"package.json\")\n if (existsSync(candidate)) {\n for (let i = 0; i < traversed.length; i++) {\n const dir = traversed[i]\n if (!dir) continue\n cache.set(dir, candidate)\n }\n return candidate\n }\n\n const parent = dirname(current)\n if (parent === current) {\n for (let i = 0; i < traversed.length; i++) {\n const dir = traversed[i]\n if (!dir) continue\n cache.set(dir, null)\n }\n return null\n }\n current = parent\n }\n}\n\nfunction readPackageEntry(packageJsonPath: string): PackageIndexEntry | null {\n try {\n const parsed = packageManifestSchema.safeParse(JSON.parse(readFileSync(packageJsonPath, \"utf-8\")))\n if (!parsed.success) return null\n\n return {\n rootPath: dirname(packageJsonPath),\n name: parsed.data.name,\n exportsValue: parsePackageExportNode(parsed.data.exports),\n }\n } catch {\n return null\n }\n}\n\nfunction parsePackageExportNode(value: z.infer<typeof JSON_VALUE_SCHEMA> | undefined): PackageExportNode | null {\n if (value === undefined) return null\n if (typeof value === \"string\") {\n return {\n kind: \"path\",\n value,\n }\n }\n\n if (Array.isArray(value)) {\n const values: PackageExportNode[] = []\n\n for (let i = 0; i < value.length; i++) {\n const parsed = parsePackageExportNode(value[i])\n if (parsed === null) continue\n values.push(parsed)\n }\n\n return {\n kind: \"array\",\n values,\n }\n }\n\n if (typeof value !== \"object\") return null\n if (value === null) return null\n\n const fields = new Map<string, PackageExportNode>()\n\n for (const [key, nested] of Object.entries(value)) {\n const parsed = parsePackageExportNode(nested)\n if (parsed === null) continue\n fields.set(key, parsed)\n }\n\n return {\n kind: \"map\",\n fields,\n }\n}\n\n// ── Graph builder ────────────────────────────────────────────────────────\n\nexport function buildDependencyGraph(\n solidTrees: ReadonlyMap<string, SolidSyntaxTree>,\n cssTrees: ReadonlyMap<string, CSSSyntaxTree>,\n): DependencyGraph {\n const solidPathSet = new Set<string>()\n for (const key of solidTrees.keys()) solidPathSet.add(resolve(key))\n\n const cssPathSet = new Set<string>()\n for (const key of cssTrees.keys()) cssPathSet.add(resolve(key))\n\n const packageEntries = buildPackageIndex(solidPathSet, cssPathSet)\n\n const resolveSolid = (importerFile: string, source: string): string | null =>\n resolveImportPath({\n importerFile,\n source,\n availablePaths: solidPathSet,\n extensions: SOLID_EXTENSIONS,\n packageEntries,\n allowPartialFiles: false,\n })\n\n const resolveCss = (importerFile: string, source: string): string | null =>\n resolveImportPath({\n importerFile,\n source,\n availablePaths: cssPathSet,\n extensions: CSS_EXTENSIONS,\n packageEntries,\n allowPartialFiles: true,\n })\n\n // Build CSS file index: canonical path → CSSSyntaxTree\n const cssTreeByCanonical = new Map<string, CSSSyntaxTree>()\n for (const [path, tree] of cssTrees) {\n cssTreeByCanonical.set(canonicalPath(path), tree)\n }\n\n // Forward edges: filePath → DependencyEdgeInfo[]\n const forwardEdges = new Map<string, DependencyEdgeInfo[]>()\n // Reverse edges: target → set of source file paths\n const reverseEdges = new Map<string, Set<string>>()\n // Component importers: solidFilePath → ComponentImportEdge[]\n const componentImporters = new Map<string, ComponentImportEdge[]>()\n\n const addEdge = (source: string, target: string, kind: DependencyEdgeKind): void => {\n let fwd = forwardEdges.get(source)\n if (fwd === undefined) {\n fwd = []\n forwardEdges.set(source, fwd)\n }\n fwd.push({ target, kind })\n\n let rev = reverseEdges.get(target)\n if (rev === undefined) {\n rev = new Set()\n reverseEdges.set(target, rev)\n }\n rev.add(source)\n }\n\n // Transitive @import scope cache\n const transitiveScopeCache = new Map<string, readonly string[]>()\n\n const getOrCollectTransitiveScope = (entryPath: string): readonly string[] => {\n const existing = transitiveScopeCache.get(entryPath)\n if (existing) return existing\n\n const out: string[] = []\n const queue = [entryPath]\n const seen = new Set<string>()\n\n for (let i = 0; i < queue.length; i++) {\n const current = queue[i]\n if (!current) continue\n if (seen.has(current)) continue\n seen.add(current)\n\n const tree = cssTreeByCanonical.get(current)\n if (!tree) continue\n out.push(current)\n\n const imports = tree.file.imports\n for (let j = 0; j < imports.length; j++) {\n const imp = imports[j]\n if (!imp) continue\n const importPath = resolveCss(tree.file.path, imp.path)\n if (importPath === null) continue\n const canonical = canonicalPath(importPath)\n if (seen.has(canonical)) continue\n queue.push(canonical)\n }\n }\n\n transitiveScopeCache.set(entryPath, out)\n return out\n }\n\n const resolveColocatedCss = (solidFilePath: string): string | null => {\n const dotIndex = solidFilePath.lastIndexOf(\".\")\n if (dotIndex === -1) return null\n const stem = solidFilePath.slice(0, dotIndex)\n\n for (let i = 0; i < CSS_COLOCATED_EXTENSIONS.length; i++) {\n const ext = CSS_COLOCATED_EXTENSIONS[i]\n if (!ext) continue\n const candidate = canonicalPath(stem + ext)\n if (cssTreeByCanonical.has(candidate)) return candidate\n }\n\n return null\n }\n\n // ── Pass 1: Build edges and per-file local CSS scopes ──────────────────\n\n const localScopeBySolidFile = new Map<string, Set<string>>()\n const globalSideEffectScope = new Set<string>()\n\n for (const [solidPath, solidTree] of solidTrees) {\n const scope = new Set<string>()\n\n // 1. Co-located CSS\n const colocatedCssPath = resolveColocatedCss(solidPath)\n if (colocatedCssPath !== null) {\n addEdge(solidPath, colocatedCssPath, \"colocated\")\n const colocatedScope = getOrCollectTransitiveScope(colocatedCssPath)\n for (let k = 0; k < colocatedScope.length; k++) {\n const cs = colocatedScope[k]\n if (!cs) continue\n scope.add(cs)\n }\n }\n\n const imports = solidTree.imports\n for (let j = 0; j < imports.length; j++) {\n const imp = imports[j]\n if (!imp) continue\n if (imp.isTypeOnly) continue\n\n // 2. Direct CSS imports (+ transitive @import chains)\n const resolvedCssPath = resolveCss(solidPath, imp.source)\n if (resolvedCssPath !== null) {\n const canonicalCss = canonicalPath(resolvedCssPath)\n addEdge(solidPath, canonicalCss, \"css-import\")\n\n const transitiveScope = getOrCollectTransitiveScope(canonicalCss)\n for (let k = 0; k < transitiveScope.length; k++) {\n const ts = transitiveScope[k]\n if (!ts) continue\n scope.add(ts)\n }\n\n // 5. Global side-effect CSS: bare import without specifiers\n if (imp.specifiers.length === 0) {\n for (let k = 0; k < transitiveScope.length; k++) {\n const ts = transitiveScope[k]\n if (!ts) continue\n globalSideEffectScope.add(ts)\n }\n }\n }\n\n // 4. Cross-component CSS: when importing a component (has specifiers),\n // include CSS co-located with that component.\n if (imp.specifiers.length !== 0) {\n const resolvedSolidPath = resolveSolid(solidPath, imp.source)\n if (resolvedSolidPath !== null) {\n addEdge(solidPath, resolvedSolidPath, \"js-import\")\n\n // Track component importers\n let importerList = componentImporters.get(resolvedSolidPath)\n if (importerList === undefined) {\n importerList = []\n componentImporters.set(resolvedSolidPath, importerList)\n }\n for (let k = 0; k < imp.specifiers.length; k++) {\n const spec = imp.specifiers[k]\n if (!spec) continue\n importerList.push({\n importerFile: solidPath,\n importedName: spec.localName,\n })\n }\n\n const componentCssPath = resolveColocatedCss(resolvedSolidPath)\n if (componentCssPath !== null) {\n const componentCssScope = getOrCollectTransitiveScope(componentCssPath)\n for (let k = 0; k < componentCssScope.length; k++) {\n const cs = componentCssScope[k]\n if (!cs) continue\n scope.add(cs)\n }\n }\n }\n }\n }\n\n localScopeBySolidFile.set(solidPath, scope)\n }\n\n // Build CSS @import edges\n for (const [, cssTree] of cssTrees) {\n const imports = cssTree.file.imports\n for (let i = 0; i < imports.length; i++) {\n const imp = imports[i]\n if (!imp) continue\n const resolvedPath = resolveCss(cssTree.file.path, imp.path)\n if (resolvedPath === null) continue\n addEdge(canonicalPath(cssTree.file.path), canonicalPath(resolvedPath), \"css-at-import\")\n }\n }\n\n // ── Pass 2: Merge global side-effects into all solid file scopes ───────\n\n const cssScopeCache = new Map<string, readonly string[]>()\n\n for (const [solidPath, local] of localScopeBySolidFile) {\n for (const cssPath of globalSideEffectScope) {\n local.add(cssPath)\n }\n const frozen = [...local]\n cssScopeCache.set(solidPath, frozen)\n }\n\n // ── Precompute isInCSSScope sets for O(1) lookup ───────────────────────\n\n const cssScopeSets = new Map<string, ReadonlySet<string>>()\n for (const [solidPath, local] of localScopeBySolidFile) {\n cssScopeSets.set(solidPath, local)\n }\n\n return {\n getDirectDependencies(filePath: string): readonly DependencyEdgeInfo[] {\n return forwardEdges.get(filePath) ?? []\n },\n\n getReverseDependencies(filePath: string): readonly string[] {\n const rev = reverseEdges.get(filePath)\n if (rev === undefined) return []\n return [...rev]\n },\n\n getCSSScope(solidFilePath: string): readonly string[] {\n return cssScopeCache.get(solidFilePath) ?? []\n },\n\n getComponentImporters(solidFilePath: string): readonly ComponentImportEdge[] {\n return componentImporters.get(solidFilePath) ?? []\n },\n\n getTransitivelyAffected(filePath: string): readonly string[] {\n const out: string[] = [filePath]\n const seen = new Set<string>()\n seen.add(filePath)\n\n for (let i = 0; i < out.length; i++) {\n const current = out[i]!\n const rev = reverseEdges.get(current)\n if (rev === undefined) continue\n for (const dep of rev) {\n if (seen.has(dep)) continue\n seen.add(dep)\n out.push(dep)\n }\n }\n\n return out\n },\n\n isInCSSScope(solidFilePath: string, cssFilePath: string): boolean {\n const scopeSet = cssScopeSets.get(solidFilePath)\n if (scopeSet === undefined) return false\n return scopeSet.has(cssFilePath)\n },\n }\n}\n","/**\n * ElementNode type definition + element construction + component host resolution.\n *\n * Moved from cross-file/layout/element-record.ts + cross-file/layout/component-host.ts + build.ts wiring.\n */\nimport { readFileSync, existsSync } from \"node:fs\"\nimport { resolve, dirname, join } from \"node:path\"\nimport ts from \"typescript\"\nimport { ExportKind, type ExportEntity } from \"../../solid/entities/export\"\nimport type { FunctionEntity } from \"../../solid/entities/function\"\nimport type { JSXElementEntity } from \"../../solid/entities/jsx\"\nimport type { VariableEntity } from \"../../solid/entities/variable\"\nimport { buildSolidSyntaxTree } from \"../../solid/impl\"\nimport { createSolidInput } from \"../../solid/create-input\"\nimport type { SolidSyntaxTree } from \"../core/solid-syntax-tree\"\nimport { getStaticStringFromJSXValue, getStaticNumericValue, getStaticStringValue } from \"../../solid/util/static-value\"\nimport { getPropertyKeyName } from \"../../solid/util/pattern-detection\"\nimport { containsJSX } from \"../../solid/util/function\"\nimport { noopLogger, isBlank, Level } from \"@drskillissue/ganko-shared\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\nimport { toKebabCase } from \"@drskillissue/ganko-shared\"\nimport { TextualContentState, isControlTag, isReplacedTag, isMonitoredSignal } from \"./signal-builder\"\nimport type { StyleCompilation } from \"../core/compilation\"\nimport { resolveImportPath, buildPackageIndex } from \"../incremental/dependency-graph\"\nimport { CSS_EXTENSIONS, SOLID_EXTENSIONS } from \"@drskillissue/ganko-shared\"\n\n\n// ── ElementNode ──────────────────────────────────────────────────────────\n\nexport interface ElementNode {\n readonly key: string\n readonly solidFile: string\n readonly elementId: number\n readonly jsxEntity: JSXElementEntity\n readonly tag: string | null\n readonly tagName: string | null\n readonly classTokens: readonly string[]\n readonly classTokenSet: ReadonlySet<string>\n readonly inlineStyleKeys: readonly string[]\n readonly parentElementNode: ElementNode | null\n readonly childElementNodes: readonly ElementNode[]\n readonly previousSiblingNode: ElementNode | null\n readonly siblingIndex: number\n readonly siblingCount: number\n readonly siblingTypeIndex: number\n readonly siblingTypeCount: number\n readonly selectorDispatchKeys: readonly string[]\n readonly attributes: ReadonlyMap<string, string | null>\n readonly inlineStyleValues: ReadonlyMap<string, string>\n readonly textualContent: TextualContentState\n readonly isControl: boolean\n readonly isReplaced: boolean\n}\n\n\n// ── Component host types ────────────────────────────────────────────────\n\nexport interface LayoutComponentHostDescriptor {\n readonly tagName: string | null\n readonly staticAttributes: ReadonlyMap<string, string | null>\n readonly staticClassTokens: readonly string[]\n readonly forwardsChildren: boolean\n readonly attributePropBindings: ReadonlyMap<string, string>\n}\n\nexport interface HostElementRef {\n readonly filePath: string\n readonly element: JSXElementEntity\n}\n\nexport interface ResolvedComponentHost {\n readonly descriptor: LayoutComponentHostDescriptor\n readonly hostElementRef: HostElementRef | null\n}\n\nexport interface ComponentHostResolver {\n resolveHost(importerFile: string, tag: string): ResolvedComponentHost | null\n isTransparentPrimitive(importerFile: string, tag: string): boolean\n}\n\n\n// ── Internal types ───────────────────────────────────────────────────────\n\ninterface MutableElementNode {\n key: string\n solidFile: string\n elementId: number\n jsxEntity: JSXElementEntity\n tag: string | null\n tagName: string | null\n classTokens: readonly string[]\n classTokenSet: ReadonlySet<string>\n inlineStyleKeys: readonly string[]\n parentElementNode: ElementNode | null\n childElementNodes: ElementNode[]\n previousSiblingNode: ElementNode | null\n siblingIndex: number\n siblingCount: number\n siblingTypeIndex: number\n siblingTypeCount: number\n selectorDispatchKeys: readonly string[]\n attributes: ReadonlyMap<string, string | null>\n inlineStyleValues: ReadonlyMap<string, string>\n textualContent: TextualContentState\n isControl: boolean\n isReplaced: boolean\n}\n\ninterface CompositionMeta {\n readonly element: JSXElementEntity\n readonly participates: boolean\n readonly tag: string | null\n readonly tagName: string | null\n readonly resolvedHost: ResolvedComponentHost | null\n}\n\ninterface ComponentBinding {\n readonly kind: \"component\"\n readonly host: ResolvedComponentHost\n}\n\ninterface NamespaceBinding {\n readonly kind: \"namespace\"\n readonly base: ComponentBinding | null\n readonly members: ReadonlyMap<string, LayoutBinding>\n}\n\ntype LayoutBinding = ComponentBinding | NamespaceBinding\n\ninterface ImportBinding {\n readonly source: string\n readonly kind: \"named\" | \"default\" | \"namespace\"\n readonly importedName: string | null\n}\n\ninterface ResolvedComponentHostEntry {\n readonly resolution: \"resolved\"\n readonly descriptor: LayoutComponentHostDescriptor\n readonly hostElementRef: HostElementRef | null\n}\n\ninterface DeferredComponentHostEntry {\n readonly resolution: \"deferred\"\n readonly innerTag: string\n readonly filePath: string\n readonly staticAttributes: ReadonlyMap<string, string | null>\n readonly staticClassTokens: readonly string[]\n readonly forwardsChildren: boolean\n readonly attributePropBindings: ReadonlyMap<string, string>\n}\n\ntype ComponentHostEntry = ResolvedComponentHostEntry | DeferredComponentHostEntry\n\ninterface SolidModuleIndex {\n readonly tree: SolidSyntaxTree\n readonly hostByComponentName: ReadonlyMap<string, ComponentHostEntry>\n readonly variableInitByName: ReadonlyMap<string, ts.Expression>\n readonly importByLocalName: ReadonlyMap<string, ImportBinding>\n readonly exportsByName: ReadonlyMap<string, readonly ExportEntity[]>\n readonly transparentPrimitiveNames: ReadonlySet<string>\n}\n\n\n// ── Constants ────────────────────────────────────────────────────────────\n\nconst EMPTY_INLINE_STYLE_VALUES: ReadonlyMap<string, string> = new Map()\nconst EMPTY_ATTRIBUTES: ReadonlyMap<string, string | null> = new Map()\nconst EMPTY_PROP_BINDINGS: ReadonlyMap<string, string> = new Map()\nconst EMPTY_CLASS_TOKEN_SET: ReadonlySet<string> = new Set()\nconst EMPTY_STRING_LIST: readonly string[] = []\nconst MAX_EXTERNAL_FILES_PARSED = 100\nconst MAX_CHILDREN_REFERENCE_QUEUE_SIZE = 512\n\nconst TRANSPARENT_SOLID_PRIMITIVES = new Set([\n \"For\",\n \"Index\",\n \"Show\",\n \"Switch\",\n \"Match\",\n \"ErrorBoundary\",\n \"Suspense\",\n \"SuspenseList\",\n])\n\nconst HTML_TAG_NAMES: ReadonlySet<string> = new Set([\n \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\",\n \"b\", \"base\", \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\",\n \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\",\n \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\",\n \"em\", \"embed\",\n \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\",\n \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\",\n \"i\", \"iframe\", \"img\", \"input\", \"ins\",\n \"kbd\",\n \"label\", \"legend\", \"li\", \"link\",\n \"main\", \"map\", \"mark\", \"menu\", \"meta\", \"meter\",\n \"nav\", \"noscript\",\n \"object\", \"ol\", \"optgroup\", \"option\", \"output\",\n \"p\", \"picture\", \"pre\", \"progress\",\n \"q\",\n \"rp\", \"rt\", \"ruby\",\n \"s\", \"samp\", \"script\", \"search\", \"section\", \"select\", \"slot\", \"small\", \"source\", \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\",\n \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\",\n \"u\", \"ul\",\n \"var\", \"video\",\n \"wbr\",\n])\n\n\n// ── Local JSX query helpers (work with SolidSyntaxTree directly) ─────────\n\nfunction getStaticClassTokensForTree(tree: SolidSyntaxTree, elementId: number): readonly string[] {\n const idx = tree.staticClassTokensByElementId.get(elementId)\n if (!idx || idx.hasDynamicClass) return EMPTY_STRING_LIST\n return idx.tokens\n}\n\nfunction getStaticClassListKeysForTree(tree: SolidSyntaxTree, elementId: number): readonly string[] {\n const idx = tree.staticClassListKeysByElementId.get(elementId)\n if (!idx) return EMPTY_STRING_LIST\n return idx.keys\n}\n\nfunction getStaticClassTokensForTreeElement(tree: SolidSyntaxTree, element: JSXElementEntity): readonly string[] {\n const out: string[] = []\n const seen = new Set<string>()\n\n const classTokens = getStaticClassTokensForTree(tree, element.id)\n for (let i = 0; i < classTokens.length; i++) {\n const token = classTokens[i]\n if (!token || seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n\n const classListTokens = getStaticClassListKeysForTree(tree, element.id)\n for (let i = 0; i < classListTokens.length; i++) {\n const token = classListTokens[i]\n if (!token || seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n\n return out\n}\n\nfunction getStaticStyleKeysForTree(tree: SolidSyntaxTree, elementId: number): readonly string[] {\n const idx = tree.staticStyleKeysByElementId.get(elementId)\n if (!idx || idx.hasDynamic) return EMPTY_STRING_LIST\n return idx.keys\n}\n\n\n// ── buildElementNodes ────────────────────────────────────────────────────\n\nexport function buildElementNodes(\n solidTree: SolidSyntaxTree,\n compilation: StyleCompilation,\n): ElementNode[] {\n const moduleResolver = createModuleResolverFromCompilation(compilation)\n const componentHostResolver = createComponentHostResolver(compilation.solidTrees, moduleResolver)\n const selectorRequirements = { needsClassTokens: true, needsAttributes: true }\n\n const inlineStyleValuesByElementId = collectInlineStyleValuesByElementId(solidTree)\n const compositionMetaByElementId = collectCompositionMetaByElementId(solidTree, componentHostResolver)\n const textContentMemo = new Map<number, TextualContentState>()\n\n interface FlatRecord {\n readonly element: JSXElementEntity\n readonly key: string\n readonly tag: string | null\n readonly tagName: string | null\n readonly classTokens: readonly string[]\n readonly classTokenSet: ReadonlySet<string>\n readonly inlineStyleKeys: readonly string[]\n readonly attributes: ReadonlyMap<string, string | null>\n readonly selectorDispatchKeys: readonly string[]\n readonly inlineStyleValues: ReadonlyMap<string, string>\n readonly textualContent: TextualContentState\n readonly parentElementId: number | null\n }\n\n const records: FlatRecord[] = []\n const jsxElements = solidTree.jsxElements\n\n for (let i = 0; i < jsxElements.length; i++) {\n const element = jsxElements[i]\n if (!element) continue\n const meta = compositionMetaByElementId.get(element.id)\n if (!meta || !meta.participates) continue\n\n const localClassTokens = selectorRequirements.needsClassTokens\n ? getStaticClassTokensForTreeElement(solidTree, element)\n : EMPTY_STRING_LIST\n const classTokens = mergeClassTokens(localClassTokens, meta.resolvedHost?.descriptor.staticClassTokens)\n const classTokenSet = classTokens.length === 0 ? EMPTY_CLASS_TOKEN_SET : createClassTokenSet(classTokens)\n const inlineStyleKeys = getStaticStyleKeysForTree(solidTree, element.id)\n const localAttributes = selectorRequirements.needsAttributes\n ? collectStaticAttributes(element)\n : EMPTY_ATTRIBUTES\n const attributes = mergeCallSiteAttributes(localAttributes, meta.resolvedHost?.descriptor.staticAttributes, meta.resolvedHost?.descriptor.attributePropBindings)\n const selectorDispatchKeys = buildSelectorDispatchKeys(attributes, classTokens)\n const inlineStyleValues = inlineStyleValuesByElementId.get(element.id) ?? EMPTY_INLINE_STYLE_VALUES\n const textualContent = getTextualContentState(element, textContentMemo, compositionMetaByElementId)\n const parentElementId = resolveComposedParentElementId(element, compositionMetaByElementId)\n\n records.push({\n element,\n key: `${solidTree.filePath}::${element.id}`,\n tag: meta.tag,\n tagName: meta.tagName,\n classTokens,\n classTokenSet,\n inlineStyleKeys,\n attributes,\n selectorDispatchKeys,\n inlineStyleValues,\n textualContent,\n parentElementId,\n })\n }\n\n // Compute sibling totals\n const siblingCountByParentId = new Map<number, number>()\n const siblingTypeCountByParentId = new Map<number, Map<string, number>>()\n for (let i = 0; i < records.length; i++) {\n const record = records[i]\n if (!record) continue\n const parentElementId = record.parentElementId\n if (parentElementId === null) continue\n siblingCountByParentId.set(parentElementId, (siblingCountByParentId.get(parentElementId) ?? 0) + 1)\n if (record.tagName !== null) {\n let byType = siblingTypeCountByParentId.get(parentElementId)\n if (!byType) { byType = new Map(); siblingTypeCountByParentId.set(parentElementId, byType) }\n byType.set(record.tagName, (byType.get(record.tagName) ?? 0) + 1)\n }\n }\n\n // Wire into ElementNode tree\n const elements: MutableElementNode[] = []\n const nodeByElementId = new Map<number, MutableElementNode>()\n const lastChildByParentId = new Map<number, MutableElementNode>()\n const siblingTypeSeenByParentId = new Map<number, Map<string, number>>()\n\n for (let i = 0; i < records.length; i++) {\n const record = records[i]\n if (!record) continue\n\n const parentElementId = record.parentElementId\n const parentNode = parentElementId === null ? null : (nodeByElementId.get(parentElementId) ?? null)\n const previousSiblingNode = parentElementId === null ? null : (lastChildByParentId.get(parentElementId) ?? null)\n const siblingIndex = previousSiblingNode ? previousSiblingNode.siblingIndex + 1 : 1\n const siblingCount = parentElementId === null ? 1 : (siblingCountByParentId.get(parentElementId) ?? 1)\n const siblingTypeIndex = resolveSiblingTypeIndex(siblingTypeSeenByParentId, parentElementId, record.tagName, siblingIndex)\n const siblingTypeCount = resolveSiblingTypeCount(siblingTypeCountByParentId, parentElementId, record.tagName, siblingCount)\n\n const node: MutableElementNode = {\n key: record.key,\n solidFile: solidTree.filePath,\n elementId: record.element.id,\n jsxEntity: record.element,\n tag: record.tag,\n tagName: record.tagName,\n classTokens: record.classTokens,\n classTokenSet: record.classTokenSet,\n inlineStyleKeys: record.inlineStyleKeys,\n parentElementNode: parentNode,\n childElementNodes: [],\n previousSiblingNode: previousSiblingNode,\n siblingIndex,\n siblingCount,\n siblingTypeIndex,\n siblingTypeCount,\n selectorDispatchKeys: record.selectorDispatchKeys,\n attributes: record.attributes,\n inlineStyleValues: record.inlineStyleValues,\n textualContent: record.textualContent,\n isControl: isControlTag(record.tagName),\n isReplaced: isReplacedTag(record.tagName),\n }\n\n elements.push(node)\n nodeByElementId.set(record.element.id, node)\n if (parentElementId !== null) lastChildByParentId.set(parentElementId, node)\n if (parentNode !== null) {\n (parentNode.childElementNodes).push(node)\n }\n }\n\n return elements\n}\n\n\n// ── Inline style collection ──────────────────────────────────────────────\n\nfunction collectInlineStyleValuesByElementId(tree: SolidSyntaxTree): ReadonlyMap<number, ReadonlyMap<string, string>> {\n const out = new Map<number, Map<string, string>>()\n const styleProperties = tree.styleProperties\n\n for (let i = 0; i < styleProperties.length; i++) {\n const entry = styleProperties[i]\n if (!entry) continue\n const property = entry.property\n if (!ts.isPropertyAssignment(property)) continue\n\n const keyName = getPropertyKeyName(property.name)\n if (!keyName) continue\n\n const normalizedKey = normalizeStyleKey(keyName)\n if (!isMonitoredSignal(normalizedKey)) continue\n const value = getStaticStyleValue(property.initializer)\n if (value === null) continue\n\n const existing = out.get(entry.element.id)\n if (existing) { existing.set(normalizedKey, value); continue }\n const next = new Map<string, string>()\n next.set(normalizedKey, value)\n out.set(entry.element.id, next)\n }\n\n return out\n}\n\nfunction normalizeStyleKey(key: string): string {\n if (key.includes(\"-\")) return key.toLowerCase()\n return toKebabCase(key)\n}\n\nfunction getStaticStyleValue(node: ts.Node): string | null {\n const staticString = getStaticStringValue(node)\n if (staticString !== null) return staticString\n const staticNumber = getStaticNumericValue(node)\n if (staticNumber === null) return null\n return String(staticNumber)\n}\n\n\n// ── Composition meta ─────────────────────────────────────────────────────\n\nfunction collectCompositionMetaByElementId(\n tree: SolidSyntaxTree,\n componentHostResolver: ComponentHostResolver,\n): ReadonlyMap<number, CompositionMeta> {\n const out = new Map<number, CompositionMeta>()\n\n for (let i = 0; i < tree.jsxElements.length; i++) {\n const element = tree.jsxElements[i]\n if (!element) continue\n\n const resolvedHost = resolveHostForElement(componentHostResolver, tree.filePath, element)\n const isTransparentPrimitive = resolveTransparentPrimitiveStatus(componentHostResolver, tree.filePath, element, resolvedHost)\n const participates = element.tag !== null && !isTransparentPrimitive\n const tag = resolveEffectiveTag(element, resolvedHost?.descriptor ?? null)\n const tagName = tag ? tag.toLowerCase() : null\n\n out.set(element.id, { element, participates, tag, tagName, resolvedHost })\n }\n\n return out\n}\n\nfunction resolveHostForElement(\n componentHostResolver: ComponentHostResolver,\n solidFile: string,\n element: JSXElementEntity,\n): ResolvedComponentHost | null {\n if (element.tag === null) return null\n if (element.isDomElement) return null\n\n const defaultHost = componentHostResolver.resolveHost(solidFile, element.tag)\n\n const asTag = extractPolymorphicAsTag(element)\n if (asTag !== null) {\n const asHost = componentHostResolver.resolveHost(solidFile, asTag)\n if (asHost !== null) return composePolymorphicHost(defaultHost, asHost)\n }\n\n return defaultHost\n}\n\nfunction extractPolymorphicAsTag(element: JSXElementEntity): string | null {\n for (let i = 0; i < element.attributes.length; i++) {\n const attr = element.attributes[i]\n if (!attr) continue\n if (attr.name !== \"as\") continue\n if (attr.valueNode === null) continue\n if (!ts.isJsxExpression(attr.valueNode)) continue\n const expression = attr.valueNode.expression\n if (!expression) continue\n if (ts.isIdentifier(expression)) return expression.text\n if (ts.isPropertyAccessExpression(expression)) return expression.getText()\n return null\n }\n return null\n}\n\nfunction composePolymorphicHost(\n outerHost: ResolvedComponentHost | null,\n asHost: ResolvedComponentHost,\n): ResolvedComponentHost {\n if (outerHost === null) return asHost\n\n const outerDesc = outerHost.descriptor\n const asDesc = asHost.descriptor\n\n const staticAttributes = new Map<string, string | null>()\n for (const [name, value] of outerDesc.staticAttributes) staticAttributes.set(name, value)\n for (const [name, value] of asDesc.staticAttributes) staticAttributes.set(name, value)\n\n const classTokenSet = new Set<string>()\n const staticClassTokens: string[] = []\n for (const token of outerDesc.staticClassTokens) {\n if (!classTokenSet.has(token)) { classTokenSet.add(token); staticClassTokens.push(token) }\n }\n for (const token of asDesc.staticClassTokens) {\n if (!classTokenSet.has(token)) { classTokenSet.add(token); staticClassTokens.push(token) }\n }\n\n const attributePropBindings = new Map<string, string>()\n for (const [name, value] of outerDesc.attributePropBindings) attributePropBindings.set(name, value)\n for (const [name, value] of asDesc.attributePropBindings) attributePropBindings.set(name, value)\n\n return {\n descriptor: {\n tagName: asDesc.tagName ?? outerDesc.tagName,\n staticAttributes,\n staticClassTokens,\n forwardsChildren: asDesc.forwardsChildren || outerDesc.forwardsChildren,\n attributePropBindings,\n },\n hostElementRef: asHost.hostElementRef ?? outerHost.hostElementRef,\n }\n}\n\nfunction resolveTransparentPrimitiveStatus(\n componentHostResolver: ComponentHostResolver,\n solidFile: string,\n element: JSXElementEntity,\n resolvedHost: ResolvedComponentHost | null,\n): boolean {\n if (element.tag === null) return false\n if (element.isDomElement) return false\n if (resolvedHost !== null) return false\n return componentHostResolver.isTransparentPrimitive(solidFile, element.tag)\n}\n\nfunction resolveEffectiveTag(element: JSXElementEntity, hostDescriptor: LayoutComponentHostDescriptor | null): string | null {\n if (hostDescriptor !== null) return hostDescriptor.tagName\n if (!element.isDomElement) return null\n return element.tag\n}\n\nfunction resolveComposedParentElementId(\n element: JSXElementEntity,\n compositionMetaByElementId: ReadonlyMap<number, CompositionMeta>,\n): number | null {\n let parent = element.parent\n while (parent !== null) {\n const meta = compositionMetaByElementId.get(parent.id)\n if (meta && meta.participates) return parent.id\n parent = parent.parent\n }\n return null\n}\n\n\n// ── Textual content state ────────────────────────────────────────────────\n\nfunction getTextualContentState(\n element: JSXElementEntity,\n memo: Map<number, TextualContentState>,\n compositionMetaByElementId: ReadonlyMap<number, CompositionMeta>,\n logger: Logger = noopLogger,\n): TextualContentState {\n const existing = memo.get(element.id)\n if (existing !== undefined) return existing\n\n let hasTextOnlyExpression = false\n\n for (let i = 0; i < element.children.length; i++) {\n const child = element.children[i]\n if (!child) continue\n if (child.kind === \"expression\") {\n if (isStructuralExpression(child.node)) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} → unknown (structural expression child)`)\n memo.set(element.id, TextualContentState.Unknown)\n return TextualContentState.Unknown\n }\n hasTextOnlyExpression = true\n continue\n }\n if (child.kind !== \"text\") continue\n if (!ts.isJsxText(child.node)) continue\n if (isBlank(child.node.text)) continue\n memo.set(element.id, TextualContentState.Yes)\n return TextualContentState.Yes\n }\n\n let childHasUnknown = false\n let childHasDynamicText = false\n\n for (let i = 0; i < element.childElements.length; i++) {\n const child = element.childElements[i]\n if (!child) continue\n const childState = getTextualContentState(child, memo, compositionMetaByElementId, logger)\n\n if (!child.isDomElement) {\n const childMeta = compositionMetaByElementId.get(child.id)\n if (childMeta !== undefined && isControlTag(childMeta.tagName)) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id}: non-DOM child ${child.tag}#${child.id} resolves to control tag=${childMeta.tagName}, skipping`)\n continue\n }\n\n if (childState !== TextualContentState.No) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id}: non-DOM child ${child.tag ?? child.id}#${child.id} has state=${childState} → childHasUnknown`)\n childHasUnknown = true\n }\n continue\n }\n\n if (childState === TextualContentState.Yes) {\n memo.set(element.id, TextualContentState.Yes)\n return TextualContentState.Yes\n }\n if (childState === TextualContentState.Unknown) childHasUnknown = true\n if (childState === TextualContentState.DynamicText) childHasDynamicText = true\n }\n\n if (childHasUnknown) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} → unknown (child has unknown)`)\n memo.set(element.id, TextualContentState.Unknown)\n return TextualContentState.Unknown\n }\n\n if (hasTextOnlyExpression || childHasDynamicText) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} → dynamic-text`)\n memo.set(element.id, TextualContentState.DynamicText)\n return TextualContentState.DynamicText\n }\n\n memo.set(element.id, TextualContentState.No)\n return TextualContentState.No\n}\n\nfunction isStructuralExpression(node: ts.Node): boolean {\n if (!ts.isJsxExpression(node)) return false\n const expr = node.expression\n if (!expr) return false\n return containsJSX(expr)\n}\n\n\n// ── Element record helpers ───────────────────────────────────────────────\n\nfunction mergeClassTokens(localTokens: readonly string[], hostTokens: readonly string[] | undefined): readonly string[] {\n if (hostTokens === undefined || hostTokens.length === 0) return localTokens\n if (localTokens.length === 0) return hostTokens\n const out: string[] = []\n const seen = new Set<string>()\n for (let i = 0; i < hostTokens.length; i++) {\n const token = hostTokens[i]\n if (!token || seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n for (let i = 0; i < localTokens.length; i++) {\n const token = localTokens[i]\n if (!token || seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n return out\n}\n\nfunction mergeCallSiteAttributes(\n localAttributes: ReadonlyMap<string, string | null>,\n hostAttributes: ReadonlyMap<string, string | null> | undefined,\n propBindings: ReadonlyMap<string, string> | undefined,\n): ReadonlyMap<string, string | null> {\n if (hostAttributes === undefined || hostAttributes.size === 0) return localAttributes\n if (localAttributes.size === 0 && (propBindings === undefined || propBindings.size === 0)) return hostAttributes\n\n const out = new Map<string, string | null>()\n for (const [name, value] of hostAttributes) {\n if (propBindings !== undefined) {\n const propName = propBindings.get(name)\n if (propName !== undefined) {\n const callSiteValue = localAttributes.get(propName)\n if (callSiteValue !== undefined && callSiteValue !== null) {\n out.set(name, callSiteValue)\n continue\n }\n }\n }\n out.set(name, value)\n }\n for (const [name, value] of localAttributes) {\n out.set(name, value)\n }\n return out\n}\n\nfunction createClassTokenSet(tokens: readonly string[]): ReadonlySet<string> {\n const set = new Set<string>()\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (token) set.add(token)\n }\n return set\n}\n\nfunction buildSelectorDispatchKeys(attributes: ReadonlyMap<string, string | null>, classTokens: readonly string[]): readonly string[] {\n const out: string[] = []\n const idValue = attributes.get(\"id\")\n if (idValue !== null && idValue !== undefined) out.push(`id:${idValue}`)\n for (let i = 0; i < classTokens.length; i++) out.push(`class:${classTokens[i]}`)\n for (const attributeName of attributes.keys()) out.push(`attr:${attributeName}`)\n if (out.length <= 1) return out\n out.sort()\n return dedupeSorted(out)\n}\n\nfunction dedupeSorted(values: readonly string[]): readonly string[] {\n if (values.length <= 1) return values\n const first = values[0]\n if (first === undefined) return values\n const out: string[] = [first]\n for (let i = 1; i < values.length; i++) {\n const value = values[i]\n if (value === undefined || value === out[out.length - 1]) continue\n out.push(value)\n }\n return out\n}\n\nfunction resolveSiblingTypeIndex(\n seenByParentId: Map<number, Map<string, number>>,\n parentElementId: number | null,\n tagName: string | null,\n siblingIndex: number,\n): number {\n if (parentElementId === null || tagName === null) return siblingIndex\n const seen = seenByParentId.get(parentElementId)\n if (!seen) {\n const next = new Map<string, number>()\n next.set(tagName, 1)\n seenByParentId.set(parentElementId, next)\n return 1\n }\n const count = (seen.get(tagName) ?? 0) + 1\n seen.set(tagName, count)\n return count\n}\n\nfunction resolveSiblingTypeCount(\n totalsByParentId: ReadonlyMap<number, ReadonlyMap<string, number>>,\n parentElementId: number | null,\n tagName: string | null,\n siblingCount: number,\n): number {\n if (parentElementId === null || tagName === null) return siblingCount\n const totals = totalsByParentId.get(parentElementId)\n if (!totals) return 1\n return totals.get(tagName) ?? 1\n}\n\n\n// ── Static attribute collection (exported) ───────────────────────────────\n\nexport function collectStaticAttributes(element: JSXElementEntity): ReadonlyMap<string, string | null> {\n let out: Map<string, string | null> | null = null\n\n for (let i = 0; i < element.attributes.length; i++) {\n const attribute = element.attributes[i]\n if (!attribute) continue\n if (!ts.isJsxAttribute(attribute.node)) continue\n if (!attribute.name) continue\n const name = attribute.name.toLowerCase()\n\n if (attribute.valueNode === null) {\n if (out === null) out = new Map<string, string | null>()\n out.set(name, null)\n continue\n }\n\n const value = getStaticStringFromJSXValue(attribute.valueNode)\n if (out === null) out = new Map<string, string | null>()\n out.set(name, value)\n }\n\n if (out === null) return EMPTY_ATTRIBUTES\n return out\n}\n\nfunction extractPropMemberName(node: ts.Node): string | null {\n if (!ts.isJsxExpression(node)) return null\n const expression = node.expression\n if (!expression) return null\n return extractMemberNameFromExpression(expression)\n}\n\nfunction extractMemberNameFromExpression(expression: ts.Expression): string | null {\n if (ts.isPropertyAccessExpression(expression)) {\n return expression.name.text\n }\n if (ts.isCallExpression(expression) && ts.isPropertyAccessExpression(expression.expression) && expression.arguments.length === 0) {\n return expression.expression.name.text\n }\n if (ts.isBinaryExpression(expression) && expression.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken) {\n return extractMemberNameFromExpression(expression.left)\n }\n return null\n}\n\nexport function collectAttributePropBindings(element: JSXElementEntity): ReadonlyMap<string, string> {\n let out: Map<string, string> | null = null\n\n for (let i = 0; i < element.attributes.length; i++) {\n const attribute = element.attributes[i]\n if (!attribute) continue\n if (!ts.isJsxAttribute(attribute.node)) continue\n if (!attribute.name) continue\n if (attribute.valueNode === null) continue\n\n const propName = extractPropMemberName(attribute.valueNode)\n if (propName === null) continue\n\n const attrName = attribute.name.toLowerCase()\n if (out === null) out = new Map<string, string>()\n out.set(attrName, propName)\n }\n\n if (out === null) return EMPTY_PROP_BINDINGS\n return out\n}\n\n\n// ── Module resolver interface ─────────────────────────────────────────────\n\ninterface ModuleResolver {\n resolveSolid(importerFile: string, source: string): string | null\n resolveCss(importerFile: string, source: string): string | null\n}\n\n\n// ── resolveExternalModule (moved from cross-file/layout/module-resolver.ts) ─\n\nfunction resolveExternalModule(importerFile: string, importSource: string): string | null {\n if (importSource.length === 0) return null\n if (importSource.startsWith(\"http://\") || importSource.startsWith(\"https://\") || importSource.startsWith(\"data:\")) return null\n if (importSource.startsWith(\".\") || importSource.startsWith(\"/\")) {\n const basePath = importSource.startsWith(\"/\") ? resolve(importSource) : resolve(dirname(resolve(importerFile)), importSource)\n return resolveExternalFromBasePath(basePath)\n }\n return resolveExternalPackage(importerFile, importSource)\n}\n\nfunction resolveExternalFromBasePath(basePath: string): string | null {\n const normalizedBase = resolve(basePath)\n const candidates = [normalizedBase]\n for (let i = 0; i < SOLID_EXTENSIONS.length; i++) candidates.push(normalizedBase + SOLID_EXTENSIONS[i])\n for (let i = 0; i < SOLID_EXTENSIONS.length; i++) candidates.push(join(normalizedBase, `index${SOLID_EXTENSIONS[i]}`))\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i]\n if (!candidate) continue\n if (existsSync(candidate)) return candidate\n }\n return null\n}\n\nfunction resolveExternalPackage(importerFile: string, source: string): string | null {\n const { packageName, subpath } = parseExternalPackageSpecifier(source)\n if (packageName === null) return null\n const packageDir = findNodeModulesPackage(importerFile, packageName)\n if (packageDir === null) return null\n const packageJsonPath = join(packageDir, \"package.json\")\n let entry: { name: string; exportsValue: ExternalPackageExportNode | null } | null = null\n try {\n const raw = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"))\n if (typeof raw === \"object\" && raw !== null && typeof raw.name === \"string\") {\n entry = { name: raw.name, exportsValue: parseExternalExportNode(raw.exports) }\n }\n } catch { /* ignore */ }\n if (entry === null) return null\n\n const exportSubpath = subpath === null ? \".\" : `./${subpath}`\n const EXTERNAL_CONDITIONS = [\"solid\", \"import\", \"default\"]\n const exported = resolveExternalExportTarget(entry.exportsValue, exportSubpath, EXTERNAL_CONDITIONS)\n if (exported !== null) {\n const resolved = resolveExternalFromBasePath(resolve(packageDir, exported))\n if (resolved !== null) return resolved\n }\n if (subpath !== null) {\n const direct = resolveExternalFromBasePath(resolve(packageDir, subpath))\n if (direct !== null) return direct\n const fromSrc = resolveExternalFromBasePath(resolve(packageDir, \"src\", subpath))\n if (fromSrc !== null) return fromSrc\n } else {\n const fromRoot = resolveExternalFromBasePath(resolve(packageDir, \"index\"))\n if (fromRoot !== null) return fromRoot\n const fromSrc = resolveExternalFromBasePath(resolve(packageDir, \"src/index\"))\n if (fromSrc !== null) return fromSrc\n }\n return null\n}\n\nfunction parseExternalPackageSpecifier(source: string): { packageName: string | null; subpath: string | null } {\n if (source.startsWith(\"@\")) {\n const firstSlash = source.indexOf(\"/\")\n if (firstSlash < 0) return { packageName: null, subpath: null }\n const secondSlash = source.indexOf(\"/\", firstSlash + 1)\n if (secondSlash < 0) return { packageName: source, subpath: null }\n return { packageName: source.slice(0, secondSlash), subpath: source.slice(secondSlash + 1) }\n }\n const firstSlash = source.indexOf(\"/\")\n if (firstSlash < 0) return { packageName: source, subpath: null }\n return { packageName: source.slice(0, firstSlash), subpath: source.slice(firstSlash + 1) }\n}\n\nfunction findNodeModulesPackage(importerFile: string, packageName: string): string | null {\n let current = dirname(resolve(importerFile))\n while (true) {\n const candidate = join(current, \"node_modules\", packageName)\n if (existsSync(join(candidate, \"package.json\"))) return candidate\n const parent = dirname(current)\n if (parent === current) return null\n current = parent\n }\n}\n\ntype ExternalPackageExportNode = { kind: \"path\"; value: string } | { kind: \"array\"; values: ExternalPackageExportNode[] } | { kind: \"map\"; fields: Map<string, ExternalPackageExportNode> }\n\ntype JsonValue = string | number | boolean | null | undefined | JsonValue[] | { [key: string]: JsonValue }\n\nfunction parseExternalExportNode(value: JsonValue): ExternalPackageExportNode | null {\n if (typeof value === \"string\") return { kind: \"path\", value }\n if (Array.isArray(value)) {\n const values: ExternalPackageExportNode[] = []\n for (let i = 0; i < value.length; i++) { const parsed = parseExternalExportNode(value[i]); if (parsed !== null) values.push(parsed) }\n return { kind: \"array\", values }\n }\n if (typeof value !== \"object\" || value === null) return null\n const fields = new Map<string, ExternalPackageExportNode>()\n for (const [key, nested] of Object.entries(value)) { const parsed = parseExternalExportNode(nested); if (parsed !== null) fields.set(key, parsed) }\n return { kind: \"map\", fields }\n}\n\nfunction resolveExternalExportTarget(node: ExternalPackageExportNode | null, subpath: string, conditions: readonly string[]): string | null {\n if (node === null) return null\n if (node.kind === \"path\") return node.value\n if (node.kind === \"array\") {\n for (let i = 0; i < node.values.length; i++) { const v = node.values[i]; if (!v) continue; const r = resolveExternalExportTarget(v, subpath, conditions); if (r !== null) return r }\n return null\n }\n const exact = node.fields.get(subpath)\n if (exact) { const r = resolveExternalExportCondition(exact, conditions); if (r !== null) return r }\n for (const [key, value] of node.fields) {\n const star = key.indexOf(\"*\"); if (star < 0) continue\n const prefix = key.slice(0, star); const suffix = key.slice(star + 1)\n if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix)) continue\n const captured = subpath.slice(prefix.length, subpath.length - suffix.length)\n const target = resolveExternalExportCondition(value, conditions)\n if (target === null) continue\n return target.includes(\"*\") ? target.replaceAll(\"*\", captured) : target\n }\n if (subpath === \".\") { const root = node.fields.get(\".\"); if (root) { const r = resolveExternalExportCondition(root, conditions); if (r !== null) return r } }\n return resolveExternalExportCondition(node, conditions)\n}\n\nfunction resolveExternalExportCondition(node: ExternalPackageExportNode | undefined, conditions: readonly string[]): string | null {\n if (node === undefined) return null\n if (node.kind === \"path\") return node.value\n if (node.kind === \"array\") {\n for (let i = 0; i < node.values.length; i++) { const r = resolveExternalExportCondition(node.values[i], conditions); if (r !== null) return r }\n return null\n }\n for (let i = 0; i < conditions.length; i++) { const c = conditions[i]; if (!c) continue; const r = resolveExternalExportCondition(node.fields.get(c), conditions); if (r !== null) return r }\n for (const next of node.fields.values()) { const r = resolveExternalExportCondition(next, conditions); if (r !== null) return r }\n return null\n}\n\n\n// ── Module resolver from compilation ─────────────────────────────────────\n\nfunction createModuleResolverFromCompilation(compilation: StyleCompilation): ModuleResolver {\n const solidPathSet = new Set<string>()\n for (const key of compilation.solidTrees.keys()) solidPathSet.add(resolve(key))\n\n const cssPathSet = new Set<string>()\n for (const key of compilation.cssTrees.keys()) cssPathSet.add(resolve(key))\n\n const packageEntries = buildPackageIndex(solidPathSet, cssPathSet)\n\n return {\n resolveSolid(importerFile: string, source: string): string | null {\n return resolveImportPath({\n importerFile,\n source,\n availablePaths: solidPathSet,\n extensions: SOLID_EXTENSIONS,\n packageEntries,\n allowPartialFiles: false,\n })\n },\n resolveCss(importerFile: string, source: string): string | null {\n return resolveImportPath({\n importerFile,\n source,\n availablePaths: cssPathSet,\n extensions: CSS_EXTENSIONS,\n packageEntries,\n allowPartialFiles: true,\n })\n },\n }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Component Host Resolution\n// Moved from cross-file/layout/component-host.ts (1452 lines)\n// ══════════════════════════════════════════════════════════════════════════\n\nexport function createComponentHostResolver(\n allSolidTrees: ReadonlyMap<string, SolidSyntaxTree>,\n moduleResolver: ModuleResolver,\n logger: Logger = noopLogger,\n): ComponentHostResolver {\n const moduleIndexes = new Map(buildSolidModuleIndexes(allSolidTrees))\n const externalResolutionCache = new Map<string, string | null>()\n let externalFilesParsed = 0\n const localBindingCache = new Map<string, LayoutBinding | null>()\n const exportBindingCache = new Map<string, LayoutBinding | null>()\n const namespaceBindingCache = new Map<string, NamespaceBinding | null>()\n const resolvingLocal = new Set<string>()\n const resolvingExport = new Set<string>()\n const hostByTagCache = new Map<string, ResolvedComponentHost | null>()\n\n return {\n resolveHost(importerFile, tag) {\n const normalizedFile = resolve(importerFile)\n const cacheKey = `${normalizedFile}::${tag}`\n const cached = hostByTagCache.get(cacheKey)\n if (cached !== undefined) return cached\n\n const binding = resolveTagBinding(normalizedFile, tag)\n if (binding === null) {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): binding=null`)\n hostByTagCache.set(cacheKey, null)\n return null\n }\n\n if (binding.kind === \"component\") {\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): component, tagName=${binding.host.descriptor.tagName}, attrs=[${[...binding.host.descriptor.staticAttributes.keys()]}]`)\n hostByTagCache.set(cacheKey, binding.host)\n return binding.host\n }\n\n const host = binding.base ? binding.base.host : null\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): namespace, base=${host?.descriptor.tagName ?? \"null\"}`)\n hostByTagCache.set(cacheKey, host)\n return host\n },\n\n isTransparentPrimitive(importerFile, tag) {\n const root = readTagRoot(tag)\n if (root === null) return false\n\n const index = moduleIndexes.get(resolve(importerFile))\n if (!index) return false\n return index.transparentPrimitiveNames.has(root)\n },\n }\n\n function resolveComponentHostEntry(entry: ComponentHostEntry): ResolvedComponentHost | null {\n if (entry.resolution === \"resolved\") {\n return { descriptor: entry.descriptor, hostElementRef: entry.hostElementRef }\n }\n\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveComponentHostEntry: deferred innerTag=${entry.innerTag}, file=${entry.filePath}, attrs=[${[...entry.staticAttributes.keys()]}]`)\n\n const innerBinding = resolveLocalIdentifierBinding(entry.filePath, entry.innerTag)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerBinding=${innerBinding === null ? \"null\" : innerBinding.kind}`)\n const innerHost = extractHostFromBinding(innerBinding)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerHost=${innerHost === null ? \"null\" : `tagName=${innerHost.descriptor.tagName}, attrs=[${[...innerHost.descriptor.staticAttributes.keys()]}]`}`)\n\n let tagName = innerHost !== null ? innerHost.descriptor.tagName : null\n if (tagName === null) {\n tagName = resolveTagNameFromPolymorphicProp(entry.staticAttributes)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] polymorphic fallback: tagName=${tagName}`)\n }\n const staticAttributes = innerHost !== null\n ? mergeStaticAttributes(entry.staticAttributes, innerHost.descriptor.staticAttributes)\n : entry.staticAttributes\n const staticClassTokens = innerHost !== null\n ? mergeStaticClassTokens(entry.staticClassTokens, innerHost.descriptor.staticClassTokens)\n : entry.staticClassTokens\n const forwardsChildren = entry.forwardsChildren || (innerHost !== null && innerHost.descriptor.forwardsChildren)\n const attributePropBindings = innerHost !== null\n ? mergePropBindings(entry.attributePropBindings, innerHost.descriptor.attributePropBindings)\n : entry.attributePropBindings\n\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolved: tagName=${tagName}, attrs=[${[...staticAttributes.keys()]}], classes=[${staticClassTokens}]`)\n\n return {\n descriptor: { tagName, staticAttributes, staticClassTokens, forwardsChildren, attributePropBindings },\n hostElementRef: innerHost?.hostElementRef ?? null,\n }\n }\n\n function extractHostFromBinding(binding: LayoutBinding | null): ResolvedComponentHost | null {\n if (binding === null) return null\n if (binding.kind === \"component\") return binding.host\n return binding.base !== null ? binding.base.host : null\n }\n\n function resolveTagBinding(filePath: string, tag: string): LayoutBinding | null {\n const parts = splitTagPath(tag)\n if (parts.length === 0) return null\n\n const firstPart = parts[0]\n if (!firstPart) return null\n let binding = resolveLocalIdentifierBinding(filePath, firstPart)\n if (binding === null) return null\n\n for (let i = 1; i < parts.length; i++) {\n if (binding.kind !== \"namespace\") return null\n const part = parts[i]\n if (!part) return null\n const next = binding.members.get(part)\n if (!next) return null\n binding = next\n }\n\n return binding\n }\n\n function resolveLocalIdentifierBinding(filePath: string, name: string): LayoutBinding | null {\n const key = `${filePath}::${name}`\n const cached = localBindingCache.get(key)\n if (cached !== undefined) return cached\n if (resolvingLocal.has(key)) return null\n resolvingLocal.add(key)\n\n const index = moduleIndexes.get(filePath)\n if (!index) {\n localBindingCache.set(key, null)\n resolvingLocal.delete(key)\n return null\n }\n\n const hostEntry = index.hostByComponentName.get(name)\n if (hostEntry) {\n const resolved = resolveComponentHostEntry(hostEntry)\n if (resolved !== null) {\n const binding: ComponentBinding = { kind: \"component\", host: resolved }\n localBindingCache.set(key, binding)\n resolvingLocal.delete(key)\n return binding\n }\n }\n\n const variableInit = index.variableInitByName.get(name)\n if (variableInit) {\n const binding = resolveBindingFromExpression(filePath, variableInit)\n localBindingCache.set(key, binding)\n resolvingLocal.delete(key)\n return binding\n }\n\n const importBinding = index.importByLocalName.get(name)\n if (importBinding) {\n const binding = resolveBindingFromImport(filePath, importBinding)\n localBindingCache.set(key, binding)\n resolvingLocal.delete(key)\n return binding\n }\n\n localBindingCache.set(key, null)\n resolvingLocal.delete(key)\n return null\n }\n\n function resolveBindingFromExpression(filePath: string, expression: ts.Expression): LayoutBinding | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isIdentifier(unwrapped)) {\n return resolveLocalIdentifierBinding(filePath, unwrapped.text)\n }\n\n if (ts.isPropertyAccessExpression(unwrapped)) {\n return resolveBindingFromMemberExpression(filePath, unwrapped)\n }\n\n if (ts.isCallExpression(unwrapped)) {\n return resolveBindingFromCallExpression(filePath, unwrapped)\n }\n\n if (ts.isObjectLiteralExpression(unwrapped)) {\n return resolveNamespaceFromObjectExpression(filePath, unwrapped, null)\n }\n\n if (ts.isCommaListExpression(unwrapped)) {\n if (unwrapped.elements.length === 0) return null\n const lastExpr = unwrapped.elements[unwrapped.elements.length - 1]\n if (!lastExpr) return null\n return resolveBindingFromExpression(filePath, lastExpr)\n }\n\n return null\n }\n\n function resolveBindingFromMemberExpression(\n filePath: string,\n expression: ts.PropertyAccessExpression,\n ): LayoutBinding | null {\n if (expression.expression.kind === ts.SyntaxKind.SuperKeyword) return null\n\n const objectBinding = resolveBindingFromExpression(filePath, expression.expression)\n if (objectBinding === null) return null\n if (objectBinding.kind !== \"namespace\") return null\n return objectBinding.members.get(expression.name.text) ?? null\n }\n\n function resolveBindingFromCallExpression(\n filePath: string,\n expression: ts.CallExpression,\n ): LayoutBinding | null {\n if (!isObjectAssignCall(expression)) return null\n if (expression.arguments.length === 0) return null\n\n const firstArg = expression.arguments[0]\n if (!firstArg) return null\n const baseExpression = toExpressionArgument(firstArg)\n if (baseExpression === null) return null\n const baseBinding = resolveBindingFromExpression(filePath, baseExpression)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] Object.assign base: ${baseBinding === null ? \"null\" : baseBinding.kind}${baseBinding?.kind === \"component\" ? `, tagName=${baseBinding.host.descriptor.tagName}` : \"\"}`)\n\n let baseComponent: ComponentBinding | null = null\n const members = new Map<string, LayoutBinding>()\n\n if (baseBinding && baseBinding.kind === \"component\") {\n baseComponent = baseBinding\n }\n\n if (baseBinding && baseBinding.kind === \"namespace\") {\n baseComponent = baseBinding.base\n for (const [name, value] of baseBinding.members) {\n members.set(name, value)\n }\n }\n\n for (let i = 1; i < expression.arguments.length; i++) {\n const argument = expression.arguments[i]\n if (!argument) continue\n if (ts.isSpreadElement(argument)) {\n const spread = resolveBindingFromExpression(filePath, argument.expression)\n if (!spread || spread.kind !== \"namespace\") continue\n for (const [name, value] of spread.members) {\n members.set(name, value)\n }\n continue\n }\n\n if (!ts.isObjectLiteralExpression(argument)) continue\n appendObjectExpressionMembers(filePath, argument, members)\n }\n\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] Object.assign result: base=${baseComponent === null ? \"null\" : `tagName=${baseComponent.host.descriptor.tagName}`}, members=[${[...members.keys()]}]`)\n if (baseComponent === null && members.size === 0) return null\n\n return {\n kind: \"namespace\",\n base: baseComponent,\n members,\n }\n }\n\n function resolveNamespaceFromObjectExpression(\n filePath: string,\n objectExpression: ts.ObjectLiteralExpression,\n base: ComponentBinding | null,\n ): NamespaceBinding | null {\n const members = new Map<string, LayoutBinding>()\n appendObjectExpressionMembers(filePath, objectExpression, members)\n if (base === null && members.size === 0) return null\n\n return {\n kind: \"namespace\",\n base,\n members,\n }\n }\n\n function appendObjectExpressionMembers(\n filePath: string,\n objectExpression: ts.ObjectLiteralExpression,\n members: Map<string, LayoutBinding>,\n ): void {\n for (let i = 0; i < objectExpression.properties.length; i++) {\n const property = objectExpression.properties[i]\n if (!property) continue\n if (ts.isSpreadAssignment(property)) {\n const spread = resolveBindingFromExpression(filePath, property.expression)\n if (!spread || spread.kind !== \"namespace\") continue\n for (const [name, value] of spread.members) {\n members.set(name, value)\n }\n continue\n }\n\n if (!ts.isPropertyAssignment(property)) continue\n if (property.name && ts.isComputedPropertyName(property.name)) continue\n const keyName = readObjectPropertyKey(property.name)\n if (keyName === null) continue\n const value = property.initializer\n\n const valueBinding = resolveBindingFromExpression(filePath, value)\n if (valueBinding === null) continue\n members.set(keyName, valueBinding)\n }\n }\n\n function resolveBindingFromImport(filePath: string, importBinding: ImportBinding): LayoutBinding | null {\n const resolvedModule = moduleResolver.resolveSolid(filePath, importBinding.source)\n ?? resolveAndIndexExternalModule(filePath, importBinding.source)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveBindingFromImport: source=${importBinding.source}, kind=${importBinding.kind}, resolvedModule=${resolvedModule}`)\n if (resolvedModule === null) return null\n\n const normalized = resolve(resolvedModule)\n if (importBinding.kind === \"namespace\") {\n return resolveNamespaceBindingForFile(normalized)\n }\n\n const exportName = importBinding.kind === \"default\" ? \"default\" : importBinding.importedName\n if (exportName === null) return null\n const result = resolveExportBinding(normalized, exportName)\n if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] export ${exportName}: ${result === null ? \"null\" : result.kind}`)\n return result\n }\n\n function resolveAndIndexExternalModule(importerFile: string, importSource: string): string | null {\n const cacheKey = `${importerFile}::${importSource}`\n const cached = externalResolutionCache.get(cacheKey)\n if (cached !== undefined) return cached\n\n if (externalFilesParsed >= MAX_EXTERNAL_FILES_PARSED) {\n externalResolutionCache.set(cacheKey, null)\n return null\n }\n\n const externalPath = resolveExternalModule(importerFile, importSource)\n if (externalPath === null) {\n externalResolutionCache.set(cacheKey, null)\n return null\n }\n\n const normalized = resolve(externalPath)\n if (moduleIndexes.has(normalized)) {\n externalResolutionCache.set(cacheKey, normalized)\n return normalized\n }\n\n const index = parseAndBuildExternalIndex(normalized)\n if (index === null) {\n externalResolutionCache.set(cacheKey, null)\n return null\n }\n\n moduleIndexes.set(normalized, index)\n externalResolutionCache.set(cacheKey, normalized)\n externalFilesParsed++\n return normalized\n }\n\n function resolveNamespaceBindingForFile(filePath: string): NamespaceBinding | null {\n const cached = namespaceBindingCache.get(filePath)\n if (cached !== undefined) return cached\n\n const index = moduleIndexes.get(filePath)\n if (!index) {\n namespaceBindingCache.set(filePath, null)\n return null\n }\n\n const members = new Map<string, LayoutBinding>()\n\n for (const exportName of index.exportsByName.keys()) {\n const binding = resolveExportBinding(filePath, exportName)\n if (binding === null) continue\n members.set(exportName, binding)\n }\n\n if (members.size === 0) {\n namespaceBindingCache.set(filePath, null)\n return null\n }\n\n const namespaceBinding: NamespaceBinding = {\n kind: \"namespace\",\n base: null,\n members,\n }\n namespaceBindingCache.set(filePath, namespaceBinding)\n return namespaceBinding\n }\n\n function resolveExportBinding(filePath: string, exportName: string): LayoutBinding | null {\n const key = `${filePath}::${exportName}`\n const cached = exportBindingCache.get(key)\n if (cached !== undefined) return cached\n if (resolvingExport.has(key)) return null\n resolvingExport.add(key)\n\n const index = moduleIndexes.get(filePath)\n if (!index) {\n exportBindingCache.set(key, null)\n resolvingExport.delete(key)\n return null\n }\n\n const candidates = index.exportsByName.get(exportName)\n if (!candidates || candidates.length === 0) {\n exportBindingCache.set(key, null)\n resolvingExport.delete(key)\n return null\n }\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i]\n if (!candidate) continue\n const binding = resolveBindingFromExportEntity(filePath, candidate)\n if (binding === null) continue\n exportBindingCache.set(key, binding)\n resolvingExport.delete(key)\n return binding\n }\n\n exportBindingCache.set(key, null)\n resolvingExport.delete(key)\n return null\n }\n\n function resolveBindingFromExportEntity(filePath: string, exportEntity: ExportEntity): LayoutBinding | null {\n if (exportEntity.isTypeOnly) return null\n\n if (exportEntity.source !== null) {\n const targetModule = moduleResolver.resolveSolid(filePath, exportEntity.source)\n if (targetModule === null) return null\n\n const targetName = exportEntity.importedName ?? exportEntity.name\n if (targetName === \"*\") return null\n return resolveExportBinding(resolve(targetModule), targetName)\n }\n\n const index = moduleIndexes.get(filePath)\n if (!index) return null\n\n const byEntityId = resolveBindingByEntityId(index, filePath, exportEntity)\n if (byEntityId !== null) return byEntityId\n\n if (exportEntity.name === \"default\") return null\n const localName = exportEntity.importedName ?? exportEntity.name\n return resolveLocalIdentifierBinding(filePath, localName)\n }\n\n function resolveBindingByEntityId(\n index: SolidModuleIndex,\n filePath: string,\n exportEntity: ExportEntity,\n ): LayoutBinding | null {\n if (exportEntity.entityId < 0) return null\n\n if (exportEntity.kind === ExportKind.COMPONENT) {\n const fn = index.tree.functions[exportEntity.entityId]\n if (!fn || fn.name === null) return null\n const hostEntry = index.hostByComponentName.get(fn.name)\n if (!hostEntry) return null\n const resolved = resolveComponentHostEntry(hostEntry)\n if (resolved === null) return null\n return {\n kind: \"component\",\n host: resolved,\n }\n }\n\n if (exportEntity.kind === ExportKind.FUNCTION) {\n const fn = index.tree.functions[exportEntity.entityId]\n if (!fn || fn.name === null) return null\n return resolveLocalIdentifierBinding(filePath, fn.name)\n }\n\n const variable = index.tree.variables[exportEntity.entityId]\n if (!variable) return null\n return resolveLocalIdentifierBinding(filePath, variable.name)\n }\n}\n\n\n// ── Module index construction ────────────────────────────────────────────\n\nfunction buildSolidModuleIndexes(allTrees: ReadonlyMap<string, SolidSyntaxTree>): ReadonlyMap<string, SolidModuleIndex> {\n const out = new Map<string, SolidModuleIndex>()\n\n for (const [filePath, tree] of allTrees) {\n out.set(resolve(filePath), buildSolidModuleIndex(tree))\n }\n\n return out\n}\n\nfunction buildSolidModuleIndex(tree: SolidSyntaxTree): SolidModuleIndex {\n return {\n tree,\n hostByComponentName: collectComponentHosts(tree),\n variableInitByName: collectTopLevelVariableInitializers(tree),\n importByLocalName: collectImportBindingsByLocalName(tree),\n exportsByName: collectExportsByName(tree),\n transparentPrimitiveNames: collectTransparentPrimitiveNames(tree),\n }\n}\n\nfunction parseAndBuildExternalIndex(filePath: string): SolidModuleIndex | null {\n try {\n const content = readFileSync(filePath, \"utf-8\")\n const program = ts.createProgram([filePath], {\n target: ts.ScriptTarget.ESNext,\n module: ts.ModuleKind.ESNext,\n jsx: ts.JsxEmit.Preserve,\n allowJs: true,\n noEmit: true,\n }, {\n getSourceFile(name, languageVersion) {\n if (name === filePath) return ts.createSourceFile(name, content, languageVersion, true)\n return undefined\n },\n writeFile() {},\n getDefaultLibFileName: () => \"lib.d.ts\",\n useCaseSensitiveFileNames: () => true,\n getCanonicalFileName: (f) => f,\n getCurrentDirectory: () => \"\",\n getNewLine: () => \"\\n\",\n fileExists: (f) => f === filePath,\n readFile: (f) => f === filePath ? content : undefined,\n })\n const input = createSolidInput(filePath, program)\n const tree = buildSolidSyntaxTree(input, \"external\")\n return buildSolidModuleIndex(tree)\n } catch {\n return null\n }\n}\n\nfunction collectComponentHosts(tree: SolidSyntaxTree): ReadonlyMap<string, ComponentHostEntry> {\n const out = new Map<string, ComponentHostEntry>()\n\n for (let i = 0; i < tree.componentFunctions.length; i++) {\n const fn = tree.componentFunctions[i]\n if (!fn) continue\n if (fn.name === null) continue\n const entry = resolveComponentHostEntryForFunction(tree, fn)\n if (entry === null) continue\n out.set(fn.name, entry)\n }\n\n return out\n}\n\nfunction resolveComponentHostEntryForFunction(\n tree: SolidSyntaxTree,\n fn: FunctionEntity,\n): ComponentHostEntry | null {\n let entry: ComponentHostEntry | null = null\n let hostElementRefAgreed = true\n\n const bodyEntry = resolveHostEntryFromFunctionBody(tree, fn)\n if (bodyEntry !== null) {\n entry = bodyEntry\n }\n\n for (let i = 0; i < fn.returnStatements.length; i++) {\n const returnStatement = fn.returnStatements[i]\n if (!returnStatement) continue\n const argument = returnStatement.node.expression\n if (!argument) continue\n const returnEntry = resolveHostEntryFromExpression(tree, argument)\n if (returnEntry === null) return null\n\n if (entry === null) {\n entry = returnEntry\n continue\n }\n\n if (areComponentHostEntriesEqual(entry, returnEntry)) {\n if (\n hostElementRefAgreed &&\n entry.resolution === \"resolved\" &&\n returnEntry.resolution === \"resolved\" &&\n entry.hostElementRef !== returnEntry.hostElementRef\n ) {\n hostElementRefAgreed = false\n }\n continue\n }\n return null\n }\n\n if (!hostElementRefAgreed && entry !== null && entry.resolution === \"resolved\") {\n return { resolution: \"resolved\", descriptor: entry.descriptor, hostElementRef: null }\n }\n\n return entry\n}\n\nfunction resolveHostEntryFromFunctionBody(\n tree: SolidSyntaxTree,\n fn: FunctionEntity,\n): ComponentHostEntry | null {\n if (!fn.body || ts.isBlock(fn.body)) return null\n return resolveHostEntryFromExpression(tree, fn.body)\n}\n\nfunction resolveHostEntryFromExpression(\n tree: SolidSyntaxTree,\n expression: ts.Expression,\n): ComponentHostEntry | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isJsxElement(unwrapped) || ts.isJsxSelfClosingElement(unwrapped)) {\n return resolveHostEntryFromJSXElement(tree, unwrapped)\n }\n\n if (!ts.isJsxFragment(unwrapped)) return null\n return resolveHostEntryFromJSXFragment(tree, unwrapped)\n}\n\nfunction resolveHostEntryFromJSXElement(tree: SolidSyntaxTree, node: ts.JsxElement | ts.JsxSelfClosingElement): ComponentHostEntry | null {\n const element = tree.jsxByNode.get(node)\n if (!element) return null\n if (element.tag === null) return null\n\n if (element.isDomElement) {\n if (element.tagName === null) return null\n return {\n resolution: \"resolved\",\n descriptor: {\n tagName: element.tagName,\n staticAttributes: collectStaticAttributes(element),\n staticClassTokens: getStaticClassTokensForTreeElement(tree, element),\n forwardsChildren: detectChildrenForwarding(element),\n attributePropBindings: collectAttributePropBindings(element),\n },\n hostElementRef: { filePath: tree.filePath, element },\n }\n }\n\n if (isContextProviderTag(element.tag)) {\n const children = ts.isJsxElement(node) ? node.children : []\n return resolveHostEntryFromJSXChildren(tree, children)\n }\n\n return {\n resolution: \"deferred\",\n innerTag: element.tag,\n filePath: tree.filePath,\n staticAttributes: collectStaticAttributes(element),\n staticClassTokens: getStaticClassTokensForTreeElement(tree, element),\n forwardsChildren: detectChildrenForwarding(element),\n attributePropBindings: collectAttributePropBindings(element),\n }\n}\n\nfunction isContextProviderTag(tag: string): boolean {\n return tag.endsWith(\".Provider\")\n}\n\nfunction resolveHostEntryFromJSXChildren(tree: SolidSyntaxTree, children: readonly ts.JsxChild[]): ComponentHostEntry | null {\n let candidate: ComponentHostEntry | null = null\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (!child) continue\n const resolved = resolveHostEntryFromJSXChild(tree, child)\n if (resolved === \"ignore\") continue\n if (resolved === null) return null\n if (candidate !== null) {\n if (!areComponentHostEntriesEqual(candidate, resolved)) return null\n }\n candidate = resolved\n }\n\n return candidate\n}\n\nfunction resolveHostEntryFromJSXFragment(tree: SolidSyntaxTree, node: ts.JsxFragment): ComponentHostEntry | null {\n return resolveHostEntryFromJSXChildren(tree, [...node.children])\n}\n\nfunction resolveHostEntryFromJSXChild(\n tree: SolidSyntaxTree,\n child: ts.JsxChild,\n): ComponentHostEntry | null | \"ignore\" {\n if (ts.isJsxText(child)) {\n if (isBlank(child.text)) return \"ignore\"\n return null\n }\n\n if (ts.isJsxExpression(child)) {\n if (!child.expression) return \"ignore\"\n return null\n }\n\n if (ts.isJsxElement(child) || ts.isJsxSelfClosingElement(child)) {\n return resolveHostEntryFromJSXElement(tree, child)\n }\n\n if (!ts.isJsxFragment(child)) return null\n return resolveHostEntryFromJSXFragment(tree, child)\n}\n\nfunction detectChildrenForwarding(root: JSXElementEntity): boolean {\n const queue = [root]\n const seen = new Set<number>()\n\n for (let i = 0; i < queue.length; i++) {\n const current = queue[i]\n if (!current) continue\n if (seen.has(current.id)) continue\n seen.add(current.id)\n\n for (let j = 0; j < current.children.length; j++) {\n const child = current.children[j]\n if (!child) continue\n if (child.kind !== \"expression\") continue\n if (!ts.isJsxExpression(child.node)) continue\n if (!child.node.expression) continue\n if (containsChildrenReference(child.node.expression)) return true\n }\n\n for (let j = 0; j < current.childElements.length; j++) {\n const childElement = current.childElements[j]\n if (!childElement) continue\n queue.push(childElement)\n }\n }\n\n return false\n}\n\nfunction containsChildrenReference(expression: ts.Expression): boolean {\n const queue: ts.Node[] = [expression]\n\n for (let i = 0; i < queue.length; i++) {\n if (queue.length > MAX_CHILDREN_REFERENCE_QUEUE_SIZE) return false\n const current = queue[i]\n if (!current) continue\n\n if (ts.isIdentifier(current)) {\n if (current.text === \"children\") return true\n continue\n }\n\n if (ts.isPropertyAccessExpression(current)) {\n if (ts.isIdentifier(current.name) && current.name.text === \"children\") {\n return true\n }\n queue.push(current.expression)\n continue\n }\n\n if (ts.isElementAccessExpression(current)) {\n queue.push(current.expression)\n queue.push(current.argumentExpression)\n continue\n }\n\n if (ts.isCallExpression(current)) {\n if (ts.isIdentifier(current.expression) && current.expression.text === \"children\") return true\n queue.push(current.expression)\n\n for (let j = 0; j < current.arguments.length; j++) {\n const argument = current.arguments[j]\n if (!argument) continue\n if (ts.isSpreadElement(argument)) {\n queue.push(argument.expression)\n continue\n }\n queue.push(argument)\n }\n continue\n }\n\n if (ts.isConditionalExpression(current)) {\n queue.push(current.condition)\n queue.push(current.whenTrue)\n queue.push(current.whenFalse)\n continue\n }\n\n if (ts.isBinaryExpression(current)) {\n queue.push(current.left)\n queue.push(current.right)\n continue\n }\n\n if (ts.isPrefixUnaryExpression(current) || ts.isPostfixUnaryExpression(current)) {\n queue.push(current.operand)\n continue\n }\n\n if (ts.isCommaListExpression(current)) {\n for (let j = 0; j < current.elements.length; j++) {\n const expr = current.elements[j]\n if (!expr) continue\n queue.push(expr)\n }\n continue\n }\n\n if (ts.isArrayLiteralExpression(current)) {\n for (let j = 0; j < current.elements.length; j++) {\n const elem = current.elements[j]\n if (!elem) continue\n queue.push(elem)\n }\n continue\n }\n\n if (ts.isObjectLiteralExpression(current)) {\n for (let j = 0; j < current.properties.length; j++) {\n const property = current.properties[j]\n if (!property) continue\n if (ts.isSpreadAssignment(property)) {\n queue.push(property.expression)\n continue\n }\n if (!ts.isPropertyAssignment(property)) continue\n if (property.name && ts.isComputedPropertyName(property.name)) queue.push(property.name.expression)\n queue.push(property.initializer)\n }\n continue\n }\n\n if (ts.isTemplateExpression(current)) {\n for (let j = 0; j < current.templateSpans.length; j++) {\n const span = current.templateSpans[j]\n if (!span) continue\n queue.push(span.expression)\n }\n continue\n }\n\n if (ts.isAwaitExpression(current)) {\n queue.push(current.expression)\n continue\n }\n\n if (ts.isAsExpression(current) || ts.isTypeAssertionExpression(current)) {\n queue.push(current.expression)\n continue\n }\n\n if (ts.isNonNullExpression(current)) {\n queue.push(current.expression)\n continue\n }\n }\n\n return false\n}\n\n\n// ── Module index helpers ─────────────────────────────────────────────────\n\nfunction collectTopLevelVariableInitializers(tree: SolidSyntaxTree): ReadonlyMap<string, ts.Expression> {\n const out = new Map<string, ts.Expression>()\n\n for (let i = 0; i < tree.variables.length; i++) {\n const variable = tree.variables[i]\n if (!variable) continue\n if (variable.scope.kind !== \"program\") continue\n\n const initializer = resolveInitializerExpression(variable)\n if (initializer === null) continue\n out.set(variable.name, initializer)\n }\n\n return out\n}\n\nfunction resolveInitializerExpression(variable: VariableEntity): ts.Expression | null {\n return variable.initializer\n}\n\nfunction collectImportBindingsByLocalName(tree: SolidSyntaxTree): ReadonlyMap<string, ImportBinding> {\n const out = new Map<string, ImportBinding>()\n\n for (let i = 0; i < tree.imports.length; i++) {\n const importEntity = tree.imports[i]\n if (!importEntity) continue\n if (importEntity.isTypeOnly) continue\n\n for (let j = 0; j < importEntity.specifiers.length; j++) {\n const specifier = importEntity.specifiers[j]\n if (!specifier) continue\n if (specifier.isTypeOnly) continue\n if (out.has(specifier.localName)) continue\n out.set(specifier.localName, {\n source: importEntity.source,\n kind: specifier.kind,\n importedName: specifier.importedName,\n })\n }\n }\n\n return out\n}\n\nfunction collectTransparentPrimitiveNames(tree: SolidSyntaxTree): ReadonlySet<string> {\n const out = new Set<string>()\n\n for (let i = 0; i < tree.imports.length; i++) {\n const importEntity = tree.imports[i]\n if (!importEntity) continue\n if (importEntity.source !== \"solid-js\") continue\n if (importEntity.isTypeOnly) continue\n\n for (let j = 0; j < importEntity.specifiers.length; j++) {\n const specifier = importEntity.specifiers[j]\n if (!specifier) continue\n if (specifier.isTypeOnly) continue\n if (specifier.kind !== \"named\") continue\n if (specifier.importedName === null) continue\n if (!TRANSPARENT_SOLID_PRIMITIVES.has(specifier.importedName)) continue\n out.add(specifier.localName)\n }\n }\n\n return out\n}\n\nfunction collectExportsByName(tree: SolidSyntaxTree): ReadonlyMap<string, readonly ExportEntity[]> {\n const out = new Map<string, ExportEntity[]>()\n\n for (let i = 0; i < tree.exports.length; i++) {\n const exportEntity = tree.exports[i]\n if (!exportEntity) continue\n const existing = out.get(exportEntity.name)\n if (existing) {\n existing.push(exportEntity)\n continue\n }\n out.set(exportEntity.name, [exportEntity])\n }\n\n return out\n}\n\n\n// ── Expression/type helpers ──────────────────────────────────────────────\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression\n\n while (true) {\n if (ts.isAsExpression(current) || ts.isTypeAssertionExpression(current)) {\n current = current.expression\n continue\n }\n\n if (ts.isNonNullExpression(current)) {\n current = current.expression\n continue\n }\n\n if (ts.isParenthesizedExpression(current)) {\n current = current.expression\n continue\n }\n\n return current\n }\n}\n\nfunction isObjectAssignCall(expression: ts.CallExpression): boolean {\n const callee = expression.expression\n if (!ts.isPropertyAccessExpression(callee)) return false\n if (!ts.isIdentifier(callee.expression)) return false\n if (callee.expression.text !== \"Object\") return false\n return callee.name.text === \"assign\"\n}\n\nfunction toExpressionArgument(argument: ts.Expression): ts.Expression | null {\n if (ts.isSpreadElement(argument)) return null\n return argument\n}\n\nfunction readObjectPropertyKey(key: ts.PropertyName): string | null {\n if (ts.isPrivateIdentifier(key)) return null\n if (ts.isIdentifier(key)) return key.text\n if (ts.isStringLiteral(key)) return key.text\n if (ts.isNumericLiteral(key)) return key.text\n if (ts.isNoSubstitutionTemplateLiteral(key)) return key.text\n return null\n}\n\nfunction splitTagPath(tag: string): readonly string[] {\n if (tag.length === 0) return []\n const parts = tag.split(\".\")\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part || part.length === 0) return []\n }\n return parts\n}\n\nfunction readTagRoot(tag: string): string | null {\n if (tag.length === 0) return null\n const dotIndex = tag.indexOf(\".\")\n const root = dotIndex === -1 ? tag : tag.slice(0, dotIndex)\n if (root.length === 0) return null\n return root\n}\n\n\n// ── Host entry comparison ────────────────────────────────────────────────\n\nfunction areHostDescriptorsEqual(\n left: LayoutComponentHostDescriptor,\n right: LayoutComponentHostDescriptor,\n): boolean {\n if (left.tagName !== right.tagName) return false\n if (left.forwardsChildren !== right.forwardsChildren) return false\n if (!areStringListsEqual(left.staticClassTokens, right.staticClassTokens)) return false\n if (!areAttributeMapsEqual(left.staticAttributes, right.staticAttributes)) return false\n if (left.attributePropBindings.size !== right.attributePropBindings.size) return false\n for (const [key, value] of left.attributePropBindings) {\n if (right.attributePropBindings.get(key) !== value) return false\n }\n return true\n}\n\nfunction areComponentHostEntriesEqual(\n left: ComponentHostEntry,\n right: ComponentHostEntry,\n): boolean {\n if (left.resolution !== right.resolution) return false\n\n if (left.resolution === \"resolved\" && right.resolution === \"resolved\") {\n return areHostDescriptorsEqual(left.descriptor, right.descriptor)\n }\n\n if (left.resolution === \"deferred\" && right.resolution === \"deferred\") {\n if (left.innerTag !== right.innerTag) return false\n if (left.filePath !== right.filePath) return false\n if (left.forwardsChildren !== right.forwardsChildren) return false\n if (!areStringListsEqual(left.staticClassTokens, right.staticClassTokens)) return false\n return areAttributeMapsEqual(left.staticAttributes, right.staticAttributes)\n }\n\n return false\n}\n\nfunction areStringListsEqual(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) return false\n\n for (let i = 0; i < left.length; i++) {\n if (left[i] !== right[i]) return false\n }\n\n return true\n}\n\nfunction areAttributeMapsEqual(\n left: ReadonlyMap<string, string | null>,\n right: ReadonlyMap<string, string | null>,\n): boolean {\n if (left.size !== right.size) return false\n\n for (const [key, value] of left) {\n if (!right.has(key)) return false\n if (right.get(key) !== value) return false\n }\n\n return true\n}\n\n\n// ── Host resolution merge helpers ────────────────────────────────────────\n\nfunction mergeStaticAttributes(\n outer: ReadonlyMap<string, string | null>,\n inner: ReadonlyMap<string, string | null>,\n): ReadonlyMap<string, string | null> {\n if (inner.size === 0) return outer\n if (outer.size === 0) return inner\n\n const out = new Map<string, string | null>()\n for (const [name, value] of inner) out.set(name, value)\n for (const [name, value] of outer) out.set(name, value)\n return out\n}\n\nfunction mergePropBindings(\n outer: ReadonlyMap<string, string>,\n inner: ReadonlyMap<string, string>,\n): ReadonlyMap<string, string> {\n if (inner.size === 0) return outer\n if (outer.size === 0) return inner\n\n const out = new Map<string, string>()\n for (const [name, value] of inner) out.set(name, value)\n for (const [name, value] of outer) out.set(name, value)\n return out\n}\n\nfunction resolveTagNameFromPolymorphicProp(\n staticAttributes: ReadonlyMap<string, string | null>,\n): string | null {\n const asValue = staticAttributes.get(\"as\")\n if (asValue === undefined || asValue === null) return null\n const normalized = asValue.toLowerCase()\n if (!HTML_TAG_NAMES.has(normalized)) return null\n return normalized\n}\n\nfunction mergeStaticClassTokens(\n outer: readonly string[],\n inner: readonly string[],\n): readonly string[] {\n if (inner.length === 0) return outer\n if (outer.length === 0) return inner\n\n const seen = new Set<string>()\n const out: string[] = []\n\n for (let i = 0; i < outer.length; i++) {\n const token = outer[i]\n if (!token) continue\n if (seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n\n for (let i = 0; i < inner.length; i++) {\n const token = inner[i]\n if (!token) continue\n if (seen.has(token)) continue\n seen.add(token)\n out.push(token)\n }\n\n return out\n}\n","/**\n * Signal snapshot types + construction.\n *\n * Moved from cross-file/layout/signal-normalization.ts + signal-collection.ts.\n */\nimport type { SignalSource, RuleGuard, ElementCascade, CascadedDeclaration } from \"./cascade-binder\"\nimport { parseUnitlessValue, parsePxValue } from \"../../css/parser/value-util\"\nimport { splitWhitespaceTokens } from \"../../css/parser/value-tokenizer\"\n\nexport { type SignalSource, type RuleGuard } from \"./cascade-binder\"\n\nexport const layoutSignalNames = [\n \"line-height\", \"font-size\", \"width\", \"inline-size\", \"height\", \"block-size\",\n \"min-width\", \"min-block-size\", \"min-height\", \"max-width\", \"max-height\",\n \"aspect-ratio\", \"vertical-align\", \"display\", \"white-space\", \"object-fit\",\n \"overflow\", \"overflow-y\", \"overflow-anchor\", \"scrollbar-gutter\", \"scrollbar-width\",\n \"contain-intrinsic-size\", \"content-visibility\", \"align-items\", \"align-self\",\n \"justify-items\", \"place-items\", \"place-self\", \"flex-direction\", \"flex-basis\",\n \"grid-auto-flow\", \"appearance\", \"box-sizing\", \"padding-top\", \"padding-left\",\n \"padding-right\", \"padding-bottom\", \"border-top-width\", \"border-left-width\",\n \"border-right-width\", \"border-bottom-width\", \"position\", \"top\", \"bottom\",\n \"margin-top\", \"margin-bottom\", \"transform\", \"translate\", \"inset-block-start\",\n \"inset-block-end\", \"writing-mode\", \"direction\", \"contain\",\n] as const\n\nexport type LayoutSignalName = (typeof layoutSignalNames)[number]\n\nexport const enum SignalValueKind { Known = 0, Unknown = 1 }\nexport const enum SignalUnit { Px = 0, Unitless = 1, Keyword = 2, Unknown = 3 }\nexport const enum SignalQuality { Exact = 0, Estimated = 1 }\n\nexport interface KnownSignalValue {\n readonly kind: SignalValueKind.Known\n readonly name: LayoutSignalName\n readonly normalized: string\n readonly source: SignalSource\n readonly guard: RuleGuard\n readonly unit: SignalUnit\n readonly px: number | null\n readonly quality: SignalQuality\n}\n\nexport interface UnknownSignalValue {\n readonly kind: SignalValueKind.Unknown\n readonly name: LayoutSignalName\n readonly source: SignalSource | null\n readonly guard: RuleGuard\n readonly reason: string\n}\n\nexport type SignalValue = KnownSignalValue | UnknownSignalValue\n\nexport interface SignalSnapshot {\n readonly elementId: number\n readonly signals: ReadonlyMap<LayoutSignalName, SignalValue>\n readonly knownSignalCount: number\n readonly unknownSignalCount: number\n readonly conditionalSignalCount: number\n}\n\n\n// ── Offset baseline parsing ──────────────────────────────────────────────\n\n// layoutOffsetSignals and parseOffsetPx moved to analysis/alignment.ts per plan\n\nconst TRANSLATE_Y_RE = /translatey\\(\\s*([^)]+)\\s*\\)/i\nconst TRANSLATE_RE = /translate\\(\\s*([^,)]+)(?:,\\s*([^)]+))?\\s*\\)/i\nconst TRANSLATE_3D_RE = /translate3d\\(\\s*[^,]+,\\s*([^,]+),\\s*[^)]+\\)/i\n\nexport function parseSignedPxValue(raw: string): number | null {\n const trimmed = raw.trim()\n if (trimmed.length === 0) return null\n\n if (trimmed.startsWith(\"-\")) {\n const px = parsePxValue(trimmed.slice(1))\n if (px === null) return null\n return -px\n }\n\n if (trimmed.startsWith(\"+\")) {\n return parsePxValue(trimmed.slice(1))\n }\n\n return parsePxValue(trimmed)\n}\n\nexport function extractTransformYPx(raw: string): number | null {\n const normalized = raw.trim().toLowerCase()\n if (normalized.length === 0) return null\n\n const translate3d = TRANSLATE_3D_RE.exec(normalized)\n if (translate3d) {\n const yVal = translate3d[1]\n if (!yVal) return null\n return parseSignedPxValue(yVal)\n }\n\n const translateY = TRANSLATE_Y_RE.exec(normalized)\n if (translateY) {\n const yVal = translateY[1]\n if (!yVal) return null\n return parseSignedPxValue(yVal)\n }\n\n const translate = TRANSLATE_RE.exec(normalized)\n if (!translate) return null\n\n const yRaw = translate[2] ?? \"0px\"\n return parseSignedPxValue(yRaw)\n}\n\nexport function extractTranslatePropertyYPx(raw: string): number | null {\n const parts = splitWhitespaceTokens(raw.trim().toLowerCase())\n const yRaw = parts.length >= 2 ? (parts[1] ?? \"0px\") : \"0px\"\n return parseSignedPxValue(yRaw)\n}\n\n\n\n// ── Textual content state ────────────────────────────────────────────────\n\nexport const enum TextualContentState { Yes = 0, No = 1, Unknown = 2, DynamicText = 3 }\n\n// ── Control/replaced element tags ────────────────────────────────────────\n\nconst CONTROL_ELEMENT_TAGS: ReadonlySet<string> = new Set([\"input\", \"select\", \"textarea\", \"button\"])\nconst REPLACED_ELEMENT_TAGS: ReadonlySet<string> = new Set([\n ...CONTROL_ELEMENT_TAGS, \"img\", \"video\", \"canvas\", \"svg\", \"iframe\",\n])\n\nexport function isControlTag(tag: string | null): boolean {\n if (tag === null) return false\n return CONTROL_ELEMENT_TAGS.has(tag)\n}\n\nexport function isReplacedTag(tag: string | null): boolean {\n if (tag === null) return false\n return REPLACED_ELEMENT_TAGS.has(tag)\n}\n\n// ── Signal normalization ─────────────────────────────────────────────────\n\nconst MONITORED_SIGNAL_SET = new Set<string>(layoutSignalNames)\nconst MONITORED_SHORTHAND_SET = new Set<string>([\n \"padding\", \"border-width\", \"margin-block\", \"padding-block\",\n \"padding-inline\", \"inset-block\", \"flex-flow\",\n])\n\nexport const MONITORED_SIGNAL_NAME_MAP = new Map<string, LayoutSignalName>(\n layoutSignalNames.map((name) => [name, name]),\n)\n\nexport function isMonitoredSignal(property: string): boolean {\n if (MONITORED_SIGNAL_SET.has(property)) return true\n return MONITORED_SHORTHAND_SET.has(property)\n}\n\nconst LENGTH_SIGNAL_SET = new Set<LayoutSignalName>([\n \"font-size\", \"width\", \"inline-size\", \"height\", \"block-size\",\n \"min-width\", \"min-block-size\", \"min-height\", \"max-width\", \"max-height\",\n \"flex-basis\", \"top\", \"bottom\", \"margin-top\", \"margin-bottom\",\n \"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\",\n \"border-top-width\", \"border-left-width\", \"border-right-width\", \"border-bottom-width\",\n \"inset-block-start\", \"inset-block-end\",\n])\n\nconst KEYWORD_SIGNAL_SET = new Set<LayoutSignalName>([\n \"vertical-align\", \"display\", \"white-space\", \"object-fit\",\n \"overflow\", \"overflow-y\", \"overflow-anchor\", \"scrollbar-gutter\", \"scrollbar-width\",\n \"content-visibility\", \"align-items\", \"align-self\", \"justify-items\",\n \"place-items\", \"place-self\", \"flex-direction\", \"grid-auto-flow\",\n \"appearance\", \"box-sizing\", \"position\", \"writing-mode\", \"direction\",\n])\n\nconst DIMENSION_KEYWORD_SET: ReadonlySet<string> = new Set([\n \"auto\", \"none\", \"fit-content\", \"min-content\", \"max-content\", \"stretch\",\n \"inherit\", \"initial\", \"unset\", \"revert\", \"revert-layer\",\n])\n\ninterface NormalizedSignalMap {\n readonly signals: ReadonlyMap<LayoutSignalName, SignalValue>\n readonly knownSignalCount: number\n readonly unknownSignalCount: number\n readonly conditionalSignalCount: number\n}\n\nfunction normalizeSignalMapWithCounts(\n values: ReadonlyMap<string, CascadedDeclaration>,\n): NormalizedSignalMap {\n const out = new Map<LayoutSignalName, SignalValue>()\n\n const fontSizeEntry = values.get(\"font-size\")\n let fontSizePx: number | null = null\n\n if (fontSizeEntry) {\n const parsedFontSize = normalizeSignal(\n \"font-size\", fontSizeEntry.value, fontSizeEntry.source, fontSizeEntry.guardProvenance, null,\n )\n out.set(\"font-size\", parsedFontSize)\n if (parsedFontSize.kind === SignalValueKind.Known && parsedFontSize.guard.kind === 0 /* Unconditional */) {\n fontSizePx = parsedFontSize.px\n }\n }\n\n for (const [property, declaration] of values) {\n if (property === \"font-size\") continue\n\n const name = MONITORED_SIGNAL_NAME_MAP.get(property)\n if (!name) continue\n\n const normalized = normalizeSignal(\n name, declaration.value, declaration.source, declaration.guardProvenance, fontSizePx,\n )\n out.set(name, normalized)\n }\n\n let knownSignalCount = 0\n let unknownSignalCount = 0\n let conditionalSignalCount = 0\n\n for (const value of out.values()) {\n if (value.guard.kind === 1 /* Conditional */) {\n conditionalSignalCount++\n continue\n }\n if (value.kind === SignalValueKind.Known) {\n knownSignalCount++\n continue\n }\n unknownSignalCount++\n }\n\n return { signals: out, knownSignalCount, unknownSignalCount, conditionalSignalCount }\n}\n\nfunction normalizeSignal(\n name: LayoutSignalName,\n raw: string,\n source: SignalSource,\n guard: RuleGuard,\n fontSizePx: number | null,\n): SignalValue {\n switch (name) {\n case \"line-height\":\n return parseLineHeight(name, raw, source, guard, fontSizePx)\n case \"aspect-ratio\":\n return parseAspectRatio(name, raw, source, guard)\n case \"contain-intrinsic-size\":\n return parseContainIntrinsicSize(name, raw, source, guard)\n case \"transform\":\n return parseTransform(name, raw, source, guard)\n case \"translate\":\n return parseTranslateProperty(name, raw, source, guard)\n default:\n break\n }\n if (LENGTH_SIGNAL_SET.has(name)) return parseLength(name, raw, source, guard)\n if (KEYWORD_SIGNAL_SET.has(name)) return parseKeyword(name, raw, source, guard)\n return createUnknown(name, source, guard, \"unsupported signal\")\n}\n\nfunction parseAspectRatio(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const trimmed = raw.trim().toLowerCase()\n if (trimmed.length === 0) return createUnknown(name, source, guard, \"aspect-ratio value is empty\")\n if (hasDynamicExpression(trimmed)) return createUnknown(name, source, guard, \"aspect-ratio uses runtime-dependent function\")\n if (trimmed === \"auto\") return createUnknown(name, source, guard, \"aspect-ratio auto does not reserve ratio\")\n\n const slash = trimmed.indexOf(\"/\")\n if (slash !== -1) {\n const left = Number(trimmed.slice(0, slash).trim())\n const right = Number(trimmed.slice(slash + 1).trim())\n if (!Number.isFinite(left) || !Number.isFinite(right) || left <= 0 || right <= 0) {\n return createUnknown(name, source, guard, \"aspect-ratio ratio is invalid\")\n }\n return createKnown(name, trimmed, source, guard, null, SignalUnit.Unitless, SignalQuality.Exact)\n }\n\n const ratio = Number(trimmed)\n if (!Number.isFinite(ratio) || ratio <= 0) return createUnknown(name, source, guard, \"aspect-ratio is not statically parseable\")\n return createKnown(name, trimmed, source, guard, null, SignalUnit.Unitless, SignalQuality.Exact)\n}\n\nfunction parseContainIntrinsicSize(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const trimmed = raw.trim().toLowerCase()\n if (trimmed.length === 0) return createUnknown(name, source, guard, \"contain-intrinsic-size value is empty\")\n if (hasDynamicExpression(trimmed)) return createUnknown(name, source, guard, \"contain-intrinsic-size uses runtime-dependent function\")\n if (trimmed === \"none\" || trimmed === \"auto\") return createUnknown(name, source, guard, \"contain-intrinsic-size does not reserve space\")\n\n const parts = splitWhitespaceTokens(trimmed)\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part) continue\n const px = parseSignedPxValue(part)\n if (px !== null) return createKnown(name, trimmed, source, guard, px, SignalUnit.Px, SignalQuality.Exact)\n }\n\n return createUnknown(name, source, guard, \"contain-intrinsic-size is not statically parseable in px\")\n}\n\nfunction parseLineHeight(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard, fontSizePx: number | null): SignalValue {\n const normalized = raw.trim().toLowerCase()\n const unitless = parseUnitlessValue(raw)\n if (unitless !== null) {\n const base = fontSizePx === null ? 16 : fontSizePx\n return createKnown(name, normalized, source, guard, unitless * base, SignalUnit.Unitless, SignalQuality.Estimated)\n }\n\n const px = parseSignedPxValue(raw)\n if (px !== null) return createKnown(name, normalized, source, guard, px, SignalUnit.Px, SignalQuality.Exact)\n return createUnknown(name, source, guard, \"line-height is not statically parseable\")\n}\n\nfunction parseLength(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const px = parseSignedPxValue(raw)\n const normalized = raw.trim().toLowerCase()\n if (px !== null) return createKnown(name, normalized, source, guard, px, SignalUnit.Px, SignalQuality.Exact)\n if (DIMENSION_KEYWORD_SET.has(normalized) || normalized.startsWith(\"fit-content(\")) {\n return createKnown(name, normalized, source, guard, null, SignalUnit.Keyword, SignalQuality.Exact)\n }\n return createUnknown(name, source, guard, \"length is not statically parseable in px\")\n}\n\nfunction parseKeyword(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const normalized = raw.trim().toLowerCase()\n if (normalized.length === 0) return createUnknown(name, source, guard, \"keyword value is empty\")\n if (hasDynamicExpression(normalized)) return createUnknown(name, source, guard, \"keyword uses runtime-dependent function\")\n return createKnown(name, normalized, source, guard, null, SignalUnit.Keyword, SignalQuality.Exact)\n}\n\nfunction parseTransform(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const normalized = raw.trim().toLowerCase()\n if (normalized.length === 0) return createUnknown(name, source, guard, \"transform value is empty\")\n if (hasDynamicExpression(normalized)) return createUnknown(name, source, guard, \"transform uses runtime-dependent function\")\n\n const y = extractTransformYPx(normalized)\n if (y !== null) return createKnown(name, normalized, source, guard, y, SignalUnit.Px, SignalQuality.Exact)\n return createUnknown(name, source, guard, \"transform has non-translational or non-px functions\")\n}\n\nfunction parseTranslateProperty(name: LayoutSignalName, raw: string, source: SignalSource, guard: RuleGuard): SignalValue {\n const trimmed = raw.trim().toLowerCase()\n if (trimmed.length === 0) return createUnknown(name, source, guard, \"translate value is empty\")\n if (hasDynamicExpression(trimmed)) return createUnknown(name, source, guard, \"translate uses runtime-dependent function\")\n\n const y = extractTranslatePropertyYPx(trimmed)\n if (y !== null) return createKnown(name, trimmed, source, guard, y, SignalUnit.Px, SignalQuality.Exact)\n return createUnknown(name, source, guard, \"translate property vertical component is not px\")\n}\n\nfunction hasDynamicExpression(raw: string): boolean {\n if (raw.includes(\"var(\")) return true\n if (raw.includes(\"env(\")) return true\n if (raw.includes(\"attr(\")) return true\n return false\n}\n\nfunction createKnown(\n name: LayoutSignalName, normalized: string, source: SignalSource,\n guard: RuleGuard, px: number | null, unit: SignalUnit, quality: SignalQuality,\n): KnownSignalValue {\n return { kind: SignalValueKind.Known, name, normalized, source, guard, unit, px, quality }\n}\n\nfunction createUnknown(\n name: LayoutSignalName, source: SignalSource | null, guard: RuleGuard, reason: string,\n): UnknownSignalValue {\n return { kind: SignalValueKind.Unknown, name, source, guard, reason }\n}\n\n\n// ── Signal inheritance ───────────────────────────────────────────────────\n\nconst INHERITED_SIGNAL_NAMES: readonly LayoutSignalName[] = [\n \"font-size\", \"line-height\", \"writing-mode\", \"direction\",\n]\n\ninterface InheritedSignalsResult {\n readonly signals: ReadonlyMap<LayoutSignalName, SignalValue>\n readonly knownDelta: number\n readonly unknownDelta: number\n readonly conditionalDelta: number\n}\n\nfunction inheritSignalsFromParent(\n parentSnapshot: SignalSnapshot | null,\n local: ReadonlyMap<LayoutSignalName, SignalValue>,\n): InheritedSignalsResult {\n if (!parentSnapshot) {\n return { signals: local, knownDelta: 0, unknownDelta: 0, conditionalDelta: 0 }\n }\n\n let out: Map<LayoutSignalName, SignalValue> | null = null\n let knownDelta = 0\n let unknownDelta = 0\n let conditionalDelta = 0\n\n for (let i = 0; i < INHERITED_SIGNAL_NAMES.length; i++) {\n const signal = INHERITED_SIGNAL_NAMES[i]\n if (!signal) continue\n if (local.has(signal)) continue\n\n const inheritedValue = parentSnapshot.signals.get(signal)\n if (!inheritedValue) continue\n if (out === null) out = new Map(local)\n out.set(signal, inheritedValue)\n\n if (inheritedValue.guard.kind === 1 /* Conditional */) {\n conditionalDelta++\n continue\n }\n\n if (inheritedValue.kind === SignalValueKind.Known) {\n knownDelta++\n continue\n }\n unknownDelta++\n }\n\n if (out === null) {\n return { signals: local, knownDelta: 0, unknownDelta: 0, conditionalDelta: 0 }\n }\n\n return { signals: out, knownDelta, unknownDelta, conditionalDelta }\n}\n\n\n// ── buildSignalSnapshot ──────────────────────────────────────────────────\n\nexport function buildSignalSnapshot(\n elementId: number,\n cascade: ElementCascade,\n parentSnapshot: SignalSnapshot | null,\n): SignalSnapshot {\n const normalized = normalizeSignalMapWithCounts(cascade.declarations)\n const inherited = inheritSignalsFromParent(parentSnapshot, normalized.signals)\n\n return {\n elementId,\n signals: inherited.signals,\n knownSignalCount: normalized.knownSignalCount + inherited.knownDelta,\n unknownSignalCount: normalized.unknownSignalCount + inherited.unknownDelta,\n conditionalSignalCount: normalized.conditionalSignalCount + inherited.conditionalDelta,\n }\n}\n","/**\n * Cascade Resolution Utilities\n *\n * Functions for resolving CSS cascade order and determining\n * which declarations win when multiple rules target the same element.\n *\n */\n\nimport type { DeclarationEntity, CascadePosition, Specificity } from \"../entities\";\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../entities\";\n\n/**\n * Cascade Comparison.\n *\n * @param a - First declaration\n * @param b - Second declaration\n * @returns Negative if a < b, positive if a > b, 0 if equal\n */\nfunction compareCascadeInline(a: DeclarationEntity, b: DeclarationEntity): number {\n const posA = a.cascadePosition;\n const posB = b.cascadePosition;\n\n // 1. !important\n if (posA.isImportant !== posB.isImportant) {\n return posA.isImportant ? 1 : -1;\n }\n\n // 2. Layer order (reverse for !important)\n if (posA.layerOrder !== posB.layerOrder) {\n const diff = posA.layerOrder - posB.layerOrder;\n return posA.isImportant ? -diff : diff;\n }\n\n // 3. Specificity - single number comparison (vs 4 tuple comparisons)\n if (posA.specificityScore !== posB.specificityScore) {\n return posA.specificityScore - posB.specificityScore;\n }\n\n // 4. Source order\n return posA.sourceOrder - posB.sourceOrder;\n}\n\n/**\n * Compare two cascade positions directly.\n *\n * @param posA - First cascade position\n * @param posB - Second cascade position\n * @returns Negative if posA < posB, positive if posA > posB, 0 if equal\n */\nexport function compareCascadePositions(posA: CascadePosition, posB: CascadePosition): number {\n if (posA === posB) {\n return 0;\n }\n\n // 1. !important\n if (posA.isImportant !== posB.isImportant) {\n return posA.isImportant ? 1 : -1;\n }\n\n // 2. Layer order (reverse for !important)\n if (posA.layerOrder !== posB.layerOrder) {\n const diff = posA.layerOrder - posB.layerOrder;\n return posA.isImportant ? -diff : diff;\n }\n\n // 3. Specificity - use precomputed score (single comparison)\n if (posA.specificityScore !== posB.specificityScore) {\n return posA.specificityScore - posB.specificityScore;\n }\n\n // 4. Source order\n return posA.sourceOrder - posB.sourceOrder;\n}\n\n/**\n * Get the cascade position information for a declaration.\n *\n * @param decl - The declaration to analyze\n * @param layers - Ordered layer names (first = lowest priority)\n * @param layerMap - Optional Map for layer indices\n * @returns Cascade position info\n */\nexport function getCascadePosition(\n decl: DeclarationEntity,\n layers: readonly string[] = [],\n layerMap?: Map<string, number>,\n): CascadePosition {\n if (layers.length === 0) {\n return decl.cascadePosition;\n }\n\n // Slow path: custom layers need layer order recalculation\n let layerOrder = 0;\n const rule = decl.rule;\n\n if (rule && rule.parent && rule.parent.kind !== \"rule\") {\n const atRule = rule.parent;\n if (atRule.kind === \"layer\" && atRule.params) {\n if (layerMap) {\n const idx = layerMap.get(atRule.params);\n if (idx !== undefined) {\n layerOrder = idx;\n }\n } else {\n const layerIndex = layers.indexOf(atRule.params);\n if (layerIndex !== -1) {\n layerOrder = layerIndex + 1;\n }\n }\n }\n }\n\n // Find highest specificity selector\n let specificity: Specificity = [0, 0, 0, 0];\n let specificityScore = 0;\n if (rule && rule.kind === \"rule\" && rule.selectors.length > 0) {\n for (let i = 0; i < rule.selectors.length; i++) {\n const sel = rule.selectors[i];\n if (!sel) continue;\n if (sel.specificityScore > specificityScore) {\n specificityScore = sel.specificityScore;\n specificity = sel.specificity;\n }\n }\n }\n\n return {\n layer: decl.cascadePosition.layer,\n layerOrder,\n sourceOrder: decl.id,\n specificity,\n specificityScore,\n isImportant: hasFlag(decl._flags, DECL_IS_IMPORTANT),\n };\n}\n\n/**\n * Compare two declarations for cascade order.\n *\n * @param a - First declaration\n * @param b - Second declaration\n * @param layers - Ordered layer names for @layer resolution\n * @returns Comparison result\n */\nexport function compareCascade(\n a: DeclarationEntity,\n b: DeclarationEntity,\n layers: readonly string[] = [],\n): number {\n if (a === b) {\n return 0;\n }\n\n if (layers.length === 0) {\n return compareCascadeInline(a, b);\n }\n\n // Slow path: custom layers\n const layerMap = new Map(layers.map((name, i) => [name, i + 1]));\n const posA = getCascadePosition(a, layers, layerMap);\n const posB = getCascadePosition(b, layers, layerMap);\n return compareCascadePositions(posA, posB);\n}\n\n/**\n * Resolve which declaration wins in the cascade.\n *\n * @param declarations - Declarations to compare\n * @param layers - Ordered layer names for @layer resolution\n * @returns The winning declaration, or null if empty\n */\nexport function resolveCascade(\n declarations: readonly DeclarationEntity[],\n layers: readonly string[] = [],\n): DeclarationEntity | null {\n const len = declarations.length;\n if (len === 0) {\n return null;\n }\n if (len === 1) {\n return declarations[0] ?? null;\n }\n\n if (layers.length === 0) {\n let winner = declarations[0];\n if (!winner) return null;\n for (let i = 1; i < len; i++) {\n const candidate = declarations[i];\n if (!candidate) continue;\n if (compareCascadeInline(candidate, winner) > 0) {\n winner = candidate;\n }\n }\n return winner;\n }\n\n // Slow path: custom layers\n const layerMap = new Map(layers.map((name, i) => [name, i + 1]));\n let winner = declarations[0];\n if (!winner) return null;\n let winnerPos = getCascadePosition(winner, layers, layerMap);\n\n for (let i = 1; i < len; i++) {\n const current = declarations[i];\n if (!current) continue;\n const currentPos = getCascadePosition(current, layers, layerMap);\n if (compareCascadePositions(currentPos, winnerPos) > 0) {\n winner = current;\n winnerPos = currentPos;\n }\n }\n\n return winner;\n}\n\n/**\n * Sort declarations by cascade order (winner last).\n *\n * @param declarations - Declarations to sort\n * @param layers - Ordered layer names for @layer resolution\n * @returns New array sorted by cascade order (ascending, winner last)\n */\nexport function sortByCascade(\n declarations: readonly DeclarationEntity[],\n layers: readonly string[] = [],\n): readonly DeclarationEntity[] {\n const len = declarations.length;\n if (len <= 1) {\n return declarations;\n }\n\n if (layers.length === 0) {\n const result = declarations.slice();\n result.sort(compareCascadeInline);\n return result;\n }\n\n // Slow path: custom layers - decorate-sort-undecorate\n const layerMap = new Map(layers.map((name, i) => [name, i + 1]));\n const decorated: { decl: DeclarationEntity; pos: CascadePosition }[] = [];\n for (let i = 0; i < len; i++) {\n const decl = declarations[i];\n if (!decl) continue;\n decorated.push({ decl, pos: getCascadePosition(decl, layers, layerMap) });\n }\n\n decorated.sort((a, b) => compareCascadePositions(a.pos, b.pos));\n\n const result: DeclarationEntity[] = [];\n for (let i = 0; i < decorated.length; i++) {\n const entry = decorated[i];\n if (!entry) continue;\n result.push(entry.decl);\n }\n return result;\n}\n\n/**\n * Check if declaration A would override declaration B.\n *\n * @param a - Potentially overriding declaration\n * @param b - Potentially overridden declaration\n * @returns true if A would override B\n */\nexport function doesOverride(a: DeclarationEntity, b: DeclarationEntity): boolean {\n if (a === b) {\n return false;\n }\n return compareCascadeInline(a, b) > 0;\n}\n","/**\n * Cascade binding types + lazy per-element cascade resolution.\n *\n * Moved from cross-file/layout/cascade-builder.ts + selector-match.ts matching.\n */\nimport type { CascadePosition } from \"../../css/entities/value\"\nimport type { SelectorAttributeConstraint, NthPattern, AtRuleEntity, RuleEntity } from \"../../css/entities\"\nimport type { VariableEntity } from \"../../css/entities/variable\"\nimport { compareCascadePositions } from \"../../css/analysis/cascade\"\nimport { parseBlockShorthand, parseQuadShorthand, splitWhitespaceTokens } from \"../../css/parser/value-tokenizer\"\nimport { extractVarReferences } from \"../../css/parser/value\"\nimport { isWhitespace } from \"@drskillissue/ganko-shared\"\nimport type { SelectorSymbol, CompiledSelectorMatcher } from \"../symbols/selector\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { ScopedSelectorIndex } from \"./scope-resolver\"\nimport type { ElementNode } from \"./element-builder\"\nimport type { LayoutSignalName } from \"./signal-builder\"\nimport { isMonitoredSignal, MONITORED_SIGNAL_NAME_MAP } from \"./signal-builder\"\n\n\n// ── Enums & types ────────────────────────────────────────────────────────\n\nexport const enum SignalSource { Selector = 0, InlineStyle = 1 }\nexport const enum SignalGuardKind { Unconditional = 0, Conditional = 1 }\n\nexport type GuardConditionKind = \"media\" | \"supports\" | \"container\" | \"dynamic-attribute\"\n\nexport interface GuardConditionProvenance {\n readonly kind: GuardConditionKind\n readonly query: string | null\n readonly key: string\n}\n\nexport type RuleGuard =\n | { readonly kind: SignalGuardKind.Unconditional; readonly conditions: readonly GuardConditionProvenance[]; readonly key: \"always\" }\n | { readonly kind: SignalGuardKind.Conditional; readonly conditions: readonly GuardConditionProvenance[]; readonly key: string }\n\nexport interface CascadedDeclaration {\n readonly value: string\n readonly source: SignalSource\n readonly guardProvenance: RuleGuard\n}\n\nexport interface SelectorMatch {\n readonly selectorId: number\n readonly specificityScore: number\n readonly sourceOrder: number\n readonly conditionalMatch: boolean\n}\n\nexport interface ElementCascade {\n readonly elementId: number\n readonly declarations: ReadonlyMap<string, CascadedDeclaration>\n readonly edges: readonly SelectorMatch[]\n}\n\n\n// ── Monitored declarations ───────────────────────────────────────────────\n\nexport interface MonitoredDeclaration {\n readonly property: LayoutSignalName\n readonly value: string\n readonly position: CascadePosition\n readonly guardProvenance: RuleGuard\n}\n\n\n// ── Cached bind state (lazily built per symbol table) ────────────────────\n\nconst bindCacheBySymbolTable = new WeakMap<SymbolTable, {\n readonly monitoredDeclarationsBySelectorId: ReadonlyMap<number, readonly MonitoredDeclaration[]>\n}>()\n\nexport function getOrBuildBindState(symbolTable: SymbolTable): {\n readonly monitoredDeclarationsBySelectorId: ReadonlyMap<number, readonly MonitoredDeclaration[]>\n} {\n const cached = bindCacheBySymbolTable.get(symbolTable)\n if (cached !== undefined) return cached\n\n const state = {\n monitoredDeclarationsBySelectorId: buildMonitoredDeclarationsMap(symbolTable),\n }\n bindCacheBySymbolTable.set(symbolTable, state)\n return state\n}\n\n\n// ── buildMonitoredDeclarationsMap ────────────────────────────────────────\n\nfunction buildMonitoredDeclarationsMap(\n symbolTable: SymbolTable,\n): ReadonlyMap<number, readonly MonitoredDeclaration[]> {\n const out = new Map<number, readonly MonitoredDeclaration[]>()\n\n const variablesByName = buildVariablesByNameFromSymbolTable(symbolTable)\n\n for (const [selectorId, symbol] of symbolTable.selectors) {\n const entity = symbol.entity\n const guard = resolveRuleGuard(entity.rule)\n const layerOrder = resolveLayerOrder(entity.rule.containingLayer, symbolTable)\n\n const declarations = collectMonitoredDeclarations(\n entity,\n layerOrder,\n guard,\n variablesByName,\n )\n\n if (declarations.length > 0) {\n out.set(selectorId, declarations)\n }\n }\n\n return out\n}\n\nfunction buildVariablesByNameFromSymbolTable(\n symbolTable: SymbolTable,\n): ReadonlyMap<string, readonly VariableEntity[]> {\n const out = new Map<string, VariableEntity[]>()\n\n for (const [name, symbol] of symbolTable.customProperties) {\n const existing = out.get(name)\n if (existing) {\n existing.push(symbol.entity)\n } else {\n out.set(name, [symbol.entity])\n }\n }\n\n return out\n}\n\n// ── resolveRuleGuard (moved from cross-file/layout/guard-model.ts) ───────\n\nconst UNCONDITIONAL_GUARD: RuleGuard = { kind: SignalGuardKind.Unconditional, conditions: [], key: \"always\" }\nconst WHITESPACE_RE_GLOBAL = /\\s+/g\n\nfunction resolveRuleGuard(rule: RuleEntity): RuleGuard {\n const conditions = collectRuleConditions(rule)\n if (conditions.length === 0) return UNCONDITIONAL_GUARD\n return {\n kind: SignalGuardKind.Conditional,\n conditions,\n key: conditions.map((c) => c.key).join(\"&\"),\n }\n}\n\nfunction collectRuleConditions(rule: RuleEntity): readonly GuardConditionProvenance[] {\n const out: GuardConditionProvenance[] = []\n const seenKeys = new Set<string>()\n function pushCondition(condition: GuardConditionProvenance): void {\n if (seenKeys.has(condition.key)) return\n seenKeys.add(condition.key)\n out.push(condition)\n }\n if (rule.containingMedia !== null) {\n const mediaCondition = toGuardCondition(rule.containingMedia)\n if (mediaCondition !== null) pushCondition(mediaCondition)\n }\n let current: RuleEntity[\"parent\"] = rule.parent\n while (current !== null) {\n if (current.kind === \"rule\") { current = current.parent; continue }\n const condition = toGuardCondition(current)\n if (condition !== null) pushCondition(condition)\n current = current.parent\n }\n if (out.length === 0) return []\n out.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0)\n return out\n}\n\nfunction toGuardCondition(atRule: AtRuleEntity): GuardConditionProvenance | null {\n if (atRule.kind === \"media\") return buildGuardCondition(\"media\", atRule.params)\n if (atRule.kind === \"supports\") return buildGuardCondition(\"supports\", atRule.params)\n if (atRule.kind === \"container\") return buildGuardCondition(\"container\", atRule.parsedParams.containerCondition ?? atRule.params)\n return null\n}\n\nfunction buildGuardCondition(kind: GuardConditionKind, query: string | null): GuardConditionProvenance {\n const normalized = query === null ? null : query.trim().toLowerCase().replace(WHITESPACE_RE_GLOBAL, \" \") || null\n return { kind, query, key: `${kind}:${normalized === null ? \"*\" : normalized}` }\n}\n\n\n// ── expandShorthand (moved from cross-file/layout/shorthand-expansion.ts) ─\n\ninterface ShorthandExpansionResult { readonly name: string; readonly value: string }\n\nconst QUAD_EXPANSIONS: ReadonlyMap<string, readonly [string, string, string, string]> = new Map([\n [\"padding\", [\"padding-top\", \"padding-right\", \"padding-bottom\", \"padding-left\"]],\n [\"border-width\", [\"border-top-width\", \"border-right-width\", \"border-bottom-width\", \"border-left-width\"]],\n [\"margin\", [\"margin-top\", \"margin-right\", \"margin-bottom\", \"margin-left\"]],\n [\"inset\", [\"top\", \"right\", \"bottom\", \"left\"]],\n])\n\nconst BLOCK_EXPANSIONS: ReadonlyMap<string, readonly [string, string]> = new Map([\n [\"margin-block\", [\"margin-top\", \"margin-bottom\"]],\n [\"padding-block\", [\"padding-top\", \"padding-bottom\"]],\n [\"inset-block\", [\"inset-block-start\", \"inset-block-end\"]],\n])\n\nconst INLINE_EXPANSIONS: ReadonlyMap<string, readonly [string, string]> = new Map([\n [\"padding-inline\", [\"padding-left\", \"padding-right\"]],\n])\n\nconst FLEX_DIRECTION_VALUES = new Set([\"row\", \"row-reverse\", \"column\", \"column-reverse\"])\n\nexport function expandShorthand(property: string, value: string): readonly ShorthandExpansionResult[] | null | undefined {\n const quadTarget = QUAD_EXPANSIONS.get(property)\n if (quadTarget !== undefined) {\n const parsed = parseQuadShorthand(value)\n if (parsed === null) return null\n return [\n { name: quadTarget[0], value: parsed.top },\n { name: quadTarget[1], value: parsed.right },\n { name: quadTarget[2], value: parsed.bottom },\n { name: quadTarget[3], value: parsed.left },\n ]\n }\n const blockTarget = BLOCK_EXPANSIONS.get(property)\n if (blockTarget !== undefined) {\n const parsed = parseBlockShorthand(value)\n if (parsed === null) return null\n return [{ name: blockTarget[0], value: parsed.start }, { name: blockTarget[1], value: parsed.end }]\n }\n const inlineTarget = INLINE_EXPANSIONS.get(property)\n if (inlineTarget !== undefined) {\n const parsed = parseBlockShorthand(value)\n if (parsed === null) return null\n return [{ name: inlineTarget[0], value: parsed.start }, { name: inlineTarget[1], value: parsed.end }]\n }\n if (property === \"flex-flow\") return expandFlexFlow(value)\n return undefined\n}\n\nfunction expandFlexFlow(value: string): readonly ShorthandExpansionResult[] | null {\n const tokens = splitWhitespaceTokens(value.trim().toLowerCase())\n if (tokens.length === 0 || tokens.length > 2) return null\n let direction: string | null = null\n let wrap: string | null = null\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (!token) continue\n if (FLEX_DIRECTION_VALUES.has(token)) { if (direction !== null) return null; direction = token }\n else { if (wrap !== null) return null; wrap = token }\n }\n const out: ShorthandExpansionResult[] = []\n if (direction !== null) out.push({ name: \"flex-direction\", value: direction })\n if (wrap !== null) out.push({ name: \"flex-wrap\", value: wrap })\n return out.length > 0 ? out : null\n}\n\nexport function getShorthandLonghandNames(property: string): readonly string[] | null {\n const quad = QUAD_EXPANSIONS.get(property)\n if (quad !== undefined) return [...quad]\n const block = BLOCK_EXPANSIONS.get(property)\n if (block !== undefined) return [...block]\n const inline = INLINE_EXPANSIONS.get(property)\n if (inline !== undefined) return [...inline]\n if (property === \"flex-flow\") return [\"flex-direction\", \"flex-wrap\"]\n return null\n}\n\nfunction resolveLayerOrder(\n containingLayer: { readonly parsedParams: { readonly layerName?: string | null } } | null,\n symbolTable: SymbolTable,\n): number {\n if (!containingLayer) return 0\n const name = containingLayer.parsedParams.layerName ?? null\n if (!name) return 0\n const layerSymbol = symbolTable.layers.get(name)\n if (!layerSymbol) return 0\n return layerSymbol.order\n}\n\nfunction collectMonitoredDeclarations(\n selector: { readonly rule: { readonly declarations: readonly { readonly property: string; readonly value: string; readonly sourceOrder: number; readonly cascadePosition: CascadePosition; readonly node: { readonly important: boolean } }[] }; readonly specificity: readonly [number, number, number, number]; readonly specificityScore: number },\n layerOrder: number,\n guard: RuleGuard,\n variablesByName: ReadonlyMap<string, readonly VariableEntity[]>,\n): readonly MonitoredDeclaration[] {\n const out: MonitoredDeclaration[] = []\n const declarations = selector.rule.declarations\n for (let i = 0; i < declarations.length; i++) {\n const declaration = declarations[i]\n if (!declaration) continue\n const property = declaration.property.toLowerCase()\n if (!isMonitoredSignal(property)) continue\n\n const position: CascadePosition = {\n layer: declaration.cascadePosition.layer,\n layerOrder,\n sourceOrder: declaration.sourceOrder,\n specificity: selector.specificity,\n specificityScore: selector.specificityScore,\n isImportant: declaration.cascadePosition.isImportant || declaration.node.important,\n }\n\n const rawValue = declaration.value\n const resolvedValue = variablesByName.size > 0 && rawValue.includes(\"var(\")\n ? substituteVarReferences(rawValue, variablesByName, 0)\n : rawValue\n\n const directSignal = MONITORED_SIGNAL_NAME_MAP.get(property)\n if (directSignal !== undefined) {\n out.push({ property: directSignal, value: resolvedValue, guardProvenance: guard, position })\n continue\n }\n\n const value = resolvedValue.trim().toLowerCase()\n const expanded = expandShorthand(property, value)\n if (expanded === undefined) continue\n if (expanded === null) {\n const longhandNames = getShorthandLonghandNames(property)\n if (longhandNames === null) continue\n for (let j = 0; j < longhandNames.length; j++) {\n const longhand = longhandNames[j]\n if (!longhand) continue\n const signal = MONITORED_SIGNAL_NAME_MAP.get(longhand)\n if (signal === undefined) continue\n out.push({ property: signal, value: resolvedValue, guardProvenance: guard, position })\n }\n continue\n }\n for (let j = 0; j < expanded.length; j++) {\n const entry = expanded[j]\n if (!entry) continue\n const signal = MONITORED_SIGNAL_NAME_MAP.get(entry.name)\n if (signal === undefined) continue\n out.push({ property: signal, value: entry.value, guardProvenance: guard, position })\n }\n }\n\n return out\n}\n\n\n// ── Variable substitution ────────────────────────────────────────────────\n\nconst MAX_VAR_SUBSTITUTION_DEPTH = 10\n\nfunction substituteVarReferences(\n value: string,\n variablesByName: ReadonlyMap<string, readonly VariableEntity[]>,\n depth: number,\n): string {\n if (depth >= MAX_VAR_SUBSTITUTION_DEPTH) return value\n const refs = extractVarReferences(value)\n if (refs.length === 0) return value\n\n let result = value\n for (let i = refs.length - 1; i >= 0; i--) {\n const ref = refs[i]\n if (!ref) continue\n const candidates = variablesByName.get(ref.name)\n const resolvedValue = candidates !== undefined && candidates.length > 0\n ? selectBestVariableValue(candidates)\n : ref.fallback\n if (resolvedValue === null) continue\n result = result.slice(0, ref.sourceIndex) + resolvedValue + result.slice(ref.sourceIndex + ref.raw.length)\n }\n\n if (result !== value && result.includes(\"var(\")) {\n return substituteVarReferences(result, variablesByName, depth + 1)\n }\n\n return result\n}\n\nfunction selectBestVariableValue(candidates: readonly VariableEntity[]): string | null {\n let bestGlobal: VariableEntity | null = null\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i]\n if (!candidate) continue\n if (candidate.scope.type === \"global\") {\n if (bestGlobal === null || candidate.declaration.sourceOrder > bestGlobal.declaration.sourceOrder) {\n bestGlobal = candidate\n }\n }\n }\n\n if (bestGlobal !== null) return bestGlobal.value\n const first = candidates[0]\n return first ? first.value : null\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Selector Matching Engine\n// Moved from cross-file/layout/selector-match.ts\n// ══════════════════════════════════════════════════════════════════════════\n\nconst enum MatchResult { Match = 0, NoMatch = 1, Conditional = 2 }\n\ninterface ElementIndex {\n readonly byDispatchKey: ReadonlyMap<string, readonly ElementNode[]>\n readonly byTagName: ReadonlyMap<string, readonly ElementNode[]>\n}\n\ntype CompiledCompound = CompiledSelectorMatcher[\"compoundsRightToLeft\"][number]\n\nexport function selectorMatchesElement(\n element: ElementNode,\n matcher: CompiledSelectorMatcher,\n): boolean {\n const firstCompound = matcher.compoundsRightToLeft[0]\n if (firstCompound === undefined) return false\n const subjectResult = matchesCompound(element, firstCompound)\n if (subjectResult === MatchResult.NoMatch) return false\n if (matcher.compoundsRightToLeft.length === 1) return true\n const chainResult = matchesChain(matcher, element, 0, null, null)\n return chainResult !== MatchResult.NoMatch\n}\n\nfunction matchElement(\n matcher: CompiledSelectorMatcher,\n node: ElementNode,\n rootElements: readonly ElementNode[] | null,\n fileElementIndex: ElementIndex | null,\n): MatchResult {\n const firstCompound = matcher.compoundsRightToLeft[0]\n if (firstCompound === undefined) return MatchResult.NoMatch\n const subjectResult = matchesCompound(node, firstCompound)\n if (subjectResult === MatchResult.NoMatch) return MatchResult.NoMatch\n if (matcher.compoundsRightToLeft.length === 1) return subjectResult\n const chainResult = matchesChain(matcher, node, 0, rootElements, fileElementIndex)\n if (chainResult === MatchResult.NoMatch) return MatchResult.NoMatch\n if (subjectResult === MatchResult.Conditional || chainResult === MatchResult.Conditional) return MatchResult.Conditional\n return MatchResult.Match\n}\n\nfunction matchesChain(\n matcher: CompiledSelectorMatcher,\n node: ElementNode,\n index: number,\n fileRootElements: readonly ElementNode[] | null,\n fileElementIndex: ElementIndex | null,\n): MatchResult {\n const combinator = matcher.combinatorsRightToLeft[index]\n if (combinator === undefined) return MatchResult.NoMatch\n const nextIndex = index + 1\n const targetCompound = matcher.compoundsRightToLeft[nextIndex]\n if (targetCompound === undefined) return MatchResult.NoMatch\n const isFinal = nextIndex === matcher.compoundsRightToLeft.length - 1\n\n if (combinator === \"child\") {\n const parent = node.parentElementNode\n if (parent === null) return MatchResult.NoMatch\n const compoundResult = matchesCompound(parent, targetCompound)\n if (compoundResult === MatchResult.NoMatch) return MatchResult.NoMatch\n if (isFinal) return compoundResult\n const chainResult = matchesChain(matcher, parent, nextIndex, fileRootElements, fileElementIndex)\n return mergeMatchResults(compoundResult, chainResult)\n }\n\n if (combinator === \"adjacent\") {\n const sibling = node.previousSiblingNode\n if (sibling === null) return MatchResult.NoMatch\n const compoundResult = matchesCompound(sibling, targetCompound)\n if (compoundResult === MatchResult.NoMatch) return MatchResult.NoMatch\n if (isFinal) return compoundResult\n const chainResult = matchesChain(matcher, sibling, nextIndex, fileRootElements, fileElementIndex)\n return mergeMatchResults(compoundResult, chainResult)\n }\n\n if (combinator === \"sibling\") {\n let sibling = node.previousSiblingNode\n while (sibling !== null) {\n const compoundResult = matchesCompound(sibling, targetCompound)\n if (compoundResult !== MatchResult.NoMatch) {\n if (isFinal) return compoundResult\n const chainResult = matchesChain(matcher, sibling, nextIndex, fileRootElements, fileElementIndex)\n if (chainResult !== MatchResult.NoMatch) return mergeMatchResults(compoundResult, chainResult)\n }\n sibling = sibling.previousSiblingNode\n }\n return MatchResult.NoMatch\n }\n\n // Descendant combinator — walk ancestor chain\n let bestResult: MatchResult = MatchResult.NoMatch\n let ancestor = node.parentElementNode\n while (ancestor !== null) {\n const compoundResult = matchesCompound(ancestor, targetCompound)\n if (compoundResult !== MatchResult.NoMatch) {\n if (isFinal) return compoundResult\n const chainResult = matchesChain(matcher, ancestor, nextIndex, fileRootElements, fileElementIndex)\n if (chainResult !== MatchResult.NoMatch) {\n const merged = mergeMatchResults(compoundResult, chainResult)\n if (merged === MatchResult.Match) return MatchResult.Match\n bestResult = merged\n }\n }\n ancestor = ancestor.parentElementNode\n }\n\n // Same-file root element fallback for descendant combinators\n if (fileRootElements !== null) {\n for (let r = 0; r < fileRootElements.length; r++) {\n const root = fileRootElements[r]\n if (root === undefined) continue\n if (root === node) continue\n if (root.solidFile !== node.solidFile) continue\n const compoundResult = matchesCompound(root, targetCompound)\n if (compoundResult !== MatchResult.NoMatch) {\n if (isFinal) return compoundResult\n const chainResult = matchesChain(matcher, root, nextIndex, fileRootElements, fileElementIndex)\n if (chainResult !== MatchResult.NoMatch) {\n const merged = mergeMatchResults(compoundResult, chainResult)\n if (merged === MatchResult.Match) return MatchResult.Match\n bestResult = merged\n }\n }\n }\n }\n\n // Dispatch-key-indexed fallback for descendant combinators\n if (fileElementIndex !== null && bestResult === MatchResult.NoMatch) {\n const candidates = resolveCompoundCandidates(fileElementIndex, targetCompound)\n if (candidates !== null) {\n for (let r = 0; r < candidates.length; r++) {\n const elem = candidates[r]\n if (elem === undefined) continue\n if (elem === node) continue\n const compoundResult = matchesCompound(elem, targetCompound)\n if (compoundResult !== MatchResult.NoMatch) {\n bestResult = MatchResult.Conditional\n break\n }\n }\n }\n }\n\n return bestResult\n}\n\nfunction mergeMatchResults(a: MatchResult, b: MatchResult): MatchResult {\n if (a === MatchResult.NoMatch || b === MatchResult.NoMatch) return MatchResult.NoMatch\n if (a === MatchResult.Conditional || b === MatchResult.Conditional) return MatchResult.Conditional\n return MatchResult.Match\n}\n\nfunction resolveCompoundCandidates(\n index: ElementIndex,\n compound: CompiledCompound,\n): readonly ElementNode[] | null {\n if (compound.idValue !== null) {\n return index.byDispatchKey.get(`id:${compound.idValue}`) ?? null\n }\n if (compound.classes.length > 0 && compound.classes[0] !== undefined) {\n return index.byDispatchKey.get(`class:${compound.classes[0]}`) ?? null\n }\n if (compound.attributes.length > 0 && compound.attributes[0] !== undefined) {\n return index.byDispatchKey.get(`attr:${compound.attributes[0].name}`) ?? null\n }\n if (compound.tagName !== null) {\n return index.byTagName.get(compound.tagName) ?? null\n }\n return null\n}\n\nfunction matchesCompound(node: ElementNode, compound: CompiledCompound): MatchResult {\n if (compound.tagName !== null && node.tagName !== compound.tagName) return MatchResult.NoMatch\n\n if (compound.idValue !== null) {\n const id = node.attributes.get(\"id\")\n if (id !== compound.idValue) return MatchResult.NoMatch\n }\n\n if (!matchesRequiredClasses(compound.classes, node.classTokenSet)) return MatchResult.NoMatch\n const attrResult = matchesRequiredAttributes(compound.attributes, node.attributes)\n if (attrResult === MatchResult.NoMatch) return MatchResult.NoMatch\n if (!matchesPseudoConstraints(node, compound.pseudo)) return MatchResult.NoMatch\n\n return attrResult\n}\n\nfunction matchesPseudoConstraints(node: ElementNode, pseudo: CompiledCompound[\"pseudo\"]): boolean {\n if (pseudo.firstChild && node.siblingIndex !== 1) return false\n if (pseudo.lastChild && node.siblingIndex !== node.siblingCount) return false\n if (pseudo.onlyChild && node.siblingCount !== 1) return false\n if (pseudo.nthChild !== null && !matchesNthPattern(node.siblingIndex, pseudo.nthChild)) return false\n\n if (pseudo.nthLastChild !== null) {\n const nthFromEnd = node.siblingCount - node.siblingIndex + 1\n if (!matchesNthPattern(nthFromEnd, pseudo.nthLastChild)) return false\n }\n\n if (pseudo.nthOfType !== null) {\n if (!matchesNthPattern(node.siblingTypeIndex, pseudo.nthOfType)) return false\n }\n\n if (pseudo.nthLastOfType !== null) {\n const nthFromTypeEnd = node.siblingTypeCount - node.siblingTypeIndex + 1\n if (!matchesNthPattern(nthFromTypeEnd, pseudo.nthLastOfType)) return false\n }\n\n for (let i = 0; i < pseudo.anyOfGroups.length; i++) {\n const group = pseudo.anyOfGroups[i]\n if (group === undefined) continue\n let matched = false\n\n for (let j = 0; j < group.length; j++) {\n const compound = group[j]\n if (compound === undefined) continue\n if (matchesCompound(node, compound) === MatchResult.NoMatch) continue\n matched = true\n break\n }\n\n if (!matched) return false\n }\n\n for (let i = 0; i < pseudo.noneOfGroups.length; i++) {\n const group = pseudo.noneOfGroups[i]\n if (group === undefined) continue\n\n for (let j = 0; j < group.length; j++) {\n const compound = group[j]\n if (compound === undefined) continue\n if (matchesCompound(node, compound) === MatchResult.NoMatch) continue\n return false\n }\n }\n\n return true\n}\n\nfunction matchesNthPattern(index: number, pattern: NthPattern): boolean {\n if (index < 1) return false\n\n const step = pattern.step\n const offset = pattern.offset\n if (step === 0) {\n if (offset < 1) return false\n return index === offset\n }\n\n if (step > 0) {\n const delta = index - offset\n if (delta < 0) return false\n return delta % step === 0\n }\n\n const positiveStep = -step\n const delta = offset - index\n if (delta < 0) return false\n return delta % positiveStep === 0\n}\n\nfunction matchesRequiredClasses(required: readonly string[], actual: ReadonlySet<string>): boolean {\n if (required.length === 0) return true\n if (actual.size === 0) return false\n\n for (let i = 0; i < required.length; i++) {\n const cls = required[i]\n if (cls === undefined) continue\n if (actual.has(cls)) continue\n return false\n }\n\n return true\n}\n\nfunction matchesRequiredAttributes(\n required: readonly SelectorAttributeConstraint[],\n actual: ReadonlyMap<string, string | null>,\n): MatchResult {\n if (required.length === 0) return MatchResult.Match\n\n let hasConditional = false\n\n for (let i = 0; i < required.length; i++) {\n const constraint = required[i]\n if (constraint === undefined) continue\n if (!actual.has(constraint.name)) return MatchResult.NoMatch\n if (constraint.operator === \"exists\") {\n const existsValue = actual.get(constraint.name)\n if (existsValue === null) hasConditional = true\n continue\n }\n\n const actualValue = actual.get(constraint.name)\n if (actualValue === undefined) return MatchResult.NoMatch\n if (actualValue === null) {\n hasConditional = true\n continue\n }\n if (constraint.value === null) return MatchResult.NoMatch\n if (matchesAttributeValue(actualValue, constraint)) continue\n return MatchResult.NoMatch\n }\n\n return hasConditional ? MatchResult.Conditional : MatchResult.Match\n}\n\nfunction matchesAttributeValue(\n actualValue: string,\n constraint: SelectorAttributeConstraint,\n): boolean {\n const expectedValue = constraint.value\n if (expectedValue === null) return false\n\n const actual = constraint.caseInsensitive ? actualValue.toLowerCase() : actualValue\n const expected = constraint.caseInsensitive ? expectedValue.toLowerCase() : expectedValue\n\n if (constraint.operator === \"equals\") return actual === expected\n if (constraint.operator === \"prefix\") return actual.startsWith(expected)\n if (constraint.operator === \"suffix\") return actual.endsWith(expected)\n if (constraint.operator === \"contains\") return actual.includes(expected)\n\n if (constraint.operator === \"includes-word\") {\n return includesAttributeWord(actual, expected)\n }\n\n if (constraint.operator === \"dash-prefix\") {\n if (actual === expected) return true\n return actual.startsWith(expected + \"-\")\n }\n\n return false\n}\n\nfunction includesAttributeWord(value: string, word: string): boolean {\n if (value.length === 0 || word.length === 0) return false\n\n let i = 0\n while (i < value.length) {\n while (i < value.length && isWhitespace(value.charCodeAt(i))) i++\n if (i >= value.length) return false\n\n const start = i\n while (i < value.length && !isWhitespace(value.charCodeAt(i))) i++\n const tokenLength = i - start\n if (tokenLength !== word.length) continue\n if (value.startsWith(word, start)) return true\n }\n\n return false\n}\n\n\n// ── bind / bindFile ──────────────────────────────────────────────────────\n\nexport function bind(\n element: ElementNode,\n scopedSelectors: ScopedSelectorIndex,\n symbolTable: SymbolTable,\n): ElementCascade {\n const state = getOrBuildBindState(symbolTable)\n const edges: SelectorMatch[] = []\n\n appendMatchingEdges(element, scopedSelectors, edges)\n\n const declarations = buildCascadeMap(element, edges, state, symbolTable)\n\n return {\n elementId: element.elementId,\n declarations,\n edges,\n }\n}\n\nexport function bindFile(\n elements: readonly ElementNode[],\n scopedSelectors: ScopedSelectorIndex,\n symbolTable: SymbolTable,\n): ReadonlyMap<number, ElementCascade> {\n const state = getOrBuildBindState(symbolTable)\n const out = new Map<number, ElementCascade>()\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n\n const edges: SelectorMatch[] = []\n appendMatchingEdges(element, scopedSelectors, edges)\n const declarations = buildCascadeMap(element, edges, state, symbolTable)\n\n out.set(element.elementId, {\n elementId: element.elementId,\n declarations,\n edges,\n })\n }\n\n return out\n}\n\nfunction appendMatchingEdges(\n element: ElementNode,\n scopedSelectors: ScopedSelectorIndex,\n edges: SelectorMatch[],\n): void {\n const candidates: SelectorSymbol[] = []\n\n const dispatchKeys = element.selectorDispatchKeys\n for (let i = 0; i < dispatchKeys.length; i++) {\n const key = dispatchKeys[i]\n if (key === undefined) continue\n const bucket = scopedSelectors.byDispatchKey.get(key)\n if (!bucket) continue\n for (let j = 0; j < bucket.length; j++) {\n const symbol = bucket[j]\n if (symbol) candidates.push(symbol)\n }\n }\n\n if (element.tagName !== null) {\n const byTag = scopedSelectors.byTagName.get(element.tagName)\n if (byTag) {\n for (let j = 0; j < byTag.length; j++) {\n const symbol = byTag[j]\n if (symbol) candidates.push(symbol)\n }\n }\n }\n\n const seen = new Set<number>()\n for (let i = 0; i < candidates.length; i++) {\n const symbol = candidates[i]\n if (!symbol) continue\n if (seen.has(symbol.entity.id)) continue\n seen.add(symbol.entity.id)\n\n const matcher = symbol.compiledMatcher\n if (matcher === null) continue\n\n const matchResult = matchElement(matcher, element, null, null)\n if (matchResult === MatchResult.NoMatch) continue\n\n edges.push({\n selectorId: symbol.entity.id,\n specificityScore: symbol.entity.specificityScore,\n sourceOrder: symbol.entity.rule.sourceOrder,\n conditionalMatch: matchResult === MatchResult.Conditional,\n })\n }\n}\n\n\n// ── Cascade map ──────────────────────────────────────────────────────────\n\nconst DYNAMIC_ATTRIBUTE_GUARD: RuleGuard = {\n kind: SignalGuardKind.Conditional,\n conditions: [{ kind: \"dynamic-attribute\", query: null, key: \"dynamic-attribute:*\" }],\n key: \"dynamic-attribute:*\",\n}\n\nconst INLINE_CASCADE_POSITION: CascadePosition = Object.freeze({\n layer: null,\n layerOrder: Number.MAX_SAFE_INTEGER,\n sourceOrder: Number.MAX_SAFE_INTEGER,\n specificity: [1, 0, 0, 0] as const,\n specificityScore: Number.MAX_SAFE_INTEGER,\n isImportant: false,\n})\n\nconst INLINE_GUARD_PROVENANCE: RuleGuard = Object.freeze({\n kind: SignalGuardKind.Unconditional,\n conditions: [],\n key: \"always\",\n})\n\ninterface CascadeCandidate {\n readonly declaration: CascadedDeclaration\n readonly position: CascadePosition\n}\n\nfunction buildCascadeMap(\n element: ElementNode,\n edges: readonly SelectorMatch[],\n state: { readonly monitoredDeclarationsBySelectorId: ReadonlyMap<number, readonly MonitoredDeclaration[]> },\n symbolTable: SymbolTable,\n): ReadonlyMap<string, CascadedDeclaration> {\n const out = new Map<string, CascadedDeclaration>()\n const positions = new Map<string, CascadePosition>()\n\n for (let i = 0; i < edges.length; i++) {\n const edge = edges[i]\n if (!edge) continue\n const declarations = state.monitoredDeclarationsBySelectorId.get(edge.selectorId)\n if (!declarations) continue\n\n for (let j = 0; j < declarations.length; j++) {\n const declaration = declarations[j]\n if (!declaration) continue\n const property = declaration.property\n\n const guardProvenance = edge.conditionalMatch && declaration.guardProvenance.kind === SignalGuardKind.Unconditional\n ? DYNAMIC_ATTRIBUTE_GUARD\n : declaration.guardProvenance\n\n const newDeclaration: CascadedDeclaration = {\n value: declaration.value,\n source: SignalSource.Selector,\n guardProvenance,\n }\n\n const existingPosition = positions.get(property)\n if (existingPosition === undefined) {\n out.set(property, newDeclaration)\n positions.set(property, declaration.position)\n continue\n }\n\n const existingDeclaration = out.get(property)\n if (existingDeclaration === undefined) continue\n if (!doesCandidateOverride(\n { declaration: existingDeclaration, position: existingPosition },\n { declaration: newDeclaration, position: declaration.position },\n )) continue\n out.set(property, newDeclaration)\n positions.set(property, declaration.position)\n }\n }\n\n // Inline styles\n for (const [property, value] of element.inlineStyleValues) {\n const newDeclaration: CascadedDeclaration = {\n value,\n source: SignalSource.InlineStyle,\n guardProvenance: INLINE_GUARD_PROVENANCE,\n }\n\n const existingPosition = positions.get(property)\n if (existingPosition === undefined) {\n out.set(property, newDeclaration)\n positions.set(property, INLINE_CASCADE_POSITION)\n continue\n }\n\n const existingDeclaration = out.get(property)\n if (existingDeclaration === undefined) continue\n if (!doesCandidateOverride(\n { declaration: existingDeclaration, position: existingPosition },\n { declaration: newDeclaration, position: INLINE_CASCADE_POSITION },\n )) continue\n out.set(property, newDeclaration)\n positions.set(property, INLINE_CASCADE_POSITION)\n }\n\n // Tailwind augmentation (lowest priority — fills gaps only)\n augmentCascadeWithTailwindFromSymbolTable(out, element, symbolTable)\n\n return out\n}\n\nfunction doesCandidateOverride(\n existing: CascadeCandidate,\n incoming: CascadeCandidate,\n): boolean {\n const existingSource = existing.declaration.source\n const incomingSource = incoming.declaration.source\n\n if (existingSource !== incomingSource) {\n if (incomingSource === SignalSource.InlineStyle) {\n if (existing.position.isImportant && !incoming.position.isImportant) return false\n return true\n }\n if (existing.position.isImportant && !incoming.position.isImportant) return false\n }\n\n return compareCascadePositions(incoming.position, existing.position) > 0\n}\n\n\n// ── Tailwind augmentation via symbol table ───────────────────────────────\n\nconst TAILWIND_CSS_DECLARATION = /^\\s+([\\w-]+)\\s*:\\s*(.+?)\\s*;?\\s*$/gm\n\nfunction parseTailwindCssDeclarations(css: string): readonly [string, string][] {\n const result: [string, string][] = []\n TAILWIND_CSS_DECLARATION.lastIndex = 0\n let match: RegExpExecArray | null\n while ((match = TAILWIND_CSS_DECLARATION.exec(css)) !== null) {\n const prop = match[1]\n const val = match[2]\n if (prop === undefined || val === undefined) continue\n result.push([prop, val])\n }\n return result\n}\n\nfunction augmentCascadeWithTailwindFromSymbolTable(\n cascade: Map<string, CascadedDeclaration>,\n element: ElementNode,\n symbolTable: SymbolTable,\n): void {\n const classTokens = element.classTokens\n if (classTokens.length === 0) return\n\n const guardProvenance: RuleGuard = {\n kind: SignalGuardKind.Unconditional,\n conditions: [],\n key: \"always\",\n }\n\n for (let i = 0; i < classTokens.length; i++) {\n const token = classTokens[i]\n if (token === undefined) continue\n const classSymbol = symbolTable.classNames.get(token)\n if (!classSymbol) continue\n if (classSymbol.source.kind !== \"tailwind\") continue\n const resolvedCSS = classSymbol.source.resolvedCSS\n if (resolvedCSS === null) continue\n\n const declarations = parseTailwindCssDeclarations(resolvedCSS)\n for (let j = 0; j < declarations.length; j++) {\n const entry = declarations[j]\n if (!entry) continue\n const [property, value] = entry\n if (cascade.has(property)) continue\n cascade.set(property, {\n value,\n source: SignalSource.Selector,\n guardProvenance,\n })\n }\n }\n}\n\n\n// ── Layout fact computation from cascade ─────────────────────────────────\n\nimport type { LayoutFactKind, LayoutFactMap, ReservedSpaceFact, ScrollContainerFact, FlowParticipationFact, ContainingBlockFact } from \"../analysis/layout-fact\"\n\nconst SCROLLABLE_VALUES: ReadonlySet<string> = new Set([\"auto\", \"scroll\"])\nconst OUT_OF_FLOW_POSITIONS: ReadonlySet<string> = new Set([\"absolute\", \"fixed\", \"sticky\"])\n\nexport function computeLayoutFact<K extends LayoutFactKind>(\n factKind: K,\n elementId: number,\n declarations: ReadonlyMap<string, CascadedDeclaration>,\n allElements: readonly ElementNode[],\n getCascadeForElement: (id: number) => ReadonlyMap<string, CascadedDeclaration>,\n): LayoutFactMap[K] {\n switch (factKind) {\n case \"reservedSpace\": return computeReservedSpaceFact(declarations) as LayoutFactMap[K]\n case \"scrollContainer\": return computeScrollContainerFact(declarations) as LayoutFactMap[K]\n case \"flowParticipation\": return computeFlowParticipationFact(declarations) as LayoutFactMap[K]\n case \"containingBlock\": return computeContainingBlockFact(elementId, allElements, getCascadeForElement) as LayoutFactMap[K]\n default: throw new Error(`Unknown layout fact kind: ${factKind}`)\n }\n}\n\nfunction getCascadeValue(declarations: ReadonlyMap<string, CascadedDeclaration>, property: string): string | null {\n const decl = declarations.get(property)\n if (!decl) return null\n return decl.value.trim().toLowerCase()\n}\n\nfunction computeReservedSpaceFact(declarations: ReadonlyMap<string, CascadedDeclaration>): ReservedSpaceFact {\n const reasons: string[] = []\n\n const height = getCascadeValue(declarations, \"height\")\n if (height !== null && height !== \"auto\" && height !== \"fit-content\" && height !== \"min-content\" && height !== \"max-content\") {\n reasons.push(\"height\")\n }\n\n const blockSize = getCascadeValue(declarations, \"block-size\")\n if (blockSize !== null && blockSize !== \"auto\" && blockSize !== \"fit-content\" && blockSize !== \"min-content\" && blockSize !== \"max-content\") {\n reasons.push(\"block-size\")\n }\n\n const minHeight = getCascadeValue(declarations, \"min-height\")\n if (minHeight !== null && minHeight !== \"0\" && minHeight !== \"0px\" && minHeight !== \"auto\") {\n reasons.push(\"min-height\")\n }\n\n const minBlockSize = getCascadeValue(declarations, \"min-block-size\")\n if (minBlockSize !== null && minBlockSize !== \"0\" && minBlockSize !== \"0px\" && minBlockSize !== \"auto\") {\n reasons.push(\"min-block-size\")\n }\n\n const containIntrinsicSize = getCascadeValue(declarations, \"contain-intrinsic-size\")\n const hasContainIntrinsicSize = containIntrinsicSize !== null\n if (hasContainIntrinsicSize) {\n reasons.push(\"contain-intrinsic-size\")\n }\n\n const aspectRatio = getCascadeValue(declarations, \"aspect-ratio\")\n const hasUsableAspectRatio = aspectRatio !== null && aspectRatio !== \"auto\"\n\n const width = getCascadeValue(declarations, \"width\")\n const inlineSize = getCascadeValue(declarations, \"inline-size\")\n const hasDeclaredInlineDimension = (width !== null && width !== \"auto\") || (inlineSize !== null && inlineSize !== \"auto\")\n const hasDeclaredBlockDimension = height !== null && height !== \"auto\"\n\n if (hasUsableAspectRatio && hasDeclaredInlineDimension) {\n if (width !== null) reasons.push(\"aspect-ratio+width\")\n if (inlineSize !== null) reasons.push(\"aspect-ratio+inline-size\")\n }\n\n return {\n hasReservedSpace: reasons.length > 0,\n reasons,\n hasContainIntrinsicSize,\n hasUsableAspectRatio,\n hasDeclaredInlineDimension,\n hasDeclaredBlockDimension,\n }\n}\n\nfunction computeScrollContainerFact(declarations: ReadonlyMap<string, CascadedDeclaration>): ScrollContainerFact {\n const overflow = getCascadeValue(declarations, \"overflow\")\n const overflowY = getCascadeValue(declarations, \"overflow-y\")\n\n let axis = 0\n let isScrollContainer = false\n let hasConditionalScroll = false\n let hasUnconditionalScroll = false\n\n if (overflow !== null && SCROLLABLE_VALUES.has(overflow)) {\n isScrollContainer = true\n axis = 3 // both\n const decl = declarations.get(\"overflow\")\n if (decl && decl.guardProvenance.kind === SignalGuardKind.Conditional) {\n hasConditionalScroll = true\n } else {\n hasUnconditionalScroll = true\n }\n }\n\n if (overflowY !== null && SCROLLABLE_VALUES.has(overflowY)) {\n isScrollContainer = true\n if (axis === 0) axis = 2 // vertical only\n const decl = declarations.get(\"overflow-y\")\n if (decl && decl.guardProvenance.kind === SignalGuardKind.Conditional) {\n hasConditionalScroll = true\n } else {\n hasUnconditionalScroll = true\n }\n }\n\n return {\n isScrollContainer,\n axis,\n overflow,\n overflowY,\n hasConditionalScroll,\n hasUnconditionalScroll,\n }\n}\n\nfunction computeFlowParticipationFact(declarations: ReadonlyMap<string, CascadedDeclaration>): FlowParticipationFact {\n const position = getCascadeValue(declarations, \"position\")\n const isOutOfFlow = position !== null && OUT_OF_FLOW_POSITIONS.has(position)\n\n let hasConditionalOutOfFlow = false\n let hasUnconditionalOutOfFlow = false\n\n if (isOutOfFlow) {\n const decl = declarations.get(\"position\")\n if (decl && decl.guardProvenance.kind === SignalGuardKind.Conditional) {\n hasConditionalOutOfFlow = true\n } else {\n hasUnconditionalOutOfFlow = true\n }\n }\n\n return {\n inFlow: !isOutOfFlow,\n position,\n hasConditionalOutOfFlow,\n hasUnconditionalOutOfFlow,\n }\n}\n\nfunction computeContainingBlockFact(\n elementId: number,\n allElements: readonly ElementNode[],\n getCascadeForElement: (id: number) => ReadonlyMap<string, CascadedDeclaration>,\n): ContainingBlockFact {\n // Walk up the parent chain to find the nearest positioned ancestor\n let current: ElementNode | null = null\n for (let i = 0; i < allElements.length; i++) {\n const el = allElements[i]\n if (el && el.elementId === elementId) { current = el; break }\n }\n\n if (current === null) {\n return { nearestPositionedAncestorKey: null, nearestPositionedAncestorHasReservedSpace: false }\n }\n\n let ancestor = current.parentElementNode\n while (ancestor !== null) {\n const ancestorCascade = getCascadeForElement(ancestor.elementId)\n const pos = getCascadeValue(ancestorCascade, \"position\")\n if (pos !== null && pos !== \"static\") {\n const reservedFact = computeReservedSpaceFact(ancestorCascade)\n return {\n nearestPositionedAncestorKey: ancestor.key,\n nearestPositionedAncestorHasReservedSpace: reservedFact.hasReservedSpace,\n }\n }\n ancestor = ancestor.parentElementNode\n }\n\n return { nearestPositionedAncestorKey: null, nearestPositionedAncestorHasReservedSpace: false }\n}\n","/**\n * Scoped selector index type + construction (Phase 6 adds buildScopedSelectorIndex).\n */\nimport type { SelectorSymbol } from \"../symbols/selector\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\n\nexport interface ScopedSelectorIndex {\n readonly byDispatchKey: ReadonlyMap<string, readonly SelectorSymbol[]>\n readonly byTagName: ReadonlyMap<string, readonly SelectorSymbol[]>\n readonly requirements: {\n readonly needsClassTokens: boolean\n readonly needsAttributes: boolean\n }\n}\n\nexport function buildScopedSelectorIndex(\n scopedCSSFiles: readonly string[],\n symbolTable: SymbolTable,\n): ScopedSelectorIndex {\n if (scopedCSSFiles.length === 0) {\n return {\n byDispatchKey: new Map(),\n byTagName: new Map(),\n requirements: { needsClassTokens: false, needsAttributes: false },\n }\n }\n\n const scopedSet = new Set<string>(scopedCSSFiles)\n const byDispatchKeyMut = new Map<string, SelectorSymbol[]>()\n const byTagNameMut = new Map<string, SelectorSymbol[]>()\n let needsClassTokens = false\n let needsAttributes = false\n\n for (const [, symbol] of symbolTable.selectors) {\n if (symbol.filePath === null || !scopedSet.has(symbol.filePath)) continue\n\n const matcher = symbol.compiledMatcher\n if (matcher === null) continue\n\n if (matcher.requirements.needsClassTokens) needsClassTokens = true\n if (matcher.requirements.needsAttributes) needsAttributes = true\n\n const dispatchKeys = symbol.dispatchKeys\n for (let i = 0; i < dispatchKeys.length; i++) {\n const key = dispatchKeys[i]\n if (key === undefined) continue\n const existing = byDispatchKeyMut.get(key)\n if (existing !== undefined) {\n existing.push(symbol)\n } else {\n byDispatchKeyMut.set(key, [symbol])\n }\n }\n\n if (matcher.subjectTag !== null) {\n const tag = matcher.subjectTag\n const existing = byTagNameMut.get(tag)\n if (existing !== undefined) {\n existing.push(symbol)\n } else {\n byTagNameMut.set(tag, [symbol])\n }\n }\n }\n\n return {\n byDispatchKey: byDispatchKeyMut,\n byTagName: byTagNameMut,\n requirements: { needsClassTokens, needsAttributes },\n }\n}\n","/**\n * Layout fact types + computation from signal snapshots.\n *\n * Moved from cross-file/layout/build.ts steps 6-7.\n */\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { SignalSnapshot } from \"../binding/signal-builder\"\nimport { SignalValueKind } from \"../binding/signal-builder\"\n\nexport type LayoutFactKind = \"reservedSpace\" | \"scrollContainer\" | \"flowParticipation\" | \"containingBlock\"\n\nexport interface LayoutFactMap {\n reservedSpace: ReservedSpaceFact\n scrollContainer: ScrollContainerFact\n flowParticipation: FlowParticipationFact\n containingBlock: ContainingBlockFact\n}\n\nexport interface ReservedSpaceFact {\n readonly hasReservedSpace: boolean\n readonly reasons: readonly string[]\n readonly hasContainIntrinsicSize: boolean\n readonly hasUsableAspectRatio: boolean\n readonly hasDeclaredInlineDimension: boolean\n readonly hasDeclaredBlockDimension: boolean\n}\n\nexport const enum ScrollAxis { None = 0, X = 1, Y = 2, Both = 3 }\n\nexport interface ScrollContainerFact {\n readonly isScrollContainer: boolean\n readonly axis: number\n readonly overflow: string | null\n readonly overflowY: string | null\n readonly hasConditionalScroll: boolean\n readonly hasUnconditionalScroll: boolean\n}\n\nexport interface FlowParticipationFact {\n readonly inFlow: boolean\n readonly position: string | null\n readonly hasConditionalOutOfFlow: boolean\n readonly hasUnconditionalOutOfFlow: boolean\n}\n\nexport interface ContainingBlockFact {\n readonly nearestPositionedAncestorKey: string | null\n readonly nearestPositionedAncestorHasReservedSpace: boolean\n}\n\n\n// ── Constants ────────────────────────────────────────────────────────────\n\nconst SCROLLABLE_VALUES: ReadonlySet<string> = new Set([\"auto\", \"scroll\"])\nconst NON_RESERVING_DIMENSION_KEYWORDS = new Set([\"auto\", \"none\", \"fit-content\", \"min-content\", \"max-content\", \"stretch\", \"inherit\", \"initial\", \"unset\", \"revert\", \"revert-layer\"])\nconst BLOCK_LEVEL_DISPLAY_VALUES = new Set([\"block\", \"flex\", \"grid\", \"table\", \"list-item\", \"flow-root\", \"table-row\", \"table-cell\", \"table-caption\", \"table-row-group\", \"table-header-group\", \"table-footer-group\", \"table-column\", \"table-column-group\"])\n\n\n// ── computeReservedSpaceFact ─────────────────────────────────────────────\n\nexport function computeReservedSpaceFact(snapshot: SignalSnapshot): ReservedSpaceFact {\n const reasons: string[] = []\n\n const hasHeight = hasDeclaredDimension(snapshot, \"height\")\n if (hasHeight) reasons.push(\"height\")\n\n const hasBlockSize = hasDeclaredDimension(snapshot, \"block-size\")\n if (hasBlockSize) reasons.push(\"block-size\")\n\n const hasMinHeight = hasDeclaredDimension(snapshot, \"min-height\")\n if (hasMinHeight) reasons.push(\"min-height\")\n\n const hasMinBlockSize = hasDeclaredDimension(snapshot, \"min-block-size\")\n if (hasMinBlockSize) reasons.push(\"min-block-size\")\n\n const hasContainIntrinsic = hasDeclaredDimension(snapshot, \"contain-intrinsic-size\")\n if (hasContainIntrinsic) reasons.push(\"contain-intrinsic-size\")\n\n const hasAspectRatio = hasUsableAspectRatio(snapshot)\n if (hasAspectRatio) {\n if (hasDeclaredDimension(snapshot, \"width\")) reasons.push(\"aspect-ratio+width\")\n if (hasDeclaredDimension(snapshot, \"inline-size\")) reasons.push(\"aspect-ratio+inline-size\")\n if (hasDeclaredDimension(snapshot, \"min-width\")) reasons.push(\"aspect-ratio+min-width\")\n if (hasMinBlockSize) reasons.push(\"aspect-ratio+min-block-size\")\n if (hasMinHeight) reasons.push(\"aspect-ratio+min-height\")\n }\n\n return {\n hasReservedSpace: reasons.length > 0,\n reasons,\n hasContainIntrinsicSize: hasContainIntrinsic,\n hasUsableAspectRatio: hasAspectRatio,\n hasDeclaredBlockDimension: hasHeight || hasBlockSize || hasMinHeight || hasMinBlockSize,\n hasDeclaredInlineDimension: hasDeclaredDimension(snapshot, \"width\")\n || hasDeclaredDimension(snapshot, \"inline-size\")\n || hasDeclaredDimension(snapshot, \"min-width\")\n || hasDeclaredDimension(snapshot, \"flex-basis\")\n || isBlockLevelDisplay(snapshot),\n }\n}\n\ntype DimensionSignalName = \"width\" | \"inline-size\" | \"min-width\" | \"height\" | \"block-size\" | \"min-height\" | \"min-block-size\" | \"flex-basis\" | \"contain-intrinsic-size\"\n\nfunction hasDeclaredDimension(snapshot: SignalSnapshot, property: DimensionSignalName): boolean {\n const signal = snapshot.signals.get(property)\n if (!signal) return false\n if (signal.kind === SignalValueKind.Known) {\n if (signal.px !== null) return signal.px > 0\n if (signal.normalized.length === 0) return false\n return !isNonReservingDimension(signal.normalized)\n }\n if (signal.kind === SignalValueKind.Unknown) {\n return signal.source !== null\n }\n return false\n}\n\nfunction isBlockLevelDisplay(snapshot: SignalSnapshot): boolean {\n const signal = snapshot.signals.get(\"display\")\n if (!signal || signal.kind !== SignalValueKind.Known) return false\n return BLOCK_LEVEL_DISPLAY_VALUES.has(signal.normalized)\n}\n\nfunction hasUsableAspectRatio(snapshot: SignalSnapshot): boolean {\n const signal = snapshot.signals.get(\"aspect-ratio\")\n if (!signal) return false\n if (signal.guard.kind === 1 /* Conditional */) return false\n if (signal.kind === SignalValueKind.Unknown) return false\n if (signal.kind !== SignalValueKind.Known) return false\n if (signal.normalized.length === 0) return false\n return signal.normalized !== \"auto\"\n}\n\nfunction isNonReservingDimension(value: string): boolean {\n if (NON_RESERVING_DIMENSION_KEYWORDS.has(value)) return true\n if (value.startsWith(\"fit-content(\")) return true\n return false\n}\n\n\n// ── computeScrollContainerFact ───────────────────────────────────────────\n\nexport function computeScrollContainerFact(snapshot: SignalSnapshot): ScrollContainerFact {\n const overflowSignal = snapshot.signals.get(\"overflow\")\n const overflowYSignal = snapshot.signals.get(\"overflow-y\")\n\n const overflow = overflowSignal && overflowSignal.kind === SignalValueKind.Known\n ? overflowSignal.normalized\n : null\n const overflowY = overflowYSignal && overflowYSignal.kind === SignalValueKind.Known\n ? overflowYSignal.normalized\n : null\n\n const shorthandAxis = parseOverflowShorthandAxis(overflow)\n const yFromLonghand = parseSingleAxisScroll(overflowY)\n\n const xScroll = shorthandAxis.x\n const yScroll = yFromLonghand === null ? shorthandAxis.y : yFromLonghand\n\n const hasConditionalScroll = (overflowSignal?.guard.kind === 1 /* Conditional */ && (shorthandAxis.x || shorthandAxis.y))\n || (overflowYSignal?.guard.kind === 1 /* Conditional */ && yFromLonghand === true)\n const hasUnconditionalScroll = (overflowSignal?.guard.kind === 0 /* Unconditional */ && (shorthandAxis.x || shorthandAxis.y))\n || (overflowYSignal?.guard.kind === 0 /* Unconditional */ && yFromLonghand === true)\n\n return {\n isScrollContainer: xScroll || yScroll,\n axis: toScrollAxis(xScroll, yScroll),\n overflow,\n overflowY,\n hasConditionalScroll,\n hasUnconditionalScroll,\n }\n}\n\nconst NO_SCROLL = Object.freeze({ x: false, y: false })\nconst BOTH_SCROLL = Object.freeze({ x: true, y: true })\n\nfunction parseOverflowShorthandAxis(value: string | null): { x: boolean; y: boolean } {\n if (value === null) return NO_SCROLL\n const trimmed = value.trim()\n const spaceIdx = trimmed.indexOf(\" \")\n if (spaceIdx === -1) {\n const scroll = SCROLLABLE_VALUES.has(trimmed)\n return scroll ? BOTH_SCROLL : NO_SCROLL\n }\n const first = trimmed.slice(0, spaceIdx)\n const second = trimmed.slice(spaceIdx + 1).trimStart()\n return {\n x: SCROLLABLE_VALUES.has(first),\n y: SCROLLABLE_VALUES.has(second),\n }\n}\n\nfunction parseSingleAxisScroll(value: string | null): boolean | null {\n if (value === null) return null\n const trimmed = value.trim()\n const spaceIdx = trimmed.indexOf(\" \")\n const first = spaceIdx === -1 ? trimmed : trimmed.slice(0, spaceIdx)\n return SCROLLABLE_VALUES.has(first)\n}\n\nfunction toScrollAxis(x: boolean, y: boolean): number {\n if (x && y) return ScrollAxis.Both\n if (x) return ScrollAxis.X\n if (y) return ScrollAxis.Y\n return ScrollAxis.None\n}\n\n\n// ── computeFlowParticipationFact ─────────────────────────────────────────\n\nexport function computeFlowParticipationFact(snapshot: SignalSnapshot): FlowParticipationFact {\n const signal = snapshot.signals.get(\"position\")\n if (!signal || signal.kind !== SignalValueKind.Known) {\n return { inFlow: true, position: null, hasConditionalOutOfFlow: false, hasUnconditionalOutOfFlow: false }\n }\n\n const position = signal.normalized\n const outOfFlow = position === \"absolute\" || position === \"fixed\"\n\n return {\n inFlow: !outOfFlow,\n position,\n hasConditionalOutOfFlow: signal.guard.kind === 1 /* Conditional */ && outOfFlow,\n hasUnconditionalOutOfFlow: signal.guard.kind === 0 /* Unconditional */ && outOfFlow,\n }\n}\n\n\n// ── computeContainingBlockFact ───────────────────────────────────────────\n\nexport function computeContainingBlockFact(\n node: ElementNode,\n positionedAncestorByKey: ReadonlyMap<string, { readonly key: string; readonly hasReservedSpace: boolean }>,\n): ContainingBlockFact {\n let ancestor = node.parentElementNode\n while (ancestor !== null) {\n const positioned = positionedAncestorByKey.get(ancestor.key)\n if (positioned) {\n return {\n nearestPositionedAncestorKey: positioned.key,\n nearestPositionedAncestorHasReservedSpace: positioned.hasReservedSpace,\n }\n }\n ancestor = ancestor.parentElementNode\n }\n\n return { nearestPositionedAncestorKey: null, nearestPositionedAncestorHasReservedSpace: false }\n}\n","/**\n * Alignment model types + computation.\n *\n * Moved from cross-file/layout/context-classification.ts + cohort-index.ts +\n * measurement-node.ts + content-composition.ts + consistency-domain.ts +\n * offset.ts + signal-access helpers + util helpers.\n */\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { GuardConditionProvenance } from \"../binding/cascade-binder\"\nimport type { SignalSnapshot, SignalValue, KnownSignalValue, LayoutSignalName } from \"../binding/signal-builder\"\nimport { SignalValueKind, SignalQuality, parseSignedPxValue, extractTransformYPx, extractTranslatePropertyYPx } from \"../binding/signal-builder\"\nimport { TextualContentState } from \"../binding/signal-builder\"\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Types\n// ══════════════════════════════════════════════════════════════════════════\n\nexport type AlignmentContextKind = \"inline-formatting\" | \"table-cell\" | \"flex-cross-axis\" | \"grid-cross-axis\" | \"block-flow\" | \"positioned-offset\"\nexport type LayoutAxisModel = \"horizontal-tb\" | \"vertical-rl\" | \"vertical-lr\"\nexport type InlineDirectionModel = \"ltr\" | \"rtl\"\nexport type LayoutContextContainerKind = \"table\" | \"flex\" | \"grid\" | \"inline\" | \"block\"\nexport const enum ContextCertainty { Resolved = 0, Conditional = 1, Unknown = 2 }\nexport type BaselineRelevance = \"relevant\" | \"irrelevant\"\n\nexport interface LayoutContextEvidence {\n readonly containerKind: LayoutContextContainerKind\n readonly containerKindCertainty: ContextCertainty\n readonly hasTableSemantics: boolean\n readonly hasPositionedOffset: boolean\n readonly positionedOffsetCertainty: ContextCertainty\n}\n\nexport interface AlignmentContext {\n readonly kind: AlignmentContextKind\n readonly certainty: ContextCertainty\n readonly parentSolidFile: string\n readonly parentElementId: number\n readonly parentElementKey: string\n readonly parentTag: string | null\n readonly axis: LayoutAxisModel\n readonly axisCertainty: ContextCertainty\n readonly inlineDirection: InlineDirectionModel\n readonly inlineDirectionCertainty: ContextCertainty\n readonly parentDisplay: string | null\n readonly parentAlignItems: string | null\n readonly parentPlaceItems: string | null\n readonly hasPositionedOffset: boolean\n readonly crossAxisIsBlockAxis: boolean\n readonly crossAxisIsBlockAxisCertainty: ContextCertainty\n readonly baselineRelevance: BaselineRelevance\n readonly evidence: LayoutContextEvidence\n}\n\nexport const enum EvidenceValueKind { Exact = 0, Interval = 1, Conditional = 2, Unknown = 3 }\nexport interface EvidenceWitness<T> { readonly value: T | null; readonly kind: EvidenceValueKind }\nexport type NumericEvidenceValue = EvidenceWitness<number>\n\nexport const enum AlignmentTextContrast { Different = 0, Same = 1, Unknown = 2 }\nexport const enum SignalConflictValue { Conflict = 0, Aligned = 1, Unknown = 2 }\nexport interface SignalConflictEvidence { readonly value: SignalConflictValue; readonly kind: EvidenceValueKind }\n\nexport interface AlignmentCohortSignals {\n readonly verticalAlign: SignalConflictEvidence\n readonly alignSelf: SignalConflictEvidence\n readonly placeSelf: SignalConflictEvidence\n readonly hasControlOrReplacedPeer: boolean\n readonly textContrastWithPeers: AlignmentTextContrast\n}\n\nexport const enum CohortSubjectMembership { Dominant = 0, Nondominant = 1, Ambiguous = 2, Insufficient = 3 }\nexport interface CohortIdentifiability {\n readonly dominantShare: number\n readonly subjectExcludedDominantShare: number\n readonly subjectMembership: CohortSubjectMembership\n readonly ambiguous: boolean\n readonly kind: EvidenceValueKind\n}\n\nexport const enum ContentCompositionClassification {\n TextOnly = 0, ReplacedOnly = 1, MixedUnmitigated = 2,\n MixedMitigated = 3, BlockSegmented = 4, Unknown = 5,\n}\nexport type InlineReplacedKind = \"intrinsic\" | \"container\"\n\nexport interface ContentCompositionFingerprint {\n readonly hasTextContent: boolean\n readonly hasInlineReplaced: boolean\n readonly inlineReplacedKind: InlineReplacedKind | null\n readonly hasHeightContributingDescendant: boolean\n readonly wrappingContextMitigates: boolean\n readonly hasVerticalAlignMitigation: boolean\n readonly mixedContentDepth: number\n readonly classification: ContentCompositionClassification\n readonly analyzableChildCount: number\n readonly totalChildCount: number\n readonly hasOnlyBlockChildren: boolean\n}\n\nexport interface AlignmentElementEvidence {\n readonly solidFile: string\n readonly elementKey: string\n readonly elementId: number\n readonly tag: string | null\n readonly snapshot: SignalSnapshot\n}\n\nexport interface CohortFactSummary {\n readonly exact: number\n readonly interval: number\n readonly unknown: number\n readonly conditional: number\n readonly total: number\n readonly exactShare: number\n readonly intervalShare: number\n readonly unknownShare: number\n readonly conditionalShare: number\n}\n\nexport interface EvidenceProvenance {\n readonly reason: string\n readonly guardKey: string\n readonly guards: readonly GuardConditionProvenance[]\n}\n\nexport interface CohortProfile {\n readonly medianDeclaredOffsetPx: number | null\n readonly declaredOffsetDispersionPx: number | null\n readonly medianEffectiveOffsetPx: number | null\n readonly effectiveOffsetDispersionPx: number | null\n readonly medianLineHeightPx: number | null\n readonly lineHeightDispersionPx: number | null\n readonly dominantClusterSize: number\n readonly dominantClusterShare: number\n readonly unimodal: boolean\n}\n\nexport interface CohortSubjectStats {\n readonly element: AlignmentElementEvidence\n readonly declaredOffset: NumericEvidenceValue\n readonly effectiveOffset: NumericEvidenceValue\n readonly lineHeight: NumericEvidenceValue\n readonly baselineProfile: CohortProfile\n readonly signals: AlignmentCohortSignals\n readonly identifiability: CohortIdentifiability\n readonly contentComposition: ContentCompositionFingerprint\n}\n\nexport interface CohortStats {\n readonly profile: CohortProfile\n readonly snapshots: readonly SignalSnapshot[]\n readonly factSummary: CohortFactSummary\n readonly provenance: EvidenceProvenance\n readonly conditionalSignalCount: number\n readonly totalSignalCount: number\n readonly subjectsByElementKey: ReadonlyMap<string, CohortSubjectStats>\n readonly excludedElementKeys: ReadonlySet<string>\n}\n\nexport interface HotEvidenceWitness<T> extends EvidenceWitness<T> { readonly present: boolean }\nexport type HotNumericSignalEvidence = HotEvidenceWitness<number>\nexport type HotNormalizedSignalEvidence = HotEvidenceWitness<string>\n\nexport interface SnapshotHotSignals {\n readonly lineHeight: HotNumericSignalEvidence\n readonly verticalAlign: HotNormalizedSignalEvidence\n readonly alignSelf: HotNormalizedSignalEvidence\n readonly placeSelf: HotNormalizedSignalEvidence\n readonly flexDirection: HotNormalizedSignalEvidence\n readonly gridAutoFlow: HotNormalizedSignalEvidence\n readonly writingMode: HotNormalizedSignalEvidence\n readonly direction: HotNormalizedSignalEvidence\n readonly display: HotNormalizedSignalEvidence\n readonly alignItems: HotNormalizedSignalEvidence\n readonly placeItems: HotNormalizedSignalEvidence\n readonly position: HotNormalizedSignalEvidence\n readonly insetBlockStart: HotNumericSignalEvidence\n readonly insetBlockEnd: HotNumericSignalEvidence\n readonly transform: HotNumericSignalEvidence\n readonly translate: HotNumericSignalEvidence\n readonly top: HotNumericSignalEvidence\n readonly bottom: HotNumericSignalEvidence\n readonly marginTop: HotNumericSignalEvidence\n readonly marginBottom: HotNumericSignalEvidence\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Util helpers (from cross-file/layout/util.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nconst CONTROL_ELEMENT_TAGS: ReadonlySet<string> = new Set([\"input\", \"select\", \"textarea\", \"button\"])\nconst INTRINSIC_REPLACED_TAGS: ReadonlySet<string> = new Set([\"img\", \"svg\", \"video\", \"canvas\", \"iframe\", \"object\", \"embed\"])\nconst WHITESPACE_RE = /\\s+/\n\nfunction mergeEvidenceKind(left: EvidenceValueKind, right: EvidenceValueKind): EvidenceValueKind {\n return left > right ? left : right\n}\n\nfunction selectKth(values: number[], targetIndex: number): number {\n let left = 0\n let right = values.length - 1\n\n while (left <= right) {\n if (left === right) {\n const result = values[left]\n if (result === undefined) return 0\n return result\n }\n\n const pivotIndex = choosePivotIndex(values, left, right)\n const partitionIndex = partitionAroundPivot(values, left, right, pivotIndex)\n\n if (partitionIndex === targetIndex) {\n const result = values[partitionIndex]\n if (result === undefined) return 0\n return result\n }\n if (partitionIndex < targetIndex) {\n left = partitionIndex + 1\n continue\n }\n right = partitionIndex - 1\n }\n\n const fallback = values[targetIndex]\n if (fallback === undefined) return 0\n return fallback\n}\n\nfunction choosePivotIndex(values: number[], left: number, right: number): number {\n const middle = Math.floor((left + right) / 2)\n const leftValue = values[left] ?? 0\n const middleValue = values[middle] ?? 0\n const rightValue = values[right] ?? 0\n\n if (leftValue < middleValue) {\n if (middleValue < rightValue) return middle\n if (leftValue < rightValue) return right\n return left\n }\n\n if (leftValue < rightValue) return left\n if (middleValue < rightValue) return right\n return middle\n}\n\nfunction partitionAroundPivot(values: number[], left: number, right: number, pivotIndex: number): number {\n const pivotValue = values[pivotIndex] ?? 0\n swap(values, pivotIndex, right)\n\n let storeIndex = left\n for (let i = left; i < right; i++) {\n const current = values[i]\n if (current === undefined || current > pivotValue) continue\n swap(values, storeIndex, i)\n storeIndex++\n }\n\n swap(values, storeIndex, right)\n return storeIndex\n}\n\nfunction swap(values: number[], left: number, right: number): void {\n if (left === right) return\n const leftValue = values[left] ?? 0\n const rightValue = values[right] ?? 0\n values[left] = rightValue\n values[right] = leftValue\n}\n\n// ── Offset baseline (from cross-file/layout/offset-baseline.ts) ──────────\n\nexport const layoutOffsetSignals = [\n \"top\", \"bottom\", \"margin-top\", \"margin-bottom\",\n \"inset-block-start\", \"inset-block-end\", \"transform\", \"translate\",\n] as const satisfies readonly LayoutSignalName[]\n\nexport type LayoutOffsetSignal = (typeof layoutOffsetSignals)[number]\n\nexport function parseOffsetPx(property: LayoutOffsetSignal, raw: string): number | null {\n if (property === \"transform\") return extractTransformYPx(raw)\n if (property === \"translate\") return extractTranslatePropertyYPx(raw)\n return parseSignedPxValue(raw)\n}\n\nfunction toComparableExactValue(value: NumericEvidenceValue): number | null {\n if (value.value !== null) {\n if (value.kind !== EvidenceValueKind.Exact) return null\n return value.value\n }\n if (value.kind === EvidenceValueKind.Exact) return 0\n return null\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Signal access helpers (from cross-file/layout/signal-access.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nfunction readKnownSignalWithGuard(snapshot: SignalSnapshot, name: LayoutSignalName): KnownSignalValue | null {\n const value = snapshot.signals.get(name)\n if (!value) return null\n if (value.kind !== SignalValueKind.Known) return null\n return value\n}\n\nfunction readKnownSignal(snapshot: SignalSnapshot, name: LayoutSignalName): KnownSignalValue | null {\n const value = readKnownSignalWithGuard(snapshot, name)\n if (!value) return null\n if (value.guard.kind === 1 /* Conditional */) return null\n return value\n}\n\nfunction readKnownNormalized(snapshot: SignalSnapshot, name: LayoutSignalName): string | null {\n const value = readKnownSignal(snapshot, name)\n if (!value) return null\n return value.normalized\n}\n\nfunction toSignalEvidenceKind(value: KnownSignalValue): EvidenceValueKind {\n if (value.guard.kind === 1 /* Conditional */) return EvidenceValueKind.Conditional\n if (value.quality === SignalQuality.Estimated) return EvidenceValueKind.Interval\n return EvidenceValueKind.Exact\n}\n\nexport function readNumericSignalEvidence(snapshot: SignalSnapshot, name: LayoutSignalName): NumericEvidenceValue {\n const value = snapshot.signals.get(name)\n if (!value) return { value: null, kind: EvidenceValueKind.Unknown }\n if (value.kind !== SignalValueKind.Known) {\n if (value.guard.kind === 1 /* Conditional */) return { value: null, kind: EvidenceValueKind.Conditional }\n return { value: null, kind: EvidenceValueKind.Unknown }\n }\n return { value: value.px, kind: toSignalEvidenceKind(value) }\n}\n\ntype NormalizedSignalEvidence = EvidenceWitness<string>\n\nfunction readNormalizedSignalEvidence(snapshot: SignalSnapshot, name: LayoutSignalName): NormalizedSignalEvidence {\n const value = snapshot.signals.get(name)\n if (!value) return { value: null, kind: EvidenceValueKind.Unknown }\n if (value.kind !== SignalValueKind.Known) {\n if (value.guard.kind === 1 /* Conditional */) return { value: null, kind: EvidenceValueKind.Conditional }\n return { value: null, kind: EvidenceValueKind.Unknown }\n }\n return { value: value.normalized, kind: toSignalEvidenceKind(value) }\n}\n\nfunction isLayoutHidden(node: ElementNode, snapshotByElementId: ReadonlyMap<number, SignalSnapshot>): boolean {\n if (node.attributes.has(\"hidden\")) return true\n if (node.classTokenSet.has(\"hidden\")) return true\n const snapshot = snapshotByElementId.get(node.elementId)\n if (snapshot) {\n const display = readKnownNormalized(snapshot, \"display\")\n if (display === \"none\") return true\n }\n return false\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Hot signals (from cross-file/layout/build.ts computeHotSignals)\n// ══════════════════════════════════════════════════════════════════════════\n\nconst ABSENT_NUMERIC: HotNumericSignalEvidence = { present: false, value: null, kind: EvidenceValueKind.Unknown }\nconst ABSENT_NORMALIZED: HotNormalizedSignalEvidence = { present: false, value: null, kind: EvidenceValueKind.Unknown }\n\nfunction toHotNumeric(signal: SignalValue): HotNumericSignalEvidence {\n if (signal.kind !== SignalValueKind.Known) {\n return {\n present: true,\n value: null,\n kind: signal.guard.kind === 1 /* Conditional */ ? EvidenceValueKind.Conditional : EvidenceValueKind.Unknown,\n }\n }\n return {\n present: true,\n value: signal.px,\n kind: signal.guard.kind === 1 /* Conditional */\n ? EvidenceValueKind.Conditional\n : signal.quality === SignalQuality.Estimated ? EvidenceValueKind.Interval : EvidenceValueKind.Exact,\n }\n}\n\nfunction toHotNormalized(signal: SignalValue): HotNormalizedSignalEvidence {\n if (signal.kind !== SignalValueKind.Known) {\n return {\n present: true,\n value: null,\n kind: signal.guard.kind === 1 /* Conditional */ ? EvidenceValueKind.Conditional : EvidenceValueKind.Unknown,\n }\n }\n return {\n present: true,\n value: signal.normalized,\n kind: signal.guard.kind === 1 /* Conditional */\n ? EvidenceValueKind.Conditional\n : signal.quality === SignalQuality.Estimated ? EvidenceValueKind.Interval : EvidenceValueKind.Exact,\n }\n}\n\nexport function computeHotSignals(snapshot: SignalSnapshot): SnapshotHotSignals {\n let lineHeight: HotNumericSignalEvidence = ABSENT_NUMERIC\n let verticalAlign: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let alignSelf: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let placeSelf: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let flexDirection: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let gridAutoFlow: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let writingMode: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let direction: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let display: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let alignItems: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let placeItems: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let position: HotNormalizedSignalEvidence = ABSENT_NORMALIZED\n let insetBlockStart: HotNumericSignalEvidence = ABSENT_NUMERIC\n let insetBlockEnd: HotNumericSignalEvidence = ABSENT_NUMERIC\n let transform: HotNumericSignalEvidence = ABSENT_NUMERIC\n let translate: HotNumericSignalEvidence = ABSENT_NUMERIC\n let top: HotNumericSignalEvidence = ABSENT_NUMERIC\n let bottom: HotNumericSignalEvidence = ABSENT_NUMERIC\n let marginTop: HotNumericSignalEvidence = ABSENT_NUMERIC\n let marginBottom: HotNumericSignalEvidence = ABSENT_NUMERIC\n\n for (const [name, value] of snapshot.signals) {\n switch (name) {\n case \"line-height\": lineHeight = toHotNumeric(value); break\n case \"vertical-align\": verticalAlign = toHotNormalized(value); break\n case \"align-self\": alignSelf = toHotNormalized(value); break\n case \"place-self\": placeSelf = toHotNormalized(value); break\n case \"flex-direction\": flexDirection = toHotNormalized(value); break\n case \"grid-auto-flow\": gridAutoFlow = toHotNormalized(value); break\n case \"writing-mode\": writingMode = toHotNormalized(value); break\n case \"direction\": direction = toHotNormalized(value); break\n case \"display\": display = toHotNormalized(value); break\n case \"align-items\": alignItems = toHotNormalized(value); break\n case \"place-items\": placeItems = toHotNormalized(value); break\n case \"position\": position = toHotNormalized(value); break\n case \"inset-block-start\": insetBlockStart = toHotNumeric(value); break\n case \"inset-block-end\": insetBlockEnd = toHotNumeric(value); break\n case \"transform\": transform = toHotNumeric(value); break\n case \"translate\": translate = toHotNumeric(value); break\n case \"top\": top = toHotNumeric(value); break\n case \"bottom\": bottom = toHotNumeric(value); break\n case \"margin-top\": marginTop = toHotNumeric(value); break\n case \"margin-bottom\": marginBottom = toHotNumeric(value); break\n default: break\n }\n }\n\n return {\n lineHeight, verticalAlign, alignSelf, placeSelf,\n flexDirection, gridAutoFlow, writingMode, direction,\n display, alignItems, placeItems, position,\n insetBlockStart, insetBlockEnd, transform, translate,\n top, bottom, marginTop, marginBottom,\n }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Context classification (from cross-file/layout/context-classification.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nconst TABLE_SEMANTIC_TAGS = new Set([\"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", \"td\", \"th\"])\nconst TABLE_DISPLAY_VALUES = new Set([\"table\", \"inline-table\", \"table-row\", \"table-cell\", \"table-row-group\", \"table-header-group\", \"table-footer-group\", \"table-column\", \"table-column-group\", \"table-caption\"])\nconst FLEX_DISPLAY_VALUES = new Set([\"flex\", \"inline-flex\"])\nconst GRID_DISPLAY_VALUES = new Set([\"grid\", \"inline-grid\"])\nconst INLINE_DISPLAY_VALUES = new Set([\"inline\", \"inline-block\", \"inline-list-item\"])\nconst FLEX_ROW_VALUES = new Set([\"row\", \"row-reverse\"])\nconst FLEX_GRID_GEOMETRIC_ALIGN_ITEMS: ReadonlySet<string> = new Set([\"center\", \"flex-start\", \"flex-end\", \"start\", \"end\", \"stretch\", \"self-start\", \"self-end\", \"normal\"])\nconst TABLE_CELL_GEOMETRIC_VERTICAL_ALIGN: ReadonlySet<string> = new Set([\"middle\", \"top\", \"bottom\"])\n\nexport function createAlignmentContextForParent(parent: ElementNode, snapshot: SignalSnapshot): AlignmentContext {\n const axis = resolveAxis(snapshot)\n const inlineDirection = resolveInlineDirection(snapshot)\n const parentDisplaySignal = readKnownSignalWithGuard(snapshot, \"display\")\n const parentAlignItemsSignal = readKnownSignalWithGuard(snapshot, \"align-items\")\n const parentPlaceItemsSignal = readKnownSignalWithGuard(snapshot, \"place-items\")\n\n const parentDisplay = parentDisplaySignal ? parentDisplaySignal.normalized : null\n const parentAlignItems = parentAlignItemsSignal ? parentAlignItemsSignal.normalized : null\n const parentPlaceItems = parentPlaceItemsSignal ? parentPlaceItemsSignal.normalized : null\n const parentDisplayCertainty = resolveSignalCertainty(parentDisplaySignal)\n\n const positionedOffset = resolvePositionedOffset(snapshot)\n const evidence = resolveContextEvidence(parent, parentDisplay, parentDisplayCertainty, positionedOffset.hasPositionedOffset, positionedOffset.certainty)\n const classified = classifyKind(evidence)\n const contextCertainty = combineCertainty(classified.certainty, axis.certainty)\n const certainty = combineCertainty(contextCertainty, inlineDirection.certainty)\n\n const baselineRelevance = computeBaselineRelevance(classified.kind, parentAlignItems, parentPlaceItems)\n const crossAxisInfo = resolveCrossAxisIsBlockAxis(classified.kind, snapshot, axis.value)\n\n return {\n kind: classified.kind,\n certainty,\n parentSolidFile: parent.solidFile,\n parentElementId: parent.elementId,\n parentElementKey: parent.key,\n parentTag: parent.tag,\n axis: axis.value,\n axisCertainty: axis.certainty,\n inlineDirection: inlineDirection.value,\n inlineDirectionCertainty: inlineDirection.certainty,\n parentDisplay,\n parentAlignItems,\n parentPlaceItems,\n hasPositionedOffset: positionedOffset.hasPositionedOffset,\n crossAxisIsBlockAxis: crossAxisInfo.value,\n crossAxisIsBlockAxisCertainty: crossAxisInfo.certainty,\n baselineRelevance,\n evidence,\n }\n}\n\nfunction classifyKind(evidence: LayoutContextEvidence): { readonly kind: AlignmentContextKind; readonly certainty: ContextCertainty } {\n if (evidence.hasTableSemantics) return { kind: \"table-cell\", certainty: ContextCertainty.Resolved }\n if (evidence.containerKind === \"table\") return { kind: \"table-cell\", certainty: evidence.containerKindCertainty }\n if (evidence.containerKind === \"flex\") return { kind: \"flex-cross-axis\", certainty: evidence.containerKindCertainty }\n if (evidence.containerKind === \"grid\") return { kind: \"grid-cross-axis\", certainty: evidence.containerKindCertainty }\n if (evidence.containerKind === \"inline\") return { kind: \"inline-formatting\", certainty: evidence.containerKindCertainty }\n if (evidence.hasPositionedOffset) return { kind: \"positioned-offset\", certainty: evidence.positionedOffsetCertainty }\n return { kind: \"block-flow\", certainty: combineCertainty(evidence.containerKindCertainty, evidence.positionedOffsetCertainty) }\n}\n\nfunction resolveContextEvidence(parent: ElementNode, parentDisplay: string | null, parentDisplayCertainty: ContextCertainty, hasPositionedOffset: boolean, positionedOffsetCertainty: ContextCertainty): LayoutContextEvidence {\n const hasTableSemantics = parent.tagName !== null && TABLE_SEMANTIC_TAGS.has(parent.tagName)\n const container = resolveContainerKind(parentDisplay, parentDisplayCertainty)\n return { containerKind: container.kind, containerKindCertainty: container.certainty, hasTableSemantics, hasPositionedOffset, positionedOffsetCertainty }\n}\n\nfunction resolveContainerKind(parentDisplay: string | null, certainty: ContextCertainty): { readonly kind: LayoutContextContainerKind; readonly certainty: ContextCertainty } {\n if (parentDisplay === null) return { kind: \"block\", certainty }\n const display = parentDisplay.trim().toLowerCase()\n if (display.length === 0) return { kind: \"block\", certainty }\n if (TABLE_DISPLAY_VALUES.has(display)) return { kind: \"table\", certainty }\n if (FLEX_DISPLAY_VALUES.has(display)) return { kind: \"flex\", certainty }\n if (GRID_DISPLAY_VALUES.has(display)) return { kind: \"grid\", certainty }\n if (INLINE_DISPLAY_VALUES.has(display)) return { kind: \"inline\", certainty }\n\n const tokens = display.split(WHITESPACE_RE)\n if (tokens.length === 2) {\n const inside = tokens[1]\n if (inside === \"table\") return { kind: \"table\", certainty }\n if (inside === \"flex\") return { kind: \"flex\", certainty }\n if (inside === \"grid\") return { kind: \"grid\", certainty }\n if (tokens[0] === \"inline\") return { kind: \"inline\", certainty }\n }\n\n if (tokens.length > 0 && tokens[0] === \"inline\") return { kind: \"inline\", certainty }\n return { kind: \"block\", certainty }\n}\n\nfunction resolveAxis(snapshot: SignalSnapshot): { readonly value: LayoutAxisModel; readonly certainty: ContextCertainty } {\n if (!snapshot.signals.has(\"writing-mode\")) return { value: \"horizontal-tb\", certainty: ContextCertainty.Resolved }\n const writingMode = readNormalizedSignalEvidence(snapshot, \"writing-mode\")\n if (writingMode.value === \"vertical-rl\") return { value: \"vertical-rl\", certainty: toContextCertainty(writingMode.kind) }\n if (writingMode.value === \"vertical-lr\") return { value: \"vertical-lr\", certainty: toContextCertainty(writingMode.kind) }\n return { value: \"horizontal-tb\", certainty: toContextCertainty(writingMode.kind) }\n}\n\nfunction resolveInlineDirection(snapshot: SignalSnapshot): { readonly value: InlineDirectionModel; readonly certainty: ContextCertainty } {\n if (!snapshot.signals.has(\"direction\")) return { value: \"ltr\", certainty: ContextCertainty.Resolved }\n const direction = readNormalizedSignalEvidence(snapshot, \"direction\")\n if (direction.value === \"rtl\") return { value: \"rtl\", certainty: toContextCertainty(direction.kind) }\n return { value: \"ltr\", certainty: toContextCertainty(direction.kind) }\n}\n\nfunction toContextCertainty(kind: EvidenceValueKind): ContextCertainty {\n if (kind === EvidenceValueKind.Exact) return ContextCertainty.Resolved\n if (kind === EvidenceValueKind.Interval || kind === EvidenceValueKind.Conditional) return ContextCertainty.Conditional\n return ContextCertainty.Unknown\n}\n\nfunction resolvePositionedOffset(snapshot: SignalSnapshot): { readonly hasPositionedOffset: boolean; readonly certainty: ContextCertainty } {\n const position = readKnownSignalWithGuard(snapshot, \"position\")\n if (!position) return { hasPositionedOffset: false, certainty: ContextCertainty.Unknown }\n const certainty = resolveSignalCertainty(position)\n if (position.normalized === \"static\") return { hasPositionedOffset: false, certainty }\n return { hasPositionedOffset: true, certainty }\n}\n\nfunction resolveCrossAxisIsBlockAxis(kind: AlignmentContextKind, snapshot: SignalSnapshot, _axis: LayoutAxisModel): { readonly value: boolean; readonly certainty: ContextCertainty } {\n if (kind !== \"flex-cross-axis\" && kind !== \"grid-cross-axis\") return { value: true, certainty: ContextCertainty.Resolved }\n if (kind === \"flex-cross-axis\") {\n const signal = readKnownSignalWithGuard(snapshot, \"flex-direction\")\n if (!signal) return { value: true, certainty: ContextCertainty.Resolved }\n return { value: FLEX_ROW_VALUES.has(signal.normalized), certainty: resolveSignalCertainty(signal) }\n }\n const signal = readKnownSignalWithGuard(snapshot, \"grid-auto-flow\")\n if (!signal) return { value: true, certainty: ContextCertainty.Resolved }\n return { value: !signal.normalized.startsWith(\"column\"), certainty: resolveSignalCertainty(signal) }\n}\n\nfunction resolveSignalCertainty(value: KnownSignalValue | null): ContextCertainty {\n if (!value) return ContextCertainty.Unknown\n if (value.guard.kind === 1 /* Conditional */) return ContextCertainty.Conditional\n return ContextCertainty.Resolved\n}\n\nfunction combineCertainty(left: ContextCertainty, right: ContextCertainty): ContextCertainty {\n return left > right ? left : right\n}\n\nfunction computeBaselineRelevance(kind: AlignmentContextKind, parentAlignItems: string | null, parentPlaceItems: string | null): BaselineRelevance {\n if (kind === \"flex-cross-axis\" || kind === \"grid-cross-axis\") {\n const effective = resolveEffectiveAlignItems(parentAlignItems, parentPlaceItems)\n if (effective === null) return \"relevant\"\n return FLEX_GRID_GEOMETRIC_ALIGN_ITEMS.has(effective) ? \"irrelevant\" : \"relevant\"\n }\n return \"relevant\"\n}\n\nfunction resolveEffectiveAlignItems(alignItems: string | null, placeItems: string | null): string | null {\n if (alignItems !== null) return alignItems\n if (placeItems === null) return null\n const firstToken = placeItems.split(WHITESPACE_RE)[0]\n return firstToken ?? null\n}\n\nexport function finalizeTableCellBaselineRelevance(\n contextByParentId: Map<number, AlignmentContext>,\n cohortVerticalAlignConsensus: ReadonlyMap<number, string | null>,\n): void {\n for (const [parentId, consensusValue] of cohortVerticalAlignConsensus) {\n const context = contextByParentId.get(parentId)\n if (!context) continue\n if (context.kind !== \"table-cell\") continue\n if (consensusValue === null) continue\n if (!TABLE_CELL_GEOMETRIC_VERTICAL_ALIGN.has(consensusValue)) continue\n contextByParentId.set(parentId, { ...context, baselineRelevance: \"irrelevant\" })\n }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Consistency domain (from cross-file/layout/consistency-domain.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nexport function summarizeSignalFacts(snapshots: readonly SignalSnapshot[]): CohortFactSummary {\n let exact = 0\n let interval = 0\n let unknown = 0\n let conditional = 0\n let total = 0\n\n for (let i = 0; i < snapshots.length; i++) {\n const snap = snapshots[i]\n if (!snap) continue\n for (const value of snap.signals.values()) {\n if (value.guard.kind === 1 /* Conditional */) { conditional++; total++; continue }\n if (value.kind === SignalValueKind.Unknown) { unknown++; total++; continue }\n if (value.quality === SignalQuality.Estimated && value.px !== null) { interval++; total++; continue }\n exact++; total++\n }\n }\n\n if (total === 0) return { exact, interval, unknown, conditional, total, exactShare: 0, intervalShare: 0, unknownShare: 0, conditionalShare: 0 }\n return { exact, interval, unknown, conditional, total, exactShare: exact / total, intervalShare: interval / total, unknownShare: unknown / total, conditionalShare: conditional / total }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Offset estimation (from cross-file/layout/offset.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\ninterface BlockOffsetEstimate {\n readonly declared: NumericEvidenceValue\n readonly effective: NumericEvidenceValue\n}\n\nexport function estimateBlockOffsetWithDeclaredFromHotSignals(hot: SnapshotHotSignals, axis: LayoutAxisModel): BlockOffsetEstimate {\n return estimateBlockOffsetWithDeclaredFromSources(axis, hot.position, (name) => {\n switch (name) {\n case \"inset-block-start\": return hot.insetBlockStart\n case \"inset-block-end\": return hot.insetBlockEnd\n case \"transform\": return hot.transform\n case \"translate\": return hot.translate\n case \"top\": return hot.top\n case \"bottom\": return hot.bottom\n case \"margin-top\": return hot.marginTop\n default: return hot.marginBottom\n }\n })\n}\n\nfunction estimateBlockOffsetWithDeclaredFromSources(\n axis: LayoutAxisModel,\n position: { readonly value: string | null; readonly kind: EvidenceValueKind },\n readNumeric: (name: \"inset-block-start\" | \"inset-block-end\" | \"transform\" | \"translate\" | \"top\" | \"bottom\" | \"margin-top\" | \"margin-bottom\") => HotNumericSignalEvidence,\n): BlockOffsetEstimate {\n let declaredTotal = 0\n let declaredCount = 0\n let declaredKind: EvidenceValueKind = EvidenceValueKind.Exact\n let declaredMissingKind: EvidenceValueKind = EvidenceValueKind.Exact\n let effectiveTotal = 0\n let effectiveCount = 0\n let effectiveKind: EvidenceValueKind = EvidenceValueKind.Exact\n let effectiveMissingKind: EvidenceValueKind = EvidenceValueKind.Exact\n const positioned = position.value !== null && position.value !== \"static\"\n\n const add = (name: \"inset-block-start\" | \"inset-block-end\" | \"transform\" | \"translate\" | \"top\" | \"bottom\" | \"margin-top\" | \"margin-bottom\", sign: number, requiresPositioning: boolean): void => {\n const v = readNumeric(name)\n if (!v.present) return\n if (v.value === null) {\n declaredMissingKind = mergeEvidenceKind(declaredMissingKind, v.kind)\n if (requiresPositioning) effectiveMissingKind = mergeEvidenceKind(effectiveMissingKind, mergeEvidenceKind(v.kind, position.kind))\n if (!requiresPositioning) effectiveMissingKind = mergeEvidenceKind(effectiveMissingKind, v.kind)\n return\n }\n const signed = v.value * sign\n declaredTotal += signed\n declaredCount++\n declaredKind = mergeEvidenceKind(declaredKind, v.kind)\n const effectiveContributionKind = requiresPositioning ? mergeEvidenceKind(v.kind, position.kind) : v.kind\n if (requiresPositioning && !positioned) {\n effectiveMissingKind = mergeEvidenceKind(effectiveMissingKind, effectiveContributionKind)\n return\n }\n effectiveTotal += signed\n effectiveCount++\n effectiveKind = mergeEvidenceKind(effectiveKind, effectiveContributionKind)\n }\n\n add(\"inset-block-start\", 1, true)\n add(\"inset-block-end\", -1, true)\n if (axis === \"horizontal-tb\") {\n add(\"transform\", 1, false)\n add(\"translate\", 1, false)\n add(\"top\", 1, true)\n add(\"bottom\", -1, true)\n add(\"margin-top\", 1, false)\n add(\"margin-bottom\", -1, false)\n }\n\n return {\n declared: { value: declaredCount === 0 ? null : declaredTotal, kind: declaredCount === 0 ? declaredMissingKind : declaredKind },\n effective: { value: effectiveCount === 0 ? null : effectiveTotal, kind: effectiveCount === 0 ? effectiveMissingKind : effectiveKind },\n }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Measurement node (from cross-file/layout/measurement-node.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\ninterface MeasurementCandidateSet {\n readonly firstControlOrReplacedDescendant: ElementNode | null\n readonly firstTextualDescendant: ElementNode | null\n}\n\nconst INHERENTLY_INLINE_TAGS = new Set([\"a\", \"abbr\", \"acronym\", \"b\", \"bdo\", \"big\", \"br\", \"cite\", \"code\", \"dfn\", \"em\", \"i\", \"kbd\", \"label\", \"mark\", \"output\", \"q\", \"ruby\", \"s\", \"samp\", \"small\", \"span\", \"strong\", \"sub\", \"sup\", \"time\", \"tt\", \"u\", \"var\", \"wbr\", \"data\", \"slot\"])\n\nexport function buildMeasurementNodeIndex(\n elements: readonly ElementNode[],\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n): ReadonlyMap<string, ElementNode> {\n const candidateCache = new Map<number, MeasurementCandidateSet>()\n const measurementByRootKey = new Map<string, ElementNode>()\n\n for (let i = 0; i < elements.length; i++) {\n const root = elements[i]\n if (!root) continue\n const candidates = resolveMeasurementCandidates(root, childrenByParentId, snapshotByElementId, candidateCache)\n const measurement = resolveMeasurementNode(root, candidates)\n measurementByRootKey.set(root.key, measurement)\n }\n\n return measurementByRootKey\n}\n\nfunction measurementEstablishesFormattingContext(node: ElementNode, snapshotByElementId: ReadonlyMap<number, SignalSnapshot>): boolean {\n if (node.isReplaced) return true\n const snapshot = snapshotByElementId.get(node.elementId)\n if (snapshot) {\n const displaySignal = snapshot.signals.get(\"display\")\n if (displaySignal && displaySignal.kind === SignalValueKind.Known) {\n const v = displaySignal.normalized.trim().toLowerCase()\n return v !== \"inline\" && v !== \"contents\"\n }\n const overflowSignal = snapshot.signals.get(\"overflow\")\n if (overflowSignal && overflowSignal.kind === SignalValueKind.Known) {\n const ov = overflowSignal.normalized\n if (ov !== \"visible\" && ov !== \"clip\") return true\n }\n const overflowYSignal = snapshot.signals.get(\"overflow-y\")\n if (overflowYSignal && overflowYSignal.kind === SignalValueKind.Known) {\n const ov = overflowYSignal.normalized\n if (ov !== \"visible\" && ov !== \"clip\") return true\n }\n }\n if (node.tagName === null) return true\n return !INHERENTLY_INLINE_TAGS.has(node.tagName)\n}\n\nfunction resolveMeasurementCandidates(\n root: ElementNode,\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n cache: Map<number, MeasurementCandidateSet>,\n): MeasurementCandidateSet {\n const existing = cache.get(root.elementId)\n if (existing) return existing\n const children = childrenByParentId.get(root.elementId) ?? []\n let firstControlOrReplacedDescendant: ElementNode | null = null\n let firstTextualDescendant: ElementNode | null = null\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (!child) continue\n if (isLayoutHidden(child, snapshotByElementId)) continue\n if (firstControlOrReplacedDescendant === null && (child.isControl || child.isReplaced)) firstControlOrReplacedDescendant = child\n if (firstTextualDescendant === null && child.textualContent === TextualContentState.Yes) firstTextualDescendant = child\n if (firstControlOrReplacedDescendant !== null && firstTextualDescendant !== null) break\n }\n\n const firstChild = children.length === 1 ? children[0] : undefined\n if (firstChild && !measurementEstablishesFormattingContext(firstChild, snapshotByElementId)) {\n const childCandidates = resolveMeasurementCandidates(firstChild, childrenByParentId, snapshotByElementId, cache)\n if (firstControlOrReplacedDescendant === null) firstControlOrReplacedDescendant = childCandidates.firstControlOrReplacedDescendant\n if (firstTextualDescendant === null) firstTextualDescendant = childCandidates.firstTextualDescendant\n }\n\n const out: MeasurementCandidateSet = { firstControlOrReplacedDescendant, firstTextualDescendant }\n cache.set(root.elementId, out)\n return out\n}\n\nfunction resolveMeasurementNode(root: ElementNode, candidates: MeasurementCandidateSet): ElementNode {\n if (candidates.firstControlOrReplacedDescendant !== null) return candidates.firstControlOrReplacedDescendant\n if (root.isControl || root.isReplaced) return root\n if (candidates.firstTextualDescendant !== null) return candidates.firstTextualDescendant\n if (root.textualContent === TextualContentState.Yes) return root\n return root\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Content composition (from cross-file/layout/content-composition.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nconst BLOCK_FORMATTING_CONTEXT_DISPLAYS: ReadonlySet<string> = new Set([\"block\", \"flex\", \"grid\", \"table\", \"flow-root\", \"list-item\"])\nconst INLINE_REPLACED_DISPLAYS: ReadonlySet<string> = new Set([\"inline-flex\", \"inline-block\", \"inline-table\", \"inline-grid\"])\nconst INLINE_CONTINUATION_DISPLAYS: ReadonlySet<string> = new Set([\"inline\", \"contents\"])\nconst HEIGHT_CONTRIBUTING_SIGNALS: readonly LayoutSignalName[] = [\"height\", \"min-height\", \"padding-top\", \"padding-bottom\", \"border-top-width\", \"border-bottom-width\"]\nconst VERTICAL_ALIGN_MITIGATIONS: ReadonlySet<string> = new Set([\"middle\", \"top\", \"bottom\", \"text-top\", \"text-bottom\"])\n\nexport const alignmentStrengthCalibration = {\n baselineConflictBoost: 0.66,\n lineHeightWeight: 0.7,\n contextConflictBoost: 0.7,\n contextLineHeightWeight: 0.35,\n contextCenterPenalty: 0.6,\n replacedDifferentTextBoost: 0.85,\n replacedUnknownTextBoost: 0.25,\n replacedLineHeightWeight: 0.4,\n compositionMixedUnmitigatedOutlierStrength: 0.85,\n compositionMixedOutlierAmongReplacedStrength: 0.6,\n compositionTextOutlierAmongMixedStrength: 0.55,\n compositionUnknownPenalty: 0.4,\n}\n\ninterface FingerprintWalkState {\n hasTextContent: boolean\n hasInlineReplaced: boolean\n inlineReplacedKind: InlineReplacedKind | null\n hasHeightContributingDescendant: boolean\n wrappingContextMitigates: boolean\n hasVerticalAlignMitigation: boolean\n mixedContentDepth: number\n analyzableChildCount: number\n totalChildCount: number\n blockChildCount: number\n inlineChildCount: number\n}\n\nexport function computeContentCompositionFingerprint(\n elementNode: ElementNode,\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>,\n): ContentCompositionFingerprint {\n const state: FingerprintWalkState = {\n hasTextContent: false, hasInlineReplaced: false, inlineReplacedKind: null,\n hasHeightContributingDescendant: false, wrappingContextMitigates: false,\n hasVerticalAlignMitigation: false, mixedContentDepth: 0,\n analyzableChildCount: 0, totalChildCount: 0, blockChildCount: 0, inlineChildCount: 0,\n }\n\n if (elementNode.textualContent === TextualContentState.Yes || elementNode.textualContent === TextualContentState.DynamicText) {\n state.hasTextContent = true\n }\n\n const elementHotSignals = hotSignalsByElementId.get(elementNode.elementId)\n const elementDisplay = elementHotSignals?.display.value ?? null\n\n if (elementDisplay !== null && !INLINE_CONTINUATION_DISPLAYS.has(elementDisplay)) {\n return {\n hasTextContent: state.hasTextContent, hasInlineReplaced: false, inlineReplacedKind: null,\n hasHeightContributingDescendant: false, wrappingContextMitigates: false, hasVerticalAlignMitigation: false,\n mixedContentDepth: 0, classification: ContentCompositionClassification.BlockSegmented,\n analyzableChildCount: 0, totalChildCount: 0, hasOnlyBlockChildren: false,\n }\n }\n\n walkInlineDescendants(elementNode, childrenByParentId, snapshotByElementId, hotSignalsByElementId, state, 0)\n\n const hasOnlyBlockChildren = state.analyzableChildCount > 0 && state.blockChildCount > 0 && state.inlineChildCount === 0\n const classification = classifyContentCompositionFromState(state, elementNode, hasOnlyBlockChildren)\n\n return {\n hasTextContent: state.hasTextContent, hasInlineReplaced: state.hasInlineReplaced,\n inlineReplacedKind: state.inlineReplacedKind, hasHeightContributingDescendant: state.hasHeightContributingDescendant,\n wrappingContextMitigates: state.wrappingContextMitigates, hasVerticalAlignMitigation: state.hasVerticalAlignMitigation,\n mixedContentDepth: state.mixedContentDepth, classification,\n analyzableChildCount: state.analyzableChildCount, totalChildCount: state.totalChildCount, hasOnlyBlockChildren,\n }\n}\n\nfunction walkInlineDescendants(\n node: ElementNode,\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>,\n state: FingerprintWalkState,\n depth: number,\n): void {\n const children = childrenByParentId.get(node.elementId)\n if (!children) return\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (!child) continue\n if (depth === 0) state.totalChildCount++\n const snapshot = snapshotByElementId.get(child.elementId)\n if (!snapshot) continue\n if (depth === 0) state.analyzableChildCount++\n\n const childTag = child.tagName?.toLowerCase() ?? null\n const hotSignals = hotSignalsByElementId.get(child.elementId)\n const childDisplay = hotSignals?.display.value ?? null\n\n if (childTag !== null && (INTRINSIC_REPLACED_TAGS.has(childTag) || CONTROL_ELEMENT_TAGS.has(childTag))) {\n state.hasInlineReplaced = true\n if (state.inlineReplacedKind === null) state.inlineReplacedKind = \"intrinsic\"\n else if (state.inlineReplacedKind !== \"intrinsic\") state.inlineReplacedKind = \"intrinsic\"\n checkHeightContributions(snapshot, state)\n checkVerticalAlignMitigation(snapshot, state)\n if (state.mixedContentDepth === 0 || depth + 1 < state.mixedContentDepth) state.mixedContentDepth = depth + 1\n if (depth === 0) state.inlineChildCount++\n\n const parentHotSignals = hotSignalsByElementId.get(node.elementId)\n const parentDisplay = parentHotSignals?.display.value ?? null\n if (parentDisplay !== null && isAlignmentContextWithNonBaselineAlignment(parentDisplay, parentHotSignals)) {\n state.wrappingContextMitigates = true\n } else if (childDisplay !== null && isAlignmentContextWithNonBaselineAlignment(childDisplay, hotSignals)\n && containsMixedContent(child, childrenByParentId, snapshotByElementId, hotSignalsByElementId)) {\n state.wrappingContextMitigates = true\n }\n continue\n }\n\n if (childDisplay !== null && BLOCK_FORMATTING_CONTEXT_DISPLAYS.has(childDisplay)) {\n if (depth === 0) state.blockChildCount++\n continue\n }\n\n if (childDisplay !== null && INLINE_REPLACED_DISPLAYS.has(childDisplay)) {\n state.hasInlineReplaced = true\n if (state.inlineReplacedKind === null) state.inlineReplacedKind = \"container\"\n checkHeightContributions(snapshot, state)\n checkVerticalAlignMitigation(snapshot, state)\n if (state.mixedContentDepth === 0 || depth + 1 < state.mixedContentDepth) state.mixedContentDepth = depth + 1\n if (depth === 0) state.inlineChildCount++\n\n const parentHotSignals = hotSignalsByElementId.get(node.elementId)\n const parentDisplay = parentHotSignals?.display.value ?? null\n if (parentDisplay !== null && isAlignmentContextWithNonBaselineAlignment(parentDisplay, parentHotSignals)) {\n state.wrappingContextMitigates = true\n } else if (isAlignmentContextWithNonBaselineAlignment(childDisplay, hotSignals)\n && containsMixedContent(child, childrenByParentId, snapshotByElementId, hotSignalsByElementId)) {\n state.wrappingContextMitigates = true\n }\n continue\n }\n\n if (child.textualContent === TextualContentState.Yes || child.textualContent === TextualContentState.DynamicText) {\n state.hasTextContent = true\n }\n checkHeightContributions(snapshot, state)\n if (depth === 0) state.inlineChildCount++\n\n if (childDisplay === null || INLINE_CONTINUATION_DISPLAYS.has(childDisplay)) {\n walkInlineDescendants(child, childrenByParentId, snapshotByElementId, hotSignalsByElementId, state, depth + 1)\n }\n }\n}\n\nfunction checkHeightContributions(snapshot: SignalSnapshot, state: FingerprintWalkState): void {\n for (let i = 0; i < HEIGHT_CONTRIBUTING_SIGNALS.length; i++) {\n const signalName = HEIGHT_CONTRIBUTING_SIGNALS[i]\n if (!signalName) continue\n const signal = snapshot.signals.get(signalName)\n if (!signal) continue\n if (signal.kind !== SignalValueKind.Known) continue\n if (signal.px !== null && signal.px > 0) { state.hasHeightContributingDescendant = true; return }\n }\n}\n\nfunction checkVerticalAlignMitigation(snapshot: SignalSnapshot, state: FingerprintWalkState): void {\n const verticalAlign = snapshot.signals.get(\"vertical-align\")\n if (!verticalAlign) return\n if (verticalAlign.kind !== SignalValueKind.Known) return\n if (VERTICAL_ALIGN_MITIGATIONS.has(verticalAlign.normalized)) state.hasVerticalAlignMitigation = true\n}\n\nfunction isAlignmentContextWithNonBaselineAlignment(display: string, hotSignals: SnapshotHotSignals | undefined): boolean {\n if (display !== \"flex\" && display !== \"inline-flex\" && display !== \"grid\" && display !== \"inline-grid\") return false\n if (!hotSignals) return false\n const alignItems = hotSignals.alignItems.value\n if (alignItems === null) return false\n return alignItems !== \"baseline\"\n}\n\nfunction containsMixedContent(\n node: ElementNode,\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>,\n): boolean {\n const hasText = node.textualContent === TextualContentState.Yes || node.textualContent === TextualContentState.DynamicText\n return scanMixedContent(node, childrenByParentId, snapshotByElementId, hotSignalsByElementId, { hasText, hasReplaced: false })\n}\n\nfunction scanMixedContent(\n node: ElementNode,\n childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>,\n snapshotByElementId: ReadonlyMap<number, SignalSnapshot>,\n hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>,\n found: { hasText: boolean; hasReplaced: boolean },\n): boolean {\n const children = childrenByParentId.get(node.elementId)\n if (!children) return false\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (!child) continue\n const childTag = child.tagName?.toLowerCase() ?? null\n const hotSignals = hotSignalsByElementId.get(child.elementId)\n const childDisplay = hotSignals?.display.value ?? null\n if (childTag !== null && (INTRINSIC_REPLACED_TAGS.has(childTag) || CONTROL_ELEMENT_TAGS.has(childTag))) {\n found.hasReplaced = true\n if (found.hasText) return true\n continue\n }\n if (childDisplay !== null && BLOCK_FORMATTING_CONTEXT_DISPLAYS.has(childDisplay)) continue\n if (childDisplay !== null && INLINE_REPLACED_DISPLAYS.has(childDisplay)) {\n found.hasReplaced = true\n if (found.hasText) return true\n continue\n }\n if (child.textualContent === TextualContentState.Yes || child.textualContent === TextualContentState.DynamicText) {\n found.hasText = true\n if (found.hasReplaced) return true\n }\n if (childDisplay === null || INLINE_CONTINUATION_DISPLAYS.has(childDisplay)) {\n if (scanMixedContent(child, childrenByParentId, snapshotByElementId, hotSignalsByElementId, found)) return true\n }\n }\n return false\n}\n\nfunction classifyContentCompositionFromState(state: FingerprintWalkState, elementNode: ElementNode, hasOnlyBlockChildren: boolean): ContentCompositionClassification {\n if (hasOnlyBlockChildren) return ContentCompositionClassification.BlockSegmented\n if (state.totalChildCount === 0 && !state.hasTextContent) {\n if (elementNode.textualContent === TextualContentState.Unknown) return ContentCompositionClassification.Unknown\n if (elementNode.textualContent === TextualContentState.Yes || elementNode.textualContent === TextualContentState.DynamicText) return ContentCompositionClassification.TextOnly\n return ContentCompositionClassification.Unknown\n }\n if (state.analyzableChildCount === 0 && state.totalChildCount > 0) return ContentCompositionClassification.Unknown\n if (state.hasTextContent && state.hasInlineReplaced) {\n if (state.wrappingContextMitigates) return ContentCompositionClassification.MixedMitigated\n if (state.hasVerticalAlignMitigation) return ContentCompositionClassification.MixedMitigated\n return ContentCompositionClassification.MixedUnmitigated\n }\n if (!state.hasTextContent && state.hasInlineReplaced) return ContentCompositionClassification.ReplacedOnly\n if (state.hasTextContent && !state.hasInlineReplaced) return ContentCompositionClassification.TextOnly\n return ContentCompositionClassification.Unknown\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Cohort index (from cross-file/layout/cohort-index.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\ninterface CohortMetrics {\n readonly key: string\n readonly element: AlignmentElementEvidence\n readonly measurementNode: ElementNode\n readonly rootNode: ElementNode\n readonly hotSignals: SnapshotHotSignals\n readonly declaredOffset: NumericEvidenceValue\n readonly effectiveOffset: NumericEvidenceValue\n readonly lineHeight: NumericEvidenceValue\n}\n\ninterface CohortProfileBuffers {\n readonly declaredOffsets: number[]\n readonly effectiveOffsets: number[]\n readonly lineHeights: number[]\n readonly deviationScratch: number[]\n readonly baselineDeclaredValues: (number | null)[]\n readonly baselineEffectiveValues: (number | null)[]\n readonly baselineLineHeightValues: (number | null)[]\n readonly baselineDeclaredSorted: number[]\n readonly baselineEffectiveSorted: number[]\n readonly baselineLineHeightSorted: number[]\n}\n\ninterface ComparableClusterSummary {\n readonly comparableCount: number\n readonly clusterCount: number\n readonly dominantClusterSize: number\n readonly dominantClusterCount: number\n readonly clusterSizeByKey: ReadonlyMap<string, number>\n}\n\ninterface CohortSignalAggregate {\n readonly mergedKind: EvidenceValueKind\n readonly comparableCount: number\n readonly countsByValue: ReadonlyMap<string, number>\n}\n\ninterface CohortSignalsByElement {\n readonly verticalAlign: SnapshotHotSignals[\"verticalAlign\"]\n readonly alignSelf: SnapshotHotSignals[\"alignSelf\"]\n readonly placeSelf: SnapshotHotSignals[\"placeSelf\"]\n readonly textualContent: TextualContentState\n readonly isControlOrReplaced: boolean\n}\n\ninterface CohortSignalIndex {\n readonly byKey: ReadonlyMap<string, CohortSignalsByElement>\n readonly verticalAlign: CohortSignalAggregate\n readonly alignSelf: CohortSignalAggregate\n readonly placeSelf: CohortSignalAggregate\n readonly controlOrReplacedCount: number\n readonly textYesCount: number\n readonly textNoCount: number\n readonly textUnknownCount: number\n}\n\nexport interface CohortIndex {\n readonly statsByParentId: ReadonlyMap<number, CohortStats>\n readonly verticalAlignConsensusByParentId: ReadonlyMap<number, string | null>\n readonly conditionalSignals: number\n readonly totalSignals: number\n readonly unimodalFalseCount: number\n}\n\nexport function buildCohortIndex(input: {\n readonly childrenByParentId: ReadonlyMap<number, readonly ElementNode[]>\n readonly contextByParentId: ReadonlyMap<number, AlignmentContext>\n readonly measurementNodeByRootKey: ReadonlyMap<string, ElementNode>\n readonly snapshotByElementId: ReadonlyMap<number, SignalSnapshot>\n readonly hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>\n}): CohortIndex {\n const statsByParentId = new Map<number, CohortStats>()\n const verticalAlignConsensusByParentId = new Map<number, string | null>()\n const profileBuffers = createCohortProfileBuffers()\n\n let conditionalSignals = 0\n let totalSignals = 0\n let unimodalFalseCount = 0\n\n for (const [parentId, children] of input.childrenByParentId) {\n if (children.length < 2) continue\n const context = input.contextByParentId.get(parentId)\n if (!context) continue\n\n const cohortMetricsResult = collectCohortMetrics({\n children,\n axis: context.axis,\n axisCertainty: context.axisCertainty,\n measurementNodeByRootKey: input.measurementNodeByRootKey,\n snapshotByElementId: input.snapshotByElementId,\n hotSignalsByElementId: input.hotSignalsByElementId,\n })\n\n const metrics = cohortMetricsResult.metrics\n if (metrics.length < 2) continue\n\n const clusterSummary = summarizeComparableClusters(metrics)\n const profile = buildCohortProfile(metrics, profileBuffers, clusterSummary)\n const baselineProfiles = buildSubjectBaselineProfiles(metrics, profile, clusterSummary, profileBuffers)\n const signalIndex = buildCohortSignalIndex(metrics)\n const cohortEvidenceKind = resolveCohortEvidenceKind(metrics)\n const snapshots = collectCohortSnapshots(metrics)\n const factSummary = summarizeSignalFacts(snapshots)\n const provenance = collectCohortProvenanceFromSnapshots(snapshots)\n const counts = collectConditionalSignalCounts(snapshots)\n const subjectsByElementKey = new Map<string, CohortSubjectStats>()\n\n for (let i = 0; i < metrics.length; i++) {\n const subjectMetrics = metrics[i]\n if (!subjectMetrics) continue\n const signals = collectSubjectCohortSignals(signalIndex, subjectMetrics, context)\n const baselineProfile = baselineProfiles[i]\n if (!baselineProfile) continue\n const identifiability = resolveSubjectIdentifiability(subjectMetrics, profile, baselineProfile, clusterSummary, signalIndex, cohortEvidenceKind, metrics.length)\n const contentComposition = computeContentCompositionFingerprint(subjectMetrics.rootNode, input.childrenByParentId, input.snapshotByElementId, input.hotSignalsByElementId)\n\n subjectsByElementKey.set(subjectMetrics.key, {\n element: subjectMetrics.element,\n declaredOffset: subjectMetrics.declaredOffset,\n effectiveOffset: subjectMetrics.effectiveOffset,\n lineHeight: subjectMetrics.lineHeight,\n baselineProfile,\n signals,\n identifiability,\n contentComposition,\n })\n }\n\n statsByParentId.set(parentId, {\n profile, snapshots, factSummary, provenance,\n conditionalSignalCount: counts.conditional,\n totalSignalCount: counts.total,\n subjectsByElementKey,\n excludedElementKeys: cohortMetricsResult.excludedElementKeys,\n })\n\n verticalAlignConsensusByParentId.set(parentId, resolveVerticalAlignConsensus(signalIndex.verticalAlign))\n conditionalSignals += counts.conditional\n totalSignals += counts.total\n if (!profile.unimodal) unimodalFalseCount++\n }\n\n return { statsByParentId, verticalAlignConsensusByParentId, conditionalSignals, totalSignals, unimodalFalseCount }\n}\n\nfunction isUnconditionallyOutOfFlow(snapshot: SignalSnapshot): boolean {\n const position = readKnownNormalized(snapshot, \"position\")\n return position === \"absolute\" || position === \"fixed\"\n}\n\nfunction collectCohortMetrics(input: {\n readonly children: readonly ElementNode[]\n readonly axis: LayoutAxisModel\n readonly axisCertainty: ContextCertainty\n readonly measurementNodeByRootKey: ReadonlyMap<string, ElementNode>\n readonly snapshotByElementId: ReadonlyMap<number, SignalSnapshot>\n readonly hotSignalsByElementId: ReadonlyMap<number, SnapshotHotSignals>\n}): { readonly metrics: readonly CohortMetrics[]; readonly excludedElementKeys: ReadonlySet<string> } {\n const out: CohortMetrics[] = []\n const excluded = new Set<string>()\n const axisKind = toContextCertaintyEvidenceKind(input.axisCertainty)\n\n for (let i = 0; i < input.children.length; i++) {\n const node = input.children[i]\n if (!node) continue\n if (isLayoutHidden(node, input.snapshotByElementId)) { excluded.add(node.key); continue }\n const childSnapshot = input.snapshotByElementId.get(node.elementId)\n if (childSnapshot && isUnconditionallyOutOfFlow(childSnapshot)) { excluded.add(node.key); continue }\n\n const measurementNode = input.measurementNodeByRootKey.get(node.key)\n if (!measurementNode) continue\n const snapshot = input.snapshotByElementId.get(measurementNode.elementId)\n if (!snapshot) continue\n const hotSignals = input.hotSignalsByElementId.get(measurementNode.elementId)\n if (!hotSignals) continue\n\n const element: AlignmentElementEvidence = {\n solidFile: measurementNode.solidFile, elementKey: measurementNode.key,\n elementId: measurementNode.elementId, tag: measurementNode.tag, snapshot,\n }\n\n const offset = estimateBlockOffsetWithDeclaredFromHotSignals(hotSignals, input.axis)\n out.push({\n key: element.elementKey, element, measurementNode, rootNode: node, hotSignals,\n declaredOffset: { value: offset.declared.value, kind: mergeEvidenceKind(offset.declared.kind, axisKind) },\n effectiveOffset: { value: offset.effective.value, kind: mergeEvidenceKind(offset.effective.kind, axisKind) },\n lineHeight: hotSignals.lineHeight,\n })\n }\n return { metrics: out, excludedElementKeys: excluded }\n}\n\nfunction toContextCertaintyEvidenceKind(certainty: ContextCertainty): EvidenceValueKind {\n if (certainty === ContextCertainty.Resolved) return EvidenceValueKind.Exact\n if (certainty === ContextCertainty.Conditional) return EvidenceValueKind.Conditional\n return EvidenceValueKind.Unknown\n}\n\nfunction createCohortProfileBuffers(): CohortProfileBuffers {\n return {\n declaredOffsets: [], effectiveOffsets: [], lineHeights: [], deviationScratch: [],\n baselineDeclaredValues: [], baselineEffectiveValues: [], baselineLineHeightValues: [],\n baselineDeclaredSorted: [], baselineEffectiveSorted: [], baselineLineHeightSorted: [],\n }\n}\n\nfunction summarizeComparableClusters(metrics: readonly CohortMetrics[]): ComparableClusterSummary {\n const clusterSizeByKey = new Map<string, number>()\n let comparableCount = 0\n for (let i = 0; i < metrics.length; i++) {\n const metric = metrics[i]\n if (!metric) continue\n const key = toComparableClusterKey(metric)\n if (key === null) continue\n comparableCount++\n clusterSizeByKey.set(key, (clusterSizeByKey.get(key) ?? 0) + 1)\n }\n let dominantClusterSize = 0\n let dominantClusterCount = 0\n for (const size of clusterSizeByKey.values()) {\n if (size > dominantClusterSize) { dominantClusterSize = size; dominantClusterCount = 1; continue }\n if (size === dominantClusterSize) dominantClusterCount++\n }\n return { comparableCount, clusterCount: clusterSizeByKey.size, dominantClusterSize, dominantClusterCount, clusterSizeByKey }\n}\n\nfunction toComparableClusterKey(metric: CohortMetrics): string | null {\n const effectiveOffset = toComparableExactValue(metric.effectiveOffset)\n const lineHeight = toComparableExactValue(metric.lineHeight)\n if (effectiveOffset === null || lineHeight === null) return null\n return `${effectiveOffset}|${lineHeight}`\n}\n\nfunction buildCohortProfile(metrics: readonly CohortMetrics[], buffers: CohortProfileBuffers, clusterSummary: ComparableClusterSummary): CohortProfile {\n buffers.declaredOffsets.length = 0; buffers.effectiveOffsets.length = 0; buffers.lineHeights.length = 0\n for (let i = 0; i < metrics.length; i++) {\n const m = metrics[i]; if (!m) continue\n const d = toComparableExactValue(m.declaredOffset); const e = toComparableExactValue(m.effectiveOffset); const l = toComparableExactValue(m.lineHeight)\n if (d !== null) buffers.declaredOffsets.push(d); if (e !== null) buffers.effectiveOffsets.push(e); if (l !== null) buffers.lineHeights.push(l)\n }\n const medianDeclaredOffsetPx = computeMedian(buffers.declaredOffsets)\n const declaredOffsetDispersionPx = computeMAD(buffers.declaredOffsets, medianDeclaredOffsetPx, buffers.deviationScratch)\n const medianEffectiveOffsetPx = computeMedian(buffers.effectiveOffsets)\n const effectiveOffsetDispersionPx = computeMAD(buffers.effectiveOffsets, medianEffectiveOffsetPx, buffers.deviationScratch)\n const medianLineHeightPx = computeMedian(buffers.lineHeights)\n const lineHeightDispersionPx = computeMAD(buffers.lineHeights, medianLineHeightPx, buffers.deviationScratch)\n const dominantClusterShare = clusterSummary.comparableCount === 0 ? 0 : clusterSummary.dominantClusterSize / clusterSummary.comparableCount\n return { medianDeclaredOffsetPx, declaredOffsetDispersionPx, medianEffectiveOffsetPx, effectiveOffsetDispersionPx, medianLineHeightPx, lineHeightDispersionPx, dominantClusterSize: clusterSummary.dominantClusterSize, dominantClusterShare, unimodal: clusterSummary.clusterCount <= 1 }\n}\n\nfunction buildSubjectBaselineProfiles(metrics: readonly CohortMetrics[], profile: CohortProfile, clusterSummary: ComparableClusterSummary, buffers: CohortProfileBuffers): readonly CohortProfile[] {\n collectComparableValuesInto(metrics, \"declared\", buffers.baselineDeclaredValues)\n collectComparableValuesInto(metrics, \"effective\", buffers.baselineEffectiveValues)\n collectComparableValuesInto(metrics, \"line-height\", buffers.baselineLineHeightValues)\n const declaredSorted = toSortedComparableValuesInto(buffers.baselineDeclaredValues, buffers.baselineDeclaredSorted)\n const effectiveSorted = toSortedComparableValuesInto(buffers.baselineEffectiveValues, buffers.baselineEffectiveSorted)\n const lineHeightSorted = toSortedComparableValuesInto(buffers.baselineLineHeightValues, buffers.baselineLineHeightSorted)\n const topClusters = resolveTopClusterSizes(clusterSummary)\n const out: CohortProfile[] = []\n for (let i = 0; i < metrics.length; i++) {\n const m = metrics[i]; if (!m) continue\n const clusterKey = toComparableClusterKey(m)\n const cluster = resolveClusterSummaryExcluding(clusterSummary, topClusters, clusterKey)\n out.push({\n medianDeclaredOffsetPx: resolveMedianExcluding(declaredSorted, buffers.baselineDeclaredValues[i] ?? null),\n declaredOffsetDispersionPx: profile.declaredOffsetDispersionPx,\n medianEffectiveOffsetPx: resolveMedianExcluding(effectiveSorted, buffers.baselineEffectiveValues[i] ?? null),\n effectiveOffsetDispersionPx: profile.effectiveOffsetDispersionPx,\n medianLineHeightPx: resolveMedianExcluding(lineHeightSorted, buffers.baselineLineHeightValues[i] ?? null),\n lineHeightDispersionPx: profile.lineHeightDispersionPx,\n dominantClusterSize: cluster.dominantClusterSize,\n dominantClusterShare: cluster.dominantClusterShare,\n unimodal: cluster.unimodal,\n })\n }\n return out\n}\n\ntype ComparableValueKind = \"declared\" | \"effective\" | \"line-height\"\nfunction collectComparableValuesInto(metrics: readonly CohortMetrics[], kind: ComparableValueKind, out: (number | null)[]): void {\n out.length = 0\n for (let i = 0; i < metrics.length; i++) {\n const m = metrics[i]; if (!m) continue\n if (kind === \"declared\") { out.push(toComparableExactValue(m.declaredOffset)); continue }\n if (kind === \"effective\") { out.push(toComparableExactValue(m.effectiveOffset)); continue }\n out.push(toComparableExactValue(m.lineHeight))\n }\n}\nfunction toSortedComparableValuesInto(values: readonly (number | null)[], out: number[]): readonly number[] {\n out.length = 0\n for (let i = 0; i < values.length; i++) { const v = values[i]; if (v !== null && v !== undefined) out.push(v) }\n out.sort((a, b) => a - b)\n return out\n}\nfunction resolveMedianExcluding(sorted: readonly number[], excluded: number | null): number | null {\n if (excluded === null) return medianOfSorted(sorted)\n if (sorted.length <= 1) return null\n const size = sorted.length - 1; const middle = Math.floor((size - 1) / 2)\n const lower = resolveValueAtIndexExcluding(sorted, middle, excluded)\n if (size % 2 === 1) return lower\n return (lower + resolveValueAtIndexExcluding(sorted, middle + 1, excluded)) / 2\n}\nfunction medianOfSorted(sorted: readonly number[]): number | null {\n if (sorted.length === 0) return null\n const mid = Math.floor((sorted.length - 1) / 2)\n const v = sorted[mid]; if (v === undefined) return null\n if (sorted.length % 2 === 1) return v\n const next = sorted[mid + 1]; if (next === undefined) return null\n return (v + next) / 2\n}\nfunction resolveValueAtIndexExcluding(sorted: readonly number[], index: number, excluded: number): number {\n const removedIndex = lowerBound(sorted, excluded)\n const effectiveIndex = index < removedIndex ? index : index + 1\n return sorted[effectiveIndex] ?? 0\n}\nfunction lowerBound(sorted: readonly number[], target: number): number {\n let low = 0; let high = sorted.length\n while (low < high) { const mid = Math.floor((low + high) / 2); const v = sorted[mid]; if (v !== undefined && v < target) { low = mid + 1; continue } high = mid }\n return low\n}\ninterface TopClusterSizes { readonly largest: number; readonly largestCount: number; readonly secondLargest: number }\nfunction resolveTopClusterSizes(summary: ComparableClusterSummary): TopClusterSizes {\n let largest = 0; let largestCount = 0; let secondLargest = 0\n for (const size of summary.clusterSizeByKey.values()) {\n if (size > largest) { secondLargest = largest; largest = size; largestCount = 1; continue }\n if (size === largest) { largestCount++; continue }\n if (size > secondLargest) secondLargest = size\n }\n return { largest, largestCount, secondLargest }\n}\nfunction resolveClusterSummaryExcluding(summary: ComparableClusterSummary, top: TopClusterSizes, excludedClusterKey: string | null): { readonly dominantClusterSize: number; readonly dominantClusterShare: number; readonly unimodal: boolean } {\n if (excludedClusterKey === null) return { dominantClusterSize: summary.dominantClusterSize, dominantClusterShare: summary.comparableCount === 0 ? 0 : summary.dominantClusterSize / summary.comparableCount, unimodal: summary.clusterCount <= 1 }\n const excludedSize = summary.clusterSizeByKey.get(excludedClusterKey)\n if (excludedSize === undefined || excludedSize <= 0) return { dominantClusterSize: summary.dominantClusterSize, dominantClusterShare: summary.comparableCount === 0 ? 0 : summary.dominantClusterSize / summary.comparableCount, unimodal: summary.clusterCount <= 1 }\n const comparableCount = summary.comparableCount - 1\n if (comparableCount <= 0) return { dominantClusterSize: 0, dominantClusterShare: 0, unimodal: true }\n const clusterCount = excludedSize === 1 ? summary.clusterCount - 1 : summary.clusterCount\n const reducedSize = excludedSize - 1\n if (excludedSize < top.largest) return { dominantClusterSize: top.largest, dominantClusterShare: top.largest / comparableCount, unimodal: clusterCount <= 1 }\n if (excludedSize > top.largest) return { dominantClusterSize: reducedSize, dominantClusterShare: reducedSize / comparableCount, unimodal: clusterCount <= 1 }\n if (top.largestCount > 1) return { dominantClusterSize: top.largest, dominantClusterShare: top.largest / comparableCount, unimodal: clusterCount <= 1 }\n const dominant = top.secondLargest > reducedSize ? top.secondLargest : reducedSize\n return { dominantClusterSize: dominant, dominantClusterShare: dominant / comparableCount, unimodal: clusterCount <= 1 }\n}\nfunction buildCohortSignalIndex(metrics: readonly CohortMetrics[]): CohortSignalIndex {\n const byKey = new Map<string, CohortSignalsByElement>()\n const verticalAlignCounts = new Map<string, number>(); const alignSelfCounts = new Map<string, number>(); const placeSelfCounts = new Map<string, number>()\n let verticalAlignMergedKind: EvidenceValueKind = EvidenceValueKind.Exact; let alignSelfMergedKind: EvidenceValueKind = EvidenceValueKind.Exact; let placeSelfMergedKind: EvidenceValueKind = EvidenceValueKind.Exact\n let verticalAlignComparableCount = 0; let alignSelfComparableCount = 0; let placeSelfComparableCount = 0; let controlOrReplacedCount = 0; let textYesCount = 0; let textNoCount = 0; let textUnknownCount = 0\n for (let i = 0; i < metrics.length; i++) {\n const m = metrics[i]; if (!m) continue\n const rootNode = m.rootNode; const isControlOrReplaced = rootNode.isControl || rootNode.isReplaced\n const verticalAlign = resolveComparableVerticalAlign(m.hotSignals.verticalAlign, isControlOrReplaced)\n if (isControlOrReplaced) controlOrReplacedCount++\n if (rootNode.textualContent === TextualContentState.Yes || rootNode.textualContent === TextualContentState.DynamicText) textYesCount++\n if (rootNode.textualContent === TextualContentState.No) textNoCount++\n if (rootNode.textualContent === TextualContentState.Unknown) textUnknownCount++\n if (verticalAlign.value !== null) { verticalAlignMergedKind = mergeEvidenceKind(verticalAlignMergedKind, verticalAlign.kind); verticalAlignComparableCount++; incrementCount(verticalAlignCounts, verticalAlign.value) }\n if (m.hotSignals.alignSelf.value !== null) { alignSelfMergedKind = mergeEvidenceKind(alignSelfMergedKind, m.hotSignals.alignSelf.kind); alignSelfComparableCount++; incrementCount(alignSelfCounts, m.hotSignals.alignSelf.value) }\n if (m.hotSignals.placeSelf.value !== null) { placeSelfMergedKind = mergeEvidenceKind(placeSelfMergedKind, m.hotSignals.placeSelf.kind); placeSelfComparableCount++; incrementCount(placeSelfCounts, m.hotSignals.placeSelf.value) }\n byKey.set(m.key, { verticalAlign, alignSelf: m.hotSignals.alignSelf, placeSelf: m.hotSignals.placeSelf, textualContent: rootNode.textualContent, isControlOrReplaced })\n }\n return {\n byKey,\n verticalAlign: { mergedKind: verticalAlignComparableCount === 0 ? EvidenceValueKind.Unknown : verticalAlignMergedKind, comparableCount: verticalAlignComparableCount, countsByValue: verticalAlignCounts },\n alignSelf: { mergedKind: alignSelfComparableCount === 0 ? EvidenceValueKind.Unknown : alignSelfMergedKind, comparableCount: alignSelfComparableCount, countsByValue: alignSelfCounts },\n placeSelf: { mergedKind: placeSelfComparableCount === 0 ? EvidenceValueKind.Unknown : placeSelfMergedKind, comparableCount: placeSelfComparableCount, countsByValue: placeSelfCounts },\n controlOrReplacedCount, textYesCount, textNoCount, textUnknownCount,\n }\n}\nfunction resolveComparableVerticalAlign(va: SnapshotHotSignals[\"verticalAlign\"], isControlOrReplaced: boolean): SnapshotHotSignals[\"verticalAlign\"] {\n if (va.value !== null) return va\n if (!isControlOrReplaced) return va\n return { present: va.present, value: \"baseline\", kind: EvidenceValueKind.Exact }\n}\nfunction collectSubjectCohortSignals(index: CohortSignalIndex, subjectMetrics: CohortMetrics, context: AlignmentContext): AlignmentCohortSignals {\n const subject = index.byKey.get(subjectMetrics.key)\n if (!subject) throw new Error(`missing cohort signal entry for ${subjectMetrics.key}`)\n const verticalAlignKind = subject.verticalAlign.value !== null ? index.verticalAlign.mergedKind : subject.verticalAlign.kind\n const alignSelfKind = subject.alignSelf.value !== null ? index.alignSelf.mergedKind : subject.alignSelf.kind\n const placeSelfKind = subject.placeSelf.value !== null ? index.placeSelf.mergedKind : subject.placeSelf.kind\n const hasControlOrReplacedPeer = index.controlOrReplacedCount - (subject.isControlOrReplaced ? 1 : 0) > 0\n const verticalAlign = finalizeConflictEvidence(subject.verticalAlign.value, verticalAlignKind, hasComparablePeer(index.verticalAlign, subject.verticalAlign.value), hasConflictPeer(index.verticalAlign, subject.verticalAlign.value))\n const tableCellControlFallback = context.kind === \"table-cell\" && subject.isControlOrReplaced && verticalAlign.value === SignalConflictValue.Unknown && index.byKey.size > index.controlOrReplacedCount\n const normalizedVerticalAlign: SignalConflictEvidence = tableCellControlFallback ? { value: SignalConflictValue.Conflict, kind: verticalAlignKind } : verticalAlign\n const textContrastWithPeers = resolveIndexedTextContrastWithPeers(index, subject.textualContent, subject.isControlOrReplaced, tableCellControlFallback)\n return {\n verticalAlign: normalizedVerticalAlign,\n alignSelf: finalizeConflictEvidence(subject.alignSelf.value, alignSelfKind, hasComparablePeer(index.alignSelf, subject.alignSelf.value), hasConflictPeer(index.alignSelf, subject.alignSelf.value)),\n placeSelf: finalizeConflictEvidence(subject.placeSelf.value, placeSelfKind, hasComparablePeer(index.placeSelf, subject.placeSelf.value), hasConflictPeer(index.placeSelf, subject.placeSelf.value)),\n hasControlOrReplacedPeer,\n textContrastWithPeers,\n }\n}\nfunction hasComparablePeer(agg: CohortSignalAggregate, subjectValue: string | null): boolean { return subjectValue !== null && agg.comparableCount - 1 > 0 }\nfunction hasConflictPeer(agg: CohortSignalAggregate, subjectValue: string | null): boolean { if (subjectValue === null) return false; const peers = agg.comparableCount - 1; if (peers <= 0) return false; return peers > ((agg.countsByValue.get(subjectValue) ?? 0) - 1) }\nfunction finalizeConflictEvidence(subjectValue: string | null, kind: EvidenceValueKind, sawPeer: boolean, sawConflict: boolean): SignalConflictEvidence {\n if (subjectValue === null || !sawPeer) return { value: SignalConflictValue.Unknown, kind }\n return { value: sawConflict ? SignalConflictValue.Conflict : SignalConflictValue.Aligned, kind }\n}\nfunction resolveIndexedTextContrastWithPeers(index: CohortSignalIndex, textualContent: TextualContentState, isControlOrReplaced: boolean, tableCellControlFallback: boolean): AlignmentTextContrast {\n if (textualContent === TextualContentState.Unknown) return AlignmentTextContrast.Unknown\n if (textualContent === TextualContentState.Yes || textualContent === TextualContentState.DynamicText) {\n if (index.textNoCount > 0) return AlignmentTextContrast.Different\n if (index.textUnknownCount > 0) return AlignmentTextContrast.Unknown\n return AlignmentTextContrast.Same\n }\n if (index.textYesCount > 0) return AlignmentTextContrast.Different\n if (tableCellControlFallback) return AlignmentTextContrast.Different\n if (isControlOrReplaced && index.controlOrReplacedCount === 1 && index.byKey.size >= 3 && index.textUnknownCount > 0) return AlignmentTextContrast.Different\n if (index.textUnknownCount > 0) return AlignmentTextContrast.Unknown\n return AlignmentTextContrast.Same\n}\nfunction resolveSubjectIdentifiability(subjectMetrics: CohortMetrics, profile: CohortProfile, subjectBaselineProfile: CohortProfile, clusterSummary: ComparableClusterSummary, signalIndex: CohortSignalIndex, cohortKind: EvidenceValueKind, cohortSize: number): CohortIdentifiability {\n const subjectClusterKey = toComparableClusterKey(subjectMetrics)\n if (subjectClusterKey === null) {\n const roleFallback = resolveControlRoleIdentifiability(subjectMetrics, signalIndex, cohortKind, cohortSize)\n if (roleFallback !== null) return roleFallback\n return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Insufficient, ambiguous: true, kind: cohortKind }\n }\n if (cohortSize <= 2) return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Dominant, ambiguous: false, kind: cohortKind }\n if (clusterSummary.comparableCount < 2 || clusterSummary.clusterCount === 0) return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Insufficient, ambiguous: true, kind: cohortKind }\n const subjectClusterSize = clusterSummary.clusterSizeByKey.get(subjectClusterKey)\n if (subjectClusterSize === undefined || subjectClusterSize <= 0) return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Insufficient, ambiguous: true, kind: cohortKind }\n const ambiguous = clusterSummary.dominantClusterCount > 1 && subjectClusterSize === clusterSummary.dominantClusterSize\n if (ambiguous) return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Ambiguous, ambiguous: true, kind: cohortKind }\n if (subjectClusterSize >= clusterSummary.dominantClusterSize) return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Dominant, ambiguous: false, kind: cohortKind }\n return { dominantShare: profile.dominantClusterShare, subjectExcludedDominantShare: subjectBaselineProfile.dominantClusterShare, subjectMembership: CohortSubjectMembership.Nondominant, ambiguous: false, kind: cohortKind }\n}\nfunction resolveControlRoleIdentifiability(subjectMetrics: CohortMetrics, signalIndex: CohortSignalIndex, kind: EvidenceValueKind, cohortSize: number): CohortIdentifiability | null {\n const isCtrl = subjectMetrics.rootNode.isControl || subjectMetrics.rootNode.isReplaced\n const ctrlCount = signalIndex.controlOrReplacedCount; const nonCtrlCount = cohortSize - ctrlCount\n if (ctrlCount <= 0 || nonCtrlCount <= 0) return null\n const dominantShare = Math.max(ctrlCount, nonCtrlCount) / cohortSize\n const ctrlAfter = ctrlCount - (isCtrl ? 1 : 0); const nonCtrlAfter = nonCtrlCount - (isCtrl ? 0 : 1); const totalAfter = ctrlAfter + nonCtrlAfter\n const excludedDominantShare = totalAfter <= 0 ? 0 : Math.max(ctrlAfter, nonCtrlAfter) / totalAfter\n const membership = ctrlCount === nonCtrlCount ? CohortSubjectMembership.Ambiguous : (ctrlCount > nonCtrlCount) === isCtrl ? CohortSubjectMembership.Dominant : CohortSubjectMembership.Nondominant\n if (cohortSize <= 2) return { dominantShare, subjectExcludedDominantShare: excludedDominantShare, subjectMembership: membership === CohortSubjectMembership.Ambiguous ? CohortSubjectMembership.Dominant : membership, ambiguous: false, kind }\n if (membership === CohortSubjectMembership.Ambiguous) return { dominantShare, subjectExcludedDominantShare: excludedDominantShare, subjectMembership: membership, ambiguous: true, kind }\n return { dominantShare, subjectExcludedDominantShare: excludedDominantShare, subjectMembership: membership, ambiguous: false, kind }\n}\nfunction collectConditionalSignalCounts(snapshots: readonly SignalSnapshot[]): { readonly conditional: number; readonly total: number } {\n let conditional = 0; let total = 0\n for (let i = 0; i < snapshots.length; i++) { const s = snapshots[i]; if (!s) continue; conditional += s.conditionalSignalCount; total += s.knownSignalCount + s.unknownSignalCount + s.conditionalSignalCount }\n return { conditional, total }\n}\nfunction collectCohortSnapshots(metrics: readonly CohortMetrics[]): readonly SignalSnapshot[] {\n const out: SignalSnapshot[] = []\n for (let i = 0; i < metrics.length; i++) { const m = metrics[i]; if (!m) continue; out.push(m.element.snapshot) }\n return out\n}\nfunction collectCohortProvenanceFromSnapshots(snapshots: readonly SignalSnapshot[]): EvidenceProvenance {\n const byKey = new Map<string, GuardConditionProvenance>()\n for (let i = 0; i < snapshots.length; i++) { const s = snapshots[i]; if (!s) continue; for (const signal of s.signals.values()) { for (let j = 0; j < signal.guard.conditions.length; j++) { const g = signal.guard.conditions[j]; if (!g) continue; if (!byKey.has(g.key)) byKey.set(g.key, g) } } }\n const guards = [...byKey.values()]; guards.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0)\n const guardKey = guards.length === 0 ? \"always\" : guards.map(g => g.key).join(\"&\")\n return { reason: \"cohort-derived alignment evidence\", guardKey, guards }\n}\nfunction resolveCohortEvidenceKind(metrics: readonly CohortMetrics[]): EvidenceValueKind {\n let kind: EvidenceValueKind = EvidenceValueKind.Exact\n for (let i = 0; i < metrics.length; i++) { const m = metrics[i]; if (!m) continue; kind = mergeEvidenceKind(kind, mergeEvidenceKind(m.effectiveOffset.kind, m.lineHeight.kind)) }\n return kind\n}\nfunction incrementCount(counts: Map<string, number>, key: string): void { counts.set(key, (counts.get(key) ?? 0) + 1) }\nfunction computeMedian(values: number[]): number | null {\n if (values.length === 0) return null\n const mid = Math.floor((values.length - 1) / 2)\n const lower = selectKth(values, mid)\n if (values.length % 2 === 1) return lower\n return (lower + selectKth(values, mid + 1)) / 2\n}\nfunction computeMAD(values: readonly number[], median: number | null, scratch: number[]): number | null {\n if (median === null || values.length === 0) return null\n scratch.length = 0\n for (let i = 0; i < values.length; i++) { const v = values[i]; if (v === undefined) continue; scratch.push(Math.abs(v - median)) }\n return computeMedian(scratch)\n}\nfunction resolveVerticalAlignConsensus(aggregate: CohortSignalAggregate): string | null {\n if (aggregate.comparableCount === 0) return null\n if (aggregate.countsByValue.size !== 1) return null\n const firstEntry = aggregate.countsByValue.entries().next()\n if (firstEntry.done) return null\n return firstEntry.value[0]\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Rule kit (from cross-file/layout/rule-kit.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\nexport type AlignmentFactorId =\n | \"offset-delta\"\n | \"declared-offset-delta\"\n | \"baseline-conflict\"\n | \"context-conflict\"\n | \"replaced-control-risk\"\n | \"content-composition-conflict\"\n | \"context-certainty\"\n\nexport interface LayoutEvidence {\n readonly severity: number\n readonly confidence: number\n readonly causes: readonly string[]\n readonly primaryFix: string\n readonly contextKind: AlignmentContextKind\n readonly contextCertainty: ContextCertainty\n readonly estimatedOffsetPx: number | null\n readonly decisionReason: \"accepted-lower-bound\"\n readonly posteriorLower: number\n readonly posteriorUpper: number\n readonly evidenceMass: number\n readonly topFactors: readonly AlignmentFactorId[]\n}\n\nexport type LayoutEvaluationResult =\n | {\n readonly kind: \"accept\"\n readonly evidence: LayoutEvidence\n }\n | {\n readonly kind: \"reject\"\n readonly reason: \"low-evidence\" | \"threshold\" | \"undecidable\"\n readonly detail?: \"evidence-mass\" | \"posterior\" | \"interval\" | \"identifiability\"\n readonly posteriorLower: number\n readonly posteriorUpper: number\n readonly evidenceMass: number\n }\n\nexport interface LayoutDetection<TCase> {\n readonly caseData: TCase\n readonly evidence: LayoutEvidence\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n if (value < min) return min\n if (value > max) return max\n return value\n}\n\nexport function collectAlignmentCases<TCase>(\n collect: () => readonly TCase[],\n): readonly TCase[] {\n return collect()\n}\n\nexport function evaluateAlignmentCase<TCase>(\n caseData: TCase,\n evaluate: (input: TCase) => LayoutEvaluationResult,\n): LayoutDetection<TCase> | null {\n const result = evaluate(caseData)\n if (result.kind === \"accept\") {\n return { caseData, evidence: result.evidence }\n }\n return null\n}\n\nexport function runAlignmentDetector<TCase>(\n cases: readonly TCase[],\n evaluate: (input: TCase) => LayoutEvaluationResult,\n): readonly LayoutDetection<TCase>[] {\n const out: LayoutDetection<TCase>[] = []\n\n for (let i = 0; i < cases.length; i++) {\n const current = cases[i]\n if (!current) continue\n const result = evaluate(current)\n if (result.kind === \"accept\") {\n out.push({ caseData: current, evidence: result.evidence })\n }\n }\n\n return out\n}\n\nexport function computeBayesianPosterior(\n priorLogOdds: number,\n evidenceLogOdds: number,\n): { readonly posteriorLower: number; readonly posteriorUpper: number; readonly evidenceMass: number } {\n const posteriorLogOdds = priorLogOdds + evidenceLogOdds\n const posteriorProbability = 1 / (1 + Math.exp(-posteriorLogOdds))\n const clamped = clamp(posteriorProbability, 0, 1)\n const evidenceMass = clamp(Math.abs(evidenceLogOdds) / 5, 0, 1)\n\n return {\n posteriorLower: clamped,\n posteriorUpper: clamp(clamped + (1 - evidenceMass) * 0.1, 0, 1),\n evidenceMass,\n }\n}\n\n\n// ══════════════════════════════════════════════════════════════════════════\n// Alignment case evaluation pipeline\n// (from cross-file/layout/calibration.ts + consistency-evidence.ts +\n// consistency-policy.ts + scoring.ts + diagnostics.ts + content-composition.ts)\n// ══════════════════════════════════════════════════════════════════════════\n\n// ── Types ─────────────────────────────────────────────────────────────────\n\nexport type AlignmentFindingKind =\n | \"offset-delta\"\n | \"declared-offset-delta\"\n | \"baseline-conflict\"\n | \"context-conflict\"\n | \"replaced-control-risk\"\n | \"content-composition-conflict\"\n\nexport type AlignmentFactorCoverage = Readonly<Record<AlignmentFactorId, number>>\n\nexport interface LogOddsInterval {\n readonly min: number\n readonly max: number\n}\n\nexport interface EvidenceAtom {\n readonly factorId: AlignmentFactorId\n readonly valueKind: EvidenceValueKind\n readonly contribution: LogOddsInterval\n readonly provenance: EvidenceProvenance\n readonly relevanceWeight: number\n readonly coverage: number\n}\n\nexport interface PosteriorInterval {\n readonly lower: number\n readonly upper: number\n}\n\nexport interface AlignmentSignalFinding {\n readonly kind: AlignmentFindingKind\n readonly message: string\n readonly fix: string\n readonly weight: number\n}\n\nexport interface AlignmentEvaluation {\n readonly severity: number\n readonly confidence: number\n readonly declaredOffsetPx: number | null\n readonly estimatedOffsetPx: number | null\n readonly contextKind: AlignmentContextKind\n readonly contextCertainty: ContextCertainty\n readonly posterior: PosteriorInterval\n readonly evidenceMass: number\n readonly topFactors: readonly AlignmentFactorId[]\n readonly signalFindings: readonly AlignmentSignalFinding[]\n}\n\nexport interface AlignmentCase {\n readonly subject: AlignmentElementEvidence\n readonly subjectIsControlOrReplaced: boolean\n readonly cohort: { readonly parentElementKey: string; readonly parentElementId: number; readonly parentTag: string | null; readonly siblingCount: number }\n readonly cohortProfile: CohortProfile\n readonly cohortSignals: AlignmentCohortSignals\n readonly subjectIdentifiability: CohortIdentifiability\n readonly factorCoverage: AlignmentFactorCoverage\n readonly cohortSnapshots: readonly SignalSnapshot[]\n readonly cohortFactSummary: CohortFactSummary\n readonly cohortProvenance: EvidenceProvenance\n readonly subjectDeclaredOffsetDeviation: NumericEvidenceValue\n readonly subjectEffectiveOffsetDeviation: NumericEvidenceValue\n readonly subjectLineHeightDeviation: NumericEvidenceValue\n readonly context: AlignmentContext\n readonly subjectContentComposition: ContentCompositionFingerprint\n readonly cohortContentCompositions: readonly ContentCompositionFingerprint[]\n}\n\n\n// ── Calibration (from calibration.ts) ─────────────────────────────────────\n\ninterface AlignmentFactorContract {\n readonly polarity: \"support\" | \"penalty\"\n readonly maxMagnitude: number\n}\n\nconst ALIGNMENT_FACTOR_CONTRACTS: Readonly<Record<AlignmentFactorId, AlignmentFactorContract>> = {\n \"offset-delta\": { polarity: \"support\", maxMagnitude: 1.6 },\n \"declared-offset-delta\": { polarity: \"support\", maxMagnitude: 0.42 },\n \"baseline-conflict\": { polarity: \"support\", maxMagnitude: 1.35 },\n \"context-conflict\": { polarity: \"support\", maxMagnitude: 0.78 },\n \"replaced-control-risk\": { polarity: \"support\", maxMagnitude: 1.35 },\n \"content-composition-conflict\": { polarity: \"support\", maxMagnitude: 2.60 },\n \"context-certainty\": { polarity: \"penalty\", maxMagnitude: 0.26 },\n}\n\nconst alignmentPolicyCalibration = {\n priorLogOdds: -1.25,\n posteriorThreshold: 0.68,\n evidenceMassFloor: 0.34,\n severityPosteriorWeight: 0.72,\n severityOffsetWeight: 0.2,\n severityBaselineWeight: 0.08,\n confidenceMassFloor: 0.25,\n confidenceMassWeight: 0.75,\n confidenceIntervalPenalty: 0.35,\n}\n\nconst evidenceContributionCalibration = {\n supportIntervalLowerScale: 0.6,\n supportConditionalUpperScale: 0.7,\n penaltyIntervalUpperScale: 0.45,\n}\n\n\n// ── Content composition divergence (from content-composition.ts) ──────────\n\nexport interface CompositionDivergenceResult {\n readonly strength: number\n readonly majorityClassification: ContentCompositionClassification\n}\n\nconst NO_DIVERGENCE: CompositionDivergenceResult = Object.freeze({\n strength: 0,\n majorityClassification: ContentCompositionClassification.Unknown,\n})\n\nexport function resolveCompositionDivergence(\n subjectFingerprint: ContentCompositionFingerprint,\n allFingerprints: readonly ContentCompositionFingerprint[],\n parentContext: AlignmentContext | null,\n): CompositionDivergenceResult {\n if (allFingerprints.length < 2) return NO_DIVERGENCE\n if (parentContext !== null && parentContext.baselineRelevance !== \"relevant\") return NO_DIVERGENCE\n\n const countByClassification = new Map<ContentCompositionClassification, number>()\n for (let i = 0; i < allFingerprints.length; i++) {\n const fp = allFingerprints[i]\n if (!fp) continue\n const normalized = normalizeClassificationForComparison(fp.classification)\n countByClassification.set(normalized, (countByClassification.get(normalized) ?? 0) + 1)\n }\n\n const subjectNormalized = normalizeClassificationForComparison(subjectFingerprint.classification)\n const subjectCount = countByClassification.get(subjectNormalized) ?? 0\n\n let majorityClassification: ContentCompositionClassification = ContentCompositionClassification.Unknown\n let majorityCount = 0\n for (const [classification, count] of countByClassification) {\n if (count > majorityCount) { majorityCount = count; majorityClassification = classification }\n }\n\n if (subjectCount === allFingerprints.length) return { strength: resolveInlineReplacedKindDivergence(subjectFingerprint, allFingerprints), majorityClassification }\n if (subjectNormalized === majorityClassification) return { strength: resolveInlineReplacedKindDivergence(subjectFingerprint, allFingerprints), majorityClassification }\n if (subjectNormalized === ContentCompositionClassification.Unknown) return { strength: 0, majorityClassification }\n\n const cal = alignmentStrengthCalibration\n if (majorityClassification === ContentCompositionClassification.TextOnly && subjectNormalized === ContentCompositionClassification.MixedUnmitigated) return { strength: cal.compositionMixedUnmitigatedOutlierStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.ReplacedOnly && subjectNormalized === ContentCompositionClassification.MixedUnmitigated) return { strength: cal.compositionMixedOutlierAmongReplacedStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.MixedUnmitigated && subjectNormalized === ContentCompositionClassification.TextOnly) return { strength: cal.compositionTextOutlierAmongMixedStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.MixedUnmitigated && subjectNormalized === ContentCompositionClassification.ReplacedOnly) return { strength: cal.compositionTextOutlierAmongMixedStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.TextOnly && subjectNormalized === ContentCompositionClassification.ReplacedOnly) return { strength: cal.compositionMixedOutlierAmongReplacedStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.ReplacedOnly && subjectNormalized === ContentCompositionClassification.TextOnly) return { strength: cal.compositionTextOutlierAmongMixedStrength, majorityClassification }\n if (majorityClassification === ContentCompositionClassification.Unknown) return { strength: 0, majorityClassification }\n return { strength: cal.compositionUnknownPenalty, majorityClassification }\n}\n\nfunction resolveInlineReplacedKindDivergence(\n subjectFingerprint: ContentCompositionFingerprint,\n allFingerprints: readonly ContentCompositionFingerprint[],\n): number {\n if (subjectFingerprint.inlineReplacedKind === null) return 0\n const countByKind = new Map<InlineReplacedKind, number>()\n for (let i = 0; i < allFingerprints.length; i++) {\n const fp = allFingerprints[i]\n if (!fp || fp.inlineReplacedKind === null) continue\n countByKind.set(fp.inlineReplacedKind, (countByKind.get(fp.inlineReplacedKind) ?? 0) + 1)\n }\n if (countByKind.size < 2) return 0\n const subjectKindCount = countByKind.get(subjectFingerprint.inlineReplacedKind) ?? 0\n if (subjectKindCount === allFingerprints.length) return 0\n return alignmentStrengthCalibration.compositionMixedOutlierAmongReplacedStrength\n}\n\nfunction normalizeClassificationForComparison(classification: ContentCompositionClassification): ContentCompositionClassification {\n if (classification === ContentCompositionClassification.MixedMitigated) return ContentCompositionClassification.TextOnly\n if (classification === ContentCompositionClassification.BlockSegmented) return ContentCompositionClassification.TextOnly\n return classification\n}\n\nexport function resolveCompositionCoverage(\n subjectFingerprint: ContentCompositionFingerprint,\n allFingerprints: readonly ContentCompositionFingerprint[],\n): number {\n if (allFingerprints.length < 2) return 0\n let analyzableCount = 0\n for (let i = 0; i < allFingerprints.length; i++) {\n const fp = allFingerprints[i]\n if (fp && fp.classification !== ContentCompositionClassification.Unknown) analyzableCount++\n }\n const analyzableShare = analyzableCount / allFingerprints.length\n if (subjectFingerprint.classification === ContentCompositionClassification.Unknown) return analyzableShare * 0.3\n if (subjectFingerprint.totalChildCount > 0 && subjectFingerprint.analyzableChildCount === 0) return analyzableShare * 0.4\n return analyzableShare\n}\n\nexport function formatCompositionFixSuggestion(subjectFingerprint: ContentCompositionFingerprint): string {\n if (subjectFingerprint.classification === ContentCompositionClassification.MixedUnmitigated) {\n if (subjectFingerprint.hasVerticalAlignMitigation) return \"verify vertical-align resolves the baseline shift\"\n return \"add display: inline-flex; align-items: center to the wrapping container, or vertical-align: middle on the inline-replaced child\"\n }\n return \"ensure consistent content composition across siblings\"\n}\n\n\n// ── Consistency evidence (from consistency-evidence.ts) ───────────────────\n\ninterface StrengthEvidence {\n readonly strength: number\n readonly kind: EvidenceValueKind\n}\n\nconst ZERO_STRENGTH: StrengthEvidence = { strength: 0, kind: EvidenceValueKind.Exact }\n\ninterface ConsistencyEvidence {\n readonly offsetStrength: number\n readonly declaredOffsetStrength: number\n readonly baselineStrength: number\n readonly contextStrength: number\n readonly replacedStrength: number\n readonly compositionStrength: number\n readonly majorityClassification: ContentCompositionClassification\n readonly identifiability: CohortIdentifiability\n readonly factSummary: CohortFactSummary\n readonly atoms: readonly EvidenceAtom[]\n}\n\nfunction buildConsistencyEvidence(input: AlignmentCase): ConsistencyEvidence {\n const factSummary = input.cohortFactSummary\n const effectiveOffsetScaleReference = resolveOffsetScaleReference(input.cohortProfile.medianLineHeightPx, input.cohortProfile.medianEffectiveOffsetPx)\n const declaredOffsetScaleReference = resolveOffsetScaleReference(input.cohortProfile.medianLineHeightPx, input.cohortProfile.medianDeclaredOffsetPx)\n\n const offsetRaw = normalizeDeviation(input.subjectEffectiveOffsetDeviation, input.cohortProfile.effectiveOffsetDispersionPx, effectiveOffsetScaleReference)\n const declaredOffsetRaw = normalizeDeviation(input.subjectDeclaredOffsetDeviation, input.cohortProfile.declaredOffsetDispersionPx, declaredOffsetScaleReference)\n const lineHeight = normalizeDeviation(input.subjectLineHeightDeviation, input.cohortProfile.lineHeightDispersionPx, input.cohortProfile.medianLineHeightPx)\n\n const baselinesIrrelevant = input.context.baselineRelevance === \"irrelevant\"\n const blockAxisIsMainAxis = !input.context.crossAxisIsBlockAxis\n const suppressAll = blockAxisIsMainAxis\n const offset = suppressAll ? ZERO_STRENGTH : offsetRaw\n const declaredOffset = suppressAll ? ZERO_STRENGTH : declaredOffsetRaw\n\n const baselineStrength = (baselinesIrrelevant || suppressAll) ? ZERO_STRENGTH : resolveBaselineStrength(input, lineHeight)\n const contextStrength = (baselinesIrrelevant || suppressAll) ? ZERO_STRENGTH : resolveContextStrength(input, lineHeight)\n const replacedStrength = (baselinesIrrelevant || suppressAll) ? ZERO_STRENGTH : resolveReplacedControlStrength(input, lineHeight)\n const compositionResult = (baselinesIrrelevant || suppressAll) ? null : resolveContentCompositionStrength(input)\n const compositionStrength = compositionResult ? compositionResult.evidence : ZERO_STRENGTH\n const contextCertaintyPenalty = resolveContextCertaintyPenalty(input)\n const provenance = input.cohortProvenance\n const atoms = buildEvidenceAtoms(input, offset, declaredOffset, baselineStrength, contextStrength, replacedStrength, compositionStrength, contextCertaintyPenalty, provenance)\n\n return {\n offsetStrength: offset.strength,\n declaredOffsetStrength: declaredOffset.strength,\n baselineStrength: baselineStrength.strength,\n contextStrength: contextStrength.strength,\n replacedStrength: replacedStrength.strength,\n compositionStrength: compositionStrength.strength,\n majorityClassification: compositionResult ? compositionResult.divergence.majorityClassification : ContentCompositionClassification.Unknown,\n identifiability: input.subjectIdentifiability,\n factSummary,\n atoms,\n }\n}\n\nfunction normalizeDeviation(value: NumericEvidenceValue, dispersion: number | null, baselineMagnitude: number | null): StrengthEvidence {\n if (value.value === null || value.value <= 0) return { strength: 0, kind: value.kind }\n const scaledDispersion = dispersion === null ? 0 : Math.abs(dispersion) * 1.5\n const magnitudeScale = baselineMagnitude === null ? 0 : Math.abs(baselineMagnitude)\n let scale = scaledDispersion\n if (magnitudeScale > scale) scale = magnitudeScale\n if (scale <= 0) scale = Math.abs(value.value)\n if (scale <= 0) return { strength: 0, kind: value.kind }\n return { strength: value.value / scale, kind: value.kind }\n}\n\nfunction resolveOffsetScaleReference(medianLineHeightPx: number | null, fallbackMedianOffsetPx: number | null): number | null {\n if (medianLineHeightPx !== null) return Math.abs(medianLineHeightPx) * 0.1\n if (fallbackMedianOffsetPx === null) return null\n return Math.abs(fallbackMedianOffsetPx)\n}\n\nfunction resolveBaselineStrength(input: AlignmentCase, lineHeight: StrengthEvidence): StrengthEvidence {\n const verticalAlign = input.cohortSignals.verticalAlign\n const hasConflict = verticalAlign.value === SignalConflictValue.Conflict\n const conflict = hasConflict ? alignmentStrengthCalibration.baselineConflictBoost : 0\n const kind = !hasConflict ? mergeEvidenceKind(lineHeight.kind, verticalAlign.kind) : (lineHeight.kind === EvidenceValueKind.Unknown ? verticalAlign.kind : mergeEvidenceKind(lineHeight.kind, verticalAlign.kind))\n return { strength: clamp(lineHeight.strength * alignmentStrengthCalibration.lineHeightWeight + conflict, 0, 1), kind }\n}\n\nfunction resolveContextStrength(input: AlignmentCase, lineHeight: StrengthEvidence): StrengthEvidence {\n const contextKind = mapContextCertaintyToEvidenceKind(input.context.certainty)\n if (input.context.kind !== \"flex-cross-axis\" && input.context.kind !== \"grid-cross-axis\") return { strength: 0, kind: contextKind }\n\n const alignSelf = input.cohortSignals.alignSelf\n const placeSelf = input.cohortSignals.placeSelf\n const conflictKind = mergeEvidenceKind(alignSelf.kind, placeSelf.kind)\n const hasConflict = alignSelf.value === SignalConflictValue.Conflict || placeSelf.value === SignalConflictValue.Conflict\n const conflictStrength = hasConflict ? alignmentStrengthCalibration.contextConflictBoost : 0\n\n const parentIsCenter = input.context.parentAlignItems === \"center\" || input.context.parentPlaceItems === \"center\"\n const centerPenalty = parentIsCenter ? alignmentStrengthCalibration.contextCenterPenalty : 0\n const kind = mergeEvidenceKind(mergeEvidenceKind(lineHeight.kind, conflictKind), contextKind)\n return { strength: clamp(conflictStrength + lineHeight.strength * alignmentStrengthCalibration.contextLineHeightWeight - centerPenalty, 0, 1), kind }\n}\n\nfunction resolveReplacedControlStrength(input: AlignmentCase, lineHeight: StrengthEvidence): StrengthEvidence {\n const hasReplacedPair = input.subjectIsControlOrReplaced || input.cohortSignals.hasControlOrReplacedPeer\n if (!hasReplacedPair) return { strength: 0, kind: lineHeight.kind }\n if (input.cohortSignals.textContrastWithPeers === AlignmentTextContrast.Different) return { strength: alignmentStrengthCalibration.replacedDifferentTextBoost, kind: EvidenceValueKind.Exact }\n if (input.cohortSignals.textContrastWithPeers === AlignmentTextContrast.Unknown) return { strength: alignmentStrengthCalibration.replacedUnknownTextBoost, kind: EvidenceValueKind.Conditional }\n return { strength: clamp(lineHeight.strength * alignmentStrengthCalibration.replacedLineHeightWeight, 0, 1), kind: lineHeight.kind }\n}\n\nfunction resolveContentCompositionStrength(input: AlignmentCase): { evidence: StrengthEvidence; divergence: CompositionDivergenceResult } {\n const divergence = resolveCompositionDivergence(input.subjectContentComposition, input.cohortContentCompositions, input.context)\n if (divergence.strength <= 0) return { evidence: { strength: 0, kind: EvidenceValueKind.Exact }, divergence }\n const kind: EvidenceValueKind = input.subjectContentComposition.classification === ContentCompositionClassification.Unknown ? EvidenceValueKind.Conditional : EvidenceValueKind.Exact\n return { evidence: { strength: clamp(divergence.strength, 0, 1), kind }, divergence }\n}\n\nfunction resolveContextCertaintyPenalty(input: AlignmentCase): StrengthEvidence {\n const kind = mapContextCertaintyToEvidenceKind(input.context.certainty)\n const coverage = clamp(input.factorCoverage[\"context-certainty\"], 0, 1)\n return { strength: 1 - coverage, kind }\n}\n\nfunction mapContextCertaintyToEvidenceKind(certainty: ContextCertainty): EvidenceValueKind {\n if (certainty === ContextCertainty.Resolved) return EvidenceValueKind.Exact\n if (certainty === ContextCertainty.Conditional) return EvidenceValueKind.Conditional\n return EvidenceValueKind.Unknown\n}\n\nfunction buildEvidenceAtoms(\n input: AlignmentCase, offset: StrengthEvidence, declaredOffset: StrengthEvidence,\n baselineStrength: StrengthEvidence, contextStrength: StrengthEvidence,\n replacedStrength: StrengthEvidence, compositionStrength: StrengthEvidence,\n contextCertaintyPenalty: StrengthEvidence, provenance: EvidenceProvenance,\n): readonly EvidenceAtom[] {\n const out: EvidenceAtom[] = []\n pushAtom(out, \"offset-delta\", offset.kind, offset.strength, input.factorCoverage[\"offset-delta\"], provenance, \"support\")\n pushAtom(out, \"declared-offset-delta\", declaredOffset.kind, declaredOffset.strength, input.factorCoverage[\"declared-offset-delta\"], provenance, \"support\")\n pushAtom(out, \"baseline-conflict\", baselineStrength.kind, baselineStrength.strength, input.factorCoverage[\"baseline-conflict\"], provenance, \"support\")\n pushAtom(out, \"context-conflict\", contextStrength.kind, contextStrength.strength, input.factorCoverage[\"context-conflict\"], provenance, \"support\")\n pushAtom(out, \"replaced-control-risk\", replacedStrength.kind, replacedStrength.strength, input.factorCoverage[\"replaced-control-risk\"], provenance, \"support\")\n pushAtom(out, \"content-composition-conflict\", compositionStrength.kind, compositionStrength.strength, input.factorCoverage[\"content-composition-conflict\"], provenance, \"support\")\n pushAtom(out, \"context-certainty\", contextCertaintyPenalty.kind, contextCertaintyPenalty.strength, input.factorCoverage[\"context-certainty\"], provenance, \"penalty\")\n return out\n}\n\nfunction pushAtom(\n out: EvidenceAtom[], factorId: AlignmentFactorId, valueKind: EvidenceValueKind,\n strength: number, coverage: number, provenance: EvidenceProvenance, expectedPolarity: \"support\" | \"penalty\",\n): void {\n if (strength <= 0) return\n const contract = ALIGNMENT_FACTOR_CONTRACTS[factorId]\n const contribution = expectedPolarity === \"support\"\n ? toPositiveContribution(strength, contract.maxMagnitude, valueKind)\n : toNegativeContribution(strength, contract.maxMagnitude, valueKind)\n out.push({ factorId, valueKind, contribution, provenance, relevanceWeight: clamp(strength, 0, 1), coverage: clamp(coverage, 0, 1) })\n}\n\nfunction toPositiveContribution(strength: number, maxWeight: number, valueKind: EvidenceValueKind): LogOddsInterval {\n const contribution = clamp(strength, 0, 2) * maxWeight\n if (valueKind === EvidenceValueKind.Exact) return { min: contribution, max: contribution }\n if (valueKind === EvidenceValueKind.Interval) return { min: contribution * evidenceContributionCalibration.supportIntervalLowerScale, max: contribution }\n if (valueKind === EvidenceValueKind.Conditional) return { min: 0, max: contribution * evidenceContributionCalibration.supportConditionalUpperScale }\n return { min: 0, max: 0 }\n}\n\nfunction toNegativeContribution(strength: number, maxPenalty: number, valueKind: EvidenceValueKind): LogOddsInterval {\n const penalty = clamp(strength, 0, 1) * maxPenalty\n if (valueKind === EvidenceValueKind.Exact) return { min: -penalty, max: -penalty }\n if (valueKind === EvidenceValueKind.Interval) return { min: -penalty, max: -penalty * evidenceContributionCalibration.penaltyIntervalUpperScale }\n if (valueKind === EvidenceValueKind.Conditional) return { min: -penalty, max: 0 }\n return { min: -penalty, max: 0 }\n}\n\n\n// ── Consistency policy (from consistency-policy.ts) ───────────────────────\n\nfunction applyConsistencyPolicy(evidence: ConsistencyEvidence): {\n readonly kind: \"accept\"; readonly severity: number; readonly confidence: number; readonly posterior: PosteriorInterval; readonly evidenceMass: number; readonly topFactors: readonly AlignmentFactorId[]\n} | {\n readonly kind: \"reject\"; readonly reason: \"low-evidence\" | \"threshold\" | \"undecidable\"; readonly detail: \"evidence-mass\" | \"posterior\" | \"interval\" | \"identifiability\"; readonly posterior: PosteriorInterval; readonly evidenceMass: number\n} {\n const evidenceMass = resolveEvidenceMass(evidence)\n const posterior = resolvePosteriorBounds(evidence)\n\n if (evidence.identifiability.ambiguous) return { kind: \"reject\", reason: \"undecidable\", detail: \"identifiability\", posterior, evidenceMass }\n if (posterior.lower >= alignmentPolicyCalibration.posteriorThreshold) {\n return { kind: \"accept\", severity: resolveSeverity(evidence, posterior), confidence: resolveConfidence(posterior, evidenceMass), posterior, evidenceMass, topFactors: selectTopFactors(evidence) }\n }\n if (posterior.upper < alignmentPolicyCalibration.posteriorThreshold) return { kind: \"reject\", reason: \"threshold\", detail: \"posterior\", posterior, evidenceMass }\n return { kind: \"reject\", reason: \"undecidable\", detail: \"interval\", posterior, evidenceMass }\n}\n\nfunction resolvePosteriorBounds(evidence: ConsistencyEvidence): PosteriorInterval {\n let minLogOdds = alignmentPolicyCalibration.priorLogOdds\n let maxLogOdds = alignmentPolicyCalibration.priorLogOdds\n for (let i = 0; i < evidence.atoms.length; i++) {\n const atom = evidence.atoms[i]\n if (!atom) continue\n minLogOdds += atom.contribution.min\n maxLogOdds += atom.contribution.max\n }\n return { lower: logistic(minLogOdds), upper: logistic(maxLogOdds) }\n}\n\nfunction resolveEvidenceMass(evidence: ConsistencyEvidence): number {\n if (evidence.atoms.length === 0) return 0\n let coverageWeightedSum = 0\n let contributionWeightSum = 0\n for (let i = 0; i < evidence.atoms.length; i++) {\n const atom = evidence.atoms[i]\n if (!atom) continue\n const meanContribution = Math.abs((atom.contribution.min + atom.contribution.max) / 2)\n if (meanContribution <= 0) continue\n const weight = clamp(meanContribution, 0, 4)\n coverageWeightedSum += clamp(atom.coverage, 0, 1) * weight\n contributionWeightSum += weight\n }\n if (contributionWeightSum <= 0) return 0\n return clamp(coverageWeightedSum / contributionWeightSum, 0, 1)\n}\n\nfunction resolveSeverity(evidence: ConsistencyEvidence, posterior: PosteriorInterval): number {\n const midpoint = (posterior.lower + posterior.upper) / 2\n return clamp(\n midpoint * alignmentPolicyCalibration.severityPosteriorWeight\n + evidence.offsetStrength * alignmentPolicyCalibration.severityOffsetWeight\n + evidence.baselineStrength * alignmentPolicyCalibration.severityBaselineWeight, 0, 1)\n}\n\nfunction resolveConfidence(posterior: PosteriorInterval, evidenceMass: number): number {\n const intervalWidth = posterior.upper - posterior.lower\n const weightedMass = alignmentPolicyCalibration.confidenceMassFloor + evidenceMass * alignmentPolicyCalibration.confidenceMassWeight\n return clamp(posterior.lower * weightedMass * (1 - intervalWidth * alignmentPolicyCalibration.confidenceIntervalPenalty), 0, 1)\n}\n\nfunction selectTopFactors(evidence: ConsistencyEvidence): readonly AlignmentFactorId[] {\n const atoms = evidence.atoms\n if (atoms.length === 0) return []\n const top: { id: AlignmentFactorId; mag: number }[] = []\n for (let i = 0; i < atoms.length; i++) {\n const atom = atoms[i]\n if (!atom) continue\n const mag = Math.abs((atom.contribution.min + atom.contribution.max) / 2)\n if (mag <= 0) continue\n if (top.length < 4) { top.push({ id: atom.factorId, mag }); continue }\n let minIdx = 0\n for (let j = 1; j < top.length; j++) { const curr = top[j]; const best = top[minIdx]; if (curr && best && curr.mag < best.mag) minIdx = j }\n const minEntry = top[minIdx]\n if (minEntry && mag > minEntry.mag) top[minIdx] = { id: atom.factorId, mag }\n }\n top.sort((a, b) => { if (a.mag !== b.mag) return b.mag - a.mag; if (a.id < b.id) return -1; if (a.id > b.id) return 1; return 0 })\n return top.map(t => t.id)\n}\n\nfunction logistic(value: number): number {\n if (value > 30) return 1\n if (value < -30) return 0\n return 1 / (1 + Math.exp(-value))\n}\n\n\n// ── Scoring — evaluateAlignmentCase (from scoring.ts) ─────────────────────\n\nexport type AlignmentEvaluationDecision =\n | { readonly kind: \"accept\"; readonly evaluation: AlignmentEvaluation }\n | { readonly kind: \"reject\"; readonly reason: \"low-evidence\" | \"threshold\" | \"undecidable\"; readonly detail?: \"evidence-mass\" | \"posterior\" | \"interval\" | \"identifiability\"; readonly posterior: PosteriorInterval; readonly evidenceMass: number }\n\nexport function scoreAlignmentCase(input: AlignmentCase): AlignmentEvaluationDecision {\n const evidence = buildConsistencyEvidence(input)\n const policy = applyConsistencyPolicy(evidence)\n\n if (policy.kind === \"reject\") {\n return { kind: \"reject\", reason: policy.reason, detail: policy.detail, posterior: policy.posterior, evidenceMass: policy.evidenceMass }\n }\n\n const signalFindings = buildFindingsFromAtoms(evidence.atoms, input, evidence)\n\n return {\n kind: \"accept\",\n evaluation: {\n severity: round(policy.severity),\n confidence: round(policy.confidence),\n declaredOffsetPx: input.subjectDeclaredOffsetDeviation.value === null ? null : round(input.subjectDeclaredOffsetDeviation.value),\n estimatedOffsetPx: input.subjectEffectiveOffsetDeviation.value === null ? null : round(input.subjectEffectiveOffsetDeviation.value),\n contextKind: input.context.kind,\n contextCertainty: input.context.certainty,\n posterior: { lower: round(policy.posterior.lower), upper: round(policy.posterior.upper) },\n evidenceMass: round(policy.evidenceMass),\n topFactors: policy.topFactors,\n signalFindings,\n },\n }\n}\n\nfunction buildFindingsFromAtoms(atoms: readonly EvidenceAtom[], input: AlignmentCase, _evidence: ConsistencyEvidence): readonly AlignmentSignalFinding[] {\n const byKind = new Map<AlignmentFindingKind, AlignmentSignalFinding>()\n for (let i = 0; i < atoms.length; i++) {\n const atom = atoms[i]\n if (!atom) continue\n const factor = toFindingFactor(atom.factorId, input)\n if (factor === null) continue\n const meanContribution = (atom.contribution.min + atom.contribution.max) / 2\n if (meanContribution <= 0) continue\n const weight = clamp(Math.abs(meanContribution), 0, 1)\n const next: AlignmentSignalFinding = { kind: factor.kind, message: factor.message, fix: factor.fix, weight }\n const existing = byKind.get(factor.kind)\n if (!existing) { byKind.set(factor.kind, next); continue }\n if (next.weight > existing.weight) byKind.set(factor.kind, next)\n }\n return [...byKind.values()]\n}\n\nfunction toFindingFactor(factorId: AlignmentFactorId, input: AlignmentCase): { kind: AlignmentFindingKind; message: string; fix: string } | null {\n switch (factorId) {\n case \"offset-delta\": return { kind: \"offset-delta\", message: \"block-axis offset differs from siblings\", fix: \"normalize margin/padding to match sibling cohort\" }\n case \"declared-offset-delta\": return { kind: \"declared-offset-delta\", message: \"declared block-axis offset differs from siblings\", fix: \"remove or unify the offset\" }\n case \"baseline-conflict\": return { kind: \"baseline-conflict\", message: \"baseline/line-height mismatch between siblings\", fix: \"unify line-height or add vertical-align\" }\n case \"context-conflict\": return { kind: \"context-conflict\", message: \"container and child alignment conflict\", fix: \"check align-items on the parent\" }\n case \"replaced-control-risk\": return { kind: \"replaced-control-risk\", message: \"replaced element baseline differs from text siblings\", fix: \"add vertical-align: middle to the replaced element\" }\n case \"content-composition-conflict\": return { kind: \"content-composition-conflict\", message: \"content composition differs from siblings\", fix: formatCompositionFixSuggestion(input.subjectContentComposition) }\n default: return null\n }\n}\n\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000\n}\n\n\n// ── Diagnostics (from diagnostics.ts) ─────────────────────────────────────\n\nconst FINDING_WEIGHT_BY_KIND = new Map<string, number>([\n [\"offset-delta\", 0], [\"declared-offset-delta\", 1], [\"baseline-conflict\", 2],\n [\"context-conflict\", 3], [\"replaced-control-risk\", 4], [\"content-composition-conflict\", 5],\n])\n\nexport function formatAlignmentCauses(findings: readonly AlignmentSignalFinding[]): readonly string[] {\n const ordered = findings.toSorted((left, right) => {\n const leftWeight = FINDING_WEIGHT_BY_KIND.get(left.kind) ?? Number.MAX_SAFE_INTEGER\n const rightWeight = FINDING_WEIGHT_BY_KIND.get(right.kind) ?? Number.MAX_SAFE_INTEGER\n if (leftWeight !== rightWeight) return leftWeight - rightWeight\n if (left.weight !== right.weight) return right.weight - left.weight\n if (left.message < right.message) return -1\n if (left.message > right.message) return 1\n return 0\n })\n const out: string[] = []\n for (let i = 0; i < ordered.length; i++) {\n const finding = ordered[i]\n if (!finding) continue\n const message = finding.message.trim()\n if (message.length === 0) continue\n out.push(message)\n }\n return out\n}\n\nexport function formatPrimaryFix(findings: readonly AlignmentSignalFinding[]): string {\n if (findings.length === 0) return \"\"\n let best: AlignmentSignalFinding | null = null\n for (let i = 0; i < findings.length; i++) {\n const finding = findings[i]\n if (!finding) continue\n if (best === null || finding.weight > best.weight) best = finding\n }\n if (best === null) return \"\"\n return best.fix\n}\n","/**\n * Conditional delta types + computation.\n *\n * Moved from cross-file/layout/cascade-builder.ts buildConditionalDeltaIndex.\n */\nimport { splitWhitespaceTokens } from \"../../css/parser/value-tokenizer\"\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { ElementCascade, MonitoredDeclaration } from \"../binding/cascade-binder\"\nimport { SignalGuardKind } from \"../binding/cascade-binder\"\nimport type { LayoutSignalName } from \"../binding/signal-builder\"\nimport { layoutOffsetSignals, parseOffsetPx } from \"./alignment\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\n\nexport interface ConditionalSignalDelta {\n readonly hasConditional: boolean\n readonly hasDelta: boolean\n readonly conditionalValues: readonly string[]\n readonly unconditionalValues: readonly string[]\n readonly hasConditionalScrollValue: boolean\n readonly hasConditionalNonScrollValue: boolean\n readonly hasUnconditionalScrollValue: boolean\n readonly hasUnconditionalNonScrollValue: boolean\n}\n\nexport interface ConditionalDeltaIndex {\n readonly deltaByElementId: ReadonlyMap<number, ReadonlyMap<LayoutSignalName, ConditionalSignalDelta>>\n readonly elementsWithDeltaBySignal: ReadonlyMap<LayoutSignalName, readonly ElementNode[]>\n readonly baselineOffsetsByElementId: ReadonlyMap<number, ReadonlyMap<LayoutSignalName, readonly number[]>>\n}\n\nconst SCROLLABLE_VALUES: ReadonlySet<string> = new Set([\"auto\", \"scroll\"])\n\nexport function computeConditionalDelta(\n elements: readonly ElementNode[],\n cascadeByElementId: ReadonlyMap<number, ElementCascade>,\n monitoredDeclarationsBySelectorId: ReadonlyMap<number, readonly MonitoredDeclaration[]>,\n symbolTable: SymbolTable,\n): ConditionalDeltaIndex {\n const deltaByElementId = new Map<number, ReadonlyMap<LayoutSignalName, ConditionalSignalDelta>>()\n const elementsWithDeltaBySignal = new Map<LayoutSignalName, ElementNode[]>()\n const baselineOffsetsByElementId = new Map<number, ReadonlyMap<LayoutSignalName, readonly number[]>>()\n\n for (let i = 0; i < elements.length; i++) {\n const node = elements[i]\n if (!node) continue\n\n const cascade = cascadeByElementId.get(node.elementId)\n const edges = cascade?.edges\n let factByProperty: ReadonlyMap<LayoutSignalName, ConditionalSignalDelta> | null = null\n\n if (edges !== undefined && edges.length > 0) {\n const byProperty = new Map<LayoutSignalName, { conditional: Set<string>; unconditional: Set<string> }>()\n let conditionalAttributeDispatch: Map<LayoutSignalName, Map<string, string>> | null = null\n\n for (let j = 0; j < edges.length; j++) {\n const currentEdge = edges[j]\n if (!currentEdge) continue\n const declarations = monitoredDeclarationsBySelectorId.get(currentEdge.selectorId)\n if (!declarations) continue\n\n let conditionalAttributeName: string | null = null\n if (currentEdge.conditionalMatch) {\n conditionalAttributeName = identifyConditionalAttribute(currentEdge.selectorId, node, symbolTable)\n }\n\n for (let k = 0; k < declarations.length; k++) {\n const declaration = declarations[k]\n if (!declaration) continue\n const property = declaration.property\n const value = declaration.value.trim().toLowerCase()\n\n let bucket = byProperty.get(property)\n if (!bucket) {\n bucket = { conditional: new Set<string>(), unconditional: new Set<string>() }\n byProperty.set(property, bucket)\n }\n\n if (declaration.guardProvenance.kind === SignalGuardKind.Conditional || currentEdge.conditionalMatch) {\n bucket.conditional.add(value)\n if (conditionalAttributeName !== null && declaration.guardProvenance.kind !== SignalGuardKind.Conditional) {\n if (conditionalAttributeDispatch === null) conditionalAttributeDispatch = new Map()\n let dispatchMap = conditionalAttributeDispatch.get(property)\n if (!dispatchMap) {\n dispatchMap = new Map()\n conditionalAttributeDispatch.set(property, dispatchMap)\n }\n dispatchMap.set(value, conditionalAttributeName)\n }\n continue\n }\n bucket.unconditional.add(value)\n }\n }\n\n if (byProperty.size > 0) {\n const facts = new Map<LayoutSignalName, ConditionalSignalDelta>()\n for (const [property, bucket] of byProperty) {\n const unconditionalValues = [...bucket.unconditional]\n const conditionalValues = [...bucket.conditional]\n const hasConditional = conditionalValues.length > 0\n if (!hasConditional) continue\n\n let hasDelta = unconditionalValues.length === 0\n if (!hasDelta) {\n for (let k = 0; k < conditionalValues.length; k++) {\n const condVal = conditionalValues[k]\n if (condVal === undefined) continue\n if (!bucket.unconditional.has(condVal)) {\n hasDelta = true\n break\n }\n }\n }\n\n if (hasDelta && conditionalAttributeDispatch !== null) {\n const dispatchMap = conditionalAttributeDispatch.get(property)\n if (dispatchMap !== undefined && dispatchMap.size === conditionalValues.length) {\n let singleAttribute: string | null = null\n let allSameAttribute = true\n for (const attrName of dispatchMap.values()) {\n if (singleAttribute === null) {\n singleAttribute = attrName\n } else if (singleAttribute !== attrName) {\n allSameAttribute = false\n break\n }\n }\n if (allSameAttribute && singleAttribute !== null) {\n hasDelta = false\n }\n }\n }\n\n const scrollProfile = buildScrollValueProfile(property, conditionalValues, unconditionalValues)\n\n facts.set(property, {\n hasConditional,\n hasDelta,\n conditionalValues,\n unconditionalValues,\n hasConditionalScrollValue: scrollProfile.hasConditionalScrollValue,\n hasConditionalNonScrollValue: scrollProfile.hasConditionalNonScrollValue,\n hasUnconditionalScrollValue: scrollProfile.hasUnconditionalScrollValue,\n hasUnconditionalNonScrollValue: scrollProfile.hasUnconditionalNonScrollValue,\n })\n }\n\n if (facts.size > 0) {\n factByProperty = facts\n deltaByElementId.set(node.elementId, facts)\n\n for (const [signal, fact] of facts) {\n if (!fact.hasConditional) continue\n const existing = elementsWithDeltaBySignal.get(signal)\n if (existing) {\n existing.push(node)\n continue\n }\n elementsWithDeltaBySignal.set(signal, [node])\n }\n }\n }\n }\n\n const baselineBySignal = new Map<LayoutSignalName, readonly number[]>()\n for (let j = 0; j < layoutOffsetSignals.length; j++) {\n const signal = layoutOffsetSignals[j]\n if (!signal) continue\n const values = new Set<number>()\n const conditionalFact = factByProperty?.get(signal)\n\n if (conditionalFact) {\n for (let k = 0; k < conditionalFact.unconditionalValues.length; k++) {\n const uncondVal = conditionalFact.unconditionalValues[k]\n if (uncondVal === undefined) continue\n const px = parseOffsetPx(signal, uncondVal)\n if (px === null) continue\n values.add(px)\n }\n }\n\n const inlineValue = node.inlineStyleValues.get(signal)\n if (inlineValue) {\n const inlinePx = parseOffsetPx(signal, inlineValue)\n if (inlinePx !== null) values.add(inlinePx)\n }\n\n if (values.size === 0) continue\n baselineBySignal.set(signal, [...values])\n }\n\n if (baselineBySignal.size > 0) {\n baselineOffsetsByElementId.set(node.elementId, baselineBySignal)\n }\n }\n\n return {\n deltaByElementId,\n elementsWithDeltaBySignal,\n baselineOffsetsByElementId,\n }\n}\n\nfunction identifyConditionalAttribute(\n selectorId: number,\n node: ElementNode,\n symbolTable: SymbolTable,\n): string | null {\n const symbol = symbolTable.selectors.get(selectorId)\n if (!symbol) return null\n\n const selector = symbol.entity\n const constraints = selector.anchor.attributes\n let dynamicAttributeName: string | null = null\n\n for (let i = 0; i < constraints.length; i++) {\n const constraint = constraints[i]\n if (!constraint) continue\n if (constraint.operator !== \"equals\") continue\n if (constraint.value === null) continue\n\n const elementValue = node.attributes.get(constraint.name)\n if (elementValue !== null) continue\n if (dynamicAttributeName !== null && dynamicAttributeName !== constraint.name) {\n return null\n }\n dynamicAttributeName = constraint.name\n }\n\n return dynamicAttributeName\n}\n\nfunction buildScrollValueProfile(\n property: LayoutSignalName,\n conditionalValues: readonly string[],\n unconditionalValues: readonly string[],\n): {\n hasConditionalScrollValue: boolean\n hasConditionalNonScrollValue: boolean\n hasUnconditionalScrollValue: boolean\n hasUnconditionalNonScrollValue: boolean\n} {\n if (property !== \"overflow\" && property !== \"overflow-y\") {\n return {\n hasConditionalScrollValue: false,\n hasConditionalNonScrollValue: false,\n hasUnconditionalScrollValue: false,\n hasUnconditionalNonScrollValue: false,\n }\n }\n\n let hasConditionalScrollValue = false\n let hasConditionalNonScrollValue = false\n let hasUnconditionalScrollValue = false\n let hasUnconditionalNonScrollValue = false\n\n for (let i = 0; i < conditionalValues.length; i++) {\n const condVal = conditionalValues[i]\n if (condVal === undefined) continue\n if (containsScrollToken(condVal)) {\n hasConditionalScrollValue = true\n continue\n }\n hasConditionalNonScrollValue = true\n }\n\n for (let i = 0; i < unconditionalValues.length; i++) {\n const uncondVal = unconditionalValues[i]\n if (uncondVal === undefined) continue\n if (containsScrollToken(uncondVal)) {\n hasUnconditionalScrollValue = true\n continue\n }\n hasUnconditionalNonScrollValue = true\n }\n\n return {\n hasConditionalScrollValue,\n hasConditionalNonScrollValue,\n hasUnconditionalScrollValue,\n hasUnconditionalNonScrollValue,\n }\n}\n\nfunction containsScrollToken(value: string): boolean {\n const tokens = splitWhitespaceTokens(value)\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (token === undefined) continue\n if (SCROLLABLE_VALUES.has(token)) return true\n }\n return false\n}\n","/**\n * Stateful analysis types + computation.\n *\n * Moved from cross-file/layout/stateful-rule-index.ts.\n */\nimport type { AtRuleEntity, RuleEntity } from \"../../css/entities\"\nimport { extractPseudoClasses, normalizeSelector, parseSelectorList } from \"../../css/parser/selector\"\nimport { LAYOUT_STATEFUL_SHIFT_PROPERTIES } from \"../../css/layout-taxonomy\"\nimport { expandShorthand } from \"../binding/cascade-binder\"\n\nexport interface StatefulSelectorEntry {\n readonly raw: string\n readonly isStateful: boolean\n readonly statePseudoClasses: readonly string[]\n readonly isDirectInteraction: boolean\n readonly baseLookupKeys: readonly string[]\n}\n\nexport interface NormalizedRuleDeclaration {\n readonly declarationId: number\n readonly property: string\n readonly normalizedValue: string\n readonly filePath: string\n readonly startLine: number\n readonly startColumn: number\n readonly propertyLength: number\n}\n\nexport interface StatefulRuleIndexes {\n readonly selectorEntriesByRuleId: ReadonlyMap<number, readonly StatefulSelectorEntry[]>\n readonly normalizedDeclarationsByRuleId: ReadonlyMap<number, readonly NormalizedRuleDeclaration[]>\n readonly baseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>\n}\n\n\n// ── Constants ────────────────────────────────────────────────────────────\n\nconst EMPTY_STATEFUL_SELECTOR_ENTRY_LIST: readonly StatefulSelectorEntry[] = []\nconst EMPTY_NORMALIZED_DECLARATION_LIST: readonly NormalizedRuleDeclaration[] = []\nconst EMPTY_STRING_LIST: readonly string[] = []\nconst CLASS_SELECTOR_RE = /\\.[_a-zA-Z][_a-zA-Z0-9-]*/g\nconst SIMPLE_SELECTOR_COMBINATOR_RE = /[\\s>+~]/\n\nconst STATE_PSEUDO_CLASSIFICATION = new Map<string, \"direct\" | \"indirect\">([\n [\"hover\", \"direct\"],\n [\"focus\", \"direct\"],\n [\"focus-visible\", \"direct\"],\n [\"active\", \"direct\"],\n [\"checked\", \"indirect\"],\n [\"target\", \"indirect\"],\n])\nconst STATE_PSEUDO_SET = new Set(STATE_PSEUDO_CLASSIFICATION.keys())\nconst STATE_PSEUDO_STRIP_RE = /:hover\\b|:focus-visible\\b|:focus\\b|:active\\b|:checked\\b|:target\\b/g\nconst PSEUDO_FUNCTION_RE = /:(?:has|not)\\(/i\nconst STATE_IS_WHERE_RE = /:(?:is|where)\\(\\s*(?::hover|:focus-visible|:focus|:active|:checked|:target)(?:\\s*,\\s*(?::hover|:focus-visible|:focus|:active|:checked|:target))*\\s*\\)/g\n\n\n// ── buildStatefulRuleIndexes ─────────────────────────────────────────────\n\nexport function buildStatefulRuleIndexes(rules: readonly RuleEntity[]): StatefulRuleIndexes {\n const selectorEntriesByRuleId = new Map<number, readonly StatefulSelectorEntry[]>()\n const normalizedDeclarationsByRuleId = new Map<number, readonly NormalizedRuleDeclaration[]>()\n const baseValueIndex = new Map<string, Map<string, Set<string>>>()\n const selectorKeyCache = new Map<string, readonly string[]>()\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i]\n if (!rule) continue\n const selectorEntries = buildStatefulSelectorEntries(rule.selectorText, selectorKeyCache)\n selectorEntriesByRuleId.set(rule.id, selectorEntries)\n\n const normalizedDeclarations = buildStatefulNormalizedDeclarations(rule)\n normalizedDeclarationsByRuleId.set(rule.id, normalizedDeclarations)\n\n if (isConditionalRule(rule)) continue\n if (selectorEntries.length === 0) continue\n if (normalizedDeclarations.length === 0) continue\n\n for (let j = 0; j < selectorEntries.length; j++) {\n const selector = selectorEntries[j]\n if (!selector) continue\n if (selector.isStateful) continue\n if (selector.baseLookupKeys.length === 0) continue\n\n for (let k = 0; k < selector.baseLookupKeys.length; k++) {\n const selectorKey = selector.baseLookupKeys[k]\n if (!selectorKey) continue\n let propertyMap = baseValueIndex.get(selectorKey)\n if (!propertyMap) {\n propertyMap = new Map<string, Set<string>>()\n baseValueIndex.set(selectorKey, propertyMap)\n }\n\n for (let n = 0; n < normalizedDeclarations.length; n++) {\n const declaration = normalizedDeclarations[n]\n if (!declaration) continue\n if (declaration.property === \"position\") {\n addStatefulValue(propertyMap, declaration.property, declaration.normalizedValue)\n continue\n }\n\n addStatefulPropertyValue(propertyMap, declaration.property, declaration.normalizedValue)\n }\n }\n }\n }\n\n return {\n selectorEntriesByRuleId,\n normalizedDeclarationsByRuleId,\n baseValueIndex,\n }\n}\n\nfunction buildStatefulSelectorEntries(\n selectorText: string,\n selectorKeyCache: Map<string, readonly string[]>,\n): readonly StatefulSelectorEntry[] {\n const parsed = parseSelectorList(selectorText)\n if (parsed.length === 0) return EMPTY_STATEFUL_SELECTOR_ENTRY_LIST\n\n const entries: StatefulSelectorEntry[] = []\n for (let i = 0; i < parsed.length; i++) {\n const rawEntry = parsed[i]\n if (!rawEntry) continue\n const raw = rawEntry.trim()\n if (raw.length === 0) continue\n\n const normalized = normalizeSelector(raw.toLowerCase())\n if (normalized.length === 0) continue\n\n const statePseudoClasses = classifyStatefulSelector(normalized)\n const isStateful = statePseudoClasses.length > 0\n const isDirectInteraction = isStateful && isAllDirectInteraction(statePseudoClasses)\n const baseSelector = isStateful ? toBaseSelector(normalized) : normalized\n const baseLookupKeys = baseSelector ? getSelectorLookupKeys(baseSelector, selectorKeyCache) : EMPTY_STRING_LIST\n entries.push({\n raw,\n isStateful,\n statePseudoClasses,\n isDirectInteraction,\n baseLookupKeys,\n })\n }\n\n if (entries.length === 0) return EMPTY_STATEFUL_SELECTOR_ENTRY_LIST\n return entries\n}\n\nfunction buildStatefulNormalizedDeclarations(rule: RuleEntity): readonly NormalizedRuleDeclaration[] {\n const out: NormalizedRuleDeclaration[] = []\n\n for (let i = 0; i < rule.declarations.length; i++) {\n const declaration = rule.declarations[i]\n if (!declaration) continue\n const property = declaration.property.toLowerCase()\n if (!LAYOUT_STATEFUL_SHIFT_PROPERTIES.has(property) && property !== \"position\") continue\n\n out.push({\n declarationId: declaration.id,\n property,\n normalizedValue: declaration.value.trim().toLowerCase(),\n filePath: declaration.file.path,\n startLine: declaration.startLine,\n startColumn: declaration.startColumn,\n propertyLength: declaration.property.length,\n })\n }\n\n if (out.length === 0) return EMPTY_NORMALIZED_DECLARATION_LIST\n return out\n}\n\nfunction addStatefulPropertyValue(propertyMap: Map<string, Set<string>>, property: string, normalizedValue: string): void {\n addStatefulValue(propertyMap, property, normalizedValue)\n\n const expanded = expandShorthand(property, normalizedValue)\n if (expanded === undefined || expanded === null) return\n for (let i = 0; i < expanded.length; i++) {\n const entry = expanded[i]\n if (!entry) continue\n addStatefulValue(propertyMap, entry.name, entry.value)\n }\n}\n\nfunction addStatefulValue(propertyMap: Map<string, Set<string>>, property: string, value: string): void {\n let values = propertyMap.get(property)\n if (!values) {\n values = new Set<string>()\n propertyMap.set(property, values)\n }\n values.add(value)\n}\n\nfunction getSelectorLookupKeys(\n selector: string,\n selectorKeyCache: Map<string, readonly string[]>,\n): readonly string[] {\n const existing = selectorKeyCache.get(selector)\n if (existing) return existing\n\n const canonical = canonicalizeClassOrder(selector)\n const keys = !canonical || canonical === selector\n ? [selector]\n : [selector, canonical]\n selectorKeyCache.set(selector, keys)\n return keys\n}\n\nfunction canonicalizeClassOrder(selector: string): string | null {\n if (selector.length === 0) return null\n if (SIMPLE_SELECTOR_COMBINATOR_RE.test(selector)) return null\n if (selector.includes(\"[\")) return null\n if (selector.includes(\":\")) return null\n if (selector.indexOf(\".\") === -1) return null\n\n const classTokens = selector.match(CLASS_SELECTOR_RE)\n if (!classTokens || classTokens.length < 2) return null\n\n const sorted = classTokens.toSorted()\n const withoutClasses = selector.replace(CLASS_SELECTOR_RE, \"\")\n return normalizeSelector(`${withoutClasses}${sorted.join(\"\")}`)\n}\n\nfunction classifyStatefulSelector(selector: string): readonly string[] {\n const pseudoClasses = extractPseudoClasses(selector)\n const matched: string[] = []\n for (let i = 0; i < pseudoClasses.length; i++) {\n const pc = pseudoClasses[i]\n if (!pc) continue\n if (STATE_PSEUDO_SET.has(pc)) matched.push(pc)\n }\n return matched\n}\n\nfunction isAllDirectInteraction(pseudoClasses: readonly string[]): boolean {\n for (let i = 0; i < pseudoClasses.length; i++) {\n const pc = pseudoClasses[i]\n if (!pc) continue\n if (STATE_PSEUDO_CLASSIFICATION.get(pc) !== \"direct\") return false\n }\n return true\n}\n\nfunction toBaseSelector(selector: string): string | null {\n if (PSEUDO_FUNCTION_RE.test(selector)) return null\n\n const stripped = selector\n .replace(STATE_IS_WHERE_RE, \"\")\n .replace(STATE_PSEUDO_STRIP_RE, \"\")\n const normalized = normalizeSelector(stripped)\n if (normalized.length === 0) return null\n return normalized\n}\n\nfunction isConditionalRule(rule: RuleEntity): boolean {\n let current: RuleEntity | AtRuleEntity | null = rule.parent\n\n while (current) {\n if (current.kind === \"rule\") {\n current = current.parent\n continue\n }\n\n if (current.kind === \"media\" || current.kind === \"supports\" || current.kind === \"container\") {\n return true\n }\n current = current.parent\n }\n\n return false\n}\n","import type { SolidSyntaxTree } from \"../core/solid-syntax-tree\"\nimport type { StyleCompilation } from \"../core/compilation\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { ClassNameSymbol } from \"../symbols/class-name\"\nimport type { SelectorSymbol } from \"../symbols/selector\"\nimport type { CustomPropertySymbol } from \"../symbols/custom-property\"\nimport type { ComponentHostSymbol } from \"../symbols/component-host\"\nimport type { DependencyGraph } from \"../incremental/dependency-graph\"\nimport type { VariableEntity } from \"../../solid/entities/variable\"\nimport type { ComputationEntity, DependencyEdge } from \"../../solid/entities/computation\"\nimport type { ImportEntity } from \"../../solid/entities/import\"\nimport type { VariableReferenceEntity } from \"../../css/entities/variable\"\nimport type { RuleEntity } from \"../../css/entities/rule\"\nimport type { ElementNode } from \"./element-builder\"\nimport { buildElementNodes } from \"./element-builder\"\nimport type { ElementCascade, MonitoredDeclaration, SelectorMatch } from \"./cascade-binder\"\nimport { bind, computeLayoutFact, getOrBuildBindState } from \"./cascade-binder\"\nimport { buildScopedSelectorIndex } from \"./scope-resolver\"\nimport type { SignalSnapshot, LayoutSignalName } from \"./signal-builder\"\nimport { buildSignalSnapshot, SignalValueKind } from \"./signal-builder\"\nimport type { ScopedSelectorIndex } from \"./scope-resolver\"\nimport type { LayoutFactKind, LayoutFactMap } from \"../analysis/layout-fact\"\nimport { computeScrollContainerFact } from \"../analysis/layout-fact\"\nimport type { ConditionalSignalDelta } from \"../analysis/cascade-analyzer\"\nimport { computeConditionalDelta, type ConditionalDeltaIndex } from \"../analysis/cascade-analyzer\"\nimport type { AlignmentContext, CohortStats, SnapshotHotSignals } from \"../analysis/alignment\"\nimport { createAlignmentContextForParent, buildCohortIndex, computeHotSignals, buildMeasurementNodeIndex, finalizeTableCellBaselineRelevance } from \"../analysis/alignment\"\nimport type { StatefulSelectorEntry, NormalizedRuleDeclaration } from \"../analysis/statefulness\"\nimport { buildStatefulRuleIndexes, type StatefulRuleIndexes } from \"../analysis/statefulness\"\n\n// ── Types owned by semantic-model ────────────────────────────────────────\n\nexport interface CustomPropertyResolution {\n readonly resolved: boolean\n readonly symbol: CustomPropertySymbol | null\n readonly value: string | null\n readonly unresolvedReferences: readonly VariableReferenceEntity[]\n}\n\nexport type ReactiveKind = \"signal\" | \"props\" | \"store\" | \"resource\" | \"memo\" | \"derived\"\n\n// ── FileSemanticModel interface ──────────────────────────────────────────\n\nexport interface FileSemanticModel {\n readonly filePath: string\n readonly compilation: StyleCompilation\n readonly solidTree: SolidSyntaxTree\n\n getElementNode(elementId: number): ElementNode | null\n getElementNodes(): readonly ElementNode[]\n getElementCascade(elementId: number): ElementCascade\n getMatchingSelectors(elementId: number): readonly SelectorMatch[]\n getComponentHost(importSource: string, exportName: string): ComponentHostSymbol | null\n getElementsByTagName(tag: string): readonly ElementNode[]\n getLayoutFact<K extends LayoutFactKind>(elementId: number, factKind: K): LayoutFactMap[K]\n\n getSignalSnapshot(elementId: number): SignalSnapshot\n getConditionalDelta(elementId: number): ReadonlyMap<string, ConditionalSignalDelta> | null\n getBaselineOffsets(elementId: number): ReadonlyMap<LayoutSignalName, readonly number[]> | null\n\n getClassNameInfo(name: string): ClassNameSymbol | null\n getCustomPropertyResolution(name: string): CustomPropertyResolution\n getSelectorOverrides(selectorId: number): readonly SelectorSymbol[]\n\n getScopedCSSFiles(): readonly string[]\n getScopedSelectors(): ScopedSelectorIndex\n getImportChain(): readonly ImportEntity[]\n\n getReactiveKind(variable: VariableEntity): ReactiveKind | null\n getDependencyEdges(computation: ComputationEntity): readonly DependencyEdge[]\n\n getAlignmentContext(parentElementId: number): AlignmentContext | null\n getCohortStats(parentElementId: number): CohortStats | null\n\n getElementsWithConditionalDelta(signal: string): readonly ElementNode[]\n getScrollContainerElements(): readonly ElementNode[]\n getDynamicSlotCandidates(): readonly ElementNode[]\n getElementsByKnownSignalValue(signal: LayoutSignalName, value: string): readonly ElementNode[]\n\n getStatefulSelectorEntries(ruleId: number): readonly StatefulSelectorEntry[]\n getStatefulNormalizedDeclarations(ruleId: number): readonly NormalizedRuleDeclaration[]\n getStatefulBaseValueIndex(): ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>\n}\n\n// ── Factory ──────────────────────────────────────────────────────────────\n\nconst EMPTY_SCOPED_INDEX: ScopedSelectorIndex = {\n byDispatchKey: new Map(),\n byTagName: new Map(),\n requirements: { needsClassTokens: false, needsAttributes: false },\n}\n\nexport function createFileSemanticModel(\n solidTree: SolidSyntaxTree,\n symbolTable: SymbolTable,\n dependencyGraph: DependencyGraph,\n compilation: StyleCompilation,\n): FileSemanticModel {\n const filePath = solidTree.filePath\n\n let cachedCSSScope: readonly string[] | null = null\n let cachedScopedSelectors: ScopedSelectorIndex | null = null\n let cachedElementNodes: readonly ElementNode[] | null = null\n let cachedElementNodeById: Map<number, ElementNode> | null = null\n const cachedCascadeByElementId = new Map<number, ElementCascade>()\n\n // Phase 7 caches\n let cachedSnapshotByElementId: Map<number, SignalSnapshot> | null = null\n let cachedConditionalDeltaIndex: ConditionalDeltaIndex | null = null\n let cachedContextByParentId: Map<number, AlignmentContext> | null = null\n let cachedCohortStatsByParentId: ReadonlyMap<number, CohortStats> | null = null\n let cachedStatefulIndexes: StatefulRuleIndexes | null = null\n let cachedHotSignalsByElementId: Map<number, SnapshotHotSignals> | null = null\n\n function ensureSnapshotIndex(model: FileSemanticModel): Map<number, SignalSnapshot> {\n if (cachedSnapshotByElementId !== null) return cachedSnapshotByElementId\n const elements = model.getElementNodes()\n const snapshotById = new Map<number, SignalSnapshot>()\n\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n const cascade = model.getElementCascade(el.elementId)\n const parentSnapshot = el.parentElementNode\n ? snapshotById.get(el.parentElementNode.elementId) ?? null\n : null\n const snapshot = buildSignalSnapshot(el.elementId, cascade, parentSnapshot)\n snapshotById.set(el.elementId, snapshot)\n }\n cachedSnapshotByElementId = snapshotById\n return snapshotById\n }\n\n function ensureHotSignals(model: FileSemanticModel): Map<number, SnapshotHotSignals> {\n if (cachedHotSignalsByElementId !== null) return cachedHotSignalsByElementId\n const snapshotIndex = ensureSnapshotIndex(model)\n const out = new Map<number, SnapshotHotSignals>()\n for (const [id, snapshot] of snapshotIndex) {\n out.set(id, computeHotSignals(snapshot))\n }\n cachedHotSignalsByElementId = out\n return out\n }\n\n function ensureConditionalDeltaIndex(model: FileSemanticModel): ConditionalDeltaIndex {\n if (cachedConditionalDeltaIndex !== null) return cachedConditionalDeltaIndex\n const elements = model.getElementNodes()\n const cascadeByElementId = new Map<number, ElementCascade>()\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n cascadeByElementId.set(el.elementId, model.getElementCascade(el.elementId))\n }\n\n // Get monitored declarations from cascade-binder's bind state\n const bindState = getBindMonitoredDeclarations()\n cachedConditionalDeltaIndex = computeConditionalDelta(elements, cascadeByElementId, bindState, symbolTable)\n return cachedConditionalDeltaIndex\n }\n\n function getBindMonitoredDeclarations(): ReadonlyMap<number, readonly MonitoredDeclaration[]> {\n return getOrBuildBindState(symbolTable).monitoredDeclarationsBySelectorId\n }\n\n function ensureContextIndex(model: FileSemanticModel): Map<number, AlignmentContext> {\n if (cachedContextByParentId !== null) return cachedContextByParentId\n const elements = model.getElementNodes()\n const snapshotIndex = ensureSnapshotIndex(model)\n const childrenByParentId = buildChildrenByParentId(elements)\n const out = new Map<number, AlignmentContext>()\n\n for (const [parentId, children] of childrenByParentId) {\n if (children.length < 2) continue\n const snapshot = snapshotIndex.get(parentId)\n if (!snapshot) continue\n const parent = cachedElementNodeById?.get(parentId)\n if (!parent) continue\n out.set(parentId, createAlignmentContextForParent(parent, snapshot))\n }\n\n cachedContextByParentId = out\n return out\n }\n\n function ensureCohortStats(model: FileSemanticModel): ReadonlyMap<number, CohortStats> {\n if (cachedCohortStatsByParentId !== null) return cachedCohortStatsByParentId\n const elements = model.getElementNodes()\n const snapshotIndex = ensureSnapshotIndex(model)\n const hotSignals = ensureHotSignals(model)\n const childrenByParentId = buildChildrenByParentId(elements)\n const contextByParentId = ensureContextIndex(model)\n const measurementNodeByRootKey = buildMeasurementNodeIndex(elements, childrenByParentId, snapshotIndex)\n\n const cohortIndex = buildCohortIndex({\n childrenByParentId,\n contextByParentId,\n measurementNodeByRootKey,\n snapshotByElementId: snapshotIndex,\n hotSignalsByElementId: hotSignals,\n })\n\n finalizeTableCellBaselineRelevance(contextByParentId, cohortIndex.verticalAlignConsensusByParentId)\n cachedCohortStatsByParentId = cohortIndex.statsByParentId\n return cohortIndex.statsByParentId\n }\n\n function ensureStatefulIndexes(): StatefulRuleIndexes {\n if (cachedStatefulIndexes !== null) return cachedStatefulIndexes\n // Collect all CSS rules from the symbol table's selectors\n const rulesSeen = new Set<number>()\n const rules: RuleEntity[] = []\n for (const [, selector] of symbolTable.selectors) {\n const rule = selector.entity.rule\n if (rulesSeen.has(rule.id)) continue\n rulesSeen.add(rule.id)\n rules.push(rule)\n }\n cachedStatefulIndexes = buildStatefulRuleIndexes(rules)\n return cachedStatefulIndexes\n }\n\n function buildChildrenByParentId(elements: readonly ElementNode[]): Map<number, ElementNode[]> {\n const out = new Map<number, ElementNode[]>()\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n const parent = el.parentElementNode\n if (!parent) continue\n let bucket = out.get(parent.elementId)\n if (!bucket) { bucket = []; out.set(parent.elementId, bucket) }\n bucket.push(el)\n }\n return out\n }\n\n const reactiveVariables = solidTree.reactiveVariables\n const VALID_REACTIVE_KINDS = new Map<string, ReactiveKind>([\n [\"signal\", \"signal\"], [\"props\", \"props\"], [\"store\", \"store\"],\n [\"resource\", \"resource\"], [\"memo\", \"memo\"], [\"derived\", \"derived\"],\n ])\n const reactiveKindByVariableId = new Map<number, ReactiveKind>()\n for (let i = 0; i < reactiveVariables.length; i++) {\n const v = reactiveVariables[i]\n if (!v) continue\n if (v.reactiveKind !== null) {\n const validated = VALID_REACTIVE_KINDS.get(v.reactiveKind)\n if (validated !== undefined) reactiveKindByVariableId.set(v.id, validated)\n }\n }\n\n const edges = solidTree.dependencyEdges\n const edgesByConsumerId = new Map<number, DependencyEdge[]>()\n for (let i = 0; i < edges.length; i++) {\n const edge = edges[i]\n if (!edge) continue\n const consumerId = edge.consumer.id\n let bucket = edgesByConsumerId.get(consumerId)\n if (bucket === undefined) {\n bucket = []\n edgesByConsumerId.set(consumerId, bucket)\n }\n bucket.push(edge)\n }\n\n const EMPTY_EDGES: readonly DependencyEdge[] = []\n\n return {\n filePath,\n compilation,\n solidTree,\n\n // ── Tier 0-1: Symbol queries ───────────────────────────────────────\n\n getClassNameInfo(name: string): ClassNameSymbol | null {\n return symbolTable.getClassName(name)\n },\n\n getCustomPropertyResolution(name: string): CustomPropertyResolution {\n const symbol = symbolTable.getCustomProperty(name)\n return {\n resolved: symbol !== null,\n symbol,\n value: symbol !== null ? symbol.resolvedValue : null,\n unresolvedReferences: [],\n }\n },\n\n getSelectorOverrides(_selectorId: number): readonly SelectorSymbol[] {\n return [] // Phase 6\n },\n\n // ── Tier 0-1: Scope queries ────────────────────────────────────────\n\n getScopedCSSFiles(): readonly string[] {\n if (cachedCSSScope !== null) return cachedCSSScope\n cachedCSSScope = dependencyGraph.getCSSScope(filePath)\n return cachedCSSScope\n },\n\n getScopedSelectors(): ScopedSelectorIndex {\n if (cachedScopedSelectors !== null) return cachedScopedSelectors\n\n const scopedFiles = this.getScopedCSSFiles()\n if (scopedFiles.length === 0) {\n cachedScopedSelectors = EMPTY_SCOPED_INDEX\n return cachedScopedSelectors\n }\n\n cachedScopedSelectors = buildScopedSelectorIndex(scopedFiles, symbolTable)\n return cachedScopedSelectors\n },\n\n getImportChain(): readonly ImportEntity[] {\n return solidTree.imports\n },\n\n // ── Tier 0-1: Reactive queries ─────────────────────────────────────\n\n getReactiveKind(variable: VariableEntity): ReactiveKind | null {\n return reactiveKindByVariableId.get(variable.id) ?? null\n },\n\n getDependencyEdges(computation: ComputationEntity): readonly DependencyEdge[] {\n return edgesByConsumerId.get(computation.id) ?? EMPTY_EDGES\n },\n\n // ── Tier 2-3: Element + cascade queries ────────────────────────────\n\n getElementNode(elementId: number): ElementNode | null {\n const nodes = this.getElementNodes()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]\n if (node && node.elementId === elementId) return node\n }\n return null\n },\n\n getElementNodes(): readonly ElementNode[] {\n if (cachedElementNodes !== null) return cachedElementNodes\n cachedElementNodes = buildElementNodes(solidTree, this.compilation)\n cachedElementNodeById = new Map()\n for (let i = 0; i < cachedElementNodes.length; i++) {\n const node = cachedElementNodes[i]\n if (node) cachedElementNodeById.set(node.elementId, node)\n }\n return cachedElementNodes\n },\n\n getElementCascade(elementId: number): ElementCascade {\n const cached = cachedCascadeByElementId.get(elementId)\n if (cached !== undefined) return cached\n\n const element = cachedElementNodeById?.get(elementId) ?? this.getElementNode(elementId)\n if (element === null) {\n const empty: ElementCascade = { elementId, declarations: new Map(), edges: [] }\n cachedCascadeByElementId.set(elementId, empty)\n return empty\n }\n\n const scopedSelectors = this.getScopedSelectors()\n const cascade = bind(element, scopedSelectors, symbolTable)\n cachedCascadeByElementId.set(elementId, cascade)\n return cascade\n },\n\n getMatchingSelectors(elementId: number): readonly SelectorMatch[] {\n return this.getElementCascade(elementId).edges\n },\n\n getComponentHost(_importSource: string, _exportName: string): ComponentHostSymbol | null {\n return symbolTable.componentHosts.get(`${_importSource}::${_exportName}`) ?? null\n },\n\n getElementsByTagName(tag: string): readonly ElementNode[] {\n const nodes = this.getElementNodes()\n const out: ElementNode[] = []\n const lowerTag = tag.toLowerCase()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]\n if (node && node.tagName === lowerTag) out.push(node)\n }\n return out\n },\n\n getLayoutFact<K extends LayoutFactKind>(elementId: number, factKind: K): LayoutFactMap[K] {\n const cascade = this.getElementCascade(elementId)\n const allElements = this.getElementNodes()\n return computeLayoutFact(\n factKind,\n elementId,\n cascade.declarations,\n allElements,\n (id) => this.getElementCascade(id).declarations,\n )\n },\n\n // ── Tier 4-5: Signal + fact + alignment queries ────────────────────\n\n getSignalSnapshot(elementId: number): SignalSnapshot {\n const index = ensureSnapshotIndex(this)\n const snapshot = index.get(elementId)\n if (!snapshot) throw new Error(`No signal snapshot for element ${elementId}`)\n return snapshot\n },\n\n getConditionalDelta(elementId: number): ReadonlyMap<string, ConditionalSignalDelta> | null {\n const index = ensureConditionalDeltaIndex(this)\n return index.deltaByElementId.get(elementId) ?? null\n },\n\n getBaselineOffsets(elementId: number): ReadonlyMap<LayoutSignalName, readonly number[]> | null {\n const index = ensureConditionalDeltaIndex(this)\n return index.baselineOffsetsByElementId.get(elementId) ?? null\n },\n\n getAlignmentContext(parentElementId: number): AlignmentContext | null {\n const contexts = ensureContextIndex(this)\n return contexts.get(parentElementId) ?? null\n },\n\n getCohortStats(parentElementId: number): CohortStats | null {\n const stats = ensureCohortStats(this)\n return stats.get(parentElementId) ?? null\n },\n\n getElementsWithConditionalDelta(signal: string): readonly ElementNode[] {\n const index = ensureConditionalDeltaIndex(this)\n return index.elementsWithDeltaBySignal.get(signal as LayoutSignalName) ?? []\n },\n\n getScrollContainerElements(): readonly ElementNode[] {\n const elements = this.getElementNodes()\n const snapshotIndex = ensureSnapshotIndex(this)\n const out: ElementNode[] = []\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n const snapshot = snapshotIndex.get(el.elementId)\n if (!snapshot) continue\n const fact = computeScrollContainerFact(snapshot)\n if (fact.isScrollContainer) out.push(el)\n }\n return out\n },\n\n getDynamicSlotCandidates(): readonly ElementNode[] {\n const elements = this.getElementNodes()\n const out: ElementNode[] = []\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n if (el.tagName === \"slot\") out.push(el)\n }\n return out\n },\n\n getElementsByKnownSignalValue(signal: LayoutSignalName, value: string): readonly ElementNode[] {\n const elements = this.getElementNodes()\n const snapshotIndex = ensureSnapshotIndex(this)\n const out: ElementNode[] = []\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i]\n if (!el) continue\n const snapshot = snapshotIndex.get(el.elementId)\n if (!snapshot) continue\n const sv = snapshot.signals.get(signal)\n if (!sv || sv.kind !== SignalValueKind.Known) continue\n if (sv.normalized === value) out.push(el)\n }\n return out\n },\n\n getStatefulSelectorEntries(ruleId: number): readonly StatefulSelectorEntry[] {\n const indexes = ensureStatefulIndexes()\n return indexes.selectorEntriesByRuleId.get(ruleId) ?? []\n },\n\n getStatefulNormalizedDeclarations(ruleId: number): readonly NormalizedRuleDeclaration[] {\n const indexes = ensureStatefulIndexes()\n return indexes.normalizedDeclarationsByRuleId.get(ruleId) ?? []\n },\n\n getStatefulBaseValueIndex(): ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>> {\n const indexes = ensureStatefulIndexes()\n return indexes.baseValueIndex\n },\n }\n}\n","import type { SolidSyntaxTree } from \"./solid-syntax-tree\";\nimport type { CSSSyntaxTree } from \"./css-syntax-tree\";\nimport type { SymbolTable } from \"../symbols/symbol-table\";\nimport { buildSymbolTable } from \"../symbols/symbol-table\";\nimport type { DependencyGraph } from \"../incremental/dependency-graph\";\nimport { buildDependencyGraph } from \"../incremental/dependency-graph\";\nimport { createFileSemanticModel, type FileSemanticModel } from \"../binding/semantic-model\";\nimport type { TailwindValidator } from \"../../css/tailwind\";\n\nexport interface TailwindConfigInput {\n readonly kind: \"tailwind-config\";\n readonly filePath: string;\n readonly version: string;\n readonly validator: TailwindValidator | null;\n}\n\nexport interface PackageManifestInput {\n readonly kind: \"package-manifest\";\n readonly filePath: string;\n readonly version: string;\n}\n\nexport interface TSConfigInput {\n readonly kind: \"tsconfig\";\n readonly filePath: string;\n readonly version: string;\n}\n\nexport interface StyleCompilation {\n readonly id: number;\n\n readonly solidTrees: ReadonlyMap<string, SolidSyntaxTree>;\n readonly cssTrees: ReadonlyMap<string, CSSSyntaxTree>;\n\n readonly tailwindConfig: TailwindConfigInput | null;\n readonly packageManifest: PackageManifestInput | null;\n readonly tsConfig: TSConfigInput | null;\n\n readonly symbolTable: SymbolTable;\n readonly dependencyGraph: DependencyGraph;\n\n withSolidTree(tree: SolidSyntaxTree): StyleCompilation;\n withCSSTrees(trees: readonly CSSSyntaxTree[]): StyleCompilation;\n withCSSTree(tree: CSSSyntaxTree): StyleCompilation;\n withoutFile(filePath: string): StyleCompilation;\n withTailwindConfig(config: TailwindConfigInput | null): StyleCompilation;\n withPackageManifest(manifest: PackageManifestInput | null): StyleCompilation;\n withTSConfig(config: TSConfigInput | null): StyleCompilation;\n withFile(filePath: string, tree: SolidSyntaxTree | CSSSyntaxTree): StyleCompilation;\n\n getSolidTree(filePath: string): SolidSyntaxTree | null;\n getCSSTree(filePath: string): CSSSyntaxTree | null;\n getSemanticModel(solidFilePath: string): FileSemanticModel;\n\n getSolidFilePaths(): readonly string[];\n getCSSFilePaths(): readonly string[];\n}\n\nlet nextId = 1;\n\nconst EMPTY_SOLID: ReadonlyMap<string, SolidSyntaxTree> = new Map();\nconst EMPTY_CSS: ReadonlyMap<string, CSSSyntaxTree> = new Map();\n\nfunction makeCompilation(\n solidTrees: ReadonlyMap<string, SolidSyntaxTree>,\n cssTrees: ReadonlyMap<string, CSSSyntaxTree>,\n tailwindConfig: TailwindConfigInput | null,\n packageManifest: PackageManifestInput | null,\n tsConfig: TSConfigInput | null,\n): StyleCompilation {\n const id = nextId++;\n let cachedSymbolTable: SymbolTable | null = null\n let cachedDependencyGraph: DependencyGraph | null = null\n const cachedSemanticModels = new Map<string, FileSemanticModel>()\n\n const self: StyleCompilation = {\n id,\n solidTrees,\n cssTrees,\n tailwindConfig,\n packageManifest,\n tsConfig,\n\n get symbolTable(): SymbolTable {\n if (cachedSymbolTable === null) {\n const allCssTrees: CSSSyntaxTree[] = []\n for (const tree of cssTrees.values()) allCssTrees.push(tree)\n cachedSymbolTable = buildSymbolTable(allCssTrees, tailwindConfig?.validator ?? null)\n }\n return cachedSymbolTable\n },\n\n get dependencyGraph(): DependencyGraph {\n if (cachedDependencyGraph === null) {\n cachedDependencyGraph = buildDependencyGraph(solidTrees, cssTrees)\n }\n return cachedDependencyGraph\n },\n\n withSolidTree(tree: SolidSyntaxTree): StyleCompilation {\n const next = new Map(solidTrees);\n next.set(tree.filePath, tree);\n return makeCompilation(next, cssTrees, tailwindConfig, packageManifest, tsConfig);\n },\n\n withCSSTree(tree: CSSSyntaxTree): StyleCompilation {\n const next = new Map(cssTrees);\n next.set(tree.filePath, tree);\n return makeCompilation(solidTrees, next, tailwindConfig, packageManifest, tsConfig);\n },\n\n withCSSTrees(trees: readonly CSSSyntaxTree[]): StyleCompilation {\n const next = new Map(cssTrees);\n for (let i = 0; i < trees.length; i++) {\n const t = trees[i]!;\n next.set(t.filePath, t);\n }\n return makeCompilation(solidTrees, next, tailwindConfig, packageManifest, tsConfig);\n },\n\n withoutFile(filePath: string): StyleCompilation {\n const hasSolid = solidTrees.has(filePath);\n const hasCSS = cssTrees.has(filePath);\n if (!hasSolid && !hasCSS) return this;\n\n let nextSolid = solidTrees;\n let nextCSS = cssTrees;\n if (hasSolid) {\n nextSolid = new Map(solidTrees);\n (nextSolid as Map<string, SolidSyntaxTree>).delete(filePath);\n }\n if (hasCSS) {\n nextCSS = new Map(cssTrees);\n (nextCSS as Map<string, CSSSyntaxTree>).delete(filePath);\n }\n return makeCompilation(nextSolid, nextCSS, tailwindConfig, packageManifest, tsConfig);\n },\n\n withTailwindConfig(config: TailwindConfigInput | null): StyleCompilation {\n return makeCompilation(solidTrees, cssTrees, config, packageManifest, tsConfig);\n },\n\n withPackageManifest(manifest: PackageManifestInput | null): StyleCompilation {\n return makeCompilation(solidTrees, cssTrees, tailwindConfig, manifest, tsConfig);\n },\n\n withTSConfig(config: TSConfigInput | null): StyleCompilation {\n return makeCompilation(solidTrees, cssTrees, tailwindConfig, packageManifest, config);\n },\n\n withFile(_filePath: string, tree: SolidSyntaxTree | CSSSyntaxTree): StyleCompilation {\n if (tree.kind === \"solid\") {\n return this.withSolidTree(tree);\n }\n return this.withCSSTree(tree);\n },\n\n getSolidTree(filePath: string): SolidSyntaxTree | null {\n return solidTrees.get(filePath) ?? null;\n },\n\n getCSSTree(filePath: string): CSSSyntaxTree | null {\n return cssTrees.get(filePath) ?? null;\n },\n\n getSemanticModel(solidFilePath: string): FileSemanticModel {\n const cached = cachedSemanticModels.get(solidFilePath)\n if (cached !== undefined) return cached\n const solidTree = solidTrees.get(solidFilePath)\n if (!solidTree) throw new Error(`No solid tree for ${solidFilePath}`)\n const model = createFileSemanticModel(solidTree, self.symbolTable, self.dependencyGraph, self)\n cachedSemanticModels.set(solidFilePath, model)\n return model\n },\n\n getSolidFilePaths(): readonly string[] {\n const keys = solidTrees.keys();\n const out: string[] = [];\n for (const k of keys) out.push(k);\n return out;\n },\n\n getCSSFilePaths(): readonly string[] {\n const keys = cssTrees.keys();\n const out: string[] = [];\n for (const k of keys) out.push(k);\n return out;\n },\n }\n\n return self\n}\n\nexport function createStyleCompilation(): StyleCompilation {\n return makeCompilation(EMPTY_SOLID, EMPTY_CSS, null, null, null);\n}\n\nexport function createCompilationFromLegacy(\n solidTrees: readonly SolidSyntaxTree[],\n cssTrees: readonly CSSSyntaxTree[],\n): StyleCompilation {\n const solidMap = new Map<string, SolidSyntaxTree>();\n for (let i = 0; i < solidTrees.length; i++) {\n const t = solidTrees[i];\n if (t) solidMap.set(t.filePath, t);\n }\n\n const cssMap = new Map<string, CSSSyntaxTree>();\n for (let i = 0; i < cssTrees.length; i++) {\n const t = cssTrees[i];\n if (t) cssMap.set(t.filePath, t);\n }\n\n return makeCompilation(solidMap, cssMap, null, null, null);\n}\n","import type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\nimport type { SymbolTable } from \"./symbol-table\"\nimport type { TailwindValidator } from \"../../css/tailwind\"\nimport { buildSymbolTable } from \"./symbol-table\"\n\nexport interface DeclarationTable {\n readonly generation: number\n withTree(tree: CSSSyntaxTree): DeclarationTable\n withoutTree(filePath: string): DeclarationTable\n withTailwindValidator(validator: TailwindValidator | null): DeclarationTable\n materialize(): SymbolTable\n}\n\nclass DeclarationTableImpl implements DeclarationTable {\n readonly generation: number\n private readonly _olderTrees: ReadonlyMap<string, CSSSyntaxTree>\n private readonly _latestTree: CSSSyntaxTree | null\n private _cachedTable: SymbolTable | null\n private readonly _tailwindValidator: TailwindValidator | null\n\n constructor(\n olderTrees: ReadonlyMap<string, CSSSyntaxTree>,\n latestTree: CSSSyntaxTree | null,\n cachedTable: SymbolTable | null,\n generation: number,\n tailwindValidator: TailwindValidator | null,\n ) {\n this._olderTrees = olderTrees\n this._latestTree = latestTree\n this._cachedTable = cachedTable\n this.generation = generation\n this._tailwindValidator = tailwindValidator\n }\n\n withTree(tree: CSSSyntaxTree): DeclarationTable {\n const olderTrees = new Map(this._olderTrees)\n const prev = this._latestTree\n if (prev !== null) {\n olderTrees.set(prev.filePath, prev)\n }\n\n if (olderTrees.has(tree.filePath)) {\n olderTrees.delete(tree.filePath)\n }\n\n return new DeclarationTableImpl(\n olderTrees,\n tree,\n null,\n this.generation + 1,\n this._tailwindValidator,\n )\n }\n\n withoutTree(filePath: string): DeclarationTable {\n if (this._latestTree !== null && this._latestTree.filePath === filePath) {\n return new DeclarationTableImpl(\n this._olderTrees,\n null,\n null,\n this.generation + 1,\n this._tailwindValidator,\n )\n }\n\n if (!this._olderTrees.has(filePath)) {\n return this\n }\n\n const olderTrees = new Map(this._olderTrees)\n olderTrees.delete(filePath)\n return new DeclarationTableImpl(\n olderTrees,\n this._latestTree,\n null,\n this.generation + 1,\n this._tailwindValidator,\n )\n }\n\n withTailwindValidator(validator: TailwindValidator | null): DeclarationTable {\n return new DeclarationTableImpl(\n this._olderTrees,\n this._latestTree,\n null,\n this.generation + 1,\n validator,\n )\n }\n\n materialize(): SymbolTable {\n if (this._cachedTable !== null) {\n return this._cachedTable\n }\n\n const allTrees: CSSSyntaxTree[] = []\n for (const tree of this._olderTrees.values()) {\n allTrees.push(tree)\n }\n if (this._latestTree !== null) {\n allTrees.push(this._latestTree)\n }\n\n const table = buildSymbolTable(allTrees, this._tailwindValidator)\n this._cachedTable = table\n return table\n }\n}\n\nconst EMPTY_OLDER: ReadonlyMap<string, CSSSyntaxTree> = new Map()\n\nexport function createDeclarationTable(): DeclarationTable {\n return new DeclarationTableImpl(EMPTY_OLDER, null, null, 0, null)\n}\n","import type { CSSSourceProvider, CSSSymbolContribution } from \"./provider\"\nimport type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\nimport type { CSSClassNameSource } from \"../symbols/class-name\"\nimport { buildCSSResult } from \"../../css/impl\"\nimport { createCSSInput } from \"../../css/input\"\nimport { createSelectorSymbol } from \"../symbols/selector\"\nimport { createDeclarationSymbol } from \"../symbols/declaration\"\nimport { createCustomPropertySymbol } from \"../symbols/custom-property\"\nimport { createKeyframesSymbol } from \"../symbols/keyframes\"\nimport { createFontFaceSymbol } from \"../symbols/font-face\"\nimport { createLayerSymbol } from \"../symbols/layer\"\nimport { createContainerSymbol } from \"../symbols/container\"\nimport { createThemeTokenSymbol } from \"../symbols/theme-token\"\nimport type { SelectorSymbol } from \"../symbols/selector\"\nimport type { DeclarationSymbol } from \"../symbols/declaration\"\nimport type { CustomPropertySymbol } from \"../symbols/custom-property\"\nimport type { KeyframesSymbol } from \"../symbols/keyframes\"\nimport type { FontFaceSymbol } from \"../symbols/font-face\"\nimport type { LayerSymbol } from \"../symbols/layer\"\nimport type { ContainerSymbol } from \"../symbols/container\"\nimport type { ThemeTokenSymbol } from \"../symbols/theme-token\"\nimport type { SelectorEntity } from \"../../css/entities/selector\"\nimport type { DeclarationEntity } from \"../../css/entities/declaration\"\nimport { parseContainerQueryName } from \"../../css/parser/value-util\"\nimport { LAYOUT_ANIMATION_MUTATION_PROPERTIES } from \"../../css/layout-taxonomy\"\nimport type { KeyframeLayoutMutation } from \"../symbols/keyframes\"\n\nconst STRIP_QUOTES_RE = /[\"']/g\n\nexport interface PlainCSSProvider extends CSSSourceProvider {\n readonly kind: \"plain-css\"\n}\n\nfunction extractSymbolsFromTree(tree: CSSSyntaxTree): CSSSymbolContribution {\n const filePath = tree.filePath\n const classNamesBuilding = new Map<string, { selectors: SelectorEntity[]; filePaths: string[] }>()\n const selectors: SelectorSymbol[] = []\n const declarations: DeclarationSymbol[] = []\n const customProperties: CustomPropertySymbol[] = []\n const keyframes: KeyframesSymbol[] = []\n const fontFaces: FontFaceSymbol[] = []\n const layers: LayerSymbol[] = []\n const containers: ContainerSymbol[] = []\n const themeTokens: ThemeTokenSymbol[] = []\n\n const treeSelectors = tree.selectors\n for (let i = 0; i < treeSelectors.length; i++) {\n const entity = treeSelectors[i]\n if (!entity) continue\n selectors.push(createSelectorSymbol(entity, filePath))\n\n const compounds = entity.compounds\n for (let ci = 0; ci < compounds.length; ci++) {\n const compound = compounds[ci]\n if (!compound) continue\n const classes = compound.classes\n for (let j = 0; j < classes.length; j++) {\n const cls = classes[j]\n if (!cls) continue\n const existing = classNamesBuilding.get(cls)\n if (existing) {\n existing.selectors.push(entity)\n if (existing.filePaths.indexOf(filePath) === -1) existing.filePaths.push(filePath)\n } else {\n classNamesBuilding.set(cls, {\n selectors: [entity],\n filePaths: [filePath],\n })\n }\n }\n }\n }\n\n const treeDeclarations = tree.declarations\n for (let i = 0; i < treeDeclarations.length; i++) {\n const entity = treeDeclarations[i]\n if (!entity) continue\n const sourceOrder = tree.sourceOrderBase + entity.sourceOrder\n const layerOrder = entity.cascadePosition.layerOrder\n declarations.push(createDeclarationSymbol(entity, filePath, sourceOrder, layerOrder))\n }\n\n const treeVariables = tree.variables\n const seenVars = new Set<string>()\n for (let i = 0; i < treeVariables.length; i++) {\n const entity = treeVariables[i]\n if (!entity) continue\n if (!seenVars.has(entity.name)) {\n seenVars.add(entity.name)\n customProperties.push(createCustomPropertySymbol(entity, filePath))\n }\n }\n\n const treeAtRules = tree.atRules\n let layerOrderCounter = 0\n for (let i = 0; i < treeAtRules.length; i++) {\n const entity = treeAtRules[i]\n if (!entity) continue\n switch (entity.kind) {\n case \"keyframes\": {\n const name = entity.parsedParams.animationName\n if (!name) break\n\n const byProperty = new Map<string, { values: Set<string>; declarations: DeclarationEntity[] }>()\n const kfRules = entity.rules\n for (let r = 0; r < kfRules.length; r++) {\n const kfRule = kfRules[r]\n if (!kfRule) continue\n const kfDecls = kfRule.declarations\n for (let d = 0; d < kfDecls.length; d++) {\n const decl = kfDecls[d]\n if (!decl) continue\n const property = decl.property.toLowerCase()\n if (!LAYOUT_ANIMATION_MUTATION_PROPERTIES.has(property)) continue\n\n let bucket = byProperty.get(property)\n if (!bucket) {\n bucket = { values: new Set<string>(), declarations: [] }\n byProperty.set(property, bucket)\n }\n bucket.values.add(decl.value.trim().toLowerCase())\n bucket.declarations.push(decl)\n }\n }\n\n const layoutMutations: KeyframeLayoutMutation[] = []\n for (const [property, bucket] of byProperty) {\n if (bucket.values.size <= 1) continue\n layoutMutations.push({\n property,\n values: [...bucket.values],\n declarations: bucket.declarations,\n })\n }\n\n keyframes.push(createKeyframesSymbol(entity, name, filePath, layoutMutations))\n break\n }\n case \"font-face\": {\n const childDecls = entity.declarations\n let family = \"\"\n let display: string | null = null\n let hasWebFontSource = false\n let hasMetricOverrides = false\n if (childDecls) {\n for (let d = 0; d < childDecls.length; d++) {\n const decl = childDecls[d]\n if (!decl) continue\n const prop = decl.property.toLowerCase()\n if (prop === \"font-family\") family = decl.value.replace(STRIP_QUOTES_RE, \"\").trim()\n else if (prop === \"font-display\") display = decl.value.trim().toLowerCase()\n else if (prop === \"src\" && decl.value.toLowerCase().includes(\"url(\")) hasWebFontSource = true\n else if (prop === \"size-adjust\" || prop === \"ascent-override\" || prop === \"descent-override\" || prop === \"line-gap-override\") {\n const v = decl.value.trim().toLowerCase()\n if (v !== \"normal\" && v !== \"none\" && v.length > 0) hasMetricOverrides = true\n }\n }\n }\n if (family.length > 0) {\n fontFaces.push(createFontFaceSymbol(entity, family, filePath, display, hasWebFontSource, hasMetricOverrides))\n }\n break\n }\n case \"layer\": {\n const name = entity.params.trim()\n if (name.length > 0) {\n layers.push(createLayerSymbol(entity, name, filePath, layerOrderCounter++))\n }\n break\n }\n case \"container\": {\n const queryName = parseContainerQueryName(entity.params)\n if (queryName !== null && queryName.length > 0) {\n containers.push(createContainerSymbol(queryName, [], [entity]))\n }\n break\n }\n }\n }\n\n const treeTokens = tree.tokens\n for (let i = 0; i < treeTokens.length; i++) {\n const entity = treeTokens[i]\n if (!entity) continue\n themeTokens.push(createThemeTokenSymbol(entity, filePath))\n }\n\n const classNamesMap = new Map<string, CSSClassNameSource>()\n for (const [name, entry] of classNamesBuilding) {\n classNamesMap.set(name, { kind: \"css\", selectors: entry.selectors, filePaths: entry.filePaths })\n }\n\n return {\n classNames: classNamesMap,\n selectors,\n declarations,\n customProperties,\n keyframes,\n fontFaces,\n layers,\n containers,\n themeTokens,\n }\n}\n\nexport function createPlainCSSProvider(): PlainCSSProvider {\n return {\n kind: \"plain-css\",\n\n parse(filePath: string, content: string, sourceOrderBase: number): CSSSyntaxTree {\n const result = buildCSSResult(createCSSInput([{ path: filePath, content }]))\n const trees = result.trees\n const tree = trees[0]!\n return {\n ...tree,\n sourceOrderBase,\n }\n },\n\n extractSymbols: extractSymbolsFromTree,\n }\n}\n","/**\n * Change propagation — transitive invalidation via reverse dependency edges.\n *\n * Given a changed file, determines which other files' SemanticModels\n * are stale and need rebinding. Uses the DependencyGraph's reverse edges\n * to propagate invalidation from CSS changes to Solid files that import them.\n */\nimport type { DependencyGraph } from \"./dependency-graph\"\nimport type { StyleCompilation } from \"../core/compilation\"\n\nexport interface ChangePropagationResult {\n readonly directlyChanged: ReadonlySet<string>\n readonly transitivelyAffected: ReadonlySet<string>\n readonly allStale: ReadonlySet<string>\n}\n\n/**\n * Compute the full set of stale files given a set of directly changed file paths.\n *\n * CSS change → transitively affected Solid files (via reverse import edges)\n * Solid change → only that Solid file\n * Both → union\n */\nexport function propagateChanges(\n changedFiles: ReadonlySet<string>,\n dependencyGraph: DependencyGraph,\n _compilation: StyleCompilation,\n): ChangePropagationResult {\n const directlyChanged = new Set(changedFiles)\n const transitivelyAffected = new Set<string>()\n\n for (const filePath of changedFiles) {\n const affected = dependencyGraph.getTransitivelyAffected(filePath)\n for (let i = 0; i < affected.length; i++) {\n const dep = affected[i]\n if (!dep) continue\n if (directlyChanged.has(dep)) continue\n transitivelyAffected.add(dep)\n }\n }\n\n const allStale = new Set<string>()\n for (const f of directlyChanged) allStale.add(f)\n for (const f of transitivelyAffected) allStale.add(f)\n\n return { directlyChanged, transitivelyAffected, allStale }\n}\n\n/**\n * Determine which Solid files need SemanticModel rebinding\n * given a set of stale file paths. Only Solid files that exist\n * in the compilation's solidTrees are returned.\n */\nexport function filterStaleSolidFiles(\n staleFiles: ReadonlySet<string>,\n compilation: StyleCompilation,\n): ReadonlySet<string> {\n const out = new Set<string>()\n for (const filePath of staleFiles) {\n if (compilation.solidTrees.has(filePath)) out.add(filePath)\n }\n return out\n}\n","/**\n * CompilationTracker — replaces three-level GraphCache.\n *\n * Like Roslyn's CompilationTracker + SolutionCompilationState:\n * tracks which compilation state is current, which parts are stale,\n * and reuses unchanged parts when building new compilations.\n */\nimport type { Diagnostic } from \"../../diagnostic\"\nimport type { StyleCompilation, TailwindConfigInput } from \"../core/compilation\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { DeclarationTable } from \"../symbols/declaration-table\"\nimport { createDeclarationTable } from \"../symbols/declaration-table\"\nimport type { CSSSourceProvider } from \"../providers/provider\"\nimport { createPlainCSSProvider } from \"../providers/plain-css\"\nimport type { TailwindProvider } from \"../providers/tailwind\"\nimport type { DependencyGraph } from \"./dependency-graph\"\nimport { buildDependencyGraph } from \"./dependency-graph\"\nimport { propagateChanges, filterStaleSolidFiles } from \"./change-propagation\"\nimport { noopLogger } from \"@drskillissue/ganko-shared\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\nimport { canonicalPath, matchesExtension, CSS_EXTENSIONS, SOLID_EXTENSIONS } from \"@drskillissue/ganko-shared\"\n\n// ── Types ────────────────────────────────────────────────────────────────\n\nexport type AdditionalInput =\n | TailwindConfigInput\n | { readonly kind: \"package-manifest\"; readonly filePath: string; readonly version: string }\n | { readonly kind: \"tsconfig\"; readonly filePath: string; readonly version: string }\n\nexport interface CompilationTracker {\n readonly currentCompilation: StyleCompilation\n readonly previousCompilation: StyleCompilation | null\n\n applyChange(filePath: string, content: string, version: string): CompilationTracker\n applyDeletion(filePath: string): CompilationTracker\n applyInputChange(input: AdditionalInput): CompilationTracker\n\n /**\n * Apply a batch of file changes in one dependency graph rebuild.\n * solidTrees: pre-built SolidSyntaxTrees keyed by canonical path.\n * CSS files are parsed internally via CSSSourceProvider.\n * Rebuilds the dependency graph ONCE after all mutations.\n */\n applyBatch(\n changes: readonly { path: string; content: string; version: string }[],\n solidTrees: ReadonlyMap<string, import(\"../core/solid-syntax-tree\").SolidSyntaxTree>,\n ): CompilationTracker\n\n getStaleFiles(): ReadonlySet<string>\n getDirectlyChangedFiles(): ReadonlySet<string>\n isSemanticModelValid(filePath: string): boolean\n\n getCachedCrossFileDiagnostics(filePath: string): readonly Diagnostic[]\n setCachedCrossFileDiagnostics(filePath: string, diagnostics: readonly Diagnostic[]): void\n getCachedCrossFileResults(): ReadonlyMap<string, readonly Diagnostic[]> | null\n setCachedCrossFileResults(allDiagnostics: readonly Diagnostic[]): void\n invalidateCrossFileResults(): void\n}\n\nexport interface CompilationTrackerOptions {\n readonly cssProvider?: CSSSourceProvider\n readonly scssProvider?: CSSSourceProvider\n readonly tailwindProvider?: TailwindProvider\n readonly logger?: Logger\n}\n\n// ── Implementation ───────────────────────────────────────────────────────\n\ninterface TrackerState {\n readonly compilation: StyleCompilation\n readonly previous: StyleCompilation | null\n readonly declarationTable: DeclarationTable\n readonly symbolTable: SymbolTable\n readonly dependencyGraph: DependencyGraph\n readonly directlyChanged: ReadonlySet<string>\n readonly staleFiles: ReadonlySet<string>\n readonly crossFileDiagnostics: Map<string, readonly Diagnostic[]>\n readonly crossFileResultsGeneration: number\n readonly crossFileResults: ReadonlyMap<string, readonly Diagnostic[]> | null\n readonly generation: number\n readonly logger: Logger\n readonly cssProvider: CSSSourceProvider | null\n readonly scssProvider: CSSSourceProvider | null\n}\n\nfunction buildState(\n compilation: StyleCompilation,\n previous: StyleCompilation | null,\n declarationTable: DeclarationTable,\n directlyChanged: ReadonlySet<string>,\n crossFileDiagnostics: Map<string, readonly Diagnostic[]>,\n crossFileResultsGeneration: number,\n crossFileResults: ReadonlyMap<string, readonly Diagnostic[]> | null,\n generation: number,\n logger: Logger,\n cssProvider: CSSSourceProvider | null,\n scssProvider: CSSSourceProvider | null,\n): TrackerState {\n const symbolTable = declarationTable.materialize()\n const dependencyGraph = buildDependencyGraph(compilation.solidTrees, compilation.cssTrees)\n\n const propagation = propagateChanges(directlyChanged, dependencyGraph, compilation)\n const filteredStale = filterStaleSolidFiles(propagation.allStale, compilation)\n // Directly changed files are always stale, even if removed from compilation\n // (e.g. when no parser is provided to re-add them)\n const staleFiles = new Set(filteredStale)\n for (const f of directlyChanged) staleFiles.add(f)\n\n return {\n compilation,\n previous,\n declarationTable,\n symbolTable,\n dependencyGraph,\n directlyChanged,\n staleFiles,\n crossFileDiagnostics,\n crossFileResultsGeneration,\n crossFileResults: crossFileResultsGeneration === generation ? crossFileResults : null,\n generation,\n logger,\n cssProvider,\n scssProvider,\n }\n}\n\nfunction createTrackerFromState(state: TrackerState): CompilationTracker {\n return {\n currentCompilation: state.compilation,\n previousCompilation: state.previous,\n\n applyChange(filePath: string, content: string, _version: string): CompilationTracker {\n const key = canonicalPath(filePath)\n const isCss = matchesExtension(key, CSS_EXTENSIONS)\n const isSolid = matchesExtension(key, SOLID_EXTENSIONS)\n\n // Step 1: Remove old tree\n let nextCompilation = state.compilation\n let nextDeclarationTable = state.declarationTable\n\n if (isCss) {\n nextCompilation = nextCompilation.withoutFile(key)\n nextDeclarationTable = nextDeclarationTable.withoutTree(key)\n }\n if (isSolid) {\n nextCompilation = nextCompilation.withoutFile(key)\n }\n\n // Step 2: Parse new content into syntax tree via provider and add to compilation\n if (isCss) {\n const provider = key.endsWith(\".scss\") ? state.scssProvider : state.cssProvider\n if (provider !== null) {\n const sourceOrderBase = nextCompilation.cssTrees.size * 10000\n const newTree = provider.parse(key, content, sourceOrderBase)\n nextCompilation = nextCompilation.withCSSTree(newTree)\n nextDeclarationTable = nextDeclarationTable.withTree(newTree)\n }\n }\n // Solid files require a TypeScript program for parsing — the caller\n // provides the parsed tree externally via compilation.withSolidTree()\n // before or after calling applyChange. The tracker handles invalidation.\n\n // Step 3-5: Propagate changes, invalidate, return new tracker\n const nextDirectlyChanged = new Set(state.directlyChanged)\n nextDirectlyChanged.add(key)\n\n const nextCrossFileDiagnostics = new Map(state.crossFileDiagnostics)\n nextCrossFileDiagnostics.delete(key)\n\n return createTrackerFromState(buildState(\n nextCompilation,\n state.compilation,\n nextDeclarationTable,\n nextDirectlyChanged,\n nextCrossFileDiagnostics,\n state.crossFileResultsGeneration,\n state.crossFileResults,\n state.generation + 1,\n state.logger,\n state.cssProvider,\n state.scssProvider,\n ))\n },\n\n applyDeletion(filePath: string): CompilationTracker {\n const key = canonicalPath(filePath)\n const nextCompilation = state.compilation.withoutFile(key)\n const nextDeclarationTable = state.declarationTable.withoutTree(key)\n\n const nextDirectlyChanged = new Set(state.directlyChanged)\n nextDirectlyChanged.add(key)\n\n const nextCrossFileDiagnostics = new Map(state.crossFileDiagnostics)\n nextCrossFileDiagnostics.delete(key)\n\n return createTrackerFromState(buildState(\n nextCompilation,\n state.compilation,\n nextDeclarationTable,\n nextDirectlyChanged,\n nextCrossFileDiagnostics,\n state.crossFileResultsGeneration,\n state.crossFileResults,\n state.generation + 1,\n state.logger,\n state.cssProvider,\n state.scssProvider,\n ))\n },\n\n applyInputChange(_input: AdditionalInput): CompilationTracker {\n // Input changes (tailwind config, package manifest, tsconfig) invalidate everything\n const allSolidFiles = new Set<string>()\n for (const key of state.compilation.solidTrees.keys()) allSolidFiles.add(key)\n for (const key of state.compilation.cssTrees.keys()) allSolidFiles.add(key)\n\n return createTrackerFromState(buildState(\n state.compilation,\n state.compilation,\n state.declarationTable,\n allSolidFiles,\n new Map(),\n state.generation + 1,\n null,\n state.generation + 1,\n state.logger,\n state.cssProvider,\n state.scssProvider,\n ))\n },\n\n applyBatch(\n changes: readonly { path: string; content: string; version: string }[],\n solidTrees: ReadonlyMap<string, import(\"../core/solid-syntax-tree\").SolidSyntaxTree>,\n ): CompilationTracker {\n let nextCompilation = state.compilation\n let nextDeclarationTable = state.declarationTable\n const nextDirectlyChanged = new Set(state.directlyChanged)\n const nextCrossFileDiagnostics = new Map(state.crossFileDiagnostics)\n\n for (let i = 0; i < changes.length; i++) {\n const change = changes[i]\n if (!change) continue\n const key = canonicalPath(change.path)\n const isCss = matchesExtension(key, CSS_EXTENSIONS)\n const isSolid = matchesExtension(key, SOLID_EXTENSIONS)\n\n // Remove old tree\n if (isCss) {\n nextCompilation = nextCompilation.withoutFile(key)\n nextDeclarationTable = nextDeclarationTable.withoutTree(key)\n }\n if (isSolid) {\n nextCompilation = nextCompilation.withoutFile(key)\n }\n\n // Add new tree\n if (isCss) {\n const provider = key.endsWith(\".scss\") ? state.scssProvider : state.cssProvider\n if (provider !== null) {\n const sourceOrderBase = nextCompilation.cssTrees.size * 10000\n const newTree = provider.parse(key, change.content, sourceOrderBase)\n nextCompilation = nextCompilation.withCSSTree(newTree)\n nextDeclarationTable = nextDeclarationTable.withTree(newTree)\n }\n }\n if (isSolid) {\n const tree = solidTrees.get(key)\n if (tree) {\n nextCompilation = nextCompilation.withSolidTree(tree)\n }\n }\n\n nextDirectlyChanged.add(key)\n nextCrossFileDiagnostics.delete(key)\n }\n\n // One graph rebuild for the entire batch\n return createTrackerFromState(buildState(\n nextCompilation,\n state.compilation,\n nextDeclarationTable,\n nextDirectlyChanged,\n nextCrossFileDiagnostics,\n state.crossFileResultsGeneration,\n state.crossFileResults,\n state.generation + 1,\n state.logger,\n state.cssProvider,\n state.scssProvider,\n ))\n },\n\n getStaleFiles(): ReadonlySet<string> {\n return state.staleFiles\n },\n\n getDirectlyChangedFiles(): ReadonlySet<string> {\n return state.directlyChanged\n },\n\n isSemanticModelValid(filePath: string): boolean {\n return !state.staleFiles.has(canonicalPath(filePath))\n },\n\n getCachedCrossFileDiagnostics(filePath: string): readonly Diagnostic[] {\n return state.crossFileDiagnostics.get(canonicalPath(filePath)) ?? []\n },\n\n setCachedCrossFileDiagnostics(filePath: string, diagnostics: readonly Diagnostic[]): void {\n state.crossFileDiagnostics.set(canonicalPath(filePath), diagnostics)\n },\n\n getCachedCrossFileResults(): ReadonlyMap<string, readonly Diagnostic[]> | null {\n if (state.crossFileResultsGeneration !== state.generation) return null\n return state.crossFileResults\n },\n\n setCachedCrossFileResults(allDiagnostics: readonly Diagnostic[]): void {\n const byFile = new Map<string, Diagnostic[]>()\n for (let i = 0; i < allDiagnostics.length; i++) {\n const d = allDiagnostics[i]\n if (!d) continue\n let arr = byFile.get(d.file)\n if (!arr) { arr = []; byFile.set(d.file, arr) }\n arr.push(d)\n }\n ;(state as { crossFileResults: ReadonlyMap<string, readonly Diagnostic[]> | null }).crossFileResults = byFile\n ;(state as { crossFileResultsGeneration: number }).crossFileResultsGeneration = state.generation\n\n state.crossFileDiagnostics.clear()\n for (const [file, diagnostics] of byFile) {\n state.crossFileDiagnostics.set(file, diagnostics)\n }\n },\n\n invalidateCrossFileResults() {\n ;(state as { crossFileResults: ReadonlyMap<string, readonly Diagnostic[]> | null }).crossFileResults = null\n ;(state as { crossFileResultsGeneration: number }).crossFileResultsGeneration = -1\n state.crossFileDiagnostics.clear()\n },\n }\n}\n\nexport function createCompilationTracker(\n compilation: StyleCompilation,\n options?: CompilationTrackerOptions,\n): CompilationTracker {\n const logger = options?.logger ?? noopLogger\n\n // Build initial declaration table from all CSS trees\n let declarationTable = createDeclarationTable()\n for (const [, tree] of compilation.cssTrees) {\n declarationTable = declarationTable.withTree(tree)\n }\n\n const state = buildState(\n compilation,\n null,\n declarationTable,\n new Set(),\n new Map(),\n 0,\n null,\n 0,\n logger,\n options?.cssProvider ?? createPlainCSSProvider(),\n options?.scssProvider ?? null,\n )\n\n return createTrackerFromState(state)\n}\n","/**\n * AnalysisRule + typed action registry — replaces CrossRule + BaseRule<CrossRuleContext>.\n */\nimport type { Diagnostic } from \"../../diagnostic\"\nimport type { StyleCompilation } from \"../core/compilation\"\nimport type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\nimport type { SolidSyntaxTree } from \"../core/solid-syntax-tree\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { ClassNameSymbol } from \"../symbols/class-name\"\nimport type { SelectorSymbol } from \"../symbols/selector\"\nimport type { DeclarationSymbol } from \"../symbols/declaration\"\nimport type { CustomPropertySymbol } from \"../symbols/custom-property\"\nimport type { ComponentHostSymbol } from \"../symbols/component-host\"\nimport type { KeyframesSymbol } from \"../symbols/keyframes\"\nimport type { FontFaceSymbol } from \"../symbols/font-face\"\nimport type { LayerSymbol } from \"../symbols/layer\"\nimport type { ContainerSymbol } from \"../symbols/container\"\nimport type { ThemeTokenSymbol } from \"../symbols/theme-token\"\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { ElementCascade } from \"../binding/cascade-binder\"\nimport type { SignalSnapshot, LayoutSignalName } from \"../binding/signal-builder\"\nimport type { FileSemanticModel } from \"../binding/semantic-model\"\nimport type { LayoutFactKind, LayoutFactMap } from \"../analysis/layout-fact\"\nimport type { ConditionalSignalDelta } from \"../analysis/cascade-analyzer\"\nimport type { AlignmentContext, CohortStats } from \"../analysis/alignment\"\nexport type { StatefulSelectorEntry, NormalizedRuleDeclaration } from \"../analysis/statefulness\"\n\nexport type Emit = (diagnostic: Diagnostic) => void\n\nexport const enum ComputationTier {\n CSSSyntax = 0,\n CrossSyntax = 1,\n ElementResolution = 2,\n SelectiveLayoutFacts = 3,\n FullCascade = 4,\n AlignmentModel = 5,\n}\n\nexport interface TierRequirement {\n readonly tier: ComputationTier\n readonly factKinds?: readonly LayoutFactKind[]\n readonly signals?: readonly LayoutSignalName[]\n}\n\nexport type StyleSymbolKind = keyof StyleSymbolByKind\n\nexport interface StyleSymbolByKind {\n className: ClassNameSymbol\n selector: SelectorSymbol\n declaration: DeclarationSymbol\n customProperty: CustomPropertySymbol\n componentHost: ComponentHostSymbol\n keyframes: KeyframesSymbol\n fontFace: FontFaceSymbol\n layer: LayerSymbol\n container: ContainerSymbol\n themeToken: ThemeTokenSymbol\n}\n\nexport interface AnalysisActionRegistry {\n registerCSSSyntaxAction(action: (tree: CSSSyntaxTree, symbolTable: SymbolTable, emit: Emit) => void): void\n registerCrossSyntaxAction(action: (solidTree: SolidSyntaxTree, symbolTable: SymbolTable, emit: Emit) => void): void\n registerCompilationAction(action: (compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit) => void): void\n registerSymbolAction<K extends StyleSymbolKind>(kind: K, action: (symbol: StyleSymbolByKind[K], semanticModel: FileSemanticModel, emit: Emit) => void): void\n registerElementAction(action: (element: ElementNode, semanticModel: FileSemanticModel, emit: Emit) => void): void\n registerFactAction<K extends LayoutFactKind>(factKind: K, action: (element: ElementNode, fact: LayoutFactMap[K], semanticModel: FileSemanticModel, emit: Emit) => void): void\n registerCascadeAction(action: (element: ElementNode, cascade: ElementCascade, snapshot: SignalSnapshot, semanticModel: FileSemanticModel, emit: Emit) => void): void\n registerConditionalDeltaAction(action: (element: ElementNode, delta: ReadonlyMap<string, ConditionalSignalDelta>, semanticModel: FileSemanticModel, emit: Emit) => void): void\n registerAlignmentAction(action: (parentElement: ElementNode, context: AlignmentContext, cohort: CohortStats, semanticModel: FileSemanticModel, emit: Emit) => void): void\n}\n\nexport interface AnalysisRule {\n readonly id: string\n readonly severity: \"error\" | \"warn\" | \"off\"\n readonly messages: Record<string, string>\n readonly meta: {\n readonly description: string\n readonly fixable: boolean\n readonly category: string\n }\n readonly requirement: TierRequirement\n register(registry: AnalysisActionRegistry): void\n}\n\nexport function defineAnalysisRule(rule: AnalysisRule): AnalysisRule {\n return rule\n}\n","/**\n * AnalysisActionRegistry implementation — collects typed actions from rules.\n *\n * Uses existential closure encoding to achieve type-safe heterogeneous\n * dispatch without type assertions, `any`, or type predicates.\n *\n * Each registered symbol/fact action becomes a self-contained dispatch\n * thunk that closes over both the kind (K) and the action at registration\n * time. Since K is still in scope inside the thunk factory, TypeScript\n * proves the provider.getSymbols(kind)/provider.getLayoutFact(id, kind)\n * return type matches the action's parameter type. At dispatch time, the\n * thunks are opaque — the type parameter has been existentially erased\n * into the closure.\n */\nimport type { StyleCompilation } from \"../core/compilation\"\nimport type { CSSSyntaxTree } from \"../core/css-syntax-tree\"\nimport type { SolidSyntaxTree } from \"../core/solid-syntax-tree\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { ElementCascade } from \"../binding/cascade-binder\"\nimport type { SignalSnapshot } from \"../binding/signal-builder\"\nimport type { FileSemanticModel } from \"../binding/semantic-model\"\nimport type { LayoutFactKind, LayoutFactMap } from \"../analysis/layout-fact\"\nimport type { ConditionalSignalDelta } from \"../analysis/cascade-analyzer\"\nimport type { AlignmentContext, CohortStats } from \"../analysis/alignment\"\nimport type { AnalysisActionRegistry, Emit, StyleSymbolKind, StyleSymbolByKind } from \"./rule\"\n\nexport type CSSSyntaxAction = (tree: CSSSyntaxTree, symbolTable: SymbolTable, emit: Emit) => void\nexport type CrossSyntaxAction = (solidTree: SolidSyntaxTree, symbolTable: SymbolTable, emit: Emit) => void\nexport type ElementAction = (element: ElementNode, semanticModel: FileSemanticModel, emit: Emit) => void\nexport type CascadeAction = (element: ElementNode, cascade: ElementCascade, snapshot: SignalSnapshot, semanticModel: FileSemanticModel, emit: Emit) => void\nexport type ConditionalDeltaAction = (element: ElementNode, delta: ReadonlyMap<string, ConditionalSignalDelta>, semanticModel: FileSemanticModel, emit: Emit) => void\nexport type AlignmentAction = (parentElement: ElementNode, context: AlignmentContext, cohort: CohortStats, semanticModel: FileSemanticModel, emit: Emit) => void\nexport type CompilationAction = (compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit) => void\n\n/**\n * Opaque dispatch thunk for a symbol action. Calls provider.getSymbols(kind)\n * with the captured kind K, then invokes the captured action for each symbol.\n * The type parameter K is existentially erased into the closure.\n */\nexport interface SymbolDispatchThunk {\n readonly kind: StyleSymbolKind\n dispatch(provider: SymbolProvider, semanticModel: FileSemanticModel, emit: Emit): void\n}\n\n/**\n * Opaque dispatch thunk for a fact action. Calls provider.getLayoutFact\n * with the captured factKind K, then invokes the captured action.\n */\nexport interface FactDispatchThunk {\n readonly kind: LayoutFactKind\n dispatch(element: ElementNode, provider: FactProvider, semanticModel: FileSemanticModel, emit: Emit): void\n}\n\nexport interface SymbolProvider {\n getSymbols<K extends StyleSymbolKind>(kind: K): ReadonlyArray<StyleSymbolByKind[K]>\n}\n\nexport interface FactProvider {\n getLayoutFact<K extends LayoutFactKind>(elementId: number, factKind: K): LayoutFactMap[K]\n}\n\nexport interface CollectedActions {\n readonly cssSyntax: readonly CSSSyntaxAction[]\n readonly crossSyntax: readonly CrossSyntaxAction[]\n readonly symbolThunks: readonly SymbolDispatchThunk[]\n readonly symbolKinds: ReadonlySet<StyleSymbolKind>\n readonly element: readonly ElementAction[]\n readonly factThunks: readonly FactDispatchThunk[]\n readonly factKinds: ReadonlySet<LayoutFactKind>\n readonly cascade: readonly CascadeAction[]\n readonly conditionalDelta: readonly ConditionalDeltaAction[]\n readonly alignment: readonly AlignmentAction[]\n readonly compilation: readonly CompilationAction[]\n}\n\nfunction createSymbolThunk<K extends StyleSymbolKind>(\n kind: K,\n action: (symbol: StyleSymbolByKind[K], semanticModel: FileSemanticModel, emit: Emit) => void,\n): SymbolDispatchThunk {\n return {\n kind,\n dispatch(provider, semanticModel, emit) {\n const symbols = provider.getSymbols(kind)\n for (let i = 0; i < symbols.length; i++) {\n action(symbols[i]!, semanticModel, emit)\n }\n },\n }\n}\n\nfunction createFactThunk<K extends LayoutFactKind>(\n factKind: K,\n action: (element: ElementNode, fact: LayoutFactMap[K], semanticModel: FileSemanticModel, emit: Emit) => void,\n): FactDispatchThunk {\n return {\n kind: factKind,\n dispatch(element, provider, semanticModel, emit) {\n action(element, provider.getLayoutFact(element.elementId, factKind), semanticModel, emit)\n },\n }\n}\n\nexport function createActionRegistry(): { registry: AnalysisActionRegistry; actions: CollectedActions } {\n const cssSyntax: CSSSyntaxAction[] = []\n const crossSyntax: CrossSyntaxAction[] = []\n const symbolThunks: SymbolDispatchThunk[] = []\n const symbolKinds = new Set<StyleSymbolKind>()\n const element: ElementAction[] = []\n const factThunks: FactDispatchThunk[] = []\n const factKinds = new Set<LayoutFactKind>()\n const cascade: CascadeAction[] = []\n const conditionalDelta: ConditionalDeltaAction[] = []\n const alignment: AlignmentAction[] = []\n const compilation: CompilationAction[] = []\n\n const registry: AnalysisActionRegistry = {\n registerCSSSyntaxAction(action) { cssSyntax.push(action) },\n registerCrossSyntaxAction(action) { crossSyntax.push(action) },\n registerSymbolAction(kind, action) {\n symbolKinds.add(kind)\n symbolThunks.push(createSymbolThunk(kind, action))\n },\n registerElementAction(action) { element.push(action) },\n registerFactAction(factKind, action) {\n factKinds.add(factKind)\n factThunks.push(createFactThunk(factKind, action))\n },\n registerCascadeAction(action) { cascade.push(action) },\n registerConditionalDeltaAction(action) { conditionalDelta.push(action) },\n registerAlignmentAction(action) { alignment.push(action) },\n registerCompilationAction(action) { compilation.push(action) },\n }\n\n const actions: CollectedActions = {\n cssSyntax, crossSyntax, symbolThunks, symbolKinds,\n element, factThunks, factKinds, cascade, conditionalDelta, alignment, compilation,\n }\n\n return { registry, actions }\n}\n","/**\n * Tier resolver — inspects registered rules to determine maximum required computation tier.\n */\nimport type { AnalysisRule } from \"./rule\"\nimport { ComputationTier } from \"./rule\"\nimport type { CollectedActions } from \"./registry\"\n\nexport function resolveMaxTier(rules: readonly AnalysisRule[]): ComputationTier {\n let max: ComputationTier = ComputationTier.CSSSyntax\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i]\n if (!rule) continue\n if (rule.severity === \"off\") continue\n if (rule.requirement.tier > max) max = rule.requirement.tier\n }\n\n return max\n}\n\nexport function resolveRequiredTierFromActions(actions: CollectedActions): ComputationTier {\n if (actions.alignment.length > 0) return ComputationTier.AlignmentModel\n if (actions.cascade.length > 0 || actions.conditionalDelta.length > 0) return ComputationTier.FullCascade\n if (actions.factThunks.length > 0) return ComputationTier.SelectiveLayoutFacts\n if (actions.element.length > 0) return ComputationTier.ElementResolution\n if (actions.crossSyntax.length > 0 || actions.symbolThunks.length > 0) return ComputationTier.CrossSyntax\n if (actions.cssSyntax.length > 0) return ComputationTier.CSSSyntax\n return ComputationTier.CSSSyntax\n}\n","/**\n * AnalysisDispatcher — tiered rule execution framework.\n *\n * Like Roslyn's CompilationWithAnalyzers + AnalyzerDriver:\n * rules register typed subscriptions, the framework inspects subscriptions\n * to determine the maximum required tier, computes only that tier,\n * and dispatches to subscribers.\n */\nimport type { Diagnostic } from \"../../diagnostic\"\nimport type { StyleCompilation } from \"../core/compilation\"\nimport type { SymbolTable } from \"../symbols/symbol-table\"\nimport type { FileSemanticModel } from \"../binding/semantic-model\"\nimport type { ElementNode } from \"../binding/element-builder\"\nimport type { AnalysisRule, Emit } from \"./rule\"\nimport { ComputationTier } from \"./rule\"\nimport { createActionRegistry, type CollectedActions } from \"./registry\"\nimport { resolveMaxTier } from \"./tier-resolver\"\n\nexport interface AnalysisResult {\n readonly diagnostics: readonly Diagnostic[]\n readonly maxTierComputed: ComputationTier\n}\n\nexport interface AnalysisDispatcher {\n register(rule: AnalysisRule): void\n run(compilation: StyleCompilation): AnalysisResult\n /**\n * Run only on a subset of affected files. Tier 0 CSS syntax actions\n * only fire for affected CSS files. Tier 1+ only fire for affected\n * solid files. Compilation-wide actions always run.\n * Used for incremental re-analysis after a file change.\n */\n runSubset(compilation: StyleCompilation, affectedFiles: ReadonlySet<string>): AnalysisResult\n}\n\nexport function createAnalysisDispatcher(): AnalysisDispatcher {\n const rules: AnalysisRule[] = []\n\n function setup() {\n const { registry, actions } = createActionRegistry()\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i]\n if (!rule) continue\n if (rule.severity === \"off\") continue\n rule.register(registry)\n }\n return { actions, maxTier: resolveMaxTier(rules) }\n }\n\n function dispatch(\n compilation: StyleCompilation,\n actions: CollectedActions,\n maxTier: ComputationTier,\n emit: Emit,\n affectedFiles: ReadonlySet<string> | null,\n ): void {\n const symbolTable = compilation.symbolTable\n\n // Tier 0: CSS syntax actions\n if (maxTier >= ComputationTier.CSSSyntax) {\n if (affectedFiles !== null) {\n dispatchCSSSyntaxActionsSubset(actions, compilation, symbolTable, emit, affectedFiles)\n } else {\n dispatchCSSSyntaxActions(actions, compilation, symbolTable, emit)\n }\n }\n\n // Tier 1: Cross-syntax actions\n if (maxTier >= ComputationTier.CrossSyntax) {\n if (affectedFiles !== null) {\n dispatchCrossSyntaxActionsSubset(actions, compilation, symbolTable, emit, affectedFiles)\n } else {\n dispatchCrossSyntaxActions(actions, compilation, symbolTable, emit)\n }\n }\n\n // Tier 2+: Element-level actions require semantic model per file\n if (maxTier >= ComputationTier.ElementResolution) {\n const solidFiles = affectedFiles !== null\n ? [...compilation.solidTrees.keys()].filter(p => affectedFiles.has(p))\n : [...compilation.solidTrees.keys()]\n\n for (let fi = 0; fi < solidFiles.length; fi++) {\n const solidFilePath = solidFiles[fi]\n if (!solidFilePath) continue\n const model = compilation.getSemanticModel(solidFilePath)\n const elements = model.getElementNodes()\n\n if (maxTier >= ComputationTier.ElementResolution) {\n dispatchElementActions(actions, elements, model, emit)\n }\n if (maxTier >= ComputationTier.SelectiveLayoutFacts) {\n dispatchFactActions(actions, elements, model, emit)\n }\n if (maxTier >= ComputationTier.FullCascade) {\n dispatchCascadeActions(actions, elements, model, emit)\n dispatchConditionalDeltaActions(actions, elements, model, emit)\n }\n if (maxTier >= ComputationTier.AlignmentModel) {\n dispatchAlignmentActions(actions, elements, model, emit)\n }\n }\n }\n\n // Compilation-wide actions always run\n dispatchCompilationActions(actions, compilation, symbolTable, emit)\n }\n\n return {\n register(rule: AnalysisRule): void {\n rules.push(rule)\n },\n\n run(compilation): AnalysisResult {\n const { actions, maxTier } = setup()\n const diagnostics: Diagnostic[] = []\n const emit: Emit = (d) => { diagnostics.push(d) }\n dispatch(compilation, actions, maxTier, emit, null)\n return { diagnostics, maxTierComputed: maxTier }\n },\n\n runSubset(compilation, affectedFiles): AnalysisResult {\n const { actions, maxTier } = setup()\n const diagnostics: Diagnostic[] = []\n const emit: Emit = (d) => { diagnostics.push(d) }\n dispatch(compilation, actions, maxTier, emit, affectedFiles)\n return { diagnostics, maxTierComputed: maxTier }\n },\n }\n}\n\nfunction dispatchCSSSyntaxActions(actions: CollectedActions, compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit): void {\n if (actions.cssSyntax.length === 0) return\n\n for (const [, tree] of compilation.cssTrees) {\n for (let i = 0; i < actions.cssSyntax.length; i++) {\n const action = actions.cssSyntax[i]\n if (action) action(tree, symbolTable, emit)\n }\n }\n}\n\nfunction dispatchCSSSyntaxActionsSubset(actions: CollectedActions, compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit, affectedFiles: ReadonlySet<string>): void {\n if (actions.cssSyntax.length === 0) return\n\n for (const [path, tree] of compilation.cssTrees) {\n if (!affectedFiles.has(path)) continue\n for (let i = 0; i < actions.cssSyntax.length; i++) {\n const action = actions.cssSyntax[i]\n if (action) action(tree, symbolTable, emit)\n }\n }\n}\n\nfunction dispatchCrossSyntaxActions(actions: CollectedActions, compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit): void {\n if (actions.crossSyntax.length === 0) return\n\n for (const [, solidTree] of compilation.solidTrees) {\n for (let i = 0; i < actions.crossSyntax.length; i++) {\n const action = actions.crossSyntax[i]\n if (action) action(solidTree, symbolTable, emit)\n }\n }\n}\n\nfunction dispatchCrossSyntaxActionsSubset(actions: CollectedActions, compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit, affectedFiles: ReadonlySet<string>): void {\n if (actions.crossSyntax.length === 0) return\n\n for (const [path, solidTree] of compilation.solidTrees) {\n if (!affectedFiles.has(path)) continue\n for (let i = 0; i < actions.crossSyntax.length; i++) {\n const action = actions.crossSyntax[i]\n if (action) action(solidTree, symbolTable, emit)\n }\n }\n}\n\nfunction dispatchElementActions(actions: CollectedActions, elements: readonly ElementNode[], model: FileSemanticModel, emit: Emit): void {\n if (actions.element.length === 0) return\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n for (let j = 0; j < actions.element.length; j++) {\n const action = actions.element[j]\n if (action) action(element, model, emit)\n }\n }\n}\n\nfunction dispatchFactActions(actions: CollectedActions, elements: readonly ElementNode[], model: FileSemanticModel, emit: Emit): void {\n if (actions.factThunks.length === 0) return\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n\n for (let j = 0; j < actions.factThunks.length; j++) {\n const thunk = actions.factThunks[j]\n if (thunk) thunk.dispatch(element, model, model, emit)\n }\n }\n}\n\nfunction dispatchCascadeActions(actions: CollectedActions, elements: readonly ElementNode[], model: FileSemanticModel, emit: Emit): void {\n if (actions.cascade.length === 0) return\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n const cascade = model.getElementCascade(element.elementId)\n const snapshot = model.getSignalSnapshot(element.elementId)\n for (let j = 0; j < actions.cascade.length; j++) {\n const action = actions.cascade[j]\n if (action) action(element, cascade, snapshot, model, emit)\n }\n }\n}\n\nfunction dispatchConditionalDeltaActions(actions: CollectedActions, elements: readonly ElementNode[], model: FileSemanticModel, emit: Emit): void {\n if (actions.conditionalDelta.length === 0) return\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n const delta = model.getConditionalDelta(element.elementId)\n if (delta === null) continue\n for (let j = 0; j < actions.conditionalDelta.length; j++) {\n const action = actions.conditionalDelta[j]\n if (action) action(element, delta, model, emit)\n }\n }\n}\n\nfunction dispatchAlignmentActions(actions: CollectedActions, elements: readonly ElementNode[], model: FileSemanticModel, emit: Emit): void {\n if (actions.alignment.length === 0) return\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (!element) continue\n const context = model.getAlignmentContext(element.elementId)\n if (context === null) continue\n const cohort = model.getCohortStats(element.elementId)\n if (cohort === null) continue\n for (let j = 0; j < actions.alignment.length; j++) {\n const action = actions.alignment[j]\n if (action) action(element, context, cohort, model, emit)\n }\n }\n}\n\nfunction dispatchCompilationActions(actions: CollectedActions, compilation: StyleCompilation, symbolTable: SymbolTable, emit: Emit): void {\n if (actions.compilation.length === 0) return\n\n for (let i = 0; i < actions.compilation.length; i++) {\n const action = actions.compilation[i]\n if (action) action(compilation, symbolTable, emit)\n }\n}\n","/**\n * Exemption logic for layout property animation rules.\n *\n * Layout property transitions/animations can only cause CLS when the\n * animating element participates in normal document flow AND the\n * transition fires without user interaction. This module checks the\n * CSS context surrounding a declaration to determine exemptions:\n *\n * 1. Out-of-flow: The rule (or an ancestor in the CSS nesting chain)\n * has `position: fixed | absolute`, removing the element from flow.\n *\n * 2. Contained expand/collapse: `grid-template-rows` transitions where\n * the element's nested rules include `overflow: hidden | clip`, which\n * is the standard CSS-only expand/collapse pattern (0fr → 1fr).\n *\n * 3. User-interaction-gated: The selector includes state-indicating\n * attribute selectors (e.g., `[data-ready]`, `[data-expanded]`)\n * that indicate the transition only activates after a state change,\n * meaning the layout shift is within the 500ms user-input exclusion\n * window and does not count toward CLS scoring.\n */\n\nimport type { DeclarationEntity } from \"../../entities/declaration\"\nimport type { RuleEntity } from \"../../entities/rule\"\nimport type { AtRuleEntity } from \"../../entities/at-rule\"\n\nconst OUT_OF_FLOW_POSITIONS = new Set([\"fixed\", \"absolute\"])\n\nconst OVERFLOW_CONTAINMENT_VALUES = new Set([\"hidden\", \"clip\"])\n\n/**\n * Component-identifying attribute prefixes. These establish identity rather\n * than state, so they should NOT be treated as state-indicating selectors.\n */\nconst IDENTITY_ATTRIBUTE_NAMES = new Set([\"data-component\", \"data-slot\"])\n\n/**\n * Check if a layout property transition declaration is exempt from CLS warnings.\n *\n * @param declaration - The transition/transition-property declaration\n * @param layoutProperty - The specific layout property being transitioned (e.g., \"width\", \"grid-template-rows\")\n * @returns true if the declaration is exempt from layout animation warnings\n */\nexport function isLayoutAnimationExempt(\n declaration: DeclarationEntity,\n layoutProperty: string,\n): boolean {\n const rule = declaration.rule\n if (!rule) return false\n\n if (isInOutOfFlowContext(rule)) return true\n if (isContainedExpandCollapse(rule, layoutProperty)) return true\n if (isUserGatedTransition(rule)) return true\n\n return false\n}\n\n/**\n * Walk the rule and its CSS nesting ancestors to check if any establish\n * out-of-flow positioning (position: fixed | absolute).\n */\nfunction isInOutOfFlowContext(rule: RuleEntity): boolean {\n let current: RuleEntity | AtRuleEntity | null = rule\n\n while (current !== null) {\n if (current.kind === \"rule\") {\n if (hasOutOfFlowPosition(current)) return true\n current = current.parent\n } else {\n // AtRuleEntity — skip but continue walking\n current = current.parent\n }\n }\n\n return false\n}\n\n/**\n * Check if a rule has a position declaration with fixed or absolute value.\n */\nfunction hasOutOfFlowPosition(rule: RuleEntity): boolean {\n const positionDecls = rule.declarationIndex.get(\"position\")\n if (!positionDecls) return false\n\n for (let i = 0; i < positionDecls.length; i++) {\n const decl = positionDecls[i]\n if (!decl) continue\n const value = decl.value.trim().toLowerCase()\n if (OUT_OF_FLOW_POSITIONS.has(value)) return true\n }\n\n return false\n}\n\n/**\n * For `grid-template-rows` transitions, check if the rule has nested\n * rules with `overflow: hidden | clip`. This is the standard CSS-only\n * expand/collapse pattern where 0fr → 1fr animates height while the\n * inner wrapper clips overflow.\n */\nfunction isContainedExpandCollapse(rule: RuleEntity, layoutProperty: string): boolean {\n if (layoutProperty !== \"grid-template-rows\" && layoutProperty !== \"grid-template-columns\") {\n return false\n }\n\n return hasOverflowContainmentInNestedRules(rule)\n}\n\n/**\n * Recursively check if any nested rule (direct child or deeper) has\n * overflow: hidden | clip.\n */\nfunction hasOverflowContainmentInNestedRules(rule: RuleEntity): boolean {\n for (let i = 0; i < rule.nestedRules.length; i++) {\n const nested = rule.nestedRules[i]\n if (!nested) continue\n if (hasOverflowContainment(nested)) return true\n if (hasOverflowContainmentInNestedRules(nested)) return true\n }\n\n return false\n}\n\n/**\n * Check if a rule has overflow: hidden | clip.\n */\nfunction hasOverflowContainment(rule: RuleEntity): boolean {\n const overflowDecls = rule.declarationIndex.get(\"overflow\")\n if (overflowDecls) {\n for (let i = 0; i < overflowDecls.length; i++) {\n const decl = overflowDecls[i];\n if (!decl) continue;\n const value = decl.value.trim().toLowerCase()\n if (OVERFLOW_CONTAINMENT_VALUES.has(value)) return true\n }\n }\n\n const overflowX = rule.declarationIndex.get(\"overflow-x\")\n if (overflowX) {\n for (let i = 0; i < overflowX.length; i++) {\n const decl = overflowX[i];\n if (!decl) continue;\n const value = decl.value.trim().toLowerCase()\n if (OVERFLOW_CONTAINMENT_VALUES.has(value)) return true\n }\n }\n\n const overflowY = rule.declarationIndex.get(\"overflow-y\")\n if (overflowY) {\n for (let i = 0; i < overflowY.length; i++) {\n const decl = overflowY[i];\n if (!decl) continue;\n const value = decl.value.trim().toLowerCase()\n if (OVERFLOW_CONTAINMENT_VALUES.has(value)) return true\n }\n }\n\n return false\n}\n\n/**\n * Check if the rule's selector(s) include state-indicating attribute\n * selectors beyond component identity attributes.\n *\n * Selectors like `[data-component=\"sidebar\"][data-ready]` indicate\n * that the rule only matches after a state change (e.g., user interaction,\n * mount completion). Transitions gated behind such selectors fire within\n * the browser's user-input attribution window and are excluded from CLS\n * scoring.\n *\n * Identity attributes (`data-component`, `data-slot`) are not state\n * indicators — they're structural. Only additional attribute selectors\n * beyond identity qualify as state gates.\n */\nfunction isUserGatedTransition(rule: RuleEntity): boolean {\n const selectors = rule.selectors\n if (selectors.length === 0) return false\n\n // ALL selectors in the rule must be user-gated (a rule can have\n // comma-separated selectors; if any matches without a state gate,\n // the transition can fire without user interaction).\n for (let i = 0; i < selectors.length; i++) {\n const sel = selectors[i];\n if (!sel) continue;\n if (!selectorHasStateAttribute(sel.anchor.attributes)) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Check if a selector's attribute constraints include at least one\n * state-indicating attribute (not an identity attribute).\n */\nfunction selectorHasStateAttribute(\n attributes: readonly { name: string; operator: string; value: string | null }[],\n): boolean {\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes[i]\n if (!attr) continue\n if (IDENTITY_ATTRIBUTE_NAMES.has(attr.name)) continue\n // Any non-identity attribute selector is a state gate\n return true\n }\n\n return false\n}\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { findPropertyInList, findTransitionProperty } from \"../../../css/parser/value-util\"\nimport { LAYOUT_TRANSITION_PROPERTIES } from \"../../../css/layout-taxonomy\"\nimport { isLayoutAnimationExempt } from \"../../../css/rules/animation/layout-animation-exempt\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n transitionLayoutProperty:\n \"Transition '{{property}}' in '{{declaration}}' animates layout-affecting geometry. Prefer transform/opacity to avoid CLS.\",\n} as const\n\nexport const cssLayoutTransitionLayoutProperty = defineAnalysisRule({\n id: \"css-layout-transition-layout-property\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow transitions that animate layout-affecting geometry properties.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((_compilation, symbolTable, emit) => {\n const declarations = symbolTable.declarationsForProperties(\"transition\", \"transition-property\")\n for (let i = 0; i < declarations.length; i++) {\n const declaration = declarations[i]\n if (!declaration) continue\n const property = declaration.property.toLowerCase()\n\n const target = property === \"transition\"\n ? findTransitionProperty(declaration.value, LAYOUT_TRANSITION_PROPERTIES)\n : findPropertyInList(declaration.value, LAYOUT_TRANSITION_PROPERTIES)\n if (!target) continue\n if (isLayoutAnimationExempt(declaration, target)) continue\n\n emit(createCSSDiagnostic(\n declaration.file.path, declaration.startLine, declaration.startColumn,\n cssLayoutTransitionLayoutProperty.id, \"transitionLayoutProperty\",\n resolveMessage(messages.transitionLayoutProperty, {\n property: target,\n declaration: declaration.property,\n }), \"warn\",\n))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { normalizeAnimationName } from \"../../../css/parser/value-util\"\nimport { splitTopLevelComma, splitTopLevelWhitespace } from \"../../../css/parser/value-tokenizer\"\nimport { isAnimationKeywordToken } from \"../../../css/parser/animation-transition-keywords\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\nimport type { KeyframeLayoutMutation } from \"../../symbols/keyframes\"\n\nconst messages = {\n animationLayoutProperty:\n \"Animation '{{animation}}' mutates layout-affecting '{{property}}', which can trigger CLS. Prefer transform/opacity or reserve geometry.\",\n} as const\n\nexport const cssLayoutAnimationLayoutProperty = defineAnalysisRule({\n id: \"css-layout-animation-layout-property\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow keyframe animations that mutate layout-affecting properties and can trigger CLS.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((_compilation, symbolTable, emit) => {\n // Build risky keyframes map from symbol table\n const riskyKeyframes = new Map<string, readonly KeyframeLayoutMutation[]>()\n for (const [name, symbol] of symbolTable.keyframes) {\n if (symbol.layoutMutations.length > 0) {\n riskyKeyframes.set(name, symbol.layoutMutations)\n }\n }\n if (riskyKeyframes.size === 0) return\n\n const declarations = symbolTable.declarationsForProperties(\"animation\", \"animation-name\")\n for (let i = 0; i < declarations.length; i++) {\n const declaration = declarations[i]\n if (!declaration) continue\n if (declaration.rule === null) continue\n\n const property = declaration.property.toLowerCase()\n const names = property === \"animation\"\n ? parseAnimationShorthandNames(declaration.value, riskyKeyframes)\n : parseAnimationNameList(declaration.value)\n if (names.length === 0) continue\n\n const match = firstRiskyAnimationName(names, riskyKeyframes)\n if (!match) continue\n\n emit(createCSSDiagnostic(\n declaration.file.path, declaration.startLine, declaration.startColumn,\n cssLayoutAnimationLayoutProperty.id, \"animationLayoutProperty\",\n resolveMessage(messages.animationLayoutProperty, {\n animation: match.name,\n property: match.property,\n }), \"warn\",\n))\n }\n })\n },\n})\n\nfunction parseAnimationNameList(raw: string): readonly string[] {\n const parts = splitTopLevelComma(raw)\n const out: string[] = []\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part) continue\n const name = normalizeAnimationName(part)\n if (!name) continue\n if (name === \"none\") continue\n out.push(name)\n }\n return out\n}\n\nfunction parseAnimationShorthandNames(\n raw: string,\n riskyKeyframes: ReadonlyMap<string, readonly KeyframeLayoutMutation[]>,\n): readonly string[] {\n const parts = splitTopLevelComma(raw)\n const out: string[] = []\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part) continue\n const name = parseAnimationLayerName(part, riskyKeyframes)\n if (!name) continue\n out.push(name)\n }\n return out\n}\n\nfunction parseAnimationLayerName(\n layer: string,\n riskyKeyframes: ReadonlyMap<string, readonly KeyframeLayoutMutation[]>,\n): string | null {\n const parts = splitTopLevelWhitespace(layer.trim().toLowerCase())\n const candidates: string[] = []\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (!part) continue\n const token = normalizeAnimationName(part)\n if (!token) continue\n if (isAnimationKeywordToken(token)) continue\n if (riskyKeyframes.has(token)) return token\n candidates.push(token)\n }\n if (candidates.length === 1) return candidates[0] ?? null\n return null\n}\n\nfunction firstRiskyAnimationName(\n names: readonly string[],\n riskyKeyframes: ReadonlyMap<string, readonly KeyframeLayoutMutation[]>,\n): { name: string; property: string } | null {\n for (let i = 0; i < names.length; i++) {\n const name = names[i]\n if (!name) continue\n const mutations = riskyKeyframes.get(name)\n if (!mutations || mutations.length === 0) continue\n const firstMutation = mutations[0]\n if (!firstMutation) continue\n return { name, property: firstMutation.property }\n }\n return null\n}\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { AtRuleEntity } from \"../../../css/entities/at-rule\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unstableFontSwap:\n \"`@font-face` for '{{family}}' uses `font-display: {{display}}` without metric overrides (for example `size-adjust`), which can cause CLS when the webfont swaps in.\",\n} as const\n\nconst SWAP_DISPLAYS = new Set([\"swap\", \"fallback\"])\n\nexport const cssLayoutFontSwapInstability = defineAnalysisRule({\n id: \"css-layout-font-swap-instability\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require metric overrides for swapping webfonts to reduce layout shifts during font load.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((_compilation, symbolTable, emit) => {\n const usedFamilies = symbolTable.usedFontFamilies\n if (usedFamilies.size === 0) return\n\n for (const family of usedFamilies) {\n const fontFaces = symbolTable.fontFaces.get(family)\n if (!fontFaces) continue\n\n let hasAnyMetricsAdjustedCandidate = false\n const pendingReports: {\n declaration: { file: { path: string }; startLine: number; startColumn: number; property: string }\n display: string\n }[] = []\n\n for (let i = 0; i < fontFaces.length; i++) {\n const ff = fontFaces[i]\n if (!ff) continue\n if (!ff.display) continue\n if (!SWAP_DISPLAYS.has(ff.display)) continue\n if (!ff.hasWebFontSource) continue\n\n // Find the font-display declaration within the @font-face entity\n const displayDecl = findFontDisplayDeclaration(ff.entity)\n if (!displayDecl) continue\n\n if (ff.hasEffectiveMetricOverrides) {\n hasAnyMetricsAdjustedCandidate = true\n continue\n }\n\n pendingReports.push({ declaration: displayDecl, display: ff.display })\n }\n\n if (pendingReports.length === 0) continue\n if (hasAnyMetricsAdjustedCandidate) continue\n\n for (let i = 0; i < pendingReports.length; i++) {\n const report = pendingReports[i]\n if (!report) continue\n emit(createCSSDiagnostic(\n report.declaration.file.path, report.declaration.startLine, report.declaration.startColumn,\n cssLayoutFontSwapInstability.id, \"unstableFontSwap\",\n resolveMessage(messages.unstableFontSwap, {\n family,\n display: report.display,\n }), \"warn\",\n))\n }\n }\n })\n },\n})\n\nfunction findFontDisplayDeclaration(entity: AtRuleEntity): { file: { path: string }; startLine: number; startColumn: number; property: string } | null {\n for (let i = 0; i < entity.declarations.length; i++) {\n const decl = entity.declarations[i]\n if (!decl) continue\n if (decl.property.toLowerCase() === \"font-display\") return decl\n }\n return null\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n undefinedClass: \"CSS class '{{className}}' is not defined in project CSS files\",\n} as const\n\nexport const jsxNoUndefinedCssClass = defineAnalysisRule({\n id: \"jsx-no-undefined-css-class\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Detect undefined CSS class names in JSX\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, symbolTable, emit) => {\n const seenByElementId = new Map<number, Set<string>>()\n\n for (const [elementId, idx] of solidTree.staticClassTokensByElementId) {\n if (idx.hasDynamicClass) continue\n const tokens = idx.tokens\n for (let i = 0; i < tokens.length; i++) {\n const name = tokens[i]\n if (!name) continue\n const existing = seenByElementId.get(elementId)\n if (existing) { if (existing.has(name)) continue; existing.add(name) }\n else { const next = new Set<string>(); next.add(name); seenByElementId.set(elementId, next) }\n if (symbolTable.hasClassName(name)) continue\n if (solidTree.inlineStyleClassNames.has(name)) continue\n\n const element = solidTree.jsxElements.find(e => e.id === elementId)\n if (!element) continue\n\n emit(createDiagnostic(\n solidTree.filePath, element.node, solidTree.sourceFile,\n jsxNoUndefinedCssClass.id, \"undefinedClass\",\n resolveMessage(messages.undefinedClass, { className: name }), \"error\",\n ))\n }\n }\n\n for (const [elementId, idx] of solidTree.staticClassListKeysByElementId) {\n const keys = idx.keys\n for (let i = 0; i < keys.length; i++) {\n const name = keys[i]\n if (!name) continue\n const existing = seenByElementId.get(elementId)\n if (existing) { if (existing.has(name)) continue; existing.add(name) }\n else { const next = new Set<string>(); next.add(name); seenByElementId.set(elementId, next) }\n if (symbolTable.hasClassName(name)) continue\n if (solidTree.inlineStyleClassNames.has(name)) continue\n\n const element = solidTree.jsxElements.find(e => e.id === elementId)\n if (!element) continue\n\n emit(createDiagnostic(\n solidTree.filePath, element.node, solidTree.sourceFile,\n jsxNoUndefinedCssClass.id, \"undefinedClass\",\n resolveMessage(messages.undefinedClass, { className: name }), \"error\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unreferencedClass: \"CSS class '{{className}}' is defined but not referenced by static JSX class attributes\",\n} as const\n\nexport const cssNoUnreferencedComponentClass = defineAnalysisRule({\n id: \"css-no-unreferenced-component-class\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Detect CSS classes that are never referenced by static JSX class attributes.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, symbolTable, emit) => {\n const used = new Set<string>()\n\n for (const [, solidTree] of compilation.solidTrees) {\n for (const [, idx] of solidTree.staticClassTokensByElementId) {\n if (idx.hasDynamicClass) continue\n const tokens = idx.tokens\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (token) used.add(token)\n }\n }\n\n for (const [, idx] of solidTree.staticClassListKeysByElementId) {\n const keys = idx.keys\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n if (key) used.add(key)\n }\n }\n }\n\n for (const [name] of symbolTable.classNames) {\n if (used.has(name)) continue\n const selectorSymbols = symbolTable.getSelectorsByClassName(name)\n if (selectorSymbols.length === 0) continue\n const selectorSymbol = selectorSymbols[0]\n if (!selectorSymbol) continue\n const rule = selectorSymbol.entity.rule\n\n emit(createCSSDiagnostic(\n rule.file.path, rule.startLine, rule.startColumn,\n cssNoUnreferencedComponentClass.id, \"unreferencedClass\",\n resolveMessage(messages.unreferencedClass, { className: name }), \"warn\",\n ))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { isBooleanish, isDefinitelyNonBoolean } from \"../../../solid/util/static-value\"\nimport { isBooleanType, isDefinitelyNonBooleanType } from \"../../../solid/util/type-flags\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n nonBooleanValue: \"classList value for `{{name}}` must be boolean.\",\n} as const\n\nexport const jsxClasslistBooleanValues = defineAnalysisRule({\n id: \"jsx-classlist-boolean-values\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Require classList values to be boolean-like expressions.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.classListProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const n = getPropertyKeyName(p.name)\n if (!n) continue\n if (isBooleanish(p.initializer)) continue\n if (isDefinitelyNonBoolean(p.initializer)) {\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxClasslistBooleanValues.id, \"nonBooleanValue\", resolveMessage(messages.nonBooleanValue, { name: n }), \"error\"))\n return\n }\n if (isBooleanType(solidTree, p.initializer)) continue\n if (!isDefinitelyNonBooleanType(solidTree, p.initializer)) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxClasslistBooleanValues.id, \"nonBooleanValue\", resolveMessage(messages.nonBooleanValue, { name: n }), \"error\"))\n }\n })\n },\n})\n","/**\n * TypeScript Type Flag Constants\n *\n * Named constants for ts.TypeFlags values used in type analysis.\n * See: https://github.com/microsoft/TypeScript/blob/main/src/compiler/types.ts\n */\n\nimport type ts from \"typescript\";\nimport type { SolidSyntaxTree as SolidGraph } from \"../../compilation/core/solid-syntax-tree\"\n\n/** ts.TypeFlags.Any | ts.TypeFlags.Unknown */\nexport const TS_ANY_OR_UNKNOWN = 1 | 2;\n\n/** ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral (16 | 512) */\nexport const TS_BOOLEAN_LIKE = 528;\n\n/** ts.TypeFlags.Number | ts.TypeFlags.NumberLiteral | ts.TypeFlags.BigIntLiteral + enum flags */\nexport const TS_NUMBER_LIKE = 296;\n\n/** ts.TypeFlags.String | ts.TypeFlags.StringLiteral | ts.TypeFlags.TemplateLiteral + enum string flags */\nexport const TS_STRING_LIKE = 402653316;\n\n/** ts.TypeFlags.Object */\nexport const TS_OBJECT_LIKE = 524288;\n\n/**\n * Check if a node's TypeScript type is exclusively boolean.\n * Returns false for any/unknown, union types containing non-boolean members,\n * or nodes whose type cannot be resolved.\n */\nexport function isBooleanType(solid: SolidGraph, node: ts.Node): boolean {\n const info = solid.typeResolver.getType(node);\n if (!info) return false;\n\n if ((info.flags & TS_ANY_OR_UNKNOWN) !== 0) return false;\n if ((info.flags & TS_BOOLEAN_LIKE) === 0) return false;\n if ((info.flags & TS_STRING_LIKE) !== 0) return false;\n if ((info.flags & TS_NUMBER_LIKE) !== 0) return false;\n if ((info.flags & TS_OBJECT_LIKE) !== 0) return false;\n return true;\n}\n\n/**\n * Check if a node's TypeScript type is definitively not boolean.\n * Returns false for any/unknown (ambiguous) or actual boolean types.\n */\nexport function isDefinitelyNonBooleanType(solid: SolidGraph, node: ts.Node): boolean {\n const info = solid.typeResolver.getType(node);\n if (!info) return false;\n\n if ((info.flags & TS_ANY_OR_UNKNOWN) !== 0) return false;\n if (isBooleanType(solid, node)) return false;\n return true;\n}\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getScopeFor, getVariableByNameInScope } from \"../../../solid/queries/scope\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n accessorReference: \"Signal accessor `{{name}}` must be called in classList value (use {{name}}()).\",\n} as const\n\nexport const jsxClasslistNoAccessorReference = defineAnalysisRule({\n id: \"jsx-classlist-no-accessor-reference\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Disallow passing accessor references directly as classList values.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.classListProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n let v: ts.Identifier\n if (ts.isShorthandPropertyAssignment(p)) {\n v = p.name\n } else if (ts.isPropertyAssignment(p) && ts.isIdentifier(p.initializer)) {\n v = p.initializer\n } else {\n continue\n }\n const scope = getScopeFor(solidTree, v)\n const variable = getVariableByNameInScope(solidTree, v.text, scope)\n if (!variable) continue\n\n const isAccessorLike = variable.reactiveKind === \"accessor\" || variable.reactiveKind === \"signal\"\n if (!isAccessorLike) continue\n\n const typeInfo = solidTree.typeResolver.getType(v)\n if (typeInfo) {\n if (!typeInfo.isAccessor && !typeInfo.isSignal) continue\n }\n\n emit(createDiagnostic(solidTree.filePath, v, solidTree.sourceFile, jsxClasslistNoAccessorReference.id, \"accessorReference\", resolveMessage(messages.accessorReference, { name: v.text }), \"error\"))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n constantEntry: \"classList entry `{{name}}: {{value}}` is constant; move it to static class.\",\n} as const\n\nexport const jsxClasslistNoConstantLiterals = defineAnalysisRule({\n id: \"jsx-classlist-no-constant-literals\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow classList entries with constant true/false values.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.classListProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const n = getPropertyKeyName(p.name)\n if (!n) continue\n const val = p.initializer\n if (val.kind !== ts.SyntaxKind.TrueKeyword && val.kind !== ts.SyntaxKind.FalseKeyword) continue\n emit(createDiagnostic(solidTree.filePath, val, solidTree.sourceFile, jsxClasslistNoConstantLiterals.id, \"constantEntry\", resolveMessage(messages.constantEntry, { name: n, value: val.kind === ts.SyntaxKind.TrueKeyword ? \"true\" : \"false\" }), \"warn\"))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n nonStaticKey: \"classList key must be statically known for reliable class mapping.\",\n} as const\n\nexport const jsxClasslistStaticKeys = defineAnalysisRule({\n id: \"jsx-classlist-static-keys\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Require classList keys to be static and non-computed.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.classListProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (ts.isSpreadAssignment(p)) continue\n if (!ts.isPropertyAssignment(p)) {\n emit(createDiagnostic(solidTree.filePath, p, solidTree.sourceFile, jsxClasslistStaticKeys.id, \"nonStaticKey\", resolveMessage(messages.nonStaticKey), \"error\"))\n continue\n }\n if (ts.isComputedPropertyName(p.name)) continue\n if (ts.isIdentifier(p.name)) continue\n if (ts.isStringLiteral(p.name)) continue\n emit(createDiagnostic(solidTree.filePath, p.name, solidTree.sourceFile, jsxClasslistStaticKeys.id, \"nonStaticKey\", resolveMessage(messages.nonStaticKey), \"error\"))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { isKebabCase, toKebabCase } from \"@drskillissue/ganko-shared\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n kebabStyleKey: \"Style key `{{name}}` should be `{{kebab}}` in Solid style objects.\",\n} as const\n\nexport const jsxStyleKebabCaseKeys = defineAnalysisRule({\n id: \"jsx-style-kebab-case-keys\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Require kebab-case keys in JSX style object literals.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.styleProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n if (ts.isComputedPropertyName(p.name)) continue\n const n = getPropertyKeyName(p.name)\n if (!n) continue\n const kebab = n.includes(\"-\") ? n.toLowerCase() : toKebabCase(n)\n if (n === kebab && isKebabCase(n)) continue\n\n emit(createDiagnostic(solidTree.filePath, p.name, solidTree.sourceFile, jsxStyleKebabCaseKeys.id, \"kebabStyleKey\", resolveMessage(messages.kebabStyleKey, { name: n, kebab }), \"error\"))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n functionStyleValue: \"Style value for `{{name}}` is a function; pass computed value instead.\",\n} as const\n\nexport const jsxStyleNoFunctionValues = defineAnalysisRule({\n id: \"jsx-style-no-function-values\",\n severity: \"error\",\n messages,\n meta: {\n description: \"Disallow function values in JSX style objects.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const properties = solidTree.styleProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const n = getPropertyKeyName(p.name)\n if (!n) continue\n const v = p.initializer\n if (ts.isArrowFunction(v) || ts.isFunctionExpression(v)) {\n emit(createDiagnostic(solidTree.filePath, v, solidTree.sourceFile, jsxStyleNoFunctionValues.id, \"functionStyleValue\", resolveMessage(messages.functionStyleValue, { name: n }), \"error\"))\n continue\n }\n if (ts.isIdentifier(v) && solidTree.typeResolver.isCallableType(v)) {\n emit(createDiagnostic(solidTree.filePath, v, solidTree.sourceFile, jsxStyleNoFunctionValues.id, \"functionStyleValue\", resolveMessage(messages.functionStyleValue, { name: n }), \"error\"))\n }\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unusedInlineVar: \"Inline custom property `{{name}}` is never read via var({{name}}).\",\n} as const\n\nexport const jsxStyleNoUnusedCustomProp = defineAnalysisRule({\n id: \"jsx-style-no-unused-custom-prop\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Detect inline style custom properties that are never consumed by CSS var() references.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, symbolTable, emit) => {\n // Collect used CSS variable names from symbol table\n const usedVarNames = new Set<string>()\n for (const [name] of symbolTable.customProperties) {\n usedVarNames.add(name)\n }\n\n // Skip files with classList (dynamic class application makes usage unpredictable)\n if (solidTree.jsxClassListAttributes.length > 0) return\n\n // Check for files with only static class literals\n let hasNonStaticClass = false\n for (const [, idx] of solidTree.staticClassTokensByElementId) {\n if (idx.hasDynamicClass) { hasNonStaticClass = true; break }\n }\n if (hasNonStaticClass) return\n\n const properties = solidTree.styleProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const n = getPropertyKeyName(p.name)\n if (!n || !n.startsWith(\"--\")) continue\n if (usedVarNames.has(n)) continue\n\n emit(createDiagnostic(\n solidTree.filePath,\n p.name,\n solidTree.sourceFile,\n jsxStyleNoUnusedCustomProp.id,\n \"unusedInlineVar\",\n resolveMessage(messages.unusedInlineVar, { name: n }),\n \"warn\",\n ))\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport type { SelectorEntity } from \"../../../css/entities/selector\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { SymbolTable } from \"../../symbols/symbol-table\"\nimport { LAYOUT_CLASS_GEOMETRY_PROPERTIES } from \"../../../css/layout-taxonomy\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { constantTruthiness } from \"../../../solid/util/static-value\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n classListGeometryToggle:\n \"classList toggles '{{className}}', and matching CSS changes layout-affecting '{{property}}', which can cause CLS.\",\n} as const\n\nconst OUT_OF_FLOW_POSITIONS = new Set([\"fixed\", \"absolute\"])\n\nexport const jsxLayoutClasslistGeometryToggle = defineAnalysisRule({\n id: \"jsx-layout-classlist-geometry-toggle\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Flag classList-driven class toggles that map to layout-affecting CSS geometry changes.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, symbolTable, emit) => {\n const classGeometryIndex = symbolTable.layoutPropertiesByClassToken\n if (classGeometryIndex.size === 0) return\n\n const properties = solidTree.classListProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const objectProperty = entry.property\n if (!ts.isPropertyAssignment(objectProperty)) continue\n\n const className = getPropertyKeyName(objectProperty.name)\n if (!className) continue\n if (!isDynamicallyToggleable(objectProperty.initializer)) continue\n\n const riskyProperty = classGeometryIndex.get(className)\n if (!riskyProperty || riskyProperty.length === 0) continue\n\n const property = firstGeometryProperty(riskyProperty)\n if (!property) continue\n\n if (classEstablishesOutOfFlow(className, symbolTable)) continue\n\n emit(\n createDiagnostic(\n solidTree.filePath,\n objectProperty.initializer,\n solidTree.sourceFile,\n jsxLayoutClasslistGeometryToggle.id,\n \"classListGeometryToggle\",\n resolveMessage(messages.classListGeometryToggle, { className, property }),\n \"warn\",\n ),\n )\n }\n })\n },\n})\n\nfunction classEstablishesOutOfFlow(\n className: string,\n symbolTable: SymbolTable,\n): boolean {\n for (const [, symbol] of symbolTable.selectors) {\n if (!selectorAnchorHasClass(symbol.entity, className)) continue\n\n const positionDecls = symbol.entity.rule.declarationIndex.get(\"position\")\n if (!positionDecls) continue\n\n for (let j = 0; j < positionDecls.length; j++) {\n const decl = positionDecls[j]\n if (!decl) continue\n const value = decl.value.trim().toLowerCase()\n if (OUT_OF_FLOW_POSITIONS.has(value)) return true\n }\n }\n return false\n}\n\nfunction selectorAnchorHasClass(selector: SelectorEntity, className: string): boolean {\n const classes = selector.anchor.classes\n for (let i = 0; i < classes.length; i++) {\n if (classes[i] === className) return true\n }\n return false\n}\n\nfunction firstGeometryProperty(properties: readonly string[]): string | null {\n for (let i = 0; i < properties.length; i++) {\n const property = properties[i]\n if (!property) continue\n if (!LAYOUT_CLASS_GEOMETRY_PROPERTIES.has(property)) continue\n return property\n }\n return null\n}\n\nfunction isDynamicallyToggleable(node: ts.Node): boolean {\n return constantTruthiness(node) === null\n}\n","import type { JSXElementEntity } from \"../../../solid/entities/jsx\"\nimport type { SolidSyntaxTree } from \"../../core/solid-syntax-tree\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getJSXElementsByTag, getStaticNumericJSXAttributeValue } from \"../../../solid/queries\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n inconsistentPictureRatio:\n \"`<picture>` source ratio {{sourceRatio}} differs from fallback img ratio {{imgRatio}}, which can cause reserved-space mismatch and CLS.\",\n} as const\n\nconst RATIO_DELTA_THRESHOLD = 0.02\n\nexport const jsxLayoutPictureSourceRatioConsistency = defineAnalysisRule({\n id: \"jsx-layout-picture-source-ratio-consistency\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require consistent intrinsic aspect ratios across <picture> sources and fallback image.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const pictures = getJSXElementsByTag(solidTree, \"picture\")\n for (let j = 0; j < pictures.length; j++) {\n const picture = pictures[j]\n if (!picture) continue\n const mismatch = firstPictureRatioMismatch(solidTree, picture)\n if (!mismatch) continue\n\n emit(createDiagnostic(\n solidTree.filePath,\n picture.node,\n solidTree.sourceFile,\n jsxLayoutPictureSourceRatioConsistency.id,\n \"inconsistentPictureRatio\",\n resolveMessage(messages.inconsistentPictureRatio, {\n sourceRatio: mismatch.sourceRatio,\n imgRatio: mismatch.imgRatio,\n }),\n \"warn\",\n ))\n }\n })\n },\n})\n\nfunction firstPictureRatioMismatch(tree: SolidSyntaxTree, picture: JSXElementEntity): { sourceRatio: string; imgRatio: string } | null {\n let fallbackRatio: number | null = null\n const pendingSourceRatios: number[] = []\n\n for (let i = 0; i < picture.childElements.length; i++) {\n const child = picture.childElements[i]\n if (!child) continue\n const tag = child.tagName\n if (!tag) continue\n\n if (tag === \"source\") {\n const sourceRatio = elementIntrinsicRatio(tree, child)\n if (sourceRatio === null) continue\n if (fallbackRatio === null) { pendingSourceRatios.push(sourceRatio); continue }\n if (isRatioEquivalent(sourceRatio, fallbackRatio)) continue\n return { sourceRatio: formatRatio(sourceRatio), imgRatio: formatRatio(fallbackRatio) }\n }\n\n if (tag !== \"img\") continue\n if (fallbackRatio !== null) continue\n fallbackRatio = elementIntrinsicRatio(tree, child)\n if (fallbackRatio === null) continue\n\n for (let j = 0; j < pendingSourceRatios.length; j++) {\n const sourceRatio = pendingSourceRatios[j]\n if (sourceRatio === undefined) continue\n if (isRatioEquivalent(sourceRatio, fallbackRatio)) continue\n return { sourceRatio: formatRatio(sourceRatio), imgRatio: formatRatio(fallbackRatio) }\n }\n }\n\n return null\n}\n\nfunction elementIntrinsicRatio(tree: SolidSyntaxTree, element: JSXElementEntity): number | null {\n const width = getStaticNumericJSXAttributeValue(tree, element, \"width\")\n const height = getStaticNumericJSXAttributeValue(tree, element, \"height\")\n if (width === null || height === null || width <= 0 || height <= 0) return null\n return width / height\n}\n\nfunction isRatioEquivalent(left: number, right: number): boolean {\n const delta = Math.abs(left - right)\n const baseline = Math.max(Math.abs(left), Math.abs(right), 1)\n return delta / baseline <= RATIO_DELTA_THRESHOLD\n}\n\nfunction formatRatio(value: number): string {\n return value.toFixed(3)\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n duplicateClassToken: \"Class token `{{name}}` appears in both class and classList.\",\n} as const\n\nexport const jsxNoDuplicateClassTokenClassClasslist = defineAnalysisRule({\n id: \"jsx-no-duplicate-class-token-class-classlist\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow duplicate class tokens between class and classList on the same JSX element.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.CrossSyntax },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n for (const [elementId, classIndex] of solidTree.staticClassTokensByElementId) {\n if (classIndex.hasDynamicClass) continue\n const classListIndex = solidTree.staticClassListKeysByElementId.get(elementId)\n if (!classListIndex || classListIndex.hasDynamic || classListIndex.keys.length === 0) continue\n if (classIndex.tokens.length === 0) continue\n\n const classListSet = new Set<string>()\n for (let j = 0; j < classListIndex.keys.length; j++) {\n const key = classListIndex.keys[j]\n if (!key) continue\n classListSet.add(key)\n }\n\n const element = solidTree.jsxElements.find(e => e.id === elementId)\n if (!element) continue\n\n const seen = new Set<string>()\n for (let j = 0; j < classIndex.tokens.length; j++) {\n const token = classIndex.tokens[j]\n if (!token) continue\n if (seen.has(token)) continue\n seen.add(token)\n if (!classListSet.has(token)) continue\n\n emit(createDiagnostic(\n solidTree.filePath,\n element.node,\n solidTree.sourceFile,\n jsxNoDuplicateClassTokenClassClasslist.id,\n \"duplicateClassToken\",\n resolveMessage(messages.duplicateClassToken, { name: token }),\n \"warn\",\n ))\n }\n }\n })\n },\n})\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { getStaticStringValue, getStaticNumericValue, getStaticStringFromJSXValue } from \"../../../solid/util/static-value\"\nimport { getActivePolicy, getActivePolicyName } from \"../../../css/policy\"\nimport { parsePxValue, parseUnitlessValue, parseEmValue } from \"../../../css/parser/value-util\"\nimport { toKebabCase } from \"@drskillissue/ganko-shared\"\nimport { getJSXAttributeEntity } from \"../../../solid/queries/jsx\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n fontTooSmall: \"Inline style `{{prop}}: {{value}}` ({{resolved}}px) is below the minimum `{{min}}px` for policy `{{policy}}`.\",\n lineHeightTooSmall: \"Inline style `line-height: {{value}}` is below the minimum `{{min}}` for policy `{{policy}}`.\",\n heightTooSmall: \"Inline style `{{prop}}: {{value}}` ({{resolved}}px) is below the minimum `{{min}}px` for interactive elements in policy `{{policy}}`.\",\n letterSpacingTooSmall: \"Inline style `letter-spacing: {{value}}` ({{resolved}}em) is below the minimum `{{min}}em` for policy `{{policy}}`.\",\n wordSpacingTooSmall: \"Inline style `word-spacing: {{value}}` ({{resolved}}em) is below the minimum `{{min}}em` for policy `{{policy}}`.\",\n} as const\n\nconst INLINE_TOUCH_TARGET_KEYS = new Set([\"height\", \"min-height\", \"width\", \"min-width\"])\nconst INTERACTIVE_HTML_TAGS = new Set([\"button\", \"a\", \"input\", \"select\", \"textarea\", \"label\", \"summary\"])\nconst INTERACTIVE_ARIA_ROLES = new Set([\"button\", \"link\", \"checkbox\", \"radio\", \"combobox\", \"listbox\", \"menuitem\", \"menuitemcheckbox\", \"menuitemradio\", \"option\", \"switch\", \"tab\"])\n\nfunction normalizeKey(key: string): string {\n if (key.includes(\"-\")) return key.toLowerCase()\n return toKebabCase(key)\n}\n\nfunction formatRounded(value: number): string {\n return Math.round(value * 100) / 100 + \"\"\n}\n\nexport const jsxStylePolicy = defineAnalysisRule({\n id: \"jsx-style-policy\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Enforce accessibility policy thresholds on inline JSX style objects.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.ElementResolution },\n register(registry) {\n registry.registerCrossSyntaxAction((solidTree, _symbolTable, emit) => {\n const policy = getActivePolicy()\n if (policy === null) return\n const name = getActivePolicyName() ?? \"\"\n\n const properties = solidTree.styleProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const key = getPropertyKeyName(p.name)\n if (!key) continue\n const normalizedKey = normalizeKey(key)\n\n if (normalizedKey === \"font-size\") {\n const strVal = getStaticStringValue(p.initializer)\n if (!strVal) continue\n const px = parsePxValue(strVal)\n if (px === null || px >= policy.minBodyFontSize) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxStylePolicy.id, \"fontTooSmall\",\n resolveMessage(messages.fontTooSmall, { prop: key, value: strVal, resolved: formatRounded(px), min: String(policy.minBodyFontSize), policy: name }), \"warn\"))\n continue\n }\n\n if (normalizedKey === \"line-height\") {\n const strVal = getStaticStringValue(p.initializer)\n const numVal = getStaticNumericValue(p.initializer)\n const lh = numVal ?? (strVal ? parseUnitlessValue(strVal) : null)\n if (lh === null || lh >= policy.minLineHeight) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxStylePolicy.id, \"lineHeightTooSmall\",\n resolveMessage(messages.lineHeightTooSmall, { value: String(lh), min: String(policy.minLineHeight), policy: name }), \"warn\"))\n continue\n }\n\n if (INLINE_TOUCH_TARGET_KEYS.has(normalizedKey)) {\n const element = entry.element\n if (element.tagName === null || !INTERACTIVE_HTML_TAGS.has(element.tagName)) {\n const roleAttr = getJSXAttributeEntity(solidTree, element, \"role\")\n if (roleAttr === null || roleAttr.valueNode === null) continue\n const role = getStaticStringFromJSXValue(roleAttr.valueNode)\n if (role === null || !INTERACTIVE_ARIA_ROLES.has(role)) continue\n }\n const strVal = getStaticStringValue(p.initializer)\n if (!strVal) continue\n const px = parsePxValue(strVal)\n if (px === null || px >= policy.minButtonHeight) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxStylePolicy.id, \"heightTooSmall\",\n resolveMessage(messages.heightTooSmall, { prop: key, value: strVal, resolved: formatRounded(px), min: String(policy.minButtonHeight), policy: name }), \"warn\"))\n continue\n }\n\n if (normalizedKey === \"letter-spacing\") {\n const strVal = getStaticStringValue(p.initializer)\n if (!strVal) continue\n const em = parseEmValue(strVal)\n if (em === null || em >= policy.minLetterSpacing) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxStylePolicy.id, \"letterSpacingTooSmall\",\n resolveMessage(messages.letterSpacingTooSmall, { value: strVal, resolved: String(em), min: String(policy.minLetterSpacing), policy: name }), \"warn\"))\n continue\n }\n\n if (normalizedKey === \"word-spacing\") {\n const strVal = getStaticStringValue(p.initializer)\n if (!strVal) continue\n const em = parseEmValue(strVal)\n if (em === null || em >= policy.minWordSpacing) continue\n emit(createDiagnostic(solidTree.filePath, p.initializer, solidTree.sourceFile, jsxStylePolicy.id, \"wordSpacingTooSmall\",\n resolveMessage(messages.wordSpacingTooSmall, { value: strVal, resolved: String(em), min: String(policy.minWordSpacing), policy: name }), \"warn\"))\n }\n }\n })\n },\n})\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getFillImageElements, findEnclosingDOMElement } from \"../../../solid/queries\"\nimport type { SolidSyntaxTree } from \"../../core/solid-syntax-tree\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport type { SignalSnapshot } from \"../../binding/signal-builder\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unsizedFillParent:\n \"Fill-image component '{{component}}' is inside a parent without stable size/position; add parent sizing (height/min-height/aspect-ratio) and non-static position to avoid CLS.\",\n} as const\n\nexport const jsxLayoutFillImageParentMustBeSized = defineAnalysisRule({\n id: \"jsx-layout-fill-image-parent-must-be-sized\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require stable parent size and positioning for fill-image component usage.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let fillImageParentElementIds: Set<number> | null = null\n let fillImageComponentByParentId: Map<number, { node: import(\"typescript\").Node; tag: string }> | null = null\n\n function ensureIndex(solidTree: SolidSyntaxTree, semanticModel: FileSemanticModel): void {\n if (fillImageParentElementIds !== null) return\n fillImageParentElementIds = new Set()\n fillImageComponentByParentId = new Map()\n\n const fillImages = getFillImageElements(solidTree)\n for (let i = 0; i < fillImages.length; i++) {\n const element = fillImages[i]\n if (!element) continue\n const parent = findEnclosingDOMElement(solidTree, element)\n if (!parent) continue\n const parentNode = semanticModel.getElementNode(parent.id)\n if (!parentNode) continue\n fillImageParentElementIds.add(parentNode.elementId)\n fillImageComponentByParentId!.set(parentNode.elementId, {\n node: element.node,\n tag: element.tag ?? \"Image\",\n })\n }\n }\n\n registry.registerFactAction(\"reservedSpace\", (element, reservedSpaceFact, semanticModel, emit) => {\n ensureIndex(semanticModel.solidTree, semanticModel)\n if (!fillImageParentElementIds!.has(element.elementId)) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const containingBlock = semanticModel.getLayoutFact(element.elementId, \"containingBlock\")\n\n if (hasEffectivePosition(snapshot) && reservedSpaceFact.hasReservedSpace) return\n if (containingBlock.nearestPositionedAncestorKey !== null && containingBlock.nearestPositionedAncestorHasReservedSpace) return\n\n const component = fillImageComponentByParentId!.get(element.elementId)\n if (!component) return\n\n emit(\n createDiagnostic(\n element.solidFile,\n component.node,\n semanticModel.solidTree.sourceFile,\n jsxLayoutFillImageParentMustBeSized.id,\n \"unsizedFillParent\",\n resolveMessage(messages.unsizedFillParent, {\n component: component.tag,\n }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction hasEffectivePosition(snapshot: SignalSnapshot): boolean {\n const signal = snapshot.signals.get(\"position\")\n if (!signal || signal.kind !== SignalValueKind.Known) return false\n return signal.normalized !== \"static\"\n}\n","import ts from \"typescript\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { parsePxValue } from \"../../../css/parser/value-util\"\nimport { getStaticNumericValue, getStaticStringFromJSXValue } from \"../../../solid/util/static-value\"\nimport { getJSXAttributeEntity } from \"../../../solid/queries/jsx\"\nimport type { JSXElementEntity } from \"../../../solid/entities/jsx\"\nimport type { SolidSyntaxTree } from \"../../core/solid-syntax-tree\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { ReservedSpaceFact } from \"../../analysis/layout-fact\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unsizedReplacedElement:\n \"Replaced element '{{tag}}' has no stable reserved size (width/height or aspect-ratio with a dimension), which can cause CLS.\",\n} as const\n\nconst REPLACED_MEDIA_TAGS = new Set([\"img\", \"video\", \"iframe\", \"canvas\", \"svg\"])\n\nexport const cssLayoutUnsizedReplacedElement = defineAnalysisRule({\n id: \"css-layout-unsized-replaced-element\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require stable reserved geometry for replaced media elements to prevent layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n registry.registerFactAction(\"reservedSpace\", (element, reservedSpaceFact, semanticModel, emit) => {\n if (element.tagName === null || !REPLACED_MEDIA_TAGS.has(element.tagName)) return\n\n if (hasReservedSize(semanticModel.solidTree, element, reservedSpaceFact, semanticModel)) return\n\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutUnsizedReplacedElement.id,\n \"unsizedReplacedElement\",\n resolveMessage(messages.unsizedReplacedElement, { tag: element.tagName }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction hasReservedSize(\n solidTree: SolidSyntaxTree,\n element: ElementNode,\n reservedSpaceFact: ReservedSpaceFact,\n semanticModel: FileSemanticModel,\n): boolean {\n if (reservedSpaceFact.hasReservedSpace) return true\n\n const attrWidth = parsePositiveLength(element.attributes.get(\"width\"))\n const attrHeight = parsePositiveLength(element.attributes.get(\"height\"))\n const jsxAttrWidth = readPositiveJsxAttribute(solidTree, element.jsxEntity, \"width\")\n const jsxAttrHeight = readPositiveJsxAttribute(solidTree, element.jsxEntity, \"height\")\n\n // Host DOM element JSX attributes — populated when the node is a component call\n // site resolved to a concrete DOM element.\n const hostRef = resolveHostElementRef(element, semanticModel)\n const hostJsxWidth = hostRef !== null\n ? readPositiveJsxAttribute(hostRef.solidTree, hostRef.element, \"width\")\n : false\n const hostJsxHeight = hostRef !== null\n ? readPositiveJsxAttribute(hostRef.solidTree, hostRef.element, \"height\")\n : false\n\n if ((attrWidth && attrHeight) || (jsxAttrWidth && jsxAttrHeight) || (hostJsxWidth && hostJsxHeight)) return true\n\n const hasAnyWidth = attrWidth || jsxAttrWidth || hostJsxWidth || reservedSpaceFact.hasDeclaredInlineDimension\n const hasAnyHeight = attrHeight || jsxAttrHeight || hostJsxHeight || reservedSpaceFact.hasDeclaredBlockDimension || reservedSpaceFact.hasContainIntrinsicSize\n\n if (reservedSpaceFact.hasUsableAspectRatio && (hasAnyWidth || hasAnyHeight)) return true\n if (reservedSpaceFact.hasContainIntrinsicSize && (hasAnyWidth || hasAnyHeight)) return true\n\n return false\n}\n\nfunction parsePositiveLength(raw: string | null | undefined): boolean {\n if (!raw) return false\n const px = parsePxValue(raw)\n if (px === null) return false\n return px > 0\n}\n\nfunction readPositiveJsxAttribute(\n solidTree: SolidSyntaxTree,\n element: JSXElementEntity,\n name: string,\n): boolean {\n const attribute = getJSXAttributeEntity(solidTree, element, name)\n if (!attribute || !attribute.valueNode) return false\n\n const staticString = getStaticStringFromJSXValue(attribute.valueNode)\n if (staticString !== null) return parsePositiveLength(staticString)\n\n if (!ts.isJsxExpression(attribute.valueNode)) return false\n if (!attribute.valueNode.expression) return false\n const staticNumeric = getStaticNumericValue(attribute.valueNode.expression)\n if (staticNumeric === null) return false\n return staticNumeric > 0\n}\n\ninterface ResolvedHostRef {\n readonly solidTree: SolidSyntaxTree\n readonly element: JSXElementEntity\n}\n\nfunction resolveHostElementRef(_element: ElementNode, _semanticModel: FileSemanticModel): ResolvedHostRef | null {\n return null\n}\n","import { HEADING_ELEMENTS } from \"@drskillissue/ganko-shared\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { SignalSnapshot, LayoutSignalName } from \"../../binding/signal-builder\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n dynamicSlotNoReservedSpace:\n \"Dynamic content container '{{tag}}' does not reserve block space (min-height/height/aspect-ratio/contain-intrinsic-size), which can cause CLS.\",\n} as const\n\nconst INLINE_DISPLAYS = new Set([\"inline\", \"contents\"])\n\nexport const cssLayoutDynamicSlotNoReservedSpace = defineAnalysisRule({\n id: \"css-layout-dynamic-slot-no-reserved-space\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require reserved block space for dynamic content containers to avoid layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let candidateElementIds: Set<number> | null = null\n\n registry.registerFactAction(\"reservedSpace\", (element, reservedSpaceFact, semanticModel, emit) => {\n if (candidateElementIds === null) {\n candidateElementIds = new Set()\n const candidates = semanticModel.getDynamicSlotCandidates()\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i]\n if (c) candidateElementIds.add(c.elementId)\n }\n }\n if (!candidateElementIds.has(element.elementId)) return\n\n if (element.isControl) return\n if (element.tagName === null) return\n if (HEADING_ELEMENTS.has(element.tagName)) return\n\n const flowFact = semanticModel.getLayoutFact(element.elementId, \"flowParticipation\")\n if (!flowFact.inFlow) return\n if (hasOutOfFlowAncestor(element, semanticModel)) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const displaySignal = snapshot.signals.get(\"display\")\n if (displaySignal && displaySignal.kind === SignalValueKind.Known && INLINE_DISPLAYS.has(displaySignal.normalized)) return\n\n if (reservedSpaceFact.hasReservedSpace) return\n if (hasBlockAxisPadding(snapshot)) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutDynamicSlotNoReservedSpace.id,\n \"dynamicSlotNoReservedSpace\",\n resolveMessage(messages.dynamicSlotNoReservedSpace, { tag }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction hasBlockAxisPadding(snapshot: SignalSnapshot): boolean {\n const top = readKnownPx(snapshot, \"padding-top\")\n const bottom = readKnownPx(snapshot, \"padding-bottom\")\n if (top !== null && top > 0 && bottom !== null && bottom > 0) return true\n return false\n}\n\nfunction readKnownPx(snapshot: SignalSnapshot, name: LayoutSignalName): number | null {\n const sig = snapshot.signals.get(name)\n if (!sig || sig.kind !== SignalValueKind.Known) return null\n return sig.px\n}\n\nfunction hasOutOfFlowAncestor(element: ElementNode, semanticModel: FileSemanticModel): boolean {\n let current = element.parentElementNode\n while (current !== null) {\n const flow = semanticModel.getLayoutFact(current.elementId, \"flowParticipation\")\n if (!flow.inFlow) return true\n current = current.parentElementNode\n }\n return false\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { TextualContentState } from \"../../binding/signal-builder\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unstableOverflowAnchor:\n \"Element '{{tag}}' sets `overflow-anchor: none` on a {{context}} container; disabling scroll anchoring can amplify visible layout shifts.\",\n} as const\n\nexport const cssLayoutOverflowAnchorInstability = defineAnalysisRule({\n id: \"css-layout-overflow-anchor-instability\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow overflow-anchor none on dynamic or scrollable containers prone to visible layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let anchorNoneElementIds: Set<number> | null = null\n\n registry.registerFactAction(\"flowParticipation\", (element, flowFact, semanticModel, emit) => {\n if (anchorNoneElementIds === null) {\n anchorNoneElementIds = new Set()\n const candidates = semanticModel.getElementsByKnownSignalValue(\"overflow-anchor\", \"none\")\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i]\n if (c) anchorNoneElementIds.add(c.elementId)\n }\n }\n if (!anchorNoneElementIds.has(element.elementId)) return\n if (!flowFact.inFlow) return\n\n const scrollFact = semanticModel.getLayoutFact(element.elementId, \"scrollContainer\")\n const isScrollable = scrollFact.isScrollContainer\n const isDynamicContainer = element.textualContent === TextualContentState.Unknown && element.siblingCount >= 2\n if (!isScrollable && !isDynamicContainer) return\n\n const containerContext = isScrollable ? \"scrollable\" : \"dynamic\"\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutOverflowAnchorInstability.id,\n \"unstableOverflowAnchor\",\n resolveMessage(messages.unstableOverflowAnchor, { tag, context: containerContext }),\n \"warn\",\n ),\n )\n })\n },\n})\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport { ScrollAxis } from \"../../analysis/layout-fact\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n missingScrollbarGutter:\n \"Scrollable container '{{tag}}' uses overflow auto/scroll without `scrollbar-gutter: stable`, which can trigger CLS when scrollbars appear.\",\n} as const\n\nexport const cssLayoutScrollbarGutterInstability = defineAnalysisRule({\n id: \"css-layout-scrollbar-gutter-instability\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require stable scrollbar gutters for scrollable containers to reduce layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let scrollElementIds: Set<number> | null = null\n\n registry.registerFactAction(\"scrollContainer\", (element, scrollFact, semanticModel, emit) => {\n if (scrollElementIds === null) {\n scrollElementIds = new Set()\n const candidates = semanticModel.getScrollContainerElements()\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i]\n if (c) scrollElementIds.add(c.elementId)\n }\n }\n if (!scrollElementIds.has(element.elementId)) return\n if (!scrollFact.isScrollContainer) return\n if (scrollFact.axis !== ScrollAxis.Y && scrollFact.axis !== ScrollAxis.Both) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n\n const scrollbarWidthSignal = snapshot.signals.get(\"scrollbar-width\")\n if (scrollbarWidthSignal && scrollbarWidthSignal.kind === SignalValueKind.Known && scrollbarWidthSignal.normalized === \"none\") return\n\n const gutterSignal = snapshot.signals.get(\"scrollbar-gutter\")\n if (gutterSignal && gutterSignal.kind === SignalValueKind.Known && gutterSignal.normalized.startsWith(\"stable\")) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutScrollbarGutterInstability.id,\n \"missingScrollbarGutter\",\n resolveMessage(messages.missingScrollbarGutter, { tag }),\n \"warn\",\n ),\n )\n })\n },\n})\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport { TextualContentState } from \"../../binding/signal-builder\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n missingIntrinsicSize:\n \"`content-visibility: auto` on '{{tag}}' lacks intrinsic size reservation (`contain-intrinsic-size`/min-height/height/aspect-ratio), which can cause CLS.\",\n} as const\n\nconst SECTIONING_CONTAINER_TAGS = new Set([\"section\", \"article\", \"main\"])\n\nexport const cssLayoutContentVisibilityNoIntrinsicSize = defineAnalysisRule({\n id: \"css-layout-content-visibility-no-intrinsic-size\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Require intrinsic size reservation when using content-visibility auto to avoid late layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let cvAutoElementIds: Set<number> | null = null\n\n registry.registerFactAction(\"reservedSpace\", (element, reservedSpaceFact, semanticModel, emit) => {\n if (cvAutoElementIds === null) {\n cvAutoElementIds = new Set()\n const candidates = semanticModel.getElementsByKnownSignalValue(\"content-visibility\", \"auto\")\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i]\n if (c) cvAutoElementIds.add(c.elementId)\n }\n }\n if (!cvAutoElementIds.has(element.elementId)) return\n if (!isDeferredContainerLike(element)) return\n if (reservedSpaceFact.hasReservedSpace) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutContentVisibilityNoIntrinsicSize.id,\n \"missingIntrinsicSize\",\n resolveMessage(messages.missingIntrinsicSize, { tag }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction isDeferredContainerLike(element: ElementNode): boolean {\n if (element.siblingCount >= 2) return true\n if (element.textualContent === TextualContentState.Unknown) return true\n if (element.tagName !== null && SECTIONING_CONTAINER_TAGS.has(element.tagName)) return true\n return false\n}\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { LAYOUT_POSITIONED_OFFSET_PROPERTIES } from \"../../../css/layout-taxonomy\"\nimport { parseBlockShorthand, parseQuadShorthand } from \"../../../css/parser/value-tokenizer\"\nimport type { StatefulSelectorEntry, NormalizedRuleDeclaration } from \"../../analysis/statefulness\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier, type Emit } from \"../rule\"\n\nconst messages = {\n statefulBoxModelShift:\n \"State selector '{{selector}}' changes layout-affecting '{{property}}'. Keep geometry stable across states to avoid CLS.\",\n} as const\n\nexport const cssLayoutStatefulBoxModelShift = defineAnalysisRule({\n id: \"css-layout-stateful-box-model-shift\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow stateful selector changes that alter element geometry and trigger layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n let processed = false\n\n registry.registerFactAction(\"flowParticipation\", (_element, _fact, semanticModel, emit) => {\n if (processed) return\n processed = true\n\n runStatefulBoxModelCheck(semanticModel, emit)\n })\n },\n})\n\nfunction runStatefulBoxModelCheck(semanticModel: FileSemanticModel, emit: Emit): void {\n const baseValueIndex = semanticModel.getStatefulBaseValueIndex()\n const reported = new Set<number>()\n\n // Iterate all CSS rules via the compilation's CSS syntax trees\n const rulesSeen = new Set<number>()\n\n for (const [, cssTree] of semanticModel.compilation.cssTrees) {\n for (let r = 0; r < cssTree.rules.length; r++) {\n const rule = cssTree.rules[r]\n if (!rule) continue\n if (rulesSeen.has(rule.id)) continue\n rulesSeen.add(rule.id)\n\n const selectors = semanticModel.getStatefulSelectorEntries(rule.id)\n if (selectors.length === 0) continue\n\n const declarations = semanticModel.getStatefulNormalizedDeclarations(rule.id)\n if (declarations.length === 0) continue\n\n for (let j = 0; j < declarations.length; j++) {\n const declaration = declarations[j]\n if (!declaration) continue\n if (declaration.property === \"position\") continue\n if (reported.has(declaration.declarationId)) continue\n\n const match = firstStatefulSelectorWithDelta(\n selectors,\n declaration.property,\n declaration.normalizedValue,\n baseValueIndex,\n )\n if (!match) continue\n if (LAYOUT_POSITIONED_OFFSET_PROPERTIES.has(declaration.property)\n && !hasStatefulPositionContext(selectors, declarations, baseValueIndex)) {\n continue\n }\n\n if (isVisualFeedbackTransform(declaration.property, match.isDirectInteraction)) continue\n\n emit(createCSSDiagnostic(\n declaration.filePath, declaration.startLine, declaration.startColumn,\n cssLayoutStatefulBoxModelShift.id, \"statefulBoxModelShift\",\n resolveMessage(messages.statefulBoxModelShift, {\n selector: match.raw,\n property: declaration.property,\n }), \"warn\",\n ))\n reported.add(declaration.declarationId)\n }\n }\n }\n}\n\nfunction isVisualFeedbackTransform(property: string, isDirectInteraction: boolean): boolean {\n if (!isDirectInteraction) return false\n return property === \"transform\" || property === \"translate\"\n}\n\ninterface StatefulSelectorMatch {\n readonly raw: string\n readonly isDirectInteraction: boolean\n}\n\nfunction firstStatefulSelectorWithDelta(\n selectors: readonly StatefulSelectorEntry[],\n property: string,\n stateValue: string,\n baseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>,\n): StatefulSelectorMatch | null {\n for (let i = 0; i < selectors.length; i++) {\n const selector = selectors[i]\n if (!selector) continue\n if (!selector.isStateful) continue\n if (selector.baseLookupKeys.length === 0) return { raw: selector.raw, isDirectInteraction: selector.isDirectInteraction }\n\n const baseByProperty = lookupBaseByProperty(baseValueIndex, selector.baseLookupKeys)\n if (!baseByProperty) return { raw: selector.raw, isDirectInteraction: selector.isDirectInteraction }\n\n if (!matchesBasePropertyValue(baseByProperty, property, stateValue)) return { raw: selector.raw, isDirectInteraction: selector.isDirectInteraction }\n }\n\n return null\n}\n\nfunction hasStatefulPositionContext(\n selectors: readonly StatefulSelectorEntry[],\n declarations: readonly NormalizedRuleDeclaration[],\n baseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>,\n): boolean {\n if (hasNonStaticPositionInDeclarations(declarations)) return true\n\n for (let i = 0; i < selectors.length; i++) {\n const selector = selectors[i]\n if (!selector) continue\n if (!selector.isStateful) continue\n if (selector.baseLookupKeys.length === 0) continue\n\n const baseByProperty = lookupBaseByProperty(baseValueIndex, selector.baseLookupKeys)\n if (!baseByProperty) continue\n const positionValues = baseByProperty.get(\"position\")\n if (!positionValues) continue\n\n for (const value of positionValues) {\n if (value !== \"static\") return true\n }\n }\n\n return false\n}\n\nfunction hasNonStaticPositionInDeclarations(\n declarations: readonly NormalizedRuleDeclaration[],\n): boolean {\n for (let i = 0; i < declarations.length; i++) {\n const decl = declarations[i]\n if (!decl) continue\n if (decl.property !== \"position\") continue\n if (decl.normalizedValue !== \"static\") return true\n }\n return false\n}\n\nfunction matchesBasePropertyValue(\n baseByProperty: ReadonlyMap<string, ReadonlySet<string>>,\n property: string,\n stateValue: string,\n): boolean {\n if (hasBaseValue(baseByProperty, property, stateValue)) return true\n\n if (property === \"padding\" || property === \"margin\" || property === \"border-width\" || property === \"inset\") {\n const quad = parseQuadShorthand(stateValue)\n if (!quad) return false\n\n if (property === \"padding\") {\n return hasBaseValue(baseByProperty, \"padding-top\", quad.top)\n && hasBaseValue(baseByProperty, \"padding-bottom\", quad.bottom)\n && hasBaseValue(baseByProperty, \"padding-left\", quad.left)\n && hasBaseValue(baseByProperty, \"padding-right\", quad.right)\n }\n\n if (property === \"margin\") {\n return hasBaseValue(baseByProperty, \"margin-top\", quad.top)\n && hasBaseValue(baseByProperty, \"margin-bottom\", quad.bottom)\n && hasBaseValue(baseByProperty, \"margin-left\", quad.left)\n && hasBaseValue(baseByProperty, \"margin-right\", quad.right)\n }\n\n if (property === \"border-width\") {\n return hasBaseValue(baseByProperty, \"border-top-width\", quad.top)\n && hasBaseValue(baseByProperty, \"border-bottom-width\", quad.bottom)\n && hasBaseValue(baseByProperty, \"border-left-width\", quad.left)\n && hasBaseValue(baseByProperty, \"border-right-width\", quad.right)\n }\n\n return hasBaseValue(baseByProperty, \"top\", quad.top)\n && hasBaseValue(baseByProperty, \"bottom\", quad.bottom)\n }\n\n if (property === \"inset-block\") {\n const block = parseBlockShorthand(stateValue)\n if (!block) return false\n return hasBaseValue(baseByProperty, \"inset-block-start\", block.start)\n && hasBaseValue(baseByProperty, \"inset-block-end\", block.end)\n }\n\n return false\n}\n\nfunction hasBaseValue(\n baseByProperty: ReadonlyMap<string, ReadonlySet<string>>,\n property: string,\n expectedValue: string,\n): boolean {\n const values = baseByProperty.get(property)\n if (!values) return false\n return values.has(expectedValue)\n}\n\nfunction lookupBaseByProperty(\n baseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>,\n selectorKeys: readonly string[],\n): ReadonlyMap<string, ReadonlySet<string>> | null {\n for (let i = 0; i < selectorKeys.length; i++) {\n const key = selectorKeys[i]\n if (!key) continue\n const value = baseValueIndex.get(key)\n if (value) return value\n }\n return null\n}\n","import ts from \"typescript\"\nimport { parsePxValue } from \"../../../css/parser/value-util\"\nimport { LAYOUT_INLINE_STYLE_TOGGLE_PROPERTIES } from \"../../../css/layout-taxonomy\"\nimport { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getPropertyKeyName } from \"../../../solid/util/pattern-detection\"\nimport { constantTruthiness, getStaticValue } from \"../../../solid/util/static-value\"\nimport { toKebabCase } from \"@drskillissue/ganko-shared\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport type { FlowParticipationFact } from \"../../analysis/layout-fact\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unstableLayoutStyleToggle:\n \"Dynamic style value for '{{property}}' can toggle layout geometry at runtime and cause CLS.\",\n} as const\n\nconst PX_NUMBER_PROPERTIES = new Set([\n \"top\", \"bottom\", \"margin-top\", \"margin-bottom\", \"padding-top\", \"padding-bottom\",\n \"height\", \"min-height\", \"width\", \"min-width\", \"font-size\",\n])\n\nconst POSITIONED_OFFSET_PROPERTIES = new Set([\"top\", \"bottom\"])\n\nexport const jsxLayoutUnstableStyleToggle = defineAnalysisRule({\n id: \"jsx-layout-unstable-style-toggle\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Flag dynamic inline style values on layout-sensitive properties that can trigger CLS.\",\n fixable: false,\n category: \"css-jsx\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n registry.registerFactAction(\"flowParticipation\", (element, flowFact, semanticModel, emit) => {\n const solidTree = semanticModel.solidTree\n const properties = solidTree.styleProperties\n for (let i = 0; i < properties.length; i++) {\n const entry = properties[i]\n if (!entry) continue\n if (entry.element.id !== element.jsxEntity.id) continue\n const p = entry.property\n if (!ts.isPropertyAssignment(p)) continue\n const key = getPropertyKeyName(p.name)\n if (!key) continue\n\n const normalized = normalizeStylePropertyKey(key)\n if (!LAYOUT_INLINE_STYLE_TOGGLE_PROPERTIES.has(normalized)) continue\n if (!hasUnstableLayoutDelta(normalized, p.initializer)) continue\n if (isExemptFromCLS(element, flowFact, normalized, semanticModel)) continue\n\n emit(\n createDiagnostic(\n solidTree.filePath,\n p.initializer,\n solidTree.sourceFile,\n jsxLayoutUnstableStyleToggle.id,\n \"unstableLayoutStyleToggle\",\n resolveMessage(messages.unstableLayoutStyleToggle, { property: normalized }),\n \"warn\",\n ),\n )\n }\n })\n },\n})\n\nfunction normalizeStylePropertyKey(key: string): string {\n if (key.includes(\"-\")) return key.toLowerCase()\n return toKebabCase(key)\n}\n\nfunction isExemptFromCLS(\n element: ElementNode,\n flowFact: FlowParticipationFact,\n property: string,\n _semanticModel: FileSemanticModel,\n): boolean {\n if (!flowFact.inFlow) return true\n\n if (POSITIONED_OFFSET_PROPERTIES.has(property) && flowFact.position !== null && flowFact.position !== \"static\") {\n return true\n }\n\n if (hasLayoutContainment(element) || (element.parentElementNode !== null && hasLayoutContainment(element.parentElementNode))) {\n return true\n }\n\n return false\n}\n\nfunction hasLayoutContainment(node: ElementNode): boolean {\n const contain = node.inlineStyleValues.get(\"contain\")\n if (contain === undefined) return false\n return contain === \"layout\"\n || contain === \"strict\"\n || contain === \"content\"\n || contain.includes(\"layout\")\n}\n\nfunction hasUnstableLayoutDelta(property: string, node: ts.Node): boolean {\n const unwrapped = unwrapTypeWrapper(node)\n\n if (isStaticComparable(property, unwrapped)) return false\n\n if (ts.isConditionalExpression(unwrapped)) {\n return conditionalHasDelta(property, unwrapped)\n }\n\n if (ts.isBinaryExpression(unwrapped) && isLogicalOperator(unwrapped.operatorToken.kind)) {\n return logicalHasDelta(property, unwrapped)\n }\n\n return true\n}\n\nfunction conditionalHasDelta(property: string, node: ts.ConditionalExpression): boolean {\n const consequent = unwrapTypeWrapper(node.whenTrue)\n const alternate = unwrapTypeWrapper(node.whenFalse)\n\n const consequentValue = readComparableStaticValue(property, consequent)\n const alternateValue = readComparableStaticValue(property, alternate)\n if (consequentValue !== null && alternateValue !== null) {\n return consequentValue !== alternateValue\n }\n\n return true\n}\n\nfunction isLogicalOperator(kind: ts.SyntaxKind): boolean {\n return kind === ts.SyntaxKind.AmpersandAmpersandToken\n || kind === ts.SyntaxKind.BarBarToken\n}\n\nfunction logicalHasDelta(property: string, node: ts.BinaryExpression): boolean {\n const left = unwrapTypeWrapper(node.left)\n const right = unwrapTypeWrapper(node.right)\n const leftTruthiness = constantTruthiness(left)\n\n if (node.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {\n if (leftTruthiness === false) return hasUnstableLayoutDelta(property, left)\n if (leftTruthiness === true) return hasUnstableLayoutDelta(property, right)\n return true\n }\n\n if (node.operatorToken.kind === ts.SyntaxKind.BarBarToken) {\n if (leftTruthiness === true) return hasUnstableLayoutDelta(property, left)\n if (leftTruthiness === false) return hasUnstableLayoutDelta(property, right)\n return true\n }\n\n return true\n}\n\nfunction isStaticComparable(property: string, node: ts.Node): boolean {\n return readComparableStaticValue(property, node) !== null\n}\n\nfunction readComparableStaticValue(property: string, node: ts.Node): string | null {\n const staticValue = getStaticValue(node)\n if (staticValue === null) return null\n return normalizeComparableValue(property, staticValue.value)\n}\n\nfunction normalizeComparableValue(\n property: string,\n value: string | number | boolean | null | undefined,\n): string | null {\n const isPxProperty = PX_NUMBER_PROPERTIES.has(property)\n const isLineHeightProperty = property === \"line-height\"\n\n if (typeof value === \"number\") {\n if (isLineHeightProperty) return `line-height:${value}`\n if (isPxProperty) return `px:${value}`\n return `num:${value}`\n }\n\n if (typeof value === \"string\") {\n const normalized = value.trim().toLowerCase()\n if (isPxProperty) {\n const px = parsePxValue(normalized)\n if (px !== null) return `px:${px}`\n }\n if (isLineHeightProperty) {\n const unitless = Number(normalized)\n if (Number.isFinite(unitless)) return `line-height:${unitless}`\n }\n return `str:${normalized}`\n }\n\n if (typeof value === \"boolean\") return value ? \"bool:true\" : \"bool:false\"\n if (value === null) return \"null\"\n if (value === undefined) return \"undefined\"\n return null\n}\n\nfunction unwrapTypeWrapper(node: ts.Node): ts.Node {\n let current = node\n\n while (true) {\n if (ts.isAsExpression(current) || ts.isTypeAssertionExpression(current)) {\n current = current.expression\n continue\n }\n\n if (ts.isNonNullExpression(current)) {\n current = current.expression\n continue\n }\n\n return current\n }\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getActivePolicy, getActivePolicyName } from \"../../../css/policy\"\nimport { parsePxValue } from \"../../../css/parser/value-util\"\nimport { getJSXAttributeEntity } from \"../../../solid/queries/jsx\"\nimport { getStaticStringFromJSXValue } from \"../../../solid/util/static-value\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { SignalSnapshot, LayoutSignalName } from \"../../binding/signal-builder\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport { SignalGuardKind } from \"../../binding/cascade-binder\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier, type Emit } from \"../rule\"\n\nconst messages = {\n heightTooSmall: \"`{{signal}}` of `{{value}}px` is below the minimum `{{min}}px` for interactive element `<{{tag}}>` in policy `{{policy}}`.\",\n widthTooSmall: \"`{{signal}}` of `{{value}}px` is below the minimum `{{min}}px` for interactive element `<{{tag}}>` in policy `{{policy}}`.\",\n paddingTooSmall: \"Horizontal padding `{{signal}}` of `{{value}}px` is below the minimum `{{min}}px` for interactive element `<{{tag}}>` in policy `{{policy}}`.\",\n noReservedBlockSize: \"Interactive element `<{{tag}}>` has no declared height (minimum `{{min}}px` required by policy `{{policy}}`). The element is content-sized and may not meet the touch-target threshold.\",\n noReservedInlineSize: \"Interactive element `<{{tag}}>` has no declared width (minimum `{{min}}px` required by policy `{{policy}}`). The element is content-sized and may not meet the touch-target threshold.\",\n} as const\n\nconst INTERACTIVE_HTML_TAGS = new Set([\"button\", \"a\", \"input\", \"select\", \"textarea\", \"label\", \"summary\"])\nconst INTERACTIVE_ARIA_ROLES = new Set([\n \"button\", \"link\", \"checkbox\", \"radio\", \"combobox\", \"listbox\",\n \"menuitem\", \"menuitemcheckbox\", \"menuitemradio\", \"option\", \"switch\", \"tab\",\n])\n\ntype InteractiveKind = \"button\" | \"input\"\n\nexport const jsxLayoutPolicyTouchTarget = defineAnalysisRule({\n id: \"jsx-layout-policy-touch-target\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Enforce minimum interactive element sizes per accessibility policy via resolved layout signals.\",\n fixable: false,\n category: \"css-a11y\",\n },\n requirement: { tier: ComputationTier.SelectiveLayoutFacts },\n register(registry) {\n registry.registerFactAction(\"reservedSpace\", (element, reservedSpaceFact, semanticModel, emit) => {\n const policy = getActivePolicy()\n if (policy === null) return\n const policyName = getActivePolicyName() ?? \"\"\n\n const kind = classifyInteractive(element, semanticModel)\n if (kind === null) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n if (isVisuallyHidden(element, snapshot)) return\n\n const tag = element.tagName ?? element.tag ?? \"element\"\n\n // Height checks\n checkDimension(snapshot, \"height\", kind === \"button\" ? policy.minButtonHeight : policy.minInputHeight,\n element, semanticModel, emit, \"heightTooSmall\", messages.heightTooSmall, tag, policyName)\n checkDimension(snapshot, \"min-height\", kind === \"button\" ? policy.minButtonHeight : policy.minInputHeight,\n element, semanticModel, emit, \"heightTooSmall\", messages.heightTooSmall, tag, policyName)\n checkDimension(snapshot, \"max-height\", kind === \"button\" ? policy.minButtonHeight : policy.minInputHeight,\n element, semanticModel, emit, \"heightTooSmall\", messages.heightTooSmall, tag, policyName)\n\n // Width checks\n checkDimension(snapshot, \"width\", kind === \"button\" ? policy.minButtonWidth : policy.minTouchTarget,\n element, semanticModel, emit, \"widthTooSmall\", messages.widthTooSmall, tag, policyName)\n checkDimension(snapshot, \"min-width\", kind === \"button\" ? policy.minButtonWidth : policy.minTouchTarget,\n element, semanticModel, emit, \"widthTooSmall\", messages.widthTooSmall, tag, policyName)\n checkDimension(snapshot, \"max-width\", kind === \"button\" ? policy.minButtonWidth : policy.minTouchTarget,\n element, semanticModel, emit, \"widthTooSmall\", messages.widthTooSmall, tag, policyName)\n\n // Horizontal padding checks (buttons only)\n if (kind === \"button\") {\n checkDimension(snapshot, \"padding-left\", policy.minButtonHorizontalPadding,\n element, semanticModel, emit, \"paddingTooSmall\", messages.paddingTooSmall, tag, policyName)\n checkDimension(snapshot, \"padding-right\", policy.minButtonHorizontalPadding,\n element, semanticModel, emit, \"paddingTooSmall\", messages.paddingTooSmall, tag, policyName)\n }\n\n // No reserved size checks\n const minBlock = kind === \"button\" ? policy.minButtonHeight : policy.minInputHeight\n const minInline = kind === \"button\" ? policy.minButtonWidth : policy.minTouchTarget\n\n if (!reservedSpaceFact.hasDeclaredBlockDimension) {\n emit(createDiagnostic(\n element.solidFile, element.jsxEntity.node, semanticModel.solidTree.sourceFile,\n jsxLayoutPolicyTouchTarget.id, \"noReservedBlockSize\",\n resolveMessage(messages.noReservedBlockSize, { tag, min: String(minBlock), policy: policyName }),\n \"warn\",\n ))\n }\n\n if (!reservedSpaceFact.hasDeclaredInlineDimension) {\n emit(createDiagnostic(\n element.solidFile, element.jsxEntity.node, semanticModel.solidTree.sourceFile,\n jsxLayoutPolicyTouchTarget.id, \"noReservedInlineSize\",\n resolveMessage(messages.noReservedInlineSize, { tag, min: String(minInline), policy: policyName }),\n \"warn\",\n ))\n }\n })\n },\n})\n\nfunction classifyInteractive(element: ElementNode, semanticModel: FileSemanticModel): InteractiveKind | null {\n const tag = element.tagName\n if (tag !== null && INTERACTIVE_HTML_TAGS.has(tag)) {\n if (tag === \"input\" || tag === \"select\" || tag === \"textarea\") return \"input\"\n return \"button\"\n }\n\n const roleAttr = getJSXAttributeEntity(semanticModel.solidTree, element.jsxEntity, \"role\")\n if (roleAttr !== null && roleAttr.valueNode !== null) {\n const role = getStaticStringFromJSXValue(roleAttr.valueNode)\n if (role !== null && INTERACTIVE_ARIA_ROLES.has(role)) return \"button\"\n }\n\n // Component call site resolved to a native interactive DOM element\n const hostSymbol = resolveHostTag(element, semanticModel)\n if (hostSymbol !== null && INTERACTIVE_HTML_TAGS.has(hostSymbol)) {\n if (hostSymbol === \"input\" || hostSymbol === \"select\" || hostSymbol === \"textarea\") return \"input\"\n return \"button\"\n }\n\n return null\n}\n\nfunction resolveHostTag(_element: ElementNode, _semanticModel: FileSemanticModel): string | null {\n return null\n}\n\nfunction isVisuallyHidden(element: ElementNode, snapshot: SignalSnapshot): boolean {\n const posSignal = snapshot.signals.get(\"position\")\n if (!posSignal || posSignal.kind !== SignalValueKind.Known) return false\n if (posSignal.normalized !== \"absolute\" && posSignal.normalized !== \"fixed\") return false\n\n const opacityAttr = element.inlineStyleValues.get(\"opacity\")\n if (opacityAttr === \"0\") return true\n\n if (element.classTokenSet.has(\"opacity-0\")) return true\n\n const widthSignal = snapshot.signals.get(\"width\")\n const heightSignal = snapshot.signals.get(\"height\")\n if (widthSignal && widthSignal.kind === SignalValueKind.Known && widthSignal.px === 1\n && heightSignal && heightSignal.kind === SignalValueKind.Known && heightSignal.px === 1) return true\n\n return false\n}\n\ntype DimensionSignal = \"height\" | \"min-height\" | \"max-height\" | \"width\" | \"min-width\" | \"max-width\" | \"padding-left\" | \"padding-right\"\n\nfunction checkDimension(\n snapshot: SignalSnapshot,\n signal: DimensionSignal,\n min: number,\n element: ElementNode,\n semanticModel: FileSemanticModel,\n emit: Emit,\n messageId: string,\n template: string,\n tag: string,\n policyName: string,\n): void {\n let px = readKnownPx(snapshot, signal)\n\n if (px === null) {\n const signalValue = snapshot.signals.get(signal)\n if (signalValue !== null && signalValue !== undefined && signalValue.guard.kind === SignalGuardKind.Conditional) {\n px = resolveUnconditionalFallbackPx(semanticModel, element.elementId, signal)\n }\n }\n\n if (px === null) return\n if (px >= min) return\n\n emit(createDiagnostic(\n element.solidFile, element.jsxEntity.node, semanticModel.solidTree.sourceFile,\n jsxLayoutPolicyTouchTarget.id, messageId,\n resolveMessage(template, {\n signal,\n value: formatRounded(px),\n min: String(min),\n tag,\n policy: policyName,\n }),\n \"warn\",\n ))\n}\n\nfunction readKnownPx(snapshot: SignalSnapshot, name: LayoutSignalName): number | null {\n const sig = snapshot.signals.get(name)\n if (!sig || sig.kind !== SignalValueKind.Known) return null\n return sig.px\n}\n\nfunction formatRounded(value: number, digits = 2): string {\n const scale = 10 ** digits\n return String(Math.round(value * scale) / scale)\n}\n\nfunction resolveUnconditionalFallbackPx(\n semanticModel: FileSemanticModel,\n elementId: number,\n signal: LayoutSignalName,\n): number | null {\n const deltaMap = semanticModel.getConditionalDelta(elementId)\n if (!deltaMap) return null\n const delta = deltaMap.get(signal)\n if (!delta || !delta.hasConditional) return null\n\n const values = delta.unconditionalValues\n let bestPx: number | null = null\n\n for (let i = 0; i < values.length; i++) {\n const raw = values[i]\n if (!raw) continue\n const px = parsePxValue(raw)\n if (px === null) continue\n if (bestPx === null || px > bestPx) bestPx = px\n }\n\n return bestPx\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport { TextualContentState, SignalValueKind } from \"../../binding/signal-builder\"\nimport { SignalGuardKind } from \"../../binding/cascade-binder\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n conditionalDisplayCollapse:\n \"Conditional display sets '{{display}}' on '{{tag}}' without stable reserved space, which can collapse/expand layout and cause CLS.\",\n} as const\n\nconst COLLAPSING_DISPLAYS = new Set([\"none\", \"contents\"])\n\nexport const cssLayoutConditionalDisplayCollapse = defineAnalysisRule({\n id: \"css-layout-conditional-display-collapse\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow conditional display collapse in flow without reserved geometry.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.FullCascade },\n register(registry) {\n registry.registerConditionalDeltaAction((element, delta, semanticModel, emit) => {\n const displayDelta = delta.get(\"display\")\n if (!displayDelta || !displayDelta.hasConditional || !displayDelta.hasDelta) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const displaySignal = snapshot.signals.get(\"display\")\n if (!displaySignal || displaySignal.kind !== SignalValueKind.Known) return\n if (!COLLAPSING_DISPLAYS.has(displaySignal.normalized)) return\n if (displaySignal.guard.kind !== SignalGuardKind.Conditional) return\n\n const flowFact = semanticModel.getLayoutFact(element.elementId, \"flowParticipation\")\n if (!flowFact.inFlow) return\n if (!isFlowRelevantBySiblingsOrText(element)) return\n\n const reservedSpace = semanticModel.getLayoutFact(element.elementId, \"reservedSpace\")\n if (reservedSpace.hasReservedSpace) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutConditionalDisplayCollapse.id,\n \"conditionalDisplayCollapse\",\n resolveMessage(messages.conditionalDisplayCollapse, { tag, display: displaySignal.normalized }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction isFlowRelevantBySiblingsOrText(element: ElementNode): boolean {\n if (element.siblingCount >= 2) return true\n return element.textualContent === TextualContentState.Yes\n || element.textualContent === TextualContentState.Unknown\n || element.textualContent === TextualContentState.DynamicText\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { LAYOUT_POSITIONED_OFFSET_SIGNALS } from \"../../../css/layout-taxonomy\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport { SignalGuardKind } from \"../../binding/cascade-binder\"\nimport type { SignalSnapshot, LayoutSignalName } from \"../../binding/signal-builder\"\nimport type { ConditionalSignalDelta } from \"../../analysis/cascade-analyzer\"\nimport { layoutOffsetSignals, type LayoutOffsetSignal } from \"../../analysis/alignment\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n conditionalOffsetShift:\n \"Conditional style applies non-zero '{{property}}' offset ({{value}}), which can cause layout shifts when conditions toggle.\",\n} as const\n\nexport const cssLayoutConditionalOffsetShift = defineAnalysisRule({\n id: \"css-layout-conditional-offset-shift\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow conditional non-zero block-axis offsets that can trigger layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.FullCascade },\n register(registry) {\n registry.registerConditionalDeltaAction((element, delta, semanticModel, emit) => {\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const baselineBySignal = semanticModel.getBaselineOffsets(element.elementId)\n\n const matches = collectConditionalOffsets(delta, snapshot)\n if (matches.length === 0) return\n\n if (isElementOrAncestorOutOfFlow(element, semanticModel)) return\n\n const match = firstActionableOffset(snapshot, baselineBySignal, matches)\n if (!match) return\n\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutConditionalOffsetShift.id,\n \"conditionalOffsetShift\",\n resolveMessage(messages.conditionalOffsetShift, {\n property: match.property,\n value: `${formatFixed(match.value)}px`,\n }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction collectConditionalOffsets(\n delta: ReadonlyMap<string, ConditionalSignalDelta>,\n snapshot: SignalSnapshot,\n): readonly { property: LayoutOffsetSignal; value: number; guardKey: string }[] {\n const out: { property: LayoutOffsetSignal; value: number; guardKey: string }[] = []\n\n for (let i = 0; i < layoutOffsetSignals.length; i++) {\n const name = layoutOffsetSignals[i]\n if (!name) continue\n const offsetDelta = delta.get(name)\n if (!offsetDelta || !offsetDelta.hasConditional || !offsetDelta.hasDelta) continue\n\n const signal = snapshot.signals.get(name)\n if (!signal) continue\n if (signal.guard.kind !== SignalGuardKind.Conditional) continue\n if (signal.kind !== SignalValueKind.Known) continue\n if (signal.px === null) continue\n if (Math.abs(signal.px) <= 0.25) continue\n out.push({ property: name, value: signal.px, guardKey: signal.guard.key })\n }\n\n return out\n}\n\nfunction firstActionableOffset(\n snapshot: SignalSnapshot,\n baselineBySignal: ReadonlyMap<LayoutSignalName, readonly number[]> | null,\n matches: readonly { property: LayoutOffsetSignal; value: number; guardKey: string }[],\n): { property: LayoutOffsetSignal; value: number; guardKey: string } | null {\n for (let i = 0; i < matches.length; i++) {\n const match = matches[i]\n if (!match) continue\n if (LAYOUT_POSITIONED_OFFSET_SIGNALS.has(match.property) && !hasEffectivePosition(snapshot)) {\n continue\n }\n if (baselineBySignal !== null && hasStableBaseline(baselineBySignal, match.property, match.value)) continue\n return match\n }\n\n return null\n}\n\nfunction isElementOrAncestorOutOfFlow(element: ElementNode, semanticModel: FileSemanticModel): boolean {\n const flow = semanticModel.getLayoutFact(element.elementId, \"flowParticipation\")\n if (!flow.inFlow) return true\n\n let current = element.parentElementNode\n while (current !== null) {\n const ancestorFlow = semanticModel.getLayoutFact(current.elementId, \"flowParticipation\")\n if (!ancestorFlow.inFlow) return true\n current = current.parentElementNode\n }\n return false\n}\n\nfunction hasEffectivePosition(snapshot: SignalSnapshot): boolean {\n const position = snapshot.signals.get(\"position\")\n if (!position) return false\n if (position.kind !== SignalValueKind.Known) return false\n return position.normalized !== \"static\"\n}\n\nfunction hasStableBaseline(\n baselineBySignal: ReadonlyMap<LayoutSignalName, readonly number[]>,\n property: LayoutOffsetSignal,\n expectedPx: number,\n): boolean {\n const values = baselineBySignal.get(property)\n if (!values) return false\n\n for (let i = 0; i < values.length; i++) {\n const val = values[i]\n if (val === undefined) continue\n if (Math.abs(val - expectedPx) <= 0.25) return true\n }\n return false\n}\n\nfunction formatFixed(value: number, digits = 2): string {\n return value.toFixed(digits)\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport { TextualContentState, SignalValueKind } from \"../../binding/signal-builder\"\nimport type { LayoutSignalName, SignalSnapshot } from \"../../binding/signal-builder\"\nimport { SignalGuardKind } from \"../../binding/cascade-binder\"\nimport type { ConditionalSignalDelta } from \"../../analysis/cascade-analyzer\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n conditionalWhiteSpaceShift:\n \"Conditional white-space '{{whiteSpace}}' on '{{tag}}' can reflow text and shift siblings; keep wrapping behavior stable or reserve geometry.\",\n} as const\n\nconst WRAP_SHIFT_VALUES = new Set([\"nowrap\", \"pre\"])\nconst INLINE_SIZE_PROPERTIES: readonly LayoutSignalName[] = [\"width\", \"min-width\"]\nconst BLOCK_SIZE_PROPERTIES: readonly LayoutSignalName[] = [\"height\", \"min-height\"]\n\nexport const cssLayoutConditionalWhiteSpaceWrapShift = defineAnalysisRule({\n id: \"css-layout-conditional-white-space-wrap-shift\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow conditional white-space wrapping mode toggles that can trigger CLS.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.FullCascade },\n register(registry) {\n registry.registerConditionalDeltaAction((element, delta, semanticModel, emit) => {\n const whiteSpaceDelta = delta.get(\"white-space\")\n if (!whiteSpaceDelta || !whiteSpaceDelta.hasConditional || !whiteSpaceDelta.hasDelta) return\n if (!hasWrapShiftDelta(whiteSpaceDelta)) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const whiteSpaceSignal = snapshot.signals.get(\"white-space\")\n if (!whiteSpaceSignal || whiteSpaceSignal.kind !== SignalValueKind.Known) return\n if (whiteSpaceSignal.guard.kind !== SignalGuardKind.Conditional) return\n\n const flowFact = semanticModel.getLayoutFact(element.elementId, \"flowParticipation\")\n if (!flowFact.inFlow) return\n if (!isFlowRelevantBySiblingsOrText(element)) return\n if (hasStableTextShell(snapshot)) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutConditionalWhiteSpaceWrapShift.id,\n \"conditionalWhiteSpaceShift\",\n resolveMessage(messages.conditionalWhiteSpaceShift, { tag, whiteSpace: whiteSpaceSignal.normalized }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction isFlowRelevantBySiblingsOrText(element: ElementNode): boolean {\n if (element.siblingCount >= 2) return true\n return element.textualContent === TextualContentState.Yes\n || element.textualContent === TextualContentState.Unknown\n || element.textualContent === TextualContentState.DynamicText\n}\n\nfunction hasStableTextShell(snapshot: SignalSnapshot): boolean {\n return hasAnyPositiveKnownPx(snapshot, INLINE_SIZE_PROPERTIES)\n && hasAnyPositiveKnownPx(snapshot, BLOCK_SIZE_PROPERTIES)\n}\n\nfunction hasAnyPositiveKnownPx(snapshot: SignalSnapshot, properties: readonly LayoutSignalName[]): boolean {\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i]\n if (!prop) continue\n const sig = snapshot.signals.get(prop)\n if (!sig || sig.kind !== SignalValueKind.Known) continue\n if (sig.px !== null && sig.px > 0) return true\n }\n return false\n}\n\nfunction hasWrapShiftDelta(delta: ConditionalSignalDelta): boolean {\n for (let i = 0; i < delta.conditionalValues.length; i++) {\n const val = delta.conditionalValues[i]\n if (val && WRAP_SHIFT_VALUES.has(val)) return true\n }\n for (let i = 0; i < delta.unconditionalValues.length; i++) {\n const val = delta.unconditionalValues[i]\n if (val && WRAP_SHIFT_VALUES.has(val)) return true\n }\n return false\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport type { ConditionalSignalDelta } from \"../../analysis/cascade-analyzer\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n overflowModeToggle:\n \"Conditional overflow mode changes scrolling ('{{overflow}}') on '{{tag}}' without `scrollbar-gutter: stable`, which can trigger CLS.\",\n} as const\n\nconst VIEWPORT_CONTAINER_TAGS = new Set([\"html\", \"body\", \"main\", \"section\", \"article\", \"div\"])\n\nexport const cssLayoutOverflowModeToggleInstability = defineAnalysisRule({\n id: \"css-layout-overflow-mode-toggle-instability\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow conditional overflow mode switches that can introduce scrollbar-induced layout shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.FullCascade },\n register(registry) {\n registry.registerConditionalDeltaAction((element, delta, semanticModel, emit) => {\n const overflowDelta = delta.get(\"overflow\") ?? null\n const overflowYDelta = delta.get(\"overflow-y\") ?? null\n\n if (!hasRelevantScrollModeDelta(overflowDelta, overflowYDelta)) return\n\n const flowFact = semanticModel.getLayoutFact(element.elementId, \"flowParticipation\")\n if (!flowFact.inFlow) return\n if (!isLikelyViewportAffectingContainer(element)) return\n\n const scrollFact = semanticModel.getLayoutFact(element.elementId, \"scrollContainer\")\n if (!scrollFact.isScrollContainer && !hasAnyScrollValue(overflowDelta) && !hasAnyScrollValue(overflowYDelta)) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n\n const scrollbarWidthSignal = snapshot.signals.get(\"scrollbar-width\")\n if (scrollbarWidthSignal && scrollbarWidthSignal.kind === SignalValueKind.Known && scrollbarWidthSignal.normalized === \"none\") return\n\n const gutterSignal = snapshot.signals.get(\"scrollbar-gutter\")\n if (gutterSignal && gutterSignal.kind === SignalValueKind.Known && gutterSignal.normalized.startsWith(\"stable\")) return\n\n const overflowValue = scrollFact.overflowY ?? scrollFact.overflow ?? \"auto\"\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutOverflowModeToggleInstability.id,\n \"overflowModeToggle\",\n resolveMessage(messages.overflowModeToggle, { tag, overflow: overflowValue }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction isLikelyViewportAffectingContainer(element: ElementNode): boolean {\n if (element.siblingCount >= 2) return true\n if (element.parentElementNode === null) return true\n if (element.tagName !== null && VIEWPORT_CONTAINER_TAGS.has(element.tagName)) return true\n return false\n}\n\nfunction hasRelevantScrollModeDelta(\n overflowDelta: ConditionalSignalDelta | null,\n overflowYDelta: ConditionalSignalDelta | null,\n): boolean {\n return hasScrollModeDelta(overflowDelta) || hasScrollModeDelta(overflowYDelta)\n}\n\nfunction hasScrollModeDelta(delta: ConditionalSignalDelta | null): boolean {\n if (!delta || !delta.hasConditional || !delta.hasDelta) return false\n\n if (delta.hasConditionalScrollValue && delta.hasUnconditionalNonScrollValue) return true\n if (delta.hasUnconditionalScrollValue && delta.hasConditionalNonScrollValue) return true\n if (delta.hasConditionalScrollValue && delta.unconditionalValues.length === 0) return true\n if (delta.hasUnconditionalScrollValue && delta.conditionalValues.length === 0) return true\n return false\n}\n\nfunction hasAnyScrollValue(delta: ConditionalSignalDelta | null): boolean {\n if (!delta) return false\n return delta.hasConditionalScrollValue || delta.hasUnconditionalScrollValue\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { SignalValueKind } from \"../../binding/signal-builder\"\nimport type { LayoutSignalName, SignalSnapshot } from \"../../binding/signal-builder\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n boxSizingToggleWithChrome:\n \"Conditional `box-sizing` toggle on '{{tag}}' combines with non-zero padding/border, which can shift layout and trigger CLS.\",\n} as const\n\nconst BOX_SIZING_VALUES = new Set([\"content-box\", \"border-box\"])\nconst CHROME_PROPERTIES: readonly LayoutSignalName[] = [\n \"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\",\n \"border-top-width\", \"border-left-width\", \"border-right-width\", \"border-bottom-width\",\n]\n\nexport const cssLayoutBoxSizingToggleWithChrome = defineAnalysisRule({\n id: \"css-layout-box-sizing-toggle-with-chrome\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Disallow conditional box-sizing mode toggles when box chrome contributes to geometry shifts.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.FullCascade },\n register(registry) {\n registry.registerConditionalDeltaAction((element, delta, semanticModel, emit) => {\n const boxSizingDelta = delta.get(\"box-sizing\")\n if (!boxSizingDelta || !boxSizingDelta.hasConditional || !boxSizingDelta.hasDelta) return\n\n const snapshot = semanticModel.getSignalSnapshot(element.elementId)\n const boxSizingSignal = snapshot.signals.get(\"box-sizing\")\n if (!boxSizingSignal || boxSizingSignal.kind !== SignalValueKind.Known) return\n if (!BOX_SIZING_VALUES.has(boxSizingSignal.normalized)) return\n\n if (!hasNonZeroChrome(snapshot)) return\n\n const tag = element.tagName ?? \"element\"\n emit(\n createDiagnostic(\n element.solidFile,\n element.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutBoxSizingToggleWithChrome.id,\n \"boxSizingToggleWithChrome\",\n resolveMessage(messages.boxSizingToggleWithChrome, { tag }),\n \"warn\",\n ),\n )\n })\n },\n})\n\nfunction hasNonZeroChrome(snapshot: SignalSnapshot): boolean {\n for (let i = 0; i < CHROME_PROPERTIES.length; i++) {\n const prop = CHROME_PROPERTIES[i]\n if (!prop) continue\n const sig = snapshot.signals.get(prop)\n if (!sig || sig.kind !== SignalValueKind.Known) continue\n if (sig.px !== null && sig.px > 0) return true\n }\n return false\n}\n","import { createDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { ElementNode } from \"../../binding/element-builder\"\nimport type { AlignmentContext, CohortStats, CohortSubjectStats, AlignmentCase, AlignmentFactorCoverage, ContentCompositionFingerprint } from \"../../analysis/alignment\"\nimport {\n scoreAlignmentCase,\n formatAlignmentCauses,\n formatPrimaryFix,\n resolveCompositionCoverage,\n type LayoutDetection,\n type AlignmentFactorId,\n} from \"../../analysis/alignment\"\nimport type { FileSemanticModel } from \"../../binding/semantic-model\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n misalignedSibling:\n \"Vertically misaligned '{{subject}}' in '{{parent}}'.{{fix}}{{offsetClause}}\",\n} as const\n\nconst MIN_CONFIDENCE_THRESHOLD = 0.48\nconst MIN_OFFSET_PX_THRESHOLD = 2.0\n\nconst NON_OFFSET_FACTORS: ReadonlySet<string> = new Set([\n \"baseline-conflict\", \"context-conflict\", \"replaced-control-risk\", \"content-composition-conflict\",\n])\n\nexport const cssLayoutSiblingAlignmentOutlier = defineAnalysisRule({\n id: \"css-layout-sibling-alignment-outlier\",\n severity: \"warn\",\n messages,\n meta: {\n description: \"Detect vertical alignment outliers between sibling elements in shared layout containers.\",\n fixable: false,\n category: \"css-layout\",\n },\n requirement: { tier: ComputationTier.AlignmentModel },\n register(registry) {\n registry.registerAlignmentAction((parentElement, context, cohort, semanticModel, emit) => {\n const detections = collectAndEvaluate(context, cohort, semanticModel)\n const uniqueDetections = dedupeDetectionsBySubject(detections)\n\n for (let i = 0; i < uniqueDetections.length; i++) {\n const detection = uniqueDetections[i]\n if (!detection) continue\n\n if (detection.evidence.confidence < MIN_CONFIDENCE_THRESHOLD) continue\n\n const estimatedOffset = detection.evidence.estimatedOffsetPx\n if (estimatedOffset !== null && Math.abs(estimatedOffset) < MIN_OFFSET_PX_THRESHOLD && !hasNonOffsetPrimaryEvidence(detection.evidence.topFactors)) continue\n\n if (isInsideOutOfFlowAncestor(detection.caseData.cohort.parentElementKey, parentElement, semanticModel)) continue\n\n const subjectNode = semanticModel.getElementNode(detection.caseData.subject.elementId)\n if (!subjectNode) continue\n\n const subjectTag = detection.caseData.subject.tag ?? \"element\"\n const parentTag = detection.caseData.cohort.parentTag ?? \"container\"\n const offset = detection.evidence.estimatedOffsetPx\n const hasOffset = offset !== null && Math.abs(offset) > 0.25\n const offsetClause = hasOffset ? ` Estimated offset: ${offset!.toFixed(2)}px.` : \"\"\n const primaryFix = detection.evidence.primaryFix\n const firstChar = primaryFix.length > 0 ? primaryFix[0] : undefined\n const fix = firstChar !== undefined ? ` ${firstChar.toUpperCase()}${primaryFix.slice(1)}.` : \"\"\n\n emit(\n createDiagnostic(\n subjectNode.solidFile,\n subjectNode.jsxEntity.node,\n semanticModel.solidTree.sourceFile,\n cssLayoutSiblingAlignmentOutlier.id,\n \"misalignedSibling\",\n resolveMessage(messages.misalignedSibling, { subject: subjectTag, parent: parentTag, fix, offsetClause }),\n \"warn\",\n ),\n )\n }\n })\n },\n})\n\ninterface AlignmentDetectionCase {\n readonly subject: { readonly solidFile: string; readonly elementKey: string; readonly elementId: number; readonly tag: string | null }\n readonly cohort: { readonly parentElementKey: string; readonly parentElementId: number; readonly parentTag: string | null; readonly siblingCount: number }\n}\n\nfunction collectAndEvaluate(\n context: AlignmentContext,\n cohort: CohortStats,\n semanticModel: FileSemanticModel,\n): readonly LayoutDetection<AlignmentDetectionCase>[] {\n const out: LayoutDetection<AlignmentDetectionCase>[] = []\n const cohortCompositions: ContentCompositionFingerprint[] = []\n\n for (const [, subjectStats] of cohort.subjectsByElementKey) {\n cohortCompositions.push(subjectStats.contentComposition)\n }\n\n for (const [, subjectStats] of cohort.subjectsByElementKey) {\n const subjectNode = semanticModel.getElementNode(subjectStats.element.elementId)\n const subjectIsControlOrReplaced = subjectNode !== null && (subjectNode.isControl || subjectNode.isReplaced)\n\n const factorCoverage = buildFactorCoverage(subjectStats, cohort, context, cohortCompositions)\n\n const alignmentCase: AlignmentCase = {\n subject: subjectStats.element,\n subjectIsControlOrReplaced,\n cohort: {\n parentElementKey: context.parentElementKey,\n parentElementId: context.parentElementId,\n parentTag: context.parentTag,\n siblingCount: cohort.subjectsByElementKey.size,\n },\n cohortProfile: cohort.profile,\n cohortSignals: subjectStats.signals,\n subjectIdentifiability: subjectStats.identifiability,\n factorCoverage,\n cohortSnapshots: cohort.snapshots,\n cohortFactSummary: cohort.factSummary,\n cohortProvenance: cohort.provenance,\n subjectDeclaredOffsetDeviation: subjectStats.declaredOffset,\n subjectEffectiveOffsetDeviation: subjectStats.effectiveOffset,\n subjectLineHeightDeviation: subjectStats.lineHeight,\n context,\n subjectContentComposition: subjectStats.contentComposition,\n cohortContentCompositions: cohortCompositions,\n }\n\n const decision = scoreAlignmentCase(alignmentCase)\n if (decision.kind === \"reject\") continue\n\n out.push({\n caseData: {\n subject: { solidFile: subjectStats.element.solidFile, elementKey: subjectStats.element.elementKey, elementId: subjectStats.element.elementId, tag: subjectStats.element.tag },\n cohort: alignmentCase.cohort,\n },\n evidence: {\n severity: decision.evaluation.severity,\n confidence: decision.evaluation.confidence,\n causes: formatAlignmentCauses(decision.evaluation.signalFindings),\n primaryFix: formatPrimaryFix(decision.evaluation.signalFindings),\n contextKind: decision.evaluation.contextKind,\n contextCertainty: decision.evaluation.contextCertainty,\n estimatedOffsetPx: decision.evaluation.estimatedOffsetPx,\n decisionReason: \"accepted-lower-bound\",\n posteriorLower: decision.evaluation.posterior.lower,\n posteriorUpper: decision.evaluation.posterior.upper,\n evidenceMass: decision.evaluation.evidenceMass,\n topFactors: decision.evaluation.topFactors,\n },\n })\n }\n\n return out\n}\n\nfunction buildFactorCoverage(\n subjectStats: CohortSubjectStats,\n cohort: CohortStats,\n context: AlignmentContext,\n cohortCompositions: readonly ContentCompositionFingerprint[],\n): AlignmentFactorCoverage {\n const factSummary = cohort.factSummary\n const baseCoverage = factSummary.total > 0 ? factSummary.exactShare + factSummary.intervalShare * 0.7 : 0\n const contextCoverage = context.certainty === 0 /* Resolved */ ? 1 : context.certainty === 1 /* Conditional */ ? 0.6 : 0.2\n const compositionCoverage = resolveCompositionCoverage(subjectStats.contentComposition, cohortCompositions)\n\n return {\n \"offset-delta\": baseCoverage,\n \"declared-offset-delta\": baseCoverage,\n \"baseline-conflict\": baseCoverage,\n \"context-conflict\": contextCoverage,\n \"replaced-control-risk\": baseCoverage,\n \"content-composition-conflict\": compositionCoverage,\n \"context-certainty\": contextCoverage,\n }\n}\n\nfunction isInsideOutOfFlowAncestor(\n _parentElementKey: string,\n parentElement: ElementNode,\n semanticModel: FileSemanticModel,\n): boolean {\n let current: ElementNode | null = parentElement\n while (current !== null) {\n const flowFact = semanticModel.getLayoutFact(current.elementId, \"flowParticipation\")\n if (!flowFact.inFlow) return true\n current = current.parentElementNode\n }\n return false\n}\n\nfunction dedupeDetectionsBySubject(\n detections: readonly LayoutDetection<AlignmentDetectionCase>[],\n): readonly LayoutDetection<AlignmentDetectionCase>[] {\n const bySubject = new Map<string, LayoutDetection<AlignmentDetectionCase>>()\n for (let i = 0; i < detections.length; i++) {\n const current = detections[i]\n if (!current) continue\n const key = `${current.caseData.subject.solidFile}::${current.caseData.subject.elementId}`\n const existing = bySubject.get(key)\n if (!existing) { bySubject.set(key, current); continue }\n if (isStrongerDetection(current, existing)) bySubject.set(key, current)\n }\n\n const out: LayoutDetection<AlignmentDetectionCase>[] = new Array(bySubject.size)\n let index = 0\n for (const detection of bySubject.values()) { out[index] = detection; index++ }\n out.sort((left, right) => {\n if (left.caseData.subject.solidFile < right.caseData.subject.solidFile) return -1\n if (left.caseData.subject.solidFile > right.caseData.subject.solidFile) return 1\n return left.caseData.subject.elementId - right.caseData.subject.elementId\n })\n return out\n}\n\nfunction isStrongerDetection(\n current: LayoutDetection<AlignmentDetectionCase>,\n existing: LayoutDetection<AlignmentDetectionCase>,\n): boolean {\n if (current.evidence.confidence > existing.evidence.confidence) return true\n if (current.evidence.confidence < existing.evidence.confidence) return false\n if (current.evidence.severity > existing.evidence.severity) return true\n if (current.evidence.severity < existing.evidence.severity) return false\n if (current.evidence.posteriorLower > existing.evidence.posteriorLower) return true\n if (current.evidence.posteriorLower < existing.evidence.posteriorLower) return false\n if (current.caseData.cohort.siblingCount > existing.caseData.cohort.siblingCount) return true\n if (current.caseData.cohort.siblingCount < existing.caseData.cohort.siblingCount) return false\n return current.caseData.cohort.parentElementId < existing.caseData.cohort.parentElementId\n}\n\nfunction hasNonOffsetPrimaryEvidence(topFactors: readonly AlignmentFactorId[]): boolean {\n for (let i = 0; i < topFactors.length; i++) {\n const factor = topFactors[i]\n if (!factor) continue\n if (NON_OFFSET_FACTORS.has(factor)) return true\n }\n return false\n}\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n emptyRule: \"Empty rule `{{selector}}` should be removed.\",\n} as const\n\nexport const cssNoEmptyRule = defineAnalysisRule({\n id: \"css-no-empty-rule\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow empty CSS rules.\", fixable: false, category: \"css-structure\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.rules.length; i++) {\n const rule = tree.rules[i]\n if (!rule) continue\n if (rule.declarations.length > 0 || rule.nestedRules.length > 0 || rule.nestedAtRules.length > 0) continue\n emit(createCSSDiagnostic(\n rule.file.path, rule.startLine, rule.startColumn,\n cssNoEmptyRule.id, \"emptyRule\",\n resolveMessage(messages.emptyRule, { selector: rule.selectorText }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { hasFlag, SEL_HAS_ID } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n avoidId: \"Avoid ID selector in `{{selector}}`. IDs raise specificity and make component-level styling harder to maintain.\",\n} as const\n\nexport const cssNoIdSelectors = defineAnalysisRule({\n id: \"no-id-selectors\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow ID selectors.\", fixable: false, category: \"css-selector\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.selectors.length; i++) {\n const selector = tree.selectors[i]\n if (!selector) continue\n if (!hasFlag(selector.complexity._flags, SEL_HAS_ID)) continue\n emit(createCSSDiagnostic(\n selector.rule.file.path, selector.rule.startLine, selector.rule.startColumn,\n cssNoIdSelectors.id, \"avoidId\",\n resolveMessage(messages.avoidId, { selector: selector.raw }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n selectorTooDeep: \"Selector `{{selector}}` has depth {{depth}}. Deep selectors increase style recalculation cost and are fragile across component rerenders.\",\n} as const\n\nconst MAX_DEPTH = 3\n\nexport const cssNoComplexSelectors = defineAnalysisRule({\n id: \"no-complex-selectors\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow deep selectors that are expensive to match.\", fixable: false, category: \"css-selector\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.selectors.length; i++) {\n const selector = tree.selectors[i]\n if (!selector) continue\n if (selector.complexity.depth <= MAX_DEPTH) continue\n emit(createCSSDiagnostic(\n selector.rule.file.path, selector.rule.startLine, selector.rule.startColumn,\n cssNoComplexSelectors.id, \"selectorTooDeep\",\n resolveMessage(messages.selectorTooDeep, { selector: selector.raw, depth: String(selector.complexity.depth) }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n maxSpecificity: \"Selector `{{selector}}` specificity {{specificity}} exceeds max {{max}}. Reduce selector weight to keep the cascade predictable.\",\n} as const\n\nconst MAX_SPECIFICITY_SCORE = 800\n\nexport const cssSelectorMaxSpecificity = defineAnalysisRule({\n id: \"selector-max-specificity\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow selectors that exceed a specificity threshold.\", fixable: false, category: \"css-selector\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.selectors.length; i++) {\n const selector = tree.selectors[i]\n if (!selector) continue\n if (selector.specificityScore <= MAX_SPECIFICITY_SCORE) continue\n emit(createCSSDiagnostic(\n selector.rule.file.path, selector.rule.startLine, selector.rule.startColumn,\n cssSelectorMaxSpecificity.id, \"maxSpecificity\",\n resolveMessage(messages.maxSpecificity, { selector: selector.raw, specificity: `(${selector.specificity.join(\",\")})`, max: String(MAX_SPECIFICITY_SCORE) }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { hasFlag, SEL_HAS_ATTRIBUTE, SEL_HAS_UNIVERSAL } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n tooManyAttributes: \"Selector `{{selector}}` uses attribute selector(s). Maximum allowed is 0.\",\n tooManyUniversals: \"Selector `{{selector}}` uses universal selector(s). Maximum allowed is 0.\",\n} as const\n\nexport const cssSelectorMaxAttributeAndUniversal = defineAnalysisRule({\n id: \"selector-max-attribute-and-universal\",\n severity: \"off\",\n messages,\n meta: { description: \"Disallow selectors with attribute or universal selectors.\", fixable: false, category: \"css-selector\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.selectors.length; i++) {\n const selector = tree.selectors[i]\n if (!selector) continue\n const flags = selector.complexity._flags\n if (hasFlag(flags, SEL_HAS_ATTRIBUTE)) {\n emit(createCSSDiagnostic(\n selector.rule.file.path, selector.rule.startLine, selector.rule.startColumn,\n cssSelectorMaxAttributeAndUniversal.id, \"tooManyAttributes\",\n resolveMessage(messages.tooManyAttributes, { selector: selector.raw }), \"warn\",\n ))\n }\n if (hasFlag(flags, SEL_HAS_UNIVERSAL)) {\n emit(createCSSDiagnostic(\n selector.rule.file.path, selector.rule.startLine, selector.rule.startColumn,\n cssSelectorMaxAttributeAndUniversal.id, \"tooManyUniversals\",\n resolveMessage(messages.tooManyUniversals, { selector: selector.raw }), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n overriddenWithinRule: \"Declaration `{{property}}` is overridden later in the same rule. Keep one final declaration per property.\",\n} as const\n\nexport const cssDeclarationNoOverriddenWithinRule = defineAnalysisRule({\n id: \"declaration-no-overridden-within-rule\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow duplicate declarations of the same property within a single rule block.\", fixable: false, category: \"css-cascade\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.rules.length; i++) {\n const rule = tree.rules[i]\n if (!rule || rule.declarations.length < 2) continue\n for (const [property, decls] of rule.declarationIndex) {\n if (decls.length < 2) continue\n for (let j = 0; j < decls.length - 1; j++) {\n const overridden = decls[j]\n if (!overridden) continue\n emit(createCSSDiagnostic(\n overridden.file.path, overridden.startLine, overridden.startColumn,\n cssDeclarationNoOverriddenWithinRule.id, \"overriddenWithinRule\",\n resolveMessage(messages.overriddenWithinRule, { property }), \"warn\",\n ))\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n hardcodedZ: \"Use a z-index token variable instead of literal `{{value}}`.\",\n} as const\n\nconst DIGITS_ONLY = /^[0-9]+$/\n\nexport const cssNoHardcodedZIndex = defineAnalysisRule({\n id: \"css-no-hardcoded-z-index\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow hardcoded positive z-index literals.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const decls = tree.declarationsByProperty.get(\"z-index\")\n if (!decls) return\n for (let i = 0; i < decls.length; i++) {\n const d = decls[i]\n if (!d) continue\n const t = d.value.trim()\n if (t.includes(\"var(\") || !DIGITS_ONLY.test(t) || Number(t) <= 0) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoHardcodedZIndex.id, \"hardcodedZ\",\n resolveMessage(messages.hardcodedZ, { value: t }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n zIndexNoContext: \"`z-index` has no guaranteed effect without a positioned context.\",\n} as const\n\nexport const cssZIndexRequiresPositionedContext = defineAnalysisRule({\n id: \"css-z-index-requires-positioned-context\",\n severity: \"warn\",\n messages,\n meta: { description: \"Require positioned context when using z-index.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const zDecls = tree.declarationsByProperty.get(\"z-index\")\n if (!zDecls) return\n for (let i = 0; i < zDecls.length; i++) {\n const zd = zDecls[i]\n if (!zd || zd.value.trim() === \"auto\") continue\n const rule = zd.rule\n if (!rule) continue\n const posDecls = rule.declarationIndex.get(\"position\")\n if (!posDecls) continue\n const lastPos = posDecls[posDecls.length - 1]\n if (!lastPos || lastPos.value.trim().toLowerCase() !== \"static\") continue\n emit(createCSSDiagnostic(\n zd.file.path, zd.startLine, zd.startColumn,\n cssZIndexRequiresPositionedContext.id, \"zIndexNoContext\",\n resolveMessage(messages.zIndexNoContext), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { findTransitionProperty, findPropertyInList } from \"../../../css/parser/value-util\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst discrete = new Set([\"display\", \"position\", \"overflow\", \"overflow-x\", \"overflow-y\", \"visibility\", \"float\", \"clear\"])\n\nconst messages = {\n discreteTransition: \"Property `{{property}}` is discrete and should not be transitioned.\",\n} as const\n\nexport const cssNoDiscreteTransition = defineAnalysisRule({\n id: \"css-no-discrete-transition\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow transitions on discrete CSS properties.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const tDecls = tree.declarationsByProperty.get(\"transition\") ?? []\n const tpDecls = tree.declarationsByProperty.get(\"transition-property\") ?? []\n for (let i = 0; i < tDecls.length; i++) {\n const d = tDecls[i]\n if (!d) continue\n const bad = findTransitionProperty(d.value, discrete)\n if (!bad) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoDiscreteTransition.id, \"discreteTransition\",\n resolveMessage(messages.discreteTransition, { property: bad }), \"error\",\n ))\n }\n for (let i = 0; i < tpDecls.length; i++) {\n const d = tpDecls[i]\n if (!d) continue\n const bad = findPropertyInList(d.value, discrete)\n if (!bad) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoDiscreteTransition.id, \"discreteTransition\",\n resolveMessage(messages.discreteTransition, { property: bad }), \"error\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n avoidTransitionAll: \"Avoid `transition: all`. Transition specific properties to reduce unnecessary style and paint work.\",\n} as const\n\nconst WORD_ALL = /\\ball\\b/\n\nexport const cssNoTransitionAll = defineAnalysisRule({\n id: \"no-transition-all\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow transition: all.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const tDecls = tree.declarationsByProperty.get(\"transition\") ?? []\n const tpDecls = tree.declarationsByProperty.get(\"transition-property\") ?? []\n const allDecls = [...tDecls, ...tpDecls]\n for (let i = 0; i < allDecls.length; i++) {\n const d = allDecls[i]\n if (!d || !WORD_ALL.test(d.value)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoTransitionAll.id, \"avoidTransitionAll\",\n resolveMessage(messages.avoidTransitionAll), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n avoidLegacyVh: \"Use 100dvh/100svh instead of `100vh` for mobile-safe viewport sizing.\",\n} as const\n\nconst LEGACY_VH_100 = /(^|\\s|,)100vh($|\\s|;|,)/\n\nexport const cssNoLegacyVh100 = defineAnalysisRule({\n id: \"css-no-legacy-vh-100\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow 100vh in viewport sizing declarations.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (const prop of [\"height\", \"min-height\", \"max-height\"]) {\n const decls = tree.declarationsByProperty.get(prop)\n if (!decls) continue\n for (let i = 0; i < decls.length; i++) {\n const d = decls[i]\n if (!d || !LEGACY_VH_100.test(d.value)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoLegacyVh100.id, \"avoidLegacyVh\",\n resolveMessage(messages.avoidLegacyVh), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst PHYSICAL_TO_LOGICAL = new Map([\n [\"margin-left\", \"margin-inline-start\"],\n [\"margin-right\", \"margin-inline-end\"],\n [\"padding-left\", \"padding-inline-start\"],\n [\"padding-right\", \"padding-inline-end\"],\n [\"left\", \"inset-inline-start\"],\n [\"right\", \"inset-inline-end\"],\n])\n\nconst messages = {\n preferLogical: \"Use logical property `{{logical}}` instead of `{{physical}}`.\",\n} as const\n\nexport const cssPreferLogicalProperties = defineAnalysisRule({\n id: \"css-prefer-logical-properties\",\n severity: \"warn\",\n messages,\n meta: { description: \"Prefer logical properties over physical left/right properties.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (const [physical, logical] of PHYSICAL_TO_LOGICAL) {\n const decls = tree.declarationsByProperty.get(physical)\n if (!decls) continue\n for (let i = 0; i < decls.length; i++) {\n const d = decls[i]\n if (!d) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPreferLogicalProperties.id, \"preferLogical\",\n resolveMessage(messages.preferLogical, { logical, physical }), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../../../css/entities\"\nimport type { DeclarationEntity } from \"../../../css/entities/declaration\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n avoidImportant: \"Avoid `!important` on `{{property}}`. It increases override cost and usually signals specificity debt.\",\n} as const\n\nconst SYSTEM_LEVEL_MEDIA_RE = /prefers-reduced-motion|prefers-contrast|prefers-color-scheme|forced-colors|hover\\s*:|pointer\\s*:/\n\nfunction isSystemLevelOverride(decl: DeclarationEntity): boolean {\n const rule = decl.rule\n if (!rule) return false\n for (let i = 0; i < rule.containingMediaStack.length; i++) {\n const media = rule.containingMediaStack[i]\n if (!media) continue\n if (SYSTEM_LEVEL_MEDIA_RE.test(media.params.toLowerCase())) return true\n }\n if (rule.selectorText.toLowerCase().includes(\"[hidden]\")) return true\n return false\n}\n\nexport const cssNoImportant = defineAnalysisRule({\n id: \"no-important\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow !important declarations.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.declarations.length; i++) {\n const decl = tree.declarations[i]\n if (!decl) continue\n if (!hasFlag(decl._flags, DECL_IS_IMPORTANT) && !decl.node.important) continue\n if (isSystemLevelOverride(decl)) continue\n emit(createCSSDiagnostic(\n decl.file.path, decl.startLine, decl.startColumn,\n cssNoImportant.id, \"avoidImportant\",\n resolveMessage(messages.avoidImportant, { property: decl.property }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { isBlank } from \"@drskillissue/ganko-shared\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unresolvedCustomProperty: \"Custom property reference `{{name}}` is unresolved in `{{property}}`. Define it or provide a fallback value.\",\n} as const\n\nexport const cssNoUnresolvedCustomProperties = defineAnalysisRule({\n id: \"no-unresolved-custom-properties\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow unresolved custom property references.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n for (let i = 0; i < tree.unresolvedRefs.length; i++) {\n const ref = tree.unresolvedRefs[i]\n if (!ref) continue\n if (ref.fallback && !isBlank(ref.fallback)) continue\n emit(createCSSDiagnostic(\n ref.file.path, ref.declaration.startLine, ref.declaration.startColumn,\n cssNoUnresolvedCustomProperties.id, \"unresolvedCustomProperty\",\n resolveMessage(messages.unresolvedCustomProperty, { name: ref.name, property: ref.declaration.property }), \"error\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { hasFlag, VAR_IS_SCSS, VAR_IS_USED } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unusedCustomProperty: \"Custom property `{{name}}` is never referenced within the project CSS.\",\n} as const\n\nexport const cssNoUnusedCustomProperties = defineAnalysisRule({\n id: \"no-unused-custom-properties\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow unused CSS custom properties.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n for (const [, tree] of compilation.cssTrees) {\n for (let i = 0; i < tree.variables.length; i++) {\n const variable = tree.variables[i]\n if (!variable) continue\n if (hasFlag(variable._flags, VAR_IS_USED)) continue\n if (hasFlag(variable._flags, VAR_IS_SCSS)) continue\n if (variable.scope.type === \"global\") continue\n emit(createCSSDiagnostic(\n variable.file.path, variable.declaration.startLine, variable.declaration.startColumn,\n cssNoUnusedCustomProperties.id, \"unusedCustomProperty\",\n resolveMessage(messages.unusedCustomProperty, { name: variable.name }), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n duplicateSelector: \"Selector `{{selector}}` is duplicated {{count}} times. Merge declarations to avoid cascade ambiguity.\",\n} as const\n\nexport const cssNoDuplicateSelectors = defineAnalysisRule({\n id: \"no-duplicate-selectors\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow duplicate selector blocks.\", fixable: false, category: \"css-selector\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n // Duplicate detection needs workspace-wide dedup index\n // Build per-file selector dedup\n for (const [, tree] of compilation.cssTrees) {\n const dedupIndex = new Map<string, import(\"../../../css/entities/rule\").RuleEntity[]>()\n for (let i = 0; i < tree.rules.length; i++) {\n const rule = tree.rules[i]\n if (!rule) continue\n // Skip keyframe selectors. Build full nesting context key —\n // selectors inside different parent rules, at-rules, or nesting\n // contexts are NOT duplicates of each other.\n let isKeyframe = false\n const parentParts: string[] = []\n for (let p = rule.parent; p !== null; p = p.parent as typeof rule.parent) {\n if (p.kind === \"keyframes\") { isKeyframe = true; break }\n if (p.kind === \"rule\") parentParts.push(`r:${p.selectorText ?? \"\"}`)\n else parentParts.push(`${p.kind}:${p.params ?? \"\"}`)\n }\n if (isKeyframe) continue\n const contextKey = parentParts.length > 0 ? parentParts.reverse().join(\"/\") : \"\"\n const key = `${rule.file.path}\\0${contextKey}\\0${rule.selectorText}`\n const existing = dedupIndex.get(key)\n if (existing) existing.push(rule)\n else dedupIndex.set(key, [rule])\n }\n for (const [, rules] of dedupIndex) {\n if (rules.length < 2) continue\n const count = String(rules.length)\n const selector = rules[0]!.selectorText\n const msg = resolveMessage(messages.duplicateSelector, { selector, count })\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i]\n if (!rule) continue\n emit(createCSSDiagnostic(\n rule.file.path, rule.startLine, rule.startColumn,\n cssNoDuplicateSelectors.id, \"duplicateSelector\",\n msg, \"warn\",\n ))\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n emptyKeyframes: \"@keyframes `{{name}}` has no effective keyframes.\",\n} as const\n\nexport const cssNoEmptyKeyframes = defineAnalysisRule({\n id: \"css-no-empty-keyframes\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow empty @keyframes rules.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const keyframes = tree.atRulesByKind.get(\"keyframes\")\n if (!keyframes) return\n for (let i = 0; i < keyframes.length; i++) {\n const kf = keyframes[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName\n if (!name) continue\n if (kf.rules.length === 0) {\n emit(createCSSDiagnostic(\n kf.file.path, kf.startLine, 1,\n cssNoEmptyKeyframes.id, \"emptyKeyframes\",\n resolveMessage(messages.emptyKeyframes, { name }), \"error\",\n ))\n continue\n }\n let hasDecl = false\n for (let j = 0; j < kf.rules.length; j++) { const r = kf.rules[j]; if (r && r.declarations.length > 0) { hasDecl = true; break } }\n if (!hasDecl) emit(createCSSDiagnostic(\n kf.file.path, kf.startLine, 1,\n cssNoEmptyKeyframes.id, \"emptyKeyframes\",\n resolveMessage(messages.emptyKeyframes, { name }), \"error\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { extractKeyframeNames } from \"@drskillissue/ganko-shared\"\nimport { CSS_WIDE_KEYWORDS } from \"../../../css/parser/css-keywords\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unknownAnimationName: \"Animation name `{{name}}` in `{{property}}` does not match any declared @keyframes.\",\n} as const\n\nexport const cssNoUnknownAnimationName = defineAnalysisRule({\n id: \"no-unknown-animation-name\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow animation names that do not match declared keyframes.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n // Needs workspace-wide keyframe name index\n const knownNames = new Set<string>()\n for (const [, tree] of compilation.cssTrees) {\n const keyframes = tree.atRulesByKind.get(\"keyframes\")\n if (!keyframes) continue\n for (let i = 0; i < keyframes.length; i++) {\n const kf = keyframes[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName\n if (name) knownNames.add(name)\n }\n }\n // Check animation references across all files\n const IGNORED = new Set([...CSS_WIDE_KEYWORDS, \"none\"])\n for (const [, tree] of compilation.cssTrees) {\n const animDecls = [...(tree.declarationsByProperty.get(\"animation\") ?? []), ...(tree.declarationsByProperty.get(\"animation-name\") ?? [])]\n for (let i = 0; i < animDecls.length; i++) {\n const d = animDecls[i]\n if (!d) continue\n const names = extractKeyframeNames(d.value, d.property.toLowerCase())\n for (let j = 0; j < names.length; j++) {\n const name = names[j]\n if (!name || IGNORED.has(name) || name.includes(\"(\") || knownNames.has(name)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoUnknownAnimationName.id, \"unknownAnimationName\",\n resolveMessage(messages.unknownAnimationName, { name, property: d.property }), \"error\",\n ))\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { extractKeyframeNames } from \"@drskillissue/ganko-shared\"\nimport { CSS_WIDE_KEYWORDS } from \"../../../css/parser/css-keywords\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unusedKeyframes: \"@keyframes `{{name}}` is never referenced by animation declarations.\",\n} as const\n\nexport const cssNoUnusedKeyframes = defineAnalysisRule({\n id: \"no-unused-keyframes\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow unused @keyframes declarations.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const IGNORED = new Set([...CSS_WIDE_KEYWORDS, \"none\"])\n const usedNames = new Set<string>()\n for (const [, tree] of compilation.cssTrees) {\n const animDecls = [...(tree.declarationsByProperty.get(\"animation\") ?? []), ...(tree.declarationsByProperty.get(\"animation-name\") ?? [])]\n for (let i = 0; i < animDecls.length; i++) {\n const d = animDecls[i]\n if (!d) continue\n const names = extractKeyframeNames(d.value, d.property.toLowerCase())\n for (let j = 0; j < names.length; j++) { const n = names[j]; if (n && !IGNORED.has(n)) usedNames.add(n) }\n }\n for (let i = 0; i < tree.atRules.length; i++) {\n const atRule = tree.atRules[i]\n if (!atRule) continue\n if (atRule.declarations.length > 0) continue\n const nodes = atRule.node.nodes\n if (!nodes) continue\n for (let j = 0; j < nodes.length; j++) {\n const child = nodes[j]\n if (!child || child.type !== \"decl\") continue\n const prop = child.prop.toLowerCase()\n if (prop !== \"animation\" && prop !== \"animation-name\") continue\n const names = extractKeyframeNames(child.value, prop)\n for (let k = 0; k < names.length; k++) { const n = names[k]; if (n && !IGNORED.has(n)) usedNames.add(n) }\n }\n }\n }\n for (const [, tree] of compilation.cssTrees) {\n const keyframes = tree.atRulesByKind.get(\"keyframes\")\n if (!keyframes) continue\n for (let i = 0; i < keyframes.length; i++) {\n const kf = keyframes[i]\n if (!kf) continue\n const name = kf.parsedParams.animationName\n if (!name || usedNames.has(name)) continue\n emit(createCSSDiagnostic(\n kf.file.path, kf.startLine, 1,\n cssNoUnusedKeyframes.id, \"unusedKeyframes\",\n resolveMessage(messages.unusedKeyframes, { name }), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { parseContainerQueryName, parseContainerNames, parseContainerNamesFromShorthand } from \"../../../css/parser/value-util\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unknownContainer: \"Unknown container name `{{name}}` in @container query.\",\n} as const\n\nexport const cssNoUnknownContainerName = defineAnalysisRule({\n id: \"css-no-unknown-container-name\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow unknown named containers in @container queries.\", fixable: false, category: \"css-structure\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const declaredNames = new Set<string>()\n for (const [, tree] of compilation.cssTrees) {\n for (let i = 0; i < tree.declarations.length; i++) {\n const d = tree.declarations[i]\n if (!d) continue\n const p = d.property.toLowerCase()\n let names: readonly string[] | null = null\n if (p === \"container-name\") names = parseContainerNames(d.value)\n else if (p === \"container\") names = parseContainerNamesFromShorthand(d.value)\n if (!names) continue\n for (let j = 0; j < names.length; j++) { const n = names[j]; if (n) declaredNames.add(n) }\n }\n }\n for (const [, tree] of compilation.cssTrees) {\n const containers = tree.atRulesByKind.get(\"container\")\n if (!containers) continue\n for (let i = 0; i < containers.length; i++) {\n const at = containers[i]\n if (!at) continue\n const name = at.parsedParams.containerName ?? parseContainerQueryName(at.params)\n if (!name || declaredNames.has(name)) continue\n emit(createCSSDiagnostic(\n at.file.path, at.startLine, 1,\n cssNoUnknownContainerName.id, \"unknownContainer\",\n resolveMessage(messages.unknownContainer, { name }), \"error\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { parseContainerQueryName, parseContainerNames, parseContainerNamesFromShorthand } from \"../../../css/parser/value-util\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n unusedContainer: \"Container name `{{name}}` is declared but never queried.\",\n} as const\n\nexport const cssNoUnusedContainerName = defineAnalysisRule({\n id: \"css-no-unused-container-name\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow unused named containers.\", fixable: false, category: \"css-structure\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const queriedNames = new Set<string>()\n for (const [, tree] of compilation.cssTrees) {\n const containers = tree.atRulesByKind.get(\"container\")\n if (!containers) continue\n for (let i = 0; i < containers.length; i++) {\n const at = containers[i]\n if (!at) continue\n const name = at.parsedParams.containerName ?? parseContainerQueryName(at.params)\n if (name) queriedNames.add(name)\n }\n }\n for (const [, tree] of compilation.cssTrees) {\n for (let i = 0; i < tree.declarations.length; i++) {\n const d = tree.declarations[i]\n if (!d) continue\n const p = d.property.toLowerCase()\n let names: readonly string[] | null = null\n if (p === \"container-name\") names = parseContainerNames(d.value)\n else if (p === \"container\") names = parseContainerNamesFromShorthand(d.value)\n if (!names) continue\n const seen = new Set<string>()\n for (let j = 0; j < names.length; j++) {\n const name = names[j]\n if (!name || queriedNames.has(name) || seen.has(name)) continue\n seen.add(name)\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoUnusedContainerName.id, \"unusedContainer\",\n resolveMessage(messages.unusedContainer, { name }), \"warn\",\n ))\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { RuleEntity } from \"../../../css/entities/rule\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst ZERO_MS = /(^|\\s|,)0ms($|\\s|,)/\nconst ZERO_S = /(^|\\s|,)0s($|\\s|,)/\nconst TIME_VALUE_G = /([0-9]*\\.?[0-9]+)(ms|s)/g\nconst AMPERSAND_G = /&/g\nconst WHITESPACE_G = /\\s+/g\n\nconst messages = {\n missingReducedMotion: \"Animated selector `{{selector}}` lacks prefers-reduced-motion override.\",\n} as const\n\nfunction isAnimationDecl(p: string): boolean { return p === \"animation\" || p === \"animation-duration\" }\nfunction isTransitionDecl(p: string): boolean { return p === \"transition\" || p === \"transition-duration\" }\nfunction isDisabledMotionValue(v: string): boolean {\n const s = v.toLowerCase()\n return s.includes(\"none\") || ZERO_MS.test(s) || ZERO_S.test(s)\n}\nfunction hasPositiveTime(value: string): boolean {\n const m = value.toLowerCase().match(TIME_VALUE_G)\n if (!m) return false\n for (let i = 0; i < m.length; i++) {\n const token = m[i]; if (!token) continue\n const unit = token.endsWith(\"ms\") ? \"ms\" : \"s\"\n const n = Number(token.slice(0, unit === \"ms\" ? -2 : -1))\n if (!Number.isNaN(n) && n > 0) return true\n }\n return false\n}\nfunction isReducedMotionRule(rule: { containingMedia: { params: string } | null }): boolean {\n const m = rule.containingMedia\n if (!m) return false\n const p = m.params.toLowerCase()\n return p.includes(\"prefers-reduced-motion\") && p.includes(\"reduce\")\n}\nfunction resolveFullSelectors(rule: RuleEntity): string[] {\n const chain: RuleEntity[] = [rule]\n let cur: RuleEntity[\"parent\"] = rule.parent\n while (cur !== null) { if (cur.kind === \"rule\") { chain.push(cur) }; cur = cur.parent }\n const outermost = chain[chain.length - 1]\n if (!outermost) return []\n let resolved: string[] = splitSelectors(outermost.selectorText)\n for (let i = chain.length - 2; i >= 0; i--) {\n const entry = chain[i]; if (!entry) continue\n const childParts = splitSelectors(entry.selectorText)\n const next: string[] = []\n for (let p = 0; p < resolved.length; p++) {\n const parent = resolved[p]; if (!parent) continue\n for (let c = 0; c < childParts.length; c++) {\n const child = childParts[c]; if (!child) continue\n next.push(child.includes(\"&\") ? child.replace(AMPERSAND_G, parent) : parent + \" \" + child)\n }\n }\n resolved = next\n }\n return resolved\n}\nfunction splitSelectors(text: string): string[] {\n if (text.indexOf(\",\") === -1) { const t = text.trim(); return t ? [t] : [] }\n const out: string[] = []; let start = 0; let parenD = 0; let brackD = 0\n for (let i = 0; i < text.length; i++) {\n const ch = text.charCodeAt(i)\n if (ch === 0x28) parenD++; else if (ch === 0x29) parenD--\n else if (ch === 0x5b) brackD++; else if (ch === 0x5d) brackD--\n else if (ch === 0x2c && parenD === 0 && brackD === 0) { const t = text.substring(start, i).trim(); if (t) out.push(t); start = i + 1 }\n }\n const t = text.substring(start).trim(); if (t) out.push(t)\n return out\n}\nfunction normalizeSelector(s: string): string { return s.replace(WHITESPACE_G, \" \").trim() }\n\nexport const cssRequireReducedMotionOverride = defineAnalysisRule({\n id: \"css-require-reduced-motion-override\",\n severity: \"warn\",\n messages,\n meta: { description: \"Require reduced-motion override for animated selectors.\", fixable: false, category: \"css-a11y\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const reduced = new Set<string>()\n const motionDecls: { d: import(\"../../../css/entities/declaration\").DeclarationEntity; tree: import(\"../../core/css-syntax-tree\").CSSSyntaxTree }[] = []\n\n for (const [, tree] of compilation.cssTrees) {\n for (const prop of [\"animation\", \"animation-duration\", \"transition\", \"transition-duration\"]) {\n const decls = tree.declarationsByProperty.get(prop)\n if (!decls) continue\n for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) motionDecls.push({ d, tree }) }\n }\n }\n\n for (let i = 0; i < motionDecls.length; i++) {\n const { d } = motionDecls[i]!\n const r = d.rule; if (!r || !isReducedMotionRule(r)) continue\n const p = d.property.toLowerCase()\n const group = isAnimationDecl(p) ? \"animation\" : isTransitionDecl(p) ? \"transition\" : null\n if (!group) continue\n const resolved = resolveFullSelectors(r)\n for (let j = 0; j < resolved.length; j++) { const sel = resolved[j]; if (sel) reduced.add(`${normalizeSelector(sel)}|${group}`) }\n }\n\n for (let i = 0; i < motionDecls.length; i++) {\n const { d } = motionDecls[i]!\n const r = d.rule; if (!r || isReducedMotionRule(r)) continue\n const p = d.property.toLowerCase()\n const group = isAnimationDecl(p) ? \"animation\" : isTransitionDecl(p) ? \"transition\" : null\n if (!group || isDisabledMotionValue(d.value) || !hasPositiveTime(d.value)) continue\n const resolved = resolveFullSelectors(r)\n let covered = false\n for (let j = 0; j < resolved.length; j++) { const sel = resolved[j]; if (sel && reduced.has(`${normalizeSelector(sel)}|${group}`)) { covered = true; break } }\n if (covered) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssRequireReducedMotionOverride.id, \"missingReducedMotion\",\n resolveMessage(messages.missingReducedMotion, { selector: r.selectorText }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst FOCUS_NOT_VISIBLE_G = /:focus(?!-visible)/g\nconst messages = { missingFocusVisible: \"Focus outline removed without matching `:focus-visible` replacement.\" } as const\n\nfunction removesOutline(value: string): boolean { const v = value.trim().toLowerCase(); return v === \"none\" || v === \"0\" }\nfunction hasVisibleFocusIndicator(declarations: readonly { property: string; value: string }[]): boolean {\n for (let i = 0; i < declarations.length; i++) {\n const d = declarations[i]; if (!d) continue; const p = d.property.toLowerCase(); const v = d.value.trim().toLowerCase()\n if (p === \"outline\" && v !== \"none\" && v !== \"0\") return true\n if (p === \"box-shadow\" && v !== \"none\") return true\n if (p === \"border\" && v !== \"none\" && v !== \"0\") return true\n }\n return false\n}\n\nexport const cssNoOutlineNoneWithoutFocusVisible = defineAnalysisRule({\n id: \"css-no-outline-none-without-focus-visible\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow removing outline without explicit focus-visible replacement.\", fixable: false, category: \"css-a11y\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const focusVisibleSelectors = tree.selectorsByPseudoClass.get(\"focus-visible\")\n const focusVisibleWithIndicator = new Set<string>()\n if (focusVisibleSelectors) {\n for (let i = 0; i < focusVisibleSelectors.length; i++) { const sel = focusVisibleSelectors[i]; if (sel && hasVisibleFocusIndicator(sel.rule.declarations)) focusVisibleWithIndicator.add(sel.raw) }\n }\n const focusSelectors = tree.selectorsByPseudoClass.get(\"focus\")\n if (!focusSelectors) return\n const checked = new Set<number>()\n for (let i = 0; i < focusSelectors.length; i++) {\n const s = focusSelectors[i]; if (!s) continue; const rule = s.rule; if (checked.has(rule.id)) continue; checked.add(rule.id)\n const outlineDecls = rule.declarationIndex.get(\"outline\"); if (!outlineDecls) continue\n let stripsOutline = false\n for (let j = 0; j < outlineDecls.length; j++) { const od = outlineDecls[j]; if (od && removesOutline(od.value)) stripsOutline = true }\n if (!stripsOutline) continue\n for (let j = 0; j < rule.selectors.length; j++) {\n const sel = rule.selectors[j]; if (!sel || !sel.raw.includes(\":focus\") || sel.raw.includes(\":focus-visible\")) continue\n const expected = sel.raw.replace(FOCUS_NOT_VISIBLE_G, \":focus-visible\")\n if (focusVisibleWithIndicator.has(expected)) continue\n emit(createCSSDiagnostic(\n rule.file.path, rule.startLine, rule.startColumn,\n cssNoOutlineNoneWithoutFocusVisible.id, \"missingFocusVisible\",\n resolveMessage(messages.missingFocusVisible), \"error\",\n ))\n }\n }\n })\n },\n})\n","/**\n * Color parsing and WCAG contrast ratio utilities.\n *\n * Converts CSS color values to sRGB, computes relative luminance per\n * WCAG 2.0 §1.4.3, and calculates contrast ratios.\n */\n\n/** sRGB color as 0-1 channel values with optional alpha. */\nexport interface SRGB {\n readonly r: number\n readonly g: number\n readonly b: number\n readonly a: number\n}\n\nconst HEX3 = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i\nconst HEX4 = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i\nconst HEX6 = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i\nconst HEX8 = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i\nconst RGB_FUNC = /^rgba?\\(\\s*([0-9.]+%?)\\s*[,\\s]\\s*([0-9.]+%?)\\s*[,\\s]\\s*([0-9.]+%?)(?:\\s*[,/]\\s*([0-9.]+%?))?\\s*\\)/i\nconst HSL_FUNC = /^hsla?\\(\\s*([0-9.]+)\\s*[,\\s]\\s*([0-9.]+)%\\s*[,\\s]\\s*([0-9.]+)%(?:\\s*[,/]\\s*([0-9.]+%?))?\\s*\\)/i\n\n/**\n * CSS named colors → pre-computed sRGB.\n * The parser (value.ts NAMED_COLORS) already recognises these as colors\n * and pushes raw name strings into parsedValue.colors. This map converts\n * those strings to sRGB so contrast computation works on named colors.\n */\nconst NAMED: Readonly<Record<string, SRGB>> = /* @__PURE__ */ buildNamedColors()\n\nfunction buildNamedColors(): Record<string, SRGB> {\n const hex: Record<string, string> = {\n aliceblue: \"f0f8ff\", antiquewhite: \"faebd7\", aqua: \"00ffff\", aquamarine: \"7fffd4\",\n azure: \"f0ffff\", beige: \"f5f5dc\", bisque: \"ffe4c4\", black: \"000000\",\n blanchedalmond: \"ffebcd\", blue: \"0000ff\", blueviolet: \"8a2be2\", brown: \"a52a2a\",\n burlywood: \"deb887\", cadetblue: \"5f9ea0\", chartreuse: \"7fff00\", chocolate: \"d2691e\",\n coral: \"ff7f50\", cornflowerblue: \"6495ed\", cornsilk: \"fff8dc\", crimson: \"dc143c\",\n cyan: \"00ffff\", darkblue: \"00008b\", darkcyan: \"008b8b\", darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\", darkgreen: \"006400\", darkgrey: \"a9a9a9\", darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\", darkolivegreen: \"556b2f\", darkorange: \"ff8c00\",\n darkorchid: \"9932cc\", darkred: \"8b0000\", darksalmon: \"e9967a\", darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\", darkslategray: \"2f4f4f\", darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\", darkviolet: \"9400d3\", deeppink: \"ff1493\",\n deepskyblue: \"00bfff\", dimgray: \"696969\", dimgrey: \"696969\", dodgerblue: \"1e90ff\",\n firebrick: \"b22222\", floralwhite: \"fffaf0\", forestgreen: \"228b22\", fuchsia: \"ff00ff\",\n gainsboro: \"dcdcdc\", ghostwhite: \"f8f8ff\", gold: \"ffd700\", goldenrod: \"daa520\",\n gray: \"808080\", green: \"008000\", greenyellow: \"adff2f\", grey: \"808080\",\n honeydew: \"f0fff0\", hotpink: \"ff69b4\", indianred: \"cd5c5c\", indigo: \"4b0082\",\n ivory: \"fffff0\", khaki: \"f0e68c\", lavender: \"e6e6fa\", lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\", lemonchiffon: \"fffacd\", lightblue: \"add8e6\", lightcoral: \"f08080\",\n lightcyan: \"e0ffff\", lightgoldenrodyellow: \"fafad2\", lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\", lightgrey: \"d3d3d3\", lightpink: \"ffb6c1\", lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\", lightskyblue: \"87cefa\", lightslategray: \"778899\",\n lightslategrey: \"778899\", lightsteelblue: \"b0c4de\", lightyellow: \"ffffe0\",\n lime: \"00ff00\", limegreen: \"32cd32\", linen: \"faf0e6\", magenta: \"ff00ff\",\n maroon: \"800000\", mediumaquamarine: \"66cdaa\", mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\", mediumpurple: \"9370db\", mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\", mediumspringgreen: \"00fa9a\", mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\", midnightblue: \"191970\", mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\", moccasin: \"ffe4b5\", navajowhite: \"ffdead\", navy: \"000080\",\n oldlace: \"fdf5e6\", olive: \"808000\", olivedrab: \"6b8e23\", orange: \"ffa500\",\n orangered: \"ff4500\", orchid: \"da70d6\", palegoldenrod: \"eee8aa\", palegreen: \"98fb98\",\n paleturquoise: \"afeeee\", palevioletred: \"db7093\", papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\", peru: \"cd853f\", pink: \"ffc0cb\", plum: \"dda0dd\",\n powderblue: \"b0e0e6\", purple: \"800080\", rebeccapurple: \"663399\", red: \"ff0000\",\n rosybrown: \"bc8f8f\", royalblue: \"4169e1\", saddlebrown: \"8b4513\", salmon: \"fa8072\",\n sandybrown: \"f4a460\", seagreen: \"2e8b57\", seashell: \"fff5ee\", sienna: \"a0522d\",\n silver: \"c0c0c0\", skyblue: \"87ceeb\", slateblue: \"6a5acd\", slategray: \"708090\",\n slategrey: \"708090\", snow: \"fffafa\", springgreen: \"00ff7f\", steelblue: \"4682b4\",\n tan: \"d2b48c\", teal: \"008080\", thistle: \"d8bfd8\", tomato: \"ff6347\",\n turquoise: \"40e0d0\", violet: \"ee82ee\", wheat: \"f5deb3\", white: \"ffffff\",\n whitesmoke: \"f5f5f5\", yellow: \"ffff00\", yellowgreen: \"9acd32\",\n }\n const out: Record<string, SRGB> = {}\n for (const name in hex) {\n const h = hex[name]\n if (!h) continue\n out[name] = {\n r: parseInt(h.slice(0, 2), 16) / 255,\n g: parseInt(h.slice(2, 4), 16) / 255,\n b: parseInt(h.slice(4, 6), 16) / 255,\n a: 1,\n }\n }\n return out\n}\n\nfunction parseHex(h: string): number {\n return parseInt(h, 16) / 255\n}\n\nfunction parseHexDigit(h: string): number {\n return parseInt(h + h, 16) / 255\n}\n\n/** Parse a CSS color string to sRGB. Returns null for dynamic/unsupported values. */\nexport function parseColor(raw: string): SRGB | null {\n const trimmed = raw.trim().toLowerCase()\n if (trimmed.length === 0) return null\n if (trimmed === \"transparent\" || trimmed === \"currentcolor\") return null\n if (trimmed === \"inherit\" || trimmed === \"initial\" || trimmed === \"unset\" || trimmed === \"revert\") return null\n\n const named = NAMED[trimmed]\n if (named) return named\n\n let m = HEX6.exec(trimmed)\n if (m) {\n const c1 = m[1], c2 = m[2], c3 = m[3]\n if (!c1 || !c2 || !c3) return null\n return { r: parseHex(c1), g: parseHex(c2), b: parseHex(c3), a: 1 }\n }\n\n m = HEX3.exec(trimmed)\n if (m) {\n const c1 = m[1], c2 = m[2], c3 = m[3]\n if (!c1 || !c2 || !c3) return null\n return { r: parseHexDigit(c1), g: parseHexDigit(c2), b: parseHexDigit(c3), a: 1 }\n }\n\n m = HEX8.exec(trimmed)\n if (m) {\n const c1 = m[1], c2 = m[2], c3 = m[3], c4 = m[4]\n if (!c1 || !c2 || !c3 || !c4) return null\n return { r: parseHex(c1), g: parseHex(c2), b: parseHex(c3), a: parseHex(c4) }\n }\n\n m = HEX4.exec(trimmed)\n if (m) {\n const c1 = m[1], c2 = m[2], c3 = m[3], c4 = m[4]\n if (!c1 || !c2 || !c3 || !c4) return null\n return { r: parseHexDigit(c1), g: parseHexDigit(c2), b: parseHexDigit(c3), a: parseHexDigit(c4) }\n }\n\n m = RGB_FUNC.exec(trimmed)\n if (m) {\n const rc = m[1], gc = m[2], bc = m[3]\n if (!rc || !gc || !bc) return null\n const r = rc.endsWith(\"%\") ? parseFloat(rc) / 100 : parseFloat(rc) / 255\n const g = gc.endsWith(\"%\") ? parseFloat(gc) / 100 : parseFloat(gc) / 255\n const b = bc.endsWith(\"%\") ? parseFloat(bc) / 100 : parseFloat(bc) / 255\n const a = m[4] ? (m[4].endsWith(\"%\") ? parseFloat(m[4]) / 100 : parseFloat(m[4])) : 1\n return { r, g, b, a }\n }\n\n m = HSL_FUNC.exec(trimmed)\n if (m) {\n const hc = m[1], sc = m[2], lc = m[3]\n if (!hc || !sc || !lc) return null\n const h = (parseFloat(hc) % 360 + 360) % 360\n const s = parseFloat(sc) / 100\n const l = parseFloat(lc) / 100\n const a = m[4] ? (m[4].endsWith(\"%\") ? parseFloat(m[4]) / 100 : parseFloat(m[4])) : 1\n const rgb = hslToRgb(h, s, l)\n return { r: rgb.r, g: rgb.g, b: rgb.b, a }\n }\n\n return null\n}\n\n/** Internal RGB result without alpha (alpha is added by parseColor). */\ninterface RGB3 { readonly r: number; readonly g: number; readonly b: number }\n\nfunction hslToRgb(h: number, s: number, l: number): RGB3 {\n if (s === 0) return { r: l, g: l, b: l }\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s\n const p = 2 * l - q\n return {\n r: hueToChannel(p, q, h + 120),\n g: hueToChannel(p, q, h),\n b: hueToChannel(p, q, h - 120),\n }\n}\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n const n = ((t % 360) + 360) % 360\n if (n < 60) return p + (q - p) * n / 60\n if (n < 180) return q\n if (n < 240) return p + (q - p) * (240 - n) / 60\n return p\n}\n\n/**\n * Alpha-composite a semi-transparent color over an opaque backdrop.\n * Uses the standard \"source over\" formula: out = src × α + dst × (1 − α).\n * Returns a fully opaque SRGB.\n */\nexport function compositeOver(fg: SRGB, bg: SRGB): SRGB {\n const a = fg.a\n if (a >= 1) return fg\n return {\n r: fg.r * a + bg.r * (1 - a),\n g: fg.g * a + bg.g * (1 - a),\n b: fg.b * a + bg.b * (1 - a),\n a: 1,\n }\n}\n\n/**\n * WCAG 2.0 relative luminance.\n * https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\nexport function relativeLuminance(c: SRGB): number {\n const rl = linearize(c.r)\n const gl = linearize(c.g)\n const bl = linearize(c.b)\n return 0.2126 * rl + 0.7152 * gl + 0.0722 * bl\n}\n\nfunction linearize(channel: number): number {\n if (channel <= 0.03928) return channel / 12.92\n return Math.pow((channel + 0.055) / 1.055, 2.4)\n}\n\n/**\n * WCAG 2.0 contrast ratio between two sRGB colors.\n * Returns a value between 1 and 21.\n *\n * This is a pure luminance-based computation. Callers are responsible\n * for alpha compositing before invoking this function.\n */\nexport function contrastRatio(a: SRGB, b: SRGB): number {\n const la = relativeLuminance(a)\n const lb = relativeLuminance(b)\n const lighter = Math.max(la, lb)\n const darker = Math.min(la, lb)\n return (lighter + 0.05) / (darker + 0.05)\n}\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getActivePolicy, getActivePolicyName } from \"../../../css/policy\"\nimport { parseColor, contrastRatio, compositeOver, type SRGB } from \"../../../css/parser/color\"\nimport { parsePxValue } from \"../../../css/parser/value-util\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst WHITE: SRGB = { r: 1, g: 1, b: 1, a: 1 }\nconst BLACK: SRGB = { r: 0, g: 0, b: 0, a: 1 }\nconst messages = { insufficientContrast: \"Contrast ratio `{{ratio}}:1` between `{{fg}}` and `{{bg}}` is below the minimum `{{min}}:1` for `{{textSize}}` text in policy `{{policy}}`.\" } as const\n\nfunction computeComposited(fg: SRGB, bg: SRGB, backdrop: SRGB): number {\n const resolvedBg = bg.a < 1 ? compositeOver(bg, backdrop) : bg\n const resolvedFg = fg.a < 1 ? compositeOver(fg, resolvedBg) : fg\n return contrastRatio(resolvedFg, resolvedBg)\n}\n\nexport const cssPolicyContrast = defineAnalysisRule({\n id: \"css-policy-contrast\",\n severity: \"warn\",\n messages,\n meta: { description: \"Enforce minimum contrast ratio per accessibility policy.\", fixable: false, category: \"css-a11y\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const policy = getActivePolicy(); if (policy === null) return\n const name = getActivePolicyName() ?? \"\"\n const colorDecls = tree.declarationsByProperty.get(\"color\"); if (!colorDecls) return\n const candidates = new Set<number>()\n for (let i = 0; i < colorDecls.length; i++) { const cd = colorDecls[i]; if (cd?.rule) candidates.add(cd.rule.id) }\n for (let i = 0; i < tree.rules.length; i++) {\n const rule = tree.rules[i]; if (!rule || !candidates.has(rule.id)) continue\n const fgDecls = rule.declarationIndex.get(\"color\")\n const bgDecls = rule.declarationIndex.get(\"background-color\") ?? rule.declarationIndex.get(\"background\")\n if (!fgDecls || !bgDecls) continue\n const fgDecl = fgDecls[fgDecls.length - 1]; const bgDecl = bgDecls[bgDecls.length - 1]; if (!fgDecl || !bgDecl) continue\n const fgColor = parseColor(fgDecl.value); if (!fgColor) continue\n const bgRaw = bgDecl.property.toLowerCase() === \"background\" ? (bgDecl.value.includes(\"url(\") || bgDecl.value.includes(\"gradient\") ? null : bgDecl.value) : bgDecl.value\n if (!bgRaw) continue; const bgColor = parseColor(bgRaw); if (!bgColor) continue\n const large = (rule.declarationIndex.get(\"font-size\") ?? []).some(d => { const px = parsePxValue(d.value); return px !== null && px >= policy.largeTextThreshold })\n const min = large ? policy.minContrastLargeText : policy.minContrastNormalText\n const needsDual = fgColor.a < 1 || bgColor.a < 1\n const ratio = needsDual ? Math.max(computeComposited(fgColor, bgColor, WHITE), computeComposited(fgColor, bgColor, BLACK)) : contrastRatio(fgColor, bgColor)\n const rounded = Math.round(ratio * 100) / 100; if (rounded >= min) continue\n emit(createCSSDiagnostic(\n fgDecl.file.path, fgDecl.startLine, fgDecl.startColumn,\n cssPolicyContrast.id, \"insufficientContrast\",\n resolveMessage(messages.insufficientContrast, { ratio: String(rounded), fg: fgDecl.value.trim(), bg: bgDecl.value.trim(), min: String(min), textSize: large ? \"large\" : \"normal\", policy: name }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getActivePolicy, getActivePolicyName } from \"../../../css/policy\"\nimport type { PolicyThresholds } from \"../../../css/policy\"\nimport { parsePxValue, parseUnitlessValue } from \"../../../css/parser/value-util\"\nimport type { DeclarationEntity } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n fontTooSmall: \"Font size `{{value}}` ({{resolved}}px) is below the `{{context}}` minimum of `{{min}}px` for policy `{{policy}}`.\",\n lineHeightTooSmall: \"Line height `{{value}}` is below the `{{context}}` minimum of `{{min}}` for policy `{{policy}}`.\",\n} as const\n\nconst LINE_HEIGHT_EXEMPT_KINDS = new Set([\"inline-formatting\", \"pseudo-element\"])\n\nfunction resolveContext(d: DeclarationEntity, p: PolicyThresholds): { context: string; min: number } {\n const kinds = d.rule?.elementKinds\n if (kinds && kinds.size > 0) {\n if (kinds.has(\"heading\")) return { context: \"heading\", min: p.minHeadingFontSize }\n if (kinds.has(\"button\")) return { context: \"button\", min: p.minButtonFontSize }\n if (kinds.has(\"paragraph\")) return { context: \"body\", min: p.minBodyFontSize }\n if (kinds.has(\"caption\")) return { context: \"caption\", min: p.minCaptionFontSize }\n if (kinds.has(\"input\")) return { context: \"input\", min: p.minButtonFontSize }\n if (kinds.has(\"inline-formatting\")) return { context: \"caption\", min: p.minCaptionFontSize }\n }\n return { context: \"unclassified\", min: p.minCaptionFontSize }\n}\n\nfunction resolveLineHeightContext(d: DeclarationEntity, p: PolicyThresholds): { context: string; min: number } {\n const kinds = d.rule?.elementKinds\n if (kinds && kinds.size > 0) {\n if (kinds.has(\"heading\")) return { context: \"heading\", min: p.minHeadingLineHeight }\n if (kinds.has(\"paragraph\")) return { context: \"body\", min: p.minLineHeight }\n }\n return { context: \"body\", min: p.minLineHeight }\n}\n\nexport const cssPolicyTypography = defineAnalysisRule({\n id: \"css-policy-typography\",\n severity: \"warn\",\n messages,\n meta: { description: \"Enforce minimum font sizes and line heights per accessibility policy.\", fixable: false, category: \"css-a11y\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const policy = getActivePolicy(); if (policy === null) return\n const name = getActivePolicyName() ?? \"\"\n const fontDecls = tree.declarationsByProperty.get(\"font-size\")\n if (fontDecls) {\n for (let i = 0; i < fontDecls.length; i++) {\n const d = fontDecls[i]; if (!d) continue; const px = parsePxValue(d.value); if (px === null) continue\n const { context, min } = resolveContext(d, policy); if (px >= min) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicyTypography.id, \"fontTooSmall\",\n resolveMessage(messages.fontTooSmall, { value: d.value.trim(), resolved: String(Math.round(px * 100) / 100), context, min: String(min), policy: name }), \"warn\",\n ))\n }\n }\n const lhDecls = tree.declarationsByProperty.get(\"line-height\")\n if (lhDecls) {\n for (let i = 0; i < lhDecls.length; i++) {\n const d = lhDecls[i]; if (!d) continue\n const kinds = d.rule?.elementKinds; if (kinds) { let exempt = false; for (const k of kinds) { if (LINE_HEIGHT_EXEMPT_KINDS.has(k)) { exempt = true; break } }; if (exempt) continue }\n const lh = parseUnitlessValue(d.value); if (lh === null) continue\n const { context, min } = resolveLineHeightContext(d, policy); if (lh >= min) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicyTypography.id, \"lineHeightTooSmall\",\n resolveMessage(messages.lineHeightTooSmall, { value: d.value.trim(), context, min: String(min), policy: name }), \"warn\",\n ))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { getActivePolicy, getActivePolicyName } from \"../../../css/policy\"\nimport { parsePxValue, parseEmValue } from \"../../../css/parser/value-util\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n letterSpacingTooSmall: \"Letter spacing `{{value}}` ({{resolved}}em) is below the minimum `{{min}}em` for policy `{{policy}}`.\",\n wordSpacingTooSmall: \"Word spacing `{{value}}` ({{resolved}}em) is below the minimum `{{min}}em` for policy `{{policy}}`.\",\n paragraphSpacingTooSmall: \"Paragraph spacing `{{value}}` ({{resolved}}em) is below the minimum `{{min}}em` ({{minMultiplier}}× font-size) for policy `{{policy}}`.\",\n touchTargetTooSmall: \"`{{property}}: {{value}}` ({{resolved}}px) is below the minimum `{{min}}px` for interactive elements in policy `{{policy}}`.\",\n} as const\n\nconst INTERACTIVE_SELECTORS = /button|input|select|textarea|\\[role=/i\n\nexport const cssPolicySpacing = defineAnalysisRule({\n id: \"css-policy-spacing\",\n severity: \"warn\",\n messages,\n meta: { description: \"Enforce minimum spacing per accessibility policy.\", fixable: false, category: \"css-a11y\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const policy = getActivePolicy(); if (policy === null) return\n const name = getActivePolicyName() ?? \"\"\n const lsDecls = tree.declarationsByProperty.get(\"letter-spacing\")\n if (lsDecls) {\n for (let i = 0; i < lsDecls.length; i++) {\n const d = lsDecls[i]; if (!d) continue; const em = parseEmValue(d.value); if (em === null || em >= policy.minLetterSpacing) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicySpacing.id, \"letterSpacingTooSmall\",\n resolveMessage(messages.letterSpacingTooSmall, { value: d.value.trim(), resolved: String(em), min: String(policy.minLetterSpacing), policy: name }), \"warn\",\n))\n }\n }\n const wsDecls = tree.declarationsByProperty.get(\"word-spacing\")\n if (wsDecls) {\n for (let i = 0; i < wsDecls.length; i++) {\n const d = wsDecls[i]; if (!d) continue; const em = parseEmValue(d.value); if (em === null || em >= policy.minWordSpacing) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicySpacing.id, \"wordSpacingTooSmall\",\n resolveMessage(messages.wordSpacingTooSmall, { value: d.value.trim(), resolved: String(em), min: String(policy.minWordSpacing), policy: name }), \"warn\",\n))\n }\n }\n for (const prop of [\"height\", \"min-height\"]) {\n const decls = tree.declarationsByProperty.get(prop)\n if (!decls) continue\n for (let i = 0; i < decls.length; i++) {\n const d = decls[i]; if (!d) continue; const rule = d.rule; if (!rule) continue\n if (!INTERACTIVE_SELECTORS.test(rule.selectorText)) continue\n const px = parsePxValue(d.value); if (px === null || px >= policy.minButtonHeight) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicySpacing.id, \"touchTargetTooSmall\",\n resolveMessage(messages.touchTargetTooSmall, { property: prop, value: d.value.trim(), resolved: String(Math.round(px * 100) / 100), min: String(policy.minButtonHeight), policy: name }), \"warn\",\n))\n }\n }\n for (const prop of [\"margin-bottom\", \"margin-block-end\"]) {\n const decls = tree.declarationsByProperty.get(prop)\n if (!decls) continue\n for (let i = 0; i < decls.length; i++) {\n const d = decls[i]; if (!d) continue; const rule = d.rule; if (!rule) continue\n if (!rule.elementKinds.has(\"paragraph\")) continue\n const em = parseEmValue(d.value); if (em === null || em >= policy.minParagraphSpacing) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssPolicySpacing.id, \"paragraphSpacingTooSmall\",\n resolveMessage(messages.paragraphSpacingTooSmall, { value: d.value.trim(), resolved: String(em), min: String(policy.minParagraphSpacing), minMultiplier: String(policy.minParagraphSpacing), policy: name }), \"warn\",\n))\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { findTransitionProperty, findPropertyInList } from \"../../../css/parser/value-util\"\nimport { isLayoutAnimationExempt } from \"../../../css/rules/animation/layout-animation-exempt\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst layoutProperties = new Set([\n \"top\", \"left\", \"right\", \"bottom\", \"width\", \"height\", \"min-width\", \"max-width\", \"min-height\", \"max-height\",\n \"margin\", \"margin-top\", \"margin-right\", \"margin-bottom\", \"margin-left\",\n \"padding\", \"padding-top\", \"padding-right\", \"padding-bottom\", \"padding-left\",\n \"border-width\", \"border-top-width\", \"border-right-width\", \"border-bottom-width\", \"border-left-width\",\n \"font-size\", \"line-height\", \"letter-spacing\", \"word-spacing\",\n \"grid-template-columns\", \"grid-template-rows\", \"grid-column\", \"grid-row\", \"flex-basis\",\n])\n\nconst messages = { avoidLayoutAnimation: \"Avoid animating layout property `{{property}}`. Prefer transform or opacity to reduce layout thrashing.\" } as const\n\nexport const cssNoLayoutPropertyAnimation = defineAnalysisRule({\n id: \"no-layout-property-animation\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow animating layout-affecting properties.\", fixable: false, category: \"css-animation\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const tDecls = tree.declarationsByProperty.get(\"transition\") ?? []\n const tpDecls = tree.declarationsByProperty.get(\"transition-property\") ?? []\n for (let i = 0; i < tDecls.length; i++) {\n const d = tDecls[i]; if (!d) continue\n const lp = findTransitionProperty(d.value, layoutProperties); if (!lp || isLayoutAnimationExempt(d, lp)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoLayoutPropertyAnimation.id, \"avoidLayoutAnimation\",\n resolveMessage(messages.avoidLayoutAnimation, { property: lp }), \"warn\",\n))\n }\n for (let i = 0; i < tpDecls.length; i++) {\n const d = tpDecls[i]; if (!d) continue\n const lp = findPropertyInList(d.value, layoutProperties); if (!lp || isLayoutAnimationExempt(d, lp)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoLayoutPropertyAnimation.id, \"avoidLayoutAnimation\",\n resolveMessage(messages.avoidLayoutAnimation, { property: lp }), \"warn\",\n))\n }\n // Keyframe declarations\n for (let i = 0; i < tree.declarations.length; i++) {\n const d = tree.declarations[i]; if (!d) continue; const rule = d.rule; if (!rule) continue\n const parent = rule.parent; if (!parent || parent.kind === \"rule\" || parent.kind !== \"keyframes\") continue\n const property = d.property.toLowerCase(); if (!layoutProperties.has(property)) continue\n emit(createCSSDiagnostic(\n d.file.path, d.startLine, d.startColumn,\n cssNoLayoutPropertyAnimation.id, \"avoidLayoutAnimation\",\n resolveMessage(messages.avoidLayoutAnimation, { property }), \"warn\",\n))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = { missingLayer: \"Rule `{{selector}}` is not inside any @layer block while this file uses @layer. Place component rules inside an explicit layer.\" } as const\n\nexport const cssLayerRequirementForComponentRules = defineAnalysisRule({\n id: \"layer-requirement-for-component-rules\",\n severity: \"warn\",\n messages,\n meta: { description: \"Require style rules to be inside @layer when the file defines layers.\", fixable: false, category: \"css-structure\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const layers = tree.atRulesByKind.get(\"layer\")\n if (!layers || layers.length === 0) return\n for (let i = 0; i < tree.rules.length; i++) {\n const rule = tree.rules[i]; if (!rule || rule.containingLayer) continue\n emit(createCSSDiagnostic(\n rule.file.path, rule.startLine, rule.startColumn,\n cssLayerRequirementForComponentRules.id, \"missingLayer\",\n resolveMessage(messages.missingLayer, { selector: rule.selectorText }), \"warn\",\n ))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = { variableCycle: \"Custom property cycle detected involving `{{name}}`.\" } as const\n\nexport const cssNoCustomPropertyCycle = defineAnalysisRule({\n id: \"css-no-custom-property-cycle\",\n severity: \"error\",\n messages,\n meta: { description: \"Disallow cycles in custom property references.\", fixable: false, category: \"css-property\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n // Collect all CSS custom properties across all trees\n type VarEntry = { id: number; name: string; filePath: string; startLine: number; startColumn: number; scopeType: string; scopeCondition: string | null; scopeSelector: string | null; parsedVarRefs: readonly { name: string }[]; variablesByName: ReadonlyMap<string, readonly VarEntry[]> }\n const allVars: VarEntry[] = []\n const allVarsByName = new Map<string, VarEntry[]>()\n\n for (const [, tree] of compilation.cssTrees) {\n for (let i = 0; i < tree.variables.length; i++) {\n const v = tree.variables[i]; if (!v || v.name.startsWith(\"$\")) continue\n const entry: VarEntry = { id: v.id, name: v.name, filePath: v.file.path, startLine: v.declaration.startLine, startColumn: v.declaration.startColumn, scopeType: v.scope.type, scopeCondition: v.scope.condition, scopeSelector: v.scopeSelector?.raw ?? null, parsedVarRefs: v.declaration.parsedVarRefs, variablesByName: allVarsByName }\n allVars.push(entry)\n const existing = allVarsByName.get(v.name); if (existing) existing.push(entry); else allVarsByName.set(v.name, [entry])\n }\n }\n\n if (allVars.length === 0) return\n\n const edges = new Map<number, Set<number>>()\n for (const variable of allVars) {\n const to = edges.get(variable.id) ?? new Set<number>(); edges.set(variable.id, to)\n for (let i = 0; i < variable.parsedVarRefs.length; i++) {\n const ref = variable.parsedVarRefs[i]; if (!ref || !ref.name.startsWith(\"--\")) continue\n const candidates = allVarsByName.get(ref.name); if (!candidates) continue\n for (let j = 0; j < candidates.length; j++) {\n const target = candidates[j]; if (!target) continue\n if (variable.filePath !== target.filePath || variable.scopeType !== target.scopeType || variable.scopeCondition !== target.scopeCondition || variable.scopeSelector !== target.scopeSelector) continue\n to.add(target.id)\n }\n }\n }\n\n const visiting = new Set<number>(); const visited = new Set<number>(); const cyclic = new Set<number>()\n const varById = new Map<number, VarEntry>(); for (const v of allVars) varById.set(v.id, v)\n const dfs = (n: number): void => {\n if (visited.has(n)) return; visited.add(n); visiting.add(n)\n const to = edges.get(n)\n if (to) { for (const next of to) { if (!varById.has(next)) continue; if (visiting.has(next)) { cyclic.add(n); cyclic.add(next); continue }; dfs(next); if (cyclic.has(next)) cyclic.add(n) } }\n visiting.delete(n)\n }\n for (const n of varById.keys()) dfs(n)\n if (cyclic.size === 0) return\n for (const v of allVars) {\n if (!cyclic.has(v.id)) continue\n emit(createCSSDiagnostic(\n v.filePath, v.startLine, v.startColumn,\n cssNoCustomPropertyCycle.id, \"variableCycle\",\n resolveMessage(messages.variableCycle, { name: v.name }), \"error\",\n))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n layerOrderInversion: \"Declaration for `{{property}}` in selector `{{selector}}` appears later but is overridden by an earlier declaration due to @layer precedence.\",\n} as const\n\nexport const cssNoLayerOrderInversion = defineAnalysisRule({\n id: \"no-layer-order-inversion\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow source-order assumptions that are inverted by layer precedence.\", fixable: false, category: \"css-cascade\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n // Build workspace-wide layer order + multi-declaration index\n const layerOrder = new Map<string, number>()\n const multiDeclarationProperties = new Map<string, import(\"../../../css/entities/declaration\").DeclarationEntity[]>()\n const declarationsByProperty = new Map<string, import(\"../../../css/entities/declaration\").DeclarationEntity[]>()\n\n for (const [, tree] of compilation.cssTrees) {\n // Collect layer order from at-rules\n const layers = tree.atRulesByKind.get(\"layer\")\n if (layers) {\n for (let i = 0; i < layers.length; i++) {\n const l = layers[i]\n if (!l) continue\n const name = l.parsedParams.layerName\n if (name && !layerOrder.has(name)) layerOrder.set(name, layerOrder.size)\n }\n }\n // Collect all declarations by property\n for (const [property, decls] of tree.declarationsByProperty) {\n const existing = declarationsByProperty.get(property)\n if (existing) { for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) existing.push(d) } }\n else { const arr: import(\"../../../css/entities/declaration\").DeclarationEntity[] = []; for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) arr.push(d) }; declarationsByProperty.set(property, arr) }\n }\n }\n\n // Sort and find multi-declaration properties\n for (const [property, decls] of declarationsByProperty) {\n decls.sort((a, b) => a.sourceOrder - b.sourceOrder)\n if (decls.length >= 2) multiDeclarationProperties.set(property, decls)\n }\n\n const layerOrderFor = (name: string | null): number => {\n if (name === null) return -1\n return layerOrder.get(name) ?? -1\n }\n\n const seen = new Set<number>()\n\n for (const [property, declarations] of multiDeclarationProperties) {\n for (let i = 1; i < declarations.length; i++) {\n const later = declarations[i]\n if (!later) continue\n const laterRule = later.rule\n if (!laterRule) continue\n\n for (let j = 0; j < i; j++) {\n const earlier = declarations[j]\n if (!earlier) continue\n const earlierRule = earlier.rule\n if (!earlierRule) continue\n if (earlier.file.path !== later.file.path) continue\n if (earlierRule.selectorText !== laterRule.selectorText) continue\n if (hasFlag(earlier._flags, DECL_IS_IMPORTANT) !== hasFlag(later._flags, DECL_IS_IMPORTANT)) continue\n if (earlier.value === later.value) continue\n\n const earlierMedia = earlierRule.containingMedia?.params ?? null\n const laterMedia = laterRule.containingMedia?.params ?? null\n if (earlierMedia !== laterMedia) continue\n\n const earlierLayer = layerOrderFor(earlierRule.containingLayer?.parsedParams.layerName ?? null)\n const laterLayer = layerOrderFor(laterRule.containingLayer?.parsedParams.layerName ?? null)\n if (earlierLayer <= laterLayer) continue\n if (seen.has(later.id)) continue\n\n seen.add(later.id)\n emit(createCSSDiagnostic(\n later.file.path, later.startLine, later.startColumn,\n cssNoLayerOrderInversion.id, \"layerOrderInversion\",\n resolveMessage(messages.layerOrderInversion, { property, selector: laterRule.selectorText }), \"warn\",\n))\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { RuleEntity } from \"../../../css/entities/rule\"\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = {\n redundantOverride: \"Declaration `{{property}}` is always overridden later by the same selector in the same cascade context.\",\n} as const\n\nfunction isSameCascadeContext(a: RuleEntity, b: RuleEntity): boolean {\n return a.file.path === b.file.path && a.parent === b.parent && a.selectorText === b.selectorText\n}\n\nexport const cssNoRedundantOverridePairs = defineAnalysisRule({\n id: \"no-redundant-override-pairs\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow declarations that are deterministically overridden in the same selector context.\", fixable: false, category: \"css-cascade\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCSSSyntaxAction((tree, _symbolTable, emit) => {\n const seen = new Set<number>()\n for (let i = 0; i < tree.declarations.length; i++) {\n const declaration = tree.declarations[i]\n if (!declaration || declaration.overriddenBy.length === 0) continue\n const rule = declaration.rule\n if (!rule) continue\n\n let redundant = false\n for (let j = 0; j < declaration.overriddenBy.length; j++) {\n const override = declaration.overriddenBy[j]\n if (!override) continue\n const overrideRule = override.rule\n if (!overrideRule) continue\n if (override.property !== declaration.property) continue\n if (hasFlag(override._flags, DECL_IS_IMPORTANT) !== hasFlag(declaration._flags, DECL_IS_IMPORTANT)) continue\n if (override.cascadePosition.layerOrder !== declaration.cascadePosition.layerOrder) continue\n if (!isSameCascadeContext(rule, overrideRule)) continue\n redundant = true\n break\n }\n\n if (!redundant || seen.has(declaration.id)) continue\n seen.add(declaration.id)\n emit(createCSSDiagnostic(\n declaration.file.path, declaration.startLine, declaration.startColumn,\n cssNoRedundantOverridePairs.id, \"redundantOverride\",\n resolveMessage(messages.redundantOverride, { property: declaration.property }), \"warn\",\n))\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { AtRuleEntity, DeclarationEntity } from \"../../../css/entities\"\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst PX_VALUE = /^([0-9]+(?:\\.[0-9]+)?)px$/\nconst messages = { mediaOverlapConflict: \"Overlapping media queries set different `{{property}}` values for `{{selector}}` in the same overlap range.\" } as const\n\ninterface WidthRange { readonly min: number; readonly max: number }\n\nfunction parsePx(value: string): number | null { const m = PX_VALUE.exec(value.trim()); return m ? Number(m[1]) : null }\n\nfunction rangeFromMediaCondition(condition: NonNullable<AtRuleEntity[\"parsedParams\"][\"mediaConditions\"]>[number]): WidthRange | null {\n if (condition.isNot || condition.type !== \"all\") return null\n let min = -Infinity; let max = Infinity; let hasWidth = false\n for (let i = 0; i < condition.features.length; i++) {\n const f = condition.features[i]; if (!f || f.name !== \"width\" || !f.value || !f.operator) return null\n const v = parsePx(f.value); if (v === null) return null; hasWidth = true\n if (f.operator === \"min\" && v > min) min = v\n else if (f.operator === \"max\" && v < max) max = v\n else if (f.operator === \"exact\") { min = v; max = v }\n else return null\n }\n return hasWidth && min <= max ? { min, max } : null\n}\n\nfunction mediaRanges(media: AtRuleEntity): readonly WidthRange[] | null {\n if (media.params.includes(\">\") || media.params.includes(\"<\")) return null\n const conditions = media.parsedParams.mediaConditions\n if (conditions && conditions.length > 0) {\n const ranges: WidthRange[] = []\n for (let i = 0; i < conditions.length; i++) { const c = conditions[i]; if (!c) continue; const r = rangeFromMediaCondition(c); if (!r) return null; ranges.push(r) }\n if (ranges.length > 0) return ranges\n }\n return null\n}\n\nfunction declarationRanges(declaration: DeclarationEntity): readonly WidthRange[] | null {\n const rule = declaration.rule; if (!rule) return null\n const stack = rule.containingMediaStack; if (stack.length === 0) return null\n let effective: WidthRange[] = [{ min: -Infinity, max: Infinity }]\n for (let i = 0; i < stack.length; i++) {\n const media = stack[i]; if (!media) continue; const ranges = mediaRanges(media); if (!ranges) return null\n const next: WidthRange[] = []\n for (let a = 0; a < effective.length; a++) { const ea = effective[a]; if (!ea) continue; for (let b = 0; b < ranges.length; b++) { const rb = ranges[b]; if (!rb) continue; const min = ea.min > rb.min ? ea.min : rb.min; const max = ea.max < rb.max ? ea.max : rb.max; if (min <= max) next.push({ min, max }) } }\n if (next.length === 0) return []; effective = next\n }\n return effective\n}\n\nfunction isPartialOverlap(a: WidthRange, b: WidthRange): boolean {\n if (a.min > b.max || b.min > a.max) return false\n if (a.min <= b.min && a.max >= b.max) return false\n if (b.min <= a.min && b.max >= a.max) return false\n return true\n}\n\nexport const cssMediaQueryOverlapConflict = defineAnalysisRule({\n id: \"media-query-overlap-conflict\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow conflicting declarations in partially overlapping media queries.\", fixable: false, category: \"css-cascade\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const declarationsByProperty = new Map<string, DeclarationEntity[]>()\n for (const [, tree] of compilation.cssTrees) {\n for (const [property, decls] of tree.declarationsByProperty) {\n const existing = declarationsByProperty.get(property)\n if (existing) { for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) existing.push(d) } }\n else { const arr: DeclarationEntity[] = []; for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) arr.push(d) }; declarationsByProperty.set(property, arr) }\n }\n }\n for (const [, decls] of declarationsByProperty) decls.sort((a, b) => a.sourceOrder - b.sourceOrder)\n\n const seen = new Set<number>()\n for (const [property, declarations] of declarationsByProperty) {\n if (declarations.length < 2) continue\n for (let i = 0; i < declarations.length; i++) {\n const a = declarations[i]; if (!a) continue; const aRule = a.rule; if (!aRule) continue\n const aRanges = declarationRanges(a); if (!aRanges || aRanges.length === 0) continue\n for (let j = i + 1; j < declarations.length; j++) {\n const b = declarations[j]; if (!b) continue; const bRule = b.rule; if (!bRule) continue\n if (a.file.path !== b.file.path || aRule.selectorText !== bRule.selectorText || a.value === b.value) continue\n if (hasFlag(a._flags, DECL_IS_IMPORTANT) !== hasFlag(b._flags, DECL_IS_IMPORTANT)) continue\n if (a.cascadePosition.layerOrder !== b.cascadePosition.layerOrder) continue\n const bRanges = declarationRanges(b); if (!bRanges || bRanges.length === 0) continue\n let hasOverlap = false\n for (let ai = 0; ai < aRanges.length && !hasOverlap; ai++) { const ar = aRanges[ai]; if (!ar) continue; for (let bi = 0; bi < bRanges.length; bi++) { const br = bRanges[bi]; if (br && isPartialOverlap(ar, br)) { hasOverlap = true; break } } }\n if (!hasOverlap) continue\n if (!seen.has(a.id)) { seen.add(a.id); emit(createCSSDiagnostic(\n a.file.path, a.startLine, a.startColumn,\n cssMediaQueryOverlapConflict.id, \"mediaOverlapConflict\",\n resolveMessage(messages.mediaOverlapConflict, { property, selector: aRule.selectorText }), \"warn\",\n)) }\n if (!seen.has(b.id)) { seen.add(b.id); emit(createCSSDiagnostic(\n b.file.path, b.startLine, b.startColumn,\n cssMediaQueryOverlapConflict.id, \"mediaOverlapConflict\",\n resolveMessage(messages.mediaOverlapConflict, { property, selector: bRule.selectorText }), \"warn\",\n)) }\n }\n }\n }\n })\n },\n})\n","import { createCSSDiagnostic, resolveMessage } from \"../../../diagnostic\"\nimport type { SelectorEntity, DeclarationEntity } from \"../../../css/entities\"\nimport { hasFlag, DECL_IS_IMPORTANT } from \"../../../css/entities\"\nimport { defineAnalysisRule, ComputationTier } from \"../rule\"\n\nconst messages = { descendingSpecificity: \"Lower-specificity selector `{{laterSelector}}` appears after `{{earlierSelector}}` for `{{property}}`, creating brittle cascade behavior.\" } as const\n\ninterface Compound { readonly tag: string | null; readonly classes: readonly string[]; readonly ids: readonly string[] }\n\nfunction extractCompounds(selector: SelectorEntity): readonly Compound[] | null {\n const sc = selector.compounds; if (sc.length === 0) return null\n for (let i = 0; i < sc.length; i++) { const c = sc[i]; if (!c) continue; for (let j = 0; j < c.parts.length; j++) { const p = c.parts[j]; if (!p) continue; if (p.type === \"attribute\" || p.type === \"pseudo-class\" || p.type === \"pseudo-element\" || p.type === \"universal\" || p.type === \"nesting\") return null } }\n const compounds: Compound[] = []\n for (let i = 0; i < sc.length; i++) { const c = sc[i]; if (!c) continue; const ids: string[] = []; if (c.idValue !== null) ids.push(c.idValue); if (!c.tagName && c.classes.length === 0 && ids.length === 0) return null; compounds.push({ tag: c.tagName, classes: c.classes, ids }) }\n return compounds\n}\n\nfunction hasToken(list: readonly string[], token: string): boolean { for (let i = 0; i < list.length; i++) { if (list[i] === token) return true } return false }\n\nfunction isCompoundSuperset(superset: Compound, subset: Compound): boolean {\n if (subset.tag && superset.tag !== subset.tag) return false\n for (let i = 0; i < subset.classes.length; i++) { const cls = subset.classes[i]; if (cls && !hasToken(superset.classes, cls)) return false }\n for (let i = 0; i < subset.ids.length; i++) { const id = subset.ids[i]; if (id && !hasToken(superset.ids, id)) return false }\n return true\n}\n\nfunction isExactMatch(a: Compound, b: Compound): boolean {\n if (a.tag !== b.tag || a.classes.length !== b.classes.length || a.ids.length !== b.ids.length) return false\n for (let i = 0; i < a.classes.length; i++) { const c = a.classes[i]; if (c && !hasToken(b.classes, c)) return false }\n for (let i = 0; i < a.ids.length; i++) { const id = a.ids[i]; if (id && !hasToken(b.ids, id)) return false }\n return true\n}\n\nfunction isProvableDescendingPair(earlier: SelectorEntity, later: SelectorEntity): boolean {\n const ec = extractCompounds(earlier); if (!ec) return false\n const lc = extractCompounds(later); if (!lc) return false\n if (ec.length !== lc.length || earlier.combinators.length !== later.combinators.length) return false\n for (let i = 0; i < earlier.combinators.length; i++) { if (earlier.combinators[i] !== later.combinators[i]) return false }\n const last = ec.length - 1\n for (let i = 0; i < last; i++) { const a = ec[i]; const b = lc[i]; if (!a || !b || !isExactMatch(a, b)) return false }\n const et = ec[last]; const lt = lc[last]; if (!et || !lt) return false\n return isCompoundSuperset(et, lt) && !isExactMatch(et, lt)\n}\n\nexport const cssNoDescendingSpecificityConflict = defineAnalysisRule({\n id: \"no-descending-specificity-conflict\",\n severity: \"warn\",\n messages,\n meta: { description: \"Disallow lower-specificity selectors after higher-specificity selectors for the same property.\", fixable: false, category: \"css-cascade\" },\n requirement: { tier: ComputationTier.CSSSyntax },\n register(registry) {\n registry.registerCompilationAction((compilation, _symbolTable, emit) => {\n const declarationsByProperty = new Map<string, DeclarationEntity[]>()\n for (const [, tree] of compilation.cssTrees) {\n for (const [property, decls] of tree.declarationsByProperty) {\n const existing = declarationsByProperty.get(property)\n if (existing) { for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) existing.push(d) } }\n else { const arr: DeclarationEntity[] = []; for (let i = 0; i < decls.length; i++) { const d = decls[i]; if (d) arr.push(d) }; declarationsByProperty.set(property, arr) }\n }\n }\n for (const [, decls] of declarationsByProperty) decls.sort((a, b) => a.sourceOrder - b.sourceOrder)\n\n for (const [property, declarations] of declarationsByProperty) {\n if (declarations.length < 2) continue\n const seen = new Set<number>()\n for (let i = 1; i < declarations.length; i++) {\n const later = declarations[i]; if (!later) continue; const laterRule = later.rule; if (!laterRule) continue\n for (let j = 0; j < i; j++) {\n const earlier = declarations[j]; if (!earlier) continue\n if (earlier.file.path !== later.file.path) continue\n if (hasFlag(earlier._flags, DECL_IS_IMPORTANT) !== hasFlag(later._flags, DECL_IS_IMPORTANT)) continue\n if (earlier.cascadePosition.layerOrder !== later.cascadePosition.layerOrder) continue\n if (later.cascadePosition.specificityScore >= earlier.cascadePosition.specificityScore) continue\n const earlierRule = earlier.rule; if (!earlierRule) continue\n if (earlierRule.selectors.length !== 1 || laterRule.selectors.length !== 1) continue\n const es = earlierRule.selectors[0]; const ls = laterRule.selectors[0]; if (!es || !ls) continue\n if (!isProvableDescendingPair(es, ls) || seen.has(later.id)) continue\n seen.add(later.id)\n emit(createCSSDiagnostic(\n later.file.path, later.startLine, later.startColumn,\n cssNoDescendingSpecificityConflict.id, \"descendingSpecificity\",\n resolveMessage(messages.descendingSpecificity, { laterSelector: ls.raw, earlierSelector: es.raw, property }), \"warn\",\n))\n }\n }\n }\n })\n },\n})\n","import type { AnalysisRule } from \"../rule\"\n\nimport { cssLayoutTransitionLayoutProperty } from \"./css-layout-transition-layout-property\"\nimport { cssLayoutAnimationLayoutProperty } from \"./css-layout-animation-layout-property\"\nimport { cssLayoutFontSwapInstability } from \"./css-layout-font-swap-instability\"\nimport { jsxNoUndefinedCssClass } from \"./jsx-no-undefined-css-class\"\nimport { cssNoUnreferencedComponentClass } from \"./css-no-unreferenced-component-class\"\nimport { jsxClasslistBooleanValues } from \"./jsx-classlist-boolean-values\"\nimport { jsxClasslistNoAccessorReference } from \"./jsx-classlist-no-accessor-reference\"\nimport { jsxClasslistNoConstantLiterals } from \"./jsx-classlist-no-constant-literals\"\nimport { jsxClasslistStaticKeys } from \"./jsx-classlist-static-keys\"\nimport { jsxStyleKebabCaseKeys } from \"./jsx-style-kebab-case-keys\"\nimport { jsxStyleNoFunctionValues } from \"./jsx-style-no-function-values\"\nimport { jsxStyleNoUnusedCustomProp } from \"./jsx-style-no-unused-custom-prop\"\nimport { jsxLayoutClasslistGeometryToggle } from \"./jsx-layout-classlist-geometry-toggle\"\nimport { jsxLayoutPictureSourceRatioConsistency } from \"./jsx-layout-picture-source-ratio-consistency\"\nimport { jsxNoDuplicateClassTokenClassClasslist } from \"./jsx-no-duplicate-class-token-class-classlist\"\nimport { jsxStylePolicy } from \"./jsx-style-policy\"\nimport { jsxLayoutFillImageParentMustBeSized } from \"./jsx-layout-fill-image-parent-must-be-sized\"\nimport { cssLayoutUnsizedReplacedElement } from \"./css-layout-unsized-replaced-element\"\nimport { cssLayoutDynamicSlotNoReservedSpace } from \"./css-layout-dynamic-slot-no-reserved-space\"\nimport { cssLayoutOverflowAnchorInstability } from \"./css-layout-overflow-anchor-instability\"\nimport { cssLayoutScrollbarGutterInstability } from \"./css-layout-scrollbar-gutter-instability\"\nimport { cssLayoutContentVisibilityNoIntrinsicSize } from \"./css-layout-content-visibility-no-intrinsic-size\"\nimport { cssLayoutStatefulBoxModelShift } from \"./css-layout-stateful-box-model-shift\"\nimport { jsxLayoutUnstableStyleToggle } from \"./jsx-layout-unstable-style-toggle\"\nimport { jsxLayoutPolicyTouchTarget } from \"./jsx-layout-policy-touch-target\"\nimport { cssLayoutConditionalDisplayCollapse } from \"./css-layout-conditional-display-collapse\"\nimport { cssLayoutConditionalOffsetShift } from \"./css-layout-conditional-offset-shift\"\nimport { cssLayoutConditionalWhiteSpaceWrapShift } from \"./css-layout-conditional-white-space-wrap-shift\"\nimport { cssLayoutOverflowModeToggleInstability } from \"./css-layout-overflow-mode-toggle-instability\"\nimport { cssLayoutBoxSizingToggleWithChrome } from \"./css-layout-box-sizing-toggle-with-chrome\"\nimport { cssLayoutSiblingAlignmentOutlier } from \"./css-layout-sibling-alignment-outlier\"\nimport { cssNoEmptyRule } from \"./css-no-empty-rule\"\nimport { cssNoIdSelectors } from \"./css-no-id-selectors\"\nimport { cssNoComplexSelectors } from \"./css-no-complex-selectors\"\nimport { cssSelectorMaxSpecificity } from \"./css-selector-max-specificity\"\nimport { cssSelectorMaxAttributeAndUniversal } from \"./css-selector-max-attribute-and-universal\"\nimport { cssDeclarationNoOverriddenWithinRule } from \"./css-declaration-no-overridden-within-rule\"\nimport { cssNoHardcodedZIndex } from \"./css-no-hardcoded-z-index\"\nimport { cssZIndexRequiresPositionedContext } from \"./css-z-index-requires-positioned-context\"\nimport { cssNoDiscreteTransition } from \"./css-no-discrete-transition\"\nimport { cssNoTransitionAll } from \"./css-no-transition-all\"\nimport { cssNoLegacyVh100 } from \"./css-no-legacy-vh-100\"\nimport { cssPreferLogicalProperties } from \"./css-prefer-logical-properties\"\nimport { cssNoImportant } from \"./css-no-important\"\nimport { cssNoUnresolvedCustomProperties } from \"./css-no-unresolved-custom-properties\"\nimport { cssNoUnusedCustomProperties } from \"./css-no-unused-custom-properties\"\nimport { cssNoDuplicateSelectors } from \"./css-no-duplicate-selectors\"\nimport { cssNoEmptyKeyframes } from \"./css-no-empty-keyframes\"\nimport { cssNoUnknownAnimationName } from \"./css-no-unknown-animation-name\"\nimport { cssNoUnusedKeyframes } from \"./css-no-unused-keyframes\"\nimport { cssNoUnknownContainerName } from \"./css-no-unknown-container-name\"\nimport { cssNoUnusedContainerName } from \"./css-no-unused-container-name\"\nimport { cssRequireReducedMotionOverride } from \"./css-require-reduced-motion-override\"\nimport { cssNoOutlineNoneWithoutFocusVisible } from \"./css-no-outline-none-without-focus-visible\"\nimport { cssPolicyContrast } from \"./css-policy-contrast\"\nimport { cssPolicyTypography } from \"./css-policy-typography\"\nimport { cssPolicySpacing } from \"./css-policy-spacing\"\nimport { cssNoLayoutPropertyAnimation } from \"./css-no-layout-property-animation\"\nimport { cssLayerRequirementForComponentRules } from \"./css-layer-requirement-for-component-rules\"\nimport { cssNoCustomPropertyCycle } from \"./css-no-custom-property-cycle\"\nimport { cssNoLayerOrderInversion } from \"./css-no-layer-order-inversion\"\nimport { cssNoRedundantOverridePairs } from \"./css-no-redundant-override-pairs\"\nimport { cssMediaQueryOverlapConflict } from \"./css-media-query-overlap-conflict\"\nimport { cssNoDescendingSpecificityConflict } from \"./css-no-descending-specificity-conflict\"\n\nexport const allRules: readonly AnalysisRule[] = [\n cssLayoutTransitionLayoutProperty,\n cssLayoutAnimationLayoutProperty,\n cssLayoutFontSwapInstability,\n jsxNoUndefinedCssClass,\n cssNoUnreferencedComponentClass,\n jsxClasslistBooleanValues,\n jsxClasslistNoAccessorReference,\n jsxClasslistNoConstantLiterals,\n jsxClasslistStaticKeys,\n jsxStyleKebabCaseKeys,\n jsxStyleNoFunctionValues,\n jsxStyleNoUnusedCustomProp,\n jsxLayoutClasslistGeometryToggle,\n jsxLayoutPictureSourceRatioConsistency,\n jsxNoDuplicateClassTokenClassClasslist,\n jsxStylePolicy,\n jsxLayoutFillImageParentMustBeSized,\n cssLayoutUnsizedReplacedElement,\n cssLayoutDynamicSlotNoReservedSpace,\n cssLayoutOverflowAnchorInstability,\n cssLayoutScrollbarGutterInstability,\n cssLayoutContentVisibilityNoIntrinsicSize,\n cssLayoutStatefulBoxModelShift,\n jsxLayoutUnstableStyleToggle,\n jsxLayoutPolicyTouchTarget,\n cssLayoutConditionalDisplayCollapse,\n cssLayoutConditionalOffsetShift,\n cssLayoutConditionalWhiteSpaceWrapShift,\n cssLayoutOverflowModeToggleInstability,\n cssLayoutBoxSizingToggleWithChrome,\n cssLayoutSiblingAlignmentOutlier,\n cssNoEmptyRule,\n cssNoIdSelectors,\n cssNoComplexSelectors,\n cssSelectorMaxSpecificity,\n cssSelectorMaxAttributeAndUniversal,\n cssDeclarationNoOverriddenWithinRule,\n cssNoHardcodedZIndex,\n cssZIndexRequiresPositionedContext,\n cssNoDiscreteTransition,\n cssNoTransitionAll,\n cssNoLegacyVh100,\n cssPreferLogicalProperties,\n cssNoImportant,\n cssNoUnresolvedCustomProperties,\n cssNoUnusedCustomProperties,\n cssNoDuplicateSelectors,\n cssNoEmptyKeyframes,\n cssNoUnknownAnimationName,\n cssNoUnusedKeyframes,\n cssNoUnknownContainerName,\n cssNoUnusedContainerName,\n cssRequireReducedMotionOverride,\n cssNoOutlineNoneWithoutFocusVisible,\n cssPolicyContrast,\n cssPolicyTypography,\n cssPolicySpacing,\n cssNoLayoutPropertyAnimation,\n cssLayerRequirementForComponentRules,\n cssNoCustomPropertyCycle,\n cssNoLayerOrderInversion,\n cssNoRedundantOverridePairs,\n cssMediaQueryOverlapConflict,\n cssNoDescendingSpecificityConflict,\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,mBAAmB,QAAc,WAAgC;AAC/E,SAAO,CAAC,MAAM;AACZ,UAAM,WAAW,UAAU,EAAE,IAAI;AACjC,QAAI,aAAa,QAAW;AAAE,aAAO,CAAC;AAAG;AAAA,IAAO;AAChD,QAAI,aAAa,MAAO;AACxB,QAAI,aAAa,EAAE,UAAU;AAC3B,aAAO,EAAE,GAAG,GAAG,UAAU,SAAS,CAAC;AACnC;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV;AACF;AAKO,SAAS,aAAa,QAA8B;AACzD,MAAI,YAA2B,OAAO,SAAS,CAAC;AAChD,MAAI,UAAkC,OAAO;AAE7C,SAAO;AAAA,IACL,IAAI,OAAO;AACT,YAAM,cAA4B,CAAC;AACnC,YAAM,MAAY,CAAC,MAAM,YAAY,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ACrBM,IAAM,WAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["rules","rules","hasEffectiveMetricOverrides","allRules","existsSync","readFileSync","dirname","join","dirname","join","existsSync","readFileSync","ts","readFileSync","existsSync","resolve","dirname","join","resolve","dirname","join","existsSync","readFileSync","firstSlash","value","delta","SCROLLABLE_VALUES","computeScrollContainerFact","SCROLLABLE_VALUES","CONTROL_ELEMENT_TAGS","WHITESPACE_RE","WHITESPACE_RE","signal","firstToken","CONTROL_ELEMENT_TAGS","SCROLLABLE_VALUES","EMPTY_STRING_LIST","rules","rules","computeScrollContainerFact","rules","rules","OUT_OF_FLOW_POSITIONS","messages","messages","messages","messages","ts","messages","ts","ts","messages","ts","ts","messages","ts","ts","messages","ts","ts","messages","ts","ts","messages","ts","ts","messages","ts","ts","messages","OUT_OF_FLOW_POSITIONS","ts","messages","messages","ts","messages","ts","messages","ts","messages","ts","messages","messages","messages","messages","messages","ts","messages","ts","messages","INTERACTIVE_HTML_TAGS","INTERACTIVE_ARIA_ROLES","readKnownPx","formatRounded","messages","messages","hasEffectivePosition","messages","isFlowRelevantBySiblingsOrText","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","rules","messages","messages","messages","messages","messages","messages","t","normalizeSelector","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages","messages"]}
|