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