ordering-ui-external 10.4.0 → 10.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.
Files changed (80) hide show
  1. package/_bundles/{0.ordering-ui.487a31b3537d90f69a9d.js → 0.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  2. package/_bundles/{1.ordering-ui.487a31b3537d90f69a9d.js → 1.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  3. package/_bundles/{2.ordering-ui.487a31b3537d90f69a9d.js → 2.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  4. package/_bundles/{4.ordering-ui.487a31b3537d90f69a9d.js → 4.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  5. package/_bundles/{5.ordering-ui.487a31b3537d90f69a9d.js → 5.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  6. package/_bundles/{6.ordering-ui.487a31b3537d90f69a9d.js → 6.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  7. package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js → 7.ordering-ui.cc1d13aa04732fde3671.js} +2 -2
  8. package/_bundles/{8.ordering-ui.487a31b3537d90f69a9d.js → 8.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  9. package/_bundles/{9.ordering-ui.487a31b3537d90f69a9d.js → 9.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  10. package/_bundles/ordering-ui.cc1d13aa04732fde3671.js +2 -0
  11. package/_modules/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +4 -2
  12. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +3 -1
  13. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  14. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -2
  15. package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +25 -19
  16. package/_modules/themes/five/src/components/BusinessProductsList/index.js +35 -13
  17. package/_modules/themes/five/src/components/BusinessProductsList/styles.js +7 -3
  18. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  19. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +133 -31
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +37 -3
  21. package/_modules/themes/five/src/components/Cart/index.js +10 -6
  22. package/_modules/themes/five/src/components/Checkout/index.js +67 -22
  23. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +53 -0
  24. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +16 -0
  25. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +69 -0
  26. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +16 -0
  27. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/index.js +90 -0
  28. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +43 -0
  29. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +75 -0
  30. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +19 -0
  31. package/_modules/themes/five/src/components/MyOrders/index.js +6 -1
  32. package/_modules/themes/five/src/components/OrderProgress/index.js +1 -1
  33. package/_modules/themes/five/src/components/OrdersOption/index.js +1 -0
  34. package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +165 -31
  35. package/_modules/themes/five/src/components/PhoneAutocomplete/styles.js +53 -9
  36. package/_modules/themes/five/src/components/ProductForm/index.js +1 -0
  37. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
  38. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  39. package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -17
  40. package/_modules/themes/five/src/components/UserFormDetails/styles.js +3 -7
  41. package/index-template.js +9 -1
  42. package/package.json +2 -2
  43. package/src/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +3 -1
  44. package/src/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +5 -1
  45. package/src/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  46. package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -2
  47. package/src/themes/five/src/components/BusinessItemAccordion/styles.js +8 -7
  48. package/src/themes/five/src/components/BusinessProductsList/index.js +36 -3
  49. package/src/themes/five/src/components/BusinessProductsList/styles.js +20 -0
  50. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  51. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +156 -36
  52. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +66 -0
  53. package/src/themes/five/src/components/Cart/index.js +7 -4
  54. package/src/themes/five/src/components/Checkout/index.js +61 -35
  55. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +50 -0
  56. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +34 -0
  57. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +75 -0
  58. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +29 -0
  59. package/src/themes/five/src/components/GiftCard/SingleGiftCard/index.js +79 -0
  60. package/src/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +79 -0
  61. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +72 -0
  62. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +31 -0
  63. package/src/themes/five/src/components/MyOrders/index.js +6 -1
  64. package/src/themes/five/src/components/OrderProgress/index.js +1 -1
  65. package/src/themes/five/src/components/OrdersOption/index.js +1 -0
  66. package/src/themes/five/src/components/PhoneAutocomplete/index.js +195 -46
  67. package/src/themes/five/src/components/PhoneAutocomplete/styles.js +106 -10
  68. package/src/themes/five/src/components/ProductForm/index.js +1 -0
  69. package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -0
  70. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  71. package/src/themes/five/src/components/UserFormDetails/index.js +6 -27
  72. package/src/themes/five/src/components/UserFormDetails/styles.js +0 -16
  73. package/template/assets/images/delivery.svg +11 -0
  74. package/template/assets/images/phone-hero-callcenter.png +0 -0
  75. package/template/assets/images/phone.svg +11 -0
  76. package/template/assets/images/pickup.svg +17 -0
  77. package/template/pages/BusinessProductsList/index.js +2 -1
  78. package/_bundles/ordering-ui.487a31b3537d90f69a9d.js +0 -2
  79. /package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → 7.ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
  80. /package/_bundles/{ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.VerticalGiftCardOrdersLayout = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _orderingComponentsExternal = require("ordering-components-external");
10
+ var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
11
+ var _SingleGiftCard = require("../SingleGiftCard");
12
+ var _Buttons = require("../../../styles/Buttons");
13
+ var _styles = require("./styles");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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); }
16
+ 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; }
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; }
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
22
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
28
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
+ 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; } }
31
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
+ var VerticalGiftCardOrdersLayoutUI = function VerticalGiftCardOrdersLayoutUI(props) {
33
+ var _giftCards$list2;
34
+ var giftCards = props.giftCards,
35
+ paginationProps = props.paginationProps,
36
+ loadMoreOrders = props.loadMoreOrders,
37
+ title = props.title,
38
+ setIsEmpty = props.setIsEmpty;
39
+ var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
40
+ _useLanguage2 = _slicedToArray(_useLanguage, 2),
41
+ t = _useLanguage2[1];
42
+ (0, _react.useEffect)(function () {
43
+ var _giftCards$list;
44
+ if (giftCards.loading) return;
45
+ if (((_giftCards$list = giftCards.list) === null || _giftCards$list === void 0 ? void 0 : _giftCards$list.length) === 0) setIsEmpty(true);
46
+ }, [giftCards]);
47
+ return /*#__PURE__*/_react.default.createElement(_styles.ProductsListContainer, null, giftCards.loading ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
48
+ width: 100,
49
+ height: 24
50
+ }) : ((_giftCards$list2 = giftCards.list) === null || _giftCards$list2 === void 0 ? void 0 : _giftCards$list2.length) > 0 && /*#__PURE__*/_react.default.createElement("h2", null, title), giftCards.list.map(function (card) {
51
+ return /*#__PURE__*/_react.default.createElement(_styles.SingleGiftCardWrapper, {
52
+ key: card.id
53
+ }, /*#__PURE__*/_react.default.createElement(_SingleGiftCard.SingleGiftCard, {
54
+ card: card
55
+ }));
56
+ }), giftCards.loading && _toConsumableArray(Array(10).keys()).map(function (i) {
57
+ return /*#__PURE__*/_react.default.createElement(_styles.SingleGiftCardWrapper, {
58
+ key: i
59
+ }, /*#__PURE__*/_react.default.createElement(_SingleGiftCard.SingleGiftCard, {
60
+ isSkeleton: true
61
+ }));
62
+ }), paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && /*#__PURE__*/_react.default.createElement(_styles.WrappButton, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
63
+ outline: true,
64
+ color: "primary",
65
+ bgtransparent: true,
66
+ onClick: loadMoreOrders
67
+ }, t('LOAD_MORE_ORDERS', 'Load more orders'))));
68
+ };
69
+ var VerticalGiftCardOrdersLayout = function VerticalGiftCardOrdersLayout(props) {
70
+ var giftCardsProps = _objectSpread(_objectSpread({}, props), {}, {
71
+ UIComponent: VerticalGiftCardOrdersLayoutUI
72
+ });
73
+ return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.GiftCardOrdersList, giftCardsProps);
74
+ };
75
+ exports.VerticalGiftCardOrdersLayout = VerticalGiftCardOrdersLayout;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WrappButton = exports.SingleGiftCardWrapper = exports.ProductsListContainer = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _polished = require("polished");
9
+ var _templateObject, _templateObject2, _templateObject3;
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
+ var ProductsListContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 10px;\n"])));
13
+ exports.ProductsListContainer = ProductsListContainer;
14
+ var SingleGiftCardWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-bottom: 1px solid #E9ECEF;\n padding: 20px 0;\n"])));
15
+ exports.SingleGiftCardWrapper = SingleGiftCardWrapper;
16
+ var WrappButton = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 80%;\n display: flex;\n justify-content: center;\n margin: 20px auto;\n\n button {\n padding: 10px 0px;\n width: 100%;\n }\n\n button:hover{\n color: ", ";\n }\n\n @media (min-width: 768px) {\n button {\n width: 60%;\n }\n }\n"])), function (props) {
17
+ return (0, _polished.darken)(0.07, props.theme.colors.primary);
18
+ });
19
+ exports.WrappButton = WrappButton;
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _orderingComponentsExternal = require("ordering-components-external");
10
10
  var _ProfileOptions = require("../../../../../components/UserProfileForm/ProfileOptions");
