builder-settings-types 0.0.150 → 0.0.153

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.
@@ -5,7 +5,7 @@ let R = (c = 21) => {
5
5
  t += A[e[c] & 63];
6
6
  return t;
7
7
  };
8
- function V(c) {
8
+ function y(c) {
9
9
  if (c === null || typeof c != "object")
10
10
  return c;
11
11
  if (c instanceof Date)
@@ -13,16 +13,16 @@ function V(c) {
13
13
  if (Array.isArray(c)) {
14
14
  const i = [];
15
15
  for (let s = 0; s < c.length; s++)
16
- i[s] = V(c[s]);
16
+ i[s] = y(c[s]);
17
17
  return i;
18
18
  }
19
19
  const t = {};
20
20
  for (const i in c)
21
- Object.prototype.hasOwnProperty.call(c, i) && (t[i] = V(c[i]));
21
+ Object.prototype.hasOwnProperty.call(c, i) && (t[i] = y(c[i]));
22
22
  const e = Object.getPrototypeOf(c);
23
23
  return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
24
24
  }
25
- function $(c) {
25
+ function _(c) {
26
26
  switch (c) {
27
27
  case "number":
28
28
  return 0;
@@ -55,8 +55,8 @@ class m {
55
55
  }
56
56
  // Basic clone method
57
57
  clone() {
58
- const t = this.constructor, e = V(this.props), i = new t(e);
59
- return i.value = V(this.value), i;
58
+ const t = this.constructor, e = y(this.props), i = new t(e);
59
+ return i.value = y(this.value), i;
60
60
  }
61
61
  createInput(t) {
62
62
  t = { ...this.props.inputProps, ...t };
@@ -76,7 +76,7 @@ class m {
76
76
  const i = document.createElement("div");
77
77
  i.className = t.wrapperClassName || "";
78
78
  const s = document.createElement("input");
79
- this.inputEl = s, s.value = String(t.value || $(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
79
+ this.inputEl = s, s.value = String(t.value || _(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
80
80
  const n = (a) => {
81
81
  const o = a.target;
82
82
  let l = o.value;
@@ -122,22 +122,10 @@ function M(c, t) {
122
122
  t(e, i);
123
123
  }
124
124
  }
125
- const E = class E {
125
+ const w = class w {
126
126
  constructor(t) {
127
127
  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.lastValues = {}, this.lastChangeTime = 0, this.CHANGE_DEBOUNCE = 100, this.handleBlur = () => {
128
- }, this.pendingBlurHandler = null, this.hasFocus = !1, this.focusTrackingEnabled = !1, this.handleFocus = () => {
129
- }, this.blurDebounceTime = 100, this.lastBlurTime = 0, this.isProcessingBlur = !1, this.isInteracting = !1, this.interactionStartTime = 0, this.modifiedSettings = /* @__PURE__ */ new Set(), this.activeSettingId = null, this.hasValueChanged = !1, this.handleInteractionStart = (e) => {
130
- this.isInteracting || (this.isInteracting = !0, this.interactionStartTime = Date.now(), this.modifiedSettings.clear(), console.log(`[${this.title}] Setting interaction started`));
131
- }, this.handleChange = (e) => {
132
- if (e.target instanceof HTMLElement) {
133
- this.hasValueChanged = !0;
134
- const i = e.target.closest("[data-setting-id]");
135
- if (i) {
136
- const s = i.getAttribute("data-setting-id");
137
- typeof s == "string" && (this.activeSettingId = s);
138
- }
139
- }
140
- }, typeof t.id == "string" && t.id.trim() !== "" ? this.id = t.id.trim() : this.id = R(), typeof t.title == "string" ? this.title = t.title : (this.title = "Untitled Setting Group", console.warn(`SettingGroup constructor: Invalid title provided, defaulting to '${this.title}'.`, t)), this.settings = t.settings, typeof t.description == "string" ? this.description = t.description : t.description === null || t.description === void 0 ? this.description = void 0 : (this.description = String(t.description), console.warn("SettingGroup constructor: Invalid description type, coercing to string.", t)), this.icon = t.icon, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.hideCondition = t.hideCondition, this.onBlur = t.onBlur, this.blurDebounceTime = t.blurDebounceTime ?? 100, Object.assign(this, t.settings), this.initialValues = this.getValues();
128
+ }, this.pendingBlurHandler = null, this.id = t.id || R(), this.title = t.title, this.settings = t.settings, this.description = t.description, this.icon = t.icon, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.hideCondition = t.hideCondition, this.onBlur = t.onBlur, Object.assign(this, t.settings), this.initialValues = this.getValues();
141
129
  }
142
130
  static hide() {
143
131
  this.hiddenElements.forEach((t) => {
@@ -157,77 +145,52 @@ const E = class E {
157
145
  this.initialValues,
158
146
  i
159
147
  );
160
- Object.keys(s).length > 0 && (this.hasValueChanged = !0, this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
148
+ Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
161
149
  }, 50));
162
150
  };
163
151
  return this.changeHandlers.clear(), M(this.settings, (i, s) => {
164
152
  var n;
165
- if (s instanceof E)
153
+ if (s instanceof w)
166
154
  s.setOnChange((a) => {
167
- this.hasValueChanged = !0;
168
155
  const o = this.getValues();
169
156
  this.initialValues = o, t(o);
170
157
  }), this.changeHandlers.add(() => t(this.getValues()));
171
158
  else if (s instanceof m) {
172
159
  const a = () => {
173
- this.hasValueChanged = !0, e();
160
+ e();
174
161
  };
175
162
  this.changeHandlers.add(a), s.setOnChange(a);
176
163
  } else {
177
164
  const a = () => {
178
- this.hasValueChanged = !0, e();
165
+ e();
179
166
  };
180
167
  this.changeHandlers.add(a), (n = s.setOnChange) == null || n.call(s, a);
181
168
  }
182
169
  }), this;
183
170
  }
184
- setOnBlur(t, e) {
185
- return this.onBlur = t, this.pendingBlurHandler = t, this.focusTrackingEnabled = !0, e !== void 0 && (this.blurDebounceTime = e), this.handleBlur = (i) => {
186
- if (!this.hasValueChanged && !i) return;
187
- let n = null;
188
- if ((i == null ? void 0 : i.target) instanceof HTMLElement) {
189
- const a = i.target.closest("[data-setting-id]");
190
- if (a) {
191
- const o = a.getAttribute("data-setting-id");
192
- typeof o == "string" && (n = o);
193
- }
171
+ setOnBlur(t) {
172
+ return this.onBlur = t, this.pendingBlurHandler = t, this.handleBlur = (e) => {
173
+ (e == null ? void 0 : e.target) instanceof HTMLElement && e.target.closest(".setting-group") !== this.elementRef || (this.blurTimeout && clearTimeout(this.blurTimeout), this.blurTimeout = setTimeout(() => {
174
+ t();
175
+ }, 100));
176
+ }, this.elementRef && this.setupBlurHandlers(), this;
177
+ }
178
+ setupBlurHandlers() {
179
+ this.elementRef && this.elementRef.removeEventListener("focusout", this.handleBlur), this.elementRef && this.elementRef.addEventListener("focusout", this.handleBlur, !0), M(this.settings, (t, e) => {
180
+ var i;
181
+ if (e instanceof w)
182
+ e.setOnBlur(this.handleBlur);
183
+ else {
184
+ const s = (i = this.elementRef) == null ? void 0 : i.querySelector(`[data-setting-id="${e.id}"]`);
185
+ s && s.addEventListener("focusout", this.handleBlur, !0);
194
186
  }
195
- this.blurTimeout && clearTimeout(this.blurTimeout), this.blurTimeout = setTimeout(() => {
196
- try {
197
- this.saveChangesImmediately();
198
- const a = this.getValues();
199
- (this.activeSettingId === null && n !== null || n === null && this.activeSettingId !== null || this.activeSettingId !== n || this.hasValueChanged) && this.onBlur && (this.onBlur(a || {}), this.hasValueChanged = !1), this.activeSettingId = n;
200
- } catch (a) {
201
- console.error("Error in blur handler:", a), this.hasValueChanged = !1, this.activeSettingId = null;
202
- }
203
- }, this.blurDebounceTime);
204
- }, this.elementRef && this.setupFocusHandlers(), this;
205
- }
206
- hasFocusWithin() {
207
- if (!this.elementRef) return !1;
208
- const t = document.activeElement;
209
- return this.elementRef.contains(t) || this.hasFocus;
210
- }
211
- setupFocusHandlers() {
212
- if (!this.elementRef || !this.focusTrackingEnabled) return;
213
- this.elementRef.removeEventListener("focusout", this.handleBlur), this.elementRef.removeEventListener("change", this.handleChange), this.elementRef.removeEventListener("input", this.handleChange), this.elementRef.addEventListener("focusout", this.handleBlur), this.elementRef.addEventListener("change", this.handleChange), this.elementRef.addEventListener("input", this.handleChange);
214
- const t = this.elementRef.closest("form");
215
- t && (t.removeEventListener("submit", this.handleBlur), t.addEventListener("submit", this.handleBlur)), document.addEventListener("visibilitychange", () => {
216
- document.visibilityState === "hidden" && this.elementRef && document.activeElement && this.elementRef.contains(document.activeElement) && this.handleBlur();
217
187
  });
218
188
  }
189
+ // Clean up method to be called when the group is destroyed
219
190
  cleanup() {
220
- if (this.changeTimeout && (clearTimeout(this.changeTimeout), this.changeTimeout = null), this.blurTimeout && (clearTimeout(this.blurTimeout), this.blurTimeout = null), this.elementRef) {
221
- this.elementRef.removeEventListener("focusout", this.handleBlur), this.elementRef.removeEventListener("change", this.handleChange), this.elementRef.removeEventListener("input", this.handleChange);
222
- const t = this.elementRef.closest("form");
223
- t && t.removeEventListener("submit", this.handleBlur);
224
- }
225
- document.removeEventListener("visibilitychange", () => {
226
- document.visibilityState === "hidden" && this.elementRef && document.activeElement && this.elementRef.contains(document.activeElement) && this.handleBlur();
227
- }), M(this.settings, (t, e) => {
228
- typeof e.cleanup == "function" && e.cleanup();
229
- }), this.changeHandlers.clear(), this.activeSettingId = null, this.hasValueChanged = !1;
191
+ this.changeTimeout && (clearTimeout(this.changeTimeout), this.changeTimeout = null), this.blurTimeout && (clearTimeout(this.blurTimeout), this.blurTimeout = null), this.elementRef && this.elementRef.removeEventListener("focusout", this.handleBlur), this.changeHandlers.clear();
230
192
  }
193
+ // Add the clone method here
231
194
  clone() {
232
195
  const t = {};
233
196
  M(this.settings, (n, a) => {
@@ -236,12 +199,17 @@ const E = class E {
236
199
  const e = {
237
200
  title: this.title,
238
201
  settings: t,
202
+ // Cast needed as we build it dynamically
239
203
  description: this.description,
240
204
  icon: this.icon,
241
205
  collapsed: this.isCollapsed,
242
206
  main: this.isMain,
243
207
  custom: this.custom,
244
208
  hideCondition: this.hideCondition
209
+ // Note: Cloning event handlers (onBlur, onChange) is complex and often not desired.
210
+ // The new clone will typically need its own handlers set up.
211
+ // We intentionally do not copy onBlur or onChange here.
212
+ // id is generated anew in the constructor
245
213
  }, i = this.constructor, s = new i(e);
246
214
  return s.initialValues = this.getValues(), s;
247
215
  }
@@ -262,27 +230,22 @@ const E = class E {
262
230
  this.elementRef && (this.elementRef.style.display = "", this.isHidden = !1);
263
231
  }
264
232
  getValues(t) {
265
- try {
266
- if (t === void 0) {
267
- const e = {};
268
- for (const i in this.settings)
269
- if (this.settings.hasOwnProperty(i)) {
270
- const s = this.settings[i];
271
- if (!s) continue;
272
- s instanceof E ? e[i] = s.getValues() : typeof s.value < "u" && (e[i] = s.value);
273
- }
274
- return e;
275
- } else {
276
- const e = this.settings[t];
277
- return e ? (this.isInteracting && typeof t == "string" && this.modifiedSettings.add(t), e instanceof E ? e.getValues() : typeof e.value < "u" ? e.value : void 0) : void 0;
278
- }
279
- } catch (e) {
280
- return console.error("Error in getValues:", e), {};
233
+ if (t === void 0) {
234
+ const e = {};
235
+ for (const i in this.settings)
236
+ if (this.settings.hasOwnProperty(i)) {
237
+ const s = this.settings[i];
238
+ s instanceof w ? e[i] = s.getValues() : e[i] = s.value;
239
+ }
240
+ return e;
241
+ } else {
242
+ const e = this.settings[t];
243
+ return e ? e instanceof w ? e.getValues() : e.value : void 0;
281
244
  }
282
245
  }
283
246
  draw() {
284
247
  const t = document.createElement("div");
285
- t.className = "setting-group", t.id = `setting-group-${this.id}`, E.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group");
248
+ t.className = "setting-group", t.id = `setting-group-${this.id}`, w.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group");
286
249
  const e = document.createElement("div");
287
250
  e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
288
251
  "aria-expanded",
@@ -290,21 +253,21 @@ const E = class E {
290
253
  ), e.setAttribute("tabindex", "0");
291
254
  const i = document.createElement("div");
292
255
  if (i.className = "title-section", this.icon) {
293
- const h = document.createElement("span");
294
- h.className = "group-icon", h.innerHTML = this.icon, i.appendChild(h);
256
+ const r = document.createElement("span");
257
+ r.className = "group-icon", r.innerHTML = this.icon, i.appendChild(r);
295
258
  }
296
259
  this.custom && t.classList.add("custom_class");
297
260
  const s = document.createElement("h3");
298
261
  s.textContent = this.title, i.appendChild(s);
299
262
  const n = document.createElement("div");
300
263
  if (n.className = "actions-section", this.description && this.isCollapsed) {
301
- const h = document.createElement("span");
302
- h.className = "info-marker", h.innerHTML = `
264
+ const r = document.createElement("span");
265
+ r.className = "info-marker", r.innerHTML = `
303
266
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
304
267
  <path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
305
268
  stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
306
269
  </svg>
307
- `, h.title = this.description, n.appendChild(h);
270
+ `, r.title = this.description, n.appendChild(r);
308
271
  }
309
272
  const a = document.createElement("span");
310
273
  a.className = "setting-group-arrow", a.innerHTML = `
@@ -314,20 +277,20 @@ const E = class E {
314
277
  `, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
315
278
  const o = document.createElement("div");
316
279
  if (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"), this.description && !this.isCollapsed) {
317
- const h = document.createElement("div");
318
- h.className = "setting-group-description", h.textContent = this.description, o.appendChild(h);
280
+ const r = document.createElement("div");
281
+ r.className = "setting-group-description", r.textContent = this.description, o.appendChild(r);
319
282
  }
320
283
  const l = () => {
321
284
  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(
322
285
  "aria-expanded",
323
286
  (!this.isCollapsed).toString()
324
287
  );
325
- const h = o.querySelector(
288
+ const r = o.querySelector(
326
289
  ".setting-group-description"
327
- ), p = n.querySelector(".info-marker");
290
+ ), u = n.querySelector(".info-marker");
328
291
  if (this.description)
329
292
  if (this.isCollapsed) {
330
- if (h && h.remove(), !p) {
293
+ if (r && r.remove(), !u) {
331
294
  const d = document.createElement("span");
332
295
  d.className = "info-marker", d.innerHTML = `
333
296
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -337,29 +300,29 @@ const E = class E {
337
300
  `, d.title = this.description, n.insertBefore(d, a);
338
301
  }
339
302
  } else {
340
- if (!h) {
303
+ if (!r) {
341
304
  const d = document.createElement("div");
342
305
  d.className = "setting-group-description", d.textContent = this.description, o.insertBefore(
343
306
  d,
344
307
  o.firstChild
345
308
  );
346
309
  }
347
- p && p.remove();
310
+ u && u.remove();
348
311
  }
349
312
  };
350
- if (e.onclick = l, e.onkeydown = (h) => {
351
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), l());
313
+ if (e.onclick = l, e.onkeydown = (r) => {
314
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), l());
352
315
  }, Object.keys(this.settings).length > 0) {
353
- for (const h in this.settings)
354
- if (this.settings.hasOwnProperty(h)) {
355
- const p = this.settings[h];
356
- o.appendChild(p.draw());
316
+ for (const r in this.settings)
317
+ if (this.settings.hasOwnProperty(r)) {
318
+ const u = this.settings[r];
319
+ o.appendChild(u.draw());
357
320
  }
358
321
  } else {
359
- const h = document.createElement("div");
360
- h.className = "setting-group-empty", h.textContent = "No settings in this group", o.appendChild(h);
322
+ const r = document.createElement("div");
323
+ r.className = "setting-group-empty", r.textContent = "No settings in this group", o.appendChild(r);
361
324
  }
362
- return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, this.pendingBlurHandler && (this.setupFocusHandlers(), this.pendingBlurHandler = null), t;
325
+ return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
363
326
  }
364
327
  collapse() {
365
328
  if (!this.elementRef || this.isCollapsed) return;
@@ -385,17 +348,10 @@ const E = class E {
385
348
  toggle() {
386
349
  this.isHidden ? this.show() : this.hide();
387
350
  }
388
- // Force save changes immediately without debounce
389
- saveChangesImmediately() {
390
- if (!this.onChange) return;
391
- this.changeTimeout && (clearTimeout(this.changeTimeout), this.changeTimeout = null);
392
- const t = this.getValues(), e = this.calculateChanges(this.initialValues, t);
393
- Object.keys(e).length > 0 && (this.initialValues = t, this.onChange(t), this.updateVisibility());
394
- }
395
351
  };
396
- E.hiddenElements = /* @__PURE__ */ new Set();
397
- let f = E;
398
- class H extends m {
352
+ w.hiddenElements = /* @__PURE__ */ new Set();
353
+ let f = w;
354
+ class S extends m {
399
355
  constructor(t = {}) {
400
356
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
401
357
  }
@@ -416,13 +372,13 @@ class H extends m {
416
372
  }
417
373
  }
418
374
  const I = "<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>";
419
- class O extends H {
375
+ class O extends S {
420
376
  constructor(t) {
421
377
  super({
422
378
  ...t,
423
379
  icon: t.icon || I,
424
380
  title: t.title || "Color"
425
- }), this.inputType = "color", this.detectChange = t.detectChange;
381
+ }), this.inputType = "color", this.element = null, this.detectChange = t.detectChange;
426
382
  }
427
383
  hexToRgb(t) {
428
384
  t = t.replace("#", "");
@@ -440,7 +396,7 @@ class O extends H {
440
396
  }
441
397
  draw() {
442
398
  const t = document.createElement("div");
443
- t.className = "color-setting-wrapper";
399
+ t.className = "color-setting-wrapper", this.element = t;
444
400
  const e = document.createElement("div");
445
401
  e.className = "icon-container";
446
402
  const i = this.createIcon(this.props.icon || I), s = this.createLabel(this.title || "Color");
@@ -448,43 +404,40 @@ class O extends H {
448
404
  const n = document.createElement("div");
449
405
  n.className = "color-input-wrapper";
450
406
  const a = (d) => {
451
- const u = d.value.split(",").map((N) => parseInt(N.trim()));
452
- if (u.length !== 3 || u.some(isNaN))
407
+ const g = d.value.split(",").map((N) => parseInt(N.trim()));
408
+ if (g.length !== 3 || g.some(isNaN))
453
409
  return d.style.border = "1px solid red", !1;
454
- const [g, C, v] = u, y = g >= 0 && g <= 255 && C >= 0 && C <= 255 && v >= 0 && v <= 255;
455
- return d.style.border = y ? "" : "1px solid red", y;
410
+ const [p, C, v] = g, L = p >= 0 && p <= 255 && C >= 0 && C <= 255 && v >= 0 && v <= 255;
411
+ return d.style.border = L ? "" : "1px solid red", L;
456
412
  }, o = document.createElement("div");
457
- o.className = "color-preview", o.style.backgroundColor = typeof this.value == "string" && this.value ? `rgb(${this.value})` : "";
413
+ o.className = "color-preview", o.style.backgroundColor = this.value ? `rgb(${this.value})` : "";
458
414
  const l = this.createInput({
459
- value: typeof this.value == "string" ? this.value : "",
415
+ value: this.value,
460
416
  inputType: "text",
461
417
  inputClassName: "color-text-input"
462
- }), r = l.querySelector("input");
463
- r.readOnly = !0;
464
- const h = this.createInput({
465
- value: typeof this.value == "string" ? this.rgbToHex(this.value) : "#000000",
418
+ }), h = l.querySelector("input");
419
+ h.readOnly = !0;
420
+ const r = this.createInput({
421
+ value: this.value ? this.rgbToHex(this.value) : "",
466
422
  inputType: this.inputType,
467
423
  inputClassName: "color-picker"
468
- }), p = h.querySelector("input");
469
- if (r.oninput = (d) => {
470
- var g;
471
- let u = d.target.value.trim();
472
- a(r) && (this.value = u, (g = this.onChange) == null || g.call(this, u), p.value = this.rgbToHex(u), o.style.backgroundColor = `rgb(${u})`);
473
- }, p.oninput = (d) => {
424
+ }), u = r.querySelector("input");
425
+ return h.oninput = (d) => {
426
+ var p;
427
+ let g = d.target.value.trim();
428
+ a(h) && (this.value = g, (p = this.onChange) == null || p.call(this, g), u.value = this.rgbToHex(g), o.style.backgroundColor = `rgb(${g})`);
429
+ }, u.oninput = (d) => {
474
430
  var C, v;
475
- const u = d.target.value, g = this.hexToRgb(u);
476
- this.value = g, (C = this.onChange) == null || C.call(this, g), (v = this.detectChange) == null || v.call(this, g), r.value = g, o.style.backgroundColor = `rgb(${g})`;
477
- }, p.onchange = (d) => {
431
+ const g = d.target.value, p = this.hexToRgb(g);
432
+ this.value = p, (C = this.onChange) == null || C.call(this, p), (v = this.detectChange) == null || v.call(this, p), h.value = p, o.style.backgroundColor = `rgb(${p})`;
433
+ }, u.onchange = (d) => {
478
434
  var C, v;
479
- const u = d.target.value, g = this.hexToRgb(u);
480
- this.value = g, (C = this.onChange) == null || C.call(this, g), (v = this.detectChange) == null || v.call(this, g), r.value = g, o.style.backgroundColor = `rgb(${g})`;
481
- }, n.appendChild(o), n.appendChild(h), n.appendChild(l), t.appendChild(e), t.appendChild(n), typeof this.value == "string" && this.value.includes(","))
482
- r.value = this.value, p.value = this.rgbToHex(this.value), o.style.backgroundColor = `rgb(${this.value})`;
483
- else {
484
- let d = "", u = "#000000";
485
- typeof this.value == "string" ? (d = this.value, u = this.rgbToHex(this.value)) : this.value !== void 0 ? (console.warn(`ColorSetting: Initial value "${this.value}" (type: ${typeof this.value}) is not a string. Displaying default color.`), d = "0,0,0", u = this.rgbToHex(d)) : (d = "", u = "#000000"), r.value = d, p.value = u, o.style.backgroundColor = d ? `rgb(${d})` : "";
486
- }
487
- return t;
435
+ const g = d.target.value, p = this.hexToRgb(g);
436
+ this.value = p, (C = this.onChange) == null || C.call(this, p), (v = this.detectChange) == null || v.call(this, p), h.value = p, o.style.backgroundColor = `rgb(${p})`;
437
+ }, n.appendChild(o), n.appendChild(r), n.appendChild(l), t.appendChild(e), t.appendChild(n), this.value && (h.value = this.value, u.value = this.rgbToHex(this.value), o.style.backgroundColor = `rgb(${this.value})`), t;
438
+ }
439
+ getElement() {
440
+ return this.element;
488
441
  }
489
442
  }
490
443
  class b extends m {
@@ -537,7 +490,7 @@ class b extends m {
537
490
  this.props.minValue !== void 0 && (this.props.default ?? 0) < this.props.minValue && console.warn(`Default value ${this.props.default} is less than minValue ${this.props.minValue}`), this.props.maxValue !== void 0 && (this.props.default ?? 0) > this.props.maxValue && console.warn(`Default value ${this.props.default} is greater than maxValue ${this.props.maxValue}`);
538
491
  }
539
492
  }
540
- const _ = `
493
+ const $ = `
541
494
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
542
495
  <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"/>
543
496
  <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"/>
@@ -551,7 +504,7 @@ class T extends b {
551
504
  maxValue: 100,
552
505
  step: 1,
553
506
  default: t.default ?? 100,
554
- icon: _,
507
+ icon: $,
555
508
  ...t
556
509
  };
557
510
  super(e), this.inputType = "number", this.mobileValue = t.mobile;
@@ -616,8 +569,8 @@ class B extends m {
616
569
  selectOption(t, e, i) {
617
570
  var n, a, o;
618
571
  const s = this._options[e];
619
- s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((r, h) => {
620
- h === e ? r.classList.add("selected") : r.classList.remove("selected");
572
+ s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((h, r) => {
573
+ r === e ? h.classList.add("selected") : h.classList.remove("selected");
621
574
  }));
622
575
  }
623
576
  updateOptionsList() {
@@ -715,7 +668,7 @@ class lt extends m {
715
668
  return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
716
669
  }
717
670
  }
718
- class ht extends m {
671
+ class rt extends m {
719
672
  constructor(t = {}) {
720
673
  super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
721
674
  const e = t.width || 0, i = t.height || 0;
@@ -735,7 +688,7 @@ class ht extends m {
735
688
  suffix: "px",
736
689
  minValue: this.minHeight,
737
690
  maxValue: this.maxHeight,
738
- icon: D
691
+ icon: q
739
692
  }), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
740
693
  }
741
694
  handleWidthChange(t) {
@@ -829,18 +782,18 @@ class ht extends m {
829
782
  }
830
783
  const G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
831
784
  <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"/>
832
- </svg>`, D = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
785
+ </svg>`, q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
833
786
  <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"/>
834
- </svg>`, S = `
787
+ </svg>`, H = `
835
788
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
836
789
  <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"/>
837
790
  </svg>
838
- `, F = `
791
+ `, D = `
839
792
  <svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
840
793
  <rect width="91" height="71" rx="4" fill="#F2F4F7"/>
841
794
  <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"/>
842
795
  </svg>
843
- `, q = `
796
+ `, F = `
844
797
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
845
798
  <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"/>
846
799
  </svg>
@@ -853,29 +806,29 @@ class U extends m {
853
806
  if (!this.previewWrapper || !this.previewEl) return;
854
807
  const e = this.previewWrapper.parentElement, i = e == null ? void 0 : e.querySelector(".upload-button"), s = e == null ? void 0 : e.querySelector(".preview-placeholder");
855
808
  t && t !== "" ? (this.previewWrapper.classList.add("has-image"), this.previewEl.src = t, this.previewWrapper.style.display = "block", this.previewEl.style.display = "block", s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
856
- <span class="upload-icon">${S}</span>
809
+ <span class="upload-icon">${H}</span>
857
810
  <span class="upload-label">Replace</span>
858
811
  `)) : (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 = `
859
- <span class="upload-icon">${S}</span>
812
+ <span class="upload-icon">${H}</span>
860
813
  <span class="upload-label">Upload</span>
861
814
  `));
862
815
  }
863
816
  draw() {
864
817
  const t = document.createElement("div");
865
818
  t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener("focusout", (l) => {
866
- var r;
867
- l.relatedTarget && t.contains(l.relatedTarget) || (r = this.onBlur) == null || r.call(this);
819
+ var h;
820
+ l.relatedTarget && t.contains(l.relatedTarget) || (h = this.onBlur) == null || h.call(this);
868
821
  }, !0);
869
822
  const e = !!(this.props.title || this.props.icon);
870
823
  if (e || t.classList.add("no-label"), e) {
871
824
  const l = document.createElement("div");
872
825
  if (l.className = "icon-title-container", this.props.icon) {
873
- const r = this.createIcon(this.props.icon);
874
- l.appendChild(r);
826
+ const h = this.createIcon(this.props.icon);
827
+ l.appendChild(h);
875
828
  }
876
829
  if (this.props.title) {
877
- const r = this.createLabel(this.props.title);
878
- l.appendChild(r);
830
+ const h = this.createLabel(this.props.title);
831
+ l.appendChild(h);
879
832
  }
880
833
  t.appendChild(l);
881
834
  }
@@ -884,49 +837,49 @@ class U extends m {
884
837
  const s = this.value && this.value !== "";
885
838
  s || i.classList.add("no-image");
886
839
  const n = document.createElement("div");
887
- if (n.className = "preview-placeholder", n.innerHTML = F, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
840
+ if (n.className = "preview-placeholder", n.innerHTML = D, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
888
841
  const l = document.createElement("button");
889
- l.className = "delete-button", l.type = "button", l.title = "Delete image", l.innerHTML = q, this.previewWrapper.appendChild(l), l.onclick = (r) => {
890
- var h;
891
- r.stopPropagation(), this.value = "", o.value = "", this.updatePreviewState(null), (h = this.onChange) == null || h.call(this, "");
842
+ l.className = "delete-button", l.type = "button", l.title = "Delete image", l.innerHTML = F, this.previewWrapper.appendChild(l), l.onclick = (h) => {
843
+ var r;
844
+ h.stopPropagation(), this.value = "", o.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, "");
892
845
  };
893
846
  }
894
847
  this.previewWrapper.appendChild(this.previewEl);
895
848
  const a = document.createElement("button");
896
849
  a.className = "upload-button", a.innerHTML = `
897
- <span class="upload-icon">${S}</span>
850
+ <span class="upload-icon">${H}</span>
898
851
  <span class="upload-label">Upload</span>
899
852
  `;
900
853
  const o = document.createElement("input");
901
854
  return o.type = "file", o.accept = "image/*", o.style.display = "none", i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), t.appendChild(o), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
902
855
  o.click();
903
856
  }, o.onchange = async () => {
904
- var r, h, p, d;
905
- const l = (r = o.files) == null ? void 0 : r[0];
857
+ var h, r, u, d;
858
+ const l = (h = o.files) == null ? void 0 : h[0];
906
859
  if (l)
907
860
  try {
908
861
  a.classList.add("loading"), a.disabled = !0;
909
- const u = new FormData(), g = this.props.formFieldName || "file";
910
- u.append(g, l, l.name);
862
+ const g = new FormData(), p = this.props.formFieldName || "file";
863
+ g.append(p, l, l.name);
911
864
  const C = this.props.uploadUrl;
912
865
  if (!C)
913
866
  throw new Error("No uploadUrl provided to UploadSetting.");
914
- const v = this.props.requestMethod || "POST", y = { ...this.props.requestHeaders || {} }, k = await (await fetch(C, {
867
+ const v = this.props.requestMethod || "POST", L = { ...this.props.requestHeaders || {} }, k = await (await fetch(C, {
915
868
  method: v,
916
- body: u,
917
- headers: y
869
+ body: g,
870
+ headers: L
918
871
  })).json();
919
872
  console.log("Upload response:", k);
920
- let w;
873
+ let x;
921
874
  if (this.props.parseResponse)
922
- w = this.props.parseResponse(k);
923
- else if (w = (h = k == null ? void 0 : k.data) == null ? void 0 : h.url, !w)
875
+ x = this.props.parseResponse(k);
876
+ else if (x = (r = k == null ? void 0 : k.data) == null ? void 0 : r.url, !x)
924
877
  throw new Error(
925
878
  "No URL found in response. Provide a parseResponse if needed."
926
879
  );
927
- console.log("Final URL:", w), this.value = w, this.updatePreviewState(w), (p = this.onChange) == null || p.call(this, w), (d = this.onBlur) == null || d.call(this);
928
- } catch (u) {
929
- console.error("Error uploading file:", u);
880
+ console.log("Final URL:", x), this.value = x, this.updatePreviewState(x), (u = this.onChange) == null || u.call(this, x), (d = this.onBlur) == null || d.call(this);
881
+ } catch (g) {
882
+ console.error("Error uploading file:", g);
930
883
  } finally {
931
884
  a.classList.remove("loading"), a.disabled = !1, o.value = "";
932
885
  }
@@ -935,7 +888,7 @@ class U extends m {
935
888
  }, t;
936
889
  }
937
890
  }
938
- class rt extends b {
891
+ class ht extends b {
939
892
  // Store mobile value
940
893
  constructor(t = {}) {
941
894
  const e = {
@@ -1044,7 +997,7 @@ class dt extends m {
1044
997
  const a = new Set(this._options.map((l) => JSON.stringify(l.value))), o = n.filter((l) => !a.has(JSON.stringify(l.value)));
1045
998
  if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
1046
999
  const l = this._options.findIndex(
1047
- (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1000
+ (h) => JSON.stringify(h.value) === JSON.stringify(this.value)
1048
1001
  );
1049
1002
  this.selectedOptionIndex = l !== -1 ? l : null;
1050
1003
  } else
@@ -1056,7 +1009,7 @@ class dt extends m {
1056
1009
  const a = new Set(this._options.map((l) => JSON.stringify(l.value))), o = n.filter((l) => !a.has(JSON.stringify(l.value)));
1057
1010
  if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
1058
1011
  const l = this._options.findIndex(
1059
- (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1012
+ (h) => JSON.stringify(h.value) === JSON.stringify(this.value)
1060
1013
  );
1061
1014
  this.selectedOptionIndex = l !== -1 ? l : null;
1062
1015
  } else
@@ -1067,7 +1020,7 @@ class dt extends m {
1067
1020
  })), t;
1068
1021
  }
1069
1022
  selectApiOption(t, e, i) {
1070
- var l, r, h, p;
1023
+ var l, h, r, u;
1071
1024
  const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
1072
1025
  n && (n.checked = !0), this.selectedOptionIndex = e;
1073
1026
  const a = this._options[e].value;
@@ -1079,7 +1032,7 @@ class dt extends m {
1079
1032
  const d = i.firstChild;
1080
1033
  d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
1081
1034
  }
1082
- this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (p = this.onChange) == null || p.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
1035
+ this.isOpen = !1, (h = this.optionsListEl) == null || h.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (u = this.onChange) == null || u.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
1083
1036
  }
1084
1037
  updateOptionsList() {
1085
1038
  !this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
@@ -1135,19 +1088,19 @@ class ut extends m {
1135
1088
  i.className = "toggle-switch";
1136
1089
  const s = document.createElement("input");
1137
1090
  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, s.addEventListener("change", () => {
1138
- var r, h;
1139
- const l = ((h = (r = this.props.options) == null ? void 0 : r.find((p) => p.status === s.checked)) == null ? void 0 : h.value) ?? "";
1091
+ var h, r;
1092
+ const l = ((r = (h = this.props.options) == null ? void 0 : h.find((u) => u.status === s.checked)) == null ? void 0 : r.value) ?? "";
1140
1093
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
1141
1094
  });
1142
1095
  const n = document.createElement("span");
1143
1096
  if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
1144
- const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50", h = this.props.inactiveColor || "#ccc";
1097
+ const l = document.createElement("style"), h = this.props.activeColor || "#4CAF50", r = this.props.inactiveColor || "#ccc";
1145
1098
  l.textContent = `
1146
1099
  .toggle-switch input:checked + .toggle-slider {
1147
- background-color: ${r};
1100
+ background-color: ${h};
1148
1101
  }
1149
1102
  .toggle-switch .toggle-slider {
1150
- background-color: ${h};
1103
+ background-color: ${r};
1151
1104
  }
1152
1105
  `, document.head.appendChild(l);
1153
1106
  }
@@ -1192,10 +1145,10 @@ class pt extends m {
1192
1145
  let o = parseFloat(a.value);
1193
1146
  o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
1194
1147
  }), s.addEventListener("blur", (n) => {
1195
- var l, r;
1148
+ var l, h;
1196
1149
  const a = n.target;
1197
1150
  let o = parseFloat(a.value);
1198
- 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);
1151
+ o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (h = (l = this.props).onBlur) == null || h.call(l);
1199
1152
  }), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
1200
1153
  const n = document.createElement("span");
1201
1154
  n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
@@ -1212,7 +1165,7 @@ class pt extends m {
1212
1165
  return this.mobileValue;
1213
1166
  }
1214
1167
  }
1215
- class x extends f {
1168
+ class E extends f {
1216
1169
  // ms
1217
1170
  constructor(t) {
1218
1171
  var o;
@@ -1237,7 +1190,7 @@ class x extends f {
1237
1190
  tabs: this.tabValues,
1238
1191
  activeTabId: this.activeTabId
1239
1192
  }, Object.values(e.settings).forEach((i) => {
1240
- i instanceof x && (i._parentTabsSettings = this);
1193
+ i instanceof E && (i._parentTabsSettings = this);
1241
1194
  }), this.connectChildChangeHandlers());
1242
1195
  }
1243
1196
  /**
@@ -1265,7 +1218,7 @@ class x extends f {
1265
1218
  });
1266
1219
  }), this.tabs.forEach((e) => {
1267
1220
  Object.entries(e.settings).forEach(([i, s]) => {
1268
- (s instanceof f || s instanceof m) && (s instanceof x ? (s._parentTabsSettings = this, s.setOnChange((n) => {
1221
+ (s instanceof f || s instanceof m) && (s instanceof E ? (s._parentTabsSettings = this, s.setOnChange((n) => {
1269
1222
  Promise.resolve().then(() => {
1270
1223
  this.tabValues[e.id] = this.getTabValues(e), this.triggerDebouncedChange();
1271
1224
  });
@@ -1295,21 +1248,21 @@ class x extends f {
1295
1248
  handleTabClick(t) {
1296
1249
  var o, l;
1297
1250
  if (t === this.activeTabId) return;
1298
- const e = this.tabs.find((r) => r.id === this.activeTabId);
1251
+ const e = this.tabs.find((h) => h.id === this.activeTabId);
1299
1252
  e && (this.tabValues[this.activeTabId] = this.getTabValues(e)), this.previousTabId = this.activeTabId, this.activeTabId = t;
1300
1253
  const i = (o = this.tabsContainer) == null ? void 0 : o.querySelectorAll(".tab-button");
1301
- i == null || i.forEach((r) => {
1302
- if (r instanceof HTMLElement) {
1303
- const h = this.tabs.find((p) => p.label === r.textContent);
1304
- r.classList.toggle("active", (h == null ? void 0 : h.id) === t);
1254
+ i == null || i.forEach((h) => {
1255
+ if (h instanceof HTMLElement) {
1256
+ const r = this.tabs.find((u) => u.label === h.textContent);
1257
+ h.classList.toggle("active", (r == null ? void 0 : r.id) === t);
1305
1258
  }
1306
1259
  }), this.updateSettingsFromTab(t);
1307
1260
  const s = (l = this.container) == null ? void 0 : l.querySelector(".setting-group-content");
1308
1261
  if (s) {
1309
1262
  s.innerHTML = "";
1310
- const r = this.settings;
1311
- Object.values(r).forEach((h) => {
1312
- s.appendChild(h.draw());
1263
+ const h = this.settings;
1264
+ Object.values(h).forEach((r) => {
1265
+ s.appendChild(r.draw());
1313
1266
  });
1314
1267
  }
1315
1268
  const n = this.getValues();
@@ -1375,7 +1328,7 @@ class x extends f {
1375
1328
  activeTabId: this.activeTabId
1376
1329
  }, this.tabs.forEach((t) => {
1377
1330
  Object.values(t.settings).forEach((e) => {
1378
- e instanceof x && e.updateInitialValues();
1331
+ e instanceof E && e.updateInitialValues();
1379
1332
  });
1380
1333
  }));
1381
1334
  }
@@ -1399,7 +1352,7 @@ class x extends f {
1399
1352
  getTabValues(t) {
1400
1353
  const e = {};
1401
1354
  return Object.entries(t.settings).forEach(([i, s]) => {
1402
- s instanceof x || s instanceof f ? e[i] = s.getValues() : (s instanceof m, e[i] = s.value);
1355
+ s instanceof E || s instanceof f ? e[i] = s.getValues() : (s instanceof m, e[i] = s.value);
1403
1356
  }), e;
1404
1357
  }
1405
1358
  /**
@@ -1427,7 +1380,7 @@ class x extends f {
1427
1380
  settings: {}
1428
1381
  // We don't clone callbacks - they should be set up again on the clone
1429
1382
  };
1430
- return new x(e);
1383
+ return new E(e);
1431
1384
  }
1432
1385
  /**
1433
1386
  * Override setValue method to update the TabsSettings state
@@ -1625,7 +1578,7 @@ class ft extends f {
1625
1578
  `;
1626
1579
  }
1627
1580
  }
1628
- class L extends m {
1581
+ class V extends m {
1629
1582
  constructor(t) {
1630
1583
  super({
1631
1584
  ...t,
@@ -1635,9 +1588,9 @@ class L extends m {
1635
1588
  draw() {
1636
1589
  const t = this.value === "auto" ? "text" : "number", e = (o) => {
1637
1590
  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", () => {
1638
- const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, r = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
1639
- let h = Number(o.value);
1640
- h < l && (h = l), h > r && (h = r), o.value = String(h);
1591
+ const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, h = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
1592
+ let r = Number(o.value);
1593
+ r < l && (r = l), r > h && (r = h), o.value = String(r);
1641
1594
  }));
1642
1595
  }, i = this.createInput({
1643
1596
  value: this.value,
@@ -1664,8 +1617,8 @@ class L extends m {
1664
1617
  if (l.toLowerCase() === "auto")
1665
1618
  this.value = "auto";
1666
1619
  else {
1667
- const r = Number(l);
1668
- isNaN(r) || (this.value = r);
1620
+ const h = Number(l);
1621
+ isNaN(h) || (this.value = h);
1669
1622
  }
1670
1623
  this.onChange && this.onChange(this.value);
1671
1624
  }), i;
@@ -1678,25 +1631,25 @@ class Ct extends f {
1678
1631
  collapsed: t == null ? void 0 : t.collapsed,
1679
1632
  hideCondition: t == null ? void 0 : t.hideCondition,
1680
1633
  settings: {
1681
- marginTop: new L({
1634
+ marginTop: new V({
1682
1635
  title: "Top",
1683
1636
  icon: it,
1684
1637
  suffix: "px",
1685
1638
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
1686
1639
  }),
1687
- marginRight: new L({
1640
+ marginRight: new V({
1688
1641
  title: "Right",
1689
1642
  icon: st,
1690
1643
  suffix: "px",
1691
1644
  default: (t == null ? void 0 : t.marginRight) ?? 0
1692
1645
  }),
1693
- marginBottom: new L({
1646
+ marginBottom: new V({
1694
1647
  title: "Bottom",
1695
1648
  icon: nt,
1696
1649
  suffix: "px",
1697
1650
  default: (t == null ? void 0 : t.marginBottom) ?? 0
1698
1651
  }),
1699
- marginLeft: new L({
1652
+ marginLeft: new V({
1700
1653
  title: "Left",
1701
1654
  icon: at,
1702
1655
  suffix: "px",
@@ -1731,11 +1684,11 @@ class ot extends f {
1731
1684
  hideCondition: i == null ? void 0 : i.hideCondition,
1732
1685
  collapsed: i == null ? void 0 : i.collapsed,
1733
1686
  settings: {
1734
- name: new H({
1687
+ name: new S({
1735
1688
  title: "Tab Name",
1736
1689
  default: `Tab ${t + 1}`
1737
1690
  }),
1738
- content: new H({
1691
+ content: new S({
1739
1692
  title: "Content",
1740
1693
  default: ""
1741
1694
  })
@@ -1917,10 +1870,10 @@ export {
1917
1870
  mt as BorderSettingSet,
1918
1871
  lt as ButtonSetting,
1919
1872
  O as ColorSetting,
1920
- ht as DimensionSetting,
1873
+ rt as DimensionSetting,
1921
1874
  pt as GapSetting,
1922
1875
  ft as HeaderTypographySettingSet,
1923
- rt as HeightSetting,
1876
+ ht as HeightSetting,
1924
1877
  gt as MarginBottomSetting,
1925
1878
  Ct as MarginSettingGroup,
1926
1879
  b as NumberSetting,
@@ -1929,9 +1882,9 @@ export {
1929
1882
  B as SelectSetting,
1930
1883
  m as Setting,
1931
1884
  f as SettingGroup,
1932
- H as StringSetting,
1885
+ S as StringSetting,
1933
1886
  vt as TabsContainerGroup,
1934
- x as TabsSettings,
1887
+ E as TabsSettings,
1935
1888
  ut as Toggle,
1936
1889
  U as UploadSetting,
1937
1890
  ct as WidthSetting,