@pygmalionjs/pygmalion 0.2.40 → 0.2.41

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,12 +1,27 @@
1
- import { jsxs as M, jsx as S } from "react/jsx-runtime";
2
- import { b as ae, m as Ye, i as it, g as at, e as X, c as ct, a as lt, d as dt, f as ut, h as ft, j as mt, k as pt, l as ht, n as ye, o as gt, p as yt, q as wt, r as vt, t as bt, u as St, v as It, w as Fe, x as xt, y as Pt, z as Et, A as ke, B as Te, C as ne, D as Ct, E as Rt, G as ze, H as Nt, I as pe, J as je, S as At, K as Mt, L as _e, M as $t, O as Be, P as Ot, Q as Dt, R as Ft, T as kt, U as Tt, V as zt, W as Ue } from "./App-CiVUoaTo.js";
3
- import { X as _n, Y as Bn, Z as Un, _ as Hn, $ as qn, a0 as Kn, a1 as Gn, a2 as Ln, a3 as Wn, a4 as Vn, a5 as Jn, a6 as Qn, a7 as Xn, a8 as Yn, a9 as Zn, aa as er, ab as tr, ac as nr, ad as rr, ae as or, af as sr, ag as ir, ah as ar, ai as cr, aj as lr, ak as dr, al as ur, am as fr, an as mr, ao as pr, ap as hr, aq as gr, ar as yr, as as wr, at as vr, au as br, av as Sr, aw as Ir, ax as xr, ay as Pr, az as Er, aA as Cr, aB as Rr } from "./App-CiVUoaTo.js";
4
- import { createElement as He, useMemo as ce, useState as ue, useRef as ve, useCallback as ie, useEffect as fe, useLayoutEffect as qe } from "react";
5
- function Ae(e, t = /* @__PURE__ */ new Set()) {
1
+ import { jsxs as $, jsx as S } from "react/jsx-runtime";
2
+ import { b as se, m as tt, i as lt, g as dt, e as X, S as ut, c as ft, a as mt, d as ht, f as pt, h as gt, j as yt, k as wt, l as bt, n as Se, o as vt, p as St, q as It, r as xt, t as Pt, u as Et, v as Ct, w as je, x as Rt, y as Nt, z as At, A as _e, B as Be, C as oe, D as $t, E as Mt, G as Ue, H as Ot, I as ye, J as we, K as Dt, L as He, M as kt, O as qe, P as Ft, Q as Tt, R as zt, T as jt, U as _t, V as Bt, W as Ke } from "./App-kzN-1Je6.js";
3
+ import { X as qn, Y as Kn, Z as Gn, _ as Ln, $ as Vn, a0 as Wn, a1 as Jn, a2 as Qn, a3 as Xn, a4 as Yn, a5 as Zn, a6 as er, a7 as tr, a8 as nr, a9 as rr, aa as or, ab as sr, ac as ir, ad as ar, ae as cr, af as lr, ag as dr, ah as ur, ai as fr, aj as mr, ak as hr, al as pr, am as gr, an as yr, ao as wr, ap as br, aq as vr, ar as Sr, as as Ir, at as xr, au as Pr, av as Er, aw as Cr, ax as Rr, ay as Nr, az as Ar, aA as $r, aB as Mr } from "./App-kzN-1Je6.js";
4
+ import { createElement as Ge, useMemo as ie, useState as fe, useRef as xe, useCallback as de, useEffect as me, useLayoutEffect as Le } from "react";
5
+ function Ut(e) {
6
+ return e.flatMap((t, o) => {
7
+ const r = t.id.trim() || `path:${o + 1}`, n = t.screenIds.map((s) => s.trim()).filter(Boolean);
8
+ return n.slice(1).map((s, l) => {
9
+ var a, u;
10
+ return {
11
+ id: `${r}:${l + 1}`,
12
+ from: n[l],
13
+ to: s,
14
+ kind: ((a = t.kind) == null ? void 0 : a.trim()) || "authored-path",
15
+ label: ((u = t.label) == null ? void 0 : u.trim()) || void 0
16
+ };
17
+ });
18
+ });
19
+ }
20
+ function De(e, t = /* @__PURE__ */ new Set()) {
6
21
  if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
7
22
  return e;
8
23
  if (Array.isArray(e))
9
- return e.map((r) => Ae(r, t));
24
+ return e.map((r) => De(r, t));
10
25
  if (typeof e != "object") return null;
11
26
  if (t.has(e))
12
27
  throw new Error("A storyboard recipe cannot contain circular references.");
@@ -14,13 +29,13 @@ function Ae(e, t = /* @__PURE__ */ new Set()) {
14
29
  const o = {};
15
30
  for (const r of Object.keys(e).sort()) {
16
31
  const n = e[r];
17
- n !== void 0 && (o[r] = Ae(n, t));
32
+ n !== void 0 && (o[r] = De(n, t));
18
33
  }
19
34
  return t.delete(e), o;
20
35
  }
21
- function jt(e) {
36
+ function Ht(e) {
22
37
  return JSON.stringify(
23
- Ae({
38
+ De({
24
39
  version: 1,
25
40
  route: e.route ?? null,
26
41
  componentName: e.componentName ?? null,
@@ -42,11 +57,11 @@ function jt(e) {
42
57
  function B(e) {
43
58
  return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, o) => t.localeCompare(o));
44
59
  }
45
- function _t(e, t) {
60
+ function qt(e, t) {
46
61
  var r;
47
62
  return ((r = e.id) == null ? void 0 : r.trim()) || `edge:${t + 1}`;
48
63
  }
49
- function Bt(e) {
64
+ function Kt(e) {
50
65
  const t = [...e.screens].sort((r, n) => r.id.localeCompare(n.id)), o = t[0].id;
51
66
  return {
52
67
  id: `story:${o}`,
@@ -66,7 +81,7 @@ function Bt(e) {
66
81
  states: B(t.map((r) => r.state))
67
82
  };
68
83
  }
69
- function Ke(e) {
84
+ function Ve(e) {
70
85
  return [
71
86
  e.code,
72
87
  e.edgeId,
@@ -75,286 +90,286 @@ function Ke(e) {
75
90
  e.scenarioId
76
91
  ].join(":");
77
92
  }
78
- function Ut(e) {
79
- var te, V;
93
+ function Gt(e) {
94
+ var Z, V;
80
95
  const t = [], o = [], r = /* @__PURE__ */ new Map();
81
- for (const l of e.screens) {
82
- const a = l.id.trim();
83
- if (!a || r.has(a)) {
96
+ for (const c of e.screens) {
97
+ const i = c.id.trim();
98
+ if (!i || r.has(i)) {
84
99
  t.push({
85
100
  code: "duplicate-screen-id",
86
101
  severity: "error",
87
- message: a ? `Multiple storyboard screens use the id "${a}".` : "A storyboard screen has an empty id.",
88
- screenId: a || void 0
102
+ message: i ? `Multiple storyboard screens use the id "${i}".` : "A storyboard screen has an empty id.",
103
+ screenId: i || void 0
89
104
  });
90
105
  continue;
91
106
  }
92
- const i = a === l.id ? l : { ...l, id: a };
93
- r.set(a, i), o.push(i);
107
+ const d = i === c.id ? c : { ...c, id: i };
108
+ r.set(i, d), o.push(d);
94
109
  }
95
110
  const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
96
- for (const l of o) {
97
- let a;
111
+ for (const c of o) {
112
+ let i;
98
113
  try {
99
- if (a = (e.recipeKey ?? jt)(l), !a.trim()) throw new Error("Recipe keys cannot be empty.");
100
- } catch (m) {
101
- s.add(l.id), t.push({
114
+ if (i = (e.recipeKey ?? Ht)(c), !i.trim()) throw new Error("Recipe keys cannot be empty.");
115
+ } catch (g) {
116
+ s.add(c.id), t.push({
102
117
  code: "invalid-recipe",
103
118
  severity: "error",
104
- message: m instanceof Error ? m.message : "Storyboard recipe identity could not be created.",
105
- screenId: l.id
106
- }), a = `invalid:${l.id}`;
119
+ message: g instanceof Error ? g.message : "Storyboard recipe identity could not be created.",
120
+ screenId: c.id
121
+ }), i = `invalid:${c.id}`;
107
122
  }
108
- const i = n.get(a);
109
- i ? i.screens.push(l) : n.set(a, { recipeKey: a, screens: [l] });
123
+ const d = n.get(i);
124
+ d ? d.screens.push(c) : n.set(i, { recipeKey: i, screens: [c] });
110
125
  }
111
- const d = [...n.values()].map(Bt).sort((l, a) => l.id.localeCompare(a.id)), c = {};
112
- for (const l of d)
113
- for (const a of l.screenIds) c[a] = l.id;
114
- const u = new Map(d.map((l) => [l.id, l])), w = (l, a) => B([
115
- a,
116
- ...(l ?? []).flatMap((i) => {
117
- const m = i.trim(), y = c[m] ?? (u.has(m) ? m : null);
118
- return y ? [y] : [];
126
+ const l = [...n.values()].map(Kt).sort((c, i) => c.id.localeCompare(i.id)), a = {};
127
+ for (const c of l)
128
+ for (const i of c.screenIds) a[i] = c.id;
129
+ const u = new Map(l.map((c) => [c.id, c])), w = (c, i) => B([
130
+ i,
131
+ ...(c ?? []).flatMap((d) => {
132
+ const g = d.trim(), I = a[g] ?? (u.has(g) ? g : null);
133
+ return I ? [I] : [];
119
134
  })
120
- ]), p = /* @__PURE__ */ new Map();
121
- for (const l of e.assets ?? []) {
122
- const a = p.get(l.pageId);
123
- a ? a.push(l) : p.set(l.pageId, [l]);
135
+ ]), h = /* @__PURE__ */ new Map();
136
+ for (const c of e.assets ?? []) {
137
+ const i = h.get(c.pageId);
138
+ i ? i.push(c) : h.set(c.pageId, [c]);
124
139
  }
125
- const h = d.map((l) => {
126
- const a = l.screenIds.flatMap(
127
- (i) => p.get(i) ?? []
140
+ const p = l.map((c) => {
141
+ const i = c.screenIds.flatMap(
142
+ (d) => h.get(d) ?? []
128
143
  );
129
144
  return {
130
- ...l,
145
+ ...c,
131
146
  scenarioIds: B([
132
- ...l.scenarioIds,
133
- ...a.map((i) => i.scenarioId)
147
+ ...c.scenarioIds,
148
+ ...i.map((d) => d.scenarioId)
134
149
  ]),
135
150
  sourceKeys: B([
136
- ...l.sourceKeys,
137
- ...a.map((i) => i.sourcePath)
151
+ ...c.sourceKeys,
152
+ ...i.map((d) => d.sourcePath)
138
153
  ])
139
154
  };
140
- }), P = /* @__PURE__ */ new Map();
141
- for (const l of h)
142
- for (const a of l.routes) {
143
- const i = P.get(a);
144
- i ? i.push(l.id) : P.set(a, [l.id]);
155
+ }), E = /* @__PURE__ */ new Map();
156
+ for (const c of p)
157
+ for (const i of c.routes) {
158
+ const d = E.get(i);
159
+ d ? d.push(c.id) : E.set(i, [c.id]);
145
160
  }
146
- const b = (l, a, i) => {
147
- const m = l.trim(), y = c[m] ?? (u.has(m) ? m : null);
148
- if (y) return y;
149
- const A = B(P.get(m) ?? []);
150
- return A.length === 1 ? A[0] : A.length > 1 ? (t.push({
151
- code: i === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
161
+ const b = (c, i, d) => {
162
+ const g = c.trim(), I = a[g] ?? (u.has(g) ? g : null);
163
+ if (I) return I;
164
+ const m = B(E.get(g) ?? []);
165
+ return m.length === 1 ? m[0] : m.length > 1 ? (t.push({
166
+ code: d === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
152
167
  severity: "error",
153
- message: `Storyboard edge "${a}" references an ambiguous ${i} route.`,
154
- edgeId: a,
155
- screenId: m || void 0
168
+ message: `Storyboard edge "${i}" references an ambiguous ${d} route.`,
169
+ edgeId: i,
170
+ screenId: g || void 0
156
171
  }), null) : (t.push({
157
- code: i === "source" ? "unknown-edge-source" : "unknown-edge-target",
172
+ code: d === "source" ? "unknown-edge-source" : "unknown-edge-target",
158
173
  severity: "error",
159
- message: `Storyboard edge "${a}" references an unknown ${i}.`,
160
- edgeId: a,
161
- screenId: m || void 0
174
+ message: `Storyboard edge "${i}" references an unknown ${d}.`,
175
+ edgeId: i,
176
+ screenId: g || void 0
162
177
  }), null);
163
- }, g = [], x = /* @__PURE__ */ new Map(), f = [
178
+ }, y = [], P = /* @__PURE__ */ new Map(), f = [
164
179
  ["explicit", e.explicitEdges ?? []],
165
180
  ["inferred", e.inferredEdges ?? []]
166
181
  ];
167
- let N = 0;
168
- for (const [l, a] of f)
169
- for (const i of a) {
170
- const m = _t(i, N);
171
- N += 1;
172
- const y = b(i.from, m, "source"), A = b(i.to, m, "target");
173
- if (!y || !A || y === A) continue;
174
- const F = w(i.fromScope, y), q = w(i.toScope, A), H = `${y}\0${A}`, T = x.get(H);
175
- if (T) {
176
- const R = {
177
- ...T,
182
+ let R = 0;
183
+ for (const [c, i] of f)
184
+ for (const d of i) {
185
+ const g = qt(d, R);
186
+ R += 1;
187
+ const I = b(d.from, g, "source"), m = b(d.to, g, "target");
188
+ if (!I || !m || I === m) continue;
189
+ const N = w(d.fromScope, I), O = w(d.toScope, m), K = `${I}\0${m}`, F = P.get(K);
190
+ if (F) {
191
+ const ce = {
192
+ ...F,
178
193
  fromNodeIds: B([
179
- ...T.fromNodeIds ?? [T.from],
180
- ...F
194
+ ...F.fromNodeIds ?? [F.from],
195
+ ...N
181
196
  ]),
182
197
  toNodeIds: B([
183
- ...T.toNodeIds ?? [T.to],
184
- ...q
198
+ ...F.toNodeIds ?? [F.to],
199
+ ...O
185
200
  ]),
186
201
  sourceEdgeIds: B([
187
- ...T.sourceEdgeIds,
188
- m
202
+ ...F.sourceEdgeIds,
203
+ g
189
204
  ])
190
205
  };
191
- x.set(H, R);
192
- const O = g.indexOf(T);
193
- O >= 0 && (g[O] = R);
206
+ P.set(K, ce);
207
+ const pe = y.indexOf(F);
208
+ pe >= 0 && (y[pe] = ce);
194
209
  continue;
195
210
  }
196
- const C = {
197
- id: m,
198
- from: y,
199
- to: A,
200
- fromNodeIds: F,
201
- toNodeIds: q,
202
- kind: ((te = i.kind) == null ? void 0 : te.trim()) || void 0,
203
- label: ((V = i.label) == null ? void 0 : V.trim()) || void 0,
204
- origin: l,
205
- sourceEdgeIds: [m]
211
+ const q = {
212
+ id: g,
213
+ from: I,
214
+ to: m,
215
+ fromNodeIds: N,
216
+ toNodeIds: O,
217
+ kind: ((Z = d.kind) == null ? void 0 : Z.trim()) || void 0,
218
+ label: ((V = d.label) == null ? void 0 : V.trim()) || void 0,
219
+ origin: c,
220
+ sourceEdgeIds: [g]
206
221
  };
207
- x.set(H, C), g.push(C);
222
+ P.set(K, q), y.push(q);
208
223
  }
209
- g.sort(
210
- (l, a) => `${l.from}:${l.to}:${l.id}`.localeCompare(`${a.from}:${a.to}:${a.id}`)
224
+ y.sort(
225
+ (c, i) => `${c.from}:${c.to}:${c.id}`.localeCompare(`${i.from}:${i.to}:${i.id}`)
211
226
  );
212
227
  const D = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
213
- for (const l of g) {
214
- for (const a of l.fromNodeIds ?? [l.from]) {
215
- const i = v.get(a);
216
- i ? i.push(l) : v.set(a, [l]);
228
+ for (const c of y) {
229
+ for (const i of c.fromNodeIds ?? [c.from]) {
230
+ const d = v.get(i);
231
+ d ? d.push(c) : v.set(i, [c]);
217
232
  }
218
- for (const a of l.toNodeIds ?? [l.to]) {
219
- const i = D.get(a);
220
- i ? i.push(l) : D.set(a, [l]);
233
+ for (const i of c.toNodeIds ?? [c.to]) {
234
+ const d = D.get(i);
235
+ d ? d.push(c) : D.set(i, [c]);
221
236
  }
222
237
  }
223
- const $ = [];
224
- for (const l of e.startScreenIds ?? []) {
225
- const a = l.trim(), i = c[a] ?? (u.has(a) ? a : null);
226
- if (!i) {
238
+ const M = [];
239
+ for (const c of e.startScreenIds ?? []) {
240
+ const i = c.trim(), d = a[i] ?? (u.has(i) ? i : null);
241
+ if (!d) {
227
242
  t.push({
228
243
  code: "unknown-start-screen",
229
244
  severity: "error",
230
- message: `Storyboard start references an unknown screen "${a}".`,
231
- screenId: a || void 0
245
+ message: `Storyboard start references an unknown screen "${i}".`,
246
+ screenId: i || void 0
232
247
  });
233
248
  continue;
234
249
  }
235
- $.push(i);
250
+ M.push(d);
236
251
  }
237
- const ee = new Set($);
238
- let I = B($);
239
- I.length || (I = h.filter((l) => {
240
- var a;
241
- return (((a = D.get(l.id)) == null ? void 0 : a.length) ?? 0) === 0;
242
- }).map((l) => l.id).sort((l, a) => l.localeCompare(a))), !I.length && h.length && (I = [h[0].id]);
243
- const E = /* @__PURE__ */ new Set(), _ = [...I];
244
- for (; _.length; ) {
245
- const l = _.shift();
246
- if (!E.has(l)) {
247
- E.add(l);
248
- for (const a of v.get(l) ?? [])
249
- _.push(a.to), l === a.from && _.push(...a.toNodeIds ?? [a.to]);
252
+ const te = new Set(M);
253
+ let x = B(M);
254
+ x.length || (x = p.filter((c) => {
255
+ var i;
256
+ return (((i = D.get(c.id)) == null ? void 0 : i.length) ?? 0) === 0;
257
+ }).map((c) => c.id).sort((c, i) => c.localeCompare(i))), !x.length && p.length && (x = [p[0].id]);
258
+ const C = /* @__PURE__ */ new Set(), j = [...x];
259
+ for (; j.length; ) {
260
+ const c = j.shift();
261
+ if (!C.has(c)) {
262
+ C.add(c);
263
+ for (const i of v.get(c) ?? [])
264
+ j.push(i.to), c === i.from && j.push(...i.toNodeIds ?? [i.to]);
250
265
  }
251
266
  }
252
- const z = h.filter((l) => {
253
- var i, m;
254
- const a = (((i = D.get(l.id)) == null ? void 0 : i.length) ?? 0) === 0 && (((m = v.get(l.id)) == null ? void 0 : m.length) ?? 0) === 0 && !ee.has(l.id);
255
- return !E.has(l.id) || a && h.length > 1;
267
+ const H = p.filter((c) => {
268
+ var d, g;
269
+ const i = (((d = D.get(c.id)) == null ? void 0 : d.length) ?? 0) === 0 && (((g = v.get(c.id)) == null ? void 0 : g.length) ?? 0) === 0 && !te.has(c.id);
270
+ return !C.has(c.id) || i && p.length > 1;
256
271
  });
257
- for (const l of z)
258
- for (const a of l.screenIds)
272
+ for (const c of H)
273
+ for (const i of c.screenIds)
259
274
  t.push({
260
275
  code: "disconnected-screen",
261
276
  severity: "warning",
262
- message: `Storyboard screen "${a}" is not connected to a graph branch.`,
263
- screenId: a,
264
- nodeId: l.id
277
+ message: `Storyboard screen "${i}" is not connected to a graph branch.`,
278
+ screenId: i,
279
+ nodeId: c.id
265
280
  });
266
- const Y = /* @__PURE__ */ new Map();
267
- for (const l of h)
268
- for (const a of l.sourceKeys) {
269
- const i = Y.get(a) ?? {
281
+ const Q = /* @__PURE__ */ new Map();
282
+ for (const c of p)
283
+ for (const i of c.sourceKeys) {
284
+ const d = Q.get(i) ?? {
270
285
  nodeIds: /* @__PURE__ */ new Set(),
271
286
  screenIds: /* @__PURE__ */ new Set()
272
287
  };
273
- i.nodeIds.add(l.id);
274
- for (const m of l.screenIds) i.screenIds.add(m);
275
- Y.set(a, i);
288
+ d.nodeIds.add(c.id);
289
+ for (const g of c.screenIds) d.screenIds.add(g);
290
+ Q.set(i, d);
276
291
  }
277
- const re = [...Y.entries()].map(([l, a]) => ({
278
- sourceKey: l,
279
- nodeIds: [...a.nodeIds].sort((i, m) => i.localeCompare(m)),
280
- screenIds: [...a.screenIds].sort((i, m) => i.localeCompare(m)),
281
- shared: a.nodeIds.size > 1
282
- })).sort((l, a) => l.sourceKey.localeCompare(a.sourceKey)), le = h.map((l) => {
283
- const a = [...v.get(l.id) ?? []].sort(
284
- (i, m) => i.id.localeCompare(m.id)
292
+ const he = [...Q.entries()].map(([c, i]) => ({
293
+ sourceKey: c,
294
+ nodeIds: [...i.nodeIds].sort((d, g) => d.localeCompare(g)),
295
+ screenIds: [...i.screenIds].sort((d, g) => d.localeCompare(g)),
296
+ shared: i.nodeIds.size > 1
297
+ })).sort((c, i) => c.sourceKey.localeCompare(i.sourceKey)), ue = p.map((c) => {
298
+ const i = [...v.get(c.id) ?? []].sort(
299
+ (d, g) => d.id.localeCompare(g.id)
285
300
  );
286
301
  return {
287
- nodeId: l.id,
288
- edgeIds: a.map((i) => i.id),
289
- targetNodeIds: B(a.map((i) => i.to))
302
+ nodeId: c.id,
303
+ edgeIds: i.map((d) => d.id),
304
+ targetNodeIds: B(i.map((d) => d.to))
290
305
  };
291
- }).filter((l) => l.targetNodeIds.length > 1).sort((l, a) => l.nodeId.localeCompare(a.nodeId)), oe = new Set(
292
- h.flatMap((l) => l.scenarioIds)
293
- ), de = new Set(
294
- (e.nonVisualScenarioIds ?? []).map((l) => l.trim())
295
- ), G = B(
296
- (e.scenarios ?? []).map((l) => l.id)
297
- ), J = G.filter(
298
- (l) => !oe.has(l) && !de.has(l)
306
+ }).filter((c) => c.targetNodeIds.length > 1).sort((c, i) => c.nodeId.localeCompare(i.nodeId)), W = new Set(
307
+ p.flatMap((c) => c.scenarioIds)
308
+ ), ae = new Set(
309
+ (e.nonVisualScenarioIds ?? []).map((c) => c.trim())
310
+ ), ne = B(
311
+ (e.scenarios ?? []).map((c) => c.id)
312
+ ), Y = ne.filter(
313
+ (c) => !W.has(c) && !ae.has(c)
299
314
  );
300
- for (const l of J)
315
+ for (const c of Y)
301
316
  t.push({
302
317
  code: "missing-code-scenario",
303
318
  severity: "warning",
304
- message: `Code scenario "${l}" is not represented in the storyboard.`,
305
- scenarioId: l
319
+ message: `Code scenario "${c}" is not represented in the storyboard.`,
320
+ scenarioId: c
306
321
  });
307
322
  t.sort(
308
- (l, a) => Ke(l).localeCompare(Ke(a))
323
+ (c, i) => Ve(c).localeCompare(Ve(i))
309
324
  );
310
- const L = B(
311
- z.flatMap((l) => l.screenIds)
312
- ), Q = {
325
+ const re = B(
326
+ H.flatMap((c) => c.screenIds)
327
+ ), J = {
313
328
  screens: o.length,
314
- canonicalNodes: h.length,
315
- mergedScreens: Math.max(0, o.length - h.length),
316
- edges: g.length,
317
- connectedNodes: h.length - z.length,
318
- disconnectedScreens: L,
319
- codeScenarios: G.length,
320
- representedScenarios: G.filter(
321
- (l) => oe.has(l)
329
+ canonicalNodes: p.length,
330
+ mergedScreens: Math.max(0, o.length - p.length),
331
+ edges: y.length,
332
+ connectedNodes: p.length - H.length,
333
+ disconnectedScreens: re,
334
+ codeScenarios: ne.length,
335
+ representedScenarios: ne.filter(
336
+ (c) => W.has(c)
322
337
  ).length,
323
- missingScenarios: J,
324
- complete: L.length === 0 && J.length === 0 && !t.some((l) => l.severity === "error") && s.size === 0
338
+ missingScenarios: Y,
339
+ complete: re.length === 0 && Y.length === 0 && !t.some((c) => c.severity === "error") && s.size === 0
325
340
  };
326
341
  return {
327
342
  version: 1,
328
- nodes: h,
329
- edges: g,
343
+ nodes: p,
344
+ edges: y,
330
345
  aliases: Object.fromEntries(
331
- Object.entries(c).sort(([l], [a]) => l.localeCompare(a))
346
+ Object.entries(a).sort(([c], [i]) => c.localeCompare(i))
332
347
  ),
333
- sourceGroups: re,
334
- startNodeIds: I,
335
- branches: le,
348
+ sourceGroups: he,
349
+ startNodeIds: x,
350
+ branches: ue,
336
351
  warnings: t,
337
- coverage: Q
352
+ coverage: J
338
353
  };
339
354
  }
340
- function Ht(e) {
355
+ function Lt(e) {
341
356
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
342
357
  }
343
- function be(e) {
344
- if (Array.isArray(e)) return e.map(be);
358
+ function Pe(e) {
359
+ if (Array.isArray(e)) return e.map(Pe);
345
360
  if (e && typeof e == "object") {
346
- const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o, be(r)]).filter(([, o]) => o !== void 0);
361
+ const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o, Pe(r)]).filter(([, o]) => o !== void 0);
347
362
  return t.length ? Object.fromEntries(t) : void 0;
348
363
  }
349
364
  return e;
350
365
  }
351
- function Ge(e) {
352
- return JSON.stringify(be(e ?? null));
366
+ function We(e) {
367
+ return JSON.stringify(Pe(e ?? null));
353
368
  }
354
- function qt(e) {
369
+ function Vt(e) {
355
370
  return !!(e && typeof e == "object" && !Array.isArray(e));
356
371
  }
357
- function W(e) {
372
+ function L(e) {
358
373
  const t = e == null ? void 0 : e.trim();
359
374
  if (!t) return null;
360
375
  let o = t;
@@ -365,25 +380,28 @@ function W(e) {
365
380
  }
366
381
  return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
367
382
  }
368
- function Ze(e) {
369
- return `source-route:${encodeURIComponent(e)}`;
383
+ function nt(e) {
384
+ const t = L(e);
385
+ if (!t)
386
+ throw new Error("A storyboard source route must be a non-empty path.");
387
+ return `source-route:${encodeURIComponent(t)}`;
370
388
  }
371
- function Oe(e, t) {
389
+ function Te(e, t) {
372
390
  const o = e.split("/").filter(Boolean), r = t.split("/").filter(Boolean);
373
391
  let n = 0;
374
392
  for (let s = 0; s < o.length; s += 1) {
375
- const d = o[s];
376
- if (d === "*" || d.startsWith("*")) return !0;
377
- const c = r[n];
378
- if (!(d.endsWith("?") && c == null)) {
379
- if (c == null || !d.startsWith(":") && d !== c) return !1;
393
+ const l = o[s];
394
+ if (l === "*" || l.startsWith("*")) return !0;
395
+ const a = r[n];
396
+ if (!(l.endsWith("?") && a == null)) {
397
+ if (a == null || !l.startsWith(":") && l !== a) return !1;
380
398
  n += 1;
381
399
  }
382
400
  }
383
401
  return n === r.length;
384
402
  }
385
- function Le(e, t, o) {
386
- const r = W(e);
403
+ function Je(e, t, o) {
404
+ const r = L(e);
387
405
  if (!r) return [];
388
406
  const n = t.get(r);
389
407
  return n && !/[:*]/.test(r) ? [
@@ -391,18 +409,18 @@ function Le(e, t, o) {
391
409
  representativeId: n,
392
410
  screenIds: o.get(r) ?? [n]
393
411
  }
394
- ] : [...t.entries()].filter(([s]) => Oe(r, s)).map(([s, d]) => ({
395
- representativeId: d,
396
- screenIds: o.get(s) ?? [d]
397
- })).sort((s, d) => s.representativeId.localeCompare(d.representativeId));
412
+ ] : [...t.entries()].filter(([s]) => Te(r, s)).map(([s, l]) => ({
413
+ representativeId: l,
414
+ screenIds: o.get(s) ?? [l]
415
+ })).sort((s, l) => s.representativeId.localeCompare(l.representativeId));
398
416
  }
399
- function Kt(e) {
417
+ function Wt(e) {
400
418
  var o;
401
419
  const t = /* @__PURE__ */ new Map();
402
420
  for (const r of e ?? []) {
403
- const n = W(r.path);
421
+ const n = L(r.path);
404
422
  !n || t.has(n) || t.set(n, {
405
- id: Ze(n),
423
+ id: nt(n),
406
424
  name: n,
407
425
  section: "Source routes",
408
426
  codeName: ((o = r.id) == null ? void 0 : o.trim()) || void 0
@@ -410,22 +428,22 @@ function Kt(e) {
410
428
  }
411
429
  return [...t.values()].sort((r, n) => r.id.localeCompare(n.id));
412
430
  }
413
- function Gt(e, t, o, r) {
431
+ function Jt(e, t, o, r) {
414
432
  return (e ?? []).flatMap((n, s) => {
415
- var h, P, b;
416
- const d = (h = n.from) == null ? void 0 : h.trim(), c = (P = n.to) == null ? void 0 : P.trim();
417
- if (!d || !c || n.unresolvedTarget) return [];
418
- const u = r.has(d) ? [{ representativeId: d, screenIds: [d] }] : Le(d, t, o), w = r.has(c) ? [{ representativeId: c, screenIds: [c] }] : Le(c, t, o);
433
+ var p, E, b;
434
+ const l = (p = n.from) == null ? void 0 : p.trim(), a = (E = n.to) == null ? void 0 : E.trim();
435
+ if (!l || !a || n.unresolvedTarget) return [];
436
+ const u = r.has(l) ? [{ representativeId: l, screenIds: [l] }] : Je(l, t, o), w = r.has(a) ? [{ representativeId: a, screenIds: [a] }] : Je(a, t, o);
419
437
  if (!u.length || !w.length) return [];
420
- const p = ((b = n.id) == null ? void 0 : b.trim()) || `discovery-edge:${s + 1}`;
438
+ const h = ((b = n.id) == null ? void 0 : b.trim()) || `discovery-edge:${s + 1}`;
421
439
  return u.flatMap(
422
- (g, x) => w.map((f, N) => {
440
+ (y, P) => w.map((f, R) => {
423
441
  var D, v;
424
442
  return {
425
- id: u.length === 1 && w.length === 1 ? p : `${p}:${x + 1}:${N + 1}`,
426
- from: g.representativeId,
443
+ id: u.length === 1 && w.length === 1 ? h : `${h}:${P + 1}:${R + 1}`,
444
+ from: y.representativeId,
427
445
  to: f.representativeId,
428
- fromScope: g.screenIds,
446
+ fromScope: y.screenIds,
429
447
  toScope: f.screenIds,
430
448
  kind: ((D = n.kind) == null ? void 0 : D.trim()) || void 0,
431
449
  label: ((v = n.label) == null ? void 0 : v.trim()) || void 0
@@ -434,32 +452,32 @@ function Gt(e, t, o, r) {
434
452
  );
435
453
  });
436
454
  }
437
- function Lt(e, t, o) {
438
- const r = W(e.route);
455
+ function Qt(e, t, o) {
456
+ const r = L(e.route);
439
457
  if (!r) return [];
440
458
  const n = t.filter(
441
- (c) => {
442
- const u = W(c.route);
443
- return u ? Oe(u, r) : !1;
459
+ (a) => {
460
+ const u = L(a.route);
461
+ return u ? Te(u, r) : !1;
444
462
  }
445
463
  );
446
464
  if (!n.length) return [];
447
- const s = Ge(
448
- Ye(o, e.environment)
449
- ), d = n.filter(
450
- (c) => Ge(c.environment) === s
465
+ const s = We(
466
+ tt(o, e.environment)
467
+ ), l = n.filter(
468
+ (a) => We(a.environment) === s
451
469
  );
452
470
  return [
453
471
  ...new Set(
454
- d.map((c) => {
472
+ l.map((a) => {
455
473
  var u;
456
- return (u = c.scenarioId) == null ? void 0 : u.trim();
457
- }).filter((c) => !!c)
474
+ return (u = a.scenarioId) == null ? void 0 : u.trim();
475
+ }).filter((a) => !!a)
458
476
  )
459
- ].sort((c, u) => c.localeCompare(u));
477
+ ].sort((a, u) => a.localeCompare(u));
460
478
  }
461
- function Wt(e, t) {
462
- const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n = tt(t);
479
+ function Xt(e, t) {
480
+ const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n = ot(t);
463
481
  return e.filter(
464
482
  (s) => o ? s.importKind === "screens" : !!s.route
465
483
  ).map((s) => ({
@@ -480,42 +498,42 @@ function Wt(e, t) {
480
498
  scenario: s.scenario,
481
499
  state: s.state,
482
500
  scenarioId: s.scenarioId,
483
- scenarioIds: Lt(s, r, n),
501
+ scenarioIds: Qt(s, r, n),
484
502
  interactions: s.interactions,
485
503
  environment: s.environment,
486
504
  preset: s.preset,
487
505
  assertions: s.assertions,
488
- sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((d, c) => d.localeCompare(c))[0]
506
+ sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((l, a) => l.localeCompare(a))[0]
489
507
  }));
490
508
  }
491
- function Pe(e, t) {
492
- var c, u, w, p;
493
- const o = (((c = e.interactions) == null ? void 0 : c.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
509
+ function Ne(e, t) {
510
+ var a, u, w, h;
511
+ const o = (((a = e.interactions) == null ? void 0 : a.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
494
512
  if (o !== 0) return o;
495
- const r = (w = e.scenarioIds) != null && w.includes("environment:baseline") ? 0 : 1, n = (p = t.scenarioIds) != null && p.includes("environment:baseline") ? 0 : 1;
513
+ const r = (w = e.scenarioIds) != null && w.includes("environment:baseline") ? 0 : 1, n = (h = t.scenarioIds) != null && h.includes("environment:baseline") ? 0 : 1;
496
514
  if (r !== n) return r - n;
497
- const s = !e.environment && !e.preset ? 0 : 1, d = !t.environment && !t.preset ? 0 : 1;
498
- return s !== d ? s - d : e.id.localeCompare(t.id);
515
+ const s = !e.environment && !e.preset ? 0 : 1, l = !t.environment && !t.preset ? 0 : 1;
516
+ return s !== l ? s - l : e.id.localeCompare(t.id);
499
517
  }
500
- function Vt(e) {
518
+ function Yt(e) {
501
519
  const t = /* @__PURE__ */ new Map();
502
520
  for (const o of e) {
503
- const r = W(o.route);
521
+ const r = L(o.route);
504
522
  if (!r) continue;
505
523
  const n = t.get(r);
506
524
  n ? n.push(o) : t.set(r, [o]);
507
525
  }
508
526
  return new Map(
509
527
  [...t.entries()].map(([o, r]) => {
510
- const n = [...r].sort(Pe);
528
+ const n = [...r].sort(Ne);
511
529
  return [o, n[0].id];
512
530
  })
513
531
  );
514
532
  }
515
- function Jt(e) {
533
+ function Zt(e) {
516
534
  const t = /* @__PURE__ */ new Map();
517
535
  for (const o of e) {
518
- const r = W(o.route);
536
+ const r = L(o.route);
519
537
  if (!r) continue;
520
538
  const n = t.get(r);
521
539
  n ? n.push(o.id) : t.set(r, [o.id]);
@@ -527,9 +545,9 @@ function Jt(e) {
527
545
  ])
528
546
  );
529
547
  }
530
- function Qt(e) {
548
+ function en(e) {
531
549
  return e.action === "wait" ? null : JSON.stringify(
532
- be({
550
+ Pe({
533
551
  action: e.action,
534
552
  selector: e.selector,
535
553
  text: e.text,
@@ -543,74 +561,74 @@ function Qt(e) {
543
561
  })
544
562
  );
545
563
  }
546
- function et(e) {
547
- return (e.interactions ?? []).map(Qt).filter((t) => t != null);
564
+ function rt(e) {
565
+ return (e.interactions ?? []).map(en).filter((t) => t != null);
548
566
  }
549
- function Xt(e, t) {
567
+ function tn(e, t) {
550
568
  return e.length < t.length && e.every((o, r) => o === t[r]);
551
569
  }
552
- function Yt(e, t) {
570
+ function nn(e, t) {
553
571
  const o = /* @__PURE__ */ new Map();
554
572
  for (const r of e) {
555
- const n = W(r.route);
573
+ const n = L(r.route);
556
574
  if (!n) continue;
557
- const s = `${n}\0${et(r).join("")}`, d = o.get(s);
558
- d ? d.push(r) : o.set(s, [r]);
575
+ const s = `${n}\0${rt(r).join("")}`, l = o.get(s);
576
+ l ? l.push(r) : o.set(s, [r]);
559
577
  }
560
578
  return [...o.values()].flatMap((r) => {
561
579
  if (r.length < 2) return [];
562
- const n = W(r[0].route), s = t.get(n), d = r.find((c) => c.id === s) ?? [...r].sort(Pe)[0];
563
- return r.filter((c) => c.id !== d.id).sort((c, u) => c.id.localeCompare(u.id)).map((c) => ({
564
- id: `discovery-variant:${encodeURIComponent(d.id)}:${encodeURIComponent(c.id)}`,
565
- from: d.id,
566
- to: c.id,
580
+ const n = L(r[0].route), s = t.get(n), l = r.find((a) => a.id === s) ?? [...r].sort(Ne)[0];
581
+ return r.filter((a) => a.id !== l.id).sort((a, u) => a.id.localeCompare(u.id)).map((a) => ({
582
+ id: `discovery-variant:${encodeURIComponent(l.id)}:${encodeURIComponent(a.id)}`,
583
+ from: l.id,
584
+ to: a.id,
567
585
  kind: "variant"
568
586
  }));
569
587
  });
570
588
  }
571
- function Zt(e, t) {
589
+ function rn(e, t) {
572
590
  const o = /* @__PURE__ */ new Map();
573
591
  for (const r of e) {
574
- const n = W(r.route);
592
+ const n = L(r.route);
575
593
  if (!n) continue;
576
594
  const s = o.get(n);
577
595
  s ? s.push(r) : o.set(n, [r]);
578
596
  }
579
597
  return [...o.entries()].flatMap(([r, n]) => {
580
598
  const s = new Map(
581
- n.map((u) => [u.id, et(u)])
582
- ), d = t.get(r), c = n.find(
583
- (u) => u.id === d
599
+ n.map((u) => [u.id, rt(u)])
600
+ ), l = t.get(r), a = n.find(
601
+ (u) => u.id === l
584
602
  );
585
603
  return n.flatMap((u) => {
586
604
  const w = s.get(u.id);
587
605
  if (!w.length) return [];
588
- const h = n.filter(
589
- (P) => Xt(
590
- s.get(P.id),
606
+ const p = n.filter(
607
+ (E) => tn(
608
+ s.get(E.id),
591
609
  w
592
610
  )
593
- ).sort((P, b) => {
594
- const g = s.get(b.id).length - s.get(P.id).length;
595
- if (g !== 0) return g;
596
- const x = P.flow && P.flow === u.flow ? 0 : 1, f = b.flow && b.flow === u.flow ? 0 : 1;
597
- if (x !== f) return x - f;
598
- const N = P.section && P.section === u.section ? 0 : 1, D = b.section && b.section === u.section ? 0 : 1;
599
- if (N !== D) return N - D;
600
- const v = P.id === d ? 0 : 1, $ = b.id === d ? 0 : 1;
601
- return v !== $ ? v - $ : Pe(P, b);
611
+ ).sort((E, b) => {
612
+ const y = s.get(b.id).length - s.get(E.id).length;
613
+ if (y !== 0) return y;
614
+ const P = E.flow && E.flow === u.flow ? 0 : 1, f = b.flow && b.flow === u.flow ? 0 : 1;
615
+ if (P !== f) return P - f;
616
+ const R = E.section && E.section === u.section ? 0 : 1, D = b.section && b.section === u.section ? 0 : 1;
617
+ if (R !== D) return R - D;
618
+ const v = E.id === l ? 0 : 1, M = b.id === l ? 0 : 1;
619
+ return v !== M ? v - M : Ne(E, b);
602
620
  })[0];
603
- return h ? [
621
+ return p ? [
604
622
  {
605
- id: `discovery-recipe:${encodeURIComponent(h.id)}:${encodeURIComponent(u.id)}`,
606
- from: h.id,
623
+ id: `discovery-recipe:${encodeURIComponent(p.id)}:${encodeURIComponent(u.id)}`,
624
+ from: p.id,
607
625
  to: u.id,
608
626
  kind: "recipe-step"
609
627
  }
610
- ] : c && c.id !== u.id && s.get(c.id).join("") !== w.join("") ? [
628
+ ] : a && a.id !== u.id && s.get(a.id).join("") !== w.join("") ? [
611
629
  {
612
- id: `discovery-route-case:${encodeURIComponent(c.id)}:${encodeURIComponent(u.id)}`,
613
- from: c.id,
630
+ id: `discovery-route-case:${encodeURIComponent(a.id)}:${encodeURIComponent(u.id)}`,
631
+ from: a.id,
614
632
  to: u.id,
615
633
  kind: "route-case"
616
634
  }
@@ -618,7 +636,7 @@ function Zt(e, t) {
618
636
  });
619
637
  });
620
638
  }
621
- function en(e) {
639
+ function on(e) {
622
640
  var o;
623
641
  const t = /* @__PURE__ */ new Map();
624
642
  for (const r of e) {
@@ -629,148 +647,154 @@ function en(e) {
629
647
  }
630
648
  return [...t.values()].flatMap((r) => {
631
649
  const n = r[0], s = /* @__PURE__ */ new Map();
632
- for (const d of r) {
633
- const c = W(d.route);
634
- if (!c) continue;
635
- const u = s.get(c);
636
- u ? u.push(d) : s.set(c, [d]);
650
+ for (const l of r) {
651
+ const a = L(l.route);
652
+ if (!a) continue;
653
+ const u = s.get(a);
654
+ u ? u.push(l) : s.set(a, [l]);
637
655
  }
638
- return s.size < 2 ? [] : [...s.values()].flatMap((d) => {
639
- const c = [...d].sort(
640
- Pe
656
+ return s.size < 2 ? [] : [...s.values()].flatMap((l) => {
657
+ const a = [...l].sort(
658
+ Ne
641
659
  )[0];
642
- return c.id === n.id ? [] : [
660
+ return a.id === n.id ? [] : [
643
661
  {
644
- id: `discovery-flow-route:${encodeURIComponent(n.id)}:${encodeURIComponent(c.id)}`,
662
+ id: `discovery-flow-route:${encodeURIComponent(n.id)}:${encodeURIComponent(a.id)}`,
645
663
  from: n.id,
646
- to: c.id,
664
+ to: a.id,
647
665
  kind: "flow-route"
648
666
  }
649
667
  ];
650
668
  });
651
669
  });
652
670
  }
653
- function tn(e, t, o) {
671
+ function sn(e, t, o) {
654
672
  const r = new Set(
655
- (t.routes ?? []).map((n) => W(n.path)).filter((n) => !!n)
673
+ (t.routes ?? []).map((n) => L(n.path)).filter((n) => !!n)
656
674
  );
657
675
  return e.map((n) => {
658
- const s = W(n.route);
676
+ const s = L(n.route);
659
677
  if (!s || o.get(s) !== n.id)
660
678
  return n;
661
- const d = [...r].filter(
662
- (c) => Oe(c, s)
679
+ const l = [...r].filter(
680
+ (a) => Te(a, s)
663
681
  );
664
- return d.length ? {
682
+ return l.length ? {
665
683
  ...n,
666
684
  scenarioIds: [
667
685
  .../* @__PURE__ */ new Set([
668
686
  ...n.scenarioIds ?? [],
669
- ...d.map(Ze)
687
+ ...l.map(nt)
670
688
  ])
671
- ].sort((c, u) => c.localeCompare(u))
689
+ ].sort((a, u) => a.localeCompare(u))
672
690
  } : n;
673
691
  });
674
692
  }
675
- function nn(e, t) {
676
- var w, p, h, P, b;
677
- const o = new Set(e.map((g) => g.id)), r = new Map(
678
- e.map((g, x) => [g.id, x])
679
- ), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
680
- for (const g of o)
681
- n.set(g, /* @__PURE__ */ new Set()), s.set(g, /* @__PURE__ */ new Set()), d.set(g, /* @__PURE__ */ new Set());
682
- for (const g of t) {
683
- const x = [
684
- ...(g.fromScope ?? [g.from]).map(
685
- (f) => [f, g.to]
693
+ function an(e, t) {
694
+ var w, h, p, E, b;
695
+ const o = new Set(e.map((y) => y.id)), r = new Map(
696
+ e.map((y, P) => [y.id, P])
697
+ ), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
698
+ for (const y of o)
699
+ n.set(y, /* @__PURE__ */ new Set()), s.set(y, /* @__PURE__ */ new Set()), l.set(y, /* @__PURE__ */ new Set());
700
+ for (const y of t) {
701
+ const P = [
702
+ ...(y.fromScope ?? [y.from]).map(
703
+ (f) => [f, y.to]
686
704
  ),
687
- ...(g.toScope ?? [g.to]).map(
688
- (f) => [g.from, f]
705
+ ...(y.toScope ?? [y.to]).map(
706
+ (f) => [y.from, f]
689
707
  )
690
708
  ];
691
- for (const [f, N] of x)
692
- !o.has(f) || !o.has(N) || ((w = n.get(N)) == null || w.add(f), (p = s.get(f)) == null || p.add(N), (h = d.get(f)) == null || h.add(N), (P = d.get(N)) == null || P.add(f));
709
+ for (const [f, R] of P)
710
+ !o.has(f) || !o.has(R) || ((w = n.get(R)) == null || w.add(f), (h = s.get(f)) == null || h.add(R), (p = l.get(f)) == null || p.add(R), (E = l.get(R)) == null || E.add(f));
693
711
  }
694
- const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
695
- for (const g of o) {
696
- if (u.has(g)) continue;
697
- const x = [], f = [g];
712
+ const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
713
+ for (const y of o) {
714
+ if (u.has(y)) continue;
715
+ const P = [], f = [y];
698
716
  for (; f.length; ) {
699
- const I = f.shift();
700
- if (!u.has(I)) {
701
- u.add(I), x.push(I);
702
- for (const E of d.get(I) ?? [])
703
- u.has(E) || f.push(E);
717
+ const x = f.shift();
718
+ if (!u.has(x)) {
719
+ u.add(x), P.push(x);
720
+ for (const C of l.get(x) ?? [])
721
+ u.has(C) || f.push(C);
704
722
  }
705
723
  }
706
- if (x.length === 1 && (((b = d.get(x[0])) == null ? void 0 : b.size) ?? 0) === 0)
724
+ if (P.length === 1 && (((b = l.get(P[0])) == null ? void 0 : b.size) ?? 0) === 0)
707
725
  continue;
708
- const N = x.filter((I) => {
709
- var E;
710
- return (((E = n.get(I)) == null ? void 0 : E.size) ?? 0) === 0;
726
+ const R = P.filter((x) => {
727
+ var C;
728
+ return (((C = n.get(x)) == null ? void 0 : C.size) ?? 0) === 0;
711
729
  }).sort(
712
- (I, E) => (r.get(I) ?? Number.MAX_SAFE_INTEGER) - (r.get(E) ?? Number.MAX_SAFE_INTEGER) || I.localeCompare(E)
713
- ), D = [...x].sort(
714
- (I, E) => (r.get(I) ?? Number.MAX_SAFE_INTEGER) - (r.get(E) ?? Number.MAX_SAFE_INTEGER) || I.localeCompare(E)
730
+ (x, C) => (r.get(x) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || x.localeCompare(C)
731
+ ), D = [...P].sort(
732
+ (x, C) => (r.get(x) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || x.localeCompare(C)
715
733
  )[0];
716
734
  if (!D) continue;
717
- const v = [D], $ = /* @__PURE__ */ new Set(), ee = (I) => {
718
- const E = [I];
719
- for (; E.length; ) {
720
- const _ = E.shift();
721
- if (!$.has(_)) {
722
- $.add(_);
723
- for (const z of s.get(_) ?? [])
724
- $.has(z) || E.push(z);
735
+ const v = [D], M = /* @__PURE__ */ new Set(), te = (x) => {
736
+ const C = [x];
737
+ for (; C.length; ) {
738
+ const j = C.shift();
739
+ if (!M.has(j)) {
740
+ M.add(j);
741
+ for (const H of s.get(j) ?? [])
742
+ M.has(H) || C.push(H);
725
743
  }
726
744
  }
727
745
  };
728
- ee(D);
729
- for (const I of N)
730
- $.has(I) || (v.push(I), ee(I));
731
- for (const I of v)
732
- c.add(I);
746
+ te(D);
747
+ for (const x of R)
748
+ M.has(x) || (v.push(x), te(x));
749
+ for (const x of v)
750
+ a.add(x);
733
751
  }
734
- return [...c].sort(
735
- (g, x) => (r.get(g) ?? Number.MAX_SAFE_INTEGER) - (r.get(x) ?? Number.MAX_SAFE_INTEGER) || g.localeCompare(x)
752
+ return [...a].sort(
753
+ (y, P) => (r.get(y) ?? Number.MAX_SAFE_INTEGER) - (r.get(P) ?? Number.MAX_SAFE_INTEGER) || y.localeCompare(P)
736
754
  );
737
755
  }
738
- function tt(e) {
756
+ function ot(e) {
739
757
  var t, o;
740
- return Ht(
758
+ return Lt(
741
759
  (o = (t = e.scenarios) == null ? void 0 : t.find(
742
760
  (r) => r.id === "environment:baseline"
743
761
  )) == null ? void 0 : o.environment
744
762
  );
745
763
  }
746
- function rn(e) {
747
- const t = Wt(
764
+ function cn(e) {
765
+ var u, w, h, p, E;
766
+ const t = Xt(
748
767
  e.pages,
749
768
  e.manifest
750
- ), o = Vt(t), r = Jt(t), n = tn(
769
+ ), o = Yt(t), r = Zt(t), n = sn(
751
770
  t,
752
771
  e.manifest,
753
772
  o
754
- ), d = [
755
- ...Gt(
773
+ ), l = [
774
+ ...Jt(
756
775
  e.manifest.edges,
757
776
  o,
758
777
  r,
759
- new Set(n.map((c) => c.id))
778
+ new Set(n.map((b) => b.id))
760
779
  ),
761
- ...Yt(n, o),
762
- ...Zt(n, o),
763
- ...en(n)
780
+ ...nn(n, o),
781
+ ...rn(n, o),
782
+ ...on(n)
783
+ ], a = [
784
+ ...((u = e.storyboard) == null ? void 0 : u.edges) ?? [],
785
+ ...Ut(((w = e.storyboard) == null ? void 0 : w.paths) ?? [])
764
786
  ];
765
- return Ut({
787
+ return Gt({
766
788
  screens: n,
767
789
  assets: e.assets,
768
- scenarios: Kt(e.manifest.routes),
769
- inferredEdges: d,
770
- startScreenIds: nn(n, d)
790
+ scenarios: Wt(e.manifest.routes),
791
+ explicitEdges: a,
792
+ inferredEdges: l,
793
+ startScreenIds: (p = (h = e.storyboard) == null ? void 0 : h.startScreenIds) != null && p.length ? e.storyboard.startScreenIds : an(n, [...a, ...l]),
794
+ nonVisualScenarioIds: (E = e.storyboard) == null ? void 0 : E.nonVisualScenarioIds
771
795
  });
772
796
  }
773
- async function nt(e) {
797
+ async function st(e) {
774
798
  const o = await (e.fetcher ?? ((n, s) => fetch(n, s)))(e.endpoint, {
775
799
  headers: { accept: "application/json" },
776
800
  cache: "no-store",
@@ -779,41 +803,42 @@ async function nt(e) {
779
803
  if (!o.ok)
780
804
  throw new Error(`Storyboard discovery failed (${o.status})`);
781
805
  const r = await o.json();
782
- if (!qt(r))
806
+ if (!Vt(r))
783
807
  throw new Error("Storyboard discovery returned an invalid manifest.");
784
808
  return {
785
809
  manifest: r,
786
- baselineEnvironment: tt(r),
787
- graph: rn({
810
+ baselineEnvironment: ot(r),
811
+ graph: cn({
788
812
  manifest: r,
789
813
  pages: e.pages,
790
- assets: e.assets
814
+ assets: e.assets,
815
+ storyboard: e.storyboard
791
816
  })
792
817
  };
793
818
  }
794
- async function Pn(e) {
795
- ae(null);
819
+ async function Nn(e) {
820
+ se(null);
796
821
  try {
797
- const t = await nt(e);
798
- return ae(t.graph), t;
822
+ const t = await st(e);
823
+ return se(t.graph), t;
799
824
  } catch (t) {
800
- throw ae(null), t;
825
+ throw se(null), t;
801
826
  }
802
827
  }
803
- const Se = "var(--pygmalion-catalog-surface, #ffffff)", Ie = "var(--pygmalion-catalog-canvas, #f5f5f5)", Me = "var(--pygmalion-catalog-border, #e5e7eb)", xe = "var(--pygmalion-catalog-text, #202124)", K = "var(--pygmalion-catalog-muted, #6b7280)", on = "var(--pygmalion-catalog-header, #11182f)", sn = "var(--pygmalion-catalog-accent, #7c6cf2)";
804
- function En({
828
+ const Ee = "var(--pygmalion-catalog-surface, #ffffff)", Ce = "var(--pygmalion-catalog-canvas, #f5f5f5)", ke = "var(--pygmalion-catalog-border, #e5e7eb)", Re = "var(--pygmalion-catalog-text, #202124)", G = "var(--pygmalion-catalog-muted, #6b7280)", ln = "var(--pygmalion-catalog-header, #11182f)", dn = "var(--pygmalion-catalog-accent, #7c6cf2)";
829
+ function An({
805
830
  title: e,
806
831
  eyebrow: t,
807
832
  description: o,
808
833
  version: r,
809
834
  meta: n,
810
835
  children: s,
811
- headerBackground: d = on,
812
- headerColor: c = "#ffffff",
813
- bodyBackground: u = Se,
836
+ headerBackground: l = ln,
837
+ headerColor: a = "#ffffff",
838
+ bodyBackground: u = Ee,
814
839
  bodyGap: w = 40
815
840
  }) {
816
- return /* @__PURE__ */ M(
841
+ return /* @__PURE__ */ $(
817
842
  "section",
818
843
  {
819
844
  "data-pygmalion-catalog-document": "",
@@ -825,12 +850,12 @@ function En({
825
850
  maxWidth: "none",
826
851
  flexDirection: "column",
827
852
  overflow: "visible",
828
- color: xe,
853
+ color: Re,
829
854
  background: u,
830
855
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
831
856
  },
832
857
  children: [
833
- /* @__PURE__ */ M(
858
+ /* @__PURE__ */ $(
834
859
  "header",
835
860
  {
836
861
  style: {
@@ -840,11 +865,11 @@ function En({
840
865
  justifyContent: "space-between",
841
866
  gap: 48,
842
867
  padding: "44px 48px 48px",
843
- color: c,
844
- background: d
868
+ color: a,
869
+ background: l
845
870
  },
846
871
  children: [
847
- /* @__PURE__ */ M("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
872
+ /* @__PURE__ */ $("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
848
873
  t ? /* @__PURE__ */ S(
849
874
  "div",
850
875
  {
@@ -885,7 +910,7 @@ function En({
885
910
  }
886
911
  ) : null
887
912
  ] }),
888
- r || n ? /* @__PURE__ */ M(
913
+ r || n ? /* @__PURE__ */ $(
889
914
  "div",
890
915
  {
891
916
  style: {
@@ -925,7 +950,7 @@ function En({
925
950
  }
926
951
  );
927
952
  }
928
- function Cn({
953
+ function $n({
929
954
  title: e,
930
955
  itemId: t,
931
956
  count: o,
@@ -933,7 +958,7 @@ function Cn({
933
958
  children: n,
934
959
  tone: s = "tinted"
935
960
  }) {
936
- return /* @__PURE__ */ M(
961
+ return /* @__PURE__ */ $(
937
962
  "section",
938
963
  {
939
964
  "data-pygmalion-catalog-section": "",
@@ -946,10 +971,10 @@ function Cn({
946
971
  alignItems: "flex-start",
947
972
  gap: 18,
948
973
  padding: s === "tinted" ? 24 : 0,
949
- background: s === "tinted" ? Ie : "transparent"
974
+ background: s === "tinted" ? Ce : "transparent"
950
975
  },
951
976
  children: [
952
- /* @__PURE__ */ M("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
977
+ /* @__PURE__ */ $("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
953
978
  /* @__PURE__ */ S(
954
979
  "h2",
955
980
  {
@@ -962,23 +987,23 @@ function Cn({
962
987
  children: e
963
988
  }
964
989
  ),
965
- typeof o == "number" ? /* @__PURE__ */ S("span", { style: { color: K, fontSize: 11 }, children: o }) : null
990
+ typeof o == "number" ? /* @__PURE__ */ S("span", { style: { color: G, fontSize: 11 }, children: o }) : null
966
991
  ] }),
967
- r ? /* @__PURE__ */ S("div", { style: { marginTop: -10, color: K, fontSize: 11 }, children: r }) : null,
992
+ r ? /* @__PURE__ */ S("div", { style: { marginTop: -10, color: G, fontSize: 11 }, children: r }) : null,
968
993
  n
969
994
  ]
970
995
  }
971
996
  );
972
997
  }
973
- function Rn({
998
+ function Mn({
974
999
  rows: e,
975
1000
  columns: t,
976
1001
  cornerLabel: o,
977
1002
  renderCell: r,
978
1003
  renderRowLabel: n = (u) => u,
979
1004
  renderColumnLabel: s = (u) => u,
980
- boundary: d = !0,
981
- cellStyle: c
1005
+ boundary: l = !0,
1006
+ cellStyle: a
982
1007
  }) {
983
1008
  return /* @__PURE__ */ S(
984
1009
  "div",
@@ -988,11 +1013,11 @@ function Rn({
988
1013
  boxSizing: "border-box",
989
1014
  display: "inline-block",
990
1015
  width: "max-content",
991
- padding: d ? 16 : 0,
992
- border: d ? `1px dashed ${sn}` : void 0,
993
- borderRadius: d ? 4 : void 0
1016
+ padding: l ? 16 : 0,
1017
+ border: l ? `1px dashed ${dn}` : void 0,
1018
+ borderRadius: l ? 4 : void 0
994
1019
  },
995
- children: /* @__PURE__ */ M(
1020
+ children: /* @__PURE__ */ $(
996
1021
  "table",
997
1022
  {
998
1023
  style: {
@@ -1001,13 +1026,13 @@ function Rn({
1001
1026
  borderSpacing: 0
1002
1027
  },
1003
1028
  children: [
1004
- /* @__PURE__ */ S("thead", { children: /* @__PURE__ */ M("tr", { children: [
1029
+ /* @__PURE__ */ S("thead", { children: /* @__PURE__ */ $("tr", { children: [
1005
1030
  /* @__PURE__ */ S(
1006
1031
  "th",
1007
1032
  {
1008
1033
  style: {
1009
1034
  padding: "0 16px 12px 0",
1010
- color: K,
1035
+ color: G,
1011
1036
  fontSize: 10,
1012
1037
  fontWeight: 600,
1013
1038
  textAlign: "left",
@@ -1021,7 +1046,7 @@ function Rn({
1021
1046
  {
1022
1047
  style: {
1023
1048
  padding: "0 16px 12px",
1024
- color: K,
1049
+ color: G,
1025
1050
  fontSize: 10,
1026
1051
  fontWeight: 600,
1027
1052
  textAlign: "center",
@@ -1032,13 +1057,13 @@ function Rn({
1032
1057
  u
1033
1058
  ))
1034
1059
  ] }) }),
1035
- /* @__PURE__ */ S("tbody", { children: e.map((u) => /* @__PURE__ */ M("tr", { children: [
1060
+ /* @__PURE__ */ S("tbody", { children: e.map((u) => /* @__PURE__ */ $("tr", { children: [
1036
1061
  /* @__PURE__ */ S(
1037
1062
  "th",
1038
1063
  {
1039
1064
  style: {
1040
1065
  padding: "12px 16px 12px 0",
1041
- color: K,
1066
+ color: G,
1042
1067
  fontSize: 10,
1043
1068
  fontWeight: 600,
1044
1069
  textAlign: "left",
@@ -1054,7 +1079,7 @@ function Rn({
1054
1079
  padding: "12px 16px",
1055
1080
  textAlign: "center",
1056
1081
  verticalAlign: "middle",
1057
- ...c
1082
+ ...a
1058
1083
  },
1059
1084
  children: r(u, w)
1060
1085
  },
@@ -1067,14 +1092,14 @@ function Rn({
1067
1092
  }
1068
1093
  );
1069
1094
  }
1070
- function an(e) {
1095
+ function un(e) {
1071
1096
  return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
1072
1097
  }
1073
- function rt(e, t, o = "PygmalionCatalog") {
1074
- const r = (n) => an(n).replace(/-/g, "_");
1098
+ function it(e, t, o = "PygmalionCatalog") {
1099
+ const r = (n) => un(n).replace(/-/g, "_");
1075
1100
  return `${o}_${r(e)}_${r(t)}`;
1076
1101
  }
1077
- function ot(e, t) {
1102
+ function at(e, t) {
1078
1103
  return {
1079
1104
  id: e.id,
1080
1105
  name: e.name,
@@ -1085,7 +1110,7 @@ function ot(e, t) {
1085
1110
  description: e.description
1086
1111
  };
1087
1112
  }
1088
- function st(e) {
1113
+ function ct(e) {
1089
1114
  const t = /* @__PURE__ */ new Set();
1090
1115
  for (const o of e) {
1091
1116
  if (t.has(o.id))
@@ -1093,17 +1118,17 @@ function st(e) {
1093
1118
  t.add(o.id);
1094
1119
  }
1095
1120
  }
1096
- function cn(e, t, o) {
1121
+ function fn(e, t, o) {
1097
1122
  return typeof e == "function" ? e(t, o) : e;
1098
1123
  }
1099
- function ln({
1124
+ function mn({
1100
1125
  page: e,
1101
1126
  items: t,
1102
1127
  renderPreview: o,
1103
1128
  secondaryLabel: r,
1104
1129
  minimumColumnWidth: n
1105
1130
  }) {
1106
- return /* @__PURE__ */ M(
1131
+ return /* @__PURE__ */ $(
1107
1132
  "section",
1108
1133
  {
1109
1134
  "data-pygmalion-catalog-page": e.id,
@@ -1113,14 +1138,14 @@ function ln({
1113
1138
  display: "inline-block",
1114
1139
  width: "max-content",
1115
1140
  padding: 32,
1116
- color: xe,
1117
- background: Ie,
1141
+ color: Re,
1142
+ background: Ce,
1118
1143
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1119
1144
  },
1120
1145
  children: [
1121
- /* @__PURE__ */ M("header", { style: { marginBottom: 24 }, children: [
1146
+ /* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
1122
1147
  /* @__PURE__ */ S("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
1123
- /* @__PURE__ */ M("p", { style: { margin: "6px 0 0", color: K, fontSize: 13 }, children: [
1148
+ /* @__PURE__ */ $("p", { style: { margin: "6px 0 0", color: G, fontSize: 13 }, children: [
1124
1149
  t.length,
1125
1150
  " assets"
1126
1151
  ] })
@@ -1133,7 +1158,7 @@ function ln({
1133
1158
  gridTemplateColumns: "repeat(6, max-content)",
1134
1159
  gap: 16
1135
1160
  },
1136
- children: t.map((s) => /* @__PURE__ */ M(
1161
+ children: t.map((s) => /* @__PURE__ */ $(
1137
1162
  "article",
1138
1163
  {
1139
1164
  "data-pygmalion-catalog-item": s.id,
@@ -1141,9 +1166,9 @@ function ln({
1141
1166
  minWidth: n,
1142
1167
  width: n,
1143
1168
  padding: 16,
1144
- border: `1px solid ${Me}`,
1169
+ border: `1px solid ${ke}`,
1145
1170
  borderRadius: 12,
1146
- background: Se
1171
+ background: Ee
1147
1172
  },
1148
1173
  children: [
1149
1174
  /* @__PURE__ */ S(
@@ -1174,13 +1199,13 @@ function ln({
1174
1199
  children: s.name
1175
1200
  }
1176
1201
  ),
1177
- r ? /* @__PURE__ */ S("div", { style: { marginTop: 4, color: K, fontSize: 11, lineHeight: 1.45 }, children: r(s) }) : s.codeName ? /* @__PURE__ */ S(
1202
+ r ? /* @__PURE__ */ S("div", { style: { marginTop: 4, color: G, fontSize: 11, lineHeight: 1.45 }, children: r(s) }) : s.codeName ? /* @__PURE__ */ S(
1178
1203
  "div",
1179
1204
  {
1180
1205
  style: {
1181
1206
  marginTop: 4,
1182
1207
  overflow: "hidden",
1183
- color: K,
1208
+ color: G,
1184
1209
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
1185
1210
  fontSize: 11,
1186
1211
  textOverflow: "ellipsis",
@@ -1200,21 +1225,21 @@ function ln({
1200
1225
  }
1201
1226
  );
1202
1227
  }
1203
- function Nn(e) {
1204
- st(e.items);
1228
+ function On(e) {
1229
+ ct(e.items);
1205
1230
  const t = /* @__PURE__ */ new Map();
1206
1231
  for (const n of e.items) {
1207
- const s = e.pageFor(n), d = t.get(s.id);
1208
- if (d) {
1209
- if (d.page.name !== s.name || d.page.section !== s.section)
1232
+ const s = e.pageFor(n), l = t.get(s.id);
1233
+ if (l) {
1234
+ if (l.page.name !== s.name || l.page.section !== s.section)
1210
1235
  throw new Error(`Conflicting design catalog page descriptor: ${s.id}`);
1211
- d.items.push(n);
1236
+ l.items.push(n);
1212
1237
  continue;
1213
1238
  }
1214
1239
  t.set(s.id, {
1215
1240
  page: s,
1216
1241
  items: [n],
1217
- registryName: rt(
1242
+ registryName: it(
1218
1243
  e.kind,
1219
1244
  s.id,
1220
1245
  e.registryPrefix
@@ -1224,7 +1249,7 @@ function Nn(e) {
1224
1249
  const o = {}, r = [];
1225
1250
  for (const n of t.values()) {
1226
1251
  const s = () => /* @__PURE__ */ S(
1227
- ln,
1252
+ mn,
1228
1253
  {
1229
1254
  page: n.page,
1230
1255
  items: n.items,
@@ -1237,34 +1262,34 @@ function Nn(e) {
1237
1262
  component: s,
1238
1263
  children: "none"
1239
1264
  };
1240
- const d = cn(e.frame, n.page, n.items);
1265
+ const l = fn(e.frame, n.page, n.items);
1241
1266
  r.push({
1242
1267
  ...n.page,
1243
1268
  componentName: n.registryName,
1244
- width: (d == null ? void 0 : d.width) ?? 1,
1245
- height: (d == null ? void 0 : d.height) ?? 1,
1246
- frameSizeMode: d ? "fixed" : "content"
1269
+ width: (l == null ? void 0 : l.width) ?? 1,
1270
+ height: (l == null ? void 0 : l.height) ?? 1,
1271
+ frameSizeMode: l ? "fixed" : "content"
1247
1272
  });
1248
1273
  }
1249
1274
  return {
1250
1275
  registry: o,
1251
1276
  collection: {
1252
1277
  expectedCount: e.expectedCount ?? e.items.length,
1253
- assets: e.items.map((n) => ot(n, e.pageFor(n).id)),
1278
+ assets: e.items.map((n) => at(n, e.pageFor(n).id)),
1254
1279
  pages: r
1255
1280
  }
1256
1281
  };
1257
1282
  }
1258
- function dn(e, t = 60) {
1259
- const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, u], [w, p]) => p.length - u.length || c.localeCompare(w)), r = o[0], n = o[1], s = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), d = n == null ? void 0 : n[1].slice(0, Math.max(1, Math.floor(t / s)));
1283
+ function hn(e, t = 60) {
1284
+ const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, a]) => a.length > 0).sort(([a, u], [w, h]) => h.length - u.length || a.localeCompare(w)), r = o[0], n = o[1], s = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), l = n == null ? void 0 : n[1].slice(0, Math.max(1, Math.floor(t / s)));
1260
1285
  return {
1261
1286
  row: r,
1262
- column: n ? [n[0], d ?? []] : void 0,
1263
- fixed: o.slice(2).map(([c, u]) => [c, u[0]]),
1287
+ column: n ? [n[0], l ?? []] : void 0,
1288
+ fixed: o.slice(2).map(([a, u]) => [a, u[0]]),
1264
1289
  additional: o.slice(2)
1265
1290
  };
1266
1291
  }
1267
- function un(e, t, o, r) {
1292
+ function pn(e, t, o, r) {
1268
1293
  return {
1269
1294
  ...e.defaultProps,
1270
1295
  ...Object.fromEntries(t.fixed),
@@ -1272,14 +1297,14 @@ function un(e, t, o, r) {
1272
1297
  ...t.column && r ? { [t.column[0]]: r } : {}
1273
1298
  };
1274
1299
  }
1275
- function fn({
1300
+ function gn({
1276
1301
  item: e,
1277
1302
  entry: t,
1278
1303
  maxVariantCells: o
1279
1304
  }) {
1280
- var c, u;
1305
+ var a, u;
1281
1306
  if (!t)
1282
- return /* @__PURE__ */ M(
1307
+ return /* @__PURE__ */ $(
1283
1308
  "section",
1284
1309
  {
1285
1310
  "data-pygmalion-catalog-component": e.id,
@@ -1289,17 +1314,17 @@ function fn({
1289
1314
  display: "inline-block",
1290
1315
  width: "max-content",
1291
1316
  padding: 32,
1292
- color: xe,
1293
- background: Ie
1317
+ color: Re,
1318
+ background: Ce
1294
1319
  },
1295
1320
  children: [
1296
1321
  /* @__PURE__ */ S("strong", { children: e.name }),
1297
- /* @__PURE__ */ S("p", { style: { color: K }, children: "The component is not registered." })
1322
+ /* @__PURE__ */ S("p", { style: { color: G }, children: "The component is not registered." })
1298
1323
  ]
1299
1324
  }
1300
1325
  );
1301
- const r = dn(t, o), n = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0], d = t.component;
1302
- return /* @__PURE__ */ M(
1326
+ const r = hn(t, o), n = ((a = r.row) == null ? void 0 : a[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0], l = t.component;
1327
+ return /* @__PURE__ */ $(
1303
1328
  "section",
1304
1329
  {
1305
1330
  "data-pygmalion-catalog-component": e.id,
@@ -1309,14 +1334,14 @@ function fn({
1309
1334
  display: "inline-block",
1310
1335
  width: "max-content",
1311
1336
  padding: 32,
1312
- color: xe,
1313
- background: Ie,
1337
+ color: Re,
1338
+ background: Ce,
1314
1339
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1315
1340
  },
1316
1341
  children: [
1317
- /* @__PURE__ */ M("header", { style: { marginBottom: 24 }, children: [
1342
+ /* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
1318
1343
  /* @__PURE__ */ S("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
1319
- e.sourcePath ? /* @__PURE__ */ S("p", { style: { margin: "6px 0 0", color: K, fontSize: 12 }, children: e.sourcePath }) : null
1344
+ e.sourcePath ? /* @__PURE__ */ S("p", { style: { margin: "6px 0 0", color: G, fontSize: 12 }, children: e.sourcePath }) : null
1320
1345
  ] }),
1321
1346
  /* @__PURE__ */ S(
1322
1347
  "div",
@@ -1327,90 +1352,90 @@ function fn({
1327
1352
  gap: 12
1328
1353
  },
1329
1354
  children: n.flatMap(
1330
- (w) => s.map((p) => {
1331
- const h = un(t, r, w, p), P = [
1355
+ (w) => s.map((h) => {
1356
+ const p = pn(t, r, w, h), E = [
1332
1357
  r.row && w ? `${r.row[0]}=${w}` : "",
1333
- r.column && p ? `${r.column[0]}=${p}` : ""
1358
+ r.column && h ? `${r.column[0]}=${h}` : ""
1334
1359
  ].filter(Boolean).join(" · ");
1335
- return /* @__PURE__ */ M(
1360
+ return /* @__PURE__ */ $(
1336
1361
  "article",
1337
1362
  {
1338
1363
  style: {
1339
1364
  width: "max-content",
1340
1365
  padding: 16,
1341
- border: `1px solid ${Me}`,
1366
+ border: `1px solid ${ke}`,
1342
1367
  borderRadius: 10,
1343
- background: Se
1368
+ background: Ee
1344
1369
  },
1345
1370
  children: [
1346
- P ? /* @__PURE__ */ S("div", { style: { marginBottom: 12, color: K, fontSize: 11 }, children: P }) : null,
1347
- /* @__PURE__ */ S("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: He(
1348
- d,
1349
- h,
1371
+ E ? /* @__PURE__ */ S("div", { style: { marginBottom: 12, color: G, fontSize: 11 }, children: E }) : null,
1372
+ /* @__PURE__ */ S("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Ge(
1373
+ l,
1374
+ p,
1350
1375
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1351
1376
  ) })
1352
1377
  ]
1353
1378
  },
1354
- `${w ?? "default"}:${p ?? "default"}`
1379
+ `${w ?? "default"}:${h ?? "default"}`
1355
1380
  );
1356
1381
  })
1357
1382
  )
1358
1383
  }
1359
1384
  ),
1360
- r.additional.map(([w, p]) => /* @__PURE__ */ M("section", { style: { marginTop: 20 }, children: [
1361
- /* @__PURE__ */ S("h2", { style: { margin: "0 0 10px", color: K, fontSize: 12 }, children: w }),
1362
- /* @__PURE__ */ S("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: p.map((h) => /* @__PURE__ */ M(
1385
+ r.additional.map(([w, h]) => /* @__PURE__ */ $("section", { style: { marginTop: 20 }, children: [
1386
+ /* @__PURE__ */ S("h2", { style: { margin: "0 0 10px", color: G, fontSize: 12 }, children: w }),
1387
+ /* @__PURE__ */ S("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: h.map((p) => /* @__PURE__ */ $(
1363
1388
  "article",
1364
1389
  {
1365
1390
  style: {
1366
1391
  padding: 16,
1367
- border: `1px solid ${Me}`,
1392
+ border: `1px solid ${ke}`,
1368
1393
  borderRadius: 10,
1369
- background: Se
1394
+ background: Ee
1370
1395
  },
1371
1396
  children: [
1372
- /* @__PURE__ */ S("div", { style: { marginBottom: 12, color: K, fontSize: 11 }, children: h }),
1373
- He(
1374
- d,
1375
- { ...t.defaultProps, [w]: h },
1397
+ /* @__PURE__ */ S("div", { style: { marginBottom: 12, color: G, fontSize: 11 }, children: p }),
1398
+ Ge(
1399
+ l,
1400
+ { ...t.defaultProps, [w]: p },
1376
1401
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1377
1402
  )
1378
1403
  ]
1379
1404
  },
1380
- h
1405
+ p
1381
1406
  )) })
1382
1407
  ] }, w))
1383
1408
  ]
1384
1409
  }
1385
1410
  );
1386
1411
  }
1387
- function An(e) {
1388
- st(e.items);
1412
+ function Dn(e) {
1413
+ ct(e.items);
1389
1414
  const t = {}, o = [], r = [], n = e.maxVariantCells ?? 60;
1390
1415
  for (const s of e.items) {
1391
- const d = rt(
1416
+ const l = it(
1392
1417
  e.kind,
1393
1418
  s.id,
1394
1419
  e.registryPrefix
1395
- ), c = e.registry[s.name], u = () => /* @__PURE__ */ S(
1396
- fn,
1420
+ ), a = e.registry[s.name], u = () => /* @__PURE__ */ S(
1421
+ gn,
1397
1422
  {
1398
1423
  item: s,
1399
- entry: c,
1424
+ entry: a,
1400
1425
  maxVariantCells: n
1401
1426
  }
1402
1427
  );
1403
- t[d] = { component: u, children: "none" }, o.push({
1428
+ t[l] = { component: u, children: "none" }, o.push({
1404
1429
  id: s.id,
1405
1430
  name: s.name,
1406
1431
  section: s.section,
1407
- componentName: d,
1432
+ componentName: l,
1408
1433
  // The seed exists only long enough to mount the intrinsic max-content
1409
1434
  // catalog root. The editor replaces it with actual rendered DOM bounds.
1410
1435
  width: 1,
1411
1436
  height: 1,
1412
1437
  frameSizeMode: "content"
1413
- }), r.push(ot(s, s.id));
1438
+ }), r.push(at(s, s.id));
1414
1439
  }
1415
1440
  return {
1416
1441
  registry: t,
@@ -1421,34 +1446,34 @@ function An(e) {
1421
1446
  }
1422
1447
  };
1423
1448
  }
1424
- const We = /^[a-f0-9]{64}$/, mn = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, pn = /^p\d+$/;
1425
- function $e(e) {
1426
- return typeof e == "string" && mn.test(e) ? e : void 0;
1449
+ const Qe = /^[a-f0-9]{64}$/, yn = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, wn = /^p\d+$/;
1450
+ function Fe(e) {
1451
+ return typeof e == "string" && yn.test(e) ? e : void 0;
1427
1452
  }
1428
- function Ve(e, t) {
1453
+ function Xe(e, t) {
1429
1454
  const o = new URL(e, t);
1430
1455
  return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
1431
1456
  }
1432
- function Re(e) {
1457
+ function Me(e) {
1433
1458
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1434
1459
  const t = e;
1435
- return typeof t.domStructureHash != "string" || !We.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !We.test(t.screenshotHash) ? null : {
1460
+ return typeof t.domStructureHash != "string" || !Qe.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !Qe.test(t.screenshotHash) ? null : {
1436
1461
  domStructureHash: t.domStructureHash,
1437
1462
  screenshotHash: t.screenshotHash,
1438
- ...$e(t.screenshotUrl) ? { screenshotUrl: $e(t.screenshotUrl) } : {}
1463
+ ...Fe(t.screenshotUrl) ? { screenshotUrl: Fe(t.screenshotUrl) } : {}
1439
1464
  };
1440
1465
  }
1441
- function Je(e) {
1466
+ function Ye(e) {
1442
1467
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1443
1468
  const t = e;
1444
1469
  return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
1445
1470
  }
1446
- function hn(e) {
1471
+ function bn(e) {
1447
1472
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1448
- const t = e, o = Je(t.before), r = Je(t.after);
1473
+ const t = e, o = Ye(t.before), r = Ye(t.after);
1449
1474
  if (!o || !r || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
1450
1475
  return null;
1451
- const n = t.heatmapUrl == null ? null : $e(t.heatmapUrl) ?? null;
1476
+ const n = t.heatmapUrl == null ? null : Fe(t.heatmapUrl) ?? null;
1452
1477
  return {
1453
1478
  before: o,
1454
1479
  after: r,
@@ -1460,15 +1485,15 @@ function hn(e) {
1460
1485
  heatmapUrl: n
1461
1486
  };
1462
1487
  }
1463
- function gn(e, t) {
1488
+ function vn(e, t) {
1464
1489
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1465
1490
  const o = e;
1466
1491
  if (typeof o.id != "string" || !o.id) return null;
1467
- const r = Re(o), n = Re(o.before) ?? r;
1492
+ const r = Me(o), n = Me(o.before) ?? r;
1468
1493
  if (!n) return null;
1469
- const s = Re(o.after);
1494
+ const s = Me(o.after);
1470
1495
  if (t === "changed" && !s) return null;
1471
- const d = s ? hn(o.pixelDiff) : null;
1496
+ const l = s ? bn(o.pixelDiff) : null;
1472
1497
  return {
1473
1498
  id: o.id,
1474
1499
  before: n,
@@ -1477,26 +1502,26 @@ function gn(e, t) {
1477
1502
  domChanged: n.domStructureHash !== s.domStructureHash,
1478
1503
  screenshotChanged: n.screenshotHash !== s.screenshotHash
1479
1504
  } : {},
1480
- ...d ? { pixelDiff: d } : {}
1505
+ ...l ? { pixelDiff: l } : {}
1481
1506
  };
1482
1507
  }
1483
- function yn(e, t = []) {
1508
+ function Sn(e, t = []) {
1484
1509
  const o = new Set(t), r = o.size > 0, n = /* @__PURE__ */ new Set(), s = [
1485
- ...e.styles.map((d) => d.affectedFrames ?? []),
1486
- ...e.texts.map((d) => d.affectedFrames ?? []),
1487
- ...e.operations.map((d) => d.affectedFrames ?? [])
1510
+ ...e.styles.map((l) => l.affectedFrames ?? []),
1511
+ ...e.texts.map((l) => l.affectedFrames ?? []),
1512
+ ...e.operations.map((l) => l.affectedFrames ?? [])
1488
1513
  ];
1489
- for (const d of s)
1490
- for (const c of d) {
1491
- if (r && pn.test(c.id) && !o.has(c.id))
1514
+ for (const l of s)
1515
+ for (const a of l) {
1516
+ if (r && wn.test(a.id) && !o.has(a.id))
1492
1517
  throw new Error(
1493
- `"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
1518
+ `"Impact Screen"${a.name}"This internal editor ID (${a.id}) is used. A canonical screen ID is required.`
1494
1519
  );
1495
- !c.id || r && !o.has(c.id) || n.add(c.id);
1520
+ !a.id || r && !o.has(a.id) || n.add(a.id);
1496
1521
  }
1497
1522
  return [...n].sort();
1498
1523
  }
1499
- async function Qe(e, t, o) {
1524
+ async function Ze(e, t, o) {
1500
1525
  const r = await e(`${t.replace(/\/$/, "")}/capture`, {
1501
1526
  method: "POST",
1502
1527
  headers: { "content-type": "application/json" },
@@ -1508,63 +1533,63 @@ async function Qe(e, t, o) {
1508
1533
  );
1509
1534
  if (typeof n.baselineId != "string" || !n.baselineId)
1510
1535
  throw new Error("Pygmalion visual QA response has no baselineId");
1511
- const s = Array.isArray(n.frames) ? n.frames.map((p) => gn(p, o.phase)).filter((p) => p != null) : [], d = Array.isArray(n.failures) ? n.failures.map((p) => {
1512
- if (!p || typeof p != "object" || Array.isArray(p)) return null;
1513
- const h = p;
1514
- return typeof h.id == "string" && typeof h.error == "string" ? { id: h.id, error: h.error } : null;
1515
- }).filter((p) => p != null) : [], c = new Set(o.frameIds), w = new Set(s.map((p) => p.id)).size === s.length && s.every((p) => c.has(p.id)) && d.every((p) => c.has(p.id));
1536
+ const s = Array.isArray(n.frames) ? n.frames.map((h) => vn(h, o.phase)).filter((h) => h != null) : [], l = Array.isArray(n.failures) ? n.failures.map((h) => {
1537
+ if (!h || typeof h != "object" || Array.isArray(h)) return null;
1538
+ const p = h;
1539
+ return typeof p.id == "string" && typeof p.error == "string" ? { id: p.id, error: p.error } : null;
1540
+ }).filter((h) => h != null) : [], a = new Set(o.frameIds), w = new Set(s.map((h) => h.id)).size === s.length && s.every((h) => a.has(h.id)) && l.every((h) => a.has(h.id));
1516
1541
  return {
1517
1542
  phase: o.phase,
1518
1543
  baselineId: n.baselineId,
1519
- complete: n.complete !== !1 && w && d.length === 0 && s.length === o.frameIds.length,
1544
+ complete: n.complete !== !1 && w && l.length === 0 && s.length === o.frameIds.length,
1520
1545
  frames: s,
1521
- failures: d
1546
+ failures: l
1522
1547
  };
1523
1548
  }
1524
- const Ne = {
1549
+ const Oe = {
1525
1550
  mirror: "/__pygmalion-dev-control",
1526
1551
  sessions: "/__pygmalion-design-session",
1527
1552
  inspect: "/__pygmalion-inspect"
1528
- }, wn = "pygmalion.designSessionId", vn = "/__pygmalion-qa", we = /* @__PURE__ */ new Map();
1529
- function Xe() {
1553
+ }, In = "pygmalion.designSessionId", xn = "/__pygmalion-qa", Ie = /* @__PURE__ */ new Map();
1554
+ function et() {
1530
1555
  var e;
1531
1556
  return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1532
1557
  }
1533
- function bn(e, t) {
1558
+ function Pn(e, t) {
1534
1559
  if (e) return e;
1535
- const o = we.get(t);
1560
+ const o = Ie.get(t);
1536
1561
  if (o) return o;
1537
1562
  try {
1538
1563
  const r = window.localStorage.getItem(t);
1539
1564
  if (r)
1540
- return we.set(t, r), r;
1541
- const n = Xe();
1542
- return window.localStorage.setItem(t, n), we.set(t, n), n;
1565
+ return Ie.set(t, r), r;
1566
+ const n = et();
1567
+ return window.localStorage.setItem(t, n), Ie.set(t, n), n;
1543
1568
  } catch {
1544
- const r = Xe();
1545
- return we.set(t, r), r;
1569
+ const r = et();
1570
+ return Ie.set(t, r), r;
1546
1571
  }
1547
1572
  }
1548
- async function Z(e) {
1573
+ async function ee(e) {
1549
1574
  const t = await e.json();
1550
1575
  if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
1551
1576
  return t;
1552
1577
  }
1553
- function Mn(e = {}) {
1554
- var L, Q, te, V, l;
1578
+ function kn(e = {}) {
1579
+ var re, J, Z, V, c;
1555
1580
  const {
1556
1581
  sessionId: t,
1557
- sessionStorageKey: o = wn,
1582
+ sessionStorageKey: o = In,
1558
1583
  autoStart: r = !0,
1559
1584
  fetcher: n = fetch,
1560
1585
  formatApplyMessage: s
1561
- } = e, d = ((L = e.endpoints) == null ? void 0 : L.mirror) ?? Ne.mirror, c = ((Q = e.endpoints) == null ? void 0 : Q.sessions) ?? Ne.sessions, u = ((te = e.endpoints) == null ? void 0 : te.inspect) ?? Ne.inspect, w = e.visualQa != null, p = ((V = e.visualQa) == null ? void 0 : V.endpoint) ?? vn, h = JSON.stringify(((l = e.visualQa) == null ? void 0 : l.eligibleFrameIds) ?? []), P = ce(
1562
- () => JSON.parse(h),
1563
- [h]
1564
- ), b = ce(
1565
- () => bn(t, o),
1586
+ } = e, l = ((re = e.endpoints) == null ? void 0 : re.mirror) ?? Oe.mirror, a = ((J = e.endpoints) == null ? void 0 : J.sessions) ?? Oe.sessions, u = ((Z = e.endpoints) == null ? void 0 : Z.inspect) ?? Oe.inspect, w = e.visualQa != null, h = ((V = e.visualQa) == null ? void 0 : V.endpoint) ?? xn, p = JSON.stringify(((c = e.visualQa) == null ? void 0 : c.eligibleFrameIds) ?? []), E = ie(
1587
+ () => JSON.parse(p),
1588
+ [p]
1589
+ ), b = ie(
1590
+ () => Pn(t, o),
1566
1591
  [t, o]
1567
- ), [g, x] = ue({
1592
+ ), [y, P] = fe({
1568
1593
  state: "idle",
1569
1594
  commit: null,
1570
1595
  shortCommit: null,
@@ -1574,219 +1599,219 @@ function Mn(e = {}) {
1574
1599
  warning: null,
1575
1600
  error: null,
1576
1601
  appOrigin: null
1577
- }), [f, N] = ue(null), [D, v] = ue(null), [$, ee] = ue({
1602
+ }), [f, R] = fe(null), [D, v] = fe(null), [M, te] = fe({
1578
1603
  refs: [],
1579
1604
  defaultRef: null,
1580
1605
  worktreeRef: null
1581
- }), I = ve(null), E = ve(null), _ = ie(
1582
- async (a = !0, i) => {
1583
- if (i != null && I.current && await I.current.catch(() => {
1584
- }), I.current) return I.current;
1585
- const m = (async () => {
1586
- x((y) => ({ ...y, state: "syncing", error: null }));
1606
+ }), x = xe(null), C = xe(null), j = de(
1607
+ async (i = !0, d) => {
1608
+ if (d != null && x.current && await x.current.catch(() => {
1609
+ }), x.current) return x.current;
1610
+ const g = (async () => {
1611
+ P((I) => ({ ...I, state: "syncing", error: null }));
1587
1612
  try {
1588
- const y = i != null;
1589
- let A = await n(`${d}/${a || y ? "refresh" : "status"}`, {
1590
- method: a || y ? "POST" : "GET",
1591
- ...y ? {
1613
+ const I = d != null;
1614
+ let m = await n(`${l}/${i || I ? "refresh" : "status"}`, {
1615
+ method: i || I ? "POST" : "GET",
1616
+ ...I ? {
1592
1617
  headers: { "content-type": "application/json" },
1593
- body: JSON.stringify({ ref: i })
1618
+ body: JSON.stringify({ ref: d })
1594
1619
  } : {}
1595
- }), F = await Z(A);
1596
- const q = Date.now();
1597
- for (; !a && F.state === "syncing" && Date.now() - q < 12e4; )
1598
- await new Promise((C) => window.setTimeout(C, 500)), A = await n(`${d}/status`), F = await Z(A);
1599
- if (F.state !== "ready" || !F.appOrigin || !F.commit)
1600
- throw new Error(F.error ?? "Pygmalion could not prepare the source preview");
1601
- const H = await Z(
1602
- await n(`${c}/open`, {
1620
+ }), N = await ee(m);
1621
+ const O = Date.now();
1622
+ for (; !i && N.state === "syncing" && Date.now() - O < 12e4; )
1623
+ await new Promise((q) => window.setTimeout(q, 500)), m = await n(`${l}/status`), N = await ee(m);
1624
+ if (N.state !== "ready" || !N.appOrigin || !N.commit)
1625
+ throw new Error(N.error ?? "Pygmalion could not prepare the source preview");
1626
+ const K = await ee(
1627
+ await n(`${a}/open`, {
1603
1628
  method: "POST",
1604
1629
  headers: { "content-type": "application/json" },
1605
- body: JSON.stringify({ sessionId: b, baseDevSha: F.commit })
1630
+ body: JSON.stringify({ sessionId: b, baseDevSha: N.commit })
1606
1631
  })
1607
1632
  );
1608
- if (!H.ok || !H.session)
1609
- throw new Error(H.error ?? "Pygmalion could not open the design session");
1610
- let T = H.session;
1611
- if (T.branchName) {
1612
- const C = await Z(
1613
- await n(`${c}/check`, {
1633
+ if (!K.ok || !K.session)
1634
+ throw new Error(K.error ?? "Pygmalion could not open the design session");
1635
+ let F = K.session;
1636
+ if (F.branchName) {
1637
+ const q = await ee(
1638
+ await n(`${a}/check`, {
1614
1639
  method: "POST",
1615
1640
  headers: { "content-type": "application/json" },
1616
- body: JSON.stringify({ sessionId: T.id })
1641
+ body: JSON.stringify({ sessionId: F.id })
1617
1642
  })
1618
1643
  );
1619
- if (!C.ok || !C.session)
1620
- throw new Error(C.error ?? "Pygmalion could not check the design session");
1621
- T = C.session;
1644
+ if (!q.ok || !q.session)
1645
+ throw new Error(q.error ?? "Pygmalion could not check the design session");
1646
+ F = q.session;
1622
1647
  }
1623
- x(F), N(T), v(T.appOrigin ?? F.appOrigin);
1624
- } catch (y) {
1625
- x((A) => ({
1626
- ...A,
1648
+ P(N), R(F), v(F.appOrigin ?? N.appOrigin);
1649
+ } catch (I) {
1650
+ P((m) => ({
1651
+ ...m,
1627
1652
  state: "error",
1628
- error: y instanceof Error ? y.message : String(y)
1653
+ error: I instanceof Error ? I.message : String(I)
1629
1654
  }));
1630
1655
  }
1631
1656
  })();
1632
- I.current = m;
1657
+ x.current = g;
1633
1658
  try {
1634
- await m;
1659
+ await g;
1635
1660
  } finally {
1636
- I.current === m && (I.current = null);
1661
+ x.current === g && (x.current = null);
1637
1662
  }
1638
1663
  },
1639
- [n, d, c, b]
1640
- ), z = ie(async () => {
1664
+ [n, l, a, b]
1665
+ ), H = de(async () => {
1641
1666
  try {
1642
- const a = await Z(
1643
- await n(`${d}/refs`)
1644
- ), i = {
1645
- refs: a.refs ?? [],
1646
- defaultRef: a.defaultRef ?? null,
1647
- worktreeRef: a.worktreeRef ?? null
1667
+ const i = await ee(
1668
+ await n(`${l}/refs`)
1669
+ ), d = {
1670
+ refs: i.refs ?? [],
1671
+ defaultRef: i.defaultRef ?? null,
1672
+ worktreeRef: i.worktreeRef ?? null
1648
1673
  };
1649
- return ee(i), i;
1674
+ return te(d), d;
1650
1675
  } catch {
1651
- return $;
1676
+ return M;
1652
1677
  }
1653
- }, [n, d, $]), Y = ie(
1654
- async (a, i) => {
1655
- if (f != null && f.branchName && !(i != null && i.discardEdits))
1678
+ }, [n, l, M]), Q = de(
1679
+ async (i, d) => {
1680
+ if (f != null && f.branchName && !(d != null && d.discardEdits))
1656
1681
  throw new Error(
1657
1682
  "This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
1658
1683
  );
1659
- await _(!0, a), await z();
1684
+ await j(!0, i), await H();
1660
1685
  },
1661
- [z, _, f == null ? void 0 : f.branchName]
1662
- ), re = ie(
1663
- async (a) => {
1664
- var F;
1686
+ [H, j, f == null ? void 0 : f.branchName]
1687
+ ), he = de(
1688
+ async (i) => {
1689
+ var N;
1665
1690
  if (!f) throw new Error("Pygmalion design session is not ready");
1666
- const i = E.current;
1667
- if (i && (i.sessionId !== f.id || i.baseDevSha !== f.baseDevSha || i.revision !== f.revision || i.fingerprint !== JSON.stringify(a)))
1691
+ const d = C.current;
1692
+ if (d && (d.sessionId !== f.id || d.baseDevSha !== f.baseDevSha || d.revision !== f.revision || d.fingerprint !== JSON.stringify(i)))
1668
1693
  throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
1669
- const m = await Z(
1670
- await n(`${c}/apply-visual`, {
1694
+ const g = await ee(
1695
+ await n(`${a}/apply-visual`, {
1671
1696
  method: "POST",
1672
1697
  headers: { "content-type": "application/json" },
1673
1698
  body: JSON.stringify({
1674
1699
  sessionId: f.id,
1675
1700
  baseDevSha: f.baseDevSha,
1676
1701
  expectedRevision: f.revision,
1677
- ...i ? { previewRevision: i.revision } : {},
1678
- changes: a
1702
+ ...d ? { previewRevision: d.revision } : {},
1703
+ changes: i
1679
1704
  })
1680
1705
  })
1681
1706
  );
1682
- if (!m.ok || !m.session)
1683
- throw new Error(m.error ?? "Pygmalion could not apply the visual changes");
1684
- N(m.session), m.session.appOrigin && v(m.session.appOrigin);
1685
- const y = m.applied ?? a.styles.length + a.texts.length + a.operations.length;
1686
- let A;
1687
- if (i != null && i.qaBaselineId && ((F = i.qaFrameIds) != null && F.length) && m.session.appOrigin)
1707
+ if (!g.ok || !g.session)
1708
+ throw new Error(g.error ?? "Pygmalion could not apply the visual changes");
1709
+ R(g.session), g.session.appOrigin && v(g.session.appOrigin);
1710
+ const I = g.applied ?? i.styles.length + i.texts.length + i.operations.length;
1711
+ let m;
1712
+ if (d != null && d.qaBaselineId && ((N = d.qaFrameIds) != null && N.length) && g.session.appOrigin)
1688
1713
  try {
1689
- A = await Qe(n, p, {
1714
+ m = await Ze(n, h, {
1690
1715
  phase: "changed",
1691
- baselineId: i.qaBaselineId,
1692
- basePath: Ve(m.session.appOrigin, window.location.origin),
1693
- frameIds: i.qaFrameIds
1716
+ baselineId: d.qaBaselineId,
1717
+ basePath: Xe(g.session.appOrigin, window.location.origin),
1718
+ frameIds: d.qaFrameIds
1694
1719
  });
1695
- } catch (q) {
1696
- const H = q instanceof Error ? q.message : String(q);
1697
- A = {
1720
+ } catch (O) {
1721
+ const K = O instanceof Error ? O.message : String(O);
1722
+ m = {
1698
1723
  phase: "changed",
1699
- baselineId: i.qaBaselineId,
1724
+ baselineId: d.qaBaselineId,
1700
1725
  complete: !1,
1701
1726
  frames: [],
1702
- failures: i.qaFrameIds.map((T) => ({ id: T, error: H }))
1727
+ failures: d.qaFrameIds.map((F) => ({ id: F, error: K }))
1703
1728
  };
1704
1729
  }
1705
- return E.current = null, {
1706
- applied: y,
1707
- branch: m.session.branchName ?? void 0,
1708
- integration: m.session.integration.state,
1709
- message: s == null ? void 0 : s(m.session, y),
1710
- ...A ? { qa: A } : {}
1730
+ return C.current = null, {
1731
+ applied: I,
1732
+ branch: g.session.branchName ?? void 0,
1733
+ integration: g.session.integration.state,
1734
+ message: s == null ? void 0 : s(g.session, I),
1735
+ ...m ? { qa: m } : {}
1711
1736
  };
1712
1737
  },
1713
- [n, s, p, f, c]
1714
- ), le = ie(
1715
- async (a) => {
1716
- var F;
1738
+ [n, s, h, f, a]
1739
+ ), ue = de(
1740
+ async (i) => {
1741
+ var N;
1717
1742
  if (!f) throw new Error("Pygmalion design session is not ready");
1718
- E.current = null;
1719
- const i = await Z(
1720
- await n(`${c}/preview-visual`, {
1743
+ C.current = null;
1744
+ const d = await ee(
1745
+ await n(`${a}/preview-visual`, {
1721
1746
  method: "POST",
1722
1747
  headers: { "content-type": "application/json" },
1723
1748
  body: JSON.stringify({
1724
1749
  sessionId: f.id,
1725
1750
  baseDevSha: f.baseDevSha,
1726
1751
  expectedRevision: f.revision,
1727
- changes: a
1752
+ changes: i
1728
1753
  })
1729
1754
  })
1730
1755
  );
1731
- if (!i.ok || !Number.isSafeInteger(i.revision))
1732
- throw new Error(i.error ?? "Pygmalion could not preview the visual changes");
1733
- const m = w ? yn(a, P) : [];
1734
- let y;
1735
- const A = f.appOrigin ?? g.appOrigin;
1736
- if (m.length > 0) {
1737
- if (!A)
1756
+ if (!d.ok || !Number.isSafeInteger(d.revision))
1757
+ throw new Error(d.error ?? "Pygmalion could not preview the visual changes");
1758
+ const g = w ? Sn(i, E) : [];
1759
+ let I;
1760
+ const m = f.appOrigin ?? y.appOrigin;
1761
+ if (g.length > 0) {
1762
+ if (!m)
1738
1763
  throw new Error("Impact screen QA baseline preview not ready");
1739
- if (y = await Qe(n, p, {
1764
+ if (I = await Ze(n, h, {
1740
1765
  phase: "baseline",
1741
- basePath: Ve(A, window.location.origin),
1742
- frameIds: m
1743
- }), !y.complete)
1766
+ basePath: Xe(m, window.location.origin),
1767
+ frameIds: g
1768
+ }), !I.complete)
1744
1769
  throw new Error(
1745
- ((F = y.failures[0]) == null ? void 0 : F.error) ?? `Failed to capture ${m.length - y.frames.length} affected frames`
1770
+ ((N = I.failures[0]) == null ? void 0 : N.error) ?? `Failed to capture ${g.length - I.frames.length} affected frames`
1746
1771
  );
1747
1772
  }
1748
- return E.current = {
1773
+ return C.current = {
1749
1774
  sessionId: f.id,
1750
1775
  baseDevSha: f.baseDevSha,
1751
- revision: i.revision,
1752
- fingerprint: JSON.stringify(a),
1753
- ...y ? { qaBaselineId: y.baselineId, qaFrameIds: m } : {}
1776
+ revision: d.revision,
1777
+ fingerprint: JSON.stringify(i),
1778
+ ...I ? { qaBaselineId: I.baselineId, qaFrameIds: g } : {}
1754
1779
  }, {
1755
- revision: i.revision,
1756
- files: Array.isArray(i.files) ? i.files : [],
1757
- affectedFiles: Array.isArray(i.affectedFiles) ? i.affectedFiles : [],
1758
- ...y ? { qa: y } : {}
1780
+ revision: d.revision,
1781
+ files: Array.isArray(d.files) ? d.files : [],
1782
+ affectedFiles: Array.isArray(d.affectedFiles) ? d.affectedFiles : [],
1783
+ ...I ? { qa: I } : {}
1759
1784
  };
1760
1785
  },
1761
1786
  [
1762
1787
  n,
1763
- g.appOrigin,
1764
- P,
1765
- p,
1788
+ y.appOrigin,
1789
+ E,
1790
+ h,
1766
1791
  f,
1767
- c,
1792
+ a,
1768
1793
  w
1769
1794
  ]
1770
- ), oe = ie(
1771
- async (a) => {
1772
- if (a.length === 0) return { files: [] };
1773
- const i = await Z(
1795
+ ), W = de(
1796
+ async (i) => {
1797
+ if (i.length === 0) return { files: [] };
1798
+ const d = await ee(
1774
1799
  await n(`${u}/impact`, {
1775
1800
  method: "POST",
1776
1801
  headers: { "content-type": "application/json" },
1777
- body: JSON.stringify({ componentFiles: a })
1802
+ body: JSON.stringify({ componentFiles: i })
1778
1803
  })
1779
1804
  );
1780
- if (i.error || i.ok === !1)
1781
- throw new Error(i.error ?? "Pygmalion could not calculate source impact");
1782
- return { files: Array.isArray(i.files) ? i.files : [] };
1805
+ if (d.error || d.ok === !1)
1806
+ throw new Error(d.error ?? "Pygmalion could not calculate source impact");
1807
+ return { files: Array.isArray(d.files) ? d.files : [] };
1783
1808
  },
1784
1809
  [n, u]
1785
- ), de = ie(async () => {
1810
+ ), ae = de(async () => {
1786
1811
  if (!(f != null && f.canRevert) || !f.headSha)
1787
1812
  throw new Error("There are no reversible changes applied");
1788
- const a = await Z(
1789
- await n(`${c}/revert-visual`, {
1813
+ const i = await ee(
1814
+ await n(`${a}/revert-visual`, {
1790
1815
  method: "POST",
1791
1816
  headers: { "content-type": "application/json" },
1792
1817
  body: JSON.stringify({
@@ -1797,88 +1822,88 @@ function Mn(e = {}) {
1797
1822
  })
1798
1823
  })
1799
1824
  );
1800
- if (!a.ok || a.reverted !== !0 || !a.operation || a.operation.kind !== "visual-revert" || !a.session)
1801
- throw new Error(a.error ?? "Pygmalion could not revert the last visual change");
1802
- return E.current = null, N(a.session), a.session.appOrigin && v(a.session.appOrigin), {
1825
+ if (!i.ok || i.reverted !== !0 || !i.operation || i.operation.kind !== "visual-revert" || !i.session)
1826
+ throw new Error(i.error ?? "Pygmalion could not revert the last visual change");
1827
+ return C.current = null, R(i.session), i.session.appOrigin && v(i.session.appOrigin), {
1803
1828
  reverted: !0,
1804
- operation: a.operation,
1805
- session: a.session
1829
+ operation: i.operation,
1830
+ session: i.session
1806
1831
  };
1807
- }, [n, f, c]);
1808
- fe(() => {
1809
- r && _(!1);
1810
- }, [r, _]), fe(() => {
1811
- r && z();
1832
+ }, [n, f, a]);
1833
+ me(() => {
1834
+ r && j(!1);
1835
+ }, [r, j]), me(() => {
1836
+ r && H();
1812
1837
  }, [r]);
1813
- const G = (f == null ? void 0 : f.appOrigin) ?? g.appOrigin ?? D, J = (f == null ? void 0 : f.headSha) ?? (f == null ? void 0 : f.baseDevSha) ?? g.commit ?? "pending";
1838
+ const ne = (f == null ? void 0 : f.appOrigin) ?? y.appOrigin ?? D, Y = (f == null ? void 0 : f.headSha) ?? (f == null ? void 0 : f.baseDevSha) ?? y.commit ?? "pending";
1814
1839
  return {
1815
- mirror: g,
1840
+ mirror: y,
1816
1841
  session: f,
1817
1842
  ready: D != null,
1818
- appOrigin: G,
1819
- previewRevision: `${J}:${(f == null ? void 0 : f.revision) ?? 0}`,
1820
- previewSourceRevision: J,
1821
- refresh: _,
1822
- switchSource: Y,
1823
- sourceRefs: $,
1824
- loadSourceRefs: z,
1825
- previewVisual: le,
1826
- inspectImpact: oe,
1827
- applyVisual: re,
1828
- revertLastVisual: de
1843
+ appOrigin: ne,
1844
+ previewRevision: `${Y}:${(f == null ? void 0 : f.revision) ?? 0}`,
1845
+ previewSourceRevision: Y,
1846
+ refresh: j,
1847
+ switchSource: Q,
1848
+ sourceRefs: M,
1849
+ loadSourceRefs: H,
1850
+ previewVisual: ue,
1851
+ inspectImpact: W,
1852
+ applyVisual: he,
1853
+ revertLastVisual: ae
1829
1854
  };
1830
1855
  }
1831
- function $n({
1856
+ function Fn({
1832
1857
  value: e,
1833
1858
  currentCommit: t = null,
1834
1859
  refs: o,
1835
1860
  onChange: r,
1836
1861
  busy: n = !1,
1837
1862
  defaultRef: s = null,
1838
- worktreeRef: d = null,
1839
- label: c = "Source revision",
1863
+ worktreeRef: l = null,
1864
+ label: a = "Source revision",
1840
1865
  refreshLabel: u = "Refresh current revision",
1841
1866
  children: w,
1842
- className: p
1867
+ className: h
1843
1868
  }) {
1844
- const h = ce(
1869
+ const p = ie(
1845
1870
  () => ({
1846
1871
  local: o.filter((v) => v.kind === "local"),
1847
1872
  remote: o.filter((v) => v.kind === "remote")
1848
1873
  }),
1849
1874
  [o]
1850
- ), P = ce(() => {
1851
- const v = new Set(o.map(($) => $.name));
1852
- return s && v.add(s), d && v.add(d), v;
1853
- }, [s, o, d]), b = e ?? s ?? "", g = ce(
1875
+ ), E = ie(() => {
1876
+ const v = new Set(o.map((M) => M.name));
1877
+ return s && v.add(s), l && v.add(l), v;
1878
+ }, [s, o, l]), b = e ?? s ?? "", y = ie(
1854
1879
  () => o.find((v) => v.name === b) ?? null,
1855
1880
  [o, b]
1856
- ), x = (t == null ? void 0 : t.toLowerCase()) ?? null, f = (g == null ? void 0 : g.commit.toLowerCase()) ?? null, N = !!(x && f && x !== f && !x.startsWith(f) && !f.startsWith(x)), D = (t == null ? void 0 : t.slice(0, 8)) ?? null;
1857
- return /* @__PURE__ */ M(
1881
+ ), P = (t == null ? void 0 : t.toLowerCase()) ?? null, f = (y == null ? void 0 : y.commit.toLowerCase()) ?? null, R = !!(P && f && P !== f && !P.startsWith(f) && !f.startsWith(P)), D = (t == null ? void 0 : t.slice(0, 8)) ?? null;
1882
+ return /* @__PURE__ */ $(
1858
1883
  "span",
1859
1884
  {
1860
- className: p,
1885
+ className: h,
1861
1886
  "data-pygmalion-source-ref": "",
1862
1887
  "data-busy": n ? "" : void 0,
1863
- "data-update-available": N ? "" : void 0,
1864
- "data-latest-commit": N ? g == null ? void 0 : g.commit : void 0,
1888
+ "data-update-available": R ? "" : void 0,
1889
+ "data-latest-commit": R ? y == null ? void 0 : y.commit : void 0,
1865
1890
  style: { position: "relative", display: "inline-flex", alignItems: "center" },
1866
1891
  children: [
1867
- w ?? /* @__PURE__ */ S("span", { "data-pygmalion-source-ref-value": "", children: b || c }),
1868
- /* @__PURE__ */ M(
1892
+ w ?? /* @__PURE__ */ S("span", { "data-pygmalion-source-ref-value": "", children: b || a }),
1893
+ /* @__PURE__ */ $(
1869
1894
  "select",
1870
1895
  {
1871
1896
  value: b,
1872
1897
  disabled: n,
1873
- "aria-label": c,
1898
+ "aria-label": a,
1874
1899
  "data-pygmalion-source-ref-select": "",
1875
1900
  onChange: (v) => {
1876
- const $ = v.target.value;
1877
- if (!$) {
1901
+ const M = v.target.value;
1902
+ if (!M) {
1878
1903
  b && r(b);
1879
1904
  return;
1880
1905
  }
1881
- $ && $ !== b && r($);
1906
+ M && M !== b && r(M);
1882
1907
  },
1883
1908
  style: {
1884
1909
  position: "absolute",
@@ -1894,23 +1919,23 @@ function $n({
1894
1919
  margin: 0
1895
1920
  },
1896
1921
  children: [
1897
- b ? /* @__PURE__ */ M("option", { value: "", children: [
1922
+ b ? /* @__PURE__ */ $("option", { value: "", children: [
1898
1923
  u,
1899
1924
  " · ",
1900
1925
  b,
1901
- N ? ` · ${D ?? "unknown"} → ${(g == null ? void 0 : g.commit) ?? "latest"}` : ""
1926
+ R ? ` · ${D ?? "unknown"} → ${(y == null ? void 0 : y.commit) ?? "latest"}` : ""
1902
1927
  ] }) : null,
1903
- b && !P.has(b) ? /* @__PURE__ */ S("option", { value: b, children: b }) : null,
1904
- d ? /* @__PURE__ */ M("option", { value: d, children: [
1905
- d,
1928
+ b && !E.has(b) ? /* @__PURE__ */ S("option", { value: b, children: b }) : null,
1929
+ l ? /* @__PURE__ */ $("option", { value: l, children: [
1930
+ l,
1906
1931
  " · uncommitted work"
1907
1932
  ] }) : null,
1908
- h.local.length > 0 ? /* @__PURE__ */ S("optgroup", { label: "local", children: h.local.map((v) => /* @__PURE__ */ M("option", { value: v.name, children: [
1933
+ p.local.length > 0 ? /* @__PURE__ */ S("optgroup", { label: "local", children: p.local.map((v) => /* @__PURE__ */ $("option", { value: v.name, children: [
1909
1934
  v.name,
1910
1935
  " · ",
1911
1936
  v.commit
1912
1937
  ] }, v.fullName)) }) : null,
1913
- h.remote.length > 0 ? /* @__PURE__ */ S("optgroup", { label: "remote", children: h.remote.map((v) => /* @__PURE__ */ M("option", { value: v.name, children: [
1938
+ p.remote.length > 0 ? /* @__PURE__ */ S("optgroup", { label: "remote", children: p.remote.map((v) => /* @__PURE__ */ $("option", { value: v.name, children: [
1914
1939
  v.name,
1915
1940
  " · ",
1916
1941
  v.commit
@@ -1922,448 +1947,446 @@ function $n({
1922
1947
  }
1923
1948
  );
1924
1949
  }
1925
- const On = {
1950
+ const Tn = {
1926
1951
  editor: X,
1927
- getObserverTree: at,
1928
- isObservableProp: it
1952
+ getObserverTree: dt,
1953
+ isObservableProp: lt
1929
1954
  };
1930
- function Dn(e) {
1955
+ function zn(e) {
1931
1956
  X.navigateToPageByName(e);
1932
1957
  }
1933
- function Fn() {
1958
+ function jn() {
1934
1959
  X.openPreview();
1935
1960
  }
1936
- function kn() {
1937
- const e = _e.entries.length > 0;
1938
- return e && _e.discardPending(), X.resetCurrentEdits() || e;
1961
+ function _n() {
1962
+ const e = He.entries.length > 0;
1963
+ return e && He.discardPending(), X.resetCurrentEdits() || e;
1939
1964
  }
1940
- function Tn({
1965
+ function Bn({
1941
1966
  registry: e,
1942
1967
  tokens: t,
1943
1968
  initialPages: o,
1944
1969
  initialCanvas: r,
1945
1970
  componentConnections: n,
1946
1971
  viewportPresets: s,
1947
- previewEnvironmentControls: d,
1948
- designImport: c,
1972
+ previewEnvironmentControls: l,
1973
+ designImport: a,
1949
1974
  onTokensChange: u,
1950
1975
  appOrigin: w,
1951
- previewRevision: p,
1952
- previewCacheNamespace: h,
1953
- previewArtifacts: P,
1976
+ previewRevision: h,
1977
+ previewCacheNamespace: p,
1978
+ previewArtifacts: E,
1954
1979
  previewArtifactEndpoint: b,
1955
- previewConcurrency: g,
1956
- previewOpen: x,
1980
+ previewConcurrency: y,
1981
+ previewOpen: P,
1957
1982
  onPreviewOpenChange: f,
1958
- flowCanvas: N,
1983
+ flowCanvas: R,
1959
1984
  onApply: D,
1960
1985
  onDesignChange: v,
1961
- onInspectApply: $,
1962
- onInspectPreview: ee,
1963
- onInspectImpact: I,
1964
- storyboardDiscovery: E = !0,
1965
- storyboardDiscoveryEndpoint: _ = At
1986
+ onInspectApply: M,
1987
+ onInspectPreview: te,
1988
+ onInspectImpact: x,
1989
+ storyboard: C,
1990
+ storyboardDiscovery: j = !0,
1991
+ storyboardDiscoveryEndpoint: H = ut
1966
1992
  }) {
1967
- const [z, Y] = ue(!E), [re, le] = ue();
1968
- c && (c.assertComplete(), ct(c));
1969
- const oe = e ?? (c == null ? void 0 : c.getRegistry()), de = t ?? (c == null ? void 0 : c.getTokens()), G = o ?? (c == null ? void 0 : c.getInitialPages());
1970
- oe && lt(oe), dt(n ?? []), de && ut(de), s && ft(s), Dt(u ?? null), mt(h), pt(
1993
+ const Q = ie(
1994
+ () => ({}),
1995
+ [
1996
+ a,
1997
+ o,
1998
+ j,
1999
+ H,
2000
+ C
2001
+ ]
2002
+ ), [he, ue] = fe(null), W = he === Q, [ae, ne] = fe();
2003
+ a && (a.assertComplete(), ft(a));
2004
+ const Y = e ?? (a == null ? void 0 : a.getRegistry()), re = t ?? (a == null ? void 0 : a.getTokens()), J = o ?? (a == null ? void 0 : a.getInitialPages());
2005
+ Y && mt(Y), ht(n ?? []), re && pt(re), s && gt(s), Tt(u ?? null), yt(p), wt(
1971
2006
  !!(b != null && b.trim())
1972
2007
  );
1973
- const J = re ?? P, L = ce(
1974
- () => (G ?? []).flatMap(
1975
- (i) => i.route && i.importPageId ? [
2008
+ const Z = ae ?? E, V = ie(
2009
+ () => (J ?? []).flatMap(
2010
+ (m) => m.route && m.importPageId ? [
1976
2011
  {
1977
- canonicalId: i.importPageId,
1978
- route: i.route,
1979
- width: i.width,
1980
- height: i.height,
1981
- environment: i.environment,
1982
- preset: i.preset,
1983
- interactions: i.interactions,
1984
- assertions: i.assertions
2012
+ canonicalId: m.importPageId,
2013
+ route: m.route,
2014
+ width: m.width,
2015
+ height: m.height,
2016
+ environment: m.environment,
2017
+ preset: m.preset,
2018
+ interactions: m.interactions,
2019
+ assertions: m.assertions
1985
2020
  }
1986
2021
  ] : []
1987
2022
  ),
1988
- [G]
1989
- ), Q = p ?? $t(), te = w ?? Be(), V = ve([]), l = ve([]), a = ce(
1990
- () => L.map((i) => ({
1991
- id: i.canonicalId,
1992
- fingerprint: ht(
1993
- i,
1994
- Q,
1995
- ye()
2023
+ [J]
2024
+ ), c = h ?? kt(), i = w ?? qe(), d = xe([]), g = xe([]), I = ie(
2025
+ () => V.map((m) => ({
2026
+ id: m.canonicalId,
2027
+ fingerprint: bt(
2028
+ m,
2029
+ c,
2030
+ Se()
1996
2031
  )
1997
2032
  })),
1998
- [L, Q, z]
2033
+ [V, c, W]
1999
2034
  );
2000
- return V.current = a, l.current = L.map(
2001
- (i) => gt({
2002
- namespace: h ?? "",
2003
- previewRevision: Q,
2004
- route: i.route,
2005
- width: i.width ?? 390,
2006
- height: i.height ?? 600,
2007
- environment: Ye(
2008
- ye(),
2009
- i.environment
2035
+ return d.current = I, g.current = V.map(
2036
+ (m) => vt({
2037
+ namespace: p ?? "",
2038
+ previewRevision: c,
2039
+ route: m.route,
2040
+ width: m.width ?? 390,
2041
+ height: m.height ?? 600,
2042
+ environment: tt(
2043
+ Se(),
2044
+ m.environment
2010
2045
  ),
2011
- preset: i.preset,
2012
- interactions: i.interactions,
2013
- assertions: i.assertions
2046
+ preset: m.preset,
2047
+ interactions: m.interactions,
2048
+ assertions: m.assertions
2014
2049
  })
2015
- ), g != null && yt(g), Ft(f ?? null), N != null && wt(N), kt(D ?? null), Tt($ ?? null), vt(ee ?? null), zt(I ?? null), G && X.initPagesFromComponents(G, { initialCanvas: r }), qe(() => {
2016
- w != null && bt(w), p != null && St(p), It(d ?? []);
2017
- }, [w, d, p]), qe(() => {
2018
- !J || !G || !z || Fe(J, {
2019
- namespace: h ?? "",
2020
- previewRevision: Q,
2021
- appOrigin: te,
2022
- baselineEnvironment: ye(),
2050
+ ), y != null && St(y), zt(f ?? null), R != null && It(R), jt(D ?? null), _t(M ?? null), xt(te ?? null), Bt(x ?? null), J && X.initPagesFromComponents(J, { initialCanvas: r }), Le(() => {
2051
+ w != null && Pt(w), h != null && Et(h), Ct(l ?? []);
2052
+ }, [w, l, h]), Le(() => {
2053
+ !Z || !J || !W || je(Z, {
2054
+ namespace: p ?? "",
2055
+ previewRevision: c,
2056
+ appOrigin: i,
2057
+ baselineEnvironment: Se(),
2023
2058
  allowStaleIdentity: !!b,
2024
- allowMatchingFrameIdentity: re != null,
2025
- pages: L.map((i, m) => {
2026
- var y;
2059
+ allowMatchingFrameIdentity: ae != null,
2060
+ pages: V.map((m, N) => {
2061
+ var O;
2027
2062
  return {
2028
- ...i,
2029
- fingerprint: (y = a[m]) == null ? void 0 : y.fingerprint
2063
+ ...m,
2064
+ fingerprint: (O = I[N]) == null ? void 0 : O.fingerprint
2030
2065
  };
2031
2066
  })
2032
2067
  });
2033
2068
  }, [
2034
- J,
2035
- a,
2036
- L,
2069
+ Z,
2070
+ I,
2071
+ V,
2037
2072
  b,
2038
- h,
2039
- re,
2040
- te,
2041
- G,
2042
- Q,
2043
- z
2044
- ]), fe(() => {
2045
- Ue(v ?? null);
2046
- const i = xt(X);
2073
+ p,
2074
+ ae,
2075
+ i,
2076
+ J,
2077
+ c,
2078
+ W
2079
+ ]), me(() => {
2080
+ Ke(v ?? null);
2081
+ const m = Rt(X);
2047
2082
  return () => {
2048
- i(), Ue(null);
2083
+ m(), Ke(null);
2049
2084
  };
2050
- }, [v]), fe(() => {
2051
- if (le(void 0), !z || !b || !(h != null && h.trim()) || !(p != null && p.trim()))
2085
+ }, [v]), me(() => {
2086
+ if (ne(void 0), !W || !b || !(p != null && p.trim()) || !(h != null && h.trim()))
2052
2087
  return;
2053
- const i = new AbortController(), m = Pt({
2088
+ const m = new AbortController(), N = Nt({
2054
2089
  endpoint: b,
2055
2090
  captureBaseUrl: w
2056
- }), y = Et(p), A = (C) => {
2057
- Fe(C, {
2058
- namespace: h,
2059
- previewRevision: p,
2060
- appOrigin: Be(),
2061
- baselineEnvironment: ye(),
2091
+ }), O = At(h), K = (T) => {
2092
+ je(T, {
2093
+ namespace: p,
2094
+ previewRevision: h,
2095
+ appOrigin: qe(),
2096
+ baselineEnvironment: Se(),
2062
2097
  allowStaleIdentity: !0,
2063
2098
  allowMatchingFrameIdentity: !0,
2064
- pages: L.map((R, O) => {
2065
- var j;
2099
+ pages: V.map((A, z) => {
2100
+ var _;
2066
2101
  return {
2067
- ...R,
2068
- fingerprint: (j = a[O]) == null ? void 0 : j.fingerprint
2102
+ ...A,
2103
+ fingerprint: (_ = I[z]) == null ? void 0 : _.fingerprint
2069
2104
  };
2070
2105
  })
2071
- }), le(C);
2072
- }, F = (C, R, O) => Ot({
2073
- namespace: h,
2074
- sourceRevision: y,
2075
- transport: m,
2076
- signal: O,
2077
- ...C.length ? { frames: C } : {},
2078
- ...R ? {} : { generate: !1 }
2079
- }), q = (C, R) => {
2080
- const O = new Set(R);
2081
- return C.filter((j) => O.has(j.id));
2082
- }, H = (C, R) => C instanceof Error && C.message ? C.message : R, T = new AbortController();
2083
- if (ke(async (C) => {
2084
- var O, j, se;
2085
- const R = await F(C, !0, T.signal);
2086
- if (R.status === "accepted") {
2087
- A(R.artifact);
2088
- const he = new Set(((O = R.frameResolution) == null ? void 0 : O.exact) ?? []);
2089
- if (C.every((ge) => he.has(ge.id)))
2106
+ }), ne(T);
2107
+ }, F = (T, A, z) => Ft({
2108
+ namespace: p,
2109
+ sourceRevision: O,
2110
+ transport: N,
2111
+ signal: z,
2112
+ ...T.length ? { frames: T } : {},
2113
+ ...A ? {} : { generate: !1 }
2114
+ }), q = (T, A) => {
2115
+ const z = new Set(A);
2116
+ return T.filter((_) => z.has(_.id));
2117
+ }, ce = (T, A) => T instanceof Error && T.message ? T.message : A, pe = new AbortController();
2118
+ if (_e(async (T) => {
2119
+ var z, _, le;
2120
+ const A = await F(T, !0, pe.signal);
2121
+ if (A.status === "accepted") {
2122
+ K(A.artifact);
2123
+ const be = new Set(((z = A.frameResolution) == null ? void 0 : z.exact) ?? []);
2124
+ if (T.every((ve) => be.has(ve.id)))
2090
2125
  return { status: "accepted" };
2091
- const me = [
2092
- ...((j = R.frameResolution) == null ? void 0 : j.missing) ?? [],
2093
- ...((se = R.frameResolution) == null ? void 0 : se.stale) ?? []
2126
+ const ge = [
2127
+ ...((_ = A.frameResolution) == null ? void 0 : _.missing) ?? [],
2128
+ ...((le = A.frameResolution) == null ? void 0 : le.stale) ?? []
2094
2129
  ];
2095
2130
  return {
2096
2131
  status: "unavailable",
2097
- message: me.length ? `The exact preview endpoint did not return a current capture for ${me.join(", ")}.` : "The exact preview endpoint returned no current capture."
2132
+ message: ge.length ? `The exact preview endpoint did not return a current capture for ${ge.join(", ")}.` : "The exact preview endpoint returned no current capture."
2098
2133
  };
2099
2134
  }
2100
- return R.status === "rejected" ? {
2135
+ return A.status === "rejected" ? {
2101
2136
  status: "rejected",
2102
- message: R.errors.join(" ") || "The preview artifact was rejected."
2137
+ message: A.errors.join(" ") || "The preview artifact was rejected."
2103
2138
  } : {
2104
2139
  status: "unavailable",
2105
- message: H(
2106
- R.error,
2140
+ message: ce(
2141
+ A.error,
2107
2142
  "The exact preview endpoint is unavailable."
2108
2143
  )
2109
2144
  };
2110
- }), V.current.length) {
2111
- const C = V.current.filter((O) => {
2112
- const j = Te(
2113
- O.id,
2114
- O.fingerprint
2145
+ }), d.current.length) {
2146
+ const T = d.current.filter((z) => {
2147
+ const _ = Be(
2148
+ z.id,
2149
+ z.fingerprint
2115
2150
  ).status;
2116
- return j !== "exact" && j !== "generating";
2151
+ return _ !== "exact" && _ !== "generating";
2117
2152
  });
2118
- ne(C, { status: "checking" });
2119
- const R = (O) => O.filter((j) => {
2120
- const se = Te(
2121
- j.id,
2122
- j.fingerprint
2153
+ oe(T, { status: "checking" });
2154
+ const A = (z) => z.filter((_) => {
2155
+ const le = Be(
2156
+ _.id,
2157
+ _.fingerprint
2123
2158
  ).status;
2124
- return se !== "generating" && se !== "exact";
2159
+ return le !== "generating" && le !== "exact";
2125
2160
  });
2126
2161
  (async () => {
2127
- var me, ge, De;
2128
- const O = l.current.slice(
2162
+ var ge, ve, ze;
2163
+ const z = g.current.slice(
2129
2164
  0,
2130
- V.current.length
2165
+ d.current.length
2131
2166
  );
2132
- if (await Ct(O), i.signal.aborted) return;
2133
- const j = new Set(
2134
- V.current.filter(
2135
- (U, k) => O[k] ? Rt(O[k]) : !1
2167
+ if (await $t(z), m.signal.aborted) return;
2168
+ const _ = new Set(
2169
+ d.current.filter(
2170
+ (U, k) => z[k] ? Mt(z[k]) : !1
2136
2171
  ).map((U) => U.id)
2137
2172
  );
2138
- ne(
2139
- R(
2140
- C.filter((U) => j.has(U.id))
2173
+ oe(
2174
+ A(
2175
+ T.filter((U) => _.has(U.id))
2141
2176
  ),
2142
2177
  { status: "exact" }
2143
2178
  );
2144
- const se = R(
2145
- C.filter((U) => !j.has(U.id))
2146
- ), he = [];
2147
- for (const U of ze(
2148
- se
2179
+ const le = A(
2180
+ T.filter((U) => !_.has(U.id))
2181
+ ), be = [];
2182
+ for (const U of Ue(
2183
+ le
2149
2184
  )) {
2150
- const k = await Nt({
2151
- namespace: h,
2152
- sourceRevision: y,
2153
- transport: m,
2185
+ const k = await Ot({
2186
+ namespace: p,
2187
+ sourceRevision: O,
2188
+ transport: N,
2154
2189
  frames: U,
2155
- signal: i.signal
2190
+ signal: m.signal
2156
2191
  });
2157
- if (i.signal.aborted) return;
2192
+ if (m.signal.aborted) return;
2158
2193
  if (k.status === "accepted") {
2159
- he.push(
2194
+ be.push(
2160
2195
  ...q(U, k.resolution.exact)
2161
2196
  );
2162
- const Ce = q(U, [
2197
+ const $e = q(U, [
2163
2198
  ...k.resolution.missing,
2164
2199
  ...k.resolution.stale
2165
2200
  ]);
2166
- ne(R(Ce), {
2201
+ oe(A($e), {
2167
2202
  status: "outdated",
2168
2203
  message: "Select this frame to generate the exact preview."
2169
2204
  });
2170
2205
  continue;
2171
2206
  }
2172
- const Ee = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact probe was rejected." : H(
2207
+ const Ae = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact probe was rejected." : ce(
2173
2208
  k.error,
2174
2209
  "The exact preview endpoint is unavailable."
2175
2210
  );
2176
- ne(R(U), {
2211
+ oe(A(U), {
2177
2212
  status: "error",
2178
2213
  reason: k.status === "rejected" ? "rejected" : "unavailable",
2179
- message: Ee
2214
+ message: Ae
2180
2215
  });
2181
2216
  }
2182
- for (const U of ze(
2183
- R(he)
2217
+ for (const U of Ue(
2218
+ A(be)
2184
2219
  )) {
2185
2220
  const k = await F(
2186
2221
  U,
2187
2222
  !1,
2188
- i.signal
2223
+ m.signal
2189
2224
  );
2190
- if (i.signal.aborted) return;
2225
+ if (m.signal.aborted) return;
2191
2226
  if (k.status === "accepted") {
2192
- A(k.artifact), ne(
2193
- q(U, ((me = k.frameResolution) == null ? void 0 : me.exact) ?? []),
2227
+ K(k.artifact), oe(
2228
+ q(U, ((ge = k.frameResolution) == null ? void 0 : ge.exact) ?? []),
2194
2229
  { status: "exact" }
2195
2230
  );
2196
- const Ce = q(U, [
2197
- ...((ge = k.frameResolution) == null ? void 0 : ge.missing) ?? [],
2198
- ...((De = k.frameResolution) == null ? void 0 : De.stale) ?? []
2231
+ const $e = q(U, [
2232
+ ...((ve = k.frameResolution) == null ? void 0 : ve.missing) ?? [],
2233
+ ...((ze = k.frameResolution) == null ? void 0 : ze.stale) ?? []
2199
2234
  ]);
2200
- ne(R(Ce), {
2235
+ oe(A($e), {
2201
2236
  status: "outdated",
2202
2237
  message: "Select this frame to generate the exact preview."
2203
2238
  });
2204
2239
  continue;
2205
2240
  }
2206
- const Ee = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact was rejected." : H(
2241
+ const Ae = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact was rejected." : ce(
2207
2242
  k.error,
2208
2243
  "The exact preview endpoint is unavailable."
2209
2244
  );
2210
- ne(R(U), {
2245
+ oe(A(U), {
2211
2246
  status: "error",
2212
2247
  reason: k.status === "rejected" ? "rejected" : "unavailable",
2213
- message: Ee
2248
+ message: Ae
2214
2249
  });
2215
2250
  }
2216
- })().catch((O) => {
2217
- if (i.signal.aborted) return;
2218
- const j = R(C);
2219
- ne(j, {
2251
+ })().catch((z) => {
2252
+ if (m.signal.aborted) return;
2253
+ const _ = A(T);
2254
+ oe(_, {
2220
2255
  status: "error",
2221
2256
  reason: "unavailable",
2222
- message: H(
2223
- O,
2257
+ message: ce(
2258
+ z,
2224
2259
  "The exact preview endpoint is unavailable."
2225
2260
  )
2226
2261
  });
2227
2262
  });
2228
2263
  }
2229
2264
  return () => {
2230
- ke(null), T.abort(), i.abort();
2265
+ _e(null), pe.abort(), m.abort();
2231
2266
  };
2232
2267
  }, [
2233
2268
  b,
2234
- h,
2235
2269
  p,
2270
+ h,
2236
2271
  w,
2237
- z
2238
- ]), fe(() => {
2239
- let i = !0;
2240
- if (!E)
2241
- return pe(void 0), Y(!0), () => {
2242
- i = !1;
2272
+ W
2273
+ ]), me(() => {
2274
+ let m = !0;
2275
+ if (!j)
2276
+ return ye(void 0), we(null), se(null), ue(Q), () => {
2277
+ m = !1;
2243
2278
  };
2244
- const m = new AbortController();
2245
- return Y(!1), pe(void 0), ae(null), nt({
2246
- endpoint: _,
2247
- signal: m.signal,
2248
- pages: X.pages.map((y) => ({
2249
- ...y,
2250
- id: y.importPageId ?? y.id,
2251
- importKind: y.importKind
2279
+ const N = new AbortController();
2280
+ return ye(void 0), we(null), se(null), st({
2281
+ endpoint: H,
2282
+ signal: N.signal,
2283
+ pages: X.pages.map((O) => ({
2284
+ ...O,
2285
+ id: O.importPageId ?? O.id,
2286
+ importKind: O.importKind
2252
2287
  })),
2253
- assets: (c == null ? void 0 : c.getAssets("screens")) ?? []
2254
- }).then((y) => {
2255
- i && (pe(y.baselineEnvironment), je(y.manifest.routes ?? null), ae(y.graph));
2288
+ assets: (a == null ? void 0 : a.getAssets("screens")) ?? [],
2289
+ storyboard: C
2290
+ }).then((O) => {
2291
+ m && (ye(O.baselineEnvironment), we(O.manifest.routes ?? null), se(O.graph));
2256
2292
  }).catch(() => {
2257
- i && (pe(void 0), je(null), ae(null));
2293
+ m && (ye(void 0), we(null), se(null));
2258
2294
  }).finally(() => {
2259
- i && Y(!0);
2295
+ m && ue(Q);
2260
2296
  }), () => {
2261
- i = !1, m.abort(), pe(void 0), ae(null);
2297
+ m = !1, N.abort(), ye(void 0), we(null), se(null);
2262
2298
  };
2263
2299
  }, [
2264
- c,
2265
- o,
2266
- E,
2267
- _
2268
- ]), fe(() => {
2269
- x == null || x === X.previewOpen || (x ? X.openPreview({ notifyHost: !1 }) : X.closePreview({ notifyHost: !1 }));
2270
- }, [x]), z ? /* @__PURE__ */ S(Mt, {}) : /* @__PURE__ */ S(
2271
- "div",
2272
- {
2273
- "data-pygmalion-storyboard-loading": "",
2274
- role: "status",
2275
- style: {
2276
- display: "grid",
2277
- width: "100%",
2278
- height: "100%",
2279
- placeItems: "center",
2280
- color: "#777777",
2281
- background: "#f5f5f5",
2282
- font: "12px system-ui, sans-serif"
2283
- },
2284
- children: "Discovering storyboard branches"
2285
- }
2286
- );
2300
+ a,
2301
+ C,
2302
+ j,
2303
+ H,
2304
+ Q
2305
+ ]), me(() => {
2306
+ P == null || P === X.previewOpen || (P ? X.openPreview({ notifyHost: !1 }) : X.closePreview({ notifyHost: !1 }));
2307
+ }, [P]), /* @__PURE__ */ S(Dt, { previewIdentityReady: W });
2287
2308
  }
2288
2309
  export {
2289
- _n as DEFAULT_DESIGN_COMPILE_LIMITS,
2290
- Bn as DESIGN_IMPORT_KINDS,
2291
- Un as DESIGN_IR_SCHEMA,
2292
- Hn as DESIGN_IR_VERSION,
2293
- En as PygmalionCatalogDocument,
2294
- Rn as PygmalionCatalogMatrix,
2295
- Cn as PygmalionCatalogSection,
2296
- Tn as PygmalionEditor,
2297
- At as STORYBOARD_ENVIRONMENT_CONTROL,
2298
- qn as STORYBOARD_ENVIRONMENT_QUERY,
2299
- $n as SourceRefControl,
2300
- On as __debug,
2301
- Kn as applyTokenOverride,
2302
- Ot as bootstrapPreviewArtifact,
2303
- Gn as clearPreviewEnvironmentControlValues,
2304
- Ln as clearPygmalionPreviewCache,
2305
- Wn as compileDesignDocument,
2306
- An as createDesignComponentCatalog,
2307
- dn as createDesignComponentVariantMatrix,
2308
- Nn as createDesignGalleryCatalog,
2309
- Vn as createDesignImportController,
2310
- Jn as createDesignIntermediateDocument,
2311
- Qn as createDesignScreenCollection,
2312
- Pt as createPreviewArtifactHttpTransport,
2313
- Xn as createPreviewCacheNamespace,
2314
- Yn as createPreviewFrameFingerprint,
2315
- Zn as createPreviewRecipeFingerprint,
2316
- er as createStoryboardCaptureRecipeIdentity,
2317
- Ut as createStoryboardGraph,
2318
- rn as createStoryboardGraphFromDiscovery,
2319
- tr as createStoryboardGraphViewModel,
2320
- nr as createStoryboardRouteUrl,
2321
- an as designCatalogKey,
2322
- rt as designCatalogRegistryName,
2323
- rr as enumerateDesignComponentConnectionCases,
2324
- or as expandDesignScreenCasesViewports,
2325
- sr as expandDesignScreenCollectionViewports,
2326
- ir as getDesignCodegenAdapters,
2327
- ar as getDesignComponentConnection,
2328
- cr as getDesignComponentConnectionForComponent,
2329
- lr as getDesignComponentConnections,
2330
- dr as getPreviewEnvironmentControlValue,
2331
- ur as getPreviewEnvironmentControls,
2332
- fr as getPreviewEnvironmentOverride,
2333
- mr as getRecommendedPygmalionPreviewConcurrency,
2334
- ye as getStoryboardBaselineEnvironment,
2335
- tt as getStoryboardDiscoveryBaselineEnvironment,
2336
- pr as getStoryboardGraph,
2337
- hr as getViewportPresets,
2338
- nt as loadStoryboardDiscovery,
2339
- gr as mergeScreenPresets,
2340
- Ye as mergeStoryboardEnvironment,
2341
- Pn as publishStoryboardDiscovery,
2342
- Dn as pygmalionNavigate,
2343
- Fn as pygmalionOpenPreview,
2344
- kn as pygmalionResetCurrentEdits,
2345
- yr as reconstructRoutePreviewArtifactScreenshotV3,
2346
- wr as reconstructRoutePreviewArtifactSnapshotV3,
2347
- vr as registerDesignCodegenAdapter,
2348
- br as resetTokenOverrides,
2349
- Sr as resolvePreviewArtifactFrames,
2350
- Wt as resolveStoryboardScreenCases,
2351
- lt as setComponentRegistry,
2352
- dt as setDesignComponentConnections,
2353
- Ir as setPreviewEnvironmentControlValue,
2354
- It as setPreviewEnvironmentControls,
2355
- bt as setPygmalionAppOrigin,
2356
- yt as setPygmalionPreviewConcurrency,
2357
- St as setPygmalionPreviewRevision,
2358
- pe as setStoryboardBaselineEnvironment,
2359
- ae as setStoryboardGraph,
2360
- ut as setTokens,
2361
- ft as setViewportPresets,
2362
- jt as storyboardScreenRecipeKey,
2363
- xr as subscribePreviewEnvironmentControls,
2364
- Pr as subscribeStoryboardGraph,
2365
- Mn as usePygmalionProject,
2366
- Er as validateDesignComponentConnections,
2367
- Cr as validatePreviewArtifactBundle,
2368
- Rr as validateRoutePreviewArtifactV3Browser
2310
+ qn as DEFAULT_DESIGN_COMPILE_LIMITS,
2311
+ Kn as DESIGN_IMPORT_KINDS,
2312
+ Gn as DESIGN_IR_SCHEMA,
2313
+ Ln as DESIGN_IR_VERSION,
2314
+ An as PygmalionCatalogDocument,
2315
+ Mn as PygmalionCatalogMatrix,
2316
+ $n as PygmalionCatalogSection,
2317
+ Bn as PygmalionEditor,
2318
+ ut as STORYBOARD_ENVIRONMENT_CONTROL,
2319
+ Vn as STORYBOARD_ENVIRONMENT_QUERY,
2320
+ Fn as SourceRefControl,
2321
+ Tn as __debug,
2322
+ Wn as applyTokenOverride,
2323
+ Ft as bootstrapPreviewArtifact,
2324
+ Jn as clearPreviewEnvironmentControlValues,
2325
+ Qn as clearPygmalionPreviewCache,
2326
+ Xn as compileDesignDocument,
2327
+ Dn as createDesignComponentCatalog,
2328
+ hn as createDesignComponentVariantMatrix,
2329
+ On as createDesignGalleryCatalog,
2330
+ Yn as createDesignImportController,
2331
+ Zn as createDesignIntermediateDocument,
2332
+ er as createDesignScreenCollection,
2333
+ Nt as createPreviewArtifactHttpTransport,
2334
+ tr as createPreviewCacheNamespace,
2335
+ nr as createPreviewFrameFingerprint,
2336
+ rr as createPreviewRecipeFingerprint,
2337
+ or as createStoryboardCaptureRecipeIdentity,
2338
+ Gt as createStoryboardGraph,
2339
+ cn as createStoryboardGraphFromDiscovery,
2340
+ sr as createStoryboardGraphViewModel,
2341
+ Ut as createStoryboardPathEdges,
2342
+ nt as createStoryboardRouteScenarioId,
2343
+ ir as createStoryboardRouteUrl,
2344
+ un as designCatalogKey,
2345
+ it as designCatalogRegistryName,
2346
+ ar as enumerateDesignComponentConnectionCases,
2347
+ cr as expandDesignScreenCasesViewports,
2348
+ lr as expandDesignScreenCollectionViewports,
2349
+ dr as getDesignCodegenAdapters,
2350
+ ur as getDesignComponentConnection,
2351
+ fr as getDesignComponentConnectionForComponent,
2352
+ mr as getDesignComponentConnections,
2353
+ hr as getPreviewEnvironmentControlValue,
2354
+ pr as getPreviewEnvironmentControls,
2355
+ gr as getPreviewEnvironmentOverride,
2356
+ yr as getRecommendedPygmalionPreviewConcurrency,
2357
+ Se as getStoryboardBaselineEnvironment,
2358
+ ot as getStoryboardDiscoveryBaselineEnvironment,
2359
+ wr as getStoryboardGraph,
2360
+ br as getViewportPresets,
2361
+ st as loadStoryboardDiscovery,
2362
+ vr as mergeScreenPresets,
2363
+ tt as mergeStoryboardEnvironment,
2364
+ Nn as publishStoryboardDiscovery,
2365
+ zn as pygmalionNavigate,
2366
+ jn as pygmalionOpenPreview,
2367
+ _n as pygmalionResetCurrentEdits,
2368
+ Sr as reconstructRoutePreviewArtifactScreenshotV3,
2369
+ Ir as reconstructRoutePreviewArtifactSnapshotV3,
2370
+ xr as registerDesignCodegenAdapter,
2371
+ Pr as resetTokenOverrides,
2372
+ Er as resolvePreviewArtifactFrames,
2373
+ Xt as resolveStoryboardScreenCases,
2374
+ mt as setComponentRegistry,
2375
+ ht as setDesignComponentConnections,
2376
+ Cr as setPreviewEnvironmentControlValue,
2377
+ Ct as setPreviewEnvironmentControls,
2378
+ Pt as setPygmalionAppOrigin,
2379
+ St as setPygmalionPreviewConcurrency,
2380
+ Et as setPygmalionPreviewRevision,
2381
+ ye as setStoryboardBaselineEnvironment,
2382
+ se as setStoryboardGraph,
2383
+ pt as setTokens,
2384
+ gt as setViewportPresets,
2385
+ Ht as storyboardScreenRecipeKey,
2386
+ Rr as subscribePreviewEnvironmentControls,
2387
+ Nr as subscribeStoryboardGraph,
2388
+ kn as usePygmalionProject,
2389
+ Ar as validateDesignComponentConnections,
2390
+ $r as validatePreviewArtifactBundle,
2391
+ Mr as validateRoutePreviewArtifactV3Browser
2369
2392
  };