@brucesantos/design-space 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,190 +1,237 @@
1
- import { jsxs as c, jsx as a, Fragment as M } from "react/jsx-runtime";
2
- import { useState as x, useEffect as E, useMemo as y, useCallback as C, useContext as ae, createContext as ne, forwardRef as re, useRef as se } from "react";
3
- import { v as oe, P as f, N as Y, s as ie, c as de, g as ce } from "./contrast-BXd_acxo.js";
4
- import { C as lt, S as ut, a as ht, b as mt, d as pt, e as bt, f as ft, h as vt, i as gt, j as wt, p as Nt, r as kt, k as _t, l as yt, m as St } from "./contrast-BXd_acxo.js";
5
- function le(e) {
6
- const t = new Map(e.scenarios.map((u) => [u.id, u])), n = new Map(e.personas.map((u) => [u.id, u])), s = new Map(e.fixtures.map((u) => [u.id, u])), r = new Map((e.rules ?? []).map((u) => [u.id, u])), o = new Map(e.modules.map((u) => [u.id, u])), d = new Map(
7
- e.modules.flatMap((u) => (u.flows ?? []).map((h) => [h.id, h]))
8
- ), l = e.modules.map((u) => ({
9
- module: u,
10
- scenarios: e.scenarios.filter((h) => h.id.split(".")[0] === u.id)
11
- })), m = new Set(l.flatMap((u) => u.scenarios.map((h) => h.id))), i = e.scenarios.filter((u) => !m.has(u.id)), p = (u) => u ? t.get(u) : void 0, g = (u) => u ? n.get(u) : void 0, v = (u) => u ? u.permissions ? u.permissions : g(u.persona)?.permissions ?? [] : [];
1
+ import { jsxs as d, jsx as o, Fragment as P } from "react/jsx-runtime";
2
+ import { useState as F, useEffect as B, useMemo as T, useCallback as I, useContext as se, createContext as ie, useRef as q, forwardRef as ce } from "react";
3
+ import { S as de, v as le, P as v, N as oe, s as ue, c as he, g as pe } from "./contrast-B8I8gWGa.js";
4
+ import { C as _t, a as Ct, b as Tt, d as Pt, e as At, f as Lt, h as Et, i as Ft, j as $t, k as Dt, p as Rt, r as Ot, l as It, m as Bt, n as Wt } from "./contrast-B8I8gWGa.js";
5
+ function me(e) {
6
+ const t = new Map(e.scenarios.map((l) => [l.id, l])), n = new Map(
7
+ (e.components ?? []).map((l) => [l.id, l])
8
+ ), r = new Map(e.personas.map((l) => [l.id, l])), i = new Map(e.fixtures.map((l) => [l.id, l])), a = new Map((e.rules ?? []).map((l) => [l.id, l])), s = new Map(e.modules.map((l) => [l.id, l])), c = new Map(
9
+ e.modules.flatMap((l) => (l.flows ?? []).map((g) => [g.id, g]))
10
+ ), p = e.modules.map((l) => ({
11
+ module: l,
12
+ scenarios: e.scenarios.filter((g) => g.id.split(".")[0] === l.id)
13
+ })), h = new Set(p.flatMap((l) => l.scenarios.map((g) => g.id))), m = e.scenarios.filter((l) => !h.has(l.id)), b = (l) => l ? t.get(l) : void 0, u = (l) => l ? r.get(l) : void 0, S = (l, g) => {
14
+ if (!(!l || !g))
15
+ return n.get(l)?.fixtures?.find((k) => k.id === g);
16
+ }, w = (l = {}) => e.scenarios.filter(
17
+ (g) => l.includePorted || g.status !== "ported" || g.id === l.activeScenario
18
+ ), C = (l) => l ? l.permissions ? l.permissions : u(l.persona)?.permissions ?? [] : [];
12
19
  return {
13
20
  product: e,
14
- tree: l,
15
- orphans: i,
16
- issues: oe(e),
17
- scenario: p,
18
- persona: g,
19
- fixture: (u) => u ? s.get(u) : void 0,
20
- rule: (u) => u ? r.get(u) : void 0,
21
- module: (u) => u ? o.get(u) : void 0,
22
- flow: (u) => u ? d.get(u) : void 0,
23
- rulesOf: (u) => (u?.rules ?? []).map((h) => r.get(h)).filter((h) => !!h),
24
- permissionsOf: v,
25
- scenariosForRoute: (u) => {
26
- const h = u.split("?")[0];
27
- return e.scenarios.filter((b) => b.route.split("?")[0] === h);
21
+ tree: p,
22
+ orphans: m,
23
+ issues: le(e),
24
+ scenario: b,
25
+ component: (l) => l ? n.get(l) : void 0,
26
+ componentFixture: S,
27
+ resolveComponentFixture: (l, g) => {
28
+ const k = l ? n.get(l) : void 0, M = S(l, g), _ = S(l, k?.defaultFixture) ?? k?.fixtures?.[0];
29
+ return {
30
+ fixture: M ?? _,
31
+ requestedId: g,
32
+ didFallback: !!(g && !M)
33
+ };
34
+ },
35
+ persona: u,
36
+ fixture: (l) => l ? i.get(l) : void 0,
37
+ rule: (l) => l ? a.get(l) : void 0,
38
+ module: (l) => l ? s.get(l) : void 0,
39
+ flow: (l) => l ? c.get(l) : void 0,
40
+ rulesOf: (l) => (l?.rules ?? []).map((g) => a.get(g)).filter((g) => !!g),
41
+ permissionsOf: C,
42
+ scenariosForRoute: (l, g) => {
43
+ const k = l.split("?")[0];
44
+ return w(g).filter((M) => M.route.split("?")[0] === k);
45
+ },
46
+ activeScenarios: w,
47
+ treeFor: (l) => {
48
+ const g = new Set(w(l).map((k) => k.id));
49
+ return p.map((k) => ({
50
+ ...k,
51
+ scenarios: k.scenarios.filter((M) => g.has(M.id))
52
+ }));
28
53
  },
29
- search: (u) => {
30
- const h = z(u);
31
- return h ? e.scenarios.filter((b) => {
32
- const w = o.get(b.id.split(".")[0] ?? "")?.name ?? "";
33
- return z(
54
+ orphansFor: (l) => {
55
+ const g = new Set(w(l).map((k) => k.id));
56
+ return m.filter((k) => g.has(k.id));
57
+ },
58
+ search: (l, g) => {
59
+ const k = Q(l), M = w(g);
60
+ return k ? M.filter((_) => {
61
+ const $ = s.get(_.id.split(".")[0] ?? "")?.name ?? "";
62
+ return Q(
34
63
  [
35
- b.title,
36
- b.id,
37
- b.intent ?? "",
38
- b.route,
39
- w,
40
- n.get(b.persona)?.name ?? "",
41
- (b.tags ?? []).join(" "),
42
- (b.expected ?? []).join(" ")
64
+ _.title,
65
+ _.id,
66
+ _.intent ?? "",
67
+ _.route,
68
+ $,
69
+ r.get(_.persona)?.name ?? "",
70
+ (_.tags ?? []).join(" "),
71
+ (_.expected ?? []).join(" ")
43
72
  ].join(" ")
44
- ).includes(h);
45
- }) : e.scenarios;
73
+ ).includes(k);
74
+ }) : M;
46
75
  },
47
- byStatus: (u) => e.scenarios.filter((h) => h.status === u),
48
- coverage: () => {
49
- const u = {
50
- proposed: 0,
51
- "in-review": 0,
52
- approved: 0,
53
- "in-implementation": 0,
54
- implemented: 0,
55
- superseded: 0
56
- };
57
- for (const h of e.scenarios) u[h.status] += 1;
58
- return u;
76
+ byStatus: (l) => e.scenarios.filter((g) => g.status === l),
77
+ coverage: (l) => {
78
+ const g = Object.fromEntries(
79
+ de.map((k) => [k, 0])
80
+ );
81
+ for (const k of w(l)) g[k.status] += 1;
82
+ return g;
59
83
  }
60
84
  };
61
85
  }
62
- function z(e) {
86
+ function Q(e) {
63
87
  return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
64
88
  }
65
- const G = [
89
+ const ne = [
66
90
  { id: "fit", label: "Ajustar" },
67
91
  { id: "mobile", label: "Celular", width: 390, height: 844 },
68
92
  { id: "tablet", label: "Tablet", width: 834, height: 1112 },
69
93
  { id: "desktop", label: "Desktop", width: 1440, height: 900 },
70
94
  { id: "custom", label: "Personalizado" }
71
- ], Q = [1, 1.25, 1.5, 2];
72
- function ue(e, t) {
73
- const n = new URLSearchParams(e), s = n.get(f.scenario) ?? void 0, r = t.scenario(s), o = n.get(f.network), d = Number(n.get(f.textScale));
95
+ ], fe = [1, 1.25, 1.5, 2];
96
+ function be(e, t) {
97
+ const n = new URLSearchParams(e), r = n.get(v.component) ?? void 0, i = t.component(r), a = n.get(v.scenario) ?? void 0, s = i ? void 0 : t.scenario(a), c = n.get(v.fixture) ?? void 0, p = i ? c ?? t.componentFixture(i.id, i.defaultFixture)?.id ?? i.fixtures?.[0]?.id : void 0, h = n.get(v.network), m = Number(n.get(v.textScale));
74
98
  return {
75
- scenario: r?.id,
76
- persona: n.get(f.persona) ?? r?.persona,
77
- fixture: n.get(f.fixture) ?? r?.fixture,
78
- network: pe(o) ? o : r?.network ?? "success",
79
- viewport: n.get(f.viewport) ?? "fit",
80
- customWidth: be(n.get(f.customWidth)),
81
- themeMode: n.get(f.themeMode) ?? t.product.theme?.modes?.[0],
82
- locale: n.get(f.locale) ?? t.product.theme?.locales?.[0],
83
- dataSource: n.get(f.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
99
+ scenario: s?.id,
100
+ showPorted: n.get(v.showPorted) === "1",
101
+ component: i?.id,
102
+ persona: n.get(v.persona) ?? s?.persona,
103
+ fixture: i ? p : c ?? s?.fixture,
104
+ network: we(h) ? h : s?.network ?? "success",
105
+ viewport: n.get(v.viewport) ?? "fit",
106
+ customWidth: Ne(n.get(v.customWidth)),
107
+ themeMode: n.get(v.themeMode) ?? t.product.theme?.modes?.[0],
108
+ locale: n.get(v.locale) ?? t.product.theme?.locales?.[0],
109
+ dataSource: n.get(v.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
110
+ chromeTheme: ke(n.get(v.chromeTheme)) ? n.get(v.chromeTheme) : "dark",
84
111
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
85
112
  // de tela, então precisa ser explícito para não sumir sem pedido.
86
- chrome: n.get(f.chrome) !== "0",
87
- keyboardMode: n.get(f.keyboardMode) === "1",
88
- reducedMotion: n.get(f.reducedMotion) === "1",
89
- textScale: Q.includes(d) ? d : 1,
90
- inspector: n.get(f.inspector) !== "0"
113
+ chrome: n.get(v.chrome) !== "0",
114
+ keyboardMode: n.get(v.keyboardMode) === "1",
115
+ reducedMotion: n.get(v.reducedMotion) === "1",
116
+ textScale: fe.includes(m) ? m : 1,
117
+ inspector: n.get(v.inspector) !== "0"
91
118
  };
92
119
  }
93
- function U(e, t) {
94
- const n = new URLSearchParams(), s = t.scenario(e.scenario);
95
- e.scenario && n.set(f.scenario, e.scenario), e.persona && e.persona !== s?.persona && n.set(f.persona, e.persona), e.fixture && e.fixture !== s?.fixture && n.set(f.fixture, e.fixture), e.network !== (s?.network ?? "success") && n.set(f.network, e.network), e.viewport !== "fit" && n.set(f.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(f.customWidth, String(e.customWidth));
96
- const r = t.product.theme?.modes?.[0];
97
- e.themeMode && e.themeMode !== r && n.set(f.themeMode, e.themeMode);
98
- const o = t.product.theme?.locales?.[0];
99
- e.locale && e.locale !== o && n.set(f.locale, e.locale);
100
- const d = t.product.dataSources?.default ?? "fixtures";
101
- e.dataSource && e.dataSource !== d && n.set(f.dataSource, e.dataSource), e.chrome || n.set(f.chrome, "0"), e.keyboardMode && n.set(f.keyboardMode, "1"), e.reducedMotion && n.set(f.reducedMotion, "1"), e.textScale !== 1 && n.set(f.textScale, String(e.textScale)), e.inspector || n.set(f.inspector, "0");
102
- const l = n.toString();
103
- return l ? `?${l}` : "";
120
+ function G(e, t) {
121
+ const n = new URLSearchParams(), r = t.scenario(e.scenario);
122
+ e.component ? n.set(v.component, e.component) : e.scenario && n.set(v.scenario, e.scenario), e.showPorted && n.set(v.showPorted, "1"), e.persona && e.persona !== r?.persona && n.set(v.persona, e.persona), e.component && e.fixture ? n.set(v.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && n.set(v.fixture, e.fixture), e.network !== (r?.network ?? "success") && n.set(v.network, e.network), e.viewport !== "fit" && n.set(v.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(v.customWidth, String(e.customWidth));
123
+ const i = t.product.theme?.modes?.[0];
124
+ e.themeMode && e.themeMode !== i && n.set(v.themeMode, e.themeMode);
125
+ const a = t.product.theme?.locales?.[0];
126
+ e.locale && e.locale !== a && n.set(v.locale, e.locale);
127
+ const s = t.product.dataSources?.default ?? "fixtures";
128
+ e.dataSource && e.dataSource !== s && n.set(v.dataSource, e.dataSource), e.chromeTheme === "light" && n.set(v.chromeTheme, "light"), e.chrome || n.set(v.chrome, "0"), e.keyboardMode && n.set(v.keyboardMode, "1"), e.reducedMotion && n.set(v.reducedMotion, "1"), e.textScale !== 1 && n.set(v.textScale, String(e.textScale)), e.inspector || n.set(v.inspector, "0");
129
+ const c = n.toString();
130
+ return c ? `?${c}` : "";
104
131
  }
105
- function he(e) {
106
- const [t, n] = x(() => K());
107
- E(() => {
108
- const i = () => n(K());
109
- return window.addEventListener("popstate", i), () => window.removeEventListener("popstate", i);
132
+ function ge(e) {
133
+ const [t, n] = F(() => X());
134
+ B(() => {
135
+ const m = () => n(X());
136
+ return window.addEventListener("popstate", m), () => window.removeEventListener("popstate", m);
110
137
  }, []);
111
- const s = y(() => ue(t.search, e), [t.search, e]), r = C((i, p, g = !1) => {
112
- const v = `${i}${p}`;
113
- g ? window.history.replaceState(null, "", v) : window.history.pushState(null, "", v), n({ path: i, search: p });
114
- }, []), o = C(
115
- (i) => {
116
- const p = { ...s, ...i };
117
- r(t.path, U(p, e), !0);
138
+ const r = T(() => be(t.search, e), [t.search, e]), i = I((m, b, u = !1) => {
139
+ const S = `${m}${b}`;
140
+ u ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), n({ path: m, search: b });
141
+ }, []), a = I(
142
+ (m) => {
143
+ const b = { ...r, ...m };
144
+ i(t.path, G(b, e), !0);
145
+ },
146
+ [r, t.path, i, e]
147
+ ), s = I(
148
+ (m, b) => {
149
+ const [u, S] = m.split("?"), w = u || "/", C = S ? `?${S}` : t.search;
150
+ i(w, C, b?.replace ?? !1);
118
151
  },
119
- [s, t.path, r, e]
120
- ), d = C(
121
- (i, p) => {
122
- const [g, v] = i.split("?"), u = g || "/", h = v ? `?${v}` : t.search;
123
- r(u, h, p?.replace ?? !1);
152
+ [t.search, i]
153
+ ), c = I(
154
+ (m) => {
155
+ const b = e.scenario(m);
156
+ if (!b) return;
157
+ const u = {
158
+ ...r,
159
+ scenario: b.id,
160
+ showPorted: r.showPorted,
161
+ component: void 0,
162
+ persona: b.persona,
163
+ fixture: b.fixture,
164
+ network: b.network ?? "success"
165
+ };
166
+ i(b.route, G(u, e), !1);
124
167
  },
125
- [t.search, r]
126
- ), l = C(
127
- (i) => {
128
- const p = e.scenario(i);
129
- if (!p) return;
130
- const g = {
131
- ...s,
132
- scenario: p.id,
133
- persona: p.persona,
134
- fixture: p.fixture,
135
- network: p.network ?? "success"
168
+ [r, i, e]
169
+ ), p = I(
170
+ (m) => {
171
+ const b = e.component(m);
172
+ if (!b) return;
173
+ const u = {
174
+ ...r,
175
+ scenario: void 0,
176
+ component: b.id,
177
+ persona: void 0,
178
+ fixture: void 0,
179
+ network: "success"
136
180
  };
137
- r(p.route, U(g, e), !1);
181
+ u.fixture = e.componentFixture(b.id, b.defaultFixture)?.id ?? b.fixtures?.[0]?.id, i("/", G(u, e), !1);
138
182
  },
139
- [s, r, e]
140
- ), m = y(() => me(s), [s]);
141
- return { location: t, controls: s, viewport: m, setControls: o, navigate: d, openScenario: l };
183
+ [r, i, e]
184
+ ), h = T(() => ve(r), [r]);
185
+ return { location: t, controls: r, viewport: h, setControls: a, navigate: s, openScenario: c, openComponent: p };
142
186
  }
143
- function me(e) {
144
- const t = G.find((n) => n.id === e.viewport);
187
+ function ve(e) {
188
+ const t = ne.find((n) => n.id === e.viewport);
145
189
  return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : t ?? { id: "fit", label: "Ajustar" };
146
190
  }
147
- function K() {
191
+ function X() {
148
192
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
149
193
  }
150
- function pe(e) {
151
- return e !== null && Y.includes(e);
194
+ function we(e) {
195
+ return e !== null && oe.includes(e);
196
+ }
197
+ function ke(e) {
198
+ return e === "dark" || e === "light";
152
199
  }
153
- function be(e) {
200
+ function Ne(e) {
154
201
  if (!e) return;
155
202
  const t = Number.parseInt(e, 10);
156
203
  return Number.isFinite(t) && t > 0 ? t : void 0;
157
204
  }
158
- function fe(e, t) {
159
- const n = e.split("/").filter(Boolean), s = ge(t).split("/").filter(Boolean), r = {};
160
- for (const [o, d] of n.entries()) {
161
- if (d === "*")
162
- return r["*"] = s.slice(o).join("/"), r;
163
- const l = s[o];
164
- if (l === void 0) return null;
165
- if (d.startsWith(":")) {
166
- r[d.slice(1)] = l;
205
+ function ye(e, t) {
206
+ const n = e.split("/").filter(Boolean), r = Se(t).split("/").filter(Boolean), i = {};
207
+ for (const [a, s] of n.entries()) {
208
+ if (s === "*")
209
+ return i["*"] = r.slice(a).join("/"), i;
210
+ const c = r[a];
211
+ if (c === void 0) return null;
212
+ if (s.startsWith(":")) {
213
+ i[s.slice(1)] = c;
167
214
  continue;
168
215
  }
169
- if (d !== l) return null;
216
+ if (s !== c) return null;
170
217
  }
171
- return n.length !== s.length ? null : r;
218
+ return n.length !== r.length ? null : i;
172
219
  }
173
- function ve(e, t) {
174
- const n = [...e].sort((s, r) => V(r.path) - V(s.path));
175
- for (const s of n) {
176
- const r = fe(s.path, t);
177
- if (r) return { definition: s, params: r };
220
+ function xe(e, t) {
221
+ const n = [...e].sort((r, i) => Z(i.path) - Z(r.path));
222
+ for (const r of n) {
223
+ const i = ye(r.path, t);
224
+ if (i) return { definition: r, params: i };
178
225
  }
179
226
  }
180
- function V(e) {
227
+ function Z(e) {
181
228
  const t = e.split("/").filter(Boolean);
182
229
  let n = t.length;
183
- for (const s of t)
184
- s === "*" ? n -= 2 : s.startsWith(":") ? n += 1 : n += 4;
230
+ for (const r of t)
231
+ r === "*" ? n -= 2 : r.startsWith(":") ? n += 1 : n += 4;
185
232
  return n;
186
233
  }
187
- function ge(e) {
234
+ function Se(e) {
188
235
  const t = e.split("?")[0] ?? e;
189
236
  try {
190
237
  return decodeURI(t);
@@ -192,17 +239,17 @@ function ge(e) {
192
239
  return t;
193
240
  }
194
241
  }
195
- const we = 2500;
196
- class Ne extends Error {
242
+ const Me = 2500;
243
+ class _e extends Error {
197
244
  constructor(t) {
198
245
  super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
199
246
  }
200
247
  }
201
- function P(e) {
248
+ function Y(e) {
202
249
  if (e)
203
250
  return typeof e.data == "function" ? e.data() : e.data;
204
251
  }
205
- const O = {
252
+ const J = {
206
253
  id: "fixtures",
207
254
  label: "Fixtures",
208
255
  load: async ({ scenario: e, fixture: t, network: n }) => {
@@ -210,66 +257,66 @@ const O = {
210
257
  case "empty":
211
258
  return null;
212
259
  case "error":
213
- throw new Ne(e.id);
260
+ throw new _e(e.id);
214
261
  case "loading":
215
262
  return new Promise(() => {
216
263
  });
217
264
  case "slow":
218
- return await ke(we), P(t);
265
+ return await Ce(Me), Y(t);
219
266
  default:
220
- return P(t);
267
+ return Y(t);
221
268
  }
222
269
  }
223
270
  };
224
- function et(e) {
225
- const { id: t, label: n, baseUrl: s, path: r, init: o, fallbackToFixture: d = !0 } = e;
271
+ function ft(e) {
272
+ const { id: t, label: n, baseUrl: r, path: i, init: a, fallbackToFixture: s = !0 } = e;
226
273
  return {
227
274
  id: t,
228
275
  label: n,
229
- load: async (l) => {
230
- const m = new URL(r ? r(l) : l.scenario.route, s);
276
+ load: async (c) => {
277
+ const p = new URL(i ? i(c) : c.scenario.route, r);
231
278
  try {
232
- const i = await fetch(m, o);
233
- if (!i.ok) throw new Error(`${i.status} ${i.statusText}`);
234
- return await i.json();
235
- } catch (i) {
236
- if (d) return P(l.fixture);
237
- throw new Error(`Adapter "${t}" falhou em ${m.toString()}`, { cause: i });
279
+ const h = await fetch(p, a);
280
+ if (!h.ok) throw new Error(`${h.status} ${h.statusText}`);
281
+ return await h.json();
282
+ } catch (h) {
283
+ if (s) return Y(c.fixture);
284
+ throw new Error(`Adapter "${t}" falhou em ${p.toString()}`, { cause: h });
238
285
  }
239
286
  }
240
287
  };
241
288
  }
242
- function ke(e) {
289
+ function Ce(e) {
243
290
  return new Promise((t) => setTimeout(t, e));
244
291
  }
245
- function _e(e) {
246
- const { scenario: t, fixture: n, network: s, adapter: r } = e, [o, d] = x({
292
+ function Te(e) {
293
+ const { scenario: t, fixture: n, network: r, adapter: i } = e, [a, s] = F({
247
294
  data: void 0,
248
295
  isLoading: !!t,
249
296
  error: void 0
250
297
  });
251
- return E(() => {
298
+ return B(() => {
252
299
  if (!t) {
253
- d({ data: void 0, isLoading: !1, error: void 0 });
300
+ s({ data: void 0, isLoading: !1, error: void 0 });
254
301
  return;
255
302
  }
256
- let l = !0;
257
- d({ data: void 0, isLoading: !0, error: void 0 });
258
- const m = r ?? O;
259
- return Promise.resolve(m.load({ scenario: t, fixture: n, network: s })).then((i) => {
260
- l && d({ data: i, isLoading: !1, error: void 0 });
261
- }).catch((i) => {
262
- l && d({
303
+ let c = !0;
304
+ s({ data: void 0, isLoading: !0, error: void 0 });
305
+ const p = i ?? J;
306
+ return Promise.resolve(p.load({ scenario: t, fixture: n, network: r })).then((h) => {
307
+ c && s({ data: h, isLoading: !1, error: void 0 });
308
+ }).catch((h) => {
309
+ c && s({
263
310
  data: void 0,
264
311
  isLoading: !1,
265
- error: i instanceof Error ? i : new Error(String(i))
312
+ error: h instanceof Error ? h : new Error(String(h))
266
313
  });
267
314
  }), () => {
268
- l = !1;
315
+ c = !1;
269
316
  };
270
- }, [t, n, s, r]), o;
317
+ }, [t, n, r, i]), a;
271
318
  }
272
- const ye = {
319
+ const Pe = {
273
320
  a: "link",
274
321
  article: "article",
275
322
  aside: "complementary",
@@ -303,7 +350,7 @@ const ye = {
303
350
  th: "columnheader",
304
351
  tr: "row",
305
352
  ul: "list"
306
- }, Se = {
353
+ }, Ae = {
307
354
  button: "button",
308
355
  checkbox: "checkbox",
309
356
  email: "textbox",
@@ -318,65 +365,65 @@ const ye = {
318
365
  text: "textbox",
319
366
  url: "textbox"
320
367
  };
321
- function xe(e) {
368
+ function Le(e) {
322
369
  if (!e || !(e instanceof HTMLElement)) return;
323
- const { name: t, nameFrom: n } = Ce(e);
370
+ const { name: t, nameFrom: n } = Fe(e);
324
371
  return {
325
- role: Me(e),
372
+ role: Ee(e),
326
373
  name: t,
327
374
  nameFrom: n,
328
- description: Te(e),
329
- states: Ae(e),
330
- selector: $e(e),
375
+ description: $e(e),
376
+ states: De(e),
377
+ selector: Ie(e),
331
378
  hiddenFromTabOrder: e.tabIndex < 0,
332
- hiddenFromAssistiveTech: Ee(e)
379
+ hiddenFromAssistiveTech: Re(e)
333
380
  };
334
381
  }
335
- function Me(e) {
382
+ function Ee(e) {
336
383
  const t = e.getAttribute("role");
337
384
  if (t) return t.split(/\s+/)[0] ?? t;
338
385
  const n = e.tagName.toLowerCase();
339
386
  if (n === "input") {
340
- const s = e.type.toLowerCase();
341
- return Se[s] ?? "textbox";
387
+ const r = e.type.toLowerCase();
388
+ return Ae[r] ?? "textbox";
342
389
  }
343
- return n === "a" && !e.hasAttribute("href") ? "generic" : ye[n] ?? "generic";
390
+ return n === "a" && !e.hasAttribute("href") ? "generic" : Pe[n] ?? "generic";
344
391
  }
345
- function Ce(e) {
392
+ function Fe(e) {
346
393
  const t = e.getAttribute("aria-labelledby");
347
394
  if (t) {
348
- const d = t.split(/\s+/).map((l) => e.ownerDocument.getElementById(l)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
349
- if (d) return { name: d, nameFrom: "aria-labelledby" };
395
+ const s = t.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
396
+ if (s) return { name: s, nameFrom: "aria-labelledby" };
350
397
  }
351
398
  const n = e.getAttribute("aria-label")?.trim();
352
399
  if (n) return { name: n, nameFrom: "aria-label" };
353
400
  if (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) {
354
- const d = Array.from(e.labels ?? []).map((l) => l.textContent?.trim() ?? "").filter(Boolean);
355
- if (d.length) return { name: d.join(" "), nameFrom: "label" };
401
+ const s = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
402
+ if (s.length) return { name: s.join(" "), nameFrom: "label" };
356
403
  }
357
404
  if (e instanceof HTMLImageElement) {
358
- const d = e.getAttribute("alt");
359
- if (d !== null) return { name: d, nameFrom: "alt" };
405
+ const s = e.getAttribute("alt");
406
+ if (s !== null) return { name: s, nameFrom: "alt" };
360
407
  }
361
- const s = e.getAttribute("title")?.trim(), r = Le(e);
362
- return r ? { name: r, nameFrom: "content" } : s ? { name: s, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
408
+ const r = e.getAttribute("title")?.trim(), i = Oe(e);
409
+ return i ? { name: i, nameFrom: "content" } : r ? { name: r, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
363
410
  }
364
- function Te(e) {
411
+ function $e(e) {
365
412
  const t = e.getAttribute("aria-describedby");
366
413
  if (t) {
367
- const n = t.split(/\s+/).map((s) => e.ownerDocument.getElementById(s)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
414
+ const n = t.split(/\s+/).map((r) => e.ownerDocument.getElementById(r)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
368
415
  if (n) return n;
369
416
  }
370
417
  return e.getAttribute("aria-description")?.trim() || void 0;
371
418
  }
372
- function Ae(e) {
373
- const t = [], n = (s, r = s.replace("aria-", "")) => {
374
- const o = e.getAttribute(s);
375
- o !== null && o !== "false" && t.push(o === "true" || o === "" ? r : `${r}=${o}`);
419
+ function De(e) {
420
+ const t = [], n = (r, i = r.replace("aria-", "")) => {
421
+ const a = e.getAttribute(r);
422
+ a !== null && a !== "false" && t.push(a === "true" || a === "" ? i : `${i}=${a}`);
376
423
  };
377
424
  return e.disabled && t.push("disabled"), e.getAttribute("aria-disabled") === "true" && t.push("disabled"), e.required && t.push("required"), e.readOnly && t.push("readonly"), e.checked && t.push("checked"), n("aria-expanded"), n("aria-selected"), n("aria-checked"), n("aria-pressed"), n("aria-current"), n("aria-invalid"), n("aria-busy"), n("aria-live"), n("aria-haspopup"), n("aria-level", "level"), e.ownerDocument.activeElement === e && t.push("focused"), [...new Set(t)];
378
425
  }
379
- function Ee(e) {
426
+ function Re(e) {
380
427
  let t = e;
381
428
  for (; t; ) {
382
429
  if (t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden")) return !0;
@@ -384,21 +431,21 @@ function Ee(e) {
384
431
  }
385
432
  return !1;
386
433
  }
387
- function Le(e) {
434
+ function Oe(e) {
388
435
  const t = e.cloneNode(!0);
389
436
  for (const n of t.querySelectorAll("[aria-hidden='true'],[hidden]"))
390
437
  n.remove();
391
438
  return (t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
392
439
  }
393
- function $e(e) {
440
+ function Ie(e) {
394
441
  const t = e.tagName.toLowerCase();
395
442
  if (e.id) return `${t}#${e.id}`;
396
443
  const n = e.getAttribute("data-testid");
397
444
  if (n) return `${t}[data-testid="${n}"]`;
398
- const s = Array.from(e.classList).slice(0, 2);
399
- return s.length ? `${t}.${s.join(".")}` : t;
445
+ const r = Array.from(e.classList).slice(0, 2);
446
+ return r.length ? `${t}.${r.join(".")}` : t;
400
447
  }
401
- function Fe(e = document) {
448
+ function Be(e = document) {
402
449
  const t = [
403
450
  "a[href]",
404
451
  "button",
@@ -411,41 +458,42 @@ function Fe(e = document) {
411
458
  ].join(",");
412
459
  return Array.from(e.querySelectorAll(t)).filter((n) => {
413
460
  if (n.tabIndex < 0 || n.disabled || n.getAttribute("aria-hidden") === "true") return !1;
414
- const s = window.getComputedStyle(n);
415
- return s.display === "none" || s.visibility === "hidden" ? !1 : n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement;
461
+ const r = window.getComputedStyle(n);
462
+ return r.display === "none" || r.visibility === "hidden" ? !1 : n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement;
416
463
  });
417
464
  }
418
- function Pe(e, t) {
419
- const [n, s] = x(), [r, o] = x([]), d = C(() => {
420
- const l = t.current;
421
- if (!l) {
422
- o([]);
465
+ function We(e, t) {
466
+ const [n, r] = F(), [i, a] = F([]), s = I(() => {
467
+ const c = t.current;
468
+ if (!c) {
469
+ a([]);
423
470
  return;
424
471
  }
425
- o(
426
- Fe(l).map((m, i) => ({
427
- index: i + 1,
428
- element: m,
429
- rect: m.getBoundingClientRect(),
430
- forcedOrder: m.tabIndex > 0
472
+ a(
473
+ Be(c).map((p, h) => ({
474
+ index: h + 1,
475
+ element: p,
476
+ rect: p.getBoundingClientRect(),
477
+ forcedOrder: p.tabIndex > 0
431
478
  }))
432
479
  );
433
480
  }, [t]);
434
- return E(() => {
481
+ return B(() => {
435
482
  if (!e) {
436
- s(void 0), o([]);
483
+ r(void 0), a([]);
437
484
  return;
438
485
  }
439
- const l = () => s(xe(document.activeElement));
440
- document.addEventListener("focusin", l), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), l(), d();
441
- const m = t.current, i = m ? new MutationObserver(() => d()) : void 0;
442
- return i?.observe(m, { childList: !0, subtree: !0, attributes: !0 }), () => {
443
- document.removeEventListener("focusin", l), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), i?.disconnect();
486
+ const c = () => r(Le(document.activeElement));
487
+ document.addEventListener("focusin", c), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), c(), s();
488
+ const p = t.current, h = p ? new MutationObserver(() => s()) : void 0;
489
+ return h?.observe(p, { childList: !0, subtree: !0, attributes: !0 }), () => {
490
+ document.removeEventListener("focusin", c), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), h?.disconnect();
444
491
  };
445
- }, [e, d, t]), { focused: n, tabStops: r, refresh: d };
492
+ }, [e, s, t]), { focused: n, tabStops: i, refresh: s };
446
493
  }
447
- const S = {
494
+ const E = {
448
495
  status: {
496
+ ported: "Portado — não validado",
449
497
  proposed: "Proposta",
450
498
  "in-review": "Em revisão",
451
499
  approved: "Aprovado",
@@ -454,6 +502,7 @@ const S = {
454
502
  superseded: "Superado"
455
503
  },
456
504
  statusMeaning: {
505
+ ported: "Veio do sistema existente, mas não foi validado e não representa compromisso de implementação.",
457
506
  proposed: "Exploração ainda não aprovada.",
458
507
  "in-review": "Aberto para validação de design, negócio ou cliente.",
459
508
  approved: "Referência autorizada, registrada por URL de commit.",
@@ -481,30 +530,48 @@ const S = {
481
530
  custom: "Personalizado"
482
531
  },
483
532
  topbar: {
533
+ homeTitle: (e) => `Ir para a página inicial de ${e}`,
484
534
  toggleNav: "Mostrar ou ocultar a navegação",
485
535
  copyLink: "Copiar link",
486
536
  copied: "Link copiado",
487
537
  copyPrompt: "Copie o link do cenário:",
488
538
  cleanReview: "Revisão limpa",
489
- cleanReviewTitle: "Ocultar o chrome do Design Space para revisão limpa e captura de tela",
539
+ cleanReviewTitle: "Abrir a situação em uma nova aba, sem o chrome do Design Space",
490
540
  panel: "Painel",
541
+ lightMode: "Modo claro",
542
+ darkMode: "Modo escuro",
491
543
  branchTitle: (e) => `Branch: ${e}`,
492
544
  commitTitle: (e) => `Commit: ${e}`,
493
545
  envTitle: (e) => `Ambiente: ${e}`
494
546
  },
495
547
  sidebar: {
496
548
  region: "Cenários do produto",
549
+ flowsTab: "Fluxos",
550
+ componentsTab: "Componentes",
497
551
  searchPlaceholder: "Buscar situação…",
498
552
  searchLabel: "Buscar cenário pelo vocabulário do produto",
553
+ componentSearchPlaceholder: "Buscar componente…",
554
+ componentSearchLabel: "Buscar componente do produto",
555
+ searchShortcut: "⌘K",
499
556
  noMatch: (e) => `Nenhuma situação para "${e}".`,
500
557
  matchCount: (e) => `${e} ${e === 1 ? "situação" : "situações"}.`,
558
+ noComponentMatch: (e) => `Nenhum componente para "${e}".`,
559
+ componentMatchCount: (e) => `${e} ${e === 1 ? "componente" : "componentes"}.`,
560
+ showPorted: "Mostrar portados",
561
+ activePorted: "Aberto por link direto; oculto do trabalho ativo",
501
562
  emptyModule: "Nenhum cenário ainda.",
502
- withoutModule: "Sem módulo"
563
+ emptyComponents: "O produto ainda não registrou componentes.",
564
+ withoutModule: "Sem módulo",
565
+ scope: "Escopo ativo",
566
+ scopeData: "Dados",
567
+ scopePersona: "Persona",
568
+ scopeNetwork: "Rede"
503
569
  },
504
570
  controls: {
505
571
  region: "Controles do cenário",
506
572
  persona: "Persona",
507
573
  fixture: "Dados",
574
+ componentFixture: "Dados do componente",
508
575
  network: "Rede",
509
576
  viewport: "Viewport",
510
577
  customWidth: "Largura personalizada em pixels",
@@ -527,6 +594,11 @@ const S = {
527
594
  tabDiagnostics: "Diagnóstico",
528
595
  diagnosticsWithErrors: (e) => `Diagnóstico (${e})`,
529
596
  noScenario: "Nenhum cenário ativo. Escolha uma situação na navegação para ver contexto, regras e critérios.",
597
+ componentReference: "Componente",
598
+ componentGroup: "Grupo",
599
+ componentFixture: "Fixture ativa",
600
+ componentFixtureDescription: "Descrição da fixture",
601
+ componentFixtureFallback: (e, t) => `A fixture \`${e}\` não existe neste componente. Exibindo \`${t}\` como fallback.`,
530
602
  situation: "Situação",
531
603
  reproduction: "Reprodução",
532
604
  id: "Id",
@@ -576,253 +648,605 @@ const S = {
576
648
  withoutModule: "Sem módulo",
577
649
  withoutModuleHint: "O prefixo do id não corresponde a nenhum módulo registrado, então estas situações não aparecem na navegação por módulo.",
578
650
  emptyModule: "Nenhuma situação registrada neste módulo ainda.",
579
- keyboardBadge: "teclado"
651
+ keyboardBadge: "teclado",
652
+ noActiveWork: "Não há trabalho ativo. As referências portadas continuam registradas e podem ser exibidas com “Mostrar portados”."
580
653
  },
581
654
  shell: {
582
655
  restoreChrome: "Mostrar controles",
583
656
  noRoute: "Nenhuma rota para este endereço",
584
657
  noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação."
585
658
  }
659
+ }, bt = {
660
+ status: {
661
+ ported: "Ported — not validated",
662
+ proposed: "Proposed",
663
+ "in-review": "In review",
664
+ approved: "Approved",
665
+ "in-implementation": "In implementation",
666
+ implemented: "Implemented",
667
+ superseded: "Superseded"
668
+ },
669
+ statusMeaning: {
670
+ ported: "Imported from the existing system, but not validated and not an implementation commitment.",
671
+ proposed: "Exploration that has not been approved yet.",
672
+ "in-review": "Open for design, business, or client validation.",
673
+ approved: "Authorized reference, recorded with a commit URL.",
674
+ "in-implementation": "Linked to active engineering work.",
675
+ implemented: "Available in the real product and validated.",
676
+ superseded: "Kept for history or replaced by another decision."
677
+ },
678
+ network: {
679
+ success: "Success",
680
+ loading: "Loading",
681
+ empty: "Empty",
682
+ error: "Error",
683
+ slow: "Slow"
684
+ },
685
+ keyboard: {
686
+ full: "Journey can be completed with keyboard only",
687
+ partial: "Partially operable with keyboard",
688
+ "not-applicable": "Not applicable"
689
+ },
690
+ viewport: {
691
+ fit: "Fit",
692
+ mobile: "Mobile",
693
+ tablet: "Tablet",
694
+ desktop: "Desktop",
695
+ custom: "Custom"
696
+ },
697
+ topbar: {
698
+ homeTitle: (e) => `Go to ${e} home`,
699
+ toggleNav: "Show or hide navigation",
700
+ copyLink: "Copy link",
701
+ copied: "Link copied",
702
+ copyPrompt: "Copy the scenario link:",
703
+ cleanReview: "Clean review",
704
+ cleanReviewTitle: "Open this state in a new tab without the Design Space chrome",
705
+ panel: "Panel",
706
+ lightMode: "Light mode",
707
+ darkMode: "Dark mode",
708
+ branchTitle: (e) => `Branch: ${e}`,
709
+ commitTitle: (e) => `Commit: ${e}`,
710
+ envTitle: (e) => `Environment: ${e}`
711
+ },
712
+ sidebar: {
713
+ region: "Product scenarios",
714
+ flowsTab: "Flows",
715
+ componentsTab: "Components",
716
+ searchPlaceholder: "Search scenarios…",
717
+ searchLabel: "Search scenarios using product language",
718
+ componentSearchPlaceholder: "Search components…",
719
+ componentSearchLabel: "Search product components",
720
+ searchShortcut: "⌘K",
721
+ noMatch: (e) => `No scenarios found for "${e}".`,
722
+ matchCount: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"}.`,
723
+ noComponentMatch: (e) => `No components found for "${e}".`,
724
+ componentMatchCount: (e) => `${e} ${e === 1 ? "component" : "components"}.`,
725
+ showPorted: "Show ported",
726
+ activePorted: "Opened by direct link; hidden from active work",
727
+ emptyModule: "No scenarios yet.",
728
+ emptyComponents: "The product has not registered any components yet.",
729
+ withoutModule: "No module",
730
+ scope: "Active scope",
731
+ scopeData: "Data",
732
+ scopePersona: "Persona",
733
+ scopeNetwork: "Network"
734
+ },
735
+ controls: {
736
+ region: "Scenario controls",
737
+ persona: "Persona",
738
+ fixture: "Data",
739
+ componentFixture: "Component data",
740
+ network: "Network",
741
+ viewport: "Viewport",
742
+ customWidth: "Custom width in pixels",
743
+ theme: "Theme",
744
+ locale: "Language",
745
+ dataSource: "Source",
746
+ fixturesOption: "Fixtures",
747
+ a11y: "Accessibility",
748
+ keyboardMode: "Keyboard",
749
+ keyboardModeTitle: "Complete the journey with keyboard only, showing focus and tab order",
750
+ reducedMotion: "Motion",
751
+ reducedMotionTitle: "Reduce motion inside the stage",
752
+ textScale: "Text size",
753
+ none: "—"
754
+ },
755
+ inspector: {
756
+ region: "Context panel",
757
+ tabScenario: "Scenario",
758
+ tabA11y: "Accessibility",
759
+ tabDiagnostics: "Diagnostics",
760
+ diagnosticsWithErrors: (e) => `Diagnostics (${e})`,
761
+ noScenario: "No active scenario. Choose a state in the navigation to see its context, rules, and criteria.",
762
+ componentReference: "Component",
763
+ componentGroup: "Group",
764
+ componentFixture: "Active fixture",
765
+ componentFixtureDescription: "Fixture description",
766
+ componentFixtureFallback: (e, t) => `Fixture \`${e}\` does not exist for this component. Showing \`${t}\` as fallback.`,
767
+ situation: "State",
768
+ reproduction: "Reproduction",
769
+ id: "ID",
770
+ route: "Route",
771
+ persona: "Persona",
772
+ personaSwapped: "changed",
773
+ data: "Data",
774
+ network: "Network",
775
+ goal: (e) => `Goal: ${e}`,
776
+ permissions: "Effective permissions",
777
+ preconditions: "Preconditions",
778
+ rules: "Rules",
779
+ actions: "Available actions",
780
+ expected: "Acceptance criteria",
781
+ approval: "Approval",
782
+ openApproved: "Open approved version",
783
+ engineering: "Engineering",
784
+ a11yContract: "Scenario contract",
785
+ keyboard: "Keyboard",
786
+ contrast: "Contrast",
787
+ contrastTarget: (e) => `WCAG 2.2 ${e}`,
788
+ announces: "Must be announced:",
789
+ focusedElement: "Focused element",
790
+ keyboardModeOff: "Turn on keyboard mode in the controls to inspect the accessibility tree.",
791
+ pressTab: (e) => `Press Tab inside the stage. ${e} tab ${e === 1 ? "stop was" : "stops were"} found.`,
792
+ role: "Role",
793
+ name: "Name",
794
+ noAccessibleName: "no accessible name",
795
+ nameFrom: "Name source",
796
+ description: "Description",
797
+ selector: "Selector",
798
+ focusableButHidden: "This element is focusable but hidden from assistive technology. A screen reader receives focus without receiving content.",
799
+ tabStopsInStage: (e) => `${e} tab ${e === 1 ? "stop" : "stops"} in the stage.`,
800
+ tokenContrast: "Token contrast",
801
+ noContrastPairs: "The product has not declared contrast pairs in theme.contrastPairs. Contrast belongs to a pair of colors; declaring pairs here validates them once, at the source.",
802
+ pair: "Pair",
803
+ ratio: "Ratio",
804
+ pairsFailing: (e) => `${e} ${e === 1 ? "pair is" : "pairs are"} below the target. The product token test fails the build for this.`,
805
+ automatedIsFloor: "Automated checks are a floor, not a ceiling. Confusing reading order, technically present but meaningless labels, and journeys that cannot be completed with a screen reader can still pass automated tools.",
806
+ coverage: "Coverage by status",
807
+ scenariosRegistered: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"} registered.`,
808
+ scenarioContract: "Scenario contract",
809
+ noIssues: "No issues found."
810
+ },
811
+ home: {
812
+ lead: (e) => `Executable specification: each state below opens from a link with its own persona, data, and rules. ${e} ${e === 1 ? "state registered" : "states registered"}.`,
813
+ withoutModule: "No module",
814
+ withoutModuleHint: "The ID prefix does not match a registered module, so these states do not appear in module navigation.",
815
+ emptyModule: "No states have been registered in this module yet.",
816
+ keyboardBadge: "keyboard",
817
+ noActiveWork: "There is no active work. Ported references remain registered and can be included with “Show ported”."
818
+ },
819
+ shell: {
820
+ restoreChrome: "Show controls",
821
+ noRoute: "No route for this address",
822
+ noRouteHint: "does not match any declared route. Choose a state from the navigation."
823
+ }
586
824
  };
587
- function Oe(e) {
588
- if (!e) return S;
589
- const t = { ...S };
590
- for (const n of Object.keys(S)) {
591
- const s = e[n];
592
- s && (t[n] = { ...S[n], ...s });
825
+ function je(e) {
826
+ if (!e) return E;
827
+ const t = { ...E };
828
+ for (const n of Object.keys(E)) {
829
+ const r = e[n];
830
+ r && (t[n] = { ...E[n], ...r });
593
831
  }
594
832
  return t;
595
833
  }
596
- const J = ne(S);
597
- function N() {
598
- return ae(J);
834
+ const ae = ie(E);
835
+ function A() {
836
+ return se(ae);
599
837
  }
600
- const tt = S.status, at = S.statusMeaning, nt = S.network, rt = S.keyboard;
601
- function Re({ registry: e, activeScenario: t, onOpenScenario: n }) {
602
- const s = N(), [r, o] = x(""), [d, l] = x(/* @__PURE__ */ new Set()), m = y(() => {
603
- if (r.trim())
604
- return new Set(e.search(r).map((h) => h.id));
605
- }, [r, e]), i = (h) => l((b) => {
606
- const w = new Set(b);
607
- return w.has(h) ? w.delete(h) : w.add(h), w;
608
- }), p = (h) => m ? h.filter((b) => m.has(b.id)) : h, g = e.tree.map((h) => ({ ...h, scenarios: p(h.scenarios) })).filter((h) => m ? h.scenarios.length > 0 : !0), v = p(e.orphans), u = g.reduce((h, b) => h + b.scenarios.length, 0) + v.length;
609
- return /* @__PURE__ */ c("nav", { className: "ds-chrome ds-sidebar", "aria-label": s.sidebar.region, children: [
610
- /* @__PURE__ */ a("div", { className: "ds-sidebar__search", children: /* @__PURE__ */ a(
611
- "input",
612
- {
613
- className: "ds-input ds-input--search",
614
- type: "search",
615
- value: r,
616
- placeholder: s.sidebar.searchPlaceholder,
617
- "aria-label": s.sidebar.searchLabel,
618
- onChange: (h) => o(h.target.value)
619
- }
620
- ) }),
621
- /* @__PURE__ */ c("div", { className: "ds-sidebar__tree", children: [
622
- r.trim() !== "" && /* @__PURE__ */ a("p", { className: "ds-sidebar__empty", role: "status", children: u === 0 ? s.sidebar.noMatch(r) : s.sidebar.matchCount(u) }),
623
- g.map((h) => {
624
- const b = !d.has(h.module.id) || !!m;
625
- return /* @__PURE__ */ c("section", { className: "ds-module", children: [
626
- /* @__PURE__ */ c(
627
- "button",
628
- {
629
- type: "button",
630
- className: "ds-module__header",
631
- "aria-expanded": b,
632
- onClick: () => i(h.module.id),
633
- children: [
634
- /* @__PURE__ */ a("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
635
- /* @__PURE__ */ a("span", { children: h.module.name }),
636
- /* @__PURE__ */ a("span", { className: "ds-module__count", children: h.scenarios.length })
637
- ]
638
- }
639
- ),
640
- b && /* @__PURE__ */ c("ul", { className: "ds-module__scenarios", children: [
641
- h.scenarios.map((w) => /* @__PURE__ */ a(
642
- q,
643
- {
644
- scenario: w,
645
- isActive: w.id === t,
646
- onOpen: n
647
- },
648
- w.id
649
- )),
650
- h.scenarios.length === 0 && /* @__PURE__ */ a("li", { className: "ds-sidebar__empty", children: s.sidebar.emptyModule })
651
- ] })
652
- ] }, h.module.id);
653
- }),
654
- v.length > 0 && /* @__PURE__ */ c("section", { className: "ds-module", children: [
655
- /* @__PURE__ */ c("div", { className: "ds-module__header", "aria-hidden": "true", children: [
656
- /* @__PURE__ */ a("span", { className: "ds-module__chevron", children: "▶" }),
657
- /* @__PURE__ */ a("span", { children: s.sidebar.withoutModule }),
658
- /* @__PURE__ */ a("span", { className: "ds-module__count", children: v.length })
659
- ] }),
660
- /* @__PURE__ */ a("ul", { className: "ds-module__scenarios", children: v.map((h) => /* @__PURE__ */ a(
661
- q,
662
- {
663
- scenario: h,
664
- isActive: h.id === t,
665
- onOpen: n
838
+ const gt = E.status, vt = E.statusMeaning, wt = E.network, kt = E.keyboard;
839
+ function He({
840
+ registry: e,
841
+ activeScenario: t,
842
+ activeComponent: n,
843
+ controls: r,
844
+ onOpenScenario: i,
845
+ onOpenComponent: a,
846
+ onShowPortedChange: s
847
+ }) {
848
+ const c = A(), [p, h] = F(n ? "components" : "flows"), [m, b] = F(""), [u, S] = F(/* @__PURE__ */ new Set()), w = q(null), C = q(/* @__PURE__ */ new Map());
849
+ B(() => {
850
+ n ? h("components") : t && h("flows");
851
+ }, [n, t]), B(() => {
852
+ const f = (N) => {
853
+ Ue(N) && (N.preventDefault(), w.current?.focus(), w.current?.select());
854
+ };
855
+ return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
856
+ }, []);
857
+ const l = T(() => {
858
+ if (m.trim())
859
+ return new Set(
860
+ e.search(m, { includePorted: r.showPorted }).map((f) => f.id)
861
+ );
862
+ }, [r.showPorted, m, e]), g = T(() => {
863
+ const f = te(m);
864
+ return (e.product.components ?? []).filter(
865
+ (N) => te([N.name, N.id, N.group, N.description].join(" ")).includes(
866
+ f
867
+ )
868
+ );
869
+ }, [m, e.product.components]), k = (f) => l ? f.filter((N) => l.has(N.id)) : f, M = {
870
+ includePorted: r.showPorted,
871
+ activeScenario: m.trim() ? void 0 : t?.id
872
+ }, _ = e.treeFor(M).map((f) => ({ ...f, scenarios: k(f.scenarios) })).filter((f) => l ? f.scenarios.length > 0 : !0), $ = k(e.orphansFor(M)), D = _.reduce((f, N) => f + N.scenarios.length, 0) + $.length, W = ze(g), R = p === "flows" ? [..._.flatMap((f) => f.scenarios), ...$].map((f) => f.id) : g.map((f) => f.id), j = (f, N) => {
873
+ if (R.length === 0) return;
874
+ const y = Ge(R, f, N);
875
+ y && C.current.get(y)?.focus();
876
+ }, U = (f) => {
877
+ f.key === "ArrowDown" ? (f.preventDefault(), j(void 0, 1)) : f.key === "Escape" && b("");
878
+ }, O = (f, N) => {
879
+ N.key !== "ArrowDown" && N.key !== "ArrowUp" || (N.preventDefault(), j(f, N.key === "ArrowDown" ? 1 : -1));
880
+ }, H = (f, N) => {
881
+ N ? C.current.set(f, N) : C.current.delete(f);
882
+ }, K = (f) => S((N) => {
883
+ const y = new Set(N);
884
+ return y.has(f) ? y.delete(f) : y.add(f), y;
885
+ });
886
+ return /* @__PURE__ */ d("nav", { className: "ds-chrome ds-sidebar", "aria-label": c.sidebar.region, children: [
887
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
888
+ /* @__PURE__ */ o(
889
+ "button",
890
+ {
891
+ type: "button",
892
+ role: "tab",
893
+ "aria-selected": p === "flows",
894
+ onClick: () => {
895
+ h("flows"), b("");
666
896
  },
667
- h.id
668
- )) })
897
+ children: c.sidebar.flowsTab
898
+ }
899
+ ),
900
+ /* @__PURE__ */ o(
901
+ "button",
902
+ {
903
+ type: "button",
904
+ role: "tab",
905
+ "aria-selected": p === "components",
906
+ onClick: () => {
907
+ h("components"), b("");
908
+ },
909
+ children: c.sidebar.componentsTab
910
+ }
911
+ )
912
+ ] }),
913
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__search", children: [
914
+ /* @__PURE__ */ o(
915
+ "input",
916
+ {
917
+ ref: w,
918
+ className: "ds-input ds-input--search",
919
+ type: "search",
920
+ value: m,
921
+ placeholder: p === "flows" ? c.sidebar.searchPlaceholder : c.sidebar.componentSearchPlaceholder,
922
+ "aria-label": p === "flows" ? c.sidebar.searchLabel : c.sidebar.componentSearchLabel,
923
+ onChange: (f) => b(f.target.value),
924
+ onKeyDown: U
925
+ }
926
+ ),
927
+ /* @__PURE__ */ o("kbd", { children: c.sidebar.searchShortcut })
928
+ ] }),
929
+ p === "flows" && /* @__PURE__ */ d("label", { className: "ds-sidebar__option", children: [
930
+ /* @__PURE__ */ o(
931
+ "input",
932
+ {
933
+ type: "checkbox",
934
+ checked: r.showPorted ?? !1,
935
+ onChange: (f) => s(f.target.checked)
936
+ }
937
+ ),
938
+ /* @__PURE__ */ o("span", { children: c.sidebar.showPorted })
939
+ ] }),
940
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__tree", role: "tabpanel", children: [
941
+ m.trim() !== "" && /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", role: "status", children: p === "flows" ? D === 0 ? c.sidebar.noMatch(m) : c.sidebar.matchCount(D) : g.length === 0 ? c.sidebar.noComponentMatch(m) : c.sidebar.componentMatchCount(g.length) }),
942
+ p === "flows" ? /* @__PURE__ */ o(
943
+ Ke,
944
+ {
945
+ nodes: _,
946
+ orphans: $,
947
+ matches: l,
948
+ collapsed: u,
949
+ activeScenario: t?.id,
950
+ showPorted: r.showPorted ?? !1,
951
+ activePortedLabel: c.sidebar.activePorted,
952
+ emptyModuleLabel: c.sidebar.emptyModule,
953
+ withoutModuleLabel: c.sidebar.withoutModule,
954
+ onToggle: K,
955
+ onOpen: i,
956
+ onKeyDown: O,
957
+ setItemRef: H
958
+ }
959
+ ) : W.length === 0 && !m ? /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", children: c.sidebar.emptyComponents }) : W.map(([f, N]) => /* @__PURE__ */ d("section", { className: "ds-component-group", children: [
960
+ /* @__PURE__ */ o("h2", { children: f }),
961
+ /* @__PURE__ */ o("ul", { children: N.map((y) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
962
+ "button",
963
+ {
964
+ ref: (x) => H(y.id, x),
965
+ type: "button",
966
+ className: "ds-component-item",
967
+ "aria-current": y.id === n,
968
+ onClick: () => a(y.id),
969
+ onKeyDown: (x) => O(y.id, x),
970
+ children: [
971
+ /* @__PURE__ */ o("span", { children: y.name }),
972
+ y.description && /* @__PURE__ */ o("small", { children: y.description })
973
+ ]
974
+ }
975
+ ) }, y.id)) })
976
+ ] }, f))
977
+ ] }),
978
+ p === "flows" && t && /* @__PURE__ */ d("aside", { className: "ds-sidebar__scope", "aria-label": c.sidebar.scope, children: [
979
+ /* @__PURE__ */ o("h2", { children: c.sidebar.scope }),
980
+ /* @__PURE__ */ d("dl", { children: [
981
+ /* @__PURE__ */ o("dt", { children: c.sidebar.scopeData }),
982
+ /* @__PURE__ */ o("dd", { children: e.fixture(r.fixture ?? t.fixture)?.label ?? c.controls.none }),
983
+ /* @__PURE__ */ o("dt", { children: c.sidebar.scopePersona }),
984
+ /* @__PURE__ */ o("dd", { children: e.persona(r.persona ?? t.persona)?.name ?? c.controls.none }),
985
+ /* @__PURE__ */ o("dt", { children: c.sidebar.scopeNetwork }),
986
+ /* @__PURE__ */ o("dd", { children: c.network[r.network] })
669
987
  ] })
670
988
  ] })
671
989
  ] });
672
990
  }
673
- function q({
991
+ function Ke(e) {
992
+ return /* @__PURE__ */ d(P, { children: [
993
+ e.nodes.map((t) => {
994
+ const n = !e.collapsed.has(t.module.id) || !!e.matches;
995
+ return /* @__PURE__ */ d("section", { className: "ds-module", children: [
996
+ /* @__PURE__ */ d(
997
+ "button",
998
+ {
999
+ type: "button",
1000
+ className: "ds-module__header",
1001
+ "aria-expanded": n,
1002
+ onClick: () => e.onToggle(t.module.id),
1003
+ children: [
1004
+ /* @__PURE__ */ o("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
1005
+ /* @__PURE__ */ o("span", { children: t.module.name }),
1006
+ /* @__PURE__ */ o("span", { className: "ds-module__count", children: t.scenarios.length })
1007
+ ]
1008
+ }
1009
+ ),
1010
+ n && /* @__PURE__ */ d("ul", { className: "ds-module__scenarios", children: [
1011
+ t.scenarios.map((r) => /* @__PURE__ */ o(ee, { scenario: r, ...e }, r.id)),
1012
+ t.scenarios.length === 0 && /* @__PURE__ */ o("li", { className: "ds-sidebar__empty", children: e.emptyModuleLabel })
1013
+ ] })
1014
+ ] }, t.module.id);
1015
+ }),
1016
+ e.orphans.length > 0 && /* @__PURE__ */ d("section", { className: "ds-module", children: [
1017
+ /* @__PURE__ */ d("div", { className: "ds-module__header", "aria-hidden": "true", children: [
1018
+ /* @__PURE__ */ o("span", { className: "ds-module__chevron", children: "▶" }),
1019
+ /* @__PURE__ */ o("span", { children: e.withoutModuleLabel }),
1020
+ /* @__PURE__ */ o("span", { className: "ds-module__count", children: e.orphans.length })
1021
+ ] }),
1022
+ /* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: e.orphans.map((t) => /* @__PURE__ */ o(ee, { scenario: t, ...e }, t.id)) })
1023
+ ] })
1024
+ ] });
1025
+ }
1026
+ function ee({
674
1027
  scenario: e,
675
- isActive: t,
676
- onOpen: n
1028
+ activeScenario: t,
1029
+ showPorted: n,
1030
+ activePortedLabel: r,
1031
+ onOpen: i,
1032
+ onKeyDown: a,
1033
+ setItemRef: s
677
1034
  }) {
678
- const s = N().status[e.status];
679
- return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(
1035
+ const c = A().status[e.status], p = e.status === "ported" && e.id === t && !n;
1036
+ return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
680
1037
  "button",
681
1038
  {
1039
+ ref: (h) => s(e.id, h),
682
1040
  type: "button",
683
1041
  className: "ds-scenario",
684
- "aria-current": t,
685
- onClick: () => n(e.id),
1042
+ "aria-current": e.id === t,
1043
+ onClick: () => i(e.id),
1044
+ onKeyDown: (h) => a(e.id, h),
686
1045
  children: [
687
- /* @__PURE__ */ a(
688
- "span",
689
- {
690
- className: "ds-status-dot",
691
- "data-status": e.status,
692
- title: s
693
- }
694
- ),
695
- /* @__PURE__ */ a("span", { className: "ds-scenario__title", children: e.title }),
696
- /* @__PURE__ */ a("span", { className: "ds-visually-hidden", children: s })
1046
+ /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": e.status, title: c }),
1047
+ /* @__PURE__ */ o("span", { className: "ds-scenario__title", children: e.title }),
1048
+ /* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: c }),
1049
+ p && /* @__PURE__ */ o("span", { className: "ds-scenario__flag", title: r, children: c })
697
1050
  ]
698
1051
  }
699
1052
  ) });
700
1053
  }
701
- function Ie({
1054
+ function ze(e) {
1055
+ const t = /* @__PURE__ */ new Map();
1056
+ for (const n of e) {
1057
+ const r = n.group ?? "Componentes";
1058
+ t.set(r, [...t.get(r) ?? [], n]);
1059
+ }
1060
+ return [...t.entries()];
1061
+ }
1062
+ function te(e) {
1063
+ return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
1064
+ }
1065
+ function Ue(e) {
1066
+ const t = e.key.toLowerCase();
1067
+ return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (t === "k" || t === "f");
1068
+ }
1069
+ function Ge(e, t, n) {
1070
+ if (e.length === 0) return;
1071
+ const r = t ? e.indexOf(t) : -1, i = Math.max(0, Math.min(e.length - 1, r + n));
1072
+ return e[i];
1073
+ }
1074
+ function Ve({
702
1075
  product: e,
703
1076
  scenario: t,
704
1077
  deploy: n,
705
- inspectorOpen: s,
706
- sidebarOpen: r,
707
- onToggleInspector: o,
708
- onToggleSidebar: d,
709
- onHideChrome: l
1078
+ inspectorOpen: r,
1079
+ chromeTheme: i,
1080
+ showPorted: a,
1081
+ onToggleInspector: s,
1082
+ onToggleChromeTheme: c
710
1083
  }) {
711
- const m = N().topbar, [i, p] = x(!1), g = async () => {
712
- const v = t ? ie(t, { origin: n.origin }) : `${n.origin}${window.location.pathname}${window.location.search}`;
1084
+ const p = A().topbar, [h, m] = F(!1), b = async () => {
1085
+ const w = t ? ue(t, {
1086
+ origin: n.origin,
1087
+ overrides: {
1088
+ ...i === "light" ? { chromeTheme: i } : {},
1089
+ ...a ? { showPorted: !0 } : {}
1090
+ }
1091
+ }) : `${n.origin}${window.location.pathname}${window.location.search}`;
713
1092
  try {
714
- await navigator.clipboard.writeText(v);
1093
+ await navigator.clipboard.writeText(w);
715
1094
  } catch {
716
- window.prompt(m.copyPrompt, v);
1095
+ window.prompt(p.copyPrompt, w);
717
1096
  }
718
- p(!0), window.setTimeout(() => p(!1), 1600);
719
- };
720
- return /* @__PURE__ */ c("header", { className: "ds-chrome ds-topbar", children: [
721
- /* @__PURE__ */ a(
1097
+ m(!0), window.setTimeout(() => m(!1), 1600);
1098
+ }, u = qe(
1099
+ typeof window > "u" ? `${n.origin}/` : window.location.href
1100
+ ), S = Ye(n.origin, i, a);
1101
+ return /* @__PURE__ */ d("header", { className: "ds-chrome ds-topbar", children: [
1102
+ /* @__PURE__ */ d("div", { className: "ds-topbar__product", children: [
1103
+ /* @__PURE__ */ o(
1104
+ "a",
1105
+ {
1106
+ className: "ds-topbar__home",
1107
+ href: S,
1108
+ "aria-label": p.homeTitle(e.name),
1109
+ title: p.homeTitle(e.name),
1110
+ children: e.name
1111
+ }
1112
+ ),
1113
+ e.tagline && /* @__PURE__ */ o("span", { className: "ds-topbar__tagline", children: e.tagline })
1114
+ ] }),
1115
+ /* @__PURE__ */ o("div", { className: "ds-topbar__spacer" }),
1116
+ /* @__PURE__ */ d("div", { className: "ds-topbar__meta", children: [
1117
+ n.branch && /* @__PURE__ */ o("code", { title: p.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
1118
+ n.commit && /* @__PURE__ */ o("code", { title: p.commitTitle(n.commit), children: n.shortCommit }),
1119
+ /* @__PURE__ */ o("code", { title: p.envTitle(n.env), children: n.env })
1120
+ ] }),
1121
+ /* @__PURE__ */ o(
722
1122
  "button",
723
1123
  {
724
1124
  type: "button",
725
- className: "ds-btn ds-btn--ghost",
726
- "aria-pressed": r,
727
- onClick: d,
728
- title: m.toggleNav,
729
- children: "☰"
1125
+ className: "ds-btn ds-btn--icon",
1126
+ "aria-pressed": i === "light",
1127
+ "aria-label": i === "dark" ? p.lightMode : p.darkMode,
1128
+ title: i === "dark" ? p.lightMode : p.darkMode,
1129
+ onClick: c,
1130
+ children: /* @__PURE__ */ o(Je, { theme: i })
730
1131
  }
731
1132
  ),
732
- /* @__PURE__ */ c("div", { className: "ds-topbar__product", children: [
733
- /* @__PURE__ */ a("span", { children: e.name }),
734
- e.tagline && /* @__PURE__ */ a("span", { className: "ds-topbar__tagline", children: e.tagline })
735
- ] }),
736
- /* @__PURE__ */ a("div", { className: "ds-topbar__spacer" }),
737
- /* @__PURE__ */ c("div", { className: "ds-topbar__meta", children: [
738
- n.branch && /* @__PURE__ */ a("code", { title: m.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
739
- n.commit && /* @__PURE__ */ a("code", { title: m.commitTitle(n.commit), children: n.shortCommit }),
740
- /* @__PURE__ */ a("code", { title: m.envTitle(n.env), children: n.env })
741
- ] }),
742
- /* @__PURE__ */ a("button", { type: "button", className: "ds-btn", onClick: g, children: i ? m.copied : m.copyLink }),
743
- /* @__PURE__ */ a(
744
- "button",
1133
+ /* @__PURE__ */ o("button", { type: "button", className: "ds-btn", onClick: b, children: h ? p.copied : p.copyLink }),
1134
+ /* @__PURE__ */ o(
1135
+ "a",
745
1136
  {
746
- type: "button",
747
1137
  className: "ds-btn",
748
- onClick: l,
749
- title: m.cleanReviewTitle,
750
- children: m.cleanReview
1138
+ href: u,
1139
+ target: "_blank",
1140
+ rel: "noreferrer",
1141
+ title: p.cleanReviewTitle,
1142
+ children: p.cleanReview
751
1143
  }
752
1144
  ),
753
- /* @__PURE__ */ a(
1145
+ /* @__PURE__ */ o(
754
1146
  "button",
755
1147
  {
756
1148
  type: "button",
757
1149
  className: "ds-btn",
758
- "aria-pressed": s,
759
- onClick: o,
760
- children: m.panel
1150
+ "aria-pressed": r,
1151
+ onClick: s,
1152
+ children: p.panel
761
1153
  }
762
1154
  )
763
1155
  ] });
764
1156
  }
765
- function De({ registry: e, controls: t, onChange: n }) {
766
- const s = N(), r = s.controls, { product: o } = e, d = o.dataSources?.adapters ?? [], l = o.theme?.modes ?? [], m = o.theme?.locales ?? [];
767
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": r.region, children: [
768
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
769
- /* @__PURE__ */ a("label", { htmlFor: "ds-persona", children: r.persona }),
770
- /* @__PURE__ */ c(
1157
+ function qe(e) {
1158
+ const t = new URL(e);
1159
+ return t.searchParams.set(v.chrome, "0"), t.toString();
1160
+ }
1161
+ function Ye(e, t, n = !1) {
1162
+ const r = new URL("/", e);
1163
+ return t === "light" && r.searchParams.set(v.chromeTheme, t), n && r.searchParams.set(v.showPorted, "1"), r.toString();
1164
+ }
1165
+ function Je({ theme: e }) {
1166
+ const t = {
1167
+ width: 15,
1168
+ height: 15,
1169
+ viewBox: "0 0 24 24",
1170
+ fill: "none",
1171
+ stroke: "currentColor",
1172
+ strokeWidth: 2,
1173
+ strokeLinecap: "round",
1174
+ strokeLinejoin: "round",
1175
+ "aria-hidden": !0
1176
+ };
1177
+ return e === "dark" ? /* @__PURE__ */ d("svg", { ...t, children: [
1178
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "4" }),
1179
+ /* @__PURE__ */ o("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42" })
1180
+ ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
1181
+ }
1182
+ function Qe({
1183
+ registry: e,
1184
+ controls: t,
1185
+ scenarioActive: n,
1186
+ component: r,
1187
+ componentFixture: i,
1188
+ onChange: a
1189
+ }) {
1190
+ const s = A(), c = s.controls, { product: p } = e, h = p.dataSources?.adapters ?? [], m = p.theme?.modes ?? [], b = p.theme?.locales ?? [];
1191
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": c.region, children: [
1192
+ r?.fixtures?.length ? /* @__PURE__ */ d("div", { className: "ds-field", children: [
1193
+ /* @__PURE__ */ o("label", { htmlFor: "ds-component-fixture", children: c.componentFixture }),
1194
+ /* @__PURE__ */ o(
771
1195
  "select",
772
1196
  {
773
- id: "ds-persona",
1197
+ id: "ds-component-fixture",
774
1198
  className: "ds-select",
775
- value: t.persona ?? "",
776
- onChange: (i) => n({ persona: i.target.value || void 0 }),
777
- children: [
778
- /* @__PURE__ */ a("option", { value: "", children: r.none }),
779
- o.personas.map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.name }, i.id))
780
- ]
1199
+ value: i?.fixture?.id ?? "",
1200
+ onChange: (u) => a({ fixture: u.target.value || void 0 }),
1201
+ children: r.fixtures.map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.label }, u.id))
781
1202
  }
782
1203
  )
783
- ] }),
784
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
785
- /* @__PURE__ */ a("label", { htmlFor: "ds-fixture", children: r.fixture }),
786
- /* @__PURE__ */ c(
1204
+ ] }) : null,
1205
+ n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1206
+ /* @__PURE__ */ o("label", { htmlFor: "ds-persona", children: c.persona }),
1207
+ /* @__PURE__ */ d(
787
1208
  "select",
788
1209
  {
789
- id: "ds-fixture",
1210
+ id: "ds-persona",
790
1211
  className: "ds-select",
791
- value: t.fixture ?? "",
792
- onChange: (i) => n({ fixture: i.target.value || void 0 }),
1212
+ value: t.persona ?? "",
1213
+ onChange: (u) => a({ persona: u.target.value || void 0 }),
793
1214
  children: [
794
- /* @__PURE__ */ a("option", { value: "", children: r.none }),
795
- o.fixtures.map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.label }, i.id))
1215
+ /* @__PURE__ */ o("option", { value: "", children: c.none }),
1216
+ p.personas.map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.name }, u.id))
796
1217
  ]
797
1218
  }
798
1219
  )
799
1220
  ] }),
800
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
801
- /* @__PURE__ */ a("span", { className: "ds-field__label", id: "ds-network-label", children: r.network }),
802
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: Y.map((i) => /* @__PURE__ */ a(
1221
+ n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1222
+ /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-network-label", children: c.network }),
1223
+ /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: oe.map((u) => /* @__PURE__ */ o(
803
1224
  "button",
804
1225
  {
805
1226
  type: "button",
806
- "aria-pressed": t.network === i,
807
- onClick: () => n({ network: i }),
808
- children: s.network[i]
1227
+ "aria-pressed": t.network === u,
1228
+ onClick: () => a({ network: u }),
1229
+ children: s.network[u]
809
1230
  },
810
- i
1231
+ u
811
1232
  )) })
812
1233
  ] }),
813
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
814
- /* @__PURE__ */ a("span", { className: "ds-field__label", id: "ds-viewport-label", children: r.viewport }),
815
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: G.map((i) => /* @__PURE__ */ a(
1234
+ /* @__PURE__ */ d("div", { className: "ds-field", children: [
1235
+ /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-viewport-label", children: c.viewport }),
1236
+ /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: ne.map((u) => /* @__PURE__ */ o(
816
1237
  "button",
817
1238
  {
818
1239
  type: "button",
819
- "aria-pressed": t.viewport === i.id,
820
- onClick: () => n({ viewport: i.id }),
821
- children: s.viewport[i.id] ?? i.label
1240
+ className: "ds-icon-button",
1241
+ "aria-pressed": t.viewport === u.id,
1242
+ "aria-label": s.viewport[u.id] ?? u.label,
1243
+ title: s.viewport[u.id] ?? u.label,
1244
+ onClick: () => a({ viewport: u.id }),
1245
+ children: /* @__PURE__ */ o(Xe, { id: u.id })
822
1246
  },
823
- i.id
1247
+ u.id
824
1248
  )) }),
825
- t.viewport === "custom" && /* @__PURE__ */ a(
1249
+ t.viewport === "custom" && /* @__PURE__ */ o(
826
1250
  "input",
827
1251
  {
828
1252
  className: "ds-input",
@@ -831,337 +1255,374 @@ function De({ registry: e, controls: t, onChange: n }) {
831
1255
  max: 3840,
832
1256
  step: 10,
833
1257
  style: { width: 88 },
834
- "aria-label": r.customWidth,
1258
+ "aria-label": c.customWidth,
835
1259
  value: t.customWidth ?? 1024,
836
- onChange: (i) => n({ customWidth: Number(i.target.value) || void 0 })
1260
+ onChange: (u) => a({ customWidth: Number(u.target.value) || void 0 })
837
1261
  }
838
1262
  )
839
1263
  ] }),
840
- l.length > 1 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
841
- /* @__PURE__ */ a("label", { htmlFor: "ds-theme", children: r.theme }),
842
- /* @__PURE__ */ a(
1264
+ m.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1265
+ /* @__PURE__ */ o("label", { htmlFor: "ds-theme", children: c.theme }),
1266
+ /* @__PURE__ */ o(
843
1267
  "select",
844
1268
  {
845
1269
  id: "ds-theme",
846
1270
  className: "ds-select",
847
- value: t.themeMode ?? l[0],
848
- onChange: (i) => n({ themeMode: i.target.value }),
849
- children: l.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1271
+ value: t.themeMode ?? m[0],
1272
+ onChange: (u) => a({ themeMode: u.target.value }),
1273
+ children: m.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
850
1274
  }
851
1275
  )
852
1276
  ] }),
853
- m.length > 1 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
854
- /* @__PURE__ */ a("label", { htmlFor: "ds-locale", children: r.locale }),
855
- /* @__PURE__ */ a(
1277
+ b.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1278
+ /* @__PURE__ */ o("label", { htmlFor: "ds-locale", children: c.locale }),
1279
+ /* @__PURE__ */ o(
856
1280
  "select",
857
1281
  {
858
1282
  id: "ds-locale",
859
1283
  className: "ds-select",
860
- value: t.locale ?? m[0],
861
- onChange: (i) => n({ locale: i.target.value }),
862
- children: m.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1284
+ value: t.locale ?? b[0],
1285
+ onChange: (u) => a({ locale: u.target.value }),
1286
+ children: b.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
863
1287
  }
864
1288
  )
865
1289
  ] }),
866
- d.length > 0 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
867
- /* @__PURE__ */ a("label", { htmlFor: "ds-source", children: r.dataSource }),
868
- /* @__PURE__ */ c(
1290
+ n && h.length > 0 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1291
+ /* @__PURE__ */ o("label", { htmlFor: "ds-source", children: c.dataSource }),
1292
+ /* @__PURE__ */ d(
869
1293
  "select",
870
1294
  {
871
1295
  id: "ds-source",
872
1296
  className: "ds-select",
873
1297
  value: t.dataSource ?? "fixtures",
874
- onChange: (i) => n({ dataSource: i.target.value }),
1298
+ onChange: (u) => a({ dataSource: u.target.value }),
875
1299
  children: [
876
- /* @__PURE__ */ a("option", { value: "fixtures", children: r.fixturesOption }),
877
- d.filter((i) => i.id !== "fixtures").map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.label }, i.id))
1300
+ /* @__PURE__ */ o("option", { value: "fixtures", children: c.fixturesOption }),
1301
+ h.filter((u) => u.id !== "fixtures").map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.label }, u.id))
878
1302
  ]
879
1303
  }
880
1304
  )
881
- ] }),
882
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
883
- /* @__PURE__ */ a("span", { className: "ds-field__label", children: r.a11y }),
884
- /* @__PURE__ */ a(
885
- "button",
886
- {
887
- type: "button",
888
- className: "ds-btn",
889
- "aria-pressed": t.keyboardMode,
890
- onClick: () => n({ keyboardMode: !t.keyboardMode }),
891
- title: r.keyboardModeTitle,
892
- children: r.keyboardMode
893
- }
894
- ),
895
- /* @__PURE__ */ a(
896
- "button",
897
- {
898
- type: "button",
899
- className: "ds-btn",
900
- "aria-pressed": t.reducedMotion,
901
- onClick: () => n({ reducedMotion: !t.reducedMotion }),
902
- title: r.reducedMotionTitle,
903
- children: r.reducedMotion
904
- }
905
- ),
906
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-label": r.textScale, children: Q.map((i) => /* @__PURE__ */ a(
907
- "button",
908
- {
909
- type: "button",
910
- "aria-pressed": t.textScale === i,
911
- onClick: () => n({ textScale: i }),
912
- children: i === 1 ? "100%" : `${i * 100}%`
913
- },
914
- i
915
- )) })
916
1305
  ] })
917
1306
  ] });
918
1307
  }
919
- function Be({
1308
+ function Xe({ id: e }) {
1309
+ const t = {
1310
+ width: 16,
1311
+ height: 16,
1312
+ viewBox: "0 0 24 24",
1313
+ fill: "none",
1314
+ stroke: "currentColor",
1315
+ strokeWidth: 2,
1316
+ strokeLinecap: "round",
1317
+ strokeLinejoin: "round",
1318
+ "aria-hidden": !0
1319
+ };
1320
+ return e === "fit" ? /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3" }) }) : e === "mobile" ? /* @__PURE__ */ d("svg", { ...t, children: [
1321
+ /* @__PURE__ */ o("rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }),
1322
+ /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1323
+ ] }) : e === "tablet" ? /* @__PURE__ */ d("svg", { ...t, children: [
1324
+ /* @__PURE__ */ o("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2" }),
1325
+ /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1326
+ ] }) : e === "desktop" ? /* @__PURE__ */ d("svg", { ...t, children: [
1327
+ /* @__PURE__ */ o("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1328
+ /* @__PURE__ */ o("path", { d: "M8 21h8M12 17v4" })
1329
+ ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
1330
+ }
1331
+ function Ze({
920
1332
  registry: e,
921
1333
  scenario: t,
922
- controls: n,
923
- focusedNode: s,
924
- tabStopCount: r
1334
+ component: n,
1335
+ componentFixture: r,
1336
+ controls: i,
1337
+ focusedNode: a,
1338
+ tabStopCount: s
925
1339
  }) {
926
- const o = N().inspector, [d, l] = x("scenario"), m = e.issues.filter((i) => i.level === "error").length;
927
- return /* @__PURE__ */ c("aside", { className: "ds-chrome ds-inspector", "aria-label": o.region, children: [
928
- /* @__PURE__ */ c("div", { className: "ds-inspector__tabs", role: "tablist", children: [
929
- /* @__PURE__ */ a(F, { id: "scenario", current: d, onSelect: l, children: o.tabScenario }),
930
- /* @__PURE__ */ a(F, { id: "a11y", current: d, onSelect: l, children: o.tabA11y }),
931
- /* @__PURE__ */ a(F, { id: "diagnostics", current: d, onSelect: l, children: m > 0 ? o.diagnosticsWithErrors(m) : o.tabDiagnostics })
1340
+ const c = A().inspector, [p, h] = F("scenario"), m = e.issues.filter((b) => b.level === "error").length;
1341
+ return /* @__PURE__ */ d("aside", { className: "ds-chrome ds-inspector", "aria-label": c.region, children: [
1342
+ /* @__PURE__ */ d("div", { className: "ds-inspector__tabs", role: "tablist", children: [
1343
+ /* @__PURE__ */ o(V, { id: "scenario", current: p, onSelect: h, children: n ? c.componentReference : c.tabScenario }),
1344
+ /* @__PURE__ */ o(V, { id: "a11y", current: p, onSelect: h, children: c.tabA11y }),
1345
+ /* @__PURE__ */ o(V, { id: "diagnostics", current: p, onSelect: h, children: m > 0 ? c.diagnosticsWithErrors(m) : c.tabDiagnostics })
932
1346
  ] }),
933
- /* @__PURE__ */ c("div", { className: "ds-inspector__body", role: "tabpanel", children: [
934
- d === "scenario" && /* @__PURE__ */ a(We, { registry: e, scenario: t, controls: n }),
935
- d === "a11y" && /* @__PURE__ */ a(
936
- je,
1347
+ /* @__PURE__ */ d("div", { className: "ds-inspector__body", role: "tabpanel", children: [
1348
+ p === "scenario" && /* @__PURE__ */ o(
1349
+ et,
937
1350
  {
938
1351
  registry: e,
939
1352
  scenario: t,
940
- focusedNode: s,
941
- keyboardMode: n.keyboardMode,
942
- tabStopCount: r
1353
+ component: n,
1354
+ componentFixture: r,
1355
+ controls: i
943
1356
  }
944
1357
  ),
945
- d === "diagnostics" && /* @__PURE__ */ a(He, { registry: e })
1358
+ p === "a11y" && /* @__PURE__ */ o(
1359
+ tt,
1360
+ {
1361
+ registry: e,
1362
+ scenario: t,
1363
+ focusedNode: a,
1364
+ keyboardMode: i.keyboardMode,
1365
+ tabStopCount: s
1366
+ }
1367
+ ),
1368
+ p === "diagnostics" && /* @__PURE__ */ o(ot, { registry: e })
946
1369
  ] })
947
1370
  ] });
948
1371
  }
949
- function F({
1372
+ function V({
950
1373
  id: e,
951
1374
  current: t,
952
1375
  onSelect: n,
953
- children: s
1376
+ children: r
954
1377
  }) {
955
- return /* @__PURE__ */ a(
1378
+ return /* @__PURE__ */ o(
956
1379
  "button",
957
1380
  {
958
1381
  type: "button",
959
1382
  role: "tab",
960
1383
  "aria-selected": t === e,
961
1384
  onClick: () => n(e),
962
- children: s
1385
+ children: r
963
1386
  }
964
1387
  );
965
1388
  }
966
- function We({
1389
+ function et({
967
1390
  registry: e,
968
1391
  scenario: t,
969
- controls: n
1392
+ component: n,
1393
+ componentFixture: r,
1394
+ controls: i
970
1395
  }) {
971
- const s = N(), r = s.inspector;
1396
+ const a = A(), s = a.inspector;
972
1397
  if (!t)
973
- return /* @__PURE__ */ a("p", { className: "ds-block", children: r.noScenario });
974
- const o = e.persona(n.persona ?? t.persona), d = n.persona ? e.persona(n.persona)?.permissions ?? [] : e.permissionsOf(t), l = e.rulesOf(t), m = e.fixture(n.fixture ?? t.fixture), i = !!(n.persona && n.persona !== t.persona);
975
- return /* @__PURE__ */ c(M, { children: [
976
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
977
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.situation }),
978
- /* @__PURE__ */ a("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
979
- t.intent && /* @__PURE__ */ a("p", { children: t.intent }),
980
- /* @__PURE__ */ c("div", { className: "ds-chips", children: [
981
- /* @__PURE__ */ a("span", { className: "ds-chip", "data-tone": ze(t.status), children: s.status[t.status] }),
982
- (t.tags ?? []).map((p) => /* @__PURE__ */ a("span", { className: "ds-chip", children: p }, p))
1398
+ return n ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1399
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.componentReference }),
1400
+ /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: n.name }),
1401
+ n.description && /* @__PURE__ */ o("p", { children: n.description }),
1402
+ /* @__PURE__ */ d("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
1403
+ /* @__PURE__ */ o("dt", { children: s.id }),
1404
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.id }),
1405
+ n.group && /* @__PURE__ */ d(P, { children: [
1406
+ /* @__PURE__ */ o("dt", { children: s.componentGroup }),
1407
+ /* @__PURE__ */ o("dd", { children: n.group })
1408
+ ] }),
1409
+ r?.fixture && /* @__PURE__ */ d(P, { children: [
1410
+ /* @__PURE__ */ o("dt", { children: s.componentFixture }),
1411
+ /* @__PURE__ */ d("dd", { children: [
1412
+ r.fixture.label,
1413
+ " ",
1414
+ /* @__PURE__ */ o("code", { children: r.fixture.id })
1415
+ ] }),
1416
+ r.fixture.description && /* @__PURE__ */ d(P, { children: [
1417
+ /* @__PURE__ */ o("dt", { children: s.componentFixtureDescription }),
1418
+ /* @__PURE__ */ o("dd", { children: r.fixture.description })
1419
+ ] })
1420
+ ] })
1421
+ ] }),
1422
+ r?.didFallback && r.fixture && /* @__PURE__ */ o("p", { className: "ds-note", "data-tone": "warn", children: s.componentFixtureFallback(
1423
+ r.requestedId ?? "",
1424
+ r.fixture.id
1425
+ ) })
1426
+ ] }) : /* @__PURE__ */ o("p", { className: "ds-block", children: s.noScenario });
1427
+ const c = e.persona(i.persona ?? t.persona), p = i.persona ? e.persona(i.persona)?.permissions ?? [] : e.permissionsOf(t), h = e.rulesOf(t), m = e.fixture(i.fixture ?? t.fixture), b = !!(i.persona && i.persona !== t.persona);
1428
+ return /* @__PURE__ */ d(P, { children: [
1429
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1430
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.situation }),
1431
+ /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
1432
+ t.intent && /* @__PURE__ */ o("p", { children: t.intent }),
1433
+ /* @__PURE__ */ d("div", { className: "ds-chips", children: [
1434
+ /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": at(t.status), children: a.status[t.status] }),
1435
+ (t.tags ?? []).map((u) => /* @__PURE__ */ o("span", { className: "ds-chip", children: u }, u))
983
1436
  ] }),
984
- /* @__PURE__ */ a("p", { style: { marginTop: 6 }, children: s.statusMeaning[t.status] })
1437
+ /* @__PURE__ */ o("p", { style: { marginTop: 6 }, children: a.statusMeaning[t.status] })
985
1438
  ] }),
986
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
987
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.reproduction }),
988
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
989
- /* @__PURE__ */ a("dt", { children: r.id }),
990
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
991
- /* @__PURE__ */ a("dt", { children: r.route }),
992
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
993
- /* @__PURE__ */ a("dt", { children: r.persona }),
994
- /* @__PURE__ */ c("dd", { children: [
995
- o?.name ?? "—",
996
- i && /* @__PURE__ */ a("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: r.personaSwapped })
1439
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1440
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.reproduction }),
1441
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1442
+ /* @__PURE__ */ o("dt", { children: s.id }),
1443
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
1444
+ /* @__PURE__ */ o("dt", { children: s.route }),
1445
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
1446
+ /* @__PURE__ */ o("dt", { children: s.persona }),
1447
+ /* @__PURE__ */ d("dd", { children: [
1448
+ c?.name ?? "—",
1449
+ b && /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: s.personaSwapped })
997
1450
  ] }),
998
- /* @__PURE__ */ a("dt", { children: r.data }),
999
- /* @__PURE__ */ a("dd", { children: m?.label ?? "—" }),
1000
- /* @__PURE__ */ a("dt", { children: r.network }),
1001
- /* @__PURE__ */ a("dd", { children: s.network[n.network] })
1451
+ /* @__PURE__ */ o("dt", { children: s.data }),
1452
+ /* @__PURE__ */ o("dd", { children: m?.label ?? "—" }),
1453
+ /* @__PURE__ */ o("dt", { children: s.network }),
1454
+ /* @__PURE__ */ o("dd", { children: a.network[i.network] })
1002
1455
  ] }),
1003
- o?.goal && /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: r.goal(o.goal) })
1456
+ c?.goal && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.goal(c.goal) })
1004
1457
  ] }),
1005
- d.length > 0 && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1006
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.permissions }),
1007
- /* @__PURE__ */ a("div", { className: "ds-chips", children: d.map((p) => /* @__PURE__ */ a("span", { className: "ds-chip", children: p }, p)) })
1458
+ p.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1459
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.permissions }),
1460
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: p.map((u) => /* @__PURE__ */ o("span", { className: "ds-chip", children: u }, u)) })
1008
1461
  ] }),
1009
- t.preconditions?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1010
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.preconditions }),
1011
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.preconditions.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1462
+ t.preconditions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1463
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.preconditions }),
1464
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.preconditions.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
1012
1465
  ] }) : null,
1013
- l.length > 0 && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1014
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.rules }),
1015
- l.map((p) => /* @__PURE__ */ c("div", { className: "ds-rule", children: [
1016
- /* @__PURE__ */ a("span", { className: "ds-rule__id", children: p.id }),
1017
- /* @__PURE__ */ a("span", { className: "ds-rule__statement", children: p.statement }),
1018
- p.rationale && /* @__PURE__ */ a("p", { className: "ds-rule__rationale", children: p.rationale })
1019
- ] }, p.id))
1466
+ h.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1467
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.rules }),
1468
+ h.map((u) => /* @__PURE__ */ d("div", { className: "ds-rule", children: [
1469
+ /* @__PURE__ */ o("span", { className: "ds-rule__id", children: u.id }),
1470
+ /* @__PURE__ */ o("span", { className: "ds-rule__statement", children: u.statement }),
1471
+ u.rationale && /* @__PURE__ */ o("p", { className: "ds-rule__rationale", children: u.rationale })
1472
+ ] }, u.id))
1020
1473
  ] }),
1021
- t.actions?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1022
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.actions }),
1023
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.actions.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1474
+ t.actions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1475
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.actions }),
1476
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.actions.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
1024
1477
  ] }) : null,
1025
- t.expected?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1026
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.expected }),
1027
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.expected.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1478
+ t.expected?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1479
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.expected }),
1480
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.expected.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
1028
1481
  ] }) : null,
1029
- t.approvedAt && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1030
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.approval }),
1031
- /* @__PURE__ */ c("p", { children: [
1482
+ t.approvedAt && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1483
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.approval }),
1484
+ /* @__PURE__ */ d("p", { children: [
1032
1485
  t.approvedAt.date,
1033
1486
  " · ",
1034
- /* @__PURE__ */ a("code", { children: t.approvedAt.commit.slice(0, 7) })
1487
+ /* @__PURE__ */ o("code", { children: t.approvedAt.commit.slice(0, 7) })
1035
1488
  ] }),
1036
- /* @__PURE__ */ a("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: r.openApproved })
1489
+ /* @__PURE__ */ o("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: s.openApproved })
1037
1490
  ] }),
1038
- t.ticket && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1039
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.engineering }),
1040
- /* @__PURE__ */ a("p", { children: t.ticket })
1491
+ t.ticket && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1492
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.engineering }),
1493
+ /* @__PURE__ */ o("p", { children: t.ticket })
1041
1494
  ] })
