@pygmalionjs/pygmalion 0.2.20 → 0.2.22

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