11
11
  var _OrdersOption = require("../OrdersOption");
12
+ var _GiftCardOrdersList = require("../GiftCard/GiftCardOrdersList");
12
13
  var _Buttons = require("../../styles/Buttons");
13
14
  var _MdClose = _interopRequireDefault(require("@meronex/icons/ios/MdClose"));
14
15
  var _reactRouterDom = require("react-router-dom");
@@ -75,6 +76,10 @@ var MyOrders = function MyOrders(props) {
75
76
  key: 'products',
76
77
  value: t('PRODUCTS', 'Products'),
77
78
  disabled: hideProductsTab
79
+ }, {
80
+ key: 'giftCards',
81
+ value: t('GIFT_CARD', 'Gift card'),
82
+ disabled: false
78
83
  }];
79
84
  var notOrderOptions = ['business', 'products', 'professionals'];
80
85
  var allEmpty = isEmptyActive && isEmptyPast && isEmptyPreorder || (isEmptyBusinesses || (businessOrderIds === null || businessOrderIds === void 0 ? void 0 : businessOrderIds.length) === 0) && hideOrders;
@@ -141,7 +146,7 @@ var MyOrders = function MyOrders(props) {
141
146
  businessOrderIds: businessOrderIds,
142
147
  setBusinessOrderIds: setBusinessOrderIds,
143
148
  onProductRedirect: onProductRedirect
144
- }))), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
149
+ })), selectedOption === 'giftCards' && /*#__PURE__*/_react.default.createElement(_GiftCardOrdersList.GiftCardOrdersList, null)), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
145
150
  return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
