@storepecker/storefront-core 1.2.0 → 2.1.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/api/index.cjs +76 -75
- package/dist/api/index.d.cts +5 -3
- package/dist/api/index.d.ts +5 -3
- package/dist/api/index.js +9 -8
- package/dist/{booking-CegE1cje.d.ts → booking-BgZoXUBv.d.cts} +2 -41
- package/dist/{booking-B21s0inO.d.cts → booking-CZ59BXk3.d.ts} +2 -41
- package/dist/cart-BY8D8w-s.d.cts +90 -0
- package/dist/cart-GuhgeBBt.d.ts +90 -0
- package/dist/checkout/index.cjs +38 -37
- package/dist/checkout/index.d.cts +2 -1
- package/dist/checkout/index.d.ts +2 -1
- package/dist/checkout/index.js +6 -5
- package/dist/{chunk-34KV265H.cjs → chunk-26A3EBZI.cjs} +20 -20
- package/dist/chunk-2AHH3XBW.cjs +47 -0
- package/dist/{chunk-K5B62JZO.cjs → chunk-47XTPPII.cjs} +4 -4
- package/dist/chunk-4C4NTH6O.js +41 -0
- package/dist/{chunk-UM24VDYB.js → chunk-7R2V4C7Q.js} +2 -2
- package/dist/{chunk-CSISWBZZ.js → chunk-B7FOXIZN.js} +1 -1
- package/dist/chunk-BBRB475I.cjs +43 -0
- package/dist/chunk-BBRXE57K.cjs +50 -0
- package/dist/{chunk-QCQCFYYR.js → chunk-BHOXJGIE.js} +1 -1
- package/dist/chunk-BQ256JKN.js +39 -0
- package/dist/{chunk-7UH6REGV.js → chunk-C7ZJZEEN.js} +1 -1
- package/dist/{chunk-A6IO3HIN.cjs → chunk-FMHR5ABF.cjs} +28 -28
- package/dist/{chunk-JHGXIIBZ.cjs → chunk-G3R7ZVAG.cjs} +7 -7
- package/dist/{chunk-4MJMNIAB.js → chunk-GHABOHLA.js} +1 -1
- package/dist/chunk-GTV42PDK.cjs +46 -0
- package/dist/chunk-HEFA67WK.js +42 -0
- package/dist/chunk-HSF2D56O.js +40 -0
- package/dist/{chunk-GB3HW6DM.js → chunk-JWKDXFS4.js} +1 -1
- package/dist/{chunk-KWKHHRRJ.cjs → chunk-KKQKHG26.cjs} +3 -3
- package/dist/{chunk-QM73PI5L.cjs → chunk-N3ZCCKXV.cjs} +10 -10
- package/dist/{chunk-GQTO5ZE2.cjs → chunk-NE3ZHELZ.cjs} +0 -46
- package/dist/chunk-PWYWNRVO.cjs +150 -0
- package/dist/{chunk-E7WPE3PV.js → chunk-QAC72HKO.js} +1 -1
- package/dist/{chunk-CFF632IQ.cjs → chunk-SMHJRNCR.cjs} +4 -4
- package/dist/chunk-UOFTDL4D.js +146 -0
- package/dist/chunk-WEMNXIRS.js +47 -0
- package/dist/{chunk-LC5ZAUKL.cjs → chunk-XLQAALMU.cjs} +10 -10
- package/dist/{chunk-Z7LHRD3V.js → chunk-Y6NFUWTH.js} +3 -3
- package/dist/{chunk-LBGIUNM6.js → chunk-YY77CUWX.js} +1 -1
- package/dist/{chunk-UXLUE3HW.cjs → chunk-ZO2HREQL.cjs} +2 -2
- package/dist/collections-CenI9AlQ.d.cts +40 -0
- package/dist/collections-CenI9AlQ.d.ts +40 -0
- package/dist/components/index.cjs +126 -7
- package/dist/components/index.d.cts +35 -8
- package/dist/components/index.d.ts +35 -8
- package/dist/components/index.js +122 -7
- package/dist/hooks/index.cjs +368 -27
- package/dist/hooks/index.d.cts +83 -3
- package/dist/hooks/index.d.ts +83 -3
- package/dist/hooks/index.js +352 -14
- package/dist/middleware/index.cjs +47 -0
- package/dist/middleware/index.d.cts +8 -0
- package/dist/middleware/index.d.ts +8 -0
- package/dist/middleware/index.js +44 -0
- package/dist/models/index.d.cts +5 -3
- package/dist/models/index.d.ts +5 -3
- package/dist/{cart-VaCKkJ1C.d.cts → product-Dfi0ke-4.d.cts} +1 -88
- package/dist/{cart-VaCKkJ1C.d.ts → product-Dfi0ke-4.d.ts} +1 -88
- package/dist/store/index.cjs +17 -85
- package/dist/store/index.d.cts +22 -2
- package/dist/store/index.d.ts +22 -2
- package/dist/store/index.js +7 -82
- package/dist/utils/index.cjs +80 -65
- package/dist/utils/index.d.cts +72 -7
- package/dist/utils/index.d.ts +72 -7
- package/dist/utils/index.js +20 -43
- package/dist/{wishlist-FG8tgn76.d.ts → wishlist-DHOvXmJj.d.cts} +1 -1
- package/dist/{wishlist-CkAhLpbI.d.cts → wishlist-LfdFxddw.d.ts} +1 -1
- package/package.json +24 -5
- package/dist/chunk-7DQIKSGY.js +0 -40
- package/dist/chunk-FLBJKM6G.js +0 -83
- package/dist/chunk-S3WIGYDS.cjs +0 -42
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { d as SLICE_STATUS, c as ProductDetail } from './product-Dfi0ke-4.js';
|
|
2
|
+
|
|
3
|
+
declare namespace Category {
|
|
4
|
+
interface Root {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
photo: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
description: string;
|
|
10
|
+
children?: Root[];
|
|
11
|
+
}
|
|
12
|
+
interface CategoriesState {
|
|
13
|
+
data: Root[];
|
|
14
|
+
status: SLICE_STATUS;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type DiscountType = "discount";
|
|
19
|
+
type ValueType = "percentage" | "fixed";
|
|
20
|
+
type ApplicableTarget = "product_category" | "product_variant" | "product_bundle" | "customer";
|
|
21
|
+
type CouponStatus = "active" | "inactive" | "expired";
|
|
22
|
+
interface Coupon {
|
|
23
|
+
id: number;
|
|
24
|
+
coupon_code: string;
|
|
25
|
+
discount_type: DiscountType;
|
|
26
|
+
value: string;
|
|
27
|
+
value_type: ValueType;
|
|
28
|
+
min_order_amount: string;
|
|
29
|
+
max_discount_amount: string;
|
|
30
|
+
start_date: string;
|
|
31
|
+
end_date: string;
|
|
32
|
+
status: CouponStatus;
|
|
33
|
+
is_deleted: boolean;
|
|
34
|
+
usage_limit: number;
|
|
35
|
+
usage_count: number;
|
|
36
|
+
applicable_target: ApplicableTarget;
|
|
37
|
+
applicable_product_variants: any[];
|
|
38
|
+
applicable_product_bundles: any[];
|
|
39
|
+
applicable_product_categories: Category.Root[];
|
|
40
|
+
applicable_customers: any[];
|
|
41
|
+
auto_apply: boolean;
|
|
42
|
+
created_at: string;
|
|
43
|
+
updated_at: string;
|
|
44
|
+
is_cart_applicable: boolean;
|
|
45
|
+
coupon_message: string;
|
|
46
|
+
}
|
|
47
|
+
type Coupons = Coupon[];
|
|
48
|
+
interface CouponResponse {
|
|
49
|
+
coupon: Coupon;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface CartState {
|
|
53
|
+
cart: Cart.Root | null;
|
|
54
|
+
status: SLICE_STATUS;
|
|
55
|
+
}
|
|
56
|
+
declare namespace Cart {
|
|
57
|
+
interface Root {
|
|
58
|
+
product_variants: ProductDetail.Root[];
|
|
59
|
+
total_amount: number;
|
|
60
|
+
total_quantity: number;
|
|
61
|
+
products_quantity: ProductsQuantity;
|
|
62
|
+
cart_count: number;
|
|
63
|
+
missing_items: Array<any>;
|
|
64
|
+
customization_inputs: Array<CustomizationInput>;
|
|
65
|
+
total_coupon_discount: number;
|
|
66
|
+
variant_discounts: {
|
|
67
|
+
[key: number]: number;
|
|
68
|
+
};
|
|
69
|
+
total_shipping: number;
|
|
70
|
+
total_tax_amount: number;
|
|
71
|
+
applied_coupon: Coupon | {};
|
|
72
|
+
}
|
|
73
|
+
interface CustomizationInput {
|
|
74
|
+
id: number;
|
|
75
|
+
product_variant: number;
|
|
76
|
+
customization_option: number;
|
|
77
|
+
customer_wishlist: null;
|
|
78
|
+
customer_order: null;
|
|
79
|
+
customer_cart: number;
|
|
80
|
+
customer_input: string;
|
|
81
|
+
customization_option_name: string;
|
|
82
|
+
customization_option_type: string;
|
|
83
|
+
is_mandatory: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface ProductsQuantity {
|
|
86
|
+
[key: number]: number;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { type ApplicableTarget as A, Cart as C, type DiscountType as D, type ValueType as V, type CartState as a, Category as b, type Coupon as c, type CouponResponse as d, type CouponStatus as e, type Coupons as f };
|
package/dist/checkout/index.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkXLQAALMU_cjs = require('../chunk-XLQAALMU.cjs');
|
|
4
|
+
var chunkFMHR5ABF_cjs = require('../chunk-FMHR5ABF.cjs');
|
|
5
5
|
var chunkK44JZ5NL_cjs = require('../chunk-K44JZ5NL.cjs');
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
6
|
+
var chunk47XTPPII_cjs = require('../chunk-47XTPPII.cjs');
|
|
7
|
+
require('../chunk-ZO2HREQL.cjs');
|
|
8
|
+
require('../chunk-BBRXE57K.cjs');
|
|
9
|
+
require('../chunk-NE3ZHELZ.cjs');
|
|
9
10
|
require('../chunk-N3CTXRFT.cjs');
|
|
10
11
|
|
|
11
12
|
// src/checkout/cart-calculations.ts
|
|
@@ -47,7 +48,7 @@ function calculateCartTotals(cart) {
|
|
|
47
48
|
// src/checkout/payment-status.ts
|
|
48
49
|
async function checkPhonepeReturnStatus(transactionId, callbacks) {
|
|
49
50
|
try {
|
|
50
|
-
const response = await
|
|
51
|
+
const response = await chunkFMHR5ABF_cjs.checkPhonepePaymentStatus(transactionId);
|
|
51
52
|
if (response.data.success) {
|
|
52
53
|
callbacks.onSuccess(void 0);
|
|
53
54
|
} else {
|
|
@@ -60,8 +61,8 @@ async function checkPhonepeReturnStatus(transactionId, callbacks) {
|
|
|
60
61
|
async function checkPhonepeReturnStatusWithOrder(transactionId, orderNumber, callbacks) {
|
|
61
62
|
try {
|
|
62
63
|
const [paymentResponse, orderResponse] = await Promise.all([
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
chunkFMHR5ABF_cjs.checkPhonepePaymentStatus(transactionId),
|
|
65
|
+
chunkFMHR5ABF_cjs.getOrderDetailsByNumber(orderNumber)
|
|
65
66
|
]);
|
|
66
67
|
const order = orderResponse.data;
|
|
67
68
|
callbacks.onOrderLoaded?.(order);
|
|
@@ -78,12 +79,12 @@ async function checkPhonepeReturnStatusWithOrder(transactionId, orderNumber, cal
|
|
|
78
79
|
}
|
|
79
80
|
async function checkStripeReturnStatus(sessionId, orderNumber, paymentLinkUrl, callbacks, options) {
|
|
80
81
|
try {
|
|
81
|
-
const getStatus = options?.isPublic ?
|
|
82
|
+
const getStatus = options?.isPublic ? chunkFMHR5ABF_cjs.getStripePaymentStatusPublic : chunkFMHR5ABF_cjs.getStripePaymentStatus;
|
|
82
83
|
const response = await getStatus(sessionId, orderNumber, paymentLinkUrl);
|
|
83
84
|
const data = response.data;
|
|
84
85
|
if (data.payment_status === "paid" || data.status === "complete") {
|
|
85
86
|
try {
|
|
86
|
-
const orderResponse = await
|
|
87
|
+
const orderResponse = await chunkFMHR5ABF_cjs.getOrderDetailsByNumber(orderNumber);
|
|
87
88
|
const order = orderResponse.data;
|
|
88
89
|
callbacks.onOrderLoaded?.(order);
|
|
89
90
|
chunkK44JZ5NL_cjs.pixelEvents.purchase(order);
|
|
@@ -101,10 +102,10 @@ async function checkStripeReturnStatus(sessionId, orderNumber, paymentLinkUrl, c
|
|
|
101
102
|
}
|
|
102
103
|
async function checkTabbyReturnStatus(orderNumber, callbacks) {
|
|
103
104
|
try {
|
|
104
|
-
const response = await
|
|
105
|
+
const response = await chunkFMHR5ABF_cjs.verifyTabbyPayment(orderNumber);
|
|
105
106
|
if (response.data.order_status === "paid" || response.data.order_status === "confirmed") {
|
|
106
107
|
try {
|
|
107
|
-
const orderResponse = await
|
|
108
|
+
const orderResponse = await chunkFMHR5ABF_cjs.getOrderDetailsByNumber(orderNumber);
|
|
108
109
|
const order = orderResponse.data;
|
|
109
110
|
callbacks.onOrderLoaded?.(order);
|
|
110
111
|
chunkK44JZ5NL_cjs.pixelEvents.purchase(order);
|
|
@@ -123,103 +124,103 @@ async function checkTabbyReturnStatus(orderNumber, callbacks) {
|
|
|
123
124
|
|
|
124
125
|
Object.defineProperty(exports, "applyCheckoutCoupon", {
|
|
125
126
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkXLQAALMU_cjs.applyCheckoutCoupon; }
|
|
127
128
|
});
|
|
128
129
|
Object.defineProperty(exports, "fetchAppliedCoupon", {
|
|
129
130
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkXLQAALMU_cjs.fetchAppliedCoupon; }
|
|
131
132
|
});
|
|
132
133
|
Object.defineProperty(exports, "fetchAvailableCoupons", {
|
|
133
134
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkXLQAALMU_cjs.fetchAvailableCoupons; }
|
|
135
136
|
});
|
|
136
137
|
Object.defineProperty(exports, "handleCODPayment", {
|
|
137
138
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkXLQAALMU_cjs.handleCODPayment; }
|
|
139
140
|
});
|
|
140
141
|
Object.defineProperty(exports, "handlePhonepePayment", {
|
|
141
142
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkXLQAALMU_cjs.handlePhonepePayment; }
|
|
143
144
|
});
|
|
144
145
|
Object.defineProperty(exports, "handleRazorpayFail", {
|
|
145
146
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkXLQAALMU_cjs.handleRazorpayFail; }
|
|
147
148
|
});
|
|
148
149
|
Object.defineProperty(exports, "handleRazorpaySuccess", {
|
|
149
150
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkXLQAALMU_cjs.handleRazorpaySuccess; }
|
|
151
152
|
});
|
|
152
153
|
Object.defineProperty(exports, "handleStripePayment", {
|
|
153
154
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkXLQAALMU_cjs.handleStripePayment; }
|
|
155
156
|
});
|
|
156
157
|
Object.defineProperty(exports, "handleStripeSuccess", {
|
|
157
158
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkXLQAALMU_cjs.handleStripeSuccess; }
|
|
159
160
|
});
|
|
160
161
|
Object.defineProperty(exports, "handleTabbyPayment", {
|
|
161
162
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkXLQAALMU_cjs.handleTabbyPayment; }
|
|
163
164
|
});
|
|
164
165
|
Object.defineProperty(exports, "openRazorpayCheckout", {
|
|
165
166
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkXLQAALMU_cjs.openRazorpayCheckout; }
|
|
167
168
|
});
|
|
168
169
|
Object.defineProperty(exports, "processPayment", {
|
|
169
170
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkXLQAALMU_cjs.processPayment; }
|
|
171
172
|
});
|
|
172
173
|
Object.defineProperty(exports, "removeCheckoutCoupon", {
|
|
173
174
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
175
|
+
get: function () { return chunkXLQAALMU_cjs.removeCheckoutCoupon; }
|
|
175
176
|
});
|
|
176
177
|
Object.defineProperty(exports, "IP_API_CACHE_KEY", {
|
|
177
178
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunk47XTPPII_cjs.IP_API_CACHE_KEY; }
|
|
179
180
|
});
|
|
180
181
|
Object.defineProperty(exports, "addressFormInitialValues", {
|
|
181
182
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunk47XTPPII_cjs.addressFormInitialValues; }
|
|
183
184
|
});
|
|
184
185
|
Object.defineProperty(exports, "addressValidationSchema", {
|
|
185
186
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunk47XTPPII_cjs.addressValidationSchema; }
|
|
187
188
|
});
|
|
188
189
|
Object.defineProperty(exports, "buildAddressPayload", {
|
|
189
190
|
enumerable: true,
|
|
190
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunk47XTPPII_cjs.buildAddressPayload; }
|
|
191
192
|
});
|
|
192
193
|
Object.defineProperty(exports, "buildSubmitPayload", {
|
|
193
194
|
enumerable: true,
|
|
194
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunk47XTPPII_cjs.buildSubmitPayload; }
|
|
195
196
|
});
|
|
196
197
|
Object.defineProperty(exports, "clearAddressFormSession", {
|
|
197
198
|
enumerable: true,
|
|
198
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunk47XTPPII_cjs.clearAddressFormSession; }
|
|
199
200
|
});
|
|
200
201
|
Object.defineProperty(exports, "decodeAddress", {
|
|
201
202
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
203
|
+
get: function () { return chunk47XTPPII_cjs.decodeAddress; }
|
|
203
204
|
});
|
|
204
205
|
Object.defineProperty(exports, "encodeAddress", {
|
|
205
206
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunk47XTPPII_cjs.encodeAddress; }
|
|
207
208
|
});
|
|
208
209
|
Object.defineProperty(exports, "isValidPhoneNumber", {
|
|
209
210
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunk47XTPPII_cjs.isValidPhoneNumber; }
|
|
211
212
|
});
|
|
212
213
|
Object.defineProperty(exports, "loadAddressFormFromSession", {
|
|
213
214
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunk47XTPPII_cjs.loadAddressFormFromSession; }
|
|
215
216
|
});
|
|
216
217
|
Object.defineProperty(exports, "parseEditAddress", {
|
|
217
218
|
enumerable: true,
|
|
218
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunk47XTPPII_cjs.parseEditAddress; }
|
|
219
220
|
});
|
|
220
221
|
Object.defineProperty(exports, "saveAddressFormToSession", {
|
|
221
222
|
enumerable: true,
|
|
222
|
-
get: function () { return
|
|
223
|
+
get: function () { return chunk47XTPPII_cjs.saveAddressFormToSession; }
|
|
223
224
|
});
|
|
224
225
|
exports.calculateCartTotals = calculateCartTotals;
|
|
225
226
|
exports.checkPhonepeReturnStatus = checkPhonepeReturnStatus;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
|
-
import { C as Cart,
|
|
2
|
+
import { C as Cart, c as Coupon } from '../cart-BY8D8w-s.cjs';
|
|
3
3
|
import { O as Order } from '../orders-DHJhJ3xz.cjs';
|
|
4
|
+
import '../product-Dfi0ke-4.cjs';
|
|
4
5
|
import 'react-toastify';
|
|
5
6
|
|
|
6
7
|
/**
|
package/dist/checkout/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
|
-
import { C as Cart,
|
|
2
|
+
import { C as Cart, c as Coupon } from '../cart-GuhgeBBt.js';
|
|
3
3
|
import { O as Order } from '../orders-DHJhJ3xz.js';
|
|
4
|
+
import '../product-Dfi0ke-4.js';
|
|
4
5
|
import 'react-toastify';
|
|
5
6
|
|
|
6
7
|
/**
|
package/dist/checkout/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { applyCheckoutCoupon, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, openRazorpayCheckout, processPayment, removeCheckoutCoupon } from '../chunk-
|
|
2
|
-
import { checkPhonepePaymentStatus, getOrderDetailsByNumber, getStripePaymentStatusPublic, getStripePaymentStatus, verifyTabbyPayment } from '../chunk-
|
|
1
|
+
export { applyCheckoutCoupon, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, openRazorpayCheckout, processPayment, removeCheckoutCoupon } from '../chunk-BHOXJGIE.js';
|
|
2
|
+
import { checkPhonepePaymentStatus, getOrderDetailsByNumber, getStripePaymentStatusPublic, getStripePaymentStatus, verifyTabbyPayment } from '../chunk-GHABOHLA.js';
|
|
3
3
|
import { pixelEvents } from '../chunk-WFDKKOO7.js';
|
|
4
|
-
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, saveAddressFormToSession } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
4
|
+
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, saveAddressFormToSession } from '../chunk-B7FOXIZN.js';
|
|
5
|
+
import '../chunk-JWKDXFS4.js';
|
|
6
|
+
import '../chunk-WEMNXIRS.js';
|
|
7
|
+
import '../chunk-BQ256JKN.js';
|
|
7
8
|
import '../chunk-JQMLHRWL.js';
|
|
8
9
|
|
|
9
10
|
// src/checkout/cart-calculations.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkSMHJRNCR_cjs = require('./chunk-SMHJRNCR.cjs');
|
|
4
|
+
var chunkZO2HREQL_cjs = require('./chunk-ZO2HREQL.cjs');
|
|
5
|
+
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
6
6
|
|
|
7
7
|
// src/api/cart.ts
|
|
8
8
|
async function getCart(url, addressId) {
|
|
9
|
-
const localCart =
|
|
10
|
-
return
|
|
9
|
+
const localCart = chunkSMHJRNCR_cjs.cart_default.get();
|
|
10
|
+
return chunkBBRXE57K_cjs.auth_default.getUserDetails() ? (await chunkZO2HREQL_cjs.http_service_default.get(url, { params: { address_id: addressId } })).data : localCart || {
|
|
11
11
|
product_variants: [],
|
|
12
12
|
total_amount: 0,
|
|
13
13
|
total_quantity: 0,
|
|
@@ -23,20 +23,20 @@ async function getCart(url, addressId) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
async function addToCart(product, customizationInputs) {
|
|
26
|
-
return
|
|
26
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/customer/cart/", {
|
|
27
27
|
action: "add",
|
|
28
28
|
cart_items: product,
|
|
29
29
|
customization_inputs: customizationInputs
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
async function removeFromCart(product) {
|
|
33
|
-
return
|
|
33
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/customer/cart/", {
|
|
34
34
|
action: "remove",
|
|
35
35
|
cart_items: product
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
async function updateCart(product) {
|
|
39
|
-
return
|
|
39
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/customer/cart/", {
|
|
40
40
|
action: "update",
|
|
41
41
|
cart_items: product
|
|
42
42
|
});
|
|
@@ -44,43 +44,43 @@ async function updateCart(product) {
|
|
|
44
44
|
|
|
45
45
|
// src/api/product.ts
|
|
46
46
|
async function getProductList(url, filter) {
|
|
47
|
-
const response = await
|
|
47
|
+
const response = await chunkZO2HREQL_cjs.http_service_default.get(url, {
|
|
48
48
|
params: filter
|
|
49
49
|
});
|
|
50
50
|
return response.data;
|
|
51
51
|
}
|
|
52
52
|
async function getProducts(filter) {
|
|
53
|
-
return
|
|
53
|
+
return chunkZO2HREQL_cjs.http_service_default.get("/inventory/products/", {
|
|
54
54
|
params: { ...filter }
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
async function getProductDetail(url, slug) {
|
|
58
|
-
const response = await
|
|
58
|
+
const response = await chunkZO2HREQL_cjs.http_service_default.get(url, {
|
|
59
59
|
params: { variant_slug: slug }
|
|
60
60
|
});
|
|
61
61
|
return response.data;
|
|
62
62
|
}
|
|
63
63
|
async function getProductCategories(url) {
|
|
64
|
-
return await
|
|
64
|
+
return await chunkZO2HREQL_cjs.http_service_default.get(url);
|
|
65
65
|
}
|
|
66
66
|
async function getDigitalProductDownloadLink(variantId) {
|
|
67
|
-
return
|
|
67
|
+
return chunkZO2HREQL_cjs.http_service_default.get("/inventory/digital_product/download/", {
|
|
68
68
|
params: { variant_id: variantId }
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
async function updateDigitalProductDownloadLinkCount(variantId, downloadLink) {
|
|
72
|
-
return
|
|
72
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/inventory/digital_product/download/", {
|
|
73
73
|
variant_id: variantId,
|
|
74
74
|
download_link: downloadLink
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
async function getCategories(responseType = "flat") {
|
|
78
|
-
return await
|
|
78
|
+
return await chunkZO2HREQL_cjs.http_service_default.get("/inventory/categories/", {
|
|
79
79
|
params: { response_structure: responseType }
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
async function getProductDetailBySlug(url, slug) {
|
|
83
|
-
const response = await
|
|
83
|
+
const response = await chunkZO2HREQL_cjs.http_service_default.get(url, {
|
|
84
84
|
params: { variant_slug: slug }
|
|
85
85
|
});
|
|
86
86
|
const product = response.data;
|
|
@@ -96,19 +96,19 @@ async function getProductDetailBySlug(url, slug) {
|
|
|
96
96
|
return product;
|
|
97
97
|
}
|
|
98
98
|
async function notifyProductStock(userDetails) {
|
|
99
|
-
return
|
|
99
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/utils/customer/notify-me/", userDetails);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// src/api/wishlist.ts
|
|
103
103
|
async function getWishlist(url) {
|
|
104
|
-
const response = await
|
|
104
|
+
const response = await chunkZO2HREQL_cjs.http_service_default.get(url);
|
|
105
105
|
return response.data;
|
|
106
106
|
}
|
|
107
107
|
async function addWishlist(productDetails) {
|
|
108
|
-
return
|
|
108
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/customer/wishlist/", productDetails);
|
|
109
109
|
}
|
|
110
110
|
async function removeFromWishlist(product_variants) {
|
|
111
|
-
return
|
|
111
|
+
return chunkZO2HREQL_cjs.http_service_default.post("/customer/wishlist/", {
|
|
112
112
|
action: "remove",
|
|
113
113
|
product_variants
|
|
114
114
|
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/utils/variant.ts
|
|
4
|
+
var findMatchingVariant = (variantAttributes, attributeKeys, newSelectedVariant) => {
|
|
5
|
+
return variantAttributes.find((attributes) => {
|
|
6
|
+
for (const key of attributeKeys) {
|
|
7
|
+
const selectedVal = newSelectedVariant?.[key]?.name?.toLowerCase();
|
|
8
|
+
const attrVal = attributes?.[key]?.name?.toLowerCase();
|
|
9
|
+
if (selectedVal !== attrVal) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var findSimilarVariant = (variantAttributes, variantType, variant) => {
|
|
17
|
+
return variantAttributes.find(
|
|
18
|
+
(attributes) => attributes?.[variantType]?.value?.toLowerCase() === variant.value?.toLowerCase()
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
var isVariantCombinationAvailable = (variantAttributes, attributeKeys, currentSelection, variantType, candidate) => {
|
|
22
|
+
if (variantAttributes.length === 0) return false;
|
|
23
|
+
const newSelection = {
|
|
24
|
+
...currentSelection,
|
|
25
|
+
[variantType]: candidate
|
|
26
|
+
};
|
|
27
|
+
const matched = variantAttributes.find((attributes) => {
|
|
28
|
+
for (const key of attributeKeys) {
|
|
29
|
+
const selectedVal = newSelection?.[key]?.name?.toLowerCase();
|
|
30
|
+
const attrVal = attributes?.[key]?.name?.toLowerCase();
|
|
31
|
+
if (selectedVal !== attrVal) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
});
|
|
37
|
+
return !!matched;
|
|
38
|
+
};
|
|
39
|
+
var isColorVariantType = (variantType) => {
|
|
40
|
+
const type = variantType.toLowerCase();
|
|
41
|
+
return type === "color" || type === "colors";
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.findMatchingVariant = findMatchingVariant;
|
|
45
|
+
exports.findSimilarVariant = findSimilarVariant;
|
|
46
|
+
exports.isColorVariantType = isColorVariantType;
|
|
47
|
+
exports.isVariantCombinationAvailable = isVariantCombinationAvailable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNE3ZHELZ_cjs = require('./chunk-NE3ZHELZ.cjs');
|
|
4
4
|
var libphonenumberJs = require('libphonenumber-js');
|
|
5
5
|
var Yup = require('yup');
|
|
6
6
|
|
|
@@ -73,13 +73,13 @@ function decodeAddress(encoded) {
|
|
|
73
73
|
}
|
|
74
74
|
function saveAddressFormToSession(values) {
|
|
75
75
|
try {
|
|
76
|
-
sessionStorage.setItem(
|
|
76
|
+
sessionStorage.setItem(chunkNE3ZHELZ_cjs.ADDRESS_FORM_SESSION_KEY, JSON.stringify(values));
|
|
77
77
|
} catch {
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
function loadAddressFormFromSession() {
|
|
81
81
|
try {
|
|
82
|
-
const stored = sessionStorage.getItem(
|
|
82
|
+
const stored = sessionStorage.getItem(chunkNE3ZHELZ_cjs.ADDRESS_FORM_SESSION_KEY);
|
|
83
83
|
return stored ? JSON.parse(stored) : null;
|
|
84
84
|
} catch {
|
|
85
85
|
return null;
|
|
@@ -87,7 +87,7 @@ function loadAddressFormFromSession() {
|
|
|
87
87
|
}
|
|
88
88
|
function clearAddressFormSession() {
|
|
89
89
|
try {
|
|
90
|
-
sessionStorage.removeItem(
|
|
90
|
+
sessionStorage.removeItem(chunkNE3ZHELZ_cjs.ADDRESS_FORM_SESSION_KEY);
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/utils/routes.ts
|
|
2
|
+
var protectedRoutes = [
|
|
3
|
+
"/my/profile",
|
|
4
|
+
"/my/orders",
|
|
5
|
+
"/my/delete-account",
|
|
6
|
+
"/my/addresses",
|
|
7
|
+
"/my/dashboard"
|
|
8
|
+
];
|
|
9
|
+
var authRoutes = ["/login", "/signup"];
|
|
10
|
+
var publicRoutes = ["/about", "/"];
|
|
11
|
+
var urls = {
|
|
12
|
+
dashboard: "/my/dashboard",
|
|
13
|
+
profile: "/my/profile",
|
|
14
|
+
orders: "/my/orders",
|
|
15
|
+
orderDetail: "/my/orders/:id",
|
|
16
|
+
deleteAccount: "/my/delete-account",
|
|
17
|
+
addresses: "/my/addresses",
|
|
18
|
+
bookings: "/my/bookings",
|
|
19
|
+
login: "/login",
|
|
20
|
+
signup: "/signup",
|
|
21
|
+
about: "/about",
|
|
22
|
+
home: "/",
|
|
23
|
+
searchProducts: "/search-products",
|
|
24
|
+
shop: "/shop",
|
|
25
|
+
shopDetails: "/shop/:id",
|
|
26
|
+
cart: "/checkout/cart",
|
|
27
|
+
address: "/checkout/address",
|
|
28
|
+
payment: "/checkout/payment",
|
|
29
|
+
wishlist: "/wishlist",
|
|
30
|
+
privacyPolicy: "/privacy-policy",
|
|
31
|
+
faq: "/faq",
|
|
32
|
+
contactUs: "/contact-us",
|
|
33
|
+
services: "/services",
|
|
34
|
+
storeReview: "/store-review",
|
|
35
|
+
returnAndRefund: "/return-and-refund",
|
|
36
|
+
shippingPolicy: "/shipping-policy",
|
|
37
|
+
termsOfService: "/terms-of-service"
|
|
38
|
+
};
|
|
39
|
+
var routes_default = urls;
|
|
40
|
+
|
|
41
|
+
export { authRoutes, protectedRoutes, publicRoutes, routes_default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { updateAddress, addAddress, getCountries, getSubdivisions } from './chunk-
|
|
1
|
+
import { updateAddress, addAddress, getCountries, getSubdivisions } from './chunk-YY77CUWX.js';
|
|
2
2
|
import { getCache, getAddressMeta } from './chunk-YUPBTD4M.js';
|
|
3
|
-
import { addressFormInitialValues, IP_API_CACHE_KEY, addressValidationSchema, buildSubmitPayload } from './chunk-
|
|
3
|
+
import { addressFormInitialValues, IP_API_CACHE_KEY, addressValidationSchema, buildSubmitPayload } from './chunk-B7FOXIZN.js';
|
|
4
4
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useFormik } from 'formik';
|
|
6
6
|
import { isSupportedCountry, getCountryCallingCode } from 'libphonenumber-js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/utils/date.ts
|
|
4
|
+
function timeFromNow(date) {
|
|
5
|
+
const now = /* @__PURE__ */ new Date();
|
|
6
|
+
const target = new Date(date);
|
|
7
|
+
const diffMs = target.getTime() - now.getTime();
|
|
8
|
+
const absDiffMs = Math.abs(diffMs);
|
|
9
|
+
const isFuture = diffMs > 0;
|
|
10
|
+
const seconds = Math.floor(absDiffMs / 1e3);
|
|
11
|
+
const minutes = Math.floor(seconds / 60);
|
|
12
|
+
const hours = Math.floor(minutes / 60);
|
|
13
|
+
const days = Math.floor(hours / 24);
|
|
14
|
+
const months = Math.floor(days / 30);
|
|
15
|
+
const years = Math.floor(days / 365);
|
|
16
|
+
let value;
|
|
17
|
+
let unit;
|
|
18
|
+
if (years > 0) {
|
|
19
|
+
value = years;
|
|
20
|
+
unit = years === 1 ? "year" : "years";
|
|
21
|
+
} else if (months > 0) {
|
|
22
|
+
value = months;
|
|
23
|
+
unit = months === 1 ? "month" : "months";
|
|
24
|
+
} else if (days > 0) {
|
|
25
|
+
value = days;
|
|
26
|
+
unit = days === 1 ? "day" : "days";
|
|
27
|
+
} else if (hours > 0) {
|
|
28
|
+
value = hours;
|
|
29
|
+
unit = hours === 1 ? "hour" : "hours";
|
|
30
|
+
} else if (minutes > 0) {
|
|
31
|
+
value = minutes;
|
|
32
|
+
unit = minutes === 1 ? "minute" : "minutes";
|
|
33
|
+
} else {
|
|
34
|
+
return isFuture ? "in a few seconds" : "a few seconds ago";
|
|
35
|
+
}
|
|
36
|
+
return isFuture ? `in ${value} ${unit}` : `${value} ${unit} ago`;
|
|
37
|
+
}
|
|
38
|
+
function isExpired(date) {
|
|
39
|
+
return /* @__PURE__ */ new Date() > new Date(date);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.isExpired = isExpired;
|
|
43
|
+
exports.timeFromNow = timeFromNow;
|