@brad-frost-web/eddie-render 0.66.0 → 0.68.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.
@@ -1,11 +1,11 @@
1
- const C = /* @__PURE__ */ new Set(["component", "children", "slots", "accessibility", "action", "metadata", "catalogId", "id"]), F = "Text";
2
- function D(i) {
1
+ const D = /* @__PURE__ */ new Set(["component", "children", "slots", "accessibility", "action", "metadata", "catalogId", "id"]), U = "Text";
2
+ function R(i) {
3
3
  return String(i).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
4
4
  }
5
- function X(i) {
5
+ function te(i) {
6
6
  return String(i).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
7
7
  }
8
- function L(i, e) {
8
+ function j(i, e) {
9
9
  if (i && typeof i == "object" && !Array.isArray(i) && "path" in i) {
10
10
  const t = String(i.path);
11
11
  let n = e;
@@ -17,23 +17,23 @@ function L(i, e) {
17
17
  }
18
18
  return i;
19
19
  }
20
- function K(i, e) {
20
+ function z(i, e) {
21
21
  const t = [];
22
22
  for (const [n, o] of Object.entries(i)) {
23
- if (C.has(n)) continue;
24
- const r = L(o, e);
23
+ if (D.has(n)) continue;
24
+ const r = j(o, e);
25
25
  r != null && (typeof r == "string" || typeof r == "number" || typeof r == "boolean") && t.push([n, r]);
26
26
  }
27
27
  return t;
28
28
  }
29
- function z(i, e, t) {
29
+ function Y(i, e, t) {
30
30
  const o = (i.metadata.extensions.eddie_expansion ?? `<${i.metadata.extensions.eddie_tag}>{{children}}</${i.metadata.extensions.eddie_tag}>`).replace(/\{\{(?!children\}\})([a-zA-Z_][\w]*)\}\}/g, (a, s) => {
31
- const c = L(e[s], t);
32
- return c == null ? "" : D(c);
31
+ const c = j(e[s], t);
32
+ return c == null ? "" : R(c);
33
33
  }), r = o.indexOf("{{children}}");
34
34
  return r === -1 ? { before: o, after: "" } : { before: o.slice(0, r), after: o.slice(r + 12) };
35
35
  }
36
- function Y(i, e) {
36
+ function B(i, e) {
37
37
  const t = [];
38
38
  let n = "";
39
39
  const o = /* @__PURE__ */ new Set(), r = (s, c) => {
@@ -47,31 +47,31 @@ function Y(i, e) {
47
47
  }
48
48
  }
49
49
  }, a = (s, c, d) => {
50
- const f = e.components[c.component], u = d ? ` slot="${D(d)}"` : "";
50
+ const f = e.components[c.component], u = d ? ` slot="${R(d)}"` : "";
51
51
  if (t.push({ start: n.length, id: s }), !f) {
52
- n += `<unknown data-eddie-id="${D(s)}"${u}></unknown>`;
52
+ n += `<unknown data-eddie-id="${R(s)}"${u}></unknown>`;
53
53
  return;
54
54
  }
55
- const w = f.metadata.extensions;
56
- if (w.eddie_kind === "text" || c.component === F) {
57
- const g = typeof c.tagName == "string" ? c.tagName : "", p = X(L(c.text, i.dataModel) ?? "");
55
+ const y = f.metadata.extensions;
56
+ if (y.eddie_kind === "text" || c.component === U) {
57
+ const g = typeof c.tagName == "string" ? c.tagName : "", p = te(j(c.text, i.dataModel) ?? "");
58
58
  n += g ? `<${g}${u}>${p}</${g}>` : p;
59
59
  return;
60
60
  }
61
- const y = () => {
61
+ const w = () => {
62
62
  for (const g of c.children ?? []) r(String(g));
63
63
  for (const [g, p] of Object.entries(c.slots ?? {})) {
64
- const x = w.eddie_slotAttrs?.[g] ?? g;
65
- for (const k of p) r(String(k), x);
64
+ const S = y.eddie_slotAttrs?.[g] ?? g;
65
+ for (const C of p) r(String(C), S);
66
66
  }
67
67
  };
68
- if (w.eddie_kind === "composition") {
69
- const { before: g, after: p } = z(f, c, i.dataModel);
70
- n += d ? g.replace(/^(<[a-zA-Z][^>\s]*)/, `$1${u}`) : g, y(), n += p;
68
+ if (y.eddie_kind === "composition") {
69
+ const { before: g, after: p } = Y(f, c, i.dataModel);
70
+ n += d ? g.replace(/^(<[a-zA-Z][^>\s]*)/, `$1${u}`) : g, w(), n += p;
71
71
  return;
72
72
  }
73
- const N = K(c, i.dataModel).map(([g, p]) => p === !0 ? ` ${g}` : p === !1 ? "" : ` ${g}="${D(p)}"`).join("");
74
- n += `<${w.eddie_tag}${N}${u}>`, y(), n += `</${w.eddie_tag}>`;
73
+ const N = z(c, i.dataModel).map(([g, p]) => p === !0 ? ` ${g}` : p === !1 ? "" : ` ${g}="${R(p)}"`).join("");
74
+ n += `<${y.eddie_tag}${N}${u}>`, w(), n += `</${y.eddie_tag}>`;
75
75
  };
76
76
  return i.root && r(i.root), {
77
77
  markup: n,
@@ -82,31 +82,31 @@ function Y(i, e) {
82
82
  }
83
83
  };
84
84
  }
85
- function U() {
85
+ function V() {
86
86
  return { root: null, elements: {}, dataModel: {} };
87
87
  }
88
- function T(i) {
88
+ function L(i) {
89
89
  return JSON.parse(JSON.stringify(i));
90
90
  }
91
- const Q = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
92
- function B(i) {
91
+ const ne = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
92
+ function Z(i) {
93
93
  if (i === "" || i === "/") return [];
94
94
  if (!i.startsWith("/")) throw new Error(`Invalid JSON Pointer "${i}": must start with "/"`);
95
95
  const e = i.slice(1).split("/").map((t) => t.replace(/~1/g, "/").replace(/~0/g, "~"));
96
96
  for (const t of e)
97
- if (Q.has(t)) throw new Error(`Refusing JSON Pointer segment "${t}"`);
97
+ if (ne.has(t)) throw new Error(`Refusing JSON Pointer segment "${t}"`);
98
98
  return e;
99
99
  }
100
- function j(i, e) {
100
+ function M(i, e) {
101
101
  let t = i;
102
- for (const n of B(e)) {
102
+ for (const n of Z(e)) {
103
103
  if (t === null || typeof t != "object") return;
104
104
  t = Array.isArray(t) ? t[Number(n)] : t[n];
105
105
  }
106
106
  return t;
107
107
  }
108
- function O(i, e, t) {
109
- const n = B(e);
108
+ function I(i, e, t) {
109
+ const n = Z(e);
110
110
  if (n.length === 0) throw new Error("Cannot set the document root by pointer");
111
111
  let o = i;
112
112
  for (let a = 0; a < n.length - 1; a++) {
@@ -117,7 +117,7 @@ function O(i, e, t) {
117
117
  const r = n[n.length - 1];
118
118
  Array.isArray(o) ? t === void 0 ? o.splice(Number(r), 1) : r === "-" ? o.push(t) : o[Number(r)] = t : t === void 0 ? delete o[r] : o[r] = t;
119
119
  }
120
- function J(i, e) {
120
+ function H(i, e) {
121
121
  const t = i;
122
122
  switch (e.op) {
123
123
  case "noop":
@@ -125,34 +125,34 @@ function J(i, e) {
125
125
  case "add":
126
126
  case "replace":
127
127
  if (!e.path) throw new Error(`${e.op} needs a path`);
128
- O(t, e.path, e.value);
128
+ I(t, e.path, e.value);
129
129
  return;
130
130
  case "remove":
131
131
  if (!e.path) throw new Error("remove needs a path");
132
- O(t, e.path, void 0);
132
+ I(t, e.path, void 0);
133
133
  return;
134
134
  case "move": {
135
135
  if (!e.path || !e.from) throw new Error("move needs from and path");
136
- const n = j(t, e.from);
137
- O(t, e.from, void 0), O(t, e.path, n);
136
+ const n = M(t, e.from);
137
+ I(t, e.from, void 0), I(t, e.path, n);
138
138
  return;
139
139
  }
140
140
  case "copy": {
141
141
  if (!e.path || !e.from) throw new Error("copy needs from and path");
142
- const n = j(t, e.from);
143
- O(t, e.path, n === void 0 ? void 0 : JSON.parse(JSON.stringify(n)));
142
+ const n = M(t, e.from);
143
+ I(t, e.path, n === void 0 ? void 0 : JSON.parse(JSON.stringify(n)));
144
144
  return;
145
145
  }
146
146
  case "test": {
147
147
  if (!e.path) throw new Error("test needs a path");
148
- if (JSON.stringify(j(t, e.path)) !== JSON.stringify(e.value)) throw new Error(`test failed at ${e.path}`);
148
+ if (JSON.stringify(M(t, e.path)) !== JSON.stringify(e.value)) throw new Error(`test failed at ${e.path}`);
149
149
  return;
150
150
  }
151
151
  default:
152
152
  throw new Error(`Unknown patch op "${e.op}"`);
153
153
  }
154
154
  }
155
- function I(i) {
155
+ function _(i) {
156
156
  const e = i.trim();
157
157
  if (!e || !e.startsWith("{")) return null;
158
158
  try {
@@ -162,8 +162,8 @@ function I(i) {
162
162
  return null;
163
163
  }
164
164
  }
165
- function ee(i) {
166
- const e = I(i);
165
+ function oe(i) {
166
+ const e = _(i);
167
167
  if (e) return e;
168
168
  let t = i.trim();
169
169
  if (!t.startsWith("{")) return null;
@@ -179,12 +179,12 @@ function ee(i) {
179
179
  a === '"' ? n = !0 : a === "{" ? o.push("}") : a === "[" ? o.push("]") : (a === "}" || a === "]") && o.pop();
180
180
  }
181
181
  for (n && (t += '"'); o.length; ) t += o.pop();
182
- return I(t);
182
+ return _(t);
183
183
  }
184
- function ue() {
184
+ function me() {
185
185
  let i = "";
186
186
  const e = [], t = (n) => {
187
- const o = I(n);
187
+ const o = _(n);
188
188
  return !o && n.trim() && e.push(n), o;
189
189
  };
190
190
  return {
@@ -205,26 +205,26 @@ function ue() {
205
205
  end() {
206
206
  const n = i;
207
207
  if (i = "", !n.trim()) return [];
208
- const o = I(n) ?? ee(n);
208
+ const o = _(n) ?? oe(n);
209
209
  return o ? [o] : (e.push(n), []);
210
210
  }
211
211
  };
212
212
  }
213
- function he(i, e) {
213
+ function ge(i, e) {
214
214
  const t = Array.isArray(e) ? e : e.split(`
215
215
  `), n = [], o = [];
216
216
  for (const r of t) {
217
- const a = I(r);
217
+ const a = _(r);
218
218
  if (a)
219
219
  try {
220
- J(i, a), n.push(a);
220
+ H(i, a), n.push(a);
221
221
  } catch (s) {
222
222
  o.push({ op: a, error: s instanceof Error ? s.message : String(s) });
223
223
  }
224
224
  }
225
225
  return { applied: n, failed: o };
226
226
  }
227
- function V(i) {
227
+ function W(i) {
228
228
  const { id: e, component: t, ...n } = i;
229
229
  if (typeof t == "string")
230
230
  return [e, { component: t, ...n }];
@@ -233,13 +233,13 @@ function V(i) {
233
233
  c && typeof c == "object" && "literalString" in c ? a[s] = c.literalString : c && typeof c == "object" && "explicitList" in c ? a[s] = c.explicitList : a[s] = c;
234
234
  return a.child !== void 0 && a.children === void 0 && (a.children = [String(a.child)], delete a.child), [e, a];
235
235
  }
236
- function te(i, e) {
236
+ function re(i, e) {
237
237
  if (e.createSurface) {
238
238
  const n = e.createSurface;
239
239
  i.root = null, i.elements = {}, i.dataModel = n.dataModel ? JSON.parse(JSON.stringify(n.dataModel)) : {};
240
240
  const o = [];
241
241
  for (const a of n.components ?? []) {
242
- const [s, c] = V(a);
242
+ const [s, c] = W(a);
243
243
  i.elements[s] = c, o.push(s);
244
244
  }
245
245
  const r = n.metadata?.extensions ?? {};
@@ -253,30 +253,30 @@ function te(i, e) {
253
253
  if (t) {
254
254
  const n = [];
255
255
  for (const o of t.components ?? []) {
256
- const [r, a] = V(o);
256
+ const [r, a] = W(o);
257
257
  i.elements[r] = a, n.push(r);
258
258
  }
259
259
  return i.root === null && n.includes("root") && (i.root = "root"), { kind: "updateComponents", surfaceId: t.surfaceId, ids: n };
260
260
  }
261
261
  if (e.updateDataModel) {
262
262
  const { path: n, value: o, surfaceId: r } = e.updateDataModel;
263
- return !n || n === "/" || n === "" ? i.dataModel = o && typeof o == "object" ? JSON.parse(JSON.stringify(o)) : {} : O(i.dataModel, n, o === null ? void 0 : o), { kind: "updateDataModel", surfaceId: r, ids: [] };
263
+ return !n || n === "/" || n === "" ? i.dataModel = o && typeof o == "object" ? JSON.parse(JSON.stringify(o)) : {} : I(i.dataModel, n, o === null ? void 0 : o), { kind: "updateDataModel", surfaceId: r, ids: [] };
264
264
  }
265
265
  if (e.dataModelUpdate) {
266
266
  const { path: n, value: o, contents: r, surfaceId: a } = e.dataModelUpdate;
267
267
  if (Array.isArray(r))
268
268
  for (const s of r) {
269
269
  const c = String(s.key), d = s.valueString ?? s.valueNumber ?? s.valueBoolean ?? s.valueMap;
270
- O(i.dataModel, `${n ?? ""}/${c}`, d);
270
+ I(i.dataModel, `${n ?? ""}/${c}`, d);
271
271
  }
272
- else n && O(i.dataModel, n, o);
272
+ else n && I(i.dataModel, n, o);
273
273
  return { kind: "updateDataModel", surfaceId: a, ids: [] };
274
274
  }
275
275
  if (e.deleteSurface)
276
276
  return i.root = null, i.elements = {}, i.dataModel = {}, { kind: "deleteSurface", surfaceId: e.deleteSurface.surfaceId, ids: [] };
277
277
  throw new Error(`Unrecognised A2UI message: ${Object.keys(e).join(", ") || "empty"}`);
278
278
  }
279
- function H(i) {
279
+ function F(i) {
280
280
  const e = /* @__PURE__ */ new Set(), t = [], n = (o) => {
281
281
  if (e.has(o)) return;
282
282
  e.add(o);
@@ -289,27 +289,27 @@ function H(i) {
289
289
  };
290
290
  return i.root && n(i.root), t;
291
291
  }
292
- class S extends Error {
292
+ class x extends Error {
293
293
  constructor(e, t) {
294
294
  super(`Invalid anti-pattern selector "${e}": ${t}`), this.name = "SelectorSyntaxError";
295
295
  }
296
296
  }
297
- const W = /^(?:ed-[a-z0-9-]+|h[1-6]|a|p|img|button|span|div|ul|ol|li)$/, G = /^[a-zA-Z][\w-]*$/;
298
- function ne(i, e) {
297
+ const G = /^(?:ed-[a-z0-9-]+|h[1-6]|a|p|img|button|span|div|ul|ol|li)$/, K = /^[a-zA-Z][\w-]*$/;
298
+ function se(i, e) {
299
299
  let t = i.trim();
300
300
  const n = t.match(/^(\*|[a-z][a-z0-9-]*)/);
301
- if (!n) throw new S(e, `expected a tag or "*" at "${t}"`);
301
+ if (!n) throw new x(e, `expected a tag or "*" at "${t}"`);
302
302
  const o = n[1];
303
- if (o !== "*" && !W.test(o))
304
- throw new S(e, `"${o}" is not an Eddie tag or an allowed native element`);
303
+ if (o !== "*" && !G.test(o))
304
+ throw new x(e, `"${o}" is not an Eddie tag or an allowed native element`);
305
305
  t = t.slice(o.length);
306
306
  const r = { tag: o, not: [] };
307
307
  for (; t.length > 0; ) {
308
308
  const a = t.match(/^\[slot=([^\]]*)\]/);
309
309
  if (a) {
310
310
  const c = a[1].replace(/^["']|["']$/g, "");
311
- if (!G.test(c)) throw new S(e, `bad slot name "${a[1]}"`);
312
- if (r.slot) throw new S(e, "a compound may carry one [slot=] clause");
311
+ if (!K.test(c)) throw new x(e, `bad slot name "${a[1]}"`);
312
+ if (r.slot) throw new x(e, "a compound may carry one [slot=] clause");
313
313
  r.slot = c, t = t.slice(a[0].length);
314
314
  continue;
315
315
  }
@@ -318,52 +318,52 @@ function ne(i, e) {
318
318
  const c = s[1].trim(), d = c.match(/^\[slot=([^\]]*)\]$/);
319
319
  if (d) {
320
320
  const f = d[1].replace(/^["']|["']$/g, "");
321
- if (!G.test(f)) throw new S(e, `bad slot name in :not(): "${c}"`);
321
+ if (!K.test(f)) throw new x(e, `bad slot name in :not(): "${c}"`);
322
322
  r.not.push({ slot: f });
323
- } else if (W.test(c))
323
+ } else if (G.test(c))
324
324
  r.not.push({ tag: c });
325
325
  else
326
- throw new S(e, `:not() accepts one tag or one [slot=name], got "${c}"`);
326
+ throw new x(e, `:not() accepts one tag or one [slot=name], got "${c}"`);
327
327
  t = t.slice(s[0].length);
328
328
  continue;
329
329
  }
330
- throw new S(e, `unexpected "${t}"`);
330
+ throw new x(e, `unexpected "${t}"`);
331
331
  }
332
332
  if (r.tag === "*" && r.not.length === 0 && !r.slot)
333
- throw new S(e, '"*" alone matches everything; qualify it with [slot=] or :not()');
333
+ throw new x(e, '"*" alone matches everything; qualify it with [slot=] or :not()');
334
334
  return r;
335
335
  }
336
- function oe(i) {
336
+ function ie(i) {
337
337
  const e = i.trim().replace(/\s+/g, " ");
338
- if (!e) throw new S(i, "empty selector");
338
+ if (!e) throw new x(i, "empty selector");
339
339
  const t = e.split(" ").filter(Boolean), n = [], o = [];
340
340
  let r = !1, a = !0;
341
341
  for (const s of t) {
342
342
  if (s === ">") {
343
- if (a) throw new S(e, '">" needs a compound on both sides');
343
+ if (a) throw new x(e, '">" needs a compound on both sides');
344
344
  r = !0, a = !0;
345
345
  continue;
346
346
  }
347
- a ? n.length > 0 && o.push(r ? "child" : "descendant") : o.push("descendant"), n.push(ne(s, e)), r = !1, a = !1;
347
+ a ? n.length > 0 && o.push(r ? "child" : "descendant") : o.push("descendant"), n.push(se(s, e)), r = !1, a = !1;
348
348
  }
349
- if (a) throw new S(e, "selector ends with a combinator");
349
+ if (a) throw new x(e, "selector ends with a combinator");
350
350
  if (n.length < 2)
351
- throw new S(e, "an anti-pattern describes a relationship: it needs a parent and a child");
351
+ throw new x(e, "an anti-pattern describes a relationship: it needs a parent and a child");
352
352
  return { text: e, compounds: n, combinators: o };
353
353
  }
354
- const re = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]), q = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)(\/?)>/g;
355
- function se(i) {
354
+ const ae = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]), q = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)(\/?)>/g;
355
+ function ce(i) {
356
356
  const e = i.match(/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i);
357
357
  if (e)
358
358
  return (e[1] ?? e[2] ?? e[3]).trim();
359
359
  }
360
- function ie(i) {
360
+ function le(i) {
361
361
  const e = [], t = [];
362
362
  q.lastIndex = 0;
363
363
  let n;
364
364
  for (; (n = q.exec(i)) !== null; ) {
365
365
  if (n[0].startsWith("<!--")) continue;
366
- const o = n[1] === "/", r = n[2].toLowerCase(), a = n[3] ?? "", s = n[4] === "/" || re.has(r);
366
+ const o = n[1] === "/", r = n[2].toLowerCase(), a = n[3] ?? "", s = n[4] === "/" || ae.has(r);
367
367
  if (o) {
368
368
  for (let u = t.length - 1; u >= 0; u--)
369
369
  if (t[u].tag === r) {
@@ -372,46 +372,46 @@ function ie(i) {
372
372
  }
373
373
  continue;
374
374
  }
375
- const c = { tag: r, index: n.index, children: [] }, d = se(a);
375
+ const c = { tag: r, index: n.index, children: [] }, d = ce(a);
376
376
  d !== void 0 && (c.slot = d);
377
377
  const f = t[t.length - 1];
378
378
  f ? (c.parent = f, f.children.push(c)) : e.push(c), s || t.push(c);
379
379
  }
380
380
  return e;
381
381
  }
382
- function* Z(i) {
382
+ function* X(i) {
383
383
  for (const e of i)
384
- yield e, yield* Z(e.children);
384
+ yield e, yield* X(e.children);
385
385
  }
386
- function M(i, e) {
386
+ function P(i, e) {
387
387
  if (i.tag !== "*" && i.tag !== e.tag || i.slot !== void 0 && e.slot !== i.slot) return !1;
388
388
  for (const t of i.not)
389
389
  if (t.tag !== void 0 && e.tag === t.tag || t.slot !== void 0 && e.slot === t.slot) return !1;
390
390
  return !0;
391
391
  }
392
- function ae(i, e) {
392
+ function de(i, e) {
393
393
  const { compounds: t, combinators: n } = i, o = t.length - 1;
394
- if (!M(t[o], e)) return !1;
394
+ if (!P(t[o], e)) return !1;
395
395
  const r = (a, s) => {
396
396
  if (a < 0) return !0;
397
397
  if (n[a] === "child")
398
- return !!s && M(t[a], s) && r(a - 1, s.parent);
398
+ return !!s && P(t[a], s) && r(a - 1, s.parent);
399
399
  for (let d = s; d; d = d.parent)
400
- if (M(t[a], d) && r(a - 1, d.parent)) return !0;
400
+ if (P(t[a], d) && r(a - 1, d.parent)) return !0;
401
401
  return !1;
402
402
  };
403
403
  return r(o - 1, e.parent);
404
404
  }
405
- function ce(i, e) {
405
+ function fe(i, e) {
406
406
  if (e.length === 0) return [];
407
- const t = e.map((o) => ({ pattern: o, selector: oe(o.selector) })), n = [];
408
- for (const o of Z(ie(i)))
407
+ const t = e.map((o) => ({ pattern: o, selector: ie(o.selector) })), n = [];
408
+ for (const o of X(le(i)))
409
409
  for (const { pattern: r, selector: a } of t)
410
- ae(a, o) && n.push({ pattern: r, node: o, index: o.index });
410
+ de(a, o) && n.push({ pattern: r, node: o, index: o.index });
411
411
  return n.sort((o, r) => o.index - r.index);
412
412
  }
413
- const le = /^h([1-6])$/;
414
- function P(i, e, t = {}) {
413
+ const ue = /^h([1-6])$/;
414
+ function J(i, e, t = {}) {
415
415
  const n = [];
416
416
  let o;
417
417
  try {
@@ -453,8 +453,8 @@ function P(i, e, t = {}) {
453
453
  });
454
454
  continue;
455
455
  }
456
- const b = c(h.component);
457
- if (!b) {
456
+ const $ = c(h.component);
457
+ if (!$) {
458
458
  s({
459
459
  code: "UNKNOWN_COMPONENT",
460
460
  severity: "error",
@@ -465,13 +465,13 @@ function P(i, e, t = {}) {
465
465
  });
466
466
  continue;
467
467
  }
468
- const $ = b.properties ?? {};
469
- for (const m of b.required ?? [])
468
+ const O = $.properties ?? {};
469
+ for (const m of $.required ?? [])
470
470
  m === "component" || m === "children" || h[m] === void 0 && s({ code: "VALIDATION_FAILED", severity: "error", id: l, message: `"${h.component}" requires "${m}".`, path: `/elements/${l}/${m}` });
471
- for (const [m, v] of Object.entries(h)) {
472
- if (C.has(m)) continue;
473
- const A = $[m];
474
- if (!A) {
471
+ for (const [m, b] of Object.entries(h)) {
472
+ if (D.has(m)) continue;
473
+ const v = O[m];
474
+ if (!v) {
475
475
  s({
476
476
  code: "UNKNOWN_PROP",
477
477
  severity: "warning",
@@ -481,31 +481,31 @@ function P(i, e, t = {}) {
481
481
  }), t.autoFix && (delete r.elements[l][m], a = !0);
482
482
  continue;
483
483
  }
484
- if (v && typeof v == "object" && "path" in v) continue;
485
- if (Array.isArray(A.enum) && !A.enum.includes(v)) {
484
+ if (b && typeof b == "object" && "path" in b) continue;
485
+ if (Array.isArray(v.enum) && !v.enum.includes(b)) {
486
486
  s({
487
487
  code: "VALIDATION_FAILED",
488
488
  severity: "error",
489
489
  id: l,
490
- message: `"${m}" on "${h.component}" must be one of ${A.enum.map(String).join(", ")}; got ${JSON.stringify(v)}.`,
490
+ message: `"${m}" on "${h.component}" must be one of ${v.enum.map(String).join(", ")}; got ${JSON.stringify(b)}.`,
491
491
  path: `/elements/${l}/${m}`
492
492
  });
493
493
  continue;
494
494
  }
495
- const R = A.type;
496
- R === "string" && typeof v != "string" && s({
495
+ const E = v.type;
496
+ E === "string" && typeof b != "string" && s({
497
497
  code: "VALIDATION_FAILED",
498
498
  severity: "error",
499
499
  id: l,
500
500
  message: `"${m}" on "${h.component}" must be a string.`,
501
501
  path: `/elements/${l}/${m}`
502
- }), R === "number" && typeof v != "number" && s({
502
+ }), E === "number" && typeof b != "number" && s({
503
503
  code: "VALIDATION_FAILED",
504
504
  severity: "error",
505
505
  id: l,
506
506
  message: `"${m}" on "${h.component}" must be a number.`,
507
507
  path: `/elements/${l}/${m}`
508
- }), R === "boolean" && typeof v != "boolean" && s({
508
+ }), E === "boolean" && typeof b != "boolean" && s({
509
509
  code: "VALIDATION_FAILED",
510
510
  severity: "error",
511
511
  id: l,
@@ -513,14 +513,14 @@ function P(i, e, t = {}) {
513
513
  path: `/elements/${l}/${m}`
514
514
  });
515
515
  }
516
- const E = $.slots?.properties ?? {};
516
+ const A = O.slots?.properties ?? {};
517
517
  for (const m of Object.keys(h.slots ?? {}))
518
- E[m] || s({
518
+ A[m] || s({
519
519
  code: "UNKNOWN_SLOT",
520
520
  severity: "error",
521
521
  id: l,
522
522
  message: `"${h.component}" has no slot "${m}"; slotted content would be silently dropped.`,
523
- fix: Object.keys(E).length ? `Use one of: ${Object.keys(E).join(", ")}, or put the content in children.` : "This node has no named slots; put the content in children.",
523
+ fix: Object.keys(A).length ? `Use one of: ${Object.keys(A).join(", ")}, or put the content in children.` : "This node has no named slots; put the content in children.",
524
524
  path: `/elements/${l}/slots/${m}`
525
525
  });
526
526
  h.children !== void 0 && !Array.isArray(h.children) && s({
@@ -531,7 +531,7 @@ function P(i, e, t = {}) {
531
531
  path: `/elements/${l}/children`
532
532
  });
533
533
  }
534
- const d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), u = (l, h) => {
534
+ const d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(), y = (l, h, $ = "root") => {
535
535
  if (d.has(l)) {
536
536
  s({
537
537
  code: "CYCLE",
@@ -542,9 +542,21 @@ function P(i, e, t = {}) {
542
542
  });
543
543
  return;
544
544
  }
545
- if (f.has(l)) return;
546
- const b = r.elements[l];
547
- if (!b) {
545
+ const O = u.get(l);
546
+ if (O !== void 0) {
547
+ s({
548
+ code: "DUPLICATE_REFERENCE",
549
+ severity: "error",
550
+ id: l,
551
+ message: `"${l}" is placed twice: ${O}, and ${$}. A node can sit in one place only.`,
552
+ fix: `Keep "${l}" in one position and remove the other reference.`,
553
+ path: h ? `/elements/${h}` : void 0
554
+ });
555
+ return;
556
+ }
557
+ if (u.set(l, $), f.has(l)) return;
558
+ const A = r.elements[l];
559
+ if (!A) {
548
560
  if (t.streaming) return;
549
561
  s({
550
562
  code: "DANGLING_CHILD",
@@ -557,63 +569,64 @@ function P(i, e, t = {}) {
557
569
  return;
558
570
  }
559
571
  d.add(l);
560
- const $ = c(b.component), E = h ? r.elements[h] : void 0, m = E ? E.component : "Surface";
561
- if ($) {
562
- $.allowedParents && !$.allowedParents.includes(m) && s({
572
+ const m = c(A.component), b = h ? r.elements[h] : void 0, v = b ? b.component : "Surface";
573
+ if (m) {
574
+ m.allowedParents && !m.allowedParents.includes(v) && s({
563
575
  code: "UNALLOWED_PARENT",
564
576
  severity: "error",
565
577
  id: l,
566
- message: `"${b.component}" may only sit under ${$.allowedParents.join(", ")}; it is under "${m}".`,
567
- fix: $.allowedParents.includes("Surface") ? `Make "${l}" the root, or move it under an allowed parent.` : `Move "${l}" under one of: ${$.allowedParents.join(", ")}.`
578
+ message: `"${A.component}" may only sit under ${m.allowedParents.join(", ")}; it is under "${v}".`,
579
+ fix: m.allowedParents.includes("Surface") ? `Make "${l}" the root, or move it under an allowed parent.` : `Move "${l}" under one of: ${m.allowedParents.join(", ")}.`
568
580
  });
569
- const v = E ? c(E.component) : void 0;
570
- v?.allowedChildren && !v.allowedChildren.includes(b.component) && s({
581
+ const E = b ? c(b.component) : void 0;
582
+ E?.allowedChildren && !E.allowedChildren.includes(A.component) && s({
571
583
  code: "UNALLOWED_CHILD",
572
584
  severity: "error",
573
585
  id: l,
574
- message: `"${m}" does not allow "${b.component}" inside it.`,
575
- fix: `Use one of the nodes "${m}" allows (${v.allowedChildren.slice(0, 8).join(", ")}${v.allowedChildren.length > 8 ? ", …" : ""}), or a different page shape.`,
586
+ message: `"${v}" does not allow "${A.component}" inside it.`,
587
+ fix: `Use one of the nodes "${v}" allows (${E.allowedChildren.slice(0, 8).join(", ")}${E.allowedChildren.length > 8 ? ", …" : ""}), or a different page shape.`,
576
588
  path: `/elements/${h}/children`
577
589
  });
578
590
  }
579
- for (const v of b.children ?? []) u(String(v), l);
580
- for (const v of Object.values(b.slots ?? {})) for (const A of v) u(String(A), l);
591
+ for (const E of A.children ?? []) y(String(E), l, `in "${l}" children`);
592
+ for (const [E, Q] of Object.entries(A.slots ?? {}))
593
+ for (const ee of Q) y(String(ee), l, `in "${l}" slot "${E}"`);
581
594
  d.delete(l), f.add(l);
582
595
  };
583
- r.root && u(r.root, null);
584
- const w = new Set(H(r));
596
+ r.root && y(r.root, null);
597
+ const w = new Set(F(r));
585
598
  for (const l of Object.keys(r.elements))
586
599
  w.has(l) || s({ code: "ORPHAN", severity: "warning", id: l, message: `"${l}" is not reachable from the root and will not render.` });
587
- const y = e.antiPatterns ?? [], N = n.some((l) => l.code === "CYCLE");
588
- if (y.length && !N && r.root && r.elements[r.root]) {
589
- const { markup: l, idOf: h } = Y(r, e);
590
- for (const b of ce(l, y))
600
+ const N = e.antiPatterns ?? [], g = n.some((l) => l.code === "CYCLE");
601
+ if (N.length && !g && r.root && r.elements[r.root]) {
602
+ const { markup: l, idOf: h } = B(r, e);
603
+ for (const $ of fe(l, N))
591
604
  s({
592
605
  code: "ANTI_PATTERN",
593
- severity: b.pattern.severity,
594
- id: h(b.index),
595
- message: `${b.pattern.selector}: ${b.pattern.reason}`,
596
- fix: b.pattern.fix
606
+ severity: $.pattern.severity,
607
+ id: h($.index),
608
+ message: `${$.pattern.selector}: ${$.pattern.reason}`,
609
+ fix: $.pattern.fix
597
610
  });
598
611
  }
599
- const g = [];
600
- let p = 0;
601
- for (const l of H(r)) {
602
- const h = r.elements[l], $ = c(h.component)?.metadata.extensions.eddie_tag, E = typeof h.tagName == "string" ? h.tagName : void 0;
603
- if ($ === "ed-heading" && E) {
604
- const v = E.match(le);
605
- if (v) {
606
- const A = Number(v[1]);
607
- A === 1 && p++, g.length && A > g[g.length - 1] + 1 && s({
612
+ const p = [];
613
+ let S = 0;
614
+ for (const l of F(r)) {
615
+ const h = r.elements[l], O = c(h.component)?.metadata.extensions.eddie_tag, A = typeof h.tagName == "string" ? h.tagName : void 0;
616
+ if (O === "ed-heading" && A) {
617
+ const b = A.match(ue);
618
+ if (b) {
619
+ const v = Number(b[1]);
620
+ v === 1 && S++, p.length && v > p[p.length - 1] + 1 && s({
608
621
  code: "A11Y",
609
622
  severity: "warning",
610
623
  id: l,
611
- message: `Heading level jumps from h${g[g.length - 1]} to h${A}.`,
624
+ message: `Heading level jumps from h${p[p.length - 1]} to h${v}.`,
612
625
  fix: "Step heading levels by one."
613
- }), g.push(A);
626
+ }), p.push(v);
614
627
  }
615
628
  }
616
- $ && /^ed-(text|textarea|select|checkbox|radio)-field$/.test($) && !h.label && !h.slots?.label && s({
629
+ O && /^ed-(text|textarea|select|checkbox|radio)-field$/.test(O) && !h.label && !h.slots?.label && s({
617
630
  code: "A11Y",
618
631
  severity: "warning",
619
632
  id: l,
@@ -621,7 +634,7 @@ function P(i, e, t = {}) {
621
634
  fix: "Set the `label` prop so the field is announced."
622
635
  });
623
636
  const m = h.text && typeof h.text == "object" && "path" in h.text;
624
- h.component === F && typeof h.text != "string" && !m && s({
637
+ h.component === U && typeof h.text != "string" && !m && s({
625
638
  code: "VALIDATION_FAILED",
626
639
  severity: "error",
627
640
  id: l,
@@ -629,11 +642,11 @@ function P(i, e, t = {}) {
629
642
  path: "/elements//text"
630
643
  });
631
644
  }
632
- p > 1 && s({ code: "A11Y", severity: "warning", message: `${p} h1 headings; a page has one.`, fix: "Keep one h1 and demote the rest." });
645
+ S > 1 && s({ code: "A11Y", severity: "warning", message: `${S} h1 headings; a page has one.`, fix: "Keep one h1 and demote the rest." });
633
646
  const k = { ok: !n.some((l) => l.severity === "error"), issues: n };
634
647
  return t.autoFix && a && (k.fixed = r), k;
635
648
  }
636
- function pe(i, e) {
649
+ function ye(i, e) {
637
650
  return i.filter((t) => t.severity === "error").map((t) => ({
638
651
  version: "v1.0",
639
652
  error: {
@@ -644,13 +657,13 @@ function pe(i, e) {
644
657
  }
645
658
  }));
646
659
  }
647
- const de = "data-eddie-pending", _ = "data-eddie-id";
648
- class fe extends EventTarget {
660
+ const he = "data-eddie-pending", T = "data-eddie-id";
661
+ class pe extends EventTarget {
649
662
  element;
650
663
  surfaceId;
651
664
  ready;
652
665
  catalog = null;
653
- committed = U();
666
+ committed = V();
654
667
  mounted = /* @__PURE__ */ new Map();
655
668
  surfaceRoot = null;
656
669
  refusalRegion;
@@ -661,14 +674,14 @@ class fe extends EventTarget {
661
674
  }
662
675
  /** The committed (rendered, canonical) spec. A copy; mutate through a turn. */
663
676
  get spec() {
664
- return T(this.committed);
677
+ return L(this.committed);
665
678
  }
666
679
  get catalogDocument() {
667
680
  return this.catalog;
668
681
  }
669
682
  /** Validate a spec against this host's catalog without touching the surface. */
670
683
  validate(e) {
671
- return P(e, this.requireCatalog());
684
+ return J(e, this.requireCatalog());
672
685
  }
673
686
  /** Apply messages as one turn: validate strictly, then commit or refuse. */
674
687
  apply(e) {
@@ -682,15 +695,15 @@ class fe extends EventTarget {
682
695
  }
683
696
  /** Clear the surface (a `deleteSurface`). */
684
697
  reset() {
685
- this.committed = U(), this.render(this.committed, { provisional: !1 }), this.clearRefusals();
698
+ this.committed = V(), this.render(this.committed, { provisional: !1 }), this.clearRefusals();
686
699
  }
687
700
  beginTurn() {
688
- const e = this.requireCatalog(), t = T(this.committed);
701
+ const e = this.requireCatalog(), t = L(this.committed);
689
702
  let n = !0;
690
703
  const o = /* @__PURE__ */ new Set();
691
704
  let r = !1;
692
705
  const a = () => {
693
- if (!P(t, e, { streaming: !0 }).issues.some((c) => c.severity === "error" && c.code !== "DANGLING_CHILD" && c.code !== "MISSING_ROOT"))
706
+ if (!J(t, e, { streaming: !0 }).issues.some((c) => c.severity === "error" && c.code !== "DANGLING_CHILD" && c.code !== "MISSING_ROOT"))
694
707
  for (const c of this.render(t, { provisional: !0 })) o.add(c);
695
708
  };
696
709
  return {
@@ -700,10 +713,10 @@ class fe extends EventTarget {
700
713
  const c = Array.isArray(s) ? s : s.split(`
701
714
  `), d = [];
702
715
  for (const f of c) {
703
- const u = I(f);
716
+ const u = _(f);
704
717
  if (u)
705
718
  try {
706
- J(t, u), d.push(u);
719
+ H(t, u), d.push(u);
707
720
  } catch {
708
721
  }
709
722
  }
@@ -711,24 +724,24 @@ class fe extends EventTarget {
711
724
  },
712
725
  pushOp: (s) => {
713
726
  if (!n) throw new Error("Turn already ended");
714
- J(t, s), a();
727
+ H(t, s), a();
715
728
  },
716
729
  message: (s) => {
717
730
  if (!n) throw new Error("Turn already ended");
718
731
  for (const c of Array.isArray(s) ? s : [s])
719
- te(t, c).kind === "deleteSurface" ? r = !0 : r = !1;
732
+ re(t, c).kind === "deleteSurface" ? r = !0 : r = !1;
720
733
  r || a();
721
734
  },
722
735
  end: () => {
723
736
  if (!n) throw new Error("Turn already ended");
724
737
  if (n = !1, r)
725
- return this.reset(), this.dispatchEvent(new CustomEvent("render", { detail: { spec: T(this.committed), issues: [], touched: [] } })), { ok: !0, issues: [], outcome: "committed", touched: [] };
726
- const s = P(t, e);
738
+ return this.reset(), this.dispatchEvent(new CustomEvent("render", { detail: { spec: L(this.committed), issues: [], touched: [] } })), { ok: !0, issues: [], outcome: "committed", touched: [] };
739
+ const s = J(t, e);
727
740
  if (s.ok) {
728
741
  this.committed = t;
729
742
  for (const d of this.render(t, { provisional: !1 })) o.add(d);
730
743
  const c = [...o];
731
- return this.clearRefusals(), this.dispatchEvent(new CustomEvent("render", { detail: { spec: T(t), issues: s.issues, touched: c } })), { ...s, outcome: "committed", touched: c };
744
+ return this.clearRefusals(), this.dispatchEvent(new CustomEvent("render", { detail: { spec: L(t), issues: s.issues, touched: c } })), { ...s, outcome: "committed", touched: c };
732
745
  }
733
746
  return this.render(this.committed, { provisional: !1 }), this.showRefusals(s.issues), this.dispatchEvent(new CustomEvent("refusal", { detail: { issues: s.issues, surfaceId: this.surfaceId } })), { ...s, outcome: "refused", touched: [] };
734
747
  },
@@ -745,30 +758,33 @@ class fe extends EventTarget {
745
758
  const n = this.requireCatalog(), o = this.element.ownerDocument, r = [], a = /* @__PURE__ */ new Set();
746
759
  this.opts.scripts !== !1 && this.ensureScripts(e, n);
747
760
  const s = e.dataModel, c = (f) => {
748
- const u = L(f, s);
761
+ const u = j(f, s);
749
762
  if (u && typeof u == "object" && !Array.isArray(u) && u.bind === "client") {
750
- const w = typeof f == "object" && f && "path" in f ? String(f.path) : "";
751
- return this.opts.bind ? this.opts.bind(w) : void 0;
763
+ const y = typeof f == "object" && f && "path" in f ? String(f.path) : "";
764
+ return this.opts.bind ? this.opts.bind(y) : void 0;
752
765
  }
753
766
  return u;
754
767
  }, d = (f, u) => {
768
+ if (a.has(f)) return null;
755
769
  a.add(f);
756
- const w = e.elements[f], y = this.mounted.get(f);
757
- if (!w) {
758
- if (y?.kind === "pending") return y.el;
759
- const x = o.createElement("span");
760
- return x.setAttribute(de, f), x.hidden = !0, this.mounted.set(f, { el: x, key: "pending", childHost: null, anchor: null, kind: "pending" }), x;
770
+ const y = e.elements[f], w = this.mounted.get(f);
771
+ if (!y) {
772
+ if (w?.kind === "pending") return w.el;
773
+ const S = o.createElement("span");
774
+ return S.setAttribute(he, f), S.hidden = !0, this.mounted.set(f, { el: S, key: "pending", childHost: null, anchor: null, kind: "pending" }), S;
761
775
  }
762
- const N = n.components[w.component], g = this.keyFor(w, c, u);
763
- let p = y;
764
- if ((!p || p.key !== g || p.kind === "pending") && (p = this.create(o, f, w, N, c, g), y && y.el.parentNode && y.el.replaceWith(p.el), this.mounted.set(f, p), r.push(f)), p.el instanceof Element && (u ? p.el.setAttribute("slot", u) : p.el.removeAttribute("slot")), p.childHost) {
765
- const x = [];
766
- for (const k of w.children ?? []) x.push(d(String(k)));
767
- for (const [k, l] of Object.entries(w.slots ?? {})) {
776
+ const N = n.components[y.component], g = this.keyFor(y, c, u);
777
+ let p = w;
778
+ if ((!p || p.key !== g || p.kind === "pending") && (p = this.create(o, f, y, N, c, g), w && w.el.parentNode && w.el.replaceWith(p.el), this.mounted.set(f, p), r.push(f)), p.el instanceof Element && (u ? p.el.setAttribute("slot", u) : p.el.removeAttribute("slot")), p.childHost) {
779
+ const S = [], C = (k) => {
780
+ k && S.push(k);
781
+ };
782
+ for (const k of y.children ?? []) C(d(String(k)));
783
+ for (const [k, l] of Object.entries(y.slots ?? {})) {
768
784
  const h = N?.metadata.extensions.eddie_slotAttrs?.[k] ?? k;
769
- for (const b of l) x.push(d(String(b), h));
785
+ for (const $ of l) C(d(String($), h));
770
786
  }
771
- this.syncChildren(p.childHost, p.anchor, x);
787
+ this.syncChildren(p.childHost, p.anchor, S);
772
788
  }
773
789
  return p.el;
774
790
  };
@@ -783,29 +799,29 @@ class fe extends EventTarget {
783
799
  keyFor(e, t, n) {
784
800
  const o = {};
785
801
  for (const [r, a] of Object.entries(e))
786
- r === "children" || r === "slots" || (o[r] = C.has(r) ? a : t(a));
802
+ r === "children" || r === "slots" || (o[r] = D.has(r) ? a : t(a));
787
803
  return JSON.stringify([o, n ?? ""]);
788
804
  }
789
805
  create(e, t, n, o, r, a) {
790
806
  if (!o) {
791
807
  const d = e.createElement("span");
792
- return d.setAttribute(_, t), d.setAttribute("data-eddie-unknown", n.component), d.hidden = !0, { el: d, key: a, childHost: null, anchor: null, kind: "unknown" };
808
+ return d.setAttribute(T, t), d.setAttribute("data-eddie-unknown", n.component), d.hidden = !0, { el: d, key: a, childHost: null, anchor: null, kind: "unknown" };
793
809
  }
794
810
  const s = o.metadata.extensions;
795
- if (s.eddie_kind === "text" || n.component === F) {
811
+ if (s.eddie_kind === "text" || n.component === U) {
796
812
  const d = String(r(n.text) ?? ""), f = typeof n.tagName == "string" ? n.tagName : "";
797
813
  if (!f) return { el: e.createTextNode(d), key: a, childHost: null, anchor: null, kind: "text" };
798
814
  const u = e.createElement(f);
799
- return u.textContent = d, u.setAttribute(_, t), { el: u, key: a, childHost: null, anchor: null, kind: "text" };
815
+ return u.textContent = d, u.setAttribute(T, t), { el: u, key: a, childHost: null, anchor: null, kind: "text" };
800
816
  }
801
817
  if (s.eddie_kind === "composition") {
802
- const { before: d, after: f } = z(o, n, this.resolvedProps(n, r)), u = e.createElement("template");
818
+ const { before: d, after: f } = Y(o, n, this.resolvedProps(n, r)), u = e.createElement("template");
803
819
  u.innerHTML = `${d}<!--eddie:children-->${f}`;
804
- const w = u.content;
805
- let y;
806
- w.children.length === 1 ? y = w.firstElementChild : (y = e.createElement("div"), y.append(w));
820
+ const y = u.content;
821
+ let w;
822
+ y.children.length === 1 ? w = y.firstElementChild : (w = e.createElement("div"), w.append(y));
807
823
  const N = e.createTreeWalker(
808
- y,
824
+ w,
809
825
  128
810
826
  /* NodeFilter.SHOW_COMMENT */
811
827
  );
@@ -815,16 +831,16 @@ class fe extends EventTarget {
815
831
  g = p;
816
832
  break;
817
833
  }
818
- return y.setAttribute(_, t), this.applyCommon(y, n), { el: y, key: a, childHost: g?.parentElement ?? y, anchor: g, kind: "composition" };
834
+ return w.setAttribute(T, t), this.applyCommon(w, n), { el: w, key: a, childHost: g?.parentElement ?? w, anchor: g, kind: "composition" };
819
835
  }
820
836
  const c = e.createElement(s.eddie_tag);
821
- c.setAttribute(_, t);
822
- for (const [d, f] of K(n, {})) {
837
+ c.setAttribute(T, t);
838
+ for (const [d, f] of z(n, {})) {
823
839
  const u = r(f);
824
840
  u === !0 ? c.setAttribute(d, "") : u === !1 || u === void 0 || u === null ? c.removeAttribute(d) : c.setAttribute(d, String(u));
825
841
  }
826
842
  for (const [d, f] of Object.entries(n)) {
827
- if (C.has(d)) continue;
843
+ if (D.has(d)) continue;
828
844
  const u = r(f);
829
845
  u && typeof u == "object" && (c[d] = u);
830
846
  }
@@ -832,7 +848,7 @@ class fe extends EventTarget {
832
848
  }
833
849
  resolvedProps(e, t) {
834
850
  const n = {};
835
- for (const [o, r] of Object.entries(e)) C.has(o) || (n[o] = t(r));
851
+ for (const [o, r] of Object.entries(e)) D.has(o) || (n[o] = t(r));
836
852
  return n;
837
853
  }
838
854
  applyCommon(e, t) {
@@ -875,7 +891,7 @@ class fe extends EventTarget {
875
891
  onActivate(e) {
876
892
  const n = e.target?.closest?.("[data-eddie-action]");
877
893
  if (!n || !this.element.contains(n)) return;
878
- const o = n.getAttribute(_), r = o ? this.committed.elements[o] : void 0;
894
+ const o = n.getAttribute(T), r = o ? this.committed.elements[o] : void 0;
879
895
  if (!o || !r?.action) return;
880
896
  const a = {
881
897
  name: r.action.name,
@@ -888,7 +904,7 @@ class fe extends EventTarget {
888
904
  }
889
905
  ensureScripts(e, t) {
890
906
  const n = this.element.ownerDocument;
891
- for (const o of H(e)) {
907
+ for (const o of F(e)) {
892
908
  const a = t.components[e.elements[o]?.component ?? ""]?.metadata.extensions.eddie_scriptTag;
893
909
  if (a)
894
910
  for (const s of a.matchAll(/src="([^"]+)"/g)) {
@@ -914,34 +930,34 @@ class fe extends EventTarget {
914
930
  }
915
931
  /** The committed surface as markup (what the validator's anti-pattern pass sees). */
916
932
  toMarkup() {
917
- return Y(this.committed, this.requireCatalog()).markup;
933
+ return B(this.committed, this.requireCatalog()).markup;
918
934
  }
919
935
  }
920
- function me(i, e) {
921
- return new fe(i, e);
936
+ function we(i, e) {
937
+ return new pe(i, e);
922
938
  }
923
939
  export {
924
- C as RESERVED_KEYS,
925
- fe as SurfaceHost,
926
- F as TEXT_NODE,
927
- te as applyMessage,
928
- he as applyPatchLines,
929
- J as applyPatchOp,
930
- T as cloneSpec,
931
- ue as createSpecStreamCompiler,
932
- me as createSurfaceHost,
933
- U as emptySpec,
934
- z as expand,
935
- j as getAtPointer,
936
- ee as healJsonLine,
937
- V as normaliseWireComponent,
938
- I as parsePatchLine,
939
- B as parsePointer,
940
- H as reachableIds,
941
- L as resolveValue,
942
- Y as serializeSpec,
943
- O as setAtPointer,
944
- pe as toA2uiErrors,
945
- P as validateSpec
940
+ D as RESERVED_KEYS,
941
+ pe as SurfaceHost,
942
+ U as TEXT_NODE,
943
+ re as applyMessage,
944
+ ge as applyPatchLines,
945
+ H as applyPatchOp,
946
+ L as cloneSpec,
947
+ me as createSpecStreamCompiler,
948
+ we as createSurfaceHost,
949
+ V as emptySpec,
950
+ Y as expand,
951
+ M as getAtPointer,
952
+ oe as healJsonLine,
953
+ W as normaliseWireComponent,
954
+ _ as parsePatchLine,
955
+ Z as parsePointer,
956
+ F as reachableIds,
957
+ j as resolveValue,
958
+ B as serializeSpec,
959
+ I as setAtPointer,
960
+ ye as toA2uiErrors,
961
+ J as validateSpec
946
962
  };
947
963
  //# sourceMappingURL=eddie-render.js.map