ordering-ui-external 10.10.8 → 10.10.9

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 (20) hide show
  1. package/_bundles/{0.ordering-ui.52dae15bda2bcf26f93e.js → 0.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  2. package/_bundles/{1.ordering-ui.52dae15bda2bcf26f93e.js → 1.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  3. package/_bundles/{2.ordering-ui.52dae15bda2bcf26f93e.js → 2.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  4. package/_bundles/{4.ordering-ui.52dae15bda2bcf26f93e.js → 4.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  5. package/_bundles/{5.ordering-ui.52dae15bda2bcf26f93e.js → 5.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  6. package/_bundles/{6.ordering-ui.52dae15bda2bcf26f93e.js → 6.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  7. package/_bundles/{7.ordering-ui.52dae15bda2bcf26f93e.js → 7.ordering-ui.5adc4f46e634487b1938.js} +2 -2
  8. package/_bundles/{8.ordering-ui.52dae15bda2bcf26f93e.js → 8.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  9. package/_bundles/{9.ordering-ui.52dae15bda2bcf26f93e.js → 9.ordering-ui.5adc4f46e634487b1938.js} +1 -1
  10. package/_bundles/ordering-ui.5adc4f46e634487b1938.js +2 -0
  11. package/_modules/themes/five/src/components/OrderDetails/index.js +1 -1
  12. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +8 -13
  13. package/_modules/utils/index.js +13 -8
  14. package/package.json +2 -2
  15. package/src/themes/five/src/components/OrderDetails/index.js +1 -1
  16. package/src/themes/five/src/components/ProductOptionSubOption/index.js +11 -10
  17. package/src/utils/index.js +1 -0
  18. package/_bundles/ordering-ui.52dae15bda2bcf26f93e.js +0 -2
  19. /package/_bundles/{7.ordering-ui.52dae15bda2bcf26f93e.js.LICENSE.txt → 7.ordering-ui.5adc4f46e634487b1938.js.LICENSE.txt} +0 -0
  20. /package/_bundles/{ordering-ui.52dae15bda2bcf26f93e.js.LICENSE.txt → ordering-ui.5adc4f46e634487b1938.js.LICENSE.txt} +0 -0
@@ -179,7 +179,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
179
179
  businessData = _props$order.businessData,
180
180
  error = _props$order.error;
181
181
  var yourSpotString = (order === null || order === void 0 ? void 0 : order.delivery_type) === 3 ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number');
182
- var acceptedStatus = [1, 2, 5, 6, 10, 11, 12];
182
+ var acceptedStatus = [1, 2, 5, 6, 10, 11, 12, 15];
183
183
  var completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17];
184
184
  var placeSpotTypes = [3, 4, 5];
185
185
  var activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23];
@@ -19,19 +19,22 @@ var _MdRadioButtonUnchecked = _interopRequireDefault(require("@meronex/icons/md/
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
20
  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); }
21
21
  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; }
22
- 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); }
23
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
24
  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; }
26
25
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
27
26
  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); }
27
+ 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); }
28
28
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
29
  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."); }
30
30
  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); }
31
31
  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; }
32
32
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
33
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
- var ProductOptionSubOptionUI = function ProductOptionSubOptionUI(props) {
34
+ var ProductOptionSubOptionPropsAreEqual = function ProductOptionSubOptionPropsAreEqual(prevProps, nextProps) {
35
+ return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) && JSON.stringify(prevProps.pizzaType) === JSON.stringify(nextProps.pizzaType) && prevProps.balance === nextProps.balance && JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart);
36
+ };
37
+ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props) {
35
38
  var _props$beforeElements, _props$beforeComponen, _props$afterComponent, _props$afterElements;
36
39
  var state = props.state,
37
40
  increment = props.increment,
@@ -93,17 +96,9 @@ var ProductOptionSubOptionUI = function ProductOptionSubOptionUI(props) {
93
96
  }
94
97
  }
95
98
  }, [state === null || state === void 0 ? void 0 : state.selected]);
