@pygmalionjs/pygmalion 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{App-BpS2IDVb.js → App-CiSnd2mV.js} +1585 -1562
- package/dist-lib/pygmalion.js +446 -445
- package/dist-lib/testing.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +6 -0
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { b as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as A, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { b as L, m as He, v as Ke, c as qe, i as Ge, g as Le, e as H, d as Ve, a as Je, f as We, h as Qe, j as Xe, k as Ye, l as Ze, n as et, o as tt, p as nt, q as rt, r as ot, t as st, u as Y, S as it, A as at, w as ve, x as ct, y as lt, z as dt, B as ft, C as ut, D as pt, E as ht, G as Ie } from "./App-CiSnd2mV.js";
|
|
3
|
+
import { H as Mn, I as Tn, J as Dn, K as kn, L as zn, M as _n, O as Fn, P as Bn, Q as jn, R as Un, T as Hn, U as Kn, V as qn, W as Gn, X as Ln, Y as Vn, Z as Jn } from "./App-CiSnd2mV.js";
|
|
4
4
|
import { createElement as xe, useMemo as Pe, useState as te, useRef as Ee, useCallback as Z, useEffect as ee } from "react";
|
|
5
5
|
function pe(e, t = /* @__PURE__ */ new Set()) {
|
|
6
6
|
if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
|
|
@@ -18,7 +18,7 @@ function pe(e, t = /* @__PURE__ */ new Set()) {
|
|
|
18
18
|
}
|
|
19
19
|
return t.delete(e), r;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function mt(e) {
|
|
22
22
|
return JSON.stringify(
|
|
23
23
|
pe({
|
|
24
24
|
version: 1,
|
|
@@ -42,11 +42,11 @@ function ht(e) {
|
|
|
42
42
|
function z(e) {
|
|
43
43
|
return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, r) => t.localeCompare(r));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function gt(e, t) {
|
|
46
46
|
var n;
|
|
47
47
|
return ((n = e.id) == null ? void 0 : n.trim()) || `edge:${t + 1}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function yt(e) {
|
|
50
50
|
const t = [...e.screens].sort((n, o) => n.id.localeCompare(o.id)), r = t[0].id;
|
|
51
51
|
return {
|
|
52
52
|
id: `story:${r}`,
|
|
@@ -66,7 +66,7 @@ function gt(e) {
|
|
|
66
66
|
states: z(t.map((n) => n.state))
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Re(e) {
|
|
70
70
|
return [
|
|
71
71
|
e.code,
|
|
72
72
|
e.edgeId,
|
|
@@ -75,8 +75,8 @@ function Ne(e) {
|
|
|
75
75
|
e.scenarioId
|
|
76
76
|
].join(":");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
78
|
+
function wt(e) {
|
|
79
|
+
var v, g;
|
|
80
80
|
const t = [], r = [], n = /* @__PURE__ */ new Map();
|
|
81
81
|
for (const i of e.screens) {
|
|
82
82
|
const l = i.id.trim();
|
|
@@ -96,7 +96,7 @@ function yt(e) {
|
|
|
96
96
|
for (const i of r) {
|
|
97
97
|
let l;
|
|
98
98
|
try {
|
|
99
|
-
if (l = (e.recipeKey ??
|
|
99
|
+
if (l = (e.recipeKey ?? mt)(i), !l.trim()) throw new Error("Recipe keys cannot be empty.");
|
|
100
100
|
} catch (y) {
|
|
101
101
|
s.add(i.id), t.push({
|
|
102
102
|
code: "invalid-recipe",
|
|
@@ -108,7 +108,7 @@ function yt(e) {
|
|
|
108
108
|
const f = o.get(l);
|
|
109
109
|
f ? f.screens.push(i) : o.set(l, { recipeKey: l, screens: [i] });
|
|
110
110
|
}
|
|
111
|
-
const a = [...o.values()].map(
|
|
111
|
+
const a = [...o.values()].map(yt).sort((i, l) => i.id.localeCompare(l.id)), c = {};
|
|
112
112
|
for (const i of a)
|
|
113
113
|
for (const l of i.screenIds) c[l] = i.id;
|
|
114
114
|
const d = new Map(a.map((i) => [i.id, i])), h = /* @__PURE__ */ new Map();
|
|
@@ -137,11 +137,11 @@ function yt(e) {
|
|
|
137
137
|
const f = b.get(l);
|
|
138
138
|
f ? f.push(i.id) : b.set(l, [i.id]);
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
const y = i.trim(),
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
return
|
|
140
|
+
const x = (i, l, f) => {
|
|
141
|
+
const y = i.trim(), T = c[y] ?? (d.has(y) ? y : null);
|
|
142
|
+
if (T) return T;
|
|
143
|
+
const D = z(b.get(y) ?? []);
|
|
144
|
+
return D.length === 1 ? D[0] : D.length > 1 ? (t.push({
|
|
145
145
|
code: f === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
|
|
146
146
|
severity: "error",
|
|
147
147
|
message: `Storyboard edge "${l}" references an ambiguous ${f} route.`,
|
|
@@ -154,18 +154,18 @@ function yt(e) {
|
|
|
154
154
|
edgeId: l,
|
|
155
155
|
screenId: y || void 0
|
|
156
156
|
}), null);
|
|
157
|
-
},
|
|
157
|
+
}, P = [], m = /* @__PURE__ */ new Map(), E = [
|
|
158
158
|
["explicit", e.explicitEdges ?? []],
|
|
159
159
|
["inferred", e.inferredEdges ?? []]
|
|
160
160
|
];
|
|
161
161
|
let p = 0;
|
|
162
|
-
for (const [i, l] of
|
|
162
|
+
for (const [i, l] of E)
|
|
163
163
|
for (const f of l) {
|
|
164
|
-
const y =
|
|
164
|
+
const y = gt(f, p);
|
|
165
165
|
p += 1;
|
|
166
|
-
const
|
|
167
|
-
if (!
|
|
168
|
-
const
|
|
166
|
+
const T = x(f.from, y, "source"), D = x(f.to, y, "target");
|
|
167
|
+
if (!T || !D || T === D) continue;
|
|
168
|
+
const Q = `${T}\0${D}`, X = m.get(Q);
|
|
169
169
|
if (X) {
|
|
170
170
|
if (!X.sourceEdgeIds.includes(y)) {
|
|
171
171
|
const be = {
|
|
@@ -175,34 +175,34 @@ function yt(e) {
|
|
|
175
175
|
y
|
|
176
176
|
])
|
|
177
177
|
};
|
|
178
|
-
m.set(
|
|
179
|
-
const Se =
|
|
180
|
-
Se >= 0 && (
|
|
178
|
+
m.set(Q, be);
|
|
179
|
+
const Se = P.indexOf(X);
|
|
180
|
+
Se >= 0 && (P[Se] = be);
|
|
181
181
|
}
|
|
182
182
|
continue;
|
|
183
183
|
}
|
|
184
184
|
const we = {
|
|
185
185
|
id: y,
|
|
186
|
-
from:
|
|
187
|
-
to:
|
|
188
|
-
kind: ((
|
|
189
|
-
label: ((
|
|
186
|
+
from: T,
|
|
187
|
+
to: D,
|
|
188
|
+
kind: ((v = f.kind) == null ? void 0 : v.trim()) || void 0,
|
|
189
|
+
label: ((g = f.label) == null ? void 0 : g.trim()) || void 0,
|
|
190
190
|
origin: i,
|
|
191
191
|
sourceEdgeIds: [y]
|
|
192
192
|
};
|
|
193
|
-
m.set(
|
|
193
|
+
m.set(Q, we), P.push(we);
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
P.sort(
|
|
196
196
|
(i, l) => `${i.from}:${i.to}:${i.id}`.localeCompare(`${l.from}:${l.to}:${l.id}`)
|
|
197
197
|
);
|
|
198
|
-
const
|
|
199
|
-
for (const i of
|
|
200
|
-
const l =
|
|
201
|
-
l ? l.push(i) :
|
|
202
|
-
const f =
|
|
203
|
-
f ? f.push(i) :
|
|
198
|
+
const O = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
|
|
199
|
+
for (const i of P) {
|
|
200
|
+
const l = N.get(i.from);
|
|
201
|
+
l ? l.push(i) : N.set(i.from, [i]);
|
|
202
|
+
const f = O.get(i.to);
|
|
203
|
+
f ? f.push(i) : O.set(i.to, [i]);
|
|
204
204
|
}
|
|
205
|
-
const
|
|
205
|
+
const M = [];
|
|
206
206
|
for (const i of e.startScreenIds ?? []) {
|
|
207
207
|
const l = i.trim(), f = c[l] ?? (d.has(l) ? l : null);
|
|
208
208
|
if (!f) {
|
|
@@ -214,25 +214,25 @@ function yt(e) {
|
|
|
214
214
|
});
|
|
215
215
|
continue;
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
M.push(f);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
|
|
219
|
+
const $ = new Set(M);
|
|
220
|
+
let C = z(M);
|
|
221
|
+
C.length || (C = u.filter((i) => {
|
|
222
222
|
var l;
|
|
223
|
-
return (((l =
|
|
224
|
-
}).map((i) => i.id).sort((i, l) => i.localeCompare(l))), !
|
|
225
|
-
const S = /* @__PURE__ */ new Set(),
|
|
226
|
-
for (;
|
|
227
|
-
const i =
|
|
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))), !C.length && u.length && (C = [u[0].id]);
|
|
225
|
+
const S = /* @__PURE__ */ new Set(), R = [...C];
|
|
226
|
+
for (; R.length; ) {
|
|
227
|
+
const i = R.shift();
|
|
228
228
|
if (!S.has(i)) {
|
|
229
229
|
S.add(i);
|
|
230
|
-
for (const l of
|
|
230
|
+
for (const l of N.get(i) ?? []) R.push(l.to);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
const F = u.filter((i) => {
|
|
234
234
|
var f, y;
|
|
235
|
-
const l = (((f =
|
|
235
|
+
const l = (((f = O.get(i.id)) == null ? void 0 : f.length) ?? 0) === 0 && (((y = N.get(i.id)) == null ? void 0 : y.length) ?? 0) === 0 && !$.has(i.id);
|
|
236
236
|
return !S.has(i.id) || l && u.length > 1;
|
|
237
237
|
});
|
|
238
238
|
for (const i of F)
|
|
@@ -255,13 +255,13 @@ function yt(e) {
|
|
|
255
255
|
for (const y of i.screenIds) f.screenIds.add(y);
|
|
256
256
|
j.set(l, f);
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const J = [...j.entries()].map(([i, l]) => ({
|
|
259
259
|
sourceKey: i,
|
|
260
260
|
nodeIds: [...l.nodeIds].sort((f, y) => f.localeCompare(y)),
|
|
261
261
|
screenIds: [...l.screenIds].sort((f, y) => f.localeCompare(y)),
|
|
262
262
|
shared: l.nodeIds.size > 1
|
|
263
|
-
})).sort((i, l) => i.sourceKey.localeCompare(l.sourceKey)),
|
|
264
|
-
const l = [...
|
|
263
|
+
})).sort((i, l) => i.sourceKey.localeCompare(l.sourceKey)), K = u.map((i) => {
|
|
264
|
+
const l = [...N.get(i.id) ?? []].sort(
|
|
265
265
|
(f, y) => f.id.localeCompare(y.id)
|
|
266
266
|
);
|
|
267
267
|
return {
|
|
@@ -269,14 +269,14 @@ function yt(e) {
|
|
|
269
269
|
edgeIds: l.map((f) => f.id),
|
|
270
270
|
targetNodeIds: z(l.map((f) => f.to))
|
|
271
271
|
};
|
|
272
|
-
}).filter((i) => i.targetNodeIds.length > 1).sort((i, l) => i.nodeId.localeCompare(l.nodeId)),
|
|
272
|
+
}).filter((i) => i.targetNodeIds.length > 1).sort((i, l) => i.nodeId.localeCompare(l.nodeId)), q = new Set(
|
|
273
273
|
u.flatMap((i) => i.scenarioIds)
|
|
274
|
-
),
|
|
274
|
+
), I = new Set(
|
|
275
275
|
(e.nonVisualScenarioIds ?? []).map((i) => i.trim())
|
|
276
276
|
), B = z(
|
|
277
277
|
(e.scenarios ?? []).map((i) => i.id)
|
|
278
278
|
), k = B.filter(
|
|
279
|
-
(i) => !
|
|
279
|
+
(i) => !q.has(i) && !I.has(i)
|
|
280
280
|
);
|
|
281
281
|
for (const i of k)
|
|
282
282
|
t.push({
|
|
@@ -286,53 +286,53 @@ function yt(e) {
|
|
|
286
286
|
scenarioId: i
|
|
287
287
|
});
|
|
288
288
|
t.sort(
|
|
289
|
-
(i, l) =>
|
|
289
|
+
(i, l) => Re(i).localeCompare(Re(l))
|
|
290
290
|
);
|
|
291
|
-
const
|
|
291
|
+
const W = z(
|
|
292
292
|
F.flatMap((i) => i.screenIds)
|
|
293
|
-
),
|
|
293
|
+
), ne = {
|
|
294
294
|
screens: r.length,
|
|
295
295
|
canonicalNodes: u.length,
|
|
296
296
|
mergedScreens: Math.max(0, r.length - u.length),
|
|
297
|
-
edges:
|
|
297
|
+
edges: P.length,
|
|
298
298
|
connectedNodes: u.length - F.length,
|
|
299
|
-
disconnectedScreens:
|
|
299
|
+
disconnectedScreens: W,
|
|
300
300
|
codeScenarios: B.length,
|
|
301
301
|
representedScenarios: B.filter(
|
|
302
|
-
(i) =>
|
|
302
|
+
(i) => q.has(i)
|
|
303
303
|
).length,
|
|
304
304
|
missingScenarios: k,
|
|
305
|
-
complete:
|
|
305
|
+
complete: W.length === 0 && k.length === 0 && !t.some((i) => i.severity === "error") && s.size === 0
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
version: 1,
|
|
309
309
|
nodes: u,
|
|
310
|
-
edges:
|
|
310
|
+
edges: P,
|
|
311
311
|
aliases: Object.fromEntries(
|
|
312
312
|
Object.entries(c).sort(([i], [l]) => i.localeCompare(l))
|
|
313
313
|
),
|
|
314
|
-
sourceGroups:
|
|
315
|
-
startNodeIds:
|
|
316
|
-
branches:
|
|
314
|
+
sourceGroups: J,
|
|
315
|
+
startNodeIds: C,
|
|
316
|
+
branches: K,
|
|
317
317
|
warnings: t,
|
|
318
|
-
coverage:
|
|
318
|
+
coverage: ne
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function bt(e) {
|
|
322
322
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
if (Array.isArray(e)) return e.map(
|
|
324
|
+
function se(e) {
|
|
325
|
+
if (Array.isArray(e)) return e.map(se);
|
|
326
326
|
if (e && typeof e == "object") {
|
|
327
|
-
const t = Object.entries(e).filter(([, r]) => r !== void 0).sort(([r], [n]) => r.localeCompare(n)).map(([r, n]) => [r,
|
|
327
|
+
const t = Object.entries(e).filter(([, r]) => r !== void 0).sort(([r], [n]) => r.localeCompare(n)).map(([r, n]) => [r, se(n)]).filter(([, r]) => r !== void 0);
|
|
328
328
|
return t.length ? Object.fromEntries(t) : void 0;
|
|
329
329
|
}
|
|
330
330
|
return e;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return JSON.stringify(
|
|
332
|
+
function Ne(e) {
|
|
333
|
+
return JSON.stringify(se(e ?? null));
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function St(e) {
|
|
336
336
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
337
337
|
}
|
|
338
338
|
function U(e) {
|
|
@@ -363,7 +363,7 @@ function ye(e, t) {
|
|
|
363
363
|
}
|
|
364
364
|
return o === n.length;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Ce(e, t) {
|
|
367
367
|
const r = U(e);
|
|
368
368
|
if (!r) return [];
|
|
369
369
|
const n = t.get(r);
|
|
@@ -373,7 +373,7 @@ function Re(e, t) {
|
|
|
373
373
|
)
|
|
374
374
|
].sort((o, s) => o.localeCompare(s));
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function vt(e) {
|
|
377
377
|
var r;
|
|
378
378
|
const t = /* @__PURE__ */ new Map();
|
|
379
379
|
for (const n of e ?? []) {
|
|
@@ -387,29 +387,29 @@ function St(e) {
|
|
|
387
387
|
}
|
|
388
388
|
return [...t.values()].sort((n, o) => n.id.localeCompare(o.id));
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function It(e, t, r) {
|
|
391
391
|
return (e ?? []).flatMap((n, o) => {
|
|
392
|
-
var u, b,
|
|
392
|
+
var u, b, x;
|
|
393
393
|
const s = (u = n.from) == null ? void 0 : u.trim(), a = (b = n.to) == null ? void 0 : b.trim();
|
|
394
394
|
if (!s || !a || n.unresolvedTarget) return [];
|
|
395
|
-
const c = r.has(s) ? [s] :
|
|
395
|
+
const c = r.has(s) ? [s] : Ce(s, t), d = r.has(a) ? [a] : Ce(a, t);
|
|
396
396
|
if (!c.length || !d.length) return [];
|
|
397
|
-
const h = ((
|
|
397
|
+
const h = ((x = n.id) == null ? void 0 : x.trim()) || `discovery-edge:${o + 1}`;
|
|
398
398
|
return c.flatMap(
|
|
399
|
-
(
|
|
400
|
-
var
|
|
399
|
+
(P, m) => d.map((E, p) => {
|
|
400
|
+
var O, N;
|
|
401
401
|
return {
|
|
402
402
|
id: c.length === 1 && d.length === 1 ? h : `${h}:${m + 1}:${p + 1}`,
|
|
403
|
-
from:
|
|
404
|
-
to:
|
|
405
|
-
kind: ((
|
|
406
|
-
label: ((
|
|
403
|
+
from: P,
|
|
404
|
+
to: E,
|
|
405
|
+
kind: ((O = n.kind) == null ? void 0 : O.trim()) || void 0,
|
|
406
|
+
label: ((N = n.label) == null ? void 0 : N.trim()) || void 0
|
|
407
407
|
};
|
|
408
408
|
})
|
|
409
409
|
);
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function xt(e, t, r) {
|
|
413
413
|
const n = U(e.route);
|
|
414
414
|
if (!n) return [];
|
|
415
415
|
const o = t.filter(
|
|
@@ -419,10 +419,10 @@ function It(e, t, r) {
|
|
|
419
419
|
}
|
|
420
420
|
);
|
|
421
421
|
if (!o.length) return [];
|
|
422
|
-
const s =
|
|
422
|
+
const s = Ne(
|
|
423
423
|
He(r, e.environment)
|
|
424
424
|
), a = o.filter(
|
|
425
|
-
(c) =>
|
|
425
|
+
(c) => Ne(c.environment) === s
|
|
426
426
|
);
|
|
427
427
|
return [
|
|
428
428
|
...new Set(
|
|
@@ -433,7 +433,7 @@ function It(e, t, r) {
|
|
|
433
433
|
)
|
|
434
434
|
].sort((c, d) => c.localeCompare(d));
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function Pt(e, t) {
|
|
437
437
|
const r = e.some((s) => s.importKind != null), n = t.candidates ?? [], o = ze(t);
|
|
438
438
|
return e.filter(
|
|
439
439
|
(s) => r ? s.importKind === "screens" : !!s.route
|
|
@@ -455,7 +455,7 @@ function xt(e, t) {
|
|
|
455
455
|
scenario: s.scenario,
|
|
456
456
|
state: s.state,
|
|
457
457
|
scenarioId: s.scenarioId,
|
|
458
|
-
scenarioIds:
|
|
458
|
+
scenarioIds: xt(s, n, o),
|
|
459
459
|
interactions: s.interactions,
|
|
460
460
|
environment: s.environment,
|
|
461
461
|
preset: s.preset,
|
|
@@ -463,7 +463,7 @@ function xt(e, t) {
|
|
|
463
463
|
sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((a, c) => a.localeCompare(c))[0]
|
|
464
464
|
}));
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function de(e, t) {
|
|
467
467
|
var c, d, h, u;
|
|
468
468
|
const r = (((c = e.interactions) == null ? void 0 : c.length) ?? 0) - (((d = t.interactions) == null ? void 0 : d.length) ?? 0);
|
|
469
469
|
if (r !== 0) return r;
|
|
@@ -472,7 +472,7 @@ function le(e, t) {
|
|
|
472
472
|
const s = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
|
|
473
473
|
return s !== a ? s - a : e.id.localeCompare(t.id);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Et(e) {
|
|
476
476
|
const t = /* @__PURE__ */ new Map();
|
|
477
477
|
for (const r of e) {
|
|
478
478
|
const n = U(r.route);
|
|
@@ -482,14 +482,14 @@ function Pt(e) {
|
|
|
482
482
|
}
|
|
483
483
|
return new Map(
|
|
484
484
|
[...t.entries()].map(([r, n]) => {
|
|
485
|
-
const o = [...n].sort(
|
|
485
|
+
const o = [...n].sort(de);
|
|
486
486
|
return [r, o[0].id];
|
|
487
487
|
})
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Rt(e) {
|
|
491
491
|
return e.action === "wait" ? null : JSON.stringify(
|
|
492
|
-
|
|
492
|
+
se({
|
|
493
493
|
action: e.action,
|
|
494
494
|
selector: e.selector,
|
|
495
495
|
text: e.text,
|
|
@@ -504,7 +504,7 @@ function Et(e) {
|
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
506
|
function ke(e) {
|
|
507
|
-
return (e.interactions ?? []).map(
|
|
507
|
+
return (e.interactions ?? []).map(Rt).filter((t) => t != null);
|
|
508
508
|
}
|
|
509
509
|
function Nt(e, t) {
|
|
510
510
|
return e.length < t.length && e.every((r, n) => r === t[n]);
|
|
@@ -519,7 +519,7 @@ function Ct(e, t) {
|
|
|
519
519
|
}
|
|
520
520
|
return [...r.values()].flatMap((n) => {
|
|
521
521
|
if (n.length < 2) return [];
|
|
522
|
-
const o = U(n[0].route), s = t.get(o), a = n.find((c) => c.id === s) ?? [...n].sort(
|
|
522
|
+
const o = U(n[0].route), s = t.get(o), a = n.find((c) => c.id === s) ?? [...n].sort(de)[0];
|
|
523
523
|
return n.filter((c) => c.id !== a.id).sort((c, d) => c.id.localeCompare(d.id)).map((c) => ({
|
|
524
524
|
id: `discovery-variant:${encodeURIComponent(a.id)}:${encodeURIComponent(c.id)}`,
|
|
525
525
|
from: a.id,
|
|
@@ -528,7 +528,7 @@ function Ct(e, t) {
|
|
|
528
528
|
}));
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function At(e, t) {
|
|
532
532
|
const r = /* @__PURE__ */ new Map();
|
|
533
533
|
for (const n of e) {
|
|
534
534
|
const o = U(n.route);
|
|
@@ -546,19 +546,19 @@ function Rt(e, t) {
|
|
|
546
546
|
const h = s.get(d.id);
|
|
547
547
|
if (!h.length) return [];
|
|
548
548
|
const b = o.filter(
|
|
549
|
-
(
|
|
550
|
-
s.get(
|
|
549
|
+
(x) => Nt(
|
|
550
|
+
s.get(x.id),
|
|
551
551
|
h
|
|
552
552
|
)
|
|
553
|
-
).sort((
|
|
554
|
-
const m = s.get(
|
|
553
|
+
).sort((x, P) => {
|
|
554
|
+
const m = s.get(P.id).length - s.get(x.id).length;
|
|
555
555
|
if (m !== 0) return m;
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
560
|
-
const
|
|
561
|
-
return
|
|
556
|
+
const E = x.flow && x.flow === d.flow ? 0 : 1, p = P.flow && P.flow === d.flow ? 0 : 1;
|
|
557
|
+
if (E !== p) return E - p;
|
|
558
|
+
const O = x.section && x.section === d.section ? 0 : 1, N = P.section && P.section === d.section ? 0 : 1;
|
|
559
|
+
if (O !== N) return O - N;
|
|
560
|
+
const M = x.id === a ? 0 : 1, $ = P.id === a ? 0 : 1;
|
|
561
|
+
return M !== $ ? M - $ : de(x, P);
|
|
562
562
|
})[0];
|
|
563
563
|
return b ? [
|
|
564
564
|
{
|
|
@@ -578,7 +578,7 @@ function Rt(e, t) {
|
|
|
578
578
|
});
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Ot(e) {
|
|
582
582
|
var r;
|
|
583
583
|
const t = /* @__PURE__ */ new Map();
|
|
584
584
|
for (const n of e) {
|
|
@@ -597,7 +597,7 @@ function At(e) {
|
|
|
597
597
|
}
|
|
598
598
|
return s.size < 2 ? [] : [...s.values()].flatMap((a) => {
|
|
599
599
|
const c = [...a].sort(
|
|
600
|
-
|
|
600
|
+
de
|
|
601
601
|
)[0];
|
|
602
602
|
return c.id === o.id ? [] : [
|
|
603
603
|
{
|
|
@@ -610,7 +610,7 @@ function At(e) {
|
|
|
610
610
|
});
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function $t(e, t, r) {
|
|
614
614
|
const n = new Set(
|
|
615
615
|
(t.routes ?? []).map((o) => U(o.path)).filter((o) => !!o)
|
|
616
616
|
);
|
|
@@ -632,91 +632,91 @@ function Ot(e, t, r) {
|
|
|
632
632
|
} : o;
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
var h, u, b,
|
|
635
|
+
function Mt(e, t) {
|
|
636
|
+
var h, u, b, x, P;
|
|
637
637
|
const r = new Set(e.map((m) => m.id)), n = new Map(
|
|
638
|
-
e.map((m,
|
|
638
|
+
e.map((m, E) => [m.id, E])
|
|
639
639
|
), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
640
640
|
for (const m of r)
|
|
641
641
|
o.set(m, /* @__PURE__ */ new Set()), s.set(m, /* @__PURE__ */ new Set()), a.set(m, /* @__PURE__ */ new Set());
|
|
642
642
|
for (const m of t)
|
|
643
|
-
!r.has(m.from) || !r.has(m.to) || ((h = o.get(m.to)) == null || h.add(m.from), (u = s.get(m.from)) == null || u.add(m.to), (b = a.get(m.from)) == null || b.add(m.to), (
|
|
643
|
+
!r.has(m.from) || !r.has(m.to) || ((h = o.get(m.to)) == null || h.add(m.from), (u = s.get(m.from)) == null || u.add(m.to), (b = a.get(m.from)) == null || b.add(m.to), (x = a.get(m.to)) == null || x.add(m.from));
|
|
644
644
|
const c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
645
645
|
for (const m of r) {
|
|
646
646
|
if (d.has(m)) continue;
|
|
647
|
-
const
|
|
647
|
+
const E = [], p = [m];
|
|
648
648
|
for (; p.length; ) {
|
|
649
649
|
const S = p.shift();
|
|
650
650
|
if (!d.has(S)) {
|
|
651
|
-
d.add(S),
|
|
652
|
-
for (const
|
|
653
|
-
d.has(
|
|
651
|
+
d.add(S), E.push(S);
|
|
652
|
+
for (const R of a.get(S) ?? [])
|
|
653
|
+
d.has(R) || p.push(R);
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
if (
|
|
656
|
+
if (E.length === 1 && (((P = a.get(E[0])) == null ? void 0 : P.size) ?? 0) === 0)
|
|
657
657
|
continue;
|
|
658
|
-
const
|
|
659
|
-
var
|
|
660
|
-
return (((
|
|
658
|
+
const O = E.filter((S) => {
|
|
659
|
+
var R;
|
|
660
|
+
return (((R = o.get(S)) == null ? void 0 : R.size) ?? 0) === 0;
|
|
661
661
|
}).sort(
|
|
662
|
-
(S,
|
|
663
|
-
),
|
|
664
|
-
(S,
|
|
662
|
+
(S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
|
|
663
|
+
), N = [...E].sort(
|
|
664
|
+
(S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
|
|
665
665
|
)[0];
|
|
666
|
-
if (!
|
|
667
|
-
const
|
|
668
|
-
const
|
|
669
|
-
for (;
|
|
670
|
-
const F =
|
|
671
|
-
if (
|
|
672
|
-
|
|
666
|
+
if (!N) continue;
|
|
667
|
+
const M = [N], $ = /* @__PURE__ */ new Set(), C = (S) => {
|
|
668
|
+
const R = [S];
|
|
669
|
+
for (; R.length; ) {
|
|
670
|
+
const F = R.shift();
|
|
671
|
+
if (!$.has(F)) {
|
|
672
|
+
$.add(F);
|
|
673
673
|
for (const j of s.get(F) ?? [])
|
|
674
|
-
|
|
674
|
+
$.has(j) || R.push(j);
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
|
|
679
|
-
for (const S of
|
|
680
|
-
|
|
681
|
-
for (const S of
|
|
678
|
+
C(N);
|
|
679
|
+
for (const S of O)
|
|
680
|
+
$.has(S) || (M.push(S), C(S));
|
|
681
|
+
for (const S of M)
|
|
682
682
|
c.add(S);
|
|
683
683
|
}
|
|
684
684
|
return [...c].sort(
|
|
685
|
-
(m,
|
|
685
|
+
(m, E) => (n.get(m) ?? Number.MAX_SAFE_INTEGER) - (n.get(E) ?? Number.MAX_SAFE_INTEGER) || m.localeCompare(E)
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
688
|
function ze(e) {
|
|
689
689
|
var t, r;
|
|
690
|
-
return
|
|
690
|
+
return bt(
|
|
691
691
|
(r = (t = e.scenarios) == null ? void 0 : t.find(
|
|
692
692
|
(n) => n.id === "environment:baseline"
|
|
693
693
|
)) == null ? void 0 : r.environment
|
|
694
694
|
);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
const t =
|
|
696
|
+
function Tt(e) {
|
|
697
|
+
const t = Pt(
|
|
698
698
|
e.pages,
|
|
699
699
|
e.manifest
|
|
700
|
-
), r =
|
|
700
|
+
), r = Et(t), n = $t(
|
|
701
701
|
t,
|
|
702
702
|
e.manifest,
|
|
703
703
|
r
|
|
704
704
|
), s = [
|
|
705
|
-
...
|
|
705
|
+
...It(
|
|
706
706
|
e.manifest.edges,
|
|
707
707
|
r,
|
|
708
708
|
new Set(n.map((a) => a.id))
|
|
709
709
|
),
|
|
710
710
|
...Ct(n, r),
|
|
711
|
-
...
|
|
712
|
-
...
|
|
711
|
+
...At(n, r),
|
|
712
|
+
...Ot(n)
|
|
713
713
|
];
|
|
714
|
-
return
|
|
714
|
+
return wt({
|
|
715
715
|
screens: n,
|
|
716
716
|
assets: e.assets,
|
|
717
|
-
scenarios:
|
|
717
|
+
scenarios: vt(e.manifest.routes),
|
|
718
718
|
inferredEdges: s,
|
|
719
|
-
startScreenIds:
|
|
719
|
+
startScreenIds: Mt(n, s)
|
|
720
720
|
});
|
|
721
721
|
}
|
|
722
722
|
async function _e(e) {
|
|
@@ -728,39 +728,39 @@ async function _e(e) {
|
|
|
728
728
|
if (!r.ok)
|
|
729
729
|
throw new Error(`Storyboard discovery failed (${r.status})`);
|
|
730
730
|
const n = await r.json();
|
|
731
|
-
if (!
|
|
731
|
+
if (!St(n))
|
|
732
732
|
throw new Error("Storyboard discovery returned an invalid manifest.");
|
|
733
733
|
return {
|
|
734
734
|
manifest: n,
|
|
735
735
|
baselineEnvironment: ze(n),
|
|
736
|
-
graph:
|
|
736
|
+
graph: Tt({
|
|
737
737
|
manifest: n,
|
|
738
738
|
pages: e.pages,
|
|
739
739
|
assets: e.assets
|
|
740
740
|
})
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
async function
|
|
744
|
-
|
|
743
|
+
async function gn(e) {
|
|
744
|
+
L(null);
|
|
745
745
|
try {
|
|
746
746
|
const t = await _e(e);
|
|
747
|
-
return
|
|
747
|
+
return L(t.graph), t;
|
|
748
748
|
} catch (t) {
|
|
749
|
-
throw
|
|
749
|
+
throw L(null), t;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
const
|
|
752
|
+
const Dt = "pygmalion-preview", kt = "unknown", zt = 512, _t = 2048, Ft = 8 * 1024 * 1024, Bt = 128 * 1024 * 1024, jt = /* @__PURE__ */ new Set([
|
|
753
753
|
"__proto__",
|
|
754
754
|
"constructor",
|
|
755
755
|
"prototype"
|
|
756
756
|
]);
|
|
757
|
-
function
|
|
757
|
+
function V(e, t) {
|
|
758
758
|
const r = e.trim();
|
|
759
759
|
if (!r && t != null) return t;
|
|
760
|
-
if (
|
|
760
|
+
if (oe(r)) return r;
|
|
761
761
|
throw new TypeError("Preview identity must be a non-empty bounded string.");
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Ut(e) {
|
|
764
764
|
const t = e ?? 1;
|
|
765
765
|
if (!Number.isSafeInteger(t) || t < 1)
|
|
766
766
|
throw new TypeError(
|
|
@@ -787,7 +787,7 @@ function he(e, t = /* @__PURE__ */ new Set()) {
|
|
|
787
787
|
}
|
|
788
788
|
return t.delete(e), r;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Ht(e) {
|
|
791
791
|
let t = 2166136261, r = 2654435769;
|
|
792
792
|
for (let n = 0; n < e.length; n += 1) {
|
|
793
793
|
const o = e.charCodeAt(n);
|
|
@@ -795,11 +795,11 @@ function Ut(e) {
|
|
|
795
795
|
}
|
|
796
796
|
return `${(t >>> 0).toString(16).padStart(8, "0")}${(r >>> 0).toString(16).padStart(8, "0")}`;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Kt(e) {
|
|
799
799
|
if (!Array.isArray(e))
|
|
800
800
|
throw new TypeError("Preview recipes must be an array.");
|
|
801
801
|
const t = /* @__PURE__ */ new Set(), r = e.map(({ id: n, recipe: o }) => {
|
|
802
|
-
const s =
|
|
802
|
+
const s = V(n);
|
|
803
803
|
if (t.has(s))
|
|
804
804
|
throw new TypeError(`Duplicate preview recipe identity: ${s}`);
|
|
805
805
|
return t.add(s), {
|
|
@@ -807,21 +807,21 @@ function Ht(e) {
|
|
|
807
807
|
recipe: he(o)
|
|
808
808
|
};
|
|
809
809
|
});
|
|
810
|
-
return
|
|
810
|
+
return Ht(JSON.stringify(r));
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function yn({
|
|
813
813
|
sourceRevision: e,
|
|
814
814
|
recipes: t,
|
|
815
815
|
recipeVersion: r,
|
|
816
|
-
scope: n =
|
|
816
|
+
scope: n = Dt
|
|
817
817
|
}) {
|
|
818
|
-
const o =
|
|
818
|
+
const o = V(n), s = V(
|
|
819
819
|
e,
|
|
820
|
-
|
|
821
|
-
), a =
|
|
820
|
+
kt
|
|
821
|
+
), a = Ut(r), c = Kt(t);
|
|
822
822
|
return `${o}:${encodeURIComponent(s)}:recipe-v${a}:${c}`;
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function wn(e) {
|
|
825
825
|
return {
|
|
826
826
|
route: e.route,
|
|
827
827
|
path: e.path,
|
|
@@ -848,7 +848,7 @@ function yn(e) {
|
|
|
848
848
|
assertions: e.assertions
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function qt({
|
|
852
852
|
endpoint: e,
|
|
853
853
|
fetcher: t,
|
|
854
854
|
captureBaseUrl: r
|
|
@@ -877,7 +877,7 @@ function Kt({
|
|
|
877
877
|
return h.ok ? h.json().catch(() => null) : null;
|
|
878
878
|
};
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function ie(e) {
|
|
881
881
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
882
882
|
const t = Object.getPrototypeOf(e);
|
|
883
883
|
return t === Object.prototype || t === null;
|
|
@@ -885,10 +885,10 @@ function se(e) {
|
|
|
885
885
|
function Fe(e) {
|
|
886
886
|
return new TextEncoder().encode(e).byteLength;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
return typeof e == "string" && e.length > 0 && e.length <=
|
|
888
|
+
function oe(e) {
|
|
889
|
+
return typeof e == "string" && e.length > 0 && e.length <= zt && e === e.trim() && !jt.has(e);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Gt(e) {
|
|
892
892
|
const t = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
|
|
893
893
|
for (const r of e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi))
|
|
894
894
|
if (t.test(r[1] ?? "")) return !0;
|
|
@@ -898,14 +898,14 @@ function qt(e) {
|
|
|
898
898
|
if (t.test(r[1] ?? r[2] ?? r[3] ?? "")) return !0;
|
|
899
899
|
return !1;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
902
|
-
return typeof e != "string" || e.length === 0 || Fe(e) >
|
|
901
|
+
function Lt(e) {
|
|
902
|
+
return typeof e != "string" || e.length === 0 || Fe(e) > Ft ? !1 : !(/<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(e) || /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(e) || /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(e) || /\s(?:href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*|'?\s*)(?:javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(
|
|
903
903
|
e
|
|
904
|
-
) ||
|
|
904
|
+
) || Gt(e));
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Vt(e) {
|
|
907
907
|
const t = [];
|
|
908
|
-
if (!
|
|
908
|
+
if (!ie(e) || e.version !== 1)
|
|
909
909
|
return {
|
|
910
910
|
valid: !1,
|
|
911
911
|
artifact: null,
|
|
@@ -913,16 +913,16 @@ function Lt(e) {
|
|
|
913
913
|
"Preview artifact must be a version 1, version 2, or version 3 bundle."
|
|
914
914
|
]
|
|
915
915
|
};
|
|
916
|
-
if (
|
|
916
|
+
if (oe(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !oe(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !ie(e.snapshots))
|
|
917
917
|
t.push("Preview artifact snapshots must be a record.");
|
|
918
918
|
else {
|
|
919
919
|
const r = Object.entries(e.snapshots);
|
|
920
|
-
r.length >
|
|
920
|
+
r.length > _t && t.push("Preview artifact has too many frames.");
|
|
921
921
|
for (const [n, o] of r)
|
|
922
|
-
(!
|
|
922
|
+
(!oe(n) || !Lt(o)) && t.push(`Preview artifact frame "${n}" is invalid.`);
|
|
923
923
|
}
|
|
924
924
|
try {
|
|
925
|
-
Fe(JSON.stringify(e)) >
|
|
925
|
+
Fe(JSON.stringify(e)) > Bt && t.push("Preview artifact exceeds the bundle byte limit.");
|
|
926
926
|
} catch {
|
|
927
927
|
t.push("Preview artifact is not serializable.");
|
|
928
928
|
}
|
|
@@ -932,35 +932,35 @@ function Lt(e) {
|
|
|
932
932
|
errors: t
|
|
933
933
|
};
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
const r =
|
|
935
|
+
function Jt(e, t) {
|
|
936
|
+
const r = ie(e) && e.version === 3 ? (() => {
|
|
937
937
|
const n = Ke(e);
|
|
938
938
|
return {
|
|
939
939
|
valid: n.valid,
|
|
940
940
|
artifact: n.valid ? e : null,
|
|
941
941
|
errors: n.errors
|
|
942
942
|
};
|
|
943
|
-
})() :
|
|
943
|
+
})() : ie(e) && e.version === 2 ? (() => {
|
|
944
944
|
const n = qe(e);
|
|
945
945
|
return {
|
|
946
946
|
valid: n.valid,
|
|
947
947
|
artifact: n.valid ? e : null,
|
|
948
948
|
errors: n.errors
|
|
949
949
|
};
|
|
950
|
-
})() :
|
|
950
|
+
})() : Vt(e);
|
|
951
951
|
return !r.valid || !r.artifact ? {
|
|
952
952
|
valid: !1,
|
|
953
953
|
artifact: null,
|
|
954
954
|
reason: "invalid-bundle",
|
|
955
955
|
errors: r.errors
|
|
956
|
-
} : t && r.artifact.namespace !==
|
|
956
|
+
} : t && r.artifact.namespace !== V(t.namespace) ? {
|
|
957
957
|
valid: !1,
|
|
958
958
|
artifact: null,
|
|
959
959
|
reason: "namespace-mismatch",
|
|
960
960
|
errors: [
|
|
961
961
|
"Preview artifact namespace does not match the runtime namespace."
|
|
962
962
|
]
|
|
963
|
-
} : t && r.artifact.sourceRevision !==
|
|
963
|
+
} : t && r.artifact.sourceRevision !== V(t.sourceRevision) ? {
|
|
964
964
|
valid: !1,
|
|
965
965
|
artifact: null,
|
|
966
966
|
reason: "revision-mismatch",
|
|
@@ -973,15 +973,15 @@ function Vt(e, t) {
|
|
|
973
973
|
errors: []
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
|
-
async function
|
|
976
|
+
async function Wt({
|
|
977
977
|
namespace: e,
|
|
978
978
|
sourceRevision: t,
|
|
979
979
|
transport: r,
|
|
980
980
|
signal: n
|
|
981
981
|
}) {
|
|
982
982
|
const o = {
|
|
983
|
-
namespace:
|
|
984
|
-
sourceRevision:
|
|
983
|
+
namespace: V(e),
|
|
984
|
+
sourceRevision: V(t)
|
|
985
985
|
};
|
|
986
986
|
let s;
|
|
987
987
|
try {
|
|
@@ -992,7 +992,7 @@ async function Jt({
|
|
|
992
992
|
}
|
|
993
993
|
if (s == null)
|
|
994
994
|
return { status: "unavailable", artifact: null };
|
|
995
|
-
const a =
|
|
995
|
+
const a = Jt(s, o);
|
|
996
996
|
return a.valid ? { status: "accepted", artifact: a.artifact } : {
|
|
997
997
|
status: "rejected",
|
|
998
998
|
artifact: null,
|
|
@@ -1000,20 +1000,20 @@ async function Jt({
|
|
|
1000
1000
|
errors: a.errors
|
|
1001
1001
|
};
|
|
1002
1002
|
}
|
|
1003
|
-
const
|
|
1004
|
-
function
|
|
1003
|
+
const ae = "var(--pygmalion-catalog-surface, #ffffff)", ce = "var(--pygmalion-catalog-canvas, #f5f5f5)", me = "var(--pygmalion-catalog-border, #e5e7eb)", le = "var(--pygmalion-catalog-text, #202124)", _ = "var(--pygmalion-catalog-muted, #6b7280)", Qt = "var(--pygmalion-catalog-header, #11182f)", Xt = "var(--pygmalion-catalog-accent, #7c6cf2)";
|
|
1004
|
+
function bn({
|
|
1005
1005
|
title: e,
|
|
1006
1006
|
eyebrow: t,
|
|
1007
1007
|
description: r,
|
|
1008
1008
|
version: n,
|
|
1009
1009
|
meta: o,
|
|
1010
1010
|
children: s,
|
|
1011
|
-
headerBackground: a =
|
|
1011
|
+
headerBackground: a = Qt,
|
|
1012
1012
|
headerColor: c = "#ffffff",
|
|
1013
|
-
bodyBackground: d =
|
|
1013
|
+
bodyBackground: d = ae,
|
|
1014
1014
|
bodyGap: h = 40
|
|
1015
1015
|
}) {
|
|
1016
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ A(
|
|
1017
1017
|
"section",
|
|
1018
1018
|
{
|
|
1019
1019
|
"data-pygmalion-catalog-document": "",
|
|
@@ -1025,12 +1025,12 @@ function wn({
|
|
|
1025
1025
|
maxWidth: "none",
|
|
1026
1026
|
flexDirection: "column",
|
|
1027
1027
|
overflow: "visible",
|
|
1028
|
-
color:
|
|
1028
|
+
color: le,
|
|
1029
1029
|
background: d,
|
|
1030
1030
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1031
1031
|
},
|
|
1032
1032
|
children: [
|
|
1033
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ A(
|
|
1034
1034
|
"header",
|
|
1035
1035
|
{
|
|
1036
1036
|
style: {
|
|
@@ -1044,7 +1044,7 @@ function wn({
|
|
|
1044
1044
|
background: a
|
|
1045
1045
|
},
|
|
1046
1046
|
children: [
|
|
1047
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ A("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1048
1048
|
t ? /* @__PURE__ */ w(
|
|
1049
1049
|
"div",
|
|
1050
1050
|
{
|
|
@@ -1085,7 +1085,7 @@ function wn({
|
|
|
1085
1085
|
}
|
|
1086
1086
|
) : null
|
|
1087
1087
|
] }),
|
|
1088
|
-
n || o ? /* @__PURE__ */
|
|
1088
|
+
n || o ? /* @__PURE__ */ A(
|
|
1089
1089
|
"div",
|
|
1090
1090
|
{
|
|
1091
1091
|
style: {
|
|
@@ -1125,14 +1125,14 @@ function wn({
|
|
|
1125
1125
|
}
|
|
1126
1126
|
);
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function Sn({
|
|
1129
1129
|
title: e,
|
|
1130
1130
|
count: t,
|
|
1131
1131
|
description: r,
|
|
1132
1132
|
children: n,
|
|
1133
1133
|
tone: o = "tinted"
|
|
1134
1134
|
}) {
|
|
1135
|
-
return /* @__PURE__ */
|
|
1135
|
+
return /* @__PURE__ */ A(
|
|
1136
1136
|
"section",
|
|
1137
1137
|
{
|
|
1138
1138
|
"data-pygmalion-catalog-section": "",
|
|
@@ -1144,10 +1144,10 @@ function bn({
|
|
|
1144
1144
|
alignItems: "flex-start",
|
|
1145
1145
|
gap: 18,
|
|
1146
1146
|
padding: o === "tinted" ? 24 : 0,
|
|
1147
|
-
background: o === "tinted" ?
|
|
1147
|
+
background: o === "tinted" ? ce : "transparent"
|
|
1148
1148
|
},
|
|
1149
1149
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ A("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
|
|
1151
1151
|
/* @__PURE__ */ w(
|
|
1152
1152
|
"h2",
|
|
1153
1153
|
{
|
|
@@ -1168,7 +1168,7 @@ function bn({
|
|
|
1168
1168
|
}
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function vn({
|
|
1172
1172
|
rows: e,
|
|
1173
1173
|
columns: t,
|
|
1174
1174
|
cornerLabel: r,
|
|
@@ -1187,10 +1187,10 @@ function Sn({
|
|
|
1187
1187
|
display: "inline-block",
|
|
1188
1188
|
width: "max-content",
|
|
1189
1189
|
padding: a ? 16 : 0,
|
|
1190
|
-
border: a ? `1px dashed ${
|
|
1190
|
+
border: a ? `1px dashed ${Xt}` : void 0,
|
|
1191
1191
|
borderRadius: a ? 4 : void 0
|
|
1192
1192
|
},
|
|
1193
|
-
children: /* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */ A(
|
|
1194
1194
|
"table",
|
|
1195
1195
|
{
|
|
1196
1196
|
style: {
|
|
@@ -1199,7 +1199,7 @@ function Sn({
|
|
|
1199
1199
|
borderSpacing: 0
|
|
1200
1200
|
},
|
|
1201
1201
|
children: [
|
|
1202
|
-
/* @__PURE__ */ w("thead", { children: /* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ A("tr", { children: [
|
|
1203
1203
|
/* @__PURE__ */ w(
|
|
1204
1204
|
"th",
|
|
1205
1205
|
{
|
|
@@ -1230,7 +1230,7 @@ function Sn({
|
|
|
1230
1230
|
d
|
|
1231
1231
|
))
|
|
1232
1232
|
] }) }),
|
|
1233
|
-
/* @__PURE__ */ w("tbody", { children: e.map((d) => /* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ w("tbody", { children: e.map((d) => /* @__PURE__ */ A("tr", { children: [
|
|
1234
1234
|
/* @__PURE__ */ w(
|
|
1235
1235
|
"th",
|
|
1236
1236
|
{
|
|
@@ -1265,11 +1265,11 @@ function Sn({
|
|
|
1265
1265
|
}
|
|
1266
1266
|
);
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Yt(e) {
|
|
1269
1269
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1270
1270
|
}
|
|
1271
1271
|
function Be(e, t, r = "PygmalionCatalog") {
|
|
1272
|
-
const n = (o) =>
|
|
1272
|
+
const n = (o) => Yt(o).replace(/-/g, "_");
|
|
1273
1273
|
return `${r}_${n(e)}_${n(t)}`;
|
|
1274
1274
|
}
|
|
1275
1275
|
function je(e, t) {
|
|
@@ -1291,17 +1291,17 @@ function Ue(e) {
|
|
|
1291
1291
|
t.add(r.id);
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Zt(e, t, r) {
|
|
1295
1295
|
return typeof e == "function" ? e(t, r) : e;
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function en({
|
|
1298
1298
|
page: e,
|
|
1299
1299
|
items: t,
|
|
1300
1300
|
renderPreview: r,
|
|
1301
1301
|
secondaryLabel: n,
|
|
1302
1302
|
minimumColumnWidth: o
|
|
1303
1303
|
}) {
|
|
1304
|
-
return /* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ A(
|
|
1305
1305
|
"section",
|
|
1306
1306
|
{
|
|
1307
1307
|
"data-pygmalion-catalog-page": e.id,
|
|
@@ -1311,14 +1311,14 @@ function Zt({
|
|
|
1311
1311
|
display: "inline-block",
|
|
1312
1312
|
width: "max-content",
|
|
1313
1313
|
padding: 32,
|
|
1314
|
-
color:
|
|
1315
|
-
background:
|
|
1314
|
+
color: le,
|
|
1315
|
+
background: ce,
|
|
1316
1316
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1317
1317
|
},
|
|
1318
1318
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ A("header", { style: { marginBottom: 24 }, children: [
|
|
1320
1320
|
/* @__PURE__ */ w("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
|
|
1321
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ A("p", { style: { margin: "6px 0 0", color: _, fontSize: 13 }, children: [
|
|
1322
1322
|
t.length,
|
|
1323
1323
|
" assets"
|
|
1324
1324
|
] })
|
|
@@ -1331,7 +1331,7 @@ function Zt({
|
|
|
1331
1331
|
gridTemplateColumns: "repeat(6, max-content)",
|
|
1332
1332
|
gap: 16
|
|
1333
1333
|
},
|
|
1334
|
-
children: t.map((s) => /* @__PURE__ */
|
|
1334
|
+
children: t.map((s) => /* @__PURE__ */ A(
|
|
1335
1335
|
"article",
|
|
1336
1336
|
{
|
|
1337
1337
|
"data-pygmalion-catalog-item": s.id,
|
|
@@ -1341,7 +1341,7 @@ function Zt({
|
|
|
1341
1341
|
padding: 16,
|
|
1342
1342
|
border: `1px solid ${me}`,
|
|
1343
1343
|
borderRadius: 12,
|
|
1344
|
-
background:
|
|
1344
|
+
background: ae
|
|
1345
1345
|
},
|
|
1346
1346
|
children: [
|
|
1347
1347
|
/* @__PURE__ */ w(
|
|
@@ -1398,7 +1398,7 @@ function Zt({
|
|
|
1398
1398
|
}
|
|
1399
1399
|
);
|
|
1400
1400
|
}
|
|
1401
|
-
function
|
|
1401
|
+
function In(e) {
|
|
1402
1402
|
Ue(e.items);
|
|
1403
1403
|
const t = /* @__PURE__ */ new Map();
|
|
1404
1404
|
for (const o of e.items) {
|
|
@@ -1422,7 +1422,7 @@ function vn(e) {
|
|
|
1422
1422
|
const r = {}, n = [];
|
|
1423
1423
|
for (const o of t.values()) {
|
|
1424
1424
|
const s = () => /* @__PURE__ */ w(
|
|
1425
|
-
|
|
1425
|
+
en,
|
|
1426
1426
|
{
|
|
1427
1427
|
page: o.page,
|
|
1428
1428
|
items: o.items,
|
|
@@ -1435,7 +1435,7 @@ function vn(e) {
|
|
|
1435
1435
|
component: s,
|
|
1436
1436
|
children: "none"
|
|
1437
1437
|
};
|
|
1438
|
-
const a =
|
|
1438
|
+
const a = Zt(e.frame, o.page, o.items);
|
|
1439
1439
|
n.push({
|
|
1440
1440
|
...o.page,
|
|
1441
1441
|
componentName: o.registryName,
|
|
@@ -1453,7 +1453,7 @@ function vn(e) {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function tn(e, t = 60) {
|
|
1457
1457
|
const r = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, d], [h, u]) => u.length - d.length || c.localeCompare(h)), n = r[0], o = r[1], s = Math.max(1, (n == null ? void 0 : n[1].length) ?? 1), a = o == null ? void 0 : o[1].slice(0, Math.max(1, Math.floor(t / s)));
|
|
1458
1458
|
return {
|
|
1459
1459
|
row: n,
|
|
@@ -1462,7 +1462,7 @@ function en(e, t = 60) {
|
|
|
1462
1462
|
additional: r.slice(2)
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function nn(e, t, r, n) {
|
|
1466
1466
|
return {
|
|
1467
1467
|
...e.defaultProps,
|
|
1468
1468
|
...Object.fromEntries(t.fixed),
|
|
@@ -1470,14 +1470,14 @@ function tn(e, t, r, n) {
|
|
|
1470
1470
|
...t.column && n ? { [t.column[0]]: n } : {}
|
|
1471
1471
|
};
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function rn({
|
|
1474
1474
|
item: e,
|
|
1475
1475
|
entry: t,
|
|
1476
1476
|
maxVariantCells: r
|
|
1477
1477
|
}) {
|
|
1478
1478
|
var c, d;
|
|
1479
1479
|
if (!t)
|
|
1480
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ A(
|
|
1481
1481
|
"section",
|
|
1482
1482
|
{
|
|
1483
1483
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1487,8 +1487,8 @@ function nn({
|
|
|
1487
1487
|
display: "inline-block",
|
|
1488
1488
|
width: "max-content",
|
|
1489
1489
|
padding: 32,
|
|
1490
|
-
color:
|
|
1491
|
-
background:
|
|
1490
|
+
color: le,
|
|
1491
|
+
background: ce
|
|
1492
1492
|
},
|
|
1493
1493
|
children: [
|
|
1494
1494
|
/* @__PURE__ */ w("strong", { children: e.name }),
|
|
@@ -1496,8 +1496,8 @@ function nn({
|
|
|
1496
1496
|
]
|
|
1497
1497
|
}
|
|
1498
1498
|
);
|
|
1499
|
-
const n =
|
|
1500
|
-
return /* @__PURE__ */
|
|
1499
|
+
const n = tn(t, r), o = ((c = n.row) == null ? void 0 : c[1]) ?? [void 0], s = ((d = n.column) == null ? void 0 : d[1]) ?? [void 0], a = t.component;
|
|
1500
|
+
return /* @__PURE__ */ A(
|
|
1501
1501
|
"section",
|
|
1502
1502
|
{
|
|
1503
1503
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1507,12 +1507,12 @@ function nn({
|
|
|
1507
1507
|
display: "inline-block",
|
|
1508
1508
|
width: "max-content",
|
|
1509
1509
|
padding: 32,
|
|
1510
|
-
color:
|
|
1511
|
-
background:
|
|
1510
|
+
color: le,
|
|
1511
|
+
background: ce,
|
|
1512
1512
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1513
1513
|
},
|
|
1514
1514
|
children: [
|
|
1515
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ A("header", { style: { marginBottom: 24 }, children: [
|
|
1516
1516
|
/* @__PURE__ */ w("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
|
|
1517
1517
|
e.sourcePath ? /* @__PURE__ */ w("p", { style: { margin: "6px 0 0", color: _, fontSize: 12 }, children: e.sourcePath }) : null
|
|
1518
1518
|
] }),
|
|
@@ -1526,11 +1526,11 @@ function nn({
|
|
|
1526
1526
|
},
|
|
1527
1527
|
children: o.flatMap(
|
|
1528
1528
|
(h) => s.map((u) => {
|
|
1529
|
-
const b =
|
|
1529
|
+
const b = nn(t, n, h, u), x = [
|
|
1530
1530
|
n.row && h ? `${n.row[0]}=${h}` : "",
|
|
1531
1531
|
n.column && u ? `${n.column[0]}=${u}` : ""
|
|
1532
1532
|
].filter(Boolean).join(" · ");
|
|
1533
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ A(
|
|
1534
1534
|
"article",
|
|
1535
1535
|
{
|
|
1536
1536
|
style: {
|
|
@@ -1538,10 +1538,10 @@ function nn({
|
|
|
1538
1538
|
padding: 16,
|
|
1539
1539
|
border: `1px solid ${me}`,
|
|
1540
1540
|
borderRadius: 10,
|
|
1541
|
-
background:
|
|
1541
|
+
background: ae
|
|
1542
1542
|
},
|
|
1543
1543
|
children: [
|
|
1544
|
-
|
|
1544
|
+
x ? /* @__PURE__ */ w("div", { style: { marginBottom: 12, color: _, fontSize: 11 }, children: x }) : null,
|
|
1545
1545
|
/* @__PURE__ */ w("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: xe(
|
|
1546
1546
|
a,
|
|
1547
1547
|
b,
|
|
@@ -1555,16 +1555,16 @@ function nn({
|
|
|
1555
1555
|
)
|
|
1556
1556
|
}
|
|
1557
1557
|
),
|
|
1558
|
-
n.additional.map(([h, u]) => /* @__PURE__ */
|
|
1558
|
+
n.additional.map(([h, u]) => /* @__PURE__ */ A("section", { style: { marginTop: 20 }, children: [
|
|
1559
1559
|
/* @__PURE__ */ w("h2", { style: { margin: "0 0 10px", color: _, fontSize: 12 }, children: h }),
|
|
1560
|
-
/* @__PURE__ */ w("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: u.map((b) => /* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: u.map((b) => /* @__PURE__ */ A(
|
|
1561
1561
|
"article",
|
|
1562
1562
|
{
|
|
1563
1563
|
style: {
|
|
1564
1564
|
padding: 16,
|
|
1565
1565
|
border: `1px solid ${me}`,
|
|
1566
1566
|
borderRadius: 10,
|
|
1567
|
-
background:
|
|
1567
|
+
background: ae
|
|
1568
1568
|
},
|
|
1569
1569
|
children: [
|
|
1570
1570
|
/* @__PURE__ */ w("div", { style: { marginBottom: 12, color: _, fontSize: 11 }, children: b }),
|
|
@@ -1582,7 +1582,7 @@ function nn({
|
|
|
1582
1582
|
}
|
|
1583
1583
|
);
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function xn(e) {
|
|
1586
1586
|
Ue(e.items);
|
|
1587
1587
|
const t = {}, r = [], n = [], o = e.maxVariantCells ?? 60;
|
|
1588
1588
|
for (const s of e.items) {
|
|
@@ -1591,7 +1591,7 @@ function In(e) {
|
|
|
1591
1591
|
s.id,
|
|
1592
1592
|
e.registryPrefix
|
|
1593
1593
|
), c = e.registry[s.name], d = () => /* @__PURE__ */ w(
|
|
1594
|
-
|
|
1594
|
+
rn,
|
|
1595
1595
|
{
|
|
1596
1596
|
item: s,
|
|
1597
1597
|
entry: c,
|
|
@@ -1619,9 +1619,9 @@ function In(e) {
|
|
|
1619
1619
|
}
|
|
1620
1620
|
};
|
|
1621
1621
|
}
|
|
1622
|
-
const Ae = /^[a-f0-9]{64}$/,
|
|
1622
|
+
const Ae = /^[a-f0-9]{64}$/, on = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, sn = /^p\d+$/;
|
|
1623
1623
|
function ge(e) {
|
|
1624
|
-
return typeof e == "string" &&
|
|
1624
|
+
return typeof e == "string" && on.test(e) ? e : void 0;
|
|
1625
1625
|
}
|
|
1626
1626
|
function Oe(e, t) {
|
|
1627
1627
|
const r = new URL(e, t);
|
|
@@ -1641,7 +1641,7 @@ function $e(e) {
|
|
|
1641
1641
|
const t = e;
|
|
1642
1642
|
return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function an(e) {
|
|
1645
1645
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1646
1646
|
const t = e, r = $e(t.before), n = $e(t.after);
|
|
1647
1647
|
if (!r || !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)
|
|
@@ -1658,7 +1658,7 @@ function sn(e) {
|
|
|
1658
1658
|
heatmapUrl: o
|
|
1659
1659
|
};
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function cn(e, t) {
|
|
1662
1662
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1663
1663
|
const r = e;
|
|
1664
1664
|
if (typeof r.id != "string" || !r.id) return null;
|
|
@@ -1666,7 +1666,7 @@ function an(e, t) {
|
|
|
1666
1666
|
if (!o) return null;
|
|
1667
1667
|
const s = fe(r.after);
|
|
1668
1668
|
if (t === "changed" && !s) return null;
|
|
1669
|
-
const a = s ?
|
|
1669
|
+
const a = s ? an(r.pixelDiff) : null;
|
|
1670
1670
|
return {
|
|
1671
1671
|
id: r.id,
|
|
1672
1672
|
before: o,
|
|
@@ -1678,7 +1678,7 @@ function an(e, t) {
|
|
|
1678
1678
|
...a ? { pixelDiff: a } : {}
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function ln(e, t = []) {
|
|
1682
1682
|
const r = new Set(t), n = r.size > 0, o = /* @__PURE__ */ new Set(), s = [
|
|
1683
1683
|
...e.styles.map((a) => a.affectedFrames ?? []),
|
|
1684
1684
|
...e.texts.map((a) => a.affectedFrames ?? []),
|
|
@@ -1686,7 +1686,7 @@ function cn(e, t = []) {
|
|
|
1686
1686
|
];
|
|
1687
1687
|
for (const a of s)
|
|
1688
1688
|
for (const c of a) {
|
|
1689
|
-
if (n &&
|
|
1689
|
+
if (n && sn.test(c.id) && !r.has(c.id))
|
|
1690
1690
|
throw new Error(
|
|
1691
1691
|
`"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
|
|
1692
1692
|
);
|
|
@@ -1706,7 +1706,7 @@ async function Me(e, t, r) {
|
|
|
1706
1706
|
);
|
|
1707
1707
|
if (typeof o.baselineId != "string" || !o.baselineId)
|
|
1708
1708
|
throw new Error("Pygmalion visual QA response has no baselineId");
|
|
1709
|
-
const s = Array.isArray(o.frames) ? o.frames.map((u) =>
|
|
1709
|
+
const s = Array.isArray(o.frames) ? o.frames.map((u) => cn(u, r.phase)).filter((u) => u != null) : [], a = Array.isArray(o.failures) ? o.failures.map((u) => {
|
|
1710
1710
|
if (!u || typeof u != "object" || Array.isArray(u)) return null;
|
|
1711
1711
|
const b = u;
|
|
1712
1712
|
return typeof b.id == "string" && typeof b.error == "string" ? { id: b.id, error: b.error } : null;
|
|
@@ -1723,46 +1723,46 @@ const ue = {
|
|
|
1723
1723
|
mirror: "/__pygmalion-dev-control",
|
|
1724
1724
|
sessions: "/__pygmalion-design-session",
|
|
1725
1725
|
inspect: "/__pygmalion-inspect"
|
|
1726
|
-
},
|
|
1726
|
+
}, dn = "pygmalion.designSessionId", fn = "/__pygmalion-qa", re = /* @__PURE__ */ new Map();
|
|
1727
1727
|
function Te() {
|
|
1728
1728
|
var e;
|
|
1729
1729
|
return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1731
|
+
function un(e, t) {
|
|
1732
1732
|
if (e) return e;
|
|
1733
|
-
const r =
|
|
1733
|
+
const r = re.get(t);
|
|
1734
1734
|
if (r) return r;
|
|
1735
1735
|
try {
|
|
1736
1736
|
const n = window.localStorage.getItem(t);
|
|
1737
1737
|
if (n)
|
|
1738
|
-
return
|
|
1738
|
+
return re.set(t, n), n;
|
|
1739
1739
|
const o = Te();
|
|
1740
|
-
return window.localStorage.setItem(t, o),
|
|
1740
|
+
return window.localStorage.setItem(t, o), re.set(t, o), o;
|
|
1741
1741
|
} catch {
|
|
1742
1742
|
const n = Te();
|
|
1743
|
-
return
|
|
1743
|
+
return re.set(t, n), n;
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
|
-
async function
|
|
1746
|
+
async function G(e) {
|
|
1747
1747
|
const t = await e.json();
|
|
1748
1748
|
if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
|
|
1749
1749
|
return t;
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1752
|
-
var
|
|
1751
|
+
function Pn(e = {}) {
|
|
1752
|
+
var I, B, k, W, ne;
|
|
1753
1753
|
const {
|
|
1754
1754
|
sessionId: t,
|
|
1755
|
-
sessionStorageKey: r =
|
|
1755
|
+
sessionStorageKey: r = dn,
|
|
1756
1756
|
autoStart: n = !0,
|
|
1757
1757
|
fetcher: o = fetch,
|
|
1758
1758
|
formatApplyMessage: s
|
|
1759
|
-
} = e, a = ((
|
|
1759
|
+
} = e, a = ((I = e.endpoints) == null ? void 0 : I.mirror) ?? ue.mirror, c = ((B = e.endpoints) == null ? void 0 : B.sessions) ?? ue.sessions, d = ((k = e.endpoints) == null ? void 0 : k.inspect) ?? ue.inspect, h = e.visualQa != null, u = ((W = e.visualQa) == null ? void 0 : W.endpoint) ?? fn, b = JSON.stringify(((ne = e.visualQa) == null ? void 0 : ne.eligibleFrameIds) ?? []), x = Pe(
|
|
1760
1760
|
() => JSON.parse(b),
|
|
1761
1761
|
[b]
|
|
1762
|
-
),
|
|
1763
|
-
() =>
|
|
1762
|
+
), P = Pe(
|
|
1763
|
+
() => un(t, r),
|
|
1764
1764
|
[t, r]
|
|
1765
|
-
), [m,
|
|
1765
|
+
), [m, E] = te({
|
|
1766
1766
|
state: "idle",
|
|
1767
1767
|
commit: null,
|
|
1768
1768
|
shortCommit: null,
|
|
@@ -1771,67 +1771,67 @@ function xn(e = {}) {
|
|
|
1771
1771
|
warning: null,
|
|
1772
1772
|
error: null,
|
|
1773
1773
|
appOrigin: null
|
|
1774
|
-
}), [p,
|
|
1774
|
+
}), [p, O] = te(null), [N, M] = te(null), $ = Ee(null), C = Ee(null), S = Z(
|
|
1775
1775
|
async (v = !0) => {
|
|
1776
|
-
if (
|
|
1776
|
+
if ($.current) return $.current;
|
|
1777
1777
|
const g = (async () => {
|
|
1778
|
-
|
|
1778
|
+
E((i) => ({ ...i, state: "syncing", error: null }));
|
|
1779
1779
|
try {
|
|
1780
|
-
let
|
|
1780
|
+
let i = await o(`${a}/${v ? "refresh" : "status"}`, {
|
|
1781
1781
|
method: v ? "POST" : "GET"
|
|
1782
|
-
}),
|
|
1783
|
-
const
|
|
1784
|
-
for (; !v &&
|
|
1785
|
-
await new Promise((D) => window.setTimeout(D, 500)),
|
|
1786
|
-
if (
|
|
1787
|
-
throw new Error(
|
|
1788
|
-
const
|
|
1782
|
+
}), l = await G(i);
|
|
1783
|
+
const f = Date.now();
|
|
1784
|
+
for (; !v && l.state === "syncing" && Date.now() - f < 12e4; )
|
|
1785
|
+
await new Promise((D) => window.setTimeout(D, 500)), i = await o(`${a}/status`), l = await G(i);
|
|
1786
|
+
if (l.state !== "ready" || !l.appOrigin || !l.commit)
|
|
1787
|
+
throw new Error(l.error ?? "Pygmalion could not prepare the source preview");
|
|
1788
|
+
const y = await G(
|
|
1789
1789
|
await o(`${c}/open`, {
|
|
1790
1790
|
method: "POST",
|
|
1791
1791
|
headers: { "content-type": "application/json" },
|
|
1792
|
-
body: JSON.stringify({ sessionId:
|
|
1792
|
+
body: JSON.stringify({ sessionId: P, baseDevSha: l.commit })
|
|
1793
1793
|
})
|
|
1794
1794
|
);
|
|
1795
|
-
if (!
|
|
1796
|
-
throw new Error(
|
|
1797
|
-
let
|
|
1798
|
-
if (
|
|
1799
|
-
const D = await
|
|
1795
|
+
if (!y.ok || !y.session)
|
|
1796
|
+
throw new Error(y.error ?? "Pygmalion could not open the design session");
|
|
1797
|
+
let T = y.session;
|
|
1798
|
+
if (T.branchName) {
|
|
1799
|
+
const D = await G(
|
|
1800
1800
|
await o(`${c}/check`, {
|
|
1801
1801
|
method: "POST",
|
|
1802
1802
|
headers: { "content-type": "application/json" },
|
|
1803
|
-
body: JSON.stringify({ sessionId:
|
|
1803
|
+
body: JSON.stringify({ sessionId: T.id })
|
|
1804
1804
|
})
|
|
1805
1805
|
);
|
|
1806
1806
|
if (!D.ok || !D.session)
|
|
1807
1807
|
throw new Error(D.error ?? "Pygmalion could not check the design session");
|
|
1808
|
-
|
|
1808
|
+
T = D.session;
|
|
1809
1809
|
}
|
|
1810
|
-
|
|
1811
|
-
} catch (
|
|
1812
|
-
|
|
1813
|
-
...
|
|
1810
|
+
E(l), O(T), M(T.appOrigin ?? l.appOrigin);
|
|
1811
|
+
} catch (i) {
|
|
1812
|
+
E((l) => ({
|
|
1813
|
+
...l,
|
|
1814
1814
|
state: "error",
|
|
1815
|
-
error:
|
|
1815
|
+
error: i instanceof Error ? i.message : String(i)
|
|
1816
1816
|
}));
|
|
1817
1817
|
}
|
|
1818
1818
|
})();
|
|
1819
|
-
|
|
1819
|
+
$.current = g;
|
|
1820
1820
|
try {
|
|
1821
1821
|
await g;
|
|
1822
1822
|
} finally {
|
|
1823
|
-
|
|
1823
|
+
$.current === g && ($.current = null);
|
|
1824
1824
|
}
|
|
1825
1825
|
},
|
|
1826
|
-
[o, a, c,
|
|
1827
|
-
),
|
|
1826
|
+
[o, a, c, P]
|
|
1827
|
+
), R = Z(
|
|
1828
1828
|
async (v) => {
|
|
1829
|
-
var
|
|
1829
|
+
var y;
|
|
1830
1830
|
if (!p) throw new Error("Pygmalion design session is not ready");
|
|
1831
|
-
const g =
|
|
1831
|
+
const g = C.current;
|
|
1832
1832
|
if (g && (g.sessionId !== p.id || g.baseDevSha !== p.baseDevSha || g.revision !== p.revision || g.fingerprint !== JSON.stringify(v)))
|
|
1833
1833
|
throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
|
|
1834
|
-
const
|
|
1834
|
+
const i = await G(
|
|
1835
1835
|
await o(`${c}/apply-visual`, {
|
|
1836
1836
|
method: "POST",
|
|
1837
1837
|
headers: { "content-type": "application/json" },
|
|
@@ -1844,44 +1844,44 @@ function xn(e = {}) {
|
|
|
1844
1844
|
})
|
|
1845
1845
|
})
|
|
1846
1846
|
);
|
|
1847
|
-
if (!
|
|
1848
|
-
throw new Error(
|
|
1849
|
-
|
|
1850
|
-
const
|
|
1851
|
-
let
|
|
1852
|
-
if (g != null && g.qaBaselineId && ((
|
|
1847
|
+
if (!i.ok || !i.session)
|
|
1848
|
+
throw new Error(i.error ?? "Pygmalion could not apply the visual changes");
|
|
1849
|
+
O(i.session), i.session.appOrigin && M(i.session.appOrigin);
|
|
1850
|
+
const l = i.applied ?? v.styles.length + v.texts.length + v.operations.length;
|
|
1851
|
+
let f;
|
|
1852
|
+
if (g != null && g.qaBaselineId && ((y = g.qaFrameIds) != null && y.length) && i.session.appOrigin)
|
|
1853
1853
|
try {
|
|
1854
|
-
|
|
1854
|
+
f = await Me(o, u, {
|
|
1855
1855
|
phase: "changed",
|
|
1856
1856
|
baselineId: g.qaBaselineId,
|
|
1857
|
-
basePath: Oe(
|
|
1857
|
+
basePath: Oe(i.session.appOrigin, window.location.origin),
|
|
1858
1858
|
frameIds: g.qaFrameIds
|
|
1859
1859
|
});
|
|
1860
|
-
} catch (
|
|
1861
|
-
const D =
|
|
1862
|
-
|
|
1860
|
+
} catch (T) {
|
|
1861
|
+
const D = T instanceof Error ? T.message : String(T);
|
|
1862
|
+
f = {
|
|
1863
1863
|
phase: "changed",
|
|
1864
1864
|
baselineId: g.qaBaselineId,
|
|
1865
1865
|
complete: !1,
|
|
1866
1866
|
frames: [],
|
|
1867
|
-
failures: g.qaFrameIds.map((
|
|
1867
|
+
failures: g.qaFrameIds.map((Q) => ({ id: Q, error: D }))
|
|
1868
1868
|
};
|
|
1869
1869
|
}
|
|
1870
|
-
return
|
|
1871
|
-
applied:
|
|
1872
|
-
branch:
|
|
1873
|
-
integration:
|
|
1874
|
-
message: s == null ? void 0 : s(
|
|
1875
|
-
...
|
|
1870
|
+
return C.current = null, {
|
|
1871
|
+
applied: l,
|
|
1872
|
+
branch: i.session.branchName ?? void 0,
|
|
1873
|
+
integration: i.session.integration.state,
|
|
1874
|
+
message: s == null ? void 0 : s(i.session, l),
|
|
1875
|
+
...f ? { qa: f } : {}
|
|
1876
1876
|
};
|
|
1877
1877
|
},
|
|
1878
1878
|
[o, s, u, p, c]
|
|
1879
1879
|
), F = Z(
|
|
1880
1880
|
async (v) => {
|
|
1881
|
-
var
|
|
1881
|
+
var y;
|
|
1882
1882
|
if (!p) throw new Error("Pygmalion design session is not ready");
|
|
1883
|
-
|
|
1884
|
-
const g = await
|
|
1883
|
+
C.current = null;
|
|
1884
|
+
const g = await G(
|
|
1885
1885
|
await o(`${c}/preview-visual`, {
|
|
1886
1886
|
method: "POST",
|
|
1887
1887
|
headers: { "content-type": "application/json" },
|
|
@@ -1895,38 +1895,38 @@ function xn(e = {}) {
|
|
|
1895
1895
|
);
|
|
1896
1896
|
if (!g.ok || !Number.isSafeInteger(g.revision))
|
|
1897
1897
|
throw new Error(g.error ?? "Pygmalion could not preview the visual changes");
|
|
1898
|
-
const
|
|
1899
|
-
let
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
if (!
|
|
1898
|
+
const i = h ? ln(v, x) : [];
|
|
1899
|
+
let l;
|
|
1900
|
+
const f = p.appOrigin ?? m.appOrigin;
|
|
1901
|
+
if (i.length > 0) {
|
|
1902
|
+
if (!f)
|
|
1903
1903
|
throw new Error("Impact screen QA baseline preview not ready");
|
|
1904
|
-
if (
|
|
1904
|
+
if (l = await Me(o, u, {
|
|
1905
1905
|
phase: "baseline",
|
|
1906
|
-
basePath: Oe(
|
|
1907
|
-
frameIds:
|
|
1908
|
-
}), !
|
|
1906
|
+
basePath: Oe(f, window.location.origin),
|
|
1907
|
+
frameIds: i
|
|
1908
|
+
}), !l.complete)
|
|
1909
1909
|
throw new Error(
|
|
1910
|
-
((
|
|
1910
|
+
((y = l.failures[0]) == null ? void 0 : y.error) ?? `Failed to capture ${i.length - l.frames.length} affected frames`
|
|
1911
1911
|
);
|
|
1912
1912
|
}
|
|
1913
|
-
return
|
|
1913
|
+
return C.current = {
|
|
1914
1914
|
sessionId: p.id,
|
|
1915
1915
|
baseDevSha: p.baseDevSha,
|
|
1916
1916
|
revision: g.revision,
|
|
1917
1917
|
fingerprint: JSON.stringify(v),
|
|
1918
|
-
...
|
|
1918
|
+
...l ? { qaBaselineId: l.baselineId, qaFrameIds: i } : {}
|
|
1919
1919
|
}, {
|
|
1920
1920
|
revision: g.revision,
|
|
1921
1921
|
files: Array.isArray(g.files) ? g.files : [],
|
|
1922
1922
|
affectedFiles: Array.isArray(g.affectedFiles) ? g.affectedFiles : [],
|
|
1923
|
-
...
|
|
1923
|
+
...l ? { qa: l } : {}
|
|
1924
1924
|
};
|
|
1925
1925
|
},
|
|
1926
1926
|
[
|
|
1927
1927
|
o,
|
|
1928
1928
|
m.appOrigin,
|
|
1929
|
-
|
|
1929
|
+
x,
|
|
1930
1930
|
u,
|
|
1931
1931
|
p,
|
|
1932
1932
|
c,
|
|
@@ -1935,7 +1935,7 @@ function xn(e = {}) {
|
|
|
1935
1935
|
), j = Z(
|
|
1936
1936
|
async (v) => {
|
|
1937
1937
|
if (v.length === 0) return { files: [] };
|
|
1938
|
-
const g = await
|
|
1938
|
+
const g = await G(
|
|
1939
1939
|
await o(`${d}/impact`, {
|
|
1940
1940
|
method: "POST",
|
|
1941
1941
|
headers: { "content-type": "application/json" },
|
|
@@ -1947,10 +1947,10 @@ function xn(e = {}) {
|
|
|
1947
1947
|
return { files: Array.isArray(g.files) ? g.files : [] };
|
|
1948
1948
|
},
|
|
1949
1949
|
[o, d]
|
|
1950
|
-
),
|
|
1950
|
+
), J = Z(async () => {
|
|
1951
1951
|
if (!(p != null && p.canRevert) || !p.headSha)
|
|
1952
1952
|
throw new Error("There are no reversible changes applied");
|
|
1953
|
-
const v = await
|
|
1953
|
+
const v = await G(
|
|
1954
1954
|
await o(`${c}/revert-visual`, {
|
|
1955
1955
|
method: "POST",
|
|
1956
1956
|
headers: { "content-type": "application/json" },
|
|
@@ -1964,7 +1964,7 @@ function xn(e = {}) {
|
|
|
1964
1964
|
);
|
|
1965
1965
|
if (!v.ok || v.reverted !== !0 || !v.operation || v.operation.kind !== "visual-revert" || !v.session)
|
|
1966
1966
|
throw new Error(v.error ?? "Pygmalion could not revert the last visual change");
|
|
1967
|
-
return
|
|
1967
|
+
return C.current = null, O(v.session), v.session.appOrigin && M(v.session.appOrigin), {
|
|
1968
1968
|
reverted: !0,
|
|
1969
1969
|
operation: v.operation,
|
|
1970
1970
|
session: v.session
|
|
@@ -1973,36 +1973,37 @@ function xn(e = {}) {
|
|
|
1973
1973
|
ee(() => {
|
|
1974
1974
|
n && S(!1);
|
|
1975
1975
|
}, [n, S]);
|
|
1976
|
-
const
|
|
1976
|
+
const K = (p == null ? void 0 : p.appOrigin) ?? m.appOrigin ?? N, q = (p == null ? void 0 : p.headSha) ?? (p == null ? void 0 : p.baseDevSha) ?? m.commit ?? "pending";
|
|
1977
1977
|
return {
|
|
1978
1978
|
mirror: m,
|
|
1979
1979
|
session: p,
|
|
1980
|
-
ready:
|
|
1981
|
-
appOrigin:
|
|
1982
|
-
previewRevision: `${
|
|
1980
|
+
ready: N != null,
|
|
1981
|
+
appOrigin: K,
|
|
1982
|
+
previewRevision: `${q}:${(p == null ? void 0 : p.revision) ?? 0}`,
|
|
1983
|
+
previewSourceRevision: q,
|
|
1983
1984
|
refresh: S,
|
|
1984
1985
|
previewVisual: F,
|
|
1985
1986
|
inspectImpact: j,
|
|
1986
|
-
applyVisual:
|
|
1987
|
-
revertLastVisual:
|
|
1987
|
+
applyVisual: R,
|
|
1988
|
+
revertLastVisual: J
|
|
1988
1989
|
};
|
|
1989
1990
|
}
|
|
1990
|
-
const
|
|
1991
|
-
editor:
|
|
1991
|
+
const En = {
|
|
1992
|
+
editor: H,
|
|
1992
1993
|
getObserverTree: Le,
|
|
1993
1994
|
isObservableProp: Ge
|
|
1994
1995
|
};
|
|
1995
|
-
function
|
|
1996
|
-
|
|
1996
|
+
function Rn(e) {
|
|
1997
|
+
H.navigateToPageByName(e);
|
|
1997
1998
|
}
|
|
1998
1999
|
function Nn() {
|
|
1999
|
-
|
|
2000
|
+
H.openPreview();
|
|
2000
2001
|
}
|
|
2001
2002
|
function Cn() {
|
|
2002
2003
|
const e = ve.entries.length > 0;
|
|
2003
|
-
return e && ve.discardPending(),
|
|
2004
|
+
return e && ve.discardPending(), H.resetCurrentEdits() || e;
|
|
2004
2005
|
}
|
|
2005
|
-
function
|
|
2006
|
+
function An({
|
|
2006
2007
|
registry: e,
|
|
2007
2008
|
tokens: t,
|
|
2008
2009
|
initialPages: r,
|
|
@@ -2015,101 +2016,101 @@ function Rn({
|
|
|
2015
2016
|
previewArtifactEndpoint: h,
|
|
2016
2017
|
previewConcurrency: u,
|
|
2017
2018
|
previewOpen: b,
|
|
2018
|
-
onPreviewOpenChange:
|
|
2019
|
-
flowCanvas:
|
|
2019
|
+
onPreviewOpenChange: x,
|
|
2020
|
+
flowCanvas: P,
|
|
2020
2021
|
onApply: m,
|
|
2021
|
-
onDesignChange:
|
|
2022
|
+
onDesignChange: E,
|
|
2022
2023
|
onInspectApply: p,
|
|
2023
|
-
onInspectPreview:
|
|
2024
|
-
onInspectImpact:
|
|
2025
|
-
storyboardDiscovery:
|
|
2026
|
-
storyboardDiscoveryEndpoint:
|
|
2024
|
+
onInspectPreview: O,
|
|
2025
|
+
onInspectImpact: N,
|
|
2026
|
+
storyboardDiscovery: M = !0,
|
|
2027
|
+
storyboardDiscoveryEndpoint: $ = it
|
|
2027
2028
|
}) {
|
|
2028
|
-
const [
|
|
2029
|
+
const [C, S] = te(!M), [R, F] = te();
|
|
2029
2030
|
n && (n.assertComplete(), Ve(n));
|
|
2030
|
-
const j = e ?? (n == null ? void 0 : n.getRegistry()),
|
|
2031
|
-
j && Je(j),
|
|
2032
|
-
const
|
|
2033
|
-
return
|
|
2031
|
+
const j = e ?? (n == null ? void 0 : n.getRegistry()), J = t ?? (n == null ? void 0 : n.getTokens()), K = r ?? (n == null ? void 0 : n.getInitialPages());
|
|
2032
|
+
j && Je(j), J && We(J), ct(o ?? null), s != null && Qe(s), a != null && Xe(a), Ye(c);
|
|
2033
|
+
const q = R ?? d;
|
|
2034
|
+
return q && K && C && Ze(q, {
|
|
2034
2035
|
namespace: c ?? "",
|
|
2035
|
-
previewRevision:
|
|
2036
|
-
appOrigin:
|
|
2036
|
+
previewRevision: dt(),
|
|
2037
|
+
appOrigin: lt(),
|
|
2037
2038
|
baselineEnvironment: et(),
|
|
2038
|
-
allowStaleIdentity:
|
|
2039
|
-
pages:
|
|
2040
|
-
(
|
|
2039
|
+
allowStaleIdentity: R == null && !!h,
|
|
2040
|
+
pages: K.flatMap(
|
|
2041
|
+
(I) => I.route && I.importPageId ? [
|
|
2041
2042
|
{
|
|
2042
|
-
canonicalId:
|
|
2043
|
-
route:
|
|
2044
|
-
width:
|
|
2045
|
-
height:
|
|
2046
|
-
environment:
|
|
2047
|
-
preset:
|
|
2048
|
-
interactions:
|
|
2049
|
-
assertions:
|
|
2043
|
+
canonicalId: I.importPageId,
|
|
2044
|
+
route: I.route,
|
|
2045
|
+
width: I.width,
|
|
2046
|
+
height: I.height,
|
|
2047
|
+
environment: I.environment,
|
|
2048
|
+
preset: I.preset,
|
|
2049
|
+
interactions: I.interactions,
|
|
2050
|
+
assertions: I.assertions
|
|
2050
2051
|
}
|
|
2051
2052
|
] : []
|
|
2052
2053
|
)
|
|
2053
|
-
}), u != null && tt(u),
|
|
2054
|
-
Ie(
|
|
2055
|
-
const
|
|
2054
|
+
}), u != null && tt(u), ft(x ?? null), P != null && nt(P), ut(m ?? null), pt(p ?? null), rt(O ?? null), ht(N ?? null), K && H.initPagesFromComponents(K), ee(() => {
|
|
2055
|
+
Ie(E ?? null);
|
|
2056
|
+
const I = ot(H);
|
|
2056
2057
|
return () => {
|
|
2057
|
-
|
|
2058
|
+
I(), Ie(null);
|
|
2058
2059
|
};
|
|
2059
|
-
}, [
|
|
2060
|
-
if (F(void 0), !
|
|
2060
|
+
}, [E]), ee(() => {
|
|
2061
|
+
if (F(void 0), !C || !h || !(c != null && c.trim()) || !(a != null && a.trim()))
|
|
2061
2062
|
return;
|
|
2062
|
-
const
|
|
2063
|
-
return
|
|
2063
|
+
const I = new AbortController();
|
|
2064
|
+
return Wt({
|
|
2064
2065
|
namespace: c,
|
|
2065
|
-
sourceRevision: a,
|
|
2066
|
-
transport:
|
|
2066
|
+
sourceRevision: st(a),
|
|
2067
|
+
transport: qt({
|
|
2067
2068
|
endpoint: h,
|
|
2068
2069
|
captureBaseUrl: s
|
|
2069
2070
|
}),
|
|
2070
|
-
signal:
|
|
2071
|
+
signal: I.signal
|
|
2071
2072
|
}).then((B) => {
|
|
2072
|
-
!
|
|
2073
|
-
}), () =>
|
|
2073
|
+
!I.signal.aborted && B.status === "accepted" && F(B.artifact);
|
|
2074
|
+
}), () => I.abort();
|
|
2074
2075
|
}, [
|
|
2075
2076
|
h,
|
|
2076
2077
|
c,
|
|
2077
2078
|
a,
|
|
2078
2079
|
s,
|
|
2079
|
-
|
|
2080
|
+
C
|
|
2080
2081
|
]), ee(() => {
|
|
2081
|
-
let
|
|
2082
|
-
if (!
|
|
2082
|
+
let I = !0;
|
|
2083
|
+
if (!M)
|
|
2083
2084
|
return Y(void 0), S(!0), () => {
|
|
2084
|
-
|
|
2085
|
+
I = !1;
|
|
2085
2086
|
};
|
|
2086
2087
|
const B = new AbortController();
|
|
2087
|
-
return S(!1), Y(void 0),
|
|
2088
|
-
endpoint:
|
|
2088
|
+
return S(!1), Y(void 0), L(null), _e({
|
|
2089
|
+
endpoint: $,
|
|
2089
2090
|
signal: B.signal,
|
|
2090
|
-
pages:
|
|
2091
|
+
pages: H.pages.map((k) => ({
|
|
2091
2092
|
...k,
|
|
2092
2093
|
id: k.importPageId ?? k.id,
|
|
2093
2094
|
importKind: k.importKind
|
|
2094
2095
|
})),
|
|
2095
2096
|
assets: (n == null ? void 0 : n.getAssets("screens")) ?? []
|
|
2096
2097
|
}).then((k) => {
|
|
2097
|
-
|
|
2098
|
+
I && (Y(k.baselineEnvironment), L(k.graph));
|
|
2098
2099
|
}).catch(() => {
|
|
2099
|
-
|
|
2100
|
+
I && (Y(void 0), L(null));
|
|
2100
2101
|
}).finally(() => {
|
|
2101
|
-
|
|
2102
|
+
I && S(!0);
|
|
2102
2103
|
}), () => {
|
|
2103
|
-
|
|
2104
|
+
I = !1, B.abort(), Y(void 0), L(null);
|
|
2104
2105
|
};
|
|
2105
2106
|
}, [
|
|
2106
2107
|
n,
|
|
2107
2108
|
r,
|
|
2108
|
-
|
|
2109
|
-
|
|
2109
|
+
M,
|
|
2110
|
+
$
|
|
2110
2111
|
]), ee(() => {
|
|
2111
|
-
b == null || b ===
|
|
2112
|
-
}, [b]),
|
|
2112
|
+
b == null || b === H.previewOpen || (b ? H.openPreview({ notifyHost: !1 }) : H.closePreview({ notifyHost: !1 }));
|
|
2113
|
+
}, [b]), C ? /* @__PURE__ */ w(at, {}) : /* @__PURE__ */ w(
|
|
2113
2114
|
"div",
|
|
2114
2115
|
{
|
|
2115
2116
|
"data-pygmalion-storyboard-loading": "",
|
|
@@ -2128,59 +2129,59 @@ function Rn({
|
|
|
2128
2129
|
);
|
|
2129
2130
|
}
|
|
2130
2131
|
export {
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2132
|
+
Mn as DESIGN_IMPORT_KINDS,
|
|
2133
|
+
bn as PygmalionCatalogDocument,
|
|
2134
|
+
vn as PygmalionCatalogMatrix,
|
|
2135
|
+
Sn as PygmalionCatalogSection,
|
|
2136
|
+
An as PygmalionEditor,
|
|
2137
|
+
it as STORYBOARD_ENVIRONMENT_CONTROL,
|
|
2138
|
+
Tn as STORYBOARD_ENVIRONMENT_QUERY,
|
|
2139
|
+
En as __debug,
|
|
2140
|
+
Dn as applyTokenOverride,
|
|
2141
|
+
Wt as bootstrapPreviewArtifact,
|
|
2142
|
+
kn as clearPygmalionPreviewCache,
|
|
2143
|
+
xn as createDesignComponentCatalog,
|
|
2144
|
+
tn as createDesignComponentVariantMatrix,
|
|
2145
|
+
In as createDesignGalleryCatalog,
|
|
2146
|
+
zn as createDesignImportController,
|
|
2147
|
+
_n as createDesignScreenCollection,
|
|
2148
|
+
qt as createPreviewArtifactHttpTransport,
|
|
2149
|
+
yn as createPreviewCacheNamespace,
|
|
2150
|
+
Kt as createPreviewRecipeFingerprint,
|
|
2151
|
+
wn as createStoryboardCaptureRecipeIdentity,
|
|
2152
|
+
wt as createStoryboardGraph,
|
|
2153
|
+
Tt as createStoryboardGraphFromDiscovery,
|
|
2154
|
+
Fn as createStoryboardGraphViewModel,
|
|
2155
|
+
Bn as createStoryboardRouteUrl,
|
|
2156
|
+
Yt as designCatalogKey,
|
|
2156
2157
|
Be as designCatalogRegistryName,
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2158
|
+
jn as expandDesignScreenCasesViewports,
|
|
2159
|
+
Un as expandDesignScreenCollectionViewports,
|
|
2160
|
+
Hn as getRecommendedPygmalionPreviewConcurrency,
|
|
2160
2161
|
et as getStoryboardBaselineEnvironment,
|
|
2161
2162
|
ze as getStoryboardDiscoveryBaselineEnvironment,
|
|
2162
|
-
|
|
2163
|
+
Kn as getStoryboardGraph,
|
|
2163
2164
|
_e as loadStoryboardDiscovery,
|
|
2164
|
-
|
|
2165
|
+
qn as mergeScreenPresets,
|
|
2165
2166
|
He as mergeStoryboardEnvironment,
|
|
2166
|
-
|
|
2167
|
-
|
|
2167
|
+
gn as publishStoryboardDiscovery,
|
|
2168
|
+
Rn as pygmalionNavigate,
|
|
2168
2169
|
Nn as pygmalionOpenPreview,
|
|
2169
2170
|
Cn as pygmalionResetCurrentEdits,
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2171
|
+
Gn as reconstructRoutePreviewArtifactScreenshotV3,
|
|
2172
|
+
Ln as reconstructRoutePreviewArtifactSnapshotV3,
|
|
2173
|
+
Vn as resetTokenOverrides,
|
|
2174
|
+
Pt as resolveStoryboardScreenCases,
|
|
2174
2175
|
Je as setComponentRegistry,
|
|
2175
2176
|
Qe as setPygmalionAppOrigin,
|
|
2176
2177
|
tt as setPygmalionPreviewConcurrency,
|
|
2177
2178
|
Xe as setPygmalionPreviewRevision,
|
|
2178
2179
|
Y as setStoryboardBaselineEnvironment,
|
|
2179
|
-
|
|
2180
|
+
L as setStoryboardGraph,
|
|
2180
2181
|
We as setTokens,
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2182
|
+
mt as storyboardScreenRecipeKey,
|
|
2183
|
+
Jn as subscribeStoryboardGraph,
|
|
2184
|
+
Pn as usePygmalionProject,
|
|
2185
|
+
Jt as validatePreviewArtifactBundle,
|
|
2185
2186
|
Ke as validateRoutePreviewArtifactV3Browser
|
|
2186
2187
|
};
|