@ancon/wildcat-utils 1.43.4 → 1.44.0-timezone-refactor.1
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/card/index.d.ts +2 -0
- package/card/index.js +1 -1
- package/card/index.mjs +5 -3
- package/card/isWalletDebitTransaction.d.ts +2 -0
- package/card/isWalletDebitTransaction.js +1 -0
- package/card/isWalletDebitTransaction.mjs +13 -0
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +7 -5
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +49 -47
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +14 -13
- 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/index.d.ts +4 -0
- package/date/index.js +1 -0
- package/date/index.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 +96 -74
- 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/getMomentFromDateAndTimeString.js +1 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +1 -1
- 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 +16 -15
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +27 -26
- 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 +8 -7
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +10 -8
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +11 -11
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +33 -34
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +4 -3
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +69 -70
- 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 +12 -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 +6 -7
- package/outlet/getServiceIntervalsForOrderFormat.d.ts +7 -8
- package/outlet/getStructuredOutletAddress.js +1 -1
- package/outlet/getStructuredOutletAddress.mjs +7 -7
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +73 -68
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +49 -56
- package/outlet/serviceDateTimesFromOpeningHours.d.ts +3 -5
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +342 -27
- package/outlet/types.d.ts +0 -2
- package/package.json +26 -1
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +5 -9
- 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/toString-425512fc.js +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { IntervalType as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import D from "
|
|
1
|
+
import { IntervalType as v } from "@ancon/wildcat-types";
|
|
2
|
+
import g from "moment";
|
|
3
|
+
import l from "../date/createLocalTimezoneMoment.mjs";
|
|
4
|
+
import D from "../time/getTimeSpanParts.mjs";
|
|
5
|
+
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as M } from "./constants.mjs";
|
|
6
|
+
import O from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
5
7
|
import k from "./getMomentFromDateAndTimeString.mjs";
|
|
6
|
-
import
|
|
8
|
+
import S from "./searchNextOpeningMoment.mjs";
|
|
7
9
|
const x = {
|
|
8
10
|
0: 127,
|
|
9
11
|
1: 1,
|
|
@@ -16,103 +18,100 @@ const x = {
|
|
|
16
18
|
// WEEKDAYS: 31,
|
|
17
19
|
// WEEKENDS: 96,
|
|
18
20
|
};
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
[
|
|
21
|
+
function T(n, e) {
|
|
22
|
+
const o = n.isSame(e, "d"), a = {
|
|
23
|
+
[e.format(d)]: {
|
|
22
24
|
intervals: [],
|
|
23
25
|
exception: null,
|
|
24
|
-
metadata: { dayOfWeek: x[
|
|
26
|
+
metadata: { dayOfWeek: x[e.isoWeekday()] }
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
|
-
for (let
|
|
28
|
-
const
|
|
29
|
-
|
|
29
|
+
for (let s = o ? 1 : 0; s < M; s += 1) {
|
|
30
|
+
const i = g(n).add(s, "d");
|
|
31
|
+
a[i.format(d)] = {
|
|
30
32
|
intervals: [],
|
|
31
33
|
exception: null,
|
|
32
|
-
metadata: { dayOfWeek: x[
|
|
34
|
+
metadata: { dayOfWeek: x[i.isoWeekday()] }
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
return
|
|
37
|
+
return a;
|
|
36
38
|
}
|
|
37
|
-
function W(n,
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
|
|
39
|
+
function W(n, e) {
|
|
40
|
+
const o = l(e.periodFrom), t = l(e.periodTo);
|
|
41
|
+
if (!o.isSame(
|
|
42
|
+
t,
|
|
41
43
|
"d"
|
|
42
44
|
))
|
|
43
45
|
Object.keys(n).forEach((s) => {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
46
|
+
const i = g(s);
|
|
47
|
+
if (i.isSame(o, "d") || i.isSame(t, "d") || i.isBetween(o, t)) {
|
|
48
|
+
const p = n[s], r = p.exception ? p.exception.position : 0;
|
|
49
|
+
e.position > r && (p.exception = e);
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
52
|
else {
|
|
51
|
-
const s =
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
53
|
+
const s = o.format(d), i = n[s];
|
|
54
|
+
if (i) {
|
|
55
|
+
const u = i.exception ? i.exception.position : 0;
|
|
56
|
+
e.position > u && (i.exception = e);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
|
-
function E(n,
|
|
59
|
-
Object.keys(n).forEach((
|
|
60
|
-
const
|
|
61
|
-
(
|
|
60
|
+
function E(n, e) {
|
|
61
|
+
Object.keys(n).forEach((o) => {
|
|
62
|
+
const t = n[o], { dayOfWeek: a } = t.metadata, { dayOfWeek: s } = e;
|
|
63
|
+
(a & s) === a && t.intervals.push(e);
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
|
-
function I(n,
|
|
65
|
-
const
|
|
66
|
-
return n.forEach((
|
|
67
|
-
|
|
68
|
-
}),
|
|
66
|
+
function I(n, e, o) {
|
|
67
|
+
const t = T(e, o);
|
|
68
|
+
return n.forEach((a) => {
|
|
69
|
+
a.type === v.Exception ? W(t, a) : E(t, a);
|
|
70
|
+
}), t;
|
|
69
71
|
}
|
|
70
|
-
function h(n,
|
|
71
|
-
const
|
|
72
|
+
function h(n, e, o, t) {
|
|
73
|
+
const a = I(
|
|
72
74
|
n,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
), s =
|
|
75
|
+
o,
|
|
76
|
+
t
|
|
77
|
+
), s = t.format(d), i = O(
|
|
76
78
|
s,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
) !== null,
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
a[s],
|
|
80
|
+
t
|
|
81
|
+
) !== null, u = e;
|
|
82
|
+
let p = null, r = null;
|
|
83
|
+
if (e) {
|
|
84
|
+
const f = o.format(d), c = O(
|
|
85
|
+
f,
|
|
86
|
+
a[f],
|
|
87
|
+
o
|
|
86
88
|
);
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
if (c) {
|
|
90
|
+
const { hours: m, minutes: y } = D(
|
|
91
|
+
c.duration
|
|
92
|
+
);
|
|
93
|
+
r = k(
|
|
94
|
+
f,
|
|
95
|
+
c.from
|
|
96
|
+
), p = r.clone().add(m, "hours").add(y, "minutes");
|
|
93
97
|
}
|
|
94
98
|
} else
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
o
|
|
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())
|
|
99
|
+
r = S(a, o);
|
|
100
|
+
if (!e && !r) {
|
|
101
|
+
const f = n.filter(
|
|
102
|
+
(m) => m.state && l(m.periodTo).isAfter(o)
|
|
103
|
+
), [c] = f.sort(
|
|
104
|
+
(m, y) => t.valueOf() - (l(m.periodTo).valueOf() - l(y.periodTo).valueOf())
|
|
105
105
|
);
|
|
106
|
-
if (
|
|
106
|
+
if (c)
|
|
107
107
|
return h(
|
|
108
108
|
n,
|
|
109
|
-
t,
|
|
110
|
-
r(l.toDate),
|
|
111
109
|
e,
|
|
112
|
-
|
|
110
|
+
l(c.periodTo),
|
|
111
|
+
t
|
|
113
112
|
);
|
|
114
113
|
}
|
|
115
|
-
return { closingTime:
|
|
114
|
+
return { closingTime: p, openingTime: r, openDuringSpecifiedTime: u, openNow: i };
|
|
116
115
|
}
|
|
117
116
|
export {
|
|
118
117
|
x as DaysOfWeekMap,
|
|
@@ -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 d=require("moment"),n=require("../time/getTimeSpanParts.js"),a=require("./hoursAndMinutesToMinutes.js");function p(i,o,r="00:00:00"){const u=d(),s=n(o.from),e=n(r),c=n(o.duration),t=i.clone().hour(s.hours).minute(s.minutes).second(0).millisecond(0);t.add(c);const m=a(e.hours,e.minutes);return t.diff(u,"minute")<m&&t.subtract(e),t}module.exports=p;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import d from "moment";
|
|
2
|
+
import o from "../time/getTimeSpanParts.mjs";
|
|
3
|
+
import a from "./hoursAndMinutesToMinutes.mjs";
|
|
4
|
+
function h(i, e, s = "00:00:00") {
|
|
5
|
+
const m = d(), r = o(e.from), n = o(s), u = o(e.duration), t = i.clone().hour(r.hours).minute(r.minutes).second(0).millisecond(0);
|
|
6
|
+
t.add(u);
|
|
7
|
+
const c = a(
|
|
8
|
+
n.hours,
|
|
9
|
+
n.minutes
|
|
10
|
+
);
|
|
11
|
+
return t.diff(m, "minute") < c && t.subtract(n), t;
|
|
10
12
|
}
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
h as default
|
|
13
15
|
};
|
|
@@ -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 r=require("../time/getTimeSpanParts.js"),u=require("./getNextTenthMinute.js");require("moment");function c(n,i,o="00:00:00"){const t=r(i.from),s=r(o),e=n.clone().hour(t.hours).minute(t.minutes).second(0).millisecond(0);return e.add(s),e.minute(u(e)),e}module.exports=c;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "../time/getTimeSpanParts.mjs";
|
|
2
|
+
import s from "./getNextTenthMinute.mjs";
|
|
2
3
|
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;
|
|
4
|
+
function p(n, o, i = "00:00:00") {
|
|
5
|
+
const e = r(o.from), m = r(i), t = n.clone().hour(e.hours).minute(e.minutes).second(0).millisecond(0);
|
|
6
|
+
return t.add(m), t.minute(s(t)), t;
|
|
8
7
|
}
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
p as default
|
|
11
10
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { OrderFormat, ServiceDateTime } from '@ancon/wildcat-types';
|
|
1
|
+
import { DayOfWeek, IntervalState, IntervalType, OrderFormat, ServiceDateTime } from '@ancon/wildcat-types';
|
|
2
2
|
declare type ModifiedServiceDateTimeInterval = {
|
|
3
|
-
|
|
3
|
+
from: string;
|
|
4
4
|
duration: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type: number;
|
|
5
|
+
periodFrom: string;
|
|
6
|
+
periodTo: string;
|
|
7
|
+
type: IntervalType;
|
|
9
8
|
position: number;
|
|
10
|
-
state:
|
|
11
|
-
dayOfWeek:
|
|
9
|
+
state: IntervalState;
|
|
10
|
+
dayOfWeek: DayOfWeek;
|
|
12
11
|
isDefault: boolean;
|
|
13
12
|
reason: string;
|
|
14
13
|
orderFormats: OrderFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function i(t){return t.filter(Boolean).join(", ")||""}function l(t){if(t){const{street:r,city:
|
|
1
|
+
"use strict";function i(t){return t.filter(Boolean).join(", ")||""}function l(t){if(t){const{street:r,city:o,state:s,zipCode:c,country:u}=t,e=i([r||"",o||""]),n=i([s||"",c||"",u||""]);return{line1:e||n,line2:e?n:""}}return{line1:"",line2:""}}module.exports=l;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function i(
|
|
2
|
-
return
|
|
1
|
+
function i(e) {
|
|
2
|
+
return e.filter(Boolean).join(", ") || "";
|
|
3
3
|
}
|
|
4
|
-
function l(
|
|
5
|
-
if (
|
|
6
|
-
const { street: r, city: o, state: s,
|
|
4
|
+
function l(e) {
|
|
5
|
+
if (e) {
|
|
6
|
+
const { street: r, city: o, state: s, zipCode: u, country: c } = e, t = i([r || "", o || ""]), n = i([
|
|
7
7
|
s || "",
|
|
8
8
|
u || "",
|
|
9
9
|
c || ""
|
|
10
10
|
]);
|
|
11
11
|
return {
|
|
12
|
-
line1:
|
|
13
|
-
line2:
|
|
12
|
+
line1: t || n,
|
|
13
|
+
line2: t ? n : ""
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return {
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),s=require("./getOutletDeliveryFee.js"),n=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),s=require("./getOutletDeliveryFee.js"),n=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),q=require("./getServiceIntervalRange.js"),c=require("./getServiceIntervalsForOrderFormat.js"),d=require("./getOutletFormattedAddress.js"),m=require("./getPartitionedOutletsList.js"),T=require("./getOutletPickerTimesForWeek.js"),F=require("./getOutletPickerTimesForDay.js"),_=require("./getOutletOrderPrepTime.js"),v=require("./getStructuredOutletAddress.js"),p=require("./getOutletNextOpeningTimeText.js"),f=require("./getOutletCurrentClosingTimeText.js"),A=require("./getOutletNextReadyToOrderTime.js"),y=require("./getOutletNextOpeningTagInformation.js"),b=require("./getOutletCurrentAvailabilityInfo.js"),x=require("./getExpressAvailableOrderFormats.js"),P=require("./getExpressNextAvailabilityShiftTime.js"),S=require("./getOrderFormatAOTipSettings.js"),I=require("./isAOTippingEnabledForOrderFormat.js"),D=require("./isMenuTreeHierarchyProductAvailable.js"),N=require("./getOutletMenuProductsSortCriteria.js"),k=require("./getOutletNextServiceTimeOffset.js");require("moment");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.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("../_baseSlice-e1b41ceb.js");require("../shared/constants.js");require("../time/toMinutes.js");require("../time/getNextTenthMinute.js");require("../string/truncate.js");require("./types.js");require("./getSettingsForOrderFormat.js");require("./getServiceIntervalStart.js");require("./getNextTenthMinute.js");require("./generatePickerTimesForDay.js");require("./getServiceIntervalEnd.js");require("./hoursAndMinutesToMinutes.js");require("./getExpressServiceIntervalStart.js");require("./getExpressServiceIntervalEnd.js");exports.getListOutletOpeningHoursTable=e;exports.getOutletTagInformation=t.default;exports.getOutletAvailabilityInfo=r.default;exports.getOutletOfflineOrderFormats=i;exports.getOutletAvailableOrderFormats=u;exports.getOutletFormattedDistance=o;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=s;exports.getOutletTodayOpeningTimes=n;exports.getOutletOrderFormats=a;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=g;exports.getServiceIntervalRange=q;exports.getServiceIntervalsForOrderFormat=c;exports.getOutletFormattedAddress=d;exports.getPartitionedOutletsList=m;exports.getOutletPickerTimesForWeek=T;exports.getOutletPickerTimesForDay=F;exports.getOutletOrderPreparationTime=_;exports.getStructuredOutletAddress=v;exports.getOutletNextOpeningTimeText=p;exports.getOutletCurrentClosingTimeText=f;exports.getOutletNextReadyToOrderTime=A;exports.getOutletNextOpeningTagInformation=y;exports.getOutletCurrentAvailabilityInfo=b;exports.getExpressAvailableOrderFormats=x;exports.getExpressNextAvailabilityShiftTime=P;exports.getOrderFormatAOTipSettings=S.default;exports.isAOTippingEnabledForOrderFormat=I;exports.isMenuTreeHierarchyProductAvailable=D;exports.getOutletMenuProductsSortCriteria=N;exports.getOutletNextServiceTimeOffset=k;
|