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