ordering-ui-external 2.5.9 → 2.6.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 (40) hide show
  1. package/_bundles/{7.ordering-ui.c8be47315cef138f7d1e.js → 7.ordering-ui.bdbe517f1ccc205e7de9.js} +1 -1
  2. package/_bundles/ordering-ui.bdbe517f1ccc205e7de9.js +2 -0
  3. package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
  4. package/_modules/themes/five/src/components/AddressForm/index.js +6 -6
  5. package/_modules/themes/five/src/components/AddressList/index.js +38 -15
  6. package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +1 -1
  7. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  8. package/_modules/themes/five/src/components/CardForm/index.js +2 -1
  9. package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
  10. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +28 -6
  11. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +7 -5
  12. package/_modules/themes/five/src/components/OrderContextUI/index.js +5 -3
  13. package/_modules/themes/five/src/components/OrderContextUI/styles.js +3 -2
  14. package/_modules/themes/five/src/components/OrderProgress/index.js +3 -1
  15. package/_modules/themes/five/src/components/SidebarMenu/index.js +4 -2
  16. package/package.json +2 -2
  17. package/src/components/VerticalOrdersLayout/styles.js +7 -3
  18. package/src/themes/five/src/components/AddressForm/index.js +12 -3
  19. package/src/themes/five/src/components/AddressList/index.js +5 -3
  20. package/src/themes/five/src/components/BusinessListingSearch/styles.js +3 -0
  21. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  22. package/src/themes/five/src/components/CardForm/index.js +2 -1
  23. package/src/themes/five/src/components/Checkout/styles.js +1 -1
  24. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +29 -9
  25. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +3 -1
  26. package/src/themes/five/src/components/OrderContextUI/index.js +12 -9
  27. package/src/themes/five/src/components/OrderContextUI/styles.js +1 -1
  28. package/src/themes/five/src/components/OrderProgress/index.js +1 -1
  29. package/src/themes/five/src/components/SidebarMenu/index.js +8 -2
  30. package/_bundles/ordering-ui.c8be47315cef138f7d1e.js +0 -2
  31. /package/_bundles/{0.ordering-ui.c8be47315cef138f7d1e.js → 0.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  32. /package/_bundles/{1.ordering-ui.c8be47315cef138f7d1e.js → 1.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  33. /package/_bundles/{2.ordering-ui.c8be47315cef138f7d1e.js → 2.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  34. /package/_bundles/{4.ordering-ui.c8be47315cef138f7d1e.js → 4.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  35. /package/_bundles/{5.ordering-ui.c8be47315cef138f7d1e.js → 5.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  36. /package/_bundles/{6.ordering-ui.c8be47315cef138f7d1e.js → 6.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  37. /package/_bundles/{7.ordering-ui.c8be47315cef138f7d1e.js.LICENSE.txt → 7.ordering-ui.bdbe517f1ccc205e7de9.js.LICENSE.txt} +0 -0
  38. /package/_bundles/{8.ordering-ui.c8be47315cef138f7d1e.js → 8.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  39. /package/_bundles/{9.ordering-ui.c8be47315cef138f7d1e.js → 9.ordering-ui.bdbe517f1ccc205e7de9.js} +0 -0
  40. /package/_bundles/{ordering-ui.c8be47315cef138f7d1e.js.LICENSE.txt → ordering-ui.bdbe517f1ccc205e7de9.js.LICENSE.txt} +0 -0
@@ -31,7 +31,7 @@ var PastLogo = _styledComponents.default.div(_templateObject7 || (_templateObjec
31
31
  return isMulti && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 55px;\n min-width: 55px;\n height: 55px;\n min-height: 55px;\n margin: 3px;\n "])));
32
32
  });
33
33
  exports.PastLogo = PastLogo;
34
- var WrapperBusinessTitle = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: 95%;\n display: flex;\n gap: 10px;\n\n @media (min-width: 480px) {\n width: 80%;\n }\n"])));
34
+ var WrapperBusinessTitle = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: 80%;\n display: flex;\n gap: 10px;\n\n @media (min-width: 480px) {\n width: 95%;\n }\n"])));
35
35
  exports.WrapperBusinessTitle = WrapperBusinessTitle;
36
36
  var Reorder = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: 20%;\n text-align: center;\n align-items: center;\n justify-content: center;\n font-size: 0.8em;\n\n button {\n border-radius: 8px;\n font-size: 10px;\n line-height: 15px;\n padding: 10px;\n overflow: inherit;\n text-overflow: inherit;\n border: 1px solid ", ";\n margin: 5px 0;\n\n &.reorder {\n background: ", ";\n &:hover {\n background: ", ";\n }\n }\n }\n\n ", "\n\n p {\n color: #53ad26;\n margin-block-start: 0;\n margin-block-end: 0;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; /* number of lines to show */\n -webkit-box-orient: vertical;\n }\n @media (min-width: 480px){\n font-size: 1em;\n button{\n width: 90%;\n font-size: 0.9em;\n }\n flex-direction: row;\n gap: 10px;\n margin-right: 25px;\n }\n\n @media (min-width: 768px){\n ", "\n button{\n width: 80%;\n }\n }\n\n @media (min-width: 1024px){\n button{\n width: 50%;\n }\n }\n"])), function (props) {
37
37
  return props.theme.colors.primaryContrast;
@@ -55,5 +55,5 @@ var WrappButton = _styledComponents.default.div(_templateObject15 || (_templateO
55
55
  exports.WrappButton = WrappButton;
56
56
  var ReviewWrapper = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n .review-sent {\n border-radius: 7.6px;\n }\n"])));
57
57
  exports.ReviewWrapper = ReviewWrapper;
58
- var MultiLogosContainer = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
58
+ var MultiLogosContainer = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n display: none;\n align-items: center;\n\n @media (min-width: 480px) {\n display: flex;\n }\n"])));
59
59
  exports.MultiLogosContainer = MultiLogosContainer;
@@ -362,16 +362,16 @@ var AddressFormUI = function AddressFormUI(props) {
362
362
  if (isEditing) {
363
363
  var _formState$changes20;
364
364
  if (formState !== null && formState !== void 0 && (_formState$changes20 = formState.changes) !== null && _formState$changes20 !== void 0 && _formState$changes20.location) {
365
- var _formState$changes21, _formState$changes21$, _formState$changes22, _formState$changes22$;
365
+ var _locationChange$lat, _locationChange$lng, _formState$changes21, _formState$changes21$, _formState$changes21$2, _formState$changes22, _formState$changes22$, _formState$changes22$2;
366
366
  var prevLocation = {
367
- lat: Math.trunc(locationChange === null || locationChange === void 0 ? void 0 : locationChange.lat),
368
- lng: Math.trunc(locationChange === null || locationChange === void 0 ? void 0 : locationChange.lng)
367
+ lat: locationChange === null || locationChange === void 0 ? void 0 : (_locationChange$lat = locationChange.lat) === null || _locationChange$lat === void 0 ? void 0 : _locationChange$lat.toFixed(5),
368
+ lng: locationChange === null || locationChange === void 0 ? void 0 : (_locationChange$lng = locationChange.lng) === null || _locationChange$lng === void 0 ? void 0 : _locationChange$lng.toFixed(5)
369
369
  };
370
370
  var newLocation = {
371
- lat: Math.trunc(formState === null || formState === void 0 ? void 0 : (_formState$changes21 = formState.changes) === null || _formState$changes21 === void 0 ? void 0 : (_formState$changes21$ = _formState$changes21.location) === null || _formState$changes21$ === void 0 ? void 0 : _formState$changes21$.lat),
372
- lng: Math.trunc(formState === null || formState === void 0 ? void 0 : (_formState$changes22 = formState.changes) === null || _formState$changes22 === void 0 ? void 0 : (_formState$changes22$ = _formState$changes22.location) === null || _formState$changes22$ === void 0 ? void 0 : _formState$changes22$.lng)
371
+ lat: formState === null || formState === void 0 ? void 0 : (_formState$changes21 = formState.changes) === null || _formState$changes21 === void 0 ? void 0 : (_formState$changes21$ = _formState$changes21.location) === null || _formState$changes21$ === void 0 ? void 0 : (_formState$changes21$2 = _formState$changes21$.lat) === null || _formState$changes21$2 === void 0 ? void 0 : _formState$changes21$2.toFixed(5),
372
+ lng: formState === null || formState === void 0 ? void 0 : (_formState$changes22 = formState.changes) === null || _formState$changes22 === void 0 ? void 0 : (_formState$changes22$ = _formState$changes22.location) === null || _formState$changes22$ === void 0 ? void 0 : (_formState$changes22$2 = _formState$changes22$.lng) === null || _formState$changes22$2 === void 0 ? void 0 : _formState$changes22$2.toFixed(5)
373
373
  };
374
- if (prevLocation.lat !== newLocation.lat && prevLocation.lng !== newLocation.lng) {
374
+ if ((prevLocation === null || prevLocation === void 0 ? void 0 : prevLocation.lat) !== (newLocation === null || newLocation === void 0 ? void 0 : newLocation.lat) && (prevLocation === null || prevLocation === void 0 ? void 0 : prevLocation.lng) !== (newLocation === null || newLocation === void 0 ? void 0 : newLocation.lng)) {
375
375
  var _formState$changes23;
376
376
  setLocationChange(formState === null || formState === void 0 ? void 0 : (_formState$changes23 = formState.changes) === null || _formState$changes23 === void 0 ? void 0 : _formState$changes23.location);
377
377
  }
@@ -25,6 +25,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
  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; }
26
26
  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); }
27
27
  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); }
28
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
29
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
30
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
28
31
  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; }
29
32
  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; }
30
33
  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; }
@@ -54,7 +57,8 @@ var AddressListUI = function AddressListUI(props) {
54
57
  isFromCheckout = props.isFromCheckout,
55
58
  setIsAddressFormOpen = props.setIsAddressFormOpen,
56
59
  isProfile = props.isProfile,
57
- isMobile = props.isMobile;
60
+ isMobile = props.isMobile,
61
+ onCancel = props.onCancel;
58
62
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
59
63
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
60
64
  t = _useLanguage2[1];
@@ -130,18 +134,37 @@ var AddressListUI = function AddressListUI(props) {
130
134
  }
131
135
  handleCloseAddressForm();
132
136
  };
133
- var handleSetAddress = function handleSetAddress(address) {
134
- if (checkAddress(address) && isCustomerMode && (userCustomerSetup === null || userCustomerSetup === void 0 ? void 0 : userCustomerSetup.id) === (user === null || user === void 0 ? void 0 : user.id) && !isFromCheckout) {
135
- events.emit('go_to_page', {
136
- page: 'search'
137
- });
138
- handleSetDefault(address, userCustomerSetup, true);
139
- setCustomerModalOpen && setCustomerModalOpen(false);
140
- return;
141
- }
142
- handleCloseAddressForm();
143
- handleSetDefault(address, userCustomerSetup);
144
- };
137
+ var handleSetAddress = /*#__PURE__*/function () {
138
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(address) {
139
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
140
+ while (1) switch (_context.prev = _context.next) {
141
+ case 0:
142
+ if (!(checkAddress(address) && isCustomerMode && (userCustomerSetup === null || userCustomerSetup === void 0 ? void 0 : userCustomerSetup.id) === (user === null || user === void 0 ? void 0 : user.id) && !isFromCheckout)) {
143
+ _context.next = 5;
144
+ break;
145
+ }
146
+ events.emit('go_to_page', {
147
+ page: 'search'
148
+ });
149
+ handleSetDefault(address, userCustomerSetup, true);
150
+ setCustomerModalOpen && setCustomerModalOpen(false);
151
+ return _context.abrupt("return");
152
+ case 5:
153
+ handleCloseAddressForm();
154
+ _context.next = 8;
155
+ return handleSetDefault(address, userCustomerSetup);
156
+ case 8:
157
+ onCancel && onCancel();
158
+ case 9:
159
+ case "end":
160
+ return _context.stop();
161
+ }
162
+ }, _callee);
163
+ }));
164
+ return function handleSetAddress(_x2) {
165
+ return _ref.apply(this, arguments);
166
+ };
167
+ }();
145
168
  var handleDeleteClick = function handleDeleteClick(address) {
146
169
  setConfirm({
147
170
  open: true,
@@ -194,8 +217,8 @@ var AddressListUI = function AddressListUI(props) {
194
217
  handleCloseAddressForm();
195
218
  };
196
219
  }, []);
197
- var AddressListCallcenterLayout = function AddressListCallcenterLayout(_ref) {
198
- var children = _ref.children;
220
+ var AddressListCallcenterLayout = function AddressListCallcenterLayout(_ref2) {
221
+ var children = _ref2.children;
199
222
  return /*#__PURE__*/_react.default.createElement(_styles.AddressHalfContainer, null, /*#__PURE__*/_react.default.createElement(_styles.List, {
200
223
  halfWidth: addressOpen,
201
224
  id: "address_list"
@@ -19,7 +19,7 @@ var Title = _styledComponents.default.div(_templateObject2 || (_templateObject2
19
19
  exports.Title = Title;
20
20
  var FiltersContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex-direction: column;\n @media (min-width: 993px){\n flex-direction: row;\n display: flex;\n width: 100%;\n }\n"])));
21
21
  exports.FiltersContainer = FiltersContainer;
22
- var Filters = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n max-width: 100%;\n\n @media (min-width: 993px){\n width: 25%;\n max-width: 25%;\n margin-right: 70px;\n }\n"])));
22
+ var Filters = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n max-width: 100%;\n padding: 0 10px;\n box-sizing: border-box;\n\n @media (min-width: 993px){\n padding: 0;\n width: 25%;\n max-width: 25%;\n margin-right: 70px;\n }\n"])));
23
23
  exports.Filters = Filters;
24
24
  var FiltersResultContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 100%;\n max-width: 100%;\n @media (min-width: 993px){\n width: 75%;\n max-width: 75%;\n }\n"])));
25
25
  exports.FiltersResultContainer = FiltersResultContainer;
@@ -150,7 +150,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
150
150
  var hasMore = !(paginationProps.totalPages === paginationProps.currentPage);
151
151
  if (badScrollPosition || businessesList.loading || ((_businessesList$error = businessesList.error) === null || _businessesList$error === void 0 ? void 0 : _businessesList$error.length) > 0 || !hasMore) return;
152
152
  getBusinesses();
153
- }, [businessesList.loading, paginationProps]);
153
+ }, [businessesList, paginationProps]);
154
154
  (0, _react.useEffect)(function () {
155
155
  window.addEventListener('scroll', handleScroll);
156
156
  return function () {
@@ -37,7 +37,8 @@ var CARD_ELEMENT_OPTIONS = {
37
37
  color: '#fa755a',
38
38
  iconColor: '#fa755a'
39
39
  }
40
- }
40
+ },
41
+ showIcon: true
41
42
  };
42
43
  var CardFormUI = function CardFormUI(props) {
43
44
  var _props$beforeElements, _props$beforeComponen, _props$afterComponent, _props$afterElements;
@@ -12,7 +12,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
13
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n flex-direction: column;\n min-height: auto;\n\n @media (min-width: 769px) {\n flex-direction: row;\n }\n\n @media (min-width: 993px) {\n min-height: calc(100vh - 337px);\n box-sizing: border-box;\n }\n"])));
14
14
  exports.Container = Container;
15
- var WrapperLeftContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n box-sizing: border-box;\n padding: 55px 20px 30px;\n\n @media (min-width: 769px) {\n width: 55%;\n padding: 55px 60px 55px 40px;\n }\n\n @media (min-width: 820px) {\n padding: 30px 60px 55px 40px;\n }\n"])));
15
+ var WrapperLeftContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n box-sizing: border-box;\n padding: 20px 20px 30px;\n\n @media (min-width: 769px) {\n width: 55%;\n padding: 55px 60px 55px 40px;\n }\n\n @media (min-width: 820px) {\n padding: 30px 60px 55px 40px;\n }\n"])));
16
16
  exports.WrapperLeftContainer = WrapperLeftContainer;
17
17
  var WrapperRightContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n background: #F8F9FA;\n box-sizing: border-box;\n padding: 40px 20px;\n\n @media (min-width: 769px) {\n width: 45%;\n padding: 55px 40px;\n }\n"])));
18
18
  exports.WrapperRightContainer = WrapperRightContainer;
@@ -38,6 +38,7 @@ var RedeemGiftCardUI = function RedeemGiftCardUI(props) {
38
38
  _useUtils2 = _slicedToArray(_useUtils, 1),
39
39
  parsePrice = _useUtils2[0].parsePrice;
40
40
  var _useForm = (0, _reactHookForm.useForm)(),
41
+ control = _useForm.control,
41
42
  register = _useForm.register,
42
43
  handleSubmit = _useForm.handleSubmit,
43
44
  errors = _useForm.errors;
@@ -48,9 +49,18 @@ var RedeemGiftCardUI = function RedeemGiftCardUI(props) {
48
49
  _useState2 = _slicedToArray(_useState, 2),
49
50
  alertState = _useState2[0],
50
51
  setAlertState = _useState2[1];
52
+ var codeRef = (0, _react.useRef)(null);
51
53
  var onSubmit = function onSubmit(values) {
52
54
  handleApply(values);
53
55
  };
56
+ var handleChangeCode = function handleChangeCode(event) {
57
+ var string = event.target.value;
58
+ string = string.replace(/-/g, '');
59
+ if (!string) return;
60
+ var codeSlices = string.match(/.{1,4}/g);
61
+ string = codeSlices.join('-');
62
+ codeRef.current.value = string;
63
+ };
54
64
  (0, _react.useEffect)(function () {
55
65
  if (Object.keys(errors).length > 0) {
56
66
  setAlertState({
@@ -70,14 +80,26 @@ var RedeemGiftCardUI = function RedeemGiftCardUI(props) {
70
80
  }, [actionState.error]);
71
81
  return /*#__PURE__*/_react.default.createElement(_styles.Container, null, !redeemedGiftCard ? /*#__PURE__*/_react.default.createElement(_styles.FormContainer, {
72
82
  onSubmit: handleSubmit(onSubmit)
73
- }, /*#__PURE__*/_react.default.createElement("h2", null, t('REDEEM_GIFT_CARD', 'Redeem a gift card')), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('GIFT_CARD_CODE', 'Gift card code')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
83
+ }, /*#__PURE__*/_react.default.createElement("h2", null, t('REDEEM_GIFT_CARD', 'Redeem a gift card')), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('GIFT_CARD_CODE', 'Gift card code')), /*#__PURE__*/_react.default.createElement(_reactHookForm.Controller, {
74
84
  name: "code",
75
- placeholder: "0000 0000",
76
- type: "text",
77
- ref: register({
85
+ control: control,
86
+ render: function render(_ref) {
87
+ var _onChange = _ref.onChange,
88
+ value = _ref.value;
89
+ return /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
90
+ placeholder: "XXXX-XXXX-XXXX-XXXX",
91
+ type: "text",
92
+ autoComplete: "off",
93
+ ref: codeRef,
94
+ onChange: function onChange(e) {
95
+ _onChange(e.target.value);
96
+ handleChangeCode(e);
97
+ }
98
+ });
99
+ },
100
+ rules: {
78
101
  required: t('VALIDATION_ERROR_REQUIRED', 'Code is required').replace('_attribute_', t('CODE', 'Code'))
79
- }),
80
- autoComplete: "off"
102
+ }
81
103
  })), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('PASSWORD', 'Password')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
82
104
  name: "password",
83
105
  type: "password",
@@ -73,7 +73,7 @@ var CreditCard2 = function CreditCard2() {
73
73
  }));
74
74
  };
75
75
  var MultiCartsPaymethodsAndWalletsUI = function MultiCartsPaymethodsAndWalletsUI(props) {
76
- var _configs$wallet_cash_, _configs$wallet_credi, _paymethodSelected$pa, _paymethodSelected$pa2, _paymethodSelected$pa3, _paymethodSelected$pa4, _paymethodSelected$pa5, _paymethodSelected$pa6, _paymethodSelected$pa7, _paymethodSelected$pa8, _paymethodSelected$pa9, _paymethodSelected$pa10, _walletsState$result, _paymethodSelected$pa11, _paymethodSelected$da, _paymethodSelected$da2, _paymethodSelected$pa12, _paymethodSelected$pa13, _paymethodSelected$da3, _paymethodSelected$da4;
76
+ var _configs$wallet_cash_, _configs$wallet_credi, _paymethodSelected$pa, _paymethodSelected$pa2, _paymethodSelected$pa3, _paymethodSelected$pa4, _paymethodSelected$da, _paymethodSelected$pa5, _paymethodSelected$pa6, _paymethodSelected$pa7, _paymethodSelected$pa8, _paymethodSelected$pa9, _paymethodSelected$pa10, _walletsState$result, _paymethodSelected$pa11, _paymethodSelected$da2, _paymethodSelected$da3, _paymethodSelected$pa12, _paymethodSelected$pa13, _paymethodSelected$da4, _paymethodSelected$da5;
77
77
  var businessIds = props.businessIds,
78
78
  balance = props.balance,
79
79
  paymethodsAndWallets = props.paymethodsAndWallets,
@@ -148,8 +148,10 @@ var MultiCartsPaymethodsAndWalletsUI = function MultiCartsPaymethodsAndWalletsUI
148
148
  businessIds: businessIds,
149
149
  publicKey: paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa2 = paymethodSelected.paymethod) === null || _paymethodSelected$pa2 === void 0 ? void 0 : (_paymethodSelected$pa3 = _paymethodSelected$pa2.credentials) === null || _paymethodSelected$pa3 === void 0 ? void 0 : _paymethodSelected$pa3.publishable,
150
150
  payType: paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa4 = paymethodSelected.paymethod) === null || _paymethodSelected$pa4 === void 0 ? void 0 : _paymethodSelected$pa4.name,
151
- onSelectCard: handlePaymethodDataChange
152
- }), stripeOptions.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa5 = paymethodSelected.paymethod) === null || _paymethodSelected$pa5 === void 0 ? void 0 : _paymethodSelected$pa5.gateway) && (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa6 = paymethodSelected.paymethod_data) === null || _paymethodSelected$pa6 === void 0 ? void 0 : _paymethodSelected$pa6.card) && /*#__PURE__*/_react.default.createElement(_styles.PayCardSelected, null, /*#__PURE__*/_react.default.createElement(_styles.CardItemContent, null, /*#__PURE__*/_react.default.createElement("span", {
151
+ onSelectCard: handlePaymethodDataChange,
152
+ paymethodSelected: paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da = paymethodSelected.data) === null || _paymethodSelected$da === void 0 ? void 0 : _paymethodSelected$da.id,
153
+ setCardList: setCardList
154
+ }), stripeOptions.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa5 = paymethodSelected.paymethod) === null || _paymethodSelected$pa5 === void 0 ? void 0 : _paymethodSelected$pa5.gateway) && (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa6 = paymethodSelected.paymethod_data) === null || _paymethodSelected$pa6 === void 0 ? void 0 : _paymethodSelected$pa6.card) && (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.gateway) !== 'stripe' && /*#__PURE__*/_react.default.createElement(_styles.PayCardSelected, null, /*#__PURE__*/_react.default.createElement(_styles.CardItemContent, null, /*#__PURE__*/_react.default.createElement("span", {
153
155
  className: "checks"
154
156
  }, /*#__PURE__*/_react.default.createElement(_IosRadioButtonOn.default, null)), /*#__PURE__*/_react.default.createElement("span", {
155
157
  className: "brand"
@@ -213,12 +215,12 @@ var MultiCartsPaymethodsAndWalletsUI = function MultiCartsPaymethodsAndWalletsUI
213
215
  onClose: function onClose() {
214
216
  return setOpenPaymethod(null);
215
217
  }
216
- }, !(paymethodSelected !== null && paymethodSelected !== void 0 && (_paymethodSelected$da = paymethodSelected.data) !== null && _paymethodSelected$da !== void 0 && _paymethodSelected$da.publishable) && /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("p", null, t('ADD_PUBLISHABLE_KEY', 'Please add a publishable key'))), (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da2 = paymethodSelected.data) === null || _paymethodSelected$da2 === void 0 ? void 0 : _paymethodSelected$da2.publishable) && (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa12 = paymethodSelected.paymethod) === null || _paymethodSelected$pa12 === void 0 ? void 0 : _paymethodSelected$pa12.gateway)) && /*#__PURE__*/_react.default.createElement(_StripeElementsForm.StripeElementsForm, {
218
+ }, !(paymethodSelected !== null && paymethodSelected !== void 0 && (_paymethodSelected$da2 = paymethodSelected.data) !== null && _paymethodSelected$da2 !== void 0 && _paymethodSelected$da2.publishable) && /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("p", null, t('ADD_PUBLISHABLE_KEY', 'Please add a publishable key'))), (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da3 = paymethodSelected.data) === null || _paymethodSelected$da3 === void 0 ? void 0 : _paymethodSelected$da3.publishable) && (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa12 = paymethodSelected.paymethod) === null || _paymethodSelected$pa12 === void 0 ? void 0 : _paymethodSelected$pa12.gateway)) && /*#__PURE__*/_react.default.createElement(_StripeElementsForm.StripeElementsForm, {
217
219
  methodsPay: methodsPay,
218
220
  paymethod: paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$pa13 = paymethodSelected.paymethod) === null || _paymethodSelected$pa13 === void 0 ? void 0 : _paymethodSelected$pa13.gateway,
219
221
  businessId: props.businessId,
220
222
  cartGroup: cartGroup === null || cartGroup === void 0 ? void 0 : cartGroup.result,
221
- publicKey: (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da3 = paymethodSelected.data) === null || _paymethodSelected$da3 === void 0 ? void 0 : _paymethodSelected$da3.publishable) || (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da4 = paymethodSelected.data) === null || _paymethodSelected$da4 === void 0 ? void 0 : _paymethodSelected$da4.publishable_key),
223
+ publicKey: (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da4 = paymethodSelected.data) === null || _paymethodSelected$da4 === void 0 ? void 0 : _paymethodSelected$da4.publishable) || (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da5 = paymethodSelected.data) === null || _paymethodSelected$da5 === void 0 ? void 0 : _paymethodSelected$da5.publishable_key),
222
224
  handleSource: handlePaymethodDataChange,
