@pygmalionjs/pygmalion 0.2.21 → 0.2.23

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 Q, m as Ge, v as Ve, c as qe, i as Je, g as Le, e as K, d as We, a as Qe, f as Xe, h as Ye, j as Ze, k as et, l as tt, n as nt, o as rt, p as ot, q as it, r as st, t as at, u as ct, w as ie, S as lt, A as dt, x as xe, y as ft, z as ut, B as pt, C as ht, D as mt, E as gt, G as yt, H as Pe } from "./App-B_6qmxhS.js";
3
- import { I as zn, J as _n, K as Fn, L as jn, M as Bn, O as Un, P as Hn, Q as Kn, R as Gn, T as Vn, U as qn, V as Jn, W as Ln, X as Wn, Y as Qn, Z as Xn, _ as Yn, $ as Zn } from "./App-B_6qmxhS.js";
4
- import { createElement as Ee, useMemo as de, useState as te, useRef as Ne, useCallback as W, 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-CkJW2APT.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-CkJW2APT.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 wt(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 wt(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 bt(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 St(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 vt(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 ?? wt)(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(St).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 = bt(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)) {
171
- const V = {
172
- ...C,
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
+ const J = {
172
+ ...R,
173
173
  sourceEdgeIds: z([
174
- ...C.sourceEdgeIds,
175
- u
174
+ ...R.sourceEdgeIds,
175
+ f
176
176
  ])
177
177
  };
178
- y.set(M, V);
179
- const H = v.indexOf(C);
180
- H >= 0 && (v[H] = V);
178
+ y.set(k, J);
179
+ const H = I.indexOf(R);
180
+ H >= 0 && (I[H] = J);
181
181
  }
182
182
  continue;
183
183
  }
184
184
  const L = {
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]
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, L), v.push(L);
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 D = [];
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
- D.push(d);
217
+ F.push(d);
218
218
  }
219
- const $ = new Set(D);
220
- let k = z(D);
221
- k.length || (k = 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))), !k.length && p.length && (k = [p[0].id]);
225
- const S = /* @__PURE__ */ new Set(), x = [...k];
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)), G = 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) => !G.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
+ ), V = z(
277
+ (e.scenarios ?? []).map((i) => i.id)
278
+ ), G = V.filter(
279
+ (i) => !K.has(i) && !te.has(i)
280
280
  );
281
- for (const c of B)
281
+ for (const i of G)
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
- ), ae = {
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) => G.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: V.length,
301
+ representedScenarios: V.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: G,
305
+ complete: Q.length === 0 && G.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: k,
316
- branches: Y,
314
+ sourceGroups: Z,
315
+ startNodeIds: T,
316
+ branches: ee,
317
317
  warnings: t,
318
- coverage: ae
318
+ coverage: x
319
319
  };
320
320
  }