96
- (0, _react.useEffect)(function () {
97
- if (dirtyRef !== null && dirtyRef !== void 0 && dirtyRef.current || !(suboption !== null && suboption !== void 0 && suboption.preselected) || !(option !== null && option !== void 0 && option.respect_to)) return;
98
- var newState = _objectSpread(_objectSpread({}, state), {}, {
99
- selected: suboption === null || suboption === void 0 ? void 0 : suboption.preselected,
100
- quantity: state.selected ? 0 : 1
101
- });
102
- onChange(newState, suboption, option);
103
- }, [suboption, dirtyRef, option]);
104
99
  (0, _react.useEffect)(function () {
105
100
  var _pizzaType$type, _pizzaType$type$toLow;
106
- if (((_pizzaType$type = pizzaType.type) === null || _pizzaType$type === void 0 || (_pizzaType$type$toLow = _pizzaType$type.toLowerCase) === null || _pizzaType$type$toLow === void 0 ? void 0 : _pizzaType$type$toLow.call(_pizzaType$type)) === 'mitad y mitad' && option !== null && option !== void 0 && option.with_half_option) {
101
+ if ((pizzaType === null || pizzaType === void 0 || (_pizzaType$type = pizzaType.type) === null || _pizzaType$type === void 0 || (_pizzaType$type$toLow = _pizzaType$type.toLowerCase) === null || _pizzaType$type$toLow === void 0 ? void 0 : _pizzaType$type$toLow.call(_pizzaType$type)) === 'mitad y mitad' && option !== null && option !== void 0 && option.with_half_option) {
107
102
  var _Object$values, _Object$values3;
108
103
  var _option = (_Object$values = Object.values((productCart === null || productCart === void 0 ? void 0 : productCart.options) || {})) === null || _Object$values === void 0 ? void 0 : _Object$values.find(function (option) {
109
104
  var _option$name, _option$name$toLowerC, _Object$values2;
@@ -122,7 +117,7 @@ var ProductOptionSubOptionUI = function ProductOptionSubOptionUI(props) {
122
117
  }
123
118
  }
124
119
  }
125
- }, [pizzaType.type, state === null || state === void 0 ? void 0 : state.selected, suboption === null || suboption === void 0 ? void 0 : suboption.id]);
120
+ }, [pizzaType === null || pizzaType === void 0 ? void 0 : pizzaType.type, state === null || state === void 0 ? void 0 : state.selected, suboption === null || suboption === void 0 ? void 0 : suboption.id]);
126
121
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
127
122
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
128
123
  key: i
@@ -179,7 +174,7 @@ var ProductOptionSubOptionUI = function ProductOptionSubOptionUI(props) {
179
174
  key: i
180
175
  }, AfterElement);
181
176
  }));
182
- };
177
+ }, ProductOptionSubOptionPropsAreEqual);
183
178
  var ProductOptionSubOption = exports.ProductOptionSubOption = function ProductOptionSubOption(props) {
184
179
  var productOptionSubOptionProps = _objectSpread(_objectSpread({}, props), {}, {
185
180
  UIComponent: ProductOptionSubOptionUI,
@@ -1004,7 +1004,7 @@ var getOrderStatus = exports.getOrderStatus = function getOrderStatus(s) {
1004
1004
  return objectStatus && objectStatus;
1005
1005
  };
1006
1006
  var getOrderStatuPickUp = exports.getOrderStatuPickUp = function getOrderStatuPickUp(s) {
1007
- var _theme$defaultLanguag25, _theme$defaultLanguag26, _theme$defaultLanguag27, _theme$defaultLanguag28, _theme$defaultLanguag29, _theme$defaultLanguag30, _theme$defaultLanguag31, _theme$defaultLanguag32, _theme$defaultLanguag33, _theme$defaultLanguag34, _theme$defaultLanguag35, _theme$defaultLanguag36, _theme$defaultLanguag37;
1007
+ var _theme$defaultLanguag25, _theme$defaultLanguag26, _theme$defaultLanguag27, _theme$defaultLanguag28, _theme$defaultLanguag29, _theme$defaultLanguag30, _theme$defaultLanguag31, _theme$defaultLanguag32, _theme$defaultLanguag33, _theme$defaultLanguag34, _theme$defaultLanguag35, _theme$defaultLanguag36, _theme$defaultLanguag37, _theme$defaultLanguag38;
1008
1008
  var _useLanguage9 = (0, _orderingComponentsExternal.useLanguage)(),
1009
1009
  _useLanguage10 = _slicedToArray(_useLanguage9, 2),
1010
1010
  t = _useLanguage10[1];
@@ -1040,39 +1040,44 @@ var getOrderStatuPickUp = exports.getOrderStatuPickUp = function getOrderStatuPi
1040
1040
  value: t('ACCEPTED_BY_BUSINESS', (theme === null || theme === void 0 || (_theme$defaultLanguag30 = theme.defaultLanguages) === null || _theme$defaultLanguag30 === void 0 ? void 0 : _theme$defaultLanguag30.ACCEPTED_BY_BUSINESS) || 'Accepted by business'),
1041
1041
  slug: 'ACCEPTED_BY_BUSINESS',
1042
1042
  percentage: 30
1043
+ }, {
1044
+ key: 11,
1045
+ value: t('DELIVERY_COMPLETED_BY_DRIVER', (theme === null || theme === void 0 || (_theme$defaultLanguag31 = theme.defaultLanguages) === null || _theme$defaultLanguag31 === void 0 ? void 0 : _theme$defaultLanguag31.DELIVERY_COMPLETED_BY_DRIVER) || 'Delivery completed by driver'),
1046
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
1047
+ percentage: 100
1043
1048
  }, {
1044
1049
  key: 13,
1045
- value: t('PREORDER', (theme === null || theme === void 0 || (_theme$defaultLanguag31 = theme.defaultLanguages) === null || _theme$defaultLanguag31 === void 0 ? void 0 : _theme$defaultLanguag31.PREORDER) || 'PreOrder'),
1050
+ value: t('PREORDER', (theme === null || theme === void 0 || (_theme$defaultLanguag32 = theme.defaultLanguages) === null || _theme$defaultLanguag32 === void 0 ? void 0 : _theme$defaultLanguag32.PREORDER) || 'PreOrder'),
1046
1051
  slug: 'PREORDER',
1047
1052
  percentage: 0
1048
1053
  }, {
1049
1054
  key: 14,
1050
- value: t('ORDER_NOT_READY', (theme === null || theme === void 0 || (_theme$defaultLanguag32 = theme.defaultLanguages) === null || _theme$defaultLanguag32 === void 0 ? void 0 : _theme$defaultLanguag32.ORDER_NOT_READY) || 'Order not ready'),
1055
+ value: t('ORDER_NOT_READY', (theme === null || theme === void 0 || (_theme$defaultLanguag33 = theme.defaultLanguages) === null || _theme$defaultLanguag33 === void 0 ? void 0 : _theme$defaultLanguag33.ORDER_NOT_READY) || 'Order not ready'),
1051
1056
  slug: 'ORDER_NOT_READY',
1052
1057
  percentage: 30
1053
1058
  }, {
1054
1059
  key: 15,
1055
- value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag33 = theme.defaultLanguages) === null || _theme$defaultLanguag33 === void 0 ? void 0 : _theme$defaultLanguag33.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER) || 'Order picked up completed by customer'),
1060
+ value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag34 = theme.defaultLanguages) === null || _theme$defaultLanguag34 === void 0 ? void 0 : _theme$defaultLanguag34.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER) || 'Order picked up completed by customer'),
1056
1061
  slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
