@ancon/wildcat-utils 1.40.18 → 1.40.19
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.
|
@@ -34,7 +34,8 @@ declare enum TranslationKey {
|
|
|
34
34
|
OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess",
|
|
35
35
|
OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon",
|
|
36
36
|
YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost",
|
|
37
|
-
|
|
37
|
+
OrderCanceledHostWillUpdateAndProcessAgain = "orderCanceledHostWillUpdateAndProcessAgain",
|
|
38
|
+
OrderCanceledYouCanManageYourOrderAgain = "orderCanceledYouCanManageYourOrderAgain",
|
|
38
39
|
YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed",
|
|
39
40
|
YourOrderWasCancelled = "yourOrderWasCancelled",
|
|
40
41
|
ProcessingPayment = "processingPayment",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),A=require("./getCheckoutItemsMappedByTicketItemStatus.js");var
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),A=require("./getCheckoutItemsMappedByTicketItemStatus.js");var f=(e=>(e.OrderConfirmedHostWillApproveAndProcess="orderConfirmedHostWillApproveAndProcess",e.OrderConfirmedRestaurantAdminWillAcceptSoon="orderConfirmedRestaurantAdminWillAcceptSoon",e.YourOrderHasBeenApprovedByHost="yourOrderHasBeenApprovedByHost",e.OrderCanceledHostWillUpdateAndProcessAgain="orderCanceledHostWillUpdateAndProcessAgain",e.OrderCanceledYouCanManageYourOrderAgain="orderCanceledYouCanManageYourOrderAgain",e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime="yourOrderHasBeenAcceptedEstimatedDeliveryStartTime",e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime="yourOrderIsBeingPreparedEstimatedDeliveryStartTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e.ThereWasAnError="thereWasAnError",e.YourOrderReadyToPickupFromLocker="yourOrderReadyToPickupFromLocker",e))(f||{});function v(e){switch(e){case r.CheckoutStatus.Error:return"thereWasAnError";case r.CheckoutStatus.Created:case r.CheckoutStatus.Ready:case r.CheckoutStatus.Processing:case r.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case r.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case r.CheckoutStatus.Received:return"processingPayment";default:return null}}function T(e){switch(e){case r.TicketStatus.Pending:case r.TicketStatus.PendingAccept:return"yourOrderIsBeingProcessed";case r.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case r.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case r.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case r.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`)}}function B(e){const{isHost:o,preOrderStatus:d,preOrderAttendeeStatus:i,preOrderCancelInfo:a}=e;if(i===r.AttendeePreOrderStatus.Confirmed)switch(d){case r.PreOrderStatus.Started:{const{cancelActor:s,canceledAt:t}=a??{};return!!s&&!!t?o?"orderCanceledYouCanManageYourOrderAgain":"orderCanceledHostWillUpdateAndProcessAgain":"orderConfirmedHostWillApproveAndProcess"}case r.PreOrderStatus.Waiting:return o?"orderConfirmedRestaurantAdminWillAcceptSoon":"yourOrderHasBeenApprovedByHost"}return null}function I(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:i}){const a=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,s=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,t=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(a||s||t&&!i)return!1;const n=o!=null,u=d!=null;if(n){const l=o===r.CheckoutStatus.Captured,c=o===r.CheckoutStatus.InProgress;return l||c}if(u){const l=d===r.TicketStatus.Preparing,c=d===r.TicketStatus.Ready;return l||c}return!1}function k(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:i,pickupTimeUpdated:a,preOrderOptions:s},t){if(t&&I(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:i})){if(t.ready>0)return t.ready<2?["oneItemIsReadyToCollect"]:["multipleItemsAreReadyToCollect",{count:t.ready}];if(t.done>0&&t.done<t.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,t.all-t.done-t.ready)}]}if(d!=null)return[T(d)];if(s&&(o===r.CheckoutStatus.Created||o===r.CheckoutStatus.Authorized)){const C=B(s);if(C)return[C]}const n=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,u=v(o);if(u)return[u];const l=o===r.CheckoutStatus.Captured,c=o===r.CheckoutStatus.InProgress,m=o===r.CheckoutStatus.Done,P=o===r.CheckoutStatus.DeliveryInProgress,h=o===r.CheckoutStatus.ReadyToCollect,p=(e==null?void 0:e.orderFormat)===r.OrderFormat.EatIn,y=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,O=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder,g=(e==null?void 0:e.orderFormat)===r.OrderFormat.BoxPickup;if(l)return O&&!i?["yourOrderWillArriveAtYourTable"]:n?a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"]:a?["modifiedPickUpTime"]:["yourOrderHasBeenAcceptedPickupTime"];if(c){if(n)return a?["modifiedDeliveryStartTime"]:["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];if(t&&(p||y)){if(t.ready===t.all)return["yourOrderIsReadyToCollect"];if(t.done===t.all)return["yourOrderHasBeenCompleted"]}if(O){if(t){if(t.ready===t.all)return i?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"];if(t.done===t.all)return i?["yourOrderHasBeenCompleted"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:i?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(m)return p||y?["yourOrderHasBeenCompleted"]:n?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(P&&g)switch(e==null?void 0:e.deliveryStatus){case r.CheckoutDeliveryStatus.PickedUp:return["yourOrderHasBeenCompleted"];case r.CheckoutDeliveryStatus.Delivered:return["yourOrderReadyToPickupFromLocker"];default:return["yourOrderIsBeingPrepared"]}if(h)return n?["yourOrderIsBeingDelivered"]:g?["yourOrderReadyToPickupFromLocker"]:["yourOrderIsReadyToCollect"];throw new Error("Could not resolve translation key in getTranslationKey()")}const S={orderConfirmedHostWillApproveAndProcess:()=>({title:`Order confirmed!
|
|
2
2
|
The host will approve and process the pre-order.`,message:"Please contact the host if you want to edit your order."}),orderConfirmedRestaurantAdminWillAcceptSoon:()=>({title:`Order confirmed!
|
|
3
|
-
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),
|
|
4
|
-
The host will
|
|
3
|
+
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),orderCanceledHostWillUpdateAndProcessAgain:()=>({title:`Order canceled!
|
|
4
|
+
The host will update and process the pre-order again.`,message:"Please contact the host if you want to edit your order."}),orderCanceledYouCanManageYourOrderAgain:()=>({title:`Order canceled!
|
|
5
|
+
You can manage your order.`,message:"Please update and process the pre-order again."}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function Y(e,o){if(o)return;const d=A(e);return{all:d.all.length,ready:d.ready.length,done:d.done.length}}function w(e,o,d=S){const{isSkipTicketStatus:i}=o,a=Y((e==null?void 0:e.items)??[],i),[s,t]=k(e,o,a),n=d[s]({key:s,meta:t});if(!n)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[n,s]}exports.TranslationKey=f;exports.default=w;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as C, TicketStatus as s, AttendeePreOrderStatus as I, PreOrderStatus as A } from "@ancon/wildcat-types";
|
|
2
2
|
import T from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
-
var
|
|
4
|
-
function
|
|
3
|
+
var Y = /* @__PURE__ */ ((e) => (e.OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess", e.OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon", e.YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost", e.OrderCanceledHostWillUpdateAndProcessAgain = "orderCanceledHostWillUpdateAndProcessAgain", e.OrderCanceledYouCanManageYourOrderAgain = "orderCanceledYouCanManageYourOrderAgain", e.YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed", e.YourOrderWasCancelled = "yourOrderWasCancelled", e.ProcessingPayment = "processingPayment", e.YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared", e.YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect", e.YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered", e.YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted", e.YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable", e.ModifiedDeliveryStartTime = "modifiedDeliveryStartTime", e.ModifiedPickUpTime = "modifiedPickUpTime", e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime = "yourOrderHasBeenAcceptedEstimatedDeliveryStartTime", e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime = "yourOrderIsBeingPreparedEstimatedDeliveryStartTime", e.YourOrderHasBeenAcceptedEstimatedTime = "yourOrderHasBeenAcceptedEstimatedTime", e.YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime", e.DeliveryWasCompleted = "deliveryWasCompleted", e.OneItemIsReadyToCollect = "oneItemIsReadyToCollect", e.MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect", e.EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared", e.ThereWasAnError = "thereWasAnError", e.YourOrderReadyToPickupFromLocker = "yourOrderReadyToPickupFromLocker", e))(Y || {});
|
|
4
|
+
function w(e) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Error:
|
|
7
7
|
return "thereWasAnError";
|
|
@@ -18,18 +18,18 @@ function W(e) {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function W(e) {
|
|
22
22
|
switch (e) {
|
|
23
|
-
case
|
|
24
|
-
case
|
|
23
|
+
case s.Pending:
|
|
24
|
+
case s.PendingAccept:
|
|
25
25
|
return "yourOrderIsBeingProcessed";
|
|
26
|
-
case
|
|
26
|
+
case s.Preparing:
|
|
27
27
|
return "yourOrderIsBeingPrepared";
|
|
28
|
-
case
|
|
28
|
+
case s.Ready:
|
|
29
29
|
return "yourOrderIsReadyToCollect";
|
|
30
|
-
case
|
|
30
|
+
case s.Closed:
|
|
31
31
|
return "yourOrderHasBeenCompleted";
|
|
32
|
-
case
|
|
32
|
+
case s.Canceled:
|
|
33
33
|
return "yourOrderWasCancelled";
|
|
34
34
|
default:
|
|
35
35
|
throw new Error(
|
|
@@ -37,49 +37,49 @@ function H(e) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const { isHost: t, preOrderStatus:
|
|
42
|
-
if (
|
|
43
|
-
switch (
|
|
44
|
-
case
|
|
45
|
-
const { cancelActor:
|
|
46
|
-
return !!
|
|
40
|
+
function H(e) {
|
|
41
|
+
const { isHost: t, preOrderStatus: d, preOrderAttendeeStatus: i, preOrderCancelInfo: a } = e;
|
|
42
|
+
if (i === I.Confirmed)
|
|
43
|
+
switch (d) {
|
|
44
|
+
case A.Started: {
|
|
45
|
+
const { cancelActor: n, canceledAt: r } = a ?? {};
|
|
46
|
+
return !!n && !!r ? t ? "orderCanceledYouCanManageYourOrderAgain" : "orderCanceledHostWillUpdateAndProcessAgain" : "orderConfirmedHostWillApproveAndProcess";
|
|
47
47
|
}
|
|
48
|
-
case
|
|
48
|
+
case A.Waiting:
|
|
49
49
|
return t ? "orderConfirmedRestaurantAdminWillAcceptSoon" : "yourOrderHasBeenApprovedByHost";
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
function k(e, {
|
|
54
54
|
checkoutStatus: t,
|
|
55
|
-
ticketStatus:
|
|
56
|
-
customersFetchTableOrders:
|
|
55
|
+
ticketStatus: d,
|
|
56
|
+
customersFetchTableOrders: i
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
58
|
+
const a = (e == null ? void 0 : e.orderFormat) === c.Delivery, n = (e == null ? void 0 : e.orderFormat) === c.TakeAway, r = (e == null ? void 0 : e.orderFormat) === c.TableOrder;
|
|
59
|
+
if (a || n || r && !i)
|
|
60
60
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
const l = t != null, y = d != null;
|
|
62
|
+
if (l) {
|
|
63
63
|
const u = t === o.Captured, p = t === o.InProgress;
|
|
64
64
|
return u || p;
|
|
65
65
|
}
|
|
66
66
|
if (y) {
|
|
67
|
-
const u =
|
|
67
|
+
const u = d === s.Preparing, p = d === s.Ready;
|
|
68
68
|
return u || p;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
72
|
function R(e, {
|
|
73
73
|
checkoutStatus: t,
|
|
74
|
-
ticketStatus:
|
|
75
|
-
customersFetchTableOrders:
|
|
76
|
-
pickupTimeUpdated:
|
|
77
|
-
preOrderOptions:
|
|
74
|
+
ticketStatus: d,
|
|
75
|
+
customersFetchTableOrders: i,
|
|
76
|
+
pickupTimeUpdated: a,
|
|
77
|
+
preOrderOptions: n
|
|
78
78
|
}, r) {
|
|
79
79
|
if (r && k(e, {
|
|
80
80
|
checkoutStatus: t,
|
|
81
|
-
ticketStatus:
|
|
82
|
-
customersFetchTableOrders:
|
|
81
|
+
ticketStatus: d,
|
|
82
|
+
customersFetchTableOrders: i
|
|
83
83
|
})) {
|
|
84
84
|
if (r.ready > 0)
|
|
85
85
|
return r.ready < 2 ? [
|
|
@@ -95,28 +95,28 @@ function R(e, {
|
|
|
95
95
|
{ count: Math.max(0, r.all - r.done - r.ready) }
|
|
96
96
|
];
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
99
|
-
return [
|
|
100
|
-
if (
|
|
101
|
-
const m =
|
|
98
|
+
if (d != null)
|
|
99
|
+
return [W(d)];
|
|
100
|
+
if (n && (t === o.Created || t === o.Authorized)) {
|
|
101
|
+
const m = H(n);
|
|
102
102
|
if (m)
|
|
103
103
|
return [m];
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const l = (e == null ? void 0 : e.orderFormat) === c.Delivery, y = w(t);
|
|
106
106
|
if (y)
|
|
107
107
|
return [y];
|
|
108
|
-
const u = t === o.Captured, p = t === o.InProgress,
|
|
108
|
+
const u = t === o.Captured, p = t === o.InProgress, h = t === o.Done, B = t === o.DeliveryInProgress, v = t === o.ReadyToCollect, g = (e == null ? void 0 : e.orderFormat) === c.EatIn, O = (e == null ? void 0 : e.orderFormat) === c.TakeAway, f = (e == null ? void 0 : e.orderFormat) === c.TableOrder, P = (e == null ? void 0 : e.orderFormat) === c.BoxPickup;
|
|
109
109
|
if (u)
|
|
110
|
-
return
|
|
110
|
+
return f && !i ? [
|
|
111
111
|
"yourOrderWillArriveAtYourTable"
|
|
112
112
|
/* YourOrderWillArriveAtYourTable */
|
|
113
|
-
] :
|
|
113
|
+
] : l ? a ? [
|
|
114
114
|
"modifiedDeliveryStartTime"
|
|
115
115
|
/* ModifiedDeliveryStartTime */
|
|
116
116
|
] : [
|
|
117
117
|
"yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"
|
|
118
118
|
/* YourOrderHasBeenAcceptedEstimatedDeliveryStartTime */
|
|
119
|
-
] :
|
|
119
|
+
] : a ? [
|
|
120
120
|
"modifiedPickUpTime"
|
|
121
121
|
/* ModifiedPickUpTime */
|
|
122
122
|
] : [
|
|
@@ -124,15 +124,15 @@ function R(e, {
|
|
|
124
124
|
/* YourOrderHasBeenAcceptedPickupTime */
|
|
125
125
|
];
|
|
126
126
|
if (p) {
|
|
127
|
-
if (
|
|
128
|
-
return
|
|
127
|
+
if (l)
|
|
128
|
+
return a ? [
|
|
129
129
|
"modifiedDeliveryStartTime"
|
|
130
130
|
/* ModifiedDeliveryStartTime */
|
|
131
131
|
] : [
|
|
132
132
|
"yourOrderIsBeingPreparedEstimatedDeliveryStartTime"
|
|
133
133
|
/* YourOrderIsBeingPreparedEstimatedDeliveryStartTime */
|
|
134
134
|
];
|
|
135
|
-
if (r && (
|
|
135
|
+
if (r && (g || O)) {
|
|
136
136
|
if (r.ready === r.all)
|
|
137
137
|
return [
|
|
138
138
|
"yourOrderIsReadyToCollect"
|
|
@@ -144,10 +144,10 @@ function R(e, {
|
|
|
144
144
|
/* YourOrderHasBeenCompleted */
|
|
145
145
|
];
|
|
146
146
|
}
|
|
147
|
-
if (
|
|
147
|
+
if (f) {
|
|
148
148
|
if (r) {
|
|
149
149
|
if (r.ready === r.all)
|
|
150
|
-
return
|
|
150
|
+
return i ? [
|
|
151
151
|
"yourOrderIsReadyToCollect"
|
|
152
152
|
/* YourOrderIsReadyToCollect */
|
|
153
153
|
] : [
|
|
@@ -155,7 +155,7 @@ function R(e, {
|
|
|
155
155
|
/* YourOrderWillArriveAtYourTable */
|
|
156
156
|
];
|
|
157
157
|
if (r.done === r.all)
|
|
158
|
-
return
|
|
158
|
+
return i ? [
|
|
159
159
|
"yourOrderHasBeenCompleted"
|
|
160
160
|
/* YourOrderHasBeenCompleted */
|
|
161
161
|
] : [
|
|
@@ -163,10 +163,10 @@ function R(e, {
|
|
|
163
163
|
/* YourOrderWillArriveAtYourTable */
|
|
164
164
|
];
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return a ? [
|
|
167
167
|
"modifiedPickUpTime"
|
|
168
168
|
/* ModifiedPickUpTime */
|
|
169
|
-
] :
|
|
169
|
+
] : i ? [
|
|
170
170
|
"yourOrderIsBeingPrepared"
|
|
171
171
|
/* YourOrderIsBeingPrepared */
|
|
172
172
|
] : [
|
|
@@ -174,7 +174,7 @@ function R(e, {
|
|
|
174
174
|
/* YourOrderWillArriveAtYourTable */
|
|
175
175
|
];
|
|
176
176
|
}
|
|
177
|
-
return
|
|
177
|
+
return a ? [
|
|
178
178
|
"modifiedPickUpTime"
|
|
179
179
|
/* ModifiedPickUpTime */
|
|
180
180
|
] : [
|
|
@@ -182,11 +182,11 @@ function R(e, {
|
|
|
182
182
|
/* YourOrderIsBeingPrepared */
|
|
183
183
|
];
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
186
|
-
return
|
|
185
|
+
if (h)
|
|
186
|
+
return g || O ? [
|
|
187
187
|
"yourOrderHasBeenCompleted"
|
|
188
188
|
/* YourOrderHasBeenCompleted */
|
|
189
|
-
] :
|
|
189
|
+
] : l ? [
|
|
190
190
|
"deliveryWasCompleted"
|
|
191
191
|
/* DeliveryWasCompleted */
|
|
192
192
|
] : [
|
|
@@ -195,12 +195,12 @@ function R(e, {
|
|
|
195
195
|
];
|
|
196
196
|
if (B && P)
|
|
197
197
|
switch (e == null ? void 0 : e.deliveryStatus) {
|
|
198
|
-
case
|
|
198
|
+
case C.PickedUp:
|
|
199
199
|
return [
|
|
200
200
|
"yourOrderHasBeenCompleted"
|
|
201
201
|
/* YourOrderHasBeenCompleted */
|
|
202
202
|
];
|
|
203
|
-
case
|
|
203
|
+
case C.Delivered:
|
|
204
204
|
return [
|
|
205
205
|
"yourOrderReadyToPickupFromLocker"
|
|
206
206
|
/* YourOrderReadyToPickupFromLocker */
|
|
@@ -211,8 +211,8 @@ function R(e, {
|
|
|
211
211
|
/* YourOrderIsBeingPrepared */
|
|
212
212
|
];
|
|
213
213
|
}
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
214
|
+
if (v)
|
|
215
|
+
return l ? [
|
|
216
216
|
"yourOrderIsBeingDelivered"
|
|
217
217
|
/* YourOrderIsBeingDelivered */
|
|
218
218
|
] : P ? [
|
|
@@ -238,11 +238,16 @@ The restaurant admin will accept your pre-order soon.`
|
|
|
238
238
|
title: "Your order has been approved by host!",
|
|
239
239
|
message: "The restaurant admin will accept and process the pre-order"
|
|
240
240
|
}),
|
|
241
|
-
|
|
241
|
+
orderCanceledHostWillUpdateAndProcessAgain: () => ({
|
|
242
242
|
title: `Order canceled!
|
|
243
|
-
The host will
|
|
243
|
+
The host will update and process the pre-order again.`,
|
|
244
244
|
message: "Please contact the host if you want to edit your order."
|
|
245
245
|
}),
|
|
246
|
+
orderCanceledYouCanManageYourOrderAgain: () => ({
|
|
247
|
+
title: `Order canceled!
|
|
248
|
+
You can manage your order.`,
|
|
249
|
+
message: "Please update and process the pre-order again."
|
|
250
|
+
}),
|
|
246
251
|
yourOrderIsBeingProcessed: () => ({
|
|
247
252
|
title: "Your order is being processed"
|
|
248
253
|
}),
|
|
@@ -325,23 +330,23 @@ The host will approve and process the pre-order again.`,
|
|
|
325
330
|
function E(e, t) {
|
|
326
331
|
if (t)
|
|
327
332
|
return;
|
|
328
|
-
const
|
|
333
|
+
const d = T(e);
|
|
329
334
|
return {
|
|
330
|
-
all:
|
|
331
|
-
ready:
|
|
332
|
-
done:
|
|
335
|
+
all: d.all.length,
|
|
336
|
+
ready: d.ready.length,
|
|
337
|
+
done: d.done.length
|
|
333
338
|
};
|
|
334
339
|
}
|
|
335
|
-
function
|
|
336
|
-
const { isSkipTicketStatus:
|
|
340
|
+
function M(e, t, d = D) {
|
|
341
|
+
const { isSkipTicketStatus: i } = t, a = E(
|
|
337
342
|
(e == null ? void 0 : e.items) ?? [],
|
|
338
|
-
|
|
339
|
-
), [
|
|
340
|
-
if (!
|
|
343
|
+
i
|
|
344
|
+
), [n, r] = R(e, t, a), l = d[n]({ key: n, meta: r });
|
|
345
|
+
if (!l)
|
|
341
346
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
342
|
-
return [
|
|
347
|
+
return [l, n];
|
|
343
348
|
}
|
|
344
349
|
export {
|
|
345
|
-
|
|
346
|
-
|
|
350
|
+
Y as TranslationKey,
|
|
351
|
+
M as default
|
|
347
352
|
};
|