@sentecacommerce-theme/lib 0.13.17 → 0.13.20
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/cjs/analytics/Releva/types.js +19 -20
- package/dist/cjs/analytics/pageView.js +4 -4
- package/dist/cjs/analytics/purchase.js +2 -2
- package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +48 -43
- package/dist/cjs/components/AnalyticsScripts/index.js +3 -3
- package/dist/cjs/components/GoogleOneTap/index.js +3 -3
- package/dist/cjs/contexts/CheckoutForm/utils/validateBillingAddress.js +3 -8
- package/dist/cjs/product/hooks/useBnpOffers.js +47 -40
- package/dist/cjs/seo/api/ssr/fetchRedirectByFrom.js +5 -2
- package/dist/esm/analytics/Releva/types.js +19 -20
- package/dist/esm/analytics/pageView.js +4 -4
- package/dist/esm/analytics/purchase.js +2 -2
- package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +48 -43
- package/dist/esm/components/AnalyticsScripts/index.js +3 -3
- package/dist/esm/components/GoogleOneTap/index.js +3 -3
- package/dist/esm/contexts/CheckoutForm/utils/validateBillingAddress.js +3 -8
- package/dist/esm/product/hooks/useBnpOffers.js +47 -40
- package/dist/esm/seo/api/ssr/fetchRedirectByFrom.js +5 -2
- package/dist/types/analytics/Releva/types.d.ts +19 -19
- package/dist/types/checkout/hooks/useBnpCalculateForCart.d.ts +4 -3
- package/dist/types/product/hooks/useBnpOffers.d.ts +12 -8
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +4 -4
@@ -2,27 +2,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
2
2
|
value: true
|
3
3
|
});
|
4
4
|
exports.relevaCookie = exports.GenericActionTypesEnum = exports.PageTypeMap = void 0;
|
5
|
-
var PageTypeMap
|
5
|
+
var PageTypeMap = {
|
6
|
+
'/': 'Home page',
|
7
|
+
'/[slug]/p': 'Product page',
|
8
|
+
'/[slug]/c': 'Category page',
|
9
|
+
'/[slug]/[cat]/c': 'Category page',
|
10
|
+
'/[slug]/b': 'Brand page',
|
11
|
+
'/[slug]/[cat]/b': 'Brand page',
|
12
|
+
'/[slug]/v': 'View page',
|
13
|
+
'/[slug]/ct': 'Collection page',
|
14
|
+
'/search': 'Search page',
|
15
|
+
'/profile/[[...tab]]': 'Profile page',
|
16
|
+
'/favorites': 'Wishlist page',
|
17
|
+
'/basket': 'Cart page',
|
18
|
+
'/checkout': 'Checkout page',
|
19
|
+
'/order/[orderId]': 'Order Complete page',
|
20
|
+
'/stores': 'Stores page',
|
21
|
+
'/vouchers': 'Vouchers page',
|
22
|
+
'/login': 'Login/Register page'
|
23
|
+
};
|
6
24
|
exports.PageTypeMap = PageTypeMap;
|
7
|
-
(function(PageTypeMap) {
|
8
|
-
PageTypeMap['/'] = '/';
|
9
|
-
PageTypeMap['/[slug]/p'] = '/[slug]/p';
|
10
|
-
PageTypeMap['/[slug]/c'] = '/[slug]/c';
|
11
|
-
PageTypeMap['/[slug]/[cat]/c'] = '/[slug]/[cat]/c';
|
12
|
-
PageTypeMap['/[slug]/b'] = '/[slug]/b';
|
13
|
-
PageTypeMap['/[slug]/[cat]/b'] = '/[slug]/[cat]/b';
|
14
|
-
PageTypeMap['/[slug]/v'] = '/[slug]/v';
|
15
|
-
PageTypeMap['/[slug]/ct'] = '/[slug]/ct';
|
16
|
-
PageTypeMap['/search'] = '/search';
|
17
|
-
PageTypeMap['/profile/[[...tab]]'] = '/profile/[[...tab]]';
|
18
|
-
PageTypeMap['/favorites'] = '/favorites';
|
19
|
-
PageTypeMap['/basket'] = '/basket';
|
20
|
-
PageTypeMap['/checkout'] = '/checkout';
|
21
|
-
PageTypeMap['/order/[orderId]'] = '/order/[orderId]';
|
22
|
-
PageTypeMap['/stores'] = '/stores';
|
23
|
-
PageTypeMap['/vouchers'] = '/vouchers';
|
24
|
-
PageTypeMap['/login'] = '/login';
|
25
|
-
})(PageTypeMap || (exports.PageTypeMap = PageTypeMap = {}));
|
26
25
|
var GenericActionTypesEnum;
|
27
26
|
exports.GenericActionTypesEnum = GenericActionTypesEnum;
|
28
27
|
(function(GenericActionTypesEnum) {
|
@@ -7,8 +7,8 @@ var usePageView = function() {
|
|
7
7
|
var config = (0, _useConfig).useConfigState();
|
8
8
|
return function(url, title) {
|
9
9
|
var ref, ref1;
|
10
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
11
|
-
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.
|
10
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
11
|
+
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.analytics, {
|
12
12
|
page_path: url,
|
13
13
|
page_title: title
|
14
14
|
});
|
@@ -18,8 +18,8 @@ exports.usePageView = usePageView;
|
|
18
18
|
var getPageView = function(config) {
|
19
19
|
return function(url, title) {
|
20
20
|
var ref, ref2, ref3;
|
21
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
22
|
-
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
21
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
22
|
+
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.analytics, {
|
23
23
|
page_path: url,
|
24
24
|
page_title: title
|
25
25
|
});
|
@@ -13,7 +13,7 @@ var purchase = function(order, config) {
|
|
13
13
|
var hasGoogleReMarketing = Boolean(((ref4 = config.google) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.reMarketing) === null || ref5 === void 0 ? void 0 : ref5.id) && ((ref6 = config.google) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.reMarketing) === null || ref7 === void 0 ? void 0 : ref7.label));
|
14
14
|
var facebookPixelLoaded = Boolean(window.fbq);
|
15
15
|
var isGtagLoaded = Boolean(window.gtag);
|
16
|
-
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.
|
16
|
+
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.analytics);
|
17
17
|
if (isGtagLoaded && hasGoogleId) {
|
18
18
|
var ref9, ref10, ref11;
|
19
19
|
var items = ((ref9 = order.lineItems) === null || ref9 === void 0 ? void 0 : ref9.map(function(item, i) {
|
@@ -28,7 +28,7 @@ var purchase = function(order, config) {
|
|
28
28
|
})) || [];
|
29
29
|
(ref11 = window.gtag) === null || ref11 === void 0 ? void 0 : ref11.call(window, 'event', 'purchase', {
|
30
30
|
transaction_id: order._id,
|
31
|
-
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.
|
31
|
+
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.analytics,
|
32
32
|
affiliation: config.defaultMerchant,
|
33
33
|
value: (0, _decodePrice).decodePrice(order.grandTotalPrice),
|
34
34
|
currency: order.currencyCode,
|
@@ -55,56 +55,61 @@ function _objectSpread(target) {
|
|
55
55
|
return target;
|
56
56
|
}
|
57
57
|
var useBnpCalculateForCart = function(props) {
|
58
|
-
var
|
58
|
+
var ref5, ref1, ref2, ref3;
|
59
59
|
var ref4 = props !== null && props !== void 0 ? props : {}, _preferredInstallmentCentAmount = ref4.preferredInstallmentCentAmount, preferredInstallmentCentAmount = _preferredInstallmentCentAmount === void 0 ? 0 : _preferredInstallmentCentAmount, _downPaymentCentAmount = ref4.downPaymentCentAmount, downPaymentCentAmount = _downPaymentCentAmount === void 0 ? 0 : _downPaymentCentAmount;
|
60
60
|
var response = (0, _api).useBnpCalculateForCartQuery({
|
61
61
|
preferredInstallmentCentAmount: preferredInstallmentCentAmount,
|
62
62
|
downPaymentCentAmount: downPaymentCentAmount
|
63
63
|
});
|
64
|
-
var configLocale = ((
|
64
|
+
var configLocale = ((ref5 = (0, _index).useConfigState()) === null || ref5 === void 0 ? void 0 : (ref1 = ref5.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
65
65
|
return (0, _react).useMemo(function() {
|
66
|
-
var
|
66
|
+
var ref6;
|
67
67
|
return _objectSpread({}, response, {
|
68
|
-
data:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
68
|
+
data: (ref6 = response.data) === null || ref6 === void 0 ? void 0 : ref6.map(function(options) {
|
69
|
+
var ref;
|
70
|
+
return {
|
71
|
+
name: options.scheme.name,
|
72
|
+
scheme: options.scheme,
|
73
|
+
offers: (ref = options.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
74
|
+
var _totalRepaymentAmount = (0, _index).decodePrice(offer.totalRepaymentAmount);
|
75
|
+
var _correctDownPaymentAmount = (0, _index).decodePrice(offer.correctDownPaymentAmount);
|
76
|
+
var _installmentAmount = (0, _index).decodePrice(offer.installmentAmount);
|
77
|
+
var _processingFeeAmount = (0, _index).decodePrice(offer.processingFeeAmount);
|
78
|
+
var totalRepaymentAmount = (0, _index).formatAsCurrency({
|
79
|
+
price: _totalRepaymentAmount,
|
80
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
81
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
82
|
+
locale: configLocale || 'en'
|
83
|
+
});
|
84
|
+
var correctDownPaymentAmount = (0, _index).formatAsCurrency({
|
85
|
+
price: _correctDownPaymentAmount,
|
86
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
87
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
88
|
+
locale: configLocale || 'en'
|
89
|
+
});
|
90
|
+
var installmentAmount = (0, _index).formatAsCurrency({
|
91
|
+
price: _installmentAmount,
|
92
|
+
precision: offer.installmentAmount.fractionDigits,
|
93
|
+
currency: offer.installmentAmount.currencyCode,
|
94
|
+
locale: configLocale || 'en'
|
95
|
+
});
|
96
|
+
var processingFeeAmount = (0, _index).formatAsCurrency({
|
97
|
+
price: _processingFeeAmount,
|
98
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
99
|
+
currency: offer.processingFeeAmount.currencyCode,
|
100
|
+
locale: configLocale || 'en'
|
101
|
+
});
|
102
|
+
return _objectSpread({}, offer, {
|
103
|
+
offerRaw: offer,
|
104
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
105
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
106
|
+
installmentAmount: installmentAmount,
|
107
|
+
processingFeeAmount: processingFeeAmount
|
108
|
+
});
|
109
|
+
}).sort(function(offer, offer2) {
|
110
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
111
|
+
})
|
112
|
+
};
|
108
113
|
})
|
109
114
|
});
|
110
115
|
}, [
|
@@ -87,18 +87,18 @@ function AnalyticsScripts() {
|
|
87
87
|
var router = (0, _router).useRouter();
|
88
88
|
var config = (0, _useConfig).useConfigState();
|
89
89
|
var ref5 = _slicedToArray((0, _react).useState(null), 2), scripts = ref5[0], setScripts = ref5[1];
|
90
|
-
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.
|
90
|
+
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.analytics);
|
91
91
|
var hasGoogleReMarketing = Boolean(((ref1 = config.google) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.reMarketing) === null || ref2 === void 0 ? void 0 : ref2.id) && ((ref3 = config.google) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.reMarketing) === null || ref4 === void 0 ? void 0 : ref4.label));
|
92
92
|
var initAnalytics = function() {
|
93
93
|
var ref, ref6, ref7, ref8, ref9, ref10;
|
94
94
|
return setScripts({
|
95
95
|
gtag: hasGoogleId ? /*#__PURE__*/ _react.default.createElement("script", {
|
96
96
|
async: true,
|
97
|
-
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
97
|
+
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)
|
98
98
|
}) : null,
|
99
99
|
gtm: hasGoogleId ? /*#__PURE__*/ _react.default.createElement("script", {
|
100
100
|
dangerouslySetInnerHTML: {
|
101
|
-
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.
|
101
|
+
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.analytics, "', {\n page_path: window.location.pathname,\n });\n ").concat(hasGoogleReMarketing ? "gtag('config', '".concat((ref7 = config.google) === null || ref7 === void 0 ? void 0 : (ref8 = ref7.reMarketing) === null || ref8 === void 0 ? void 0 : ref8.id, "')") : '', "\n ")
|
102
102
|
}
|
103
103
|
}) : null,
|
104
104
|
pixel: ((ref9 = config.facebook) === null || ref9 === void 0 ? void 0 : ref9.pixelId) ? /*#__PURE__*/ _react.default.createElement("script", {
|
@@ -119,11 +119,11 @@ var GoogleOneTap = function(param) {
|
|
119
119
|
var ref;
|
120
120
|
var token = _jsCookie.default.get(_tokens.AUTH_TOKEN_KEY);
|
121
121
|
// Google one tap
|
122
|
-
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
122
|
+
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.oneTapId)) return;
|
123
123
|
if (!token) {
|
124
124
|
var ref2;
|
125
125
|
google.accounts.id.initialize({
|
126
|
-
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
126
|
+
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.oneTapId,
|
127
127
|
callback: function() {
|
128
128
|
var _ref = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(response) {
|
129
129
|
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
@@ -157,7 +157,7 @@ var GoogleOneTap = function(param) {
|
|
157
157
|
google.accounts.id.cancel();
|
158
158
|
}
|
159
159
|
}, [
|
160
|
-
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.
|
160
|
+
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.oneTapId,
|
161
161
|
login,
|
162
162
|
autoSignIn
|
163
163
|
]);
|
@@ -30,11 +30,6 @@ function _objectSpread(target) {
|
|
30
30
|
}
|
31
31
|
return target;
|
32
32
|
}
|
33
|
-
var requiredFields = [
|
34
|
-
'city',
|
35
|
-
'postalCode',
|
36
|
-
'streetName'
|
37
|
-
];
|
38
33
|
function genericBillingAddressValidation(data, errorLabels, requiredCompanyFields) {
|
39
34
|
var isWithInvoice = Boolean(data.company);
|
40
35
|
if (!isWithInvoice) return null;
|
@@ -45,9 +40,9 @@ function genericBillingAddressValidation(data, errorLabels, requiredCompanyField
|
|
45
40
|
}
|
46
41
|
return errors;
|
47
42
|
}, {});
|
48
|
-
var fieldErrors =
|
49
|
-
var ref;
|
50
|
-
if (!((ref = data[field]) === null ||
|
43
|
+
var fieldErrors = requiredCompanyFields.reduce(function(errors, field) {
|
44
|
+
var ref, ref2;
|
45
|
+
if (!(data === null || data === void 0 ? void 0 : (ref = data.company) === null || ref === void 0 ? void 0 : (ref2 = ref[field]) === null || ref2 === void 0 ? void 0 : ref2.trim())) {
|
51
46
|
return _objectSpread({}, errors, _defineProperty({}, field, errorLabels.fieldIsRequired));
|
52
47
|
}
|
53
48
|
return errors;
|
@@ -34,49 +34,56 @@ function _objectSpread(target) {
|
|
34
34
|
return target;
|
35
35
|
}
|
36
36
|
var useBnpOffers = function(props) {
|
37
|
-
var
|
38
|
-
var configLocale = ((
|
37
|
+
var ref4, ref1, ref2, ref3;
|
38
|
+
var configLocale = ((ref4 = (0, _index).useConfigState()) === null || ref4 === void 0 ? void 0 : (ref1 = ref4.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
39
39
|
var response = (0, _queries).useBnpOffersQuery(props);
|
40
40
|
return (0, _react).useMemo(function() {
|
41
|
-
var
|
41
|
+
var ref5;
|
42
42
|
return _objectSpread({}, response, {
|
43
|
-
data: response === null || response === void 0 ? void 0 : (
|
44
|
-
var
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
43
|
+
data: response === null || response === void 0 ? void 0 : (ref5 = response.data) === null || ref5 === void 0 ? void 0 : ref5.map(function(result) {
|
44
|
+
var ref;
|
45
|
+
return {
|
46
|
+
name: result.scheme.name,
|
47
|
+
scheme: result.scheme,
|
48
|
+
offers: (ref = result.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
49
|
+
var _totalRepaymentAmount = (0, _index).decodePrice(offer.totalRepaymentAmount);
|
50
|
+
var _correctDownPaymentAmount = (0, _index).decodePrice(offer.correctDownPaymentAmount);
|
51
|
+
var _installmentAmount = (0, _index).decodePrice(offer.installmentAmount);
|
52
|
+
var _processingFeeAmount = (0, _index).decodePrice(offer.processingFeeAmount);
|
53
|
+
var totalRepaymentAmount = (0, _index).formatAsCurrency({
|
54
|
+
price: _totalRepaymentAmount,
|
55
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
56
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
57
|
+
locale: configLocale || 'en'
|
58
|
+
});
|
59
|
+
var correctDownPaymentAmount = (0, _index).formatAsCurrency({
|
60
|
+
price: _correctDownPaymentAmount,
|
61
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
62
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
63
|
+
locale: configLocale || 'en'
|
64
|
+
});
|
65
|
+
var installmentAmount = (0, _index).formatAsCurrency({
|
66
|
+
price: _installmentAmount,
|
67
|
+
precision: offer.installmentAmount.fractionDigits,
|
68
|
+
currency: offer.installmentAmount.currencyCode,
|
69
|
+
locale: configLocale || 'en'
|
70
|
+
});
|
71
|
+
var processingFeeAmount = (0, _index).formatAsCurrency({
|
72
|
+
price: _processingFeeAmount,
|
73
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
74
|
+
currency: offer.processingFeeAmount.currencyCode,
|
75
|
+
locale: configLocale || 'en'
|
76
|
+
});
|
77
|
+
return _objectSpread({}, offer, {
|
78
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
79
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
80
|
+
installmentAmount: installmentAmount,
|
81
|
+
processingFeeAmount: processingFeeAmount
|
82
|
+
});
|
83
|
+
}).sort(function(offer, offer2) {
|
84
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
85
|
+
})
|
86
|
+
};
|
80
87
|
})
|
81
88
|
});
|
82
89
|
}, [
|
@@ -40,14 +40,17 @@ function _interopRequireDefault(obj) {
|
|
40
40
|
}
|
41
41
|
var fetchRedirectByFrom = function() {
|
42
42
|
var _ref = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(from) {
|
43
|
+
var redirectUrl;
|
43
44
|
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
44
45
|
while(1)switch(_ctx.prev = _ctx.next){
|
45
46
|
case 0:
|
46
47
|
_ctx.next = 2;
|
47
48
|
return (0, _sdk).RedirectsGetByFrom(from);
|
48
49
|
case 2:
|
49
|
-
|
50
|
-
|
50
|
+
redirectUrl = _ctx.sent;
|
51
|
+
redirectUrl.to = encodeURI(redirectUrl.to);
|
52
|
+
return _ctx.abrupt("return", redirectUrl);
|
53
|
+
case 5:
|
51
54
|
case "end":
|
52
55
|
return _ctx.stop();
|
53
56
|
}
|
@@ -1,23 +1,22 @@
|
|
1
|
-
export var PageTypeMap
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
})(PageTypeMap || (PageTypeMap = {}));
|
1
|
+
export var PageTypeMap = {
|
2
|
+
'/': 'Home page',
|
3
|
+
'/[slug]/p': 'Product page',
|
4
|
+
'/[slug]/c': 'Category page',
|
5
|
+
'/[slug]/[cat]/c': 'Category page',
|
6
|
+
'/[slug]/b': 'Brand page',
|
7
|
+
'/[slug]/[cat]/b': 'Brand page',
|
8
|
+
'/[slug]/v': 'View page',
|
9
|
+
'/[slug]/ct': 'Collection page',
|
10
|
+
'/search': 'Search page',
|
11
|
+
'/profile/[[...tab]]': 'Profile page',
|
12
|
+
'/favorites': 'Wishlist page',
|
13
|
+
'/basket': 'Cart page',
|
14
|
+
'/checkout': 'Checkout page',
|
15
|
+
'/order/[orderId]': 'Order Complete page',
|
16
|
+
'/stores': 'Stores page',
|
17
|
+
'/vouchers': 'Vouchers page',
|
18
|
+
'/login': 'Login/Register page'
|
19
|
+
};
|
21
20
|
export var GenericActionTypesEnum;
|
22
21
|
(function(GenericActionTypesEnum) {
|
23
22
|
GenericActionTypesEnum["changeBasket"] = "changeBasket";
|
@@ -3,8 +3,8 @@ export var usePageView = function() {
|
|
3
3
|
var config = useConfigState();
|
4
4
|
return function(url, title) {
|
5
5
|
var ref, ref1;
|
6
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
7
|
-
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.
|
6
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
7
|
+
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.analytics, {
|
8
8
|
page_path: url,
|
9
9
|
page_title: title
|
10
10
|
});
|
@@ -13,8 +13,8 @@ export var usePageView = function() {
|
|
13
13
|
export var getPageView = function(config) {
|
14
14
|
return function(url, title) {
|
15
15
|
var ref, ref2, ref3;
|
16
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
17
|
-
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
16
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
17
|
+
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.analytics, {
|
18
18
|
page_path: url,
|
19
19
|
page_title: title
|
20
20
|
});
|
@@ -9,7 +9,7 @@ export var purchase = function(order, config) {
|
|
9
9
|
var hasGoogleReMarketing = Boolean(((ref4 = config.google) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.reMarketing) === null || ref5 === void 0 ? void 0 : ref5.id) && ((ref6 = config.google) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.reMarketing) === null || ref7 === void 0 ? void 0 : ref7.label));
|
10
10
|
var facebookPixelLoaded = Boolean(window.fbq);
|
11
11
|
var isGtagLoaded = Boolean(window.gtag);
|
12
|
-
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.
|
12
|
+
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.analytics);
|
13
13
|
if (isGtagLoaded && hasGoogleId) {
|
14
14
|
var ref9, ref10, ref11;
|
15
15
|
var items = ((ref9 = order.lineItems) === null || ref9 === void 0 ? void 0 : ref9.map(function(item, i) {
|
@@ -24,7 +24,7 @@ export var purchase = function(order, config) {
|
|
24
24
|
})) || [];
|
25
25
|
(ref11 = window.gtag) === null || ref11 === void 0 ? void 0 : ref11.call(window, 'event', 'purchase', {
|
26
26
|
transaction_id: order._id,
|
27
|
-
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.
|
27
|
+
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.analytics,
|
28
28
|
affiliation: config.defaultMerchant,
|
29
29
|
value: decodePrice(order.grandTotalPrice),
|
30
30
|
currency: order.currencyCode,
|
@@ -30,56 +30,61 @@ function _objectSpread(target) {
|
|
30
30
|
return target;
|
31
31
|
}
|
32
32
|
export var useBnpCalculateForCart = function(props) {
|
33
|
-
var
|
33
|
+
var ref5, ref1, ref2, ref3;
|
34
34
|
var ref4 = props !== null && props !== void 0 ? props : {}, _preferredInstallmentCentAmount = ref4.preferredInstallmentCentAmount, preferredInstallmentCentAmount = _preferredInstallmentCentAmount === void 0 ? 0 : _preferredInstallmentCentAmount, _downPaymentCentAmount = ref4.downPaymentCentAmount, downPaymentCentAmount = _downPaymentCentAmount === void 0 ? 0 : _downPaymentCentAmount;
|
35
35
|
var response = useBnpCalculateForCartQuery({
|
36
36
|
preferredInstallmentCentAmount: preferredInstallmentCentAmount,
|
37
37
|
downPaymentCentAmount: downPaymentCentAmount
|
38
38
|
});
|
39
|
-
var configLocale = ((
|
39
|
+
var configLocale = ((ref5 = useConfigState()) === null || ref5 === void 0 ? void 0 : (ref1 = ref5.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
40
40
|
return useMemo(function() {
|
41
|
-
var
|
41
|
+
var ref6;
|
42
42
|
return _objectSpread({}, response, {
|
43
|
-
data:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
43
|
+
data: (ref6 = response.data) === null || ref6 === void 0 ? void 0 : ref6.map(function(options) {
|
44
|
+
var ref;
|
45
|
+
return {
|
46
|
+
name: options.scheme.name,
|
47
|
+
scheme: options.scheme,
|
48
|
+
offers: (ref = options.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
49
|
+
var _totalRepaymentAmount = decodePrice(offer.totalRepaymentAmount);
|
50
|
+
var _correctDownPaymentAmount = decodePrice(offer.correctDownPaymentAmount);
|
51
|
+
var _installmentAmount = decodePrice(offer.installmentAmount);
|
52
|
+
var _processingFeeAmount = decodePrice(offer.processingFeeAmount);
|
53
|
+
var totalRepaymentAmount = formatAsCurrency({
|
54
|
+
price: _totalRepaymentAmount,
|
55
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
56
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
57
|
+
locale: configLocale || 'en'
|
58
|
+
});
|
59
|
+
var correctDownPaymentAmount = formatAsCurrency({
|
60
|
+
price: _correctDownPaymentAmount,
|
61
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
62
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
63
|
+
locale: configLocale || 'en'
|
64
|
+
});
|
65
|
+
var installmentAmount = formatAsCurrency({
|
66
|
+
price: _installmentAmount,
|
67
|
+
precision: offer.installmentAmount.fractionDigits,
|
68
|
+
currency: offer.installmentAmount.currencyCode,
|
69
|
+
locale: configLocale || 'en'
|
70
|
+
});
|
71
|
+
var processingFeeAmount = formatAsCurrency({
|
72
|
+
price: _processingFeeAmount,
|
73
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
74
|
+
currency: offer.processingFeeAmount.currencyCode,
|
75
|
+
locale: configLocale || 'en'
|
76
|
+
});
|
77
|
+
return _objectSpread({}, offer, {
|
78
|
+
offerRaw: offer,
|
79
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
80
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
81
|
+
installmentAmount: installmentAmount,
|
82
|
+
processingFeeAmount: processingFeeAmount
|
83
|
+
});
|
84
|
+
}).sort(function(offer, offer2) {
|
85
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
86
|
+
})
|
87
|
+
};
|
83
88
|
})
|
84
89
|
});
|
85
90
|
}, [
|
@@ -57,18 +57,18 @@ export function AnalyticsScripts() {
|
|
57
57
|
var router = useRouter();
|
58
58
|
var config = useConfigState();
|
59
59
|
var ref5 = _slicedToArray(useState(null), 2), scripts = ref5[0], setScripts = ref5[1];
|
60
|
-
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.
|
60
|
+
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.analytics);
|
61
61
|
var hasGoogleReMarketing = Boolean(((ref1 = config.google) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.reMarketing) === null || ref2 === void 0 ? void 0 : ref2.id) && ((ref3 = config.google) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.reMarketing) === null || ref4 === void 0 ? void 0 : ref4.label));
|
62
62
|
var initAnalytics = function() {
|
63
63
|
var ref, ref6, ref7, ref8, ref9, ref10;
|
64
64
|
return setScripts({
|
65
65
|
gtag: hasGoogleId ? /*#__PURE__*/ React.createElement("script", {
|
66
66
|
async: true,
|
67
|
-
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
67
|
+
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)
|
68
68
|
}) : null,
|
69
69
|
gtm: hasGoogleId ? /*#__PURE__*/ React.createElement("script", {
|
70
70
|
dangerouslySetInnerHTML: {
|
71
|
-
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.
|
71
|
+
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.analytics, "', {\n page_path: window.location.pathname,\n });\n ").concat(hasGoogleReMarketing ? "gtag('config', '".concat((ref7 = config.google) === null || ref7 === void 0 ? void 0 : (ref8 = ref7.reMarketing) === null || ref8 === void 0 ? void 0 : ref8.id, "')") : '', "\n ")
|
72
72
|
}
|
73
73
|
}) : null,
|
74
74
|
pixel: ((ref9 = config.facebook) === null || ref9 === void 0 ? void 0 : ref9.pixelId) ? /*#__PURE__*/ React.createElement("script", {
|
@@ -89,11 +89,11 @@ export var GoogleOneTap = function(param) {
|
|
89
89
|
var ref;
|
90
90
|
var token = Cookies.get(AUTH_TOKEN_KEY);
|
91
91
|
// Google one tap
|
92
|
-
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
92
|
+
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.oneTapId)) return;
|
93
93
|
if (!token) {
|
94
94
|
var ref2;
|
95
95
|
google.accounts.id.initialize({
|
96
|
-
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
96
|
+
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.oneTapId,
|
97
97
|
callback: function() {
|
98
98
|
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(response) {
|
99
99
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
@@ -127,7 +127,7 @@ export var GoogleOneTap = function(param) {
|
|
127
127
|
google.accounts.id.cancel();
|
128
128
|
}
|
129
129
|
}, [
|
130
|
-
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.
|
130
|
+
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.oneTapId,
|
131
131
|
login,
|
132
132
|
autoSignIn
|
133
133
|
]);
|
@@ -26,11 +26,6 @@ function _objectSpread(target) {
|
|
26
26
|
}
|
27
27
|
return target;
|
28
28
|
}
|
29
|
-
var requiredFields = [
|
30
|
-
'city',
|
31
|
-
'postalCode',
|
32
|
-
'streetName'
|
33
|
-
];
|
34
29
|
export function genericBillingAddressValidation(data, errorLabels, requiredCompanyFields) {
|
35
30
|
var isWithInvoice = Boolean(data.company);
|
36
31
|
if (!isWithInvoice) return null;
|
@@ -41,9 +36,9 @@ export function genericBillingAddressValidation(data, errorLabels, requiredCompa
|
|
41
36
|
}
|
42
37
|
return errors;
|
43
38
|
}, {});
|
44
|
-
var fieldErrors =
|
45
|
-
var ref;
|
46
|
-
if (!((ref = data[field]) === null ||
|
39
|
+
var fieldErrors = requiredCompanyFields.reduce(function(errors, field) {
|
40
|
+
var ref, ref2;
|
41
|
+
if (!(data === null || data === void 0 ? void 0 : (ref = data.company) === null || ref === void 0 ? void 0 : (ref2 = ref[field]) === null || ref2 === void 0 ? void 0 : ref2.trim())) {
|
47
42
|
return _objectSpread({}, errors, _defineProperty({}, field, errorLabels.fieldIsRequired));
|
48
43
|
}
|
49
44
|
return errors;
|
@@ -30,49 +30,56 @@ function _objectSpread(target) {
|
|
30
30
|
return target;
|
31
31
|
}
|
32
32
|
export var useBnpOffers = function(props) {
|
33
|
-
var
|
34
|
-
var configLocale = ((
|
33
|
+
var ref4, ref1, ref2, ref3;
|
34
|
+
var configLocale = ((ref4 = useConfigState()) === null || ref4 === void 0 ? void 0 : (ref1 = ref4.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
35
35
|
var response = useBnpOffersQuery(props);
|
36
36
|
return useMemo(function() {
|
37
|
-
var
|
37
|
+
var ref5;
|
38
38
|
return _objectSpread({}, response, {
|
39
|
-
data: response === null || response === void 0 ? void 0 : (
|
40
|
-
var
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
39
|
+
data: response === null || response === void 0 ? void 0 : (ref5 = response.data) === null || ref5 === void 0 ? void 0 : ref5.map(function(result) {
|
40
|
+
var ref;
|
41
|
+
return {
|
42
|
+
name: result.scheme.name,
|
43
|
+
scheme: result.scheme,
|
44
|
+
offers: (ref = result.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
45
|
+
var _totalRepaymentAmount = decodePrice(offer.totalRepaymentAmount);
|
46
|
+
var _correctDownPaymentAmount = decodePrice(offer.correctDownPaymentAmount);
|
47
|
+
var _installmentAmount = decodePrice(offer.installmentAmount);
|
48
|
+
var _processingFeeAmount = decodePrice(offer.processingFeeAmount);
|
49
|
+
var totalRepaymentAmount = formatAsCurrency({
|
50
|
+
price: _totalRepaymentAmount,
|
51
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
52
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
53
|
+
locale: configLocale || 'en'
|
54
|
+
});
|
55
|
+
var correctDownPaymentAmount = formatAsCurrency({
|
56
|
+
price: _correctDownPaymentAmount,
|
57
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
58
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
59
|
+
locale: configLocale || 'en'
|
60
|
+
});
|
61
|
+
var installmentAmount = formatAsCurrency({
|
62
|
+
price: _installmentAmount,
|
63
|
+
precision: offer.installmentAmount.fractionDigits,
|
64
|
+
currency: offer.installmentAmount.currencyCode,
|
65
|
+
locale: configLocale || 'en'
|
66
|
+
});
|
67
|
+
var processingFeeAmount = formatAsCurrency({
|
68
|
+
price: _processingFeeAmount,
|
69
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
70
|
+
currency: offer.processingFeeAmount.currencyCode,
|
71
|
+
locale: configLocale || 'en'
|
72
|
+
});
|
73
|
+
return _objectSpread({}, offer, {
|
74
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
75
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
76
|
+
installmentAmount: installmentAmount,
|
77
|
+
processingFeeAmount: processingFeeAmount
|
78
|
+
});
|
79
|
+
}).sort(function(offer, offer2) {
|
80
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
81
|
+
})
|
82
|
+
};
|
76
83
|
})
|
77
84
|
});
|
78
85
|
}, [
|
@@ -31,14 +31,17 @@ function _asyncToGenerator(fn) {
|
|
31
31
|
}
|
32
32
|
export var fetchRedirectByFrom = function() {
|
33
33
|
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(from) {
|
34
|
+
var redirectUrl;
|
34
35
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
35
36
|
while(1)switch(_ctx.prev = _ctx.next){
|
36
37
|
case 0:
|
37
38
|
_ctx.next = 2;
|
38
39
|
return RedirectsGetByFrom(from);
|
39
40
|
case 2:
|
40
|
-
|
41
|
-
|
41
|
+
redirectUrl = _ctx.sent;
|
42
|
+
redirectUrl.to = encodeURI(redirectUrl.to);
|
43
|
+
return _ctx.abrupt("return", redirectUrl);
|
44
|
+
case 5:
|
42
45
|
case "end":
|
43
46
|
return _ctx.stop();
|
44
47
|
}
|
@@ -58,25 +58,25 @@ export declare type ListingDataType = {
|
|
58
58
|
items?: SearchResultDTO[];
|
59
59
|
activeFilters: FormattedAggregationResultType[];
|
60
60
|
};
|
61
|
-
export declare
|
62
|
-
'/'
|
63
|
-
'/[slug]/p'
|
64
|
-
'/[slug]/c'
|
65
|
-
'/[slug]/[cat]/c'
|
66
|
-
'/[slug]/b'
|
67
|
-
'/[slug]/[cat]/b'
|
68
|
-
'/[slug]/v'
|
69
|
-
'/[slug]/ct'
|
70
|
-
'/search'
|
71
|
-
'/profile/[[...tab]]'
|
72
|
-
'/favorites'
|
73
|
-
'/basket'
|
74
|
-
'/checkout'
|
75
|
-
'/order/[orderId]'
|
76
|
-
'/stores'
|
77
|
-
'/vouchers'
|
78
|
-
'/login'
|
79
|
-
}
|
61
|
+
export declare const PageTypeMap: {
|
62
|
+
'/': string;
|
63
|
+
'/[slug]/p': string;
|
64
|
+
'/[slug]/c': string;
|
65
|
+
'/[slug]/[cat]/c': string;
|
66
|
+
'/[slug]/b': string;
|
67
|
+
'/[slug]/[cat]/b': string;
|
68
|
+
'/[slug]/v': string;
|
69
|
+
'/[slug]/ct': string;
|
70
|
+
'/search': string;
|
71
|
+
'/profile/[[...tab]]': string;
|
72
|
+
'/favorites': string;
|
73
|
+
'/basket': string;
|
74
|
+
'/checkout': string;
|
75
|
+
'/order/[orderId]': string;
|
76
|
+
'/stores': string;
|
77
|
+
'/vouchers': string;
|
78
|
+
'/login': string;
|
79
|
+
};
|
80
80
|
export declare enum GenericActionTypesEnum {
|
81
81
|
changeBasket = "changeBasket",
|
82
82
|
changeProfileData = "changeProfileData",
|
@@ -3,6 +3,8 @@ export declare const useBnpCalculateForCart: (props?: {
|
|
3
3
|
downPaymentCentAmount?: number | undefined;
|
4
4
|
} | undefined) => {
|
5
5
|
data: {
|
6
|
+
name: string;
|
7
|
+
scheme: import("@sentecacommerce/sdk").PricingSchemesDTO;
|
6
8
|
offers: {
|
7
9
|
offerRaw: import("@sentecacommerce/sdk").LoanVariantDTO;
|
8
10
|
totalRepaymentAmount: import("../../index").FormattedPriceType;
|
@@ -13,9 +15,8 @@ export declare const useBnpCalculateForCart: (props?: {
|
|
13
15
|
maturity: string;
|
14
16
|
nir: string;
|
15
17
|
variantId: string;
|
16
|
-
}[]
|
17
|
-
|
18
|
-
};
|
18
|
+
}[];
|
19
|
+
}[] | undefined;
|
19
20
|
canFetchMore: boolean | undefined;
|
20
21
|
clear: () => void;
|
21
22
|
error: unknown;
|
@@ -4,14 +4,18 @@ export declare const useBnpOffers: (props: {
|
|
4
4
|
downPaymentCentAmount?: number;
|
5
5
|
}) => {
|
6
6
|
data: {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
name: string;
|
8
|
+
scheme: import("@sentecacommerce/sdk").PricingSchemesDTO;
|
9
|
+
offers: {
|
10
|
+
totalRepaymentAmount: import("../../index").FormattedPriceType;
|
11
|
+
correctDownPaymentAmount: import("../../index").FormattedPriceType;
|
12
|
+
installmentAmount: import("../../index").FormattedPriceType;
|
13
|
+
processingFeeAmount: import("../../index").FormattedPriceType;
|
14
|
+
apr: string;
|
15
|
+
maturity: string;
|
16
|
+
nir: string;
|
17
|
+
variantId: string;
|
18
|
+
}[];
|
15
19
|
}[] | undefined;
|
16
20
|
canFetchMore: boolean | undefined;
|
17
21
|
clear: () => void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { GroupField, NumberField, StringField } from
|
1
|
+
import { GroupField, NumberField, StringField } from '@sentecacommerce-theme/cms';
|
2
2
|
export interface DefaultConfig {
|
3
3
|
organizationPhone: StringField;
|
4
4
|
domain: StringField;
|
@@ -25,7 +25,7 @@ export interface DefaultConfig {
|
|
25
25
|
redirectURI: StringField;
|
26
26
|
}>;
|
27
27
|
google: GroupField<{
|
28
|
-
|
28
|
+
oneTapId: StringField;
|
29
29
|
analytics: StringField;
|
30
30
|
reMarketing: GroupField<{
|
31
31
|
id: StringField;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
3
3
|
"sideEffects": false,
|
4
|
-
"version": "0.13.
|
4
|
+
"version": "0.13.20",
|
5
5
|
"main": "dist/cjs/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
7
7
|
"types": "dist/types/index.d.ts",
|
@@ -31,13 +31,13 @@
|
|
31
31
|
"watch:cjs": "swc src --out-dir dist/cjs -w",
|
32
32
|
"watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "180efa3c715ce270c82969af7a8ecbd6176286f6",
|
35
35
|
"peerDependencies": {
|
36
36
|
"react-query": "^2.26.2"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@sentecacommerce-theme/base": "^0.13.
|
40
|
-
"@sentecacommerce-theme/cms": "^0.13.
|
39
|
+
"@sentecacommerce-theme/base": "^0.13.20",
|
40
|
+
"@sentecacommerce-theme/cms": "^0.13.20",
|
41
41
|
"@sentecacommerce/sdk": "2.0.175",
|
42
42
|
"body-scroll-lock": "^3.1.5",
|
43
43
|
"copy-to-clipboard": "^3.3.1",
|