146
151
  key: i
147
152
  }, props));
@@ -114,7 +114,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
114
114
  };
115
115
  var OrderProgress = function OrderProgress(props) {
116
116
  var propsToFetchBusiness = ['name', 'logo', 'slug', 'id'];
117
- var propsToFetch = ['cart', 'business', 'status', 'id', 'uuid', 'cart_group_id', 'business_id', 'delivery_datetime', 'delivery_datetime_utc', 'total', 'summary'];
117
+ var propsToFetch = ['cart', 'business', 'status', 'id', 'uuid', 'cart_group_id', 'business_id', 'delivery_datetime', 'delivery_datetime_utc', 'total', 'summary', 'eta_current_status_time', 'eta_previous_status_times', 'eta_time', 'delivered_in', 'prepared_in', 'eta_drive_time'];
118
118
  var orderProgressProps = _objectSpread(_objectSpread({}, props), {}, {
119
119
  UIComponent: OrderProgressUI,
120
120
  orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
@@ -376,6 +376,7 @@ var OrdersOption = function OrdersOption(props) {
376
376
  var getAllOrders = props.activeOrders && props.pastOrders && props.preOrders;
377
377
  var orderListProps = _objectSpread(_objectSpread({}, props), {}, {
378
378
  UIComponent: OrdersOptionUI,
379
+ noGiftCardOrders: true,
379
380
  orderStatus: getAllOrders ? [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23] : props.activeOrders ? [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23] : props.pastOrders ? [1, 2, 5, 6, 10, 11, 12, 15, 16, 17] : [13],
380
381
  useDefualtSessionManager: true,
381
382
  paginationSettings: {
@@ -36,7 +36,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
36
36
  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; } }
37
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38
38
  var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
39
- var _theme$images, _orderState$options2, _orderState$options4, _orderState$options5, _customerState$result, _customerState$result2;
39
+ var _orderState$options, _configState$configs, _customersPhones$user2, _orderState$options4, _orderState$options7, _theme$images, _theme$images2, _orderState$options8, _orderState$options9, _orderState$options11, _orderState$options12, _theme$colors, _theme$images3, _customerState$result, _customerState$result2;
40
40
  var phone = props.phone,
41
41
  customerState = props.customerState,
42
42
  customersPhones = props.customersPhones,
@@ -47,10 +47,16 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
47
47
  onChangeNumber = props.onChangeNumber,
48
48
  setCustomerState = props.setCustomerState,
49
49
  countryCallingCode = props.countryCallingCode,
50
- onRedirectPage = props.onRedirectPage;
50
+ onRedirectPage = props.onRedirectPage,
51
+ urlPhone = props.urlPhone,
52
+ orderTypes = props.orderTypes,
53
+ localPhoneCode = props.localPhoneCode;
54
+ var allOrderTypes = [1, 2, 3, 4, 5];
55
+ var pickupTypes = [2, 3, 4, 5];
51
56
  var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
52
- _useOrder2 = _slicedToArray(_useOrder, 1),
53
- orderState = _useOrder2[0];
57
+ _useOrder2 = _slicedToArray(_useOrder, 2),
58
+ orderState = _useOrder2[0],
59
+ changeType = _useOrder2[1].changeType;
54
60
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
55
61
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
56
62
  t = _useLanguage2[1];
@@ -58,6 +64,9 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
58
64
  var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
59
65
  _useCustomer2 = _slicedToArray(_useCustomer, 2),
60
66
  deleteUserCustomer = _useCustomer2[1].deleteUserCustomer;
67
+ var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
68
+ _useConfig2 = _slicedToArray(_useConfig, 1),
69
+ configState = _useConfig2[0];
61
70
  var _useState = (0, _react.useState)({
62
71
  open: false,
63
72
  content: []
@@ -65,7 +74,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
65
74
  _useState2 = _slicedToArray(_useState, 2),
66
75
  alertState = _useState2[0],
67
76
  setAlertState = _useState2[1];
68
- var _useState3 = (0, _react.useState)(''),
77
+ var _useState3 = (0, _react.useState)(urlPhone !== null && urlPhone !== void 0 ? urlPhone : ''),
69
78
  _useState4 = _slicedToArray(_useState3, 2),
70
79
  inputValue = _useState4[0],
71
80
  setInputValue = _useState4[1];
@@ -81,7 +90,16 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
81
90
  _useState10 = _slicedToArray(_useState9, 2),
82
91
  isAddressFormOpen = _useState10[0],
83
92
  setIsAddressFormOpen = _useState10[1];
93
+ var _useState11 = (0, _react.useState)(pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type)),
94
+ _useState12 = _slicedToArray(_useState11, 2),
95
+ isPickupSelected = _useState12[0],
96
+ setIsPickupSelected = _useState12[1];
84
97
  var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
98
+ var configTypes = (configState === null || configState === void 0 || (_configState$configs = configState.configs) === null || _configState$configs === void 0 || (_configState$configs = _configState$configs.order_types_allowed) === null || _configState$configs === void 0 ? void 0 : _configState$configs.value.split('|').filter(function (value) {
99
+ return allOrderTypes.includes(Number(value));
100
+ }).map(function (value) {
101
+ return Number(value);
102
+ })) || [];
85
103
  var userName = userCustomer !== null && userCustomer !== void 0 && userCustomer.lastname ? "".concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name, " ").concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.lastname) : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name;
86
104
  var handleCloseAlert = function handleCloseAlert() {
87
105
  setCustomersPhones(_objectSpread(_objectSpread({}, customersPhones), {}, {
@@ -105,8 +123,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
105
123
  });
106
124
  };
107
125
  var handleFindClick = function handleFindClick() {
108
- var _orderState$options;
109
- if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$options = orderState.options) !== null && _orderState$options !== void 0 && (_orderState$options = _orderState$options.address) !== null && _orderState$options !== void 0 && _orderState$options.address) {
126
+ var _orderState$options2;
127
+ if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$options2 = orderState.options) !== null && _orderState$options2 !== void 0 && (_orderState$options2 = _orderState$options2.address) !== null && _orderState$options2 !== void 0 && _orderState$options2.address) {
110
128
  onRedirectPage && onRedirectPage('search');
111
129
  } else {
112
130
  setAlertState({
@@ -115,6 +133,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
115
133
  });
116
134
  }
117
135
  };
136
+ var handleChangeType = function handleChangeType(value) {
137
+ if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
138
+ changeType(value);
139
+ if (value === 1) {
140
+ setIsPickupSelected(false);
141
+ }
142
+ }
143
+ };
118
144
  (0, _react.useEffect)(function () {
119
145
  if (customersPhones !== null && customersPhones !== void 0 && customersPhones.error) {
120
146
  setAlertState({
@@ -140,11 +166,12 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
140
166
  };
141
167
  var onChange = function onChange(option) {
142
168
  var _customersPhones$user;
169
+ setOptSelected(option);
170
+ setInputValue(option ? option === null || option === void 0 ? void 0 : option.value : '');
143
171
  if (!option) {
144
172
  onChangeNumber('');
173
+ return;
145
174
  }
146
- setOptSelected(option);
147
- setInputValue(option ? option === null || option === void 0 ? void 0 : option.value : '');
148
175
  var user = (_customersPhones$user = customersPhones.users) === null || _customersPhones$user === void 0 ? void 0 : _customersPhones$user.find(function (user) {
149
176
  return user.cellphone === (option === null || option === void 0 ? void 0 : option.value) || user.phone === (option === null || option === void 0 ? void 0 : option.value);
150
177
  });
@@ -152,9 +179,20 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
152
179
  setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
153
180
  result: user
154
181
  }));
155
- setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
182
+ setOpenModal({
183
+ signup: false,
156
184
  customer: true
185
+ });
186
+ } else {
187
+ setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
188
+ result: {
189
+ error: false
190
+ }
157
191
  }));
