@billgangcom/theme-lib 1.22.0 → 1.23.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/builder.cjs.js +2 -2
- package/dist/builder.es.js +572 -572
- package/dist/{root-B5icYjT0.cjs → index-BnVOEtT7.cjs} +26 -26
- package/dist/{root-DGGdzWua.js → index-satprvMg.js} +18813 -18810
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +144 -144
- package/package.json +2 -2
package/dist/ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as t, c as
|
|
2
|
-
import { k as Xn, l as Qn, h as Wn, E as Jn, L as Kn, P as Zn, R as tc, g as ec, i as sc } from "./
|
|
1
|
+
import { j as t, c as M, I as x, a as G, S as V, T as lt, C as it, b as Y, D as rt, H as dt, B as X, v as tt, u as ut, d as mt, e as ot, f as at, M as gt } from "./index-satprvMg.js";
|
|
2
|
+
import { k as Xn, l as Qn, h as Wn, E as Jn, L as Kn, P as Zn, R as tc, g as ec, i as sc } from "./index-satprvMg.js";
|
|
3
3
|
import f from "react";
|
|
4
4
|
const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18", jt = "_open_9e4oa_21", vt = "_content_9e4oa_25", J = {
|
|
5
5
|
accordion: xt,
|
|
@@ -8,8 +8,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
8
8
|
open: jt,
|
|
9
9
|
content: vt
|
|
10
10
|
}, Rn = ({ title: r, content: n }) => {
|
|
11
|
-
const [e,
|
|
12
|
-
|
|
11
|
+
const [e, o] = f.useState(!1), [i, a] = f.useState(0), s = f.useRef(null), c = () => {
|
|
12
|
+
o(!e);
|
|
13
13
|
};
|
|
14
14
|
return f.useEffect(() => {
|
|
15
15
|
s.current && a(e ? s.current.scrollHeight : 0);
|
|
@@ -21,7 +21,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
21
21
|
onClick: c,
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ t.jsx("h3", { children: r }),
|
|
24
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
24
|
+
/* @__PURE__ */ t.jsx("div", { className: M(J.icon, { [J.open]: e }), children: /* @__PURE__ */ t.jsx(x, { name: "CaretDown" }) })
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
),
|
|
@@ -30,7 +30,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
30
30
|
{
|
|
31
31
|
ref: s,
|
|
32
32
|
className: J.content,
|
|
33
|
-
style: { height: `${
|
|
33
|
+
style: { height: `${i}px` },
|
|
34
34
|
children: /* @__PURE__ */ t.jsx("p", { children: n })
|
|
35
35
|
}
|
|
36
36
|
)
|
|
@@ -58,7 +58,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
58
58
|
"bottom",
|
|
59
59
|
"bottomRight"
|
|
60
60
|
], St = ["left", "top", "right", "bottom"], Hn = (r) => {
|
|
61
|
-
const { alignment: n, padding: e, setPadding:
|
|
61
|
+
const { alignment: n, padding: e, setPadding: o, setAlignment: i } = r;
|
|
62
62
|
function a() {
|
|
63
63
|
switch (n) {
|
|
64
64
|
case "left":
|
|
@@ -98,7 +98,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
100
|
onClick: () => {
|
|
101
|
-
|
|
101
|
+
i(c);
|
|
102
102
|
},
|
|
103
103
|
className: D.alignment,
|
|
104
104
|
children: [
|
|
@@ -134,7 +134,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
134
134
|
{
|
|
135
135
|
type: "text",
|
|
136
136
|
value: String(e[c]),
|
|
137
|
-
onChange: (m) =>
|
|
137
|
+
onChange: (m) => o({
|
|
138
138
|
...e,
|
|
139
139
|
[c]: Number(m)
|
|
140
140
|
}),
|
|
@@ -149,20 +149,20 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
149
149
|
] })
|
|
150
150
|
] })
|
|
151
151
|
] });
|
|
152
|
-
}, Ot = "_subtitle_1qrz9_1", Dt = "_header_1qrz9_8", Et = "_text_1qrz9_9",
|
|
152
|
+
}, Ot = "_subtitle_1qrz9_1", Dt = "_header_1qrz9_8", Et = "_text_1qrz9_9", Mt = "_top_1qrz9_17", Lt = "_itemsBlock_1qrz9_26", K = {
|
|
153
153
|
subtitle: Ot,
|
|
154
154
|
header: Dt,
|
|
155
155
|
text: Et,
|
|
156
|
-
top:
|
|
157
|
-
itemsBlock:
|
|
156
|
+
top: Mt,
|
|
157
|
+
itemsBlock: Lt
|
|
158
158
|
}, Rt = "_typeTexts_rcw8p_1", Ht = "_block_rcw8p_8", Vt = "_active_rcw8p_21", nt = {
|
|
159
159
|
typeTexts: Rt,
|
|
160
160
|
block: Ht,
|
|
161
161
|
active: Vt
|
|
162
162
|
}, Ft = ["bold", "italic", "underline", "strike-through", "code"], _t = (r) => {
|
|
163
163
|
const { typesText: n, setTypesText: e } = r;
|
|
164
|
-
function i
|
|
165
|
-
switch (
|
|
164
|
+
function o(i) {
|
|
165
|
+
switch (i) {
|
|
166
166
|
case "bold":
|
|
167
167
|
return "TextB";
|
|
168
168
|
case "italic":
|
|
@@ -175,38 +175,38 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
175
175
|
return "TextUnderline";
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
return /* @__PURE__ */ t.jsx("div", { className: nt.typeTexts, children: Ft.map((
|
|
178
|
+
return /* @__PURE__ */ t.jsx("div", { className: nt.typeTexts, children: Ft.map((i) => /* @__PURE__ */ t.jsx(
|
|
179
179
|
"div",
|
|
180
180
|
{
|
|
181
|
-
className:
|
|
182
|
-
[nt.active]: n.includes(
|
|
181
|
+
className: M(nt.block, {
|
|
182
|
+
[nt.active]: n.includes(i)
|
|
183
183
|
}),
|
|
184
184
|
onClick: () => {
|
|
185
185
|
const a = [...n];
|
|
186
|
-
if (a.includes(
|
|
187
|
-
const s = a.filter((c) => c !==
|
|
186
|
+
if (a.includes(i)) {
|
|
187
|
+
const s = a.filter((c) => c !== i);
|
|
188
188
|
e(s);
|
|
189
189
|
} else
|
|
190
|
-
a.push(
|
|
190
|
+
a.push(i), e(a);
|
|
191
191
|
},
|
|
192
192
|
children: /* @__PURE__ */ t.jsx(
|
|
193
193
|
x,
|
|
194
194
|
{
|
|
195
|
-
name: i
|
|
196
|
-
fill: n.includes(
|
|
195
|
+
name: o(i),
|
|
196
|
+
fill: n.includes(i) ? "#252525" : "#757575",
|
|
197
197
|
width: 20,
|
|
198
198
|
height: 20
|
|
199
199
|
}
|
|
200
200
|
)
|
|
201
201
|
},
|
|
202
|
-
String(
|
|
202
|
+
String(i)
|
|
203
203
|
)) });
|
|
204
204
|
}, Ut = (r) => {
|
|
205
205
|
const {
|
|
206
206
|
typesText: n,
|
|
207
207
|
isActiveText: e,
|
|
208
|
-
setIsActiveText:
|
|
209
|
-
text:
|
|
208
|
+
setIsActiveText: o,
|
|
209
|
+
text: i,
|
|
210
210
|
setText: a,
|
|
211
211
|
setTypesText: s,
|
|
212
212
|
title: c,
|
|
@@ -215,11 +215,11 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
215
215
|
return /* @__PURE__ */ t.jsxs("div", { className: K.text, children: [
|
|
216
216
|
(c || e !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: K.top, children: [
|
|
217
217
|
c && /* @__PURE__ */ t.jsx("h3", { className: K.title, children: c }),
|
|
218
|
-
e !== void 0 &&
|
|
218
|
+
e !== void 0 && o && /* @__PURE__ */ t.jsx(
|
|
219
219
|
V,
|
|
220
220
|
{
|
|
221
221
|
current: e,
|
|
222
|
-
onChange: ($) =>
|
|
222
|
+
onChange: ($) => o($)
|
|
223
223
|
}
|
|
224
224
|
)
|
|
225
225
|
] }),
|
|
@@ -229,7 +229,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
229
229
|
lt,
|
|
230
230
|
{
|
|
231
231
|
onChange: ($) => a($),
|
|
232
|
-
value:
|
|
232
|
+
value: i,
|
|
233
233
|
maxLength: 150
|
|
234
234
|
}
|
|
235
235
|
),
|
|
@@ -264,7 +264,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
264
264
|
link: re,
|
|
265
265
|
modalOptions: de
|
|
266
266
|
}, ue = (r) => {
|
|
267
|
-
const { activeItem: n, setActiveItem: e, popupPosition:
|
|
267
|
+
const { activeItem: n, setActiveItem: e, popupPosition: o, modalOptions: i, setIsOpenModal: a } = r;
|
|
268
268
|
return /* @__PURE__ */ t.jsxs(
|
|
269
269
|
"div",
|
|
270
270
|
{
|
|
@@ -273,8 +273,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
273
273
|
s.stopPropagation();
|
|
274
274
|
},
|
|
275
275
|
style: {
|
|
276
|
-
top: `${
|
|
277
|
-
left: `${
|
|
276
|
+
top: `${o.top}px`,
|
|
277
|
+
left: `${o.left}px`
|
|
278
278
|
},
|
|
279
279
|
children: [
|
|
280
280
|
/* @__PURE__ */ t.jsxs("div", { className: P.top, children: [
|
|
@@ -292,7 +292,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
292
292
|
}
|
|
293
293
|
)
|
|
294
294
|
] }),
|
|
295
|
-
/* @__PURE__ */ t.jsx("div", { className: P.modalOptions, children:
|
|
295
|
+
/* @__PURE__ */ t.jsx("div", { className: P.modalOptions, children: i.map((s) => {
|
|
296
296
|
if (s.type === "image")
|
|
297
297
|
return /* @__PURE__ */ t.jsx(
|
|
298
298
|
it,
|
|
@@ -428,20 +428,20 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
428
428
|
const { items: n, title: e = "Other" } = r;
|
|
429
429
|
return /* @__PURE__ */ t.jsxs("div", { className: ct.other, children: [
|
|
430
430
|
/* @__PURE__ */ t.jsx("h5", { className: ct.subtitle, children: e }),
|
|
431
|
-
/* @__PURE__ */ t.jsx("div", { className: ct.items, children: n.map((
|
|
431
|
+
/* @__PURE__ */ t.jsx("div", { className: ct.items, children: n.map((o, i) => /* @__PURE__ */ t.jsx(
|
|
432
432
|
V,
|
|
433
433
|
{
|
|
434
|
-
current:
|
|
435
|
-
onChange: (a) =>
|
|
436
|
-
label:
|
|
434
|
+
current: o.isItem,
|
|
435
|
+
onChange: (a) => o.setIsItem(a),
|
|
436
|
+
label: o.label,
|
|
437
437
|
hasBackground: !0,
|
|
438
438
|
paddingless: !1
|
|
439
439
|
},
|
|
440
|
-
|
|
440
|
+
i
|
|
441
441
|
)) })
|
|
442
442
|
] });
|
|
443
443
|
}, pe = (r) => {
|
|
444
|
-
const { index: n, moveProduct: e, children:
|
|
444
|
+
const { index: n, moveProduct: e, children: o } = r, [, i] = ut({
|
|
445
445
|
accept: "product",
|
|
446
446
|
hover(c) {
|
|
447
447
|
c.index !== n && (e(c.index, n), c.index = n);
|
|
@@ -456,17 +456,17 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
456
456
|
return /* @__PURE__ */ t.jsx(
|
|
457
457
|
"div",
|
|
458
458
|
{
|
|
459
|
-
ref: (c) => s(
|
|
459
|
+
ref: (c) => s(i(c)),
|
|
460
460
|
className: `${P.product} ${a ? P.dragging : ""}`,
|
|
461
|
-
children:
|
|
461
|
+
children: o
|
|
462
462
|
}
|
|
463
463
|
);
|
|
464
464
|
}, ge = (r) => {
|
|
465
465
|
const {
|
|
466
466
|
isActiveItems: n,
|
|
467
467
|
setIsActiveItems: e,
|
|
468
|
-
items:
|
|
469
|
-
setItems:
|
|
468
|
+
items: o,
|
|
469
|
+
setItems: i,
|
|
470
470
|
other: a,
|
|
471
471
|
title: s,
|
|
472
472
|
subtitle: c,
|
|
@@ -483,12 +483,12 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
483
483
|
modalOptions: Q,
|
|
484
484
|
addableOptions: F = {},
|
|
485
485
|
limit: y
|
|
486
|
-
} = r, [
|
|
486
|
+
} = r, [L, R] = f.useState(null), [st, et] = f.useState({
|
|
487
487
|
top: 0,
|
|
488
488
|
left: 0
|
|
489
489
|
}), [h, v] = f.useState(!1), A = (u, w) => {
|
|
490
|
-
const S = [...
|
|
491
|
-
S.splice(w, 0, N),
|
|
490
|
+
const S = [...o], [N] = S.splice(u, 1);
|
|
491
|
+
S.splice(w, 0, N), i(S);
|
|
492
492
|
};
|
|
493
493
|
f.useEffect(() => {
|
|
494
494
|
const u = () => {
|
|
@@ -498,11 +498,11 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
498
498
|
R(null), v(!1), document.body.removeEventListener("click", u);
|
|
499
499
|
};
|
|
500
500
|
}, []), f.useEffect(() => {
|
|
501
|
-
if (
|
|
502
|
-
const u = [...
|
|
503
|
-
|
|
501
|
+
if (L) {
|
|
502
|
+
const u = [...o].map((w) => w.id === L.id ? L : w);
|
|
503
|
+
i(u);
|
|
504
504
|
}
|
|
505
|
-
}, [
|
|
505
|
+
}, [L]);
|
|
506
506
|
const C = (u, w) => {
|
|
507
507
|
u.stopPropagation(), v(!0);
|
|
508
508
|
const S = u.target.getBoundingClientRect(), N = 500, W = window.innerHeight;
|
|
@@ -547,14 +547,14 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
547
547
|
Y,
|
|
548
548
|
{
|
|
549
549
|
onChange: (N) => {
|
|
550
|
-
const E = [...
|
|
550
|
+
const E = [...o].map((H) => H.id === u.id ? {
|
|
551
551
|
...u,
|
|
552
552
|
name: N
|
|
553
553
|
} : H);
|
|
554
554
|
R({
|
|
555
555
|
...u,
|
|
556
556
|
name: N
|
|
557
|
-
}),
|
|
557
|
+
}), i([...E]);
|
|
558
558
|
},
|
|
559
559
|
value: u.name,
|
|
560
560
|
options: l,
|
|
@@ -565,11 +565,11 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
565
565
|
G,
|
|
566
566
|
{
|
|
567
567
|
onChange: (N) => {
|
|
568
|
-
const E = [...
|
|
568
|
+
const E = [...o].map((H) => H.id === u.id ? {
|
|
569
569
|
...u,
|
|
570
570
|
name: N
|
|
571
571
|
} : H);
|
|
572
|
-
|
|
572
|
+
i([...E]);
|
|
573
573
|
},
|
|
574
574
|
value: u.name,
|
|
575
575
|
placeholder: _
|
|
@@ -579,11 +579,11 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
579
579
|
it,
|
|
580
580
|
{
|
|
581
581
|
onChange: (N) => {
|
|
582
|
-
const E = [...
|
|
582
|
+
const E = [...o].map((H) => H.id === u.id ? {
|
|
583
583
|
...u,
|
|
584
584
|
images: N
|
|
585
585
|
} : H);
|
|
586
|
-
|
|
586
|
+
i([...E]);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
),
|
|
@@ -606,7 +606,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
606
606
|
width: 20,
|
|
607
607
|
height: 20,
|
|
608
608
|
fill: "#C12A2A",
|
|
609
|
-
onClick: () => o
|
|
609
|
+
onClick: () => i(o.filter((N) => N.id !== u.id))
|
|
610
610
|
}
|
|
611
611
|
)
|
|
612
612
|
] })
|
|
@@ -640,10 +640,10 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
640
640
|
}
|
|
641
641
|
)
|
|
642
642
|
] }),
|
|
643
|
-
|
|
643
|
+
L && m && Q && h && /* @__PURE__ */ t.jsx(
|
|
644
644
|
ue,
|
|
645
645
|
{
|
|
646
|
-
activeItem:
|
|
646
|
+
activeItem: L,
|
|
647
647
|
setActiveItem: R,
|
|
648
648
|
popupPosition: st,
|
|
649
649
|
modalOptions: Q,
|
|
@@ -653,19 +653,19 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
653
653
|
B && q && /* @__PURE__ */ t.jsx(bs, { ...q }),
|
|
654
654
|
/* @__PURE__ */ t.jsxs("div", { className: P.products, children: [
|
|
655
655
|
c && /* @__PURE__ */ t.jsx("h5", { className: P.subtitle, children: c }),
|
|
656
|
-
$ ? /* @__PURE__ */ t.jsx(rt, { backend: dt, children:
|
|
656
|
+
$ ? /* @__PURE__ */ t.jsx(rt, { backend: dt, children: o.map((u, w) => O(u, w)) }) : o.map((u, w) => O(u, w)),
|
|
657
657
|
j && /* @__PURE__ */ t.jsxs(
|
|
658
658
|
X,
|
|
659
659
|
{
|
|
660
|
-
className:
|
|
661
|
-
[P.disabled]: !!(y && y <=
|
|
660
|
+
className: M(P.button, {
|
|
661
|
+
[P.disabled]: !!(y && y <= o.length)
|
|
662
662
|
}),
|
|
663
663
|
size: "s",
|
|
664
|
-
disabled: !!(y && y <=
|
|
664
|
+
disabled: !!(y && y <= o.length),
|
|
665
665
|
onClick: () => {
|
|
666
|
-
const u = [...
|
|
666
|
+
const u = [...o];
|
|
667
667
|
d === "select" ? u.push({
|
|
668
|
-
name: l[0] || `Product ${
|
|
668
|
+
name: l[0] || `Product ${o.length + 1}`,
|
|
669
669
|
id: tt(),
|
|
670
670
|
...F
|
|
671
671
|
}) : d === "input" ? u.push({
|
|
@@ -673,10 +673,10 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
673
673
|
id: tt(),
|
|
674
674
|
...F
|
|
675
675
|
}) : u.push({
|
|
676
|
-
name: `Image ${
|
|
676
|
+
name: `Image ${o.length + 1}`,
|
|
677
677
|
id: tt(),
|
|
678
678
|
...F
|
|
679
|
-
}),
|
|
679
|
+
}), i(u);
|
|
680
680
|
},
|
|
681
681
|
children: [
|
|
682
682
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
@@ -716,7 +716,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
716
716
|
other: Oe,
|
|
717
717
|
options: De
|
|
718
718
|
}, Ee = (r) => {
|
|
719
|
-
const { activeButton: n, setActiveButton: e, popupPosition:
|
|
719
|
+
const { activeButton: n, setActiveButton: e, popupPosition: o } = r, [i, a] = f.useState(n.typesText), [s, c] = f.useState(n.destination), [m, $] = f.useState(n.link || ""), [p, k] = f.useState(n.text || "");
|
|
720
720
|
return f.useEffect(() => {
|
|
721
721
|
e({
|
|
722
722
|
...n,
|
|
@@ -724,10 +724,10 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
724
724
|
text: p,
|
|
725
725
|
link: m,
|
|
726
726
|
destination: s,
|
|
727
|
-
typesText:
|
|
727
|
+
typesText: i
|
|
728
728
|
}
|
|
729
729
|
});
|
|
730
|
-
}, [
|
|
730
|
+
}, [i, s, m, p]), /* @__PURE__ */ t.jsxs(
|
|
731
731
|
"div",
|
|
732
732
|
{
|
|
733
733
|
className: z.modal,
|
|
@@ -735,8 +735,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
735
735
|
j.stopPropagation();
|
|
736
736
|
},
|
|
737
737
|
style: {
|
|
738
|
-
top: `${
|
|
739
|
-
left: `${
|
|
738
|
+
top: `${o.top}px`,
|
|
739
|
+
left: `${o.left}px`
|
|
740
740
|
},
|
|
741
741
|
children: [
|
|
742
742
|
/* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
|
|
@@ -799,7 +799,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
799
799
|
/* @__PURE__ */ t.jsx(
|
|
800
800
|
_t,
|
|
801
801
|
{
|
|
802
|
-
typesText:
|
|
802
|
+
typesText: i,
|
|
803
803
|
setTypesText: a
|
|
804
804
|
}
|
|
805
805
|
)
|
|
@@ -807,9 +807,9 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
807
807
|
]
|
|
808
808
|
}
|
|
809
809
|
);
|
|
810
|
-
},
|
|
811
|
-
subtitle:
|
|
812
|
-
header:
|
|
810
|
+
}, Me = "_subtitle_m8qel_1", Le = "_header_m8qel_8", Re = "_text_m8qel_9", He = "_productsBlock_m8qel_10", Ve = "_buttonsBlock_m8qel_11", Fe = "_top_m8qel_23", Ue = "_itemsBlock_m8qel_32", ze = "_typeTexts_m8qel_38", Ge = "_block_m8qel_45", Ye = "_active_m8qel_58", Xe = "_products_m8qel_10", Qe = "_product_m8qel_10", We = "_button_m8qel_11", Je = "_image_m8qel_88", Ke = "_info_m8qel_95", Ze = "_name_m8qel_107", ts = "_buttons_m8qel_11", es = "_modal_m8qel_118", ss = "_other_m8qel_137", ns = "_options_m8qel_143", Z = {
|
|
811
|
+
subtitle: Me,
|
|
812
|
+
header: Le,
|
|
813
813
|
text: Re,
|
|
814
814
|
productsBlock: He,
|
|
815
815
|
buttonsBlock: Ve,
|
|
@@ -829,7 +829,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
829
829
|
other: ss,
|
|
830
830
|
options: ns
|
|
831
831
|
}, cs = (r) => {
|
|
832
|
-
const { buttons: n, setButtons: e, deletable:
|
|
832
|
+
const { buttons: n, setButtons: e, deletable: o = !0, addable: i = !0 } = r, [a, s] = f.useState(null), [c, m] = f.useState({
|
|
833
833
|
top: 0,
|
|
834
834
|
left: 0
|
|
835
835
|
});
|
|
@@ -889,7 +889,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
),
|
|
892
|
-
|
|
892
|
+
o && /* @__PURE__ */ t.jsx(
|
|
893
893
|
x,
|
|
894
894
|
{
|
|
895
895
|
name: "Trash",
|
|
@@ -916,7 +916,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
916
916
|
popupPosition: c
|
|
917
917
|
}
|
|
918
918
|
),
|
|
919
|
-
|
|
919
|
+
i && /* @__PURE__ */ t.jsxs(
|
|
920
920
|
X,
|
|
921
921
|
{
|
|
922
922
|
className: Z.button,
|
|
@@ -946,7 +946,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
946
946
|
)
|
|
947
947
|
] });
|
|
948
948
|
}, Vn = (r) => {
|
|
949
|
-
const { isActiveButtons: n, setIsActiveButtons: e, buttons:
|
|
949
|
+
const { isActiveButtons: n, setIsActiveButtons: e, buttons: o, setButtons: i } = r;
|
|
950
950
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: z.buttonsBlock, children: [
|
|
951
951
|
/* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
|
|
952
952
|
/* @__PURE__ */ t.jsx("h3", { className: z.title, children: "Buttons" }),
|
|
@@ -961,8 +961,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
961
961
|
/* @__PURE__ */ t.jsx(
|
|
962
962
|
cs,
|
|
963
963
|
{
|
|
964
|
-
buttons:
|
|
965
|
-
setButtons:
|
|
964
|
+
buttons: o,
|
|
965
|
+
setButtons: i
|
|
966
966
|
}
|
|
967
967
|
)
|
|
968
968
|
] }) });
|
|
@@ -982,12 +982,12 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
982
982
|
controls: xs,
|
|
983
983
|
button: fs
|
|
984
984
|
}, bs = (r) => {
|
|
985
|
-
const { label: n, min: e = 1, max:
|
|
986
|
-
a <
|
|
985
|
+
const { label: n, min: e = 1, max: o = 4, step: i = 1, count: a, setCount: s } = r, [c, m] = f.useState(!1), $ = Array.from({ length: (o - e) / i + 1 }), p = (a - e) / (o - e) * 100, k = () => {
|
|
986
|
+
a < o && s(a + i);
|
|
987
987
|
}, j = () => {
|
|
988
|
-
a > e && s(a -
|
|
988
|
+
a > e && s(a - i);
|
|
989
989
|
}, d = (_) => {
|
|
990
|
-
const l = e + _ *
|
|
990
|
+
const l = e + _ * i;
|
|
991
991
|
s(l);
|
|
992
992
|
};
|
|
993
993
|
return /* @__PURE__ */ t.jsxs("div", { className: I.wrapper, children: [
|
|
@@ -1003,17 +1003,17 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1003
1003
|
}
|
|
1004
1004
|
),
|
|
1005
1005
|
/* @__PURE__ */ t.jsx("div", { className: I.dots, children: $.map((_, l) => {
|
|
1006
|
-
const B = l <= (a - e) /
|
|
1006
|
+
const B = l <= (a - e) / i;
|
|
1007
1007
|
return /* @__PURE__ */ t.jsx(
|
|
1008
1008
|
"button",
|
|
1009
1009
|
{
|
|
1010
1010
|
onClick: () => d(l),
|
|
1011
|
-
className:
|
|
1011
|
+
className: M(I.dot, {
|
|
1012
1012
|
[I.active]: B,
|
|
1013
1013
|
[I.inactive]: !B,
|
|
1014
1014
|
[I.dragging]: c
|
|
1015
1015
|
}),
|
|
1016
|
-
"aria-label": `Set value to ${e + l *
|
|
1016
|
+
"aria-label": `Set value to ${e + l * i}`
|
|
1017
1017
|
},
|
|
1018
1018
|
l
|
|
1019
1019
|
);
|
|
@@ -1023,8 +1023,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1023
1023
|
{
|
|
1024
1024
|
type: "range",
|
|
1025
1025
|
min: e,
|
|
1026
|
-
max:
|
|
1027
|
-
step:
|
|
1026
|
+
max: o,
|
|
1027
|
+
step: i,
|
|
1028
1028
|
value: a,
|
|
1029
1029
|
onChange: (_) => s(Number(_.target.value)),
|
|
1030
1030
|
onMouseDown: () => m(!0),
|
|
@@ -1041,11 +1041,11 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1041
1041
|
{
|
|
1042
1042
|
type: "number",
|
|
1043
1043
|
min: e,
|
|
1044
|
-
max:
|
|
1044
|
+
max: o,
|
|
1045
1045
|
paddingless: !0,
|
|
1046
1046
|
onChange: (_) => {
|
|
1047
1047
|
const l = Number(_);
|
|
1048
|
-
l >
|
|
1048
|
+
l > o ? s(o) : l < e ? s(e) : s(l);
|
|
1049
1049
|
},
|
|
1050
1050
|
value: String(a)
|
|
1051
1051
|
}
|
|
@@ -1055,7 +1055,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1055
1055
|
"button",
|
|
1056
1056
|
{
|
|
1057
1057
|
onClick: k,
|
|
1058
|
-
disabled: a >=
|
|
1058
|
+
disabled: a >= o,
|
|
1059
1059
|
className: I.button,
|
|
1060
1060
|
"aria-label": "Increment count",
|
|
1061
1061
|
children: /* @__PURE__ */ t.jsx(
|
|
@@ -1089,7 +1089,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1089
1089
|
] })
|
|
1090
1090
|
] })
|
|
1091
1091
|
] });
|
|
1092
|
-
}, js = "_subtitle_16rdk_1", vs = "_header_16rdk_8", ks = "_text_16rdk_9", ys = "_productsBlock_16rdk_10", $s = "_top_16rdk_22", Ns = "_itemsBlock_16rdk_31", Cs = "_typeTexts_16rdk_37", Is = "_block_16rdk_44", Ps = "_active_16rdk_57", Bs = "_products_16rdk_10", ws = "_product_16rdk_10", Ts = "_button_16rdk_76", qs = "_image_16rdk_87", As = "_info_16rdk_94", Ss = "_name_16rdk_106", Os = "_buttons_16rdk_110", Ds = "_modal_16rdk_117", Es = "_link_16rdk_137",
|
|
1092
|
+
}, js = "_subtitle_16rdk_1", vs = "_header_16rdk_8", ks = "_text_16rdk_9", ys = "_productsBlock_16rdk_10", $s = "_top_16rdk_22", Ns = "_itemsBlock_16rdk_31", Cs = "_typeTexts_16rdk_37", Is = "_block_16rdk_44", Ps = "_active_16rdk_57", Bs = "_products_16rdk_10", ws = "_product_16rdk_10", Ts = "_button_16rdk_76", qs = "_image_16rdk_87", As = "_info_16rdk_94", Ss = "_name_16rdk_106", Os = "_buttons_16rdk_110", Ds = "_modal_16rdk_117", Es = "_link_16rdk_137", Ms = "_modalOptions_16rdk_143", T = {
|
|
1093
1093
|
subtitle: js,
|
|
1094
1094
|
header: vs,
|
|
1095
1095
|
text: ks,
|
|
@@ -1108,9 +1108,9 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1108
1108
|
buttons: Os,
|
|
1109
1109
|
modal: Ds,
|
|
1110
1110
|
link: Es,
|
|
1111
|
-
modalOptions:
|
|
1112
|
-
},
|
|
1113
|
-
const { activeItem: n, setActiveItem: e, popupPosition:
|
|
1111
|
+
modalOptions: Ms
|
|
1112
|
+
}, Ls = (r) => {
|
|
1113
|
+
const { activeItem: n, setActiveItem: e, popupPosition: o, setIsOpenModal: i } = r;
|
|
1114
1114
|
return /* @__PURE__ */ t.jsxs(
|
|
1115
1115
|
"div",
|
|
1116
1116
|
{
|
|
@@ -1119,8 +1119,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1119
1119
|
a.stopPropagation();
|
|
1120
1120
|
},
|
|
1121
1121
|
style: {
|
|
1122
|
-
top: `${
|
|
1123
|
-
left: `${
|
|
1122
|
+
top: `${o.top}px`,
|
|
1123
|
+
left: `${o.left}px`
|
|
1124
1124
|
},
|
|
1125
1125
|
children: [
|
|
1126
1126
|
/* @__PURE__ */ t.jsxs("div", { className: T.top, children: [
|
|
@@ -1133,7 +1133,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1133
1133
|
width: 20,
|
|
1134
1134
|
hoverable: !0,
|
|
1135
1135
|
onClick: () => {
|
|
1136
|
-
|
|
1136
|
+
i(!1), e(null);
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
)
|
|
@@ -1156,7 +1156,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1156
1156
|
}
|
|
1157
1157
|
);
|
|
1158
1158
|
}, Rs = (r) => {
|
|
1159
|
-
const { index: n, moveProduct: e, children:
|
|
1159
|
+
const { index: n, moveProduct: e, children: o } = r, [, i] = ut({
|
|
1160
1160
|
accept: "product",
|
|
1161
1161
|
hover(c) {
|
|
1162
1162
|
c.index !== n && (e(c.index, n), c.index = n);
|
|
@@ -1171,17 +1171,17 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1171
1171
|
return /* @__PURE__ */ t.jsx(
|
|
1172
1172
|
"div",
|
|
1173
1173
|
{
|
|
1174
|
-
ref: (c) => s(
|
|
1174
|
+
ref: (c) => s(i(c)),
|
|
1175
1175
|
className: `${T.product} ${a ? T.dragging : ""}`,
|
|
1176
|
-
children:
|
|
1176
|
+
children: o
|
|
1177
1177
|
}
|
|
1178
1178
|
);
|
|
1179
1179
|
}, Fn = (r) => {
|
|
1180
1180
|
const {
|
|
1181
1181
|
isActiveItems: n,
|
|
1182
1182
|
setIsActiveItems: e,
|
|
1183
|
-
items:
|
|
1184
|
-
setItems:
|
|
1183
|
+
items: o,
|
|
1184
|
+
setItems: i,
|
|
1185
1185
|
other: a,
|
|
1186
1186
|
title: s,
|
|
1187
1187
|
subtitle: c,
|
|
@@ -1195,9 +1195,9 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1195
1195
|
} = r, [l, B] = f.useState(null), [q, Q] = f.useState({
|
|
1196
1196
|
top: 0,
|
|
1197
1197
|
left: 0
|
|
1198
|
-
}), [F, y] = f.useState(!1),
|
|
1199
|
-
const A = [...
|
|
1200
|
-
A.splice(v, 0, C),
|
|
1198
|
+
}), [F, y] = f.useState(!1), L = (h, v) => {
|
|
1199
|
+
const A = [...o], [C] = A.splice(h, 1);
|
|
1200
|
+
A.splice(v, 0, C), i(A);
|
|
1201
1201
|
};
|
|
1202
1202
|
f.useEffect(() => {
|
|
1203
1203
|
const h = () => {
|
|
@@ -1208,8 +1208,8 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1208
1208
|
};
|
|
1209
1209
|
}, []), f.useEffect(() => {
|
|
1210
1210
|
if (l) {
|
|
1211
|
-
const h = [...
|
|
1212
|
-
|
|
1211
|
+
const h = [...o].map((v) => v.id === l.id ? l : v);
|
|
1212
|
+
i(h);
|
|
1213
1213
|
}
|
|
1214
1214
|
}, [l]);
|
|
1215
1215
|
const R = (h, v) => {
|
|
@@ -1256,7 +1256,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1256
1256
|
Y,
|
|
1257
1257
|
{
|
|
1258
1258
|
onChange: (C) => {
|
|
1259
|
-
const U = [...
|
|
1259
|
+
const U = [...o], O = Number(C.split(" ")[1]), u = _.find((N) => N.id === O);
|
|
1260
1260
|
if (!u) return;
|
|
1261
1261
|
const w = {
|
|
1262
1262
|
...u.productData.stats,
|
|
@@ -1272,7 +1272,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1272
1272
|
...h,
|
|
1273
1273
|
name: C,
|
|
1274
1274
|
listingId: O
|
|
1275
|
-
}),
|
|
1275
|
+
}), i([...S]);
|
|
1276
1276
|
},
|
|
1277
1277
|
value: h.name,
|
|
1278
1278
|
options: [..._.map((C) => `Product ${C.id}`)],
|
|
@@ -1299,7 +1299,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1299
1299
|
width: 20,
|
|
1300
1300
|
height: 20,
|
|
1301
1301
|
fill: "#C12A2A",
|
|
1302
|
-
onClick: () => o
|
|
1302
|
+
onClick: () => i(o.filter((C) => C.id !== h.id))
|
|
1303
1303
|
}
|
|
1304
1304
|
)
|
|
1305
1305
|
] })
|
|
@@ -1309,7 +1309,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1309
1309
|
{
|
|
1310
1310
|
product: h,
|
|
1311
1311
|
index: v,
|
|
1312
|
-
moveProduct:
|
|
1312
|
+
moveProduct: L,
|
|
1313
1313
|
children: A
|
|
1314
1314
|
},
|
|
1315
1315
|
h.id
|
|
@@ -1334,7 +1334,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1334
1334
|
)
|
|
1335
1335
|
] }),
|
|
1336
1336
|
F && l && /* @__PURE__ */ t.jsx(
|
|
1337
|
-
|
|
1337
|
+
Ls,
|
|
1338
1338
|
{
|
|
1339
1339
|
activeItem: l,
|
|
1340
1340
|
setActiveItem: B,
|
|
@@ -1344,14 +1344,14 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1344
1344
|
),
|
|
1345
1345
|
/* @__PURE__ */ t.jsxs("div", { className: T.products, children: [
|
|
1346
1346
|
c && /* @__PURE__ */ t.jsx("h5", { className: T.subtitle, children: c }),
|
|
1347
|
-
$ ? /* @__PURE__ */ t.jsx(rt, { backend: dt, children:
|
|
1347
|
+
$ ? /* @__PURE__ */ t.jsx(rt, { backend: dt, children: o.map((h, v) => et(h, v)) }) : o.map((h, v) => et(h, v)),
|
|
1348
1348
|
j && /* @__PURE__ */ t.jsxs(
|
|
1349
1349
|
X,
|
|
1350
1350
|
{
|
|
1351
1351
|
className: T.button,
|
|
1352
1352
|
size: "s",
|
|
1353
1353
|
onClick: () => {
|
|
1354
|
-
const h = [...
|
|
1354
|
+
const h = [...o], v = _[0].id;
|
|
1355
1355
|
h.push({
|
|
1356
1356
|
name: `Product ${v}`,
|
|
1357
1357
|
id: tt(),
|
|
@@ -1363,7 +1363,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1363
1363
|
newPrice: _[0].productData.minPrice.amount,
|
|
1364
1364
|
oldPrice: _[0].productData.compareAtPrice.amount
|
|
1365
1365
|
}
|
|
1366
|
-
}),
|
|
1366
|
+
}), i(h);
|
|
1367
1367
|
},
|
|
1368
1368
|
children: [
|
|
1369
1369
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
@@ -1405,7 +1405,7 @@ const xt = "_accordion_9e4oa_1", ft = "_header_9e4oa_9", bt = "_icon_9e4oa_18",
|
|
|
1405
1405
|
};
|
|
1406
1406
|
var pt = /* @__PURE__ */ ((r) => (r.ONE_TIME = "One-Time", r.RECURRING = "Subscribe & Save", r))(pt || {});
|
|
1407
1407
|
const Un = (r) => {
|
|
1408
|
-
const { variants: n } = r, [e,
|
|
1408
|
+
const { variants: n } = r, [e, o] = f.useState(n[0]), [i, a] = f.useState(e.chargeTypes[0]), s = ot(), [c, m] = f.useState(1), { reset: $, addProductToCart: p, getProducts: k } = at();
|
|
1409
1409
|
async function j() {
|
|
1410
1410
|
await k(), await p({
|
|
1411
1411
|
productId: r.id,
|
|
@@ -1435,8 +1435,8 @@ const Un = (r) => {
|
|
|
1435
1435
|
/* @__PURE__ */ t.jsx("div", { className: b.chargeTypes, children: e.chargeTypes.map((l) => /* @__PURE__ */ t.jsx(
|
|
1436
1436
|
"div",
|
|
1437
1437
|
{
|
|
1438
|
-
className:
|
|
1439
|
-
[b.chargeActive]:
|
|
1438
|
+
className: M(b.charge, {
|
|
1439
|
+
[b.chargeActive]: i === l
|
|
1440
1440
|
}),
|
|
1441
1441
|
onClick: () => a(l),
|
|
1442
1442
|
children: pt[l]
|
|
@@ -1446,19 +1446,19 @@ const Un = (r) => {
|
|
|
1446
1446
|
/* @__PURE__ */ t.jsx("div", { className: b.variants, children: n.map((l) => /* @__PURE__ */ t.jsxs(
|
|
1447
1447
|
"div",
|
|
1448
1448
|
{
|
|
1449
|
-
className:
|
|
1449
|
+
className: M(b.variant, {
|
|
1450
1450
|
[b.activeVariant]: e.id === l.id
|
|
1451
1451
|
}),
|
|
1452
|
-
onClick: () =>
|
|
1452
|
+
onClick: () => o(l),
|
|
1453
1453
|
children: [
|
|
1454
1454
|
/* @__PURE__ */ t.jsxs("div", { className: b.variantInfo, children: [
|
|
1455
1455
|
/* @__PURE__ */ t.jsx("span", { className: b.title, children: l.name }),
|
|
1456
1456
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1457
1457
|
"$",
|
|
1458
|
-
|
|
1458
|
+
i === "ONE_TIME" ? l.price.amount : l.subscriptionSettings.price.amount
|
|
1459
1459
|
] })
|
|
1460
1460
|
] }),
|
|
1461
|
-
/* @__PURE__ */ t.jsx("div", { children:
|
|
1461
|
+
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: b.stock, children: [
|
|
1462
1462
|
l.quantity.restrictions.max || 0,
|
|
1463
1463
|
" in stock"
|
|
1464
1464
|
] }) })
|
|
@@ -1471,7 +1471,7 @@ const Un = (r) => {
|
|
|
1471
1471
|
"div",
|
|
1472
1472
|
{
|
|
1473
1473
|
onClick: () => {
|
|
1474
|
-
|
|
1474
|
+
i === "ONE_TIME" && (c > 1 ? m((l) => l - 1) : m(1));
|
|
1475
1475
|
},
|
|
1476
1476
|
className: b.button,
|
|
1477
1477
|
children: /* @__PURE__ */ t.jsx(x, { name: "Minus" })
|
|
@@ -1482,7 +1482,7 @@ const Un = (r) => {
|
|
|
1482
1482
|
"div",
|
|
1483
1483
|
{
|
|
1484
1484
|
onClick: () => {
|
|
1485
|
-
|
|
1485
|
+
i === "ONE_TIME" && m((l) => l + 1);
|
|
1486
1486
|
},
|
|
1487
1487
|
className: b.button,
|
|
1488
1488
|
children: /* @__PURE__ */ t.jsx(x, { name: "Plus" })
|
|
@@ -1507,7 +1507,7 @@ const Un = (r) => {
|
|
|
1507
1507
|
] }),
|
|
1508
1508
|
/* @__PURE__ */ t.jsxs("div", { className: b.info, children: [
|
|
1509
1509
|
/* @__PURE__ */ t.jsx("span", { children: "Price" }),
|
|
1510
|
-
/* @__PURE__ */ t.jsx("div", { className: b.infoRight, children:
|
|
1510
|
+
/* @__PURE__ */ t.jsx("div", { className: b.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: b.price, children: [
|
|
1511
1511
|
/* @__PURE__ */ t.jsxs("span", { className: b.newPrice, children: [
|
|
1512
1512
|
"$ ",
|
|
1513
1513
|
(e.price.amount || 0) * c
|
|
@@ -1543,7 +1543,7 @@ const Un = (r) => {
|
|
|
1543
1543
|
children: "Buy Now"
|
|
1544
1544
|
}
|
|
1545
1545
|
),
|
|
1546
|
-
/* @__PURE__ */ t.jsx(
|
|
1546
|
+
i === "ONE_TIME" && /* @__PURE__ */ t.jsx(
|
|
1547
1547
|
X,
|
|
1548
1548
|
{
|
|
1549
1549
|
type: "Secondary",
|
|
@@ -1582,38 +1582,38 @@ const Un = (r) => {
|
|
|
1582
1582
|
block: An,
|
|
1583
1583
|
shoppingCount: Sn
|
|
1584
1584
|
}, zn = (r) => {
|
|
1585
|
-
const { shopping: n, signUp: e } = r,
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1585
|
+
const { shopping: n, signUp: e } = r, o = ot();
|
|
1586
|
+
function i(a) {
|
|
1587
|
+
o(a);
|
|
1588
1588
|
}
|
|
1589
1589
|
return /* @__PURE__ */ t.jsxs("div", { className: g.buttons, children: [
|
|
1590
1590
|
n && /* @__PURE__ */ t.jsx(On, {}),
|
|
1591
1591
|
/* @__PURE__ */ t.jsx(
|
|
1592
1592
|
"div",
|
|
1593
1593
|
{
|
|
1594
|
-
className:
|
|
1595
|
-
onClick: () =>
|
|
1594
|
+
className: M(g.button, g.login),
|
|
1595
|
+
onClick: () => i("/customer-dash"),
|
|
1596
1596
|
children: "Login"
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
1599
|
e && /* @__PURE__ */ t.jsx(
|
|
1600
1600
|
"div",
|
|
1601
1601
|
{
|
|
1602
|
-
className:
|
|
1603
|
-
onClick: () =>
|
|
1602
|
+
className: M(g.button, g.login, g.signUp),
|
|
1603
|
+
onClick: () => i("/customer-dash"),
|
|
1604
1604
|
children: "Sign Up"
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] });
|
|
1608
1608
|
}, On = () => {
|
|
1609
1609
|
const [r, n] = f.useState(!1), { cart: e } = at();
|
|
1610
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1610
|
+
return console.log(e), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1611
1611
|
/* @__PURE__ */ t.jsxs(
|
|
1612
1612
|
"div",
|
|
1613
1613
|
{
|
|
1614
1614
|
className: g.button,
|
|
1615
|
-
onClick: (
|
|
1616
|
-
|
|
1615
|
+
onClick: (o) => {
|
|
1616
|
+
o.stopPropagation(), n(!0);
|
|
1617
1617
|
},
|
|
1618
1618
|
children: [
|
|
1619
1619
|
/* @__PURE__ */ t.jsx(
|
|
@@ -1630,7 +1630,7 @@ const Un = (r) => {
|
|
|
1630
1630
|
r && /* @__PURE__ */ t.jsx(gt, { close: n, children: /* @__PURE__ */ t.jsx(Dn, {}) })
|
|
1631
1631
|
] });
|
|
1632
1632
|
}, Dn = () => {
|
|
1633
|
-
const { cart: r, reset: n, getProducts: e, getTotalAndDiscount:
|
|
1633
|
+
const { cart: r, reset: n, getProducts: e, getTotalAndDiscount: o, updateQuantityOfProduct: i } = at(), [a, s] = f.useState([]), c = ot();
|
|
1634
1634
|
function m(d) {
|
|
1635
1635
|
for (let _ = 0; _ < r.parts.length; _++)
|
|
1636
1636
|
for (let l = 0; l < d.variants.length; l++)
|
|
@@ -1647,14 +1647,14 @@ const Un = (r) => {
|
|
|
1647
1647
|
c(d);
|
|
1648
1648
|
}
|
|
1649
1649
|
function k(d) {
|
|
1650
|
-
|
|
1650
|
+
i({
|
|
1651
1651
|
productId: d.id,
|
|
1652
1652
|
productVariantId: d.activeVariantId,
|
|
1653
1653
|
quantity: d.quantity + 1
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
1656
|
function j(d) {
|
|
1657
|
-
|
|
1657
|
+
i({
|
|
1658
1658
|
productId: d.id,
|
|
1659
1659
|
productVariantId: d.activeVariantId,
|
|
1660
1660
|
quantity: d.quantity - 1
|
|
@@ -1683,7 +1683,7 @@ const Un = (r) => {
|
|
|
1683
1683
|
/* @__PURE__ */ t.jsx(
|
|
1684
1684
|
"button",
|
|
1685
1685
|
{
|
|
1686
|
-
className:
|
|
1686
|
+
className: M(g.clear, {
|
|
1687
1687
|
[g.activeClear]: r.parts.length > 0
|
|
1688
1688
|
}),
|
|
1689
1689
|
disabled: r.parts.length === 0,
|
|
@@ -1774,7 +1774,7 @@ const Un = (r) => {
|
|
|
1774
1774
|
] }),
|
|
1775
1775
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1776
1776
|
"$",
|
|
1777
|
-
|
|
1777
|
+
o().total
|
|
1778
1778
|
] })
|
|
1779
1779
|
] }),
|
|
1780
1780
|
/* @__PURE__ */ t.jsx(X, { onClick: () => p("/checkout"), children: "Checkout" })
|