1042
1495
  ] });
1043
1496
  }
1044
- function je({
1497
+ function tt({
1045
1498
  registry: e,
1046
1499
  scenario: t,
1047
1500
  focusedNode: n,
1048
- keyboardMode: s,
1049
- tabStopCount: r
1501
+ keyboardMode: r,
1502
+ tabStopCount: i
1050
1503
  }) {
1051
- const o = N(), d = o.inspector, l = de(e.product.theme?.contrastPairs), m = l.filter((i) => i.passes !== !0);
1052
- return /* @__PURE__ */ c(M, { children: [
1053
- t && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1054
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.a11yContract }),
1055
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
1056
- /* @__PURE__ */ a("dt", { children: d.keyboard }),
1057
- /* @__PURE__ */ a("dd", { children: o.keyboard[t.a11y.keyboard] }),
1058
- /* @__PURE__ */ a("dt", { children: d.contrast }),
1059
- /* @__PURE__ */ a("dd", { children: d.contrastTarget(t.a11y.contrast) })
1504
+ const a = A(), s = a.inspector, c = he(e.product.theme?.contrastPairs), p = c.filter((h) => h.passes !== !0);
1505
+ return /* @__PURE__ */ d(P, { children: [
1506
+ t && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1507
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.a11yContract }),
1508
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1509
+ /* @__PURE__ */ o("dt", { children: s.keyboard }),
1510
+ /* @__PURE__ */ o("dd", { children: a.keyboard[t.a11y.keyboard] }),
1511
+ /* @__PURE__ */ o("dt", { children: s.contrast }),
1512
+ /* @__PURE__ */ o("dd", { children: s.contrastTarget(t.a11y.contrast) })
1060
1513
  ] }),
1061
- t.a11y.announces?.length ? /* @__PURE__ */ c(M, { children: [
1062
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: d.announces }),
1063
- /* @__PURE__ */ a("div", { className: "ds-chips", children: t.a11y.announces.map((i) => /* @__PURE__ */ a("span", { className: "ds-chip", children: i }, i)) })
1514
+ t.a11y.announces?.length ? /* @__PURE__ */ d(P, { children: [
1515
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.announces }),
1516
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: t.a11y.announces.map((h) => /* @__PURE__ */ o("span", { className: "ds-chip", children: h }, h)) })
1064
1517
  ] }) : null,
