@ancon/wildcat-utils 1.44.0-terminal-refactor.8 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_baseIsEqual-12d01a44.mjs +169 -0
- package/_baseIsEqual-bcac9024.js +1 -0
- package/_baseIteratee-075c204c.js +1 -0
- package/_baseIteratee-4c4d0995.mjs +97 -0
- package/_baseSlice-4d543985.mjs +10 -0
- package/_baseSlice-e1b41ceb.js +1 -0
- package/_getTag-4e44633b.mjs +382 -0
- package/_getTag-b8923c48.js +1 -0
- package/checkout/checkoutHasWallet.d.ts +3 -0
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +7 -5
- package/checkout/getCheckoutRequestItemFromCheckoutItem.d.ts +2 -2
- package/checkout/getCheckoutRequestItemFromCheckoutItem.js +1 -1
- package/checkout/getCheckoutRequestItemFromCheckoutItem.mjs +26 -14
- package/checkout/getCheckoutWalletTopUpMetaData.d.ts +7 -0
- package/checkout/getCheckoutWalletTopUpMetaData.js +1 -0
- package/checkout/getCheckoutWalletTopUpMetaData.mjs +15 -0
- package/checkout/getWalletMetaFromCheckout.d.ts +3 -0
- package/checkout/index.d.ts +4 -1
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +49 -41
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +14 -13
- package/checkout/isWalletTopUpCheckout.d.ts +2 -0
- package/checkout/isWalletTopUpCheckout.js +1 -0
- package/checkout/isWalletTopUpCheckout.mjs +12 -0
- package/checkout/isWalletTopUpCheckoutItem.d.ts +2 -0
- package/checkout/isWalletTopUpCheckoutItem.js +1 -0
- package/checkout/isWalletTopUpCheckoutItem.mjs +9 -0
- package/date/convertToLocalTimezone.d.ts +8 -0
- package/date/convertToLocalTimezone.js +1 -0
- package/date/convertToLocalTimezone.mjs +12 -0
- package/date/convertToSpecificTimezone.d.ts +9 -0
- package/date/convertToSpecificTimezone.js +1 -0
- package/date/convertToSpecificTimezone.mjs +6 -0
- package/date/createLocalTimezoneDate.d.ts +8 -0
- package/date/createLocalTimezoneDate.js +1 -0
- package/date/createLocalTimezoneDate.mjs +8 -0
- package/date/createLocalTimezoneMoment.d.ts +9 -0
- package/date/createLocalTimezoneMoment.js +1 -0
- package/date/createLocalTimezoneMoment.mjs +8 -0
- package/date/getFormattedUTCDateTime.d.ts +10 -0
- package/date/getFormattedUTCDateTime.js +1 -0
- package/date/getFormattedUTCDateTime.mjs +8 -0
- package/date/getTimezoneUtcOffsetDifference.d.ts +8 -0
- package/date/getTimezoneUtcOffsetDifference.js +1 -0
- package/date/getTimezoneUtcOffsetDifference.mjs +8 -0
- package/date/index.d.ts +8 -0
- package/date/index.js +1 -0
- package/date/index.mjs +17 -0
- package/date/isDSTShiftPresentInRange.d.ts +8 -0
- package/date/isDSTShiftPresentInRange.js +1 -0
- package/date/isDSTShiftPresentInRange.mjs +9 -0
- package/identity-1bae7cf8.js +1 -0
- package/identity-6eafe87b.mjs +64 -0
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/index.mjs +228 -188
- package/logger/index.js +1 -1
- package/logger/index.mjs +8 -7
- package/logger/pascalCaseFormatter.js +1 -1
- package/logger/pascalCaseFormatter.mjs +21 -27
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +15 -13
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +19 -17
- package/order/index.js +1 -1
- package/order/index.mjs +11 -9
- package/outlet/getExpressAvailableOrderFormats.js +1 -1
- package/outlet/getExpressAvailableOrderFormats.mjs +27 -26
- package/outlet/getExpressNextAvailabilityShiftTime.d.ts +2 -2
- package/outlet/getExpressNextAvailabilityShiftTime.js +1 -1
- package/outlet/getExpressNextAvailabilityShiftTime.mjs +19 -18
- package/outlet/getExpressServiceIntervalEnd.d.ts +2 -2
- package/outlet/getExpressServiceIntervalEnd.js +1 -1
- package/outlet/getExpressServiceIntervalEnd.mjs +7 -9
- package/outlet/getExpressServiceIntervalStart.d.ts +2 -2
- package/outlet/getExpressServiceIntervalStart.js +1 -1
- package/outlet/getExpressServiceIntervalStart.mjs +7 -9
- package/outlet/getListOutletOpeningHoursTable.d.ts +1 -1
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +135 -150
- package/outlet/getOutletActiveOpeningInterval.d.ts +2 -2
- package/outlet/getOutletActiveOpeningInterval.js +1 -1
- package/outlet/getOutletActiveOpeningInterval.mjs +15 -12
- package/outlet/getOutletAvailabilityInfo.js +1 -1
- package/outlet/getOutletAvailabilityInfo.mjs +23 -25
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -1
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +26 -20
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +33 -29
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +14 -10
- package/outlet/getOutletDeliveryFee.js +1 -1
- package/outlet/getOutletDeliveryFee.mjs +5 -5
- package/outlet/getOutletFormattedAddress.d.ts +9 -1
- package/outlet/getOutletFormattedAddress.js +1 -1
- package/outlet/getOutletFormattedAddress.mjs +9 -4
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +18 -14
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +14 -9
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +40 -28
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +102 -48
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +14 -8
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +73 -72
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +43 -39
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +4 -4
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +20 -12
- package/outlet/getServiceIntervalEnd.d.ts +1 -1
- package/outlet/getServiceIntervalEnd.js +1 -1
- package/outlet/getServiceIntervalEnd.mjs +13 -10
- package/outlet/getServiceIntervalRange.d.ts +1 -2
- package/outlet/getServiceIntervalRange.js +1 -1
- package/outlet/getServiceIntervalRange.mjs +8 -12
- package/outlet/getServiceIntervalStart.d.ts +1 -1
- package/outlet/getServiceIntervalStart.js +1 -1
- package/outlet/getServiceIntervalStart.mjs +7 -7
- package/outlet/getServiceIntervalTimeSpanMoment.d.ts +9 -0
- package/outlet/getServiceIntervalTimeSpanMoment.js +1 -0
- package/outlet/getServiceIntervalTimeSpanMoment.mjs +9 -0
- package/outlet/getServiceIntervalsForOrderFormat.d.ts +7 -8
- package/outlet/getStructuredOutletAddress.js +1 -1
- package/outlet/getStructuredOutletAddress.mjs +7 -7
- package/outlet/getTimezoneAdjustedServiceInterval.d.ts +14 -0
- package/outlet/getTimezoneAdjustedServiceInterval.js +1 -0
- package/outlet/getTimezoneAdjustedServiceInterval.mjs +26 -0
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +78 -70
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +62 -66
- package/outlet/serviceDateTimesFromOpeningHours.d.ts +3 -5
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +342 -27
- package/outlet/types.d.ts +6 -2
- package/outlet/types.js +1 -1
- package/outlet/types.mjs +3 -2
- package/package.json +76 -11
- package/time/convertSecondsToTimeSpan.d.ts +9 -0
- package/time/convertSecondsToTimeSpan.js +1 -0
- package/time/convertSecondsToTimeSpan.mjs +12 -0
- package/time/convertTimeSpanToSeconds.d.ts +6 -0
- package/time/convertTimeSpanToSeconds.js +1 -0
- package/time/convertTimeSpanToSeconds.mjs +8 -0
- package/time/createTimeSpan.js +1 -1
- package/time/createTimeSpan.mjs +10 -5
- package/time/formatTimeSpan.js +1 -1
- package/time/formatTimeSpan.mjs +5 -4
- package/time/getDurationBetweenTimeSpans.d.ts +2 -2
- package/time/getDurationBetweenTimeSpans.js +1 -1
- package/time/getDurationBetweenTimeSpans.mjs +11 -9
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +8 -10
- package/time/index.d.ts +3 -1
- package/time/index.js +1 -1
- package/time/index.mjs +16 -12
- package/{toString-e631a957.mjs → toString-3b91b335.mjs} +12 -11
- package/toString-9eae9442.js +1 -0
- package/_baseIsEqual-39cef2eb.mjs +0 -530
- package/_baseIsEqual-b3df9240.js +0 -1
- package/_baseIteratee-13e892b8.mjs +0 -151
- package/_baseIteratee-be26bb18.js +0 -1
- package/outlet/getMomentFromDateAndTimeString.d.ts +0 -3
- package/outlet/getMomentFromDateAndTimeString.js +0 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +0 -17
- package/outlet/getNextTenthMinute.d.ts +0 -2
- package/outlet/getNextTenthMinute.js +0 -1
- package/outlet/getNextTenthMinute.mjs +0 -7
- package/toString-425512fc.js +0 -1
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import { OutletState as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { OutletState as l } from "@ancon/wildcat-types";
|
|
2
|
+
import f from "moment";
|
|
3
|
+
import T from "./getOutletTagInformation.mjs";
|
|
4
|
+
import a from "./getOutletAvailabilityInfo.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
5
6
|
import "./constants.mjs";
|
|
6
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
|
-
import "./
|
|
8
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
9
|
+
import "../time/getTimeSpanParts.mjs";
|
|
10
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
11
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
12
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
8
13
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
10
|
-
let { openingTime:
|
|
11
|
-
return !!i.openingTime && !!i.closingTime ? (
|
|
14
|
+
function d(n, i) {
|
|
15
|
+
let { openingTime: o } = n, { closingTime: e } = n;
|
|
16
|
+
return !!i.openingTime && !!i.closingTime ? (n.openingTime ? n.openingTime.isBetween(
|
|
12
17
|
i.openingTime,
|
|
13
18
|
i.closingTime
|
|
14
|
-
) && (
|
|
19
|
+
) && (o = i.openingTime) : o = i.openingTime, n.closingTime ? n.closingTime.isBetween(
|
|
15
20
|
i.openingTime,
|
|
16
21
|
i.closingTime
|
|
17
|
-
) && (
|
|
18
|
-
openingTime:
|
|
19
|
-
closingTime:
|
|
22
|
+
) && (e = i.closingTime) : e = i.closingTime) : ((!o && i.openingTime || i.openingTime && o && i.openingTime.isBefore(o)) && (o = i.openingTime), !e && i.closingTime ? e = i.closingTime : i.closingTime && e && (i.closingTime.isBefore(e) || (e = i.closingTime))), {
|
|
23
|
+
openingTime: o,
|
|
24
|
+
closingTime: e
|
|
20
25
|
};
|
|
21
26
|
}
|
|
22
|
-
function
|
|
23
|
-
const { serviceDateTimes: i, state:
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n
|
|
27
|
+
function H(n) {
|
|
28
|
+
const { serviceDateTimes: i, state: o } = n, e = f(), g = o === l.Opened, t = i.reduce((m, r) => {
|
|
29
|
+
const p = (r == null ? void 0 : r.intervals) || [], s = T(
|
|
30
|
+
p,
|
|
31
|
+
g,
|
|
32
|
+
e,
|
|
33
|
+
e
|
|
30
34
|
);
|
|
31
|
-
return
|
|
32
|
-
...
|
|
33
|
-
openNow:
|
|
34
|
-
openDuringSpecifiedTime:
|
|
35
|
-
} :
|
|
35
|
+
return m ? m.openNow && !s.openNow ? m : {
|
|
36
|
+
...d(m, s),
|
|
37
|
+
openNow: m.openNow || s.openNow,
|
|
38
|
+
openDuringSpecifiedTime: m.openDuringSpecifiedTime || s.openDuringSpecifiedTime
|
|
39
|
+
} : s;
|
|
36
40
|
}, void 0);
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
return t ? a(
|
|
42
|
+
t,
|
|
43
|
+
e,
|
|
40
44
|
!1
|
|
41
45
|
) : null;
|
|
42
46
|
}
|
|
43
47
|
export {
|
|
44
|
-
|
|
48
|
+
H as default
|
|
45
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("moment"),d=require("./getOutletTodayOpeningTimes.js");require("../_baseIteratee-075c204c.js");require("../_getTag-b8923c48.js");require("../isArray-640f9811.js");require("../_baseIsEqual-bcac9024.js");require("../identity-1bae7cf8.js");require("../toString-9eae9442.js");require("../noop-7ea3b37b.js");require("./getListOutletOpeningHoursTable.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function m(q,c){const n=t(),u=d(q);if(u){const s=u.find(e=>{const r=t(e.start),i=t(e.end);return n.isBetween(r,i)});if(s){const{end:e}=s,r=t(e),i=n.isSame(r,"day"),o=r.format(i?"LT":"ddd LT");return c("untilTime",{time:o})||""}}}module.exports=m;
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "moment";
|
|
2
2
|
import c from "./getOutletTodayOpeningTimes.mjs";
|
|
3
|
-
import "../_baseIteratee-
|
|
4
|
-
import "../
|
|
3
|
+
import "../_baseIteratee-4c4d0995.mjs";
|
|
4
|
+
import "../_getTag-4e44633b.mjs";
|
|
5
5
|
import "../isArray-0d9c7aaa.mjs";
|
|
6
|
-
import "../
|
|
6
|
+
import "../_baseIsEqual-12d01a44.mjs";
|
|
7
|
+
import "../identity-6eafe87b.mjs";
|
|
8
|
+
import "../toString-3b91b335.mjs";
|
|
7
9
|
import "../noop-378485d5.mjs";
|
|
8
10
|
import "./getListOutletOpeningHoursTable.mjs";
|
|
9
11
|
import "@ancon/wildcat-types";
|
|
10
12
|
import "../shared/isWithinFlag.mjs";
|
|
11
13
|
import "../shared/generateId.mjs";
|
|
12
14
|
import "react";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
import "../time/getTimeSpanParts.mjs";
|
|
16
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
17
|
+
function H(p, d) {
|
|
18
|
+
const n = e(), r = c(p);
|
|
15
19
|
if (r) {
|
|
16
20
|
const m = r.find((t) => {
|
|
17
|
-
const
|
|
18
|
-
return
|
|
21
|
+
const o = e(t.start), i = e(t.end);
|
|
22
|
+
return n.isBetween(o, i);
|
|
19
23
|
});
|
|
20
24
|
if (m) {
|
|
21
|
-
const { end: t } = m,
|
|
25
|
+
const { end: t } = m, o = e(t), i = n.isSame(o, "day"), s = o.format(i ? "LT" : "ddd LT");
|
|
22
26
|
return d("untilTime", { time: s }) || "";
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
export {
|
|
27
|
-
|
|
31
|
+
H as default
|
|
28
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("@ancon/wildcat-types");function i(r){return r?r.find(t=>(t.orderFormats&e.OrderFormat.Delivery)===e.OrderFormat.Delivery):null}module.exports=i;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OrderFormat as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
(t) => (t.
|
|
1
|
+
import { OrderFormat as e } from "@ancon/wildcat-types";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return r ? r.find(
|
|
4
|
+
(t) => (t.orderFormats & e.Delivery) === e.Delivery
|
|
5
5
|
) : null;
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
o as default
|
|
9
9
|
};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
declare type StreetCity = {
|
|
2
|
+
street: string;
|
|
3
|
+
city: string;
|
|
4
|
+
};
|
|
5
|
+
declare type FormatOptions = {
|
|
6
|
+
streetMaxLength?: number;
|
|
7
|
+
};
|
|
8
|
+
export default function getOutletFormattedAddress<OutletAddress extends StreetCity>(address: OutletAddress | undefined, options?: FormatOptions): string;
|
|
9
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const u=require("../string/truncate.js"),s=40;function a(e,t){if(e){const{street:r,city:n}=e,c=(t==null?void 0:t.streetMaxLength)||s;return[r&&u(r,c),n].filter(Boolean).join(", ")||""}return""}module.exports=a;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import c from "../string/truncate.mjs";
|
|
2
|
+
const u = 40;
|
|
3
|
+
function d(e, t) {
|
|
4
|
+
if (e) {
|
|
5
|
+
const { street: r, city: n } = e, a = (t == null ? void 0 : t.streetMaxLength) || u;
|
|
6
|
+
return [r && c(r, a), n].filter(Boolean).join(", ") || "";
|
|
7
|
+
}
|
|
8
|
+
return "";
|
|
4
9
|
}
|
|
5
10
|
export {
|
|
6
|
-
|
|
11
|
+
d as default
|
|
7
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types"),g=require("moment"),q=require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../time/getTimeSpanParts.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");function f(t){const o=g();return t.serviceDateTimes.reduce((e,r)=>{const i=(r==null?void 0:r.intervals)||[],n=q.default(i,t.state===s.OutletState.Opened,o,o);if(!e&&!n.openNow)return n;const u=(e==null?void 0:e.openingTime)&&n.openingTime&&n.openingTime.isBefore(e.openingTime);return!n.openNow&&u?n:e},void 0)}module.exports=f;
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { OutletState as p } from "@ancon/wildcat-types";
|
|
2
2
|
import f from "moment";
|
|
3
3
|
import g from "./getOutletTagInformation.mjs";
|
|
4
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
4
5
|
import "./constants.mjs";
|
|
5
6
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
6
|
-
import "./
|
|
7
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
8
|
+
import "../time/getTimeSpanParts.mjs";
|
|
9
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
10
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
11
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
7
12
|
import "./searchNextOpeningMoment.mjs";
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return e.serviceDateTimes.reduce((
|
|
11
|
-
const r = (
|
|
13
|
+
function M(e) {
|
|
14
|
+
const i = f();
|
|
15
|
+
return e.serviceDateTimes.reduce((o, n) => {
|
|
16
|
+
const r = (n == null ? void 0 : n.intervals) || [], t = g(
|
|
12
17
|
r,
|
|
13
|
-
e.state === p.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
e == null ? void 0 : e.timeZoneOffset
|
|
18
|
+
e.state === p.Opened,
|
|
19
|
+
i,
|
|
20
|
+
i
|
|
17
21
|
);
|
|
18
|
-
if (!
|
|
19
|
-
return
|
|
20
|
-
const m = (
|
|
21
|
-
return !
|
|
22
|
+
if (!o && !t.openNow)
|
|
23
|
+
return t;
|
|
24
|
+
const m = (o == null ? void 0 : o.openingTime) && t.openingTime && t.openingTime.isBefore(o.openingTime);
|
|
25
|
+
return !t.openNow && m ? t : o;
|
|
22
26
|
}, void 0);
|
|
23
27
|
}
|
|
24
28
|
export {
|
|
25
|
-
|
|
29
|
+
M as default
|
|
26
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("moment"),o=require("./getOutletNextOpeningTagInformation.js");require("@ancon/wildcat-types");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../time/getTimeSpanParts.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");function u(r,t){const e=o(r);if(e&&!e.openNow&&e.openingTime){const i=n(e.openingTime).calendar({sameDay:"[Today] [at] LT",nextDay:"[Tomorrow] [at] LT",nextWeek:"ddd [at] LT"});return t("openingTime",{time:i})}return null}module.exports=u;
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import n from "moment";
|
|
2
|
+
import m from "./getOutletNextOpeningTagInformation.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "./getOutletTagInformation.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
5
6
|
import "./constants.mjs";
|
|
6
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
|
-
import "./
|
|
8
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
9
|
+
import "../time/getTimeSpanParts.mjs";
|
|
10
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
11
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
12
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
8
13
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
10
|
-
const
|
|
14
|
+
function y(o, e) {
|
|
15
|
+
const t = m(o);
|
|
11
16
|
if (t && !t.openNow && t.openingTime) {
|
|
12
|
-
const
|
|
17
|
+
const i = n(t.openingTime).calendar({
|
|
13
18
|
sameDay: "[Today] [at] LT",
|
|
14
19
|
nextDay: "[Tomorrow] [at] LT",
|
|
15
20
|
nextWeek: "ddd [at] LT"
|
|
16
21
|
});
|
|
17
|
-
return
|
|
18
|
-
time:
|
|
22
|
+
return e("openingTime", {
|
|
23
|
+
time: i
|
|
19
24
|
});
|
|
20
25
|
}
|
|
21
26
|
return null;
|
|
22
27
|
}
|
|
23
28
|
export {
|
|
24
|
-
|
|
29
|
+
y as default
|
|
25
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const p=require("@ancon/wildcat-types"),i=require("moment"),x=require("../date/getTimezoneUtcOffsetDifference.js"),v=require("../time/getNextTenthMinute.js"),_=require("./getSettingsForOrderFormat.js"),I=require("./isOutletAcceptingPreOrders.js"),S=require("./getOutletTagInformation.js"),M=require("./getServiceIntervalsForOrderFormat.js"),N=require("./getOutletNextServiceTimeOffset.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../time/getTimeSpanParts.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");function h(e,t){const c=(e==null?void 0:e.state)===p.OutletState.Opened,r=_(t,e==null?void 0:e.orderFormatSettings),u=(r==null?void 0:r.preparationTime)??"00:00:00",g=I((e==null?void 0:e.orderFormatSettings)||[]),T=M(t,(e==null?void 0:e.serviceDateTimes)||[]),f=S.default(T,c,i(),i()),q=!c&&g&&f.openingTime?f.openingTime:void 0,o=i(),s=i(q),n=(o>s?o:s).clone(),O=n.utcOffset();n.seconds(0).milliseconds(0),n.utcOffset()-O&&n.utcOffset(O,!0);const m=N(t,u,e==null?void 0:e.deliveryIntegrationEnabled);m>0&&n.add(m,"minutes");const a=v(n)-n.minutes();a&&n.add(a,"minutes");const d=x(s,n);return d&&n.add(d,"minutes"),n}module.exports=h;
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import { OutletState as
|
|
1
|
+
import { OutletState as v } from "@ancon/wildcat-types";
|
|
2
2
|
import n from "moment";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import I from "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
4
|
+
import S from "../time/getNextTenthMinute.mjs";
|
|
5
|
+
import M from "./getSettingsForOrderFormat.mjs";
|
|
6
|
+
import N from "./isOutletAcceptingPreOrders.mjs";
|
|
7
|
+
import h from "./getOutletTagInformation.mjs";
|
|
8
|
+
import D from "./getServiceIntervalsForOrderFormat.mjs";
|
|
9
|
+
import F from "./getOutletNextServiceTimeOffset.mjs";
|
|
10
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
9
11
|
import "./constants.mjs";
|
|
10
12
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
11
|
-
import "./
|
|
12
|
-
import "./searchNextOpeningMoment.mjs";
|
|
13
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
13
14
|
import "../time/getTimeSpanParts.mjs";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
),
|
|
24
|
-
|
|
15
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
16
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
17
|
+
import "./searchNextOpeningMoment.mjs";
|
|
18
|
+
function J(e, t) {
|
|
19
|
+
const s = (e == null ? void 0 : e.state) === v.Opened, r = M(
|
|
20
|
+
t,
|
|
21
|
+
e == null ? void 0 : e.orderFormatSettings
|
|
22
|
+
), d = (r == null ? void 0 : r.preparationTime) ?? "00:00:00", g = N(
|
|
23
|
+
(e == null ? void 0 : e.orderFormatSettings) || []
|
|
24
|
+
), T = D(
|
|
25
|
+
t,
|
|
26
|
+
(e == null ? void 0 : e.serviceDateTimes) || []
|
|
27
|
+
), o = h(
|
|
28
|
+
T,
|
|
25
29
|
s,
|
|
26
30
|
n(),
|
|
27
|
-
n()
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
n()
|
|
32
|
+
), x = !s && g && o.openingTime ? o.openingTime : void 0, f = n(), m = n(x), i = (f > m ? f : m).clone(), c = i.utcOffset();
|
|
33
|
+
i.seconds(0).milliseconds(0), i.utcOffset() - c && i.utcOffset(c, !0);
|
|
34
|
+
const p = F(
|
|
35
|
+
t,
|
|
36
|
+
d,
|
|
37
|
+
e == null ? void 0 : e.deliveryIntegrationEnabled
|
|
38
|
+
);
|
|
39
|
+
p > 0 && i.add(p, "minutes");
|
|
40
|
+
const O = S(i) - i.minutes();
|
|
41
|
+
O && i.add(O, "minutes");
|
|
42
|
+
const a = I(
|
|
43
|
+
m,
|
|
44
|
+
i
|
|
33
45
|
);
|
|
34
|
-
return
|
|
46
|
+
return a && i.add(a, "minutes"), i;
|
|
35
47
|
}
|
|
36
48
|
export {
|
|
37
|
-
|
|
49
|
+
J as default
|
|
38
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const p=require("@ancon/wildcat-types"),o=require("moment"),O=require("../date/isDSTShiftPresentInRange.js"),P=require("./getPickerIntervalsForDay.js"),v=require("./getSettingsForOrderFormat.js"),y=require("./getServiceIntervalStart.js"),h=require("./types.js"),I=require("./generatePickerTimesForDay.js"),_=require("./getServiceIntervalEnd.js"),D=require("./getOutletNextReadyToOrderTime.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../shared/constants.js");require("../date/createLocalTimezoneMoment.js");require("./getServiceIntervalsForOrderFormat.js");require("../time/getTimeSpanParts.js");require("../time/getNextTenthMinute.js");require("./getServiceIntervalTimeSpanMoment.js");require("./hoursAndMinutesToMinutes.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../date/convertToSpecificTimezone.js");require("./searchNextOpeningMoment.js");require("./getOutletNextServiceTimeOffset.js");function b(e,n,a){let u=e;return O(n,a)&&(u=e.filter(i=>{const s=o(i.timestamp).utc(!0),t=o(n).utc(!0);return s.isSameOrAfter(t)})),u}function x(e){const n=e[0],a=e[e.length-1];if(O(n.timestamp,a.timestamp)){const m=Math.max(o(n.timestamp).utcOffset(),o(a.timestamp).utcOffset()),i=e.map(t=>t.timeLabel),s=i.filter((t,r)=>i.indexOf(t)!==r);return e.map(t=>{if(s.includes(t.timeLabel)){const T=o(t.timestamp).utcOffset()===m?h.PickerTimeTimezoneTag.Summer:h.PickerTimeTimezoneTag.Standard;return{...t,timezoneTag:T}}return t})}return e}function z(e,n,a,u){const{preparationTime:m="00:00:00"}=v(n,e==null?void 0:e.orderFormatSettings)??{},i=D(e,n);let s=i.clone();const t=o(a);if(t>i)s=i.clone().set({year:t.year(),month:t.month(),date:t.date()});else if(i.diff(t,"day")>0)return[];let r=[];const T=P(s,e==null?void 0:e.serviceDateTimes,n);let q;return T.forEach(c=>{!q&&c.type&&(r=[]);const f=y(s,c,m),S=_(s,c,m);f<i&&f.add(i.valueOf()-f.valueOf(),"millisecond");const l=I(f,S,r,void 0,u);if(l.length>0)switch(c.state){case p.IntervalState.Closed:{const d=l[0],k=l[l.length-1];r=r.filter(({timestamp:g})=>g<d.timestamp||g>k.timestamp);break}case p.IntervalState.Opened:default:{const d=b(l,f,S);r=r.concat(d);break}}q=c.type}),r.length?x(r):r}module.exports=z;
|
|
@@ -1,71 +1,125 @@
|
|
|
1
|
-
import { IntervalState as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { IntervalState as h } from "@ancon/wildcat-types";
|
|
2
|
+
import s from "moment";
|
|
3
|
+
import k from "../date/isDSTShiftPresentInRange.mjs";
|
|
4
|
+
import v from "./getPickerIntervalsForDay.mjs";
|
|
5
|
+
import y from "./getSettingsForOrderFormat.mjs";
|
|
6
|
+
import I from "./getServiceIntervalStart.mjs";
|
|
7
|
+
import { PickerTimeTimezoneTag as O } from "./types.mjs";
|
|
8
|
+
import D from "./generatePickerTimesForDay.mjs";
|
|
9
|
+
import b from "./getServiceIntervalEnd.mjs";
|
|
10
|
+
import x from "./getOutletNextReadyToOrderTime.mjs";
|
|
11
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
9
12
|
import "../shared/constants.mjs";
|
|
13
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
10
14
|
import "./getServiceIntervalsForOrderFormat.mjs";
|
|
11
|
-
import "
|
|
15
|
+
import "../time/getTimeSpanParts.mjs";
|
|
16
|
+
import "../time/getNextTenthMinute.mjs";
|
|
17
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
12
18
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
13
19
|
import "./isOutletAcceptingPreOrders.mjs";
|
|
14
20
|
import "./getOutletTagInformation.mjs";
|
|
15
21
|
import "./constants.mjs";
|
|
16
22
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
17
|
-
import "./
|
|
23
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
24
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
18
25
|
import "./searchNextOpeningMoment.mjs";
|
|
19
26
|
import "./getOutletNextServiceTimeOffset.mjs";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
n =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function R(t, m, o) {
|
|
28
|
+
let f = t;
|
|
29
|
+
return k(
|
|
30
|
+
m,
|
|
31
|
+
o
|
|
32
|
+
) && (f = t.filter((r) => {
|
|
33
|
+
const n = s(r.timestamp).utc(!0), e = s(m).utc(!0);
|
|
34
|
+
return n.isSameOrAfter(e);
|
|
35
|
+
})), f;
|
|
36
|
+
}
|
|
37
|
+
function z(t) {
|
|
38
|
+
const m = t[0], o = t[t.length - 1];
|
|
39
|
+
if (k(
|
|
40
|
+
m.timestamp,
|
|
41
|
+
o.timestamp
|
|
42
|
+
)) {
|
|
43
|
+
const c = Math.max(
|
|
44
|
+
s(m.timestamp).utcOffset(),
|
|
45
|
+
s(o.timestamp).utcOffset()
|
|
46
|
+
), r = t.map((e) => e.timeLabel), n = r.filter(
|
|
47
|
+
(e, i) => r.indexOf(e) !== i
|
|
48
|
+
);
|
|
49
|
+
return t.map((e) => {
|
|
50
|
+
if (n.includes(e.timeLabel)) {
|
|
51
|
+
const d = s(e.timestamp).utcOffset() === c ? O.Summer : O.Standard;
|
|
52
|
+
return { ...e, timezoneTag: d };
|
|
53
|
+
}
|
|
54
|
+
return e;
|
|
30
55
|
});
|
|
31
|
-
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
function it(t, m, o, f) {
|
|
60
|
+
const { preparationTime: c = "00:00:00" } = y(m, t == null ? void 0 : t.orderFormatSettings) ?? {}, r = x(t, m);
|
|
61
|
+
let n = r.clone();
|
|
62
|
+
const e = s(o);
|
|
63
|
+
if (e > r)
|
|
64
|
+
n = r.clone().set({
|
|
65
|
+
year: e.year(),
|
|
66
|
+
month: e.month(),
|
|
67
|
+
date: e.date()
|
|
68
|
+
});
|
|
69
|
+
else if (r.diff(e, "day") > 0)
|
|
32
70
|
return [];
|
|
33
|
-
let
|
|
34
|
-
const
|
|
71
|
+
let i = [];
|
|
72
|
+
const d = v(
|
|
35
73
|
n,
|
|
36
|
-
|
|
37
|
-
|
|
74
|
+
t == null ? void 0 : t.serviceDateTimes,
|
|
75
|
+
m
|
|
38
76
|
);
|
|
39
|
-
let
|
|
40
|
-
return
|
|
41
|
-
!
|
|
42
|
-
const
|
|
77
|
+
let S;
|
|
78
|
+
return d.forEach((a) => {
|
|
79
|
+
!S && a.type && (i = []);
|
|
80
|
+
const p = I(
|
|
43
81
|
n,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
), h = x(
|
|
82
|
+
a,
|
|
83
|
+
c
|
|
84
|
+
), u = b(
|
|
48
85
|
n,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
r == null ? void 0 : r.timeZoneOffset
|
|
86
|
+
a,
|
|
87
|
+
c
|
|
52
88
|
);
|
|
53
|
-
|
|
54
|
-
|
|
89
|
+
p < r && p.add(
|
|
90
|
+
r.valueOf() - p.valueOf(),
|
|
55
91
|
"millisecond"
|
|
56
92
|
);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
93
|
+
const l = D(
|
|
94
|
+
p,
|
|
95
|
+
u,
|
|
96
|
+
i,
|
|
61
97
|
void 0,
|
|
62
|
-
|
|
98
|
+
f
|
|
63
99
|
);
|
|
64
|
-
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
100
|
+
if (l.length > 0)
|
|
101
|
+
switch (a.state) {
|
|
102
|
+
case h.Closed: {
|
|
103
|
+
const T = l[0], P = l[l.length - 1];
|
|
104
|
+
i = i.filter(
|
|
105
|
+
({ timestamp: g }) => g < T.timestamp || g > P.timestamp
|
|
106
|
+
);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case h.Opened:
|
|
110
|
+
default: {
|
|
111
|
+
const T = R(
|
|
112
|
+
l,
|
|
113
|
+
p,
|
|
114
|
+
u
|
|
115
|
+
);
|
|
116
|
+
i = i.concat(T);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
S = a.type;
|
|
121
|
+
}), i.length ? z(i) : i;
|
|
68
122
|
}
|
|
69
123
|
export {
|
|
70
|
-
|
|
124
|
+
it as default
|
|
71
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./getOutletNextReadyToOrderTime.js"),l=require("./getOutletPickerTimesForDay.js");require("@ancon/wildcat-types");require("moment");require("./getSettingsForOrderFormat.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./
|
|
1
|
+
"use strict";const n=require("./getOutletNextReadyToOrderTime.js"),l=require("./getOutletPickerTimesForDay.js");require("@ancon/wildcat-types");require("moment");require("../date/getTimezoneUtcOffsetDifference.js");require("../time/getNextTenthMinute.js");require("./getSettingsForOrderFormat.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../time/getTimeSpanParts.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");require("./getServiceIntervalsForOrderFormat.js");require("./getOutletNextServiceTimeOffset.js");require("../date/isDSTShiftPresentInRange.js");require("./getPickerIntervalsForDay.js");require("../shared/constants.js");require("./getServiceIntervalStart.js");require("./types.js");require("./generatePickerTimesForDay.js");require("./getServiceIntervalEnd.js");require("./hoursAndMinutesToMinutes.js");function k(r,i,q){const c=n(r,i),u=[],t=c.clone();for(let e=0;e<7;e+=1)u.push(t.clone()),t.add(1,"day");return u.reduce((e,s)=>{const o=l(r,i,s,q);return e.push(o),e},[]).filter(e=>e.length>0)}module.exports=k;
|