@ng-native/fabric 0.16.0 → 0.17.1

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/dist/css.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAKL,WAAW,EACX,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAyB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwJpE,sGAAsG;AACtG,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC;AAsGxC;;;;GAIG;AACH,MAAM,QAAQ,GAAiD;IAC7D,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,SAAS,MAAM,CAAC,KAA6B,EAAE,IAAe;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,4FAA4F;IAC5F,+FAA+F;IAC/F,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAC;AAoUD;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAkB;IACtC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,IAAK,KAA2B,CAAC,IAAI,KAAK,EAAE,CAA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AE,CAAC,aAAa,CAAC,CAAC;IACxE,OAAQ,KAAgC,IAAI,IAAI,CAAC;AACnD,CAAC","sourcesContent":["/**\n * Runtime half of the CSS system: selector matching and the cascade.\n *\n * All the expensive work happened at build time (parsing, longhand expansion, value conversion,\n * specificity maths, sorting), so this only walks a pre-sorted rule list and merges. It is\n * framework-agnostic and knows nothing about Angular.\n */\nimport {\n type HueMethod,\n type MixSide,\n type MixSpace,\n type Rgba,\n mixChannels,\n mixColours,\n} from './color-mix.ts';\nimport { type BackgroundLayers, backgroundLayers } from './background-layers.ts';\nimport { ELEMENT_STYLES } from './element-styles.ts';\nimport { type Channel, relativeColour } from './relative-colour.ts';\nimport type { Keyframe } from './transition.ts';\n\n/** One `[name]` or `[name op \"value\"]` test. */\nexport interface AttributeTest {\n readonly name: string;\n /** Absent means a presence test. */\n readonly operator?: 'equal' | 'prefix' | 'suffix' | 'substring' | 'includes' | 'dash-match';\n readonly value?: string;\n /** The `i` flag: the value is compared without case, and is written here in lower case. */\n readonly insensitive?: true;\n}\n\nexport interface Compound {\n readonly type?: string;\n readonly id?: string;\n /** `:root`: the node at the top of the tree. */\n readonly root?: true;\n readonly classes: readonly string[];\n readonly attributes?: readonly AttributeTest[];\n /** `:is()` / `:where()` arguments: the compound matches if any of these do. */\n readonly is?: readonly (readonly Compound[])[];\n /** `:not()` arguments: the compound matches only if none of these do. */\n readonly not?: readonly Compound[];\n /** `:host`: the node must be the host of the component whose sheet is being evaluated. */\n readonly host?: true;\n /** `:host-context()`, once for each written: the host, or one of its ancestors, must match it. */\n readonly hostContext?: readonly Compound[];\n /**\n * `:is(<compound> *)`: every one of these must match some ancestor, the node itself excluded.\n * What Tailwind's `group-*` variants compile to.\n */\n readonly ancestors?: readonly Compound[];\n /**\n * `:is(<compound> > *)`: every one of these must match the node's parent. What Tailwind's `*:`\n * variant compiles to.\n */\n readonly parents?: readonly Compound[];\n /** Interaction state the engine tracks: `:focus` and `:active`. */\n readonly pseudo?: readonly ('focus' | 'active')[];\n /**\n * `:first-child` and its family, reduced to the counting tests CSS defines them as. More than\n * one because `:only-child` is two: first from the start and first from the end.\n */\n readonly nth?: readonly NthTest[];\n /** `:empty`: no children at all, text included. */\n readonly empty?: true;\n /**\n * What a `::ng-deep` is written after: an element of the component the sheet is of, or its\n * host. A rule with one is for what is under it, in other components' views too.\n */\n readonly own?: true;\n /** `:has()`: every one of these must find a match beneath the node. */\n readonly has?: readonly HasTest[];\n}\n\n/** One `:has()`: some element beneath the node, or some child of it, matches one of `any`. */\nexport interface HasTest {\n /** `:has(> x)`: a child, not any descendant. */\n readonly child?: true;\n readonly any: readonly Compound[];\n}\n\n/** `an + b`, counted from the start unless `fromEnd`. */\nexport interface NthTest {\n readonly a: number;\n readonly b: number;\n readonly fromEnd?: true;\n /** Counted among the siblings with the node's own element name: `:nth-of-type()`. */\n readonly ofType?: true;\n}\n\nexport type Combinator = 'descendant' | 'child' | 'next-sibling' | 'later-sibling';\n\nexport interface StyleRule {\n readonly compounds: readonly Compound[];\n /** Between compounds; length is `compounds.length - 1`. */\n readonly combinators: readonly Combinator[];\n readonly specificity: number;\n /** Written with `::ng-deep`: for what is under its component, in other components' views too. */\n readonly deep?: true;\n /**\n * The cascade layer the rule is in, as its place in its sheet's `layers`, or nothing for a rule\n * in no layer, which beats every layered one whatever their specificity.\n */\n readonly layer?: number;\n readonly order: number;\n readonly declarations: Readonly<Record<string, unknown>>;\n readonly important?: Readonly<Record<string, unknown>>;\n /** Custom properties this rule defines, pre-converted into every form a use site might want. */\n readonly tokens?: Readonly<Record<string, TokenValue>>;\n /** The names among `tokens` declared `!important`, which beat every plain one. */\n readonly importantTokens?: readonly string[];\n /** Declarations whose value is a `var()`, resolved once the token map is known. */\n readonly deferred?: readonly DeferredDeclaration[];\n /**\n * The corners and edges the rule's plain declarations wrote, in the order it wrote them, where\n * it wrote one in both its logical form and its physical one. The cascade settles the two as\n * one property, and a value settled on device is in a list of its own, with no order between\n * it and the rest.\n */\n readonly sides?: readonly string[];\n /** The same for the rule's important declarations. */\n readonly importantSides?: readonly string[];\n /** The media query guarding this rule, if any. */\n readonly condition?: MediaCondition;\n /** Memo of the last condition evaluation, and the conditions version it was made against. */\n activeAt?: number;\n active?: boolean;\n}\n\nexport type MediaCondition =\n | { readonly all: readonly MediaCondition[] }\n | { readonly any: readonly MediaCondition[] }\n | {\n readonly feature: 'width' | 'height';\n readonly op: 'gt' | 'gte' | 'lt' | 'lte' | 'eq';\n readonly value: number;\n }\n | {\n /** `direction` is not a media feature: it is what `:dir()` asks, of the app as a whole. */\n readonly feature:\n 'orientation' | 'prefers-color-scheme' | 'prefers-reduced-motion' | 'direction';\n readonly value: string;\n };\n\n/** What media queries are evaluated against. Pushed in by the host: the engine imports no RN. */\nexport interface Conditions {\n readonly width: number;\n readonly height: number;\n readonly colorScheme: 'light' | 'dark';\n /**\n * The user asked for less animation. Optional because it is a preference rather than a\n * measurement: an app that never asks the platform gets `no-preference`, which is what a\n * platform that cannot answer means anyway.\n */\n readonly reducedMotion?: boolean;\n /**\n * The system text size, as a multiplier: `PixelRatio.getFontScale()`. What native text scales\n * by; the engine scales the line box it keeps for a single-line iOS text input by it too.\n * Optional, and 1 when absent. A change reaches that line box when text is measured again\n * (`Engine.remeasureText`), which `watchConditions` does after it.\n */\n readonly fontScale?: number;\n /**\n * The direction the app is laid out in, which is the device's unless the app forced one:\n * `I18nManager.isRTL`. Optional, and left to right when absent. It decides which physical\n * corner or edge a logical one is, where an element has both and no `direction` of its own.\n */\n readonly direction?: 'ltr' | 'rtl';\n}\n\n/** A run of CSS whitespace: spaces, tabs, newlines, carriage returns and form feeds, and no other. */\nexport const CSS_SPACE = /[ \\t\\n\\r\\f]+/;\n\n/** A custom property's value, in each form it can legally take. Absent forms are unusable. */\nexport interface TokenValue {\n readonly length?: number | string;\n /** An angle, in degrees whatever unit it was written in. */\n readonly angle?: number;\n /** A time, in milliseconds whatever unit it was written in. */\n readonly time?: number;\n readonly color?: string;\n readonly keyword?: string;\n readonly number?: number;\n /** A font weight, as the string `fontWeight` takes. */\n readonly weight?: string;\n /** The first family of a font stack. A single word is read from `keyword` instead. */\n readonly family?: string;\n /**\n * A bare number as a line-height: a multiple of the font size, settled where it is used. A\n * length is read from `length` instead.\n */\n readonly lineHeight?: { readonly __defer: DeferredDeclaration['compute'] };\n /**\n * Two to four lengths, which a shorthand of sides or corners takes a value each from:\n * `padding: var(--list-padding)` of `--list-padding: 0.25rem 0.5rem`.\n */\n readonly lengths?: readonly (number | string)[];\n /**\n * The same where a part is a `var()`, each such part as the alias a token that is one is:\n * `0 var(--modal-padding) var(--modal-padding)`. Worked out into `lengths` where it is defined.\n */\n readonly deferredLengths?: readonly (number | string | TokenValue)[];\n /** A whole shadow list, in the processed shape `boxShadow` takes. */\n readonly shadow?: readonly unknown[];\n /** One filter function, as the one-entry list `filter` takes: a slot of Tailwind's filters. */\n readonly filter?: readonly unknown[];\n /** One transform function, as the one-entry list `transform` takes: a 3D rotation or skew. */\n readonly transform?: readonly unknown[];\n /** One font variant, as the one-entry list `fontVariant` takes: a numeric variant's slot. */\n readonly fontVariant?: readonly string[];\n /** Bare colour channels as `rgb()` reads them, 0 to 255: `13, 110, 253` or `100% 0% 0%`. */\n readonly channels?: readonly number[];\n /** The same as `hsl()` reads them: degrees, then saturation and lightness as fractions. */\n readonly hslChannels?: readonly number[];\n /** A transition's curve, as the cubic-bezier control points a timing keyword stands for. */\n readonly easing?: readonly number[];\n /** A whole animation, as the spec the engine plays: `--animate-spin`. */\n readonly animation?: Readonly<Record<string, unknown>>;\n /**\n * Defined as a colour made of other tokens: `rgba(var(--channels), <alpha>)`, or a `color-mix()`\n * of one. Settled on the node that defines it, as an `hsl` one is.\n */\n readonly deferredColour?: ColourExpression;\n /**\n * Defined as arithmetic of other tokens, `calc(var(--spacing) * 4)`, read as a length and as a\n * number. Settled on the node that defines it, as an `hsl` one is.\n */\n readonly deferredCalc?: readonly CalcMarker[];\n /**\n * Defined as another token, `var(--name)`. Resolved on the node that defines it, against the\n * tokens in scope there, and passed down resolved - which is what a browser does.\n */\n readonly alias?: string;\n /** What an alias becomes when the token it names is not defined. */\n readonly fallback?: TokenValue;\n /**\n * Defined as `hsl(var(--h), var(--s), var(--l))`, or `hsla()` with an alpha: how Bulma writes\n * every colour. Resolved into `color` on the node that defines it, alongside its aliases, so a\n * use site never has to know a token was ever built this way.\n */\n readonly hsl?: {\n readonly h: HslChannel;\n readonly s: HslChannel;\n readonly l: HslChannel;\n readonly alpha?: HslChannel;\n /** Written with commas, whose saturation and lightness are percentages alone. */\n readonly legacy?: true;\n };\n}\n\n/** One channel of an `hsl()` token: settled at build time, or a token to read at match time. */\nexport type HslChannel = number | { readonly reference: string; readonly fallback?: number };\n\n/** The forms a token can be read in: one per kind of value a use site can need. */\nexport type TokenKind =\n | 'length'\n | 'color'\n | 'keyword'\n | 'number'\n | 'weight'\n | 'family'\n | 'lineHeight'\n | 'shadow'\n | 'filter'\n | 'transform'\n | 'fontVariant'\n | 'channels'\n | 'hslChannels'\n | 'easing'\n | 'time'\n | 'animation'\n | 'display';\n\n/**\n * Where a form a token does not have can be read from instead. A length is already a\n * line-height and a single word is already a family, so neither is stored twice in every token\n * that happens to be one. The compiler reads fallbacks with the same table.\n */\nconst STAND_IN: Partial<Record<TokenKind, keyof TokenValue>> = {\n lineHeight: 'length',\n family: 'keyword',\n};\n\nfunction formOf(token: TokenValue | undefined, kind: TokenKind): unknown {\n if (!token) return undefined;\n // A display is a word, read as one native has where it is used: see `displayOf`. Two words,\n // `inline flex`, are a family when the stylesheet wrote them, as a font stack's first name is.\n if (kind === 'display') return token.keyword ?? token.family;\n const stand = STAND_IN[kind];\n return token[kind] ?? (stand ? token[stand] : undefined);\n}\n\nexport interface DeferredDeclaration {\n /**\n * The React Native style properties this lands in. Usually one, but a four-sided shorthand is\n * unambiguous given a single-valued token, so `padding: var(--gap)` writes all four.\n */\n readonly props: readonly string[];\n /**\n * `background: var()`: the token may hold gradients over a colour, so `props` names the image\n * beside the colour and each is written from its own part of the token. See `layersOf`.\n */\n readonly layers?: true;\n /**\n * `inherit`, written for these props: each is the parent's value for it, or nothing where the\n * parent has none.\n */\n readonly inherit?: true;\n /** The element a bound declaration is on, by name, for a message about it to say. */\n readonly on?: string;\n /** A `var()` reference. Exactly one of this and `compute` is present. */\n readonly kind?: TokenKind;\n readonly reference?: string;\n /**\n * The tokens a fallback that is itself a `var()` names, tried in turn when `reference` is not\n * defined: `var(--a, var(--b, green))` is `--a`, then `--b`, then `green`.\n */\n readonly alternatives?: readonly string[];\n readonly fallback?: unknown;\n /**\n * A fallback made of other tokens, `var(--missing, calc(var(--gap) * 2))`, worked out from the\n * tokens in scope where it is used, as a browser substitutes it there.\n */\n readonly fallbackToken?: TokenValue;\n /**\n * What to write when the reference resolves, whatever it resolves to: `flex: var(--grow)` sets a\n * shrink of 1 and a basis of 0%, but only when there is a grow for them to go with.\n */\n readonly whenSet?: unknown;\n /**\n * What to write when the reference resolves to nothing: the property's initial value, which is\n * what a browser gives a property whose `var()` cannot be substituted. Only where it differs\n * from leaving the property out: `flex-shrink` starts at 1 in CSS and at 0 in Yoga.\n */\n readonly unset?: unknown;\n /**\n * For a colour built from `channels`, the token its alpha comes from:\n * `rgba(var(--bs-primary-rgb), var(--bs-bg-opacity))`. A written alpha is an `adjust` instead.\n */\n readonly alpha?: { readonly reference: string; readonly fallback?: number };\n /** For a colour built from `channels`, read through `hsl()` rather than `rgb()`. */\n readonly space?: ChannelSpace;\n /**\n * A gradient whose stops are custom properties, filled in once a node's tokens are known. What\n * a utility framework's `from-*` and `to-*` classes compile to, since the class that paints the\n * gradient is not the class that supplies its colours.\n */\n readonly gradient?: GradientTemplate | readonly GradientTemplate[];\n /**\n * Arithmetic around the reference, settled at build time. `value * scale + offset`, then no\n * smaller than `floor`. What `calc(var(--x) + 12px)` and `max(var(--x), 16px)` become.\n */\n readonly adjust?: {\n readonly scale?: number;\n readonly offset?: number;\n readonly floor?: number;\n /**\n * The reference is multiplied by a length, so it is a number: `calc(var(--n) * 1px)`. Without\n * this it is a length, and a number token is no such thing, as CSS types a calc().\n */\n readonly number?: true;\n /**\n * A fraction to multiply the resolved colour's alpha by. What\n * `color-mix(in oklab, var(--x) 90%, transparent)` becomes, which is Tailwind's `/90`.\n */\n readonly alpha?: number;\n };\n /** Declared `!important`: ranked with the important declarations, not the plain ones. */\n readonly important?: true;\n /**\n * A length relative to the viewport or to the font size in scope, plus an absolute `offset`\n * when it came from a sum: `calc(1.375rem + 1.5vw)` is 1.5vw with 22 added.\n */\n readonly compute?: {\n readonly unit: 'em' | 'vw' | 'vh' | 'vmin' | 'vmax';\n readonly factor: number;\n readonly offset?: number;\n /**\n * A unitless line-height: the node renders `factor` em, and what it hands down is the number,\n * which each text under it multiplies its own font size by. See `LineHeightMultiple`.\n */\n readonly multiple?: true;\n };\n /**\n * A structured value - a transform list, a shadow, a filter - with lengths like `compute`'s\n * somewhere inside it, each marked `{ __defer: compute }`. Filled in where it is used.\n */\n readonly within?: unknown;\n /** A `border` or a side's line with tokens in it, each given its role where it is used. */\n readonly line?: LineTemplate;\n}\n\n/**\n * `border: var(--w) var(--s) var(--c)`: which token is the width, the style or the colour cannot be\n * told at build time, so each is given the role its form says on device. `roles` are those the\n * written parts left open; `props` of the declaration are every longhand, which a line its tokens\n * make nothing of unsets.\n */\nexport interface LineTemplate {\n readonly references: readonly {\n readonly reference: string;\n readonly alternatives?: readonly string[];\n readonly fallback?: TokenValue;\n /** `var(--x,)`: nothing at all when the token is unset. */\n readonly empty?: true;\n /** `calc(var(--w) * 2)`: the arithmetic that makes the token the width, and only that. */\n readonly adjust?: DeferredDeclaration['adjust'];\n }[];\n readonly roles: readonly ('width' | 'style' | 'color')[];\n readonly widths: readonly string[];\n readonly colors: readonly string[];\n /** `color-mix(in srgb, var(--tint) 35%, transparent)`: the colour, written as a function. */\n readonly colour?: unknown;\n readonly style?: string;\n /** Each side's own style, which the line's style is written to as well: see `settleBorders`. */\n readonly marks?: readonly string[];\n}\n\n/**\n * A colour a deferred value is made of: settled at build time, a token, or a `color-mix()` of two\n * such, worked out once the tokens are known. What a gradient stop, a shadow's colour or a colour\n * property with a `var()` in a mix becomes.\n */\nexport type ColourExpression =\n | { readonly color: string }\n | {\n readonly reference: string;\n readonly alternatives?: readonly string[];\n readonly fallback?: string;\n /** A fallback made of other tokens, worked out from the tokens where it is used. */\n readonly fallbackToken?: TokenValue;\n /**\n * A shadow's `var(--x,)` with no colour beside it, which holds the colour or the word\n * `inset`: currentcolor when it is `inset` or unset.\n */\n readonly orInset?: true;\n }\n | {\n /** A token of bare channels, as `rgba(var(--channels), <alpha>)` reads it. */\n readonly channels: {\n readonly reference: string;\n readonly fallback?: readonly number[];\n readonly space?: ChannelSpace;\n };\n readonly alpha?: number | { readonly reference: string; readonly fallback?: number };\n }\n | { readonly hsl: NonNullable<TokenValue['hsl']> }\n | {\n /** `oklch(from <colour> <channel> <channel> <channel> [/ <alpha>])`. */\n readonly relative: {\n readonly space: MixSpace;\n readonly from: ColourExpression;\n readonly channels: readonly [Channel, Channel, Channel];\n readonly alpha?: Channel;\n };\n }\n | {\n readonly mix: {\n readonly space: MixSpace;\n readonly hue?: HueMethod;\n readonly a: ColourExpression;\n readonly aPercentage?: MixShare;\n readonly b: ColourExpression;\n readonly bPercentage?: MixShare;\n };\n };\n\n/**\n * The share of a colour in a mix: a percentage, or a token multiplied into one, as\n * `calc(var(--opacity) * 100%)` is the token times a hundred, with the number the token falls\n * back to where it wrote one.\n */\nexport type MixShare =\n number | { readonly reference: string; readonly scale: number; readonly fallback?: number };\n\n/** One component's compiled styles, pre-sorted by specificity then source order. */\n/**\n * A gradient with holes in it: everything but the stop colours is settled at build time.\n *\n * The shape is React Native's own processed one, so filling it in is a copy with the references\n * resolved rather than a translation.\n */\nexport interface GradientTemplate {\n readonly type: 'linear-gradient' | 'radial-gradient';\n readonly colorStops: readonly {\n /** The custom property holding this stop's colour. A stop with no colour is not painted. */\n readonly reference?: string;\n /** A colour made from tokens and literals instead, such as a `color-mix()` of one. */\n readonly colour?: ColourExpression;\n readonly positionReference?: string;\n readonly position?: string | number;\n }[];\n /**\n * A radial gradient's centre, by the edges native measures from: each offset written, or a\n * token with what is written beside its name to use when it is not set.\n */\n readonly position?: Readonly<\n Record<\n string,\n string | number | { readonly reference: string; readonly fallback?: string | number }\n >\n >;\n}\n\nexport interface StyleSheet {\n readonly rules: readonly StyleRule[];\n /**\n * The sheet's cascade layers, each by its name from the outermost layer in, in the order they\n * were first named. A name that starts with a null is a block with no name, which is a layer\n * no other block can name.\n */\n readonly layers?: readonly (readonly string[])[];\n /**\n * `@keyframes` by name. Global within a sheet, as they are within a document; the engine keeps\n * one registry across every sheet it sees, so a name defined in a global stylesheet is usable\n * from a component's.\n */\n readonly keyframes?: Readonly<Record<string, readonly Keyframe[]>>;\n /**\n * Whether any rule here asks about a node's position among its siblings.\n *\n * Said on the sheet because what these cost is not matching but invalidation: adding a row\n * changes what its neighbours match while nothing about those neighbours moved, so the engine\n * has to re-resolve a whole child list when it changes. It only does that where a sheet asks.\n */\n readonly structural?: true;\n /**\n * Some rule uses `:has()`, so what a node matches can change when something beneath it does.\n * Said on the sheet for the same reason `structural` is: the cost is invalidation, and only a\n * sheet that asks has the engine match a changed node's ancestors again.\n */\n readonly has?: true;\n /**\n * The `@font-face` rules the sheet declares, each `source` the bundler's `require` of the file.\n * The engine does not read them: `loadFonts()` in `@ng-native/expo/fonts` registers them with\n * the platform before mount.\n */\n readonly fonts?: readonly {\n readonly family: string;\n readonly source: unknown;\n readonly weight?: number;\n /** The weights a variable font covers, `font-weight: 100 900`, in place of one `weight`. */\n readonly weightRange?: readonly [number, number];\n readonly style?: string;\n /**\n * The name inside the face's file, which the build reads where it can. SwiftUI finds a face by\n * this name only, and not by the name it is registered under.\n */\n readonly postScriptName?: string;\n }[];\n}\n\n/**\n * What one node resolved to. `style` is what it renders with; `inherited` is what its children\n * start from, which is the parent's own `inherited` plus whatever inheritable values this node\n * set. Keeping the two apart is what lets resolution go downwards.\n */\n/** What a node's matched rules come to: shared between nodes that match the same way. */\ntype Styled = Pick<StyleCache, 'style' | 'inherited' | 'tokens' | 'important'>;\n\nexport interface StyleCache {\n epoch: number;\n /**\n * Identity token standing for \"the ancestor chain, as far as matching is concerned\". A node\n * mints a fresh one whenever it recomputes, and reuses its previous one when it does not, so a\n * descendant can tell whether anything above it moved with a single reference comparison.\n *\n * It has to cover more than the inherited values. `.wrap.dark .label` and\n * `:host-context(.dark) .label` both change what a descendant matches when a class toggles on\n * an ancestor, while nothing inherited changes at all, so watching the inherited map alone\n * leaves those stale.\n */\n context: object;\n /** The parent's `context` this was computed from. */\n parentContext: object;\n /**\n * Identity token standing for what an element under this node could match differently: minted\n * when the node is styled for a change that can alter that, and kept when it is styled again\n * for one that cannot, a custom property of its own or an inherited value from above. An\n * element whose parent's is the one it was last styled under matches the rules it did, so it\n * is styled from those it kept and they are not found again.\n */\n scope: object;\n /** The parent's `scope` this was computed from. */\n parentScope: object;\n /** The rules the node matched, for a styling that finds its parent's `scope` as it was. */\n rules?: readonly StyleRule[];\n /** The conditions version this was resolved under. */\n generation: number;\n style: Record<string, unknown>;\n inherited: Record<string, unknown>;\n /**\n * Custom properties in scope for this node and its descendants. Cascades exactly as inherited\n * values do, and by the same copy-on-write rule, so a subtree that defines none shares one map.\n */\n tokens: Readonly<Record<string, TokenValue>>;\n /**\n * The rules the node matched, kept only while a sheet uses `:has()`: what a node whose\n * subtree changed is compared against, to tell whether it has to be restyled.\n */\n matched?: readonly StyleRule[];\n /**\n * Set once a child takes a value from this node's own style, an `inherit` for a property CSS\n * does not hand down: a change to the node's inline style then restyles it, and its children\n * with it, where otherwise an inline style changes nothing a child resolves to.\n */\n heirs?: true;\n /**\n * The properties a rule declared `!important`, where any did: an inline style is the last of\n * the plain declarations, so for these what the rules say stands over it.\n */\n important?: ReadonlySet<string>;\n}\n\n/**\n * Whether a child is one `:empty` sees. An anchor is a comment on the web, which it does not;\n * nor text of no length, which a binding to nothing leaves behind.\n */\nexport function fills(child: StyleTarget): boolean {\n if (child.kind === 'anchor') return false;\n return child.kind !== 'text' || (child as { text?: string }).text !== '';\n}\n\n/** What the matcher needs of a node. The engine's node satisfies this structurally. */\nexport interface StyleTarget {\n readonly tag: string;\n readonly parent: StyleTarget | null;\n /**\n * Needed only by the selectors that ask about a node's place among its siblings, which is why\n * it is read through the parent rather than kept as an index: an index would have to be right\n * after every insertion and removal, and this is right by construction.\n */\n readonly children?: readonly StyleTarget[];\n /**\n * Only elements are counted by the selectors that ask about position. Text is not one, and\n * neither is the anchor a structural directive leaves behind - the same reason a browser does\n * not count a comment. Absent means element, so a hand-built target needs nothing extra.\n */\n readonly kind?: string;\n readonly classes: ReadonlySet<string> | null;\n readonly props: Readonly<Record<string, unknown>>;\n /**\n * Whether `props.style` sets a property children inherit, kept by whoever sets the style so the\n * resolver reads the style only where it can matter. Absent is false.\n */\n readonly inlineInherits?: boolean;\n /**\n * The bound declarations that are a `var()`, `[style.color]=\"'var(--brand)'\"`, as the deferred\n * declarations a rule's would be: settled with the node's tokens, last of its normal ones.\n */\n readonly boundStyle?: readonly DeferredDeclaration[] | null;\n /** A node the engine made, such as the paragraph around loose text: it only inherits. */\n readonly anonymous?: true;\n /** One of HTML's text elements the engine has styles of its own for, such as `strong`. */\n readonly styled?: true;\n /**\n * The sheet this node's own rules come from, which is the sheet of the component whose renderer\n * created it. Read from the node rather than passed in, because a node's ancestors usually\n * belong to other components and must be matched against their own sheets, not this one's.\n */\n readonly sheet: StyleSheet | null;\n /**\n * The sheet of the component this node is the *host* of, if it is one. Distinct from `sheet`,\n * which is the sheet of the component that *created* it: a host node is created by the parent,\n * so those two are always different sheets and `:host` needs the second.\n */\n hostSheet: StyleSheet | null;\n /**\n * Custom properties set on the node itself, `[style.--tint]` or `style=\"--tint: red\"`, already\n * converted (`inline-token.ts`). In scope for its own rules and its descendants', and stronger\n * than any rule's, as inline style is on the web. Absent on a hand-built target.\n */\n readonly customProperties?: Readonly<Record<string, TokenValue>> | null;\n /** Memo slot, owned by the resolver. */\n styleCache: StyleCache | null;\n /** Set when something that could change what this node matches has changed. */\n styleDirty: boolean;\n /**\n * Set when what this node matches, or a custom property it holds, may have changed, and nothing\n * that an element under it is matched by: the node is matched and styled again, and those under\n * it are styled from the rules they matched. Absent on a hand-built target.\n */\n ownDirty?: boolean;\n /**\n * Set when something beneath this node changed and a sheet uses `:has()`: the node is matched\n * again, and restyled only if the rules it matches came out different. Absent on a hand-built\n * target.\n */\n hasDirty?: boolean;\n /**\n * Set by the engine when the node's own interaction state changed and nothing else about it\n * did: a press began or ended on it or under it. It is matched again, and keeps the style it\n * has, and everything under it, when it matches the rules it did. Not for an element a rule\n * asks about from another one, which is restyled: see `usesActive`.\n *\n * Set as well when its place among its siblings changed and nothing else about it did, which\n * is the same case: what it is asked about from another element is `placeReadElsewhere`.\n */\n stateDirty?: boolean;\n /** `:focus`. Set by the engine from the native focus and blur events. */\n focused?: boolean;\n /**\n * `:active`. Set by the engine on the responder and every one of its ancestors, because a press\n * activates the whole chain on the web too, not only the deepest element under the finger.\n */\n active?: boolean;\n}\n\n/**\n * Properties CSS inherits that mean something on native.\n *\n * RN does not inherit these: a `color` on a view has no effect on a text inside it, only a text\n * inside a text inherits. CSS authors expect otherwise, and a stylesheet written against that\n * expectation would silently lose every colour, so the cascade emulates inheritance for exactly\n * this set. NativeScript does the same.\n */\nconst INHERITED = new Set([\n 'color',\n // Yoga inherits it for layout already; carried here as well so a paragraph can align by it.\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontWeight',\n 'fontVariant',\n 'letterSpacing',\n 'lineHeight',\n 'textAlign',\n 'textTransform',\n 'textDecorationLine',\n 'writingDirection',\n // CSS inherits a text shadow, and `user-select: auto` takes the parent's, so a card's\n // `text-shadow-md` or `select-none` reaches the text inside it.\n 'textShadowOffset',\n 'textShadowRadius',\n 'textShadowColor',\n 'selectable',\n // CSS inherits it, and its `none` is the element alone: a descendant's `auto` takes touches\n // again. The engine commits a computed `none` as native's `box-none`, which means that.\n 'pointerEvents',\n]);\n\n/**\n * The `pointer-events` values CSS has. Native's own `box-none` and `box-only` say what their\n * children do already, so neither is handed down.\n */\nconst INHERITED_POINTER_EVENTS = new Set(['none', 'auto']);\n\n/**\n * `border-style: none`, which the compiler writes as a style native does not have. On the web it\n * makes every border width 0, whichever rule set the width, so `border-hidden border-x` draws no\n * side. Settled here, once the cascade has picked a style, and not sent on.\n */\nfunction drawNoBorder(own: Record<string, unknown>): void {\n delete own['borderStyle'];\n for (const key of Object.keys(own)) if (/^border\\w*Width$/.test(key)) own[key] = 0;\n own['borderWidth'] = 0;\n}\n\n/** Each side's own style, as the compiler keeps it, and the width it is the style of. */\nconst SIDE_STYLES = ['Top', 'Right', 'Bottom', 'Left', 'Start', 'End'].map(\n (side) => [`border${side}Style`, `border${side}Width`] as const,\n);\n\n/**\n * Settle a border side by side, once the cascade has picked each side's style: a side styled\n * `none` has no width, whichever rule set one, and the one style native has is that of a side\n * that is drawn. With no side drawn and no style at all, there is no border. A side's own style\n * is not sent on: native has none.\n */\nfunction settleBorders(own: Record<string, unknown>): void {\n let drawn: unknown;\n for (const [style, width] of SIDE_STYLES) {\n if (!(style in own)) continue;\n if (own[style] === 'none') own[width] = 0;\n else drawn ??= own[style];\n delete own[style];\n }\n if (own['borderStyle'] !== 'none') return;\n if (drawn === undefined) drawNoBorder(own);\n else own['borderStyle'] = drawn;\n}\n\n/**\n * Deterministic work counters for the matcher.\n *\n * Wall-clock is noise; a compound comparison is not. Asserting on these catches an algorithmic\n * regression (a walk that became quadratic, a cache that stopped hitting) in a way that a timing\n * assertion never could without being flaky. `test/css-cost.test.ts` holds the baselines.\n *\n * The cost is one integer increment per comparison, against a Set lookup and several property\n * reads, so it does not distort what it measures.\n */\n/**\n * What a sheet asks about a pressed element. `own` is whether a rule styles one, `.button:active`,\n * which matching the pressed elements again answers. `elsewhere` is each compound that asks about\n * a pressed element from another one: `.card:active .title`, `.a:active + .b`, or `:active`\n * inside `:not()`, `:is()` or `:has()`. An element such a compound could be is restyled with\n * everything under it when it is pressed, as what it changes is not itself alone.\n */\nexport function usesActive(sheet: StyleSheet): ActiveUse {\n const known = ACTIVE_USE.get(sheet);\n if (known) return known;\n let own = false;\n const elsewhere: Compound[] = [];\n for (const rule of sheet.rules) {\n rule.compounds.forEach((compound, at) => {\n const subject = at === rule.compounds.length - 1;\n // Asked of the element itself, on the compound or in its `:is()` and `:not()`: the\n // subject's is its own, and any other compound's is of the element that compound is.\n if (activeItself(compound, elsewhere)) {\n if (subject) own = true;\n else elsewhere.push(compound);\n }\n activeAround(compound, elsewhere);\n });\n }\n const use = { own, elsewhere };\n ACTIVE_USE.set(sheet, use);\n return use;\n}\n\nconst isActive = (compound: Compound): boolean => compound.pseudo?.includes('active') === true;\n\n/**\n * Whether a compound asks about the pressed state of the element it matches: on itself, in a\n * `:not()`, or as the last compound of an `:is()` argument. The compounds before the last in\n * such an argument are other elements, and are collected as they are.\n */\nfunction activeItself(compound: Compound, elsewhere: Compound[]): boolean {\n let itself = isActive(compound);\n for (const inner of compound.not ?? []) {\n if (activeItself(inner, elsewhere)) itself = true;\n activeAround(inner, elsewhere);\n }\n for (const chain of compound.is ?? []) {\n chain.forEach((inner, at) => {\n const asked = activeItself(inner, elsewhere);\n if (asked && at === chain.length - 1) itself = true;\n else if (asked) elsewhere.push(inner);\n activeAround(inner, elsewhere);\n });\n }\n return itself;\n}\n\n/** Each compound that asks about a pressed element around the one a compound matches. */\nfunction activeAround(compound: Compound, elsewhere: Compound[]): void {\n const collect = (value: unknown): void => {\n if (!value || typeof value !== 'object') return;\n if (Array.isArray(value)) return value.forEach(collect);\n if (isActive(value as Compound)) elsewhere.push(value as Compound);\n for (const inside of Object.values(value)) collect(inside);\n };\n for (const [key, inside] of Object.entries(compound)) {\n if (key !== 'is' && key !== 'not' && key !== 'pseudo') collect(inside);\n }\n}\nexport interface ActiveUse {\n readonly own: boolean;\n readonly elsewhere: readonly Compound[];\n}\nconst ACTIVE_USE = new WeakMap<StyleSheet, ActiveUse>();\n\nexport const styleStats = {\n /** Calls to `matchesCompound`, the innermost unit of matching work. */\n compoundTests: 0,\n /** Rules considered, i.e. calls to `matches`. */\n ruleTests: 0,\n /** Nodes cascaded, as opposed to handed back from the memo. */\n nodesResolved: 0,\n /** Rules filed by key selector: each sheet's once, however many sheets come after it. */\n rulesFiled: 0,\n /** Nodes asked whether a rule `:has()` was asked for could be for them: see `isFor`. */\n subjectTests: 0,\n};\n\nexport function resetStyleStats(): void {\n styleStats.compoundTests = 0;\n styleStats.ruleTests = 0;\n styleStats.nodesResolved = 0;\n styleStats.rulesFiled = 0;\n styleStats.subjectTests = 0;\n}\n\n/** A prop's value as an attribute test compares it: in lower case, under the i flag. */\nconst attributeText = (actual: unknown, test: AttributeTest): string =>\n test.insensitive ? String(actual).toLowerCase() : String(actual);\n\n/**\n * `[disabled]`, and the value operators.\n *\n * A prop set to `false` or `null` counts as absent, matching the web, where an attribute is either\n * present or not and a `disabled` binding that evaluates false removes it. Everything else is\n * compared as a string, so `[tabIndex=\"0\"]` works against a numeric prop. `class` is no prop: it\n * is the element's class list, as the attribute would spell it.\n */\nfunction matchesAttribute(node: StyleTarget, test: AttributeTest): boolean {\n const actual = test.name === 'class' ? classAttribute(node) : node.props[test.name];\n if (actual === undefined || actual === null || actual === false) return false;\n if (test.operator === undefined) return true;\n // `^=`, `$=`, `*=` and `~=` with an empty value match nothing, as Selectors 4 says.\n if (test.value === '' && !EMPTY_MATCHES.has(test.operator)) return false;\n return matchesValue(attributeText(actual, test), test.operator, test.value!);\n}\n\n/** The classes of a node in the order they were set, one space between each; none is absent. */\nconst classAttribute = (node: StyleTarget): string | undefined =>\n node.classes?.size ? [...node.classes].join(' ') : undefined;\n\n/** The operators an empty value can still match by: `=` and `|=`. */\nconst EMPTY_MATCHES: ReadonlySet<AttributeTest['operator']> = new Set(['equal', 'dash-match']);\n\n/** Whether an attribute's value, as `attributeText` gives it, passes an operator's test. */\nfunction matchesValue(\n value: string,\n operator: NonNullable<AttributeTest['operator']>,\n expected: string,\n): boolean {\n switch (operator) {\n case 'equal':\n return value === expected;\n case 'prefix':\n return value.startsWith(expected);\n case 'suffix':\n return value.endsWith(expected);\n case 'substring':\n return value.includes(expected);\n case 'includes':\n // `~=` matches one whole word of a list split at CSS's spaces, which a no-break space is not.\n return value.split(CSS_SPACE).includes(expected);\n case 'dash-match':\n // `|=` matches the value itself or the value followed by a hyphen, as `lang` uses.\n return value === expected || value.startsWith(`${expected}-`);\n }\n}\n\n/**\n * Whether a node is one a compound written before `::ng-deep` may be: an element of the view of\n * the component the sheet is of. Its host is one only where the compound says `:host`, which is\n * asked of it already: a class a parent gives the host is no anchor.\n */\nfunction ownedBy(node: StyleTarget, compound: Compound, sheet: StyleSheet | null): boolean {\n if (compound.host !== undefined || compound.hostContext !== undefined) return true;\n return node.sheet === sheet;\n}\n\n/*\n * Exempt from the complexity limit deliberately. This is a flat conjunction of independent\n * guards, not nested logic: cyclomatic complexity scores the two the same, and they are not the\n * same thing. It is also the hottest function in the matcher, called tens of thousands of times\n * per commit, so splitting each guard into its own call would cost more than it reads better.\n */\n// eslint-disable-next-line complexity\nfunction matchesCompound(node: StyleTarget, compound: Compound, sheet: StyleSheet | null): boolean {\n styleStats.compoundTests++;\n if (compound.host !== undefined && node.hostSheet !== sheet) return false;\n if (compound.root !== undefined && node.parent !== null) return false;\n if (compound.pseudo !== undefined) {\n for (const state of compound.pseudo) {\n if (state === 'focus' ? !node.focused : !node.active) return false;\n }\n }\n if (compound.type !== undefined && compound.type !== node.tag) return false;\n if (compound.own !== undefined && !ownedBy(node, compound, sheet)) return false;\n if (compound.id !== undefined && node.props['nativeID'] !== compound.id) return false;\n for (const className of compound.classes) {\n if (!node.classes?.has(className)) return false;\n }\n if (compound.attributes) {\n for (const test of compound.attributes) {\n if (!matchesAttribute(node, test)) return false;\n }\n }\n if (compound.empty !== undefined && node.children?.some(fills)) return false;\n if (compound.nth !== undefined) {\n for (const test of compound.nth) {\n if (!matchesNth(node, test)) return false;\n }\n }\n if (compound.not) {\n for (const excluded of compound.not) {\n if (matchesCompound(node, excluded, sheet)) return false;\n }\n }\n if (compound.is) {\n for (const alternatives of compound.is) {\n if (!alternatives.some((option) => matchesCompound(node, option, sheet))) return false;\n }\n }\n if (compound.has) {\n for (const test of compound.has) {\n if (!hasBeneath(node, test, sheet)) return false;\n }\n }\n if (compound.parents) {\n const parent = node.parent;\n if (!parent) return false;\n for (const above of compound.parents) {\n if (!matchesCompound(parent, above, sheet)) return false;\n }\n }\n if (compound.ancestors) {\n for (const ancestor of compound.ancestors) {\n let found = false;\n // From the parent: a descendant combinator never matches the node against itself.\n for (let n = node.parent; n && !found; n = n.parent) {\n found = matchesCompound(n, ancestor, sheet);\n }\n if (!found) return false;\n }\n }\n if (compound.hostContext) {\n for (const context of compound.hostContext) {\n // The host itself counts, as it does on the web.\n let found = false;\n for (let n: StyleTarget | null = node; n && !found; n = n.parent) {\n found = matchesCompound(n, context, sheet);\n }\n if (!found) return false;\n }\n }\n return true;\n}\n\n/** Whether some element beneath `node`, or some child of it for `:has(> x)`, matches the test. */\nfunction hasBeneath(node: StyleTarget, test: HasTest, sheet: StyleSheet | null): boolean {\n for (const child of node.children ?? []) {\n if (child.kind !== undefined && child.kind !== 'element') continue;\n if (test.any.some((option) => matchesCompound(child, option, sheet))) return true;\n if (!test.child && hasBeneath(child, test, sheet)) return true;\n }\n return false;\n}\n\n/**\n * Right-to-left matching, as every CSS engine does it: the rightmost compound is the cheapest\n * filter and rejects almost everything immediately.\n */\nexport function matches(\n node: StyleTarget,\n rule: StyleRule,\n sheet: StyleSheet | null = null,\n): boolean {\n styleStats.ruleTests++;\n const last = rule.compounds.length - 1;\n const subject = rule.compounds[last]!;\n // From the sheet of the component this node hosts, only a :host rule reaches it. Its other\n // rules are for the elements inside that component, which is how emulated encapsulation scopes\n // them on the web; without this, a class the parent puts on the host picks up the child's rule\n // of the same name.\n if (\n sheet !== null &&\n sheet === node.hostSheet &&\n sheet !== node.sheet &&\n subject.host === undefined\n ) {\n return false;\n }\n if (!matchesCompound(node, subject, sheet)) return false;\n return matchPrefix(node, rule, last - 1, sheet);\n}\n\n/**\n * Match the part of a selector to the left of an already-matched compound.\n *\n * `index` is the compound still to match, counting leftwards, and `from` is where to start\n * looking. A descendant combinator tries every ancestor and, crucially, keeps trying when the\n * rest of the selector does not work out from there. Taking the first ancestor that fits and\n * committing to it misses `.a > .b .c` whenever the nearest `.b` fails the child combinator while\n * a further one satisfies it, which is what the browser differential suite caught.\n */\nfunction matchPrefix(\n matched: StyleTarget,\n rule: StyleRule,\n index: number,\n sheet: StyleSheet | null,\n): boolean {\n if (index < 0) return true;\n\n const compound = rule.compounds[index]!;\n // `combinators[index]` joins this compound to the one on its right.\n switch (rule.combinators[index]) {\n case 'child':\n return matchStep(matched.parent, rule, index, compound, sheet);\n case 'next-sibling':\n return matchStep(previousElement(matched), rule, index, compound, sheet);\n case 'later-sibling':\n return matchAny(previousElement(matched), previousElement, rule, index, compound, sheet);\n default:\n return matchAny(matched.parent, (node) => node.parent, rule, index, compound, sheet);\n }\n}\n\n/** A combinator with exactly one candidate: the parent, or the sibling immediately before. */\nfunction matchStep(\n candidate: StyleTarget | null,\n rule: StyleRule,\n index: number,\n compound: Compound,\n sheet: StyleSheet | null,\n): boolean {\n if (!candidate || !matchesCompound(candidate, compound, sheet)) return false;\n return matchPrefix(candidate, rule, index - 1, sheet);\n}\n\n/**\n * A combinator with many candidates: every ancestor, or every earlier sibling.\n *\n * Crucially it keeps trying when the rest of the selector does not work out from a candidate that\n * fits. Taking the first and committing to it misses `.a > .b .c` whenever the nearest `.b` fails\n * the child combinator while a further one satisfies it, which is what the browser differential\n * suite caught.\n */\nfunction matchAny(\n first: StyleTarget | null,\n next: (node: StyleTarget) => StyleTarget | null,\n rule: StyleRule,\n index: number,\n compound: Compound,\n sheet: StyleSheet | null,\n): boolean {\n for (let candidate = first; candidate; candidate = next(candidate)) {\n if (\n matchesCompound(candidate, compound, sheet) &&\n matchPrefix(candidate, rule, index - 1, sheet)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * An ancestor filter, as a browser has one. A selector of several parts is matched leftwards\n * from the node, up through its ancestors: a node a dozen boxes down is asked of a dozen\n * ancestors for each rule its last part fits, and almost every such rule names an ancestor it\n * has not got. So what a node's ancestors are, their classes, names and ids, is gathered once\n * as sixty-four bits, and a rule that names one of them whose bit is not there is passed over\n * without a walk. Two names can share a bit: that is a walk that finds nothing, as before.\n */\ntype Bits = readonly [number, number];\n\nconst BIT_OF = new Map<string, number>();\n/** Past this many names the bits are worked out again: ids made per row would be kept for ever. */\nconst BITS_KEPT = 4096;\n\n/** The bit a class, a name or an id has among the sixty-four. */\nfunction bitOf(kind: string, name: string): number {\n const key = kind + name;\n let bit = BIT_OF.get(key);\n if (bit === undefined) {\n let hash = 0;\n for (let at = 0; at < key.length; at++) hash = (Math.imul(hash, 31) + key.charCodeAt(at)) | 0;\n bit = (hash ^ (hash >>> 16)) & 63;\n // A bit is its name's hash, so one forgotten is the same when it is asked for again.\n if (BIT_OF.size >= BITS_KEPT) BIT_OF.clear();\n BIT_OF.set(key, bit);\n }\n return bit;\n}\n\nconst NAMED_ABOVE = new WeakMap<StyleRule, Bits | null>();\n\n/**\n * The classes, names and ids a rule names of the node's ancestors: of each part joined to what\n * is on its right by a descendant or a child combinator. One joined by a sibling combinator is\n * no ancestor of the node, though the parts to its left that are ancestors of it are ancestors\n * of the node as well. Null where it names none, a rule of one part among them.\n */\nfunction namedAbove(rule: StyleRule): Bits | null {\n let named = NAMED_ABOVE.get(rule);\n if (named !== undefined) return named;\n let [low, high] = [0, 0];\n const add = (bit: number) => {\n if (bit < 32) low |= 1 << bit;\n else high |= 1 << (bit - 32);\n };\n for (let at = 0; at < rule.compounds.length - 1; at++) {\n const joined = rule.combinators[at];\n if (joined === 'next-sibling' || joined === 'later-sibling') continue;\n const compound = rule.compounds[at]!;\n for (const className of compound.classes) add(bitOf('.', className));\n if (compound.type !== undefined) add(bitOf('<', compound.type));\n if (compound.id !== undefined) add(bitOf('#', compound.id));\n }\n named = low === 0 && high === 0 ? null : [low, high];\n NAMED_ABOVE.set(rule, named);\n return named;\n}\n\n/** The classes, names and ids of a node's ancestors, as bits. */\nfunction bitsAbove(node: StyleTarget): Bits {\n let [low, high] = [0, 0];\n const add = (bit: number) => {\n if (bit < 32) low |= 1 << bit;\n else high |= 1 << (bit - 32);\n };\n for (let up = node.parent; up; up = up.parent) {\n if (up.classes) for (const className of up.classes) add(bitOf('.', className));\n if (up.tag !== undefined) add(bitOf('<', up.tag));\n const id = up.props?.['nativeID'];\n if (typeof id === 'string') add(bitOf('#', id));\n }\n return [low, high];\n}\n\n/** Whether what is above a node lacks something a rule names there. */\nconst lacks = (above: Bits, named: Bits): boolean =>\n (named[0] & ~above[0]) !== 0 || (named[1] & ~above[1]) !== 0;\n\nconst TAKES_PARENTS = new WeakMap<StyleRule, boolean>();\n\n/** Whether a rule has an `inherit` in it, which is settled from the parent's own style. */\nfunction takesParents(rule: StyleRule): boolean {\n let takes = TAKES_PARENTS.get(rule);\n if (takes === undefined) {\n takes = rule.deferred?.some((declaration) => declaration.inherit) === true;\n TAKES_PARENTS.set(rule, takes);\n }\n return takes;\n}\n\n/** Whether a node is one of the children CSS counts. Text and anchors are children, not elements. */\nconst isElement = (node: StyleTarget) => node.kind === undefined || node.kind === 'element';\n\n/** A node's first `count` elements, or its last, skipping everything that is not one. */\nexport function elementsAtEnd<T extends StyleTarget>(\n siblings: readonly T[],\n count: number,\n fromEnd: boolean,\n): T[] {\n const found: T[] = [];\n for (let step = 0; step < siblings.length && found.length < count; step++) {\n const sibling = siblings[fromEnd ? siblings.length - 1 - step : step]!;\n if (isElement(sibling)) found.push(sibling);\n }\n return found;\n}\n\n/**\n * Which way from a change in a child list a sheet's rules can match differently, past the\n * elements at its two ends. An element's place from the start hangs on the elements before it\n * and on none after, so a change moves the ones after it; its place from the end is the other\n * way about.\n */\nexport interface SiblingReach {\n /**\n * How many elements after a change it reaches. All of them, `Infinity`, where it counts from\n * the start (`:nth-child(odd)`) or asks about any element before (`~`). Where it asks only\n * about the element just before (`+`), as many as its longest run of them steps along: one for\n * `.a + .b`, two for `.a + .b + .c`. Zero where it asks none of these.\n */\n readonly after: number;\n /** It counts from the end (`:nth-last-child(2)`). */\n readonly before: boolean;\n}\n\nconst REACH = new WeakMap<StyleSheet, SiblingReach>();\n\n/**\n * How far a sheet asks about a child list beyond which element is first and which is last.\n * Where no sheet reaches either way, only the elements at the two ends can match differently.\n */\nexport function siblingReach(sheet: StyleSheet): SiblingReach {\n let known = REACH.get(sheet);\n if (known === undefined) {\n const reach = { after: 0, before: false };\n for (const rule of sheet.rules) {\n reach.after = Math.max(reach.after, stepsAlong(rule.combinators));\n for (const compound of rule.compounds) countSiblings(compound, reach, false);\n }\n known = reach;\n REACH.set(sheet, known);\n }\n return known;\n}\n\n/**\n * How many elements on from one a rule's combinators read: every later one for a `~`, and\n * otherwise its longest run of `+`. A run ends at a descendant or child combinator, which steps\n * out of the list.\n */\nfunction stepsAlong(combinators: readonly Combinator[]): number {\n let longest = 0;\n let run = 0;\n for (const one of combinators) {\n if (one === 'later-sibling') return Infinity;\n run = one === 'next-sibling' ? run + 1 : 0;\n longest = Math.max(longest, run);\n }\n return longest;\n}\n\n/**\n * Note in `reach` which end a compound, or one nested in it, counts its siblings from, further\n * than the first or last. A count inside a `:has()` is read as both: what it is asked of is\n * matched again by other means, and which way it reaches is not worked out.\n */\nfunction countSiblings(\n compound: Compound,\n reach: { after: number; before: boolean },\n withinHas: boolean,\n): void {\n // Which is first and which is last is the ends, and no count. Not of one name: the first of\n // its name is wherever the others of it are not.\n const counts = (compound.nth ?? []).filter((test) => test.a !== 0 || test.b !== 1 || test.ofType);\n if (counts.some((test) => withinHas || !test.fromEnd)) reach.after = Infinity;\n if (counts.some((test) => withinHas || test.fromEnd)) reach.before = true;\n for (const inner of nestedCompounds(compound)) countSiblings(inner, reach, withinHas);\n for (const test of compound.has ?? []) {\n for (const inner of test.any) countSiblings(inner, reach, true);\n }\n}\n\n/**\n * A compound whose element's place is read from another element, with the classes the rule asks\n * of what that element is in: its parent's where `child`, and otherwise of anything above it.\n */\nexport interface PlaceReader {\n readonly compound: Compound;\n readonly above?: readonly string[];\n readonly child?: boolean;\n}\n\nconst PLACE_ELSEWHERE = new WeakMap<StyleSheet, readonly PlaceReader[]>();\n\n/**\n * Each compound in a sheet whose element's place among its siblings is read from another\n * element: one with something under it in the rule, `.row:nth-child(odd) .label` and\n * `.a + .b .c`, or one an `:is()` or `:host-context()` looks for above the element styled.\n *\n * An element whose place changed is matched again, and where it matches the rules it did, it\n * and everything under it are left as they were: its own rules are all that its place can\n * change. Not an element one of these could be. What is under that one can match differently\n * though it matches the same, so it is styled again with everything under it.\n *\n * A place read by the element a rule styles, or by the elements before it that the rule steps\n * from (`.a:first-child + .b`), is that element's own: the rules it matches say.\n */\nexport function placeReadElsewhere(sheet: StyleSheet): readonly PlaceReader[] {\n let known = PLACE_ELSEWHERE.get(sheet);\n if (known === undefined) {\n const elsewhere: PlaceReader[] = [];\n for (const rule of sheet.rules) {\n // A run of compounds joined by `+` and `~` is one child list. Every run but the last is\n // above the element styled, and its last compound is the element the rest hangs under.\n let start = 0;\n rule.compounds.forEach((compound, at) => {\n placeReadAbove(compound, elsewhere);\n const joined = rule.combinators[at];\n if (joined === 'next-sibling' || joined === 'later-sibling') return;\n const run = rule.compounds.slice(start, at + 1);\n // What the run is in: the compound before it, which every element of it is under.\n const list = rule.compounds[start - 1];\n const child = rule.combinators[start - 1] === 'child';\n start = at + 1;\n const above = at < rule.compounds.length - 1;\n if (above && (run.length > 1 || run.some(readsPlace)))\n elsewhere.push({ compound, above: list?.classes, child });\n });\n }\n known = elsewhere;\n PLACE_ELSEWHERE.set(sheet, known);\n }\n return known;\n}\n\nconst NAMED_BESIDE = new WeakMap<StyleSheet, ReadonlySet<string>>();\n\n/**\n * The props a sheet's rules ask of an element before another in a child list, `[data-on] ~ .x`:\n * those whose change can restyle the elements after it. An id is asked as `nativeID`.\n */\nexport function namedBeside(sheet: StyleSheet): ReadonlySet<string> {\n let named = NAMED_BESIDE.get(sheet);\n if (named === undefined) {\n named = new Set();\n for (const rule of sheet.rules) {\n rule.combinators.forEach((joined, at) => {\n if (joined === 'next-sibling' || joined === 'later-sibling') {\n propsNamed(rule.compounds[at]!, named as Set<string>);\n }\n });\n }\n NAMED_BESIDE.set(sheet, named);\n }\n return named;\n}\n\n/** Add each prop a compound, or one nested in it at any depth, asks about: an attribute or an id. */\nfunction propsNamed(compound: Compound, into: Set<string>): void {\n if (compound.id !== undefined) into.add('nativeID');\n for (const test of compound.attributes ?? []) into.add(test.name);\n const within = (compound.has ?? []).flatMap((test) => test.any);\n for (const inner of [...nestedCompounds(compound), ...within]) propsNamed(inner, into);\n}\n\n/** Whether a compound, or one nested in it at any depth, asks about a place in a child list. */\nfunction readsPlace(compound: Compound): boolean {\n if (compound.nth?.length) return true;\n const within = (compound.has ?? []).flatMap((test) => test.any);\n return [...nestedCompounds(compound), ...within].some(readsPlace);\n}\n\n/**\n * Collect the compounds nested in one that are matched against an element above the one it is\n * matched against, and ask about that element's place: `:is(.group:first-child *)`.\n */\nfunction placeReadAbove(compound: Compound, elsewhere: PlaceReader[]): void {\n const above = [\n ...(compound.ancestors ?? []),\n ...(compound.parents ?? []),\n ...(compound.hostContext ?? []),\n ];\n for (const inner of above) if (readsPlace(inner)) elsewhere.push({ compound: inner });\n for (const inner of nestedCompounds(compound)) placeReadAbove(inner, elsewhere);\n}\n\n/** The compounds nested in one, a `:has()`'s apart. */\nconst nestedCompounds = (compound: Compound): Compound[] => [\n ...(compound.not ?? []),\n ...(compound.is ?? []).flat(),\n ...(compound.ancestors ?? []),\n ...(compound.parents ?? []),\n ...(compound.hostContext ?? []),\n];\n\n/** The element before this one, skipping everything that is not one. */\nfunction previousElement(node: StyleTarget): StyleTarget | null {\n const siblings = node.parent?.children;\n if (!siblings) return null;\n for (let i = siblings.indexOf(node) - 1; i >= 0; i--) {\n if (isElement(siblings[i]!)) return siblings[i]!;\n }\n return null;\n}\n\n/**\n * Whether a node's position satisfies `an + b`.\n *\n * ponytail: the general case counts the node's siblings, so a rule like `:nth-child(2n)` over a\n * long list is quadratic in it. The two that matter - first and last - are answered without\n * counting, and the rest wait for a list that is actually slow.\n */\nfunction matchesNth(node: StyleTarget, test: NthTest): boolean {\n const siblings = node.parent?.children;\n if (!siblings) return false;\n\n if (test.a === 0 && test.b === 1 && !test.ofType) {\n return (test.fromEnd ? lastElement(siblings) : firstElement(siblings)) === node;\n }\n\n const from = countPosition(node, siblings, test.fromEnd === true, test.ofType === true);\n if (from === 0) return false;\n // `an + b` for some whole number of steps, which is what CSS counts from.\n if (test.a === 0) return from === test.b;\n const steps = (from - test.b) / test.a;\n return Number.isInteger(steps) && steps >= 0;\n}\n\n/** Which element this is among its siblings, counting from one end or the other. Zero if absent. */\n/**\n * Drop from the pending deferred set every property a later rule has now set outright.\n *\n * Per property rather than per declaration: one deferred declaration can cover four sides, and a\n * later `padding-left` should take only that side away from it.\n */\nfunction overriddenBy(\n deferred: DeferredDeclaration[],\n declarations: Readonly<Record<string, unknown>>,\n important: boolean,\n): DeferredDeclaration[] | null {\n const kept: DeferredDeclaration[] = [];\n for (const declaration of deferred) {\n // A plain declaration cannot take anything from an important one.\n if (declaration.important && !important) {\n kept.push(declaration);\n continue;\n }\n const props = declaration.props.filter((prop) => !(prop in declarations));\n if (props.length === declaration.props.length) kept.push(declaration);\n else if (props.length) kept.push({ ...declaration, props });\n }\n return kept.length ? kept : null;\n}\n\n/**\n * The logical property and the physical one for the same corner or edge, left to right. CSS\n * settles the two as one property, the later declaration winning. A native view has a prop for\n * each and takes one whatever their order: React Native the physical corner, Yoga the logical\n * edge. So a declaration of either takes the other out of the cascade.\n */\nconst SIDES_LTR: readonly (readonly [logical: string, physical: string])[] = [\n ['borderStartStartRadius', 'borderTopLeftRadius'],\n ['borderStartEndRadius', 'borderTopRightRadius'],\n ['borderEndStartRadius', 'borderBottomLeftRadius'],\n ['borderEndEndRadius', 'borderBottomRightRadius'],\n ...['margin', 'padding'].flatMap((box) => [\n [`${box}Start`, `${box}Left`] as const,\n [`${box}End`, `${box}Right`] as const,\n ]),\n ...['Width', 'Color'].flatMap((part) => [\n [`borderStart${part}`, `borderLeft${part}`] as const,\n [`borderEnd${part}`, `borderRight${part}`] as const,\n ]),\n ['start', 'left'],\n ['end', 'right'],\n];\n\nconst mirrored = (physical: string): string =>\n physical.includes('Left') || physical === 'left'\n ? physical.replace('Left', 'Right').replace('left', 'right')\n : physical.replace('Right', 'Left').replace('right', 'left');\n\n/** Each property's other form, both ways, in a layout of each direction. */\nconst twins = (pairs: readonly (readonly [string, string])[]): Readonly<Record<string, string>> =>\n Object.fromEntries(\n pairs.flatMap(([logical, physical]) => [\n [logical, physical],\n [physical, logical],\n ]),\n );\n\nconst TWIN: Readonly<Record<'ltr' | 'rtl', Readonly<Record<string, string>>>> = {\n ltr: twins(SIDES_LTR),\n rtl: twins(SIDES_LTR.map(([logical, physical]) => [logical, mirrored(physical)] as const)),\n};\n\n/** The properties of a rule that have another form, plain and important, or null for neither. */\ninterface Sided {\n readonly plain: readonly string[];\n readonly important: readonly string[];\n}\n\nconst sidedOf = new WeakMap<StyleRule, Sided | null>();\n\nfunction sided(rule: StyleRule): Sided | null {\n let found = sidedOf.get(rule);\n if (found !== undefined) return found;\n const twin = TWIN.ltr;\n const plain = Object.keys(rule.declarations).filter((key) => key in twin);\n const important = rule.important ? Object.keys(rule.important).filter((key) => key in twin) : [];\n for (const declaration of rule.deferred ?? []) {\n for (const prop of declaration.props) {\n if (prop in twin) (declaration.important ? important : plain).push(prop);\n }\n }\n found = plain.length || important.length ? { plain, important } : null;\n sidedOf.set(rule, found);\n return found;\n}\n\n/** Of `keys`, in the order a rule wrote them, each whose other form comes after it. */\nfunction writtenEarlier(keys: readonly string[], twin: Readonly<Record<string, string>>): string[] {\n return keys.filter((key, at) => keys.indexOf(twin[key]!) > at);\n}\n\n/** The other form of each of `keys`, as the record `overriddenBy` reads. */\nfunction twinsOf(\n keys: readonly string[],\n twin: Readonly<Record<string, string>>,\n): Record<string, true> {\n const out: Record<string, true> = {};\n for (const key of keys) out[twin[key]!] = true;\n return out;\n}\n\n/**\n * One cascade's settling of the corners and edges set in both forms: each rule's are taken out of\n * what the rules before it left, in the form the rule does not use.\n */\nclass OtherForms {\n /** Worked out for the first rule that sets a corner or an edge, which most elements have none of. */\n private twin: Readonly<Record<string, string>> | null = null;\n private overImportant: Record<string, true> | null = null;\n private readonly direction: () => 'ltr' | 'rtl';\n\n constructor(direction: () => 'ltr' | 'rtl') {\n this.direction = direction;\n }\n\n /** Before `rule` is applied: the other form of what it sets goes, as the same property would. */\n before(\n rule: StyleRule,\n normal: Record<string, unknown>,\n important: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n const sides = sided(rule);\n if (!sides) return deferred;\n const twin = (this.twin ??= TWIN[this.direction()]);\n const plain = twinsOf(sides.plain, twin);\n for (const key in plain) delete normal[key];\n let kept = deferred && overriddenBy(deferred, plain, false);\n if (!sides.important.length) return kept;\n const gone = twinsOf(sides.important, twin);\n for (const key in gone) delete important[key];\n kept &&= overriddenBy(kept, gone, true);\n Object.assign((this.overImportant ??= {}), gone);\n return kept;\n }\n\n /**\n * Once `rule` is applied, its deferred values among `deferred`: where it wrote both forms, the\n * one it wrote later stands, among its plain declarations and among its important ones. The\n * order is the rule's own, sent with it, since a value settled on device is in another list.\n */\n within(\n rule: StyleRule,\n normal: Record<string, unknown>,\n important: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n if (!rule.sides && !rule.importantSides) return deferred;\n const twin = (this.twin ??= TWIN[this.direction()]);\n let kept = deferred;\n const settle = (order: readonly string[], into: Record<string, unknown>, tier: boolean) => {\n const lost: Record<string, true> = {};\n for (const key of writtenEarlier(order, twin)) {\n delete into[key];\n lost[key] = true;\n }\n kept &&= overriddenBy(kept, lost, tier);\n };\n if (rule.sides) settle(rule.sides, normal, false);\n if (rule.importantSides) settle(rule.importantSides, important, true);\n return kept;\n }\n\n /** An important one stands over the other form wherever that was set, as over its own. */\n after(\n normal: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n if (!this.overImportant) return deferred;\n for (const key in this.overImportant) delete normal[key];\n return deferred && overriddenBy(deferred, this.overImportant, false);\n }\n}\n\n/**\n * The deferred values still standing once `rule` has been applied, plus its own.\n *\n * A plain declaration from this rule beats a `var()` from an earlier one. Deferred values are\n * resolved after the cascade has run, so without this a token would win whatever the cascade\n * said: `.row { background: var(--surface) }` would repaint over\n * `.row:nth-child(odd) { background: ... }`, which is a rule with a pseudo-class on top of the\n * same class and should win. An important one survives a plain declaration, and only an important\n * declaration takes it away.\n */\nfunction carryDeferred(\n deferred: DeferredDeclaration[] | null,\n rule: StyleRule,\n): DeferredDeclaration[] | null {\n let kept = deferred;\n if (kept && Object.keys(rule.declarations).length) {\n kept = overriddenBy(kept, rule.declarations, false);\n }\n if (kept && rule.important) kept = overriddenBy(kept, rule.important, true);\n if (rule.deferred) (kept ??= []).push(...rule.deferred);\n return kept;\n}\n\nconst NO_DECLARATIONS: Readonly<Record<string, unknown>> = Object.freeze({});\n\nconst pick = <T>(from: Readonly<Record<string, T>>, names: readonly string[]): Record<string, T> =>\n Object.fromEntries(names.map((name) => [name, from[name]!]));\n\nconst isImportant = (rule: StyleRule): boolean =>\n rule.important !== undefined ||\n rule.importantTokens !== undefined ||\n rule.deferred?.some((one) => one.important) === true;\n\n/**\n * The matched rules in the order their declarations apply, weakest first.\n *\n * That is the order they matched in, unless a layered rule is important. Layers turn round for\n * `!important`: an important declaration in a layer beats one in a later layer, and both beat one\n * in no layer. So each such rule is split, its plain declarations where it matched, and its\n * important ones after every plain one, in the layers' order reversed.\n */\nfunction byImportance(\n matched: readonly StyleRule[],\n places: WeakMap<StyleRule, LayerPlace>,\n): readonly StyleRule[] {\n if (!matched.some((rule) => rule.layer !== undefined && isImportant(rule))) return matched;\n const plain = matched.map((rule) =>\n isImportant(rule)\n ? {\n ...rule,\n important: undefined,\n importantTokens: undefined,\n deferred: rule.deferred?.filter((one) => !one.important),\n }\n : rule,\n );\n const important = matched\n .filter(isImportant)\n // Stable, so rules of one layer keep the order their specificity gave them. Sorted before\n // they are copied, since a rule's place is kept by the rule itself.\n .sort((a, b) => layerOrder(places.get(b), places.get(a)))\n .map((rule) => ({\n ...rule,\n declarations: NO_DECLARATIONS,\n // Its important custom properties alone: the plain ones were applied where it matched.\n tokens: rule.importantTokens && pick(rule.tokens!, rule.importantTokens),\n deferred: rule.deferred?.filter((one) => one.important),\n }));\n return [...plain, ...important];\n}\n\nfunction countPosition(\n node: StyleTarget,\n siblings: readonly StyleTarget[],\n fromEnd: boolean,\n ofType: boolean,\n): number {\n let position = 0;\n let seen = 0;\n for (const sibling of siblings) {\n if (!isElement(sibling) || (ofType && sibling.tag !== node.tag)) continue;\n seen++;\n if (sibling === node) position = seen;\n }\n if (position === 0) return 0;\n return fromEnd ? seen - position + 1 : position;\n}\n\nfunction firstElement(siblings: readonly StyleTarget[]): StyleTarget | null {\n for (const sibling of siblings) if (isElement(sibling)) return sibling;\n return null;\n}\n\nfunction lastElement(siblings: readonly StyleTarget[]): StyleTarget | null {\n for (let i = siblings.length - 1; i >= 0; i--) {\n if (isElement(siblings[i]!)) return siblings[i]!;\n }\n return null;\n}\n\n/**\n * How much specificity a component's own rules gain over the application's global sheet.\n *\n * One class, which is precisely what Angular's emulated encapsulation already grants them by\n * rewriting a component rule to carry an `[_ngcontent-x]` attribute. Matching that keeps the\n * precedence people already have in their fingers rather than inventing a rule for native.\n */\nconst COMPONENT_SPECIFICITY_BUMP = 1_000;\n\n/**\n * Where a layer is among every layer the app's sheets have named: at each depth, its place among\n * the layers nested in its parent, in the order they were first named.\n */\ntype LayerPlace = readonly number[];\n\n/** The layers named so far at one depth, each with its place and the layers nested in it. */\ninterface LayerNames {\n readonly place: number;\n readonly nested: Map<string, LayerNames>;\n}\n\n/**\n * Two rules' layers, weakest first: a layer before each one named after it, a layer's nested\n * layers before its own rules, and every layered rule before a rule in no layer.\n */\nfunction layerOrder(a: LayerPlace | undefined, b: LayerPlace | undefined): number {\n if (a === b) return 0;\n if (a === undefined) return 1;\n if (b === undefined) return -1;\n const shared = Math.min(a.length, b.length);\n for (let depth = 0; depth < shared; depth++) {\n if (a[depth] !== b[depth]) return a[depth]! - b[depth]!;\n }\n // One is nested in the other, whose own rules are the stronger.\n return b.length - a.length;\n}\n\n/**\n * The engine's own styles for HTML's text elements, as rules to match before any a stylesheet\n * holds, so every rule an author writes beats them whatever its specificity, as a browser's own\n * sheet is beaten. Offered only to a node marked `styled`, which few are.\n */\nconst ELEMENT_ENTRIES: readonly RuleEntry[] = ELEMENT_STYLES.rules.map((rule) => ({\n rule,\n sheet: ELEMENT_STYLES,\n weight: rule.specificity,\n}));\n\n/** One rule in a cascade: the sheet it came from, which `:host` needs, and its weight here. */\ninterface RuleEntry {\n readonly rule: StyleRule;\n readonly sheet: StyleSheet;\n readonly weight: number;\n}\n\n/**\n * The bucket a rule is filed under: the most selective simple selector in its rightmost compound,\n * which is what a browser calls the key selector.\n *\n * Matching counts leftwards from that compound, so if it cannot match a node then nothing to its\n * left needs looking at. Anything that could match a node whose name, id and classes say nothing -\n * an attribute test, `:host`, `:is()`, a bare pseudo-class, `*` - goes in the universal bucket and\n * is offered to everything, because the alternative is a rule that silently stops applying.\n */\nexport function ruleKey(rule: StyleRule): string {\n return ruleKeys(rule)[0]!;\n}\n\n/**\n * Every bucket a rule is filed under. One, but for a rule whose rightmost compound is only an\n * `:is()` of compounds that each have a key: it is filed under each of theirs, since a node it\n * matches has one of them.\n *\n * A rule that says nothing of the node's own name can still say whose child it is, `.row > *`.\n * It is filed under the parent's class, and offered to the children of an element that has it.\n */\nexport function ruleKeys(rule: StyleRule): readonly string[] {\n const key = rule.compounds[rule.compounds.length - 1];\n if (!key) return EVERY_NODE;\n if (key.classes.length) return [`class:${key.classes[0]}`];\n if (key.id !== undefined) return [`id:${key.id}`];\n if (key.type !== undefined) return [`type:${key.type}`];\n const held = parentClass(rule, key);\n if (held !== undefined) return [`in:${held}`];\n return alternativeKeys(key) ?? attributeKey(key) ?? ancestorKeys(rule, key) ?? EVERY_NODE;\n}\n\n/**\n * The buckets of a rule for anything inside an element with a class, `.item:focus *`: under the\n * class, or each class the element may have instead. Offered to what has such an element\n * somewhere over it, where the universal bucket has every element walk to the root to find none.\n */\nfunction ancestorKeys(rule: StyleRule, key: Compound): string[] | undefined {\n const joined = rule.combinators[rule.combinators.length - 1];\n const above =\n key.ancestors?.[0] ??\n (joined === 'descendant' ? rule.compounds[rule.compounds.length - 2] : undefined);\n if (!above) return undefined;\n if (above.classes.length) return [`under:${above.classes[0]}`];\n const any = above.is?.[0];\n if (!any?.length || any.some((one) => !one.classes.length)) return undefined;\n return any.map((one) => `under:${one.classes[0]}`);\n}\n\n/**\n * The bucket of a rule that names its element by an attribute and nothing else, `[ngpButton]`:\n * a prop the element has to have, which is how a headless library names every element it\n * styles. Not `class`, which is no prop of the element's to find the bucket by.\n */\nfunction attributeKey(key: Compound): string[] | undefined {\n const named = key.attributes?.find((test) => test.name !== 'class');\n return named ? [`attr:${named.name}`] : undefined;\n}\n\n/** A class the node's parent has to have for the rule to match, where its selector says one. */\nfunction parentClass(rule: StyleRule, key: Compound): string | undefined {\n const written = key.parents?.find((compound) => compound.classes.length > 0);\n if (written) return written.classes[0];\n if (rule.combinators[rule.combinators.length - 1] !== 'child') return undefined;\n return rule.compounds[rule.compounds.length - 2]?.classes[0];\n}\n\n/** The keys of each compound a bare `:is()` takes, or nothing where one of them has none. */\nfunction alternativeKeys(key: Compound): string[] | undefined {\n const any = key.is?.[0];\n if (!any?.length) return undefined;\n const keys: string[] = [];\n for (const one of any) {\n if (one.classes.length) keys.push(`class:${one.classes[0]}`);\n else if (one.id !== undefined) keys.push(`id:${one.id}`);\n else if (one.type !== undefined) keys.push(`type:${one.type}`);\n else return undefined;\n }\n return keys;\n}\n\nconst UNIVERSAL = '*';\nconst EVERY_NODE: readonly string[] = [UNIVERSAL];\n\n/**\n * Where each kind of sheet is filed, as a multiple of the room one sheet's rules are given: the\n * global sheet first, then a host's own, its creator's, and each added sheet after those.\n */\nconst SHEET_ROOM = 1_000_000;\nconst HOSTS = 1;\nconst CREATED = 2;\nconst ADDED = 3;\n\n/** A rule in an index, and where it comes among rules of the same weight: the order it was written in. */\ninterface IndexedEntry {\n readonly entry: RuleEntry;\n readonly at: number;\n}\n\nexport interface RuleIndex {\n readonly buckets: Map<string, IndexedEntry[]>;\n readonly universal: IndexedEntry[];\n /** Whether any rule is filed under an attribute, which a node's props are then looked up for. */\n attributes?: boolean;\n /** Whether any is filed under the class of an element its own is inside. */\n under?: boolean;\n}\n\n/**\n * File rules by key selector, each at `from` and on: its place among every rule there is, which\n * settles the order of two of the same weight. Into an index there already where one is given,\n * so a sheet that arrives later is added to what is filed and nothing is filed again.\n */\nexport function indexRules(\n entries: readonly RuleEntry[],\n into: RuleIndex = { buckets: new Map(), universal: [] },\n from = 0,\n): RuleIndex {\n styleStats.rulesFiled += entries.length;\n entries.forEach((entry, n) => {\n const indexed = { entry, at: from + n };\n for (const key of ruleKeys(entry.rule)) {\n if (key === UNIVERSAL) {\n into.universal.push(indexed);\n continue;\n }\n if (key.startsWith('attr:')) into.attributes = true;\n else if (key.startsWith('under:')) into.under = true;\n const bucket = into.buckets.get(key);\n if (bucket) bucket.push(indexed);\n else into.buckets.set(key, [indexed]);\n }\n });\n return into;\n}\n\n/** Rules in the order they were filed in, which is the order of a list sorted before it was. */\nconst byPlace = (a: IndexedEntry, b: IndexedEntry): number => a.at - b.at;\n\n/** Add to `found` what one index holds in the buckets a node's name, id and classes reach. */\nfunction reach(node: StyleTarget, index: RuleIndex, found: IndexedEntry[]): void {\n const take = (key: string): void => {\n const bucket = index.buckets.get(key);\n if (bucket) found.push(...bucket);\n };\n if (index.universal.length) found.push(...index.universal);\n take(`type:${node.tag}`);\n const id = node.props['nativeID'];\n if (typeof id === 'string') take(`id:${id}`);\n if (node.classes) for (const name of node.classes) take(`class:${name}`);\n // What is written for any child of an element with one of the parent's classes.\n const around = node.parent?.classes;\n if (around) for (const name of around) take(`in:${name}`);\n if (index.attributes) reachByAttribute(node, take);\n if (index.under) reachUnder(node, take);\n}\n\n/** The buckets of the classes of every element over a node. */\nfunction reachUnder(node: StyleTarget, take: (key: string) => void): void {\n for (let above = node.parent; above; above = above.parent) {\n if (above.classes) for (const name of above.classes) take(`under:${name}`);\n }\n}\n\n/** The buckets of the attributes a node has: a prop of its own that is set. */\nfunction reachByAttribute(node: StyleTarget, take: (key: string) => void): void {\n for (const name in node.props) {\n const value = node.props[name];\n // As `matchesAttribute` has it: a prop that is false is an attribute that is not there.\n if (value !== undefined && value !== null && value !== false) take(`attr:${name}`);\n }\n}\n\n/**\n * The rules worth trying against a node, in cascade order: `order` says which of two comes\n * first, and with none it is the order they were filed in.\n *\n * From each index, only the buckets the node's name, id and classes reach, which is the entire\n * point of the index: the lists are short by construction, so sorting them is cheap.\n */\nexport function candidateRules(\n node: StyleTarget,\n indexes: RuleIndex | readonly RuleIndex[],\n order: (a: IndexedEntry, b: IndexedEntry) => number = byPlace,\n): RuleEntry[] {\n const found: IndexedEntry[] = [];\n const all = Array.isArray(indexes) ? (indexes as readonly RuleIndex[]) : [indexes as RuleIndex];\n for (const index of all) reach(node, index, found);\n if (found.length < 2) return found.map((indexed) => indexed.entry);\n found.sort(order);\n // A rule filed under two keys the node has is offered once.\n const offered: RuleEntry[] = [];\n for (let i = 0; i < found.length; i++) {\n if (found[i] !== found[i - 1]) offered.push(found[i]!.entry);\n }\n return offered;\n}\n\n/**\n * The properties the rules matching a node declared `!important`, or nothing where none did:\n * each by its own name and by the other form of it, so `margin-left` stands over an inline\n * `marginStart` as it does over an inline `marginLeft`.\n */\nfunction importantNames(\n result: CascadeResult,\n twin: () => Readonly<Record<string, string>>,\n): ReadonlySet<string> | undefined {\n const deferred = result.deferred?.filter((one) => one.important) ?? [];\n if (!result.important && !deferred.length) return undefined;\n const names = [...Object.keys(result.important ?? {}), ...deferred.flatMap((one) => one.props)];\n const sided = names.filter((name) => name in TWIN.ltr);\n return new Set(sided.length ? [...names, ...sided.map((name) => twin()[name]!)] : names);\n}\n\n/** What the rules matching one node add up to. */\ninterface CascadeResult {\n readonly declarations: Record<string, unknown>;\n /** The important declarations alone, which a deferred value that is not important cannot beat. */\n readonly important: Record<string, unknown> | null;\n readonly tokens: Record<string, TokenValue> | null;\n /** The custom properties among `tokens` declared `!important`, which the element's own do not take. */\n readonly importantTokens: Record<string, TokenValue> | null;\n readonly deferred: DeferredDeclaration[] | null;\n}\n\n/** What `em` falls back to when nothing in scope has set a font size. The web's default. */\nconst DEFAULT_FONT_SIZE = 16;\n\n/**\n * The rules a node matched, to style it from again: for a change above it, and not for one of\n * its own or beneath it, which can change what it matches.\n */\nfunction rulesKept(cached: StyleCache, node: StyleTarget): readonly StyleRule[] | undefined {\n return node.ownDirty || node.hasDirty ? undefined : cached.rules;\n}\n\n/** Shared empty result. Never handed out anywhere that mutates it. */\nconst EMPTY: Record<string, unknown> = {};\n\n/** Stands in for the parent of a root node, so the comparison needs no null case. */\nconst ROOT_CONTEXT: object = {};\n/** The `scope` over a node with no parent. */\nconst ROOT_SCOPE: object = {};\n/**\n * The `scope` of the one cache every node with nothing to style shares. It is no one node's, so\n * nothing styled under it, or holding it, is taken to match what it did.\n */\nconst SHARED_SCOPE: object = {};\n\n/** Shared empty token map, for the overwhelmingly common case of a subtree defining none. */\nconst NO_TOKENS: Readonly<Record<string, TokenValue>> = {};\n\n/**\n * Conditions generations are unique across every resolver in the process, not merely\n * increasing within one, because the memo they stamp lives on the compiled rule and a sheet is\n * shared by every engine that mounts the component.\n */\nlet generations = 0;\n\n/** What a sheet's rules are written for: the last compound of each, by its class or its name. */\nexport interface Subjects {\n readonly classes: Set<string>;\n readonly types: Set<string>;\n /**\n * The classes of the boxes that rules for anything are written inside: `.dialog > :first-child`\n * is for any element, but only one that has an element with `dialog` over it.\n */\n readonly inside: Set<string>;\n /** A rule for anything anywhere: no class, no name, and no such box to be in. */\n any: boolean;\n /**\n * In what a class reaches: a rule is for the element that has the class, `.on`, which is then\n * matched again itself. Unset where the rules are only for elements under it.\n */\n own?: boolean;\n /**\n * In what a class reaches: a rule names it in `:has()`, `.field:has(.on)`, which the boxes\n * above the element that has it are then asked again.\n */\n beneath?: boolean;\n /**\n * In what a class reaches: a rule names it in `:has(> )` alone, `.field:has(> .on)`, which only\n * the box right above the element that has it is then asked again.\n */\n parentHas?: boolean;\n}\n\ninterface Addition {\n readonly before: number;\n readonly after: number;\n readonly subjects: Subjects;\n}\n\nconst subjects = new WeakMap<StyleSheet, Subjects>();\n\nfunction subjectsOf(sheet: StyleSheet): Subjects {\n let found = subjects.get(sheet);\n if (found) return found;\n const classes = new Set<string>();\n const types = new Set<string>();\n const inside = new Set<string>();\n const all = { classes, types, inside, any: false };\n for (const rule of sheet.rules) noteSubject(all, rule);\n subjects.set(sheet, (found = all));\n return found;\n}\n\n/**\n * A box a rule asks `:has()` of that is not the node it styles, `.card:has(.x) .title`, by the\n * classes the rule asks of that box, with what the rule is for: the nodes under such a box to\n * match again when what is in it changes.\n */\nexport interface HasAbove {\n readonly classes: readonly string[];\n readonly subjects: Subjects;\n}\n\nconst HAS_ABOVE = new WeakMap<StyleSheet, readonly HasAbove[]>();\n\n/** Whether a compound, or one it asks of the same node, uses `:has()`. */\nconst asksBeneath = (compound: Compound): boolean =>\n compound.has !== undefined ||\n [...(compound.not ?? []), ...(compound.is ?? []).flat()].some(asksBeneath);\n\n/**\n * The boxes above the styled node that a compound asks `:has()` of: the compound's own node,\n * where that is not the styled one, and each box it is asked to be inside,\n * `.body:is(.card:has(.x) *) .title`.\n */\nfunction* boxesAsked(compound: Compound, styled: boolean): Generator<Compound> {\n if (!styled && asksBeneath(compound)) yield compound;\n for (const key of ['ancestors', 'parents', 'hostContext'] as const) {\n for (const outer of compound[key] ?? []) yield* boxesAsked(outer, false);\n }\n}\n\n/** Each box a sheet's rules ask `:has()` of above the node they style. */\nexport function hasAbove(sheet: StyleSheet): readonly HasAbove[] {\n let known = HAS_ABOVE.get(sheet);\n if (known === undefined) {\n const found: HasAbove[] = [];\n for (const rule of sheet.rules) {\n const last = rule.compounds.length - 1;\n for (const [at, compound] of rule.compounds.entries()) {\n for (const box of boxesAsked(compound, at === last)) {\n const subjects = noSubjects();\n noteSubject(subjects, rule);\n found.push({ classes: box.classes, subjects });\n }\n }\n }\n HAS_ABOVE.set(sheet, (known = found));\n }\n return known;\n}\n\n/** Note in `into` what a rule is for. */\nfunction noteSubject(into: Subjects, rule: StyleRule): void {\n const subject = rule.compounds.at(-1);\n // One class of several is enough to ask: a node without it matches none of them.\n if (subject?.classes.length) into.classes.add(subject.classes[0]!);\n else if (boxAround(rule) !== undefined) into.inside.add(boxAround(rule)!);\n else if (subject?.type && subject.type !== '*') into.types.add(subject.type);\n else into.any = true;\n}\n\n/**\n * What a class changing on an element can restyle, by the rules that name the class:\n *\n * - `true`, the element and all under it and after it, each matched again: a rule names the\n * class beside its element, or inside `:has()` or `:host-context()`;\n * - or the element itself, `own`, where a rule is for the element that has the class, and the\n * elements under it that rules are for, where a rule names it as what its own element is\n * inside, `.busy .row` or `.row:is(.busy *)`: those and no other are matched again.\n *\n * A class in no rule is in neither, and restyles nothing.\n */\ntype ClassReach = Map<string, true | Subjects>;\n\ninterface SheetReach {\n readonly classes: ClassReach;\n /** The tests of the `class` attribute itself, which a class in no rule can still answer. */\n readonly reads: readonly AttributeTest[];\n /** Every attribute a selector of the sheet asks about, by name. */\n readonly named: ReadonlySet<string>;\n}\n\nconst reaches = new WeakMap<StyleSheet, SheetReach>();\n\n/**\n * How far each class a sheet's selectors name reaches, and the tests of the `class` attribute\n * itself that are in them.\n *\n * The rules are walked whole for the classes in them, whatever a selector is made of: a part of\n * one added later counts as a class that reaches everything, without being named here.\n */\nfunction classReach(sheet: StyleSheet): SheetReach {\n let found = reaches.get(sheet);\n if (found) return found;\n const classes: ClassReach = new Map();\n const reads: AttributeTest[] = [];\n const named = new Set<string>();\n for (const rule of sheet.rules) {\n const every = new Set<string>();\n collectClasses(rule, every, reads, named);\n const { own, inside, beneath, parentHas } = classPlaces(rule);\n for (const name of every) {\n const placed = own.has(name) || inside.has(name) || beneath.has(name) || parentHas.has(name);\n if (!placed) classes.set(name, true);\n if (own.has(name)) noteOwn(classes, name);\n if (inside.has(name)) noteInside(classes, name, rule);\n if (beneath.has(name)) noteBeneath(classes, name, 'beneath');\n if (parentHas.has(name)) noteBeneath(classes, name, 'parentHas');\n }\n }\n reaches.set(sheet, (found = { classes, reads, named }));\n return found;\n}\n\n/** Note a rule as one for the element that has a class. */\nfunction noteOwn(found: ClassReach, name: string): void {\n const subjects = found.get(name);\n if (subjects === true) return;\n if (subjects) subjects.own = true;\n else found.set(name, { ...noSubjects(), own: true });\n}\n\n/** Note a rule as one that names a class in `:has()`, or in `:has(> )` alone. */\nfunction noteBeneath(found: ClassReach, name: string, how: 'beneath' | 'parentHas'): void {\n const subjects = found.get(name);\n if (subjects === true) return;\n if (subjects) subjects[how] = true;\n else found.set(name, { ...noSubjects(), [how]: true });\n}\n\n/** Note a rule as one that names a class as what its element is inside. */\nfunction noteInside(found: ClassReach, name: string, rule: StyleRule): void {\n let subjects = found.get(name);\n if (subjects === true) return;\n if (!subjects) found.set(name, (subjects = noSubjects()));\n const subject = rule.compounds.at(-1);\n if (subject?.classes.length) subjects.classes.add(subject.classes[0]!);\n else if (subject?.type && subject.type !== '*') subjects.types.add(subject.type);\n // A rule for anything in the box, `.busy > *`: anything under the node the class changed\n // on. Asking which box has the class finds none once the class has gone from it.\n else subjects.any = true;\n}\n\nconst noSubjects = (): Subjects => ({\n classes: new Set(),\n types: new Set(),\n inside: new Set(),\n any: false,\n});\n\n/** Add to `into` what `from` is for. */\nfunction addSubjects(into: Subjects, from: Subjects): void {\n for (const name of from.classes) into.classes.add(name);\n for (const name of from.types) into.types.add(name);\n for (const name of from.inside) into.inside.add(name);\n into.any ||= from.any;\n if (from.own) into.own = true;\n if (from.beneath) into.beneath = true;\n if (from.parentHas) into.parentHas = true;\n}\n\n/** What all of `each` are for, as one. */\nexport function joinSubjects(each: readonly Subjects[]): Subjects {\n const all = noSubjects();\n for (const one of each) addSubjects(all, one);\n return all;\n}\n\n/**\n * Where a rule names each class it names, for the classes it names in no other place than these:\n *\n * - `own`, on the element the rule is for: its own classes, and those in `:is()` and `:not()` of\n * it, which are asked of that element;\n * - `inside`, as what that element is inside: the classes of a compound before the last, with\n * nothing but `>` and a space between there and the element, and those of what `:is(.box *)`\n * and `:is(.box > *)` put over it;\n * - `beneath`, inside `:has()`, wherever in the rule that is: what it asks of is under the box\n * that answers it;\n * - `parentHas`, of what `:has(> )` asks of the box's children themselves, and nowhere else in\n * `:has()`: the element is right under that box.\n *\n * A class named anywhere else in the rule is in none, whatever else names it: beside the element,\n * inside `:host-context()`, or in `:not()` of a box the element is in. A test of the class\n * attribute is placed as a class is, by `classTestKey`.\n */\nfunction classPlaces(rule: StyleRule): {\n own: ReadonlySet<string>;\n inside: ReadonlySet<string>;\n beneath: ReadonlySet<string>;\n parentHas: ReadonlySet<string>;\n} {\n const own = new Set<string>();\n const inside = new Set<string>();\n const beneath = new Set<string>();\n const parentHas = new Set<string>();\n const elsewhere = new Set<string>();\n const below = { beneath, parentHas, elsewhere };\n const last = rule.compounds.length - 1;\n let under = true;\n for (let index = last; index >= 0; index--) {\n const compound = rule.compounds[index]!;\n if (index === last) {\n placeClasses(compound, own, inside, below);\n continue;\n }\n const joined = rule.combinators[index];\n under &&= joined === 'child' || joined === 'descendant';\n // A box the element is under, by its classes and by those it is asked to have or not to,\n // `.box:not(.busy) .row`: each is asked of that box, as its own are.\n const over = under ? inside : elsewhere;\n placeClasses(compound, over, over, below);\n }\n for (const name of elsewhere) {\n own.delete(name);\n inside.delete(name);\n beneath.delete(name);\n parentHas.delete(name);\n }\n return { own, inside, beneath, parentHas };\n}\n\n/**\n * The classes of a compound asked of the element a rule is for, into `at`, and of the compounds\n * it puts over that element, into `inside`. What any other part of it names goes `elsewhere`:\n * a part read here by name is one this knows the reach of, and one added later is not.\n */\nfunction placeClasses(\n compound: Compound,\n at: Set<string>,\n inside: Set<string>,\n below: Below,\n): void {\n const {\n classes,\n is,\n not,\n ancestors,\n parents,\n attributes,\n has,\n type: _t,\n id: _i,\n root: _r,\n pseudo: _p,\n ...rest\n } = compound;\n for (const name of namesOf(classes, attributes)) at.add(name);\n for (const alternatives of is ?? []) {\n for (const option of alternatives) placeClasses(option, at, inside, below);\n }\n for (const excluded of not ?? []) placeClasses(excluded, at, inside, below);\n // What is over the element is over it whichever of these said so, and what is over that is too.\n for (const above of [...(ancestors ?? []), ...(parents ?? [])]) {\n placeClasses(above, inside, inside, below);\n }\n placeHas(has, below);\n collectClasses(rest, below.elsewhere, []);\n}\n\n/** Where `classPlaces` puts what `:has()` asks, and what it can place nowhere. */\ninterface Below {\n readonly beneath: Set<string>;\n readonly parentHas: Set<string>;\n readonly elsewhere: Set<string>;\n}\n\n/**\n * The classes `:has()` asks of what is under the box that answers it, into `beneath`, wherever\n * in the rule it is written, or into `parentHas` for what `:has(> )` asks of the box's children.\n * One it can ask of what is above the box goes `elsewhere`: `:is()` in `:has()` is not relative,\n * so the `.night` of `:has(:is(.night .cell))` can be any element over the cell.\n */\nfunction placeHas(tests: readonly HasTest[] | undefined, below: Below): void {\n for (const test of tests ?? []) {\n const into = test.child ? below.parentHas : below.beneath;\n for (const compound of test.any) placeBeneath(compound, into, below);\n }\n}\n\n/** `placeHas` for one compound of a `:has()` argument, whose own classes go `into`. */\nfunction placeBeneath(compound: Compound, into: Set<string>, below: Below): void {\n const {\n classes,\n attributes,\n is,\n not,\n has,\n type: _t,\n id: _i,\n root: _r,\n pseudo: _p,\n ...rest\n } = compound;\n for (const name of namesOf(classes, attributes)) into.add(name);\n for (const alternatives of is ?? []) {\n for (const option of alternatives) placeBeneath(option, into, below);\n }\n for (const excluded of not ?? []) placeBeneath(excluded, into, below);\n placeHas(has, below);\n collectClasses(rest, below.elsewhere, []);\n}\n\n/** A compound's classes, and its tests of the class attribute, which are asked as its classes are. */\nfunction namesOf(\n classes: readonly string[],\n attributes: readonly AttributeTest[] | undefined,\n): readonly string[] {\n const tests = attributes?.filter((test) => test.name === 'class');\n return tests?.length ? [...classes, ...tests.map(classTestKey)] : classes;\n}\n\n/**\n * A test of the class attribute, `[class^=\"p-\"]`, by a name no class can have: it has a reach\n * as a class does, for what any class it answers can restyle.\n */\nconst classTestKey = (test: AttributeTest): string =>\n `\\0${test.operator ?? ''}${test.insensitive ? 'i' : ''}\\0${test.value ?? ''}`;\n\n/** What a rule declares, which names no element. */\nconst DECLARED = new Set(['declarations', 'important', 'tokens']);\n\n/**\n * Add each class under `value` to `into`, each test of the `class` attribute to `reads`, and the\n * name of every attribute asked about to `named`.\n */\nfunction collectClasses(\n value: unknown,\n into: Set<string>,\n reads: AttributeTest[],\n named?: Set<string>,\n): void {\n if (value === null || typeof value !== 'object') return;\n if (Array.isArray(value)) {\n return value.forEach((inner) => collectClasses(inner, into, reads, named));\n }\n const part = value as { classes?: unknown; attributes?: unknown };\n if (Array.isArray(part.classes)) for (const name of part.classes) into.add(String(name));\n if (Array.isArray(part.attributes)) {\n for (const test of part.attributes as AttributeTest[]) {\n named?.add(test.name);\n if (test.name !== 'class') continue;\n reads.push(test);\n into.add(classTestKey(test));\n }\n }\n for (const [key, inner] of Object.entries(value)) {\n if (!DECLARED.has(key)) collectClasses(inner, into, reads, named);\n }\n}\n\n/**\n * Whether a class coming or going could change what a test of the `class` attribute answers.\n * One class of the list where the test is for a whole class or for part of one; any class\n * where it is for how the list starts or ends, or for a part with a space in it.\n */\nfunction answers(test: AttributeTest, name: string): boolean {\n const value = test.value ?? '';\n const folded = test.insensitive ? name.toLowerCase() : name;\n if (test.operator === 'includes') return folded === value;\n if (test.operator === 'substring' && !/\\s/.test(value)) return folded.includes(value);\n return true;\n}\n\n/**\n * A class of the nearest box a rule's subject has to be in: the compound before it, where that\n * is joined as what holds it and names a class. Nothing where it is a sibling, or has no class.\n */\nfunction boxAround(rule: StyleRule): string | undefined {\n const joined = rule.combinators.at(-1);\n if (joined !== 'child' && joined !== 'descendant') return undefined;\n return rule.compounds.at(-2)?.classes[0];\n}\n\n/** Whether a rule among these could be for a node: never no where one is. */\nfunction writtenFor(of: Subjects, node: StyleTarget): boolean {\n if (of.any || of.types.has(node.tag)) return true;\n for (const name of node.classes ?? []) if (of.classes.has(name)) return true;\n if (!of.inside.size) return false;\n for (let over = node.parent; over; over = over.parent) {\n for (const name of over.classes ?? []) if (of.inside.has(name)) return true;\n }\n return false;\n}\n\n/**\n * Whether a node has its answer for this commit already. Not one marked since it was given the\n * one cache every box with nothing to style shares, see `unstyled`: another of them resolved in\n * this commit has set that cache's epoch, and it is not this node's answer.\n */\nfunction resolvedIn(epoch: number, cache: StyleCache | null, node: StyleTarget): boolean {\n return (\n cache !== null && cache.epoch === epoch && (!node.styleDirty || cache.context !== ROOT_CONTEXT)\n );\n}\n\nfunction emptyCacheFor(epoch: number, generation: number): StyleCache {\n return {\n epoch,\n generation,\n context: ROOT_CONTEXT,\n parentContext: ROOT_CONTEXT,\n scope: SHARED_SCOPE,\n parentScope: SHARED_SCOPE,\n style: EMPTY,\n inherited: EMPTY,\n tokens: NO_TOKENS,\n };\n}\n\n/**\n * A unitless line-height as a node hands it down. CSS inherits the number, not the points it comes\n * to where it is written, so a title under `.card { font-size: 10px; line-height: 2 }` with a\n * font size of 20 is 40 tall, not 20. It is only ever in an inherited map: `settleLineHeight`\n * turns it into points in every style a node renders with.\n */\ninterface LineHeightMultiple {\n readonly multiple: number;\n}\n\nfunction isMultiple(value: unknown): value is LineHeightMultiple {\n return typeof value === 'object' && value !== null && 'multiple' in value;\n}\n\n/** A line-height as points, for a node of font size `size`: what an em of it comes to. */\nfunction lineHeightPoints(line: LineHeightMultiple, size: unknown): number {\n const points = line.multiple * (typeof size === 'number' ? size : DEFAULT_FONT_SIZE);\n return Math.round(points * 1000) / 1000;\n}\n\n/** A node's style with a unitless line-height it set or inherited worked out against its font size. */\nfunction settleLineHeight(style: Record<string, unknown>): void {\n const line = style['lineHeight'];\n if (isMultiple(line)) style['lineHeight'] = lineHeightPoints(line, style['fontSize']);\n}\n\n/** The styles of nodes with no rules, by the map they inherit, for one that hands down a multiple. */\nconst unstyledStyles = new WeakMap<Record<string, unknown>, Record<string, unknown>>();\n\n/**\n * The style of a node no rule matches: what it inherits, with a unitless line-height worked out\n * against its font size, which an inline style can set. The same object where there is none.\n */\nfunction unstyledStyle(\n inherited: Record<string, unknown>,\n inline: Record<string, unknown> | null,\n): Record<string, unknown> {\n const line = inherited['lineHeight'];\n if (!isMultiple(line)) return inherited;\n const size = inline?.['fontSize'];\n if (typeof size === 'number') return { ...inherited, lineHeight: lineHeightPoints(line, size) };\n let style = unstyledStyles.get(inherited);\n if (!style) {\n style = { ...inherited, lineHeight: lineHeightPoints(line, inherited['fontSize']) };\n unstyledStyles.set(inherited, style);\n }\n return style;\n}\n\n/**\n * What this node's children inherit: the parent's map, overlaid with any inheritable value the\n * node set itself. Copied on first write only, so a node that sets none hands the same object on\n * and a whole subtree can share it.\n */\nfunction inheritFrom(\n parentInherited: Record<string, unknown>,\n own: Record<string, unknown>,\n): Record<string, unknown> {\n let inherited = parentInherited;\n for (const key of Object.keys(own)) {\n if (!INHERITED.has(key)) continue;\n // `pointer-events: inherit`, which only an inline style on an element no rule matches still\n // holds here: what the parent hands down stands.\n if (key === 'pointerEvents' && own[key] === 'inherit') continue;\n if (inherited === parentInherited) inherited = { ...parentInherited };\n if (key === 'pointerEvents' && !INHERITED_POINTER_EVENTS.has(own[key] as string)) {\n delete inherited[key];\n } else {\n inherited[key] = own[key];\n }\n }\n return inherited;\n}\n\n/**\n * A text decoration's colour, which travels with its line rather than inheriting on its own. A\n * decoration is drawn under the text inside the element that declares it, in that element's\n * decoration colour or its text colour, and a text's own decoration colour only colours a line it\n * declares itself. `style` is the node's, and gets the colour its line is drawn in; what its\n * children inherit is returned.\n */\nfunction decorate(\n style: Record<string, unknown>,\n inherited: Record<string, unknown>,\n own: Record<string, unknown>,\n): Record<string, unknown> {\n const declared = own['textDecorationLine'] !== undefined;\n // With no line declared here or above, nothing is drawn and the colour is left as computed.\n if (!declared && !drawsLine(inherited['textDecorationLine'])) return inherited;\n const colour = declared\n ? (own['textDecorationColor'] ?? style['color'])\n : inherited['textDecorationColor'];\n if (colour === undefined) delete style['textDecorationColor'];\n else style['textDecorationColor'] = colour;\n if (!declared || inherited['textDecorationColor'] === colour) return inherited;\n const { textDecorationColor: _parent, ...rest } = inherited;\n return colour === undefined ? rest : { ...rest, textDecorationColor: colour };\n}\n\nfunction drawsLine(line: unknown): boolean {\n return line !== undefined && line !== 'none';\n}\n\n/** Whether an inline style sets a property children inherit. Allocates nothing: it runs per set. */\nexport function setsInherited(style: unknown): boolean {\n if (!style || typeof style !== 'object') return false;\n if (Array.isArray(style)) return style.some(setsInherited);\n for (const key in style) {\n if (INHERITED.has(key) && (style as Record<string, unknown>)[key] != null) return true;\n }\n return false;\n}\n\n/**\n * The inherited properties a node's inline style sets, or null for none. Inline style is the\n * strongest normal declaration on its element, so what it sets is inherited, and read by\n * `color: inherit` and `currentColor`, as a rule's would be.\n */\nexport function inlineInherited(style: unknown): Record<string, unknown> | null {\n let out: Record<string, unknown> | null = null;\n // Flattened first, as native applies it, so a later entry's null clears an earlier value.\n for (const [key, value] of Object.entries(flattenInline(style, {}))) {\n if (INHERITED.has(key) && value !== undefined && value !== null) (out ??= {})[key] = value;\n }\n return out;\n}\n\nfunction flattenInline(style: unknown, into: Record<string, unknown>): Record<string, unknown> {\n if (Array.isArray(style)) for (const entry of style) flattenInline(entry, into);\n else if (style && typeof style === 'object') Object.assign(into, style);\n return into;\n}\n\n/**\n * The runtime half of CSS for one engine: the global sheet, the conditions media queries are\n * evaluated against, and the memo that makes resolution cost nodes x rules rather than\n * nodes x rules x depth.\n *\n * One per engine rather than module state, so two surfaces in one process (or two engines in\n * one test) cannot overwrite each other's sheet or viewport.\n *\n * Inherited state is pushed **down** rather than walked up: a node takes what its parent already\n * resolved and overlays its own declarations. That is how real CSS engines do it, and it matters\n * for two separate reasons.\n *\n * Correctness first. Walking up meant matching every ancestor against the *starting node's*\n * sheet, but an ancestor almost always belongs to a different component, so a component's rules\n * reached nodes it did not own while a parent's real values never arrived. Reading `sheet` off\n * each node fixes both directions at once.\n *\n * Cost second. Walking up re-derived, for every node, everything its parent had already worked\n * out. Memoising by epoch makes it nodes x rules, and a node that sets no inheritable value hands\n * its parent's map straight on rather than copying it, so the common case allocates nothing.\n */\nexport class StyleResolver {\n private conditions: Conditions;\n /**\n * Bumped whenever the conditions move. Every cached result and every per-rule condition memo\n * is stamped with it, so a rotation or a theme switch invalidates the lot in one assignment\n * rather than walking the tree.\n */\n private generation = ++generations;\n private emptyCache = emptyCacheFor(-1, -1);\n /**\n * The rules a node is matched against, merged across the global sheet, the sheet of the\n * component it hosts and the sheet that created it, sorted once by weight and then filed by key\n * selector. Keyed by the creating sheet and then the hosted one, so a component's nodes share a\n * single index.\n */\n /** The global sheet and every sheet added to it, filed by key selector. See `rulesFor`. */\n private filed: RuleIndex | null = null;\n /** How many of the added sheets `filed` holds: one added since is filed at the next read. */\n private filedAdded = 0;\n /** A component's own sheet, indexed once for each place it can take: a host's, or its creator's. */\n private readonly ownIndexes = new WeakMap<StyleSheet, (RuleIndex | undefined)[]>();\n /**\n * Whether any sheet merged so far has a rule in a cascade layer. Until one does, rules are\n * ordered by weight alone and the cascade does not look for layers, which is nearly every app.\n * It stays set once a layered sheet has gone, which costs a look at each cascade and no more.\n */\n private layered = false;\n /**\n * Every layer the sheets seen so far have named, in the order each name was first seen, which\n * is the one order a document has for them. A name keeps its place when its sheet is replaced.\n */\n private readonly layerNames: LayerNames = { place: 0, nested: new Map() };\n /** Each layered rule's place among them, set when its sheet is first merged. */\n private readonly layerPlaces = new WeakMap<StyleRule, LayerPlace>();\n private readonly layeredSheets = new WeakSet<StyleSheet>();\n private unnamedLayers = 0;\n\n /**\n * The application-level sheet, if any: the one set of rules allowed to match a node whatever\n * component created it, which is what resets, utility classes and `:root` tokens all need.\n */\n private readonly globalSheet: StyleSheet | null;\n\n /**\n * Global sheets added once the engine is running, in the order they came: a\n * `ViewEncapsulation.None` component's, which a browser adds to the document unscoped when the\n * component first renders, after the application's own. See `addGlobalSheet`.\n */\n private readonly addedSheets: StyleSheet[] = [];\n\n /**\n * Custom properties the host supplies rather than the stylesheet: the safe-area insets, and\n * whatever else is a property of the device instead of the design.\n *\n * Seeded rather than forced. They stand in for the root's inherited tokens, so a `:root` rule\n * in the app's own sheet overrides them the way it would override anything it inherited, and an\n * app that wants to pin an inset for a tablet layout or a screenshot still can.\n */\n private tokensOnRoot: Readonly<Record<string, TokenValue>> = NO_TOKENS;\n\n /** What the host has supplied so far, so a second source can add to it rather than replace it. */\n get rootTokens(): Readonly<Record<string, TokenValue>> {\n return this.tokensOnRoot;\n }\n\n /**\n * Told of a `var()` that names a custom property nothing in scope defines and has no fallback,\n * which is dropped. Set only in development, where it is how the engine says so.\n */\n onUndefinedToken: ((name: string, props: readonly string[], on?: string) => void) | null = null;\n\n /**\n * Told of a `display: var()` whose token holds no display native has, `grid` or `table`, which\n * leaves display unset. Set only in development, where it is how the engine says so: the\n * compiler refuses the same value written out, but a token is only known here.\n */\n onUnreadDisplay: ((name: string, value: string | undefined) => void) | null = null;\n\n constructor(globalSheet: StyleSheet | null, conditions: Conditions) {\n this.globalSheet = globalSheet;\n this.conditions = conditions;\n }\n\n /**\n * Match `sheet` against every node from now on, as a global sheet, after the application's;\n * false when it already is. Every cached result goes, as on a theme switch: rules that were not\n * there can now match anything. `:host` in it matches nothing, since no node hosts it.\n *\n * With `replacing`, a sheet added before, it takes that one's place, and so its order: a hot\n * swap of the component's CSS edits the sheet where it is.\n */\n addGlobalSheet(sheet: StyleSheet, replacing?: StyleSheet): boolean {\n if (sheet === this.globalSheet || this.addedSheets.includes(sheet)) return false;\n const at = replacing ? this.addedSheets.indexOf(replacing) : -1;\n if (at === -1) this.addedSheets.push(sheet);\n else {\n this.addedSheets[at] = sheet;\n this.forgetBeside(replacing!);\n }\n this.noteBeside(sheet);\n // One added at the end is filed after what is there. One in another's place files them all again.\n if (at !== -1) this.filed = null;\n const before = this.generation;\n this.generation = ++generations;\n // One that takes another's place can change what any node comes to. One that names layers\n // cannot: a layer has its place from the first sheet to name it, and a new name comes last.\n if (at !== -1) this.additions.length = 0;\n else this.additions.push({ before, after: this.generation, subjects: subjectsOf(sheet) });\n return true;\n }\n\n /**\n * The sheets added one after another with nothing else changed between them, each with the\n * generation it began and ended: a cache made before them still stands for a node none of\n * them could match. Emptied by anything else that moves the generation on.\n */\n private readonly additions: Addition[] = [];\n\n /** Whether a sheet could match a node: one of its rules is written for it. */\n couldMatch(sheet: StyleSheet, node: StyleTarget): boolean {\n return writtenFor(subjectsOf(sheet), node);\n }\n\n /** How far each class named by the sheets met so far reaches: see `classReach`. */\n private readonly reach: ClassReach = new Map();\n /** The tests of the `class` attribute itself in those sheets, which any class may answer. */\n private readonly classTests = new Map<string, AttributeTest>();\n private readonly noted = new WeakSet<StyleSheet>();\n /**\n * The sheets with a rule written with `::ng-deep`, which is for what is under the component\n * in the views of the components it holds. None in most apps, and nothing is asked then.\n */\n private readonly deepSheets = new Set<StyleSheet>();\n private readonly deepIndexes = new WeakMap<StyleSheet, RuleIndex>();\n\n /**\n * Read the classes a sheet names, once, as soon as any node is given it. One `scoped` to a\n * component or a host asks of its elements for good, global or not.\n */\n noteSheet(sheet: StyleSheet | null | undefined, scoped = false): void {\n if (!sheet) return;\n if (scoped) this.scoped.add(sheet);\n this.noteBeside(sheet);\n if (this.noted.has(sheet)) return;\n this.noted.add(sheet);\n if (sheet.rules.some((rule) => rule.deep)) this.deepSheets.add(sheet);\n const { classes, reads, named } = classReach(sheet);\n for (const [name, how] of classes) this.noteReach(name, how);\n for (const test of reads) this.classTests.set(classTestKey(test), test);\n for (const name of named) this.named.add(name);\n }\n\n /** The props a selector of some sheet asks about: an id, and each attribute by its name. */\n private readonly named = new Set<string>(['nativeID']);\n\n /**\n * Whether a prop changing can change what any element matches: only where a selector of a\n * sheet that was ever loaded names it. A sheet loaded later has every element matched again.\n */\n reads(prop: string): boolean {\n return this.named.has(prop);\n }\n\n /**\n * By prop, how many sheets in play ask it of an element before another: see `namedBeside`. A\n * global sheet taken away, or replaced, asks no more.\n */\n private readonly besideNamed = new Map<string, number>();\n private readonly besideNoted = new WeakSet<StyleSheet>();\n /** The sheets a component or a host was given: see `noteSheet`. */\n private readonly scoped = new WeakSet<StyleSheet>();\n\n private noteBeside(sheet: StyleSheet): void {\n if (this.besideNoted.has(sheet)) return;\n this.besideNoted.add(sheet);\n for (const name of namedBeside(sheet)) {\n this.besideNamed.set(name, (this.besideNamed.get(name) ?? 0) + 1);\n }\n }\n\n private forgetBeside(sheet: StyleSheet): void {\n if (this.scoped.has(sheet) || !this.besideNoted.delete(sheet)) return;\n for (const name of namedBeside(sheet)) {\n const left = this.besideNamed.get(name)! - 1;\n if (left) this.besideNamed.set(name, left);\n else this.besideNamed.delete(name);\n }\n }\n\n /** Whether a prop changing can change what the elements after its element match. */\n readsBeside(prop: string): boolean {\n return this.besideNamed.has(prop);\n }\n\n private noteReach(name: string, how: true | Subjects): void {\n const had = this.reach.get(name);\n if (had === true) return;\n if (how === true) this.reach.set(name, true);\n else addSubjects(had ?? (this.reach.set(name, noSubjects()).get(name) as Subjects), how);\n }\n\n /** Whether a class's reach names any element under the one that has it. */\n reachesUnder(subjects: Subjects): boolean {\n return (\n subjects.any ||\n subjects.classes.size > 0 ||\n subjects.types.size > 0 ||\n subjects.inside.size > 0\n );\n }\n\n /**\n * What classes coming to an element or going from it can restyle: `true` for it and all\n * under it and after it, as any change to it does; the element itself, where `own`, and the\n * elements under it to match again, by what rules are for; or null, where no rule names any\n * of them and nothing is styled again.\n */\n reachOf(classes: Iterable<string>): true | Subjects | null {\n let found: Subjects | null = null;\n for (const name of classes) {\n for (const how of this.reachesOf(name)) {\n if (how === true) return true;\n addSubjects((found ??= noSubjects()), how);\n }\n }\n return found;\n }\n\n /** How far a class reaches by its name, and by each test of the class attribute it answers. */\n private *reachesOf(name: string): Generator<true | Subjects> {\n const how = this.reach.get(name);\n if (how) yield how;\n for (const [key, test] of this.classTests) {\n if (answers(test, name)) yield this.reach.get(key) ?? true;\n }\n }\n\n /** Whether one of the rules `subjects` stands for could be for a node. */\n isFor(subjects: Subjects, node: StyleTarget): boolean {\n styleStats.subjectTests++;\n return writtenFor(subjects, node);\n }\n\n /**\n * Whether a cache is of this generation, or of one before sheets that could not match the\n * node were added, which leaves it as it was: it is then brought up to this one.\n */\n private current(cached: StyleCache, node: StyleTarget): boolean {\n if (cached.generation === this.generation) return true;\n // The one cache shared by every node with nothing to style is not one node's to move on.\n if (cached.context === ROOT_CONTEXT) return false;\n let at = cached.generation;\n for (const added of this.additions) {\n if (added.before !== at) continue;\n if (writtenFor(added.subjects, node)) return false;\n at = added.after;\n }\n if (at !== this.generation) return false;\n cached.generation = at;\n return true;\n }\n\n /** Stop matching a sheet `addGlobalSheet` added; false when it is not one. */\n removeGlobalSheet(sheet: StyleSheet): boolean {\n const at = this.addedSheets.indexOf(sheet);\n if (at === -1) return false;\n this.addedSheets.splice(at, 1);\n this.forgetBeside(sheet);\n this.filed = null;\n this.additions.length = 0;\n this.generation = ++generations;\n return true;\n }\n\n setConditions(next: Conditions): void {\n this.conditions = next;\n this.additions.length = 0;\n this.generation = ++generations;\n }\n\n setRootTokens(next: Readonly<Record<string, TokenValue>>): void {\n this.tokensOnRoot = next;\n this.additions.length = 0;\n this.generation = ++generations;\n }\n\n /**\n * Resolve a node, memoised for the life of one epoch.\n *\n * `epoch` scopes the memo. The engine bumps it once per commit, so within a commit each node\n * resolves at most once however many descendants ask for its inherited values.\n */\n resolve(node: StyleTarget, epoch: number): StyleCache {\n const cached = node.styleCache;\n // Within one commit a node is asked for its inherited map once per descendant, so this is the\n // hot path and it must not walk anywhere.\n if (resolvedIn(epoch, cached, node)) return cached!;\n\n const parent = node.parent ? this.resolve(node.parent, epoch) : null;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n\n // Across commits: nothing about this node changed and nothing above it moved, so the last\n // answer still holds. Reusing the object, rather than recomputing an equal one, is what lets\n // a descendant tell \"unchanged\" from \"changed\" by reference alone.\n if (this.reusable(cached, node, parentContext)) {\n cached.epoch = epoch;\n return cached;\n }\n const kept = this.kept(node, parentContext, epoch);\n // The rules it was just found to match, where they are not the ones it did. Taken here\n // whether or not they are used, so that none is left for the next node resolved.\n const found = this.justMatched;\n this.justMatched = null;\n if (kept) return kept;\n\n return this.styledAgain(node, epoch, parent, found);\n }\n\n /** A node styled now, from the rules found for it or from those it kept: see `matchesStand`. */\n private styledAgain(\n node: StyleTarget,\n epoch: number,\n parent: StyleCache | null,\n found: readonly StyleRule[] | null,\n ): StyleCache {\n const cached = node.styleCache;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n const parentInherited = parent ? parent.inherited : EMPTY;\n const parentScope = parent ? parent.scope : ROOT_SCOPE;\n const stands = this.matchesStand(cached, node, parentScope);\n // The scope it keeps, or none: it then has a new one, which its new `context` serves as.\n const scope = stands ? cached!.scope : null;\n\n // A box the engine made around loose text is in no template, so no rule matches it.\n if (node.anonymous || this.hasNoRules(node)) {\n return this.unstyled(node, epoch, parent, parentInherited, scope, parentScope);\n }\n\n styleStats.nodesResolved++;\n\n const rules = stands ? rulesKept(cached!, node) : undefined;\n const matched = found ?? rules ?? this.matchedBy(node);\n const parentTokens = parent ? parent.tokens : this.tokensOnRoot;\n this.heir(node, parent, matched);\n const styled = this.styled(node, matched, parentTokens, parentInherited);\n\n const cache = this.cached(epoch, parentContext, styled, matched, scope, parentScope);\n node.styleCache = cache;\n node.styleDirty = false;\n node.ownDirty = false;\n node.hasDirty = false;\n node.stateDirty = false;\n return cache;\n }\n\n /**\n * Whether what an element could match is as it was when it was last styled: nothing that can\n * change it was marked on the element, its parent's `scope` is the one it was styled under,\n * and no sheet that could match it has come since. It is being styled again all the same, for\n * a change of its own that alters nothing under it, or for what it inherits.\n *\n * A change beneath it is not one: what it answers `:has()` is asked again, and the elements a\n * rule asking that of it is for are marked on their own (`markUnderHas`), not all under it.\n */\n private matchesStand(cached: StyleCache | null, node: StyleTarget, parentScope: object): boolean {\n return (\n cached !== null &&\n !node.styleDirty &&\n !node.stateDirty &&\n cached.scope !== SHARED_SCOPE &&\n parentScope !== SHARED_SCOPE &&\n cached.parentScope === parentScope &&\n this.current(cached, node)\n );\n }\n\n /**\n * A cache of a node just styled, with a context of its own. It keeps the rules the node\n * matched, for the node to be compared with, once a sheet has a use for them: see `tracksHas`.\n */\n private cached(\n epoch: number,\n parentContext: object,\n styled: Styled,\n matched: readonly StyleRule[],\n scope: object | null,\n parentScope: object,\n ): StyleCache {\n const context = {};\n const cache: StyleCache = {\n epoch,\n generation: this.generation,\n context,\n parentContext,\n scope: scope ?? context,\n parentScope,\n rules: matched,\n ...styled,\n };\n if (this.tracksHas) cache.matched = matched;\n return cache;\n }\n\n /**\n * Set by the engine once a sheet uses `:has()`, styles a pressed element or asks about a place\n * in a child list. Until then no cache keeps the rules it matched, so an app that never asks\n * pays nothing for it.\n */\n tracksHas = false;\n\n /**\n * The cache of a node whose subtree changed, and nothing else, when it matches the rules it\n * did: keeping the object is what leaves everything under it alone. Nothing when it has to be\n * resolved, as it does with no record of what it matched, made before any sheet asked.\n */\n private keptBeneath(node: StyleTarget, parentContext: object, epoch: number): StyleCache | null {\n const cached = node.styleCache;\n const stands =\n (node.hasDirty === true || node.stateDirty === true) &&\n cached?.matched !== undefined &&\n !node.styleDirty &&\n !node.ownDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node);\n if (!stands) return null;\n const now = this.matchedBy(node);\n const before = cached.matched!;\n if (now.length !== before.length || now.some((rule, i) => rule !== before[i])) {\n // It is styled again next, from the rules just found rather than from finding them twice.\n this.justMatched = now;\n return null;\n }\n node.hasDirty = false;\n node.stateDirty = false;\n cached.epoch = epoch;\n return cached;\n }\n\n /** The rules a node matches now, weakest first. */\n private matchedBy(node: StyleTarget): readonly StyleRule[] {\n const candidates = this.rulesFor(node);\n return this.matched(node, node.styled ? ELEMENT_ENTRIES.concat(candidates) : candidates);\n }\n\n /**\n * The rules `keptBeneath` found the node being resolved to match, where they are other than\n * it matched before: it is styled from them next, rather than matched a second time.\n */\n private justMatched: readonly StyleRule[] | null = null;\n\n /** A cache that still stands for a node marked for its subtree or its state alone. */\n private kept(node: StyleTarget, parentContext: object, epoch: number): StyleCache | null {\n return (\n this.keptBeneath(node, parentContext, epoch) ?? this.keptUnmatched(node, parentContext, epoch)\n );\n }\n\n /**\n * The cache of a node whose pressed state changed and nothing else, where no rule can match\n * it at all: it has no style of its own to change, so it and all under it stay as they are.\n */\n private keptUnmatched(\n node: StyleTarget,\n parentContext: object,\n epoch: number,\n ): StyleCache | null {\n const cached = node.styleCache;\n const stands =\n node.stateDirty === true &&\n cached !== null &&\n !node.styleDirty &&\n !node.ownDirty &&\n !node.hasDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node) &&\n (node.anonymous === true || this.hasNoRules(node));\n if (!stands) return null;\n node.stateDirty = false;\n cached.epoch = epoch;\n return cached;\n }\n\n /**\n * Whether a node's last answer still stands under a parent that resolved to `parentContext`,\n * without resolving it. What lets a commit step over a clean child in one comparison.\n */\n holds(node: StyleTarget, parentContext: object): boolean {\n return this.reusable(node.styleCache, node, parentContext);\n }\n\n /**\n * Whether a node was last styled under a box holding the one cache shared by every box with\n * nothing to style. Such boxes hand the same `context` down, so the node cannot tell one from\n * another by it: moved under another box, it has to be told.\n */\n styledUnderShared(node: StyleTarget): boolean {\n return node.styleCache !== null && node.styleCache.parentContext === ROOT_CONTEXT;\n }\n\n /**\n * Whether a previous result still stands: nothing about the node changed, nothing above it\n * moved, and the conditions have not.\n */\n private reusable(\n cached: StyleCache | null,\n node: StyleTarget,\n parentContext: object,\n ): cached is StyleCache {\n return (\n cached !== null &&\n !node.styleDirty &&\n !node.ownDirty &&\n !node.hasDirty &&\n !node.stateDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node)\n );\n }\n\n /**\n * Nothing anywhere can match this node, and it sets no custom property of its own, so its style\n * is whatever it inherits.\n */\n private hasNoRules(node: StyleTarget): boolean {\n return (\n node.sheet === null &&\n node.hostSheet === null &&\n this.deepSheets.size === 0 &&\n this.globalSheet === null &&\n this.addedSheets.length === 0 &&\n !node.customProperties &&\n !node.boundStyle &&\n !node.styled\n );\n }\n\n /**\n * A node with no rules anywhere: it renders with what it inherits and passes the same map on.\n *\n * It still mints a context, because a rule further down may match on one of *its* classes.\n * When there is nothing to inherit either, one shared cache object serves every such node, so\n * an application that writes no CSS allocates nothing per node. Not when there are tokens to\n * carry: the shared object holds none, and the surface root answering with it dropped every\n * token the device had seeded.\n */\n private unstyled(\n node: StyleTarget,\n epoch: number,\n parent: StyleCache | null,\n parentInherited: Record<string, unknown>,\n scope: object | null,\n parentScope: object,\n ): StyleCache {\n const tokens = parent ? parent.tokens : this.tokensOnRoot;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n // What inline style sets is inherited too, with no rule to read it against.\n const inline = node.inlineInherits ? inlineInherited(node.props['style']) : null;\n const nothing =\n !inline &&\n parentInherited === EMPTY &&\n parentContext === ROOT_CONTEXT &&\n tokens === NO_TOKENS;\n if (nothing && !node.styleDirty && !node.ownDirty) return this.sharedEmpty(node, epoch);\n\n const context = {};\n const passthrough: StyleCache = {\n epoch,\n generation: this.generation,\n context,\n parentContext,\n scope: scope ?? context,\n parentScope,\n style: unstyledStyle(parentInherited, inline),\n inherited: inline ? inheritFrom(parentInherited, inline) : parentInherited,\n tokens,\n };\n node.styleCache = passthrough;\n node.styleDirty = false;\n node.ownDirty = false;\n node.stateDirty = false;\n return passthrough;\n }\n\n /** The one cache of every node with nothing to style and nothing to hand down, given to one more. */\n private sharedEmpty(node: StyleTarget, epoch: number): StyleCache {\n if (this.emptyCache.epoch !== epoch || this.emptyCache.generation !== this.generation) {\n this.emptyCache = emptyCacheFor(epoch, this.generation);\n }\n node.styleCache = this.emptyCache;\n return this.emptyCache;\n }\n\n /**\n * The rules worth trying against a node, in cascade order.\n *\n * Every sheet is filed once, by key selector: the app's global sheet and each sheet added to it\n * in one index, and a component's own in one of its own. What comes back is only the buckets\n * this node can reach. A global utility sheet is hundreds of rules and a screen is a thousand\n * nodes, and the difference is between a million match attempts and a few thousand. A library\n * adds a sheet for each of its components as the component first renders, dozens on one\n * screen, so one more is added to what is filed and nothing is filed again.\n *\n * Sheets are filed in the order a document holds them, which is the order of two rules of the\n * same weight, and where a layer gets its place: the app's global sheet, the host's own, the\n * creating component's, then each added sheet as it came. The component layers get a small\n * specificity bump, so the encapsulation attribute Angular adds on the web does not have to\n * be written.\n *\n * A sheet added with `addGlobalSheet` comes last, with no bump: a browser adds a None\n * component's CSS when the component first renders, after the styles of the components around\n * it, so it loses to their extra attribute and wins a tie with them.\n */\n private rulesFor(node: StyleTarget): readonly RuleEntry[] {\n if (this.globalSheet) this.placeLayers(this.globalSheet);\n const indexes: RuleIndex[] = [];\n if (node.hostSheet) indexes.push(this.ownIndex(node.hostSheet, HOSTS));\n if (node.sheet) indexes.push(this.ownIndex(node.sheet, CREATED));\n if (this.deepSheets.size) this.reachedFromAbove(node, indexes);\n indexes.push(this.sharedIndex());\n return candidateRules(node, indexes, this.cascadeOrder);\n }\n\n /**\n * Add the `::ng-deep` rules of each component a node is in whose sheet is not the node's own:\n * a node is tried against its own component's rules already, those among them.\n */\n private reachedFromAbove(node: StyleTarget, indexes: RuleIndex[]): void {\n for (let up = node.parent; up; up = up.parent) {\n const sheet = up.hostSheet;\n if (!sheet || sheet === node.sheet || sheet === node.hostSheet) continue;\n if (this.deepSheets.has(sheet)) indexes.push(this.deepIndex(sheet));\n }\n }\n\n /** A sheet's `::ng-deep` rules alone, filed as a component's own are. */\n private deepIndex(sheet: StyleSheet): RuleIndex {\n let index = this.deepIndexes.get(sheet);\n if (!index) {\n const deep = this.entries(sheet, COMPONENT_SPECIFICITY_BUMP).filter(({ rule }) => rule.deep);\n this.deepIndexes.set(sheet, (index = indexRules(deep, undefined, HOSTS * SHEET_ROOM)));\n }\n return index;\n }\n\n /** Weakest first: by layer where any sheet has one, then by weight, then as they were filed. */\n private readonly cascadeOrder = (a: IndexedEntry, b: IndexedEntry): number => {\n const layers = this.layered\n ? layerOrder(this.layerPlaces.get(a.entry.rule), this.layerPlaces.get(b.entry.rule))\n : 0;\n return layers || a.entry.weight - b.entry.weight || a.at - b.at;\n };\n\n /** A component's sheet as the rules of a host or of a creator, which differ only in their place. */\n private ownIndex(sheet: StyleSheet, role: typeof HOSTS | typeof CREATED): RuleIndex {\n let roles = this.ownIndexes.get(sheet);\n if (!roles) this.ownIndexes.set(sheet, (roles = []));\n return (roles[role] ??= indexRules(\n this.entries(sheet, COMPONENT_SPECIFICITY_BUMP),\n undefined,\n role * SHEET_ROOM,\n ));\n }\n\n /** The app's global sheet and every sheet added to it, with any added since the last read. */\n private sharedIndex(): RuleIndex {\n if (!this.filed) {\n this.filed = { buckets: new Map(), universal: [] };\n this.filedAdded = 0;\n if (this.globalSheet) indexRules(this.entries(this.globalSheet, 0), this.filed, 0);\n }\n for (; this.filedAdded < this.addedSheets.length; this.filedAdded++) {\n const from = (ADDED + this.filedAdded) * SHEET_ROOM;\n indexRules(this.entries(this.addedSheets[this.filedAdded]!, 0), this.filed, from);\n }\n return this.filed;\n }\n\n /** A sheet's rules at their weight here, with its layers given their places. */\n private entries(sheet: StyleSheet, bump: number): RuleEntry[] {\n this.placeLayers(sheet);\n if (sheet.rules.some((rule) => rule.layer !== undefined)) this.layered = true;\n return sheet.rules.map((rule) => ({ rule, sheet, weight: rule.specificity + bump }));\n }\n\n /**\n * Gives each of a sheet's layers its place among every sheet's, the first time the sheet is\n * merged, and each of its layered rules that place. Sheets are merged in the order a document\n * holds them: the app's global sheet, then each component's as it first renders.\n */\n private placeLayers(sheet: StyleSheet): void {\n if (!sheet.layers || this.layeredSheets.has(sheet)) return;\n this.layeredSheets.add(sheet);\n // A block with no name is a layer of this sheet's alone.\n const unnamed = `\\0${this.unnamedLayers++}`;\n const places = sheet.layers.map((path) => {\n const place: number[] = [];\n let names = this.layerNames;\n for (const part of path) {\n const name = part.startsWith('\\0') ? unnamed + part : part;\n let nested = names.nested.get(name);\n if (!nested)\n names.nested.set(name, (nested = { place: names.nested.size, nested: new Map() }));\n place.push(nested.place);\n names = nested;\n }\n return place;\n });\n for (const rule of sheet.rules) {\n if (rule.layer !== undefined) this.layerPlaces.set(rule, places[rule.layer]!);\n }\n }\n\n /**\n * A node's style from the rules it matched, shared with every other node that matched the same\n * rules under the same inherited values and tokens: a list's rows, and what is inside each.\n *\n * Everything past matching depends on those alone, and it is most of the work where a sheet\n * leaves values to the device: settling each `var()`, mixing colours, filling a shadow's slots.\n * A node that sets custom properties of its own is worked out alone. What is shared is never\n * written to after, so sharing it is safe; each node still has a cache and a context of its own.\n */\n private styled(\n node: StyleTarget,\n matched: readonly StyleRule[],\n parentTokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n ): Styled {\n // Shared between nodes that match alike, unless the node sets something of its own.\n const inline = node.inlineInherits ? inlineInherited(node.props['style']) : null;\n // Nor one that takes a value from its parent's own style, which two parents differ in.\n if (node.customProperties || inline || node.boundStyle || matched.some(takesParents)) {\n return this.style(node, matched, parentTokens, parentInherited, inline);\n }\n if (this.sharedGeneration !== this.generation) {\n this.shared.clear();\n this.sharedGeneration = this.generation;\n }\n const key = matched.map((rule) => this.ruleId(rule)).join(',');\n let byTokens = this.shared.get(key);\n if (!byTokens) this.shared.set(key, (byTokens = new WeakMap()));\n let byInherited = byTokens.get(parentTokens);\n if (!byInherited) byTokens.set(parentTokens, (byInherited = new WeakMap()));\n let styled = byInherited.get(parentInherited);\n if (!styled) {\n styled = this.style(node, matched, parentTokens, parentInherited);\n byInherited.set(parentInherited, styled);\n }\n return styled;\n }\n\n private readonly shared = new Map<\n string,\n WeakMap<object, WeakMap<Record<string, unknown>, Styled>>\n >();\n private sharedGeneration = 0;\n private readonly ruleIds = new WeakMap<StyleRule, number>();\n private nextRuleId = 0;\n\n private ruleId(rule: StyleRule): number {\n let id = this.ruleIds.get(rule);\n if (id === undefined) this.ruleIds.set(rule, (id = this.nextRuleId++));\n return id;\n }\n\n /** A node's style from the rules it matched, worked out. */\n private style(\n node: StyleTarget,\n matched: readonly StyleRule[],\n parentTokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n inline: Record<string, unknown> | null = null,\n ): Styled {\n // Inline style is the last normal declaration, under every important one.\n const bound = node.boundStyle;\n const result = this.cascade(\n inline || bound\n ? [\n ...matched,\n { declarations: inline ?? EMPTY, ...(bound && { deferred: bound }) } as StyleRule,\n ]\n : matched,\n parentInherited,\n );\n\n // Tokens are in scope for this node's own declarations as well as its descendants', so they\n // are merged before any `var()` here is resolved.\n const tokens = tokensInScope(\n parentTokens,\n result.tokens,\n node.customProperties,\n result.importantTokens,\n );\n\n const own = result.declarations;\n if (result.deferred) {\n this.applyDeferred(result.deferred, own, tokens, parentInherited, result.important);\n }\n settleBorders(own);\n // `pointer-events: inherit` won the cascade: what the parent hands down stands.\n if (own['pointerEvents'] === 'inherit') delete own['pointerEvents'];\n const style = { ...parentInherited, ...own };\n settleLineHeight(style);\n const inherited = decorate(style, inheritFrom(parentInherited, own), own);\n const rtl = (style['direction'] ?? this.conditions.direction) === 'rtl';\n const important = importantNames(result, () => TWIN[rtl ? 'rtl' : 'ltr']);\n return important ? { style, inherited, tokens, important } : { style, inherited, tokens };\n }\n\n /** The rules that apply to a node, weakest first. */\n private matched(node: StyleTarget, entries: readonly RuleEntry[]): StyleRule[] {\n const out: StyleRule[] = [];\n // What the node's ancestors are, gathered for the first rule that names one.\n let above: Bits | undefined;\n for (const { rule, sheet } of entries) {\n if (!this.conditionHolds(rule)) continue;\n const named = namedAbove(rule);\n if (named && lacks((above ??= bitsAbove(node)), named)) continue;\n if (matches(node, rule, sheet)) out.push(rule);\n }\n return out;\n }\n\n /** The declarations of the rules a node matched. The list is sorted, so later simply wins. */\n private cascade(\n matched: readonly StyleRule[],\n parentInherited: Record<string, unknown>,\n ): CascadeResult {\n const normal: Record<string, unknown> = {};\n const important: Record<string, unknown> = {};\n let hasImportant = false;\n let tokens: Record<string, TokenValue> | null = null;\n let importantTokens: Record<string, TokenValue> | null = null;\n let deferred: DeferredDeclaration[] | null = null;\n const forms = new OtherForms(() => this.directionOf(matched, parentInherited));\n\n for (const rule of this.layered ? byImportance(matched, this.layerPlaces) : matched) {\n deferred = forms.before(rule, normal, important, deferred);\n Object.assign(normal, rule.declarations);\n if (rule.important) {\n Object.assign(important, rule.important);\n hasImportant = true;\n }\n if (rule.tokens) Object.assign((tokens ??= {}), rule.tokens);\n // An important custom property beats every plain one, whatever the rules' order.\n if (rule.importantTokens) {\n Object.assign((importantTokens ??= {}), pick(rule.tokens!, rule.importantTokens));\n }\n deferred = forms.within(rule, normal, important, carryDeferred(deferred, rule));\n }\n if (importantTokens) Object.assign(tokens!, importantTokens);\n deferred = forms.after(normal, deferred);\n\n return {\n declarations: hasImportant ? { ...normal, ...important } : normal,\n important: hasImportant ? important : null,\n tokens,\n importantTokens,\n deferred,\n };\n }\n\n /**\n * An inline style over the style the cascade settled, both already in `style`: a corner or an\n * edge the inline style sets takes the other form of it out, as a later rule would.\n */\n overOtherForms(inline: Readonly<Record<string, unknown>>, style: Record<string, unknown>): void {\n let twin: Readonly<Record<string, string>> | null = null;\n const written = Object.keys(inline);\n for (const [at, key] of written.entries()) {\n if (!(key in TWIN.ltr)) continue;\n twin ??= TWIN[this.readsRightToLeft(style) ? 'rtl' : 'ltr'];\n const other = twin[key]!;\n // Where the inline style sets both, the one it set later stands.\n if (written.indexOf(other) < at) delete style[other];\n }\n }\n\n /** Whether a settled style is of an element read right to left: by its own, or the app's. */\n readsRightToLeft(style: Readonly<Record<string, unknown>>): boolean {\n return (style['direction'] ?? this.conditions.direction) === 'rtl';\n }\n\n /**\n * The direction an element is laid out in: the last `direction` its own rules give it, the one\n * it inherits, or the app's. A logical corner is a different physical one in each.\n */\n private directionOf(\n matched: readonly StyleRule[],\n parentInherited: Record<string, unknown>,\n ): 'ltr' | 'rtl' {\n let plain: unknown;\n let important: unknown;\n for (const rule of matched) {\n plain = rule.declarations['direction'] ?? plain;\n important = rule.important?.['direction'] ?? important;\n }\n const direction =\n important ?? plain ?? parentInherited['direction'] ?? this.conditions.direction;\n return direction === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /**\n * Whether a rule's media query holds, memoised per rule.\n *\n * Conditions are the same for every node, so this is answered once per rule per change rather\n * than once per rule per node.\n */\n private conditionHolds(rule: StyleRule): boolean {\n if (rule.condition === undefined) return true;\n if (rule.activeAt !== this.generation) {\n rule.activeAt = this.generation;\n rule.active = this.evaluate(rule.condition);\n }\n return rule.active!;\n }\n\n private evaluate(condition: MediaCondition): boolean {\n if ('all' in condition) return condition.all.every((part) => this.evaluate(part));\n if ('any' in condition) return condition.any.some((part) => this.evaluate(part));\n\n if (!('op' in condition)) return this.preference(condition.feature) === condition.value;\n\n const { width, height } = this.conditions;\n const actual = condition.feature === 'width' ? width : height;\n const { op, value } = condition;\n if (op === 'gt') return actual > value;\n if (op === 'gte') return actual >= value;\n if (op === 'lt') return actual < value;\n if (op === 'lte') return actual <= value;\n return actual === value;\n }\n\n /** What the device answers for a feature that is a keyword rather than a measurement. */\n private preference(\n feature: 'orientation' | 'prefers-color-scheme' | 'prefers-reduced-motion' | 'direction',\n ) {\n const { width, height, colorScheme, reducedMotion, direction } = this.conditions;\n if (feature === 'direction') return direction ?? 'ltr';\n if (feature === 'orientation') return width > height ? 'landscape' : 'portrait';\n if (feature === 'prefers-color-scheme') return colorScheme;\n return reducedMotion ? 'reduce' : 'no-preference';\n }\n\n /** A length relative to the viewport, in points. */\n private viewportLength(unit: 'vw' | 'vh' | 'vmin' | 'vmax', factor: number): number {\n const { width, height } = this.conditions;\n const basis = {\n vw: width,\n vh: height,\n vmin: Math.min(width, height),\n vmax: Math.max(width, height),\n };\n return (factor * basis[unit]) / 100;\n }\n\n /**\n * Write the declarations that could not be settled at build time: a `var()` reference, or a\n * length relative to the viewport or to the font size in scope.\n *\n * A declaration with no token and no usable fallback is dropped rather than written as\n * undefined, which is what a browser does with a value it cannot resolve.\n */\n /**\n * What declarations that wait for a node's tokens come to on it, where no rule of the node's\n * carries them: a keyframe's, which is settled against the element that plays it.\n */\n settleFor(\n node: StyleTarget,\n deferred: readonly DeferredDeclaration[],\n epoch: number,\n ): Record<string, unknown> {\n const { tokens } = this.resolve(node, epoch);\n const above = node.parent ? this.resolve(node.parent, epoch).inherited : EMPTY;\n const own: Record<string, unknown> = {};\n this.applyDeferred(deferred, own, tokens, above, null);\n return own;\n }\n\n private applyDeferred(\n deferred: readonly DeferredDeclaration[],\n own: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n important: Record<string, unknown> | null,\n ): void {\n for (const declaration of settlingOrder(deferred)) {\n if (declaration.inherit) {\n this.inherit(declaration, own, parentInherited, important);\n continue;\n }\n const settled = this.settled(declaration, own, parentInherited, tokens);\n if (settled === undefined && this.onUndefinedToken) {\n this.reportUndefined(declaration, tokens);\n }\n const outranked = (prop: string) =>\n !declaration.important && important !== null && prop in important;\n // Said only of a display that is written: an important one wins over the token's.\n const unread = settled === undefined && declaration.kind === 'display';\n if (unread && this.onUnreadDisplay && !outranked('display')) {\n this.reportDisplay(declaration, tokens);\n }\n const layers = settled === undefined ? layersOf(declaration, tokens) : undefined;\n for (const prop of declaration.props) {\n if (!outranked(prop)) writeSettled(own, prop, declaration, settled, layers);\n }\n }\n }\n\n /** Note what the node being resolved takes an `inherit` from, and that its parent has an heir. */\n private heir(node: StyleTarget, parent: StyleCache | null, matched: readonly StyleRule[]): void {\n this.parentOf = parent;\n this.parentInline = node.parent?.props['style'];\n if (parent && matched.some(takesParents)) parent.heirs = true;\n }\n\n /** What the parent of the node being resolved came to: an `inherit` takes its values from it. */\n private parentOf: StyleCache | null = null;\n /** That parent's inline style, which is over what its rules gave it. */\n private parentInline: unknown;\n\n /** What the parent's inline style sets, under what its rules marked important, as on the parent. */\n private parentSet(): Readonly<Record<string, unknown>> {\n if (!this.parentInline) return EMPTY;\n const inline = flattenInline(this.parentInline, {});\n for (const prop of this.parentOf?.important ?? []) delete inline[prop];\n return inline;\n }\n\n /**\n * `inherit`: each prop as the parent has it, handed down or its own, and gone where the parent\n * has none, which is what a weaker rule's value for it gives way to.\n */\n private inherit(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n important: Record<string, unknown> | null,\n ): void {\n const inline = this.parentSet();\n for (const prop of declaration.props) {\n if (!declaration.important && important !== null && prop in important) continue;\n const value = inline[prop] ?? parentInherited[prop] ?? this.parentOf?.style[prop];\n if (value === undefined) delete own[prop];\n else own[prop] = value;\n }\n }\n\n /** One deferred declaration's value, from the tokens in scope and the node's own style. */\n private settled(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n if (declaration.within !== undefined) {\n return this.settledWithin(declaration.within, declaration, own, parentInherited, tokens);\n }\n if (declaration.compute) return this.computed(declaration, own, parentInherited);\n if (declaration.line) return this.settledLine(declaration, own, parentInherited, tokens);\n const value = referenced(declaration, tokens);\n if (declaration.whenSet !== undefined)\n return value === undefined ? undefined : declaration.whenSet;\n // A token defined in `em` or a viewport unit cannot be settled where it is defined: a\n // browser substitutes it and works it out where it is used, so the same here.\n const pending = (value as { __defer?: DeferredDeclaration['compute'] } | null)?.__defer;\n if (pending) return this.computed({ ...declaration, compute: pending }, own, parentInherited);\n // A token can hold a structured value with markers of its own: a shadow token whose colour\n // is another token, as Tailwind's rings are.\n return typeof value === 'object' && value !== null\n ? this.settledWithin(value, declaration, own, parentInherited, tokens)\n : value;\n }\n\n /** A line's longhands from its tokens, with a width in `em` worked out against the font size. */\n private settledLine(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): Record<string, unknown> | undefined {\n const line = declaration.line!;\n const values = lineValues(line, tokens);\n if (!values) return undefined;\n if (line.colour !== undefined) {\n // A colour that cannot be worked out makes the whole line invalid, as an unset token does.\n const colour = this.settledWithin(line.colour, declaration, own, parentInherited, tokens);\n if (colour === undefined) return undefined;\n for (const prop of line.colors) values[prop] = colour;\n }\n // `currentcolor` is the colour in scope, which only the node knows.\n if (values[line.colors[0]!] === 'currentcolor') {\n const colour = own['color'] ?? parentInherited['color'] ?? 'black';\n for (const prop of line.colors) values[prop] = colour;\n }\n const width = values[line.widths[0]!] as { __defer?: DeferredDeclaration['compute'] };\n if (!width?.__defer) return values;\n // No less than zero, as CSS clamps a line's width: `calc(var(--w) - 2px)` with an em token.\n const points = this.computed({ ...declaration, compute: width.__defer }, own, parentInherited);\n for (const prop of line.widths) values[prop] = Math.max(points as number, 0);\n return values;\n }\n\n /** A reference with nothing defined for it and nothing to fall back to. */\n private reportUndefined(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n ): void {\n const name = declaration.reference;\n if (name === undefined || name in tokens) return;\n if (declaration.fallback !== undefined || declaration.fallbackToken) return;\n if (declaration.alternatives?.some((alternative) => alternative in tokens)) return;\n this.onUndefinedToken!(name, declaration.props, declaration.on);\n }\n\n /** A display token set to a value native has no display for. */\n private reportDisplay(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n ): void {\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const name = names.find((candidate) => tokens[candidate] !== undefined);\n if (name) this.onUnreadDisplay!(name, formOf(tokens[name], 'display') as string | undefined);\n }\n\n /**\n * A structured value with every deferred length and colour inside it settled, or undefined when\n * a colour in it cannot be: a shadow with no colour is not a shadow, as CSS reads it.\n */\n private settledWithin(\n value: unknown,\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n const filled = this.filledIn(value, declaration, own, parentInherited, tokens);\n if (filled === UNSETTLED) return undefined;\n // As the compiler drops a shadow nobody can see: Tailwind composes five, four of them nothing.\n return declaration.props.includes('boxShadow') && Array.isArray(filled)\n ? filled.filter((shadow) => !invisible((shadow as { color?: unknown }).color))\n : filled;\n }\n\n /** A structured value with every deferred length and colour inside it settled. */\n private filledIn(\n value: unknown,\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n if (!needsFilling(value)) return value;\n const fill = (part: unknown) => this.filledIn(part, declaration, own, parentInherited, tokens);\n if (Array.isArray(value)) return this.filledList(value, fill, tokens);\n // `currentcolor` is the colour in scope, which only the node knows: Tailwind's ring default.\n // On `color` itself that is the inherited colour, as CSS reads it.\n const current = (): string => {\n const ownColour = declaration.props.includes('color') ? undefined : own['color'];\n return (ownColour ?? parentInherited['color'] ?? 'black') as string;\n };\n const marked = settledMarker(value, tokens, current);\n if (marked === 'currentcolor') return current();\n if (marked !== NOT_A_MARKER) return marked ?? UNSETTLED;\n const pending = (value as { __defer?: DeferredDeclaration['compute'] }).__defer;\n if (pending) return this.computed({ ...declaration, compute: pending }, own, parentInherited);\n const out: Record<string, unknown> = {};\n for (const [key, part] of Object.entries(value)) {\n const filled = fill(part);\n if (filled === UNSETTLED) return UNSETTLED;\n out[key] = filled;\n }\n return out;\n }\n\n /**\n * A list's parts filled in, a whole shadow or filter token standing for however many entries it\n * holds: none, for an empty filter slot.\n */\n private filledList(\n value: readonly unknown[],\n fill: (part: unknown) => unknown,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n const parts: unknown[] = [];\n for (const part of value) {\n const slot = slotOf(part);\n if (!slot) {\n const filled = fill(part);\n if (filled === UNSETTLED) return UNSETTLED;\n parts.push(filled);\n continue;\n }\n const filled = fill(\n substitute(slot.marker, tokens, (token) => slotEntries(token, slot.kind)),\n );\n if (filled === UNSETTLED || !Array.isArray(filled)) return UNSETTLED;\n parts.push(...filled);\n }\n return parts;\n }\n\n /** A length relative to the viewport or to the font size in scope. */\n private computed(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n ): unknown {\n const { unit, factor, offset = 0, multiple } = declaration.compute!;\n if (unit !== 'em') return this.viewportLength(unit, factor) + offset;\n if (multiple && !offset) return { multiple: factor } satisfies LineHeightMultiple;\n // The font size in scope. On `font-size` itself that is the inherited size rather than the\n // one being computed, which is what makes a nested `1.5em` compound as on the web.\n const base = declaration.props.includes('fontSize')\n ? parentInherited['fontSize']\n : (own['fontSize'] ?? parentInherited['fontSize']);\n // To a thousandth of a point: a factor rounded at build time, times a font size, is otherwise\n // 19.99998 where the web draws 20.\n const points = factor * (typeof base === 'number' ? base : DEFAULT_FONT_SIZE) + offset;\n return Math.round(points * 1000) / 1000;\n }\n}\n\n/**\n * The order a node's deferred declarations are settled in.\n *\n * Plain ones first and important ones after, so an important one wins whatever order they matched\n * in; and a plain one never writes over an important declaration. The font size before everything\n * else, because an em anywhere on the node is measured against it, whichever rule it came from:\n * '.x { padding: 1em } .y { font-size: 2em }'. Then the colour, because a `currentcolor` anywhere\n * on the node is the node's own colour: a ring's default, beside a `color: var(--c)`.\n */\nfunction settlingOrder(deferred: readonly DeferredDeclaration[]): readonly DeferredDeclaration[] {\n const byImportance = deferred.some((one) => one.important)\n ? [...deferred.filter((one) => !one.important), ...deferred.filter((one) => one.important)]\n : deferred;\n const rank = (one: DeferredDeclaration) =>\n one.props.includes('fontSize') ? 0 : one.props.includes('color') ? 1 : 2;\n return byImportance.some((one) => rank(one) < 2)\n ? [0, 1, 2].flatMap((wanted) => byImportance.filter((one) => rank(one) === wanted))\n : byImportance;\n}\n\n/**\n * The aliases, hsl() colours and channel colours among a node's own definitions, resolved against everything in\n * scope on it. Done once, where they are defined, so a descendant only ever sees values. A name\n * that resolves to nothing - undefined, part of a cycle, or an hsl() missing a channel - is\n * dropped, as a browser treats it as unset.\n *\n * Aliases first: an hsl() channel that names a plain token reads it whichever order these run in,\n * but an alias that names an hsl() token needs the hsl() already turned into a colour.\n */\n/**\n * The tokens in scope at a node: its parent's, overlaid with what its rules define, overlaid with\n * what it sets itself, which wins as inline style does.\n */\nfunction tokensInScope(\n parentTokens: Readonly<Record<string, TokenValue>>,\n ruleTokens: Readonly<Record<string, TokenValue>> | null,\n custom: Readonly<Record<string, TokenValue>> | null | undefined,\n important: Readonly<Record<string, TokenValue>> | null = null,\n): Readonly<Record<string, TokenValue>> {\n // What the element sets is over its rules' definitions, but for the ones marked important.\n const own = custom ? { ...ruleTokens, ...custom, ...important } : ruleTokens;\n if (!own || changesNothing(own, parentTokens)) return parentTokens;\n return resolveAliases(own, { ...parentTokens, ...own }, parentTokens);\n}\n\n/**\n * Whether a node's own definitions leave every token as its parent has it: each is the value the\n * parent has already, from the same rule, or a CSS-wide keyword that comes to what is in scope.\n * Tailwind writes `--tw-translate-x: 0`, `--tw-blur: initial` and forty more like them on every\n * element, so on nearly every node this is all there is, and the parent's map is handed on as it\n * is where a copy of it, a few hundred tokens, would be made.\n */\nfunction changesNothing(\n own: Readonly<Record<string, TokenValue>>,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n for (const name in own) {\n const value = own[name]!;\n // The very value its parent has: the one rule gave it to both, as `*` gives every element.\n if (parentTokens[name] === value) continue;\n const word = value.keyword;\n if (word === undefined || !CSS_WIDE.has(word)) return false;\n // `inherit` and `unset` are the parent's value whatever it is; the rest are no value at all.\n if (word !== 'inherit' && word !== 'unset' && parentTokens[name] !== undefined) return false;\n }\n return true;\n}\n\nfunction resolveAliases(\n own: Readonly<Record<string, TokenValue>>,\n merged: Record<string, TokenValue>,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): Record<string, TokenValue> {\n const names = Object.keys(own);\n for (const name of names) {\n const word = own[name]!.keyword;\n if (word !== undefined && CSS_WIDE.has(word)) cssWide(merged, name, word, parentTokens);\n }\n const aliases = names.filter((name) => own[name]!.alias);\n followAliases(aliases, merged);\n // Left to work out: each token made of others and each alias that came to one, by a link or a\n // fallback, `var(--missing, calc(var(--gap) * 2))`, which is worked out here as well.\n const pending = new Set(names.filter((name) => isDerived(merged[name])));\n if (pending.size) settleDerived(own, merged, pending);\n return merged;\n}\n\nconst CSS_WIDE: ReadonlySet<string> = new Set([\n 'initial',\n 'inherit',\n 'unset',\n 'revert',\n 'revert-layer',\n]);\n\n/**\n * A token set to a CSS-wide keyword, as CSS has one: its parent's value for `inherit` and `unset`,\n * since a custom property inherits, and otherwise its initial value, which is to be unset. Tailwind\n * writes `--tw-blur: initial` for each filter slot a node has not filled.\n */\nfunction cssWide(\n merged: Record<string, TokenValue>,\n name: string,\n word: string,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): void {\n const inherited = word === 'inherit' || word === 'unset' ? parentTokens[name] : undefined;\n if (inherited) merged[name] = inherited;\n else delete merged[name];\n}\n\n/** What a token not yet worked out reads as while another is: set, with no form of any kind. */\nconst PENDING: TokenValue = Object.freeze({});\n\n/**\n * The tokens left to work out, each settled once none it reads is still to be, whatever order they\n * are defined in. One that reads another still to be waits, rather than taking a fallback: a\n * fallback is for a token that is unset or invalid. When every one left waits for another, those\n * in a cycle, counting only the references read, are invalid, and the rest go on without them,\n * taking their fallbacks, as CSS has it.\n */\nfunction settleDerived(\n own: Readonly<Record<string, TokenValue>>,\n merged: Record<string, TokenValue>,\n pending: Set<string>,\n): void {\n const waitingOn = new Map<string, ReadonlySet<string>>();\n let read = new Set<string>();\n const view = new Proxy(merged, {\n get: (tokens, name: string) => {\n if (!pending.has(name)) return tokens[name];\n read.add(name);\n return PENDING;\n },\n });\n while (pending.size) {\n let settled = false;\n for (const name of pending) {\n read = new Set();\n const token = own[name]!;\n const value = token.alias ? substitutedIn(token, view) : workedOut(token, view);\n if (read.size) {\n waitingOn.set(name, read);\n continue;\n }\n pending.delete(name);\n settle(merged, name, value);\n settled = true;\n }\n if (settled) continue;\n for (const name of inCycles(pending, waitingOn)) {\n pending.delete(name);\n delete merged[name];\n }\n }\n}\n\n/** An alias's target, or the first of its fallbacks that is set, with one made of others worked out. */\nfunction substitutedIn(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n let link: TokenValue | undefined = token;\n while (link?.alias) {\n const target = tokens[link.alias];\n if (target !== undefined) return target;\n link = link.fallback;\n }\n return link && isDerived(link) ? workedOut(link, tokens) : link;\n}\n\n/**\n * A token that is set but makes no valid value. A use site finds it set, so takes no fallback, and\n * in no form, so its property is unset, as CSS substitutes such a token and then unsets it.\n */\nconst INVALID: TokenValue = Object.freeze({});\n\n/**\n * A token made of others, worked out: invalid when it makes nothing valid, as `hsl()` of a\n * percentage hue does, and unset only when a `var()` in it has nothing to be substituted with.\n */\nfunction workedOut(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n return derived(token, tokens) ?? (substitutable(token, tokens) ? INVALID : undefined);\n}\n\n/** Whether each `var()` in a token made of others names a token that is set, or has a fallback. */\nfunction substitutable(token: TokenValue, tokens: Readonly<Record<string, TokenValue>>): boolean {\n if (token.hsl) return hslSubstitutable(token.hsl, tokens);\n if (token.deferredColour) return colourSubstitutable(token.deferredColour, tokens);\n if (token.deferredLengths) {\n return token.deferredLengths.every(\n (part) => typeof part !== 'object' || substitutedIn(part, tokens) !== undefined,\n );\n }\n // Each marker is one reading of the same text, and a fallback one cannot read is dropped from it.\n return token.deferredCalc!.some((marker) => calcSubstitutable(marker.expression, tokens));\n}\n\nfunction hslSubstitutable(\n hsl: NonNullable<TokenValue['hsl']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n return [hsl.h, hsl.s, hsl.l, hsl.alpha].every(\n (channel) =>\n typeof channel !== 'object' ||\n tokens[channel.reference] !== undefined ||\n channel.fallback !== undefined,\n );\n}\n\nfunction calcSubstitutable(\n expression: CalcExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if (Array.isArray(expression)) {\n return expression.slice(1).every((side) => calcSubstitutable(side, tokens));\n }\n if (typeof expression !== 'object' || 'percentage' in expression) return true;\n const leaf = expression as Extract<CalcLeaf, { reference: string }>;\n if (tokens[leaf.reference] !== undefined) return true;\n return leaf.fallback !== undefined && calcSubstitutable(leaf.fallback, tokens);\n}\n\nfunction colourSubstitutable(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if ('color' in expression) return true;\n if ('hsl' in expression) return hslSubstitutable(expression.hsl, tokens);\n if ('relative' in expression) return colourSubstitutable(expression.relative.from, tokens);\n if ('mix' in expression) {\n const { a, b } = expression.mix;\n return colourSubstitutable(a, tokens) && colourSubstitutable(b, tokens);\n }\n if ('channels' in expression) {\n const { channels, alpha } = expression;\n const set = (one: { reference: string; fallback?: unknown }) =>\n tokens[one.reference] !== undefined || one.fallback !== undefined;\n return set(channels) && (typeof alpha !== 'object' || set(alpha));\n }\n return referenceSubstitutable(expression, tokens);\n}\n\n/** A colour's `var()`: a token or alternative that is set, or a fallback that can be worked out. */\nfunction referenceSubstitutable(\n expression: Extract<ColourExpression, { reference: string }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n const names = [expression.reference, ...(expression.alternatives ?? [])];\n if (names.some((name) => tokens[name] !== undefined)) return true;\n if (expression.fallback !== undefined) return true;\n const token = expression.fallbackToken;\n return token !== undefined && (!isDerived(token) || substitutable(token, tokens));\n}\n\n/**\n * A reference read from its token when that is set, in whatever form `read` finds, and its\n * fallback only when it is not.\n */\nfunction substitute(\n marker: { readonly reference: string; readonly fallback?: unknown },\n tokens: Readonly<Record<string, TokenValue>>,\n read: (token: TokenValue) => unknown,\n): unknown {\n const token = tokens[marker.reference];\n return token === undefined ? marker.fallback : read(token);\n}\n\n/** The first of the names that is set: the one a `var()` and its `var()` fallbacks substitute. */\nfunction firstSet(\n names: readonly string[],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n for (const name of names) if (tokens[name] !== undefined) return tokens[name];\n return undefined;\n}\n\n/** The names among `names` that reach themselves by what each waits on. */\nfunction inCycles(\n names: ReadonlySet<string>,\n waitingOn: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n const reaches = (from: string, to: string, seen: Set<string>): boolean => {\n for (const next of waitingOn.get(from) ?? []) {\n if (next === to) return true;\n if (names.has(next) && !seen.has(next) && seen.add(next) && reaches(next, to, seen)) {\n return true;\n }\n }\n return false;\n };\n return [...names].filter((name) => reaches(name, name, new Set()));\n}\n\n/** Whether a token is made of others, and so worked out where it is defined. */\nfunction isDerived(token: TokenValue | undefined): boolean {\n return Boolean(\n token?.hsl || token?.deferredColour || token?.deferredCalc || token?.deferredLengths,\n );\n}\n\n/** A token made of others, worked out from the tokens in scope. */\nfunction derived(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n if (token.hsl) return colourToken(resolveHsl(token.hsl, tokens));\n if (token.deferredColour) return colourToken(resolveColour(token.deferredColour, tokens));\n if (token.deferredLengths) return lengthsToken(token, tokens);\n return calcToken(token.deferredCalc!, tokens);\n}\n\n/**\n * A token of several lengths with each part that is a `var()` followed. Where a part comes to\n * no length the token is what else it reads as, a shadow whose colour is a token being several\n * lengths and a `var()` too, or nothing where it reads as nothing else.\n */\nfunction lengthsToken(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n const { deferredLengths, ...rest } = token;\n const lengths = deferredLengths!.map((part) =>\n typeof part === 'object' ? substitutedIn(part, tokens)?.length : part,\n );\n if (lengths.every((length) => length !== undefined)) {\n return { ...rest, lengths: lengths as (number | string)[] };\n }\n return Object.keys(rest).length ? rest : undefined;\n}\n\n/**\n * Each alias settled to what it names. `follow` writes back every one that resolves; one in a\n * cycle is removed only once all are followed, as removed any sooner, the next one round the\n * cycle would find it unset and take its own fallback.\n */\nfunction followAliases(aliases: readonly string[], merged: Record<string, TokenValue>): void {\n const cyclic = aliases.filter((name) => typeof follow(name, merged, []) === 'number');\n for (const name of cyclic) delete merged[name];\n}\n\n/** A token set to what it resolved to, or removed when it resolved to nothing, as CSS unsets it. */\nfunction settle(\n merged: Record<string, TokenValue>,\n name: string,\n value: TokenValue | undefined,\n): void {\n if (value) merged[name] = value;\n else delete merged[name];\n}\n\nconst colourToken = (color: string | undefined): TokenValue | undefined =>\n color === undefined ? undefined : { color };\n\n/** A `calc()` token's forms, from the tokens in scope: undefined when it makes neither. */\nfunction calcToken(\n markers: readonly CalcMarker[],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n let token: TokenValue | undefined;\n for (const marker of markers) {\n const value = resolveCalc(marker, tokens);\n if (value === undefined) continue;\n if (marker.kind === 'length') token = { ...token, length: value };\n else if (typeof value === 'number') token = { ...token, number: value };\n // Arithmetic of a percentage, `calc(var(--half) * 2)`, is a percentage, as a token written\n // `100%` is, so an hsl() does not read it as a bare number of percent.\n const percentage = marker.kind === 'number' && calcType(marker.expression, tokens) === '%';\n if (percentage && typeof value === 'number' && token?.length === undefined) {\n token = { ...token, length: `${Math.round(value * 100000) / 1000}%` };\n }\n }\n return token;\n}\n\n/**\n * What a calc() of numbers and percentage tokens makes, as CSS types it: a number, `''`, a\n * percentage, `'%'`, or neither, as a percentage added to a number is, or one percentage\n * multiplied by another.\n */\nfunction calcType(\n expression: CalcExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): '' | '%' | undefined {\n if (typeof expression === 'number') return '';\n if (!Array.isArray(expression)) return leafType(expression as CalcLeaf, tokens);\n const [op, a, b] = expression as readonly [string, CalcExpression, CalcExpression];\n const left = calcType(a, tokens);\n const right = calcType(b, tokens);\n if (left === undefined || right === undefined) return undefined;\n if (op === '*') return left && right ? undefined : left || right;\n if (op === '/') return right ? undefined : left;\n return left === right ? left : undefined;\n}\n\n/** What one token in a calc() is, as `calcType` reads it: its fallback's type when it is unset. */\nfunction leafType(\n leaf: CalcLeaf,\n tokens: Readonly<Record<string, TokenValue>>,\n): '' | '%' | undefined {\n if ('percentage' in leaf) return '%';\n const token = tokens[leaf.reference];\n if (!token) return leaf.fallback === undefined ? undefined : calcType(leaf.fallback, tokens);\n return typeof token.length === 'string' && token.length.endsWith('%') ? '%' : '';\n}\n\n/** An `hsl()` token's channels, read from the tokens in scope, as the colour they make. */\nfunction resolveHsl(\n hsl: NonNullable<TokenValue['hsl']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n const h = hslChannel(hsl.h, tokens, 'hue');\n const s = hslChannel(hsl.s, tokens, hsl.legacy ? 'legacy' : 'percentage');\n const l = hslChannel(hsl.l, tokens, hsl.legacy ? 'legacy' : 'percentage');\n const alpha = hsl.alpha === undefined ? 1 : hslChannel(hsl.alpha, tokens, 'alpha');\n if (h === undefined || s === undefined || l === undefined || alpha === undefined) {\n return undefined;\n }\n return hslToRgb(h, s, l, alpha);\n}\n\n/**\n * A channel's number, or undefined when its token is the wrong kind for the slot, as the token's\n * text substituted into the hsl() would read: a hue is a number or an angle, read in degrees, as\n * `0.5turn` is 180 and not 0.5, and never a percentage; a saturation or a lightness is a\n * percentage, or a bare number of percent, `--s: 100`, though not in the legacy comma syntax; an\n * alpha is a number or a percentage. The fallback is only for a token that is not set, as a set\n * one is substituted, whatever it holds.\n */\nfunction hslChannel(\n channel: HslChannel,\n tokens: Readonly<Record<string, TokenValue>>,\n slot: 'hue' | 'percentage' | 'legacy' | 'alpha',\n): number | undefined {\n if (typeof channel === 'number') return channel;\n const token = tokens[channel.reference];\n if (!token) return channel.fallback;\n const percentage = typeof token.length === 'string' && token.length.endsWith('%');\n if (slot === 'hue') return percentage ? undefined : (token.angle ?? token.number);\n if (token.angle !== undefined || token.number === undefined) return undefined;\n if (percentage || slot === 'alpha') return token.number;\n return slot === 'legacy' ? undefined : token.number / 100;\n}\n\n/**\n * `hsl(h, s, l)` converted to sRGB, printed the same way `fromChannels` prints an rgba() built\n * from tokens: a use site never has to know which of the two ever built a colour.\n *\n * `h` is degrees; `s` and `l` are fractions, which is what a percentage token already reads as\n * (see `formOf`), so nothing here rescales them.\n */\nfunction hslToRgb(h: number, saturation: number, l: number, opacity: number): string {\n // Out of range as CSS Color 4 takes it: a saturation below 0 is 0, an alpha is clamped, and\n // anything else is converted as it is, each channel it makes then clamped into sRGB.\n const s = Math.max(0, saturation);\n const alpha = Math.min(1, Math.max(0, opacity));\n const hue = ((h % 360) + 360) % 360;\n const chroma = (1 - Math.abs(2 * l - 1)) * s;\n const x = chroma * (1 - Math.abs(((hue / 60) % 2) - 1));\n const m = l - chroma / 2;\n const [r1, g1, b1] =\n hue < 60\n ? [chroma, x, 0]\n : hue < 120\n ? [x, chroma, 0]\n : hue < 180\n ? [0, chroma, x]\n : hue < 240\n ? [0, x, chroma]\n : hue < 300\n ? [x, 0, chroma]\n : [chroma, 0, x];\n const [r, g, b] = [r1, g1, b1].map((c) => Math.round(Math.min(1, Math.max(0, c + m)) * 255));\n return alpha >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${Math.round(alpha * 1000) / 1000})`;\n}\n\n/**\n * A token with its `var()` substituted, through as many aliases and fallbacks as it takes.\n *\n * `path` is the aliases being followed on the way here. A number is a cycle, and the index in\n * `path` where it starts: every property from there on is in it and invalid at computed-value\n * time, so none of them takes its fallback, while one before it names an invalid property and\n * does. Anything else is final wherever the chain started, so it is written back to `tokens`, and\n * no alias is followed twice.\n */\nfunction follow(\n name: string,\n tokens: Record<string, TokenValue>,\n path: string[],\n): TokenValue | undefined | number {\n const value = tokens[name];\n if (!value?.alias) return value;\n const start = path.indexOf(name);\n if (start >= 0) return start;\n const depth = path.push(name) - 1;\n const result = substituted(value, tokens, path, depth);\n path.pop();\n if (typeof result !== 'number') settle(tokens, name, result);\n return result;\n}\n\n/** An alias's target, or its fallback, which may be another `var()`, when the target is unset. */\nfunction substituted(\n value: TokenValue,\n tokens: Record<string, TokenValue>,\n path: string[],\n depth: number,\n): TokenValue | undefined | number {\n const target = follow(value.alias!, tokens, path);\n if (typeof target === 'object' || (typeof target === 'number' && target <= depth)) return target;\n const { fallback } = value;\n return fallback?.alias ? substituted(fallback, tokens, path, depth) : fallback;\n}\n\n/** What a `var()` resolves to: a gradient's stops, or one value with its arithmetic applied. */\nfunction referenced(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (declaration.gradient) return paintLayers(declaration.gradient, tokens);\n // The first token set is substituted, whatever it holds: one of the wrong kind leaves the\n // property unset rather than trying the next, or the fallback.\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const token = firstSet(names, tokens);\n let value = token ? formFor(token, declaration) : fallbackOf(declaration, tokens);\n // `calc(var(--n) * 1px)`: the arithmetic gives a unitless token its unit, which is the usual\n // way to turn a count into a length. So it reads the bare number, and a length is no such thing.\n if (token && declaration.adjust?.number && declaration.kind === 'length') {\n value = token.number;\n }\n if (declaration.kind === 'display') return displayOf(value);\n const base = CHANNEL_KINDS.has(declaration.kind!)\n ? fromChannels(value, declaration.alpha, tokens, declaration.space)\n : value;\n return declaration.adjust ? adjusted(base, declaration.adjust) : base;\n}\n\n/**\n * What native displays for a keyword: flex, none or contents. A block, inline, inline-block,\n * flow-root or inline-flex box is flex, as the compiler reads one written out, and so is `flow`,\n * which is a block. Anything else, a grid or a table, is no display native has, so the property\n * is unset.\n */\nconst DISPLAYS: ReadonlyMap<string, string> = new Map([\n ...['flex', 'block', 'inline', 'inline-block', 'flow-root', 'inline-flex', 'flow'].map(\n (word) => [word, 'flex'] as const,\n ),\n ['none', 'none'],\n ['contents', 'contents'],\n]);\n\n/**\n * The two-keyword form, an outer display and an inner one in either order: `inline flex` is\n * `inline-flex` and `block flow` is `block`, as Chrome computes them, so each is flex here.\n */\nconst OUTER = new Set(['block', 'inline']);\nconst INNER = new Set(['flow', 'flow-root', 'flex']);\n\nfunction displayOf(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined;\n const words = value.toLowerCase().split(CSS_SPACE);\n if (words.length === 1) return DISPLAYS.get(words[0]!);\n const [first, second] = words as [string, string];\n const pair = (OUTER.has(first) && INNER.has(second)) || (INNER.has(first) && OUTER.has(second));\n return words.length === 2 && pair ? 'flex' : undefined;\n}\n\n/**\n * A set token's value in the form wanted. A token of `currentColor` is the colour in scope where\n * it is used, not where it is set, so it is the marker the node fills in.\n */\nfunction tokenForm(token: TokenValue, kind: TokenKind): unknown {\n const value = formOf(token, kind);\n return value === undefined && kind === 'color' && isCurrentColour(token) ? CURRENT_COLOUR : value;\n}\n\n/** A corner's place among four as CSS writes them, before a side's: `borderTopLeftRadius`. */\nconst PLACES: readonly (readonly [RegExp, number])[] = [\n [/TopLeft|TopStart|StartStart/, 0],\n [/TopRight|TopEnd|StartEnd/, 1],\n [/BottomRight|BottomEnd|EndEnd/, 2],\n [/BottomLeft|BottomStart|EndStart/, 3],\n [/Top/, 0],\n [/Right|End/, 1],\n [/Bottom/, 2],\n [/Left|Start/, 3],\n];\n\n/** Where a side or a corner comes in a shorthand of four, whatever order its props are kept in. */\nconst placeOf = (prop: string): number => PLACES.find(([named]) => named.test(prop))?.[1] ?? 0;\n\n/** The lengths of a token that holds several, for the props of a shorthand to take one each. */\nclass EachSide {\n readonly lengths: readonly (number | string)[];\n constructor(lengths: readonly (number | string)[]) {\n this.lengths = lengths;\n }\n\n /**\n * The length for one of a shorthand's four props, as CSS gives them: two are a pair repeated,\n * and of three the left takes the right's. Nothing for a property that is not such a\n * shorthand: a token of several lengths is no value for it, and it is unset.\n */\n at(props: readonly string[], prop: string): number | string | undefined {\n if (props.length !== 4) return undefined;\n const index = placeOf(prop);\n return this.lengths[index] ?? this.lengths[index - 2] ?? this.lengths[0];\n }\n}\n\n/**\n * A set token's value in the form a declaration wants, or its several lengths where it wants a\n * length and the token has no one: for a shorthand that takes one a side, see `writeSettled`.\n * Not with arithmetic on it, which is of one length.\n */\nfunction formFor(token: TokenValue, declaration: DeferredDeclaration): unknown {\n const value = tokenForm(token, declaration.kind!);\n if (value !== undefined || !token.lengths || declaration.kind !== 'length') return value;\n return declaration.adjust ? undefined : new EachSide(token.lengths);\n}\n\n/** What a deferred declaration settled to, written to one of its props. */\nfunction writeSettled(\n own: Record<string, unknown>,\n prop: string,\n declaration: DeferredDeclaration,\n settled: unknown,\n layers: BackgroundLayers | undefined,\n): void {\n const one = settled instanceof EachSide ? settled.at(declaration.props, prop) : settled;\n const value = one ?? declaration.unset;\n if (declaration.layers) writeLayer(own, prop, value, layers);\n else write(own, prop, value, declaration.line !== undefined);\n}\n\n/**\n * One prop of a `background: var()`, whose token may hold the images as well as the colour. The\n * image is written only where the token holds one: a token that is a colour leaves an image\n * another rule declared as it is. Each prop is ranked in the cascade by itself, so an image a\n * later rule declares, or an important one, is not written over by the token's.\n */\nfunction writeLayer(\n own: Record<string, unknown>,\n prop: string,\n value: unknown,\n layers: BackgroundLayers | undefined,\n): void {\n if (prop !== BACKGROUND_IMAGE) write(own, prop, layers?.color ?? value, false);\n else if (layers) own[prop] = layers.images;\n}\n\nconst BACKGROUND_IMAGE = 'experimental_backgroundImage';\n\n/**\n * The gradients a `background: var()` reads where its token is no colour: see `backgroundLayers`.\n * Only the shorthand, which the compiler marks: `background-color: var()` is a colour or nothing.\n * And only where the token is set as text on an element, which is where a library sets one as the\n * app runs; a stylesheet's is refused where it is written. The token is the one the declaration\n * settles on, the first that is set.\n */\nfunction layersOf(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): BackgroundLayers | undefined {\n if (!declaration.layers) return undefined;\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const text = firstSet(names, tokens)?.keyword;\n return text && /gradient\\(/i.test(text) ? backgroundLayers(text) : undefined;\n}\n\nconst BOUND_NUMBERS = new Set([\n 'opacity',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'zIndex',\n 'aspectRatio',\n 'elevation',\n]);\nconst BOUND_LENGTH =\n /^(?:(?:min|max)?(?:width|height)|top|right|bottom|left|start|end|gap|fontSize|letterSpacing)$|(?:margin|padding|inset|Width|Radius|Gap|Basis)/i;\n\n/** The properties whose token is read in a form of its own. */\nconst BOUND_KINDS: Readonly<Record<string, TokenKind>> = {\n display: 'display',\n transform: 'transform',\n boxShadow: 'shadow',\n filter: 'filter',\n};\n\n/** What a token is read as for a bound declaration of `prop`, as the compiler says for a rule. */\nfunction boundKind(prop: string): TokenKind {\n // `fill` and `stroke` are a shape's paint, which is a colour.\n if (/color$/i.test(prop) || prop === 'fill' || prop === 'stroke') return 'color';\n if (prop === 'fontWeight') return 'weight';\n if (prop === 'fontFamily') return 'family';\n if (prop === 'lineHeight') return 'lineHeight';\n if (prop in BOUND_KINDS) return BOUND_KINDS[prop]!;\n if (BOUND_NUMBERS.has(prop)) return 'number';\n return BOUND_LENGTH.test(prop) ? 'length' : 'keyword';\n}\n\n/**\n * A bound declaration whose value is one `var()`, `var(--brand, red)`, as the deferred declaration\n * the compiler writes for the same value in a rule. `token` is the value as a token, which is an\n * alias when it is a `var()`; null for any other.\n *\n * A colour made of tokens, `color-mix(in srgb, var(--brand), white 20%)`, is worked out from the\n * tokens where it is used, as a fallback of the same shape is.\n *\n * ponytail: any other value has to be the whole `var()`. One inside a longer value, `calc()`\n * included, is what the compiler parses at build time and nothing here does; write the sum in a\n * custom property, `[style.--gap]`, and read that in the stylesheet.\n */\nexport function boundDeclaration(\n prop: string,\n token: TokenValue | undefined,\n on?: string,\n): DeferredDeclaration | null {\n const kind = boundKind(prop);\n if (!token?.alias) return derivedColour(prop, token, kind, on);\n const [reference, ...alternatives] = aliasesOf(token);\n for (; token?.alias; token = token.fallback);\n // `tokenForm`, so a fallback of `currentColor` is the colour of the element, as in a rule.\n const fallback = token && !isDerived(token) ? tokenForm(token, kind) : undefined;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n kind,\n reference: reference!,\n ...(alternatives.length ? { alternatives } : {}),\n ...(fallback !== undefined ? { fallback } : {}),\n ...(token && isDerived(token) ? { fallbackToken: token } : {}),\n };\n}\n\n/** A CSS number: `1.5`, `+1.5`, `.5`, `1e0`, `-2`. */\nconst CSS_NUMBER = String.raw`[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?`;\n\n/** A length in `em` or a viewport unit, the whole value: `2em`, `-0.5em`, `50vw`. */\nconst RELATIVE_LENGTH = new RegExp(String.raw`^\\s*(${CSS_NUMBER})(em|vw|vh|vmin|vmax)\\s*$`, 'i');\n\n/** A number with no unit, as a `line-height` is written: a multiple of the font size. */\nconst UNITLESS = new RegExp(String.raw`^\\s*(${CSS_NUMBER})\\s*$`, 'i');\n\n/** A negative `line-height`, of a number or a length, which CSS has no value for. */\nconst NEGATIVE = new RegExp(String.raw`^\\s*-(?:\\d|\\.\\d)`);\n\n/** Whether `text` is a `line-height` below zero, which a browser drops: `-1.5`, `-1em`, `-2px`. */\nexport const isNegativeLineHeight = (prop: string, text: string): boolean =>\n prop === 'lineHeight' && NEGATIVE.test(text);\n\ntype RelativeUnit = NonNullable<DeferredDeclaration['compute']>['unit'];\n\n/**\n * A bound declaration of a length in `em` or a viewport unit, `[style.width]=\"'2em'\"`, as the\n * deferred declaration the compiler writes for the same value in a rule: measured where it is\n * used, against the font size in scope. A viewport unit is measured against the viewport, and\n * again when it changes. A `line-height` with no unit is the number a rule hands down. Null for\n * any other value, and for a property that takes no length.\n */\nexport function boundRelativeLength(\n prop: string,\n text: string,\n on?: string,\n): DeferredDeclaration | null {\n const kind = boundKind(prop);\n if (kind !== 'length' && kind !== 'lineHeight') return null;\n const relative = RELATIVE_LENGTH.exec(text);\n if (relative) {\n const unit = relative[2]!.toLowerCase() as RelativeUnit;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n compute: { unit, factor: Number(relative[1]) },\n };\n }\n // A line height with no unit is a number each text under it multiplies its own font size by,\n // not the points it comes to here: the compiler writes the same for it in a rule.\n const unitless = kind === 'lineHeight' ? UNITLESS.exec(text) : null;\n if (!unitless) return null;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n compute: { unit: 'em', factor: Number(unitless[1]), multiple: true },\n };\n}\n\n/** A bound colour made of tokens, worked out where it is used; null for any other value. */\nfunction derivedColour(\n prop: string,\n token: TokenValue | undefined,\n kind: TokenKind,\n on: string | undefined,\n): DeferredDeclaration | null {\n if (!token || kind !== 'color' || !isDerived(token)) return null;\n return { props: [prop], ...(on === undefined ? {} : { on }), kind, fallbackToken: token };\n}\n\n/** The names a `var()` tries in turn: its own, then each `var()` nested as its fallback. */\nfunction aliasesOf(token: TokenValue | undefined): string[] {\n const names: string[] = [];\n for (; token?.alias; token = token.fallback) names.push(token.alias);\n return names;\n}\n\n/** The fallback written, or one made of other tokens, worked out from the tokens where it is used. */\nfunction fallbackOf(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n const token = declaration.fallbackToken;\n return declaration.fallback ?? (token && formOf(derived(token, tokens), declaration.kind!));\n}\n\n/**\n * One longhand of a deferred declaration written to the node's own style. Unset when the value is\n * nothing, as CSS has a declaration invalid once its tokens are known: it still wins the cascade,\n * so what a weaker rule set goes, and the property inherits or starts over. A line's value is one\n * per longhand, and leaves the ones it was written with alone.\n */\nfunction write(own: Record<string, unknown>, prop: string, value: unknown, perProp: boolean): void {\n if (value === undefined) delete own[prop];\n else if (!perProp) own[prop] = value;\n else if (prop in (value as Record<string, unknown>)) {\n own[prop] = (value as Record<string, unknown>)[prop];\n }\n}\n\n/** The styles a line's token can be, as the compiler reads a written one. */\nconst LINE_STYLES: ReadonlySet<string> = new Set([\n 'solid',\n 'dashed',\n 'dotted',\n 'double',\n 'groove',\n 'ridge',\n 'inset',\n 'none',\n 'hidden',\n]);\nconst LINE_WIDTHS: Readonly<Record<string, number>> = { thin: 1, medium: 3, thick: 5 };\n\n/** What a line's token substitutes to: a token, or nothing at all, `var(--x,)` or `--x: ;`. */\nconst NOTHING = Symbol('nothing');\n\n/**\n * A line's longhands, each token given the one role its form says and the written parts did not\n * take. Undefined when a token is unset with nothing to fall back to, fits no role left, or would\n * take a role twice: CSS makes the whole shorthand invalid then.\n */\nfunction lineValues(\n line: LineTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): Record<string, unknown> | undefined {\n const open = new Set(line.roles);\n const values: Record<string, unknown> = {};\n for (const reference of line.references) {\n const token = lineToken(reference, tokens);\n if (token === undefined) return undefined;\n if (token === NOTHING) continue;\n const found = reference.adjust\n ? computedWidth(token, open, reference.adjust)\n : lineRole(token, open);\n if (!found) return undefined;\n open.delete(found.role);\n fillRole(line, values, found.role, found.value);\n }\n // A part no token filled takes its initial value, as one left out of a written line does.\n for (const role of open) fillRole(line, values, role, LINE_INITIAL[role]);\n return values;\n}\n\n/** A token of `currentColor`, in any case. */\nconst isCurrentColour = (token: TokenValue | undefined): boolean =>\n token?.keyword?.toLowerCase() === 'currentcolor';\n\n/** The marker the compiler writes for `currentColor`, which the node fills in. */\nconst CURRENT_COLOUR = { __colour: { color: 'currentcolor' } };\n\n/** What a line's width, style and colour are when it leaves them out. */\nconst LINE_INITIAL = {\n width: LINE_WIDTHS['medium'],\n style: 'none',\n color: 'currentcolor',\n} as const;\n\nfunction fillRole(\n line: LineTemplate,\n values: Record<string, unknown>,\n role: LineTemplate['roles'][number],\n value: unknown,\n): void {\n const styles = [line.style!, ...(line.marks ?? [])];\n const props = { width: line.widths, color: line.colors, style: styles }[role];\n for (const prop of props) values[prop] = value;\n}\n\nfunction lineToken(\n reference: LineTemplate['references'][number],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | typeof NOTHING | undefined {\n const set = firstSet([reference.reference, ...(reference.alternatives ?? [])], tokens);\n if (set) return set.keyword?.trim() === '' ? NOTHING : set;\n if (reference.empty) return NOTHING;\n const { fallback } = reference;\n return fallback && isDerived(fallback) ? derived(fallback, tokens) : fallback;\n}\n\n/** The role a token's form says it has, among those still open. */\nfunction lineRole(\n token: TokenValue,\n open: ReadonlySet<LineTemplate['roles'][number]>,\n): { role: LineTemplate['roles'][number]; value: unknown } | undefined {\n const word = token.keyword;\n const width = word && word in LINE_WIDTHS ? LINE_WIDTHS[word] : token.length;\n if (open.has('width') && (typeof width === 'number' || isDeferredLength(width))) {\n return { role: 'width', value: width };\n }\n if (open.has('style') && word && LINE_STYLES.has(word)) return { role: 'style', value: word };\n const color = isCurrentColour(token) ? 'currentcolor' : formOf(token, 'color');\n return open.has('color') && color !== undefined ? { role: 'color', value: color } : undefined;\n}\n\n/** A `calc()` of a token, which is a width, and no less than zero, as CSS clamps one. */\nfunction computedWidth(\n token: TokenValue,\n open: ReadonlySet<LineTemplate['roles'][number]>,\n adjust: NonNullable<DeferredDeclaration['adjust']>,\n): { role: 'width'; value: unknown } | undefined {\n // A bare number only when the calc() gives it its unit: `calc(var(--n) * 1px)`.\n const length = adjust.number ? token.number : token.length;\n if (!open.has('width') || (typeof length !== 'number' && !isDeferredLength(length))) {\n return undefined;\n }\n const value = adjusted(length, adjust);\n return { role: 'width', value: typeof value === 'number' ? Math.max(value, 0) : value };\n}\n\nconst isDeferredLength = (value: unknown): boolean =>\n typeof value === 'object' && value !== null && '__defer' in value;\n\nconst CHANNEL_KINDS: ReadonlySet<TokenKind> = new Set(['channels', 'hslChannels']);\n\n/** `hsl()` reads a channels token as hue, saturation and lightness; `rgb()` as sRGB. */\ntype ChannelSpace = 'rgb' | 'hsl';\n\n/**\n * `13, 110, 253` as the colour it is, at the alpha the token beside it says, if one does: the\n * channels form for `rgb()`, the hslChannels form for `hsl()`.\n */\nfunction fromChannels(\n value: unknown,\n alpha: DeferredDeclaration['alpha'],\n tokens: Readonly<Record<string, TokenValue>>,\n space?: ChannelSpace,\n): string | undefined {\n if (!Array.isArray(value) || value.length !== 3) return undefined;\n // An alpha naming a token nothing set, with no fallback, is no colour: CSS drops it.\n const opacity = alpha ? substitute(alpha, tokens, (token) => token.number) : 1;\n if (typeof opacity !== 'number') return undefined;\n if (space === 'hsl') return hslToRgb(value[0], value[1], value[2], opacity);\n const [r, g, b] = value as number[];\n return opacity >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${Math.round(opacity * 1000) / 1000})`;\n}\n\n/** One template, or a layered background of several: every layer painted, or, as CSS would, none. */\nfunction paintLayers(\n gradient: GradientTemplate | readonly GradientTemplate[],\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (!Array.isArray(gradient)) return paintGradient(gradient as GradientTemplate, tokens);\n const painted: unknown[] = [];\n for (const layer of gradient as readonly GradientTemplate[]) {\n const one = paintGradient(layer, tokens) as unknown[] | undefined;\n if (!one) return undefined;\n painted.push(...one);\n }\n return painted;\n}\n\n/**\n * A gradient template with its stops filled in from the cascade.\n *\n * A stop whose colour is not defined anywhere is dropped rather than painted transparent: that is\n * what makes an optional middle colour optional, and it is what a browser does with the same\n * stylesheet. Fewer than two colours is not a gradient, and paints nothing at all.\n */\nfunction paintGradient(\n template: GradientTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n const colorStops = paintedStops(template, tokens);\n if (!colorStops || colorStops.length < 2) return undefined;\n const position = template.position && placed(template.position, tokens);\n if (position === null) return undefined;\n return [{ ...template, colorStops, ...(position ? { position } : {}) }];\n}\n\n/**\n * A template's stops with their tokens read, leaving out any whose colour is not set. Undefined\n * when a stop's colour or position token is set but no such thing, which makes the gradient\n * invalid, as CSS substitutes a set token rather than falling back.\n */\nfunction paintedStops(\n template: GradientTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): { color: string; position: string | number | null }[] | undefined {\n const colorStops = [];\n for (const stop of template.colorStops) {\n const token = stop.colour ? undefined : tokens[stop.reference!];\n const color = stop.colour ? resolveColour(stop.colour, tokens) : token?.color;\n // `none` is how the Tailwind flattening writes `via-none`: the stop left out, not invalid.\n if (color === undefined && token && token.keyword !== 'none') return undefined;\n if (color === undefined) continue;\n const position = stopPosition(stop, tokens);\n if (position === INVALID_POSITION) return undefined;\n // Written even when there is none: Fabric looks the key up before it looks at the value, and\n // silently skips a stop that has not got one.\n colorStops.push({ color, position: (position as string | number | undefined) ?? null });\n }\n return colorStops;\n}\n\nconst INVALID_POSITION = Symbol('invalid position');\n\n/** A stop's position: its token's when that is set, the one written otherwise. */\nfunction stopPosition(\n stop: GradientTemplate['colorStops'][number],\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (!stop.positionReference) return stop.position;\n const token = tokens[stop.positionReference];\n if (!token) return stop.position;\n return token.length ?? INVALID_POSITION;\n}\n\n/**\n * A radial gradient's centre with any token in it read, or null when a token it needs is not set\n * and has nothing written beside it: CSS would not paint the gradient then, and neither does this.\n */\nfunction placed(\n position: NonNullable<GradientTemplate['position']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): Record<string, unknown> | null {\n const out: Record<string, unknown> = {};\n for (const [edge, offset] of Object.entries(position)) {\n if (offset === null || typeof offset !== 'object') {\n out[edge] = offset;\n continue;\n }\n const marker = offset as { reference: string; fallback?: string | number };\n const value = substitute(marker, tokens, (token) => token.length);\n if (value === undefined || typeof value === 'object') return null;\n out[edge] = value;\n }\n return out;\n}\n\n/**\n * A colour expression with its tokens looked up and any mix in it worked out. Undefined when a\n * token it needs is not defined anywhere and has nothing to fall back to.\n *\n * `current` is the node's colour, for a `currentColor` inside a mix or a relative colour. One that\n * is the whole expression is answered as `currentcolor`, for the caller to fill in.\n */\nfunction resolveColour(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): string | undefined {\n if ('color' in expression) return expression.color;\n if ('channels' in expression) return channelsColour(expression, tokens);\n if ('hsl' in expression) return resolveHsl(expression.hsl, tokens);\n if ('reference' in expression) return tokenColour(expression, tokens);\n if ('relative' in expression) {\n const { space, from, channels, alpha } = expression.relative;\n const origin = innerColour(from, tokens, current);\n return origin === undefined ? undefined : relativeColour(space, origin, channels, alpha);\n }\n const sides = mixSides(expression.mix, tokens, current);\n return sides && mixColours(expression.mix.space, ...sides, expression.mix.hue);\n}\n\n/** The colour of the node a value is settled for, worked out only when something asks. */\ntype CurrentColour = () => string;\n\n/** A colour inside another: `currentColor` there, written or in a token, is the node's colour. */\nfunction innerColour(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n current: CurrentColour | undefined,\n): string | undefined {\n if (!current) return resolveColour(expression, tokens);\n if ('reference' in expression) {\n const names = [expression.reference, ...(expression.alternatives ?? [])];\n if (isCurrentColour(firstSet(names, tokens))) return current();\n }\n const colour = resolveColour(expression, tokens, current);\n return colour?.toLowerCase() === 'currentcolor' ? current() : colour;\n}\n\ntype Mix = Extract<ColourExpression, { mix: unknown }>['mix'];\n\n/** A mix's two sides, a mix inside it unrounded, as CSS rounds only the colour at the end. */\nfunction mixSides(\n mix: Mix,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): [MixSide, MixSide] | undefined {\n const colour = (side: ColourExpression) =>\n 'mix' in side ? unroundedMix(side.mix, tokens, current) : innerColour(side, tokens, current);\n const first = colour(mix.a);\n const second = colour(mix.b);\n const shares = [mix.aPercentage, mix.bPercentage].map((share) => shareOf(share, tokens));\n // A share that is a token nothing sets: no mix, as CSS has no colour for one.\n if (first === undefined || second === undefined || shares.includes(null)) return undefined;\n return [\n { colour: first, percentage: shares[0] ?? undefined },\n { colour: second, percentage: shares[1] ?? undefined },\n ];\n}\n\nfunction unroundedMix(\n mix: Mix,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): Rgba | undefined {\n const sides = mixSides(mix, tokens, current);\n return sides && mixChannels(mix.space, ...sides, mix.hue);\n}\n\n/** A share as the percentage it comes to: undefined for none written, null for a token unset. */\nfunction shareOf(\n share: MixShare | undefined,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | null | undefined {\n if (share === undefined || typeof share === 'number') return share;\n const factor = tokens[share.reference]?.number ?? share.fallback;\n return factor === undefined ? null : factor * share.scale;\n}\n\n/** A length in a structured value that is a token, with the arithmetic around it. */\ninterface LengthMarker {\n readonly reference: string;\n readonly adjust?: DeferredDeclaration['adjust'];\n readonly fallback?: number;\n}\n\n/**\n * Arithmetic with tokens in it, as the compiler leaves it: numbers, token references and\n * `[op, a, b]`, in points, degrees or plain numbers as the slot it fills counts. A percentage\n * written where a number is wanted is its fraction, kept apart from a bare number so that what\n * the arithmetic makes is still a percentage (see `calcType`).\n */\ntype CalcExpression =\n | number\n | { readonly percentage: number }\n | { readonly reference: string; readonly fallback?: CalcExpression }\n | readonly ['+' | '-' | '*' | '/' | 'max' | 'min', CalcExpression, CalcExpression];\n\n/** A calc() tree's leaf that is not a bare number. */\ntype CalcLeaf = Exclude<CalcExpression, number | readonly unknown[]>;\n\ninterface CalcMarker {\n readonly expression: CalcExpression;\n readonly kind: 'length' | 'angle' | 'time' | 'number';\n}\n\n/** A calc marker worked out, as its slot takes it; undefined when a token in it is not set. */\nfunction resolveCalc(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | string | undefined {\n const percentage = wholePercentage(marker, tokens);\n if (percentage !== undefined) return percentage;\n if (bareNumberAsLength(marker, tokens) || notAnAngle(marker, tokens)) return undefined;\n // A percentage and a number added together, `calc(var(--n) + 10%)`, are neither, and invalid.\n if (marker.kind === 'number' && calcType(marker.expression, tokens) === undefined)\n return undefined;\n const value = calculated(marker.expression, marker.kind, tokens);\n if (value === undefined || !Number.isFinite(value)) return undefined;\n const rounded = Math.round(value * 1000) / 1000;\n return marker.kind === 'angle' ? `${rounded}deg` : rounded;\n}\n\n/**\n * Whether a length is one token holding a bare number other than 0: `--tw-translate-x: 3`, from\n * `translate-x-[3]`, which a browser drops. Inside arithmetic a bare number is a factor, and fine.\n */\nfunction bareNumberAsLength(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if (marker.kind !== 'length' || typeof marker.expression !== 'object') return false;\n if (Array.isArray(marker.expression)) return false;\n const token = tokens[(marker.expression as { reference: string }).reference];\n return (\n token !== undefined &&\n token.length === undefined &&\n token.number !== undefined &&\n token.number !== 0\n );\n}\n\n/**\n * Whether an angle is one token that holds no angle: `--tw-rotate: 3` or `37%`, from\n * `rotate-[3]`, which a browser drops, taking the whole transform with it. A bare 0 is an angle;\n * `0%` is not.\n */\nfunction notAnAngle(marker: CalcMarker, tokens: Readonly<Record<string, TokenValue>>): boolean {\n if (marker.kind !== 'angle' || typeof marker.expression !== 'object') return false;\n if (Array.isArray(marker.expression)) return false;\n const token = tokens[(marker.expression as { reference: string }).reference];\n if (token === undefined || token.angle !== undefined) return false;\n // `0%` has a number 0 as well, and is still a percentage, which no angle is.\n return token.number !== 0 || typeof token.length === 'string';\n}\n\n/**\n * A length that is one token holding a percentage, `translate-x-1/2`'s 50%, passed on as it is:\n * a share of a box nobody has laid out yet can be used, but not added to or scaled here.\n */\nfunction wholePercentage(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n if (marker.kind !== 'length' || typeof marker.expression !== 'object') return undefined;\n if (Array.isArray(marker.expression)) return undefined;\n const leaf = marker.expression as { reference: string };\n const value = formOf(tokens[leaf.reference], 'length');\n return typeof value === 'string' && value.endsWith('%') ? value : undefined;\n}\n\nfunction calculated(\n expression: CalcExpression,\n kind: CalcMarker['kind'],\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n if (typeof expression === 'number') return expression;\n if (!Array.isArray(expression)) return leafValue(expression as CalcLeaf, kind, tokens);\n const [op, a, b] = expression as readonly [string, CalcExpression, CalcExpression];\n const left = calculated(a, kind, tokens);\n const right = calculated(b, kind, tokens);\n if (left === undefined || right === undefined) return undefined;\n if (op === '+') return left + right;\n if (op === '-') return left - right;\n if (op === '*') return left * right;\n if (op === 'max') return Math.max(left, right);\n if (op === 'min') return Math.min(left, right);\n return left / right;\n}\n\n/** A written percentage, or a token, as `calculated` reads it: its fallback when it is unset. */\nfunction leafValue(\n leaf: CalcLeaf,\n kind: CalcMarker['kind'],\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n if ('percentage' in leaf) return leaf.percentage;\n const token = tokens[leaf.reference];\n if (token) return tokenNumber(token, kind);\n return leaf.fallback === undefined ? undefined : calculated(leaf.fallback, kind, tokens);\n}\n\n/** Where each kind of slot reads a token from, before its bare number. */\nconst FORM_OF_KIND: Record<\n Exclude<CalcMarker['kind'], 'number'>,\n (token: TokenValue) => unknown\n> = {\n length: (token) => token.length,\n angle: (token) => token.angle,\n time: (token) => token.time,\n};\n\n/**\n * A token as a number in a slot of this kind: its length in points or its angle in degrees, or\n * a bare number, which multiplies (`calc(var(--n) * 1px)`). A length that is not points, a\n * percentage, is not one, and is not read as the bare number it also is.\n */\nfunction tokenNumber(token: TokenValue | undefined, kind: CalcMarker['kind']): number | undefined {\n if (!token) return undefined;\n const own = kind === 'number' ? undefined : FORM_OF_KIND[kind](token);\n if (own !== undefined) return typeof own === 'number' ? own : undefined;\n // An angle is a number of degrees to a hue, and neither a length nor a factor: `30deg` as a\n // translate moved a box thirty points, and as a scale made it thirty times the size, where a\n // browser drops the declaration.\n if (token.angle !== undefined) return undefined;\n return token.number;\n}\n\n/** A whole shadow, filter or transform token in a list, and the entries to use when it is unset. */\ninterface ShadowsMarker {\n readonly reference: string;\n readonly fallback?: readonly unknown[];\n}\n\n/** What a token set in a slot stands for: its entries, or none for one set to nothing, `--tw-blur: ;`. */\nfunction slotEntries(token: TokenValue, kind: TokenKind): unknown {\n return formOf(token, kind) ?? (token.keyword?.trim() === '' ? [] : undefined);\n}\n\n/** The slot a list entry can be instead of an entry: one per list property that has them. */\nconst SLOT_KINDS = {\n __shadows: 'shadow',\n __filters: 'filter',\n __transforms: 'transform',\n __variants: 'fontVariant',\n} as const satisfies Record<string, TokenKind>;\n\nconst SLOT_ENTRIES = Object.entries(SLOT_KINDS);\n\n/** The slot a list entry is, and the form of token that fills it; undefined for an entry. */\nfunction slotOf(part: unknown): { marker: ShadowsMarker; kind: TokenKind } | undefined {\n if (part === null || typeof part !== 'object') return undefined;\n for (const [key, kind] of SLOT_ENTRIES) {\n const marker = (part as Record<string, ShadowsMarker | undefined>)[key];\n if (marker) return { marker, kind };\n }\n return undefined;\n}\n\nfunction resolveLength(\n marker: LengthMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n // A number when the arithmetic gives it its unit, as `referenced` reads one.\n const form = marker.adjust?.number ? 'number' : 'length';\n const value = substitute(marker, tokens, (token) => formOf(token, form));\n if (typeof value !== 'number') return undefined;\n return marker.adjust ? (adjusted(value, marker.adjust) as number) : value;\n}\n\n/** A colour at no opacity at all. */\nfunction invisible(colour: unknown): boolean {\n if (colour === 'transparent') return true;\n const parts = typeof colour === 'string' ? RGB.exec(colour) : null;\n return parts?.[4] !== undefined && Number(parts[4]) === 0;\n}\n\n/**\n * Whether a compiled value has something in it to settle: a marker, slot or deferred length at\n * any depth. One with none is used as it is. Asked of values from the sheet, which never change,\n * so the answer is kept: Tailwind's reset fills three of a shadow's five slots with one on every\n * node.\n */\nfunction needsFilling(value: unknown): value is object {\n if (value === null || typeof value !== 'object') return false;\n let answer = NEEDS_FILLING.get(value);\n if (answer === undefined) {\n answer = Object.entries(value).some(\n ([key, part]) => key.startsWith('__') || needsFilling(part),\n );\n NEEDS_FILLING.set(value, answer);\n }\n return answer;\n}\nconst NEEDS_FILLING = new WeakMap<object, boolean>();\n\n/** What `settledMarker` says of a part that is not a token's marker at all. */\nconst NOT_A_MARKER = Symbol('not a marker');\n\n/** A colour, length or calc marker settled from the tokens, or undefined when one cannot be. */\nfunction settledMarker(\n value: object,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): unknown {\n const colour = colourMarker(value);\n if (colour) return resolveColour(colour, tokens, current);\n // Whether a shadow is inset, from a token that is the word or nothing: `ring-inset`.\n const inset = (value as { __inset?: { reference: string } }).__inset;\n if (inset) return formOf(tokens[inset.reference], 'keyword') === 'inset';\n const token = (value as { __length?: LengthMarker }).__length;\n if (token) return resolveLength(token, tokens);\n const sum = (value as { __calc?: CalcMarker }).__calc;\n if (sum) return resolveCalc(sum, tokens);\n const shadow = (value as { __dropShadow?: { reference: string } }).__dropShadow;\n if (shadow) return dropShadowOf(tokens[shadow.reference]?.shadow);\n return NOT_A_MARKER;\n}\n\n/**\n * A shadow token as the drop shadow a filter draws: `drop-shadow(var(--drop-shadow-xs))`. One\n * shadow, never inset and with no spread, which is all a drop shadow can be; nothing otherwise.\n */\nfunction dropShadowOf(shadow: unknown): unknown {\n if (!Array.isArray(shadow) || shadow.length !== 1) return undefined;\n const [{ offsetX, offsetY, blurRadius, spreadDistance, color, inset }] = shadow as {\n offsetX: number;\n offsetY: number;\n blurRadius: number;\n spreadDistance: number;\n color: unknown;\n inset: boolean;\n }[];\n if (spreadDistance !== 0 || inset || typeof color !== 'string') return undefined;\n return { offsetX, offsetY, standardDeviation: blurRadius, color };\n}\n\n/** What a colour that cannot be settled makes of the whole value it is in. */\nconst UNSETTLED = Symbol('unsettled');\n\n/** `rgba(var(--channels), <alpha>)`: the token's channels, at the alpha written or tokened. */\nfunction channelsColour(\n expression: Extract<ColourExpression, { channels: unknown }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n const { space } = expression.channels;\n const kind = space === 'hsl' ? 'hslChannels' : 'channels';\n const value = substitute(expression.channels, tokens, (token) => formOf(token, kind));\n const { alpha } = expression;\n if (typeof alpha !== 'number') return fromChannels(value, alpha, tokens, space);\n const opaque = fromChannels(value, undefined, tokens, space);\n return opaque === undefined ? undefined : (faded(opaque, alpha) as string);\n}\n\n/** A token's colour, or the first of its alternatives that is defined, or its fallback. */\nfunction tokenColour(\n expression: Extract<ColourExpression, { reference: string }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n // The first token set is substituted, whatever it holds, as `referenced` reads one.\n const set = firstSet([expression.reference, ...(expression.alternatives ?? [])], tokens);\n if (expression.orInset) return insetOrColour(set);\n if (set) return formOf(set, 'color') as string | undefined;\n const token = expression.fallbackToken;\n return expression.fallback ?? (token && (formOf(derived(token, tokens), 'color') as string));\n}\n\n/**\n * A shadow's colour from a token that is the colour or the word `inset`: currentcolor, which the\n * node fills in, when it is `inset` or unset, and nothing, so no shadow, when it is anything else.\n */\nfunction insetOrColour(token: TokenValue | undefined): string | undefined {\n if (!token || token.keyword === 'inset') return 'currentcolor';\n return formOf(token, 'color') as string | undefined;\n}\n\n/** A marker the compiler leaves in a structured value for a colour only the device can settle. */\nfunction colourMarker(value: unknown): ColourExpression | undefined {\n return (value as { __colour?: ColourExpression } | null)?.__colour;\n}\n\n/**\n * A resolved length, moved by the arithmetic that surrounded its `var()`.\n *\n * A non-numeric value is left alone rather than coerced: the token was a keyword or a percentage\n * the app meant, and turning it into NaN would be a silent layout rather than a visible one.\n */\nfunction adjusted(value: unknown, adjust: NonNullable<DeferredDeclaration['adjust']>): unknown {\n if (adjust.alpha !== undefined) return faded(value, adjust.alpha);\n const em = (value as { __defer?: DeferredEm } | null)?.__defer;\n if (em && adjust.floor === undefined) return adjustedEm(em, adjust);\n if (typeof value !== 'number') return value;\n const scaled = value * (adjust.scale ?? 1) + (adjust.offset ?? 0);\n return adjust.floor === undefined ? scaled : Math.max(scaled, adjust.floor);\n}\n\ninterface DeferredEm {\n readonly unit: string;\n readonly factor: number;\n readonly offset?: number;\n}\n\n/** A length in em, worked out against the font size later, with the arithmetic moved inside it. */\nfunction adjustedEm(\n em: DeferredEm,\n adjust: NonNullable<DeferredDeclaration['adjust']>,\n): { __defer: DeferredEm } {\n const scale = adjust.scale ?? 1;\n const offset = (em.offset ?? 0) * scale + (adjust.offset ?? 0);\n return { __defer: { ...em, factor: em.factor * scale, ...(offset ? { offset } : {}) } };\n}\n\n/** `rgb(r, g, b)` and `rgba(r, g, b, a)`, which is every colour the compiler emits. */\nconst RGB = /^rgba?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*(?:,\\s*([\\d.]+)\\s*)?\\)$/;\n\n/**\n * A colour at a fraction of its opacity.\n *\n * Multiplied rather than replaced, so a token that was already translucent stays relatively so -\n * `rgba(0, 0, 0, 0.5)` faded to 90% is 45% opaque, which is what a browser computes for the same\n * mix. A value that is not one of ours is returned untouched: it may be a platform colour, and a\n * colour nobody can parse is better painted as it stands than dropped.\n */\nexport function faded(value: unknown, fraction: number): unknown {\n if (typeof value !== 'string') return value;\n const parts = RGB.exec(value);\n if (!parts) return value;\n const alpha = (parts[4] === undefined ? 1 : Number(parts[4])) * fraction;\n return `rgba(${parts[1]}, ${parts[2]}, ${parts[3]}, ${Math.round(alpha * 1000) / 1000})`;\n}\n\n/**\n * Where a component's compiled sheet lives: a static on the component class, written by the\n * Metro transformer at build time.\n *\n * `RendererFactory2.createRenderer(host, type)` receives the component definition, and a\n * definition references its class, so a renderer can find its own sheet with no registry and no\n * generated id. That is also how encapsulation is scoped for free: a component's renderer only\n * ever matches that component's rules, so its elements cannot be styled by anyone else's CSS.\n */\nexport const NATIVE_STYLES = 'ɵnativeStyles';\n\nexport function styleSheetOf(type: unknown): StyleSheet | null {\n const sheet = (type as Record<string, unknown> | null)?.[NATIVE_STYLES];\n return (sheet as StyleSheet | undefined) ?? null;\n}\n"]}
1
+ {"version":3,"file":"css.js","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAKL,WAAW,EACX,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAyB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA6LpE,sGAAsG;AACtG,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC;AAsGxC;;;;GAIG;AACH,MAAM,QAAQ,GA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,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1F,CAAC;AAED,uFAAuF;AACvF,MAAM,GAAG,GAAG,6EAA6E,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,KAAc,EAAE,QAAgB;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;IACzE,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC;AAC3F,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,MAAM,KAAK,GAAI,IAAuC,EAAE,CAAC,aAAa,CAAC,CAAC;IACxE,OAAQ,KAAgC,IAAI,IAAI,CAAC;AACnD,CAAC","sourcesContent":["/**\n * Runtime half of the CSS system: selector matching and the cascade.\n *\n * All the expensive work happened at build time (parsing, longhand expansion, value conversion,\n * specificity maths, sorting), so this only walks a pre-sorted rule list and merges. It is\n * framework-agnostic and knows nothing about Angular.\n */\nimport {\n type HueMethod,\n type MixSide,\n type MixSpace,\n type Rgba,\n mixChannels,\n mixColours,\n} from './color-mix.ts';\nimport { type BackgroundLayers, backgroundLayers } from './background-layers.ts';\nimport { ELEMENT_STYLES } from './element-styles.ts';\nimport { type Channel, relativeColour } from './relative-colour.ts';\nimport type { Keyframe } from './transition.ts';\n\n/** One `[name]` or `[name op \"value\"]` test. */\nexport interface AttributeTest {\n readonly name: string;\n /** Absent means a presence test. */\n readonly operator?: 'equal' | 'prefix' | 'suffix' | 'substring' | 'includes' | 'dash-match';\n readonly value?: string;\n /** The `i` flag: the value is compared without case, and is written here in lower case. */\n readonly insensitive?: true;\n}\n\nexport interface Compound {\n readonly type?: string;\n readonly id?: string;\n /** `:root`: the node at the top of the tree. */\n readonly root?: true;\n readonly classes: readonly string[];\n readonly attributes?: readonly AttributeTest[];\n /** `:is()` / `:where()` arguments: the compound matches if any of these do. */\n readonly is?: readonly (readonly Compound[])[];\n /**\n * `:is()` / `:where()` with an argument of more than a compound, `:is(.a + .b)`, once for each\n * written: the node is the last element of one of these. Read only where `is` is set, which\n * the compiler sets beside it, so a compound with no `:is()` pays nothing for it.\n */\n readonly isComplex?: readonly (readonly ComplexSelector[])[];\n /** `:not()` arguments: the compound matches only if none of these do. */\n readonly not?: readonly Compound[];\n /**\n * `:not()` with an argument of more than a compound: the node is the last of none of these.\n * Read only where `not` is set, as `isComplex` is.\n */\n readonly notComplex?: readonly ComplexSelector[];\n /** `:host`: the node must be the host of the component whose sheet is being evaluated. */\n readonly host?: true;\n /** `:host-context()`, once for each written: the host, or one of its ancestors, must match it. */\n readonly hostContext?: readonly Compound[];\n /**\n * `:is(<compound> *)`: every one of these must match some ancestor, the node itself excluded.\n * What Tailwind's `group-*` variants compile to.\n */\n readonly ancestors?: readonly Compound[];\n /**\n * `:is(<compound> > *)`: every one of these must match the node's parent. What Tailwind's `*:`\n * variant compiles to.\n */\n readonly parents?: readonly Compound[];\n /** Interaction state the engine tracks: `:focus` and `:active`. */\n readonly pseudo?: readonly ('focus' | 'active')[];\n /**\n * `:first-child` and its family, reduced to the counting tests CSS defines them as. More than\n * one because `:only-child` is two: first from the start and first from the end.\n */\n readonly nth?: readonly NthTest[];\n /** `:empty`: no children at all, text included. */\n readonly empty?: true;\n /**\n * What a `::ng-deep` is written after: an element of the component the sheet is of, or its\n * host. A rule with one is for what is under it, in other components' views too.\n */\n readonly own?: true;\n /** `:has()`: every one of these must find a match beneath the node. */\n readonly has?: readonly HasTest[];\n}\n\n/** One `:has()`: some element beneath the node, or some child of it, matches one of `any`. */\nexport interface HasTest {\n /** `:has(> x)`: a child, not any descendant. */\n readonly child?: true;\n readonly any: readonly Compound[];\n /**\n * Arguments that are more than one compound for a descendant or a child, `:has(+ .a)` or\n * `:has(.a > .b)`: some element related to the node by one of these is its last.\n */\n readonly relative?: readonly RelativeSelector[];\n}\n\n/** Compounds joined by combinators, matched leftwards from the last as a rule's are. */\nexport interface ComplexSelector {\n readonly compounds: readonly Compound[];\n /** Between compounds; length is `compounds.length - 1`. */\n readonly combinators: readonly Combinator[];\n}\n\n/**\n * A `:has()` argument, which starts at the node it is asked of: `combinators[0]` joins that node\n * to `compounds[0]`, and each one after joins the compound before it to the next.\n */\nexport interface RelativeSelector {\n readonly compounds: readonly Compound[];\n readonly combinators: readonly Combinator[];\n}\n\n/** `an + b`, counted from the start unless `fromEnd`. */\nexport interface NthTest {\n readonly a: number;\n readonly b: number;\n readonly fromEnd?: true;\n /** Counted among the siblings with the node's own element name: `:nth-of-type()`. */\n readonly ofType?: true;\n}\n\nexport type Combinator = 'descendant' | 'child' | 'next-sibling' | 'later-sibling';\n\nexport interface StyleRule {\n readonly compounds: readonly Compound[];\n /** Between compounds; length is `compounds.length - 1`. */\n readonly combinators: readonly Combinator[];\n readonly specificity: number;\n /** Written with `::ng-deep`: for what is under its component, in other components' views too. */\n readonly deep?: true;\n /**\n * The cascade layer the rule is in, as its place in its sheet's `layers`, or nothing for a rule\n * in no layer, which beats every layered one whatever their specificity.\n */\n readonly layer?: number;\n readonly order: number;\n readonly declarations: Readonly<Record<string, unknown>>;\n readonly important?: Readonly<Record<string, unknown>>;\n /** Custom properties this rule defines, pre-converted into every form a use site might want. */\n readonly tokens?: Readonly<Record<string, TokenValue>>;\n /** The names among `tokens` declared `!important`, which beat every plain one. */\n readonly importantTokens?: readonly string[];\n /** Declarations whose value is a `var()`, resolved once the token map is known. */\n readonly deferred?: readonly DeferredDeclaration[];\n /**\n * The corners and edges the rule's plain declarations wrote, in the order it wrote them, where\n * it wrote one in both its logical form and its physical one. The cascade settles the two as\n * one property, and a value settled on device is in a list of its own, with no order between\n * it and the rest.\n */\n readonly sides?: readonly string[];\n /** The same for the rule's important declarations. */\n readonly importantSides?: readonly string[];\n /** The media query guarding this rule, if any. */\n readonly condition?: MediaCondition;\n /** Memo of the last condition evaluation, and the conditions version it was made against. */\n activeAt?: number;\n active?: boolean;\n}\n\nexport type MediaCondition =\n | { readonly all: readonly MediaCondition[] }\n | { readonly any: readonly MediaCondition[] }\n | {\n readonly feature: 'width' | 'height';\n readonly op: 'gt' | 'gte' | 'lt' | 'lte' | 'eq';\n readonly value: number;\n }\n | {\n /** `direction` is not a media feature: it is what `:dir()` asks, of the app as a whole. */\n readonly feature:\n 'orientation' | 'prefers-color-scheme' | 'prefers-reduced-motion' | 'direction';\n readonly value: string;\n };\n\n/** What media queries are evaluated against. Pushed in by the host: the engine imports no RN. */\nexport interface Conditions {\n readonly width: number;\n readonly height: number;\n readonly colorScheme: 'light' | 'dark';\n /**\n * The user asked for less animation. Optional because it is a preference rather than a\n * measurement: an app that never asks the platform gets `no-preference`, which is what a\n * platform that cannot answer means anyway.\n */\n readonly reducedMotion?: boolean;\n /**\n * The system text size, as a multiplier: `PixelRatio.getFontScale()`. What native text scales\n * by; the engine scales the line box it keeps for a single-line iOS text input by it too.\n * Optional, and 1 when absent. A change reaches that line box when text is measured again\n * (`Engine.remeasureText`), which `watchConditions` does after it.\n */\n readonly fontScale?: number;\n /**\n * The screen's pixels in a point: `PixelRatio.get()`. Nothing in the engine reads it; a\n * package answering a page's `devicePixelRatio` does. Optional, and 1 when absent.\n */\n readonly pixelRatio?: number;\n /**\n * The direction the app is laid out in, which is the device's unless the app forced one:\n * `I18nManager.isRTL`. Optional, and left to right when absent. It decides which physical\n * corner or edge a logical one is, where an element has both and no `direction` of its own.\n */\n readonly direction?: 'ltr' | 'rtl';\n}\n\n/** A run of CSS whitespace: spaces, tabs, newlines, carriage returns and form feeds, and no other. */\nexport const CSS_SPACE = /[ \\t\\n\\r\\f]+/;\n\n/** A custom property's value, in each form it can legally take. Absent forms are unusable. */\nexport interface TokenValue {\n readonly length?: number | string;\n /** An angle, in degrees whatever unit it was written in. */\n readonly angle?: number;\n /** A time, in milliseconds whatever unit it was written in. */\n readonly time?: number;\n readonly color?: string;\n readonly keyword?: string;\n readonly number?: number;\n /** A font weight, as the string `fontWeight` takes. */\n readonly weight?: string;\n /** The first family of a font stack. A single word is read from `keyword` instead. */\n readonly family?: string;\n /**\n * A bare number as a line-height: a multiple of the font size, settled where it is used. A\n * length is read from `length` instead.\n */\n readonly lineHeight?: { readonly __defer: DeferredDeclaration['compute'] };\n /**\n * Two to four lengths, which a shorthand of sides or corners takes a value each from:\n * `padding: var(--list-padding)` of `--list-padding: 0.25rem 0.5rem`.\n */\n readonly lengths?: readonly (number | string)[];\n /**\n * The same where a part is a `var()`, each such part as the alias a token that is one is:\n * `0 var(--modal-padding) var(--modal-padding)`. Worked out into `lengths` where it is defined.\n */\n readonly deferredLengths?: readonly (number | string | TokenValue)[];\n /** A whole shadow list, in the processed shape `boxShadow` takes. */\n readonly shadow?: readonly unknown[];\n /** One filter function, as the one-entry list `filter` takes: a slot of Tailwind's filters. */\n readonly filter?: readonly unknown[];\n /** One transform function, as the one-entry list `transform` takes: a 3D rotation or skew. */\n readonly transform?: readonly unknown[];\n /** One font variant, as the one-entry list `fontVariant` takes: a numeric variant's slot. */\n readonly fontVariant?: readonly string[];\n /** Bare colour channels as `rgb()` reads them, 0 to 255: `13, 110, 253` or `100% 0% 0%`. */\n readonly channels?: readonly number[];\n /** The same as `hsl()` reads them: degrees, then saturation and lightness as fractions. */\n readonly hslChannels?: readonly number[];\n /** A transition's curve, as the cubic-bezier control points a timing keyword stands for. */\n readonly easing?: readonly number[];\n /** A whole animation, as the spec the engine plays: `--animate-spin`. */\n readonly animation?: Readonly<Record<string, unknown>>;\n /**\n * Defined as a colour made of other tokens: `rgba(var(--channels), <alpha>)`, or a `color-mix()`\n * of one. Settled on the node that defines it, as an `hsl` one is.\n */\n readonly deferredColour?: ColourExpression;\n /**\n * Defined as arithmetic of other tokens, `calc(var(--spacing) * 4)`, read as a length and as a\n * number. Settled on the node that defines it, as an `hsl` one is.\n */\n readonly deferredCalc?: readonly CalcMarker[];\n /**\n * Defined as another token, `var(--name)`. Resolved on the node that defines it, against the\n * tokens in scope there, and passed down resolved - which is what a browser does.\n */\n readonly alias?: string;\n /** What an alias becomes when the token it names is not defined. */\n readonly fallback?: TokenValue;\n /**\n * Defined as `hsl(var(--h), var(--s), var(--l))`, or `hsla()` with an alpha: how Bulma writes\n * every colour. Resolved into `color` on the node that defines it, alongside its aliases, so a\n * use site never has to know a token was ever built this way.\n */\n readonly hsl?: {\n readonly h: HslChannel;\n readonly s: HslChannel;\n readonly l: HslChannel;\n readonly alpha?: HslChannel;\n /** Written with commas, whose saturation and lightness are percentages alone. */\n readonly legacy?: true;\n };\n}\n\n/** One channel of an `hsl()` token: settled at build time, or a token to read at match time. */\nexport type HslChannel = number | { readonly reference: string; readonly fallback?: number };\n\n/** The forms a token can be read in: one per kind of value a use site can need. */\nexport type TokenKind =\n | 'length'\n | 'color'\n | 'keyword'\n | 'number'\n | 'weight'\n | 'family'\n | 'lineHeight'\n | 'shadow'\n | 'filter'\n | 'transform'\n | 'fontVariant'\n | 'channels'\n | 'hslChannels'\n | 'easing'\n | 'time'\n | 'animation'\n | 'display';\n\n/**\n * Where a form a token does not have can be read from instead. A length is already a\n * line-height and a single word is already a family, so neither is stored twice in every token\n * that happens to be one. The compiler reads fallbacks with the same table.\n */\nconst STAND_IN: Partial<Record<TokenKind, keyof TokenValue>> = {\n lineHeight: 'length',\n family: 'keyword',\n};\n\nfunction formOf(token: TokenValue | undefined, kind: TokenKind): unknown {\n if (!token) return undefined;\n // A display is a word, read as one native has where it is used: see `displayOf`. Two words,\n // `inline flex`, are a family when the stylesheet wrote them, as a font stack's first name is.\n if (kind === 'display') return token.keyword ?? token.family;\n const stand = STAND_IN[kind];\n return token[kind] ?? (stand ? token[stand] : undefined);\n}\n\nexport interface DeferredDeclaration {\n /**\n * The React Native style properties this lands in. Usually one, but a four-sided shorthand is\n * unambiguous given a single-valued token, so `padding: var(--gap)` writes all four.\n */\n readonly props: readonly string[];\n /**\n * `background: var()`: the token may hold gradients over a colour, so `props` names the image\n * beside the colour and each is written from its own part of the token. See `layersOf`.\n */\n readonly layers?: true;\n /**\n * `inherit`, written for these props: each is the parent's value for it, or nothing where the\n * parent has none.\n */\n readonly inherit?: true;\n /** The element a bound declaration is on, by name, for a message about it to say. */\n readonly on?: string;\n /** A `var()` reference. Exactly one of this and `compute` is present. */\n readonly kind?: TokenKind;\n readonly reference?: string;\n /**\n * The tokens a fallback that is itself a `var()` names, tried in turn when `reference` is not\n * defined: `var(--a, var(--b, green))` is `--a`, then `--b`, then `green`.\n */\n readonly alternatives?: readonly string[];\n readonly fallback?: unknown;\n /**\n * A fallback made of other tokens, `var(--missing, calc(var(--gap) * 2))`, worked out from the\n * tokens in scope where it is used, as a browser substitutes it there.\n */\n readonly fallbackToken?: TokenValue;\n /**\n * What to write when the reference resolves, whatever it resolves to: `flex: var(--grow)` sets a\n * shrink of 1 and a basis of 0%, but only when there is a grow for them to go with.\n */\n readonly whenSet?: unknown;\n /**\n * What to write when the reference resolves to nothing: the property's initial value, which is\n * what a browser gives a property whose `var()` cannot be substituted. Only where it differs\n * from leaving the property out: `flex-shrink` starts at 1 in CSS and at 0 in Yoga.\n */\n readonly unset?: unknown;\n /**\n * For a colour built from `channels`, the token its alpha comes from:\n * `rgba(var(--bs-primary-rgb), var(--bs-bg-opacity))`. A written alpha is an `adjust` instead.\n */\n readonly alpha?: { readonly reference: string; readonly fallback?: number };\n /** For a colour built from `channels`, read through `hsl()` rather than `rgb()`. */\n readonly space?: ChannelSpace;\n /**\n * A gradient whose stops are custom properties, filled in once a node's tokens are known. What\n * a utility framework's `from-*` and `to-*` classes compile to, since the class that paints the\n * gradient is not the class that supplies its colours.\n */\n readonly gradient?: GradientTemplate | readonly GradientTemplate[];\n /**\n * Arithmetic around the reference, settled at build time. `value * scale + offset`, then no\n * smaller than `floor`. What `calc(var(--x) + 12px)` and `max(var(--x), 16px)` become.\n */\n readonly adjust?: {\n readonly scale?: number;\n readonly offset?: number;\n readonly floor?: number;\n /**\n * A percentage the length is added to, `calc(100% - var(--x))`: written as that sum, which\n * the engine works out once the box the percentage is of has been laid out.\n */\n readonly percent?: number;\n /**\n * The reference is multiplied by a length, so it is a number: `calc(var(--n) * 1px)`. Without\n * this it is a length, and a number token is no such thing, as CSS types a calc().\n */\n readonly number?: true;\n /**\n * A fraction to multiply the resolved colour's alpha by. What\n * `color-mix(in oklab, var(--x) 90%, transparent)` becomes, which is Tailwind's `/90`.\n */\n readonly alpha?: number;\n };\n /** Declared `!important`: ranked with the important declarations, not the plain ones. */\n readonly important?: true;\n /**\n * A length relative to the viewport or to the font size in scope, plus an absolute `offset`\n * when it came from a sum: `calc(1.375rem + 1.5vw)` is 1.5vw with 22 added.\n */\n readonly compute?: {\n readonly unit: 'em' | 'vw' | 'vh' | 'vmin' | 'vmax';\n readonly factor: number;\n readonly offset?: number;\n /**\n * A unitless line-height: the node renders `factor` em, and what it hands down is the number,\n * which each text under it multiplies its own font size by. See `LineHeightMultiple`.\n */\n readonly multiple?: true;\n };\n /**\n * A structured value - a transform list, a shadow, a filter - with lengths like `compute`'s\n * somewhere inside it, each marked `{ __defer: compute }`. Filled in where it is used.\n */\n readonly within?: unknown;\n /** A `border` or a side's line with tokens in it, each given its role where it is used. */\n readonly line?: LineTemplate;\n}\n\n/**\n * `border: var(--w) var(--s) var(--c)`: which token is the width, the style or the colour cannot be\n * told at build time, so each is given the role its form says on device. `roles` are those the\n * written parts left open; `props` of the declaration are every longhand, which a line its tokens\n * make nothing of unsets.\n */\nexport interface LineTemplate {\n readonly references: readonly {\n readonly reference: string;\n readonly alternatives?: readonly string[];\n readonly fallback?: TokenValue;\n /** `var(--x,)`: nothing at all when the token is unset. */\n readonly empty?: true;\n /** `calc(var(--w) * 2)`: the arithmetic that makes the token the width, and only that. */\n readonly adjust?: DeferredDeclaration['adjust'];\n }[];\n readonly roles: readonly ('width' | 'style' | 'color')[];\n readonly widths: readonly string[];\n readonly colors: readonly string[];\n /** `color-mix(in srgb, var(--tint) 35%, transparent)`: the colour, written as a function. */\n readonly colour?: unknown;\n readonly style?: string;\n /** Each side's own style, which the line's style is written to as well: see `settleBorders`. */\n readonly marks?: readonly string[];\n}\n\n/**\n * A colour a deferred value is made of: settled at build time, a token, or a `color-mix()` of two\n * such, worked out once the tokens are known. What a gradient stop, a shadow's colour or a colour\n * property with a `var()` in a mix becomes.\n */\nexport type ColourExpression =\n | { readonly color: string }\n | {\n readonly reference: string;\n readonly alternatives?: readonly string[];\n readonly fallback?: string;\n /** A fallback made of other tokens, worked out from the tokens where it is used. */\n readonly fallbackToken?: TokenValue;\n /**\n * A shadow's `var(--x,)` with no colour beside it, which holds the colour or the word\n * `inset`: currentcolor when it is `inset` or unset.\n */\n readonly orInset?: true;\n }\n | {\n /** A token of bare channels, as `rgba(var(--channels), <alpha>)` reads it. */\n readonly channels: {\n readonly reference: string;\n readonly fallback?: readonly number[];\n readonly space?: ChannelSpace;\n };\n readonly alpha?: number | { readonly reference: string; readonly fallback?: number };\n }\n | { readonly hsl: NonNullable<TokenValue['hsl']> }\n | {\n /** `oklch(from <colour> <channel> <channel> <channel> [/ <alpha>])`. */\n readonly relative: {\n readonly space: MixSpace;\n readonly from: ColourExpression;\n readonly channels: readonly [Channel, Channel, Channel];\n readonly alpha?: Channel;\n };\n }\n | {\n readonly mix: {\n readonly space: MixSpace;\n readonly hue?: HueMethod;\n readonly a: ColourExpression;\n readonly aPercentage?: MixShare;\n readonly b: ColourExpression;\n readonly bPercentage?: MixShare;\n };\n };\n\n/**\n * The share of a colour in a mix: a percentage, or a token multiplied into one, as\n * `calc(var(--opacity) * 100%)` is the token times a hundred, with the number the token falls\n * back to where it wrote one.\n */\nexport type MixShare =\n number | { readonly reference: string; readonly scale: number; readonly fallback?: number };\n\n/** One component's compiled styles, pre-sorted by specificity then source order. */\n/**\n * A gradient with holes in it: everything but the stop colours is settled at build time.\n *\n * The shape is React Native's own processed one, so filling it in is a copy with the references\n * resolved rather than a translation.\n */\nexport interface GradientTemplate {\n readonly type: 'linear-gradient' | 'radial-gradient';\n readonly colorStops: readonly {\n /** The custom property holding this stop's colour. A stop with no colour is not painted. */\n readonly reference?: string;\n /** A colour made from tokens and literals instead, such as a `color-mix()` of one. */\n readonly colour?: ColourExpression;\n readonly positionReference?: string;\n readonly position?: string | number;\n }[];\n /**\n * A radial gradient's centre, by the edges native measures from: each offset written, or a\n * token with what is written beside its name to use when it is not set.\n */\n readonly position?: Readonly<\n Record<\n string,\n string | number | { readonly reference: string; readonly fallback?: string | number }\n >\n >;\n}\n\nexport interface StyleSheet {\n readonly rules: readonly StyleRule[];\n /**\n * The sheet's cascade layers, each by its name from the outermost layer in, in the order they\n * were first named. A name that starts with a null is a block with no name, which is a layer\n * no other block can name.\n */\n readonly layers?: readonly (readonly string[])[];\n /**\n * `@keyframes` by name. Global within a sheet, as they are within a document; the engine keeps\n * one registry across every sheet it sees, so a name defined in a global stylesheet is usable\n * from a component's.\n */\n readonly keyframes?: Readonly<Record<string, readonly Keyframe[]>>;\n /**\n * Whether any rule here asks about a node's position among its siblings.\n *\n * Said on the sheet because what these cost is not matching but invalidation: adding a row\n * changes what its neighbours match while nothing about those neighbours moved, so the engine\n * has to re-resolve a whole child list when it changes. It only does that where a sheet asks.\n */\n readonly structural?: true;\n /**\n * Some rule is for a generated box, `::before` or `::after`, which only a sheet compiled to\n * draw them has. Said on the sheet so the engine reads the rules of no other for one.\n */\n readonly generated?: true;\n /**\n * Some rule uses `:has()`, so what a node matches can change when something beneath it does.\n * Said on the sheet for the same reason `structural` is: the cost is invalidation, and only a\n * sheet that asks has the engine match a changed node's ancestors again.\n */\n readonly has?: true;\n /**\n * The `@font-face` rules the sheet declares, each `source` the bundler's `require` of the file.\n * The engine does not read them: `loadFonts()` in `@ng-native/expo/fonts` registers them with\n * the platform before mount.\n */\n readonly fonts?: readonly {\n readonly family: string;\n readonly source: unknown;\n readonly weight?: number;\n /** The weights a variable font covers, `font-weight: 100 900`, in place of one `weight`. */\n readonly weightRange?: readonly [number, number];\n readonly style?: string;\n /**\n * The name inside the face's file, which the build reads where it can. SwiftUI finds a face by\n * this name only, and not by the name it is registered under.\n */\n readonly postScriptName?: string;\n }[];\n}\n\n/**\n * What one node resolved to. `style` is what it renders with; `inherited` is what its children\n * start from, which is the parent's own `inherited` plus whatever inheritable values this node\n * set. Keeping the two apart is what lets resolution go downwards.\n */\n/** What a node's matched rules come to: shared between nodes that match the same way. */\ntype Styled = Pick<StyleCache, 'style' | 'inherited' | 'tokens' | 'important'>;\n\nexport interface StyleCache {\n epoch: number;\n /**\n * Identity token standing for \"the ancestor chain, as far as matching is concerned\". A node\n * mints a fresh one whenever it recomputes, and reuses its previous one when it does not, so a\n * descendant can tell whether anything above it moved with a single reference comparison.\n *\n * It has to cover more than the inherited values. `.wrap.dark .label` and\n * `:host-context(.dark) .label` both change what a descendant matches when a class toggles on\n * an ancestor, while nothing inherited changes at all, so watching the inherited map alone\n * leaves those stale.\n */\n context: object;\n /** The parent's `context` this was computed from. */\n parentContext: object;\n /**\n * Identity token standing for what an element under this node could match differently: minted\n * when the node is styled for a change that can alter that, and kept when it is styled again\n * for one that cannot, a custom property of its own or an inherited value from above. An\n * element whose parent's is the one it was last styled under matches the rules it did, so it\n * is styled from those it kept and they are not found again.\n */\n scope: object;\n /** The parent's `scope` this was computed from. */\n parentScope: object;\n /** The rules the node matched, for a styling that finds its parent's `scope` as it was. */\n rules?: readonly StyleRule[];\n /** The conditions version this was resolved under. */\n generation: number;\n style: Record<string, unknown>;\n inherited: Record<string, unknown>;\n /**\n * Custom properties in scope for this node and its descendants. Cascades exactly as inherited\n * values do, and by the same copy-on-write rule, so a subtree that defines none shares one map.\n */\n tokens: Readonly<Record<string, TokenValue>>;\n /**\n * The rules the node matched, kept only while a sheet uses `:has()`: what a node whose\n * subtree changed is compared against, to tell whether it has to be restyled.\n */\n matched?: readonly StyleRule[];\n /**\n * Set once a child takes a value from this node's own style, an `inherit` for a property CSS\n * does not hand down: a change to the node's inline style then restyles it, and its children\n * with it, where otherwise an inline style changes nothing a child resolves to.\n */\n heirs?: true;\n /**\n * The properties a rule declared `!important`, where any did: an inline style is the last of\n * the plain declarations, so for these what the rules say stands over it.\n */\n important?: ReadonlySet<string>;\n}\n\n/**\n * Whether a child is one `:empty` sees. An anchor is a comment on the web, which it does not;\n * nor text of no length, which a binding to nothing leaves behind; nor a box a rule generated,\n * which is not in the tree a selector is matched against.\n */\nexport function fills(child: StyleTarget): boolean {\n if (child.nodeKind === 'anchor' || (boxesDrawn && isGenerated(child.tag))) return false;\n return child.nodeKind !== 'text' || (child as { nodeText?: string }).nodeText !== '';\n}\n\n/** The name a type selector matches a node by. */\nconst typeOf = (node: StyleTarget): string => node.typeName ?? node.tag;\n\n/** What the matcher needs of a node. The engine's node satisfies this structurally. */\nexport interface StyleTarget {\n readonly tag: string;\n /** The name a type selector reads, where it is not `tag`: see `EngineNode.typeName`. */\n readonly typeName?: string;\n /** Set on a node of a library's drawing: see `EngineNode.namespace`. */\n readonly namespace?: string;\n readonly parent: StyleTarget | null;\n /**\n * Needed only by the selectors that ask about a node's place among its siblings, which is why\n * it is read through the parent rather than kept as an index: an index would have to be right\n * after every insertion and removal, and this is right by construction.\n */\n readonly childList?: readonly StyleTarget[];\n /**\n * Only elements are counted by the selectors that ask about position. Text is not one, and\n * neither is the anchor a structural directive leaves behind - the same reason a browser does\n * not count a comment. Absent means element, so a hand-built target needs nothing extra.\n */\n readonly nodeKind?: string;\n readonly classes: ReadonlySet<string> | null;\n readonly props: Readonly<Record<string, unknown>>;\n /** Attributes a package keeps apart from props, for selectors alone: see `attributeOf`. */\n readonly keptAttributes?: Readonly<Record<string, string>>;\n /**\n * Whether `props.style` sets a property children inherit, kept by whoever sets the style so the\n * resolver reads the style only where it can matter. Absent is false.\n */\n readonly inlineInherits?: boolean;\n /**\n * The bound declarations that are a `var()`, `[style.color]=\"'var(--brand)'\"`, as the deferred\n * declarations a rule's would be: settled with the node's tokens, last of its normal ones.\n */\n readonly boundStyle?: readonly DeferredDeclaration[] | null;\n /** A node the engine made, such as the paragraph around loose text: it only inherits. */\n readonly anonymous?: true;\n /** One of HTML's text elements the engine has styles of its own for, such as `strong`. */\n readonly styled?: true;\n /**\n * The sheet this node's own rules come from, which is the sheet of the component whose renderer\n * created it. Read from the node rather than passed in, because a node's ancestors usually\n * belong to other components and must be matched against their own sheets, not this one's.\n */\n readonly templateSheet: StyleSheet | null;\n /**\n * The sheet of the component this node is the *host* of, if it is one. Distinct from `templateSheet`,\n * which is the sheet of the component that *created* it: a host node is created by the parent,\n * so those two are always different sheets and `:host` needs the second.\n */\n hostSheet: StyleSheet | null;\n /**\n * Custom properties set on the node itself, `[style.--tint]` or `style=\"--tint: red\"`, already\n * converted (`inline-token.ts`). In scope for its own rules and its descendants', and stronger\n * than any rule's, as inline style is on the web. Absent on a hand-built target.\n */\n readonly customProperties?: Readonly<Record<string, TokenValue>> | null;\n /** Memo slot, owned by the resolver. */\n styleCache: StyleCache | null;\n /** Set when something that could change what this node matches has changed. */\n styleDirty: boolean;\n /**\n * Set when what this node matches, or a custom property it holds, may have changed, and nothing\n * that an element under it is matched by: the node is matched and styled again, and those under\n * it are styled from the rules they matched. Absent on a hand-built target.\n */\n ownDirty?: boolean;\n /**\n * Set when something beneath this node changed and a sheet uses `:has()`: the node is matched\n * again, and restyled only if the rules it matches came out different. Absent on a hand-built\n * target.\n */\n hasDirty?: boolean;\n /**\n * Set by the engine when the node's own interaction state changed and nothing else about it\n * did: a press began or ended on it or under it. It is matched again, and keeps the style it\n * has, and everything under it, when it matches the rules it did. Not for an element a rule\n * asks about from another one, which is restyled: see `usesActive`.\n *\n * Set as well when its place among its siblings changed and nothing else about it did, which\n * is the same case: what it is asked about from another element is `placeReadElsewhere`.\n */\n stateDirty?: boolean;\n /** `:focus`. Set by the engine from the native focus and blur events. */\n focused?: boolean;\n /**\n * `:active`. Set by the engine on the responder and every one of its ancestors, because a press\n * activates the whole chain on the web too, not only the deepest element under the finger.\n */\n active?: boolean;\n}\n\n/**\n * Properties CSS inherits that mean something on native.\n *\n * RN does not inherit these: a `color` on a view has no effect on a text inside it, only a text\n * inside a text inherits. CSS authors expect otherwise, and a stylesheet written against that\n * expectation would silently lose every colour, so the cascade emulates inheritance for exactly\n * this set. NativeScript does the same.\n */\nconst INHERITED = new Set([\n 'color',\n // Yoga inherits it for layout already; carried here as well so a paragraph can align by it.\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontWeight',\n 'fontVariant',\n 'letterSpacing',\n 'lineHeight',\n 'textAlign',\n 'textTransform',\n 'textDecorationLine',\n 'writingDirection',\n // CSS inherits a text shadow, and `user-select: auto` takes the parent's, so a card's\n // `text-shadow-md` or `select-none` reaches the text inside it.\n 'textShadowOffset',\n 'textShadowRadius',\n 'textShadowColor',\n 'selectable',\n // CSS inherits it, and its `none` is the element alone: a descendant's `auto` takes touches\n // again. The engine commits a computed `none` as native's `box-none`, which means that.\n 'pointerEvents',\n]);\n\n/**\n * The `pointer-events` values CSS has. Native's own `box-none` and `box-only` say what their\n * children do already, so neither is handed down.\n */\nconst INHERITED_POINTER_EVENTS = new Set(['none', 'auto']);\n\n/**\n * A shape's paint, which SVG hands down: a path under an `<svg>` with a `fill` has that fill.\n * Inherited only in a library's drawing (`StyleTarget.namespace`). An icon's shapes are left to\n * react-native-svg, which hands a group's paint down itself, from what the shape set as its own.\n */\nconst SHAPE_PAINT_INHERITED: ReadonlySet<string> = new Set(['fill', 'stroke', 'strokeWidth']);\n\n/** Whether a prop of a shape in a drawing is a paint it hands down: see `inheritFrom`. */\nexport const handsDownPaint = (key: string): boolean =>\n key === 'propList' || SHAPE_PAINT_INHERITED.has(key);\n\n/**\n * `border-style: none`, which the compiler writes as a style native does not have. On the web it\n * makes every border width 0, whichever rule set the width, so `border-hidden border-x` draws no\n * side. Settled here, once the cascade has picked a style, and not sent on.\n */\nfunction drawNoBorder(own: Record<string, unknown>): void {\n delete own['borderStyle'];\n for (const key of Object.keys(own)) if (/^border\\w*Width$/.test(key)) own[key] = 0;\n own['borderWidth'] = 0;\n}\n\n/** Each side's own style, as the compiler keeps it, and the width it is the style of. */\nconst SIDE_STYLES = ['Top', 'Right', 'Bottom', 'Left', 'Start', 'End'].map(\n (side) => [`border${side}Style`, `border${side}Width`] as const,\n);\n\n/**\n * Settle a border side by side, once the cascade has picked each side's style: a side styled\n * `none` has no width, whichever rule set one, and the one style native has is that of a side\n * that is drawn. With no side drawn and no style at all, there is no border. A side's own style\n * is not sent on: native has none.\n */\nfunction settleBorders(own: Record<string, unknown>): void {\n let drawn: unknown;\n for (const [style, width] of SIDE_STYLES) {\n if (!(style in own)) continue;\n if (own[style] === 'none') own[width] = 0;\n else drawn ??= own[style];\n delete own[style];\n }\n if (own['borderStyle'] !== 'none') return;\n if (drawn === undefined) drawNoBorder(own);\n else own['borderStyle'] = drawn;\n}\n\n/**\n * Deterministic work counters for the matcher.\n *\n * Wall-clock is noise; a compound comparison is not. Asserting on these catches an algorithmic\n * regression (a walk that became quadratic, a cache that stopped hitting) in a way that a timing\n * assertion never could without being flaky. `test/css-cost.test.ts` holds the baselines.\n *\n * The cost is one integer increment per comparison, against a Set lookup and several property\n * reads, so it does not distort what it measures.\n */\n/**\n * What a sheet asks about a pressed element. `own` is whether a rule styles one, `.button:active`,\n * which matching the pressed elements again answers. `elsewhere` is each compound that asks about\n * a pressed element from another one: `.card:active .title`, `.a:active + .b`, or `:active`\n * inside `:not()`, `:is()` or `:has()`. An element such a compound could be is restyled with\n * everything under it when it is pressed, as what it changes is not itself alone.\n */\nexport function usesActive(sheet: StyleSheet): ActiveUse {\n const known = ACTIVE_USE.get(sheet);\n if (known) return known;\n let own = false;\n const elsewhere: Compound[] = [];\n for (const rule of sheet.rules) {\n rule.compounds.forEach((compound, at) => {\n const subject = at === rule.compounds.length - 1;\n // Asked of the element itself, on the compound or in its `:is()` and `:not()`: the\n // subject's is its own, and any other compound's is of the element that compound is.\n if (activeItself(compound, elsewhere)) {\n if (subject) own = true;\n else elsewhere.push(compound);\n }\n activeAround(compound, elsewhere);\n });\n }\n const use = { own, elsewhere };\n ACTIVE_USE.set(sheet, use);\n return use;\n}\n\nconst isActive = (compound: Compound): boolean => compound.pseudo?.includes('active') === true;\n\n/**\n * Whether a compound asks about the pressed state of the element it matches: on itself, in a\n * `:not()`, or as the last compound of an `:is()` argument. The compounds before the last in\n * such an argument are other elements, and are collected as they are.\n */\nfunction activeItself(compound: Compound, elsewhere: Compound[]): boolean {\n let itself = isActive(compound);\n for (const inner of compound.not ?? []) {\n if (activeItself(inner, elsewhere)) itself = true;\n activeAround(inner, elsewhere);\n }\n for (const chain of compound.is ?? []) {\n chain.forEach((inner, at) => {\n const asked = activeItself(inner, elsewhere);\n if (asked && at === chain.length - 1) itself = true;\n else if (asked) elsewhere.push(inner);\n activeAround(inner, elsewhere);\n });\n }\n return itself;\n}\n\n/** Each compound that asks about a pressed element around the one a compound matches. */\nfunction activeAround(compound: Compound, elsewhere: Compound[]): void {\n const collect = (value: unknown): void => {\n if (!value || typeof value !== 'object') return;\n if (Array.isArray(value)) return value.forEach(collect);\n if (isActive(value as Compound)) elsewhere.push(value as Compound);\n for (const inside of Object.values(value)) collect(inside);\n };\n for (const [key, inside] of Object.entries(compound)) {\n if (key !== 'is' && key !== 'not' && key !== 'pseudo') collect(inside);\n }\n}\nexport interface ActiveUse {\n readonly own: boolean;\n readonly elsewhere: readonly Compound[];\n}\nconst ACTIVE_USE = new WeakMap<StyleSheet, ActiveUse>();\n\nexport const styleStats = {\n /** Calls to `matchesCompound`, the innermost unit of matching work. */\n compoundTests: 0,\n /** Rules considered, i.e. calls to `matches`. */\n ruleTests: 0,\n /** Nodes cascaded, as opposed to handed back from the memo. */\n nodesResolved: 0,\n /** Rules filed by key selector: each sheet's once, however many sheets come after it. */\n rulesFiled: 0,\n /** Nodes asked whether a rule `:has()` was asked for could be for them: see `isFor`. */\n subjectTests: 0,\n /** Children whose place in a list `:has()` noted, to step from one to the next. */\n placesIndexed: 0,\n};\n\nexport function resetStyleStats(): void {\n styleStats.compoundTests = 0;\n styleStats.ruleTests = 0;\n styleStats.nodesResolved = 0;\n styleStats.rulesFiled = 0;\n styleStats.subjectTests = 0;\n styleStats.placesIndexed = 0;\n}\n\n/** A prop's value as an attribute test compares it: in lower case, under the i flag. */\nconst attributeText = (actual: unknown, test: AttributeTest): string =>\n test.insensitive ? String(actual).toLowerCase() : String(actual);\n\n/**\n * `[disabled]`, and the value operators.\n *\n * A prop set to `false` or `null` counts as absent, matching the web, where an attribute is either\n * present or not and a `disabled` binding that evaluates false removes it. Everything else is\n * compared as a string, so `[tabIndex=\"0\"]` works against a numeric prop. `class` is no prop: it\n * is the element's class list, as the attribute would spell it.\n */\nfunction matchesAttribute(node: StyleTarget, test: AttributeTest): boolean {\n const actual = test.name === 'class' ? classAttribute(node) : attributeOf(node, test.name);\n if (actual === undefined || actual === null || actual === false) return false;\n if (test.operator === undefined) return true;\n // `^=`, `$=`, `*=` and `~=` with an empty value match nothing, as Selectors 4 says.\n if (test.value === '' && !EMPTY_MATCHES.has(test.operator)) return false;\n return matchesValue(attributeText(actual, test), test.operator, test.value!);\n}\n\n/**\n * A node's attribute as a selector reads it: the one a package keeps for it apart from its props,\n * where it keeps one by that name, and otherwise its prop. See `Engine.keepAttribute`.\n */\nexport const attributeOf = (node: StyleTarget, name: string): unknown =>\n node.keptAttributes?.[name] ?? node.props[name];\n\n/** The classes of a node in the order they were set, one space between each; none is absent. */\nconst classAttribute = (node: StyleTarget): string | undefined =>\n node.classes?.size ? [...node.classes].join(' ') : undefined;\n\n/** The operators an empty value can still match by: `=` and `|=`. */\nconst EMPTY_MATCHES: ReadonlySet<AttributeTest['operator']> = new Set(['equal', 'dash-match']);\n\n/** Whether an attribute's value, as `attributeText` gives it, passes an operator's test. */\nfunction matchesValue(\n value: string,\n operator: NonNullable<AttributeTest['operator']>,\n expected: string,\n): boolean {\n switch (operator) {\n case 'equal':\n return value === expected;\n case 'prefix':\n return value.startsWith(expected);\n case 'suffix':\n return value.endsWith(expected);\n case 'substring':\n return value.includes(expected);\n case 'includes':\n // `~=` matches one whole word of a list split at CSS's spaces, which a no-break space is not.\n return value.split(CSS_SPACE).includes(expected);\n case 'dash-match':\n // `|=` matches the value itself or the value followed by a hyphen, as `lang` uses.\n return value === expected || value.startsWith(`${expected}-`);\n }\n}\n\n/**\n * Whether a node is one a compound written before `::ng-deep` may be: an element of the view of\n * the component the sheet is of. Its host is one only where the compound says `:host`, which is\n * asked of it already: a class a parent gives the host is no anchor.\n */\nfunction ownedBy(node: StyleTarget, compound: Compound, sheet: StyleSheet | null): boolean {\n if (compound.host !== undefined || compound.hostContext !== undefined) return true;\n return node.templateSheet === sheet;\n}\n\n/*\n * Exempt from the complexity limit deliberately. This is a flat conjunction of independent\n * guards, not nested logic: cyclomatic complexity scores the two the same, and they are not the\n * same thing. It is also the hottest function in the matcher, called tens of thousands of times\n * per commit, so splitting each guard into its own call would cost more than it reads better.\n */\n/** The first character of a generated box's tag, `::before` or `::after`. */\nconst COLON = 58;\n\n/**\n * Whether any sheet in the process has drawn a generated box: until one has, no node is one, and\n * the checks for one below cost a boolean read. Set once and left set.\n *\n * ponytail: never turned off again, as the checks are only a cost once it is on; count the\n * engines with boxes if an app that drops its last library sheet needs the matching back.\n */\nlet boxesDrawn = false;\n\n/** Note that a sheet in play draws generated boxes: see `boxesDrawn`. */\nexport function noteGeneratedBoxes(): void {\n boxesDrawn = true;\n}\n\n// eslint-disable-next-line complexity\nfunction matchesCompound(node: StyleTarget, compound: Compound, sheet: StyleSheet | null): boolean {\n styleStats.compoundTests++;\n if (compound.host !== undefined && node.hostSheet !== sheet) return false;\n if (compound.root !== undefined && node.parent !== null) return false;\n if (compound.pseudo !== undefined) {\n for (const state of compound.pseudo) {\n if (state === 'focus' ? !node.focused : !node.active) return false;\n }\n }\n if (compound.type !== undefined) {\n // `typeOf`, asked here without the call: this is asked of every compound tested.\n if (compound.type !== (node.typeName ?? node.tag)) return false;\n // A generated box is no element to a compound that names none, `*` or a class alone, as a\n // pseudo-element is none in a browser: one character told from any element's name.\n } else if (boxesDrawn && node.tag.charCodeAt(0) === COLON) return false;\n if (compound.own !== undefined && !ownedBy(node, compound, sheet)) return false;\n if (compound.id !== undefined && node.props['nativeID'] !== compound.id) return false;\n for (const className of compound.classes) {\n if (!node.classes?.has(className)) return false;\n }\n if (compound.attributes) {\n for (const test of compound.attributes) {\n if (!matchesAttribute(node, test)) return false;\n }\n }\n if (compound.empty !== undefined && node.childList?.some(fills)) return false;\n if (compound.nth !== undefined) {\n for (const test of compound.nth) {\n if (!matchesNth(node, test)) return false;\n }\n }\n // `:not()`: the node is none of its arguments, a compound or a longer selector.\n if (compound.not) {\n for (const excluded of compound.not) {\n if (matchesCompound(node, excluded, sheet)) return false;\n }\n if (compound.notComplex) {\n for (const excluded of compound.notComplex) {\n if (matchesComplex(node, excluded, sheet)) return false;\n }\n }\n }\n // `:is()` and `:where()`: the node is one of each list of alternatives.\n if (compound.is) {\n for (const alternatives of compound.is) {\n if (!alternatives.some((option) => matchesCompound(node, option, sheet))) return false;\n }\n if (compound.isComplex) {\n for (const alternatives of compound.isComplex) {\n if (!alternatives.some((option) => matchesComplex(node, option, sheet))) return false;\n }\n }\n }\n if (compound.has) {\n for (const test of compound.has) {\n if (!hasBeneath(node, test, sheet)) return false;\n }\n }\n if (compound.parents) {\n const parent = node.parent;\n if (!parent) return false;\n for (const above of compound.parents) {\n if (!matchesCompound(parent, above, sheet)) return false;\n }\n }\n if (compound.ancestors) {\n for (const ancestor of compound.ancestors) {\n let found = false;\n // From the parent: a descendant combinator never matches the node against itself.\n for (let n = node.parent; n && !found; n = n.parent) {\n found = matchesCompound(n, ancestor, sheet);\n }\n if (!found) return false;\n }\n }\n if (compound.hostContext) {\n for (const context of compound.hostContext) {\n // The host itself counts, as it does on the web.\n let found = false;\n for (let n: StyleTarget | null = node; n && !found; n = n.parent) {\n found = matchesCompound(n, context, sheet);\n }\n if (!found) return false;\n }\n }\n return true;\n}\n\n/**\n * `:has()` answers, by the node asked and the test, while the engine commits: a rule like\n * `main:has(.missing) span` asks the same of `main` for each span in it, and each answer is a\n * walk of everything in `main`. Nothing an answer hangs on changes in a commit, and a change\n * between two drops them all: see `forgetHasAnswers`.\n */\nlet hasAnswers: Map<StyleTarget, Map<HasTest, boolean>> | null = null;\n\n/**\n * What `:has()` found of a list while the engine commits, kept and dropped with `hasAnswers`:\n * without it, asking each of a thousand items `:has(~ .x)` looks through the list once each.\n */\nlet relations: Relations | null = null;\n\n/** Keep `:has()` answers from here, or stop keeping them. */\nexport function keepHasAnswers(keep: boolean): void {\n hasAnswers = keep ? new Map() : null;\n relations = keep ? new Relations() : null;\n}\n\n/** Drop the `:has()` answers kept, for something beneath a node changed. */\nexport function forgetHasAnswers(): void {\n hasAnswers?.clear();\n if (relations) relations = new Relations();\n}\n\n/** Whether some element beneath `node`, or some child of it for `:has(> x)`, matches the test. */\nfunction hasBeneath(node: StyleTarget, test: HasTest, sheet: StyleSheet | null): boolean {\n const known = hasAnswers?.get(node)?.get(test);\n if (known !== undefined) return known;\n const found =\n test.relative?.some((relative) => hasRelative(node, relative, sheet)) === true ||\n hasCompound(node, test, sheet);\n if (hasAnswers) {\n let answers = hasAnswers.get(node);\n if (!answers) hasAnswers.set(node, (answers = new Map()));\n answers.set(test, found);\n }\n return found;\n}\n\nfunction hasCompound(node: StyleTarget, test: HasTest, sheet: StyleSheet | null): boolean {\n if (!test.any.length) return false;\n for (const child of node.childList ?? []) {\n if (child.nodeKind !== undefined && child.nodeKind !== 'element') continue;\n if (test.any.some((option) => matchesCompound(child, option, sheet))) return true;\n if (!test.child && hasCompound(child, test, sheet)) return true;\n }\n return false;\n}\n\n/** Whether a node is the last element of a selector: matched leftwards, as a rule is. */\nfunction matchesComplex(node: StyleTarget, selector: ComplexSelector, sheet: StyleSheet | null) {\n const last = selector.compounds.length - 1;\n return (\n matchesCompound(node, selector.compounds[last]!, sheet) &&\n matchPrefix(node, selector, last - 1, sheet)\n );\n}\n\nconst SIBLING_COMBINATORS: ReadonlySet<Combinator> = new Set(['next-sibling', 'later-sibling']);\n\n/**\n * Each element's place in its parent's list, found once for a `:has()` as it is asked: a list\n * of thousands asked `:has(.a + .b)` is not searched again for each element in it to find the\n * one before. Nothing changes while a selector is matched, so nothing is out of date.\n */\nclass Places {\n private readonly lists = new Map<StyleTarget, Map<StyleTarget, number>>();\n\n /** Where `node` is in its parent's list, counting what is not an element. */\n place(node: StyleTarget): number {\n const siblings = node.parent!.childList ?? [];\n let places = this.lists.get(node.parent!);\n if (!places) {\n places = new Map(siblings.map((child, at) => [child, at]));\n styleStats.placesIndexed += siblings.length;\n this.lists.set(node.parent!, places);\n }\n return places.get(node)!;\n }\n\n /** The element `step` places along from `node`: before it for -1, after it for 1. */\n element(node: StyleTarget, step: -1 | 1): StyleTarget | null {\n const siblings = node.parent?.childList;\n if (!siblings) return null;\n for (let at = this.place(node) + step; at >= 0 && at < siblings.length; at += step) {\n if (isElement(siblings[at]!)) return siblings[at]!;\n }\n return null;\n }\n}\n\n/** A `:has()` argument less its first step: `.a .b` of `~ .a .b`, asked of the `.a`. */\nconst TAILS = new WeakMap<RelativeSelector, RelativeSelector>();\n\nfunction tailOf(relative: RelativeSelector): RelativeSelector {\n let tail = TAILS.get(relative);\n if (!tail) {\n tail = { compounds: relative.compounds.slice(1), combinators: relative.combinators.slice(1) };\n TAILS.set(relative, tail);\n }\n return tail;\n}\n\n/**\n * What a `:has()` argument that starts with `+` or `~` finds of a list: which elements after\n * the node asked it can start from, the rest of it asked of each. That is the same whichever\n * element before them asks, so a list is looked through once for all of them.\n */\nclass Relations {\n readonly places = new Places();\n /** By argument and list, the place of the last element `~` can start from, or -1. */\n private readonly lastStarts = new Map<RelativeSelector, Map<StyleTarget, number>>();\n\n /** Whether `relative`, which starts with `+` or `~`, is true of `anchor`. */\n after(anchor: StyleTarget, relative: RelativeSelector, sheet: StyleSheet | null): boolean {\n if (relative.combinators[0] === 'next-sibling') {\n const next = this.places.element(anchor, 1);\n return next !== null && this.startsAt(next, relative, sheet);\n }\n const list = anchor.parent;\n return list !== null && this.places.place(anchor) < this.lastStart(list, relative, sheet);\n }\n\n private lastStart(list: StyleTarget, relative: RelativeSelector, sheet: StyleSheet | null) {\n let byList = this.lastStarts.get(relative);\n if (!byList) this.lastStarts.set(relative, (byList = new Map()));\n let last = byList.get(list);\n if (last === undefined) {\n const siblings = list.childList ?? [];\n last = siblings.length - 1;\n while (\n last >= 0 &&\n !(isElement(siblings[last]!) && this.startsAt(siblings[last]!, relative, sheet))\n ) {\n last--;\n }\n byList.set(list, last);\n }\n return last;\n }\n\n /** Whether `node` is where the first compound of `relative` is, the rest of it asked of it. */\n private startsAt(node: StyleTarget, relative: RelativeSelector, sheet: StyleSheet | null) {\n if (!matchesCompound(node, relative.compounds[0]!, sheet)) return false;\n return relative.compounds.length === 1 || hasRelative(node, tailOf(relative), sheet);\n }\n}\n\n/**\n * Whether some element is the last of a `:has()` argument asked of `anchor`: one beneath it, or\n * after it where the argument starts with `+` or `~`, and beneath one of those where it goes on\n * to a child or a descendant.\n */\nfunction hasRelative(\n anchor: StyleTarget,\n relative: RelativeSelector,\n sheet: StyleSheet | null,\n): boolean {\n const known = relations ?? new Relations();\n if (SIBLING_COMBINATORS.has(relative.combinators[0]!))\n return known.after(anchor, relative, sheet);\n return someBeneath(anchor, (node) => relativeFits(node, relative, anchor, sheet, known.places));\n}\n\n/** Whether some element beneath `node` passes `test`. */\nfunction someBeneath(node: StyleTarget, test: (node: StyleTarget) => boolean): boolean {\n for (const child of node.childList ?? []) {\n if (!isElement(child)) continue;\n if (test(child) || someBeneath(child, test)) return true;\n }\n return false;\n}\n\n/** Whether `node` is the last element of a `:has()` argument asked of `anchor`. */\nfunction relativeFits(\n node: StyleTarget,\n relative: RelativeSelector,\n anchor: StyleTarget,\n sheet: StyleSheet | null,\n places: Places,\n): boolean {\n const last = relative.compounds.length - 1;\n return (\n matchesCompound(node, relative.compounds[last]!, sheet) &&\n relativeLeft(node, last, { relative, anchor, sheet, places })\n );\n}\n\n/** What a `:has()` argument is matched with: see `relativeLeft`. */\ninterface Relating {\n readonly relative: RelativeSelector;\n readonly anchor: StyleTarget;\n readonly sheet: StyleSheet | null;\n readonly places: Places;\n}\n\n/**\n * Match what is left of `relative.compounds[at]`, which `matched` is: the compound before it,\n * or the anchor where it is the first, by the combinator between. A descendant or a later\n * sibling tries each candidate, as `matchAny` does.\n */\nfunction relativeLeft(matched: StyleTarget, at: number, relating: Relating): boolean {\n const { relative, anchor, sheet, places } = relating;\n const compound = at > 0 ? relative.compounds[at - 1]! : null;\n const fits = (node: StyleTarget): boolean =>\n compound === null\n ? node === anchor\n : matchesCompound(node, compound, sheet) && relativeLeft(node, at - 1, relating);\n switch (relative.combinators[at]) {\n case 'child':\n return matched.parent !== null && fits(matched.parent);\n case 'next-sibling': {\n const before = places.element(matched, -1);\n return before !== null && fits(before);\n }\n case 'later-sibling':\n for (let before = places.element(matched, -1); before; before = places.element(before, -1)) {\n if (fits(before)) return true;\n }\n return false;\n default:\n for (let up = matched.parent; up; up = up.parent) {\n if (fits(up)) return true;\n // Nothing above the anchor is beneath it.\n if (up === anchor) return false;\n }\n return false;\n }\n}\n\n/**\n * Right-to-left matching, as every CSS engine does it: the rightmost compound is the cheapest\n * filter and rejects almost everything immediately.\n */\nexport function matches(\n node: StyleTarget,\n rule: StyleRule,\n sheet: StyleSheet | null = null,\n): boolean {\n styleStats.ruleTests++;\n const last = rule.compounds.length - 1;\n const subject = rule.compounds[last]!;\n // From the sheet of the component this node hosts, only a :host rule reaches it. Its other\n // rules are for the elements inside that component, which is how emulated encapsulation scopes\n // them on the web; without this, a class the parent puts on the host picks up the child's rule\n // of the same name.\n if (\n sheet !== null &&\n sheet === node.hostSheet &&\n sheet !== node.templateSheet &&\n subject.host === undefined\n ) {\n return false;\n }\n if (!matchesCompound(node, subject, sheet)) return false;\n return matchPrefix(node, rule, last - 1, sheet);\n}\n\n/**\n * Match the part of a selector to the left of an already-matched compound.\n *\n * `index` is the compound still to match, counting leftwards, and `from` is where to start\n * looking. A descendant combinator tries every ancestor and, crucially, keeps trying when the\n * rest of the selector does not work out from there. Taking the first ancestor that fits and\n * committing to it misses `.a > .b .c` whenever the nearest `.b` fails the child combinator while\n * a further one satisfies it, which is what the browser differential suite caught.\n */\nfunction matchPrefix(\n matched: StyleTarget,\n rule: ComplexSelector,\n index: number,\n sheet: StyleSheet | null,\n): boolean {\n if (index < 0) return true;\n\n const compound = rule.compounds[index]!;\n // `combinators[index]` joins this compound to the one on its right.\n switch (rule.combinators[index]) {\n case 'child':\n return matchStep(matched.parent, rule, index, compound, sheet);\n case 'next-sibling':\n return matchStep(previousElement(matched), rule, index, compound, sheet);\n case 'later-sibling':\n return matchAny(previousElement(matched), previousElement, rule, index, compound, sheet);\n default:\n return matchAny(matched.parent, (node) => node.parent, rule, index, compound, sheet);\n }\n}\n\n/** A combinator with exactly one candidate: the parent, or the sibling immediately before. */\nfunction matchStep(\n candidate: StyleTarget | null,\n rule: ComplexSelector,\n index: number,\n compound: Compound,\n sheet: StyleSheet | null,\n): boolean {\n if (!candidate || !matchesCompound(candidate, compound, sheet)) return false;\n return matchPrefix(candidate, rule, index - 1, sheet);\n}\n\n/**\n * A combinator with many candidates: every ancestor, or every earlier sibling.\n *\n * Crucially it keeps trying when the rest of the selector does not work out from a candidate that\n * fits. Taking the first and committing to it misses `.a > .b .c` whenever the nearest `.b` fails\n * the child combinator while a further one satisfies it, which is what the browser differential\n * suite caught.\n */\nfunction matchAny(\n first: StyleTarget | null,\n next: (node: StyleTarget) => StyleTarget | null,\n rule: ComplexSelector,\n index: number,\n compound: Compound,\n sheet: StyleSheet | null,\n): boolean {\n for (let candidate = first; candidate; candidate = next(candidate)) {\n if (\n matchesCompound(candidate, compound, sheet) &&\n matchPrefix(candidate, rule, index - 1, sheet)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * An ancestor filter, as a browser has one. A selector of several parts is matched leftwards\n * from the node, up through its ancestors: a node a dozen boxes down is asked of a dozen\n * ancestors for each rule its last part fits, and almost every such rule names an ancestor it\n * has not got. So what a node's ancestors are, their classes, names and ids, is gathered once\n * as sixty-four bits, and a rule that names one of them whose bit is not there is passed over\n * without a walk. Two names can share a bit: that is a walk that finds nothing, as before.\n */\ntype Bits = readonly [number, number];\n\nconst BIT_OF = new Map<string, number>();\n/** Past this many names the bits are worked out again: ids made per row would be kept for ever. */\nconst BITS_KEPT = 4096;\n\n/** The bit a class, a name or an id has among the sixty-four. */\nfunction bitOf(kind: string, name: string): number {\n const key = kind + name;\n let bit = BIT_OF.get(key);\n if (bit === undefined) {\n let hash = 0;\n for (let at = 0; at < key.length; at++) hash = (Math.imul(hash, 31) + key.charCodeAt(at)) | 0;\n bit = (hash ^ (hash >>> 16)) & 63;\n // A bit is its name's hash, so one forgotten is the same when it is asked for again.\n if (BIT_OF.size >= BITS_KEPT) BIT_OF.clear();\n BIT_OF.set(key, bit);\n }\n return bit;\n}\n\nconst NAMED_ABOVE = new WeakMap<StyleRule, Bits | null>();\n\n/**\n * The classes, names and ids a rule names of the node's ancestors: of each part joined to what\n * is on its right by a descendant or a child combinator. One joined by a sibling combinator is\n * no ancestor of the node, though the parts to its left that are ancestors of it are ancestors\n * of the node as well. Null where it names none, a rule of one part among them.\n */\nfunction namedAbove(rule: StyleRule): Bits | null {\n let named = NAMED_ABOVE.get(rule);\n if (named !== undefined) return named;\n let [low, high] = [0, 0];\n const add = (bit: number) => {\n if (bit < 32) low |= 1 << bit;\n else high |= 1 << (bit - 32);\n };\n for (let at = 0; at < rule.compounds.length - 1; at++) {\n const joined = rule.combinators[at];\n if (joined === 'next-sibling' || joined === 'later-sibling') continue;\n const compound = rule.compounds[at]!;\n for (const className of compound.classes) add(bitOf('.', className));\n if (compound.type !== undefined) add(bitOf('<', compound.type));\n if (compound.id !== undefined) add(bitOf('#', compound.id));\n }\n named = low === 0 && high === 0 ? null : [low, high];\n NAMED_ABOVE.set(rule, named);\n return named;\n}\n\n/** The classes, names and ids of a node's ancestors, as bits. */\nfunction bitsAbove(node: StyleTarget): Bits {\n let [low, high] = [0, 0];\n const add = (bit: number) => {\n if (bit < 32) low |= 1 << bit;\n else high |= 1 << (bit - 32);\n };\n for (let up = node.parent; up; up = up.parent) {\n if (up.classes) for (const className of up.classes) add(bitOf('.', className));\n if (up.tag !== undefined) add(bitOf('<', typeOf(up)));\n const id = up.props?.['nativeID'];\n if (typeof id === 'string') add(bitOf('#', id));\n }\n return [low, high];\n}\n\n/** Whether what is above a node lacks something a rule names there. */\nconst lacks = (above: Bits, named: Bits): boolean =>\n (named[0] & ~above[0]) !== 0 || (named[1] & ~above[1]) !== 0;\n\nconst TAKES_PARENTS = new WeakMap<StyleRule, boolean>();\n\n/** Whether a rule has an `inherit` in it, which is settled from the parent's own style. */\nfunction takesParents(rule: StyleRule): boolean {\n let takes = TAKES_PARENTS.get(rule);\n if (takes === undefined) {\n takes = rule.deferred?.some((declaration) => declaration.inherit) === true;\n TAKES_PARENTS.set(rule, takes);\n }\n return takes;\n}\n\n/** Whether a node is one of the children CSS counts. Text and anchors are children, not elements. */\nconst isElement = (node: StyleTarget) =>\n // Asked of each sibling a rule counts: told from a generated box here, without a call.\n (node.nodeKind === undefined || node.nodeKind === 'element') &&\n !(boxesDrawn && node.tag.charCodeAt(0) === COLON);\n\n/**\n * Whether an element's name is a generated box's, `::before` or `::after`: a child the engine\n * keeps for a rule that draws one, which no selector counts among the element's children.\n */\nexport const isGenerated = (name: string): boolean => name.startsWith('::');\n\n/** A node's first `count` elements, or its last, skipping everything that is not one. */\nexport function elementsAtEnd<T extends StyleTarget>(\n siblings: readonly T[],\n count: number,\n fromEnd: boolean,\n): T[] {\n const found: T[] = [];\n for (let step = 0; step < siblings.length && found.length < count; step++) {\n const sibling = siblings[fromEnd ? siblings.length - 1 - step : step]!;\n if (isElement(sibling)) found.push(sibling);\n }\n return found;\n}\n\n/**\n * Which way from a change in a child list a sheet's rules can match differently, past the\n * elements at its two ends. An element's place from the start hangs on the elements before it\n * and on none after, so a change moves the ones after it; its place from the end is the other\n * way about.\n */\nexport interface SiblingReach {\n /**\n * How many elements after a change it reaches. All of them, `Infinity`, where it counts from\n * the start (`:nth-child(odd)`) or asks about any element before (`~`). Where it asks only\n * about the element just before (`+`), as many as its longest run of them steps along: one for\n * `.a + .b`, two for `.a + .b + .c`. Zero where it asks none of these.\n */\n readonly after: number;\n /** It counts from the end (`:nth-last-child(2)`). */\n readonly before: boolean;\n}\n\nconst REACH = new WeakMap<StyleSheet, SiblingReach>();\n\n/**\n * How far a sheet asks about a child list beyond which element is first and which is last.\n * Where no sheet reaches either way, only the elements at the two ends can match differently.\n */\nexport function siblingReach(sheet: StyleSheet): SiblingReach {\n let known = REACH.get(sheet);\n if (known === undefined) {\n const reach = { after: 0, before: false };\n for (const rule of sheet.rules) {\n reach.after = Math.max(reach.after, stepsAlong(rule.combinators));\n for (const compound of rule.compounds) countSiblings(compound, reach, false);\n }\n known = reach;\n REACH.set(sheet, known);\n }\n return known;\n}\n\n/**\n * How many elements on from one a rule's combinators read: every later one for a `~`, and\n * otherwise its longest run of `+`. A run ends at a descendant or child combinator, which steps\n * out of the list.\n */\nfunction stepsAlong(combinators: readonly Combinator[]): number {\n let longest = 0;\n let run = 0;\n for (const one of combinators) {\n if (one === 'later-sibling') return Infinity;\n run = one === 'next-sibling' ? run + 1 : 0;\n longest = Math.max(longest, run);\n }\n return longest;\n}\n\n/**\n * Note in `reach` which end a compound, or one nested in it, counts its siblings from, further\n * than the first or last. A count inside a `:has()` is read as both: what it is asked of is\n * matched again by other means, and which way it reaches is not worked out.\n */\nfunction countSiblings(\n compound: Compound,\n reach: { after: number; before: boolean },\n withinHas: boolean,\n): void {\n // Which is first and which is last is the ends, and no count. Not of one name: the first of\n // its name is wherever the others of it are not.\n const counts = (compound.nth ?? []).filter((test) => test.a !== 0 || test.b !== 1 || test.ofType);\n if (counts.some((test) => withinHas || !test.fromEnd)) reach.after = Infinity;\n if (counts.some((test) => withinHas || test.fromEnd)) reach.before = true;\n // `:is(.a + .b)`: what the node matches hangs on the element before it, as a rule's does.\n for (const selector of nestedSelectors(compound)) {\n if (!withinHas) reach.after = Math.max(reach.after, stepsAlong(selector.combinators));\n }\n for (const inner of nestedCompounds(compound)) countSiblings(inner, reach, withinHas);\n for (const inner of hasCompounds(compound)) countSiblings(inner, reach, true);\n}\n\n/**\n * A compound whose element's place is read from another element, with the classes the rule asks\n * of what that element is in: its parent's where `child`, and otherwise of anything above it.\n */\nexport interface PlaceReader {\n readonly compound: Compound;\n readonly above?: readonly string[];\n readonly child?: boolean;\n}\n\nconst PLACE_ELSEWHERE = new WeakMap<StyleSheet, readonly PlaceReader[]>();\n\n/**\n * Each compound in a sheet whose element's place among its siblings is read from another\n * element: one with something under it in the rule, `.row:nth-child(odd) .label` and\n * `.a + .b .c`, or one an `:is()` or `:host-context()` looks for above the element styled.\n *\n * An element whose place changed is matched again, and where it matches the rules it did, it\n * and everything under it are left as they were: its own rules are all that its place can\n * change. Not an element one of these could be. What is under that one can match differently\n * though it matches the same, so it is styled again with everything under it.\n *\n * A place read by the element a rule styles, or by the elements before it that the rule steps\n * from (`.a:first-child + .b`), is that element's own: the rules it matches say.\n */\nexport function placeReadElsewhere(sheet: StyleSheet): readonly PlaceReader[] {\n let known = PLACE_ELSEWHERE.get(sheet);\n if (known === undefined) {\n const elsewhere: PlaceReader[] = [];\n for (const rule of sheet.rules) {\n // A run of compounds joined by `+` and `~` is one child list. Every run but the last is\n // above the element styled, and its last compound is the element the rest hangs under.\n let start = 0;\n rule.compounds.forEach((compound, at) => {\n placeReadAbove(compound, elsewhere, at < rule.compounds.length - 1);\n const joined = rule.combinators[at];\n if (joined === 'next-sibling' || joined === 'later-sibling') return;\n const run = rule.compounds.slice(start, at + 1);\n // What the run is in: the compound before it, which every element of it is under.\n const list = rule.compounds[start - 1];\n const child = rule.combinators[start - 1] === 'child';\n start = at + 1;\n const above = at < rule.compounds.length - 1;\n if (above && (run.length > 1 || run.some(readsPlace)))\n elsewhere.push({ compound, above: list?.classes, child });\n });\n }\n known = elsewhere;\n PLACE_ELSEWHERE.set(sheet, known);\n }\n return known;\n}\n\nconst NAMED_BESIDE = new WeakMap<StyleSheet, ReadonlySet<string>>();\n\n/**\n * The props a sheet's rules ask of an element before another in a child list, `[data-on] ~ .x`:\n * those whose change can restyle the elements after it. An id is asked as `nativeID`.\n */\nexport function namedBeside(sheet: StyleSheet): ReadonlySet<string> {\n let named = NAMED_BESIDE.get(sheet);\n if (named === undefined) {\n const found = new Set<string>();\n for (const rule of sheet.rules) besideIn(rule, rule, found);\n NAMED_BESIDE.set(sheet, (named = found));\n }\n return named;\n}\n\n/**\n * Add to `into` what each compound joined to a later one by `+` or `~` asks, in a selector and\n * in each one nested in it. A `:has()` argument starts at the element it is asked of, so one\n * with a sibling in it has every prop the rule names added.\n */\nfunction besideIn(selector: unknown, rule: StyleRule, into: Set<string>): void {\n if (selector === null || typeof selector !== 'object') return;\n if (Array.isArray(selector)) return selector.forEach((inner) => besideIn(inner, rule, into));\n const { compounds, combinators } = selector as Partial<ComplexSelector>;\n if (Array.isArray(compounds) && Array.isArray(combinators)) {\n const relative = combinators.length === compounds.length;\n combinators.forEach((joined, at) => {\n if (joined !== 'next-sibling' && joined !== 'later-sibling') return;\n if (relative) propsNamed(rule, into);\n else propsNamed(compounds[at], into);\n });\n }\n for (const [key, inner] of Object.entries(selector)) {\n if (!DECLARED.has(key)) besideIn(inner, rule, into);\n }\n}\n\n/** Add every prop a part of a selector asks about to `into`: each attribute, and an id. */\nfunction propsNamed(part: unknown, into: Set<string>): void {\n if (part === null || typeof part !== 'object') return;\n if (Array.isArray(part)) return part.forEach((inner) => propsNamed(inner, into));\n const { attributes, id } = part as Partial<Compound>;\n if (id !== undefined) into.add('nativeID');\n for (const test of attributes ?? []) into.add(test.name);\n for (const [key, inner] of Object.entries(part)) if (!DECLARED.has(key)) propsNamed(inner, into);\n}\n\n/** Whether a compound, or one nested in it at any depth, asks about a place in a child list. */\nfunction readsPlace(compound: Compound): boolean {\n if (compound.nth?.length) return true;\n return [...nestedCompounds(compound), ...hasCompounds(compound)].some(readsPlace);\n}\n\n/**\n * Collect the compounds nested in one that are matched against an element above the one it is\n * matched against, and ask about that element's place: `:is(.group:first-child *)`. `above`\n * says the compound is itself matched against an element above the one styled.\n */\nfunction placeReadAbove(compound: Compound, elsewhere: PlaceReader[], above: boolean): void {\n const over = [\n ...(compound.ancestors ?? []),\n ...(compound.parents ?? []),\n ...(compound.hostContext ?? []),\n ];\n for (const inner of over) if (readsPlace(inner)) elsewhere.push({ compound: inner });\n // `:is(.a + .b) .c` or `:not(:first-child .b)`: an element whose place changed can change what\n // one under it matches, which is told from no class here. Only such sheets pay. Of the element\n // styled, `.b:is(.a ~ *)` reads what is before the element alone, as a rule's own `~` does.\n const reads = above ? beside : readFromUnder;\n if (nestedSelectors(compound).some(reads)) elsewhere.push({ compound: { classes: [] } });\n for (const inner of over) placeReadAbove(inner, elsewhere, true);\n placeReadNested(compound, elsewhere, above);\n}\n\n/**\n * `placeReadAbove` of the compounds nested in one: those of its `:is()` and `:not()` are matched\n * against the element it is, and those of a longer selector in one before its last against others.\n */\nfunction placeReadNested(compound: Compound, elsewhere: PlaceReader[], above: boolean): void {\n for (const inner of [...(compound.not ?? []), ...(compound.is ?? []).flat()]) {\n placeReadAbove(inner, elsewhere, above);\n }\n for (const selector of nestedSelectors(compound)) {\n const last = selector.compounds.length - 1;\n selector.compounds.forEach((inner, at) => placeReadAbove(inner, elsewhere, above || at < last));\n }\n}\n\n/** Whether what a selector matches hangs on where an element is among those beside it. */\nconst beside = (one: ComplexSelector): boolean =>\n one.combinators.some((each) => SIBLING_COMBINATORS.has(each)) ||\n (one.compounds.length > 1 && one.compounds.some(readsPlace));\n\n/**\n * Whether a selector reads the place of an element above the one it ends at: a run of compounds\n * joined by `+` and `~` before a descendant or child combinator, `.a + .b .c`, or a compound\n * there that asks its place, `:first-child > .c`.\n */\nfunction readFromUnder(one: ComplexSelector): boolean {\n let start = 0;\n for (let at = 0; at < one.combinators.length; at++) {\n if (SIBLING_COMBINATORS.has(one.combinators[at]!)) continue;\n const run = one.compounds.slice(start, at + 1);\n if (run.length > 1 || run.some(readsPlace)) return true;\n start = at + 1;\n }\n return false;\n}\n\n/** The selectors of more than a compound nested in one, in its `:is()` and its `:not()`. */\nconst nestedSelectors = (compound: Compound): ComplexSelector[] => [\n ...(compound.notComplex ?? []),\n ...(compound.isComplex ?? []).flat(),\n];\n\n/** The compounds nested in one, a `:has()`'s apart. */\nconst nestedCompounds = (compound: Compound): Compound[] => [\n ...(compound.not ?? []),\n ...(compound.is ?? []).flat(),\n ...(compound.ancestors ?? []),\n ...(compound.parents ?? []),\n ...(compound.hostContext ?? []),\n ...nestedSelectors(compound).flatMap((selector) => selector.compounds),\n];\n\n/** The compounds of a compound's `:has()` arguments. */\nconst hasCompounds = (compound: Compound): Compound[] =>\n (compound.has ?? []).flatMap((test) => [\n ...test.any,\n ...(test.relative ?? []).flatMap((relative) => relative.compounds),\n ]);\n\n/** The element before this one, skipping everything that is not one. */\nfunction previousElement(node: StyleTarget): StyleTarget | null {\n const siblings = node.parent?.childList;\n if (!siblings) return null;\n for (let i = siblings.indexOf(node) - 1; i >= 0; i--) {\n if (isElement(siblings[i]!)) return siblings[i]!;\n }\n return null;\n}\n\n/**\n * Whether a node's position satisfies `an + b`.\n *\n * ponytail: the general case counts the node's siblings, so a rule like `:nth-child(2n)` over a\n * long list is quadratic in it. The two that matter - first and last - are answered without\n * counting, and the rest wait for a list that is actually slow.\n */\nfunction matchesNth(node: StyleTarget, test: NthTest): boolean {\n const siblings = node.parent?.childList;\n if (!siblings) return false;\n\n if (test.a === 0 && test.b === 1 && !test.ofType) {\n return (test.fromEnd ? lastElement(siblings) : firstElement(siblings)) === node;\n }\n\n const from = countPosition(node, siblings, test.fromEnd === true, test.ofType === true);\n if (from === 0) return false;\n // `an + b` for some whole number of steps, which is what CSS counts from.\n if (test.a === 0) return from === test.b;\n const steps = (from - test.b) / test.a;\n return Number.isInteger(steps) && steps >= 0;\n}\n\n/** Which element this is among its siblings, counting from one end or the other. Zero if absent. */\n/**\n * Drop from the pending deferred set every property a later rule has now set outright.\n *\n * Per property rather than per declaration: one deferred declaration can cover four sides, and a\n * later `padding-left` should take only that side away from it.\n */\nfunction overriddenBy(\n deferred: DeferredDeclaration[],\n declarations: Readonly<Record<string, unknown>>,\n important: boolean,\n): DeferredDeclaration[] | null {\n const kept: DeferredDeclaration[] = [];\n for (const declaration of deferred) {\n // A plain declaration cannot take anything from an important one.\n if (declaration.important && !important) {\n kept.push(declaration);\n continue;\n }\n const props = declaration.props.filter((prop) => !(prop in declarations));\n if (props.length === declaration.props.length) kept.push(declaration);\n else if (props.length) kept.push({ ...declaration, props });\n }\n return kept.length ? kept : null;\n}\n\n/**\n * The logical property and the physical one for the same corner or edge, left to right. CSS\n * settles the two as one property, the later declaration winning. A native view has a prop for\n * each and takes one whatever their order: React Native the physical corner, Yoga the logical\n * edge. So a declaration of either takes the other out of the cascade.\n */\nconst SIDES_LTR: readonly (readonly [logical: string, physical: string])[] = [\n ['borderStartStartRadius', 'borderTopLeftRadius'],\n ['borderStartEndRadius', 'borderTopRightRadius'],\n ['borderEndStartRadius', 'borderBottomLeftRadius'],\n ['borderEndEndRadius', 'borderBottomRightRadius'],\n ...['margin', 'padding'].flatMap((box) => [\n [`${box}Start`, `${box}Left`] as const,\n [`${box}End`, `${box}Right`] as const,\n ]),\n ...['Width', 'Color'].flatMap((part) => [\n [`borderStart${part}`, `borderLeft${part}`] as const,\n [`borderEnd${part}`, `borderRight${part}`] as const,\n ]),\n ['start', 'left'],\n ['end', 'right'],\n];\n\nconst mirrored = (physical: string): string =>\n physical.includes('Left') || physical === 'left'\n ? physical.replace('Left', 'Right').replace('left', 'right')\n : physical.replace('Right', 'Left').replace('right', 'left');\n\n/** Each property's other form, both ways, in a layout of each direction. */\nconst twins = (pairs: readonly (readonly [string, string])[]): Readonly<Record<string, string>> =>\n Object.fromEntries(\n pairs.flatMap(([logical, physical]) => [\n [logical, physical],\n [physical, logical],\n ]),\n );\n\nconst TWIN: Readonly<Record<'ltr' | 'rtl', Readonly<Record<string, string>>>> = {\n ltr: twins(SIDES_LTR),\n rtl: twins(SIDES_LTR.map(([logical, physical]) => [logical, mirrored(physical)] as const)),\n};\n\n/** The props of each edge of a box across and down, in each form Yoga or React Native reads. */\nconst across = (box: string): string[] =>\n ['Left', 'Right', 'Start', 'End', 'InlineStart', 'InlineEnd'].map((side) => `${box}${side}`);\nconst down = (box: string): string[] =>\n ['Top', 'Bottom', 'BlockStart', 'BlockEnd'].map((side) => `${box}${side}`);\n\n/** A box's shorthand for every edge, across and down, keyed by the name an inline style uses. */\nfunction boxShorthands(\n all: string,\n edges: { across: string[]; down: string[] },\n axes: { across: string[]; down: string[] },\n): [string, string[]][] {\n return [\n [all, [...edges.across, ...edges.down, ...axes.across, ...axes.down]],\n // An axis's own name among them is skipped as one the element sets itself.\n ...axes.across.map((axis): [string, string[]] => [axis, [...edges.across, ...axes.across]]),\n ...axes.down.map((axis): [string, string[]] => [axis, [...edges.down, ...axes.down]]),\n ];\n}\n\n/** Every corner, physical and logical, by the name of its radius. */\nconst CORNERS = [\n ...['TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', 'TopStart', 'TopEnd'],\n ...['BottomStart', 'BottomEnd', 'StartStart', 'StartEnd', 'EndStart', 'EndEnd'],\n].map((corner) => `border${corner}Radius`);\n\n/**\n * The props each shorthand an inline style can set covers, in every form a native view reads\n * them: physical, logical and the aliases Yoga takes. A stylesheet's shorthand is compiled to its\n * longhands, so only an element's own style commits one as it is written, and there CSS has it\n * win over a rule's longhand, where Yoga and React Native read the more specific edge or corner.\n */\nconst COVERS: ReadonlyMap<string, readonly string[]> = new Map([\n ...['margin', 'padding'].flatMap((box) =>\n boxShorthands(\n box,\n { across: across(box), down: down(box) },\n { across: [`${box}Horizontal`, `${box}Inline`], down: [`${box}Vertical`, `${box}Block`] },\n ),\n ),\n ...boxShorthands(\n 'inset',\n {\n across: ['left', 'right', 'start', 'end', 'insetInlineStart', 'insetInlineEnd'],\n down: ['top', 'bottom', 'insetBlockStart', 'insetBlockEnd'],\n },\n { across: ['insetInline'], down: ['insetBlock'] },\n ),\n ['gap', ['rowGap', 'columnGap']],\n ['borderWidth', [...across('border'), ...down('border')].map((side) => `${side}Width`)],\n ['borderColor', [...across('border'), ...down('border'), 'borderBlock'].map((s) => `${s}Color`)],\n ['borderBlockColor', down('border').map((side) => `${side}Color`)],\n ['borderRadius', CORNERS],\n ['flex', ['flexGrow', 'flexShrink', 'flexBasis']],\n]);\n\n/**\n * The longhands Yoga reads `flex` as when none is set (`Node::resolveFlexGrow`,\n * `resolveFlexShrink`, `processFlexBasis`), so an inline `flex` means the same over a class's.\n * Null for a value that is no finite number, which covers nothing.\n */\nfunction flexParts(n: unknown): Record<string, unknown> | null {\n if (typeof n !== 'number' || !Number.isFinite(n)) return null;\n return { flexGrow: n > 0 ? n : 0, flexShrink: n < 0 ? -n : 0, flexBasis: n > 0 ? 0 : 'auto' };\n}\n\n/**\n * Whether a value is several CSS values, `4px 8px` or `4px / 8px`, split on whitespace outside\n * brackets. Native takes none of them for a side, so a side keeps its own.\n *\n * ponytail: a side keeps its own rather than taking its part of the value. The renderer's\n * `longhands` splits `padding`, `margin`, `inset` and `gap` into their parts; the others can join it.\n */\nfunction severalValues(value: unknown): boolean {\n if (typeof value !== 'string') return false;\n let flat = value;\n for (let inner = flat; (inner = flat.replace(/\\([^()]*\\)/g, '()')) !== flat;) flat = inner;\n return flat.split(CSS_SPACE).filter(Boolean).length > 1;\n}\n\n/**\n * What a shorthand's value gives each side it covers: undefined for the value itself, the parts\n * of a `flex`, or null for nothing, as for several values.\n */\nfunction partsOf(shorthand: string, value: unknown): Record<string, unknown> | null | undefined {\n if (severalValues(value)) return null;\n return shorthand === 'flex' && value != null ? flexParts(value) : undefined;\n}\n\n/**\n * How late React Native applies a shorthand to an edge it shares with another\n * (`YogaLayoutableShadowNode`): the box's own name, then its axis, then the logical axis.\n */\nfunction rankOf(shorthand: string): number {\n if (/(Inline|Block)$/.test(shorthand)) return 2;\n return /(Horizontal|Vertical|BlockColor)$/.test(shorthand) ? 1 : 0;\n}\n\n/** The shorthands covering each prop, the one React Native reads first ahead of the rest. */\nconst COVERED_BY: ReadonlyMap<string, readonly string[]> = (() => {\n const by = new Map<string, string[]>();\n for (const [shorthand, keys] of COVERS) {\n for (const key of keys) by.set(key, [...(by.get(key) ?? []), shorthand]);\n }\n for (const shorthands of by.values()) shorthands.sort((a, b) => rankOf(b) - rankOf(a));\n return by;\n})();\n\n/** Whether an element sets a shorthand itself, inline or bound from a token. */\nconst setsItself = (\n shorthand: string,\n inline: Readonly<Record<string, unknown>>,\n bound: ReadonlyMap<string, unknown> | undefined,\n): boolean => inline[shorthand] != null || bound?.has(shorthand) === true;\n\n/** Whether an element sets any shorthand that covers a prop, so that there is anything to do. */\nfunction setsAnyShorthand(\n inline: Readonly<Record<string, unknown>>,\n bound: ReadonlyMap<string, unknown> | undefined,\n): boolean {\n for (const key in inline) if (inline[key] != null && COVERS.has(key)) return true;\n if (bound) for (const key of bound.keys()) if (COVERS.has(key)) return true;\n return false;\n}\n\nconst UNCOVERED = Symbol('uncovered');\n\n/** What `key` takes from the first of its shorthands the element sets and that gives it one. */\nfunction coveredValue(\n key: string,\n shorthands: readonly string[],\n style: Readonly<Record<string, unknown>>,\n inline: Readonly<Record<string, unknown>>,\n bound: ReadonlyMap<string, unknown> | undefined,\n): unknown {\n for (const shorthand of shorthands) {\n if (!setsItself(shorthand, inline, bound)) continue;\n const parts = partsOf(shorthand, style[shorthand]);\n if (parts !== null) return parts ? parts[key] : style[shorthand];\n }\n return UNCOVERED;\n}\n\n/**\n * Gives each prop in `style` that a shorthand the element sets itself covers the shorthand's\n * value: one in its inline style, `inline`, or bound from a token, `bound`. The value rather than\n * nothing, so a transition of the side eases to it, as in a browser. Not a prop the element sets\n * as well, which Yoga reads over its shorthand as before, nor one a rule marked `!important`,\n * which beats the element's own declaration. Of two shorthands over one prop, the one React Native\n * reads: `paddingInline` over `paddingHorizontal`, whichever was written first.\n *\n * Per commit for every element with a style of its own, so it walks the props in `style`, a few,\n * rather than every side and corner a shorthand covers.\n */\nexport function underOwnShorthands(\n style: Record<string, unknown>,\n inline: Readonly<Record<string, unknown>>,\n bound: ReadonlyMap<string, unknown> | undefined,\n important: ReadonlySet<string> | undefined,\n): void {\n if (!setsAnyShorthand(inline, bound)) return;\n for (const key in style) {\n const shorthands = COVERED_BY.get(key);\n if (!shorthands || key in inline || bound?.has(key) || important?.has(key)) continue;\n const next = coveredValue(key, shorthands, style, inline, bound);\n if (next === UNCOVERED) continue;\n if (next == null) delete style[key];\n else style[key] = next;\n }\n}\n\n/** The properties of a rule that have another form, plain and important, or null for neither. */\ninterface Sided {\n readonly plain: readonly string[];\n readonly important: readonly string[];\n}\n\nconst sidedOf = new WeakMap<StyleRule, Sided | null>();\n\nfunction sided(rule: StyleRule): Sided | null {\n let found = sidedOf.get(rule);\n if (found !== undefined) return found;\n const twin = TWIN.ltr;\n const plain = Object.keys(rule.declarations).filter((key) => key in twin);\n const important = rule.important ? Object.keys(rule.important).filter((key) => key in twin) : [];\n for (const declaration of rule.deferred ?? []) {\n for (const prop of declaration.props) {\n if (prop in twin) (declaration.important ? important : plain).push(prop);\n }\n }\n found = plain.length || important.length ? { plain, important } : null;\n sidedOf.set(rule, found);\n return found;\n}\n\n/** Of `keys`, in the order a rule wrote them, each whose other form comes after it. */\nfunction writtenEarlier(keys: readonly string[], twin: Readonly<Record<string, string>>): string[] {\n return keys.filter((key, at) => keys.indexOf(twin[key]!) > at);\n}\n\n/** The other form of each of `keys`, as the record `overriddenBy` reads. */\nfunction twinsOf(\n keys: readonly string[],\n twin: Readonly<Record<string, string>>,\n): Record<string, true> {\n const out: Record<string, true> = {};\n for (const key of keys) out[twin[key]!] = true;\n return out;\n}\n\n/**\n * One cascade's settling of the corners and edges set in both forms: each rule's are taken out of\n * what the rules before it left, in the form the rule does not use.\n */\nclass OtherForms {\n /** Worked out for the first rule that sets a corner or an edge, which most elements have none of. */\n private twin: Readonly<Record<string, string>> | null = null;\n private overImportant: Record<string, true> | null = null;\n private readonly direction: () => 'ltr' | 'rtl';\n\n constructor(direction: () => 'ltr' | 'rtl') {\n this.direction = direction;\n }\n\n /** Before `rule` is applied: the other form of what it sets goes, as the same property would. */\n before(\n rule: StyleRule,\n normal: Record<string, unknown>,\n important: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n const sides = sided(rule);\n if (!sides) return deferred;\n const twin = (this.twin ??= TWIN[this.direction()]);\n const plain = twinsOf(sides.plain, twin);\n for (const key in plain) delete normal[key];\n let kept = deferred && overriddenBy(deferred, plain, false);\n if (!sides.important.length) return kept;\n const gone = twinsOf(sides.important, twin);\n for (const key in gone) delete important[key];\n kept &&= overriddenBy(kept, gone, true);\n Object.assign((this.overImportant ??= {}), gone);\n return kept;\n }\n\n /**\n * Once `rule` is applied, its deferred values among `deferred`: where it wrote both forms, the\n * one it wrote later stands, among its plain declarations and among its important ones. The\n * order is the rule's own, sent with it, since a value settled on device is in another list.\n */\n within(\n rule: StyleRule,\n normal: Record<string, unknown>,\n important: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n if (!rule.sides && !rule.importantSides) return deferred;\n const twin = (this.twin ??= TWIN[this.direction()]);\n let kept = deferred;\n const settle = (order: readonly string[], into: Record<string, unknown>, tier: boolean) => {\n const lost: Record<string, true> = {};\n for (const key of writtenEarlier(order, twin)) {\n delete into[key];\n lost[key] = true;\n }\n kept &&= overriddenBy(kept, lost, tier);\n };\n if (rule.sides) settle(rule.sides, normal, false);\n if (rule.importantSides) settle(rule.importantSides, important, true);\n return kept;\n }\n\n /** An important one stands over the other form wherever that was set, as over its own. */\n after(\n normal: Record<string, unknown>,\n deferred: DeferredDeclaration[] | null,\n ): DeferredDeclaration[] | null {\n if (!this.overImportant) return deferred;\n for (const key in this.overImportant) delete normal[key];\n return deferred && overriddenBy(deferred, this.overImportant, false);\n }\n}\n\n/**\n * The deferred values still standing once `rule` has been applied, plus its own.\n *\n * A plain declaration from this rule beats a `var()` from an earlier one. Deferred values are\n * resolved after the cascade has run, so without this a token would win whatever the cascade\n * said: `.row { background: var(--surface) }` would repaint over\n * `.row:nth-child(odd) { background: ... }`, which is a rule with a pseudo-class on top of the\n * same class and should win. An important one survives a plain declaration, and only an important\n * declaration takes it away.\n */\nfunction carryDeferred(\n deferred: DeferredDeclaration[] | null,\n rule: StyleRule,\n): DeferredDeclaration[] | null {\n let kept = deferred;\n if (kept && Object.keys(rule.declarations).length) {\n kept = overriddenBy(kept, rule.declarations, false);\n }\n if (kept && rule.important) kept = overriddenBy(kept, rule.important, true);\n if (rule.deferred) (kept ??= []).push(...rule.deferred);\n return kept;\n}\n\nconst NO_DECLARATIONS: Readonly<Record<string, unknown>> = Object.freeze({});\n\nconst pick = <T>(from: Readonly<Record<string, T>>, names: readonly string[]): Record<string, T> =>\n Object.fromEntries(names.map((name) => [name, from[name]!]));\n\nconst isImportant = (rule: StyleRule): boolean =>\n rule.important !== undefined ||\n rule.importantTokens !== undefined ||\n rule.deferred?.some((one) => one.important) === true;\n\n/**\n * The matched rules in the order their declarations apply, weakest first.\n *\n * That is the order they matched in, unless a layered rule is important. Layers turn round for\n * `!important`: an important declaration in a layer beats one in a later layer, and both beat one\n * in no layer. So each such rule is split, its plain declarations where it matched, and its\n * important ones after every plain one, in the layers' order reversed.\n */\nfunction byImportance(\n matched: readonly StyleRule[],\n places: WeakMap<StyleRule, LayerPlace>,\n): readonly StyleRule[] {\n if (!matched.some((rule) => rule.layer !== undefined && isImportant(rule))) return matched;\n const plain = matched.map((rule) =>\n isImportant(rule)\n ? {\n ...rule,\n important: undefined,\n importantTokens: undefined,\n deferred: rule.deferred?.filter((one) => !one.important),\n }\n : rule,\n );\n const important = matched\n .filter(isImportant)\n // Stable, so rules of one layer keep the order their specificity gave them. Sorted before\n // they are copied, since a rule's place is kept by the rule itself.\n .sort((a, b) => layerOrder(places.get(b), places.get(a)))\n .map((rule) => ({\n ...rule,\n declarations: NO_DECLARATIONS,\n // Its important custom properties alone: the plain ones were applied where it matched.\n tokens: rule.importantTokens && pick(rule.tokens!, rule.importantTokens),\n deferred: rule.deferred?.filter((one) => one.important),\n }));\n return [...plain, ...important];\n}\n\nfunction countPosition(\n node: StyleTarget,\n siblings: readonly StyleTarget[],\n fromEnd: boolean,\n ofType: boolean,\n): number {\n let position = 0;\n let seen = 0;\n for (const sibling of siblings) {\n if (!isElement(sibling) || (ofType && typeOf(sibling) !== typeOf(node))) continue;\n seen++;\n if (sibling === node) position = seen;\n }\n if (position === 0) return 0;\n return fromEnd ? seen - position + 1 : position;\n}\n\nfunction firstElement(siblings: readonly StyleTarget[]): StyleTarget | null {\n for (const sibling of siblings) if (isElement(sibling)) return sibling;\n return null;\n}\n\nfunction lastElement(siblings: readonly StyleTarget[]): StyleTarget | null {\n for (let i = siblings.length - 1; i >= 0; i--) {\n if (isElement(siblings[i]!)) return siblings[i]!;\n }\n return null;\n}\n\n/**\n * How much specificity a component's own rules gain over the application's global sheet.\n *\n * One class, which is precisely what Angular's emulated encapsulation already grants them by\n * rewriting a component rule to carry an `[_ngcontent-x]` attribute. Matching that keeps the\n * precedence people already have in their fingers rather than inventing a rule for native.\n */\nconst COMPONENT_SPECIFICITY_BUMP = 1_000;\n\n/**\n * Where a layer is among every layer the app's sheets have named: at each depth, its place among\n * the layers nested in its parent, in the order they were first named.\n */\ntype LayerPlace = readonly number[];\n\n/** The layers named so far at one depth, each with its place and the layers nested in it. */\ninterface LayerNames {\n readonly place: number;\n readonly nested: Map<string, LayerNames>;\n}\n\n/**\n * Two rules' layers, weakest first: a layer before each one named after it, a layer's nested\n * layers before its own rules, and every layered rule before a rule in no layer.\n */\nfunction layerOrder(a: LayerPlace | undefined, b: LayerPlace | undefined): number {\n if (a === b) return 0;\n if (a === undefined) return 1;\n if (b === undefined) return -1;\n const shared = Math.min(a.length, b.length);\n for (let depth = 0; depth < shared; depth++) {\n if (a[depth] !== b[depth]) return a[depth]! - b[depth]!;\n }\n // One is nested in the other, whose own rules are the stronger.\n return b.length - a.length;\n}\n\n/**\n * The engine's own styles for HTML's text elements, as rules to match before any a stylesheet\n * holds, so every rule an author writes beats them whatever its specificity, as a browser's own\n * sheet is beaten. Offered only to a node marked `styled`, which few are.\n */\nconst ELEMENT_ENTRIES: readonly RuleEntry[] = ELEMENT_STYLES.rules.map((rule) => ({\n rule,\n sheet: ELEMENT_STYLES,\n weight: rule.specificity,\n}));\n\n/** One rule in a cascade: the sheet it came from, which `:host` needs, and its weight here. */\ninterface RuleEntry {\n readonly rule: StyleRule;\n readonly sheet: StyleSheet;\n readonly weight: number;\n}\n\n/**\n * The bucket a rule is filed under: the most selective simple selector in its rightmost compound,\n * which is what a browser calls the key selector.\n *\n * Matching counts leftwards from that compound, so if it cannot match a node then nothing to its\n * left needs looking at. Anything that could match a node whose name, id and classes say nothing -\n * an attribute test, `:host`, `:is()`, a bare pseudo-class, `*` - goes in the universal bucket and\n * is offered to everything, because the alternative is a rule that silently stops applying.\n */\nexport function ruleKey(rule: StyleRule): string {\n return ruleKeys(rule)[0]!;\n}\n\n/**\n * Every bucket a rule is filed under. One, but for a rule whose rightmost compound is only an\n * `:is()` of compounds that each have a key: it is filed under each of theirs, since a node it\n * matches has one of them.\n *\n * Two kinds of rule say nothing of the node's own name and still say whose child it is: one for\n * a generated box, `.card::before`, which is `.card > ::before` here, and one for any child,\n * `.row > *`. Each is filed under the parent's class, and offered to the children of an element\n * that has it. Filed by the box's own name, every `::before` rule there is would be offered to\n * every such box.\n */\nexport function ruleKeys(rule: StyleRule): readonly string[] {\n const key = rule.compounds[rule.compounds.length - 1];\n if (!key) return EVERY_NODE;\n if (key.classes.length) return [`class:${key.classes[0]}`];\n if (key.id !== undefined) return [`id:${key.id}`];\n const held = parentClass(rule, key);\n if (key.type !== undefined && !(held !== undefined && isGenerated(key.type))) {\n return [`type:${key.type}`];\n }\n if (held !== undefined) return [`in:${held}`];\n return alternativeKeys(key) ?? attributeKey(key) ?? ancestorKeys(rule, key) ?? EVERY_NODE;\n}\n\n/**\n * The buckets of a rule for anything inside an element with a class, `.item:focus *`: under the\n * class, or each class the element may have instead. Offered to what has such an element\n * somewhere over it, where the universal bucket has every element walk to the root to find none.\n */\nfunction ancestorKeys(rule: StyleRule, key: Compound): string[] | undefined {\n const joined = rule.combinators[rule.combinators.length - 1];\n const above =\n key.ancestors?.[0] ??\n (joined === 'descendant' ? rule.compounds[rule.compounds.length - 2] : undefined);\n if (!above) return undefined;\n if (above.classes.length) return [`under:${above.classes[0]}`];\n const any = above.is?.[0];\n if (!any?.length || any.some((one) => !one.classes.length)) return undefined;\n return any.map((one) => `under:${one.classes[0]}`);\n}\n\n/**\n * The bucket of a rule that names its element by an attribute and nothing else, `[ngpButton]`:\n * a prop the element has to have, which is how a headless library names every element it\n * styles. Not `class`, which is no prop of the element's to find the bucket by.\n */\nfunction attributeKey(key: Compound): string[] | undefined {\n const named = key.attributes?.find((test) => test.name !== 'class');\n return named ? [`attr:${named.name}`] : undefined;\n}\n\n/** A class the node's parent has to have for the rule to match, where its selector says one. */\nfunction parentClass(rule: StyleRule, key: Compound): string | undefined {\n const written = key.parents?.find((compound) => compound.classes.length > 0);\n if (written) return written.classes[0];\n if (rule.combinators[rule.combinators.length - 1] !== 'child') return undefined;\n return rule.compounds[rule.compounds.length - 2]?.classes[0];\n}\n\n/** The keys of each compound a bare `:is()` takes, or nothing where one of them has none. */\nfunction alternativeKeys(key: Compound): string[] | undefined {\n const any = key.is?.[0];\n if (!any?.length) return undefined;\n const keys: string[] = [];\n for (const one of any) {\n if (one.classes.length) keys.push(`class:${one.classes[0]}`);\n else if (one.id !== undefined) keys.push(`id:${one.id}`);\n else if (one.type !== undefined) keys.push(`type:${one.type}`);\n else return undefined;\n }\n return keys;\n}\n\nconst UNIVERSAL = '*';\nconst EVERY_NODE: readonly string[] = [UNIVERSAL];\n\n/**\n * Where each kind of sheet is filed, as a multiple of the room one sheet's rules are given: the\n * global sheet first, then a host's own, its creator's, and each added sheet after those.\n */\nconst SHEET_ROOM = 1_000_000;\nconst HOSTS = 1;\nconst CREATED = 2;\nconst ADDED = 3;\n\n/** A rule in an index, and where it comes among rules of the same weight: the order it was written in. */\ninterface IndexedEntry {\n readonly entry: RuleEntry;\n readonly at: number;\n}\n\nexport interface RuleIndex {\n readonly buckets: Map<string, IndexedEntry[]>;\n readonly universal: IndexedEntry[];\n /** Whether any rule is filed under an attribute, which a node's props are then looked up for. */\n attributes?: boolean;\n /** Whether any is filed under the class of an element its own is inside. */\n under?: boolean;\n}\n\n/**\n * File rules by key selector, each at `from` and on: its place among every rule there is, which\n * settles the order of two of the same weight. Into an index there already where one is given,\n * so a sheet that arrives later is added to what is filed and nothing is filed again.\n */\nexport function indexRules(\n entries: readonly RuleEntry[],\n into: RuleIndex = { buckets: new Map(), universal: [] },\n from = 0,\n): RuleIndex {\n styleStats.rulesFiled += entries.length;\n entries.forEach((entry, n) => {\n const indexed = { entry, at: from + n };\n for (const key of ruleKeys(entry.rule)) {\n if (key === UNIVERSAL) {\n into.universal.push(indexed);\n continue;\n }\n if (key.startsWith('attr:')) into.attributes = true;\n else if (key.startsWith('under:')) into.under = true;\n const bucket = into.buckets.get(key);\n if (bucket) bucket.push(indexed);\n else into.buckets.set(key, [indexed]);\n }\n });\n return into;\n}\n\n/** Rules in the order they were filed in, which is the order of a list sorted before it was. */\nconst byPlace = (a: IndexedEntry, b: IndexedEntry): number => a.at - b.at;\n\n/** Add to `found` what one index holds in the buckets a node's name, id and classes reach. */\nfunction reach(node: StyleTarget, index: RuleIndex, found: IndexedEntry[]): void {\n const take = (key: string): void => {\n const bucket = index.buckets.get(key);\n if (bucket) found.push(...bucket);\n };\n if (index.universal.length) found.push(...index.universal);\n take(`type:${node.typeName ?? node.tag}`);\n const id = node.props['nativeID'];\n if (typeof id === 'string') take(`id:${id}`);\n if (node.classes) for (const name of node.classes) take(`class:${name}`);\n // What is written for any child of an element with one of the parent's classes.\n const around = node.parent?.classes;\n if (around) for (const name of around) take(`in:${name}`);\n if (index.attributes) reachByAttribute(node, take);\n if (index.under) reachUnder(node, take);\n}\n\n/** The buckets of the classes of every element over a node. */\nfunction reachUnder(node: StyleTarget, take: (key: string) => void): void {\n for (let above = node.parent; above; above = above.parent) {\n if (above.classes) for (const name of above.classes) take(`under:${name}`);\n }\n}\n\n/** The buckets of the attributes a node has: a prop of its own that is set. */\nfunction reachByAttribute(node: StyleTarget, take: (key: string) => void): void {\n const kept = node.keptAttributes;\n for (const name in node.props) {\n const value = node.props[name];\n // As `matchesAttribute` has it: a prop that is false is an attribute that is not there.\n if (value !== undefined && value !== null && value !== false) take(`attr:${name}`);\n else if (kept?.[name] !== undefined) take(`attr:${name}`);\n }\n // One kept by no prop's name: a prop's is taken above.\n if (kept) for (const name in kept) if (!(name in node.props)) take(`attr:${name}`);\n}\n\n/**\n * The rules worth trying against a node, in cascade order: `order` says which of two comes\n * first, and with none it is the order they were filed in.\n *\n * From each index, only the buckets the node's name, id and classes reach, which is the entire\n * point of the index: the lists are short by construction, so sorting them is cheap.\n */\nexport function candidateRules(\n node: StyleTarget,\n indexes: RuleIndex | readonly RuleIndex[],\n order: (a: IndexedEntry, b: IndexedEntry) => number = byPlace,\n): RuleEntry[] {\n const found: IndexedEntry[] = [];\n const all = Array.isArray(indexes) ? (indexes as readonly RuleIndex[]) : [indexes as RuleIndex];\n for (const index of all) reach(node, index, found);\n if (found.length < 2) return found.map((indexed) => indexed.entry);\n found.sort(order);\n // A rule filed under two keys the node has is offered once.\n const offered: RuleEntry[] = [];\n for (let i = 0; i < found.length; i++) {\n if (found[i] !== found[i - 1]) offered.push(found[i]!.entry);\n }\n return offered;\n}\n\n/**\n * The properties the rules matching a node declared `!important`, or nothing where none did:\n * each by its own name and by the other form of it, so `margin-left` stands over an inline\n * `marginStart` as it does over an inline `marginLeft`.\n */\nfunction importantNames(\n result: CascadeResult,\n twin: () => Readonly<Record<string, string>>,\n): ReadonlySet<string> | undefined {\n const deferred = result.deferred?.filter((one) => one.important) ?? [];\n if (!result.important && !deferred.length) return undefined;\n const names = [...Object.keys(result.important ?? {}), ...deferred.flatMap((one) => one.props)];\n const sided = names.filter((name) => name in TWIN.ltr);\n return new Set(sided.length ? [...names, ...sided.map((name) => twin()[name]!)] : names);\n}\n\n/** What the rules matching one node add up to. */\ninterface CascadeResult {\n readonly declarations: Record<string, unknown>;\n /** The important declarations alone, which a deferred value that is not important cannot beat. */\n readonly important: Record<string, unknown> | null;\n readonly tokens: Record<string, TokenValue> | null;\n /** The custom properties among `tokens` declared `!important`, which the element's own do not take. */\n readonly importantTokens: Record<string, TokenValue> | null;\n readonly deferred: DeferredDeclaration[] | null;\n}\n\n/** What `em` falls back to when nothing in scope has set a font size. The web's default. */\nconst DEFAULT_FONT_SIZE = 16;\n\n/**\n * The rules a node matched, to style it from again: for a change above it, and not for one of\n * its own or beneath it, which can change what it matches.\n */\nfunction rulesKept(cached: StyleCache, node: StyleTarget): readonly StyleRule[] | undefined {\n return node.ownDirty || node.hasDirty ? undefined : cached.rules;\n}\n\n/** Shared empty result. Never handed out anywhere that mutates it. */\nconst EMPTY: Record<string, unknown> = {};\n\n/** Stands in for the parent of a root node, so the comparison needs no null case. */\nconst ROOT_CONTEXT: object = {};\n/** The `scope` over a node with no parent. */\nconst ROOT_SCOPE: object = {};\n/**\n * The `scope` of the one cache every node with nothing to style shares. It is no one node's, so\n * nothing styled under it, or holding it, is taken to match what it did.\n */\nconst SHARED_SCOPE: object = {};\n\n/** Shared empty token map, for the overwhelmingly common case of a subtree defining none. */\nconst NO_TOKENS: Readonly<Record<string, TokenValue>> = {};\n\n/**\n * Conditions generations are unique across every resolver in the process, not merely\n * increasing within one, because the memo they stamp lives on the compiled rule and a sheet is\n * shared by every engine that mounts the component.\n */\nlet generations = 0;\n\n/** What a sheet's rules are written for: the last compound of each, by its class or its name. */\nexport interface Subjects {\n readonly classes: Set<string>;\n readonly types: Set<string>;\n /**\n * The classes of the boxes that rules for anything are written inside: `.dialog > :first-child`\n * is for any element, but only one that has an element with `dialog` over it.\n */\n readonly inside: Set<string>;\n /** A rule for anything anywhere: no class, no name, and no such box to be in. */\n any: boolean;\n /**\n * In what a class reaches: a rule is for the element that has the class, `.on`, which is then\n * matched again itself. Unset where the rules are only for elements under it.\n */\n own?: boolean;\n /**\n * In what a class reaches: a rule names it in `:has()`, `.field:has(.on)`, which the boxes\n * above the element that has it are then asked again.\n */\n beneath?: boolean;\n /**\n * In what a class reaches: a rule names it in `:has(> )` alone, `.field:has(> .on)`, which only\n * the box right above the element that has it is then asked again.\n */\n parentHas?: boolean;\n}\n\ninterface Addition {\n readonly before: number;\n readonly after: number;\n readonly subjects: Subjects;\n}\n\nconst subjects = new WeakMap<StyleSheet, Subjects>();\n\nfunction subjectsOf(sheet: StyleSheet): Subjects {\n let found = subjects.get(sheet);\n if (found) return found;\n const classes = new Set<string>();\n const types = new Set<string>();\n const inside = new Set<string>();\n const all = { classes, types, inside, any: false };\n for (const rule of sheet.rules) noteSubject(all, rule);\n subjects.set(sheet, (found = all));\n return found;\n}\n\n/**\n * A box a rule asks `:has()` of that is not the node it styles, `.card:has(.x) .title`, by the\n * classes the rule asks of that box, with what the rule is for: the nodes under such a box to\n * match again when what is in it changes.\n */\nexport interface HasAbove {\n readonly classes: readonly string[];\n /** The element the box is, where the rule names one. */\n readonly type?: string;\n readonly subjects: Subjects;\n /**\n * The box is before the node, or before a box the node is in: `.card:has(.x) ~ .title`. What\n * comes after it is matched again as well as what is under it.\n */\n readonly beside?: true;\n}\n\nconst HAS_ABOVE = new WeakMap<StyleSheet, readonly HasAbove[]>();\n\n/** Whether a compound, or one it asks of the same node, uses `:has()`. */\nconst asksBeneath = (compound: Compound): boolean =>\n compound.has !== undefined ||\n [\n ...(compound.not ?? []),\n ...(compound.is ?? []).flat(),\n ...nestedSelectors(compound).map((selector) => selector.compounds.at(-1)!),\n ].some(asksBeneath);\n\n/**\n * The boxes other than the styled node that a compound asks `:has()` of: the compound's own\n * node, where that is not the styled one, each box it is asked to be inside,\n * `.body:is(.card:has(.x) *) .title`, and each element an `:is()` or `:not()` of more than a\n * compound asks about, which can be before it as well as above it.\n */\nfunction* boxesAsked(\n compound: Compound,\n styled: boolean,\n beside: boolean,\n): Generator<{ box: Compound; beside: boolean }> {\n if (!styled && asksBeneath(compound)) yield { box: compound, beside };\n for (const key of ['ancestors', 'parents', 'hostContext'] as const) {\n for (const outer of compound[key] ?? []) yield* boxesAsked(outer, false, beside);\n }\n for (const selector of nestedSelectors(compound)) {\n const last = selector.compounds.length - 1;\n // The last is the compound's own node, which `asksBeneath` has asked of already.\n for (const [at, inner] of selector.compounds.entries()) {\n yield* boxesAsked(inner, at === last, at === last ? beside : true);\n }\n }\n}\n\n/** Each box a sheet's rules ask `:has()` of other than the node they style. */\nexport function hasAbove(sheet: StyleSheet): readonly HasAbove[] {\n let known = HAS_ABOVE.get(sheet);\n if (known === undefined) {\n const found: HasAbove[] = [];\n for (const rule of sheet.rules) {\n const last = rule.compounds.length - 1;\n for (const [at, compound] of rule.compounds.entries()) {\n const before = rule.combinators.slice(at).some((one) => SIBLING_COMBINATORS.has(one));\n for (const { box, beside } of boxesAsked(compound, at === last, before)) {\n const subjects = noSubjects();\n noteSubject(subjects, rule);\n found.push({\n classes: classesOf(box),\n ...(box.type !== undefined ? { type: box.type } : {}),\n subjects,\n ...(beside ? { beside: true } : {}),\n });\n }\n }\n }\n HAS_ABOVE.set(sheet, (known = found));\n }\n return known;\n}\n\n/** Whether `node` can be the box a `:has()` rule asks: it has the classes and is the element. */\nexport function couldAsk(reader: HasAbove, node: StyleTarget): boolean {\n if (reader.type !== undefined && reader.type !== typeOf(node)) return false;\n return reader.classes.every((name) => node.classes?.has(name));\n}\n\n/**\n * The classes a node needs to match a compound: its own, and those every argument of one of its\n * `:is()` or `:where()` lists names, `:where(.group)` as Tailwind's `group-has-*` writes it.\n */\nfunction classesOf(compound: Compound): readonly string[] {\n if (!compound.is && !compound.isComplex) return compound.classes;\n const all = new Set(compound.classes);\n const lists = [\n ...(compound.is ?? []),\n ...(compound.isComplex ?? []).map((list) => list.map((selector) => selector.compounds.at(-1)!)),\n ];\n for (const list of lists) {\n const [first, ...rest] = list.map(classesOf);\n for (const name of first ?? []) if (rest.every((other) => other.includes(name))) all.add(name);\n }\n return [...all];\n}\n\n/** Each compound in one, and each nested in it at any depth, `:has()` arguments among them. */\nfunction* everyCompound(compound: Compound): Generator<Compound> {\n yield compound;\n for (const inner of [...nestedCompounds(compound), ...hasCompounds(compound)]) {\n yield* everyCompound(inner);\n }\n}\n\nconst HAS_BESIDE = new WeakMap<StyleSheet, boolean>();\n\n/**\n * Whether a sheet asks `:has()` about what comes after a node, `:has(+ .x)` or `:has(~ .x .y)`:\n * then a change can change what the elements before it match, and those before what it is in.\n */\nexport function hasBeside(sheet: StyleSheet): boolean {\n let known = HAS_BESIDE.get(sheet);\n if (known === undefined) {\n const after = (test: HasTest) =>\n test.relative?.some((one) => SIBLING_COMBINATORS.has(one.combinators[0]!)) === true;\n known = sheet.rules.some((rule) =>\n rule.compounds.some((outer) => {\n for (const compound of everyCompound(outer)) if (compound.has?.some(after)) return true;\n return false;\n }),\n );\n HAS_BESIDE.set(sheet, known);\n }\n return known;\n}\n\n/** Note in `into` what a rule is for. */\nfunction noteSubject(into: Subjects, rule: StyleRule): void {\n const subject = rule.compounds.at(-1);\n // One class of several is enough to ask: a node without it matches none of them.\n if (subject?.classes.length) into.classes.add(subject.classes[0]!);\n else if (boxAround(rule) !== undefined) into.inside.add(boxAround(rule)!);\n else if (subject?.type && subject.type !== '*') into.types.add(subject.type);\n else into.any = true;\n}\n\n/**\n * What a class changing on an element can restyle, by the rules that name the class:\n *\n * - `true`, the element and all under it and after it, each matched again: a rule names the\n * class beside its element, or inside `:has()` or `:host-context()`;\n * - or the element itself, `own`, where a rule is for the element that has the class, and the\n * elements under it that rules are for, where a rule names it as what its own element is\n * inside, `.busy .row` or `.row:is(.busy *)`: those and no other are matched again.\n *\n * A class in no rule is in neither, and restyles nothing.\n */\ntype ClassReach = Map<string, true | Subjects>;\n\ninterface SheetReach {\n readonly classes: ClassReach;\n /** The tests of the `class` attribute itself, which a class in no rule can still answer. */\n readonly reads: readonly AttributeTest[];\n /** Every attribute a selector of the sheet asks about, by name. */\n readonly named: ReadonlySet<string>;\n}\n\nconst reaches = new WeakMap<StyleSheet, SheetReach>();\n\n/**\n * How far each class a sheet's selectors name reaches, and the tests of the `class` attribute\n * itself that are in them.\n *\n * The rules are walked whole for the classes in them, whatever a selector is made of: a part of\n * one added later counts as a class that reaches everything, without being named here.\n */\nfunction classReach(sheet: StyleSheet): SheetReach {\n let found = reaches.get(sheet);\n if (found) return found;\n const classes: ClassReach = new Map();\n const reads: AttributeTest[] = [];\n const named = new Set<string>();\n for (const rule of sheet.rules) {\n const every = new Set<string>();\n collectClasses(rule, every, reads, named);\n const { own, inside, beneath, parentHas } = classPlaces(rule);\n for (const name of every) {\n const placed = own.has(name) || inside.has(name) || beneath.has(name) || parentHas.has(name);\n if (!placed) classes.set(name, true);\n if (own.has(name)) noteOwn(classes, name);\n if (inside.has(name)) noteInside(classes, name, rule);\n if (beneath.has(name)) noteBeneath(classes, name, 'beneath');\n if (parentHas.has(name)) noteBeneath(classes, name, 'parentHas');\n }\n }\n reaches.set(sheet, (found = { classes, reads, named }));\n return found;\n}\n\n/** Note a rule as one for the element that has a class. */\nfunction noteOwn(found: ClassReach, name: string): void {\n const subjects = found.get(name);\n if (subjects === true) return;\n if (subjects) subjects.own = true;\n else found.set(name, { ...noSubjects(), own: true });\n}\n\n/** Note a rule as one that names a class in `:has()`, or in `:has(> )` alone. */\nfunction noteBeneath(found: ClassReach, name: string, how: 'beneath' | 'parentHas'): void {\n const subjects = found.get(name);\n if (subjects === true) return;\n if (subjects) subjects[how] = true;\n else found.set(name, { ...noSubjects(), [how]: true });\n}\n\n/** Note a rule as one that names a class as what its element is inside. */\nfunction noteInside(found: ClassReach, name: string, rule: StyleRule): void {\n let subjects = found.get(name);\n if (subjects === true) return;\n if (!subjects) found.set(name, (subjects = noSubjects()));\n const subject = rule.compounds.at(-1);\n if (subject?.classes.length) subjects.classes.add(subject.classes[0]!);\n else if (subject?.type && subject.type !== '*') subjects.types.add(subject.type);\n // A rule for anything in the box, `.busy > *`: anything under the node the class changed\n // on. Asking which box has the class finds none once the class has gone from it.\n else subjects.any = true;\n}\n\nconst noSubjects = (): Subjects => ({\n classes: new Set(),\n types: new Set(),\n inside: new Set(),\n any: false,\n});\n\n/** Add to `into` what `from` is for. */\nfunction addSubjects(into: Subjects, from: Subjects): void {\n for (const name of from.classes) into.classes.add(name);\n for (const name of from.types) into.types.add(name);\n for (const name of from.inside) into.inside.add(name);\n into.any ||= from.any;\n if (from.own) into.own = true;\n if (from.beneath) into.beneath = true;\n if (from.parentHas) into.parentHas = true;\n}\n\n/** What all of `each` are for, as one. */\nexport function joinSubjects(each: readonly Subjects[]): Subjects {\n const all = noSubjects();\n for (const one of each) addSubjects(all, one);\n return all;\n}\n\n/**\n * Where a rule names each class it names, for the classes it names in no other place than these:\n *\n * - `own`, on the element the rule is for: its own classes, and those in `:is()` and `:not()` of\n * it, which are asked of that element;\n * - `inside`, as what that element is inside: the classes of a compound before the last, with\n * nothing but `>` and a space between there and the element, and those of what `:is(.box *)`\n * and `:is(.box > *)` put over it;\n * - `beneath`, inside `:has()`, wherever in the rule that is: what it asks of is under the box\n * that answers it, or after it;\n * - `parentHas`, of what `:has(> )` asks of the box's children themselves, and nowhere else in\n * `:has()`: the element is right under that box.\n *\n * A class named anywhere else in the rule is in none, whatever else names it: beside the element,\n * inside `:host-context()`, or in `:not()` of a box the element is in. A test of the class\n * attribute is placed as a class is, by `classTestKey`.\n */\nfunction classPlaces(rule: StyleRule): {\n own: ReadonlySet<string>;\n inside: ReadonlySet<string>;\n beneath: ReadonlySet<string>;\n parentHas: ReadonlySet<string>;\n} {\n const own = new Set<string>();\n const inside = new Set<string>();\n const beneath = new Set<string>();\n const parentHas = new Set<string>();\n const elsewhere = new Set<string>();\n const below = { beneath, parentHas, elsewhere };\n const last = rule.compounds.length - 1;\n let under = true;\n for (let index = last; index >= 0; index--) {\n const compound = rule.compounds[index]!;\n if (index === last) {\n placeClasses(compound, own, inside, below);\n continue;\n }\n const joined = rule.combinators[index];\n under &&= joined === 'child' || joined === 'descendant';\n // A box the element is under, by its classes and by those it is asked to have or not to,\n // `.box:not(.busy) .row`: each is asked of that box, as its own are.\n const over = under ? inside : elsewhere;\n placeClasses(compound, over, over, below);\n }\n for (const name of elsewhere) {\n own.delete(name);\n inside.delete(name);\n beneath.delete(name);\n parentHas.delete(name);\n }\n return { own, inside, beneath, parentHas };\n}\n\n/**\n * The classes of a compound asked of the element a rule is for, into `at`, and of the compounds\n * it puts over that element, into `inside`. What any other part of it names goes `elsewhere`:\n * a part read here by name is one this knows the reach of, and one added later is not.\n */\nfunction placeClasses(\n compound: Compound,\n at: Set<string>,\n inside: Set<string>,\n below: Below,\n): void {\n const {\n classes,\n is,\n not,\n ancestors,\n parents,\n attributes,\n has,\n type: _t,\n id: _i,\n root: _r,\n pseudo: _p,\n ...rest\n } = compound;\n for (const name of namesOf(classes, attributes)) at.add(name);\n for (const alternatives of is ?? []) {\n for (const option of alternatives) placeClasses(option, at, inside, below);\n }\n for (const excluded of not ?? []) placeClasses(excluded, at, inside, below);\n // What is over the element is over it whichever of these said so, and what is over that is too.\n for (const above of [...(ancestors ?? []), ...(parents ?? [])]) {\n placeClasses(above, inside, inside, below);\n }\n placeHas(has, below);\n collectClasses(rest, below.elsewhere, []);\n}\n\n/** Where `classPlaces` puts what `:has()` asks, and what it can place nowhere. */\ninterface Below {\n readonly beneath: Set<string>;\n readonly parentHas: Set<string>;\n readonly elsewhere: Set<string>;\n}\n\n/**\n * The classes `:has()` asks of what is under the box that answers it or after it, into\n * `beneath`, wherever in the rule it is written, or into `parentHas` for what `:has(> )` asks of\n * the box's children. One it can ask of what is above the box goes `elsewhere`: `:is()` in\n * `:has()` is not relative, so the `.night` of `:has(:is(.night .cell))` can be any element over\n * the cell.\n */\nfunction placeHas(tests: readonly HasTest[] | undefined, below: Below): void {\n for (const test of tests ?? []) {\n const into = test.child ? below.parentHas : below.beneath;\n for (const compound of test.any) placeBeneath(compound, into, below);\n for (const one of test.relative ?? []) {\n for (const compound of one.compounds) placeBeneath(compound, below.beneath, below);\n }\n }\n}\n\n/** `placeHas` for one compound of a `:has()` argument, whose own classes go `into`. */\nfunction placeBeneath(compound: Compound, into: Set<string>, below: Below): void {\n const {\n classes,\n attributes,\n is,\n not,\n has,\n type: _t,\n id: _i,\n root: _r,\n pseudo: _p,\n ...rest\n } = compound;\n for (const name of namesOf(classes, attributes)) into.add(name);\n for (const alternatives of is ?? []) {\n for (const option of alternatives) placeBeneath(option, into, below);\n }\n for (const excluded of not ?? []) placeBeneath(excluded, into, below);\n placeHas(has, below);\n collectClasses(rest, below.elsewhere, []);\n}\n\n/** A compound's classes, and its tests of the class attribute, which are asked as its classes are. */\nfunction namesOf(\n classes: readonly string[],\n attributes: readonly AttributeTest[] | undefined,\n): readonly string[] {\n const tests = attributes?.filter((test) => test.name === 'class');\n return tests?.length ? [...classes, ...tests.map(classTestKey)] : classes;\n}\n\n/**\n * A test of the class attribute, `[class^=\"p-\"]`, by a name no class can have: it has a reach\n * as a class does, for what any class it answers can restyle.\n */\nconst classTestKey = (test: AttributeTest): string =>\n `\\0${test.operator ?? ''}${test.insensitive ? 'i' : ''}\\0${test.value ?? ''}`;\n\n/** What a rule declares, which names no element. */\nconst DECLARED = new Set(['declarations', 'important', 'tokens']);\n\n/**\n * Add each class under `value` to `into`, each test of the `class` attribute to `reads`, and the\n * name of every attribute asked about to `named`.\n */\nfunction collectClasses(\n value: unknown,\n into: Set<string>,\n reads: AttributeTest[],\n named?: Set<string>,\n): void {\n if (value === null || typeof value !== 'object') return;\n if (Array.isArray(value)) {\n return value.forEach((inner) => collectClasses(inner, into, reads, named));\n }\n const part = value as { classes?: unknown; attributes?: unknown };\n if (Array.isArray(part.classes)) for (const name of part.classes) into.add(String(name));\n if (Array.isArray(part.attributes)) {\n for (const test of part.attributes as AttributeTest[]) {\n named?.add(test.name);\n if (test.name !== 'class') continue;\n reads.push(test);\n into.add(classTestKey(test));\n }\n }\n for (const [key, inner] of Object.entries(value)) {\n if (!DECLARED.has(key)) collectClasses(inner, into, reads, named);\n }\n}\n\n/**\n * Whether a class coming or going could change what a test of the `class` attribute answers.\n * One class of the list where the test is for a whole class or for part of one; any class\n * where it is for how the list starts or ends, or for a part with a space in it.\n */\nfunction answers(test: AttributeTest, name: string, attribute?: ClassChange): boolean {\n const value = test.value ?? '';\n const folded = test.insensitive ? name.toLowerCase() : name;\n if (test.operator === 'includes') return folded === value;\n if (test.operator === 'substring' && !/\\s/.test(value)) return folded.includes(value);\n // `[class^=\"icon-\"]` reads the attribute as a whole: told it, before and after, a change that\n // leaves its answer as it was answers nothing new.\n if (attribute) return classHolds(test, attribute.was) !== classHolds(test, attribute.now);\n return true;\n}\n\n/**\n * A node's `class` attribute, as `[class^=\"icon-\"]` reads it, before a change to its classes and\n * after: undefined where it has none.\n */\nexport interface ClassChange {\n readonly was: string | undefined;\n readonly now: string | undefined;\n}\n\n/** Whether a test of the `class` attribute holds for it written as `value`. */\nfunction classHolds(test: AttributeTest, value: string | undefined): boolean {\n if (value === undefined) return false;\n if (test.operator === undefined) return true;\n if (test.value === '' && !EMPTY_MATCHES.has(test.operator)) return false;\n return matchesValue(attributeText(value, test), test.operator, test.value!);\n}\n\n/**\n * A class of the nearest box a rule's subject has to be in: the compound before it, where that\n * is joined as what holds it and names a class. Nothing where it is a sibling, or has no class.\n */\nfunction boxAround(rule: StyleRule): string | undefined {\n const joined = rule.combinators.at(-1);\n if (joined !== 'child' && joined !== 'descendant') return undefined;\n return rule.compounds.at(-2)?.classes[0];\n}\n\n/** Whether a rule among these could be for a node: never no where one is. */\nfunction writtenFor(of: Subjects, node: StyleTarget): boolean {\n if (of.any || of.types.has(typeOf(node))) return true;\n for (const name of node.classes ?? []) if (of.classes.has(name)) return true;\n if (!of.inside.size) return false;\n for (let over = node.parent; over; over = over.parent) {\n for (const name of over.classes ?? []) if (of.inside.has(name)) return true;\n }\n return false;\n}\n\n/**\n * Whether a node has its answer for this commit already. Not one marked since it was given the\n * one cache every box with nothing to style shares, see `unstyled`: another of them resolved in\n * this commit has set that cache's epoch, and it is not this node's answer.\n */\nfunction resolvedIn(epoch: number, cache: StyleCache | null, node: StyleTarget): boolean {\n return (\n cache !== null && cache.epoch === epoch && (!node.styleDirty || cache.context !== ROOT_CONTEXT)\n );\n}\n\nfunction emptyCacheFor(epoch: number, generation: number): StyleCache {\n return {\n epoch,\n generation,\n context: ROOT_CONTEXT,\n parentContext: ROOT_CONTEXT,\n scope: SHARED_SCOPE,\n parentScope: SHARED_SCOPE,\n style: EMPTY,\n inherited: EMPTY,\n tokens: NO_TOKENS,\n };\n}\n\n/**\n * A unitless line-height as a node hands it down. CSS inherits the number, not the points it comes\n * to where it is written, so a title under `.card { font-size: 10px; line-height: 2 }` with a\n * font size of 20 is 40 tall, not 20. It is only ever in an inherited map: `settleLineHeight`\n * turns it into points in every style a node renders with.\n */\ninterface LineHeightMultiple {\n readonly multiple: number;\n}\n\nfunction isMultiple(value: unknown): value is LineHeightMultiple {\n return typeof value === 'object' && value !== null && 'multiple' in value;\n}\n\n/** A line-height as points, for a node of font size `size`: what an em of it comes to. */\nfunction lineHeightPoints(line: LineHeightMultiple, size: unknown): number {\n const points = line.multiple * (typeof size === 'number' ? size : DEFAULT_FONT_SIZE);\n return Math.round(points * 1000) / 1000;\n}\n\n/** A node's style with a unitless line-height it set or inherited worked out against its font size. */\nfunction settleLineHeight(style: Record<string, unknown>): void {\n const line = style['lineHeight'];\n if (isMultiple(line)) style['lineHeight'] = lineHeightPoints(line, style['fontSize']);\n}\n\n/** The styles of nodes with no rules, by the map they inherit, for one that hands down a multiple. */\nconst unstyledStyles = new WeakMap<Record<string, unknown>, Record<string, unknown>>();\n\n/**\n * The style of a node no rule matches: what it inherits, with a unitless line-height worked out\n * against its font size, which an inline style can set. The same object where there is none.\n */\nfunction unstyledStyle(\n inherited: Record<string, unknown>,\n inline: Record<string, unknown> | null,\n): Record<string, unknown> {\n const line = inherited['lineHeight'];\n if (!isMultiple(line)) return inherited;\n const size = inline?.['fontSize'];\n if (typeof size === 'number') return { ...inherited, lineHeight: lineHeightPoints(line, size) };\n let style = unstyledStyles.get(inherited);\n if (!style) {\n style = { ...inherited, lineHeight: lineHeightPoints(line, inherited['fontSize']) };\n unstyledStyles.set(inherited, style);\n }\n return style;\n}\n\n/**\n * What this node's children inherit: the parent's map, overlaid with any inheritable value the\n * node set itself. Copied on first write only, so a node that sets none hands the same object on\n * and a whole subtree can share it.\n */\nfunction inheritFrom(\n parentInherited: Record<string, unknown>,\n own: Record<string, unknown>,\n node?: StyleTarget,\n): Record<string, unknown> {\n const drawing = node?.namespace !== undefined;\n let inherited = drawing ? ownPaint(node!, parentInherited, own) : parentInherited;\n for (const key of Object.keys(own)) {\n if (!(INHERITED.has(key) || (drawing && SHAPE_PAINT_INHERITED.has(key)))) continue;\n // `pointer-events: inherit`, which only an inline style on an element no rule matches still\n // holds here: what the parent hands down stands.\n if (key === 'pointerEvents' && own[key] === 'inherit') continue;\n if (inherited === parentInherited) inherited = { ...parentInherited };\n if (key === 'pointerEvents' && !INHERITED_POINTER_EVENTS.has(own[key] as string)) {\n delete inherited[key];\n } else {\n inherited[key] = own[key];\n }\n }\n return inherited;\n}\n\n/** What a node no rule matches hands down: its inline style's, or a drawing's own paint. */\nfunction handedOn(\n node: StyleTarget,\n parentInherited: Record<string, unknown>,\n inline: Record<string, unknown> | null,\n drawing: boolean,\n): Record<string, unknown> {\n return inline || drawing ? inheritFrom(parentInherited, inline ?? {}, node) : parentInherited;\n}\n\n/**\n * What a shape of a drawing hands down of the paint it set itself, as an attribute its\n * `propList` names, over a paint it inherits: a `<g stroke=\"none\">` under a stroked `<svg>`\n * strokes nothing inside it, as in a browser. A style of its own stands over either.\n */\nfunction ownPaint(\n node: StyleTarget,\n parentInherited: Record<string, unknown>,\n own: Record<string, unknown>,\n): Record<string, unknown> {\n const named = node.props['propList'];\n if (!Array.isArray(named)) return parentInherited;\n let inherited = parentInherited;\n for (const key of named as readonly string[]) {\n if (!SHAPE_PAINT_INHERITED.has(key) || key in own) continue;\n const value = node.props[key];\n // A paint named and not set is `none`, as react-native-svg reads a list naming it.\n const paint = value ?? (key === 'strokeWidth' ? undefined : 'none');\n if (paint === undefined || inherited[key] === paint) continue;\n if (inherited === parentInherited) inherited = { ...parentInherited };\n inherited[key] = paint;\n }\n return inherited;\n}\n\n/**\n * A text decoration's colour, which travels with its line rather than inheriting on its own. A\n * decoration is drawn under the text inside the element that declares it, in that element's\n * decoration colour or its text colour, and a text's own decoration colour only colours a line it\n * declares itself. `style` is the node's, and gets the colour its line is drawn in; what its\n * children inherit is returned.\n */\nfunction decorate(\n style: Record<string, unknown>,\n inherited: Record<string, unknown>,\n own: Record<string, unknown>,\n): Record<string, unknown> {\n const declared = own['textDecorationLine'] !== undefined;\n // With no line declared here or above, nothing is drawn and the colour is left as computed.\n if (!declared && !drawsLine(inherited['textDecorationLine'])) return inherited;\n const colour = declared\n ? (own['textDecorationColor'] ?? style['color'])\n : inherited['textDecorationColor'];\n if (colour === undefined) delete style['textDecorationColor'];\n else style['textDecorationColor'] = colour;\n if (!declared || inherited['textDecorationColor'] === colour) return inherited;\n const { textDecorationColor: _parent, ...rest } = inherited;\n return colour === undefined ? rest : { ...rest, textDecorationColor: colour };\n}\n\nfunction drawsLine(line: unknown): boolean {\n return line !== undefined && line !== 'none';\n}\n\n/**\n * Whether an inline style sets a property children inherit, by a node of a library's drawing or by\n * any other. Allocates nothing, and calls nothing a key: it runs per set.\n */\nexport function setsInherited(style: unknown, drawing = false): boolean {\n if (!style || typeof style !== 'object') return false;\n if (Array.isArray(style)) return style.some((entry) => setsInherited(entry, drawing));\n for (const key in style) {\n if (\n (INHERITED.has(key) || (drawing && SHAPE_PAINT_INHERITED.has(key))) &&\n (style as Record<string, unknown>)[key] != null\n )\n return true;\n }\n return false;\n}\n\n/**\n * The inherited properties a node's inline style sets, or null for none. Inline style is the\n * strongest normal declaration on its element, so what it sets is inherited, and read by\n * `color: inherit` and `currentColor`, as a rule's would be.\n */\nexport function inlineInherited(style: unknown, drawing = false): Record<string, unknown> | null {\n let out: Record<string, unknown> | null = null;\n // Flattened first, as native applies it, so a later entry's null clears an earlier value.\n for (const [key, value] of Object.entries(flattenInline(style, {}))) {\n if (\n (INHERITED.has(key) || (drawing && SHAPE_PAINT_INHERITED.has(key))) &&\n value !== undefined &&\n value !== null\n )\n (out ??= {})[key] = value;\n }\n return out;\n}\n\nfunction flattenInline(style: unknown, into: Record<string, unknown>): Record<string, unknown> {\n if (Array.isArray(style)) for (const entry of style) flattenInline(entry, into);\n else if (style && typeof style === 'object') Object.assign(into, style);\n return into;\n}\n\n/**\n * The runtime half of CSS for one engine: the global sheet, the conditions media queries are\n * evaluated against, and the memo that makes resolution cost nodes x rules rather than\n * nodes x rules x depth.\n *\n * One per engine rather than module state, so two surfaces in one process (or two engines in\n * one test) cannot overwrite each other's sheet or viewport.\n *\n * Inherited state is pushed **down** rather than walked up: a node takes what its parent already\n * resolved and overlays its own declarations. That is how real CSS engines do it, and it matters\n * for two separate reasons.\n *\n * Correctness first. Walking up meant matching every ancestor against the *starting node's*\n * sheet, but an ancestor almost always belongs to a different component, so a component's rules\n * reached nodes it did not own while a parent's real values never arrived. Reading `templateSheet` off\n * each node fixes both directions at once.\n *\n * Cost second. Walking up re-derived, for every node, everything its parent had already worked\n * out. Memoising by epoch makes it nodes x rules, and a node that sets no inheritable value hands\n * its parent's map straight on rather than copying it, so the common case allocates nothing.\n */\nexport class StyleResolver {\n private conditions: Conditions;\n /**\n * Bumped whenever the conditions move. Every cached result and every per-rule condition memo\n * is stamped with it, so a rotation or a theme switch invalidates the lot in one assignment\n * rather than walking the tree.\n */\n private generation = ++generations;\n private emptyCache = emptyCacheFor(-1, -1);\n /**\n * The rules a node is matched against, merged across the global sheet, the sheet of the\n * component it hosts and the sheet that created it, sorted once by weight and then filed by key\n * selector. Keyed by the creating sheet and then the hosted one, so a component's nodes share a\n * single index.\n */\n /** The global sheet and every sheet added to it, filed by key selector. See `rulesFor`. */\n private filed: RuleIndex | null = null;\n /** How many of the added sheets `filed` holds: one added since is filed at the next read. */\n private filedAdded = 0;\n /** A component's own sheet, indexed once for each place it can take: a host's, or its creator's. */\n private readonly ownIndexes = new WeakMap<StyleSheet, (RuleIndex | undefined)[]>();\n /**\n * Whether any sheet merged so far has a rule in a cascade layer. Until one does, rules are\n * ordered by weight alone and the cascade does not look for layers, which is nearly every app.\n * It stays set once a layered sheet has gone, which costs a look at each cascade and no more.\n */\n private layered = false;\n /**\n * Every layer the sheets seen so far have named, in the order each name was first seen, which\n * is the one order a document has for them. A name keeps its place when its sheet is replaced.\n */\n private readonly layerNames: LayerNames = { place: 0, nested: new Map() };\n /** Each layered rule's place among them, set when its sheet is first merged. */\n private readonly layerPlaces = new WeakMap<StyleRule, LayerPlace>();\n private readonly layeredSheets = new WeakSet<StyleSheet>();\n private unnamedLayers = 0;\n\n /**\n * The application-level sheet, if any: the one set of rules allowed to match a node whatever\n * component created it, which is what resets, utility classes and `:root` tokens all need.\n */\n private readonly globalSheet: StyleSheet | null;\n\n /**\n * Global sheets added once the engine is running, in the order they came: a\n * `ViewEncapsulation.None` component's, which a browser adds to the document unscoped when the\n * component first renders, after the application's own. See `addGlobalSheet`.\n */\n private readonly addedSheets: StyleSheet[] = [];\n\n /**\n * Custom properties the host supplies rather than the stylesheet: the safe-area insets, and\n * whatever else is a property of the device instead of the design.\n *\n * Seeded rather than forced. They stand in for the root's inherited tokens, so a `:root` rule\n * in the app's own sheet overrides them the way it would override anything it inherited, and an\n * app that wants to pin an inset for a tablet layout or a screenshot still can.\n */\n private tokensOnRoot: Readonly<Record<string, TokenValue>> = NO_TOKENS;\n\n /** What the host has supplied so far, so a second source can add to it rather than replace it. */\n get rootTokens(): Readonly<Record<string, TokenValue>> {\n return this.tokensOnRoot;\n }\n\n /**\n * Told of a `var()` that names a custom property nothing in scope defines and has no fallback,\n * which is dropped. Set only in development, where it is how the engine says so.\n */\n onUndefinedToken: ((name: string, props: readonly string[], on?: string) => void) | null = null;\n\n /**\n * Told of a `display: var()` whose token holds no display native has, `grid` or `table`, which\n * leaves display unset. Set only in development, where it is how the engine says so: the\n * compiler refuses the same value written out, but a token is only known here.\n */\n onUnreadDisplay: ((name: string, value: string | undefined) => void) | null = null;\n\n constructor(globalSheet: StyleSheet | null, conditions: Conditions) {\n this.globalSheet = globalSheet;\n this.conditions = conditions;\n }\n\n /**\n * Match `sheet` against every node from now on, as a global sheet, after the application's;\n * false when it already is. Every cached result goes, as on a theme switch: rules that were not\n * there can now match anything. `:host` in it matches nothing, since no node hosts it.\n *\n * With `replacing`, a sheet added before, it takes that one's place, and so its order: a hot\n * swap of the component's CSS edits the sheet where it is.\n */\n addGlobalSheet(sheet: StyleSheet, replacing?: StyleSheet): boolean {\n if (sheet === this.globalSheet || this.addedSheets.includes(sheet)) return false;\n const at = replacing ? this.addedSheets.indexOf(replacing) : -1;\n if (at === -1) this.addedSheets.push(sheet);\n else {\n this.addedSheets[at] = sheet;\n this.forgetBeside(replacing!);\n }\n this.noteBeside(sheet);\n // One added at the end is filed after what is there. One in another's place files them all again.\n if (at !== -1) this.filed = null;\n const before = this.generation;\n this.generation = ++generations;\n // One that takes another's place can change what any node comes to. One that names layers\n // cannot: a layer has its place from the first sheet to name it, and a new name comes last.\n if (at !== -1) this.additions.length = 0;\n else this.additions.push({ before, after: this.generation, subjects: subjectsOf(sheet) });\n return true;\n }\n\n /**\n * The sheets added one after another with nothing else changed between them, each with the\n * generation it began and ended: a cache made before them still stands for a node none of\n * them could match. Emptied by anything else that moves the generation on.\n */\n private readonly additions: Addition[] = [];\n\n /** What the rules of several sheets are for, as one: see `isFor`. */\n subjectsOfAll(sheets: readonly StyleSheet[]): Subjects {\n return sheets.length === 1 ? subjectsOf(sheets[0]!) : joinSubjects(sheets.map(subjectsOf));\n }\n\n /** How far each class named by the sheets met so far reaches: see `classReach`. */\n private readonly reach: ClassReach = new Map();\n /** The tests of the `class` attribute itself in those sheets, which any class may answer. */\n private readonly classTests = new Map<string, AttributeTest>();\n private readonly noted = new WeakSet<StyleSheet>();\n /**\n * The sheets with a rule written with `::ng-deep`, which is for what is under the component\n * in the views of the components it holds. None in most apps, and nothing is asked then.\n */\n private readonly deepSheets = new Set<StyleSheet>();\n private readonly deepIndexes = new WeakMap<StyleSheet, RuleIndex>();\n /** Each component sheet's rules for a box of its host: see `hostBoxIndex`. */\n private readonly hostBoxIndexes = new WeakMap<StyleSheet, RuleIndex>();\n\n /**\n * Read the classes a sheet names, once, as soon as any node is given it. One `scoped` to a\n * component or a host asks of its elements for good, global or not.\n */\n noteSheet(sheet: StyleSheet | null | undefined, scoped = false): void {\n if (!sheet) return;\n if (scoped) this.scoped.add(sheet);\n this.noteBeside(sheet);\n if (this.noted.has(sheet)) return;\n this.noted.add(sheet);\n if (sheet.rules.some((rule) => rule.deep)) this.deepSheets.add(sheet);\n const { classes, reads, named } = classReach(sheet);\n for (const [name, how] of classes) this.noteReach(name, how);\n for (const test of reads) this.classTests.set(classTestKey(test), test);\n for (const name of named) this.named.add(name);\n }\n\n /** The props a selector of some sheet asks about: an id, and each attribute by its name. */\n private readonly named = new Set<string>(['nativeID']);\n\n /**\n * Whether a prop changing can change what any element matches: only where a selector of a\n * sheet that was ever loaded names it. A sheet loaded later has every element matched again.\n */\n reads(prop: string): boolean {\n return this.named.has(prop);\n }\n\n /**\n * By prop, how many sheets in play ask it of an element before another: see `namedBeside`. A\n * global sheet taken away, or replaced, asks no more.\n */\n private readonly besideNamed = new Map<string, number>();\n private readonly besideNoted = new WeakSet<StyleSheet>();\n /** The sheets a component or a host was given: see `noteSheet`. */\n private readonly scoped = new WeakSet<StyleSheet>();\n\n private noteBeside(sheet: StyleSheet): void {\n if (this.besideNoted.has(sheet)) return;\n this.besideNoted.add(sheet);\n for (const name of namedBeside(sheet)) {\n this.besideNamed.set(name, (this.besideNamed.get(name) ?? 0) + 1);\n }\n }\n\n private forgetBeside(sheet: StyleSheet): void {\n if (this.scoped.has(sheet) || !this.besideNoted.delete(sheet)) return;\n for (const name of namedBeside(sheet)) {\n const left = this.besideNamed.get(name)! - 1;\n if (left) this.besideNamed.set(name, left);\n else this.besideNamed.delete(name);\n }\n }\n\n /** Whether a prop changing can change what the elements after its element match. */\n readsBeside(prop: string): boolean {\n return this.besideNamed.has(prop);\n }\n\n private noteReach(name: string, how: true | Subjects): void {\n const had = this.reach.get(name);\n if (had === true) return;\n if (how === true) this.reach.set(name, true);\n else addSubjects(had ?? (this.reach.set(name, noSubjects()).get(name) as Subjects), how);\n }\n\n /** Whether a class's reach names any element under the one that has it. */\n reachesUnder(subjects: Subjects): boolean {\n return (\n subjects.any ||\n subjects.classes.size > 0 ||\n subjects.types.size > 0 ||\n subjects.inside.size > 0\n );\n }\n\n /**\n * What classes coming to an element or going from it can restyle: `true` for it and all\n * under it and after it, as any change to it does; the element itself, where `own`, and the\n * elements under it to match again, by what rules are for; or null, where no rule names any\n * of them and nothing is styled again.\n */\n reachOf(classes: Iterable<string>, attribute?: ClassChange): true | Subjects | null {\n let found: Subjects | null = null;\n for (const name of classes) {\n for (const how of this.reachesOf(name, attribute)) {\n if (how === true) return true;\n addSubjects((found ??= noSubjects()), how);\n }\n }\n return found;\n }\n\n /** How far a class reaches by its name, and by each test of the class attribute it answers. */\n private *reachesOf(name: string, attribute?: ClassChange): Generator<true | Subjects> {\n const how = this.reach.get(name);\n if (how) yield how;\n for (const [key, test] of this.classTests) {\n if (answers(test, name, attribute)) yield this.reach.get(key) ?? true;\n }\n }\n\n /** Whether a sheet tests the `class` attribute as a whole: see `ClassChange`. */\n get testsClassAttribute(): boolean {\n return this.classTests.size > 0;\n }\n\n /** Whether one of the rules `subjects` stands for could be for a node. */\n isFor(subjects: Subjects, node: StyleTarget): boolean {\n styleStats.subjectTests++;\n return writtenFor(subjects, node);\n }\n\n /**\n * Whether a cache is of this generation, or of one before sheets that could not match the\n * node were added, which leaves it as it was: it is then brought up to this one.\n */\n private current(cached: StyleCache, node: StyleTarget): boolean {\n if (cached.generation === this.generation) return true;\n // The one cache shared by every node with nothing to style is not one node's to move on.\n if (cached.context === ROOT_CONTEXT) return false;\n let at = cached.generation;\n for (const added of this.additions) {\n if (added.before !== at) continue;\n if (writtenFor(added.subjects, node)) return false;\n at = added.after;\n }\n if (at !== this.generation) return false;\n cached.generation = at;\n return true;\n }\n\n /** Stop matching a sheet `addGlobalSheet` added; false when it is not one. */\n removeGlobalSheet(sheet: StyleSheet): boolean {\n const at = this.addedSheets.indexOf(sheet);\n if (at === -1) return false;\n this.addedSheets.splice(at, 1);\n this.forgetBeside(sheet);\n this.filed = null;\n this.additions.length = 0;\n this.generation = ++generations;\n return true;\n }\n\n setConditions(next: Conditions): void {\n this.conditions = next;\n this.additions.length = 0;\n this.generation = ++generations;\n }\n\n setRootTokens(next: Readonly<Record<string, TokenValue>>): void {\n this.tokensOnRoot = next;\n this.additions.length = 0;\n this.generation = ++generations;\n }\n\n /**\n * Resolve a node, memoised for the life of one epoch.\n *\n * `epoch` scopes the memo. The engine bumps it once per commit, so within a commit each node\n * resolves at most once however many descendants ask for its inherited values.\n */\n resolve(node: StyleTarget, epoch: number): StyleCache {\n const cached = node.styleCache;\n // Within one commit a node is asked for its inherited map once per descendant, so this is the\n // hot path and it must not walk anywhere.\n if (resolvedIn(epoch, cached, node)) return cached!;\n\n const parent = node.parent ? this.resolve(node.parent, epoch) : null;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n\n // Across commits: nothing about this node changed and nothing above it moved, so the last\n // answer still holds. Reusing the object, rather than recomputing an equal one, is what lets\n // a descendant tell \"unchanged\" from \"changed\" by reference alone.\n if (this.reusable(cached, node, parentContext)) {\n cached.epoch = epoch;\n return cached;\n }\n const kept = this.kept(node, parentContext, epoch);\n // The rules it was just found to match, where they are not the ones it did. Taken here\n // whether or not they are used, so that none is left for the next node resolved.\n const found = this.justMatched;\n this.justMatched = null;\n if (kept) return kept;\n\n return this.styledAgain(node, epoch, parent, found);\n }\n\n /** A node styled now, from the rules found for it or from those it kept: see `matchesStand`. */\n private styledAgain(\n node: StyleTarget,\n epoch: number,\n parent: StyleCache | null,\n found: readonly StyleRule[] | null,\n ): StyleCache {\n const cached = node.styleCache;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n const parentInherited = parent ? parent.inherited : EMPTY;\n const parentScope = parent ? parent.scope : ROOT_SCOPE;\n const stands = this.matchesStand(cached, node, parentScope);\n // The scope it keeps, or none: it then has a new one, which its new `context` serves as.\n const scope = stands ? cached!.scope : null;\n\n // A box the engine made around loose text is in no template, so no rule matches it.\n if (node.anonymous || this.hasNoRules(node)) {\n return this.unstyled(node, epoch, parent, parentInherited, scope, parentScope);\n }\n\n styleStats.nodesResolved++;\n\n const rules = stands ? rulesKept(cached!, node) : undefined;\n const matched = found ?? rules ?? this.matchedBy(node);\n const parentTokens = parent ? parent.tokens : this.tokensOnRoot;\n this.heir(node, parent, matched);\n const styled = this.styled(node, matched, parentTokens, parentInherited);\n\n const cache = this.cached(epoch, parentContext, styled, matched, scope, parentScope);\n node.styleCache = cache;\n node.styleDirty = false;\n node.ownDirty = false;\n node.hasDirty = false;\n node.stateDirty = false;\n return cache;\n }\n\n /**\n * Whether what an element could match is as it was when it was last styled: nothing that can\n * change it was marked on the element, its parent's `scope` is the one it was styled under,\n * and no sheet that could match it has come since. It is being styled again all the same, for\n * a change of its own that alters nothing under it, or for what it inherits.\n *\n * A change beneath it is not one: what it answers `:has()` is asked again, and the elements a\n * rule asking that of it is for are marked on their own (`markUnderHas`), not all under it.\n */\n private matchesStand(cached: StyleCache | null, node: StyleTarget, parentScope: object): boolean {\n return (\n cached !== null &&\n !node.styleDirty &&\n !node.stateDirty &&\n cached.scope !== SHARED_SCOPE &&\n parentScope !== SHARED_SCOPE &&\n cached.parentScope === parentScope &&\n this.current(cached, node)\n );\n }\n\n /**\n * A cache of a node just styled, with a context of its own. It keeps the rules the node\n * matched, for the node to be compared with, once a sheet has a use for them: see `tracksHas`.\n */\n private cached(\n epoch: number,\n parentContext: object,\n styled: Styled,\n matched: readonly StyleRule[],\n scope: object | null,\n parentScope: object,\n ): StyleCache {\n const context = {};\n const cache: StyleCache = {\n epoch,\n generation: this.generation,\n context,\n parentContext,\n scope: scope ?? context,\n parentScope,\n rules: matched,\n ...styled,\n };\n if (this.tracksHas) cache.matched = matched;\n return cache;\n }\n\n /**\n * Set by the engine while a sheet in play uses `:has()` or styles a pressed element, and once\n * one asks about a place in a child list. Otherwise no cache keeps the rules it matched, so an\n * app that never asks pays nothing for it.\n */\n tracksHas = false;\n\n /**\n * The cache of a node whose subtree changed, and nothing else, when it matches the rules it\n * did: keeping the object is what leaves everything under it alone. Nothing when it has to be\n * resolved, as it does with no record of what it matched, made before any sheet asked.\n */\n private keptBeneath(node: StyleTarget, parentContext: object, epoch: number): StyleCache | null {\n const cached = node.styleCache;\n const stands =\n (node.hasDirty === true || node.stateDirty === true) &&\n cached?.matched !== undefined &&\n !node.styleDirty &&\n !node.ownDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node);\n if (!stands) return null;\n const now = this.matchedBy(node);\n const before = cached.matched!;\n if (now.length !== before.length || now.some((rule, i) => rule !== before[i])) {\n // It is styled again next, from the rules just found rather than from finding them twice.\n this.justMatched = now;\n return null;\n }\n node.hasDirty = false;\n node.stateDirty = false;\n cached.epoch = epoch;\n return cached;\n }\n\n /** The rules a node matches now, weakest first. */\n private matchedBy(node: StyleTarget): readonly StyleRule[] {\n const candidates = this.rulesFor(node);\n return this.matched(node, node.styled ? ELEMENT_ENTRIES.concat(candidates) : candidates);\n }\n\n /**\n * The rules `keptBeneath` found the node being resolved to match, where they are other than\n * it matched before: it is styled from them next, rather than matched a second time.\n */\n private justMatched: readonly StyleRule[] | null = null;\n\n /** A cache that still stands for a node marked for its subtree or its state alone. */\n private kept(node: StyleTarget, parentContext: object, epoch: number): StyleCache | null {\n return (\n this.keptBeneath(node, parentContext, epoch) ?? this.keptUnmatched(node, parentContext, epoch)\n );\n }\n\n /**\n * The cache of a node whose pressed state changed and nothing else, where no rule can match\n * it at all: it has no style of its own to change, so it and all under it stay as they are.\n */\n private keptUnmatched(\n node: StyleTarget,\n parentContext: object,\n epoch: number,\n ): StyleCache | null {\n const cached = node.styleCache;\n const stands =\n node.stateDirty === true &&\n cached !== null &&\n !node.styleDirty &&\n !node.ownDirty &&\n !node.hasDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node) &&\n (node.anonymous === true || this.hasNoRules(node));\n if (!stands) return null;\n node.stateDirty = false;\n cached.epoch = epoch;\n return cached;\n }\n\n /**\n * Whether a node's last answer still stands under a parent that resolved to `parentContext`,\n * without resolving it. What lets a commit step over a clean child in one comparison.\n */\n holds(node: StyleTarget, parentContext: object): boolean {\n return this.reusable(node.styleCache, node, parentContext);\n }\n\n /**\n * Whether a node was last styled under a box holding the one cache shared by every box with\n * nothing to style. Such boxes hand the same `context` down, so the node cannot tell one from\n * another by it: moved under another box, it has to be told.\n */\n styledUnderShared(node: StyleTarget): boolean {\n return node.styleCache !== null && node.styleCache.parentContext === ROOT_CONTEXT;\n }\n\n /**\n * Whether a previous result still stands: nothing about the node changed, nothing above it\n * moved, and the conditions have not.\n */\n private reusable(\n cached: StyleCache | null,\n node: StyleTarget,\n parentContext: object,\n ): cached is StyleCache {\n return (\n cached !== null &&\n !node.styleDirty &&\n !node.ownDirty &&\n !node.hasDirty &&\n !node.stateDirty &&\n cached.parentContext === parentContext &&\n this.current(cached, node)\n );\n }\n\n /**\n * Nothing anywhere can match this node, and it sets no custom property of its own, so its style\n * is whatever it inherits.\n */\n private hasNoRules(node: StyleTarget): boolean {\n return (\n node.templateSheet === null &&\n node.hostSheet === null &&\n // A generated box matches the `:host::before` of the component its element hosts.\n !(boxesDrawn && node.tag.charCodeAt(0) === COLON && node.parent?.hostSheet) &&\n this.deepSheets.size === 0 &&\n this.globalSheet === null &&\n this.addedSheets.length === 0 &&\n !node.customProperties &&\n !node.boundStyle &&\n !node.styled\n );\n }\n\n /**\n * A node with no rules anywhere: it renders with what it inherits and passes the same map on.\n *\n * It still mints a context, because a rule further down may match on one of *its* classes.\n * When there is nothing to inherit either, one shared cache object serves every such node, so\n * an application that writes no CSS allocates nothing per node. Not when there are tokens to\n * carry: the shared object holds none, and the surface root answering with it dropped every\n * token the device had seeded.\n */\n private unstyled(\n node: StyleTarget,\n epoch: number,\n parent: StyleCache | null,\n parentInherited: Record<string, unknown>,\n scope: object | null,\n parentScope: object,\n ): StyleCache {\n const tokens = parent ? parent.tokens : this.tokensOnRoot;\n const parentContext = parent ? parent.context : ROOT_CONTEXT;\n // What inline style sets is inherited too, with no rule to read it against.\n const drawing = node.namespace !== undefined;\n const inline = node.inlineInherits ? inlineInherited(node.props['style'], drawing) : null;\n const nothing =\n !inline &&\n parentInherited === EMPTY &&\n parentContext === ROOT_CONTEXT &&\n tokens === NO_TOKENS;\n if (nothing && !node.styleDirty && !node.ownDirty) return this.sharedEmpty(node, epoch);\n\n const context = {};\n const passthrough: StyleCache = {\n epoch,\n generation: this.generation,\n context,\n parentContext,\n scope: scope ?? context,\n parentScope,\n style: unstyledStyle(parentInherited, inline),\n inherited: handedOn(node, parentInherited, inline, drawing),\n tokens,\n };\n node.styleCache = passthrough;\n node.styleDirty = false;\n node.ownDirty = false;\n node.stateDirty = false;\n return passthrough;\n }\n\n /** The one cache of every node with nothing to style and nothing to hand down, given to one more. */\n private sharedEmpty(node: StyleTarget, epoch: number): StyleCache {\n if (this.emptyCache.epoch !== epoch || this.emptyCache.generation !== this.generation) {\n this.emptyCache = emptyCacheFor(epoch, this.generation);\n }\n node.styleCache = this.emptyCache;\n return this.emptyCache;\n }\n\n /**\n * The rules worth trying against a node, in cascade order.\n *\n * Every sheet is filed once, by key selector: the app's global sheet and each sheet added to it\n * in one index, and a component's own in one of its own. What comes back is only the buckets\n * this node can reach. A global utility sheet is hundreds of rules and a screen is a thousand\n * nodes, and the difference is between a million match attempts and a few thousand. A library\n * adds a sheet for each of its components as the component first renders, dozens on one\n * screen, so one more is added to what is filed and nothing is filed again.\n *\n * Sheets are filed in the order a document holds them, which is the order of two rules of the\n * same weight, and where a layer gets its place: the app's global sheet, the host's own, the\n * creating component's, then each added sheet as it came. The component layers get a small\n * specificity bump, so the encapsulation attribute Angular adds on the web does not have to\n * be written.\n *\n * A sheet added with `addGlobalSheet` comes last, with no bump: a browser adds a None\n * component's CSS when the component first renders, after the styles of the components around\n * it, so it loses to their extra attribute and wins a tie with them.\n */\n private rulesFor(node: StyleTarget): readonly RuleEntry[] {\n if (this.globalSheet) this.placeLayers(this.globalSheet);\n const indexes: RuleIndex[] = [];\n if (node.hostSheet) indexes.push(this.ownIndex(node.hostSheet, HOSTS));\n // A generated box is tried against the rules of the component its element hosts too, where\n // `:host::before` is written: it is no host itself, so a bare `:host` rule still misses it.\n const host =\n boxesDrawn && node.tag.charCodeAt(0) === COLON ? node.parent?.hostSheet : undefined;\n if (host) indexes.push(this.hostBoxIndex(host));\n if (node.templateSheet) indexes.push(this.ownIndex(node.templateSheet, CREATED));\n if (this.deepSheets.size) this.reachedFromAbove(node, indexes);\n indexes.push(this.sharedIndex());\n return candidateRules(node, indexes, this.cascadeOrder);\n }\n\n /**\n * Add the `::ng-deep` rules of each component a node is in whose sheet is not the node's own:\n * a node is tried against its own component's rules already, those among them.\n */\n private reachedFromAbove(node: StyleTarget, indexes: RuleIndex[]): void {\n for (let up = node.parent; up; up = up.parent) {\n const sheet = up.hostSheet;\n if (!sheet || sheet === node.templateSheet || sheet === node.hostSheet) continue;\n if (this.deepSheets.has(sheet)) indexes.push(this.deepIndex(sheet));\n }\n }\n\n /**\n * A sheet's rules for a box of its host alone, `:host::before` and `:host(.x)::after`, filed as\n * a component's own are. Its other rules for a box are for the elements of its template, which\n * is how emulated encapsulation scopes them on the web: `.icon::before` in it never reaches the\n * box of a host its parent puts the class `icon` on.\n */\n private hostBoxIndex(sheet: StyleSheet): RuleIndex {\n let index = this.hostBoxIndexes.get(sheet);\n if (!index) {\n const boxes = this.entries(sheet, COMPONENT_SPECIFICITY_BUMP).filter(\n ({ rule }) => rule.compounds.at(-2)?.host !== undefined,\n );\n this.hostBoxIndexes.set(sheet, (index = indexRules(boxes, undefined, HOSTS * SHEET_ROOM)));\n }\n return index;\n }\n\n /** A sheet's `::ng-deep` rules alone, filed as a component's own are. */\n private deepIndex(sheet: StyleSheet): RuleIndex {\n let index = this.deepIndexes.get(sheet);\n if (!index) {\n const deep = this.entries(sheet, COMPONENT_SPECIFICITY_BUMP).filter(({ rule }) => rule.deep);\n this.deepIndexes.set(sheet, (index = indexRules(deep, undefined, HOSTS * SHEET_ROOM)));\n }\n return index;\n }\n\n /** Weakest first: by layer where any sheet has one, then by weight, then as they were filed. */\n private readonly cascadeOrder = (a: IndexedEntry, b: IndexedEntry): number => {\n const layers = this.layered\n ? layerOrder(this.layerPlaces.get(a.entry.rule), this.layerPlaces.get(b.entry.rule))\n : 0;\n return layers || a.entry.weight - b.entry.weight || a.at - b.at;\n };\n\n /** A component's sheet as the rules of a host or of a creator, which differ only in their place. */\n private ownIndex(sheet: StyleSheet, role: typeof HOSTS | typeof CREATED): RuleIndex {\n let roles = this.ownIndexes.get(sheet);\n if (!roles) this.ownIndexes.set(sheet, (roles = []));\n return (roles[role] ??= indexRules(\n this.entries(sheet, COMPONENT_SPECIFICITY_BUMP),\n undefined,\n role * SHEET_ROOM,\n ));\n }\n\n /** The app's global sheet and every sheet added to it, with any added since the last read. */\n private sharedIndex(): RuleIndex {\n if (!this.filed) {\n this.filed = { buckets: new Map(), universal: [] };\n this.filedAdded = 0;\n if (this.globalSheet) indexRules(this.entries(this.globalSheet, 0), this.filed, 0);\n }\n for (; this.filedAdded < this.addedSheets.length; this.filedAdded++) {\n const from = (ADDED + this.filedAdded) * SHEET_ROOM;\n indexRules(this.entries(this.addedSheets[this.filedAdded]!, 0), this.filed, from);\n }\n return this.filed;\n }\n\n /** A sheet's rules at their weight here, with its layers given their places. */\n private entries(sheet: StyleSheet, bump: number): RuleEntry[] {\n this.placeLayers(sheet);\n if (sheet.rules.some((rule) => rule.layer !== undefined)) this.layered = true;\n return sheet.rules.map((rule) => ({ rule, sheet, weight: rule.specificity + bump }));\n }\n\n /**\n * Gives each of a sheet's layers its place among every sheet's, the first time the sheet is\n * merged, and each of its layered rules that place. Sheets are merged in the order a document\n * holds them: the app's global sheet, then each component's as it first renders.\n */\n private placeLayers(sheet: StyleSheet): void {\n if (!sheet.layers || this.layeredSheets.has(sheet)) return;\n this.layeredSheets.add(sheet);\n // A block with no name is a layer of this sheet's alone.\n const unnamed = `\\0${this.unnamedLayers++}`;\n const places = sheet.layers.map((path) => {\n const place: number[] = [];\n let names = this.layerNames;\n for (const part of path) {\n const name = part.startsWith('\\0') ? unnamed + part : part;\n let nested = names.nested.get(name);\n if (!nested)\n names.nested.set(name, (nested = { place: names.nested.size, nested: new Map() }));\n place.push(nested.place);\n names = nested;\n }\n return place;\n });\n for (const rule of sheet.rules) {\n if (rule.layer !== undefined) this.layerPlaces.set(rule, places[rule.layer]!);\n }\n }\n\n /**\n * A node's style from the rules it matched, shared with every other node that matched the same\n * rules under the same inherited values and tokens: a list's rows, and what is inside each.\n *\n * Everything past matching depends on those alone, and it is most of the work where a sheet\n * leaves values to the device: settling each `var()`, mixing colours, filling a shadow's slots.\n * A node that sets custom properties of its own is worked out alone. What is shared is never\n * written to after, so sharing it is safe; each node still has a cache and a context of its own.\n */\n private styled(\n node: StyleTarget,\n matched: readonly StyleRule[],\n parentTokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n ): Styled {\n // Shared between nodes that match alike, unless the node sets something of its own.\n const drawing = node.namespace !== undefined;\n const inline = node.inlineInherits ? inlineInherited(node.props['style'], drawing) : null;\n // Nor one that takes a value from its parent's own style, which two parents differ in, nor\n // a node of a drawing, which hands down paint another node with its rules does not.\n if (\n node.customProperties ||\n inline ||\n node.boundStyle ||\n drawing ||\n matched.some(takesParents)\n ) {\n return this.style(node, matched, parentTokens, parentInherited, inline);\n }\n if (this.sharedGeneration !== this.generation) {\n this.shared.clear();\n this.sharedGeneration = this.generation;\n }\n const key = matched.map((rule) => this.ruleId(rule)).join(',');\n let byTokens = this.shared.get(key);\n if (!byTokens) this.shared.set(key, (byTokens = new WeakMap()));\n let byInherited = byTokens.get(parentTokens);\n if (!byInherited) byTokens.set(parentTokens, (byInherited = new WeakMap()));\n let styled = byInherited.get(parentInherited);\n if (!styled) {\n styled = this.style(node, matched, parentTokens, parentInherited);\n byInherited.set(parentInherited, styled);\n }\n return styled;\n }\n\n private readonly shared = new Map<\n string,\n WeakMap<object, WeakMap<Record<string, unknown>, Styled>>\n >();\n private sharedGeneration = 0;\n private readonly ruleIds = new WeakMap<StyleRule, number>();\n private nextRuleId = 0;\n\n private ruleId(rule: StyleRule): number {\n let id = this.ruleIds.get(rule);\n if (id === undefined) this.ruleIds.set(rule, (id = this.nextRuleId++));\n return id;\n }\n\n /** A node's style from the rules it matched, worked out. */\n private style(\n node: StyleTarget,\n matched: readonly StyleRule[],\n parentTokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n inline: Record<string, unknown> | null = null,\n ): Styled {\n // Inline style is the last normal declaration, under every important one.\n const bound = node.boundStyle;\n const result = this.cascade(\n inline || bound\n ? [\n ...matched,\n { declarations: inline ?? EMPTY, ...(bound && { deferred: bound }) } as StyleRule,\n ]\n : matched,\n parentInherited,\n );\n\n // Tokens are in scope for this node's own declarations as well as its descendants', so they\n // are merged before any `var()` here is resolved.\n const tokens = tokensInScope(\n parentTokens,\n result.tokens,\n node.customProperties,\n result.importantTokens,\n );\n\n const own = result.declarations;\n if (result.deferred) {\n this.applyDeferred(result.deferred, own, tokens, parentInherited, result.important);\n }\n settleBorders(own);\n // `pointer-events: inherit` won the cascade: what the parent hands down stands.\n if (own['pointerEvents'] === 'inherit') delete own['pointerEvents'];\n const style = { ...parentInherited, ...own };\n settleLineHeight(style);\n const inherited = decorate(style, inheritFrom(parentInherited, own, node), own);\n const rtl = (style['direction'] ?? this.conditions.direction) === 'rtl';\n const important = importantNames(result, () => TWIN[rtl ? 'rtl' : 'ltr']);\n return important ? { style, inherited, tokens, important } : { style, inherited, tokens };\n }\n\n /** The rules that apply to a node, weakest first. */\n private matched(node: StyleTarget, entries: readonly RuleEntry[]): StyleRule[] {\n const out: StyleRule[] = [];\n // What the node's ancestors are, gathered for the first rule that names one.\n let above: Bits | undefined;\n for (const { rule, sheet } of entries) {\n if (!this.conditionHolds(rule)) continue;\n const named = namedAbove(rule);\n if (named && lacks((above ??= bitsAbove(node)), named)) continue;\n if (matches(node, rule, sheet)) out.push(rule);\n }\n return out;\n }\n\n /** The declarations of the rules a node matched. The list is sorted, so later simply wins. */\n private cascade(\n matched: readonly StyleRule[],\n parentInherited: Record<string, unknown>,\n ): CascadeResult {\n const normal: Record<string, unknown> = {};\n const important: Record<string, unknown> = {};\n let hasImportant = false;\n let tokens: Record<string, TokenValue> | null = null;\n let importantTokens: Record<string, TokenValue> | null = null;\n let deferred: DeferredDeclaration[] | null = null;\n const forms = new OtherForms(() => this.directionOf(matched, parentInherited));\n\n for (const rule of this.layered ? byImportance(matched, this.layerPlaces) : matched) {\n deferred = forms.before(rule, normal, important, deferred);\n Object.assign(normal, rule.declarations);\n if (rule.important) {\n Object.assign(important, rule.important);\n hasImportant = true;\n }\n if (rule.tokens) Object.assign((tokens ??= {}), rule.tokens);\n // An important custom property beats every plain one, whatever the rules' order.\n if (rule.importantTokens) {\n Object.assign((importantTokens ??= {}), pick(rule.tokens!, rule.importantTokens));\n }\n deferred = forms.within(rule, normal, important, carryDeferred(deferred, rule));\n }\n if (importantTokens) Object.assign(tokens!, importantTokens);\n deferred = forms.after(normal, deferred);\n\n return {\n declarations: hasImportant ? { ...normal, ...important } : normal,\n important: hasImportant ? important : null,\n tokens,\n importantTokens,\n deferred,\n };\n }\n\n /**\n * An inline style over the style the cascade settled, both already in `style`: a corner or an\n * edge the inline style sets takes the other form of it out, as a later rule would.\n */\n overOtherForms(inline: Readonly<Record<string, unknown>>, style: Record<string, unknown>): void {\n let twin: Readonly<Record<string, string>> | null = null;\n const written = Object.keys(inline);\n for (const [at, key] of written.entries()) {\n if (!(key in TWIN.ltr)) continue;\n twin ??= TWIN[this.readsRightToLeft(style) ? 'rtl' : 'ltr'];\n const other = twin[key]!;\n // Where the inline style sets both, the one it set later stands.\n if (written.indexOf(other) < at) delete style[other];\n }\n }\n\n /** Whether a settled style is of an element read right to left: by its own, or the app's. */\n readsRightToLeft(style: Readonly<Record<string, unknown>>): boolean {\n return (style['direction'] ?? this.conditions.direction) === 'rtl';\n }\n\n /**\n * The direction an element is laid out in: the last `direction` its own rules give it, the one\n * it inherits, or the app's. A logical corner is a different physical one in each.\n */\n private directionOf(\n matched: readonly StyleRule[],\n parentInherited: Record<string, unknown>,\n ): 'ltr' | 'rtl' {\n let plain: unknown;\n let important: unknown;\n for (const rule of matched) {\n plain = rule.declarations['direction'] ?? plain;\n important = rule.important?.['direction'] ?? important;\n }\n const direction =\n important ?? plain ?? parentInherited['direction'] ?? this.conditions.direction;\n return direction === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /**\n * Whether a rule's media query holds, memoised per rule.\n *\n * Conditions are the same for every node, so this is answered once per rule per change rather\n * than once per rule per node.\n */\n private conditionHolds(rule: StyleRule): boolean {\n if (rule.condition === undefined) return true;\n if (rule.activeAt !== this.generation) {\n rule.activeAt = this.generation;\n rule.active = this.evaluate(rule.condition);\n }\n return rule.active!;\n }\n\n private evaluate(condition: MediaCondition): boolean {\n if ('all' in condition) return condition.all.every((part) => this.evaluate(part));\n if ('any' in condition) return condition.any.some((part) => this.evaluate(part));\n\n if (!('op' in condition)) return this.preference(condition.feature) === condition.value;\n\n const { width, height } = this.conditions;\n const actual = condition.feature === 'width' ? width : height;\n const { op, value } = condition;\n if (op === 'gt') return actual > value;\n if (op === 'gte') return actual >= value;\n if (op === 'lt') return actual < value;\n if (op === 'lte') return actual <= value;\n return actual === value;\n }\n\n /** What the device answers for a feature that is a keyword rather than a measurement. */\n private preference(\n feature: 'orientation' | 'prefers-color-scheme' | 'prefers-reduced-motion' | 'direction',\n ) {\n const { width, height, colorScheme, reducedMotion, direction } = this.conditions;\n if (feature === 'direction') return direction ?? 'ltr';\n if (feature === 'orientation') return width > height ? 'landscape' : 'portrait';\n if (feature === 'prefers-color-scheme') return colorScheme;\n return reducedMotion ? 'reduce' : 'no-preference';\n }\n\n /** A length relative to the viewport, in points. */\n private viewportLength(unit: 'vw' | 'vh' | 'vmin' | 'vmax', factor: number): number {\n const { width, height } = this.conditions;\n const basis = {\n vw: width,\n vh: height,\n vmin: Math.min(width, height),\n vmax: Math.max(width, height),\n };\n return (factor * basis[unit]) / 100;\n }\n\n /**\n * Write the declarations that could not be settled at build time: a `var()` reference, or a\n * length relative to the viewport or to the font size in scope.\n *\n * A declaration with no token and no usable fallback is dropped rather than written as\n * undefined, which is what a browser does with a value it cannot resolve.\n */\n /**\n * What declarations that wait for a node's tokens come to on it, where no rule of the node's\n * carries them: a keyframe's, which is settled against the element that plays it.\n */\n settleFor(\n node: StyleTarget,\n deferred: readonly DeferredDeclaration[],\n epoch: number,\n ): Record<string, unknown> {\n const { tokens } = this.resolve(node, epoch);\n const above = node.parent ? this.resolve(node.parent, epoch).inherited : EMPTY;\n const own: Record<string, unknown> = {};\n this.applyDeferred(deferred, own, tokens, above, null);\n return own;\n }\n\n private applyDeferred(\n deferred: readonly DeferredDeclaration[],\n own: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n parentInherited: Record<string, unknown>,\n important: Record<string, unknown> | null,\n ): void {\n for (const declaration of settlingOrder(deferred)) {\n if (declaration.inherit) {\n this.inherit(declaration, own, parentInherited, important);\n continue;\n }\n const settled = this.settled(declaration, own, parentInherited, tokens);\n if (settled === undefined && this.onUndefinedToken) {\n this.reportUndefined(declaration, tokens);\n }\n const outranked = (prop: string) =>\n !declaration.important && important !== null && prop in important;\n // Said only of a display that is written: an important one wins over the token's.\n const unread = settled === undefined && declaration.kind === 'display';\n if (unread && this.onUnreadDisplay && !outranked('display')) {\n this.reportDisplay(declaration, tokens);\n }\n const layers = settled === undefined ? layersOf(declaration, tokens) : undefined;\n for (const prop of declaration.props) {\n if (!outranked(prop)) writeSettled(own, prop, declaration, settled, layers);\n }\n }\n }\n\n /** Note what the node being resolved takes an `inherit` from, and that its parent has an heir. */\n private heir(node: StyleTarget, parent: StyleCache | null, matched: readonly StyleRule[]): void {\n this.parentOf = parent;\n this.parentInline = node.parent?.props['style'];\n if (parent && matched.some(takesParents)) parent.heirs = true;\n }\n\n /** What the parent of the node being resolved came to: an `inherit` takes its values from it. */\n private parentOf: StyleCache | null = null;\n /** That parent's inline style, which is over what its rules gave it. */\n private parentInline: unknown;\n\n /** What the parent's inline style sets, under what its rules marked important, as on the parent. */\n private parentSet(): Readonly<Record<string, unknown>> {\n if (!this.parentInline) return EMPTY;\n const inline = flattenInline(this.parentInline, {});\n for (const prop of this.parentOf?.important ?? []) delete inline[prop];\n return inline;\n }\n\n /**\n * `inherit`: each prop as the parent has it, handed down or its own, and gone where the parent\n * has none, which is what a weaker rule's value for it gives way to.\n */\n private inherit(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n important: Record<string, unknown> | null,\n ): void {\n const inline = this.parentSet();\n for (const prop of declaration.props) {\n if (!declaration.important && important !== null && prop in important) continue;\n const value = inline[prop] ?? parentInherited[prop] ?? this.parentOf?.style[prop];\n if (value === undefined) delete own[prop];\n else own[prop] = value;\n }\n }\n\n /** One deferred declaration's value, from the tokens in scope and the node's own style. */\n private settled(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n if (declaration.within !== undefined) {\n return this.settledWithin(declaration.within, declaration, own, parentInherited, tokens);\n }\n if (declaration.compute) return this.computed(declaration, own, parentInherited);\n if (declaration.line) return this.settledLine(declaration, own, parentInherited, tokens);\n const value = referenced(declaration, tokens);\n if (declaration.whenSet !== undefined)\n return value === undefined ? undefined : declaration.whenSet;\n // A token defined in `em` or a viewport unit cannot be settled where it is defined: a\n // browser substitutes it and works it out where it is used, so the same here.\n const pending = (value as { __defer?: DeferredDeclaration['compute'] } | null)?.__defer;\n if (pending) return this.computed({ ...declaration, compute: pending }, own, parentInherited);\n // A token can hold a structured value with markers of its own: a shadow token whose colour\n // is another token, as Tailwind's rings are.\n return typeof value === 'object' && value !== null\n ? this.settledWithin(value, declaration, own, parentInherited, tokens)\n : value;\n }\n\n /** A line's longhands from its tokens, with a width in `em` worked out against the font size. */\n private settledLine(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): Record<string, unknown> | undefined {\n const line = declaration.line!;\n const values = lineValues(line, tokens);\n if (!values) return undefined;\n if (line.colour !== undefined) {\n // A colour that cannot be worked out makes the whole line invalid, as an unset token does.\n const colour = this.settledWithin(line.colour, declaration, own, parentInherited, tokens);\n if (colour === undefined) return undefined;\n for (const prop of line.colors) values[prop] = colour;\n }\n // `currentcolor` is the colour in scope, which only the node knows.\n if (values[line.colors[0]!] === 'currentcolor') {\n const colour = own['color'] ?? parentInherited['color'] ?? 'black';\n for (const prop of line.colors) values[prop] = colour;\n }\n const width = values[line.widths[0]!] as { __defer?: DeferredDeclaration['compute'] };\n if (!width?.__defer) return values;\n // No less than zero, as CSS clamps a line's width: `calc(var(--w) - 2px)` with an em token.\n const points = this.computed({ ...declaration, compute: width.__defer }, own, parentInherited);\n for (const prop of line.widths) values[prop] = Math.max(points as number, 0);\n return values;\n }\n\n /** A reference with nothing defined for it and nothing to fall back to. */\n private reportUndefined(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n ): void {\n const name = declaration.reference;\n if (name === undefined || name in tokens) return;\n if (declaration.fallback !== undefined || declaration.fallbackToken) return;\n if (declaration.alternatives?.some((alternative) => alternative in tokens)) return;\n this.onUndefinedToken!(name, declaration.props, declaration.on);\n }\n\n /** A display token set to a value native has no display for. */\n private reportDisplay(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n ): void {\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const name = names.find((candidate) => tokens[candidate] !== undefined);\n if (name) this.onUnreadDisplay!(name, formOf(tokens[name], 'display') as string | undefined);\n }\n\n /**\n * A structured value with every deferred length and colour inside it settled, or undefined when\n * a colour in it cannot be: a shadow with no colour is not a shadow, as CSS reads it.\n */\n private settledWithin(\n value: unknown,\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n const filled = this.filledIn(value, declaration, own, parentInherited, tokens);\n if (filled === UNSETTLED) return undefined;\n // As the compiler drops a shadow nobody can see: Tailwind composes five, four of them nothing.\n return declaration.props.includes('boxShadow') && Array.isArray(filled)\n ? filled.filter((shadow) => !invisible((shadow as { color?: unknown }).color))\n : filled;\n }\n\n /** A structured value with every deferred length and colour inside it settled. */\n private filledIn(\n value: unknown,\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n if (!needsFilling(value)) return value;\n const fill = (part: unknown) => this.filledIn(part, declaration, own, parentInherited, tokens);\n if (Array.isArray(value)) return this.filledList(value, fill, tokens);\n // `currentcolor` is the colour in scope, which only the node knows: Tailwind's ring default.\n // On `color` itself that is the inherited colour, as CSS reads it.\n const current = (): string => {\n const ownColour = declaration.props.includes('color') ? undefined : own['color'];\n return (ownColour ?? parentInherited['color'] ?? 'black') as string;\n };\n const marked = settledMarker(value, tokens, current);\n if (marked === 'currentcolor') return current();\n if (marked !== NOT_A_MARKER) return marked ?? UNSETTLED;\n const pending = (value as { __defer?: DeferredDeclaration['compute'] }).__defer;\n if (pending) return this.computed({ ...declaration, compute: pending }, own, parentInherited);\n const out: Record<string, unknown> = {};\n for (const [key, part] of Object.entries(value)) {\n const filled = fill(part);\n if (filled === UNSETTLED) return UNSETTLED;\n out[key] = filled;\n }\n return out;\n }\n\n /**\n * A list's parts filled in, a whole shadow or filter token standing for however many entries it\n * holds: none, for an empty filter slot.\n */\n private filledList(\n value: readonly unknown[],\n fill: (part: unknown) => unknown,\n tokens: Readonly<Record<string, TokenValue>>,\n ): unknown {\n const parts: unknown[] = [];\n for (const part of value) {\n const slot = slotOf(part);\n if (!slot) {\n const filled = fill(part);\n if (filled === UNSETTLED) return UNSETTLED;\n parts.push(filled);\n continue;\n }\n const filled = fill(\n substitute(slot.marker, tokens, (token) => slotEntries(token, slot.kind)),\n );\n if (filled === UNSETTLED || !Array.isArray(filled)) return UNSETTLED;\n parts.push(...filled);\n }\n return parts;\n }\n\n /** A length relative to the viewport or to the font size in scope. */\n private computed(\n declaration: DeferredDeclaration,\n own: Record<string, unknown>,\n parentInherited: Record<string, unknown>,\n ): unknown {\n const { unit, factor, offset = 0, multiple } = declaration.compute!;\n if (unit !== 'em') return this.viewportLength(unit, factor) + offset;\n if (multiple && !offset) return { multiple: factor } satisfies LineHeightMultiple;\n // The font size in scope. On `font-size` itself that is the inherited size rather than the\n // one being computed, which is what makes a nested `1.5em` compound as on the web.\n const base = declaration.props.includes('fontSize')\n ? parentInherited['fontSize']\n : (own['fontSize'] ?? parentInherited['fontSize']);\n // To a thousandth of a point: a factor rounded at build time, times a font size, is otherwise\n // 19.99998 where the web draws 20.\n const points = factor * (typeof base === 'number' ? base : DEFAULT_FONT_SIZE) + offset;\n return Math.round(points * 1000) / 1000;\n }\n}\n\n/**\n * The order a node's deferred declarations are settled in.\n *\n * Plain ones first and important ones after, so an important one wins whatever order they matched\n * in; and a plain one never writes over an important declaration. The font size before everything\n * else, because an em anywhere on the node is measured against it, whichever rule it came from:\n * '.x { padding: 1em } .y { font-size: 2em }'. Then the colour, because a `currentcolor` anywhere\n * on the node is the node's own colour: a ring's default, beside a `color: var(--c)`.\n */\nfunction settlingOrder(deferred: readonly DeferredDeclaration[]): readonly DeferredDeclaration[] {\n const byImportance = deferred.some((one) => one.important)\n ? [...deferred.filter((one) => !one.important), ...deferred.filter((one) => one.important)]\n : deferred;\n const rank = (one: DeferredDeclaration) =>\n one.props.includes('fontSize') ? 0 : one.props.includes('color') ? 1 : 2;\n return byImportance.some((one) => rank(one) < 2)\n ? [0, 1, 2].flatMap((wanted) => byImportance.filter((one) => rank(one) === wanted))\n : byImportance;\n}\n\n/**\n * The aliases, hsl() colours and channel colours among a node's own definitions, resolved against everything in\n * scope on it. Done once, where they are defined, so a descendant only ever sees values. A name\n * that resolves to nothing - undefined, part of a cycle, or an hsl() missing a channel - is\n * dropped, as a browser treats it as unset.\n *\n * Aliases first: an hsl() channel that names a plain token reads it whichever order these run in,\n * but an alias that names an hsl() token needs the hsl() already turned into a colour.\n */\n/**\n * The tokens in scope at a node: its parent's, overlaid with what its rules define, overlaid with\n * what it sets itself, which wins as inline style does.\n */\nfunction tokensInScope(\n parentTokens: Readonly<Record<string, TokenValue>>,\n ruleTokens: Readonly<Record<string, TokenValue>> | null,\n custom: Readonly<Record<string, TokenValue>> | null | undefined,\n important: Readonly<Record<string, TokenValue>> | null = null,\n): Readonly<Record<string, TokenValue>> {\n // What the element sets is over its rules' definitions, but for the ones marked important.\n const own = custom ? { ...ruleTokens, ...custom, ...important } : ruleTokens;\n if (!own || changesNothing(own, parentTokens)) return parentTokens;\n return resolveAliases(own, { ...parentTokens, ...own }, parentTokens);\n}\n\n/**\n * Whether a node's own definitions leave every token as its parent has it: each is the value the\n * parent has already, from the same rule, or a CSS-wide keyword that comes to what is in scope.\n * Tailwind writes `--tw-translate-x: 0`, `--tw-blur: initial` and forty more like them on every\n * element, so on nearly every node this is all there is, and the parent's map is handed on as it\n * is where a copy of it, a few hundred tokens, would be made.\n */\nfunction changesNothing(\n own: Readonly<Record<string, TokenValue>>,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n for (const name in own) {\n const value = own[name]!;\n // The very value its parent has: the one rule gave it to both, as `*` gives every element.\n if (parentTokens[name] === value) continue;\n const word = value.keyword;\n if (word === undefined || !CSS_WIDE.has(word)) return false;\n // `inherit` and `unset` are the parent's value whatever it is; the rest are no value at all.\n if (word !== 'inherit' && word !== 'unset' && parentTokens[name] !== undefined) return false;\n }\n return true;\n}\n\nfunction resolveAliases(\n own: Readonly<Record<string, TokenValue>>,\n merged: Record<string, TokenValue>,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): Record<string, TokenValue> {\n const names = Object.keys(own);\n for (const name of names) {\n const word = own[name]!.keyword;\n if (word !== undefined && CSS_WIDE.has(word)) cssWide(merged, name, word, parentTokens);\n }\n const aliases = names.filter((name) => own[name]!.alias);\n followAliases(aliases, merged);\n // Left to work out: each token made of others and each alias that came to one, by a link or a\n // fallback, `var(--missing, calc(var(--gap) * 2))`, which is worked out here as well.\n const pending = new Set(names.filter((name) => isDerived(merged[name])));\n if (pending.size) settleDerived(own, merged, pending);\n return merged;\n}\n\nconst CSS_WIDE: ReadonlySet<string> = new Set([\n 'initial',\n 'inherit',\n 'unset',\n 'revert',\n 'revert-layer',\n]);\n\n/**\n * A token set to a CSS-wide keyword, as CSS has one: its parent's value for `inherit` and `unset`,\n * since a custom property inherits, and otherwise its initial value, which is to be unset. Tailwind\n * writes `--tw-blur: initial` for each filter slot a node has not filled.\n */\nfunction cssWide(\n merged: Record<string, TokenValue>,\n name: string,\n word: string,\n parentTokens: Readonly<Record<string, TokenValue>>,\n): void {\n const inherited = word === 'inherit' || word === 'unset' ? parentTokens[name] : undefined;\n if (inherited) merged[name] = inherited;\n else delete merged[name];\n}\n\n/** What a token not yet worked out reads as while another is: set, with no form of any kind. */\nconst PENDING: TokenValue = Object.freeze({});\n\n/**\n * The tokens left to work out, each settled once none it reads is still to be, whatever order they\n * are defined in. One that reads another still to be waits, rather than taking a fallback: a\n * fallback is for a token that is unset or invalid. When every one left waits for another, those\n * in a cycle, counting only the references read, are invalid, and the rest go on without them,\n * taking their fallbacks, as CSS has it.\n */\nfunction settleDerived(\n own: Readonly<Record<string, TokenValue>>,\n merged: Record<string, TokenValue>,\n pending: Set<string>,\n): void {\n const waitingOn = new Map<string, ReadonlySet<string>>();\n let read = new Set<string>();\n const view = new Proxy(merged, {\n get: (tokens, name: string) => {\n if (!pending.has(name)) return tokens[name];\n read.add(name);\n return PENDING;\n },\n });\n while (pending.size) {\n let settled = false;\n for (const name of pending) {\n read = new Set();\n const token = own[name]!;\n const value = token.alias ? substitutedIn(token, view) : workedOut(token, view);\n if (read.size) {\n waitingOn.set(name, read);\n continue;\n }\n pending.delete(name);\n settle(merged, name, value);\n settled = true;\n }\n if (settled) continue;\n for (const name of inCycles(pending, waitingOn)) {\n pending.delete(name);\n delete merged[name];\n }\n }\n}\n\n/** An alias's target, or the first of its fallbacks that is set, with one made of others worked out. */\nfunction substitutedIn(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n let link: TokenValue | undefined = token;\n while (link?.alias) {\n const target = tokens[link.alias];\n if (target !== undefined) return target;\n link = link.fallback;\n }\n return link && isDerived(link) ? workedOut(link, tokens) : link;\n}\n\n/**\n * A token that is set but makes no valid value. A use site finds it set, so takes no fallback, and\n * in no form, so its property is unset, as CSS substitutes such a token and then unsets it.\n */\nconst INVALID: TokenValue = Object.freeze({});\n\n/**\n * A token made of others, worked out: invalid when it makes nothing valid, as `hsl()` of a\n * percentage hue does, and unset only when a `var()` in it has nothing to be substituted with.\n */\nfunction workedOut(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n return derived(token, tokens) ?? (substitutable(token, tokens) ? INVALID : undefined);\n}\n\n/** Whether each `var()` in a token made of others names a token that is set, or has a fallback. */\nfunction substitutable(token: TokenValue, tokens: Readonly<Record<string, TokenValue>>): boolean {\n if (token.hsl) return hslSubstitutable(token.hsl, tokens);\n if (token.deferredColour) return colourSubstitutable(token.deferredColour, tokens);\n if (token.deferredLengths) {\n return token.deferredLengths.every(\n (part) => typeof part !== 'object' || substitutedIn(part, tokens) !== undefined,\n );\n }\n // Each marker is one reading of the same text, and a fallback one cannot read is dropped from it.\n return token.deferredCalc!.some((marker) => calcSubstitutable(marker.expression, tokens));\n}\n\nfunction hslSubstitutable(\n hsl: NonNullable<TokenValue['hsl']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n return [hsl.h, hsl.s, hsl.l, hsl.alpha].every(\n (channel) =>\n typeof channel !== 'object' ||\n tokens[channel.reference] !== undefined ||\n channel.fallback !== undefined,\n );\n}\n\nfunction calcSubstitutable(\n expression: CalcExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if (Array.isArray(expression)) {\n return expression.slice(1).every((side) => calcSubstitutable(side, tokens));\n }\n if (typeof expression !== 'object' || 'percentage' in expression) return true;\n const leaf = expression as Extract<CalcLeaf, { reference: string }>;\n if (tokens[leaf.reference] !== undefined) return true;\n return leaf.fallback !== undefined && calcSubstitutable(leaf.fallback, tokens);\n}\n\nfunction colourSubstitutable(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if ('color' in expression) return true;\n if ('hsl' in expression) return hslSubstitutable(expression.hsl, tokens);\n if ('relative' in expression) return colourSubstitutable(expression.relative.from, tokens);\n if ('mix' in expression) {\n const { a, b } = expression.mix;\n return colourSubstitutable(a, tokens) && colourSubstitutable(b, tokens);\n }\n if ('channels' in expression) {\n const { channels, alpha } = expression;\n const set = (one: { reference: string; fallback?: unknown }) =>\n tokens[one.reference] !== undefined || one.fallback !== undefined;\n return set(channels) && (typeof alpha !== 'object' || set(alpha));\n }\n return referenceSubstitutable(expression, tokens);\n}\n\n/** A colour's `var()`: a token or alternative that is set, or a fallback that can be worked out. */\nfunction referenceSubstitutable(\n expression: Extract<ColourExpression, { reference: string }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n const names = [expression.reference, ...(expression.alternatives ?? [])];\n if (names.some((name) => tokens[name] !== undefined)) return true;\n if (expression.fallback !== undefined) return true;\n const token = expression.fallbackToken;\n return token !== undefined && (!isDerived(token) || substitutable(token, tokens));\n}\n\n/**\n * A reference read from its token when that is set, in whatever form `read` finds, and its\n * fallback only when it is not.\n */\nfunction substitute(\n marker: { readonly reference: string; readonly fallback?: unknown },\n tokens: Readonly<Record<string, TokenValue>>,\n read: (token: TokenValue) => unknown,\n): unknown {\n const token = tokens[marker.reference];\n return token === undefined ? marker.fallback : read(token);\n}\n\n/** The first of the names that is set: the one a `var()` and its `var()` fallbacks substitute. */\nfunction firstSet(\n names: readonly string[],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n for (const name of names) if (tokens[name] !== undefined) return tokens[name];\n return undefined;\n}\n\n/** The names among `names` that reach themselves by what each waits on. */\nfunction inCycles(\n names: ReadonlySet<string>,\n waitingOn: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n const reaches = (from: string, to: string, seen: Set<string>): boolean => {\n for (const next of waitingOn.get(from) ?? []) {\n if (next === to) return true;\n if (names.has(next) && !seen.has(next) && seen.add(next) && reaches(next, to, seen)) {\n return true;\n }\n }\n return false;\n };\n return [...names].filter((name) => reaches(name, name, new Set()));\n}\n\n/** Whether a token is made of others, and so worked out where it is defined. */\nfunction isDerived(token: TokenValue | undefined): boolean {\n return Boolean(\n token?.hsl || token?.deferredColour || token?.deferredCalc || token?.deferredLengths,\n );\n}\n\n/** A token made of others, worked out from the tokens in scope. */\nfunction derived(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n if (token.hsl) return colourToken(resolveHsl(token.hsl, tokens));\n if (token.deferredColour) return colourToken(resolveColour(token.deferredColour, tokens));\n if (token.deferredLengths) return lengthsToken(token, tokens);\n return calcToken(token.deferredCalc!, tokens);\n}\n\n/**\n * A token of several lengths with each part that is a `var()` followed. Where a part comes to\n * no length the token is what else it reads as, a shadow whose colour is a token being several\n * lengths and a `var()` too, or nothing where it reads as nothing else.\n */\nfunction lengthsToken(\n token: TokenValue,\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n const { deferredLengths, ...rest } = token;\n const lengths = deferredLengths!.map((part) =>\n typeof part === 'object' ? substitutedIn(part, tokens)?.length : part,\n );\n if (lengths.every((length) => length !== undefined)) {\n return { ...rest, lengths: lengths as (number | string)[] };\n }\n return Object.keys(rest).length ? rest : undefined;\n}\n\n/**\n * Each alias settled to what it names. `follow` writes back every one that resolves; one in a\n * cycle is removed only once all are followed, as removed any sooner, the next one round the\n * cycle would find it unset and take its own fallback.\n */\nfunction followAliases(aliases: readonly string[], merged: Record<string, TokenValue>): void {\n const cyclic = aliases.filter((name) => typeof follow(name, merged, []) === 'number');\n for (const name of cyclic) delete merged[name];\n}\n\n/** A token set to what it resolved to, or removed when it resolved to nothing, as CSS unsets it. */\nfunction settle(\n merged: Record<string, TokenValue>,\n name: string,\n value: TokenValue | undefined,\n): void {\n if (value) merged[name] = value;\n else delete merged[name];\n}\n\nconst colourToken = (color: string | undefined): TokenValue | undefined =>\n color === undefined ? undefined : { color };\n\n/** A `calc()` token's forms, from the tokens in scope: undefined when it makes neither. */\nfunction calcToken(\n markers: readonly CalcMarker[],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | undefined {\n let token: TokenValue | undefined;\n for (const marker of markers) {\n const value = resolveCalc(marker, tokens);\n if (value === undefined) continue;\n if (marker.kind === 'length') token = { ...token, length: value };\n else if (typeof value === 'number') token = { ...token, number: value };\n // Arithmetic of a percentage, `calc(var(--half) * 2)`, is a percentage, as a token written\n // `100%` is, so an hsl() does not read it as a bare number of percent.\n const percentage = marker.kind === 'number' && calcType(marker.expression, tokens) === '%';\n if (percentage && typeof value === 'number' && token?.length === undefined) {\n token = { ...token, length: `${Math.round(value * 100000) / 1000}%` };\n }\n }\n return token;\n}\n\n/**\n * What a calc() of numbers and percentage tokens makes, as CSS types it: a number, `''`, a\n * percentage, `'%'`, or neither, as a percentage added to a number is, or one percentage\n * multiplied by another.\n */\nfunction calcType(\n expression: CalcExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n): '' | '%' | undefined {\n if (typeof expression === 'number') return '';\n if (!Array.isArray(expression)) return leafType(expression as CalcLeaf, tokens);\n const [op, a, b] = expression as readonly [string, CalcExpression, CalcExpression];\n const left = calcType(a, tokens);\n const right = calcType(b, tokens);\n if (left === undefined || right === undefined) return undefined;\n if (op === '*') return left && right ? undefined : left || right;\n if (op === '/') return right ? undefined : left;\n return left === right ? left : undefined;\n}\n\n/** What one token in a calc() is, as `calcType` reads it: its fallback's type when it is unset. */\nfunction leafType(\n leaf: CalcLeaf,\n tokens: Readonly<Record<string, TokenValue>>,\n): '' | '%' | undefined {\n if ('percentage' in leaf) return '%';\n const token = tokens[leaf.reference];\n if (!token) return leaf.fallback === undefined ? undefined : calcType(leaf.fallback, tokens);\n return typeof token.length === 'string' && token.length.endsWith('%') ? '%' : '';\n}\n\n/** An `hsl()` token's channels, read from the tokens in scope, as the colour they make. */\nfunction resolveHsl(\n hsl: NonNullable<TokenValue['hsl']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n const h = hslChannel(hsl.h, tokens, 'hue');\n const s = hslChannel(hsl.s, tokens, hsl.legacy ? 'legacy' : 'percentage');\n const l = hslChannel(hsl.l, tokens, hsl.legacy ? 'legacy' : 'percentage');\n const alpha = hsl.alpha === undefined ? 1 : hslChannel(hsl.alpha, tokens, 'alpha');\n if (h === undefined || s === undefined || l === undefined || alpha === undefined) {\n return undefined;\n }\n return hslToRgb(h, s, l, alpha);\n}\n\n/**\n * A channel's number, or undefined when its token is the wrong kind for the slot, as the token's\n * text substituted into the hsl() would read: a hue is a number or an angle, read in degrees, as\n * `0.5turn` is 180 and not 0.5, and never a percentage; a saturation or a lightness is a\n * percentage, or a bare number of percent, `--s: 100`, though not in the legacy comma syntax; an\n * alpha is a number or a percentage. The fallback is only for a token that is not set, as a set\n * one is substituted, whatever it holds.\n */\nfunction hslChannel(\n channel: HslChannel,\n tokens: Readonly<Record<string, TokenValue>>,\n slot: 'hue' | 'percentage' | 'legacy' | 'alpha',\n): number | undefined {\n if (typeof channel === 'number') return channel;\n const token = tokens[channel.reference];\n if (!token) return channel.fallback;\n const percentage = typeof token.length === 'string' && token.length.endsWith('%');\n if (slot === 'hue') return percentage ? undefined : (token.angle ?? token.number);\n if (token.angle !== undefined || token.number === undefined) return undefined;\n if (percentage || slot === 'alpha') return token.number;\n return slot === 'legacy' ? undefined : token.number / 100;\n}\n\n/**\n * `hsl(h, s, l)` converted to sRGB, printed the same way `fromChannels` prints an rgba() built\n * from tokens: a use site never has to know which of the two ever built a colour.\n *\n * `h` is degrees; `s` and `l` are fractions, which is what a percentage token already reads as\n * (see `formOf`), so nothing here rescales them.\n */\nfunction hslToRgb(h: number, saturation: number, l: number, opacity: number): string {\n // Out of range as CSS Color 4 takes it: a saturation below 0 is 0, an alpha is clamped, and\n // anything else is converted as it is, each channel it makes then clamped into sRGB.\n const s = Math.max(0, saturation);\n const alpha = Math.min(1, Math.max(0, opacity));\n const hue = ((h % 360) + 360) % 360;\n const chroma = (1 - Math.abs(2 * l - 1)) * s;\n const x = chroma * (1 - Math.abs(((hue / 60) % 2) - 1));\n const m = l - chroma / 2;\n const [r1, g1, b1] =\n hue < 60\n ? [chroma, x, 0]\n : hue < 120\n ? [x, chroma, 0]\n : hue < 180\n ? [0, chroma, x]\n : hue < 240\n ? [0, x, chroma]\n : hue < 300\n ? [x, 0, chroma]\n : [chroma, 0, x];\n const [r, g, b] = [r1, g1, b1].map((c) => Math.round(Math.min(1, Math.max(0, c + m)) * 255));\n return alpha >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${Math.round(alpha * 1000) / 1000})`;\n}\n\n/**\n * A token with its `var()` substituted, through as many aliases and fallbacks as it takes.\n *\n * `path` is the aliases being followed on the way here. A number is a cycle, and the index in\n * `path` where it starts: every property from there on is in it and invalid at computed-value\n * time, so none of them takes its fallback, while one before it names an invalid property and\n * does. Anything else is final wherever the chain started, so it is written back to `tokens`, and\n * no alias is followed twice.\n */\nfunction follow(\n name: string,\n tokens: Record<string, TokenValue>,\n path: string[],\n): TokenValue | undefined | number {\n const value = tokens[name];\n if (!value?.alias) return value;\n const start = path.indexOf(name);\n if (start >= 0) return start;\n const depth = path.push(name) - 1;\n const result = substituted(value, tokens, path, depth);\n path.pop();\n if (typeof result !== 'number') settle(tokens, name, result);\n return result;\n}\n\n/** An alias's target, or its fallback, which may be another `var()`, when the target is unset. */\nfunction substituted(\n value: TokenValue,\n tokens: Record<string, TokenValue>,\n path: string[],\n depth: number,\n): TokenValue | undefined | number {\n const target = follow(value.alias!, tokens, path);\n if (typeof target === 'object' || (typeof target === 'number' && target <= depth)) return target;\n const { fallback } = value;\n return fallback?.alias ? substituted(fallback, tokens, path, depth) : fallback;\n}\n\n/** What a `var()` resolves to: a gradient's stops, or one value with its arithmetic applied. */\nfunction referenced(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (declaration.gradient) return paintLayers(declaration.gradient, tokens);\n // The first token set is substituted, whatever it holds: one of the wrong kind leaves the\n // property unset rather than trying the next, or the fallback.\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const token = firstSet(names, tokens);\n let value = token ? formFor(token, declaration) : fallbackOf(declaration, tokens);\n // `calc(var(--n) * 1px)`: the arithmetic gives a unitless token its unit, which is the usual\n // way to turn a count into a length. So it reads the bare number, and a length is no such thing.\n if (token && declaration.adjust?.number && declaration.kind === 'length') {\n value = token.number;\n }\n if (declaration.kind === 'display') return displayOf(value);\n const base = CHANNEL_KINDS.has(declaration.kind!)\n ? fromChannels(value, declaration.alpha, tokens, declaration.space)\n : value;\n return declaration.adjust ? adjusted(base, declaration.adjust) : base;\n}\n\n/**\n * What a display keyword is laid out as: flex, none, contents, or one of the block containers,\n * which the engine lays out as a flex column and commits as flex (`flow.ts`). An inline box is\n * flex, as the compiler reads one written out, an inline-flex box sits in a line, and `flow` is\n * a block.\n * Anything else, a grid or a table, is no display native has, so the property is unset.\n */\nconst DISPLAYS: ReadonlyMap<string, string> = new Map([\n ...['flex', 'inline'].map((word) => [word, 'flex'] as const),\n ...['block', 'flow-root', 'inline-block', 'inline-flex', 'none', 'contents'].map(\n (word) => [word, word] as const,\n ),\n ['grid', 'grid'],\n ['inline-grid', 'inline-grid'],\n ['flow', 'block'],\n]);\n\n/**\n * The two-keyword form, an outer display and an inner one in either order, as Chrome computes\n * it: `inline flex` is `inline-flex`, `block flow` is `block`, `inline flow-root` is\n * `inline-block`.\n */\nconst OUTER = new Set(['block', 'inline']);\nconst INNER = new Set(['flow', 'flow-root', 'flex', 'grid']);\nconst PAIRS: Readonly<Record<string, string>> = {\n 'block flow': 'block',\n 'block flow-root': 'flow-root',\n 'inline flow-root': 'inline-block',\n 'block grid': 'grid',\n 'inline grid': 'inline-grid',\n 'inline flex': 'inline-flex',\n};\n\nfunction displayOf(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined;\n const words = value.toLowerCase().split(CSS_SPACE);\n if (words.length === 1) return DISPLAYS.get(words[0]!);\n if (words.length !== 2) return undefined;\n const [outer, inner] = (OUTER.has(words[0]!) ? words : [words[1], words[0]]) as [string, string];\n if (!OUTER.has(outer) || !INNER.has(inner)) return undefined;\n return PAIRS[`${outer} ${inner}`] ?? 'flex';\n}\n\n/**\n * A set token's value in the form wanted. A token of `currentColor` is the colour in scope where\n * it is used, not where it is set, so it is the marker the node fills in.\n */\nfunction tokenForm(token: TokenValue, kind: TokenKind): unknown {\n const value = formOf(token, kind);\n return value === undefined && kind === 'color' && isCurrentColour(token) ? CURRENT_COLOUR : value;\n}\n\n/** A corner's place among four as CSS writes them, before a side's: `borderTopLeftRadius`. */\nconst PLACES: readonly (readonly [RegExp, number])[] = [\n [/TopLeft|TopStart|StartStart/, 0],\n [/TopRight|TopEnd|StartEnd/, 1],\n [/BottomRight|BottomEnd|EndEnd/, 2],\n [/BottomLeft|BottomStart|EndStart/, 3],\n [/Top/, 0],\n [/Right|End/, 1],\n [/Bottom/, 2],\n [/Left|Start/, 3],\n];\n\n/** Where a side or a corner comes in a shorthand of four, whatever order its props are kept in. */\nconst placeOf = (prop: string): number => PLACES.find(([named]) => named.test(prop))?.[1] ?? 0;\n\n/** The lengths of a token that holds several, for the props of a shorthand to take one each. */\nclass EachSide {\n readonly lengths: readonly (number | string)[];\n constructor(lengths: readonly (number | string)[]) {\n this.lengths = lengths;\n }\n\n /**\n * The length for one of a shorthand's four props, as CSS gives them: two are a pair repeated,\n * and of three the left takes the right's. Nothing for a property that is not such a\n * shorthand: a token of several lengths is no value for it, and it is unset.\n */\n at(props: readonly string[], prop: string): number | string | undefined {\n if (props.length !== 4) return undefined;\n const index = placeOf(prop);\n return this.lengths[index] ?? this.lengths[index - 2] ?? this.lengths[0];\n }\n}\n\n/**\n * A set token's value in the form a declaration wants, or its several lengths where it wants a\n * length and the token has no one: for a shorthand that takes one a side, see `writeSettled`.\n * Not with arithmetic on it, which is of one length.\n */\nfunction formFor(token: TokenValue, declaration: DeferredDeclaration): unknown {\n const value = tokenForm(token, declaration.kind!);\n if (value !== undefined || !token.lengths || declaration.kind !== 'length') return value;\n return declaration.adjust ? undefined : new EachSide(token.lengths);\n}\n\n/** What a deferred declaration settled to, written to one of its props. */\nfunction writeSettled(\n own: Record<string, unknown>,\n prop: string,\n declaration: DeferredDeclaration,\n settled: unknown,\n layers: BackgroundLayers | undefined,\n): void {\n const one = settled instanceof EachSide ? settled.at(declaration.props, prop) : settled;\n const value = one ?? declaration.unset;\n if (declaration.layers) writeLayer(own, prop, value, layers);\n else write(own, prop, value, declaration.line !== undefined);\n}\n\n/**\n * One prop of a `background: var()`, whose token may hold the images as well as the colour. The\n * image is written only where the token holds one: a token that is a colour leaves an image\n * another rule declared as it is. Each prop is ranked in the cascade by itself, so an image a\n * later rule declares, or an important one, is not written over by the token's.\n */\nfunction writeLayer(\n own: Record<string, unknown>,\n prop: string,\n value: unknown,\n layers: BackgroundLayers | undefined,\n): void {\n if (prop !== BACKGROUND_IMAGE) write(own, prop, layers?.color ?? value, false);\n else if (layers) own[prop] = layers.images;\n}\n\nconst BACKGROUND_IMAGE = 'experimental_backgroundImage';\n\n/**\n * The gradients a `background: var()` reads where its token is no colour: see `backgroundLayers`.\n * Only the shorthand, which the compiler marks: `background-color: var()` is a colour or nothing.\n * And only where the token is set as text on an element, which is where a library sets one as the\n * app runs; a stylesheet's is refused where it is written. The token is the one the declaration\n * settles on, the first that is set.\n */\nfunction layersOf(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): BackgroundLayers | undefined {\n if (!declaration.layers) return undefined;\n const names = [declaration.reference!, ...(declaration.alternatives ?? [])];\n const text = firstSet(names, tokens)?.keyword;\n return text && /gradient\\(/i.test(text) ? backgroundLayers(text) : undefined;\n}\n\nconst BOUND_NUMBERS = new Set([\n 'opacity',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'zIndex',\n 'aspectRatio',\n 'elevation',\n]);\nconst BOUND_LENGTH =\n /^(?:(?:min|max)?(?:width|height)|top|right|bottom|left|start|end|gap|fontSize|letterSpacing)$|(?:margin|padding|inset|Width|Radius|Gap|Basis)/i;\n\n/** The properties whose token is read in a form of its own. */\nconst BOUND_KINDS: Readonly<Record<string, TokenKind>> = {\n display: 'display',\n transform: 'transform',\n boxShadow: 'shadow',\n filter: 'filter',\n};\n\n/** What a token is read as for a bound declaration of `prop`, as the compiler says for a rule. */\nfunction boundKind(prop: string): TokenKind {\n // `fill` and `stroke` are a shape's paint, which is a colour.\n if (/color$/i.test(prop) || prop === 'fill' || prop === 'stroke') return 'color';\n if (prop === 'fontWeight') return 'weight';\n if (prop === 'fontFamily') return 'family';\n if (prop === 'lineHeight') return 'lineHeight';\n if (prop in BOUND_KINDS) return BOUND_KINDS[prop]!;\n if (BOUND_NUMBERS.has(prop)) return 'number';\n return BOUND_LENGTH.test(prop) ? 'length' : 'keyword';\n}\n\n/**\n * A bound declaration whose value is one `var()`, `var(--brand, red)`, as the deferred declaration\n * the compiler writes for the same value in a rule. `token` is the value as a token, which is an\n * alias when it is a `var()`; null for any other.\n *\n * A colour made of tokens, `color-mix(in srgb, var(--brand), white 20%)`, is worked out from the\n * tokens where it is used, as a fallback of the same shape is.\n *\n * ponytail: any other value has to be the whole `var()`. One inside a longer value, `calc()`\n * included, is what the compiler parses at build time and nothing here does; write the sum in a\n * custom property, `[style.--gap]`, and read that in the stylesheet.\n */\nexport function boundDeclaration(\n prop: string,\n token: TokenValue | undefined,\n on?: string,\n): DeferredDeclaration | null {\n const kind = boundKind(prop);\n if (!token?.alias) return derivedColour(prop, token, kind, on);\n const [reference, ...alternatives] = aliasesOf(token);\n for (; token?.alias; token = token.fallback);\n // `tokenForm`, so a fallback of `currentColor` is the colour of the element, as in a rule.\n const fallback = token && !isDerived(token) ? tokenForm(token, kind) : undefined;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n kind,\n reference: reference!,\n ...(alternatives.length ? { alternatives } : {}),\n ...(fallback !== undefined ? { fallback } : {}),\n ...(token && isDerived(token) ? { fallbackToken: token } : {}),\n };\n}\n\n/** A CSS number: `1.5`, `+1.5`, `.5`, `1e0`, `-2`. */\nconst CSS_NUMBER = String.raw`[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?`;\n\n/** A length in `em` or a viewport unit, the whole value: `2em`, `-0.5em`, `50vw`. */\nconst RELATIVE_LENGTH = new RegExp(String.raw`^\\s*(${CSS_NUMBER})(em|vw|vh|vmin|vmax)\\s*$`, 'i');\n\n/** A number with no unit, as a `line-height` is written: a multiple of the font size. */\nconst UNITLESS = new RegExp(String.raw`^\\s*(${CSS_NUMBER})\\s*$`, 'i');\n\n/** A negative `line-height`, of a number or a length, which CSS has no value for. */\nconst NEGATIVE = new RegExp(String.raw`^\\s*-(?:\\d|\\.\\d)`);\n\n/** Whether `text` is a `line-height` below zero, which a browser drops: `-1.5`, `-1em`, `-2px`. */\nexport const isNegativeLineHeight = (prop: string, text: string): boolean =>\n prop === 'lineHeight' && NEGATIVE.test(text);\n\ntype RelativeUnit = NonNullable<DeferredDeclaration['compute']>['unit'];\n\n/**\n * A bound declaration of a length in `em` or a viewport unit, `[style.width]=\"'2em'\"`, as the\n * deferred declaration the compiler writes for the same value in a rule: measured where it is\n * used, against the font size in scope. A viewport unit is measured against the viewport, and\n * again when it changes. A `line-height` with no unit is the number a rule hands down. Null for\n * any other value, and for a property that takes no length.\n */\nexport function boundRelativeLength(\n prop: string,\n text: string,\n on?: string,\n): DeferredDeclaration | null {\n const kind = boundKind(prop);\n if (kind !== 'length' && kind !== 'lineHeight') return null;\n const relative = RELATIVE_LENGTH.exec(text);\n if (relative) {\n const unit = relative[2]!.toLowerCase() as RelativeUnit;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n compute: { unit, factor: Number(relative[1]) },\n };\n }\n // A line height with no unit is a number each text under it multiplies its own font size by,\n // not the points it comes to here: the compiler writes the same for it in a rule.\n const unitless = kind === 'lineHeight' ? UNITLESS.exec(text) : null;\n if (!unitless) return null;\n return {\n props: [prop],\n ...(on === undefined ? {} : { on }),\n compute: { unit: 'em', factor: Number(unitless[1]), multiple: true },\n };\n}\n\n/** A bound colour made of tokens, worked out where it is used; null for any other value. */\nfunction derivedColour(\n prop: string,\n token: TokenValue | undefined,\n kind: TokenKind,\n on: string | undefined,\n): DeferredDeclaration | null {\n if (!token || kind !== 'color' || !isDerived(token)) return null;\n return { props: [prop], ...(on === undefined ? {} : { on }), kind, fallbackToken: token };\n}\n\n/** The names a `var()` tries in turn: its own, then each `var()` nested as its fallback. */\nfunction aliasesOf(token: TokenValue | undefined): string[] {\n const names: string[] = [];\n for (; token?.alias; token = token.fallback) names.push(token.alias);\n return names;\n}\n\n/** The fallback written, or one made of other tokens, worked out from the tokens where it is used. */\nfunction fallbackOf(\n declaration: DeferredDeclaration,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n const token = declaration.fallbackToken;\n return declaration.fallback ?? (token && formOf(derived(token, tokens), declaration.kind!));\n}\n\n/**\n * One longhand of a deferred declaration written to the node's own style. Unset when the value is\n * nothing, as CSS has a declaration invalid once its tokens are known: it still wins the cascade,\n * so what a weaker rule set goes, and the property inherits or starts over. A line's value is one\n * per longhand, and leaves the ones it was written with alone.\n */\nfunction write(own: Record<string, unknown>, prop: string, value: unknown, perProp: boolean): void {\n if (value === undefined) delete own[prop];\n else if (!perProp) own[prop] = value;\n else if (prop in (value as Record<string, unknown>)) {\n own[prop] = (value as Record<string, unknown>)[prop];\n }\n}\n\n/** The styles a line's token can be, as the compiler reads a written one. */\nconst LINE_STYLES: ReadonlySet<string> = new Set([\n 'solid',\n 'dashed',\n 'dotted',\n 'double',\n 'groove',\n 'ridge',\n 'inset',\n 'none',\n 'hidden',\n]);\nconst LINE_WIDTHS: Readonly<Record<string, number>> = { thin: 1, medium: 3, thick: 5 };\n\n/** What a line's token substitutes to: a token, or nothing at all, `var(--x,)` or `--x: ;`. */\nconst NOTHING = Symbol('nothing');\n\n/**\n * A line's longhands, each token given the one role its form says and the written parts did not\n * take. Undefined when a token is unset with nothing to fall back to, fits no role left, or would\n * take a role twice: CSS makes the whole shorthand invalid then.\n */\nfunction lineValues(\n line: LineTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): Record<string, unknown> | undefined {\n const open = new Set(line.roles);\n const values: Record<string, unknown> = {};\n for (const reference of line.references) {\n const token = lineToken(reference, tokens);\n if (token === undefined) return undefined;\n if (token === NOTHING) continue;\n const found = reference.adjust\n ? computedWidth(token, open, reference.adjust)\n : lineRole(token, open);\n if (!found) return undefined;\n open.delete(found.role);\n fillRole(line, values, found.role, found.value);\n }\n // A part no token filled takes its initial value, as one left out of a written line does.\n for (const role of open) fillRole(line, values, role, LINE_INITIAL[role]);\n return values;\n}\n\n/** A token of `currentColor`, in any case. */\nconst isCurrentColour = (token: TokenValue | undefined): boolean =>\n token?.keyword?.toLowerCase() === 'currentcolor';\n\n/** The marker the compiler writes for `currentColor`, which the node fills in. */\nconst CURRENT_COLOUR = { __colour: { color: 'currentcolor' } };\n\n/** What a line's width, style and colour are when it leaves them out. */\nconst LINE_INITIAL = {\n width: LINE_WIDTHS['medium'],\n style: 'none',\n color: 'currentcolor',\n} as const;\n\nfunction fillRole(\n line: LineTemplate,\n values: Record<string, unknown>,\n role: LineTemplate['roles'][number],\n value: unknown,\n): void {\n const styles = [line.style!, ...(line.marks ?? [])];\n const props = { width: line.widths, color: line.colors, style: styles }[role];\n for (const prop of props) values[prop] = value;\n}\n\nfunction lineToken(\n reference: LineTemplate['references'][number],\n tokens: Readonly<Record<string, TokenValue>>,\n): TokenValue | typeof NOTHING | undefined {\n const set = firstSet([reference.reference, ...(reference.alternatives ?? [])], tokens);\n if (set) return set.keyword?.trim() === '' ? NOTHING : set;\n if (reference.empty) return NOTHING;\n const { fallback } = reference;\n return fallback && isDerived(fallback) ? derived(fallback, tokens) : fallback;\n}\n\n/** The role a token's form says it has, among those still open. */\nfunction lineRole(\n token: TokenValue,\n open: ReadonlySet<LineTemplate['roles'][number]>,\n): { role: LineTemplate['roles'][number]; value: unknown } | undefined {\n const word = token.keyword;\n const width = word && word in LINE_WIDTHS ? LINE_WIDTHS[word] : token.length;\n if (open.has('width') && (typeof width === 'number' || isDeferredLength(width))) {\n return { role: 'width', value: width };\n }\n if (open.has('style') && word && LINE_STYLES.has(word)) return { role: 'style', value: word };\n const color = isCurrentColour(token) ? 'currentcolor' : formOf(token, 'color');\n return open.has('color') && color !== undefined ? { role: 'color', value: color } : undefined;\n}\n\n/** A `calc()` of a token, which is a width, and no less than zero, as CSS clamps one. */\nfunction computedWidth(\n token: TokenValue,\n open: ReadonlySet<LineTemplate['roles'][number]>,\n adjust: NonNullable<DeferredDeclaration['adjust']>,\n): { role: 'width'; value: unknown } | undefined {\n // A bare number only when the calc() gives it its unit: `calc(var(--n) * 1px)`.\n const length = adjust.number ? token.number : token.length;\n if (!open.has('width') || (typeof length !== 'number' && !isDeferredLength(length))) {\n return undefined;\n }\n const value = adjusted(length, adjust);\n return { role: 'width', value: typeof value === 'number' ? Math.max(value, 0) : value };\n}\n\nconst isDeferredLength = (value: unknown): boolean =>\n typeof value === 'object' && value !== null && '__defer' in value;\n\nconst CHANNEL_KINDS: ReadonlySet<TokenKind> = new Set(['channels', 'hslChannels']);\n\n/** `hsl()` reads a channels token as hue, saturation and lightness; `rgb()` as sRGB. */\ntype ChannelSpace = 'rgb' | 'hsl';\n\n/**\n * `13, 110, 253` as the colour it is, at the alpha the token beside it says, if one does: the\n * channels form for `rgb()`, the hslChannels form for `hsl()`.\n */\nfunction fromChannels(\n value: unknown,\n alpha: DeferredDeclaration['alpha'],\n tokens: Readonly<Record<string, TokenValue>>,\n space?: ChannelSpace,\n): string | undefined {\n if (!Array.isArray(value) || value.length !== 3) return undefined;\n // An alpha naming a token nothing set, with no fallback, is no colour: CSS drops it.\n const opacity = alpha ? substitute(alpha, tokens, (token) => token.number) : 1;\n if (typeof opacity !== 'number') return undefined;\n if (space === 'hsl') return hslToRgb(value[0], value[1], value[2], opacity);\n const [r, g, b] = value as number[];\n return opacity >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${Math.round(opacity * 1000) / 1000})`;\n}\n\n/** One template, or a layered background of several: every layer painted, or, as CSS would, none. */\nfunction paintLayers(\n gradient: GradientTemplate | readonly GradientTemplate[],\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (!Array.isArray(gradient)) return paintGradient(gradient as GradientTemplate, tokens);\n const painted: unknown[] = [];\n for (const layer of gradient as readonly GradientTemplate[]) {\n const one = paintGradient(layer, tokens) as unknown[] | undefined;\n if (!one) return undefined;\n painted.push(...one);\n }\n return painted;\n}\n\n/**\n * A gradient template with its stops filled in from the cascade.\n *\n * A stop whose colour is not defined anywhere is dropped rather than painted transparent: that is\n * what makes an optional middle colour optional, and it is what a browser does with the same\n * stylesheet. Fewer than two colours is not a gradient, and paints nothing at all.\n */\nfunction paintGradient(\n template: GradientTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n const colorStops = paintedStops(template, tokens);\n if (!colorStops || colorStops.length < 2) return undefined;\n const position = template.position && placed(template.position, tokens);\n if (position === null) return undefined;\n return [{ ...template, colorStops, ...(position ? { position } : {}) }];\n}\n\n/**\n * A template's stops with their tokens read, leaving out any whose colour is not set. Undefined\n * when a stop's colour or position token is set but no such thing, which makes the gradient\n * invalid, as CSS substitutes a set token rather than falling back.\n */\nfunction paintedStops(\n template: GradientTemplate,\n tokens: Readonly<Record<string, TokenValue>>,\n): { color: string; position: string | number | null }[] | undefined {\n const colorStops = [];\n for (const stop of template.colorStops) {\n const token = stop.colour ? undefined : tokens[stop.reference!];\n const color = stop.colour ? resolveColour(stop.colour, tokens) : token?.color;\n // `none` is how the Tailwind flattening writes `via-none`: the stop left out, not invalid.\n if (color === undefined && token && token.keyword !== 'none') return undefined;\n if (color === undefined) continue;\n const position = stopPosition(stop, tokens);\n if (position === INVALID_POSITION) return undefined;\n // Written even when there is none: Fabric looks the key up before it looks at the value, and\n // silently skips a stop that has not got one.\n colorStops.push({ color, position: (position as string | number | undefined) ?? null });\n }\n return colorStops;\n}\n\nconst INVALID_POSITION = Symbol('invalid position');\n\n/** A stop's position: its token's when that is set, the one written otherwise. */\nfunction stopPosition(\n stop: GradientTemplate['colorStops'][number],\n tokens: Readonly<Record<string, TokenValue>>,\n): unknown {\n if (!stop.positionReference) return stop.position;\n const token = tokens[stop.positionReference];\n if (!token) return stop.position;\n return token.length ?? INVALID_POSITION;\n}\n\n/**\n * A radial gradient's centre with any token in it read, or null when a token it needs is not set\n * and has nothing written beside it: CSS would not paint the gradient then, and neither does this.\n */\nfunction placed(\n position: NonNullable<GradientTemplate['position']>,\n tokens: Readonly<Record<string, TokenValue>>,\n): Record<string, unknown> | null {\n const out: Record<string, unknown> = {};\n for (const [edge, offset] of Object.entries(position)) {\n if (offset === null || typeof offset !== 'object') {\n out[edge] = offset;\n continue;\n }\n const marker = offset as { reference: string; fallback?: string | number };\n const value = substitute(marker, tokens, (token) => token.length);\n if (value === undefined || typeof value === 'object') return null;\n out[edge] = value;\n }\n return out;\n}\n\n/**\n * A colour expression with its tokens looked up and any mix in it worked out. Undefined when a\n * token it needs is not defined anywhere and has nothing to fall back to.\n *\n * `current` is the node's colour, for a `currentColor` inside a mix or a relative colour. One that\n * is the whole expression is answered as `currentcolor`, for the caller to fill in.\n */\nfunction resolveColour(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): string | undefined {\n if ('color' in expression) return expression.color;\n if ('channels' in expression) return channelsColour(expression, tokens);\n if ('hsl' in expression) return resolveHsl(expression.hsl, tokens);\n if ('reference' in expression) return tokenColour(expression, tokens);\n if ('relative' in expression) {\n const { space, from, channels, alpha } = expression.relative;\n const origin = innerColour(from, tokens, current);\n return origin === undefined ? undefined : relativeColour(space, origin, channels, alpha);\n }\n const sides = mixSides(expression.mix, tokens, current);\n return sides && mixColours(expression.mix.space, ...sides, expression.mix.hue);\n}\n\n/** The colour of the node a value is settled for, worked out only when something asks. */\ntype CurrentColour = () => string;\n\n/** A colour inside another: `currentColor` there, written or in a token, is the node's colour. */\nfunction innerColour(\n expression: ColourExpression,\n tokens: Readonly<Record<string, TokenValue>>,\n current: CurrentColour | undefined,\n): string | undefined {\n if (!current) return resolveColour(expression, tokens);\n if ('reference' in expression) {\n const names = [expression.reference, ...(expression.alternatives ?? [])];\n if (isCurrentColour(firstSet(names, tokens))) return current();\n }\n const colour = resolveColour(expression, tokens, current);\n return colour?.toLowerCase() === 'currentcolor' ? current() : colour;\n}\n\ntype Mix = Extract<ColourExpression, { mix: unknown }>['mix'];\n\n/** A mix's two sides, a mix inside it unrounded, as CSS rounds only the colour at the end. */\nfunction mixSides(\n mix: Mix,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): [MixSide, MixSide] | undefined {\n const colour = (side: ColourExpression) =>\n 'mix' in side ? unroundedMix(side.mix, tokens, current) : innerColour(side, tokens, current);\n const first = colour(mix.a);\n const second = colour(mix.b);\n const shares = [mix.aPercentage, mix.bPercentage].map((share) => shareOf(share, tokens));\n // A share that is a token nothing sets: no mix, as CSS has no colour for one.\n if (first === undefined || second === undefined || shares.includes(null)) return undefined;\n return [\n { colour: first, percentage: shares[0] ?? undefined },\n { colour: second, percentage: shares[1] ?? undefined },\n ];\n}\n\nfunction unroundedMix(\n mix: Mix,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): Rgba | undefined {\n const sides = mixSides(mix, tokens, current);\n return sides && mixChannels(mix.space, ...sides, mix.hue);\n}\n\n/** A share as the percentage it comes to: undefined for none written, null for a token unset. */\nfunction shareOf(\n share: MixShare | undefined,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | null | undefined {\n if (share === undefined || typeof share === 'number') return share;\n const factor = tokens[share.reference]?.number ?? share.fallback;\n return factor === undefined ? null : factor * share.scale;\n}\n\n/** A length in a structured value that is a token, with the arithmetic around it. */\ninterface LengthMarker {\n readonly reference: string;\n readonly adjust?: DeferredDeclaration['adjust'];\n readonly fallback?: number;\n}\n\n/**\n * Arithmetic with tokens in it, as the compiler leaves it: numbers, token references and\n * `[op, a, b]`, in points, degrees or plain numbers as the slot it fills counts. A percentage\n * written where a number is wanted is its fraction, kept apart from a bare number so that what\n * the arithmetic makes is still a percentage (see `calcType`).\n */\ntype CalcExpression =\n | number\n | { readonly percentage: number }\n | { readonly reference: string; readonly fallback?: CalcExpression }\n | readonly ['+' | '-' | '*' | '/' | 'max' | 'min', CalcExpression, CalcExpression];\n\n/** A calc() tree's leaf that is not a bare number. */\ntype CalcLeaf = Exclude<CalcExpression, number | readonly unknown[]>;\n\ninterface CalcMarker {\n readonly expression: CalcExpression;\n readonly kind: 'length' | 'angle' | 'time' | 'number';\n}\n\n/** A calc marker worked out, as its slot takes it; undefined when a token in it is not set. */\nfunction resolveCalc(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | string | undefined {\n const percentage = wholePercentage(marker, tokens);\n if (percentage !== undefined) return percentage;\n if (bareNumberAsLength(marker, tokens) || notAnAngle(marker, tokens)) return undefined;\n // A percentage and a number added together, `calc(var(--n) + 10%)`, are neither, and invalid.\n if (marker.kind === 'number' && calcType(marker.expression, tokens) === undefined)\n return undefined;\n const value = calculated(marker.expression, marker.kind, tokens);\n if (value === undefined || !Number.isFinite(value)) return undefined;\n const rounded = Math.round(value * 1000) / 1000;\n return marker.kind === 'angle' ? `${rounded}deg` : rounded;\n}\n\n/**\n * Whether a length is one token holding a bare number other than 0: `--tw-translate-x: 3`, from\n * `translate-x-[3]`, which a browser drops. Inside arithmetic a bare number is a factor, and fine.\n */\nfunction bareNumberAsLength(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): boolean {\n if (marker.kind !== 'length' || typeof marker.expression !== 'object') return false;\n if (Array.isArray(marker.expression)) return false;\n const token = tokens[(marker.expression as { reference: string }).reference];\n return (\n token !== undefined &&\n token.length === undefined &&\n token.number !== undefined &&\n token.number !== 0\n );\n}\n\n/**\n * Whether an angle is one token that holds no angle: `--tw-rotate: 3` or `37%`, from\n * `rotate-[3]`, which a browser drops, taking the whole transform with it. A bare 0 is an angle;\n * `0%` is not.\n */\nfunction notAnAngle(marker: CalcMarker, tokens: Readonly<Record<string, TokenValue>>): boolean {\n if (marker.kind !== 'angle' || typeof marker.expression !== 'object') return false;\n if (Array.isArray(marker.expression)) return false;\n const token = tokens[(marker.expression as { reference: string }).reference];\n if (token === undefined || token.angle !== undefined) return false;\n // `0%` has a number 0 as well, and is still a percentage, which no angle is.\n return token.number !== 0 || typeof token.length === 'string';\n}\n\n/**\n * A length that is one token holding a percentage, `translate-x-1/2`'s 50%, passed on as it is:\n * a share of a box nobody has laid out yet can be used, but not added to or scaled here.\n */\nfunction wholePercentage(\n marker: CalcMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n if (marker.kind !== 'length' || typeof marker.expression !== 'object') return undefined;\n if (Array.isArray(marker.expression)) return undefined;\n const leaf = marker.expression as { reference: string };\n const value = formOf(tokens[leaf.reference], 'length');\n // And one holding a percentage with a length added, which the engine finishes: `calc(100% + -2px)`.\n const whole = typeof value === 'string' && (value.endsWith('%') || value.startsWith('calc('));\n return whole ? (value as string) : undefined;\n}\n\nfunction calculated(\n expression: CalcExpression,\n kind: CalcMarker['kind'],\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n if (typeof expression === 'number') return expression;\n if (!Array.isArray(expression)) return leafValue(expression as CalcLeaf, kind, tokens);\n const [op, a, b] = expression as readonly [string, CalcExpression, CalcExpression];\n const left = calculated(a, kind, tokens);\n const right = calculated(b, kind, tokens);\n if (left === undefined || right === undefined) return undefined;\n if (op === '+') return left + right;\n if (op === '-') return left - right;\n if (op === '*') return left * right;\n if (op === 'max') return Math.max(left, right);\n if (op === 'min') return Math.min(left, right);\n return left / right;\n}\n\n/** A written percentage, or a token, as `calculated` reads it: its fallback when it is unset. */\nfunction leafValue(\n leaf: CalcLeaf,\n kind: CalcMarker['kind'],\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n if ('percentage' in leaf) return leaf.percentage;\n const token = tokens[leaf.reference];\n if (token) return tokenNumber(token, kind);\n return leaf.fallback === undefined ? undefined : calculated(leaf.fallback, kind, tokens);\n}\n\n/** Where each kind of slot reads a token from, before its bare number. */\nconst FORM_OF_KIND: Record<\n Exclude<CalcMarker['kind'], 'number'>,\n (token: TokenValue) => unknown\n> = {\n length: (token) => token.length,\n angle: (token) => token.angle,\n time: (token) => token.time,\n};\n\n/**\n * A token as a number in a slot of this kind: its length in points or its angle in degrees, or\n * a bare number, which multiplies (`calc(var(--n) * 1px)`). A length that is not points, a\n * percentage, is not one, and is not read as the bare number it also is.\n */\nfunction tokenNumber(token: TokenValue | undefined, kind: CalcMarker['kind']): number | undefined {\n if (!token) return undefined;\n const own = kind === 'number' ? undefined : FORM_OF_KIND[kind](token);\n if (own !== undefined) return typeof own === 'number' ? own : undefined;\n // An angle is a number of degrees to a hue, and neither a length nor a factor: `30deg` as a\n // translate moved a box thirty points, and as a scale made it thirty times the size, where a\n // browser drops the declaration.\n if (token.angle !== undefined) return undefined;\n return token.number;\n}\n\n/** A whole shadow, filter or transform token in a list, and the entries to use when it is unset. */\ninterface ShadowsMarker {\n readonly reference: string;\n readonly fallback?: readonly unknown[];\n}\n\n/** What a token set in a slot stands for: its entries, or none for one set to nothing, `--tw-blur: ;`. */\nfunction slotEntries(token: TokenValue, kind: TokenKind): unknown {\n return formOf(token, kind) ?? (token.keyword?.trim() === '' ? [] : undefined);\n}\n\n/** The slot a list entry can be instead of an entry: one per list property that has them. */\nconst SLOT_KINDS = {\n __shadows: 'shadow',\n __filters: 'filter',\n __transforms: 'transform',\n __variants: 'fontVariant',\n} as const satisfies Record<string, TokenKind>;\n\nconst SLOT_ENTRIES = Object.entries(SLOT_KINDS);\n\n/** The slot a list entry is, and the form of token that fills it; undefined for an entry. */\nfunction slotOf(part: unknown): { marker: ShadowsMarker; kind: TokenKind } | undefined {\n if (part === null || typeof part !== 'object') return undefined;\n for (const [key, kind] of SLOT_ENTRIES) {\n const marker = (part as Record<string, ShadowsMarker | undefined>)[key];\n if (marker) return { marker, kind };\n }\n return undefined;\n}\n\nfunction resolveLength(\n marker: LengthMarker,\n tokens: Readonly<Record<string, TokenValue>>,\n): number | undefined {\n // A number when the arithmetic gives it its unit, as `referenced` reads one.\n const form = marker.adjust?.number ? 'number' : 'length';\n const value = substitute(marker, tokens, (token) => formOf(token, form));\n if (typeof value !== 'number') return undefined;\n return marker.adjust ? (adjusted(value, marker.adjust) as number) : value;\n}\n\n/** A colour at no opacity at all. */\nfunction invisible(colour: unknown): boolean {\n if (colour === 'transparent') return true;\n const parts = typeof colour === 'string' ? RGB.exec(colour) : null;\n return parts?.[4] !== undefined && Number(parts[4]) === 0;\n}\n\n/**\n * Whether a compiled value has something in it to settle: a marker, slot or deferred length at\n * any depth. One with none is used as it is. Asked of values from the sheet, which never change,\n * so the answer is kept: Tailwind's reset fills three of a shadow's five slots with one on every\n * node.\n */\nfunction needsFilling(value: unknown): value is object {\n if (value === null || typeof value !== 'object') return false;\n let answer = NEEDS_FILLING.get(value);\n if (answer === undefined) {\n answer = Object.entries(value).some(\n ([key, part]) => key.startsWith('__') || needsFilling(part),\n );\n NEEDS_FILLING.set(value, answer);\n }\n return answer;\n}\nconst NEEDS_FILLING = new WeakMap<object, boolean>();\n\n/** What `settledMarker` says of a part that is not a token's marker at all. */\nconst NOT_A_MARKER = Symbol('not a marker');\n\n/** A colour, length or calc marker settled from the tokens, or undefined when one cannot be. */\nfunction settledMarker(\n value: object,\n tokens: Readonly<Record<string, TokenValue>>,\n current?: CurrentColour,\n): unknown {\n const colour = colourMarker(value);\n if (colour) return resolveColour(colour, tokens, current);\n // Whether a shadow is inset, from a token that is the word or nothing: `ring-inset`.\n const inset = (value as { __inset?: { reference: string } }).__inset;\n if (inset) return formOf(tokens[inset.reference], 'keyword') === 'inset';\n const token = (value as { __length?: LengthMarker }).__length;\n if (token) return resolveLength(token, tokens);\n const sum = (value as { __calc?: CalcMarker }).__calc;\n if (sum) return resolveCalc(sum, tokens);\n const shadow = (value as { __dropShadow?: { reference: string } }).__dropShadow;\n if (shadow) return dropShadowOf(tokens[shadow.reference]?.shadow);\n return NOT_A_MARKER;\n}\n\n/**\n * A shadow token as the drop shadow a filter draws: `drop-shadow(var(--drop-shadow-xs))`. One\n * shadow, never inset and with no spread, which is all a drop shadow can be; nothing otherwise.\n */\nfunction dropShadowOf(shadow: unknown): unknown {\n if (!Array.isArray(shadow) || shadow.length !== 1) return undefined;\n const [{ offsetX, offsetY, blurRadius, spreadDistance, color, inset }] = shadow as {\n offsetX: number;\n offsetY: number;\n blurRadius: number;\n spreadDistance: number;\n color: unknown;\n inset: boolean;\n }[];\n if (spreadDistance !== 0 || inset || typeof color !== 'string') return undefined;\n return { offsetX, offsetY, standardDeviation: blurRadius, color };\n}\n\n/** What a colour that cannot be settled makes of the whole value it is in. */\nconst UNSETTLED = Symbol('unsettled');\n\n/** `rgba(var(--channels), <alpha>)`: the token's channels, at the alpha written or tokened. */\nfunction channelsColour(\n expression: Extract<ColourExpression, { channels: unknown }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n const { space } = expression.channels;\n const kind = space === 'hsl' ? 'hslChannels' : 'channels';\n const value = substitute(expression.channels, tokens, (token) => formOf(token, kind));\n const { alpha } = expression;\n if (typeof alpha !== 'number') return fromChannels(value, alpha, tokens, space);\n const opaque = fromChannels(value, undefined, tokens, space);\n return opaque === undefined ? undefined : (faded(opaque, alpha) as string);\n}\n\n/** A token's colour, or the first of its alternatives that is defined, or its fallback. */\nfunction tokenColour(\n expression: Extract<ColourExpression, { reference: string }>,\n tokens: Readonly<Record<string, TokenValue>>,\n): string | undefined {\n // The first token set is substituted, whatever it holds, as `referenced` reads one.\n const set = firstSet([expression.reference, ...(expression.alternatives ?? [])], tokens);\n if (expression.orInset) return insetOrColour(set);\n if (set) return formOf(set, 'color') as string | undefined;\n const token = expression.fallbackToken;\n return expression.fallback ?? (token && (formOf(derived(token, tokens), 'color') as string));\n}\n\n/**\n * A shadow's colour from a token that is the colour or the word `inset`: currentcolor, which the\n * node fills in, when it is `inset` or unset, and nothing, so no shadow, when it is anything else.\n */\nfunction insetOrColour(token: TokenValue | undefined): string | undefined {\n if (!token || token.keyword === 'inset') return 'currentcolor';\n return formOf(token, 'color') as string | undefined;\n}\n\n/** A marker the compiler leaves in a structured value for a colour only the device can settle. */\nfunction colourMarker(value: unknown): ColourExpression | undefined {\n return (value as { __colour?: ColourExpression } | null)?.__colour;\n}\n\n/**\n * A token added to a percentage, `calc(100% - var(--handle))`: a length in points or a share of\n * the same box adds up to one value. A length of the box's own font does not, here, so the box is\n * given none rather than one that is not what the rule says.\n */\nfunction withPercent(value: unknown, adjust: NonNullable<DeferredDeclaration['adjust']>): unknown {\n const percent = adjust.percent!;\n if (typeof value === 'string' && value.endsWith('%')) {\n const share = percent + Number.parseFloat(value) * (adjust.scale ?? 1);\n const offset = adjust.offset ?? 0;\n return offset === 0 ? `${share}%` : `calc(${share}% + ${offset}px)`;\n }\n // A length of its own font, deferred, is no number here.\n if (typeof value !== 'number') return undefined;\n const scaled = value * (adjust.scale ?? 1) + (adjust.offset ?? 0);\n // With nothing to add, the percentage alone, which needs no second pass.\n return scaled === 0 ? `${percent}%` : `calc(${percent}% + ${scaled}px)`;\n}\n\n/**\n * A resolved length, moved by the arithmetic that surrounded its `var()`.\n *\n * A non-numeric value is left alone rather than coerced: the token was a keyword or a percentage\n * the app meant, and turning it into NaN would be a silent layout rather than a visible one.\n */\nfunction adjusted(value: unknown, adjust: NonNullable<DeferredDeclaration['adjust']>): unknown {\n if (adjust.alpha !== undefined) return faded(value, adjust.alpha);\n const em = (value as { __defer?: DeferredEm } | null)?.__defer;\n if (adjust.percent !== undefined) return withPercent(value, adjust);\n if (em && adjust.floor === undefined) return adjustedEm(em, adjust);\n if (typeof value !== 'number') return value;\n const scaled = value * (adjust.scale ?? 1) + (adjust.offset ?? 0);\n return adjust.floor === undefined ? scaled : Math.max(scaled, adjust.floor);\n}\n\ninterface DeferredEm {\n readonly unit: string;\n readonly factor: number;\n readonly offset?: number;\n}\n\n/** A length in em, worked out against the font size later, with the arithmetic moved inside it. */\nfunction adjustedEm(\n em: DeferredEm,\n adjust: NonNullable<DeferredDeclaration['adjust']>,\n): { __defer: DeferredEm } {\n const scale = adjust.scale ?? 1;\n const offset = (em.offset ?? 0) * scale + (adjust.offset ?? 0);\n return { __defer: { ...em, factor: em.factor * scale, ...(offset ? { offset } : {}) } };\n}\n\n/** `rgb(r, g, b)` and `rgba(r, g, b, a)`, which is every colour the compiler emits. */\nconst RGB = /^rgba?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*(?:,\\s*([\\d.]+)\\s*)?\\)$/;\n\n/**\n * A colour at a fraction of its opacity.\n *\n * Multiplied rather than replaced, so a token that was already translucent stays relatively so -\n * `rgba(0, 0, 0, 0.5)` faded to 90% is 45% opaque, which is what a browser computes for the same\n * mix. A value that is not one of ours is returned untouched: it may be a platform colour, and a\n * colour nobody can parse is better painted as it stands than dropped.\n */\nexport function faded(value: unknown, fraction: number): unknown {\n if (typeof value !== 'string') return value;\n const parts = RGB.exec(value);\n if (!parts) return value;\n const alpha = (parts[4] === undefined ? 1 : Number(parts[4])) * fraction;\n return `rgba(${parts[1]}, ${parts[2]}, ${parts[3]}, ${Math.round(alpha * 1000) / 1000})`;\n}\n\n/**\n * Where a component's compiled sheet lives: a static on the component class, written by the\n * Metro transformer at build time.\n *\n * `RendererFactory2.createRenderer(host, type)` receives the component definition, and a\n * definition references its class, so a renderer can find its own sheet with no registry and no\n * generated id. That is also how encapsulation is scoped for free: a component's renderer only\n * ever matches that component's rules, so its elements cannot be styled by anyone else's CSS.\n */\nexport const NATIVE_STYLES = 'ɵnativeStyles';\n\nexport function styleSheetOf(type: unknown): StyleSheet | null {\n const sheet = (type as Record<string, unknown> | null)?.[NATIVE_STYLES];\n return (sheet as StyleSheet | undefined) ?? null;\n}\n"]}