@billgangcom/theme-lib 1.100.7 → 1.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as t, I as j, e as U, g as Ct, h as mt, i as pt, P as gt, S as lt, k as Pt, D as ft, l as xt, v as _t, B as dt, m as ot, a as wt, n as Tt, O as ht, o as J, q as yt, C as jt, r as V, t as At, w as Dt, x as bt, y as Et, z as It, A as W, L as Rt, E as St, F as vt, b as ct, s as at, f as Q, G as Lt, H as R, J as Ut, M as ut, K as Ht, N as rt, Q as zt, T as Mt, U as Ft, V as Bt, W as Vt } from "./index-Qq-gh3Zs.js";
2
- import { a2 as si, a6 as ni, a0 as ii, _ as ai, a5 as oi, a4 as ci, Z as ri, $ as li, X as di, Y as ui, a1 as hi, a3 as mi } from "./index-Qq-gh3Zs.js";
1
+ import { j as t, I as j, e as U, g as Ct, h as mt, i as pt, P as gt, S as lt, k as Pt, D as ft, l as xt, v as _t, B as dt, m as ot, a as wt, n as Tt, O as ht, o as J, q as yt, C as jt, r as V, t as At, w as Dt, x as bt, y as Et, z as It, A as W, L as Rt, E as St, F as vt, b as ct, s as at, f as Q, G as Lt, H as R, J as Ut, M as ut, K as Ht, N as rt, Q as zt, T as Mt, U as Ft, V as Bt, W as Vt } from "./index-j3ElqsZ4.js";
2
+ import { a2 as si, a6 as ni, a0 as ii, _ as ai, a5 as oi, a4 as ci, Z as ri, $ as li, X as di, Y as ui, a1 as hi, a3 as mi } from "./index-j3ElqsZ4.js";
3
3
  import f from "react";
4
4
  import "react-dom";
5
5
  const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23", Xt = "_alignmentContent_kh9z8_30", Qt = "_alignments_kh9z8_39", Jt = "_alignment_kh9z8_30", Kt = "_circle_kh9z8_64", Zt = "_paddings_kh9z8_71", te = "_padding_kh9z8_71", ee = "_active_kh9z8_97", G = {
@@ -62,7 +62,7 @@ const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23",
62
62
  return "AlignBottom";
63
63
  }
64
64
  }
