@themal/editor 0.17.0 → 0.17.1

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.
Files changed (2) hide show
  1. package/dist/index.js +289 -259
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ class _o {
51
51
  }
52
52
  }
53
53
  }
54
- class Gr {
54
+ class _r {
55
55
  constructor() {
56
56
  xr(this, "store", /* @__PURE__ */ new Map());
57
57
  }
@@ -72,7 +72,7 @@ class ma {
72
72
  constructor() {
73
73
  xr(this, "primary");
74
74
  xr(this, "fallback");
75
- this.test("localStorage") ? (this.primary = new fa(), this.fallback = new _o()) : this.test("sessionStorage") ? (this.primary = new _o(), this.fallback = new Gr()) : (this.primary = new Gr(), this.fallback = new Gr());
75
+ this.test("localStorage") ? (this.primary = new fa(), this.fallback = new _o()) : this.test("sessionStorage") ? (this.primary = new _o(), this.fallback = new _r()) : (this.primary = new _r(), this.fallback = new _r());
76
76
  }
77
77
  test(n) {
78
78
  try {
@@ -103,15 +103,15 @@ class ma {
103
103
  this.primary.remove(n), this.fallback.remove(n);
104
104
  }
105
105
  }
106
- const _r = new ma(), O = {
107
- get: (r, n) => _r.get(r, n),
108
- set: (r, n) => _r.set(r, n),
109
- remove: (r) => _r.remove(r)
110
- }, Mr = "ds-theme-colors", ue = "ds-pending-colors", Me = "ds-color-history", eo = "ds-contrast-knowledge";
106
+ const Ur = new ma(), O = {
107
+ get: (r, n) => Ur.get(r, n),
108
+ set: (r, n) => Ur.set(r, n),
109
+ remove: (r) => Ur.remove(r)
110
+ }, Mr = "ds-theme-colors", ue = "ds-pending-colors", Me = "ds-color-history", to = "ds-contrast-knowledge";
111
111
  function ba(r, n, s) {
112
112
  const c = r.trim().split(/\s+/);
113
113
  if (c.length < 3) return;
114
- const l = parseFloat(c[0]), h = parseFloat(c[2]), p = 15, u = 10, m = O.get(eo) || [], b = m.find(
114
+ const l = parseFloat(c[0]), h = parseFloat(c[2]), p = 15, u = 10, m = O.get(to) || [], b = m.find(
115
115
  (g) => g.fgKey === n && l >= g.bgHueRange[0] && l <= g.bgHueRange[1] && h >= g.bgLightRange[0] && h <= g.bgLightRange[1]
116
116
  );
117
117
  b ? b.correctedValue = s : m.push({
@@ -125,12 +125,12 @@ function ba(r, n, s) {
125
125
  ],
126
126
  fgKey: n,
127
127
  correctedValue: s
128
- }), m.length > 100 && m.splice(0, m.length - 100), O.set(eo, m);
128
+ }), m.length > 100 && m.splice(0, m.length - 100), O.set(to, m);
129
129
  }
130
130
  function cn(r, n) {
131
131
  const s = r.trim().split(/\s+/);
132
132
  if (s.length < 3) return {};
133
- const c = parseFloat(s[0]), l = parseFloat(s[2]), h = O.get(eo) || [], p = {};
133
+ const c = parseFloat(s[0]), l = parseFloat(s[2]), h = O.get(to) || [], p = {};
134
134
  for (const u of h) {
135
135
  if (n.has(u.fgKey)) continue;
136
136
  const m = c >= u.bgHueRange[0] && c <= u.bgHueRange[1], b = l >= u.bgLightRange[0] && l <= u.bgLightRange[1];
@@ -161,16 +161,16 @@ function Tr(r) {
161
161
  };
162
162
  return [p(0), p(8), p(4)];
163
163
  }
164
- function to(r, n, s) {
164
+ function ro(r, n, s) {
165
165
  const c = (l) => l <= 0.03928 ? l / 12.92 : Math.pow((l + 0.055) / 1.055, 2.4);
166
166
  return 0.2126 * c(r) + 0.7152 * c(n) + 0.0722 * c(s);
167
167
  }
168
168
  function M(r) {
169
- const [n, s, c] = Tr(r), l = to(n, s, c), h = (1 + 0.05) / (l + 0.05), p = (l + 0.05) / (0 + 0.05);
169
+ const [n, s, c] = Tr(r), l = ro(n, s, c), h = (1 + 0.05) / (l + 0.05), p = (l + 0.05) / (0 + 0.05);
170
170
  return h >= p ? "0 0% 100%" : "0 0% 0%";
171
171
  }
172
172
  function ee(r, n) {
173
- const [s, c, l] = Tr(r), [h, p, u] = Tr(n), m = to(s, c, l), b = to(h, p, u), g = Math.max(m, b), v = Math.min(m, b);
173
+ const [s, c, l] = Tr(r), [h, p, u] = Tr(n), m = ro(s, c, l), b = ro(h, p, u), g = Math.max(m, b), v = Math.min(m, b);
174
174
  return (g + 0.05) / (v + 0.05);
175
175
  }
176
176
  const Ne = [
@@ -208,7 +208,7 @@ function De(r) {
208
208
  };
209
209
  return `#${p(0)}${p(8)}${p(4)}`;
210
210
  }
211
- function Ct(r) {
211
+ function Nt(r) {
212
212
  const n = parseInt(r.slice(1, 3), 16) / 255, s = parseInt(r.slice(3, 5), 16) / 255, c = parseInt(r.slice(5, 7), 16) / 255, l = Math.max(n, s, c), h = Math.min(n, s, c), p = (l + h) / 2;
213
213
  if (l === h) return `0 0% ${(p * 100).toFixed(1)}%`;
214
214
  const u = l - h, m = p > 0.5 ? u / (2 - l - h) : u / (l + h);
@@ -364,7 +364,7 @@ const Ve = (r, n, s, c) => {
364
364
  }
365
365
  }
366
366
  return s;
367
- }, Ur = ["Complementary", "Analogous", "Triadic", "Split-Complementary"], ya = (r, n, s, c) => {
367
+ }, Xr = ["Complementary", "Analogous", "Triadic", "Split-Complementary"], ya = (r, n, s, c) => {
368
368
  const l = c ?? /* @__PURE__ */ new Set(), h = r.trim().split(/\s+/);
369
369
  if (h.length < 3) return {};
370
370
  const p = parseFloat(h[0]), u = parseFloat(h[1]), m = parseFloat(h[2]);
@@ -396,8 +396,8 @@ const Ve = (r, n, s, c) => {
396
396
  const fe = cn(ge, l);
397
397
  Object.assign(U, fe);
398
398
  }
399
- const ce = { ...s, ...U }, dt = Ie(ce, l);
400
- return Object.assign(U, dt), U;
399
+ const ce = { ...s, ...U }, ht = Ie(ce, l);
400
+ return Object.assign(U, ht), U;
401
401
  }, va = (r, n, s) => {
402
402
  const c = n ?? /* @__PURE__ */ new Set(), l = {}, h = s ?? document.documentElement.classList.contains("dark"), p = Math.random() * 360, u = 55 + Math.random() * 35, m = h ? 50 + Math.random() * 20 : 35 + Math.random() * 25, b = `${p.toFixed(1)} ${u.toFixed(1)}% ${m.toFixed(1)}%`;
403
403
  c.has("--brand") || (l["--brand"] = b);
@@ -420,8 +420,8 @@ const Ve = (r, n, s, c) => {
420
420
  l["--muted"] = `${A(T + 15).toFixed(1)} ${(15 + Math.random() * 15).toFixed(1)}% ${be.toFixed(1)}%`;
421
421
  }
422
422
  let ce = { ...r, ...l };
423
- const dt = Ve("--brand", g, ce, c);
424
- if (Object.assign(l, dt), ce = { ...ce, ...dt }, !c.has("--secondary")) {
423
+ const ht = Ve("--brand", g, ce, c);
424
+ if (Object.assign(l, ht), ce = { ...ce, ...ht }, !c.has("--secondary")) {
425
425
  const te = Ve("--secondary", l["--secondary"] || r["--secondary"], ce, c);
426
426
  Object.assign(l, te), ce = { ...ce, ...te };
427
427
  }
@@ -434,9 +434,9 @@ const Ve = (r, n, s, c) => {
434
434
  const te = cn(fe, c);
435
435
  Object.assign(l, te);
436
436
  }
437
- const Er = { ...r, ...l }, ht = Ie(Er, c);
438
- return Object.assign(l, ht), l;
439
- }, Ut = "ds-card-style", Xr = {
437
+ const Er = { ...r, ...l }, ut = Ie(Er, c);
438
+ return Object.assign(l, ut), l;
439
+ }, Ut = "ds-card-style", Kr = {
440
440
  preset: "solid",
441
441
  shadowOffsetX: 0,
442
442
  shadowOffsetY: 2,
@@ -538,7 +538,7 @@ function wa(r) {
538
538
  const n = O.get(Ut);
539
539
  return n ? (yr(n, r), n) : null;
540
540
  }
541
- const $t = "ds-typography-v2", vr = {
541
+ const Lt = "ds-typography-v2", vr = {
542
542
  preset: "system",
543
543
  headingFamily: "system-ui, -apple-system, sans-serif",
544
544
  bodyFamily: "system-ui, -apple-system, sans-serif",
@@ -624,7 +624,7 @@ function jr(r) {
624
624
  c.id = s, c.rel = "stylesheet", c.href = `https://fonts.googleapis.com/css2?family=${n}&display=swap`, document.head.appendChild(c);
625
625
  }
626
626
  const dn = "ds-custom-fonts";
627
- function ct() {
627
+ function dt() {
628
628
  try {
629
629
  const r = localStorage.getItem(dn);
630
630
  return r ? JSON.parse(r) : [];
@@ -651,27 +651,27 @@ async function Sa(r) {
651
651
  if (!await Na(n)) throw new Error(`"${n}" not found on Google Fonts`);
652
652
  const l = `${n.replace(/\s+/g, "+")}:wght@100;200;300;400;500;600;700;800;900`, h = n.includes(" ") ? `"${n}", sans-serif` : `${n}, sans-serif`, p = { label: n, value: h, spec: l };
653
653
  Fr[h] = l, jr(h);
654
- const u = ct().filter((m) => m.label !== n);
654
+ const u = dt().filter((m) => m.label !== n);
655
655
  return u.push(p), hn(u), p;
656
656
  }
657
657
  function $a(r) {
658
- const n = ct(), s = n.find((c) => c.label === r);
658
+ const n = dt(), s = n.find((c) => c.label === r);
659
659
  s && delete Fr[s.value], hn(n.filter((c) => c.label !== r));
660
660
  }
661
661
  function La() {
662
- const r = ct();
662
+ const r = dt();
663
663
  for (const n of r)
664
664
  Fr[n.value] = n.spec, jr(n.value);
665
665
  }
666
666
  function Ma() {
667
667
  document.querySelectorAll('link[id^="gf-"]').forEach((r) => r.remove());
668
668
  }
669
- const ro = "themal-typography";
669
+ const oo = "themal-typography";
670
670
  function Xt(r) {
671
671
  const n = document.documentElement;
672
672
  n.style.setProperty("--font-heading", r.headingFamily), n.style.setProperty("--font-body", r.bodyFamily), n.style.setProperty("--font-size-base", `${r.baseFontSize}px`), n.style.setProperty("--font-weight-heading", String(r.headingWeight)), n.style.setProperty("--font-weight-body", String(r.bodyWeight)), n.style.setProperty("--line-height", String(r.lineHeight)), n.style.setProperty("--letter-spacing", `${r.letterSpacing}em`), n.style.setProperty("--letter-spacing-heading", `${r.headingLetterSpacing}em`);
673
- let s = document.getElementById(ro);
674
- s || (s = document.createElement("style"), s.id = ro, document.head.appendChild(s)), s.textContent = `
673
+ let s = document.getElementById(oo);
674
+ s || (s = document.createElement("style"), s.id = oo, document.head.appendChild(s)), s.textContent = `
675
675
  body, .ds-editor {
676
676
  font-family: ${r.bodyFamily} !important;
677
677
  font-size: ${r.baseFontSize}px !important;
@@ -699,7 +699,7 @@ function Xt(r) {
699
699
  font-weight: ${r.bodyWeight} !important;
700
700
  line-height: ${r.lineHeight} !important;
701
701
  }
702
- `, jr(r.headingFamily), jr(r.bodyFamily), O.set($t, r);
702
+ `, jr(r.headingFamily), jr(r.bodyFamily), O.set(Lt, r);
703
703
  }
704
704
  function Ko() {
705
705
  const r = document.documentElement;
@@ -715,14 +715,14 @@ function Ko() {
715
715
  ])
716
716
  r.style.removeProperty(s);
717
717
  Ma();
718
- const n = document.getElementById(ro);
718
+ const n = document.getElementById(oo);
719
719
  n && n.remove();
720
720
  }
721
721
  function Ta() {
722
- const r = O.get($t);
722
+ const r = O.get(Lt);
723
723
  return r ? (Xt(r), r) : null;
724
724
  }
725
- const Nt = "ds-alert-style", Gt = {
725
+ const St = "ds-alert-style", Gt = {
726
726
  preset: "filled",
727
727
  borderRadius: 8,
728
728
  borderWidth: 0,
@@ -754,15 +754,15 @@ const Nt = "ds-alert-style", Gt = {
754
754
  };
755
755
  function kr(r) {
756
756
  const n = document.documentElement;
757
- n.style.setProperty("--alert-radius", `${r.borderRadius}px`), n.style.setProperty("--alert-border-width", `${r.borderWidth}px`), n.style.setProperty("--alert-padding", `${r.padding}px`), O.set(Nt, r);
757
+ n.style.setProperty("--alert-radius", `${r.borderRadius}px`), n.style.setProperty("--alert-border-width", `${r.borderWidth}px`), n.style.setProperty("--alert-padding", `${r.padding}px`), O.set(St, r);
758
758
  }
759
- function Kr() {
759
+ function Zr() {
760
760
  const r = document.documentElement;
761
761
  for (const n of ["--alert-radius", "--alert-border-width", "--alert-padding"])
762
762
  r.style.removeProperty(n);
763
763
  }
764
764
  function ja() {
765
- const r = O.get(Nt);
765
+ const r = O.get(St);
766
766
  return r ? (kr(r), r) : null;
767
767
  }
768
768
  const Kt = "ds-toast-style", wr = {
@@ -815,12 +815,12 @@ const Zt = "ds-interaction-style", Cr = {
815
815
  transitionDuration: 100,
816
816
  focusRingWidth: 3
817
817
  }
818
- }, oo = "themal-interaction";
818
+ }, no = "themal-interaction";
819
819
  function Nr(r) {
820
820
  const n = document.documentElement;
821
821
  n.style.setProperty("--hover-opacity", String(r.hoverOpacity)), n.style.setProperty("--hover-scale", String(r.hoverScale)), n.style.setProperty("--active-scale", String(r.activeScale)), n.style.setProperty("--transition-duration", `${r.transitionDuration}ms`), n.style.setProperty("--focus-ring-width", `${r.focusRingWidth}px`), n.style.setProperty("--focus-ring-color", "hsl(var(--ring))");
822
- let s = document.getElementById(oo);
823
- s || (s = document.createElement("style"), s.id = oo, document.head.appendChild(s)), s.textContent = `
822
+ let s = document.getElementById(no);
823
+ s || (s = document.createElement("style"), s.id = no, document.head.appendChild(s)), s.textContent = `
824
824
  html button, html a, html [role="button"],
825
825
  html .ds-editor button, html .ds-editor a, html .ds-editor [role="button"] {
826
826
  transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
@@ -852,14 +852,14 @@ function Qo() {
852
852
  "--focus-ring-color"
853
853
  ])
854
854
  r.style.removeProperty(s);
855
- const n = document.getElementById(oo);
855
+ const n = document.getElementById(no);
856
856
  n && n.remove();
857
857
  }
858
858
  function Ea() {
859
859
  const r = O.get(Zt);
860
860
  return r ? (Nr(r), r) : null;
861
861
  }
862
- const Or = "ds-button-style", St = {
862
+ const Or = "ds-button-style", $t = {
863
863
  paddingX: 16,
864
864
  paddingY: 8,
865
865
  fontSize: 14,
@@ -907,7 +907,7 @@ function Wa() {
907
907
  document.documentElement.style.setProperty(h, p);
908
908
  }), _t(l);
909
909
  }
910
- const c = O.get($t);
910
+ const c = O.get(Lt);
911
911
  c && Xt(c);
912
912
  }
913
913
  const qt = "ds-typo-interaction-style", $r = {
@@ -944,12 +944,12 @@ const qt = "ds-typo-interaction-style", $r = {
944
944
  headingHoverScale: 1.02,
945
945
  headingTransitionDuration: 100
946
946
  }
947
- }, no = "themal-typo-interaction";
948
- function ao(r) {
947
+ }, ao = "themal-typo-interaction";
948
+ function so(r) {
949
949
  const n = document.documentElement;
950
950
  n.style.setProperty("--link-hover-opacity", String(r.linkHoverOpacity)), n.style.setProperty("--link-hover-scale", String(r.linkHoverScale)), n.style.setProperty("--link-active-scale", String(r.linkActiveScale)), n.style.setProperty("--link-transition-duration", `${r.linkTransitionDuration}ms`), n.style.setProperty("--heading-hover-opacity", String(r.headingHoverOpacity)), n.style.setProperty("--heading-hover-scale", String(r.headingHoverScale)), n.style.setProperty("--heading-transition-duration", `${r.headingTransitionDuration}ms`);
951
- let s = document.getElementById(no);
952
- s || (s = document.createElement("style"), s.id = no, document.head.appendChild(s));
951
+ let s = document.getElementById(ao);
952
+ s || (s = document.createElement("style"), s.id = ao, document.head.appendChild(s));
953
953
  const c = r.linkUnderline === "always" ? "underline" : "none", l = r.linkUnderline === "none" ? "none" : "underline";
954
954
  s.textContent = `
955
955
  html a:not(button):not([role="button"]) {
@@ -985,12 +985,12 @@ function en() {
985
985
  "--heading-transition-duration"
986
986
  ])
987
987
  r.style.removeProperty(s);
988
- const n = document.getElementById(no);
988
+ const n = document.getElementById(ao);
989
989
  n && n.remove();
990
990
  }
991
991
  function Ha() {
992
992
  const r = O.get(qt);
993
- return r ? (ao(r), r) : null;
993
+ return r ? (so(r), r) : null;
994
994
  }
995
995
  function pn(r) {
996
996
  const [n, s, c] = Tr(r);
@@ -1018,7 +1018,7 @@ const fn = {
1018
1018
  "--warning-foreground": "Warning FG",
1019
1019
  "--border": "Border"
1020
1020
  };
1021
- function Zr(r, n) {
1021
+ function qr(r, n) {
1022
1022
  const s = [];
1023
1023
  for (const [c, l] of Object.entries(fn)) {
1024
1024
  const h = r[c];
@@ -1058,7 +1058,7 @@ async function za(r) {
1058
1058
  function Vt(r, n, s, c, l, h, p) {
1059
1059
  switch (r) {
1060
1060
  case "buttons": {
1061
- const u = p ?? St;
1061
+ const u = p ?? $t;
1062
1062
  return {
1063
1063
  button: {
1064
1064
  paddingX: { $value: `${u.paddingX}px`, $type: "dimension" },
@@ -1167,7 +1167,7 @@ function Aa(r) {
1167
1167
  alertStyle: s.a,
1168
1168
  interactionStyle: s.i,
1169
1169
  typoInteractionStyle: s.ti,
1170
- buttonStyle: s.bs || { ...St }
1170
+ buttonStyle: s.bs || { ...$t }
1171
1171
  };
1172
1172
  } catch {
1173
1173
  return null;
@@ -1233,11 +1233,11 @@ function rn(r, n, s, c, l) {
1233
1233
  }
1234
1234
  };
1235
1235
  }
1236
- function qr(r) {
1236
+ function Jr(r) {
1237
1237
  const n = r.trim().toLowerCase();
1238
1238
  if (n.startsWith("#")) {
1239
1239
  let h = n;
1240
- return h.length === 4 && (h = `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`), /^#[0-9a-f]{6}$/.test(h) ? Ct(h) : null;
1240
+ return h.length === 4 && (h = `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`), /^#[0-9a-f]{6}$/.test(h) ? Nt(h) : null;
1241
1241
  }
1242
1242
  const s = n.match(/hsla?\(\s*([\d.]+)[\s,]+([\d.]+)%[\s,]+([\d.]+)%/);
1243
1243
  if (s) return `${parseFloat(s[1])} ${parseFloat(s[2])}% ${parseFloat(s[3])}%`;
@@ -1246,7 +1246,7 @@ function qr(r) {
1246
1246
  const l = n.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/);
1247
1247
  if (l) {
1248
1248
  const h = `#${[l[1], l[2], l[3]].map((p) => Math.round(parseFloat(p)).toString(16).padStart(2, "0")).join("")}`;
1249
- return Ct(h);
1249
+ return Nt(h);
1250
1250
  }
1251
1251
  return null;
1252
1252
  }
@@ -1316,7 +1316,7 @@ function Va(r) {
1316
1316
  n.raw[p] = u;
1317
1317
  const m = Da[p] || (p.startsWith("--") ? p : null);
1318
1318
  if (m && Ia.has(m)) {
1319
- const v = qr(u);
1319
+ const v = Jr(u);
1320
1320
  if (v) {
1321
1321
  n.colors[m] = v;
1322
1322
  continue;
@@ -1447,13 +1447,13 @@ function Va(r) {
1447
1447
  m != null && n.cardStyle.borderRadius == null && (n.cardStyle.borderRadius = m);
1448
1448
  break;
1449
1449
  case "color": {
1450
- const b = qr(u);
1450
+ const b = Jr(u);
1451
1451
  b && !n.colors["--foreground"] && (n.colors["--foreground"] = b);
1452
1452
  break;
1453
1453
  }
1454
1454
  case "background":
1455
1455
  case "background-color": {
1456
- const b = qr(u);
1456
+ const b = Jr(u);
1457
1457
  b && !n.colors["--background"] && (n.colors["--background"] = b);
1458
1458
  break;
1459
1459
  }
@@ -1728,7 +1728,7 @@ function Ce({
1728
1728
  u && /* @__PURE__ */ e(sn, { upgradeUrl: g, signInUrl: l, feature: r, onClose: () => m(!1) })
1729
1729
  ] });
1730
1730
  }
1731
- function so(r, n) {
1731
+ function lo(r, n) {
1732
1732
  return Math.sqrt((r.r - n.r) ** 2 + (r.g - n.g) ** 2 + (r.b - n.b) ** 2);
1733
1733
  }
1734
1734
  function vn(r, n, s) {
@@ -1743,7 +1743,7 @@ function ln(r) {
1743
1743
  const { s: n } = vn(r.r, r.g, r.b);
1744
1744
  return n;
1745
1745
  }
1746
- function Jr(r) {
1746
+ function Qr(r) {
1747
1747
  return 0.299 * r.r + 0.587 * r.g + 0.114 * r.b;
1748
1748
  }
1749
1749
  function Xa(r, n) {
@@ -1751,7 +1751,7 @@ function Xa(r, n) {
1751
1751
  s.push({ ...r[c] });
1752
1752
  for (let l = 1; l < n; l++) {
1753
1753
  const h = r.map((m) => {
1754
- const b = Math.min(...s.map((g) => so(m, g)));
1754
+ const b = Math.min(...s.map((g) => lo(m, g)));
1755
1755
  return b * b;
1756
1756
  }), p = h.reduce((m, b) => m + b, 0);
1757
1757
  let u = Math.random() * p;
@@ -1771,7 +1771,7 @@ function Ka(r, n, s) {
1771
1771
  for (const p of r) {
1772
1772
  let u = 1 / 0, m = 0;
1773
1773
  for (let b = 0; b < c.length; b++) {
1774
- const g = so(p, c[b]);
1774
+ const g = lo(p, c[b]);
1775
1775
  g < u && (u = g, m = b);
1776
1776
  }
1777
1777
  h[m].push(p);
@@ -1792,7 +1792,7 @@ function Za(r, n) {
1792
1792
  if (c.has(l)) continue;
1793
1793
  let h = { ...r[l] }, p = 1;
1794
1794
  for (let u = l + 1; u < r.length; u++)
1795
- c.has(u) || so(r[l], r[u]) < n && (h.r += r[u].r, h.g += r[u].g, h.b += r[u].b, p++, c.add(u));
1795
+ c.has(u) || lo(r[l], r[u]) < n && (h.r += r[u].r, h.g += r[u].g, h.b += r[u].b, p++, c.add(u));
1796
1796
  s.push({ r: h.r / p, g: h.g / p, b: h.b / p }), c.add(l);
1797
1797
  }
1798
1798
  return s;
@@ -1826,7 +1826,7 @@ function kn(r) {
1826
1826
  const j = n[0];
1827
1827
  n.push({ r: Math.min(255, j.r + 30), g: Math.min(255, j.g + 30), b: Math.min(255, j.b + 30) });
1828
1828
  }
1829
- const s = [...n].sort((j, i) => Jr(j) - Jr(i)), c = s[0], l = s[s.length - 1], p = r.reduce((j, i) => j + Jr(i), 0) / r.length < 128, u = p ? c : l, m = p ? l : c, b = n.filter((j) => j !== c && j !== l);
1829
+ const s = [...n].sort((j, i) => Qr(j) - Qr(i)), c = s[0], l = s[s.length - 1], p = r.reduce((j, i) => j + Qr(i), 0) / r.length < 128, u = p ? c : l, m = p ? l : c, b = n.filter((j) => j !== c && j !== l);
1830
1830
  b.sort((j, i) => ln(i) - ln(j));
1831
1831
  const g = b[0] || s[Math.floor(s.length / 2)], v = b[1] || s[Math.floor(s.length / 3)], T = b[2] || s[Math.floor(s.length * 2 / 3)];
1832
1832
  return {
@@ -1954,7 +1954,7 @@ const $s = [
1954
1954
  { name: "Bell", icon: Cs },
1955
1955
  { name: "Clock", icon: Ns },
1956
1956
  { name: "Download", icon: Ss }
1957
- ], Qr = [
1957
+ ], eo = [
1958
1958
  { key: "--brand", label: "Primary" },
1959
1959
  { key: "--secondary", label: "Secondary" },
1960
1960
  { key: "--accent", label: "Accent" },
@@ -2042,15 +2042,15 @@ function Ls({
2042
2042
  );
2043
2043
  Ln(H);
2044
2044
  }, [K]);
2045
- const [ge, ce] = S(!1), [dt, fe] = S(!1), [Er, ht] = S(!1), [te, be] = S(!1), [Se, Lt] = S(null), [Cn, lo] = S(!1), [Qt, io] = S(
2045
+ const [ge, ce] = S(!1), [ht, fe] = S(!1), [Er, ut] = S(!1), [te, be] = S(!1), [Se, Mt] = S(null), [Cn, io] = S(!1), [Qt, co] = S(
2046
2046
  /* @__PURE__ */ new Set(["colors", "card", "typography", "alerts", "interactions"])
2047
- ), [Nn, er] = S(!1), [Sn, Mt] = S(!1), [co, Tt] = S({}), [ho, xe] = S("idle"), Rr = It(null), uo = It(null), po = It({}), go = It(null), [$n, Ln] = S({}), [pe, ut] = S([]), [jt, $e] = S(0), [tr, Ot] = S(-1), [fo, rr] = S(!1), [x, pt] = S(() => O.get(Ut) || { ...Xr }), [Ye, Ge] = S(!1), [Mn, mo] = S(!1), [Te, or] = S(
2047
+ ), [Nn, er] = S(!1), [Sn, Tt] = S(!1), [ho, jt] = S({}), [Rr, xe] = S("idle"), Pr = It(null), uo = It(null), po = It({}), go = It(null), [$n, Ln] = S({}), [pe, pt] = S([]), [Ot, $e] = S(0), [tr, Ft] = S(-1), [fo, rr] = S(!1), [x, gt] = S(() => O.get(Ut) || { ...Kr }), [Ye, Ge] = S(!1), [Mn, mo] = S(!1), [Te, or] = S(
2048
2048
  "css"
2049
- ), [C, gt] = S(
2050
- () => O.get($t) || { ...vr }
2049
+ ), [C, ft] = S(
2050
+ () => O.get(Lt) || { ...vr }
2051
2051
  ), [nr, bo] = S(
2052
- () => ct()
2053
- ), [ft, xo] = S(""), [yo, Pr] = S(""), [Wr, vo] = S(!1), ko = pa(
2052
+ () => dt()
2053
+ ), [mt, xo] = S(""), [yo, Wr] = S(""), [Br, vo] = S(!1), ko = pa(
2054
2054
  () => [
2055
2055
  ...Xo,
2056
2056
  ...nr.map((t) => ({ label: `${t.label} *`, value: t.value }))
@@ -2058,13 +2058,13 @@ function Ls({
2058
2058
  [nr]
2059
2059
  ), [_e, Ue] = S(!1), [Tn, wo] = S(!1), [je, ar] = S(
2060
2060
  "css"
2061
- ), [I, Xe] = S(() => O.get(Nt) || { ...Gt }), [ne, sr] = S(() => O.get(Kt) || { ...wr }), [Ke, Ft] = S(!1), [jn, Co] = S(!1), [Oe, No] = S(
2061
+ ), [I, Xe] = S(() => O.get(St) || { ...Gt }), [ne, sr] = S(() => O.get(Kt) || { ...wr }), [Ke, Et] = S(!1), [jn, Co] = S(!1), [Oe, No] = S(
2062
2062
  "css"
2063
- ), [Ze, Et] = S(!1), [On, So] = S(!1), [Fe, $o] = S(
2063
+ ), [Ze, Rt] = S(!1), [On, So] = S(!1), [Fe, $o] = S(
2064
2064
  "css"
2065
- ), [Fn, Lo] = S(!1), [$, mt] = S(() => O.get(Or) || { ...St }), [R, bt] = S(() => O.get(Zt) || { ...Cr }), [qe, Je] = S(!1), [En, Mo] = S(!1), [Ee, lr] = S("css"), [Qe, et] = S(!1), [Rn, To] = S(!1), [Re, ir] = S("css"), [Pn, cr] = S(!1), [E, Rt] = S(() => O.get(
2065
+ ), [Fn, Lo] = S(!1), [$, bt] = S(() => O.get(Or) || { ...$t }), [R, xt] = S(() => O.get(Zt) || { ...Cr }), [qe, Je] = S(!1), [En, Mo] = S(!1), [Ee, lr] = S("css"), [Qe, et] = S(!1), [Rn, To] = S(!1), [Re, ir] = S("css"), [Pn, cr] = S(!1), [E, Pt] = S(() => O.get(
2066
2066
  qt
2067
- ) || { ...$r }), [tt, rt] = S(!1), [Wn, jo] = S(!1), [Pe, dr] = S("css"), [Bn, Pt] = S(!1), [Br, de] = S(!1), [We, ye] = S("idle"), [Hr, hr] = S(""), [zr, xt] = S(""), [Hn, Be] = S(!1), [Le, ur] = S("css"), [zn, pr] = S(!1), [An, gr] = S(!1), [Dn, fr] = S(!1), [In, Wt] = S(""), [W, yt] = S(null), [Vn, vt] = S(!1), [ot, Bt] = S(null), [Oo, Fo] = S(null), [nt, Ar] = S(null), [at, st] = S("#000000"), Ht = (t) => {
2067
+ ) || { ...$r }), [tt, rt] = S(!1), [Wn, jo] = S(!1), [Pe, dr] = S("css"), [Bn, Wt] = S(!1), [Hr, de] = S(!1), [We, ye] = S("idle"), [zr, hr] = S(""), [Ar, yt] = S(""), [Hn, Be] = S(!1), [Le, ur] = S("css"), [zn, pr] = S(!1), [An, gr] = S(!1), [Dn, fr] = S(!1), [In, Bt] = S(""), [W, vt] = S(null), [Vn, kt] = S(!1), [ot, Ht] = S(null), [Oo, Fo] = S(null), [nt, Dr] = S(null), [at, st] = S("#000000"), zt = (t) => {
2068
2068
  s == null || s(t);
2069
2069
  };
2070
2070
  oe(() => {
@@ -2078,7 +2078,7 @@ function Ls({
2078
2078
  if (a) {
2079
2079
  for (const [d, f] of Object.entries(a.colors))
2080
2080
  document.documentElement.style.setProperty(d, f);
2081
- A(a.colors), pt(a.cardStyle), yr(a.cardStyle, a.colors), gt(a.typographyState), Xt(a.typographyState), Xe(a.alertStyle), kr(a.alertStyle), bt(a.interactionStyle), Nr(a.interactionStyle), Rt(a.typoInteractionStyle), ao(a.typoInteractionStyle), mt(a.buttonStyle), Sr(a.buttonStyle), window.history.replaceState(
2081
+ A(a.colors), gt(a.cardStyle), yr(a.cardStyle, a.colors), ft(a.typographyState), Xt(a.typographyState), Xe(a.alertStyle), kr(a.alertStyle), xt(a.interactionStyle), Nr(a.interactionStyle), Pt(a.typoInteractionStyle), so(a.typoInteractionStyle), bt(a.buttonStyle), Sr(a.buttonStyle), window.history.replaceState(
2082
2082
  null,
2083
2083
  "",
2084
2084
  window.location.pathname + window.location.search
@@ -2086,13 +2086,13 @@ function Ls({
2086
2086
  }
2087
2087
  }, []);
2088
2088
  const lt = se((t) => {
2089
- pt((a) => {
2089
+ gt((a) => {
2090
2090
  const d = { ...a, ...t };
2091
2091
  return t.preset === void 0 && a.preset !== "custom" && (d.preset = "custom"), d;
2092
2092
  });
2093
2093
  }, []), Yn = se((t) => {
2094
2094
  const a = ka[t];
2095
- a && pt((d) => ({ ...d, ...a }));
2095
+ a && gt((d) => ({ ...d, ...a }));
2096
2096
  }, []);
2097
2097
  oe(() => {
2098
2098
  Xt(C);
@@ -2100,31 +2100,31 @@ function Ls({
2100
2100
  La(), Ta();
2101
2101
  }, []);
2102
2102
  const ve = se((t) => {
2103
- gt((a) => {
2103
+ ft((a) => {
2104
2104
  const d = { ...a, ...t };
2105
2105
  return t.preset === void 0 && a.preset !== "custom" && (d.preset = "custom"), d;
2106
2106
  });
2107
2107
  }, []), Gn = se((t) => {
2108
2108
  const a = Ca[t];
2109
- a && gt({ ...a });
2109
+ a && ft({ ...a });
2110
2110
  }, []), Eo = se(async () => {
2111
- const t = ft.trim();
2111
+ const t = mt.trim();
2112
2112
  if (t) {
2113
- vo(!0), Pr("");
2113
+ vo(!0), Wr("");
2114
2114
  try {
2115
- await Sa(t), bo(ct()), xo("");
2115
+ await Sa(t), bo(dt()), xo("");
2116
2116
  } catch (a) {
2117
- Pr(
2117
+ Wr(
2118
2118
  a instanceof Error ? a.message : "Failed to add font"
2119
2119
  );
2120
2120
  } finally {
2121
2121
  vo(!1);
2122
2122
  }
2123
2123
  }
2124
- }, [ft]), _n = se(
2124
+ }, [mt]), _n = se(
2125
2125
  (t) => {
2126
- const d = ct().find((f) => f.label === t);
2127
- if ($a(t), bo(ct()), d) {
2126
+ const d = dt().find((f) => f.label === t);
2127
+ if ($a(t), bo(dt()), d) {
2128
2128
  const f = Xo[0].value, L = {};
2129
2129
  C.headingFamily === d.value && (L.headingFamily = f), C.bodyFamily === d.value && (L.bodyFamily = f), Object.keys(L).length && ve(L);
2130
2130
  }
@@ -2136,7 +2136,7 @@ function Ls({
2136
2136
  }, [I]), oe(() => {
2137
2137
  ja();
2138
2138
  }, []);
2139
- const Dr = se((t) => {
2139
+ const Ir = se((t) => {
2140
2140
  Xe((a) => {
2141
2141
  const d = { ...a, ...t };
2142
2142
  return t.preset === void 0 && a.preset !== "custom" && (d.preset = "custom"), d;
@@ -2145,7 +2145,7 @@ function Ls({
2145
2145
  const a = Zo[t];
2146
2146
  a && Xe({ ...a });
2147
2147
  }, []), Xn = () => {
2148
- O.remove(Nt), Kr(), Xe({ ...Gt }), O.remove(Kt), Jo(), sr({ ...wr });
2148
+ O.remove(St), Zr(), Xe({ ...Gt }), O.remove(Kt), Jo(), sr({ ...wr });
2149
2149
  };
2150
2150
  oe(() => {
2151
2151
  un(ne);
@@ -2165,7 +2165,7 @@ function Ls({
2165
2165
  Sr($);
2166
2166
  }, [$]);
2167
2167
  const ke = se((t) => {
2168
- mt((a) => ({ ...a, ...t }));
2168
+ bt((a) => ({ ...a, ...t }));
2169
2169
  }, []);
2170
2170
  oe(() => {
2171
2171
  Nr(R);
@@ -2174,9 +2174,9 @@ function Ls({
2174
2174
  }, []), oe(() => {
2175
2175
  Ea();
2176
2176
  }, []);
2177
- const zt = se(
2177
+ const At = se(
2178
2178
  (t) => {
2179
- bt((a) => {
2179
+ xt((a) => {
2180
2180
  const d = { ...a, ...t };
2181
2181
  return t.preset === void 0 && a.preset !== "custom" && (d.preset = "custom"), d;
2182
2182
  });
@@ -2184,18 +2184,18 @@ function Ls({
2184
2184
  []
2185
2185
  ), Zn = se((t) => {
2186
2186
  const a = Fa[t];
2187
- a && bt({ ...a });
2187
+ a && xt({ ...a });
2188
2188
  }, []), qn = () => {
2189
- O.remove(Zt), Qo(), bt({ ...Cr });
2189
+ O.remove(Zt), Qo(), xt({ ...Cr });
2190
2190
  };
2191
2191
  oe(() => {
2192
- ao(E);
2192
+ so(E);
2193
2193
  }, [E]), oe(() => {
2194
2194
  Ha();
2195
2195
  }, []);
2196
2196
  const He = se(
2197
2197
  (t) => {
2198
- Rt((a) => {
2198
+ Pt((a) => {
2199
2199
  const d = { ...a, ...t };
2200
2200
  return t.preset === void 0 && a.preset !== "custom" && (d.preset = "custom"), d;
2201
2201
  });
@@ -2203,9 +2203,9 @@ function Ls({
2203
2203
  []
2204
2204
  ), Jn = se((t) => {
2205
2205
  const a = Ba[t];
2206
- a && Rt({ ...a });
2206
+ a && Pt({ ...a });
2207
2207
  }, []), Qn = () => {
2208
- O.remove(qt), en(), Rt({ ...$r });
2208
+ O.remove(qt), en(), Pt({ ...$r });
2209
2209
  }, Po = se(
2210
2210
  (t) => {
2211
2211
  let a = "";
@@ -2261,7 +2261,7 @@ ${a}}`;
2261
2261
  ), ea = se(
2262
2262
  async (t, a) => {
2263
2263
  if (!v || !r) return;
2264
- Tt((f) => ({
2264
+ jt((f) => ({
2265
2265
  ...f,
2266
2266
  [a]: { status: "creating" }
2267
2267
  }));
@@ -2274,7 +2274,7 @@ ${a}}`;
2274
2274
  }), y = await F.json();
2275
2275
  if (!F.ok) {
2276
2276
  if (F.status === 429) {
2277
- Tt((w) => ({
2277
+ jt((w) => ({
2278
2278
  ...w,
2279
2279
  [a]: { status: "rate-limited", error: y.error }
2280
2280
  })), d == null || d.close();
@@ -2282,19 +2282,19 @@ ${a}}`;
2282
2282
  }
2283
2283
  throw new Error(y.error || "Failed to create PR");
2284
2284
  }
2285
- Tt((w) => ({
2285
+ jt((w) => ({
2286
2286
  ...w,
2287
2287
  [a]: { status: "created", url: y.url }
2288
2288
  })), d ? d.location.href = y.url : window.open(y.url, "_blank");
2289
2289
  } catch {
2290
- Tt((f) => ({
2290
+ jt((f) => ({
2291
2291
  ...f,
2292
2292
  [a]: { status: "error" }
2293
2293
  })), d == null || d.close();
2294
2294
  }
2295
2295
  },
2296
2296
  [v, r, Po]
2297
- ), At = (t, a) => {
2297
+ ), Dt = (t, a) => {
2298
2298
  const d = a.toLowerCase();
2299
2299
  if (t === "--brand" && (d === "#000000" || d === "#ffffff"))
2300
2300
  return;
@@ -2303,7 +2303,7 @@ ${a}}`;
2303
2303
  if ((V === "#000000" || V === "#ffffff") && d === V || (k === "#000000" || k === "#ffffff") && d === k)
2304
2304
  return;
2305
2305
  }
2306
- const f = Ct(a), L = O.get(
2306
+ const f = Nt(a), L = O.get(
2307
2307
  Me
2308
2308
  ) || [];
2309
2309
  L.push({ key: t, previousValue: i[t] || "" }), document.documentElement.style.setProperty(t, f);
@@ -2324,7 +2324,7 @@ ${a}}`;
2324
2324
  const G = Ie(F, H);
2325
2325
  for (const [V, k] of Object.entries(G))
2326
2326
  L.push({ key: V, previousValue: F[V] || "" }), document.documentElement.style.setProperty(V, k), F[V] = k, y[V] = k;
2327
- O.set(Me, L), A(F), O.set(ue, y), _t(G), window.dispatchEvent(new Event("theme-pending-update")), Ht(F), n && (Rr.current && clearTimeout(Rr.current), Rr.current = setTimeout(() => Dt(), 800));
2327
+ O.set(Me, L), A(F), O.set(ue, y), _t(G), window.dispatchEvent(new Event("theme-pending-update")), zt(F), n && (Pr.current && clearTimeout(Pr.current), Pr.current = setTimeout(() => it(), 800));
2328
2328
  }, mr = () => {
2329
2329
  let t = `:root {
2330
2330
  `;
@@ -2396,55 +2396,55 @@ colors: {
2396
2396
  `, d += ` ring: "hsl(var(--ring))",
2397
2397
  `, d += "}";
2398
2398
  const f = t + d;
2399
- c ? c(f) : Lt(f);
2399
+ c ? c(f) : Mt(f);
2400
2400
  }, ta = (t) => {
2401
2401
  if (!v) return;
2402
- const a = Ur[t], d = i["--brand"];
2402
+ const a = Xr[t], d = i["--brand"];
2403
2403
  if (!d) return;
2404
2404
  const f = ya(d, a, i, B), L = O.get(
2405
2405
  Me
2406
2406
  ) || [], F = O.get(ue) || {}, y = { ...i };
2407
2407
  for (const [w, H] of Object.entries(f))
2408
2408
  L.push({ key: w, previousValue: y[w] || "" }), document.documentElement.style.setProperty(w, H), y[w] = H, F[w] = H;
2409
- O.set(Me, L), A(y), O.set(ue, F), window.dispatchEvent(new Event("theme-pending-update")), Ot(t), rr(!1), Ht(y), n && Dt();
2410
- }, Ir = () => {
2409
+ O.set(Me, L), A(y), O.set(ue, F), window.dispatchEvent(new Event("theme-pending-update")), Ft(t), rr(!1), zt(y), n && it();
2410
+ }, Vr = () => {
2411
2411
  J({ ...i });
2412
2412
  const t = document.documentElement.classList.contains("dark"), a = va(i, B, t), d = O.get(
2413
2413
  Me
2414
2414
  ) || [], f = O.get(ue) || {}, L = { ...i };
2415
2415
  for (const [F, y] of Object.entries(a))
2416
2416
  d.push({ key: F, previousValue: L[F] || "" }), document.documentElement.style.setProperty(F, y), L[F] = y, f[F] = y;
2417
- O.set(Me, d), A(L), O.set(ue, f), window.dispatchEvent(new Event("theme-pending-update")), Ot(-1), Ht(L), n && Dt();
2417
+ O.set(Me, d), A(L), O.set(ue, f), window.dispatchEvent(new Event("theme-pending-update")), Ft(-1), zt(L), n && it();
2418
2418
  }, ra = () => {
2419
2419
  if (!_) return;
2420
2420
  const t = O.get(ue) || {};
2421
2421
  for (const [a, d] of Object.entries(_))
2422
2422
  document.documentElement.style.setProperty(a, d), t[a] = d;
2423
- A(_), O.set(ue, t), window.dispatchEvent(new Event("theme-pending-update")), J(null), Ht(_), n && Dt();
2423
+ A(_), O.set(ue, t), window.dispatchEvent(new Event("theme-pending-update")), J(null), zt(_), n && it();
2424
2424
  }, Wo = async (t) => {
2425
2425
  try {
2426
2426
  ye("extracting");
2427
2427
  const a = await Ja(t), d = URL.createObjectURL(t);
2428
- Bt({ imageUrl: d, palette: a }), ye("idle");
2428
+ Ht({ imageUrl: d, palette: a }), ye("idle");
2429
2429
  } catch (a) {
2430
2430
  console.error("Image palette extraction failed:", a), ye("error"), setTimeout(() => ye("idle"), 3e3);
2431
2431
  }
2432
2432
  }, Bo = async () => {
2433
- const t = Hr.trim();
2433
+ const t = zr.trim();
2434
2434
  if (t) {
2435
2435
  try {
2436
2436
  new URL(t);
2437
2437
  } catch {
2438
- xt("Please enter a valid URL");
2438
+ yt("Please enter a valid URL");
2439
2439
  return;
2440
2440
  }
2441
- xt("");
2441
+ yt("");
2442
2442
  try {
2443
2443
  ye("extracting");
2444
2444
  const a = await qa(t);
2445
- Bt({ imageUrl: t, palette: a }), ye("idle"), hr("");
2445
+ Ht({ imageUrl: t, palette: a }), ye("idle"), hr("");
2446
2446
  } catch (a) {
2447
- console.error("Image URL palette extraction failed:", a), xt(
2447
+ console.error("Image URL palette extraction failed:", a), yt(
2448
2448
  "Failed to load image. The server may block cross-origin requests."
2449
2449
  ), ye("error"), setTimeout(() => ye("idle"), 3e3);
2450
2450
  }
@@ -2485,31 +2485,31 @@ colors: {
2485
2485
  ) || [], F = O.get(ue) || {}, y = { ...i };
2486
2486
  for (const [w, H] of Object.entries(a))
2487
2487
  H !== i[w] && (L.push({ key: w, previousValue: y[w] || "" }), document.documentElement.style.setProperty(w, H), y[w] = H, F[w] = H);
2488
- O.set(Me, L), A(y), O.set(ue, F), window.dispatchEvent(new Event("theme-pending-update")), Ot(-1), Ht(y), n && Dt(), ye("done"), setTimeout(() => ye("idle"), 3e3);
2488
+ O.set(Me, L), A(y), O.set(ue, F), window.dispatchEvent(new Event("theme-pending-update")), Ft(-1), zt(y), n && it(), ye("done"), setTimeout(() => ye("idle"), 3e3);
2489
2489
  }, Ho = () => {
2490
2490
  Ne.forEach(({ key: t }) => {
2491
2491
  document.documentElement.style.removeProperty(t);
2492
- }), O.remove(Mr), O.remove(ue), O.remove(Me), O.remove(Ut), Uo(), pt({ ...Xr }), O.remove($t), Ko(), gt({ ...vr }), O.remove(Nt), Kr(), Xe({ ...Gt }), O.remove(Or), Ra(), mt({ ...St }), O.remove(Zt), Qo(), bt({ ...Cr }), O.remove(qt), en(), Rt({ ...$r }), Q(), Lt(null), Tt({}), window.dispatchEvent(new Event("theme-pending-update"));
2492
+ }), O.remove(Mr), O.remove(ue), O.remove(Me), O.remove(Ut), Uo(), gt({ ...Kr }), O.remove(Lt), Ko(), ft({ ...vr }), O.remove(St), Zr(), Xe({ ...Gt }), O.remove(Or), Ra(), bt({ ...$t }), O.remove(Zt), Qo(), xt({ ...Cr }), O.remove(qt), en(), Pt({ ...$r }), Q(), Mt(null), jt({}), window.dispatchEvent(new Event("theme-pending-update"));
2493
2493
  }, na = () => {
2494
- O.remove(Ut), Uo(), pt({ ...Xr });
2494
+ O.remove(Ut), Uo(), gt({ ...Kr });
2495
2495
  }, aa = () => {
2496
- O.remove($t), Ko(), gt({ ...vr });
2497
- }, Vr = (t) => {
2496
+ O.remove(Lt), Ko(), ft({ ...vr });
2497
+ }, Yr = (t) => {
2498
2498
  const a = document.querySelector(t.selector);
2499
2499
  a && (a.scrollIntoView({ behavior: "smooth", block: "center" }), a.style.outline = "3px solid hsl(0 84% 60%)", a.style.outlineOffset = "2px", setTimeout(() => {
2500
2500
  a.style.outline = "", a.style.outlineOffset = "";
2501
2501
  }, 3e3));
2502
- }, Dt = async () => {
2502
+ }, it = async () => {
2503
2503
  var t;
2504
2504
  if (n) {
2505
- xe("running"), ut([]), $e(0);
2505
+ xe("running"), pt([]), $e(0);
2506
2506
  try {
2507
2507
  const a = (await import("axe-core")).default;
2508
2508
  if ((await a.run(
2509
2509
  { exclude: ["[data-axe-exclude]"] },
2510
2510
  { runOnly: { type: "rule", values: ["color-contrast"] } }
2511
2511
  )).violations.length === 0)
2512
- xe("idle"), ut([]), $e(0);
2512
+ xe("idle"), pt([]), $e(0);
2513
2513
  else {
2514
2514
  const f = getComputedStyle(document.documentElement), L = {};
2515
2515
  Ne.forEach(({ key: w }) => {
@@ -2527,7 +2527,7 @@ colors: {
2527
2527
  { runOnly: { type: "rule", values: ["color-contrast"] } }
2528
2528
  );
2529
2529
  if (y.violations.length === 0)
2530
- xe("idle"), ut([]), $e(0);
2530
+ xe("idle"), pt([]), $e(0);
2531
2531
  else {
2532
2532
  xe("failed");
2533
2533
  const w = [];
@@ -2536,7 +2536,7 @@ colors: {
2536
2536
  const V = String(G.target[0] || ""), k = document.querySelector(V), N = ((t = k == null ? void 0 : k.textContent) == null ? void 0 : t.trim().slice(0, 40)) || V;
2537
2537
  w.push({ selector: V, text: N });
2538
2538
  }
2539
- ut(w), $e(0);
2539
+ pt(w), $e(0);
2540
2540
  }
2541
2541
  }
2542
2542
  } catch {
@@ -2598,15 +2598,15 @@ colors: {
2598
2598
  const Y = Math.max(P, D, Z), re = Math.min(P, D, Z), he = (Y + re) / 2;
2599
2599
  if (Y === re) return { h: 0, s: 0, l: he };
2600
2600
  const me = Y - re, Io = he > 0.5 ? me / (2 - Y - re) : me / (Y + re);
2601
- let wt = 0;
2602
- return Y === P ? wt = ((D - Z) / me + (D < Z ? 6 : 0)) / 6 : Y === D ? wt = ((Z - P) / me + 2) / 6 : wt = ((P - D) / me + 4) / 6, { h: wt, s: Io, l: he };
2603
- }, it = (P, D, Z) => {
2601
+ let Ct = 0;
2602
+ return Y === P ? Ct = ((D - Z) / me + (D < Z ? 6 : 0)) / 6 : Y === D ? Ct = ((Z - P) / me + 2) / 6 : Ct = ((P - D) / me + 4) / 6, { h: Ct, s: Io, l: he };
2603
+ }, ct = (P, D, Z) => {
2604
2604
  const Y = D * Math.min(Z, 1 - Z), re = (he) => {
2605
2605
  const me = (he + P * 12) % 12;
2606
2606
  return Z - Y * Math.max(Math.min(me - 3, 9 - me, 1), -1);
2607
2607
  };
2608
2608
  return `rgb(${Math.round(re(0) * 255)}, ${Math.round(re(8) * 255)}, ${Math.round(re(4) * 255)})`;
2609
- }, kt = async (P) => {
2609
+ }, wt = async (P) => {
2610
2610
  const D = document.querySelector(
2611
2611
  P.target[0]
2612
2612
  );
@@ -2616,22 +2616,22 @@ colors: {
2616
2616
  const he = ae(...re), me = ae(...Y);
2617
2617
  if ((Math.max(me, he) + 0.05) / (Math.min(me, he) + 0.05) >= 4.5) return;
2618
2618
  D.scrollIntoView({ behavior: "smooth", block: "center" }), d(D, "hsl(0 84% 60%)"), await a(300);
2619
- const wt = ze(...Y);
2619
+ const Ct = ze(...Y);
2620
2620
  let Vo = !1;
2621
2621
  for (const la of [
2622
2622
  he > 0.5 ? -0.01 : 0.01,
2623
2623
  he > 0.5 ? 0.01 : -0.01
2624
2624
  ]) {
2625
- const we = { ...wt };
2625
+ const we = { ...Ct };
2626
2626
  for (let Yo = 0; Yo < 100; Yo++) {
2627
2627
  we.l = Math.max(0, Math.min(1, we.l + la));
2628
- const ia = we.s * Math.min(we.l, 1 - we.l), Yr = [0, 0, 0];
2628
+ const ia = we.s * Math.min(we.l, 1 - we.l), Gr = [0, 0, 0];
2629
2629
  for (let br = 0; br < 3; br++) {
2630
2630
  const Go = ([0, 8, 4][br] + we.h * 12) % 12;
2631
- Yr[br] = we.l - ia * Math.max(Math.min(Go - 3, 9 - Go, 1), -1);
2631
+ Gr[br] = we.l - ia * Math.max(Math.min(Go - 3, 9 - Go, 1), -1);
2632
2632
  }
2633
- if ((Math.max(ae(...Yr), he) + 0.05) / (Math.min(ae(...Yr), he) + 0.05) >= 4.5) {
2634
- D.style.color = it(we.h, we.s, we.l), Vo = !0;
2633
+ if ((Math.max(ae(...Gr), he) + 0.05) / (Math.min(ae(...Gr), he) + 0.05) >= 4.5) {
2634
+ D.style.color = ct(we.h, we.s, we.l), Vo = !0;
2635
2635
  break;
2636
2636
  }
2637
2637
  }
@@ -2646,12 +2646,12 @@ colors: {
2646
2646
  );
2647
2647
  if (!Z) break;
2648
2648
  for (let Y = 0; Y < Z.nodes.length; Y++)
2649
- $e(Y), await kt(Z.nodes[Y]);
2649
+ $e(Y), await wt(Z.nodes[Y]);
2650
2650
  }
2651
2651
  await a(400);
2652
2652
  const Ae = await z();
2653
2653
  if (Ae.violations.length === 0)
2654
- xe("passed"), ut([]), $e(0);
2654
+ xe("passed"), pt([]), $e(0);
2655
2655
  else {
2656
2656
  xe("failed");
2657
2657
  const P = [];
@@ -2660,7 +2660,7 @@ colors: {
2660
2660
  const Y = String(Z.target[0] || ""), re = document.querySelector(Y), he = ((t = re == null ? void 0 : re.textContent) == null ? void 0 : t.trim().slice(0, 40)) || Y;
2661
2661
  P.push({ selector: Y, text: he });
2662
2662
  }
2663
- ut(P), $e(0);
2663
+ pt(P), $e(0);
2664
2664
  }
2665
2665
  } catch (a) {
2666
2666
  console.error("fixContrastIssues failed:", a), xe("failed");
@@ -2877,7 +2877,7 @@ colors: {
2877
2877
  /* @__PURE__ */ e(
2878
2878
  "button",
2879
2879
  {
2880
- onClick: () => de(!Br),
2880
+ onClick: () => de(!Hr),
2881
2881
  className: "p-2 rounded-lg transition-opacity hover:opacity-70 md:hidden",
2882
2882
  style: { color: "hsl(var(--foreground))" },
2883
2883
  "aria-label": "Toggle menu",
@@ -2889,7 +2889,7 @@ colors: {
2889
2889
  stroke: "currentColor",
2890
2890
  viewBox: "0 0 24 24",
2891
2891
  strokeWidth: 2,
2892
- children: Br ? /* @__PURE__ */ e(
2892
+ children: Hr ? /* @__PURE__ */ e(
2893
2893
  "path",
2894
2894
  {
2895
2895
  strokeLinecap: "round",
@@ -2936,8 +2936,8 @@ colors: {
2936
2936
  const a = t.target.value;
2937
2937
  if (a === "reset-all") fe(!0);
2938
2938
  else if (a === "default")
2939
- Ot(-1), Ir();
2940
- else if (a === "refresh") Ir();
2939
+ Ft(-1), Vr();
2940
+ else if (a === "refresh") Vr();
2941
2941
  else if (a === "upload") Be(!0);
2942
2942
  else if (a === "export") gr(!0);
2943
2943
  else if (a === "share") {
@@ -2953,7 +2953,7 @@ colors: {
2953
2953
  window.location.hash = d, navigator.clipboard.writeText(window.location.href).then(() => {
2954
2954
  pr(!0), setTimeout(() => pr(!1), 2e3);
2955
2955
  });
2956
- } else a === "pr" && Mt(!0);
2956
+ } else a === "pr" ? Tt(!0) : a === "audit" && it();
2957
2957
  t.target.value = "";
2958
2958
  },
2959
2959
  children: [
@@ -2964,7 +2964,8 @@ colors: {
2964
2964
  /* @__PURE__ */ e("option", { value: "upload", children: "Upload Image" }),
2965
2965
  /* @__PURE__ */ e("option", { value: "export", children: "Export Palette" }),
2966
2966
  /* @__PURE__ */ e("option", { value: "share", children: "Share" }),
2967
- /* @__PURE__ */ e("option", { value: "pr", children: "Open PR" })
2967
+ /* @__PURE__ */ e("option", { value: "pr", children: "Open PR" }),
2968
+ n && /* @__PURE__ */ e("option", { value: "audit", children: "Accessibility Check" })
2968
2969
  ]
2969
2970
  }
2970
2971
  ) })
@@ -3002,7 +3003,7 @@ colors: {
3002
3003
  /* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ o(
3003
3004
  "button",
3004
3005
  {
3005
- onClick: Ir,
3006
+ onClick: Vr,
3006
3007
  className: "ds-global-btn h-12 px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-80 flex items-center justify-center gap-1",
3007
3008
  children: [
3008
3009
  /* @__PURE__ */ e(
@@ -3089,7 +3090,7 @@ colors: {
3089
3090
  )
3090
3091
  }
3091
3092
  ),
3092
- /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: tr >= 0 ? Ur[tr] : "Palette Options" }),
3093
+ /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: tr >= 0 ? Xr[tr] : "Palette Options" }),
3093
3094
  /* @__PURE__ */ e(
3094
3095
  "svg",
3095
3096
  {
@@ -3141,7 +3142,7 @@ colors: {
3141
3142
  "button",
3142
3143
  {
3143
3144
  onClick: () => {
3144
- Ot(-1), rr(!1);
3145
+ Ft(-1), rr(!1);
3145
3146
  },
3146
3147
  className: "w-full text-left px-4 py-2 text-[14px] font-light transition-colors hover:opacity-80 flex items-center justify-between",
3147
3148
  style: { color: "hsl(var(--foreground))" },
@@ -3151,7 +3152,7 @@ colors: {
3151
3152
  ]
3152
3153
  }
3153
3154
  ),
3154
- Ur.map((t, a) => /* @__PURE__ */ o(
3155
+ Xr.map((t, a) => /* @__PURE__ */ o(
3155
3156
  "button",
3156
3157
  {
3157
3158
  onClick: () => ta(a),
@@ -3388,7 +3389,7 @@ colors: {
3388
3389
  children: /* @__PURE__ */ o(
3389
3390
  "button",
3390
3391
  {
3391
- onClick: () => Mt(!0),
3392
+ onClick: () => Tt(!0),
3392
3393
  className: "ds-global-btn h-12 px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-80 flex items-center justify-center gap-1",
3393
3394
  children: [
3394
3395
  /* @__PURE__ */ e(
@@ -3421,6 +3422,35 @@ colors: {
3421
3422
  }
3422
3423
  )
3423
3424
  }
3425
+ ),
3426
+ n && /* @__PURE__ */ o(
3427
+ "button",
3428
+ {
3429
+ onClick: () => it(),
3430
+ className: "ds-global-btn h-12 px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-80 flex items-center justify-center gap-1",
3431
+ title: "Run accessibility audit",
3432
+ children: [
3433
+ /* @__PURE__ */ e(
3434
+ "svg",
3435
+ {
3436
+ className: "w-4 h-4 flex-shrink-0",
3437
+ fill: "none",
3438
+ stroke: "currentColor",
3439
+ viewBox: "0 0 24 24",
3440
+ strokeWidth: 2,
3441
+ children: /* @__PURE__ */ e(
3442
+ "path",
3443
+ {
3444
+ strokeLinecap: "round",
3445
+ strokeLinejoin: "round",
3446
+ d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
3447
+ }
3448
+ )
3449
+ }
3450
+ ),
3451
+ /* @__PURE__ */ e("span", { className: "truncate", children: Rr === "running" ? "Auditing..." : "Accessibility Check" })
3452
+ ]
3453
+ }
3424
3454
  )
3425
3455
  ] }) }),
3426
3456
  /* @__PURE__ */ e("div", { className: "w-full md:pt-12" }),
@@ -3590,7 +3620,7 @@ colors: {
3590
3620
  className: "w-full sm:w-auto order-first sm:order-last flex-shrink-0 sm:min-h-[36px] pointer-events-none [&>*]:pointer-events-auto",
3591
3621
  "data-axe-exclude": !0,
3592
3622
  children: [
3593
- n && ho === "failed" && /* @__PURE__ */ o(
3623
+ n && Rr === "failed" && /* @__PURE__ */ o(
3594
3624
  "span",
3595
3625
  {
3596
3626
  "aria-live": "assertive",
@@ -3606,8 +3636,8 @@ colors: {
3606
3636
  "button",
3607
3637
  {
3608
3638
  onClick: () => {
3609
- const t = (jt - 1 + pe.length) % pe.length;
3610
- $e(t), Vr(pe[t]);
3639
+ const t = (Ot - 1 + pe.length) % pe.length;
3640
+ $e(t), Yr(pe[t]);
3611
3641
  },
3612
3642
  className: "text-red-600 dark:text-red-400 hover:opacity-70 disabled:opacity-30",
3613
3643
  disabled: pe.length <= 1,
@@ -3615,7 +3645,7 @@ colors: {
3615
3645
  }
3616
3646
  ),
3617
3647
  /* @__PURE__ */ o("span", { className: "text-[14px] tabular-nums", children: [
3618
- jt + 1,
3648
+ Ot + 1,
3619
3649
  "/",
3620
3650
  pe.length
3621
3651
  ] }),
@@ -3623,8 +3653,8 @@ colors: {
3623
3653
  "button",
3624
3654
  {
3625
3655
  onClick: () => {
3626
- const t = (jt + 1) % pe.length;
3627
- $e(t), Vr(pe[t]);
3656
+ const t = (Ot + 1) % pe.length;
3657
+ $e(t), Yr(pe[t]);
3628
3658
  },
3629
3659
  className: "text-red-600 dark:text-red-400 hover:opacity-70 disabled:opacity-30",
3630
3660
  disabled: pe.length <= 1,
@@ -3635,7 +3665,7 @@ colors: {
3635
3665
  "button",
3636
3666
  {
3637
3667
  onClick: () => {
3638
- pe[jt] && Vr(pe[jt]), setTimeout(() => sa(), 500);
3668
+ pe[Ot] && Yr(pe[Ot]), setTimeout(() => sa(), 500);
3639
3669
  },
3640
3670
  className: "ml-1 px-2 py-0.5 text-[14px] font-light rounded transition-colors hover:opacity-80 whitespace-nowrap",
3641
3671
  style: {
@@ -3648,7 +3678,7 @@ colors: {
3648
3678
  ]
3649
3679
  }
3650
3680
  ),
3651
- n && ho === "passed" && /* @__PURE__ */ o(
3681
+ n && Rr === "passed" && /* @__PURE__ */ o(
3652
3682
  "span",
3653
3683
  {
3654
3684
  "aria-live": "assertive",
@@ -3735,7 +3765,7 @@ colors: {
3735
3765
  )
3736
3766
  }
3737
3767
  ),
3738
- dt && /* @__PURE__ */ e(
3768
+ ht && /* @__PURE__ */ e(
3739
3769
  "div",
3740
3770
  {
3741
3771
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
@@ -3836,7 +3866,7 @@ colors: {
3836
3866
  /* @__PURE__ */ e(
3837
3867
  "button",
3838
3868
  {
3839
- onClick: () => ht(!1),
3869
+ onClick: () => ut(!1),
3840
3870
  className: "px-3 py-1.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
3841
3871
  style: {
3842
3872
  backgroundColor: "transparent",
@@ -3849,7 +3879,7 @@ colors: {
3849
3879
  "button",
3850
3880
  {
3851
3881
  onClick: () => {
3852
- na(), ht(!1);
3882
+ na(), ut(!1);
3853
3883
  },
3854
3884
  className: "px-3 py-1.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
3855
3885
  style: {
@@ -4029,7 +4059,7 @@ colors: {
4029
4059
  {
4030
4060
  onClick: () => {
4031
4061
  if (Se && Le === "css") {
4032
- Lt(null);
4062
+ Mt(null);
4033
4063
  return;
4034
4064
  }
4035
4065
  ur("css"), mr();
@@ -4077,7 +4107,7 @@ colors: {
4077
4107
  {
4078
4108
  onClick: () => {
4079
4109
  if (Se && Le === "tokens") {
4080
- Lt(null);
4110
+ Mt(null);
4081
4111
  return;
4082
4112
  }
4083
4113
  ur("tokens"), mr();
@@ -4163,7 +4193,7 @@ colors: {
4163
4193
  className: "grid grid-cols-3 sm:grid-cols-5 gap-2 sm:gap-5 rounded-lg p-4 overflow-visible",
4164
4194
  "data-axe-exclude": !0,
4165
4195
  style: { backgroundColor: "rgba(0,0,0,0.04)" },
4166
- children: Qr.filter(
4196
+ children: eo.filter(
4167
4197
  ({ key: t }) => [
4168
4198
  "--brand",
4169
4199
  "--secondary",
@@ -4206,7 +4236,7 @@ colors: {
4206
4236
  onClick: () => {
4207
4237
  var z;
4208
4238
  if (window.innerWidth < 640) {
4209
- Ar(t), st(d ? De(d) : "#000000");
4239
+ Dr(t), st(d ? De(d) : "#000000");
4210
4240
  return;
4211
4241
  }
4212
4242
  (z = document.getElementById("colors")) == null || z.scrollIntoView({
@@ -4249,7 +4279,7 @@ colors: {
4249
4279
  type: "color",
4250
4280
  "aria-label": `Select ${a} color`,
4251
4281
  value: i[t] ? De(i[t]) : "#000000",
4252
- onChange: (k) => At(t, k.target.value),
4282
+ onChange: (k) => Dt(t, k.target.value),
4253
4283
  className: "absolute inset-0 opacity-0 cursor-pointer",
4254
4284
  style: { width: "100%", height: "calc(100% - 24px)" }
4255
4285
  }
@@ -4492,7 +4522,7 @@ colors: {
4492
4522
  null,
4493
4523
  2
4494
4524
  ) : Se;
4495
- navigator.clipboard.writeText(t), lo(!0), setTimeout(() => lo(!1), 2e3);
4525
+ navigator.clipboard.writeText(t), io(!0), setTimeout(() => io(!1), 2e3);
4496
4526
  },
4497
4527
  className: "px-2 py-0.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
4498
4528
  style: {
@@ -4505,7 +4535,7 @@ colors: {
4505
4535
  /* @__PURE__ */ e(
4506
4536
  "button",
4507
4537
  {
4508
- onClick: () => Lt(null),
4538
+ onClick: () => Mt(null),
4509
4539
  className: "px-2 py-0.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
4510
4540
  style: {
4511
4541
  backgroundColor: "hsl(var(--muted))",
@@ -4549,7 +4579,7 @@ colors: {
4549
4579
  children: "Palette"
4550
4580
  }
4551
4581
  ),
4552
- /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 md:grid-cols-[repeat(auto-fit,minmax(76px,1fr))] md:gap-3", children: Qr.filter(
4582
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 md:grid-cols-[repeat(auto-fit,minmax(76px,1fr))] md:gap-3", children: eo.filter(
4553
4583
  ({ key: t }) => ![
4554
4584
  "--brand",
4555
4585
  "--secondary",
@@ -4884,7 +4914,7 @@ colors: {
4884
4914
  value: "",
4885
4915
  onChange: (t) => {
4886
4916
  const a = t.target.value;
4887
- a === "css" ? (lr("css"), Je(!0)) : a === "tokens" ? (lr("tokens"), Je(!0)) : a === "reset" && mt({ ...St }), t.target.value = "";
4917
+ a === "css" ? (lr("css"), Je(!0)) : a === "tokens" ? (lr("tokens"), Je(!0)) : a === "reset" && bt({ ...$t }), t.target.value = "";
4888
4918
  },
4889
4919
  children: [
4890
4920
  /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Actions…" }),
@@ -4950,7 +4980,7 @@ colors: {
4950
4980
  /* @__PURE__ */ o(
4951
4981
  "button",
4952
4982
  {
4953
- onClick: () => mt({ ...St }),
4983
+ onClick: () => bt({ ...$t }),
4954
4984
  className: "h-10 px-2 sm:px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-70 flex items-center justify-center gap-1",
4955
4985
  style: { color: "hsl(var(--muted-foreground))" },
4956
4986
  children: [
@@ -5822,7 +5852,7 @@ colors: {
5822
5852
  max: 1,
5823
5853
  step: 0.01,
5824
5854
  value: R.hoverOpacity,
5825
- onChange: (t) => zt({
5855
+ onChange: (t) => At({
5826
5856
  hoverOpacity: Number(t.target.value)
5827
5857
  }),
5828
5858
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -5849,7 +5879,7 @@ colors: {
5849
5879
  max: 1.1,
5850
5880
  step: 5e-3,
5851
5881
  value: R.hoverScale,
5852
- onChange: (t) => zt({
5882
+ onChange: (t) => At({
5853
5883
  hoverScale: Number(t.target.value)
5854
5884
  }),
5855
5885
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -5886,7 +5916,7 @@ colors: {
5886
5916
  max: 1.05,
5887
5917
  step: 5e-3,
5888
5918
  value: R.activeScale,
5889
- onChange: (t) => zt({
5919
+ onChange: (t) => At({
5890
5920
  activeScale: Number(t.target.value)
5891
5921
  }),
5892
5922
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -5924,7 +5954,7 @@ colors: {
5924
5954
  max: 500,
5925
5955
  step: 10,
5926
5956
  value: R.transitionDuration,
5927
- onChange: (t) => zt({
5957
+ onChange: (t) => At({
5928
5958
  transitionDuration: Number(t.target.value)
5929
5959
  }),
5930
5960
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -5952,7 +5982,7 @@ colors: {
5952
5982
  max: 4,
5953
5983
  step: 0.5,
5954
5984
  value: R.focusRingWidth,
5955
- onChange: (t) => zt({
5985
+ onChange: (t) => At({
5956
5986
  focusRingWidth: Number(t.target.value)
5957
5987
  }),
5958
5988
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -6190,7 +6220,7 @@ colors: {
6190
6220
  value: "",
6191
6221
  onChange: (t) => {
6192
6222
  const a = t.target.value;
6193
- a === "css" ? (or("css"), Ge(!0)) : a === "tokens" ? (or("tokens"), Ge(!0)) : a === "reset" && ht(!0), t.target.value = "";
6223
+ a === "css" ? (or("css"), Ge(!0)) : a === "tokens" ? (or("tokens"), Ge(!0)) : a === "reset" && ut(!0), t.target.value = "";
6194
6224
  },
6195
6225
  children: [
6196
6226
  /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Actions…" }),
@@ -6296,7 +6326,7 @@ colors: {
6296
6326
  /* @__PURE__ */ o(
6297
6327
  "button",
6298
6328
  {
6299
- onClick: () => ht(!0),
6329
+ onClick: () => ut(!0),
6300
6330
  className: "h-10 px-2 sm:px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-70 flex items-center justify-center gap-1",
6301
6331
  style: { color: "hsl(var(--muted-foreground))" },
6302
6332
  children: [
@@ -7088,7 +7118,7 @@ colors: {
7088
7118
  min: 0,
7089
7119
  max: 24,
7090
7120
  value: I.borderRadius,
7091
- onChange: (t) => Dr({
7121
+ onChange: (t) => Ir({
7092
7122
  borderRadius: Number(t.target.value)
7093
7123
  }),
7094
7124
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -7115,7 +7145,7 @@ colors: {
7115
7145
  min: 0,
7116
7146
  max: 4,
7117
7147
  value: I.borderWidth,
7118
- onChange: (t) => Dr({
7148
+ onChange: (t) => Ir({
7119
7149
  borderWidth: Number(t.target.value)
7120
7150
  }),
7121
7151
  className: "w-32 accent-[hsl(var(--brand))]"
@@ -7142,7 +7172,7 @@ colors: {
7142
7172
  min: 8,
7143
7173
  max: 32,
7144
7174
  value: I.padding,
7145
- onChange: (t) => Dr({ padding: Number(t.target.value) }),
7175
+ onChange: (t) => Ir({ padding: Number(t.target.value) }),
7146
7176
  className: "w-32 accent-[hsl(var(--brand))]"
7147
7177
  }
7148
7178
  )
@@ -7253,10 +7283,10 @@ colors: {
7253
7283
  {
7254
7284
  onClick: () => {
7255
7285
  if (Ke && Oe === "css") {
7256
- Ft(!1);
7286
+ Et(!1);
7257
7287
  return;
7258
7288
  }
7259
- No("css"), Ft(!0);
7289
+ No("css"), Et(!0);
7260
7290
  },
7261
7291
  className: "h-8 px-2 text-[13px] font-light transition-colors hover:opacity-70 flex items-center justify-center gap-1",
7262
7292
  style: {
@@ -7278,10 +7308,10 @@ colors: {
7278
7308
  {
7279
7309
  onClick: () => {
7280
7310
  if (Ke && Oe === "tokens") {
7281
- Ft(!1);
7311
+ Et(!1);
7282
7312
  return;
7283
7313
  }
7284
- No("tokens"), Ft(!0);
7314
+ No("tokens"), Et(!0);
7285
7315
  },
7286
7316
  className: "h-8 px-2 text-[13px] font-light transition-colors hover:opacity-70 flex items-center justify-center gap-1",
7287
7317
  style: {
@@ -7298,7 +7328,7 @@ colors: {
7298
7328
  "button",
7299
7329
  {
7300
7330
  onClick: () => {
7301
- O.remove(Nt), Kr(), Xe({ ...Gt });
7331
+ O.remove(St), Zr(), Xe({ ...Gt });
7302
7332
  },
7303
7333
  className: "h-8 px-2 text-[13px] font-light rounded-lg transition-colors hover:opacity-70 flex items-center justify-center gap-1",
7304
7334
  style: { color: "hsl(var(--muted-foreground))" },
@@ -7354,7 +7384,7 @@ colors: {
7354
7384
  /* @__PURE__ */ e(
7355
7385
  "button",
7356
7386
  {
7357
- onClick: () => Ft(!1),
7387
+ onClick: () => Et(!1),
7358
7388
  className: "px-2 py-0.5 text-[13px] font-light rounded-lg transition-colors hover:opacity-80",
7359
7389
  style: {
7360
7390
  backgroundColor: "hsl(var(--muted))",
@@ -7631,10 +7661,10 @@ colors: {
7631
7661
  {
7632
7662
  onClick: () => {
7633
7663
  if (Ze && Fe === "css") {
7634
- Et(!1);
7664
+ Rt(!1);
7635
7665
  return;
7636
7666
  }
7637
- $o("css"), Et(!0);
7667
+ $o("css"), Rt(!0);
7638
7668
  },
7639
7669
  className: "h-8 px-2 text-[13px] font-light transition-colors hover:opacity-70 flex items-center justify-center gap-1",
7640
7670
  style: {
@@ -7656,10 +7686,10 @@ colors: {
7656
7686
  {
7657
7687
  onClick: () => {
7658
7688
  if (Ze && Fe === "tokens") {
7659
- Et(!1);
7689
+ Rt(!1);
7660
7690
  return;
7661
7691
  }
7662
- $o("tokens"), Et(!0);
7692
+ $o("tokens"), Rt(!0);
7663
7693
  },
7664
7694
  className: "h-8 px-2 text-[13px] font-light transition-colors hover:opacity-70 flex items-center justify-center gap-1",
7665
7695
  style: {
@@ -7732,7 +7762,7 @@ colors: {
7732
7762
  /* @__PURE__ */ e(
7733
7763
  "button",
7734
7764
  {
7735
- onClick: () => Et(!1),
7765
+ onClick: () => Rt(!1),
7736
7766
  className: "px-2 py-0.5 text-[13px] font-light rounded-lg transition-colors hover:opacity-80",
7737
7767
  style: {
7738
7768
  backgroundColor: "hsl(var(--muted))",
@@ -8551,9 +8581,9 @@ colors: {
8551
8581
  "input",
8552
8582
  {
8553
8583
  type: "text",
8554
- value: ft,
8584
+ value: mt,
8555
8585
  onChange: (t) => {
8556
- xo(t.target.value), Pr("");
8586
+ xo(t.target.value), Wr("");
8557
8587
  },
8558
8588
  placeholder: "Google Font name…",
8559
8589
  className: "flex-1 min-w-0 h-8 px-2 text-[14px] font-light rounded-md border",
@@ -8563,23 +8593,23 @@ colors: {
8563
8593
  borderColor: "hsl(var(--border))"
8564
8594
  },
8565
8595
  onKeyDown: (t) => {
8566
- t.key === "Enter" && ft.trim() && (t.preventDefault(), Eo());
8596
+ t.key === "Enter" && mt.trim() && (t.preventDefault(), Eo());
8567
8597
  }
8568
8598
  }
8569
8599
  ),
8570
8600
  /* @__PURE__ */ e(
8571
8601
  "button",
8572
8602
  {
8573
- disabled: Wr || !ft.trim(),
8603
+ disabled: Br || !mt.trim(),
8574
8604
  onClick: Eo,
8575
8605
  className: "h-8 px-2 text-[12px] font-medium rounded-md border whitespace-nowrap",
8576
8606
  style: {
8577
8607
  backgroundColor: "hsl(var(--primary))",
8578
8608
  color: "hsl(var(--primary-foreground))",
8579
8609
  borderColor: "hsl(var(--border))",
8580
- opacity: Wr || !ft.trim() ? 0.5 : 1
8610
+ opacity: Br || !mt.trim() ? 0.5 : 1
8581
8611
  },
8582
- children: Wr ? "…" : "+ Font"
8612
+ children: Br ? "…" : "+ Font"
8583
8613
  }
8584
8614
  )
8585
8615
  ] })
@@ -8738,7 +8768,7 @@ colors: {
8738
8768
  value: "",
8739
8769
  onChange: (t) => {
8740
8770
  const a = t.target.value;
8741
- a === "css" ? (dr("css"), rt(!0)) : a === "tokens" ? (dr("tokens"), rt(!0)) : a === "reset" && Pt(!0), t.target.value = "";
8771
+ a === "css" ? (dr("css"), rt(!0)) : a === "tokens" ? (dr("tokens"), rt(!0)) : a === "reset" && Wt(!0), t.target.value = "";
8742
8772
  },
8743
8773
  children: [
8744
8774
  /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Actions…" }),
@@ -8844,7 +8874,7 @@ colors: {
8844
8874
  /* @__PURE__ */ o(
8845
8875
  "button",
8846
8876
  {
8847
- onClick: () => Pt(!0),
8877
+ onClick: () => Wt(!0),
8848
8878
  className: "h-10 px-2 sm:px-3 text-[14px] font-light rounded-lg transition-colors hover:opacity-70 flex items-center justify-center gap-1",
8849
8879
  style: { color: "hsl(var(--muted-foreground))" },
8850
8880
  children: [
@@ -9471,7 +9501,7 @@ colors: {
9471
9501
  {
9472
9502
  className: "fixed inset-0 z-50 flex items-center justify-center",
9473
9503
  style: { backgroundColor: "rgba(0,0,0,0.5)" },
9474
- onClick: () => Pt(!1),
9504
+ onClick: () => Wt(!1),
9475
9505
  children: /* @__PURE__ */ o(
9476
9506
  "div",
9477
9507
  {
@@ -9492,7 +9522,7 @@ colors: {
9492
9522
  /* @__PURE__ */ e(
9493
9523
  "button",
9494
9524
  {
9495
- onClick: () => Pt(!1),
9525
+ onClick: () => Wt(!1),
9496
9526
  className: "px-4 py-2 text-[14px] font-light rounded-lg",
9497
9527
  style: { backgroundColor: "#e5e7eb", color: "#111" },
9498
9528
  children: "Cancel"
@@ -9502,7 +9532,7 @@ colors: {
9502
9532
  "button",
9503
9533
  {
9504
9534
  onClick: () => {
9505
- Qn(), Pt(!1);
9535
+ Qn(), Wt(!1);
9506
9536
  },
9507
9537
  className: "px-4 py-2 text-[14px] font-light rounded-lg",
9508
9538
  style: { backgroundColor: "#ef4444", color: "#fff" },
@@ -9524,7 +9554,7 @@ colors: {
9524
9554
  {
9525
9555
  className: "fixed inset-0 z-50 flex items-center justify-center",
9526
9556
  onClick: () => {
9527
- fr(!1), Wt(""), yt(null);
9557
+ fr(!1), Bt(""), vt(null);
9528
9558
  },
9529
9559
  children: [
9530
9560
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/50" }),
@@ -9541,7 +9571,7 @@ colors: {
9541
9571
  "button",
9542
9572
  {
9543
9573
  onClick: () => {
9544
- fr(!1), Wt(""), yt(null);
9574
+ fr(!1), Bt(""), vt(null);
9545
9575
  },
9546
9576
  className: "p-1 rounded hover:opacity-70",
9547
9577
  style: { color: "hsl(var(--muted-foreground))" },
@@ -9572,7 +9602,7 @@ $primary: #3b82f6;
9572
9602
  $background: #fff;`,
9573
9603
  value: In,
9574
9604
  onChange: (t) => {
9575
- Wt(t.target.value), t.target.value.trim() ? yt(Va(t.target.value)) : yt(null);
9605
+ Bt(t.target.value), t.target.value.trim() ? vt(Va(t.target.value)) : vt(null);
9576
9606
  }
9577
9607
  }
9578
9608
  ),
@@ -9642,7 +9672,7 @@ $background: #fff;`,
9642
9672
  "button",
9643
9673
  {
9644
9674
  onClick: () => {
9645
- fr(!1), Wt(""), yt(null);
9675
+ fr(!1), Bt(""), vt(null);
9646
9676
  },
9647
9677
  className: "px-4 py-2 text-[14px] font-light rounded-lg",
9648
9678
  style: { backgroundColor: "#e5e7eb", color: "#111" },
@@ -9661,22 +9691,22 @@ $background: #fff;`,
9661
9691
  document.documentElement.style.setProperty(a, d);
9662
9692
  A(t);
9663
9693
  }
9664
- Object.keys(W.cardStyle).length > 0 && pt((t) => {
9694
+ Object.keys(W.cardStyle).length > 0 && gt((t) => {
9665
9695
  const a = { ...t, ...W.cardStyle, preset: "custom" };
9666
9696
  return yr(a, i), a;
9667
- }), Object.keys(W.typographyState).length > 0 && gt((t) => {
9697
+ }), Object.keys(W.typographyState).length > 0 && ft((t) => {
9668
9698
  const a = { ...t, ...W.typographyState, preset: "custom" };
9669
9699
  return Xt(a), a;
9670
- }), Object.keys(W.buttonStyle).length > 0 && mt((t) => {
9700
+ }), Object.keys(W.buttonStyle).length > 0 && bt((t) => {
9671
9701
  const a = { ...t, ...W.buttonStyle };
9672
9702
  return Sr(a), a;
9673
- }), Object.keys(W.interactionStyle).length > 0 && bt((t) => {
9703
+ }), Object.keys(W.interactionStyle).length > 0 && xt((t) => {
9674
9704
  const a = { ...t, ...W.interactionStyle, preset: "custom" };
9675
9705
  return Nr(a), a;
9676
9706
  }), Object.keys(W.alertStyle).length > 0 && Xe((t) => {
9677
9707
  const a = { ...t, ...W.alertStyle, preset: "custom" };
9678
9708
  return kr(a), a;
9679
- }), fr(!1), Wt(""), yt(null);
9709
+ }), fr(!1), Bt(""), vt(null);
9680
9710
  }
9681
9711
  },
9682
9712
  className: "px-4 py-2 text-[14px] font-light rounded-lg transition-opacity",
@@ -9701,7 +9731,7 @@ $background: #fff;`,
9701
9731
  className: "fixed inset-0 z-50 flex items-center justify-center",
9702
9732
  style: { backgroundColor: "rgba(0,0,0,0.5)" },
9703
9733
  onClick: () => {
9704
- Be(!1), hr(""), xt("");
9734
+ Be(!1), hr(""), yt("");
9705
9735
  },
9706
9736
  onDragOver: (t) => {
9707
9737
  t.preventDefault(), t.stopPropagation();
@@ -9816,9 +9846,9 @@ $background: #fff;`,
9816
9846
  "input",
9817
9847
  {
9818
9848
  type: "text",
9819
- value: Hr,
9849
+ value: zr,
9820
9850
  onChange: (t) => {
9821
- hr(t.target.value), xt("");
9851
+ hr(t.target.value), yt("");
9822
9852
  },
9823
9853
  onKeyDown: (t) => {
9824
9854
  t.key === "Enter" && (Bo(), Be(!1));
@@ -9826,7 +9856,7 @@ $background: #fff;`,
9826
9856
  placeholder: "https://example.com/photo.jpg",
9827
9857
  className: "flex-1 h-10 px-3 text-[14px] font-light rounded-lg border bg-transparent",
9828
9858
  style: {
9829
- borderColor: zr ? "hsl(var(--destructive))" : "hsl(var(--border))",
9859
+ borderColor: Ar ? "hsl(var(--destructive))" : "hsl(var(--border))",
9830
9860
  color: "hsl(var(--foreground))"
9831
9861
  },
9832
9862
  autoFocus: !0
@@ -9838,7 +9868,7 @@ $background: #fff;`,
9838
9868
  onClick: () => {
9839
9869
  Bo(), Be(!1);
9840
9870
  },
9841
- disabled: We === "extracting" || !Hr.trim(),
9871
+ disabled: We === "extracting" || !zr.trim(),
9842
9872
  className: "h-10 px-4 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
9843
9873
  style: {
9844
9874
  backgroundColor: "hsl(var(--brand))",
@@ -9848,12 +9878,12 @@ $background: #fff;`,
9848
9878
  }
9849
9879
  )
9850
9880
  ] }),
9851
- zr && /* @__PURE__ */ e(
9881
+ Ar && /* @__PURE__ */ e(
9852
9882
  "p",
9853
9883
  {
9854
9884
  className: "text-[12px] font-light mt-1",
9855
9885
  style: { color: "hsl(var(--destructive))" },
9856
- children: zr
9886
+ children: Ar
9857
9887
  }
9858
9888
  )
9859
9889
  ] }),
@@ -9889,7 +9919,7 @@ $background: #fff;`,
9889
9919
  "button",
9890
9920
  {
9891
9921
  onClick: () => {
9892
- Be(!1), hr(""), xt("");
9922
+ Be(!1), hr(""), yt("");
9893
9923
  },
9894
9924
  className: "px-3 py-1.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
9895
9925
  style: { color: "hsl(var(--muted-foreground))" },
@@ -9907,7 +9937,7 @@ $background: #fff;`,
9907
9937
  className: "fixed inset-0 z-50 flex items-center justify-center",
9908
9938
  style: { backgroundColor: "rgba(0,0,0,0.5)" },
9909
9939
  onClick: () => {
9910
- URL.revokeObjectURL(ot.imageUrl), Bt(null);
9940
+ URL.revokeObjectURL(ot.imageUrl), Ht(null);
9911
9941
  },
9912
9942
  children: /* @__PURE__ */ o(
9913
9943
  "div",
@@ -9973,7 +10003,7 @@ $background: #fff;`,
9973
10003
  "button",
9974
10004
  {
9975
10005
  onClick: () => {
9976
- URL.revokeObjectURL(ot.imageUrl), Bt(null);
10006
+ URL.revokeObjectURL(ot.imageUrl), Ht(null);
9977
10007
  },
9978
10008
  className: "px-3 py-1.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
9979
10009
  style: { color: "hsl(var(--card-foreground))" },
@@ -9986,7 +10016,7 @@ $background: #fff;`,
9986
10016
  onClick: () => {
9987
10017
  oa(ot.palette);
9988
10018
  const t = ot.imageUrl;
9989
- Bt(null), Fo(t), setTimeout(() => {
10019
+ Ht(null), Fo(t), setTimeout(() => {
9990
10020
  Fo((a) => (a === t && URL.revokeObjectURL(t), a === t ? null : a));
9991
10021
  }, 3e3);
9992
10022
  },
@@ -10032,26 +10062,26 @@ $background: #fff;`,
10032
10062
  }, a = (k, N, z) => {
10033
10063
  k /= 255, N /= 255, z /= 255;
10034
10064
  const le = Math.max(k, N, z), ae = Math.min(k, N, z);
10035
- let ze = 0, it = 0;
10036
- const kt = (le + ae) / 2;
10065
+ let ze = 0, ct = 0;
10066
+ const wt = (le + ae) / 2;
10037
10067
  if (le !== ae) {
10038
10068
  const Ae = le - ae;
10039
- it = kt > 0.5 ? Ae / (2 - le - ae) : Ae / (le + ae), le === k ? ze = ((N - z) / Ae + (N < z ? 6 : 0)) / 6 : le === N ? ze = ((z - k) / Ae + 2) / 6 : ze = ((k - N) / Ae + 4) / 6;
10069
+ ct = wt > 0.5 ? Ae / (2 - le - ae) : Ae / (le + ae), le === k ? ze = ((N - z) / Ae + (N < z ? 6 : 0)) / 6 : le === N ? ze = ((z - k) / Ae + 2) / 6 : ze = ((k - N) / Ae + 4) / 6;
10040
10070
  }
10041
- return { h: Math.round(ze * 360), s: Math.round(it * 100), l: Math.round(kt * 100) };
10071
+ return { h: Math.round(ze * 360), s: Math.round(ct * 100), l: Math.round(wt * 100) };
10042
10072
  }, d = (k, N, z) => {
10043
10073
  N /= 100, z /= 100;
10044
10074
  const le = N * Math.min(z, 1 - z), ae = (ze) => {
10045
- const it = (ze + k / 30) % 12, kt = z - le * Math.max(Math.min(it - 3, 9 - it, 1), -1);
10046
- return Math.round(255 * kt).toString(16).padStart(2, "0");
10075
+ const ct = (ze + k / 30) % 12, wt = z - le * Math.max(Math.min(ct - 3, 9 - ct, 1), -1);
10076
+ return Math.round(255 * wt).toString(16).padStart(2, "0");
10047
10077
  };
10048
10078
  return `#${ae(0)}${ae(8)}${ae(4)}`;
10049
- }, { r: f, g: L, b: F } = t(at), y = a(f, L, F), w = ee("0 0% 100%", Ct(at)), H = ee("0 0% 0%", Ct(at)), G = w >= H ? "#ffffff" : "#000000", V = ["--brand", "--secondary", "--accent", "--background", "--foreground"].map((k) => {
10079
+ }, { r: f, g: L, b: F } = t(at), y = a(f, L, F), w = ee("0 0% 100%", Nt(at)), H = ee("0 0% 0%", Nt(at)), G = w >= H ? "#ffffff" : "#000000", V = ["--brand", "--secondary", "--accent", "--background", "--foreground"].map((k) => {
10050
10080
  var N;
10051
10081
  return {
10052
10082
  key: k,
10053
- label: ((N = Qr.find((z) => z.key === k)) == null ? void 0 : N.label) || k,
10054
- hsl: k === nt ? Ct(at) : i[k],
10083
+ label: ((N = eo.find((z) => z.key === k)) == null ? void 0 : N.label) || k,
10084
+ hsl: k === nt ? Nt(at) : i[k],
10055
10085
  active: k === nt
10056
10086
  };
10057
10087
  });
@@ -10065,7 +10095,7 @@ $background: #fff;`,
10065
10095
  "button",
10066
10096
  {
10067
10097
  onClick: () => {
10068
- Ar(k.key), st(k.hsl ? De(k.hsl) : "#000000");
10098
+ Dr(k.key), st(k.hsl ? De(k.hsl) : "#000000");
10069
10099
  },
10070
10100
  className: "flex-1 flex flex-col items-center gap-0.5",
10071
10101
  children: [
@@ -10115,7 +10145,7 @@ $background: #fff;`,
10115
10145
  value: y.h,
10116
10146
  onChange: (k) => {
10117
10147
  const N = d(Number(k.target.value), y.s, y.l);
10118
- st(N), At(nt, N);
10148
+ st(N), Dt(nt, N);
10119
10149
  },
10120
10150
  className: "w-full h-8 rounded-lg appearance-none cursor-pointer",
10121
10151
  style: {
@@ -10139,7 +10169,7 @@ $background: #fff;`,
10139
10169
  value: y.s,
10140
10170
  onChange: (k) => {
10141
10171
  const N = d(y.h, Number(k.target.value), y.l);
10142
- st(N), At(nt, N);
10172
+ st(N), Dt(nt, N);
10143
10173
  },
10144
10174
  className: "w-full h-8 rounded-lg appearance-none cursor-pointer",
10145
10175
  style: {
@@ -10163,7 +10193,7 @@ $background: #fff;`,
10163
10193
  value: y.l,
10164
10194
  onChange: (k) => {
10165
10195
  const N = d(y.h, y.s, Number(k.target.value));
10166
- st(N), At(nt, N);
10196
+ st(N), Dt(nt, N);
10167
10197
  },
10168
10198
  className: "w-full h-8 rounded-lg appearance-none cursor-pointer",
10169
10199
  style: {
@@ -10181,7 +10211,7 @@ $background: #fff;`,
10181
10211
  value: at,
10182
10212
  onChange: (k) => {
10183
10213
  const N = k.target.value;
10184
- /^#[0-9a-fA-F]{6}$/.test(N) ? (st(N), At(nt, N)) : st(N);
10214
+ /^#[0-9a-fA-F]{6}$/.test(N) ? (st(N), Dt(nt, N)) : st(N);
10185
10215
  },
10186
10216
  className: "w-full h-10 px-3 text-[16px] font-mono rounded-lg border bg-transparent",
10187
10217
  style: { borderColor: "hsl(var(--border))", color: "hsl(var(--foreground))" }
@@ -10192,7 +10222,7 @@ $background: #fff;`,
10192
10222
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
10193
10223
  "button",
10194
10224
  {
10195
- onClick: () => Ar(null),
10225
+ onClick: () => Dr(null),
10196
10226
  className: "w-full h-12 rounded-xl text-[16px] font-medium cursor-pointer",
10197
10227
  style: {
10198
10228
  backgroundColor: "hsl(var(--primary))",
@@ -10228,24 +10258,24 @@ $background: #fff;`,
10228
10258
  label: "Copy as HEX",
10229
10259
  action: () => {
10230
10260
  navigator.clipboard.writeText(
10231
- Zr(i, "hex")
10232
- ), vt(!0), setTimeout(() => vt(!1), 2e3);
10261
+ qr(i, "hex")
10262
+ ), kt(!0), setTimeout(() => kt(!1), 2e3);
10233
10263
  }
10234
10264
  },
10235
10265
  {
10236
10266
  label: "Copy as RGB",
10237
10267
  action: () => {
10238
10268
  navigator.clipboard.writeText(
10239
- Zr(i, "rgb")
10240
- ), vt(!0), setTimeout(() => vt(!1), 2e3);
10269
+ qr(i, "rgb")
10270
+ ), kt(!0), setTimeout(() => kt(!1), 2e3);
10241
10271
  }
10242
10272
  },
10243
10273
  {
10244
10274
  label: "Copy as RGBA",
10245
10275
  action: () => {
10246
10276
  navigator.clipboard.writeText(
10247
- Zr(i, "rgba")
10248
- ), vt(!0), setTimeout(() => vt(!1), 2e3);
10277
+ qr(i, "rgba")
10278
+ ), kt(!0), setTimeout(() => kt(!1), 2e3);
10249
10279
  }
10250
10280
  },
10251
10281
  {
@@ -10305,7 +10335,7 @@ $background: #fff;`,
10305
10335
  {
10306
10336
  className: "fixed inset-0 z-50 flex items-center justify-center",
10307
10337
  style: { backgroundColor: "rgba(0,0,0,0.5)" },
10308
- onClick: () => Mt(!1),
10338
+ onClick: () => Tt(!1),
10309
10339
  children: /* @__PURE__ */ o(
10310
10340
  "div",
10311
10341
  {
@@ -10363,7 +10393,7 @@ $background: #fff;`,
10363
10393
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(
10364
10394
  "button",
10365
10395
  {
10366
- onClick: () => Mt(!1),
10396
+ onClick: () => Tt(!1),
10367
10397
  className: "px-4 py-1.5 text-[14px] font-light rounded-lg transition-colors hover:opacity-80",
10368
10398
  style: {
10369
10399
  backgroundColor: "#e5e7eb",
@@ -10428,7 +10458,7 @@ $background: #fff;`,
10428
10458
  type: "checkbox",
10429
10459
  checked: Qt.has(t),
10430
10460
  onChange: () => {
10431
- io((d) => {
10461
+ co((d) => {
10432
10462
  const f = new Set(d);
10433
10463
  return f.has(t) ? f.delete(t) : f.add(t), f;
10434
10464
  });
@@ -10458,7 +10488,7 @@ $background: #fff;`,
10458
10488
  /* @__PURE__ */ e(
10459
10489
  "button",
10460
10490
  {
10461
- disabled: Qt.size === 0 || ((Ao = co.main) == null ? void 0 : Ao.status) === "creating",
10491
+ disabled: Qt.size === 0 || ((Ao = ho.main) == null ? void 0 : Ao.status) === "creating",
10462
10492
  onClick: () => {
10463
10493
  ea(Qt, "main"), er(!1);
10464
10494
  },
@@ -10468,7 +10498,7 @@ $background: #fff;`,
10468
10498
  color: "#111",
10469
10499
  boxShadow: "0 2px 4px rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6)"
10470
10500
  },
10471
- children: ((Do = co.main) == null ? void 0 : Do.status) === "creating" ? "Preparing..." : `Submit PR (${Qt.size})`
10501
+ children: ((Do = ho.main) == null ? void 0 : Do.status) === "creating" ? "Preparing..." : `Submit PR (${Qt.size})`
10472
10502
  }
10473
10503
  )
10474
10504
  ] })
@@ -10477,7 +10507,7 @@ $background: #fff;`,
10477
10507
  )
10478
10508
  }
10479
10509
  ),
10480
- Br && /* @__PURE__ */ o(
10510
+ Hr && /* @__PURE__ */ o(
10481
10511
  "div",
10482
10512
  {
10483
10513
  className: "lg:hidden fixed inset-0 z-40",
@@ -10628,10 +10658,10 @@ $background: #fff;`,
10628
10658
  {
10629
10659
  onClick: () => {
10630
10660
  if (de(!1), !r) {
10631
- Mt(!0);
10661
+ Tt(!0);
10632
10662
  return;
10633
10663
  }
10634
- io(/* @__PURE__ */ new Set()), er(!0);
10664
+ co(/* @__PURE__ */ new Set()), er(!0);
10635
10665
  },
10636
10666
  className: "block py-2 text-[20px] font-bold tracking-wider mb-[5px] transition-opacity hover:opacity-70 flex items-baseline gap-2",
10637
10667
  style: { color: "hsl(var(--foreground))" },
@@ -10728,16 +10758,16 @@ function Rs({
10728
10758
  return /* @__PURE__ */ e(_a, { licenseKey: r, children: /* @__PURE__ */ e(Ls, { ...n }) });
10729
10759
  }
10730
10760
  export {
10731
- Nt as ALERT_STYLE_KEY,
10761
+ St as ALERT_STYLE_KEY,
10732
10762
  Ut as CARD_STYLE_KEY,
10733
10763
  Rs as DesignSystemEditor,
10734
10764
  Ne as EDITABLE_VARS,
10735
- Ur as HARMONY_SCHEMES,
10765
+ Xr as HARMONY_SCHEMES,
10736
10766
  Zt as INTERACTION_STYLE_KEY,
10737
10767
  _a as LicenseProvider,
10738
10768
  Ce as PremiumGate,
10739
10769
  Kt as TOAST_STYLE_KEY,
10740
- $t as TYPOGRAPHY_KEY,
10770
+ Lt as TYPOGRAPHY_KEY,
10741
10771
  Sa as addCustomFont,
10742
10772
  ja as applyStoredAlertStyle,
10743
10773
  wa as applyStoredCardStyle,
@@ -10749,12 +10779,12 @@ export {
10749
10779
  Aa as deserializeThemeState,
10750
10780
  za as exportPaletteAsPng,
10751
10781
  mn as exportPaletteAsSvg,
10752
- Zr as exportPaletteAsText,
10782
+ qr as exportPaletteAsText,
10753
10783
  M as fgForBg,
10754
10784
  rn as generateDesignTokens,
10755
10785
  Es as generateLicenseKey,
10756
- ct as getCustomFonts,
10757
- Ct as hexToHslString,
10786
+ dt as getCustomFonts,
10787
+ Nt as hexToHslString,
10758
10788
  De as hslStringToHex,
10759
10789
  La as initCustomFonts,
10760
10790
  $a as removeCustomFont,