@takazudo/zdtp 0.3.0 → 0.3.2

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,14 +1,14 @@
1
1
  import { jsxs as k, jsx as s, Fragment as ae } from "preact/jsx-runtime";
2
2
  import { createContext as jt, render as Kt } from "preact";
3
- import { useState as j, useRef as D, useMemo as J, useEffect as W, useId as ft, useCallback as R, useLayoutEffect as Po, useContext as Io, createPortal as Wt, memo as Ge } from "preact/compat";
4
- import { b as ge, i as Pn, s as zo, r as Ue, e as Ro, c as Oo, d as it, f as In, D as ln, h as Do, j as Bo, k as We, m as Vo, n as Ho, o as Fo, p as jo, l as zn, q as sn, t as cn, u as Rt, v as Ko, w as je, x as Wo, y as xt, z as dn, A as yt, B as un, C as Nt, E as Xo, a as Yo } from "./tweak-state-DMwBHPow.js";
5
- import { Z as Ul } from "./tweak-state-DMwBHPow.js";
6
- import { g as q, k as ve, n as qo, o as P, p as Go, r as Uo, q as Jo, t as pn, a as Rn, u as On, v as Zo, w as Qo, x as er, D as tr, y as nr, z as or } from "./panel-config-BOyB8Egg.js";
7
- import { c as Zl, s as Ql } from "./panel-config-BOyB8Egg.js";
8
- import { c as rr } from "./color-schemes-CgzOBqGO.js";
9
- import { r as ar } from "./route-tokens-to-files-1DvmWBdj.js";
10
- import { useContext as Xt, useCallback as Y, useRef as de, useEffect as ue, useState as _e, useMemo as lt } from "preact/hooks";
11
- function $e(e, t = q()) {
3
+ import { useState as K, useRef as B, useMemo as Z, useEffect as X, useId as ht, useCallback as R, useLayoutEffect as zo, useContext as Ro, createPortal as Wt, memo as Ge } from "preact/compat";
4
+ import { b as ge, i as Pn, s as Oo, r as Ue, e as Do, c as Vo, d as lt, f as In, D as ln, h as Bo, j as Ho, k as We, m as Fo, n as jo, o as Ko, p as Wo, l as zn, q as sn, t as cn, u as Rt, v as Xo, w as je, x as Yo, y as yt, z as dn, A as Nt, B as un, C as _t, E as qo, a as Go } from "./tweak-state-Do5gj6Nw.js";
5
+ import { Z as es } from "./tweak-state-Do5gj6Nw.js";
6
+ import { g as Y, k as ve, n as Uo, o as P, p as Jo, r as Zo, q as Qo, t as pn, a as Rn, u as On, v as er, w as tr, x as nr, D as or, y as Dn, z as rr } from "./panel-config-066BPYJD.js";
7
+ import { c as ns, s as os } from "./panel-config-066BPYJD.js";
8
+ import { c as ar } from "./color-schemes-CgzOBqGO.js";
9
+ import { r as ir } from "./route-tokens-to-files-1DvmWBdj.js";
10
+ import { useContext as Xt, useCallback as q, useRef as de, useEffect as ue, useState as $e, useMemo as st } from "preact/hooks";
11
+ function xe(e, t = Y()) {
12
12
  const n = t.tabs.find((r) => r.id === e);
13
13
  if (!n) return [];
14
14
  const o = [];
@@ -17,11 +17,34 @@ function $e(e, t = q()) {
17
17
  o.push(a);
18
18
  return o;
19
19
  }
20
- const rt = "zudo-design-tokens/v2", _t = "zudo-design-tokens/v1";
21
- function Dn() {
20
+ const Vn = /* @__PURE__ */ new Set([
21
+ "color",
22
+ "color-secondary",
23
+ "spacing",
24
+ "font",
25
+ "size"
26
+ ]);
27
+ function lr(e) {
28
+ const t = {};
29
+ if (!e) return t;
30
+ for (const n of Object.values(e))
31
+ for (const [o, r] of Object.entries(n))
32
+ t[o] = r;
33
+ return t;
34
+ }
35
+ function sr(e, t) {
36
+ const n = /* @__PURE__ */ new Map(), o = t.tabs.find((r) => r.id === e);
37
+ if (!o) return n;
38
+ for (const r of o.tiers)
39
+ for (const a of r.items)
40
+ a.readonly || n.set(a.cssVar, { tierId: r.id, itemId: a.id });
41
+ return n;
42
+ }
43
+ const at = "zudo-design-tokens/v2", $t = "zudo-design-tokens/v1";
44
+ function Bn() {
22
45
  return {};
23
46
  }
24
- function ir(e = q()) {
47
+ function cr(e = Y()) {
25
48
  return e.schemaId;
26
49
  }
27
50
  class Pe extends Error {
@@ -31,20 +54,26 @@ class Pe extends Error {
31
54
  super(n), this.name = "DesignTokenSchemaError", this.reason = t, this.actualSchema = o, Object.setPrototypeOf(this, Pe.prototype);
32
55
  }
33
56
  }
34
- function Bn(e, t = {}, n = q()) {
57
+ function Hn(e, t = {}, n = Y()) {
35
58
  const o = t.now ? t.now() : /* @__PURE__ */ new Date(), r = {
36
- $schema: rt,
59
+ $schema: at,
37
60
  exportedAt: o.toISOString()
38
- }, a = {}, i = lr(e.color, t, n);
61
+ }, a = {}, i = dr(e.color, t, n);
39
62
  i && (a.color = i);
40
- const l = $t($e("spacing", n), e.spacing, t);
63
+ const l = Je(xe("spacing", n), e.spacing, t);
41
64
  l && (a.spacing = l);
42
- const c = $t($e("font", n), e.typography, t);
65
+ const c = Je(xe("font", n), e.typography, t);
43
66
  c && (a.font = c);
44
- const d = $t($e("size", n), e.size, t);
45
- return d && (a.size = d), Object.keys(a).length > 0 && (r.tabs = a), r;
67
+ const d = Je(xe("size", n), e.size, t);
68
+ d && (a.size = d);
69
+ for (const u of n.tabs) {
70
+ if (Vn.has(u.id)) continue;
71
+ const p = lr(e.tabs?.[u.id]), m = Je(xe(u.id, n), p, t);
72
+ m && (a[u.id] = m);
73
+ }
74
+ return Object.keys(a).length > 0 && (r.tabs = a), r;
46
75
  }
47
- function lr(e, t, n) {
76
+ function dr(e, t, n) {
48
77
  const o = t.colorDefaults, r = t.includeDefaults === !0, a = ge(n), i = {};
49
78
  let l = !1;
50
79
  const c = {};
@@ -64,7 +93,7 @@ function lr(e, t, n) {
64
93
  }
65
94
  return p && (i.semantic = u, l = !0), l ? i : void 0;
66
95
  }
67
- function $t(e, t, n) {
96
+ function Je(e, t, n) {
68
97
  const o = n.includeDefaults === !0, r = {};
69
98
  let a = !1;
70
99
  if (o)
@@ -81,34 +110,56 @@ function $t(e, t, n) {
81
110
  }
82
111
  return a ? { raw: r } : void 0;
83
112
  }
84
- function sr(e, t = {}, n = q()) {
113
+ function ur(e, t = {}, n = Y()) {
85
114
  if (e === null || typeof e != "object" || Array.isArray(e))
86
115
  throw new Pe("not-object", "Input is not a JSON object.");
87
116
  const o = e, r = o.$schema;
88
117
  if (r === void 0)
89
118
  throw new Pe(
90
119
  "schema-missing",
91
- `Missing "$schema" key. Expected "${rt}" or "${_t}".`
120
+ `Missing "$schema" key. Expected "${at}" or "${$t}".`
92
121
  );
93
- if (r === rt)
94
- return cr(o, t, n);
95
- if (r === _t)
96
- return ur(o, t, n);
122
+ if (r === at)
123
+ return pr(o, t, n);
124
+ if (r === $t)
125
+ return hr(o, t, n);
97
126
  throw new Pe(
98
127
  "schema-mismatch",
99
- `Unsupported "$schema" value: ${JSON.stringify(r)}. Expected "${rt}" or "${_t}".`,
128
+ `Unsupported "$schema" value: ${JSON.stringify(r)}. Expected "${at}" or "${$t}".`,
100
129
  r
101
130
  );
102
131
  }
103
- function cr(e, t, n) {
104
- const o = [], r = [], a = t.colorDefaults ?? Vn(n), i = ge(n), l = e.tabs && typeof e.tabs == "object" && !Array.isArray(e.tabs) ? e.tabs : {}, c = l.color, d = dr(c, a, i, o), u = l.spacing, p = u && typeof u == "object" ? u.raw : void 0, m = Ct(p, $e("spacing", n), "spacing", r, o), h = l.font, v = h && typeof h == "object" ? h.raw : void 0, C = Ct(v, $e("font", n), "font.raw", r, o), b = l.size, x = b && typeof b == "object" ? b.raw : void 0, g = Ct(x, $e("size", n), "size", r, o);
132
+ function pr(e, t, n) {
133
+ const o = [], r = [], a = t.colorDefaults ?? Fn(n), i = ge(n), l = e.tabs && typeof e.tabs == "object" && !Array.isArray(e.tabs) ? e.tabs : {}, c = l.color, d = fr(c, a, i, o), u = l.spacing, p = u && typeof u == "object" ? u.raw : void 0, m = Ct(p, xe("spacing", n), "spacing", r, o), h = l.font, v = h && typeof h == "object" ? h.raw : void 0, C = Ct(v, xe("font", n), "font.raw", r, o), b = l.size, N = b && typeof b == "object" ? b.raw : void 0, g = Ct(N, xe("size", n), "size", r, o);
134
+ let y;
135
+ for (const w of n.tabs) {
136
+ if (Vn.has(w.id)) continue;
137
+ const _ = l[w.id], x = _ && typeof _ == "object" && !Array.isArray(_) ? _.raw : void 0;
138
+ if (!x || typeof x != "object" || Array.isArray(x)) continue;
139
+ const f = sr(w.id, n), E = {};
140
+ let S = !1;
141
+ for (const [O, j] of Object.entries(x)) {
142
+ const D = f.get(O);
143
+ if (!D) {
144
+ r.push(O);
145
+ continue;
146
+ }
147
+ if (typeof j != "string" || j.length === 0) {
148
+ o.push(`${w.id}.raw.${O} is not a non-empty string; ignored.`);
149
+ continue;
150
+ }
151
+ const G = E[D.tierId] ?? (E[D.tierId] = {});
152
+ G[D.itemId] = j, S = !0;
153
+ }
154
+ S && (y || (y = {}), y[w.id] = E);
155
+ }
105
156
  return {
106
- state: { color: d, spacing: m, typography: C, size: g },
157
+ state: { color: d, spacing: m, typography: C, size: g, ...y ? { tabs: y } : {} },
107
158
  unknownTokens: r,
108
159
  warnings: o
109
160
  };
110
161
  }
111
- function dr(e, t, n, o) {
162
+ function fr(e, t, n, o) {
112
163
  if (!e || typeof e != "object" || Array.isArray(e))
113
164
  return { ...t, palette: [...t.palette], semanticMappings: { ...t.semanticMappings } };
114
165
  const r = e;
@@ -147,7 +198,7 @@ function dr(e, t, n, o) {
147
198
  };
148
199
  }
149
200
  function Ct(e, t, n, o, r) {
150
- if (!e || typeof e != "object") return Dn();
201
+ if (!e || typeof e != "object") return Bn();
151
202
  const a = /* @__PURE__ */ new Map();
152
203
  for (const l of t)
153
204
  l.readonly || a.set(l.cssVar, l);
@@ -166,15 +217,15 @@ function Ct(e, t, n, o, r) {
166
217
  }
167
218
  return i;
168
219
  }
169
- function ur(e, t, n) {
170
- const o = [], r = [], a = t.colorDefaults ?? Vn(n), i = pr(e.color, a, o), l = Et(e.spacing, $e("spacing", n), "spacing", r, o), c = Et(e.typography, $e("font", n), "typography", r, o), d = Et(e.size, $e("size", n), "size", r, o);
220
+ function hr(e, t, n) {
221
+ const o = [], r = [], a = t.colorDefaults ?? Fn(n), i = gr(e.color, a, o), l = Et(e.spacing, xe("spacing", n), "spacing", r, o), c = Et(e.typography, xe("font", n), "typography", r, o), d = Et(e.size, xe("size", n), "size", r, o);
171
222
  return {
172
223
  state: { color: i, spacing: l, typography: c, size: d },
173
224
  unknownTokens: r,
174
225
  warnings: o
175
226
  };
176
227
  }
177
- function pr(e, t, n) {
228
+ function gr(e, t, n) {
178
229
  if (!e || typeof e != "object")
179
230
  return {
180
231
  ...t,
@@ -194,7 +245,7 @@ function pr(e, t, n) {
194
245
  );
195
246
  }
196
247
  }
197
- const a = o.base && typeof o.base == "object" ? o.base : {}, i = Be(a.bg, t.background), l = Be(a.fg, t.foreground), c = Be(a.cursor, t.cursor), d = Be(a["sel-bg"], t.selectionBg), u = Be(a["sel-fg"], t.selectionFg), p = {
248
+ const a = o.base && typeof o.base == "object" ? o.base : {}, i = Ve(a.bg, t.background), l = Ve(a.fg, t.foreground), c = Ve(a.cursor, t.cursor), d = Ve(a["sel-bg"], t.selectionBg), u = Ve(a["sel-fg"], t.selectionFg), p = {
198
249
  ...t.semanticMappings
199
250
  };
200
251
  if (o.semantic && typeof o.semantic == "object")
@@ -215,7 +266,7 @@ function pr(e, t, n) {
215
266
  };
216
267
  }
217
268
  function Et(e, t, n, o, r) {
218
- if (!e || typeof e != "object") return Dn();
269
+ if (!e || typeof e != "object") return Bn();
219
270
  const a = /* @__PURE__ */ new Map();
220
271
  for (const l of t)
221
272
  l.readonly || a.set(l.cssVar, l);
@@ -234,10 +285,10 @@ function Et(e, t, n, o, r) {
234
285
  }
235
286
  return i;
236
287
  }
237
- function Be(e, t) {
288
+ function Ve(e, t) {
238
289
  return typeof e == "number" && Number.isFinite(e) ? e : t;
239
290
  }
240
- function Vn(e = q()) {
291
+ function Fn(e = Y()) {
241
292
  const t = ge(e), n = t && t.paletteSize > 0 ? t.paletteSize : 16, o = n - 1, r = Array.from({ length: n }, (i, l) => l === 0 ? "#000000" : l === o ? "#ffffff" : "#808080"), a = (i) => Math.min(Math.max(i, 0), o);
242
293
  return {
243
294
  palette: r,
@@ -250,14 +301,14 @@ function Vn(e = q()) {
250
301
  shikiTheme: "dracula"
251
302
  };
252
303
  }
253
- function fr(e, t) {
304
+ function kr(e, t) {
254
305
  if (t) return t;
255
- const n = Object.values(rr)[0];
306
+ const n = Object.values(ar)[0];
256
307
  return n ? Pn(n) : e;
257
308
  }
258
- function hr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
259
- const [r, a] = j("Copy"), [i, l] = j(!1), c = D(null), d = D(null), u = D(null), p = o ?? q(), m = qo(p), h = J(() => {
260
- const g = fr(t.color, n), N = Bn(
309
+ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
310
+ const [r, a] = K("Copy"), [i, l] = K(!1), c = B(null), d = B(null), u = B(null), p = o ?? Y(), m = Uo(p), h = Z(() => {
311
+ const g = kr(t.color, n), y = Hn(
261
312
  t,
262
313
  {
263
314
  includeDefaults: i,
@@ -265,9 +316,9 @@ function hr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
265
316
  },
266
317
  p
267
318
  );
268
- return JSON.stringify(N, null, 2);
319
+ return JSON.stringify(y, null, 2);
269
320
  }, [t, n, i, p]);
270
- W(() => {
321
+ X(() => {
271
322
  const g = c.current;
272
323
  if (g)
273
324
  return g.showModal(), window.requestAnimationFrame(() => {
@@ -275,21 +326,21 @@ function hr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
275
326
  }), () => {
276
327
  g.open && g.close();
277
328
  };
278
- }, []), W(() => {
329
+ }, []), X(() => {
279
330
  const g = c.current;
280
331
  if (!g) return;
281
- function N() {
332
+ function y() {
282
333
  e();
283
334
  }
284
- return g.addEventListener("close", N), () => g.removeEventListener("close", N);
285
- }, [e]), W(() => () => {
335
+ return g.addEventListener("close", y), () => g.removeEventListener("close", y);
336
+ }, [e]), X(() => () => {
286
337
  u.current && clearTimeout(u.current);
287
338
  }, []);
288
339
  function v(g) {
289
- const N = c.current;
290
- if (!N) return;
291
- const y = N.getBoundingClientRect();
292
- (g.clientX < y.left || g.clientX > y.right || g.clientY < y.top || g.clientY > y.bottom) && N.close();
340
+ const y = c.current;
341
+ if (!y) return;
342
+ const w = y.getBoundingClientRect();
343
+ (g.clientX < w.left || g.clientX > w.right || g.clientY < w.top || g.clientY > w.bottom) && y.close();
293
344
  }
294
345
  async function C() {
295
346
  let g = !1;
@@ -298,28 +349,28 @@ function hr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
298
349
  } catch {
299
350
  }
300
351
  if (!g) {
301
- const N = c.current;
302
- if (N)
352
+ const y = c.current;
353
+ if (y)
303
354
  try {
304
- const y = document.createElement("textarea");
305
- y.value = h, y.style.cssText = "position:fixed;opacity:0;left:-9999px", y.tabIndex = -1, y.setAttribute("aria-hidden", "true"), N.appendChild(y), y.focus(), y.select(), g = document.execCommand("copy"), N.removeChild(y);
355
+ const w = document.createElement("textarea");
356
+ w.value = h, w.style.cssText = "position:fixed;opacity:0;left:-9999px", w.tabIndex = -1, w.setAttribute("aria-hidden", "true"), y.appendChild(w), w.focus(), w.select(), g = document.execCommand("copy"), y.removeChild(w);
306
357
  } catch {
307
358
  }
308
359
  }
309
360
  a(g ? "Copied!" : "Failed"), u.current && clearTimeout(u.current), u.current = setTimeout(() => a("Copy"), 2e3);
310
361
  }
311
- const b = ft(), x = `${p.modalClassPrefix}-export-title-${b}`;
362
+ const b = ht(), N = `${p.modalClassPrefix}-export-title-${b}`;
312
363
  return /* @__PURE__ */ k(
313
364
  "dialog",
314
365
  {
315
366
  ref: c,
316
367
  onClick: v,
317
- "aria-labelledby": x,
368
+ "aria-labelledby": N,
318
369
  className: `${P(p, "")} ${P(p, "--export")}`,
319
370
  "data-design-token-panel-modal": "",
320
371
  "data-design-token-panel-modal-variant": "export",
321
372
  children: [
322
- /* @__PURE__ */ s("div", { id: x, role: "heading", "aria-level": 2, className: P(p, "__title"), children: "Export Design Tokens" }),
373
+ /* @__PURE__ */ s("div", { id: N, role: "heading", "aria-level": 2, className: P(p, "__title"), children: "Export Design Tokens" }),
323
374
  /* @__PURE__ */ k("div", { className: P(p, "__hint"), children: [
324
375
  "Save as ",
325
376
  /* @__PURE__ */ s("span", { className: "tokenpanel-code", children: m }),
@@ -370,9 +421,9 @@ function hr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
370
421
  }
371
422
  );
372
423
  }
373
- function gr({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
374
- const [r, a] = j(""), [i, l] = j(null), c = D(null), d = D(null), u = o ?? q(), p = ir(u);
375
- W(() => {
424
+ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
425
+ const [r, a] = K(""), [i, l] = K(null), c = B(null), d = B(null), u = o ?? Y(), p = cr(u);
426
+ X(() => {
376
427
  const b = c.current;
377
428
  if (b)
378
429
  return b.showModal(), window.requestAnimationFrame(() => {
@@ -380,19 +431,19 @@ function gr({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
380
431
  }), () => {
381
432
  b.open && b.close();
382
433
  };
383
- }, []), W(() => {
434
+ }, []), X(() => {
384
435
  const b = c.current;
385
436
  if (!b) return;
386
- function x() {
437
+ function N() {
387
438
  e();
388
439
  }
389
- return b.addEventListener("close", x), () => b.removeEventListener("close", x);
440
+ return b.addEventListener("close", N), () => b.removeEventListener("close", N);
390
441
  }, [e]);
391
442
  function m(b) {
392
- const x = c.current;
393
- if (!x) return;
394
- const g = x.getBoundingClientRect();
395
- (b.clientX < g.left || b.clientX > g.right || b.clientY < g.top || b.clientY > g.bottom) && x.close();
443
+ const N = c.current;
444
+ if (!N) return;
445
+ const g = N.getBoundingClientRect();
446
+ (b.clientX < g.left || b.clientX > g.right || b.clientY < g.top || b.clientY > g.bottom) && N.close();
396
447
  }
397
448
  function h() {
398
449
  l(null);
@@ -401,38 +452,38 @@ function gr({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
401
452
  l({ kind: "error", text: "Paste a JSON blob first." });
402
453
  return;
403
454
  }
404
- let x;
455
+ let N;
405
456
  try {
406
- x = JSON.parse(b);
457
+ N = JSON.parse(b);
407
458
  } catch (g) {
408
- const N = g instanceof Error ? g.message : String(g);
409
- l({ kind: "error", text: `JSON parse error: ${N}` });
459
+ const y = g instanceof Error ? g.message : String(g);
460
+ l({ kind: "error", text: `JSON parse error: ${y}` });
410
461
  return;
411
462
  }
412
463
  try {
413
- const { state: g, unknownTokens: N, warnings: y } = sr(
414
- x,
464
+ const { state: g, unknownTokens: y, warnings: w } = ur(
465
+ N,
415
466
  {
416
467
  colorDefaults: n
417
468
  },
418
469
  u
419
470
  );
420
- if (N.length > 0) {
471
+ if (y.length > 0) {
421
472
  console.groupCollapsed(
422
- `[design-token-serde] ${N.length} unknown token${N.length === 1 ? "" : "s"} ignored while loading JSON`
473
+ `[design-token-serde] ${y.length} unknown token${y.length === 1 ? "" : "s"} ignored while loading JSON`
423
474
  );
424
- for (const E of N)
475
+ for (const E of y)
425
476
  console.warn(E);
426
477
  console.groupEnd();
427
478
  }
428
- y.length > 0 && console.warn("[design-token-serde] warnings:", y), t(g);
429
- const _ = Object.keys(g.spacing).length + Object.keys(g.typography).length + Object.keys(g.size).length, w = Go(g.color, n);
430
- _ === 0 && w && N.length > 0 ? l({
479
+ w.length > 0 && console.warn("[design-token-serde] warnings:", w), t(g);
480
+ const _ = Object.keys(g.spacing).length + Object.keys(g.typography).length + Object.keys(g.size).length, x = Jo(g.color, n);
481
+ _ === 0 && x && y.length > 0 ? l({
431
482
  kind: "error",
432
- text: `Nothing applied — all ${N.length} token${N.length === 1 ? "" : "s"} in the payload were unknown. See console for the list.`
433
- }) : N.length > 0 ? l({
483
+ text: `Nothing applied — all ${y.length} token${y.length === 1 ? "" : "s"} in the payload were unknown. See console for the list.`
484
+ }) : y.length > 0 ? l({
434
485
  kind: "info",
435
- text: `Loaded. ${N.length} unknown token${N.length === 1 ? "" : "s"} ignored — see console for the list.`
486
+ text: `Loaded. ${y.length} unknown token${y.length === 1 ? "" : "s"} ignored — see console for the list.`
436
487
  }) : l({ kind: "info", text: "Loaded." });
437
488
  } catch (g) {
438
489
  if (g instanceof Pe) {
@@ -445,11 +496,11 @@ function gr({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
445
496
  }) : l({ kind: "error", text: "Input is not a JSON object." });
446
497
  return;
447
498
  }
448
- const N = g instanceof Error ? g.message : String(g);
449
- l({ kind: "error", text: `Load failed: ${N}` });
499
+ const y = g instanceof Error ? g.message : String(g);
500
+ l({ kind: "error", text: `Load failed: ${y}` });
450
501
  }
451
502
  }
452
- const v = ft(), C = `${u.modalClassPrefix}-import-title-${v}`;
503
+ const v = ht(), C = `${u.modalClassPrefix}-import-title-${v}`;
453
504
  return /* @__PURE__ */ k(
454
505
  "dialog",
455
506
  {
@@ -517,7 +568,7 @@ function gr({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
517
568
  }
518
569
  );
519
570
  }
520
- function fn(e, t, n = ge(), o = q().tabs) {
571
+ function fn(e, t, n = ge(), o = Y().tabs) {
521
572
  const r = {}, a = e.color, i = a.palette.length;
522
573
  for (let c = 0; c < i; c++) {
523
574
  const d = a.palette[c];
@@ -530,9 +581,9 @@ function fn(e, t, n = ge(), o = q().tabs) {
530
581
  if (u === void 0) continue;
531
582
  const p = t?.semanticMappings[c];
532
583
  if (!(t === void 0 || u !== p)) continue;
533
- const h = mr(u, a);
584
+ const h = wr(u, a);
534
585
  if (h === null) continue;
535
- const v = zo(h, a.palette.length);
586
+ const v = Oo(h, a.palette.length);
536
587
  v !== h && console.error(
537
588
  `[design-token-panel] paletteIndex ${h} for ${d} is out of range (palette length ${a.palette.length}); clamping to ${v}.`
538
589
  ), r[d] = `var(${ve(n, v)})`;
@@ -545,11 +596,11 @@ function fn(e, t, n = ge(), o = q().tabs) {
545
596
  for (const { tabId: c, overrides: d } of l) {
546
597
  if (Object.keys(d).length === 0) continue;
547
598
  const u = o.find((p) => p.id === c);
548
- u && kr(u, d, r);
599
+ u && vr(u, d, r);
549
600
  }
550
601
  return r;
551
602
  }
552
- function kr(e, t, n) {
603
+ function vr(e, t, n) {
553
604
  const o = {};
554
605
  for (const r of e.tiers) {
555
606
  const a = {};
@@ -566,19 +617,19 @@ function kr(e, t, n) {
566
617
  if (!(typeof i != "string" || i.length === 0))
567
618
  try {
568
619
  const l = Ue(e, r.id, a.id, o);
569
- n[a.cssVar] = Ro(l);
620
+ n[a.cssVar] = Do(l);
570
621
  } catch {
571
622
  }
572
623
  }
573
624
  }
574
- function mr(e, t) {
625
+ function wr(e, t) {
575
626
  return e === "bg" ? t.background : e === "fg" ? t.foreground : typeof e == "number" && Number.isInteger(e) ? e : null;
576
627
  }
577
- const br = 2e3, St = { kind: "preview" };
578
- function vr(e, t, n) {
579
- return JSON.stringify(Bn(e, { colorDefaults: t }, n), null, 2);
628
+ const xr = 2e3, St = { kind: "preview" };
629
+ function yr(e, t, n) {
630
+ return JSON.stringify(Hn(e, { colorDefaults: t }, n), null, 2);
580
631
  }
581
- function wr(e) {
632
+ function Nr(e) {
582
633
  if (Array.isArray(e.updated)) return e.updated;
583
634
  const t = e.results;
584
635
  if (Array.isArray(t)) return t;
@@ -591,7 +642,7 @@ function wr(e) {
591
642
  }
592
643
  return n;
593
644
  }
594
- function xr(e) {
645
+ function _r(e) {
595
646
  return {
596
647
  dialog: `${P(e, "")} ${P(e, "--apply")}`,
597
648
  header: P(e, "__header"),
@@ -613,38 +664,38 @@ function xr(e) {
613
664
  jsonBlock: P(e, "__json")
614
665
  };
615
666
  }
616
- function yr(e) {
617
- const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a, instanceConfig: i } = e, l = D(null), c = D(null), d = i ?? q(), u = J(() => xr(d), [d]), p = ft(), m = `${d.modalClassPrefix}-apply-title-${p}`, [h, v] = j(St), [C, b] = j("Copy pre-apply state to clipboard");
618
- W(() => {
667
+ function $r(e) {
668
+ const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a, instanceConfig: i } = e, l = B(null), c = B(null), d = i ?? Y(), u = Z(() => _r(d), [d]), p = ht(), m = `${d.modalClassPrefix}-apply-title-${p}`, [h, v] = K(St), [C, b] = K("Copy pre-apply state to clipboard");
669
+ X(() => {
619
670
  const A = l.current;
620
671
  if (!A) return;
621
- const B = A.open;
622
- n && !B ? (typeof A.showModal == "function" ? A.showModal() : A.setAttribute("open", ""), window.requestAnimationFrame(() => {
672
+ const H = A.open;
673
+ n && !H ? (typeof A.showModal == "function" ? A.showModal() : A.setAttribute("open", ""), window.requestAnimationFrame(() => {
623
674
  c.current?.focus();
624
- })) : !n && B && (typeof A.close == "function" ? A.close() : A.removeAttribute("open"));
625
- }, [n]), W(() => {
675
+ })) : !n && H && (typeof A.close == "function" ? A.close() : A.removeAttribute("open"));
676
+ }, [n]), X(() => {
626
677
  n && (v(St), b("Copy pre-apply state to clipboard"));
627
- }, [n]), W(() => {
678
+ }, [n]), X(() => {
628
679
  if (C !== "Copied!") return;
629
680
  const A = window.setTimeout(
630
681
  () => b("Copy pre-apply state to clipboard"),
631
- br
682
+ xr
632
683
  );
633
684
  return () => window.clearTimeout(A);
634
685
  }, [C]);
635
- const x = J(() => {
636
- const A = ge(d), B = fn(t, r, A, d.tabs), ee = Uo(d), be = ee && t.secondary ? fn(
686
+ const N = Z(() => {
687
+ const A = ge(d), H = fn(t, r, A, d.tabs), ee = Zo(d), be = ee && t.secondary ? fn(
637
688
  { ...t, color: t.secondary },
638
689
  void 0,
639
690
  ee,
640
691
  d.tabs
641
692
  ) : {};
642
- return { ...B, ...be };
643
- }, [t, r, d]), g = J(() => Jo(d), [d]), { groups: N, rejected: y, rejectedReasons: _ } = J(
644
- () => ar(x, g),
645
- [x, g]
646
- ), w = J(() => Object.keys(x).length, [x]), f = w === 0, E = N.length > 0, S = d.applyEndpoint, V = !!S && Object.keys(g).length > 0;
647
- async function X() {
693
+ return { ...H, ...be };
694
+ }, [t, r, d]), g = Z(() => Qo(d), [d]), { groups: y, rejected: w, rejectedReasons: _ } = Z(
695
+ () => ir(N, g),
696
+ [N, g]
697
+ ), x = Z(() => Object.keys(N).length, [N]), f = x === 0, E = y.length > 0, S = d.applyEndpoint, O = !!S && Object.keys(g).length > 0;
698
+ async function j() {
648
699
  if (!S) {
649
700
  v({
650
701
  kind: "error",
@@ -652,18 +703,18 @@ function yr(e) {
652
703
  });
653
704
  return;
654
705
  }
655
- const A = vr(t, r, d);
706
+ const A = yr(t, r, d);
656
707
  v({ kind: "applying" });
657
708
  try {
658
- const B = await fetch(S, {
709
+ const H = await fetch(S, {
659
710
  method: "POST",
660
711
  headers: { "Content-Type": "application/json" },
661
- body: JSON.stringify({ tokens: x })
712
+ body: JSON.stringify({ tokens: N })
662
713
  });
663
- if (!B.ok) {
714
+ if (!H.ok) {
664
715
  let be = "";
665
716
  try {
666
- const I = await B.text();
717
+ const I = await H.text();
667
718
  if (I)
668
719
  try {
669
720
  const re = JSON.parse(I);
@@ -673,31 +724,31 @@ function yr(e) {
673
724
  }
674
725
  } catch {
675
726
  }
676
- const $ = be ? `Apply failed (${B.status}): ${be}` : `Apply failed (${B.status} ${B.statusText || "error"}).`;
727
+ const $ = be ? `Apply failed (${H.status}): ${be}` : `Apply failed (${H.status} ${H.statusText || "error"}).`;
677
728
  v({ kind: "error", message: $ });
678
729
  return;
679
730
  }
680
731
  let ee = {};
681
732
  try {
682
- ee = await B.json();
733
+ ee = await H.json();
683
734
  } catch {
684
735
  ee = {};
685
736
  }
686
737
  v({ kind: "success", response: ee, previewJson: A });
687
- } catch (B) {
688
- const ee = B instanceof Error ? B.message : String(B);
738
+ } catch (H) {
739
+ const ee = H instanceof Error ? H.message : String(H);
689
740
  v({ kind: "error", message: `Network error: ${ee}` });
690
741
  }
691
742
  }
692
- function H(A) {
693
- const B = typeof navigator < "u" ? navigator.clipboard : void 0;
694
- B?.writeText && B.writeText(A).then(
743
+ function D(A) {
744
+ const H = typeof navigator < "u" ? navigator.clipboard : void 0;
745
+ H?.writeText && H.writeText(A).then(
695
746
  () => b("Copied!"),
696
747
  () => {
697
748
  }
698
749
  );
699
750
  }
700
- function Z() {
751
+ function G() {
701
752
  a(), oe();
702
753
  }
703
754
  function ie() {
@@ -715,18 +766,18 @@ function yr(e) {
715
766
  typeof A.close == "function" ? A.close() : (A.removeAttribute("open"), o());
716
767
  }
717
768
  function me(A) {
718
- const B = l.current;
719
- if (!B) return;
720
- const ee = B.getBoundingClientRect();
769
+ const H = l.current;
770
+ if (!H) return;
771
+ const ee = H.getBoundingClientRect();
721
772
  (A.clientX < ee.left || A.clientX > ee.right || A.clientY < ee.top || A.clientY > ee.bottom) && oe();
722
773
  }
723
- const De = J(
774
+ const De = Z(
724
775
  () => Object.values(g).map((A) => {
725
- const B = A.lastIndexOf("/");
726
- return B >= 0 ? A.slice(B + 1) : A;
776
+ const H = A.lastIndexOf("/");
777
+ return H >= 0 ? A.slice(H + 1) : A;
727
778
  }).join(" / "),
728
779
  [g]
729
- ), Ae = h.kind === "applying" ? "Applying…" : V ? `Apply to ${De}` : "Apply (host not configured)";
780
+ ), Ae = h.kind === "applying" ? "Applying…" : O ? `Apply to ${De}` : "Apply (host not configured)";
730
781
  return /* @__PURE__ */ k(
731
782
  "dialog",
732
783
  {
@@ -757,35 +808,35 @@ function yr(e) {
757
808
  ] }),
758
809
  /* @__PURE__ */ k("div", { children: [
759
810
  h.kind === "preview" && /* @__PURE__ */ s(
760
- Nr,
811
+ Cr,
761
812
  {
762
813
  cls: u,
763
- groups: N,
764
- rejected: y,
814
+ groups: y,
815
+ rejected: w,
765
816
  rejectedReasons: _,
766
- totalCount: w,
817
+ totalCount: x,
767
818
  isEmpty: f,
768
- applyConfigured: V
819
+ applyConfigured: O
769
820
  }
770
821
  ),
771
- h.kind === "applying" && /* @__PURE__ */ s(_r, { cls: u }),
822
+ h.kind === "applying" && /* @__PURE__ */ s(Er, { cls: u }),
772
823
  h.kind === "success" && /* @__PURE__ */ s(
773
- $r,
824
+ Sr,
774
825
  {
775
826
  cls: u,
776
- results: wr(h.response),
827
+ results: Nr(h.response),
777
828
  unknownCssVars: Array.isArray(h.response.unknownCssVars) ? h.response.unknownCssVars : [],
778
829
  previewJson: h.previewJson,
779
830
  copyLabel: C,
780
- onCopy: () => H(h.previewJson)
831
+ onCopy: () => D(h.previewJson)
781
832
  }
782
833
  ),
783
- h.kind === "error" && /* @__PURE__ */ s(Cr, { cls: u, message: h.message })
834
+ h.kind === "error" && /* @__PURE__ */ s(Tr, { cls: u, message: h.message })
784
835
  ] }),
785
836
  /* @__PURE__ */ k("div", { className: u.actions, children: [
786
837
  h.kind === "preview" && /* @__PURE__ */ k(ae, { children: [
787
838
  (() => {
788
- const A = f || !E || !V;
839
+ const A = f || !E || !O;
789
840
  return /* @__PURE__ */ s(
790
841
  "div",
791
842
  {
@@ -794,12 +845,12 @@ function yr(e) {
794
845
  tabIndex: 0,
795
846
  className: u.primaryButton,
796
847
  "aria-disabled": A || void 0,
797
- title: V ? void 0 : "Host has not configured an apply endpoint or routing map. The Apply modal can preview the diff but cannot rewrite source files.",
848
+ title: O ? void 0 : "Host has not configured an apply endpoint or routing map. The Apply modal can preview the diff but cannot rewrite source files.",
798
849
  onClick: () => {
799
- A || X();
850
+ A || j();
800
851
  },
801
- onKeyDown: (B) => {
802
- (B.key === "Enter" || B.key === " ") && (B.preventDefault(), A || X());
852
+ onKeyDown: (H) => {
853
+ (H.key === "Enter" || H.key === " ") && (H.preventDefault(), A || j());
803
854
  },
804
855
  children: Ae
805
856
  }
@@ -826,9 +877,9 @@ function yr(e) {
826
877
  role: "button",
827
878
  tabIndex: 0,
828
879
  className: u.primaryButton,
829
- onClick: Z,
880
+ onClick: G,
830
881
  onKeyDown: (A) => {
831
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), Z());
882
+ (A.key === "Enter" || A.key === " ") && (A.preventDefault(), G());
832
883
  },
833
884
  children: "Done"
834
885
  }
@@ -866,7 +917,7 @@ function yr(e) {
866
917
  }
867
918
  );
868
919
  }
869
- function Nr({
920
+ function Cr({
870
921
  cls: e,
871
922
  groups: t,
872
923
  rejected: n,
@@ -895,7 +946,7 @@ function Nr({
895
946
  ] }),
896
947
  t.map((c) => /* @__PURE__ */ k("div", { children: [
897
948
  /* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: [
898
- Er(c.relativePath),
949
+ Mr(c.relativePath),
899
950
  " (",
900
951
  Object.keys(c.tokens).length,
901
952
  ")"
@@ -924,13 +975,13 @@ function Nr({
924
975
  ] })
925
976
  ] });
926
977
  }
927
- function _r({ cls: e }) {
978
+ function Er({ cls: e }) {
928
979
  return /* @__PURE__ */ k("div", { className: e.applying, role: "status", "aria-live": "polite", children: [
929
980
  /* @__PURE__ */ s("span", { className: e.spinner, "aria-hidden": "true" }),
930
981
  /* @__PURE__ */ s("span", { children: "Applying changes…" })
931
982
  ] });
932
983
  }
933
- function $r({
984
+ function Sr({
934
985
  cls: e,
935
986
  results: t,
936
987
  unknownCssVars: n,
@@ -942,9 +993,9 @@ function $r({
942
993
  /* @__PURE__ */ s("div", { className: e.statusSuccess, role: "status", children: "Applied successfully." }),
943
994
  t.length === 0 ? /* @__PURE__ */ s("div", { className: e.hint, children: "The server returned no per-file details." }) : t.map((i) => /* @__PURE__ */ k("div", { children: [
944
995
  /* @__PURE__ */ s("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: i.file ?? "(unknown file)" }),
945
- /* @__PURE__ */ s(Mt, { cls: e, label: "changed", values: i.changed }),
946
- /* @__PURE__ */ s(Mt, { cls: e, label: "unknown", values: i.unknown }),
947
- /* @__PURE__ */ s(Mt, { cls: e, label: "unchanged", values: i.unchanged })
996
+ /* @__PURE__ */ s(Tt, { cls: e, label: "changed", values: i.changed }),
997
+ /* @__PURE__ */ s(Tt, { cls: e, label: "unknown", values: i.unknown }),
998
+ /* @__PURE__ */ s(Tt, { cls: e, label: "unchanged", values: i.unchanged })
948
999
  ] }, i.file ?? "unknown-file")),
949
1000
  n.length > 0 && /* @__PURE__ */ k("div", { className: e.statusWarning, children: [
950
1001
  n.length,
@@ -970,7 +1021,7 @@ function $r({
970
1021
  /* @__PURE__ */ s("div", { role: "none", className: e.jsonBlock, children: o })
971
1022
  ] });
972
1023
  }
973
- function Mt({ cls: e, label: t, values: n }) {
1024
+ function Tt({ cls: e, label: t, values: n }) {
974
1025
  return !n || n.length === 0 ? null : /* @__PURE__ */ k("div", { children: [
975
1026
  /* @__PURE__ */ k("div", { className: e.hint, children: [
976
1027
  t,
@@ -981,13 +1032,13 @@ function Mt({ cls: e, label: t, values: n }) {
981
1032
  /* @__PURE__ */ s("div", { className: e.list, children: n.map((o) => /* @__PURE__ */ s("div", { className: e.listItem, children: /* @__PURE__ */ s("span", { className: "tokenpanel-code", children: o }) }, o)) })
982
1033
  ] });
983
1034
  }
984
- function Cr({ cls: e, message: t }) {
1035
+ function Tr({ cls: e, message: t }) {
985
1036
  return /* @__PURE__ */ k("div", { children: [
986
1037
  /* @__PURE__ */ s("div", { className: e.statusError, role: "alert", children: t }),
987
1038
  /* @__PURE__ */ s("div", { className: e.hint, children: "Your edits are still intact — click Retry to send the same diff again, or Close to keep editing." })
988
1039
  ] });
989
1040
  }
990
- function Er(e) {
1041
+ function Mr(e) {
991
1042
  if (!e) return "(unknown file)";
992
1043
  const t = e.lastIndexOf("/");
993
1044
  return t >= 0 ? e.slice(t + 1) : e;
@@ -1026,21 +1077,21 @@ function Se({
1026
1077
  }
1027
1078
  );
1028
1079
  }
1029
- const Sr = { h: 0, s: 0, l: 0, a: 100 };
1030
- function Mr(e) {
1080
+ const Ar = { h: 0, s: 0, l: 0, a: 100 };
1081
+ function Lr(e) {
1031
1082
  const t = e.toLowerCase();
1032
1083
  return /^#[0-9a-f]{6}$/.test(t) || /^#[0-9a-f]{8}$/.test(t) ? t : /^#[0-9a-f]{3}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}` : /^#[0-9a-f]{4}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}${t[4]}${t[4]}` : "";
1033
1084
  }
1034
- function Tr(e) {
1035
- const t = Mr(e);
1036
- if (!t) return { ...Sr };
1085
+ function Pr(e) {
1086
+ const t = Lr(e);
1087
+ if (!t) return { ...Ar };
1037
1088
  const n = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, r = parseInt(t.slice(5, 7), 16) / 255, a = t.length === 9 ? Math.round(parseInt(t.slice(7, 9), 16) / 255 * 100) : 100, i = Math.max(n, o, r), l = Math.min(n, o, r), c = (i + l) / 2;
1038
1089
  if (i === l) return { h: 0, s: 0, l: Math.round(c * 100), a };
1039
1090
  const d = i - l, u = c > 0.5 ? d / (2 - i - l) : d / (i + l);
1040
1091
  let p = 0;
1041
1092
  return i === n ? p = ((o - r) / d + (o < r ? 6 : 0)) / 6 : i === o ? p = ((r - n) / d + 2) / 6 : p = ((n - o) / d + 4) / 6, { h: Math.round(p * 360), s: Math.round(u * 100), l: Math.round(c * 100), a };
1042
1093
  }
1043
- function Ar(e, t, n, o) {
1094
+ function Ir(e, t, n, o) {
1044
1095
  t = Math.max(0, Math.min(100, t)), n = Math.max(0, Math.min(100, n)), o = Math.max(0, Math.min(100, o)), e = (e % 360 + 360) % 360;
1045
1096
  const r = t / 100, a = n / 100, i = (1 - Math.abs(2 * a - 1)) * r, l = i * (1 - Math.abs(e / 60 % 2 - 1)), c = a - i / 2;
1046
1097
  let d = 0, u = 0, p = 0;
@@ -1050,7 +1101,7 @@ function Ar(e, t, n, o) {
1050
1101
  const v = Math.round(o / 100 * 255).toString(16).padStart(2, "0");
1051
1102
  return `${h}${v}`;
1052
1103
  }
1053
- const Hn = (e, t) => {
1104
+ const jn = (e, t) => {
1054
1105
  if (typeof e == "number") {
1055
1106
  if (t === 3)
1056
1107
  return {
@@ -1083,7 +1134,7 @@ const Hn = (e, t) => {
1083
1134
  alpha: (e & 255) / 255
1084
1135
  };
1085
1136
  }
1086
- }, Lr = {
1137
+ }, zr = {
1087
1138
  aliceblue: 15792383,
1088
1139
  antiquewhite: 16444375,
1089
1140
  aqua: 65535,
@@ -1234,23 +1285,23 @@ const Hn = (e, t) => {
1234
1285
  whitesmoke: 16119285,
1235
1286
  yellow: 16776960,
1236
1287
  yellowgreen: 10145074
1237
- }, Pr = (e) => Hn(Lr[e.toLowerCase()], 6), Ir = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, zr = (e) => {
1288
+ }, Rr = (e) => jn(zr[e.toLowerCase()], 6), Or = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Dr = (e) => {
1238
1289
  let t;
1239
- return (t = e.match(Ir)) ? Hn(parseInt(t[1], 16), t[1].length) : void 0;
1240
- }, Me = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", Xe = `${Me}%`, Yt = `(?:${Me}%|${Me})`, Rr = `(?:${Me}(deg|grad|rad|turn)|${Me})`, Re = "\\s*,\\s*", Or = new RegExp(
1241
- `^rgba?\\(\\s*${Me}${Re}${Me}${Re}${Me}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
1242
- ), Dr = new RegExp(
1290
+ return (t = e.match(Or)) ? jn(parseInt(t[1], 16), t[1].length) : void 0;
1291
+ }, Te = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", Xe = `${Te}%`, Yt = `(?:${Te}%|${Te})`, Vr = `(?:${Te}(deg|grad|rad|turn)|${Te})`, Re = "\\s*,\\s*", Br = new RegExp(
1292
+ `^rgba?\\(\\s*${Te}${Re}${Te}${Re}${Te}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
1293
+ ), Hr = new RegExp(
1243
1294
  `^rgba?\\(\\s*${Xe}${Re}${Xe}${Re}${Xe}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
1244
- ), Br = (e) => {
1295
+ ), Fr = (e) => {
1245
1296
  let t = { mode: "rgb" }, n;
1246
- if (n = e.match(Or))
1297
+ if (n = e.match(Br))
1247
1298
  n[1] !== void 0 && (t.r = n[1] / 255), n[2] !== void 0 && (t.g = n[2] / 255), n[3] !== void 0 && (t.b = n[3] / 255);
1248
- else if (n = e.match(Dr))
1299
+ else if (n = e.match(Hr))
1249
1300
  n[1] !== void 0 && (t.r = n[1] / 100), n[2] !== void 0 && (t.g = n[2] / 100), n[3] !== void 0 && (t.b = n[3] / 100);
1250
1301
  else
1251
1302
  return;
1252
1303
  return n[4] !== void 0 ? t.alpha = Math.max(0, Math.min(1, n[4] / 100)) : n[5] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +n[5]))), t;
1253
- }, st = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Wn(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, xe = (e = "rgb") => (t) => (t = st(t, e)) !== void 0 ? (
1304
+ }, ct = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Yn(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, ye = (e = "rgb") => (t) => (t = ct(t, e)) !== void 0 ? (
1254
1305
  // if the color's mode corresponds to our target mode
1255
1306
  t.mode === e ? (
1256
1307
  // then just return the color
@@ -1273,7 +1324,7 @@ const Hn = (e, t) => {
1273
1324
  )
1274
1325
  )
1275
1326
  )
1276
- ) : void 0, we = {}, Fn = {}, ct = [], jn = {}, Vr = (e) => e, qt = (e) => (we[e.mode] = {
1327
+ ) : void 0, we = {}, Kn = {}, dt = [], Wn = {}, jr = (e) => e, qt = (e) => (we[e.mode] = {
1277
1328
  ...we[e.mode],
1278
1329
  ...e.toMode
1279
1330
  }, Object.keys(e.fromMode || {}).forEach((t) => {
@@ -1283,16 +1334,16 @@ const Hn = (e, t) => {
1283
1334
  throw new Error(`Missing interpolator for: ${t}`);
1284
1335
  typeof e.interpolate[t] == "function" && (e.interpolate[t] = {
1285
1336
  use: e.interpolate[t]
1286
- }), e.interpolate[t].fixup || (e.interpolate[t].fixup = Vr);
1287
- }), Fn[e.mode] = e, (e.parse || []).forEach((t) => {
1288
- Hr(t, e.mode);
1289
- }), xe(e.mode)), ht = (e) => Fn[e], Hr = (e, t) => {
1337
+ }), e.interpolate[t].fixup || (e.interpolate[t].fixup = jr);
1338
+ }), Kn[e.mode] = e, (e.parse || []).forEach((t) => {
1339
+ Kr(t, e.mode);
1340
+ }), ye(e.mode)), gt = (e) => Kn[e], Kr = (e, t) => {
1290
1341
  if (typeof e == "string") {
1291
1342
  if (!t)
1292
1343
  throw new Error("'mode' required when 'parser' is a string");
1293
- jn[e] = t;
1294
- } else typeof e == "function" && ct.indexOf(e) < 0 && ct.push(e);
1295
- }, Ot = /[^\x00-\x7F]|[a-zA-Z_]/, Fr = /[^\x00-\x7F]|[-\w]/, T = {
1344
+ Wn[e] = t;
1345
+ } else typeof e == "function" && dt.indexOf(e) < 0 && dt.push(e);
1346
+ }, Ot = /[^\x00-\x7F]|[a-zA-Z_]/, Wr = /[^\x00-\x7F]|[-\w]/, M = {
1296
1347
  Function: "function",
1297
1348
  Ident: "ident",
1298
1349
  Number: "number",
@@ -1303,7 +1354,7 @@ const Hn = (e, t) => {
1303
1354
  Alpha: "alpha"
1304
1355
  };
1305
1356
  let L = 0;
1306
- function Je(e) {
1357
+ function Ze(e) {
1307
1358
  let t = e[L], n = e[L + 1];
1308
1359
  return t === "-" || t === "+" ? /\d/.test(n) || n === "." && /\d/.test(e[L + 2]) : t === "." ? /\d/.test(n) : /\d/.test(t);
1309
1360
  }
@@ -1321,37 +1372,37 @@ function Dt(e) {
1321
1372
  }
1322
1373
  return !1;
1323
1374
  }
1324
- const jr = {
1375
+ const Xr = {
1325
1376
  deg: 1,
1326
1377
  rad: 180 / Math.PI,
1327
1378
  grad: 9 / 10,
1328
1379
  turn: 360
1329
1380
  };
1330
- function Ve(e) {
1381
+ function Be(e) {
1331
1382
  let t = "";
1332
- if ((e[L] === "-" || e[L] === "+") && (t += e[L++]), t += Ze(e), e[L] === "." && /\d/.test(e[L + 1]) && (t += e[L++] + Ze(e)), (e[L] === "e" || e[L] === "E") && ((e[L + 1] === "-" || e[L + 1] === "+") && /\d/.test(e[L + 2]) ? t += e[L++] + e[L++] + Ze(e) : /\d/.test(e[L + 1]) && (t += e[L++] + Ze(e))), Dt(e)) {
1333
- let n = dt(e);
1334
- return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: T.Hue, value: t * jr[n] } : void 0;
1383
+ if ((e[L] === "-" || e[L] === "+") && (t += e[L++]), t += Qe(e), e[L] === "." && /\d/.test(e[L + 1]) && (t += e[L++] + Qe(e)), (e[L] === "e" || e[L] === "E") && ((e[L + 1] === "-" || e[L + 1] === "+") && /\d/.test(e[L + 2]) ? t += e[L++] + e[L++] + Qe(e) : /\d/.test(e[L + 1]) && (t += e[L++] + Qe(e))), Dt(e)) {
1384
+ let n = ut(e);
1385
+ return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: M.Hue, value: t * Xr[n] } : void 0;
1335
1386
  }
1336
- return e[L] === "%" ? (L++, { type: T.Percentage, value: +t }) : { type: T.Number, value: +t };
1387
+ return e[L] === "%" ? (L++, { type: M.Percentage, value: +t }) : { type: M.Number, value: +t };
1337
1388
  }
1338
- function Ze(e) {
1389
+ function Qe(e) {
1339
1390
  let t = "";
1340
1391
  for (; /\d/.test(e[L]); )
1341
1392
  t += e[L++];
1342
1393
  return t;
1343
1394
  }
1344
- function dt(e) {
1395
+ function ut(e) {
1345
1396
  let t = "";
1346
- for (; L < e.length && Fr.test(e[L]); )
1397
+ for (; L < e.length && Wr.test(e[L]); )
1347
1398
  t += e[L++];
1348
1399
  return t;
1349
1400
  }
1350
- function Kr(e) {
1351
- let t = dt(e);
1352
- return e[L] === "(" ? (L++, { type: T.Function, value: t }) : t === "none" ? { type: T.None, value: void 0 } : { type: T.Ident, value: t };
1401
+ function Yr(e) {
1402
+ let t = ut(e);
1403
+ return e[L] === "(" ? (L++, { type: M.Function, value: t }) : t === "none" ? { type: M.None, value: void 0 } : { type: M.Ident, value: t };
1353
1404
  }
1354
- function Wr(e = "") {
1405
+ function qr(e = "") {
1355
1406
  let t = e.trim(), n = [], o;
1356
1407
  for (L = 0; L < t.length; ) {
1357
1408
  if (o = t[L++], o === `
@@ -1364,30 +1415,30 @@ function Wr(e = "") {
1364
1415
  if (o === ",")
1365
1416
  return;
1366
1417
  if (o === ")") {
1367
- n.push({ type: T.ParenClose });
1418
+ n.push({ type: M.ParenClose });
1368
1419
  continue;
1369
1420
  }
1370
1421
  if (o === "+") {
1371
- if (L--, Je(t)) {
1372
- n.push(Ve(t));
1422
+ if (L--, Ze(t)) {
1423
+ n.push(Be(t));
1373
1424
  continue;
1374
1425
  }
1375
1426
  return;
1376
1427
  }
1377
1428
  if (o === "-") {
1378
- if (L--, Je(t)) {
1379
- n.push(Ve(t));
1429
+ if (L--, Ze(t)) {
1430
+ n.push(Be(t));
1380
1431
  continue;
1381
1432
  }
1382
1433
  if (Dt(t)) {
1383
- n.push({ type: T.Ident, value: dt(t) });
1434
+ n.push({ type: M.Ident, value: ut(t) });
1384
1435
  continue;
1385
1436
  }
1386
1437
  return;
1387
1438
  }
1388
1439
  if (o === ".") {
1389
- if (L--, Je(t)) {
1390
- n.push(Ve(t));
1440
+ if (L--, Ze(t)) {
1441
+ n.push(Be(t));
1391
1442
  continue;
1392
1443
  }
1393
1444
  return;
@@ -1397,56 +1448,56 @@ function Wr(e = "") {
1397
1448
  ` || t[L] === " " || t[L] === " "); )
1398
1449
  L++;
1399
1450
  let r;
1400
- if (Je(t) && (r = Ve(t), r.type !== T.Hue)) {
1401
- n.push({ type: T.Alpha, value: r });
1451
+ if (Ze(t) && (r = Be(t), r.type !== M.Hue)) {
1452
+ n.push({ type: M.Alpha, value: r });
1402
1453
  continue;
1403
1454
  }
1404
- if (Dt(t) && dt(t) === "none") {
1455
+ if (Dt(t) && ut(t) === "none") {
1405
1456
  n.push({
1406
- type: T.Alpha,
1407
- value: { type: T.None, value: void 0 }
1457
+ type: M.Alpha,
1458
+ value: { type: M.None, value: void 0 }
1408
1459
  });
1409
1460
  continue;
1410
1461
  }
1411
1462
  return;
1412
1463
  }
1413
1464
  if (/\d/.test(o)) {
1414
- L--, n.push(Ve(t));
1465
+ L--, n.push(Be(t));
1415
1466
  continue;
1416
1467
  }
1417
1468
  if (Ot.test(o)) {
1418
- L--, n.push(Kr(t));
1469
+ L--, n.push(Yr(t));
1419
1470
  continue;
1420
1471
  }
1421
1472
  return;
1422
1473
  }
1423
1474
  return n;
1424
1475
  }
1425
- function Xr(e) {
1476
+ function Gr(e) {
1426
1477
  e._i = 0;
1427
1478
  let t = e[e._i++];
1428
- if (!t || t.type !== T.Function || t.value !== "color" || (t = e[e._i++], t.type !== T.Ident))
1479
+ if (!t || t.type !== M.Function || t.value !== "color" || (t = e[e._i++], t.type !== M.Ident))
1429
1480
  return;
1430
- const n = jn[t.value];
1481
+ const n = Wn[t.value];
1431
1482
  if (!n)
1432
1483
  return;
1433
- const o = { mode: n }, r = Kn(e, !1);
1484
+ const o = { mode: n }, r = Xn(e, !1);
1434
1485
  if (!r)
1435
1486
  return;
1436
- const a = ht(n).channels;
1487
+ const a = gt(n).channels;
1437
1488
  for (let i = 0, l, c; i < a.length; i++)
1438
- l = r[i], c = a[i], l.type !== T.None && (o[c] = l.type === T.Number ? l.value : l.value / 100, c === "alpha" && (o[c] = Math.max(0, Math.min(1, o[c]))));
1489
+ l = r[i], c = a[i], l.type !== M.None && (o[c] = l.type === M.Number ? l.value : l.value / 100, c === "alpha" && (o[c] = Math.max(0, Math.min(1, o[c]))));
1439
1490
  return o;
1440
1491
  }
1441
- function Kn(e, t) {
1492
+ function Xn(e, t) {
1442
1493
  const n = [];
1443
1494
  let o;
1444
1495
  for (; e._i < e.length; ) {
1445
- if (o = e[e._i++], o.type === T.None || o.type === T.Number || o.type === T.Alpha || o.type === T.Percentage || t && o.type === T.Hue) {
1496
+ if (o = e[e._i++], o.type === M.None || o.type === M.Number || o.type === M.Alpha || o.type === M.Percentage || t && o.type === M.Hue) {
1446
1497
  n.push(o);
1447
1498
  continue;
1448
1499
  }
1449
- if (o.type === T.ParenClose) {
1500
+ if (o.type === M.ParenClose) {
1450
1501
  if (e._i < e.length)
1451
1502
  return;
1452
1503
  continue;
@@ -1455,70 +1506,70 @@ function Kn(e, t) {
1455
1506
  }
1456
1507
  if (!(n.length < 3 || n.length > 4)) {
1457
1508
  if (n.length === 4) {
1458
- if (n[3].type !== T.Alpha)
1509
+ if (n[3].type !== M.Alpha)
1459
1510
  return;
1460
1511
  n[3] = n[3].value;
1461
1512
  }
1462
- return n.length === 3 && n.push({ type: T.None, value: void 0 }), n.every((r) => r.type !== T.Alpha) ? n : void 0;
1513
+ return n.length === 3 && n.push({ type: M.None, value: void 0 }), n.every((r) => r.type !== M.Alpha) ? n : void 0;
1463
1514
  }
1464
1515
  }
1465
- function Yr(e, t) {
1516
+ function Ur(e, t) {
1466
1517
  e._i = 0;
1467
1518
  let n = e[e._i++];
1468
- if (!n || n.type !== T.Function)
1519
+ if (!n || n.type !== M.Function)
1469
1520
  return;
1470
- let o = Kn(e, t);
1521
+ let o = Xn(e, t);
1471
1522
  if (o)
1472
1523
  return o.unshift(n.value), o;
1473
1524
  }
1474
- const Wn = (e) => {
1525
+ const Yn = (e) => {
1475
1526
  if (typeof e != "string")
1476
1527
  return;
1477
- const t = Wr(e), n = t ? Yr(t, !0) : void 0;
1478
- let o, r = 0, a = ct.length;
1528
+ const t = qr(e), n = t ? Ur(t, !0) : void 0;
1529
+ let o, r = 0, a = dt.length;
1479
1530
  for (; r < a; )
1480
- if ((o = ct[r++](e, n)) !== void 0)
1531
+ if ((o = dt[r++](e, n)) !== void 0)
1481
1532
  return o;
1482
- return t ? Xr(t) : void 0;
1533
+ return t ? Gr(t) : void 0;
1483
1534
  };
1484
- function qr(e, t) {
1535
+ function Jr(e, t) {
1485
1536
  if (!t || t[0] !== "rgb" && t[0] !== "rgba")
1486
1537
  return;
1487
1538
  const n = { mode: "rgb" }, [, o, r, a, i] = t;
1488
- if (!(o.type === T.Hue || r.type === T.Hue || a.type === T.Hue))
1489
- return o.type !== T.None && (n.r = o.type === T.Number ? o.value / 255 : o.value / 100), r.type !== T.None && (n.g = r.type === T.Number ? r.value / 255 : r.value / 100), a.type !== T.None && (n.b = a.type === T.Number ? a.value / 255 : a.value / 100), i.type !== T.None && (n.alpha = Math.min(
1539
+ if (!(o.type === M.Hue || r.type === M.Hue || a.type === M.Hue))
1540
+ return o.type !== M.None && (n.r = o.type === M.Number ? o.value / 255 : o.value / 100), r.type !== M.None && (n.g = r.type === M.Number ? r.value / 255 : r.value / 100), a.type !== M.None && (n.b = a.type === M.Number ? a.value / 255 : a.value / 100), i.type !== M.None && (n.alpha = Math.min(
1490
1541
  1,
1491
1542
  Math.max(
1492
1543
  0,
1493
- i.type === T.Number ? i.value : i.value / 100
1544
+ i.type === M.Number ? i.value : i.value / 100
1494
1545
  )
1495
1546
  )), n;
1496
1547
  }
1497
- const Gr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0, Ur = (e, t, n) => e + n * (t - e), Jr = (e) => {
1548
+ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0, Qr = (e, t, n) => e + n * (t - e), ea = (e) => {
1498
1549
  let t = [];
1499
1550
  for (let n = 0; n < e.length - 1; n++) {
1500
1551
  let o = e[n], r = e[n + 1];
1501
1552
  o === void 0 && r === void 0 ? t.push(void 0) : o !== void 0 && r !== void 0 ? t.push([o, r]) : t.push(o !== void 0 ? [o, o] : [r, r]);
1502
1553
  }
1503
1554
  return t;
1504
- }, Zr = (e) => (t) => {
1505
- let n = Jr(t);
1555
+ }, ta = (e) => (t) => {
1556
+ let n = ea(t);
1506
1557
  return (o) => {
1507
1558
  let r = o * n.length, a = o >= 1 ? n.length - 1 : Math.max(Math.floor(r), 0), i = n[a];
1508
1559
  return i === void 0 ? void 0 : e(i[0], i[1], r - a);
1509
1560
  };
1510
- }, he = Zr(Ur), Gt = (e) => {
1561
+ }, he = ta(Qr), Gt = (e) => {
1511
1562
  let t = !1, n = e.map((o) => o !== void 0 ? (t = !0, o) : 1);
1512
1563
  return t ? n : e;
1513
- }, Qr = {
1564
+ }, na = {
1514
1565
  mode: "rgb",
1515
1566
  channels: ["r", "g", "b", "alpha"],
1516
1567
  parse: [
1517
- qr,
1518
- zr,
1519
- Br,
1520
- Pr,
1521
- Gr,
1568
+ Jr,
1569
+ Dr,
1570
+ Fr,
1571
+ Rr,
1572
+ Zr,
1522
1573
  "srgb"
1523
1574
  ],
1524
1575
  serialize: "srgb",
@@ -1531,21 +1582,21 @@ const Gr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
1531
1582
  gamut: !0,
1532
1583
  white: { r: 1, g: 1, b: 1 },
1533
1584
  black: { r: 0, g: 0, b: 0 }
1534
- }, Tt = (e = 0) => {
1585
+ }, Mt = (e = 0) => {
1535
1586
  const t = Math.abs(e);
1536
1587
  return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
1537
- }, Xn = ({ r: e, g: t, b: n, alpha: o }) => {
1588
+ }, qn = ({ r: e, g: t, b: n, alpha: o }) => {
1538
1589
  let r = {
1539
1590
  mode: "lrgb",
1540
- r: Tt(e),
1541
- g: Tt(t),
1542
- b: Tt(n)
1591
+ r: Mt(e),
1592
+ g: Mt(t),
1593
+ b: Mt(n)
1543
1594
  };
1544
1595
  return o !== void 0 && (r.alpha = o), r;
1545
1596
  }, At = (e = 0) => {
1546
1597
  const t = Math.abs(e);
1547
1598
  return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
1548
- }, Yn = ({ r: e, g: t, b: n, alpha: o }, r = "rgb") => {
1599
+ }, Gn = ({ r: e, g: t, b: n, alpha: o }, r = "rgb") => {
1549
1600
  let a = {
1550
1601
  mode: r,
1551
1602
  r: At(e),
@@ -1553,22 +1604,22 @@ const Gr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
1553
1604
  b: At(n)
1554
1605
  };
1555
1606
  return o !== void 0 && (a.alpha = o), a;
1556
- }, Te = (e) => (e = e % 360) < 0 ? e + 360 : e, ea = (e, t) => e.map((n, o, r) => {
1607
+ }, Me = (e) => (e = e % 360) < 0 ? e + 360 : e, oa = (e, t) => e.map((n, o, r) => {
1557
1608
  if (n === void 0)
1558
1609
  return n;
1559
- let a = Te(n);
1560
- return o === 0 || e[o - 1] === void 0 ? a : t(a - Te(r[o - 1]));
1561
- }).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []), qn = (e) => ea(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), ta = (e, t) => {
1610
+ let a = Me(n);
1611
+ return o === 0 || e[o - 1] === void 0 ? a : t(a - Me(r[o - 1]));
1612
+ }).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []), Un = (e) => oa(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), ra = (e, t) => {
1562
1613
  if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
1563
1614
  return 0;
1564
- let n = Te(e.h), o = Te(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
1615
+ let n = Me(e.h), o = Me(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
1565
1616
  return 2 * Math.sqrt(e.s * t.s) * r;
1566
- }, na = (e, t) => {
1617
+ }, aa = (e, t) => {
1567
1618
  if (e.h === void 0 || t.h === void 0 || !e.c || !t.c)
1568
1619
  return 0;
1569
- let n = Te(e.h), o = Te(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
1620
+ let n = Me(e.h), o = Me(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
1570
1621
  return 2 * Math.sqrt(e.c * t.c) * r;
1571
- }, Gn = (e) => {
1622
+ }, Jn = (e) => {
1572
1623
  let t = e.reduce(
1573
1624
  (o, r) => {
1574
1625
  if (r !== void 0) {
@@ -1580,11 +1631,11 @@ const Gr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
1580
1631
  { sin: 0, cos: 0 }
1581
1632
  ), n = Math.atan2(t.sin, t.cos) * 180 / Math.PI;
1582
1633
  return n < 0 ? 360 + n : n;
1583
- }, ut = ({ l: e, a: t, b: n, alpha: o }, r = "lch") => {
1634
+ }, pt = ({ l: e, a: t, b: n, alpha: o }, r = "lch") => {
1584
1635
  t === void 0 && (t = 0), n === void 0 && (n = 0);
1585
1636
  let a = Math.sqrt(t * t + n * n), i = { mode: r, l: e, c: a };
1586
- return a && (i.h = Te(Math.atan2(n, t) * 180 / Math.PI)), o !== void 0 && (i.alpha = o), i;
1587
- }, pt = ({ l: e, c: t, h: n, alpha: o }, r = "lab") => {
1637
+ return a && (i.h = Me(Math.atan2(n, t) * 180 / Math.PI)), o !== void 0 && (i.alpha = o), i;
1638
+ }, ft = ({ l: e, c: t, h: n, alpha: o }, r = "lab") => {
1588
1639
  n === void 0 && (n = 0);
1589
1640
  let a = {
1590
1641
  mode: r,
@@ -1598,8 +1649,8 @@ const Gr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
1598
1649
  Y: 1,
1599
1650
  Z: (1 - 0.3457 - 0.3585) / 0.3585
1600
1651
  };
1601
- function oa({ h: e, s: t, l: n, alpha: o }) {
1602
- e = Te(e !== void 0 ? e : 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1652
+ function ia({ h: e, s: t, l: n, alpha: o }) {
1653
+ e = Me(e !== void 0 ? e : 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1603
1654
  let r = n + t * (n < 0.5 ? n : 1 - n), a = r - (r - n) * 2 * Math.abs(e / 60 % 2 - 1), i;
1604
1655
  switch (Math.floor(e / 60)) {
1605
1656
  case 0:
@@ -1625,7 +1676,7 @@ function oa({ h: e, s: t, l: n, alpha: o }) {
1625
1676
  }
1626
1677
  return i.mode = "rgb", o !== void 0 && (i.alpha = o), i;
1627
1678
  }
1628
- function ra({ r: e, g: t, b: n, alpha: o }) {
1679
+ function la({ r: e, g: t, b: n, alpha: o }) {
1629
1680
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1630
1681
  let r = Math.max(e, t, n), a = Math.min(e, t, n), i = {
1631
1682
  mode: "hsl",
@@ -1634,7 +1685,7 @@ function ra({ r: e, g: t, b: n, alpha: o }) {
1634
1685
  };
1635
1686
  return r - a !== 0 && (i.h = (r === e ? (t - n) / (r - a) + (t < n) * 6 : r === t ? (n - e) / (r - a) + 2 : (e - t) / (r - a) + 4) * 60), o !== void 0 && (i.alpha = o), i;
1636
1687
  }
1637
- const aa = (e, t) => {
1688
+ const sa = (e, t) => {
1638
1689
  switch (t) {
1639
1690
  case "deg":
1640
1691
  return +e;
@@ -1645,71 +1696,71 @@ const aa = (e, t) => {
1645
1696
  case "turn":
1646
1697
  return e * 360;
1647
1698
  }
1648
- }, ia = new RegExp(
1649
- `^hsla?\\(\\s*${Rr}${Re}${Xe}${Re}${Xe}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
1650
- ), la = (e) => {
1651
- let t = e.match(ia);
1699
+ }, ca = new RegExp(
1700
+ `^hsla?\\(\\s*${Vr}${Re}${Xe}${Re}${Xe}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
1701
+ ), da = (e) => {
1702
+ let t = e.match(ca);
1652
1703
  if (!t) return;
1653
1704
  let n = { mode: "hsl" };
1654
- return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h = aa(t[1], t[2])), t[4] !== void 0 && (n.s = Math.min(Math.max(0, t[4] / 100), 1)), t[5] !== void 0 && (n.l = Math.min(Math.max(0, t[5] / 100), 1)), t[6] !== void 0 ? n.alpha = Math.max(0, Math.min(1, t[6] / 100)) : t[7] !== void 0 && (n.alpha = Math.max(0, Math.min(1, +t[7]))), n;
1705
+ return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h = sa(t[1], t[2])), t[4] !== void 0 && (n.s = Math.min(Math.max(0, t[4] / 100), 1)), t[5] !== void 0 && (n.l = Math.min(Math.max(0, t[5] / 100), 1)), t[6] !== void 0 ? n.alpha = Math.max(0, Math.min(1, t[6] / 100)) : t[7] !== void 0 && (n.alpha = Math.max(0, Math.min(1, +t[7]))), n;
1655
1706
  };
1656
- function sa(e, t) {
1707
+ function ua(e, t) {
1657
1708
  if (!t || t[0] !== "hsl" && t[0] !== "hsla")
1658
1709
  return;
1659
1710
  const n = { mode: "hsl" }, [, o, r, a, i] = t;
1660
- if (o.type !== T.None) {
1661
- if (o.type === T.Percentage)
1711
+ if (o.type !== M.None) {
1712
+ if (o.type === M.Percentage)
1662
1713
  return;
1663
1714
  n.h = o.value;
1664
1715
  }
1665
- if (r.type !== T.None) {
1666
- if (r.type === T.Hue)
1716
+ if (r.type !== M.None) {
1717
+ if (r.type === M.Hue)
1667
1718
  return;
1668
1719
  n.s = r.value / 100;
1669
1720
  }
1670
- if (a.type !== T.None) {
1671
- if (a.type === T.Hue)
1721
+ if (a.type !== M.None) {
1722
+ if (a.type === M.Hue)
1672
1723
  return;
1673
1724
  n.l = a.value / 100;
1674
1725
  }
1675
- return i.type !== T.None && (n.alpha = Math.min(
1726
+ return i.type !== M.None && (n.alpha = Math.min(
1676
1727
  1,
1677
1728
  Math.max(
1678
1729
  0,
1679
- i.type === T.Number ? i.value : i.value / 100
1730
+ i.type === M.Number ? i.value : i.value / 100
1680
1731
  )
1681
1732
  )), n;
1682
1733
  }
1683
- const ca = {
1734
+ const pa = {
1684
1735
  mode: "hsl",
1685
1736
  toMode: {
1686
- rgb: oa
1737
+ rgb: ia
1687
1738
  },
1688
1739
  fromMode: {
1689
- rgb: ra
1740
+ rgb: la
1690
1741
  },
1691
1742
  channels: ["h", "s", "l", "alpha"],
1692
1743
  ranges: {
1693
1744
  h: [0, 360]
1694
1745
  },
1695
1746
  gamut: "rgb",
1696
- parse: [sa, la],
1747
+ parse: [ua, da],
1697
1748
  serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
1698
1749
  interpolate: {
1699
- h: { use: he, fixup: qn },
1750
+ h: { use: he, fixup: Un },
1700
1751
  s: he,
1701
1752
  l: he,
1702
1753
  alpha: { use: he, fixup: Gt }
1703
1754
  },
1704
1755
  difference: {
1705
- h: ta
1756
+ h: ra
1706
1757
  },
1707
1758
  average: {
1708
- h: Gn
1759
+ h: Jn
1709
1760
  }
1710
- }, Un = Math.pow(29, 3) / Math.pow(3, 3), Jn = Math.pow(6, 3) / Math.pow(29, 3);
1711
- let Lt = (e) => Math.pow(e, 3) > Jn ? Math.pow(e, 3) : (116 * e - 16) / Un;
1712
- const da = ({ l: e, a: t, b: n, alpha: o }) => {
1761
+ }, Zn = Math.pow(29, 3) / Math.pow(3, 3), Qn = Math.pow(6, 3) / Math.pow(29, 3);
1762
+ let Lt = (e) => Math.pow(e, 3) > Qn ? Math.pow(e, 3) : (116 * e - 16) / Zn;
1763
+ const fa = ({ l: e, a: t, b: n, alpha: o }) => {
1713
1764
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1714
1765
  let r = (e + 16) / 116, a = t / 500 + r, i = r - n / 200, l = {
1715
1766
  mode: "xyz50",
@@ -1718,23 +1769,23 @@ const da = ({ l: e, a: t, b: n, alpha: o }) => {
1718
1769
  z: Lt(i) * Ie.Z
1719
1770
  };
1720
1771
  return o !== void 0 && (l.alpha = o), l;
1721
- }, ua = ({ x: e, y: t, z: n, alpha: o }) => {
1772
+ }, ha = ({ x: e, y: t, z: n, alpha: o }) => {
1722
1773
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1723
- let r = Yn({
1774
+ let r = Gn({
1724
1775
  r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * n,
1725
1776
  g: e * -0.978795502912089 + t * 1.916254567259524 + 0.03344273116131949 * n,
1726
1777
  b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * n
1727
1778
  });
1728
1779
  return o !== void 0 && (r.alpha = o), r;
1729
- }, pa = (e) => ua(da(e)), fa = (e) => {
1730
- let { r: t, g: n, b: o, alpha: r } = Xn(e), a = {
1780
+ }, ga = (e) => ha(fa(e)), ka = (e) => {
1781
+ let { r: t, g: n, b: o, alpha: r } = qn(e), a = {
1731
1782
  mode: "xyz50",
1732
1783
  x: 0.436065742824811 * t + 0.3851514688337912 * n + 0.14307845442264197 * o,
1733
1784
  y: 0.22249319175623702 * t + 0.7168870538238823 * n + 0.06061979053616537 * o,
1734
1785
  z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * o
1735
1786
  };
1736
1787
  return r !== void 0 && (a.alpha = r), a;
1737
- }, Pt = (e) => e > Jn ? Math.cbrt(e) : (Un * e + 16) / 116, ha = ({ x: e, y: t, z: n, alpha: o }) => {
1788
+ }, Pt = (e) => e > Qn ? Math.cbrt(e) : (Zn * e + 16) / 116, ma = ({ x: e, y: t, z: n, alpha: o }) => {
1738
1789
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1739
1790
  let r = Pt(e / Ie.X), a = Pt(t / Ie.Y), i = Pt(n / Ie.Z), l = {
1740
1791
  mode: "lab",
@@ -1743,44 +1794,44 @@ const da = ({ l: e, a: t, b: n, alpha: o }) => {
1743
1794
  b: 200 * (a - i)
1744
1795
  };
1745
1796
  return o !== void 0 && (l.alpha = o), l;
1746
- }, ga = (e) => {
1747
- let t = ha(fa(e));
1797
+ }, ba = (e) => {
1798
+ let t = ma(ka(e));
1748
1799
  return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
1749
1800
  };
1750
- function ka(e, t) {
1801
+ function va(e, t) {
1751
1802
  if (!t || t[0] !== "lch")
1752
1803
  return;
1753
1804
  const n = { mode: "lch" }, [, o, r, a, i] = t;
1754
- if (o.type !== T.None) {
1755
- if (o.type === T.Hue)
1805
+ if (o.type !== M.None) {
1806
+ if (o.type === M.Hue)
1756
1807
  return;
1757
1808
  n.l = Math.min(Math.max(0, o.value), 100);
1758
1809
  }
1759
- if (r.type !== T.None && (n.c = Math.max(
1810
+ if (r.type !== M.None && (n.c = Math.max(
1760
1811
  0,
1761
- r.type === T.Number ? r.value : r.value * 150 / 100
1762
- )), a.type !== T.None) {
1763
- if (a.type === T.Percentage)
1812
+ r.type === M.Number ? r.value : r.value * 150 / 100
1813
+ )), a.type !== M.None) {
1814
+ if (a.type === M.Percentage)
1764
1815
  return;
1765
1816
  n.h = a.value;
1766
1817
  }
1767
- return i.type !== T.None && (n.alpha = Math.min(
1818
+ return i.type !== M.None && (n.alpha = Math.min(
1768
1819
  1,
1769
1820
  Math.max(
1770
1821
  0,
1771
- i.type === T.Number ? i.value : i.value / 100
1822
+ i.type === M.Number ? i.value : i.value / 100
1772
1823
  )
1773
1824
  )), n;
1774
1825
  }
1775
- const ma = {
1826
+ const wa = {
1776
1827
  mode: "lch",
1777
1828
  toMode: {
1778
- lab: pt,
1779
- rgb: (e) => pa(pt(e))
1829
+ lab: ft,
1830
+ rgb: (e) => ga(ft(e))
1780
1831
  },
1781
1832
  fromMode: {
1782
- rgb: (e) => ut(ga(e)),
1783
- lab: ut
1833
+ rgb: (e) => pt(ba(e)),
1834
+ lab: pt
1784
1835
  },
1785
1836
  channels: ["l", "c", "h", "alpha"],
1786
1837
  ranges: {
@@ -1788,21 +1839,21 @@ const ma = {
1788
1839
  c: [0, 150],
1789
1840
  h: [0, 360]
1790
1841
  },
1791
- parse: [ka],
1842
+ parse: [va],
1792
1843
  serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
1793
1844
  interpolate: {
1794
- h: { use: he, fixup: qn },
1845
+ h: { use: he, fixup: Un },
1795
1846
  c: he,
1796
1847
  l: he,
1797
1848
  alpha: { use: he, fixup: Gt }
1798
1849
  },
1799
1850
  difference: {
1800
- h: na
1851
+ h: aa
1801
1852
  },
1802
1853
  average: {
1803
- h: Gn
1854
+ h: Jn
1804
1855
  }
1805
- }, ba = ({ r: e, g: t, b: n, alpha: o }) => {
1856
+ }, xa = ({ r: e, g: t, b: n, alpha: o }) => {
1806
1857
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1807
1858
  let r = Math.cbrt(
1808
1859
  0.412221469470763 * e + 0.5363325372617348 * t + 0.0514459932675022 * n
@@ -1817,10 +1868,10 @@ const ma = {
1817
1868
  b: 0.0259040424655478 * r + 0.7827717124575296 * a - 0.8086757549230774 * i
1818
1869
  };
1819
1870
  return o !== void 0 && (l.alpha = o), l;
1820
- }, va = (e) => {
1821
- let t = ba(Xn(e));
1871
+ }, ya = (e) => {
1872
+ let t = xa(qn(e));
1822
1873
  return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
1823
- }, wa = ({ l: e, a: t, b: n, alpha: o }) => {
1874
+ }, Na = ({ l: e, a: t, b: n, alpha: o }) => {
1824
1875
  e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
1825
1876
  let r = Math.pow(e + 0.3963377773761749 * t + 0.2158037573099136 * n, 3), a = Math.pow(e - 0.1055613458156586 * t - 0.0638541728258133 * n, 3), i = Math.pow(e - 0.0894841775298119 * t - 1.2914855480194092 * n, 3), l = {
1826
1877
  mode: "lrgb",
@@ -1829,64 +1880,64 @@ const ma = {
1829
1880
  b: -0.0041960761386756 * r - 0.7034186179359362 * a + 1.7076146940746117 * i
1830
1881
  };
1831
1882
  return o !== void 0 && (l.alpha = o), l;
1832
- }, xa = (e) => Yn(wa(e));
1833
- function ya(e, t) {
1883
+ }, _a = (e) => Gn(Na(e));
1884
+ function $a(e, t) {
1834
1885
  if (!t || t[0] !== "oklch")
1835
1886
  return;
1836
1887
  const n = { mode: "oklch" }, [, o, r, a, i] = t;
1837
- if (o.type !== T.None) {
1838
- if (o.type === T.Hue)
1888
+ if (o.type !== M.None) {
1889
+ if (o.type === M.Hue)
1839
1890
  return;
1840
1891
  n.l = Math.min(
1841
- Math.max(0, o.type === T.Number ? o.value : o.value / 100),
1892
+ Math.max(0, o.type === M.Number ? o.value : o.value / 100),
1842
1893
  1
1843
1894
  );
1844
1895
  }
1845
- if (r.type !== T.None && (n.c = Math.max(
1896
+ if (r.type !== M.None && (n.c = Math.max(
1846
1897
  0,
1847
- r.type === T.Number ? r.value : r.value * 0.4 / 100
1848
- )), a.type !== T.None) {
1849
- if (a.type === T.Percentage)
1898
+ r.type === M.Number ? r.value : r.value * 0.4 / 100
1899
+ )), a.type !== M.None) {
1900
+ if (a.type === M.Percentage)
1850
1901
  return;
1851
1902
  n.h = a.value;
1852
1903
  }
1853
- return i.type !== T.None && (n.alpha = Math.min(
1904
+ return i.type !== M.None && (n.alpha = Math.min(
1854
1905
  1,
1855
1906
  Math.max(
1856
1907
  0,
1857
- i.type === T.Number ? i.value : i.value / 100
1908
+ i.type === M.Number ? i.value : i.value / 100
1858
1909
  )
1859
1910
  )), n;
1860
1911
  }
1861
- const Na = {
1862
- ...ma,
1912
+ const Ca = {
1913
+ ...wa,
1863
1914
  mode: "oklch",
1864
1915
  toMode: {
1865
- oklab: (e) => pt(e, "oklab"),
1866
- rgb: (e) => xa(pt(e, "oklab"))
1916
+ oklab: (e) => ft(e, "oklab"),
1917
+ rgb: (e) => _a(ft(e, "oklab"))
1867
1918
  },
1868
1919
  fromMode: {
1869
- rgb: (e) => ut(va(e), "oklch"),
1870
- oklab: (e) => ut(e, "oklch")
1920
+ rgb: (e) => pt(ya(e), "oklch"),
1921
+ oklab: (e) => pt(e, "oklch")
1871
1922
  },
1872
- parse: [ya],
1923
+ parse: [$a],
1873
1924
  serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
1874
1925
  ranges: {
1875
1926
  l: [0, 1],
1876
1927
  c: [0, 0.4],
1877
1928
  h: [0, 360]
1878
1929
  }
1879
- }, _a = (e) => Math.max(0, Math.min(1, e || 0)), at = (e) => Math.round(_a(e) * 255), Zn = xe("rgb"), Qn = (e) => {
1930
+ }, Ea = (e) => Math.max(0, Math.min(1, e || 0)), it = (e) => Math.round(Ea(e) * 255), eo = ye("rgb"), to = (e) => {
1880
1931
  if (e === void 0)
1881
1932
  return;
1882
- let t = at(e.r), n = at(e.g), o = at(e.b);
1933
+ let t = it(e.r), n = it(e.g), o = it(e.b);
1883
1934
  return "#" + (1 << 24 | t << 16 | n << 8 | o).toString(16).slice(1);
1884
- }, $a = (e) => {
1935
+ }, Sa = (e) => {
1885
1936
  if (e === void 0)
1886
1937
  return;
1887
- let t = at(e.alpha !== void 0 ? e.alpha : 1);
1888
- return Qn(e) + (256 | t).toString(16).slice(1);
1889
- }, Ca = (e) => Qn(Zn(e)), Ea = (e) => $a(Zn(e)), eo = xe("rgb"), to = (e) => {
1938
+ let t = it(e.alpha !== void 0 ? e.alpha : 1);
1939
+ return to(e) + (256 | t).toString(16).slice(1);
1940
+ }, Ta = (e) => to(eo(e)), Ma = (e) => Sa(eo(e)), no = ye("rgb"), oo = (e) => {
1890
1941
  const t = {
1891
1942
  mode: e.mode,
1892
1943
  r: Math.max(0, Math.min(e.r !== void 0 ? e.r : 0, 1)),
@@ -1894,53 +1945,53 @@ const Na = {
1894
1945
  b: Math.max(0, Math.min(e.b !== void 0 ? e.b : 0, 1))
1895
1946
  };
1896
1947
  return e.alpha !== void 0 && (t.alpha = e.alpha), t;
1897
- }, Sa = (e) => to(eo(e)), no = (e) => e !== void 0 && (e.r === void 0 || e.r >= 0 && e.r <= 1) && (e.g === void 0 || e.g >= 0 && e.g <= 1) && (e.b === void 0 || e.b >= 0 && e.b <= 1);
1898
- function Ma(e) {
1899
- return no(eo(e));
1948
+ }, Aa = (e) => oo(no(e)), ro = (e) => e !== void 0 && (e.r === void 0 || e.r >= 0 && e.r <= 1) && (e.g === void 0 || e.g >= 0 && e.g <= 1) && (e.b === void 0 || e.b >= 0 && e.b <= 1);
1949
+ function La(e) {
1950
+ return ro(no(e));
1900
1951
  }
1901
1952
  function Ut(e = "rgb") {
1902
- const { gamut: t } = ht(e);
1953
+ const { gamut: t } = gt(e);
1903
1954
  if (!t)
1904
1955
  return (o) => !0;
1905
- const n = xe(typeof t == "string" ? t : e);
1906
- return (o) => no(n(o));
1956
+ const n = ye(typeof t == "string" ? t : e);
1957
+ return (o) => ro(n(o));
1907
1958
  }
1908
- function Ta(e = "rgb") {
1909
- const { gamut: t } = ht(e);
1959
+ function Pa(e = "rgb") {
1960
+ const { gamut: t } = gt(e);
1910
1961
  if (!t)
1911
- return (a) => st(a);
1912
- const n = typeof t == "string" ? t : e, o = xe(n), r = Ut(n);
1962
+ return (a) => ct(a);
1963
+ const n = typeof t == "string" ? t : e, o = ye(n), r = Ut(n);
1913
1964
  return (a) => {
1914
- const i = st(a);
1965
+ const i = ct(a);
1915
1966
  if (!i)
1916
1967
  return;
1917
1968
  const l = o(i);
1918
1969
  if (r(l))
1919
1970
  return i;
1920
- const c = to(l);
1921
- return i.mode === c.mode ? c : xe(i.mode)(c);
1971
+ const c = oo(l);
1972
+ return i.mode === c.mode ? c : ye(i.mode)(c);
1922
1973
  };
1923
1974
  }
1924
- function Aa(e, t = "lch", n = "rgb") {
1925
- e = st(e);
1926
- let o = n === "rgb" ? Ma : Ut(n), r = n === "rgb" ? Sa : Ta(n);
1975
+ function Ia(e, t = "lch", n = "rgb") {
1976
+ e = ct(e);
1977
+ let o = n === "rgb" ? La : Ut(n), r = n === "rgb" ? Aa : Pa(n);
1927
1978
  if (e === void 0 || o(e)) return e;
1928
- let a = xe(e.mode);
1929
- e = xe(t)(e);
1979
+ let a = ye(e.mode);
1980
+ e = ye(t)(e);
1930
1981
  let i = { ...e, c: 0 };
1931
1982
  if (!o(i))
1932
1983
  return a(r(i));
1933
- let l = 0, c = e.c !== void 0 ? e.c : 0, d = ht(t).ranges.c, u = (d[1] - d[0]) / Math.pow(2, 13), p = i.c;
1984
+ let l = 0, c = e.c !== void 0 ? e.c : 0, d = gt(t).ranges.c, u = (d[1] - d[0]) / Math.pow(2, 13), p = i.c;
1934
1985
  for (; c - l > u; )
1935
1986
  i.c = l + (c - l) * 0.5, o(i) ? (p = i.c, l = i.c) : c = i.c;
1936
1987
  return a(
1937
1988
  o(i) ? i : { ...i, c: p }
1938
1989
  );
1939
1990
  }
1940
- qt(Na);
1941
- qt(Qr);
1942
- qt(ca);
1943
- const oo = 0.37, ro = xe("oklch"), ao = xe("rgb"), La = Ut("rgb");
1991
+ qt(Ca);
1992
+ qt(na);
1993
+ qt(pa);
1994
+ const ao = 0.37, io = ye("oklch"), lo = ye("rgb"), za = Ut("rgb");
1944
1995
  function Jt(e) {
1945
1996
  return {
1946
1997
  mode: "oklch",
@@ -1950,7 +2001,7 @@ function Jt(e) {
1950
2001
  alpha: e.a / 100
1951
2002
  };
1952
2003
  }
1953
- function Pa(e) {
2004
+ function Ra(e) {
1954
2005
  return {
1955
2006
  l: (e.l ?? 0) * 100,
1956
2007
  c: e.c ?? 0,
@@ -1965,12 +2016,12 @@ function ne(e) {
1965
2016
  const r = (e.a / 100).toFixed(4);
1966
2017
  return `oklch(${t} ${n} ${o} / ${r})`;
1967
2018
  }
1968
- function Ia(e) {
2019
+ function Oa(e) {
1969
2020
  const t = { l: 0, c: 0, h: 0, a: 100 };
1970
2021
  try {
1971
- const n = Wn(e);
2022
+ const n = Yn(e);
1972
2023
  if (!n) return t;
1973
- const o = ro(n);
2024
+ const o = io(n);
1974
2025
  if (!o) return t;
1975
2026
  const r = o.alpha === void 0 ? 1 : o.alpha;
1976
2027
  return {
@@ -1984,8 +2035,8 @@ function Ia(e) {
1984
2035
  }
1985
2036
  }
1986
2037
  function hn(e, t) {
1987
- const n = Jt(e), o = ao(n);
1988
- return o ? e.a < 100 ? Ea({ ...o, alpha: e.a / 100 }) ?? "#000000ff" : Ca(o) ?? "#000000" : "#000000";
2038
+ const n = Jt(e), o = lo(n);
2039
+ return o ? e.a < 100 ? Ma({ ...o, alpha: e.a / 100 }) ?? "#000000ff" : Ta(o) ?? "#000000" : "#000000";
1989
2040
  }
1990
2041
  function Ee(e) {
1991
2042
  const t = {
@@ -1994,11 +2045,11 @@ function Ee(e) {
1994
2045
  s: e.s / 100,
1995
2046
  l: e.l / 100,
1996
2047
  alpha: e.a / 100
1997
- }, n = ro(t);
1998
- return n ? Pa(n) : { l: 0, c: 0, h: 0, a: e.a };
2048
+ }, n = io(t);
2049
+ return n ? Ra(n) : { l: 0, c: 0, h: 0, a: e.a };
1999
2050
  }
2000
2051
  function gn(e) {
2001
- const t = Jt(e), n = Aa(t, "oklch", "rgb");
2052
+ const t = Jt(e), n = Ia(t, "oklch", "rgb");
2002
2053
  return n ? {
2003
2054
  l: (n.l ?? e.l / 100) * 100,
2004
2055
  c: n.c ?? 0,
@@ -2006,14 +2057,14 @@ function gn(e) {
2006
2057
  a: e.a
2007
2058
  } : { l: e.l, c: 0, h: e.h, a: e.a };
2008
2059
  }
2009
- function za(e) {
2010
- const t = ao(Jt(e));
2011
- return t ? La(t) : !1;
2060
+ function Da(e) {
2061
+ const t = lo(Jt(e));
2062
+ return t ? za(t) : !1;
2012
2063
  }
2013
- function Qe(e, t, n) {
2064
+ function et(e, t, n) {
2014
2065
  return Math.min(n, Math.max(t, e));
2015
2066
  }
2016
- function Ra(e, t, n) {
2067
+ function Va(e, t, n) {
2017
2068
  if (n <= 0) return e;
2018
2069
  const o = Math.round((e - t) / n);
2019
2070
  return t + o * n;
@@ -2026,68 +2077,68 @@ function kn({
2026
2077
  onDragStart: r,
2027
2078
  onDragEnd: a
2028
2079
  }) {
2029
- const { label: i, ariaLabel: l, min: c, max: d, step: u, format: p } = e, m = D(u);
2080
+ const { label: i, ariaLabel: l, min: c, max: d, step: u, format: p } = e, m = B(u);
2030
2081
  m.current = u;
2031
- const h = D(!1), v = D(null), C = Qe((t - c) / (d - c), 0, 1), b = D(o);
2082
+ const h = B(!1), v = B(null), C = et((t - c) / (d - c), 0, 1), b = B(o);
2032
2083
  b.current = o;
2033
- const x = D(r);
2034
- x.current = r;
2035
- const g = D(a);
2084
+ const N = B(r);
2085
+ N.current = r;
2086
+ const g = B(a);
2036
2087
  g.current = a;
2037
- const N = D(c);
2038
- N.current = c;
2039
- const y = D(d);
2040
- y.current = d;
2088
+ const y = B(c);
2089
+ y.current = c;
2090
+ const w = B(d);
2091
+ w.current = d;
2041
2092
  function _(f) {
2042
2093
  const E = v.current;
2043
2094
  if (!E) return null;
2044
2095
  const S = E.getBoundingClientRect();
2045
2096
  if (S.width === 0) return null;
2046
- const V = Qe((f - S.left) / S.width, 0, 1), X = N.current + V * (y.current - N.current), H = Ra(X, N.current, m.current);
2047
- return Qe(H, N.current, y.current);
2097
+ const O = et((f - S.left) / S.width, 0, 1), j = y.current + O * (w.current - y.current), D = Va(j, y.current, m.current);
2098
+ return et(D, y.current, w.current);
2048
2099
  }
2049
- W(() => {
2100
+ X(() => {
2050
2101
  const f = v.current;
2051
2102
  if (!f) return;
2052
- function E(H) {
2053
- h.current = !0, x.current();
2103
+ function E(D) {
2104
+ h.current = !0, N.current();
2054
2105
  try {
2055
- f.setPointerCapture(H.pointerId);
2106
+ f.setPointerCapture(D.pointerId);
2056
2107
  } catch {
2057
2108
  }
2058
- const Z = _(H.clientX);
2059
- Z !== null && b.current(Z);
2109
+ const G = _(D.clientX);
2110
+ G !== null && b.current(G);
2060
2111
  }
2061
- function S(H) {
2112
+ function S(D) {
2062
2113
  if (!h.current) return;
2063
- const Z = _(H.clientX);
2064
- Z !== null && b.current(Z);
2114
+ const G = _(D.clientX);
2115
+ G !== null && b.current(G);
2065
2116
  }
2066
- function V(H) {
2117
+ function O(D) {
2067
2118
  if (h.current) {
2068
2119
  h.current = !1;
2069
2120
  try {
2070
- f.releasePointerCapture(H.pointerId);
2121
+ f.releasePointerCapture(D.pointerId);
2071
2122
  } catch {
2072
2123
  }
2073
2124
  g.current();
2074
2125
  }
2075
2126
  }
2076
- function X(H) {
2127
+ function j(D) {
2077
2128
  if (h.current) {
2078
2129
  h.current = !1;
2079
2130
  try {
2080
- f.releasePointerCapture(H.pointerId);
2131
+ f.releasePointerCapture(D.pointerId);
2081
2132
  } catch {
2082
2133
  }
2083
2134
  g.current();
2084
2135
  }
2085
2136
  }
2086
- return f.addEventListener("pointerdown", E), f.addEventListener("pointermove", S), f.addEventListener("pointerup", V), f.addEventListener("pointercancel", X), () => {
2087
- f.removeEventListener("pointerdown", E), f.removeEventListener("pointermove", S), f.removeEventListener("pointerup", V), f.removeEventListener("pointercancel", X);
2137
+ return f.addEventListener("pointerdown", E), f.addEventListener("pointermove", S), f.addEventListener("pointerup", O), f.addEventListener("pointercancel", j), () => {
2138
+ f.removeEventListener("pointerdown", E), f.removeEventListener("pointermove", S), f.removeEventListener("pointerup", O), f.removeEventListener("pointercancel", j);
2088
2139
  };
2089
2140
  }, []);
2090
- const w = R(
2141
+ const x = R(
2091
2142
  (f) => {
2092
2143
  const E = u * 10;
2093
2144
  let S = 0;
@@ -2109,7 +2160,7 @@ function kn({
2109
2160
  default:
2110
2161
  return;
2111
2162
  }
2112
- f.preventDefault(), o(Qe(t + S, c, d));
2163
+ f.preventDefault(), o(et(t + S, c, d));
2113
2164
  },
2114
2165
  [t, c, d, u, o]
2115
2166
  );
@@ -2127,7 +2178,7 @@ function kn({
2127
2178
  "aria-valuemax": d,
2128
2179
  "aria-valuenow": t,
2129
2180
  "aria-valuetext": p(t),
2130
- onKeyDown: w,
2181
+ onKeyDown: x,
2131
2182
  children: [
2132
2183
  /* @__PURE__ */ s(
2133
2184
  "div",
@@ -2149,8 +2200,8 @@ function kn({
2149
2200
  /* @__PURE__ */ s("span", { className: "tokenpanel-color-picker-slider-value", children: p(t) })
2150
2201
  ] });
2151
2202
  }
2152
- const io = "tokenpanel.colorPicker.mode", Bt = [95, 78, 61, 44, 27, 10], Oa = [0, 60, 120, 180, 240, 300], Da = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Ba = 0.18, Va = 320, Ha = 400, Fa = 520, ja = 440;
2153
- function Ka() {
2203
+ const so = "tokenpanel.colorPicker.mode", Vt = [95, 78, 61, 44, 27, 10], Ba = [0, 60, 120, 180, 240, 300], Ha = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Fa = 0.18, ja = 320, Ka = 400, Wa = 520, Xa = 440;
2204
+ function Ya() {
2154
2205
  return [
2155
2206
  {
2156
2207
  key: "l",
@@ -2166,7 +2217,7 @@ function Ka() {
2166
2217
  label: "C",
2167
2218
  ariaLabel: "Chroma",
2168
2219
  min: 0,
2169
- max: oo,
2220
+ max: ao,
2170
2221
  step: 1e-3,
2171
2222
  format: (e) => e.toFixed(3)
2172
2223
  },
@@ -2190,7 +2241,7 @@ function Ka() {
2190
2241
  }
2191
2242
  ];
2192
2243
  }
2193
- function Wa() {
2244
+ function qa() {
2194
2245
  return [
2195
2246
  {
2196
2247
  key: "h",
@@ -2232,35 +2283,35 @@ function Wa() {
2232
2283
  }
2233
2284
  function mn(e, t, n, o) {
2234
2285
  return {
2235
- l: Bt[e] ?? 50,
2236
- c: Ba,
2286
+ l: Vt[e] ?? 50,
2287
+ c: Fa,
2237
2288
  h: o[t] ?? 0,
2238
2289
  a: n
2239
2290
  };
2240
2291
  }
2241
- function Xa(e) {
2292
+ function Ga(e) {
2242
2293
  if (typeof window > "u") return e;
2243
2294
  try {
2244
- const t = window.localStorage.getItem(io);
2295
+ const t = window.localStorage.getItem(so);
2245
2296
  if (t === "oklch" || t === "hsl") return t;
2246
2297
  } catch {
2247
2298
  }
2248
2299
  return e;
2249
2300
  }
2250
- function Ya(e) {
2301
+ function Ua(e) {
2251
2302
  if (!(typeof window > "u"))
2252
2303
  try {
2253
- window.localStorage.setItem(io, e);
2304
+ window.localStorage.setItem(so, e);
2254
2305
  } catch {
2255
2306
  }
2256
2307
  }
2257
- function qa(e, t) {
2258
- const [n, o] = j(e);
2259
- return W(() => {
2308
+ function Ja(e, t) {
2309
+ const [n, o] = K(e);
2310
+ return X(() => {
2260
2311
  t.current || o(e);
2261
2312
  }, [e, t]), [n, o];
2262
2313
  }
2263
- function lo(e, t, n) {
2314
+ function co(e, t, n) {
2264
2315
  if (!e) return { position: "fixed" };
2265
2316
  const o = e.getBoundingClientRect(), r = 4, a = 8, i = window.innerWidth, l = window.innerHeight, c = l - o.bottom - r - a, d = o.top - r - a, u = c < n && d > c;
2266
2317
  let p = o.left;
@@ -2270,9 +2321,9 @@ function lo(e, t, n) {
2270
2321
  const h = { position: "fixed", left: p, top: m };
2271
2322
  return n > l - 2 * a && (h.top = a, h.maxHeight = l - 2 * a, h.overflowY = "auto"), h;
2272
2323
  }
2273
- function so(e, t) {
2274
- const n = D(t);
2275
- n.current = t, W(() => {
2324
+ function uo(e, t) {
2325
+ const n = B(t);
2326
+ n.current = t, X(() => {
2276
2327
  function o(a) {
2277
2328
  e.current && !e.current.contains(a.target) && n.current();
2278
2329
  }
@@ -2284,7 +2335,7 @@ function so(e, t) {
2284
2335
  };
2285
2336
  }, []);
2286
2337
  }
2287
- function co({
2338
+ function po({
2288
2339
  color: e,
2289
2340
  onChange: t,
2290
2341
  label: n,
@@ -2292,18 +2343,18 @@ function co({
2292
2343
  anchorRef: r,
2293
2344
  onClose: a
2294
2345
  }) {
2295
- const i = D(null), l = D(null), c = D(!1), [d, u] = qa(e, c), [p, m] = j(
2346
+ const i = B(null), l = B(null), c = B(!1), [d, u] = Ja(e, c), [p, m] = K(
2296
2347
  null
2297
- ), h = D(null), v = D(!1), [C, b] = j(
2298
- () => Xa(o)
2299
- ), [x, g] = j("mini"), [N, y] = j(d);
2300
- W(() => {
2301
- (/^#[0-9a-fA-F]{6}$/.test(N) || /^#[0-9a-fA-F]{8}$/.test(N)) && y(d);
2302
- }, [d]), so(i, a);
2303
- const _ = J(() => Ia(d), [d]), w = J(() => Tr(d), [d]), f = R(
2348
+ ), h = B(null), v = B(!1), [C, b] = K(
2349
+ () => Ga(o)
2350
+ ), [N, g] = K("mini"), [y, w] = K(d);
2351
+ X(() => {
2352
+ (/^#[0-9a-fA-F]{6}$/.test(y) || /^#[0-9a-fA-F]{8}$/.test(y)) && w(d);
2353
+ }, [d]), uo(i, a);
2354
+ const _ = Z(() => Oa(d), [d]), x = Z(() => Pr(d), [d]), f = R(
2304
2355
  ($) => {
2305
2356
  const I = $.toLowerCase();
2306
- u(I), y(I), t(I);
2357
+ u(I), w(I), t(I);
2307
2358
  },
2308
2359
  [u, t]
2309
2360
  ), E = R(
@@ -2320,117 +2371,117 @@ function co({
2320
2371
  ), S = R(
2321
2372
  ($) => {
2322
2373
  const I = {
2323
- h: $.h ?? w.h,
2324
- s: $.s ?? w.s,
2325
- l: $.l ?? w.l,
2326
- a: $.a ?? w.a
2374
+ h: $.h ?? x.h,
2375
+ s: $.s ?? x.s,
2376
+ l: $.l ?? x.l,
2377
+ a: $.a ?? x.a
2327
2378
  };
2328
- f(Ar(I.h, I.s, I.l, I.a));
2379
+ f(Ir(I.h, I.s, I.l, I.a));
2329
2380
  },
2330
- [w, f]
2331
- ), V = ($) => {
2332
- y($), (/^#[0-9a-fA-F]{6}$/.test($) || /^#[0-9a-fA-F]{8}$/.test($)) && f($);
2333
- }, X = x === "expanded" ? Da : Oa, H = R(
2381
+ [x, f]
2382
+ ), O = ($) => {
2383
+ w($), (/^#[0-9a-fA-F]{6}$/.test($) || /^#[0-9a-fA-F]{8}$/.test($)) && f($);
2384
+ }, j = N === "expanded" ? Ha : Ba, D = R(
2334
2385
  ($, I) => {
2335
- const re = mn($, I, _.a, X), Q = gn(re);
2386
+ const re = mn($, I, _.a, j), Q = gn(re);
2336
2387
  f(hn(Q));
2337
2388
  },
2338
- [_.a, X, f]
2339
- ), Z = R(
2389
+ [_.a, j, f]
2390
+ ), G = R(
2340
2391
  ($, I, re) => {
2341
- let Q = I, O = re;
2392
+ let Q = I, V = re;
2342
2393
  if ($.key === "ArrowRight")
2343
- O = Math.min(X.length - 1, re + 1);
2344
- else if ($.key === "ArrowLeft") O = Math.max(0, re - 1);
2394
+ V = Math.min(j.length - 1, re + 1);
2395
+ else if ($.key === "ArrowLeft") V = Math.max(0, re - 1);
2345
2396
  else if ($.key === "ArrowDown")
2346
- Q = Math.min(Bt.length - 1, I + 1);
2397
+ Q = Math.min(Vt.length - 1, I + 1);
2347
2398
  else if ($.key === "ArrowUp") Q = Math.max(0, I - 1);
2348
2399
  else if ($.key === "Enter" || $.key === " ") {
2349
- $.preventDefault(), H(I, re);
2400
+ $.preventDefault(), D(I, re);
2350
2401
  return;
2351
2402
  } else return;
2352
2403
  $.preventDefault(), i.current?.querySelector(
2353
- `[data-grid-row="${Q}"][data-grid-col="${O}"]`
2404
+ `[data-grid-row="${Q}"][data-grid-col="${V}"]`
2354
2405
  )?.focus();
2355
2406
  },
2356
- [X, H]
2407
+ [j, D]
2357
2408
  ), ie = ($) => {
2358
- Ya($), b($);
2359
- }, ke = J(() => Ka(), []), oe = J(() => Wa(), []), me = J(() => C === "oklch" ? {
2409
+ Ua($), b($);
2410
+ }, ke = Z(() => Ya(), []), oe = Z(() => qa(), []), me = Z(() => C === "oklch" ? {
2360
2411
  l: `linear-gradient(90deg in oklch, ${ne({ l: 0, c: _.c, h: _.h, a: 100 })}, ${ne({ l: 100, c: _.c, h: _.h, a: 100 })})`,
2361
- c: `linear-gradient(90deg in oklch, ${ne({ l: _.l, c: 0, h: _.h, a: 100 })}, ${ne({ l: _.l, c: oo, h: _.h, a: 100 })})`,
2412
+ c: `linear-gradient(90deg in oklch, ${ne({ l: _.l, c: 0, h: _.h, a: 100 })}, ${ne({ l: _.l, c: ao, h: _.h, a: 100 })})`,
2362
2413
  h: `linear-gradient(90deg in oklch longer hue, ${ne({ l: _.l, c: _.c, h: 0, a: 100 })}, ${ne({ l: _.l, c: _.c, h: 360, a: 100 })})`,
2363
2414
  a: `linear-gradient(90deg in oklch, ${ne({ ..._, a: 0 })}, ${ne({ ..._, a: 100 })})`
2364
2415
  } : {
2365
- h: `linear-gradient(90deg in oklch longer hue, ${ne(Ee({ h: 0, s: w.s, l: w.l, a: 100 }))}, ${ne(Ee({ h: 360, s: w.s, l: w.l, a: 100 }))})`,
2366
- s: `linear-gradient(90deg in oklch, ${ne(Ee({ h: w.h, s: 0, l: w.l, a: 100 }))}, ${ne(Ee({ h: w.h, s: 100, l: w.l, a: 100 }))})`,
2367
- l: `linear-gradient(90deg in oklch, ${ne(Ee({ h: w.h, s: w.s, l: 0, a: 100 }))}, ${ne(Ee({ h: w.h, s: w.s, l: 100, a: 100 }))})`,
2368
- a: `linear-gradient(90deg in oklch, ${ne(Ee({ ...w, a: 0 }))}, ${ne(Ee({ ...w, a: 100 }))})`
2369
- }, [C, _, w]), [De, Ae] = j(() => ({
2416
+ h: `linear-gradient(90deg in oklch longer hue, ${ne(Ee({ h: 0, s: x.s, l: x.l, a: 100 }))}, ${ne(Ee({ h: 360, s: x.s, l: x.l, a: 100 }))})`,
2417
+ s: `linear-gradient(90deg in oklch, ${ne(Ee({ h: x.h, s: 0, l: x.l, a: 100 }))}, ${ne(Ee({ h: x.h, s: 100, l: x.l, a: 100 }))})`,
2418
+ l: `linear-gradient(90deg in oklch, ${ne(Ee({ h: x.h, s: x.s, l: 0, a: 100 }))}, ${ne(Ee({ h: x.h, s: x.s, l: 100, a: 100 }))})`,
2419
+ a: `linear-gradient(90deg in oklch, ${ne(Ee({ ...x, a: 0 }))}, ${ne(Ee({ ...x, a: 100 }))})`
2420
+ }, [C, _, x]), [De, Ae] = K(() => ({
2370
2421
  position: "fixed",
2371
2422
  visibility: "hidden"
2372
2423
  }));
2373
- Po(() => {
2424
+ zo(() => {
2374
2425
  const $ = r.current;
2375
2426
  if (!$) {
2376
2427
  Ae({ position: "fixed", visibility: "hidden" });
2377
2428
  return;
2378
2429
  }
2379
2430
  Ae(
2380
- lo(
2431
+ co(
2381
2432
  $,
2382
- x === "mini" ? Va : Fa,
2383
- x === "mini" ? Ha : ja
2433
+ N === "mini" ? ja : Wa,
2434
+ N === "mini" ? Ka : Xa
2384
2435
  )
2385
2436
  );
2386
- }, [r, x]), W(() => {
2437
+ }, [r, N]), X(() => {
2387
2438
  const $ = l.current;
2388
2439
  if (!$) return;
2389
- function I(O) {
2390
- O.preventDefault(), O.stopPropagation();
2391
- const G = i.current;
2392
- if (!G) return;
2393
- const ce = G.getBoundingClientRect();
2440
+ function I(V) {
2441
+ V.preventDefault(), V.stopPropagation();
2442
+ const U = i.current;
2443
+ if (!U) return;
2444
+ const ce = U.getBoundingClientRect();
2394
2445
  h.current = {
2395
- pointerId: O.pointerId,
2396
- startX: O.clientX,
2397
- startY: O.clientY,
2446
+ pointerId: V.pointerId,
2447
+ startX: V.clientX,
2448
+ startY: V.clientY,
2398
2449
  baseLeft: ce.left,
2399
2450
  baseTop: ce.top
2400
2451
  }, v.current = !0;
2401
2452
  try {
2402
- $.setPointerCapture(O.pointerId);
2453
+ $.setPointerCapture(V.pointerId);
2403
2454
  } catch {
2404
2455
  }
2405
2456
  }
2406
- function re(O) {
2407
- if (!v.current || !h.current || O.pointerId !== h.current.pointerId) return;
2408
- const { startX: G, startY: ce, baseLeft: M, baseTop: F } = h.current, K = M + (O.clientX - G), U = F + (O.clientY - ce);
2409
- m({ left: K, top: U });
2457
+ function re(V) {
2458
+ if (!v.current || !h.current || V.pointerId !== h.current.pointerId) return;
2459
+ const { startX: U, startY: ce, baseLeft: T, baseTop: F } = h.current, W = T + (V.clientX - U), J = F + (V.clientY - ce);
2460
+ m({ left: W, top: J });
2410
2461
  }
2411
- function Q(O) {
2412
- if (!v.current || !h.current || O.pointerId !== h.current.pointerId) return;
2462
+ function Q(V) {
2463
+ if (!v.current || !h.current || V.pointerId !== h.current.pointerId) return;
2413
2464
  v.current = !1, h.current = null;
2414
2465
  try {
2415
- $.releasePointerCapture(O.pointerId);
2466
+ $.releasePointerCapture(V.pointerId);
2416
2467
  } catch {
2417
2468
  }
2418
- const G = i.current;
2419
- if (!G) return;
2420
- const ce = G.getBoundingClientRect(), M = 8, F = window.innerWidth, K = window.innerHeight, U = Math.max(
2421
- M,
2422
- Math.min(F - M - ce.width, ce.left)
2469
+ const U = i.current;
2470
+ if (!U) return;
2471
+ const ce = U.getBoundingClientRect(), T = 8, F = window.innerWidth, W = window.innerHeight, J = Math.max(
2472
+ T,
2473
+ Math.min(F - T - ce.width, ce.left)
2423
2474
  ), z = Math.max(
2424
- M,
2425
- Math.min(K - M - ce.height, ce.top)
2475
+ T,
2476
+ Math.min(W - T - ce.height, ce.top)
2426
2477
  );
2427
- m({ left: U, top: z });
2478
+ m({ left: J, top: z });
2428
2479
  }
2429
2480
  return $.addEventListener("pointerdown", I), $.addEventListener("pointermove", re), $.addEventListener("pointerup", Q), $.addEventListener("pointercancel", Q), () => {
2430
2481
  $.removeEventListener("pointerdown", I), $.removeEventListener("pointermove", re), $.removeEventListener("pointerup", Q), $.removeEventListener("pointercancel", Q);
2431
2482
  };
2432
2483
  }, []);
2433
- const A = /^#[0-9a-fA-F]{8}$/.test(d), B = R(() => {
2484
+ const A = /^#[0-9a-fA-F]{8}$/.test(d), H = R(() => {
2434
2485
  c.current = !0;
2435
2486
  }, []), ee = R(() => {
2436
2487
  c.current = !1;
@@ -2440,7 +2491,7 @@ function co({
2440
2491
  {
2441
2492
  ref: i,
2442
2493
  className: "tokenpanel-color-picker",
2443
- "data-mode-shell": x,
2494
+ "data-mode-shell": N,
2444
2495
  style: be,
2445
2496
  role: "dialog",
2446
2497
  "aria-label": n ? `${n} color picker` : "Color picker",
@@ -2501,13 +2552,13 @@ function co({
2501
2552
  role: "button",
2502
2553
  tabIndex: 0,
2503
2554
  className: "tokenpanel-color-picker-expand-btn",
2504
- "aria-label": x === "mini" ? "Expand picker" : "Collapse picker",
2505
- "aria-expanded": x === "expanded",
2506
- onClick: () => g(x === "mini" ? "expanded" : "mini"),
2555
+ "aria-label": N === "mini" ? "Expand picker" : "Collapse picker",
2556
+ "aria-expanded": N === "expanded",
2557
+ onClick: () => g(N === "mini" ? "expanded" : "mini"),
2507
2558
  onKeyDown: ($) => {
2508
- ($.key === "Enter" || $.key === " ") && ($.preventDefault(), g(x === "mini" ? "expanded" : "mini"));
2559
+ ($.key === "Enter" || $.key === " ") && ($.preventDefault(), g(N === "mini" ? "expanded" : "mini"));
2509
2560
  },
2510
- children: x === "mini" ? "⤢" : "⤡"
2561
+ children: N === "mini" ? "⤢" : "⤡"
2511
2562
  }
2512
2563
  )
2513
2564
  ] }),
@@ -2527,8 +2578,8 @@ function co({
2527
2578
  {
2528
2579
  type: "text",
2529
2580
  className: "tokenpanel-color-picker-hex-input",
2530
- value: N,
2531
- onChange: ($) => V($.target.value),
2581
+ value: y,
2582
+ onChange: ($) => O($.target.value),
2532
2583
  spellcheck: !1,
2533
2584
  "aria-label": "Hex color value"
2534
2585
  }
@@ -2540,22 +2591,22 @@ function co({
2540
2591
  className: "tokenpanel-color-picker-grid",
2541
2592
  role: "grid",
2542
2593
  "aria-label": "Color presets",
2543
- children: Bt.map(($, I) => /* @__PURE__ */ s("div", { role: "row", children: X.map((re, Q) => {
2544
- const O = mn(I, Q, _.a, X), G = za(O), ce = ne(gn(O)), M = Math.abs(_.h - O.h) % 360, F = Math.min(M, 360 - M), K = Math.abs(_.l - O.l) < 2 && F < 5 && Math.abs(_.c - O.c) < 0.05;
2594
+ children: Vt.map(($, I) => /* @__PURE__ */ s("div", { role: "row", children: j.map((re, Q) => {
2595
+ const V = mn(I, Q, _.a, j), U = Da(V), ce = ne(gn(V)), T = Math.abs(_.h - V.h) % 360, F = Math.min(T, 360 - T), W = Math.abs(_.l - V.l) < 2 && F < 5 && Math.abs(_.c - V.c) < 0.05;
2545
2596
  return /* @__PURE__ */ s(
2546
2597
  "div",
2547
2598
  {
2548
2599
  role: "gridcell",
2549
2600
  "data-grid-row": I,
2550
2601
  "data-grid-col": Q,
2551
- "data-oog": G ? "false" : "true",
2552
- "aria-selected": K,
2553
- "aria-label": `Preset L ${O.l}% H ${O.h}°`,
2602
+ "data-oog": U ? "false" : "true",
2603
+ "aria-selected": W,
2604
+ "aria-label": `Preset L ${V.l}% H ${V.h}°`,
2554
2605
  className: "tokenpanel-color-picker-grid-cell",
2555
2606
  style: { background: ce },
2556
2607
  tabIndex: I === 0 && Q === 0 ? 0 : -1,
2557
- onClick: () => H(I, Q),
2558
- onKeyDown: (U) => Z(U, I, Q)
2608
+ onClick: () => D(I, Q),
2609
+ onKeyDown: (J) => G(J, I, Q)
2559
2610
  },
2560
2611
  `${I}-${Q}`
2561
2612
  );
@@ -2569,7 +2620,7 @@ function co({
2569
2620
  value: _[$.key] ?? 0,
2570
2621
  gradient: me[$.key] ?? "",
2571
2622
  onChange: (I) => E({ [$.key]: I }),
2572
- onDragStart: B,
2623
+ onDragStart: H,
2573
2624
  onDragEnd: ee
2574
2625
  },
2575
2626
  $.key
@@ -2577,15 +2628,15 @@ function co({
2577
2628
  kn,
2578
2629
  {
2579
2630
  config: $,
2580
- value: w[$.key] ?? 0,
2631
+ value: x[$.key] ?? 0,
2581
2632
  gradient: me[$.key] ?? "",
2582
2633
  onChange: (I) => S({ [$.key]: I }),
2583
- onDragStart: B,
2634
+ onDragStart: H,
2584
2635
  onDragEnd: ee
2585
2636
  },
2586
2637
  $.key
2587
2638
  )) }),
2588
- x === "expanded" && /* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-readout", "aria-live": "polite", children: [
2639
+ N === "expanded" && /* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-readout", "aria-live": "polite", children: [
2589
2640
  "L ",
2590
2641
  Math.round(_.l),
2591
2642
  "% · C ",
@@ -2603,7 +2654,7 @@ const Zt = jt(null);
2603
2654
  function se({ cssVar: e }) {
2604
2655
  const t = Xt(Zt);
2605
2656
  if (t === null) return null;
2606
- const { state: n, toggle: o, matchCounts: r } = t, a = n.active[e], i = a !== void 0, l = i ? n.slots[a]?.color : void 0, c = r?.[e], d = Y(() => {
2657
+ const { state: n, toggle: o, matchCounts: r } = t, a = n.active[e], i = a !== void 0, l = i ? n.slots[a]?.color : void 0, c = r?.[e], d = q(() => {
2607
2658
  o(e);
2608
2659
  }, [o, e]), u = i ? `Stop highlighting ${e}` + (c !== void 0 ? ` (${c} elements)` : "") : `Highlight elements using ${e}`;
2609
2660
  return /* @__PURE__ */ s(
@@ -2648,16 +2699,16 @@ function se({ cssVar: e }) {
2648
2699
  }
2649
2700
  );
2650
2701
  }
2651
- function Ga({
2702
+ function Za({
2652
2703
  anchorRef: e,
2653
2704
  onClose: t
2654
2705
  }) {
2655
- const n = Io(Zt), [o, r] = j(null), a = D(Array.from({ length: 10 }, () => null)), i = D(null), l = D(null);
2656
- if (so(i, t), !n) return null;
2706
+ const n = Ro(Zt), [o, r] = K(null), a = B(Array.from({ length: 10 }, () => null)), i = B(null), l = B(null);
2707
+ if (uo(i, t), !n) return null;
2657
2708
  const { state: c, setSlot: d, setOutlineWidth: u, reset: p, disableAll: m } = n, h = {};
2658
2709
  for (const [C, b] of Object.entries(c.active))
2659
2710
  b in h || (h[b] = C);
2660
- const v = lo(e.current ?? null, 370, 520);
2711
+ const v = co(e.current ?? null, 370, 520);
2661
2712
  return o !== null && (l.current = a.current[o] ?? null), /* @__PURE__ */ k(
2662
2713
  "div",
2663
2714
  {
@@ -2692,7 +2743,7 @@ function Ga({
2692
2743
  ] })
2693
2744
  ] }),
2694
2745
  /* @__PURE__ */ s("div", { className: "tokenpanel-highlight-settings-list", children: c.slots.map((C, b) => {
2695
- const x = h[b], g = x !== void 0, N = `${c.outlineWidth}px solid ${C.color}`;
2746
+ const N = h[b], g = N !== void 0, y = `${c.outlineWidth}px solid ${C.color}`;
2696
2747
  return /* @__PURE__ */ k(
2697
2748
  "div",
2698
2749
  {
@@ -2702,17 +2753,17 @@ function Ga({
2702
2753
  /* @__PURE__ */ s(
2703
2754
  "div",
2704
2755
  {
2705
- ref: (y) => {
2706
- a.current[b] = y;
2756
+ ref: (w) => {
2757
+ a.current[b] = w;
2707
2758
  },
2708
2759
  className: "tokenpanel-highlight-settings-ring",
2709
- style: { border: N },
2760
+ style: { border: y },
2710
2761
  role: "button",
2711
2762
  tabIndex: 0,
2712
2763
  "aria-label": `Edit color for slot ${b + 1}`,
2713
2764
  onClick: () => r(o === b ? null : b),
2714
- onKeyDown: (y) => {
2715
- (y.key === "Enter" || y.key === " ") && (y.preventDefault(), r(o === b ? null : b));
2765
+ onKeyDown: (w) => {
2766
+ (w.key === "Enter" || w.key === " ") && (w.preventDefault(), r(o === b ? null : b));
2716
2767
  }
2717
2768
  }
2718
2769
  ),
@@ -2720,7 +2771,7 @@ function Ga({
2720
2771
  "div",
2721
2772
  {
2722
2773
  className: g ? "tokenpanel-highlight-settings-name is-active" : "tokenpanel-highlight-settings-name",
2723
- children: g ? x : "available"
2774
+ children: g ? N : "available"
2724
2775
  }
2725
2776
  )
2726
2777
  ]
@@ -2747,7 +2798,7 @@ function Ga({
2747
2798
  )
2748
2799
  ] }),
2749
2800
  o !== null && /* @__PURE__ */ s(
2750
- co,
2801
+ po,
2751
2802
  {
2752
2803
  color: c.slots[o]?.color ?? "#ffffff",
2753
2804
  onChange: (C) => {
@@ -2762,7 +2813,7 @@ function Ga({
2762
2813
  }
2763
2814
  );
2764
2815
  }
2765
- const uo = [
2816
+ const fo = [
2766
2817
  { color: "#ff2d2d" },
2767
2818
  // red
2768
2819
  { color: "#ff2dcf" },
@@ -2783,28 +2834,28 @@ const uo = [
2783
2834
  // yellow
2784
2835
  { color: "#2d6eff" }
2785
2836
  // blue
2786
- ], po = 2;
2787
- function fo() {
2788
- return `${q().storagePrefix}-highlight-slots`;
2837
+ ], ho = 2;
2838
+ function go() {
2839
+ return `${Y().storagePrefix}-highlight-slots`;
2789
2840
  }
2790
- function ho() {
2791
- return `${q().storagePrefix}-highlight-active`;
2841
+ function ko() {
2842
+ return `${Y().storagePrefix}-highlight-active`;
2792
2843
  }
2793
- function go() {
2794
- return `${q().storagePrefix}-highlight-outline-width`;
2844
+ function mo() {
2845
+ return `${Y().storagePrefix}-highlight-outline-width`;
2795
2846
  }
2796
- function Ua(e) {
2847
+ function Qa(e) {
2797
2848
  const t = new Set(Object.values(e));
2798
2849
  for (let n = 0; n < 10; n++)
2799
2850
  if (!t.has(n)) return n;
2800
2851
  return -1;
2801
2852
  }
2802
- function Ja(e, t) {
2853
+ function ei(e, t) {
2803
2854
  if (t in e.active) {
2804
2855
  const { [t]: o, ...r } = e.active;
2805
2856
  return { ...e, active: r };
2806
2857
  }
2807
- const n = Ua(e.active);
2858
+ const n = Qa(e.active);
2808
2859
  return n === -1 ? (console.warn(
2809
2860
  "[zudo-design-token-panel] highlight: all 10 slots are in use; cannot highlight",
2810
2861
  t
@@ -2813,29 +2864,29 @@ function Ja(e, t) {
2813
2864
  active: { ...e.active, [t]: n }
2814
2865
  };
2815
2866
  }
2816
- function Za(e) {
2867
+ function ti(e) {
2817
2868
  return {
2818
2869
  ...e,
2819
- slots: uo.map((t) => ({ ...t })),
2820
- outlineWidth: po
2870
+ slots: fo.map((t) => ({ ...t })),
2871
+ outlineWidth: ho
2821
2872
  };
2822
2873
  }
2823
- function Qa(e) {
2874
+ function ni(e) {
2824
2875
  return { ...e, active: {} };
2825
2876
  }
2826
- function ei(e, t, n) {
2877
+ function oi(e, t, n) {
2827
2878
  if (t < 0 || t >= e.slots.length) return e;
2828
2879
  const o = e.slots.map((r, a) => a === t ? { ...r, ...n } : r);
2829
2880
  return { ...e, slots: o };
2830
2881
  }
2831
- function ti(e, t) {
2882
+ function ri(e, t) {
2832
2883
  const n = Math.max(1, t);
2833
2884
  return { ...e, outlineWidth: n };
2834
2885
  }
2835
- function ni() {
2836
- let e = uo.map((o) => ({ ...o })), t = po, n = {};
2886
+ function ai() {
2887
+ let e = fo.map((o) => ({ ...o })), t = ho, n = {};
2837
2888
  try {
2838
- const o = localStorage.getItem(fo());
2889
+ const o = localStorage.getItem(go());
2839
2890
  if (o !== null) {
2840
2891
  const r = JSON.parse(o);
2841
2892
  Array.isArray(r) && r.length === 10 && (e = r.map((a) => ({ color: a.color })));
@@ -2843,7 +2894,7 @@ function ni() {
2843
2894
  } catch {
2844
2895
  }
2845
2896
  try {
2846
- const o = localStorage.getItem(go());
2897
+ const o = localStorage.getItem(mo());
2847
2898
  if (o !== null) {
2848
2899
  const r = JSON.parse(o);
2849
2900
  typeof r == "number" && r >= 1 && (t = r);
@@ -2851,7 +2902,7 @@ function ni() {
2851
2902
  } catch {
2852
2903
  }
2853
2904
  try {
2854
- const o = sessionStorage.getItem(ho());
2905
+ const o = sessionStorage.getItem(ko());
2855
2906
  if (o !== null) {
2856
2907
  const r = JSON.parse(o);
2857
2908
  r !== null && typeof r == "object" && !Array.isArray(r) && (n = r);
@@ -2862,15 +2913,15 @@ function ni() {
2862
2913
  }
2863
2914
  function He(e) {
2864
2915
  try {
2865
- localStorage.setItem(fo(), JSON.stringify(e.slots));
2916
+ localStorage.setItem(go(), JSON.stringify(e.slots));
2866
2917
  } catch {
2867
2918
  }
2868
2919
  try {
2869
- localStorage.setItem(go(), JSON.stringify(e.outlineWidth));
2920
+ localStorage.setItem(mo(), JSON.stringify(e.outlineWidth));
2870
2921
  } catch {
2871
2922
  }
2872
2923
  try {
2873
- sessionStorage.setItem(ho(), JSON.stringify(e.active));
2924
+ sessionStorage.setItem(ko(), JSON.stringify(e.active));
2874
2925
  } catch {
2875
2926
  }
2876
2927
  }
@@ -3078,16 +3129,16 @@ const bn = {
3078
3129
  longhands: ["mask-image"],
3079
3130
  compounds: ["mask-image"]
3080
3131
  }
3081
- }, et = [null, "::before", "::after"], ko = "tokenpanel-highlight-mount", mo = "tokenpanel-elpath-mount", Qt = `.tokenpanel-shell, [data-design-token-panel-modal], #${ko}, #${mo}`, oi = /^(transparent|currentcolor|currentColor|inherit|initial|unset|red|blue|green|black|white|gray|grey|silver|yellow|orange|purple|pink|brown|cyan|magenta|lime|olive|navy|maroon|teal|aqua|fuchsia|coral|salmon|gold|khaki|violet|indigo|crimson|lavender|beige|ivory|chocolate|tomato|orchid|plum|turquoise|tan|sienna|peru|papayawhip|peachpuff|moccasin|mistyrose|linen|lemonchiffon|honeydew|gainsboro)$/i, ri = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, ai = /^#/, ii = /^-?\d+(\.\d+)?(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr)%?$/, li = /^-?\d+(\.\d+)?$/, si = /^(cubic-bezier|steps|linear)\(/i, ci = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, di = /^".*"$/, ui = /^url\(/i;
3082
- function pi(e, t) {
3132
+ }, tt = [null, "::before", "::after"], bo = "tokenpanel-highlight-mount", vo = "tokenpanel-elpath-mount", Qt = `.tokenpanel-shell, [data-design-token-panel-modal], #${bo}, #${vo}`, ii = /^(transparent|currentcolor|currentColor|inherit|initial|unset|red|blue|green|black|white|gray|grey|silver|yellow|orange|purple|pink|brown|cyan|magenta|lime|olive|navy|maroon|teal|aqua|fuchsia|coral|salmon|gold|khaki|violet|indigo|crimson|lavender|beige|ivory|chocolate|tomato|orchid|plum|turquoise|tan|sienna|peru|papayawhip|peachpuff|moccasin|mistyrose|linen|lemonchiffon|honeydew|gainsboro)$/i, li = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, si = /^#/, ci = /^-?\d+(\.\d+)?(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr)%?$/, di = /^-?\d+(\.\d+)?$/, ui = /^(cubic-bezier|steps|linear)\(/i, pi = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, fi = /^".*"$/, hi = /^url\(/i;
3133
+ function gi(e, t) {
3083
3134
  const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
3084
- return n ? ri.test(n) || ai.test(n) || oi.test(n) ? "color" : ii.test(n) ? "length" : li.test(n) ? "number" : si.test(n) ? "easing" : ci.test(n) ? "time" : di.test(n) ? "content" : (ui.test(n) && t.push(
3135
+ return n ? li.test(n) || si.test(n) || ii.test(n) ? "color" : ci.test(n) ? "length" : di.test(n) ? "number" : ui.test(n) ? "easing" : pi.test(n) ? "time" : fi.test(n) ? "content" : (hi.test(n) && t.push(
3085
3136
  `type auto-detection inconclusive for ${e}: resolved value starts with url(); defaulting to text — supply kind:'cursor' or kind:'mask-image' explicitly if this is a cursor or mask-image token`
3086
3137
  ), "text") : (t.push(
3087
3138
  `type auto-detection inconclusive for ${e}; defaulting to color — supply kind explicitly if this is incorrect`
3088
3139
  ), "color");
3089
3140
  }
3090
- function Vt(e, t, n) {
3141
+ function Bt(e, t, n) {
3091
3142
  for (const o of e)
3092
3143
  if (o instanceof CSSStyleRule) {
3093
3144
  const r = o.style;
@@ -3096,14 +3147,14 @@ function Vt(e, t, n) {
3096
3147
  n.add(o.selectorText);
3097
3148
  break;
3098
3149
  }
3099
- o.cssRules?.length && Vt(
3150
+ o.cssRules?.length && Bt(
3100
3151
  o.cssRules,
3101
3152
  t,
3102
3153
  n
3103
3154
  );
3104
- } else "cssRules" in o && o.cssRules && Vt(o.cssRules, t, n);
3155
+ } else "cssRules" in o && o.cssRules && Bt(o.cssRules, t, n);
3105
3156
  }
3106
- function fi(e, t) {
3157
+ function ki(e, t) {
3107
3158
  const n = /* @__PURE__ */ new Set();
3108
3159
  for (const o of document.styleSheets) {
3109
3160
  let r;
@@ -3114,11 +3165,11 @@ function fi(e, t) {
3114
3165
  t.push(`Cross-origin stylesheet skipped: ${a}`);
3115
3166
  continue;
3116
3167
  }
3117
- Vt(r, e, n);
3168
+ Bt(r, e, n);
3118
3169
  }
3119
3170
  return n;
3120
3171
  }
3121
- function hi(e) {
3172
+ function mi(e) {
3122
3173
  const t = /* @__PURE__ */ new Set(), n = document.querySelectorAll("[style]");
3123
3174
  for (const o of n)
3124
3175
  o.style.getPropertyValue(e) !== "" && t.add(o);
@@ -3175,7 +3226,7 @@ function vn(e, t, n) {
3175
3226
  r[a] = o.getPropertyValue(a);
3176
3227
  return r;
3177
3228
  }
3178
- function gi(e, t) {
3229
+ function bi(e, t) {
3179
3230
  if (!e || !t) return null;
3180
3231
  for (const n in e)
3181
3232
  if (e[n] !== t[n]) return n;
@@ -3184,7 +3235,7 @@ function gi(e, t) {
3184
3235
  function wn(e, t) {
3185
3236
  let n = e.trim();
3186
3237
  n.startsWith("var(") && (n = n.replace(/^var\(\s*/, "").replace(/\s*\)$/, "").trim());
3187
- const o = [], r = t?.mode ?? "equality", a = t?.kind ?? pi(n, o), i = bn[a] ?? bn.color, l = fi(n, o), c = hi(n), d = [document.body, ...document.body.querySelectorAll("*")], u = /* @__PURE__ */ new Set();
3238
+ const o = [], r = t?.mode ?? "equality", a = t?.kind ?? gi(n, o), i = bn[a] ?? bn.color, l = ki(n, o), c = mi(n), d = [document.body, ...document.body.querySelectorAll("*")], u = /* @__PURE__ */ new Set();
3188
3239
  if (r === "equality") {
3189
3240
  const { sentinelA: m, longhands: h, compounds: v } = i, C = i.needleA ?? m, b = It(
3190
3241
  n,
@@ -3194,36 +3245,36 @@ function wn(e, t) {
3194
3245
  o
3195
3246
  );
3196
3247
  document.documentElement.offsetHeight;
3197
- for (const x of d)
3198
- for (const g of et) {
3199
- let N;
3248
+ for (const N of d)
3249
+ for (const g of tt) {
3250
+ let y;
3200
3251
  try {
3201
- N = getComputedStyle(x, g);
3252
+ y = getComputedStyle(N, g);
3202
3253
  } catch {
3203
3254
  continue;
3204
3255
  }
3205
- let y = !1;
3256
+ let w = !1;
3206
3257
  for (const _ of h)
3207
- if (N.getPropertyValue(_) === m) {
3208
- y = !0;
3258
+ if (y.getPropertyValue(_) === m) {
3259
+ w = !0;
3209
3260
  break;
3210
3261
  }
3211
- if (!y)
3262
+ if (!w)
3212
3263
  for (const _ of v) {
3213
- const w = N.getPropertyValue(_);
3214
- if (w && w.includes(C)) {
3215
- y = !0;
3264
+ const x = y.getPropertyValue(_);
3265
+ if (x && x.includes(C)) {
3266
+ w = !0;
3216
3267
  break;
3217
3268
  }
3218
3269
  }
3219
- if (y) {
3220
- u.add(x);
3270
+ if (w) {
3271
+ u.add(N);
3221
3272
  break;
3222
3273
  }
3223
3274
  }
3224
3275
  zt(n, b);
3225
3276
  } else {
3226
- const { sentinelA: m, sentinelB: h, longhands: v, compounds: C } = i, b = [...v, ...C], x = It(
3277
+ const { sentinelA: m, sentinelB: h, longhands: v, compounds: C } = i, b = [...v, ...C], N = It(
3227
3278
  n,
3228
3279
  m,
3229
3280
  l,
@@ -3232,10 +3283,10 @@ function wn(e, t) {
3232
3283
  );
3233
3284
  document.documentElement.offsetHeight;
3234
3285
  const g = /* @__PURE__ */ new Map();
3235
- for (const y of d)
3236
- g.set(y, et.map((_) => vn(y, _, b)));
3237
- zt(n, x);
3238
- const N = It(
3286
+ for (const w of d)
3287
+ g.set(w, tt.map((_) => vn(w, _, b)));
3288
+ zt(n, N);
3289
+ const y = It(
3239
3290
  n,
3240
3291
  h,
3241
3292
  l,
@@ -3243,17 +3294,17 @@ function wn(e, t) {
3243
3294
  o
3244
3295
  );
3245
3296
  document.documentElement.offsetHeight;
3246
- for (const y of d) {
3247
- const _ = g.get(y);
3248
- for (let w = 0; w < et.length; w++) {
3249
- const f = vn(y, et[w], b);
3250
- if (gi(_[w], f) !== null) {
3251
- u.add(y);
3297
+ for (const w of d) {
3298
+ const _ = g.get(w);
3299
+ for (let x = 0; x < tt.length; x++) {
3300
+ const f = vn(w, tt[x], b);
3301
+ if (bi(_[x], f) !== null) {
3302
+ u.add(w);
3252
3303
  break;
3253
3304
  }
3254
3305
  }
3255
3306
  }
3256
- zt(n, N);
3307
+ zt(n, y);
3257
3308
  }
3258
3309
  const p = [];
3259
3310
  for (const m of u) {
@@ -3265,7 +3316,7 @@ function wn(e, t) {
3265
3316
  }
3266
3317
  return { elements: p, warnings: o };
3267
3318
  }
3268
- const Le = 200, ki = 49;
3319
+ const Le = 200, vi = 49;
3269
3320
  function xn(e, t) {
3270
3321
  return {
3271
3322
  position: "fixed",
@@ -3279,15 +3330,15 @@ function xn(e, t) {
3279
3330
  // box-shadow inset draws the same ring without relying on outline.
3280
3331
  boxShadow: `inset 0 0 0 ${t.outlineWidth}px ${t.color}`,
3281
3332
  pointerEvents: "none",
3282
- zIndex: String(ki),
3333
+ zIndex: String(vi),
3283
3334
  boxSizing: "border-box"
3284
3335
  };
3285
3336
  }
3286
- function mi(e, t) {
3337
+ function wi(e, t) {
3287
3338
  for (const n of Object.keys(t))
3288
3339
  e.style[n] = t[n];
3289
3340
  }
3290
- function bi({ items: e }) {
3341
+ function xi({ items: e }) {
3291
3342
  const t = e.length > Le ? e.slice(0, Le) : e, n = de(!1);
3292
3343
  e.length > Le && !n.current && (n.current = !0, console.warn(
3293
3344
  `HighlightOverlay: received ${e.length} items (max ${Le}). Only the first ${Le} overlays will be rendered.`
@@ -3301,7 +3352,7 @@ function bi({ items: e }) {
3301
3352
  const l = o.current[i];
3302
3353
  if (!l) continue;
3303
3354
  const c = t[i].element.getBoundingClientRect();
3304
- mi(l, xn(c, t[i].slot));
3355
+ wi(l, xn(c, t[i].slot));
3305
3356
  }
3306
3357
  r = requestAnimationFrame(a);
3307
3358
  }
@@ -3324,8 +3375,8 @@ function bi({ items: e }) {
3324
3375
  );
3325
3376
  }) });
3326
3377
  }
3327
- function bo(e) {
3328
- const t = de(null), [, n] = _e(0);
3378
+ function wo(e) {
3379
+ const t = de(null), [, n] = $e(0);
3329
3380
  return ue(() => {
3330
3381
  function o() {
3331
3382
  if (typeof document > "u") return null;
@@ -3343,7 +3394,7 @@ function bo(e) {
3343
3394
  };
3344
3395
  }, [e]), t.current;
3345
3396
  }
3346
- function vi(e) {
3397
+ function yi(e) {
3347
3398
  if (e)
3348
3399
  switch (e.kind) {
3349
3400
  case "color":
@@ -3374,70 +3425,70 @@ function vi(e) {
3374
3425
  return "mask-image";
3375
3426
  }
3376
3427
  }
3377
- function wi() {
3428
+ function Ni() {
3378
3429
  const e = /* @__PURE__ */ new Map();
3379
- for (const t of q().tabs)
3430
+ for (const t of Y().tabs)
3380
3431
  for (const n of t.tiers)
3381
3432
  for (const o of n.items)
3382
3433
  e.set(o.cssVar, o.type);
3383
3434
  return e;
3384
3435
  }
3385
- const xi = /* @__PURE__ */ new Set(["text", "cursor", "content", "mask-image"]);
3386
- function yi(e) {
3387
- return e ? !xi.has(e.kind) : !0;
3436
+ const _i = /* @__PURE__ */ new Set(["text", "cursor", "content", "mask-image"]);
3437
+ function $i(e) {
3438
+ return e ? !_i.has(e.kind) : !0;
3388
3439
  }
3389
- function Ni({ items: e }) {
3390
- const t = bo(ko);
3391
- return t ? Wt(/* @__PURE__ */ s(bi, { items: e }), t) : null;
3440
+ function Ci({ items: e }) {
3441
+ const t = wo(bo);
3442
+ return t ? Wt(/* @__PURE__ */ s(xi, { items: e }), t) : null;
3392
3443
  }
3393
- function _i({ children: e }) {
3394
- const [t, n] = _e(ni), [o, r] = _e(0), [a, i] = _e(0), l = de(/* @__PURE__ */ new Map()), c = Y((b) => {
3395
- n((x) => {
3396
- const g = Ja(x, b);
3444
+ function Ei({ children: e }) {
3445
+ const [t, n] = $e(ai), [o, r] = $e(0), [a, i] = $e(0), l = de(/* @__PURE__ */ new Map()), c = q((b) => {
3446
+ n((N) => {
3447
+ const g = ei(N, b);
3397
3448
  return He(g), g;
3398
3449
  });
3399
- }, []), d = Y((b, x) => {
3450
+ }, []), d = q((b, N) => {
3400
3451
  n((g) => {
3401
- const N = ei(g, b, x);
3402
- return He(N), N;
3452
+ const y = oi(g, b, N);
3453
+ return He(y), y;
3403
3454
  });
3404
- }, []), u = Y((b) => {
3405
- n((x) => {
3406
- const g = ti(x, b);
3455
+ }, []), u = q((b) => {
3456
+ n((N) => {
3457
+ const g = ri(N, b);
3407
3458
  return He(g), g;
3408
3459
  });
3409
- }, []), p = Y(() => {
3460
+ }, []), p = q(() => {
3410
3461
  n((b) => {
3411
- const x = Za(b);
3412
- return He(x), x;
3462
+ const N = ti(b);
3463
+ return He(N), N;
3413
3464
  });
3414
- }, []), m = Y(() => {
3465
+ }, []), m = q(() => {
3415
3466
  n((b) => {
3416
- const x = Qa(b);
3417
- return He(x), x;
3467
+ const N = ni(b);
3468
+ return He(N), N;
3418
3469
  });
3419
3470
  }, []);
3420
3471
  ue(() => {
3421
3472
  let b = null;
3422
- function x() {
3423
- b && b.disconnect(), b = new MutationObserver((N) => {
3424
- for (const y of N) {
3425
- for (const _ of y.addedNodes)
3473
+ function N() {
3474
+ b && b.disconnect(), b = new MutationObserver((y) => {
3475
+ for (const w of y) {
3476
+ for (const _ of w.addedNodes)
3426
3477
  if (yn(_)) {
3427
- r((w) => w + 1);
3478
+ r((x) => x + 1);
3428
3479
  return;
3429
3480
  }
3430
- for (const _ of y.removedNodes)
3481
+ for (const _ of w.removedNodes)
3431
3482
  if (yn(_)) {
3432
- r((w) => w + 1);
3483
+ r((x) => x + 1);
3433
3484
  return;
3434
3485
  }
3435
3486
  }
3436
3487
  }), b.observe(document.head, { childList: !0 });
3437
3488
  }
3438
- x();
3489
+ N();
3439
3490
  function g() {
3440
- x(), r((N) => N + 1);
3491
+ N(), r((y) => y + 1);
3441
3492
  }
3442
3493
  return typeof window < "u" && window.addEventListener("astro:after-swap", g), () => {
3443
3494
  b?.disconnect(), typeof window < "u" && window.removeEventListener("astro:after-swap", g);
@@ -3445,53 +3496,53 @@ function _i({ children: e }) {
3445
3496
  }, []), ue(() => {
3446
3497
  if (typeof window > "u") return;
3447
3498
  const b = new MutationObserver(() => {
3448
- i((x) => x + 1), l.current.clear();
3499
+ i((N) => N + 1), l.current.clear();
3449
3500
  });
3450
3501
  return b.observe(document.documentElement, {
3451
3502
  attributes: !0,
3452
3503
  attributeFilter: ["data-theme", "class"]
3453
3504
  }), () => b.disconnect();
3454
3505
  }, []);
3455
- const { items: h, matchCounts: v } = lt(() => {
3456
- const b = wi();
3457
- function x(y) {
3458
- const _ = `${y}|${o}|${a}`, w = l.current.get(_);
3459
- if (w) return w;
3460
- const f = b.get(y), E = vi(f), S = E ? { kind: E } : {}, V = wn(y, S);
3461
- let X, H;
3462
- if (yi(f)) {
3463
- const ie = wn(y, { ...S, mode: "differential" }), ke = new Set(V.elements);
3506
+ const { items: h, matchCounts: v } = st(() => {
3507
+ const b = Ni();
3508
+ function N(w) {
3509
+ const _ = `${w}|${o}|${a}`, x = l.current.get(_);
3510
+ if (x) return x;
3511
+ const f = b.get(w), E = yi(f), S = E ? { kind: E } : {}, O = wn(w, S);
3512
+ let j, D;
3513
+ if ($i(f)) {
3514
+ const ie = wn(w, { ...S, mode: "differential" }), ke = new Set(O.elements);
3464
3515
  for (const me of ie.elements) ke.add(me);
3465
- X = Array.from(ke);
3466
- const oe = new Set(V.warnings);
3516
+ j = Array.from(ke);
3517
+ const oe = new Set(O.warnings);
3467
3518
  for (const me of ie.warnings) oe.add(me);
3468
- H = Array.from(oe);
3519
+ D = Array.from(oe);
3469
3520
  } else
3470
- X = V.elements, H = V.warnings;
3471
- const Z = { elements: X, warnings: H };
3472
- return l.current.set(_, Z), Z;
3521
+ j = O.elements, D = O.warnings;
3522
+ const G = { elements: j, warnings: D };
3523
+ return l.current.set(_, G), G;
3473
3524
  }
3474
- const g = [], N = {};
3475
- for (const [y, _] of Object.entries(t.active)) {
3476
- const w = x(y);
3477
- if (w.warnings.length > 0)
3478
- for (const S of w.warnings)
3525
+ const g = [], y = {};
3526
+ for (const [w, _] of Object.entries(t.active)) {
3527
+ const x = N(w);
3528
+ if (x.warnings.length > 0)
3529
+ for (const S of x.warnings)
3479
3530
  console.warn("[zudo-design-token-panel] highlight:", S);
3480
- const f = w.elements;
3481
- N[y] = f.length;
3531
+ const f = x.elements;
3532
+ y[w] = f.length;
3482
3533
  const E = t.slots[_];
3483
3534
  if (E)
3484
3535
  for (const S of f)
3485
3536
  g.push({ element: S, slot: { color: E.color, outlineWidth: t.outlineWidth } });
3486
3537
  }
3487
- return { items: g, matchCounts: N };
3488
- }, [t.active, t.slots, t.outlineWidth, o, a]), C = lt(
3538
+ return { items: g, matchCounts: y };
3539
+ }, [t.active, t.slots, t.outlineWidth, o, a]), C = st(
3489
3540
  () => ({ state: t, toggle: c, setSlot: d, setOutlineWidth: u, reset: p, disableAll: m, matchCounts: v }),
3490
3541
  [t, c, d, u, p, m, v]
3491
3542
  );
3492
3543
  return /* @__PURE__ */ k(ae, { children: [
3493
3544
  /* @__PURE__ */ s(Zt.Provider, { value: C, children: e }),
3494
- /* @__PURE__ */ s(Ni, { items: h })
3545
+ /* @__PURE__ */ s(Ci, { items: h })
3495
3546
  ] });
3496
3547
  }
3497
3548
  function yn(e) {
@@ -3499,24 +3550,24 @@ function yn(e) {
3499
3550
  const t = e;
3500
3551
  return t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
3501
3552
  }
3502
- const vo = jt(null);
3503
- function wo() {
3504
- return `${q().storagePrefix}-elpath-enabled`;
3553
+ const xo = jt(null);
3554
+ function yo() {
3555
+ return `${Y().storagePrefix}-elpath-enabled`;
3505
3556
  }
3506
- function $i() {
3557
+ function Si() {
3507
3558
  try {
3508
- return localStorage.getItem(wo()) === "1";
3559
+ return localStorage.getItem(yo()) === "1";
3509
3560
  } catch {
3510
3561
  return !1;
3511
3562
  }
3512
3563
  }
3513
3564
  function Nn(e) {
3514
3565
  try {
3515
- localStorage.setItem(wo(), e ? "1" : "0");
3566
+ localStorage.setItem(yo(), e ? "1" : "0");
3516
3567
  } catch {
3517
3568
  }
3518
3569
  }
3519
- const _n = 60, $n = 8, Ci = [
3570
+ const _n = 60, $n = 8, Ti = [
3520
3571
  "id",
3521
3572
  "data-testid",
3522
3573
  "data-test",
@@ -3528,7 +3579,7 @@ const _n = 60, $n = 8, Ci = [
3528
3579
  "alt",
3529
3580
  "placeholder",
3530
3581
  "title"
3531
- ], Ei = 5, Si = {
3582
+ ], Mi = 5, Ai = {
3532
3583
  nav: "navigation",
3533
3584
  main: "main",
3534
3585
  header: "banner",
@@ -3562,11 +3613,11 @@ function Ht(e) {
3562
3613
  }
3563
3614
  return t;
3564
3615
  }
3565
- function xo(e) {
3616
+ function No(e) {
3566
3617
  const t = (e.getAttribute("class") ?? "").trim();
3567
3618
  return t ? t.split(/\s+/).filter((n) => n.length > 0).filter((n) => !/__|^sc-|^css-[a-z0-9]{4,}/i.test(n)).filter((n) => !(/[a-z][0-9]|[0-9][a-z]/i.test(n) && n.length >= 6)) : [];
3568
3619
  }
3569
- function tt(e, t) {
3620
+ function nt(e, t) {
3570
3621
  const n = t.ownerDocument;
3571
3622
  if (!n) return !1;
3572
3623
  try {
@@ -3576,21 +3627,21 @@ function tt(e, t) {
3576
3627
  return !1;
3577
3628
  }
3578
3629
  }
3579
- function Mi(e) {
3630
+ function Li(e) {
3580
3631
  const t = e.parentElement;
3581
3632
  if (!t) return "";
3582
3633
  const n = e.tagName, o = Array.from(t.children).filter((a) => a.tagName === n);
3583
3634
  return o.length <= 1 ? "" : `:nth-of-type(${o.indexOf(e) + 1})`;
3584
3635
  }
3585
- function Ti(e) {
3586
- return e.localName + Mi(e);
3636
+ function Pi(e) {
3637
+ return e.localName + Li(e);
3587
3638
  }
3588
- function Ai(e) {
3639
+ function Ii(e) {
3589
3640
  if (e.tagName === "HTML") return "html";
3590
3641
  const t = e.getAttribute("id");
3591
3642
  if (t) {
3592
3643
  const r = `#${Ht(t)}`;
3593
- if (tt(r, e)) return r;
3644
+ if (nt(r, e)) return r;
3594
3645
  }
3595
3646
  const n = [];
3596
3647
  let o = e;
@@ -3598,31 +3649,31 @@ function Ai(e) {
3598
3649
  const r = o.getAttribute("id");
3599
3650
  if (r) {
3600
3651
  const i = `#${Ht(r)}`;
3601
- if (tt(i, o)) {
3652
+ if (nt(i, o)) {
3602
3653
  n.unshift(i);
3603
3654
  const l = n.join(" > ");
3604
- if (tt(l, e)) return l;
3655
+ if (nt(l, e)) return l;
3605
3656
  o = o.parentElement;
3606
3657
  continue;
3607
3658
  }
3608
3659
  }
3609
- n.unshift(Ti(o));
3660
+ n.unshift(Pi(o));
3610
3661
  const a = n.join(" > ");
3611
- if (tt(a, e)) return a;
3662
+ if (nt(a, e)) return a;
3612
3663
  o = o.parentElement;
3613
3664
  }
3614
3665
  return n.join(" > ");
3615
3666
  }
3616
- function Li(e) {
3667
+ function zi(e) {
3617
3668
  const t = [];
3618
3669
  let n = e;
3619
3670
  for (; n && n.nodeType === 1 && n.tagName !== "HTML"; ) {
3620
- const o = n.localName, r = xo(n)[0];
3671
+ const o = n.localName, r = No(n)[0];
3621
3672
  t.unshift(r ? `${o}.${r}` : o), n = n.parentElement;
3622
3673
  }
3623
3674
  return t.length > $n ? "… > " + t.slice(-$n).join(" > ") : t.join(" > ");
3624
3675
  }
3625
- function Pi(e) {
3676
+ function Ri(e) {
3626
3677
  const t = e.getAttribute("role");
3627
3678
  if (t && t.trim()) return t.trim();
3628
3679
  const n = e.tagName.toLowerCase();
@@ -3632,16 +3683,16 @@ function Pi(e) {
3632
3683
  const o = (e.getAttribute("type") ?? "text").toLowerCase();
3633
3684
  return o === "checkbox" ? "checkbox" : o === "radio" ? "radio" : o === "button" || o === "submit" || o === "reset" ? "button" : o === "range" ? "slider" : o === "hidden" ? null : "textbox";
3634
3685
  }
3635
- return Si[n] ?? null;
3686
+ return Ai[n] ?? null;
3636
3687
  }
3637
- function Ii(e) {
3688
+ function Oi(e) {
3638
3689
  const t = (e.textContent ?? "").replace(/\s+/g, " ").trim();
3639
3690
  return t ? t.length <= _n ? t : t.slice(0, _n - 1).trimEnd() + "…" : null;
3640
3691
  }
3641
- function zi(e) {
3692
+ function Di(e) {
3642
3693
  const t = [];
3643
- for (const n of Ci) {
3644
- if (t.length >= Ei) break;
3694
+ for (const n of Ti) {
3695
+ if (t.length >= Mi) break;
3645
3696
  const o = e.getAttribute(n);
3646
3697
  if (o === null) continue;
3647
3698
  const r = o.replace(/\s+/g, " ").trim();
@@ -3652,13 +3703,13 @@ function zi(e) {
3652
3703
  return t;
3653
3704
  }
3654
3705
  function Ft(e) {
3655
- const t = e.localName, n = e.getAttribute("id"), o = xo(e).slice(0, 2);
3706
+ const t = e.localName, n = e.getAttribute("id"), o = No(e).slice(0, 2);
3656
3707
  let r = t;
3657
3708
  n && (r += `#${Ht(n)}`);
3658
3709
  for (const a of o) r += `.${a}`;
3659
3710
  return r;
3660
3711
  }
3661
- function Ri(e) {
3712
+ function Vi(e) {
3662
3713
  let t = { width: 0, height: 0 };
3663
3714
  if (typeof e.getBoundingClientRect == "function") {
3664
3715
  const n = e.getBoundingClientRect();
@@ -3666,23 +3717,23 @@ function Ri(e) {
3666
3717
  }
3667
3718
  return {
3668
3719
  summary: Ft(e),
3669
- selector: Ai(e),
3670
- breadcrumb: Li(e),
3671
- role: Pi(e),
3672
- text: Ii(e),
3673
- attrs: zi(e),
3720
+ selector: Ii(e),
3721
+ breadcrumb: zi(e),
3722
+ role: Ri(e),
3723
+ text: Oi(e),
3724
+ attrs: Di(e),
3674
3725
  size: t
3675
3726
  };
3676
3727
  }
3677
- function Oi(e) {
3728
+ function Bi(e) {
3678
3729
  const t = [];
3679
3730
  return t.push(`element: ${e.summary}`), t.push(`selector: ${e.selector}`), t.push(`path: ${e.breadcrumb}`), e.role && t.push(`role: ${e.role}`), e.text && t.push(`text: "${e.text}"`), e.attrs.length > 0 && t.push(`attrs: ${e.attrs.join(", ")}`), t.push(`size: ${e.size.width} × ${e.size.height}`), t.join(`
3680
3731
  `);
3681
3732
  }
3682
- function Di(e) {
3683
- return Oi(Ri(e));
3733
+ function Hi(e) {
3734
+ return Bi(Vi(e));
3684
3735
  }
3685
- async function Bi(e, t) {
3736
+ async function Fi(e, t) {
3686
3737
  try {
3687
3738
  if (typeof navigator < "u" && navigator.clipboard?.writeText)
3688
3739
  return await navigator.clipboard.writeText(e), !0;
@@ -3700,8 +3751,8 @@ async function Bi(e, t) {
3700
3751
  return !1;
3701
3752
  }
3702
3753
  }
3703
- const Vi = 2147483001;
3704
- function Hi({ message: e, ok: t }) {
3754
+ const ji = 2147483001;
3755
+ function Ki({ message: e, ok: t }) {
3705
3756
  return e === null ? null : /* @__PURE__ */ s(
3706
3757
  "div",
3707
3758
  {
@@ -3710,7 +3761,7 @@ function Hi({ message: e, ok: t }) {
3710
3761
  top: 0,
3711
3762
  left: 0,
3712
3763
  right: 0,
3713
- zIndex: Vi,
3764
+ zIndex: ji,
3714
3765
  display: "flex",
3715
3766
  justifyContent: "center",
3716
3767
  pointerEvents: "none"
@@ -3747,26 +3798,26 @@ function Hi({ message: e, ok: t }) {
3747
3798
  }
3748
3799
  );
3749
3800
  }
3750
- const Cn = 2147483e3, Fi = 2200, En = 2;
3751
- function ji(e) {
3801
+ const Cn = 2147483e3, Wi = 2200, En = 2;
3802
+ function Xi(e) {
3752
3803
  try {
3753
3804
  return e.closest(Qt) !== null;
3754
3805
  } catch {
3755
3806
  return !1;
3756
3807
  }
3757
3808
  }
3758
- function Ki({ enabled: e }) {
3759
- const [t, n] = _e(!1), [o, r] = _e(null), [a, i] = _e(null), l = de(!1);
3809
+ function Yi({ enabled: e }) {
3810
+ const [t, n] = $e(!1), [o, r] = $e(null), [a, i] = $e(null), l = de(!1);
3760
3811
  l.current = t;
3761
3812
  const c = de(null);
3762
3813
  c.current = o;
3763
- const d = de(null), u = de(null), p = de(null), m = de(0), h = de(null), v = Y(async (g) => {
3764
- const N = Di(g), y = await Bi(N);
3814
+ const d = de(null), u = de(null), p = de(null), m = de(0), h = de(null), v = q(async (g) => {
3815
+ const y = Hi(g), w = await Fi(y);
3765
3816
  m.current += 1, i({
3766
- message: y ? `Copied path: ${Ft(g)}` : "Copy failed — clipboard unavailable",
3767
- ok: y,
3817
+ message: w ? `Copied path: ${Ft(g)}` : "Copy failed — clipboard unavailable",
3818
+ ok: w,
3768
3819
  key: m.current
3769
- }), p.current && clearTimeout(p.current), p.current = setTimeout(() => i(null), Fi);
3820
+ }), p.current && clearTimeout(p.current), p.current = setTimeout(() => i(null), Wi);
3770
3821
  }, []);
3771
3822
  ue(() => {
3772
3823
  e || (n(!1), r(null));
@@ -3774,12 +3825,12 @@ function Ki({ enabled: e }) {
3774
3825
  if (!e) return;
3775
3826
  function g(f, E) {
3776
3827
  const S = document.elementFromPoint(f, E);
3777
- r(!S || ji(S) ? null : S);
3828
+ r(!S || Xi(S) ? null : S);
3778
3829
  }
3779
- function N(f) {
3830
+ function y(f) {
3780
3831
  h.current = { x: f.clientX, y: f.clientY }, l.current && g(f.clientX, f.clientY);
3781
3832
  }
3782
- function y(f) {
3833
+ function w(f) {
3783
3834
  if ((f.key === "Alt" || f.altKey) && !l.current) {
3784
3835
  n(!0);
3785
3836
  const E = h.current;
@@ -3789,23 +3840,23 @@ function Ki({ enabled: e }) {
3789
3840
  function _(f) {
3790
3841
  (f.key === "Alt" || !f.altKey) && (n(!1), r(null));
3791
3842
  }
3792
- function w() {
3843
+ function x() {
3793
3844
  n(!1), r(null);
3794
3845
  }
3795
- return document.addEventListener("mousemove", N, { passive: !0 }), window.addEventListener("keydown", y, !0), window.addEventListener("keyup", _, !0), window.addEventListener("blur", w), () => {
3796
- document.removeEventListener("mousemove", N), window.removeEventListener("keydown", y, !0), window.removeEventListener("keyup", _, !0), window.removeEventListener("blur", w);
3846
+ return document.addEventListener("mousemove", y, { passive: !0 }), window.addEventListener("keydown", w, !0), window.addEventListener("keyup", _, !0), window.addEventListener("blur", x), () => {
3847
+ document.removeEventListener("mousemove", y), window.removeEventListener("keydown", w, !0), window.removeEventListener("keyup", _, !0), window.removeEventListener("blur", x);
3797
3848
  };
3798
3849
  }, [e]), ue(() => {
3799
3850
  if (!e || !t) return;
3800
- function g(y) {
3801
- c.current && (y.preventDefault(), y.stopPropagation(), y.stopImmediatePropagation());
3851
+ function g(w) {
3852
+ c.current && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation());
3802
3853
  }
3803
- function N(y) {
3854
+ function y(w) {
3804
3855
  const _ = c.current;
3805
- _ && (y.preventDefault(), y.stopPropagation(), y.stopImmediatePropagation(), v(_));
3856
+ _ && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation(), v(_));
3806
3857
  }
3807
- return document.addEventListener("mousedown", g, !0), document.addEventListener("click", N, !0), () => {
3808
- document.removeEventListener("mousedown", g, !0), document.removeEventListener("click", N, !0);
3858
+ return document.addEventListener("mousedown", g, !0), document.addEventListener("click", y, !0), () => {
3859
+ document.removeEventListener("mousedown", g, !0), document.removeEventListener("click", y, !0);
3809
3860
  };
3810
3861
  }, [e, t, v]), ue(() => {
3811
3862
  if (!e || !t) return;
@@ -3816,32 +3867,32 @@ function Ki({ enabled: e }) {
3816
3867
  }, [e, t]), ue(() => {
3817
3868
  if (!t || !o) return;
3818
3869
  let g = 0;
3819
- function N() {
3820
- const y = c.current, _ = d.current;
3821
- if (y && _) {
3822
- if (!y.isConnected) {
3870
+ function y() {
3871
+ const w = c.current, _ = d.current;
3872
+ if (w && _) {
3873
+ if (!w.isConnected) {
3823
3874
  r(null);
3824
3875
  return;
3825
3876
  }
3826
- const w = y.getBoundingClientRect();
3827
- _.style.top = `${w.top}px`, _.style.left = `${w.left}px`, _.style.width = `${w.width}px`, _.style.height = `${w.height}px`;
3877
+ const x = w.getBoundingClientRect();
3878
+ _.style.top = `${x.top}px`, _.style.left = `${x.left}px`, _.style.width = `${x.width}px`, _.style.height = `${x.height}px`;
3828
3879
  const f = u.current;
3829
3880
  if (f) {
3830
3881
  const E = f.offsetHeight;
3831
- let S = w.top - E - En;
3832
- S < 0 && (S = w.top + En), f.style.left = `${Math.max(0, w.left)}px`, f.style.top = `${S}px`;
3882
+ let S = x.top - E - En;
3883
+ S < 0 && (S = x.top + En), f.style.left = `${Math.max(0, x.left)}px`, f.style.top = `${S}px`;
3833
3884
  }
3834
3885
  }
3835
- g = requestAnimationFrame(N);
3886
+ g = requestAnimationFrame(y);
3836
3887
  }
3837
- return g = requestAnimationFrame(N), () => cancelAnimationFrame(g);
3888
+ return g = requestAnimationFrame(y), () => cancelAnimationFrame(g);
3838
3889
  }, [t, o]), ue(() => () => {
3839
3890
  p.current && clearTimeout(p.current);
3840
3891
  }, []);
3841
- const C = e && t && o !== null, b = lt(
3892
+ const C = e && t && o !== null, b = st(
3842
3893
  () => C && o ? Ft(o) : "",
3843
3894
  [C, o]
3844
- ), x = C && o ? o.getBoundingClientRect() : null;
3895
+ ), N = C && o ? o.getBoundingClientRect() : null;
3845
3896
  return /* @__PURE__ */ k(ae, { children: [
3846
3897
  /* @__PURE__ */ s(
3847
3898
  "div",
@@ -3863,7 +3914,7 @@ function Ki({ enabled: e }) {
3863
3914
  children: a?.message ?? ""
3864
3915
  }
3865
3916
  ),
3866
- C && x && /* @__PURE__ */ k(ae, { children: [
3917
+ C && N && /* @__PURE__ */ k(ae, { children: [
3867
3918
  /* @__PURE__ */ s(
3868
3919
  "div",
3869
3920
  {
@@ -3872,10 +3923,10 @@ function Ki({ enabled: e }) {
3872
3923
  "aria-hidden": "true",
3873
3924
  style: {
3874
3925
  position: "fixed",
3875
- top: `${x.top}px`,
3876
- left: `${x.left}px`,
3877
- width: `${x.width}px`,
3878
- height: `${x.height}px`,
3926
+ top: `${N.top}px`,
3927
+ left: `${N.left}px`,
3928
+ width: `${N.width}px`,
3929
+ height: `${N.height}px`,
3879
3930
  zIndex: Cn
3880
3931
  }
3881
3932
  }
@@ -3888,47 +3939,47 @@ function Ki({ enabled: e }) {
3888
3939
  "aria-hidden": "true",
3889
3940
  style: {
3890
3941
  position: "fixed",
3891
- top: `${x.top}px`,
3892
- left: `${x.left}px`,
3942
+ top: `${N.top}px`,
3943
+ left: `${N.left}px`,
3893
3944
  zIndex: Cn
3894
3945
  },
3895
3946
  children: [
3896
3947
  /* @__PURE__ */ s("span", { className: "tokenpanel-elpath-label-name", children: b }),
3897
3948
  /* @__PURE__ */ k("span", { className: "tokenpanel-elpath-label-size", children: [
3898
- Math.round(x.width),
3949
+ Math.round(N.width),
3899
3950
  " × ",
3900
- Math.round(x.height)
3951
+ Math.round(N.height)
3901
3952
  ] })
3902
3953
  ]
3903
3954
  }
3904
3955
  )
3905
3956
  ] }),
3906
- a && /* @__PURE__ */ s(Hi, { message: a.message, ok: a.ok }, a.key)
3957
+ a && /* @__PURE__ */ s(Ki, { message: a.message, ok: a.ok }, a.key)
3907
3958
  ] });
3908
3959
  }
3909
- function Wi({ enabled: e }) {
3910
- const t = bo(mo);
3911
- return t ? Wt(/* @__PURE__ */ s(Ki, { enabled: e }), t) : null;
3960
+ function qi({ enabled: e }) {
3961
+ const t = wo(vo);
3962
+ return t ? Wt(/* @__PURE__ */ s(Yi, { enabled: e }), t) : null;
3912
3963
  }
3913
- function Xi({ children: e }) {
3914
- const [t, n] = _e($i), o = Y((i) => {
3964
+ function Gi({ children: e }) {
3965
+ const [t, n] = $e(Si), o = q((i) => {
3915
3966
  n(i), Nn(i);
3916
- }, []), r = Y(() => {
3967
+ }, []), r = q(() => {
3917
3968
  n((i) => {
3918
3969
  const l = !i;
3919
3970
  return Nn(l), l;
3920
3971
  });
3921
- }, []), a = lt(
3972
+ }, []), a = st(
3922
3973
  () => ({ enabled: t, setEnabled: o, toggle: r }),
3923
3974
  [t, o, r]
3924
3975
  );
3925
3976
  return /* @__PURE__ */ k(ae, { children: [
3926
- /* @__PURE__ */ s(vo.Provider, { value: a, children: e }),
3927
- /* @__PURE__ */ s(Wi, { enabled: t })
3977
+ /* @__PURE__ */ s(xo.Provider, { value: a, children: e }),
3978
+ /* @__PURE__ */ s(qi, { enabled: t })
3928
3979
  ] });
3929
3980
  }
3930
- function Yi() {
3931
- const e = Xt(vo);
3981
+ function Ui() {
3982
+ const e = Xt(xo);
3932
3983
  if (e === null) return null;
3933
3984
  const { enabled: t, toggle: n } = e;
3934
3985
  return /* @__PURE__ */ s(
@@ -3964,8 +4015,8 @@ function Yi() {
3964
4015
  }
3965
4016
  );
3966
4017
  }
3967
- const yo = jt(null);
3968
- function qi({ state: e }) {
4018
+ const _o = jt(null);
4019
+ function Ji({ state: e }) {
3969
4020
  const t = de(null);
3970
4021
  return ue(() => {
3971
4022
  if (!e.visible || !e.triggerEl || !t.current) return;
@@ -3986,16 +4037,16 @@ function qi({ state: e }) {
3986
4037
  }
3987
4038
  );
3988
4039
  }
3989
- function Gi({ children: e }) {
3990
- const [t, n] = _e({
4040
+ function Zi({ children: e }) {
4041
+ const [t, n] = $e({
3991
4042
  visible: !1,
3992
4043
  text: "",
3993
4044
  triggerEl: null
3994
- }), o = de(null), r = Y((l, c) => {
4045
+ }), o = de(null), r = q((l, c) => {
3995
4046
  o.current = l, n({ visible: !0, text: c, triggerEl: l });
3996
- }, []), a = Y((l) => {
4047
+ }, []), a = q((l) => {
3997
4048
  o.current === l && (o.current = null, n({ visible: !1, text: "", triggerEl: null }));
3998
- }, []), i = Y(() => {
4049
+ }, []), i = q(() => {
3999
4050
  o.current = null, n({ visible: !1, text: "", triggerEl: null });
4000
4051
  }, []);
4001
4052
  return ue(() => {
@@ -4008,28 +4059,28 @@ function Gi({ children: e }) {
4008
4059
  o.current && i();
4009
4060
  }
4010
4061
  return window.addEventListener("scroll", l, !0), () => window.removeEventListener("scroll", l, !0);
4011
- }, [i]), /* @__PURE__ */ k(yo.Provider, { value: { show: r, hide: a }, children: [
4062
+ }, [i]), /* @__PURE__ */ k(_o.Provider, { value: { show: r, hide: a }, children: [
4012
4063
  e,
4013
- typeof document < "u" && Wt(/* @__PURE__ */ s(qi, { state: t }), document.body)
4064
+ typeof document < "u" && Wt(/* @__PURE__ */ s(Ji, { state: t }), document.body)
4014
4065
  ] });
4015
4066
  }
4016
4067
  function en(e) {
4017
- const t = Xt(yo), n = Y(
4068
+ const t = Xt(_o), n = q(
4018
4069
  (i) => {
4019
4070
  t && t.show(i.currentTarget, e);
4020
4071
  },
4021
4072
  [t, e]
4022
- ), o = Y(
4073
+ ), o = q(
4023
4074
  (i) => {
4024
4075
  t && t.hide(i.currentTarget);
4025
4076
  },
4026
4077
  [t, e]
4027
- ), r = Y(
4078
+ ), r = q(
4028
4079
  (i) => {
4029
4080
  t && t.show(i.currentTarget, e);
4030
4081
  },
4031
4082
  [t, e]
4032
- ), a = Y(
4083
+ ), a = q(
4033
4084
  (i) => {
4034
4085
  t && t.hide(i.currentTarget);
4035
4086
  },
@@ -4037,8 +4088,8 @@ function en(e) {
4037
4088
  );
4038
4089
  return { onMouseEnter: n, onMouseLeave: o, onFocusIn: r, onFocusOut: a };
4039
4090
  }
4040
- function Ui(e, t, n) {
4041
- W(() => {
4091
+ function Qi(e, t, n) {
4092
+ X(() => {
4042
4093
  if (!n) return;
4043
4094
  function o(a) {
4044
4095
  e.current && !e.current.contains(a.target) && t();
@@ -4049,7 +4100,7 @@ function Ui(e, t, n) {
4049
4100
  return document.addEventListener("mousedown", o), document.addEventListener("keydown", r), () => {
4050
4101
  document.removeEventListener("mousedown", o), document.removeEventListener("keydown", r);
4051
4102
  };
4052
- }, [n, t, e]), W(() => {
4103
+ }, [n, t, e]), X(() => {
4053
4104
  if (!n) return;
4054
4105
  function o() {
4055
4106
  t();
@@ -4057,7 +4108,7 @@ function Ui(e, t, n) {
4057
4108
  return window.addEventListener("scroll", o, !0), () => window.removeEventListener("scroll", o, !0);
4058
4109
  }, [n, t]);
4059
4110
  }
4060
- function Ji(e, t, n, o) {
4111
+ function el(e, t, n, o) {
4061
4112
  if (!e) return { position: "fixed", zIndex: 70, ...o };
4062
4113
  const r = e.getBoundingClientRect(), a = 4, i = 8, l = window.innerHeight - r.bottom - i, c = r.top - i, d = l < n && c > l;
4063
4114
  let u = r.left;
@@ -4077,7 +4128,7 @@ const Sn = Ge(function({
4077
4128
  label: r,
4078
4129
  cssVar: a
4079
4130
  }) {
4080
- const [i, l] = j(!1), c = D(null), d = R(() => l(!1), []), u = R(
4131
+ const [i, l] = K(!1), c = B(null), d = R(() => l(!1), []), u = R(
4081
4132
  (h) => {
4082
4133
  n(o, h);
4083
4134
  },
@@ -4102,7 +4153,7 @@ const Sn = Ge(function({
4102
4153
  }
4103
4154
  ),
4104
4155
  i && /* @__PURE__ */ s(
4105
- co,
4156
+ po,
4106
4157
  {
4107
4158
  color: t,
4108
4159
  onChange: u,
@@ -4115,7 +4166,7 @@ const Sn = Ge(function({
4115
4166
  a && /* @__PURE__ */ s(se, { cssVar: a })
4116
4167
  ] })
4117
4168
  ] });
4118
- }), nt = Ge(function({
4169
+ }), ot = Ge(function({
4119
4170
  label: t,
4120
4171
  idKey: n,
4121
4172
  value: o,
@@ -4127,11 +4178,11 @@ const Sn = Ge(function({
4127
4178
  foreground: d,
4128
4179
  cssVar: u
4129
4180
  }) {
4130
- const p = a ?? ((w) => `--zd-p${w}`), [m, h] = j(!1), v = D(null), C = D(null), b = R(() => h(!1), []), x = R(() => h((w) => !w), []), g = o === "bg" ? c ?? "#000000" : o === "fg" ? d ?? "#ffffff" : r[o] ?? "#000000", N = o === "bg" ? "bg" : o === "fg" ? "fg" : `p${o}`;
4131
- Ui(v, b, m);
4132
- const y = en(`${t}: ${N}`);
4133
- function _(w) {
4134
- i(n, w), h(!1);
4181
+ const p = a ?? ((x) => `--zd-p${x}`), [m, h] = K(!1), v = B(null), C = B(null), b = R(() => h(!1), []), N = R(() => h((x) => !x), []), g = o === "bg" ? c ?? "#000000" : o === "fg" ? d ?? "#ffffff" : r[o] ?? "#000000", y = o === "bg" ? "bg" : o === "fg" ? "fg" : `p${o}`;
4182
+ Qi(v, b, m);
4183
+ const w = en(`${t}: ${y}`);
4184
+ function _(x) {
4185
+ i(n, x), h(!1);
4135
4186
  }
4136
4187
  return /* @__PURE__ */ k("div", { className: "tokenpanel-palette-selector", ref: v, children: [
4137
4188
  /* @__PURE__ */ k(
@@ -4140,14 +4191,14 @@ const Sn = Ge(function({
4140
4191
  ref: C,
4141
4192
  role: "button",
4142
4193
  tabIndex: 0,
4143
- onClick: x,
4144
- onKeyDown: (w) => {
4145
- (w.key === "Enter" || w.key === " ") && (w.preventDefault(), x());
4194
+ onClick: N,
4195
+ onKeyDown: (x) => {
4196
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), N());
4146
4197
  },
4147
4198
  className: "tokenpanel-palette-trigger",
4148
- "aria-label": `${t}: ${N}`,
4199
+ "aria-label": `${t}: ${y}`,
4149
4200
  "aria-expanded": m,
4150
- ...y,
4201
+ ...w,
4151
4202
  children: [
4152
4203
  /* @__PURE__ */ s("span", { className: "tokenpanel-palette-trigger-label", children: t }),
4153
4204
  /* @__PURE__ */ s(
@@ -4157,7 +4208,7 @@ const Sn = Ge(function({
4157
4208
  style: { backgroundColor: g }
4158
4209
  }
4159
4210
  ),
4160
- /* @__PURE__ */ s("span", { className: "tokenpanel-palette-trigger-value", children: N }),
4211
+ /* @__PURE__ */ s("span", { className: "tokenpanel-palette-trigger-value", children: y }),
4161
4212
  /* @__PURE__ */ s(
4162
4213
  "svg",
4163
4214
  {
@@ -4181,16 +4232,16 @@ const Sn = Ge(function({
4181
4232
  role: "listbox",
4182
4233
  "aria-label": `${t} color options`,
4183
4234
  className: "tokenpanel-palette-options",
4184
- style: Ji(C.current, 440, l ? 160 : 120),
4235
+ style: el(C.current, 440, l ? 160 : 120),
4185
4236
  children: [
4186
- l && l.length > 0 && /* @__PURE__ */ s("div", { className: "tokenpanel-palette-options-extras", children: l.map((w) => {
4187
- const f = w === "bg" ? c ?? "#000000" : d ?? "#ffffff", E = o === w;
4237
+ l && l.length > 0 && /* @__PURE__ */ s("div", { className: "tokenpanel-palette-options-extras", children: l.map((x) => {
4238
+ const f = x === "bg" ? c ?? "#000000" : d ?? "#ffffff", E = o === x;
4188
4239
  return /* @__PURE__ */ k(
4189
4240
  "div",
4190
4241
  {
4191
4242
  role: "option",
4192
4243
  "aria-selected": E,
4193
- onClick: () => _(w),
4244
+ onClick: () => _(x),
4194
4245
  className: E ? "tokenpanel-palette-extra-option is-selected" : "tokenpanel-palette-extra-option",
4195
4246
  children: [
4196
4247
  /* @__PURE__ */ s(
@@ -4200,24 +4251,24 @@ const Sn = Ge(function({
4200
4251
  style: { backgroundColor: f }
4201
4252
  }
4202
4253
  ),
4203
- /* @__PURE__ */ s("span", { className: "tokenpanel-palette-extra-label", children: w })
4254
+ /* @__PURE__ */ s("span", { className: "tokenpanel-palette-extra-label", children: x })
4204
4255
  ]
4205
4256
  },
4206
- w
4257
+ x
4207
4258
  );
4208
4259
  }) }),
4209
- /* @__PURE__ */ s("div", { className: "tokenpanel-palette-options-grid", children: r.map((w, f) => {
4260
+ /* @__PURE__ */ s("div", { className: "tokenpanel-palette-options-grid", children: r.map((x, f) => {
4210
4261
  const E = o === f, S = p(f);
4211
4262
  return /* @__PURE__ */ s(
4212
4263
  "div",
4213
4264
  {
4214
4265
  role: "option",
4215
4266
  "aria-selected": E,
4216
- "aria-label": `${S}: ${w}`,
4267
+ "aria-label": `${S}: ${x}`,
4217
4268
  onClick: () => _(f),
4218
- title: `${S}: ${w}`,
4269
+ title: `${S}: ${x}`,
4219
4270
  className: E ? "tokenpanel-palette-option-button is-selected" : "tokenpanel-palette-option-button",
4220
- style: { backgroundColor: w }
4271
+ style: { backgroundColor: x }
4221
4272
  },
4222
4273
  f
4223
4274
  );
@@ -4227,7 +4278,7 @@ const Sn = Ge(function({
4227
4278
  )
4228
4279
  ] });
4229
4280
  });
4230
- function Zi({
4281
+ function tl({
4231
4282
  tab: e,
4232
4283
  state: t,
4233
4284
  persistColor: n,
@@ -4235,7 +4286,7 @@ function Zi({
4235
4286
  secondaryState: r,
4236
4287
  persistSecondary: a
4237
4288
  }) {
4238
- const i = J(() => pn(e), [e]), l = J(
4289
+ const i = Z(() => pn(e), [e]), l = Z(
4239
4290
  () => i ?? {
4240
4291
  id: "stub",
4241
4292
  paletteSize: 0,
@@ -4249,23 +4300,23 @@ function Zi({
4249
4300
  panelSettings: { colorScheme: "", colorMode: !1 }
4250
4301
  },
4251
4302
  [i]
4252
- ), c = J(
4303
+ ), c = Z(
4253
4304
  () => o ? pn(o) ?? null : null,
4254
4305
  [o]
4255
- ), d = q().colorPresets ?? {}, u = J(
4306
+ ), d = Y().colorPresets ?? {}, u = Z(
4256
4307
  () => ({ ...d, ...l.colorSchemes }),
4257
4308
  [d, l.colorSchemes]
4258
- ), p = J(() => Object.keys(l.colorSchemes), [l.colorSchemes]), m = J(() => Object.keys(d).sort(), [d]), h = l.label ?? l.id.toUpperCase(), v = c?.label ?? c?.id.toUpperCase() ?? "", C = R(
4309
+ ), p = Z(() => Object.keys(l.colorSchemes), [l.colorSchemes]), m = Z(() => Object.keys(d).sort(), [d]), h = l.label ?? l.id.toUpperCase(), v = c?.label ?? c?.id.toUpperCase() ?? "", C = R(
4259
4310
  (f) => ve(l, f),
4260
4311
  [l]
4261
4312
  ), b = R(
4262
4313
  (f) => c ? ve(c, f) : "",
4263
4314
  [c]
4264
- ), x = R(
4315
+ ), N = R(
4265
4316
  (f, E) => {
4266
4317
  n((S) => ({
4267
4318
  ...S,
4268
- palette: S.palette.map((V, X) => X === f ? E : V)
4319
+ palette: S.palette.map((O, j) => j === f ? E : O)
4269
4320
  }));
4270
4321
  },
4271
4322
  [n]
@@ -4273,11 +4324,11 @@ function Zi({
4273
4324
  (f, E) => {
4274
4325
  a((S) => S && {
4275
4326
  ...S,
4276
- palette: S.palette.map((V, X) => X === f ? E : V)
4327
+ palette: S.palette.map((O, j) => j === f ? E : O)
4277
4328
  });
4278
4329
  },
4279
4330
  [a]
4280
- ), N = R(
4331
+ ), y = R(
4281
4332
  (f, E) => {
4282
4333
  a((S) => S && {
4283
4334
  ...S,
@@ -4285,7 +4336,7 @@ function Zi({
4285
4336
  });
4286
4337
  },
4287
4338
  [a]
4288
- ), y = R(
4339
+ ), w = R(
4289
4340
  (f, E) => {
4290
4341
  typeof E == "number" && (f !== "background" && f !== "foreground" && f !== "cursor" && f !== "selectionBg" && f !== "selectionFg" || n((S) => ({ ...S, [f]: E })));
4291
4342
  },
@@ -4298,12 +4349,12 @@ function Zi({
4298
4349
  }));
4299
4350
  },
4300
4351
  [n]
4301
- ), w = R(
4352
+ ), x = R(
4302
4353
  (f) => {
4303
4354
  const E = u[f];
4304
4355
  if (!E) return;
4305
4356
  const S = Pn(E);
4306
- n(() => S), Oo(S.shikiTheme);
4357
+ n(() => S), Vo(S.shikiTheme);
4307
4358
  },
4308
4359
  [n]
4309
4360
  );
@@ -4313,7 +4364,7 @@ function Zi({
4313
4364
  {
4314
4365
  onChange: (f) => {
4315
4366
  const E = f.target, S = E.value;
4316
- S && (w(S), E.value = "");
4367
+ S && (x(S), E.value = "");
4317
4368
  },
4318
4369
  className: "tokenpanel-color-preset-select",
4319
4370
  "aria-label": "Load color scheme preset",
@@ -4341,7 +4392,7 @@ function Zi({
4341
4392
  index: E,
4342
4393
  label: ve(l, E),
4343
4394
  cssVar: ve(l, E),
4344
- onChange: x
4395
+ onChange: N
4345
4396
  },
4346
4397
  E
4347
4398
  )
@@ -4355,26 +4406,26 @@ function Zi({
4355
4406
  ] }),
4356
4407
  /* @__PURE__ */ k("div", { className: "tokenpanel-color-base-grid", children: [
4357
4408
  /* @__PURE__ */ s(
4358
- nt,
4409
+ ot,
4359
4410
  {
4360
4411
  label: "background (bg)",
4361
4412
  idKey: "background",
4362
4413
  value: t.background,
4363
4414
  palette: t.palette,
4364
4415
  paletteCssVar: C,
4365
- onChange: y,
4416
+ onChange: w,
4366
4417
  cssVar: l.baseRoles.background
4367
4418
  }
4368
4419
  ),
4369
4420
  /* @__PURE__ */ s(
4370
- nt,
4421
+ ot,
4371
4422
  {
4372
4423
  label: "foreground (fg)",
4373
4424
  idKey: "foreground",
4374
4425
  value: t.foreground,
4375
4426
  palette: t.palette,
4376
4427
  paletteCssVar: C,
4377
- onChange: y,
4428
+ onChange: w,
4378
4429
  cssVar: l.baseRoles.foreground
4379
4430
  }
4380
4431
  )
@@ -4388,7 +4439,7 @@ function Zi({
4388
4439
  /* @__PURE__ */ s("div", { className: "tokenpanel-color-base-grid", children: Object.entries(l.semanticDefaults).map(([f, E]) => {
4389
4440
  const S = l.semanticCssNames[f];
4390
4441
  return /* @__PURE__ */ s(
4391
- nt,
4442
+ ot,
4392
4443
  {
4393
4444
  label: S ?? f,
4394
4445
  idKey: f,
@@ -4442,14 +4493,14 @@ function Zi({
4442
4493
  /* @__PURE__ */ s("div", { className: "tokenpanel-color-base-grid", children: Object.entries(c.semanticDefaults).map(([f, E]) => {
4443
4494
  const S = c.semanticCssNames[f];
4444
4495
  return /* @__PURE__ */ s(
4445
- nt,
4496
+ ot,
4446
4497
  {
4447
4498
  label: S ?? f,
4448
4499
  idKey: f,
4449
4500
  value: r.semanticMappings[f] ?? E,
4450
4501
  palette: r.palette,
4451
4502
  paletteCssVar: b,
4452
- onChange: N,
4503
+ onChange: y,
4453
4504
  cssVar: S
4454
4505
  },
4455
4506
  f
@@ -4462,18 +4513,18 @@ function Zi({
4462
4513
  ] })
4463
4514
  ] });
4464
4515
  }
4465
- const qe = "__literal__", Mn = 28;
4466
- function Qi(e) {
4467
- return e.length <= Mn ? e : e.slice(0, Mn - 1) + "…";
4516
+ const qe = "__literal__", Tn = 28;
4517
+ function nl(e) {
4518
+ return e.length <= Tn ? e : e.slice(0, Tn - 1) + "…";
4468
4519
  }
4469
- function Tn(e, t) {
4520
+ function Mn(e, t) {
4470
4521
  return e.tiers.find((n) => n.id === t);
4471
4522
  }
4472
- function el(e, t) {
4523
+ function ol(e, t) {
4473
4524
  return e.items.find((n) => n.id === t);
4474
4525
  }
4475
- function tl({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueFor: a }) {
4476
- const l = Tn(e, t)?.referencesTier ?? "", c = l ? Tn(e, l) : void 0, d = c?.items ?? [], u = c && el(c, o) ? o : d[0]?.id ?? "";
4526
+ function rl({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueFor: a }) {
4527
+ const l = Mn(e, t)?.referencesTier ?? "", c = l ? Mn(e, l) : void 0, d = c?.items ?? [], u = c && ol(c, o) ? o : d[0]?.id ?? "";
4477
4528
  return /* @__PURE__ */ s("div", { className: "tokenpanel-tier-ref-selector", children: /* @__PURE__ */ k(
4478
4529
  "select",
4479
4530
  {
@@ -4485,7 +4536,7 @@ function tl({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueF
4485
4536
  "aria-label": `${n} tier reference`,
4486
4537
  children: [
4487
4538
  d.map((m) => {
4488
- const h = Qi(a(m.id));
4539
+ const h = nl(a(m.id));
4489
4540
  return /* @__PURE__ */ k("option", { value: m.id, children: [
4490
4541
  m.cssVar,
4491
4542
  " (",
@@ -4498,18 +4549,18 @@ function tl({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueF
4498
4549
  }
4499
4550
  ) });
4500
4551
  }
4501
- const gt = Ge(tl);
4502
- function nl({ cssVar: e, label: t, className: n }) {
4552
+ const kt = Ge(rl);
4553
+ function al({ cssVar: e, label: t, className: n }) {
4503
4554
  const o = en(e);
4504
4555
  return /* @__PURE__ */ k("span", { className: n ?? "tokenpanel-row-label", ...o, children: [
4505
4556
  e,
4506
4557
  t && t !== e && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: t })
4507
4558
  ] });
4508
4559
  }
4509
- const fe = Ge(nl);
4510
- function ol({ item: e, value: t, onChange: n }) {
4511
- const o = e.type, r = e.readonly === !0, a = e.pill, i = a?.value ?? "", l = a?.customDefault ?? "", c = a ? t === i : !1, d = D(c ? l : t);
4512
- W(() => {
4560
+ const fe = Ge(al);
4561
+ function il({ item: e, value: t, onChange: n }) {
4562
+ const o = e.type, r = e.readonly === !0, a = e.pill, i = a?.value ?? "", l = a?.customDefault ?? "", c = a ? t === i : !1, d = B(c ? l : t);
4563
+ X(() => {
4513
4564
  c || (d.current = t);
4514
4565
  }, [c, t]);
4515
4566
  const u = R(
@@ -4521,19 +4572,19 @@ function ol({ item: e, value: t, onChange: n }) {
4521
4572
  switch (o.kind) {
4522
4573
  case "length":
4523
4574
  case "number": {
4524
- const p = o.kind === "length" ? o.unit : "", m = parseFloat(t), h = Number.isFinite(m) ? m : 0, [v, C] = j(String(h));
4525
- W(() => {
4575
+ const p = o.kind === "length" ? o.unit : "", m = parseFloat(t), h = Number.isFinite(m) ? m : 0, [v, C] = K(String(h));
4576
+ X(() => {
4526
4577
  C(String(Number.isFinite(parseFloat(t)) ? parseFloat(t) : 0));
4527
4578
  }, [t]);
4528
- const b = (y) => {
4529
- const _ = y.currentTarget.value;
4579
+ const b = (w) => {
4580
+ const _ = w.currentTarget.value;
4530
4581
  C(_);
4531
- const w = parseFloat(_);
4532
- Number.isFinite(w) && n(e.id, p ? `${w}${p}` : String(w));
4533
- }, x = () => {
4534
- const y = parseFloat(v);
4535
- Number.isFinite(y) || C(String(h));
4536
- }, g = r || a !== void 0 && c, N = /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${e.id}`, children: /* @__PURE__ */ k("div", { className: "tokenpanel-row-head", children: [
4582
+ const x = parseFloat(_);
4583
+ Number.isFinite(x) && n(e.id, p ? `${x}${p}` : String(x));
4584
+ }, N = () => {
4585
+ const w = parseFloat(v);
4586
+ Number.isFinite(w) || C(String(h));
4587
+ }, g = r || a !== void 0 && c, y = /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${e.id}`, children: /* @__PURE__ */ k("div", { className: "tokenpanel-row-head", children: [
4537
4588
  /* @__PURE__ */ s(fe, { cssVar: e.cssVar, label: e.label }),
4538
4589
  /* @__PURE__ */ k("div", { className: "tokenpanel-row-input-group", children: [
4539
4590
  /* @__PURE__ */ s(
@@ -4543,7 +4594,7 @@ function ol({ item: e, value: t, onChange: n }) {
4543
4594
  inputMode: "decimal",
4544
4595
  value: v,
4545
4596
  onChange: b,
4546
- onBlur: x,
4597
+ onBlur: N,
4547
4598
  disabled: g,
4548
4599
  className: "tokenpanel-row-number-input",
4549
4600
  "aria-label": `${e.cssVar} value`
@@ -4571,12 +4622,12 @@ function ol({ item: e, value: t, onChange: n }) {
4571
4622
  ")"
4572
4623
  ] })
4573
4624
  ] }),
4574
- N
4575
- ] }) : N;
4625
+ y
4626
+ ] }) : y;
4576
4627
  }
4577
4628
  case "select": {
4578
- const p = o.options, [m, h] = j(t);
4579
- W(() => {
4629
+ const p = o.options, [m, h] = K(t);
4630
+ X(() => {
4580
4631
  h(t);
4581
4632
  }, [t]);
4582
4633
  const v = (C) => {
@@ -4649,8 +4700,8 @@ function ol({ item: e, value: t, onChange: n }) {
4649
4700
  return null;
4650
4701
  }
4651
4702
  }
4652
- const tn = Ge(ol);
4653
- function rl({ tab: e, state: t, persistFont: n }) {
4703
+ const tn = Ge(il);
4704
+ function ll({ tab: e, state: t, persistFont: n }) {
4654
4705
  const o = R(
4655
4706
  (a, i) => {
4656
4707
  if (i === qe) {
@@ -4681,7 +4732,7 @@ function rl({ tab: e, state: t, persistFont: n }) {
4681
4732
  }
4682
4733
  ) }),
4683
4734
  e.tiers.map((a) => /* @__PURE__ */ s(
4684
- al,
4735
+ sl,
4685
4736
  {
4686
4737
  tab: e,
4687
4738
  tier: a,
@@ -4692,7 +4743,7 @@ function rl({ tab: e, state: t, persistFont: n }) {
4692
4743
  ))
4693
4744
  ] });
4694
4745
  }
4695
- function al({ tab: e, tier: t, state: n, onChange: o }) {
4746
+ function sl({ tab: e, tier: t, state: n, onChange: o }) {
4696
4747
  const r = t.referencesTier !== void 0;
4697
4748
  return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `font-tier-${t.id}`, children: [
4698
4749
  /* @__PURE__ */ s(
@@ -4714,7 +4765,7 @@ function al({ tab: e, tier: t, state: n, onChange: o }) {
4714
4765
  children: [
4715
4766
  /* @__PURE__ */ s(fe, { cssVar: a.cssVar, label: a.label }),
4716
4767
  /* @__PURE__ */ s(
4717
- gt,
4768
+ kt,
4718
4769
  {
4719
4770
  tab: e,
4720
4771
  tierId: t.id,
@@ -4745,7 +4796,7 @@ function al({ tab: e, tier: t, state: n, onChange: o }) {
4745
4796
  }) })
4746
4797
  ] });
4747
4798
  }
4748
- function il({ tab: e, state: t, persistSize: n }) {
4799
+ function cl({ tab: e, state: t, persistSize: n }) {
4749
4800
  const o = R(
4750
4801
  (a, i) => {
4751
4802
  if (i === qe) {
@@ -4776,7 +4827,7 @@ function il({ tab: e, state: t, persistSize: n }) {
4776
4827
  }
4777
4828
  ) }),
4778
4829
  e.tiers.map((a) => /* @__PURE__ */ s(
4779
- ll,
4830
+ dl,
4780
4831
  {
4781
4832
  tab: e,
4782
4833
  tier: a,
@@ -4787,7 +4838,7 @@ function il({ tab: e, state: t, persistSize: n }) {
4787
4838
  ))
4788
4839
  ] });
4789
4840
  }
4790
- function ll({ tab: e, tier: t, state: n, onChange: o }) {
4841
+ function dl({ tab: e, tier: t, state: n, onChange: o }) {
4791
4842
  const r = t.referencesTier !== void 0;
4792
4843
  return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `size-tier-${t.id}`, children: [
4793
4844
  /* @__PURE__ */ s(
@@ -4809,7 +4860,7 @@ function ll({ tab: e, tier: t, state: n, onChange: o }) {
4809
4860
  children: [
4810
4861
  /* @__PURE__ */ s(fe, { cssVar: a.cssVar, label: a.label }),
4811
4862
  /* @__PURE__ */ s(
4812
- gt,
4863
+ kt,
4813
4864
  {
4814
4865
  tab: e,
4815
4866
  tierId: t.id,
@@ -4840,7 +4891,7 @@ function ll({ tab: e, tier: t, state: n, onChange: o }) {
4840
4891
  }) })
4841
4892
  ] });
4842
4893
  }
4843
- function sl({ tab: e, state: t, persistSpacing: n }) {
4894
+ function ul({ tab: e, state: t, persistSpacing: n }) {
4844
4895
  const o = R(
4845
4896
  (a, i) => {
4846
4897
  if (i === qe) {
@@ -4871,7 +4922,7 @@ function sl({ tab: e, state: t, persistSpacing: n }) {
4871
4922
  }
4872
4923
  ) }),
4873
4924
  e.tiers.map((a) => /* @__PURE__ */ s(
4874
- cl,
4925
+ pl,
4875
4926
  {
4876
4927
  tab: e,
4877
4928
  tier: a,
@@ -4882,7 +4933,7 @@ function sl({ tab: e, state: t, persistSpacing: n }) {
4882
4933
  ))
4883
4934
  ] });
4884
4935
  }
4885
- function cl({ tab: e, tier: t, state: n, onChange: o }) {
4936
+ function pl({ tab: e, tier: t, state: n, onChange: o }) {
4886
4937
  const r = t.referencesTier !== void 0;
4887
4938
  return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `spacing-tier-${t.id}`, children: [
4888
4939
  /* @__PURE__ */ s(
@@ -4904,7 +4955,7 @@ function cl({ tab: e, tier: t, state: n, onChange: o }) {
4904
4955
  children: [
4905
4956
  /* @__PURE__ */ s(fe, { cssVar: a.cssVar, label: a.label }),
4906
4957
  /* @__PURE__ */ s(
4907
- gt,
4958
+ kt,
4908
4959
  {
4909
4960
  tab: e,
4910
4961
  tierId: t.id,
@@ -4935,13 +4986,13 @@ function cl({ tab: e, tier: t, state: n, onChange: o }) {
4935
4986
  }) })
4936
4987
  ] });
4937
4988
  }
4938
- function dl({ tab: e, tier: t, item: n, value: o, overrides: r, onChange: a }) {
4989
+ function fl({ tab: e, tier: t, item: n, value: o, overrides: r, onChange: a }) {
4939
4990
  if (t.referencesTier !== void 0) {
4940
4991
  const c = t.referencesTier;
4941
4992
  return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-ref-row-${n.id}`, children: [
4942
4993
  /* @__PURE__ */ s(fe, { cssVar: n.cssVar, label: n.label }),
4943
4994
  /* @__PURE__ */ s(
4944
- gt,
4995
+ kt,
4945
4996
  {
4946
4997
  tab: e,
4947
4998
  tierId: t.id,
@@ -4961,15 +5012,15 @@ function dl({ tab: e, tier: t, item: n, value: o, overrides: r, onChange: a }) {
4961
5012
  switch (i.kind) {
4962
5013
  case "length":
4963
5014
  case "number": {
4964
- const c = i.kind === "length" ? i.unit : "", d = parseFloat(o), u = Number.isFinite(d) ? d : 0, [p, m] = j(String(u));
4965
- W(() => {
5015
+ const c = i.kind === "length" ? i.unit : "", d = parseFloat(o), u = Number.isFinite(d) ? d : 0, [p, m] = K(String(u));
5016
+ X(() => {
4966
5017
  m(String(Number.isFinite(parseFloat(o)) ? parseFloat(o) : 0));
4967
5018
  }, [o]);
4968
5019
  const h = (C) => {
4969
5020
  const b = C.currentTarget.value;
4970
5021
  m(b);
4971
- const x = parseFloat(b);
4972
- Number.isFinite(x) && a(n.id, c ? `${x}${c}` : String(x));
5022
+ const N = parseFloat(b);
5023
+ Number.isFinite(N) && a(n.id, c ? `${N}${c}` : String(N));
4973
5024
  }, v = () => {
4974
5025
  const C = parseFloat(p);
4975
5026
  Number.isFinite(C) || m(String(u));
@@ -5066,7 +5117,7 @@ function dl({ tab: e, tier: t, item: n, value: o, overrides: r, onChange: a }) {
5066
5117
  return null;
5067
5118
  }
5068
5119
  }
5069
- function ul({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: r }) {
5120
+ function hl({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: r }) {
5070
5121
  const a = R(
5071
5122
  (i, l) => {
5072
5123
  r(t.id, i, l);
@@ -5086,7 +5137,7 @@ function ul({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: r }
5086
5137
  /* @__PURE__ */ s("div", { className: "tokenpanel-tab-grid", children: t.items.map((i) => {
5087
5138
  const l = n[i.id] ?? i.default;
5088
5139
  return /* @__PURE__ */ s(
5089
- dl,
5140
+ fl,
5090
5141
  {
5091
5142
  tab: e,
5092
5143
  tier: t,
@@ -5100,7 +5151,7 @@ function ul({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: r }
5100
5151
  }) })
5101
5152
  ] });
5102
5153
  }
5103
- function pl({ tab: e, overrides: t, onChange: n }) {
5154
+ function gl({ tab: e, overrides: t, onChange: n }) {
5104
5155
  const o = R(
5105
5156
  (r, a, i) => {
5106
5157
  n(r, a, i);
@@ -5110,7 +5161,7 @@ function pl({ tab: e, overrides: t, onChange: n }) {
5110
5161
  return /* @__PURE__ */ s("div", { className: "tokenpanel-tab-content", "data-testid": `generic-tab-${e.id}`, children: e.tiers.map((r) => {
5111
5162
  const a = t[r.id] ?? {};
5112
5163
  return /* @__PURE__ */ s(
5113
- ul,
5164
+ hl,
5114
5165
  {
5115
5166
  tab: e,
5116
5167
  tier: r,
@@ -5122,19 +5173,19 @@ function pl({ tab: e, overrides: t, onChange: n }) {
5122
5173
  );
5123
5174
  }) });
5124
5175
  }
5125
- function fl(e, t) {
5126
- const n = Y(
5176
+ function kl(e, t) {
5177
+ const n = q(
5127
5178
  (u) => {
5128
5179
  e((p) => {
5129
5180
  if (!p) return p;
5130
5181
  const m = u(p);
5131
- return it(m, t), In(m, void 0, t), m;
5182
+ return lt(m, t), In(m, void 0, t), m;
5132
5183
  });
5133
5184
  },
5134
5185
  // cfg is intentionally included so the callback re-binds when the
5135
5186
  // config reference changes (e.g. hot-reload in dev).
5136
5187
  [e, t]
5137
- ), o = Y(
5188
+ ), o = q(
5138
5189
  (u, p) => {
5139
5190
  n((m) => {
5140
5191
  const h = m.tabs?.[u] ?? {}, v = p(h);
@@ -5148,32 +5199,32 @@ function fl(e, t) {
5148
5199
  });
5149
5200
  },
5150
5201
  [n]
5151
- ), r = Y(
5202
+ ), r = q(
5152
5203
  (u) => {
5153
5204
  n((p) => ({ ...p, color: u(p.color) }));
5154
5205
  },
5155
5206
  [n]
5156
- ), a = Y(
5207
+ ), a = q(
5157
5208
  (u) => {
5158
5209
  n((p) => ({ ...p, spacing: u(p.spacing) }));
5159
5210
  },
5160
5211
  [n]
5161
- ), i = Y(
5212
+ ), i = q(
5162
5213
  (u) => {
5163
5214
  n((p) => ({ ...p, typography: u(p.typography) }));
5164
5215
  },
5165
5216
  [n]
5166
- ), l = Y(
5217
+ ), l = q(
5167
5218
  (u) => {
5168
5219
  n((p) => ({ ...p, size: u(p.size) }));
5169
5220
  },
5170
5221
  [n]
5171
- ), c = Y(
5222
+ ), c = q(
5172
5223
  (u) => {
5173
5224
  n((p) => ({ ...p, panelPosition: u(p.panelPosition) }));
5174
5225
  },
5175
5226
  [n]
5176
- ), d = Y(
5227
+ ), d = q(
5177
5228
  (u) => {
5178
5229
  n((p) => {
5179
5230
  const m = u(p.secondary);
@@ -5203,8 +5254,8 @@ function fl(e, t) {
5203
5254
  persistSecondary: d
5204
5255
  };
5205
5256
  }
5206
- const hl = ["color", "font", "spacing", "size"], gl = "color", Ke = 900;
5207
- function kl(e, t, n) {
5257
+ const ml = ["color", "font", "spacing", "size"], bl = "color", Ke = 900;
5258
+ function vl(e, t, n) {
5208
5259
  const o = e < Ke;
5209
5260
  return o ? {
5210
5261
  width: "min(calc(100vw - 16px), 500px)",
@@ -5216,201 +5267,201 @@ function kl(e, t, n) {
5216
5267
  narrow: o
5217
5268
  };
5218
5269
  }
5219
- function ot(e) {
5270
+ function rt(e) {
5220
5271
  return {
5221
5272
  color: je(ge(e)),
5222
- spacing: Nt(),
5223
- typography: Nt(),
5224
- size: Nt(),
5273
+ spacing: _t(),
5274
+ typography: _t(),
5275
+ size: _t(),
5225
5276
  secondary: Rt(e)
5226
5277
  };
5227
5278
  }
5228
- function ml({
5279
+ function wl({
5229
5280
  instanceConfig: e
5230
5281
  } = {}) {
5231
- const t = J(
5232
- () => e ?? q(),
5282
+ const t = Z(
5283
+ () => e ?? Y(),
5233
5284
  [e]
5234
- ), n = ft(), [o, r] = j(!1), [a, i] = j(!1), [l, c] = j(!1), [d, u] = j(!1), [p, m] = j(!1), h = D(null), [v, C] = j(null), [b, x] = j(gl), [g, N] = j(ln), [y, _] = j(Do), [w, f] = j(Bo), [E, S] = j(!1), V = D(null), X = D({
5285
+ ), n = ht(), [o, r] = K(!1), [a, i] = K(!1), [l, c] = K(!1), [d, u] = K(!1), [p, m] = K(!1), h = B(null), [v, C] = K(null), [b, N] = K(bl), [g, y] = K(ln), [w, _] = K(Bo), [x, f] = K(Ho), [E, S] = K(!1), O = B(null), j = B({
5235
5286
  spacing: null,
5236
5287
  font: null,
5237
5288
  size: null,
5238
5289
  color: null
5239
- }), H = D(ln);
5240
- H.current = g;
5241
- const Z = D(y);
5242
- Z.current = y;
5243
- const ie = D(null), ke = D(null), { persistColor: oe, persistSpacing: me, persistFont: De, persistSize: Ae, persistSecondary: A, persistTab: B } = fl(C, t);
5244
- W(() => {
5290
+ }), D = B(ln);
5291
+ D.current = g;
5292
+ const G = B(w);
5293
+ G.current = w;
5294
+ const ie = B(null), ke = B(null), { persistColor: oe, persistSpacing: me, persistFont: De, persistSize: Ae, persistSecondary: A, persistTab: H } = kl(C, t);
5295
+ X(() => {
5245
5296
  try {
5246
5297
  localStorage.getItem(We(t)) === "1" && r(!0);
5247
5298
  } catch {
5248
5299
  }
5249
- const M = Vo(t);
5250
- N(M), H.current = M;
5251
- const F = Ho(t);
5252
- _(F), Z.current = F, f(Fo(t)), S(window.innerWidth < Ke);
5300
+ const T = Fo(t);
5301
+ y(T), D.current = T;
5302
+ const F = jo(t);
5303
+ _(F), G.current = F, f(Ko(t)), S(window.innerWidth < Ke);
5253
5304
  }, []);
5254
5305
  const ee = R(
5255
- (M) => {
5256
- f(M), jo(M, t);
5306
+ (T) => {
5307
+ f(T), Wo(T, t);
5257
5308
  },
5258
5309
  [t]
5259
5310
  );
5260
- W(() => {
5311
+ X(() => {
5261
5312
  try {
5262
- const M = We(t);
5263
- o ? localStorage.setItem(M, "1") : localStorage.removeItem(M);
5313
+ const T = We(t);
5314
+ o ? localStorage.setItem(T, "1") : localStorage.removeItem(T);
5264
5315
  } catch {
5265
5316
  }
5266
5317
  try {
5267
- const M = Rn(t);
5268
- localStorage.setItem(M, o ? "1" : "0");
5318
+ const T = Rn(t);
5319
+ localStorage.setItem(T, o ? "1" : "0");
5269
5320
  } catch {
5270
5321
  }
5271
- }, [o, t]), W(() => {
5322
+ }, [o, t]), X(() => {
5272
5323
  if (!o) return;
5273
- function M(F) {
5324
+ function T(F) {
5274
5325
  F.key === "Escape" && (a || l || d || (F.preventDefault(), r(!1)));
5275
5326
  }
5276
- return document.addEventListener("keydown", M), () => {
5277
- document.removeEventListener("keydown", M);
5327
+ return document.addEventListener("keydown", T), () => {
5328
+ document.removeEventListener("keydown", T);
5278
5329
  };
5279
- }, [o, a, l, d]), W(() => {
5280
- const M = On(t);
5330
+ }, [o, a, l, d]), X(() => {
5331
+ const T = On(t);
5281
5332
  function F() {
5282
5333
  try {
5283
5334
  r(localStorage.getItem(We(t)) === "1");
5284
5335
  } catch {
5285
5336
  }
5286
5337
  }
5287
- return window.addEventListener(M, F), () => {
5288
- window.removeEventListener(M, F);
5338
+ return window.addEventListener(T, F), () => {
5339
+ window.removeEventListener(T, F);
5289
5340
  };
5290
- }, [t]), W(() => {
5291
- function M() {
5292
- Wo(void 0, void 0, t), C(
5341
+ }, [t]), X(() => {
5342
+ function T() {
5343
+ Yo(void 0, void 0, t), C(
5293
5344
  (F) => F ? {
5294
5345
  ...F,
5295
5346
  color: je(ge(t)),
5296
5347
  secondary: Rt(t)
5297
- } : ot(t)
5348
+ } : rt(t)
5298
5349
  );
5299
5350
  }
5300
- return window.addEventListener("color-scheme-changed", M), () => window.removeEventListener("color-scheme-changed", M);
5301
- }, [t]), W(() => {
5351
+ return window.addEventListener("color-scheme-changed", T), () => window.removeEventListener("color-scheme-changed", T);
5352
+ }, [t]), X(() => {
5302
5353
  if (!o || v) return;
5303
- const M = zn(
5354
+ const T = zn(
5304
5355
  void 0,
5305
5356
  void 0,
5306
5357
  ge(t),
5307
5358
  t
5308
5359
  );
5309
- if (M) {
5310
- it(M, t), C(M);
5360
+ if (T) {
5361
+ lt(T, t), C(T);
5311
5362
  return;
5312
5363
  }
5313
- C(ot(t));
5364
+ C(rt(t));
5314
5365
  }, [o, v, t]);
5315
- const be = R((M) => {
5316
- if (window.innerWidth < Ke || M.target.closest("button, select, option, [role='tab'], [role='button']")) return;
5317
- M.preventDefault();
5318
- const K = M.clientX, U = M.clientY, z = H.current.left, te = H.current.top, ye = V.current?.offsetWidth ?? 600;
5319
- V.current?.offsetHeight;
5320
- function le(Ne) {
5321
- const Ce = Ne.clientX - K, Lo = Ne.clientY - U, wt = yt(
5322
- te + Lo,
5366
+ const be = R((T) => {
5367
+ if (window.innerWidth < Ke || T.target.closest("button, select, option, [role='tab'], [role='button']")) return;
5368
+ T.preventDefault();
5369
+ const W = T.clientX, J = T.clientY, z = D.current.left, te = D.current.top, Ne = O.current?.offsetWidth ?? 600;
5370
+ O.current?.offsetHeight;
5371
+ function le(_e) {
5372
+ const Ce = _e.clientX - W, Io = _e.clientY - J, xt = Nt(
5373
+ te + Io,
5323
5374
  z + Ce,
5324
- ye
5375
+ Ne
5325
5376
  );
5326
- V.current && (V.current.style.top = `${wt.top}px`, V.current.style.left = `${wt.left}px`), H.current = wt;
5377
+ O.current && (O.current.style.top = `${xt.top}px`, O.current.style.left = `${xt.left}px`), D.current = xt;
5327
5378
  }
5328
5379
  function pe() {
5329
5380
  document.removeEventListener("mousemove", le), document.removeEventListener("mouseup", pe), ie.current = null;
5330
- const Ne = H.current;
5331
- N(Ne), xt(Ne, t);
5381
+ const _e = D.current;
5382
+ y(_e), yt(_e, t);
5332
5383
  }
5333
5384
  document.addEventListener("mousemove", le), document.addEventListener("mouseup", pe), ie.current = () => {
5334
5385
  document.removeEventListener("mousemove", le), document.removeEventListener("mouseup", pe);
5335
5386
  };
5336
- }, [t]), $ = R((M) => {
5387
+ }, [t]), $ = R((T) => {
5337
5388
  if (window.innerWidth < Ke) return;
5338
- M.preventDefault(), M.stopPropagation();
5339
- const F = M.clientX, K = M.clientY, U = Z.current.width, z = Z.current.height;
5389
+ T.preventDefault(), T.stopPropagation();
5390
+ const F = T.clientX, W = T.clientY, J = G.current.width, z = G.current.height;
5340
5391
  function te(le) {
5341
- const pe = le.clientX - F, Ne = le.clientY - K, Ce = un(U + pe, z + Ne);
5342
- V.current && (V.current.style.width = `${Ce.width}px`, V.current.style.height = `${Ce.height}px`), Z.current = Ce;
5392
+ const pe = le.clientX - F, _e = le.clientY - W, Ce = un(J + pe, z + _e);
5393
+ O.current && (O.current.style.width = `${Ce.width}px`, O.current.style.height = `${Ce.height}px`), G.current = Ce;
5343
5394
  }
5344
- function ye() {
5345
- document.removeEventListener("mousemove", te), document.removeEventListener("mouseup", ye), ke.current = null;
5346
- const le = Z.current;
5395
+ function Ne() {
5396
+ document.removeEventListener("mousemove", te), document.removeEventListener("mouseup", Ne), ke.current = null;
5397
+ const le = G.current;
5347
5398
  _(le), dn(le, t);
5348
- const pe = yt(
5349
- H.current.top,
5350
- H.current.left,
5399
+ const pe = Nt(
5400
+ D.current.top,
5401
+ D.current.left,
5351
5402
  le.width,
5352
5403
  le.height
5353
5404
  );
5354
- (pe.top !== H.current.top || pe.left !== H.current.left) && (N(pe), xt(pe, t));
5405
+ (pe.top !== D.current.top || pe.left !== D.current.left) && (y(pe), yt(pe, t));
5355
5406
  }
5356
- document.addEventListener("mousemove", te), document.addEventListener("mouseup", ye), ke.current = () => {
5357
- document.removeEventListener("mousemove", te), document.removeEventListener("mouseup", ye);
5407
+ document.addEventListener("mousemove", te), document.addEventListener("mouseup", Ne), ke.current = () => {
5408
+ document.removeEventListener("mousemove", te), document.removeEventListener("mouseup", Ne);
5358
5409
  };
5359
5410
  }, [t]);
5360
- W(() => () => {
5411
+ X(() => () => {
5361
5412
  ie.current?.(), ke.current?.();
5362
- }, []), W(() => {
5363
- function M() {
5364
- S(window.innerWidth < Ke), _((K) => {
5365
- const U = un(K.width, K.height);
5366
- return (U.width !== K.width || U.height !== K.height) && dn(U, t), U;
5413
+ }, []), X(() => {
5414
+ function T() {
5415
+ S(window.innerWidth < Ke), _((W) => {
5416
+ const J = un(W.width, W.height);
5417
+ return (J.width !== W.width || J.height !== W.height) && dn(J, t), J;
5367
5418
  });
5368
- const F = V.current?.offsetWidth ?? 600;
5369
- V.current?.offsetHeight, N((K) => {
5370
- const U = yt(K.top, K.left, F);
5371
- return xt(U, t), U;
5419
+ const F = O.current?.offsetWidth ?? 600;
5420
+ O.current?.offsetHeight, y((W) => {
5421
+ const J = Nt(W.top, W.left, F);
5422
+ return yt(J, t), J;
5372
5423
  });
5373
5424
  }
5374
- return window.addEventListener("resize", M), () => window.removeEventListener("resize", M);
5425
+ return window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
5375
5426
  }, [t]);
5376
5427
  const I = R(
5377
- (M) => {
5378
- it(M, t), In(M, void 0, t), C(M);
5428
+ (T) => {
5429
+ lt(T, t), In(T, void 0, t), C(T);
5379
5430
  },
5380
5431
  [t]
5381
5432
  ), re = R(() => {
5382
- sn(void 0, t), cn(void 0, t), C(ot(t));
5433
+ sn(void 0, t), cn(void 0, t), C(rt(t));
5383
5434
  }, [t]), Q = R(() => {
5384
- sn(void 0, t), cn(void 0, t), C(ot(t));
5385
- }, [t]), O = J(() => t.tabs.map((M) => ({ id: M.id, label: M.label })), [t]), G = J(() => {
5386
- const M = {};
5435
+ sn(void 0, t), cn(void 0, t), C(rt(t));
5436
+ }, [t]), V = Z(() => t.tabs.map((T) => ({ id: T.id, label: T.label })), [t]), U = Z(() => {
5437
+ const T = {};
5387
5438
  for (const F of t.tabs)
5388
- M[F.id] = F;
5389
- return M;
5390
- }, []), ce = R(
5391
- (M) => {
5392
- const F = O.findIndex((z) => z.id === b);
5439
+ T[F.id] = F;
5440
+ return T;
5441
+ }, [t]), ce = R(
5442
+ (T) => {
5443
+ const F = V.findIndex((z) => z.id === b);
5393
5444
  if (F === -1) return;
5394
- let K = null;
5395
- if (M.key === "ArrowRight" ? K = (F + 1) % O.length : M.key === "ArrowLeft" ? K = (F - 1 + O.length) % O.length : M.key === "Home" ? K = 0 : M.key === "End" && (K = O.length - 1), K === null) return;
5396
- M.preventDefault();
5397
- const U = O[K];
5398
- x(U.id), window.requestAnimationFrame(() => {
5399
- X.current[U.id]?.focus();
5445
+ let W = null;
5446
+ if (T.key === "ArrowRight" ? W = (F + 1) % V.length : T.key === "ArrowLeft" ? W = (F - 1 + V.length) % V.length : T.key === "Home" ? W = 0 : T.key === "End" && (W = V.length - 1), W === null) return;
5447
+ T.preventDefault();
5448
+ const J = V[W];
5449
+ N(J.id), window.requestAnimationFrame(() => {
5450
+ j.current[J.id]?.focus();
5400
5451
  });
5401
5452
  },
5402
- [b, O]
5453
+ [b, V]
5403
5454
  );
5404
- return /* @__PURE__ */ s(_i, { children: /* @__PURE__ */ s(Xi, { children: /* @__PURE__ */ s(Gi, { children: o && (() => {
5455
+ return /* @__PURE__ */ s(Ei, { children: /* @__PURE__ */ s(Gi, { children: /* @__PURE__ */ s(Zi, { children: o && (() => {
5405
5456
  const {
5406
- width: M,
5457
+ width: T,
5407
5458
  height: F,
5408
- narrow: K
5409
- } = kl(
5459
+ narrow: W
5460
+ } = vl(
5410
5461
  typeof window < "u" ? window.innerWidth : 1024,
5411
5462
  typeof window < "u" ? window.innerHeight : 768,
5412
- y
5413
- ), U = K || E ? {
5463
+ w
5464
+ ), J = W || E ? {
5414
5465
  position: "fixed",
5415
5466
  top: 16,
5416
5467
  left: "50%",
@@ -5421,24 +5472,24 @@ function ml({
5421
5472
  /* @__PURE__ */ k(
5422
5473
  "div",
5423
5474
  {
5424
- ref: V,
5475
+ ref: O,
5425
5476
  className: "tokenpanel-shell",
5426
5477
  style: {
5427
- ...U,
5428
- width: M,
5478
+ ...J,
5479
+ width: T,
5429
5480
  height: F,
5430
5481
  maxHeight: "calc(100vh - 32px)",
5431
5482
  // `--tokenpanel-grid-min` is read by .tokenpanel-tab-grid /
5432
5483
  // .tokenpanel-tab-advanced-grid; switching the variable rewires the
5433
5484
  // min-card-width without re-rendering the grids.
5434
- "--tokenpanel-grid-min": Ko(w)
5485
+ "--tokenpanel-grid-min": Xo(x)
5435
5486
  },
5436
5487
  children: [
5437
5488
  /* @__PURE__ */ k(
5438
5489
  "div",
5439
5490
  {
5440
5491
  className: "tokenpanel-header",
5441
- style: { cursor: K || E ? "default" : "move" },
5492
+ style: { cursor: W || E ? "default" : "move" },
5442
5493
  onMouseDown: be,
5443
5494
  children: [
5444
5495
  /* @__PURE__ */ s("span", { className: "tokenpanel-title", children: "Design Tokens" }),
@@ -5468,7 +5519,7 @@ function ml({
5468
5519
  ),
5469
5520
  /* @__PURE__ */ s(Se, { onClick: re, className: "tokenpanel-action-link", children: "Reset" }),
5470
5521
  /* @__PURE__ */ s("div", { className: "tokenpanel-spacer" }),
5471
- /* @__PURE__ */ s(Yi, {}),
5522
+ /* @__PURE__ */ s(Ui, {}),
5472
5523
  /* @__PURE__ */ s(
5473
5524
  "div",
5474
5525
  {
@@ -5539,20 +5590,20 @@ function ml({
5539
5590
  role: "tablist",
5540
5591
  "aria-label": "Design token categories",
5541
5592
  className: "tokenpanel-tabbar-tabs",
5542
- children: O.map((z) => {
5593
+ children: V.map((z) => {
5543
5594
  const te = b === z.id;
5544
5595
  return /* @__PURE__ */ s(
5545
5596
  "div",
5546
5597
  {
5547
- ref: (ye) => {
5548
- X.current[z.id] = ye;
5598
+ ref: (Ne) => {
5599
+ j.current[z.id] = Ne;
5549
5600
  },
5550
5601
  role: "tab",
5551
5602
  id: `dtp-tab-${n}-${z.id}`,
5552
5603
  "aria-selected": te,
5553
5604
  "aria-controls": `dtp-panel-${n}-${z.id}`,
5554
5605
  tabIndex: te ? 0 : -1,
5555
- onClick: () => x(z.id),
5606
+ onClick: () => N(z.id),
5556
5607
  onKeyDown: ce,
5557
5608
  className: te ? "tokenpanel-tab-button is-active" : "tokenpanel-tab-button",
5558
5609
  children: z.label
@@ -5580,7 +5631,7 @@ function ml({
5580
5631
  min: 0,
5581
5632
  max: 2,
5582
5633
  step: 1,
5583
- value: w,
5634
+ value: x,
5584
5635
  onInput: (z) => {
5585
5636
  const te = Number(z.currentTarget.value);
5586
5637
  (te === 0 || te === 1 || te === 2) && ee(te);
@@ -5591,8 +5642,8 @@ function ml({
5591
5642
  )
5592
5643
  ] })
5593
5644
  ] }),
5594
- /* @__PURE__ */ s("div", { className: "tokenpanel-body", children: O.map((z) => {
5595
- const te = b === z.id, ye = hl.includes(z.id);
5645
+ /* @__PURE__ */ s("div", { className: "tokenpanel-body", children: V.map((z) => {
5646
+ const te = b === z.id, Ne = ml.includes(z.id);
5596
5647
  return /* @__PURE__ */ k(
5597
5648
  "div",
5598
5649
  {
@@ -5602,52 +5653,52 @@ function ml({
5602
5653
  tabIndex: 0,
5603
5654
  hidden: !te,
5604
5655
  children: [
5605
- z.id === "color" && v && G.color && /* @__PURE__ */ s(
5606
- Zi,
5656
+ z.id === "color" && v && U.color && /* @__PURE__ */ s(
5657
+ tl,
5607
5658
  {
5608
- tab: G.color,
5659
+ tab: U.color,
5609
5660
  state: v.color,
5610
5661
  persistColor: oe,
5611
- secondaryTab: G["color-secondary"] ?? null,
5662
+ secondaryTab: U["color-secondary"] ?? null,
5612
5663
  secondaryState: v.secondary ?? Rt(t) ?? null,
5613
5664
  persistSecondary: A
5614
5665
  }
5615
5666
  ),
5616
- z.id === "spacing" && v && G.spacing && /* @__PURE__ */ s(
5617
- sl,
5667
+ z.id === "spacing" && v && U.spacing && /* @__PURE__ */ s(
5668
+ ul,
5618
5669
  {
5619
- tab: G.spacing,
5670
+ tab: U.spacing,
5620
5671
  state: v.spacing,
5621
5672
  persistSpacing: me
5622
5673
  }
5623
5674
  ),
5624
- z.id === "font" && v && G.font && /* @__PURE__ */ s(
5625
- rl,
5675
+ z.id === "font" && v && U.font && /* @__PURE__ */ s(
5676
+ ll,
5626
5677
  {
5627
- tab: G.font,
5678
+ tab: U.font,
5628
5679
  state: v.typography,
5629
5680
  persistFont: De
5630
5681
  }
5631
5682
  ),
5632
- z.id === "size" && v && G.size && /* @__PURE__ */ s(
5633
- il,
5683
+ z.id === "size" && v && U.size && /* @__PURE__ */ s(
5684
+ cl,
5634
5685
  {
5635
- tab: G.size,
5686
+ tab: U.size,
5636
5687
  state: v.size,
5637
5688
  persistSize: Ae
5638
5689
  }
5639
5690
  ),
5640
- !ye && G[z.id] && v && /* @__PURE__ */ s(
5641
- pl,
5691
+ !Ne && U[z.id] && v && /* @__PURE__ */ s(
5692
+ gl,
5642
5693
  {
5643
- tab: G[z.id],
5694
+ tab: U[z.id],
5644
5695
  overrides: v.tabs?.[z.id] ?? {},
5645
- onChange: (le, pe, Ne) => {
5646
- B(z.id, (Ce) => ({
5696
+ onChange: (le, pe, _e) => {
5697
+ H(z.id, (Ce) => ({
5647
5698
  ...Ce,
5648
5699
  [le]: {
5649
5700
  ...Ce[le] ?? {},
5650
- [pe]: Ne
5701
+ [pe]: _e
5651
5702
  }
5652
5703
  }));
5653
5704
  }
@@ -5658,7 +5709,7 @@ function ml({
5658
5709
  z.id
5659
5710
  );
5660
5711
  }) }),
5661
- !(K || E) && /* @__PURE__ */ s(
5712
+ !(W || E) && /* @__PURE__ */ s(
5662
5713
  "div",
5663
5714
  {
5664
5715
  className: "tokenpanel-resize-handle",
@@ -5671,7 +5722,7 @@ function ml({
5671
5722
  }
5672
5723
  ),
5673
5724
  a && v && /* @__PURE__ */ s(
5674
- hr,
5725
+ mr,
5675
5726
  {
5676
5727
  onClose: () => i(!1),
5677
5728
  state: v,
@@ -5680,7 +5731,7 @@ function ml({
5680
5731
  }
5681
5732
  ),
5682
5733
  l && v && /* @__PURE__ */ s(
5683
- gr,
5734
+ br,
5684
5735
  {
5685
5736
  onClose: () => c(!1),
5686
5737
  onLoad: I,
@@ -5689,7 +5740,7 @@ function ml({
5689
5740
  }
5690
5741
  ),
5691
5742
  d && v && /* @__PURE__ */ s(
5692
- yr,
5743
+ $r,
5693
5744
  {
5694
5745
  state: v,
5695
5746
  open: d,
@@ -5700,7 +5751,7 @@ function ml({
5700
5751
  }
5701
5752
  ),
5702
5753
  p && /* @__PURE__ */ s(
5703
- Ga,
5754
+ Za,
5704
5755
  {
5705
5756
  anchorRef: h,
5706
5757
  onClose: () => m(!1)
@@ -5709,66 +5760,66 @@ function ml({
5709
5760
  ] });
5710
5761
  })() }) }) });
5711
5762
  }
5712
- const bl = ':where(.tokenpanel-shell,[data-design-token-panel-modal],.tokenpanel-highlight-settings-popover,.tokenpanel-color-picker,.tokenpanel-tooltip,.tokenpanel-elpath-label,.tokenpanel-elpath-toast){--tokentweak-color-fg: #b8b8b8;--tokentweak-color-bg: #181818;--tokentweak-color-muted: #888888;--tokentweak-color-surface: #1c1c1c;--tokentweak-color-accent: #d69a66;--tokentweak-color-accent-hover: #a7c0e3;--tokentweak-color-code-bg: #383838;--tokentweak-color-code-fg: #e0e0e0;--tokentweak-color-success: #93bb77;--tokentweak-color-danger: #da6871;--tokentweak-color-warning: #dfbb77;--tokentweak-font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--tokentweak-pad-2xs: .125rem;--tokentweak-pad-xs: .375rem;--tokentweak-pad-sm: .5rem;--tokentweak-pad-md: .75rem;--tokentweak-pad-lg: 1rem;--tokentweak-pad-xl: 1.5rem;--tokentweak-pad-2xl: 2rem;--tokentweak-gap-2xs: .4375rem;--tokentweak-gap-xs: .875rem;--tokentweak-gap-sm: 1.25rem;--tokentweak-gap-md: 1.5rem;--tokentweak-gap-lg: 1.75rem;--tokentweak-gap-xl: 2.5rem;--tokentweak-gap-2xl: 3.5rem;--tokentweak-text-micro: .75rem;--tokentweak-text-caption: .875rem;--tokentweak-text-small: 1rem;--tokentweak-text-body: 1.2rem;--tokentweak-text-subheading: 1.4rem;--tokentweak-text-heading: 3rem;--tokentweak-text-display: 3.75rem;--radius-tokentweak: .25rem}.tokenpanel-color-picker{position:fixed;width:320px;padding:var(--tokentweak-pad-md);background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);box-shadow:0 8px 24px #0006;display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs);z-index:70;color:var(--tokentweak-color-fg);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker[data-mode-shell=expanded]{width:520px;padding:var(--tokentweak-pad-lg);gap:var(--tokentweak-gap-xs)}.tokenpanel-color-picker-header{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-drag-handle{flex-shrink:0;cursor:grab;color:var(--tokentweak-color-muted);font-size:var(--tokentweak-text-caption);line-height:1;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-drag-handle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-drag-handle:active{cursor:grabbing}.tokenpanel-color-picker-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker-mode-toggle{display:flex;align-items:center;gap:2px;background:var(--tokentweak-color-bg);border:1px solid var(--tokentweak-color-muted);border-radius:999px;padding:2px;flex-shrink:0}.tokenpanel-color-picker-mode-btn{border-radius:999px;padding-inline:var(--tokentweak-pad-xs);padding-block:var(--tokentweak-pad-2xs);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .12s ease,color .12s ease;white-space:nowrap}.tokenpanel-color-picker-mode-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn[aria-pressed=true]{background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-expand-btn{flex-shrink:0;color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);transition:color .12s ease}.tokenpanel-color-picker-expand-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-expand-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-top-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-preview{position:relative;flex-shrink:0;width:3rem;height:3rem;border-radius:var(--radius-tokentweak);border:1px solid var(--tokentweak-color-muted);overflow:hidden}.tokenpanel-color-picker-preview-checkerboard{position:absolute;inset:0;background-image:repeating-conic-gradient(gray 0% 25%,silver 0% 50%);background-size:10px 10px}.tokenpanel-color-picker-preview-color{position:absolute;inset:0}.tokenpanel-color-picker-hex-input{flex:1;min-width:0;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption);background:var(--tokentweak-color-bg);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding:var(--tokentweak-pad-2xs) var(--tokentweak-pad-xs);transition:border-color .12s ease}.tokenpanel-color-picker-hex-input:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-hex-input:focus{border-color:var(--tokentweak-color-accent);outline:none}.tokenpanel-color-picker-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:2px}.tokenpanel-color-picker-grid>[role=row]{display:contents}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-grid{grid-template-columns:repeat(12,1fr)}.tokenpanel-color-picker-grid-cell{position:relative;aspect-ratio:1;border-radius:var(--radius-tokentweak);cursor:pointer;transition:box-shadow .12s ease}.tokenpanel-color-picker-grid-cell:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-color-picker-grid-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-color-picker-grid-cell:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-grid-cell[data-oog=true]:after{content:"";position:absolute;inset:1px;border:1px dashed oklch(98% 0 0 / .4);border-radius:var(--radius-tokentweak);pointer-events:none}.tokenpanel-color-picker-sliders{display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-label{flex-shrink:0;width:1.25rem;font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);-webkit-user-select:none;user-select:none}.tokenpanel-color-picker-slider{flex:1;position:relative;height:18px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-slider:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:var(--radius-tokentweak)}.tokenpanel-color-picker-slider-track{width:100%;height:18px;border-radius:9px;overflow:hidden;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-color-picker-slider-thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--tokentweak-color-fg);border:2px solid var(--tokentweak-color-bg);box-shadow:0 0 0 1px var(--tokentweak-color-muted);pointer-events:none}.tokenpanel-color-picker-slider-value{flex-shrink:0;width:3rem;text-align:right;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-readout{display:none;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);padding-top:var(--tokentweak-pad-2xs);border-top:1px solid var(--tokentweak-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-readout{display:block}.tokenpanel-shell{z-index:50;display:flex;flex-direction:column;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);border-radius:var(--radius-tokentweak);box-shadow:0 4px 24px #00000040}.tokenpanel-resize-handle{position:absolute;right:2px;bottom:2px;width:16px;height:16px;cursor:nwse-resize;-webkit-user-select:none;user-select:none;background-image:repeating-linear-gradient(-45deg,transparent 0,transparent 2px,var(--tokentweak-color-muted) 2px,var(--tokentweak-color-muted) 3px);-webkit-mask-image:linear-gradient(135deg,transparent 50%,#000 50%);mask-image:linear-gradient(135deg,transparent 50%,#000 50%);border-bottom-right-radius:var(--radius-tokentweak);transition:opacity .15s ease;opacity:.7}.tokenpanel-resize-handle:hover,.tokenpanel-resize-handle:focus-visible{opacity:1}.tokenpanel-header{display:flex;align-items:center;gap:var(--tokentweak-pad-md);padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-xs);border-bottom:1px solid var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-title{color:var(--tokentweak-color-fg);font-weight:600;font-size:.875rem;flex-shrink:0}.tokenpanel-action-link{color:var(--tokentweak-color-accent);font-size:.75rem;background:none;border:none;padding:0;cursor:pointer;transition:color .15s ease}.tokenpanel-action-link:hover{color:var(--tokentweak-color-accent-hover)}.tokenpanel-spacer{flex:1}.tokenpanel-close-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-close-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-tabbar{display:flex;align-items:center;border-bottom:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-xl);flex-shrink:0;gap:var(--tokentweak-pad-md)}.tokenpanel-tabbar-tabs{display:flex;align-items:center;gap:2px;flex:1;min-width:0}.tokenpanel-tab-button{border:none;background:none;padding-inline:var(--tokentweak-pad-md);padding-block:var(--tokentweak-gap-xs);font-size:.875rem;cursor:pointer;border-bottom:2px solid transparent;color:var(--tokentweak-color-muted);transition:color .15s ease,border-color .15s ease}.tokenpanel-tab-button:hover,.tokenpanel-tab-button:focus-visible{color:var(--tokentweak-color-fg);text-decoration:underline}.tokenpanel-tab-button.is-active{color:var(--tokentweak-color-fg);border-bottom-color:var(--tokentweak-color-accent);text-decoration:none}.tokenpanel-density{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);flex-shrink:0}.tokenpanel-density-label{color:var(--tokentweak-color-muted);font-size:.6875rem;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;cursor:pointer}.tokenpanel-density-slider{width:5rem;accent-color:var(--tokentweak-color-accent);cursor:pointer}.tokenpanel-body{flex:1;min-height:0;overflow-y:auto;padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-sm)}.tokenpanel-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:12rem;padding-block:var(--tokentweak-gap-md);padding-inline:var(--tokentweak-pad-xl)}.tokenpanel-empty-state-text{color:var(--tokentweak-color-muted, #a8a8a8);font-size:.8125rem;line-height:1.5;max-width:32rem;margin:0}.tokenpanel-empty-state-text code{font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:.8125rem;color:var(--tokentweak-color-fg)}.tokenpanel-empty-state-link{color:var(--tokentweak-color-accent);text-decoration:underline;transition:color .15s ease}.tokenpanel-empty-state-link:hover,.tokenpanel-empty-state-link:focus-visible{color:var(--tokentweak-color-accent-hover)}.tokenpanel-tab-content{display:flex;flex-direction:column;gap:var(--tokentweak-gap-sm)}.tokenpanel-tab-actions{display:flex;align-items:center;gap:var(--tokentweak-pad-md)}.tokenpanel-tab-section{position:relative;flex-shrink:0;border:1px solid var(--tokentweak-color-muted);border-radius:.5rem;padding:18px 14px 14px}.tokenpanel-tab-section-heading{position:absolute;top:-.625rem;left:12px;background:var(--tokentweak-color-surface);padding:0 8px;margin:0;color:var(--tokentweak-color-fg);font-family:inherit;font-weight:600;font-size:.8125rem;line-height:1.25rem;text-transform:none;letter-spacing:normal}.tokenpanel-tab-section-heading--color{font-size:.875rem}.tokenpanel-tab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 18rem),1fr));gap:var(--tokentweak-gap-xs)}.tokenpanel-color-preset-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:2px;font-size:.75rem;border-radius:var(--radius-tokentweak);max-width:14rem;cursor:pointer;transition:border-color .15s ease}.tokenpanel-color-preset-select:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-palette-grid,.tokenpanel-color-palette-grid--secondary{display:grid;grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr));gap:var(--tokentweak-pad-sm)}.tokenpanel-color-base-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 11rem),1fr));gap:6px}.tokenpanel-color-swatch-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:100%}.tokenpanel-color-swatch-button{display:block;border:1px solid var(--tokentweak-color-muted);cursor:pointer;width:3.5rem;height:3.5rem;border-radius:var(--radius-tokentweak);background:none;padding:0;transition:border-color .15s ease}.tokenpanel-color-swatch-button:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-swatch-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-swatch-label-row{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}.tokenpanel-color-swatch-label{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.6875rem;line-height:1.1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-tooltip{position:fixed;z-index:9999;pointer-events:none;background:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:4px;padding:4px 8px;font-family:var(--tokentweak-font-mono);font-size:11px;line-height:1.3;white-space:nowrap;box-shadow:0 4px 12px #00000080;opacity:0;transform:translateY(2px);transition:opacity 90ms ease,transform 90ms ease}.tokenpanel-tooltip[data-show=true]{opacity:1;transform:translateY(0)}.tokenpanel-popover{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:12px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-selector{position:relative;width:100%;display:flex;align-items:center;gap:6px}.tokenpanel-palette-trigger{display:flex;align-items:center;gap:4px;flex:1;min-width:0;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding-inline:6px;padding-block:4px;font-size:.75rem;border-radius:var(--radius-tokentweak);cursor:pointer;transition:border-color .15s ease}.tokenpanel-palette-trigger:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-palette-trigger:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-palette-trigger-label{flex:1;min-width:0;text-align:left;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-palette-trigger-color{flex-shrink:0;border:1px solid var(--tokentweak-color-muted);width:14px;height:14px;border-radius:2px}.tokenpanel-palette-trigger-value{flex-shrink:0;color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);width:2.5em}.tokenpanel-palette-trigger-icon{color:var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-palette-options{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:10px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-options-extras{display:flex;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-option{display:flex;align-items:center;gap:6px;padding-inline:8px;padding-block:4px;border-radius:4px;font-size:1rem;background:none;border:none;cursor:pointer;transition:background-color .15s ease}.tokenpanel-palette-extra-option:hover{background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-palette-extra-option.is-selected{background-color:rgb(from var(--tokentweak-color-accent) r g b / .2)}.tokenpanel-palette-extra-color{width:1.75rem;height:1.75rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-label{color:var(--tokentweak-color-fg)}.tokenpanel-palette-options-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.tokenpanel-palette-option-button{width:3rem;height:3rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted);cursor:pointer;padding:0;transition:box-shadow .15s ease}.tokenpanel-palette-option-button:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-palette-option-button.is-selected{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-row{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row--stacked{display:flex;flex-direction:column;gap:2px}.tokenpanel-row--column{display:flex;flex-direction:column;gap:4px}.tokenpanel-row-head{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row-label{color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);flex:1;min-width:0;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-row-input-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-row-number-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);text-align:right;font-size:.75rem;width:5rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-number-input:disabled{opacity:.6}.tokenpanel-row-number-input--invalid{border-color:#e05252;color:#e05252}.tokenpanel-row-unit{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.75rem;width:2rem}.tokenpanel-row-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;width:7rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-select:disabled{opacity:.6}.tokenpanel-row-text-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;flex:1;min-width:0;border-radius:var(--radius-tokentweak)}.tokenpanel-row-text-input:disabled{opacity:.6}.tokenpanel-pill-toggle{display:flex;align-items:center;gap:var(--tokentweak-pad-xs);flex-shrink:0;cursor:pointer}.tokenpanel-pill-toggle-checkbox{accent-color:var(--tokentweak-color-accent)}.tokenpanel-pill-toggle-text{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);font-size:.75rem}[data-design-token-panel-modal]{margin-inline:auto;width:100%;max-width:46rem;max-height:80vh;overflow-y:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);padding:var(--tokentweak-pad-xl);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-user-select:text;user-select:text}[data-design-token-panel-modal]::backdrop{background-color:rgb(from var(--tokentweak-color-bg) r g b / .8)}[data-design-token-panel-modal] [class*=__header]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--tokentweak-pad-md);margin-bottom:var(--tokentweak-gap-sm)}[data-design-token-panel-modal] [class*=__title]{font-size:var(--tokentweak-text-subheading);font-weight:700;color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__hint]{font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-muted);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__section-heading]{font-size:var(--tokentweak-text-small);font-weight:700;color:var(--tokentweak-color-fg);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__list]:not([class*=__list-item]){overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__list-item]{font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__actions]{display:flex;align-items:center;gap:var(--tokentweak-pad-md);margin-top:var(--tokentweak-gap-md)}[data-design-token-panel-modal] [class*=__toggle]{display:inline-flex;align-items:center;gap:var(--tokentweak-pad-xs);font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-fg);cursor:pointer;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__textarea]{width:100%;min-height:12rem;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-small);resize:vertical;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__json]{overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);white-space:pre;font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__status]{font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__status--info]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__status--error]{color:var(--tokentweak-color-danger)}[data-design-token-panel-modal] [class*=__status--warning]{color:var(--tokentweak-color-warning)}[data-design-token-panel-modal] [class*=__status--success]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__applying]{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-muted);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small)}[data-design-token-panel-modal] [class*=__spinner]{display:inline-block;width:1rem;height:1rem;border:2px solid var(--tokentweak-color-muted);border-top-color:var(--tokentweak-color-fg);border-radius:50%;animation:design-token-panel-modal-spin .75s linear infinite}@keyframes design-token-panel-modal-spin{to{transform:rotate(360deg)}}[data-design-token-panel-modal] [class*=__revert-hint]{font-size:var(--tokentweak-text-small);font-style:italic;color:var(--tokentweak-color-muted);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-lg);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}[data-design-token-panel-modal] [class*=__button]:hover,[data-design-token-panel-modal] [class*=__button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__button]:disabled{cursor:not-allowed;opacity:.5}[data-design-token-panel-modal] [class*=__button--primary]{border-color:var(--tokentweak-color-accent);background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__button--primary]:hover,[data-design-token-panel-modal] [class*=__button--primary]:focus-visible{border-color:var(--tokentweak-color-accent-hover);background-color:var(--tokentweak-color-accent-hover);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__close-button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease}[data-design-token-panel-modal] [class*=__close-button]:hover,[data-design-token-panel-modal] [class*=__close-button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}.tokenpanel-tier-ref-selector{flex:1;min-width:0}select.tokenpanel-tier-ref-select{width:100%;background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding-inline:var(--tokentweak-pad-sm);padding-block:4px;font-family:var(--tokentweak-font-mono);font-size:.75rem;cursor:pointer}select.tokenpanel-tier-ref-select:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-row-label-sub{display:block;font-size:var(--tokentweak-text-micro, .6875rem);color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);line-height:1.2}.tokenpanel-tab-section [role=heading]{display:block}.tokenpanel-code{font-family:var(--tokentweak-font-mono);font-size:inherit;background:none;color:inherit;padding:0;border:none;border-radius:0;white-space:pre-wrap}[data-design-token-panel-modal] [class*=__button][aria-disabled=true]{cursor:not-allowed;opacity:.5;pointer-events:none}[data-design-token-panel-modal] [role=button]:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-action-link:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-close-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-tab-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-overlay{margin:0;padding:0;border:0;background:transparent;display:block}.tokenpanel-highlight-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;color:var(--tokentweak-color-muted);cursor:pointer;vertical-align:middle;border-radius:2px;transition:background-color .15s ease,color .15s ease}.tokenpanel-highlight-toggle:hover{color:var(--tokentweak-color-fg);background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-highlight-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-toggle.is-active{opacity:1}:where(.tokenpanel-shell) svg{fill:currentColor;pointer-events:none;display:inline-block;overflow:visible}:where(.tokenpanel-shell) .tokenpanel-highlight-toggle svg{fill:none;stroke:currentColor}.tokenpanel-highlight-settings-popover{width:370px;background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:6px;box-shadow:0 8px 32px #00000080}.tokenpanel-highlight-settings-header{padding:10px 16px;border-bottom:1px solid var(--tokentweak-color-muted);font-weight:600;font-size:.8125rem;color:var(--tokentweak-color-fg);display:flex;align-items:center;justify-content:space-between;gap:12px}.tokenpanel-highlight-settings-header-label{flex:1;min-width:0}.tokenpanel-highlight-settings-outline-control{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-highlight-settings-outline-input{width:44px;background:#222;border:1px solid var(--tokentweak-color-muted);border-radius:3px;color:var(--tokentweak-color-fg);font-size:12px;font-variant-numeric:tabular-nums;padding:3px 6px;text-align:right}.tokenpanel-highlight-settings-outline-px{color:var(--tokentweak-color-muted);font-size:12px;font-weight:400}.tokenpanel-highlight-settings-list{padding:4px 0;display:grid;grid-template-columns:1fr 1fr}.tokenpanel-highlight-settings-row{display:grid;grid-template-columns:22px 32px 1fr;gap:8px;align-items:center;padding:8px 12px}.tokenpanel-highlight-settings-row:hover{background:#ffffff08}.tokenpanel-highlight-settings-num{color:var(--tokentweak-color-muted);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.tokenpanel-highlight-settings-ring{width:28px;height:28px;border-radius:3px;background:transparent;box-sizing:border-box;cursor:pointer;flex-shrink:0}.tokenpanel-highlight-settings-ring:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-highlight-settings-name{font-family:var(--tokentweak-font-mono);font-size:12px;color:var(--tokentweak-color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-highlight-settings-name.is-active{color:var(--tokentweak-color-fg)}.tokenpanel-highlight-settings-footer{padding:12px 16px;border-top:1px solid var(--tokentweak-color-muted);display:flex;justify-content:flex-end;gap:var(--tokentweak-pad-sm)}.tokenpanel-highlight-settings-reset-btn{padding:6px 12px;background:#333;border:1px solid var(--tokentweak-color-muted);border-radius:3px;cursor:pointer;font-size:12px;color:var(--tokentweak-color-fg);transition:background .15s ease}.tokenpanel-highlight-settings-reset-btn:hover{background:#404040}.tokenpanel-highlight-settings-reset-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:3px}.tokenpanel-gear-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-gear-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-gear-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-elpath-toggle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-elpath-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle.is-active{color:var(--tokentweak-color-accent)}:where(.tokenpanel-shell) .tokenpanel-elpath-toggle svg{fill:none;stroke:currentColor}html.tokenpanel-elpath-inspecting,html.tokenpanel-elpath-inspecting *{cursor:crosshair!important;-webkit-user-select:none!important;user-select:none!important}.tokenpanel-elpath-box{margin:0;padding:0;border:0;pointer-events:none;box-sizing:border-box;background:#6fa8dc40;outline:1px solid rgb(111 168 220 / .9);outline-offset:-1px;box-shadow:inset 0 0 0 1px #6fa8dce6}.tokenpanel-elpath-label{pointer-events:none;display:inline-flex;align-items:baseline;gap:8px;max-width:90vw;padding:2px 6px;border-radius:3px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 1px 3px #0006}.tokenpanel-elpath-label-name{color:var(--tokentweak-color-accent, #d69a66);font-weight:600;overflow:hidden;text-overflow:ellipsis}.tokenpanel-elpath-label-size{color:var(--tokentweak-color-muted, #888888);flex-shrink:0}.tokenpanel-elpath-toast{pointer-events:none;display:inline-flex;align-items:center;gap:8px;margin:12px auto 0;padding:8px 14px;border-radius:6px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:12px;line-height:1.4;max-width:min(90vw,520px);box-shadow:0 4px 16px #00000073;border:1px solid rgb(255 255 255 / .08)}.tokenpanel-elpath-toast .tokenpanel-elpath-toast-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-elpath-toast svg{flex-shrink:0;fill:none;stroke:var(--tokentweak-color-success, #93bb77);pointer-events:none;display:inline-block;overflow:visible}.tokenpanel-elpath-toast.is-error svg{stroke:var(--tokentweak-color-danger, #da6871)}';
5713
- function Il(e) {
5763
+ const xl = ':where(.tokenpanel-shell,[data-design-token-panel-modal],.tokenpanel-highlight-settings-popover,.tokenpanel-color-picker,.tokenpanel-tooltip,.tokenpanel-elpath-label,.tokenpanel-elpath-toast){--tokentweak-color-fg: #b8b8b8;--tokentweak-color-bg: #181818;--tokentweak-color-muted: #888888;--tokentweak-color-surface: #1c1c1c;--tokentweak-color-accent: #d69a66;--tokentweak-color-accent-hover: #a7c0e3;--tokentweak-color-code-bg: #383838;--tokentweak-color-code-fg: #e0e0e0;--tokentweak-color-success: #93bb77;--tokentweak-color-danger: #da6871;--tokentweak-color-warning: #dfbb77;--tokentweak-font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--tokentweak-pad-2xs: .125rem;--tokentweak-pad-xs: .375rem;--tokentweak-pad-sm: .5rem;--tokentweak-pad-md: .75rem;--tokentweak-pad-lg: 1rem;--tokentweak-pad-xl: 1.5rem;--tokentweak-pad-2xl: 2rem;--tokentweak-gap-2xs: .4375rem;--tokentweak-gap-xs: .875rem;--tokentweak-gap-sm: 1.25rem;--tokentweak-gap-md: 1.5rem;--tokentweak-gap-lg: 1.75rem;--tokentweak-gap-xl: 2.5rem;--tokentweak-gap-2xl: 3.5rem;--tokentweak-text-micro: .75rem;--tokentweak-text-caption: .875rem;--tokentweak-text-small: 1rem;--tokentweak-text-body: 1.2rem;--tokentweak-text-subheading: 1.4rem;--tokentweak-text-heading: 3rem;--tokentweak-text-display: 3.75rem;--radius-tokentweak: .25rem}.tokenpanel-color-picker{position:fixed;width:320px;padding:var(--tokentweak-pad-md);background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);box-shadow:0 8px 24px #0006;display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs);z-index:70;color:var(--tokentweak-color-fg);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker[data-mode-shell=expanded]{width:520px;padding:var(--tokentweak-pad-lg);gap:var(--tokentweak-gap-xs)}.tokenpanel-color-picker-header{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-drag-handle{flex-shrink:0;cursor:grab;color:var(--tokentweak-color-muted);font-size:var(--tokentweak-text-caption);line-height:1;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-drag-handle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-drag-handle:active{cursor:grabbing}.tokenpanel-color-picker-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker-mode-toggle{display:flex;align-items:center;gap:2px;background:var(--tokentweak-color-bg);border:1px solid var(--tokentweak-color-muted);border-radius:999px;padding:2px;flex-shrink:0}.tokenpanel-color-picker-mode-btn{border-radius:999px;padding-inline:var(--tokentweak-pad-xs);padding-block:var(--tokentweak-pad-2xs);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .12s ease,color .12s ease;white-space:nowrap}.tokenpanel-color-picker-mode-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn[aria-pressed=true]{background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-expand-btn{flex-shrink:0;color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);transition:color .12s ease}.tokenpanel-color-picker-expand-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-expand-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-top-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-preview{position:relative;flex-shrink:0;width:3rem;height:3rem;border-radius:var(--radius-tokentweak);border:1px solid var(--tokentweak-color-muted);overflow:hidden}.tokenpanel-color-picker-preview-checkerboard{position:absolute;inset:0;background-image:repeating-conic-gradient(gray 0% 25%,silver 0% 50%);background-size:10px 10px}.tokenpanel-color-picker-preview-color{position:absolute;inset:0}.tokenpanel-color-picker-hex-input{flex:1;min-width:0;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption);background:var(--tokentweak-color-bg);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding:var(--tokentweak-pad-2xs) var(--tokentweak-pad-xs);transition:border-color .12s ease}.tokenpanel-color-picker-hex-input:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-hex-input:focus{border-color:var(--tokentweak-color-accent);outline:none}.tokenpanel-color-picker-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:2px}.tokenpanel-color-picker-grid>[role=row]{display:contents}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-grid{grid-template-columns:repeat(12,1fr)}.tokenpanel-color-picker-grid-cell{position:relative;aspect-ratio:1;border-radius:var(--radius-tokentweak);cursor:pointer;transition:box-shadow .12s ease}.tokenpanel-color-picker-grid-cell:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-color-picker-grid-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-color-picker-grid-cell:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-grid-cell[data-oog=true]:after{content:"";position:absolute;inset:1px;border:1px dashed oklch(98% 0 0 / .4);border-radius:var(--radius-tokentweak);pointer-events:none}.tokenpanel-color-picker-sliders{display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-label{flex-shrink:0;width:1.25rem;font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);-webkit-user-select:none;user-select:none}.tokenpanel-color-picker-slider{flex:1;position:relative;height:18px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-slider:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:var(--radius-tokentweak)}.tokenpanel-color-picker-slider-track{width:100%;height:18px;border-radius:9px;overflow:hidden;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-color-picker-slider-thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--tokentweak-color-fg);border:2px solid var(--tokentweak-color-bg);box-shadow:0 0 0 1px var(--tokentweak-color-muted);pointer-events:none}.tokenpanel-color-picker-slider-value{flex-shrink:0;width:3rem;text-align:right;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-readout{display:none;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);padding-top:var(--tokentweak-pad-2xs);border-top:1px solid var(--tokentweak-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-readout{display:block}.tokenpanel-shell{z-index:50;display:flex;flex-direction:column;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);border-radius:var(--radius-tokentweak);box-shadow:0 4px 24px #00000040}.tokenpanel-resize-handle{position:absolute;right:2px;bottom:2px;width:16px;height:16px;cursor:nwse-resize;-webkit-user-select:none;user-select:none;background-image:repeating-linear-gradient(-45deg,transparent 0,transparent 2px,var(--tokentweak-color-muted) 2px,var(--tokentweak-color-muted) 3px);-webkit-mask-image:linear-gradient(135deg,transparent 50%,#000 50%);mask-image:linear-gradient(135deg,transparent 50%,#000 50%);border-bottom-right-radius:var(--radius-tokentweak);transition:opacity .15s ease;opacity:.7}.tokenpanel-resize-handle:hover,.tokenpanel-resize-handle:focus-visible{opacity:1}.tokenpanel-header{display:flex;align-items:center;gap:var(--tokentweak-pad-md);padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-xs);border-bottom:1px solid var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-title{color:var(--tokentweak-color-fg);font-weight:600;font-size:.875rem;flex-shrink:0}.tokenpanel-action-link{color:var(--tokentweak-color-accent);font-size:.75rem;background:none;border:none;padding:0;cursor:pointer;transition:color .15s ease}.tokenpanel-action-link:hover{color:var(--tokentweak-color-accent-hover)}.tokenpanel-spacer{flex:1}.tokenpanel-close-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-close-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-tabbar{display:flex;align-items:center;border-bottom:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-xl);flex-shrink:0;gap:var(--tokentweak-pad-md)}.tokenpanel-tabbar-tabs{display:flex;align-items:center;gap:2px;flex:1;min-width:0}.tokenpanel-tab-button{border:none;background:none;padding-inline:var(--tokentweak-pad-md);padding-block:var(--tokentweak-gap-xs);font-size:.875rem;cursor:pointer;border-bottom:2px solid transparent;color:var(--tokentweak-color-muted);transition:color .15s ease,border-color .15s ease}.tokenpanel-tab-button:hover,.tokenpanel-tab-button:focus-visible{color:var(--tokentweak-color-fg);text-decoration:underline}.tokenpanel-tab-button.is-active{color:var(--tokentweak-color-fg);border-bottom-color:var(--tokentweak-color-accent);text-decoration:none}.tokenpanel-density{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);flex-shrink:0}.tokenpanel-density-label{color:var(--tokentweak-color-muted);font-size:.6875rem;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;cursor:pointer}.tokenpanel-density-slider{width:5rem;accent-color:var(--tokentweak-color-accent);cursor:pointer}.tokenpanel-body{flex:1;min-height:0;overflow-y:auto;padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-sm)}.tokenpanel-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:12rem;padding-block:var(--tokentweak-gap-md);padding-inline:var(--tokentweak-pad-xl)}.tokenpanel-empty-state-text{color:var(--tokentweak-color-muted, #a8a8a8);font-size:.8125rem;line-height:1.5;max-width:32rem;margin:0}.tokenpanel-empty-state-text code{font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:.8125rem;color:var(--tokentweak-color-fg)}.tokenpanel-empty-state-link{color:var(--tokentweak-color-accent);text-decoration:underline;transition:color .15s ease}.tokenpanel-empty-state-link:hover,.tokenpanel-empty-state-link:focus-visible{color:var(--tokentweak-color-accent-hover)}.tokenpanel-tab-content{display:flex;flex-direction:column;gap:var(--tokentweak-gap-sm)}.tokenpanel-tab-actions{display:flex;align-items:center;gap:var(--tokentweak-pad-md)}.tokenpanel-tab-section{position:relative;flex-shrink:0;border:1px solid var(--tokentweak-color-muted);border-radius:.5rem;padding:18px 14px 14px}.tokenpanel-tab-section-heading{position:absolute;top:-.625rem;left:12px;background:var(--tokentweak-color-surface);padding:0 8px;margin:0;color:var(--tokentweak-color-fg);font-family:inherit;font-weight:600;font-size:.8125rem;line-height:1.25rem;text-transform:none;letter-spacing:normal}.tokenpanel-tab-section-heading--color{font-size:.875rem}.tokenpanel-tab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 18rem),1fr));gap:var(--tokentweak-gap-xs)}.tokenpanel-color-preset-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:2px;font-size:.75rem;border-radius:var(--radius-tokentweak);max-width:14rem;cursor:pointer;transition:border-color .15s ease}.tokenpanel-color-preset-select:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-palette-grid,.tokenpanel-color-palette-grid--secondary{display:grid;grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr));gap:var(--tokentweak-pad-sm)}.tokenpanel-color-base-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 11rem),1fr));gap:6px}.tokenpanel-color-swatch-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:100%}.tokenpanel-color-swatch-button{display:block;border:1px solid var(--tokentweak-color-muted);cursor:pointer;width:3.5rem;height:3.5rem;border-radius:var(--radius-tokentweak);background:none;padding:0;transition:border-color .15s ease}.tokenpanel-color-swatch-button:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-swatch-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-swatch-label-row{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}.tokenpanel-color-swatch-label{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.6875rem;line-height:1.1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-tooltip{position:fixed;z-index:9999;pointer-events:none;background:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:4px;padding:4px 8px;font-family:var(--tokentweak-font-mono);font-size:11px;line-height:1.3;white-space:nowrap;box-shadow:0 4px 12px #00000080;opacity:0;transform:translateY(2px);transition:opacity 90ms ease,transform 90ms ease}.tokenpanel-tooltip[data-show=true]{opacity:1;transform:translateY(0)}.tokenpanel-popover{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:12px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-selector{position:relative;width:100%;display:flex;align-items:center;gap:6px}.tokenpanel-palette-trigger{display:flex;align-items:center;gap:4px;flex:1;min-width:0;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding-inline:6px;padding-block:4px;font-size:.75rem;border-radius:var(--radius-tokentweak);cursor:pointer;transition:border-color .15s ease}.tokenpanel-palette-trigger:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-palette-trigger:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-palette-trigger-label{flex:1;min-width:0;text-align:left;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-palette-trigger-color{flex-shrink:0;border:1px solid var(--tokentweak-color-muted);width:14px;height:14px;border-radius:2px}.tokenpanel-palette-trigger-value{flex-shrink:0;color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);width:2.5em}.tokenpanel-palette-trigger-icon{color:var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-palette-options{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:10px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-options-extras{display:flex;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-option{display:flex;align-items:center;gap:6px;padding-inline:8px;padding-block:4px;border-radius:4px;font-size:1rem;background:none;border:none;cursor:pointer;transition:background-color .15s ease}.tokenpanel-palette-extra-option:hover{background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-palette-extra-option.is-selected{background-color:rgb(from var(--tokentweak-color-accent) r g b / .2)}.tokenpanel-palette-extra-color{width:1.75rem;height:1.75rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-label{color:var(--tokentweak-color-fg)}.tokenpanel-palette-options-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.tokenpanel-palette-option-button{width:3rem;height:3rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted);cursor:pointer;padding:0;transition:box-shadow .15s ease}.tokenpanel-palette-option-button:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-palette-option-button.is-selected{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-row{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row--stacked{display:flex;flex-direction:column;gap:2px}.tokenpanel-row--column{display:flex;flex-direction:column;gap:4px}.tokenpanel-row-head{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row-label{color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);flex:1;min-width:0;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-row-input-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-row-number-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);text-align:right;font-size:.75rem;width:5rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-number-input:disabled{opacity:.6}.tokenpanel-row-number-input--invalid{border-color:#e05252;color:#e05252}.tokenpanel-row-unit{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.75rem;width:2rem}.tokenpanel-row-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;width:7rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-select:disabled{opacity:.6}.tokenpanel-row-text-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;flex:1;min-width:0;border-radius:var(--radius-tokentweak)}.tokenpanel-row-text-input:disabled{opacity:.6}.tokenpanel-pill-toggle{display:flex;align-items:center;gap:var(--tokentweak-pad-xs);flex-shrink:0;cursor:pointer}.tokenpanel-pill-toggle-checkbox{accent-color:var(--tokentweak-color-accent)}.tokenpanel-pill-toggle-text{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);font-size:.75rem}[data-design-token-panel-modal]{margin-inline:auto;width:100%;max-width:46rem;max-height:80vh;overflow-y:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);padding:var(--tokentweak-pad-xl);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-user-select:text;user-select:text}[data-design-token-panel-modal]::backdrop{background-color:rgb(from var(--tokentweak-color-bg) r g b / .8)}[data-design-token-panel-modal] [class*=__header]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--tokentweak-pad-md);margin-bottom:var(--tokentweak-gap-sm)}[data-design-token-panel-modal] [class*=__title]{font-size:var(--tokentweak-text-subheading);font-weight:700;color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__hint]{font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-muted);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__section-heading]{font-size:var(--tokentweak-text-small);font-weight:700;color:var(--tokentweak-color-fg);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__list]:not([class*=__list-item]){overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__list-item]{font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__actions]{display:flex;align-items:center;gap:var(--tokentweak-pad-md);margin-top:var(--tokentweak-gap-md)}[data-design-token-panel-modal] [class*=__toggle]{display:inline-flex;align-items:center;gap:var(--tokentweak-pad-xs);font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-fg);cursor:pointer;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__textarea]{width:100%;min-height:12rem;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-small);resize:vertical;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__json]{overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);white-space:pre;font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__status]{font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__status--info]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__status--error]{color:var(--tokentweak-color-danger)}[data-design-token-panel-modal] [class*=__status--warning]{color:var(--tokentweak-color-warning)}[data-design-token-panel-modal] [class*=__status--success]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__applying]{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-muted);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small)}[data-design-token-panel-modal] [class*=__spinner]{display:inline-block;width:1rem;height:1rem;border:2px solid var(--tokentweak-color-muted);border-top-color:var(--tokentweak-color-fg);border-radius:50%;animation:design-token-panel-modal-spin .75s linear infinite}@keyframes design-token-panel-modal-spin{to{transform:rotate(360deg)}}[data-design-token-panel-modal] [class*=__revert-hint]{font-size:var(--tokentweak-text-small);font-style:italic;color:var(--tokentweak-color-muted);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-lg);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}[data-design-token-panel-modal] [class*=__button]:hover,[data-design-token-panel-modal] [class*=__button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__button]:disabled{cursor:not-allowed;opacity:.5}[data-design-token-panel-modal] [class*=__button--primary]{border-color:var(--tokentweak-color-accent);background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__button--primary]:hover,[data-design-token-panel-modal] [class*=__button--primary]:focus-visible{border-color:var(--tokentweak-color-accent-hover);background-color:var(--tokentweak-color-accent-hover);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__close-button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease}[data-design-token-panel-modal] [class*=__close-button]:hover,[data-design-token-panel-modal] [class*=__close-button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}.tokenpanel-tier-ref-selector{flex:1;min-width:0}select.tokenpanel-tier-ref-select{width:100%;background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding-inline:var(--tokentweak-pad-sm);padding-block:4px;font-family:var(--tokentweak-font-mono);font-size:.75rem;cursor:pointer}select.tokenpanel-tier-ref-select:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-row-label-sub{display:block;font-size:var(--tokentweak-text-micro, .6875rem);color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);line-height:1.2}.tokenpanel-tab-section [role=heading]{display:block}.tokenpanel-code{font-family:var(--tokentweak-font-mono);font-size:inherit;background:none;color:inherit;padding:0;border:none;border-radius:0;white-space:pre-wrap}[data-design-token-panel-modal] [class*=__button][aria-disabled=true]{cursor:not-allowed;opacity:.5;pointer-events:none}[data-design-token-panel-modal] [role=button]:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-action-link:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-close-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-tab-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-overlay{margin:0;padding:0;border:0;background:transparent;display:block}.tokenpanel-highlight-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;color:var(--tokentweak-color-muted);cursor:pointer;vertical-align:middle;border-radius:2px;transition:background-color .15s ease,color .15s ease}.tokenpanel-highlight-toggle:hover{color:var(--tokentweak-color-fg);background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-highlight-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-toggle.is-active{opacity:1}:where(.tokenpanel-shell) svg{fill:currentColor;pointer-events:none;display:inline-block;overflow:visible}:where(.tokenpanel-shell) .tokenpanel-highlight-toggle svg{fill:none;stroke:currentColor}.tokenpanel-highlight-settings-popover{width:370px;background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:6px;box-shadow:0 8px 32px #00000080}.tokenpanel-highlight-settings-header{padding:10px 16px;border-bottom:1px solid var(--tokentweak-color-muted);font-weight:600;font-size:.8125rem;color:var(--tokentweak-color-fg);display:flex;align-items:center;justify-content:space-between;gap:12px}.tokenpanel-highlight-settings-header-label{flex:1;min-width:0}.tokenpanel-highlight-settings-outline-control{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-highlight-settings-outline-input{width:44px;background:#222;border:1px solid var(--tokentweak-color-muted);border-radius:3px;color:var(--tokentweak-color-fg);font-size:12px;font-variant-numeric:tabular-nums;padding:3px 6px;text-align:right}.tokenpanel-highlight-settings-outline-px{color:var(--tokentweak-color-muted);font-size:12px;font-weight:400}.tokenpanel-highlight-settings-list{padding:4px 0;display:grid;grid-template-columns:1fr 1fr}.tokenpanel-highlight-settings-row{display:grid;grid-template-columns:22px 32px 1fr;gap:8px;align-items:center;padding:8px 12px}.tokenpanel-highlight-settings-row:hover{background:#ffffff08}.tokenpanel-highlight-settings-num{color:var(--tokentweak-color-muted);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.tokenpanel-highlight-settings-ring{width:28px;height:28px;border-radius:3px;background:transparent;box-sizing:border-box;cursor:pointer;flex-shrink:0}.tokenpanel-highlight-settings-ring:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-highlight-settings-name{font-family:var(--tokentweak-font-mono);font-size:12px;color:var(--tokentweak-color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-highlight-settings-name.is-active{color:var(--tokentweak-color-fg)}.tokenpanel-highlight-settings-footer{padding:12px 16px;border-top:1px solid var(--tokentweak-color-muted);display:flex;justify-content:flex-end;gap:var(--tokentweak-pad-sm)}.tokenpanel-highlight-settings-reset-btn{padding:6px 12px;background:#333;border:1px solid var(--tokentweak-color-muted);border-radius:3px;cursor:pointer;font-size:12px;color:var(--tokentweak-color-fg);transition:background .15s ease}.tokenpanel-highlight-settings-reset-btn:hover{background:#404040}.tokenpanel-highlight-settings-reset-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:3px}.tokenpanel-gear-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-gear-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-gear-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-elpath-toggle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-elpath-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle.is-active{color:var(--tokentweak-color-accent)}:where(.tokenpanel-shell) .tokenpanel-elpath-toggle svg{fill:none;stroke:currentColor}html.tokenpanel-elpath-inspecting,html.tokenpanel-elpath-inspecting *{cursor:crosshair!important;-webkit-user-select:none!important;user-select:none!important}.tokenpanel-elpath-box{margin:0;padding:0;border:0;pointer-events:none;box-sizing:border-box;background:#6fa8dc40;outline:1px solid rgb(111 168 220 / .9);outline-offset:-1px;box-shadow:inset 0 0 0 1px #6fa8dce6}.tokenpanel-elpath-label{pointer-events:none;display:inline-flex;align-items:baseline;gap:8px;max-width:90vw;padding:2px 6px;border-radius:3px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 1px 3px #0006}.tokenpanel-elpath-label-name{color:var(--tokentweak-color-accent, #d69a66);font-weight:600;overflow:hidden;text-overflow:ellipsis}.tokenpanel-elpath-label-size{color:var(--tokentweak-color-muted, #888888);flex-shrink:0}.tokenpanel-elpath-toast{pointer-events:none;display:inline-flex;align-items:center;gap:8px;margin:12px auto 0;padding:8px 14px;border-radius:6px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:12px;line-height:1.4;max-width:min(90vw,520px);box-shadow:0 4px 16px #00000073;border:1px solid rgb(255 255 255 / .08)}.tokenpanel-elpath-toast .tokenpanel-elpath-toast-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-elpath-toast svg{flex-shrink:0;fill:none;stroke:var(--tokentweak-color-success, #93bb77);pointer-events:none;display:inline-block;overflow:visible}.tokenpanel-elpath-toast.is-error svg{stroke:var(--tokentweak-color-danger, #da6871)}';
5764
+ function Dl(e) {
5714
5765
  return e.kind === "length";
5715
5766
  }
5716
- function zl(e) {
5767
+ function Vl(e) {
5717
5768
  return e.kind === "number";
5718
5769
  }
5719
- function Rl(e) {
5770
+ function Bl(e) {
5720
5771
  return e.kind === "select";
5721
5772
  }
5722
- function Ol(e) {
5773
+ function Hl(e) {
5723
5774
  return e.kind === "text";
5724
5775
  }
5725
- function Dl(e) {
5776
+ function Fl(e) {
5726
5777
  return e.kind === "cursor";
5727
5778
  }
5728
- function Bl(e) {
5779
+ function jl(e) {
5729
5780
  return e.kind === "content";
5730
5781
  }
5731
- function Vl(e) {
5782
+ function Kl(e) {
5732
5783
  return e.kind === "mask-image";
5733
5784
  }
5734
- function Hl(e) {
5785
+ function Wl(e) {
5735
5786
  return e.kind === "color";
5736
5787
  }
5737
- function No(e) {
5738
- return nr(e);
5788
+ function $o(e) {
5789
+ return rr(e);
5739
5790
  }
5740
- function _o(e) {
5791
+ function Co(e) {
5741
5792
  return Rn(e);
5742
5793
  }
5743
5794
  const An = "toggle-color-tweak-panel";
5744
- function kt(e) {
5795
+ function mt(e) {
5745
5796
  typeof window > "u" || window.dispatchEvent(new CustomEvent(On(e)));
5746
5797
  }
5747
- function mt(e, t) {
5798
+ function bt(e, t) {
5748
5799
  if (!(typeof window > "u"))
5749
5800
  try {
5750
- window.localStorage.setItem(_o(e), t ? "1" : "0");
5801
+ window.localStorage.setItem(Co(e), t ? "1" : "0");
5751
5802
  } catch {
5752
5803
  }
5753
5804
  }
5754
- function $o(e) {
5805
+ function Eo(e) {
5755
5806
  if (typeof window > "u") return !1;
5756
5807
  try {
5757
- return window.localStorage.getItem(_o(e)) === "1";
5808
+ return window.localStorage.getItem(Co(e)) === "1";
5758
5809
  } catch {
5759
5810
  return !1;
5760
5811
  }
5761
5812
  }
5762
- function vl(e) {
5813
+ function yl(e) {
5763
5814
  if (typeof window > "u") return !1;
5764
5815
  try {
5765
5816
  const t = window.localStorage;
5766
- return t.getItem(Xo(e)) !== null || t.getItem(Yo(e)) !== null;
5817
+ return t.getItem(qo(e)) !== null || t.getItem(Go(e)) !== null;
5767
5818
  } catch {
5768
5819
  return !1;
5769
5820
  }
5770
5821
  }
5771
- function Co(e) {
5822
+ function So(e) {
5772
5823
  if (typeof window > "u") return !1;
5773
5824
  try {
5774
5825
  return window.localStorage.getItem(We(e)) === "1";
@@ -5776,7 +5827,7 @@ function Co(e) {
5776
5827
  return !1;
5777
5828
  }
5778
5829
  }
5779
- function bt(e, t) {
5830
+ function vt(e, t) {
5780
5831
  if (!(typeof window > "u"))
5781
5832
  try {
5782
5833
  const n = We(e);
@@ -5785,75 +5836,75 @@ function bt(e, t) {
5785
5836
  }
5786
5837
  }
5787
5838
  function Oe(e) {
5788
- return typeof document > "u" ? null : document.getElementById(No(e));
5839
+ return typeof document > "u" ? null : document.getElementById($o(e));
5789
5840
  }
5790
5841
  const Ln = "zudo-design-token-panel-styles";
5791
- function wl() {
5842
+ function Nl() {
5792
5843
  if (typeof document > "u" || document.getElementById(Ln)) return;
5793
5844
  const e = document.createElement("style");
5794
- e.id = Ln, e.textContent = bl, document.head.appendChild(e);
5845
+ e.id = Ln, e.textContent = xl, document.head.appendChild(e);
5795
5846
  }
5796
- function vt(e) {
5847
+ function wt(e) {
5797
5848
  if (typeof document > "u") return !1;
5798
5849
  an(e);
5799
- const t = No(e);
5850
+ const t = $o(e);
5800
5851
  if (document.getElementById(t)) return !1;
5801
- wl();
5852
+ Nl();
5802
5853
  const n = document.createElement("div");
5803
- return n.id = t, document.body.appendChild(n), Kt(/* @__PURE__ */ s(ml, { instanceConfig: e }), n), !0;
5854
+ return n.id = t, document.body.appendChild(n), Kt(/* @__PURE__ */ s(wl, { instanceConfig: e }), n), !0;
5804
5855
  }
5805
- function xl(e) {
5856
+ function _l(e) {
5806
5857
  const t = Oe(e);
5807
5858
  t && (Kt(null, t), t.remove());
5808
5859
  }
5809
- function Fl() {
5810
- return q();
5860
+ function Xl() {
5861
+ return Y();
5811
5862
  }
5812
5863
  function nn(e) {
5813
5864
  if (typeof window > "u") return;
5814
5865
  const t = !Oe(e);
5815
- bt(e, !0), vt(e), mt(e, !0), !t && kt(e);
5866
+ vt(e, !0), wt(e), bt(e, !0), !t && mt(e);
5816
5867
  }
5817
5868
  function on(e) {
5818
5869
  if (typeof window > "u") return;
5819
5870
  const t = !Oe(e);
5820
- bt(e, !1), vt(e), mt(e, !1), !t && kt(e);
5871
+ vt(e, !1), wt(e), bt(e, !1), !t && mt(e);
5821
5872
  }
5822
- function Eo(e) {
5873
+ function To(e) {
5823
5874
  if (typeof window > "u") return;
5824
- const t = !Co(e), n = !Oe(e);
5825
- bt(e, t), vt(e), mt(e, t), !n && kt(e);
5875
+ const t = !So(e), n = !Oe(e);
5876
+ vt(e, t), wt(e), bt(e, t), !n && mt(e);
5826
5877
  }
5827
- function jl() {
5828
- nn(q());
5878
+ function Yl() {
5879
+ nn(Y());
5829
5880
  }
5830
- function Kl() {
5831
- on(q());
5881
+ function ql() {
5882
+ on(Y());
5832
5883
  }
5833
- function Wl() {
5834
- Eo(q());
5884
+ function Gl() {
5885
+ To(Y());
5835
5886
  }
5836
- function So() {
5887
+ function Mo() {
5837
5888
  if (!(typeof window > "u"))
5838
5889
  try {
5839
5890
  const e = zn();
5840
- e && it(e);
5891
+ e && lt(e);
5841
5892
  } catch {
5842
5893
  }
5843
5894
  }
5844
5895
  function Ye() {
5845
- const e = q(), t = Oe(e);
5896
+ const e = Y(), t = Oe(e);
5846
5897
  if (!t) return;
5847
- const n = $o(e);
5848
- Kt(null, t), t.remove(), n && mt(e, !0);
5898
+ const n = Eo(e);
5899
+ Kt(null, t), t.remove(), n && bt(e, !0);
5849
5900
  }
5850
5901
  function ze() {
5851
- const e = q();
5852
- So(), $o(e) ? nn(e) : vl(e) && on(e);
5902
+ const e = Y();
5903
+ Mo(), Eo(e) ? nn(e) : yl(e) && on(e);
5853
5904
  }
5854
- function yl(e) {
5855
- const t = !Oe(e), n = t ? !0 : !Co(e);
5856
- bt(e, n), vt(e), !t && kt(e);
5905
+ function $l(e) {
5906
+ const t = !Oe(e), n = t ? !0 : !So(e);
5907
+ vt(e, n), wt(e), !t && mt(e);
5857
5908
  }
5858
5909
  function rn() {
5859
5910
  const e = window;
@@ -5861,16 +5912,28 @@ function rn() {
5861
5912
  const t = /* @__PURE__ */ new Map();
5862
5913
  return e.__zudoDesignTokenPanelInstanceBindings = t, t;
5863
5914
  }
5915
+ function Cl(e, t, n) {
5916
+ const o = Dn(e);
5917
+ if (o) return o;
5918
+ if (t) {
5919
+ const r = Y();
5920
+ if (r.storagePrefix !== e) return r;
5921
+ }
5922
+ return n;
5923
+ }
5864
5924
  function an(e) {
5865
5925
  if (typeof window > "u") return;
5866
5926
  const t = rn();
5867
5927
  if (t.has(e.storagePrefix)) return;
5868
- const n = er(e), o = () => yl(e);
5869
- window.addEventListener(n, o);
5870
- const r = [() => window.removeEventListener(n, o)];
5871
- n === tr && (window.addEventListener(An, o), r.push(() => window.removeEventListener(An, o))), t.set(e.storagePrefix, { cleanups: r });
5928
+ const n = e.storagePrefix, o = nr(e), r = o === or, a = (l) => {
5929
+ const c = Cl(n, r, e), d = l, u = d.__zdtpToggledPrefixes ?? /* @__PURE__ */ new Set();
5930
+ u.has(c.storagePrefix) || (u.add(c.storagePrefix), d.__zdtpToggledPrefixes = u, $l(c));
5931
+ };
5932
+ window.addEventListener(o, a);
5933
+ const i = [() => window.removeEventListener(o, a)];
5934
+ r && (window.addEventListener(An, a), i.push(() => window.removeEventListener(An, a))), t.set(n, { cleanups: i });
5872
5935
  }
5873
- function Mo(e) {
5936
+ function Ao(e) {
5874
5937
  if (typeof window > "u") return;
5875
5938
  const t = rn(), n = t.get(e);
5876
5939
  if (n) {
@@ -5882,19 +5945,19 @@ function Mo(e) {
5882
5945
  t.delete(e);
5883
5946
  }
5884
5947
  }
5885
- function Xl() {
5948
+ function Ul() {
5886
5949
  if (typeof window > "u") return;
5887
5950
  const e = rn();
5888
5951
  for (const t of [...e.keys()])
5889
- Mo(t);
5952
+ Ao(t);
5890
5953
  }
5891
5954
  function Fe(e) {
5892
- const t = or(e);
5955
+ const t = Dn(e);
5893
5956
  if (t) return t;
5894
- const n = q();
5957
+ const n = Y();
5895
5958
  return n.storagePrefix === e ? n : { ...n, storagePrefix: e };
5896
5959
  }
5897
- Zo({
5960
+ er({
5898
5961
  // Fires once per `configurePanel` (every instance, incl. the 2nd+). Bind the
5899
5962
  // instance's toggle-event channel now so a host-dispatched
5900
5963
  // `toggle-${storagePrefix}` window event works immediately, before any
@@ -5902,19 +5965,19 @@ Zo({
5902
5965
  configured: (e) => an(Fe(e)),
5903
5966
  open: (e) => nn(Fe(e)),
5904
5967
  close: (e) => on(Fe(e)),
5905
- toggle: (e) => Eo(Fe(e)),
5968
+ toggle: (e) => To(Fe(e)),
5906
5969
  destroy: (e) => {
5907
5970
  const t = Fe(e);
5908
- Mo(e), xl(t);
5971
+ Ao(e), _l(t);
5909
5972
  }
5910
5973
  });
5911
- function To() {
5974
+ function Lo() {
5912
5975
  const e = window;
5913
5976
  if (e.__zudoDesignTokenPanelLifecycle) return e.__zudoDesignTokenPanelLifecycle;
5914
5977
  const t = { bound: !1, cleanups: [], adapter: null };
5915
5978
  return e.__zudoDesignTokenPanelLifecycle = t, t;
5916
5979
  }
5917
- function Nl(e) {
5980
+ function El(e) {
5918
5981
  const t = e.cleanups;
5919
5982
  e.cleanups = [];
5920
5983
  for (const n of t)
@@ -5923,13 +5986,13 @@ function Nl(e) {
5923
5986
  } catch {
5924
5987
  }
5925
5988
  }
5926
- function Ao(e) {
5989
+ function Po(e) {
5927
5990
  typeof document > "u" || (document.addEventListener("astro:before-swap", Ye), document.addEventListener("astro:page-load", ze), e.cleanups.push(
5928
5991
  () => document.removeEventListener("astro:before-swap", Ye),
5929
5992
  () => document.removeEventListener("astro:page-load", ze)
5930
5993
  ));
5931
5994
  }
5932
- function _l(e, t) {
5995
+ function Sl(e, t) {
5933
5996
  if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(Ye)) : (document.addEventListener("astro:before-swap", Ye), e.cleanups.push(
5934
5997
  () => document.removeEventListener("astro:before-swap", Ye)
5935
5998
  )), t.onPageLoad ? e.cleanups.push(t.onPageLoad(ze)) : (document.addEventListener("astro:page-load", ze), e.cleanups.push(
@@ -5944,36 +6007,36 @@ function _l(e, t) {
5944
6007
  );
5945
6008
  }
5946
6009
  }
5947
- function Yl(e) {
6010
+ function Jl(e) {
5948
6011
  if (typeof window > "u") return;
5949
- const t = To();
5950
- Nl(t), t.adapter = e, e ? _l(t, e) : Ao(t);
6012
+ const t = Lo();
6013
+ El(t), t.adapter = e, e ? Sl(t, e) : Po(t);
5951
6014
  }
5952
- const $l = () => {
5953
- So(), ze();
6015
+ const Tl = () => {
6016
+ Mo(), ze();
5954
6017
  };
5955
6018
  if (typeof window < "u") {
5956
- const e = To();
5957
- an(q()), e.bound || (e.bound = !0, Ao(e), Qo($l));
6019
+ const e = Lo();
6020
+ an(Y()), e.bound || (e.bound = !0, Po(e), tr(Tl));
5958
6021
  }
5959
6022
  export {
5960
- Ul as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
5961
- Fl as __panelConfigForTest,
5962
- Xl as __resetInstanceBindingsForTests,
5963
- Zl as configurePanel,
5964
- Nt as emptyOverrides,
5965
- Kl as hideDesignTokenPanel,
5966
- Hl as isColorKind,
5967
- Bl as isContentKind,
5968
- Dl as isCursorKind,
5969
- Il as isLengthKind,
5970
- Vl as isMaskImageKind,
5971
- zl as isNumberKind,
5972
- Rl as isSelectKind,
5973
- Ol as isTextKind,
5974
- So as reapplyPersistedOverrides,
5975
- Yl as setLifecycleAdapter,
5976
- Ql as setPanelColorPresets,
5977
- jl as showDesignTokenPanel,
5978
- Wl as toggleDesignPanel
6023
+ es as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
6024
+ Xl as __panelConfigForTest,
6025
+ Ul as __resetInstanceBindingsForTests,
6026
+ ns as configurePanel,
6027
+ _t as emptyOverrides,
6028
+ ql as hideDesignTokenPanel,
6029
+ Wl as isColorKind,
6030
+ jl as isContentKind,
6031
+ Fl as isCursorKind,
6032
+ Dl as isLengthKind,
6033
+ Kl as isMaskImageKind,
6034
+ Vl as isNumberKind,
6035
+ Bl as isSelectKind,
6036
+ Hl as isTextKind,
6037
+ Mo as reapplyPersistedOverrides,
6038
+ Jl as setLifecycleAdapter,
6039
+ os as setPanelColorPresets,
6040
+ Yl as showDesignTokenPanel,
6041
+ Gl as toggleDesignPanel
5979
6042
  };