1065
- t.a11y.notes && /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: t.a11y.notes })
1518
+ t.a11y.notes && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: t.a11y.notes })
1066
1519
  ] }),
1067
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1068
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.focusedElement }),
1069
- s ? n ? /* @__PURE__ */ c(M, { children: [
1070
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
1071
- /* @__PURE__ */ a("dt", { children: d.role }),
1072
- /* @__PURE__ */ a("dd", { children: n.role }),
1073
- /* @__PURE__ */ a("dt", { children: d.name }),
1074
- /* @__PURE__ */ a("dd", { children: n.name ? n.name : /* @__PURE__ */ a("span", { style: { color: "var(--ds-err)" }, children: d.noAccessibleName }) }),
1075
- /* @__PURE__ */ a("dt", { children: d.nameFrom }),
1076
- /* @__PURE__ */ a("dd", { children: n.nameFrom }),
1077
- n.description ? /* @__PURE__ */ c(M, { children: [
1078
- /* @__PURE__ */ a("dt", { children: d.description }),
1079
- /* @__PURE__ */ a("dd", { children: n.description })
1520
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1521
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.focusedElement }),
1522
+ r ? n ? /* @__PURE__ */ d(P, { children: [
1523
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1524
+ /* @__PURE__ */ o("dt", { children: s.role }),
1525
+ /* @__PURE__ */ o("dd", { children: n.role }),
1526
+ /* @__PURE__ */ o("dt", { children: s.name }),
1527
+ /* @__PURE__ */ o("dd", { children: n.name ? n.name : /* @__PURE__ */ o("span", { style: { color: "var(--ds-err)" }, children: s.noAccessibleName }) }),
1528
+ /* @__PURE__ */ o("dt", { children: s.nameFrom }),
1529
+ /* @__PURE__ */ o("dd", { children: n.nameFrom }),
1530
+ n.description ? /* @__PURE__ */ d(P, { children: [
1531
+ /* @__PURE__ */ o("dt", { children: s.description }),
1532
+ /* @__PURE__ */ o("dd", { children: n.description })
1080
1533
  ] }) : null,
1081
- /* @__PURE__ */ a("dt", { children: d.selector }),
1082
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
1534
+ /* @__PURE__ */ o("dt", { children: s.selector }),
1535
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
1083
1536
  ] }),
1084
- n.states.length > 0 && /* @__PURE__ */ a("div", { className: "ds-chips", style: { marginTop: 8 }, children: n.states.map((i) => /* @__PURE__ */ a("span", { className: "ds-chip", children: i }, i)) }),
1085
- n.hiddenFromAssistiveTech && /* @__PURE__ */ a("p", { className: "ds-note", style: { marginTop: 8 }, children: d.focusableButHidden }),
1086
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: d.tabStopsInStage(r) })
1087
- ] }) : /* @__PURE__ */ a("p", { children: d.pressTab(r) }) : /* @__PURE__ */ a("p", { children: d.keyboardModeOff })
1537
+ n.states.length > 0 && /* @__PURE__ */ o("div", { className: "ds-chips", style: { marginTop: 8 }, children: n.states.map((h) => /* @__PURE__ */ o("span", { className: "ds-chip", children: h }, h)) }),
1538
+ n.hiddenFromAssistiveTech && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: s.focusableButHidden }),
1539
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.tabStopsInStage(i) })
1540
+ ] }) : /* @__PURE__ */ o("p", { children: s.pressTab(i) }) : /* @__PURE__ */ o("p", { children: s.keyboardModeOff })
1088
1541
  ] }),
