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