builder-settings-types 0.0.263 → 0.0.265

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.
@@ -11,25 +11,25 @@ function ct(p) {
11
11
  e.classList.contains("setting-group") && e !== p && t++, e = e.parentElement;
12
12
  return t;
13
13
  }
14
- function Z(p, t) {
14
+ function X(p, t) {
15
15
  const e = Math.min(Math.max(t, 0), 5);
16
16
  p.setAttribute("data-nesting-level", e.toString()), e > 0 ? p.style.setProperty("--visual-indent", `${e * 2}px`) : (p.style.removeProperty("--visual-indent"), p.style.marginLeft = "");
17
17
  }
18
18
  function tt(p, t = 0) {
19
19
  p.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
20
20
  const s = i, n = t + 1;
21
- Z(s, n), tt(s, n);
21
+ X(s, n), tt(s, n);
22
22
  });
23
23
  }
24
- const ht = {
24
+ const dt = {
25
25
  maxLevel: 5,
26
26
  spacingMultiplier: 1,
27
27
  visualIndentMultiplier: 2,
28
28
  enableAutoDetection: !0
29
29
  };
30
- class dt {
30
+ class ht {
31
31
  constructor(t = {}) {
32
- this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...ht, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
32
+ this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...dt, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
33
33
  }
34
34
  /**
35
35
  * Setup automatic detection using MutationObserver
@@ -111,15 +111,15 @@ class dt {
111
111
  this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
112
112
  }
113
113
  }
114
- const it = new dt();
115
- function X(p) {
114
+ const it = new ht();
115
+ function Y(p) {
116
116
  if (p === null || typeof p != "object") return p;
117
117
  if (p instanceof Date) return new Date(p.getTime());
118
- if (p instanceof Array) return p.map((t) => X(t));
118
+ if (p instanceof Array) return p.map((t) => Y(t));
119
119
  if (typeof p == "object") {
120
120
  const t = {};
121
121
  for (const e in p)
122
- Object.prototype.hasOwnProperty.call(p, e) && (t[e] = X(p[e]));
122
+ Object.prototype.hasOwnProperty.call(p, e) && (t[e] = Y(p[e]));
123
123
  return t;
124
124
  }
125
125
  return p;
@@ -142,15 +142,15 @@ function pt(p) {
142
142
  return "";
143
143
  }
144
144
  }
145
- class S {
145
+ class I {
146
146
  constructor(t = {}) {
147
147
  this.props = t, this.dataPropsPath = "", this.id = t.id || ot(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
148
148
  }
149
149
  static SetUploadUrl(t) {
150
- globalThis.DefaultUploadUrl = t, S.DefaultUploadUrl = t;
150
+ globalThis.DefaultUploadUrl = t, I.DefaultUploadUrl = t;
151
151
  }
152
152
  static SetDefaultLanguage(t) {
153
- globalThis.DefaultLanguage = t, S.DefaultLanguage = t;
153
+ globalThis.DefaultLanguage = t, I.DefaultLanguage = t;
154
154
  }
155
155
  destroy() {
156
156
  throw new Error("Method not implemented.");
@@ -171,8 +171,8 @@ class S {
171
171
  this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
172
172
  }
173
173
  clone() {
174
- const t = this.constructor, e = X(this.props), i = new t(e);
175
- return i.value = X(this.value), i;
174
+ const t = this.constructor, e = Y(this.props), i = new t(e);
175
+ return i.value = Y(this.value), i;
176
176
  }
177
177
  createInput(t) {
178
178
  t = { ...this.props.inputProps, ...t };
@@ -234,29 +234,29 @@ class S {
234
234
  }
235
235
  }
236
236
  function j(p) {
237
- return p instanceof S;
237
+ return p instanceof I;
238
238
  }
239
239
  function N(p) {
240
- return p instanceof G;
240
+ return p instanceof z;
241
241
  }
242
242
  function st(p) {
243
243
  return j(p) || N(p);
244
244
  }
245
- function q(p, t) {
245
+ function J(p, t) {
246
246
  for (const e in p)
247
247
  if (Object.prototype.hasOwnProperty.call(p, e)) {
248
248
  const i = p[e];
249
249
  t(e, i);
250
250
  }
251
251
  }
252
- const Y = class Y {
252
+ const _ = class _ {
253
253
  constructor(t) {
254
254
  this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
255
- }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.id = t.id || ot(), this.title = t.title, this.settings = t.settings, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = t.includeGetJson ?? !0, this.addItemCfg = t.addItem, this.deleteItemCfg = t.deleteItem, this.dataProps = t.dataProps, this.dataPropsPath = t.dataProps || "", Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath();
255
+ }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.id = t.id || ot(), this.title = t.title, this.settings = t.settings, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = t.includeGetJson ?? !0, this.addItemCfg = t.addItem, this.deleteItemCfg = t.deleteItem, this.dataProps = t.dataProps, this.dataPropsPath = t.dataProps || "", this.isHidden = t.hidden ?? !1, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath();
256
256
  }
257
257
  propagateNestingLevel() {
258
258
  const t = this.nestingLevel + 1;
259
- q(this.settings, (e, i) => {
259
+ J(this.settings, (e, i) => {
260
260
  N(i) && (i.nestingLevel = t, i.propagateNestingLevel());
261
261
  });
262
262
  }
@@ -273,13 +273,13 @@ const Y = class Y {
273
273
  this.dataPropsPath = t, this.propagateDataPropsPath();
274
274
  }
275
275
  propagateDataPropsPath() {
276
- q(this.settings, (t, e) => {
276
+ J(this.settings, (t, e) => {
277
277
  const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
278
278
  (N(e) || j(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
279
279
  });
280
280
  }
281
281
  updateNestingStyles() {
282
- this.elementRef && (Z(this.elementRef, this.nestingLevel), tt(this.elementRef, this.nestingLevel));
282
+ this.elementRef && (X(this.elementRef, this.nestingLevel), tt(this.elementRef, this.nestingLevel));
283
283
  }
284
284
  forceChildUIRefresh() {
285
285
  Object.entries(this.settings).forEach(([t, e]) => {
@@ -323,12 +323,21 @@ const Y = class Y {
323
323
  const i = this.getValues();
324
324
  this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
325
325
  }
326
+ getHidden() {
327
+ return this.isHidden;
328
+ }
329
+ setHidden(t) {
330
+ this.isHidden = t ?? !1, this.updateVisibility();
331
+ }
326
332
  updateVisibility() {
327
- this.elementRef;
333
+ this.elementRef && (this.isHidden ? (this.elementRef.style.display = "none", this.elementRef.setAttribute("aria-hidden", "true"), _.hiddenElements.add(this.elementRef)) : (this.elementRef.style.display = "", this.elementRef.removeAttribute("aria-hidden"), _.hiddenElements.delete(this.elementRef)));
328
334
  }
335
+ // public updateVisibility(): void {
336
+ // if (!this.elementRef) return;
337
+ // }
329
338
  clone() {
330
339
  const t = {};
331
- q(this.settings, (s, n) => {
340
+ J(this.settings, (s, n) => {
332
341
  const o = String(s);
333
342
  typeof n.clone == "function" ? t[o] = n.clone() : (console.warn(
334
343
  `Setting with key '${o}' does not have a clone method. Copying reference.`
@@ -343,7 +352,8 @@ const Y = class Y {
343
352
  includeGetJson: this.includeGetJson,
344
353
  addItem: this.addItemCfg,
345
354
  deleteItem: this.deleteItemCfg,
346
- dataProps: this.dataProps
355
+ dataProps: this.dataProps,
356
+ hidden: this.isHidden
347
357
  }, i = gt(e);
348
358
  return i.initialValues = this.getValues(), i;
349
359
  }
@@ -390,7 +400,7 @@ const Y = class Y {
390
400
  Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
391
401
  }, 50));
392
402
  };
393
- return this.changeHandlers.clear(), q(this.settings, (i, s) => {
403
+ return this.changeHandlers.clear(), J(this.settings, (i, s) => {
394
404
  var n;
395
405
  if (N(s))
396
406
  s.setOnChange(() => {
@@ -449,11 +459,11 @@ const Y = class Y {
449
459
  N(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
450
460
  const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
451
461
  if (l) {
452
- const h = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
453
- h && t.startsWith(h) && this.addDeleteButtonToElement(a, t);
462
+ const d = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
463
+ d && t.startsWith(d) && this.addDeleteButtonToElement(a, t);
454
464
  }
455
465
  const r = o.querySelector(".sg-add-button-bottom");
456
- r ? o.insertBefore(a, r) : o.appendChild(a), it.trackElement(a), Z(a, this.nestingLevel + 1), tt(a, this.nestingLevel + 1);
466
+ r ? o.insertBefore(a, r) : o.appendChild(a), it.trackElement(a), X(a, this.nestingLevel + 1), tt(a, this.nestingLevel + 1);
457
467
  const c = a.style.display;
458
468
  a.style.display = "none", a.offsetHeight, a.style.display = c, this.updateNestingStyles();
459
469
  }
@@ -602,11 +612,11 @@ const Y = class Y {
602
612
  r(), t(!1);
603
613
  }), l.addEventListener("click", () => {
604
614
  r(), t(!0);
605
- }), e.addEventListener("click", (h) => {
606
- h.target === e && (r(), t(!1));
615
+ }), e.addEventListener("click", (d) => {
616
+ d.target === e && (r(), t(!1));
607
617
  });
608
- const c = (h) => {
609
- h.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
618
+ const c = (d) => {
619
+ d.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
610
620
  };
611
621
  document.addEventListener("keydown", c), o.appendChild(a), o.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(o), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
612
622
  e.style.opacity = "1", i.style.transform = "scale(1)";
@@ -703,7 +713,7 @@ const Y = class Y {
703
713
  }
704
714
  draw() {
705
715
  const t = document.createElement("div");
706
- t.className = "setting-group", t.id = `setting-group-${this.id}`, Y.hiddenElements.add(t), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), Z(t, this.nestingLevel);
716
+ t.className = "setting-group", t.id = `setting-group-${this.id}`, _.hiddenElements.add(t), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), X(t, this.nestingLevel);
707
717
  const e = document.createElement("div");
708
718
  e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
709
719
  "aria-expanded",
@@ -734,14 +744,14 @@ const Y = class Y {
734
744
  }, Object.keys(this.settings).length > 0) {
735
745
  for (const c in this.settings)
736
746
  if (Object.prototype.hasOwnProperty.call(this.settings, c)) {
737
- const h = this.settings[c];
738
- N(h) && typeof h.setNestingLevel == "function" && h.setNestingLevel(this.nestingLevel + 1);
739
- const d = h.draw();
740
- N(h) && h.deleteItemCfg && this.addDeleteButtonToElement(
741
- d,
747
+ const d = this.settings[c];
748
+ N(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.nestingLevel + 1);
749
+ const h = d.draw();
750
+ N(d) && d.deleteItemCfg && this.addDeleteButtonToElement(
751
+ h,
742
752
  c,
743
- h
744
- ), a.appendChild(d);
753
+ d
754
+ ), a.appendChild(h);
745
755
  }
746
756
  } else {
747
757
  const c = document.createElement("div");
@@ -750,18 +760,18 @@ const Y = class Y {
750
760
  if (this.addItemCfg) {
751
761
  const c = document.createElement("button");
752
762
  c.type = "button", c.className = "sg-add-button-bottom", c.style.marginTop = "8px";
753
- const h = `
763
+ const d = `
754
764
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none"
755
765
  xmlns="http://www.w3.org/2000/svg">
756
766
  <path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
757
767
  stroke-width="1.5" stroke-linecap="round"/>
758
768
  </svg>`;
759
- c.innerHTML = `${h}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (d) => {
760
- d.stopPropagation(), d.preventDefault();
761
- const m = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), u = this.addItemCfg.createItem(m);
762
- if (st(u)) {
763
- const g = `${this.addItemCfg.keyPrefix}${m}`;
764
- this.addSetting(g, u);
769
+ c.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (h) => {
770
+ h.stopPropagation(), h.preventDefault();
771
+ const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), g = this.addItemCfg.createItem(u);
772
+ if (st(g)) {
773
+ const C = `${this.addItemCfg.keyPrefix}${u}`;
774
+ this.addSetting(C, g);
765
775
  }
766
776
  }), a.appendChild(c);
767
777
  }
@@ -807,12 +817,12 @@ const Y = class Y {
807
817
  }
808
818
  }
809
819
  };
810
- Y.hiddenElements = /* @__PURE__ */ new Set();
811
- let G = Y;
820
+ _.hiddenElements = /* @__PURE__ */ new Set();
821
+ let z = _;
812
822
  function zt(p) {
813
823
  return new ut(p);
814
824
  }
815
- class ut extends G {
825
+ class ut extends z {
816
826
  constructor(t) {
817
827
  super(t);
818
828
  const e = Object.keys(this.settings)[0];
@@ -852,9 +862,9 @@ class ut extends G {
852
862
  r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", a), r.textContent = a, r.addEventListener("click", () => this.switchToTab(a)), n.appendChild(r);
853
863
  const c = document.createElement("div");
854
864
  c.className = "tab-panel", this.contentContainers[a] = c;
855
- const h = this.settings[a];
856
- h && (N(h) && typeof h.setNestingLevel == "function" && h.setNestingLevel(this.getNestingLevel() + 1), c.appendChild(
857
- h.draw()
865
+ const d = this.settings[a];
866
+ d && (N(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.getNestingLevel() + 1), c.appendChild(
867
+ d.draw()
858
868
  )), o.appendChild(c), l === 0 && !this.activeTabId && (this.activeTabId = a);
859
869
  }), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
860
870
  const a = Object.keys(this.settings)[0];
@@ -864,12 +874,12 @@ class ut extends G {
864
874
  }
865
875
  }
866
876
  function gt(p) {
867
- return new G(p);
877
+ return new z(p);
868
878
  }
869
879
  function Ut(p) {
870
880
  return p;
871
881
  }
872
- class mt extends S {
882
+ class mt extends I {
873
883
  constructor(t = {}) {
874
884
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
875
885
  }
@@ -890,17 +900,17 @@ class mt extends S {
890
900
  }
891
901
  }
892
902
  const ft = "<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";
893
- class F extends mt {
903
+ class R extends mt {
894
904
  constructor(t) {
895
905
  super({
896
906
  ...t,
897
907
  icon: t.icon || ft,
898
908
  title: t.title || "Color",
899
- default: t.default ? F.normalizeColorValue(t.default) : "#000000"
909
+ default: t.default ? R.normalizeColorValue(t.default) : "#000000"
900
910
  }), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
901
911
  }
902
912
  static normalizeColorValue(t) {
903
- return t.startsWith("#") ? F.normalizeHexValue(t) : t.includes(",") ? F.rgbToHexStatic(t) : F.normalizeHexValue(t);
913
+ return t.startsWith("#") ? R.normalizeHexValue(t) : t.includes(",") ? R.rgbToHexStatic(t) : R.normalizeHexValue(t);
904
914
  }
905
915
  static normalizeHexValue(t) {
906
916
  return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length !== 6 ? (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000") : /^[0-9A-Fa-f]{6}$/.test(t) ? `#${t.toLowerCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000");
@@ -910,8 +920,8 @@ class F extends mt {
910
920
  if (e.length !== 3 || e.some(isNaN))
911
921
  return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
912
922
  const [i, s, n] = e, o = Math.max(0, Math.min(255, i)), a = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (c) => {
913
- const h = c.toString(16);
914
- return h.length === 1 ? "0" + h : h;
923
+ const d = c.toString(16);
924
+ return d.length === 1 ? "0" + d : d;
915
925
  };
916
926
  return `#${r(o)}${r(a)}${r(l)}`;
917
927
  }
@@ -921,7 +931,7 @@ class F extends mt {
921
931
  return;
922
932
  }
923
933
  if (typeof t == "string") {
924
- const e = F.normalizeColorValue(t);
934
+ const e = R.normalizeColorValue(t);
925
935
  this.value = e, this.colorInputEl && (this.colorInputEl.value = e), this.textInputEl && (this.textInputEl.value = e), this.onChange && this.onChange(e), this.props.detectChange && this.props.detectChange(e);
926
936
  } else
927
937
  this.value = "#000000", this.colorInputEl && (this.colorInputEl.value = "#000000"), this.textInputEl && (this.textInputEl.value = "#000000"), this.onChange && this.onChange("#000000"), this.props.detectChange && this.props.detectChange("#000000");
@@ -951,8 +961,8 @@ class F extends mt {
951
961
  const r = l.value.trim();
952
962
  if (!r)
953
963
  return e.classList.remove("error"), !0;
954
- const h = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
955
- return h ? e.classList.remove("error") : e.classList.add("error"), h;
964
+ const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
965
+ return d ? e.classList.remove("error") : e.classList.add("error"), d;
956
966
  }, s = document.createElement("input");
957
967
  s.type = "color", s.className = "color-picker", s.value = this.value || "#000000", s.setAttribute("aria-label", "Choose color"), s.setAttribute("title", "Click to open color picker"), this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), this.colorInputEl = s;
958
968
  const n = document.createElement("div");
@@ -961,20 +971,20 @@ class F extends mt {
961
971
  n.style.backgroundColor = o;
962
972
  const a = document.createElement("input");
963
973
  return a.type = "text", a.className = "color-text-input", a.value = this.value || "", a.placeholder = "#000000", a.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), a.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), a.setAttribute("aria-label", "Hex color value"), a.setAttribute("maxlength", "7"), this.getDataPropsPath() && a.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = a, this.textInputEl.addEventListener("input", (l) => {
964
- var c, h;
974
+ var c, d;
965
975
  let r = l.target.value.trim();
966
976
  if (this.textInputEl && i(this.textInputEl)) {
967
- const d = F.normalizeColorValue(r);
968
- this.value = d, (c = this.onChange) == null || c.call(this, d), (h = this.detectChange) == null || h.call(this, d), this.colorInputEl && (this.colorInputEl.value = d), n.style.backgroundColor = d;
977
+ const h = R.normalizeColorValue(r);
978
+ this.value = h, (c = this.onChange) == null || c.call(this, h), (d = this.detectChange) == null || d.call(this, h), this.colorInputEl && (this.colorInputEl.value = h), n.style.backgroundColor = h;
969
979
  }
970
980
  }), this.colorInputEl.addEventListener("input", (l) => {
971
- var h, d;
972
- const r = l.target.value, c = F.normalizeColorValue(r);
973
- this.value = c, (h = this.onChange) == null || h.call(this, c), (d = this.detectChange) == null || d.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c, e.classList.remove("error");
981
+ var d, h;
982
+ const r = l.target.value, c = R.normalizeColorValue(r);
983
+ this.value = c, (d = this.onChange) == null || d.call(this, c), (h = this.detectChange) == null || h.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c, e.classList.remove("error");
974
984
  }), this.colorInputEl.addEventListener("change", (l) => {
975
- var h, d;
976
- const r = l.target.value, c = F.normalizeColorValue(r);
977
- this.value = c, (h = this.onChange) == null || h.call(this, c), (d = this.detectChange) == null || d.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c;
985
+ var d, h;
986
+ const r = l.target.value, c = R.normalizeColorValue(r);
987
+ this.value = c, (d = this.onChange) == null || d.call(this, c), (h = this.detectChange) == null || h.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c;
978
988
  }), e.appendChild(s), e.appendChild(n), e.appendChild(a), t.appendChild(e), this.element = t, t;
979
989
  }
980
990
  getElement() {
@@ -982,7 +992,7 @@ class F extends mt {
982
992
  }
983
993
  // Helper method to get normalized hex value
984
994
  getNormalizedValue() {
985
- return this.value ? F.normalizeColorValue(this.value) : "#000000";
995
+ return this.value ? R.normalizeColorValue(this.value) : "#000000";
986
996
  }
987
997
  // Helper method to check if current value is valid hex
988
998
  isValidHex() {
@@ -999,14 +1009,14 @@ const vt = `
999
1009
  <path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
1000
1010
  <path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
1001
1011
  </svg>`;
1002
- class W extends S {
1012
+ class U extends I {
1003
1013
  constructor(t = {}) {
1004
1014
  super({
1005
1015
  ...t,
1006
1016
  icon: t.icon || vt,
1007
1017
  title: t.title || "Color & Opacity",
1008
1018
  default: t.default || "#000000FF"
1009
- }), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = W.normalizeHexWithOpacity(this.value));
1019
+ }), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = U.normalizeHexWithOpacity(this.value));
1010
1020
  }
1011
1021
  static normalizeHexWithOpacity(t) {
1012
1022
  return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6 && (t = t + "FF"), t.length === 8 && /^[0-9A-Fa-f]{8}$/.test(t) ? `#${t.toUpperCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000FF"`), "#000000FF");
@@ -1024,7 +1034,7 @@ class W extends S {
1024
1034
  return `#${i}${n}`;
1025
1035
  }
1026
1036
  setValue(t) {
1027
- t === void 0 || t === "" ? this.value = "#000000FF" : this.value = W.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
1037
+ t === void 0 || t === "" ? this.value = "#000000FF" : this.value = U.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
1028
1038
  }
1029
1039
  updateInputElements() {
1030
1040
  this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
@@ -1035,7 +1045,7 @@ class W extends S {
1035
1045
  this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
1036
1046
  }
1037
1047
  handleColorChange(t) {
1038
- const e = this.getOpacityPercent(), i = W.combineColorOpacity(
1048
+ const e = this.getOpacityPercent(), i = U.combineColorOpacity(
1039
1049
  t,
1040
1050
  e
1041
1051
  );
@@ -1046,7 +1056,7 @@ class W extends S {
1046
1056
  return e || i ? (this.setValue(t), !0) : !1;
1047
1057
  }
1048
1058
  handleOpacityChange(t) {
1049
- const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = W.combineColorOpacity(
1059
+ const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = U.combineColorOpacity(
1050
1060
  e,
1051
1061
  i
1052
1062
  );
@@ -1121,7 +1131,7 @@ class W extends S {
1121
1131
  };
1122
1132
  }
1123
1133
  }
1124
- class jt extends S {
1134
+ class jt extends I {
1125
1135
  constructor(t = {}) {
1126
1136
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
1127
1137
  }
@@ -1153,7 +1163,7 @@ class jt extends S {
1153
1163
  return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
1154
1164
  }
1155
1165
  }
1156
- class D extends S {
1166
+ class G extends I {
1157
1167
  constructor(t) {
1158
1168
  super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
1159
1169
  }
@@ -1217,7 +1227,7 @@ const Ct = `
1217
1227
  <path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1218
1228
  <path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1219
1229
  </svg>`;
1220
- class yt extends D {
1230
+ class yt extends G {
1221
1231
  constructor(t = {}) {
1222
1232
  const e = {
1223
1233
  title: "Opacity",
@@ -1243,7 +1253,7 @@ const Et = `
1243
1253
  <polyline points="6 9 12 15 18 9"></polyline>
1244
1254
  </svg>
1245
1255
  `;
1246
- class et extends S {
1256
+ class et extends I {
1247
1257
  constructor(t = {}) {
1248
1258
  if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.clickOutsideListener = null, this.resizeListener = null, t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && (this.isLoading = !0), this.value !== void 0) {
1249
1259
  const e = this._options.findIndex((i) => i.value === this.value);
@@ -1356,7 +1366,7 @@ class et extends S {
1356
1366
  this.clickOutsideListener && (document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = null), this.resizeListener && (window.removeEventListener("resize", this.resizeListener), this.resizeListener = null), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.parentNode && this.optionsListEl.parentNode.removeChild(this.optionsListEl), super.destroy();
1357
1367
  }
1358
1368
  }
1359
- class bt extends S {
1369
+ class bt extends I {
1360
1370
  constructor(t = {}) {
1361
1371
  super(t), this.inputType = "button", this.value || (this.value = "center");
1362
1372
  }
@@ -1412,7 +1422,7 @@ class bt extends S {
1412
1422
  }), t.appendChild(i), t;
1413
1423
  }
1414
1424
  }
1415
- class _t extends S {
1425
+ class _t extends I {
1416
1426
  constructor(t) {
1417
1427
  super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
1418
1428
  }
@@ -1441,21 +1451,21 @@ class _t extends S {
1441
1451
  return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
1442
1452
  }
1443
1453
  }
1444
- class qt extends S {
1454
+ class qt extends I {
1445
1455
  constructor(t = {}) {
1446
1456
  super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
1447
1457
  const e = t.width || 0, i = t.height || 0;
1448
1458
  this.value || (this.value = {
1449
1459
  width: e,
1450
1460
  height: i
1451
- }), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new D({
1461
+ }), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new G({
1452
1462
  title: "Width",
1453
1463
  default: this.value.width,
1454
1464
  suffix: "px",
1455
1465
  minValue: this.minWidth,
1456
1466
  maxValue: this.maxWidth,
1457
1467
  icon: wt
1458
- }), this.heightSetting = new D({
1468
+ }), this.heightSetting = new G({
1459
1469
  title: "Height",
1460
1470
  default: this.value.height,
1461
1471
  suffix: "px",
@@ -1592,7 +1602,7 @@ const wt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
1592
1602
  <circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
1593
1603
  </svg>
1594
1604
  `;
1595
- class at extends S {
1605
+ class at extends I {
1596
1606
  constructor(t = {}) {
1597
1607
  super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.messageListener = null, this.loadingSpinner = null, this.props.delete === void 0 && (this.props.delete = !0), this.props.maxFileSizeMB === void 0 && (this.props.maxFileSizeMB = 5), !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl), this.setupMessageListener();
1598
1608
  }
@@ -1712,7 +1722,7 @@ class at extends S {
1712
1722
  }, t;
1713
1723
  }
1714
1724
  }
1715
- class Jt extends D {
1725
+ class Jt extends G {
1716
1726
  constructor(t = {}) {
1717
1727
  super({
1718
1728
  ...t,
@@ -1733,7 +1743,7 @@ class Jt extends D {
1733
1743
  const St = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1734
1744
  <path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
1735
1745
  </svg>`;
1736
- class Zt extends D {
1746
+ class Zt extends G {
1737
1747
  constructor(t = {}) {
1738
1748
  super({
1739
1749
  ...t,
@@ -1758,7 +1768,7 @@ const It = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
1758
1768
  <polyline points="6 9 12 15 18 9"></polyline>
1759
1769
  </svg>
1760
1770
  `;
1761
- class Xt extends S {
1771
+ class Xt extends I {
1762
1772
  constructor(t = {}) {
1763
1773
  if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.hasInitializedOptions = !1, this.selectedOptionIndex = null, t.default !== void 0 && (this.value = t.default), this.initializeOptions(t), !t.getOptionsAsync && this.value !== void 0) {
1764
1774
  const e = this._options.findIndex(
@@ -1860,7 +1870,7 @@ class Xt extends S {
1860
1870
  return JSON.stringify(t ? {} : { value: this.value }, null, 2);
1861
1871
  }
1862
1872
  selectApiOption(t, e, i) {
1863
- var l, r, c, h;
1873
+ var l, r, c, d;
1864
1874
  const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
1865
1875
  n && (n.checked = !0), this.selectedOptionIndex = e;
1866
1876
  const o = this._options[e].value;
@@ -1869,10 +1879,10 @@ class Xt extends S {
1869
1879
  if (a)
1870
1880
  a.textContent = this._options[e].name;
1871
1881
  else {
1872
- const d = i.firstChild;
1873
- d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
1882
+ const h = i.firstChild;
1883
+ h && h.tagName === "SPAN" && (h.textContent = this._options[e].name);
1874
1884
  }
1875
- this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (c = this.svgContainer) == null || c.classList.remove("open"), (h = this.onChange) == null || h.call(this, o), this.detectChangeCallback && this.detectChangeCallback(o);
1885
+ this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (c = this.svgContainer) == null || c.classList.remove("open"), (d = this.onChange) == null || d.call(this, o), this.detectChangeCallback && this.detectChangeCallback(o);
1876
1886
  }
1877
1887
  updateOptionsList() {
1878
1888
  !this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
@@ -1905,7 +1915,7 @@ class Xt extends S {
1905
1915
  ), this.updateButtonText();
1906
1916
  }
1907
1917
  }
1908
- class Yt extends S {
1918
+ class Yt extends I {
1909
1919
  constructor(t) {
1910
1920
  var e, i;
1911
1921
  super(t), this.inputType = "text", this.value = t.default ?? ((i = (e = t.options) == null ? void 0 : e[0]) == null ? void 0 : i.value) ?? "", this.detectChangeCallback = t.detectChange;
@@ -1929,7 +1939,7 @@ class Yt extends S {
1929
1939
  const s = document.createElement("input");
1930
1940
  s.type = "checkbox", s.checked = ((a = (o = this.props.options) == null ? void 0 : o.find((l) => l.value === this.value)) == null ? void 0 : a.status) ?? !1, this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), s.addEventListener("change", () => {
1931
1941
  var r, c;
1932
- const l = ((c = (r = this.props.options) == null ? void 0 : r.find((h) => h.status === s.checked)) == null ? void 0 : c.value) ?? "";
1942
+ const l = ((c = (r = this.props.options) == null ? void 0 : r.find((d) => d.status === s.checked)) == null ? void 0 : c.value) ?? "";
1933
1943
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
1934
1944
  });
1935
1945
  const n = document.createElement("span");
@@ -1958,7 +1968,7 @@ class Yt extends S {
1958
1968
  const Vt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1959
1969
  <path d="M13.3334 5.99996H2.66675M13.3334 9.99996H2.66675M5.33341 12.6666V3.33329M10.6667 12.6666V3.33329" stroke="#667085" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
1960
1970
  </svg>`;
1961
- class Kt extends S {
1971
+ class Kt extends I {
1962
1972
  // Store mobile value
1963
1973
  constructor(t = {}) {
1964
1974
  t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Vt, t.suffix = t.suffix ?? "px", t.minValue = t.minValue ?? 0, super(t), this.inputType = "number", this.inputValues = {}, this.mobileValue = t.mobile, this.value = this.validateValue(t.default ?? 0), t.rowGap && (this.inputValues.row = this.value), t.columnGap && (this.inputValues.column = this.value);
@@ -2015,7 +2025,7 @@ class Kt extends S {
2015
2025
  const Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2016
2026
  <path d="M2.25 11.75H15.75M5.85 2.75H12.15C13.4101 2.75 14.0402 2.75 14.5215 2.99524C14.9448 3.21095 15.289 3.55516 15.5048 3.97852C15.75 4.45982 15.75 5.08988 15.75 6.35V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V6.35C2.25 5.08988 2.25 4.45982 2.49524 3.97852C2.71095 3.55516 3.05516 3.21095 3.47852 2.99524C3.95982 2.75 4.58988 2.75 5.85 2.75Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2017
2027
  </svg>`;
2018
- class Qt extends D {
2028
+ class Qt extends G {
2019
2029
  constructor(t = {}) {
2020
2030
  super({
2021
2031
  ...t,
@@ -2032,7 +2042,7 @@ const Tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
2032
2042
  <path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
2033
2043
  stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2034
2044
  </svg>`;
2035
- class te extends D {
2045
+ class te extends G {
2036
2046
  constructor(t = {}) {
2037
2047
  super({
2038
2048
  ...t,
@@ -2045,9 +2055,9 @@ class te extends D {
2045
2055
  }), this.inputType = "number";
2046
2056
  }
2047
2057
  }
2048
- class ee extends S {
2058
+ class ee extends I {
2049
2059
  constructor(t) {
2050
- super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(S.DefaultLanguage) ? S.DefaultLanguage : t.languages[0];
2060
+ super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(I.DefaultLanguage) ? I.DefaultLanguage : t.languages[0];
2051
2061
  const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
2052
2062
  t.languages.forEach((i) => {
2053
2063
  var s, n;
@@ -2078,13 +2088,13 @@ class ee extends S {
2078
2088
  return;
2079
2089
  }
2080
2090
  const c = "...";
2081
- let h = 0, d = e.length, m = 0;
2082
- for (; h <= d; ) {
2083
- const g = Math.floor((h + d) / 2), f = e.slice(0, g).trimEnd() + c;
2084
- this.measureTextWidth(f, i) <= l ? (m = g, h = g + 1) : d = g - 1;
2091
+ let d = 0, h = e.length, u = 0;
2092
+ for (; d <= h; ) {
2093
+ const C = Math.floor((d + h) / 2), m = e.slice(0, C).trimEnd() + c;
2094
+ this.measureTextWidth(m, i) <= l ? (u = C, d = C + 1) : h = C - 1;
2085
2095
  }
2086
- const u = e.slice(0, m).trimEnd() + c;
2087
- t.placeholder = u;
2096
+ const g = e.slice(0, u).trimEnd() + c;
2097
+ t.placeholder = g;
2088
2098
  }
2089
2099
  autosizeTextarea(t, e = 3) {
2090
2100
  t.style.height = "auto";
@@ -2192,7 +2202,7 @@ class ee extends S {
2192
2202
  });
2193
2203
  }
2194
2204
  }
2195
- class ie extends S {
2205
+ class ie extends I {
2196
2206
  constructor(t = {}) {
2197
2207
  super(t), this.inputType = "select";
2198
2208
  const e = [
@@ -2235,75 +2245,82 @@ const lt = `<svg
2235
2245
  </svg>`;
2236
2246
  function nt(p) {
2237
2247
  try {
2238
- const t = p.match(/linear-gradient\(([^)]+)\)/);
2248
+ const t = p.match(/linear-gradient\s*\(/);
2239
2249
  if (t) {
2240
- const e = t[1].trim();
2241
- let i = 90;
2242
- const s = e.match(/(\d+)deg/);
2243
- s ? i = parseInt(s[1]) : e.includes("to right") ? i = 90 : e.includes("to left") ? i = 270 : e.includes("to top") ? i = 0 : e.includes("to bottom") ? i = 180 : e.includes("to top right") ? i = 45 : e.includes("to top left") ? i = 315 : e.includes("to bottom right") ? i = 135 : e.includes("to bottom left") && (i = 225);
2244
- const n = [];
2245
- let o = "", a = 0;
2246
- for (let r = 0; r < e.length; r++) {
2247
- const c = e[r];
2248
- c === "(" && a++, c === ")" && a--, c === "," && a === 0 ? (n.push(o.trim()), o = "") : o += c;
2249
- }
2250
- o.trim() && n.push(o.trim());
2251
- const l = [];
2252
- for (let r = 0; r < n.length; r++) {
2253
- const c = n[r];
2254
- if (c.includes("deg") || c.includes("to ")) continue;
2255
- let h = "", d = 0, m = 100;
2256
- const u = c.match(/rgba?\(([^)]+)\)(?:\s*(\d+)%)?/);
2257
- if (u) {
2258
- const g = u[1].split(",").map((V) => V.trim()), f = parseInt(g[0]), y = parseInt(g[1]), v = parseInt(g[2]), w = g[3] ? parseFloat(g[3]) : 1;
2259
- h = `#${f.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}${v.toString(16).padStart(2, "0")}`, m = Math.round(w * 100), u[2] ? d = parseInt(u[2]) : d = Math.round(r / Math.max(n.length - 2, 1) * 100);
2260
- } else {
2261
- const g = c.match(/#([a-fA-F0-9]{3,8})(?:\s*(\d+)%)?/);
2262
- g && (h = `#${g[1]}`, g[2] ? d = parseInt(g[2]) : d = Math.round(r / Math.max(n.length - 2, 1) * 100));
2250
+ const e = t.index + t[0].length;
2251
+ let i = 1, s = e;
2252
+ for (let n = e; n < p.length && i > 0; n++)
2253
+ p[n] === "(" ? i++ : p[n] === ")" && i--, s = n;
2254
+ if (i === 0) {
2255
+ const n = p.substring(e, s).trim();
2256
+ let o = 90;
2257
+ const a = n.match(/(\d+)deg/);
2258
+ a ? o = parseInt(a[1]) : n.includes("to right") ? o = 90 : n.includes("to left") ? o = 270 : n.includes("to top") ? o = 0 : n.includes("to bottom") ? o = 180 : n.includes("to top right") ? o = 45 : n.includes("to top left") ? o = 315 : n.includes("to bottom right") ? o = 135 : n.includes("to bottom left") && (o = 225);
2259
+ const l = [];
2260
+ let r = "", c = 0;
2261
+ for (let u = 0; u < n.length; u++) {
2262
+ const g = n[u];
2263
+ g === "(" && c++, g === ")" && c--, g === "," && c === 0 ? (l.push(r.trim()), r = "") : r += g;
2263
2264
  }
2264
- h && l.push({
2265
- color: h,
2266
- position: d,
2267
- opacity: m
2268
- });
2269
- }
2270
- if (l.length === 0) {
2271
- console.log(
2272
- "No positioned stops found, trying to extract colors without positions"
2273
- );
2274
- const r = e.match(
2275
- /(#[a-fA-F0-9]{3,8}|rgba?\([^)]+\))/g
2276
- );
2277
- r && r.forEach((c, h) => {
2278
- let d = "", m = 100;
2279
- if (c.startsWith("#"))
2280
- d = c;
2281
- else {
2282
- const u = c.match(/rgba?\(([^)]+)\)/);
2283
- if (u) {
2284
- const g = u[1].split(",").map((V) => V.trim()), f = parseInt(g[0]), y = parseInt(g[1]), v = parseInt(g[2]), w = g[3] ? parseFloat(g[3]) : 1;
2285
- d = `#${f.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}${v.toString(16).padStart(2, "0")}`, m = Math.round(w * 100);
2286
- }
2287
- }
2288
- if (d) {
2289
- const u = Math.round(
2290
- h / Math.max(r.length - 1, 1) * 100
2265
+ r.trim() && l.push(r.trim());
2266
+ const d = [];
2267
+ let h = [];
2268
+ for (let u = 0; u < l.length; u++) {
2269
+ const g = l[u];
2270
+ g.includes("deg") || g.includes("to ") || h.push(g);
2271
+ }
2272
+ for (let u = 0; u < h.length; u++) {
2273
+ const g = h[u];
2274
+ let C = "", m = 0, y = 100;
2275
+ const f = g.match(
2276
+ /rgba?\(([^)]+)\)(?:\s*(\d+(?:\.\d+)?)%)?/
2277
+ );
2278
+ if (f) {
2279
+ const E = f[1].split(",").map((b) => b.trim()), V = parseInt(E[0]), A = parseInt(E[1]), B = parseInt(E[2]), L = E[3] ? parseFloat(E[3]) : 1;
2280
+ C = `#${V.toString(16).padStart(2, "0")}${A.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`, y = Math.round(L * 100), f[2] ? m = parseFloat(f[2]) : m = h.length === 1 ? 0 : Math.round(u / (h.length - 1) * 100);
2281
+ } else {
2282
+ const E = g.match(
2283
+ /#([a-fA-F0-9]{3,8})(?:\s*(\d+(?:\.\d+)?)%)?/
2291
2284
  );
2292
- console.log(
2293
- `Auto-positioned stop: ${d} at ${u}% with ${m}% opacity`
2294
- ), l.push({
2295
- color: d,
2296
- position: u,
2297
- opacity: m
2298
- });
2285
+ E && (C = `#${E[1]}`, E[2] ? m = parseFloat(E[2]) : m = h.length === 1 ? 0 : Math.round(u / (h.length - 1) * 100));
2299
2286
  }
2300
- });
2287
+ C && d.push({
2288
+ color: C,
2289
+ position: m,
2290
+ opacity: y
2291
+ });
2292
+ }
2293
+ if (d.length === 0) {
2294
+ const u = n.match(
2295
+ /(#[a-fA-F0-9]{3,8}|rgba?\([^)]+\))/g
2296
+ );
2297
+ u && u.forEach((g, C) => {
2298
+ let m = "", y = 100;
2299
+ if (g.startsWith("#"))
2300
+ m = g;
2301
+ else {
2302
+ const f = g.match(/rgba?\(([^)]+)\)/);
2303
+ if (f) {
2304
+ const E = f[1].split(",").map((b) => b.trim()), V = parseInt(E[0]), A = parseInt(E[1]), B = parseInt(E[2]), L = E[3] ? parseFloat(E[3]) : 1;
2305
+ m = `#${V.toString(16).padStart(2, "0")}${A.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`, y = Math.round(L * 100);
2306
+ }
2307
+ }
2308
+ if (m) {
2309
+ const f = u.length === 1 ? 0 : Math.round(C / (u.length - 1) * 100);
2310
+ d.push({
2311
+ color: m,
2312
+ position: f,
2313
+ opacity: y
2314
+ });
2315
+ }
2316
+ });
2317
+ }
2318
+ return console.log("Color stops found:", d), {
2319
+ type: "linear",
2320
+ angle: o,
2321
+ stops: d
2322
+ };
2301
2323
  }
2302
- return {
2303
- type: "linear",
2304
- angle: i,
2305
- stops: l
2306
- };
2307
2324
  }
2308
2325
  return null;
2309
2326
  } catch (t) {
@@ -2340,27 +2357,27 @@ class Pt {
2340
2357
  r.className = "color-picker-hue", this.hueSlider = r;
2341
2358
  const c = document.createElement("div");
2342
2359
  c.className = "color-picker-hue-marker", this.hueMarker = c, r.appendChild(c), a.appendChild(l), a.appendChild(r);
2343
- const h = document.createElement("div");
2344
- h.className = "color-picker-opacity", this.opacitySlider = h;
2345
2360
  const d = document.createElement("div");
2346
- d.className = "color-picker-opacity-marker", this.opacityMarker = d, h.appendChild(d);
2347
- const m = document.createElement("div");
2348
- m.className = "color-picker-format-section";
2349
- const u = document.createElement("select");
2350
- u.className = "color-picker-format-select", this.formatSelect = u;
2351
- const g = document.createElement("option");
2352
- g.value = "hex", g.textContent = "HEX";
2353
- const f = document.createElement("option");
2354
- f.value = "rgb", f.textContent = "RGB";
2361
+ d.className = "color-picker-opacity", this.opacitySlider = d;
2362
+ const h = document.createElement("div");
2363
+ h.className = "color-picker-opacity-marker", this.opacityMarker = h, d.appendChild(h);
2364
+ const u = document.createElement("div");
2365
+ u.className = "color-picker-format-section";
2366
+ const g = document.createElement("select");
2367
+ g.className = "color-picker-format-select", this.formatSelect = g;
2368
+ const C = document.createElement("option");
2369
+ C.value = "hex", C.textContent = "HEX";
2370
+ const m = document.createElement("option");
2371
+ m.value = "rgb", m.textContent = "RGB";
2355
2372
  const y = document.createElement("option");
2356
- y.value = "hsl", y.textContent = "HSL", u.appendChild(g), u.appendChild(f), u.appendChild(y);
2357
- const v = document.createElement("input");
2358
- v.type = "text", v.className = "color-picker-color-input", v.value = this.currentColor, this.hexInput = v;
2359
- const w = document.createElement("div");
2360
- w.className = "color-picker-input-container";
2373
+ y.value = "hsl", y.textContent = "HSL", g.appendChild(C), g.appendChild(m), g.appendChild(y);
2374
+ const f = document.createElement("input");
2375
+ f.type = "text", f.className = "color-picker-color-input", f.value = this.currentColor, this.hexInput = f;
2376
+ const E = document.createElement("div");
2377
+ E.className = "color-picker-input-container";
2361
2378
  const V = document.createElement("button");
2362
- return V.className = "color-picker-copy-inside", V.textContent = "Copy", V.addEventListener("click", () => this.copyToClipboard()), w.appendChild(v), w.appendChild(V), m.appendChild(u), m.appendChild(w), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(h), t.appendChild(m), this.setupEyedropper(l), this.setupEventListeners(), t.addEventListener("click", (z) => {
2363
- z.stopPropagation();
2379
+ return V.className = "color-picker-copy-inside", V.textContent = "Copy", V.addEventListener("click", () => this.copyToClipboard()), E.appendChild(f), E.appendChild(V), u.appendChild(g), u.appendChild(E), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(d), t.appendChild(u), this.setupEyedropper(l), this.setupEventListeners(), t.addEventListener("click", (A) => {
2380
+ A.stopPropagation();
2364
2381
  }), t;
2365
2382
  }
2366
2383
  setupEventListeners() {
@@ -2400,11 +2417,7 @@ class Pt {
2400
2417
  this.isUpdatingHue = !0;
2401
2418
  const e = this.hueSlider.getBoundingClientRect();
2402
2419
  let i = (t.clientX - e.left) / e.width;
2403
- i = Math.max(2e-3, Math.min(0.996, i)), console.log("Hue slider click:", {
2404
- x: i,
2405
- hueValue: i * 360,
2406
- percent: i * 100
2407
- }), this.hueMarker.style.left = `${i * 100}%`;
2420
+ i = Math.max(2e-3, Math.min(0.996, i)), this.hueMarker.style.left = `${i * 100}%`;
2408
2421
  const s = i * 360;
2409
2422
  this.updateHue(s), this.isUpdatingHue = !1;
2410
2423
  }
@@ -2413,16 +2426,15 @@ class Pt {
2413
2426
  this.setColor(s);
2414
2427
  }
2415
2428
  updateHue(t) {
2416
- const e = t;
2417
- t = Math.max(0.5, Math.min(358.5, t)), console.log("UpdateHue:", { originalHue: e, clampedHue: t }), this.colorArea.getBoundingClientRect();
2418
- const i = parseFloat(this.colorMarker.style.left || "50%") / 100, s = parseFloat(this.colorMarker.style.top || "50%") / 100;
2429
+ t = Math.max(0.5, Math.min(358.5, t)), this.colorArea.getBoundingClientRect();
2430
+ const e = parseFloat(this.colorMarker.style.left || "50%") / 100, i = parseFloat(this.colorMarker.style.top || "50%") / 100;
2419
2431
  this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`;
2420
- const n = i, o = 1 - s, a = this.hsvToHex(t, n, o);
2421
- this.setColor(a);
2432
+ const s = e, n = 1 - i, o = this.hsvToHex(t, s, n);
2433
+ this.setColor(o);
2422
2434
  }
2423
2435
  getCurrentHue() {
2424
- const t = parseFloat(this.hueMarker.style.left || "0%") / 100, e = t * 360;
2425
- return console.log("GetCurrentHue:", { huePosition: t, hueValue: e }), Math.max(0.5, Math.min(358.5, e));
2436
+ const e = parseFloat(this.hueMarker.style.left || "0%") / 100 * 360;
2437
+ return Math.max(0.5, Math.min(358.5, e));
2426
2438
  }
2427
2439
  updateColorInput() {
2428
2440
  const t = this.formatSelect.value, { h: e, s: i, v: s } = this.hexToHsv(this.currentColor);
@@ -2490,7 +2502,7 @@ class Pt {
2490
2502
  return /^#[0-9A-Fa-f]{6}$/.test(t);
2491
2503
  }
2492
2504
  hsvToHex(t, e, i) {
2493
- t = Math.max(0, Math.min(359.9, t)), e = Math.max(0, Math.min(1, e)), i = Math.max(0, Math.min(1, i)), console.log("CustomColorPicker HsvToHex:", { h: t, s: e, v: i });
2505
+ t = Math.max(0, Math.min(359.9, t)), e = Math.max(0, Math.min(1, e)), i = Math.max(0, Math.min(1, i));
2494
2506
  const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
2495
2507
  let a = 0, l = 0, r = 0;
2496
2508
  return t < 60 ? (a = s, l = n, r = 0) : t < 120 ? (a = n, l = s, r = 0) : t < 180 ? (a = 0, l = s, r = n) : t < 240 ? (a = 0, l = n, r = s) : t < 300 ? (a = n, l = 0, r = s) : (a = s, l = 0, r = n), a = Math.round((a + o) * 255), l = Math.round((l + o) * 255), r = Math.round((r + o) * 255), `#${a.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}`;
@@ -2551,21 +2563,21 @@ class Pt {
2551
2563
  }
2552
2564
  makeDraggable(t, e) {
2553
2565
  let i = !1, s = 0, n = 0, o = 0, a = 0;
2554
- const l = (h) => {
2555
- if (h.target.closest("button"))
2566
+ const l = (d) => {
2567
+ if (d.target.closest("button"))
2556
2568
  return;
2557
- h.preventDefault(), h.stopPropagation(), i = !0, s = h.clientX, n = h.clientY;
2558
- const d = e.getBoundingClientRect();
2559
- o = d.left, a = d.top, e.classList.add("dragging"), document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
2560
- }, r = (h) => {
2569
+ d.preventDefault(), d.stopPropagation(), i = !0, s = d.clientX, n = d.clientY;
2570
+ const h = e.getBoundingClientRect();
2571
+ o = h.left, a = h.top, e.classList.add("dragging"), document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
2572
+ }, r = (d) => {
2561
2573
  if (!i) return;
2562
- h.preventDefault(), h.stopPropagation();
2563
- const d = h.clientX - s, m = h.clientY - n;
2564
- let u = o + d, g = a + m;
2565
- const f = window.innerWidth, y = window.innerHeight, v = e.offsetWidth, w = e.offsetHeight;
2566
- u = Math.max(8, Math.min(f - v - 8, u)), g = Math.max(8, Math.min(y - w - 8, g)), e.style.left = `${u}px`, e.style.top = `${g}px`;
2567
- }, c = (h) => {
2568
- i && (i = !1, h.preventDefault(), h.stopPropagation(), e.classList.remove("dragging"), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "");
2574
+ d.preventDefault(), d.stopPropagation();
2575
+ const h = d.clientX - s, u = d.clientY - n;
2576
+ let g = o + h, C = a + u;
2577
+ const m = window.innerWidth, y = window.innerHeight, f = e.offsetWidth, E = e.offsetHeight;
2578
+ g = Math.max(8, Math.min(m - f - 8, g)), C = Math.max(8, Math.min(y - E - 8, C)), e.style.left = `${g}px`, e.style.top = `${C}px`;
2579
+ }, c = (d) => {
2580
+ i && (i = !1, d.preventDefault(), d.stopPropagation(), e.classList.remove("dragging"), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "");
2569
2581
  };
2570
2582
  t.addEventListener("mousedown", l);
2571
2583
  }
@@ -2576,7 +2588,7 @@ class Pt {
2576
2588
  return this.element;
2577
2589
  }
2578
2590
  }
2579
- class se extends S {
2591
+ class se extends I {
2580
2592
  constructor(t = {}) {
2581
2593
  let e;
2582
2594
  if (typeof t.default == "string")
@@ -2609,7 +2621,10 @@ class se extends S {
2609
2621
  { color: "#786666", position: 100, opacity: 100 }
2610
2622
  ]
2611
2623
  };
2612
- super({
2624
+ (!e.stops || e.stops.length === 0) && (e.stops = [
2625
+ { color: "#a84b4b", position: 0, opacity: 100 },
2626
+ { color: "#786666", position: 100, opacity: 100 }
2627
+ ]), super({
2613
2628
  ...t,
2614
2629
  title: t.title || "Gradient",
2615
2630
  default: e
@@ -2628,26 +2643,12 @@ class se extends S {
2628
2643
  }
2629
2644
  // Safe getter for the value property
2630
2645
  getSafeValue() {
2631
- return !this.value || !this.isValidGradientValue(this.value) ? (console.warn("Invalid value detected, returning default:", this.value), {
2632
- type: "linear",
2633
- angle: 90,
2634
- stops: [
2635
- { color: "#a84b4b", position: 0, opacity: 100 },
2636
- { color: "#786666", position: 100, opacity: 100 }
2637
- ]
2638
- }) : this.value;
2646
+ return !this.value || !this.isValidGradientValue(this.value) ? (console.warn("Invalid value detected, returning default:", this.value), this.getDefaultGradientValue()) : this.value;
2639
2647
  }
2640
2648
  setValue(t) {
2641
2649
  let e;
2642
2650
  if (!t)
2643
- console.warn("Undefined value in setValue, using default"), e = {
2644
- type: "linear",
2645
- angle: 90,
2646
- stops: [
2647
- { color: "#a84b4b", position: 0, opacity: 100 },
2648
- { color: "#786666", position: 100, opacity: 100 }
2649
- ]
2650
- };
2651
+ console.warn("Undefined value in setValue, using default"), e = this.getDefaultGradientValue();
2651
2652
  else if (typeof t == "string")
2652
2653
  if (t.match(/^#[a-fA-F0-9]{3,8}$/)) {
2653
2654
  let i = t, s = 100;
@@ -2662,17 +2663,10 @@ class se extends S {
2662
2663
  };
2663
2664
  } else {
2664
2665
  const i = nt(t);
2665
- i ? e = i : (console.warn(
2666
+ i && this.isValidGradientValue(i) ? e = i : (console.warn(
2666
2667
  "Failed to parse string value, using default:",
2667
2668
  t
2668
- ), e = {
2669
- type: "linear",
2670
- angle: 90,
2671
- stops: [
2672
- { color: "#a84b4b", position: 0, opacity: 100 },
2673
- { color: "#786666", position: 100, opacity: 100 }
2674
- ]
2675
- });
2669
+ ), e = this.getDefaultGradientValue());
2676
2670
  }
2677
2671
  else if (typeof t == "object" && t.background) {
2678
2672
  console.warn(
@@ -2684,28 +2678,27 @@ class se extends S {
2684
2678
  this.setValue(i);
2685
2679
  return;
2686
2680
  } else
2687
- e = {
2688
- type: "linear",
2689
- angle: 90,
2690
- stops: [
2691
- { color: "#a84b4b", position: 0, opacity: 100 },
2692
- { color: "#786666", position: 100, opacity: 100 }
2693
- ]
2694
- };
2695
- } else this.isValidGradientValue(t) ? (e = t, e.stops && e.stops.forEach((i) => {
2681
+ e = this.getDefaultGradientValue();
2682
+ } else this.isValidGradientValue(t) ? (e = t, e.stops && e.stops.length > 0 ? e.stops.forEach((i) => {
2696
2683
  i.opacity === void 0 && (i.opacity = 100);
2697
- })) : (console.warn(
2684
+ }) : e.stops = [
2685
+ { color: "#a84b4b", position: 0, opacity: 100 },
2686
+ { color: "#786666", position: 100, opacity: 100 }
2687
+ ]) : (console.warn(
2698
2688
  "Invalid gradient value in setValue, using default:",
2699
2689
  t
2700
- ), e = {
2690
+ ), e = this.getDefaultGradientValue());
2691
+ super.setValue(e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent();
2692
+ }
2693
+ getDefaultGradientValue() {
2694
+ return this.props && this.props.default && this.isValidGradientValue(this.props.default) ? this.props.default : {
2701
2695
  type: "linear",
2702
2696
  angle: 90,
2703
2697
  stops: [
2704
2698
  { color: "#a84b4b", position: 0, opacity: 100 },
2705
2699
  { color: "#786666", position: 100, opacity: 100 }
2706
2700
  ]
2707
- });
2708
- super.setValue(e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent();
2701
+ };
2709
2702
  }
2710
2703
  updateUI() {
2711
2704
  if (this.previewElement && this.value)
@@ -2878,14 +2871,14 @@ class se extends S {
2878
2871
  t.innerHTML = "", this.value && (this.value.type === "solid" ? this.createSolidEditor(t) : this.createGradientEditor(t));
2879
2872
  }
2880
2873
  createSolidEditor(t) {
2881
- var o, a, l, r, c, h;
2874
+ var o, a, l, r, c, d;
2882
2875
  const e = document.createElement("div");
2883
2876
  e.className = "gradient-solid-picker embedded-color-picker";
2884
- const i = ((l = (a = (o = this.value) == null ? void 0 : o.stops) == null ? void 0 : a[0]) == null ? void 0 : l.color) || "#000000", s = ((h = (c = (r = this.value) == null ? void 0 : r.stops) == null ? void 0 : c[0]) == null ? void 0 : h.opacity) || 100, n = this.createEmbeddedColorPickerWithOpacity(
2877
+ const i = ((l = (a = (o = this.value) == null ? void 0 : o.stops) == null ? void 0 : a[0]) == null ? void 0 : l.color) || "#000000", s = ((d = (c = (r = this.value) == null ? void 0 : r.stops) == null ? void 0 : c[0]) == null ? void 0 : d.opacity) || 100, n = this.createEmbeddedColorPickerWithOpacity(
2885
2878
  i,
2886
2879
  s,
2887
- (d, m) => {
2888
- this.value && (!this.value.stops || this.value.stops.length === 0 ? this.value.stops = [{ color: d, position: 0, opacity: m }] : (this.value.stops[0].color = d, this.value.stops[0].opacity = m), this.updateUI(), this.triggerChange());
2880
+ (h, u) => {
2881
+ this.value && (!this.value.stops || this.value.stops.length === 0 ? this.value.stops = [{ color: h, position: 0, opacity: u }] : (this.value.stops[0].color = h, this.value.stops[0].opacity = u), this.updateUI(), this.triggerChange());
2889
2882
  }
2890
2883
  );
2891
2884
  e.appendChild(n), t.appendChild(e);
@@ -2907,40 +2900,40 @@ class se extends S {
2907
2900
  r.className = "color-picker-hue embedded";
2908
2901
  const c = document.createElement("div");
2909
2902
  c.className = "color-picker-hue-marker", r.appendChild(c), a.appendChild(l), a.appendChild(r);
2910
- const h = document.createElement("div");
2911
- h.className = "color-picker-opacity embedded";
2912
2903
  const d = document.createElement("div");
2913
- d.className = "color-picker-opacity-marker", h.appendChild(d);
2914
- const m = document.createElement("div");
2915
- m.className = "color-picker-format-section embedded";
2916
- const u = document.createElement("select");
2917
- u.className = "color-picker-format-select";
2918
- const g = document.createElement("option");
2919
- g.value = "hex", g.textContent = "HEX";
2920
- const f = document.createElement("option");
2921
- f.value = "rgb", f.textContent = "RGB";
2904
+ d.className = "color-picker-opacity embedded";
2905
+ const h = document.createElement("div");
2906
+ h.className = "color-picker-opacity-marker", d.appendChild(h);
2907
+ const u = document.createElement("div");
2908
+ u.className = "color-picker-format-section embedded";
2909
+ const g = document.createElement("select");
2910
+ g.className = "color-picker-format-select";
2911
+ const C = document.createElement("option");
2912
+ C.value = "hex", C.textContent = "HEX";
2913
+ const m = document.createElement("option");
2914
+ m.value = "rgb", m.textContent = "RGB";
2922
2915
  const y = document.createElement("option");
2923
- y.value = "hsl", y.textContent = "HSL", u.appendChild(g), u.appendChild(f), u.appendChild(y);
2924
- const v = document.createElement("input");
2925
- v.type = "text", v.className = "color-picker-color-input", v.value = t;
2926
- const w = document.createElement("div");
2927
- w.className = "color-picker-input-container";
2916
+ y.value = "hsl", y.textContent = "HSL", g.appendChild(C), g.appendChild(m), g.appendChild(y);
2917
+ const f = document.createElement("input");
2918
+ f.type = "text", f.className = "color-picker-color-input", f.value = t;
2919
+ const E = document.createElement("div");
2920
+ E.className = "color-picker-input-container";
2928
2921
  const V = document.createElement("button");
2929
- return V.className = "color-picker-copy-inside", V.textContent = "Copy", w.appendChild(v), w.appendChild(V), m.appendChild(u), m.appendChild(w), s.appendChild(n), s.appendChild(a), s.appendChild(h), s.appendChild(m), this.setupEmbeddedColorPicker(
2922
+ return V.className = "color-picker-copy-inside", V.textContent = "Copy", E.appendChild(f), E.appendChild(V), u.appendChild(g), u.appendChild(E), s.appendChild(n), s.appendChild(a), s.appendChild(d), s.appendChild(u), this.setupEmbeddedColorPicker(
2930
2923
  n,
2931
2924
  o,
2932
2925
  r,
2933
2926
  c,
2934
- u,
2935
- v,
2927
+ g,
2928
+ f,
2936
2929
  V,
2937
2930
  l,
2938
2931
  t,
2939
2932
  e,
2940
2933
  i
2941
2934
  ), this.setupOpacitySlider(
2942
- h,
2943
2935
  d,
2936
+ h,
2944
2937
  t,
2945
2938
  e,
2946
2939
  i
@@ -2963,140 +2956,140 @@ class se extends S {
2963
2956
  r.className = "color-picker-hue embedded";
2964
2957
  const c = document.createElement("div");
2965
2958
  c.className = "color-picker-hue-marker", r.appendChild(c), a.appendChild(l), a.appendChild(r);
2966
- const h = document.createElement("div");
2967
- h.className = "color-picker-format-section embedded";
2968
- const d = document.createElement("select");
2969
- d.className = "color-picker-format-select";
2970
- const m = document.createElement("option");
2971
- m.value = "hex", m.textContent = "HEX";
2959
+ const d = document.createElement("div");
2960
+ d.className = "color-picker-format-section embedded";
2961
+ const h = document.createElement("select");
2962
+ h.className = "color-picker-format-select";
2972
2963
  const u = document.createElement("option");
2973
- u.value = "rgb", u.textContent = "RGB";
2964
+ u.value = "hex", u.textContent = "HEX";
2974
2965
  const g = document.createElement("option");
2975
- g.value = "hsl", g.textContent = "HSL", d.appendChild(m), d.appendChild(u), d.appendChild(g);
2976
- const f = document.createElement("input");
2977
- f.type = "text", f.className = "color-picker-color-input", f.value = t;
2966
+ g.value = "rgb", g.textContent = "RGB";
2967
+ const C = document.createElement("option");
2968
+ C.value = "hsl", C.textContent = "HSL", h.appendChild(u), h.appendChild(g), h.appendChild(C);
2969
+ const m = document.createElement("input");
2970
+ m.type = "text", m.className = "color-picker-color-input", m.value = t;
2978
2971
  const y = document.createElement("div");
2979
2972
  y.className = "color-picker-input-container";
2980
- const v = document.createElement("button");
2981
- return v.className = "color-picker-copy-inside", v.textContent = "Copy", y.appendChild(f), y.appendChild(v), h.appendChild(d), h.appendChild(y), s.appendChild(n), s.appendChild(a), s.appendChild(h), this.setupEmbeddedColorPicker(
2973
+ const f = document.createElement("button");
2974
+ return f.className = "color-picker-copy-inside", f.textContent = "Copy", y.appendChild(m), y.appendChild(f), d.appendChild(h), d.appendChild(y), s.appendChild(n), s.appendChild(a), s.appendChild(d), this.setupEmbeddedColorPicker(
2982
2975
  n,
2983
2976
  o,
2984
2977
  r,
2985
2978
  c,
2986
- d,
2979
+ h,
2980
+ m,
2987
2981
  f,
2988
- v,
2989
2982
  l,
2990
2983
  t,
2991
2984
  e,
2992
2985
  i
2993
2986
  ), s;
2994
2987
  }
2995
- setupEmbeddedColorPicker(t, e, i, s, n, o, a, l, r, c, h) {
2996
- let d = r;
2997
- const { h: m, s: u, v: g } = this.hexToHsv(r);
2998
- let f = c;
2999
- s.style.left = `${m / 360 * 100}%`, e.style.left = `${u * 100}%`, e.style.top = `${(1 - g) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`;
3000
- const y = (C, b = f) => {
3001
- d = C, f = Math.round(b), v(), h(C, f);
3002
- }, v = () => {
3003
- const C = n.value, { h: b, s: x, v: L } = this.hexToHsv(d);
3004
- switch (C) {
2988
+ setupEmbeddedColorPicker(t, e, i, s, n, o, a, l, r, c, d) {
2989
+ let h = r;
2990
+ const { h: u, s: g, v: C } = this.hexToHsv(r);
2991
+ let m = c;
2992
+ s.style.left = `${u / 360 * 100}%`, e.style.left = `${g * 100}%`, e.style.top = `${(1 - C) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`;
2993
+ const y = (v, w = m) => {
2994
+ h = v, m = Math.round(w), f(), d(v, m);
2995
+ }, f = () => {
2996
+ const v = n.value, { h: w, s: x, v: k } = this.hexToHsv(h);
2997
+ switch (v) {
3005
2998
  case "hex":
3006
- o.value = d;
2999
+ o.value = h;
3007
3000
  break;
3008
3001
  case "rgb":
3009
- const { r: H, g: $, b: R } = this.hexToRgb(d);
3010
- o.value = `rgb(${H}, ${$}, ${R})`;
3002
+ const { r: H, g: $, b: W } = this.hexToRgb(h);
3003
+ o.value = `rgb(${H}, ${$}, ${W})`;
3011
3004
  break;
3012
3005
  case "hsl":
3013
- const { hue: B, sat: _, lightness: K } = this.hsvToHsl(b, x, L);
3014
- o.value = `hsl(${Math.round(B)}, ${Math.round(
3015
- _ * 100
3006
+ const { hue: F, sat: q, lightness: K } = this.hsvToHsl(w, x, k);
3007
+ o.value = `hsl(${Math.round(F)}, ${Math.round(
3008
+ q * 100
3016
3009
  )}%, ${Math.round(K * 100)}%)`;
3017
3010
  break;
3018
3011
  }
3019
- }, w = () => parseFloat(s.style.left || "0%") / 100 * 360, V = (C, b) => {
3020
- const x = w(), L = this.hsvToHex(x, C, b);
3021
- y(L, f);
3022
- }, z = (C) => {
3023
- C = Math.max(0.1, Math.min(358.9, C));
3024
- const b = parseFloat(e.style.left || "50%") / 100, x = parseFloat(e.style.top || "50%") / 100;
3025
- t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${C}, 100%, 50%))`;
3026
- const L = b, H = 1 - x, $ = this.hsvToHex(C, L, H);
3027
- y($, f);
3028
- }, U = (C) => {
3029
- C.stopPropagation();
3030
- const b = t.getBoundingClientRect(), x = Math.max(0, Math.min(1, (C.clientX - b.left) / b.width)), L = Math.max(0, Math.min(1, (C.clientY - b.top) / b.height));
3031
- e.style.left = `${x * 100}%`, e.style.top = `${L * 100}%`, V(x, 1 - L);
3032
- }, I = (C) => {
3033
- C.preventDefault(), C.stopPropagation(), U(C);
3034
- const b = (L) => U(L), x = () => {
3035
- document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x);
3012
+ }, E = () => parseFloat(s.style.left || "0%") / 100 * 360, V = (v, w) => {
3013
+ const x = E(), k = this.hsvToHex(x, v, w);
3014
+ y(k, m);
3015
+ }, A = (v) => {
3016
+ v = Math.max(0.1, Math.min(358.9, v));
3017
+ const w = parseFloat(e.style.left || "50%") / 100, x = parseFloat(e.style.top || "50%") / 100;
3018
+ t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${v}, 100%, 50%))`;
3019
+ const k = w, H = 1 - x, $ = this.hsvToHex(v, k, H);
3020
+ y($, m);
3021
+ }, B = (v) => {
3022
+ v.stopPropagation();
3023
+ const w = t.getBoundingClientRect(), x = Math.max(0, Math.min(1, (v.clientX - w.left) / w.width)), k = Math.max(0, Math.min(1, (v.clientY - w.top) / w.height));
3024
+ e.style.left = `${x * 100}%`, e.style.top = `${k * 100}%`, V(x, 1 - k);
3025
+ }, L = (v) => {
3026
+ v.preventDefault(), v.stopPropagation(), B(v);
3027
+ const w = (k) => B(k), x = () => {
3028
+ document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", x);
3036
3029
  };
3037
- document.addEventListener("mousemove", b), document.addEventListener("mouseup", x);
3038
- }, E = (C) => {
3039
- C.stopPropagation();
3040
- const b = i.getBoundingClientRect();
3041
- let x = (C.clientX - b.left) / b.width;
3030
+ document.addEventListener("mousemove", w), document.addEventListener("mouseup", x);
3031
+ }, b = (v) => {
3032
+ v.stopPropagation();
3033
+ const w = i.getBoundingClientRect();
3034
+ let x = (v.clientX - w.left) / w.width;
3042
3035
  x = Math.max(1e-3, Math.min(0.998, x)), s.style.left = `${x * 100}%`;
3043
- const L = x * 360;
3044
- z(L);
3045
- }, k = (C) => {
3046
- C.preventDefault(), C.stopPropagation(), E(C);
3047
- const b = (L) => E(L), x = () => {
3048
- document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x);
3036
+ const k = x * 360;
3037
+ A(k);
3038
+ }, M = (v) => {
3039
+ v.preventDefault(), v.stopPropagation(), b(v);
3040
+ const w = (k) => b(k), x = () => {
3041
+ document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", x);
3049
3042
  };
3050
- document.addEventListener("mousemove", b), document.addEventListener("mouseup", x);
3051
- }, P = (C) => {
3052
- const b = C.target.value, x = n.value;
3053
- let L = "";
3054
- if (x === "hex" && /^#[0-9A-Fa-f]{6}$/.test(b))
3055
- L = b;
3043
+ document.addEventListener("mousemove", w), document.addEventListener("mouseup", x);
3044
+ }, P = (v) => {
3045
+ const w = v.target.value, x = n.value;
3046
+ let k = "";
3047
+ if (x === "hex" && /^#[0-9A-Fa-f]{6}$/.test(w))
3048
+ k = w;
3056
3049
  else if (x === "rgb") {
3057
- const H = b.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
3050
+ const H = w.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
3058
3051
  if (H) {
3059
- const $ = parseInt(H[1]), R = parseInt(H[2]), B = parseInt(H[3]);
3060
- $ <= 255 && R <= 255 && B <= 255 && (L = `#${$.toString(16).padStart(2, "0")}${R.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`);
3052
+ const $ = parseInt(H[1]), W = parseInt(H[2]), F = parseInt(H[3]);
3053
+ $ <= 255 && W <= 255 && F <= 255 && (k = `#${$.toString(16).padStart(2, "0")}${W.toString(16).padStart(2, "0")}${F.toString(16).padStart(2, "0")}`);
3061
3054
  }
3062
3055
  } else if (x === "hsl") {
3063
- const H = b.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
3056
+ const H = w.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
3064
3057
  if (H) {
3065
- const $ = parseInt(H[1]), R = parseInt(H[2]) / 100, B = parseInt(H[3]) / 100;
3066
- if ($ <= 360 && R <= 1 && B <= 1) {
3067
- const _ = B + R * Math.min(B, 1 - B), K = _ === 0 ? 0 : 2 * (1 - B / _);
3068
- L = this.hsvToHex($, K, _);
3058
+ const $ = parseInt(H[1]), W = parseInt(H[2]) / 100, F = parseInt(H[3]) / 100;
3059
+ if ($ <= 360 && W <= 1 && F <= 1) {
3060
+ const q = F + W * Math.min(F, 1 - F), K = q === 0 ? 0 : 2 * (1 - F / q);
3061
+ k = this.hsvToHex($, K, q);
3069
3062
  }
3070
3063
  }
3071
3064
  }
3072
- if (L) {
3073
- const { h: H, s: $, v: R } = this.hexToHsv(L);
3074
- s.style.left = `${H / 360 * 100}%`, e.style.left = `${$ * 100}%`, e.style.top = `${(1 - R) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${H}, 100%, 50%))`, y(L, f);
3065
+ if (k) {
3066
+ const { h: H, s: $, v: W } = this.hexToHsv(k);
3067
+ s.style.left = `${H / 360 * 100}%`, e.style.left = `${$ * 100}%`, e.style.top = `${(1 - W) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${H}, 100%, 50%))`, y(k, m);
3075
3068
  }
3076
- }, O = (C) => {
3077
- v();
3069
+ }, O = (v) => {
3070
+ f();
3078
3071
  }, T = () => {
3079
- v();
3080
- }, M = () => {
3072
+ f();
3073
+ }, S = () => {
3081
3074
  navigator.clipboard.writeText(o.value).catch(() => {
3082
3075
  o.select(), document.execCommand("copy");
3083
3076
  });
3084
3077
  };
3085
- v(), t.addEventListener("mousedown", I), t.addEventListener("click", U), i.addEventListener("mousedown", k), i.addEventListener("click", E), n.addEventListener("change", T), o.addEventListener("input", P), o.addEventListener("blur", O), a.addEventListener("click", M);
3086
- const A = async () => {
3078
+ f(), t.addEventListener("mousedown", L), t.addEventListener("click", B), i.addEventListener("mousedown", M), i.addEventListener("click", b), n.addEventListener("change", T), o.addEventListener("input", P), o.addEventListener("blur", O), a.addEventListener("click", S);
3079
+ const D = async () => {
3087
3080
  if ("EyeDropper" in window)
3088
3081
  try {
3089
- const x = (await new window.EyeDropper().open()).sRGBHex, { h: L, s: H, v: $ } = this.hexToHsv(x);
3090
- s.style.left = `${L / 360 * 100}%`, e.style.left = `${H * 100}%`, e.style.top = `${(1 - $) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${L}, 100%, 50%))`, y(x, f);
3091
- } catch (C) {
3092
- console.log("User cancelled eyedropper or error occurred:", C);
3082
+ const x = (await new window.EyeDropper().open()).sRGBHex, { h: k, s: H, v: $ } = this.hexToHsv(x);
3083
+ s.style.left = `${k / 360 * 100}%`, e.style.left = `${H * 100}%`, e.style.top = `${(1 - $) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${k}, 100%, 50%))`, y(x, m);
3084
+ } catch (v) {
3085
+ console.log("User cancelled eyedropper or error occurred:", v);
3093
3086
  }
3094
3087
  else
3095
3088
  alert(
3096
3089
  "EyeDropper API is not supported in this browser. Try using Chrome 95+ or Edge 95+."
3097
3090
  );
3098
3091
  };
3099
- l.addEventListener("click", A);
3092
+ l.addEventListener("click", D);
3100
3093
  }
3101
3094
  hsvToHex(t, e, i) {
3102
3095
  const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
@@ -3105,16 +3098,16 @@ class se extends S {
3105
3098
  }
3106
3099
  setupOpacitySlider(t, e, i, s, n) {
3107
3100
  const o = () => {
3108
- const { r: c, g: h, b: d } = this.hexToRgb(i);
3109
- t.style.setProperty("--color-rgb", `${c}, ${h}, ${d}`);
3101
+ const { r: c, g: d, b: h } = this.hexToRgb(i);
3102
+ t.style.setProperty("--color-rgb", `${c}, ${d}, ${h}`);
3110
3103
  }, a = () => {
3111
3104
  e.style.left = `${s}%`;
3112
3105
  };
3113
3106
  o(), a();
3114
3107
  let l = !1;
3115
3108
  const r = (c) => {
3116
- const h = t.getBoundingClientRect(), d = c.clientX - h.left, m = Math.max(0, Math.min(100, d / h.width * 100)), u = Math.round(m);
3117
- s = u, a(), n(i, u);
3109
+ const d = t.getBoundingClientRect(), h = c.clientX - d.left, u = Math.max(0, Math.min(100, h / d.width * 100)), g = Math.round(u);
3110
+ s = g, a(), n(i, g);
3118
3111
  };
3119
3112
  t.addEventListener("mousedown", (c) => {
3120
3113
  l = !0, r(c);
@@ -3153,45 +3146,45 @@ class se extends S {
3153
3146
  <svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
3154
3147
  <path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3155
3148
  </svg>
3156
- `, l.title = "Flip gradient", i.addEventListener("change", (f) => {
3157
- const y = f.target.value;
3149
+ `, l.title = "Flip gradient", i.addEventListener("change", (m) => {
3150
+ const y = m.target.value;
3158
3151
  this.switchType(y === "radial" ? "radial" : "linear");
3159
- }), o.addEventListener("input", (f) => {
3160
- const y = f.target.value, v = parseInt(y);
3161
- if (this.value && !isNaN(v)) {
3162
- const w = Math.max(0, Math.min(360, v));
3163
- this.value.angle = w, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3152
+ }), o.addEventListener("input", (m) => {
3153
+ const y = m.target.value, f = parseInt(y);
3154
+ if (this.value && !isNaN(f)) {
3155
+ const E = Math.max(0, Math.min(360, f));
3156
+ this.value.angle = E, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3164
3157
  }
3165
- }), o.addEventListener("focus", (f) => {
3166
- const y = f.target;
3158
+ }), o.addEventListener("focus", (m) => {
3159
+ const y = m.target;
3167
3160
  y.value = y.value.replace(/[^0-9-]/g, ""), setTimeout(() => y.select(), 0);
3168
- }), o.addEventListener("blur", (f) => {
3169
- var w;
3170
- const y = f.target;
3171
- let v = parseInt(y.value);
3172
- isNaN(v) && (v = ((w = this.value) == null ? void 0 : w.angle) ?? 0), v = Math.max(0, Math.min(360, v)), this.value && (this.value.angle = v), y.value = `${v}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3161
+ }), o.addEventListener("blur", (m) => {
3162
+ var E;
3163
+ const y = m.target;
3164
+ let f = parseInt(y.value);
3165
+ isNaN(f) && (f = ((E = this.value) == null ? void 0 : E.angle) ?? 0), f = Math.max(0, Math.min(360, f)), this.value && (this.value.angle = f), y.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3173
3166
  }), l.addEventListener("click", () => {
3174
- this.value && (this.value.stops = this.value.stops.map((f) => ({
3175
- ...f,
3176
- position: 100 - f.position
3167
+ this.value && (this.value.stops = this.value.stops.map((m) => ({
3168
+ ...m,
3169
+ position: 100 - m.position
3177
3170
  })), this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
3178
3171
  }), e.appendChild(i), e.appendChild(o), e.appendChild(l), t.appendChild(e), (() => {
3179
- var f;
3180
- ((f = this.value) == null ? void 0 : f.type) === "radial" ? (o.disabled = !0, o.style.opacity = "0.5") : (o.disabled = !1, o.style.opacity = "1");
3172
+ var m;
3173
+ ((m = this.value) == null ? void 0 : m.type) === "radial" ? (o.disabled = !0, o.style.opacity = "0.5") : (o.disabled = !1, o.style.opacity = "1");
3181
3174
  })();
3182
3175
  const c = document.createElement("div");
3183
3176
  c.className = "gradient-preview", this.updateGradientPreview(c);
3184
- const h = document.createElement("div");
3185
- h.className = "gradient-handles", this.createGradientHandles(h, c), c.appendChild(h), t.appendChild(c);
3186
3177
  const d = document.createElement("div");
3187
- d.className = "gradient-stops-header";
3188
- const m = document.createElement("span");
3189
- m.textContent = "Stops";
3190
- const u = document.createElement("button");
3191
- u.type = "button", u.className = "gradient-add-stop", u.textContent = "+", d.appendChild(m), d.appendChild(u);
3192
- const g = document.createElement("div");
3193
- g.className = "gradient-stops", t.appendChild(d), t.appendChild(g), this.updateStopsList(g), u.addEventListener("click", () => {
3194
- this.addGradientStop(), this.updateStopsList(g), this.updateGradientPreview(c), this.createGradientHandles(h, c), this.updateUI();
3178
+ d.className = "gradient-handles", this.createGradientHandles(d, c), c.appendChild(d), t.appendChild(c);
3179
+ const h = document.createElement("div");
3180
+ h.className = "gradient-stops-header";
3181
+ const u = document.createElement("span");
3182
+ u.textContent = "Stops";
3183
+ const g = document.createElement("button");
3184
+ g.type = "button", g.className = "gradient-add-stop", g.textContent = "+", h.appendChild(u), h.appendChild(g);
3185
+ const C = document.createElement("div");
3186
+ C.className = "gradient-stops", t.appendChild(h), t.appendChild(C), this.updateStopsList(C), g.addEventListener("click", () => {
3187
+ this.addGradientStop(), this.updateStopsList(C), this.updateGradientPreview(c), this.createGradientHandles(d, c), this.updateUI();
3195
3188
  });
3196
3189
  }
3197
3190
  updateGradientPreview(t) {
@@ -3209,21 +3202,21 @@ class se extends S {
3209
3202
  }
3210
3203
  makeDraggable(t, e, i) {
3211
3204
  let s = !1, n = 0, o = 0, a = null;
3212
- const l = (d) => "touches" in d && d.touches.length > 0 ? d.touches[0].clientX : d.clientX, r = (d) => {
3213
- var m, u, g;
3214
- s = !0, n = l(d), o = ((g = (u = (m = this.value) == null ? void 0 : m.stops) == null ? void 0 : u[i]) == null ? void 0 : g.position) || 0, t.classList.add("selected"), document.addEventListener("pointermove", c, { passive: !1 }), document.addEventListener("pointerup", h), document.addEventListener("mousemove", c, { passive: !1 }), document.addEventListener("mouseup", h), document.addEventListener("touchmove", c, {
3205
+ const l = (h) => "touches" in h && h.touches.length > 0 ? h.touches[0].clientX : h.clientX, r = (h) => {
3206
+ var u, g, C;
3207
+ s = !0, n = l(h), o = ((C = (g = (u = this.value) == null ? void 0 : u.stops) == null ? void 0 : g[i]) == null ? void 0 : C.position) || 0, t.classList.add("selected"), document.addEventListener("pointermove", c, { passive: !1 }), document.addEventListener("pointerup", d), document.addEventListener("mousemove", c, { passive: !1 }), document.addEventListener("mouseup", d), document.addEventListener("touchmove", c, {
3215
3208
  passive: !1
3216
- }), document.addEventListener("touchend", h), d.preventDefault();
3217
- }, c = (d) => {
3218
- var y, v;
3219
- if (!s || !((v = (y = this.value) == null ? void 0 : y.stops) != null && v[i])) return;
3220
- const m = e.getBoundingClientRect(), g = (l(d) - n) / m.width * 100;
3221
- let f = o + g;
3222
- f = Math.max(0, Math.min(100, f)), this.value.stops[i].position = Math.round(f), t.style.left = `${f}%`, a && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
3209
+ }), document.addEventListener("touchend", d), h.preventDefault();
3210
+ }, c = (h) => {
3211
+ var y, f;
3212
+ if (!s || !((f = (y = this.value) == null ? void 0 : y.stops) != null && f[i])) return;
3213
+ const u = e.getBoundingClientRect(), C = (l(h) - n) / u.width * 100;
3214
+ let m = o + C;
3215
+ m = Math.max(0, Math.min(100, m)), this.value.stops[i].position = Math.round(m), t.style.left = `${m}%`, a && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
3223
3216
  this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), a = null;
3224
- }), d.preventDefault();
3225
- }, h = () => {
3226
- s && (s = !1, t.classList.remove("selected"), a && (cancelAnimationFrame(a), a = null), this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange(), document.removeEventListener("pointermove", c), document.removeEventListener("pointerup", h), document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h), document.removeEventListener("touchmove", c), document.removeEventListener("touchend", h));
3217
+ }), h.preventDefault();
3218
+ }, d = () => {
3219
+ s && (s = !1, t.classList.remove("selected"), a && (cancelAnimationFrame(a), a = null), this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange(), document.removeEventListener("pointermove", c), document.removeEventListener("pointerup", d), document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", d), document.removeEventListener("touchmove", c), document.removeEventListener("touchend", d));
3227
3220
  };
3228
3221
  t.addEventListener("pointerdown", r), t.addEventListener("mousedown", r), t.addEventListener("touchstart", r, {
3229
3222
  passive: !1
@@ -3233,7 +3226,7 @@ class se extends S {
3233
3226
  var i;
3234
3227
  const e = t || ((i = this.popoverElement) == null ? void 0 : i.querySelector(".gradient-stops"));
3235
3228
  !e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
3236
- var z, U;
3229
+ var A, B;
3237
3230
  const o = document.createElement("div");
3238
3231
  o.className = "gstop-row";
3239
3232
  const a = document.createElement("div");
@@ -3244,133 +3237,133 @@ class se extends S {
3244
3237
  r.className = "gstop-color-container";
3245
3238
  const c = document.createElement("div");
3246
3239
  c.className = "gstop-color-preview", c.style.backgroundColor = s.color;
3247
- const h = document.createElement("input");
3248
- h.type = "text", h.className = "gstop-color-input", h.value = s.color.replace("#", "").toUpperCase();
3249
- const d = document.createElement("button");
3250
- d.type = "button", d.className = "gstop-color-copy", d.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3240
+ const d = document.createElement("input");
3241
+ d.type = "text", d.className = "gstop-color-input", d.value = s.color.replace("#", "").toUpperCase();
3242
+ const h = document.createElement("button");
3243
+ h.type = "button", h.className = "gstop-color-copy", h.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3251
3244
  <path d="M14.5896 19.3033L13.4111 20.4818C11.7839 22.109 9.14575 22.109 7.51856 20.4818C5.89138 18.8546 5.89138 16.2164 7.51856 14.5892L8.69708 13.4107M19.3037 14.5892L20.4822 13.4107C22.1094 11.7835 22.1094 9.14535 20.4822 7.51816C18.855 5.89098 16.2168 5.89098 14.5896 7.51816L13.4111 8.69668M11.0837 16.9166L16.917 11.0833" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3252
- </svg>`, r.appendChild(c), r.appendChild(h), r.appendChild(d);
3253
- const m = document.createElement("button");
3254
- m.type = "button", m.className = "gstop-del", m.innerHTML = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
3245
+ </svg>`, r.appendChild(c), r.appendChild(d), r.appendChild(h);
3246
+ const u = document.createElement("button");
3247
+ u.type = "button", u.className = "gstop-del", u.innerHTML = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
3255
3248
  <path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3256
- </svg>`, m.disabled = (((U = (z = this.value) == null ? void 0 : z.stops) == null ? void 0 : U.length) || 0) <= 2, l.addEventListener("input", (I) => {
3249
+ </svg>`, u.disabled = (((B = (A = this.value) == null ? void 0 : A.stops) == null ? void 0 : B.length) || 0) <= 2, l.addEventListener("input", (L) => {
3257
3250
  var O;
3258
- const E = I.target, k = E.value.replace(/[^\d]/g, ""), P = parseInt(k);
3251
+ const b = L.target, M = b.value.replace(/[^\d]/g, ""), P = parseInt(M);
3259
3252
  if (this.value && !isNaN(P)) {
3260
3253
  const T = Math.max(0, Math.min(100, P));
3261
- this.value.stops[n].position = T, E.value = `${T}%`;
3262
- const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3254
+ this.value.stops[n].position = T, b.value = `${T}%`;
3255
+ const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3263
3256
  ".gradient-preview"
3264
- ), A = M == null ? void 0 : M.querySelector(
3257
+ ), D = S == null ? void 0 : S.querySelector(
3265
3258
  ".gradient-handles"
3266
3259
  );
3267
- M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3260
+ S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3268
3261
  }
3269
- }), l.addEventListener("focus", (I) => {
3270
- const E = I.target, k = E.value.replace("%", "");
3271
- E.value = k, E.select();
3272
- }), l.addEventListener("blur", (I) => {
3262
+ }), l.addEventListener("focus", (L) => {
3263
+ const b = L.target, M = b.value.replace("%", "");
3264
+ b.value = M, b.select();
3265
+ }), l.addEventListener("blur", (L) => {
3273
3266
  var O, T;
3274
- const E = I.target, k = E.value.replace(/[^\d]/g, ""), P = parseInt(k);
3267
+ const b = L.target, M = b.value.replace(/[^\d]/g, ""), P = parseInt(M);
3275
3268
  if (isNaN(P))
3276
- E.value = `${((T = (O = this.value) == null ? void 0 : O.stops[n]) == null ? void 0 : T.position) || 0}%`;
3269
+ b.value = `${((T = (O = this.value) == null ? void 0 : O.stops[n]) == null ? void 0 : T.position) || 0}%`;
3277
3270
  else {
3278
- const M = Math.max(0, Math.min(100, P));
3279
- E.value = `${M}%`, this.value && (this.value.stops[n].position = M, this.updateGradientPreview(), this.updateUI(), this.triggerChange());
3271
+ const S = Math.max(0, Math.min(100, P));
3272
+ b.value = `${S}%`, this.value && (this.value.stops[n].position = S, this.updateGradientPreview(), this.updateUI(), this.triggerChange());
3280
3273
  }
3281
3274
  });
3282
- const u = new Pt(
3283
- (I, E) => {
3284
- var k, P, O;
3285
- if (h.value = I.replace("#", "").toUpperCase(), c.style.backgroundColor = I, this.value) {
3286
- this.value.stops[n].color = I, E !== void 0 && (this.value.stops[n].opacity = E);
3287
- const T = (k = o.parentElement) == null ? void 0 : k.querySelector(
3275
+ const g = new Pt(
3276
+ (L, b) => {
3277
+ var M, P, O;
3278
+ if (d.value = L.replace("#", "").toUpperCase(), c.style.backgroundColor = L, this.value) {
3279
+ this.value.stops[n].color = L, b !== void 0 && (this.value.stops[n].opacity = b);
3280
+ const T = (M = o.parentElement) == null ? void 0 : M.querySelector(
3288
3281
  ".gstop-opacity-slider"
3289
3282
  );
3290
3283
  if (T) {
3291
- const C = this.hexToRgb(I);
3284
+ const v = this.hexToRgb(L);
3292
3285
  T.style.setProperty(
3293
3286
  "--slider-color",
3294
- `rgb(${C.r}, ${C.g}, ${C.b})`
3287
+ `rgb(${v.r}, ${v.g}, ${v.b})`
3295
3288
  );
3296
3289
  }
3297
- if (E !== void 0) {
3298
- const C = (P = o.parentElement) == null ? void 0 : P.querySelector(
3290
+ if (b !== void 0) {
3291
+ const v = (P = o.parentElement) == null ? void 0 : P.querySelector(
3299
3292
  ".gstop-opacity-value"
3300
3293
  );
3301
- C && (C.textContent = `${E}%`), T && (T.value = E.toString());
3294
+ v && (v.textContent = `${b}%`), T && (T.value = b.toString());
3302
3295
  }
3303
- const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3296
+ const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3304
3297
  ".gradient-preview"
3305
- ), A = M == null ? void 0 : M.querySelector(
3298
+ ), D = S == null ? void 0 : S.querySelector(
3306
3299
  ".gradient-handles"
3307
3300
  );
3308
- M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3301
+ S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3309
3302
  }
3310
3303
  }
3311
3304
  );
3312
- h.addEventListener("click", (I) => {
3313
- I.stopPropagation(), u.open(s.color, h, s.opacity || 100);
3314
- }), h.addEventListener("input", (I) => {
3305
+ d.addEventListener("click", (L) => {
3306
+ L.stopPropagation(), g.open(s.color, d, s.opacity || 100);
3307
+ }), d.addEventListener("input", (L) => {
3315
3308
  var P, O;
3316
- const E = I.target.value.trim(), k = E.startsWith("#") ? E : `#${E}`;
3317
- if (/^#[0-9A-Fa-f]{6}$/.test(k) && (c.style.backgroundColor = k, this.value)) {
3318
- this.value.stops[n].color = k;
3309
+ const b = L.target.value.trim(), M = b.startsWith("#") ? b : `#${b}`;
3310
+ if (/^#[0-9A-Fa-f]{6}$/.test(M) && (c.style.backgroundColor = M, this.value)) {
3311
+ this.value.stops[n].color = M;
3319
3312
  const T = (P = o.parentElement) == null ? void 0 : P.querySelector(
3320
3313
  ".gstop-opacity-slider"
3321
3314
  );
3322
3315
  if (T) {
3323
- const C = this.hexToRgb(k);
3316
+ const v = this.hexToRgb(M);
3324
3317
  T.style.setProperty(
3325
3318
  "--slider-color",
3326
- `rgb(${C.r}, ${C.g}, ${C.b})`
3319
+ `rgb(${v.r}, ${v.g}, ${v.b})`
3327
3320
  );
3328
3321
  }
3329
- const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3322
+ const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3330
3323
  ".gradient-preview"
3331
- ), A = M == null ? void 0 : M.querySelector(
3324
+ ), D = S == null ? void 0 : S.querySelector(
3332
3325
  ".gradient-handles"
3333
3326
  );
3334
- M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3327
+ S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3335
3328
  }
3336
- }), d.addEventListener("click", async (I) => {
3337
- I.stopPropagation();
3338
- const E = `#${h.value}`;
3329
+ }), h.addEventListener("click", async (L) => {
3330
+ L.stopPropagation();
3331
+ const b = `#${d.value}`;
3339
3332
  try {
3340
- await navigator.clipboard.writeText(E);
3341
- const k = d.innerHTML;
3342
- d.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3333
+ await navigator.clipboard.writeText(b);
3334
+ const M = h.innerHTML;
3335
+ h.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3343
3336
  <path d="M9.3335 14L12.2502 16.9167L18.6668 10.5" stroke="#00A76F" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3344
3337
  </svg>`, setTimeout(() => {
3345
- d.innerHTML = k;
3338
+ h.innerHTML = M;
3346
3339
  }, 1e3);
3347
- } catch (k) {
3348
- console.warn("Failed to copy color to clipboard:", k);
3340
+ } catch (M) {
3341
+ console.warn("Failed to copy color to clipboard:", M);
3349
3342
  }
3350
- }), m.addEventListener("click", () => {
3351
- var I;
3343
+ }), u.addEventListener("click", () => {
3344
+ var L;
3352
3345
  if (this.value && this.value.stops.length > 2) {
3353
3346
  this.value.stops.splice(n, 1);
3354
- const E = (I = this.popoverElement) == null ? void 0 : I.querySelector(
3347
+ const b = (L = this.popoverElement) == null ? void 0 : L.querySelector(
3355
3348
  ".gradient-preview"
3356
- ), k = E == null ? void 0 : E.querySelector(
3349
+ ), M = b == null ? void 0 : b.querySelector(
3357
3350
  ".gradient-handles"
3358
3351
  );
3359
- E && k && this.createGradientHandles(k, E), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3352
+ b && M && this.createGradientHandles(M, b), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3360
3353
  }
3361
- }), o.appendChild(a), o.appendChild(r), o.appendChild(m), e.appendChild(o);
3362
- const g = document.createElement("div");
3363
- g.className = "gstop-opacity-row";
3364
- const f = document.createElement("span");
3365
- f.className = "gstop-opacity-label", f.textContent = "Opacity";
3354
+ }), o.appendChild(a), o.appendChild(r), o.appendChild(u), e.appendChild(o);
3355
+ const C = document.createElement("div");
3356
+ C.className = "gstop-opacity-row";
3357
+ const m = document.createElement("span");
3358
+ m.className = "gstop-opacity-label", m.textContent = "Opacity";
3366
3359
  const y = document.createElement("div");
3367
3360
  y.className = "gstop-opacity-group";
3368
- const v = document.createElement("input");
3369
- v.type = "range", v.className = "gstop-opacity-slider", v.min = "0", v.max = "100", v.value = (s.opacity !== void 0 ? s.opacity : 100).toString();
3370
- const w = this.hexToRgb(s.color);
3371
- v.style.setProperty(
3361
+ const f = document.createElement("input");
3362
+ f.type = "range", f.className = "gstop-opacity-slider", f.min = "0", f.max = "100", f.value = (s.opacity !== void 0 ? s.opacity : 100).toString();
3363
+ const E = this.hexToRgb(s.color);
3364
+ f.style.setProperty(
3372
3365
  "--slider-color",
3373
- `rgb(${w.r}, ${w.g}, ${w.b})`
3366
+ `rgb(${E.r}, ${E.g}, ${E.b})`
3374
3367
  );
3375
3368
  const V = document.createElement("span");
3376
3369
  V.className = "gstop-opacity-value", V.textContent = `${s.opacity !== void 0 ? s.opacity : 100}%`;
@@ -3485,8 +3478,8 @@ class se extends S {
3485
3478
  /hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+))?\s*\)/
3486
3479
  );
3487
3480
  if (s) {
3488
- const n = parseFloat(s[1]), o = parseFloat(s[2]) / 100, a = parseFloat(s[3]) / 100, l = s[4] ? parseFloat(s[4]) : 1, { r, g: c, b: h } = this.hslToRgb(n, o, a);
3489
- return { color: `#${r.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}${h.toString(16).padStart(2, "0")}`, position: 0, opacity: Math.round(l * 100) };
3481
+ const n = parseFloat(s[1]), o = parseFloat(s[2]) / 100, a = parseFloat(s[3]) / 100, l = s[4] ? parseFloat(s[4]) : 1, { r, g: c, b: d } = this.hslToRgb(n, o, a);
3482
+ return { color: `#${r.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}${d.toString(16).padStart(2, "0")}`, position: 0, opacity: Math.round(l * 100) };
3490
3483
  }
3491
3484
  return { color: e, position: 0, opacity: 100 };
3492
3485
  }
@@ -3598,8 +3591,8 @@ class se extends S {
3598
3591
  let o = "", a = 0;
3599
3592
  const l = n.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
3600
3593
  if (l) {
3601
- const c = l[1].trim(), h = parseFloat(l[2]);
3602
- this.isValidColorFormat(c) ? (o = c, a = h) : (o = n, a = t.length === 1 ? 0 : s / (t.length - 1) * 100);
3594
+ const c = l[1].trim(), d = parseFloat(l[2]);
3595
+ this.isValidColorFormat(c) ? (o = c, a = d) : (o = n, a = t.length === 1 ? 0 : s / (t.length - 1) * 100);
3603
3596
  } else
3604
3597
  o = n, a = t.length === 1 ? 0 : s / (t.length - 1) * 100;
3605
3598
  const r = this.parseColorWithOpacity(o);
@@ -3625,16 +3618,24 @@ class se extends S {
3625
3618
  return this.element;
3626
3619
  }
3627
3620
  getValue() {
3628
- return this.value ? this.forText ? {
3629
- background: this.generateCSS(this.getSafeValue()),
3621
+ return this.value ? this.generateCSS(this.getSafeValue()) : "";
3622
+ }
3623
+ getCSSValue() {
3624
+ return this.value ? this.generateCSS(this.getSafeValue()) : "";
3625
+ }
3626
+ // Method to get CSS properties object for text gradients
3627
+ getTextCSSProperties() {
3628
+ if (!this.value) return {};
3629
+ const t = this.generateCSS(this.getSafeValue());
3630
+ return t.includes("gradient") ? {
3631
+ background: t,
3630
3632
  "-webkit-background-clip": "text",
3631
3633
  "background-clip": "text",
3632
3634
  color: "transparent",
3633
3635
  "-webkit-text-fill-color": "transparent"
3634
- } : this.generateCSS(this.getSafeValue()) : this.forText ? {} : "";
3635
- }
3636
- getCSSValue() {
3637
- return this.value ? this.generateCSS(this.getSafeValue()) : "";
3636
+ } : {
3637
+ color: t
3638
+ };
3638
3639
  }
3639
3640
  // Add method to get the raw object value if needed
3640
3641
  getRawValue() {
@@ -3650,22 +3651,22 @@ const Ot = `
3650
3651
  <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
3651
3652
  </svg>
3652
3653
  `;
3653
- class ne extends G {
3654
+ class ne extends z {
3654
3655
  constructor(t) {
3655
3656
  super({
3656
3657
  title: "Border",
3657
3658
  collapsed: t == null ? void 0 : t.collapsed,
3658
3659
  settings: {
3659
- size: new D({
3660
+ size: new G({
3660
3661
  title: "Size",
3661
3662
  icon: $t,
3662
3663
  default: (t == null ? void 0 : t.size) ?? 0,
3663
3664
  suffix: "px"
3664
3665
  }),
3665
- color: new W({
3666
+ color: new U({
3666
3667
  default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
3667
3668
  }),
3668
- radius: new D({
3669
+ radius: new G({
3669
3670
  title: "Radius",
3670
3671
  icon: Ot,
3671
3672
  default: (t == null ? void 0 : t.radius) ?? 12,
@@ -3694,12 +3695,12 @@ const At = `
3694
3695
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3695
3696
  <path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
3696
3697
  </svg>
3697
- `, Ft = `
3698
+ `, Dt = `
3698
3699
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3699
3700
  <path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
3700
3701
  </svg>
3701
3702
  `;
3702
- class oe extends G {
3703
+ class oe extends z {
3703
3704
  constructor(t = {}) {
3704
3705
  const { showAlign: e = t.showAlign ?? !0, ...i } = t;
3705
3706
  super({
@@ -3707,7 +3708,7 @@ class oe extends G {
3707
3708
  collapsed: i.collapsed,
3708
3709
  settings: (() => {
3709
3710
  const s = {
3710
- color: new W({
3711
+ color: new U({
3711
3712
  default: i.colorDefault ?? "0, 0, 30"
3712
3713
  }),
3713
3714
  fontFamily: new et({
@@ -3735,9 +3736,9 @@ class oe extends G {
3735
3736
  getOptions: i.fontWeightGetOptions,
3736
3737
  getOptionsAsync: i.fontWeightGetOptionsAsync
3737
3738
  }),
3738
- fontSize: new D({
3739
+ fontSize: new G({
3739
3740
  title: "Size",
3740
- icon: Ft,
3741
+ icon: Dt,
3741
3742
  default: i.fontSizeDefault ?? 12,
3742
3743
  suffix: "px",
3743
3744
  mobile: i.fontSizeMobileDefault
@@ -3765,7 +3766,7 @@ class oe extends G {
3765
3766
  `;
3766
3767
  }
3767
3768
  }
3768
- class J extends S {
3769
+ class Z extends I {
3769
3770
  constructor(t) {
3770
3771
  super({
3771
3772
  ...t,
@@ -3811,31 +3812,31 @@ class J extends S {
3811
3812
  }), i;
3812
3813
  }
3813
3814
  }
3814
- class ae extends G {
3815
+ class ae extends z {
3815
3816
  constructor(t) {
3816
3817
  super({
3817
3818
  title: "Margins",
3818
3819
  collapsed: t == null ? void 0 : t.collapsed,
3819
3820
  settings: {
3820
- marginTop: new J({
3821
+ marginTop: new Z({
3821
3822
  title: "Top",
3822
- icon: Dt,
3823
+ icon: Ft,
3823
3824
  suffix: "px",
3824
3825
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
3825
3826
  }),
3826
- marginRight: new J({
3827
+ marginRight: new Z({
3827
3828
  title: "Right",
3828
3829
  icon: Rt,
3829
3830
  suffix: "px",
3830
3831
  default: (t == null ? void 0 : t.marginRight) ?? 0
3831
3832
  }),
3832
- marginBottom: new J({
3833
+ marginBottom: new Z({
3833
3834
  title: "Bottom",
3834
3835
  icon: Gt,
3835
3836
  suffix: "px",
3836
3837
  default: (t == null ? void 0 : t.marginBottom) ?? 0
3837
3838
  }),
3838
- marginLeft: new J({
3839
+ marginLeft: new Z({
3839
3840
  title: "Left",
3840
3841
  icon: Wt,
3841
3842
  suffix: "px",
@@ -3854,7 +3855,7 @@ class ae extends G {
3854
3855
  `;
3855
3856
  }
3856
3857
  }
3857
- const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3858
+ const Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3858
3859
  <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
3859
3860
  </svg>`, Rt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3860
3861
  <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
@@ -3863,7 +3864,7 @@ const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
3863
3864
  </svg>`, Wt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3864
3865
  <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
3865
3866
  </svg>`;
3866
- class le extends G {
3867
+ class le extends z {
3867
3868
  constructor(t) {
3868
3869
  super({
3869
3870
  title: "Background Image",
@@ -3876,7 +3877,7 @@ class le extends G {
3876
3877
  opacity: new yt({
3877
3878
  default: (t == null ? void 0 : t.opacity) ?? 100
3878
3879
  }),
3879
- backgroundColor: new W({
3880
+ backgroundColor: new U({
3880
3881
  default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
3881
3882
  })
3882
3883
  }
@@ -3908,8 +3909,8 @@ export {
3908
3909
  le as BackgroundSettingSet,
3909
3910
  ne as BorderSettingSet,
3910
3911
  _t as ButtonSetting,
3911
- F as ColorSetting,
3912
- W as ColorWithOpacitySetting,
3912
+ R as ColorSetting,
3913
+ U as ColorWithOpacitySetting,
3913
3914
  qt as DimensionSetting,
3914
3915
  Kt as GapSetting,
3915
3916
  se as GradientSetting,
@@ -3920,12 +3921,12 @@ export {
3920
3921
  ae as MarginSettingGroup,
3921
3922
  te as MarginTopSetting,
3922
3923
  ee as MultiLanguageSetting,
3923
- D as NumberSetting,
3924
+ G as NumberSetting,
3924
3925
  yt as OpacitySetting,
3925
3926
  Xt as SelectApiSettings,
3926
3927
  et as SelectSetting,
3927
- S as Setting,
3928
- G as SettingGroup,
3928
+ I as Setting,
3929
+ z as SettingGroup,
3929
3930
  mt as StringSetting,
3930
3931
  ut as TabSettingGroup,
3931
3932
  ut as TabsSettingGroup,
@@ -3938,5 +3939,5 @@ export {
3938
3939
  j as isSetting,
3939
3940
  st as isSettingChild,
3940
3941
  N as isSettingGroup,
3941
- q as iterateSettings
3942
+ J as iterateSettings
3942
3943
  };