builder-settings-types 0.0.256 → 0.0.257

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.
@@ -1,35 +1,35 @@
1
- const B = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
- let T = (c = 21) => {
3
- let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
4
- for (; c--; )
5
- t += B[e[c] & 63];
1
+ const lt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
+ let nt = (p = 21) => {
3
+ let t = "", e = crypto.getRandomValues(new Uint8Array(p |= 0));
4
+ for (; p--; )
5
+ t += lt[e[p] & 63];
6
6
  return t;
7
7
  };
8
- function $(c) {
9
- let t = 0, e = c.parentElement;
8
+ function rt(p) {
9
+ let t = 0, e = p.parentElement;
10
10
  for (; e; )
11
- e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
11
+ e.classList.contains("setting-group") && e !== p && t++, e = e.parentElement;
12
12
  return t;
13
13
  }
14
- function k(c, t) {
14
+ function Z(p, t) {
15
15
  const e = Math.min(Math.max(t, 0), 5);
16
- c.setAttribute("data-nesting-level", e.toString()), e > 0 ? c.style.setProperty("--visual-indent", `${e * 2}px`) : (c.style.removeProperty("--visual-indent"), c.style.marginLeft = "");
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
- function S(c, t = 0) {
19
- c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
18
+ function tt(p, t = 0) {
19
+ p.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
20
20
  const s = i, n = t + 1;
21
- k(s, n), S(s, n);
21
+ Z(s, n), tt(s, n);
22
22
  });
23
23
  }
24
- const D = {
24
+ const ct = {
25
25
  maxLevel: 5,
26
26
  spacingMultiplier: 1,
27
27
  visualIndentMultiplier: 2,
28
28
  enableAutoDetection: !0
29
29
  };
30
- class F {
30
+ class ht {
31
31
  constructor(t = {}) {
32
- this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...D, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
32
+ this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...ct, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
33
33
  }
34
34
  /**
35
35
  * Setup automatic detection using MutationObserver
@@ -63,7 +63,7 @@ class F {
63
63
  * Update nesting for a specific element
64
64
  */
65
65
  updateElementNesting(t) {
66
- const e = $(t);
66
+ const e = rt(t);
67
67
  this.applyNestingWithConfig(t, e);
68
68
  }
69
69
  /**
@@ -111,21 +111,21 @@ class F {
111
111
  this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
112
112
  }
113
113
  }
114
- const O = new F();
115
- function M(c) {
116
- if (c === null || typeof c != "object") return c;
117
- if (c instanceof Date) return new Date(c.getTime());
118
- if (c instanceof Array) return c.map((t) => M(t));
119
- if (typeof c == "object") {
114
+ const it = new ht();
115
+ function X(p) {
116
+ if (p === null || typeof p != "object") return p;
117
+ if (p instanceof Date) return new Date(p.getTime());
118
+ if (p instanceof Array) return p.map((t) => X(t));
119
+ if (typeof p == "object") {
120
120
  const t = {};
121
- for (const e in c)
122
- Object.prototype.hasOwnProperty.call(c, e) && (t[e] = M(c[e]));
121
+ for (const e in p)
122
+ Object.prototype.hasOwnProperty.call(p, e) && (t[e] = X(p[e]));
123
123
  return t;
124
124
  }
125
- return c;
125
+ return p;
126
126
  }
127
- function R(c) {
128
- switch (c) {
127
+ function dt(p) {
128
+ switch (p) {
129
129
  case "number":
130
130
  return 0;
131
131
  case "text":
@@ -142,15 +142,15 @@ function R(c) {
142
142
  return "";
143
143
  }
144
144
  }
145
- class p {
145
+ class S {
146
146
  constructor(t = {}) {
147
- this.props = t, this.dataPropsPath = "", this.id = t.id || T(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
147
+ this.props = t, this.dataPropsPath = "", this.id = t.id || nt(), 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, p.DefaultUploadUrl = t;
150
+ globalThis.DefaultUploadUrl = t, S.DefaultUploadUrl = t;
151
151
  }
152
152
  static SetDefaultLanguage(t) {
153
- globalThis.DefaultLanguage = t, p.DefaultLanguage = t;
153
+ globalThis.DefaultLanguage = t, S.DefaultLanguage = t;
154
154
  }
155
155
  destroy() {
156
156
  throw new Error("Method not implemented.");
@@ -171,30 +171,30 @@ class p {
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 = M(this.props), i = new t(e);
175
- return i.value = M(this.value), i;
174
+ const t = this.constructor, e = X(this.props), i = new t(e);
175
+ return i.value = X(this.value), i;
176
176
  }
177
177
  createInput(t) {
178
178
  t = { ...this.props.inputProps, ...t };
179
179
  const e = document.createElement("div");
180
180
  if (e.className = t.wrapperClassName || "", t.title || t.icon) {
181
- const o = document.createElement("div");
182
- if (o.className = "icon-container", t.icon) {
181
+ const a = document.createElement("div");
182
+ if (a.className = "icon-container", t.icon) {
183
183
  const l = this.createIcon(t.icon, t.iconClassName);
184
- o.appendChild(l);
184
+ a.appendChild(l);
185
185
  }
186
186
  if (t.title) {
187
187
  const l = this.createLabel(t.title, t.labelClassName);
188
- o.appendChild(l);
188
+ a.appendChild(l);
189
189
  }
190
- e.appendChild(o);
190
+ e.appendChild(a);
191
191
  }
192
192
  const i = document.createElement("div");
193
193
  i.className = t.wrapperClassName || "";
194
194
  const s = document.createElement("input");
195
- this.inputEl = s, s.value = String(t.value || R(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
196
- const n = (o) => {
197
- const l = o.target;
195
+ this.inputEl = s, s.value = String(t.value || dt(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
196
+ const n = (a) => {
197
+ const l = a.target;
198
198
  let r = l.value;
199
199
  switch (t.inputType) {
200
200
  case "number":
@@ -219,10 +219,10 @@ class p {
219
219
  r = l.value;
220
220
  }
221
221
  this.value = r, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
222
- }, a = (o) => {
223
- o.target, this.onBlur && this.onBlur(this.value);
222
+ }, o = (a) => {
223
+ a.target, this.onBlur && this.onBlur(this.value);
224
224
  };
225
- return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", a), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
225
+ return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", o), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
226
226
  }
227
227
  createLabel(t, e) {
228
228
  const i = document.createElement("span");
@@ -233,31 +233,31 @@ class p {
233
233
  return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
234
234
  }
235
235
  }
236
- function E(c) {
237
- return c instanceof p;
236
+ function j(p) {
237
+ return p instanceof S;
238
238
  }
239
- function g(c) {
240
- return c instanceof v;
239
+ function N(p) {
240
+ return p instanceof G;
241
241
  }
242
- function H(c) {
243
- return E(c) || g(c);
242
+ function st(p) {
243
+ return j(p) || N(p);
244
244
  }
245
- function y(c, t) {
246
- for (const e in c)
247
- if (Object.prototype.hasOwnProperty.call(c, e)) {
248
- const i = c[e];
245
+ function q(p, t) {
246
+ for (const e in p)
247
+ if (Object.prototype.hasOwnProperty.call(p, e)) {
248
+ const i = p[e];
249
249
  t(e, i);
250
250
  }
251
251
  }
252
- const V = class V {
252
+ const Y = class Y {
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 || T(), 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 || nt(), 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();
256
256
  }
257
257
  propagateNestingLevel() {
258
258
  const t = this.nestingLevel + 1;
259
- y(this.settings, (e, i) => {
260
- g(i) && (i.nestingLevel = t, i.propagateNestingLevel());
259
+ q(this.settings, (e, i) => {
260
+ N(i) && (i.nestingLevel = t, i.propagateNestingLevel());
261
261
  });
262
262
  }
263
263
  getNestingLevel() {
@@ -273,18 +273,18 @@ const V = class V {
273
273
  this.dataPropsPath = t, this.propagateDataPropsPath();
274
274
  }
275
275
  propagateDataPropsPath() {
276
- y(this.settings, (t, e) => {
276
+ q(this.settings, (t, e) => {
277
277
  const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
278
- (g(e) || E(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
278
+ (N(e) || j(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
279
279
  });
280
280
  }
281
281
  updateNestingStyles() {
282
- this.elementRef && (k(this.elementRef, this.nestingLevel), S(this.elementRef, this.nestingLevel));
282
+ this.elementRef && (Z(this.elementRef, this.nestingLevel), tt(this.elementRef, this.nestingLevel));
283
283
  }
284
284
  forceChildUIRefresh() {
285
285
  Object.entries(this.settings).forEach(([t, e]) => {
286
286
  try {
287
- if (g(e)) {
287
+ if (N(e)) {
288
288
  const i = e.getValues();
289
289
  e.setValue(i);
290
290
  } else if (typeof e.setValue == "function") {
@@ -307,13 +307,13 @@ const V = class V {
307
307
  ".setting-group-content"
308
308
  );
309
309
  if (n) {
310
- const a = Array.from(
310
+ const o = Array.from(
311
311
  n.querySelectorAll(".setting-group, .setting")
312
312
  );
313
- for (const o of a) {
314
- const l = o.id;
313
+ for (const a of o) {
314
+ const l = a.id;
315
315
  if (l && "id" in e && typeof e.id == "string" && l.includes(e.id)) {
316
- o.remove();
316
+ a.remove();
317
317
  break;
318
318
  }
319
319
  }
@@ -328,11 +328,11 @@ const V = class V {
328
328
  }
329
329
  clone() {
330
330
  const t = {};
331
- y(this.settings, (s, n) => {
332
- const a = String(s);
333
- typeof n.clone == "function" ? t[a] = n.clone() : (console.warn(
334
- `Setting with key '${a}' does not have a clone method. Copying reference.`
335
- ), t[a] = n);
331
+ q(this.settings, (s, n) => {
332
+ const o = String(s);
333
+ typeof n.clone == "function" ? t[o] = n.clone() : (console.warn(
334
+ `Setting with key '${o}' does not have a clone method. Copying reference.`
335
+ ), t[o] = n);
336
336
  });
337
337
  const e = {
338
338
  title: this.title,
@@ -344,7 +344,7 @@ const V = class V {
344
344
  addItem: this.addItemCfg,
345
345
  deleteItem: this.deleteItemCfg,
346
346
  dataProps: this.dataProps
347
- }, i = W(e);
347
+ }, i = ut(e);
348
348
  return i.initialValues = this.getValues(), i;
349
349
  }
350
350
  resetDefault() {
@@ -354,7 +354,7 @@ const V = class V {
354
354
  setMobileValues(t) {
355
355
  !t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
356
356
  const s = this.settings[e];
357
- s && (g(s) || E(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
357
+ s && (N(s) || j(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
358
358
  }), this.setValue(t), this.onChange && this.onChange(this.getValues()));
359
359
  }
360
360
  getMobileValues(t) {
@@ -363,7 +363,7 @@ const V = class V {
363
363
  for (const i in this.settings)
364
364
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
365
365
  const s = this.settings[i];
366
- if (g(s))
366
+ if (N(s))
367
367
  e[i] = s.getMobileValues();
368
368
  else {
369
369
  const n = s;
@@ -374,7 +374,7 @@ const V = class V {
374
374
  } else {
375
375
  const e = this.settings[t];
376
376
  if (!e) return;
377
- if (g(e)) return e.getMobileValues();
377
+ if (N(e)) return e.getMobileValues();
378
378
  const i = e;
379
379
  return i.mobileValue !== void 0 ? i.mobileValue : i.value;
380
380
  }
@@ -390,19 +390,19 @@ const V = class V {
390
390
  Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
391
391
  }, 50));
392
392
  };
393
- return this.changeHandlers.clear(), y(this.settings, (i, s) => {
393
+ return this.changeHandlers.clear(), q(this.settings, (i, s) => {
394
394
  var n;
395
- if (g(s))
395
+ if (N(s))
396
396
  s.setOnChange(() => {
397
- const a = this.getValues();
398
- this.initialValues = a, t(a);
397
+ const o = this.getValues();
398
+ this.initialValues = o, t(o);
399
399
  }), this.changeHandlers.add(() => t(this.getValues()));
400
- else if (E(s)) {
401
- const a = () => e();
402
- this.changeHandlers.add(a), s.setOnChange(a);
400
+ else if (j(s)) {
401
+ const o = () => e();
402
+ this.changeHandlers.add(o), s.setOnChange(o);
403
403
  } else {
404
- const a = () => e();
405
- this.changeHandlers.add(a), (n = s.setOnChange) == null || n.call(s, a);
404
+ const o = () => e();
405
+ this.changeHandlers.add(o), (n = s.setOnChange) == null || n.call(s, o);
406
406
  }
407
407
  }), this;
408
408
  }
@@ -417,13 +417,13 @@ const V = class V {
417
417
  Object.entries(t).forEach(([i, s]) => {
418
418
  let n = this.settings[i];
419
419
  if (!n && this.addItemCfg && i.startsWith(this.addItemCfg.keyPrefix)) {
420
- const a = i.slice(this.addItemCfg.keyPrefix.length), o = Number(a);
421
- if (Number.isFinite(o)) {
422
- const l = this.addItemCfg.createItem(o);
423
- H(l) && (this.addSetting(i, l), n = l);
420
+ const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
421
+ if (Number.isFinite(a)) {
422
+ const l = this.addItemCfg.createItem(a);
423
+ st(l) && (this.addSetting(i, l), n = l);
424
424
  }
425
425
  }
426
- n && (g(n) || E(n)) && typeof n.setValue == "function" && n.setValue(s);
426
+ n && (N(n) || j(n)) && typeof n.setValue == "function" && n.setValue(s);
427
427
  }), setTimeout(() => {
428
428
  this.forceChildUIRefresh();
429
429
  }, 0);
@@ -437,25 +437,25 @@ const V = class V {
437
437
  const s = this.getValues();
438
438
  this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
439
439
  };
440
- g(t) ? t.setOnChange(() => e()) : E(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
440
+ N(t) ? t.setOnChange(() => e()) : j(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
441
441
  }
442
442
  addSetting(t, e) {
443
443
  var s, n;
444
444
  if (this.settings[t] = e, this.wireChild(e), this.elementRef) {
445
- const a = this.elementRef.querySelector(
445
+ const o = this.elementRef.querySelector(
446
446
  ".setting-group-content"
447
447
  );
448
- if (a) {
449
- g(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
450
- const o = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
448
+ if (o) {
449
+ N(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
450
+ const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
451
451
  if (l) {
452
- const d = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
453
- d && t.startsWith(d) && this.addDeleteButtonToElement(o, t);
452
+ const h = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
453
+ h && t.startsWith(h) && this.addDeleteButtonToElement(a, t);
454
454
  }
455
- const r = a.querySelector(".sg-add-button-bottom");
456
- r ? a.insertBefore(o, r) : a.appendChild(o), O.trackElement(o), k(o, this.nestingLevel + 1), S(o, this.nestingLevel + 1);
457
- const h = o.style.display;
458
- o.style.display = "none", o.offsetHeight, o.style.display = h, this.updateNestingStyles();
455
+ 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);
457
+ const c = a.style.display;
458
+ a.style.display = "none", a.offsetHeight, a.style.display = c, this.updateNestingStyles();
459
459
  }
460
460
  }
461
461
  const i = this.getValues();
@@ -472,9 +472,9 @@ const V = class V {
472
472
  const r = Array.from(
473
473
  t.querySelectorAll(".setting-group-title")
474
474
  );
475
- for (const h of r)
476
- if (h.closest(".setting-group") === t) {
477
- s = h;
475
+ for (const c of r)
476
+ if (c.closest(".setting-group") === t) {
477
+ s = c;
478
478
  break;
479
479
  }
480
480
  s || (s = r[0] ?? null);
@@ -482,8 +482,8 @@ const V = class V {
482
482
  if (!s) return;
483
483
  const n = s.querySelector(".actions-section");
484
484
  if (!n) return;
485
- const a = document.createElement("button");
486
- a.type = "button", a.className = "sg-delete-button", i ? i.deleteItemCfg : this.deleteItemCfg ?? this.addItemCfg, a.title = "Delete", a.style.cssText = `
485
+ const o = document.createElement("button");
486
+ o.type = "button", o.className = "sg-delete-button", i ? i.deleteItemCfg : this.deleteItemCfg ?? this.addItemCfg, o.title = "Delete", o.style.cssText = `
487
487
  background: none;
488
488
  border: none;
489
489
  cursor: pointer;
@@ -496,23 +496,23 @@ const V = class V {
496
496
  border-radius: 4px;
497
497
  transition: background-color 0.2s;
498
498
  `;
499
- const o = `
499
+ const a = `
500
500
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
501
501
  <path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
502
502
  <path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
503
503
  </svg>
504
504
  `;
505
- a.innerHTML = o, a.addEventListener("mouseenter", () => {
506
- a.style.backgroundColor = "#fef2f2";
507
- }), a.addEventListener("mouseleave", () => {
508
- a.style.backgroundColor = "transparent";
509
- }), a.addEventListener("click", (r) => {
510
- r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((h) => {
511
- h && (i && i.deleteItemCfg ? this.removeSetting(e) : this.removeSetting(e));
505
+ o.innerHTML = a, o.addEventListener("mouseenter", () => {
506
+ o.style.backgroundColor = "#fef2f2";
507
+ }), o.addEventListener("mouseleave", () => {
508
+ o.style.backgroundColor = "transparent";
509
+ }), o.addEventListener("click", (r) => {
510
+ r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((c) => {
511
+ c && (i && i.deleteItemCfg ? this.removeSetting(e) : this.removeSetting(e));
512
512
  });
513
513
  });
514
514
  const l = n.querySelector(".setting-group-arrow");
515
- l ? n.insertBefore(a, l) : n.appendChild(a);
515
+ l ? n.insertBefore(o, l) : n.appendChild(o);
516
516
  }
517
517
  showDeleteConfirmation() {
518
518
  return new Promise((t) => {
@@ -555,14 +555,14 @@ const V = class V {
555
555
  font-size: 14px;
556
556
  line-height: 1.5;
557
557
  `;
558
- const a = document.createElement("div");
559
- a.style.cssText = `
558
+ const o = document.createElement("div");
559
+ o.style.cssText = `
560
560
  display: flex;
561
561
  gap: 12px;
562
562
  justify-content: flex-end;
563
563
  `;
564
- const o = document.createElement("button");
565
- o.textContent = "Cancel", o.type = "button", o.style.cssText = `
564
+ const a = document.createElement("button");
565
+ a.textContent = "Cancel", a.type = "button", a.style.cssText = `
566
566
  padding: 8px 16px;
567
567
  border: 1px solid #d1d5db;
568
568
  background: white;
@@ -584,10 +584,10 @@ const V = class V {
584
584
  font-weight: 500;
585
585
  cursor: pointer;
586
586
  transition: all 0.2s;
587
- `, o.addEventListener("mouseenter", () => {
588
- o.style.backgroundColor = "#f9fafb", o.style.borderColor = "#9ca3af";
589
- }), o.addEventListener("mouseleave", () => {
590
- o.style.backgroundColor = "white", o.style.borderColor = "#d1d5db";
587
+ `, a.addEventListener("mouseenter", () => {
588
+ a.style.backgroundColor = "#f9fafb", a.style.borderColor = "#9ca3af";
589
+ }), a.addEventListener("mouseleave", () => {
590
+ a.style.backgroundColor = "white", a.style.borderColor = "#d1d5db";
591
591
  }), l.addEventListener("mouseenter", () => {
592
592
  l.style.backgroundColor = "#dc2626";
593
593
  }), l.addEventListener("mouseleave", () => {
@@ -598,17 +598,17 @@ const V = class V {
598
598
  e.parentNode && e.parentNode.removeChild(e);
599
599
  }, 200);
600
600
  };
601
- o.addEventListener("click", () => {
601
+ a.addEventListener("click", () => {
602
602
  r(), t(!1);
603
603
  }), l.addEventListener("click", () => {
604
604
  r(), t(!0);
605
- }), e.addEventListener("click", (d) => {
606
- d.target === e && (r(), t(!1));
605
+ }), e.addEventListener("click", (h) => {
606
+ h.target === e && (r(), t(!1));
607
607
  });
608
- const h = (d) => {
609
- d.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", h));
608
+ const c = (h) => {
609
+ h.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
610
610
  };
611
- document.addEventListener("keydown", h), a.appendChild(o), a.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(a), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
611
+ 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
612
  e.style.opacity = "1", i.style.transform = "scale(1)";
613
613
  }), setTimeout(() => l.focus(), 100);
614
614
  });
@@ -626,8 +626,8 @@ const V = class V {
626
626
  ...Object.keys(t),
627
627
  ...Object.keys(e)
628
628
  ])).forEach((n) => {
629
- const a = t[n], o = e[n];
630
- JSON.stringify(a) !== JSON.stringify(o) && (i[n] = { from: a, to: o });
629
+ const o = t[n], a = e[n];
630
+ JSON.stringify(o) !== JSON.stringify(a) && (i[n] = { from: o, to: a });
631
631
  }), i;
632
632
  }
633
633
  getValues(t) {
@@ -636,12 +636,20 @@ const V = class V {
636
636
  for (const i in this.settings)
637
637
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
638
638
  const s = this.settings[i];
639
- g(s) ? e[i] = s.getValues() : e[i] = s.value;
639
+ if (N(s))
640
+ e[i] = s.getValues();
641
+ else {
642
+ const n = s;
643
+ e[i] = n.getValue ? n.getValue() : n.value;
644
+ }
640
645
  }
641
646
  return e;
642
647
  } else {
643
648
  const e = this.settings[t];
644
- return e ? g(e) ? e.getValues() : e.value : void 0;
649
+ if (!e) return;
650
+ if (N(e)) return e.getValues();
651
+ const i = e;
652
+ return i.getValue ? i.getValue() : i.value;
645
653
  }
646
654
  }
647
655
  getValuesForJson(t) {
@@ -651,7 +659,7 @@ const V = class V {
651
659
  for (const i in this.settings)
652
660
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
653
661
  const s = this.settings[i];
654
- if (g(s)) {
662
+ if (N(s)) {
655
663
  const n = s.getValuesForJson();
656
664
  n !== null && (e[i] = n);
657
665
  } else {
@@ -663,7 +671,7 @@ const V = class V {
663
671
  } else {
664
672
  const e = this.settings[t];
665
673
  if (!e) return;
666
- if (g(e))
674
+ if (N(e))
667
675
  return e.includeGetJson === !1 ? null : e.getValuesForJson();
668
676
  {
669
677
  const i = e;
@@ -677,7 +685,7 @@ const V = class V {
677
685
  for (const i in this.settings)
678
686
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
679
687
  const s = this.settings[i];
680
- if (g(s))
688
+ if (N(s))
681
689
  e[i] = s.getDefaultValues();
682
690
  else {
683
691
  const n = s;
@@ -688,14 +696,14 @@ const V = class V {
688
696
  } else {
689
697
  const e = this.settings[t];
690
698
  if (!e) return;
691
- if (g(e)) return e.getDefaultValues();
699
+ if (N(e)) return e.getDefaultValues();
692
700
  const i = e;
693
701
  return i.default !== void 0 ? i.default : i.value;
694
702
  }
695
703
  }
696
704
  draw() {
697
705
  const t = document.createElement("div");
698
- t.className = "setting-group", t.id = `setting-group-${this.id}`, V.hiddenElements.add(t), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), k(t, this.nestingLevel);
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);
699
707
  const e = document.createElement("div");
700
708
  e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
701
709
  "aria-expanded",
@@ -707,57 +715,57 @@ const V = class V {
707
715
  s.textContent = this.title, i.appendChild(s);
708
716
  const n = document.createElement("div");
709
717
  n.className = "actions-section";
710
- const a = document.createElement("span");
711
- a.className = "setting-group-arrow", a.innerHTML = `
718
+ const o = document.createElement("span");
719
+ o.className = "setting-group-arrow", o.innerHTML = `
712
720
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
713
721
  <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
714
722
  </svg>
715
- `, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
716
- const o = document.createElement("div");
717
- o.className = "setting-group-content", this.isCollapsed && (o.classList.add("collapsed"), e.classList.add("collapsed-view"), a.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && o.classList.add("main-content");
723
+ `, this.isCollapsed && o.classList.add("rotated"), n.appendChild(o);
724
+ const a = document.createElement("div");
725
+ a.className = "setting-group-content", this.isCollapsed && (a.classList.add("collapsed"), e.classList.add("collapsed-view"), o.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && a.classList.add("main-content");
718
726
  const l = () => {
719
- this.isCollapsed = !this.isCollapsed, o.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), a.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
727
+ this.isCollapsed = !this.isCollapsed, a.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), o.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
720
728
  "aria-expanded",
721
729
  (!this.isCollapsed).toString()
722
730
  );
723
731
  };
724
- if (e.onclick = l, e.onkeydown = (h) => {
725
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), l());
732
+ if (e.onclick = l, e.onkeydown = (c) => {
733
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), l());
726
734
  }, Object.keys(this.settings).length > 0) {
727
- for (const h in this.settings)
728
- if (Object.prototype.hasOwnProperty.call(this.settings, h)) {
729
- const d = this.settings[h];
730
- g(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.nestingLevel + 1);
731
- const u = d.draw();
732
- g(d) && d.deleteItemCfg && this.addDeleteButtonToElement(
733
- u,
734
- h,
735
- d
736
- ), o.appendChild(u);
735
+ for (const c in this.settings)
736
+ 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,
742
+ c,
743
+ h
744
+ ), a.appendChild(d);
737
745
  }
738
746
  } else {
739
- const h = document.createElement("div");
740
- h.className = "setting-group-empty", h.textContent = "No settings in this group", o.appendChild(h);
747
+ const c = document.createElement("div");
748
+ c.className = "setting-group-empty", c.textContent = "No settings in this group", a.appendChild(c);
741
749
  }
742
750
  if (this.addItemCfg) {
743
- const h = document.createElement("button");
744
- h.type = "button", h.className = "sg-add-button-bottom", h.style.marginTop = "8px";
745
- const d = `
751
+ const c = document.createElement("button");
752
+ c.type = "button", c.className = "sg-add-button-bottom", c.style.marginTop = "8px";
753
+ const h = `
746
754
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none"
747
755
  xmlns="http://www.w3.org/2000/svg">
748
756
  <path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
749
757
  stroke-width="1.5" stroke-linecap="round"/>
750
758
  </svg>`;
751
- h.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, h.addEventListener("click", (u) => {
752
- u.stopPropagation(), u.preventDefault();
753
- const w = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), x = this.addItemCfg.createItem(w);
754
- if (H(x)) {
755
- const b = `${this.addItemCfg.keyPrefix}${w}`;
756
- this.addSetting(b, x);
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 g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), f = this.addItemCfg.createItem(g);
762
+ if (st(f)) {
763
+ const C = `${this.addItemCfg.keyPrefix}${g}`;
764
+ this.addSetting(C, f);
757
765
  }
758
- }), o.appendChild(h);
766
+ }), a.appendChild(c);
759
767
  }
760
- return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, O.trackElement(t), setTimeout(() => {
768
+ return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, it.trackElement(t), setTimeout(() => {
761
769
  this.updateNestingStyles();
762
770
  }, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
763
771
  }
@@ -788,10 +796,10 @@ const V = class V {
788
796
  let i = e;
789
797
  const s = Object.keys(this.settings), n = Object.keys(e);
790
798
  if (!s.some(
791
- (o) => n.includes(o)
799
+ (a) => n.includes(a)
792
800
  ) && n.length === 1) {
793
- const o = n[0];
794
- i = e[o];
801
+ const a = n[0];
802
+ i = e[a];
795
803
  }
796
804
  this.setValue(i);
797
805
  } catch (e) {
@@ -799,12 +807,12 @@ const V = class V {
799
807
  }
800
808
  }
801
809
  };
802
- V.hiddenElements = /* @__PURE__ */ new Set();
803
- let v = V;
804
- function vt(c) {
805
- return new z(c);
810
+ Y.hiddenElements = /* @__PURE__ */ new Set();
811
+ let G = Y;
812
+ function Wt(p) {
813
+ return new pt(p);
806
814
  }
807
- class z extends v {
815
+ class pt extends G {
808
816
  constructor(t) {
809
817
  super(t);
810
818
  const e = Object.keys(this.settings)[0];
@@ -838,30 +846,30 @@ class z extends v {
838
846
  s.textContent = this.title, i.appendChild(s);
839
847
  const n = document.createElement("div");
840
848
  n.className = "tabs-header", this.tabsContainer = n;
841
- const a = document.createElement("div");
842
- if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
849
+ const o = document.createElement("div");
850
+ if (o.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((a, l) => {
843
851
  const r = document.createElement("button");
844
- r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", o), r.textContent = o, r.addEventListener("click", () => this.switchToTab(o)), n.appendChild(r);
845
- const h = document.createElement("div");
846
- h.className = "tab-panel", this.contentContainers[o] = h;
847
- const d = this.settings[o];
848
- d && (g(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(
849
- d.draw()
850
- )), a.appendChild(h), l === 0 && !this.activeTabId && (this.activeTabId = o);
851
- }), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
852
- const o = Object.keys(this.settings)[0];
853
- this.activeTabId = o || "";
852
+ 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
+ const c = document.createElement("div");
854
+ 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()
858
+ )), o.appendChild(c), l === 0 && !this.activeTabId && (this.activeTabId = a);
859
+ }), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
860
+ const a = Object.keys(this.settings)[0];
861
+ this.activeTabId = a || "";
854
862
  }
855
863
  return this.updateTabUI(), t;
856
864
  }
857
865
  }
858
- function W(c) {
859
- return new v(c);
866
+ function ut(p) {
867
+ return new G(p);
860
868
  }
861
- function Ct(c) {
862
- return c;
869
+ function zt(p) {
870
+ return p;
863
871
  }
864
- class G extends p {
872
+ class gt extends S {
865
873
  constructor(t = {}) {
866
874
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
867
875
  }
@@ -881,31 +889,31 @@ class G extends p {
881
889
  });
882
890
  }
883
891
  }
884
- const _ = "<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>";
885
- class m extends G {
892
+ const mt = "<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 D extends gt {
886
894
  constructor(t) {
887
895
  super({
888
896
  ...t,
889
- icon: t.icon || _,
897
+ icon: t.icon || mt,
890
898
  title: t.title || "Color",
891
- default: t.default ? m.normalizeColorValue(t.default) : "#000000"
899
+ default: t.default ? D.normalizeColorValue(t.default) : "#000000"
892
900
  }), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
893
901
  }
894
902
  static normalizeColorValue(t) {
895
- return t.startsWith("#") ? m.normalizeHexValue(t) : t.includes(",") ? m.rgbToHexStatic(t) : m.normalizeHexValue(t);
903
+ return t.startsWith("#") ? D.normalizeHexValue(t) : t.includes(",") ? D.rgbToHexStatic(t) : D.normalizeHexValue(t);
896
904
  }
897
905
  static normalizeHexValue(t) {
898
906
  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");
899
907
  }
900
908
  static rgbToHexStatic(t) {
901
- const e = t.split(",").map((h) => parseInt(h.trim()));
909
+ const e = t.split(",").map((c) => parseInt(c.trim()));
902
910
  if (e.length !== 3 || e.some(isNaN))
903
911
  return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
904
- const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (h) => {
905
- const d = h.toString(16);
906
- return d.length === 1 ? "0" + d : d;
912
+ 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;
907
915
  };
908
- return `#${r(a)}${r(o)}${r(l)}`;
916
+ return `#${r(o)}${r(a)}${r(l)}`;
909
917
  }
910
918
  setValue(t) {
911
919
  if (t === void 0) {
@@ -913,7 +921,7 @@ class m extends G {
913
921
  return;
914
922
  }
915
923
  if (typeof t == "string") {
916
- const e = m.normalizeColorValue(t);
924
+ const e = D.normalizeColorValue(t);
917
925
  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);
918
926
  } else
919
927
  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");
@@ -943,38 +951,38 @@ class m extends G {
943
951
  const r = l.value.trim();
944
952
  if (!r)
945
953
  return e.classList.remove("error"), !0;
946
- const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
947
- return d ? e.classList.remove("error") : e.classList.add("error"), d;
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;
948
956
  }, s = document.createElement("input");
949
957
  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;
950
958
  const n = document.createElement("div");
951
959
  n.className = "color-preview";
952
- const a = this.value || "#000000";
953
- n.style.backgroundColor = a;
954
- const o = document.createElement("input");
955
- return o.type = "text", o.className = "color-text-input", o.value = this.value || "", o.placeholder = "#000000", o.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), o.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), o.setAttribute("aria-label", "Hex color value"), o.setAttribute("maxlength", "7"), this.getDataPropsPath() && o.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = o, this.textInputEl.addEventListener("input", (l) => {
956
- var h, d;
960
+ const o = this.value || "#000000";
961
+ n.style.backgroundColor = o;
962
+ const a = document.createElement("input");
963
+ 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;
957
965
  let r = l.target.value.trim();
958
966
  if (this.textInputEl && i(this.textInputEl)) {
959
- const u = m.normalizeColorValue(r);
960
- this.value = u, (h = this.onChange) == null || h.call(this, u), (d = this.detectChange) == null || d.call(this, u), this.colorInputEl && (this.colorInputEl.value = u), n.style.backgroundColor = u;
967
+ const d = D.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;
961
969
  }
962
970
  }), this.colorInputEl.addEventListener("input", (l) => {
963
- var d, u;
964
- const r = l.target.value, h = m.normalizeColorValue(r);
965
- this.value = h, (d = this.onChange) == null || d.call(this, h), (u = this.detectChange) == null || u.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h, e.classList.remove("error");
971
+ var h, d;
972
+ const r = l.target.value, c = D.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");
966
974
  }), this.colorInputEl.addEventListener("change", (l) => {
967
- var d, u;
968
- const r = l.target.value, h = m.normalizeColorValue(r);
969
- this.value = h, (d = this.onChange) == null || d.call(this, h), (u = this.detectChange) == null || u.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h;
970
- }), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
975
+ var h, d;
976
+ const r = l.target.value, c = D.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;
978
+ }), e.appendChild(s), e.appendChild(n), e.appendChild(a), t.appendChild(e), this.element = t, t;
971
979
  }
972
980
  getElement() {
973
981
  return this.element;
974
982
  }
975
983
  // Helper method to get normalized hex value
976
984
  getNormalizedValue() {
977
- return this.value ? m.normalizeColorValue(this.value) : "#000000";
985
+ return this.value ? D.normalizeColorValue(this.value) : "#000000";
978
986
  }
979
987
  // Helper method to check if current value is valid hex
980
988
  isValidHex() {
@@ -985,20 +993,20 @@ class m extends G {
985
993
  return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
986
994
  }
987
995
  }
988
- const j = `
996
+ const ft = `
989
997
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
990
998
  <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"/>
991
999
  <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"/>
992
1000
  <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"/>
993
1001
  </svg>`;
994
- class C extends p {
1002
+ class W extends S {
995
1003
  constructor(t = {}) {
996
1004
  super({
997
1005
  ...t,
998
- icon: t.icon || j,
1006
+ icon: t.icon || ft,
999
1007
  title: t.title || "Color & Opacity",
1000
1008
  default: t.default || "#000000FF"
1001
- }), 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 = C.normalizeHexWithOpacity(this.value));
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));
1002
1010
  }
1003
1011
  static normalizeHexWithOpacity(t) {
1004
1012
  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");
@@ -1016,18 +1024,18 @@ class C extends p {
1016
1024
  return `#${i}${n}`;
1017
1025
  }
1018
1026
  setValue(t) {
1019
- t === void 0 || t === "" ? this.value = "#000000FF" : this.value = C.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
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);
1020
1028
  }
1021
1029
  updateInputElements() {
1022
1030
  this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
1023
1031
  }
1024
1032
  updateColorPreview() {
1025
1033
  if (!this.colorPreviewEl || !this.value) return;
1026
- const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
1027
- this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
1034
+ const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
1035
+ this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
1028
1036
  }
1029
1037
  handleColorChange(t) {
1030
- const e = this.getOpacityPercent(), i = C.combineColorOpacity(
1038
+ const e = this.getOpacityPercent(), i = W.combineColorOpacity(
1031
1039
  t,
1032
1040
  e
1033
1041
  );
@@ -1038,7 +1046,7 @@ class C extends p {
1038
1046
  return e || i ? (this.setValue(t), !0) : !1;
1039
1047
  }
1040
1048
  handleOpacityChange(t) {
1041
- const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = C.combineColorOpacity(
1049
+ const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = W.combineColorOpacity(
1042
1050
  e,
1043
1051
  i
1044
1052
  );
@@ -1047,16 +1055,16 @@ class C extends p {
1047
1055
  draw() {
1048
1056
  const t = document.createElement("div");
1049
1057
  if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
1050
- const a = document.createElement("div");
1051
- if (a.className = "icon-container", this.props.icon) {
1052
- const o = document.createElement("span");
1053
- o.className = "input-icon", o.innerHTML = this.props.icon, a.appendChild(o);
1058
+ const o = document.createElement("div");
1059
+ if (o.className = "icon-container", this.props.icon) {
1060
+ const a = document.createElement("span");
1061
+ a.className = "input-icon", a.innerHTML = this.props.icon, o.appendChild(a);
1054
1062
  }
1055
1063
  if (this.props.title) {
1056
- const o = document.createElement("span");
1057
- o.className = "input-label", o.textContent = this.props.title, a.appendChild(o);
1064
+ const a = document.createElement("span");
1065
+ a.className = "input-label", a.textContent = this.props.title, o.appendChild(a);
1058
1066
  }
1059
- t.appendChild(a);
1067
+ t.appendChild(o);
1060
1068
  }
1061
1069
  const e = document.createElement("div");
1062
1070
  e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.getDataPropsPath() && this.colorInputEl.setAttribute(
@@ -1065,18 +1073,18 @@ class C extends p {
1065
1073
  ), this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.getDataPropsPath() && this.textInputEl.setAttribute(
1066
1074
  "data-test-id",
1067
1075
  `${this.getDataPropsPath()}_text`
1068
- ), this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (a) => {
1069
- const o = a.target;
1070
- this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1071
- }), this.textInputEl.addEventListener("input", (a) => {
1072
- const o = a.target;
1073
- this.handleTextInput(o.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : o.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
1074
- }), this.textInputEl.addEventListener("blur", (a) => {
1075
- const o = a.target;
1076
- o.value.trim() === "" && (o.value = this.value || "#000000FF", e.classList.remove("error"));
1076
+ ), this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (o) => {
1077
+ const a = o.target;
1078
+ this.handleColorChange(a.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1079
+ }), this.textInputEl.addEventListener("input", (o) => {
1080
+ const a = o.target;
1081
+ this.handleTextInput(a.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : a.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
1082
+ }), this.textInputEl.addEventListener("blur", (o) => {
1083
+ const a = o.target;
1084
+ a.value.trim() === "" && (a.value = this.value || "#000000FF", e.classList.remove("error"));
1077
1085
  }), this.colorPreviewEl.addEventListener("click", () => {
1078
- var a;
1079
- (a = this.colorInputEl) == null || a.click();
1086
+ var o;
1087
+ (o = this.colorInputEl) == null || o.click();
1080
1088
  }), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
1081
1089
  const i = document.createElement("div");
1082
1090
  i.className = "color-with-opacity-opacity-wrapper", this.opacityInputEl = document.createElement("input"), this.opacityInputEl.type = "number", this.opacityInputEl.className = "color-with-opacity-opacity-input", this.opacityInputEl.value = this.getOpacityPercent().toString(), this.opacityInputEl.min = "0", this.opacityInputEl.max = "100", this.opacityInputEl.step = "1", this.opacityInputEl.placeholder = "100", this.getDataPropsPath() && this.opacityInputEl.setAttribute(
@@ -1084,13 +1092,13 @@ class C extends p {
1084
1092
  `${this.getDataPropsPath()}_opacity`
1085
1093
  );
1086
1094
  const s = document.createElement("span");
1087
- s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (a) => {
1088
- const o = a.target, l = parseFloat(o.value);
1095
+ s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (o) => {
1096
+ const a = o.target, l = parseFloat(a.value);
1089
1097
  isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
1090
- }), this.opacityInputEl.addEventListener("blur", (a) => {
1091
- const o = a.target;
1092
- let l = parseFloat(o.value);
1093
- isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), o.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1098
+ }), this.opacityInputEl.addEventListener("blur", (o) => {
1099
+ const a = o.target;
1100
+ let l = parseFloat(a.value);
1101
+ isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), a.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1094
1102
  }), i.appendChild(this.opacityInputEl), i.appendChild(s);
1095
1103
  const n = document.createElement("div");
1096
1104
  return n.className = "color-with-opacity-controls-wrapper", n.appendChild(e), n.appendChild(i), t.appendChild(n), this.element = t, this.updateInputElements(), this.updateColorPreview(), t;
@@ -1103,8 +1111,8 @@ class C extends p {
1103
1111
  }
1104
1112
  getRgbaValue() {
1105
1113
  if (!this.value) return "rgba(0, 0, 0, 1)";
1106
- const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
1107
- return `rgba(${s}, ${n}, ${a}, ${e})`;
1114
+ const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
1115
+ return `rgba(${s}, ${n}, ${o}, ${e})`;
1108
1116
  }
1109
1117
  getColorAndOpacity() {
1110
1118
  return {
@@ -1113,7 +1121,7 @@ class C extends p {
1113
1121
  };
1114
1122
  }
1115
1123
  }
1116
- class wt extends p {
1124
+ class Ut extends S {
1117
1125
  constructor(t = {}) {
1118
1126
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
1119
1127
  }
@@ -1125,27 +1133,27 @@ class wt extends p {
1125
1133
  if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
1126
1134
  const n = document.createElement("div");
1127
1135
  if (n.className = "icon-container", this.props.icon) {
1128
- const a = this.createIcon(this.props.icon);
1129
- n.appendChild(a);
1136
+ const o = this.createIcon(this.props.icon);
1137
+ n.appendChild(o);
1130
1138
  }
1131
1139
  if (this.props.title) {
1132
- const a = this.createLabel(this.props.title);
1133
- n.appendChild(a);
1140
+ const o = this.createLabel(this.props.title);
1141
+ n.appendChild(o);
1134
1142
  }
1135
1143
  t.appendChild(n);
1136
1144
  }
1137
1145
  const e = document.createElement("textarea");
1138
1146
  this.textareaEl = e, e.value = this.value || "", e.placeholder = this.props.placeholder || "Paste your HTML here...", e.className = "html-setting-textarea " + (this.props.textareaClassName || ""), e.rows = this.props.rows || 6, this.getDataPropsPath() && e.setAttribute("data-test-id", this.getDataPropsPath()), this.props.maxLength !== void 0 && (e.maxLength = this.props.maxLength), this.props.className && e.classList.add(this.props.className);
1139
1147
  const i = (n) => {
1140
- const o = n.target.value;
1141
- this.value = o, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
1148
+ const a = n.target.value;
1149
+ this.value = a, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
1142
1150
  }, s = (n) => {
1143
1151
  this.onBlur && this.value !== void 0 && this.onBlur(this.value);
1144
1152
  };
1145
1153
  return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
1146
1154
  }
1147
1155
  }
1148
- class f extends p {
1156
+ class F extends S {
1149
1157
  constructor(t) {
1150
1158
  super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
1151
1159
  }
@@ -1168,12 +1176,12 @@ class f extends p {
1168
1176
  const i = document.createElement("input");
1169
1177
  if (i.type = "number", i.className = "number-setting-input " + (this.props.inputClassName || ""), i.value = String(this.value ?? ""), i.placeholder = this.props.placeholder || "", this.getDataPropsPath() && i.setAttribute("data-test-id", this.getDataPropsPath()), this.props.minValue !== void 0 && (i.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (i.max = String(this.props.maxValue)), this.props.step !== void 0 && (i.step = String(this.props.step)), i.addEventListener("input", () => {
1170
1178
  const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
1171
- let a = Number(i.value);
1172
- a < s && (a = s), a > n && (a = n), String(a) !== i.value && (i.value = String(a)), this.setValue(a);
1179
+ let o = Number(i.value);
1180
+ o < s && (o = s), o > n && (o = n), String(o) !== i.value && (i.value = String(o)), this.setValue(o);
1173
1181
  }), i.addEventListener("blur", () => {
1174
- var n, a;
1182
+ var n, o;
1175
1183
  const s = this.validateValue(Number(i.value));
1176
- s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (a = (n = this.props).onBlur) == null || a.call(n);
1184
+ s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (o = (n = this.props).onBlur) == null || o.call(n);
1177
1185
  }), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
1178
1186
  const s = document.createElement("span");
1179
1187
  s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
@@ -1204,12 +1212,12 @@ class f extends p {
1204
1212
  );
1205
1213
  }
1206
1214
  }
1207
- const U = `
1215
+ const vt = `
1208
1216
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1209
1217
  <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"/>
1210
1218
  <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"/>
1211
1219
  </svg>`;
1212
- class J extends f {
1220
+ class Ct extends F {
1213
1221
  constructor(t = {}) {
1214
1222
  const e = {
1215
1223
  title: "Opacity",
@@ -1218,7 +1226,7 @@ class J extends f {
1218
1226
  maxValue: 100,
1219
1227
  step: 1,
1220
1228
  default: t.default ?? 100,
1221
- icon: U,
1229
+ icon: vt,
1222
1230
  ...t
1223
1231
  };
1224
1232
  super(e), this.inputType = "number", this.mobileValue = t.mobile;
@@ -1230,12 +1238,12 @@ class J extends f {
1230
1238
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1231
1239
  }
1232
1240
  }
1233
- const q = `
1241
+ const Et = `
1234
1242
  <svg xmlns="http://www.w3.org/2000/svg" class="svg-select" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
1235
1243
  <polyline points="6 9 12 15 18 9"></polyline>
1236
1244
  </svg>
1237
1245
  `;
1238
- class N extends p {
1246
+ class et extends S {
1239
1247
  constructor(t = {}) {
1240
1248
  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) {
1241
1249
  const e = this._options.findIndex((i) => i.value === this.value);
@@ -1256,12 +1264,12 @@ class N extends p {
1256
1264
  if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
1257
1265
  const n = document.createElement("div");
1258
1266
  if (n.className = "icon-container", this.props.icon) {
1259
- const a = this.createIcon(this.props.icon);
1260
- n.appendChild(a);
1267
+ const o = this.createIcon(this.props.icon);
1268
+ n.appendChild(o);
1261
1269
  }
1262
1270
  if (this.props.title) {
1263
- const a = this.createLabel(this.props.title);
1264
- n.appendChild(a);
1271
+ const o = this.createLabel(this.props.title);
1272
+ n.appendChild(o);
1265
1273
  }
1266
1274
  t.appendChild(n);
1267
1275
  } else {
@@ -1270,22 +1278,22 @@ class N extends p {
1270
1278
  }
1271
1279
  const e = document.createElement("div");
1272
1280
  e.classList.add("select-button"), this.getDataPropsPath() && e.setAttribute("data-test-id", this.getDataPropsPath()), this.isLoading ? e.classList.add("loading") : e.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : this.props.placeholder || "Select an option", e.onclick = () => {
1273
- var n, a;
1274
- this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1281
+ var n, o;
1282
+ this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1275
1283
  }, t.appendChild(e), this.buttonEl = e;
1276
1284
  const i = document.createElement("ul");
1277
- i.classList.add("select-options"), this._options.forEach((n, a) => {
1278
- const o = this.createOption(n, a);
1279
- o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
1285
+ i.classList.add("select-options"), this._options.forEach((n, o) => {
1286
+ const a = this.createOption(n, o);
1287
+ a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
1280
1288
  }), document.body.appendChild(i);
1281
1289
  const s = document.createElement("div");
1282
- return s.classList.add("svg-container"), s.innerHTML = q, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1290
+ return s.classList.add("svg-container"), s.innerHTML = Et, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1283
1291
  this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
1284
1292
  }).catch((n) => {
1285
1293
  console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
1286
1294
  })), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
1287
- var a, o;
1288
- this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition());
1295
+ var o, a;
1296
+ this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition());
1289
1297
  }, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
1290
1298
  this.isOpen && this.checkDropdownPosition();
1291
1299
  }, window.addEventListener("resize", this.resizeListener), t;
@@ -1307,9 +1315,9 @@ class N extends p {
1307
1315
  }
1308
1316
  }
1309
1317
  selectOption(t, e, i) {
1310
- var n, a;
1318
+ var n, o;
1311
1319
  const s = this._options[e];
1312
- s && (this.setValue(s.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (n = this.optionsListEl) == null || n.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((l, r) => {
1320
+ s && (this.setValue(s.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (n = this.optionsListEl) == null || n.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((l, r) => {
1313
1321
  r === e ? l.classList.add("selected") : l.classList.remove("selected");
1314
1322
  }));
1315
1323
  }
@@ -1348,7 +1356,7 @@ class N extends p {
1348
1356
  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();
1349
1357
  }
1350
1358
  }
1351
- class Z extends p {
1359
+ class yt extends S {
1352
1360
  constructor(t = {}) {
1353
1361
  super(t), this.inputType = "button", this.value || (this.value = "center");
1354
1362
  }
@@ -1393,18 +1401,18 @@ class Z extends p {
1393
1401
  `
1394
1402
  }
1395
1403
  ].forEach((n) => {
1396
- const a = document.createElement("button");
1397
- a.className = "align-option-button", a.innerHTML = n.icon, this.getDataPropsPath() && a.setAttribute(
1404
+ const o = document.createElement("button");
1405
+ o.className = "align-option-button", o.innerHTML = n.icon, this.getDataPropsPath() && o.setAttribute(
1398
1406
  "data-test-id",
1399
1407
  `${this.getDataPropsPath()}_${n.name}`
1400
- ), this.value === n.name && a.classList.add("selected"), a.addEventListener("click", () => {
1401
- var o;
1402
- i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), a.classList.add("selected"), this.value = n.name, (o = this.onChange) == null || o.call(this, this.value);
1403
- }), i.appendChild(a);
1408
+ ), this.value === n.name && o.classList.add("selected"), o.addEventListener("click", () => {
1409
+ var a;
1410
+ i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), o.classList.add("selected"), this.value = n.name, (a = this.onChange) == null || a.call(this, this.value);
1411
+ }), i.appendChild(o);
1404
1412
  }), t.appendChild(i), t;
1405
1413
  }
1406
1414
  }
1407
- class bt extends p {
1415
+ class jt extends S {
1408
1416
  constructor(t) {
1409
1417
  super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
1410
1418
  }
@@ -1418,42 +1426,42 @@ class bt extends p {
1418
1426
  /^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
1419
1427
  );
1420
1428
  if (n) {
1421
- let o = +n[1], l = +n[2], r = +n[3], h = +n[4];
1422
- h >= 1 ? (o = Math.round(o * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : h = Math.min(1, h + 0.12), s = `rgba(${o},${l},${r},${h})`;
1429
+ let a = +n[1], l = +n[2], r = +n[3], c = +n[4];
1430
+ c >= 1 ? (a = Math.round(a * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : c = Math.min(1, c + 0.12), s = `rgba(${a},${l},${r},${c})`;
1423
1431
  }
1424
1432
  t.addEventListener("mouseenter", () => {
1425
1433
  console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
1426
1434
  }), t.addEventListener("mouseleave", () => {
1427
1435
  t.style.setProperty("background-color", e, "important");
1428
1436
  }), t.addEventListener("click", () => {
1429
- var o, l;
1430
- return (l = (o = this.props).onClick) == null ? void 0 : l.call(o);
1437
+ var a, l;
1438
+ return (l = (a = this.props).onClick) == null ? void 0 : l.call(a);
1431
1439
  });
1432
- const a = document.createElement("div");
1433
- return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
1440
+ const o = document.createElement("div");
1441
+ return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
1434
1442
  }
1435
1443
  }
1436
- class Et extends p {
1444
+ class _t extends S {
1437
1445
  constructor(t = {}) {
1438
1446
  super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
1439
1447
  const e = t.width || 0, i = t.height || 0;
1440
1448
  this.value || (this.value = {
1441
1449
  width: e,
1442
1450
  height: i
1443
- }), 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 f({
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 F({
1444
1452
  title: "Width",
1445
1453
  default: this.value.width,
1446
1454
  suffix: "px",
1447
1455
  minValue: this.minWidth,
1448
1456
  maxValue: this.maxWidth,
1449
- icon: K
1450
- }), this.heightSetting = new f({
1457
+ icon: bt
1458
+ }), this.heightSetting = new F({
1451
1459
  title: "Height",
1452
1460
  default: this.value.height,
1453
1461
  suffix: "px",
1454
1462
  minValue: this.minHeight,
1455
1463
  maxValue: this.maxHeight,
1456
- icon: X
1464
+ icon: wt
1457
1465
  }), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
1458
1466
  }
1459
1467
  handleWidthChange(t) {
@@ -1523,8 +1531,8 @@ class Et extends p {
1523
1531
  return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
1524
1532
  "aria-label",
1525
1533
  this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
1526
- ), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (a) => {
1527
- a.preventDefault(), this.toggleLock(n);
1534
+ ), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (o) => {
1535
+ o.preventDefault(), this.toggleLock(n);
1528
1536
  }, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
1529
1537
  }
1530
1538
  isLocked() {
@@ -1547,24 +1555,24 @@ class Et extends p {
1547
1555
  }
1548
1556
  }
1549
1557
  }
1550
- const K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1558
+ const bt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1551
1559
  <path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
1552
- </svg>`, X = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1560
+ </svg>`, wt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1553
1561
  <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="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
1554
- </svg>`, I = `
1562
+ </svg>`, Q = `
1555
1563
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
1556
1564
  <path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
1557
1565
  </svg>
1558
- `, Y = `
1566
+ `, xt = `
1559
1567
  <svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
1560
1568
  <rect width="91" height="71" rx="4" fill="#F2F4F7"/>
1561
1569
  <path d="M37 31.5L39.5 29M39.5 29L42 31.5M39.5 29V34.625M44.5 31.9643C45.2634 31.3338 45.75 30.38 45.75 29.3125C45.75 27.414 44.211 25.875 42.3125 25.875C42.1759 25.875 42.0482 25.8037 41.9788 25.6861C41.1638 24.303 39.659 23.375 37.9375 23.375C35.3487 23.375 33.25 25.4737 33.25 28.0625C33.25 29.3538 33.7721 30.5232 34.6168 31.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
1562
1570
  </svg>
1563
- `, Q = `
1571
+ `, Lt = `
1564
1572
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
1565
1573
  <path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
1566
1574
  </svg>
1567
- `, tt = `
1575
+ `, kt = `
1568
1576
  <svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
1569
1577
  <!-- Top dot -->
1570
1578
  <circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
@@ -1584,7 +1592,7 @@ const K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
1584
1592
  <circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
1585
1593
  </svg>
1586
1594
  `;
1587
- class P extends p {
1595
+ class ot extends S {
1588
1596
  constructor(t = {}) {
1589
1597
  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();
1590
1598
  }
@@ -1637,18 +1645,18 @@ class P extends p {
1637
1645
  );
1638
1646
  if (t && t !== "") {
1639
1647
  this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
1640
- <span class="upload-icon">${I}</span>
1648
+ <span class="upload-icon">${Q}</span>
1641
1649
  <span class="upload-label">Replace</span>
1642
1650
  `);
1643
1651
  const n = () => {
1644
- this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
1645
- }, a = () => {
1646
- this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
1652
+ this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
1653
+ }, o = () => {
1654
+ this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
1647
1655
  };
1648
- this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
1656
+ this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
1649
1657
  } else
1650
1658
  this.hideLoading(), this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), i && (i.innerHTML = `
1651
- <span class="upload-icon">${I}</span>
1659
+ <span class="upload-icon">${Q}</span>
1652
1660
  <span class="upload-label">Upload</span>
1653
1661
  `);
1654
1662
  }
@@ -1656,24 +1664,24 @@ class P extends p {
1656
1664
  const t = document.createElement("div");
1657
1665
  t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
1658
1666
  "focusout",
1659
- (o) => {
1667
+ (a) => {
1660
1668
  var l;
1661
- o.relatedTarget && t.contains(o.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
1669
+ a.relatedTarget && t.contains(a.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
1662
1670
  },
1663
1671
  !0
1664
1672
  );
1665
1673
  const e = !!(this.props.title || this.props.icon);
1666
1674
  if (e || t.classList.add("no-label"), e) {
1667
- const o = document.createElement("div");
1668
- if (o.className = "icon-title-container", this.props.icon) {
1675
+ const a = document.createElement("div");
1676
+ if (a.className = "icon-title-container", this.props.icon) {
1669
1677
  const l = this.createIcon(this.props.icon);
1670
- o.appendChild(l);
1678
+ a.appendChild(l);
1671
1679
  }
1672
1680
  if (this.props.title) {
1673
1681
  const l = this.createLabel(this.props.title);
1674
- o.appendChild(l);
1682
+ a.appendChild(l);
1675
1683
  }
1676
- t.appendChild(o);
1684
+ t.appendChild(a);
1677
1685
  }
1678
1686
  this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
1679
1687
  const i = document.createElement("div");
@@ -1681,19 +1689,19 @@ class P extends p {
1681
1689
  const s = this.value && this.value !== "";
1682
1690
  s || i.classList.add("no-image");
1683
1691
  const n = document.createElement("div");
1684
- if (n.className = "preview-placeholder", n.innerHTML = Y, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = tt, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
1685
- const o = document.createElement("button");
1686
- o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = Q, this.previewWrapper.appendChild(o), o.onclick = (l) => {
1692
+ if (n.className = "preview-placeholder", n.innerHTML = xt, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = kt, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
1693
+ const a = document.createElement("button");
1694
+ a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Lt, this.previewWrapper.appendChild(a), a.onclick = (l) => {
1687
1695
  var r;
1688
1696
  l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
1689
1697
  };
1690
1698
  }
1691
1699
  this.previewWrapper.appendChild(this.previewEl);
1692
- const a = document.createElement("button");
1693
- return a.className = "upload-button", this.getDataPropsPath() && a.setAttribute("data-test-id", this.getDataPropsPath()), a.innerHTML = `
1694
- <span class="upload-icon">${I}</span>
1700
+ const o = document.createElement("button");
1701
+ return o.className = "upload-button", this.getDataPropsPath() && o.setAttribute("data-test-id", this.getDataPropsPath()), o.innerHTML = `
1702
+ <span class="upload-icon">${Q}</span>
1695
1703
  <span class="upload-label">Upload</span>
1696
- `, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
1704
+ `, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(o), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = () => {
1697
1705
  window.postMessage(
1698
1706
  {
1699
1707
  type: "OPEN_FILE_MANAGER_MODAL",
@@ -1704,14 +1712,14 @@ class P extends p {
1704
1712
  }, t;
1705
1713
  }
1706
1714
  }
1707
- class xt extends f {
1715
+ class qt extends F {
1708
1716
  constructor(t = {}) {
1709
1717
  super({
1710
1718
  ...t,
1711
1719
  title: t.title || "Height",
1712
1720
  suffix: t.suffix || "px",
1713
1721
  minValue: t.minValue ?? 0,
1714
- icon: t.icon || et,
1722
+ icon: t.icon || Mt,
1715
1723
  default: t.default ?? 100
1716
1724
  }), this.inputType = "number", this.mobileValue = t.mobile;
1717
1725
  }
@@ -1722,17 +1730,17 @@ class xt extends f {
1722
1730
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1723
1731
  }
1724
1732
  }
1725
- const et = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1733
+ const Mt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1726
1734
  <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"/>
1727
1735
  </svg>`;
1728
- class yt extends f {
1736
+ class Jt extends F {
1729
1737
  constructor(t = {}) {
1730
1738
  super({
1731
1739
  ...t,
1732
1740
  title: t.title || "Width",
1733
1741
  suffix: t.suffix || "px",
1734
1742
  minValue: t.minValue ?? 0,
1735
- icon: t.icon || it,
1743
+ icon: t.icon || St,
1736
1744
  default: t.default ?? 100
1737
1745
  }), this.inputType = "number", this.mobileValue = t.mobile;
1738
1746
  }
@@ -1743,14 +1751,14 @@ class yt extends f {
1743
1751
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1744
1752
  }
1745
1753
  }
1746
- const it = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1754
+ const St = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1747
1755
  <path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
1748
- </svg>`, st = `
1756
+ </svg>`, It = `
1749
1757
  <svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
1750
1758
  <polyline points="6 9 12 15 18 9"></polyline>
1751
1759
  </svg>
1752
1760
  `;
1753
- class Lt extends p {
1761
+ class Zt extends S {
1754
1762
  constructor(t = {}) {
1755
1763
  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) {
1756
1764
  const e = this._options.findIndex(
@@ -1777,44 +1785,44 @@ class Lt extends p {
1777
1785
  e.classList.add("has-label");
1778
1786
  const n = document.createElement("div");
1779
1787
  n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
1780
- const a = document.createElement("span");
1781
- if (a.className = "select-value", this.isLoading)
1782
- a.textContent = this.props.loadingText || "Loading options...";
1788
+ const o = document.createElement("span");
1789
+ if (o.className = "select-value", this.isLoading)
1790
+ o.textContent = this.props.loadingText || "Loading options...";
1783
1791
  else {
1784
- const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = o && typeof o.name == "string" ? o.name : "Select an option";
1785
- a.textContent = l;
1792
+ const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = a && typeof a.name == "string" ? a.name : "Select an option";
1793
+ o.textContent = l;
1786
1794
  }
1787
- e.appendChild(a);
1795
+ e.appendChild(o);
1788
1796
  } else {
1789
1797
  const n = document.createElement("span");
1790
1798
  if (this.isLoading)
1791
1799
  n.textContent = this.props.loadingText || "Loading options...";
1792
1800
  else {
1793
- const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, o = a && typeof a.name == "string" ? a.name : "Select an option";
1794
- n.textContent = o;
1801
+ const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, a = o && typeof o.name == "string" ? o.name : "Select an option";
1802
+ n.textContent = a;
1795
1803
  }
1796
1804
  e.appendChild(n);
1797
1805
  }
1798
1806
  e.onclick = () => {
1799
- var n, a;
1800
- this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1807
+ var n, o;
1808
+ this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1801
1809
  }, t.appendChild(e), this.buttonEl = e;
1802
1810
  const i = document.createElement("ul");
1803
- i.classList.add("select-api-options"), this._options.forEach((n, a) => {
1804
- const o = this.createOption(n, a);
1805
- o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
1811
+ i.classList.add("select-api-options"), this._options.forEach((n, o) => {
1812
+ const a = this.createOption(n, o);
1813
+ a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
1806
1814
  }), t.appendChild(i);
1807
1815
  const s = document.createElement("div");
1808
- return s.classList.add("svg-container"), s.innerHTML = st, t.appendChild(s), s.onclick = () => {
1809
- var n, a;
1810
- this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1816
+ return s.classList.add("svg-container"), s.innerHTML = It, t.appendChild(s), s.onclick = () => {
1817
+ var n, o;
1818
+ this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1811
1819
  }, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1812
- const a = new Set(
1820
+ const o = new Set(
1813
1821
  this._options.map((l) => JSON.stringify(l.value))
1814
- ), o = n.filter(
1815
- (l) => !a.has(JSON.stringify(l.value))
1822
+ ), a = n.filter(
1823
+ (l) => !o.has(JSON.stringify(l.value))
1816
1824
  );
1817
- if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
1825
+ if (this._options.push(...a), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
1818
1826
  const l = this._options.findIndex(
1819
1827
  (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1820
1828
  );
@@ -1828,12 +1836,12 @@ class Lt extends p {
1828
1836
  !0
1829
1837
  );
1830
1838
  })) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1831
- const a = new Set(
1839
+ const o = new Set(
1832
1840
  this._options.map((l) => JSON.stringify(l.value))
1833
- ), o = n.filter(
1834
- (l) => !a.has(JSON.stringify(l.value))
1841
+ ), a = n.filter(
1842
+ (l) => !o.has(JSON.stringify(l.value))
1835
1843
  );
1836
- if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
1844
+ if (this._options.push(...a), this.isLoading = !1, this.value !== void 0) {
1837
1845
  const l = this._options.findIndex(
1838
1846
  (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1839
1847
  );
@@ -1852,19 +1860,19 @@ class Lt extends p {
1852
1860
  return JSON.stringify(t ? {} : { value: this.value }, null, 2);
1853
1861
  }
1854
1862
  selectApiOption(t, e, i) {
1855
- var l, r, h, d;
1863
+ var l, r, c, h;
1856
1864
  const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
1857
1865
  n && (n.checked = !0), this.selectedOptionIndex = e;
1858
- const a = this._options[e].value;
1859
- this.value = a;
1860
- const o = i.querySelector(".select-value");
1861
- if (o)
1862
- o.textContent = this._options[e].name;
1866
+ const o = this._options[e].value;
1867
+ this.value = o;
1868
+ const a = i.querySelector(".select-value");
1869
+ if (a)
1870
+ a.textContent = this._options[e].name;
1863
1871
  else {
1864
- const u = i.firstChild;
1865
- u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
1872
+ const d = i.firstChild;
1873
+ d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
1866
1874
  }
1867
- this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (d = this.onChange) == null || d.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
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);
1868
1876
  }
1869
1877
  updateOptionsList() {
1870
1878
  !this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
@@ -1897,13 +1905,13 @@ class Lt extends p {
1897
1905
  ), this.updateButtonText();
1898
1906
  }
1899
1907
  }
1900
- class kt extends p {
1908
+ class Xt extends S {
1901
1909
  constructor(t) {
1902
1910
  var e, i;
1903
1911
  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;
1904
1912
  }
1905
1913
  draw() {
1906
- var a, o;
1914
+ var o, a;
1907
1915
  const t = document.createElement("div");
1908
1916
  t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
1909
1917
  const e = document.createElement("div");
@@ -1919,20 +1927,20 @@ class kt extends p {
1919
1927
  const i = document.createElement("label");
1920
1928
  i.className = "toggle-switch";
1921
1929
  const s = document.createElement("input");
1922
- s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), s.addEventListener("change", () => {
1923
- var r, h;
1924
- const l = ((h = (r = this.props.options) == null ? void 0 : r.find((d) => d.status === s.checked)) == null ? void 0 : h.value) ?? "";
1930
+ 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
+ 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) ?? "";
1925
1933
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
1926
1934
  });
1927
1935
  const n = document.createElement("span");
1928
1936
  if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
1929
- const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50", h = this.props.inactiveColor || "#ccc";
1937
+ const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50", c = this.props.inactiveColor || "#ccc";
1930
1938
  l.textContent = `
1931
1939
  .toggle-switch input:checked + .toggle-slider {
1932
1940
  background-color: ${r};
1933
1941
  }
1934
1942
  .toggle-switch .toggle-slider {
1935
- background-color: ${h};
1943
+ background-color: ${c};
1936
1944
  }
1937
1945
  `, document.head.appendChild(l);
1938
1946
  }
@@ -1947,13 +1955,13 @@ class kt extends p {
1947
1955
  this.detectChangeCallback = t;
1948
1956
  }
1949
1957
  }
1950
- const nt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1958
+ const Nt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1951
1959
  <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"/>
1952
1960
  </svg>`;
1953
- class Mt extends p {
1961
+ class Yt extends S {
1954
1962
  // Store mobile value
1955
1963
  constructor(t = {}) {
1956
- t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? nt, 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);
1964
+ t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Nt, 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);
1957
1965
  }
1958
1966
  draw() {
1959
1967
  const t = document.createElement("div");
@@ -1964,27 +1972,27 @@ class Mt extends p {
1964
1972
  i.className = "setting-label", i.setAttribute("for", this.id + "-input");
1965
1973
  const s = document.createElement("span");
1966
1974
  if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
1967
- const o = document.createElement("span");
1968
- o.className = "setting-icon", o.innerHTML = this.props.icon, i.insertBefore(o, s);
1975
+ const a = document.createElement("span");
1976
+ a.className = "setting-icon", a.innerHTML = this.props.icon, i.insertBefore(a, s);
1969
1977
  }
1970
1978
  const n = document.createElement("div");
1971
1979
  n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
1972
- const a = document.createElement("div");
1973
- return a.className = "gap-inputs-container", this.props.rowGap && a.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && a.appendChild(this.createGapInput("column", "Col")), n.appendChild(a), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
1980
+ const o = document.createElement("div");
1981
+ return o.className = "gap-inputs-container", this.props.rowGap && o.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && o.appendChild(this.createGapInput("column", "Col")), n.appendChild(o), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
1974
1982
  }
1975
1983
  createGapInput(t, e) {
1976
1984
  const i = document.createElement("div");
1977
1985
  i.className = "gap-input-wrapper";
1978
1986
  const s = document.createElement("input");
1979
1987
  if (s.type = "number", s.className = `gap-input gap-${t}-input ${this.props.inputClassName || ""}`, s.id = `${this.id}-${t}-input`, s.min = String(this.props.minValue ?? 0), this.props.maxValue !== void 0 && (s.max = String(this.props.maxValue)), s.step = String(this.props.step ?? 1), s.value = String(this.inputValues[t] ?? this.value), s.title = e, this.getDataPropsPath() && s.setAttribute("data-test-id", `${this.getDataPropsPath()}_${t}`), s.addEventListener("input", (n) => {
1980
- const a = n.target;
1981
- let o = parseFloat(a.value);
1982
- o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
1988
+ const o = n.target;
1989
+ let a = parseFloat(o.value);
1990
+ a = this.validateValue(a), String(a) !== o.value && (o.value = String(a)), this.inputValues[t] = a, this.setValue(a);
1983
1991
  }), s.addEventListener("blur", (n) => {
1984
1992
  var l, r;
1985
- const a = n.target;
1986
- let o = parseFloat(a.value);
1987
- o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (r = (l = this.props).onBlur) == null || r.call(l);
1993
+ const o = n.target;
1994
+ let a = parseFloat(o.value);
1995
+ a = this.validateValue(a), String(a) !== o.value && (o.value = String(a), this.inputValues[t] = a, this.setValue(a)), (r = (l = this.props).onBlur) == null || r.call(l);
1988
1996
  }), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
1989
1997
  const n = document.createElement("span");
1990
1998
  n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
@@ -2004,42 +2012,42 @@ class Mt extends p {
2004
2012
  this.mobileValue = t, t !== void 0 && this.setValue(t);
2005
2013
  }
2006
2014
  }
2007
- const at = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2015
+ const Vt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2008
2016
  <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"/>
2009
2017
  </svg>`;
2010
- class Vt extends f {
2018
+ class Kt extends F {
2011
2019
  constructor(t = {}) {
2012
2020
  super({
2013
2021
  ...t,
2014
2022
  minValue: t.minValue ?? 0,
2015
2023
  maxValue: t.maxValue ?? 1e3,
2016
- icon: t.icon || at,
2024
+ icon: t.icon || Vt,
2017
2025
  title: t.title || "Margin Bottom",
2018
2026
  default: t.default ?? 20,
2019
2027
  wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
2020
2028
  }), this.inputType = "number";
2021
2029
  }
2022
2030
  }
2023
- const ot = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2031
+ const Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2024
2032
  <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"
2025
2033
  stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2026
2034
  </svg>`;
2027
- class It extends f {
2035
+ class Qt extends F {
2028
2036
  constructor(t = {}) {
2029
2037
  super({
2030
2038
  ...t,
2031
2039
  minValue: t.minValue ?? 0,
2032
2040
  maxValue: t.maxValue ?? 1e3,
2033
- icon: t.icon || ot,
2041
+ icon: t.icon || Ht,
2034
2042
  title: t.title || "Margin Top",
2035
2043
  default: t.default ?? 20,
2036
2044
  wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
2037
2045
  }), this.inputType = "number";
2038
2046
  }
2039
2047
  }
2040
- class St extends p {
2048
+ class te extends S {
2041
2049
  constructor(t) {
2042
- 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(p.DefaultLanguage) ? p.DefaultLanguage : t.languages[0];
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];
2043
2051
  const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
2044
2052
  t.languages.forEach((i) => {
2045
2053
  var s, n;
@@ -2057,9 +2065,9 @@ class St extends p {
2057
2065
  return i.font = s, i.measureText(t).width;
2058
2066
  }
2059
2067
  adaptPlaceholderToSingleLine(t, e) {
2060
- const i = window.getComputedStyle(t), s = parseFloat(i.paddingLeft) || 0, n = parseFloat(i.paddingRight) || 0, a = parseFloat(i.borderLeftWidth) || 0, o = parseFloat(i.borderRightWidth) || 0, l = Math.max(
2068
+ const i = window.getComputedStyle(t), s = parseFloat(i.paddingLeft) || 0, n = parseFloat(i.paddingRight) || 0, o = parseFloat(i.borderLeftWidth) || 0, a = parseFloat(i.borderRightWidth) || 0, l = Math.max(
2061
2069
  0,
2062
- t.clientWidth - s - n - a - o
2070
+ t.clientWidth - s - n - o - a
2063
2071
  );
2064
2072
  if (l <= 0) {
2065
2073
  t.placeholder = e;
@@ -2069,50 +2077,50 @@ class St extends p {
2069
2077
  t.placeholder = e;
2070
2078
  return;
2071
2079
  }
2072
- const h = "...";
2073
- let d = 0, u = e.length, w = 0;
2074
- for (; d <= u; ) {
2075
- const b = Math.floor((d + u) / 2), A = e.slice(0, b).trimEnd() + h;
2076
- this.measureTextWidth(A, i) <= l ? (w = b, d = b + 1) : u = b - 1;
2080
+ const c = "...";
2081
+ let h = 0, d = e.length, g = 0;
2082
+ for (; h <= d; ) {
2083
+ const C = Math.floor((h + d) / 2), u = e.slice(0, C).trimEnd() + c;
2084
+ this.measureTextWidth(u, i) <= l ? (g = C, h = C + 1) : d = C - 1;
2077
2085
  }
2078
- const x = e.slice(0, w).trimEnd() + h;
2079
- t.placeholder = x;
2086
+ const f = e.slice(0, g).trimEnd() + c;
2087
+ t.placeholder = f;
2080
2088
  }
2081
2089
  autosizeTextarea(t, e = 3) {
2082
2090
  t.style.height = "auto";
2083
- const i = window.getComputedStyle(t), s = parseFloat(i.lineHeight) || 20, n = parseFloat(i.paddingTop) + parseFloat(i.paddingBottom), a = parseFloat(i.borderTopWidth) + parseFloat(i.borderBottomWidth), o = s * e + n + a, l = Math.min(t.scrollHeight || 44, o);
2084
- t.style.height = `${l}px`, t.scrollHeight > o ? t.style.overflowY = "auto" : t.style.overflowY = "hidden";
2091
+ const i = window.getComputedStyle(t), s = parseFloat(i.lineHeight) || 20, n = parseFloat(i.paddingTop) + parseFloat(i.paddingBottom), o = parseFloat(i.borderTopWidth) + parseFloat(i.borderBottomWidth), a = s * e + n + o, l = Math.min(t.scrollHeight || 44, a);
2092
+ t.style.height = `${l}px`, t.scrollHeight > a ? t.style.overflowY = "auto" : t.style.overflowY = "hidden";
2085
2093
  }
2086
2094
  createTextareaRow(t, e) {
2087
2095
  const i = document.createElement("div");
2088
2096
  i.classList.add("simple-multi-language-row");
2089
2097
  const s = document.createElement("label");
2090
2098
  if (s.classList.add("simple-language-label"), s.textContent = t.toUpperCase(), s.setAttribute("for", `textarea-${t}`), i.appendChild(s), this.props.multiImg) {
2091
- const n = new P({
2099
+ const n = new ot({
2092
2100
  defaultUrl: e || "",
2093
2101
  title: "",
2094
2102
  id: `${this.id}_upload_${t}`
2095
2103
  });
2096
- n.setOnChange((o) => {
2097
- this.updateLanguageValue(t, o), t === this.defaultLanguage && this.updateOtherLanguagePlaceholders(o);
2104
+ n.setOnChange((a) => {
2105
+ this.updateLanguageValue(t, a), t === this.defaultLanguage && this.updateOtherLanguagePlaceholders(a);
2098
2106
  }), this.uploadSettings.set(t, n);
2099
- const a = n.draw();
2100
- a.classList.add("simple-language-upload"), i.appendChild(a);
2107
+ const o = n.draw();
2108
+ o.classList.add("simple-language-upload"), i.appendChild(o);
2101
2109
  } else {
2102
2110
  const n = document.createElement("textarea");
2103
2111
  n.id = `textarea-${t}`, n.classList.add("simple-language-textarea"), n.value = e || "", n.rows = 1, n.style.overflowY = "hidden";
2104
- let a = this.props.placeholder || "Enter text in {language}...";
2105
- a.includes("{language}") && (a = a.replace(
2112
+ let o = this.props.placeholder || "Enter text in {language}...";
2113
+ o.includes("{language}") && (o = o.replace(
2106
2114
  "{language}",
2107
2115
  t.toUpperCase()
2108
- )), n.setAttribute("data-full-placeholder", a), this.adaptPlaceholderToSingleLine(n, a), this.getDataPropsPath() && n.setAttribute(
2116
+ )), n.setAttribute("data-full-placeholder", o), this.adaptPlaceholderToSingleLine(n, o), this.getDataPropsPath() && n.setAttribute(
2109
2117
  "data-test-id",
2110
2118
  `${this.getDataPropsPath()}_${t}`
2111
2119
  ), n.addEventListener("input", (l) => {
2112
2120
  const r = l.target;
2113
2121
  this.updateLanguageValue(t, r.value), t === this.defaultLanguage && this.updateOtherLanguagePlaceholders(r.value), this.autosizeTextarea(r, 3);
2114
- const h = n.getAttribute("data-full-placeholder") || "";
2115
- h && this.adaptPlaceholderToSingleLine(n, h);
2122
+ const c = n.getAttribute("data-full-placeholder") || "";
2123
+ c && this.adaptPlaceholderToSingleLine(n, c);
2116
2124
  }), i.appendChild(n), ((l) => (typeof queueMicrotask == "function" ? queueMicrotask : (r) => setTimeout(r, 0))(l))(() => {
2117
2125
  this.autosizeTextarea(n, 3);
2118
2126
  const l = n.getAttribute("data-full-placeholder") || "";
@@ -2134,11 +2142,11 @@ class St extends p {
2134
2142
  `#textarea-${e}`
2135
2143
  );
2136
2144
  if (i && (!i.value || i.value.trim() === "")) {
2137
- const a = t || ((n = this.props.placeholder) == null ? void 0 : n.replace(
2145
+ const o = t || ((n = this.props.placeholder) == null ? void 0 : n.replace(
2138
2146
  "{language}",
2139
2147
  e.toUpperCase()
2140
2148
  )) || `Enter text in ${e.toUpperCase()}...`;
2141
- i.setAttribute("data-full-placeholder", a), this.adaptPlaceholderToSingleLine(i, a);
2149
+ i.setAttribute("data-full-placeholder", o), this.adaptPlaceholderToSingleLine(i, o);
2142
2150
  }
2143
2151
  });
2144
2152
  }
@@ -2150,17 +2158,17 @@ class St extends p {
2150
2158
  }
2151
2159
  const e = document.createElement("div");
2152
2160
  e.classList.add("simple-multi-language-content"), this.props.languages.forEach((s) => {
2153
- var o;
2154
- const n = ((o = this.value) == null ? void 0 : o[s]) || "", a = this.createTextareaRow(s, n);
2155
- e.appendChild(a);
2161
+ var a;
2162
+ const n = ((a = this.value) == null ? void 0 : a[s]) || "", o = this.createTextareaRow(s, n);
2163
+ e.appendChild(o);
2156
2164
  }), t.appendChild(e), this.container = t;
2157
2165
  const i = () => {
2158
2166
  if (!this.container) return;
2159
2167
  this.container.querySelectorAll(
2160
2168
  ".simple-language-textarea"
2161
2169
  ).forEach((n) => {
2162
- const a = n.getAttribute("data-full-placeholder") || "";
2163
- a && this.adaptPlaceholderToSingleLine(n, a);
2170
+ const o = n.getAttribute("data-full-placeholder") || "";
2171
+ o && this.adaptPlaceholderToSingleLine(n, o);
2164
2172
  });
2165
2173
  };
2166
2174
  return window.addEventListener("resize", i), t;
@@ -2184,7 +2192,7 @@ class St extends p {
2184
2192
  });
2185
2193
  }
2186
2194
  }
2187
- class Nt extends p {
2195
+ class ee extends S {
2188
2196
  constructor(t = {}) {
2189
2197
  super(t), this.inputType = "select";
2190
2198
  const e = [
@@ -2195,7 +2203,7 @@ class Nt extends p {
2195
2203
  { name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
2196
2204
  { name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
2197
2205
  ];
2198
- this.selectSetting = new N({
2206
+ this.selectSetting = new et({
2199
2207
  title: this.title || "Animation",
2200
2208
  options: e,
2201
2209
  default: this.props.default || "none"
@@ -2211,33 +2219,1275 @@ class Nt extends p {
2211
2219
  this.selectSetting.destroy(), super.destroy();
2212
2220
  }
2213
2221
  }
2214
- const lt = `
2222
+ const at = `<svg
2223
+ width="13"
2224
+ height="13"
2225
+ viewBox="0 0 13 13"
2226
+ fill="none"
2227
+ xmlns="http://www.w3.org/2000/svg"
2228
+ >
2229
+ <path
2230
+ fill-rule="evenodd"
2231
+ clip-rule="evenodd"
2232
+ d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
2233
+ fill="#919EAB"
2234
+ />
2235
+ </svg>`;
2236
+ class Tt {
2237
+ constructor(t) {
2238
+ this.isOpen = !1, this.currentColor = "#ff0000", this.currentOpacity = 100, this.isUpdatingHue = !1, this.handleOutsideClick = (e) => {
2239
+ const i = document.querySelector(".gradient-popover");
2240
+ i && i.contains(e.target) || this.element.contains(e.target) || (e.stopPropagation(), this.close());
2241
+ }, this.onColorChange = t, this.element = this.createColorPicker();
2242
+ }
2243
+ createColorPicker() {
2244
+ const t = document.createElement("div");
2245
+ t.className = "custom-color-picker", t.style.display = "none";
2246
+ const e = document.createElement("div");
2247
+ e.className = "color-picker-header", e.style.cursor = "move";
2248
+ const i = document.createElement("span");
2249
+ i.textContent = "Color";
2250
+ const s = document.createElement("button");
2251
+ s.className = "color-picker-close", s.innerHTML = at, s.addEventListener("click", () => this.close()), e.appendChild(i), e.appendChild(s), this.makeDraggable(e, t);
2252
+ const n = document.createElement("div");
2253
+ n.className = "color-picker-area", this.colorArea = n;
2254
+ const o = document.createElement("div");
2255
+ o.className = "color-picker-marker", this.colorMarker = o, n.appendChild(o);
2256
+ const a = document.createElement("div");
2257
+ a.className = "color-picker-hue-container";
2258
+ const l = document.createElement("button");
2259
+ l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2260
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
2261
+ </svg>`;
2262
+ const r = document.createElement("div");
2263
+ r.className = "color-picker-hue", this.hueSlider = r;
2264
+ const c = document.createElement("div");
2265
+ c.className = "color-picker-hue-marker", this.hueMarker = c, r.appendChild(c), a.appendChild(l), a.appendChild(r);
2266
+ const h = document.createElement("div");
2267
+ h.className = "color-picker-opacity", this.opacitySlider = h;
2268
+ const d = document.createElement("div");
2269
+ d.className = "color-picker-opacity-marker", this.opacityMarker = d, h.appendChild(d);
2270
+ const g = document.createElement("div");
2271
+ g.className = "color-picker-format-section";
2272
+ const f = document.createElement("select");
2273
+ f.className = "color-picker-format-select", this.formatSelect = f;
2274
+ const C = document.createElement("option");
2275
+ C.value = "hex", C.textContent = "HEX";
2276
+ const u = document.createElement("option");
2277
+ u.value = "rgb", u.textContent = "RGB";
2278
+ const E = document.createElement("option");
2279
+ E.value = "hsl", E.textContent = "HSL", f.appendChild(C), f.appendChild(u), f.appendChild(E);
2280
+ const v = document.createElement("input");
2281
+ v.type = "text", v.className = "color-picker-color-input", v.value = this.currentColor, this.hexInput = v;
2282
+ const L = document.createElement("div");
2283
+ L.className = "color-picker-input-container";
2284
+ const T = document.createElement("button");
2285
+ return T.className = "color-picker-copy-inside", T.textContent = "Copy", T.addEventListener("click", () => this.copyToClipboard()), L.appendChild(v), L.appendChild(T), g.appendChild(f), g.appendChild(L), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(h), t.appendChild(g), this.setupEyedropper(l), this.setupEventListeners(), t.addEventListener("click", (z) => {
2286
+ z.stopPropagation();
2287
+ }), t;
2288
+ }
2289
+ setupEventListeners() {
2290
+ this.colorArea.addEventListener("mousedown", (t) => this.startColorDrag(t)), this.colorArea.addEventListener("click", (t) => {
2291
+ t.stopPropagation(), this.updateColorFromArea(t);
2292
+ }), this.hueSlider.addEventListener("mousedown", (t) => this.startHueDrag(t)), this.hueSlider.addEventListener("click", (t) => {
2293
+ t.stopPropagation(), this.updateHueFromSlider(t);
2294
+ }), this.formatSelect.addEventListener("change", () => this.updateColorInput()), this.hexInput.addEventListener(
2295
+ "input",
2296
+ (t) => this.updateColorFromInput(t)
2297
+ ), this.hexInput.addEventListener("blur", (t) => this.validateColorInput(t)), this.opacitySlider.addEventListener(
2298
+ "mousedown",
2299
+ (t) => this.startOpacityDrag(t)
2300
+ ), this.opacitySlider.addEventListener("click", (t) => {
2301
+ t.stopPropagation(), this.updateOpacityFromSlider(t);
2302
+ });
2303
+ }
2304
+ startColorDrag(t) {
2305
+ t.preventDefault(), t.stopPropagation(), this.updateColorFromArea(t);
2306
+ const e = (s) => this.updateColorFromArea(s), i = () => {
2307
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", i);
2308
+ };
2309
+ document.addEventListener("mousemove", e), document.addEventListener("mouseup", i);
2310
+ }
2311
+ startHueDrag(t) {
2312
+ t.preventDefault(), t.stopPropagation(), this.updateHueFromSlider(t);
2313
+ const e = (s) => this.updateHueFromSlider(s), i = () => {
2314
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", i);
2315
+ };
2316
+ document.addEventListener("mousemove", e), document.addEventListener("mouseup", i);
2317
+ }
2318
+ updateColorFromArea(t) {
2319
+ const e = this.colorArea.getBoundingClientRect(), i = Math.max(0, Math.min(1, (t.clientX - e.left) / e.width)), s = Math.max(0, Math.min(1, (t.clientY - e.top) / e.height));
2320
+ this.colorMarker.style.left = `${i * 100}%`, this.colorMarker.style.top = `${s * 100}%`, this.updateColorFromSV(i, 1 - s);
2321
+ }
2322
+ updateHueFromSlider(t) {
2323
+ this.isUpdatingHue = !0;
2324
+ const e = this.hueSlider.getBoundingClientRect();
2325
+ let i = (t.clientX - e.left) / e.width;
2326
+ i = Math.max(2e-3, Math.min(0.996, i)), console.log("Hue slider click:", {
2327
+ x: i,
2328
+ hueValue: i * 360,
2329
+ percent: i * 100
2330
+ }), this.hueMarker.style.left = `${i * 100}%`;
2331
+ const s = i * 360;
2332
+ this.updateHue(s), this.isUpdatingHue = !1;
2333
+ }
2334
+ updateColorFromSV(t, e) {
2335
+ const i = this.getCurrentHue(), s = this.hsvToHex(i, t, e);
2336
+ this.setColor(s);
2337
+ }
2338
+ updateHue(t) {
2339
+ const e = t;
2340
+ t = Math.max(0.5, Math.min(358.5, t)), console.log("UpdateHue:", { originalHue: e, clampedHue: t }), this.colorArea.getBoundingClientRect();
2341
+ const i = parseFloat(this.colorMarker.style.left || "50%") / 100, s = parseFloat(this.colorMarker.style.top || "50%") / 100;
2342
+ this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`;
2343
+ const n = i, o = 1 - s, a = this.hsvToHex(t, n, o);
2344
+ this.setColor(a);
2345
+ }
2346
+ getCurrentHue() {
2347
+ const t = parseFloat(this.hueMarker.style.left || "0%") / 100, e = t * 360;
2348
+ return console.log("GetCurrentHue:", { huePosition: t, hueValue: e }), Math.max(0.5, Math.min(358.5, e));
2349
+ }
2350
+ updateColorInput() {
2351
+ const t = this.formatSelect.value, { h: e, s: i, v: s } = this.hexToHsv(this.currentColor);
2352
+ switch (t) {
2353
+ case "hex":
2354
+ this.hexInput.value = this.currentColor;
2355
+ break;
2356
+ case "rgb":
2357
+ const { r: n, g: o, b: a } = this.hexToRgb(this.currentColor);
2358
+ this.hexInput.value = `rgb(${n}, ${o}, ${a})`;
2359
+ break;
2360
+ case "hsl":
2361
+ const { hue: l, sat: r, lightness: c } = this.hsvToHsl(e, i, s);
2362
+ this.hexInput.value = `hsl(${Math.round(l)}, ${Math.round(
2363
+ r * 100
2364
+ )}%, ${Math.round(c * 100)}%)`;
2365
+ break;
2366
+ }
2367
+ }
2368
+ updateColorFromInput(t) {
2369
+ const e = t.target.value, i = this.formatSelect.value;
2370
+ let s = "";
2371
+ if (i === "hex" && /^#[0-9A-Fa-f]{6}$/.test(e))
2372
+ s = e;
2373
+ else if (i === "rgb") {
2374
+ const n = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
2375
+ if (n) {
2376
+ const o = parseInt(n[1]), a = parseInt(n[2]), l = parseInt(n[3]);
2377
+ o <= 255 && a <= 255 && l <= 255 && (s = `#${o.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}`);
2378
+ }
2379
+ } else if (i === "hsl") {
2380
+ const n = e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2381
+ if (n) {
2382
+ const o = parseInt(n[1]), a = parseInt(n[2]) / 100, l = parseInt(n[3]) / 100;
2383
+ if (o <= 360 && a <= 1 && l <= 1) {
2384
+ const r = l + a * Math.min(l, 1 - l), c = r === 0 ? 0 : 2 * (1 - l / r);
2385
+ s = this.hsvToHex(o, c, r);
2386
+ }
2387
+ }
2388
+ }
2389
+ s && this.setColor(s);
2390
+ }
2391
+ validateColorInput(t) {
2392
+ this.updateColorInput();
2393
+ }
2394
+ startOpacityDrag(t) {
2395
+ t.preventDefault(), t.stopPropagation(), this.updateOpacityFromSlider(t);
2396
+ const e = (s) => this.updateOpacityFromSlider(s), i = () => {
2397
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", i);
2398
+ };
2399
+ document.addEventListener("mousemove", e), document.addEventListener("mouseup", i);
2400
+ }
2401
+ updateOpacityFromSlider(t) {
2402
+ const e = this.opacitySlider.getBoundingClientRect(), i = Math.max(0, Math.min(1, (t.clientX - e.left) / e.width));
2403
+ this.opacityMarker.style.left = `${i * 100}%`, this.currentOpacity = Math.round(i * 100), this.onColorChange && this.onColorChange(this.currentColor, this.currentOpacity);
2404
+ }
2405
+ updateOpacityBackground() {
2406
+ const { r: t, g: e, b: i } = this.hexToRgb(this.currentColor);
2407
+ this.opacitySlider.style.setProperty(
2408
+ "--base-color",
2409
+ `rgb(${t}, ${e}, ${i})`
2410
+ );
2411
+ }
2412
+ isValidHex(t) {
2413
+ return /^#[0-9A-Fa-f]{6}$/.test(t);
2414
+ }
2415
+ hsvToHex(t, e, i) {
2416
+ 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 });
2417
+ const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
2418
+ let a = 0, l = 0, r = 0;
2419
+ 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")}`;
2420
+ }
2421
+ setColor(t) {
2422
+ this.currentColor = t, this.updatePickerFromColor(t), this.updateColorInput(), this.updateOpacityBackground(), this.onColorChange && this.onColorChange(t, this.currentOpacity);
2423
+ }
2424
+ setupEyedropper(t) {
2425
+ const e = async () => {
2426
+ if ("EyeDropper" in window)
2427
+ try {
2428
+ const n = (await new window.EyeDropper().open()).sRGBHex;
2429
+ this.currentColor = n, this.updateColorInput(), this.updateColorAreaFromHex(n), this.onColorChange && this.onColorChange(n);
2430
+ } catch (i) {
2431
+ console.log("User cancelled eyedropper or error occurred:", i);
2432
+ }
2433
+ else
2434
+ alert(
2435
+ "EyeDropper API is not supported in this browser. Try using Chrome 95+ or Edge 95+."
2436
+ );
2437
+ };
2438
+ t.addEventListener("click", e);
2439
+ }
2440
+ updateColorAreaFromHex(t) {
2441
+ this.hexInput.value = t;
2442
+ }
2443
+ copyToClipboard() {
2444
+ navigator.clipboard.writeText(this.currentColor).catch(() => {
2445
+ this.hexInput.select(), document.execCommand("copy");
2446
+ });
2447
+ }
2448
+ open(t, e, i) {
2449
+ this.currentColor = t, this.currentOpacity = i ?? 100, this.updateColorInput(), this.updatePickerFromColor(t), this.updateOpacityBackground(), this.opacityMarker.style.left = `${this.currentOpacity}%`, this.isOpen = !0, this.element.style.display = "block";
2450
+ const s = e.getBoundingClientRect(), n = window.innerWidth, o = window.innerHeight;
2451
+ this.element.style.position = "fixed", this.element.style.zIndex = "10002";
2452
+ let a = s.right + 8, l = s.top;
2453
+ a + 408 > n && (a = s.left - 408 - 8), a < 8 && (a = Math.max(8, (n - 408) / 2)), l + 500 > o && (l = Math.max(8, o - 500 - 8)), this.element.style.left = `${a}px`, this.element.style.top = `${l}px`, this.element.parentElement || document.body.appendChild(this.element), this.updatePickerFromColor(t), setTimeout(() => {
2454
+ document.addEventListener("click", this.handleOutsideClick, !0);
2455
+ }, 50);
2456
+ }
2457
+ updatePickerFromColor(t) {
2458
+ const { h: e, s: i, v: s } = this.hexToHsv(t);
2459
+ this.isUpdatingHue || (this.hueMarker.style.left = `${e / 360 * 100}%`), this.colorMarker.style.left = `${i * 100}%`, this.colorMarker.style.top = `${(1 - s) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e}, 100%, 50%))`;
2460
+ }
2461
+ hexToHsv(t) {
2462
+ const e = parseInt(t.slice(1, 3), 16) / 255, i = parseInt(t.slice(3, 5), 16) / 255, s = parseInt(t.slice(5, 7), 16) / 255, n = Math.max(e, i, s), o = Math.min(e, i, s), a = n - o;
2463
+ let l = 0;
2464
+ const r = n === 0 ? 0 : a / n, c = n;
2465
+ return a !== 0 && (n === e ? l = (i - s) / a % 6 : n === i ? l = (s - e) / a + 2 : l = (e - i) / a + 4), { h: l * 60, s: r, v: c };
2466
+ }
2467
+ hexToRgb(t) {
2468
+ const e = parseInt(t.slice(1, 3), 16), i = parseInt(t.slice(3, 5), 16), s = parseInt(t.slice(5, 7), 16);
2469
+ return { r: e, g: i, b: s };
2470
+ }
2471
+ hsvToHsl(t, e, i) {
2472
+ const s = i * (1 - e / 2), n = s === 0 || s === 1 ? 0 : (i - s) / Math.min(s, 1 - s);
2473
+ return { hue: t, sat: n, lightness: s };
2474
+ }
2475
+ makeDraggable(t, e) {
2476
+ let i = !1, s = 0, n = 0, o = 0, a = 0;
2477
+ const l = (h) => {
2478
+ if (h.target.closest("button"))
2479
+ return;
2480
+ h.preventDefault(), h.stopPropagation(), i = !0, s = h.clientX, n = h.clientY;
2481
+ const d = e.getBoundingClientRect();
2482
+ o = d.left, a = d.top, e.classList.add("dragging"), document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
2483
+ }, r = (h) => {
2484
+ if (!i) return;
2485
+ h.preventDefault(), h.stopPropagation();
2486
+ const d = h.clientX - s, g = h.clientY - n;
2487
+ let f = o + d, C = a + g;
2488
+ const u = window.innerWidth, E = window.innerHeight, v = e.offsetWidth, L = e.offsetHeight;
2489
+ f = Math.max(8, Math.min(u - v - 8, f)), C = Math.max(8, Math.min(E - L - 8, C)), e.style.left = `${f}px`, e.style.top = `${C}px`;
2490
+ }, c = (h) => {
2491
+ i && (i = !1, h.preventDefault(), h.stopPropagation(), e.classList.remove("dragging"), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "");
2492
+ };
2493
+ t.addEventListener("mousedown", l);
2494
+ }
2495
+ close() {
2496
+ this.isOpen = !1, this.element.style.display = "none", document.removeEventListener("click", this.handleOutsideClick, !0);
2497
+ }
2498
+ getElement() {
2499
+ return this.element;
2500
+ }
2501
+ }
2502
+ class ie extends S {
2503
+ constructor(t = {}) {
2504
+ super({
2505
+ ...t,
2506
+ title: t.title || "Gradient",
2507
+ default: t.default || {
2508
+ type: "linear",
2509
+ angle: 90,
2510
+ stops: [
2511
+ { color: "#a84b4b", position: 0, opacity: 100 },
2512
+ { color: "#786666", position: 100, opacity: 100 }
2513
+ ]
2514
+ }
2515
+ }), this.inputType = {
2516
+ type: "text",
2517
+ angle: "number",
2518
+ stops: "text"
2519
+ }, this.element = null, this.previewElement = null, this.textInputElement = null, this.popoverElement = null, this.placeholderTrigger = null, this.isPopoverOpen = !1, this.isUserEditing = !1, this.handleBackgroundClick = (e) => {
2520
+ var l;
2521
+ if (!this.popoverElement || !this.isPopoverOpen) return;
2522
+ const i = e.target, s = this.popoverElement.contains(i), n = (l = this.element) == null ? void 0 : l.contains(i), o = document.querySelectorAll(".custom-color-picker"), a = Array.from(o).some(
2523
+ (r) => r.contains(i)
2524
+ );
2525
+ !s && !n && !a && this.closePopover();
2526
+ }, this.detectChange = t.detectChange, this.forText = t.forText || !1;
2527
+ }
2528
+ setValue(t) {
2529
+ t ? (this.value = t, this.value.stops && this.value.stops.forEach((e) => {
2530
+ e.opacity === void 0 && (e.opacity = 100);
2531
+ })) : this.value = {
2532
+ type: "linear",
2533
+ angle: 90,
2534
+ stops: [
2535
+ { color: "#a84b4b", position: 0, opacity: 100 },
2536
+ { color: "#786666", position: 100, opacity: 100 }
2537
+ ]
2538
+ }, this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
2539
+ }
2540
+ updateUI() {
2541
+ if (this.previewElement && this.value)
2542
+ if (this.value.type === "solid") {
2543
+ const t = this.value.stops && this.value.stops.length > 0 ? this.value.stops[0] : null;
2544
+ if (t) {
2545
+ const e = t.opacity !== void 0 ? t.opacity : 100;
2546
+ this.previewElement.style.background = this.addOpacityToColor(
2547
+ t.color,
2548
+ e
2549
+ );
2550
+ }
2551
+ } else
2552
+ this.previewElement.style.background = this.generateCSS(this.value);
2553
+ this.textInputElement && this.value && !this.isUserEditing && (this.textInputElement.value = this.generateDisplayText(this.value));
2554
+ }
2555
+ generateDisplayText(t) {
2556
+ if (!t) return "";
2557
+ if (t.type === "solid") {
2558
+ const i = t.stops && t.stops.length > 0 ? t.stops[0] : null;
2559
+ return i ? i.color.replace("#", "").toUpperCase() : "Color";
2560
+ }
2561
+ t.stops && t.stops.length;
2562
+ const e = t.type === "linear" ? "Linear" : "Radial";
2563
+ return t.type === "linear" ? `${e} ${t.angle}°` : `${e} Gradient`;
2564
+ }
2565
+ draw() {
2566
+ const t = document.createElement("div");
2567
+ if (t.className = "gradient-setting-wrapper", this.props.title) {
2568
+ const s = document.createElement("div");
2569
+ s.className = "icon-container";
2570
+ const n = document.createElement("span");
2571
+ n.className = "input-label", n.textContent = this.props.title, s.appendChild(n), t.appendChild(s);
2572
+ }
2573
+ const e = document.createElement("div");
2574
+ e.className = "gradient-input-wrapper", this.previewElement = document.createElement("div"), this.previewElement.className = "gradient-mini-preview", this.previewElement.style.background = this.value ? this.generateCSS(this.value) : "linear-gradient(90deg, #a84b4b 0%, #786666 100%)", this.textInputElement = document.createElement("input"), this.textInputElement.type = "text", this.textInputElement.className = "gradient-text-input", this.textInputElement.placeholder = "Enter gradient CSS or paste color...", this.textInputElement.value = this.value ? this.generateDisplayText(this.value) : "", this.textInputElement.readOnly = !1, this.previewElement.addEventListener("click", () => this.openPopover()), this.textInputElement.addEventListener("focus", () => {
2575
+ this.isUserEditing = !0, this.value && (this.textInputElement.value = this.generateCSS(this.value));
2576
+ }), this.textInputElement.addEventListener("blur", () => {
2577
+ this.isUserEditing = !1, this.value && (this.textInputElement.value = this.generateDisplayText(this.value)), this.placeholderTrigger && (this.placeholderTrigger.style.display = this.textInputElement.value ? "none" : "flex");
2578
+ }), this.textInputElement.addEventListener(
2579
+ "paste",
2580
+ (s) => this.handlePaste(s)
2581
+ ), this.textInputElement.addEventListener(
2582
+ "input",
2583
+ (s) => this.handleInput(s)
2584
+ ), this.textInputElement.addEventListener("keydown", (s) => {
2585
+ s.key === "Enter" && (this.handleInput(s), this.textInputElement.blur()), s.key === "Escape" && (this.value && (this.textInputElement.value = this.generateCSS(this.value)), this.textInputElement.blur());
2586
+ });
2587
+ const i = document.createElement("div");
2588
+ return i.className = "gradient-input-placeholder-trigger", i.textContent = this.textInputElement.placeholder || "", i.style.display = this.textInputElement.value ? "none" : "flex", i.addEventListener("click", (s) => {
2589
+ s.stopPropagation(), this.openPopover();
2590
+ }), e.appendChild(this.previewElement), e.appendChild(this.textInputElement), e.appendChild(i), this.placeholderTrigger = i, t.appendChild(e), this.createPopover(), this.element = t, t;
2591
+ }
2592
+ generateCSS(t) {
2593
+ if (!t) return "linear-gradient(90deg, #a84b4b 0%, #786666 100%)";
2594
+ if (t.type === "solid") {
2595
+ const i = t.stops && t.stops.length > 0 ? t.stops[0] : null;
2596
+ if (!i) return "#000000";
2597
+ const s = i.opacity !== void 0 ? i.opacity : 100, n = Math.round(s / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
2598
+ return `#${i.color.replace("#", "")}${n}`;
2599
+ }
2600
+ const e = t.stops.map((i) => {
2601
+ const s = i.opacity !== void 0 ? i.opacity : 100;
2602
+ return `${this.addOpacityToColor(i.color, s)} ${i.position}%`;
2603
+ }).join(", ");
2604
+ return t.type === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${t.angle}deg, ${e})`;
2605
+ }
2606
+ addOpacityToColor(t, e) {
2607
+ const i = e / 100;
2608
+ if (t.startsWith("#")) {
2609
+ const s = t.slice(1), n = parseInt(s.substr(0, 2), 16), o = parseInt(s.substr(2, 2), 16), a = parseInt(s.substr(4, 2), 16);
2610
+ return `rgba(${n}, ${o}, ${a}, ${i})`;
2611
+ }
2612
+ if (t.startsWith("rgb("))
2613
+ return t.replace("rgb(", "rgba(").replace(")", `, ${i})`);
2614
+ if (t.startsWith("rgba("))
2615
+ return t.replace(/,\s*[\d.]+\)$/, `, ${i})`);
2616
+ if (t.startsWith("hsl(")) {
2617
+ const s = t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2618
+ if (s) {
2619
+ const n = parseInt(s[1]), o = parseInt(s[2]) / 100, a = parseInt(s[3]) / 100, { r: l, g: r, b: c } = this.hslToRgb(n, o, a);
2620
+ return `rgba(${l}, ${r}, ${c}, ${i})`;
2621
+ }
2622
+ }
2623
+ if (t.startsWith("hsla(")) {
2624
+ const s = t.match(
2625
+ /hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/
2626
+ );
2627
+ if (s) {
2628
+ const n = parseInt(s[1]), o = parseInt(s[2]) / 100, a = parseInt(s[3]) / 100, { r: l, g: r, b: c } = this.hslToRgb(n, o, a);
2629
+ return `rgba(${l}, ${r}, ${c}, ${i})`;
2630
+ }
2631
+ }
2632
+ try {
2633
+ const s = t.replace("#", "");
2634
+ if (/^[0-9A-Fa-f]{6}$/.test(s)) {
2635
+ const n = parseInt(s.substr(0, 2), 16), o = parseInt(s.substr(2, 2), 16), a = parseInt(s.substr(4, 2), 16);
2636
+ return `rgba(${n}, ${o}, ${a}, ${i})`;
2637
+ }
2638
+ } catch {
2639
+ }
2640
+ return t;
2641
+ }
2642
+ hexToRgb(t) {
2643
+ const e = t.replace("#", ""), i = e.length === 3 ? e.split("").map((a) => a + a).join("") : e, s = parseInt(i.slice(0, 2), 16), n = parseInt(i.slice(2, 4), 16), o = parseInt(i.slice(4, 6), 16);
2644
+ return { r: s, g: n, b: o };
2645
+ }
2646
+ createPopover() {
2647
+ if (this.popoverElement) return;
2648
+ this.popoverElement = document.createElement("div"), this.popoverElement.className = "gradient-popover", this.popoverElement.style.display = "none";
2649
+ const t = document.createElement("div");
2650
+ t.className = "gradient-popover-header";
2651
+ const e = document.createElement("span");
2652
+ e.textContent = "Fill";
2653
+ const i = document.createElement("button");
2654
+ i.type = "button", i.className = "gradient-popover-close", i.innerHTML = at, i.addEventListener("click", () => this.closePopover()), t.appendChild(e), t.appendChild(i);
2655
+ const s = document.createElement("div");
2656
+ s.className = "gradient-editor";
2657
+ const n = this.createTypeTabs();
2658
+ s.appendChild(n);
2659
+ const o = document.createElement("div");
2660
+ o.className = "gradient-editor-content", this.updatePopoverContent(o), s.appendChild(o), this.popoverElement.appendChild(t), this.popoverElement.appendChild(s), document.body.appendChild(this.popoverElement);
2661
+ }
2662
+ createTypeTabs() {
2663
+ var s, n;
2664
+ const t = document.createElement("div");
2665
+ t.className = "gradient-type-tabs";
2666
+ const e = document.createElement("button");
2667
+ e.type = "button", e.className = `gradient-type-tab ${((s = this.value) == null ? void 0 : s.type) === "solid" ? "active" : ""}`, e.textContent = "Solid", e.addEventListener("click", () => this.switchType("solid"));
2668
+ const i = document.createElement("button");
2669
+ return i.type = "button", i.className = `gradient-type-tab ${((n = this.value) == null ? void 0 : n.type) !== "solid" ? "active" : ""}`, i.textContent = "Gradient", i.addEventListener("click", () => {
2670
+ var a, l;
2671
+ const o = ((a = this.value) == null ? void 0 : a.type) === "solid" ? "linear" : ((l = this.value) == null ? void 0 : l.type) || "linear";
2672
+ this.switchType(o);
2673
+ }), t.appendChild(e), t.appendChild(i), t;
2674
+ }
2675
+ switchType(t) {
2676
+ var n, o, a;
2677
+ if (!this.value) return;
2678
+ this.value.type = t, t !== "solid" && (!this.value.stops || this.value.stops.length === 0) && (this.value.stops = [
2679
+ { color: "#a84b4b", position: 0, opacity: 100 },
2680
+ { color: "#786666", position: 100, opacity: 100 }
2681
+ ]);
2682
+ const e = (n = this.popoverElement) == null ? void 0 : n.querySelectorAll(".gradient-type-tab");
2683
+ e == null || e.forEach((l, r) => {
2684
+ l.classList.remove("active"), (r === 0 && t === "solid" || r === 1 && t !== "solid") && l.classList.add("active");
2685
+ });
2686
+ const i = (o = this.popoverElement) == null ? void 0 : o.querySelectorAll(
2687
+ ".gradient-subtype-tab"
2688
+ );
2689
+ i == null || i.forEach((l, r) => {
2690
+ l.classList.remove("active"), (r === 0 && t === "linear" || r === 1 && t === "radial") && l.classList.add("active");
2691
+ });
2692
+ const s = (a = this.popoverElement) == null ? void 0 : a.querySelector(
2693
+ ".gradient-editor-content"
2694
+ );
2695
+ s && this.updatePopoverContent(s), this.updateUI(), this.triggerChange();
2696
+ }
2697
+ updatePopoverContent(t) {
2698
+ t.innerHTML = "", this.value && (this.value.type === "solid" ? this.createSolidEditor(t) : this.createGradientEditor(t));
2699
+ }
2700
+ createSolidEditor(t) {
2701
+ var o, a, l, r, c, h;
2702
+ const e = document.createElement("div");
2703
+ e.className = "gradient-solid-picker embedded-color-picker";
2704
+ 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(
2705
+ i,
2706
+ s,
2707
+ (d, g) => {
2708
+ this.value && (!this.value.stops || this.value.stops.length === 0 ? this.value.stops = [{ color: d, position: 0, opacity: g }] : (this.value.stops[0].color = d, this.value.stops[0].opacity = g), this.updateUI(), this.triggerChange());
2709
+ }
2710
+ );
2711
+ e.appendChild(n), t.appendChild(e);
2712
+ }
2713
+ createEmbeddedColorPickerWithOpacity(t, e, i) {
2714
+ const s = document.createElement("div");
2715
+ s.className = "embedded-color-picker-content";
2716
+ const n = document.createElement("div");
2717
+ n.className = "color-picker-area embedded";
2718
+ const o = document.createElement("div");
2719
+ o.className = "color-picker-marker", n.appendChild(o);
2720
+ const a = document.createElement("div");
2721
+ a.className = "color-picker-hue-container";
2722
+ const l = document.createElement("button");
2723
+ l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2724
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
2725
+ </svg>`;
2726
+ const r = document.createElement("div");
2727
+ r.className = "color-picker-hue embedded";
2728
+ const c = document.createElement("div");
2729
+ c.className = "color-picker-hue-marker", r.appendChild(c), a.appendChild(l), a.appendChild(r);
2730
+ const h = document.createElement("div");
2731
+ h.className = "color-picker-opacity embedded";
2732
+ const d = document.createElement("div");
2733
+ d.className = "color-picker-opacity-marker", h.appendChild(d);
2734
+ const g = document.createElement("div");
2735
+ g.className = "color-picker-format-section embedded";
2736
+ const f = document.createElement("select");
2737
+ f.className = "color-picker-format-select";
2738
+ const C = document.createElement("option");
2739
+ C.value = "hex", C.textContent = "HEX";
2740
+ const u = document.createElement("option");
2741
+ u.value = "rgb", u.textContent = "RGB";
2742
+ const E = document.createElement("option");
2743
+ E.value = "hsl", E.textContent = "HSL", f.appendChild(C), f.appendChild(u), f.appendChild(E);
2744
+ const v = document.createElement("input");
2745
+ v.type = "text", v.className = "color-picker-color-input", v.value = t;
2746
+ const L = document.createElement("div");
2747
+ L.className = "color-picker-input-container";
2748
+ const T = document.createElement("button");
2749
+ return T.className = "color-picker-copy-inside", T.textContent = "Copy", L.appendChild(v), L.appendChild(T), g.appendChild(f), g.appendChild(L), s.appendChild(n), s.appendChild(a), s.appendChild(h), s.appendChild(g), this.setupEmbeddedColorPicker(
2750
+ n,
2751
+ o,
2752
+ r,
2753
+ c,
2754
+ f,
2755
+ v,
2756
+ T,
2757
+ l,
2758
+ t,
2759
+ e,
2760
+ i
2761
+ ), this.setupOpacitySlider(
2762
+ h,
2763
+ d,
2764
+ t,
2765
+ e,
2766
+ i
2767
+ ), s;
2768
+ }
2769
+ createEmbeddedColorPicker(t, e, i) {
2770
+ const s = document.createElement("div");
2771
+ s.className = "embedded-color-picker-content";
2772
+ const n = document.createElement("div");
2773
+ n.className = "color-picker-area embedded";
2774
+ const o = document.createElement("div");
2775
+ o.className = "color-picker-marker", n.appendChild(o);
2776
+ const a = document.createElement("div");
2777
+ a.className = "color-picker-hue-container";
2778
+ const l = document.createElement("button");
2779
+ l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2780
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
2781
+ </svg>`;
2782
+ const r = document.createElement("div");
2783
+ r.className = "color-picker-hue embedded";
2784
+ const c = document.createElement("div");
2785
+ c.className = "color-picker-hue-marker", r.appendChild(c), a.appendChild(l), a.appendChild(r);
2786
+ const h = document.createElement("div");
2787
+ h.className = "color-picker-format-section embedded";
2788
+ const d = document.createElement("select");
2789
+ d.className = "color-picker-format-select";
2790
+ const g = document.createElement("option");
2791
+ g.value = "hex", g.textContent = "HEX";
2792
+ const f = document.createElement("option");
2793
+ f.value = "rgb", f.textContent = "RGB";
2794
+ const C = document.createElement("option");
2795
+ C.value = "hsl", C.textContent = "HSL", d.appendChild(g), d.appendChild(f), d.appendChild(C);
2796
+ const u = document.createElement("input");
2797
+ u.type = "text", u.className = "color-picker-color-input", u.value = t;
2798
+ const E = document.createElement("div");
2799
+ E.className = "color-picker-input-container";
2800
+ const v = document.createElement("button");
2801
+ return v.className = "color-picker-copy-inside", v.textContent = "Copy", E.appendChild(u), E.appendChild(v), h.appendChild(d), h.appendChild(E), s.appendChild(n), s.appendChild(a), s.appendChild(h), this.setupEmbeddedColorPicker(
2802
+ n,
2803
+ o,
2804
+ r,
2805
+ c,
2806
+ d,
2807
+ u,
2808
+ v,
2809
+ l,
2810
+ t,
2811
+ e,
2812
+ i
2813
+ ), s;
2814
+ }
2815
+ setupEmbeddedColorPicker(t, e, i, s, n, o, a, l, r, c, h) {
2816
+ let d = r;
2817
+ const { h: g, s: f, v: C } = this.hexToHsv(r);
2818
+ let u = c;
2819
+ s.style.left = `${g / 360 * 100}%`, e.style.left = `${f * 100}%`, e.style.top = `${(1 - C) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`;
2820
+ const E = (m, b = u) => {
2821
+ d = m, u = Math.round(b), v(), h(m, u);
2822
+ }, v = () => {
2823
+ const m = n.value, { h: b, s: w, v: x } = this.hexToHsv(d);
2824
+ switch (m) {
2825
+ case "hex":
2826
+ o.value = d;
2827
+ break;
2828
+ case "rgb":
2829
+ const { r: V, g: $, b: R } = this.hexToRgb(d);
2830
+ o.value = `rgb(${V}, ${$}, ${R})`;
2831
+ break;
2832
+ case "hsl":
2833
+ const { hue: B, sat: _, lightness: K } = this.hsvToHsl(b, w, x);
2834
+ o.value = `hsl(${Math.round(B)}, ${Math.round(
2835
+ _ * 100
2836
+ )}%, ${Math.round(K * 100)}%)`;
2837
+ break;
2838
+ }
2839
+ }, L = () => parseFloat(s.style.left || "0%") / 100 * 360, T = (m, b) => {
2840
+ const w = L(), x = this.hsvToHex(w, m, b);
2841
+ E(x, u);
2842
+ }, z = (m) => {
2843
+ m = Math.max(0.1, Math.min(358.9, m));
2844
+ const b = parseFloat(e.style.left || "50%") / 100, w = parseFloat(e.style.top || "50%") / 100;
2845
+ t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`;
2846
+ const x = b, V = 1 - w, $ = this.hsvToHex(m, x, V);
2847
+ E($, u);
2848
+ }, U = (m) => {
2849
+ m.stopPropagation();
2850
+ const b = t.getBoundingClientRect(), w = Math.max(0, Math.min(1, (m.clientX - b.left) / b.width)), x = Math.max(0, Math.min(1, (m.clientY - b.top) / b.height));
2851
+ e.style.left = `${w * 100}%`, e.style.top = `${x * 100}%`, T(w, 1 - x);
2852
+ }, I = (m) => {
2853
+ m.preventDefault(), m.stopPropagation(), U(m);
2854
+ const b = (x) => U(x), w = () => {
2855
+ document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
2856
+ };
2857
+ document.addEventListener("mousemove", b), document.addEventListener("mouseup", w);
2858
+ }, y = (m) => {
2859
+ m.stopPropagation();
2860
+ const b = i.getBoundingClientRect();
2861
+ let w = (m.clientX - b.left) / b.width;
2862
+ w = Math.max(1e-3, Math.min(0.998, w)), s.style.left = `${w * 100}%`;
2863
+ const x = w * 360;
2864
+ z(x);
2865
+ }, k = (m) => {
2866
+ m.preventDefault(), m.stopPropagation(), y(m);
2867
+ const b = (x) => y(x), w = () => {
2868
+ document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
2869
+ };
2870
+ document.addEventListener("mousemove", b), document.addEventListener("mouseup", w);
2871
+ }, P = (m) => {
2872
+ const b = m.target.value, w = n.value;
2873
+ let x = "";
2874
+ if (w === "hex" && /^#[0-9A-Fa-f]{6}$/.test(b))
2875
+ x = b;
2876
+ else if (w === "rgb") {
2877
+ const V = b.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
2878
+ if (V) {
2879
+ const $ = parseInt(V[1]), R = parseInt(V[2]), B = parseInt(V[3]);
2880
+ $ <= 255 && R <= 255 && B <= 255 && (x = `#${$.toString(16).padStart(2, "0")}${R.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`);
2881
+ }
2882
+ } else if (w === "hsl") {
2883
+ const V = b.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2884
+ if (V) {
2885
+ const $ = parseInt(V[1]), R = parseInt(V[2]) / 100, B = parseInt(V[3]) / 100;
2886
+ if ($ <= 360 && R <= 1 && B <= 1) {
2887
+ const _ = B + R * Math.min(B, 1 - B), K = _ === 0 ? 0 : 2 * (1 - B / _);
2888
+ x = this.hsvToHex($, K, _);
2889
+ }
2890
+ }
2891
+ }
2892
+ if (x) {
2893
+ const { h: V, s: $, v: R } = this.hexToHsv(x);
2894
+ s.style.left = `${V / 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(${V}, 100%, 50%))`, E(x, u);
2895
+ }
2896
+ }, O = (m) => {
2897
+ v();
2898
+ }, H = () => {
2899
+ v();
2900
+ }, M = () => {
2901
+ navigator.clipboard.writeText(o.value).catch(() => {
2902
+ o.select(), document.execCommand("copy");
2903
+ });
2904
+ };
2905
+ v(), t.addEventListener("mousedown", I), t.addEventListener("click", U), i.addEventListener("mousedown", k), i.addEventListener("click", y), n.addEventListener("change", H), o.addEventListener("input", P), o.addEventListener("blur", O), a.addEventListener("click", M);
2906
+ const A = async () => {
2907
+ if ("EyeDropper" in window)
2908
+ try {
2909
+ const w = (await new window.EyeDropper().open()).sRGBHex, { h: x, s: V, v: $ } = this.hexToHsv(w);
2910
+ s.style.left = `${x / 360 * 100}%`, e.style.left = `${V * 100}%`, e.style.top = `${(1 - $) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${x}, 100%, 50%))`, E(w, u);
2911
+ } catch (m) {
2912
+ console.log("User cancelled eyedropper or error occurred:", m);
2913
+ }
2914
+ else
2915
+ alert(
2916
+ "EyeDropper API is not supported in this browser. Try using Chrome 95+ or Edge 95+."
2917
+ );
2918
+ };
2919
+ l.addEventListener("click", A);
2920
+ }
2921
+ hsvToHex(t, e, i) {
2922
+ const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
2923
+ let a = 0, l = 0, r = 0;
2924
+ return t >= 0 && t < 60 ? (a = s, l = n, r = 0) : t >= 60 && t < 120 ? (a = n, l = s, r = 0) : t >= 120 && t < 180 ? (a = 0, l = s, r = n) : t >= 180 && t < 240 ? (a = 0, l = n, r = s) : t >= 240 && t < 300 ? (a = n, l = 0, r = s) : t >= 300 && t < 360 && (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")}`;
2925
+ }
2926
+ setupOpacitySlider(t, e, i, s, n) {
2927
+ const o = () => {
2928
+ const { r: c, g: h, b: d } = this.hexToRgb(i);
2929
+ t.style.setProperty("--color-rgb", `${c}, ${h}, ${d}`);
2930
+ }, a = () => {
2931
+ e.style.left = `${s}%`;
2932
+ };
2933
+ o(), a();
2934
+ let l = !1;
2935
+ const r = (c) => {
2936
+ const h = t.getBoundingClientRect(), d = c.clientX - h.left, g = Math.max(0, Math.min(100, d / h.width * 100)), f = Math.round(g);
2937
+ s = f, a(), n(i, f);
2938
+ };
2939
+ t.addEventListener("mousedown", (c) => {
2940
+ l = !0, r(c);
2941
+ }), document.addEventListener("mousemove", (c) => {
2942
+ l && r(c);
2943
+ }), document.addEventListener("mouseup", () => {
2944
+ l = !1;
2945
+ });
2946
+ }
2947
+ hexToHsv(t) {
2948
+ const e = parseInt(t.slice(1, 3), 16) / 255, i = parseInt(t.slice(3, 5), 16) / 255, s = parseInt(t.slice(5, 7), 16) / 255, n = Math.max(e, i, s), o = Math.min(e, i, s), a = n - o;
2949
+ let l = 0;
2950
+ const r = n === 0 ? 0 : a / n, c = n;
2951
+ return a !== 0 && (n === e ? l = (i - s) / a % 6 : n === i ? l = (s - e) / a + 2 : l = (e - i) / a + 4), { h: l * 60, s: r, v: c };
2952
+ }
2953
+ hsvToHsl(t, e, i) {
2954
+ const s = i * (1 - e / 2), n = s === 0 || s === 1 ? 0 : (i - s) / Math.min(s, 1 - s);
2955
+ return { hue: t, sat: n, lightness: s };
2956
+ }
2957
+ createGradientEditor(t) {
2958
+ if (!this.value) return;
2959
+ const e = document.createElement("div");
2960
+ e.className = "gradient-subtype-inline";
2961
+ const i = document.createElement("select");
2962
+ i.className = "gradient-subtype-select";
2963
+ const s = document.createElement("option");
2964
+ s.value = "linear", s.textContent = "Linear";
2965
+ const n = document.createElement("option");
2966
+ n.value = "radial", n.textContent = "Radial", i.appendChild(s), i.appendChild(n), i.value = this.value.type === "radial" ? "radial" : "linear";
2967
+ const o = document.createElement("input");
2968
+ o.type = "text", o.inputMode = "numeric", o.className = "gradient-degree-input";
2969
+ const a = this.value.angle !== void 0 ? this.value.angle : 0;
2970
+ o.value = `${a}°`, o.setAttribute("data-min", "0"), o.setAttribute("data-max", "360"), o.style.width = "75px", o.style.textAlign = "center";
2971
+ const l = document.createElement("button");
2972
+ l.type = "button", l.className = "gradient-flip-btn", l.innerHTML = `
2973
+ <svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2974
+ <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"/>
2975
+ </svg>
2976
+ `, l.title = "Flip gradient", i.addEventListener("change", (u) => {
2977
+ const E = u.target.value;
2978
+ this.switchType(E === "radial" ? "radial" : "linear");
2979
+ }), o.addEventListener("input", (u) => {
2980
+ const E = u.target.value, v = parseInt(E);
2981
+ if (this.value && !isNaN(v)) {
2982
+ const L = Math.max(0, Math.min(360, v));
2983
+ this.value.angle = L, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
2984
+ }
2985
+ }), o.addEventListener("focus", (u) => {
2986
+ const E = u.target;
2987
+ E.value = E.value.replace(/[^0-9-]/g, ""), setTimeout(() => E.select(), 0);
2988
+ }), o.addEventListener("blur", (u) => {
2989
+ var L;
2990
+ const E = u.target;
2991
+ let v = parseInt(E.value);
2992
+ isNaN(v) && (v = ((L = this.value) == null ? void 0 : L.angle) ?? 0), v = Math.max(0, Math.min(360, v)), this.value && (this.value.angle = v), E.value = `${v}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
2993
+ }), l.addEventListener("click", () => {
2994
+ this.value && (this.value.stops = this.value.stops.map((u) => ({
2995
+ ...u,
2996
+ position: 100 - u.position
2997
+ })), this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
2998
+ }), e.appendChild(i), e.appendChild(o), e.appendChild(l), t.appendChild(e), (() => {
2999
+ var u;
3000
+ ((u = this.value) == null ? void 0 : u.type) === "radial" ? (o.disabled = !0, o.style.opacity = "0.5") : (o.disabled = !1, o.style.opacity = "1");
3001
+ })();
3002
+ const c = document.createElement("div");
3003
+ c.className = "gradient-preview", this.updateGradientPreview(c);
3004
+ const h = document.createElement("div");
3005
+ h.className = "gradient-handles", this.createGradientHandles(h, c), c.appendChild(h), t.appendChild(c);
3006
+ const d = document.createElement("div");
3007
+ d.className = "gradient-stops-header";
3008
+ const g = document.createElement("span");
3009
+ g.textContent = "Stops";
3010
+ const f = document.createElement("button");
3011
+ f.type = "button", f.className = "gradient-add-stop", f.textContent = "+", d.appendChild(g), d.appendChild(f);
3012
+ const C = document.createElement("div");
3013
+ C.className = "gradient-stops", t.appendChild(d), t.appendChild(C), this.updateStopsList(C), f.addEventListener("click", () => {
3014
+ this.addGradientStop(), this.updateStopsList(C), this.updateGradientPreview(c), this.createGradientHandles(h, c), this.updateUI();
3015
+ });
3016
+ }
3017
+ updateGradientPreview(t) {
3018
+ var i;
3019
+ const e = t || ((i = this.popoverElement) == null ? void 0 : i.querySelector(".gradient-preview"));
3020
+ e && this.value && (e.style.background = this.generateCSS(this.value));
3021
+ }
3022
+ createGradientHandles(t, e) {
3023
+ t.innerHTML = "", !(!this.value || this.value.type === "solid" || !this.value.stops) && this.value.stops.forEach((i, s) => {
3024
+ const n = document.createElement("div");
3025
+ n.className = "gstop-handle", n.style.left = `${i.position}%`;
3026
+ const o = document.createElement("div");
3027
+ o.className = "gstop-chip", o.style.backgroundColor = i.color, n.appendChild(o), this.makeDraggable(n, e, s), t.appendChild(n);
3028
+ });
3029
+ }
3030
+ makeDraggable(t, e, i) {
3031
+ let s = !1, n = 0, o = 0, a = null;
3032
+ const l = (d) => "touches" in d && d.touches.length > 0 ? d.touches[0].clientX : d.clientX, r = (d) => {
3033
+ var g, f, C;
3034
+ s = !0, n = l(d), o = ((C = (f = (g = this.value) == null ? void 0 : g.stops) == null ? void 0 : f[i]) == null ? void 0 : C.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, {
3035
+ passive: !1
3036
+ }), document.addEventListener("touchend", h), d.preventDefault();
3037
+ }, c = (d) => {
3038
+ var E, v;
3039
+ if (!s || !((v = (E = this.value) == null ? void 0 : E.stops) != null && v[i])) return;
3040
+ const g = e.getBoundingClientRect(), C = (l(d) - n) / g.width * 100;
3041
+ let u = o + C;
3042
+ u = Math.max(0, Math.min(100, u)), this.value.stops[i].position = Math.round(u), t.style.left = `${u}%`, a && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
3043
+ this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), a = null;
3044
+ }), d.preventDefault();
3045
+ }, h = () => {
3046
+ 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));
3047
+ };
3048
+ t.addEventListener("pointerdown", r), t.addEventListener("mousedown", r), t.addEventListener("touchstart", r, {
3049
+ passive: !1
3050
+ });
3051
+ }
3052
+ updateStopsList(t) {
3053
+ var i;
3054
+ const e = t || ((i = this.popoverElement) == null ? void 0 : i.querySelector(".gradient-stops"));
3055
+ !e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
3056
+ var z, U;
3057
+ const o = document.createElement("div");
3058
+ o.className = "gstop-row";
3059
+ const a = document.createElement("div");
3060
+ a.className = "gstop-position-group";
3061
+ const l = document.createElement("input");
3062
+ l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", a.appendChild(l);
3063
+ const r = document.createElement("div");
3064
+ r.className = "gstop-color-container";
3065
+ const c = document.createElement("div");
3066
+ c.className = "gstop-color-preview", c.style.backgroundColor = s.color;
3067
+ const h = document.createElement("input");
3068
+ h.type = "text", h.className = "gstop-color-input", h.value = s.color.replace("#", "").toUpperCase();
3069
+ const d = document.createElement("button");
3070
+ 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">
3071
+ <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"/>
3072
+ </svg>`, r.appendChild(c), r.appendChild(h), r.appendChild(d);
3073
+ const g = document.createElement("button");
3074
+ g.type = "button", g.className = "gstop-del", g.innerHTML = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
3075
+ <path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3076
+ </svg>`, g.disabled = (((U = (z = this.value) == null ? void 0 : z.stops) == null ? void 0 : U.length) || 0) <= 2, l.addEventListener("input", (I) => {
3077
+ var O;
3078
+ const y = I.target, k = y.value.replace(/[^\d]/g, ""), P = parseInt(k);
3079
+ if (this.value && !isNaN(P)) {
3080
+ const H = Math.max(0, Math.min(100, P));
3081
+ this.value.stops[n].position = H, y.value = `${H}%`;
3082
+ const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3083
+ ".gradient-preview"
3084
+ ), A = M == null ? void 0 : M.querySelector(
3085
+ ".gradient-handles"
3086
+ );
3087
+ M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3088
+ }
3089
+ }), l.addEventListener("focus", (I) => {
3090
+ const y = I.target, k = y.value.replace("%", "");
3091
+ y.value = k, y.select();
3092
+ }), l.addEventListener("blur", (I) => {
3093
+ var O, H;
3094
+ const y = I.target, k = y.value.replace(/[^\d]/g, ""), P = parseInt(k);
3095
+ if (isNaN(P))
3096
+ y.value = `${((H = (O = this.value) == null ? void 0 : O.stops[n]) == null ? void 0 : H.position) || 0}%`;
3097
+ else {
3098
+ const M = Math.max(0, Math.min(100, P));
3099
+ y.value = `${M}%`, this.value && (this.value.stops[n].position = M, this.updateGradientPreview(), this.updateUI(), this.triggerChange());
3100
+ }
3101
+ });
3102
+ const f = new Tt(
3103
+ (I, y) => {
3104
+ var k, P, O;
3105
+ if (h.value = I.replace("#", "").toUpperCase(), c.style.backgroundColor = I, this.value) {
3106
+ this.value.stops[n].color = I, y !== void 0 && (this.value.stops[n].opacity = y);
3107
+ const H = (k = o.parentElement) == null ? void 0 : k.querySelector(
3108
+ ".gstop-opacity-slider"
3109
+ );
3110
+ if (H) {
3111
+ const m = this.hexToRgb(I);
3112
+ H.style.setProperty(
3113
+ "--slider-color",
3114
+ `rgb(${m.r}, ${m.g}, ${m.b})`
3115
+ );
3116
+ }
3117
+ if (y !== void 0) {
3118
+ const m = (P = o.parentElement) == null ? void 0 : P.querySelector(
3119
+ ".gstop-opacity-value"
3120
+ );
3121
+ m && (m.textContent = `${y}%`), H && (H.value = y.toString());
3122
+ }
3123
+ const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3124
+ ".gradient-preview"
3125
+ ), A = M == null ? void 0 : M.querySelector(
3126
+ ".gradient-handles"
3127
+ );
3128
+ M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3129
+ }
3130
+ }
3131
+ );
3132
+ h.addEventListener("click", (I) => {
3133
+ I.stopPropagation(), f.open(s.color, h, s.opacity || 100);
3134
+ }), h.addEventListener("input", (I) => {
3135
+ var P, O;
3136
+ const y = I.target.value.trim(), k = y.startsWith("#") ? y : `#${y}`;
3137
+ if (/^#[0-9A-Fa-f]{6}$/.test(k) && (c.style.backgroundColor = k, this.value)) {
3138
+ this.value.stops[n].color = k;
3139
+ const H = (P = o.parentElement) == null ? void 0 : P.querySelector(
3140
+ ".gstop-opacity-slider"
3141
+ );
3142
+ if (H) {
3143
+ const m = this.hexToRgb(k);
3144
+ H.style.setProperty(
3145
+ "--slider-color",
3146
+ `rgb(${m.r}, ${m.g}, ${m.b})`
3147
+ );
3148
+ }
3149
+ const M = (O = this.popoverElement) == null ? void 0 : O.querySelector(
3150
+ ".gradient-preview"
3151
+ ), A = M == null ? void 0 : M.querySelector(
3152
+ ".gradient-handles"
3153
+ );
3154
+ M && A && this.createGradientHandles(A, M), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3155
+ }
3156
+ }), d.addEventListener("click", async (I) => {
3157
+ I.stopPropagation();
3158
+ const y = `#${h.value}`;
3159
+ try {
3160
+ await navigator.clipboard.writeText(y);
3161
+ const k = d.innerHTML;
3162
+ d.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3163
+ <path d="M9.3335 14L12.2502 16.9167L18.6668 10.5" stroke="#00A76F" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
3164
+ </svg>`, setTimeout(() => {
3165
+ d.innerHTML = k;
3166
+ }, 1e3);
3167
+ } catch (k) {
3168
+ console.warn("Failed to copy color to clipboard:", k);
3169
+ }
3170
+ }), g.addEventListener("click", () => {
3171
+ var I;
3172
+ if (this.value && this.value.stops.length > 2) {
3173
+ this.value.stops.splice(n, 1);
3174
+ const y = (I = this.popoverElement) == null ? void 0 : I.querySelector(
3175
+ ".gradient-preview"
3176
+ ), k = y == null ? void 0 : y.querySelector(
3177
+ ".gradient-handles"
3178
+ );
3179
+ y && k && this.createGradientHandles(k, y), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3180
+ }
3181
+ }), o.appendChild(a), o.appendChild(r), o.appendChild(g), e.appendChild(o);
3182
+ const C = document.createElement("div");
3183
+ C.className = "gstop-opacity-row";
3184
+ const u = document.createElement("span");
3185
+ u.className = "gstop-opacity-label", u.textContent = "Opacity";
3186
+ const E = document.createElement("div");
3187
+ E.className = "gstop-opacity-group";
3188
+ const v = document.createElement("input");
3189
+ v.type = "range", v.className = "gstop-opacity-slider", v.min = "0", v.max = "100", v.value = (s.opacity !== void 0 ? s.opacity : 100).toString();
3190
+ const L = this.hexToRgb(s.color);
3191
+ v.style.setProperty(
3192
+ "--slider-color",
3193
+ `rgb(${L.r}, ${L.g}, ${L.b})`
3194
+ );
3195
+ const T = document.createElement("span");
3196
+ T.className = "gstop-opacity-value", T.textContent = `${s.opacity !== void 0 ? s.opacity : 100}%`;
3197
+ }));
3198
+ }
3199
+ addGradientStop() {
3200
+ if (!this.value || this.value.type === "solid" || !this.value.stops) return;
3201
+ const t = this.value.stops.map((o) => o.position).sort((o, a) => o - a);
3202
+ let e = 50, i = 0;
3203
+ for (let o = 0; o < t.length - 1; o++) {
3204
+ const a = t[o + 1] - t[o];
3205
+ a > i && (i = a, e = t[o] + a / 2);
3206
+ }
3207
+ const s = this.value.stops.reduce((o, a) => Math.abs(a.position - e) < Math.abs(o.position - e) ? a : o), n = {
3208
+ position: Math.round(e),
3209
+ color: s.color,
3210
+ opacity: s.opacity !== void 0 ? s.opacity : 100
3211
+ };
3212
+ this.value.stops.push(n), this.value.stops.sort((o, a) => o.position - a.position);
3213
+ }
3214
+ openPopover() {
3215
+ if (!(!this.popoverElement || this.isPopoverOpen)) {
3216
+ if (this.isPopoverOpen = !0, this.popoverElement.style.display = "flex", this.refreshPopoverContent(), this.element) {
3217
+ const t = this.element.getBoundingClientRect(), e = 306, i = window.innerWidth, s = window.innerHeight, n = 16;
3218
+ this.popoverElement.style.position = "fixed", this.popoverElement.style.zIndex = "10000";
3219
+ let o = t.right + 8, a = t.top;
3220
+ const l = i - t.right, r = t.left, c = e + n;
3221
+ l < c && r > l + 100 && (o = t.left - e - 8), a + 400 > s && (a = Math.max(8, s - 400 - 8)), this.popoverElement.style.left = `${o}px`, this.popoverElement.style.top = `${a}px`;
3222
+ }
3223
+ setTimeout(() => {
3224
+ document.addEventListener("click", this.handleBackgroundClick, !0);
3225
+ }, 0);
3226
+ }
3227
+ }
3228
+ refreshPopoverContent() {
3229
+ if (!this.popoverElement) return;
3230
+ this.popoverElement.querySelectorAll(".gradient-type-tab").forEach((i, s) => {
3231
+ var n, o;
3232
+ i.classList.remove("active"), (s === 0 && ((n = this.value) == null ? void 0 : n.type) === "solid" || s === 1 && ((o = this.value) == null ? void 0 : o.type) !== "solid") && i.classList.add("active");
3233
+ });
3234
+ const e = this.popoverElement.querySelector(
3235
+ ".gradient-editor-content"
3236
+ );
3237
+ e && this.updatePopoverContent(e);
3238
+ }
3239
+ closePopover() {
3240
+ !this.popoverElement || !this.isPopoverOpen || (this.isPopoverOpen = !1, this.popoverElement.style.display = "none", document.removeEventListener("click", this.handleBackgroundClick, !0));
3241
+ }
3242
+ handlePaste(t) {
3243
+ var i;
3244
+ t.preventDefault();
3245
+ const e = ((i = t.clipboardData) == null ? void 0 : i.getData("text")) || "";
3246
+ this.parseAndSetValue(e);
3247
+ }
3248
+ handleInput(t) {
3249
+ const e = t.target;
3250
+ this.parseAndSetValue(e.value);
3251
+ }
3252
+ parseAndSetValue(t) {
3253
+ const e = t.trim();
3254
+ if (e)
3255
+ try {
3256
+ const i = this.parseGradientCSS(e);
3257
+ i && this.setValue(i);
3258
+ } catch (i) {
3259
+ console.warn("Failed to parse gradient/color:", i);
3260
+ }
3261
+ }
3262
+ parseGradientCSS(t) {
3263
+ const e = t.replace(/;$/, "").trim();
3264
+ if (this.isValidColor(e))
3265
+ return {
3266
+ type: "solid",
3267
+ angle: 0,
3268
+ stops: [this.parseColorWithOpacity(e)]
3269
+ };
3270
+ const i = this.extractGradientParams(e, "linear-gradient");
3271
+ if (i)
3272
+ return this.parseLinearGradient(i);
3273
+ const s = this.extractGradientParams(e, "radial-gradient");
3274
+ return s ? this.parseRadialGradient(s) : null;
3275
+ }
3276
+ extractGradientParams(t, e) {
3277
+ const i = new RegExp(`${e}\\s*\\(`, "i"), s = t.match(i);
3278
+ if (!s) return null;
3279
+ const n = s.index + s[0].length;
3280
+ let o = 1, a = n;
3281
+ for (let l = n; l < t.length && o > 0; l++)
3282
+ t[l] === "(" ? o++ : t[l] === ")" && o--, a = l;
3283
+ return o === 0 ? t.substring(n, a) : null;
3284
+ }
3285
+ isValidColor(t) {
3286
+ const e = document.createElement("div");
3287
+ return e.style.color = t, e.style.color !== "";
3288
+ }
3289
+ parseColorWithOpacity(t) {
3290
+ const e = t.trim();
3291
+ if (/^#[0-9A-Fa-f]{8}$/.test(e)) {
3292
+ const n = e.slice(1);
3293
+ parseInt(n.substr(0, 2), 16), parseInt(n.substr(2, 2), 16), parseInt(n.substr(4, 2), 16);
3294
+ const a = parseInt(n.substr(6, 2), 16) / 255 * 100;
3295
+ return { color: `#${n.substr(0, 6)}`, position: 0, opacity: a };
3296
+ }
3297
+ const i = e.match(
3298
+ /rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/
3299
+ );
3300
+ if (i) {
3301
+ const n = parseInt(i[1]), o = parseInt(i[2]), a = parseInt(i[3]), l = i[4] ? parseFloat(i[4]) : 1;
3302
+ return { color: `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`, position: 0, opacity: Math.round(l * 100) };
3303
+ }
3304
+ const s = e.match(
3305
+ /hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+))?\s*\)/
3306
+ );
3307
+ if (s) {
3308
+ 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);
3309
+ 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) };
3310
+ }
3311
+ return { color: e, position: 0, opacity: 100 };
3312
+ }
3313
+ hslToRgb(t, e, i) {
3314
+ const s = (1 - Math.abs(2 * i - 1)) * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s / 2;
3315
+ let a = 0, l = 0, r = 0;
3316
+ return t >= 0 && t < 60 ? (a = s, l = n, r = 0) : t >= 60 && t < 120 ? (a = n, l = s, r = 0) : t >= 120 && t < 180 ? (a = 0, l = s, r = n) : t >= 180 && t < 240 ? (a = 0, l = n, r = s) : t >= 240 && t < 300 ? (a = n, l = 0, r = s) : t >= 300 && t < 360 && (a = s, l = 0, r = n), {
3317
+ r: Math.round((a + o) * 255),
3318
+ g: Math.round((l + o) * 255),
3319
+ b: Math.round((r + o) * 255)
3320
+ };
3321
+ }
3322
+ smartSplit(t) {
3323
+ const e = [];
3324
+ let i = "", s = 0;
3325
+ for (let n = 0; n < t.length; n++) {
3326
+ const o = t[n];
3327
+ if (o === "(")
3328
+ s++;
3329
+ else if (o === ")")
3330
+ s--;
3331
+ else if (o === "," && s === 0) {
3332
+ e.push(i.trim()), i = "";
3333
+ continue;
3334
+ }
3335
+ i += o;
3336
+ }
3337
+ return i.trim() && e.push(i.trim()), e;
3338
+ }
3339
+ parseLinearGradient(t) {
3340
+ const e = this.smartSplit(t);
3341
+ let i = 90, s = [];
3342
+ const n = e[0];
3343
+ if (n.includes("deg")) {
3344
+ const a = n.match(/(-?\d+(?:\.\d+)?)deg/);
3345
+ a ? (i = parseFloat(a[1]), s = e.slice(1)) : s = e;
3346
+ } else n.includes("to ") ? (i = {
3347
+ "to right": 90,
3348
+ "to left": 270,
3349
+ "to bottom": 180,
3350
+ "to top": 0,
3351
+ "to bottom right": 135,
3352
+ "to bottom left": 225,
3353
+ "to top right": 45,
3354
+ "to top left": 315
3355
+ }[n] || 90, s = e.slice(1)) : s = e;
3356
+ const o = this.parseColorStops(s);
3357
+ return o.length === 0 ? null : {
3358
+ type: "linear",
3359
+ angle: i,
3360
+ stops: o
3361
+ };
3362
+ }
3363
+ parseRadialGradient(t) {
3364
+ const e = this.smartSplit(t);
3365
+ let i = [];
3366
+ e[0] && !this.isColorStop(e[0]) ? i = e.slice(1) : i = e;
3367
+ const s = this.parseColorStops(i);
3368
+ return s.length === 0 ? null : {
3369
+ type: "radial",
3370
+ angle: 0,
3371
+ stops: s
3372
+ };
3373
+ }
3374
+ isColorStop(t) {
3375
+ const e = t.split(" ")[0].toLowerCase();
3376
+ return [
3377
+ "circle",
3378
+ "ellipse",
3379
+ "closest-side",
3380
+ "closest-corner",
3381
+ "farthest-side",
3382
+ "farthest-corner",
3383
+ "at"
3384
+ ].includes(e) || ["contain", "cover"].includes(e) ? !1 : /^#[0-9a-f]{3,8}$/i.test(e) || /^rgb/i.test(t) || /^hsl/i.test(t) || this.isValidColorName(e);
3385
+ }
3386
+ isValidColorName(t) {
3387
+ return [
3388
+ "red",
3389
+ "green",
3390
+ "blue",
3391
+ "yellow",
3392
+ "orange",
3393
+ "purple",
3394
+ "pink",
3395
+ "brown",
3396
+ "black",
3397
+ "white",
3398
+ "gray",
3399
+ "grey",
3400
+ "cyan",
3401
+ "magenta",
3402
+ "lime",
3403
+ "navy",
3404
+ "maroon",
3405
+ "olive",
3406
+ "aqua",
3407
+ "silver",
3408
+ "teal",
3409
+ "fuchsia",
3410
+ "transparent"
3411
+ ].includes(t.toLowerCase());
3412
+ }
3413
+ parseColorStops(t) {
3414
+ const e = [];
3415
+ return t.forEach((i, s) => {
3416
+ const n = i.trim();
3417
+ if (!n) return;
3418
+ let o = "", a = 0;
3419
+ const l = n.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
3420
+ if (l) {
3421
+ const c = l[1].trim(), h = parseFloat(l[2]);
3422
+ this.isValidColorFormat(c) ? (o = c, a = h) : (o = n, a = t.length === 1 ? 0 : s / (t.length - 1) * 100);
3423
+ } else
3424
+ o = n, a = t.length === 1 ? 0 : s / (t.length - 1) * 100;
3425
+ const r = this.parseColorWithOpacity(o);
3426
+ r.position = Math.round(a), e.push(r);
3427
+ }), e;
3428
+ }
3429
+ isValidColorFormat(t) {
3430
+ return [
3431
+ /^#[0-9a-fA-F]{3,8}$/,
3432
+ // hex colors
3433
+ /^rgba?\s*\([^)]+\)$/,
3434
+ // rgb/rgba functions
3435
+ /^hsla?\s*\([^)]+\)$/,
3436
+ // hsl/hsla functions
3437
+ /^[a-zA-Z]+$/
3438
+ // named colors
3439
+ ].some((i) => i.test(t.trim())) || this.isValidColor(t);
3440
+ }
3441
+ triggerChange() {
3442
+ this.onChange && this.value && this.onChange(this.value), this.detectChange && this.value && this.detectChange(this.value);
3443
+ }
3444
+ getElement() {
3445
+ return this.element;
3446
+ }
3447
+ getValue() {
3448
+ return this.value ? this.forText ? {
3449
+ background: this.generateCSS(this.value),
3450
+ "-webkit-background-clip": "text",
3451
+ "background-clip": "text",
3452
+ color: "transparent",
3453
+ "-webkit-text-fill-color": "transparent"
3454
+ } : this.generateCSS(this.value) : this.forText ? {} : "";
3455
+ }
3456
+ getCSSValue() {
3457
+ return this.value ? this.generateCSS(this.value) : "";
3458
+ }
3459
+ // Add method to get the raw object value if needed
3460
+ getRawValue() {
3461
+ return this.value;
3462
+ }
3463
+ }
3464
+ const Pt = `
2215
3465
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2216
3466
  <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.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.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.75L5.85 2.75C4.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.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
2217
3467
  </svg>
2218
- `, rt = `
3468
+ `, Ot = `
2219
3469
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2220
3470
  <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"/>
2221
3471
  </svg>
2222
3472
  `;
2223
- class Ot extends v {
3473
+ class se extends G {
2224
3474
  constructor(t) {
2225
3475
  super({
2226
3476
  title: "Border",
2227
3477
  collapsed: t == null ? void 0 : t.collapsed,
2228
3478
  settings: {
2229
- size: new f({
3479
+ size: new F({
2230
3480
  title: "Size",
2231
- icon: rt,
3481
+ icon: Ot,
2232
3482
  default: (t == null ? void 0 : t.size) ?? 0,
2233
3483
  suffix: "px"
2234
3484
  }),
2235
- color: new C({
3485
+ color: new W({
2236
3486
  default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
2237
3487
  }),
2238
- radius: new f({
3488
+ radius: new F({
2239
3489
  title: "Radius",
2240
- icon: lt,
3490
+ icon: Pt,
2241
3491
  default: (t == null ? void 0 : t.radius) ?? 12,
2242
3492
  suffix: "px"
2243
3493
  })
@@ -2256,20 +3506,20 @@ class Ot extends v {
2256
3506
  `;
2257
3507
  }
2258
3508
  }
2259
- const ht = `
3509
+ const $t = `
2260
3510
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
2261
3511
  <path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
2262
3512
  </svg>
2263
- `, ct = `
3513
+ `, At = `
2264
3514
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2265
3515
  <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"/>
2266
3516
  </svg>
2267
- `, dt = `
3517
+ `, Bt = `
2268
3518
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2269
3519
  <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"/>
2270
3520
  </svg>
2271
3521
  `;
2272
- class Ht extends v {
3522
+ class ne extends G {
2273
3523
  constructor(t = {}) {
2274
3524
  const { showAlign: e = t.showAlign ?? !0, ...i } = t;
2275
3525
  super({
@@ -2277,12 +3527,12 @@ class Ht extends v {
2277
3527
  collapsed: i.collapsed,
2278
3528
  settings: (() => {
2279
3529
  const s = {
2280
- color: new C({
3530
+ color: new W({
2281
3531
  default: i.colorDefault ?? "0, 0, 30"
2282
3532
  }),
2283
- fontFamily: new N({
3533
+ fontFamily: new et({
2284
3534
  title: "Font",
2285
- icon: ht,
3535
+ icon: $t,
2286
3536
  default: i.fontFamilyDefault ?? "Satoshi",
2287
3537
  options: i.fontFamilyOptions ?? [
2288
3538
  { name: "Alt", value: "Croco Sans Black Caps Alt" },
@@ -2293,9 +3543,9 @@ class Ht extends v {
2293
3543
  getOptions: i.fontFamilyGetOptions,
2294
3544
  getOptionsAsync: i.fontFamilyGetOptionsAsync
2295
3545
  }),
2296
- fontWeight: new N({
3546
+ fontWeight: new et({
2297
3547
  title: "Weight",
2298
- icon: ct,
3548
+ icon: At,
2299
3549
  default: i.fontWeightDefault ?? "400",
2300
3550
  options: i.fontWeightOptions ?? [
2301
3551
  { name: "Regular", value: "400" },
@@ -2305,9 +3555,9 @@ class Ht extends v {
2305
3555
  getOptions: i.fontWeightGetOptions,
2306
3556
  getOptionsAsync: i.fontWeightGetOptionsAsync
2307
3557
  }),
2308
- fontSize: new f({
3558
+ fontSize: new F({
2309
3559
  title: "Size",
2310
- icon: dt,
3560
+ icon: Bt,
2311
3561
  default: i.fontSizeDefault ?? 12,
2312
3562
  suffix: "px",
2313
3563
  mobile: i.fontSizeMobileDefault
@@ -2315,7 +3565,7 @@ class Ht extends v {
2315
3565
  };
2316
3566
  return e ? {
2317
3567
  ...s,
2318
- align: new Z({
3568
+ align: new yt({
2319
3569
  title: "Align",
2320
3570
  default: i.alignDefault ?? "center"
2321
3571
  })
@@ -2324,8 +3574,8 @@ class Ht extends v {
2324
3574
  });
2325
3575
  }
2326
3576
  getCssCode() {
2327
- var a;
2328
- const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
3577
+ var o;
3578
+ const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((o = this.settings.align) == null ? void 0 : o.value) ?? "left";
2329
3579
  return `
2330
3580
  color: ${t};
2331
3581
  font-family: ${e};
@@ -2335,7 +3585,7 @@ class Ht extends v {
2335
3585
  `;
2336
3586
  }
2337
3587
  }
2338
- class L extends p {
3588
+ class J extends S {
2339
3589
  constructor(t) {
2340
3590
  super({
2341
3591
  ...t,
@@ -2343,11 +3593,11 @@ class L extends p {
2343
3593
  }), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
2344
3594
  }
2345
3595
  draw() {
2346
- const t = this.value === "auto" ? "text" : "number", e = (o) => {
2347
- this.value !== "auto" && (this.props.minValue !== void 0 && (o.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (o.max = String(this.props.maxValue)), this.props.className && o.classList.add(this.props.className), o.addEventListener("input", () => {
3596
+ const t = this.value === "auto" ? "text" : "number", e = (a) => {
3597
+ this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
2348
3598
  const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, r = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
2349
- let h = Number(o.value);
2350
- h < l && (h = l), h > r && (h = r), o.value = String(h);
3599
+ let c = Number(a.value);
3600
+ c < l && (c = l), c > r && (c = r), a.value = String(c);
2351
3601
  }));
2352
3602
  }, i = this.createInput({
2353
3603
  value: this.value,
@@ -2368,9 +3618,9 @@ class L extends p {
2368
3618
  s && (s.style.paddingRight = "35px");
2369
3619
  const n = document.createElement("span");
2370
3620
  n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
2371
- const a = i.querySelector("input");
2372
- return a && (a.oninput = (o) => {
2373
- const l = o.target.value.trim();
3621
+ const o = i.querySelector("input");
3622
+ return o && (o.oninput = (a) => {
3623
+ const l = a.target.value.trim();
2374
3624
  if (l.toLowerCase() === "auto")
2375
3625
  this.value = "auto";
2376
3626
  else {
@@ -2381,33 +3631,33 @@ class L extends p {
2381
3631
  }), i;
2382
3632
  }
2383
3633
  }
2384
- class Tt extends v {
3634
+ class oe extends G {
2385
3635
  constructor(t) {
2386
3636
  super({
2387
3637
  title: "Margins",
2388
3638
  collapsed: t == null ? void 0 : t.collapsed,
2389
3639
  settings: {
2390
- marginTop: new L({
3640
+ marginTop: new J({
2391
3641
  title: "Top",
2392
- icon: ut,
3642
+ icon: Dt,
2393
3643
  suffix: "px",
2394
3644
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
2395
3645
  }),
2396
- marginRight: new L({
3646
+ marginRight: new J({
2397
3647
  title: "Right",
2398
- icon: pt,
3648
+ icon: Ft,
2399
3649
  suffix: "px",
2400
3650
  default: (t == null ? void 0 : t.marginRight) ?? 0
2401
3651
  }),
2402
- marginBottom: new L({
3652
+ marginBottom: new J({
2403
3653
  title: "Bottom",
2404
- icon: gt,
3654
+ icon: Rt,
2405
3655
  suffix: "px",
2406
3656
  default: (t == null ? void 0 : t.marginBottom) ?? 0
2407
3657
  }),
2408
- marginLeft: new L({
3658
+ marginLeft: new J({
2409
3659
  title: "Left",
2410
- icon: mt,
3660
+ icon: Gt,
2411
3661
  suffix: "px",
2412
3662
  default: (t == null ? void 0 : t.marginLeft) ?? 0
2413
3663
  })
@@ -2424,29 +3674,29 @@ class Tt extends v {
2424
3674
  `;
2425
3675
  }
2426
3676
  }
2427
- const ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3677
+ const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2428
3678
  <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"/>
2429
- </svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3679
+ </svg>`, Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2430
3680
  <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"/>
2431
- </svg>`, gt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3681
+ </svg>`, Rt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2432
3682
  <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
2433
- </svg>`, mt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3683
+ </svg>`, Gt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2434
3684
  <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"/>
2435
3685
  </svg>`;
2436
- class Pt extends v {
3686
+ class ae extends G {
2437
3687
  constructor(t) {
2438
3688
  super({
2439
3689
  title: "Background Image",
2440
3690
  collapsed: t == null ? void 0 : t.collapsed,
2441
3691
  settings: {
2442
- backgroundImage: new P({
3692
+ backgroundImage: new ot({
2443
3693
  ...t == null ? void 0 : t.uploadProps,
2444
3694
  default: (t == null ? void 0 : t.backgroundImage) ?? ""
2445
3695
  }),
2446
- opacity: new J({
3696
+ opacity: new Ct({
2447
3697
  default: (t == null ? void 0 : t.opacity) ?? 100
2448
3698
  }),
2449
- backgroundColor: new C({
3699
+ backgroundColor: new W({
2450
3700
  default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
2451
3701
  })
2452
3702
  }
@@ -2455,10 +3705,10 @@ class Pt extends v {
2455
3705
  draw() {
2456
3706
  const t = super.draw(), e = t.querySelector(".setting-group-content");
2457
3707
  if (!e) return t;
2458
- const i = Array.from(e.children), [s, n, a] = i;
3708
+ const i = Array.from(e.children), [s, n, o] = i;
2459
3709
  e.innerHTML = "", e.appendChild(s), e.appendChild(n);
2460
- const o = document.createElement("div");
2461
- return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
3710
+ const a = document.createElement("div");
3711
+ return a.className = "bgset-or-label", a.textContent = "OR", e.appendChild(a), e.appendChild(o), t;
2462
3712
  }
2463
3713
  getCssCode() {
2464
3714
  const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#000000";
@@ -2473,39 +3723,40 @@ class Pt extends v {
2473
3723
  }
2474
3724
  }
2475
3725
  export {
2476
- Z as AlignSetting,
2477
- Nt as AnimationSetting,
2478
- Pt as BackgroundSettingSet,
2479
- Ot as BorderSettingSet,
2480
- bt as ButtonSetting,
2481
- m as ColorSetting,
2482
- C as ColorWithOpacitySetting,
2483
- Et as DimensionSetting,
2484
- Mt as GapSetting,
2485
- Ht as HeaderTypographySettingSet,
2486
- xt as HeightSetting,
2487
- wt as HtmlSetting,
2488
- Vt as MarginBottomSetting,
2489
- Tt as MarginSettingGroup,
2490
- It as MarginTopSetting,
2491
- St as MultiLanguageSetting,
2492
- f as NumberSetting,
2493
- J as OpacitySetting,
2494
- Lt as SelectApiSettings,
2495
- N as SelectSetting,
2496
- p as Setting,
2497
- v as SettingGroup,
2498
- G as StringSetting,
2499
- z as TabSettingGroup,
2500
- z as TabsSettingGroup,
2501
- kt as Toggle,
2502
- P as UploadSetting,
2503
- yt as WidthSetting,
2504
- Ct as asSettingGroupWithSettings,
2505
- W as createSettingGroup,
2506
- vt as createTabSettingGroup,
2507
- E as isSetting,
2508
- H as isSettingChild,
2509
- g as isSettingGroup,
2510
- y as iterateSettings
3726
+ yt as AlignSetting,
3727
+ ee as AnimationSetting,
3728
+ ae as BackgroundSettingSet,
3729
+ se as BorderSettingSet,
3730
+ jt as ButtonSetting,
3731
+ D as ColorSetting,
3732
+ W as ColorWithOpacitySetting,
3733
+ _t as DimensionSetting,
3734
+ Yt as GapSetting,
3735
+ ie as GradientSetting,
3736
+ ne as HeaderTypographySettingSet,
3737
+ qt as HeightSetting,
3738
+ Ut as HtmlSetting,
3739
+ Kt as MarginBottomSetting,
3740
+ oe as MarginSettingGroup,
3741
+ Qt as MarginTopSetting,
3742
+ te as MultiLanguageSetting,
3743
+ F as NumberSetting,
3744
+ Ct as OpacitySetting,
3745
+ Zt as SelectApiSettings,
3746
+ et as SelectSetting,
3747
+ S as Setting,
3748
+ G as SettingGroup,
3749
+ gt as StringSetting,
3750
+ pt as TabSettingGroup,
3751
+ pt as TabsSettingGroup,
3752
+ Xt as Toggle,
3753
+ ot as UploadSetting,
3754
+ Jt as WidthSetting,
3755
+ zt as asSettingGroupWithSettings,
3756
+ ut as createSettingGroup,
3757
+ Wt as createTabSettingGroup,
3758
+ j as isSetting,
3759
+ st as isSettingChild,
3760
+ N as isSettingGroup,
3761
+ q as iterateSettings
2511
3762
  };