1089
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1090
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.tokenContrast }),
1091
- l.length === 0 ? /* @__PURE__ */ a("p", { children: d.noContrastPairs }) : /* @__PURE__ */ c("table", { className: "ds-contrast", children: [
1092
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ c("tr", { children: [
1093
- /* @__PURE__ */ a("th", { scope: "col", children: d.pair }),
1094
- /* @__PURE__ */ a("th", { scope: "col", children: d.ratio })
1542
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1543
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.tokenContrast }),
1544
+ c.length === 0 ? /* @__PURE__ */ o("p", { children: s.noContrastPairs }) : /* @__PURE__ */ d("table", { className: "ds-contrast", children: [
1545
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ d("tr", { children: [
1546
+ /* @__PURE__ */ o("th", { scope: "col", children: s.pair }),
1547
+ /* @__PURE__ */ o("th", { scope: "col", children: s.ratio })
1095
1548
  ] }) }),
1096
- /* @__PURE__ */ a("tbody", { children: l.map((i) => /* @__PURE__ */ c("tr", { children: [
1097
- /* @__PURE__ */ c("td", { children: [
1098
- /* @__PURE__ */ a(
1549
+ /* @__PURE__ */ o("tbody", { children: c.map((h) => /* @__PURE__ */ d("tr", { children: [
1550
+ /* @__PURE__ */ d("td", { children: [
1551
+ /* @__PURE__ */ o(
1099
1552
  "span",
1100
1553
  {
1101
1554
  className: "ds-swatch",
1102
- style: { background: i.pair.background },
1555
+ style: { background: h.pair.background },
1103
1556
  "aria-hidden": "true"
1104
1557
  }
1105
1558
  ),
1106
- /* @__PURE__ */ a(
1559
+ /* @__PURE__ */ o(
1107
1560
  "span",
1108
1561
  {
1109
1562
  className: "ds-swatch",
1110
- style: { background: i.pair.foreground },
1563
+ style: { background: h.pair.foreground },
1111
1564
  "aria-hidden": "true"
1112
1565
  }
1113
1566
  ),
1114
- i.pair.name
1567
+ h.pair.name
1115
1568
  ] }),
1116
- /* @__PURE__ */ a(
1569
+ /* @__PURE__ */ o(
1117
1570
  "td",
1118
1571
  {
1119
1572
  style: {
1120
- color: i.passes === !0 ? "var(--ds-ok)" : i.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1573
+ color: h.passes === !0 ? "var(--ds-ok)" : h.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1121
1574
  },
1122
- children: i.label
1575
+ children: h.label
1123
1576
  }
1124
1577
  )
1125
- ] }, i.pair.name)) })
1578
+ ] }, h.pair.name)) })
1126
1579
  ] }),
1127
- m.length > 0 && /* @__PURE__ */ a("p", { className: "ds-note", style: { marginTop: 8 }, children: d.pairsFailing(m.length) })
1580
+ p.length > 0 && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: s.pairsFailing(p.length) })
1128
1581
  ] }),
1129
- /* @__PURE__ */ a("p", { className: "ds-note", children: d.automatedIsFloor })
1582
+ /* @__PURE__ */ o("p", { className: "ds-note", children: s.automatedIsFloor })
1130
1583
  ] });