223
225
  onCancel: function onCancel() {
224
226
  return setOpenPaymethod(null);
@@ -30,7 +30,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
30
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
31
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
32
  var OrderContextUI = function OrderContextUI(props) {
33
- var _configState$configs, _configState$configs$, _orderState$options2, _orderState$options2$, _orderState$options3;
33
+ var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderState$options2, _orderState$options2$, _orderState$options3;
34
34
  var isCheckOut = props.isCheckOut,
35
35
  setMapErrors = props.setMapErrors,
36
36
  isCustomerMode = props.isCustomerMode,
@@ -70,6 +70,7 @@ var OrderContextUI = function OrderContextUI(props) {
70
70
  var configTypes = (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_types_allowed) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value.split('|').map(function (value) {
71
71
  return Number(value);
72
72
  })) || [];
73
+ var isPreOrderSetting = (configState === null || configState === void 0 ? void 0 : (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 ? void 0 : (_configState$configs3 = _configState$configs2.preorder_status_enabled) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1';
73
74
  var handleTogglePopover = function handleTogglePopover(type) {
74
75
  setOpenPopover(_objectSpread(_objectSpread({}, openPopover), {}, _defineProperty({}, type, !openPopover[type])));
75
76
  };
@@ -110,7 +111,8 @@ var OrderContextUI = function OrderContextUI(props) {
110
111
  };
111
112
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, {
112
113
  isBusinessList: isBusinessList,
113
- hero: props.hideHero
114
+ hero: props.hideHero,
115
+ isCheckOut: isCheckOut
114
116
  }, /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
115
117
  onClick: function onClick() {
116
118
  return handleClickAddress();
@@ -118,7 +120,7 @@ var OrderContextUI = function OrderContextUI(props) {
118
120
  isCheckOut: isCheckOut
119
121
  }, /*#__PURE__*/_react.default.createElement(_FaMapMarkerAlt.default, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : (_orderState$options2$ = _orderState$options2.address) === null || _orderState$options2$ === void 0 ? void 0 : _orderState$options2$.address) || t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?'))), /*#__PURE__*/_react.default.createElement(_styles.FeatureItems, null, /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorHeader.OrderTypeSelectorHeader, {
120
122
  configTypes: configTypes
121
- })), /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_MomentPopover.MomentPopover, {
123
+ })), isPreOrderSetting && /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_MomentPopover.MomentPopover, {
122
124
  open: openPopover.moment,
123
125
  onClick: function onClick() {
124
126
  return handleTogglePopover('moment');
@@ -14,8 +14,9 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
14
14
  var isBusinessList = _ref.isBusinessList;
15
15
  return isBusinessList && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 0 15px;\n box-sizing: border-box;\n "])));
16
16
  }, function (_ref2) {
17
- var hero = _ref2.hero;
18
- return hero && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 10%;\n "])));
17
+ var hero = _ref2.hero,
18
+ isCheckOut = _ref2.isCheckOut;
19
+ return !(hero || isCheckOut) && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 10%;\n "])));
19
20
  });
