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