192
+ setOpenModal({
193
+ customer: false,
194
+ signup: true
195
+ });
158
196
  }
159
197
  };
160
198
  var createNewUser = function createNewUser() {
@@ -171,10 +209,9 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
171
209
  }
172
210
  };
173
211
  var handleCloseAddressList = function handleCloseAddressList() {
174
- setOpenModal({
175
- openModal: openModal,
212
+ setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
176
213
  customer: false
177
- });
214
+ }));
178
215
  setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
179
216
  result: {
180
217
  error: false
@@ -182,16 +219,88 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
182
219
  }));
183
220
  deleteUserCustomer(true);
184
221
  };
222
+ var handleChangeToPickup = function handleChangeToPickup() {
223
+ var _orderTypes$find;
224
+ var firstEnabledPickupType = (_orderTypes$find = orderTypes.find(function (type) {
225
+ return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
226
+ })) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
227
+ handleChangeType(firstEnabledPickupType);
228
+ setIsPickupSelected(true);
229
+ };
185
230
  var optionsToSelect = customersPhones.users.map(function (user) {
186
231
  var obj = {};
187
232
  obj.value = user.cellphone || user.phone;
188
233
  obj.label = "".concat(user !== null && user !== void 0 && user.country_phone_code ? "(".concat(user === null || user === void 0 ? void 0 : user.country_phone_code, ")") : '', " ").concat(user !== null && user !== void 0 && user.phone && !(user !== null && user !== void 0 && user.cellphone) ? "".concat(user === null || user === void 0 ? void 0 : user.phone) : '', " ").concat(user !== null && user !== void 0 && user.cellphone ? "".concat(user.cellphone) : '', " - {").concat(user.name, "}");
189
234
  return obj;
190
235
  }) || [];
