@billgangcom/theme-lib 1.35.0 → 1.36.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 +3 -3
- package/dist/builder.es.js +162 -162
- package/dist/{index-miO7bKV5.cjs → index-BnJDbbG8.cjs} +1 -1
- package/dist/{index-fMRXTmQw.js → index-DwwDB4Kw.js} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +557 -560
- package/package.json +1 -1
package/dist/ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as t, I as v, c as
|
|
2
|
-
import { p as fa, L as xa } from "./index-
|
|
1
|
+
import { j as t, I as v, c as F, a as X, S as tt, T as Ot, C as gt, b as et, u as $t, d as It, D as Nt, e as wt, v as Ct, B as at, f as mt, P as Bt, g as St, h as Tt, i as Ht, k as bt, l as Pt, m as qt, M as Et, n as Dt, o as zt } from "./index-DwwDB4Kw.js";
|
|
2
|
+
import { p as fa, L as xa } from "./index-DwwDB4Kw.js";
|
|
3
3
|
import g from "react";
|
|
4
4
|
import "@phosphor-icons/react";
|
|
5
5
|
const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibiw_15", Yt = "_subtitle_3ibiw_22", Gt = "_alignmentContent_3ibiw_29", Wt = "_alignments_3ibiw_37", Xt = "_alignment_3ibiw_8", Jt = "_circle_3ibiw_63", Qt = "_paddings_3ibiw_70", Kt = "_padding_3ibiw_70", Zt = "_active_3ibiw_94", te = "_input_3ibiw_101", J = {
|
|
@@ -57,7 +57,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
57
57
|
return "AlignBottom";
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const [
|
|
60
|
+
const [m, n] = g.useState(null);
|
|
61
61
|
return /* @__PURE__ */ t.jsxs("div", { className: J.layout, children: [
|
|
62
62
|
/* @__PURE__ */ t.jsx("h3", { className: J.title, children: "Layout" }),
|
|
63
63
|
/* @__PURE__ */ t.jsxs("div", { className: J.alignmentBlock, children: [
|
|
@@ -88,8 +88,8 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
88
88
|
/* @__PURE__ */ t.jsx("div", { className: J.paddings, children: se.map((o) => /* @__PURE__ */ t.jsxs(
|
|
89
89
|
"label",
|
|
90
90
|
{
|
|
91
|
-
className:
|
|
92
|
-
[J.active]:
|
|
91
|
+
className: F(J.padding, {
|
|
92
|
+
[J.active]: m === o
|
|
93
93
|
}),
|
|
94
94
|
onFocus: () => {
|
|
95
95
|
n(o);
|
|
@@ -156,13 +156,13 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
156
156
|
return /* @__PURE__ */ t.jsx("div", { className: vt.typeTexts, children: me.map((i) => /* @__PURE__ */ t.jsx(
|
|
157
157
|
"div",
|
|
158
158
|
{
|
|
159
|
-
className:
|
|
159
|
+
className: F(vt.block, {
|
|
160
160
|
[vt.active]: c.includes(i)
|
|
161
161
|
}),
|
|
162
162
|
onClick: () => {
|
|
163
163
|
const a = [...c];
|
|
164
164
|
if (a.includes(i)) {
|
|
165
|
-
const l = a.filter((
|
|
165
|
+
const l = a.filter((m) => m !== i);
|
|
166
166
|
e(l);
|
|
167
167
|
} else
|
|
168
168
|
a.push(i), e(a);
|
|
@@ -187,12 +187,12 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
187
187
|
text: i,
|
|
188
188
|
setText: a,
|
|
189
189
|
setTypesText: l,
|
|
190
|
-
title:
|
|
190
|
+
title: m,
|
|
191
191
|
subtitle: n = "Items"
|
|
192
192
|
} = r;
|
|
193
193
|
return /* @__PURE__ */ t.jsxs("div", { className: ht.text, children: [
|
|
194
|
-
(
|
|
195
|
-
|
|
194
|
+
(m || e !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: ht.top, children: [
|
|
195
|
+
m && /* @__PURE__ */ t.jsx("h3", { className: ht.title, children: m }),
|
|
196
196
|
e !== void 0 && s && /* @__PURE__ */ t.jsx(
|
|
197
197
|
tt,
|
|
198
198
|
{
|
|
@@ -220,7 +220,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
220
220
|
)
|
|
221
221
|
] })
|
|
222
222
|
] });
|
|
223
|
-
}, he = "_title_157lh_1", _e = "_subtitle_157lh_5", pe = "_header_157lh_12", ge = "_text_157lh_13", fe = "_productsBlock_157lh_14", xe = "_top_157lh_26", be = "_itemsBlock_157lh_35", je = "_typeTexts_157lh_41", ve = "_block_157lh_48", ye = "_active_157lh_61", ke = "_products_157lh_14", $e = "_product_157lh_14", Ie = "_button_157lh_80", Ne = "_disabled_157lh_91", we = "_image_157lh_95", Ce = "_info_157lh_102", Be = "_name_157lh_114", Se = "_buttons_157lh_118", Te = "_modal_157lh_125", Pe = "_link_157lh_145", Ae = "_modalOptions_157lh_151", Oe = "_addButton_157lh_163", qe = "_deleteButton_157lh_178",
|
|
223
|
+
}, he = "_title_157lh_1", _e = "_subtitle_157lh_5", pe = "_header_157lh_12", ge = "_text_157lh_13", fe = "_productsBlock_157lh_14", xe = "_top_157lh_26", be = "_itemsBlock_157lh_35", je = "_typeTexts_157lh_41", ve = "_block_157lh_48", ye = "_active_157lh_61", ke = "_products_157lh_14", $e = "_product_157lh_14", Ie = "_button_157lh_80", Ne = "_disabled_157lh_91", we = "_image_157lh_95", Ce = "_info_157lh_102", Be = "_name_157lh_114", Se = "_buttons_157lh_118", Te = "_modal_157lh_125", Pe = "_link_157lh_145", Ae = "_modalOptions_157lh_151", Oe = "_addButton_157lh_163", qe = "_deleteButton_157lh_178", H = {
|
|
224
224
|
title: he,
|
|
225
225
|
subtitle: _e,
|
|
226
226
|
header: pe,
|
|
@@ -247,14 +247,14 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
247
247
|
}, Ee = g.forwardRef(
|
|
248
248
|
(r, c) => {
|
|
249
249
|
const { activeItem: e, setActiveItem: s, popupPosition: i, modalOptions: a, setIsOpenModal: l } = r;
|
|
250
|
-
function
|
|
250
|
+
function m(n, o) {
|
|
251
251
|
return n.length > o ? `${n.slice(0, o)}...` : n;
|
|
252
252
|
}
|
|
253
253
|
return /* @__PURE__ */ t.jsxs(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
256
256
|
ref: c,
|
|
257
|
-
className:
|
|
257
|
+
className: H.modal,
|
|
258
258
|
onClick: (n) => {
|
|
259
259
|
n.stopPropagation();
|
|
260
260
|
},
|
|
@@ -263,8 +263,8 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
263
263
|
left: `${i.left}px`
|
|
264
264
|
},
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
267
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
266
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
|
|
267
|
+
/* @__PURE__ */ t.jsx("h3", { className: H.title, children: m(e.name, 20) }),
|
|
268
268
|
/* @__PURE__ */ t.jsx(
|
|
269
269
|
v,
|
|
270
270
|
{
|
|
@@ -278,7 +278,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
278
278
|
}
|
|
279
279
|
)
|
|
280
280
|
] }),
|
|
281
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
281
|
+
/* @__PURE__ */ t.jsx("div", { className: H.modalOptions, children: a.map((n) => {
|
|
282
282
|
if (n.type === "image")
|
|
283
283
|
return /* @__PURE__ */ t.jsx(
|
|
284
284
|
gt,
|
|
@@ -335,7 +335,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
|
|
|
335
335
|
}
|
|
336
336
|
);
|
|
337
337
|
if (n.type === "inputSwitch")
|
|
338
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
338
|
+
return /* @__PURE__ */ t.jsxs("div", { className: H.link, children: [
|
|
339
339
|
/* @__PURE__ */ t.jsx(
|
|
340
340
|
X,
|
|
341
341
|
{
|
|
@@ -437,7 +437,7 @@ function Me({ product: r, children: c }) {
|
|
|
437
437
|
setNodeRef: i,
|
|
438
438
|
transform: a,
|
|
439
439
|
transition: l,
|
|
440
|
-
isDragging:
|
|
440
|
+
isDragging: m
|
|
441
441
|
} = St({
|
|
442
442
|
id: r.id
|
|
443
443
|
}), n = {
|
|
@@ -449,7 +449,7 @@ function Me({ product: r, children: c }) {
|
|
|
449
449
|
{
|
|
450
450
|
ref: i,
|
|
451
451
|
style: n,
|
|
452
|
-
className: `${
|
|
452
|
+
className: `${H.product} ${m ? H.dragging : ""}`,
|
|
453
453
|
...e,
|
|
454
454
|
...s,
|
|
455
455
|
children: c
|
|
@@ -464,25 +464,25 @@ const He = (r) => {
|
|
|
464
464
|
setItems: i,
|
|
465
465
|
other: a,
|
|
466
466
|
title: l,
|
|
467
|
-
subtitle:
|
|
467
|
+
subtitle: m,
|
|
468
468
|
editable: n = !0,
|
|
469
469
|
draggable: o = !1,
|
|
470
470
|
withImage: f = !1,
|
|
471
|
-
deletable:
|
|
472
|
-
addable:
|
|
473
|
-
itemsType:
|
|
474
|
-
itemsPlaceholder:
|
|
471
|
+
deletable: N = !0,
|
|
472
|
+
addable: _ = !0,
|
|
473
|
+
itemsType: h,
|
|
474
|
+
itemsPlaceholder: p = "",
|
|
475
475
|
itemsOptions: d,
|
|
476
|
-
hasRangeSelector:
|
|
477
|
-
rangeSelectorOptions:
|
|
476
|
+
hasRangeSelector: C = !1,
|
|
477
|
+
rangeSelectorOptions: D,
|
|
478
478
|
modalOptions: y,
|
|
479
479
|
addableOptions: L = {},
|
|
480
480
|
limit: B,
|
|
481
|
-
autoScrollInterval:
|
|
482
|
-
} = r, [
|
|
481
|
+
autoScrollInterval: T
|
|
482
|
+
} = r, [x, k] = g.useState(null), [V, K] = g.useState({
|
|
483
483
|
top: 0,
|
|
484
484
|
left: 0
|
|
485
|
-
}), [b,
|
|
485
|
+
}), [b, I] = g.useState(null), P = g.useRef(null), [U, q] = g.useState(!1), M = $t(
|
|
486
486
|
It(Bt, {
|
|
487
487
|
activationConstraint: {
|
|
488
488
|
distance: 5
|
|
@@ -490,41 +490,41 @@ const He = (r) => {
|
|
|
490
490
|
})
|
|
491
491
|
);
|
|
492
492
|
g.useEffect(() => {
|
|
493
|
-
const
|
|
494
|
-
|
|
493
|
+
const u = () => {
|
|
494
|
+
k(null), q(!1);
|
|
495
495
|
};
|
|
496
|
-
return document.body.addEventListener("click",
|
|
497
|
-
|
|
496
|
+
return document.body.addEventListener("click", u), k(null), q(!1), () => {
|
|
497
|
+
k(null), q(!1), document.body.removeEventListener("click", u);
|
|
498
498
|
};
|
|
499
499
|
}, []), g.useEffect(() => {
|
|
500
|
-
if (
|
|
501
|
-
const
|
|
502
|
-
i(
|
|
500
|
+
if (x) {
|
|
501
|
+
const u = [...s].map(($) => $.id === x.id ? x : $);
|
|
502
|
+
i(u);
|
|
503
503
|
}
|
|
504
|
-
}, [
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
507
|
-
let
|
|
508
|
-
|
|
509
|
-
top:
|
|
504
|
+
}, [x]), g.useEffect(() => {
|
|
505
|
+
if (P.current && b) {
|
|
506
|
+
const u = P.current.getBoundingClientRect().height, $ = window.innerHeight;
|
|
507
|
+
let A = b.top;
|
|
508
|
+
A + u > $ + window.scrollY - 200 && (A = $ + window.scrollY - u - 200), A < 0 && (A = 10), K({
|
|
509
|
+
top: A,
|
|
510
510
|
left: b.left
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
|
-
}, [
|
|
514
|
-
const Z = (
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
top:
|
|
519
|
-
left:
|
|
520
|
-
}),
|
|
513
|
+
}, [P.current, b]);
|
|
514
|
+
const Z = (u, $) => {
|
|
515
|
+
u.stopPropagation();
|
|
516
|
+
const A = u.target.getBoundingClientRect();
|
|
517
|
+
I({
|
|
518
|
+
top: A.top + window.scrollY,
|
|
519
|
+
left: A.left - 30
|
|
520
|
+
}), k($), q(!0);
|
|
521
521
|
};
|
|
522
|
-
function ct(
|
|
522
|
+
function ct(u) {
|
|
523
523
|
if (f)
|
|
524
|
-
return
|
|
524
|
+
return u ? /* @__PURE__ */ t.jsx(
|
|
525
525
|
"img",
|
|
526
526
|
{
|
|
527
|
-
src: `https://imagedelivery.net/${
|
|
527
|
+
src: `https://imagedelivery.net/${u[0]}/w=1000`,
|
|
528
528
|
alt: "image",
|
|
529
529
|
width: 16,
|
|
530
530
|
height: 16
|
|
@@ -539,18 +539,18 @@ const He = (r) => {
|
|
|
539
539
|
}
|
|
540
540
|
);
|
|
541
541
|
}
|
|
542
|
-
const j = (
|
|
543
|
-
const { active:
|
|
544
|
-
if (
|
|
545
|
-
const R = s.findIndex((
|
|
542
|
+
const j = (u) => {
|
|
543
|
+
const { active: $, over: A } = u;
|
|
544
|
+
if (A && $.id !== A.id) {
|
|
545
|
+
const R = s.findIndex((O) => O.id === $.id), Y = s.findIndex((O) => O.id === A.id);
|
|
546
546
|
if (R !== -1 && Y !== -1) {
|
|
547
|
-
const
|
|
548
|
-
|
|
547
|
+
const O = [...s], [lt] = O.splice(R, 1);
|
|
548
|
+
O.splice(Y, 0, lt), i(O);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, E = (u, $) => {
|
|
552
552
|
var R, Y;
|
|
553
|
-
const
|
|
553
|
+
const A = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
554
554
|
o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
555
555
|
v,
|
|
556
556
|
{
|
|
@@ -560,65 +560,65 @@ const He = (r) => {
|
|
|
560
560
|
height: 20
|
|
561
561
|
}
|
|
562
562
|
) }),
|
|
563
|
-
|
|
563
|
+
h === "select" && d && /* @__PURE__ */ t.jsx(
|
|
564
564
|
et,
|
|
565
565
|
{
|
|
566
|
-
onChange: (
|
|
567
|
-
const lt = [...s], ut = d.find((ft) => ft.name ===
|
|
566
|
+
onChange: (O) => {
|
|
567
|
+
const lt = [...s], ut = d.find((ft) => ft.name === O);
|
|
568
568
|
if (!ut) return;
|
|
569
|
-
const rt = lt.map((ft) => ft.id ===
|
|
569
|
+
const rt = lt.map((ft) => ft.id === u.id ? {
|
|
570
570
|
...ut,
|
|
571
|
-
name:
|
|
571
|
+
name: O
|
|
572
572
|
} : ft);
|
|
573
|
-
|
|
574
|
-
...
|
|
575
|
-
name:
|
|
573
|
+
k({
|
|
574
|
+
...u,
|
|
575
|
+
name: O
|
|
576
576
|
}), i([...rt]);
|
|
577
577
|
},
|
|
578
|
-
value:
|
|
579
|
-
options: d.filter((
|
|
580
|
-
leftAddon: ct(
|
|
578
|
+
value: u.name,
|
|
579
|
+
options: d.filter((O) => !s.find((lt) => lt.name === O.name)).map((O) => O.name),
|
|
580
|
+
leftAddon: ct(u.images)
|
|
581
581
|
}
|
|
582
582
|
),
|
|
583
|
-
|
|
583
|
+
h === "input" && /* @__PURE__ */ t.jsx(
|
|
584
584
|
X,
|
|
585
585
|
{
|
|
586
|
-
onChange: (
|
|
587
|
-
const ut = [...s].map((rt) => rt.id ===
|
|
588
|
-
...
|
|
589
|
-
name:
|
|
586
|
+
onChange: (O) => {
|
|
587
|
+
const ut = [...s].map((rt) => rt.id === u.id ? {
|
|
588
|
+
...u,
|
|
589
|
+
name: O
|
|
590
590
|
} : rt);
|
|
591
591
|
i([...ut]);
|
|
592
592
|
},
|
|
593
|
-
value:
|
|
594
|
-
placeholder:
|
|
593
|
+
value: u.name,
|
|
594
|
+
placeholder: p
|
|
595
595
|
}
|
|
596
596
|
),
|
|
597
|
-
|
|
597
|
+
h === "image" && /* @__PURE__ */ t.jsx(
|
|
598
598
|
gt,
|
|
599
599
|
{
|
|
600
|
-
onChange: (
|
|
601
|
-
const ut = [...s].map((rt) => rt.id ===
|
|
602
|
-
...
|
|
603
|
-
images:
|
|
600
|
+
onChange: (O) => {
|
|
601
|
+
const ut = [...s].map((rt) => rt.id === u.id ? {
|
|
602
|
+
...u,
|
|
603
|
+
images: O
|
|
604
604
|
} : rt);
|
|
605
605
|
i([...ut]);
|
|
606
606
|
},
|
|
607
|
-
activeImage: (R = s.find((
|
|
607
|
+
activeImage: (R = s.find((O) => O.id === u.id)) != null && R.images ? (Y = s.find((O) => O.id === u.id)) == null ? void 0 : Y.images[0] : void 0
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
611
|
-
n && /* @__PURE__ */ t.jsx("div", { className:
|
|
610
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.buttons, children: [
|
|
611
|
+
n && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
612
612
|
v,
|
|
613
613
|
{
|
|
614
614
|
name: "Sliders",
|
|
615
615
|
hoverable: !0,
|
|
616
616
|
width: 20,
|
|
617
617
|
height: 20,
|
|
618
|
-
onClick: (
|
|
618
|
+
onClick: (O) => Z(O, u)
|
|
619
619
|
}
|
|
620
620
|
) }),
|
|
621
|
-
|
|
621
|
+
N && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
622
622
|
v,
|
|
623
623
|
{
|
|
624
624
|
name: "Trash",
|
|
@@ -626,7 +626,7 @@ const He = (r) => {
|
|
|
626
626
|
width: 20,
|
|
627
627
|
height: 20,
|
|
628
628
|
fill: "#C12A2A",
|
|
629
|
-
onClick: () => i(s.filter((
|
|
629
|
+
onClick: () => i(s.filter((O) => O.id !== u.id))
|
|
630
630
|
}
|
|
631
631
|
) })
|
|
632
632
|
] })
|
|
@@ -634,61 +634,61 @@ const He = (r) => {
|
|
|
634
634
|
return o ? /* @__PURE__ */ t.jsx(
|
|
635
635
|
Me,
|
|
636
636
|
{
|
|
637
|
-
product:
|
|
638
|
-
index:
|
|
639
|
-
children:
|
|
637
|
+
product: u,
|
|
638
|
+
index: $,
|
|
639
|
+
children: A
|
|
640
640
|
},
|
|
641
|
-
|
|
641
|
+
u.id
|
|
642
642
|
) : /* @__PURE__ */ t.jsx(
|
|
643
643
|
"div",
|
|
644
644
|
{
|
|
645
|
-
className:
|
|
646
|
-
children:
|
|
645
|
+
className: H.product,
|
|
646
|
+
children: A
|
|
647
647
|
},
|
|
648
|
-
|
|
648
|
+
u.id
|
|
649
649
|
);
|
|
650
650
|
};
|
|
651
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
652
|
-
(l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
653
|
-
l && /* @__PURE__ */ t.jsx("h3", { className:
|
|
651
|
+
return /* @__PURE__ */ t.jsxs("div", { className: H.productsBlock, children: [
|
|
652
|
+
(l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
|
|
653
|
+
l && /* @__PURE__ */ t.jsx("h3", { className: H.title, children: l }),
|
|
654
654
|
c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
655
655
|
tt,
|
|
656
656
|
{
|
|
657
657
|
current: c,
|
|
658
|
-
onChange: (
|
|
658
|
+
onChange: (u) => e == null ? void 0 : e(u)
|
|
659
659
|
}
|
|
660
660
|
)
|
|
661
661
|
] }),
|
|
662
|
-
|
|
662
|
+
x && n && y && U && /* @__PURE__ */ t.jsx(
|
|
663
663
|
Ee,
|
|
664
664
|
{
|
|
665
|
-
ref:
|
|
666
|
-
activeItem:
|
|
667
|
-
setActiveItem:
|
|
668
|
-
popupPosition:
|
|
665
|
+
ref: P,
|
|
666
|
+
activeItem: x,
|
|
667
|
+
setActiveItem: k,
|
|
668
|
+
popupPosition: V,
|
|
669
669
|
modalOptions: y,
|
|
670
|
-
setIsOpenModal:
|
|
670
|
+
setIsOpenModal: q
|
|
671
671
|
}
|
|
672
672
|
),
|
|
673
|
-
|
|
674
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
675
|
-
|
|
673
|
+
C && D && /* @__PURE__ */ t.jsx(At, { ...D }),
|
|
674
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.products, children: [
|
|
675
|
+
m && /* @__PURE__ */ t.jsx("h5", { className: H.subtitle, children: m }),
|
|
676
676
|
o ? /* @__PURE__ */ t.jsx(
|
|
677
677
|
Nt,
|
|
678
678
|
{
|
|
679
|
-
sensors:
|
|
679
|
+
sensors: M,
|
|
680
680
|
onDragEnd: j,
|
|
681
681
|
children: /* @__PURE__ */ t.jsx(
|
|
682
682
|
wt,
|
|
683
683
|
{
|
|
684
|
-
items: s.map((
|
|
684
|
+
items: s.map((u) => u.id),
|
|
685
685
|
strategy: Ct,
|
|
686
|
-
children: s.map((
|
|
686
|
+
children: s.map((u, $) => E(u, $))
|
|
687
687
|
}
|
|
688
688
|
)
|
|
689
689
|
}
|
|
690
|
-
) : s.map((
|
|
691
|
-
|
|
690
|
+
) : s.map((u, $) => E(u, $)),
|
|
691
|
+
_ && /* @__PURE__ */ t.jsx(
|
|
692
692
|
"div",
|
|
693
693
|
{
|
|
694
694
|
style: {
|
|
@@ -700,39 +700,39 @@ const He = (r) => {
|
|
|
700
700
|
at,
|
|
701
701
|
{
|
|
702
702
|
withoutHover: !0,
|
|
703
|
-
className:
|
|
704
|
-
[
|
|
703
|
+
className: F(H.button, {
|
|
704
|
+
[H.disabled]: !!(B && B <= s.length || s.length === (d == null ? void 0 : d.length))
|
|
705
705
|
}),
|
|
706
706
|
size: "s",
|
|
707
707
|
disabled: !!(B && B <= s.length || s.length === (d == null ? void 0 : d.length)),
|
|
708
708
|
onClick: () => {
|
|
709
|
-
const
|
|
710
|
-
let
|
|
709
|
+
const u = [...s];
|
|
710
|
+
let $ = null;
|
|
711
711
|
if (d) {
|
|
712
|
-
for (let
|
|
713
|
-
if (!s.find((R) => R.id === d[
|
|
714
|
-
|
|
712
|
+
for (let A = 0; A < d.length; A++)
|
|
713
|
+
if (!s.find((R) => R.id === d[A].id)) {
|
|
714
|
+
$ = d[A];
|
|
715
715
|
break;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
|
|
719
|
-
name:
|
|
720
|
-
id: (
|
|
718
|
+
h === "select" && d ? u.push({
|
|
719
|
+
name: $ ? $.name : d[0].name,
|
|
720
|
+
id: ($ == null ? void 0 : $.id) || d[0].id,
|
|
721
721
|
...L
|
|
722
|
-
}) :
|
|
722
|
+
}) : h === "input" ? u.push({
|
|
723
723
|
name: "",
|
|
724
724
|
id: mt(),
|
|
725
725
|
...L
|
|
726
|
-
}) :
|
|
726
|
+
}) : u.push({
|
|
727
727
|
name: `Image ${s.length + 1}`,
|
|
728
728
|
id: mt(),
|
|
729
729
|
...L
|
|
730
|
-
}), i(
|
|
730
|
+
}), i(u);
|
|
731
731
|
},
|
|
732
732
|
style: {
|
|
733
733
|
width: "fit-content"
|
|
734
734
|
},
|
|
735
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
735
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: H.addButton, children: [
|
|
736
736
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
737
737
|
/* @__PURE__ */ t.jsx(
|
|
738
738
|
v,
|
|
@@ -749,13 +749,13 @@ const He = (r) => {
|
|
|
749
749
|
)
|
|
750
750
|
] }),
|
|
751
751
|
a !== void 0 && /* @__PURE__ */ t.jsx(jt, { items: a }),
|
|
752
|
-
|
|
752
|
+
T !== void 0 && /* @__PURE__ */ t.jsx(
|
|
753
753
|
X,
|
|
754
754
|
{
|
|
755
755
|
label: "Auto scroll interval",
|
|
756
756
|
type: "number",
|
|
757
|
-
value: String(
|
|
758
|
-
onChange: (
|
|
757
|
+
value: String(T.scrollInterval),
|
|
758
|
+
onChange: (u) => T.setScrollInterval(Number(u)),
|
|
759
759
|
min: 0.1,
|
|
760
760
|
max: 100,
|
|
761
761
|
style: {
|
|
@@ -797,17 +797,17 @@ const He = (r) => {
|
|
|
797
797
|
setItems: i,
|
|
798
798
|
other: a,
|
|
799
799
|
title: l,
|
|
800
|
-
subtitle:
|
|
800
|
+
subtitle: m,
|
|
801
801
|
draggable: n = !1,
|
|
802
802
|
withImage: o = !1,
|
|
803
803
|
addable: f = !0,
|
|
804
|
-
itemsOptions:
|
|
805
|
-
hasRangeSelector:
|
|
806
|
-
rangeSelectorOptions:
|
|
807
|
-
limit:
|
|
804
|
+
itemsOptions: N,
|
|
805
|
+
hasRangeSelector: _ = !1,
|
|
806
|
+
rangeSelectorOptions: h,
|
|
807
|
+
limit: p,
|
|
808
808
|
autoScrollInterval: d
|
|
809
809
|
} = r;
|
|
810
|
-
function
|
|
810
|
+
function C(y) {
|
|
811
811
|
if (o)
|
|
812
812
|
return y ? /* @__PURE__ */ t.jsx(
|
|
813
813
|
"img",
|
|
@@ -827,8 +827,8 @@ const He = (r) => {
|
|
|
827
827
|
}
|
|
828
828
|
);
|
|
829
829
|
}
|
|
830
|
-
const
|
|
831
|
-
const L =
|
|
830
|
+
const D = (y) => {
|
|
831
|
+
const L = N.find((T) => T.id === y);
|
|
832
832
|
if (!L) return;
|
|
833
833
|
const B = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
834
834
|
n && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -843,15 +843,15 @@ const He = (r) => {
|
|
|
843
843
|
/* @__PURE__ */ t.jsx(
|
|
844
844
|
et,
|
|
845
845
|
{
|
|
846
|
-
onChange: (
|
|
847
|
-
const
|
|
848
|
-
if (!
|
|
849
|
-
const
|
|
846
|
+
onChange: (T) => {
|
|
847
|
+
const x = [...s], k = N.find((b) => b.name === T);
|
|
848
|
+
if (!k) return;
|
|
849
|
+
const V = k.id, K = x.map((b) => b === y ? V : b);
|
|
850
850
|
i([...K]);
|
|
851
851
|
},
|
|
852
852
|
value: L.name,
|
|
853
|
-
options:
|
|
854
|
-
leftAddon:
|
|
853
|
+
options: N.filter((T) => !s.find((x) => x === T.id)).map((T) => T.name),
|
|
854
|
+
leftAddon: C(L.images)
|
|
855
855
|
}
|
|
856
856
|
),
|
|
857
857
|
/* @__PURE__ */ t.jsx("div", { className: Q.buttons, children: /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
@@ -862,7 +862,7 @@ const He = (r) => {
|
|
|
862
862
|
width: 20,
|
|
863
863
|
height: 20,
|
|
864
864
|
fill: "#C12A2A",
|
|
865
|
-
onClick: () => i(s.filter((
|
|
865
|
+
onClick: () => i(s.filter((T) => T !== y))
|
|
866
866
|
}
|
|
867
867
|
) }) })
|
|
868
868
|
] });
|
|
@@ -886,10 +886,10 @@ const He = (r) => {
|
|
|
886
886
|
}
|
|
887
887
|
)
|
|
888
888
|
] }),
|
|
889
|
-
|
|
889
|
+
_ && h && /* @__PURE__ */ t.jsx(At, { ...h }),
|
|
890
890
|
/* @__PURE__ */ t.jsxs("div", { className: Q.products, children: [
|
|
891
|
-
|
|
892
|
-
s.map((y) =>
|
|
891
|
+
m && /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: m }),
|
|
892
|
+
s.map((y) => D(y)),
|
|
893
893
|
f && /* @__PURE__ */ t.jsx(
|
|
894
894
|
"div",
|
|
895
895
|
{
|
|
@@ -903,22 +903,22 @@ const He = (r) => {
|
|
|
903
903
|
at,
|
|
904
904
|
{
|
|
905
905
|
withoutHover: !0,
|
|
906
|
-
className:
|
|
907
|
-
[Q.disabled]: !!(
|
|
906
|
+
className: F(Q.button, {
|
|
907
|
+
[Q.disabled]: !!(p && p <= s.length || s.length === N.length)
|
|
908
908
|
}),
|
|
909
909
|
size: "s",
|
|
910
|
-
disabled: !!(
|
|
910
|
+
disabled: !!(p && p <= s.length || s.length === N.length),
|
|
911
911
|
onClick: () => {
|
|
912
912
|
const y = [...s];
|
|
913
913
|
let L = null;
|
|
914
|
-
if (
|
|
915
|
-
for (let B = 0; B <
|
|
916
|
-
if (!s.find((
|
|
917
|
-
L =
|
|
914
|
+
if (N) {
|
|
915
|
+
for (let B = 0; B < N.length; B++)
|
|
916
|
+
if (!s.find((T) => T === N[B].id)) {
|
|
917
|
+
L = N[B];
|
|
918
918
|
break;
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
y.push((L == null ? void 0 : L.id) ||
|
|
921
|
+
y.push((L == null ? void 0 : L.id) || N[0].id), i(y);
|
|
922
922
|
},
|
|
923
923
|
style: {
|
|
924
924
|
width: "fit-content"
|
|
@@ -956,7 +956,7 @@ const He = (r) => {
|
|
|
956
956
|
}
|
|
957
957
|
)
|
|
958
958
|
] });
|
|
959
|
-
}, us = "_title_1wm9m_1", ms = "_subtitle_1wm9m_5", hs = "_header_1wm9m_12", _s = "_text_1wm9m_13", ps = "_productsBlock_1wm9m_14", gs = "_top_1wm9m_26", fs = "_itemsBlock_1wm9m_35", xs = "_typeTexts_1wm9m_41", bs = "_block_1wm9m_48", js = "_active_1wm9m_61", vs = "_products_1wm9m_14", ys = "_product_1wm9m_14", ks = "_button_1wm9m_80", $s = "_disabled_1wm9m_91", Is = "_image_1wm9m_95", Ns = "_info_1wm9m_102", ws = "_name_1wm9m_114", Cs = "_buttons_1wm9m_118", Bs = "_modal_1wm9m_125", Ss = "_link_1wm9m_146", Ts = "_modalOptions_1wm9m_152", Ps = "_addButton_1wm9m_164", As = "_deleteButton_1wm9m_179",
|
|
959
|
+
}, us = "_title_1wm9m_1", ms = "_subtitle_1wm9m_5", hs = "_header_1wm9m_12", _s = "_text_1wm9m_13", ps = "_productsBlock_1wm9m_14", gs = "_top_1wm9m_26", fs = "_itemsBlock_1wm9m_35", xs = "_typeTexts_1wm9m_41", bs = "_block_1wm9m_48", js = "_active_1wm9m_61", vs = "_products_1wm9m_14", ys = "_product_1wm9m_14", ks = "_button_1wm9m_80", $s = "_disabled_1wm9m_91", Is = "_image_1wm9m_95", Ns = "_info_1wm9m_102", ws = "_name_1wm9m_114", Cs = "_buttons_1wm9m_118", Bs = "_modal_1wm9m_125", Ss = "_link_1wm9m_146", Ts = "_modalOptions_1wm9m_152", Ps = "_addButton_1wm9m_164", As = "_deleteButton_1wm9m_179", z = {
|
|
960
960
|
title: us,
|
|
961
961
|
subtitle: ms,
|
|
962
962
|
header: hs,
|
|
@@ -983,14 +983,14 @@ const He = (r) => {
|
|
|
983
983
|
}, Os = g.forwardRef(
|
|
984
984
|
(r, c) => {
|
|
985
985
|
const { activeItem: e, setActiveItem: s, popupPosition: i, modalOptions: a, setIsOpenModal: l } = r;
|
|
986
|
-
function
|
|
986
|
+
function m(n, o) {
|
|
987
987
|
return n.length > o ? `${n.slice(0, o)}...` : n;
|
|
988
988
|
}
|
|
989
989
|
return /* @__PURE__ */ t.jsxs(
|
|
990
990
|
"div",
|
|
991
991
|
{
|
|
992
992
|
ref: c,
|
|
993
|
-
className:
|
|
993
|
+
className: z.modal,
|
|
994
994
|
onClick: (n) => {
|
|
995
995
|
n.stopPropagation();
|
|
996
996
|
},
|
|
@@ -999,8 +999,8 @@ const He = (r) => {
|
|
|
999
999
|
left: `${i.left}px`
|
|
1000
1000
|
},
|
|
1001
1001
|
children: [
|
|
1002
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1003
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
1002
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
|
|
1003
|
+
/* @__PURE__ */ t.jsx("h3", { className: z.title, children: m(e.name, 20) }),
|
|
1004
1004
|
/* @__PURE__ */ t.jsx(
|
|
1005
1005
|
v,
|
|
1006
1006
|
{
|
|
@@ -1014,7 +1014,7 @@ const He = (r) => {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
)
|
|
1016
1016
|
] }),
|
|
1017
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1017
|
+
/* @__PURE__ */ t.jsx("div", { className: z.modalOptions, children: a.map((n) => {
|
|
1018
1018
|
if (n.type === "image")
|
|
1019
1019
|
return /* @__PURE__ */ t.jsx(
|
|
1020
1020
|
gt,
|
|
@@ -1071,7 +1071,7 @@ const He = (r) => {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
);
|
|
1073
1073
|
if (n.type === "inputSwitch")
|
|
1074
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1074
|
+
return /* @__PURE__ */ t.jsxs("div", { className: z.link, children: [
|
|
1075
1075
|
/* @__PURE__ */ t.jsx(
|
|
1076
1076
|
X,
|
|
1077
1077
|
{
|
|
@@ -1126,18 +1126,18 @@ const He = (r) => {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
1128
|
function qs(r) {
|
|
1129
|
-
const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition:
|
|
1129
|
+
const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: m, isDragging: n } = St({
|
|
1130
1130
|
id: c.id
|
|
1131
1131
|
}), o = {
|
|
1132
1132
|
transform: Tt.Transform.toString(l),
|
|
1133
|
-
transition:
|
|
1133
|
+
transition: m
|
|
1134
1134
|
};
|
|
1135
1135
|
return /* @__PURE__ */ t.jsx(
|
|
1136
1136
|
"div",
|
|
1137
1137
|
{
|
|
1138
1138
|
ref: a,
|
|
1139
1139
|
style: o,
|
|
1140
|
-
className: `${
|
|
1140
|
+
className: `${z.product} ${n ? z.dragging : ""}`,
|
|
1141
1141
|
...s,
|
|
1142
1142
|
...i,
|
|
1143
1143
|
children: e
|
|
@@ -1152,23 +1152,23 @@ const aa = (r) => {
|
|
|
1152
1152
|
setItems: i,
|
|
1153
1153
|
other: a,
|
|
1154
1154
|
title: l,
|
|
1155
|
-
subtitle:
|
|
1155
|
+
subtitle: m,
|
|
1156
1156
|
editable: n = !0,
|
|
1157
1157
|
draggable: o = !1,
|
|
1158
1158
|
withImage: f = !1,
|
|
1159
|
-
deletable:
|
|
1160
|
-
addable:
|
|
1161
|
-
itemsType:
|
|
1162
|
-
itemsPlaceholder:
|
|
1159
|
+
deletable: N = !0,
|
|
1160
|
+
addable: _ = !0,
|
|
1161
|
+
itemsType: h,
|
|
1162
|
+
itemsPlaceholder: p = "",
|
|
1163
1163
|
itemsOptions: d,
|
|
1164
|
-
hasRangeSelector:
|
|
1165
|
-
rangeSelectorOptions:
|
|
1164
|
+
hasRangeSelector: C = !1,
|
|
1165
|
+
rangeSelectorOptions: D,
|
|
1166
1166
|
modalOptions: y,
|
|
1167
1167
|
addableOptions: L = {}
|
|
1168
|
-
} = r, [B,
|
|
1168
|
+
} = r, [B, T] = g.useState(null), [x, k] = g.useState({
|
|
1169
1169
|
top: 0,
|
|
1170
1170
|
left: 0
|
|
1171
|
-
}), [
|
|
1171
|
+
}), [V, K] = g.useState(null), b = g.useRef(null), [I, P] = g.useState(!1), U = $t(
|
|
1172
1172
|
It(Bt, {
|
|
1173
1173
|
activationConstraint: {
|
|
1174
1174
|
distance: 5
|
|
@@ -1177,35 +1177,35 @@ const aa = (r) => {
|
|
|
1177
1177
|
);
|
|
1178
1178
|
g.useEffect(() => {
|
|
1179
1179
|
const j = () => {
|
|
1180
|
-
|
|
1180
|
+
T(null), P(!1);
|
|
1181
1181
|
};
|
|
1182
|
-
return document.body.addEventListener("click", j),
|
|
1183
|
-
|
|
1182
|
+
return document.body.addEventListener("click", j), T(null), P(!1), () => {
|
|
1183
|
+
T(null), P(!1), document.body.removeEventListener("click", j);
|
|
1184
1184
|
};
|
|
1185
1185
|
}, []), g.useEffect(() => {
|
|
1186
1186
|
if (B) {
|
|
1187
|
-
const j = [...s].map((
|
|
1187
|
+
const j = [...s].map((E) => E.id === B.id ? B : E);
|
|
1188
1188
|
i(j);
|
|
1189
1189
|
}
|
|
1190
1190
|
}, [B]), g.useEffect(() => {
|
|
1191
|
-
if (b.current &&
|
|
1192
|
-
const j = b.current.getBoundingClientRect().height,
|
|
1193
|
-
let
|
|
1194
|
-
|
|
1195
|
-
top:
|
|
1196
|
-
left:
|
|
1191
|
+
if (b.current && V) {
|
|
1192
|
+
const j = b.current.getBoundingClientRect().height, E = window.innerHeight;
|
|
1193
|
+
let u = V.top;
|
|
1194
|
+
u + j > E + window.scrollY - 200 && (u = E + window.scrollY - j - 200), u < 0 && (u = 10), k({
|
|
1195
|
+
top: u,
|
|
1196
|
+
left: V.left
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
1199
|
-
}, [b.current,
|
|
1200
|
-
const
|
|
1199
|
+
}, [b.current, V]);
|
|
1200
|
+
const q = (j, E) => {
|
|
1201
1201
|
j.stopPropagation();
|
|
1202
|
-
const
|
|
1202
|
+
const u = j.target.getBoundingClientRect();
|
|
1203
1203
|
K({
|
|
1204
|
-
top:
|
|
1205
|
-
left:
|
|
1206
|
-
}),
|
|
1204
|
+
top: u.top + window.scrollY,
|
|
1205
|
+
left: u.left - 30
|
|
1206
|
+
}), T(E), P(!0);
|
|
1207
1207
|
};
|
|
1208
|
-
function
|
|
1208
|
+
function M(j) {
|
|
1209
1209
|
if (f)
|
|
1210
1210
|
return j ? /* @__PURE__ */ t.jsx(
|
|
1211
1211
|
"img",
|
|
@@ -1226,17 +1226,17 @@ const aa = (r) => {
|
|
|
1226
1226
|
);
|
|
1227
1227
|
}
|
|
1228
1228
|
const Z = (j) => {
|
|
1229
|
-
const { active:
|
|
1230
|
-
if (
|
|
1231
|
-
const
|
|
1232
|
-
if (
|
|
1233
|
-
const R = [...s], [Y] = R.splice(
|
|
1234
|
-
R.splice(
|
|
1229
|
+
const { active: E, over: u } = j;
|
|
1230
|
+
if (u && E.id !== u.id) {
|
|
1231
|
+
const $ = s.findIndex((R) => R.id === E.id), A = s.findIndex((R) => R.id === u.id);
|
|
1232
|
+
if ($ !== -1 && A !== -1) {
|
|
1233
|
+
const R = [...s], [Y] = R.splice($, 1);
|
|
1234
|
+
R.splice(A, 0, Y), i(R);
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
1237
|
}, ct = (j) => {
|
|
1238
|
-
var
|
|
1239
|
-
const
|
|
1238
|
+
var u;
|
|
1239
|
+
const E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1240
1240
|
o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1241
1241
|
v,
|
|
1242
1242
|
{
|
|
@@ -1246,63 +1246,63 @@ const aa = (r) => {
|
|
|
1246
1246
|
height: 20
|
|
1247
1247
|
}
|
|
1248
1248
|
) }),
|
|
1249
|
-
|
|
1249
|
+
h === "select" && d && /* @__PURE__ */ t.jsx(
|
|
1250
1250
|
et,
|
|
1251
1251
|
{
|
|
1252
|
-
onChange: (
|
|
1252
|
+
onChange: ($) => {
|
|
1253
1253
|
const R = [...s].map((Y) => Y.id === j.id ? {
|
|
1254
1254
|
...j,
|
|
1255
|
-
name:
|
|
1255
|
+
name: $
|
|
1256
1256
|
} : Y);
|
|
1257
|
-
|
|
1257
|
+
T({
|
|
1258
1258
|
...j,
|
|
1259
|
-
name:
|
|
1259
|
+
name: $
|
|
1260
1260
|
}), i([...R]);
|
|
1261
1261
|
},
|
|
1262
1262
|
value: j.name,
|
|
1263
|
-
options: d.filter((
|
|
1264
|
-
leftAddon:
|
|
1263
|
+
options: d.filter(($) => !s.find((A) => A.name === $)),
|
|
1264
|
+
leftAddon: M(j.images)
|
|
1265
1265
|
}
|
|
1266
1266
|
),
|
|
1267
|
-
|
|
1267
|
+
h === "input" && /* @__PURE__ */ t.jsx(
|
|
1268
1268
|
X,
|
|
1269
1269
|
{
|
|
1270
|
-
onChange: (
|
|
1270
|
+
onChange: ($) => {
|
|
1271
1271
|
const R = [...s].map((Y) => Y.id === j.id ? {
|
|
1272
1272
|
...j,
|
|
1273
|
-
name:
|
|
1273
|
+
name: $
|
|
1274
1274
|
} : Y);
|
|
1275
1275
|
i([...R]);
|
|
1276
1276
|
},
|
|
1277
1277
|
value: j.name,
|
|
1278
|
-
placeholder:
|
|
1278
|
+
placeholder: p
|
|
1279
1279
|
}
|
|
1280
1280
|
),
|
|
1281
|
-
|
|
1281
|
+
h === "image" && /* @__PURE__ */ t.jsx(
|
|
1282
1282
|
gt,
|
|
1283
1283
|
{
|
|
1284
|
-
onChange: (
|
|
1284
|
+
onChange: ($) => {
|
|
1285
1285
|
const R = [...s].map((Y) => Y.id === j.id ? {
|
|
1286
1286
|
...j,
|
|
1287
|
-
images:
|
|
1287
|
+
images: $
|
|
1288
1288
|
} : Y);
|
|
1289
1289
|
i([...R]);
|
|
1290
1290
|
},
|
|
1291
|
-
activeImage: (
|
|
1291
|
+
activeImage: (u = s.find(($) => $.id === j.id)) == null ? void 0 : u.images[0]
|
|
1292
1292
|
}
|
|
1293
1293
|
),
|
|
1294
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1295
|
-
n && /* @__PURE__ */ t.jsx("div", { className:
|
|
1294
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.buttons, children: [
|
|
1295
|
+
n && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1296
1296
|
v,
|
|
1297
1297
|
{
|
|
1298
1298
|
name: "Sliders",
|
|
1299
1299
|
hoverable: !0,
|
|
1300
1300
|
width: 20,
|
|
1301
1301
|
height: 20,
|
|
1302
|
-
onClick: (
|
|
1302
|
+
onClick: ($) => q($, j)
|
|
1303
1303
|
}
|
|
1304
1304
|
) }),
|
|
1305
|
-
|
|
1305
|
+
N && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1306
1306
|
v,
|
|
1307
1307
|
{
|
|
1308
1308
|
name: "Trash",
|
|
@@ -1310,7 +1310,7 @@ const aa = (r) => {
|
|
|
1310
1310
|
width: 20,
|
|
1311
1311
|
height: 20,
|
|
1312
1312
|
fill: "#C12A2A",
|
|
1313
|
-
onClick: () => i(s.filter((
|
|
1313
|
+
onClick: () => i(s.filter(($) => $.id !== j.id))
|
|
1314
1314
|
}
|
|
1315
1315
|
) })
|
|
1316
1316
|
] })
|
|
@@ -1319,21 +1319,21 @@ const aa = (r) => {
|
|
|
1319
1319
|
qs,
|
|
1320
1320
|
{
|
|
1321
1321
|
product: j,
|
|
1322
|
-
children:
|
|
1322
|
+
children: E
|
|
1323
1323
|
},
|
|
1324
1324
|
j.id
|
|
1325
1325
|
) : /* @__PURE__ */ t.jsx(
|
|
1326
1326
|
"div",
|
|
1327
1327
|
{
|
|
1328
|
-
className:
|
|
1329
|
-
children:
|
|
1328
|
+
className: z.product,
|
|
1329
|
+
children: E
|
|
1330
1330
|
},
|
|
1331
1331
|
j.id
|
|
1332
1332
|
);
|
|
1333
1333
|
};
|
|
1334
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1335
|
-
(l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1336
|
-
l && /* @__PURE__ */ t.jsx("h3", { className:
|
|
1334
|
+
return /* @__PURE__ */ t.jsxs("div", { className: z.productsBlock, children: [
|
|
1335
|
+
(l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
|
|
1336
|
+
l && /* @__PURE__ */ t.jsx("h3", { className: z.title, children: l }),
|
|
1337
1337
|
c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1338
1338
|
tt,
|
|
1339
1339
|
{
|
|
@@ -1342,20 +1342,20 @@ const aa = (r) => {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
)
|
|
1344
1344
|
] }),
|
|
1345
|
-
B && n && y &&
|
|
1345
|
+
B && n && y && I && /* @__PURE__ */ t.jsx(
|
|
1346
1346
|
Os,
|
|
1347
1347
|
{
|
|
1348
1348
|
ref: b,
|
|
1349
1349
|
activeItem: B,
|
|
1350
|
-
setActiveItem:
|
|
1351
|
-
popupPosition:
|
|
1350
|
+
setActiveItem: T,
|
|
1351
|
+
popupPosition: x,
|
|
1352
1352
|
modalOptions: y,
|
|
1353
|
-
setIsOpenModal:
|
|
1353
|
+
setIsOpenModal: P
|
|
1354
1354
|
}
|
|
1355
1355
|
),
|
|
1356
|
-
|
|
1357
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1358
|
-
|
|
1356
|
+
C && D && /* @__PURE__ */ t.jsx(At, { ...D }),
|
|
1357
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.products, children: [
|
|
1358
|
+
m && /* @__PURE__ */ t.jsx("h5", { className: z.subtitle, children: m }),
|
|
1359
1359
|
o ? /* @__PURE__ */ t.jsx(
|
|
1360
1360
|
Nt,
|
|
1361
1361
|
{
|
|
@@ -1371,7 +1371,7 @@ const aa = (r) => {
|
|
|
1371
1371
|
)
|
|
1372
1372
|
}
|
|
1373
1373
|
) : s.map((j) => ct(j)),
|
|
1374
|
-
|
|
1374
|
+
_ && /* @__PURE__ */ t.jsx(
|
|
1375
1375
|
"div",
|
|
1376
1376
|
{
|
|
1377
1377
|
style: {
|
|
@@ -1383,25 +1383,25 @@ const aa = (r) => {
|
|
|
1383
1383
|
at,
|
|
1384
1384
|
{
|
|
1385
1385
|
withoutHover: !0,
|
|
1386
|
-
className:
|
|
1386
|
+
className: z.button,
|
|
1387
1387
|
size: "s",
|
|
1388
1388
|
onClick: () => {
|
|
1389
1389
|
const j = [...s];
|
|
1390
|
-
let
|
|
1390
|
+
let E = null;
|
|
1391
1391
|
if (d) {
|
|
1392
|
-
for (let
|
|
1393
|
-
if (!s.find((
|
|
1394
|
-
|
|
1392
|
+
for (let u = 0; u < d.length; u++)
|
|
1393
|
+
if (!s.find(($) => $.name === d[u])) {
|
|
1394
|
+
E = d[u];
|
|
1395
1395
|
break;
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
|
|
1399
|
-
name:
|
|
1398
|
+
h === "select" && d ? j.push({
|
|
1399
|
+
name: E || d[0],
|
|
1400
1400
|
id: mt(),
|
|
1401
1401
|
...L,
|
|
1402
1402
|
maxSymbols: 100
|
|
1403
1403
|
// пример значения
|
|
1404
|
-
}) :
|
|
1404
|
+
}) : h === "input" ? j.push({
|
|
1405
1405
|
name: "",
|
|
1406
1406
|
id: mt(),
|
|
1407
1407
|
...L,
|
|
@@ -1416,7 +1416,7 @@ const aa = (r) => {
|
|
|
1416
1416
|
style: {
|
|
1417
1417
|
width: "fit-content"
|
|
1418
1418
|
},
|
|
1419
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1419
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: z.addButton, children: [
|
|
1420
1420
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1421
1421
|
/* @__PURE__ */ t.jsx(
|
|
1422
1422
|
v,
|
|
@@ -1457,20 +1457,20 @@ const aa = (r) => {
|
|
|
1457
1457
|
other: en,
|
|
1458
1458
|
options: sn
|
|
1459
1459
|
}, nn = g.forwardRef((r, c) => {
|
|
1460
|
-
const { activeButton: e, setActiveButton: s, popupPosition: i } = r, [a, l] = g.useState(e.typesText), [
|
|
1460
|
+
const { activeButton: e, setActiveButton: s, popupPosition: i } = r, [a, l] = g.useState(e.typesText), [m, n] = g.useState(e.destination), [o, f] = g.useState(e.page), [N, _] = g.useState(e.link || ""), [h, p] = g.useState(e.text || ""), [d, C] = g.useState(e.openInNewTab), { pages: D } = Ht();
|
|
1461
1461
|
return g.useEffect(() => {
|
|
1462
1462
|
s({
|
|
1463
1463
|
...e,
|
|
1464
1464
|
...{
|
|
1465
|
-
text:
|
|
1466
|
-
link:
|
|
1467
|
-
destination:
|
|
1465
|
+
text: h,
|
|
1466
|
+
link: N,
|
|
1467
|
+
destination: m,
|
|
1468
1468
|
typesText: a,
|
|
1469
1469
|
page: o,
|
|
1470
1470
|
openInNewTab: d
|
|
1471
1471
|
}
|
|
1472
1472
|
});
|
|
1473
|
-
}, [a,
|
|
1473
|
+
}, [a, m, N, h, o, d]), /* @__PURE__ */ t.jsxs(
|
|
1474
1474
|
"div",
|
|
1475
1475
|
{
|
|
1476
1476
|
className: dt.modal,
|
|
@@ -1502,23 +1502,23 @@ const aa = (r) => {
|
|
|
1502
1502
|
{
|
|
1503
1503
|
label: "Destination",
|
|
1504
1504
|
onChange: (y) => n(y),
|
|
1505
|
-
options: ["Go to Page", "Open Link"].filter((y) => y !==
|
|
1506
|
-
value:
|
|
1505
|
+
options: ["Go to Page", "Open Link"].filter((y) => y !== m),
|
|
1506
|
+
value: m
|
|
1507
1507
|
}
|
|
1508
1508
|
),
|
|
1509
|
-
|
|
1509
|
+
m === "Go to Page" ? /* @__PURE__ */ t.jsx(
|
|
1510
1510
|
et,
|
|
1511
1511
|
{
|
|
1512
1512
|
label: "Go to",
|
|
1513
1513
|
onChange: (y) => f(y),
|
|
1514
|
-
options:
|
|
1514
|
+
options: D ? Object.values(D).filter((y) => y.name !== o).map((y) => y.name) : [],
|
|
1515
1515
|
value: o
|
|
1516
1516
|
}
|
|
1517
1517
|
) : /* @__PURE__ */ t.jsx(
|
|
1518
1518
|
X,
|
|
1519
1519
|
{
|
|
1520
|
-
onChange: (y) =>
|
|
1521
|
-
value:
|
|
1520
|
+
onChange: (y) => _(y),
|
|
1521
|
+
value: N,
|
|
1522
1522
|
placeholder: "https://",
|
|
1523
1523
|
label: "Link"
|
|
1524
1524
|
}
|
|
@@ -1528,14 +1528,14 @@ const aa = (r) => {
|
|
|
1528
1528
|
{
|
|
1529
1529
|
current: e.openInNewTab,
|
|
1530
1530
|
label: "Open in new tab",
|
|
1531
|
-
onChange: (y) =>
|
|
1531
|
+
onChange: (y) => C(y)
|
|
1532
1532
|
}
|
|
1533
1533
|
),
|
|
1534
1534
|
/* @__PURE__ */ t.jsx(
|
|
1535
1535
|
Ot,
|
|
1536
1536
|
{
|
|
1537
|
-
onChange: (y) =>
|
|
1538
|
-
value:
|
|
1537
|
+
onChange: (y) => p(y),
|
|
1538
|
+
value: h,
|
|
1539
1539
|
label: "Text",
|
|
1540
1540
|
maxLength: 150
|
|
1541
1541
|
}
|
|
@@ -1575,43 +1575,43 @@ const aa = (r) => {
|
|
|
1575
1575
|
addButton: In,
|
|
1576
1576
|
deleteButton: Nn
|
|
1577
1577
|
}, wn = (r) => {
|
|
1578
|
-
const { buttons: c, setButtons: e, deletable: s = !0, addable: i = !0 } = r, [a, l] = g.useState(null), [
|
|
1578
|
+
const { buttons: c, setButtons: e, deletable: s = !0, addable: i = !0 } = r, [a, l] = g.useState(null), [m, n] = g.useState({
|
|
1579
1579
|
top: 0,
|
|
1580
1580
|
left: 0
|
|
1581
|
-
}), [o, f] = g.useState(null),
|
|
1581
|
+
}), [o, f] = g.useState(null), N = g.useRef(null);
|
|
1582
1582
|
g.useEffect(() => {
|
|
1583
|
-
const
|
|
1583
|
+
const h = () => {
|
|
1584
1584
|
l(null);
|
|
1585
1585
|
};
|
|
1586
|
-
return document.body.addEventListener("click",
|
|
1587
|
-
l(null), document.body.removeEventListener("click",
|
|
1586
|
+
return document.body.addEventListener("click", h), l(null), () => {
|
|
1587
|
+
l(null), document.body.removeEventListener("click", h);
|
|
1588
1588
|
};
|
|
1589
1589
|
}, []), g.useEffect(() => {
|
|
1590
1590
|
if (a) {
|
|
1591
|
-
const
|
|
1592
|
-
e(
|
|
1591
|
+
const h = [...c].map((p) => p.id === a.id ? a : p);
|
|
1592
|
+
e(h);
|
|
1593
1593
|
}
|
|
1594
1594
|
}, [a]), g.useEffect(() => {
|
|
1595
|
-
if (
|
|
1596
|
-
const
|
|
1595
|
+
if (N.current && o) {
|
|
1596
|
+
const h = N.current.getBoundingClientRect().height, p = window.innerHeight;
|
|
1597
1597
|
let d = o.top;
|
|
1598
|
-
d +
|
|
1598
|
+
d + h > p + window.scrollY - 200 && (d = p + window.scrollY - h - 200), d < 0 && (d = 10), n({
|
|
1599
1599
|
top: d,
|
|
1600
1600
|
left: o.left
|
|
1601
1601
|
});
|
|
1602
1602
|
}
|
|
1603
|
-
}, [
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
const d =
|
|
1603
|
+
}, [N.current, o]);
|
|
1604
|
+
const _ = (h, p) => {
|
|
1605
|
+
h.stopPropagation();
|
|
1606
|
+
const d = h.target.getBoundingClientRect();
|
|
1607
1607
|
f({
|
|
1608
1608
|
top: d.top + window.scrollY,
|
|
1609
1609
|
left: d.left - 30
|
|
1610
|
-
}), l(
|
|
1610
|
+
}), l(p);
|
|
1611
1611
|
};
|
|
1612
1612
|
return /* @__PURE__ */ t.jsxs("div", { className: st.products, children: [
|
|
1613
1613
|
/* @__PURE__ */ t.jsx("h5", { className: st.subtitle, children: "Button Type" }),
|
|
1614
|
-
c.map((
|
|
1614
|
+
c.map((h) => /* @__PURE__ */ t.jsxs(
|
|
1615
1615
|
"div",
|
|
1616
1616
|
{
|
|
1617
1617
|
className: st.product,
|
|
@@ -1619,14 +1619,14 @@ const aa = (r) => {
|
|
|
1619
1619
|
/* @__PURE__ */ t.jsx(
|
|
1620
1620
|
et,
|
|
1621
1621
|
{
|
|
1622
|
-
onChange: (
|
|
1623
|
-
const
|
|
1624
|
-
...
|
|
1625
|
-
type:
|
|
1626
|
-
} :
|
|
1627
|
-
e(
|
|
1622
|
+
onChange: (p) => {
|
|
1623
|
+
const C = [...c].map((D) => D.id === h.id ? {
|
|
1624
|
+
...h,
|
|
1625
|
+
type: p
|
|
1626
|
+
} : D);
|
|
1627
|
+
e(C);
|
|
1628
1628
|
},
|
|
1629
|
-
value:
|
|
1629
|
+
value: h.type,
|
|
1630
1630
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
1631
1631
|
}
|
|
1632
1632
|
),
|
|
@@ -1638,8 +1638,8 @@ const aa = (r) => {
|
|
|
1638
1638
|
hoverable: !0,
|
|
1639
1639
|
width: 20,
|
|
1640
1640
|
height: 20,
|
|
1641
|
-
onClick: (
|
|
1642
|
-
p
|
|
1641
|
+
onClick: (p) => {
|
|
1642
|
+
_(p, h);
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
) }),
|
|
@@ -1649,8 +1649,8 @@ const aa = (r) => {
|
|
|
1649
1649
|
name: "Trash",
|
|
1650
1650
|
hoverable: !0,
|
|
1651
1651
|
onClick: () => {
|
|
1652
|
-
const
|
|
1653
|
-
e(
|
|
1652
|
+
const p = c.filter((d) => d.id !== h.id);
|
|
1653
|
+
e(p);
|
|
1654
1654
|
},
|
|
1655
1655
|
width: 20,
|
|
1656
1656
|
height: 20,
|
|
@@ -1660,15 +1660,15 @@ const aa = (r) => {
|
|
|
1660
1660
|
] })
|
|
1661
1661
|
]
|
|
1662
1662
|
},
|
|
1663
|
-
|
|
1663
|
+
h.id
|
|
1664
1664
|
)),
|
|
1665
1665
|
a && /* @__PURE__ */ t.jsx(
|
|
1666
1666
|
nn,
|
|
1667
1667
|
{
|
|
1668
|
-
ref:
|
|
1668
|
+
ref: N,
|
|
1669
1669
|
activeButton: a,
|
|
1670
1670
|
setActiveButton: l,
|
|
1671
|
-
popupPosition:
|
|
1671
|
+
popupPosition: m
|
|
1672
1672
|
}
|
|
1673
1673
|
),
|
|
1674
1674
|
i && /* @__PURE__ */ t.jsx(
|
|
@@ -1686,8 +1686,8 @@ const aa = (r) => {
|
|
|
1686
1686
|
className: st.button,
|
|
1687
1687
|
size: "s",
|
|
1688
1688
|
onClick: () => {
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1689
|
+
const h = [...c];
|
|
1690
|
+
h.push({
|
|
1691
1691
|
type: "Primary",
|
|
1692
1692
|
id: mt(),
|
|
1693
1693
|
typesText: [],
|
|
@@ -1695,7 +1695,7 @@ const aa = (r) => {
|
|
|
1695
1695
|
text: "Button Name",
|
|
1696
1696
|
page: "home",
|
|
1697
1697
|
openInNewTab: !0
|
|
1698
|
-
}), e(
|
|
1698
|
+
}), e(h);
|
|
1699
1699
|
},
|
|
1700
1700
|
style: {
|
|
1701
1701
|
width: "fit-content"
|
|
@@ -1753,12 +1753,12 @@ const aa = (r) => {
|
|
|
1753
1753
|
controls: Mn,
|
|
1754
1754
|
button: Hn
|
|
1755
1755
|
}, At = (r) => {
|
|
1756
|
-
const { label: c, min: e = 1, max: s = 4, step: i = 1, count: a, setCount: l } = r, [
|
|
1756
|
+
const { label: c, min: e = 1, max: s = 4, step: i = 1, count: a, setCount: l } = r, [m, n] = g.useState(!1), o = Array.from({ length: (s - e) / i + 1 }), f = (a - e) / (s - e) * 100, N = () => {
|
|
1757
1757
|
a < s && l(a + i);
|
|
1758
|
-
},
|
|
1758
|
+
}, _ = () => {
|
|
1759
1759
|
a > e && l(a - i);
|
|
1760
|
-
},
|
|
1761
|
-
const d = e +
|
|
1760
|
+
}, h = (p) => {
|
|
1761
|
+
const d = e + p * i;
|
|
1762
1762
|
l(d);
|
|
1763
1763
|
};
|
|
1764
1764
|
return /* @__PURE__ */ t.jsxs("div", { className: G.wrapper, children: [
|
|
@@ -1773,16 +1773,16 @@ const aa = (r) => {
|
|
|
1773
1773
|
style: { width: `${f}%` }
|
|
1774
1774
|
}
|
|
1775
1775
|
),
|
|
1776
|
-
/* @__PURE__ */ t.jsx("div", { className: G.dots, children: o.map((
|
|
1777
|
-
const
|
|
1776
|
+
/* @__PURE__ */ t.jsx("div", { className: G.dots, children: o.map((p, d) => {
|
|
1777
|
+
const C = d <= (a - e) / i;
|
|
1778
1778
|
return /* @__PURE__ */ t.jsx(
|
|
1779
1779
|
"button",
|
|
1780
1780
|
{
|
|
1781
|
-
onClick: () =>
|
|
1782
|
-
className:
|
|
1783
|
-
[G.active]:
|
|
1784
|
-
[G.inactive]: !
|
|
1785
|
-
[G.dragging]:
|
|
1781
|
+
onClick: () => h(d),
|
|
1782
|
+
className: F(G.dot, {
|
|
1783
|
+
[G.active]: C,
|
|
1784
|
+
[G.inactive]: !C,
|
|
1785
|
+
[G.dragging]: m
|
|
1786
1786
|
}),
|
|
1787
1787
|
"aria-label": `Set value to ${e + d * i}`
|
|
1788
1788
|
},
|
|
@@ -1797,7 +1797,7 @@ const aa = (r) => {
|
|
|
1797
1797
|
max: s,
|
|
1798
1798
|
step: i,
|
|
1799
1799
|
value: a,
|
|
1800
|
-
onChange: (
|
|
1800
|
+
onChange: (p) => l(Number(p.target.value)),
|
|
1801
1801
|
onMouseDown: () => n(!0),
|
|
1802
1802
|
onMouseUp: () => n(!1),
|
|
1803
1803
|
onTouchStart: () => n(!0),
|
|
@@ -1814,8 +1814,8 @@ const aa = (r) => {
|
|
|
1814
1814
|
min: e,
|
|
1815
1815
|
max: s,
|
|
1816
1816
|
paddingless: !0,
|
|
1817
|
-
onChange: (
|
|
1818
|
-
const d = Number(
|
|
1817
|
+
onChange: (p) => {
|
|
1818
|
+
const d = Number(p);
|
|
1819
1819
|
d > s ? l(s) : d < e ? l(e) : l(d);
|
|
1820
1820
|
},
|
|
1821
1821
|
value: String(a)
|
|
@@ -1825,7 +1825,7 @@ const aa = (r) => {
|
|
|
1825
1825
|
/* @__PURE__ */ t.jsx(
|
|
1826
1826
|
"button",
|
|
1827
1827
|
{
|
|
1828
|
-
onClick:
|
|
1828
|
+
onClick: N,
|
|
1829
1829
|
disabled: a >= s,
|
|
1830
1830
|
className: G.button,
|
|
1831
1831
|
"aria-label": "Increment count",
|
|
@@ -1842,7 +1842,7 @@ const aa = (r) => {
|
|
|
1842
1842
|
/* @__PURE__ */ t.jsx(
|
|
1843
1843
|
"button",
|
|
1844
1844
|
{
|
|
1845
|
-
onClick:
|
|
1845
|
+
onClick: _,
|
|
1846
1846
|
disabled: a <= e,
|
|
1847
1847
|
className: G.button,
|
|
1848
1848
|
"aria-label": "Decrement count",
|
|
@@ -1886,7 +1886,7 @@ const aa = (r) => {
|
|
|
1886
1886
|
}, di = (r) => {
|
|
1887
1887
|
const { activeItem: c, setActiveItem: e, popupPosition: s, setIsOpenModal: i, itemsOptions: a } = r, l = a.find((n) => n.id === c.listingId);
|
|
1888
1888
|
if (!l) return null;
|
|
1889
|
-
function
|
|
1889
|
+
function m(n, o) {
|
|
1890
1890
|
return n.length > o ? `${n.slice(0, o)}...` : n;
|
|
1891
1891
|
}
|
|
1892
1892
|
return /* @__PURE__ */ t.jsxs(
|
|
@@ -1902,7 +1902,7 @@ const aa = (r) => {
|
|
|
1902
1902
|
},
|
|
1903
1903
|
children: [
|
|
1904
1904
|
/* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
|
|
1905
|
-
/* @__PURE__ */ t.jsx("h3", { children:
|
|
1905
|
+
/* @__PURE__ */ t.jsx("h3", { children: m(l.productData.name, 20) }),
|
|
1906
1906
|
/* @__PURE__ */ t.jsx(
|
|
1907
1907
|
v,
|
|
1908
1908
|
{
|
|
@@ -1935,11 +1935,11 @@ const aa = (r) => {
|
|
|
1935
1935
|
);
|
|
1936
1936
|
};
|
|
1937
1937
|
function ui(r) {
|
|
1938
|
-
const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition:
|
|
1938
|
+
const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: m, isDragging: n } = St({
|
|
1939
1939
|
id: String(c.listingId)
|
|
1940
1940
|
}), o = {
|
|
1941
1941
|
transform: Tt.Transform.toString(l),
|
|
1942
|
-
transition:
|
|
1942
|
+
transition: m
|
|
1943
1943
|
};
|
|
1944
1944
|
return /* @__PURE__ */ t.jsx(
|
|
1945
1945
|
"div",
|
|
@@ -1961,20 +1961,20 @@ const la = (r) => {
|
|
|
1961
1961
|
setItems: i,
|
|
1962
1962
|
other: a,
|
|
1963
1963
|
title: l,
|
|
1964
|
-
subtitle:
|
|
1964
|
+
subtitle: m,
|
|
1965
1965
|
editable: n = !0,
|
|
1966
1966
|
draggable: o = !1,
|
|
1967
1967
|
withImage: f = !1,
|
|
1968
|
-
deletable:
|
|
1969
|
-
addable:
|
|
1970
|
-
itemsType:
|
|
1971
|
-
itemsOptions:
|
|
1972
|
-
} = r, [d,
|
|
1968
|
+
deletable: N = !0,
|
|
1969
|
+
addable: _ = !0,
|
|
1970
|
+
itemsType: h,
|
|
1971
|
+
itemsOptions: p
|
|
1972
|
+
} = r, [d, C] = g.useState(
|
|
1973
1973
|
null
|
|
1974
|
-
), [
|
|
1974
|
+
), [D, y] = g.useState({
|
|
1975
1975
|
top: 0,
|
|
1976
1976
|
left: 0
|
|
1977
|
-
}), [L, B] = g.useState(!1),
|
|
1977
|
+
}), [L, B] = g.useState(!1), T = $t(
|
|
1978
1978
|
It(Bt, {
|
|
1979
1979
|
activationConstraint: {
|
|
1980
1980
|
distance: 5
|
|
@@ -1983,27 +1983,27 @@ const la = (r) => {
|
|
|
1983
1983
|
);
|
|
1984
1984
|
g.useEffect(() => {
|
|
1985
1985
|
const b = () => {
|
|
1986
|
-
|
|
1986
|
+
C(null), B(!1);
|
|
1987
1987
|
};
|
|
1988
|
-
return document.body.addEventListener("click", b),
|
|
1989
|
-
|
|
1988
|
+
return document.body.addEventListener("click", b), C(null), B(!1), () => {
|
|
1989
|
+
C(null), B(!1), document.body.removeEventListener("click", b);
|
|
1990
1990
|
};
|
|
1991
1991
|
}, []), g.useEffect(() => {
|
|
1992
1992
|
if (d) {
|
|
1993
|
-
const b = [...s].map((
|
|
1993
|
+
const b = [...s].map((I) => I.listingId === d.listingId ? d : I);
|
|
1994
1994
|
i(b);
|
|
1995
1995
|
}
|
|
1996
1996
|
}, [d]);
|
|
1997
|
-
const
|
|
1997
|
+
const x = (b, I) => {
|
|
1998
1998
|
b.stopPropagation();
|
|
1999
|
-
const
|
|
2000
|
-
let
|
|
2001
|
-
|
|
2002
|
-
top:
|
|
2003
|
-
left:
|
|
2004
|
-
}),
|
|
1999
|
+
const P = b.target.getBoundingClientRect(), U = 100, q = window.innerHeight;
|
|
2000
|
+
let M = P.top + window.scrollY;
|
|
2001
|
+
M + U > q && (M = q - U - 20), B(!0), y({
|
|
2002
|
+
top: M - 80,
|
|
2003
|
+
left: P.left - 30
|
|
2004
|
+
}), C(I);
|
|
2005
2005
|
};
|
|
2006
|
-
function
|
|
2006
|
+
function k(b) {
|
|
2007
2007
|
if (f)
|
|
2008
2008
|
return b ? /* @__PURE__ */ t.jsx(
|
|
2009
2009
|
"img",
|
|
@@ -2023,18 +2023,18 @@ const la = (r) => {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
);
|
|
2025
2025
|
}
|
|
2026
|
-
const
|
|
2027
|
-
const { active:
|
|
2028
|
-
if (
|
|
2029
|
-
const U = s.findIndex((
|
|
2030
|
-
if (U !== -1 &&
|
|
2031
|
-
const
|
|
2032
|
-
|
|
2026
|
+
const V = (b) => {
|
|
2027
|
+
const { active: I, over: P } = b;
|
|
2028
|
+
if (P && I.id !== P.id) {
|
|
2029
|
+
const U = s.findIndex((M) => String(M.listingId) === I.id), q = s.findIndex((M) => String(M.listingId) === P.id);
|
|
2030
|
+
if (U !== -1 && q !== -1) {
|
|
2031
|
+
const M = [...s], [Z] = M.splice(U, 1);
|
|
2032
|
+
M.splice(q, 0, Z), i(M);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
}, K = (b,
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2035
|
+
}, K = (b, I) => {
|
|
2036
|
+
const P = p.find((q) => b.listingId === q.id);
|
|
2037
|
+
if (!P) return null;
|
|
2038
2038
|
const U = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2039
2039
|
o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
2040
2040
|
v,
|
|
@@ -2045,27 +2045,27 @@ const la = (r) => {
|
|
|
2045
2045
|
height: 20
|
|
2046
2046
|
}
|
|
2047
2047
|
) }),
|
|
2048
|
-
|
|
2048
|
+
h === "select" && /* @__PURE__ */ t.jsx(
|
|
2049
2049
|
et,
|
|
2050
2050
|
{
|
|
2051
|
-
onChange: (
|
|
2052
|
-
const
|
|
2051
|
+
onChange: (q) => {
|
|
2052
|
+
const M = [...s], Z = p.find((E) => E.productData.name === q);
|
|
2053
2053
|
if (!Z) return;
|
|
2054
2054
|
const ct = {
|
|
2055
2055
|
listingId: Z.id,
|
|
2056
2056
|
image: Z.productData.images.length > 0 ? Z.productData.images[0].cfId : ""
|
|
2057
|
-
}, j =
|
|
2058
|
-
|
|
2057
|
+
}, j = M.map((E) => E.listingId === b.listingId ? ct : E);
|
|
2058
|
+
C(ct), i([...j]);
|
|
2059
2059
|
},
|
|
2060
|
-
value:
|
|
2060
|
+
value: P.productData.name,
|
|
2061
2061
|
options: [
|
|
2062
|
-
...
|
|
2062
|
+
...p.filter((q) => !s.find((M) => M.listingId === q.id)).map((q) => q.productData.name)
|
|
2063
2063
|
],
|
|
2064
|
-
leftAddon:
|
|
2065
|
-
b.image ||
|
|
2064
|
+
leftAddon: k(
|
|
2065
|
+
b.image || P.productData.images.length > 0 && P.productData.images[0].cfId || ""
|
|
2066
2066
|
)
|
|
2067
2067
|
},
|
|
2068
|
-
|
|
2068
|
+
I
|
|
2069
2069
|
),
|
|
2070
2070
|
/* @__PURE__ */ t.jsxs("div", { className: W.buttons, children: [
|
|
2071
2071
|
n && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
@@ -2075,10 +2075,10 @@ const la = (r) => {
|
|
|
2075
2075
|
hoverable: !0,
|
|
2076
2076
|
width: 20,
|
|
2077
2077
|
height: 20,
|
|
2078
|
-
onClick: (
|
|
2078
|
+
onClick: (q) => x(q, b)
|
|
2079
2079
|
}
|
|
2080
2080
|
) }),
|
|
2081
|
-
|
|
2081
|
+
N && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
2082
2082
|
v,
|
|
2083
2083
|
{
|
|
2084
2084
|
name: "Trash",
|
|
@@ -2086,7 +2086,7 @@ const la = (r) => {
|
|
|
2086
2086
|
width: 20,
|
|
2087
2087
|
height: 20,
|
|
2088
2088
|
fill: "#C12A2A",
|
|
2089
|
-
onClick: () => i(s.filter((
|
|
2089
|
+
onClick: () => i(s.filter((q) => q !== b))
|
|
2090
2090
|
}
|
|
2091
2091
|
) })
|
|
2092
2092
|
] })
|
|
@@ -2122,30 +2122,30 @@ const la = (r) => {
|
|
|
2122
2122
|
di,
|
|
2123
2123
|
{
|
|
2124
2124
|
activeItem: d,
|
|
2125
|
-
setActiveItem:
|
|
2125
|
+
setActiveItem: C,
|
|
2126
2126
|
setIsOpenModal: B,
|
|
2127
|
-
popupPosition:
|
|
2128
|
-
itemsOptions:
|
|
2127
|
+
popupPosition: D,
|
|
2128
|
+
itemsOptions: p
|
|
2129
2129
|
}
|
|
2130
2130
|
),
|
|
2131
2131
|
/* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
|
|
2132
|
-
|
|
2132
|
+
m && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: m }),
|
|
2133
2133
|
o ? /* @__PURE__ */ t.jsx(
|
|
2134
2134
|
Nt,
|
|
2135
2135
|
{
|
|
2136
|
-
sensors:
|
|
2137
|
-
onDragEnd:
|
|
2136
|
+
sensors: T,
|
|
2137
|
+
onDragEnd: V,
|
|
2138
2138
|
children: /* @__PURE__ */ t.jsx(
|
|
2139
2139
|
wt,
|
|
2140
2140
|
{
|
|
2141
2141
|
items: s.map((b) => String(b.listingId)),
|
|
2142
2142
|
strategy: Ct,
|
|
2143
|
-
children: s.map((b,
|
|
2143
|
+
children: s.map((b, I) => K(b, I))
|
|
2144
2144
|
}
|
|
2145
2145
|
)
|
|
2146
2146
|
}
|
|
2147
|
-
) : s.map((b,
|
|
2148
|
-
|
|
2147
|
+
) : s.map((b, I) => K(b, I)),
|
|
2148
|
+
_ && /* @__PURE__ */ t.jsx(
|
|
2149
2149
|
"div",
|
|
2150
2150
|
{
|
|
2151
2151
|
style: {
|
|
@@ -2161,17 +2161,17 @@ const la = (r) => {
|
|
|
2161
2161
|
size: "s",
|
|
2162
2162
|
onClick: () => {
|
|
2163
2163
|
const b = [...s];
|
|
2164
|
-
for (let
|
|
2165
|
-
if (!s.find((
|
|
2164
|
+
for (let I = 0; I < p.length; I++)
|
|
2165
|
+
if (!s.find((P) => P.listingId === p[I].id)) {
|
|
2166
2166
|
b.push({
|
|
2167
|
-
listingId:
|
|
2168
|
-
image:
|
|
2167
|
+
listingId: p[I].id,
|
|
2168
|
+
image: p[I].productData.images.length > 0 ? p[I].productData.images[0].cfId : ""
|
|
2169
2169
|
});
|
|
2170
2170
|
break;
|
|
2171
2171
|
}
|
|
2172
2172
|
i(b);
|
|
2173
2173
|
},
|
|
2174
|
-
disabled: s.length ===
|
|
2174
|
+
disabled: s.length === p.length,
|
|
2175
2175
|
style: {
|
|
2176
2176
|
width: "fit-content"
|
|
2177
2177
|
},
|
|
@@ -2193,7 +2193,7 @@ const la = (r) => {
|
|
|
2193
2193
|
] }),
|
|
2194
2194
|
a !== void 0 && /* @__PURE__ */ t.jsx(jt, { items: a })
|
|
2195
2195
|
] });
|
|
2196
|
-
}, mi = "_options_d1lk6_1", hi = "_price_d1lk6_12", _i = "_oldPrice_d1lk6_19", pi = "_newPrice_d1lk6_27", gi = "_animate_d1lk6_34", fi = "_appearAndBounce_d1lk6_1", xi = "_meta_d1lk6_52", bi = "_info_d1lk6_58", ji = "_infoRight_d1lk6_66", vi = "_buttons_d1lk6_73", yi = "_variants_d1lk6_80", ki = "_variant_d1lk6_80", $i = "_stock_d1lk6_98", Ii = "_variantInfo_d1lk6_105", Ni = "_quantity_d1lk6_111", wi = "_count_d1lk6_118", Ci = "_focused_d1lk6_135", Bi = "_button_d1lk6_73", Si = "_activeVariant_d1lk6_161", Ti = "_chargeTypes_d1lk6_165", Pi = "_charge_d1lk6_165", Ai = "_chargeActive_d1lk6_190", Oi = "_title_d1lk6_198",
|
|
2196
|
+
}, mi = "_options_d1lk6_1", hi = "_price_d1lk6_12", _i = "_oldPrice_d1lk6_19", pi = "_newPrice_d1lk6_27", gi = "_animate_d1lk6_34", fi = "_appearAndBounce_d1lk6_1", xi = "_meta_d1lk6_52", bi = "_info_d1lk6_58", ji = "_infoRight_d1lk6_66", vi = "_buttons_d1lk6_73", yi = "_variants_d1lk6_80", ki = "_variant_d1lk6_80", $i = "_stock_d1lk6_98", Ii = "_variantInfo_d1lk6_105", Ni = "_quantity_d1lk6_111", wi = "_count_d1lk6_118", Ci = "_focused_d1lk6_135", Bi = "_button_d1lk6_73", Si = "_activeVariant_d1lk6_161", Ti = "_chargeTypes_d1lk6_165", Pi = "_charge_d1lk6_165", Ai = "_chargeActive_d1lk6_190", Oi = "_title_d1lk6_198", w = {
|
|
2197
2197
|
options: mi,
|
|
2198
2198
|
price: hi,
|
|
2199
2199
|
oldPrice: _i,
|
|
@@ -2220,97 +2220,96 @@ const la = (r) => {
|
|
|
2220
2220
|
};
|
|
2221
2221
|
var Mt = /* @__PURE__ */ ((r) => (r.ONE_TIME = "One-Time", r.RECURRING = "Subscribe & Save", r))(Mt || {});
|
|
2222
2222
|
const ra = (r) => {
|
|
2223
|
-
var
|
|
2224
|
-
const { variants: c } = r, [e, s] = g.useState(c[0]), [i, a] = g.useState(e.chargeTypes[0]), l = bt(), [
|
|
2223
|
+
var B, T;
|
|
2224
|
+
const { variants: c } = r, [e, s] = g.useState(c[0]), [i, a] = g.useState(e.chargeTypes[0]), l = bt(), [m, n] = g.useState(1), [o, f] = g.useState(!1), { reset: N, addProductToCart: _, getProducts: h } = Pt(), [p, d] = g.useState(!1);
|
|
2225
2225
|
g.useEffect(() => {
|
|
2226
|
-
|
|
2227
|
-
const
|
|
2228
|
-
return () => clearTimeout(
|
|
2229
|
-
}, [
|
|
2230
|
-
async function
|
|
2231
|
-
await
|
|
2226
|
+
d(!0);
|
|
2227
|
+
const x = setTimeout(() => d(!1), 600);
|
|
2228
|
+
return () => clearTimeout(x);
|
|
2229
|
+
}, [m]);
|
|
2230
|
+
async function C() {
|
|
2231
|
+
await h(), await _({
|
|
2232
2232
|
productId: r.id,
|
|
2233
2233
|
productVariantId: e.id,
|
|
2234
|
-
quantity:
|
|
2234
|
+
quantity: m
|
|
2235
2235
|
});
|
|
2236
2236
|
}
|
|
2237
|
-
function
|
|
2238
|
-
|
|
2237
|
+
function D() {
|
|
2238
|
+
N(), C(), l("/checkout");
|
|
2239
2239
|
}
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
return `${$} ${$ === 1 ? "minute" : "minutes"}`;
|
|
2240
|
+
function y(x) {
|
|
2241
|
+
if (x >= 864e5) {
|
|
2242
|
+
const I = Math.floor(x / 864e5);
|
|
2243
|
+
return `${I} ${I === 1 ? "day" : "days"}`;
|
|
2244
|
+
} else if (x >= 36e5) {
|
|
2245
|
+
const I = Math.floor(x / 36e5);
|
|
2246
|
+
return `${I} ${I === 1 ? "hour" : "hours"}`;
|
|
2247
|
+
} else if (x >= 6e4) {
|
|
2248
|
+
const I = Math.floor(x / 6e4);
|
|
2249
|
+
return `${I} ${I === 1 ? "minute" : "minutes"}`;
|
|
2251
2250
|
} else {
|
|
2252
|
-
const
|
|
2253
|
-
return `${
|
|
2251
|
+
const I = Math.floor(x / 1e3);
|
|
2252
|
+
return `${I} ${I === 1 ? "second" : "seconds"}`;
|
|
2254
2253
|
}
|
|
2255
2254
|
}
|
|
2256
|
-
function
|
|
2257
|
-
return
|
|
2255
|
+
function L(x, k) {
|
|
2256
|
+
return x.length > k ? x.slice(0, k) + "..." : x;
|
|
2258
2257
|
}
|
|
2259
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2260
|
-
e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className:
|
|
2258
|
+
return /* @__PURE__ */ t.jsxs("div", { className: w.options, children: [
|
|
2259
|
+
e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: w.chargeTypes, children: e.chargeTypes.map((x) => /* @__PURE__ */ t.jsx(
|
|
2261
2260
|
"div",
|
|
2262
2261
|
{
|
|
2263
|
-
className:
|
|
2264
|
-
[
|
|
2262
|
+
className: F(w.charge, {
|
|
2263
|
+
[w.chargeActive]: i === x
|
|
2265
2264
|
}),
|
|
2266
|
-
onClick: () => a(
|
|
2267
|
-
children: Mt[
|
|
2265
|
+
onClick: () => a(x),
|
|
2266
|
+
children: Mt[x]
|
|
2268
2267
|
},
|
|
2269
|
-
|
|
2268
|
+
x
|
|
2270
2269
|
)) }),
|
|
2271
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2272
|
-
var
|
|
2270
|
+
/* @__PURE__ */ t.jsx("div", { className: w.variants, children: c.map((x) => {
|
|
2271
|
+
var k;
|
|
2273
2272
|
return /* @__PURE__ */ t.jsxs(
|
|
2274
2273
|
"div",
|
|
2275
2274
|
{
|
|
2276
|
-
className:
|
|
2277
|
-
[
|
|
2275
|
+
className: F(w.variant, {
|
|
2276
|
+
[w.activeVariant]: e.id === x.id
|
|
2278
2277
|
}),
|
|
2279
|
-
onClick: () => s(
|
|
2278
|
+
onClick: () => s(x),
|
|
2280
2279
|
children: [
|
|
2281
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2282
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
2280
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.variantInfo, children: [
|
|
2281
|
+
/* @__PURE__ */ t.jsx("span", { className: w.title, children: L(x.name, 15) }),
|
|
2283
2282
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
2284
2283
|
"$",
|
|
2285
|
-
i === "ONE_TIME" ?
|
|
2284
|
+
i === "ONE_TIME" ? x.price.amount : x.subscriptionSettings ? x.subscriptionSettings.price.amount : "Price Not Found"
|
|
2286
2285
|
] })
|
|
2287
2286
|
] }),
|
|
2288
|
-
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className:
|
|
2289
|
-
((
|
|
2287
|
+
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: w.stock, children: [
|
|
2288
|
+
((k = x.quantity.restrictions) == null ? void 0 : k.max) || x.quantity.available || 0,
|
|
2290
2289
|
" in stock"
|
|
2291
2290
|
] }) })
|
|
2292
2291
|
]
|
|
2293
2292
|
},
|
|
2294
|
-
|
|
2293
|
+
x.id
|
|
2295
2294
|
);
|
|
2296
2295
|
}) }),
|
|
2297
|
-
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className:
|
|
2296
|
+
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: w.quantity, children: [
|
|
2298
2297
|
/* @__PURE__ */ t.jsx(
|
|
2299
2298
|
"button",
|
|
2300
2299
|
{
|
|
2301
2300
|
onClick: () => {
|
|
2302
|
-
|
|
2301
|
+
m > 1 ? n((x) => x - 1) : n(1);
|
|
2303
2302
|
},
|
|
2304
|
-
className:
|
|
2305
|
-
disabled: e.quantity.restrictions &&
|
|
2303
|
+
className: w.button,
|
|
2304
|
+
disabled: e.quantity.restrictions && m <= e.quantity.restrictions.min,
|
|
2306
2305
|
children: /* @__PURE__ */ t.jsx(v, { name: "Minus" })
|
|
2307
2306
|
}
|
|
2308
2307
|
),
|
|
2309
2308
|
/* @__PURE__ */ t.jsx(
|
|
2310
2309
|
"label",
|
|
2311
2310
|
{
|
|
2312
|
-
className:
|
|
2313
|
-
[
|
|
2311
|
+
className: F(w.count, {
|
|
2312
|
+
[w.focused]: o
|
|
2314
2313
|
}),
|
|
2315
2314
|
onFocus: () => f(!0),
|
|
2316
2315
|
onBlur: () => f(!1),
|
|
@@ -2318,10 +2317,10 @@ const ra = (r) => {
|
|
|
2318
2317
|
X,
|
|
2319
2318
|
{
|
|
2320
2319
|
type: "number",
|
|
2321
|
-
value: String(
|
|
2322
|
-
onChange: (
|
|
2323
|
-
max: ((
|
|
2324
|
-
min: ((
|
|
2320
|
+
value: String(m),
|
|
2321
|
+
onChange: (x) => n(Number(x)),
|
|
2322
|
+
max: ((B = e.quantity.restrictions) == null ? void 0 : B.max) || e.quantity.available || 1 / 0,
|
|
2323
|
+
min: ((T = e.quantity.restrictions) == null ? void 0 : T.min) || 0,
|
|
2325
2324
|
style: {
|
|
2326
2325
|
backgroundColor: "transparent",
|
|
2327
2326
|
border: "none",
|
|
@@ -2335,18 +2334,18 @@ const ra = (r) => {
|
|
|
2335
2334
|
"button",
|
|
2336
2335
|
{
|
|
2337
2336
|
onClick: () => {
|
|
2338
|
-
n((
|
|
2337
|
+
n((x) => x + 1);
|
|
2339
2338
|
},
|
|
2340
|
-
className:
|
|
2341
|
-
disabled: !!(e.quantity.restrictions &&
|
|
2339
|
+
className: w.button,
|
|
2340
|
+
disabled: !!(e.quantity.restrictions && m >= e.quantity.restrictions.max || e.quantity.available && m >= e.quantity.available),
|
|
2342
2341
|
children: /* @__PURE__ */ t.jsx(v, { name: "Plus" })
|
|
2343
2342
|
}
|
|
2344
2343
|
)
|
|
2345
2344
|
] }),
|
|
2346
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2347
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2345
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.meta, children: [
|
|
2346
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
2348
2347
|
/* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
|
|
2349
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2348
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.infoRight, children: [
|
|
2350
2349
|
/* @__PURE__ */ t.jsx(
|
|
2351
2350
|
v,
|
|
2352
2351
|
{
|
|
@@ -2356,44 +2355,44 @@ const ra = (r) => {
|
|
|
2356
2355
|
height: 20
|
|
2357
2356
|
}
|
|
2358
2357
|
),
|
|
2359
|
-
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" :
|
|
2358
|
+
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : y(e.deliveryTime) })
|
|
2360
2359
|
] })
|
|
2361
2360
|
] }),
|
|
2362
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2361
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
2363
2362
|
/* @__PURE__ */ t.jsx("span", { children: "Price" }),
|
|
2364
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2365
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
2363
|
+
/* @__PURE__ */ t.jsx("div", { className: w.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
2364
|
+
/* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
|
|
2366
2365
|
"$ ",
|
|
2367
|
-
(e.price.amount || 0) *
|
|
2366
|
+
(e.price.amount || 0) * m
|
|
2368
2367
|
] }),
|
|
2369
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
2368
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
2370
2369
|
"$ ",
|
|
2371
|
-
(e.compareAtPrice.amount || 0) *
|
|
2370
|
+
(e.compareAtPrice.amount || 0) * m
|
|
2372
2371
|
] })
|
|
2373
|
-
] }) : /* @__PURE__ */ t.jsxs("span", { className:
|
|
2372
|
+
] }) : /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
|
|
2374
2373
|
"$ ",
|
|
2375
|
-
(e.price.amount || 0) *
|
|
2376
|
-
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
2377
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
2374
|
+
(e.price.amount || 0) * m
|
|
2375
|
+
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
2376
|
+
/* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
|
|
2378
2377
|
"$ ",
|
|
2379
2378
|
e.subscriptionSettings.price.amount || 0
|
|
2380
2379
|
] }),
|
|
2381
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
2380
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
2382
2381
|
"$ ",
|
|
2383
2382
|
e.subscriptionSettings.compareAtPrice.amount || 0
|
|
2384
2383
|
] })
|
|
2385
|
-
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className:
|
|
2384
|
+
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
|
|
2386
2385
|
"$ ",
|
|
2387
2386
|
e.subscriptionSettings.price.amount || 0
|
|
2388
2387
|
] }) })
|
|
2389
2388
|
] })
|
|
2390
2389
|
] }),
|
|
2391
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2390
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
|
|
2392
2391
|
/* @__PURE__ */ t.jsx(
|
|
2393
2392
|
at,
|
|
2394
2393
|
{
|
|
2395
2394
|
type: "Primary",
|
|
2396
|
-
onClick: () =>
|
|
2395
|
+
onClick: () => D(),
|
|
2397
2396
|
children: /* @__PURE__ */ t.jsx("span", { children: i === "ONE_TIME" ? "Buy Now" : "Subscribe Now" })
|
|
2398
2397
|
}
|
|
2399
2398
|
),
|
|
@@ -2401,13 +2400,13 @@ const ra = (r) => {
|
|
|
2401
2400
|
at,
|
|
2402
2401
|
{
|
|
2403
2402
|
type: "Secondary",
|
|
2404
|
-
onClick: () =>
|
|
2403
|
+
onClick: () => C(),
|
|
2405
2404
|
children: "Add to Cart"
|
|
2406
2405
|
}
|
|
2407
2406
|
)
|
|
2408
2407
|
] })
|
|
2409
2408
|
] });
|
|
2410
|
-
}, qi = "_button_oyh2y_1", Ei = "_login_oyh2y_14", Di = "_signUp_oyh2y_18", Li = "_buttons_oyh2y_23", Ri = "_modal_oyh2y_32", Mi = "_closing_oyh2y_61", Hi = "_info_oyh2y_85", zi = "_top_oyh2y_92", Fi = "_title_oyh2y_103", Vi = "_clear_oyh2y_110", Ui = "_activeClear_oyh2y_117", Yi = "_count_oyh2y_121", Gi = "_cart_oyh2y_136", Wi = "_empty_oyh2y_144", Xi = "_product_oyh2y_170", Ji = "_products_oyh2y_179", Qi = "_image_oyh2y_187", Ki = "_productInfo_oyh2y_193", Zi = "_content_oyh2y_200", to = "_name_oyh2y_206", eo = "_price_oyh2y_212", so = "_productButtons_oyh2y_218", no = "_productButton_oyh2y_218", io = "_productCount_oyh2y_238", oo = "_bottom_oyh2y_254", ao = "_subtotal_oyh2y_262", co = "_block_oyh2y_270", lo = "_shoppingCount_oyh2y_277", ro = "_total_oyh2y_297", uo = "_link_oyh2y_303", mo = "_userInfo_oyh2y_310",
|
|
2409
|
+
}, qi = "_button_oyh2y_1", Ei = "_login_oyh2y_14", Di = "_signUp_oyh2y_18", Li = "_buttons_oyh2y_23", Ri = "_modal_oyh2y_32", Mi = "_closing_oyh2y_61", Hi = "_info_oyh2y_85", zi = "_top_oyh2y_92", Fi = "_title_oyh2y_103", Vi = "_clear_oyh2y_110", Ui = "_activeClear_oyh2y_117", Yi = "_count_oyh2y_121", Gi = "_cart_oyh2y_136", Wi = "_empty_oyh2y_144", Xi = "_product_oyh2y_170", Ji = "_products_oyh2y_179", Qi = "_image_oyh2y_187", Ki = "_productInfo_oyh2y_193", Zi = "_content_oyh2y_200", to = "_name_oyh2y_206", eo = "_price_oyh2y_212", so = "_productButtons_oyh2y_218", no = "_productButton_oyh2y_218", io = "_productCount_oyh2y_238", oo = "_bottom_oyh2y_254", ao = "_subtotal_oyh2y_262", co = "_block_oyh2y_270", lo = "_shoppingCount_oyh2y_277", ro = "_total_oyh2y_297", uo = "_link_oyh2y_303", mo = "_userInfo_oyh2y_310", S = {
|
|
2411
2410
|
button: qi,
|
|
2412
2411
|
login: Ei,
|
|
2413
2412
|
signUp: Di,
|
|
@@ -2451,17 +2450,17 @@ const ra = (r) => {
|
|
|
2451
2450
|
tertiaryHovered: bo,
|
|
2452
2451
|
content: jo
|
|
2453
2452
|
}, kt = (r) => {
|
|
2454
|
-
const { children: c, onClick: e, style: s, className: i, disabled: a = !1, type: l = "Primary" } = r, { themeSettings:
|
|
2453
|
+
const { children: c, onClick: e, style: s, className: i, disabled: a = !1, type: l = "Primary" } = r, { themeSettings: m } = qt();
|
|
2455
2454
|
return /* @__PURE__ */ t.jsx(
|
|
2456
2455
|
"button",
|
|
2457
2456
|
{
|
|
2458
|
-
className:
|
|
2457
|
+
className: F(nt.button, i, {
|
|
2459
2458
|
[nt.primary]: l === "Primary",
|
|
2460
2459
|
[nt.secondary]: l === "Secondary",
|
|
2461
2460
|
[nt.tertiary]: l === "Tertiary",
|
|
2462
|
-
[nt.primaryHovered]: l === "Primary" && !a &&
|
|
2463
|
-
[nt.secondaryHovered]: l === "Secondary" && !a &&
|
|
2464
|
-
[nt.tertiaryHovered]: l === "Tertiary" && !a &&
|
|
2461
|
+
[nt.primaryHovered]: l === "Primary" && !a && m.buttons.primary.hover,
|
|
2462
|
+
[nt.secondaryHovered]: l === "Secondary" && !a && m.buttons.secondary.hover,
|
|
2463
|
+
[nt.tertiaryHovered]: l === "Tertiary" && !a && m.buttons.tertiary.hover
|
|
2465
2464
|
}),
|
|
2466
2465
|
onClick: e,
|
|
2467
2466
|
style: {
|
|
@@ -2537,7 +2536,7 @@ const da = (r) => {
|
|
|
2537
2536
|
s(l);
|
|
2538
2537
|
}
|
|
2539
2538
|
const a = JSON.parse(localStorage.getItem("token") || "{}");
|
|
2540
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2539
|
+
return /* @__PURE__ */ t.jsxs("div", { className: S.buttons, children: [
|
|
2541
2540
|
c && /* @__PURE__ */ t.jsx($o, {}),
|
|
2542
2541
|
!a.data && /* @__PURE__ */ t.jsx(
|
|
2543
2542
|
kt,
|
|
@@ -2565,42 +2564,40 @@ const da = (r) => {
|
|
|
2565
2564
|
] });
|
|
2566
2565
|
}, $o = () => {
|
|
2567
2566
|
const [r, c] = g.useState(!1), [e, s] = g.useState([]), { cart: i, getProducts: a } = Pt();
|
|
2568
|
-
function l(
|
|
2569
|
-
for (let
|
|
2570
|
-
for (let
|
|
2571
|
-
if (i.parts[
|
|
2572
|
-
return i.parts[
|
|
2567
|
+
function l(_) {
|
|
2568
|
+
for (let h = 0; h < i.parts.length; h++)
|
|
2569
|
+
for (let p = 0; p < _.variants.length; p++)
|
|
2570
|
+
if (i.parts[h].productVariantId === _.variants[h].id)
|
|
2571
|
+
return i.parts[h].productVariantId;
|
|
2573
2572
|
}
|
|
2574
|
-
function
|
|
2575
|
-
for (let
|
|
2576
|
-
for (let
|
|
2577
|
-
if (i.parts[
|
|
2578
|
-
return i.parts[
|
|
2573
|
+
function m(_) {
|
|
2574
|
+
for (let h = 0; h < i.parts.length; h++)
|
|
2575
|
+
for (let p = 0; p < _.variants.length; p++)
|
|
2576
|
+
if (i.parts[h].productVariantId === _.variants[h].id)
|
|
2577
|
+
return i.parts[h].quantity;
|
|
2579
2578
|
}
|
|
2580
2579
|
g.useEffect(() => {
|
|
2581
2580
|
(async () => {
|
|
2582
|
-
const
|
|
2583
|
-
...
|
|
2584
|
-
activeVariantId: l(
|
|
2585
|
-
quantity:
|
|
2581
|
+
const h = i.parts.map((C) => String(C.productId)), d = (await a([...h])).map((C) => ({
|
|
2582
|
+
...C,
|
|
2583
|
+
activeVariantId: l(C),
|
|
2584
|
+
quantity: m(C)
|
|
2586
2585
|
}));
|
|
2587
2586
|
s(d);
|
|
2588
2587
|
})();
|
|
2589
2588
|
}, [i.parts.length]);
|
|
2590
|
-
function n(
|
|
2591
|
-
var
|
|
2592
|
-
return !
|
|
2589
|
+
function n(_) {
|
|
2590
|
+
var h;
|
|
2591
|
+
return !_ || !(_ != null && _.variants) ? !1 : (h = _.variants.find((p) => p.id === _.activeVariantId)) == null ? void 0 : h.subscriptionSettings;
|
|
2593
2592
|
}
|
|
2594
|
-
const o = i.parts.length > 0 && e.length > 0 && !n(e[0]);
|
|
2595
|
-
console.log(i.parts.length > 0, e.length > 0, !n(e[0]));
|
|
2596
|
-
const [f, I] = g.useState(!1);
|
|
2593
|
+
const o = i.parts.length > 0 && e.length > 0 && !n(e[0]), [f, N] = g.useState(!1);
|
|
2597
2594
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2598
2595
|
/* @__PURE__ */ t.jsxs(
|
|
2599
2596
|
"div",
|
|
2600
2597
|
{
|
|
2601
|
-
className:
|
|
2602
|
-
onClick: (
|
|
2603
|
-
|
|
2598
|
+
className: S.button,
|
|
2599
|
+
onClick: (_) => {
|
|
2600
|
+
_.stopPropagation(), c(!0), N(!0);
|
|
2604
2601
|
},
|
|
2605
2602
|
children: [
|
|
2606
2603
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2610,7 +2607,7 @@ const da = (r) => {
|
|
|
2610
2607
|
fill: "var(--icon-primary)"
|
|
2611
2608
|
}
|
|
2612
2609
|
),
|
|
2613
|
-
o && /* @__PURE__ */ t.jsx("div", { className:
|
|
2610
|
+
o && /* @__PURE__ */ t.jsx("div", { className: S.shoppingCount, children: i.parts.length })
|
|
2614
2611
|
]
|
|
2615
2612
|
}
|
|
2616
2613
|
),
|
|
@@ -2618,7 +2615,7 @@ const da = (r) => {
|
|
|
2618
2615
|
Et,
|
|
2619
2616
|
{
|
|
2620
2617
|
close: () => {
|
|
2621
|
-
|
|
2618
|
+
N(!1), setTimeout(() => {
|
|
2622
2619
|
c(!1);
|
|
2623
2620
|
}, 300);
|
|
2624
2621
|
},
|
|
@@ -2634,42 +2631,42 @@ const da = (r) => {
|
|
|
2634
2631
|
)
|
|
2635
2632
|
] });
|
|
2636
2633
|
}, Io = (r) => {
|
|
2637
|
-
const { activeProducts: c, isCartNotEmpty: e, isOpen: s } = r, { cart: i, reset: a, getTotalAndDiscount: l, updateQuantityOfProduct:
|
|
2638
|
-
function o(
|
|
2639
|
-
n(
|
|
2634
|
+
const { activeProducts: c, isCartNotEmpty: e, isOpen: s } = r, { cart: i, reset: a, getTotalAndDiscount: l, updateQuantityOfProduct: m } = Pt(), n = bt();
|
|
2635
|
+
function o(_) {
|
|
2636
|
+
n(_);
|
|
2640
2637
|
}
|
|
2641
|
-
function f(
|
|
2642
|
-
|
|
2643
|
-
productId:
|
|
2644
|
-
productVariantId:
|
|
2645
|
-
quantity:
|
|
2638
|
+
function f(_) {
|
|
2639
|
+
m({
|
|
2640
|
+
productId: _.id,
|
|
2641
|
+
productVariantId: _.activeVariantId,
|
|
2642
|
+
quantity: _.quantity + 1
|
|
2646
2643
|
});
|
|
2647
2644
|
}
|
|
2648
|
-
function
|
|
2649
|
-
|
|
2650
|
-
productId:
|
|
2651
|
-
productVariantId:
|
|
2652
|
-
quantity:
|
|
2645
|
+
function N(_) {
|
|
2646
|
+
m({
|
|
2647
|
+
productId: _.id,
|
|
2648
|
+
productVariantId: _.activeVariantId,
|
|
2649
|
+
quantity: _.quantity - 1
|
|
2653
2650
|
});
|
|
2654
2651
|
}
|
|
2655
2652
|
return /* @__PURE__ */ t.jsxs(
|
|
2656
2653
|
"div",
|
|
2657
2654
|
{
|
|
2658
|
-
className:
|
|
2659
|
-
[
|
|
2655
|
+
className: F(S.modal, {
|
|
2656
|
+
[S.closing]: !s
|
|
2660
2657
|
}),
|
|
2661
|
-
onClick: (
|
|
2658
|
+
onClick: (_) => _.stopPropagation(),
|
|
2662
2659
|
children: [
|
|
2663
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2664
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2665
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
2666
|
-
e && /* @__PURE__ */ t.jsx("div", { className:
|
|
2660
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.top, children: [
|
|
2661
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.info, children: [
|
|
2662
|
+
/* @__PURE__ */ t.jsx("span", { className: S.title, children: "Cart" }),
|
|
2663
|
+
e && /* @__PURE__ */ t.jsx("div", { className: S.count, children: i.parts.length })
|
|
2667
2664
|
] }),
|
|
2668
2665
|
/* @__PURE__ */ t.jsx(
|
|
2669
2666
|
"button",
|
|
2670
2667
|
{
|
|
2671
|
-
className:
|
|
2672
|
-
[
|
|
2668
|
+
className: F(S.clear, {
|
|
2669
|
+
[S.activeClear]: e
|
|
2673
2670
|
}),
|
|
2674
2671
|
disabled: !e,
|
|
2675
2672
|
onClick: a,
|
|
@@ -2677,39 +2674,39 @@ const da = (r) => {
|
|
|
2677
2674
|
}
|
|
2678
2675
|
)
|
|
2679
2676
|
] }),
|
|
2680
|
-
e ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
2681
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2677
|
+
e ? /* @__PURE__ */ t.jsxs("div", { className: S.cart, children: [
|
|
2678
|
+
/* @__PURE__ */ t.jsx("div", { className: S.products, children: c.map((_) => /* @__PURE__ */ t.jsxs(
|
|
2682
2679
|
"div",
|
|
2683
2680
|
{
|
|
2684
|
-
className:
|
|
2681
|
+
className: S.product,
|
|
2685
2682
|
children: [
|
|
2686
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2683
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.productInfo, children: [
|
|
2687
2684
|
/* @__PURE__ */ t.jsx(
|
|
2688
2685
|
"img",
|
|
2689
2686
|
{
|
|
2690
|
-
src: `https://imagedelivery.net/${
|
|
2687
|
+
src: `https://imagedelivery.net/${_.images[0].cfId}/w=500`,
|
|
2691
2688
|
alt: "image",
|
|
2692
2689
|
width: "100%",
|
|
2693
2690
|
height: "100%",
|
|
2694
|
-
className:
|
|
2691
|
+
className: S.image
|
|
2695
2692
|
}
|
|
2696
2693
|
),
|
|
2697
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2698
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2699
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2694
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.content, children: [
|
|
2695
|
+
/* @__PURE__ */ t.jsx("div", { className: S.name, children: _.name }),
|
|
2696
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.price, children: [
|
|
2700
2697
|
"$",
|
|
2701
|
-
|
|
2698
|
+
_.variants.find((h) => h.id === _.activeVariantId).price.amount * ((_ == null ? void 0 : _.quantity) || 1)
|
|
2702
2699
|
] })
|
|
2703
2700
|
] })
|
|
2704
2701
|
] }),
|
|
2705
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2702
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.productButtons, children: [
|
|
2706
2703
|
/* @__PURE__ */ t.jsx(
|
|
2707
2704
|
"div",
|
|
2708
2705
|
{
|
|
2709
2706
|
onClick: () => {
|
|
2710
|
-
|
|
2707
|
+
_.quantity !== 1 && N(_);
|
|
2711
2708
|
},
|
|
2712
|
-
className:
|
|
2709
|
+
className: S.productButton,
|
|
2713
2710
|
children: /* @__PURE__ */ t.jsx(
|
|
2714
2711
|
v,
|
|
2715
2712
|
{
|
|
@@ -2721,12 +2718,12 @@ const da = (r) => {
|
|
|
2721
2718
|
)
|
|
2722
2719
|
}
|
|
2723
2720
|
),
|
|
2724
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2721
|
+
/* @__PURE__ */ t.jsx("div", { className: S.productCount, children: _.quantity }),
|
|
2725
2722
|
/* @__PURE__ */ t.jsx(
|
|
2726
2723
|
"div",
|
|
2727
2724
|
{
|
|
2728
|
-
onClick: () => f(
|
|
2729
|
-
className:
|
|
2725
|
+
onClick: () => f(_),
|
|
2726
|
+
className: S.productButton,
|
|
2730
2727
|
children: /* @__PURE__ */ t.jsx(
|
|
2731
2728
|
v,
|
|
2732
2729
|
{
|
|
@@ -2741,11 +2738,11 @@ const da = (r) => {
|
|
|
2741
2738
|
] })
|
|
2742
2739
|
]
|
|
2743
2740
|
},
|
|
2744
|
-
|
|
2741
|
+
_.id
|
|
2745
2742
|
)) }),
|
|
2746
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2747
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2748
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2743
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.bottom, children: [
|
|
2744
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.subtotal, children: [
|
|
2745
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.block, children: [
|
|
2749
2746
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
2750
2747
|
/* @__PURE__ */ t.jsx(
|
|
2751
2748
|
v,
|
|
@@ -2757,7 +2754,7 @@ const da = (r) => {
|
|
|
2757
2754
|
}
|
|
2758
2755
|
)
|
|
2759
2756
|
] }),
|
|
2760
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2757
|
+
/* @__PURE__ */ t.jsxs("div", { className: S.total, children: [
|
|
2761
2758
|
"$",
|
|
2762
2759
|
l().total
|
|
2763
2760
|
] })
|
|
@@ -2768,7 +2765,7 @@ const da = (r) => {
|
|
|
2768
2765
|
]
|
|
2769
2766
|
}
|
|
2770
2767
|
);
|
|
2771
|
-
}, No = () => /* @__PURE__ */ t.jsxs("div", { className:
|
|
2768
|
+
}, No = () => /* @__PURE__ */ t.jsxs("div", { className: S.empty, children: [
|
|
2772
2769
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
2773
2770
|
v,
|
|
2774
2771
|
{
|
|
@@ -2784,7 +2781,7 @@ const da = (r) => {
|
|
|
2784
2781
|
"a",
|
|
2785
2782
|
{
|
|
2786
2783
|
href: "/products",
|
|
2787
|
-
className:
|
|
2784
|
+
className: S.link,
|
|
2788
2785
|
children: "view products"
|
|
2789
2786
|
}
|
|
2790
2787
|
)
|
|
@@ -2803,7 +2800,7 @@ const da = (r) => {
|
|
|
2803
2800
|
return /* @__PURE__ */ t.jsx(
|
|
2804
2801
|
"div",
|
|
2805
2802
|
{
|
|
2806
|
-
className:
|
|
2803
|
+
className: S.userInfo,
|
|
2807
2804
|
onClick: () => i("/customer-dash"),
|
|
2808
2805
|
children: /* @__PURE__ */ t.jsx("div", { children: c || "test-email@gmail.com" })
|
|
2809
2806
|
}
|
|
@@ -2874,7 +2871,7 @@ const da = (r) => {
|
|
|
2874
2871
|
/* @__PURE__ */ t.jsx(
|
|
2875
2872
|
"div",
|
|
2876
2873
|
{
|
|
2877
|
-
className:
|
|
2874
|
+
className: F(ot.copy, ot.copyText),
|
|
2878
2875
|
onClick: i,
|
|
2879
2876
|
children: s
|
|
2880
2877
|
}
|
|
@@ -2898,7 +2895,7 @@ const da = (r) => {
|
|
|
2898
2895
|
open: Ho,
|
|
2899
2896
|
content: zo
|
|
2900
2897
|
}, ma = ({ title: r, content: c }) => {
|
|
2901
|
-
const [e, s] = g.useState(!1), [i, a] = g.useState(0), l = g.useRef(null),
|
|
2898
|
+
const [e, s] = g.useState(!1), [i, a] = g.useState(0), l = g.useRef(null), m = () => {
|
|
2902
2899
|
s(!e);
|
|
2903
2900
|
};
|
|
2904
2901
|
return g.useEffect(() => {
|
|
@@ -2908,10 +2905,10 @@ const da = (r) => {
|
|
|
2908
2905
|
"div",
|
|
2909
2906
|
{
|
|
2910
2907
|
className: _t.header,
|
|
2911
|
-
onClick:
|
|
2908
|
+
onClick: m,
|
|
2912
2909
|
children: [
|
|
2913
2910
|
/* @__PURE__ */ t.jsx("h5", { id: "h5", children: r }),
|
|
2914
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2911
|
+
/* @__PURE__ */ t.jsx("div", { className: F(_t.icon, { [_t.open]: e }), children: /* @__PURE__ */ t.jsx(v, { name: "CaretDown" }) })
|
|
2915
2912
|
]
|
|
2916
2913
|
}
|
|
2917
2914
|
),
|
|
@@ -2942,20 +2939,20 @@ const da = (r) => {
|
|
|
2942
2939
|
value: i,
|
|
2943
2940
|
type: a,
|
|
2944
2941
|
min: l,
|
|
2945
|
-
max:
|
|
2942
|
+
max: m,
|
|
2946
2943
|
placeholder: n,
|
|
2947
2944
|
disabled: o = !1,
|
|
2948
2945
|
required: f = !1,
|
|
2949
|
-
regex:
|
|
2950
|
-
paddingless:
|
|
2951
|
-
borderless:
|
|
2952
|
-
editable:
|
|
2946
|
+
regex: N,
|
|
2947
|
+
paddingless: _ = !1,
|
|
2948
|
+
borderless: h = !1,
|
|
2949
|
+
editable: p = !1,
|
|
2953
2950
|
isSearch: d = !1
|
|
2954
|
-
} = r, { themeSettings:
|
|
2955
|
-
function B(
|
|
2956
|
-
if (
|
|
2957
|
-
let
|
|
2958
|
-
return
|
|
2951
|
+
} = r, { themeSettings: C } = qt(), { inputs: D } = C, [y, L] = g.useState(!1);
|
|
2952
|
+
function B(k, V) {
|
|
2953
|
+
if (k.startsWith("#")) {
|
|
2954
|
+
let I, P, U;
|
|
2955
|
+
return k.length === 7 ? (I = parseInt(k.slice(1, 3), 16), P = parseInt(k.slice(3, 5), 16), U = parseInt(k.slice(5, 7), 16)) : k.length === 4 && (I = parseInt(k[1] + k[1], 16), P = parseInt(k[2] + k[2], 16), U = parseInt(k[3] + k[3], 16)), `rgba(${I}, ${P}, ${U}, ${V})`;
|
|
2959
2956
|
}
|
|
2960
2957
|
const b = {
|
|
2961
2958
|
black: "#000000",
|
|
@@ -2964,14 +2961,14 @@ const da = (r) => {
|
|
|
2964
2961
|
green: "#00ff00",
|
|
2965
2962
|
blue: "#0000ff"
|
|
2966
2963
|
// Можно добавить больше цветов
|
|
2967
|
-
}[
|
|
2968
|
-
return b ? B(b,
|
|
2964
|
+
}[k.toLowerCase()];
|
|
2965
|
+
return b ? B(b, V) : k;
|
|
2969
2966
|
}
|
|
2970
|
-
function
|
|
2971
|
-
return Number(
|
|
2967
|
+
function T(k) {
|
|
2968
|
+
return Number(k) < 0 ? String(l) : k;
|
|
2972
2969
|
}
|
|
2973
|
-
function
|
|
2974
|
-
return !f || !
|
|
2970
|
+
function x(k) {
|
|
2971
|
+
return !f || !N ? !0 : new RegExp(N).test(k);
|
|
2975
2972
|
}
|
|
2976
2973
|
return /* @__PURE__ */ t.jsxs("div", { className: it.wrapper, children: [
|
|
2977
2974
|
s && /* @__PURE__ */ t.jsx(
|
|
@@ -2987,9 +2984,9 @@ const da = (r) => {
|
|
|
2987
2984
|
{
|
|
2988
2985
|
className: it.content,
|
|
2989
2986
|
style: {
|
|
2990
|
-
paddingRight:
|
|
2987
|
+
paddingRight: D.general.height + 15,
|
|
2991
2988
|
...e,
|
|
2992
|
-
backgroundColor: B(
|
|
2989
|
+
backgroundColor: B(D.field.color, D.field.opacity / 100)
|
|
2993
2990
|
},
|
|
2994
2991
|
children: [
|
|
2995
2992
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2997,23 +2994,23 @@ const da = (r) => {
|
|
|
2997
2994
|
{
|
|
2998
2995
|
id: s,
|
|
2999
2996
|
type: a || "text",
|
|
3000
|
-
onChange: (
|
|
3001
|
-
if (a === "text") c(
|
|
2997
|
+
onChange: (k) => {
|
|
2998
|
+
if (a === "text") c(k.target.value);
|
|
3002
2999
|
else {
|
|
3003
|
-
const
|
|
3004
|
-
c(
|
|
3000
|
+
const V = T(k.target.value);
|
|
3001
|
+
c(V);
|
|
3005
3002
|
}
|
|
3006
3003
|
},
|
|
3007
3004
|
value: i,
|
|
3008
3005
|
autoComplete: "off",
|
|
3009
3006
|
placeholder: n || "Type something...",
|
|
3010
|
-
className:
|
|
3011
|
-
[it.required]: y && f && !
|
|
3012
|
-
[it.paddingless]:
|
|
3013
|
-
[it.borderless]:
|
|
3007
|
+
className: F(it.input, {
|
|
3008
|
+
[it.required]: y && f && !x(i),
|
|
3009
|
+
[it.paddingless]: _,
|
|
3010
|
+
[it.borderless]: h
|
|
3014
3011
|
}),
|
|
3015
3012
|
min: a === "number" ? l : void 0,
|
|
3016
|
-
max: a === "number" ?
|
|
3013
|
+
max: a === "number" ? m : void 0,
|
|
3017
3014
|
disabled: o,
|
|
3018
3015
|
onFocus: () => L(!0)
|
|
3019
3016
|
}
|
|
@@ -3023,11 +3020,11 @@ const da = (r) => {
|
|
|
3023
3020
|
{
|
|
3024
3021
|
name: "MagnifyingGlass",
|
|
3025
3022
|
fill: "var(--icon-secondary)",
|
|
3026
|
-
width:
|
|
3027
|
-
height:
|
|
3023
|
+
width: D.general.height,
|
|
3024
|
+
height: D.general.height
|
|
3028
3025
|
}
|
|
3029
3026
|
) }),
|
|
3030
|
-
|
|
3027
|
+
p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
3031
3028
|
v,
|
|
3032
3029
|
{
|
|
3033
3030
|
name: "Sliders",
|
|
@@ -3046,7 +3043,7 @@ const da = (r) => {
|
|
|
3046
3043
|
textarea: Zo,
|
|
3047
3044
|
length: ta
|
|
3048
3045
|
}, _a = (r) => {
|
|
3049
|
-
const { onChange: c, label: e, value: s, maxLength: i, placeholder: a = "Type something..." } = r, [l,
|
|
3046
|
+
const { onChange: c, label: e, value: s, maxLength: i, placeholder: a = "Type something..." } = r, [l, m] = g.useState(s.length);
|
|
3050
3047
|
return /* @__PURE__ */ t.jsxs("div", { className: xt.wrapper, children: [
|
|
3051
3048
|
e && /* @__PURE__ */ t.jsx(
|
|
3052
3049
|
"label",
|
|
@@ -3062,7 +3059,7 @@ const da = (r) => {
|
|
|
3062
3059
|
id: e,
|
|
3063
3060
|
defaultValue: s,
|
|
3064
3061
|
onChange: (n) => {
|
|
3065
|
-
|
|
3062
|
+
m(n.target.value.length), c(n.target.value);
|
|
3066
3063
|
},
|
|
3067
3064
|
placeholder: a,
|
|
3068
3065
|
className: xt.textarea,
|