20
21
  exports.Container = Container;
21
22
  var AddressMenu = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: pointer;\n font-size: 14px;\n display: flex;\n align-items: center;\n background-color: ", ";\n font-weight: 600;\n border-radius: 50px;\n padding: 13px 19px;\n margin-bottom: 10px;\n ", "\n\n span {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n svg {\n margin-right: 5px;\n color: ", ";\n ", "\n }\n"])), function (props) {
@@ -64,7 +64,9 @@ var OrderProgressUI = function OrderProgressUI(props) {
64
64
  };
65
65
  (0, _react.useEffect)(function () {
66
66
  if ((orderList === null || orderList === void 0 ? void 0 : orderList.orders.length) > 0) {
67
- var sortedOrders = orderList.orders.sort(function (a, b) {
67
+ var sortedOrders = orderList.orders.filter(function (order) {
68
+ return !!(order !== null && order !== void 0 && order.business);
69
+ }).sort(function (a, b) {
68
70
  return a.id > b.id ? -1 : 1;
69
71
  });
70
72
  var orderInProgress = sortedOrders.find(function (_ref) {
@@ -267,7 +267,8 @@ var SidebarMenu = function SidebarMenu(props) {
267
267
  }
268
268
  })), !auth && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.MenuLink, {
269
269
  onClick: function onClick() {
270
- return handleOpenLoginSignUp('login');
270
+ handleOpenLoginSignUp('login');
271
+ actionSidebar(false);
271
272
  }
272
273
  }, /*#__PURE__*/_react.default.createElement(_styles.WrappContent, null, /*#__PURE__*/_react.default.createElement(_styles.MenuLinkIcon, {
273
274
  active: modalPageToShow === 'login'
@@ -275,7 +276,8 @@ var SidebarMenu = function SidebarMenu(props) {
275
276
  active: modalPageToShow === 'login'
276
277
  }, t('SIGN_IN', 'Sign in'))), /*#__PURE__*/_react.default.createElement(_styles.MenuLinkSeparator, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("hr", null))))), !isHideSignup && /*#__PURE__*/_react.default.createElement(_styles.MenuLink, {
277
278
  onClick: function onClick() {
278
- return handleOpenLoginSignUp('signup');
279
+ handleOpenLoginSignUp('signup');
280
+ actionSidebar(false);
279
281
  }
280
282
  }, /*#__PURE__*/_react.default.createElement(_styles.WrappContent, null, /*#__PURE__*/_react.default.createElement(_styles.MenuLinkIcon, {
281
283
  active: modalPageToShow === 'signup'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "2.5.9",
3
+ "version": "2.6.0",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -87,7 +87,7 @@
87
87
  "lodash": "^4.17.19",
88
88
  "moment": "^2.29.4",
89
89
  "nanoid": "^4.0.0",
90
- "ordering-components-external": "2.6.2",
90
+ "ordering-components-external": "2.7.0",
91
91
  "polished": "^3.6.6",
92
92
  "react-bootstrap-icons": "^1.7.2",
93
93
  "react-calendar": "^3.3.1",
@@ -84,12 +84,12 @@ export const PastLogo = styled.div`
84
84
  `
85
85
 
86
86
  export const WrapperBusinessTitle = styled.div`
87
- width: 95%;
87
+ width: 80%;
88
88
  display: flex;
89
89
  gap: 10px;
90
90
 
91
91
  @media (min-width: 480px) {
92
- width: 80%;
92
+ width: 95%;
93
93
  }
94
94
  `
95
95
 
@@ -209,6 +209,10 @@ export const ReviewWrapper = styled.div`
209
209
  `
210
210
 
211
211
  export const MultiLogosContainer = styled.div`
212
- display: flex;
212
+ display: none;
213
213
  align-items: center;
214
+
215
+ @media (min-width: 480px) {
216
+ display: flex;
217
+ }
214
218
  `
@@ -299,9 +299,18 @@ const AddressFormUI = (props) => {
299
299
 
300
300
  if (isEditing) {
301
301
  if (formState?.changes?.location) {
302
- const prevLocation = { lat: Math.trunc(locationChange?.lat), lng: Math.trunc(locationChange?.lng) }
303
- const newLocation = { lat: Math.trunc(formState?.changes?.location?.lat), lng: Math.trunc(formState?.changes?.location?.lng) }
304
- if (prevLocation.lat !== newLocation.lat && prevLocation.lng !== newLocation.lng) {
302
+ const prevLocation = {
303
+ lat: locationChange?.lat?.toFixed(5),
304
+ lng: locationChange?.lng?.toFixed(5)
305
+ }
306
+ const newLocation = {
307
+ lat: formState?.changes?.location?.lat?.toFixed(5),
308
+ lng: formState?.changes?.location?.lng?.toFixed(5)
309
+ }
310
+ if (
311
+ prevLocation?.lat !== newLocation?.lat &&
312
+ prevLocation?.lng !== newLocation?.lng
313
+ ) {
305
314
  setLocationChange(formState?.changes?.location)
306
315
  }
307
316
  }
@@ -65,7 +65,8 @@ const AddressListUI = (props) => {
65
65
  isFromCheckout,
66
66
  setIsAddressFormOpen,
67
67
  isProfile,
68
- isMobile
68
+ isMobile,
69
+ onCancel
69
70
  } = props
70
71
 
71
72
  const [, t] = useLanguage()
@@ -126,7 +127,7 @@ const AddressListUI = (props) => {
126
127
  handleCloseAddressForm()
127
128
  }
128
129
 
129
- const handleSetAddress = (address) => {
130
+ const handleSetAddress = async (address) => {
130
131
  if (
131
132
  checkAddress(address) &&
132
133
  isCustomerMode &&
@@ -140,7 +141,8 @@ const AddressListUI = (props) => {
140
141
  }
141
142
 
142
143
  handleCloseAddressForm()
143
- handleSetDefault(address, userCustomerSetup)
144
+ await handleSetDefault(address, userCustomerSetup)
145
+ onCancel && onCancel()
144
146
  }
145
147
 
146
148
  const handleDeleteClick = (address) => {
@@ -48,8 +48,11 @@ export const FiltersContainer = styled.div`
48
48
  export const Filters = styled.div`
49
49
  width: 100%;
50
50
  max-width: 100%;
51
+ padding: 0 10px;
52
+ box-sizing: border-box;
51
53
 
52
54
  @media (min-width: 993px){
55
+ padding: 0;
53
56
  width: 25%;
54
57
  max-width: 25%;
55
58
  margin-right: 70px;
@@ -113,7 +113,7 @@ const BusinessesListingUI = (props) => {
113
113
  const hasMore = !(paginationProps.totalPages === paginationProps.currentPage)
114
114
  if (badScrollPosition || businessesList.loading || businessesList.error?.length > 0 || !hasMore) return
115
115
  getBusinesses()
116
- }, [businessesList.loading, paginationProps])
116
+ }, [businessesList, paginationProps])
117
117
 
118
118
  useEffect(() => {
119
119
  window.addEventListener('scroll', handleScroll)
@@ -29,7 +29,8 @@ const CARD_ELEMENT_OPTIONS = {
29
29
  color: '#fa755a',
30
30
  iconColor: '#fa755a'
31
31
  }
32
- }
32
+ },
33
+ showIcon: true
33
34
  }
34
35
 
35
36
  const CardFormUI = (props) => {
@@ -19,7 +19,7 @@ export const Container = styled.div`
19
19
  export const WrapperLeftContainer = styled.div`
20
20
  width: 100%;
21
21
  box-sizing: border-box;
22
- padding: 55px 20px 30px;
22
+ padding: 20px 20px 30px;
23
23
 
24
24
  @media (min-width: 769px) {
25
25
  width: 55%;
@@ -1,6 +1,6 @@
1
- import React, { useEffect, useState } from 'react'
1
+ import React, { useEffect, useState, useRef } from 'react'
2
2
  import { useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController } from 'ordering-components-external'
3
- import { useForm } from 'react-hook-form'
3
+ import { useForm, Controller } from 'react-hook-form'
4
4
  import { Alert } from '../../Confirm'
5
5
  import { Button } from '../../../styles/Buttons'
6
6
  import { Input } from '../../../styles/Inputs'
@@ -22,13 +22,23 @@ const RedeemGiftCardUI = (props) => {
22
22
 
23
23
  const [, t] = useLanguage()
24
24
  const [{ parsePrice }] = useUtils()
25
- const { register, handleSubmit, errors } = useForm()
25
+ const { control, register, handleSubmit, errors } = useForm()
26
26
  const [alertState, setAlertState] = useState({ open: false, content: [] })
27
+ const codeRef = useRef(null)
27
28
 
28
29
  const onSubmit = (values) => {
29
30
  handleApply(values)
30
31
  }
31
32
 
33
+ const handleChangeCode = (event) => {
34
+ let string = event.target.value
35
+ string = string.replace(/-/g, '')
36
+ if (!string) return
37
+ const codeSlices = string.match(/.{1,4}/g)
38
+ string = codeSlices.join('-')
39
+ codeRef.current.value = string
40
+ }
41
+
32
42
  useEffect(() => {
33
43
  if (Object.keys(errors).length > 0) {
34
44
  setAlertState({
@@ -53,14 +63,24 @@ const RedeemGiftCardUI = (props) => {
53
63
  <h2>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</h2>
54
64
  <FormController>
55
65
  <label>{t('GIFT_CARD_CODE', 'Gift card code')}</label>
56
- <Input
66
+ <Controller
57
67
  name='code'
58
- placeholder='0000 0000'
59
- type='text'
60
- ref={register({
68
+ control={control}
69
+ render={({ onChange, value }) => (
70
+ <Input
71
+ placeholder='XXXX-XXXX-XXXX-XXXX'
72
+ type='text'
73
+ autoComplete='off'
74
+ ref={codeRef}
75
+ onChange={e => {
76
+ onChange(e.target.value)
77
+ handleChangeCode(e)
78
+ }}
79
+ />
80
+ )}
81
+ rules={{
61
82
  required: t('VALIDATION_ERROR_REQUIRED', 'Code is required').replace('_attribute_', t('CODE', 'Code'))
62
- })}
63
- autoComplete='off'
83
+ }}
64
84
  />
65
85
  </FormController>
66
86
  <FormController>
@@ -136,10 +136,12 @@ const MultiCartsPaymethodsAndWalletsUI = (props) => {
136
136
  publicKey={paymethodSelected?.paymethod?.credentials?.publishable}
137
137
  payType={paymethodSelected?.paymethod?.name}
138
138
  onSelectCard={handlePaymethodDataChange}
139
+ paymethodSelected={paymethodSelected?.data?.id}
140
+ setCardList={setCardList}
139
141
  />
140
142
  )}
141
143
 
142
- {stripeOptions.includes(paymethodSelected?.paymethod?.gateway) && paymethodSelected?.paymethod_data?.card && (
144
+ {stripeOptions.includes(paymethodSelected?.paymethod?.gateway) && paymethodSelected?.paymethod_data?.card && paymethodSelected?.gateway !== 'stripe' && (
143
145
  <PayCardSelected>
144
146
  <CardItemContent>
145
147
  <span className='checks'>