@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
|
@@ -2,37 +2,43 @@ import s from "./getOutletNextReadyToOrderTime.mjs";
|
|
|
2
2
|
import u from "./getOutletPickerTimesForDay.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "moment";
|
|
5
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
6
|
+
import "../time/getNextTenthMinute.mjs";
|
|
5
7
|
import "./getSettingsForOrderFormat.mjs";
|
|
6
8
|
import "./isOutletAcceptingPreOrders.mjs";
|
|
7
9
|
import "./getOutletTagInformation.mjs";
|
|
10
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
8
11
|
import "./constants.mjs";
|
|
9
12
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
10
|
-
import "./
|
|
13
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
14
|
+
import "../time/getTimeSpanParts.mjs";
|
|
15
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
16
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
11
17
|
import "./searchNextOpeningMoment.mjs";
|
|
12
|
-
import "./getNextTenthMinute.mjs";
|
|
13
18
|
import "./getServiceIntervalsForOrderFormat.mjs";
|
|
14
19
|
import "./getOutletNextServiceTimeOffset.mjs";
|
|
15
|
-
import "../
|
|
20
|
+
import "../date/isDSTShiftPresentInRange.mjs";
|
|
16
21
|
import "./getPickerIntervalsForDay.mjs";
|
|
17
22
|
import "../shared/constants.mjs";
|
|
18
23
|
import "./getServiceIntervalStart.mjs";
|
|
24
|
+
import "./types.mjs";
|
|
19
25
|
import "./generatePickerTimesForDay.mjs";
|
|
20
26
|
import "./getServiceIntervalEnd.mjs";
|
|
21
27
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
22
|
-
function
|
|
23
|
-
const m = s(r, o), i = [],
|
|
28
|
+
function H(r, o, e) {
|
|
29
|
+
const m = s(r, o), i = [], p = m.clone();
|
|
24
30
|
for (let t = 0; t < 7; t += 1)
|
|
25
|
-
i.push(
|
|
31
|
+
i.push(p.clone()), p.add(1, "day");
|
|
26
32
|
return i.reduce((t, c) => {
|
|
27
33
|
const n = u(
|
|
28
34
|
r,
|
|
29
35
|
o,
|
|
30
36
|
c,
|
|
31
|
-
|
|
37
|
+
e
|
|
32
38
|
);
|
|
33
39
|
return t.push(n), t;
|
|
34
40
|
}, []).filter((t) => t.length > 0);
|
|
35
41
|
}
|
|
36
42
|
export {
|
|
37
|
-
|
|
43
|
+
H as default
|
|
38
44
|
};
|
|
@@ -12,5 +12,5 @@ export declare const DaysOfWeekMap: {
|
|
|
12
12
|
7: number;
|
|
13
13
|
};
|
|
14
14
|
declare function getOutletTagInformation(operatingHours: ServiceDateTimeInterval[], open: boolean, // Derived by the `state` given by the server
|
|
15
|
-
specificTime: Moment, currentTime: Moment
|
|
15
|
+
specificTime: Moment, currentTime: Moment): OutletTagInformation;
|
|
16
16
|
export default getOutletTagInformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("@ancon/wildcat-types"),M=require("moment"),u=require("../date/createLocalTimezoneMoment.js"),p=require("./constants.js"),O=require("./getOutletCurrentActiveOperatingHour.js"),k=require("./searchNextOpeningMoment.js"),D=require("./getTimezoneAdjustedServiceInterval.js");require("../time/getTimeSpanParts.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");const m={0:127,1:1,2:2,3:4,4:8,5:16,6:32,7:64};function q(n,e){const t=n.isSame(e,"d"),a={[e.format(p.OutletMapKeyFormatter)]:{intervals:[],exception:null,metadata:{dayOfWeek:m[e.isoWeekday()]}}};for(let s=t?1:0;s<p.OutletTimelineDayCount;s+=1){const i=M(n).add(s,"d");a[i.format(p.OutletMapKeyFormatter)]={intervals:[],exception:null,metadata:{dayOfWeek:m[i.isoWeekday()]}}}return a}function S(n,e){const t=u(e.periodFrom),o=u(e.periodTo);if(!t.isSame(o,"d"))Object.keys(n).forEach(s=>{const i=M(s);if(i.isSame(t,"d")||i.isSame(o,"d")||i.isBetween(t,o)){const l=n[s],c=l.exception?l.exception.position:0;e.position>c&&(l.exception=e)}});else{const s=t.format(p.OutletMapKeyFormatter),i=n[s];if(i){const y=i.exception?i.exception.position:0;e.position>y&&(i.exception=e)}}}function T(n,e){Object.keys(n).forEach(t=>{const o=n[t],{dayOfWeek:a}=o.metadata,{dayOfWeek:s}=e;(a&s)===a&&o.intervals.push(e)})}function I(n,e,t){const o=q(e,t);return n.forEach(a=>{a.type===g.IntervalType.Exception?S(o,a):T(o,a)}),o}function v(n,e,t,o){const a=I(n,t,o),s=o.format(p.OutletMapKeyFormatter),i=O(s,a[s],o)!==null,y=e;let l=null,c=null;if(e){const d=t.format(p.OutletMapKeyFormatter),f=O(d,a[d],t);if(f){const r=D(d,f,t.utcOffset());c=r.openingTime,l=r.closingTime}}else c=k(a,t);if(!e&&!c){const d=n.filter(r=>r.state&&u(r.periodTo).isAfter(t)),[f]=d.sort((r,x)=>o.valueOf()-(u(r.periodTo).valueOf()-u(x.periodTo).valueOf()));if(f)return v(n,e,u(f.periodTo),o)}return{closingTime:l,openingTime:c,openDuringSpecifiedTime:y,openNow:i}}exports.DaysOfWeekMap=m;exports.default=v;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { IntervalType as g } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
2
|
+
import x from "moment";
|
|
3
|
+
import l from "../date/createLocalTimezoneMoment.mjs";
|
|
4
|
+
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as k } from "./constants.mjs";
|
|
5
|
+
import y from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
6
|
+
import D from "./searchNextOpeningMoment.mjs";
|
|
7
|
+
import M from "./getTimezoneAdjustedServiceInterval.mjs";
|
|
8
|
+
import "../time/getTimeSpanParts.mjs";
|
|
9
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
10
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
11
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
12
|
+
const O = {
|
|
8
13
|
0: 127,
|
|
9
14
|
1: 1,
|
|
10
15
|
2: 2,
|
|
@@ -16,105 +21,101 @@ const x = {
|
|
|
16
21
|
// WEEKDAYS: 31,
|
|
17
22
|
// WEEKENDS: 96,
|
|
18
23
|
};
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
[
|
|
24
|
+
function I(n, e) {
|
|
25
|
+
const t = n.isSame(e, "d"), a = {
|
|
26
|
+
[e.format(d)]: {
|
|
22
27
|
intervals: [],
|
|
23
28
|
exception: null,
|
|
24
|
-
metadata: { dayOfWeek:
|
|
29
|
+
metadata: { dayOfWeek: O[e.isoWeekday()] }
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
|
-
for (let
|
|
28
|
-
const
|
|
29
|
-
|
|
32
|
+
for (let s = t ? 1 : 0; s < k; s += 1) {
|
|
33
|
+
const i = x(n).add(s, "d");
|
|
34
|
+
a[i.format(d)] = {
|
|
30
35
|
intervals: [],
|
|
31
36
|
exception: null,
|
|
32
|
-
metadata: { dayOfWeek:
|
|
37
|
+
metadata: { dayOfWeek: O[i.isoWeekday()] }
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
|
-
return
|
|
40
|
+
return a;
|
|
36
41
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
42
|
+
function S(n, e) {
|
|
43
|
+
const t = l(e.periodFrom), o = l(e.periodTo);
|
|
44
|
+
if (!t.isSame(
|
|
40
45
|
o,
|
|
41
46
|
"d"
|
|
42
47
|
))
|
|
43
48
|
Object.keys(n).forEach((s) => {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
49
|
+
const i = x(s);
|
|
50
|
+
if (i.isSame(t, "d") || i.isSame(o, "d") || i.isBetween(t, o)) {
|
|
51
|
+
const p = n[s], c = p.exception ? p.exception.position : 0;
|
|
52
|
+
e.position > c && (p.exception = e);
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
55
|
else {
|
|
51
|
-
const s =
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
56
|
+
const s = t.format(d), i = n[s];
|
|
57
|
+
if (i) {
|
|
58
|
+
const u = i.exception ? i.exception.position : 0;
|
|
59
|
+
e.position > u && (i.exception = e);
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
|
-
function
|
|
59
|
-
Object.keys(n).forEach((
|
|
60
|
-
const
|
|
61
|
-
(
|
|
63
|
+
function T(n, e) {
|
|
64
|
+
Object.keys(n).forEach((t) => {
|
|
65
|
+
const o = n[t], { dayOfWeek: a } = o.metadata, { dayOfWeek: s } = e;
|
|
66
|
+
(a & s) === a && o.intervals.push(e);
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
return n.forEach((
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
+
function W(n, e, t) {
|
|
70
|
+
const o = I(e, t);
|
|
71
|
+
return n.forEach((a) => {
|
|
72
|
+
a.type === g.Exception ? S(o, a) : T(o, a);
|
|
73
|
+
}), o;
|
|
69
74
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
75
|
+
function E(n, e, t, o) {
|
|
76
|
+
const a = W(
|
|
72
77
|
n,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
), s =
|
|
78
|
+
t,
|
|
79
|
+
o
|
|
80
|
+
), s = o.format(d), i = y(
|
|
76
81
|
s,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
) !== null,
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
a[s],
|
|
83
|
+
o
|
|
84
|
+
) !== null, u = e;
|
|
85
|
+
let p = null, c = null;
|
|
86
|
+
if (e) {
|
|
87
|
+
const m = t.format(d), f = y(
|
|
88
|
+
m,
|
|
89
|
+
a[m],
|
|
90
|
+
t
|
|
86
91
|
);
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
)
|
|
92
|
+
if (f) {
|
|
93
|
+
const r = M(
|
|
94
|
+
m,
|
|
95
|
+
f,
|
|
96
|
+
t.utcOffset()
|
|
97
|
+
);
|
|
98
|
+
c = r.openingTime, p = r.closingTime;
|
|
93
99
|
}
|
|
94
100
|
} else
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
const u = n.filter(
|
|
102
|
-
(m) => m.state && r(m.toDate).isAfter(a)
|
|
103
|
-
), [l] = u.sort(
|
|
104
|
-
(m, O) => e.valueOf() - (r(m.toDate).valueOf() - r(O.toDate).valueOf())
|
|
101
|
+
c = D(a, t);
|
|
102
|
+
if (!e && !c) {
|
|
103
|
+
const m = n.filter(
|
|
104
|
+
(r) => r.state && l(r.periodTo).isAfter(t)
|
|
105
|
+
), [f] = m.sort(
|
|
106
|
+
(r, v) => o.valueOf() - (l(r.periodTo).valueOf() - l(v.periodTo).valueOf())
|
|
105
107
|
);
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
+
if (f)
|
|
109
|
+
return E(
|
|
108
110
|
n,
|
|
109
|
-
t,
|
|
110
|
-
r(l.toDate),
|
|
111
111
|
e,
|
|
112
|
+
l(f.periodTo),
|
|
112
113
|
o
|
|
113
114
|
);
|
|
114
115
|
}
|
|
115
|
-
return { closingTime:
|
|
116
|
+
return { closingTime: p, openingTime: c, openDuringSpecifiedTime: u, openNow: i };
|
|
116
117
|
}
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
O as DaysOfWeekMap,
|
|
120
|
+
E as default
|
|
120
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const I=require("moment"),b=require("../_baseIteratee-075c204c.js"),g=require("../_baseIsEqual-bcac9024.js"),q=require("../_getTag-b8923c48.js"),T=require("../noop-7ea3b37b.js"),w=require("./getListOutletOpeningHoursTable.js");require("../identity-1bae7cf8.js");require("../isArray-640f9811.js");require("../toString-9eae9442.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function p(e,n,t,i){for(var r=e.length,u=t+(i?1:-1);i?u--:++u<r;)if(n(e[u],u,e))return u;return-1}function O(e){return e!==e}function S(e,n,t){for(var i=t-1,r=e.length;++i<r;)if(e[i]===n)return i;return-1}function a(e,n,t){return n===n?S(e,n,t):p(e,O,t)}function x(e,n){var t=e==null?0:e.length;return!!t&&a(e,n,0)>-1}function _(e,n,t){for(var i=-1,r=e==null?0:e.length;++i<r;)if(t(n,e[i]))return!0;return!1}var A=1/0,H=q.Set&&1/g.setToArray(new q.Set([,-0]))[1]==A?function(e){return new q.Set(e)}:T.noop;const N=H;var W=200;function k(e,n,t){var i=-1,r=x,u=e.length,c=!0,o=[],s=o;if(t)c=!1,r=_;else if(u>=W){var h=n?null:N(e);if(h)return g.setToArray(h);c=!1,r=g.cacheHas,s=new g.SetCache}else s=n?[]:o;e:for(;++i<u;){var l=e[i],f=n?n(l):l;if(l=t||l!==0?l:0,c&&f===f){for(var d=s.length;d--;)if(s[d]===f)continue e;n&&s.push(f),o.push(l)}else r(s,f,t)||(s!==o&&s.push(f),o.push(l))}return o}function E(e,n){return e&&e.length?k(e,b.baseIteratee(n)):[]}function v(e){const n=w(e),i=I().isoWeekday(),r=n.reduce((u,{openingHours:c})=>{var s;const o=(s=c.find(h=>h.isoWeekday===i))==null?void 0:s.open;return o&&u.push(...o),u},[]);return r?E(r,["start","end"]):null}module.exports=v;
|
|
@@ -1,87 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { b as
|
|
3
|
-
import {
|
|
1
|
+
import d from "moment";
|
|
2
|
+
import { b as I } from "../_baseIteratee-4c4d0995.mjs";
|
|
3
|
+
import { s as m, S as a, c as b } from "../_baseIsEqual-12d01a44.mjs";
|
|
4
|
+
import { S as c } from "../_getTag-4e44633b.mjs";
|
|
4
5
|
import { n as w } from "../noop-378485d5.mjs";
|
|
5
6
|
import O from "./getListOutletOpeningHoursTable.mjs";
|
|
7
|
+
import "../identity-6eafe87b.mjs";
|
|
6
8
|
import "../isArray-0d9c7aaa.mjs";
|
|
7
|
-
import "../toString-
|
|
9
|
+
import "../toString-3b91b335.mjs";
|
|
8
10
|
import "@ancon/wildcat-types";
|
|
9
11
|
import "../shared/isWithinFlag.mjs";
|
|
10
12
|
import "../shared/generateId.mjs";
|
|
11
13
|
import "react";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
import "../time/getTimeSpanParts.mjs";
|
|
15
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
16
|
+
function S(n, e, t, i) {
|
|
17
|
+
for (var r = n.length, o = t + (i ? 1 : -1); i ? o-- : ++o < r; )
|
|
18
|
+
if (e(n[o], o, n))
|
|
19
|
+
return o;
|
|
16
20
|
return -1;
|
|
17
21
|
}
|
|
18
|
-
function
|
|
22
|
+
function T(n) {
|
|
19
23
|
return n !== n;
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
for (var i = t - 1,
|
|
25
|
+
function x(n, e, t) {
|
|
26
|
+
for (var i = t - 1, r = n.length; ++i < r; )
|
|
23
27
|
if (n[i] === e)
|
|
24
28
|
return i;
|
|
25
29
|
return -1;
|
|
26
30
|
}
|
|
27
31
|
function A(n, e, t) {
|
|
28
|
-
return e === e ?
|
|
32
|
+
return e === e ? x(n, e, t) : S(n, T, t);
|
|
29
33
|
}
|
|
30
34
|
function H(n, e) {
|
|
31
35
|
var t = n == null ? 0 : n.length;
|
|
32
36
|
return !!t && A(n, e, 0) > -1;
|
|
33
37
|
}
|
|
34
38
|
function N(n, e, t) {
|
|
35
|
-
for (var i = -1,
|
|
39
|
+
for (var i = -1, r = n == null ? 0 : n.length; ++i < r; )
|
|
36
40
|
if (t(e, n[i]))
|
|
37
41
|
return !0;
|
|
38
42
|
return !1;
|
|
39
43
|
}
|
|
40
|
-
var W = 1 / 0, k =
|
|
41
|
-
return new
|
|
44
|
+
var W = 1 / 0, k = c && 1 / m(new c([, -0]))[1] == W ? function(n) {
|
|
45
|
+
return new c(n);
|
|
42
46
|
} : w;
|
|
43
47
|
const q = k;
|
|
44
48
|
var v = 200;
|
|
45
49
|
function C(n, e, t) {
|
|
46
|
-
var i = -1,
|
|
50
|
+
var i = -1, r = H, o = n.length, h = !0, u = [], s = u;
|
|
47
51
|
if (t)
|
|
48
|
-
h = !1,
|
|
49
|
-
else if (
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
53
|
-
h = !1,
|
|
52
|
+
h = !1, r = N;
|
|
53
|
+
else if (o >= v) {
|
|
54
|
+
var p = e ? null : q(n);
|
|
55
|
+
if (p)
|
|
56
|
+
return m(p);
|
|
57
|
+
h = !1, r = b, s = new a();
|
|
54
58
|
} else
|
|
55
|
-
|
|
59
|
+
s = e ? [] : u;
|
|
56
60
|
n:
|
|
57
|
-
for (; ++i <
|
|
61
|
+
for (; ++i < o; ) {
|
|
58
62
|
var f = n[i], l = e ? e(f) : f;
|
|
59
63
|
if (f = t || f !== 0 ? f : 0, h && l === l) {
|
|
60
|
-
for (var
|
|
61
|
-
if (
|
|
64
|
+
for (var g = s.length; g--; )
|
|
65
|
+
if (s[g] === l)
|
|
62
66
|
continue n;
|
|
63
|
-
e &&
|
|
67
|
+
e && s.push(l), u.push(f);
|
|
64
68
|
} else
|
|
65
|
-
s
|
|
69
|
+
r(s, l, t) || (s !== u && s.push(l), u.push(f));
|
|
66
70
|
}
|
|
67
71
|
return u;
|
|
68
72
|
}
|
|
69
73
|
function E(n, e) {
|
|
70
|
-
return n && n.length ? C(n,
|
|
74
|
+
return n && n.length ? C(n, I(e)) : [];
|
|
71
75
|
}
|
|
72
|
-
function
|
|
73
|
-
const e = O(n), i =
|
|
74
|
-
(
|
|
75
|
-
var
|
|
76
|
-
const u = (
|
|
77
|
-
(
|
|
78
|
-
)) == null ? void 0 :
|
|
79
|
-
return u &&
|
|
76
|
+
function K(n) {
|
|
77
|
+
const e = O(n), i = d().isoWeekday(), r = e.reduce(
|
|
78
|
+
(o, { openingHours: h }) => {
|
|
79
|
+
var s;
|
|
80
|
+
const u = (s = h.find(
|
|
81
|
+
(p) => p.isoWeekday === i
|
|
82
|
+
)) == null ? void 0 : s.open;
|
|
83
|
+
return u && o.push(...u), o;
|
|
80
84
|
},
|
|
81
85
|
[]
|
|
82
86
|
);
|
|
83
|
-
return
|
|
87
|
+
return r ? E(r, ["start", "end"]) : null;
|
|
84
88
|
}
|
|
85
89
|
export {
|
|
86
|
-
|
|
90
|
+
K as default
|
|
87
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("@ancon/wildcat-types"),u=require("./isOutletAcceptingPreOrders.js"),e=require("./types.js");function o(s){return s.reduce((r,t)=>{const i=u(t.orderFormatSettings);return t.state===n.OutletState.
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types"),u=require("./isOutletAcceptingPreOrders.js"),e=require("./types.js");function o(s){return s.reduce((r,t)=>{const i=u(t.orderFormatSettings);return t.state===n.OutletState.Opened?r[e.OutletListSection.OrderNow].push(t):i?r[e.OutletListSection.PreOrder].push(t):r[e.OutletListSection.Closed].push(t),r},{[e.OutletListSection.OrderNow]:[],[e.OutletListSection.PreOrder]:[],[e.OutletListSection.Closed]:[]})}module.exports=o;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { OutletState as
|
|
2
|
-
import
|
|
1
|
+
import { OutletState as d } from "@ancon/wildcat-types";
|
|
2
|
+
import o from "./isOutletAcceptingPreOrders.mjs";
|
|
3
3
|
import { OutletListSection as e } from "./types.mjs";
|
|
4
4
|
function f(s) {
|
|
5
5
|
return s.reduce(
|
|
6
6
|
(t, r) => {
|
|
7
|
-
const i =
|
|
7
|
+
const i = o(
|
|
8
8
|
r.orderFormatSettings
|
|
9
9
|
);
|
|
10
|
-
return r.state ===
|
|
10
|
+
return r.state === d.Opened ? t[e.OrderNow].push(r) : i ? t[e.PreOrder].push(r) : t[e.Closed].push(r), t;
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
[e.OrderNow]: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=require("@ancon/wildcat-types"),p=require("../shared/constants.js"),o=require("../date/createLocalTimezoneMoment.js"),f=require("./getServiceIntervalsForOrderFormat.js");require("moment");function F(t,s,n){return f(n,s).reduce((r,e)=>{const i=e.dayOfWeek===c.DayOfWeek.Everyday,a=!!e.type,d=t.isoWeekday();if(i){if(a){const u=o(e.periodFrom),y=o(e.periodTo);return t.isBetween(u,y,"day","[]")&&r.push(e),r}return r.push(e),r}return e.dayOfWeek===p.DaysOfWeekMap[d]&&r.push(e),r},[])}module.exports=F;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { DayOfWeek as p } from "@ancon/wildcat-types";
|
|
2
|
+
import { DaysOfWeekMap as y } from "../shared/constants.mjs";
|
|
3
|
+
import t from "../date/createLocalTimezoneMoment.mjs";
|
|
4
4
|
import u from "./getServiceIntervalsForOrderFormat.mjs";
|
|
5
|
-
|
|
5
|
+
import "moment";
|
|
6
|
+
function w(o, n, s) {
|
|
6
7
|
return u(
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
s,
|
|
9
|
+
n
|
|
9
10
|
).reduce(
|
|
10
11
|
(r, e) => {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
14
|
-
const
|
|
15
|
-
|
|
12
|
+
const i = e.dayOfWeek === p.Everyday, a = !!e.type, m = o.isoWeekday();
|
|
13
|
+
if (i) {
|
|
14
|
+
if (a) {
|
|
15
|
+
const d = t(
|
|
16
|
+
e.periodFrom
|
|
17
|
+
), f = t(e.periodTo);
|
|
18
|
+
return o.isBetween(
|
|
19
|
+
d,
|
|
20
|
+
f,
|
|
21
|
+
"day",
|
|
22
|
+
"[]"
|
|
23
|
+
) && r.push(e), r;
|
|
16
24
|
}
|
|
17
25
|
return r.push(e), r;
|
|
18
26
|
}
|
|
19
|
-
return e.dayOfWeek ===
|
|
27
|
+
return e.dayOfWeek === y[m] && r.push(e), r;
|
|
20
28
|
},
|
|
21
29
|
[]
|
|
22
30
|
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
export default function getServiceIntervalEnd(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string
|
|
3
|
+
export default function getServiceIntervalEnd(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string): Moment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const m=require("moment"),r=require("../time/getTimeSpanParts.js"),a=require("./hoursAndMinutesToMinutes.js"),d=require("./getServiceIntervalTimeSpanMoment.js");function p(o,n,i="00:00:00"){const s=m(),t=r(i),u=r(n.duration),e=d(o,n.from);e.add(u);const c=a(t.hours,t.minutes);return e.diff(s,"minute")<c&&e.subtract(t),e}module.exports=p;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import a from "moment";
|
|
2
|
+
import o from "../time/getTimeSpanParts.mjs";
|
|
3
|
+
import p from "./hoursAndMinutesToMinutes.mjs";
|
|
4
|
+
import f from "./getServiceIntervalTimeSpanMoment.mjs";
|
|
5
|
+
function S(r, n, i = "00:00:00") {
|
|
6
|
+
const m = a(), e = o(i), s = o(n.duration), t = f(r, n.from);
|
|
7
|
+
t.add(s);
|
|
8
|
+
const u = p(
|
|
9
|
+
e.hours,
|
|
10
|
+
e.minutes
|
|
11
|
+
);
|
|
12
|
+
return t.diff(m, "minute") < u && t.subtract(e), t;
|
|
10
13
|
}
|
|
11
14
|
export {
|
|
12
|
-
|
|
15
|
+
S as default
|
|
13
16
|
};
|
|
@@ -6,7 +6,6 @@ import moment, { Moment } from 'moment';
|
|
|
6
6
|
* @param date - Moment object representing the date to be used for the calculation
|
|
7
7
|
* @param interval - Object containing the start and duration of the interval in the form "hh:mm:ss"
|
|
8
8
|
* @param preparationTime - String representing the preparation time in the form "hh:mm:ss"
|
|
9
|
-
* @param outletTimeZoneOffset - String representing the outlet timezone offset in the form "hh:mm:ss"
|
|
10
9
|
* @returns - Array containing the interval start and end as Moment objects
|
|
11
10
|
*/
|
|
12
|
-
export default function getServiceIntervalRange(date: Moment, interval: Pick<ServiceDateTimeInterval, '
|
|
11
|
+
export default function getServiceIntervalRange(date: Moment, interval: Pick<ServiceDateTimeInterval, 'from' | 'duration'>, preparationTime?: string): moment.Moment[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const d=require("moment"),a=require("../time/toMinutes.js"),h=require("../time/getNextTenthMinute.js"),s=require("../time/getTimeSpanParts.js");function l(m,i,c="00:00:00"){const o=s(i.from),u=s(i.duration),r=s(c),t=m.clone().hour(o.hours).minute(o.minutes).second(0).millisecond(0),e=a(r.hours,r.minutes),n=t.clone().add(u.hours,"hours").add(u.minutes,"minutes");return n.diff(d(),"minutes")<e&&n.subtract(e,"minutes"),t.add(e,"minutes"),t.minute(h(t)),[t,n]}module.exports=l;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { duration: m, start: a } = s, [c, f] = n(a), [l, p] = n(d), [M, O] = n(r), [h, T] = n(m), t = e.clone().utc(!0).hour(c).minute(f).second(0).millisecond(0), u = t.clone().add(l, "hour").add(p, "minute").clone().startOf("day").diff(e.clone().startOf("day"), "day");
|
|
9
|
-
u !== 0 && t.subtract(u, "day");
|
|
10
|
-
const o = v(M, O), i = t.clone().add(h, "hours").add(T, "minutes");
|
|
11
|
-
return i.diff(H().utc(!0), "minutes") < o && i.subtract(o, "minutes"), t.add(o, "minutes"), t.minute(y(t)), [t, i];
|
|
1
|
+
import c from "moment";
|
|
2
|
+
import a from "../time/toMinutes.mjs";
|
|
3
|
+
import f from "../time/getNextTenthMinute.mjs";
|
|
4
|
+
import o from "../time/getTimeSpanParts.mjs";
|
|
5
|
+
function T(u, i, d = "00:00:00") {
|
|
6
|
+
const s = o(i.from), m = o(i.duration), r = o(d), t = u.clone().hour(s.hours).minute(s.minutes).second(0).millisecond(0), n = a(r.hours, r.minutes), e = t.clone().add(m.hours, "hours").add(m.minutes, "minutes");
|
|
7
|
+
return e.diff(c(), "minutes") < n && e.subtract(n, "minutes"), t.add(n, "minutes"), t.minute(f(t)), [t, e];
|
|
12
8
|
}
|
|
13
9
|
export {
|
|
14
|
-
|
|
10
|
+
T as default
|
|
15
11
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
export default function getServiceIntervalStart(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string
|
|
3
|
+
export default function getServiceIntervalStart(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string): Moment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("../time/getTimeSpanParts.js"),s=require("../time/getNextTenthMinute.js"),u=require("./getServiceIntervalTimeSpanMoment.js");require("moment");function a(t,r,n="00:00:00"){const i=o(n),e=u(t,r.from);return e.add(i),e.minute(s(e)),e}module.exports=a;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "../time/getTimeSpanParts.mjs";
|
|
2
|
+
import i from "../time/getNextTenthMinute.mjs";
|
|
3
|
+
import a from "./getServiceIntervalTimeSpanMoment.mjs";
|
|
2
4
|
import "moment";
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const n = t.clone().add(d, "hour").add(l, "minute").clone().startOf("day").diff(e.clone().startOf("day"), "day");
|
|
7
|
-
return n !== 0 && (t = t.subtract(n, "day")), t.add(s, "hours").add(m, "minutes"), t.minute(c(t)), t;
|
|
5
|
+
function u(e, r, m = "00:00:00") {
|
|
6
|
+
const n = o(m), t = a(e, r.from);
|
|
7
|
+
return t.add(n), t.minute(i(t)), t;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
u as default
|
|
11
11
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Moment, MomentInput } from 'moment';
|
|
2
|
+
/**
|
|
3
|
+
* This generates the Moment for the given opening hour time span and the specified date.
|
|
4
|
+
*
|
|
5
|
+
* @param date - Specific date.
|
|
6
|
+
* @param timeSpan - Service interval time span.
|
|
7
|
+
* @returns The generated Moment object
|
|
8
|
+
*/
|
|
9
|
+
export default function getServiceIntervalTimeSpanMoment(date: MomentInput, timeSpan: string): Moment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("moment"),m=require("../time/getTimeSpanParts.js");function i(t,n){const e=m(n);return o(t).hour(e.hours).minute(e.minutes).second(0).millisecond(0)}module.exports=i;
|