1131
1584
  }
1132
- function He({ registry: e }) {
1133
- const t = N(), n = t.inspector, s = e.coverage(), { issues: r } = e;
1134
- return /* @__PURE__ */ c(M, { children: [
1135
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1136
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: n.coverage }),
1137
- /* @__PURE__ */ a("dl", { className: "ds-kv", children: Object.entries(s).filter(([, o]) => o > 0).map(([o, d]) => /* @__PURE__ */ c("div", { style: { display: "contents" }, children: [
1138
- /* @__PURE__ */ a("dt", { children: t.status[o] }),
1139
- /* @__PURE__ */ a("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: d })
1140
- ] }, o)) }),
1141
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
1585
+ function ot({ registry: e }) {
1586
+ const t = A(), n = t.inspector, r = e.coverage({ includePorted: !0 }), { issues: i } = e;
1587
+ return /* @__PURE__ */ d(P, { children: [
1588
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1589
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.coverage }),
1590
+ /* @__PURE__ */ o("dl", { className: "ds-kv", children: Object.entries(r).filter(([, a]) => a > 0).map(([a, s]) => /* @__PURE__ */ d("div", { style: { display: "contents" }, children: [
1591
+ /* @__PURE__ */ o("dt", { children: t.status[a] }),
1592
+ /* @__PURE__ */ o("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: s })
1593
+ ] }, a)) }),
1594
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
1142
1595
  ] }),
1143
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1144
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: n.scenarioContract }),
1145
- r.length === 0 ? /* @__PURE__ */ a("p", { children: n.noIssues }) : r.map((o, d) => /* @__PURE__ */ c("div", { className: "ds-issue", "data-level": o.level, children: [
1146
- /* @__PURE__ */ a("span", { className: "ds-issue__where", children: o.where }),
1147
- o.message
1148
- ] }, `${o.where}-${d}`))
1596
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1597
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.scenarioContract }),
1598
+ i.length === 0 ? /* @__PURE__ */ o("p", { children: n.noIssues }) : i.map((a, s) => /* @__PURE__ */ d("div", { className: "ds-issue", "data-level": a.level, children: [
1599
+ /* @__PURE__ */ o("span", { className: "ds-issue__where", children: a.where }),
1600
+ a.message
1601
+ ] }, `${a.where}-${s}`))
1149
1602
  ] })
