@billgangcom/theme-lib 1.65.2 → 1.66.1
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/App.d.ts +1 -1
- package/dist/assets/icons/index.d.ts +0 -1
- package/dist/builder/constants/aspectRatio.d.ts +11 -0
- package/dist/builder/constants/device.d.ts +1 -1
- package/dist/builder/constants/icon.d.ts +1 -1
- package/dist/builder/constants/index.d.ts +2 -1
- package/dist/builder/constants/navbar.d.ts +1 -1
- package/dist/builder/constants/pages.d.ts +1 -1
- package/dist/builder/constants/theme-settings.d.ts +1 -1
- package/dist/builder/ui/Select/index.d.ts +4 -1
- package/dist/builder/ui/SelectInfiniteList/index.d.ts +20 -0
- package/dist/builder/ui/SelectInfiniteList/utils/index.d.ts +2 -0
- package/dist/builder/ui/index.d.ts +1 -0
- package/dist/builder.cjs.js +3 -3
- package/dist/builder.es.js +1616 -83
- package/dist/{index-CMw6nNKj.js → index-6YsaO6Zm.js} +15469 -14539
- package/dist/index-zLueaIi3.cjs +194 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +9 -8
- package/dist/ui/CategorySettings/index.d.ts +5 -1
- package/dist/ui/FormSettings/popup.d.ts +4 -1
- package/dist/ui/ItemsSettings/index.d.ts +9 -1
- package/dist/ui/ItemsSettings/popup.d.ts +16 -2
- package/dist/ui/ListingSelector/index.d.ts +3 -0
- package/dist/ui/OtherSettings/index.d.ts +5 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1172 -1113
- package/package.json +5 -1
- package/dist/assets/icons/SSR.d.ts +0 -2
- package/dist/index-_Cl8H5kf.cjs +0 -178
package/dist/ui.es.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { j as t, I as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}, Kt = [
|
|
1
|
+
import { j as t, I as b, c as F, d as It, u as mt, e as ht, P as pt, S as ct, R as St, D as _t, f as gt, v as ft, B as rt, g as it, h as $t, a as wt, O as ut, i as st, k as xt, C as vt, l as Y, m as Mt, n as At, o as lt, p as Ot, r as bt, t as Q, L as Et, w as jt, x as dt, s as Nt, y as L, z as Rt, M as kt, A as qt, E as Dt, F as Bt, G as Pt, H as Lt, J as zt } from "./index-6YsaO6Zm.js";
|
|
2
|
+
import { W as ta, N as ea, U as na, V as sa, K as ia, T as aa, Q as oa } from "./index-6YsaO6Zm.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
const Ft = "_wrapper_1vmyb_2", Vt = "_alignmentBlock_1vmyb_8", Ut = "_title_1vmyb_15", Ht = "_subtitle_1vmyb_22", Yt = "_alignmentContent_1vmyb_29", Wt = "_alignments_1vmyb_37", Gt = "_alignment_1vmyb_8", Qt = "_circle_1vmyb_60", Xt = "_paddings_1vmyb_67", Jt = "_padding_1vmyb_67", Kt = "_active_1vmyb_91", Zt = "_input_1vmyb_98", K = {
|
|
5
|
+
wrapper: Ft,
|
|
6
|
+
alignmentBlock: Vt,
|
|
7
|
+
title: Ut,
|
|
8
|
+
subtitle: Ht,
|
|
9
|
+
alignmentContent: Yt,
|
|
10
|
+
alignments: Wt,
|
|
11
|
+
alignment: Gt,
|
|
12
|
+
circle: Qt,
|
|
13
|
+
paddings: Xt,
|
|
14
|
+
padding: Jt,
|
|
15
|
+
active: Kt,
|
|
16
|
+
input: Zt
|
|
17
|
+
}, te = [
|
|
19
18
|
"topLeft",
|
|
20
19
|
"top",
|
|
21
20
|
"topRight",
|
|
@@ -25,10 +24,10 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
25
24
|
"bottomLeft",
|
|
26
25
|
"bottom",
|
|
27
26
|
"bottomRight"
|
|
28
|
-
],
|
|
29
|
-
const { alignment: s, padding: e, setPadding: n, setAlignment:
|
|
30
|
-
function c(
|
|
31
|
-
switch (
|
|
27
|
+
], ee = ["left", "top", "right", "bottom"], Ei = (o) => {
|
|
28
|
+
const { alignment: s, padding: e, setPadding: n, setAlignment: a } = o;
|
|
29
|
+
function c(h) {
|
|
30
|
+
switch (h) {
|
|
32
31
|
case "left":
|
|
33
32
|
case "topLeft":
|
|
34
33
|
case "bottomLeft":
|
|
@@ -45,8 +44,8 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
45
44
|
return "TextAlignCenter";
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
function u(
|
|
49
|
-
switch (
|
|
47
|
+
function u(h) {
|
|
48
|
+
switch (h) {
|
|
50
49
|
case "left":
|
|
51
50
|
return "AlignLeft";
|
|
52
51
|
case "right":
|
|
@@ -57,29 +56,29 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
57
56
|
return "AlignBottom";
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
const [r, m] =
|
|
61
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
62
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
63
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
64
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
65
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
66
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
59
|
+
const [r, m] = f.useState(null), [_, B] = f.useState(null);
|
|
60
|
+
return /* @__PURE__ */ t.jsxs("div", { className: K.layout, children: [
|
|
61
|
+
/* @__PURE__ */ t.jsx("h3", { className: K.title, children: "Layout (for Desktop version)" }),
|
|
62
|
+
/* @__PURE__ */ t.jsxs("div", { className: K.alignmentBlock, children: [
|
|
63
|
+
/* @__PURE__ */ t.jsx("h5", { className: K.subtitle, children: "Alignment" }),
|
|
64
|
+
/* @__PURE__ */ t.jsxs("div", { className: K.alignmentContent, children: [
|
|
65
|
+
/* @__PURE__ */ t.jsx("div", { className: K.alignments, children: te.map((h) => /* @__PURE__ */ t.jsxs(
|
|
67
66
|
"div",
|
|
68
67
|
{
|
|
69
68
|
onClick: () => {
|
|
70
|
-
|
|
69
|
+
a(h);
|
|
71
70
|
},
|
|
72
|
-
className:
|
|
71
|
+
className: K.alignment,
|
|
73
72
|
onMouseEnter: () => {
|
|
74
|
-
m(
|
|
73
|
+
m(h);
|
|
75
74
|
},
|
|
76
75
|
onMouseLeave: () => {
|
|
77
76
|
m(null);
|
|
78
77
|
},
|
|
79
78
|
children: [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
h !== s && r !== h && /* @__PURE__ */ t.jsx("div", { className: K.circle }),
|
|
80
|
+
h !== s && r === h && /* @__PURE__ */ t.jsx(
|
|
81
|
+
b,
|
|
83
82
|
{
|
|
84
83
|
name: c(r),
|
|
85
84
|
fill: "#c2c2c2",
|
|
@@ -87,8 +86,8 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
87
86
|
height: 22
|
|
88
87
|
}
|
|
89
88
|
),
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
h === s && /* @__PURE__ */ t.jsx(
|
|
90
|
+
b,
|
|
92
91
|
{
|
|
93
92
|
name: c(s),
|
|
94
93
|
fill: "#FF3F19",
|
|
@@ -98,37 +97,37 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
98
97
|
)
|
|
99
98
|
]
|
|
100
99
|
},
|
|
101
|
-
|
|
100
|
+
h
|
|
102
101
|
)) }),
|
|
103
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
102
|
+
/* @__PURE__ */ t.jsx("div", { className: K.paddings, children: ee.map((h) => /* @__PURE__ */ t.jsxs(
|
|
104
103
|
"label",
|
|
105
104
|
{
|
|
106
|
-
className:
|
|
107
|
-
[
|
|
105
|
+
className: F(K.padding, {
|
|
106
|
+
[K.active]: _ === h
|
|
108
107
|
}),
|
|
109
108
|
onFocus: () => {
|
|
110
|
-
B(
|
|
109
|
+
B(h);
|
|
111
110
|
},
|
|
112
111
|
onBlur: () => {
|
|
113
112
|
B(null);
|
|
114
113
|
},
|
|
115
114
|
children: [
|
|
116
115
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
117
|
-
|
|
116
|
+
b,
|
|
118
117
|
{
|
|
119
|
-
name: u(
|
|
118
|
+
name: u(h),
|
|
120
119
|
width: 20,
|
|
121
120
|
height: 20
|
|
122
121
|
}
|
|
123
122
|
) }),
|
|
124
123
|
/* @__PURE__ */ t.jsx(
|
|
125
|
-
|
|
124
|
+
It,
|
|
126
125
|
{
|
|
127
126
|
type: "number",
|
|
128
|
-
value: String(e[
|
|
129
|
-
onChange: (
|
|
127
|
+
value: String(e[h]),
|
|
128
|
+
onChange: (i) => n({
|
|
130
129
|
...e,
|
|
131
|
-
[
|
|
130
|
+
[h]: Math.min(Number(i), 999)
|
|
132
131
|
}),
|
|
133
132
|
max: 999,
|
|
134
133
|
paddingless: !0,
|
|
@@ -137,109 +136,111 @@ const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmy
|
|
|
137
136
|
)
|
|
138
137
|
]
|
|
139
138
|
},
|
|
140
|
-
|
|
139
|
+
h
|
|
141
140
|
)) })
|
|
142
141
|
] })
|
|
143
142
|
] })
|
|
144
143
|
] });
|
|
145
|
-
},
|
|
146
|
-
title:
|
|
147
|
-
subtitle:
|
|
148
|
-
header:
|
|
149
|
-
text:
|
|
150
|
-
productsBlock:
|
|
151
|
-
top:
|
|
152
|
-
itemsBlock:
|
|
153
|
-
typeTexts:
|
|
154
|
-
block:
|
|
155
|
-
active:
|
|
156
|
-
products:
|
|
157
|
-
product:
|
|
158
|
-
button:
|
|
159
|
-
disabled:
|
|
160
|
-
image:
|
|
161
|
-
info:
|
|
162
|
-
name:
|
|
163
|
-
buttons:
|
|
164
|
-
modal:
|
|
165
|
-
link:
|
|
166
|
-
modalOptions:
|
|
167
|
-
addButton:
|
|
168
|
-
deleteButton:
|
|
144
|
+
}, ne = "_title_82zux_1", se = "_subtitle_82zux_5", ie = "_header_82zux_12", ae = "_text_82zux_13", oe = "_productsBlock_82zux_14", ce = "_top_82zux_26", re = "_itemsBlock_82zux_35", le = "_typeTexts_82zux_41", de = "_block_82zux_48", ue = "_active_82zux_61", me = "_products_82zux_14", he = "_product_82zux_14", pe = "_button_82zux_80", _e = "_disabled_82zux_91", ge = "_image_82zux_95", fe = "_info_82zux_102", xe = "_name_82zux_114", ve = "_buttons_82zux_118", je = "_modal_82zux_125", be = "_link_82zux_145", ye = "_modalOptions_82zux_151", Ie = "_addButton_82zux_157", Ne = "_deleteButton_82zux_179", X = {
|
|
145
|
+
title: ne,
|
|
146
|
+
subtitle: se,
|
|
147
|
+
header: ie,
|
|
148
|
+
text: ae,
|
|
149
|
+
productsBlock: oe,
|
|
150
|
+
top: ce,
|
|
151
|
+
itemsBlock: re,
|
|
152
|
+
typeTexts: le,
|
|
153
|
+
block: de,
|
|
154
|
+
active: ue,
|
|
155
|
+
products: me,
|
|
156
|
+
product: he,
|
|
157
|
+
button: pe,
|
|
158
|
+
disabled: _e,
|
|
159
|
+
image: ge,
|
|
160
|
+
info: fe,
|
|
161
|
+
name: xe,
|
|
162
|
+
buttons: ve,
|
|
163
|
+
modal: je,
|
|
164
|
+
link: be,
|
|
165
|
+
modalOptions: ye,
|
|
166
|
+
addButton: Ie,
|
|
167
|
+
deleteButton: Ne
|
|
169
168
|
};
|
|
170
|
-
function
|
|
169
|
+
function ke({ id: o, children: s }) {
|
|
171
170
|
const {
|
|
172
171
|
attributes: e,
|
|
173
172
|
listeners: n,
|
|
174
|
-
setNodeRef:
|
|
173
|
+
setNodeRef: a,
|
|
175
174
|
transform: c,
|
|
176
175
|
transition: u,
|
|
177
176
|
isDragging: r
|
|
178
|
-
} =
|
|
177
|
+
} = xt({
|
|
179
178
|
id: o
|
|
180
179
|
}), m = {
|
|
181
|
-
transform:
|
|
180
|
+
transform: vt.Transform.toString(c),
|
|
182
181
|
transition: u
|
|
183
182
|
};
|
|
184
183
|
return /* @__PURE__ */ t.jsx(
|
|
185
184
|
"div",
|
|
186
185
|
{
|
|
187
|
-
ref:
|
|
186
|
+
ref: a,
|
|
188
187
|
style: m,
|
|
189
|
-
className: `${
|
|
188
|
+
className: `${X.product} ${r ? X.dragging : ""}`,
|
|
190
189
|
...e,
|
|
191
190
|
...n,
|
|
192
191
|
children: s
|
|
193
192
|
}
|
|
194
193
|
);
|
|
195
194
|
}
|
|
196
|
-
const
|
|
195
|
+
const Ri = (o) => {
|
|
197
196
|
const {
|
|
198
197
|
isActiveItems: s,
|
|
199
198
|
setIsActiveItems: e,
|
|
200
199
|
items: n,
|
|
201
|
-
setItems:
|
|
200
|
+
setItems: a,
|
|
202
201
|
other: c,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
202
|
+
tags: u,
|
|
203
|
+
title: r,
|
|
204
|
+
subtitle: m,
|
|
205
|
+
draggable: _ = !1,
|
|
206
|
+
withImage: B = !1,
|
|
207
|
+
addable: h = !0,
|
|
208
|
+
itemsOptions: i,
|
|
209
|
+
hasRangeSelector: y = !1,
|
|
210
|
+
rangeSelectorOptions: d,
|
|
211
|
+
limit: C,
|
|
212
|
+
autoScrollInterval: v,
|
|
213
|
+
deletable: N,
|
|
214
|
+
aspectRatio: I,
|
|
215
|
+
setAspectRatio: A
|
|
216
|
+
} = o, x = mt(
|
|
217
|
+
ht(pt, {
|
|
216
218
|
activationConstraint: {
|
|
217
219
|
distance: 5
|
|
218
220
|
}
|
|
219
221
|
})
|
|
220
|
-
),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
$.splice(h, 0, P), i($);
|
|
222
|
+
), D = (p) => {
|
|
223
|
+
const { active: g, over: w } = p;
|
|
224
|
+
if (w && g.id !== w.id) {
|
|
225
|
+
const S = n.findIndex((q) => q === g.id), P = n.findIndex((q) => q === w.id);
|
|
226
|
+
if (S !== -1 && P !== -1) {
|
|
227
|
+
const q = [...n], [j] = q.splice(S, 1);
|
|
228
|
+
q.splice(P, 0, j), a(q);
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
|
-
function
|
|
232
|
-
if (
|
|
233
|
-
return
|
|
232
|
+
function z(p) {
|
|
233
|
+
if (B)
|
|
234
|
+
return p ? /* @__PURE__ */ t.jsx(
|
|
234
235
|
"img",
|
|
235
236
|
{
|
|
236
|
-
src: `https://imagedelivery.net/${
|
|
237
|
+
src: `https://imagedelivery.net/${p[0]}/w=1000`,
|
|
237
238
|
alt: "image",
|
|
238
239
|
width: 16,
|
|
239
240
|
height: 16
|
|
240
241
|
}
|
|
241
242
|
) : /* @__PURE__ */ t.jsx(
|
|
242
|
-
|
|
243
|
+
b,
|
|
243
244
|
{
|
|
244
245
|
name: "Image",
|
|
245
246
|
width: 16,
|
|
@@ -248,12 +249,12 @@ const Ei = (o) => {
|
|
|
248
249
|
}
|
|
249
250
|
);
|
|
250
251
|
}
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
const H = (p, g = !1) => {
|
|
253
|
+
const w = i.find((P) => P.id === p);
|
|
254
|
+
if (!w) return;
|
|
255
|
+
const S = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
256
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
257
|
+
b,
|
|
257
258
|
{
|
|
258
259
|
name: "DotsSixVertical",
|
|
259
260
|
hoverable: !0,
|
|
@@ -262,77 +263,80 @@ const Ei = (o) => {
|
|
|
262
263
|
}
|
|
263
264
|
) }),
|
|
264
265
|
/* @__PURE__ */ t.jsx(
|
|
265
|
-
|
|
266
|
+
it,
|
|
266
267
|
{
|
|
267
|
-
onChange: (
|
|
268
|
-
const
|
|
269
|
-
if (!
|
|
270
|
-
const
|
|
271
|
-
|
|
268
|
+
onChange: (P) => {
|
|
269
|
+
const q = [...n], j = i.find((T) => T.name === P);
|
|
270
|
+
if (!j) return;
|
|
271
|
+
const M = j.id, V = q.map((T) => T === p ? M : T);
|
|
272
|
+
a([...V]);
|
|
272
273
|
},
|
|
273
|
-
value:
|
|
274
|
-
options:
|
|
275
|
-
|
|
274
|
+
value: w.name,
|
|
275
|
+
options: i.filter((P) => !n.find((q) => q === P.id)).map((P) => P.name),
|
|
276
|
+
leftAddonOptions: i.map((P) => ({
|
|
277
|
+
value: P.name,
|
|
278
|
+
addon: z(P.images)
|
|
279
|
+
}))
|
|
276
280
|
}
|
|
277
281
|
),
|
|
278
|
-
|
|
279
|
-
|
|
282
|
+
g && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
283
|
+
b,
|
|
280
284
|
{
|
|
281
285
|
name: "Trash",
|
|
282
286
|
hoverable: !0,
|
|
283
287
|
width: 20,
|
|
284
288
|
height: 20,
|
|
285
289
|
fill: "#C12A2A",
|
|
286
|
-
onClick: () =>
|
|
290
|
+
onClick: () => a(n.filter((P) => P !== p))
|
|
287
291
|
}
|
|
288
292
|
) }) })
|
|
289
293
|
] });
|
|
290
|
-
return
|
|
291
|
-
|
|
294
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
295
|
+
ke,
|
|
292
296
|
{
|
|
293
|
-
id:
|
|
294
|
-
children:
|
|
297
|
+
id: p,
|
|
298
|
+
children: S
|
|
295
299
|
},
|
|
296
300
|
st()
|
|
297
301
|
) : /* @__PURE__ */ t.jsx(
|
|
298
302
|
"div",
|
|
299
303
|
{
|
|
300
|
-
className:
|
|
301
|
-
children:
|
|
304
|
+
className: X.product,
|
|
305
|
+
children: S
|
|
302
306
|
},
|
|
303
307
|
st()
|
|
304
308
|
);
|
|
305
309
|
};
|
|
306
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
307
|
-
(
|
|
308
|
-
|
|
310
|
+
return /* @__PURE__ */ t.jsxs("div", { className: X.productsBlock, children: [
|
|
311
|
+
(r || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
|
|
312
|
+
r && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: r }),
|
|
309
313
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
310
|
-
|
|
314
|
+
ct,
|
|
311
315
|
{
|
|
312
316
|
current: s,
|
|
313
|
-
onChange: (
|
|
317
|
+
onChange: (p) => e == null ? void 0 : e(p)
|
|
314
318
|
}
|
|
315
319
|
)
|
|
316
320
|
] }),
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
y && d && /* @__PURE__ */ t.jsx(St, { ...d }),
|
|
322
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
|
|
323
|
+
m && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: m }),
|
|
324
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
325
|
+
_t,
|
|
322
326
|
{
|
|
323
|
-
sensors:
|
|
324
|
-
onDragEnd:
|
|
327
|
+
sensors: x,
|
|
328
|
+
onDragEnd: D,
|
|
325
329
|
children: /* @__PURE__ */ t.jsx(
|
|
326
|
-
|
|
330
|
+
gt,
|
|
327
331
|
{
|
|
328
332
|
items: n,
|
|
329
|
-
strategy:
|
|
330
|
-
children: n.map((
|
|
333
|
+
strategy: ft,
|
|
334
|
+
children: n.map((p) => H(p, N))
|
|
331
335
|
}
|
|
332
336
|
)
|
|
333
337
|
}
|
|
334
|
-
) : n.map((
|
|
335
|
-
|
|
338
|
+
) : n.map((p) => H(p, N)),
|
|
339
|
+
h && /* @__PURE__ */ t.jsx(
|
|
336
340
|
"div",
|
|
337
341
|
{
|
|
338
342
|
style: {
|
|
@@ -342,33 +346,33 @@ const Ei = (o) => {
|
|
|
342
346
|
gap: 5
|
|
343
347
|
},
|
|
344
348
|
children: /* @__PURE__ */ t.jsx(
|
|
345
|
-
|
|
349
|
+
rt,
|
|
346
350
|
{
|
|
347
351
|
withoutHover: !0,
|
|
348
|
-
className:
|
|
349
|
-
[
|
|
352
|
+
className: F(X.button, {
|
|
353
|
+
[X.disabled]: !!(C && C <= n.length || n.length === i.length)
|
|
350
354
|
}),
|
|
351
355
|
size: "s",
|
|
352
|
-
disabled: !!(
|
|
356
|
+
disabled: !!(C && C <= n.length || n.length === i.length),
|
|
353
357
|
onClick: () => {
|
|
354
|
-
const
|
|
355
|
-
let
|
|
356
|
-
if (
|
|
357
|
-
for (let
|
|
358
|
-
if (!n.find((
|
|
359
|
-
|
|
358
|
+
const p = [...n];
|
|
359
|
+
let g = null;
|
|
360
|
+
if (i) {
|
|
361
|
+
for (let w = 0; w < i.length; w++)
|
|
362
|
+
if (!n.find((S) => S === i[w].id)) {
|
|
363
|
+
g = i[w];
|
|
360
364
|
break;
|
|
361
365
|
}
|
|
362
366
|
}
|
|
363
|
-
|
|
367
|
+
p.push((g == null ? void 0 : g.id) || i[0].id), a(p);
|
|
364
368
|
},
|
|
365
369
|
style: {
|
|
366
370
|
width: "fit-content"
|
|
367
371
|
},
|
|
368
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
372
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: X.addButton, children: [
|
|
369
373
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
370
374
|
/* @__PURE__ */ t.jsx(
|
|
371
|
-
|
|
375
|
+
b,
|
|
372
376
|
{
|
|
373
377
|
name: "Plus",
|
|
374
378
|
width: 16,
|
|
@@ -381,14 +385,37 @@ const Ei = (o) => {
|
|
|
381
385
|
}
|
|
382
386
|
)
|
|
383
387
|
] }),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
388
|
+
I && A && /* @__PURE__ */ t.jsx(
|
|
389
|
+
it,
|
|
390
|
+
{
|
|
391
|
+
value: I,
|
|
392
|
+
label: "Aspect Ratio",
|
|
393
|
+
options: Object.keys($t),
|
|
394
|
+
onChange: (p) => A(p),
|
|
395
|
+
leftAddonOptions: wt
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
u !== void 0 && /* @__PURE__ */ t.jsx(
|
|
399
|
+
ut,
|
|
400
|
+
{
|
|
401
|
+
tagsTitle: "Tags",
|
|
402
|
+
items: u
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
406
|
+
ut,
|
|
407
|
+
{
|
|
408
|
+
otherTitle: "Other",
|
|
409
|
+
items: c
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
v !== void 0 && /* @__PURE__ */ t.jsx(
|
|
413
|
+
It,
|
|
387
414
|
{
|
|
388
415
|
label: "Auto scroll interval",
|
|
389
416
|
type: "number",
|
|
390
|
-
value: String(
|
|
391
|
-
onChange: (
|
|
417
|
+
value: String(v.scrollInterval),
|
|
418
|
+
onChange: (p) => v.setScrollInterval(Number(p)),
|
|
392
419
|
min: 0.1,
|
|
393
420
|
max: 100,
|
|
394
421
|
style: {
|
|
@@ -398,52 +425,52 @@ const Ei = (o) => {
|
|
|
398
425
|
}
|
|
399
426
|
)
|
|
400
427
|
] });
|
|
401
|
-
},
|
|
402
|
-
title:
|
|
403
|
-
subtitle:
|
|
404
|
-
header:
|
|
405
|
-
text:
|
|
406
|
-
productsBlock:
|
|
407
|
-
top:
|
|
408
|
-
itemsBlock:
|
|
409
|
-
typeTexts:
|
|
410
|
-
block:
|
|
411
|
-
active:
|
|
412
|
-
products:
|
|
413
|
-
product:
|
|
414
|
-
button:
|
|
415
|
-
disabled:
|
|
416
|
-
image:
|
|
417
|
-
info:
|
|
418
|
-
name:
|
|
419
|
-
buttons:
|
|
420
|
-
modal:
|
|
421
|
-
link:
|
|
422
|
-
modalOptions:
|
|
423
|
-
addButton:
|
|
424
|
-
deleteButton:
|
|
425
|
-
closeIcon:
|
|
428
|
+
}, Ce = "_title_roi3a_1", Se = "_subtitle_roi3a_5", $e = "_header_roi3a_12", we = "_text_roi3a_13", qe = "_productsBlock_roi3a_14", Be = "_top_roi3a_26", Pe = "_itemsBlock_roi3a_35", Te = "_typeTexts_roi3a_41", Me = "_block_roi3a_48", Ae = "_active_roi3a_61", Oe = "_products_roi3a_14", Ee = "_product_roi3a_14", Re = "_button_roi3a_80", De = "_disabled_roi3a_91", Le = "_image_roi3a_95", ze = "_info_roi3a_102", Fe = "_name_roi3a_114", Ve = "_buttons_roi3a_118", Ue = "_modal_roi3a_125", He = "_link_roi3a_145", Ye = "_modalOptions_roi3a_151", We = "_addButton_roi3a_164", Ge = "_deleteButton_roi3a_179", Qe = "_closeIcon_roi3a_191", W = {
|
|
429
|
+
title: Ce,
|
|
430
|
+
subtitle: Se,
|
|
431
|
+
header: $e,
|
|
432
|
+
text: we,
|
|
433
|
+
productsBlock: qe,
|
|
434
|
+
top: Be,
|
|
435
|
+
itemsBlock: Pe,
|
|
436
|
+
typeTexts: Te,
|
|
437
|
+
block: Me,
|
|
438
|
+
active: Ae,
|
|
439
|
+
products: Oe,
|
|
440
|
+
product: Ee,
|
|
441
|
+
button: Re,
|
|
442
|
+
disabled: De,
|
|
443
|
+
image: Le,
|
|
444
|
+
info: ze,
|
|
445
|
+
name: Fe,
|
|
446
|
+
buttons: Ve,
|
|
447
|
+
modal: Ue,
|
|
448
|
+
link: He,
|
|
449
|
+
modalOptions: Ye,
|
|
450
|
+
addButton: We,
|
|
451
|
+
deleteButton: Ge,
|
|
452
|
+
closeIcon: Qe
|
|
426
453
|
};
|
|
427
|
-
function
|
|
454
|
+
function Xe({ product: o, children: s }) {
|
|
428
455
|
const {
|
|
429
456
|
attributes: e,
|
|
430
457
|
listeners: n,
|
|
431
|
-
setNodeRef:
|
|
458
|
+
setNodeRef: a,
|
|
432
459
|
transform: c,
|
|
433
460
|
transition: u,
|
|
434
461
|
isDragging: r
|
|
435
|
-
} =
|
|
462
|
+
} = xt({
|
|
436
463
|
id: o.id
|
|
437
464
|
}), m = {
|
|
438
|
-
transform:
|
|
465
|
+
transform: vt.Transform.toString(c),
|
|
439
466
|
transition: u
|
|
440
467
|
};
|
|
441
468
|
return /* @__PURE__ */ t.jsx(
|
|
442
469
|
"div",
|
|
443
470
|
{
|
|
444
|
-
ref:
|
|
471
|
+
ref: a,
|
|
445
472
|
style: m,
|
|
446
|
-
className: `${
|
|
473
|
+
className: `${W.product} ${r ? W.dragging : ""}`,
|
|
447
474
|
...e,
|
|
448
475
|
...n,
|
|
449
476
|
children: s
|
|
@@ -455,52 +482,52 @@ const Di = (o) => {
|
|
|
455
482
|
isActiveItems: s,
|
|
456
483
|
setIsActiveItems: e,
|
|
457
484
|
items: n,
|
|
458
|
-
setItems:
|
|
485
|
+
setItems: a,
|
|
459
486
|
title: c,
|
|
460
487
|
subtitle: u,
|
|
461
488
|
editable: r = !0,
|
|
462
489
|
draggable: m = !1,
|
|
463
|
-
deletable:
|
|
490
|
+
deletable: _ = !0,
|
|
464
491
|
addable: B = !0,
|
|
465
|
-
itemsType:
|
|
466
|
-
itemsOptions:
|
|
467
|
-
addableOptions:
|
|
492
|
+
itemsType: h,
|
|
493
|
+
itemsOptions: i,
|
|
494
|
+
addableOptions: y = {},
|
|
468
495
|
limit: d
|
|
469
|
-
} = o, [
|
|
470
|
-
|
|
496
|
+
} = o, [C, v] = f.useState(null), [N, I] = f.useState(null), A = f.useRef(null), x = mt(
|
|
497
|
+
ht(pt, {
|
|
471
498
|
activationConstraint: {
|
|
472
499
|
distance: 5
|
|
473
500
|
}
|
|
474
501
|
})
|
|
475
502
|
);
|
|
476
|
-
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
479
|
-
|
|
503
|
+
f.useEffect(() => {
|
|
504
|
+
if (C) {
|
|
505
|
+
const p = [...n].map((g) => g.id === C.id ? C : g);
|
|
506
|
+
a(p);
|
|
480
507
|
}
|
|
481
|
-
}, [
|
|
482
|
-
|
|
483
|
-
}, [
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
top:
|
|
489
|
-
left:
|
|
490
|
-
}), g
|
|
491
|
-
},
|
|
492
|
-
const { active:
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
|
|
508
|
+
}, [C]), f.useEffect(() => {
|
|
509
|
+
A.current && N && (A.current.getBoundingClientRect().height, N.top);
|
|
510
|
+
}, [A.current, N]);
|
|
511
|
+
const D = (p, g) => {
|
|
512
|
+
p.stopPropagation();
|
|
513
|
+
const w = p.target.getBoundingClientRect();
|
|
514
|
+
I({
|
|
515
|
+
top: w.top + window.scrollY,
|
|
516
|
+
left: w.left - 30
|
|
517
|
+
}), v(g);
|
|
518
|
+
}, z = (p) => {
|
|
519
|
+
const { active: g, over: w } = p;
|
|
520
|
+
if (w && g.id !== w.id) {
|
|
521
|
+
const S = n.findIndex((q) => q.id === g.id), P = n.findIndex((q) => q.id === w.id);
|
|
522
|
+
if (S !== -1 && P !== -1) {
|
|
523
|
+
const q = [...n], [j] = q.splice(S, 1);
|
|
524
|
+
q.splice(P, 0, j), a(q);
|
|
498
525
|
}
|
|
499
526
|
}
|
|
500
|
-
},
|
|
501
|
-
const
|
|
527
|
+
}, H = (p, g) => {
|
|
528
|
+
const w = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
502
529
|
m && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
503
|
-
|
|
530
|
+
b,
|
|
504
531
|
{
|
|
505
532
|
name: "DotsSixVertical",
|
|
506
533
|
hoverable: !0,
|
|
@@ -508,98 +535,98 @@ const Di = (o) => {
|
|
|
508
535
|
height: 20
|
|
509
536
|
}
|
|
510
537
|
) }),
|
|
511
|
-
|
|
512
|
-
|
|
538
|
+
h === "select" && i && /* @__PURE__ */ t.jsx(
|
|
539
|
+
it,
|
|
513
540
|
{
|
|
514
|
-
onChange: (
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const
|
|
518
|
-
...
|
|
541
|
+
onChange: (S) => {
|
|
542
|
+
const P = [...n], q = i.find((M) => M.name === S);
|
|
543
|
+
if (!q) return;
|
|
544
|
+
const j = P.map((M) => M.id === p.id ? {
|
|
545
|
+
...q,
|
|
519
546
|
name: {
|
|
520
|
-
"en-US":
|
|
547
|
+
"en-US": S
|
|
521
548
|
}
|
|
522
|
-
} :
|
|
523
|
-
|
|
524
|
-
...
|
|
549
|
+
} : M);
|
|
550
|
+
v({
|
|
551
|
+
...p,
|
|
525
552
|
name: {
|
|
526
|
-
"en-US":
|
|
553
|
+
"en-US": S
|
|
527
554
|
}
|
|
528
|
-
}),
|
|
555
|
+
}), a([...j]);
|
|
529
556
|
},
|
|
530
|
-
value:
|
|
531
|
-
options:
|
|
557
|
+
value: p.name,
|
|
558
|
+
options: i.filter((S) => !n.find((P) => P.name === S.name)).map((S) => S.name)
|
|
532
559
|
}
|
|
533
560
|
),
|
|
534
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
535
|
-
r && /* @__PURE__ */ t.jsx("div", { className:
|
|
536
|
-
|
|
561
|
+
/* @__PURE__ */ t.jsxs("div", { className: W.buttons, children: [
|
|
562
|
+
r && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
563
|
+
b,
|
|
537
564
|
{
|
|
538
565
|
name: "Sliders",
|
|
539
566
|
hoverable: !0,
|
|
540
567
|
width: 20,
|
|
541
568
|
height: 20,
|
|
542
|
-
onClick: (
|
|
569
|
+
onClick: (S) => D(S, p)
|
|
543
570
|
}
|
|
544
571
|
) }),
|
|
545
|
-
|
|
546
|
-
|
|
572
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
573
|
+
b,
|
|
547
574
|
{
|
|
548
575
|
name: "Trash",
|
|
549
576
|
hoverable: !0,
|
|
550
577
|
width: 20,
|
|
551
578
|
height: 20,
|
|
552
579
|
fill: "#C12A2A",
|
|
553
|
-
onClick: () =>
|
|
580
|
+
onClick: () => a(n.filter((S) => S.id !== p.id))
|
|
554
581
|
}
|
|
555
582
|
) })
|
|
556
583
|
] })
|
|
557
584
|
] });
|
|
558
585
|
return m ? /* @__PURE__ */ t.jsx(
|
|
559
|
-
|
|
586
|
+
Xe,
|
|
560
587
|
{
|
|
561
|
-
product:
|
|
562
|
-
index:
|
|
563
|
-
children:
|
|
588
|
+
product: p,
|
|
589
|
+
index: g,
|
|
590
|
+
children: w
|
|
564
591
|
},
|
|
565
|
-
|
|
592
|
+
p.id
|
|
566
593
|
) : /* @__PURE__ */ t.jsx(
|
|
567
594
|
"div",
|
|
568
595
|
{
|
|
569
|
-
className:
|
|
570
|
-
children:
|
|
596
|
+
className: W.product,
|
|
597
|
+
children: w
|
|
571
598
|
},
|
|
572
|
-
|
|
599
|
+
p.id
|
|
573
600
|
);
|
|
574
601
|
};
|
|
575
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
576
|
-
(c || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
577
|
-
c && /* @__PURE__ */ t.jsx("h3", { className:
|
|
602
|
+
return /* @__PURE__ */ t.jsxs("div", { className: W.productsBlock, children: [
|
|
603
|
+
(c || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
|
|
604
|
+
c && /* @__PURE__ */ t.jsx("h3", { className: W.title, children: c }),
|
|
578
605
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
579
|
-
|
|
606
|
+
ct,
|
|
580
607
|
{
|
|
581
608
|
current: s,
|
|
582
|
-
onChange: (
|
|
609
|
+
onChange: (p) => e == null ? void 0 : e(p)
|
|
583
610
|
}
|
|
584
611
|
)
|
|
585
612
|
] }),
|
|
586
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
587
|
-
u && /* @__PURE__ */ t.jsx("h5", { className:
|
|
613
|
+
/* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
|
|
614
|
+
u && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: u }),
|
|
588
615
|
m ? /* @__PURE__ */ t.jsx(
|
|
589
|
-
|
|
616
|
+
_t,
|
|
590
617
|
{
|
|
591
|
-
sensors:
|
|
592
|
-
onDragEnd:
|
|
618
|
+
sensors: x,
|
|
619
|
+
onDragEnd: z,
|
|
593
620
|
children: /* @__PURE__ */ t.jsx(
|
|
594
|
-
|
|
621
|
+
gt,
|
|
595
622
|
{
|
|
596
|
-
items: n.map((
|
|
597
|
-
strategy:
|
|
598
|
-
children: n.map((
|
|
623
|
+
items: n.map((p) => p.id),
|
|
624
|
+
strategy: ft,
|
|
625
|
+
children: n.map((p, g) => H(p, g))
|
|
599
626
|
}
|
|
600
627
|
)
|
|
601
628
|
}
|
|
602
|
-
) : n.map((
|
|
629
|
+
) : n.map((p, g) => H(p, g)),
|
|
603
630
|
B && /* @__PURE__ */ t.jsx(
|
|
604
631
|
"div",
|
|
605
632
|
{
|
|
@@ -609,37 +636,37 @@ const Di = (o) => {
|
|
|
609
636
|
justifyContent: "center"
|
|
610
637
|
},
|
|
611
638
|
children: /* @__PURE__ */ t.jsx(
|
|
612
|
-
|
|
639
|
+
rt,
|
|
613
640
|
{
|
|
614
641
|
withoutHover: !0,
|
|
615
|
-
className:
|
|
616
|
-
[
|
|
642
|
+
className: F(W.button, {
|
|
643
|
+
[W.disabled]: !!(d && d <= n.length || n.length === (i == null ? void 0 : i.length))
|
|
617
644
|
}),
|
|
618
645
|
size: "s",
|
|
619
|
-
disabled: !!(d && d <= n.length || n.length === (
|
|
646
|
+
disabled: !!(d && d <= n.length || n.length === (i == null ? void 0 : i.length)),
|
|
620
647
|
onClick: () => {
|
|
621
|
-
const
|
|
622
|
-
let
|
|
623
|
-
if (
|
|
624
|
-
for (let
|
|
625
|
-
if (!n.find((
|
|
626
|
-
|
|
648
|
+
const p = [...n];
|
|
649
|
+
let g = null;
|
|
650
|
+
if (i) {
|
|
651
|
+
for (let w = 0; w < i.length; w++)
|
|
652
|
+
if (!n.find((S) => S.id === i[w].id)) {
|
|
653
|
+
g = i[w];
|
|
627
654
|
break;
|
|
628
655
|
}
|
|
629
656
|
}
|
|
630
|
-
|
|
631
|
-
name:
|
|
632
|
-
id: (
|
|
633
|
-
...
|
|
634
|
-
}),
|
|
657
|
+
h === "select" && i && p.push({
|
|
658
|
+
name: g ? g.name : i[0].name,
|
|
659
|
+
id: (g == null ? void 0 : g.id) || i[0].id,
|
|
660
|
+
...y
|
|
661
|
+
}), a(p);
|
|
635
662
|
},
|
|
636
663
|
style: {
|
|
637
664
|
width: "fit-content"
|
|
638
665
|
},
|
|
639
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
666
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: W.addButton, children: [
|
|
640
667
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
641
668
|
/* @__PURE__ */ t.jsx(
|
|
642
|
-
|
|
669
|
+
b,
|
|
643
670
|
{
|
|
644
671
|
name: "Plus",
|
|
645
672
|
width: 16,
|
|
@@ -654,99 +681,99 @@ const Di = (o) => {
|
|
|
654
681
|
] })
|
|
655
682
|
] });
|
|
656
683
|
};
|
|
657
|
-
function
|
|
658
|
-
const { product: s, children: e } = o, { attributes: n, listeners:
|
|
684
|
+
function Je(o) {
|
|
685
|
+
const { product: s, children: e } = o, { attributes: n, listeners: a, setNodeRef: c, transform: u, transition: r, isDragging: m } = xt({
|
|
659
686
|
id: s.id
|
|
660
|
-
}),
|
|
661
|
-
transform:
|
|
687
|
+
}), _ = {
|
|
688
|
+
transform: vt.Transform.toString(u),
|
|
662
689
|
transition: r
|
|
663
690
|
};
|
|
664
691
|
return /* @__PURE__ */ t.jsx(
|
|
665
692
|
"div",
|
|
666
693
|
{
|
|
667
694
|
ref: c,
|
|
668
|
-
style:
|
|
669
|
-
className: `${
|
|
695
|
+
style: _,
|
|
696
|
+
className: `${Y.product} ${m ? Y.dragging : ""}`,
|
|
670
697
|
...n,
|
|
671
|
-
...
|
|
698
|
+
...a,
|
|
672
699
|
children: e
|
|
673
700
|
}
|
|
674
701
|
);
|
|
675
702
|
}
|
|
676
|
-
const
|
|
703
|
+
const Li = (o) => {
|
|
677
704
|
const {
|
|
678
705
|
isActiveItems: s,
|
|
679
706
|
setIsActiveItems: e,
|
|
680
707
|
items: n,
|
|
681
|
-
setItems:
|
|
708
|
+
setItems: a,
|
|
682
709
|
other: c,
|
|
683
710
|
title: u,
|
|
684
711
|
subtitle: r,
|
|
685
712
|
editable: m = !0,
|
|
686
|
-
draggable:
|
|
713
|
+
draggable: _ = !1,
|
|
687
714
|
withImage: B = !1,
|
|
688
|
-
deletable:
|
|
689
|
-
addable:
|
|
690
|
-
itemsType:
|
|
715
|
+
deletable: h = !0,
|
|
716
|
+
addable: i = !0,
|
|
717
|
+
itemsType: y,
|
|
691
718
|
itemsPlaceholder: d = "",
|
|
692
|
-
itemsOptions:
|
|
693
|
-
hasRangeSelector:
|
|
694
|
-
rangeSelectorOptions:
|
|
695
|
-
modalOptions:
|
|
696
|
-
addableOptions:
|
|
697
|
-
limit:
|
|
698
|
-
} = o, [
|
|
719
|
+
itemsOptions: C,
|
|
720
|
+
hasRangeSelector: v = !1,
|
|
721
|
+
rangeSelectorOptions: N,
|
|
722
|
+
modalOptions: I,
|
|
723
|
+
addableOptions: A = {},
|
|
724
|
+
limit: x
|
|
725
|
+
} = o, [D, z] = f.useState(null), [H, p] = f.useState({
|
|
699
726
|
top: 0,
|
|
700
727
|
left: 0
|
|
701
|
-
}), [
|
|
702
|
-
|
|
728
|
+
}), [g, w] = f.useState(null), S = f.useRef(null), [P, q] = f.useState(!1), j = mt(
|
|
729
|
+
ht(pt, {
|
|
703
730
|
activationConstraint: {
|
|
704
731
|
distance: 5
|
|
705
732
|
}
|
|
706
733
|
})
|
|
707
734
|
);
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
|
|
735
|
+
f.useEffect(() => {
|
|
736
|
+
const l = () => {
|
|
737
|
+
z(null), q(!1);
|
|
711
738
|
};
|
|
712
|
-
return document.body.addEventListener("click",
|
|
713
|
-
|
|
739
|
+
return document.body.addEventListener("click", l), z(null), q(!1), () => {
|
|
740
|
+
z(null), q(!1), document.body.removeEventListener("click", l);
|
|
714
741
|
};
|
|
715
|
-
}, []),
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
|
|
742
|
+
}, []), f.useEffect(() => {
|
|
743
|
+
if (D) {
|
|
744
|
+
const l = [...n].map((E) => E.id === D.id ? D : E);
|
|
745
|
+
a(l);
|
|
719
746
|
}
|
|
720
|
-
}, [
|
|
721
|
-
if (
|
|
722
|
-
const
|
|
723
|
-
let
|
|
724
|
-
|
|
725
|
-
top:
|
|
726
|
-
left:
|
|
747
|
+
}, [D]), f.useEffect(() => {
|
|
748
|
+
if (S.current && g) {
|
|
749
|
+
const l = S.current.getBoundingClientRect().height, E = window.innerHeight;
|
|
750
|
+
let R = g.top;
|
|
751
|
+
R + l > E + window.scrollY - 200 && (R = E + window.scrollY - l - 200), R < 0 && (R = 10), p({
|
|
752
|
+
top: R,
|
|
753
|
+
left: g.left
|
|
727
754
|
});
|
|
728
755
|
}
|
|
729
|
-
}, [
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
top:
|
|
735
|
-
left:
|
|
736
|
-
}),
|
|
756
|
+
}, [S.current, g]);
|
|
757
|
+
const M = (l, E) => {
|
|
758
|
+
l.stopPropagation();
|
|
759
|
+
const R = l.target.getBoundingClientRect();
|
|
760
|
+
w({
|
|
761
|
+
top: R.top + window.scrollY,
|
|
762
|
+
left: R.left - 30
|
|
763
|
+
}), z(E), q(!0);
|
|
737
764
|
};
|
|
738
|
-
function
|
|
765
|
+
function V(l) {
|
|
739
766
|
if (B)
|
|
740
|
-
return
|
|
767
|
+
return l ? /* @__PURE__ */ t.jsx(
|
|
741
768
|
"img",
|
|
742
769
|
{
|
|
743
|
-
src: `https://imagedelivery.net/${
|
|
770
|
+
src: `https://imagedelivery.net/${l[0]}/w=1000`,
|
|
744
771
|
alt: "image",
|
|
745
772
|
width: 16,
|
|
746
773
|
height: 16
|
|
747
774
|
}
|
|
748
775
|
) : /* @__PURE__ */ t.jsx(
|
|
749
|
-
|
|
776
|
+
b,
|
|
750
777
|
{
|
|
751
778
|
name: "Image",
|
|
752
779
|
width: 16,
|
|
@@ -755,20 +782,20 @@ const Ri = (o) => {
|
|
|
755
782
|
}
|
|
756
783
|
);
|
|
757
784
|
}
|
|
758
|
-
const
|
|
759
|
-
const { active:
|
|
760
|
-
if (
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
|
|
785
|
+
const T = (l) => {
|
|
786
|
+
const { active: E, over: R } = l;
|
|
787
|
+
if (R && E.id !== R.id) {
|
|
788
|
+
const O = n.findIndex((G) => G.id === E.id), nt = n.findIndex((G) => G.id === R.id);
|
|
789
|
+
if (O !== -1 && nt !== -1) {
|
|
790
|
+
const G = [...n], [Z] = G.splice(O, 1);
|
|
791
|
+
G.splice(nt, 0, Z), a(G);
|
|
765
792
|
}
|
|
766
793
|
}
|
|
767
|
-
},
|
|
768
|
-
var
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
794
|
+
}, U = (l) => {
|
|
795
|
+
var R;
|
|
796
|
+
const E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
797
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
798
|
+
b,
|
|
772
799
|
{
|
|
773
800
|
name: "DotsSixVertical",
|
|
774
801
|
hoverable: !0,
|
|
@@ -776,140 +803,145 @@ const Ri = (o) => {
|
|
|
776
803
|
height: 20
|
|
777
804
|
}
|
|
778
805
|
) }),
|
|
779
|
-
|
|
780
|
-
|
|
806
|
+
y === "select" && C && /* @__PURE__ */ t.jsx(
|
|
807
|
+
it,
|
|
781
808
|
{
|
|
782
|
-
onChange: (
|
|
783
|
-
const
|
|
784
|
-
...
|
|
809
|
+
onChange: (O) => {
|
|
810
|
+
const G = [...n].map((Z) => Z.id === l.id ? {
|
|
811
|
+
...l,
|
|
785
812
|
name: {
|
|
786
|
-
"en-US":
|
|
813
|
+
"en-US": O
|
|
787
814
|
}
|
|
788
|
-
} :
|
|
789
|
-
|
|
790
|
-
...
|
|
815
|
+
} : Z);
|
|
816
|
+
z({
|
|
817
|
+
...l,
|
|
791
818
|
name: {
|
|
792
|
-
"en-US":
|
|
819
|
+
"en-US": O
|
|
793
820
|
}
|
|
794
|
-
}),
|
|
821
|
+
}), a([...G]);
|
|
795
822
|
},
|
|
796
|
-
value:
|
|
797
|
-
options:
|
|
798
|
-
(
|
|
823
|
+
value: l.name["en-US"],
|
|
824
|
+
options: C.filter(
|
|
825
|
+
(O) => !n.find((nt) => nt.name["en-US"] === O)
|
|
799
826
|
),
|
|
800
|
-
|
|
827
|
+
leftAddonOptions: [
|
|
828
|
+
{
|
|
829
|
+
value: l.name["en-US"],
|
|
830
|
+
addon: V(l.images)
|
|
831
|
+
}
|
|
832
|
+
]
|
|
801
833
|
}
|
|
802
834
|
),
|
|
803
|
-
|
|
804
|
-
|
|
835
|
+
y === "input" && /* @__PURE__ */ t.jsx(
|
|
836
|
+
It,
|
|
805
837
|
{
|
|
806
|
-
onChange: (
|
|
807
|
-
const
|
|
808
|
-
...
|
|
838
|
+
onChange: (O) => {
|
|
839
|
+
const G = [...n].map((Z) => Z.id === l.id ? {
|
|
840
|
+
...l,
|
|
809
841
|
name: {
|
|
810
|
-
"en-US":
|
|
842
|
+
"en-US": O
|
|
811
843
|
}
|
|
812
|
-
} :
|
|
813
|
-
|
|
844
|
+
} : Z);
|
|
845
|
+
a([...G]);
|
|
814
846
|
},
|
|
815
|
-
value:
|
|
847
|
+
value: l.name["en-US"],
|
|
816
848
|
placeholder: d
|
|
817
849
|
}
|
|
818
850
|
),
|
|
819
|
-
|
|
820
|
-
|
|
851
|
+
y === "image" && /* @__PURE__ */ t.jsx(
|
|
852
|
+
At,
|
|
821
853
|
{
|
|
822
|
-
onChange: (
|
|
823
|
-
const
|
|
824
|
-
...
|
|
825
|
-
images:
|
|
826
|
-
} :
|
|
827
|
-
|
|
854
|
+
onChange: (O) => {
|
|
855
|
+
const G = [...n].map((Z) => Z.id === l.id ? {
|
|
856
|
+
...l,
|
|
857
|
+
images: O
|
|
858
|
+
} : Z);
|
|
859
|
+
a([...G]);
|
|
828
860
|
},
|
|
829
|
-
activeImage: (
|
|
861
|
+
activeImage: (R = n.find((O) => O.id === l.id)) == null ? void 0 : R.images[0]
|
|
830
862
|
}
|
|
831
863
|
),
|
|
832
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
833
|
-
m && /* @__PURE__ */ t.jsx("div", { className:
|
|
834
|
-
|
|
864
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
|
|
865
|
+
m && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
866
|
+
b,
|
|
835
867
|
{
|
|
836
868
|
name: "Sliders",
|
|
837
869
|
hoverable: !0,
|
|
838
870
|
width: 20,
|
|
839
871
|
height: 20,
|
|
840
|
-
onClick: (
|
|
872
|
+
onClick: (O) => M(O, l)
|
|
841
873
|
}
|
|
842
874
|
) }),
|
|
843
|
-
|
|
844
|
-
|
|
875
|
+
h && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
876
|
+
b,
|
|
845
877
|
{
|
|
846
878
|
name: "Trash",
|
|
847
879
|
hoverable: !0,
|
|
848
880
|
width: 20,
|
|
849
881
|
height: 20,
|
|
850
882
|
fill: "#C12A2A",
|
|
851
|
-
onClick: () =>
|
|
883
|
+
onClick: () => a(n.filter((O) => O.id !== l.id))
|
|
852
884
|
}
|
|
853
885
|
) })
|
|
854
886
|
] })
|
|
855
887
|
] });
|
|
856
|
-
return
|
|
857
|
-
|
|
888
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
889
|
+
Je,
|
|
858
890
|
{
|
|
859
|
-
product:
|
|
860
|
-
children:
|
|
891
|
+
product: l,
|
|
892
|
+
children: E
|
|
861
893
|
},
|
|
862
|
-
|
|
894
|
+
l.id
|
|
863
895
|
) : /* @__PURE__ */ t.jsx(
|
|
864
896
|
"div",
|
|
865
897
|
{
|
|
866
|
-
className:
|
|
867
|
-
children:
|
|
898
|
+
className: Y.product,
|
|
899
|
+
children: E
|
|
868
900
|
},
|
|
869
|
-
|
|
901
|
+
l.id
|
|
870
902
|
);
|
|
871
903
|
};
|
|
872
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
873
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
874
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
904
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Y.productsBlock, children: [
|
|
905
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Y.top, children: [
|
|
906
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: Y.title, children: u }),
|
|
875
907
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
876
|
-
|
|
908
|
+
ct,
|
|
877
909
|
{
|
|
878
910
|
current: s,
|
|
879
|
-
onChange: (
|
|
911
|
+
onChange: (l) => e == null ? void 0 : e(l)
|
|
880
912
|
}
|
|
881
913
|
)
|
|
882
914
|
] }),
|
|
883
|
-
|
|
884
|
-
|
|
915
|
+
D && m && I && P && /* @__PURE__ */ t.jsx(
|
|
916
|
+
Mt,
|
|
885
917
|
{
|
|
886
|
-
ref:
|
|
887
|
-
activeItem:
|
|
888
|
-
setActiveItem:
|
|
889
|
-
popupPosition:
|
|
890
|
-
modalOptions:
|
|
891
|
-
setIsOpenModal:
|
|
918
|
+
ref: S,
|
|
919
|
+
activeItem: D,
|
|
920
|
+
setActiveItem: z,
|
|
921
|
+
popupPosition: H,
|
|
922
|
+
modalOptions: I,
|
|
923
|
+
setIsOpenModal: q
|
|
892
924
|
}
|
|
893
925
|
),
|
|
894
|
-
|
|
895
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
896
|
-
r && /* @__PURE__ */ t.jsx("h5", { className:
|
|
897
|
-
|
|
898
|
-
|
|
926
|
+
v && N && /* @__PURE__ */ t.jsx(St, { ...N }),
|
|
927
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.products, children: [
|
|
928
|
+
r && /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: r }),
|
|
929
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
930
|
+
_t,
|
|
899
931
|
{
|
|
900
|
-
sensors:
|
|
901
|
-
onDragEnd:
|
|
932
|
+
sensors: j,
|
|
933
|
+
onDragEnd: T,
|
|
902
934
|
children: /* @__PURE__ */ t.jsx(
|
|
903
|
-
|
|
935
|
+
gt,
|
|
904
936
|
{
|
|
905
|
-
items: n.map((
|
|
906
|
-
strategy:
|
|
907
|
-
children: n.map((
|
|
937
|
+
items: n.map((l) => l.id),
|
|
938
|
+
strategy: ft,
|
|
939
|
+
children: n.map((l) => U(l))
|
|
908
940
|
}
|
|
909
941
|
)
|
|
910
942
|
}
|
|
911
|
-
) : n.map((
|
|
912
|
-
|
|
943
|
+
) : n.map((l) => U(l)),
|
|
944
|
+
i && /* @__PURE__ */ t.jsx(
|
|
913
945
|
"div",
|
|
914
946
|
{
|
|
915
947
|
style: {
|
|
@@ -918,55 +950,55 @@ const Ri = (o) => {
|
|
|
918
950
|
justifyContent: "center"
|
|
919
951
|
},
|
|
920
952
|
children: /* @__PURE__ */ t.jsx(
|
|
921
|
-
|
|
953
|
+
rt,
|
|
922
954
|
{
|
|
923
955
|
withoutHover: !0,
|
|
924
|
-
className:
|
|
925
|
-
[
|
|
956
|
+
className: F(Y.button, {
|
|
957
|
+
[Y.disabled]: !!(x && x <= n.length)
|
|
926
958
|
}),
|
|
927
959
|
size: "s",
|
|
928
|
-
disabled: !!(
|
|
960
|
+
disabled: !!(x && x <= n.length),
|
|
929
961
|
onClick: () => {
|
|
930
|
-
const
|
|
931
|
-
let
|
|
932
|
-
if (
|
|
933
|
-
for (let
|
|
934
|
-
if (!n.find((
|
|
935
|
-
|
|
962
|
+
const l = [...n];
|
|
963
|
+
let E = null;
|
|
964
|
+
if (C) {
|
|
965
|
+
for (let R = 0; R < C.length; R++)
|
|
966
|
+
if (!n.find((O) => O.name["en-US"] === C[R])) {
|
|
967
|
+
E = C[R];
|
|
936
968
|
break;
|
|
937
969
|
}
|
|
938
970
|
}
|
|
939
|
-
|
|
971
|
+
y === "select" && C ? l.push({
|
|
940
972
|
name: {
|
|
941
|
-
"en-US":
|
|
973
|
+
"en-US": E || C[0]
|
|
942
974
|
},
|
|
943
975
|
id: st(),
|
|
944
|
-
...
|
|
976
|
+
...A,
|
|
945
977
|
maxSymbols: 100
|
|
946
978
|
// пример значения
|
|
947
|
-
}) :
|
|
979
|
+
}) : y === "input" ? l.push({
|
|
948
980
|
name: {
|
|
949
981
|
"en-US": ""
|
|
950
982
|
},
|
|
951
983
|
id: st(),
|
|
952
|
-
...
|
|
984
|
+
...A,
|
|
953
985
|
maxSymbols: 100
|
|
954
|
-
}) :
|
|
986
|
+
}) : l.push({
|
|
955
987
|
name: {
|
|
956
988
|
"en-US": `Image ${n.length + 1}`
|
|
957
989
|
},
|
|
958
990
|
id: st(),
|
|
959
|
-
...
|
|
991
|
+
...A,
|
|
960
992
|
maxSymbols: 100
|
|
961
|
-
}),
|
|
993
|
+
}), a(l);
|
|
962
994
|
},
|
|
963
995
|
style: {
|
|
964
996
|
width: "fit-content"
|
|
965
997
|
},
|
|
966
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
998
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: Y.addButton, children: [
|
|
967
999
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
968
1000
|
/* @__PURE__ */ t.jsx(
|
|
969
|
-
|
|
1001
|
+
b,
|
|
970
1002
|
{
|
|
971
1003
|
name: "Plus",
|
|
972
1004
|
width: 16,
|
|
@@ -979,120 +1011,126 @@ const Ri = (o) => {
|
|
|
979
1011
|
}
|
|
980
1012
|
)
|
|
981
1013
|
] }),
|
|
982
|
-
c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1014
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1015
|
+
ut,
|
|
1016
|
+
{
|
|
1017
|
+
otherTitle: "Other",
|
|
1018
|
+
items: c
|
|
1019
|
+
}
|
|
1020
|
+
)
|
|
983
1021
|
] });
|
|
984
|
-
},
|
|
985
|
-
subtitle:
|
|
986
|
-
header:
|
|
987
|
-
text:
|
|
988
|
-
productsBlock:
|
|
989
|
-
buttonsBlock:
|
|
990
|
-
top:
|
|
991
|
-
itemsBlock:
|
|
992
|
-
typeTexts:
|
|
993
|
-
block:
|
|
994
|
-
active:
|
|
995
|
-
products:
|
|
996
|
-
product:
|
|
997
|
-
button:
|
|
998
|
-
image:
|
|
999
|
-
info:
|
|
1000
|
-
name:
|
|
1001
|
-
buttons:
|
|
1002
|
-
modal:
|
|
1003
|
-
other:
|
|
1004
|
-
options:
|
|
1005
|
-
addButton:
|
|
1006
|
-
deleteButton:
|
|
1007
|
-
},
|
|
1008
|
-
const { buttons: s, setButtons: e, deletable: n = !0, addable:
|
|
1022
|
+
}, Ke = "_subtitle_jql1y_1", Ze = "_header_jql1y_8", tn = "_text_jql1y_9", en = "_productsBlock_jql1y_10", nn = "_buttonsBlock_jql1y_11", sn = "_top_jql1y_23", an = "_itemsBlock_jql1y_32", on = "_typeTexts_jql1y_38", cn = "_block_jql1y_45", rn = "_active_jql1y_58", ln = "_products_jql1y_10", dn = "_product_jql1y_10", un = "_button_jql1y_11", mn = "_image_jql1y_88", hn = "_info_jql1y_95", pn = "_name_jql1y_107", _n = "_buttons_jql1y_11", gn = "_modal_jql1y_118", fn = "_other_jql1y_138", xn = "_options_jql1y_144", vn = "_addButton_jql1y_150", jn = "_deleteButton_jql1y_165", tt = {
|
|
1023
|
+
subtitle: Ke,
|
|
1024
|
+
header: Ze,
|
|
1025
|
+
text: tn,
|
|
1026
|
+
productsBlock: en,
|
|
1027
|
+
buttonsBlock: nn,
|
|
1028
|
+
top: sn,
|
|
1029
|
+
itemsBlock: an,
|
|
1030
|
+
typeTexts: on,
|
|
1031
|
+
block: cn,
|
|
1032
|
+
active: rn,
|
|
1033
|
+
products: ln,
|
|
1034
|
+
product: dn,
|
|
1035
|
+
button: un,
|
|
1036
|
+
image: mn,
|
|
1037
|
+
info: hn,
|
|
1038
|
+
name: pn,
|
|
1039
|
+
buttons: _n,
|
|
1040
|
+
modal: gn,
|
|
1041
|
+
other: fn,
|
|
1042
|
+
options: xn,
|
|
1043
|
+
addButton: vn,
|
|
1044
|
+
deleteButton: jn
|
|
1045
|
+
}, bn = (o) => {
|
|
1046
|
+
const { buttons: s, setButtons: e, deletable: n = !0, addable: a = !0, editableLink: c = !0 } = o, { pages: u } = lt(), [r, m] = f.useState(null), [_, B] = f.useState({
|
|
1009
1047
|
top: 0,
|
|
1010
1048
|
left: 0
|
|
1011
|
-
}), [
|
|
1012
|
-
|
|
1049
|
+
}), [h, i] = f.useState(null), y = f.useRef(null);
|
|
1050
|
+
f.useEffect(() => {
|
|
1013
1051
|
if (r) {
|
|
1014
|
-
const
|
|
1015
|
-
e(
|
|
1052
|
+
const v = [...s].map((N) => N.id === r.id ? r : N);
|
|
1053
|
+
e(v);
|
|
1016
1054
|
}
|
|
1017
|
-
}, [r]),
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
let
|
|
1021
|
-
|
|
1022
|
-
top:
|
|
1023
|
-
left:
|
|
1055
|
+
}, [r]), f.useEffect(() => {
|
|
1056
|
+
if (y.current && h) {
|
|
1057
|
+
const v = y.current.getBoundingClientRect().height, N = window.innerHeight;
|
|
1058
|
+
let I = h.top;
|
|
1059
|
+
I + v > N + window.scrollY - 200 && (I = N + window.scrollY - v - 200), I < 0 && (I = 10), B({
|
|
1060
|
+
top: I,
|
|
1061
|
+
left: h.left
|
|
1024
1062
|
});
|
|
1025
1063
|
}
|
|
1026
|
-
}, [
|
|
1027
|
-
const d = (
|
|
1028
|
-
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
top:
|
|
1032
|
-
left:
|
|
1033
|
-
}), m(
|
|
1034
|
-
},
|
|
1035
|
-
const
|
|
1036
|
-
...
|
|
1064
|
+
}, [y.current, h]);
|
|
1065
|
+
const d = (v, N) => {
|
|
1066
|
+
v.stopPropagation();
|
|
1067
|
+
const I = v.target.getBoundingClientRect();
|
|
1068
|
+
i({
|
|
1069
|
+
top: I.top + window.scrollY - 70,
|
|
1070
|
+
left: I.left - (a ? 30 : 65)
|
|
1071
|
+
}), m(N);
|
|
1072
|
+
}, C = (v, N) => {
|
|
1073
|
+
const I = [...s], A = {
|
|
1074
|
+
...v,
|
|
1037
1075
|
id: Math.random().toString(36).substr(2, 9)
|
|
1038
1076
|
// Генерируем новый уникальный ID
|
|
1039
1077
|
};
|
|
1040
|
-
|
|
1078
|
+
I.splice(N + 1, 0, A), e(I);
|
|
1041
1079
|
};
|
|
1042
1080
|
return /* @__PURE__ */ t.jsxs("div", { className: tt.products, children: [
|
|
1043
1081
|
/* @__PURE__ */ t.jsx("h5", { className: tt.subtitle, children: "Button Type" }),
|
|
1044
|
-
s.map((
|
|
1082
|
+
s.map((v, N) => /* @__PURE__ */ t.jsxs(
|
|
1045
1083
|
"div",
|
|
1046
1084
|
{
|
|
1047
1085
|
className: tt.product,
|
|
1048
1086
|
children: [
|
|
1049
1087
|
/* @__PURE__ */ t.jsx(
|
|
1050
|
-
|
|
1088
|
+
it,
|
|
1051
1089
|
{
|
|
1052
|
-
onChange: (
|
|
1053
|
-
const
|
|
1054
|
-
...
|
|
1055
|
-
type:
|
|
1056
|
-
} :
|
|
1057
|
-
e(
|
|
1090
|
+
onChange: (I) => {
|
|
1091
|
+
const x = [...s].map((D) => D.id === v.id ? {
|
|
1092
|
+
...v,
|
|
1093
|
+
type: I
|
|
1094
|
+
} : D);
|
|
1095
|
+
e(x);
|
|
1058
1096
|
},
|
|
1059
|
-
value:
|
|
1097
|
+
value: v.type,
|
|
1060
1098
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
1061
1099
|
}
|
|
1062
1100
|
),
|
|
1063
1101
|
/* @__PURE__ */ t.jsxs("div", { className: tt.buttons, children: [
|
|
1064
1102
|
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1065
|
-
|
|
1103
|
+
b,
|
|
1066
1104
|
{
|
|
1067
1105
|
name: "Copy",
|
|
1068
1106
|
hoverable: !0,
|
|
1069
1107
|
width: 20,
|
|
1070
1108
|
height: 20,
|
|
1071
1109
|
onClick: () => {
|
|
1072
|
-
|
|
1110
|
+
C(v, N);
|
|
1073
1111
|
}
|
|
1074
1112
|
}
|
|
1075
1113
|
) }),
|
|
1076
1114
|
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1077
|
-
|
|
1115
|
+
b,
|
|
1078
1116
|
{
|
|
1079
1117
|
name: "Sliders",
|
|
1080
1118
|
hoverable: !0,
|
|
1081
1119
|
width: 20,
|
|
1082
1120
|
height: 20,
|
|
1083
|
-
onClick: (
|
|
1084
|
-
d(
|
|
1121
|
+
onClick: (I) => {
|
|
1122
|
+
d(I, v);
|
|
1085
1123
|
}
|
|
1086
1124
|
}
|
|
1087
1125
|
) }),
|
|
1088
1126
|
n && /* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1089
|
-
|
|
1127
|
+
b,
|
|
1090
1128
|
{
|
|
1091
1129
|
name: "Trash",
|
|
1092
1130
|
hoverable: !0,
|
|
1093
1131
|
onClick: () => {
|
|
1094
|
-
const
|
|
1095
|
-
e(
|
|
1132
|
+
const I = s.filter((A) => A.id !== v.id);
|
|
1133
|
+
e(I);
|
|
1096
1134
|
},
|
|
1097
1135
|
width: 20,
|
|
1098
1136
|
height: 20,
|
|
@@ -1102,19 +1140,19 @@ const Ri = (o) => {
|
|
|
1102
1140
|
] })
|
|
1103
1141
|
]
|
|
1104
1142
|
},
|
|
1105
|
-
|
|
1143
|
+
v.id
|
|
1106
1144
|
)),
|
|
1107
1145
|
r && /* @__PURE__ */ t.jsx(
|
|
1108
|
-
|
|
1146
|
+
Ot,
|
|
1109
1147
|
{
|
|
1110
|
-
ref:
|
|
1148
|
+
ref: y,
|
|
1111
1149
|
activeButton: r,
|
|
1112
1150
|
setActiveButton: m,
|
|
1113
|
-
popupPosition:
|
|
1151
|
+
popupPosition: _,
|
|
1114
1152
|
editableLink: c
|
|
1115
1153
|
}
|
|
1116
1154
|
),
|
|
1117
|
-
|
|
1155
|
+
a && /* @__PURE__ */ t.jsx(
|
|
1118
1156
|
"div",
|
|
1119
1157
|
{
|
|
1120
1158
|
style: {
|
|
@@ -1123,14 +1161,14 @@ const Ri = (o) => {
|
|
|
1123
1161
|
justifyContent: "center"
|
|
1124
1162
|
},
|
|
1125
1163
|
children: /* @__PURE__ */ t.jsx(
|
|
1126
|
-
|
|
1164
|
+
rt,
|
|
1127
1165
|
{
|
|
1128
1166
|
withoutHover: !0,
|
|
1129
1167
|
className: tt.button,
|
|
1130
1168
|
size: "s",
|
|
1131
1169
|
onClick: () => {
|
|
1132
|
-
const
|
|
1133
|
-
c ?
|
|
1170
|
+
const v = [...s];
|
|
1171
|
+
c ? v.push({
|
|
1134
1172
|
type: "Primary",
|
|
1135
1173
|
id: st(),
|
|
1136
1174
|
typesText: [],
|
|
@@ -1140,7 +1178,7 @@ const Ri = (o) => {
|
|
|
1140
1178
|
destination: "Go to Page",
|
|
1141
1179
|
page: u ? Object.values(u)[0].path : "/",
|
|
1142
1180
|
openInNewTab: !1
|
|
1143
|
-
}) :
|
|
1181
|
+
}) : v.push({
|
|
1144
1182
|
type: "Primary",
|
|
1145
1183
|
id: st(),
|
|
1146
1184
|
typesText: [],
|
|
@@ -1150,7 +1188,7 @@ const Ri = (o) => {
|
|
|
1150
1188
|
destination: "Go to Page",
|
|
1151
1189
|
page: u ? Object.values(u)[0].path : "/",
|
|
1152
1190
|
openInNewTab: !1
|
|
1153
|
-
}), e(
|
|
1191
|
+
}), e(v);
|
|
1154
1192
|
},
|
|
1155
1193
|
style: {
|
|
1156
1194
|
width: "fit-content"
|
|
@@ -1158,7 +1196,7 @@ const Ri = (o) => {
|
|
|
1158
1196
|
children: /* @__PURE__ */ t.jsxs("div", { className: tt.addButton, children: [
|
|
1159
1197
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1160
1198
|
/* @__PURE__ */ t.jsx(
|
|
1161
|
-
|
|
1199
|
+
b,
|
|
1162
1200
|
{
|
|
1163
1201
|
name: "Plus",
|
|
1164
1202
|
width: 16,
|
|
@@ -1171,21 +1209,21 @@ const Ri = (o) => {
|
|
|
1171
1209
|
}
|
|
1172
1210
|
)
|
|
1173
1211
|
] });
|
|
1174
|
-
},
|
|
1212
|
+
}, zi = (o) => {
|
|
1175
1213
|
const {
|
|
1176
1214
|
isActiveButtons: s,
|
|
1177
1215
|
setIsActiveButtons: e,
|
|
1178
1216
|
buttons: n,
|
|
1179
|
-
setButtons:
|
|
1217
|
+
setButtons: a,
|
|
1180
1218
|
editableLink: c = !0,
|
|
1181
1219
|
addable: u = !0,
|
|
1182
1220
|
deletable: r = !0
|
|
1183
1221
|
} = o;
|
|
1184
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1185
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1186
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
1222
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: bt.buttonsBlock, children: [
|
|
1223
|
+
/* @__PURE__ */ t.jsxs("div", { className: bt.top, children: [
|
|
1224
|
+
/* @__PURE__ */ t.jsx("h3", { className: bt.title, children: "Buttons" }),
|
|
1187
1225
|
/* @__PURE__ */ t.jsx(
|
|
1188
|
-
|
|
1226
|
+
ct,
|
|
1189
1227
|
{
|
|
1190
1228
|
current: s,
|
|
1191
1229
|
onChange: (m) => e(m)
|
|
@@ -1193,10 +1231,10 @@ const Ri = (o) => {
|
|
|
1193
1231
|
)
|
|
1194
1232
|
] }),
|
|
1195
1233
|
s && /* @__PURE__ */ t.jsx(
|
|
1196
|
-
|
|
1234
|
+
bn,
|
|
1197
1235
|
{
|
|
1198
1236
|
buttons: n,
|
|
1199
|
-
setButtons:
|
|
1237
|
+
setButtons: a,
|
|
1200
1238
|
editableLink: c,
|
|
1201
1239
|
addable: u,
|
|
1202
1240
|
deletable: r
|
|
@@ -1204,88 +1242,90 @@ const Ri = (o) => {
|
|
|
1204
1242
|
)
|
|
1205
1243
|
] }) });
|
|
1206
1244
|
};
|
|
1207
|
-
function
|
|
1208
|
-
const { product: s, children: e } = o, { attributes: n, listeners:
|
|
1245
|
+
function yn(o) {
|
|
1246
|
+
const { product: s, children: e } = o, { attributes: n, listeners: a, setNodeRef: c, transform: u, transition: r, isDragging: m } = xt({
|
|
1209
1247
|
id: String(s.listingId)
|
|
1210
|
-
}),
|
|
1211
|
-
transform:
|
|
1248
|
+
}), _ = {
|
|
1249
|
+
transform: vt.Transform.toString(u),
|
|
1212
1250
|
transition: r
|
|
1213
1251
|
};
|
|
1214
1252
|
return /* @__PURE__ */ t.jsx(
|
|
1215
1253
|
"div",
|
|
1216
1254
|
{
|
|
1217
1255
|
ref: c,
|
|
1218
|
-
style:
|
|
1219
|
-
className: `${
|
|
1256
|
+
style: _,
|
|
1257
|
+
className: `${Q.product} ${m ? Q.dragging : ""}`,
|
|
1220
1258
|
...n,
|
|
1221
|
-
...
|
|
1259
|
+
...a,
|
|
1222
1260
|
children: e
|
|
1223
1261
|
}
|
|
1224
1262
|
);
|
|
1225
1263
|
}
|
|
1226
|
-
const
|
|
1264
|
+
const Fi = (o) => {
|
|
1227
1265
|
const {
|
|
1228
1266
|
isActiveItems: s,
|
|
1229
1267
|
setIsActiveItems: e,
|
|
1230
1268
|
items: n,
|
|
1231
|
-
setItems:
|
|
1269
|
+
setItems: a,
|
|
1232
1270
|
other: c,
|
|
1233
1271
|
title: u,
|
|
1234
1272
|
subtitle: r,
|
|
1235
1273
|
editable: m = !0,
|
|
1236
|
-
draggable:
|
|
1274
|
+
draggable: _ = !1,
|
|
1237
1275
|
withImage: B = !1,
|
|
1238
|
-
deletable:
|
|
1239
|
-
addable:
|
|
1240
|
-
itemsType:
|
|
1276
|
+
deletable: h = !0,
|
|
1277
|
+
addable: i = !0,
|
|
1278
|
+
itemsType: y,
|
|
1241
1279
|
itemsOptions: d,
|
|
1242
|
-
limit:
|
|
1243
|
-
|
|
1280
|
+
limit: C,
|
|
1281
|
+
aspectRatio: v,
|
|
1282
|
+
setAspectRatio: N
|
|
1283
|
+
} = o, [I, A] = f.useState(
|
|
1244
1284
|
null
|
|
1245
|
-
), [
|
|
1285
|
+
), [x, D] = f.useState({
|
|
1246
1286
|
top: 0,
|
|
1247
1287
|
left: 0
|
|
1248
|
-
}), [
|
|
1249
|
-
|
|
1288
|
+
}), [z, H] = f.useState(!1), p = mt(
|
|
1289
|
+
ht(pt, {
|
|
1250
1290
|
activationConstraint: {
|
|
1251
1291
|
distance: 5
|
|
1252
1292
|
}
|
|
1253
1293
|
})
|
|
1254
1294
|
);
|
|
1255
|
-
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1295
|
+
f.useEffect(() => {
|
|
1296
|
+
const j = () => {
|
|
1297
|
+
A(null), H(!1);
|
|
1258
1298
|
};
|
|
1259
|
-
return document.body.addEventListener("click",
|
|
1260
|
-
|
|
1299
|
+
return document.body.addEventListener("click", j), A(null), H(!1), () => {
|
|
1300
|
+
A(null), H(!1), document.body.removeEventListener("click", j);
|
|
1261
1301
|
};
|
|
1262
|
-
}, []),
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1302
|
+
}, []), f.useEffect(() => {
|
|
1303
|
+
if (I) {
|
|
1304
|
+
const j = [...n].map((M) => M.listingId === I.listingId ? I : M);
|
|
1305
|
+
a(j);
|
|
1266
1306
|
}
|
|
1267
|
-
}, [
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1271
|
-
let
|
|
1272
|
-
|
|
1273
|
-
top:
|
|
1274
|
-
left:
|
|
1275
|
-
}),
|
|
1307
|
+
}, [I]);
|
|
1308
|
+
const g = (j, M) => {
|
|
1309
|
+
j.stopPropagation();
|
|
1310
|
+
const V = j.target.getBoundingClientRect(), T = 100, U = window.innerHeight;
|
|
1311
|
+
let l = V.top + window.scrollY;
|
|
1312
|
+
l + T > U && (l = U - T - 20), H(!0), D({
|
|
1313
|
+
top: l - 80,
|
|
1314
|
+
left: V.left - 30
|
|
1315
|
+
}), A(M);
|
|
1276
1316
|
};
|
|
1277
|
-
function
|
|
1317
|
+
function w(j) {
|
|
1278
1318
|
if (B)
|
|
1279
|
-
return
|
|
1319
|
+
return j ? /* @__PURE__ */ t.jsx(
|
|
1280
1320
|
"img",
|
|
1281
1321
|
{
|
|
1282
|
-
src: `https://imagedelivery.net/${
|
|
1322
|
+
src: `https://imagedelivery.net/${j}/w=1000`,
|
|
1283
1323
|
alt: "image",
|
|
1284
1324
|
width: 16,
|
|
1285
1325
|
height: 16
|
|
1286
1326
|
}
|
|
1287
1327
|
) : /* @__PURE__ */ t.jsx(
|
|
1288
|
-
|
|
1328
|
+
b,
|
|
1289
1329
|
{
|
|
1290
1330
|
name: "Image",
|
|
1291
1331
|
width: 16,
|
|
@@ -1294,21 +1334,21 @@ const zi = (o) => {
|
|
|
1294
1334
|
}
|
|
1295
1335
|
);
|
|
1296
1336
|
}
|
|
1297
|
-
const
|
|
1298
|
-
const { active:
|
|
1299
|
-
if (
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1337
|
+
const S = (j) => {
|
|
1338
|
+
const { active: M, over: V } = j;
|
|
1339
|
+
if (V && M.id !== V.id) {
|
|
1340
|
+
const T = n.findIndex((l) => String(l.listingId) === M.id), U = n.findIndex((l) => String(l.listingId) === V.id);
|
|
1341
|
+
if (T !== -1 && U !== -1) {
|
|
1342
|
+
const l = [...n], [E] = l.splice(T, 1);
|
|
1343
|
+
l.splice(U, 0, E), a(l);
|
|
1304
1344
|
}
|
|
1305
1345
|
}
|
|
1306
|
-
},
|
|
1307
|
-
const
|
|
1308
|
-
if (!
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1346
|
+
}, P = (j) => {
|
|
1347
|
+
const M = d.find((T) => j.listingId === T.id);
|
|
1348
|
+
if (!M) return null;
|
|
1349
|
+
const V = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1350
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1351
|
+
b,
|
|
1312
1352
|
{
|
|
1313
1353
|
name: "DotsSixVertical",
|
|
1314
1354
|
hoverable: !0,
|
|
@@ -1316,108 +1356,111 @@ const zi = (o) => {
|
|
|
1316
1356
|
height: 20
|
|
1317
1357
|
}
|
|
1318
1358
|
) }),
|
|
1319
|
-
|
|
1320
|
-
|
|
1359
|
+
y === "select" && /* @__PURE__ */ t.jsx(
|
|
1360
|
+
it,
|
|
1321
1361
|
{
|
|
1322
|
-
onChange: (
|
|
1323
|
-
const
|
|
1324
|
-
if (!
|
|
1325
|
-
const
|
|
1326
|
-
listingId:
|
|
1327
|
-
image:
|
|
1328
|
-
}, R =
|
|
1329
|
-
|
|
1362
|
+
onChange: (T) => {
|
|
1363
|
+
const U = [...n], l = d.find((O) => O.productData.name === T);
|
|
1364
|
+
if (!l) return;
|
|
1365
|
+
const E = {
|
|
1366
|
+
listingId: l.id,
|
|
1367
|
+
image: l.productData.images.length > 0 ? l.productData.images[0].cfId : ""
|
|
1368
|
+
}, R = U.map((O) => O.listingId === j.listingId ? E : O);
|
|
1369
|
+
A(E), a([...R]);
|
|
1330
1370
|
},
|
|
1331
|
-
value:
|
|
1371
|
+
value: M.productData.name,
|
|
1332
1372
|
options: [
|
|
1333
|
-
...d.filter((
|
|
1373
|
+
...d.filter((T) => !n.find((U) => U.listingId === T.id)).map((T) => T.productData.name)
|
|
1334
1374
|
],
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1375
|
+
leftAddonOptions: d.map((T) => {
|
|
1376
|
+
var U;
|
|
1377
|
+
return {
|
|
1378
|
+
value: T.productData.name,
|
|
1379
|
+
addon: w(((U = T.productData.images[0]) == null ? void 0 : U.cfId) || "")
|
|
1380
|
+
};
|
|
1381
|
+
})
|
|
1382
|
+
}
|
|
1340
1383
|
),
|
|
1341
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1342
|
-
m && /* @__PURE__ */ t.jsx("div", { className:
|
|
1343
|
-
|
|
1384
|
+
/* @__PURE__ */ t.jsxs("div", { className: Q.buttons, children: [
|
|
1385
|
+
m && /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1386
|
+
b,
|
|
1344
1387
|
{
|
|
1345
1388
|
name: "Sliders",
|
|
1346
1389
|
hoverable: !0,
|
|
1347
1390
|
width: 20,
|
|
1348
1391
|
height: 20,
|
|
1349
|
-
onClick: (
|
|
1392
|
+
onClick: (T) => g(T, j)
|
|
1350
1393
|
}
|
|
1351
1394
|
) }),
|
|
1352
|
-
|
|
1353
|
-
|
|
1395
|
+
h && /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1396
|
+
b,
|
|
1354
1397
|
{
|
|
1355
1398
|
name: "Trash",
|
|
1356
1399
|
hoverable: !0,
|
|
1357
1400
|
width: 20,
|
|
1358
1401
|
height: 20,
|
|
1359
1402
|
fill: "#C12A2A",
|
|
1360
|
-
onClick: () =>
|
|
1403
|
+
onClick: () => a(n.filter((T) => T !== j))
|
|
1361
1404
|
}
|
|
1362
1405
|
) })
|
|
1363
1406
|
] })
|
|
1364
1407
|
] });
|
|
1365
|
-
return
|
|
1366
|
-
|
|
1408
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
1409
|
+
yn,
|
|
1367
1410
|
{
|
|
1368
|
-
product:
|
|
1369
|
-
children:
|
|
1411
|
+
product: j,
|
|
1412
|
+
children: V
|
|
1370
1413
|
},
|
|
1371
|
-
|
|
1414
|
+
j.listingId
|
|
1372
1415
|
) : /* @__PURE__ */ t.jsx(
|
|
1373
1416
|
"div",
|
|
1374
1417
|
{
|
|
1375
|
-
className:
|
|
1376
|
-
children:
|
|
1418
|
+
className: Q.product,
|
|
1419
|
+
children: V
|
|
1377
1420
|
},
|
|
1378
|
-
|
|
1421
|
+
j.listingId
|
|
1379
1422
|
);
|
|
1380
|
-
},
|
|
1381
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1382
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1383
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
1423
|
+
}, q = f.useRef(null);
|
|
1424
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Q.productsBlock, children: [
|
|
1425
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Q.top, children: [
|
|
1426
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: Q.title, children: u }),
|
|
1384
1427
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1385
|
-
|
|
1428
|
+
ct,
|
|
1386
1429
|
{
|
|
1387
1430
|
current: s,
|
|
1388
|
-
onChange: (
|
|
1431
|
+
onChange: (j) => e == null ? void 0 : e(j)
|
|
1389
1432
|
}
|
|
1390
1433
|
)
|
|
1391
1434
|
] }),
|
|
1392
|
-
|
|
1393
|
-
|
|
1435
|
+
z && I && /* @__PURE__ */ t.jsx(
|
|
1436
|
+
Et,
|
|
1394
1437
|
{
|
|
1395
|
-
ref:
|
|
1396
|
-
activeItem:
|
|
1397
|
-
setActiveItem:
|
|
1398
|
-
setIsOpenModal:
|
|
1399
|
-
popupPosition:
|
|
1438
|
+
ref: q,
|
|
1439
|
+
activeItem: I,
|
|
1440
|
+
setActiveItem: A,
|
|
1441
|
+
setIsOpenModal: H,
|
|
1442
|
+
popupPosition: x,
|
|
1400
1443
|
itemsOptions: d
|
|
1401
1444
|
}
|
|
1402
1445
|
),
|
|
1403
|
-
s && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1404
|
-
r && /* @__PURE__ */ t.jsx("h5", { className:
|
|
1405
|
-
|
|
1406
|
-
|
|
1446
|
+
s && /* @__PURE__ */ t.jsxs("div", { className: Q.products, children: [
|
|
1447
|
+
r && /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: r }),
|
|
1448
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
1449
|
+
_t,
|
|
1407
1450
|
{
|
|
1408
|
-
sensors:
|
|
1409
|
-
onDragEnd:
|
|
1451
|
+
sensors: p,
|
|
1452
|
+
onDragEnd: S,
|
|
1410
1453
|
children: /* @__PURE__ */ t.jsx(
|
|
1411
|
-
|
|
1454
|
+
gt,
|
|
1412
1455
|
{
|
|
1413
|
-
items: n.map((
|
|
1414
|
-
strategy:
|
|
1415
|
-
children: n.map((
|
|
1456
|
+
items: n.map((j) => String(j.listingId)),
|
|
1457
|
+
strategy: ft,
|
|
1458
|
+
children: n.map((j) => P(j))
|
|
1416
1459
|
}
|
|
1417
1460
|
)
|
|
1418
1461
|
}
|
|
1419
|
-
) : n.map((
|
|
1420
|
-
|
|
1462
|
+
) : n.map((j) => P(j)),
|
|
1463
|
+
i && /* @__PURE__ */ t.jsx(
|
|
1421
1464
|
"div",
|
|
1422
1465
|
{
|
|
1423
1466
|
style: {
|
|
@@ -1426,31 +1469,31 @@ const zi = (o) => {
|
|
|
1426
1469
|
justifyContent: "center"
|
|
1427
1470
|
},
|
|
1428
1471
|
children: /* @__PURE__ */ t.jsx(
|
|
1429
|
-
|
|
1472
|
+
rt,
|
|
1430
1473
|
{
|
|
1431
1474
|
withoutHover: !0,
|
|
1432
|
-
className:
|
|
1475
|
+
className: Q.button,
|
|
1433
1476
|
size: "s",
|
|
1434
1477
|
onClick: () => {
|
|
1435
|
-
const
|
|
1436
|
-
for (let
|
|
1437
|
-
if (!n.find((
|
|
1438
|
-
|
|
1439
|
-
listingId: d[
|
|
1440
|
-
image: d[
|
|
1478
|
+
const j = [...n];
|
|
1479
|
+
for (let M = 0; M < d.length; M++)
|
|
1480
|
+
if (!n.find((V) => V.listingId === d[M].id)) {
|
|
1481
|
+
j.push({
|
|
1482
|
+
listingId: d[M].id,
|
|
1483
|
+
image: d[M].productData.images.length > 0 ? d[M].productData.images[0].cfId : ""
|
|
1441
1484
|
});
|
|
1442
1485
|
break;
|
|
1443
1486
|
}
|
|
1444
|
-
|
|
1487
|
+
a(j);
|
|
1445
1488
|
},
|
|
1446
|
-
disabled: n.length === (
|
|
1489
|
+
disabled: n.length === (C || d.length),
|
|
1447
1490
|
style: {
|
|
1448
1491
|
width: "fit-content"
|
|
1449
1492
|
},
|
|
1450
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1493
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: Q.addButton, children: [
|
|
1451
1494
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1452
1495
|
/* @__PURE__ */ t.jsx(
|
|
1453
|
-
|
|
1496
|
+
b,
|
|
1454
1497
|
{
|
|
1455
1498
|
name: "Plus",
|
|
1456
1499
|
width: 16,
|
|
@@ -1463,154 +1506,169 @@ const zi = (o) => {
|
|
|
1463
1506
|
}
|
|
1464
1507
|
)
|
|
1465
1508
|
] }),
|
|
1466
|
-
|
|
1509
|
+
v && N && /* @__PURE__ */ t.jsx(
|
|
1510
|
+
it,
|
|
1511
|
+
{
|
|
1512
|
+
value: v,
|
|
1513
|
+
options: Object.keys($t),
|
|
1514
|
+
onChange: (j) => N(j),
|
|
1515
|
+
leftAddonOptions: wt
|
|
1516
|
+
}
|
|
1517
|
+
),
|
|
1518
|
+
s && c !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1519
|
+
ut,
|
|
1520
|
+
{
|
|
1521
|
+
otherTitle: "Other",
|
|
1522
|
+
items: c
|
|
1523
|
+
}
|
|
1524
|
+
)
|
|
1467
1525
|
] });
|
|
1468
|
-
},
|
|
1469
|
-
options:
|
|
1470
|
-
price:
|
|
1471
|
-
oldPrice:
|
|
1472
|
-
newPrice:
|
|
1473
|
-
animate:
|
|
1474
|
-
appearAndBounce:
|
|
1475
|
-
meta:
|
|
1476
|
-
info:
|
|
1477
|
-
infoRight:
|
|
1478
|
-
buttons:
|
|
1479
|
-
variants:
|
|
1480
|
-
variant:
|
|
1481
|
-
stock:
|
|
1482
|
-
variantInfo:
|
|
1483
|
-
quantity:
|
|
1484
|
-
count:
|
|
1485
|
-
focused:
|
|
1486
|
-
button:
|
|
1487
|
-
activeVariant:
|
|
1488
|
-
chargeTypes:
|
|
1489
|
-
charge:
|
|
1490
|
-
chargeActive:
|
|
1491
|
-
title:
|
|
1526
|
+
}, In = "_options_1vlf9_1", Nn = "_price_1vlf9_13", kn = "_oldPrice_1vlf9_20", Cn = "_newPrice_1vlf9_28", Sn = "_animate_1vlf9_35", $n = "_appearAndBounce_1vlf9_1", wn = "_meta_1vlf9_53", qn = "_info_1vlf9_59", Bn = "_infoRight_1vlf9_67", Pn = "_buttons_1vlf9_74", Tn = "_variants_1vlf9_81", Mn = "_variant_1vlf9_81", An = "_stock_1vlf9_99", On = "_variantInfo_1vlf9_106", En = "_quantity_1vlf9_112", Rn = "_count_1vlf9_119", Dn = "_focused_1vlf9_136", Ln = "_button_1vlf9_74", zn = "_activeVariant_1vlf9_162", Fn = "_chargeTypes_1vlf9_166", Vn = "_charge_1vlf9_166", Un = "_chargeActive_1vlf9_191", Hn = "_title_1vlf9_199", $ = {
|
|
1527
|
+
options: In,
|
|
1528
|
+
price: Nn,
|
|
1529
|
+
oldPrice: kn,
|
|
1530
|
+
newPrice: Cn,
|
|
1531
|
+
animate: Sn,
|
|
1532
|
+
appearAndBounce: $n,
|
|
1533
|
+
meta: wn,
|
|
1534
|
+
info: qn,
|
|
1535
|
+
infoRight: Bn,
|
|
1536
|
+
buttons: Pn,
|
|
1537
|
+
variants: Tn,
|
|
1538
|
+
variant: Mn,
|
|
1539
|
+
stock: An,
|
|
1540
|
+
variantInfo: On,
|
|
1541
|
+
quantity: En,
|
|
1542
|
+
count: Rn,
|
|
1543
|
+
focused: Dn,
|
|
1544
|
+
button: Ln,
|
|
1545
|
+
activeVariant: zn,
|
|
1546
|
+
chargeTypes: Fn,
|
|
1547
|
+
charge: Vn,
|
|
1548
|
+
chargeActive: Un,
|
|
1549
|
+
title: Hn
|
|
1492
1550
|
};
|
|
1493
1551
|
var Ct = /* @__PURE__ */ ((o) => (o.ONE_TIME = "One-Time", o.RECURRING = "Subscribe & Save", o))(Ct || {});
|
|
1494
|
-
const
|
|
1495
|
-
var
|
|
1496
|
-
const { variants: s } = o, [e, n] =
|
|
1552
|
+
const Yn = (o) => {
|
|
1553
|
+
var I, A;
|
|
1554
|
+
const { variants: s } = o, [e, n] = f.useState(s[0]), [a, c] = f.useState(
|
|
1497
1555
|
e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
|
|
1498
|
-
), u =
|
|
1499
|
-
console.log(B),
|
|
1556
|
+
), u = jt(), [r, m] = f.useState(1), { products: _, cart: B, reset: h, addProductToCart: i } = dt(), [y, d] = f.useState(!1);
|
|
1557
|
+
console.log(B), f.useEffect(() => {
|
|
1500
1558
|
d(!0);
|
|
1501
|
-
const
|
|
1502
|
-
return () => clearTimeout(
|
|
1559
|
+
const x = setTimeout(() => d(!1), 600);
|
|
1560
|
+
return () => clearTimeout(x);
|
|
1503
1561
|
}, [r]);
|
|
1504
|
-
async function
|
|
1505
|
-
console.log("Products P",
|
|
1562
|
+
async function C() {
|
|
1563
|
+
console.log("Products P", _), await i({
|
|
1506
1564
|
productId: o.id,
|
|
1507
1565
|
productVariantId: e.id,
|
|
1508
1566
|
quantity: r
|
|
1509
1567
|
});
|
|
1510
1568
|
}
|
|
1511
|
-
function
|
|
1512
|
-
|
|
1569
|
+
function v() {
|
|
1570
|
+
h(), C(), u("/checkout");
|
|
1513
1571
|
}
|
|
1514
|
-
function
|
|
1515
|
-
if (
|
|
1516
|
-
const
|
|
1517
|
-
return `${
|
|
1518
|
-
} else if (
|
|
1519
|
-
const
|
|
1520
|
-
return `${
|
|
1521
|
-
} else if (
|
|
1522
|
-
const
|
|
1523
|
-
return `${
|
|
1572
|
+
function N(x) {
|
|
1573
|
+
if (x >= 864e5) {
|
|
1574
|
+
const g = Math.floor(x / 864e5);
|
|
1575
|
+
return `${g} ${g === 1 ? "day" : "days"}`;
|
|
1576
|
+
} else if (x >= 36e5) {
|
|
1577
|
+
const g = Math.floor(x / 36e5);
|
|
1578
|
+
return `${g} ${g === 1 ? "hour" : "hours"}`;
|
|
1579
|
+
} else if (x >= 6e4) {
|
|
1580
|
+
const g = Math.floor(x / 6e4);
|
|
1581
|
+
return `${g} ${g === 1 ? "minute" : "minutes"}`;
|
|
1524
1582
|
} else {
|
|
1525
|
-
const
|
|
1526
|
-
return `${
|
|
1583
|
+
const g = Math.floor(x / 1e3);
|
|
1584
|
+
return `${g} ${g === 1 ? "second" : "seconds"}`;
|
|
1527
1585
|
}
|
|
1528
1586
|
}
|
|
1529
|
-
return
|
|
1587
|
+
return f.useEffect(() => {
|
|
1530
1588
|
e.quantity && e.quantity.available === 0 && m(0);
|
|
1531
|
-
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
1532
|
-
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className:
|
|
1589
|
+
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className: $.options, children: [
|
|
1590
|
+
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: $.chargeTypes, children: e.chargeTypes.map((x) => /* @__PURE__ */ t.jsx(
|
|
1533
1591
|
"div",
|
|
1534
1592
|
{
|
|
1535
|
-
className:
|
|
1536
|
-
[
|
|
1593
|
+
className: F($.charge, {
|
|
1594
|
+
[$.chargeActive]: a === x
|
|
1537
1595
|
}),
|
|
1538
|
-
onClick: () => c(
|
|
1539
|
-
children: Ct[
|
|
1596
|
+
onClick: () => c(x),
|
|
1597
|
+
children: Ct[x]
|
|
1540
1598
|
},
|
|
1541
|
-
|
|
1599
|
+
x
|
|
1542
1600
|
)) }),
|
|
1543
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1544
|
-
var
|
|
1601
|
+
/* @__PURE__ */ t.jsx("div", { className: $.variants, children: s.map((x) => {
|
|
1602
|
+
var D, z;
|
|
1545
1603
|
return /* @__PURE__ */ t.jsxs(
|
|
1546
1604
|
"div",
|
|
1547
1605
|
{
|
|
1548
|
-
className:
|
|
1549
|
-
[
|
|
1606
|
+
className: F($.variant, {
|
|
1607
|
+
[$.activeVariant]: e.id === x.id
|
|
1550
1608
|
}),
|
|
1551
|
-
onClick: () => n(
|
|
1609
|
+
onClick: () => n(x),
|
|
1552
1610
|
children: [
|
|
1553
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1554
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1611
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.variantInfo, children: [
|
|
1612
|
+
/* @__PURE__ */ t.jsx("span", { className: $.title, children: Nt(x.name) }),
|
|
1555
1613
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1556
1614
|
"$",
|
|
1557
|
-
|
|
1615
|
+
a === "ONE_TIME" ? x.price.amount : x.subscriptionSettings ? x.subscriptionSettings.price.amount : "Price Not Found"
|
|
1558
1616
|
] })
|
|
1559
1617
|
] }),
|
|
1560
|
-
/* @__PURE__ */ t.jsx("div", { children:
|
|
1561
|
-
(
|
|
1618
|
+
/* @__PURE__ */ t.jsx("div", { children: a === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: $.stock, children: [
|
|
1619
|
+
(D = x.quantity.restrictions) != null && D.max || x.quantity.available !== void 0 ? ((z = x.quantity.restrictions) == null ? void 0 : z.max) || x.quantity.available : "∞",
|
|
1562
1620
|
" ",
|
|
1563
1621
|
"in stock"
|
|
1564
1622
|
] }) })
|
|
1565
1623
|
]
|
|
1566
1624
|
},
|
|
1567
|
-
|
|
1625
|
+
x.id
|
|
1568
1626
|
);
|
|
1569
1627
|
}) }),
|
|
1570
|
-
|
|
1628
|
+
a === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: $.quantity, children: [
|
|
1571
1629
|
/* @__PURE__ */ t.jsx(
|
|
1572
|
-
|
|
1630
|
+
L,
|
|
1573
1631
|
{
|
|
1574
1632
|
type: "Secondary",
|
|
1575
1633
|
onClick: () => {
|
|
1576
|
-
r > 1 ? m((
|
|
1634
|
+
r > 1 ? m((x) => x - 1) : m(1);
|
|
1577
1635
|
},
|
|
1578
|
-
className:
|
|
1636
|
+
className: $.button,
|
|
1579
1637
|
disabled: e.quantity.available && e.quantity.restrictions && r <= e.quantity.restrictions.min || e.quantity.available === 0,
|
|
1580
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1638
|
+
children: /* @__PURE__ */ t.jsx(b, { name: "Minus" })
|
|
1581
1639
|
}
|
|
1582
1640
|
),
|
|
1583
1641
|
/* @__PURE__ */ t.jsx(
|
|
1584
|
-
|
|
1642
|
+
Rt,
|
|
1585
1643
|
{
|
|
1586
1644
|
type: "number",
|
|
1587
1645
|
value: String(r),
|
|
1588
|
-
onChange: (
|
|
1589
|
-
max: ((
|
|
1590
|
-
min: ((
|
|
1646
|
+
onChange: (x) => m(Number(x)),
|
|
1647
|
+
max: ((I = e.quantity.restrictions) == null ? void 0 : I.max) || e.quantity.available || Number.POSITIVE_INFINITY,
|
|
1648
|
+
min: ((A = e.quantity.restrictions) == null ? void 0 : A.min) || 0,
|
|
1591
1649
|
centered: !0,
|
|
1592
1650
|
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && r >= e.quantity.restrictions.max
|
|
1593
1651
|
}
|
|
1594
1652
|
),
|
|
1595
1653
|
/* @__PURE__ */ t.jsx(
|
|
1596
|
-
|
|
1654
|
+
L,
|
|
1597
1655
|
{
|
|
1598
1656
|
type: "Secondary",
|
|
1599
1657
|
onClick: () => {
|
|
1600
|
-
m((
|
|
1658
|
+
m((x) => x + 1);
|
|
1601
1659
|
},
|
|
1602
|
-
className:
|
|
1660
|
+
className: $.button,
|
|
1603
1661
|
disabled: !!(e.quantity.available && e.quantity.restrictions && r >= e.quantity.restrictions.max || e.quantity.available === 0),
|
|
1604
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1662
|
+
children: /* @__PURE__ */ t.jsx(b, { name: "Plus" })
|
|
1605
1663
|
}
|
|
1606
1664
|
)
|
|
1607
1665
|
] }),
|
|
1608
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1609
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1666
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.meta, children: [
|
|
1667
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.info, children: [
|
|
1610
1668
|
/* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
|
|
1611
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1669
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.infoRight, children: [
|
|
1612
1670
|
/* @__PURE__ */ t.jsx(
|
|
1613
|
-
|
|
1671
|
+
b,
|
|
1614
1672
|
{
|
|
1615
1673
|
name: "Lightning",
|
|
1616
1674
|
fill: "#FF3F19",
|
|
@@ -1618,159 +1676,159 @@ const Un = (o) => {
|
|
|
1618
1676
|
height: 20
|
|
1619
1677
|
}
|
|
1620
1678
|
),
|
|
1621
|
-
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" :
|
|
1679
|
+
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : N(e.deliveryTime) })
|
|
1622
1680
|
] })
|
|
1623
1681
|
] }),
|
|
1624
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1682
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.info, children: [
|
|
1625
1683
|
/* @__PURE__ */ t.jsx("span", { children: "Price" }),
|
|
1626
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1627
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1684
|
+
/* @__PURE__ */ t.jsx("div", { className: $.infoRight, children: a === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: $.price, children: [
|
|
1685
|
+
/* @__PURE__ */ t.jsxs("span", { className: F($.newPrice, { [$.animate]: y }), children: [
|
|
1628
1686
|
"$ ",
|
|
1629
1687
|
(e.price.amount || 0) * r
|
|
1630
1688
|
] }),
|
|
1631
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1689
|
+
/* @__PURE__ */ t.jsxs("span", { className: $.oldPrice, children: [
|
|
1632
1690
|
"$ ",
|
|
1633
1691
|
(e.compareAtPrice.amount || 0) * r
|
|
1634
1692
|
] })
|
|
1635
|
-
] }) : /* @__PURE__ */ t.jsxs("span", { className:
|
|
1693
|
+
] }) : /* @__PURE__ */ t.jsxs("span", { className: F($.newPrice, { [$.animate]: y }), children: [
|
|
1636
1694
|
"$ ",
|
|
1637
1695
|
(e.price.amount || 0) * r
|
|
1638
|
-
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1639
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1696
|
+
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: $.price, children: [
|
|
1697
|
+
/* @__PURE__ */ t.jsxs("span", { className: F($.newPrice, { [$.animate]: y }), children: [
|
|
1640
1698
|
"$ ",
|
|
1641
1699
|
e.subscriptionSettings.price.amount || 0
|
|
1642
1700
|
] }),
|
|
1643
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1701
|
+
/* @__PURE__ */ t.jsxs("span", { className: $.oldPrice, children: [
|
|
1644
1702
|
"$ ",
|
|
1645
1703
|
e.subscriptionSettings.compareAtPrice.amount || 0
|
|
1646
1704
|
] })
|
|
1647
|
-
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className:
|
|
1705
|
+
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: F($.newPrice, { [$.animate]: y }), children: [
|
|
1648
1706
|
"$ ",
|
|
1649
1707
|
e.subscriptionSettings.price.amount || 0
|
|
1650
1708
|
] }) })
|
|
1651
1709
|
] })
|
|
1652
1710
|
] }),
|
|
1653
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1711
|
+
/* @__PURE__ */ t.jsxs("div", { className: $.buttons, children: [
|
|
1654
1712
|
/* @__PURE__ */ t.jsx(
|
|
1655
|
-
|
|
1713
|
+
L,
|
|
1656
1714
|
{
|
|
1657
1715
|
type: "Primary",
|
|
1658
|
-
onClick: () =>
|
|
1716
|
+
onClick: () => v(),
|
|
1659
1717
|
disabled: e.quantity && e.quantity.available === 0,
|
|
1660
|
-
children:
|
|
1718
|
+
children: a === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
|
|
1661
1719
|
}
|
|
1662
1720
|
),
|
|
1663
|
-
|
|
1664
|
-
|
|
1721
|
+
a === "ONE_TIME" && /* @__PURE__ */ t.jsx(
|
|
1722
|
+
L,
|
|
1665
1723
|
{
|
|
1666
1724
|
type: "Secondary",
|
|
1667
|
-
onClick: () =>
|
|
1725
|
+
onClick: () => C(),
|
|
1668
1726
|
disabled: e.quantity && e.quantity.available === 0,
|
|
1669
1727
|
children: "Add to Cart"
|
|
1670
1728
|
}
|
|
1671
1729
|
)
|
|
1672
1730
|
] })
|
|
1673
1731
|
] });
|
|
1674
|
-
},
|
|
1675
|
-
button:
|
|
1676
|
-
login:
|
|
1677
|
-
signUp:
|
|
1678
|
-
buttons:
|
|
1679
|
-
modal:
|
|
1732
|
+
}, Wn = "_button_14q75_1", Gn = "_login_14q75_14", Qn = "_signUp_14q75_18", Xn = "_buttons_14q75_23", Jn = "_modal_14q75_32", Kn = "_closing_14q75_64", Zn = "_info_14q75_113", ts = "_top_14q75_120", es = "_title_14q75_131", ns = "_clear_14q75_138", ss = "_activeClear_14q75_145", is = "_count_14q75_149", as = "_cart_14q75_164", os = "_empty_14q75_172", cs = "_product_14q75_198", rs = "_products_14q75_207", ls = "_image_14q75_215", ds = "_productInfo_14q75_230", us = "_content_14q75_237", ms = "_name_14q75_243", hs = "_price_14q75_249", ps = "_productButtons_14q75_255", _s = "_productButton_14q75_255", gs = "_productCount_14q75_272", fs = "_bottom_14q75_289", xs = "_subtotal_14q75_297", vs = "_block_14q75_305", js = "_shoppingCount_14q75_312", bs = "_total_14q75_332", ys = "_link_14q75_338", Is = "_userInfo_14q75_345", Ns = "_pagesMobileModal_14q75_356", ks = "_pagesMobileModalContent_14q75_370", Cs = "_pagesMobileModalHeader_14q75_376", Ss = "_pagesMobileModalFooter_14q75_386", k = {
|
|
1733
|
+
button: Wn,
|
|
1734
|
+
login: Gn,
|
|
1735
|
+
signUp: Qn,
|
|
1736
|
+
buttons: Xn,
|
|
1737
|
+
modal: Jn,
|
|
1680
1738
|
"slide-in-fade": "_slide-in-fade_14q75_1",
|
|
1681
1739
|
"mobile-slide-in-fade": "_mobile-slide-in-fade_14q75_1",
|
|
1682
|
-
closing:
|
|
1740
|
+
closing: Kn,
|
|
1683
1741
|
"mobile-slide-out-fade": "_mobile-slide-out-fade_14q75_1",
|
|
1684
1742
|
"slide-out-fade": "_slide-out-fade_14q75_1",
|
|
1685
|
-
info:
|
|
1686
|
-
top:
|
|
1687
|
-
title:
|
|
1688
|
-
clear:
|
|
1689
|
-
activeClear:
|
|
1690
|
-
count:
|
|
1691
|
-
cart:
|
|
1692
|
-
empty:
|
|
1693
|
-
product:
|
|
1694
|
-
products:
|
|
1695
|
-
image:
|
|
1696
|
-
productInfo:
|
|
1697
|
-
content:
|
|
1698
|
-
name:
|
|
1699
|
-
price:
|
|
1700
|
-
productButtons:
|
|
1701
|
-
productButton:
|
|
1702
|
-
productCount:
|
|
1703
|
-
bottom:
|
|
1704
|
-
subtotal:
|
|
1705
|
-
block:
|
|
1706
|
-
shoppingCount:
|
|
1707
|
-
total:
|
|
1708
|
-
link:
|
|
1709
|
-
userInfo:
|
|
1710
|
-
pagesMobileModal:
|
|
1711
|
-
pagesMobileModalContent:
|
|
1712
|
-
pagesMobileModalHeader:
|
|
1713
|
-
pagesMobileModalFooter:
|
|
1714
|
-
},
|
|
1743
|
+
info: Zn,
|
|
1744
|
+
top: ts,
|
|
1745
|
+
title: es,
|
|
1746
|
+
clear: ns,
|
|
1747
|
+
activeClear: ss,
|
|
1748
|
+
count: is,
|
|
1749
|
+
cart: as,
|
|
1750
|
+
empty: os,
|
|
1751
|
+
product: cs,
|
|
1752
|
+
products: rs,
|
|
1753
|
+
image: ls,
|
|
1754
|
+
productInfo: ds,
|
|
1755
|
+
content: us,
|
|
1756
|
+
name: ms,
|
|
1757
|
+
price: hs,
|
|
1758
|
+
productButtons: ps,
|
|
1759
|
+
productButton: _s,
|
|
1760
|
+
productCount: gs,
|
|
1761
|
+
bottom: fs,
|
|
1762
|
+
subtotal: xs,
|
|
1763
|
+
block: vs,
|
|
1764
|
+
shoppingCount: js,
|
|
1765
|
+
total: bs,
|
|
1766
|
+
link: ys,
|
|
1767
|
+
userInfo: Is,
|
|
1768
|
+
pagesMobileModal: Ns,
|
|
1769
|
+
pagesMobileModalContent: ks,
|
|
1770
|
+
pagesMobileModalHeader: Cs,
|
|
1771
|
+
pagesMobileModalFooter: Ss
|
|
1772
|
+
}, Vi = (o) => {
|
|
1715
1773
|
const { shopping: s, signUp: e, isShowUserInfo: n = !0 } = o;
|
|
1716
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1717
|
-
s && /* @__PURE__ */ t.jsx(
|
|
1718
|
-
n && /* @__PURE__ */ t.jsx(
|
|
1774
|
+
return /* @__PURE__ */ t.jsxs("div", { className: k.buttons, children: [
|
|
1775
|
+
s && /* @__PURE__ */ t.jsx($s, {}),
|
|
1776
|
+
n && /* @__PURE__ */ t.jsx(Tt, { signUp: e })
|
|
1719
1777
|
] });
|
|
1720
|
-
},
|
|
1721
|
-
const [o, s] =
|
|
1722
|
-
function u(
|
|
1723
|
-
if (
|
|
1724
|
-
for (let
|
|
1725
|
-
for (let d = 0; d <
|
|
1726
|
-
if (
|
|
1727
|
-
return
|
|
1778
|
+
}, $s = () => {
|
|
1779
|
+
const [o, s] = f.useState(!1), [e, n] = f.useState([]), { cart: a } = dt(), { pageContext: c } = lt();
|
|
1780
|
+
function u(i) {
|
|
1781
|
+
if (i.variants.length > 0) {
|
|
1782
|
+
for (let y = 0; y < a.parts.length; y++)
|
|
1783
|
+
for (let d = 0; d < i.variants.length; d++)
|
|
1784
|
+
if (i.variants[d] && a.parts[y].productVariantId === i.variants[d].id)
|
|
1785
|
+
return a.parts[y].productVariantId;
|
|
1728
1786
|
}
|
|
1729
|
-
return
|
|
1787
|
+
return i.variants[0].id;
|
|
1730
1788
|
}
|
|
1731
|
-
function r(
|
|
1732
|
-
for (let
|
|
1733
|
-
for (let d = 0; d <
|
|
1734
|
-
if (
|
|
1735
|
-
return
|
|
1789
|
+
function r(i) {
|
|
1790
|
+
for (let y = 0; y < a.parts.length; y++)
|
|
1791
|
+
for (let d = 0; d < i.variants.length; d++)
|
|
1792
|
+
if (i.variants[d] && a.parts[y].productVariantId === i.variants[d].id)
|
|
1793
|
+
return a.parts[y].quantity;
|
|
1736
1794
|
}
|
|
1737
|
-
|
|
1795
|
+
f.useEffect(() => {
|
|
1738
1796
|
(async () => {
|
|
1739
|
-
var
|
|
1740
|
-
const
|
|
1741
|
-
...
|
|
1742
|
-
activeVariantId: u(
|
|
1743
|
-
quantity: r(
|
|
1797
|
+
var v;
|
|
1798
|
+
const y = a.parts.map((N) => String(N.productId)), C = (((v = c == null ? void 0 : c.products) == null ? void 0 : v.filter((N) => y.includes(String(N.id)))) || []).map((N) => ({
|
|
1799
|
+
...N,
|
|
1800
|
+
activeVariantId: u(N),
|
|
1801
|
+
quantity: r(N)
|
|
1744
1802
|
}));
|
|
1745
|
-
n(
|
|
1803
|
+
n(C);
|
|
1746
1804
|
})();
|
|
1747
|
-
}, [
|
|
1748
|
-
function m(
|
|
1749
|
-
var
|
|
1750
|
-
return !
|
|
1805
|
+
}, [a.parts]);
|
|
1806
|
+
function m(i) {
|
|
1807
|
+
var y;
|
|
1808
|
+
return !i || !(i != null && i.variants) ? !1 : (y = i.variants.find((d) => d.id === i.activeVariantId)) == null ? void 0 : y.subscriptionSettings;
|
|
1751
1809
|
}
|
|
1752
|
-
const
|
|
1810
|
+
const _ = a.parts.length > 0 && e.length > 0 && !m(e[0]), [B, h] = f.useState(!1);
|
|
1753
1811
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1754
1812
|
/* @__PURE__ */ t.jsxs(
|
|
1755
|
-
|
|
1813
|
+
L,
|
|
1756
1814
|
{
|
|
1757
1815
|
type: "Secondary",
|
|
1758
1816
|
style: {
|
|
1759
1817
|
padding: 10,
|
|
1760
1818
|
position: "relative"
|
|
1761
1819
|
},
|
|
1762
|
-
onClick: (
|
|
1763
|
-
|
|
1820
|
+
onClick: (i) => {
|
|
1821
|
+
i.stopPropagation(), window.location.pathname.includes("/admin/builder") || (s(!0), h(!0));
|
|
1764
1822
|
},
|
|
1765
1823
|
children: [
|
|
1766
1824
|
/* @__PURE__ */ t.jsx(
|
|
1767
|
-
|
|
1825
|
+
b,
|
|
1768
1826
|
{
|
|
1769
1827
|
name: "Handbag",
|
|
1770
1828
|
fill: "var(--text-primary)"
|
|
1771
1829
|
}
|
|
1772
1830
|
),
|
|
1773
|
-
|
|
1831
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: k.shoppingCount, children: a.parts.length })
|
|
1774
1832
|
]
|
|
1775
1833
|
}
|
|
1776
1834
|
),
|
|
@@ -1778,59 +1836,59 @@ const Un = (o) => {
|
|
|
1778
1836
|
kt,
|
|
1779
1837
|
{
|
|
1780
1838
|
close: () => {
|
|
1781
|
-
|
|
1839
|
+
h(!1), setTimeout(() => {
|
|
1782
1840
|
s(!1);
|
|
1783
1841
|
}, 300);
|
|
1784
1842
|
},
|
|
1785
1843
|
withAnimation: !1,
|
|
1786
1844
|
children: /* @__PURE__ */ t.jsx(
|
|
1787
|
-
|
|
1845
|
+
ws,
|
|
1788
1846
|
{
|
|
1789
1847
|
activeProducts: e,
|
|
1790
|
-
isCartNotEmpty:
|
|
1848
|
+
isCartNotEmpty: _,
|
|
1791
1849
|
isOpen: B
|
|
1792
1850
|
}
|
|
1793
1851
|
)
|
|
1794
1852
|
}
|
|
1795
1853
|
)
|
|
1796
1854
|
] });
|
|
1797
|
-
},
|
|
1798
|
-
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } = o, { cart:
|
|
1799
|
-
function
|
|
1800
|
-
m(
|
|
1855
|
+
}, ws = (o) => {
|
|
1856
|
+
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } = o, { cart: a, reset: c, getTotalAndDiscount: u, updateQuantityOfProduct: r } = dt(), m = jt();
|
|
1857
|
+
function _(i) {
|
|
1858
|
+
m(i);
|
|
1801
1859
|
}
|
|
1802
|
-
function B(
|
|
1803
|
-
|
|
1804
|
-
productId:
|
|
1805
|
-
productVariantId:
|
|
1806
|
-
quantity:
|
|
1860
|
+
function B(i) {
|
|
1861
|
+
i.quantity && r({
|
|
1862
|
+
productId: i.id,
|
|
1863
|
+
productVariantId: i.activeVariantId,
|
|
1864
|
+
quantity: i.quantity + 1
|
|
1807
1865
|
});
|
|
1808
1866
|
}
|
|
1809
|
-
function
|
|
1810
|
-
|
|
1811
|
-
productId:
|
|
1812
|
-
productVariantId:
|
|
1813
|
-
quantity:
|
|
1867
|
+
function h(i) {
|
|
1868
|
+
i.quantity && r({
|
|
1869
|
+
productId: i.id,
|
|
1870
|
+
productVariantId: i.activeVariantId,
|
|
1871
|
+
quantity: i.quantity - 1
|
|
1814
1872
|
});
|
|
1815
1873
|
}
|
|
1816
1874
|
return /* @__PURE__ */ t.jsxs(
|
|
1817
1875
|
"div",
|
|
1818
1876
|
{
|
|
1819
|
-
className:
|
|
1820
|
-
[
|
|
1877
|
+
className: F(k.modal, {
|
|
1878
|
+
[k.closing]: !n
|
|
1821
1879
|
}),
|
|
1822
|
-
onClick: (
|
|
1880
|
+
onClick: (i) => i.stopPropagation(),
|
|
1823
1881
|
children: [
|
|
1824
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1825
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1826
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1827
|
-
e && /* @__PURE__ */ t.jsx("div", { className:
|
|
1882
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.top, children: [
|
|
1883
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.info, children: [
|
|
1884
|
+
/* @__PURE__ */ t.jsx("span", { className: k.title, children: "Cart" }),
|
|
1885
|
+
e && /* @__PURE__ */ t.jsx("div", { className: k.count, children: a.parts.length })
|
|
1828
1886
|
] }),
|
|
1829
1887
|
/* @__PURE__ */ t.jsx(
|
|
1830
1888
|
"button",
|
|
1831
1889
|
{
|
|
1832
|
-
className:
|
|
1833
|
-
[
|
|
1890
|
+
className: F(k.clear, {
|
|
1891
|
+
[k.activeClear]: e
|
|
1834
1892
|
}),
|
|
1835
1893
|
disabled: !e,
|
|
1836
1894
|
onClick: c,
|
|
@@ -1838,49 +1896,49 @@ const Un = (o) => {
|
|
|
1838
1896
|
}
|
|
1839
1897
|
)
|
|
1840
1898
|
] }),
|
|
1841
|
-
e ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1842
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1899
|
+
e ? /* @__PURE__ */ t.jsxs("div", { className: k.cart, children: [
|
|
1900
|
+
/* @__PURE__ */ t.jsx("div", { className: k.products, children: s.map((i) => /* @__PURE__ */ t.jsxs(
|
|
1843
1901
|
"div",
|
|
1844
1902
|
{
|
|
1845
|
-
className:
|
|
1903
|
+
className: k.product,
|
|
1846
1904
|
children: [
|
|
1847
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1848
|
-
|
|
1905
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.productInfo, children: [
|
|
1906
|
+
i.images.length > 0 ? /* @__PURE__ */ t.jsx(
|
|
1849
1907
|
"img",
|
|
1850
1908
|
{
|
|
1851
|
-
src: `https://imagedelivery.net/${
|
|
1909
|
+
src: `https://imagedelivery.net/${i.images[0].cfId}/w=500`,
|
|
1852
1910
|
alt: "image",
|
|
1853
1911
|
width: "100%",
|
|
1854
1912
|
height: "100%",
|
|
1855
|
-
className:
|
|
1913
|
+
className: k.image
|
|
1856
1914
|
}
|
|
1857
|
-
) : /* @__PURE__ */ t.jsx("div", { className:
|
|
1858
|
-
|
|
1915
|
+
) : /* @__PURE__ */ t.jsx("div", { className: k.image, children: /* @__PURE__ */ t.jsx(
|
|
1916
|
+
b,
|
|
1859
1917
|
{
|
|
1860
1918
|
name: "Image",
|
|
1861
1919
|
fill: "var(--text-secondary)"
|
|
1862
1920
|
}
|
|
1863
1921
|
) }),
|
|
1864
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1865
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1866
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1922
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.content, children: [
|
|
1923
|
+
/* @__PURE__ */ t.jsx("div", { className: k.name, children: Nt(i.name) }),
|
|
1924
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.price, children: [
|
|
1867
1925
|
"$",
|
|
1868
|
-
|
|
1926
|
+
i.variants.find((y) => y.id === i.activeVariantId).price.amount * ((i == null ? void 0 : i.quantity) || 1)
|
|
1869
1927
|
] })
|
|
1870
1928
|
] })
|
|
1871
1929
|
] }),
|
|
1872
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1930
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.productButtons, children: [
|
|
1873
1931
|
/* @__PURE__ */ t.jsx(
|
|
1874
|
-
|
|
1932
|
+
L,
|
|
1875
1933
|
{
|
|
1876
1934
|
type: "Secondary",
|
|
1877
1935
|
onClick: () => {
|
|
1878
|
-
|
|
1936
|
+
i.quantity !== 1 && h(i);
|
|
1879
1937
|
},
|
|
1880
|
-
className:
|
|
1881
|
-
disabled:
|
|
1938
|
+
className: k.productButton,
|
|
1939
|
+
disabled: i.quantity === 1,
|
|
1882
1940
|
children: /* @__PURE__ */ t.jsx(
|
|
1883
|
-
|
|
1941
|
+
b,
|
|
1884
1942
|
{
|
|
1885
1943
|
name: "Minus",
|
|
1886
1944
|
fill: "#757575",
|
|
@@ -1890,16 +1948,16 @@ const Un = (o) => {
|
|
|
1890
1948
|
)
|
|
1891
1949
|
}
|
|
1892
1950
|
),
|
|
1893
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1951
|
+
/* @__PURE__ */ t.jsx("div", { className: k.productCount, children: i.quantity }),
|
|
1894
1952
|
/* @__PURE__ */ t.jsx(
|
|
1895
|
-
|
|
1953
|
+
L,
|
|
1896
1954
|
{
|
|
1897
1955
|
type: "Secondary",
|
|
1898
|
-
onClick: () => B(
|
|
1899
|
-
className:
|
|
1900
|
-
disabled:
|
|
1956
|
+
onClick: () => B(i),
|
|
1957
|
+
className: k.productButton,
|
|
1958
|
+
disabled: i.quantity === i.variants.find((y) => y.id === i.activeVariantId).quantity.available,
|
|
1901
1959
|
children: /* @__PURE__ */ t.jsx(
|
|
1902
|
-
|
|
1960
|
+
b,
|
|
1903
1961
|
{
|
|
1904
1962
|
name: "Plus",
|
|
1905
1963
|
fill: "#757575",
|
|
@@ -1912,14 +1970,14 @@ const Un = (o) => {
|
|
|
1912
1970
|
] })
|
|
1913
1971
|
]
|
|
1914
1972
|
},
|
|
1915
|
-
|
|
1973
|
+
i.id
|
|
1916
1974
|
)) }),
|
|
1917
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1918
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1919
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1975
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.bottom, children: [
|
|
1976
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.subtotal, children: [
|
|
1977
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.block, children: [
|
|
1920
1978
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
1921
1979
|
/* @__PURE__ */ t.jsx(
|
|
1922
|
-
|
|
1980
|
+
b,
|
|
1923
1981
|
{
|
|
1924
1982
|
name: "Info",
|
|
1925
1983
|
width: 20,
|
|
@@ -1928,20 +1986,20 @@ const Un = (o) => {
|
|
|
1928
1986
|
}
|
|
1929
1987
|
)
|
|
1930
1988
|
] }),
|
|
1931
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1989
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.total, children: [
|
|
1932
1990
|
"$",
|
|
1933
1991
|
u().total
|
|
1934
1992
|
] })
|
|
1935
1993
|
] }),
|
|
1936
|
-
/* @__PURE__ */ t.jsx(
|
|
1994
|
+
/* @__PURE__ */ t.jsx(L, { onClick: () => _("/checkout"), children: "Checkout" })
|
|
1937
1995
|
] })
|
|
1938
|
-
] }) : /* @__PURE__ */ t.jsx(
|
|
1996
|
+
] }) : /* @__PURE__ */ t.jsx(qs, {})
|
|
1939
1997
|
]
|
|
1940
1998
|
}
|
|
1941
1999
|
);
|
|
1942
|
-
},
|
|
2000
|
+
}, qs = () => /* @__PURE__ */ t.jsxs("div", { className: k.empty, children: [
|
|
1943
2001
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1944
|
-
|
|
2002
|
+
b,
|
|
1945
2003
|
{
|
|
1946
2004
|
name: "Handbag",
|
|
1947
2005
|
fill: "var(--text-secondary)"
|
|
@@ -1955,20 +2013,20 @@ const Un = (o) => {
|
|
|
1955
2013
|
"a",
|
|
1956
2014
|
{
|
|
1957
2015
|
href: "/products",
|
|
1958
|
-
className:
|
|
2016
|
+
className: k.link,
|
|
1959
2017
|
children: "view products"
|
|
1960
2018
|
}
|
|
1961
2019
|
)
|
|
1962
2020
|
] })
|
|
1963
|
-
] }),
|
|
1964
|
-
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e,
|
|
2021
|
+
] }), Tt = ({ signUp: o, close: s }) => {
|
|
2022
|
+
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, a = jt();
|
|
1965
2023
|
function c(m) {
|
|
1966
|
-
window.location.pathname.includes("/admin/builder") ||
|
|
2024
|
+
window.location.pathname.includes("/admin/builder") || a(m);
|
|
1967
2025
|
}
|
|
1968
2026
|
if (!n)
|
|
1969
2027
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1970
2028
|
/* @__PURE__ */ t.jsx(
|
|
1971
|
-
|
|
2029
|
+
L,
|
|
1972
2030
|
{
|
|
1973
2031
|
onClick: () => {
|
|
1974
2032
|
c("/customer-dash"), s == null || s();
|
|
@@ -1981,7 +2039,7 @@ const Un = (o) => {
|
|
|
1981
2039
|
}
|
|
1982
2040
|
),
|
|
1983
2041
|
o && /* @__PURE__ */ t.jsx(
|
|
1984
|
-
|
|
2042
|
+
L,
|
|
1985
2043
|
{
|
|
1986
2044
|
onClick: () => {
|
|
1987
2045
|
c("/customer-dash"), s == null || s();
|
|
@@ -1995,48 +2053,48 @@ const Un = (o) => {
|
|
|
1995
2053
|
}
|
|
1996
2054
|
)
|
|
1997
2055
|
] });
|
|
1998
|
-
const [u, r] =
|
|
1999
|
-
return
|
|
2056
|
+
const [u, r] = f.useState("test-email@gmail.com");
|
|
2057
|
+
return f.useEffect(() => {
|
|
2000
2058
|
(async () => {
|
|
2001
|
-
const
|
|
2002
|
-
r(
|
|
2059
|
+
const _ = Dt(n);
|
|
2060
|
+
r(_.email);
|
|
2003
2061
|
})();
|
|
2004
2062
|
}, [n]), /* @__PURE__ */ t.jsx(
|
|
2005
2063
|
"div",
|
|
2006
2064
|
{
|
|
2007
|
-
className:
|
|
2065
|
+
className: k.userInfo,
|
|
2008
2066
|
onClick: () => {
|
|
2009
2067
|
c("/customer-dash"), s == null || s();
|
|
2010
2068
|
},
|
|
2011
2069
|
children: /* @__PURE__ */ t.jsx("div", { children: u || "test-email@gmail.com" })
|
|
2012
2070
|
}
|
|
2013
2071
|
);
|
|
2014
|
-
},
|
|
2072
|
+
}, Bs = ({
|
|
2015
2073
|
children: o,
|
|
2016
2074
|
logo: s,
|
|
2017
2075
|
setIsOpen: e,
|
|
2018
2076
|
signUp: n
|
|
2019
2077
|
}) => {
|
|
2020
|
-
const { setIsOpen:
|
|
2021
|
-
|
|
2022
|
-
e(!1),
|
|
2078
|
+
const { setIsOpen: a } = qt(), c = () => {
|
|
2079
|
+
a(!1), setTimeout(() => {
|
|
2080
|
+
e(!1), a(!0);
|
|
2023
2081
|
}, 300);
|
|
2024
2082
|
};
|
|
2025
2083
|
return /* @__PURE__ */ t.jsxs(
|
|
2026
2084
|
"div",
|
|
2027
2085
|
{
|
|
2028
|
-
className:
|
|
2086
|
+
className: k.pagesMobileModal,
|
|
2029
2087
|
onClick: (u) => u.stopPropagation(),
|
|
2030
2088
|
children: [
|
|
2031
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2089
|
+
/* @__PURE__ */ t.jsxs("div", { className: k.pagesMobileModalHeader, children: [
|
|
2032
2090
|
/* @__PURE__ */ t.jsx("div", { children: s }),
|
|
2033
2091
|
/* @__PURE__ */ t.jsx(
|
|
2034
|
-
|
|
2092
|
+
L,
|
|
2035
2093
|
{
|
|
2036
2094
|
type: "Secondary",
|
|
2037
2095
|
onClick: c,
|
|
2038
2096
|
children: /* @__PURE__ */ t.jsx(
|
|
2039
|
-
|
|
2097
|
+
b,
|
|
2040
2098
|
{
|
|
2041
2099
|
name: "X",
|
|
2042
2100
|
fill: "var(--text-primary)"
|
|
@@ -2045,9 +2103,9 @@ const Un = (o) => {
|
|
|
2045
2103
|
}
|
|
2046
2104
|
)
|
|
2047
2105
|
] }),
|
|
2048
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2049
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2050
|
-
|
|
2106
|
+
/* @__PURE__ */ t.jsx("div", { className: k.pagesMobileModalContent, children: o }),
|
|
2107
|
+
/* @__PURE__ */ t.jsx("div", { className: k.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
|
|
2108
|
+
Tt,
|
|
2051
2109
|
{
|
|
2052
2110
|
signUp: n,
|
|
2053
2111
|
close: c
|
|
@@ -2056,28 +2114,28 @@ const Un = (o) => {
|
|
|
2056
2114
|
]
|
|
2057
2115
|
}
|
|
2058
2116
|
);
|
|
2059
|
-
},
|
|
2117
|
+
}, Ui = ({
|
|
2060
2118
|
children: o,
|
|
2061
2119
|
logo: s,
|
|
2062
2120
|
signUp: e
|
|
2063
2121
|
}) => {
|
|
2064
|
-
const [n,
|
|
2122
|
+
const [n, a] = f.useState(!1);
|
|
2065
2123
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2066
|
-
/* @__PURE__ */ t.jsx(
|
|
2067
|
-
n && /* @__PURE__ */ t.jsx(kt, { close: () =>
|
|
2068
|
-
|
|
2124
|
+
/* @__PURE__ */ t.jsx(Ps, { setIsOpenModal: a }),
|
|
2125
|
+
n && /* @__PURE__ */ t.jsx(kt, { close: () => a(!1), children: /* @__PURE__ */ t.jsx(
|
|
2126
|
+
Bs,
|
|
2069
2127
|
{
|
|
2070
2128
|
logo: s,
|
|
2071
|
-
setIsOpen:
|
|
2129
|
+
setIsOpen: a,
|
|
2072
2130
|
signUp: e,
|
|
2073
2131
|
children: o
|
|
2074
2132
|
}
|
|
2075
2133
|
) })
|
|
2076
2134
|
] });
|
|
2077
|
-
},
|
|
2135
|
+
}, Ps = (o) => {
|
|
2078
2136
|
const { setIsOpenModal: s } = o;
|
|
2079
2137
|
return /* @__PURE__ */ t.jsx(
|
|
2080
|
-
|
|
2138
|
+
L,
|
|
2081
2139
|
{
|
|
2082
2140
|
type: "Secondary",
|
|
2083
2141
|
style: {
|
|
@@ -2087,7 +2145,7 @@ const Un = (o) => {
|
|
|
2087
2145
|
e.stopPropagation(), window.location.pathname.includes("/admin/builder") || s(!0);
|
|
2088
2146
|
},
|
|
2089
2147
|
children: /* @__PURE__ */ t.jsx(
|
|
2090
|
-
|
|
2148
|
+
b,
|
|
2091
2149
|
{
|
|
2092
2150
|
name: "List",
|
|
2093
2151
|
fill: "var(--text-primary)"
|
|
@@ -2095,34 +2153,34 @@ const Un = (o) => {
|
|
|
2095
2153
|
)
|
|
2096
2154
|
}
|
|
2097
2155
|
);
|
|
2098
|
-
},
|
|
2099
|
-
share:
|
|
2100
|
-
modal:
|
|
2101
|
-
header:
|
|
2102
|
-
socials:
|
|
2103
|
-
social:
|
|
2104
|
-
copy:
|
|
2105
|
-
title:
|
|
2106
|
-
copyWrapper:
|
|
2107
|
-
copyText:
|
|
2108
|
-
copyTextMobile:
|
|
2109
|
-
copyTextMiniMobile:
|
|
2110
|
-
},
|
|
2111
|
-
const { isOpenModal: s, setIsOpenModal: e } =
|
|
2156
|
+
}, Ts = "_share_10urc_1", Ms = "_modal_10urc_9", As = "_header_10urc_21", Os = "_socials_10urc_31", Es = "_social_10urc_31", Rs = "_copy_10urc_41", Ds = "_title_10urc_48", Ls = "_copyWrapper_10urc_54", zs = "_copyText_10urc_63", Fs = "_copyTextMobile_10urc_76", Vs = "_copyTextMiniMobile_10urc_95", et = {
|
|
2157
|
+
share: Ts,
|
|
2158
|
+
modal: Ms,
|
|
2159
|
+
header: As,
|
|
2160
|
+
socials: Os,
|
|
2161
|
+
social: Es,
|
|
2162
|
+
copy: Rs,
|
|
2163
|
+
title: Ds,
|
|
2164
|
+
copyWrapper: Ls,
|
|
2165
|
+
copyText: zs,
|
|
2166
|
+
copyTextMobile: Fs,
|
|
2167
|
+
copyTextMiniMobile: Vs
|
|
2168
|
+
}, Hi = ({ title: o = "Copy Product Link" }) => {
|
|
2169
|
+
const { isOpenModal: s, setIsOpenModal: e } = Bt();
|
|
2112
2170
|
function n() {
|
|
2113
2171
|
e(!0);
|
|
2114
2172
|
}
|
|
2115
2173
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2116
2174
|
/* @__PURE__ */ t.jsx(
|
|
2117
|
-
|
|
2175
|
+
L,
|
|
2118
2176
|
{
|
|
2119
2177
|
className: et.share,
|
|
2120
|
-
onClick: (
|
|
2121
|
-
|
|
2178
|
+
onClick: (a) => {
|
|
2179
|
+
a.stopPropagation(), n();
|
|
2122
2180
|
},
|
|
2123
2181
|
type: "Secondary",
|
|
2124
2182
|
children: /* @__PURE__ */ t.jsx(
|
|
2125
|
-
|
|
2183
|
+
b,
|
|
2126
2184
|
{
|
|
2127
2185
|
name: "Share",
|
|
2128
2186
|
fill: "#757575",
|
|
@@ -2131,10 +2189,10 @@ const Un = (o) => {
|
|
|
2131
2189
|
)
|
|
2132
2190
|
}
|
|
2133
2191
|
),
|
|
2134
|
-
s && /* @__PURE__ */ t.jsx(kt, { close: e, children: /* @__PURE__ */ t.jsx(
|
|
2192
|
+
s && /* @__PURE__ */ t.jsx(kt, { close: e, children: /* @__PURE__ */ t.jsx(Us, { title: o }) })
|
|
2135
2193
|
] });
|
|
2136
|
-
},
|
|
2137
|
-
const { setIsOpenModal: s } =
|
|
2194
|
+
}, Us = ({ title: o = "Copy Product Link" }) => {
|
|
2195
|
+
const { setIsOpenModal: s } = Bt(), { notification: e, setNotification: n } = Pt(), { setIsOpen: a } = qt(), c = window.location.href;
|
|
2138
2196
|
function u() {
|
|
2139
2197
|
navigator.clipboard.writeText(c), n({
|
|
2140
2198
|
message: "Link copied to clipboard",
|
|
@@ -2142,23 +2200,23 @@ const Un = (o) => {
|
|
|
2142
2200
|
});
|
|
2143
2201
|
}
|
|
2144
2202
|
function r() {
|
|
2145
|
-
|
|
2146
|
-
s(!1),
|
|
2203
|
+
a(!1), setTimeout(() => {
|
|
2204
|
+
s(!1), a(!0);
|
|
2147
2205
|
}, 300);
|
|
2148
2206
|
}
|
|
2149
|
-
function m(
|
|
2150
|
-
return
|
|
2207
|
+
function m(_, B) {
|
|
2208
|
+
return _.length > B ? _.slice(0, B) + "..." : _;
|
|
2151
2209
|
}
|
|
2152
2210
|
return /* @__PURE__ */ t.jsxs(
|
|
2153
2211
|
"div",
|
|
2154
2212
|
{
|
|
2155
2213
|
className: et.modal,
|
|
2156
|
-
onClick: (
|
|
2214
|
+
onClick: (_) => _.stopPropagation(),
|
|
2157
2215
|
children: [
|
|
2158
2216
|
/* @__PURE__ */ t.jsxs("div", { className: et.header, children: [
|
|
2159
2217
|
/* @__PURE__ */ t.jsx("div", { className: et.title, children: o }),
|
|
2160
2218
|
/* @__PURE__ */ t.jsx(
|
|
2161
|
-
|
|
2219
|
+
b,
|
|
2162
2220
|
{
|
|
2163
2221
|
name: "X",
|
|
2164
2222
|
fill: "#757575",
|
|
@@ -2169,7 +2227,7 @@ const Un = (o) => {
|
|
|
2169
2227
|
] }),
|
|
2170
2228
|
/* @__PURE__ */ t.jsxs("div", { className: et.copyWrapper, children: [
|
|
2171
2229
|
/* @__PURE__ */ t.jsxs(
|
|
2172
|
-
|
|
2230
|
+
L,
|
|
2173
2231
|
{
|
|
2174
2232
|
type: "Secondary",
|
|
2175
2233
|
onClick: u,
|
|
@@ -2184,38 +2242,38 @@ const Un = (o) => {
|
|
|
2184
2242
|
}
|
|
2185
2243
|
),
|
|
2186
2244
|
/* @__PURE__ */ t.jsx(
|
|
2187
|
-
|
|
2245
|
+
L,
|
|
2188
2246
|
{
|
|
2189
2247
|
type: "Secondary",
|
|
2190
2248
|
onClick: u,
|
|
2191
|
-
children: e ? /* @__PURE__ */ t.jsx(
|
|
2249
|
+
children: e ? /* @__PURE__ */ t.jsx(b, { name: "Check" }) : /* @__PURE__ */ t.jsx(b, { name: "Copy" })
|
|
2192
2250
|
}
|
|
2193
2251
|
)
|
|
2194
2252
|
] })
|
|
2195
2253
|
]
|
|
2196
2254
|
}
|
|
2197
2255
|
);
|
|
2198
|
-
},
|
|
2199
|
-
accordion:
|
|
2200
|
-
header:
|
|
2201
|
-
icon:
|
|
2202
|
-
open:
|
|
2203
|
-
content:
|
|
2204
|
-
},
|
|
2205
|
-
const [n,
|
|
2206
|
-
|
|
2256
|
+
}, Hs = "_accordion_1s1lq_1", Ys = "_header_1s1lq_9", Ws = "_icon_1s1lq_18", Gs = "_open_1s1lq_21", Qs = "_content_1s1lq_25", ot = {
|
|
2257
|
+
accordion: Hs,
|
|
2258
|
+
header: Ys,
|
|
2259
|
+
icon: Ws,
|
|
2260
|
+
open: Gs,
|
|
2261
|
+
content: Qs
|
|
2262
|
+
}, Yi = ({ title: o, content: s, defaultOpen: e = !1 }) => {
|
|
2263
|
+
const [n, a] = f.useState(e), [c, u] = f.useState(0), r = f.useRef(null), m = () => {
|
|
2264
|
+
a(!n);
|
|
2207
2265
|
};
|
|
2208
|
-
return
|
|
2266
|
+
return f.useEffect(() => {
|
|
2209
2267
|
r.current && u(n ? r.current.scrollHeight : 0);
|
|
2210
|
-
}, [n]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
2268
|
+
}, [n]), /* @__PURE__ */ t.jsxs("div", { className: ot.accordion, children: [
|
|
2211
2269
|
/* @__PURE__ */ t.jsxs(
|
|
2212
2270
|
"div",
|
|
2213
2271
|
{
|
|
2214
|
-
className:
|
|
2272
|
+
className: ot.header,
|
|
2215
2273
|
onClick: m,
|
|
2216
2274
|
children: [
|
|
2217
2275
|
/* @__PURE__ */ t.jsx("h5", { id: "h5", children: o }),
|
|
2218
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2276
|
+
/* @__PURE__ */ t.jsx("div", { className: F(ot.icon, { [ot.open]: n }), children: /* @__PURE__ */ t.jsx(b, { name: "CaretDown" }) })
|
|
2219
2277
|
]
|
|
2220
2278
|
}
|
|
2221
2279
|
),
|
|
@@ -2223,13 +2281,13 @@ const Un = (o) => {
|
|
|
2223
2281
|
"div",
|
|
2224
2282
|
{
|
|
2225
2283
|
ref: r,
|
|
2226
|
-
className:
|
|
2284
|
+
className: ot.content,
|
|
2227
2285
|
style: { height: `${c}px` },
|
|
2228
2286
|
children: /* @__PURE__ */ t.jsx("p", { id: "p", children: s })
|
|
2229
2287
|
}
|
|
2230
2288
|
)
|
|
2231
2289
|
] });
|
|
2232
|
-
},
|
|
2290
|
+
}, Wi = ({ children: o, path: s, className: e, target: n = "_self", id: a }) => {
|
|
2233
2291
|
if (window.location.pathname.includes("/admin/builder"))
|
|
2234
2292
|
return /* @__PURE__ */ t.jsx(
|
|
2235
2293
|
"div",
|
|
@@ -2237,11 +2295,11 @@ const Un = (o) => {
|
|
|
2237
2295
|
className: e,
|
|
2238
2296
|
role: "link",
|
|
2239
2297
|
style: { cursor: "pointer" },
|
|
2240
|
-
id:
|
|
2298
|
+
id: a,
|
|
2241
2299
|
children: o
|
|
2242
2300
|
}
|
|
2243
2301
|
);
|
|
2244
|
-
const c =
|
|
2302
|
+
const c = jt(), u = /^https?:\/\//.test(s), r = (m) => {
|
|
2245
2303
|
u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.open(s, "_self") : (m.preventDefault(), c(s));
|
|
2246
2304
|
};
|
|
2247
2305
|
return /* @__PURE__ */ t.jsx(
|
|
@@ -2251,32 +2309,32 @@ const Un = (o) => {
|
|
|
2251
2309
|
className: e,
|
|
2252
2310
|
role: "link",
|
|
2253
2311
|
style: { cursor: "pointer" },
|
|
2254
|
-
id:
|
|
2312
|
+
id: a,
|
|
2255
2313
|
children: o
|
|
2256
2314
|
}
|
|
2257
2315
|
);
|
|
2258
|
-
},
|
|
2259
|
-
buttonsBlock:
|
|
2260
|
-
slideUp:
|
|
2261
|
-
},
|
|
2262
|
-
var
|
|
2263
|
-
const { setIsOpen: s, setModalType: e, productId: n } = o, { cart:
|
|
2316
|
+
}, Xs = "_buttonsBlock_1b2rb_1", Js = "_slideUp_1b2rb_1", Ks = {
|
|
2317
|
+
buttonsBlock: Xs,
|
|
2318
|
+
slideUp: Js
|
|
2319
|
+
}, Gi = (o) => {
|
|
2320
|
+
var _, B;
|
|
2321
|
+
const { setIsOpen: s, setModalType: e, productId: n } = o, { cart: a } = dt(), { pageContext: c } = lt(), u = (_ = c == null ? void 0 : c.listings) == null ? void 0 : _.find((h) => h.id === n);
|
|
2264
2322
|
if (!u)
|
|
2265
2323
|
return null;
|
|
2266
2324
|
const r = (B = c == null ? void 0 : c.products) == null ? void 0 : B.find(
|
|
2267
|
-
(
|
|
2325
|
+
(h) => h.uniquePath === u.productData.uniquePath
|
|
2268
2326
|
);
|
|
2269
2327
|
if (!r)
|
|
2270
2328
|
return null;
|
|
2271
|
-
const m =
|
|
2329
|
+
const m = a.parts.find((h) => h.productId === r.id);
|
|
2272
2330
|
return /* @__PURE__ */ t.jsxs(
|
|
2273
2331
|
"div",
|
|
2274
2332
|
{
|
|
2275
|
-
className:
|
|
2276
|
-
onClick: (
|
|
2333
|
+
className: Ks.buttonsBlock,
|
|
2334
|
+
onClick: (h) => h.stopPropagation(),
|
|
2277
2335
|
children: [
|
|
2278
2336
|
/* @__PURE__ */ t.jsx(
|
|
2279
|
-
|
|
2337
|
+
L,
|
|
2280
2338
|
{
|
|
2281
2339
|
type: "Secondary",
|
|
2282
2340
|
style: {
|
|
@@ -2289,7 +2347,7 @@ const Un = (o) => {
|
|
|
2289
2347
|
}
|
|
2290
2348
|
),
|
|
2291
2349
|
/* @__PURE__ */ t.jsx(
|
|
2292
|
-
|
|
2350
|
+
L,
|
|
2293
2351
|
{
|
|
2294
2352
|
type: "Primary",
|
|
2295
2353
|
onClick: () => {
|
|
@@ -2301,15 +2359,15 @@ const Un = (o) => {
|
|
|
2301
2359
|
]
|
|
2302
2360
|
}
|
|
2303
2361
|
);
|
|
2304
|
-
},
|
|
2305
|
-
wrapper:
|
|
2306
|
-
logo:
|
|
2307
|
-
info:
|
|
2308
|
-
},
|
|
2309
|
-
const { general: s } =
|
|
2362
|
+
}, Zs = "_wrapper_27wzz_1", ti = "_logo_27wzz_8", ei = "_info_27wzz_12", yt = {
|
|
2363
|
+
wrapper: Zs,
|
|
2364
|
+
logo: ti,
|
|
2365
|
+
info: ei
|
|
2366
|
+
}, Qi = ({ date: o }) => {
|
|
2367
|
+
const { general: s } = Lt();
|
|
2310
2368
|
if (!s) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
2311
2369
|
function e(n) {
|
|
2312
|
-
const
|
|
2370
|
+
const a = new Date(n), c = {
|
|
2313
2371
|
month: "short",
|
|
2314
2372
|
day: "2-digit",
|
|
2315
2373
|
year: "numeric",
|
|
@@ -2317,10 +2375,10 @@ const Un = (o) => {
|
|
|
2317
2375
|
minute: "2-digit",
|
|
2318
2376
|
hour12: !1
|
|
2319
2377
|
};
|
|
2320
|
-
return
|
|
2378
|
+
return a.toLocaleDateString("en-US", c);
|
|
2321
2379
|
}
|
|
2322
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2323
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2380
|
+
return /* @__PURE__ */ t.jsxs("div", { className: yt.wrapper, children: [
|
|
2381
|
+
/* @__PURE__ */ t.jsx("div", { className: yt.logo, children: s.info.logo ? /* @__PURE__ */ t.jsx(
|
|
2324
2382
|
"img",
|
|
2325
2383
|
{
|
|
2326
2384
|
src: `https://imagedelivery.net/${s.info.logo.cfId}/w=500,h=500`,
|
|
@@ -2328,68 +2386,68 @@ const Un = (o) => {
|
|
|
2328
2386
|
style: { objectFit: "contain", width: "48px", height: "48px" }
|
|
2329
2387
|
}
|
|
2330
2388
|
) : /* @__PURE__ */ t.jsx(
|
|
2331
|
-
|
|
2389
|
+
b,
|
|
2332
2390
|
{
|
|
2333
2391
|
name: "Image",
|
|
2334
2392
|
width: 48,
|
|
2335
2393
|
height: 48
|
|
2336
2394
|
}
|
|
2337
2395
|
) }),
|
|
2338
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2396
|
+
/* @__PURE__ */ t.jsxs("div", { className: yt.info, children: [
|
|
2339
2397
|
/* @__PURE__ */ t.jsx("h3", { id: "h4", children: s.info.name }),
|
|
2340
2398
|
/* @__PURE__ */ t.jsx("p", { id: "p", children: e(o) })
|
|
2341
2399
|
] })
|
|
2342
2400
|
] });
|
|
2343
|
-
},
|
|
2344
|
-
options:
|
|
2345
|
-
price:
|
|
2346
|
-
oldPrice:
|
|
2347
|
-
newPrice:
|
|
2348
|
-
animate:
|
|
2349
|
-
appearAndBounce:
|
|
2350
|
-
meta:
|
|
2351
|
-
info:
|
|
2352
|
-
infoRight:
|
|
2353
|
-
buttons:
|
|
2354
|
-
variants:
|
|
2355
|
-
variant:
|
|
2356
|
-
stock:
|
|
2357
|
-
variantInfo:
|
|
2358
|
-
quantity:
|
|
2359
|
-
count:
|
|
2360
|
-
focused:
|
|
2361
|
-
button:
|
|
2362
|
-
activeVariant:
|
|
2363
|
-
chargeTypes:
|
|
2364
|
-
charge:
|
|
2365
|
-
chargeActive:
|
|
2366
|
-
title:
|
|
2367
|
-
modal:
|
|
2368
|
-
header:
|
|
2369
|
-
},
|
|
2401
|
+
}, ni = "_options_mju90_1", si = "_price_mju90_12", ii = "_oldPrice_mju90_19", ai = "_newPrice_mju90_27", oi = "_animate_mju90_34", ci = "_appearAndBounce_mju90_1", ri = "_meta_mju90_52", li = "_info_mju90_58", di = "_infoRight_mju90_66", ui = "_buttons_mju90_73", mi = "_variants_mju90_80", hi = "_variant_mju90_80", pi = "_stock_mju90_98", _i = "_variantInfo_mju90_105", gi = "_quantity_mju90_111", fi = "_count_mju90_118", xi = "_focused_mju90_135", vi = "_button_mju90_73", ji = "_activeVariant_mju90_161", bi = "_chargeTypes_mju90_165", yi = "_charge_mju90_165", Ii = "_chargeActive_mju90_190", Ni = "_title_mju90_198", ki = "_modal_mju90_204", Ci = "_header_mju90_218", J = {
|
|
2402
|
+
options: ni,
|
|
2403
|
+
price: si,
|
|
2404
|
+
oldPrice: ii,
|
|
2405
|
+
newPrice: ai,
|
|
2406
|
+
animate: oi,
|
|
2407
|
+
appearAndBounce: ci,
|
|
2408
|
+
meta: ri,
|
|
2409
|
+
info: li,
|
|
2410
|
+
infoRight: di,
|
|
2411
|
+
buttons: ui,
|
|
2412
|
+
variants: mi,
|
|
2413
|
+
variant: hi,
|
|
2414
|
+
stock: pi,
|
|
2415
|
+
variantInfo: _i,
|
|
2416
|
+
quantity: gi,
|
|
2417
|
+
count: fi,
|
|
2418
|
+
focused: xi,
|
|
2419
|
+
button: vi,
|
|
2420
|
+
activeVariant: ji,
|
|
2421
|
+
chargeTypes: bi,
|
|
2422
|
+
charge: yi,
|
|
2423
|
+
chargeActive: Ii,
|
|
2424
|
+
title: Ni,
|
|
2425
|
+
modal: ki,
|
|
2426
|
+
header: Ci
|
|
2427
|
+
}, Xi = (o) => {
|
|
2370
2428
|
var r, m;
|
|
2371
|
-
const { pageContext: s } = lt(), e = (r = s == null ? void 0 : s.listings) == null ? void 0 : r.find((
|
|
2429
|
+
const { pageContext: s } = lt(), e = (r = s == null ? void 0 : s.listings) == null ? void 0 : r.find((_) => _.id === o.productId);
|
|
2372
2430
|
if (!e)
|
|
2373
2431
|
return;
|
|
2374
2432
|
const n = (m = s == null ? void 0 : s.products) == null ? void 0 : m.find(
|
|
2375
|
-
(
|
|
2433
|
+
(_) => _.uniquePath === e.productData.uniquePath
|
|
2376
2434
|
);
|
|
2377
2435
|
if (!n)
|
|
2378
2436
|
return;
|
|
2379
|
-
const
|
|
2380
|
-
|
|
2437
|
+
const a = n.variants[0], [c, u] = f.useState(
|
|
2438
|
+
a.chargeTypes && a.chargeTypes.length > 1 ? a.chargeTypes[0] : "ONE_TIME"
|
|
2381
2439
|
);
|
|
2382
2440
|
return /* @__PURE__ */ t.jsxs(
|
|
2383
2441
|
"div",
|
|
2384
2442
|
{
|
|
2385
|
-
className:
|
|
2386
|
-
onClick: (
|
|
2443
|
+
className: J.modal,
|
|
2444
|
+
onClick: (_) => _.stopPropagation(),
|
|
2387
2445
|
children: [
|
|
2388
2446
|
o.type === "Add To Cart" && /* @__PURE__ */ t.jsx(
|
|
2389
|
-
|
|
2447
|
+
Si,
|
|
2390
2448
|
{
|
|
2391
2449
|
variants: n.variants,
|
|
2392
|
-
activeVariant:
|
|
2450
|
+
activeVariant: a,
|
|
2393
2451
|
activeChargeType: c,
|
|
2394
2452
|
setActiveChargeType: u,
|
|
2395
2453
|
productId: n.id,
|
|
@@ -2397,7 +2455,7 @@ const Un = (o) => {
|
|
|
2397
2455
|
}
|
|
2398
2456
|
),
|
|
2399
2457
|
o.type === "Buy Now" && /* @__PURE__ */ t.jsx(
|
|
2400
|
-
|
|
2458
|
+
$i,
|
|
2401
2459
|
{
|
|
2402
2460
|
product: n,
|
|
2403
2461
|
setIsOpen: o.setIsOpen
|
|
@@ -2406,30 +2464,30 @@ const Un = (o) => {
|
|
|
2406
2464
|
]
|
|
2407
2465
|
}
|
|
2408
2466
|
);
|
|
2409
|
-
},
|
|
2410
|
-
const { variants: s, activeChargeType: e, setActiveChargeType: n, activeVariant:
|
|
2411
|
-
async function
|
|
2412
|
-
const
|
|
2413
|
-
(
|
|
2467
|
+
}, Si = (o) => {
|
|
2468
|
+
const { variants: s, activeChargeType: e, setActiveChargeType: n, activeVariant: a, productId: c, setIsOpen: u } = o, { cart: r, addProductToCart: m, addProducts: _, updateQuantityOfProduct: B } = dt(), { setNotification: h } = Pt(), { pageContext: i } = lt();
|
|
2469
|
+
async function y(d) {
|
|
2470
|
+
const C = r.parts.find(
|
|
2471
|
+
(v) => v.productId === o.productId && v.productVariantId === d
|
|
2414
2472
|
);
|
|
2415
|
-
|
|
2473
|
+
C ? B({
|
|
2416
2474
|
productId: c,
|
|
2417
2475
|
productVariantId: d,
|
|
2418
|
-
quantity:
|
|
2419
|
-
}) : (
|
|
2476
|
+
quantity: C.quantity + 1
|
|
2477
|
+
}) : (i != null && i.products && await _(i.products), await m({
|
|
2420
2478
|
productId: c,
|
|
2421
2479
|
productVariantId: d,
|
|
2422
2480
|
quantity: 1
|
|
2423
|
-
})),
|
|
2481
|
+
})), h({
|
|
2424
2482
|
message: "Product added to cart",
|
|
2425
2483
|
status: "success"
|
|
2426
2484
|
});
|
|
2427
2485
|
}
|
|
2428
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2429
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2486
|
+
return /* @__PURE__ */ t.jsxs("div", { className: J.modal, children: [
|
|
2487
|
+
/* @__PURE__ */ t.jsxs("div", { className: J.header, children: [
|
|
2430
2488
|
/* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a variant" }),
|
|
2431
2489
|
/* @__PURE__ */ t.jsx(
|
|
2432
|
-
|
|
2490
|
+
b,
|
|
2433
2491
|
{
|
|
2434
2492
|
name: "X",
|
|
2435
2493
|
width: 24,
|
|
@@ -2440,36 +2498,36 @@ const Un = (o) => {
|
|
|
2440
2498
|
}
|
|
2441
2499
|
)
|
|
2442
2500
|
] }),
|
|
2443
|
-
|
|
2501
|
+
a.chargeTypes && a.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: J.chargeTypes, children: a.chargeTypes.map((d) => /* @__PURE__ */ t.jsx(
|
|
2444
2502
|
"div",
|
|
2445
2503
|
{
|
|
2446
|
-
className:
|
|
2447
|
-
[
|
|
2504
|
+
className: F(J.charge, {
|
|
2505
|
+
[J.chargeActive]: e === d
|
|
2448
2506
|
}),
|
|
2449
2507
|
onClick: () => n(d),
|
|
2450
2508
|
children: Ct[d]
|
|
2451
2509
|
},
|
|
2452
2510
|
d
|
|
2453
2511
|
)) }),
|
|
2454
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2455
|
-
var
|
|
2512
|
+
/* @__PURE__ */ t.jsx("div", { className: J.variants, children: s.map((d) => {
|
|
2513
|
+
var C, v;
|
|
2456
2514
|
return /* @__PURE__ */ t.jsxs(
|
|
2457
2515
|
"div",
|
|
2458
2516
|
{
|
|
2459
|
-
className:
|
|
2517
|
+
className: F(J.variant),
|
|
2460
2518
|
onClick: () => {
|
|
2461
|
-
|
|
2519
|
+
y(d.id), u(!1);
|
|
2462
2520
|
},
|
|
2463
2521
|
children: [
|
|
2464
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2465
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
2522
|
+
/* @__PURE__ */ t.jsxs("div", { className: J.variantInfo, children: [
|
|
2523
|
+
/* @__PURE__ */ t.jsx("span", { className: J.title, children: d.name }),
|
|
2466
2524
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
2467
2525
|
"$",
|
|
2468
2526
|
e === "ONE_TIME" ? d.price.amount : d.subscriptionSettings ? d.subscriptionSettings.price.amount : "Price Not Found"
|
|
2469
2527
|
] })
|
|
2470
2528
|
] }),
|
|
2471
|
-
/* @__PURE__ */ t.jsx("div", { children: e === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className:
|
|
2472
|
-
(
|
|
2529
|
+
/* @__PURE__ */ t.jsx("div", { children: e === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: J.stock, children: [
|
|
2530
|
+
(C = d.quantity.restrictions) != null && C.max || d.quantity.available !== void 0 ? ((v = d.quantity.restrictions) == null ? void 0 : v.max) || d.quantity.available : "∞",
|
|
2473
2531
|
" ",
|
|
2474
2532
|
"in stock"
|
|
2475
2533
|
] }) })
|
|
@@ -2479,16 +2537,16 @@ const Un = (o) => {
|
|
|
2479
2537
|
);
|
|
2480
2538
|
}) })
|
|
2481
2539
|
] });
|
|
2482
|
-
},
|
|
2540
|
+
}, $i = (o) => {
|
|
2483
2541
|
const { product: s, setIsOpen: e } = o;
|
|
2484
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2485
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2542
|
+
return /* @__PURE__ */ t.jsxs("div", { className: J.modal, children: [
|
|
2543
|
+
/* @__PURE__ */ t.jsxs("div", { className: J.header, children: [
|
|
2486
2544
|
/* @__PURE__ */ t.jsxs("div", { id: "h3", children: [
|
|
2487
2545
|
"Buy ",
|
|
2488
2546
|
Nt(s.name)
|
|
2489
2547
|
] }),
|
|
2490
2548
|
/* @__PURE__ */ t.jsx(
|
|
2491
|
-
|
|
2549
|
+
b,
|
|
2492
2550
|
{
|
|
2493
2551
|
name: "X",
|
|
2494
2552
|
width: 24,
|
|
@@ -2503,32 +2561,32 @@ const Un = (o) => {
|
|
|
2503
2561
|
}
|
|
2504
2562
|
)
|
|
2505
2563
|
] }),
|
|
2506
|
-
/* @__PURE__ */ t.jsx(
|
|
2564
|
+
/* @__PURE__ */ t.jsx(Yn, { ...s })
|
|
2507
2565
|
] });
|
|
2508
|
-
},
|
|
2509
|
-
wrapper:
|
|
2510
|
-
label:
|
|
2511
|
-
contentBorder:
|
|
2512
|
-
contentField:
|
|
2513
|
-
textarea:
|
|
2514
|
-
length:
|
|
2515
|
-
},
|
|
2566
|
+
}, wi = "_wrapper_1efqk_1", qi = "_label_1efqk_10", Bi = "_contentBorder_1efqk_19", Pi = "_contentField_1efqk_23", Ti = "_textarea_1efqk_27", Mi = "_length_1efqk_42", at = {
|
|
2567
|
+
wrapper: wi,
|
|
2568
|
+
label: qi,
|
|
2569
|
+
contentBorder: Bi,
|
|
2570
|
+
contentField: Pi,
|
|
2571
|
+
textarea: Ti,
|
|
2572
|
+
length: Mi
|
|
2573
|
+
}, Ji = (o) => {
|
|
2516
2574
|
const {
|
|
2517
2575
|
onChange: s,
|
|
2518
2576
|
label: e,
|
|
2519
2577
|
value: n,
|
|
2520
|
-
maxLength:
|
|
2578
|
+
maxLength: a,
|
|
2521
2579
|
placeholder: c = "Type something...",
|
|
2522
2580
|
type: u = "text"
|
|
2523
|
-
} = o, [r, m] =
|
|
2524
|
-
function B(
|
|
2525
|
-
return u === "number" ?
|
|
2581
|
+
} = o, [r, m] = f.useState(n.length), { themeSettings: _ } = zt();
|
|
2582
|
+
function B(h) {
|
|
2583
|
+
return u === "number" ? h.replace(/[^\d\n]+/g, "") : h;
|
|
2526
2584
|
}
|
|
2527
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2585
|
+
return /* @__PURE__ */ t.jsxs("div", { className: at.wrapper, children: [
|
|
2528
2586
|
e && /* @__PURE__ */ t.jsx(
|
|
2529
2587
|
"label",
|
|
2530
2588
|
{
|
|
2531
|
-
className:
|
|
2589
|
+
className: at.label,
|
|
2532
2590
|
htmlFor: e,
|
|
2533
2591
|
children: e
|
|
2534
2592
|
}
|
|
@@ -2538,63 +2596,64 @@ const Un = (o) => {
|
|
|
2538
2596
|
{
|
|
2539
2597
|
id: e,
|
|
2540
2598
|
value: n,
|
|
2541
|
-
onChange: (
|
|
2542
|
-
const
|
|
2543
|
-
m(
|
|
2599
|
+
onChange: (h) => {
|
|
2600
|
+
const i = B(h.target.value);
|
|
2601
|
+
m(i.length), s(i);
|
|
2544
2602
|
},
|
|
2545
2603
|
placeholder: c,
|
|
2546
|
-
className:
|
|
2547
|
-
[
|
|
2548
|
-
[
|
|
2604
|
+
className: F(at.textarea, {
|
|
2605
|
+
[at.contentBorder]: _.inputs.border.active,
|
|
2606
|
+
[at.contentField]: _.inputs.field.active
|
|
2549
2607
|
}),
|
|
2550
|
-
maxLength:
|
|
2608
|
+
maxLength: a
|
|
2551
2609
|
}
|
|
2552
2610
|
),
|
|
2553
|
-
|
|
2611
|
+
a && /* @__PURE__ */ t.jsxs("div", { className: at.length, children: [
|
|
2554
2612
|
r,
|
|
2555
2613
|
"/",
|
|
2556
|
-
|
|
2614
|
+
a
|
|
2557
2615
|
] })
|
|
2558
2616
|
] });
|
|
2559
2617
|
};
|
|
2560
2618
|
export {
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2619
|
+
Yi as Accordion,
|
|
2620
|
+
Ps as BurgerMenuButton,
|
|
2621
|
+
L as Button,
|
|
2622
|
+
bn as ButtonTypeSettings,
|
|
2623
|
+
zi as ButtonsSettings,
|
|
2624
|
+
Ri as CategorySettings,
|
|
2567
2625
|
Ct as ChargeTypes,
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2626
|
+
At as ChooseImage,
|
|
2627
|
+
ta as ChooseImageModal,
|
|
2628
|
+
qs as EmptyCart,
|
|
2629
|
+
Li as FormSettings,
|
|
2630
|
+
Vi as HeaderButtons,
|
|
2631
|
+
b as Icon,
|
|
2632
|
+
It as InputSettings,
|
|
2633
|
+
Rt as InputUI,
|
|
2634
|
+
ea as ItemsSettings,
|
|
2635
|
+
Ei as LayoutSettings,
|
|
2636
|
+
Wi as Link,
|
|
2637
|
+
Fi as ListingSelector,
|
|
2638
|
+
na as Loader,
|
|
2639
|
+
Qi as MetaInfoPost,
|
|
2582
2640
|
kt as Modal,
|
|
2583
|
-
|
|
2584
|
-
|
|
2641
|
+
Ui as PagesMobileMenu,
|
|
2642
|
+
Bs as PagesMobileModal,
|
|
2585
2643
|
Di as PagesSettings,
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2644
|
+
Gi as ProductCardButtons,
|
|
2645
|
+
Xi as ProductCardModal,
|
|
2646
|
+
Yn as ProductOptions,
|
|
2589
2647
|
St as RangeSelector,
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2648
|
+
it as Select,
|
|
2649
|
+
sa as SelectInfiniteList,
|
|
2650
|
+
Hi as ShareLink,
|
|
2651
|
+
$s as ShoppingButton,
|
|
2652
|
+
ws as ShoppingModalCart,
|
|
2653
|
+
ct as Switch,
|
|
2654
|
+
ia as TextSettings,
|
|
2655
|
+
aa as TextareaSettings,
|
|
2656
|
+
Ji as TextareaUI,
|
|
2657
|
+
oa as TypesText,
|
|
2658
|
+
Tt as UserInfo
|
|
2600
2659
|
};
|