1057
1062
  percentage: 100
1058
1063
  }, {
1059
1064
  key: 16,
1060
- value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag34 = theme.defaultLanguages) === null || _theme$defaultLanguag34 === void 0 ? void 0 : _theme$defaultLanguag34.ORDER_STATUS_CANCELLED_BY_CUSTOMER) || 'Order cancelled by customer'),
1065
+ value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag35 = theme.defaultLanguages) === null || _theme$defaultLanguag35 === void 0 ? void 0 : _theme$defaultLanguag35.ORDER_STATUS_CANCELLED_BY_CUSTOMER) || 'Order cancelled by customer'),
1061
1066
  slug: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
1062
1067
  percentage: 0
1063
1068
  }, {
1064
1069
  key: 17,
1065
- value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag35 = theme.defaultLanguages) === null || _theme$defaultLanguag35 === void 0 ? void 0 : _theme$defaultLanguag35.ORDER_NOT_PICKEDUP_BY_CUSTOMER) || 'Order not picked up by customer'),
1070
+ value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag36 = theme.defaultLanguages) === null || _theme$defaultLanguag36 === void 0 ? void 0 : _theme$defaultLanguag36.ORDER_NOT_PICKEDUP_BY_CUSTOMER) || 'Order not picked up by customer'),
1066
1071
  slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
1067
1072
  percentage: 0