321
- function It(e) {
321
+ function wt(e) {
322
322
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
323
323
  }
324
- function fe(e) {
325
- if (Array.isArray(e)) return e.map(fe);
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, fe(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(fe(e ?? null));
332
+ function Ne(e) {
333
+ return JSON.stringify(ce(e ?? null));
334
334
  }
335
- function xt(e) {
335
+ function St(e) {
336
336
  return !!(e && typeof e == "object" && !Array.isArray(e));
337
337
  }
338
338
  function U(e) {
@@ -346,150 +346,150 @@ function U(e) {
346
346
  }
347
347
  return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
348
348
  }
349
- function ke(e) {
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 Pt(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: ke(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 Et(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 Nt(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
- Ge(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 Rt(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: Nt(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 Ct(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 At(e) {
490
+ function Et(e) {
491
491
  return e.action === "wait" ? null : JSON.stringify(
492
- fe({
492
+ ce({
493
493
  action: e.action,
494
494
  selector: e.selector,
495
495
  text: e.text,
@@ -503,530 +503,266 @@ function At(e) {
503
503
  })
504
504
  );
505
505
  }
506
- function ze(e) {
507
- return (e.interactions ?? []).map(At).filter((t) => t != null);
506
+ function Fe(e) {
507
+ return (e.interactions ?? []).map(Et).filter((t) => t != null);
508
508
  }
509
- function Ot(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 $t(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 Mt(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) => Ot(
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 D = m.id === s ? 0 : 1, $ = v.id === s ? 0 : 1;
561
- return D !== $ ? D - $ : 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 Tt(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 Dt(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(ke)
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 D = [A], $ = /* @__PURE__ */ new Set(), k = (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
- k(A);
679
- for (const S of O)
680
- $.has(S) || (D.push(S), k(S));
681
- for (const S of D)
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 It(
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 zt(e) {
697
- const t = Rt(
696
+ function Mt(e) {
697
+ const t = xt(
698
698
  e.pages,
699
699
  e.manifest
700
- ), o = Ct(t), n = Dt(
700
+ ), o = Pt(t), r = $t(
701
701
  t,
702
702
  e.manifest,
703
703
  o
704
- ), i = [
705
- ...Et(
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
- ...$t(n, o),
711
- ...Mt(n, o),
712
- ...Tt(n)
710
+ ...Nt(r, o),
711
+ ...Rt(r, o),
712
+ ...At(r)
713
713
  ];
714
- return vt({
715
- screens: n,
714
+ return yt({
715
+ screens: r,
716
716
  assets: e.assets,
717
- scenarios: Pt(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 (!xt(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: zt({
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 bn(e) {
744
- Q(null);
743
+ async function Yt(e) {
744
+ Y(null);
745
745
  try {
746
- const t = await Fe(e);
747
- return Q(t.graph), t;
746
+ const t = await ze(e);
747
+ return Y(t.graph), t;
748
748
  } catch (t) {
749
- throw Q(null), t;
749
+ throw Y(null), t;
750
750
  }
751
751
  }
752
- const _t = "pygmalion-preview", Ft = "unknown", jt = 512, Bt = 2048, Ut = 8 * 1024 * 1024, Ht = 128 * 1024 * 1024, Kt = /* @__PURE__ */ new Set([
753
- "__proto__",
754
- "constructor",
755
- "prototype"
756
- ]);
757
- function J(e, t) {
758
- const o = e.trim();
759
- if (!o && t != null) return t;
760
- if (le(o)) return o;
761
- throw new TypeError("Preview identity must be a non-empty bounded string.");
762
- }
763
- function Gt(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 Vt(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 je(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 = J(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 Vt(JSON.stringify(o));
811
- }
812
- function Sn(e, t = {}) {
813
- const o = qt(e), n = t.dependencyDigest;
814
- return je([
815
- {
816
- id: J(e.id ?? "", "frame"),
817
- recipe: n == null ? o : { recipe: o, dependencyDigest: J(n) }
818
- }
819
- ]);
820
- }
821
- function vn({
822
- sourceRevision: e,
823
- recipes: t,
824
- recipeVersion: o,
825
- scope: n = _t
826
- }) {
827
- const r = J(n), i = J(
828
- e,
829
- Ft
830
- ), s = Gt(o), a = je(t);
831
- return `${r}:${encodeURIComponent(i)}:recipe-v${s}:${a}`;
832
- }
833
- function qt(e) {
834
- return {
835
- route: e.route,
836
- path: e.path,
837
- componentName: e.componentName,
838
- gallery: e.gallery,
839
- width: e.width,
840
- height: e.height,
841
- environment: e.environment,
842
- preset: e.preset,
843
- interactions: (e.interactions ?? []).map((t) => ({
844
- action: t.action,
845
- selector: t.selector,
846
- text: t.text,
847
- exact: t.exact,
848
- index: t.index,
849
- value: t.value,
850
- key: t.key,
851
- storage: t.storage,
852
- optional: t.optional,
853
- settleMs: t.settleMs,
854
- timeoutMs: t.timeoutMs,
855
- waitState: t.waitState
856
- })),
857
- assertions: e.assertions
858
- };
859
- }
860
- function Jt({
861
- endpoint: e,
862
- fetcher: t,
863
- captureBaseUrl: o
864
- }) {
865
- const n = e.trim();
866
- if (!n)
867
- throw new TypeError(
868
- "Preview artifact endpoint must be a non-empty string."
869
- );
870
- const r = t ?? ((i, s) => fetch(i, s));
871
- return async (i) => {
872
- const s = new URLSearchParams({
873
- namespace: i.namespace,
874
- sourceRevision: i.sourceRevision
875
- });
876
- i.frames && s.set("frames", JSON.stringify(i.frames));
877
- const a = i.captureBaseUrl ?? o;
878
- a && s.set("captureBaseUrl", a);
879
- const l = n.includes("?") ? "&" : "?", g = await r(
880
- `${n}${l}${s}`,
881
- {
882
- method: "GET",
883
- headers: { accept: "application/json" },
884
- cache: "no-store",
885
- signal: i.signal
886
- }
887
- );
888
- if (!g.ok) return null;
889
- const p = await g.json().catch(() => null);
890
- return se(p) && p.artifact !== void 0 ? p.artifact : p;
891
- };
892
- }
893
- function se(e) {
894
- if (!e || typeof e != "object" || Array.isArray(e)) return !1;
895
- const t = Object.getPrototypeOf(e);
896
- return t === Object.prototype || t === null;
897
- }
898
- function Be(e) {
899
- return new TextEncoder().encode(e).byteLength;
900
- }
901
- function le(e) {
902
- return typeof e == "string" && e.length > 0 && e.length <= jt && e === e.trim() && !Kt.has(e);
903
- }
904
- function Lt(e) {
905
- const t = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
906
- for (const o of e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi))
907
- if (t.test(o[1] ?? "")) return !0;
908
- for (const o of e.matchAll(
909
- /\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi
910
- ))
911
- if (t.test(o[1] ?? o[2] ?? o[3] ?? "")) return !0;
912
- return !1;
913
- }
914
- function Wt(e) {
915
- return typeof e != "string" || e.length === 0 || Be(e) > Ut ? !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(
916
- e
917
- ) || Lt(e));
918
- }
919
- function Qt(e) {
920
- const t = [];
921
- if (!se(e) || e.version !== 1)
922
- return {
923
- valid: !1,
924
- artifact: null,
925
- errors: [
926
- "Preview artifact must be a version 1, version 2, or version 3 bundle."
927
- ]
928
- };
929
- if (le(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !le(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !se(e.snapshots))
930
- t.push("Preview artifact snapshots must be a record.");
931
- else {
932
- const o = Object.entries(e.snapshots);
933
- o.length > Bt && t.push("Preview artifact has too many frames.");
934
- for (const [n, r] of o)
935
- (!le(n) || !Wt(r)) && t.push(`Preview artifact frame "${n}" is invalid.`);
936
- }
937
- try {
938
- Be(JSON.stringify(e)) > Ht && t.push("Preview artifact exceeds the bundle byte limit.");
939
- } catch {
940
- t.push("Preview artifact is not serializable.");
941
- }
942
- return {
943
- valid: t.length === 0,
944
- artifact: t.length === 0 ? e : null,
945
- errors: t
946
- };
947
- }
948
- function Xt(e, t) {
949
- const o = se(e) && e.version === 3 ? (() => {
950
- const n = Ve(e);
951
- return {
952
- valid: n.valid,
953
- artifact: n.valid ? e : null,
954
- errors: n.errors
955
- };
956
- })() : se(e) && e.version === 2 ? (() => {
957
- const n = qe(e);
958
- return {
959
- valid: n.valid,
960
- artifact: n.valid ? e : null,
961
- errors: n.errors
962
- };
963
- })() : Qt(e);
964
- return !o.valid || !o.artifact ? {
965
- valid: !1,
966
- artifact: null,
967
- reason: "invalid-bundle",
968
- errors: o.errors
969
- } : t && o.artifact.namespace !== J(t.namespace) ? {
970
- valid: !1,
971
- artifact: null,
972
- reason: "namespace-mismatch",
973
- errors: [
974
- "Preview artifact namespace does not match the runtime namespace."
975
- ]
976
- } : t && o.artifact.sourceRevision !== J(t.sourceRevision) ? {
977
- valid: !1,
978
- artifact: null,
979
- reason: "revision-mismatch",
980
- errors: [
981
- "Preview artifact source revision does not match the runtime revision."
982
- ]
983
- } : {
984
- valid: !0,
985
- artifact: o.artifact,
986
- errors: []
987
- };
988
- }
989
- async function Yt({
990
- namespace: e,
991
- sourceRevision: t,
992
- transport: o,
993
- signal: n
994
- }) {
995
- const r = {
996
- namespace: J(e),
997
- sourceRevision: J(t)
998
- };
999
- let i;
1000
- try {
1001
- i = await o({ ...r, signal: n });
1002
- } catch (a) {
1003
- if (n != null && n.aborted) throw a;
1004
- return { status: "unavailable", artifact: null, error: a };
1005
- }
1006
- if (i == null)
1007
- return { status: "unavailable", artifact: null };
1008
- const s = Xt(i, r);
1009
- return s.valid ? { status: "accepted", artifact: s.artifact } : {
1010
- status: "rejected",
1011
- artifact: null,
1012
- reason: s.reason,
1013
- errors: s.errors
1014
- };
1015
- }
1016
- 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)", Zt = "var(--pygmalion-catalog-header, #11182f)", en = "var(--pygmalion-catalog-accent, #7c6cf2)";
1017
- function In({
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({
1018
754
  title: e,
1019
755
  eyebrow: t,
1020
756
  description: o,
1021
- version: n,
1022
- meta: r,
1023
- children: i,
1024
- headerBackground: s = Zt,
1025
- headerColor: a = "#ffffff",
1026
- bodyBackground: l = ue,
757
+ version: r,
758
+ meta: n,
759
+ children: s,
760
+ headerBackground: a = kt,
761
+ headerColor: c = "#ffffff",
762
+ bodyBackground: u = le,
1027
763
  bodyGap: g = 40
1028
764
  }) {
1029
- return /* @__PURE__ */ N(
765
+ return /* @__PURE__ */ C(
1030
766
  "section",
1031
767
  {
1032
768
  "data-pygmalion-catalog-document": "",
@@ -1038,12 +774,12 @@ function In({
1038
774
  maxWidth: "none",
1039
775
  flexDirection: "column",
1040
776
  overflow: "visible",
1041
- color: he,
1042
- background: l,
777
+ color: ue,
778
+ background: u,
1043
779
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1044
780
  },
1045
781
  children: [
1046
- /* @__PURE__ */ N(
782
+ /* @__PURE__ */ C(
1047
783
  "header",
1048
784
  {
1049
785
  style: {
@@ -1053,11 +789,11 @@ function In({
1053
789
  justifyContent: "space-between",
1054
790
  gap: 48,
1055
791
  padding: "44px 48px 48px",
1056
- color: a,
1057
- background: s
792
+ color: c,
793
+ background: a
1058
794
  },
1059
795
  children: [
1060
- /* @__PURE__ */ N("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
796
+ /* @__PURE__ */ C("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
1061
797
  t ? /* @__PURE__ */ w(
1062
798
  "div",
1063
799
  {
@@ -1098,7 +834,7 @@ function In({
1098
834
  }
1099
835
  ) : null
1100
836
  ] }),
1101
- n || r ? /* @__PURE__ */ N(
837
+ r || n ? /* @__PURE__ */ C(
1102
838
  "div",
1103
839
  {
1104
840
  style: {
@@ -1110,8 +846,8 @@ function In({
1110
846
  whiteSpace: "nowrap"
1111
847
  },
1112
848
  children: [
1113
- n ? /* @__PURE__ */ w("span", { children: n }) : null,
1114
- r ? /* @__PURE__ */ w("span", { children: r }) : null
849
+ r ? /* @__PURE__ */ w("span", { children: r }) : null,
850
+ n ? /* @__PURE__ */ w("span", { children: n }) : null
1115
851
  ]
1116
852
  }
1117
853
  ) : null
@@ -1129,23 +865,23 @@ function In({
1129
865
  alignItems: "flex-start",
1130
866
  gap: g,
1131
867
  padding: 48,
1132
- background: l
868
+ background: u
1133
869
  },
1134
- children: i
870
+ children: s
1135
871
  }
1136
872
  )
1137
873
  ]
1138
874
  }
1139
875
  );
1140
876
  }
1141
- function xn({
877
+ function en({
1142
878
  title: e,
1143
879
  count: t,
1144
880
  description: o,
1145
- children: n,
1146
- tone: r = "tinted"
881
+ children: r,
882
+ tone: n = "tinted"
1147
883
  }) {
1148
- return /* @__PURE__ */ N(
884
+ return /* @__PURE__ */ C(
1149
885
  "section",
1150
886
  {
1151
887
  "data-pygmalion-catalog-section": "",
@@ -1156,11 +892,11 @@ function xn({
1156
892
  flexDirection: "column",
1157
893
  alignItems: "flex-start",
1158
894
  gap: 18,
1159
- padding: r === "tinted" ? 24 : 0,
1160
- background: r === "tinted" ? pe : "transparent"
895
+ padding: n === "tinted" ? 24 : 0,
896
+ background: n === "tinted" ? de : "transparent"
1161
897
  },
1162
898
  children: [
1163
- /* @__PURE__ */ N("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
899
+ /* @__PURE__ */ C("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
1164
900
  /* @__PURE__ */ w(
1165
901
  "h2",
1166
902
  {
@@ -1173,23 +909,23 @@ function xn({
1173
909
  children: e
1174
910
  }
1175
911
  ),
1176
- 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
1177
913
  ] }),
1178
- o ? /* @__PURE__ */ w("div", { style: { marginTop: -10, color: F, fontSize: 11 }, children: o }) : null,
1179
- n
914
+ o ? /* @__PURE__ */ w("div", { style: { marginTop: -10, color: _, fontSize: 11 }, children: o }) : null,
915
+ r
1180
916
  ]
1181
917
  }
1182
918
  );
1183
919
  }
1184
- function Pn({
920
+ function tn({
1185
921
  rows: e,
1186
922
  columns: t,
1187
923
  cornerLabel: o,
1188
- renderCell: n,
1189
- renderRowLabel: r = (l) => l,
1190
- renderColumnLabel: i = (l) => l,
1191
- boundary: s = !0,
1192
- cellStyle: a
924
+ renderCell: r,
925
+ renderRowLabel: n = (u) => u,
926
+ renderColumnLabel: s = (u) => u,
927
+ boundary: a = !0,
928
+ cellStyle: c
1193
929
  }) {
1194
930
  return /* @__PURE__ */ w(
1195
931
  "div",
@@ -1199,11 +935,11 @@ function Pn({
1199
935
  boxSizing: "border-box",
1200
936
  display: "inline-block",
1201
937
  width: "max-content",
1202
- padding: s ? 16 : 0,
1203
- border: s ? `1px dashed ${en}` : void 0,
1204
- borderRadius: s ? 4 : void 0
938
+ padding: a ? 16 : 0,
939
+ border: a ? `1px dashed ${Dt}` : void 0,
940
+ borderRadius: a ? 4 : void 0
1205
941
  },
1206
- children: /* @__PURE__ */ N(
942
+ children: /* @__PURE__ */ C(
1207
943
  "table",
1208
944
  {
1209
945
  style: {
@@ -1212,13 +948,13 @@ function Pn({
1212
948
  borderSpacing: 0
1213
949
  },
1214
950
  children: [
1215
- /* @__PURE__ */ w("thead", { children: /* @__PURE__ */ N("tr", { children: [
951
+ /* @__PURE__ */ w("thead", { children: /* @__PURE__ */ C("tr", { children: [
1216
952
  /* @__PURE__ */ w(
1217
953
  "th",
1218
954
  {
1219
955
  style: {
1220
956
  padding: "0 16px 12px 0",
1221
- color: F,
957
+ color: _,
1222
958
  fontSize: 10,
1223
959
  fontWeight: 600,
1224
960
  textAlign: "left",
@@ -1227,35 +963,35 @@ function Pn({
1227
963
  children: o
1228
964
  }
1229
965
  ),
1230
- t.map((l) => /* @__PURE__ */ w(
966
+ t.map((u) => /* @__PURE__ */ w(
1231
967
  "th",
1232
968
  {
1233
969
  style: {
1234
970
  padding: "0 16px 12px",
1235
- color: F,
971
+ color: _,
1236
972
  fontSize: 10,
1237
973
  fontWeight: 600,
1238
974
  textAlign: "center",
1239
975
  whiteSpace: "nowrap"
1240
976
  },
1241
- children: i(l)
977
+ children: s(u)
1242
978
  },
1243
- l
979
+ u
1244
980
  ))
1245
981
  ] }) }),
1246
- /* @__PURE__ */ w("tbody", { children: e.map((l) => /* @__PURE__ */ N("tr", { children: [
982
+ /* @__PURE__ */ w("tbody", { children: e.map((u) => /* @__PURE__ */ C("tr", { children: [
1247
983
  /* @__PURE__ */ w(
1248
984
  "th",
1249
985
  {
1250
986
  style: {
1251
987
  padding: "12px 16px 12px 0",
1252
- color: F,
988
+ color: _,
1253
989
  fontSize: 10,
1254
990
  fontWeight: 600,
1255
991
  textAlign: "left",
1256
992
  whiteSpace: "nowrap"
1257
993
  },
1258
- children: r(l)
994
+ children: n(u)
1259
995
  }
1260
996
  ),
1261
997
  t.map((g) => /* @__PURE__ */ w(
@@ -1265,27 +1001,27 @@ function Pn({
1265
1001
  padding: "12px 16px",
1266
1002
  textAlign: "center",
1267
1003
  verticalAlign: "middle",
1268
- ...a
1004
+ ...c
1269
1005
  },
1270
- children: n(l, g)
1006
+ children: r(u, g)
1271
1007
  },
1272
1008
  g
1273
1009
  ))
1274
- ] }, l)) })
1010
+ ] }, u)) })
1275
1011
  ]
1276
1012
  }
1277
1013
  )
1278
1014
  }
1279
1015
  );
1280
1016
  }
1281
- function tn(e) {
1017
+ function Ft(e) {
1282
1018
  return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
1283
1019
  }
1284
- function Ue(e, t, o = "PygmalionCatalog") {
1285
- const n = (r) => tn(r).replace(/-/g, "_");
1286
- 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)}`;
1287
1023
  }
1288
- function He(e, t) {
1024
+ function Be(e, t) {
1289
1025
  return {
1290
1026
  id: e.id,
1291
1027
  name: e.name,
@@ -1296,7 +1032,7 @@ function He(e, t) {
1296
1032
  description: e.description
1297
1033
  };
1298
1034
  }
1299
- function Ke(e) {
1035
+ function je(e) {
1300
1036
  const t = /* @__PURE__ */ new Set();
1301
1037
  for (const o of e) {
1302
1038
  if (t.has(o.id))
@@ -1304,17 +1040,17 @@ function Ke(e) {
1304
1040
  t.add(o.id);
1305
1041
  }
1306
1042
  }
1307
- function nn(e, t, o) {
1043
+ function Tt(e, t, o) {
1308
1044
  return typeof e == "function" ? e(t, o) : e;
1309
1045
  }
1310
- function rn({
1046
+ function zt({
1311
1047
  page: e,
1312
1048
  items: t,
1313
1049
  renderPreview: o,
1314
- secondaryLabel: n,
1315
- minimumColumnWidth: r
1050
+ secondaryLabel: r,
1051
+ minimumColumnWidth: n
1316
1052
  }) {
1317
- return /* @__PURE__ */ N(
1053
+ return /* @__PURE__ */ C(
1318
1054
  "section",
1319
1055
  {
1320
1056
  "data-pygmalion-catalog-page": e.id,
@@ -1324,14 +1060,14 @@ function rn({
1324
1060
  display: "inline-block",
1325
1061
  width: "max-content",
1326
1062
  padding: 32,
1327
- color: he,
1328
- background: pe,
1063
+ color: ue,
1064
+ background: de,
1329
1065
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1330
1066
  },
1331
1067
  children: [
1332
- /* @__PURE__ */ N("header", { style: { marginBottom: 24 }, children: [
1068
+ /* @__PURE__ */ C("header", { style: { marginBottom: 24 }, children: [
1333
1069
  /* @__PURE__ */ w("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
1334
- /* @__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: [
1335
1071
  t.length,
1336
1072
  " assets"
1337
1073
  ] })
@@ -1344,17 +1080,17 @@ function rn({
1344
1080
  gridTemplateColumns: "repeat(6, max-content)",
1345
1081
  gap: 16
1346
1082
  },
1347
- children: t.map((i) => /* @__PURE__ */ N(
1083
+ children: t.map((s) => /* @__PURE__ */ C(
1348
1084
  "article",
1349
1085
  {
1350
- "data-pygmalion-catalog-item": i.id,
1086
+ "data-pygmalion-catalog-item": s.id,
1351
1087
  style: {
1352
- minWidth: r,
1353
- width: r,
1088
+ minWidth: n,
1089
+ width: n,
1354
1090
  padding: 16,
1355
- border: `1px solid ${Se}`,
1091
+ border: `1px solid ${ye}`,
1356
1092
  borderRadius: 12,
1357
- background: ue
1093
+ background: le
1358
1094
  },
1359
1095
  children: [
1360
1096
  /* @__PURE__ */ w(
@@ -1367,7 +1103,7 @@ function rn({
1367
1103
  justifyContent: "center",
1368
1104
  overflow: "hidden"
1369
1105
  },
1370
- children: o(i)
1106
+ children: o(s)
1371
1107
  }
1372
1108
  ),
1373
1109
  /* @__PURE__ */ w(
@@ -1381,29 +1117,29 @@ function rn({
1381
1117
  textOverflow: "ellipsis",
1382
1118
  whiteSpace: "nowrap"
1383
1119
  },
1384
- title: i.name,
1385
- children: i.name
1120
+ title: s.name,
1121
+ children: s.name
1386
1122
  }
1387
1123
  ),
1388
- 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(
1389
1125
  "div",
1390
1126
  {
1391
1127
  style: {
1392
1128
  marginTop: 4,
1393
1129
  overflow: "hidden",
1394
- color: F,
1130
+ color: _,
1395
1131
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
1396
1132
  fontSize: 11,
1397
1133
  textOverflow: "ellipsis",
1398
1134
  whiteSpace: "nowrap"
1399
1135
  },
1400
- title: i.codeName,
1401
- children: i.codeName
1136
+ title: s.codeName,
1137
+ children: s.codeName
1402
1138
  }
1403
1139
  ) : null
1404
1140
  ]
1405
1141
  },
1406
- i.id
1142
+ s.id
1407
1143
  ))
1408
1144
  }
1409
1145
  )
@@ -1411,86 +1147,86 @@ function rn({
1411
1147
  }
1412
1148
  );
1413
1149
  }
1414
- function En(e) {
1415
- Ke(e.items);
1150
+ function nn(e) {
1151
+ je(e.items);
1416
1152
  const t = /* @__PURE__ */ new Map();
1417
- for (const r of e.items) {
1418
- const i = e.pageFor(r), s = t.get(i.id);
1419
- if (s) {
1420
- if (s.page.name !== i.name || s.page.section !== i.section)
1421
- throw new Error(`Conflicting design catalog page descriptor: ${i.id}`);
1422
- 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);
1423
1159
  continue;
1424
1160
  }
1425
- t.set(i.id, {
1426
- page: i,
1427
- items: [r],
1428
- registryName: Ue(
1161
+ t.set(s.id, {
1162
+ page: s,
1163
+ items: [n],
1164
+ registryName: _e(
1429
1165
  e.kind,
1430
- i.id,
1166
+ s.id,
1431
1167
  e.registryPrefix
1432
1168
  )
1433
1169
  });
1434
1170
  }
1435
- const o = {}, n = [];
1436
- for (const r of t.values()) {
1437
- const i = () => /* @__PURE__ */ w(
1438
- rn,
1171
+ const o = {}, r = [];
1172
+ for (const n of t.values()) {
1173
+ const s = () => /* @__PURE__ */ w(
1174
+ zt,
1439
1175
  {
1440
- page: r.page,
1441
- items: r.items,
1176
+ page: n.page,
1177
+ items: n.items,
1442
1178
  renderPreview: e.renderPreview,
1443
1179
  secondaryLabel: e.secondaryLabel,
1444
1180
  minimumColumnWidth: e.minimumColumnWidth ?? 152
1445
1181
  }
1446
1182
  );
1447
- o[r.registryName] = {
1448
- component: i,
1183
+ o[n.registryName] = {
1184
+ component: s,
1449
1185
  children: "none"
1450
1186
  };
1451
- const s = nn(e.frame, r.page, r.items);
1452
- n.push({
1453
- ...r.page,
1454
- componentName: r.registryName,
1455
- width: (s == null ? void 0 : s.width) ?? 1,
1456
- height: (s == null ? void 0 : s.height) ?? 1,
1457
- 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"
1458
1194
  });
1459
1195
  }
1460
1196
  return {
1461
1197
  registry: o,
1462
1198
  collection: {
1463
1199
  expectedCount: e.expectedCount ?? e.items.length,
1464
- assets: e.items.map((r) => He(r, e.pageFor(r).id)),
1465
- pages: n
1200
+ assets: e.items.map((n) => Be(n, e.pageFor(n).id)),
1201
+ pages: r
1466
1202
  }
1467
1203
  };
1468
1204
  }
1469
- function on(e, t = 60) {
1470
- 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)));
1471
1207
  return {
1472
- row: n,
1473
- column: r ? [r[0], s ?? []] : void 0,
1474
- 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]]),
1475
1211
  additional: o.slice(2)
1476
1212
  };
1477
1213
  }
1478
- function sn(e, t, o, n) {
1214
+ function Bt(e, t, o, r) {
1479
1215
  return {
1480
1216
  ...e.defaultProps,
1481
1217
  ...Object.fromEntries(t.fixed),
1482
1218
  ...t.row && o ? { [t.row[0]]: o } : {},
1483
- ...t.column && n ? { [t.column[0]]: n } : {}
1219
+ ...t.column && r ? { [t.column[0]]: r } : {}
1484
1220
  };
1485
1221
  }
1486
- function an({
1222
+ function jt({
1487
1223
  item: e,
1488
1224
  entry: t,
1489
1225
  maxVariantCells: o
1490
1226
  }) {
1491
- var a, l;
1227
+ var c, u;
1492
1228
  if (!t)
1493
- return /* @__PURE__ */ N(
1229
+ return /* @__PURE__ */ C(
1494
1230
  "section",
1495
1231
  {
1496
1232
  "data-pygmalion-catalog-component": e.id,
@@ -1500,17 +1236,17 @@ function an({
1500
1236
  display: "inline-block",
1501
1237
  width: "max-content",
1502
1238
  padding: 32,
1503
- color: he,
1504
- background: pe
1239
+ color: ue,
1240
+ background: de
1505
1241
  },
1506
1242
  children: [
1507
1243
  /* @__PURE__ */ w("strong", { children: e.name }),
1508
- /* @__PURE__ */ w("p", { style: { color: F }, children: "The component is not registered." })
1244
+ /* @__PURE__ */ w("p", { style: { color: _ }, children: "The component is not registered." })
1509
1245
  ]
1510
1246
  }
1511
1247
  );
1512
- const n = on(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;
1513
- 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(
1514
1250
  "section",
1515
1251
  {
1516
1252
  "data-pygmalion-catalog-component": e.id,
@@ -1520,262 +1256,262 @@ function an({
1520
1256
  display: "inline-block",
1521
1257
  width: "max-content",
1522
1258
  padding: 32,
1523
- color: he,
1524
- background: pe,
1259
+ color: ue,
1260
+ background: de,
1525
1261
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1526
1262
  },
1527
1263
  children: [
1528
- /* @__PURE__ */ N("header", { style: { marginBottom: 24 }, children: [
1264
+ /* @__PURE__ */ C("header", { style: { marginBottom: 24 }, children: [
1529
1265
  /* @__PURE__ */ w("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
1530
- 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
1531
1267
  ] }),
1532
1268
  /* @__PURE__ */ w(
1533
1269
  "div",
1534
1270
  {
1535
1271
  style: {
1536
1272
  display: "inline-grid",
1537
- gridTemplateColumns: `repeat(${i.length}, max-content)`,
1273
+ gridTemplateColumns: `repeat(${s.length}, max-content)`,
1538
1274
  gap: 12
1539
1275
  },
1540
- children: r.flatMap(
1541
- (g) => i.map((p) => {
1542
- const b = sn(t, n, g, p), m = [
1543
- n.row && g ? `${n.row[0]}=${g}` : "",
1544
- 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}` : ""
1545
1281
  ].filter(Boolean).join(" · ");
1546
- return /* @__PURE__ */ N(
1282
+ return /* @__PURE__ */ C(
1547
1283
  "article",
1548
1284
  {
1549
1285
  style: {
1550
1286
  width: "max-content",
1551
1287
  padding: 16,
1552
- border: `1px solid ${Se}`,
1288
+ border: `1px solid ${ye}`,
1553
1289
  borderRadius: 10,
1554
- background: ue
1290
+ background: le
1555
1291
  },
1556
1292
  children: [
1557
- 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,
1558
1294
  /* @__PURE__ */ w("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Ee(
1559
- s,
1560
- b,
1295
+ a,
1296
+ S,
1561
1297
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1562
1298
  ) })
1563
1299
  ]
1564
1300
  },
1565
- `${g ?? "default"}:${p ?? "default"}`
1301
+ `${g ?? "default"}:${h ?? "default"}`
1566
1302
  );
1567
1303
  })
1568
1304
  )
1569
1305
  }
1570
1306
  ),
1571
- n.additional.map(([g, p]) => /* @__PURE__ */ N("section", { style: { marginTop: 20 }, children: [
1572
- /* @__PURE__ */ w("h2", { style: { margin: "0 0 10px", color: F, fontSize: 12 }, children: g }),
1573
- /* @__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(
1574
1310
  "article",
1575
1311
  {
1576
1312
  style: {
1577
1313
  padding: 16,
1578
- border: `1px solid ${Se}`,
1314
+ border: `1px solid ${ye}`,
1579
1315
  borderRadius: 10,
1580
- background: ue
1316
+ background: le
1581
1317
  },
1582
1318
  children: [
1583
- /* @__PURE__ */ w("div", { style: { marginBottom: 12, color: F, fontSize: 11 }, children: b }),
1319
+ /* @__PURE__ */ w("div", { style: { marginBottom: 12, color: _, fontSize: 11 }, children: S }),
1584
1320
  Ee(
1585
- s,
1586
- { ...t.defaultProps, [g]: b },
1321
+ a,
1322
+ { ...t.defaultProps, [g]: S },
1587
1323
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1588
1324
  )
1589
1325
  ]
1590
1326
  },
1591
- b
1327
+ S
1592
1328
  )) })
1593
1329
  ] }, g))
1594
1330
  ]
1595
1331
  }
1596
1332
  );
1597
1333
  }
1598
- function Nn(e) {
1599
- Ke(e.items);
1600
- const t = {}, o = [], n = [], r = e.maxVariantCells ?? 60;
1601
- for (const i of e.items) {
1602
- const s = Ue(
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(
1603
1339
  e.kind,
1604
- i.id,
1340
+ s.id,
1605
1341
  e.registryPrefix
1606
- ), a = e.registry[i.name], l = () => /* @__PURE__ */ w(
1607
- an,
1342
+ ), c = e.registry[s.name], u = () => /* @__PURE__ */ w(
1343
+ jt,
1608
1344
  {
1609
- item: i,
1610
- entry: a,
1611
- maxVariantCells: r
1345
+ item: s,
1346
+ entry: c,
1347
+ maxVariantCells: n
1612
1348
  }
1613
1349
  );
1614
- t[s] = { component: l, children: "none" }, o.push({
1615
- id: i.id,
1616
- name: i.name,
1617
- section: i.section,
1618
- 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,
1619
1355
  // The seed exists only long enough to mount the intrinsic max-content
1620
1356
  // catalog root. The editor replaces it with actual rendered DOM bounds.
1621
1357
  width: 1,
1622
1358
  height: 1,
1623
1359
  frameSizeMode: "content"
1624
- }), n.push(He(i, i.id));
1360
+ }), r.push(Be(s, s.id));
1625
1361
  }
1626
1362
  return {
1627
1363
  registry: t,
1628
1364
  collection: {
1629
1365
  expectedCount: e.expectedCount ?? e.items.length,
1630
- assets: n,
1366
+ assets: r,
1631
1367
  pages: o
1632
1368
  }
1633
1369
  };
1634
1370
  }
1635
- const Oe = /^[a-f0-9]{64}$/, cn = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, ln = /^p\d+$/;
1636
- function ve(e) {
1637
- return typeof e == "string" && cn.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;
1638
1374
  }
1639
1375
  function $e(e, t) {
1640
1376
  const o = new URL(e, t);
1641
1377
  return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
1642
1378
  }
1643
- function ge(e) {
1379
+ function he(e) {
1644
1380
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1645
1381
  const t = e;
1646
- 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 : {
1647
1383
  domStructureHash: t.domStructureHash,
1648
1384
  screenshotHash: t.screenshotHash,
1649
- ...ve(t.screenshotUrl) ? { screenshotUrl: ve(t.screenshotUrl) } : {}
1385
+ ...we(t.screenshotUrl) ? { screenshotUrl: we(t.screenshotUrl) } : {}
1650
1386
  };
1651
1387
  }
1652
- function Me(e) {
1388
+ function Oe(e) {
1653
1389
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1654
1390
  const t = e;
1655
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) };
1656
1392
  }
1657
- function dn(e) {
1393
+ function qt(e) {
1658
1394
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1659
- const t = e, o = Me(t.before), n = Me(t.after);
1660
- 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)
1661
1397
  return null;
1662
- const r = t.heatmapUrl == null ? null : ve(t.heatmapUrl) ?? null;
1398
+ const n = t.heatmapUrl == null ? null : we(t.heatmapUrl) ?? null;
1663
1399
  return {
1664
1400
  before: o,
1665
- after: n,
1666
- dimensionsMatch: o.width === n.width && o.height === n.height,
1401
+ after: r,
1402
+ dimensionsMatch: o.width === r.width && o.height === r.height,
1667
1403
  changedPixels: Number(t.changedPixels),
1668
1404
  totalPixels: Number(t.totalPixels),
1669
1405
  diffRatio: Number(t.changedPixels) / Number(t.totalPixels),
1670
1406
  threshold: t.threshold,
1671
- heatmapUrl: r
1407
+ heatmapUrl: n
1672
1408
  };
1673
1409
  }
1674
- function fn(e, t) {
1410
+ function Kt(e, t) {
1675
1411
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1676
1412
  const o = e;
1677
1413
  if (typeof o.id != "string" || !o.id) return null;
1678
- const n = ge(o), r = ge(o.before) ?? n;
1679
- if (!r) return null;
1680
- const i = ge(o.after);
1681
- if (t === "changed" && !i) return null;
1682
- const s = i ? dn(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;
1683
1419
  return {
1684
1420
  id: o.id,
1685
- before: r,
1686
- ...i ? { after: i } : {},
1687
- ...i ? {
1688
- domChanged: r.domStructureHash !== i.domStructureHash,
1689
- 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
1690
1426
  } : {},
1691
- ...s ? { pixelDiff: s } : {}
1427
+ ...a ? { pixelDiff: a } : {}
1692
1428
  };
1693
1429
  }
1694
- function un(e, t = []) {
1695
- const o = new Set(t), n = o.size > 0, r = /* @__PURE__ */ new Set(), i = [
1696
- ...e.styles.map((s) => s.affectedFrames ?? []),
1697
- ...e.texts.map((s) => s.affectedFrames ?? []),
1698
- ...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 ?? [])
1699
1435
  ];
1700
- for (const s of i)
1701
- for (const a of s) {
1702
- if (n && ln.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))
1703
1439
  throw new Error(
1704
- `"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.`
1705
1441
  );
1706
- !a.id || n && !o.has(a.id) || r.add(a.id);
1442
+ !c.id || r && !o.has(c.id) || n.add(c.id);
1707
1443
  }
1708
- return [...r].sort();
1444
+ return [...n].sort();
1709
1445
  }
1710
- async function Te(e, t, o) {
1711
- const n = await e(`${t.replace(/\/$/, "")}/capture`, {
1446
+ async function Me(e, t, o) {
1447
+ const r = await e(`${t.replace(/\/$/, "")}/capture`, {
1712
1448
  method: "POST",
1713
1449
  headers: { "content-type": "application/json" },
1714
1450
  body: JSON.stringify(o)
1715
- }), r = await n.json();
1716
- if (!n.ok || r.ok === !1)
1451
+ }), n = await r.json();
1452
+ if (!r.ok || n.ok === !1)
1717
1453
  throw new Error(
1718
- 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})`
1719
1455
  );
1720
- if (typeof r.baselineId != "string" || !r.baselineId)
1456
+ if (typeof n.baselineId != "string" || !n.baselineId)
1721
1457
  throw new Error("Pygmalion visual QA response has no baselineId");
1722
- const i = Array.isArray(r.frames) ? r.frames.map((p) => fn(p, o.phase)).filter((p) => p != null) : [], s = Array.isArray(r.failures) ? r.failures.map((p) => {
1723
- if (!p || typeof p != "object" || Array.isArray(p)) return null;
1724
- const b = p;
1725
- return typeof b.id == "string" && typeof b.error == "string" ? { id: b.id, error: b.error } : null;
1726
- }).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));
1727
1463
  return {
1728
1464
  phase: o.phase,
1729
- baselineId: r.baselineId,
1730
- complete: r.complete !== !1 && g && s.length === 0 && i.length === o.frameIds.length,
1731
- frames: i,
1732
- 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
1733
1469
  };
1734
1470
  }
1735
- const ye = {
1471
+ const pe = {
1736
1472
  mirror: "/__pygmalion-dev-control",
1737
1473
  sessions: "/__pygmalion-design-session",
1738
1474
  inspect: "/__pygmalion-inspect"
1739
- }, pn = "pygmalion.designSessionId", hn = "/__pygmalion-qa", ce = /* @__PURE__ */ new Map();
1740
- function De() {
1475
+ }, Jt = "pygmalion.designSessionId", Wt = "/__pygmalion-qa", ie = /* @__PURE__ */ new Map();
1476
+ function ke() {
1741
1477
  var e;
1742
1478
  return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1743
1479
  }
1744
- function mn(e, t) {
1480
+ function Vt(e, t) {
1745
1481
  if (e) return e;
1746
- const o = ce.get(t);
1482
+ const o = ie.get(t);
1747
1483
  if (o) return o;
1748
1484
  try {
1749
- const n = window.localStorage.getItem(t);
1750
- if (n)
1751
- return ce.set(t, n), n;
1752
- const r = De();
1753
- return window.localStorage.setItem(t, r), ce.set(t, r), r;
1485
+ const r = window.localStorage.getItem(t);
1486
+ if (r)
1487
+ return ie.set(t, r), r;
1488
+ const n = ke();
1489
+ return window.localStorage.setItem(t, n), ie.set(t, n), n;
1754
1490
  } catch {
1755
- const n = De();
1756
- return ce.set(t, n), n;
1491
+ const r = ke();
1492
+ return ie.set(t, r), r;
1757
1493
  }
1758
1494
  }
1759
- async function q(e) {
1495
+ async function W(e) {
1760
1496
  const t = await e.json();
1761
1497
  if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
1762
1498
  return t;
1763
1499
  }
1764
- function Rn(e = {}) {
1765
- var ae, re, oe, c, f;
1500
+ function on(e = {}) {
1501
+ var x, j, $, i, l;
1766
1502
  const {
1767
1503
  sessionId: t,
1768
- sessionStorageKey: o = pn,
1769
- autoStart: n = !0,
1770
- fetcher: r = fetch,
1771
- formatApplyMessage: i
1772
- } = e, s = ((ae = e.endpoints) == null ? void 0 : ae.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) ?? hn, b = JSON.stringify(((f = e.visualQa) == null ? void 0 : f.eligibleFrameIds) ?? []), m = de(
1773
- () => JSON.parse(b),
1774
- [b]
1775
- ), v = de(
1776
- () => mn(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),
1777
1513
  [t, o]
1778
- ), [y, R] = te({
1514
+ ), [y, N] = re({
1779
1515
  state: "idle",
1780
1516
  commit: null,
1781
1517
  shortCommit: null,
@@ -1785,300 +1521,300 @@ function Rn(e = {}) {
1785
1521
  warning: null,
1786
1522
  error: null,
1787
1523
  appOrigin: null
1788
- }), [h, O] = te(null), [A, D] = te(null), [$, k] = te({
1524
+ }), [p, O] = re(null), [A, F] = re(null), [M, T] = re({
1789
1525
  refs: [],
1790
1526
  defaultRef: null,
1791
1527
  worktreeRef: null
1792
- }), S = Ne(null), x = Ne(null), T = W(
1793
- async (d = !0, u) => {
1794
- if (u != null && S.current && await S.current.catch(() => {
1795
- }), S.current) return S.current;
1796
- const P = (async () => {
1797
- 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 }));
1798
1534
  try {
1799
- const I = u != null;
1800
- let M = await r(`${s}/${d || I ? "refresh" : "status"}`, {
1801
- method: d || I ? "POST" : "GET",
1802
- ...I ? {
1535
+ const P = f != null;
1536
+ let k = await n(`${a}/${d || P ? "refresh" : "status"}`, {
1537
+ method: d || P ? "POST" : "GET",
1538
+ ...P ? {
1803
1539
  headers: { "content-type": "application/json" },
1804
- body: JSON.stringify({ ref: u })
1540
+ body: JSON.stringify({ ref: f })
1805
1541
  } : {}
1806
- }), C = await q(M);
1542
+ }), R = await W(k);
1807
1543
  const L = Date.now();
1808
- for (; !d && C.state === "syncing" && Date.now() - L < 12e4; )
1809
- await new Promise((ee) => window.setTimeout(ee, 500)), M = await r(`${s}/status`), C = await q(M);
1810
- if (C.state !== "ready" || !C.appOrigin || !C.commit)
1811
- throw new Error(C.error ?? "Pygmalion could not prepare the source preview");
1812
- const V = await q(
1813
- await r(`${a}/open`, {
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 W(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 J = await W(
1549
+ await n(`${c}/open`, {
1814
1550
  method: "POST",
1815
1551
  headers: { "content-type": "application/json" },
1816
- body: JSON.stringify({ sessionId: v, baseDevSha: C.commit })
1552
+ body: JSON.stringify({ sessionId: I, baseDevSha: R.commit })
1817
1553
  })
1818
1554
  );
1819
- if (!V.ok || !V.session)
1820
- throw new Error(V.error ?? "Pygmalion could not open the design session");
1821
- let H = V.session;
1555
+ if (!J.ok || !J.session)
1556
+ throw new Error(J.error ?? "Pygmalion could not open the design session");
1557
+ let H = J.session;
1822
1558
  if (H.branchName) {
1823
- const ee = await q(
1824
- await r(`${a}/check`, {
1559
+ const ne = await W(
1560
+ await n(`${c}/check`, {
1825
1561
  method: "POST",
1826
1562
  headers: { "content-type": "application/json" },
1827
1563
  body: JSON.stringify({ sessionId: H.id })
1828
1564
  })
1829
1565
  );
1830
- if (!ee.ok || !ee.session)
1831
- throw new Error(ee.error ?? "Pygmalion could not check the design session");
1832
- 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;
1833
1569
  }
1834
- R(C), O(H), D(H.appOrigin ?? C.appOrigin);
1835
- } catch (I) {
1836
- R((M) => ({
1837
- ...M,
1570
+ N(R), O(H), F(H.appOrigin ?? R.appOrigin);
1571
+ } catch (P) {
1572
+ N((k) => ({
1573
+ ...k,
1838
1574
  state: "error",
1839
- error: I instanceof Error ? I.message : String(I)
1575
+ error: P instanceof Error ? P.message : String(P)
1840
1576
  }));
1841
1577
  }
1842
1578
  })();
1843
- S.current = P;
1579
+ b.current = v;
1844
1580
  try {
1845
- await P;
1581
+ await v;
1846
1582
  } finally {
1847
- S.current === P && (S.current = null);
1583
+ b.current === v && (b.current = null);
1848
1584
  }
1849
1585
  },
1850
- [r, s, a, v]
1851
- ), j = W(async () => {
1586
+ [n, a, c, I]
1587
+ ), B = X(async () => {
1852
1588
  try {
1853
- const d = await q(
1854
- await r(`${s}/refs`)
1855
- ), u = {
1589
+ const d = await W(
1590
+ await n(`${a}/refs`)
1591
+ ), f = {
1856
1592
  refs: d.refs ?? [],
1857
1593
  defaultRef: d.defaultRef ?? null,
1858
1594
  worktreeRef: d.worktreeRef ?? null
1859
1595
  };
1860
- return k(u), u;
1596
+ return T(f), f;
1861
1597
  } catch {
1862
- return $;
1598
+ return M;
1863
1599
  }
1864
- }, [r, s, $]), X = W(
1865
- async (d, u) => {
1866
- 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))
1867
1603
  throw new Error(
1868
1604
  "This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
1869
1605
  );
1870
- await T(!0, d);
1606
+ await D(!0, d);
1871
1607
  },
1872
- [T, h == null ? void 0 : h.branchName]
1873
- ), Y = W(
1608
+ [D, p == null ? void 0 : p.branchName]
1609
+ ), ee = X(
1874
1610
  async (d) => {
1875
- var C;
1876
- if (!h) throw new Error("Pygmalion design session is not ready");
1877
- const u = x.current;
1878
- 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)))
1879
1615
  throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
1880
- const P = await q(
1881
- await r(`${a}/apply-visual`, {
1616
+ const v = await W(
1617
+ await n(`${c}/apply-visual`, {
1882
1618
  method: "POST",
1883
1619
  headers: { "content-type": "application/json" },
1884
1620
  body: JSON.stringify({
1885
- sessionId: h.id,
1886
- baseDevSha: h.baseDevSha,
1887
- expectedRevision: h.revision,
1888
- ...u ? { previewRevision: u.revision } : {},
1621
+ sessionId: p.id,
1622
+ baseDevSha: p.baseDevSha,
1623
+ expectedRevision: p.revision,
1624
+ ...f ? { previewRevision: f.revision } : {},
1889
1625
  changes: d
1890
1626
  })
1891
1627
  })
1892
1628
  );
1893
- if (!P.ok || !P.session)
1894
- throw new Error(P.error ?? "Pygmalion could not apply the visual changes");
1895
- O(P.session), P.session.appOrigin && D(P.session.appOrigin);
1896
- const I = P.applied ?? d.styles.length + d.texts.length + d.operations.length;
1897
- let M;
1898
- 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)
1899
1635
  try {
1900
- M = await Te(r, p, {
1636
+ k = await Me(n, h, {
1901
1637
  phase: "changed",
1902
- baselineId: u.qaBaselineId,
1903
- basePath: $e(P.session.appOrigin, window.location.origin),
1904
- frameIds: u.qaFrameIds
1638
+ baselineId: f.qaBaselineId,
1639
+ basePath: $e(v.session.appOrigin, window.location.origin),
1640
+ frameIds: f.qaFrameIds
1905
1641
  });
1906
1642
  } catch (L) {
1907
- const V = L instanceof Error ? L.message : String(L);
1908
- M = {
1643
+ const J = L instanceof Error ? L.message : String(L);
1644
+ k = {
1909
1645
  phase: "changed",
1910
- baselineId: u.qaBaselineId,
1646
+ baselineId: f.qaBaselineId,
1911
1647
  complete: !1,
1912
1648
  frames: [],
1913
- failures: u.qaFrameIds.map((H) => ({ id: H, error: V }))
1649
+ failures: f.qaFrameIds.map((H) => ({ id: H, error: J }))
1914
1650
  };
1915
1651
  }
1916
- return x.current = null, {
1917
- applied: I,
1918
- branch: P.session.branchName ?? void 0,
1919
- integration: P.session.integration.state,
1920
- message: i == null ? void 0 : i(P.session, I),
1921
- ...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 } : {}
1922
1658
  };
1923
1659
  },
1924
- [r, i, p, h, a]
1925
- ), G = W(
1660
+ [n, s, h, p, c]
1661
+ ), K = X(
1926
1662
  async (d) => {
1927
- var C;
1928
- if (!h) throw new Error("Pygmalion design session is not ready");
1929
- x.current = null;
1930
- const u = await q(
1931
- 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 W(
1667
+ await n(`${c}/preview-visual`, {
1932
1668
  method: "POST",
1933
1669
  headers: { "content-type": "application/json" },
1934
1670
  body: JSON.stringify({
1935
- sessionId: h.id,
1936
- baseDevSha: h.baseDevSha,
1937
- expectedRevision: h.revision,
1671
+ sessionId: p.id,
1672
+ baseDevSha: p.baseDevSha,
1673
+ expectedRevision: p.revision,
1938
1674
  changes: d
1939
1675
  })
1940
1676
  })
1941
1677
  );
1942
- if (!u.ok || !Number.isSafeInteger(u.revision))
1943
- throw new Error(u.error ?? "Pygmalion could not preview the visual changes");
1944
- const P = g ? un(d, m) : [];
1945
- let I;
1946
- const M = h.appOrigin ?? y.appOrigin;
1947
- if (P.length > 0) {
1948
- 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)
1949
1685
  throw new Error("Impact screen QA baseline preview not ready");
1950
- if (I = await Te(r, p, {
1686
+ if (P = await Me(n, h, {
1951
1687
  phase: "baseline",
1952
- basePath: $e(M, window.location.origin),
1953
- frameIds: P
1954
- }), !I.complete)
1688
+ basePath: $e(k, window.location.origin),
1689
+ frameIds: v
1690
+ }), !P.complete)
1955
1691
  throw new Error(
1956
- ((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`
1957
1693
  );
1958
1694
  }
1959
- return x.current = {
1960
- sessionId: h.id,
1961
- baseDevSha: h.baseDevSha,
1962
- revision: u.revision,
1695
+ return E.current = {
1696
+ sessionId: p.id,
1697
+ baseDevSha: p.baseDevSha,
1698
+ revision: f.revision,
1963
1699
  fingerprint: JSON.stringify(d),
1964
- ...I ? { qaBaselineId: I.baselineId, qaFrameIds: P } : {}
1700
+ ...P ? { qaBaselineId: P.baselineId, qaFrameIds: v } : {}
1965
1701
  }, {
1966
- revision: u.revision,
1967
- files: Array.isArray(u.files) ? u.files : [],
1968
- affectedFiles: Array.isArray(u.affectedFiles) ? u.affectedFiles : [],
1969
- ...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 } : {}
1970
1706
  };
1971
1707
  },
1972
1708
  [
1973
- r,
1709
+ n,
1974
1710
  y.appOrigin,
1975
1711
  m,
1976
- p,
1977
1712
  h,
1978
- a,
1713
+ p,
1714
+ c,
1979
1715
  g
1980
1716
  ]
1981
- ), Z = W(
1717
+ ), te = X(
1982
1718
  async (d) => {
1983
1719
  if (d.length === 0) return { files: [] };
1984
- const u = await q(
1985
- await r(`${l}/impact`, {
1720
+ const f = await W(
1721
+ await n(`${u}/impact`, {
1986
1722
  method: "POST",
1987
1723
  headers: { "content-type": "application/json" },
1988
1724
  body: JSON.stringify({ componentFiles: d })
1989
1725
  })
1990
1726
  );
1991
- if (u.error || u.ok === !1)
1992
- throw new Error(u.error ?? "Pygmalion could not calculate source impact");
1993
- 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 : [] };
1994
1730
  },
1995
- [r, l]
1996
- ), E = W(async () => {
1997
- if (!(h != null && h.canRevert) || !h.headSha)
1731
+ [n, u]
1732
+ ), V = X(async () => {
1733
+ if (!(p != null && p.canRevert) || !p.headSha)
1998
1734
  throw new Error("There are no reversible changes applied");
1999
- const d = await q(
2000
- await r(`${a}/revert-visual`, {
1735
+ const d = await W(
1736
+ await n(`${c}/revert-visual`, {
2001
1737
  method: "POST",
2002
1738
  headers: { "content-type": "application/json" },
2003
1739
  body: JSON.stringify({
2004
- sessionId: h.id,
2005
- baseDevSha: h.baseDevSha,
2006
- expectedRevision: h.revision,
2007
- expectedHeadSha: h.headSha
1740
+ sessionId: p.id,
1741
+ baseDevSha: p.baseDevSha,
1742
+ expectedRevision: p.revision,
1743
+ expectedHeadSha: p.headSha
2008
1744
  })
2009
1745
  })
2010
1746
  );
2011
1747
  if (!d.ok || d.reverted !== !0 || !d.operation || d.operation.kind !== "visual-revert" || !d.session)
2012
1748
  throw new Error(d.error ?? "Pygmalion could not revert the last visual change");
2013
- return x.current = null, O(d.session), d.session.appOrigin && D(d.session.appOrigin), {
1749
+ return E.current = null, O(d.session), d.session.appOrigin && F(d.session.appOrigin), {
2014
1750
  reverted: !0,
2015
1751
  operation: d.operation,
2016
1752
  session: d.session
2017
1753
  };
2018
- }, [r, h, a]);
2019
- ne(() => {
2020
- n && T(!1);
2021
- }, [n, T]), ne(() => {
2022
- n && j();
2023
- }, [n]);
2024
- 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 G = (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";
2025
1761
  return {
2026
1762
  mirror: y,
2027
- session: h,
1763
+ session: p,
2028
1764
  ready: A != null,
2029
- appOrigin: B,
2030
- previewRevision: `${_}:${(h == null ? void 0 : h.revision) ?? 0}`,
2031
- previewSourceRevision: _,
2032
- refresh: T,
2033
- switchSource: X,
2034
- sourceRefs: $,
2035
- loadSourceRefs: j,
2036
- previewVisual: G,
2037
- inspectImpact: Z,
2038
- applyVisual: Y,
2039
- revertLastVisual: E
1765
+ appOrigin: G,
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: V
2040
1776
  };
2041
1777
  }
2042
- function Cn({
1778
+ function sn({
2043
1779
  value: e,
2044
1780
  refs: t,
2045
1781
  onChange: o,
2046
- busy: n = !1,
2047
- defaultRef: r = null,
2048
- worktreeRef: i = null,
2049
- label: s = "Source revision",
2050
- children: a,
2051
- 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
2052
1788
  }) {
2053
- const g = de(
1789
+ const g = ae(
2054
1790
  () => ({
2055
1791
  local: t.filter((m) => m.kind === "local"),
2056
1792
  remote: t.filter((m) => m.kind === "remote")
2057
1793
  }),
2058
1794
  [t]
2059
- ), p = de(() => {
2060
- const m = new Set(t.map((v) => v.name));
2061
- return r && m.add(r), i && m.add(i), m;
2062
- }, [r, t, i]), b = e ?? r ?? "";
2063
- 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(
2064
1800
  "span",
2065
1801
  {
2066
- className: l,
1802
+ className: u,
2067
1803
  "data-pygmalion-source-ref": "",
2068
- "data-busy": n ? "" : void 0,
1804
+ "data-busy": r ? "" : void 0,
2069
1805
  style: { position: "relative", display: "inline-flex", alignItems: "center" },
2070
1806
  children: [
2071
- a ?? /* @__PURE__ */ w("span", { "data-pygmalion-source-ref-value": "", children: b || s }),
2072
- /* @__PURE__ */ N(
1807
+ c ?? /* @__PURE__ */ w("span", { "data-pygmalion-source-ref-value": "", children: S || a }),
1808
+ /* @__PURE__ */ C(
2073
1809
  "select",
2074
1810
  {
2075
- value: b,
2076
- disabled: n,
2077
- "aria-label": s,
1811
+ value: S,
1812
+ disabled: r,
1813
+ "aria-label": a,
2078
1814
  "data-pygmalion-source-ref-select": "",
2079
1815
  onChange: (m) => {
2080
- const v = m.target.value;
2081
- v && v !== b && o(v);
1816
+ const I = m.target.value;
1817
+ I && I !== S && o(I);
2082
1818
  },
2083
1819
  style: {
2084
1820
  position: "absolute",
@@ -2086,7 +1822,7 @@ function Cn({
2086
1822
  width: "100%",
2087
1823
  height: "100%",
2088
1824
  opacity: 0,
2089
- cursor: n ? "default" : "pointer",
1825
+ cursor: r ? "default" : "pointer",
2090
1826
  // The native menu stays reachable; only the painted trigger is the host's.
2091
1827
  appearance: "none",
2092
1828
  border: 0,
@@ -2094,17 +1830,17 @@ function Cn({
2094
1830
  margin: 0
2095
1831
  },
2096
1832
  children: [
2097
- b && !p.has(b) ? /* @__PURE__ */ w("option", { value: b, children: b }) : null,
2098
- i ? /* @__PURE__ */ N("option", { value: i, children: [
2099
- i,
1833
+ S && !h.has(S) ? /* @__PURE__ */ w("option", { value: S, children: S }) : null,
1834
+ s ? /* @__PURE__ */ C("option", { value: s, children: [
1835
+ s,
2100
1836
  " · uncommitted work"
2101
1837
  ] }) : null,
2102
- 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: [
2103
1839
  m.name,
2104
1840
  " · ",
2105
1841
  m.commit
2106
1842
  ] }, m.fullName)) }) : null,
2107
- 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: [
2108
1844
  m.name,
2109
1845
  " · ",
2110
1846
  m.commit
@@ -2116,130 +1852,152 @@ function Cn({
2116
1852
  }
2117
1853
  );
2118
1854
  }
2119
- const An = {
2120
- editor: K,
2121
- getObserverTree: Le,
2122
- isObservableProp: Je
1855
+ const an = {
1856
+ editor: q,
1857
+ getObserverTree: qe,
1858
+ isObservableProp: He
2123
1859
  };
2124
- function On(e) {
2125
- K.navigateToPageByName(e);
1860
+ function cn(e) {
1861
+ q.navigateToPageByName(e);
2126
1862
  }
2127
- function $n() {
2128
- K.openPreview();
1863
+ function ln() {
1864
+ q.openPreview();
2129
1865
  }
2130
- function Mn() {
1866
+ function dn() {
2131
1867
  const e = xe.entries.length > 0;
2132
- return e && xe.discardPending(), K.resetCurrentEdits() || e;
1868
+ return e && xe.discardPending(), q.resetCurrentEdits() || e;
2133
1869
  }
2134
- function Tn({
1870
+ function un({
2135
1871
  registry: e,
2136
1872
  tokens: t,
2137
1873
  initialPages: o,
2138
- viewportPresets: n,
2139
- designImport: r,
2140
- onTokensChange: i,
2141
- appOrigin: s,
2142
- previewRevision: a,
2143
- previewCacheNamespace: l,
1874
+ viewportPresets: r,
1875
+ designImport: n,
1876
+ onTokensChange: s,
1877
+ appOrigin: a,
1878
+ previewRevision: c,
1879
+ previewCacheNamespace: u,
2144
1880
  previewArtifacts: g,
2145
- previewArtifactEndpoint: p,
2146
- previewConcurrency: b,
1881
+ previewArtifactEndpoint: h,
1882
+ previewConcurrency: S,
2147
1883
  previewOpen: m,
2148
- onPreviewOpenChange: v,
1884
+ onPreviewOpenChange: I,
2149
1885
  flowCanvas: y,
2150
- onApply: R,
2151
- onDesignChange: h,
1886
+ onApply: N,
1887
+ onDesignChange: p,
2152
1888
  onInspectApply: O,
2153
1889
  onInspectPreview: A,
2154
- onInspectImpact: D,
2155
- storyboardDiscovery: $ = !0,
2156
- storyboardDiscoveryEndpoint: k = lt
1890
+ onInspectImpact: F,
1891
+ storyboardDiscovery: M = !0,
1892
+ storyboardDiscoveryEndpoint: T = ot
2157
1893
  }) {
2158
- const [S, x] = te(!$), [T, j] = te();
2159
- r && (r.assertComplete(), We(r));
2160
- const X = e ?? (r == null ? void 0 : r.getRegistry()), Y = t ?? (r == null ? void 0 : r.getTokens()), G = o ?? (r == null ? void 0 : r.getInitialPages());
2161
- X && Qe(X), Y && Xe(Y), n && Ye(n), ft(i ?? null), s != null && Ze(s), a != null && et(a), tt(l);
2162
- const Z = T ?? g;
2163
- return Z && G && S && nt(Z, {
2164
- namespace: l ?? "",
2165
- previewRevision: pt(),
2166
- appOrigin: ut(),
2167
- baselineEnvironment: rt(),
2168
- allowStaleIdentity: T == null && !!p,
2169
- pages: G.flatMap(
2170
- (E) => E.route && E.importPageId ? [
2171
- {
2172
- canonicalId: E.importPageId,
2173
- route: E.route,
2174
- width: E.width,
2175
- height: E.height,
2176
- environment: E.environment,
2177
- preset: E.preset,
2178
- interactions: E.interactions,
2179
- assertions: E.assertions
2180
- }
2181
- ] : []
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, V = (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
+ ), G = me([]), Q = V.map((x) => ({
1912
+ id: x.canonicalId,
1913
+ fingerprint: Xe(
1914
+ x,
1915
+ ve(),
1916
+ be()
2182
1917
  )
2183
- }), b != null && ot(b), ht(v ?? null), y != null && it(y), mt(R ?? null), gt(O ?? null), st(A ?? null), yt(D ?? null), G && K.initPagesFromComponents(G), ne(() => {
2184
- Pe(h ?? null);
2185
- const E = at(K);
1918
+ }));
1919
+ return G.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: V.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);
2186
1935
  return () => {
2187
- E(), Pe(null);
1936
+ x(), Pe(null);
2188
1937
  };
2189
- }, [h]), ne(() => {
2190
- 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()))
2191
1940
  return;
2192
- const E = new AbortController();
2193
- return Yt({
2194
- namespace: l,
2195
- sourceRevision: ct(a),
2196
- transport: Jt({
2197
- endpoint: p,
2198
- captureBaseUrl: s
2199
- }),
2200
- signal: E.signal
2201
- }).then((B) => {
2202
- !E.signal.aborted && B.status === "accepted" && j(B.artifact);
2203
- }), () => 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
+ G.current.length && $(G.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
+ };
2204
1962
  }, [
2205
- p,
2206
- l,
1963
+ h,
1964
+ u,
1965
+ c,
2207
1966
  a,
2208
- s,
2209
- S
2210
- ]), ne(() => {
2211
- let E = !0;
2212
- if (!$)
2213
- return ie(void 0), x(!0), () => {
2214
- E = !1;
1967
+ b
1968
+ ]), oe(() => {
1969
+ let x = !0;
1970
+ if (!M)
1971
+ return se(void 0), E(!0), () => {
1972
+ x = !1;
2215
1973
  };
2216
- const B = new AbortController();
2217
- return x(!1), ie(void 0), Q(null), Fe({
2218
- endpoint: k,
2219
- signal: B.signal,
2220
- pages: K.pages.map((_) => ({
2221
- ..._,
2222
- id: _.importPageId ?? _.id,
2223
- 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
2224
1982
  })),
2225
- assets: (r == null ? void 0 : r.getAssets("screens")) ?? []
2226
- }).then((_) => {
2227
- E && (ie(_.baselineEnvironment), Q(_.graph));
1983
+ assets: (n == null ? void 0 : n.getAssets("screens")) ?? []
1984
+ }).then(($) => {
1985
+ x && (se($.baselineEnvironment), Y($.graph));
2228
1986
  }).catch(() => {
2229
- E && (ie(void 0), Q(null));
1987
+ x && (se(void 0), Y(null));
2230
1988
  }).finally(() => {
2231
- E && x(!0);
1989
+ x && E(!0);
2232
1990
  }), () => {
2233
- E = !1, B.abort(), ie(void 0), Q(null);
1991
+ x = !1, j.abort(), se(void 0), Y(null);
2234
1992
  };
2235
1993
  }, [
2236
- r,
1994
+ n,
2237
1995
  o,
2238
- $,
2239
- k
2240
- ]), ne(() => {
2241
- m == null || m === K.previewOpen || (m ? K.openPreview({ notifyHost: !1 }) : K.closePreview({ notifyHost: !1 }));
2242
- }, [m]), S ? /* @__PURE__ */ w(dt, {}) : /* @__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(
2243
2001
  "div",
2244
2002
  {
2245
2003
  "data-pygmalion-storyboard-loading": "",
@@ -2258,63 +2016,63 @@ function Tn({
2258
2016
  );
2259
2017
  }
2260
2018
  export {
2261
- zn as DESIGN_IMPORT_KINDS,
2262
- In as PygmalionCatalogDocument,
2263
- Pn as PygmalionCatalogMatrix,
2264
- xn as PygmalionCatalogSection,
2265
- Tn as PygmalionEditor,
2266
- lt as STORYBOARD_ENVIRONMENT_CONTROL,
2267
- _n as STORYBOARD_ENVIRONMENT_QUERY,
2268
- Cn as SourceRefControl,
2269
- An as __debug,
2270
- Fn as applyTokenOverride,
2271
- Yt as bootstrapPreviewArtifact,
2272
- jn as clearPygmalionPreviewCache,
2273
- Nn as createDesignComponentCatalog,
2274
- on as createDesignComponentVariantMatrix,
2275
- En as createDesignGalleryCatalog,
2276
- Bn as createDesignImportController,
2277
- Un as createDesignScreenCollection,
2278
- Jt as createPreviewArtifactHttpTransport,
2279
- vn as createPreviewCacheNamespace,
2280
- Sn as createPreviewFrameFingerprint,
2281
- je as createPreviewRecipeFingerprint,
2282
- qt as createStoryboardCaptureRecipeIdentity,
2283
- vt as createStoryboardGraph,
2284
- zt as createStoryboardGraphFromDiscovery,
2285
- Hn as createStoryboardGraphViewModel,
2286
- Kn as createStoryboardRouteUrl,
2287
- tn as designCatalogKey,
2288
- Ue as designCatalogRegistryName,
2289
- Gn as expandDesignScreenCasesViewports,
2290
- Vn as expandDesignScreenCollectionViewports,
2291
- qn as getRecommendedPygmalionPreviewConcurrency,
2292
- rt as getStoryboardBaselineEnvironment,
2293
- _e as getStoryboardDiscoveryBaselineEnvironment,
2294
- Jn as getStoryboardGraph,
2295
- Ln as getViewportPresets,
2296
- Fe as loadStoryboardDiscovery,
2297
- Wn as mergeScreenPresets,
2298
- Ge as mergeStoryboardEnvironment,
2299
- bn as publishStoryboardDiscovery,
2300
- On as pygmalionNavigate,
2301
- $n as pygmalionOpenPreview,
2302
- Mn as pygmalionResetCurrentEdits,
2303
- Qn as reconstructRoutePreviewArtifactScreenshotV3,
2304
- Xn as reconstructRoutePreviewArtifactSnapshotV3,
2305
- Yn as resetTokenOverrides,
2306
- Rt as resolveStoryboardScreenCases,
2307
- Qe as setComponentRegistry,
2308
- Ze as setPygmalionAppOrigin,
2309
- ot as setPygmalionPreviewConcurrency,
2310
- et as setPygmalionPreviewRevision,
2311
- ie as setStoryboardBaselineEnvironment,
2312
- Q as setStoryboardGraph,
2313
- Xe as setTokens,
2314
- Ye as setViewportPresets,
2315
- wt as storyboardScreenRecipeKey,
2316
- Zn as subscribeStoryboardGraph,
2317
- Rn as usePygmalionProject,
2318
- Xt as validatePreviewArtifactBundle,
2319
- Ve as validateRoutePreviewArtifactV3Browser
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,
2037
+ bn as createPreviewCacheNamespace,
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
2320
2078
  };