191
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.PhoneContainer, {
192
- bgimage: (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.general) === null || _theme$images === void 0 ? void 0 : _theme$images.homeHero
193
- }, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')), /*#__PURE__*/_react.default.createElement(_styles.Slogan, null, t('SUBTITLE_HOME_CALLCENTER', 'Start First by adding the customers\' phone number')), !userCustomer && /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, null, /*#__PURE__*/_react.default.createElement(_MdcCellphoneAndroid.default, {
194
- size: 26
236
+ (0, _react.useEffect)(function () {
237
+ if (!urlPhone) return;
238
+ onInputChange(urlPhone, {
239
+ action: 'url'
240
+ });
241
+ onChange({
242
+ value: urlPhone,
243
+ label: urlPhone
244
+ });
245
+ }, [urlPhone, customersPhones === null || customersPhones === void 0 || (_customersPhones$user2 = customersPhones.users) === null || _customersPhones$user2 === void 0 ? void 0 : _customersPhones$user2.length]);
246
+ (0, _react.useEffect)(function () {
247
+ var _orderState$options3;
248
+ if (pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type)) {
249
+ setIsPickupSelected(true);
250
+ }
251
+ }, [orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type]);
252
+ var OrderTypesComponent = function OrderTypesComponent() {
253
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
254
+ return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
255
+ }) : orderTypes).map(function (item, i) {
256
+ var _orderState$options5, _orderState$options6;
257
+ return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
258
+ key: item.value,
259
+ onClick: function onClick() {
260
+ return handleChangeType(item.value);
261
+ },
262
+ color: (orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
263
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
264
+ className: (orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
265
+ }, item.text);
266
+ }));
267
+ };
268
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.PhoneContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')), /*#__PURE__*/_react.default.createElement(_styles.Slogan, null, t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')), !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && (_orderState$options7 = _orderState$options7.address) !== null && _orderState$options7 !== void 0 && _orderState$options7.address) && /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
269
+ onClick: function onClick() {
270
+ return handleChangeType(1);
271
+ },
272
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
273
+ activated: !isPickupSelected
274
+ }, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
275
+ activated: !isPickupSelected
276
+ }, /*#__PURE__*/_react.default.createElement("img", {
277
+ src: theme === null || theme === void 0 || (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.general) === null || _theme$images === void 0 ? void 0 : _theme$images.deliveryIco,
278
+ width: 20,
279
+ height: 20
280
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('DELIVERY', 'Delivery'))), configTypes.some(function (type) {
281
+ return pickupTypes.includes(type);
282
+ }) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
283
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
284
+ activated: isPickupSelected,
285
+ onClick: function onClick() {
286
+ return handleChangeToPickup();
287
+ }
288
+ }, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
289
+ activated: isPickupSelected
290
+ }, /*#__PURE__*/_react.default.createElement("img", {
291
+ src: theme === null || theme === void 0 || (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.pickupIco,
292
+ width: 22,
293
+ height: 22
294
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))), isPickupSelected && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, /*#__PURE__*/_react.default.createElement(OrderTypesComponent, null))), configTypes.includes(orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !userCustomer && /*#__PURE__*/_react.default.createElement(_styles.PhoneAutocompleteContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')), /*#__PURE__*/_react.default.createElement(_styles.WrappBtn, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
295
+ color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options9 = orderState.options) !== null && _orderState$options9 !== void 0 && (_orderState$options9 = _orderState$options9.address) !== null && _orderState$options9 !== void 0 && _orderState$options9.address ? 'primary' : 'secundary',
296
+ onMouseDown: function onMouseDown() {
297
+ var _orderState$options10;
298
+ return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options10 = orderState.options) !== null && _orderState$options10 !== void 0 && (_orderState$options10 = _orderState$options10.address) !== null && _orderState$options10 !== void 0 && _orderState$options10.address) ? createNewUser() : handleFindClick();
299
+ },
300
+ disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options11 = orderState.options) !== null && _orderState$options11 !== void 0 && (_orderState$options11 = _orderState$options11.address) !== null && _orderState$options11 !== void 0 && _orderState$options11.address)
301
+ }, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options12 = orderState.options) !== null && _orderState$options12 !== void 0 && (_orderState$options12 = _orderState$options12.address) !== null && _orderState$options12 !== void 0 && _orderState$options12.address) ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))), /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, null, /*#__PURE__*/_react.default.createElement(_MdcCellphoneAndroid.default, {
302
+ size: 18,
303
+ color: theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary
195
304
  }), /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
196
305
  isSearchable: true,
197
306
  isClearable: true,
@@ -207,24 +316,23 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
207
316
  onInputChange: onInputChange,
208
317
  isLoading: customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading,
209
318
  options: optionsToSelect