1068
1073
  }, {
1069
1074
  key: 20,
1070
- value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', (theme === null || theme === void 0 || (_theme$defaultLanguag36 = theme.defaultLanguages) === null || _theme$defaultLanguag36 === void 0 ? void 0 : _theme$defaultLanguag36.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS) || 'Customer almost arrived to business'),
1075
+ value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', (theme === null || theme === void 0 || (_theme$defaultLanguag37 = theme.defaultLanguages) === null || _theme$defaultLanguag37 === void 0 ? void 0 : _theme$defaultLanguag37.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS) || 'Customer almost arrived to business'),
1071
1076
  slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
1072
1077
  percentage: 70
1073
1078
  }, {
1074
1079
  key: 21,
1075
- value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', (theme === null || theme === void 0 || (_theme$defaultLanguag37 = theme.defaultLanguages) === null || _theme$defaultLanguag37 === void 0 ? void 0 : _theme$defaultLanguag37.ORDER_CUSTOMER_ARRIVED_BUSINESS) || 'Customer arrived to business'),
1080
+ value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', (theme === null || theme === void 0 || (_theme$defaultLanguag38 = theme.defaultLanguages) === null || _theme$defaultLanguag38 === void 0 ? void 0 : _theme$defaultLanguag38.ORDER_CUSTOMER_ARRIVED_BUSINESS) || 'Customer arrived to business'),
1076
1081
  slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
1077
1082
  percentage: 90
1078
1083
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "10.10.8",
3
+ "version": "10.10.9",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -88,7 +88,7 @@
88
88
  "lodash": "^4.17.19",
89
89
  "moment": "^2.29.4",
90
90
  "nanoid": "^4.0.0",
91
- "ordering-components-external": "9.11.10",
91
+ "ordering-components-external": "9.11.11",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -126,7 +126,7 @@ const OrderDetailsUI = (props) => {
126
126
  const [isShowBusinessLogo, setIsShowBusinessLogo] = useState(true)
127
127
  const { order, loading, businessData, error } = props.order
128
128
  const yourSpotString = order?.delivery_type === 3 ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number')
129
- const acceptedStatus = [1, 2, 5, 6, 10, 11, 12]
129
+ const acceptedStatus = [1, 2, 5, 6, 10, 11, 12, 15]
130
130
  const completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
131
131
  const placeSpotTypes = [3, 4, 5]
132
132
  const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
@@ -25,7 +25,14 @@ import MdCheckBoxOutlineBlank from '@meronex/icons/md/MdCheckBoxOutlineBlank'
25
25
  import RiRadioButtonFill from '@meronex/icons/ri/RiRadioButtonFill'
26
26
  import MdRadioButtonUnchecked from '@meronex/icons/md/MdRadioButtonUnchecked'
27
27
 
28
- const ProductOptionSubOptionUI = (props) => {
28
+ const ProductOptionSubOptionPropsAreEqual = (prevProps, nextProps) => {
29
+ return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) &&
30
+ JSON.stringify(prevProps.pizzaType) === JSON.stringify(nextProps.pizzaType) &&
31
+ prevProps.balance === nextProps.balance &&
32
+ JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart)
33
+ }
34
+
35
+ const ProductOptionSubOptionUI = React.memo((props) => {
29
36
  const {
30
37
  state,
31
38
  increment,
@@ -88,13 +95,7 @@ const ProductOptionSubOptionUI = (props) => {
88
95
  }, [state?.selected])
89
96
 
90
97
  useEffect(() => {
91
- if (dirtyRef?.current || !suboption?.preselected || !option?.respect_to) return
92
- const newState = { ...state, selected: suboption?.preselected, quantity: state.selected ? 0 : 1 }
93
- onChange(newState, suboption, option)
94
- }, [suboption, dirtyRef, option])
95
-
96
- useEffect(() => {
97
- if (pizzaType.type?.toLowerCase?.() === 'mitad y mitad' && option?.with_half_option) {
98
+ if (pizzaType?.type?.toLowerCase?.() === 'mitad y mitad' && option?.with_half_option) {
98
99
  const option = Object.values(productCart?.options || {})?.find(option => option?.name?.toLowerCase?.() === 'elige tus ingredientes' && Object.values(option?.suboptions)?.length > 0)
99
100
  const alreadyRight = Object.values(option?.suboptions || {})?.some(suboption => suboption?.position === 'right')
100
101
  if (pizzaType.right && !alreadyRight) {
@@ -107,7 +108,7 @@ const ProductOptionSubOptionUI = (props) => {
107
108
  }
108
109
  }
109
110
  }
110
- }, [pizzaType.type, state?.selected, suboption?.id])
111
+ }, [pizzaType?.type, state?.selected, suboption?.id])
111
112
 
112
113
  return (
113
114
  <>
@@ -207,7 +208,7 @@ const ProductOptionSubOptionUI = (props) => {
207
208
  </React.Fragment>))}
208
209
  </>
209
210
  )
210
- }
211
+ }, ProductOptionSubOptionPropsAreEqual)
211
212
 
212
213
  export const ProductOptionSubOption = (props) => {
213
214
  const productOptionSubOptionProps = {
@@ -668,6 +668,7 @@ export const getOrderStatuPickUp = (s) => {
668
668
  { key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed'), slug: 'PREPARATION_COMPLETED', percentage: 50 },
669
669
  { key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business'), slug: 'REJECTED_BY_BUSINESS', percentage: 0 },
670
670
  { key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business'), slug: 'ACCEPTED_BY_BUSINESS', percentage: 30 },
671
+ { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver'), slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 100 },
671
672
  { key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder'), slug: 'PREORDER', percentage: 0 },
672
673
  { key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready'), slug: 'ORDER_NOT_READY', percentage: 30 },
673
674
  { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer'), slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', percentage: 100 },