ordering-ui-external 2.4.6 → 2.5.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/_bundles/{0.ordering-ui.038c4b4d536032472bc7.js → 0.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{1.ordering-ui.038c4b4d536032472bc7.js → 1.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{2.ordering-ui.038c4b4d536032472bc7.js → 2.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{4.ordering-ui.038c4b4d536032472bc7.js → 4.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{5.ordering-ui.038c4b4d536032472bc7.js → 5.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{6.ordering-ui.038c4b4d536032472bc7.js → 6.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js → 7.ordering-ui.5657c6a53b3791887fd7.js} +2 -2
- package/_bundles/{8.ordering-ui.038c4b4d536032472bc7.js → 8.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{9.ordering-ui.038c4b4d536032472bc7.js → 9.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/ordering-ui.5657c6a53b3791887fd7.js +2 -0
- package/_modules/components/OrdersOption/styles.js +1 -1
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
- package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
- package/_modules/contexts/ThemeContext/index.js +1 -0
- package/_modules/themes/five/src/components/AddressList/index.js +8 -7
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
- package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
- package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
- package/_modules/themes/five/src/components/Cart/index.js +7 -3
- package/_modules/themes/five/src/components/Checkout/index.js +12 -11
- package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +29 -21
- package/_modules/themes/five/src/components/Header/styles.js +44 -40
- package/_modules/themes/five/src/components/MultiCheckout/index.js +18 -16
- package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
- package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
- package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +5 -2
- package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
- package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
- package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
- package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
- package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
- package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
- package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
- package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
- package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
- package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
- package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
- package/_modules/utils/index.js +8 -2
- package/index.html +1 -1
- package/package.json +3 -2
- package/src/components/OrdersOption/styles.js +1 -0
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
- package/src/components/VerticalOrdersLayout/styles.js +9 -0
- package/src/contexts/ThemeContext/index.js +1 -0
- package/src/themes/five/src/components/AddressList/index.js +6 -6
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
- package/src/themes/five/src/components/BusinessController/index.js +4 -2
- package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
- package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
- package/src/themes/five/src/components/Cart/index.js +3 -4
- package/src/themes/five/src/components/Checkout/index.js +18 -4
- package/src/themes/five/src/components/Checkout/styles.js +22 -0
- package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
- package/src/themes/five/src/components/Header/index.js +17 -5
- package/src/themes/five/src/components/Header/styles.js +9 -6
- package/src/themes/five/src/components/MultiCheckout/index.js +9 -10
- package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
- package/src/themes/five/src/components/MyOrders/index.js +13 -9
- package/src/themes/five/src/components/MyOrders/styles.js +3 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +3 -2
- package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
- package/src/themes/five/src/components/OrderDetails/index.js +2 -2
- package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/src/themes/five/src/components/OrderProgress/index.js +16 -5
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
- package/src/themes/five/src/components/PageBanner/styles.js +1 -4
- package/src/themes/five/src/components/ProductForm/index.js +23 -5
- package/src/themes/five/src/components/ProductForm/styles.js +36 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
- package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
- package/src/themes/five/src/components/ServiceForm/index.js +22 -4
- package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
- package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
- package/src/themes/five/src/components/SignUpForm/index.js +4 -3
- package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
- package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
- package/src/themes/five/src/components/UserPopover/index.js +26 -15
- package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
- package/src/themes/five/src/styles/Buttons/index.js +11 -0
- package/src/themes/five/src/styles/Inputs/index.js +34 -0
- package/src/utils/index.js +5 -0
- package/template/app.js +5 -3
- package/template/theme.json +335 -24
- package/_bundles/ordering-ui.038c4b4d536032472bc7.js +0 -2
- /package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → 7.ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
|
@@ -51,7 +51,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
51
51
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
52
52
|
var PIXELS_TO_SCROLL = 300;
|
|
53
53
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
54
|
-
var _ref, _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _orderState$options, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _theme$business_listi9, _theme$business_listi10, _theme$business_listi11, _theme$business_listi12, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderState$options2, _orderState$options3, _businessesList$busin3, _configs$business_lis, _configs$business_lis2, _theme$images2, _theme$images2$genera, _theme$business_listi22, _theme$business_listi23, _theme$business_listi24, _theme$business_listi25, _Object$values, _configs$
|
|
54
|
+
var _citiesState$cities, _ref, _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _orderState$options, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _theme$business_listi9, _theme$business_listi10, _theme$business_listi11, _theme$business_listi12, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderState$options2, _orderState$options3, _businessesList$busin3, _orderState$options7, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$images2$genera, _theme$business_listi22, _theme$business_listi23, _theme$business_listi24, _theme$business_listi25, _Object$values, _configs$business_lis4, _theme$images3, _theme$images3$genera, _theme$business_listi26, _theme$business_listi27, _theme$business_listi28, _theme$business_listi29, _citiesState$cities5, _citiesState$cities6, _citiesState$cities6$, _configs$advanced_bus, _orderState$options9, _orderState$options9$, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _citiesState$cities8$, _orderState$options11, _orderState$options12, _businessesList$busin6, _businessesList$busin7;
|
|
55
55
|
var businessesList = props.businessesList,
|
|
56
56
|
paginationProps = props.paginationProps,
|
|
57
57
|
searchValue = props.searchValue,
|
|
@@ -126,7 +126,10 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
126
126
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
127
127
|
favoriteIds = _useState16[0],
|
|
128
128
|
setFavoriteIds = _useState16[1];
|
|
129
|
-
var
|
|
129
|
+
var allCitiesDisabled = citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities = citiesState.cities) === null || _citiesState$cities === void 0 ? void 0 : _citiesState$cities.every(function (city) {
|
|
130
|
+
return !city.enabled;
|
|
131
|
+
});
|
|
132
|
+
var hideCities = (_ref = (theme === null || theme === void 0 ? void 0 : (_theme$business_listi = theme.business_listing_view) === null || _theme$business_listi === void 0 ? void 0 : (_theme$business_listi2 = _theme$business_listi.components) === null || _theme$business_listi2 === void 0 ? void 0 : (_theme$business_listi3 = _theme$business_listi2.cities) === null || _theme$business_listi3 === void 0 ? void 0 : _theme$business_listi3.hidden) || (orderState === null || orderState === void 0 ? void 0 : (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) !== 2 || allCitiesDisabled) !== null && _ref !== void 0 ? _ref : true;
|
|
130
133
|
var hideSearch = theme === null || theme === void 0 ? void 0 : (_theme$business_listi4 = theme.business_listing_view) === null || _theme$business_listi4 === void 0 ? void 0 : (_theme$business_listi5 = _theme$business_listi4.components) === null || _theme$business_listi5 === void 0 ? void 0 : (_theme$business_listi6 = _theme$business_listi5.search) === null || _theme$business_listi6 === void 0 ? void 0 : _theme$business_listi6.hidden;
|
|
131
134
|
var hideFilter = (theme === null || theme === void 0 ? void 0 : (_theme$business_listi7 = theme.business_listing_view) === null || _theme$business_listi7 === void 0 ? void 0 : (_theme$business_listi8 = _theme$business_listi7.components) === null || _theme$business_listi8 === void 0 ? void 0 : (_theme$business_listi9 = _theme$business_listi8.filter) === null || _theme$business_listi9 === void 0 ? void 0 : _theme$business_listi9.hidden) || hideSearch;
|
|
132
135
|
var hideHero = theme === null || theme === void 0 ? void 0 : (_theme$business_listi10 = theme.business_listing_view) === null || _theme$business_listi10 === void 0 ? void 0 : (_theme$business_listi11 = _theme$business_listi10.components) === null || _theme$business_listi11 === void 0 ? void 0 : (_theme$business_listi12 = _theme$business_listi11.business_hero) === null || _theme$business_listi12 === void 0 ? void 0 : _theme$business_listi12.hidden;
|
|
@@ -196,8 +199,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
196
199
|
setPreorderBusiness(null);
|
|
197
200
|
};
|
|
198
201
|
var handleOpenCities = function handleOpenCities() {
|
|
199
|
-
var _citiesState$
|
|
200
|
-
if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$
|
|
202
|
+
var _citiesState$cities2;
|
|
203
|
+
if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities2 = citiesState.cities) !== null && _citiesState$cities2 !== void 0 && _citiesState$cities2.length)) {
|
|
201
204
|
getCities();
|
|
202
205
|
}
|
|
203
206
|
setModals(_objectSpread(_objectSpread({}, modals), {}, {
|
|
@@ -222,6 +225,15 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
222
225
|
});
|
|
223
226
|
setFavoriteIds(_toConsumableArray(new Set(ids)));
|
|
224
227
|
}, [businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length]);
|
|
228
|
+
(0, _react.useEffect)(function () {
|
|
229
|
+
var _citiesState$cities3, _orderState$options5, _citiesState$cities4;
|
|
230
|
+
if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities3 = citiesState.cities) !== null && _citiesState$cities3 !== void 0 && _citiesState$cities3.length) || !(orderState !== null && orderState !== void 0 && (_orderState$options5 = orderState.options) !== null && _orderState$options5 !== void 0 && _orderState$options5.city_id)) return;
|
|
231
|
+
var selectedCity = citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities4 = citiesState.cities) === null || _citiesState$cities4 === void 0 ? void 0 : _citiesState$cities4.find(function (city) {
|
|
232
|
+
var _orderState$options6;
|
|
233
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.city_id);
|
|
234
|
+
});
|
|
235
|
+
if (!selectedCity || !(selectedCity !== null && selectedCity !== void 0 && selectedCity.enabled)) changeCityFilter(null);
|
|
236
|
+
}, [citiesState, orderState === null || orderState === void 0 ? void 0 : (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7.city_id]);
|
|
225
237
|
if (logosLayout) {
|
|
226
238
|
var _businessesList$busin4, _businessesList$busin5;
|
|
227
239
|
return /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosContainer, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
@@ -246,8 +258,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
246
258
|
}
|
|
247
259
|
return /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, (windowSize.width < 576 || (configs === null || configs === void 0 ? void 0 : (_configs$business_lis = configs.business_listing_hide_image) === null || _configs$business_lis === void 0 ? void 0 : _configs$business_lis.value) !== '1' && !isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_OrderContextUI.OrderContextUI, {
|
|
248
260
|
isBusinessList: true,
|
|
249
|
-
hideHero: !hideHero
|
|
250
|
-
}), (configs === null || configs === void 0 ? void 0 : (_configs$
|
|
261
|
+
hideHero: !!(configs !== null && configs !== void 0 && (_configs$business_lis2 = configs.business_listing_hide_image) !== null && _configs$business_lis2 !== void 0 && _configs$business_lis2.value) && !hideHero
|
|
262
|
+
}), (configs === null || configs === void 0 ? void 0 : (_configs$business_lis3 = configs.business_listing_hide_image) === null || _configs$business_lis3 === void 0 ? void 0 : _configs$business_lis3.value) !== '1' && !isChew && !hideHero && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
251
263
|
bgimage: (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$genera = _theme$images2.general) === null || _theme$images2$genera === void 0 ? void 0 : _theme$images2$genera.businessHero,
|
|
252
264
|
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi22 = theme.business_listing_view) === null || _theme$business_listi22 === void 0 ? void 0 : (_theme$business_listi23 = _theme$business_listi22.components) === null || _theme$business_listi23 === void 0 ? void 0 : (_theme$business_listi24 = _theme$business_listi23.business_hero) === null || _theme$business_listi24 === void 0 ? void 0 : (_theme$business_listi25 = _theme$business_listi24.style) === null || _theme$business_listi25 === void 0 ? void 0 : _theme$business_listi25.height
|
|
253
265
|
})), !!((_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) !== null && _Object$values !== void 0 && _Object$values.length) && /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
@@ -256,7 +268,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
256
268
|
userCustomerId: userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
257
269
|
asDashboard: isCustomerMode,
|
|
258
270
|
isCustomerMode: isCustomerMode
|
|
259
|
-
}), (configs === null || configs === void 0 ? void 0 : (_configs$
|
|
271
|
+
}), (configs === null || configs === void 0 ? void 0 : (_configs$business_lis4 = configs.business_listing_hide_image) === null || _configs$business_lis4 === void 0 ? void 0 : _configs$business_lis4.value) !== '1' && isChew && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
260
272
|
bgimage: (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$genera = _theme$images3.general) === null || _theme$images3$genera === void 0 ? void 0 : _theme$images3$genera.businessHero,
|
|
261
273
|
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi26 = theme.business_listing_view) === null || _theme$business_listi26 === void 0 ? void 0 : (_theme$business_listi27 = _theme$business_listi26.components) === null || _theme$business_listi27 === void 0 ? void 0 : (_theme$business_listi28 = _theme$business_listi27.business_hero) === null || _theme$business_listi28 === void 0 ? void 0 : (_theme$business_listi29 = _theme$business_listi28.style) === null || _theme$business_listi29 === void 0 ? void 0 : _theme$business_listi29.height
|
|
262
274
|
}), isCustomerMode && !hidePreviousOrders && !businessesList.loading && /*#__PURE__*/_react.default.createElement(_OrdersSection.OrdersSection, {
|
|
@@ -281,13 +293,13 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
281
293
|
page: 'business_search'
|
|
282
294
|
});
|
|
283
295
|
}
|
|
284
|
-
}), !hideCities && (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$
|
|
296
|
+
}), !hideCities && (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities5 = citiesState.cities) === null || _citiesState$cities5 === void 0 ? void 0 : _citiesState$cities5.length) > 0 && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
285
297
|
color: "primary",
|
|
286
298
|
onClick: handleOpenCities
|
|
287
|
-
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$
|
|
288
|
-
var _orderState$
|
|
289
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
290
|
-
})) === null || _citiesState$
|
|
299
|
+
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities6 = citiesState.cities) === null || _citiesState$cities6 === void 0 ? void 0 : (_citiesState$cities6$ = _citiesState$cities6.find(function (city) {
|
|
300
|
+
var _orderState$options8;
|
|
301
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.city_id);
|
|
302
|
+
})) === null || _citiesState$cities6$ === void 0 ? void 0 : _citiesState$cities6$.name) || t('SELECT_A_CITY', 'Select a city')), !hideFilter && (configs === null || configs === void 0 ? void 0 : (_configs$advanced_bus = configs.advanced_business_search_enabled) === null || _configs$advanced_bus === void 0 ? void 0 : _configs$advanced_bus.value) === '1' && /*#__PURE__*/_react.default.createElement(_FiFilter.default, {
|
|
291
303
|
onClick: function onClick() {
|
|
292
304
|
return onRedirectPage({
|
|
293
305
|
page: 'business_search'
|
|
@@ -297,7 +309,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
297
309
|
onClick: toggleMap
|
|
298
310
|
})), activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
299
311
|
businessList: businessesList.businesses,
|
|
300
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
312
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : (_orderState$options9$ = _orderState$options9.address) === null || _orderState$options9$ === void 0 ? void 0 : _orderState$options9$.location,
|
|
301
313
|
setErrors: setMapErrors
|
|
302
314
|
})), !isChew && hasHighRatedBusiness && !props.franchiseId && !hideHighestBusiness && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
|
|
303
315
|
handleClickAddress: handleClickAddress,
|
|
@@ -333,15 +345,15 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
333
345
|
}
|
|
334
346
|
}), isCustomLayout && /*#__PURE__*/_react.default.createElement(_FiMap.default, {
|
|
335
347
|
onClick: toggleMap
|
|
336
|
-
}), !hideCities && (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$
|
|
348
|
+
}), !hideCities && (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities7 = citiesState.cities) === null || _citiesState$cities7 === void 0 ? void 0 : _citiesState$cities7.length) > 0 && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
337
349
|
color: "primary",
|
|
338
350
|
onClick: handleOpenCities
|
|
339
|
-
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$
|
|
340
|
-
var _orderState$
|
|
341
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
342
|
-
})) === null || _citiesState$
|
|
351
|
+
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities8 = citiesState.cities) === null || _citiesState$cities8 === void 0 ? void 0 : (_citiesState$cities8$ = _citiesState$cities8.find(function (city) {
|
|
352
|
+
var _orderState$options10;
|
|
353
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.city_id);
|
|
354
|
+
})) === null || _citiesState$cities8$ === void 0 ? void 0 : _citiesState$cities8$.name) || t('SELECT_A_CITY', 'Select a city')))), isCustomerMode && activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
343
355
|
businessList: businessesList.businesses,
|
|
344
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
356
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : (_orderState$options12 = _orderState$options11.address) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.location,
|
|
345
357
|
setErrors: setMapErrors
|
|
346
358
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.length) > 0 || isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
347
359
|
content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
|
|
@@ -355,14 +367,14 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
355
367
|
height: '44px'
|
|
356
368
|
}
|
|
357
369
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin7 = businessesList.businesses) === null || _businessesList$busin7 === void 0 ? void 0 : _businessesList$busin7.map(function (business) {
|
|
358
|
-
var _orderState$
|
|
370
|
+
var _orderState$options13, _business$reviews;
|
|
359
371
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
360
372
|
key: business.id,
|
|
361
373
|
className: "card",
|
|
362
374
|
business: business,
|
|
363
375
|
isBusinessOpen: business.open,
|
|
364
376
|
handleCustomClick: handleBusinessClick,
|
|
365
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
377
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options13 = orderState.options) === null || _orderState$options13 === void 0 ? void 0 : _orderState$options13.type,
|
|
366
378
|
isCustomLayout: isCustomLayout,
|
|
367
379
|
isCustomerMode: isCustomerMode,
|
|
368
380
|
onPreorderBusiness: setPreorderBusiness,
|
|
@@ -380,13 +392,13 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
380
392
|
setFavoriteIds: setFavoriteIds
|
|
381
393
|
});
|
|
382
394
|
}), (businessesList.loading || !(businessesList !== null && businessesList !== void 0 && businessesList.fetched)) && _toConsumableArray(Array((paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.nextPageItems) > 4 ? paginationProps.nextPageItems : 8).keys()).map(function (i) {
|
|
383
|
-
var _orderState$
|
|
395
|
+
var _orderState$options14;
|
|
384
396
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
385
397
|
key: i,
|
|
386
398
|
className: "card",
|
|
387
399
|
business: {},
|
|
388
400
|
isSkeleton: true,
|
|
389
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
401
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options14 = orderState.options) === null || _orderState$options14 === void 0 ? void 0 : _orderState$options14.type
|
|
390
402
|
});
|
|
391
403
|
}))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
392
404
|
open: isPreorder,
|
|
@@ -44,7 +44,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
44
44
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
45
45
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
46
46
|
var CartUI = function CartUI(props) {
|
|
47
|
-
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _theme$viewString$com, _theme$viewString$com2, _theme$viewString$com3, _theme$viewString$com4, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _theme$viewString2, _theme$viewString2$co, _theme$viewString2$co2, _theme$viewString2$co3, _theme$viewString2$co4, _orderState$options, _orderState$options2,
|
|
47
|
+
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _theme$viewString$com, _theme$viewString$com2, _theme$viewString$com3, _theme$viewString$com4, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _theme$viewString2, _theme$viewString2$co, _theme$viewString2$co2, _theme$viewString2$co3, _theme$viewString2$co4, _orderState$options, _orderState$options2, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers3$filter, _cart$offers4, _cart$offers4$filter, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes2, _cart$taxes3, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _cart$offers6$filter, _orderState$options3, _cart$offers7, _cart$offers8, _cart$offers8$filter, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options4, _validationFields$fie7, _validationFields$fie8, _validationFields$fie9, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _orderState$options5, _cart$business2, _cart$business3, _curProduct$calendar_, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
|
|
48
48
|
var currentCartUuid = props.currentCartUuid,
|
|
49
49
|
clearCart = props.clearCart,
|
|
50
50
|
isProducts = props.isProducts,
|
|
@@ -169,7 +169,11 @@ var CartUI = function CartUI(props) {
|
|
|
169
169
|
}, 0);
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
var
|
|
172
|
+
var clearAmount = function clearAmount(value) {
|
|
173
|
+
var _configs$format_numbe, _configs$format_numbe2;
|
|
174
|
+
return parseFloat((Math.trunc(value * 100) / 100).toFixed((_configs$format_numbe = (_configs$format_numbe2 = configs.format_number_decimal_length) === null || _configs$format_numbe2 === void 0 ? void 0 : _configs$format_numbe2.value) !== null && _configs$format_numbe !== void 0 ? _configs$format_numbe : 2));
|
|
175
|
+
};
|
|
176
|
+
var loyaltyRewardValue = clearAmount(((cart === null || cart === void 0 ? void 0 : cart.subtotal) + getIncludedTaxes()) * loyaltyRewardRate);
|
|
173
177
|
var momentFormatted = !(orderState !== null && orderState !== void 0 && (_orderState$option = orderState.option) !== null && _orderState$option !== void 0 && _orderState$option.moment) ? t('RIGHT_NOW', 'Right Now') : parseDate(orderState === null || orderState === void 0 ? void 0 : (_orderState$option2 = orderState.option) === null || _orderState$option2 === void 0 ? void 0 : _orderState$option2.moment, {
|
|
174
178
|
outputFormat: 'YYYY-MM-DD HH:mm'
|
|
175
179
|
});
|
|
@@ -488,7 +492,7 @@ var CartUI = function CartUI(props) {
|
|
|
488
492
|
useOrderContext: true
|
|
489
493
|
}))), /*#__PURE__*/_react.default.createElement("table", {
|
|
490
494
|
className: "total"
|
|
491
|
-
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('TOTAL', 'Total')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.total) >= 0 ? cart === null || cart === void 0 ? void 0 : cart.total : 0))), !!loyaltyRewardValue && isFinite(loyaltyRewardValue) &&
|
|
495
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('TOTAL', 'Total')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.total) >= 0 ? cart === null || cart === void 0 ? void 0 : cart.total : 0))), !!loyaltyRewardValue && isFinite(loyaltyRewardValue) && isCheckout && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, "\xA0"), /*#__PURE__*/_react.default.createElement("td", {
|
|
492
496
|
id: "loyalty"
|
|
493
497
|
}, t('REWARD_LOYALTY_POINT', 'Reward :amount: on loyalty points').replace(':amount:', loyaltyRewardValue))))), (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && !hideCartComments && /*#__PURE__*/_react.default.createElement("table", {
|
|
494
498
|
className: "comments"
|
|
@@ -62,7 +62,7 @@ var mapConfigs = {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
var CheckoutUI = function CheckoutUI(props) {
|
|
65
|
-
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _cardList$cards, _cartState$cart, _validationFields$
|
|
65
|
+
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _cart$comment, _cardList$cards, _cartState$cart, _validationFields$fie7, _validationFields$fie8, _validationFields$fie9, _validationFields$fie10, _validationFields$fie11, _validationFields$fie12, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _instructionsOptions$, _instructionsOptions$2, _theme$checkout, _theme$checkout$compo, _theme$checkout$compo2, _theme$checkout$compo3, _theme$checkout$compo4, _theme$checkout2, _theme$checkout2$comp, _theme$checkout2$comp2, _theme$checkout3, _theme$checkout3$comp, _theme$checkout3$comp2, _theme$checkout4, _theme$checkout4$comp, _theme$checkout4$comp2, _validationFields$fie13, _validationFields$fie14, _validationFields$fie15, _loyaltyPlansState$re, _creditPointPlan$busi, _options$address, _businessDetails$busi3, _theme$images, _theme$images$dummies, _configs$google_maps_, _customerState$user, _customerState$user2, _Object$values, _businessDetails$busi4, _businessDetails$busi5, _businessDetails$busi6, _businessDetails$busi7, _businessDetails$erro, _businessDetails$erro2, _businessDetails$busi8, _businessDetails$busi9, _businessDetails$busi10, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _cartState$cart$spot_, _cartState$cart2, _cart$business3, _cart$products2, _ref, _creditPointPlanOnBus, _configs$driver_tip_t3, _configs$driver_tip_u2, _configs$driver_tip_t4, _validationFields$fie24, _validationFields$fie25, _validationFields$fie26, _validationFields$fie27, _validationFields$fie28, _validationFields$fie29, _customerState$user3;
|
|
66
66
|
var cart = props.cart,
|
|
67
67
|
errors = props.errors,
|
|
68
68
|
placing = props.placing,
|
|
@@ -182,9 +182,10 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
182
182
|
var isGiftCardCart = !(cart !== null && cart !== void 0 && cart.business_id);
|
|
183
183
|
// const [hasBusinessPlaces, setHasBusinessPlaces] = useState(null)
|
|
184
184
|
|
|
185
|
+
var validateCommentsCartField = (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie = validationFields.fields) === null || _validationFields$fie === void 0 ? void 0 : (_validationFields$fie2 = _validationFields$fie.checkout) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.comments) === null || _validationFields$fie3 === void 0 ? void 0 : _validationFields$fie3.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie4 = validationFields.fields) === null || _validationFields$fie4 === void 0 ? void 0 : (_validationFields$fie5 = _validationFields$fie4.checkout) === null || _validationFields$fie5 === void 0 ? void 0 : (_validationFields$fie6 = _validationFields$fie5.comments) === null || _validationFields$fie6 === void 0 ? void 0 : _validationFields$fie6.required) && ((cart === null || cart === void 0 ? void 0 : cart.comment) === null || (cart === null || cart === void 0 ? void 0 : (_cart$comment = cart.comment) === null || _cart$comment === void 0 ? void 0 : _cart$comment.trim().length) === 0);
|
|
185
186
|
var isDisablePlaceOrderButton = !(cart !== null && cart !== void 0 && cart.valid) || !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 || (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.gateway) === 'stripe' && (cardList === null || cardList === void 0 ? void 0 : (_cardList$cards = cardList.cards) === null || _cardList$cards === void 0 ? void 0 : _cardList$cards.length) === 0 || placing || errorCash || loading || isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cartState !== null && cartState !== void 0 && (_cartState$cart = cartState.cart) !== null && _cartState$cart !== void 0 && _cartState$cart.spot_number || cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) || !(cart !== null && cart !== void 0 && cart.valid_maximum) || !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ||
|
|
186
187
|
// (((placeSpotTypes.includes(options?.type) && !cart?.place) && hasBusinessPlaces)) ||
|
|
187
|
-
options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
188
|
+
options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : (_validationFields$fie8 = _validationFields$fie7.checkout) === null || _validationFields$fie8 === void 0 ? void 0 : (_validationFields$fie9 = _validationFields$fie8.driver_tip) === null || _validationFields$fie9 === void 0 ? void 0 : _validationFields$fie9.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie10 = validationFields.fields) === null || _validationFields$fie10 === void 0 ? void 0 : (_validationFields$fie11 = _validationFields$fie10.checkout) === null || _validationFields$fie11 === void 0 ? void 0 : (_validationFields$fie12 = _validationFields$fie11.driver_tip) === null || _validationFields$fie12 === void 0 ? void 0 : _validationFields$fie12.required) && Number(cart === null || cart === void 0 ? void 0 : cart.driver_tip) <= 0 || validateCommentsCartField;
|
|
188
189
|
var driverTipsOptions = typeof (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o = configs.driver_tip_options) === null || _configs$driver_tip_o === void 0 ? void 0 : _configs$driver_tip_o.value) === 'string' ? JSON.parse(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o2 = configs.driver_tip_options) === null || _configs$driver_tip_o2 === void 0 ? void 0 : _configs$driver_tip_o2.value) || [] : (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o3 = configs.driver_tip_options) === null || _configs$driver_tip_o3 === void 0 ? void 0 : _configs$driver_tip_o3.value) || [];
|
|
189
190
|
var deliveryOptions = (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : instructionsOptions.result) && (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : (_instructionsOptions$ = instructionsOptions.result) === null || _instructionsOptions$ === void 0 ? void 0 : (_instructionsOptions$2 = _instructionsOptions$.filter(function (option) {
|
|
190
191
|
return option === null || option === void 0 ? void 0 : option.enabled;
|
|
@@ -197,9 +198,9 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
197
198
|
}));
|
|
198
199
|
var hideBusinessAddress = theme === null || theme === void 0 ? void 0 : (_theme$checkout = theme.checkout) === null || _theme$checkout === void 0 ? void 0 : (_theme$checkout$compo = _theme$checkout.components) === null || _theme$checkout$compo === void 0 ? void 0 : (_theme$checkout$compo2 = _theme$checkout$compo.business) === null || _theme$checkout$compo2 === void 0 ? void 0 : (_theme$checkout$compo3 = _theme$checkout$compo2.components) === null || _theme$checkout$compo3 === void 0 ? void 0 : (_theme$checkout$compo4 = _theme$checkout$compo3.address) === null || _theme$checkout$compo4 === void 0 ? void 0 : _theme$checkout$compo4.hidden;
|
|
199
200
|
var hideBusinessDetails = theme === null || theme === void 0 ? void 0 : (_theme$checkout2 = theme.checkout) === null || _theme$checkout2 === void 0 ? void 0 : (_theme$checkout2$comp = _theme$checkout2.components) === null || _theme$checkout2$comp === void 0 ? void 0 : (_theme$checkout2$comp2 = _theme$checkout2$comp.business) === null || _theme$checkout2$comp2 === void 0 ? void 0 : _theme$checkout2$comp2.hidden;
|
|
200
|
-
var hideBusinessMap = theme === null || theme === void 0 ? void 0 : (_theme$checkout3 = theme.checkout) === null || _theme$checkout3 === void 0 ? void 0 : (_theme$checkout3$comp = _theme$checkout3.components) === null || _theme$checkout3$comp === void 0 ? void 0 : (_theme$checkout3$comp2 = _theme$checkout3$comp.
|
|
201
|
+
var hideBusinessMap = theme === null || theme === void 0 ? void 0 : (_theme$checkout3 = theme.checkout) === null || _theme$checkout3 === void 0 ? void 0 : (_theme$checkout3$comp = _theme$checkout3.components) === null || _theme$checkout3$comp === void 0 ? void 0 : (_theme$checkout3$comp2 = _theme$checkout3$comp.map) === null || _theme$checkout3$comp2 === void 0 ? void 0 : _theme$checkout3$comp2.hidden;
|
|
201
202
|
var hideCustomerDetails = theme === null || theme === void 0 ? void 0 : (_theme$checkout4 = theme.checkout) === null || _theme$checkout4 === void 0 ? void 0 : (_theme$checkout4$comp = _theme$checkout4.components) === null || _theme$checkout4$comp === void 0 ? void 0 : (_theme$checkout4$comp2 = _theme$checkout4$comp.customer) === null || _theme$checkout4$comp2 === void 0 ? void 0 : _theme$checkout4$comp2.hidden;
|
|
202
|
-
var driverTipsField = !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && options.type === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
203
|
+
var driverTipsField = !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && options.type === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie13 = validationFields.fields) === null || _validationFields$fie13 === void 0 ? void 0 : (_validationFields$fie14 = _validationFields$fie13.checkout) === null || _validationFields$fie14 === void 0 ? void 0 : (_validationFields$fie15 = _validationFields$fie14.driver_tip) === null || _validationFields$fie15 === void 0 ? void 0 : _validationFields$fie15.enabled) && driverTipsOptions.length > 0 && !useKioskApp;
|
|
203
204
|
var creditPointPlan = loyaltyPlansState === null || loyaltyPlansState === void 0 ? void 0 : (_loyaltyPlansState$re = loyaltyPlansState.result) === null || _loyaltyPlansState$re === void 0 ? void 0 : _loyaltyPlansState$re.find(function (loyal) {
|
|
204
205
|
return loyal.type === 'credit_point';
|
|
205
206
|
});
|
|
@@ -243,20 +244,20 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
243
244
|
setIsUserDetailsEdit(false);
|
|
244
245
|
};
|
|
245
246
|
var checkValidationFields = function checkValidationFields() {
|
|
246
|
-
var _validationFields$
|
|
247
|
+
var _validationFields$fie16, _validationFields$fie17, _validationFields$fie18, _validationFields$fie19, _validationFields$fie20, _validationFields$fie21, _validationFields$fie22, _configs$verification;
|
|
247
248
|
setUserErrors([]);
|
|
248
249
|
var errors = [];
|
|
249
250
|
var notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes'];
|
|
250
251
|
var userSelected = isCustomerMode ? customerState.user : user;
|
|
251
252
|
var _requiredFields = [];
|
|
252
|
-
Object.values(validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
253
|
+
Object.values(validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie16 = validationFields.fields) === null || _validationFields$fie16 === void 0 ? void 0 : _validationFields$fie16.checkout).map(function (field) {
|
|
253
254
|
if (field !== null && field !== void 0 && field.enabled && field !== null && field !== void 0 && field.required && !notFields.includes(field.code)) {
|
|
254
255
|
if (userSelected && !userSelected[field === null || field === void 0 ? void 0 : field.code]) {
|
|
255
256
|
_requiredFields.push(field === null || field === void 0 ? void 0 : field.code);
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
});
|
|
259
|
-
if (userSelected && !(userSelected !== null && userSelected !== void 0 && userSelected.cellphone) && (validationFields !== null && validationFields !== void 0 && (_validationFields$
|
|
260
|
+
if (userSelected && !(userSelected !== null && userSelected !== void 0 && userSelected.cellphone) && (validationFields !== null && validationFields !== void 0 && (_validationFields$fie17 = validationFields.fields) !== null && _validationFields$fie17 !== void 0 && (_validationFields$fie18 = _validationFields$fie17.checkout) !== null && _validationFields$fie18 !== void 0 && (_validationFields$fie19 = _validationFields$fie18.cellphone) !== null && _validationFields$fie19 !== void 0 && _validationFields$fie19.enabled && validationFields !== null && validationFields !== void 0 && (_validationFields$fie20 = validationFields.fields) !== null && _validationFields$fie20 !== void 0 && (_validationFields$fie21 = _validationFields$fie20.checkout) !== null && _validationFields$fie21 !== void 0 && (_validationFields$fie22 = _validationFields$fie21.cellphone) !== null && _validationFields$fie22 !== void 0 && _validationFields$fie22.required || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1')) {
|
|
260
261
|
_requiredFields.push('cellphone');
|
|
261
262
|
}
|
|
262
263
|
setRequiredFields(_requiredFields);
|
|
@@ -295,8 +296,8 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
295
296
|
window.scrollTo(0, scrollElement.offsetTop - 20);
|
|
296
297
|
};
|
|
297
298
|
(0, _react.useEffect)(function () {
|
|
298
|
-
var _validationFields$
|
|
299
|
-
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$
|
|
299
|
+
var _validationFields$fie23;
|
|
300
|
+
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$fie23 = validationFields.fields) !== null && _validationFields$fie23 !== void 0 && _validationFields$fie23.checkout) {
|
|
300
301
|
checkValidationFields();
|
|
301
302
|
}
|
|
302
303
|
}, [validationFields, user, customerState]);
|
|
@@ -469,7 +470,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
469
470
|
}
|
|
470
471
|
})), /*#__PURE__*/_react.default.createElement(_styles.CheckOutDivider, null)), !cartState.loading && cart && /*#__PURE__*/_react.default.createElement(_styles.PaymentMethodContainer, {
|
|
471
472
|
className: "paymentsContainer"
|
|
472
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null, t('PAYMENT_METHODS', 'Payment Methods')), !cartState.loading && (cart === null || cart === void 0 ? void 0 : cart.status) === 4 && /*#__PURE__*/_react.default.createElement(_styles.WarningMessage, {
|
|
473
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.SectionTitleContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('PAYMENT_METHODS', 'Payment Methods')), /*#__PURE__*/_react.default.createElement(_styles.Flag, null, t('REQUIRED', 'Required'))), !cartState.loading && (cart === null || cart === void 0 ? void 0 : cart.status) === 4 && /*#__PURE__*/_react.default.createElement(_styles.WarningMessage, {
|
|
473
474
|
style: {
|
|
474
475
|
marginTop: 20
|
|
475
476
|
}
|
|
@@ -537,7 +538,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
537
538
|
onClick: function onClick() {
|
|
538
539
|
return handlePlaceOrder();
|
|
539
540
|
}
|
|
540
|
-
}, !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) : !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? "".concat(t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:'), " ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.minimum)) : placing ? t('PLACING', 'Placing') : t('PLACE_ORDER', 'Place Order'))), !(cart !== null && cart !== void 0 && cart.valid_address) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')), !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_NOT_PAYMENT_SELECTED', 'Please, select a payment method to place order.')), !(cart !== null && cart !== void 0 && cart.valid_products) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')), isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')), options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
541
|
+
}, !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) : !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? "".concat(t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:'), " ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.minimum)) : placing ? t('PLACING', 'Placing') : t('PLACE_ORDER', 'Place Order'))), !(cart !== null && cart !== void 0 && cart.valid_address) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')), !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_NOT_PAYMENT_SELECTED', 'Please, select a payment method to place order.')), !(cart !== null && cart !== void 0 && cart.valid_products) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')), isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')), options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie24 = validationFields.fields) === null || _validationFields$fie24 === void 0 ? void 0 : (_validationFields$fie25 = _validationFields$fie24.checkout) === null || _validationFields$fie25 === void 0 ? void 0 : (_validationFields$fie26 = _validationFields$fie25.driver_tip) === null || _validationFields$fie26 === void 0 ? void 0 : _validationFields$fie26.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie27 = validationFields.fields) === null || _validationFields$fie27 === void 0 ? void 0 : (_validationFields$fie28 = _validationFields$fie27.checkout) === null || _validationFields$fie28 === void 0 ? void 0 : (_validationFields$fie29 = _validationFields$fie28.driver_tip) === null || _validationFields$fie29 === void 0 ? void 0 : _validationFields$fie29.required) && Number(cart === null || cart === void 0 ? void 0 : cart.driver_tip) <= 0 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_DRIVER_TIP', 'Driver Tip is required.')), validateCommentsCartField && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_CART_COMMENTS', 'Cart comments is required.')), (cart === null || cart === void 0 ? void 0 : cart.valid_preorder) !== undefined && !(cart !== null && cart !== void 0 && cart.valid_preorder) && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('INVALID_CART_MOMENT', 'Selected schedule time is invalid, please select a schedule into the business schedule interval.'))), windowSize.width < 576 && !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.MobileWrapperPlaceOrderButton, null, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.total)), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
541
542
|
color: !(cart !== null && cart !== void 0 && cart.valid_maximum) || !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? 'secundary' : 'primary',
|
|
542
543
|
disabled: isDisablePlaceOrderButton,
|
|
543
544
|
onClick: function onClick() {
|
|
@@ -4,9 +4,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperUserDetails = exports.WrapperRightContainer = exports.WrapperPlaceOrderButton = exports.WrapperLeftContent = exports.WrapperLeftContainer = exports.WrapperActionsInput = exports.WarningText = exports.WarningMessage = exports.WalletPaymentOptionContainer = exports.UserDetailsContainer = exports.SelectSpotContainer = exports.PaymentMethodContainer = exports.OrderContextUIWrapper = exports.NotFoundImage = exports.MobileWrapperPlaceOrderButton = exports.HeaderContent = exports.DriverTipDivider = exports.DriverTipContainer = exports.DeliveryOptionsContainer = exports.Container = exports.CheckOutDivider = exports.CartsList = exports.CartHeader = exports.CartContainer = exports.BusinessDetailsContainer = exports.AuthButtonList = void 0;
|
|
7
|
+
exports.WrapperUserDetails = exports.WrapperRightContainer = exports.WrapperPlaceOrderButton = exports.WrapperLeftContent = exports.WrapperLeftContainer = exports.WrapperActionsInput = exports.WarningText = exports.WarningMessage = exports.WalletPaymentOptionContainer = exports.UserDetailsContainer = exports.SelectSpotContainer = exports.SectionTitleContainer = exports.PaymentMethodContainer = exports.OrderContextUIWrapper = exports.NotFoundImage = exports.MobileWrapperPlaceOrderButton = exports.HeaderContent = exports.Flag = exports.DriverTipDivider = exports.DriverTipContainer = exports.DeliveryOptionsContainer = exports.Container = exports.CheckOutDivider = exports.CartsList = exports.CartHeader = exports.CartContainer = exports.BusinessDetailsContainer = exports.AuthButtonList = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30;
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -70,11 +70,15 @@ var WrapperActionsInput = _styledComponents.default.div(_templateObject23 || (_t
|
|
|
70
70
|
exports.WrapperActionsInput = WrapperActionsInput;
|
|
71
71
|
var MobileWrapperPlaceOrderButton = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n position: fixed;\n width: 100vw;\n left: 0;\n bottom: 0;\n background-color: white;\n padding: 15px 25px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n z-index: 1006;\n box-shadow: 0px 4px 10px rgb(0 0 0 / 12%);\n\n span {\n font-weight: 600;\n font-size: 16px;\n\n @media (min-width: 1200px) {\n font-size: 18px;\n padding-left: 20px;\n }\n }\n\n button {\n min-height: 44px;\n border-radius: 7.6px;\n }\n"])));
|
|
72
72
|
exports.MobileWrapperPlaceOrderButton = MobileWrapperPlaceOrderButton;
|
|
73
|
-
var OrderContextUIWrapper = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n flex: 1;\n margin-left: 15px;\n ", "\n"])), function (props) {
|
|
73
|
+
var OrderContextUIWrapper = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n flex: 1;\n margin-left: 15px;\n max-width: 85%;\n\n ", "\n\n @media (min-width: 480px) {\n max-width: 90%;\n }\n"])), function (props) {
|
|
74
74
|
return props.theme.rtl && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n margin-left: 0px;\n margin-right: 15px;\n "])));
|
|
75
75
|
});
|
|
76
76
|
exports.OrderContextUIWrapper = OrderContextUIWrapper;
|
|
77
77
|
var HeaderContent = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n .back-arrow {\n font-size: 24px;\n cursor: pointer;\n }\n"])));
|
|
78
78
|
exports.HeaderContent = HeaderContent;
|
|
79
79
|
var AuthButtonList = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n h2 {\n font-weight: 600;\n font-size: 20px;\n margin-bottom: 3px;\n }\n button {\n width: 100%;\n height: 44px;\n margin-top: 22px;\n }\n"])));
|
|
80
|
-
exports.AuthButtonList = AuthButtonList;
|
|
80
|
+
exports.AuthButtonList = AuthButtonList;
|
|
81
|
+
var Flag = _styledComponents.default.span(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n font-size: 13px;\n margin: 0px;\n text-transform: capitalize;\n color: #E63757;\n font-weight: 500;\n\n @media (min-width: 381px) {\n font-size: 14px;\n }\n"])));
|
|
82
|
+
exports.Flag = Flag;
|
|
83
|
+
var SectionTitleContainer = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
|
|
84
|
+
exports.SectionTitleContainer = SectionTitleContainer;
|
|
@@ -44,6 +44,7 @@ var GiftCardUI = function GiftCardUI(props) {
|
|
|
44
44
|
}
|
|
45
45
|
}, t('REDEEM_GIFT_CARD', 'Redeem gift card'))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
46
46
|
width: "700px",
|
|
47
|
+
padding: "0px",
|
|
47
48
|
open: openModal === 'purchase',
|
|
48
49
|
onClose: function onClose() {
|
|
49
50
|
return setOpenModal(null);
|
|
@@ -11,6 +11,7 @@ var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skelet
|
|
|
11
11
|
var _Buttons = require("../../../styles/Buttons");
|
|
12
12
|
var _RiRadioButtonFill = _interopRequireDefault(require("@meronex/icons/ri/RiRadioButtonFill"));
|
|
13
13
|
var _MdRadioButtonUnchecked = _interopRequireDefault(require("@meronex/icons/md/MdRadioButtonUnchecked"));
|
|
14
|
+
var _NotFoundSource = require("../../NotFoundSource");
|
|
14
15
|
var _styles = require("./styles");
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -36,7 +37,7 @@ var PurchaseGiftCardUI = function PurchaseGiftCardUI(props) {
|
|
|
36
37
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
37
38
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
38
39
|
t = _useLanguage2[1];
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("h2", null, t('PURCHASE_GIFT_CARD', 'Purchase gift card')), /*#__PURE__*/_react.default.createElement("p", null, t('SELECT_ONE_OPTION', 'Select one option')), /*#__PURE__*/_react.default.createElement(_styles.
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("h2", null, t('PURCHASE_GIFT_CARD', 'Purchase gift card')), /*#__PURE__*/_react.default.createElement(_styles.GiftCardsListContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('SELECT_ONE_OPTION', 'Select one option')), /*#__PURE__*/_react.default.createElement(_styles.GiftCardsWrapper, null, productsListState.loading && _toConsumableArray(Array(5).keys()).map(function (i) {
|
|
40
41
|
return /*#__PURE__*/_react.default.createElement(_styles.GiftCardItem, {
|
|
41
42
|
key: i
|
|
42
43
|
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
@@ -51,14 +52,14 @@ var PurchaseGiftCardUI = function PurchaseGiftCardUI(props) {
|
|
|
51
52
|
}, /*#__PURE__*/_react.default.createElement(_styles.IconControl, null, (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.id) === product.id ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, null) : /*#__PURE__*/_react.default.createElement(_MdRadioButtonUnchecked.default, {
|
|
52
53
|
disabled: true
|
|
53
54
|
})), /*#__PURE__*/_react.default.createElement("span", null, product.name));
|
|
54
|
-
})), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
55
|
+
}), !productsListState.loading && productsListState.products.length === 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, null))), /*#__PURE__*/_react.default.createElement(_styles.ActionButtonContainer, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
55
56
|
type: "button",
|
|
56
57
|
color: "primary",
|
|
57
58
|
disabled: !selectedProduct,
|
|
58
59
|
onClick: function onClick() {
|
|
59
60
|
return handleAccept();
|
|
60
61
|
}
|
|
61
|
-
}, t('ACCEPT', 'Accept')));
|
|
62
|
+
}, t('ACCEPT', 'Accept'))));
|
|
62
63
|
};
|
|
63
64
|
var PurchaseGiftCard = function PurchaseGiftCard(props) {
|
|
64
65
|
var purchaseGiftCardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -4,26 +4,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.IconControl = exports.GiftCardsListContainer = exports.GiftCardItem = exports.Container = void 0;
|
|
7
|
+
exports.IconControl = exports.GiftCardsWrapper = exports.GiftCardsListContainer = exports.GiftCardItem = exports.Container = exports.ActionButtonContainer = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n h2 {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n margin-top: 0;\n margin-bottom: 24px;\n }\n > p {\n font-size: 16px;\n line-height: 24px;\n margin-top: 0;\n }\n
|
|
13
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding-top: 30px;\n\n h2 {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n margin-top: 0;\n margin-bottom: 24px;\n }\n > p {\n font-size: 16px;\n line-height: 24px;\n margin-top: 0;\n }\n"])));
|
|
14
14
|
exports.Container = Container;
|
|
15
|
-
var GiftCardsListContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
15
|
+
var GiftCardsListContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 30px 20px;\n"])));
|
|
16
16
|
exports.GiftCardsListContainer = GiftCardsListContainer;
|
|
17
|
-
var
|
|
17
|
+
var GiftCardsWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n"])));
|
|
18
|
+
exports.GiftCardsWrapper = GiftCardsWrapper;
|
|
19
|
+
var GiftCardItem = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n align-items: center;\n border-bottom: 1px solid ", ";\n padding: 20px 0;\n\n > span {\n font-size: 16px;\n }\n"])), function (props) {
|
|
18
20
|
return props.theme.colors.gray200;
|
|
19
21
|
});
|
|
20
22
|
exports.GiftCardItem = GiftCardItem;
|
|
21
|
-
var IconControl = _styledComponents.default.div(
|
|
23
|
+
var IconControl = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n color: ", ";\n margin-right: 40px;\n ", "\n svg {\n font-size: 24px;\n }\n\n svg[disabled] {\n color: ", ";\n }\n"])), function (props) {
|
|
22
24
|
return props.theme.colors.primary;
|
|
23
25
|
}, function (props) {
|
|
24
26
|
var _props$theme;
|
|
25
|
-
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(
|
|
27
|
+
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 40px;\n margin-right: 0px;\n "])));
|
|
26
28
|
}, function (props) {
|
|
27
29
|
return props.theme.colors.lightGray;
|
|
28
30
|
});
|
|
29
|
-
exports.IconControl = IconControl;
|
|
31
|
+
exports.IconControl = IconControl;
|
|
32
|
+
var ActionButtonContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: sticky;\n bottom: 0px;\n background-color: ", ";\n padding: 15px 20px;\n > button {\n height: 44px;\n width: 100%;\n }\n"])), function (props) {
|
|
33
|
+
return props.theme.colors.backgroundPage;
|
|
34
|
+
});
|
|
35
|
+
exports.ActionButtonContainer = ActionButtonContainer;
|
|
@@ -107,7 +107,7 @@ var RedeemGiftCardUI = function RedeemGiftCardUI(props) {
|
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
closeOnBackdrop: false
|
|
110
|
-
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("h2", null, t('GIFT_CARD', 'Gift card')), /*#__PURE__*/_react.default.createElement(_styles.GiftCardInfoContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('TYPE', 'Type'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.type), /*#__PURE__*/_react.default.createElement("p", null, t('AMOUNT', 'Amount'), ": ", parsePrice(redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.amount)), /*#__PURE__*/_react.default.createElement("p", null, t('FROM', 'From'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : (_redeemedGiftCard$rec = redeemedGiftCard.receiver) === null || _redeemedGiftCard$rec === void 0 ? void 0 : _redeemedGiftCard$rec.name, " ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : (_redeemedGiftCard$rec2 = redeemedGiftCard.receiver) === null || _redeemedGiftCard$rec2 === void 0 ? void 0 : _redeemedGiftCard$rec2.lastname), /*#__PURE__*/_react.default.createElement("p", null, t('TITLE', 'Title'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.title), /*#__PURE__*/_react.default.createElement("p", null, t('MESSAGES', 'Messages'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.message), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
110
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("h2", null, t('GIFT_CARD', 'Gift card')), /*#__PURE__*/_react.default.createElement(_styles.GiftCardInfoContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('TYPE', 'Type'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.type), /*#__PURE__*/_react.default.createElement("p", null, t('AMOUNT', 'Amount'), ": ", parsePrice(redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.amount)), /*#__PURE__*/_react.default.createElement("p", null, t('FROM', 'From'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : (_redeemedGiftCard$rec = redeemedGiftCard.receiver) === null || _redeemedGiftCard$rec === void 0 ? void 0 : _redeemedGiftCard$rec.name, " ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : (_redeemedGiftCard$rec2 = redeemedGiftCard.receiver) === null || _redeemedGiftCard$rec2 === void 0 ? void 0 : _redeemedGiftCard$rec2.lastname), (redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.title) && /*#__PURE__*/_react.default.createElement("p", null, t('TITLE', 'Title'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.title), (redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.message) && /*#__PURE__*/_react.default.createElement("p", null, t('MESSAGES', 'Messages'), ": ", redeemedGiftCard === null || redeemedGiftCard === void 0 ? void 0 : redeemedGiftCard.message), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
111
111
|
color: "primary",
|
|
112
112
|
onClick: function onClick() {
|
|
113
113
|
return onClose();
|