210
- })), /*#__PURE__*/_react.default.createElement(_styles.WrappBtn, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
211
- color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options2 = orderState.options) !== null && _orderState$options2 !== void 0 && (_orderState$options2 = _orderState$options2.address) !== null && _orderState$options2 !== void 0 && _orderState$options2.address ? 'primary' : 'secundary',
212
- onMouseDown: function onMouseDown() {
213
- var _orderState$options3;
214
- return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options3 = orderState.options) !== null && _orderState$options3 !== void 0 && (_orderState$options3 = _orderState$options3.address) !== null && _orderState$options3 !== void 0 && _orderState$options3.address) ? createNewUser() : handleFindClick();
319
+ }), optSelected && /*#__PURE__*/_react.default.createElement(_styles.ContinueButton, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
320
+ onClick: function onClick() {
321
+ return onChange(optSelected);
215
322
  },
216
- disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options4 = orderState.options) !== null && _orderState$options4 !== void 0 && (_orderState$options4 = _orderState$options4.address) !== null && _orderState$options4 !== void 0 && _orderState$options4.address)
217
- }, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options5 = orderState.options) !== null && _orderState$options5 !== void 0 && (_orderState$options5 = _orderState$options5.address) !== null && _orderState$options5 !== void 0 && _orderState$options5.address) ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
323
+ color: "primary"
324
+ }, t('CONTINUE', 'Continue'))))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
325
+ bgimage: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.phoneHero
326
+ })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
218
327
  open: openModal.signup,
219
328
  width: "80%",
220
329
  onClose: function onClose() {
221
- return setOpenModal({
222
- openModal: openModal,
330
+ return setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
223
331
  signup: false
224
- });
332
+ }));
225
333
  }
226
334
  }, /*#__PURE__*/_react.default.createElement(_SignUpForm.SignUpForm, {
227
- externalPhoneNumber: "".concat(countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
335
+ externalPhoneNumber: "".concat(localPhoneCode || countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
228
336
  saveCustomerUser: saveCustomerUser,
229
337
  fieldsNotValid: props.fieldsNotValid,
230
338
  useChekoutFileds: true,
@@ -253,7 +361,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
253
361
  userId: customerState === null || customerState === void 0 || (_customerState$result2 = customerState.result) === null || _customerState$result2 === void 0 ? void 0 : _customerState$result2.id,
254
362
  changeOrderAddressWithDefault: true,
255
363
  userCustomerSetup: _objectSpread(_objectSpread({}, customerState === null || customerState === void 0 ? void 0 : customerState.result), {}, {
256
- phone: phone
364
+ phone: phone,
365
+ urlPhone: urlPhone
257
366
  }),
258
367
  isEnableContinueButton: true,
259
368
  isCustomerMode: true,
@@ -269,9 +378,34 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
269
378
  }));
270
379
  };
271
380
  var PhoneAutocomplete = function PhoneAutocomplete(props) {
272
- var phoneProps = _objectSpread({
381
+ var _useLanguage3 = (0, _orderingComponentsExternal.useLanguage)(),
382
+ _useLanguage4 = _slicedToArray(_useLanguage3, 2),
383
+ t = _useLanguage4[1];
384
+ var phoneProps = _objectSpread(_objectSpread({
273
385
  UIComponent: PhoneAutocompleteUI
274
- }, props);
386
+ }, props), {}, {
387
+ orderTypes: props.orderTypes || [{
388
+ value: 1,
389
+ text: t('DELIVERY', 'Delivery'),
390
+ description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
391
+ }, {
392
+ value: 2,
393
+ text: t('PICKUP', 'Pickup'),
394
+ description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
395
+ }, {
396
+ value: 3,
397
+ text: t('EAT_IN', 'Eat in'),
398
+ description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
399
+ }, {
400
+ value: 4,
401
+ text: t('CURBSIDE', 'Curbside'),
402
+ description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
403
+ }, {
404
+ value: 5,
405
+ text: t('DRIVE_THRU', 'Drive thru'),
406
+ description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
407
+ }]
408
+ });
275
409
  return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.PhoneAutocomplete, phoneProps);
276
410
  };
277
411
  exports.PhoneAutocomplete = PhoneAutocomplete;
@@ -4,18 +4,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.Info = exports.ContentWrapper = exports.AutoComplete = void 0;
7
+ exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.TypesContainer = exports.TypeButton = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.PhoneAutocompleteContainer = exports.Info = exports.ImageWrapper = exports.IconTypeButton = exports.ContentWrapper = exports.AutoComplete = exports.AdditionalTypesContainer = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
8
9
  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;
10
+ 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
11
  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
