@billgangcom/theme-lib 1.63.0 → 1.65.0

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