@billgangcom/theme-lib 1.116.0 → 1.116.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builder-Bj8ViroH.js → builder-DUFJOYbB.js} +5 -5
- package/dist/{builder-CUCCG2gi.cjs → builder-DqDtctC5.cjs} +2 -2
- package/dist/{builder-components-D2219YPy.cjs → builder-components-D3Bb10J8.cjs} +1 -1
- package/dist/{builder-components-R1dTBy7D.js → builder-components-DzvQc6D4.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +22 -22
- package/dist/{charge-BrY_-ls8.cjs → charge-I1l9O9oW.cjs} +24 -24
- package/dist/{charge-Cti1lSP2.js → charge-JAW-QeMZ.js} +2014 -2001
- package/dist/{checkout-CTbZMuPC.js → checkout-BvcF30gE.js} +5 -5
- package/dist/{checkout-C-7bV9sk.cjs → checkout-CwhyZ4zD.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CUFJfAc6.js → index-BGpMbUmG.js} +1 -1
- package/dist/{index-CQm0i92r.cjs → index-Bfh9GkFs.cjs} +1 -1
- package/dist/{index-HhcLQjbw.cjs → index-BsM2kPyQ.cjs} +1 -1
- package/dist/{index-CILywG47.cjs → index-Cdm3FwGu.cjs} +1 -1
- package/dist/{index-CUnfTwF8.js → index-CyaRCiT9.js} +5 -5
- package/dist/{index-BBcZT0G2.js → index-DcWpxbHI.js} +5 -5
- package/dist/{index-O5YekXKo.cjs → index-DjnhbFh9.cjs} +1 -1
- package/dist/{index-OTW9ycHk.js → index-EjVO3qce.js} +5 -5
- package/dist/{index-B03fd16N.js → index-bsPNagUY.js} +5 -5
- package/dist/{index-xbQ-1j9f.cjs → index-dp4B_uob.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/{order-1lHCRSUw.js → order-BLPHbRzn.js} +121 -121
- package/dist/order-DN9oIA9o.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-DBjS-E8T.js → subscription-D0TYbXFf.js} +5 -5
- package/dist/{subscription-BS-hdxzD.cjs → subscription-r7qA65EX.cjs} +1 -1
- package/dist/{ticket-BtcmMwIl.js → ticket--uOANXoZ.js} +5 -5
- package/dist/{ticket-myEl0GYr.cjs → ticket-BivnxhDp.cjs} +1 -1
- package/dist/{top-up-DTVCb-zx.cjs → top-up-C13wralR.cjs} +1 -1
- package/dist/{top-up-DNSDJwN-.js → top-up-u1oUf64a.js} +5 -5
- package/dist/{ui-components-BR9v0VH1.cjs → ui-components-CC9DRvrZ.cjs} +1 -1
- package/dist/{ui-components-PK209o-T.js → ui-components-CqwUR9GH.js} +4 -4
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-D3uB6IO3.cjs → validation-BtrRWzoi.cjs} +1 -1
- package/dist/{validation-DgaNU463.js → validation-ekksqWOd.js} +5 -5
- package/package.json +1 -1
- package/dist/order-DNaXADFJ.cjs +0 -1
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import i, { useState as
|
|
3
|
-
import { X as
|
|
4
|
-
import { f as
|
|
5
|
-
import { M as
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket
|
|
1
|
+
import { jsx as o, Fragment as z, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import i, { useState as ee, useMemo as I } from "react";
|
|
3
|
+
import { X as te, p as J, M as oe, V as X, a7 as ne } from "./builder-DUFJOYbB.js";
|
|
4
|
+
import { f as ae, N as se, P as ce, O as ie, g as re, b as le, c as C, d as ue, e as de, h as me, i as he, j as pe, V as fe, k as _e, L as ge, T as ye, l as H, m as we, n as Se, o as ke } from "./charge-JAW-QeMZ.js";
|
|
5
|
+
import { M as ve, I as Y, g as V, e as Ce } from "./ui-components-CqwUR9GH.js";
|
|
6
|
+
import "./builder-components-DzvQc6D4.js";
|
|
7
|
+
import "./ticket--uOANXoZ.js";
|
|
8
8
|
import "react-dom";
|
|
9
|
-
const
|
|
10
|
-
const [n, c] = i.useState(null), [d, e] =
|
|
11
|
-
async function
|
|
9
|
+
const Ne = async (n = 1) => await ae({ PageNumber: n }), rt = () => {
|
|
10
|
+
const [n, c] = i.useState(null), [d, e] = ee(null), [_, N] = i.useState(0), { page: g } = te(), [k, l] = i.useState(!0);
|
|
11
|
+
async function v() {
|
|
12
12
|
l(!0);
|
|
13
|
-
const { list: y, totalCount: w } = await
|
|
14
|
-
c(y),
|
|
13
|
+
const { list: y, totalCount: w } = await Ne(g);
|
|
14
|
+
c(y), N(w), e(null), l(!1);
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
const y = (n == null ? void 0 : n.map((
|
|
16
|
+
async function m() {
|
|
17
|
+
const y = (n == null ? void 0 : n.map((b) => b.gatewayName)) || [], w = await re(y);
|
|
18
18
|
e(w);
|
|
19
19
|
}
|
|
20
20
|
return i.useEffect(() => {
|
|
21
|
-
!d && n &&
|
|
21
|
+
!d && n && m();
|
|
22
22
|
}, [n, d]), i.useEffect(() => {
|
|
23
|
-
|
|
24
|
-
}, [g]), /* @__PURE__ */ o(
|
|
25
|
-
|
|
23
|
+
v();
|
|
24
|
+
}, [g]), /* @__PURE__ */ o(z, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ o(
|
|
25
|
+
se,
|
|
26
26
|
{
|
|
27
27
|
title: "No Orders",
|
|
28
28
|
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
29
|
}
|
|
30
|
-
) : /* @__PURE__ */ r(
|
|
31
|
-
/* @__PURE__ */ o(
|
|
30
|
+
) : /* @__PURE__ */ r(z, { children: [
|
|
31
|
+
/* @__PURE__ */ o(ce, { title: "Orders" }),
|
|
32
32
|
/* @__PURE__ */ o(
|
|
33
|
-
|
|
33
|
+
ie,
|
|
34
34
|
{
|
|
35
35
|
orders: n,
|
|
36
36
|
gatewaysDetail: d,
|
|
37
37
|
totalCount: _,
|
|
38
|
-
isLoading:
|
|
38
|
+
isLoading: k
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] }) });
|
|
42
|
-
},
|
|
43
|
-
orderPage:
|
|
44
|
-
leftSection:
|
|
45
|
-
content:
|
|
46
|
-
main:
|
|
47
|
-
mainAntistock:
|
|
48
|
-
orderMainDataAntistock:
|
|
49
|
-
timelineBlockAntistock:
|
|
50
|
-
footerAntistock:
|
|
51
|
-
statusBlock:
|
|
42
|
+
}, be = "_orderPage_gc87l_1", Pe = "_leftSection_gc87l_15", De = "_content_gc87l_35", Oe = "_main_gc87l_42", Ae = "_mainAntistock_gc87l_56", Re = "_orderMainDataAntistock_gc87l_69", Me = "_timelineBlockAntistock_gc87l_81", Ie = "_footerAntistock_gc87l_92", Ve = "_statusBlock_gc87l_104", Be = "_timelineBlock_gc87l_81", $e = "_footer_gc87l_92", Fe = "_rightSection_gc87l_121", Te = "_header_gc87l_142", Le = "_productList_gc87l_150", Ee = "_mobileFooter_gc87l_157", We = "_loaderContainer_gc87l_166", xe = "_orderMainData_gc87l_69", qe = "_prices_gc87l_181", Ue = "_headerTitle_gc87l_185", je = "_headerDescription_gc87l_189", a = {
|
|
43
|
+
orderPage: be,
|
|
44
|
+
leftSection: Pe,
|
|
45
|
+
content: De,
|
|
46
|
+
main: Oe,
|
|
47
|
+
mainAntistock: Ae,
|
|
48
|
+
orderMainDataAntistock: Re,
|
|
49
|
+
timelineBlockAntistock: Me,
|
|
50
|
+
footerAntistock: Ie,
|
|
51
|
+
statusBlock: Ve,
|
|
52
52
|
timelineBlock: Be,
|
|
53
|
-
footer:
|
|
54
|
-
rightSection:
|
|
55
|
-
header:
|
|
56
|
-
productList:
|
|
57
|
-
mobileFooter:
|
|
58
|
-
loaderContainer:
|
|
59
|
-
orderMainData:
|
|
60
|
-
prices:
|
|
61
|
-
headerTitle:
|
|
62
|
-
headerDescription:
|
|
63
|
-
},
|
|
64
|
-
modalContent:
|
|
65
|
-
iconContainer:
|
|
66
|
-
warningIcon:
|
|
67
|
-
title:
|
|
68
|
-
description:
|
|
69
|
-
buttonContainer:
|
|
70
|
-
button:
|
|
71
|
-
},
|
|
53
|
+
footer: $e,
|
|
54
|
+
rightSection: Fe,
|
|
55
|
+
header: Te,
|
|
56
|
+
productList: Le,
|
|
57
|
+
mobileFooter: Ee,
|
|
58
|
+
loaderContainer: We,
|
|
59
|
+
orderMainData: xe,
|
|
60
|
+
prices: qe,
|
|
61
|
+
headerTitle: Ue,
|
|
62
|
+
headerDescription: je
|
|
63
|
+
}, Ge = "_modalContent_1a05n_1", ze = "_iconContainer_1a05n_16", He = "_warningIcon_1a05n_20", Je = "_title_1a05n_25", Xe = "_description_1a05n_33", Ye = "_buttonContainer_1a05n_40", Ke = "_button_1a05n_40", h = {
|
|
64
|
+
modalContent: Ge,
|
|
65
|
+
iconContainer: ze,
|
|
66
|
+
warningIcon: He,
|
|
67
|
+
title: Je,
|
|
68
|
+
description: Xe,
|
|
69
|
+
buttonContainer: Ye,
|
|
70
|
+
button: Ke
|
|
71
|
+
}, Qe = ({
|
|
72
72
|
isOpen: n,
|
|
73
73
|
onClose: c,
|
|
74
74
|
refundedAmount: d,
|
|
75
75
|
currency: e
|
|
76
76
|
}) => {
|
|
77
77
|
var D, O;
|
|
78
|
-
const _ =
|
|
78
|
+
const _ = J(), { token: N, shopDomain: g } = oe(), { isAntistock: k, general: l } = X(), v = !!((D = l == null ? void 0 : l.info) != null && D.disableSupport), m = (O = l == null ? void 0 : l.info) == null ? void 0 : O.thirdPartySupportUrl, y = !(v && !m), w = new Intl.NumberFormat("en-US", {
|
|
79
79
|
style: "currency",
|
|
80
80
|
currency: e
|
|
81
|
-
}),
|
|
82
|
-
_(
|
|
81
|
+
}), b = () => {
|
|
82
|
+
_(k ? "/account" : "/customer-dash");
|
|
83
83
|
}, u = async () => {
|
|
84
|
-
if (
|
|
85
|
-
window.open(
|
|
84
|
+
if (v && m) {
|
|
85
|
+
window.open(m);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
k ? window.open(`https://${g}/support`) : _("/contact");
|
|
89
89
|
}, s = () => {
|
|
90
90
|
c();
|
|
91
91
|
};
|
|
92
|
-
return n ? /* @__PURE__ */ o(
|
|
92
|
+
return n ? /* @__PURE__ */ o(ve, { close: c, children: /* @__PURE__ */ r(
|
|
93
93
|
"div",
|
|
94
94
|
{
|
|
95
|
-
className:
|
|
95
|
+
className: h.modalContent,
|
|
96
96
|
onClick: (A) => A.stopPropagation(),
|
|
97
97
|
children: [
|
|
98
|
-
/* @__PURE__ */ o("div", { className:
|
|
99
|
-
|
|
98
|
+
/* @__PURE__ */ o("div", { className: h.iconContainer, children: /* @__PURE__ */ o(
|
|
99
|
+
Y,
|
|
100
100
|
{
|
|
101
101
|
name: "WarningDiamond",
|
|
102
102
|
fill: "var(--text-warning)",
|
|
103
|
-
className:
|
|
103
|
+
className: h.warningIcon
|
|
104
104
|
}
|
|
105
105
|
) }),
|
|
106
|
-
/* @__PURE__ */ o("h2", { className:
|
|
107
|
-
/* @__PURE__ */ r("p", { className:
|
|
106
|
+
/* @__PURE__ */ o("h2", { className: h.title, children: "Partial Delivery Failure Refund" }),
|
|
107
|
+
/* @__PURE__ */ r("p", { className: h.description, children: [
|
|
108
108
|
"Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of",
|
|
109
109
|
" ",
|
|
110
110
|
w.format(d),
|
|
111
111
|
", to your account balance."
|
|
112
112
|
] }),
|
|
113
|
-
/* @__PURE__ */ r("div", { className:
|
|
114
|
-
!
|
|
115
|
-
|
|
113
|
+
/* @__PURE__ */ r("div", { className: h.buttonContainer, children: [
|
|
114
|
+
!N && /* @__PURE__ */ o(
|
|
115
|
+
V,
|
|
116
116
|
{
|
|
117
117
|
type: "Secondary",
|
|
118
|
-
onClick:
|
|
119
|
-
className:
|
|
118
|
+
onClick: b,
|
|
119
|
+
className: h.button,
|
|
120
120
|
children: "Login"
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
123
|
y && /* @__PURE__ */ o(
|
|
124
|
-
|
|
124
|
+
V,
|
|
125
125
|
{
|
|
126
126
|
type: "Secondary",
|
|
127
127
|
onClick: u,
|
|
128
|
-
className:
|
|
128
|
+
className: h.button,
|
|
129
129
|
children: "Contact Support"
|
|
130
130
|
}
|
|
131
131
|
),
|
|
132
132
|
/* @__PURE__ */ o(
|
|
133
|
-
|
|
133
|
+
V,
|
|
134
134
|
{
|
|
135
135
|
type: "Primary",
|
|
136
136
|
onClick: s,
|
|
137
|
-
className:
|
|
137
|
+
className: h.button,
|
|
138
138
|
children: "Continue"
|
|
139
139
|
}
|
|
140
140
|
)
|
|
@@ -142,26 +142,26 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
) }) : null;
|
|
145
|
-
},
|
|
145
|
+
}, Ze = () => {
|
|
146
146
|
var $, F, T, L, E, W, x, q, U;
|
|
147
|
-
const { id: n, accessToken: c } =
|
|
147
|
+
const { id: n, accessToken: c } = ne(), d = J(), [e, _] = i.useState(), [N, g] = i.useState(!1), [k, l] = i.useState(!1), [v, m] = i.useState(!1), [y, w] = i.useState(!1), b = le(), { isAntistock: u, general: s } = X(), D = (($ = e == null ? void 0 : e.rawPrice) == null ? void 0 : $.currency) || "USD", O = new Intl.NumberFormat("en-US", {
|
|
148
148
|
style: "currency",
|
|
149
149
|
currency: D
|
|
150
150
|
}), A = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
|
|
151
|
-
var
|
|
151
|
+
var P, M, S;
|
|
152
152
|
return {
|
|
153
|
-
id: (t == null ? void 0 :
|
|
153
|
+
id: Number((P = t.productWithVariant) == null ? void 0 : P.id) || 0,
|
|
154
154
|
image: t.productWithVariant.image,
|
|
155
155
|
name: (() => {
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
return !
|
|
156
|
+
var j, G;
|
|
157
|
+
const p = ((j = t.productWithVariant) == null ? void 0 : j.name) || "", f = ((G = t.productWithVariant) == null ? void 0 : G.variantName) || "";
|
|
158
|
+
return !p && !f ? "" : !f || p === f ? p : p ? `${p} (${f})` : f;
|
|
159
159
|
})(),
|
|
160
160
|
description: "",
|
|
161
161
|
price: {
|
|
162
162
|
quantity: t.quantity,
|
|
163
|
-
amount: ((
|
|
164
|
-
currency: (
|
|
163
|
+
amount: ((M = t.productWithVariant) == null ? void 0 : M.price.amount) || 0,
|
|
164
|
+
currency: (S = t.productWithVariant) == null ? void 0 : S.price.currency
|
|
165
165
|
},
|
|
166
166
|
deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
|
|
167
167
|
customerNote: t.customerNote,
|
|
@@ -171,15 +171,15 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
171
171
|
};
|
|
172
172
|
})) || [], [e]);
|
|
173
173
|
i.useEffect(() => {
|
|
174
|
-
e && (e.status ===
|
|
174
|
+
e && (e.status === C.FullDeliveryFailure || e.status === C.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && l(!0);
|
|
175
175
|
}, [e == null ? void 0 : e.status]);
|
|
176
|
-
const R = i.useCallback(async (t,
|
|
177
|
-
var
|
|
176
|
+
const R = i.useCallback(async (t, P, M = !1) => {
|
|
177
|
+
var p, f;
|
|
178
178
|
M || g(!0);
|
|
179
|
-
const { data:
|
|
180
|
-
g(!1),
|
|
179
|
+
const { data: S } = await (P ? ue(`${t}/${P}`) : de(t));
|
|
180
|
+
g(!1), S.status !== C.Completed && ((p = S.charge) == null ? void 0 : p.status) === me.NotPaid && d(`/charges/${(f = S.charge) == null ? void 0 : f.id}`, {
|
|
181
181
|
replace: !0
|
|
182
|
-
}), _(
|
|
182
|
+
}), _(S);
|
|
183
183
|
}, [d]);
|
|
184
184
|
i.useLayoutEffect(() => {
|
|
185
185
|
if (n && !c) {
|
|
@@ -195,22 +195,22 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
195
195
|
clearInterval(t);
|
|
196
196
|
};
|
|
197
197
|
}, [n, c, R]);
|
|
198
|
-
const
|
|
198
|
+
const K = I(() => !!(e != null && e.isApplicableForReplacement && (e.status === C.Completed || e.status === C.PartiallyDelivered || e.status === C.FullDeliveryFailure)), [e]), B = I(() => {
|
|
199
199
|
var t;
|
|
200
200
|
return !!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled && c);
|
|
201
|
-
}, [(F = s == null ? void 0 : s.info) == null ? void 0 : F.isVouchesEnabled, c]),
|
|
201
|
+
}, [(F = s == null ? void 0 : s.info) == null ? void 0 : F.isVouchesEnabled, c]), Q = I(() => {
|
|
202
202
|
var t;
|
|
203
203
|
return !!(!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !u);
|
|
204
|
-
}, [(T = s == null ? void 0 : s.info) == null ? void 0 : T.isVouchesEnabled, e == null ? void 0 : e.review, u]),
|
|
204
|
+
}, [(T = s == null ? void 0 : s.info) == null ? void 0 : T.isVouchesEnabled, e == null ? void 0 : e.review, u]), Z = I(() => {
|
|
205
205
|
var t;
|
|
206
206
|
return ((t = s == null ? void 0 : s.info) == null ? void 0 : t.domain) || window.location.hostname;
|
|
207
207
|
}, [(L = s == null ? void 0 : s.info) == null ? void 0 : L.domain]);
|
|
208
|
-
return
|
|
208
|
+
return N ? /* @__PURE__ */ o("div", { className: a.loaderContainer, children: /* @__PURE__ */ o(Ce, {}) }) : /* @__PURE__ */ r("div", { className: a.orderPage, children: [
|
|
209
209
|
/* @__PURE__ */ o("div", { className: a.leftSection, children: /* @__PURE__ */ r("div", { className: a.content, children: [
|
|
210
|
-
/* @__PURE__ */ o(
|
|
210
|
+
/* @__PURE__ */ o(he, {}),
|
|
211
211
|
e && /* @__PURE__ */ r("div", { className: `${a.main} ${u ? a.mainAntistock : ""}`, children: [
|
|
212
212
|
/* @__PURE__ */ o(
|
|
213
|
-
|
|
213
|
+
pe,
|
|
214
214
|
{
|
|
215
215
|
className: a.statusBlock,
|
|
216
216
|
orderStatus: e.status
|
|
@@ -221,15 +221,15 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
221
221
|
{
|
|
222
222
|
className: `${a.orderMainData} ${u ? a.orderMainDataAntistock : ""}`,
|
|
223
223
|
children: [
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
B && /* @__PURE__ */ o(
|
|
225
|
+
fe,
|
|
226
226
|
{
|
|
227
|
-
onAddMessage: () =>
|
|
227
|
+
onAddMessage: () => m(!0),
|
|
228
228
|
isSubmitted: y
|
|
229
229
|
}
|
|
230
230
|
),
|
|
231
231
|
/* @__PURE__ */ o(
|
|
232
|
-
|
|
232
|
+
_e,
|
|
233
233
|
{
|
|
234
234
|
lastUpdate: e.createdAt,
|
|
235
235
|
paymentType: (E = e.charge) == null ? void 0 : E.gateway,
|
|
@@ -237,8 +237,8 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
237
237
|
orderId: e.id
|
|
238
238
|
}
|
|
239
239
|
),
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
Q && e.review && /* @__PURE__ */ o(
|
|
241
|
+
ge,
|
|
242
242
|
{
|
|
243
243
|
orderId: e.id,
|
|
244
244
|
review: e.review
|
|
@@ -248,14 +248,14 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
248
248
|
}
|
|
249
249
|
),
|
|
250
250
|
e.charge && e.charge.timeline && /* @__PURE__ */ o(
|
|
251
|
-
|
|
251
|
+
ye,
|
|
252
252
|
{
|
|
253
253
|
className: `${a.timelineBlock} ${u ? a.timelineBlockAntistock : ""}`,
|
|
254
254
|
timeline: e.charge.timeline
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
/* @__PURE__ */ o(
|
|
258
|
-
|
|
258
|
+
H,
|
|
259
259
|
{
|
|
260
260
|
className: `${a.footer} ${u ? a.footerAntistock : ""}`
|
|
261
261
|
}
|
|
@@ -274,10 +274,10 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
274
274
|
e.charge.description && /* @__PURE__ */ o("p", { className: a.headerDescription, children: e.charge.description })
|
|
275
275
|
] }),
|
|
276
276
|
u ? null : /* @__PURE__ */ r(
|
|
277
|
-
|
|
277
|
+
V,
|
|
278
278
|
{
|
|
279
279
|
type: "Secondary",
|
|
280
|
-
onClick: () =>
|
|
280
|
+
onClick: () => b((e == null ? void 0 : e.id) || ""),
|
|
281
281
|
style: {
|
|
282
282
|
whiteSpace: "nowrap",
|
|
283
283
|
display: "flex",
|
|
@@ -285,7 +285,7 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
285
285
|
gap: "4px"
|
|
286
286
|
},
|
|
287
287
|
children: [
|
|
288
|
-
/* @__PURE__ */ o(
|
|
288
|
+
/* @__PURE__ */ o(Y, { name: "Copy" }),
|
|
289
289
|
/* @__PURE__ */ o("span", { children: "Copy ID" })
|
|
290
290
|
]
|
|
291
291
|
}
|
|
@@ -293,11 +293,11 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
293
293
|
] }),
|
|
294
294
|
/* @__PURE__ */ r("div", { children: [
|
|
295
295
|
/* @__PURE__ */ o("div", { className: a.productList, children: A.map((t) => /* @__PURE__ */ o(
|
|
296
|
-
|
|
296
|
+
we,
|
|
297
297
|
{
|
|
298
298
|
product: t,
|
|
299
299
|
isOrder: !0,
|
|
300
|
-
isApplicableForReplacement:
|
|
300
|
+
isApplicableForReplacement: K,
|
|
301
301
|
orderId: n,
|
|
302
302
|
accessToken: c,
|
|
303
303
|
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
@@ -305,7 +305,7 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
305
305
|
t.id
|
|
306
306
|
)) }),
|
|
307
307
|
u ? null : /* @__PURE__ */ o(
|
|
308
|
-
|
|
308
|
+
Se,
|
|
309
309
|
{
|
|
310
310
|
formatter: O,
|
|
311
311
|
coupon: null,
|
|
@@ -316,40 +316,40 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
|
|
|
316
316
|
isShowSubtotal: !1
|
|
317
317
|
}
|
|
318
318
|
),
|
|
319
|
-
/* @__PURE__ */ o(
|
|
319
|
+
/* @__PURE__ */ o(H, { className: a.mobileFooter })
|
|
320
320
|
] })
|
|
321
321
|
] })
|
|
322
322
|
}
|
|
323
323
|
),
|
|
324
324
|
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ o(
|
|
325
|
-
|
|
325
|
+
Qe,
|
|
326
326
|
{
|
|
327
|
-
isOpen:
|
|
327
|
+
isOpen: k,
|
|
328
328
|
onClose: () => l(!1),
|
|
329
329
|
refundedAmount: e.refundedPrice.amount,
|
|
330
330
|
currency: e.refundedPrice.currency
|
|
331
331
|
}
|
|
332
332
|
),
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
B && /* @__PURE__ */ o(
|
|
334
|
+
ke,
|
|
335
335
|
{
|
|
336
|
-
isOpen:
|
|
337
|
-
onClose: () =>
|
|
336
|
+
isOpen: v,
|
|
337
|
+
onClose: () => m(!1),
|
|
338
338
|
products: A,
|
|
339
339
|
orderId: n,
|
|
340
340
|
accessToken: c,
|
|
341
|
-
shopDomain:
|
|
341
|
+
shopDomain: Z,
|
|
342
342
|
onSuccess: () => {
|
|
343
|
-
w(!0),
|
|
343
|
+
w(!0), m(!1), n && R(n, c, !0);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
)
|
|
347
347
|
] });
|
|
348
|
-
},
|
|
348
|
+
}, lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
349
349
|
__proto__: null,
|
|
350
|
-
OrderPage:
|
|
350
|
+
OrderPage: Ze
|
|
351
351
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
352
352
|
export {
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
rt as O,
|
|
354
|
+
lt as i
|
|
355
355
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("react"),k=require("./builder-DqDtctC5.cjs"),o=require("./charge-I1l9O9oW.cjs"),_=require("./ui-components-CC9DRvrZ.cjs");require("./builder-components-D3Bb10J8.cjs");require("./ticket-BivnxhDp.cjs");require("react-dom");const J=async(n=1)=>await o.fetchOrders({PageNumber:n}),Y=()=>{const[n,r]=i.useState(null),[d,e]=i.useState(null),[g,v]=i.useState(0),{page:y}=k.usePaginationPagesStore(),[C,l]=i.useState(!0);async function j(){l(!0);const{list:S,totalCount:w}=await J(y);r(S),v(w),e(null),l(!1)}async function m(){const S=(n==null?void 0:n.map(N=>N.gatewayName))||[],w=await o.getGatewaysDetail(S);e(w)}return i.useEffect(()=>{!d&&n&&m()},[n,d]),i.useEffect(()=>{j()},[y]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(o.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):t.jsxs(t.Fragment,{children:[t.jsx(o.PageTitle,{title:"Orders"}),t.jsx(o.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:g,isLoading:C})]})})},K="_orderPage_gc87l_1",Q="_leftSection_gc87l_15",X="_content_gc87l_35",Z="_main_gc87l_42",ee="_mainAntistock_gc87l_56",te="_orderMainDataAntistock_gc87l_69",se="_timelineBlockAntistock_gc87l_81",ne="_footerAntistock_gc87l_92",oe="_statusBlock_gc87l_104",ae="_timelineBlock_gc87l_81",ce="_footer_gc87l_92",ie="_rightSection_gc87l_121",re="_header_gc87l_142",le="_productList_gc87l_150",ue="_mobileFooter_gc87l_157",de="_loaderContainer_gc87l_166",me="_orderMainData_gc87l_69",he="_prices_gc87l_181",pe="_headerTitle_gc87l_185",fe="_headerDescription_gc87l_189",a={orderPage:K,leftSection:Q,content:X,main:Z,mainAntistock:ee,orderMainDataAntistock:te,timelineBlockAntistock:se,footerAntistock:ne,statusBlock:oe,timelineBlock:ae,footer:ce,rightSection:ie,header:re,productList:le,mobileFooter:ue,loaderContainer:de,orderMainData:me,prices:he,headerTitle:pe,headerDescription:fe},_e="_modalContent_1a05n_1",ge="_iconContainer_1a05n_16",ye="_warningIcon_1a05n_20",Se="_title_1a05n_25",we="_description_1a05n_33",xe="_buttonContainer_1a05n_40",ke="_button_1a05n_40",h={modalContent:_e,iconContainer:ge,warningIcon:ye,title:Se,description:we,buttonContainer:xe,button:ke},Ce=({isOpen:n,onClose:r,refundedAmount:d,currency:e})=>{var O,D;const g=k.useNavigate(),{token:v,shopDomain:y}=k.useStorefrontStore(),{isAntistock:C,general:l}=k.useGeneralStore(),j=!!((O=l==null?void 0:l.info)!=null&&O.disableSupport),m=(D=l==null?void 0:l.info)==null?void 0:D.thirdPartySupportUrl,S=!(j&&!m),w=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),N=()=>{g(C?"/account":"/customer-dash")},u=async()=>{if(j&&m){window.open(m);return}C?window.open(`https://${y}/support`):g("/contact")},c=()=>{r()};return n?t.jsx(_.Modal,{close:r,children:t.jsxs("div",{className:h.modalContent,onClick:P=>P.stopPropagation(),children:[t.jsx("div",{className:h.iconContainer,children:t.jsx(_.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:h.warningIcon})}),t.jsx("h2",{className:h.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:h.description,children:["Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of"," ",w.format(d),", to your account balance."]}),t.jsxs("div",{className:h.buttonContainer,children:[!v&&t.jsx(_.Button,{type:"Secondary",onClick:N,className:h.button,children:"Login"}),S&&t.jsx(_.Button,{type:"Secondary",onClick:u,className:h.button,children:"Contact Support"}),t.jsx(_.Button,{type:"Primary",onClick:c,className:h.button,children:"Continue"})]})]})}):null},je=()=>{var I,B,F,V,$,T,q,L,E;const{id:n,accessToken:r}=k.useParams(),d=k.useNavigate(),[e,g]=i.useState(),[v,y]=i.useState(!1),[C,l]=i.useState(!1),[j,m]=i.useState(!1),[S,w]=i.useState(!1),N=o.useCopy(),{isAntistock:u,general:c}=k.useGeneralStore(),O=((I=e==null?void 0:e.rawPrice)==null?void 0:I.currency)||"USD",D=new Intl.NumberFormat("en-US",{style:"currency",currency:O}),P=i.useMemo(()=>(e==null?void 0:e.partOrders.map(s=>{var b,R,x;return{id:Number((b=s.productWithVariant)==null?void 0:b.id)||0,image:s.productWithVariant.image,name:(()=>{var W,U;const p=((W=s.productWithVariant)==null?void 0:W.name)||"",f=((U=s.productWithVariant)==null?void 0:U.variantName)||"";return!p&&!f?"":!f||p===f?p:p?`${p} (${f})`:f})(),description:"",price:{quantity:s.quantity,amount:((R=s.productWithVariant)==null?void 0:R.price.amount)||0,currency:(x=s.productWithVariant)==null?void 0:x.price.currency},deliveryCategories:"deliveryCategories"in s?s.deliveryCategories:void 0,customerNote:s.customerNote,chargeType:s.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in s?s.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in s?s.allowedReplacementReasons:void 0}}))||[],[e]);i.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&l(!0)},[e==null?void 0:e.status]);const A=i.useCallback(async(s,b,R=!1)=>{var p,f;R||y(!0);const{data:x}=await(b?o.fetchAuthorizedOrder(`${s}/${b}`):o.fetchOrder(s));y(!1),x.status!==o.OrderStatus.Completed&&((p=x.charge)==null?void 0:p.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(f=x.charge)==null?void 0:f.id}`,{replace:!0}),g(x)},[d]);i.useLayoutEffect(()=>{if(n&&!r){const s=JSON.parse(localStorage.getItem("orders")||"{}");s[n]&&d(`/orders/${n}/${s[n].fullAccessToken}`)}},[n,r,d]),i.useEffect(()=>{n&&A(n,r,!0);const s=setInterval(()=>{n&&A(n,r,!0)},5e3);return()=>{clearInterval(s)}},[n,r,A]);const G=i.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]),M=i.useMemo(()=>{var s;return!!((s=c==null?void 0:c.info)!=null&&s.isVouchesEnabled&&r)},[(B=c==null?void 0:c.info)==null?void 0:B.isVouchesEnabled,r]),z=i.useMemo(()=>{var s;return!!(!((s=c==null?void 0:c.info)!=null&&s.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(F=c==null?void 0:c.info)==null?void 0:F.isVouchesEnabled,e==null?void 0:e.review,u]),H=i.useMemo(()=>{var s;return((s=c==null?void 0:c.info)==null?void 0:s.domain)||window.location.hostname},[(V=c==null?void 0:c.info)==null?void 0:V.domain]);return v?t.jsx("div",{className:a.loaderContainer,children:t.jsx(_.Loader,{})}):t.jsxs("div",{className:a.orderPage,children:[t.jsx("div",{className:a.leftSection,children:t.jsxs("div",{className:a.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${a.main} ${u?a.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:a.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${a.orderMainData} ${u?a.orderMainDataAntistock:""}`,children:[M&&t.jsx(o.VouchCard,{onAddMessage:()=>m(!0),isSubmitted:S}),t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:($=e.charge)==null?void 0:$.gateway,email:e.customer?e.customer.email:((T=e.charge)==null?void 0:T.customerForCharge.email)||"",orderId:e.id}),z&&e.review&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${a.timelineBlock} ${u?a.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${a.footer} ${u?a.footerAntistock:""}`})]})]})}),t.jsx("div",{className:a.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:a.content,children:[((q=e==null?void 0:e.charge)==null?void 0:q.name)&&t.jsxs("header",{className:a.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:a.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:a.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(_.Button,{type:"Secondary",onClick:()=>N((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(_.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:a.productList,children:P.map(s=>t.jsx(o.CheckoutProduct,{product:s,isOrder:!0,isApplicableForReplacement:G,orderId:n,accessToken:r,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},s.id))}),u?null:t.jsx(o.CheckoutPrices,{formatter:D,coupon:null,total:((L=e==null?void 0:e.endPrice)==null?void 0:L.amount)||0,discount:0,totalWithDiscount:((E=e==null?void 0:e.endPrice)==null?void 0:E.amount)||0,className:a.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:a.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(Ce,{isOpen:C,onClose:()=>l(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),M&&t.jsx(o.VouchModal,{isOpen:j,onClose:()=>m(!1),products:P,orderId:n,accessToken:r,shopDomain:H,onSuccess:()=>{w(!0),m(!1),n&&A(n,r,!0)}})]})},ve=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:je},Symbol.toStringTag,{value:"Module"}));exports.Orders=Y;exports.index=ve;
|