12
  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; }
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
15
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n\n ", "\n\n .spinner-content{\n > div{\n width: 40px;\n height: 40px;\n border-width: 5px;\n }\n }\n\n .autocomplete {\n /*the container must be positioned relative:*/\n position: relative;\n }\n input {\n border: 1px solid transparent;\n background-color: #f1f1f1;\n padding: 10px;\n font-size: 16px;\n }\n input[type=text] {\n background-color: #f1f1f1;\n width: 100%;\n }\n input[type=submit] {\n background-color: #f1f1f1;\n width: 100%;\n }\n .autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n overflow: auto;\n max-height: 200px\n }\n .autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n }\n .autocomplete-items div:hover {\n /*when hovering an item:*/\n background-color: #e9e9e9;\n }\n .autocomplete-active {\n /*when navigating through the items using the arrow keys:*/\n background-color: DodgerBlue !important;\n color: #ffffff;\n }\n\n @media (min-width: 821px) {\n height: calc(100vh - 65px);\n }\n"])), function (_ref) {
16
+ var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n display: flex;\n ", "\n\n .spinner-content{\n > div{\n width: 40px;\n height: 40px;\n border-width: 5px;\n }\n }\n\n .autocomplete {\n /*the container must be positioned relative:*/\n position: relative;\n }\n input {\n border: 1px solid transparent;\n background-color: #f1f1f1;\n padding: 10px;\n font-size: 16px;\n }\n input[type=text] {\n background-color: #f1f1f1;\n width: 100%;\n }\n input[type=submit] {\n background-color: #f1f1f1;\n width: 100%;\n }\n .autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n overflow: auto;\n max-height: 200px\n }\n .autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n }\n .autocomplete-items div:hover {\n /*when hovering an item:*/\n background-color: #e9e9e9;\n }\n .autocomplete-active {\n /*when navigating through the items using the arrow keys:*/\n background-color: DodgerBlue !important;\n color: #ffffff;\n }\n\n @media (min-width: 821px) {\n height: calc(100vh - 65px);\n }\n"])), function (_ref) {
14
17
  var bgimage = _ref.bgimage;
15
18
  return bgimage && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: bottom;\n background-image: url(", ");\n "])), bgimage);
16
19
  });
17
20
  exports.PhoneContainer = PhoneContainer;
18
- var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n\n .basic-single {\n margin-bottom: 15px;\n }\n\n .select__control {\n border-radius: 30px;\n }\n\n .select__control.select__control--is-focused {\n border-color: ", " !important;\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .select__value-container {\n padding: 10px 8px 0;\n }\n .select__indicator.select__loading-indicator {\n color: ", " !important;\n }\n\n .select__indicator.select__dropdown-indicator,\n .select__indicator-separator {\n display: none;\n }\n\n ", "\n\n input {\n width: 90%;\n margin-bottom: 15px;\n }\n\n @media (min-width: 425px) {\n input {\n width: 45%;\n }\n }\n\n @media (min-width: 768px) {\n padding: 0px 40px 0px;\n\n ", "\n }\n"])), function (props) {
21
+ var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n width: 70%;\n\n .select__control {\n border-radius: 30px;\n }\n\n .select__control.select__control--is-focused {\n border-color: ", " !important;\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .select__value-container {\n padding: 10px 8px 0;\n }\n .select__indicator.select__loading-indicator {\n color: ", " !important;\n }\n\n .select__indicator.select__dropdown-indicator,\n .select__indicator-separator {\n display: none;\n }\n\n ", "\n\n input {\n width: 90%;\n margin-bottom: 15px;\n }\n\n @media (min-width: 425px) {\n input {\n width: 45%;\n }\n }\n\n @media (min-width: 768px) {\n padding: 0px 40px 0px;\n\n ", "\n }\n @media (min-width: 1400px){\n width: 60%;\n }\n"])), function (props) {
19
22
  var _props$theme;
20
23
  return (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.colors) === null || _props$theme === void 0 ? void 0 : _props$theme.primary;
21
24
  }, function (props) {
@@ -32,9 +35,9 @@ var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templat
32
35
  return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0px 40px 0px;\n "])));
33
36
  });
34
37
  exports.ContentWrapper = ContentWrapper;
35
- var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n\n button {\n min-width: 130px;\n max-width: 400px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])));
38
+ var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n margin-top: 20px;\n button {\n min-width: 130px;\n max-width: 400px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])));
36
39
  exports.WrappBtn = WrappBtn;
37
- var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n color: #ffffff;\n text-shadow: 0px 3px 6px #00000029;\n opacity: 1;\n font-size: 35px;\n\n ", "\n"])), function (props) {
40
+ var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n text-shadow: 0px 3px 6px #00000029;\n opacity: 1;\n font-size: 35px;\n\n ", "\n"])), function (props) {
38
41
  var _props$theme$fonts$sp;
39
42
  return ((_props$theme$fonts$sp = props.theme.fonts.special) === null || _props$theme$fonts$sp === void 0 ? void 0 : _props$theme$fonts$sp.name) || 'Georgia';
40
43
  }, function (props) {
@@ -42,7 +45,7 @@ var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 =
42
45
  return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
43
46
  });
44
47
  exports.Title = Title;
45
- var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n color: #fff;\n opacity: 1;\n margin-bottom: 15px;\n\n ", "\n\n @media (min-width: 480px) {\n font-size: 24px;\n }\n"])), function (props) {
48
+ var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n opacity: 1;\n margin-bottom: 15px;\n\n ", "\n\n @media (min-width: 480px) {\n font-size: 24px;\n }\n"])), function (props) {
46
49
  var _props$theme7;
47
50
  return ((_props$theme7 = props.theme) === null || _props$theme7 === void 0 ? void 0 : _props$theme7.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
48
51
  });