65
- const [_, M] = f.useState(null), [I, r] = f.useState(null);
65
+ const [_, M] = f.useState(null), [N, r] = f.useState(null);
66
66
  return /* @__PURE__ */ t.jsxs("div", { className: G.layout, children: [
67
67
  /* @__PURE__ */ t.jsx("h3", { className: G.title, children: "Layout (for Desktop version)" }),
68
68
  /* @__PURE__ */ t.jsxs("div", { className: G.alignmentContent, children: [
@@ -112,7 +112,7 @@ const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23",
112
112
  "label",
113
113
  {
114
114
  className: U(G.padding, {
115
- [G.active]: I === l
115
+ [G.active]: N === l
116
116
  }),
117
117
  onFocus: () => {
118
118
  r(l);
@@ -201,7 +201,7 @@ const Un = (u) => {
201
201
  subtitle: g,
202
202
  draggable: _ = !1,
203
203
  withImage: M = !1,
204
- addable: I = !0,
204
+ addable: N = !0,
205
205
  itemsOptions: r,
206
206
  hasRangeSelector: l = !1,
207
207
  rangeSelectorOptions: y,
@@ -210,18 +210,18 @@ const Un = (u) => {
210
210
  deletable: a,
211
211
  aspectRatio: b,
212
212
  setAspectRatio: k
213
- } = u, A = mt(
213
+ } = u, q = mt(
214
214
  pt(gt, {
215
215
  activationConstraint: {
216
216
  distance: 5
217
217
  }
218
218
  })
219
219
  ), E = (i) => {
220
- const { active: N, over: P } = i;
221
- if (P && N.id !== P.id) {
222
- const q = s.findIndex((C) => C === N.id), $ = s.findIndex((C) => C === P.id);
223
- if (q !== -1 && $ !== -1) {
224
- const C = [...s], [Z] = C.splice(q, 1);
220
+ const { active: v, over: P } = i;
221
+ if (P && v.id !== P.id) {
222
+ const A = s.findIndex((C) => C === v.id), $ = s.findIndex((C) => C === P.id);
223
+ if (A !== -1 && $ !== -1) {
224
+ const C = [...s], [Z] = C.splice(A, 1);
225
225
  C.splice($, 0, Z), c(C);
226
226
  }
227
227
  }
@@ -246,10 +246,10 @@ const Un = (u) => {
246
246
  }
247
247
  );
248
248
  }
249
- const L = (i, N = !1) => {
249
+ const L = (i, v = !1) => {
250
250
  const P = r.find(($) => $.id === i);
251
251
  if (!P) return;
252
- const q = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
252
+ const A = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
253
253
  _ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
254
254
  j,
255
255
  {
@@ -265,7 +265,7 @@ const Un = (u) => {
265
265
  onChange: ($) => {
266
266
  const C = [...s], Z = r.find((p) => p.name === $);
267
267
  if (!Z) return;
268
- const v = Z.id, D = C.map((p) => p === i ? v : p);
268
+ const I = Z.id, D = C.map((p) => p === i ? I : p);
269
269
  c([...D]);
270
270
  },
271
271
  value: P.name,
@@ -276,7 +276,7 @@ const Un = (u) => {
276
276
  }))
277
277
  }
278
278
  ),
279
- N && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
279
+ v && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
280
280
  j,
281
281
  {
282
282
  name: "Trash",
@@ -292,14 +292,14 @@ const Un = (u) => {
292
292
  ge,
293
293
  {
294
294
  id: i,
295
- children: q
295
+ children: A
296
296
  },
297
297
  J()
298
298
  ) : /* @__PURE__ */ t.jsx(
299
299
  "div",
300
300
  {
301
301
  className: X.product,
302
- children: q
302
+ children: A
303
303
  },
304
304
  J()
305
305
  );
@@ -321,7 +321,7 @@ const Un = (u) => {
321
321
  _ ? /* @__PURE__ */ t.jsx(
322
322
  ft,
323
323
  {
324
- sensors: A,
324
+ sensors: q,
325
325
  onDragEnd: E,
326
326
  children: /* @__PURE__ */ t.jsx(
327
327
  xt,
@@ -333,7 +333,7 @@ const Un = (u) => {
333
333
  )
334
334
  }
335
335
  ) : s.map((i) => L(i, a)),
336
- I && /* @__PURE__ */ t.jsx(
336
+ N && /* @__PURE__ */ t.jsx(
337
337
  "div",
338
338
  {
339
339
  style: {
@@ -353,15 +353,15 @@ const Un = (u) => {
353
353
  disabled: !!(x && x <= s.length || s.length === r.length),
354
354
  onClick: () => {
355
355
  const i = [...s];
356
- let N = null;
356
+ let v = null;
357
357
  if (r) {
358
358
  for (let P = 0; P < r.length; P++)
359
- if (!s.find((q) => q === r[P].id)) {
360
- N = r[P];
359
+ if (!s.find((A) => A === r[P].id)) {
360
+ v = r[P];
361
361
  break;
362
362
  }
363
363
  }
364
- i.push((N == null ? void 0 : N.id) || r[0].id), c(i);
364
+ i.push((v == null ? void 0 : v.id) || r[0].id), c(i);
365
365
  },
366
366
  style: {
367
367
  width: "fit-content"
@@ -473,11 +473,11 @@ const Hn = (u) => {
473
473
  draggable: g = !1,
474
474
  deletable: _ = !0,
475
475
  addable: M = !0,
476
- itemsType: I,
476
+ itemsType: N,
477
477
  itemsOptions: r,
478
478
  addableOptions: l = {},
479
479
  limit: y
480
- } = u, [x, m] = f.useState(null), [a, b] = f.useState(null), k = f.useRef(null), A = mt(
480
+ } = u, [x, m] = f.useState(null), [a, b] = f.useState(null), k = f.useRef(null), q = mt(
481
481
  pt(gt, {
482
482
  activationConstraint: {
483
483
  distance: 5
@@ -486,29 +486,29 @@ const Hn = (u) => {
486
486
  );
487
487
  f.useEffect(() => {
488
488
  if (x) {
489
- const i = [...s].map((N) => N.id === x.id ? x : N);
489
+ const i = [...s].map((v) => v.id === x.id ? x : v);
490
490
  c(i);
491
491
  }
492
492
  }, [x]), f.useEffect(() => {
493
493
  k.current && a && (k.current.getBoundingClientRect().height, a.top);
494
494
  }, [k.current, a]);
495
- const E = (i, N) => {
495
+ const E = (i, v) => {
496
496
  i.stopPropagation();
497
497
  const P = i.target.getBoundingClientRect();
498
498
  b({
499
499
  top: P.top + window.scrollY,
500
500
  left: P.left - 30
501
- }), m(N);
501
+ }), m(v);
502
502
  }, K = (i) => {
503
- const { active: N, over: P } = i;
504
- if (P && N.id !== P.id) {
505
- const q = s.findIndex((C) => C.id === N.id), $ = s.findIndex((C) => C.id === P.id);
506
- if (q !== -1 && $ !== -1) {
507
- const C = [...s], [Z] = C.splice(q, 1);
503
+ const { active: v, over: P } = i;
504
+ if (P && v.id !== P.id) {
505
+ const A = s.findIndex((C) => C.id === v.id), $ = s.findIndex((C) => C.id === P.id);
506
+ if (A !== -1 && $ !== -1) {
507
+ const C = [...s], [Z] = C.splice(A, 1);
508
508
  C.splice($, 0, Z), c(C);
509
509
  }
510
510
  }
511
- }, L = (i, N) => {
511
+ }, L = (i, v) => {
512
512
  const P = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
513
513
  g && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
514
514
  j,
@@ -519,27 +519,27 @@ const Hn = (u) => {
519
519
  height: 20
520
520
  }
521
521
  ) }),
522
- I === "select" && r && /* @__PURE__ */ t.jsx(
522
+ N === "select" && r && /* @__PURE__ */ t.jsx(
523
523
  ot,
524
524
  {
525
- onChange: (q) => {
526
- const $ = [...s], C = r.find((v) => v.name === q);
525
+ onChange: (A) => {
526
+ const $ = [...s], C = r.find((I) => I.name === A);
527
527
  if (!C) return;
528
- const Z = $.map((v) => v.id === i.id ? {
528
+ const Z = $.map((I) => I.id === i.id ? {
529
529
  ...C,
530
530
  name: {
531
- "en-US": q
531
+ "en-US": A
532
532
  }
533
- } : v);
533
+ } : I);
534
534
  m({
535
535
  ...i,
536
536
  name: {
537
- "en-US": q
537
+ "en-US": A
538
538
  }
539
539
  }), c([...Z]);
540
540
  },
541
541
  value: i.name,
542
- options: r.filter((q) => !s.find(($) => $.name === q.name)).map((q) => q.name)
542
+ options: r.filter((A) => !s.find(($) => $.name === A.name)).map((A) => A.name)
543
543
  }
544
544
  ),
545
545
  /* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
@@ -550,7 +550,7 @@ const Hn = (u) => {
550
550
  hoverable: !0,
551
551
  width: 20,
552
552
  height: 20,
553
- onClick: (q) => E(q, i)
553
+ onClick: (A) => E(A, i)
554
554
  }
555
555
  ) }),
556
556
  _ && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
@@ -561,7 +561,7 @@ const Hn = (u) => {
561
561
  width: 20,
562
562
  height: 20,
563
563
  fill: "#C12A2A",
564
- onClick: () => c(s.filter((q) => q.id !== i.id))
564
+ onClick: () => c(s.filter((A) => A.id !== i.id))
565
565
  }
566
566
  ) })
567
567
  ] })
@@ -570,7 +570,7 @@ const Hn = (u) => {
570
570
  ke,
571
571
  {
572
572
  product: i,
573
- index: N,
573
+ index: v,
574
574
  children: P
575
575
  },
576
576
  i.id
@@ -599,18 +599,18 @@ const Hn = (u) => {
599
599
  g ? /* @__PURE__ */ t.jsx(
600
600
  ft,
601
601
  {
602
- sensors: A,
602
+ sensors: q,
603
603
  onDragEnd: K,
604
604
  children: /* @__PURE__ */ t.jsx(
605
605
  xt,
606
606
  {
607
607
  items: s.map((i) => i.id),
608
608
  strategy: _t,
609
- children: s.map((i, N) => L(i, N))
609
+ children: s.map((i, v) => L(i, v))
610
610
  }
611
611
  )
612
612
  }
613
- ) : s.map((i, N) => L(i, N)),
613
+ ) : s.map((i, v) => L(i, v)),
614
614
  M && /* @__PURE__ */ t.jsx(
615
615
  "div",
616
616
  {
@@ -630,17 +630,17 @@ const Hn = (u) => {
630
630
  disabled: !!(y && y <= s.length || s.length === (r == null ? void 0 : r.length)),
631
631
  onClick: () => {
632
632
  const i = [...s];
633
- let N = null;
633
+ let v = null;
634
634
  if (r) {
635
635
  for (let P = 0; P < r.length; P++)
636
- if (!s.find((q) => q.id === r[P].id)) {
637
- N = r[P];
636
+ if (!s.find((A) => A.id === r[P].id)) {
637
+ v = r[P];
638
638
  break;
639
639
  }
640
640
  }
641
- I === "select" && r && i.push({
642
- name: N ? N.name : r[0].name,
643
- id: (N == null ? void 0 : N.id) || r[0].id,
641
+ N === "select" && r && i.push({
642
+ name: v ? v.name : r[0].name,
643
+ id: (v == null ? void 0 : v.id) || r[0].id,
644
644
  ...l
645
645
  }), c(i);
646
646
  },
@@ -696,7 +696,7 @@ const zn = (u) => {
696
696
  editable: g = !0,
697
697
  draggable: _ = !1,
698
698
  deletable: M = !0,
699
- addable: I = !0,
699
+ addable: N = !0,
700
700
  itemsType: r,
701
701
  itemsPlaceholder: l = "",
702
702
  itemsOptions: y,
@@ -705,10 +705,10 @@ const zn = (u) => {
705
705
  modalOptions: a,
706
706
  addableOptions: b = {},
707
707
  limit: k
708
- } = u, [A, E] = f.useState(null), [K, L] = f.useState({
708
+ } = u, [q, E] = f.useState(null), [K, L] = f.useState({
709
709
  top: 0,
710
710
  left: 0
711
- }), [i, N] = f.useState(null), P = f.useRef(null), [q, $] = f.useState(!1), C = mt(
711
+ }), [i, v] = f.useState(null), P = f.useRef(null), [A, $] = f.useState(!1), C = mt(
712
712
  pt(gt, {
713
713
  activationConstraint: {
714
714
  distance: 5
@@ -723,11 +723,11 @@ const zn = (u) => {
723
723
  E(null), $(!1), document.body.removeEventListener("click", p);
724
724
  };
725
725
  }, []), f.useEffect(() => {
726
- if (A) {
727
- const p = [...s].map((S) => S.id === A.id ? A : S);
726
+ if (q) {
727
+ const p = [...s].map((S) => S.id === q.id ? q : S);
728
728
  c(p);
729
729
  }
730
- }, [A]), f.useEffect(() => {
730
+ }, [q]), f.useEffect(() => {
731
731
  if (P.current && i) {
732
732
  const p = P.current.getBoundingClientRect().height, S = window.innerHeight;
733
733
  let B = i.top;
@@ -740,11 +740,11 @@ const zn = (u) => {
740
740
  const Z = (p, S) => {
741
741
  p.stopPropagation();
742
742
  const B = p.target.getBoundingClientRect();
743
- N({
743
+ v({
744
744
  top: B.top + window.scrollY,
745
745
  left: B.left - 30
746
746
  }), E(S), $(!0);
747
- }, v = (p) => {
747
+ }, I = (p) => {
748
748
  const { active: S, over: B } = p;
749
749
  if (B && S.id !== B.id) {
750
750
  const T = s.findIndex((z) => z.id === S.id), tt = s.findIndex((z) => z.id === B.id);
@@ -868,11 +868,11 @@ const zn = (u) => {
868
868
  }
869
869
  )
870
870
  ] }),
871
- A && g && a && q && /* @__PURE__ */ t.jsx(
871
+ q && g && a && A && /* @__PURE__ */ t.jsx(
872
872
  At,
873
873
  {
874
874
  ref: P,
875
- activeItem: A,
875
+ activeItem: q,
876
876
  setActiveItem: E,
877
877
  popupPosition: K,
878
878
  modalOptions: a,
@@ -886,7 +886,7 @@ const zn = (u) => {
886
886
  ft,
887
887
  {
888
888
  sensors: C,
889
- onDragEnd: v,
889
+ onDragEnd: I,
890
890
  children: /* @__PURE__ */ t.jsx(
891
891
  xt,
892
892
  {
@@ -897,7 +897,7 @@ const zn = (u) => {
897
897
  )
898
898
  }
899
899
  ) : s.map((p) => D(p)),
900
- I && /* @__PURE__ */ t.jsx(
900
+ N && /* @__PURE__ */ t.jsx(
901
901
  "div",
902
902
  {
903
903
  style: {
@@ -987,22 +987,22 @@ const zn = (u) => {
987
987
  const { buttons: n, setButtons: o, deletable: s = !0, addable: c = !0, editableLink: e = !0 } = u, { pages: h } = bt(), [d, g] = f.useState(null), [_, M] = f.useState({
988
988
  top: 0,
989
989
  left: 0
990
- }), [I, r] = f.useState(null), l = f.useRef(null);
990
+ }), [N, r] = f.useState(null), l = f.useRef(null);
991
991
  f.useEffect(() => {
992
992
  if (d) {
993
993
  const m = [...n].map((a) => a.id === d.id ? d : a);
994
994
  o(m);
995
995
  }
996
996
  }, [d]), f.useEffect(() => {
997
- if (l.current && I) {
997
+ if (l.current && N) {
998
998
  const m = l.current.getBoundingClientRect().height, a = window.innerHeight;
999
- let b = I.top;
999
+ let b = N.top;
1000
1000
  b + m > a + window.scrollY - 200 && (b = a + window.scrollY - m - 200), b < 0 && (b = 10), M({
1001
1001
  top: b,
1002
- left: I.left
1002
+ left: N.left
1003
1003
  });
1004
1004
  }
1005
- }, [l.current, I]);
1005
+ }, [l.current, N]);
1006
1006
  const y = (m, a) => {
1007
1007
  m.stopPropagation();
1008
1008
  const b = m.target.getBoundingClientRect();
@@ -1029,11 +1029,11 @@ const zn = (u) => {
1029
1029
  ot,
1030
1030
  {
1031
1031
  onChange: (b) => {
1032
- const A = [...n].map((E) => E.id === m.id ? {
1032
+ const q = [...n].map((E) => E.id === m.id ? {
1033
1033
  ...m,
1034
1034
  type: b
1035
1035
  } : E);
1036
- o(A);
1036
+ o(q);
1037
1037
  },
1038
1038
  value: m.type,
1039
1039
  options: ["Primary", "Secondary", "Tertiary"]
@@ -1214,7 +1214,7 @@ const Vn = (u) => {
1214
1214
  editable: g = !0,
1215
1215
  draggable: _ = !1,
1216
1216
  withImage: M = !1,
1217
- deletable: I = !0,
1217
+ deletable: N = !0,
1218
1218
  addable: r = !0,
1219
1219
  itemsType: l,
1220
1220
  itemsOptions: y,
@@ -1223,7 +1223,7 @@ const Vn = (u) => {
1223
1223
  setAspectRatio: a
1224
1224
  } = u, [b, k] = f.useState(
1225
1225
  null
1226
- ), [A, E] = f.useState({
1226
+ ), [q, E] = f.useState({
1227
1227
  top: 0,
1228
1228
  left: 0
1229
1229
  }), [K, L] = f.useState(!1), i = mt(
@@ -1234,33 +1234,33 @@ const Vn = (u) => {
1234
1234
  })
1235
1235
  );
1236
1236
  f.useEffect(() => {
1237
- const v = () => {
1237
+ const I = () => {
1238
1238
  k(null), L(!1);
1239
1239
  };
1240
- return document.body.addEventListener("click", v), k(null), L(!1), () => {
1241
- k(null), L(!1), document.body.removeEventListener("click", v);
1240
+ return document.body.addEventListener("click", I), k(null), L(!1), () => {
1241
+ k(null), L(!1), document.body.removeEventListener("click", I);
1242
1242
  };
1243
1243
  }, []), f.useEffect(() => {
1244
1244
  if (b) {
1245
- const v = [...s].map((D) => D.listingId === b.listingId ? b : D);
1246
- c(v);
1245
+ const I = [...s].map((D) => D.listingId === b.listingId ? b : D);
1246
+ c(I);
1247
1247
  }
1248
1248
  }, [b]);
1249
- const N = (v, D) => {
1250
- v.stopPropagation();
1251
- const p = v.target.getBoundingClientRect(), S = 100, B = window.innerHeight;
1249
+ const v = (I, D) => {
1250
+ I.stopPropagation();
1251
+ const p = I.target.getBoundingClientRect(), S = 100, B = window.innerHeight;
1252
1252
  let T = p.top + window.scrollY;
1253
1253
  T + S > B && (T = B - S - 20), L(!0), E({
1254
1254
  top: T - 80,
1255
1255
  left: p.left - 30
1256
1256
  }), k(D);
1257
1257
  };
1258
- function P(v) {
1258
+ function P(I) {
1259
1259
  if (M)
1260
- return v ? /* @__PURE__ */ t.jsx(
1260
+ return I ? /* @__PURE__ */ t.jsx(
1261
1261
  "img",
1262
1262
  {
1263
- src: `https://imagedelivery.net/${v}/w=1000`,
1263
+ src: `https://imagedelivery.net/${I}/w=1000`,
1264
1264
  alt: "image",
1265
1265
  width: 16,
1266
1266
  height: 16
@@ -1275,8 +1275,8 @@ const Vn = (u) => {
1275
1275
  }
1276
1276
  );
1277
1277
  }
1278
- const q = (v) => {
1279
- const { active: D, over: p } = v;
1278
+ const A = (I) => {
1279
+ const { active: D, over: p } = I;
1280
1280
  if (p && D.id !== p.id) {
1281
1281
  const S = s.findIndex((T) => String(T.listingId) === D.id), B = s.findIndex((T) => String(T.listingId) === p.id);
1282
1282
  if (S !== -1 && B !== -1) {
@@ -1286,8 +1286,8 @@ const Vn = (u) => {
1286
1286
  }
1287
1287
  }, $ = () => {
1288
1288
  L(!1), k(null);
1289
- }, C = (v) => {
1290
- const D = y.find((S) => v.listingId === S.id);
1289
+ }, C = (I) => {
1290
+ const D = y.find((S) => I.listingId === S.id);
1291
1291
  if (!D) return null;
1292
1292
  const p = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1293
1293
  _ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
@@ -1308,7 +1308,7 @@ const Vn = (u) => {
1308
1308
  const tt = {
1309
1309
  listingId: T.id,
1310
1310
  image: T.productData.images.length > 0 ? T.productData.images[0].cfId : ""
1311
- }, z = B.map((F) => F.listingId === v.listingId ? tt : F);
1311
+ }, z = B.map((F) => F.listingId === I.listingId ? tt : F);
1312
1312
  k(tt), c([...z]);
1313
1313
  },
1314
1314
  value: D.productData.name,
@@ -1332,10 +1332,10 @@ const Vn = (u) => {
1332
1332
  hoverable: !0,
1333
1333
  width: 20,
1334
1334
  height: 20,
1335
- onClick: (S) => N(S, v)
1335
+ onClick: (S) => v(S, I)
1336
1336
  }
1337
1337
  ) }),
1338
- I && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
1338
+ N && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
1339
1339
  j,
1340
1340
  {
1341
1341
  name: "Trash",
@@ -1343,7 +1343,7 @@ const Vn = (u) => {
1343
1343
  width: 20,
1344
1344
  height: 20,
1345
1345
  fill: "#C12A2A",
1346
- onClick: () => c(s.filter((S) => S !== v))
1346
+ onClick: () => c(s.filter((S) => S !== I))
1347
1347
  }
1348
1348
  ) })
1349
1349
  ] })
@@ -1351,17 +1351,17 @@ const Vn = (u) => {
1351
1351
  return _ ? /* @__PURE__ */ t.jsx(
1352
1352
  De,
1353
1353
  {
1354
- product: v,
1354
+ product: I,
1355
1355
  children: p
1356
1356
  },
1357
- v.listingId
1357
+ I.listingId
1358
1358
  ) : /* @__PURE__ */ t.jsx(
1359
1359
  "div",
1360
1360
  {
1361
1361
  className: W.product,
1362
1362
  children: p
1363
1363
  },
1364
- v.listingId
1364
+ I.listingId
1365
1365
  );
1366
1366
  }, Z = f.useRef(null);
1367
1367
  return /* @__PURE__ */ t.jsxs("div", { className: W.productsBlock, children: [
@@ -1371,7 +1371,7 @@ const Vn = (u) => {
1371
1371
  lt,
1372
1372
  {
1373
1373
  current: n,
1374
- onChange: (v) => o == null ? void 0 : o(v)
1374
+ onChange: (I) => o == null ? void 0 : o(I)
1375
1375
  }
1376
1376
  )
1377
1377
  ] }),
@@ -1382,7 +1382,7 @@ const Vn = (u) => {
1382
1382
  activeItem: b,
1383
1383
  setActiveItem: k,
1384
1384
  setIsOpenModal: L,
1385
- popupPosition: A,
1385
+ popupPosition: q,
1386
1386
  itemsOptions: y
1387
1387
  }
1388
1388
  ),
@@ -1392,18 +1392,18 @@ const Vn = (u) => {
1392
1392
  ft,
1393
1393
  {
1394
1394
  sensors: i,
1395
- onDragEnd: q,
1395
+ onDragEnd: A,
1396
1396
  onDragStart: $,
1397
1397
  children: /* @__PURE__ */ t.jsx(
1398
1398
  xt,
1399
1399
  {
1400
- items: s.map((v) => String(v.listingId)),
1400
+ items: s.map((I) => String(I.listingId)),
1401
1401
  strategy: _t,
1402
- children: s.map((v) => C(v))
1402
+ children: s.map((I) => C(I))
1403
1403
  }
1404
1404
  )
1405
1405
  }
1406
- ) : s.map((v) => C(v)),
1406
+ ) : s.map((I) => C(I)),
1407
1407
  r && /* @__PURE__ */ t.jsx(
1408
1408
  "div",
1409
1409
  {
@@ -1419,16 +1419,16 @@ const Vn = (u) => {
1419
1419
  className: W.button,
1420
1420
  size: "s",
1421
1421
  onClick: () => {
1422
- const v = [...s];
1422
+ const I = [...s];
1423
1423
  for (let D = 0; D < y.length; D++)
1424
1424
  if (!s.find((p) => p.listingId === y[D].id)) {
1425
- v.push({
1425
+ I.push({
1426
1426
  listingId: y[D].id,
1427
1427
  image: y[D].productData.images.length > 0 ? y[D].productData.images[0].cfId : ""
1428
1428
  });
1429
1429
  break;
1430
1430
  }
1431
- c(v);
1431
+ c(I);
1432
1432
  },
1433
1433
  disabled: s.length === (x || y.length),
1434
1434
  style: {
@@ -1455,7 +1455,7 @@ const Vn = (u) => {
1455
1455
  {
1456
1456
  value: m,
1457
1457
  options: Object.keys(Tt),
1458
- onChange: (v) => a(v),
1458
+ onChange: (I) => a(I),
1459
1459
  leftAddonOptions: wt
1460
1460
  }
1461
1461
  ),
@@ -1494,7 +1494,7 @@ const is = (u) => {
1494
1494
  var K, L;
1495
1495
  const { product: n, setIsOpen: o, isCartEnabled: s = !0 } = u, { variants: c } = n, [e, h] = f.useState(c[0]), [d, g] = f.useState(
1496
1496
  e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
1497
- ), { notifications: _, setNotifications: M } = St(), I = vt(), [r, l] = f.useState(1), { cart: y, reset: x, addProductToCart: m } = ct(), [a, b] = f.useState(!1);
1497
+ ), { notifications: _, setNotifications: M } = St(), N = vt(), [r, l] = f.useState(1), { cart: y, reset: x, addProductToCart: m } = ct(), [a, b] = f.useState(!1);
1498
1498
  f.useEffect(() => {
1499
1499
  b(!0);
1500
1500
  const i = setTimeout(() => b(!1), 600);
@@ -1516,19 +1516,20 @@ const is = (u) => {
1516
1516
  }
1517
1517
  ]);
1518
1518
  } catch (i) {
1519
+ const v = i;
1519
1520
  M([
1520
1521
  ..._,
1521
1522
  {
1522
1523
  id: J(),
1523
- message: `Product failed to add to cart: ${i}`,
1524
+ message: `Product failed to add to cart: ${v.message}`,
1524
1525
  status: "error"
1525
1526
  }
1526
1527
  ]);
1527
1528
  }
1528
1529
  o == null || o(!1);
1529
1530
  }
1530
- function A() {
1531
- x(), k(), I("/checkout");
1531
+ function q() {
1532
+ x(), k(), N("/checkout");
1532
1533
  }
1533
1534
  function E(i) {
1534
1535
  if (i >= 864e5) {
@@ -1564,10 +1565,10 @@ const is = (u) => {
1564
1565
  i
1565
1566
  )) }),
1566
1567
  /* @__PURE__ */ t.jsx("div", { className: O.variants, children: c.filter((i) => {
1567
- var N;
1568
- return (N = i.chargeTypes) == null ? void 0 : N.includes(d);
1568
+ var v;
1569
+ return (v = i.chargeTypes) == null ? void 0 : v.includes(d);
1569
1570
  }).map((i) => {
1570
- var N, P;
1571
+ var v, P;
1571
1572
  return /* @__PURE__ */ t.jsxs(
1572
1573
  "div",
1573
1574
  {
@@ -1604,7 +1605,7 @@ const is = (u) => {
1604
1605
  className: O.stock,
1605
1606
  id: "md",
1606
1607
  children: [
1607
- (N = i.quantity.restrictions) != null && N.max || i.quantity.available !== void 0 ? ((P = i.quantity.restrictions) == null ? void 0 : P.max) || i.quantity.available : "∞",
1608
+ (v = i.quantity.restrictions) != null && v.max || i.quantity.available !== void 0 ? ((P = i.quantity.restrictions) == null ? void 0 : P.max) || i.quantity.available : "∞",
1608
1609
  " ",
1609
1610
  "in stock"
1610
1611
  ]
@@ -1761,7 +1762,7 @@ const is = (u) => {
1761
1762
  R,
1762
1763
  {
1763
1764
  type: "Primary",
1764
- onClick: () => A(),
1765
+ onClick: () => q(),
1765
1766
  disabled: e.quantity && e.quantity.available === 0 || r === 0,
1766
1767
  children: d === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
1767
1768
  }
@@ -1837,8 +1838,8 @@ const is = (u) => {
1837
1838
  s(y);
1838
1839
  })();
1839
1840
  }, [h.parts, d]);
1840
- function g(I) {
1841
- return !I || !(I != null && I.variants) ? !1 : I.chargeType === "RECURRING";
1841
+ function g(N) {
1842
+ return !N || !(N != null && N.variants) ? !1 : N.chargeType === "RECURRING";
1842
1843
  }
1843
1844
  const _ = h.parts.length > 0 && o.length > 0 && !g(o[0]);
1844
1845
  function M() {
@@ -1855,8 +1856,8 @@ const is = (u) => {
1855
1856
  padding: 10,
1856
1857
  position: "relative"
1857
1858
  },
1858
- onClick: (I) => {
1859
- I.stopPropagation(), window.location.pathname.includes("/admin/builder") || (n(!0), e(!0));
1859
+ onClick: (N) => {
1860
+ N.stopPropagation(), window.location.pathname.includes("/admin/builder") || (n(!0), e(!0));
1860
1861
  },
1861
1862
  children: [
1862
1863
  /* @__PURE__ */ t.jsx(
@@ -1889,7 +1890,7 @@ const is = (u) => {
1889
1890
  }, Ls = (u) => {
1890
1891
  var x, m;
1891
1892
  const { activeProducts: n, isCartNotEmpty: o, isOpen: s, close: c } = u, { cart: e, reset: h, getTotalAndDiscount: d, updateQuantityOfProduct: g, removeProduct: _ } = ct(), M = vt();
1892
- function I(a, b) {
1893
+ function N(a, b) {
1893
1894
  M(a, { replace: b });
1894
1895
  }
1895
1896
  function r(a) {
@@ -2002,7 +2003,7 @@ const is = (u) => {
2002
2003
  dangerouslySetInnerHTML: {
2003
2004
  __html: at(
2004
2005
  ((b = a.variants.find(
2005
- (A) => A.id === a.activeVariantId
2006
+ (q) => q.id === a.activeVariantId
2006
2007
  )) == null ? void 0 : b.name) || a.name
2007
2008
  )
2008
2009
  }
@@ -2010,10 +2011,10 @@ const is = (u) => {
2010
2011
  ),
2011
2012
  /* @__PURE__ */ t.jsx("div", { className: w.price, children: Q({
2012
2013
  amount: a.variants.find(
2013
- (A) => A.id === a.activeVariantId
2014
+ (q) => q.id === a.activeVariantId
2014
2015
  ).price.amount * ((a == null ? void 0 : a.quantity) || 1),
2015
2016
  currency: a.variants.find(
2016
- (A) => A.id === a.activeVariantId
2017
+ (q) => q.id === a.activeVariantId
2017
2018
  ).price.currency
2018
2019
  }) })
2019
2020
  ] })
@@ -2045,9 +2046,9 @@ const is = (u) => {
2045
2046
  className: w.productCount,
2046
2047
  type: "number",
2047
2048
  value: ((k = a.quantity) == null ? void 0 : k.toString()) || "",
2048
- onChange: (A) => {
2049
+ onChange: (q) => {
2049
2050
  const E = Math.min(
2050
- Number(A.target.value),
2051
+ Number(q.target.value),
2051
2052
  a.variants.find((K) => K.id === a.activeVariantId).quantity.available || 1 / 0
2052
2053
  );
2053
2054
  E < 1 || g({
@@ -2058,7 +2059,7 @@ const is = (u) => {
2058
2059
  });
2059
2060
  },
2060
2061
  min: 1,
2061
- max: a.variants.find((A) => A.id === a.activeVariantId).quantity.available || 1 / 0
2062
+ max: a.variants.find((q) => q.id === a.activeVariantId).quantity.available || 1 / 0
2062
2063
  }
2063
2064
  ),
2064
2065
  /* @__PURE__ */ t.jsx(
@@ -2067,7 +2068,7 @@ const is = (u) => {
2067
2068
  type: "Secondary",
2068
2069
  onClick: () => r(a),
2069
2070
  className: w.productButton,
2070
- disabled: a.quantity === a.variants.find((A) => A.id === a.activeVariantId).quantity.available,
2071
+ disabled: a.quantity === a.variants.find((q) => q.id === a.activeVariantId).quantity.available,
2071
2072
  children: /* @__PURE__ */ t.jsx(
2072
2073
  j,
2073
2074
  {
@@ -2115,7 +2116,7 @@ const is = (u) => {
2115
2116
  currency: e.parts.length > 0 && ((m = (x = n.find((a) => a.id === e.parts[0].productId)) == null ? void 0 : x.variants.find((a) => a.id === e.parts[0].productVariantId)) == null ? void 0 : m.price.currency) || "USD"
2116
2117
  }) })
2117
2118
  ] }),
2118
- /* @__PURE__ */ t.jsx(R, { onClick: () => I("/checkout", !1), children: "Checkout" })
2119
+ /* @__PURE__ */ t.jsx(R, { onClick: () => N("/checkout", !1), children: "Checkout" })
2119
2120
  ] })
2120
2121
  ] }) : /* @__PURE__ */ t.jsx(Us, {})
2121
2122
  ]
@@ -2481,11 +2482,11 @@ const is = (u) => {
2481
2482
  buttonsBlock: cn,
2482
2483
  cartDisabled: rn
2483
2484
  }, Qn = (u) => {
2484
- var M, I;
2485
+ var M, N;
2485
2486
  const { setIsOpen: n, setModalType: o, productId: s, isCartEnabled: c = !0 } = u, { cart: e } = ct(), { pageContext: h } = bt(), d = (M = h == null ? void 0 : h.listings) == null ? void 0 : M.find((r) => r.id === s);
2486
2487
  if (!d)
2487
2488
  return null;
2488
- const g = (I = h == null ? void 0 : h.products) == null ? void 0 : I.find(
2489
+ const g = (N = h == null ? void 0 : h.products) == null ? void 0 : N.find(
2489
2490
  (r) => r.uniquePath === d.productData.uniquePath
2490
2491
  );
2491
2492
  if (!g)
@@ -2581,7 +2582,7 @@ const is = (u) => {
2581
2582
  var r;
2582
2583
  const { pageContext: n } = bt(), o = (r = n == null ? void 0 : n.listings) == null ? void 0 : r.find((l) => l.id === u.productId), [s, c] = f.useState(!0), [e, h] = f.useState(null), d = (e == null ? void 0 : e.variants[0]) || null, [g, _] = f.useState(
2583
2584
  "ONE_TIME"
2584
- ), { addProducts: M } = ct(), { setIsOpen: I } = rt();
2585
+ ), { addProducts: M } = ct(), { setIsOpen: N } = rt();
2585
2586
  return f.useEffect(() => {
2586
2587
  (async () => {
2587
2588
  c(!0);
@@ -2593,7 +2594,7 @@ const is = (u) => {
2593
2594
  M(y == null ? void 0 : y.data.products), h(y == null ? void 0 : y.data.products[0]), c(!1);
2594
2595
  })();
2595
2596
  }, []), f.useEffect(() => {
2596
- I(!0);
2597
+ N(!0);
2597
2598
  }, []), /* @__PURE__ */ t.jsx(ut, { close: u.setIsOpen, children: /* @__PURE__ */ t.jsxs(
2598
2599
  "div",
2599
2600
  {
@@ -2624,7 +2625,7 @@ const is = (u) => {
2624
2625
  }
2625
2626
  ) });
2626
2627
  }, bn = (u) => {
2627
- const { variants: n, activeChargeType: o, productId: s, setIsOpen: c } = u, { cart: e, addProductToCart: h, addProducts: d, updateQuantityOfProduct: g } = ct(), { notifications: _, setNotifications: M } = St(), { pageContext: I } = bt(), { setIsOpen: r } = rt(), l = () => {
2628
+ const { variants: n, activeChargeType: o, productId: s, setIsOpen: c } = u, { cart: e, addProductToCart: h, addProducts: d, updateQuantityOfProduct: g } = ct(), { notifications: _, setNotifications: M } = St(), { pageContext: N } = bt(), { setIsOpen: r } = rt(), l = () => {
2628
2629
  r(!1), setTimeout(() => {
2629
2630
  c(!1);
2630
2631
  }, 300);
@@ -2648,7 +2649,7 @@ const is = (u) => {
2648
2649
  chargeType: o
2649
2650
  });
2650
2651
  else {
2651
- I != null && I.products && d(I.products);
2652
+ N != null && N.products && d(N.products);
2652
2653
  try {
2653
2654
  h({
2654
2655
  productId: s,
@@ -2664,11 +2665,12 @@ const is = (u) => {
2664
2665
  }
2665
2666
  ]);
2666
2667
  } catch (k) {
2668
+ const q = k;
2667
2669
  M([
2668
2670
  ..._,
2669
2671
  {
2670
2672
  id: J(),
2671
- message: `Product failed to add to cart: ${k}`,
2673
+ message: `Product failed to add to cart: ${q.message}`,
2672
2674
  status: "error"
2673
2675
  }
2674
2676
  ]);
@@ -2801,7 +2803,7 @@ const is = (u) => {
2801
2803
  setProductId: c,
2802
2804
  setIsProductModalOpen: e,
2803
2805
  setShowDropdown: h
2804
- } = u, [d, g] = f.useState(null), [_, M] = f.useState(!0), { setIsOpen: I } = rt();
2806
+ } = u, [d, g] = f.useState(null), [_, M] = f.useState(!0), { setIsOpen: N } = rt();
2805
2807
  f.useEffect(() => {
2806
2808
  var y;
2807
2809
  M(!0);
@@ -2810,10 +2812,10 @@ const is = (u) => {
2810
2812
  );
2811
2813
  l && g([...l]), M(!1);
2812
2814
  }, [o]), f.useEffect(() => {
2813
- I(!0);
2815
+ N(!0);
2814
2816
  }, []);
2815
2817
  const r = () => {
2816
- I(!1), setTimeout(() => {
2818
+ N(!1), setTimeout(() => {
2817
2819
  n(!1);
2818
2820
  }, 300);
2819
2821
  };