@verajs/renderer 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +711 -225
- package/dist/development/vera-renderer-elements.d.ts +39 -0
- package/dist/development/vera-renderer-elements.d.ts.map +1 -0
- package/dist/development/vera-renderer-elements.js +193 -0
- package/dist/development/vera-renderer-elements.js.map +1 -0
- package/dist/development/vera-renderer-hydrate-slots.d.ts +94 -0
- package/dist/development/vera-renderer-hydrate-slots.d.ts.map +1 -0
- package/dist/development/vera-renderer-hydrate-slots.js +325 -0
- package/dist/development/vera-renderer-hydrate-slots.js.map +1 -0
- package/dist/development/vera-renderer-hydration.d.ts +332 -0
- package/dist/development/vera-renderer-hydration.d.ts.map +1 -0
- package/dist/development/vera-renderer-hydration.js +864 -0
- package/dist/development/vera-renderer-hydration.js.map +1 -0
- package/dist/development/vera-renderer-keyed.d.ts +25 -8
- package/dist/development/vera-renderer-keyed.d.ts.map +1 -1
- package/dist/development/vera-renderer-keyed.js +843 -268
- package/dist/development/vera-renderer-keyed.js.map +1 -1
- package/dist/development/vera-renderer-multi-window.d.ts +5 -0
- package/dist/development/vera-renderer-multi-window.d.ts.map +1 -0
- package/dist/development/vera-renderer-multi-window.js +40 -0
- package/dist/development/vera-renderer-multi-window.js.map +1 -0
- package/dist/development/vera-renderer-namespaces.d.ts +64 -0
- package/dist/development/vera-renderer-namespaces.d.ts.map +1 -0
- package/dist/development/vera-renderer-namespaces.js +94 -0
- package/dist/development/vera-renderer-namespaces.js.map +1 -0
- package/dist/development/vera-renderer-native-elements.d.ts +13 -0
- package/dist/development/vera-renderer-native-elements.d.ts.map +1 -0
- package/dist/development/vera-renderer-native-elements.js +231 -0
- package/dist/development/vera-renderer-native-elements.js.map +1 -0
- package/dist/development/vera-renderer-portal.d.ts +29 -0
- package/dist/development/vera-renderer-portal.d.ts.map +1 -0
- package/dist/development/vera-renderer-portal.js +167 -0
- package/dist/development/vera-renderer-portal.js.map +1 -0
- package/dist/development/vera-renderer-profiler.d.ts +48 -96
- package/dist/development/vera-renderer-profiler.d.ts.map +1 -1
- package/dist/development/vera-renderer-profiler.js +2423 -2140
- package/dist/development/vera-renderer-profiler.js.map +1 -1
- package/dist/development/vera-renderer-slots.d.ts +88 -92
- package/dist/development/vera-renderer-slots.d.ts.map +1 -1
- package/dist/development/vera-renderer-slots.js +1834 -1237
- package/dist/development/vera-renderer-slots.js.map +1 -1
- package/dist/development/vera-renderer-spread.d.ts +7 -41
- package/dist/development/vera-renderer-spread.d.ts.map +1 -1
- package/dist/development/vera-renderer-spread.js +539 -477
- package/dist/development/vera-renderer-spread.js.map +1 -1
- package/dist/development/vera-renderer-tag.d.ts +12 -3
- package/dist/development/vera-renderer-tag.d.ts.map +1 -1
- package/dist/development/vera-renderer-tag.js +671 -513
- package/dist/development/vera-renderer-tag.js.map +1 -1
- package/dist/development/vera-renderer-until.d.ts +24 -0
- package/dist/development/vera-renderer-until.d.ts.map +1 -0
- package/dist/development/vera-renderer-until.js +83 -0
- package/dist/development/vera-renderer-until.js.map +1 -0
- package/dist/development/vera-renderer.d.ts +48 -96
- package/dist/development/vera-renderer.d.ts.map +1 -1
- package/dist/development/vera-renderer.js +2400 -2104
- package/dist/development/vera-renderer.js.map +1 -1
- package/dist/vera-renderer-elements.min.js +2 -0
- package/dist/vera-renderer-elements.min.js.map +1 -0
- package/dist/vera-renderer-hydrate-slots.min.js +2 -0
- package/dist/vera-renderer-hydrate-slots.min.js.map +1 -0
- package/dist/vera-renderer-hydration.min.js +3 -0
- package/dist/vera-renderer-hydration.min.js.map +1 -0
- package/dist/vera-renderer-keyed.min.js +1 -1
- package/dist/vera-renderer-keyed.min.js.map +1 -1
- package/dist/vera-renderer-multi-window.min.js +2 -0
- package/dist/vera-renderer-multi-window.min.js.map +1 -0
- package/dist/vera-renderer-namespaces.min.js +2 -0
- package/dist/vera-renderer-namespaces.min.js.map +1 -0
- package/dist/vera-renderer-native-elements.min.js +2 -0
- package/dist/vera-renderer-native-elements.min.js.map +1 -0
- package/dist/vera-renderer-portal.min.js +2 -0
- package/dist/vera-renderer-portal.min.js.map +1 -0
- package/dist/vera-renderer-slots.min.js +1 -1
- package/dist/vera-renderer-slots.min.js.map +1 -1
- package/dist/vera-renderer-spread.min.js +1 -1
- package/dist/vera-renderer-spread.min.js.map +1 -1
- package/dist/vera-renderer-tag.min.js +1 -1
- package/dist/vera-renderer-tag.min.js.map +1 -1
- package/dist/vera-renderer-until.min.js +2 -0
- package/dist/vera-renderer-until.min.js.map +1 -0
- package/dist/vera-renderer.min.js +1 -1
- package/dist/vera-renderer.min.js.map +1 -1
- package/package.json +52 -9
- package/dist/development/vera-renderer-hydrate.d.ts +0 -147
- package/dist/development/vera-renderer-hydrate.d.ts.map +0 -1
- package/dist/development/vera-renderer-hydrate.js +0 -3136
- package/dist/development/vera-renderer-hydrate.js.map +0 -1
- package/dist/vera-renderer-hydrate.min.js +0 -2
- package/dist/vera-renderer-hydrate.min.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vera-renderer-slots.js","sources":["../../src/slots.ts"],"sourcesContent":["/**\n * Light-DOM slots — the `'slot'` insert the renderer's seam consults. Wire it beside the renderer\n * and every light-rendered template's `<slot name=\"…\">` distributes the host's own children,\n * exactly as shadow DOM would have:\n *\n * ```js\n * import { renderer } from '@verajs/renderer';\n * import { slots } from '@verajs/renderer/slots';\n * wire([renderer, slots]);\n * ```\n *\n * ```html\n * <my-card><h2 slot=\"header\">Hello</h2>Body text</my-card>\n * ```\n *\n * **Additive entry** (the `keyed`/`spread` family): imports nothing, reaches the renderer only\n * through the wired seam, safe alongside any renderer entry on a CDN page.\n *\n * **Wire it at the app entry, before anything renders.** The renderer resolves this seam once per\n * TEMPLATE, and templates are cached per call site for the life of the page — so a component that\n * rendered before the wiring keeps a slotless template forever. That is the same contract every\n * insert carries; the alternative (re-checking the registry per instance) would put a lookup on\n * the hot path of every app, slots or not.\n *\n * The semantics contract is the platform's own assignment algorithm: elements go to the slot\n * their `slot` attribute names, text nodes (whitespace included) to the default slot, comments\n * are never slottables (which also keeps the renderer's root marker out of capture), duplicate\n * slot names — first in mount order wins and later ones show fallback, fallback renders only\n * while nothing is assigned and comes back when a slot empties, and capture takes the host's\n * DIRECT children only, so nested components compose.\n *\n * **Post-render additions are NATIVE, and the mechanism is ownership, not position.** The host's\n * childList holds both the user's content and the component's output, and the old rules told them\n * apart by where a node sat — which made bare text unreachable at the tail and a late insertion\n * join its slot out of order. Now the renderer stamps everything it emits at a captured host's\n * top level (a non-enumerable `_$own$` property: `true` for a root part's own output — the\n * structural `_end === null` test, so async commits are covered — and the placing part for\n * content from an outer template). An unstamped top-level addition is therefore knowably the\n * user's: captured with full native semantics, text included, no `slot` attribute required\n * (`slot=\"\"`/`slot=\"name\"` still route). Ordering reads the same fact — placed content extends\n * its part's own group; an unstamped node before the boundary takes its document position ahead\n * of content distributed away, and past it, appends. **Re-slotting keeps that answer**: a node\n * whose `slot` attribute changes has not moved in the light tree, so it rejoins by a rank taken\n * when it was first captured rather than by arrival — otherwise an item toggled into a \"pinned\"\n * slot jumped to the end of the pinned list instead of holding its place.\n *\n * **What remains is reach, not order** — the earlier note here said hand-edits among several\n * `${…}` parts' content ordered \"approximately\", which measurement does not support: every\n * position a user can actually reach orders exactly as the platform does, and every order light\n * produces is one a shadow root also produces. What light has FEWER of is positions. A distributed\n * child is no longer a direct child of the host, so `host.insertBefore(node, thatChild)` throws\n * `NotFoundError` where a shadow host accepts it, and positions among an already-distributed\n * group cannot be named at the host's top level at all. `child.before(node)` / `child.after(node)`\n * go through the node's current parent and work identically in both modes; that is what the README\n * teaches, and `tests/renderer-slots.test.mjs` pins both the throw and the answer. And one parity note: whitespace appended to a\n * light host now suppresses the default fallback, because it does exactly that in a shadow root\n * (measured). `tests/slots-transition-parity.test.mjs` holds the matrix.\n *\n * **A `<slot>` cannot sit inside table markup**, in either mode: the parser's table insertion mode\n * rejects the element and foster-parents it out, so the slot lands before the `<table>` and takes\n * its distributed content with it. Measured against a shadow root given the same markup — it does\n * the same thing, so the modes agree and this is the platform's rule rather than this module's.\n * Ordinary bindings are fine (`<tbody>${rows}</tbody>` renders correctly) because the renderer's\n * anchor is a COMMENT, which table parsing permits where it rejects elements.\n *\n * **Pop-out rule.** Every *document* touch derives from the node itself (`ownerDocument`), so a\n * component rendered into a second window creates its nodes in that window's document.\n *\n * The one global read is `MutationObserver`, deliberately: an observer is not bound to the realm\n * of the nodes it watches, so deriving the constructor from `ownerDocument.defaultView` would buy\n * nothing and cost bytes on every capture. **Measured, not assumed** — `tests/browser/\n * slots-realm.test.js` renders a host in a second same-origin document and asserts that live\n * additions, `slot` changes and removals all reach their slots, on Chromium, Firefox and WebKit.\n * Behaviour the platform decides is not settled under jsdom.\n */\n\n/** What the seam holds per taken-over slot; `_$park$` rescues the user's nodes before the\n * instance's DOM is bulk-discarded on a branch-away, and un-registers the binding. */\ntype SeamState = { _$park$: () => void };\n\ntype Binding = {\n _start: Comment;\n _end: Comment;\n /** Read from `_slot` at mount and kept in step with it, so `<slot name=${…}>` works. */\n _name: string;\n /**\n * **The displaced region, parked in a fragment — empty whenever the region is on screen.**\n *\n * It began as an array of the slot's template children, detached one by one. That is a snapshot,\n * and the region it stands for is not static: a slot NESTED in this fallback keeps distributing\n * while displaced, so the array recorded a state that had moved on. Two failures came out of it,\n * one of them content loss — see `fill`.\n *\n * A fragment is the same idea without the snapshot. Displacing appends the region into it and\n * restoring inserts it back in one call, so anything that happened inside while it was away\n * comes back too, in place, with no list to keep in step. It also keeps every anchor PARENTED\n * while displaced, which is what lets a nested binding go on working instead of tripping `fill`'s\n * discarded-anchors guard.\n */\n _fallback: DocumentFragment;\n _assigned: boolean;\n /**\n * **The `<slot>` element itself, kept out of the document but alive as the component's API\n * object.** It is already what the template's own bindings attached to — `@slotchange`, `&ref`,\n * `name=${…}` all commit onto this element — so keeping it costs nothing and makes those\n * bindings mean what they mean in a shadow root: events dispatch on it, `&ref` hands it over,\n * and `assignedNodes()`/`assignedElements()` answer from the live assignment.\n */\n _slot?: Element;\n /** What this binding last SHOWED, so `slotchange` fires on change like the platform's does and\n * not on every fill. */\n _shown: Node[];\n _queued: boolean;\n};\n\ntype HostState = {\n /** The host this state belongs to — `flushPending` hands it to the record handler. */\n _host: Element;\n /** True while `flushPending` is processing, so the fills it causes do not recurse into it. */\n _flushing: boolean;\n /** Assignment by slot name ('' is the default slot). Arrays are the live membership. */\n _map: Map<string, Node[]>;\n /**\n * Every mounted binding, in MOUNT order — which is tree order, so the first one carrying a name\n * is the one that receives it, exactly as the platform picks the first matching slot.\n *\n * A flat list rather than a map keyed by name, because a slot's name is not fixed:\n * `<slot name=${section}>` can change between renders, and a keyed map would have to be re-keyed\n * on every such change. Finding the active one is then a scan, which is fine because bindings per\n * host are a handful — a rich component has three or four.\n *\n * **Measured rather than assumed**, since a scan invites the question: against the map-keyed\n * version, at 10, 50 and even an absurd 200 slots on one host, mount was within noise, and live\n * mutations and `slotted()` reads are FLAT in the number of slots (re-verified 2026-09-05:\n * re-slot cost moves ~3% from 10 to 200 slots; reads sub-microsecond throughout).\n *\n * Mount is mildly superlinear and it belongs to the DOM work, not to this — a sentence that has\n * now been checked the hard way. Re-measured under jsdom after the fragment/rank work, mount\n * looked QUADRATIC (400/100 ratio ~14) and three times its old absolute, which reads as an\n * algorithmic regression in this file. Chromium, same probe, same build: 0.8/1.8/3.2/7.6 ms at\n * 50/100/200/400 slots — ratio 4.2, mildly superlinear, fifty times faster than jsdom at the top\n * end. The scare was jsdom-as-oracle, the exact mistake this project's rules exist to prevent,\n * aimed for once at this very comment. Benchmark this module on an engine or not at all.\n */\n _bindings: Binding[];\n /** Captured nodes that are not currently displayed wait here — out of the document, exactly\n * like an unassigned light child under native shadow DOM (present, not rendered). */\n _holding: DocumentFragment;\n /**\n * Every `_fallback` park fragment on this host, so `fill` can tell one of OUR resting places\n * from a tree the user has taken a node into.\n *\n * A set rather than a check against the binding being filled, because the two need not be the\n * same binding: a node placed by a slot nested in another slot's fallback rests in the OUTER\n * binding's fragment, and at three levels of nesting it rests in one belonging to neither. The\n * per-binding comparison happens to be right at depth two and silently wrong below it, which is\n * the kind of correct-looking check this file has been bitten by before.\n */\n _parks: WeakSet<Node>;\n /** node → its current slot name, for every node ever captured: the identity test that lets\n * the observer spot USER removals and re-slottings amid the template's own mutations. */\n _names: WeakMap<Node, string>;\n /** Each kept `<slot>` element back to its binding, so a `name` change is recognised. */\n _ghosts: WeakMap<Element, Binding>;\n /**\n * **Light-tree order, remembered — because distributing a node destroys it.**\n *\n * Native `assignedNodes()` answers in flat-tree order, which for a light child is simply its\n * position among the host's children. A shadow host keeps every child where it was, so that\n * position is always readable. Here the children are MOVED — into a slot's region, or out to\n * the holding fragment when nothing claims them — and once two captured nodes live in different\n * places, nothing in the DOM says which came first.\n *\n * That is invisible while a node stays in one bucket, because the bucket was built in order. It\n * surfaces when a node CHANGES slot: it joins a bucket that may already hold nodes which come\n * after it in the light tree, and the only honest answer is a position the DOM no longer knows.\n * Appending was the old answer and it read as arrival order — an item toggled into a \"pinned\"\n * slot jumped to the end of the pinned list instead of holding its place.\n *\n * A rank per node is the whole mechanism: assigned once, when the node is first captured, and\n * never touched again — because re-slotting does not move a node in the LIGHT tree, which is the\n * tree this orders. Ranks are compared, never trusted as indices, so gaps from removals are\n * harmless.\n */\n _rank: WeakMap<Node, number>;\n _next: number;\n /** Ranks below every existing one, for a node inserted into the light region ahead of content\n * already distributed away — see `take`. Counts down; the two never meet in any real host. */\n _min: number;\n /** The host window's `Event` — see `signal` for why it cannot be taken from the slot. */\n _event: typeof Event;\n _observer: MutationObserver;\n /**\n * **The boundary between the host's LIGHT REGION and the component's own render.** One comment,\n * appended at capture time — after the children are lifted, before the component's first render\n * appends its output — so everything that ever sits before it at the host's top level is host\n * content, and everything after is the component's. Two things stand on it:\n *\n * 1. The observer captures a top-level addition BEFORE the sentinel with full native semantics —\n * no `slot` attribute required, text included. The attribute rule was written for USER\n * mutations, whose ambiguity is real only at the host's tail; it was also catching the\n * RENDERER's own re-renders of `<host>${…}</host>`, whose new nodes always land in the light\n * region, and stranding them invisibly (measured: every `→ null → back` transition, every\n * template swap, every list refill in a light host showed FALLBACK or stale content forever,\n * while shadow passed all of them). That divergence is since gone entirely — ownership\n * stamps replaced the region heuristic, and post-render additions are native.\n * 2. `_$home$` hands it to the renderer, so a text part that upgrades AFTER its text node was\n * captured plants its markers here — in the host — instead of chasing the node into the\n * slot, where the next fill swept markers and all into the holding fragment and the part\n * spent the rest of the page rendering into detached space.\n */\n _sentinel: Comment;\n};\n\nconst HOSTS = new WeakMap<Element, HostState>();\n/** The host mark's shared descriptor — non-enumerable, for the same invisibility the stamps get. */\nconst HOSTED: PropertyDescriptor = { value: true, enumerable: false, configurable: true };\n/** Every captured node → its host's sentinel, for `_$home$`. Entries die with their nodes. */\nconst HOMES = new WeakMap<Node, Comment>();\n/**\n * **The light tree's surviving skeleton, indexed.** Distribution moves the CONTENT out of the\n * host, but the part markers never move — so a comment's neighbours at capture time are exactly\n * the positional record a late hand-edit needs. Each comment in the initial walk maps to the\n * member captured immediately after it; placement walks forward from an inserted node to the\n * first recorded comment whose member is still in the right bucket, and goes before that member.\n * A WeakMap and a walk over LIVE nodes only, so a torn-down part's markers take their entries\n * with them and staleness needs no bookkeeping. (Verified before building: a part keeps the SAME\n * marker nodes across template-identity rebuilds, emptying included, so landmarks cannot churn.)\n */\nconst LANDMARKS = new WeakMap<Node, Node>();\n\n/**\n * What the observer watches, wherever it watches. Hoisted because captured nodes rest in more than\n * one place and every one of them needs the SAME watch — see the `observe` calls in `capture` and\n * the park fragment in `takeOverSlot`.\n */\nconst WATCHING = { childList: true, subtree: true, attributes: true, attributeFilter: ['slot'] };\n\n/**\n * Slottables are elements and text nodes — comments and the rest are never assigned (`null`).\n *\n * **A deliberate twin of `slotNameOf` in `@verajs/ssr`'s `vera/nodes.js`**, which must spell the\n * same rule: independent packages, ssr does not import this one at runtime, so the rule is copied\n * rather than shared. A deliberate duplication is a fix's second address — change one and the\n * other needs the same change. `tests/ssr-slot-assignment-parity.test.mjs` fails if they diverge.\n *\n * `null` here means \"not slottable\", and callers must decide what that implies for THEM: the read\n * path filters those nodes out of `assignedNodes()`, while `serverDistribute` skips them, which\n * leaves them where they are on the client and drops them on a server that has already re-rendered\n * the host. Two different consequences from one answer — see `serverDistribute`.\n */\nconst slotNameOf = (node: Node): string | null =>\n node.nodeType === 3 ? '' : node.nodeType === 1 ? ((node as Element).getAttribute('slot') ?? '') : null;\n\nconst bucketOf = (state: HostState, name: string): Node[] => {\n let bucket = state._map.get(name);\n if (bucket === undefined) state._map.set(name, (bucket = []));\n return bucket;\n};\n\n/** Take one node into the slot system: bucket it, remember it, and physically hold it. */\n/** `ordered`: the caller vouches the node arrives in its final relative order (the initial\n * capture walk and the server-park recovery — both iterate host order), so placement is a plain\n * append: O(1), and immune to the fact that earlier-taken siblings are already in holding and\n * can no longer be position-compared. */\nconst take = (state: HostState, node: Node, ordered = false, atTail = false): string | null => {\n const name = slotNameOf(node);\n if (name === null) return null;\n const bucket = bucketOf(state, name);\n const binding = activeFor(state, name);\n /**\n * **A node captured where it already belongs stays there.** Whoever put it inside the run put it\n * in a POSITION, and evacuating it to the holding fragment throws that away — it comes back at\n * the end, because the fragment has no idea where it was. A keyed list inserting a row into a\n * light host's children is the case: the row is created under the host, moved among its\n * neighbours, and captured in the same batch, and the position is the only thing that says where\n * it goes.\n *\n * Everything else — a node the user appended, one arriving from the holding fragment — is held\n * as before, and `fill` places it.\n */\n const settled = binding !== undefined && node.parentNode === binding._start.parentNode;\n /**\n * **Where a captured node goes in the bucket — one branch per way of knowing.**\n *\n * SETTLED (already inside its slot's run): document order — whoever moved it there meant that\n * position; a keyed mid-insert lands here. PLACED (stamped with the part that put it in the\n * host): after that part's last member, so a grown row extends its own list and two parts'\n * content in one host cannot interleave; no member yet means append, where a first row belongs.\n * UNSTAMPED (a human's): its position speaks — before the boundary it precedes everything\n * distributed away (document order among nodes still beside it); at or past the boundary it\n * was appended, and appends. The last-member fast path keeps the initial capture walk O(1) per\n * node — each child follows the one before it — instead of O(n²) over a big light list.\n */\n const own = (node as { _$own$?: unknown })._$own$;\n let at = bucket.length;\n /**\n * Set when this node sits in the light region ahead of everything already distributed — the rule\n * the unstamped branch below states in words. It is tracked separately from `at` because `at` is\n * a position in ONE bucket, and a node can land at the end of its own bucket while still\n * preceding every node in every other one. That is exactly the case a prepend into an empty\n * bucket makes: `at` is 0 and means nothing, and ranking from bucket neighbours put the node\n * last when it belonged first.\n */\n let front = false;\n if (ordered) {\n /* the caller's order is the order — fall through to the splice */\n } else if (settled) {\n for (let i = 0; i < bucket.length; i++)\n // eslint-disable-next-line no-bitwise -- DOCUMENT_POSITION_FOLLOWING, the platform's own flag\n if ((node.compareDocumentPosition(bucket[i]) & 4) !== 0) {\n at = i;\n break;\n }\n } else if (own !== undefined) {\n for (let i = bucket.length - 1; i >= 0; i--)\n if ((bucket[i] as { _$own$?: unknown })._$own$ === own) {\n at = i + 1;\n break;\n }\n } else {\n const home = node.parentNode;\n const last = bucket[bucket.length - 1];\n const sentinel = state._sentinel;\n /**\n * **The record is the light-tree truth; the sentinel is only a proxy for it.**\n *\n * `front` is \"this node precedes everything already distributed\" — inferred here from the\n * node preceding the `_sentinel` in the LIVE DOM. That inference holds when the host is\n * settled, and BREAKS mid-storm on an adopted seam: `flushPending` can process a genuine\n * tail-append while the sentinel is transiently positioned AFTER it, so the append reads as\n * front and takes a negative rank, sorting before the adopted nodes (run-18 residual, root\n * cause). The observer path knows better: a childList record whose `nextSibling` is null was\n * an APPEND at the light-tree tail, immune to any later churn — so `atTail` overrides the\n * proxy outright. A non-null `nextSibling` (prepend, insertBefore) is left to the existing\n * inference, which the settled and client-storm paths already exercise.\n */\n front =\n !atTail &&\n sentinel.parentNode === home &&\n // eslint-disable-next-line no-bitwise -- the node precedes the boundary: the light region\n (node.compareDocumentPosition(sentinel) & 4) !== 0;\n if (\n !atTail &&\n sentinel.parentNode === home &&\n // eslint-disable-next-line no-bitwise -- the node precedes the boundary: the light region\n (node.compareDocumentPosition(sentinel) & 4) !== 0 &&\n last !== undefined &&\n // eslint-disable-next-line no-bitwise -- fast append: skip the scan when the last member already precedes it\n !(last.parentNode === home && (last.compareDocumentPosition(node) & 4) !== 0)\n ) {\n /**\n * LANDMARKS first — exact where available: the nearest recorded comment after the node\n * names the member it belongs before, which places a hand-edit BETWEEN two parts' groups\n * where the scan below can only say \"ahead of everything distributed\". Skips members that\n * left this bucket (pulled, or another slot's) by walking on; bounded by the sentinel.\n */\n let placed = false;\n for (let next = node.nextSibling; next !== null && next !== sentinel; next = next.nextSibling) {\n const member = next.nodeType === 8 ? LANDMARKS.get(next) : undefined;\n if (member !== undefined) {\n const found = bucket.indexOf(member);\n if (found !== -1) {\n at = found;\n front = false;\n placed = true;\n break;\n }\n }\n }\n /**\n * **Backward too, because the skeleton has landmarks on both sides.** Looking only forward\n * meant that when every following landmark named a member that had since been removed or\n * re-slotted elsewhere, placement fell through to the scan below — which knows nothing\n * finer than \"ahead of everything distributed\" and so put the edit FIRST. Measured against a\n * shadow root given the same disturbance: it answers `A,U` and this answered `U,A`.\n *\n * A preceding landmark names the member captured just after it, so a node inserted after\n * that comment belongs after that member — the mirror of the forward rule, and it resolves\n * exactly when the forward walk cannot.\n */\n if (!placed)\n for (let prev = node.previousSibling; prev !== null; prev = prev.previousSibling) {\n const member = prev.nodeType === 8 ? LANDMARKS.get(prev) : undefined;\n if (member !== undefined) {\n const found = bucket.indexOf(member);\n if (found !== -1) {\n at = found + 1;\n front = false;\n placed = true;\n break;\n }\n }\n }\n if (!placed)\n for (let i = 0; i < bucket.length; i++) {\n const member = bucket[i];\n // eslint-disable-next-line no-bitwise -- first distributed member, or an in-place member that follows\n if (member.parentNode !== home || (node.compareDocumentPosition(member) & 4) !== 0) {\n at = i;\n break;\n }\n }\n }\n }\n /**\n * **A first sighting takes its light-tree rank from the position just computed.**\n *\n * `at` is this module's best answer to \"where does this node belong\", worked out from whatever\n * evidence exists — document position, the part that placed it, landmarks, the sentinel. That\n * answer is about ONE bucket, and re-slotting needs the same fact about the light tree, so the\n * rank is interpolated between the neighbours it landed among rather than invented separately.\n * Deriving it here is what makes the two agree by construction; a counter bumped on arrival\n * instead gave a node inserted at the FRONT of the light tree a tail rank, and re-slotting it\n * then sent it to the end — right where it was, wrong where it went.\n *\n * Midpoints, so an insertion never has to renumber. Doubles run out after about fifty\n * insertions between one adjacent pair, which no light host reaches; a re-capture (removed and\n * re-added) starts fresh at the tail, which is also where the platform puts it.\n */\n if (!state._rank.has(node)) {\n const before = at > 0 ? state._rank.get(bucket[at - 1]) : undefined;\n const after = at < bucket.length ? state._rank.get(bucket[at]) : undefined;\n state._rank.set(\n node,\n front\n ? --state._min\n : after === undefined\n ? state._next++\n : before === undefined\n ? after - 1\n : (before + after) / 2\n );\n }\n bucket.splice(at, 0, node);\n state._names.set(node, name);\n HOMES.set(node, state._sentinel);\n if (!settled) state._holding.appendChild(node);\n return name;\n};\n\nconst pull = (state: HostState, node: Node, name: string) => {\n const bucket = state._map.get(name);\n if (bucket === undefined) return;\n const at = bucket.indexOf(node);\n if (at !== -1) bucket.splice(at, 1);\n};\n\n/**\n * Discard the records the module's own DOM moves just produced. Wholesale discard is CORRECT here\n * for exactly one reason, and `flushPending` is that reason: every mutating operation flushes the\n * user's queued records BEFORE it moves anything, so by the time this runs the queue holds only\n * our own. (The first fix for the run-17 storms re-fed the taken records through the handler\n * instead — and our holding-fragment churn then flowed through arms never designed for it,\n * breaking real re-fallback. Process-then-move is the design that holds: user records are\n * processed while the queue is provably pure-user, ours are discarded while it is provably\n * pure-ours.)\n */\nconst drain = (state: HostState) => {\n state._observer.takeRecords();\n};\n\n/**\n * Process the USER's queued records before the module mutates anything — the run-17 fix.\n *\n * Observer delivery is asynchronous, so a user mutation made earlier in the same task (an append,\n * a `slot` rename, a removal) is still queued when a mount, fill or park starts moving nodes.\n * The old code drained that queue wholesale afterwards, under a comment claiming nothing of the\n * user's could be in it — wrong direction of time: seven deterministic storm divergences, one\n * root cause. At operation ENTRY the queue holds only user records (every previous operation\n * ended by draining its own), so processing here is exactly the observer callback running early.\n * Re-entrant-safe: processing refills, refills fill, and the inner fill's flush must not recurse.\n */\nconst flushPending = (state: HostState) => {\n if (state._flushing) return;\n const records = state._observer.takeRecords();\n if (records.length === 0) return;\n state._flushing = true;\n try {\n processRecords(state._host, state, records);\n } finally {\n state._flushing = false;\n }\n};\n\n/** The binding that OWNS a name — the first in tree order, as the platform picks the first\n * matching slot and leaves any duplicate showing its fallback. */\nconst activeFor = (state: HostState, name: string): Binding | undefined => {\n const bindings = state._bindings;\n for (let i = 0; i < bindings.length; i++) if (bindings[i]._name === name) return bindings[i];\n return undefined;\n};\n\nconst NOTHING: Node[] = [];\n\n/**\n * **`slotchange`, on the element the author bound it to.** Queued rather than dispatched inline:\n * the platform fires it at the microtask checkpoint, and firing synchronously from inside a render\n * would re-enter rendering from a handler. The queue also means the very first dispatch lands\n * after the slot's own `AttrPart`s have attached their listeners, whatever order mounting took.\n *\n * `Event` comes from the HOST's realm, not the module's — a component rendered into a popped-out\n * window must dispatch an event that window's code recognises, or a handler's `instanceof` is\n * false and, measured, a strict DOM refuses the foreign object outright.\n *\n * **From the host, and deliberately not from the slot**, which is the trap: a `<template>`'s\n * content belongs to an inert document that has no browsing context, so the slot element's\n * `ownerDocument.defaultView` is `null` — every clone of it, in every realm. The host is a live\n * element in the real document and is the only one of the two that knows which window this is.\n *\n * (`queueMicrotask` is not realm-bound; the job queue is shared.)\n */\nconst signal = (state: HostState, binding: Binding) => {\n const slot = binding._slot;\n if (slot === undefined || binding._queued) return;\n binding._queued = true;\n queueMicrotask(() => {\n binding._queued = false;\n slot.dispatchEvent(new state._event('slotchange', { bubbles: true, composed: false }));\n });\n};\n\nconst same = (a: Node[], b: Node[]): boolean => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n return true;\n};\n\n/**\n * Make one binding show what it should: the assignment (when it is the active binding for its\n * name and the bucket has nodes) or its fallback. Current occupants are evacuated first —\n * assigned nodes to holding (they remain captured), an unassigned region into `_fallback`, which\n * is a fragment rather than a list precisely because that region goes on living while it is away.\n * A bucket entry the USER spirited away while it was held (removed from holding, or adopted into\n * their own DOM) is purged rather than stolen back.\n *\n * **What the fragment fixes, stated because it cost real content.** Detaching the region node by\n * node left every anchor inside it parentless, so a binding nested in this fallback hit the guard\n * at the top of this function and returned without placing anything. A child the user added for\n * that inner slot while the outer one was assigned therefore went into its bucket and nowhere\n * else — and when the outer slot later fell back, the old list restored the inner slot's ORIGINAL\n * fallback over the top. The user's node was detached, invisible, and unrecoverable, while the\n * inner slot's own `assignedNodes()` still named it. In a shadow root the same sequence simply\n * shows the node, because there the inner slot never leaves the tree.\n *\n * Parked in a fragment, the anchors keep a parent, the inner binding places into the fragment as\n * it always would, and restoring carries the result back. One call, no list, no re-fill pass.\n */\nconst fill = (state: HostState, binding: Binding) => {\n /** The user's queued mutations first — see `flushPending`. Re-entrant fills skip via the flag. */\n flushPending(state);\n const parent = binding._start.parentNode;\n if (parent === null) return; // anchors already discarded mid-teardown — nothing to show\n /**\n * **The run's current order is remembered before it is taken apart, because it is the intent.**\n *\n * The bucket records what is assigned; its order is the order things were CAPTURED. Re-placing\n * from it therefore undoes any reordering that happened after distribution — and a keyed list\n * rendering a host's children reorders exactly those nodes, in place, where they now live. The\n * symptom was a list that reordered correctly and then snapped back to its original order the\n * next time anything caused a refill.\n *\n * Only the case that is currently wrong changes: when nothing has reordered the run, this order\n * IS the bucket's order and the sort below is the identity.\n */\n const wasShowing = new Map<Node, number>();\n let node = binding._start.nextSibling;\n while (node !== null && node !== binding._end) {\n const next = node.nextSibling;\n wasShowing.set(node, wasShowing.size);\n if (binding._assigned) state._holding.appendChild(node);\n else binding._fallback.appendChild(node);\n node = next;\n }\n const bucket = activeFor(state, binding._name) === binding ? bucketOf(state, binding._name) : NOTHING;\n /**\n * **A stable MERGE, not a re-sort.** Run members keep the run's order (a keyed reorder happens\n * in place, invisible to the observer — the run is its only record). Everything else keeps its\n * BUCKET position, ranked beside the run member it follows: a prepend `take` placed at index 0\n * stays ahead of the run instead of being shoved to the end — which is exactly how the first\n * ordering attempt broke two suites. Equal ranks fall back to bucket order (sort stability is\n * guaranteed), and `NOTHING` is shared and never written to.\n */\n if (wasShowing.size > 0 && bucket !== NOTHING) {\n const rank = new Map<Node, number>();\n let carried = -1;\n for (const member of bucket) {\n const shown = wasShowing.get(member);\n if (shown !== undefined) carried = shown;\n rank.set(member, shown ?? carried + 0.5);\n }\n bucket.sort((a, b) => rank.get(a)! - rank.get(b)!);\n }\n const shown: Node[] = [];\n for (let i = 0; i < bucket.length; i++) {\n const candidate = bucket[i];\n const home = candidate.parentNode;\n if (\n home !== state._holding &&\n home !== null &&\n home !== parent &&\n !state._parks.has(home) &&\n !inAnyRun(state, candidate)\n ) {\n /**\n * The user took this node for themselves while it was unassigned — respect that.\n *\n * `_parks` is the exception and it is not decoration: a node distributed by a slot nested in\n * a displaced fallback rests in that fallback's park fragment, which is a home of OURS. Read\n * as a user adoption it was purged from the bucket instead of being placed, so re-slotting\n * such a node to an outer slot dropped it — visible content, gone, in a sequence a shadow\n * root handles without comment.\n *\n * `!inAnyRun` is the run-27 completion of that same idea: a node RESLOTTED from one slot to\n * another has its bucket moved by the attribute arm but is still PHYSICALLY in its old\n * slot's run when this fill for the NEW slot runs — its parent is that other run's region,\n * which is a location WE control, not a user adoption. Without this the reslot's own fill\n * purged the node it was about to place, and the node vanished (run-27 adopted-seam storm\n * node-loss: concurrent DOM churn shifted delivery so the new-slot fill ran before the node\n * was physically relocated). Another run is the last of our regions the guard did not name.\n */\n bucket.splice(i--, 1);\n state._names.delete(candidate);\n continue;\n }\n parent.insertBefore(candidate, binding._end);\n shown.push(candidate);\n }\n binding._assigned = shown.length > 0;\n if (shown.length === 0) parent.insertBefore(binding._fallback, binding._end);\n if (!same(binding._shown, shown)) {\n binding._shown = shown;\n signal(state, binding);\n }\n};\n\nconst refill = (state: HostState, name: string) => {\n const binding = activeFor(state, name);\n if (binding !== undefined) fill(state, binding);\n};\n\n/**\n * Register one binding for `name` and hand back its park closure — the single source for both the\n * client seam and hydration's adopt, which previously spelled the same registration and the same\n * park body twice (the house's most-repeated defect class). Park rescues assigned user nodes into\n * holding before the instance's DOM is bulk-discarded, unregisters, and promotes the next\n * duplicate slot to the assignment — native's next-in-tree-order.\n */\nconst bind = (state: HostState, binding: Binding): SeamState => {\n state._bindings.push(binding);\n const slot = binding._slot;\n if (slot !== undefined) {\n state._ghosts.set(slot, binding);\n expose(state, binding);\n /** A `name` that is a binding can change between renders, and the element it changes on is\n * not in the host's subtree — so it is watched directly. */\n state._observer.observe(slot, { attributes: true, attributeFilter: ['name'] });\n if (__DEV__) warnInert(slot);\n }\n return {\n _$park$: () => {\n /** A rename or removal queued in this same task decides WHAT gets parked — process it first. */\n flushPending(state);\n if (binding._assigned) {\n let node = binding._start.nextSibling;\n while (node !== null && node !== binding._end) {\n const next = node.nextSibling;\n state._holding.appendChild(node);\n node = next;\n }\n }\n const wasActive = activeFor(state, binding._name) === binding;\n const at = state._bindings.indexOf(binding);\n if (at !== -1) state._bindings.splice(at, 1);\n /** Whoever is now first for that name inherits the assignment — native's next in tree order. */\n if (wasActive) refill(state, binding._name);\n drain(state);\n },\n };\n};\n\n/**\n * Answer `assignedNodes()`/`assignedElements()` from the live assignment, so a handler written for\n * a shadow slot — `event.target.assignedElements()`, or the same through `&ref` — reads the same\n * thing here. A detached element's own implementations return nothing, which is what made the\n * ordinary way of reading a slot come back empty in light mode.\n *\n * `flatten` means what it means on the platform for a slot with nothing assigned: the fallback\n * **that is actually on screen right now**. Both halves of that sentence were wrong.\n *\n * It answered from `_fallback`, which is the restore list — a snapshot of the slot's template\n * children, taken once. That is the right list to re-insert from and the wrong list to report,\n * because the region it stands for is live: a NESTED slot inside fallback content redistributes\n * as its own assignment changes, and a binding inside fallback content re-renders. Reported from\n * the snapshot, a nested slot's flatten kept naming a node the user had already removed from the\n * document, forever.\n *\n * So read from wherever the fallback IS. Rendered, that is the region between the anchors, and\n * reading it there is live by construction rather than by maintenance — nothing has to remember to\n * update it — which also makes the recursion the platform specifies fall out for free, since an\n * inner slot's distributed content is physically in that region. Displaced, there is no region to\n * walk: `fill` detaches the old fallback node by node, anchors included, so `_start` has no parent\n * and the restore list is the only record of it. That is the one honest discriminator here and it\n * needs no new state — a slot nested in another slot's fallback is exactly the case that reaches\n * it, and the platform still answers for such a slot because in a shadow tree it never left.\n *\n * The filter is the second half: the platform's word is *slottables*, so `slotNameOf` — the same\n * predicate that decides assignment everywhere else in this file — is what says which nodes count.\n * Without it the walk hands back a user's own `<!-- -->` written into fallback content, and this\n * module's own markers around a nested slot's content: an implementation detail escaping through\n * a documented API. One predicate closes both.\n */\nconst expose = (state: HostState, binding: Binding) => {\n const slot = binding._slot as HTMLSlotElement;\n const read = (flatten?: boolean): Node[] => {\n const bucket = activeFor(state, binding._name) === binding ? (state._map.get(binding._name) ?? NOTHING) : NOTHING;\n if (bucket.length > 0) return [...bucket];\n if (flatten !== true) return [];\n const shown: Node[] = [];\n for (let n = binding._start.nextSibling; n !== null && n !== binding._end; n = n.nextSibling) shown.push(n);\n return shown.filter((node) => slotNameOf(node) !== null);\n };\n slot.assignedNodes = (options?: { flatten?: boolean }) => read(options?.flatten) as Node[];\n slot.assignedElements = (options?: { flatten?: boolean }) =>\n read(options?.flatten).filter((node) => node.nodeType === 1) as Element[];\n};\n\n/**\n * **What a `<slot>` cannot carry in a light component, said out loud.** A light host has no second\n * tree, so the slot element is not rendered and never can be: `class`, `style`, `id` and the rest\n * have nowhere to apply, whether they were written statically or bound. In a shadow root they do\n * apply — a `<slot>` is a real element there — so this is the one asymmetry left, and silence\n * about it is what made it expensive to find.\n *\n * `name` is excluded because it is the slot's meaning, and events and `&ref` never appear as\n * attributes at all, so they do not trip this.\n */\nconst warnInert = (slot: Element) => {\n const inert: string[] = [];\n for (const attribute of slot.attributes) if (attribute.name !== 'name') inert.push(attribute.name);\n if (inert.length === 0) return;\n const label = slot.getAttribute('name');\n const key = `${label ?? ''}|${inert.join(',')}`;\n if (warnedInert.has(key)) return;\n warnedInert.add(key);\n console.warn(\n `[vera] <slot${label === null ? '' : ` name=\"${label}\"`}> carries ${inert.map((n) => `\\`${n}\\``).join(', ')}, ` +\n `which does nothing in a light-DOM component: the slot element is not rendered, so there is ` +\n `nothing for it to apply to. In a shadow root it would apply. Put it on a real element around ` +\n `the slot instead. (\\`name\\`, \\`@event\\` bindings and \\`&ref\\` all work here.)`\n );\n};\nconst warnedInert = new Set<string>();\n\n/**\n * The user's mutations, batched. Additions join only with an explicit `slot` attribute (the\n * documented rule above); removals and re-slottings of CAPTURED nodes are recognized anywhere by\n * identity. Template-caused records match nothing here: its nodes were never captured, and our\n * own moves were drained before they could arrive.\n */\n/**\n * Is this node currently sitting inside one of OUR runs — between some binding's anchors, in the\n * host or in a not-yet-inserted instance fragment alike? The user-took removal arm needs it: a\n * mount's `fill` moves a captured node into the instance's DETACHED fragment before the fragment\n * enters the host, so at drain time the node is in neither the host nor the holding — exactly the\n * signature the arm reads as \"the user took it\". Position between anchors is the fact that holds\n * in both worlds, and it is the same test the nested-addition arm already trusts.\n */\nconst inAnyRun = (state: HostState, node: Node): boolean => {\n for (const binding of state._bindings) {\n const parent = binding._start.parentNode;\n if (parent === null || parent !== node.parentNode) continue;\n // eslint-disable-next-line no-bitwise -- DOCUMENT_POSITION_FOLLOWING, as in the nested-add arm\n if ((binding._start.compareDocumentPosition(node) & 4) !== 0 && (node.compareDocumentPosition(binding._end) & 4) !== 0)\n return true;\n }\n return false;\n};\n\nconst processRecords = (host: Element, state: HostState, records: MutationRecord[]) => {\n const touched = new Set<string>();\n const moved: Binding[] = [];\n for (const record of records) {\n if (record.type === 'attributes') {\n const node = record.target;\n /**\n * A kept `<slot>` element renaming itself — `<slot name=${section}>` with a new value. Both\n * names are refilled: the one it left (whose next duplicate, if any, inherits) and the one it\n * joined. The binding itself is filled either way, since it may now be a duplicate and owe\n * its fallback.\n */\n const ghost = state._ghosts.get(node as Element);\n if (ghost !== undefined) {\n const next = (node as Element).getAttribute('name') ?? '';\n if (next !== ghost._name) {\n touched.add(ghost._name);\n ghost._name = next;\n touched.add(next);\n moved.push(ghost);\n }\n continue;\n }\n const previous = state._names.get(node);\n if (previous !== undefined) {\n const next = slotNameOf(node)!;\n if (next !== previous) {\n pull(state, node, previous);\n /**\n * By LIGHT ORDER, not arrival. The node has not moved in the light tree — only its\n * `slot` attribute changed — so its rank still says where it belongs among whatever the\n * new bucket already holds. Appending here was the whole of the ordering divergence.\n * `fill`'s stable merge preserves this: a member ahead of the current run ranks before\n * it, which is the same rule that keeps a prepend ahead.\n */\n const joining = bucketOf(state, next);\n const rank = state._rank.get(node)!;\n let at = joining.length;\n for (let i = 0; i < joining.length; i++) {\n const other = state._rank.get(joining[i]);\n if (other !== undefined && other > rank) {\n at = i;\n break;\n }\n }\n joining.splice(at, 0, node);\n state._names.set(node, next);\n touched.add(previous);\n touched.add(next);\n }\n }\n continue;\n }\n for (const node of record.addedNodes) {\n /**\n * **Ownership answers capture outright — the heuristic stack this replaces is gone.**\n *\n * Every node the renderer puts at a captured host's top level is stamped: `true` when it\n * is the render's own output, the placing part when it is content from an outer template.\n * So \"may I capture this?\" is one property read:\n *\n * `true` — the component's own output. Never content. (Without this, a component whose\n * rendered root carries a `slot` attribute had its output eaten.)\n * a part — placed content: captured, ordered by its part (see `take`).\n * absent — a human put it here: captured with full native semantics, TEXT INCLUDED,\n * which retires the `slot=`-after-first-render rule and the tail-text hole in\n * one move. Safe for exactly one reason: the renderer stamps 100% of its own\n * top-level output — measured across every template shape, and structurally\n * guaranteed by the `_end === null` root test, async commits included — so\n * unstamped genuinely means \"not the renderer's\".\n *\n * Deleted here: the insertion-site reconstruction (`record.nextSibling`, the region helper)\n * — it existed because created-then-moved keyed rows were positionally indistinguishable\n * from user content, and they are stamped now — and the tail attribute arm, the fail-closed\n * stand-in for ownership nobody could know. `record.target === host` still bounds this to\n * TOP-LEVEL additions (current parent alone misses same-batch moves); a component's\n * internal renders mutate deeper parents and are never considered.\n */\n if (\n (record.target === host || node.parentNode === host) &&\n (node as { _$own$?: unknown })._$own$ !== true &&\n !state._names.has(node)\n ) {\n /** `nextSibling === null` in the record means an APPEND at the host's end — the\n * light-tree tail, snapshotted at mutation time. `take` uses it to override the\n * sentinel proxy that misfires mid-storm. See the front-detection note there. */\n const name = take(state, node, false, record.nextSibling === null);\n if (name !== null) touched.add(name);\n } else if (!state._names.has(node) && (node as { _$own$?: unknown })._$own$ !== true) {\n /**\n * **A slottable that appeared INSIDE a run, never passing the host's top level.**\n *\n * `splitText` on distributed text is the real case — a highlighting library's core\n * gesture — and the tail is created as a sibling in the COMPONENT's tree, where the rule\n * above does not look. Left uncaptured it was missing from the bucket, so the next refill\n * evacuated it to holding and never brought it back: the text silently lost half of\n * itself, while a shadow root reports both halves assigned and shows them.\n *\n * Captured here, from the record, rather than by having `fill` sweep its run for\n * surprises — the observer holds the exact node, and re-deriving it downstream would be\n * the same inference-instead-of-ownership this module spent its history removing, at the\n * cost of an O(run) scan on every fill of every host forever.\n *\n * Three conditions make it safe, and each is a fact rather than a proxy: the run must be\n * ASSIGNED (a run showing FALLBACK holds the component's own nodes, and adopting those\n * would make a component's fallback into the user's content); the node must lie BETWEEN\n * the anchors, not merely share their parent, or anything dropped elsewhere in that\n * element would be pulled into the slot; and the node's own slot name must MATCH the\n * binding it landed in, so a stray element in a named slot's run is left alone rather\n * than filed under a name it never claimed.\n *\n * Measured before keeping the scan over bindings: with 500 rows rendered inside a host,\n * every one of them an unstamped nested addition that reaches this loop, four bindings\n * cost the same as one (44.5–51.5 ms against 45.1–53.9). DOM work dominates completely.\n */\n for (const binding of state._bindings)\n if (\n binding._assigned &&\n binding._start.parentNode === record.target &&\n // eslint-disable-next-line no-bitwise -- DOCUMENT_POSITION_FOLLOWING, the platform's flag\n (binding._start.compareDocumentPosition(node) & 4) !== 0 &&\n // eslint-disable-next-line no-bitwise -- and the end anchor follows the node in turn\n (node.compareDocumentPosition(binding._end) & 4) !== 0 &&\n slotNameOf(node) === binding._name\n ) {\n take(state, node);\n touched.add(binding._name);\n break;\n }\n }\n }\n for (const node of record.removedNodes) {\n const name = state._names.get(node);\n /**\n * Our evacuations were drained, so an undrained removal of a captured node is the user's.\n * The question is only whether it is still OURS to hold, and there are three answers:\n * detached entirely (`parentNode === null`) is gone; the holding fragment or anywhere in\n * the host's own subtree is a MOVE the add/attribute handling covers — a keyed row created\n * under the host and positioned inside the component in one batch is exactly that; and\n * anywhere else is the user taking the node for themselves.\n *\n * That third case used to read as a move and kept the node captured forever: it was no\n * longer in the run, so the slot showed nothing — not the node, and not its fallback — where\n * a shadow root un-assigns and falls back. `fill` already had the corresponding guard\n * (\"the user took this node\") but nothing brought it a reason to run.\n */\n if (\n name !== undefined &&\n node.parentNode !== state._holding &&\n !host.contains(node) &&\n !inAnyRun(state, node)\n ) {\n pull(state, node, name);\n state._names.delete(node);\n touched.add(name);\n }\n }\n }\n for (const name of touched) refill(state, name);\n for (const binding of moved) fill(state, binding);\n};\n\nconst onMutations = (host: Element, records: MutationRecord[]) => {\n const state = HOSTS.get(host)!;\n processRecords(host, state, records);\n drain(state);\n};\n\n/** Capture the host's children — once, at the first slot the seam hands us for it. */\nconst capture = (host: Element, skipChildren = false, boundary?: Comment): HostState => {\n let state = HOSTS.get(host);\n if (state !== undefined) return state;\n const doc = host.ownerDocument!;\n const created: HostState = (state = {\n _host: host,\n _flushing: false,\n _map: new Map(),\n _bindings: [],\n _holding: doc.createDocumentFragment(),\n _parks: new WeakSet(),\n _rank: new WeakMap(),\n _next: 0,\n _min: 0,\n _names: new WeakMap(),\n _ghosts: new WeakMap(),\n _event: ((doc.defaultView as { Event?: typeof Event } | null)?.Event ?? Event) as typeof Event,\n _observer: new MutationObserver((records) => onMutations(host, records)),\n /**\n * **The renderer's own root marker, when it has one** — it already delimits where the render's\n * output begins, which is exactly this boundary, so a sentinel of our own was a second comment\n * saying the same thing one position to the left. Only the paths that reach `capture` WITHOUT\n * one (hydration adopts per slot, and its render's marker is not in hand there) still mint it.\n */\n _sentinel: boundary ?? doc.createComment(''),\n });\n HOSTS.set(host, created);\n /**\n * The host is MARKED as captured, on itself — this is what the renderer's stamp gate reads in\n * `_insert`/`$c`: one own-property read instead of a seam call, and it cannot go stale in the\n * dangerous direction (a part committing into a not-yet-captured host reads undefined, stamps\n * nothing, and that content is exactly what the initial walk below lifts). Symmetric with the\n * node stamps: ownership facts live on the objects they describe.\n */\n Object.defineProperty(host, '_$hosted$', HOSTED);\n /** Ours to place only if ours to make; the renderer's is already in the document. */\n if (boundary === undefined) host.appendChild(created._sentinel);\n /**\n * A server render parks content no slot claimed in an inert `<template>` — recover it into\n * holding (captured, unrendered, ready if its slot ever mounts) and drop the carrier, so the\n * round trip matches CSR exactly. Done before the children walk so the carrier is never itself\n * mistaken for slot content.\n */\n for (const child of [...host.children])\n if (child.localName === 'template' && child.hasAttribute(UNASSIGNED_MARK)) {\n const held = (child as HTMLTemplateElement).content;\n for (const node of [...held.childNodes]) take(created, node, true);\n host.removeChild(child);\n }\n /** Hydration already has the children distributed and registers them itself; a fresh CSR\n * capture lifts them from the host. */\n if (!skipChildren) {\n /** Comments seen since the last member become its landmarks — see LANDMARKS. */\n let pending: Node[] | null = null;\n for (const node of [...host.childNodes]) {\n if (node.nodeType === 8) (pending ??= []).push(node);\n else if (take(created, node, true) !== null && pending !== null) {\n for (const mark of pending) LANDMARKS.set(mark, node);\n pending = null;\n }\n }\n }\n created._observer.observe(host, WATCHING);\n /**\n * HOLDING IS WATCHED TOO. Unassigned nodes wait in a detached fragment, which is not in the\n * host's subtree — so re-slotting one (`slot=\"a\"` → `\"b\"`) went unseen and the node never moved\n * to its new slot, while native re-assigns a light child whether or not it is currently\n * assigned (measured: displayed nodes re-slotted, held ones silently did not).\n */\n created._observer.observe(created._holding, WATCHING);\n return created;\n};\n\n/** The seam function — called by the renderer once per `<slot>` per instance (see the seam). */\nconst takeOverSlot = (slot: Element, root: Node, name: string): SeamState | null => {\n /**\n * The SERVER declines the client path entirely: SSR renders once and distributes through\n * `_$server$` (markerless, no observer, no anchors). If this ran under the shim it would insert\n * anchors and capture into a fragment, fighting the server pass. `__veraSsrShimmed` is the flag\n * SSR sets when it installs the DOM.\n */\n if ((globalThis as { __veraSsrShimmed?: boolean }).__veraSsrShimmed) return null;\n /** Only an element host is ours: a shadow root keeps native slotting, and a fragment or\n * document container is not a light component. Duck-typed — realm-safe for pop-outs. */\n if (root.nodeType !== 1) return null;\n const host = root as Element;\n /**\n * **A `<slot>` nested inside ANOTHER slot's fallback has already been detached by the time we\n * reach it.** Slots mount in document order, and taking over the outer one lifts its fallback\n * children out of the tree and into `_fallback` — the inner slot among them. Reaching for\n * `parentNode.insertBefore` then threw a TypeError straight out of `renderInto`, taking the whole\n * render with it.\n *\n * Declining leaves it a literal `<slot>` inside that fallback: inert, showing its own fallback\n * children if the outer slot ever falls back. That is a documented divergence from the platform,\n * where an inner slot DOES participate while the outer one shows its fallback — supporting that\n * means taking slots over at the moment a fallback is inserted, which is a feature rather than\n * this fix. What matters here is that markup the platform accepts cannot crash the renderer.\n */\n if (slot.parentNode === null) return null;\n const nestedStates: SeamState[] = [];\n const state = capture(host);\n const doc = slot.ownerDocument!;\n const parent = slot.parentNode;\n const start = doc.createComment('');\n const end = doc.createComment('');\n parent.insertBefore(start, slot);\n parent.insertBefore(end, slot);\n /**\n * **Slots inside this one's FALLBACK are taken over first, while they still have a parent.**\n *\n * The renderer hands slots over in document order, so the outer one arrives first — and the first\n * thing it used to do was detach its fallback children, taking any nested slot out of the tree\n * with them. By the time that inner slot's turn came it had no parent to anchor into: it threw\n * until a guard declined it, and declining left it a literal `<slot>` that showed its own\n * fallback instead of what it was assigned, whenever the outer one later fell back. Measured\n * against a shadow root, which re-slots it: three arrangements, three different wrong answers,\n * one of them showing nothing at all.\n *\n * Doing it here rather than reordering the renderer's mount keeps binding order in TREE order,\n * which is what decides duplicate names. Deepest first, so a slot nested two levels down is live\n * before the one containing it captures it. The renderer still visits these afterwards and the\n * parentless guard declines them, so nothing is taken over twice.\n */\n const nested = [...slot.querySelectorAll('slot')].reverse();\n for (const inner of nested) {\n const innerState = takeOverSlot(inner, root, inner.getAttribute('name') ?? '');\n if (innerState !== null) nestedStates.push(innerState);\n }\n const fallback = doc.createDocumentFragment();\n state._parks.add(fallback);\n /**\n * **And a park is watched too, for exactly the reason holding is.** A displaced fallback is a\n * second detached place captured nodes rest in: a slot nested here goes on distributing while the\n * outer slot is assigned, so its content sits in this fragment, outside the host's subtree. Left\n * unwatched, re-slotting one of those nodes (`slot=\"i\"` → `\"\"`) was invisible and it never moved\n * — the same defect `_holding` already carries a comment about, one level further out.\n */\n state._observer.observe(fallback, WATCHING);\n while (slot.firstChild !== null) fallback.appendChild(slot.firstChild);\n /** Out of the document, but KEPT — it is the component's handle on this slot. */\n parent.removeChild(slot);\n const binding: Binding = {\n _start: start,\n _end: end,\n _name: name,\n _fallback: fallback,\n _assigned: false,\n _slot: slot,\n _shown: [],\n _queued: false,\n };\n const seam = bind(state, binding);\n fill(state, binding);\n drain(state);\n /** Parking this slot has to park the ones living in its fallback, or a branch-away would strand\n * their bindings while their nodes go with the discarded DOM. */\n if (nestedStates.length > 0) {\n const own = seam._$park$;\n const inner = nestedStates;\n seam._$park$ = () => {\n for (const state of inner) state._$park$();\n own();\n };\n }\n return seam;\n};\n\n/**\n * **The capture map records membership, not order.** Native `assignedNodes()` answers in flat-tree\n * order, so this has to as well, and the bucket's own order is the order things were CAPTURED —\n * which stops being the document's the moment anything reorders the distributed nodes. A keyed list\n * rendering a host's children is exactly that: the DOM came out `cab` and this still said `abc`,\n * while the same component in shadow mode said `cab`. The observer cannot fix it either — it\n * deliberately ignores moves inside the component's own tree, or it would react to every render.\n *\n * The common case is a handful of nodes sharing one parent, so that is the fast path: one walk of\n * that parent's children. Members split across parents — some distributed, some still parked in the\n * holding template — fall back to comparing positions, which is exact wherever they are.\n */\nconst inDocumentOrder = (bucket: Node[] | undefined): Node[] => {\n if (bucket === undefined || bucket.length < 2) return bucket === undefined ? [] : [...bucket];\n const parent = bucket[0].parentNode;\n let shared = parent !== null;\n for (let i = 1; shared && i < bucket.length; i++) if (bucket[i].parentNode !== parent) shared = false;\n if (!shared)\n return [...bucket].sort((a, b) =>\n // eslint-disable-next-line no-bitwise -- DOCUMENT_POSITION_FOLLOWING, the platform's own flag\n a === b ? 0 : a.compareDocumentPosition(b) & 4 ? -1 : 1\n );\n const members = new Set(bucket);\n const ordered: Node[] = [];\n for (let node = parent!.firstChild; node !== null; node = node.nextSibling)\n if (members.has(node)) ordered.push(node);\n return ordered;\n};\n\n/**\n * What the user slotted, by name — the component-internal accessor that answers identically in\n * both modes. Shadow: the native assignment. Light: the capture map, in document order (a fresh\n * array; membership is live, so ask again after mutations). `''`/omitted is the default slot.\n */\nexport const slotted = (host: Element, name = ''): Node[] => {\n const state = HOSTS.get(host);\n if (state !== undefined) return inDocumentOrder(state._map.get(name));\n /**\n * **`_root` before `shadowRoot`, because a CLOSED root is not reachable through `shadowRoot`** —\n * it is null there, and reading only that made this return `[]` for a closed component: a silent\n * wrong answer from an accessor documented as answering in either mode. Core keeps the root it\n * attached, in both modes, and exempts `_root` from property mangling precisely so other bundles\n * can read it; `@verajs/styles` already does, for this same reason.\n *\n * Written as a QUOTED access because this bundle mangles `_[a-z]` properties and core's does not\n * mangle this one — `keep_quoted` is what keeps the two spellings the same name in production.\n */\n const root = (host as unknown as Record<string, ShadowRoot | null | undefined>)['_root'] ?? host.shadowRoot;\n if (root != null) {\n /**\n * Matched by READING each slot's name, never by interpolating one into a selector: a name\n * carrying a quote made `slot[name=\"…\"]` an invalid selector and threw a DOMException out of\n * a public accessor, and `slot:not([name])` missed `<slot name=\"\">` — which the platform\n * counts as the default slot (measured against native `assignedNodes`). One rule,\n * `(getAttribute('name') ?? '') === name`, is the platform's own and covers both.\n */\n for (const slot of root.querySelectorAll('slot'))\n if (((slot as HTMLSlotElement).getAttribute('name') ?? '') === name)\n return (slot as HTMLSlotElement).assignedNodes();\n }\n return [];\n};\n\n/**\n * SERVER distribution — a self-contained, observer-free, anchor-free pass for SSR. The client\n * path (capture + anchors + a live observer) is meaningless on a server that renders once and\n * flattens templates through its own serializer, so `@verajs/ssr` calls THIS instead, reached\n * off the insert as `_$server$` (like `_$capture$`) so ssr needs no import of this module.\n *\n * Input: the host after its template rendered — `source` are the user's original children\n * (snapshotted before the template ran), and the host also contains the rendered template with\n * literal `<slot>` elements. Output: markerless distributed light DOM — each `<slot>` UNWRAPPED\n * to its assigned nodes (or its own fallback children), the source consumed, and one attribute\n * (`data-vm-slotted=\"offset,count\"`) when the DEFAULT slot received content, which is all\n * hydration needs to tell assigned-from-fallback there.\n */\n/**\n * **`\"offset,count\"`, on the default slot's PARENT — position, not just extent.** A named slot's\n * content self-identifies (the user's nodes carry their own `slot=\"x\"`); the default slot's does\n * not, because bare text is common there and cannot carry an attribute, so the server states it.\n *\n * The count alone is enough to ADOPT — the adoption walk arrives already standing at the right\n * place. It is not enough to RECOVER, and recovery is the case that matters: when hydration hits\n * a mismatch it discards the container and clean-renders, and for a light host the user's slotted\n * content is *inside* what gets discarded. Marked with only a count on the host, content whose\n * slot the walk never reached could not be found again and was destroyed — silently, under a\n * warning that promised the page was still correct. With the position stated, `_$rescue$` lifts\n * the user's nodes back out before the discard, no walk required, and the clean render\n * redistributes them exactly as it would on a first client render.\n */\nconst SLOTTED_ATTR = 'data-vm-slotted';\n/**\n * Unassigned slot content is PRESERVED, not dropped — native leaves an unassigned light child in\n * the DOM (present, unrendered), and a light host has no second tree to hide it in, so the server\n * parks it in an inert `<template>` (exactly what the element is for: parsed, never rendered).\n * Hydration drains it back into holding, so content for a slot that only appears in another state\n * survives the round trip instead of vanishing from the HTML forever.\n */\nconst UNASSIGNED_MARK = 'data-vm-unassigned';\nconst serverDistribute = (host: Element, source: Node[]) => {\n const buckets = new Map<string, Node[]>();\n for (const node of source) {\n const name = slotNameOf(node);\n if (name === null) continue;\n let bucket = buckets.get(name);\n if (bucket === undefined) buckets.set(name, (bucket = []));\n bucket.push(node);\n if (node.parentNode !== null) node.parentNode.removeChild(node);\n }\n const filled = new Set<string>();\n /** Parents carrying a mark, with the user's first and last node — see the separator pass. */\n const marked: Array<{ parent: Element; first: Node; last: Node; count: number }> = [];\n /** Collect first (the live list mutates as slots are unwrapped). Any nesting order is fine —\n * a slot is replaced by its content, and a slot inside assigned content was itself resolved. */\n const slotEls: Element[] = [...host.querySelectorAll('slot')];\n for (const slot of slotEls) {\n const parent = slot.parentNode;\n if (parent === null) continue; // already unwrapped as another slot's assigned content\n const name = slot.getAttribute('name') ?? '';\n const assigned = !filled.has(name) ? buckets.get(name) : undefined;\n if (assigned !== undefined && assigned.length > 0) {\n filled.add(name);\n for (const node of assigned) parent.insertBefore(node, slot);\n /** The DEFAULT slot's content is unmarkable in the body (it may be bare text), so its\n * PARENT states where it is and how much of it there is. Named slots self-delimit by\n * their own `slot` attribute and need nothing. Offset is stable: slots are unwrapped in\n * document order, so everything before this one is already final. */\n /** The mark is written after the separator pass — see it for why position is computed once,\n * at the end, rather than here where the nodes are still moving. */\n if (name === '')\n marked.push({\n parent: parent as Element,\n first: assigned[0],\n last: assigned[assigned.length - 1],\n count: assigned.length,\n });\n } else {\n /** Fallback: the slot's own children, unwrapped in place. */\n let child = slot.firstChild;\n while (child !== null) {\n const next = child.nextSibling;\n parent.insertBefore(child, slot);\n child = next;\n }\n }\n parent.removeChild(slot);\n }\n /** Whatever no slot claimed goes into the inert carrier, in its original order per name. */\n /**\n * **Separators where two text runs would MERGE, because serialisation is where node identity\n * dies.** The `offset,count` mark counts nodes as they are HERE; the client's parser joins\n * adjacent text into one node, and the mark then addresses a node spanning a boundary it cannot\n * see. Both edges of the user's content are at risk and each corrupts a different reader:\n *\n * - the TRAILING edge breaks adoption's count — measured, `<main><slot>fb</slot> TAIL</main>`\n * served \"BODY TAIL\" and hydrated to \"BODY TAIL TAIL\", the static text adopted twice.\n * - the LEADING edge breaks the offset, which only `rescue` reads — so a hydration bail would\n * slice the wrong range and keep the component's markup instead of the user's.\n *\n * Run AFTER the slot loop, because until every slot is unwrapped the neighbour of a boundary is\n * still a `<slot>` element and the merge is not yet visible. Emitted by the side that KNOWS: the\n * alternative was to have hydration infer the boundary from the canonical template, which works\n * for the shape in front of you and needs a new case for each thing that can follow a slot\n * (static text, another default slot's fallback, a named slot's fallback, and whether that named\n * slot receives content at all) — one rule here removes the class instead of handling members of\n * it. React emits the same 7 bytes for the same reason.\n */\n for (const { first, last } of marked) {\n const doc = host.ownerDocument!;\n const ahead = first.previousSibling;\n if (ahead !== null && ahead.nodeType === 3 && first.nodeType === 3)\n first.parentNode!.insertBefore(doc.createComment(''), first);\n const behind = last.nextSibling;\n if (behind !== null && behind.nodeType === 3 && last.nodeType === 3)\n last.parentNode!.insertBefore(doc.createComment(''), behind);\n }\n\n let carrier: Element | null = null;\n for (const [name, bucket] of buckets) {\n if (filled.has(name) || bucket.length === 0) continue;\n if (carrier === null) {\n carrier = host.ownerDocument!.createElement('template');\n carrier.setAttribute(UNASSIGNED_MARK, '');\n }\n for (const node of bucket) carrier.appendChild(node);\n }\n if (carrier !== null) host.appendChild(carrier);\n\n /**\n * **The mark is written LAST, because it records a POSITION and position is only true once\n * nothing else will move.** Computing it in the slot loop and then inserting separators put the\n * two out of step by exactly one node: the recorded offset addressed the separator rather than\n * the content, and the rescue — the only reader of the offset — kept nothing, so a hydration\n * bail showed the component's own fallback with the user's content gone. Every hydration test\n * still passed, because adoption reads only the count.\n *\n * Writing it here rather than merely after the separators is the difference between a fix and a\n * rule: the carrier append above, and anything added below it later, cannot silently reintroduce\n * the same defect. One place computes position, and it is downstream of every pass that moves a\n * node — which is a property of the ORDER, not of remembering to check.\n */\n for (const { parent, first, count } of marked) {\n let offset = 0;\n for (let n = parent.firstChild; n !== null && n !== first; n = n.nextSibling) offset++;\n parent.setAttribute(SLOTTED_ATTR, `${offset},${count}`);\n }\n};\n\n\n/**\n * Capture a light host's children at its FIRST render, before any slot has necessarily mounted —\n * so content destined for a slot that only appears later (a conditional `<slot>` behind a branch)\n * is held invisibly meanwhile, exactly as native shadow DOM leaves an unassigned light child\n * unrendered. Idempotent (capture is once per host); the renderer calls it once per host lifetime.\n */\n(takeOverSlot as { _$capture$?: (host: Element, boundary?: Comment) => void })._$capture$ = (\n host,\n boundary,\n) => {\n if ((globalThis as { __veraSsrShimmed?: boolean }).__veraSsrShimmed) return;\n capture(host, false, boundary);\n drain(HOSTS.get(host)!);\n};\n/**\n * A captured node's HOME — the sentinel marking the end of its host's light region. The renderer's\n * text-part upgrade calls this: markers for a part whose text node was captured belong in the\n * HOST, not wherever distribution carried the node (see `_sentinel`). Returns null for a node no\n * light host has captured, which is every node in an app without light slots.\n */\n(takeOverSlot as { _$home$?: (node: Node) => Comment | null })._$home$ = (node) => {\n const sentinel = HOMES.get(node);\n return sentinel !== undefined && sentinel.parentNode !== null ? sentinel : null;\n};\n/** The server hook — SSR calls this (never the client capture/anchor path). */\n(takeOverSlot as { _$server$?: (host: Element, source: Node[]) => void })._$server$ = serverDistribute;\n\n/**\n * HYDRATION adopt — wrap already-distributed server nodes as a live binding IN PLACE, so a\n * server-rendered slot component becomes fully interactive with zero node churn: the user's nodes\n * keep their identity (focus, input values), and the capture map + observer come alive for\n * re-renders and mutations. Called by the hydrate entry once per `<slot>` it reconciles.\n *\n * `assigned` are the user's nodes already sitting at the slot position (null/empty ⇒ the slot\n * showed its fallback, which is `fallback` — those nodes are already in place too). `parent` and\n * `before` bound where anchors go. Returns the binding's park state, exactly like `takeOverSlot`.\n */\nconst adoptSlot = (\n host: Element,\n name: string,\n assigned: Node[] | null,\n fallback: Node[],\n parent: Node,\n before: Node | null,\n /** The hydrator's per-instance `<slot>` — a shallow clone of the canonical one, carrying this\n * instance's committed bindings. Appended, so a slots build paired with an older hydrate build\n * degrades to no element rather than breaking. */\n slot?: Element,\n): SeamState => {\n const state = capture(host, /* skipChildren */ true);\n const doc = host.ownerDocument!;\n const start = doc.createComment('');\n const end = doc.createComment('');\n /** Anchors bracket whatever is shown (assigned nodes, or the fallback the server rendered). */\n const firstShown = (assigned && assigned.length > 0 ? assigned[0] : fallback[0]) ?? before;\n parent.insertBefore(start, firstShown ?? before);\n parent.insertBefore(end, before);\n const isAssigned = assigned !== null && assigned.length > 0;\n /**\n * `_fallback` holds the DISPLACED region and is empty while the region is on screen, so which\n * branch this is decides where these nodes belong. Assigned: the server never rendered the\n * fallback and these are clones off the canonical template, displaced from the start — they go\n * into the fragment. Unassigned: the server DID render them and they are live in the page\n * between the anchors, so they stay exactly where they are and the fragment starts empty.\n * Moving them would delete server output from the document.\n */\n const held = doc.createDocumentFragment();\n state._parks.add(held);\n state._observer.observe(held, WATCHING);\n if (isAssigned) for (const node of fallback) held.appendChild(node);\n if (isAssigned)\n for (const node of assigned!) {\n bucketOf(state, name).push(node);\n state._names.set(node, name);\n /**\n * RANKED, like every captured node — the adoption walk visits slots in document order and\n * the server preserved within-name order, so sequential ranks reproduce the light tree.\n * Without this, adopted nodes had NO rank: every later rank-ordered merge (a re-slot's\n * splice, take's interpolation) compared against `undefined` and misplaced them — found by\n * the run-18 adopted-seam storms as membership-right, ORDER-wrong divergences from native.\n */\n state._rank.set(node, state._next++);\n }\n const binding: Binding = {\n _start: start,\n _end: end,\n _name: name,\n _fallback: held,\n _assigned: isAssigned,\n _slot: slot,\n _shown: [],\n _queued: false,\n };\n const seam = bind(state, binding);\n /** The server already put the assignment in place, so nothing is filled here — but a slot that\n * HAS an assignment has just been flattened, and the platform fires `slotchange` for that. A\n * hydrated component therefore hears the same first event a client-rendered one does. */\n if (isAssigned) {\n binding._shown = assigned!.slice();\n signal(state, binding);\n }\n drain(state);\n return seam;\n};\n(takeOverSlot as { _$adopt$?: typeof adoptSlot })._$adopt$ = adoptSlot;\n\n/**\n * HYDRATION rescue — **the user's content must survive a mismatch.** When adoption fails, the\n * hydrator discards the container's server markup and clean-renders it; for a light host the\n * user's slotted nodes are *inside* that markup, so the discard destroyed them and the slots\n * showed fallback, under a warning promising the page was still correct. It was not: content was\n * gone from the page for good.\n *\n * This un-distributes instead: it lifts the user's nodes back out, using exactly the two things\n * the server states about them — a named node carries its own `slot`, and the default slot's\n * parent carries `data-vm-slotted=\"offset,count\"` — and returns them for the caller to re-attach\n * as the host's children. From there nothing is special-cased: the clean render captures them the\n * way it captures any first client render.\n *\n * **Never descends into another component.** A nested host's children are its own source, which\n * it will capture (or rescue) itself when it renders; taking them here would hand one component's\n * content to another. A custom element is therefore collected as a node and never entered.\n *\n * One documented edge: a component whose FALLBACK content carries a `slot` attribute\n * (`<slot name=\"a\"><i slot=\"a\">…</i></slot>`) has that fallback rescued as if the user wrote it.\n * The attribute is meaningless on fallback in native shadow DOM too — it only means anything on a\n * host's children — so the markup was already saying something it does not mean.\n */\nconst rescue = (host: Element): Node[] | null => {\n const rescued: Node[] = [];\n const collect = (parent: Element) => {\n const mark = parent.getAttribute(SLOTTED_ATTR);\n let from = -1;\n let until = -1;\n if (mark !== null) {\n const comma = mark.indexOf(',');\n from = Number(mark.slice(0, comma));\n until = from + Number(mark.slice(comma + 1));\n }\n let index = 0;\n for (let child = parent.firstChild; child !== null; child = child.nextSibling, index++) {\n if (index >= from && index < until) {\n rescued.push(child);\n continue;\n }\n if (child.nodeType !== 1) continue;\n const element = child as Element;\n /**\n * The inert carrier holds what no slot claimed — user content too, and its nodes live in\n * `content`, not `childNodes`.\n *\n * **The tag is checked, not just the attribute.** This walks the SERVER's subtree, which is\n * full of the user's own markup, and `data-vm-unassigned` on anything that is not a\n * `<template>` reached `.content` on an element that has none: a TypeError thrown out of\n * `renderInto`, so the mismatch never finished falling back and the page was left with no\n * client render at all. Reserved attribute or not, a user's markup cannot be allowed to do\n * that — and `capture` was already checking both.\n */\n if (element.localName === 'template' && element.hasAttribute(UNASSIGNED_MARK)) {\n const held = (element as HTMLTemplateElement).content;\n for (let node = held.firstChild; node !== null; node = node.nextSibling) rescued.push(node);\n continue;\n }\n if (element.hasAttribute('slot')) rescued.push(element);\n else if (element.localName.indexOf('-') === -1) collect(element);\n }\n };\n collect(host);\n for (const node of rescued) node.parentNode?.removeChild(node);\n return rescued.length > 0 ? rescued : null;\n};\n(takeOverSlot as { _$rescue$?: typeof rescue })._$rescue$ = rescue;\n\n/**\n * The insert descriptor — `wire([renderer, slots])` and light-DOM slots exist.\n *\n * `fn` no longer needs a cast: `'slot'` is a declared insert point now, so this is checked against\n * `SlotInsert` rather than asserted past the type system. It used to be `as never`, which is what a\n * missing insert type looks like from the inside — and from the OUTSIDE it looked like\n * `wire([renderer, slots])` failing to compile for every TypeScript consumer.\n */\nexport const slots = {\n name: '@verajs/renderer/slots',\n on: 'slot' as const,\n fn: takeOverSlot,\n priority: 50,\n};\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EG;AA4IH,MAAM,KAAK,GAAG,IAAI,OAAO,EAAsB;AAC/C;AACA,MAAM,MAAM,GAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;AACzF;AACA,MAAM,KAAK,GAAG,IAAI,OAAO,EAAiB;AAC1C;;;;;;;;;AASG;AACH,MAAM,SAAS,GAAG,IAAI,OAAO,EAAc;AAE3C;;;;AAIG;AACH,MAAM,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE;AAEhG;;;;;;;;;;;;AAYG;AACH,MAAM,UAAU,GAAG,CAAC,IAAU,KAC5B,IAAI,CAAC,QAAQ,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAK,IAAgB,CAAC,YAAY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":["../../../shared-utils/src/diagnostic.ts","../../../shared-utils/src/diagnostics.ts","../../../shared-utils/src/markup-grammar.ts","../../../shared-utils/src/utils.ts","../../src/slots-diagnostics.ts","../../src/elements-diagnostics.ts","../../src/elements.ts","../../src/kinds.ts","../../src/slots.ts"],"sourcesContent":["/**\n * **Where every diagnostic code is explained.** The URL is permanent: a released bundle is immutable, so every version\n * published points here for ever — the domain cannot lapse and `/e/` cannot be reorganized without breaking links in\n * code nobody can edit; the docs site redirects instead. `scripts/sync-diagnostics.mjs` imports this constant, so the\n * pages and the bundles can never disagree about where they are.\n */\nexport const DOCS = 'https://verajs.dev/e/';\n\n/**\n * **What this copy of the framework has already said** (Brian's ruling, 2026-11-12): the ONE memory behind `warnOnce`, `errorOnce`\n * and `hasWarned`, for DEVELOPMENT-ONLY warnings. It replaced the hand-written once-flags every package kept\n * (`saidLists`, `warnedDrop`, per-element WeakSets, per-key Sets: two naming styles, Brian: no names). **A warning that\n * ships to production keeps its memory at its site** (bytes, measured 2026-11-12: the shared memory costs +80–145 B gz\n * per bundle); development-only warnings use warnOnce. Module state by necessity, since \"once\" spans every call on the\n * page. One per BUNDLE COPY, exactly the scope each flag had, because this package is inlined into every bundle.\n * A code, or `code key` for a string key, in a Set. An object key (an element, a setup function) in a WeakMap, so its\n * entry goes with the object. Marked pure, so a bundle that never prints once drops both.\n */\nconst printed = /* @__PURE__ */ new Set<string>();\nconst printedOn = /* @__PURE__ */ new WeakMap<object, Map<string, Set<unknown>>>();\n/**\n * A once's KEY: none (once per page), a string (once per that string), an object (once per that object: an element, a\n * class, a setup function), or the PAIR `[object, value]`, a value key on that object (a store write: the object and its\n * property; a keyed list: the list and the duplicate key, compared as the list compares them, by value, so `1` and `'1'`\n * stay apart). A pair is the only array a key may be.\n */\ntype OnceKey = string | object | readonly [object, unknown];\n/** Where an object key's (code, value) lives: the value set for that code on that object, made on demand. */\nconst valuesOn = (on: object, code: string, make: boolean): Set<unknown> | undefined => {\n let codes = printedOn.get(on);\n if (codes === undefined) {\n if (!make) return undefined;\n printedOn.set(on, (codes = new Map()));\n }\n let values = codes.get(code);\n if (values === undefined && make) codes.set(code, (values = new Set()));\n return values;\n};\n/** The object and value of an object or pair key. */\nconst split = (key: object): readonly [object, unknown] => (Array.isArray(key) ? (key as unknown as readonly [object, unknown]) : [key, undefined]);\n/** Whether (code, key) is new, recording it if so. */\nconst firstTime = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') {\n const entry = key === undefined ? code : `${code} ${key}`;\n if (printed.has(entry)) return false;\n printed.add(entry);\n return true;\n }\n const [on, sub] = split(key);\n const values = valuesOn(on, code, true)!;\n if (values.has(sub)) return false;\n values.add(sub);\n return true;\n};\n\n/**\n * **One shape for every diagnostic the framework prints** — the short line production keeps, the whole sentence\n * development adds — so a package converting its messages writes a table and a call, never its own format.\n *\n * production `[vera] hydration: element: found <i> — https://verajs.dev/e/hydration-fallback`\n * development `[vera] hydration: element: found <i> — fell back to a client render: … (hydration-fallback)`\n *\n * `subject` is the free information — what the code already has at hand, naming the problem area — the same in both\n * builds. `prose` is development only: the package's table entry (`Prose`), called behind `__DEV__` at the call site so\n * the table goes unreferenced in production and rollup drops it whole. Production prints the code inside the link, so\n * the reader is one click from the explanation, which `scripts/sync-diagnostics.mjs` publishes from the same tables.\n *\n * **Every production message is coded** (Brian, 2026-11-11; this supersedes \"convert where smaller\", 2026-10-02):\n * consistency over a few bytes, so no package keeps a hand-written production line beside its table.\n */\n/*\n * The parameter names are deliberately unlike anything a caller holds: terser will not inline a function whose\n * parameter shadows a name at the call site (measured 2026-10-02 — directives passes its own `code`, and a parameter\n * called `code` left `((e,t,n)=>`…`)(0,t,n)` in its bundle, +8 B; renamed, the call folds to the bare template).\n */\n/**\n * **A misused API, named by its function** — the thrown-error twin of `diagnostic()`: `untrack: expected a function …\n * (untrack-not-function)`, function-first because a stack already names the source and the sweep reads that shape. The\n * prose comes from a package's table, behind `__DEV__`, so a development-only guard costs production nothing.\n */\nexport const misuse = (forName: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${DOCS}${withCode}`;\n\n/**\n * **A misused API and what it was misused ABOUT** — `misuse()` with a subject, in `diagnostic()`'s ` — ` separator:\n * `parseFrontmatter: line 3 — https://verajs.dev/e/cms-frontmatter-unsupported`. The subject is the free information\n * (a line, a URL and its status) and prints in both builds. A sibling rather than an optional parameter on `misuse()`,\n * because `misuse()` is inlined into every bundle that throws and a conditional subject would tax all of them for a\n * shape few need; a sibling is tree-shaken where unused.\n */\nexport const misuseAbout = (forName: string, aboutSubject: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${aboutSubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${aboutSubject} — ${DOCS}${withCode}`;\n\nexport const diagnostic = (\n inArea: string,\n bySubject: string,\n withCode: string,\n andProse?: false | readonly [string, string?]\n) =>\n /** `__DEV__` HERE as well as at the call: production folds this to the one-line form, branch and all. */\n __DEV__ && andProse\n ? `[vera] ${inArea}: ${bySubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `[vera] ${inArea}: ${bySubject} — ${DOCS}${withCode}`;\n\n/**\n * **Text from outside — a file path, a YAML key, a URL, an error's message — quoted before it reaches a line.** A log is a\n * pipeline, and such text can be shaped by an author or a request: a newline in it forges a line, an ESC sequence hides\n * one (log injection). `JSON.stringify` escapes both; cut to 80 characters so one value cannot fill the log. @verajs/ssr\n * keeps a twin (it cannot import this), held equal by tests/ssr-coded-diagnostics.\n */\n/**\n * `max` caps the length (80 by default); `Infinity` keeps the whole text for a value worth reading in full — a site\n * owner's own path — which is still ESCAPED: truncation and escaping are separate jobs, and a path is not free of control\n * characters just because its owner wrote it (2026-10-09).\n */\nexport const quoted = (text: string, max = 80): string => JSON.stringify(text.length > max ? `${text.slice(0, max)}…` : text);\n\n/**\n * **The errors a package constructs, marked as its own** — so a wrapper that reports an inner refusal (cms's\n * `generateManifest` around a frontmatter line) carries it as it is: already formatted, its outside text already\n * quoted. Anything else is foreign, and quoted. Identity, never a shape test: a message can imitate ours, an identity\n * cannot. @verajs/ssr keeps a twin (it cannot import this).\n */\nconst ours = /* @__PURE__ */ new WeakSet<object>();\nexport const own = <E extends Error>(error: E): E => {\n ours.add(error);\n return error;\n};\nexport const isOwn = (error: unknown): boolean => typeof error === 'object' && error !== null && ours.has(error);\n\n/**\n * **Whether this copy has already said `code` (for `key`)**: for a GUARD only, where deciding to warn costs work worth\n * skipping once the warning is out (development's whole-tree walk for unwired directive attributes, an event-name\n * guess over every property of an element). A site that only prints calls `warnOnce`. Asks, never records.\n */\nexport const hasWarned = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') return printed.has(key === undefined ? code : `${code} ${key}`);\n const [on, sub] = split(key);\n return valuesOn(on, code, false)?.has(sub) === true;\n};\n\ntype Detail = false | readonly [string, string?] | (() => readonly [string, string?] | undefined);\n/**\n * The printer behind both, on one level. `andDetail` is `diagnostic()`'s prose, or a function returning it where building\n * the sentence costs something: it is called only the first time. `...andMore` rides beside the line behind '%s' (an\n * element, a thrown error), never inside it, so text from outside cannot forge a line. The console method is read at the\n * call, so a test that replaces `console.warn` sees it.\n */\nconst sayOnce =\n (level: 'warn' | 'error') =>\n (inArea: string, bySubject: string, withCode: string, andDetail?: Detail, forKey?: OnceKey, ...andMore: unknown[]): void => {\n if (!firstTime(withCode, forKey)) return;\n const line = diagnostic(inArea, bySubject, withCode, typeof andDetail === 'function' ? andDetail() : andDetail);\n if (andMore.length) console[level]('%s', line, ...andMore);\n else console[level](line);\n };\n/**\n * **A diagnostic said once per page** (per key, where one is given: a string, or an object such as the element it is\n * about): `diagnostic()`'s arguments, then the key, then what rides beside the line. Coded in production exactly as\n * `diagnostic()` is, because it IS `diagnostic()`. `errorOnce` is its twin on `console.error`, for a refusal a page should\n * not miss.\n */\nexport const warnOnce = /* @__PURE__ */ sayOnce('warn');\nexport const errorOnce = /* @__PURE__ */ sayOnce('error');\n","/**\n * **The codes more than one package prints — DEVELOPMENT ONLY, except to the jsx compiler** (2026-10-09). A\n * fact said by two emitters has\n * ONE docs page and ONE text, so its prose lives here, in the lowest dependency every emitter shares, and each raises\n * it as `SHARED['code']` — never a second sentence in a second table (the dev line would stop being the docs page's\n * text). Referenced only behind `__DEV__`, so production drops it whole — but the jsx COMPILER raises `voidChildren`\n * and `styleObject` in every build: a compile error is a build tool's only output, and Vite loads the production one. `scripts/sync-diagnostics.mjs` publishes it\n * as `packages/shared-utils/diagnostics.json`; the uniqueness check sees each code here once.\n *\n * Also the home of messages shared-utils' OWN code prints on a renderer's behalf (adopt-property, markup-grammar,\n * isSelection) — the same rule: the emitter is shared, so the text is.\n *\n * **One named export per code, never one object** (measured 2026-10-09): rollup cannot drop an unused KEY of\n * an object literal, so a shared `PROSE` object put every shared message into every importer's development bundle.\n * A named export is dropped per function. **The export's name IS the code** — `tagCalled` is `tag-called` — so the\n * map sync and the tests read is derived (`proseOf`, scripts/diagnostic-tables.mjs), never kept by hand, and a call\n * `SHARED.tagCalled(…)` names its code exactly once.\n */\nimport type { Prose } from './types.js';\n\n/**\n * core's `html`/`svg`/`mathml` and the renderer's `tag` — a tagged template called as a function. The FACT is shared;\n * the EXAMPLE is each emitter's: `html` writes markup, `tag` an element name — so the emitter passes it.\n */\nexport const tagCalled: Prose = (tag, received, example) => [\n `expected a template literal and received ${received}.`,\n `It is a tagged template — write ${tag}\\`${example}\\`, not ${tag}('${example}').`,\n];\n/** core's props adoption on an `init()` element, and the renderer's on any other element. */\nexport const getterOnlyProp: Prose = (key) => [\n `received a bound property \\`.${key}\\` (or \\`!${key}\\`), but its class declares \\`${key}\\` as a getter with no setter — the value cannot be delivered and the binding is ignored.`,\n 'Add a setter, or stop binding it.',\n];\n/** shared-utils' `adoptProperty` (renderer, spread): an element that never drains the record loses it at upgrade. */\nexport const upgradeClobber: Prose = (name) => [\n `the value bound to \\`${name}\\` was replaced while the element upgraded. A class field is the usual cause: at ES2022 \\`${name}?: …\\` emits \\`${name};\\`, which runs during upgrade and overwrites whatever was set beforehand.`,\n `Write it \\`declare ${name}?: …\\` instead. A component that calls init() adopts bound properties automatically and never sees this; this element did not. Ignore this if the component replaced the value on purpose.`,\n];\n/** shared-utils' `isSelection` (renderer, spread). */\nexport const selectMultiple: Prose = (name) => [\n `\\`${name}\\` controls only ONE selection here, and a selection the user adds is kept — it is not controlled.`,\n 'Bind `?selected=${…}` on each <option> to control every selection.',\n];\n/** shared-utils' `contentClash` (renderer, spread): a content-replacing property beside content of the element's own. */\nexport const contentClash: Prose = (tag, name, alone) => [\n `<${tag}> binds \\`.${name}\\`, which replaces the element's content, and also has content of its own — markup or a child binding, which the write would strand.`,\n `Bind one or the other: the property alone (\\`${alone}\\`), or the content alone.`,\n];\n/** shared-utils' `tagHole` (renderer; @verajs/ssr keeps a twin). */\nexport const tagHole: Prose = () => [\n 'an expression in tag position (`<${…}>`) cannot be a tag name — a tag name must be a tag value.',\n \"Use `tag`h1`` from @verajs/renderer/tag, with that entry's `html`.\",\n];\n/** core's `wire` (at wire time) and the renderer (a template built before slots was wired, at render). */\nexport const lateTemplateModule: Prose = () => [\n \"a 'template' or 'element' module (namespaces, elements, slots) was wired after the renderer had already built templates — those never ask it, and keep rendering without it.\",\n 'Wire it beside the renderer, before the first render.',\n];\n/** The renderer and spread (two bundles); @verajs/ssr refuses the same URLs silently today. */\nexport const scriptUrl: Prose = (name) => [\n `\\`${name}\\` was given a javascript: URL — refused, and the attribute removed.`,\n 'A bound URL is data, and data must never become code.',\n];\n/**\n * The renderer and spread: `kind` is what the value was (dev-values' `attributeValueKind`); `property` is the\n * emitter's own spelling of a property binding — a template's `.name=${value}`, a spread's `'.name': value`.\n */\nexport const attributeValue: Prose = (name, kind, property) => [\n `the attribute \\`${name}\\` was given ${kind}. An attribute value is a string and nothing else.`,\n `If the element is meant to RECEIVE this value, bind a property instead — \\`${property}\\` — which is how a custom element takes anything that is not text. If it is meant to be read as text, convert it where you know what it means: \\`date.toISOString()\\`, \\`list.join(' ')\\`. A Date in particular serializes with the SERVER's timezone on one side and the browser's on the other, so it will not survive hydration.`,\n];\n/** The renderer and spread: `type` is the value's `typeof`. */\nexport const notAListener: Prose = (name, type) => [\n `@${name} was given ${type === 'object' ? 'an object with no handleEvent method' : `a ${type}`}, which cannot listen — the event will do nothing.`,\n 'Pass a function, or an object with a handleEvent method. A missing handler is `undefined` or `false`, both of which are fine; this is neither.',\n];\n/** The renderer (and @verajs/ssr's twin): an expression inside an attribute NAME. */\nexport const nameExpression: Prose = (written, given) => [\n `an attribute name cannot be an expression — \\`${written}\\` is read by the parser before any value exists.`,\n `A name known only at runtime is a spread: \\`\\${spread({ [\\`${written}\\`]: ${given} })}\\` (from @verajs/renderer/spread).`,\n];\n/** The renderer (and, ruled 2026-10-09, @verajs/ssr): data shaped like a template, not made by `html`. */\nexport const forgedTemplate: Prose = () => [\n 'is shaped like a template but was not made by html`` — rendered as text.',\n 'A template from data (JSON, or html([markup])) is never markup; for trusted markup, bind it: <div .innerHTML=${markup}>.',\n];\n/** The renderer and spread (two bundles; @verajs/ssr refuses the same): binding `__proto__`. */\nexport const protoBinding: Prose = (written) => [\n `binds \\`${written}\\`, which would replace the element's own prototype and destroy it — no property write does this, and no use of it is legitimate.`,\n 'The binding is ignored.',\n];\n/** The renderer and spread: a bound `srcdoc` ATTRIBUTE. `property` is the emitter's spelling of the property binding. */\nexport const srcdocAttribute: Prose = (property) => [\n 'binds the `srcdoc` attribute, which renders its value as an HTML document — refused.',\n `If the markup is trusted and sanitized, bind the property: \\`${property}\\`.`,\n];\n/** The renderer and spread: a bound inline-handler attribute (`onclick`). `event` is the emitter's event spelling(s). */\nexport const handlerAttribute: Prose = (name, event) => [\n `binds the \\`${name}\\` attribute, which runs its value as code — refused.`,\n `Bind a function as an event instead: ${event}.`,\n];\n/**\n * The jsx compiler and the renderer's `tag` — children given to a void element. Both refuse; the FATE the refusal\n * prevents is each emitter's: compiled, they would land after the element; through `tag`, vanish.\n */\nexport const voidChildren: Prose = (tag, fate) => [\n `<${tag}> is a void element — it has no end tag and takes no children, so ${fate}; refused.`,\n 'Move the children out, or use an element that takes content.',\n];\n/** The jsx compiler and the renderer's `tag` — an object `style`. The EXAMPLE is each emitter's spelling. */\nexport const styleObject: Prose = (example) => [\n 'style expects a STRING, not an object.',\n `Build the string: ${example}.`,\n];\n/**\n * An option a module or loader does not have — autoloader(), directiveLoader(), router(), and the directives packs\n * remote(), sensors(), motion(). One fact and one fix; the module is the line's SUBJECT and the list is its own.\n */\nexport const unknownOption: Prose = (key, list) => [\n `\\`${key}\\` is not an option, so it was ignored.`,\n `The options are ${list}.`,\n];\n","import { misuse } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n/**\n * HTML's own element grammar — the facts about tags that every package emitting or reading markup\n * has to agree on.\n *\n * These are not this framework's rules; they are the parser's, and a package that guesses at them\n * produces markup whose *parse* differs from what its author wrote. That failure is silent by\n * nature: nothing throws, the page renders, and the DOM simply has a different shape than the\n * source said. See `VOID_ELEMENTS` below for the two measured instances.\n *\n * **Why here.** These sets had grown copies in `@verajs/ssr`, `@verajs/cms` and (as a regex) the\n * renderer, all agreeing by luck rather than by construction. This file is the one source for\n * every package that can take a build-time import — `@verajs/shared-utils` is private and inlined,\n * so importing it costs a consumer nothing at runtime and adds no published dependency.\n *\n * **`@verajs/ssr` cannot import it** and keeps its own copies: that package publishes its `src`\n * with no dependencies at all, so an import of a package that is never published would break the\n * published tarball. The same constraint already forced a twin of `escapeStyleText` there. A copy\n * is acceptable; a copy nothing checks is not, so `tests/markup-grammar-homes.test.mjs` drives\n * every copy against this file source-to-source rather than trusting they get edited together.\n *\n * **A consumer may keep a different SHAPE for the same fact** where a hot path needs one — the\n * renderer matches raw-text tags with a case-insensitive regex rather than lowercasing a string to\n * probe a `Set`. The rule is agreement, not representation, and the homes test asserts agreement\n * across whatever shape each home uses.\n */\n\n/**\n * Elements with no end tag, and therefore no children.\n *\n * Both directions of getting this wrong are silent, and both were live in this repo until the\n * audit of 2026-09-12 measured them:\n *\n * - **A non-void element written self-closing swallows what follows it.** HTML has no\n * self-closing syntax outside foreign content, so `<div/><span>after</span>` parses as\n * `<div><span>after</span></div>` — the sibling becomes a child. Every JSX toolchain treats\n * `<div/>` as an empty element, which is exactly why authors write it.\n * - **A void element written with an end tag is duplicated.** A parser reads `</br>` as *another*\n * `<br>`, so `<br></br>` renders two line breaks where the author wrote one.\n *\n * Inside `<svg>` and `<math>` the parser switches to foreign content, where XML self-closing *is*\n * honored — so neither rule applies there, and a consumer that checks must know where it is.\n */\nexport const VOID_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr',\n]);\n\n/**\n * Elements a parser reads the children of as text rather than as markup.\n *\n * Two pieces of measured lore travel with this list and are the reason it is not read off a spec:\n *\n * - `iframe` and `noscript` were once absent from the SSR copy, which built a tree no browser\n * builds — `<noscript><img src=\"x\"></noscript>` produced an element, so\n * `querySelectorAll('noscript img')` answered 1 where every engine answers 0.\n * - `noscript` is raw text only when scripting is ENABLED. Fragment parsing disables it, and\n * Chromium and WebKit then parse the content as markup while Firefox parses it as text — so a\n * binding inside `<noscript>` worked in two engines and painted the renderer's internal marker\n * onto the page in the third. Listing it is safe in both parses.\n *\n * jsdom is not the oracle for either: it parses with scripting disabled and agrees with the old,\n * wrong list.\n */\nexport const RAW_TEXT_ELEMENTS = new Set(['style', 'script', 'textarea', 'title', 'iframe', 'noscript']);\n\n/**\n * The hyphenated names SVG and MathML already define, which the custom-elements spec reserves — so a\n * dash in one of these does NOT make it a custom element.\n *\n * Measured, the one that matters: JSX treats a dash-named tag as a custom element and compiles its\n * attributes to PROPERTIES, which turned `<annotation-xml encoding=\"text/html\">` into\n * `.encoding=${…}`. The HTML parser decides that element is an integration point from the\n * ATTRIBUTE on its start tag, so HTML content inside was moved out of the `<math>` entirely, and a\n * custom element there was built MathML-namespaced and never upgraded — silent on the server and\n * the client alike. That is also the exact spelling the renderer's own warning recommends.\n */\nexport const RESERVED_ELEMENT_NAMES = new Set([\n 'annotation-xml', 'color-profile', 'font-face', 'font-face-src',\n 'font-face-uri', 'font-face-format', 'font-face-name', 'missing-glyph',\n]);\n\n/**\n * **A custom element, by its name:** a dash, except the eight names SVG and MathML already own (above). One\n * definition for every package that asks — `@verajs/jsx` compiles such a tag's attributes to properties, and\n * `@verajs/renderer/slots` captures such a host's children. (The renderer's own property paths ask a narrower\n * question, the bare dash, on its hot path; a reserved name never carries a property binding.)\n */\nexport const isCustomElementName = (tag: string): boolean =>\n tag.includes('-') && !RESERVED_ELEMENT_NAMES.has(tag.toLowerCase());\n\n/**\n * A URL whose scheme a browser reads as `javascript:` — navigating to one runs it, so a BOUND value\n * that parses this way is code arriving as data, never a link.\n *\n * Matched the way the URL Standard's parser reads a scheme, because that is the only reading that\n * matters: leading C0 controls and spaces are stripped, ASCII tab, LF and CR are removed anywhere, and\n * the scheme is case-insensitive. A check that only lowercases is bypassed by `\" jAvA\\tscript:\"`,\n * which every engine navigates to. React's blocking pattern is the same rule.\n *\n * `@verajs/ssr` keeps a twin (it cannot import this package), held to this one by\n * `tests/url-sinks.test.mjs`, so a server never emits a link the client refuses.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL = /^[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **Every bound name whose value is checked for a `javascript:` URL — and how.** One test answers both.\n *\n * Captured, checked from the start: the attributes (and their reflecting properties) whose value a browser\n * NAVIGATES to or loads as a document — links and areas (`href`, SVG's `xlink:href`), forms (`action`,\n * `formaction`), frames (`src`), and `<object data>`. `src` is matched on every element — refusing one on an `<img>`\n * costs nothing, since an image never runs it. Resource-only attributes (`poster`, `srcset`) are fetched, never run,\n * so they are not listed.\n *\n * Not captured, checked ITEM BY ITEM (`SCRIPT_URL_ITEM`): an SVG animation's values — `to`, `from`, `by`, `values`.\n * `<animate attributeName=\"href\" to=\"javascript:…\">` (or `<set>`, or `values`) writes its value onto the link it\n * animates, and clicking the link then RUNS it: measured 2026-09-30 in Chromium, Firefox and WebKit, through `href`\n * and `xlink:href` alike. Refused on EVERY element and whatever `attributeName` says, because `attributeName` can\n * itself be bound or spread, a server spread has no element to ask, and no legitimate value of any attribute by these\n * names starts with `javascript:` (a component's `to`, a router link's, is a URL too). **Only these names are checked\n * item by item**: an unanchored test scans the whole value for `;`, which on a bound `src` holding a data URI costs\n * ~0.45 ms per MB per update in Chromium and Firefox (measured 2026-09-30), where the anchored `SCRIPT_URL` stops at\n * the first character.\n *\n * Case-insensitive, because property spellings (`formAction`) and attribute spellings meet here. `@verajs/ssr` keeps\n * a twin, held to this one by `tests/url-sinks.test.mjs`.\n */\nexport const URL_SINK = /^(?:(href|src|action|formaction|xlink:href|data)|to|from|by|values)$/i;\n\n/**\n * `SCRIPT_URL` at the start of the value OR of any `;`-separated item of it — an animation's `values` list\n * (`\"#a;javascript:…\"`) applies every item in turn. Only for an animation's values (`URL_SINK`'s uncaptured names): a `;` inside an `href` is a path\n * character, and `/p;javascript:x` is a working link, never a script. Written out rather than derived from\n * `SCRIPT_URL`: the repeated text costs less gzipped than the code that would build it.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL_ITEM = /(?:^|;)[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **An inline event-handler attribute** — `on` and a letter, any case (`onclick`, `onLoad`, `onbeforeinput`): its\n * value is run as CODE, so a BOUND one is code arriving as data, refused by the template scanner, `spread` and the\n * server alike (a static `onclick=\"save()\"` is the author's own and untouched). Broad on purpose — it also refuses a\n * bound `once=`/`online=` attribute; the precise rule would need the platform's list of handler names. `@verajs/ssr`\n * keeps a twin, held to this one by `tests/inline-handlers.test.mjs`.\n */\nexport const INLINE_HANDLER = /^on./i;\n\n/**\n * **The properties that replace an element's whole content** — a binding to one owns the element's children, so it\n * cannot share the element with content of its own (markup, or a child binding the write would strand: a later commit\n * into it then throws on a missing parent). Development refuses the pair in the template scanner and in `spread` alike.\n */\nexport const CONTENT_PROPERTY = /^(?:textContent|innerHTML|innerText|outerHTML|outerText)$/;\n/**\n * Whether an element has content of its own that a content-replacing write would strand or lose: a child that is not\n * whitespace-only text (formatting whitespace loses nothing), or — `$content`, set in development by the renderer — a\n * child binding that owns the element whole and leaves no node behind until it commits. The element-specific `.text`\n * setters (`<a>`, `<option>`, `<title>`, `<script>`) are deliberately not in the list: a custom element's own `text`\n * prop is common, and would be refused for nothing.\n */\nexport const ownsContent = (element: Element): boolean => {\n if ((element as Element & { $content?: boolean }).$content === true) return true;\n for (let node = element.firstChild; node !== null; node = node.nextSibling)\n /**\n * An EMPTY text node is a child binding's anchor, not formatting: formatting whitespace is never empty. And\n * formatting is HTML's whitespace, `[ \\t\\n\\f\\r]` — not JS's `trim()`, which would let an ` ` be overwritten.\n */\n if (node.nodeType !== 3 || (node as Text).data === '' || /[^ \\t\\n\\f\\r]/.test((node as Text).data)) return true;\n return false;\n};\n/** `side` is the module the user wired — `renderer` for a template, `spread` for a spread. */\nexport const contentClash = (side: string, tag: string, name: string): never => {\n throw new Error(misuse(side, 'content-clash', __DEV__ && SHARED.contentClash(tag, name, side === 'spread' ? `<${tag} \\${spread({ '.${name}': … })}></${tag}>` : `<${tag} .${name}=\\${…}></${tag}>`)));\n};\n\n/**\n * **An expression in TAG-name position** (`<${x}>`, `</${x}>`, `<my-${x}>`) without `@verajs/renderer/tag`: no\n * element can be made from it — the parser reads a tag name before any value exists. Refused by the client in\n * development and by the server in every build, with one message. The tag entry splices a tag VALUE into the\n * statics before the renderer sees it, so only a non-tag ever reaches here.\n */\nexport const TAG_NAME_HOLE = /<\\/?[^\\s>]*$/;\nexport const tagHole = (side: string): never => {\n throw new Error(misuse(side, 'tag-hole', __DEV__ && SHARED.tagHole()));\n};\n","import type { HandlerHolder, Untracked } from './types.js';\nimport { diagnostic } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n\n/**\n * Get an object's type.\n *\n * @param obj The object\n * @return The type\n */\nexport const getType = (obj: unknown) => Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();\n\n/**\n * Weak collections need their per-key dependencies stored weakly, or tracking `weakMap.get(obj)`\n * holds `obj` and defeats the whole point of the type. Checked by type string rather than\n * `instanceof`, which fails across realms (iframes, `vm`).\n */\n/**\n * A WeakMap or WeakSet (or WeakRef) — read from `Symbol.toStringTag`, the tag `Object.prototype.toString` itself reads, so\n * the answer is the same (another realm's collections included) without building and lower-casing a string on every first\n * tracked read of every object.\n */\nexport const isWeakCollection = (item: unknown) => {\n const tag = (item as { [Symbol.toStringTag]?: unknown } | null)?.[Symbol.toStringTag];\n return typeof tag === 'string' && (tag[0] === 'W' || tag[0] === 'w');\n};\n\n/**\n * Remove a trailing slash from an url if its not root url (`/`).\n *\n * @param str String to remove trailing slash from\n */\nexport const stripTrailingSlash = (str: string) => (str !== '/' && str.endsWith('/') ? str.slice(0, -1) : str);\n\n/**\n * **Reports an error nothing else handled, the way the platform reports one.** `reportError` fires\n * the window's `error` event — what `window.onerror`, error trackers and test runners listen for —\n * without unwinding the caller, so one failing hook or ref never stops its siblings. A bare\n * `console.error` reached none of those: a component could stop updating while every page-error\n * listener stayed silent. Off-browser (Node has no `reportError`) the console is all there is.\n * `line` is the framework's own line, printed beside the error — a CODED one (2026-10-09):\n * each caller passes `'[vera] <code>'` in production and its table's `diagnostic()` sentence in development, both\n * literal codes at the call site, so the static checks read them. The subject is fixed wording too (`a hook`, `an\n * element ref`), never a tag name: this line is the console's FORMAT (no `'%s'`, which measured +2–3 B on the renderer\n * bundles), so nothing from outside may reach it — the element goes to the `'error'` handlers instead. Production prints it only where the platform has no\n * `reportError` (Node); in a browser, `reportError` alone reports.\n *\n * Shared by core (a hook threw) and the renderer (a ref threw) so the fallback is one rule.\n */\nexport const reportUncaught = (error: unknown, line: string) => {\n if (typeof reportError !== 'function') console.error(line, error);\n else {\n if (__DEV__) console.error(line, error);\n reportError(error);\n }\n};\n\n/**\n * **Reports what user code a render called threw — to the app's `'error'` chain, else as uncaught.** One rule for\n * every callback the framework runs on the user's behalf and survives: a hook (core), an element ref, and an element\n * claim's `create`/`mount`/`unmount` (the renderer). The caller catches at the call site and carries on, so one\n * failing callback never stops its siblings or leaves a commit half applied. `element` is the component the error\n * belongs to, handed to each handler. Every throw is reported — nothing is deduped, as a hook's never was.\n * **Core keeps a deliberate twin** (`reportHookError`, the same rule as a `forEach`): routed through here it measured\n * +11 B gzip on `vera.min.js` (2026-10-09). A change to the rule changes both.\n */\nexport const reportTo = (handlers: readonly unknown[] | undefined, error: unknown, element: Element | undefined, line: string) => {\n if (handlers?.length) for (const handler of handlers) (handler as (error: unknown, element?: Element) => void)(error, element);\n else reportUncaught(error, line);\n};\n\n/** The component a render root belongs to: a shadow root's host, or a light root itself. */\nexport const hostOf = (root: Node | null | undefined): Element | undefined =>\n root == null ? undefined : root.nodeType === 11 ? (root as ShadowRoot).host : (root as Element);\n\n/** `fn(a, b, c)`, tracked as the caller is — the stand-in for core's `untracked` when no core was wired. */\nexport const call: Untracked = (fn, a, b, c) => fn(a!, b!, c!);\n\n/**\n * **Runs a bound handler, and its callers run it UNTRACKED**: the renderer's template `@event` and spread's event key,\n * each through `untracked(dispatch, holder, event)` (2026-10-09). An effect that fires an event synchronously\n * (`el.click()`, `focus()`, `dispatchEvent`) runs the handler INSIDE itself, and the handler's reads subscribed the\n * effect: a handler doing `state.n++` made the effect re-run on every click, a self-feeding loop held to one round per\n * frame, forever (measured). A handler's reads are event-time decisions, never a hook's inputs. The directives engine's\n * delegated `listen` makes the same choice its own way. A function is called with the element as `this`; an object\n * through its `handleEvent`. One function for both callers (Brian's size-audit ruling, 2026-11-13): it was two\n * identical copies, so a fix had two addresses; each bundle still inlines its own.\n */\nexport const dispatch = (holder: HandlerHolder, event: Event) => {\n const handler = holder._handler as EventListener | EventListenerObject | null;\n if (typeof handler === 'function') handler.call(holder._element as never, event);\n else if (typeof handler?.handleEvent === 'function') handler.handleEvent(event);\n};\n\n/**\n * **Whether a property binding is a `<select>`'s SELECTION** — `value` or `selectedIndex` — which the renderer and\n * `spread` both treat as live: re-asserted every render and compared against the live value (as `!value` is), because\n * a select's options can be replaced under an unchanged value, which drops the selection. One rule, asked once per\n * binding by both, so a template and a spread key cannot disagree about it.\n *\n * In development it names the one shape it cannot serve: on a `<select multiple>` both properties read and set a\n * SINGLE selection, so a selection the user adds is kept rather than controlled. Always writing there was measured\n * 2–3% slower on every table with a select per row, to serve an API that does not fit — hence a warning, not a cost.\n */\nexport const isSelection = (element: Element, name: unknown) => {\n if ((name !== 'value' && name !== 'selectedIndex') || element.localName !== 'select') return false;\n return true;\n};\n\n/**\n * Development: the one shape a selection binding cannot serve, named by the module the user wired (`side`). Called only\n * behind `__DEV__` at each call site, so production keeps `isSelection` exactly as small as it was (a `side` argument on\n * it measured +1 B, a default +9 B on vera-renderer.min.js — 2026-10-09).\n */\nexport const saySelectMultiple = (element: Element, name: unknown, side: string) => {\n if (element.hasAttribute('multiple'))\n console.warn(diagnostic(side, '<select multiple>', 'select-multiple', __DEV__ && SHARED.selectMultiple(String(name))));\n};\n\n/**\n * `target[key]`, as a function — how a component's GETTER is read through `untracked`. Not `Reflect.get`: `untracked`\n * passes three arguments, and `Reflect.get`'s third is the RECEIVER — `undefined` there runs the getter with no `this`.\n */\nexport const read = (target: object, key: string) => (target as Record<string, unknown>)[key];\n\n/**\n * **What a thrown value says, whatever was thrown — and it never throws itself.** A caught value comes from author\n * code (a `resolve` option, a motion tick or vocabulary function), and JavaScript can throw anything: `null`, an object\n * with no prototype (`String()` finds no `toString`), one whose `toString` or `message` getter throws, a Proxy whose\n * traps throw. Formatting it naively replaced the real failure with an unrelated TypeError from inside the framework.\n * Anything unreadable becomes a fixed phrase; `Object.prototype.toString` is no fallback, since it reads\n * `Symbol.toStringTag` through a Proxy's trap too.\n *\n * **A deliberate duplicate of `thrownMessage` in `packages/ssr/src/vera/escaping.ts` — fix both copies.** `@verajs/ssr`\n * is compiled per file with no bundling, so it cannot import this private, unpublished package at run time;\n * `tests/thrown-message-copies.test.mjs` runs one table of thrown values against both, so they cannot drift.\n */\nexport const thrownMessage = (error: unknown): string => {\n try {\n if (error instanceof Error) return String(error.message);\n const message = (error as { message?: unknown } | null)?.message;\n return typeof message === 'string' ? message : String(error);\n } catch {\n return '[unprintable value thrown]';\n }\n};\n","/** **`@verajs/renderer/slots`' diagnostics — DEVELOPMENT ONLY.** Its bundle's own table, merged into the renderer's json. */\nimport type { Prose } from '@verajs/shared-utils';\n\nexport const PROSE: Record<string, Prose> = {\n 'slot-attributes': (slot, attributes) => [\n `${slot} carries ${attributes}, which does nothing in a light-DOM component: the slot element steps out of the page while it has content.`,\n 'Events, `name` and `&ref` all work here.',\n ],\n 'assigned-slot-unpatched': (kind) => [\n `this browser defines no \\`assignedSlot\\` getter on ${kind}.prototype, so slots left it alone: a light child of that kind reads what the platform answers.`,\n 'Read the assignment from the slot instead: `slot.assignedNodes()`, or `slotted(host, name)`.',\n ],\n 'slots-wire-too-old': () => [\n 'the `wire` that called slots did not hand it `wire` itself, so none of slots was wired: that core is older than this module.',\n 'Update `@verajs/core` (and `@verajs/inserts`) to the version that passes `wire` to connectors, beside this renderer.',\n ],\n 'observe-slots-option': (value) => [\n `\\`observeSlots: ${value}\\` is not a setting, so it reads as 'lazy' (the default): this component is observed from its first \\`<slot>\\` or light child.`,\n \"Set `observeSlots: 'eager'` to observe it from its first render, or leave it out.\",\n ],\n /** Two outcomes of one fact — a served page nothing hydrates — so one page, the outcome a parameter. */\n 'hydration-unwired': (outcome) => [\n `this page was server-rendered and nothing hydrates it, so ${outcome}.`,\n \"Wire `hydration` beside the renderer — `wire([renderer, hydration])` — and, where a light host holds the page's content, `hydrateSlots` with `slots`: `wire([renderer, hydration, slots, hydrateSlots])`.\",\n ],\n};\n","/** **`@verajs/renderer/elements`'s diagnostics — DEVELOPMENT ONLY.** Its bundle's own table, merged into the renderer's json. */\nimport type { Prose } from '@verajs/shared-utils';\n\nexport const PROSE: Record<string, Prose> = {\n 'claim-threw': (phase, outcome) => [\n `threw in ${phase}; its error is printed beside this line, and ${outcome}.`,\n \"Fix the claim's callback, or wire an 'error' insert to handle what claims throw.\",\n ],\n 'elements-hook-replaced': () => [\n \"a 'template' hook set an instance hook before `elements` (priority 10) and is replaced.\",\n 'Claim elements through the `element` insert instead of a second instance hook.',\n ],\n};\n","/**\n * **`@verajs/renderer/elements` — attach behavior to elements in templates.**\n *\n * ```js\n * const autofocus = { mount: (element) => element.focus() };\n * wire([renderer, elements, { on: 'element', fn: (el) => (el.hasAttribute('autofocus') ? autofocus : undefined) }]);\n * ```\n *\n * Every `'element'` claimant is asked about each element of a template ONCE, as the template is BUILT — on its\n * canonical content, so a tag and its static attributes are real and no binding is ever applied (a hydrated first\n * instance, whose elements are the server's with bound values in them, changes nothing). The answers are two flat\n * lists shared by every instance: element positions in document pre-order, and their behaviors. A template nobody\n * claimed anything in gets no instance hook at all. Each instance finds its claimed elements with one short walk to\n * those positions; once the render that created it has finished, each behavior's `mount` runs, and what it returns is\n * handed to `unmount` at teardown. Nothing runs per update.\n *\n * Built on the renderer's `'template'` insert and instance hook (`InstanceHook`); it imports nothing — the registry\n * arrives through its connector. An app that does not wire it pays nothing.\n */\nimport type { ElementBehavior, InstanceHook } from './types.js';\nimport { diagnostic, hostOf, reportTo } from '@verajs/shared-utils';\nimport { PROSE } from './elements-diagnostics.js';\n\ntype Claim = (element: Element) => ElementBehavior | undefined;\n\nlet registered: Map<string, unknown[]> | null = null;\n\n/**\n * **A claim's callbacks follow the ref rule** (Brian, 2026-10-09): user code a render calls is caught AT ITS CALL SITE\n * — so a template with no claims runs exactly the path it did — reported to the app's `'error'` chain with the\n * component it belongs to (else as uncaught), and the render, the other claims and the teardown carry on. A mid-commit\n * throw once left a component's root empty for good; `mount` propagating aborted every later claim's mount.\n */\nconst report = (error: unknown, root: Node | null, line: string) => reportTo(registered?.get('error'), error, hostOf(root), line);\n\n/**\n * **The next element of an instance in document pre-order, never leaving it.** A root is a fragment, or — for a\n * single-root template — its one element, which is then position 0. Bounded by the root rather than by the tree it\n * sits in, because a hydrated instance is already in the page.\n */\nconst firstIn = (root: Node): Element | null => (root.nodeType === 1 ? (root as Element) : (root as ParentNode).firstElementChild);\nconst nextIn = (node: Element, root: Node): Element | null => {\n if (node.firstElementChild !== null) return node.firstElementChild;\n for (let at: Element | null = node; at !== null && at !== root; at = at.parentElement)\n if (at.nextElementSibling !== null) return at.nextElementSibling;\n return null;\n};\n\n/**\n * One instance's claims until it mounts — its claimed elements and their behaviors, interleaved, where it rendered,\n * whether it was adopted — and then only what `unmount` needs. **The elements are released at mount**: per-instance\n * state that keeps DOM references past the moment it needs them costs every operation on the page (measured: ~7% on\n * select and swap of a table whose every row was claimed, operations that never touch it).\n */\ntype State = { f: (Element | ElementBehavior)[] | null; r: Node | null; a: boolean; k: unknown[] | undefined; d: boolean };\n\n/** The instance hook for one template, from the positions and behaviors its claimants answered. */\nconst hookFor = (positions: number[], behaviors: ElementBehavior[]): InstanceHook => ({\n $c: (instance, root, adopted) => {\n const found: (Element | ElementBehavior)[] = [];\n /**\n * ADOPTED, the instance arrives as its elements in template order (hydration pairs them): its live root already\n * holds what its nested parts rendered, so counting there would land on the wrong element.\n */\n const listed = Array.isArray(instance);\n let node = listed ? null : firstIn(instance as Node);\n let at = 0;\n for (let k = 0; k < positions.length; k++) {\n if (listed) node = (instance as readonly Element[])[positions[k]];\n else for (; at < positions[k]; at++) node = nextIn(node!, instance as Node);\n /**\n * At creation — before the first update, and before the instance is connected anywhere. A claim whose `create`\n * throws is reported and DROPPED for this instance (it never mounts or unmounts, being half made); the element\n * stays as the template built it — a claim inserts nothing — and every other claim carries on. The ref rule.\n */\n try {\n behaviors[k].create?.(node!, adopted);\n } catch (error) {\n report(error, root, __DEV__ ? diagnostic('elements', 'an element claim', 'claim-threw', __DEV__ && PROSE['claim-threw']('create', 'the render continued without it')) : '[vera] claim-threw');\n continue;\n }\n found.push(node!, behaviors[k]);\n }\n return { f: found, r: root, a: adopted, k: undefined, d: false } as State;\n },\n $m: (given) => {\n const state = given as State;\n /** Torn down before its render finished: it never mounts. */\n if (state.d) return;\n const found = state.f!;\n const context = { root: state.r, adopted: state.a };\n state.f = null;\n for (let i = 0; i < found.length; i += 2) {\n const behavior = found[i + 1] as ElementBehavior;\n let value;\n try {\n value = behavior.mount?.(found[i] as Element, context);\n } catch (error) {\n report(error, state.r, __DEV__ ? diagnostic('elements', 'an element claim', 'claim-threw', __DEV__ && PROSE['claim-threw']('mount', 'the others still mounted')) : '[vera] claim-threw');\n continue;\n }\n if (value !== undefined && behavior.unmount !== undefined) (state.k ??= []).push(found[i], behavior, value);\n }\n },\n $q: (given) => {\n const state = given as State;\n state.d = true;\n const kept = state.k;\n if (kept !== undefined)\n for (let i = 0; i < kept.length; i += 3)\n try {\n (kept[i + 1] as ElementBehavior).unmount!(kept[i + 2], kept[i] as Element);\n } catch (error) {\n report(error, state.r, __DEV__ ? diagnostic('elements', 'an element claim', 'claim-threw', __DEV__ && PROSE['claim-threw']('unmount', 'the rest of the teardown ran')) : '[vera] claim-threw');\n }\n },\n});\n\n/**\n * Asks the claimants about the template's canonical content, once, as it is built — and gives it an instance hook\n * only if something was claimed. The content is READ, never changed (see the `'template'` insert's contract).\n */\nconst claimTemplate = (built: object, _result: unknown, _readScope: unknown, root: Node) => {\n const claims = registered?.get('element') as Claim[] | undefined;\n if (claims === undefined || claims.length === 0) return;\n const template = built as { _$inst$?: InstanceHook };\n if (__DEV__ && template._$inst$ !== undefined)\n console.warn(diagnostic('elements', 'template', 'elements-hook-replaced', __DEV__ && PROSE['elements-hook-replaced']()));\n const positions: number[] = [];\n const behaviors: ElementBehavior[] = [];\n let at = 0;\n for (let node = firstIn(root); node !== null; node = nextIn(node, root), at++)\n for (let i = 0; i < claims.length; i++) {\n const behavior = claims[i](node);\n if (behavior !== undefined) {\n positions.push(at);\n behaviors.push(behavior);\n }\n }\n if (positions.length > 0) template._$inst$ = hookFor(positions, behaviors);\n};\n\n/** Wire it as `wire([renderer, elements, …claims])`. A bare module: it has no options. */\nexport const elements = [\n (registry: Map<string, unknown[]>) => {\n registered = registry;\n },\n { name: '@verajs/renderer/elements', on: 'template' as const, fn: claimTemplate, priority: 10 },\n];\n\nexport type { ElementBehavior } from './types.js';\n","/**\n * **The renderer's binding kinds and child-part modes** — numbers both `renderer.ts` and the separately bundled\n * `hydration.ts` read, from ONE source (each bundle inlines them; they are literals in the output). A change here\n * changes the hand-off's protocol: bump `$V` in `renderer.ts`.\n */\n/** A binding's kind, resolved once per template. */\nexport const IGNORED = 0; // consumed, nothing rendered: inside a comment, the later values of a multi-part attribute\nexport const CHILD = 1; // anchored on a primed empty text node the template carries\nexport const SOLE = 2; // its element's only content: no anchor in the template, the first commit writes `textContent`\nexport const ATTR = 3;\nexport const PROPERTY = 4;\nexport const BOOLEAN = 5;\n/** `EVENT` through `ADOPT` hold a `Slot` record in their node slot — one range test, in `instantiate` and `commit`. */\nexport const EVENT = 6;\n/** An element-position expression: a ref, or a value that applies itself (`_$apply$`). */\nexport const REF = 7;\n/** An element-position expression ON a `<select>`: a value applying itself there (a spread) waits for `flush`. */\nexport const SELECT_REF = 8;\n/** `.name` on a custom element — see `adoptProperty` in shared-utils. */\nexport const ADOPT = 9;\n/**\n * Kinds from here on re-assert on EVERY render, so the update loop never skips them as unchanged:\n * `!name` writes from the live DOM's point of view (a sibling radio's click unchecks this one with no\n * event on it), and a `<select>`'s selection is re-applied after its options exist — see `flush`.\n */\nexport const LIVE = 10;\n/** A `<select>`'s selection — `value` or `selectedIndex` (`isSelection`) — written when the pass ends: see `flush`. */\nexport const SELECT = 11;\n/** `!name` on a custom element: compared against the LIVE value — read through `untracked`, it is the component's getter. */\nexport const LIVE_CUSTOM = 12;\n/** A binding that must never write — and, from here on, the kinds `commit` handles before anything is computed. */\nexport const REFUSED = 13;\n/** A `<select>`'s `selectedIndex` — the rare spelling of its selection, queued as `SELECT` is (see `flush`). */\nexport const SELECT_INDEX = 14;\n\n\n/** A child part's mode: what its range currently holds. */\nexport const EMPTY = 0;\nexport const TEXT = 1;\nexport const TEMPLATE = 2;\nexport const LIST = 3;\nexport const NODE = 4;\n\n/**\n * **The hydration hand-off's positions** — the renderer sets `$H` to an array at `connect`, and `hydration.ts` reads\n * it by these. An array, not an object of named fields: the names cost every app bytes (−35 B gzipped measured,\n * 2026-10-02), and these constants inline to literals in both bundles. The first two are FROZEN across protocols — a\n * hydration from another release reads the protocol at 0 and, on a mismatch, can still install its clearing hook at 1.\n * Any other change here is a protocol change: bump `PROTOCOL`.\n */\n/**\n * **The protocol of this package's first-party seams** — the renderer's hand-off (`$H`, at `HANDOFF_PROTOCOL`) and slots'\n * capture (`_$capture$`), both read by hydration. One number for both: the three ship in one package, and a change to\n * either seam bumps it. A hydration that meets another number declines (the page renders fresh) and says so.\n */\nexport const PROTOCOL = 1;\n/** The protocol number — FROZEN at 0. */\nexport const HANDOFF_PROTOCOL = 0;\n/** The first-render hook's setter — FROZEN at 1. */\nexport const HANDOFF_ADOPTER = 1;\nexport const HANDOFF_GET_TEMPLATE = 2;\nexport const HANDOFF_CHILD_PART = 3;\nexport const HANDOFF_INSTANCE = 4;\nexport const HANDOFF_SLOT = 5;\nexport const HANDOFF_UNSET = 6;\nexport const HANDOFF_UPGRADED = 7;\nexport const HANDOFF_COMMIT = 8;\nexport const HANDOFF_COMMIT_AS = 9;\nexport const HANDOFF_HOOK_UP = 10;\nexport const HANDOFF_RESOLVE = 11;\nexport const HANDOFF_ROOTS = 12;\nexport const HANDOFF_TO_TEXT = 13;\nexport const HANDOFF_REMOVAL_WORK = 14;\n","/**\n * **`@verajs/renderer/slots` — `<slot>` in a light-DOM component.** `wire([renderer, slots])`.\n *\n * A component that renders into its own element (no shadow root) gets the platform's slot assignment for the\n * children the page gave it: each light child goes to the first `<slot>` of its `slot` name (the default slot for\n * text and unnamed elements), a slot with nothing assigned shows its own content (the fallback), and comments are\n * never assigned.\n *\n * **The renderer knows nothing of it.** A host's light children are divided into UNITS: each static child alone, and\n * each run a binding of the page's template wrote (its markers and everything between them) whole. A unit moves as\n * one piece — never split — so every write the renderer later makes inside it lands where the unit now is, and the\n * renderer's own range stays contiguous. While a `<slot>` has content, the element steps out of the page and its\n * content stands in its place, between this module's two comments; with none, the element is back, showing its\n * fallback. What the page's template later does inside a unit is seen by a `MutationObserver` and re-distributed —\n * synchronously after every component render (core's `'render'` insert), and at the latest by the next microtask.\n */\nimport { diagnostic, isCustomElementName, SHARED, warnOnce } from '@verajs/shared-utils';\nimport { PROSE } from './slots-diagnostics.js';\nimport { elements } from './elements.js';\nimport { PROTOCOL } from './kinds.js';\n\n/** A slot's assignment name: an element's `slot` attribute, `''` for text; a comment is never slottable. */\nconst slotNameOf = (node: Node): string | null =>\n node.nodeType === 3 ? '' : node.nodeType === 1 ? ((node as Element).getAttribute('slot') ?? '') : null;\n\n/**\n * A light unit: a static child the page wrote (`a === z`), which moves as itself; or a RUN one of its template's\n * bindings writes, between this module's own two comments, which never leaves holding — the renderer walks it there,\n * contiguous, and each node of it a slot takes leaves a STAND-IN comment at its place. Every light node goes to the\n * slot its own `slot` names, exactly as the platform assigns.\n */\ntype Unit = { a: Node; z: Node };\n/** One `<slot>` of a light host: while it has content, `rs`/`re` stand in its place and the element is out. */\ntype Rec = { slot: Kept; light: Light; rs: Comment | null; re: Comment | null; shown: Node[]; queued: boolean };\n/** `_$region$`: a filled slot's region handed over before it mounts — by hydration, the server's two markers. */\ntype Kept = HTMLSlotElement & { $rec?: Rec; _$region$?: [Comment, Comment] };\n\n/** A host's light children, by unit, in the order the page wrote them, and its slots. */\n/**\n * `wait`: captured by a template that placed runs into this host during hydration, before the host's own slots exist —\n * nothing distributes until the first of them mounts, so the nodes stay exactly where the server put them.\n */\ntype Light = { host: Element; units: Unit[]; holding?: HTMLElement; recs: Rec[]; dirty: boolean; fresh: boolean; late: boolean; wait: boolean; obs?: MutationObserver; ex?: boolean; hw?: boolean; ho?: boolean; cw?: boolean; hh?: boolean };\n\n/**\n * **Unassigned content stays CONNECTED, as under native slots** — it waits in `<ins hidden data-vm-unassigned>`, the\n * host's first child, rather than out of the page: a component in it keeps running, and assigning or unassigning it is a\n * one-op connected move, which core keeps alive. The container is in the host exactly while it holds a light node —\n * runs' markers and stand-ins are comments, which need no connection — so a host with nothing unassigned has no extra\n * child, and the server, which knows only nodes, emits the same element in the same place.\n *\n * **Why `<ins>`** (Brian, 2026-10-08), measured in all three engines: a standard element, so it is valid HTML and\n * `:defined` (the carrier was `<vm-unassigned>`, a dashed name nothing defined, which discovery loaders tried to import\n * and \"wait until everything is defined\" checks waited on forever); its content model is TRANSPARENT, so it is valid\n * around whatever it holds (a `<span>` holding a `<section>` is not); and it parses inside a `<p>` where a `<div>` would\n * close the paragraph and eject the host's content. It is known by its attribute: a user's own `<ins>` is light content\n * like any other.\n */\nconst UNASSIGNED = 'data-vm-unassigned';\n/** Into the page before a light node moves in, so the move is connected → connected. */\nconst park = (light: Light) => {\n const holding = holdingOf(light);\n if (holding.parentNode !== light.host) light.host.insertBefore(holding, light.host.firstChild);\n watchHolding(light);\n return holding;\n};\n/**\n * At the end of every pass: in the page exactly while it holds a light node — out once only comments remain, and IN if\n * the renderer wrote a new node straight into a run waiting here while it was out (that node's first connection).\n */\nconst unpark = (light: Light) => {\n const holding = light.holding;\n if (holding === undefined) return;\n for (let node = holding.firstChild; node !== null; node = node.nextSibling) if (node.nodeType !== 8) return void park(light);\n holding.remove();\n};\n\n/**\n * **Each host's light, kept ON the host** — under this module copy's own `Symbol` (2026-10-17, candidate B): every\n * component's render end asks whether its container has a light (`_$done$`), and for one that does not — a plain\n * component — that is now a missing-property read, never a WeakMap lookup. Only a host that gets a light carries the\n * field; host → light → host is a DOM↔JS cycle, so `release` clears it. The same get/has/set/delete surface as the\n * WeakMap it replaces, so hydrate-slots, handed it through the protocol, is unchanged.\n */\nconst LIGHT = Symbol();\ntype Lit = Element & { [LIGHT]?: Light };\nconst HOSTS = {\n get: (host: Element) => (host as Lit)[LIGHT],\n has: (host: Element) => (host as Lit)[LIGHT] !== undefined,\n set: (host: Element, light: Light) => {\n (host as Lit)[LIGHT] = light;\n },\n delete: (host: Element) => {\n (host as Lit)[LIGHT] = undefined;\n },\n};\n/** The static children an outer template gave a host, recorded when its instance was created (see `hostBehavior`). */\nconst STATICS = new WeakMap<Element, Set<Node>>();\n/** A run's node in a slot, and the comment holding its place in the run — both ways. */\nconst STAND = new WeakMap<Node, Comment>();\nconst REAL = new WeakMap<Node, Node>();\n/** The slot a light node was placed in (`null`: holding). */\nconst PLACED = new WeakMap<Node, Rec | null>();\n/**\n * A light node CAPTURED WHERE IT STANDS — outside the host, in a slot's region (the server put it there) — before that\n * slot has mounted: where it is, it stays. Slots mount one at a time, and a node waiting for a later one would otherwise\n * read as taken away (see `isWhere`).\n */\nconst ADOPTED = {} as Rec;\n\n/** The host's light children in the order the page wrote them — a run read through its stand-ins. */\nconst lightOf = (light: Light): Node[] => {\n const out: Node[] = [];\n for (const unit of light.units) {\n if (unit.a === unit.z) out.push(unit.a);\n else for (let node = unit.a.nextSibling; node !== null && node !== unit.z; node = node.nextSibling) out.push(REAL.get(node) ?? node);\n }\n return out;\n};\n/** A stand-in is dropped: its node is no longer in a slot (back at its place, or gone). */\nconst unstand = (node: Node) => {\n const stand = STAND.get(node);\n if (stand === undefined) return;\n STAND.delete(node);\n REAL.delete(stand);\n stand.remove();\n};\n\n/**\n * **Where a light node physically is.** A `<slot>` can itself be a light child of another host — slot FORWARDING — and\n * while it has content it is out of the page, its content standing in its place between its two comments: that range is\n * where the node is, and moving the node moves the range.\n */\nconst firstOf = (node: Node): Node => (node as Kept).$rec?.rs ?? node;\nconst lastOf = (node: Node): Node => (node as Kept).$rec?.re ?? node;\n/** A light node moved before `ref` in `parent` — the whole range of a forwarded slot that is out of the page. */\nconst move = (parent: Node, node: Node, ref: Node | null) => {\n const last = lastOf(node);\n for (let at: Node | null = firstOf(node); at !== null; ) {\n const next: Node | null = at === last ? null : at.nextSibling;\n parent.insertBefore(at, ref);\n at = next;\n }\n};\n\n/** A run's node that sits in a slot, its place in the run held by a comment before `ref` in `parent` — both ways. */\nconst standIn = (node: Node, parent: Node, ref: Node | null) => {\n const stand = node.ownerDocument!.createComment('');\n parent.insertBefore(stand, ref);\n STAND.set(node, stand);\n REAL.set(stand, node);\n};\n\n/** A light node back to holding: a run's node to its place in the run (where its stand-in is), any other to the end. */\nconst toHolding = (light: Light, node: Node) => {\n const stand = STAND.get(node);\n if (stand !== undefined) {\n move(park(light), node, stand);\n unstand(node);\n PLACED.delete(node);\n } else {\n move(park(light), node, light.holding!.lastChild);\n PLACED.set(node, null);\n }\n};\n\n/* ── tree order, through slots that are out of the page ────────────────────────────────────────── */\n\n/**\n * The positions that decide a slot's tree order: its own (its element, or the comment standing in its place), and,\n * while it sits inside another slot's element that is OUT of the page (a displaced fallback), that slot's position\n * first. `null` when the chain ends outside the host — a slot parked away by `hold`, which takes part in nothing.\n */\nconst chain = (rec: Rec): Node[] | null => {\n const out: Node[] = [];\n let node: Node = rec.rs ?? rec.slot;\n for (;;) {\n out.unshift(node);\n if (rec.light.host.contains(node)) return out;\n let root: Node = node;\n while (root.parentNode !== null) root = root.parentNode;\n const outer = (root as Kept).$rec;\n if (outer === undefined || outer.rs === null) return null;\n node = outer.rs;\n }\n};\n/** Whether `b` comes after `a` in tree order — the platform's `DOCUMENT_POSITION_FOLLOWING` bit. */\n// eslint-disable-next-line no-bitwise -- compareDocumentPosition answers in the platform's own bitmask\nconst follows = (a: Node, b: Node) => (a.compareDocumentPosition(b) & 4) !== 0;\nconst before = (x: Node[], y: Node[]) => {\n for (let i = 0; i < x.length && i < y.length; i++)\n if (x[i] !== y[i]) return follows(x[i], y[i]);\n return x.length < y.length;\n};\n\n/* ── distribution ──────────────────────────────────────────────────────────────────────────────── */\n\n/**\n * **A filled slot's region is bounded by two comments, spelled the same on both sides.** The client creates them here;\n * the server writes exactly them (`@verajs/ssr`), so a server-rendered host and a client-distributed one are the\n * same DOM down to comment data, and hydration ADOPTS the server's instead of creating its own. Measured 2026-10-07:\n * that end state hydrates faster than any marking that makes the client split text and create markers (Chrome −11%,\n * Firefox −37%, WebKit −9% on a worst case), and it needs no counting, so nothing depends on how the browser decodes\n * text. The data carries no slot name or index: pairing is positional, and a name could close the comment.\n */\nconst RANGE_START = '[';\nconst RANGE_END = ']';\n\nconst region = (rec: Rec) => {\n if (rec.rs !== null) return;\n const doc = rec.slot.ownerDocument;\n const parent = rec.slot.parentNode!;\n rec.rs = doc.createComment(RANGE_START);\n rec.re = doc.createComment(RANGE_END);\n parent.insertBefore(rec.rs, rec.slot);\n parent.insertBefore(rec.re, rec.slot);\n /** `removeChild`, never `remove()`: a kept slot's own `remove()` is the USER's (it unregions first, `removeSlot`). */\n parent.removeChild(rec.slot);\n watch(parent, rec.light);\n};\nconst unregion = (rec: Rec) => {\n if (rec.rs === null) return;\n rec.rs.parentNode?.insertBefore(rec.slot, rec.rs);\n rec.rs.remove();\n rec.re!.remove();\n rec.rs = rec.re = null;\n};\n/** What a slot shows goes back to holding, and the slot back in its place: every way a slot leaves runs this. */\nconst unplace = (rec: Rec) => {\n for (const node of lightOf(rec.light)) if (PLACED.get(node) === rec) toHolding(rec.light, node);\n unregion(rec);\n};\n/** The slot leaves its host's list of slots. */\nconst unlist = (rec: Rec) => rec.light.recs.splice(rec.light.recs.indexOf(rec), 1);\n\n/** `slotchange`, as the platform fires it: once per slot per change, after the change, on the slot element. */\nconst changed = (rec: Rec) => {\n if (rec.queued) return;\n rec.queued = true;\n queueMicrotask(() => {\n rec.queued = false;\n rec.slot.dispatchEvent(new (rec.slot.ownerDocument.defaultView!.Event)('slotchange', { bubbles: true, composed: false }));\n });\n};\n\n/**\n * Whether a node is in this host's holding or one of its slots' regions — or where the server put it (`ADOPTED`), which\n * holds until its slot mounts, as `isWhere` holds a static: a slot mounting first must not read the run's node in a\n * later slot's served region, not yet registered, as taken.\n */\nconst inLight = (node: Node, light: Light): boolean => {\n if (PLACED.get(node) === ADOPTED) return true;\n const parent = node.parentNode;\n if (parent === null) return false;\n if (parent === light.holding) return true;\n for (const rec of light.recs) if (rec.re !== null && rec.re.parentNode === parent) return true;\n return false;\n};\n/** Whether a light node is still where this module put it — false once something else took it (the user's adoption stands). */\nconst isWhere = (node: Node, light: Light): boolean => {\n const rec = PLACED.get(node);\n if (rec === ADOPTED) return true;\n const parent = firstOf(node).parentNode;\n if (rec === undefined) return parent === light.holding;\n /** `PLACED` is shared by every host: a node another host has placed is not this one's, wherever it sits. */\n return rec === null ? parent === light.holding : rec.light === light && parent !== null && parent === rec.re?.parentNode;\n};\n\n/**\n * **Every light node to its slot, in light order** — the whole decision, recomputed. A node something else took away\n * is forgotten first; then each name's first slot in tree order wins, its nodes go between its comments (a run's node\n * leaving a stand-in at its place), a slot left with nothing shows its fallback, and the rest wait in holding.\n */\n/**\n * A distribution in progress can render (a slotted component moved is reconnected, and renders): the render's end asks\n * for another, which waits for this one to finish and then runs.\n */\nlet busy = false;\nconst distribute = (light: Light) => {\n if (busy) {\n /**\n * Unreached outside the work set in every suite (18 hits, all already marked — a first connection is a fresh capture);\n * kept because the invariant requires a dirty light in work, and redundancy here is not proven. Unlike `settleIn`'s\n * mark (removed: its only caller marks first), this one is equivalent by observation only.\n */\n mark(light);\n return;\n }\n busy = true;\n try {\n do place(light);\n while (light.dirty);\n } finally {\n busy = false;\n }\n};\nconst place = (light: Light) => {\n light.dirty = false;\n /**\n * **THE INVARIANT: a slotted node moves in ONE DOM operation, connected → connected.** Core tells a move from a removal\n * by `isConnected` at `disconnectedCallback` (the platform runs it after the operation), so one `insertBefore` from\n * where the node is to where it goes keeps a slotted component alive; a hop through holding (a fragment) is a real\n * disconnect, and the component is torn down and set up again. `tests/core-keep-alive.test.mjs` pins it.\n *\n * **Captured and not yet distributed: placed straight from the host.** A node a slot takes moves host → slot in ONE\n * operation, which the platform — and core — see as a move, not a removal (`isConnected` stays true through it): a\n * slotted component is not torn down and set up again. Only what no slot takes, and a run's own markers, go to holding.\n */\n const fresh = light.fresh;\n /**\n * Parked only when the render ENDS (`ending`): its slots have all mounted by then, so a node no slot took really has\n * none. Parked earlier — at the first slot's mount — a node for a later slot would hop host → holding → slot, two\n * operations, and be torn down and set up again on the way.\n */\n /**\n * **What clears `fresh`: only a render that ENDS** (`_$done$`, after the commit). A first render that THROWS out of\n * `renderInto` skips it, and the host stays fresh — its captured children still where the page put them, its runs\n * still in the host — until a render completes. That is consistent, not stale: a failed commit mounts no slot (mounts\n * run at a render's end), so no region exists for `inRun` to misread, and a user's edit meanwhile is an ordinary\n * host record (`adopt`). Pinned in `tests/renderer-slots.test.mjs`.\n */\n if (ending) light.fresh = false;\n const host = light.host;\n /** Re-read, never a copy: holding is built at its first use (`holdingOf`), possibly during this pass. */\n const home = (node: Node) => firstOf(node).parentNode === light.holding || (fresh && firstOf(node).parentNode === host);\n light.units = light.units.filter((unit) => (unit.a === unit.z ? isWhere(unit.a, light) || (fresh && firstOf(unit.a).parentNode === host) : home(unit.a) && home(unit.z)));\n for (const unit of light.units)\n if (unit.a !== unit.z)\n for (let node = unit.a.nextSibling; node !== null && node !== unit.z; node = node.nextSibling) {\n const real = REAL.get(node);\n /** The renderer moves a run's nodes between this host's slots (beside a neighbor it follows); only leaving them all is a theft. */\n if (real !== undefined && !inLight(real, light)) {\n PLACED.delete(real);\n unstand(real);\n }\n }\n const live: { rec: Rec; at: Node[] }[] = [];\n /** A slot parked away (by `hold`) takes part in nothing — and what it shows waits with it, untouched. */\n const parked = new Set<Rec>();\n for (const rec of light.recs) {\n const at = chain(rec);\n if (at !== null) live.push({ rec, at });\n else parked.add(rec);\n }\n live.sort((x, y) => (before(x.at, y.at) ? -1 : 1));\n const winner = new Map<string, Rec>();\n for (const { rec } of live) {\n const name = rec.slot.getAttribute('name') ?? '';\n if (!winner.has(name)) winner.set(name, rec);\n }\n const nodes = lightOf(light);\n /** A static child moves as itself; only a node of a binding's RUN leaves a stand-in at its place. */\n const statics = new Set<Node>();\n for (const unit of light.units) if (unit.a === unit.z) statics.add(unit.a);\n const wanted = new Map<Rec, Node[]>();\n const taken = new Set<Node>();\n for (const node of nodes) {\n const name = slotNameOf(node);\n const rec = name === null ? undefined : winner.get(name);\n if (rec === undefined) continue;\n let list = wanted.get(rec);\n if (list === undefined) wanted.set(rec, (list = []));\n list.push(node);\n taken.add(node);\n }\n for (const { rec } of live) {\n const mine = wanted.get(rec) ?? [];\n if (mine.length > 0) {\n region(rec);\n const parent = rec.re!.parentNode!;\n /** Only what is out of place moves: a move disconnects and reconnects a component, re-running its lifecycle. */\n let previous: Node = rec.rs!;\n for (const node of mine) {\n const first = firstOf(node);\n if (first.parentNode === parent && first.previousSibling === previous) {\n previous = lastOf(node);\n continue;\n }\n /** A run's node, still at its place in holding: a stand-in takes the place before it leaves. */\n if (!statics.has(node) && home(node) && !STAND.has(node)) standIn(node, first.parentNode!, first);\n move(parent, node, previous.nextSibling);\n /** Marked as moved by slots: the renderer follows it here when it inserts beside it (see `into`). */\n (node as Node & { _$slotted$?: boolean })._$slotted$ = true;\n PLACED.set(node, rec);\n previous = lastOf(node);\n }\n }\n if (mine.length !== rec.shown.length || mine.some((node, i) => node !== rec.shown[i])) {\n rec.shown = mine;\n changed(rec);\n }\n }\n for (const node of nodes) {\n if (taken.has(node)) continue;\n const rec = PLACED.get(node);\n if (rec !== undefined && rec !== null && parked.has(rec)) continue;\n /** Adopted and waiting for its slot, which mounts later in the same render: it stays where the server put it. */\n if (rec === ADOPTED && !ending) continue;\n if (STAND.has(node) || (rec !== undefined && rec !== null) || (ending && statics.has(node) && node.parentNode === host)) toHolding(light, node);\n }\n /** A run captured in the host goes to holding now — its markers, stand-ins and unassigned nodes; its slotted nodes left in one move each. */\n if (fresh && ending)\n for (const unit of light.units)\n if (unit.a !== unit.z && unit.a.parentNode === host) {\n const run: Node[] = [];\n for (let node: Node | null = unit.a; node !== null; node = node.nextSibling) {\n run.push(node);\n if (node === unit.z) break;\n }\n const holding = holdingOf(light);\n for (const node of run) (node.nodeType === 8 ? holding : park(light)).insertBefore(node, holding.lastChild);\n watchHolding(light);\n }\n for (const { rec } of live) if (!wanted.has(rec)) unregion(rec);\n unpark(light);\n};\n\n/* ── the observer: what the page's templates (and the user) do afterwards ─────────────────────── */\n\n/**\n * **An observer per light** — never one shared by every host: Gecko's `observe()` is linear in what that observer\n * already watches, removed nodes included, through collections (2000 observes 4 → 45 ms over ten batches on one observer,\n * flat on a fresh one, flat on Chromium and WebKit), so a shared one made every new light host slower in Firefox without\n * end (2000 hosts: 262 → 9305 ms over eight renders that replaced them; flat now). A light's observer goes with it.\n *\n * From THIS module's own realm, which cannot close while its code runs — a MutationObserver watches nodes of another\n * document (measured on Chromium, Firefox and WebKit). Taking it from a host's window went deaf with that window: a\n * light host in an iframe or a popped-out window, closed later (`tests/browser/slots-realm.test.js`). The host's window\n * is the fallback only where this realm has no observer at all.\n */\nconst observerOf = (light: Light): MutationObserver => {\n const Observer = globalThis.MutationObserver ?? (light.host.ownerDocument.defaultView as typeof globalThis).MutationObserver;\n /**\n * Bound to their light (2026-10-17): a record can only reach a light through what THAT light registered, so it arrives\n * already knowing whose it is — no node → lights lookup, and no per-node bookkeeping (a WeakMap entry and a Set for every\n * watched node were ~164 ms of Chrome's slots creation at 10 000 hosts).\n */\n const handle = (records: MutationRecord[]) => {\n note(light, records);\n flush();\n };\n /**\n * ONE per light (2026-10-17; probe P3 vs P2: ~1 point of creation in each engine): its registrations are on distinct nodes —\n * the host's subtree for childList, each light element and slot for its attributes, holding and a fallback's region\n * parent for childList — so none replaces another's options, except a node both a light element and a slot (`own`).\n */\n return (light.obs ??= new Observer(handle));\n};\n/**\n * **A `hold()`-parked branch, watched while it is parked** — a slot's region in it is out of its host's subtree, where\n * the host's own attribute registration cannot see a node in it renamed (`slot=`): re-routed now, as native slots would.\n * One observer for every parked root (the renderer's `_$parked$`), registering the same root again when it parks again.\n */\nlet parkedObserver: MutationObserver | undefined;\n/** Each parked branch's owner — the container whose render parked it (a WeakMap on the parked root: parking is rare). */\nconst PARKED = new WeakMap<Node, Node>();\nconst parkedHandle = (records: MutationRecord[]) => {\n noteParked(records);\n flush();\n};\n/**\n * A light's pending records. A light in the work set (`all` false) is not asked while it has no childList registration\n * (its first render): its renames stay with the callback, and `takeRecords()` on every host every pass was ~114 ms of\n * Chrome's slots creation at 10 000 hosts (2026-10-17).\n */\nconst take = (light: Light, all = true): MutationRecord[] =>\n light.obs === undefined || (!all && light.ho !== true && light.cw !== true) ? [] : light.obs.takeRecords();\n/**\n * **This module's own moves, dropped** — what was pending before them was read at the start of the same pass. Nothing to\n * drop while the light has no childList registration (see `take`). A move never changes an attribute, so a rename found\n * here is someone else's (a moved element's `connectedCallback`): it marks its light and is followed after this pass.\n */\nconst drop = (light: Light) => {\n if (light.obs === undefined || (light.ho !== true && light.cw !== true)) return;\n for (const record of light.obs.takeRecords())\n if (record.type === 'attributes') {\n mark((record.target as Kept).$rec?.light ?? light);\n queueMicrotask(flush);\n }\n};\n/** A render is ending (the renderer's `_$done$`): captured children no slot took are parked now, not before. */\nlet ending = false;\n/** Records of this module's own moves, taken and dropped once it is done — they are not news. */\n/** How many nodes this batch has put ahead of everything, per host — so a batch's front insertions keep their order. */\nlet lead = new WeakMap<Light, number>();\n/** Whether THIS light watches `node` — its holding, a region's parent, one of its slots, or its host as a region parent. */\nconst watchedBy = (light: Light, node: Node) =>\n node === light.holding ||\n (node === light.host && light.hw === true) ||\n (node as Kept).$rec?.light === light ||\n light.recs.some((rec) => rec.re !== null && rec.re.parentNode === node);\n/**\n * The top of `node`'s tree as slots sees it: a FILLED slot has stepped out of the page, so from it the walk continues at\n * its region (where it stands in the page) — a slot in another slot's fallback is still the host's, though detached.\n */\nconst topOf = (node: Node) => {\n let at = node;\n for (;;) {\n const rec: Rec | undefined = (at as Kept).$rec;\n const up: Node | null = rec !== undefined && rec.rs !== null && rec.slot === at ? rec.rs : at.parentNode;\n if (up === null) return at;\n at = up;\n }\n};\n/** A slot the user removed: unmounted as the template's own teardown does, inside a flush (its records then dropped). */\n/** Whether `node` is the host's, walking through filled slots to where their regions stand. */\nconst insideHost = (node: Node, host: Element) => {\n for (let at: Node | null = node; at !== null; ) {\n if (at === host) return true;\n const rec: Rec | undefined = (at as Kept).$rec;\n at = rec !== undefined && rec.rs !== null && rec.slot === at ? rec.rs : at.parentNode;\n }\n return false;\n};\nconst handRemoved = (rec: Rec) => {\n unlist(rec);\n unplace(rec);\n mark(rec.light);\n};\n/**\n * A FILLED slot is not in the page (its region stands in its place), so its own `remove()` / `replaceWith()` cannot reach\n * what it shows: these put its content back to holding and the slot back in place first, then do what was asked — the\n * host's observer then finds it gone (`handRemoved`). ONE function each, shared by every slot (`this`, no closure).\n */\nfunction removeSlot(this: Kept) {\n const rec = this.$rec;\n if (rec !== undefined && rec.rs !== null) unplace(rec);\n (this.ownerDocument.defaultView as typeof globalThis).Element.prototype.remove.call(this);\n}\nfunction replaceSlot(this: Kept, ...nodes: (Node | string)[]) {\n const rec = this.$rec;\n if (rec !== undefined && rec.rs !== null) unplace(rec);\n (this.ownerDocument.defaultView as typeof globalThis).Element.prototype.replaceWith.apply(this, nodes);\n}\n/**\n * **A `<slot>` inserted BY HAND** (KNOWN fix, 2026-10-18): claimed as the template's own are, through `slotBehavior.mount`,\n * once the flush that found it is done (the mount flushes its light itself). Only a slot the component's template tree\n * holds counts: one inside the host's LIGHT content is light DOM, as natively it is no slot of this host.\n */\nlet claims: [HTMLSlotElement, Light][] = [];\n/**\n * Claimed in a MICROTASK, never inside the flush that found them: a template's own slot is found by the flush its own\n * `mount` begins with, BEFORE that mount gives it its record — claimed then, it was mounted twice (renderer-slots'\n * three-level chain). A microtask later every mount in progress has finished, and a template slot carries its record\n * (set once, never cleared), so only a slot no template made is claimed — a microtask later, the hand-edit rule.\n */\nlet claimQueued = false;\nconst findSlots = (light: Light, node: Node) => {\n if (node.nodeType !== 1) return;\n const element = node as Element;\n if (element.localName === 'slot') {\n if ((element as Kept).$rec === undefined) claims.push([element as HTMLSlotElement, light]);\n return;\n }\n /** Descendants only when there are any: the template's own small writes (a swapped `<i>`) stay one property read. */\n if (element.firstElementChild === null) return;\n const found = element.getElementsByTagName('slot');\n for (let i = 0; i < found.length; i++) if ((found[i] as Kept).$rec === undefined) claims.push([found[i] as HTMLSlotElement, light]);\n};\n/** Whether `slot` sits in the component's own tree — not inside a light node this module placed or holds. */\nconst ofTemplate = (slot: Node, light: Light) => {\n for (let at = slot.parentNode; at !== null; at = at.parentNode) {\n if (at === light.host) return true;\n if (at === light.holding || PLACED.has(at)) return false;\n }\n return false;\n};\nconst claimInserted = () => {\n claimQueued = false;\n const pending = claims;\n claims = [];\n for (const [slot, light] of pending)\n if ((slot as Kept).$rec === undefined && HOSTS.get(light.host) === light && ofTemplate(slot, light)) slotBehavior.mount(slot, { root: light.host });\n};\n/** The batch's added nodes, looked through for a hand-inserted slot — a pass of its own, so `note` stays small. */\nconst scanAdded = (light: Light, records: MutationRecord[]) => {\n for (const record of records) {\n if (record.type !== 'childList') continue;\n /** Read once: `addedNodes` is a DOM getter. */\n const added = record.addedNodes;\n for (let i = 0, n = added.length; i < n; i++) findSlots(light, added[i]);\n }\n};\nconst note = (light: Light, records: MutationRecord[]) => {\n /** Only a component observed from its first render ('eager') follows a `<slot>` inserted by hand — a lazy one pays nothing. */\n if (light.ex === true) scanAdded(light, records);\n lead = new WeakMap();\n let removed = false;\n for (const record of records) {\n const target: Node = record.target;\n if (record.removedNodes.length > 0) removed = true;\n /** An attribute record names the element: a slot's own name, or a node under something this light watches. */\n if (record.type === 'attributes') {\n const rec = (target as Kept).$rec;\n if (rec !== undefined) {\n mark(rec.light);\n continue;\n }\n /** A light node's own `slot=` — acted on only while it is still THIS light's (a registration stays on a node that left). */\n if (inLight(target, light) || target.parentNode === light.host) mark(light);\n continue;\n }\n /**\n * A watched node's children — holding, a region's parent, a slot — replayed into the runs (the host too, when a region\n * sits directly in it). Any other target in the host's subtree is the component's own template writing: not slotting.\n */\n if (target === light.host ? light.hw === true : watchedBy(light, target)) {\n mark(light);\n replay(light, record);\n }\n /** A host's own children: an addition outside its render's range is a new light child. */\n if (target === light.host) {\n /**\n * Until its first render ends, a run still sits IN the host — so what the renderer takes from it there (a node a slot\n * already took, through its stand-in) is read back as it is in holding. Missed, the stand-in went and its node stayed\n * in the slot: a commit during the host's own render left the old content beside the new.\n *\n * **Why the REMOVED half is the whole of it** — the invariant: while the run is physically in the host, every node the\n * renderer ADDS here lands exactly where the run is, between its own markers, so it is already in place and\n * `lightOf` reads it there (nothing to move; replaying it as a run neighbor would move the render's own markers);\n * every change inside a slot's region — a row added beside a node a slot took (`into` follows `_$slotted$` there),\n * or removed from it — is recorded on that region's parent, which is watched, and replayed in full (into the run\n * where it is — the host, while fresh: see `replay`). What a host\n * record alone can carry is a REMOVED stand-in: the one change that leaves state behind (its node, still in a slot).\n * Additions here are otherwise the render's own or a new light child (`adopt`).\n */\n if (light.fresh) unrun(light, record);\n for (const node of record.addedNodes) adopt(light, node);\n }\n }\n /**\n * **A `<slot>` removed BY HAND** (KNOWN fix, 2026-10-18) — it, or its region, left the host with something the user\n * removed (the slot, its parent, an ancestor). The template's own teardown unmounts a slot before removing it, and a\n * `hold()`-parked one stays registered, so whatever is gone from the host otherwise was removed by hand: unmounted like\n * the template's, its content back to holding, as natively it is unassigned. Checked once per batch that removed\n * anything, over this light's slots.\n */\n if (removed) for (let i = light.recs.length - 1; i >= 0; i--) {\n const rec = light.recs[i];\n const anchor = rec.rs ?? rec.slot;\n if (!insideHost(anchor, light.host) && !PARKED.has(topOf(anchor))) handRemoved(rec);\n }\n};\n/**\n * A `hold()`-parked branch's renames (`parkedObserver`, one for every parked root): routed by the node's own marks — a\n * slot's light, a placed node's slot's light, or the host it sits in — since no per-node watcher list exists any more.\n */\nconst noteParked = (records: MutationRecord[]) => {\n for (const record of records) {\n /**\n * A write into a parked branch (an applier resolving into it, the outer template committing there): it has left its\n * host's subtree, so it is replayed for the host whose render parked it — and only while it is still out (restored, the\n * host's own registration sees it, and replaying it twice would place it twice).\n */\n if (record.type === 'childList') {\n let top: Node = record.target;\n while (top.parentNode !== null) top = top.parentNode;\n const owner = PARKED.get(top);\n const light = owner === undefined ? undefined : HOSTS.get(owner as Element);\n if (light !== undefined && !light.host.contains(record.target) && watchedBy(light, record.target)) {\n mark(light);\n replay(light, record);\n }\n continue;\n }\n for (let node: Node | null = record.target; node !== null; node = node.parentNode) {\n const own = (node as Kept).$rec ?? PLACED.get(node);\n if (own) {\n mark(own.light);\n break;\n }\n const light = HOSTS.get(node as Element);\n if (light !== undefined) {\n mark(light);\n break;\n }\n }\n }\n};\n/**\n * **The lights that need work** — dirty, or fresh until their first render ends, never one waiting for its own slots\n * (`wait`): the only ones `flush` visits. A set of EVERY light ever seen held each removed host for good (a leak) and\n * made every flush walk them all — hydrating 2000 light hosts slowed 72 → 365 ms over ten renders that replaced them.\n * A light leaves once it is clean, or clean and disconnected (a first render that threw stays fresh); it comes back\n * through `mark`, or its own render's end (`_$done$`).\n */\nconst work = new Set<Light>();\n/** The one way a light asks to be distributed. */\nconst mark = (light: Light) => {\n light.dirty = true;\n if (!light.wait) work.add(light);\n};\n/**\n * **Applies what is pending, now** — after every component render, and before any read of the assignment. It reads the\n * records of the lights it can name: its `context` (the light being read, mounted into, or rendered), every light whose\n * element the finished render's `root` created (`FED` — an outer template changing a component's children is\n * distributed by the end of that render), the work set, and the parked branches. Any other light's records arrive at the\n * microtask, through its own observer: a light host changed DIRECTLY by the page's code is redistributed by the next\n * microtask, or at once when its slotted content is read through the slots API (`tests/slots-sync-reads.test.mjs`).\n */\nconst flush = (context?: Light, root?: Node) => {\n if (busy) return;\n const near: Light[] = [];\n if (context !== undefined) near.push(context);\n const fed = root === undefined ? undefined : FED.get(root);\n if (fed !== undefined) {\n /** A plain loop, no closure: an arrow capturing `root` would tax every call of this function (CLAUDE.md, V8). */\n const kept: WeakRef<Element>[] = [];\n const rooted = root!.isConnected;\n for (let i = 0; i < fed.length; i++) {\n const element = fed[i].deref();\n if (element === undefined) continue;\n /**\n * A host that LEFT a connected root is dropped now, not at a collection: a churned list re-filtered an array growing\n * with every removed row until GC (2026-10-18). Put back by hand it is still followed — by its own observer from its\n * first slot (a microtask later; a slots-API read flushes it at once), or by its first slot's reconcile. A render\n * into a DETACHED root keeps every entry (nothing of it is connected). A host moved by hand to another, connected\n * root stays here, distributed at this root's renders too: bounded and harmless.\n */\n if (!element.isConnected && rooted) continue;\n kept.push(fed[i]);\n const light = HOSTS.get(element);\n if (light !== undefined) near.push(light);\n }\n FED.set(root!, kept);\n }\n /** Each light's records, read by that light (they arrive knowing whose they are), then the parked branches'. */\n for (const light of near) note(light, take(light));\n /**\n * The work set's NAME records stay with their callback: distribution reads `slot=` from the DOM as it is, so a rename is\n * only a trigger — and a light being READ (`near`: the slots API, a mount, its own render) takes them now, so a read\n * right after a rename is current (tests/slots-sync-reads.test.mjs). ChildList records are taken in order, always.\n */\n for (const light of work) note(light, take(light, false));\n if (parkedObserver !== undefined) noteParked(parkedObserver.takeRecords());\n for (const light of work) {\n if (light.dirty || (ending && light.fresh)) {\n distribute(light);\n drop(light);\n }\n if (!light.dirty && (!light.fresh || !light.host.isConnected)) work.delete(light);\n }\n /** What this module just moved, recorded on the lights it read: not news. */\n for (const light of near) drop(light);\n if (claims.length > 0 && !claimQueued) {\n claimQueued = true;\n queueMicrotask(claimInserted);\n }\n};\n/** Whether `node` sits outside the host's subtree registration — detached, or inside a slot (which steps out with its content). */\nconst outside = (node: Node, host: Element) => {\n for (let at: Node | null = node; at !== host; at = at.parentNode) if (at === null || (at as Kept).$rec !== undefined) return true;\n return false;\n};\nconst watch = (node: Node, light: Light) => {\n /** The host's own subtree registration covers it; a region directly in the host also gets the region's handling. */\n if (node === light.host) {\n light.hw = true;\n return;\n }\n const observer = observerOf(light);\n /**\n * A slot: its own name only. A slot with content steps OUT of the page, so this is how a rename reaches it there; a\n * nested slot in its fallback is claimed and registered on its own. Re-registering replaces the options, so a node that\n * is also this light's light element keeps `slot=` too (the union; `own`).\n */\n if ((node as Kept).$rec !== undefined) {\n observer.observe(node, { attributes: true, attributeFilter: mineAlready(node) ? ['slot', 'name'] : ['name'] });\n return;\n }\n /** Holding (out of the page while empty) and a region's parent inside a slot's fallback (out with that slot): on themselves. */\n if (node === light.holding || outside(node, light.host)) {\n light.cw = true;\n observer.observe(node, { childList: true });\n }\n};\n/** A light element's own `slot=` — registered when its light is first observed (`register`) and on every arrival after (`adopt`, `replay`, `settleIn`). */\nconst OWN = Symbol();\nconst mineAlready = (node: Node) => (node as Node & { [OWN]?: boolean })[OWN] === true;\nconst own = (light: Light, node: Node) => {\n /** Not before the light is observed (`register`, at its first slot), which registers every light element it has then. */\n if (node.nodeType !== 1 || light.ho !== true) return;\n (node as Node & { [OWN]?: boolean })[OWN] = true;\n observerOf(light).observe(node, { attributes: true, attributeFilter: (node as Kept).$rec !== undefined ? ['slot', 'name'] : ['slot'] });\n};\n\n/**\n * A node added to a host after its render: a light unit, appended in light order — unless it is the render's own. The\n * render's range runs from the host's first comment to its last that is not one of this module's units (captured\n * light children not yet distributed sit before it); comments are never slottable, so none is adopted.\n */\nconst adopt = (light: Light, node: Node) => {\n if (node.nodeType === 8 || node.parentNode !== light.host || node === light.holding) return;\n const ours = new Set<Node>();\n for (const unit of light.units) ours.add(unit.a).add(unit.z);\n if (ours.has(node)) return;\n let first: Node | null = null;\n let last: Node | null = null;\n for (const child of light.host.childNodes)\n if (child.nodeType === 8 && !ours.has(child)) {\n first ??= child;\n last = child;\n }\n if (first !== null && first !== last && follows(first, node) && follows(node, last!))\n return;\n /** Before the render's range is ahead of everything distributed away; after it, behind. Read before it moves. */\n const ahead = first !== null && follows(node, first);\n park(light).insertBefore(node, light.holding!.lastChild);\n PLACED.set(node, null);\n own(light, node);\n if (ahead) {\n const at = lead.get(light) ?? 0;\n light.units.splice(at, 0, { a: node, z: node });\n lead.set(light, at + 1);\n } else light.units.push({ a: node, z: node });\n mark(light);\n};\n\n/** Which unit a light node is in — its own, or (a run's node in a slot) the run its stand-in sits in. */\nconst unitIndexOf = (light: Light, node: Node): number => {\n const stand = STAND.get(node);\n if (stand === undefined) return light.units.findIndex((unit) => unit.a === node);\n return light.units.findIndex(\n (unit) => unit.a !== unit.z && follows(unit.a, stand) && follows(stand, unit.z)\n );\n};\n\n/**\n * A node the USER put inside a slot's region — `slotted.before(node)`, `after()`: a light unit of its own, at that\n * place in light order. (No `mark`: only `replay` reaches here, for a record `note` has already marked the light for.)\n */\nconst settleIn = (light: Light, node: Node) => {\n const parent = node.parentNode;\n if (parent === null || node.nodeType === 8) return;\n for (const rec of light.recs) {\n if (rec.re === null || rec.re.parentNode !== parent) continue;\n if (!follows(rec.rs!, node) || !follows(node, rec.re)) continue;\n let at = -1;\n for (let next = node.nextSibling; next !== null && next !== rec.re && at < 0; next = next.nextSibling) at = unitIndexOf(light, next);\n if (at < 0) light.units.push({ a: node, z: node });\n else light.units.splice(at, 0, { a: node, z: node });\n PLACED.set(node, rec);\n own(light, node);\n return;\n }\n};\n\n/**\n * **What the renderer wrote, read back into the runs.** A run's node in a slot is still the renderer's: an insert\n * before it (a new row), markers around it (a text becoming a template), its move or removal all happen where the\n * node now is. Each lands in the run at the place its neighbor's stand-in holds, so the run stays the renderer's\n * whole range; what has no such neighbor is the user's own edit.\n */\n/**\n * **What the renderer took away from a run, read back** — the removed half of `replay`: a stand-in it removed takes its\n * node with it (cleared with its run) or into the fragment `hold` parked it in; a run's node it removed from a slot drops\n * its place. Called on its own for a host's own records while its first render runs, when a run still sits in the host.\n */\nconst unrun = (light: Light, record: MutationRecord) => {\n /** A reader: nothing can be in a holding not yet built, so `undefined` compares false. */\n const holding = light.holding;\n for (const node of record.removedNodes) {\n const real = REAL.get(node);\n if (real !== undefined) {\n /**\n * A stand-in the renderer took: cleared with its run (its node goes too), or parked by `hold` in a fragment (its\n * node joins it). One the renderer MOVED — beside a node of the run that sits in a slot — is still the run's; its\n * addition, below, puts it back at its new place.\n */\n const parent = node.parentNode;\n if (parent === holding || (parent !== null && parent.nodeType !== 11)) continue;\n if (parent === null) real.parentNode?.removeChild(real);\n else parent.insertBefore(real, node);\n PLACED.delete(real);\n unstand(real);\n } else if (STAND.has(node) && node.parentNode === null) {\n /** A run's node the renderer removed from its slot (a row deleted): its place goes too. */\n PLACED.delete(node);\n unstand(node);\n }\n }\n};\n\nconst replay = (light: Light, record: MutationRecord) => {\n /** A writer (runs move into holding below): built before it is captured. */\n const holding = holdingOf(light);\n unrun(light, record);\n for (const node of record.addedNodes) {\n if (node.parentNode !== record.target) continue;\n if (record.target === holding) {\n /** Back in holding (the renderer moved it before a marker there): its own place now, not its stand-in's. */\n if (STAND.has(node)) {\n PLACED.delete(node);\n unstand(node);\n }\n /** A run's node written straight into holding (a row the outer template inserted) is a light node from now on. */\n own(light, node);\n continue;\n }\n if (PLACED.get(node) !== undefined && !STAND.has(node)) continue;\n const next = record.nextSibling;\n const previous = record.previousSibling;\n /** Where the runs are: holding — and, until the host's first render ends, the host, where a fresh run still sits. */\n const inRun = (node: Node) => node.parentNode === holding || (light.fresh && node.parentNode === light.host);\n const ahead = next === null ? undefined : (STAND.get(next) ?? (inRun(next) ? next : undefined));\n const behind = previous === null ? undefined : (STAND.get(previous) ?? (inRun(previous) ? previous : undefined));\n if (ahead === undefined && behind === undefined) {\n settleIn(light, node);\n continue;\n }\n const place = ahead ?? behind!.nextSibling;\n /**\n * A run's node moved within the page: its place in the run moves. New to the run: it joins it, at that place — in\n * whatever holds the run: holding, or (until its host's first render ends) the HOST itself, where a fresh run still\n * sits. Inserted into holding regardless, a node new to a fresh run threw there and was left in the slot unrecorded.\n */\n const stand = STAND.get(node);\n const run = place === null ? holding : place.parentNode!;\n (run === holding && stand === undefined ? park(light) : run).insertBefore(stand ?? node, place);\n own(light, node);\n }\n};\n\n/** A captured host that turned out to have a shadow root: its children go back, in light order, for the platform. */\nconst release = (light: Light) => {\n for (const unit of light.units) {\n if (unit.a === unit.z) {\n move(light.host, unit.a, null);\n continue;\n }\n for (let node = unit.a.nextSibling; node !== null && node !== unit.z; ) {\n const next = node.nextSibling;\n light.host.appendChild(REAL.get(node) ?? node);\n node = next;\n }\n }\n light.holding?.remove();\n HOSTS.delete(light.host);\n work.delete(light);\n /**\n * Its observer goes with it. Bound to its light, it would otherwise keep handling the host's records as this light's\n * — adopting the platform's own light children into a holding that no longer exists (renderer-slots' native-sequence\n * row, 2026-10-17). Before the binding, a released light's records were simply not found and dropped.\n */\n light.obs?.disconnect();\n light.obs = undefined;\n};\n\n\n/* ── capture ───────────────────────────────────────────────────────────────────────────────────── */\n\n/**\n * **A light's childList registrations, once its first render has ENDED** (observer redesign, 2026-10-17).\n * ONE over the host's subtree — its own children and every region and slot inside it: what native slotting reacts to,\n * wherever it sits, so a region's parent needs no registration of its own — and its holding (out of the page while empty).\n * Not before: the first render's own writes would make a record each for nothing (`reconcile` covers that window).\n * Attribute changes are registered per NODE (`own`, a slot's `name` in `watch`): one subtree attribute registration made\n * Firefox check every attribute write inside the host (−17.7% of light-slots creation).\n */\nconst register = (light: Light) => {\n if (light.ho === true) return;\n light.ho = true;\n observerOf(light).observe(light.host, { childList: true, subtree: true });\n for (const node of lightOf(light)) own(light, node);\n /**\n * A light with a RUN (a part an outer template writes into, for as long as the host lives) has its holding watched\n * from now — the run moves there, and is written into there, even while holding holds nothing else. One with static\n * light children only is watched once something is parked (`park`), or never.\n */\n if (\n /** `hydrate-slots` writes runs straight into holding and relies on it being watched (hydrate-slots.ts, \"holding is watched\"). */\n (wired as { _$hydrateSlots$?: unknown } | undefined)?._$hydrateSlots$ !== undefined ||\n light.units.some((unit) => unit.a !== unit.z) ||\n (light.holding?.childNodes.length ?? 0) > 2\n )\n watchHolding(light);\n};\n/**\n * **Holding, watched once anything lives in it** — a run's markers and stand-ins, or a parked node — since the outer\n * template keeps writing into a run there, in or out of the page. An empty holding (every light node took a slot) is\n * never written into, so it costs no registration (2026-10-17).\n */\nconst watchHolding = (light: Light) => {\n if (light.ho !== true || light.hh === true) return;\n light.hh = true;\n watch(holdingOf(light), light);\n};\n/**\n * **What changed while a light was not yet observed — its first render** — read off the DOM once, at that render's end\n * (3c): who made the change does not matter, the renderer or user code (a child's `connectedCallback`, a\n * directive). A stand-in gone takes its node with it, as `unrun` does for a removal record; a host child nothing knows\n * of is a light child added meanwhile (`adopt`) — unless it is the render's own (between its markers: `adopt` checks the\n * range), one of the captured units, or a member of a captured run.\n */\nconst reconcile = (light: Light) => {\n for (const rec of light.recs)\n for (const node of [...rec.shown]) {\n const stand = STAND.get(node);\n if (stand === undefined) continue;\n if (node.parentNode === null) {\n PLACED.delete(node);\n unstand(node);\n continue;\n }\n const parent = stand.parentNode;\n if (parent === null) node.parentNode.removeChild(node);\n else if (parent.nodeType === 11) parent.insertBefore(node, stand);\n else continue;\n PLACED.delete(node);\n unstand(node);\n }\n /**\n * A node written INTO a slot's region meanwhile — a keyed row inserted beside a slotted neighbor follows it there\n * (`into`) — is handed to `replay` as the record it would have been: its parent, itself, its neighbors now.\n */\n for (const rec of light.recs) {\n if (rec.rs === null || rec.re === null) continue;\n for (let node = rec.rs.nextSibling; node !== null && node !== rec.re; ) {\n const next = node.nextSibling;\n if (!PLACED.has(node) && node.nodeType !== 8)\n replay(light, { type: 'childList', target: rec.re.parentNode!, addedNodes: [node] as unknown as NodeList, removedNodes: [] as unknown as NodeList, previousSibling: node.previousSibling, nextSibling: node.nextSibling } as unknown as MutationRecord);\n node = next;\n }\n }\n const host = light.host;\n /** The render's range, once: its first and last comment that is not a captured unit's (as `adopt` reads it). */\n const ours = new Set<Node>();\n for (const unit of light.units) ours.add(unit.a).add(unit.z);\n let first: Node | null = null;\n let last: Node | null = null;\n for (let child = host.firstChild; child !== null; child = child.nextSibling)\n if (child.nodeType === 8 && !ours.has(child)) {\n first ??= child;\n last = child;\n }\n const ranged = first !== null && first !== last;\n for (const child of [...host.childNodes]) {\n if (child.nodeType === 8 || child === light.holding || ours.has(child) || PLACED.has(child)) continue;\n if (ranged && follows(first!, child) && follows(child, last!)) continue;\n if (light.units.some((unit) => unit.a !== unit.z && follows(unit.a, child) && follows(child, unit.z))) continue;\n adopt(light, child);\n }\n};\n/** A host's light record, new: its holding (bracketed by two comments, so `lastChild` is always an anchor), watched. */\n/**\n * **`node.assignedSlot`, answered for light slots** (Brian, 2026-10-18: race it). The platform's getter knows only shadow\n * roots; ONE getter replaces it on the prototypes that define it (the Slottable mixin: `Element`, `Text`), per window,\n * at that window's first light host. It answers from `PLACED` — what distribution already records, so nothing is written\n * per node — for a node this copy placed in a slot's region, and otherwise defers to the getter it replaced (native, or\n * another copy's), so shadow-DOM nodes and other copies answer as before. Never on a server: no window with these\n * prototypes, nothing installed.\n */\nconst PATCHED = Symbol();\nconst answerAssigned = (win: typeof globalThis) => {\n const marked = win as unknown as { [PATCHED]?: true };\n if (marked[PATCHED] === true) return;\n marked[PATCHED] = true;\n for (const proto of [win.Element?.prototype, win.Text?.prototype]) {\n const before = proto === undefined ? undefined : Object.getOwnPropertyDescriptor(proto, 'assignedSlot');\n const native = before?.get;\n /** Where the platform puts no getter of its own, nothing is defined there (development says so): never a fresh property. */\n if (native === undefined) {\n if (__DEV__ && proto !== undefined) console.warn(diagnostic('slots', 'assignedSlot', 'assigned-slot-unpatched', __DEV__ && PROSE['assigned-slot-unpatched'](proto === win.Text?.prototype ? 'Text' : 'Element')));\n continue;\n }\n Object.defineProperty(proto, 'assignedSlot', {\n configurable: true,\n enumerable: before!.enumerable,\n get(this: Node) {\n const rec = PLACED.get(this);\n return rec !== undefined && rec !== null && rec !== ADOPTED ? (rec as Rec).slot : native.call(this);\n },\n });\n }\n};\n/**\n * **Holding, built at its FIRST use** (2026-10-18): a host whose light children are all assigned never needs it, and\n * building it for every host was ~82 ms of Chrome's slotted creation at 10 000 hosts. Every WRITER goes through here;\n * readers compare against `light.holding`, which is simply `undefined` until then — nothing can be in it.\n */\nconst dress = (holding: HTMLElement) => {\n const doc = holding.ownerDocument;\n holding.setAttribute('hidden', '');\n holding.setAttribute(UNASSIGNED, '');\n /**\n * `hidden` is only the UA's `display: none`, and any author rule that sets `display` beats it — a reset, a design\n * system's `:where(*)`, a `[hidden]` override — and unassigned content would RENDER. An inline `!important` beats every\n * author stylesheet; written through CSSOM, which a strict CSP does not block (served markup carries `hidden` only).\n */\n holding.style.setProperty('display', 'none', 'important');\n holding.insertBefore(doc.createComment(''), holding.firstChild);\n holding.append(doc.createComment(''));\n return holding;\n};\nconst holdingOf = (light: Light): HTMLElement => (light.holding ??= dress(light.host.ownerDocument.createElement('ins')));\n/**\n * The capture hydration is handed: hydrate-slots writes a served host's runs straight into holding (and reads its\n * anchors), so a light captured through the protocol has its holding built at once — a client-only light builds it lazily.\n */\n/** The lights hydration reads: each with its holding built (it reads the anchors), whichever capture made it. */\nconst SERVED_HOSTS = {\n get: (host: Element) => {\n const light = HOSTS.get(host);\n if (light !== undefined) holdingOf(light);\n return light;\n },\n has: (host: Element) => HOSTS.has(host),\n};\nconst captureServed: typeof capture = (...args) => {\n const light = capture(...args);\n holdingOf(light);\n return light;\n};\nconst lightFor = (host: Element, late: boolean, carrier: HTMLElement | null = null): Light => {\n const doc = host.ownerDocument;\n const win = doc.defaultView as typeof globalThis | null;\n if (win !== null) answerAssigned(win);\n arm();\n /** The server's carrier, adopted at once; otherwise holding is built at its first use (`holdingOf`). */\n const light: Light = { host, units: [], holding: carrier === null ? undefined : dress(carrier), recs: [], dirty: false, fresh: false, late, wait: false };\n HOSTS.set(host, light);\n return light;\n};\n\n/**\n * **Capture**, at `init` — before the host's first render, when everything it holds is the page's. Each static child\n * is a unit; each run between statics (what the page's template bound there) is one unit, wrapped in this module's\n * two comments so its extent survives whatever the renderer writes inside it.\n *\n * `nodes` and `carrier` are hydration's (`_$capture$`): a served host's light children in light order, wherever the server\n * distributed them, and the server's unassigned container, which becomes the holding. A node captured in a slot's region\n * stays there (`ADOPTED`) — distribution then moves only what is out of place, so the server's placement decides at most\n * WHETHER a node moves, never where it ends up.\n */\nconst capture = (host: Element, before: Node | null = null, nodes: Node[] = [...host.childNodes], carrier: HTMLElement | null = null, wait = false): Light => {\n let light = HOSTS.get(host);\n /** A slot of a custom element `init` never saw mounted first: its light content arrives now, at the render's end. */\n if (light !== undefined && !light.late) return light;\n const doc = host.ownerDocument;\n light ??= lightFor(host, false, carrier);\n light.late = false;\n const statics = STATICS.get(host);\n let run: Node[] | null = null;\n /**\n * Recorded, not moved: the children stay where the page put them — in the host, as they would under a shadow root —\n * until the host's first render finishes, which distributes them (the ones no slot takes, invisibly to holding).\n */\n const close = () => {\n if (run === null) return;\n const a = doc.createComment('');\n const z = doc.createComment('');\n host.insertBefore(a, run[0]);\n host.insertBefore(z, run[run.length - 1].nextSibling);\n light!.units.push({ a, z });\n run = null;\n };\n for (const child of nodes) {\n /** At a first render's end, only what precedes the render's own range is light content. */\n if (child === before) break;\n const parent = child.parentNode;\n if (parent !== host) PLACED.set(child, parent === light.holding ? null : ADOPTED);\n own(light, child);\n if (statics === undefined || statics.has(child)) {\n close();\n light.units.push({ a: child, z: child });\n } else (run ??= []).push(child);\n }\n close();\n /**\n * `wait`: captured by a template that placed content into this host (hydration), not by the host — nothing is\n * distributed until the host's own slots mount, so a host never defined keeps its nodes where they stand.\n */\n if (wait) light.wait = true;\n else {\n light.fresh = true;\n mark(light);\n }\n return light;\n};\n\n/**\n * **A dashed element in a template is told it was created** — before the page's template commits into it — so the\n * children it has then are exactly its statics: a binding position is still the empty text the template parsed it\n * as. Recorded by node; `init` capture reads it.\n */\n/**\n * **Which elements each render root's templates created** — so that root's render end reads their lights' records too:\n * a host whose light children an OUTER template changed is distributed by the end of that render, synchronously, though\n * it has an observer of its own (Gecko's `observe()` is linear in its observer's registrations, so none is shared).\n * Weak both ways: a root or an element gone takes its entries with it, and a dead ref is dropped by the read itself.\n */\nconst FED = new WeakMap<Node, WeakRef<Element>[]>();\n/**\n * Only for a dashed element its TEMPLATE gives children (slot-discovery decides once per template, at preparation): no\n * outer template can write into one it gives none, so there is nothing to record — an app's list of `<x-row></x-row>`\n * paid a child scan and a Set per row at create, and a WeakRef per row in its root's `FED` at mount, which that root's\n * every render then filtered (wiring slots made such a list ~9× slower to create, 2026-10-17).\n */\nconst hostBehavior = {\n mount: (element: Element, { root }: { root: Node | null }) => {\n if (root === null) return;\n let fed = FED.get(root);\n if (fed === undefined) {\n arm();\n FED.set(root, (fed = []));\n }\n fed.push(new WeakRef(element));\n },\n create: (element: Element, adopted: boolean) => {\n if (adopted) return;\n const statics = new Set<Node>();\n let hole = false;\n for (const child of [...element.childNodes]) {\n const placeholder = child.nodeType === 3 && (child as Text).data === '';\n /**\n * Two bindings written back to back (`${a}${b}`) have nothing static between them, so their runs would join into\n * one unit: a comment of this module's goes between them — every binding is its own unit.\n */\n if (placeholder && hole) {\n const between = element.ownerDocument.createComment('');\n element.insertBefore(between, child);\n statics.add(between);\n }\n if (!placeholder) statics.add(child);\n hole = placeholder;\n }\n STATICS.set(element, statics);\n },\n};\n\n/* ── the slot element ──────────────────────────────────────────────────────────────────────────── */\n\n/**\n * The `<slot>` element's own answers, from the live assignment (a slot outside a shadow tree answers nothing). With\n * `flatten`, an unassigned slot answers its fallback's slottables, a nested slot through itself.\n */\nconst assigned = (rec: Rec, elementsOnly: boolean, flatten = false): Node[] => {\n flush(rec.light);\n const out = rec.shown.filter((node) => !elementsOnly || node.nodeType === 1);\n /** The fallback is read only when NOTHING is assigned — assigned text with no element still answers [] for elements. */\n if (rec.shown.length > 0 || !flatten) return out;\n for (const node of rec.slot.childNodes) {\n const nested = (node as Kept).$rec;\n if (nested !== undefined) out.push(...assigned(nested, elementsOnly, true));\n else if (node.nodeType === 1 && (node as Element).localName === 'slot') continue;\n else if (node.nodeType === 1 || (!elementsOnly && node.nodeType === 3)) out.push(node);\n }\n /** A nested slot whose content stands in its place is read where it stands. */\n return out;\n};\n\nconst slotBehavior = {\n mount: (slot: Element, context: { root: Node | null }) => {\n const root = context.root;\n /**\n * A shadow root distributes natively; only a light host (an element rendered into) is this module's. A host\n * captured at `init` that then rendered into a shadow root of its own gets its children back, for the platform.\n */\n if (root !== null && root.nodeType === 11) {\n const owner = HOSTS.get((root as ShadowRoot).host);\n if (owner !== undefined && owner.recs.length === 0) release(owner);\n }\n if (root === null || root.nodeType !== 1) return undefined;\n if (__DEV__) {\n const inert = [...slot.attributes].map((attribute) => attribute.name).filter((name) => name !== 'name');\n if (inert.length > 0)\n console.warn(\n diagnostic('slots', `<${(root as Element).localName}>`, 'slot-attributes',\n __DEV__ && PROSE['slot-attributes'](`<slot${slot.hasAttribute('name') ? ` name=\"${slot.getAttribute('name')}\"` : ''}>`, inert.map((name) => `\\`${name}\\``).join(', ')))\n );\n }\n /** A host `init` never saw has no captured children: what it holds now is its own render, never light content. */\n /** Its own light's records first: what the user did to it this task is noted before this module's moves, which are dropped. */\n flush(HOSTS.get(root as Element));\n const light = HOSTS.get(root as Element) ?? lightFor(root as Element, isCustomElementName((root as Element).localName));\n const kept = slot as Kept;\n const rec: Rec = { slot: kept, light, rs: null, re: null, shown: [], queued: false };\n kept.$rec = rec;\n /** A region handed over (hydration: the server's two markers) IS this slot's region, and what is between them stays. */\n const served = kept._$region$;\n if (served !== undefined) {\n kept._$region$ = undefined;\n [rec.rs, rec.re] = served;\n for (let node = rec.rs.nextSibling!; node !== rec.re; node = node.nextSibling!) {\n PLACED.set(node, rec);\n (node as Node & { _$slotted$?: boolean })._$slotted$ = true;\n }\n watch(rec.re.parentNode!, light);\n }\n kept.assignedNodes = (options?: AssignedNodesOptions) => assigned(rec, false, options?.flatten);\n kept.remove = removeSlot;\n kept.replaceWith = replaceSlot;\n kept.assignedElements = (options?: AssignedNodesOptions) => assigned(rec, true, options?.flatten) as Element[];\n light.recs.push(rec);\n light.wait = false;\n watch(kept, light);\n distribute(light);\n drop(light);\n /**\n * Its FIRST slot, after its first render — in a later render of its own, or in ANOTHER container's (an applier\n * committing there, which never reaches this host's `_$done$`): once that render is over — a microtask, which no\n * render is ever halfway through — read what changed while it was unobserved, and observe it from then. Inside its\n * first render, its own `_$done$` does both.\n */\n if (!light.fresh && light.ho !== true)\n queueMicrotask(() => {\n if (light.ho === true || HOSTS.get(light.host) !== light) return;\n reconcile(light);\n flush(light);\n register(light);\n });\n return rec;\n },\n /** Torn down: its content goes back to holding first, and the element back in its place, before the renderer removes it. */\n unmount: (rec: Rec) => {\n flush(rec.light);\n unlist(rec);\n unplace(rec);\n distribute(rec.light);\n drop(rec.light);\n },\n};\n\n/**\n * **The render-end hook, installed at the first thing that needs it** (2026-10-18): until then the renderer's\n * `_$done$` read finds `undefined` and every render ends without calling slots — a page that wired slots but has nothing\n * slotted yet pays nothing per render. Armed by the first light (`lightFor`), the first host a template feeds (FED), the\n * first park, and the first render of a dashed element that already holds something (`unadopted`, the renderer-alone path,\n * which captures at render end).\n */\nlet done: ((container: Node, start: Node) => void) | undefined;\nlet doneOn: { _$done$?: unknown } | undefined;\nconst arm = () => {\n if (doneOn !== undefined && doneOn._$done$ !== done) doneOn._$done$ = done;\n};\n/**\n * **A served light host whose first render nothing adopts** — the renderer asks (`_$unadopted$`) before that render\n * would APPEND beside the server's markup: two copies, the server's dead. The server states every host it renders while\n * slots is wired (`data-vm-light`): stated EMPTY (`N:`), the host holds nothing of the page's, so the server's render\n * is cleared (its SSR stylesheets kept) and the client renders fresh — working, without the server's head start; stated\n * with light content, that content cannot be told from the server's render without `hydrateSlots`, so the host stands\n * as served and the coded error names what to wire. Development warns once per page.\n */\nconst unadopted = (container: Node) => {\n if (container.nodeType === 1 && isCustomElementName((container as Element).localName)) arm();\n /** Asked only for a container with something in it (the renderer skips an empty one: no server markup to append beside). */\n const spec = container.nodeType === 1 ? (container as Element).getAttribute(LIGHT_ATTR) : null;\n if (spec === null) return;\n if (!spec.endsWith(':'))\n /**\n * A WIRING state, not a misused argument, so the diagnostic shape (`[vera] slots: <host> — …`), not `misuse()`'s.\n * Production keeps its own short line, which already carries the code: the code-and-link shape measured +18 B on\n * vera-renderer-slots.min.js (Brian's byte rule, 2026-10-09 — a production message converts only where its bundle\n * is not larger). Development's text is the table's.\n */\n throw new Error(\n __DEV__\n ? diagnostic('slots', `<${(container as Element).localName}>`, 'hydration-unwired', __DEV__ && PROSE['hydration-unwired'](\"this light host, holding the page's content, stands as served\"))\n : '[vera] hydration-unwired'\n );\n for (let node = container.firstChild; node !== null; ) {\n const next: ChildNode | null = node.nextSibling;\n if (node.nodeType !== 1 || !(node as Element).hasAttribute('data-vm-sheet')) container.removeChild(node);\n node = next;\n }\n (container as Element).removeAttribute(LIGHT_ATTR);\n if (__DEV__)\n warnOnce('slots', 'the page', 'hydration-unwired', __DEV__ && (() => PROSE['hydration-unwired']('its components re-render on the client instead of adopting the server markup')));\n};\n\n/** A light host's children in light order, as its record holds them — what a template placing content into it adopts. */\nconst lightNodes = (host: Element): Node[] | null => {\n const light = HOSTS.get(host);\n if (light === undefined) return null;\n flush(light);\n return lightOf(light);\n};\n\n/** The slotted nodes a light host shows in its slot of `name` — or a shadow host's, from the platform. */\nexport const slotted = (host: Element, name = ''): Node[] => {\n const light = HOSTS.get(host);\n if (light !== undefined) {\n flush(light);\n for (const rec of light.recs) if ((rec.slot.getAttribute('name') ?? '') === name && rec.shown.length > 0) return [...rec.shown];\n /** Unassigned, a node still belongs to the host: it waits in holding for a slot of its name. */\n return lightOf(light).filter((node) => slotNameOf(node) === name);\n }\n /**\n * Core's `_$r$` first: a CLOSED root is null through `shadowRoot`, and core keeps the root it attached under that\n * sigiled name in both modes (`@verajs/styles` reads it the same way); no mangling regex matches a sigil.\n * Names are compared, never put in a selector — a quote in one would throw.\n */\n const root = (host as unknown as Record<string, ShadowRoot | null | undefined>)['_$r$'] ?? host.shadowRoot;\n const slot = [...(root?.querySelectorAll('slot') ?? [])].find((s) => (s.getAttribute('name') ?? '') === name);\n return slot === undefined ? [] : slot.assignedNodes();\n};\n\nconst LIGHT_ATTR = 'data-vm-light';\n\n/**\n * Whether hydration is wired — it marks the registry (`_$hydrating$`) when it installs, which may be before or after this\n * module: a served host (`data-vm-light`) is then captured by the adoption, never by `init`'s capture.\n */\nlet wired: { _$hydrating$?: boolean } | null = null;\n\n/**\n * **The `'slot'` insert: a marker** — `@verajs/ssr` distributes light hosts on the server exactly while it is wired. The\n * client claims each `<slot>` through `'element'`, so the function is never called here.\n */\nconst serve = { name: '@verajs/renderer/slots', on: 'slot' as const, fn: () => null, priority: 50 };\n\n/** Discovery: `<slot>` elements and dashed hosts claimed in templates, through `elements`. */\n/**\n * **`observeSlots: 'lazy' | 'eager'`** (paired as HTML's `loading` pairs them) — a component's own option\n * (`init({ host, observeSlots: 'eager' }, …)`, `define({ tag, observeSlots })`), else the app's default\n * (`slots({ observeSlots: 'eager' })`), else `'lazy'`; resolved ONCE here and kept on the light.\n * - `'lazy'`: observed from its first `<slot>` or light child, and a component with neither gets nothing at all (wiring\n * slots made plain components 2.1–2.7× slower to create when every one was captured and observed). Fully correct for\n * everything a template renders.\n * - `'eager'`: captured and observed from its first render, so a child appended by hand before any slot renders is\n * hidden and a `<slot>` inserted by hand is seen — what native shadow DOM does for every host, at an observer per\n * component.\n */\n/**\n * Development: `observeSlots` is `'lazy'` or `'eager'`; anything else reads as `'lazy'` — the BUILT-IN default, even where\n * the app's default is `'eager'`, as core does for `foreignNodes` — and says so.\n */\nconst checkObserve = (subject: string, value: unknown) => {\n if (value !== undefined && value !== 'lazy' && value !== 'eager')\n console.warn(diagnostic('slots', subject, 'observe-slots-option', __DEV__ && PROSE['observe-slots-option'](typeof value === 'string' ? `'${value}'` : String(value))));\n};\nconst captureAtInit = (element: Element, options: object | undefined) => {\n const own = (options as { observeSlots?: unknown } | undefined)?.observeSlots;\n if (__DEV__) checkObserve(`<${element.localName}>`, own);\n const eager = (own !== undefined ? own : (wired as { _$observeSlots$?: unknown } | undefined)?._$observeSlots$) === 'eager';\n /** Nothing to hide and nothing expected (the cheap tests first — they settle every plain component). */\n if (element.firstChild === null && !eager) return;\n /**\n * A SHADOW host distributes natively: core attaches its root before this insert runs and keeps it under the\n * unmangled `_root` (a closed root is null through `shadowRoot`), quoted so this bundle's mangling leaves it alone.\n */\n if ((element as unknown as Record<string, unknown>)['_$r$'] != null || element.shadowRoot !== null) return;\n /** A SERVER host waits: whether its marks are trusted is the following render's to decide (`read`, under adoption). */\n if (isCustomElementName(element.localName) && !HOSTS.has(element) && !(wired?._$hydrating$ === true && element.hasAttribute(LIGHT_ATTR))) {\n const light = capture(element);\n if (eager) light.ex = true;\n }\n};\n/** Development: the option key this hook reads, so core's unknown-option check accepts it (`$keys` sits on the FUNCTION). */\nif (__DEV__) Object.assign(captureAtInit, { $keys: ['observeSlots'], $module: '@verajs/renderer/slots' });\n\nexport const slotDiscovery = [\n elements,\n /**\n * **Capture at `init`** — core's insert point, before the component's first render, when everything a CUSTOM element\n * (a dash, not a reserved SVG/MathML name) holds is the page's: its light content, captured even if its `<slot>`\n * arrives later. Once per host: a reconnect finds it captured and its render untouched.\n */\n {\n name: '@verajs/renderer/slots-capture',\n on: 'init' as const,\n fn: captureAtInit,\n priority: 10,\n },\n {\n name: '@verajs/renderer/slot-discovery',\n on: 'element' as const,\n fn: (el: Element) =>\n el.localName === 'slot' ? slotBehavior : el.firstChild !== null && isCustomElementName(el.localName) ? hostBehavior : undefined,\n priority: 10,\n },\n /**\n * **After every render** — the renderer says when one finishes (`_$done$`, off-chain like `$t`), and what it did to a\n * light host's children is distributed before anything reads them.\n */\n (registry: Map<string, unknown[]>) => {\n /** Hydration's seam — off-chain like `_$done$`, stamped with this package's seam protocol: capture a served host. */\n wired = registry as unknown as { _$hydrating$?: boolean };\n (registry as unknown as { _$capture$?: unknown })._$capture$ = [PROTOCOL, captureServed, lightNodes, SERVED_HOSTS, standIn, PLACED, ADOPTED];\n (registry as unknown as { _$unadopted$?: (container: Node) => void })._$unadopted$ = unadopted;\n (registry as unknown as { _$parked$?: (root: Node, owner: Node | null) => void })._$parked$ = (root, owner) => {\n arm();\n if (owner !== null) PARKED.set(root, owner);\n (parkedObserver ??= new (globalThis.MutationObserver ?? (root.ownerDocument!.defaultView as typeof globalThis).MutationObserver)(parkedHandle)).observe(root, {\n attributes: true,\n attributeFilter: ['slot'],\n childList: true,\n subtree: true,\n });\n };\n /** Development only: how many lights wait for work — 0 once every rendered host is distributed (a retention pin). */\n if (__DEV__) (registry as unknown as { _$slotsWork$?: () => number })._$slotsWork$ = () => work.size;\n /** Development only: how many hosts a root's renders have fed, as recorded — bounded by its live rows (a growth pin). */\n if (__DEV__) (registry as unknown as { _$slotsFed$?: (root: Node) => number })._$slotsFed$ = (root) => FED.get(root)?.length ?? 0;\n doneOn = registry as unknown as { _$done$?: unknown };\n done = (container: Node, start: Node) => {\n /**\n * A CUSTOM element rendered into that `init` never captured (the renderer used on its own, without core): what it\n * held before its first render's range is its light content — Brian's ruling 4, custom elements by their name.\n */\n let own = HOSTS.get(container as Element);\n if (container.nodeType === 1 && (own?.late ?? container.firstChild !== start) && (container as Element).shadowRoot === null && isCustomElementName((container as Element).localName)) {\n capture(container as Element, start);\n own = HOSTS.get(container as Element);\n }\n /**\n * Nothing of this module's here — no light, nothing waiting, no host this render fed, nothing parked: the render of\n * every component that needs no slotting ends here (a full `flush` per render was most of what wiring slots still\n * cost a plain component in Firefox).\n */\n if (own === undefined && work.size === 0 && parkedObserver === undefined && FED.get(container) === undefined) return;\n /** Its own render ended: a fresh light that left the work set (disconnected meanwhile) is distributed now. */\n if (own?.fresh && !own.wait) work.add(own);\n /**\n * Unobserved until it has a slot: what changed meanwhile is read once — at its first render's end, and at the end of\n * the render that mounted its first slot — before the distribution below. A light with no slot shows nothing, so\n * nothing about it needs following until then.\n */\n const slotted = own !== undefined && own.recs.length > 0;\n if (own !== undefined && own.ho !== true && (own.fresh || slotted)) reconcile(own);\n ending = true;\n try {\n flush(own, container);\n } finally {\n ending = false;\n }\n /** Observed from here on — after this module's own moves above, which then make no records. */\n if (own !== undefined && own.ho !== true && (slotted || own.ex === true)) register(own);\n };\n /** A page whose components never needed slotting keeps `_$done$` undefined: their renders never call into slots. */\n },\n];\n\nconst parts = [slotDiscovery, serve];\n/** What `wire` hands a connector: the registry (told apart from options by its `get`) and `wire` itself. */\ntype Registry = { get(name: never): unknown };\ntype Wire = (item: never) => void;\ntype ObserveSlots = 'lazy' | 'eager';\ntype SlotsOptions = { observeSlots?: ObserveSlots };\ntype SlotsConnector = (registry: Registry, wire: Wire) => void;\n/** Two call signatures: as `wire` calls it (bare), and as an app calls it (with options) — both a module to `wire`. */\ntype SlotsModule = { (options?: SlotsOptions): SlotsConnector; (registry: Registry, wire: Wire): void };\n/**\n * **`slots` is a DUAL** — `wire([renderer, slots])`, or `wire([renderer, slots({ observeSlots: 'eager' })])` to make\n * observing from the first render every light component's default (a component's own `observeSlots` wins either way). Bare, `wire` hands it the\n * registry and `wire` itself, and it wires its parts; called, it returns a connector doing the same and writing the\n * default on that registry — two cores on one page keep their own.\n */\n/**\n * A `wire` that hands a connector only the registry — a core older than this module, or code calling connectors itself —\n * can wire nothing of slots: said, in both builds, rather than leaving every slot quietly undistributed.\n */\nconst tooOld = () => {\n throw new Error(__DEV__ ? diagnostic('slots', 'wire([slots])', 'slots-wire-too-old', __DEV__ && PROSE['slots-wire-too-old']()) : '[vera] slots-wire-too-old');\n};\nexport const slots = ((given?: SlotsOptions | Registry, w?: (item: unknown) => void): SlotsConnector | undefined => {\n /** Told apart by the REGISTRY (its `get`), as the module rule says — never by whether a second argument came. */\n if (typeof (given as Registry | undefined)?.get === 'function') {\n if (typeof w !== 'function') tooOld();\n w!(parts);\n return undefined;\n }\n const options = given as SlotsOptions | undefined;\n if (__DEV__) {\n for (const key in options) if (key !== 'observeSlots') console.warn(diagnostic('slots', 'slots()', 'unknown-option', __DEV__ && SHARED.unknownOption(key, 'observeSlots')));\n checkObserve('slots()', options?.observeSlots);\n }\n const observe = options?.observeSlots;\n return (registry, wire) => {\n if (typeof wire !== 'function') tooOld();\n (wire as (item: unknown) => void)(parts);\n if (observe !== undefined) (registry as unknown as { _$observeSlots$?: unknown })._$observeSlots$ = observe;\n };\n}) as SlotsModule;\n\n/** Its option's type, where slots is imported: `init({ host, observeSlots: 'eager' }, …)` (core's `VeraInitOptions`). */\ndeclare global {\n // eslint-disable-next-line no-restricted-syntax -- merging IS the point: slots adds its key to core's options\n interface VeraInitOptions {\n observeSlots?: 'lazy' | 'eager';\n }\n}\n"],"names":["PROSE","SHARED.unknownOption"],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,IAAI,GAAG,uBAAuB;AAE3C;;;;;;;;;AASG;AACH,MAAM,OAAO,mBAAmB,IAAI,GAAG,EAAU;AACjD,MAAM,SAAS,mBAAmB,IAAI,OAAO,EAAqC;AAQlF;AACA,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,IAAY,EAAE,IAAa,KAA8B;IACrF,IAAI,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;AAC7B,IAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AAEvB,QAAA,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,EAAE,EAAE;IACxC;IACA,IAAI,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAC5B,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI;AAAE,QAAA,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,EAAE,EAAE;AACvE,IAAA,OAAO,MAAM;AACf,CAAC;AACD;AACA,MAAM,KAAK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