1150
1603
  ] });
1151
1604
  }
1152
- function ze(e) {
1153
- if (e === "approved" || e === "implemented") return "ok";
1154
- if (e === "in-review" || e === "proposed") return "warn";
1605
+ const nt = {
1606
+ ported: void 0,
1607
+ proposed: "warn",
1608
+ "in-review": "warn",
1609
+ approved: "ok",
1610
+ "in-implementation": void 0,
1611
+ implemented: "ok",
1612
+ superseded: void 0
1613
+ };
1614
+ function at(e) {
1615
+ return nt[e];
1155
1616
  }
1156
- const Ue = re(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMode: r, children: o }, d) {
1157
- return /* @__PURE__ */ a("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ a(
1617
+ const rt = ce(function({ viewport: t, textScale: n, reducedMotion: r, keyboardMode: i, children: a }, s) {
1618
+ return /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
1158
1619
  "div",
1159
1620
  {
1160
- ref: d,
1621
+ ref: s,
1161
1622
  className: "ds-stage",
1162
1623
  "data-viewport": t.id,
1163
- "data-keyboard-mode": r,
1164
- "data-reduced-motion": s,
1624
+ "data-keyboard-mode": i,
1625
+ "data-reduced-motion": r,
1165
1626
  style: {
1166
1627
  width: t.width ? `${t.width}px` : "100%",
1167
1628
  minHeight: t.height ? `${t.height}px` : void 0,
@@ -1170,12 +1631,12 @@ const Ue = re(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMo
1170
1631
  // texto grande e só dar zoom na captura de tela.
1171
1632
  fontSize: n === 1 ? void 0 : `${n * 100}%`
1172
1633
  },
1173
- children: o
1634
+ children: a
1174
1635
  }
1175
1636
  ) });
1176
1637
  });