@@ -70,7 +73,48 @@ var UserEdit = _styledComponents.default.div(_templateObject19 || (_templateObje
70
73
  exports.UserEdit = UserEdit;
71
74
  var Info = _styledComponents.default.p(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral([""])));
72
75
  exports.Info = Info;
73
- var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left: 0;\n transform: translate(50%, 70%);\n z-index: 10;\n }\n > div {\n width: 100%;\n .select__placeholder, .select__single-value, input {\n margin-left: 40px;\n z-index: 100\n }\n .select__menu {\n position: relative;\n padding: 20px;\n }\n .select__clear-indicator {\n position: relative;\n left: 0;\n transform: translate(-300%, -165%);\n svg{\n width: 30px;\n height: 30px;\n }\n }\n }\n"])));
76
+ var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left: 20px;\n transform: translate(50%, 70%);\n z-index: 10;\n }\n > div {\n width: 100%;\n .select__placeholder, .select__single-value, input {\n margin-left: 40px;\n z-index: 100;\n bottom: -10px;\n }\n .select__menu {\n position: relative;\n padding: 20px;\n }\n .select__clear-indicator {\n position: relative;\n left: 0;\n transform: translate(-300%, -165%);\n svg{\n width: 30px;\n height: 30px;\n }\n }\n .select__control {\n height: 45px;\n padding-left: 10px;\n }\n .select__indicator {\n bottom: 8px;\n position: relative;\n }\n input {\n position: relative;\n top: -5px;\n }\n }\n"])));
74
77
  exports.SelectContainer = SelectContainer;
75
78
  var SearchContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n width: 90%;\n"])));
76
- exports.SearchContainer = SearchContainer;
79
+ exports.SearchContainer = SearchContainer;
80
+ var ImageWrapperStyled = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n width: 30%;\n ", "\n @media (min-width: 1400px){\n width: 40%;\n }\n"])), function (_ref3) {
81
+ var bgimage = _ref3.bgimage;
82
+ return bgimage && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n "])));
83
+ });
84
+ var ImageWrapper = function ImageWrapper(props) {
85
+ var style = {};
86
+ style.backgroundImage = "url(".concat(props.bgimage, ")");
87
+ return /*#__PURE__*/_react.default.createElement(ImageWrapperStyled, _extends({}, props, {
88
+ style: style
89
+ }), props.children);
90
+ };
91
+ exports.ImageWrapper = ImageWrapper;
92
+ var TypeButton = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 215px;\n height: 75px;\n border-radius: 7.6px;\n padding: 16px;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);\n margin-right: 32px;\n margin-bottom: 32px;\n cursor: pointer;\n background: ", ";\n p{\n margin: 0;\n margin-left: 33px;\n ", "\n }\n"])), function (_ref4) {
93
+ var _theme$colors, _theme$colors2;
94
+ var activated = _ref4.activated,
95
+ theme = _ref4.theme;
96
+ return activated ? theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary : theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.white;
97
+ }, function (_ref5) {
98
+ var _theme$colors3;
99
+ var activated = _ref5.activated,
100
+ theme = _ref5.theme;
101
+ return activated && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme === null || theme === void 0 || (_theme$colors3 = theme.colors) === null || _theme$colors3 === void 0 ? void 0 : _theme$colors3.white);
102
+ });
103
+ exports.TypeButton = TypeButton;
104
+ var IconTypeButton = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 44px;\n height: 44px;\n background: ", ";\n border-radius: 44px;\n"])), function (_ref6) {
105
+ var _theme$colors4;
106
+ var activated = _ref6.activated,
107
+ theme = _ref6.theme;
108
+ return activated ? theme === null || theme === void 0 || (_theme$colors4 = theme.colors) === null || _theme$colors4 === void 0 ? void 0 : _theme$colors4.white : '#F3F9FF';
109
+ });
110
+ exports.IconTypeButton = IconTypeButton;
111
+ var TypesContainer = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n"])));
112
+ exports.TypesContainer = TypesContainer;
113
+ var AdditionalTypesContainer = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n width: 60%;\n display: flex;\n margin-bottom: 20px;\n button {\n padding: 4px 10px;\n border-radius: 50px;\n font-size: 10px;\n line-height: 0;\n height: 25px;\n margin-right: 20px;\n }\n .activated {\n color: ", "\n }\n"])), function (_ref7) {
114
+ var _theme$colors5;
115
+ var theme = _ref7.theme;
116
+ return theme === null || theme === void 0 || (_theme$colors5 = theme.colors) === null || _theme$colors5 === void 0 ? void 0 : _theme$colors5.darkTextColor;
117
+ });
118
+ exports.AdditionalTypesContainer = AdditionalTypesContainer;
119
+ var PhoneAutocompleteContainer = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n\n h2 {\n font-size: 20px;\n margin-bottom: 20px;\n }\n"])));
120
+ exports.PhoneAutocompleteContainer = PhoneAutocompleteContainer;
@@ -439,6 +439,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
439
439
  observer: true,
440
440
  observeParents: true,
441
441
  parallax: true,
442
+ slidesPerView: 1,
442
443
  thumbs: {
443
444
  swiper: thumbsSwiper
444
445
  },