@brucesantos/design-space 0.11.0 → 0.13.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,258 +1,259 @@
1
- import { jsx as n, jsxs as C, Fragment as Z } from "react/jsx-runtime";
2
- import { useState as D, useRef as j, useCallback as I, useEffect as K, useMemo as U, useContext as pt, createContext as mt, useLayoutEffect as Be } from "react";
3
- import { r as ye, s as ft, h as re, v as wt, a as ve, b as je, p as gt, P as M, c as qe, C as be, d as Ee, e as se, t as ie, f as he, N as Ge, g as Ze, F as vt, i as Te, j as bt, k as me, l as Ne, m as St, n as Fe, o as kt, q as Oe, u as Ct, w as xt, x as yt } from "./index-Dv-W-bL0.js";
4
- import { H as Mn, y as Ln, z as En, A as Tn, B as Pn, D as Rn, E as _n, G as Fn, I as On } from "./index-Dv-W-bL0.js";
5
- import { createPortal as Nt } from "react-dom";
6
- function $t(e) {
7
- const t = e.scenarios ?? [], s = e.routes ?? [], r = e.components ?? [], o = new Map(t.map((i) => [i.id, i])), a = new Map(r.map((i) => [i.id, i])), d = new Map((e.personas ?? []).map((i) => [i.id, i])), l = new Map((e.fixtures ?? []).map((i) => [i.id, i])), w = new Map((e.rules ?? []).map((i) => [i.id, i])), h = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
8
- for (const i of t) {
9
- const f = ye(s, i.route ?? "");
10
- if (!f) continue;
11
- const x = f.definition.path;
12
- u.set(i.id, x);
13
- const T = h.get(x) ?? [];
14
- T.push(i), h.set(x, T);
1
+ import { jsx as o, jsxs as y, Fragment as G } from "react/jsx-runtime";
2
+ import { useState as D, useRef as q, useCallback as K, useEffect as V, useMemo as A, useContext as St, createContext as Ct, useLayoutEffect as qe } from "react";
3
+ import { r as Ne, s as yt, h as re, v as xt, a as be, b as Ge, p as Nt, P as M, c as Ze, C as ke, d as Pe, e as se, t as ie, f as he, N as Ye, g as Qe, F as $t, i as Re, j as Mt, k as me, l as $e, m as Et, n as ze, o as Lt, q as fe, u as Tt, w as Pt, x as Rt, y as _t } from "./index-CLox5DuH.js";
4
+ import { H as Zn, z as Yn, A as Qn, B as Xn, D as Jn, E as eo, G as to, I as no, J as oo } from "./index-CLox5DuH.js";
5
+ import { createPortal as Ft } from "react-dom";
6
+ import { r as Ot, i as zt, s as At } from "./hook-CeXcli-1.js";
7
+ function Dt(e) {
8
+ const t = e.scenarios ?? [], n = e.routes ?? [], r = e.components ?? [], s = new Map(t.map((d) => [d.id, d])), a = new Map(r.map((d) => [d.id, d])), c = new Map((e.personas ?? []).map((d) => [d.id, d])), l = new Map((e.fixtures ?? []).map((d) => [d.id, d])), h = new Map((e.rules ?? []).map((d) => [d.id, d])), p = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
9
+ for (const d of t) {
10
+ const g = Ne(n, d.route ?? "");
11
+ if (!g) continue;
12
+ const C = g.definition.path;
13
+ u.set(d.id, C);
14
+ const E = p.get(C) ?? [];
15
+ E.push(d), p.set(C, E);
15
16
  }
16
- const c = /* @__PURE__ */ new Set(), g = [];
17
- for (const i of s) {
18
- if (c.has(i.path)) continue;
19
- c.add(i.path);
20
- const f = h.get(i.path) ?? [];
21
- g.push({
22
- id: i.path,
23
- name: i.name?.trim() || f[0]?.title || i.path,
24
- description: i.description,
25
- route: i,
26
- href: ft(i.path, i.params),
27
- variations: f,
28
- group: i.group?.trim() || void 0,
29
- controls: Array.isArray(i.controls) ? i.controls : []
17
+ const i = /* @__PURE__ */ new Set(), f = [];
18
+ for (const d of n) {
19
+ if (i.has(d.path)) continue;
20
+ i.add(d.path);
21
+ const g = p.get(d.path) ?? [];
22
+ f.push({
23
+ id: d.path,
24
+ name: d.name?.trim() || g[0]?.title || d.path,
25
+ description: d.description,
26
+ route: d,
27
+ href: yt(d.path, d.params),
28
+ variations: g,
29
+ group: d.group?.trim() || void 0,
30
+ controls: Array.isArray(d.controls) ? d.controls : []
30
31
  });
31
32
  }
32
- const k = new Map(g.map((i) => [i.id, i])), $ = (i) => i ? o.get(i) : void 0, L = (i) => i ? d.get(i) : void 0, S = L(e.defaultPersona)?.id, y = (i, f) => {
33
- if (!(!i || !f))
34
- return a.get(i)?.fixtures?.find((x) => x.id === f);
35
- }, E = (i = {}) => t.filter((f) => re(i.handoff, f.id)), v = (i) => {
36
- const f = ye(s, i);
37
- return f ? k.get(f.definition.path) : void 0;
38
- }, m = (i = {}) => {
39
- const { handoff: f } = i;
40
- return f ? g.map((x) => ({
41
- ...x,
42
- variations: x.variations.filter((T) => re(f, T.id))
33
+ const S = new Map(f.map((d) => [d.id, d])), N = (d) => d ? s.get(d) : void 0, $ = (d) => d ? c.get(d) : void 0, _ = $(e.defaultPersona)?.id, v = (d, g) => {
34
+ if (!(!d || !g))
35
+ return a.get(d)?.fixtures?.find((C) => C.id === g);
36
+ }, L = (d = {}) => t.filter((g) => re(d.handoff, g.id)), b = (d) => {
37
+ const g = Ne(n, d);
38
+ return g ? S.get(g.definition.path) : void 0;
39
+ }, m = (d = {}) => {
40
+ const { handoff: g } = d;
41
+ return g ? f.map((C) => ({
42
+ ...C,
43
+ variations: C.variations.filter((E) => re(g, E.id))
43
44
  })).filter(
44
- (x) => x.variations.length > 0 || (f.routes ?? []).length > 0 && je(f, x.href)
45
- ) : g;
46
- }, p = (i) => i ? i.permissions ? i.permissions : L(i.persona ?? S)?.permissions ?? [] : [], b = (i = {}) => Ye(m(i)), N = (i, f) => {
47
- const x = new Set(i?.route.components ?? []), T = f ? [f] : i?.variations ?? [];
48
- for (const O of T)
49
- for (const _ of O.components ?? []) x.add(_);
50
- return [...x];
51
- }, P = (i) => r.filter((f) => ve(i, f.id));
45
+ (C) => C.variations.length > 0 || (g.routes ?? []).length > 0 && Ge(g, C.href)
46
+ ) : f;
47
+ }, w = (d) => d ? d.permissions ? d.permissions : $(d.persona ?? _)?.permissions ?? [] : [], k = (d = {}) => Xe(m(d)), x = (d, g) => {
48
+ const C = new Set(d?.route.components ?? []), E = g ? [g] : d?.variations ?? [];
49
+ for (const F of E)
50
+ for (const O of F.components ?? []) C.add(O);
51
+ return [...C];
52
+ }, T = (d) => r.filter((g) => be(d, g.id));
52
53
  return {
53
54
  product: e,
54
- screens: g,
55
- issues: wt(e),
56
- defaultPersona: S,
57
- scenario: $,
58
- component: (i) => i ? a.get(i) : void 0,
59
- componentFixture: y,
60
- resolveComponentFixture: (i, f) => {
61
- const x = i ? a.get(i) : void 0, T = y(i, f), O = y(i, x?.defaultFixture) ?? x?.fixtures?.[0];
55
+ screens: f,
56
+ issues: xt(e),
57
+ defaultPersona: _,
58
+ scenario: N,
59
+ component: (d) => d ? a.get(d) : void 0,
60
+ componentFixture: v,
61
+ resolveComponentFixture: (d, g) => {
62
+ const C = d ? a.get(d) : void 0, E = v(d, g), F = v(d, C?.defaultFixture) ?? C?.fixtures?.[0];
62
63
  return {
63
- fixture: T ?? O,
64
- requestedId: f,
65
- didFallback: !!(f && !T)
64
+ fixture: E ?? F,
65
+ requestedId: g,
66
+ didFallback: !!(g && !E)
66
67
  };
67
68
  },
68
- persona: L,
69
- fixture: (i) => i ? l.get(i) : void 0,
70
- rule: (i) => i ? w.get(i) : void 0,
71
- screen: (i) => i ? k.get(i) : void 0,
72
- screenForPath: v,
73
- screenOf: (i) => {
74
- const f = i ? u.get(i.id) : void 0;
75
- return f ? k.get(f) : void 0;
69
+ persona: $,
70
+ fixture: (d) => d ? l.get(d) : void 0,
71
+ rule: (d) => d ? h.get(d) : void 0,
72
+ screen: (d) => d ? S.get(d) : void 0,
73
+ screenForPath: b,
74
+ screenOf: (d) => {
75
+ const g = d ? u.get(d.id) : void 0;
76
+ return g ? S.get(g) : void 0;
76
77
  },
77
78
  screensFor: m,
78
- flows: b,
79
- flowOf: (i, f) => {
80
- if (i)
81
- return b(f).find((x) => x.name === i.group);
79
+ flows: k,
80
+ flowOf: (d, g) => {
81
+ if (d)
82
+ return k(g).find((C) => C.name === d.group);
82
83
  },
83
- controlsOf: (i) => (i?.controls ?? []).flatMap((f) => f.controls ?? []),
84
- resolveControls: (i, f = {}) => Mt(i?.controls ?? [], f),
85
- rulesOf: (i) => (i?.rules ?? []).map((f) => w.get(f)).filter((f) => !!f),
86
- permissionsOf: p,
87
- scenariosForRoute: (i, f) => {
88
- const x = v(i);
89
- return x ? x.variations.filter((T) => re(f?.handoff, T.id)) : [];
84
+ controlsOf: (d) => (d?.controls ?? []).flatMap((g) => g.controls ?? []),
85
+ resolveControls: (d, g = {}) => It(d?.controls ?? [], g),
86
+ rulesOf: (d) => (d?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
87
+ permissionsOf: w,
88
+ scenariosForRoute: (d, g) => {
89
+ const C = b(d);
90
+ return C ? C.variations.filter((E) => re(g?.handoff, E.id)) : [];
90
91
  },
91
- activeScenarios: E,
92
- search: (i, f) => {
93
- const x = Q(i), T = E(f);
94
- return x ? T.filter(
95
- (O) => Q(
92
+ activeScenarios: L,
93
+ search: (d, g) => {
94
+ const C = X(d), E = L(g);
95
+ return C ? E.filter(
96
+ (F) => X(
96
97
  [
97
- O.title,
98
- O.id,
99
- O.intent ?? "",
100
- O.route,
101
- L(O.persona)?.name ?? "",
102
- (O.tags ?? []).join(" "),
103
- (O.expected ?? []).join(" ")
98
+ F.title,
99
+ F.id,
100
+ F.intent ?? "",
101
+ F.route,
102
+ $(F.persona)?.name ?? "",
103
+ (F.tags ?? []).join(" "),
104
+ (F.expected ?? []).join(" ")
104
105
  ].join(" ")
105
- ).includes(x)
106
- ) : T;
106
+ ).includes(C)
107
+ ) : E;
107
108
  },
108
- searchScreens: (i, f) => {
109
- const x = Q(i), T = m(f);
110
- return x ? T.filter(
111
- (O) => Q(
109
+ searchScreens: (d, g) => {
110
+ const C = X(d), E = m(g);
111
+ return C ? E.filter(
112
+ (F) => X(
112
113
  [
113
- O.name,
114
- O.description ?? "",
115
- O.id,
116
- O.group ?? "",
117
- ...O.variations.flatMap((_) => [
118
- _.title,
119
- _.id,
120
- (_.tags ?? []).join(" ")
114
+ F.name,
115
+ F.description ?? "",
116
+ F.id,
117
+ F.group ?? "",
118
+ ...F.variations.flatMap((O) => [
119
+ O.title,
120
+ O.id,
121
+ (O.tags ?? []).join(" ")
121
122
  ])
122
123
  ].join(" ")
123
- ).includes(x)
124
- ) : T;
124
+ ).includes(C)
125
+ ) : E;
125
126
  },
126
- searchComponents: (i, f) => {
127
- const x = Q(i), T = P(f);
128
- return x ? T.filter(
129
- (O) => Q(
127
+ searchComponents: (d, g) => {
128
+ const C = X(d), E = T(g);
129
+ return C ? E.filter(
130
+ (F) => X(
130
131
  [
131
- O.name,
132
- O.description ?? "",
133
- O.group ?? "",
134
- O.id,
135
- O.source ?? ""
132
+ F.name,
133
+ F.description ?? "",
134
+ F.group ?? "",
135
+ F.id,
136
+ F.source ?? ""
136
137
  ].join(" ")
137
- ).includes(x)
138
- ) : T;
138
+ ).includes(C)
139
+ ) : E;
139
140
  },
140
- componentsFor: P,
141
- componentsOfScreen: (i, f) => N(i, f).map((x) => a.get(x)).filter((x) => !!x),
142
- usagesOf: (i, f) => i ? m(f).filter(
143
- (x) => x.route.components?.includes(i) || x.variations.some((T) => T.components?.includes(i))
141
+ componentsFor: T,
142
+ componentsOfScreen: (d, g) => x(d, g).map((C) => a.get(C)).filter((C) => !!C),
143
+ usagesOf: (d, g) => d ? m(g).filter(
144
+ (C) => C.route.components?.includes(d) || C.variations.some((E) => E.components?.includes(d))
144
145
  ) : []
145
146
  };
146
147
  }
147
- function Q(e) {
148
+ function X(e) {
148
149
  return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
149
150
  }
150
- function Ye(e) {
151
- const t = [], s = /* @__PURE__ */ new Map();
152
- for (const o of e) {
153
- if (!o.group) {
154
- t.push(o);
151
+ function Xe(e) {
152
+ const t = [], n = /* @__PURE__ */ new Map();
153
+ for (const s of e) {
154
+ if (!s.group) {
155
+ t.push(s);
155
156
  continue;
156
157
  }
157
- const a = s.get(o.group) ?? [];
158
- a.push(o), s.set(o.group, a);
158
+ const a = n.get(s.group) ?? [];
159
+ a.push(s), n.set(s.group, a);
159
160
  }
160
- const r = [...s].map(([o, a]) => ({ name: o, screens: a }));
161
+ const r = [...n].map(([s, a]) => ({ name: s, screens: a }));
161
162
  return t.length > 0 ? [{ name: void 0, screens: t }, ...r] : r;
162
163
  }
163
164
  function Se(e) {
164
165
  const t = e.options ?? [];
165
- return e.default !== void 0 && t.some((s) => s.value === e.default) ? e.default : t[0]?.value ?? "";
166
- }
167
- function Mt(e, t = {}) {
168
- const s = {}, r = [], o = /* @__PURE__ */ new Set(), a = t.requested ?? {};
169
- for (const d of e)
170
- for (const l of d.controls ?? []) {
171
- if (o.has(l.id)) continue;
172
- o.add(l.id);
173
- const w = (g) => g !== void 0 && (l.options ?? []).some((k) => k.value === g);
174
- let h = Se(l);
166
+ return e.default !== void 0 && t.some((n) => n.value === e.default) ? e.default : t[0]?.value ?? "";
167
+ }
168
+ function It(e, t = {}) {
169
+ const n = {}, r = [], s = /* @__PURE__ */ new Set(), a = t.requested ?? {};
170
+ for (const c of e)
171
+ for (const l of c.controls ?? []) {
172
+ if (s.has(l.id)) continue;
173
+ s.add(l.id);
174
+ const h = (f) => f !== void 0 && (l.options ?? []).some((S) => S.value === f);
175
+ let p = Se(l);
175
176
  const u = t.scenario?.controls?.[l.id];
176
- w(u) && (h = u);
177
- const c = a[l.id];
178
- c !== void 0 && (w(c) ? h = c : r.push({ id: l.id, value: c, reason: "invalid-value", fallback: h })), s[l.id] = h;
177
+ h(u) && (p = u);
178
+ const i = a[l.id];
179
+ i !== void 0 && (h(i) ? p = i : r.push({ id: l.id, value: i, reason: "invalid-value", fallback: p })), n[l.id] = p;
179
180
  }
180
- for (const [d, l] of Object.entries(a))
181
- o.has(d) || r.push({ id: d, value: l, reason: "unknown-control" });
182
- return { values: s, invalid: r };
181
+ for (const [c, l] of Object.entries(a))
182
+ s.has(c) || r.push({ id: c, value: l, reason: "unknown-control" });
183
+ return { values: n, invalid: r };
183
184
  }
184
- function Lt(e, t) {
185
- return e ? Object.entries(e.controls ?? {}).every(([s, r]) => t?.[s] === r) : !1;
185
+ function Ut(e, t) {
186
+ return e ? Object.entries(e.controls ?? {}).every(([n, r]) => t?.[n] === r) : !1;
186
187
  }
187
- const Et = [
188
+ const Vt = [
188
189
  { id: "mobile", label: "Celular", width: 375, height: 812 },
189
190
  { id: "tablet", label: "Tablet", width: 768, height: 1024 },
190
191
  { id: "desktop", label: "Desktop", width: 1280, height: 800 },
191
192
  { id: "fit", label: "Ajustar" },
192
193
  { id: "custom", label: "Personalizado" }
193
- ], Pe = 25, Re = 150, fe = 100;
194
- function Qe(e, t, s) {
195
- const r = s !== void 0 ? e.screenForPath(s) : e.screenOf(t), o = t && r && e.screenOf(t)?.id === r.id ? t : void 0;
196
- return { screen: r, scenario: o };
197
- }
198
- function $e(e, t, s) {
199
- const r = new URLSearchParams(e), o = gt(r), a = r.get(M.component) ?? void 0, d = ve(o, a) ? t.component(a) : void 0, l = r.get(M.scenario) ?? void 0, w = d || !re(o, l) ? void 0 : t.scenario(l), h = r.get(M.fixture) ?? void 0, u = d ? h ?? t.componentFixture(d.id, d.defaultFixture)?.id ?? d.fixtures?.[0]?.id : void 0, c = r.get(M.network), g = d ? void 0 : Qe(t, w, s), k = g?.screen && g.screen.controls.length > 0 ? t.resolveControls(g.screen, {
200
- scenario: g.scenario,
201
- requested: qe(r)
194
+ ], _e = 25, Fe = 150, we = 100;
195
+ function Je(e, t, n) {
196
+ const r = n !== void 0 ? e.screenForPath(n) : e.screenOf(t), s = t && r && e.screenOf(t)?.id === r.id ? t : void 0;
197
+ return { screen: r, scenario: s };
198
+ }
199
+ function Me(e, t, n) {
200
+ const r = new URLSearchParams(e), s = Nt(r), a = r.get(M.component) ?? void 0, c = be(s, a) ? t.component(a) : void 0, l = r.get(M.scenario) ?? void 0, h = c || !re(s, l) ? void 0 : t.scenario(l), p = r.get(M.fixture) ?? void 0, u = c ? p ?? t.componentFixture(c.id, c.defaultFixture)?.id ?? c.fixtures?.[0]?.id : void 0, i = r.get(M.network), f = c ? void 0 : Je(t, h, n), S = f?.screen && f.screen.controls.length > 0 ? t.resolveControls(f.screen, {
201
+ scenario: f.scenario,
202
+ requested: Ze(r)
202
203
  }).values : void 0;
203
204
  return {
204
- scenario: w?.id,
205
- handoff: o,
206
- component: d?.id,
205
+ scenario: h?.id,
206
+ handoff: s,
207
+ component: c?.id,
207
208
  // Precedência: URL, cenário, padrão do produto. O preview de componente não
208
209
  // tem persona, então o padrão não se aplica a ele.
209
- persona: r.get(M.persona) ?? w?.persona ?? (d ? void 0 : t.defaultPersona),
210
- fixture: d ? u : h ?? w?.fixture,
211
- network: Ft(c) ? c : w?.network ?? "success",
210
+ persona: r.get(M.persona) ?? h?.persona ?? (c ? void 0 : t.defaultPersona),
211
+ fixture: c ? u : p ?? h?.fixture,
212
+ network: jt(i) ? i : h?.network ?? "success",
212
213
  viewport: r.get(M.viewport) ?? "fit",
213
- customWidth: At(r.get(M.customWidth)),
214
+ customWidth: Zt(r.get(M.customWidth)),
214
215
  themeMode: r.get(M.themeMode) ?? t.product.theme?.modes?.[0],
215
216
  locale: r.get(M.locale) ?? t.product.theme?.locales?.[0],
216
217
  dataSource: r.get(M.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
217
218
  // Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
218
219
  // última escolha da pessoa e, na falta dela, pelo sistema.
219
- chromeTheme: Ot(r.get(M.chromeTheme)) ? r.get(M.chromeTheme) : void 0,
220
+ chromeTheme: qt(r.get(M.chromeTheme)) ? r.get(M.chromeTheme) : void 0,
220
221
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
221
222
  // de tela, então precisa ser explícito para não sumir sem pedido.
222
223
  chrome: r.get(M.chrome) !== "0",
223
224
  inspector: r.get(M.inspector) !== "0",
224
- panelTab: zt(r.get(M.panelTab)) ? r.get(M.panelTab) : "variations",
225
- zoom: et(r.get(M.zoom)),
225
+ panelTab: Gt(r.get(M.panelTab)) ? r.get(M.panelTab) : "variations",
226
+ zoom: nt(r.get(M.zoom)),
226
227
  rotated: r.get(M.rotated) === "1",
227
228
  highlight: r.get(M.highlight) === "1",
228
- screenControls: k
229
+ screenControls: S
229
230
  };
230
231
  }
231
- function ae(e, t, s) {
232
- const r = new URLSearchParams(), o = t.scenario(e.scenario);
233
- if (e.component ? r.set(M.component, e.component) : e.scenario && r.set(M.scenario, e.scenario), e.persona && e.persona !== (o?.persona ?? t.defaultPersona) && r.set(M.persona, e.persona), e.component && e.fixture ? r.set(M.fixture, e.fixture) : e.fixture && e.fixture !== o?.fixture && r.set(M.fixture, e.fixture), e.network !== (o?.network ?? "success") && r.set(M.network, e.network), e.screenControls && !e.component) {
234
- const u = Qe(t, o, s), c = u.screen ? t.resolveControls(u.screen, { scenario: u.scenario }).values : {}, g = u.screen ? t.controlsOf(u.screen).map((k) => k.id) : Object.keys(e.screenControls);
235
- for (const k of g) {
236
- const $ = e.screenControls[k];
237
- $ !== void 0 && $ !== c[k] && r.set(`${be}${k}`, $);
232
+ function ae(e, t, n) {
233
+ const r = new URLSearchParams(), s = t.scenario(e.scenario);
234
+ if (e.component ? r.set(M.component, e.component) : e.scenario && r.set(M.scenario, e.scenario), e.persona && e.persona !== (s?.persona ?? t.defaultPersona) && r.set(M.persona, e.persona), e.component && e.fixture ? r.set(M.fixture, e.fixture) : e.fixture && e.fixture !== s?.fixture && r.set(M.fixture, e.fixture), e.network !== (s?.network ?? "success") && r.set(M.network, e.network), e.screenControls && !e.component) {
235
+ const u = Je(t, s, n), i = u.screen ? t.resolveControls(u.screen, { scenario: u.scenario }).values : {}, f = u.screen ? t.controlsOf(u.screen).map((S) => S.id) : Object.keys(e.screenControls);
236
+ for (const S of f) {
237
+ const N = e.screenControls[S];
238
+ N !== void 0 && N !== i[S] && r.set(`${ke}${S}`, N);
238
239
  }
239
240
  }
240
241
  e.viewport !== "fit" && r.set(M.viewport, e.viewport), e.viewport === "custom" && e.customWidth && r.set(M.customWidth, String(e.customWidth));
241
242
  const a = t.product.theme?.modes?.[0];
242
243
  e.themeMode && e.themeMode !== a && r.set(M.themeMode, e.themeMode);
243
- const d = t.product.theme?.locales?.[0];
244
- e.locale && e.locale !== d && r.set(M.locale, e.locale);
244
+ const c = t.product.theme?.locales?.[0];
245
+ e.locale && e.locale !== c && r.set(M.locale, e.locale);
245
246
  const l = t.product.dataSources?.default ?? "fixtures";
246
247
  e.dataSource && e.dataSource !== l && r.set(M.dataSource, e.dataSource), e.chromeTheme && r.set(M.chromeTheme, e.chromeTheme), e.chrome || r.set(M.chrome, "0"), e.inspector || r.set(M.inspector, "0"), e.panelTab === "info" && r.set(M.panelTab, "info");
247
- const w = et(e.zoom === void 0 ? null : String(e.zoom));
248
- w !== fe && r.set(M.zoom, String(w)), e.rotated && r.set(M.rotated, "1"), e.highlight && r.set(M.highlight, "1"), Ee(r, e.handoff);
249
- const h = r.toString();
250
- return h ? `?${h}` : "";
251
- }
252
- function Xe(e, t = {}) {
253
- const s = !!t.frame, [r, o] = D(() => ke()), a = j(r), d = I((m) => {
254
- a.current = m, o(m);
255
- }, []), l = j(!1), w = I((m) => {
248
+ const h = nt(e.zoom === void 0 ? null : String(e.zoom));
249
+ h !== we && r.set(M.zoom, String(h)), e.rotated && r.set(M.rotated, "1"), e.highlight && r.set(M.highlight, "1"), Pe(r, e.handoff);
250
+ const p = r.toString();
251
+ return p ? `?${p}` : "";
252
+ }
253
+ function et(e, t = {}) {
254
+ const n = !!t.frame, [r, s] = D(() => Ce()), a = q(r), c = K((m) => {
255
+ a.current = m, s(m);
256
+ }, []), l = q(!1), h = K((m) => {
256
257
  l.current = !0;
257
258
  try {
258
259
  window.history.replaceState(null, "", m);
@@ -260,143 +261,143 @@ function Xe(e, t = {}) {
260
261
  l.current = !1;
261
262
  }
262
263
  }, []);
263
- K(() => {
264
- const m = () => d(ke());
264
+ V(() => {
265
+ const m = () => c(Ce());
265
266
  return window.addEventListener("popstate", m), () => window.removeEventListener("popstate", m);
266
- }, [d]), K(() => {
267
- if (!s) return;
268
- const m = window.history, { pushState: p, replaceState: b } = m, N = (P) => {
269
- const i = a.current;
270
- if (window.location.pathname !== i.path) return !1;
271
- const f = ze(i.search, he(window.location.href).search), x = ie(i.path, f);
272
- if (`${window.location.pathname}${window.location.search}` !== x && b.call(m, m.state, "", `${x}${window.location.hash}`), f === i.search) return !0;
273
- const O = { path: i.path, search: f };
274
- return a.current = O, queueMicrotask(() => {
275
- a.current === O && (o(O), se(
267
+ }, [c]), V(() => {
268
+ if (!n) return;
269
+ const m = window.history, { pushState: w, replaceState: k } = m, x = (T) => {
270
+ const d = a.current;
271
+ if (window.location.pathname !== d.path) return !1;
272
+ const g = Ae(d.search, he(window.location.href).search), C = ie(d.path, g);
273
+ if (`${window.location.pathname}${window.location.search}` !== C && k.call(m, m.state, "", `${C}${window.location.hash}`), g === d.search) return !0;
274
+ const F = { path: d.path, search: g };
275
+ return a.current = F, queueMicrotask(() => {
276
+ a.current === F && (s(F), se(
276
277
  window.parent === window ? void 0 : window.parent,
277
- { ds: 1, type: "navigate", url: x, replace: P },
278
+ { ds: 1, type: "navigate", url: C, replace: T },
278
279
  window.location.origin
279
280
  ));
280
281
  }), !0;
281
282
  };
282
- return m.replaceState = function(P, i, f) {
283
- b.call(m, P, i, f), l.current || N(!0);
284
- }, m.pushState = function(P, i, f) {
285
- const x = `${window.location.pathname}${window.location.search}${window.location.hash}`;
286
- b.call(m, P, i, f), !N(!1) && (b.call(m, m.state, "", x), p.call(m, P, i, f));
287
- }, N(!0), () => {
288
- m.pushState = p, m.replaceState = b;
283
+ return m.replaceState = function(T, d, g) {
284
+ k.call(m, T, d, g), l.current || x(!0);
285
+ }, m.pushState = function(T, d, g) {
286
+ const C = `${window.location.pathname}${window.location.search}${window.location.hash}`;
287
+ k.call(m, T, d, g), !x(!1) && (k.call(m, m.state, "", C), w.call(m, T, d, g));
288
+ }, x(!0), () => {
289
+ m.pushState = w, m.replaceState = k;
289
290
  };
290
- }, [s]), K(() => {
291
- if (!s || window.parent === window) return;
292
- const m = window.location.origin, p = (N) => {
293
- const P = Ze(N, { origin: m, source: window.parent });
294
- if (P?.type !== "location") return;
295
- const { path: i, search: f } = he(P.url);
296
- w(ie(i, f)), d({ path: i, search: f });
291
+ }, [n]), V(() => {
292
+ if (!n || window.parent === window) return;
293
+ const m = window.location.origin, w = (x) => {
294
+ const T = Qe(x, { origin: m, source: window.parent });
295
+ if (T?.type !== "location") return;
296
+ const { path: d, search: g } = he(T.url);
297
+ h(ie(d, g)), c({ path: d, search: g });
297
298
  };
298
- window.addEventListener("message", p);
299
- const b = ke();
299
+ window.addEventListener("message", w);
300
+ const k = Ce();
300
301
  return se(
301
302
  window.parent,
302
- { ds: 1, type: "ready", url: ie(b.path, b.search) },
303
+ { ds: 1, type: "ready", url: ie(k.path, k.search) },
303
304
  m
304
- ), () => window.removeEventListener("message", p);
305
- }, [s, d, w]);
306
- const h = U(
307
- () => $e(r.search, e, r.path),
305
+ ), () => window.removeEventListener("message", w);
306
+ }, [n, c, h]);
307
+ const p = A(
308
+ () => Me(r.search, e, r.path),
308
309
  [r.path, r.search, e]
309
- ), u = I(
310
- (m, p, b = !1) => {
311
- if (s) {
312
- const P = ie(m, p), i = he(P);
313
- w(P), d(i), se(
310
+ ), u = K(
311
+ (m, w, k = !1) => {
312
+ if (n) {
313
+ const T = ie(m, w), d = he(T);
314
+ h(T), c(d), se(
314
315
  window.parent === window ? void 0 : window.parent,
315
- { ds: 1, type: "navigate", url: P, replace: b },
316
+ { ds: 1, type: "navigate", url: T, replace: k },
316
317
  window.location.origin
317
318
  );
318
319
  return;
319
320
  }
320
- const N = `${m}${p}`;
321
- b ? window.history.replaceState(null, "", N) : window.history.pushState(null, "", N), d({ path: m, search: p });
321
+ const x = `${m}${w}`;
322
+ k ? window.history.replaceState(null, "", x) : window.history.pushState(null, "", x), c({ path: m, search: w });
322
323
  },
323
- [s, d, w]
324
- ), c = I(() => {
324
+ [n, c, h]
325
+ ), i = K(() => {
325
326
  const m = a.current;
326
- return m === r ? h : $e(m.search, e, m.path);
327
- }, [h, r, e]), g = I(
327
+ return m === r ? p : Me(m.search, e, m.path);
328
+ }, [p, r, e]), f = K(
328
329
  (m) => {
329
- const p = a.current, b = { ...c(), ...m }, N = ze(ae(b, e, p.path), p.search);
330
- N !== p.search && u(p.path, N, !0);
330
+ const w = a.current, k = { ...i(), ...m }, x = Ae(ae(k, e, w.path), w.search);
331
+ x !== w.search && u(w.path, x, !0);
331
332
  },
332
- [c, u, e]
333
- ), k = I(
333
+ [i, u, e]
334
+ ), S = K(
334
335
  (m) => {
335
- const p = c().screenControls ?? {};
336
- Object.entries(m).some(([N, P]) => p[N] !== P) && g({ screenControls: { ...p, ...m } });
336
+ const w = i().screenControls ?? {};
337
+ Object.entries(m).some(([x, T]) => w[x] !== T) && f({ screenControls: { ...w, ...m } });
337
338
  },
338
- [c, g]
339
- ), $ = I(
340
- (m, p) => {
341
- const b = Tt(m, a.current, e, {
342
- controls: p?.controls
339
+ [i, f]
340
+ ), N = K(
341
+ (m, w) => {
342
+ const k = Kt(m, a.current, e, {
343
+ controls: w?.controls
343
344
  });
344
- u(b.path, b.search, p?.replace ?? !1);
345
+ u(k.path, k.search, w?.replace ?? !1);
345
346
  },
346
347
  [u, e]
347
- ), L = I(
348
+ ), $ = K(
348
349
  (m) => {
349
- const p = e.scenario(m);
350
- if (!p || !re(h.handoff, m)) return;
351
- const b = {
352
- ...h,
353
- scenario: p.id,
350
+ const w = e.scenario(m);
351
+ if (!w || !re(p.handoff, m)) return;
352
+ const k = {
353
+ ...p,
354
+ scenario: w.id,
354
355
  component: void 0,
355
- persona: p.persona,
356
- fixture: p.fixture,
357
- network: p.network ?? "success",
356
+ persona: w.persona,
357
+ fixture: w.fixture,
358
+ network: w.network ?? "success",
358
359
  // Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
359
360
  screenControls: void 0
360
361
  };
361
- u(p.route, ae(b, e, p.route), !1);
362
+ u(w.route, ae(k, e, w.route), !1);
362
363
  },
363
- [h, u, e]
364
- ), S = I(
365
- (m, p) => {
366
- const b = e.component(m);
367
- if (!b || !ve(h.handoff, m)) return;
368
- const N = {
369
- ...h,
364
+ [p, u, e]
365
+ ), _ = K(
366
+ (m, w) => {
367
+ const k = e.component(m);
368
+ if (!k || !be(p.handoff, m)) return;
369
+ const x = {
370
+ ...p,
370
371
  scenario: void 0,
371
- component: b.id,
372
+ component: k.id,
372
373
  persona: void 0,
373
374
  fixture: void 0,
374
375
  network: "success",
375
376
  screenControls: void 0
376
377
  };
377
- N.fixture = e.componentFixture(b.id, b.defaultFixture)?.id ?? b.fixtures?.[0]?.id, u("/", ae(N, e), p?.replace ?? !1);
378
+ x.fixture = e.componentFixture(k.id, k.defaultFixture)?.id ?? k.fixtures?.[0]?.id, u("/", ae(x, e), w?.replace ?? !1);
378
379
  },
379
- [h, u, e]
380
- ), y = I(
381
- (m, p) => {
382
- const b = e.screensFor({ handoff: h.handoff }).find((i) => i.id === m);
383
- if (!b) return;
384
- const N = b.variations[0];
385
- if (N) {
386
- const i = {
387
- ...h,
388
- scenario: N.id,
380
+ [p, u, e]
381
+ ), v = K(
382
+ (m, w) => {
383
+ const k = e.screensFor({ handoff: p.handoff }).find((d) => d.id === m);
384
+ if (!k) return;
385
+ const x = k.variations[0];
386
+ if (x) {
387
+ const d = {
388
+ ...p,
389
+ scenario: x.id,
389
390
  component: void 0,
390
- persona: N.persona,
391
- fixture: N.fixture,
392
- network: N.network ?? "success",
391
+ persona: x.persona,
392
+ fixture: x.fixture,
393
+ network: x.network ?? "success",
393
394
  screenControls: void 0
394
395
  };
395
- u(N.route, ae(i, e, N.route), p?.replace ?? !1);
396
+ u(x.route, ae(d, e, x.route), w?.replace ?? !1);
396
397
  return;
397
398
  }
398
- const P = {
399
- ...h,
399
+ const T = {
400
+ ...p,
400
401
  scenario: void 0,
401
402
  component: void 0,
402
403
  persona: void 0,
@@ -404,157 +405,161 @@ function Xe(e, t = {}) {
404
405
  network: "success",
405
406
  screenControls: void 0
406
407
  };
407
- u(b.href, ae(P, e, b.href), p?.replace ?? !1);
408
+ u(k.href, ae(T, e, k.href), w?.replace ?? !1);
408
409
  },
409
- [h, u, e]
410
- ), E = I(
411
- (m, p, b) => u(m || "/", p, b?.replace ?? !1),
410
+ [p, u, e]
411
+ ), L = K(
412
+ (m, w, k) => u(m || "/", w, k?.replace ?? !1),
412
413
  [u]
413
- ), v = U(() => _t(h), [h]);
414
+ ), b = A(() => Bt(p), [p]);
414
415
  return {
415
416
  location: r,
416
- controls: h,
417
- viewport: v,
418
- setControls: g,
419
- setScreenControls: k,
420
- navigate: $,
421
- openScenario: L,
422
- openComponent: S,
423
- openScreen: y,
424
- go: E
417
+ controls: p,
418
+ viewport: b,
419
+ setControls: f,
420
+ setScreenControls: S,
421
+ navigate: N,
422
+ openScenario: $,
423
+ openComponent: _,
424
+ openScreen: v,
425
+ go: L
425
426
  };
426
427
  }
427
- function Tt(e, t, s, r = {}) {
428
- const o = e.split("#")[0] ?? e, a = o.indexOf("?"), d = (a === -1 ? o : o.slice(0, a)) || "/", l = a === -1 ? void 0 : o.slice(a + 1), w = new URLSearchParams(t.search), h = $e(t.search, s, t.path), u = !Pt(s, d, t.path);
429
- let c;
428
+ function Kt(e, t, n, r = {}) {
429
+ const s = e.split("#")[0] ?? e, a = s.indexOf("?"), c = (a === -1 ? s : s.slice(0, a)) || "/", l = a === -1 ? void 0 : s.slice(a + 1), h = new URLSearchParams(t.search), p = Me(t.search, n, t.path), u = !Ht(n, c, t.path);
430
+ let i;
430
431
  if (l === void 0 && r.controls === void 0)
431
- c = new URLSearchParams(t.search), u && (bt(c), Je(c));
432
+ i = new URLSearchParams(t.search), u && (Mt(i), tt(i));
432
433
  else {
433
- const k = new URLSearchParams(l ?? "");
434
- c = new URLSearchParams();
435
- for (const [$, L] of w)
436
- !Rt($) || k.has($) || u && !Te($) || c.append($, L);
437
- h.scenario && !k.has(M.scenario) && h.persona && h.persona !== s.defaultPersona && !c.has(M.persona) && !k.has(M.persona) && c.set(M.persona, h.persona);
438
- for (const [$, L] of k) c.append($, L);
434
+ const S = new URLSearchParams(l ?? "");
435
+ i = new URLSearchParams();
436
+ for (const [N, $] of h)
437
+ !Wt(N) || S.has(N) || u && !Re(N) || i.append(N, $);
438
+ p.scenario && !S.has(M.scenario) && p.persona && p.persona !== n.defaultPersona && !i.has(M.persona) && !S.has(M.persona) && i.set(M.persona, p.persona);
439
+ for (const [N, $] of S) i.append(N, $);
439
440
  if (r.controls) {
440
- const $ = s.screenForPath(d), L = s.scenario(c.get(M.scenario) ?? void 0), S = L && $ && s.screenOf(L)?.id === $.id ? L : void 0, y = $ ? s.resolveControls($, { scenario: S }).values : {};
441
- for (const [E, v] of Object.entries(r.controls)) {
442
- const m = `${be}${E}`;
443
- y[E] === v ? c.delete(m) : c.set(m, v);
441
+ const N = n.screenForPath(c), $ = n.scenario(i.get(M.scenario) ?? void 0), _ = $ && N && n.screenOf($)?.id === N.id ? $ : void 0, v = N ? n.resolveControls(N, { scenario: _ }).values : {};
442
+ for (const [L, b] of Object.entries(r.controls)) {
443
+ const m = `${ke}${L}`;
444
+ v[L] === b ? i.delete(m) : i.set(m, b);
444
445
  }
445
446
  }
446
447
  }
447
- h.handoff && Ee(c, h.handoff);
448
- const g = c.toString();
449
- return { path: d, search: g ? `?${g}` : "" };
450
- }
451
- function ze(e, t) {
452
- const s = new URLSearchParams(e);
453
- Je(s);
454
- for (const [o, a] of new URLSearchParams(t))
455
- o === vt || Te(o) || s.append(o, a);
456
- const r = s.toString();
448
+ p.handoff && Pe(i, p.handoff);
449
+ const f = i.toString();
450
+ return { path: c, search: f ? `?${f}` : "" };
451
+ }
452
+ function Ae(e, t) {
453
+ const n = new URLSearchParams(e);
454
+ tt(n);
455
+ for (const [s, a] of new URLSearchParams(t))
456
+ s === $t || Re(s) || n.append(s, a);
457
+ const r = n.toString();
457
458
  return r ? `?${r}` : "";
458
459
  }
459
- function Je(e) {
460
+ function tt(e) {
460
461
  for (const t of [...e.keys()])
461
- Te(t) || e.delete(t);
462
+ Re(t) || e.delete(t);
462
463
  }
463
- function Pt(e, t, s) {
464
- const r = e.screenForPath(t)?.id, o = e.screenForPath(s)?.id;
465
- return r === void 0 && o === void 0 ? t === s : r === o;
464
+ function Ht(e, t, n) {
465
+ const r = e.screenForPath(t)?.id, s = e.screenForPath(n)?.id;
466
+ return r === void 0 && s === void 0 ? t === n : r === s;
466
467
  }
467
- function Rt(e) {
468
- return e.startsWith(be) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
468
+ function Wt(e) {
469
+ return e.startsWith(ke) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
469
470
  }
470
- function _t(e) {
471
+ function Bt(e) {
471
472
  if (e.viewport === "custom")
472
473
  return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
473
- const t = Et.find((s) => s.id === e.viewport) ?? {
474
+ const t = Vt.find((n) => n.id === e.viewport) ?? {
474
475
  id: "fit",
475
476
  label: "Ajustar"
476
477
  };
477
478
  return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
478
479
  }
479
- function et(e) {
480
- if (e === null) return fe;
480
+ function nt(e) {
481
+ if (e === null) return we;
481
482
  const t = Number.parseInt(e, 10);
482
- return Number.isFinite(t) ? Math.min(Re, Math.max(Pe, t)) : fe;
483
+ return Number.isFinite(t) ? Math.min(Fe, Math.max(_e, t)) : we;
483
484
  }
484
- function ke() {
485
+ function Ce() {
485
486
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
486
487
  }
487
- function Ft(e) {
488
- return e !== null && Ge.includes(e);
488
+ function jt(e) {
489
+ return e !== null && Ye.includes(e);
489
490
  }
490
- function Ot(e) {
491
+ function qt(e) {
491
492
  return e === "dark" || e === "light";
492
493
  }
493
- function zt(e) {
494
+ function Gt(e) {
494
495
  return e === "variations" || e === "info";
495
496
  }
496
- function At(e) {
497
+ function Zt(e) {
497
498
  if (!e) return;
498
499
  const t = Number.parseInt(e, 10);
499
500
  return Number.isFinite(t) && t > 0 ? t : void 0;
500
501
  }
501
- const Dt = "@brucesantos/design-space", Ae = "0.11.0", Ut = {
502
- mobile: /* @__PURE__ */ C(Z, { children: [
503
- /* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
504
- /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
502
+ const Yt = "@brucesantos/design-space", De = "0.13.0", Qt = {
503
+ mobile: /* @__PURE__ */ y(G, { children: [
504
+ /* @__PURE__ */ o("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
505
+ /* @__PURE__ */ o("path", { d: "M11 18.5h2" })
506
+ ] }),
507
+ tablet: /* @__PURE__ */ y(G, { children: [
508
+ /* @__PURE__ */ o("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
509
+ /* @__PURE__ */ o("path", { d: "M11 18.5h2" })
505
510
  ] }),
506
- tablet: /* @__PURE__ */ C(Z, { children: [
507
- /* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
508
- /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
511
+ desktop: /* @__PURE__ */ y(G, { children: [
512
+ /* @__PURE__ */ o("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
513
+ /* @__PURE__ */ o("path", { d: "M8.5 20.5h7M12 16.5v4" })
509
514
  ] }),
510
- desktop: /* @__PURE__ */ C(Z, { children: [
511
- /* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
512
- /* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
515
+ fit: /* @__PURE__ */ o("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
516
+ rotate: /* @__PURE__ */ y(G, { children: [
517
+ /* @__PURE__ */ o("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
518
+ /* @__PURE__ */ o("path", { d: "M20 4v4.5h-4.5" })
513
519
  ] }),
514
- fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
515
- rotate: /* @__PURE__ */ C(Z, { children: [
516
- /* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
517
- /* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
520
+ minus: /* @__PURE__ */ o("path", { d: "M5 12h14" }),
521
+ plus: /* @__PURE__ */ o("path", { d: "M5 12h14M12 5v14" }),
522
+ "arrow-up-right": /* @__PURE__ */ o("path", { d: "M7 17 17 7M8 7h9v9" }),
523
+ link: /* @__PURE__ */ y(G, { children: [
524
+ /* @__PURE__ */ o("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
525
+ /* @__PURE__ */ o("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
518
526
  ] }),
519
- minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
520
- plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
521
- "arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
522
- link: /* @__PURE__ */ C(Z, { children: [
523
- /* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
524
- /* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
527
+ check: /* @__PURE__ */ o("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
528
+ fullscreen: /* @__PURE__ */ o("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
529
+ components: /* @__PURE__ */ y(G, { children: [
530
+ /* @__PURE__ */ o("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
531
+ /* @__PURE__ */ o("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" }),
532
+ /* @__PURE__ */ o("path", { d: "M13 4h7v7M4 13v7h7", strokeDasharray: "2 2" })
525
533
  ] }),
526
- check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
527
- fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
528
- components: /* @__PURE__ */ C(Z, { children: [
529
- /* @__PURE__ */ n("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
530
- /* @__PURE__ */ n("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" }),
531
- /* @__PURE__ */ n("path", { d: "M13 4h7v7M4 13v7h7", strokeDasharray: "2 2" })
534
+ external: /* @__PURE__ */ y(G, { children: [
535
+ /* @__PURE__ */ o("path", { d: "M14 4h6v6M20 4l-8.5 8.5" }),
536
+ /* @__PURE__ */ o("path", { d: "M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10" })
532
537
  ] }),
533
- sun: /* @__PURE__ */ C(Z, { children: [
534
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
535
- /* @__PURE__ */ n("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
538
+ sun: /* @__PURE__ */ y(G, { children: [
539
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "4" }),
540
+ /* @__PURE__ */ o("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
536
541
  ] }),
537
- moon: /* @__PURE__ */ n("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
538
- panel: /* @__PURE__ */ C(Z, { children: [
539
- /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
540
- /* @__PURE__ */ n("path", { d: "M15 4v16" })
542
+ moon: /* @__PURE__ */ o("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
543
+ panel: /* @__PURE__ */ y(G, { children: [
544
+ /* @__PURE__ */ o("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
545
+ /* @__PURE__ */ o("path", { d: "M15 4v16" })
541
546
  ] }),
542
- alert: /* @__PURE__ */ C(Z, { children: [
543
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
544
- /* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
547
+ alert: /* @__PURE__ */ y(G, { children: [
548
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9" }),
549
+ /* @__PURE__ */ o("path", { d: "M12 7.5v5.5M12 16.2v.3" })
545
550
  ] }),
546
- chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
547
- search: /* @__PURE__ */ C(Z, { children: [
548
- /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
549
- /* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
551
+ chevron: /* @__PURE__ */ o("path", { d: "M9 6l6 6-6 6" }),
552
+ search: /* @__PURE__ */ y(G, { children: [
553
+ /* @__PURE__ */ o("circle", { cx: "11", cy: "11", r: "6.5" }),
554
+ /* @__PURE__ */ o("path", { d: "M20 20l-4.2-4.2" })
550
555
  ] }),
551
- copy: /* @__PURE__ */ C(Z, { children: [
552
- /* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
553
- /* @__PURE__ */ n("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
556
+ copy: /* @__PURE__ */ y(G, { children: [
557
+ /* @__PURE__ */ o("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
558
+ /* @__PURE__ */ o("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
554
559
  ] })
555
560
  };
556
- function W({ name: e, size: t = 16 }) {
557
- return /* @__PURE__ */ n(
561
+ function H({ name: e, size: t = 16 }) {
562
+ return /* @__PURE__ */ o(
558
563
  "svg",
559
564
  {
560
565
  className: "ds-icon",
@@ -568,7 +573,7 @@ function W({ name: e, size: t = 16 }) {
568
573
  strokeLinejoin: "round",
569
574
  "aria-hidden": "true",
570
575
  focusable: "false",
571
- children: Ut[e]
576
+ children: Qt[e]
572
577
  }
573
578
  );
574
579
  }
@@ -600,6 +605,7 @@ const oe = {
600
605
  copyPrompt: "Copie o link:",
601
606
  cleanReview: "Revisão limpa (Shift+C)",
602
607
  highlight: "Destacar componentes",
608
+ openFrame: "Abrir em nova janela",
603
609
  lightMode: "Tema claro",
604
610
  darkMode: "Tema escuro",
605
611
  engineVersion: (e) => `Design Space ${e}`,
@@ -689,7 +695,7 @@ const oe = {
689
695
  error: "Erro",
690
696
  warning: "Aviso",
691
697
  close: "Fechar diagnóstico",
692
- invalidControl: (e, t, s) => `O controle \`${e}\` não tem a opção \`${t}\`. Exibindo \`${s}\`.`,
698
+ invalidControl: (e, t, n) => `O controle \`${e}\` não tem a opção \`${t}\`. Exibindo \`${n}\`.`,
693
699
  unknownControl: (e, t) => `A tela não tem o controle \`${e}\` (pedido \`${t}\` na URL). O parâmetro foi ignorado.`
694
700
  },
695
701
  pr: {
@@ -717,7 +723,7 @@ const oe = {
717
723
  empty: "Nada para mostrar ainda",
718
724
  emptyHint: "O produto ainda não registrou telas nem componentes."
719
725
  }
720
- }, bn = {
726
+ }, Vn = {
721
727
  network: {
722
728
  success: "Success",
723
729
  loading: "Loading",
@@ -745,6 +751,7 @@ const oe = {
745
751
  copyPrompt: "Copy the link:",
746
752
  cleanReview: "Clean review (Shift+C)",
747
753
  highlight: "Highlight components",
754
+ openFrame: "Open in new window",
748
755
  lightMode: "Light theme",
749
756
  darkMode: "Dark theme",
750
757
  engineVersion: (e) => `Design Space ${e}`,
@@ -834,7 +841,7 @@ const oe = {
834
841
  error: "Error",
835
842
  warning: "Warning",
836
843
  close: "Close diagnostics",
837
- invalidControl: (e, t, s) => `Control \`${e}\` has no option \`${t}\`. Showing \`${s}\`.`,
844
+ invalidControl: (e, t, n) => `Control \`${e}\` has no option \`${t}\`. Showing \`${n}\`.`,
838
845
  unknownControl: (e, t) => `This screen has no control \`${e}\` (\`${t}\` requested in the URL). The parameter was ignored.`
839
846
  },
840
847
  pr: {
@@ -863,246 +870,258 @@ const oe = {
863
870
  emptyHint: "The product has not registered any screens or components yet."
864
871
  }
865
872
  };
866
- function Vt(e) {
873
+ function Xt(e) {
867
874
  if (!e) return oe;
868
875
  const t = { ...oe };
869
- for (const s of Object.keys(oe)) {
870
- const r = e[s];
871
- r && (t[s] = { ...oe[s], ...r });
876
+ for (const n of Object.keys(oe)) {
877
+ const r = e[n];
878
+ r && (t[n] = { ...oe[n], ...r });
872
879
  }
873
880
  return t;
874
881
  }
875
- const tt = mt(oe);
876
- function X() {
877
- return pt(tt);
882
+ const ot = Ct(oe);
883
+ function J() {
884
+ return St(ot);
878
885
  }
879
- const Sn = oe.network, Kt = [
886
+ const Kn = oe.network, Jt = [
880
887
  { id: "mobile", icon: "mobile" },
881
888
  { id: "tablet", icon: "tablet" },
882
889
  { id: "desktop", icon: "desktop" },
883
890
  { id: "fit", icon: "fit" }
884
- ], De = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
891
+ ], Ie = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
885
892
  function Ue(e, t) {
886
- return t > 0 ? De.find((s) => s > e) ?? Re : [...De].reverse().find((s) => s < e) ?? Pe;
893
+ return t > 0 ? Ie.find((n) => n > e) ?? Fe : [...Ie].reverse().find((n) => n < e) ?? _e;
887
894
  }
888
- function It({
895
+ function en({
889
896
  productName: e,
890
897
  viewportId: t,
891
- viewport: s,
898
+ viewport: n,
892
899
  zoom: r,
893
- rotated: o,
900
+ rotated: s,
894
901
  highlight: a,
895
- theme: d,
902
+ theme: c,
896
903
  issues: l,
897
- linkUrl: w,
898
- onViewport: h,
904
+ linkUrl: h,
905
+ onViewport: p,
899
906
  onRotate: u,
900
- onZoom: c,
901
- onHighlight: g,
902
- onCleanReview: k,
907
+ onZoom: i,
908
+ onHighlight: f,
909
+ onCleanReview: S,
910
+ onOpenFrame: N,
903
911
  onToggleTheme: $
904
912
  }) {
905
- const L = X(), S = L.topbar, [y, E] = D(!1), v = (t === "mobile" || t === "tablet") && !!(s.width && s.height), m = async () => {
913
+ const _ = J(), v = _.topbar, [L, b] = D(!1), m = (t === "mobile" || t === "tablet") && !!(n.width && n.height), w = async () => {
906
914
  try {
907
- await navigator.clipboard.writeText(w);
915
+ await navigator.clipboard.writeText(h);
908
916
  } catch {
909
- window.prompt(S.copyPrompt, w);
917
+ window.prompt(v.copyPrompt, h);
910
918
  }
911
- E(!0), window.setTimeout(() => E(!1), 1600);
919
+ b(!0), window.setTimeout(() => b(!1), 1600);
912
920
  };
913
- return /* @__PURE__ */ C("header", { className: "ds-topbar", "aria-label": S.region, children: [
914
- /* @__PURE__ */ C("div", { className: "ds-topbar__product", children: [
915
- /* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
916
- /* @__PURE__ */ n(
921
+ return /* @__PURE__ */ y("header", { className: "ds-topbar", "aria-label": v.region, children: [
922
+ /* @__PURE__ */ y("div", { className: "ds-topbar__product", children: [
923
+ /* @__PURE__ */ o("span", { className: "ds-topbar__name", children: e }),
924
+ /* @__PURE__ */ o(
917
925
  "a",
918
926
  {
919
927
  className: "ds-topbar__version",
920
- href: `https://www.npmjs.com/package/${Dt}/v/${Ae}`,
928
+ href: `https://www.npmjs.com/package/${Yt}/v/${De}`,
921
929
  target: "_blank",
922
930
  rel: "noreferrer",
923
- children: S.engineVersion(Ae)
931
+ children: v.engineVersion(De)
924
932
  }
925
933
  )
926
934
  ] }),
927
- /* @__PURE__ */ C("div", { className: "ds-topbar__view", children: [
928
- /* @__PURE__ */ C("div", { className: "ds-group", role: "group", "aria-label": S.viewportGroup, children: [
929
- Kt.map((p) => {
930
- const b = L.viewport[p.id] ?? p.id;
931
- return /* @__PURE__ */ n(
935
+ /* @__PURE__ */ y("div", { className: "ds-topbar__view", children: [
936
+ /* @__PURE__ */ y("div", { className: "ds-group", role: "group", "aria-label": v.viewportGroup, children: [
937
+ Jt.map((k) => {
938
+ const x = _.viewport[k.id] ?? k.id;
939
+ return /* @__PURE__ */ o(
932
940
  "button",
933
941
  {
934
942
  type: "button",
935
943
  className: "ds-btn ds-btn--icon",
936
- "aria-pressed": t === p.id,
937
- "aria-label": b,
938
- title: b,
939
- onClick: () => h(p.id),
940
- children: /* @__PURE__ */ n(W, { name: p.icon })
944
+ "aria-pressed": t === k.id,
945
+ "aria-label": x,
946
+ title: x,
947
+ onClick: () => p(k.id),
948
+ children: /* @__PURE__ */ o(H, { name: k.icon })
941
949
  },
942
- p.id
950
+ k.id
943
951
  );
944
952
  }),
945
- /* @__PURE__ */ n(
953
+ /* @__PURE__ */ o(
946
954
  "button",
947
955
  {
948
956
  type: "button",
949
957
  className: "ds-btn ds-btn--icon",
950
- "aria-pressed": o,
951
- "aria-label": S.rotate,
952
- title: S.rotate,
953
- disabled: !v,
958
+ "aria-pressed": s,
959
+ "aria-label": v.rotate,
960
+ title: v.rotate,
961
+ disabled: !m,
954
962
  onClick: u,
955
- children: /* @__PURE__ */ n(W, { name: "rotate" })
963
+ children: /* @__PURE__ */ o(H, { name: "rotate" })
956
964
  }
957
965
  )
958
966
  ] }),
959
- /* @__PURE__ */ C("div", { className: "ds-group", role: "group", children: [
960
- /* @__PURE__ */ n(
967
+ /* @__PURE__ */ y("div", { className: "ds-group", role: "group", children: [
968
+ /* @__PURE__ */ o(
961
969
  "button",
962
970
  {
963
971
  type: "button",
964
972
  className: "ds-btn ds-btn--icon",
965
- "aria-label": S.zoomOut,
966
- title: S.zoomOut,
967
- disabled: r <= Pe,
968
- onClick: () => c(Ue(r, -1)),
969
- children: /* @__PURE__ */ n(W, { name: "minus" })
973
+ "aria-label": v.zoomOut,
974
+ title: v.zoomOut,
975
+ disabled: r <= _e,
976
+ onClick: () => i(Ue(r, -1)),
977
+ children: /* @__PURE__ */ o(H, { name: "minus" })
970
978
  }
971
979
  ),
972
- /* @__PURE__ */ n(
980
+ /* @__PURE__ */ o(
973
981
  "button",
974
982
  {
975
983
  type: "button",
976
984
  className: "ds-btn ds-btn--zoom",
977
- "aria-label": S.zoomReset,
978
- title: S.zoomReset,
979
- onClick: () => c(fe),
980
- children: S.zoomValue(r)
985
+ "aria-label": v.zoomReset,
986
+ title: v.zoomReset,
987
+ onClick: () => i(we),
988
+ children: v.zoomValue(r)
981
989
  }
982
990
  ),
983
- /* @__PURE__ */ n(
991
+ /* @__PURE__ */ o(
984
992
  "button",
985
993
  {
986
994
  type: "button",
987
995
  className: "ds-btn ds-btn--icon",
988
- "aria-label": S.zoomIn,
989
- title: S.zoomIn,
990
- disabled: r >= Re,
991
- onClick: () => c(Ue(r, 1)),
992
- children: /* @__PURE__ */ n(W, { name: "plus" })
996
+ "aria-label": v.zoomIn,
997
+ title: v.zoomIn,
998
+ disabled: r >= Fe,
999
+ onClick: () => i(Ue(r, 1)),
1000
+ children: /* @__PURE__ */ o(H, { name: "plus" })
993
1001
  }
994
1002
  )
995
1003
  ] }),
996
- /* @__PURE__ */ n(
1004
+ /* @__PURE__ */ o(
997
1005
  "button",
998
1006
  {
999
1007
  type: "button",
1000
1008
  className: "ds-btn ds-btn--icon",
1001
1009
  "aria-pressed": a,
1002
- "aria-label": S.highlight,
1003
- title: S.highlight,
1004
- onClick: g,
1005
- children: /* @__PURE__ */ n(W, { name: "components" })
1010
+ "aria-label": v.highlight,
1011
+ title: v.highlight,
1012
+ onClick: f,
1013
+ children: /* @__PURE__ */ o(H, { name: "components" })
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ o(
1017
+ "button",
1018
+ {
1019
+ type: "button",
1020
+ className: "ds-btn ds-btn--icon",
1021
+ "aria-label": v.cleanReview,
1022
+ title: v.cleanReview,
1023
+ onClick: S,
1024
+ children: /* @__PURE__ */ o(H, { name: "fullscreen" })
1006
1025
  }
1007
1026
  ),
1008
- /* @__PURE__ */ n(
1027
+ /* @__PURE__ */ o(
1009
1028
  "button",
1010
1029
  {
1011
1030
  type: "button",
1012
1031
  className: "ds-btn ds-btn--icon",
1013
- "aria-label": S.cleanReview,
1014
- title: S.cleanReview,
1015
- onClick: k,
1016
- children: /* @__PURE__ */ n(W, { name: "fullscreen" })
1032
+ "aria-label": v.openFrame,
1033
+ title: v.openFrame,
1034
+ onClick: N,
1035
+ children: /* @__PURE__ */ o(H, { name: "external" })
1017
1036
  }
1018
1037
  )
1019
1038
  ] }),
1020
- /* @__PURE__ */ C("div", { className: "ds-topbar__tools", children: [
1021
- /* @__PURE__ */ n(
1039
+ /* @__PURE__ */ y("div", { className: "ds-topbar__tools", children: [
1040
+ /* @__PURE__ */ o(
1022
1041
  "button",
1023
1042
  {
1024
1043
  type: "button",
1025
1044
  className: "ds-btn ds-btn--icon",
1026
- "aria-label": y ? S.copied : S.copyLink,
1027
- title: y ? S.copied : S.copyLink,
1028
- onClick: m,
1029
- children: /* @__PURE__ */ n(W, { name: y ? "check" : "link" })
1045
+ "aria-label": L ? v.copied : v.copyLink,
1046
+ title: L ? v.copied : v.copyLink,
1047
+ onClick: w,
1048
+ children: /* @__PURE__ */ o(H, { name: L ? "check" : "link" })
1030
1049
  }
1031
1050
  ),
1032
- /* @__PURE__ */ n(
1051
+ /* @__PURE__ */ o(
1033
1052
  "button",
1034
1053
  {
1035
1054
  type: "button",
1036
1055
  className: "ds-btn ds-btn--icon",
1037
- "aria-label": d === "dark" ? S.lightMode : S.darkMode,
1038
- title: d === "dark" ? S.lightMode : S.darkMode,
1056
+ "aria-label": c === "dark" ? v.lightMode : v.darkMode,
1057
+ title: c === "dark" ? v.lightMode : v.darkMode,
1039
1058
  onClick: $,
1040
- children: /* @__PURE__ */ n(W, { name: d === "dark" ? "sun" : "moon" })
1059
+ children: /* @__PURE__ */ o(H, { name: c === "dark" ? "sun" : "moon" })
1041
1060
  }
1042
1061
  ),
1043
- l.length > 0 && /* @__PURE__ */ n(Ht, { issues: l })
1062
+ l.length > 0 && /* @__PURE__ */ o(tn, { issues: l })
1044
1063
  ] })
1045
1064
  ] });
1046
1065
  }
1047
- function Ht({ issues: e }) {
1048
- const t = X(), [s, r] = D(!1), o = j(null), a = e.filter((w) => w.level === "error").length, d = e.length - a, l = t.topbar.diagnostics(a, d);
1049
- return K(() => {
1050
- if (!s) return;
1051
- const w = (u) => {
1052
- o.current?.contains(u.target) || r(!1);
1053
- }, h = (u) => {
1066
+ function tn({ issues: e }) {
1067
+ const t = J(), [n, r] = D(!1), s = q(null), a = e.filter((h) => h.level === "error").length, c = e.length - a, l = t.topbar.diagnostics(a, c);
1068
+ return V(() => {
1069
+ if (!n) return;
1070
+ const h = (u) => {
1071
+ s.current?.contains(u.target) || r(!1);
1072
+ }, p = (u) => {
1054
1073
  u.key === "Escape" && r(!1);
1055
1074
  };
1056
- return window.addEventListener("pointerdown", w), window.addEventListener("keydown", h), () => {
1057
- window.removeEventListener("pointerdown", w), window.removeEventListener("keydown", h);
1075
+ return window.addEventListener("pointerdown", h), window.addEventListener("keydown", p), () => {
1076
+ window.removeEventListener("pointerdown", h), window.removeEventListener("keydown", p);
1058
1077
  };
1059
- }, [s]), /* @__PURE__ */ C("div", { className: "ds-diagnostics", ref: o, children: [
1060
- /* @__PURE__ */ C(
1078
+ }, [n]), /* @__PURE__ */ y("div", { className: "ds-diagnostics", ref: s, children: [
1079
+ /* @__PURE__ */ y(
1061
1080
  "button",
1062
1081
  {
1063
1082
  type: "button",
1064
1083
  className: "ds-btn ds-diagnostics__trigger",
1065
1084
  "data-level": a > 0 ? "error" : "warning",
1066
- "aria-expanded": s,
1085
+ "aria-expanded": n,
1067
1086
  "aria-label": l,
1068
1087
  title: l,
1069
- onClick: () => r((w) => !w),
1088
+ onClick: () => r((h) => !h),
1070
1089
  children: [
1071
- /* @__PURE__ */ n(W, { name: "alert" }),
1072
- /* @__PURE__ */ n("span", { children: a > 0 ? a : d })
1090
+ /* @__PURE__ */ o(H, { name: "alert" }),
1091
+ /* @__PURE__ */ o("span", { children: a > 0 ? a : c })
1073
1092
  ]
1074
1093
  }
1075
1094
  ),
1076
- s && /* @__PURE__ */ C("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
1077
- /* @__PURE__ */ C("div", { className: "ds-diagnostics__head", children: [
1078
- /* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
1079
- /* @__PURE__ */ n("span", { className: "ds-muted", children: l })
1095
+ n && /* @__PURE__ */ y("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
1096
+ /* @__PURE__ */ y("div", { className: "ds-diagnostics__head", children: [
1097
+ /* @__PURE__ */ o("strong", { children: t.diagnostics.title }),
1098
+ /* @__PURE__ */ o("span", { className: "ds-muted", children: l })
1080
1099
  ] }),
1081
- /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((w, h) => /* @__PURE__ */ C("li", { className: "ds-diagnostics__item", "data-level": w.level, children: [
1082
- /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: w.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
1083
- /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: w.where }),
1084
- /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: w.message })
1085
- ] }, `${w.where}-${h}`)) })
1100
+ /* @__PURE__ */ o("ul", { className: "ds-diagnostics__list", children: e.map((h, p) => /* @__PURE__ */ y("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
1101
+ /* @__PURE__ */ o("span", { className: "ds-diagnostics__level", children: h.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
1102
+ /* @__PURE__ */ o("code", { className: "ds-diagnostics__where", children: h.where }),
1103
+ /* @__PURE__ */ o("span", { className: "ds-diagnostics__message", children: h.message })
1104
+ ] }, `${h.where}-${p}`)) })
1086
1105
  ] })
1087
1106
  ] });
1088
1107
  }
1089
- const Wt = 16;
1090
- function nt({ side: e, label: t, value: s, onChange: r, onStart: o, onEnd: a }) {
1091
- const d = j(void 0), l = e === "left" ? 1 : -1, w = (g) => {
1092
- if (g.button === 0) {
1093
- g.preventDefault(), d.current = { x: g.clientX, width: s };
1108
+ const nn = 16;
1109
+ function rt({ side: e, label: t, value: n, onChange: r, onStart: s, onEnd: a }) {
1110
+ const c = q(void 0), l = e === "left" ? 1 : -1, h = (f) => {
1111
+ if (f.button === 0) {
1112
+ f.preventDefault(), c.current = { x: f.clientX, width: n };
1094
1113
  try {
1095
- g.currentTarget.setPointerCapture(g.pointerId);
1114
+ f.currentTarget.setPointerCapture(f.pointerId);
1096
1115
  } catch {
1097
1116
  }
1098
- o?.();
1117
+ s?.();
1099
1118
  }
1100
- }, h = (g) => {
1101
- d.current && r(d.current.width + (g.clientX - d.current.x) * l);
1119
+ }, p = (f) => {
1120
+ c.current && r(c.current.width + (f.clientX - c.current.x) * l);
1102
1121
  }, u = () => {
1103
- d.current && (d.current = void 0, a?.());
1122
+ c.current && (c.current = void 0, a?.());
1104
1123
  };
1105
- return /* @__PURE__ */ n(
1124
+ return /* @__PURE__ */ o(
1106
1125
  "div",
1107
1126
  {
1108
1127
  className: "ds-resizer",
@@ -1110,166 +1129,166 @@ function nt({ side: e, label: t, value: s, onChange: r, onStart: o, onEnd: a })
1110
1129
  role: "separator",
1111
1130
  "aria-orientation": "vertical",
1112
1131
  "aria-label": t,
1113
- "aria-valuenow": s,
1132
+ "aria-valuenow": n,
1114
1133
  tabIndex: 0,
1115
- onPointerDown: w,
1116
- onPointerMove: h,
1134
+ onPointerDown: h,
1135
+ onPointerMove: p,
1117
1136
  onPointerUp: u,
1118
1137
  onPointerCancel: u,
1119
1138
  onLostPointerCapture: u,
1120
- onKeyDown: (g) => {
1121
- if (g.key !== "ArrowLeft" && g.key !== "ArrowRight") return;
1122
- g.preventDefault();
1123
- const k = g.key === "ArrowRight" ? 1 : -1;
1124
- r(s + k * l * Wt);
1139
+ onKeyDown: (f) => {
1140
+ if (f.key !== "ArrowLeft" && f.key !== "ArrowRight") return;
1141
+ f.preventDefault();
1142
+ const S = f.key === "ArrowRight" ? 1 : -1;
1143
+ r(n + S * l * nn);
1125
1144
  }
1126
1145
  }
1127
1146
  );
1128
1147
  }
1129
- function Bt({
1148
+ function on({
1130
1149
  registry: e,
1131
1150
  handoff: t,
1132
- activeScreen: s,
1151
+ activeScreen: n,
1133
1152
  activeComponent: r,
1134
- onOpenScreen: o,
1153
+ onOpenScreen: s,
1135
1154
  onOpenComponent: a,
1136
- width: d,
1155
+ width: c,
1137
1156
  onResize: l,
1138
- onResizeStart: w,
1139
- onResizeEnd: h
1157
+ onResizeStart: h,
1158
+ onResizeEnd: p
1140
1159
  }) {
1141
- const c = X().sidebar, [g, k] = D(""), [$, L] = D(() => /* @__PURE__ */ new Set()), S = j(null), y = e.screensFor({ handoff: t }), E = e.componentsFor(t), v = y.length > 0, m = E.length > 0, [p, b] = D(
1142
- () => r || !v ? "components" : "screens"
1160
+ const i = J().sidebar, [f, S] = D(""), [N, $] = D(() => /* @__PURE__ */ new Set()), _ = q(null), v = e.screensFor({ handoff: t }), L = e.componentsFor(t), b = v.length > 0, m = L.length > 0, [w, k] = D(
1161
+ () => r || !b ? "components" : "screens"
1143
1162
  );
1144
- K(() => {
1145
- r && m ? b("components") : s && v && b("screens");
1146
- }, [r, s, m, v]);
1147
- const N = p;
1148
- K(() => {
1149
- const _ = (V) => {
1150
- Gt(V) && (V.preventDefault(), S.current?.focus(), S.current?.select());
1163
+ V(() => {
1164
+ r && m ? k("components") : n && b && k("screens");
1165
+ }, [r, n, m, b]);
1166
+ const x = w;
1167
+ V(() => {
1168
+ const O = (I) => {
1169
+ an(I) && (I.preventDefault(), _.current?.focus(), _.current?.select());
1151
1170
  };
1152
- return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
1171
+ return window.addEventListener("keydown", O), () => window.removeEventListener("keydown", O);
1153
1172
  }, []);
1154
- const P = U(
1155
- () => e.searchScreens(g, { handoff: t }),
1156
- [t, g, e]
1157
- ), i = U(
1158
- () => e.searchComponents(g, t),
1159
- [t, g, e]
1160
- ), f = U(() => qt(i, c.ungrouped), [i, c.ungrouped]), x = U(() => Ye(P), [P]), T = g.trim().length > 0, O = (_) => L((V) => {
1161
- const R = new Set(V);
1162
- return R.has(_) ? R.delete(_) : R.add(_), R;
1173
+ const T = A(
1174
+ () => e.searchScreens(f, { handoff: t }),
1175
+ [t, f, e]
1176
+ ), d = A(
1177
+ () => e.searchComponents(f, t),
1178
+ [t, f, e]
1179
+ ), g = A(() => sn(d, i.ungrouped), [d, i.ungrouped]), C = A(() => Xe(T), [T]), E = f.trim().length > 0, F = (O) => $((I) => {
1180
+ const P = new Set(I);
1181
+ return P.has(O) ? P.delete(O) : P.add(O), P;
1163
1182
  });
1164
- return /* @__PURE__ */ C("nav", { className: "ds-sidebar", "aria-label": c.region, style: { width: d }, children: [
1165
- /* @__PURE__ */ C("div", { className: "ds-search", children: [
1166
- /* @__PURE__ */ n(W, { name: "search", size: 14 }),
1167
- /* @__PURE__ */ n(
1183
+ return /* @__PURE__ */ y("nav", { className: "ds-sidebar", "aria-label": i.region, style: { width: c }, children: [
1184
+ /* @__PURE__ */ y("div", { className: "ds-search", children: [
1185
+ /* @__PURE__ */ o(H, { name: "search", size: 14 }),
1186
+ /* @__PURE__ */ o(
1168
1187
  "input",
1169
1188
  {
1170
- ref: S,
1189
+ ref: _,
1171
1190
  className: "ds-input ds-search__input",
1172
1191
  type: "search",
1173
- value: g,
1174
- placeholder: c.searchPlaceholder,
1175
- "aria-label": c.searchLabel,
1176
- onChange: (_) => k(_.target.value),
1177
- onKeyDown: (_) => {
1178
- _.key === "Escape" && k("");
1192
+ value: f,
1193
+ placeholder: i.searchPlaceholder,
1194
+ "aria-label": i.searchLabel,
1195
+ onChange: (O) => S(O.target.value),
1196
+ onKeyDown: (O) => {
1197
+ O.key === "Escape" && S("");
1179
1198
  }
1180
1199
  }
1181
1200
  ),
1182
- /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: c.searchShortcut })
1201
+ /* @__PURE__ */ o("kbd", { className: "ds-kbd", "aria-hidden": "true", children: i.searchShortcut })
1183
1202
  ] }),
1184
- /* @__PURE__ */ C("div", { className: "ds-tabs", role: "tablist", "aria-label": c.tabs, children: [
1185
- /* @__PURE__ */ n(
1203
+ /* @__PURE__ */ y("div", { className: "ds-tabs", role: "tablist", "aria-label": i.tabs, children: [
1204
+ /* @__PURE__ */ o(
1186
1205
  Ve,
1187
1206
  {
1188
- selected: N === "screens",
1189
- label: c.screensTab,
1190
- count: T ? P.length : void 0,
1191
- onSelect: () => b("screens")
1207
+ selected: x === "screens",
1208
+ label: i.screensTab,
1209
+ count: E ? T.length : void 0,
1210
+ onSelect: () => k("screens")
1192
1211
  }
1193
1212
  ),
1194
- /* @__PURE__ */ n(
1213
+ /* @__PURE__ */ o(
1195
1214
  Ve,
1196
1215
  {
1197
- selected: N === "components",
1198
- label: c.componentsTab,
1199
- count: T ? i.length : void 0,
1200
- onSelect: () => b("components")
1216
+ selected: x === "components",
1217
+ label: i.componentsTab,
1218
+ count: E ? d.length : void 0,
1219
+ onSelect: () => k("components")
1201
1220
  }
1202
1221
  )
1203
1222
  ] }),
1204
- /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: N === "screens" ? v ? P.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: c.noMatch(g) }) : x.map((_) => {
1205
- const V = /* @__PURE__ */ n("ul", { className: "ds-items", children: _.screens.map((A) => /* @__PURE__ */ n(
1206
- jt,
1223
+ /* @__PURE__ */ o("div", { className: "ds-sidebar__list", role: "tabpanel", children: x === "screens" ? b ? T.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-empty", children: i.noMatch(f) }) : C.map((O) => {
1224
+ const I = /* @__PURE__ */ o("ul", { className: "ds-items", children: O.screens.map((U) => /* @__PURE__ */ o(
1225
+ rn,
1207
1226
  {
1208
- screen: A,
1209
- active: A.id === s && !r,
1210
- onOpen: o
1227
+ screen: U,
1228
+ active: U.id === n && !r,
1229
+ onOpen: s
1211
1230
  },
1212
- A.id
1231
+ U.id
1213
1232
  )) });
1214
- if (_.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: V }, "");
1215
- const R = `screens:${_.name}`, z = $.has(R) && !T;
1216
- return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1217
- /* @__PURE__ */ C(
1233
+ if (O.name === void 0) return /* @__PURE__ */ o("div", { className: "ds-group-section", children: I }, "");
1234
+ const P = `screens:${O.name}`, z = N.has(P) && !E;
1235
+ return /* @__PURE__ */ y("section", { className: "ds-group-section", children: [
1236
+ /* @__PURE__ */ y(
1218
1237
  "button",
1219
1238
  {
1220
1239
  type: "button",
1221
1240
  className: "ds-group-section__head",
1222
1241
  "aria-expanded": !z,
1223
- "aria-label": c.toggleGroup(_.name),
1224
- onClick: () => O(R),
1242
+ "aria-label": i.toggleGroup(O.name),
1243
+ onClick: () => F(P),
1225
1244
  children: [
1226
- /* @__PURE__ */ n(W, { name: "chevron", size: 12 }),
1227
- /* @__PURE__ */ n("span", { children: _.name }),
1228
- /* @__PURE__ */ n("span", { className: "ds-count", children: _.screens.length })
1245
+ /* @__PURE__ */ o(H, { name: "chevron", size: 12 }),
1246
+ /* @__PURE__ */ o("span", { children: O.name }),
1247
+ /* @__PURE__ */ o("span", { className: "ds-count", children: O.screens.length })
1229
1248
  ]
1230
1249
  }
1231
1250
  ),
1232
- !z && V
1233
- ] }, R);
1234
- }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: c.emptyScreens }) : m ? i.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: c.noMatch(g) }) : f.map(({ group: _, items: V }) => {
1235
- const R = $.has(_) && !T;
1236
- return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1237
- /* @__PURE__ */ C(
1251
+ !z && I
1252
+ ] }, P);
1253
+ }) : /* @__PURE__ */ o("p", { className: "ds-empty", children: i.emptyScreens }) : m ? d.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-empty", children: i.noMatch(f) }) : g.map(({ group: O, items: I }) => {
1254
+ const P = N.has(O) && !E;
1255
+ return /* @__PURE__ */ y("section", { className: "ds-group-section", children: [
1256
+ /* @__PURE__ */ y(
1238
1257
  "button",
1239
1258
  {
1240
1259
  type: "button",
1241
1260
  className: "ds-group-section__head",
1242
- "aria-expanded": !R,
1243
- "aria-label": c.toggleGroup(_),
1244
- onClick: () => O(_),
1261
+ "aria-expanded": !P,
1262
+ "aria-label": i.toggleGroup(O),
1263
+ onClick: () => F(O),
1245
1264
  children: [
1246
- /* @__PURE__ */ n(W, { name: "chevron", size: 12 }),
1247
- /* @__PURE__ */ n("span", { children: _ }),
1248
- /* @__PURE__ */ n("span", { className: "ds-count", children: V.length })
1265
+ /* @__PURE__ */ o(H, { name: "chevron", size: 12 }),
1266
+ /* @__PURE__ */ o("span", { children: O }),
1267
+ /* @__PURE__ */ o("span", { className: "ds-count", children: I.length })
1249
1268
  ]
1250
1269
  }
1251
1270
  ),
1252
- !R && /* @__PURE__ */ n("ul", { className: "ds-items", children: V.map((z) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1271
+ !P && /* @__PURE__ */ o("ul", { className: "ds-items", children: I.map((z) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
1253
1272
  "button",
1254
1273
  {
1255
1274
  type: "button",
1256
1275
  className: "ds-item",
1257
1276
  "aria-current": z.id === r ? "true" : void 0,
1258
1277
  onClick: () => a(z.id),
1259
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: z.name })
1278
+ children: /* @__PURE__ */ o("span", { className: "ds-item__title", children: z.name })
1260
1279
  }
1261
1280
  ) }, z.id)) })
1262
- ] }, _);
1263
- }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: c.emptyComponents }) }),
1264
- /* @__PURE__ */ n(
1265
- nt,
1281
+ ] }, O);
1282
+ }) : /* @__PURE__ */ o("p", { className: "ds-empty", children: i.emptyComponents }) }),
1283
+ /* @__PURE__ */ o(
1284
+ rt,
1266
1285
  {
1267
1286
  side: "left",
1268
- label: c.resize,
1269
- value: d,
1287
+ label: i.resize,
1288
+ value: c,
1270
1289
  onChange: l,
1271
- onStart: w,
1272
- onEnd: h
1290
+ onStart: h,
1291
+ onEnd: p
1273
1292
  }
1274
1293
  )
1275
1294
  ] });
@@ -1277,10 +1296,10 @@ function Bt({
1277
1296
  function Ve({
1278
1297
  selected: e,
1279
1298
  label: t,
1280
- count: s,
1299
+ count: n,
1281
1300
  onSelect: r
1282
1301
  }) {
1283
- return /* @__PURE__ */ C(
1302
+ return /* @__PURE__ */ y(
1284
1303
  "button",
1285
1304
  {
1286
1305
  type: "button",
@@ -1290,155 +1309,155 @@ function Ve({
1290
1309
  tabIndex: e ? 0 : -1,
1291
1310
  onClick: r,
1292
1311
  children: [
1293
- /* @__PURE__ */ n("span", { children: t }),
1294
- s !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: s })
1312
+ /* @__PURE__ */ o("span", { children: t }),
1313
+ n !== void 0 && /* @__PURE__ */ o("span", { className: "ds-count", children: n })
1295
1314
  ]
1296
1315
  }
1297
1316
  );
1298
1317
  }
1299
- function jt({
1318
+ function rn({
1300
1319
  screen: e,
1301
1320
  active: t,
1302
- onOpen: s
1321
+ onOpen: n
1303
1322
  }) {
1304
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ C(
1323
+ return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ y(
1305
1324
  "button",
1306
1325
  {
1307
1326
  type: "button",
1308
1327
  className: "ds-item",
1309
1328
  "aria-current": t ? "true" : void 0,
1310
- onClick: () => s(e.id),
1329
+ onClick: () => n(e.id),
1311
1330
  children: [
1312
- /* @__PURE__ */ n("span", { className: "ds-item__title", children: e.name }),
1313
- e.variations.length > 1 && /* @__PURE__ */ n("span", { className: "ds-count", children: e.variations.length })
1331
+ /* @__PURE__ */ o("span", { className: "ds-item__title", children: e.name }),
1332
+ e.variations.length > 1 && /* @__PURE__ */ o("span", { className: "ds-count", children: e.variations.length })
1314
1333
  ]
1315
1334
  }
1316
1335
  ) });
1317
1336
  }
1318
- function qt(e, t) {
1319
- const s = /* @__PURE__ */ new Map();
1337
+ function sn(e, t) {
1338
+ const n = /* @__PURE__ */ new Map();
1320
1339
  for (const r of e) {
1321
- const o = r.group?.trim() || t, a = s.get(o) ?? [];
1322
- a.push(r), s.set(o, a);
1340
+ const s = r.group?.trim() || t, a = n.get(s) ?? [];
1341
+ a.push(r), n.set(s, a);
1323
1342
  }
1324
- return [...s].map(([r, o]) => ({ group: r, items: o }));
1343
+ return [...n].map(([r, s]) => ({ group: r, items: s }));
1325
1344
  }
1326
- function Gt(e) {
1345
+ function an(e) {
1327
1346
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
1328
1347
  }
1329
- function Zt({
1348
+ function cn({
1330
1349
  screen: e,
1331
1350
  variations: t,
1332
- components: s,
1351
+ components: n,
1333
1352
  deploy: r,
1334
- labels: o,
1353
+ labels: s,
1335
1354
  overrides: a
1336
1355
  }) {
1337
- const d = o.pr, l = [`## ${e.name}`, ""];
1356
+ const c = s.pr, l = [`## ${e.name}`, ""];
1338
1357
  e.description && l.push(e.description, ""), l.push(`\`${e.route.path}\``, "");
1339
- const w = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, h = r.shortCommit ? d.commit(r.shortCommit) : void 0;
1340
- if (l.push(`### ${d.variations}`, ""), t.length === 0) {
1358
+ const h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0;
1359
+ if (l.push(`### ${c.variations}`, ""), t.length === 0) {
1341
1360
  const u = new URL(e.href, r.origin);
1342
- Ne(u.searchParams, a), l.push(`- [${o.panel.defaultVariation}](${u.toString()})`);
1361
+ $e(u.searchParams, a), l.push(`- [${s.panel.defaultVariation}](${u.toString()})`);
1343
1362
  }
1344
1363
  for (const u of t) {
1345
- const c = me(u, { origin: r.origin, overrides: a });
1346
- let g = `- [${ot(u.title)}](${c})`;
1347
- if (w) {
1348
- const k = me(u, { origin: w, overrides: a });
1349
- g += ` · [${h ?? d.immutableLink}](${k})`;
1350
- } else h && (g += ` · ${h}`);
1351
- l.push(g);
1364
+ const i = me(u, { origin: r.origin, overrides: a });
1365
+ let f = `- [${st(u.title)}](${i})`;
1366
+ if (h) {
1367
+ const S = me(u, { origin: h, overrides: a });
1368
+ f += ` · [${p ?? c.immutableLink}](${S})`;
1369
+ } else p && (f += ` · ${p}`);
1370
+ l.push(f);
1352
1371
  }
1353
- if (l.push(""), s.length > 0) {
1354
- l.push(`### ${d.components}`, ""), l.push(`| ${d.component} | ${d.source} |`, "| --- | --- |");
1355
- for (const u of s) {
1356
- const c = u.source ? `\`${we(u.source)}\`` : d.empty;
1357
- l.push(`| ${we(u.name)} (\`${u.id}\`) | ${c} |`);
1372
+ if (l.push(""), n.length > 0) {
1373
+ l.push(`### ${c.components}`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1374
+ for (const u of n) {
1375
+ const i = u.source ? `\`${ge(u.source)}\`` : c.empty;
1376
+ l.push(`| ${ge(u.name)} (\`${u.id}\`) | ${i} |`);
1358
1377
  }
1359
1378
  l.push("");
1360
1379
  }
1361
- l.push(`### ${d.expected}`, ""), t.length === 0 && l.push(`**${o.panel.defaultVariation}**`, "", d.noExpected, "");
1380
+ l.push(`### ${c.expected}`, ""), t.length === 0 && l.push(`**${s.panel.defaultVariation}**`, "", c.noExpected, "");
1362
1381
  for (const u of t) {
1363
1382
  if (l.push(`**${u.title}**`, ""), u.expected?.length)
1364
- for (const c of u.expected) l.push(`- ${c}`);
1383
+ for (const i of u.expected) l.push(`- ${i}`);
1365
1384
  else
1366
- l.push(d.noExpected);
1385
+ l.push(c.noExpected);
1367
1386
  l.push("");
1368
1387
  }
1369
1388
  return `${l.join(`
1370
1389
  `).trimEnd()}
1371
1390
  `;
1372
1391
  }
1373
- function we(e) {
1392
+ function ge(e) {
1374
1393
  return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
1375
1394
  }
1376
- function ot(e) {
1395
+ function st(e) {
1377
1396
  return e.replace(/([[\]])/g, "\\$1");
1378
1397
  }
1379
- function Yt({
1398
+ function ln({
1380
1399
  flow: e,
1381
1400
  registry: t,
1382
- open: s,
1401
+ open: n,
1383
1402
  deploy: r,
1384
- labels: o,
1403
+ labels: s,
1385
1404
  overrides: a
1386
1405
  }) {
1387
- const d = o.pr, l = [`## ${e.name}`, ""], w = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, h = r.shortCommit ? d.commit(r.shortCommit) : void 0, u = (c, g) => {
1388
- if (s && s.screen.id === c.id) {
1389
- const L = new URL(s.location.path || "/", g), S = new URLSearchParams(s.location.search);
1390
- for (const y of St) S.delete(y);
1391
- for (const [y, E] of S) L.searchParams.append(y, E);
1392
- return Ne(L.searchParams, a), L.toString();
1406
+ const c = s.pr, l = [`## ${e.name}`, ""], h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0, u = (i, f) => {
1407
+ if (n && n.screen.id === i.id) {
1408
+ const $ = new URL(n.location.path || "/", f), _ = new URLSearchParams(n.location.search);
1409
+ for (const v of Et) _.delete(v);
1410
+ for (const [v, L] of _) $.searchParams.append(v, L);
1411
+ return $e($.searchParams, a), $.toString();
1393
1412
  }
1394
- const k = c.variations[0];
1395
- if (k) return me(k, { origin: g, overrides: a });
1396
- const $ = new URL(c.href, g);
1397
- return Ne($.searchParams, a), $.toString();
1413
+ const S = i.variations[0];
1414
+ if (S) return me(S, { origin: f, overrides: a });
1415
+ const N = new URL(i.href, f);
1416
+ return $e(N.searchParams, a), N.toString();
1398
1417
  };
1399
- for (const c of e.screens) {
1400
- l.push(`### ${c.name}`, ""), c.description && l.push(c.description, "");
1401
- let g = `\`${c.route.path}\` · [${d.open}](${u(c, r.origin)})`;
1402
- if (w ? g += ` · [${h ?? d.immutableLink}](${u(c, w)})` : h && (g += ` · ${h}`), l.push(g, ""), c.controls.length > 0) {
1403
- l.push(`**${d.controls}**`, "");
1404
- for (const y of c.controls) {
1405
- l.push(`- ${le(y.title)} (\`${y.id}\`)`);
1406
- for (const E of y.controls) {
1407
- const v = Se(E), m = E.options.map(
1408
- (p) => p.value === v ? `${le(p.label)} (\`${p.value}\`, ${d.defaultOption})` : `${le(p.label)} (\`${p.value}\`)`
1418
+ for (const i of e.screens) {
1419
+ l.push(`### ${i.name}`, ""), i.description && l.push(i.description, "");
1420
+ let f = `\`${i.route.path}\` · [${c.open}](${u(i, r.origin)})`;
1421
+ if (h ? f += ` · [${p ?? c.immutableLink}](${u(i, h)})` : p && (f += ` · ${p}`), l.push(f, ""), i.controls.length > 0) {
1422
+ l.push(`**${c.controls}**`, "");
1423
+ for (const v of i.controls) {
1424
+ l.push(`- ${le(v.title)} (\`${v.id}\`)`);
1425
+ for (const L of v.controls) {
1426
+ const b = Se(L), m = L.options.map(
1427
+ (w) => w.value === b ? `${le(w.label)} (\`${w.value}\`, ${c.defaultOption})` : `${le(w.label)} (\`${w.value}\`)`
1409
1428
  ).join(" · ");
1410
- l.push(` - ${le(E.label)} (\`c.${E.id}\`): ${m}`);
1429
+ l.push(` - ${le(L.label)} (\`c.${L.id}\`): ${m}`);
1411
1430
  }
1412
1431
  }
1413
1432
  l.push("");
1414
1433
  }
1415
- if (c.variations.length > 0) {
1416
- l.push(`**${d.shortcuts}**`, "");
1417
- for (const y of c.variations)
1434
+ if (i.variations.length > 0) {
1435
+ l.push(`**${c.shortcuts}**`, "");
1436
+ for (const v of i.variations)
1418
1437
  l.push(
1419
- `- [${ot(y.title)}](${me(y, { origin: r.origin, overrides: a })})`
1438
+ `- [${st(v.title)}](${me(v, { origin: r.origin, overrides: a })})`
1420
1439
  );
1421
1440
  l.push("");
1422
1441
  }
1423
- l.push(`**${d.expected}**`, "");
1424
- const k = s?.screen.id === c.id ? s.variation : void 0, $ = k?.expected?.length ? k.expected : c.route.expected, L = c.variations.filter(
1425
- (y) => y.expected?.length && y.id !== k?.id
1442
+ l.push(`**${c.expected}**`, "");
1443
+ const S = n?.screen.id === i.id ? n.variation : void 0, N = S?.expected?.length ? S.expected : i.route.expected, $ = i.variations.filter(
1444
+ (v) => v.expected?.length && v.id !== S?.id
1426
1445
  );
1427
- if (!$?.length && L.length === 0 && l.push(d.noExpected, ""), $?.length) {
1428
- for (const y of $) l.push(`- ${y}`);
1446
+ if (!N?.length && $.length === 0 && l.push(c.noExpected, ""), N?.length) {
1447
+ for (const v of N) l.push(`- ${v}`);
1429
1448
  l.push("");
1430
1449
  }
1431
- for (const y of L) {
1432
- l.push(`*${y.title}*`, "");
1433
- for (const E of y.expected ?? []) l.push(`- ${E}`);
1450
+ for (const v of $) {
1451
+ l.push(`*${v.title}*`, "");
1452
+ for (const L of v.expected ?? []) l.push(`- ${L}`);
1434
1453
  l.push("");
1435
1454
  }
1436
- const S = t.componentsOfScreen(c);
1437
- if (S.length > 0) {
1438
- l.push(`**${d.components}**`, ""), l.push(`| ${d.component} | ${d.source} |`, "| --- | --- |");
1439
- for (const y of S) {
1440
- const E = y.source ? `\`${we(y.source)}\`` : d.empty;
1441
- l.push(`| ${we(y.name)} (\`${y.id}\`) | ${E} |`);
1455
+ const _ = t.componentsOfScreen(i);
1456
+ if (_.length > 0) {
1457
+ l.push(`**${c.components}**`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1458
+ for (const v of _) {
1459
+ const L = v.source ? `\`${ge(v.source)}\`` : c.empty;
1460
+ l.push(`| ${ge(v.name)} (\`${v.id}\`) | ${L} |`);
1442
1461
  }
1443
1462
  l.push("");
1444
1463
  }
@@ -1450,51 +1469,51 @@ function Yt({
1450
1469
  function le(e) {
1451
1470
  return e.replace(/([*_[\]`])/g, "\\$1");
1452
1471
  }
1453
- function Qt(e) {
1454
- const { tab: t, onTab: s, width: r, onResize: o, onResizeStart: a, onResizeEnd: d } = e, l = X().panel, [w, h] = D(""), u = j(null), c = j(null), [g, k] = D(!1), [$, L] = D(() => /* @__PURE__ */ new Set()), S = (E) => L((v) => {
1455
- const m = new Set(v);
1456
- return m.has(E) ? m.delete(E) : m.add(E), m;
1457
- }), y = w.trim().length > 0;
1458
- return K(() => {
1459
- const E = (v) => {
1460
- en(v) && (v.preventDefault(), u.current?.focus(), u.current?.select());
1472
+ function dn(e) {
1473
+ const { tab: t, onTab: n, width: r, onResize: s, onResizeStart: a, onResizeEnd: c } = e, l = J().panel, [h, p] = D(""), u = q(null), i = q(null), [f, S] = D(!1), [N, $] = D(() => /* @__PURE__ */ new Set()), _ = (L) => $((b) => {
1474
+ const m = new Set(b);
1475
+ return m.has(L) ? m.delete(L) : m.add(L), m;
1476
+ }), v = h.trim().length > 0;
1477
+ return V(() => {
1478
+ const L = (b) => {
1479
+ pn(b) && (b.preventDefault(), u.current?.focus(), u.current?.select());
1461
1480
  };
1462
- return window.addEventListener("keydown", E), () => window.removeEventListener("keydown", E);
1463
- }, []), Be(() => {
1464
- k(tn(c.current, w));
1465
- }), /* @__PURE__ */ C("aside", { className: "ds-panel", "aria-label": l.region, style: { width: r }, children: [
1466
- /* @__PURE__ */ n(
1467
- nt,
1481
+ return window.addEventListener("keydown", L), () => window.removeEventListener("keydown", L);
1482
+ }, []), qe(() => {
1483
+ S(mn(i.current, h));
1484
+ }), /* @__PURE__ */ y("aside", { className: "ds-panel", "aria-label": l.region, style: { width: r }, children: [
1485
+ /* @__PURE__ */ o(
1486
+ rt,
1468
1487
  {
1469
1488
  side: "right",
1470
1489
  label: l.resize,
1471
1490
  value: r,
1472
- onChange: o,
1491
+ onChange: s,
1473
1492
  onStart: a,
1474
- onEnd: d
1493
+ onEnd: c
1475
1494
  }
1476
1495
  ),
1477
- /* @__PURE__ */ C("div", { className: "ds-search", children: [
1478
- /* @__PURE__ */ n(W, { name: "search", size: 14 }),
1479
- /* @__PURE__ */ n(
1496
+ /* @__PURE__ */ y("div", { className: "ds-search", children: [
1497
+ /* @__PURE__ */ o(H, { name: "search", size: 14 }),
1498
+ /* @__PURE__ */ o(
1480
1499
  "input",
1481
1500
  {
1482
1501
  ref: u,
1483
1502
  className: "ds-input ds-search__input",
1484
1503
  type: "search",
1485
- value: w,
1504
+ value: h,
1486
1505
  placeholder: l.searchPlaceholder,
1487
1506
  "aria-label": l.searchLabel,
1488
- onChange: (E) => h(E.target.value),
1489
- onKeyDown: (E) => {
1490
- E.key === "Escape" && h("");
1507
+ onChange: (L) => p(L.target.value),
1508
+ onKeyDown: (L) => {
1509
+ L.key === "Escape" && p("");
1491
1510
  }
1492
1511
  }
1493
1512
  ),
1494
- /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: l.searchShortcut })
1513
+ /* @__PURE__ */ o("kbd", { className: "ds-kbd", "aria-hidden": "true", children: l.searchShortcut })
1495
1514
  ] }),
1496
- /* @__PURE__ */ C("div", { className: "ds-tabs", role: "tablist", "aria-label": l.tabs, children: [
1497
- /* @__PURE__ */ n(
1515
+ /* @__PURE__ */ y("div", { className: "ds-tabs", role: "tablist", "aria-label": l.tabs, children: [
1516
+ /* @__PURE__ */ o(
1498
1517
  "button",
1499
1518
  {
1500
1519
  type: "button",
@@ -1502,11 +1521,11 @@ function Qt(e) {
1502
1521
  className: "ds-tab",
1503
1522
  "aria-selected": t === "variations",
1504
1523
  tabIndex: t === "variations" ? 0 : -1,
1505
- onClick: () => s("variations"),
1524
+ onClick: () => n("variations"),
1506
1525
  children: l.variationsTab
1507
1526
  }
1508
1527
  ),
1509
- /* @__PURE__ */ n(
1528
+ /* @__PURE__ */ o(
1510
1529
  "button",
1511
1530
  {
1512
1531
  type: "button",
@@ -1514,51 +1533,51 @@ function Qt(e) {
1514
1533
  className: "ds-tab",
1515
1534
  "aria-selected": t === "info",
1516
1535
  tabIndex: t === "info" ? 0 : -1,
1517
- onClick: () => s("info"),
1536
+ onClick: () => n("info"),
1518
1537
  children: l.infoTab
1519
1538
  }
1520
1539
  )
1521
1540
  ] }),
1522
- /* @__PURE__ */ C("div", { className: "ds-panel__body", role: "tabpanel", ref: c, children: [
1523
- t === "variations" ? /* @__PURE__ */ n(Xt, { ...e, collapsed: $, onToggle: S, filtering: y }) : /* @__PURE__ */ n(Jt, { ...e }),
1524
- g && /* @__PURE__ */ n("p", { className: "ds-empty", children: l.noMatch(w) })
1541
+ /* @__PURE__ */ y("div", { className: "ds-panel__body", role: "tabpanel", ref: i, children: [
1542
+ t === "variations" ? /* @__PURE__ */ o(un, { ...e, collapsed: N, onToggle: _, filtering: v }) : /* @__PURE__ */ o(hn, { ...e }),
1543
+ f && /* @__PURE__ */ o("p", { className: "ds-empty", children: l.noMatch(h) })
1525
1544
  ] })
1526
1545
  ] });
1527
1546
  }
1528
- function Xt({
1547
+ function un({
1529
1548
  registry: e,
1530
1549
  controls: t,
1531
- screen: s,
1550
+ screen: n,
1532
1551
  variation: r,
1533
- component: o,
1552
+ component: s,
1534
1553
  componentFixture: a,
1535
- onOpenScenario: d,
1554
+ onOpenScenario: c,
1536
1555
  onOpenComponent: l,
1537
- onChange: w
1556
+ onChange: h
1538
1557
  }) {
1539
- const h = X(), u = h.panel;
1540
- if (o) {
1541
- const v = o.fixtures ?? [];
1542
- if (v.length === 0) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noComponentVariations });
1558
+ const p = J(), u = p.panel;
1559
+ if (s) {
1560
+ const b = s.fixtures ?? [];
1561
+ if (b.length === 0) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.noComponentVariations });
1543
1562
  const m = a.fixture;
1544
- return /* @__PURE__ */ C("div", { className: "ds-vcards", children: [
1545
- a.didFallback && a.requestedId && m && /* @__PURE__ */ n("p", { className: "ds-notice", children: u.fixtureFallback(a.requestedId, m.id) }),
1546
- /* @__PURE__ */ n(de, { title: o.name, hint: m?.description, children: /* @__PURE__ */ n(
1563
+ return /* @__PURE__ */ y("div", { className: "ds-vcards", children: [
1564
+ a.didFallback && a.requestedId && m && /* @__PURE__ */ o("p", { className: "ds-notice", children: u.fixtureFallback(a.requestedId, m.id) }),
1565
+ /* @__PURE__ */ o(de, { title: s.name, hint: m?.description, children: /* @__PURE__ */ o(
1547
1566
  ee,
1548
1567
  {
1549
1568
  label: u.componentVariations,
1550
1569
  value: m?.id ?? "",
1551
- options: v.map((p) => ({ value: p.id, label: p.label })),
1552
- onChange: (p) => w({ fixture: p })
1570
+ options: b.map((w) => ({ value: w.id, label: w.label })),
1571
+ onChange: (w) => h({ fixture: w })
1553
1572
  }
1554
1573
  ) })
1555
1574
  ] });
1556
1575
  }
1557
- if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.nothingSelected });
1558
- const c = s.variations, g = e.product, k = g.theme?.modes ?? [], $ = g.theme?.locales ?? [], L = g.dataSources?.adapters ?? [], S = t.screenControls ?? {}, y = r && Lt(r, S) ? r : void 0, E = (v, m) => w({ screenControls: { ...S, [v]: m } });
1559
- return /* @__PURE__ */ C("div", { className: "ds-vcards", children: [
1560
- /* @__PURE__ */ C(de, { title: u.context, children: [
1561
- /* @__PURE__ */ n(
1576
+ if (!n) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.nothingSelected });
1577
+ const i = n.variations, f = e.product, S = f.theme?.modes ?? [], N = f.theme?.locales ?? [], $ = f.dataSources?.adapters ?? [], _ = t.screenControls ?? {}, v = r && Ut(r, _) ? r : void 0, L = (b, m) => h({ screenControls: { ..._, [b]: m } });
1578
+ return /* @__PURE__ */ y("div", { className: "ds-vcards", children: [
1579
+ /* @__PURE__ */ y(de, { title: u.context, children: [
1580
+ /* @__PURE__ */ o(
1562
1581
  ee,
1563
1582
  {
1564
1583
  label: u.persona,
@@ -1566,664 +1585,773 @@ function Xt({
1566
1585
  options: [
1567
1586
  // Com persona padrão, "nenhuma" não é uma situação possível.
1568
1587
  ...e.defaultPersona ? [] : [{ value: "", label: u.none }],
1569
- ...g.personas.map((v) => ({ value: v.id, label: v.name }))
1588
+ ...f.personas.map((b) => ({ value: b.id, label: b.name }))
1570
1589
  ],
1571
- onChange: (v) => w({ persona: v || void 0 })
1590
+ onChange: (b) => h({ persona: b || void 0 })
1572
1591
  }
1573
1592
  ),
1574
- /* @__PURE__ */ n(
1593
+ /* @__PURE__ */ o(
1575
1594
  ee,
1576
1595
  {
1577
1596
  label: u.network,
1578
1597
  value: t.network,
1579
- options: Ge.map((v) => ({ value: v, label: h.network[v] })),
1580
- onChange: (v) => w({ network: v })
1598
+ options: Ye.map((b) => ({ value: b, label: p.network[b] })),
1599
+ onChange: (b) => h({ network: b })
1581
1600
  }
1582
1601
  ),
1583
- k.length > 1 && /* @__PURE__ */ n(
1602
+ S.length > 1 && /* @__PURE__ */ o(
1584
1603
  ee,
1585
1604
  {
1586
1605
  label: u.theme,
1587
- value: t.themeMode ?? k[0],
1588
- options: k.map((v) => ({ value: v, label: v })),
1589
- onChange: (v) => w({ themeMode: v })
1606
+ value: t.themeMode ?? S[0],
1607
+ options: S.map((b) => ({ value: b, label: b })),
1608
+ onChange: (b) => h({ themeMode: b })
1590
1609
  }
1591
1610
  ),
1592
- $.length > 1 && /* @__PURE__ */ n(
1611
+ N.length > 1 && /* @__PURE__ */ o(
1593
1612
  ee,
1594
1613
  {
1595
1614
  label: u.locale,
1596
- value: t.locale ?? $[0],
1597
- options: $.map((v) => ({ value: v, label: v })),
1598
- onChange: (v) => w({ locale: v })
1615
+ value: t.locale ?? N[0],
1616
+ options: N.map((b) => ({ value: b, label: b })),
1617
+ onChange: (b) => h({ locale: b })
1599
1618
  }
1600
1619
  ),
1601
- L.length > 0 && /* @__PURE__ */ n(
1620
+ $.length > 0 && /* @__PURE__ */ o(
1602
1621
  ee,
1603
1622
  {
1604
1623
  label: u.dataSource,
1605
1624
  value: t.dataSource ?? "fixtures",
1606
1625
  options: [
1607
1626
  { value: "fixtures", label: u.fixturesOption },
1608
- ...L.map((v) => ({ value: v.id, label: v.label }))
1627
+ ...$.map((b) => ({ value: b.id, label: b.label }))
1609
1628
  ],
1610
- onChange: (v) => w({ dataSource: v })
1629
+ onChange: (b) => h({ dataSource: b })
1611
1630
  }
1612
1631
  )
1613
1632
  ] }),
1614
- s.controls.map((v) => {
1615
- const m = e.component(v.component);
1616
- return /* @__PURE__ */ n(
1633
+ n.controls.map((b) => {
1634
+ const m = e.component(b.component);
1635
+ return /* @__PURE__ */ o(
1617
1636
  de,
1618
1637
  {
1619
- title: v.title,
1620
- hint: v.note,
1638
+ title: b.title,
1639
+ hint: b.note,
1621
1640
  link: m ? { label: u.openComponent(m.name), onOpen: () => l(m.id) } : void 0,
1622
- children: v.controls.map((p) => /* @__PURE__ */ n(
1641
+ children: b.controls.map((w) => /* @__PURE__ */ o(
1623
1642
  ee,
1624
1643
  {
1625
- label: p.label,
1626
- hint: p.description,
1627
- value: S[p.id] ?? Se(p),
1628
- options: p.options ?? [],
1629
- onChange: (b) => E(p.id, b)
1644
+ label: w.label,
1645
+ hint: w.description,
1646
+ value: _[w.id] ?? Se(w),
1647
+ options: w.options ?? [],
1648
+ onChange: (k) => L(w.id, k)
1630
1649
  },
1631
- p.id
1650
+ w.id
1632
1651
  ))
1633
1652
  },
1634
- v.id
1653
+ b.id
1635
1654
  );
1636
1655
  }),
1637
- c.length > 0 && /* @__PURE__ */ n(de, { title: u.shortcuts, children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": u.variationsList, children: c.map((v) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1656
+ i.length > 0 && /* @__PURE__ */ o(de, { title: u.shortcuts, children: /* @__PURE__ */ o("ul", { className: "ds-items", "aria-label": u.variationsList, children: i.map((b) => /* @__PURE__ */ o("li", { "data-ds-filter": !0, children: /* @__PURE__ */ o(
1638
1657
  "button",
1639
1658
  {
1640
1659
  type: "button",
1641
1660
  className: "ds-item",
1642
- title: v.intent,
1643
- "aria-current": y?.id === v.id ? "true" : void 0,
1644
- onClick: () => d(v.id),
1645
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: v.title })
1661
+ title: b.intent,
1662
+ "aria-current": v?.id === b.id ? "true" : void 0,
1663
+ onClick: () => c(b.id),
1664
+ children: /* @__PURE__ */ o("span", { className: "ds-item__title", children: b.title })
1646
1665
  }
1647
- ) }, v.id)) }) })
1666
+ ) }, b.id)) }) })
1648
1667
  ] });
1649
1668
  }
1650
1669
  function de({
1651
1670
  title: e,
1652
1671
  hint: t,
1653
- link: s,
1672
+ link: n,
1654
1673
  children: r
1655
1674
  }) {
1656
- return /* @__PURE__ */ C("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
1657
- /* @__PURE__ */ C("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
1658
- /* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
1659
- s && /* @__PURE__ */ n(
1675
+ return /* @__PURE__ */ y("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
1676
+ /* @__PURE__ */ y("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
1677
+ /* @__PURE__ */ o("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
1678
+ n && /* @__PURE__ */ o(
1660
1679
  "button",
1661
1680
  {
1662
1681
  type: "button",
1663
1682
  className: "ds-btn ds-btn--icon ds-vcard__link",
1664
- "aria-label": s.label,
1665
- title: s.label,
1666
- onClick: s.onOpen,
1667
- children: /* @__PURE__ */ n(W, { name: "arrow-up-right", size: 14 })
1683
+ "aria-label": n.label,
1684
+ title: n.label,
1685
+ onClick: n.onOpen,
1686
+ children: /* @__PURE__ */ o(H, { name: "arrow-up-right", size: 14 })
1668
1687
  }
1669
1688
  )
1670
1689
  ] }),
1671
- /* @__PURE__ */ n("div", { className: "ds-vcard__body", children: r })
1690
+ /* @__PURE__ */ o("div", { className: "ds-vcard__body", children: r })
1672
1691
  ] });
1673
1692
  }
1674
1693
  function ee({
1675
1694
  label: e,
1676
1695
  hint: t,
1677
- value: s,
1696
+ value: n,
1678
1697
  options: r,
1679
- onChange: o
1698
+ onChange: s
1680
1699
  }) {
1681
- return /* @__PURE__ */ C("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
1682
- /* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
1683
- /* @__PURE__ */ n("select", { className: "ds-select", value: s, onChange: (a) => o(a.target.value), children: r.map((a) => /* @__PURE__ */ n("option", { value: a.value, children: a.label }, a.value)) })
1700
+ return /* @__PURE__ */ y("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
1701
+ /* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: e }),
1702
+ /* @__PURE__ */ o("select", { className: "ds-select", value: n, onChange: (a) => s(a.target.value), children: r.map((a) => /* @__PURE__ */ o("option", { value: a.value, children: a.label }, a.value)) })
1684
1703
  ] });
1685
1704
  }
1686
- function Jt({
1705
+ function hn({
1687
1706
  registry: e,
1688
1707
  controls: t,
1689
- deploy: s,
1708
+ deploy: n,
1690
1709
  location: r,
1691
- screen: o,
1710
+ screen: s,
1692
1711
  variation: a,
1693
- component: d,
1712
+ component: c,
1694
1713
  onOpenScenario: l,
1695
- onOpenComponent: w,
1696
- onOpenScreen: h
1714
+ onOpenComponent: h,
1715
+ onOpenScreen: p
1697
1716
  }) {
1698
- const u = X(), c = u.info, [g, k] = D(!1);
1699
- if (d) {
1700
- const p = e.usagesOf(d.id, { handoff: t.handoff });
1701
- return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1702
- /* @__PURE__ */ C(ne, { title: c.component, children: [
1703
- /* @__PURE__ */ n(H, { term: c.name, children: d.name }),
1704
- /* @__PURE__ */ n(H, { term: c.id, children: /* @__PURE__ */ n("code", { children: d.id }) }),
1705
- d.group && /* @__PURE__ */ n(H, { term: c.group, children: d.group }),
1706
- d.description && /* @__PURE__ */ n(H, { term: c.description, children: d.description }),
1707
- d.source && /* @__PURE__ */ n(H, { term: c.source, children: /* @__PURE__ */ n("code", { children: d.source }) })
1717
+ const u = J(), i = u.info, [f, S] = D(!1);
1718
+ if (c) {
1719
+ const w = e.usagesOf(c.id, { handoff: t.handoff });
1720
+ return /* @__PURE__ */ y("div", { className: "ds-info", children: [
1721
+ /* @__PURE__ */ y(ne, { title: i.component, children: [
1722
+ /* @__PURE__ */ o(W, { term: i.name, children: c.name }),
1723
+ /* @__PURE__ */ o(W, { term: i.id, children: /* @__PURE__ */ o("code", { children: c.id }) }),
1724
+ c.group && /* @__PURE__ */ o(W, { term: i.group, children: c.group }),
1725
+ c.description && /* @__PURE__ */ o(W, { term: i.description, children: c.description }),
1726
+ c.source && /* @__PURE__ */ o(W, { term: i.source, children: /* @__PURE__ */ o("code", { children: c.source }) })
1708
1727
  ] }),
1709
- /* @__PURE__ */ n(ne, { title: c.usedIn, children: p.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: c.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: p.map((b) => {
1710
- const N = b.variations.find((P) => P.components?.includes(d.id)) ?? b.variations[0];
1711
- return /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1712
- /* @__PURE__ */ n(
1728
+ /* @__PURE__ */ o(ne, { title: i.usedIn, children: w.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-muted", children: i.notUsed }) : /* @__PURE__ */ o("ul", { className: "ds-links", children: w.map((k) => {
1729
+ const x = k.variations.find((T) => T.components?.includes(c.id)) ?? k.variations[0];
1730
+ return /* @__PURE__ */ y("li", { "data-ds-filter": !0, children: [
1731
+ /* @__PURE__ */ o(
1713
1732
  "button",
1714
1733
  {
1715
1734
  type: "button",
1716
1735
  className: "ds-link",
1717
- onClick: () => N ? l(N.id) : h?.(b.id),
1718
- children: b.name
1736
+ onClick: () => x ? l(x.id) : p?.(k.id),
1737
+ children: k.name
1719
1738
  }
1720
1739
  ),
1721
- /* @__PURE__ */ n("code", { className: "ds-muted", children: b.id })
1722
- ] }, b.id);
1740
+ /* @__PURE__ */ o("code", { className: "ds-muted", children: k.id })
1741
+ ] }, k.id);
1723
1742
  }) }) })
1724
1743
  ] });
1725
1744
  }
1726
- if (!o) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.panel.nothingSelected });
1727
- const $ = a ? e.componentsOfScreen(o, a) : e.componentsOfScreen(o), L = e.persona(t.persona ?? a?.persona), S = e.rulesOf(a), y = t.screenControls ?? {}, E = a?.expected?.length ? a.expected : o.route.expected, v = t.handoff ? { handoff: t.handoff } : void 0, m = async () => {
1728
- const p = o.group ? e.flowOf(o, { handoff: t.handoff }) : void 0, b = p?.name ? Yt({
1729
- flow: { name: p.name, screens: p.screens },
1745
+ if (!s) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.panel.nothingSelected });
1746
+ const N = a ? e.componentsOfScreen(s, a) : e.componentsOfScreen(s), $ = e.persona(t.persona ?? a?.persona), _ = e.rulesOf(a), v = t.screenControls ?? {}, L = a?.expected?.length ? a.expected : s.route.expected, b = t.handoff ? { handoff: t.handoff } : void 0, m = async () => {
1747
+ const w = s.group ? e.flowOf(s, { handoff: t.handoff }) : void 0, k = w?.name ? ln({
1748
+ flow: { name: w.name, screens: w.screens },
1730
1749
  registry: e,
1731
- open: { screen: o, location: r, variation: a },
1732
- deploy: s,
1750
+ open: { screen: s, location: r, variation: a },
1751
+ deploy: n,
1733
1752
  labels: u,
1734
- overrides: v
1735
- }) : Zt({
1736
- screen: o,
1737
- variations: o.variations,
1738
- components: e.componentsOfScreen(o),
1739
- deploy: s,
1753
+ overrides: b
1754
+ }) : cn({
1755
+ screen: s,
1756
+ variations: s.variations,
1757
+ components: e.componentsOfScreen(s),
1758
+ deploy: n,
1740
1759
  labels: u,
1741
- overrides: v
1760
+ overrides: b
1742
1761
  });
1743
1762
  try {
1744
- await navigator.clipboard.writeText(b);
1763
+ await navigator.clipboard.writeText(k);
1745
1764
  } catch {
1746
- window.prompt(c.copyPrompt, b);
1765
+ window.prompt(i.copyPrompt, k);
1747
1766
  }
1748
- k(!0), window.setTimeout(() => k(!1), 1600);
1767
+ S(!0), window.setTimeout(() => S(!1), 1600);
1749
1768
  };
1750
- return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1751
- /* @__PURE__ */ C(ne, { title: c.screen, children: [
1752
- /* @__PURE__ */ n(H, { term: c.name, children: o.name }),
1753
- /* @__PURE__ */ n(H, { term: c.route, children: /* @__PURE__ */ n("code", { children: o.route.path }) }),
1754
- o.group && /* @__PURE__ */ n(H, { term: c.flow, children: o.group }),
1755
- o.description && /* @__PURE__ */ n(H, { term: c.description, children: o.description }),
1756
- /* @__PURE__ */ n(ue, { term: c.expected, items: E })
1769
+ return /* @__PURE__ */ y("div", { className: "ds-info", children: [
1770
+ /* @__PURE__ */ y(ne, { title: i.screen, children: [
1771
+ /* @__PURE__ */ o(W, { term: i.name, children: s.name }),
1772
+ /* @__PURE__ */ o(W, { term: i.route, children: /* @__PURE__ */ o("code", { children: s.route.path }) }),
1773
+ s.group && /* @__PURE__ */ o(W, { term: i.flow, children: s.group }),
1774
+ s.description && /* @__PURE__ */ o(W, { term: i.description, children: s.description }),
1775
+ /* @__PURE__ */ o(ue, { term: i.expected, items: L })
1757
1776
  ] }),
1758
- o.controls.length > 0 && /* @__PURE__ */ n(ne, { title: c.controls, children: o.controls.flatMap(
1759
- (p) => p.controls.map((b) => {
1760
- const N = y[b.id] ?? Se(b), P = b.options.find((i) => i.value === N);
1761
- return /* @__PURE__ */ C(H, { term: b.label, children: [
1762
- P?.label ?? N,
1777
+ s.controls.length > 0 && /* @__PURE__ */ o(ne, { title: i.controls, children: s.controls.flatMap(
1778
+ (w) => w.controls.map((k) => {
1779
+ const x = v[k.id] ?? Se(k), T = k.options.find((d) => d.value === x);
1780
+ return /* @__PURE__ */ y(W, { term: k.label, children: [
1781
+ T?.label ?? x,
1763
1782
  " ",
1764
- /* @__PURE__ */ n("code", { children: `c.${b.id}=${N}` })
1765
- ] }, `${p.id}/${b.id}`);
1783
+ /* @__PURE__ */ o("code", { children: `c.${k.id}=${x}` })
1784
+ ] }, `${w.id}/${k.id}`);
1766
1785
  })
1767
1786
  ) }),
1768
- a && /* @__PURE__ */ C(ne, { title: c.variation, children: [
1769
- /* @__PURE__ */ n(H, { term: c.name, children: a.title }),
1770
- /* @__PURE__ */ n(H, { term: c.id, children: /* @__PURE__ */ n("code", { children: a.id }) }),
1771
- L && /* @__PURE__ */ n(H, { term: c.persona, children: L.name }),
1772
- a.intent && /* @__PURE__ */ n(H, { term: c.intent, children: a.intent }),
1773
- /* @__PURE__ */ n(ue, { term: c.preconditions, items: a.preconditions }),
1774
- /* @__PURE__ */ n(ue, { term: c.actions, items: a.actions }),
1775
- /* @__PURE__ */ n(ue, { term: c.rules, items: S.map((p) => p.statement) }),
1776
- a.ticket && /* @__PURE__ */ n(H, { term: c.ticket, children: /* @__PURE__ */ n("code", { children: a.ticket }) })
1787
+ a && /* @__PURE__ */ y(ne, { title: i.variation, children: [
1788
+ /* @__PURE__ */ o(W, { term: i.name, children: a.title }),
1789
+ /* @__PURE__ */ o(W, { term: i.id, children: /* @__PURE__ */ o("code", { children: a.id }) }),
1790
+ $ && /* @__PURE__ */ o(W, { term: i.persona, children: $.name }),
1791
+ a.intent && /* @__PURE__ */ o(W, { term: i.intent, children: a.intent }),
1792
+ /* @__PURE__ */ o(ue, { term: i.preconditions, items: a.preconditions }),
1793
+ /* @__PURE__ */ o(ue, { term: i.actions, items: a.actions }),
1794
+ /* @__PURE__ */ o(ue, { term: i.rules, items: _.map((w) => w.statement) }),
1795
+ a.ticket && /* @__PURE__ */ o(W, { term: i.ticket, children: /* @__PURE__ */ o("code", { children: a.ticket }) })
1777
1796
  ] }),
1778
- $.length > 0 && /* @__PURE__ */ n(ne, { title: c.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: $.map((p) => /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1779
- /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => w(p.id), children: p.name }),
1780
- p.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: p.source })
1781
- ] }, p.id)) }) }),
1782
- /* @__PURE__ */ C("button", { type: "button", className: "ds-btn ds-btn--block", onClick: m, children: [
1783
- /* @__PURE__ */ n(W, { name: g ? "check" : "copy", size: 14 }),
1784
- /* @__PURE__ */ n("span", { children: g ? c.copiedForPr : c.copyForPr })
1797
+ N.length > 0 && /* @__PURE__ */ o(ne, { title: i.components, children: /* @__PURE__ */ o("ul", { className: "ds-links", children: N.map((w) => /* @__PURE__ */ y("li", { "data-ds-filter": !0, children: [
1798
+ /* @__PURE__ */ o("button", { type: "button", className: "ds-link", onClick: () => h(w.id), children: w.name }),
1799
+ w.source && /* @__PURE__ */ o("code", { className: "ds-muted", children: w.source })
1800
+ ] }, w.id)) }) }),
1801
+ /* @__PURE__ */ y("button", { type: "button", className: "ds-btn ds-btn--block", onClick: m, children: [
1802
+ /* @__PURE__ */ o(H, { name: f ? "check" : "copy", size: 14 }),
1803
+ /* @__PURE__ */ o("span", { children: f ? i.copiedForPr : i.copyForPr })
1785
1804
  ] })
1786
1805
  ] });
1787
1806
  }
1788
1807
  function ne({ title: e, children: t }) {
1789
- return /* @__PURE__ */ C("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1790
- /* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
1791
- /* @__PURE__ */ n("div", { className: "ds-defs", children: t })
1808
+ return /* @__PURE__ */ y("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1809
+ /* @__PURE__ */ o("h2", { className: "ds-section__title", children: e }),
1810
+ /* @__PURE__ */ o("div", { className: "ds-defs", children: t })
1792
1811
  ] });
1793
1812
  }
1794
- function H({ term: e, children: t }) {
1795
- return /* @__PURE__ */ C("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1796
- /* @__PURE__ */ n("dt", { children: e }),
1797
- /* @__PURE__ */ n("dd", { children: t })
1813
+ function W({ term: e, children: t }) {
1814
+ return /* @__PURE__ */ y("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1815
+ /* @__PURE__ */ o("dt", { children: e }),
1816
+ /* @__PURE__ */ o("dd", { children: t })
1798
1817
  ] });
1799
1818
  }
1800
1819
  function ue({ term: e, items: t }) {
1801
- return t?.length ? /* @__PURE__ */ C("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1802
- /* @__PURE__ */ n("dt", { children: e }),
1803
- /* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
1820
+ return t?.length ? /* @__PURE__ */ y("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1821
+ /* @__PURE__ */ o("dt", { children: e }),
1822
+ /* @__PURE__ */ o("dd", { children: /* @__PURE__ */ o("ul", { className: "ds-list", children: t.map((n) => /* @__PURE__ */ o("li", { children: n }, n)) }) })
1804
1823
  ] }) : null;
1805
1824
  }
1806
- function en(e) {
1825
+ function pn(e) {
1807
1826
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
1808
1827
  }
1809
- function tn(e, t) {
1828
+ function mn(e, t) {
1810
1829
  if (!e) return !1;
1811
- const s = Q(t), r = [...e.querySelectorAll("[data-ds-filter]")];
1812
- for (const o of r)
1813
- o.hidden = s.length > 0 && !Q(o.textContent ?? "").includes(s);
1814
- for (const o of e.querySelectorAll("[data-ds-filter-group]")) {
1815
- const a = [...o.querySelectorAll("[data-ds-filter]")], d = Q(
1816
- o.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
1830
+ const n = X(t), r = [...e.querySelectorAll("[data-ds-filter]")];
1831
+ for (const s of r)
1832
+ s.hidden = n.length > 0 && !X(s.textContent ?? "").includes(n);
1833
+ for (const s of e.querySelectorAll("[data-ds-filter-group]")) {
1834
+ const a = [...s.querySelectorAll("[data-ds-filter]")], c = X(
1835
+ s.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
1817
1836
  );
1818
- if (s.length > 0 && d.includes(s)) {
1819
- o.hidden = !1;
1837
+ if (n.length > 0 && c.includes(n)) {
1838
+ s.hidden = !1;
1820
1839
  for (const l of a) l.hidden = !1;
1821
1840
  continue;
1822
1841
  }
1823
- o.hidden = s.length > 0 && a.every((l) => l.hidden);
1842
+ s.hidden = n.length > 0 && a.every((l) => l.hidden);
1824
1843
  }
1825
- return s.length > 0 && r.length > 0 && r.every((o) => o.hidden);
1844
+ return n.length > 0 && r.length > 0 && r.every((s) => s.hidden);
1826
1845
  }
1827
- const nn = 24;
1828
- function on({
1846
+ const fn = 24;
1847
+ function wn({
1829
1848
  location: e,
1830
1849
  viewport: t,
1831
- zoom: s,
1850
+ zoom: n,
1832
1851
  title: r,
1833
- resizing: o,
1852
+ resizing: s,
1834
1853
  onFrameNavigate: a,
1835
- onShortcut: d,
1836
- onEffectiveZoom: l
1854
+ onShortcut: c,
1855
+ onEffectiveZoom: l,
1856
+ frameRef: h
1837
1857
  }) {
1838
- const w = j(null), h = j(null), u = rn(w), c = ie(e.path, e.search), [g] = D(c), k = j(c), $ = j(c), L = typeof window > "u" ? "" : window.location.origin, S = I(
1839
- (f) => {
1840
- $.current = f;
1841
- const x = h.current?.contentWindow;
1858
+ const p = q(null), u = gn(p), i = ie(e.path, e.search), [f] = D(i), S = q(i), N = q(i), $ = typeof window > "u" ? "" : window.location.origin, _ = K(
1859
+ (g) => {
1860
+ N.current = g;
1861
+ const C = h.current?.contentWindow;
1842
1862
  try {
1843
- x?.location.replace(new URL(f, L).toString());
1863
+ C?.location.replace(new URL(g, $).toString());
1844
1864
  } catch {
1845
- h.current && (h.current.src = f);
1865
+ h.current && (h.current.src = g);
1846
1866
  }
1847
1867
  },
1848
- [L]
1868
+ [h, $]
1849
1869
  );
1850
- K(() => {
1851
- if (c === k.current) return;
1852
- const f = k.current;
1853
- k.current = c, Fe(f) !== Fe(c) ? S(c) : se(h.current?.contentWindow, { ds: 1, type: "location", url: c }, L);
1854
- }, [c, S, L]), K(() => {
1855
- const f = (x) => {
1856
- const T = Ze(x, {
1857
- origin: L,
1870
+ V(() => {
1871
+ if (i === S.current) return;
1872
+ const g = S.current;
1873
+ S.current = i, ze(g) !== ze(i) ? _(i) : se(h.current?.contentWindow, { ds: 1, type: "location", url: i }, $);
1874
+ }, [i, h, _, $]), V(() => {
1875
+ const g = (C) => {
1876
+ const E = Qe(C, {
1877
+ origin: $,
1858
1878
  source: h.current?.contentWindow
1859
1879
  });
1860
- if (T)
1861
- switch (T.type) {
1880
+ if (E)
1881
+ switch (E.type) {
1862
1882
  case "ready": {
1863
- if (T.url === k.current) return;
1864
- if (T.url === $.current) {
1883
+ if (E.url === S.current) return;
1884
+ if (E.url === N.current) {
1865
1885
  se(
1866
1886
  h.current?.contentWindow,
1867
- { ds: 1, type: "location", url: k.current },
1868
- L
1887
+ { ds: 1, type: "location", url: S.current },
1888
+ $
1869
1889
  );
1870
1890
  return;
1871
1891
  }
1872
- k.current = T.url, $.current = T.url, a(T.url, !0);
1892
+ S.current = E.url, N.current = E.url, a(E.url, !0);
1873
1893
  return;
1874
1894
  }
1875
1895
  case "navigate":
1876
- k.current = T.url, a(T.url, T.replace);
1896
+ S.current = E.url, a(E.url, E.replace);
1877
1897
  return;
1878
1898
  case "shortcut":
1879
- d(T.key);
1899
+ c(E.key);
1880
1900
  return;
1881
1901
  default:
1882
1902
  return;
1883
1903
  }
1884
1904
  };
1885
- return window.addEventListener("message", f), () => window.removeEventListener("message", f);
1886
- }, [a, d, L]);
1887
- const y = !!t.width, E = y ? nn : 0, v = Math.max(0, u.width - E * 2), m = Math.max(0, u.height - E * 2), p = !t.width || v === 0 || t.width <= v, b = s === 100 && !p ? Math.max(10, Math.floor(v / t.width * 100)) : s, N = b / 100;
1888
- K(() => {
1889
- l?.(b);
1890
- }, [b, l]);
1891
- const P = t.width ?? v / N, i = t.height ?? m / N;
1892
- return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: w, "data-fit": y ? void 0 : "true", children: /* @__PURE__ */ n(
1905
+ return window.addEventListener("message", g), () => window.removeEventListener("message", g);
1906
+ }, [h, a, c, $]);
1907
+ const v = !!t.width, L = v ? fn : 0, b = Math.max(0, u.width - L * 2), m = Math.max(0, u.height - L * 2), w = !t.width || b === 0 || t.width <= b, k = n === 100 && !w ? Math.max(10, Math.floor(b / t.width * 100)) : n, x = k / 100;
1908
+ V(() => {
1909
+ l?.(k);
1910
+ }, [k, l]);
1911
+ const T = t.width ?? b / x, d = t.height ?? m / x;
1912
+ return /* @__PURE__ */ o("div", { className: "ds-canvas", ref: p, "data-fit": v ? void 0 : "true", children: /* @__PURE__ */ o(
1893
1913
  "div",
1894
1914
  {
1895
1915
  className: "ds-canvas__box",
1896
- style: { width: Math.floor(P * N), height: Math.floor(i * N) },
1897
- children: /* @__PURE__ */ n(
1916
+ style: { width: Math.floor(T * x), height: Math.floor(d * x) },
1917
+ children: /* @__PURE__ */ o(
1898
1918
  "iframe",
1899
1919
  {
1900
1920
  ref: h,
1901
- [kt]: "",
1921
+ [Lt]: "",
1902
1922
  className: "ds-frame",
1903
- src: g,
1923
+ src: f,
1904
1924
  title: r,
1905
1925
  style: {
1906
- width: Math.floor(P),
1907
- height: Math.floor(i),
1908
- transform: N === 1 ? void 0 : `scale(${N})`,
1909
- pointerEvents: o ? "none" : void 0
1926
+ width: Math.floor(T),
1927
+ height: Math.floor(d),
1928
+ transform: x === 1 ? void 0 : `scale(${x})`,
1929
+ pointerEvents: s ? "none" : void 0
1910
1930
  }
1911
1931
  }
1912
1932
  )
1913
1933
  }
1914
1934
  ) });
1915
1935
  }
1916
- function rn(e) {
1917
- const [t, s] = D({ width: 0, height: 0 });
1918
- return Be(() => {
1936
+ function gn(e) {
1937
+ const [t, n] = D({ width: 0, height: 0 });
1938
+ return qe(() => {
1919
1939
  const r = e.current;
1920
1940
  if (!r) return;
1921
- const o = () => {
1922
- const d = r.clientWidth, l = r.clientHeight;
1923
- s(
1924
- (w) => w.width === d && w.height === l ? w : { width: d, height: l }
1941
+ const s = () => {
1942
+ const c = r.clientWidth, l = r.clientHeight;
1943
+ n(
1944
+ (h) => h.width === c && h.height === l ? h : { width: c, height: l }
1925
1945
  );
1926
1946
  };
1927
- if (o(), typeof ResizeObserver > "u")
1928
- return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
1929
- const a = new ResizeObserver(o);
1947
+ if (s(), typeof ResizeObserver > "u")
1948
+ return window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
1949
+ const a = new ResizeObserver(s);
1930
1950
  return a.observe(r), () => a.disconnect();
1931
1951
  }, [e]), t;
1932
1952
  }
1933
- const rt = 2500;
1934
- class st extends Error {
1953
+ const at = 2500;
1954
+ class it extends Error {
1935
1955
  constructor(t) {
1936
1956
  super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
1937
1957
  }
1938
1958
  }
1939
- function Me(e) {
1959
+ function Ee(e) {
1940
1960
  if (e)
1941
1961
  return typeof e.data == "function" ? e.data() : e.data;
1942
1962
  }
1943
1963
  const Le = {
1944
1964
  id: "fixtures",
1945
1965
  label: "Fixtures",
1946
- load: async ({ scenario: e, fixture: t, network: s }) => {
1947
- switch (s) {
1966
+ load: async ({ scenario: e, fixture: t, network: n }) => {
1967
+ switch (n) {
1948
1968
  case "empty":
1949
1969
  return null;
1950
1970
  case "error":
1951
- throw new st(e.id);
1971
+ throw new it(e.id);
1952
1972
  case "loading":
1953
1973
  return new Promise(() => {
1954
1974
  });
1955
1975
  case "slow":
1956
- return await sn(rt), Me(t);
1976
+ return await vn(at), Ee(t);
1957
1977
  default:
1958
- return Me(t);
1978
+ return Ee(t);
1959
1979
  }
1960
1980
  }
1961
1981
  };
1962
- function kn(e) {
1963
- const { id: t, label: s, baseUrl: r, path: o, init: a, fallbackToFixture: d = !0 } = e;
1982
+ function Hn(e) {
1983
+ const { id: t, label: n, baseUrl: r, path: s, init: a, fallbackToFixture: c = !0 } = e;
1964
1984
  return {
1965
1985
  id: t,
1966
- label: s,
1986
+ label: n,
1967
1987
  load: async (l) => {
1968
- const w = new URL(o ? o(l) : l.scenario.route, r);
1988
+ const h = new URL(s ? s(l) : l.scenario.route, r);
1969
1989
  try {
1970
- const h = await fetch(w, a);
1971
- if (!h.ok) throw new Error(`${h.status} ${h.statusText}`);
1972
- return await h.json();
1973
- } catch (h) {
1974
- if (d) return Me(l.fixture);
1975
- throw new Error(`Adapter "${t}" falhou em ${w.toString()}`, { cause: h });
1990
+ const p = await fetch(h, a);
1991
+ if (!p.ok) throw new Error(`${p.status} ${p.statusText}`);
1992
+ return await p.json();
1993
+ } catch (p) {
1994
+ if (c) return Ee(l.fixture);
1995
+ throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: p });
1976
1996
  }
1977
1997
  }
1978
1998
  };
1979
1999
  }
1980
- function sn(e) {
2000
+ function vn(e) {
1981
2001
  return new Promise((t) => setTimeout(t, e));
1982
2002
  }
1983
- function an(e) {
1984
- const { scenario: t, fixture: s, network: r, adapter: o } = e, [a, d] = D({
2003
+ function bn(e) {
2004
+ const { scenario: t, fixture: n, network: r, adapter: s } = e, [a, c] = D({
1985
2005
  data: void 0,
1986
2006
  isLoading: !!t || r === "loading" || r === "slow",
1987
2007
  error: void 0
1988
2008
  });
1989
- return K(() => {
2009
+ return V(() => {
1990
2010
  if (!t)
1991
2011
  switch (r) {
1992
2012
  case "loading":
1993
- d({ data: void 0, isLoading: !0, error: void 0 });
2013
+ c({ data: void 0, isLoading: !0, error: void 0 });
1994
2014
  return;
1995
2015
  case "empty":
1996
- d({ data: null, isLoading: !1, error: void 0 });
2016
+ c({ data: null, isLoading: !1, error: void 0 });
1997
2017
  return;
1998
2018
  case "error":
1999
- d({
2019
+ c({
2000
2020
  data: void 0,
2001
2021
  isLoading: !1,
2002
- error: new st(e.screen ?? "—")
2022
+ error: new it(e.screen ?? "—")
2003
2023
  });
2004
2024
  return;
2005
2025
  case "slow": {
2006
- d({ data: void 0, isLoading: !0, error: void 0 });
2007
- const h = setTimeout(
2008
- () => d({ data: void 0, isLoading: !1, error: void 0 }),
2009
- rt
2026
+ c({ data: void 0, isLoading: !0, error: void 0 });
2027
+ const p = setTimeout(
2028
+ () => c({ data: void 0, isLoading: !1, error: void 0 }),
2029
+ at
2010
2030
  );
2011
- return () => clearTimeout(h);
2031
+ return () => clearTimeout(p);
2012
2032
  }
2013
2033
  default:
2014
- d({ data: void 0, isLoading: !1, error: void 0 });
2034
+ c({ data: void 0, isLoading: !1, error: void 0 });
2015
2035
  return;
2016
2036
  }
2017
2037
  let l = !0;
2018
- d({ data: void 0, isLoading: !0, error: void 0 });
2019
- const w = o ?? Le;
2020
- return Promise.resolve(w.load({ scenario: t, fixture: s, network: r })).then((h) => {
2021
- l && d({ data: h, isLoading: !1, error: void 0 });
2022
- }).catch((h) => {
2023
- l && d({
2038
+ c({ data: void 0, isLoading: !0, error: void 0 });
2039
+ const h = s ?? Le;
2040
+ return Promise.resolve(h.load({ scenario: t, fixture: n, network: r })).then((p) => {
2041
+ l && c({ data: p, isLoading: !1, error: void 0 });
2042
+ }).catch((p) => {
2043
+ l && c({
2024
2044
  data: void 0,
2025
2045
  isLoading: !1,
2026
- error: h instanceof Error ? h : new Error(String(h))
2046
+ error: p instanceof Error ? p : new Error(String(p))
2027
2047
  });
2028
2048
  }), () => {
2029
2049
  l = !1;
2030
2050
  };
2031
- }, [t, s, r, o, e.screen]), a;
2051
+ }, [t, n, r, s, e.screen]), a;
2032
2052
  }
2033
2053
  function Ke({ title: e, children: t }) {
2034
- return /* @__PURE__ */ C("div", { className: "ds-stage-empty", children: [
2035
- /* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
2054
+ return /* @__PURE__ */ y("div", { className: "ds-stage-empty", children: [
2055
+ /* @__PURE__ */ o("h2", { className: "ds-stage-empty__title", children: e }),
2036
2056
  t
2037
2057
  ] });
2038
2058
  }
2039
- function Ie(e) {
2059
+ const kn = /* @__PURE__ */ Symbol.for("react.memo"), Sn = /* @__PURE__ */ Symbol.for("react.forward_ref");
2060
+ class ct extends Error {
2061
+ }
2062
+ function lt(e) {
2040
2063
  const t = [];
2041
- return e.querySelectorAll(`[${Oe}]`).forEach((s, r) => {
2042
- const o = s.getBoundingClientRect();
2043
- o.width === 0 && o.height === 0 || t.push({
2044
- key: `${r}`,
2045
- id: s.getAttribute(Oe) ?? "",
2046
- top: o.top,
2047
- left: o.left,
2048
- width: o.width,
2049
- height: o.height
2050
- });
2051
- }), t;
2052
- }
2053
- const cn = 16;
2054
- function ln({ registry: e }) {
2055
- const t = X(), [s, r] = D(() => Ie(document));
2056
- return K(() => {
2057
- let o = 0;
2058
- const a = () => {
2059
- o || (o = window.requestAnimationFrame(() => {
2060
- o = 0, r(Ie(document));
2064
+ let n = e;
2065
+ for (; n && (typeof n == "function" || typeof n == "object") && !t.includes(n); ) {
2066
+ t.push(n);
2067
+ const r = n.$$typeof;
2068
+ if (r === kn) n = n.type;
2069
+ else if (r === Sn) n = n.render;
2070
+ else break;
2071
+ }
2072
+ return t;
2073
+ }
2074
+ function Cn(e) {
2075
+ const t = /* @__PURE__ */ new Map();
2076
+ for (const n of e) {
2077
+ const r = Array.isArray(n.implementation) ? n.implementation : n.implementation === void 0 ? [] : [n.implementation];
2078
+ for (const s of r)
2079
+ for (const a of lt(s)) {
2080
+ const c = t.get(a) ?? [];
2081
+ c.includes(n.id) || c.push(n.id), t.set(a, c);
2082
+ }
2083
+ }
2084
+ return t;
2085
+ }
2086
+ function yn(e, t) {
2087
+ const n = [];
2088
+ for (const r of [e.type, e.elementType])
2089
+ for (const s of lt(r))
2090
+ for (const a of t.get(s) ?? []) n.includes(a) || n.push(a);
2091
+ return n;
2092
+ }
2093
+ function xn(e) {
2094
+ return !!e && e.nodeType === 1;
2095
+ }
2096
+ function dt(e) {
2097
+ return typeof e.type == "string" && xn(e.stateNode);
2098
+ }
2099
+ function Te(e) {
2100
+ if (!e || typeof e != "object" || !("child" in e) || !("sibling" in e) || !("stateNode" in e))
2101
+ throw new ct("fiber sem child, sibling ou stateNode");
2102
+ }
2103
+ function ut(e, t) {
2104
+ for (let n = e.child; n; n = n.sibling)
2105
+ Te(n), dt(n) ? t.push(n.stateNode) : ut(n, t);
2106
+ }
2107
+ function Nn(e, t) {
2108
+ const n = [];
2109
+ if (t.size === 0) return n;
2110
+ for (const r of e) {
2111
+ const s = r?.current;
2112
+ if (Te(s), s.stateNode !== r) throw new ct("raiz sem `current.stateNode` de volta");
2113
+ const a = s.child ? [s.child] : [];
2114
+ for (; a.length > 0; ) {
2115
+ const c = a.pop();
2116
+ if (Te(c), c.sibling && a.push(c.sibling), c.child && a.push(c.child), dt(c)) continue;
2117
+ const l = yn(c, t);
2118
+ if (l.length === 0) continue;
2119
+ const h = [];
2120
+ ut(c, h), h.length > 0 && n.push({ ids: l, elements: h });
2121
+ }
2122
+ }
2123
+ return n;
2124
+ }
2125
+ let He = !1;
2126
+ function We(e) {
2127
+ He || (He = !0, console.warn(`[design-space] ${e}`));
2128
+ }
2129
+ function $n(e, t) {
2130
+ if (e.size === 0) return [];
2131
+ const n = Ot(t);
2132
+ if (!n)
2133
+ return We(
2134
+ `Destacar componentes: o React carregou antes do gancho do DevTools, então só a marcação \`${fe}\` é contornada. Importe "@brucesantos/design-space/devtools-hook" na primeira linha do ponto de entrada, antes de qualquer import de React.`
2135
+ ), [];
2136
+ try {
2137
+ return Nn(n, e);
2138
+ } catch (r) {
2139
+ return We(
2140
+ "Destacar componentes: a árvore do React não tem a forma esperada, então só a marcação " + `\`${fe}\` é contornada. ${r instanceof Error ? r.message : ""}`.trim()
2141
+ ), [];
2142
+ }
2143
+ }
2144
+ function Mn(e, t = /* @__PURE__ */ new Map()) {
2145
+ const n = e.defaultView ?? window, r = $n(t, n);
2146
+ e.querySelectorAll(`[${fe}]`).forEach((l) => {
2147
+ r.push({ ids: [l.getAttribute(fe) ?? ""], elements: [l] });
2148
+ });
2149
+ const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
2150
+ for (const l of r) {
2151
+ const h = l.elements.filter((i) => i.isConnected && !i.closest(".ds-highlight"));
2152
+ if (h.length === 0) continue;
2153
+ const p = h.map((i) => (s.has(i) || s.set(i, s.size), s.get(i))).join(","), u = a.get(p) ?? { ids: [], elements: h };
2154
+ for (const i of l.ids) u.ids.includes(i) || u.ids.push(i);
2155
+ a.set(p, u);
2156
+ }
2157
+ const c = [];
2158
+ for (const [l, { ids: h, elements: p }] of a) {
2159
+ let u = 1 / 0, i = 1 / 0, f = -1 / 0, S = -1 / 0;
2160
+ for (const N of p) {
2161
+ const $ = N.getBoundingClientRect();
2162
+ $.width === 0 && $.height === 0 || (u = Math.min(u, $.top), i = Math.min(i, $.left), f = Math.max(f, $.right), S = Math.max(S, $.bottom));
2163
+ }
2164
+ u !== 1 / 0 && c.push({ key: l, ids: h, top: u, left: i, width: f - i, height: S - u });
2165
+ }
2166
+ return c;
2167
+ }
2168
+ function En(e, t) {
2169
+ return e.length === t.length && e.every((n, r) => {
2170
+ const s = t[r];
2171
+ return n.key === s.key && n.top === s.top && n.left === s.left && n.width === s.width && n.height === s.height && n.ids.join(`
2172
+ `) === s.ids.join(`
2173
+ `);
2174
+ });
2175
+ }
2176
+ const Ln = 16;
2177
+ function Tn({ registry: e }) {
2178
+ const t = J(), n = A(() => Cn(e.componentsFor()), [e]), [r, s] = D([]);
2179
+ return V(() => {
2180
+ zt(window);
2181
+ let a = 0;
2182
+ const c = () => {
2183
+ a || (a = window.requestAnimationFrame(() => {
2184
+ a = 0;
2185
+ const p = Mn(document, n);
2186
+ s((u) => En(u, p) ? u : p);
2061
2187
  }));
2062
- }, d = new MutationObserver((l) => {
2063
- l.some((h) => !(h.target instanceof Element ? h.target : h.target.parentElement)?.closest(".ds-highlight")) && a();
2188
+ }, l = new MutationObserver((p) => {
2189
+ p.some((i) => !(i.target instanceof Element ? i.target : i.target.parentElement)?.closest(".ds-highlight")) && c();
2064
2190
  });
2065
- return d.observe(document.body, { subtree: !0, childList: !0, attributes: !0, characterData: !0 }), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), document.addEventListener("transitionend", a, !0), document.addEventListener("animationend", a, !0), a(), () => {
2066
- o && window.cancelAnimationFrame(o), d.disconnect(), window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a), document.removeEventListener("transitionend", a, !0), document.removeEventListener("animationend", a, !0);
2191
+ l.observe(document.body, { subtree: !0, childList: !0, attributes: !0, characterData: !0 }), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), document.addEventListener("transitionend", c, !0), document.addEventListener("animationend", c, !0);
2192
+ const h = At(c, window);
2193
+ return c(), () => {
2194
+ a && window.cancelAnimationFrame(a), l.disconnect(), window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c), document.removeEventListener("transitionend", c, !0), document.removeEventListener("animationend", c, !0), h();
2067
2195
  };
2068
- }, []), Nt(
2069
- /* @__PURE__ */ n("div", { className: "ds-highlight", "aria-hidden": "true", children: s.map((o) => {
2070
- const a = e.component(o.id);
2071
- return /* @__PURE__ */ n(
2196
+ }, [n]), Ft(
2197
+ /* @__PURE__ */ o("div", { className: "ds-highlight", "aria-hidden": "true", children: r.map((a) => {
2198
+ const c = a.ids.map((l) => ({ id: l, known: e.component(l) }));
2199
+ return /* @__PURE__ */ o(
2072
2200
  "div",
2073
2201
  {
2074
2202
  className: "ds-highlight__box",
2075
- "data-known": a ? "true" : "false",
2076
- "data-label": o.top < cn ? "inside" : "above",
2077
- style: { top: o.top, left: o.left, width: o.width, height: o.height },
2078
- children: /* @__PURE__ */ n("span", { className: "ds-highlight__label", children: a ? a.name : t.highlight.notInCatalog(o.id) })
2203
+ "data-known": c.every((l) => l.known) ? "true" : "false",
2204
+ "data-label": a.top < Ln ? "inside" : "above",
2205
+ style: { top: a.top, left: a.left, width: a.width, height: a.height },
2206
+ children: /* @__PURE__ */ o("span", { className: "ds-highlight__label", children: c.map((l) => l.known ? l.known.name : t.highlight.notInCatalog(l.id)).join(" · ") })
2079
2207
  },
2080
- o.key
2208
+ a.key
2081
2209
  );
2082
2210
  }) }),
2083
2211
  document.body
2084
2212
  );
2085
2213
  }
2086
- function dn({ product: e, registry: t }) {
2087
- const s = X(), { location: r, controls: o, viewport: a, navigate: d, openScenario: l, setScreenControls: w } = Xe(
2214
+ function Pn({ product: e, registry: t }) {
2215
+ const n = J(), { location: r, controls: s, viewport: a, navigate: c, openScenario: l, setScreenControls: h } = et(
2088
2216
  t,
2089
2217
  { frame: !0 }
2090
- ), h = j(null);
2091
- K(() => {
2092
- const R = (z) => {
2218
+ ), p = q(null);
2219
+ V(() => {
2220
+ const P = (z) => {
2093
2221
  if (z.defaultPrevented || z.button !== 0 || z.metaKey || z.ctrlKey || z.shiftKey || z.altKey) return;
2094
- const A = z.target?.closest?.("a[href]");
2095
- if (!(A instanceof HTMLAnchorElement) || A.target && A.target !== "_self" || A.hasAttribute("download")) return;
2096
- const q = A.getAttribute("href") ?? "";
2097
- if (q.startsWith("#")) return;
2222
+ const U = z.target?.closest?.("a[href]");
2223
+ if (!(U instanceof HTMLAnchorElement) || U.target && U.target !== "_self" || U.hasAttribute("download")) return;
2224
+ const Z = U.getAttribute("href") ?? "";
2225
+ if (Z.startsWith("#")) return;
2098
2226
  let B;
2099
2227
  try {
2100
- B = new URL(q, window.location.href);
2228
+ B = new URL(Z, window.location.href);
2101
2229
  } catch {
2102
2230
  return;
2103
2231
  }
2104
- B.origin === window.location.origin && (z.preventDefault(), d(`${B.pathname}${B.search}`));
2232
+ B.origin === window.location.origin && (z.preventDefault(), c(`${B.pathname}${B.search}`));
2105
2233
  };
2106
- return document.addEventListener("click", R), () => document.removeEventListener("click", R);
2107
- }, [d]), K(() => {
2108
- const R = (z) => {
2234
+ return document.addEventListener("click", P), () => document.removeEventListener("click", P);
2235
+ }, [c]), V(() => {
2236
+ const P = (z) => {
2109
2237
  if (window.parent === window) return;
2110
- const A = un(z);
2111
- if (!A) return;
2112
- const q = z.target;
2113
- A === "C" && q?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), se(window.parent, { ds: 1, type: "shortcut", key: A }, window.location.origin));
2238
+ const U = Rn(z);
2239
+ if (!U) return;
2240
+ const Z = z.target;
2241
+ U === "C" && Z?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), se(window.parent, { ds: 1, type: "shortcut", key: U }, window.location.origin));
2114
2242
  };
2115
- return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
2116
- }, []), K(() => {
2117
- const R = h.current;
2118
- if (!R || !o.handoff) return;
2243
+ return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2244
+ }, []), V(() => {
2245
+ const P = p.current;
2246
+ if (!P || !s.handoff) return;
2119
2247
  const z = () => {
2120
- for (const q of R.querySelectorAll("a[href]")) {
2121
- const B = q.getAttribute("href");
2248
+ for (const Z of P.querySelectorAll("a[href]")) {
2249
+ const B = Z.getAttribute("href");
2122
2250
  if (!B || B.startsWith("#")) continue;
2123
- let J;
2251
+ let Y;
2124
2252
  try {
2125
- J = new URL(B, window.location.href);
2253
+ Y = new URL(B, window.location.href);
2126
2254
  } catch {
2127
2255
  continue;
2128
2256
  }
2129
- if (J.origin !== window.location.origin) continue;
2130
- Ee(J.searchParams, o.handoff);
2131
- const ce = `${J.pathname}${J.search}${J.hash}`;
2132
- B !== ce && q.setAttribute("href", ce);
2257
+ if (Y.origin !== window.location.origin) continue;
2258
+ Pe(Y.searchParams, s.handoff);
2259
+ const ce = `${Y.pathname}${Y.search}${Y.hash}`;
2260
+ B !== ce && Z.setAttribute("href", ce);
2133
2261
  }
2134
2262
  };
2135
2263
  z();
2136
- const A = new MutationObserver(z);
2137
- return A.observe(R, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => A.disconnect();
2138
- }, [o.handoff]);
2139
- const u = t.scenario(o.scenario), c = t.component(o.component), g = U(() => {
2140
- const R = new URLSearchParams(r.search);
2264
+ const U = new MutationObserver(z);
2265
+ return U.observe(P, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => U.disconnect();
2266
+ }, [s.handoff]);
2267
+ const u = t.scenario(s.scenario), i = t.component(s.component), f = A(() => {
2268
+ const P = new URLSearchParams(r.search);
2141
2269
  return {
2142
- scenario: R.get(M.scenario) ?? void 0,
2143
- component: R.get(M.component) ?? void 0
2270
+ scenario: P.get(M.scenario) ?? void 0,
2271
+ component: P.get(M.component) ?? void 0
2144
2272
  };
2145
- }, [r.search]), k = !!(o.handoff && (g.scenario && !re(o.handoff, g.scenario) || g.component && !ve(o.handoff, g.component) || !g.component && !je(o.handoff, r.path, e.scenarios))), $ = U(
2146
- () => t.resolveComponentFixture(c?.id, c ? o.fixture : void 0),
2147
- [c, o.fixture, t]
2148
- ), L = U(() => {
2149
- const R = $.fixture?.data;
2150
- return typeof R == "function" ? R() : R;
2151
- }, [$.fixture]), S = t.persona(o.persona ?? u?.persona), y = t.fixture(o.fixture ?? u?.fixture), E = U(() => {
2152
- const R = o.dataSource ?? "fixtures";
2153
- return R === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === R) ?? Le;
2154
- }, [o.dataSource, e.dataSources?.adapters]), { data: v, isLoading: m, error: p } = an({
2273
+ }, [r.search]), S = !!(s.handoff && (f.scenario && !re(s.handoff, f.scenario) || f.component && !be(s.handoff, f.component) || !f.component && !Ge(s.handoff, r.path, e.scenarios))), N = A(
2274
+ () => t.resolveComponentFixture(i?.id, i ? s.fixture : void 0),
2275
+ [i, s.fixture, t]
2276
+ ), $ = A(() => {
2277
+ const P = N.fixture?.data;
2278
+ return typeof P == "function" ? P() : P;
2279
+ }, [N.fixture]), _ = t.persona(s.persona ?? u?.persona), v = t.fixture(s.fixture ?? u?.fixture), L = A(() => {
2280
+ const P = s.dataSource ?? "fixtures";
2281
+ return P === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === P) ?? Le;
2282
+ }, [s.dataSource, e.dataSources?.adapters]), { data: b, isLoading: m, error: w } = bn({
2155
2283
  scenario: u,
2156
- fixture: y,
2157
- network: o.network,
2158
- adapter: E,
2284
+ fixture: v,
2285
+ network: s.network,
2286
+ adapter: L,
2159
2287
  screen: r.path
2160
- }), b = U(() => u ? o.persona && o.persona !== (u.persona ?? t.defaultPersona) ? t.persona(o.persona)?.permissions ?? [] : t.permissionsOf(u) : t.persona(o.persona)?.permissions ?? [], [o.persona, t, u]), N = o.screenControls, P = U(() => N ?? {}, [N]), i = I(
2161
- (R, z) => w({ [R]: z }),
2162
- [w]
2163
- ), f = U(
2288
+ }), k = A(() => u ? s.persona && s.persona !== (u.persona ?? t.defaultPersona) ? t.persona(s.persona)?.permissions ?? [] : t.permissionsOf(u) : t.persona(s.persona)?.permissions ?? [], [s.persona, t, u]), x = s.screenControls, T = A(() => x ?? {}, [x]), d = K(
2289
+ (P, z) => h({ [P]: z }),
2290
+ [h]
2291
+ ), g = A(
2164
2292
  () => ({
2165
2293
  scenario: u,
2166
- persona: S,
2167
- permissions: b,
2168
- can: (R) => b.includes(R),
2169
- data: v,
2170
- fixture: y,
2171
- network: o.network,
2294
+ persona: _,
2295
+ permissions: k,
2296
+ can: (P) => k.includes(P),
2297
+ data: b,
2298
+ fixture: v,
2299
+ network: s.network,
2172
2300
  isLoading: m,
2173
- error: p,
2301
+ error: w,
2174
2302
  rules: t.rulesOf(u),
2175
2303
  viewport: a,
2176
- themeMode: o.themeMode,
2177
- locale: o.locale,
2178
- navigate: d,
2304
+ themeMode: s.themeMode,
2305
+ locale: s.locale,
2306
+ navigate: c,
2179
2307
  openScenario: l,
2180
- controls: P,
2181
- setControl: i,
2182
- setControls: w
2308
+ controls: T,
2309
+ setControl: d,
2310
+ setControls: h
2183
2311
  }),
2184
2312
  [
2185
2313
  u,
2186
- S,
2314
+ _,
2315
+ k,
2187
2316
  b,
2188
2317
  v,
2189
- y,
2190
- o.network,
2191
- o.themeMode,
2192
- o.locale,
2318
+ s.network,
2319
+ s.themeMode,
2320
+ s.locale,
2193
2321
  m,
2194
- p,
2322
+ w,
2195
2323
  t,
2196
2324
  a,
2197
- d,
2325
+ c,
2198
2326
  l,
2199
- P,
2200
- i,
2201
- w
2327
+ T,
2328
+ d,
2329
+ h
2202
2330
  ]
2203
- ), x = ye(e.routes ?? [], r.path), T = e.wrapper, O = e.notFound, _ = c?.preview, V = k ? /* @__PURE__ */ n(Ke, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : _ ? /* @__PURE__ */ n(
2204
- _,
2331
+ ), C = Ne(e.routes ?? [], r.path), E = e.wrapper, F = e.notFound, O = i?.preview, I = S ? /* @__PURE__ */ o(Ke, { title: n.shell.outsideHandoff, children: /* @__PURE__ */ o("p", { children: n.shell.outsideHandoffHint }) }) : O ? /* @__PURE__ */ o(
2332
+ O,
2205
2333
  {
2206
- fixture: $.fixture,
2207
- data: L,
2334
+ fixture: N.fixture,
2335
+ data: $,
2208
2336
  viewport: a,
2209
- themeMode: o.themeMode ?? "default",
2210
- locale: o.locale ?? "default"
2337
+ themeMode: s.themeMode ?? "default",
2338
+ locale: s.locale ?? "default"
2211
2339
  }
2212
- ) : x ? /* @__PURE__ */ n(x.definition.screen, { params: x.params, context: f }) : O ? /* @__PURE__ */ n(O, { path: r.path }) : /* @__PURE__ */ n(Ke, { title: s.shell.noRoute, children: /* @__PURE__ */ C("p", { children: [
2213
- /* @__PURE__ */ n("code", { children: r.path }),
2340
+ ) : C ? /* @__PURE__ */ o(C.definition.screen, { params: C.params, context: g }) : F ? /* @__PURE__ */ o(F, { path: r.path }) : /* @__PURE__ */ o(Ke, { title: n.shell.noRoute, children: /* @__PURE__ */ y("p", { children: [
2341
+ /* @__PURE__ */ o("code", { children: r.path }),
2214
2342
  " ",
2215
- s.shell.noRouteHint
2343
+ n.shell.noRouteHint
2216
2344
  ] }) });
2217
2345
  return (
2218
2346
  // `display: contents` deixa o layout do produto como se este nó não
2219
2347
  // existisse: ele só serve de raiz para observar os links.
2220
- /* @__PURE__ */ C("div", { ref: h, style: { display: "contents" }, children: [
2221
- T && !k ? /* @__PURE__ */ n(T, { context: f, children: V }) : V,
2222
- o.highlight && !k && /* @__PURE__ */ n(ln, { registry: t })
2348
+ /* @__PURE__ */ y("div", { ref: p, style: { display: "contents" }, children: [
2349
+ E && !S ? /* @__PURE__ */ o(E, { context: g, children: I }) : I,
2350
+ s.highlight && !S && /* @__PURE__ */ o(Tn, { registry: t })
2223
2351
  ] })
2224
2352
  );
2225
2353
  }
2226
- function un(e) {
2354
+ function Rn(e) {
2227
2355
  if (!e.altKey) {
2228
2356
  if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
2229
2357
  if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
@@ -2238,292 +2366,302 @@ const pe = {
2238
2366
  rightWidth: "ds:right-width",
2239
2367
  appearance: "ds:appearance"
2240
2368
  };
2241
- function at(e) {
2369
+ function ht(e) {
2242
2370
  try {
2243
2371
  return window.localStorage.getItem(e) ?? void 0;
2244
2372
  } catch {
2245
2373
  return;
2246
2374
  }
2247
2375
  }
2248
- function it(e, t) {
2376
+ function pt(e, t) {
2249
2377
  try {
2250
2378
  window.localStorage.setItem(e, t);
2251
2379
  } catch {
2252
2380
  }
2253
2381
  }
2254
- function He(e, t, s) {
2255
- return Math.round(Math.min(s, Math.max(t, e)));
2382
+ function Be(e, t, n) {
2383
+ return Math.round(Math.min(n, Math.max(t, e)));
2256
2384
  }
2257
- function We(e, t, s, r) {
2258
- const [o, a] = D(() => {
2259
- const l = Number.parseInt(at(e) ?? "", 10);
2260
- return Number.isFinite(l) ? He(l, s, r) : t;
2261
- }), d = I(
2385
+ function je(e, t, n, r) {
2386
+ const [s, a] = D(() => {
2387
+ const l = Number.parseInt(ht(e) ?? "", 10);
2388
+ return Number.isFinite(l) ? Be(l, n, r) : t;
2389
+ }), c = K(
2262
2390
  (l) => {
2263
- const w = He(l, s, r);
2264
- a(w), it(e, String(w));
2391
+ const h = Be(l, n, r);
2392
+ a(h), pt(e, String(h));
2265
2393
  },
2266
- [e, r, s]
2394
+ [e, r, n]
2267
2395
  );
2268
- return [o, d];
2396
+ return [s, c];
2269
2397
  }
2270
- function hn() {
2398
+ function _n() {
2271
2399
  const e = "(prefers-color-scheme: dark)", t = () => {
2272
2400
  try {
2273
2401
  return window.matchMedia(e).matches ? "dark" : "light";
2274
2402
  } catch {
2275
2403
  return "light";
2276
2404
  }
2277
- }, [s, r] = D(t);
2278
- return K(() => {
2279
- let o;
2405
+ }, [n, r] = D(t);
2406
+ return V(() => {
2407
+ let s;
2280
2408
  try {
2281
- o = window.matchMedia(e);
2409
+ s = window.matchMedia(e);
2282
2410
  } catch {
2283
2411
  return;
2284
2412
  }
2285
- const a = () => r(o?.matches ? "dark" : "light");
2286
- return o.addEventListener?.("change", a), () => o?.removeEventListener?.("change", a);
2287
- }, []), s;
2413
+ const a = () => r(s?.matches ? "dark" : "light");
2414
+ return s.addEventListener?.("change", a), () => s?.removeEventListener?.("change", a);
2415
+ }, []), n;
2288
2416
  }
2289
- function pn() {
2290
- const e = at(pe.appearance);
2417
+ function Fn() {
2418
+ const e = ht(pe.appearance);
2291
2419
  return e === "dark" || e === "light" ? e : void 0;
2292
2420
  }
2293
- function Cn({ product: e }) {
2294
- const t = U(() => $t(e), [e]), s = U(() => Vt(e.theme?.labels), [e.theme?.labels]), [r] = D(() => Ct());
2295
- return /* @__PURE__ */ n(tt.Provider, { value: s, children: r ? /* @__PURE__ */ n(dn, { product: e, registry: t }) : /* @__PURE__ */ n(mn, { product: e, registry: t }) });
2421
+ function Wn({ product: e }) {
2422
+ const t = A(() => Dt(e), [e]), n = A(() => Xt(e.theme?.labels), [e.theme?.labels]), [r] = D(() => Tt());
2423
+ return /* @__PURE__ */ o(ot.Provider, { value: n, children: r ? /* @__PURE__ */ o(Pn, { product: e, registry: t }) : /* @__PURE__ */ o(On, { product: e, registry: t }) });
2296
2424
  }
2297
- const Ce = { initial: 290, min: 200, max: 480 }, xe = { initial: 320, min: 260, max: 560 };
2298
- function mn({ product: e, registry: t }) {
2299
- const s = X(), r = U(() => xt(e.deploy), [e.deploy]), { location: o, controls: a, viewport: d, setControls: l, openScenario: w, openComponent: h, openScreen: u, go: c } = Xe(t), g = j(o);
2300
- g.current = o;
2301
- const k = hn(), [$, L] = D(() => pn()), S = a.chromeTheme ?? $ ?? k, [y, E] = We(
2425
+ const ye = { initial: 290, min: 200, max: 480 }, xe = { initial: 320, min: 260, max: 560 };
2426
+ function On({ product: e, registry: t }) {
2427
+ const n = J(), r = A(() => Pt(e.deploy), [e.deploy]), { location: s, controls: a, viewport: c, setControls: l, openScenario: h, openComponent: p, openScreen: u, go: i } = et(t), f = q(s);
2428
+ f.current = s;
2429
+ const S = q(null), N = _n(), [$, _] = D(() => Fn()), v = a.chromeTheme ?? $ ?? N, [L, b] = je(
2302
2430
  pe.leftWidth,
2303
- Ce.initial,
2304
- Ce.min,
2305
- Ce.max
2306
- ), [v, m] = We(
2431
+ ye.initial,
2432
+ ye.min,
2433
+ ye.max
2434
+ ), [m, w] = je(
2307
2435
  pe.rightWidth,
2308
2436
  xe.initial,
2309
2437
  xe.min,
2310
2438
  xe.max
2311
- ), [p, b] = D(!1), N = a.handoff, P = t.component(a.component), i = t.scenario(a.scenario), f = P ? void 0 : t.screensFor({ handoff: N }).find((F) => F.id === t.screenForPath(o.path)?.id), x = f && i && f.variations.some((F) => F.id === i.id) ? i : void 0, T = U(
2312
- () => t.resolveComponentFixture(P?.id, P ? a.fixture : void 0),
2313
- [P, a.fixture, t]
2314
- ), O = U(() => {
2315
- if (!f || f.controls.length === 0) return t.issues;
2316
- const { invalid: F } = t.resolveControls(f, {
2317
- scenario: x,
2318
- requested: qe(o.search)
2439
+ ), [k, x] = D(!1), T = a.handoff, d = t.component(a.component), g = t.scenario(a.scenario), C = d ? void 0 : t.screensFor({ handoff: T }).find((R) => R.id === t.screenForPath(s.path)?.id), E = C && g && C.variations.some((R) => R.id === g.id) ? g : void 0, F = A(
2440
+ () => t.resolveComponentFixture(d?.id, d ? a.fixture : void 0),
2441
+ [d, a.fixture, t]
2442
+ ), O = A(() => {
2443
+ if (!C || C.controls.length === 0) return t.issues;
2444
+ const { invalid: R } = t.resolveControls(C, {
2445
+ scenario: E,
2446
+ requested: Ze(s.search)
2319
2447
  });
2320
- return F.length === 0 ? t.issues : [...F.map((Y) => ({
2448
+ return R.length === 0 ? t.issues : [...R.map((Q) => ({
2321
2449
  level: "warning",
2322
- where: `url:${be}${Y.id}`,
2323
- message: Y.reason === "invalid-value" ? s.diagnostics.invalidControl(Y.id, Y.value, Y.fallback ?? "") : s.diagnostics.unknownControl(Y.id, Y.value)
2450
+ where: `url:${ke}${Q.id}`,
2451
+ message: Q.reason === "invalid-value" ? n.diagnostics.invalidControl(Q.id, Q.value, Q.fallback ?? "") : n.diagnostics.unknownControl(Q.id, Q.value)
2324
2452
  })), ...t.issues];
2325
- }, [s, o.search, t, f, x]), _ = t.screensFor({ handoff: N })[0], V = t.componentsFor(N)[0], R = !_ && !V, z = U(() => {
2326
- const F = new URLSearchParams(o.search);
2327
- return F.has(M.scenario) || F.has(M.component);
2328
- }, [o.search]), A = o.path === "/" && !z && !t.screenForPath("/") && !R;
2329
- K(() => {
2330
- A && (_ ? u(_.id, { replace: !0 }) : V && h(V.id, { replace: !0 }));
2331
- }, [V, _, h, u, A]);
2332
- const q = I(
2453
+ }, [n, s.search, t, C, E]), I = t.screensFor({ handoff: T })[0], P = t.componentsFor(T)[0], z = !I && !P, U = A(() => {
2454
+ const R = new URLSearchParams(s.search);
2455
+ return R.has(M.scenario) || R.has(M.component);
2456
+ }, [s.search]), Z = s.path === "/" && !U && !t.screenForPath("/") && !z;
2457
+ V(() => {
2458
+ Z && (I ? u(I.id, { replace: !0 }) : P && p(P.id, { replace: !0 }));
2459
+ }, [P, I, p, u, Z]);
2460
+ const B = K(
2333
2461
  () => l({ chrome: !a.chrome }),
2334
2462
  [a.chrome, l]
2335
- ), B = I(
2336
- (F) => {
2337
- if (F === "C") {
2338
- q();
2463
+ ), Y = K(
2464
+ (R) => {
2465
+ if (R === "C") {
2466
+ B();
2339
2467
  return;
2340
2468
  }
2341
- window.dispatchEvent(new KeyboardEvent("keydown", { key: F.toLowerCase(), metaKey: !0 }));
2469
+ window.dispatchEvent(new KeyboardEvent("keydown", { key: R.toLowerCase(), metaKey: !0 }));
2342
2470
  },
2343
- [q]
2471
+ [B]
2344
2472
  );
2345
- K(() => {
2346
- const F = (G) => {
2347
- !G.shiftKey || G.metaKey || G.ctrlKey || G.altKey || G.key !== "C" || G.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (G.preventDefault(), B(G.key));
2473
+ V(() => {
2474
+ const R = (j) => {
2475
+ !j.shiftKey || j.metaKey || j.ctrlKey || j.altKey || j.key !== "C" || j.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (j.preventDefault(), Y(j.key));
2348
2476
  };
2349
- return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
2350
- }, [B]);
2351
- const J = I(
2352
- (F, G) => {
2353
- const { path: Y, search: ht } = he(F);
2354
- c(Y, yt(ht, g.current.search), { replace: G });
2477
+ return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
2478
+ }, [Y]);
2479
+ const ce = K(
2480
+ (R, j) => {
2481
+ const { path: Q, search: kt } = he(R);
2482
+ i(Q, Rt(kt, f.current.search), { replace: j });
2355
2483
  },
2356
- [c]
2357
- ), ce = () => {
2358
- const F = S === "dark" ? "light" : "dark";
2359
- it(pe.appearance, F), L(F), l({ chromeTheme: F });
2360
- }, te = (F) => l(F), ct = `${r.origin}${o.path}${o.search}`, lt = a.panelTab ?? "variations", _e = a.zoom ?? 100, [dt, ut] = D(_e);
2361
- return /* @__PURE__ */ C(
2484
+ [i]
2485
+ ), mt = () => {
2486
+ let R;
2487
+ try {
2488
+ R = S.current?.contentWindow?.location.href;
2489
+ } catch {
2490
+ }
2491
+ const j = _t(R, window.location.origin, f.current);
2492
+ window.open(j, "_blank", "noopener");
2493
+ }, ft = () => {
2494
+ const R = v === "dark" ? "light" : "dark";
2495
+ pt(pe.appearance, R), _(R), l({ chromeTheme: R });
2496
+ }, te = (R) => l(R), wt = `${r.origin}${s.path}${s.search}`, gt = a.panelTab ?? "variations", Oe = a.zoom ?? 100, [vt, bt] = D(Oe);
2497
+ return /* @__PURE__ */ y(
2362
2498
  "div",
2363
2499
  {
2364
2500
  className: "ds-root",
2365
- "data-appearance": S,
2501
+ "data-appearance": v,
2366
2502
  "data-chrome": a.chrome ? "visible" : "hidden",
2367
- "data-resizing": p ? "true" : void 0,
2368
- "data-viewport": d.id,
2503
+ "data-resizing": k ? "true" : void 0,
2504
+ "data-viewport": c.id,
2369
2505
  children: [
2370
- a.chrome && /* @__PURE__ */ n(
2371
- It,
2506
+ a.chrome && /* @__PURE__ */ o(
2507
+ en,
2372
2508
  {
2373
2509
  productName: e.name,
2374
2510
  deploy: r,
2375
2511
  viewportId: a.viewport,
2376
- viewport: d,
2377
- zoom: dt,
2512
+ viewport: c,
2513
+ zoom: vt,
2378
2514
  rotated: !!a.rotated,
2379
2515
  highlight: !!a.highlight,
2380
- theme: S,
2516
+ theme: v,
2381
2517
  issues: O,
2382
- linkUrl: ct,
2383
- onViewport: (F) => te({ viewport: F }),
2518
+ linkUrl: wt,
2519
+ onViewport: (R) => te({ viewport: R }),
2384
2520
  onRotate: () => te({ rotated: !a.rotated }),
2385
2521
  onHighlight: () => te({ highlight: !a.highlight }),
2386
- onZoom: (F) => te({ zoom: F }),
2387
- onCleanReview: q,
2388
- onToggleTheme: ce
2522
+ onZoom: (R) => te({ zoom: R }),
2523
+ onCleanReview: B,
2524
+ onOpenFrame: mt,
2525
+ onToggleTheme: ft
2389
2526
  }
2390
2527
  ),
2391
- /* @__PURE__ */ C("div", { className: "ds-body", children: [
2392
- a.chrome && /* @__PURE__ */ n(
2393
- Bt,
2528
+ /* @__PURE__ */ y("div", { className: "ds-body", children: [
2529
+ a.chrome && /* @__PURE__ */ o(
2530
+ on,
2394
2531
  {
2395
2532
  registry: t,
2396
- handoff: N,
2397
- activeScreen: f?.id,
2398
- activeComponent: P?.id,
2399
- onOpenScreen: (F) => u(F),
2400
- onOpenComponent: (F) => h(F),
2401
- width: y,
2402
- onResize: E,
2403
- onResizeStart: () => b(!0),
2404
- onResizeEnd: () => b(!1)
2533
+ handoff: T,
2534
+ activeScreen: C?.id,
2535
+ activeComponent: d?.id,
2536
+ onOpenScreen: (R) => u(R),
2537
+ onOpenComponent: (R) => p(R),
2538
+ width: L,
2539
+ onResize: b,
2540
+ onResizeStart: () => x(!0),
2541
+ onResizeEnd: () => x(!1)
2405
2542
  }
2406
2543
  ),
2407
- /* @__PURE__ */ n("main", { className: "ds-main", children: R ? /* @__PURE__ */ C("div", { className: "ds-chrome-empty", children: [
2408
- /* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
2409
- /* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
2410
- ] }) : A ? null : /* @__PURE__ */ n(
2411
- on,
2544
+ /* @__PURE__ */ o("main", { className: "ds-main", children: z ? /* @__PURE__ */ y("div", { className: "ds-chrome-empty", children: [
2545
+ /* @__PURE__ */ o("h1", { className: "ds-chrome-empty__title", children: n.shell.empty }),
2546
+ /* @__PURE__ */ o("p", { className: "ds-muted", children: n.shell.emptyHint })
2547
+ ] }) : Z ? null : /* @__PURE__ */ o(
2548
+ wn,
2412
2549
  {
2413
- location: o,
2414
- viewport: d,
2415
- zoom: _e,
2416
- onEffectiveZoom: ut,
2417
- title: s.shell.frameTitle(e.name),
2418
- resizing: p,
2419
- onFrameNavigate: J,
2420
- onShortcut: B
2550
+ location: s,
2551
+ viewport: c,
2552
+ zoom: Oe,
2553
+ onEffectiveZoom: bt,
2554
+ title: n.shell.frameTitle(e.name),
2555
+ resizing: k,
2556
+ onFrameNavigate: ce,
2557
+ onShortcut: Y,
2558
+ frameRef: S
2421
2559
  }
2422
2560
  ) }),
2423
- a.chrome && /* @__PURE__ */ n(
2424
- Qt,
2561
+ a.chrome && /* @__PURE__ */ o(
2562
+ dn,
2425
2563
  {
2426
2564
  registry: t,
2427
2565
  controls: a,
2428
2566
  deploy: r,
2429
- location: o,
2430
- screen: f,
2431
- variation: x,
2432
- component: P,
2433
- componentFixture: T,
2434
- tab: lt,
2435
- onTab: (F) => te({ panelTab: F }),
2436
- onOpenScenario: w,
2437
- onOpenComponent: (F) => h(F),
2438
- onOpenScreen: (F) => u(F),
2567
+ location: s,
2568
+ screen: C,
2569
+ variation: E,
2570
+ component: d,
2571
+ componentFixture: F,
2572
+ tab: gt,
2573
+ onTab: (R) => te({ panelTab: R }),
2574
+ onOpenScenario: h,
2575
+ onOpenComponent: (R) => p(R),
2576
+ onOpenScreen: (R) => u(R),
2439
2577
  onChange: te,
2440
- width: v,
2441
- onResize: m,
2442
- onResizeStart: () => b(!0),
2443
- onResizeEnd: () => b(!1)
2578
+ width: m,
2579
+ onResize: w,
2580
+ onResizeStart: () => x(!0),
2581
+ onResizeEnd: () => x(!1)
2444
2582
  }
2445
2583
  )
2446
2584
  ] }),
2447
- !a.chrome && /* @__PURE__ */ n(
2585
+ !a.chrome && /* @__PURE__ */ o(
2448
2586
  "button",
2449
2587
  {
2450
2588
  type: "button",
2451
2589
  className: "ds-restore",
2452
- "aria-label": s.shell.restoreChrome,
2453
- title: s.shell.restoreChrome,
2454
- onClick: q,
2455
- children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
2590
+ "aria-label": n.shell.restoreChrome,
2591
+ title: n.shell.restoreChrome,
2592
+ onClick: B,
2593
+ children: /* @__PURE__ */ o("span", { className: "ds-restore__dot", "aria-hidden": "true" })
2456
2594
  }
2457
2595
  )
2458
2596
  ]
2459
2597
  }
2460
2598
  );
2461
2599
  }
2462
- function ge(e) {
2600
+ function ve(e) {
2463
2601
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2464
2602
  }
2465
- function xn(e, t) {
2466
- const s = ge(e), r = ge(t);
2467
- let o = r.getFullYear() - s.getFullYear();
2468
- const a = r.getMonth() - s.getMonth();
2469
- return (a < 0 || a === 0 && r.getDate() < s.getDate()) && (o -= 1), o;
2603
+ function Bn(e, t) {
2604
+ const n = ve(e), r = ve(t);
2605
+ let s = r.getFullYear() - n.getFullYear();
2606
+ const a = r.getMonth() - n.getMonth();
2607
+ return (a < 0 || a === 0 && r.getDate() < n.getDate()) && (s -= 1), s;
2470
2608
  }
2471
- function yn(e, t) {
2472
- const s = ge(e), r = ge(t);
2473
- return Math.floor((r.getTime() - s.getTime()) / 864e5);
2609
+ function jn(e, t) {
2610
+ const n = ve(e), r = ve(t);
2611
+ return Math.floor((r.getTime() - n.getTime()) / 864e5);
2474
2612
  }
2475
2613
  export {
2476
- Oe as COMPONENT_ATTRIBUTE,
2477
- be as CONTROL_PARAM_PREFIX,
2614
+ fe as COMPONENT_ATTRIBUTE,
2615
+ ke as CONTROL_PARAM_PREFIX,
2478
2616
  oe as DEFAULT_LABELS,
2479
- Cn as DesignSpace,
2480
- bn as EN_US_LABELS,
2481
- kt as FRAME_ATTRIBUTE,
2482
- vt as FRAME_PARAM,
2483
- Mn as HANDOFF_PARAM,
2484
- Sn as NETWORK_LABELS,
2485
- Ge as NETWORK_STATES,
2617
+ Wn as DesignSpace,
2618
+ Vn as EN_US_LABELS,
2619
+ Lt as FRAME_ATTRIBUTE,
2620
+ $t as FRAME_PARAM,
2621
+ Zn as HANDOFF_PARAM,
2622
+ Kn as NETWORK_LABELS,
2623
+ Ye as NETWORK_STATES,
2486
2624
  M as PARAM,
2487
- rt as SLOW_NETWORK_DELAY_MS,
2488
- st as SimulatedNetworkError,
2625
+ at as SLOW_NETWORK_DELAY_MS,
2626
+ it as SimulatedNetworkError,
2489
2627
  Ke as StageEmpty,
2490
- Et as VIEWPORTS,
2491
- fe as ZOOM_DEFAULT,
2492
- Re as ZOOM_MAX,
2493
- Pe as ZOOM_MIN,
2494
- xn as ageInYears,
2495
- Ee as applyHandoffScope,
2496
- Ne as applyOverrides,
2497
- et as clampZoom,
2498
- Ln as commitUrl,
2499
- En as componentUrl,
2500
- kn as createHttpAdapter,
2501
- $t as createRegistry,
2502
- yn as daysBetween,
2628
+ Vt as VIEWPORTS,
2629
+ we as ZOOM_DEFAULT,
2630
+ Fe as ZOOM_MAX,
2631
+ _e as ZOOM_MIN,
2632
+ Bn as ageInYears,
2633
+ Pe as applyHandoffScope,
2634
+ $e as applyOverrides,
2635
+ nt as clampZoom,
2636
+ Yn as commitUrl,
2637
+ Qn as componentUrl,
2638
+ Hn as createHttpAdapter,
2639
+ Dt as createRegistry,
2640
+ jn as daysBetween,
2503
2641
  Le as fixtureAdapter,
2504
- Tn as formatIssues,
2505
- xt as getDeployContext,
2506
- ve as handoffAllowsComponent,
2507
- je as handoffAllowsPath,
2642
+ Xn as formatIssues,
2643
+ Pt as getDeployContext,
2644
+ be as handoffAllowsComponent,
2645
+ Ge as handoffAllowsPath,
2508
2646
  re as handoffAllowsScenario,
2509
- Pn as hasErrors,
2510
- Rn as matchPath,
2511
- _n as normalizeHandoffScope,
2512
- Q as normalizeSearch,
2513
- $e as parseControls,
2514
- gt as parseHandoffScope,
2515
- ge as parseIsoDate,
2516
- Me as resolveFixture,
2517
- Vt as resolveLabels,
2518
- ye as resolveRoute,
2519
- _t as resolveViewport,
2647
+ Jn as hasErrors,
2648
+ eo as matchPath,
2649
+ to as normalizeHandoffScope,
2650
+ X as normalizeSearch,
2651
+ Me as parseControls,
2652
+ Nt as parseHandoffScope,
2653
+ ve as parseIsoDate,
2654
+ Ee as resolveFixture,
2655
+ Xt as resolveLabels,
2656
+ Ne as resolveRoute,
2657
+ Bt as resolveViewport,
2520
2658
  me as scenarioUrl,
2521
2659
  ae as serializeControls,
2522
- Fn as serializeValue,
2523
- Xe as useDesignSpaceState,
2524
- X as useLabels,
2525
- an as useScenarioData,
2526
- wt as validateProduct,
2527
- On as validateScenario
2660
+ no as serializeValue,
2661
+ et as useDesignSpaceState,
2662
+ J as useLabels,
2663
+ bn as useScenarioData,
2664
+ xt as validateProduct,
2665
+ oo as validateScenario
2528
2666
  };
2529
2667
  //# sourceMappingURL=index.js.map