1177
- function Ke({ stops: e }) {
1178
- return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ a(
1638
+ function st({ stops: e }) {
1639
+ return e.length === 0 ? null : /* @__PURE__ */ o("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ o(
1179
1640
  "span",
1180
1641
  {
1181
1642
  className: "ds-taborder__badge",
@@ -1186,42 +1647,44 @@ function Ke({ stops: e }) {
1186
1647
  `${t.index}-${t.rect.top}-${t.rect.left}`
1187
1648
  )) });
1188
1649
  }
1189
- function Ve({ title: e, children: t }) {
1190
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-stage-empty", children: [
1191
- /* @__PURE__ */ a("h2", { children: e }),
1650
+ function it({ title: e, children: t }) {
1651
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-stage-empty", children: [
1652
+ /* @__PURE__ */ o("h2", { children: e }),
1192
1653
  t
1193
1654
  ] });
1194
1655
  }
1195
- function qe({ registry: e, onOpenScenario: t }) {
1196
- const n = N(), { product: s } = e, r = e.coverage(), o = s.scenarios.length;
1197
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-home", children: [
1198
- /* @__PURE__ */ c("header", { className: "ds-home__header", children: [
1199
- /* @__PURE__ */ a("h1", { children: s.name }),
1200
- s.tagline && /* @__PURE__ */ a("p", { className: "ds-home__tagline", children: s.tagline }),
1201
- /* @__PURE__ */ a("p", { className: "ds-home__lead", children: n.home.lead(o) }),
1202
- /* @__PURE__ */ a("div", { className: "ds-chips", children: Object.entries(r).filter(([, d]) => d > 0).map(([d, l]) => /* @__PURE__ */ c("span", { className: "ds-chip", children: [
1203
- n.status[d],
1656
+ function ct({ registry: e, onOpenScenario: t, showPorted: n = !1 }) {
1657
+ const r = A(), { product: i } = e, a = { includePorted: n }, s = e.coverage(a), c = e.activeScenarios(a).length, p = e.treeFor(a).filter((m) => m.scenarios.length > 0), h = e.orphansFor(a);
1658
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-home", children: [
1659
+ /* @__PURE__ */ d("header", { className: "ds-home__header", children: [
1660
+ /* @__PURE__ */ o("h1", { children: i.name }),
1661
+ i.tagline && /* @__PURE__ */ o("p", { className: "ds-home__tagline", children: i.tagline }),
1662
+ /* @__PURE__ */ o("p", { className: "ds-home__lead", children: r.home.lead(c) }),
1663
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: Object.entries(s).filter(([, m]) => m > 0).map(([m, b]) => /* @__PURE__ */ d("span", { className: "ds-chip", children: [
1664
+ r.status[m],
1204
1665
  ": ",
1205
- l
1206
- ] }, d)) })
1666
+ b
1667
+ ] }, m)) })
1207
1668
  ] }),
1208
- e.tree.map(({ module: d, scenarios: l }) => /* @__PURE__ */ a(
1209
- Ye,
1669
+ c === 0 && /* @__PURE__ */ o("p", { className: "ds-home__empty", children: r.home.noActiveWork }),
1670
+ p.map(({ module: m, scenarios: b }) => /* @__PURE__ */ o(
1671
+ dt,
1210
1672
  {
1211
- module: d,
1212
- scenarios: l,
1673
+ module: m,
1674
+ scenarios: b,
1213
1675
  registry: e,
1676
+ showPorted: n,
1214
1677
  onOpenScenario: t
1215
1678
  },
1216
- d.id
1679
+ m.id
1217
1680
  )),
1218
- e.orphans.length > 0 && /* @__PURE__ */ c("section", { className: "ds-home__module", children: [
1219
- /* @__PURE__ */ a("h2", { children: n.home.withoutModule }),
1220
- /* @__PURE__ */ a("p", { className: "ds-home__hint", children: n.home.withoutModuleHint }),
1221
- /* @__PURE__ */ a(
1222
- X,
1681
+ h.length > 0 && /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
1682
+ /* @__PURE__ */ o("h2", { children: r.home.withoutModule }),
1683
+ /* @__PURE__ */ o("p", { className: "ds-home__hint", children: r.home.withoutModuleHint }),
1684
+ /* @__PURE__ */ o(
1685
+ re,
1223
1686
  {
1224
- scenarios: e.orphans,
1687
+ scenarios: h,
1225
1688
  registry: e,
1226
1689
  onOpenScenario: t
1227
1690
  }
@@ -1229,202 +1692,260 @@ function qe({ registry: e, onOpenScenario: t }) {
1229
1692
  ] })
1230
1693
  ] });
1231
1694
  }
1232
- function Ye({
1695
+ function dt({
1233
1696
  module: e,
1234
1697
  scenarios: t,
1235
1698
  registry: n,
1236
- onOpenScenario: s
1699
+ showPorted: r,
1700
+ onOpenScenario: i
1237
1701
  }) {
1238
- return /* @__PURE__ */ c("section", { className: "ds-home__module", children: [
1239
- /* @__PURE__ */ a("h2", { children: e.name }),
1240
- e.description && /* @__PURE__ */ a("p", { className: "ds-home__hint", children: e.description }),
1241
- (e.flows ?? []).map((r) => /* @__PURE__ */ a(Ge, { flow: r, registry: n, onOpenScenario: s }, r.id)),
1242
- /* @__PURE__ */ a(X, { scenarios: t, registry: n, onOpenScenario: s })
1702
+ return /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
1703
+ /* @__PURE__ */ o("h2", { children: e.name }),
1704
+ e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1705
+ (e.flows ?? []).map((a) => /* @__PURE__ */ o(
1706
+ lt,
1707
+ {
1708
+ flow: a,
1709
+ registry: n,
1710
+ showPorted: r,
1711
+ onOpenScenario: i
1712
+ },
1713
+ a.id
1714
+ )),
1715
+ /* @__PURE__ */ o(re, { scenarios: t, registry: n, onOpenScenario: i })
1243
1716
  ] });
1244
1717
  }
1245
- function Ge({
1718
+ function lt({
1246
1719
  flow: e,
1247
1720
  registry: t,
1248
- onOpenScenario: n
1721
+ showPorted: n,
1722
+ onOpenScenario: r
1249
1723
  }) {
1250
- return /* @__PURE__ */ c("div", { className: "ds-flow", children: [
1251
- /* @__PURE__ */ a("h3", { children: e.title }),
1252
- e.description && /* @__PURE__ */ a("p", { className: "ds-home__hint", children: e.description }),
1253
- /* @__PURE__ */ a("ol", { className: "ds-flow__steps", children: e.steps.map((s, r) => {
1254
- const o = t.scenario(s.scenario), d = Object.entries(s.branches ?? {});
1255
- return /* @__PURE__ */ c("li", { children: [
1256
- /* @__PURE__ */ a("button", { type: "button", className: "ds-flow__step", onClick: () => n(s.scenario), children: s.label ?? o?.title ?? s.scenario }),
1257
- s.decision && /* @__PURE__ */ a("p", { className: "ds-flow__decision", children: s.decision }),
1258
- d.length > 0 && /* @__PURE__ */ a("ul", { className: "ds-flow__branches", children: d.map(([l, m]) => /* @__PURE__ */ c("li", { children: [
1259
- /* @__PURE__ */ a("span", { className: "ds-flow__branch-label", children: l }),
1260
- /* @__PURE__ */ a(
1724
+ const i = e.steps.filter((a) => {
1725
+ const s = t.scenario(a.scenario);
1726
+ return s && (n || s.status !== "ported");
1727
+ });
1728
+ return i.length === 0 ? null : /* @__PURE__ */ d("div", { className: "ds-flow", children: [
1729
+ /* @__PURE__ */ o("h3", { children: e.title }),
1730
+ e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1731
+ /* @__PURE__ */ o("ol", { className: "ds-flow__steps", children: i.map((a, s) => {
1732
+ const c = t.scenario(a.scenario), p = Object.entries(a.branches ?? {}).filter(([, h]) => {
1733
+ const m = t.scenario(h);
1734
+ return m && (n || m.status !== "ported");
1735
+ });
1736
+ return /* @__PURE__ */ d("li", { children: [
1737
+ /* @__PURE__ */ o("button", { type: "button", className: "ds-flow__step", onClick: () => r(a.scenario), children: a.label ?? c?.title ?? a.scenario }),
1738
+ a.decision && /* @__PURE__ */ o("p", { className: "ds-flow__decision", children: a.decision }),
1739
+ p.length > 0 && /* @__PURE__ */ o("ul", { className: "ds-flow__branches", children: p.map(([h, m]) => /* @__PURE__ */ d("li", { children: [
1740
+ /* @__PURE__ */ o("span", { className: "ds-flow__branch-label", children: h }),
1741
+ /* @__PURE__ */ o(
1261
1742
  "button",
1262
1743
  {
1263
1744
  type: "button",
1264
1745
  className: "ds-flow__step",
1265
- onClick: () => n(m),
1746
+ onClick: () => r(m),
1266
1747
  children: t.scenario(m)?.title ?? m
1267
1748
  }
1268
1749
  )
1269
- ] }, l)) })
1270
- ] }, `${s.scenario}-${r}`);
1750
+ ] }, h)) })
1751
+ ] }, `${a.scenario}-${s}`);
1271
1752
  }) })
1272
1753
  ] });
1273
1754
  }
1274
- function X({
1755
+ function re({
1275
1756
  scenarios: e,
1276
1757
  registry: t,
1277
1758
  onOpenScenario: n
1278
1759
  }) {
1279
- const s = N();
1280
- return e.length === 0 ? /* @__PURE__ */ a("p", { className: "ds-home__hint", children: s.home.emptyModule }) : /* @__PURE__ */ a("ul", { className: "ds-home__grid", children: e.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c("button", { type: "button", className: "ds-home__card", onClick: () => n(r.id), children: [
1281
- /* @__PURE__ */ c("span", { className: "ds-home__card-head", children: [
1282
- /* @__PURE__ */ a("span", { className: "ds-status-dot", "data-status": r.status }),
1283
- /* @__PURE__ */ a("span", { className: "ds-home__card-title", children: r.title })
1760
+ const r = A();
1761
+ return e.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-home__hint", children: r.home.emptyModule }) : /* @__PURE__ */ o("ul", { className: "ds-home__grid", children: e.map((i) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d("button", { type: "button", className: "ds-home__card", onClick: () => n(i.id), children: [
1762
+ /* @__PURE__ */ d("span", { className: "ds-home__card-head", children: [
1763
+ /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": i.status }),
1764
+ /* @__PURE__ */ o("span", { className: "ds-home__card-title", children: i.title })
1284
1765
  ] }),
1285
- r.intent && /* @__PURE__ */ a("span", { className: "ds-home__card-intent", children: r.intent }),
1286
- /* @__PURE__ */ c("span", { className: "ds-home__card-meta", children: [
1287
- t.persona(r.persona)?.name ?? r.persona,
1766
+ i.intent && /* @__PURE__ */ o("span", { className: "ds-home__card-intent", children: i.intent }),
1767
+ /* @__PURE__ */ d("span", { className: "ds-home__card-meta", children: [
1768
+ t.persona(i.persona)?.name ?? i.persona,
1288
1769
  " · ",
1289
- s.status[r.status],
1290
- r.a11y.keyboard === "full" ? ` · ${s.home.keyboardBadge}` : ""
1770
+ r.status[i.status],
1771
+ i.a11y.keyboard === "full" ? ` · ${r.home.keyboardBadge}` : ""
1291
1772
  ] })
1292
- ] }) }, r.id)) });
1773
+ ] }) }, i.id)) });
1293
1774
  }
1294
- function st({ product: e }) {
1295
- const t = y(() => le(e), [e]), n = y(() => Oe(e.theme?.labels), [e.theme?.labels]), s = y(() => ce(e.deploy), [e.deploy]), { location: r, controls: o, viewport: d, setControls: l, navigate: m, openScenario: i } = he(t), [p, g] = x(!0), v = se(null), { focused: u, tabStops: h } = Pe(o.keyboardMode, v), b = t.scenario(o.scenario), w = t.persona(o.persona ?? b?.persona), T = t.fixture(o.fixture ?? b?.fixture), Z = y(() => {
1296
- const k = o.dataSource ?? "fixtures";
1297
- return k === "fixtures" ? O : e.dataSources?.adapters?.find((_) => _.id === k) ?? O;
1298
- }, [o.dataSource, e.dataSources?.adapters]), { data: R, isLoading: I, error: D } = _e({ scenario: b, fixture: T, network: o.network, adapter: Z });
1299
- E(() => {
1300
- const k = (_) => {
1301
- if (!(!_.shiftKey || _.metaKey || _.ctrlKey || _.altKey || _.target?.matches("input, textarea, select, [contenteditable='true']"))) {
1302
- switch (_.key) {
1303
- case "C":
1304
- l({ chrome: !o.chrome });
1305
- break;
1775
+ function Nt({ product: e }) {
1776
+ const t = T(() => me(e), [e]), n = T(() => je(e.theme?.labels), [e.theme?.labels]), r = T(() => pe(e.deploy), [e.deploy]), { location: i, controls: a, viewport: s, setControls: c, navigate: p, openScenario: h, openComponent: m } = ge(t), b = q(null), { focused: u, tabStops: S } = We(a.keyboardMode, b), w = t.scenario(a.scenario), C = t.component(a.component), l = T(
1777
+ () => t.resolveComponentFixture(C?.id, C ? a.fixture : void 0),
1778
+ [C, a.fixture, t]
1779
+ ), g = T(() => {
1780
+ const x = l.fixture?.data;
1781
+ return typeof x == "function" ? x() : x;
1782
+ }, [l.fixture]), k = t.persona(a.persona ?? w?.persona), M = t.fixture(a.fixture ?? w?.fixture), _ = T(() => {
1783
+ const x = a.dataSource ?? "fixtures";
1784
+ return x === "fixtures" ? J : e.dataSources?.adapters?.find((L) => L.id === x) ?? J;
1785
+ }, [a.dataSource, e.dataSources?.adapters]), { data: $, isLoading: D, error: W } = Te({ scenario: w, fixture: M, network: a.network, adapter: _ });
1786
+ B(() => {
1787
+ const x = (L) => {
1788
+ if (!(!L.shiftKey || L.metaKey || L.ctrlKey || L.altKey || L.target?.matches("input, textarea, select, [contenteditable='true']"))) {
1789
+ switch (L.key) {
1306
1790
  case "K":
1307
- l({ keyboardMode: !o.keyboardMode });
1791
+ c({ keyboardMode: !a.keyboardMode });
1308
1792
  break;
1309
1793
  case "P":
1310
- l({ inspector: !o.inspector });
1794
+ c({ inspector: !a.inspector });
1311
1795
  break;
1312
1796
  default:
1313
1797
  return;
1314
1798
  }
1315
- _.preventDefault();
1799
+ L.preventDefault();
1316
1800
  }
1317
1801
  };
1318
- return window.addEventListener("keydown", k), () => window.removeEventListener("keydown", k);
1319
- }, [o.chrome, o.keyboardMode, o.inspector, l]);
1320
- const L = y(() => o.persona && o.persona !== b?.persona ? t.persona(o.persona)?.permissions ?? [] : t.permissionsOf(b), [o.persona, t, b]), B = y(
1802
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1803
+ }, [a.keyboardMode, a.inspector, c]);
1804
+ const R = T(() => a.persona && a.persona !== w?.persona ? t.persona(a.persona)?.permissions ?? [] : t.permissionsOf(w), [a.persona, t, w]), j = T(
1321
1805
  () => ({
1322
- scenario: b,
1323
- persona: w,
1324
- permissions: L,
1325
- can: (k) => L.includes(k),
1326
- data: R,
1327
- fixture: T,
1328
- network: o.network,
1329
- isLoading: I,
1330
- error: D,
1331
- rules: t.rulesOf(b),
1332
- viewport: d,
1333
- themeMode: o.themeMode,
1334
- locale: o.locale,
1806
+ scenario: w,
1807
+ persona: k,
1808
+ permissions: R,
1809
+ can: (x) => R.includes(x),
1810
+ data: $,
1811
+ fixture: M,
1812
+ network: a.network,
1813
+ isLoading: D,
1814
+ error: W,
1815
+ rules: t.rulesOf(w),
1816
+ viewport: s,
1817
+ themeMode: a.themeMode,
1818
+ locale: a.locale,
1335
1819
  a11y: {
1336
- keyboardMode: o.keyboardMode,
1337
- reducedMotion: o.reducedMotion,
1338
- textScale: o.textScale
1820
+ keyboardMode: a.keyboardMode,
1821
+ reducedMotion: a.reducedMotion,
1822
+ textScale: a.textScale
1339
1823
  },
1340
- navigate: m,
1341
- openScenario: i
1824
+ navigate: p,
1825
+ openScenario: h
1342
1826
  }),
1343
1827
  [
1344
- b,
1345
1828
  w,
1346
- L,
1829
+ k,
1347
1830
  R,
1348
- T,
1349
- o.network,
1350
- o.themeMode,
1351
- o.locale,
1352
- o.keyboardMode,
1353
- o.reducedMotion,
1354
- o.textScale,
1355
- I,
1831
+ $,
1832
+ M,
1833
+ a.network,
1834
+ a.themeMode,
1835
+ a.locale,
1836
+ a.keyboardMode,
1837
+ a.reducedMotion,
1838
+ a.textScale,
1356
1839
  D,
1840
+ W,
1357
1841
  t,
1358
- d,
1359
- m,
1360
- i
1842
+ s,
1843
+ p,
1844
+ h
1361
1845
  ]
1362
- ), ee = !b && r.path === "/", $ = ve(e.routes, r.path), W = e.wrapper, j = e.notFound, H = $ ? /* @__PURE__ */ a($.definition.screen, { params: $.params, context: B }) : j ? /* @__PURE__ */ a(j, { path: r.path }) : /* @__PURE__ */ a(Ve, { title: n.shell.noRoute, children: /* @__PURE__ */ c("p", { children: [
1363
- /* @__PURE__ */ a("code", { children: r.path }),
1846
+ ), U = !w && !C && i.path === "/", O = xe(e.routes, i.path), H = e.wrapper, K = e.notFound, f = C?.preview, N = f ? /* @__PURE__ */ o(
1847
+ f,
1848
+ {
1849
+ fixture: l.fixture,
1850
+ data: g,
1851
+ viewport: s,
1852
+ themeMode: a.themeMode ?? "default",
1853
+ locale: a.locale ?? "default",
1854
+ a11y: {
1855
+ keyboardMode: a.keyboardMode,
1856
+ reducedMotion: a.reducedMotion,
1857
+ textScale: a.textScale
1858
+ }
1859
+ }
1860
+ ) : O ? /* @__PURE__ */ o(O.definition.screen, { params: O.params, context: j }) : K ? /* @__PURE__ */ o(K, { path: i.path }) : /* @__PURE__ */ o(it, { title: n.shell.noRoute, children: /* @__PURE__ */ d("p", { children: [
1861
+ /* @__PURE__ */ o("code", { children: i.path }),
1364
1862
  " ",
1365
1863
  n.shell.noRouteHint
1366
- ] }) }), te = W ? /* @__PURE__ */ a(W, { context: B, children: H }) : H;
1367
- return /* @__PURE__ */ a(J.Provider, { value: n, children: /* @__PURE__ */ c(
1864
+ ] }) }), y = H ? /* @__PURE__ */ o(H, { context: j, children: N }) : N;
1865
+ return /* @__PURE__ */ o(ae.Provider, { value: n, children: /* @__PURE__ */ d(
1368
1866
  "div",
1369
1867
  {
1370
1868
  className: "ds-root",
1371
- "data-chrome": o.chrome ? "visible" : "hidden",
1372
- "data-inspector": o.inspector ? "open" : "closed",
1373
- "data-sidebar": p ? "open" : "closed",
1374
- "data-viewport": d.id,
1869
+ "data-chrome": a.chrome ? "visible" : "hidden",
1870
+ "data-appearance": a.chromeTheme ?? "dark",
1871
+ "data-inspector": a.inspector ? "open" : "closed",
1872
+ "data-viewport": s.id,
1375
1873
  children: [
1376
- o.chrome && /* @__PURE__ */ a(
1377
- Ie,
1874
+ a.chrome && /* @__PURE__ */ o(
1875
+ Ve,
1378
1876
  {
1379
1877
  product: e,
1380
- scenario: b,
1381
- deploy: s,
1382
- inspectorOpen: o.inspector,
1383
- sidebarOpen: p,
1384
- onToggleInspector: () => l({ inspector: !o.inspector }),
1385
- onToggleSidebar: () => g((k) => !k),
1386
- onHideChrome: () => l({ chrome: !1 })
1878
+ scenario: w,
1879
+ deploy: r,
1880
+ inspectorOpen: a.inspector,
1881
+ chromeTheme: a.chromeTheme ?? "dark",
1882
+ showPorted: a.showPorted ?? !1,
1883
+ onToggleInspector: () => c({ inspector: !a.inspector }),
1884
+ onToggleChromeTheme: () => c({ chromeTheme: a.chromeTheme === "light" ? "dark" : "light" })
1387
1885
  }
1388
1886
  ),
1389
- o.chrome && /* @__PURE__ */ a(
1390
- Re,
1887
+ a.chrome && /* @__PURE__ */ o(
1888
+ He,
1391
1889
  {
1392
1890
  registry: t,
1393
- activeScenario: o.scenario,
1394
- onOpenScenario: i
1891
+ activeScenario: w,
1892
+ activeComponent: a.component,
1893
+ controls: a,
1894
+ onOpenScenario: h,
1895
+ onOpenComponent: m,
1896
+ onShowPortedChange: (x) => c({ showPorted: x })
1395
1897
  }
1396
1898
  ),
1397
- /* @__PURE__ */ c("div", { className: "ds-stage-area", children: [
1398
- ee ? /* @__PURE__ */ a("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ a(qe, { registry: t, onOpenScenario: i }) }) : /* @__PURE__ */ a(
1399
- Ue,
1899
+ /* @__PURE__ */ d("div", { className: "ds-stage-area", children: [
1900
+ U ? /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
1901
+ ct,
1400
1902
  {
1401
- ref: v,
1402
- viewport: d,
1403
- textScale: o.textScale,
1404
- reducedMotion: o.reducedMotion,
1405
- keyboardMode: o.keyboardMode,
1406
- children: te
1903
+ registry: t,
1904
+ showPorted: a.showPorted ?? !1,
1905
+ onOpenScenario: h
1906
+ }
1907
+ ) }) : /* @__PURE__ */ o(
1908
+ rt,
1909
+ {
1910
+ ref: b,
1911
+ viewport: s,
1912
+ textScale: a.textScale,
1913
+ reducedMotion: a.reducedMotion,
1914
+ keyboardMode: a.keyboardMode,
1915
+ children: y
1407
1916
  }
1408
1917
  ),
1409
- o.chrome && /* @__PURE__ */ a(De, { registry: t, controls: o, onChange: l })
1918
+ a.chrome && /* @__PURE__ */ o(
1919
+ Qe,
1920
+ {
1921
+ registry: t,
1922
+ controls: a,
1923
+ scenarioActive: !!w,
1924
+ component: C,
1925
+ componentFixture: l,
1926
+ onChange: c
1927
+ }
1928
+ )
1410
1929
  ] }),
1411
- o.chrome && /* @__PURE__ */ a(
1412
- Be,
1930
+ a.chrome && /* @__PURE__ */ o(
1931
+ Ze,
1413
1932
  {
1414
1933
  registry: t,
1415
- scenario: b,
1416
- controls: o,
1934
+ scenario: w,
1935
+ component: C,
1936
+ componentFixture: l,
1937
+ controls: a,
1417
1938
  focusedNode: u,
1418
- tabStopCount: h.length
1939
+ tabStopCount: S.length
1419
1940
  }
1420
1941
  ),
1421
- o.keyboardMode && /* @__PURE__ */ a(Ke, { stops: h }),
1422
- !o.chrome && /* @__PURE__ */ a(
1942
+ a.keyboardMode && /* @__PURE__ */ o(st, { stops: S }),
1943
+ !a.chrome && /* @__PURE__ */ o(
1423
1944
  "button",
1424
1945
  {
1425
1946
  type: "button",
1426
1947
  className: "ds-chrome ds-restore",
1427
- onClick: () => l({ chrome: !0 }),
1948
+ onClick: () => c({ chrome: !0 }),
1428
1949
  children: n.shell.restoreChrome
1429
1950
  }
1430
1951
  )
@@ -1432,75 +1953,77 @@ function st({ product: e }) {
1432
1953
  }
1433
1954
  ) });
1434
1955
  }
1435
- function A(e) {
1956
+ function z(e) {
1436
1957
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
1437
1958
  }
1438
- function ot(e, t) {
1439
- const n = A(e), s = A(t);
1440
- let r = s.getFullYear() - n.getFullYear();
1441
- const o = s.getMonth() - n.getMonth();
1442
- return (o < 0 || o === 0 && s.getDate() < n.getDate()) && (r -= 1), r;
1959
+ function yt(e, t) {
1960
+ const n = z(e), r = z(t);
1961
+ let i = r.getFullYear() - n.getFullYear();
1962
+ const a = r.getMonth() - n.getMonth();
1963
+ return (a < 0 || a === 0 && r.getDate() < n.getDate()) && (i -= 1), i;
1443
1964
  }
1444
- function it(e, t) {
1445
- const n = A(e), s = A(t);
1446
- return Math.floor((s.getTime() - n.getTime()) / 864e5);
1965
+ function xt(e, t) {
1966
+ const n = z(e), r = z(t);
1967
+ return Math.floor((r.getTime() - n.getTime()) / 864e5);
1447
1968
  }
1448
1969
  export {
1449
- lt as CONTRAST_THRESHOLDS,
1450
- S as DEFAULT_LABELS,
1451
- st as DesignSpace,
1452
- qe as Home,
1453
- rt as KEYBOARD_LABELS,
1454
- nt as NETWORK_LABELS,
1455
- Y as NETWORK_STATES,
1456
- f as PARAM,
1457
- ut as SCENARIO_STATUSES,
1458
- we as SLOW_NETWORK_DELAY_MS,
1459
- tt as STATUS_LABELS,
1460
- at as STATUS_MEANING,
1461
- Ne as SimulatedNetworkError,
1462
- Ue as Stage,
1463
- Ve as StageEmpty,
1464
- Q as TEXT_SCALES,
1465
- Ke as TabOrderOverlay,
1466
- G as VIEWPORTS,
1467
- ot as ageInYears,
1468
- ht as applyOverrides,
1469
- mt as assertContrastPairs,
1470
- pt as checkContrastPair,
1471
- de as checkContrastPairs,
1472
- bt as commitUrl,
1473
- Me as computeRole,
1474
- ft as contrastRatio,
1475
- et as createHttpAdapter,
1476
- le as createRegistry,
1477
- it as daysBetween,
1478
- xe as describeElement,
1479
- O as fixtureAdapter,
1480
- vt as flatten,
1481
- gt as formatIssues,
1482
- ce as getDeployContext,
1483
- wt as hasErrors,
1484
- fe as matchPath,
1485
- Nt as parseColor,
1486
- ue as parseControls,
1487
- A as parseIsoDate,
1488
- kt as readCssVariable,
1489
- _t as relativeLuminance,
1490
- P as resolveFixture,
1491
- Oe as resolveLabels,
1492
- ve as resolveRoute,
1493
- me as resolveViewport,
1494
- ie as scenarioUrl,
1495
- U as serializeControls,
1496
- yt as serializeValue,
1497
- $e as shortSelector,
1498
- Fe as tabbableElements,
1499
- he as useDesignSpaceState,
1500
- Pe as useKeyboardMode,
1501
- N as useLabels,
1502
- _e as useScenarioData,
1503
- oe as validateProduct,
1504
- St as validateScenario
1970
+ _t as CONTRAST_THRESHOLDS,
1971
+ E as DEFAULT_LABELS,
1972
+ Nt as DesignSpace,
1973
+ bt as EN_US_LABELS,
1974
+ ct as Home,
1975
+ kt as KEYBOARD_LABELS,
1976
+ wt as NETWORK_LABELS,
1977
+ oe as NETWORK_STATES,
1978
+ v as PARAM,
1979
+ de as SCENARIO_STATUSES,
1980
+ Me as SLOW_NETWORK_DELAY_MS,
1981
+ gt as STATUS_LABELS,
1982
+ vt as STATUS_MEANING,
1983
+ _e as SimulatedNetworkError,
1984
+ rt as Stage,
1985
+ it as StageEmpty,
1986
+ fe as TEXT_SCALES,
1987
+ st as TabOrderOverlay,
1988
+ ne as VIEWPORTS,
1989
+ yt as ageInYears,
1990
+ Ct as applyOverrides,
1991
+ Tt as assertContrastPairs,
1992
+ Pt as checkContrastPair,
1993
+ he as checkContrastPairs,
1994
+ At as commitUrl,
1995
+ Lt as componentUrl,
1996
+ Ee as computeRole,
1997
+ Et as contrastRatio,
1998
+ ft as createHttpAdapter,
1999
+ me as createRegistry,
2000
+ xt as daysBetween,
2001
+ Le as describeElement,
2002
+ J as fixtureAdapter,
2003
+ Ft as flatten,
2004
+ $t as formatIssues,
2005
+ pe as getDeployContext,
2006
+ Dt as hasErrors,
2007
+ ye as matchPath,
2008
+ Rt as parseColor,
2009
+ be as parseControls,
2010
+ z as parseIsoDate,
2011
+ Ot as readCssVariable,
2012
+ It as relativeLuminance,
2013
+ Y as resolveFixture,
2014
+ je as resolveLabels,
2015
+ xe as resolveRoute,
2016
+ ve as resolveViewport,
2017
+ ue as scenarioUrl,
2018
+ G as serializeControls,
2019
+ Bt as serializeValue,
2020
+ Ie as shortSelector,
2021
+ Be as tabbableElements,
2022
+ ge as useDesignSpaceState,
2023
+ We as useKeyboardMode,
2024
+ A as useLabels,
2025
+ Te as useScenarioData,
2026
+ le as validateProduct,
2027
+ Wt as validateScenario
1505
2028
  };
1506
2029
  //# sourceMappingURL=index.js.map