@ancon/wildcat-utils 1.42.0 → 1.43.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/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/index.d.ts +2 -0
- package/date/index.js +1 -0
- package/date/index.mjs +5 -0
- package/error/index.d.ts +3 -1
- package/error/index.js +1 -1
- package/error/index.mjs +16 -12
- package/error/isBadGatewayError.d.ts +3 -0
- package/error/isBadGatewayError.js +1 -0
- package/error/isBadGatewayError.mjs +8 -0
- package/error/isServiceUnavailableError.d.ts +3 -0
- package/error/isServiceUnavailableError.js +1 -0
- package/error/isServiceUnavailableError.mjs +8 -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 +162 -140
- 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/getListOutletOpeningHoursTable.d.ts +1 -1
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +134 -150
- package/outlet/getMomentFromDateAndTimeString.js +1 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +1 -1
- package/outlet/getOutletActiveOpeningInterval.d.ts +2 -2
- package/outlet/getOutletAvailabilityInfo.js +1 -1
- package/outlet/getOutletAvailabilityInfo.mjs +8 -8
- 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 +13 -10
- package/outlet/getOutletDeliveryFee.js +1 -1
- package/outlet/getOutletDeliveryFee.mjs +5 -5
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +8 -7
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +4 -2
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +18 -21
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +39 -39
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +8 -6
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +68 -67
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +37 -34
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +4 -4
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +24 -14
- 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 +70 -66
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +52 -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 +21 -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,45 +1,46 @@
|
|
|
1
1
|
import { OutletState as p } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import f from "moment";
|
|
3
|
+
import T from "./getOutletTagInformation.mjs";
|
|
4
|
+
import a from "./getOutletAvailabilityInfo.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneDate.mjs";
|
|
5
6
|
import "./constants.mjs";
|
|
6
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
8
|
+
import "../time/getTimeSpanParts.mjs";
|
|
7
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
8
10
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
10
|
-
let { openingTime:
|
|
11
|
-
return !!i.openingTime && !!i.closingTime ? (
|
|
11
|
+
function d(n, i) {
|
|
12
|
+
let { openingTime: o } = n, { closingTime: e } = n;
|
|
13
|
+
return !!i.openingTime && !!i.closingTime ? (n.openingTime ? n.openingTime.isBetween(
|
|
12
14
|
i.openingTime,
|
|
13
15
|
i.closingTime
|
|
14
|
-
) && (
|
|
16
|
+
) && (o = i.openingTime) : o = i.openingTime, n.closingTime ? n.closingTime.isBetween(
|
|
15
17
|
i.openingTime,
|
|
16
18
|
i.closingTime
|
|
17
|
-
) && (
|
|
18
|
-
openingTime:
|
|
19
|
-
closingTime:
|
|
19
|
+
) && (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))), {
|
|
20
|
+
openingTime: o,
|
|
21
|
+
closingTime: e
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
const { serviceDateTimes: i, state:
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n
|
|
24
|
+
function y(n) {
|
|
25
|
+
const { serviceDateTimes: i, state: o } = n, e = f(), g = o === p.Opened, s = i.reduce((m, r) => {
|
|
26
|
+
const l = (r == null ? void 0 : r.intervals) || [], t = T(
|
|
27
|
+
l,
|
|
28
|
+
g,
|
|
29
|
+
e,
|
|
30
|
+
e
|
|
30
31
|
);
|
|
31
|
-
return
|
|
32
|
-
...
|
|
33
|
-
openNow:
|
|
34
|
-
openDuringSpecifiedTime:
|
|
32
|
+
return m ? m.openNow && !t.openNow ? m : {
|
|
33
|
+
...d(m, t),
|
|
34
|
+
openNow: m.openNow || t.openNow,
|
|
35
|
+
openDuringSpecifiedTime: m.openDuringSpecifiedTime || t.openDuringSpecifiedTime
|
|
35
36
|
} : t;
|
|
36
37
|
}, void 0);
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
return s ? a(
|
|
39
|
+
s,
|
|
40
|
+
e,
|
|
40
41
|
!1
|
|
41
42
|
) : null;
|
|
42
43
|
}
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
y as default
|
|
45
46
|
};
|
|
@@ -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");function m(c,q){const i=t(),u=d(c);if(u){const s=u.find(e=>{const r=t(e.start),n=t(e.end);return i.isBetween(r,n)});if(s){const{end:e}=s,r=t(e),n=i.isSame(r,"day"),o=r.format(n?"LT":"ddd LT");return q("untilTime",{time:o})||""}}}module.exports=m;
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o 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
|
+
function D(p, d) {
|
|
17
|
+
const n = o(), r = c(p);
|
|
15
18
|
if (r) {
|
|
16
19
|
const m = r.find((t) => {
|
|
17
|
-
const e =
|
|
18
|
-
return
|
|
20
|
+
const e = o(t.start), i = o(t.end);
|
|
21
|
+
return n.isBetween(e, i);
|
|
19
22
|
});
|
|
20
23
|
if (m) {
|
|
21
|
-
const { end: t } = m, e =
|
|
24
|
+
const { end: t } = m, e = o(t), i = n.isSame(e, "day"), s = e.format(i ? "LT" : "ddd LT");
|
|
22
25
|
return d("untilTime", { time: s }) || "";
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
D as default
|
|
28
31
|
};
|
|
@@ -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 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types"),g=require("moment"),f=require("./getOutletTagInformation.js");require("../date/createLocalTimezoneDate.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("../time/getTimeSpanParts.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function m(o){const r=g();return o.serviceDateTimes.reduce((e,t)=>{const i=(t==null?void 0:t.intervals)||[],n=f.default(i,o.state===s.OutletState.Opened,r,r);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=m;
|
|
@@ -1,19 +1,20 @@
|
|
|
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/createLocalTimezoneDate.mjs";
|
|
4
5
|
import "./constants.mjs";
|
|
5
6
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
|
+
import "../time/getTimeSpanParts.mjs";
|
|
6
8
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
7
9
|
import "./searchNextOpeningMoment.mjs";
|
|
8
10
|
function N(e) {
|
|
9
|
-
const
|
|
10
|
-
return e.serviceDateTimes.reduce((n,
|
|
11
|
-
const r = (
|
|
11
|
+
const i = f();
|
|
12
|
+
return e.serviceDateTimes.reduce((n, t) => {
|
|
13
|
+
const r = (t == null ? void 0 : t.intervals) || [], o = g(
|
|
12
14
|
r,
|
|
13
|
-
e.state === p.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
e == null ? void 0 : e.timeZoneOffset
|
|
15
|
+
e.state === p.Opened,
|
|
16
|
+
i,
|
|
17
|
+
i
|
|
17
18
|
);
|
|
18
19
|
if (!n && !o.openNow)
|
|
19
20
|
return o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("moment"),u=require("./getOutletNextOpeningTagInformation.js");require("@ancon/wildcat-types");require("./getOutletTagInformation.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function a(n,r){const
|
|
1
|
+
"use strict";const t=require("moment"),u=require("./getOutletNextOpeningTagInformation.js");require("@ancon/wildcat-types");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneDate.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("../time/getTimeSpanParts.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function a(n,r){const i=t(),e=u(n);if(e&&!e.openNow&&e.openingTime){const o=t(e.openingTime).utcOffset(i.utcOffset()).calendar({sameDay:"[Today] [at] LT",nextDay:"[Tomorrow] [at] LT",nextWeek:"ddd [at] LT"});return r("openingTime",{time:o})}return null}module.exports=a;
|
|
@@ -2,11 +2,13 @@ import e from "moment";
|
|
|
2
2
|
import r from "./getOutletNextOpeningTagInformation.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "./getOutletTagInformation.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneDate.mjs";
|
|
5
6
|
import "./constants.mjs";
|
|
6
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
8
|
+
import "../time/getTimeSpanParts.mjs";
|
|
7
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
8
10
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
11
|
+
function x(o, n) {
|
|
10
12
|
const i = e(), t = r(o);
|
|
11
13
|
if (t && !t.openNow && t.openingTime) {
|
|
12
14
|
const m = e(t.openingTime).utcOffset(i.utcOffset()).calendar({
|
|
@@ -21,5 +23,5 @@ function s(o, n) {
|
|
|
21
23
|
return null;
|
|
22
24
|
}
|
|
23
25
|
export {
|
|
24
|
-
|
|
26
|
+
x as default
|
|
25
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const O=require("@ancon/wildcat-types"),r=require("moment"),p=require("../time/getTimeSpanParts.js"),q=require("./getSettingsForOrderFormat.js"),u=require("./isOutletAcceptingPreOrders.js"),T=require("./getOutletTagInformation.js"),f=require("./getNextTenthMinute.js"),S=require("./getServiceIntervalsForOrderFormat.js");require("../date/createLocalTimezoneDate.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function _(e,i){const t=(e==null?void 0:e.state)===O.OutletState.Opened,{preparationTime:s="00:00:00"}=q(i,e==null?void 0:e.orderFormatSettings)??{},g=u((e==null?void 0:e.orderFormatSettings)||[]),m=S(i,(e==null?void 0:e.serviceDateTimes)||[]),c=T.default(m,t,r(),r()),d=!t&&g&&c.openingTime?c.openingTime:void 0,o=r(),a=r(d),n=(o>a?o:a).second(0).millisecond(0);return s&&n.add(p(s)),n.minute(f(n))}module.exports=_;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import { OutletState as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { OutletState as d } from "@ancon/wildcat-types";
|
|
2
|
+
import i from "moment";
|
|
3
|
+
import f from "../time/getTimeSpanParts.mjs";
|
|
4
|
+
import O from "./getSettingsForOrderFormat.mjs";
|
|
5
|
+
import T from "./isOutletAcceptingPreOrders.mjs";
|
|
6
|
+
import S from "./getOutletTagInformation.mjs";
|
|
7
|
+
import v from "./getNextTenthMinute.mjs";
|
|
8
|
+
import x from "./getServiceIntervalsForOrderFormat.mjs";
|
|
9
|
+
import "../date/createLocalTimezoneDate.mjs";
|
|
8
10
|
import "./constants.mjs";
|
|
9
11
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
10
12
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
11
13
|
import "./searchNextOpeningMoment.mjs";
|
|
12
|
-
function
|
|
13
|
-
const m = (r == null ? void 0 : r.state) ===
|
|
14
|
+
function j(r, e) {
|
|
15
|
+
const m = (r == null ? void 0 : r.state) === d.Opened, { preparationTime: t = "00:00:00" } = O(e, r == null ? void 0 : r.orderFormatSettings) ?? {}, a = T(
|
|
14
16
|
(r == null ? void 0 : r.orderFormatSettings) || []
|
|
15
|
-
), c =
|
|
17
|
+
), c = x(
|
|
16
18
|
e,
|
|
17
19
|
(r == null ? void 0 : r.serviceDateTimes) || []
|
|
18
|
-
),
|
|
20
|
+
), o = S(
|
|
19
21
|
c,
|
|
20
22
|
m,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (o) {
|
|
26
|
-
const [f, g] = o.split(":").map(Number);
|
|
27
|
-
i.add(f, "hour").add(g, "minute");
|
|
28
|
-
}
|
|
29
|
-
return i.minute(F(i));
|
|
23
|
+
i(),
|
|
24
|
+
i()
|
|
25
|
+
), g = !m && a && o.openingTime ? o.openingTime : void 0, s = i(), p = i(g), n = (s > p ? s : p).second(0).millisecond(0);
|
|
26
|
+
return t && n.add(f(t)), n.minute(v(n));
|
|
30
27
|
}
|
|
31
28
|
export {
|
|
32
|
-
|
|
29
|
+
j as default
|
|
33
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const f=require("@ancon/wildcat-types"),g=require("moment"),O=require("./getPickerIntervalsForDay.js"),S=require("./getSettingsForOrderFormat.js"),h=require("./getServiceIntervalStart.js"),D=require("./generatePickerTimesForDay.js"),T=require("./getServiceIntervalEnd.js"),_=require("./getOutletNextReadyToOrderTime.js");require("../shared/constants.js");require("../date/createLocalTimezoneDate.js");require("./getServiceIntervalsForOrderFormat.js");require("../time/getTimeSpanParts.js");require("./getNextTenthMinute.js");require("./hoursAndMinutesToMinutes.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function k(e,o,l,m){const{preparationTime:u="00:00:00"}=S(o,e==null?void 0:e.orderFormatSettings)??{},i=_(e,o);let a=i.clone();const s=g(l);if(s>i)a=i.clone().set({year:s.year(),month:s.month(),date:s.date()});else if(i.diff(s,"day")>0)return[];let t=[];const p=O(a,e==null?void 0:e.serviceDateTimes,o);let d;return p.forEach(r=>{!d&&r.type&&(t=[]);const c=h(a,r,u),y=T(a,r,u);c<i&&c.add(i.valueOf()-c.valueOf(),"millisecond");const n=D(c,y,t,void 0,m);n.length>0&&r.state===f.IntervalState.Closed?t=t.filter(q=>q.timestamp<n[0].timestamp||q.timestamp>n[n.length-1].timestamp):n.length>0&&r.state===f.IntervalState.Opened&&(t=t.concat(n)),d=r.type}),t}module.exports=k;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { IntervalState as d } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
2
|
+
import h from "moment";
|
|
3
|
+
import D from "./getPickerIntervalsForDay.mjs";
|
|
4
|
+
import S from "./getSettingsForOrderFormat.mjs";
|
|
5
|
+
import k from "./getServiceIntervalStart.mjs";
|
|
6
|
+
import T from "./generatePickerTimesForDay.mjs";
|
|
7
|
+
import F from "./getServiceIntervalEnd.mjs";
|
|
8
|
+
import x from "./getOutletNextReadyToOrderTime.mjs";
|
|
9
9
|
import "../shared/constants.mjs";
|
|
10
|
+
import "../date/createLocalTimezoneDate.mjs";
|
|
10
11
|
import "./getServiceIntervalsForOrderFormat.mjs";
|
|
12
|
+
import "../time/getTimeSpanParts.mjs";
|
|
11
13
|
import "./getNextTenthMinute.mjs";
|
|
12
14
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
13
15
|
import "./isOutletAcceptingPreOrders.mjs";
|
|
@@ -16,54 +18,52 @@ import "./constants.mjs";
|
|
|
16
18
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
17
19
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
18
20
|
import "./searchNextOpeningMoment.mjs";
|
|
19
|
-
function
|
|
20
|
-
const { preparationTime: f = "00:00:00" } =
|
|
21
|
+
function Q(t, n, y, g) {
|
|
22
|
+
const { preparationTime: f = "00:00:00" } = S(n, t == null ? void 0 : t.orderFormatSettings) ?? {}, i = x(t, n);
|
|
21
23
|
let a = i.clone();
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
+
const o = h(y);
|
|
25
|
+
if (o > i)
|
|
24
26
|
a = i.clone().set({
|
|
25
|
-
year:
|
|
26
|
-
month:
|
|
27
|
-
date:
|
|
27
|
+
year: o.year(),
|
|
28
|
+
month: o.month(),
|
|
29
|
+
date: o.date()
|
|
28
30
|
});
|
|
29
|
-
else if (i.diff(
|
|
31
|
+
else if (i.diff(o, "day") > 0)
|
|
30
32
|
return [];
|
|
31
|
-
let
|
|
32
|
-
const
|
|
33
|
+
let e = [];
|
|
34
|
+
const l = D(
|
|
33
35
|
a,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
t == null ? void 0 : t.serviceDateTimes,
|
|
37
|
+
n
|
|
36
38
|
);
|
|
37
39
|
let s;
|
|
38
|
-
return
|
|
39
|
-
!s &&
|
|
40
|
-
const
|
|
40
|
+
return l.forEach((r) => {
|
|
41
|
+
!s && r.type && (e = []);
|
|
42
|
+
const p = k(
|
|
41
43
|
a,
|
|
42
|
-
|
|
43
|
-
f
|
|
44
|
-
|
|
45
|
-
), h = x(
|
|
44
|
+
r,
|
|
45
|
+
f
|
|
46
|
+
), O = F(
|
|
46
47
|
a,
|
|
47
|
-
|
|
48
|
-
f
|
|
49
|
-
e == null ? void 0 : e.timeZoneOffset
|
|
48
|
+
r,
|
|
49
|
+
f
|
|
50
50
|
);
|
|
51
|
-
|
|
52
|
-
i.valueOf() -
|
|
51
|
+
p < i && p.add(
|
|
52
|
+
i.valueOf() - p.valueOf(),
|
|
53
53
|
"millisecond"
|
|
54
54
|
);
|
|
55
|
-
const m =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const m = T(
|
|
56
|
+
p,
|
|
57
|
+
O,
|
|
58
|
+
e,
|
|
59
59
|
void 0,
|
|
60
60
|
g
|
|
61
61
|
);
|
|
62
|
-
m.length > 0 &&
|
|
62
|
+
m.length > 0 && r.state === d.Closed ? e = e.filter(
|
|
63
63
|
(c) => c.timestamp < m[0].timestamp || c.timestamp > m[m.length - 1].timestamp
|
|
64
|
-
) : m.length > 0 &&
|
|
65
|
-
}),
|
|
64
|
+
) : m.length > 0 && r.state === d.Opened && (e = e.concat(m)), s = r.type;
|
|
65
|
+
}), e;
|
|
66
66
|
}
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
Q as default
|
|
69
69
|
};
|
|
@@ -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("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");require("./getNextTenthMinute.js");require("./getServiceIntervalsForOrderFormat.js");require("./getPickerIntervalsForDay.js");require("../shared/constants.js");require("./getServiceIntervalStart.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;
|
|
1
|
+
"use strict";const n=require("./getOutletNextReadyToOrderTime.js"),l=require("./getOutletPickerTimesForDay.js");require("@ancon/wildcat-types");require("moment");require("../time/getTimeSpanParts.js");require("./getSettingsForOrderFormat.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneDate.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");require("./getNextTenthMinute.js");require("./getServiceIntervalsForOrderFormat.js");require("./getPickerIntervalsForDay.js");require("../shared/constants.js");require("./getServiceIntervalStart.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;
|
|
@@ -2,9 +2,11 @@ import s from "./getOutletNextReadyToOrderTime.mjs";
|
|
|
2
2
|
import u from "./getOutletPickerTimesForDay.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "moment";
|
|
5
|
+
import "../time/getTimeSpanParts.mjs";
|
|
5
6
|
import "./getSettingsForOrderFormat.mjs";
|
|
6
7
|
import "./isOutletAcceptingPreOrders.mjs";
|
|
7
8
|
import "./getOutletTagInformation.mjs";
|
|
9
|
+
import "../date/createLocalTimezoneDate.mjs";
|
|
8
10
|
import "./constants.mjs";
|
|
9
11
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
10
12
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
@@ -17,14 +19,14 @@ import "./getServiceIntervalStart.mjs";
|
|
|
17
19
|
import "./generatePickerTimesForDay.mjs";
|
|
18
20
|
import "./getServiceIntervalEnd.mjs";
|
|
19
21
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
20
|
-
function
|
|
21
|
-
const m = s(r,
|
|
22
|
+
function z(r, o, p) {
|
|
23
|
+
const m = s(r, o), i = [], e = m.clone();
|
|
22
24
|
for (let t = 0; t < 7; t += 1)
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
+
i.push(e.clone()), e.add(1, "day");
|
|
26
|
+
return i.reduce((t, c) => {
|
|
25
27
|
const n = u(
|
|
26
28
|
r,
|
|
27
|
-
|
|
29
|
+
o,
|
|
28
30
|
c,
|
|
29
31
|
p
|
|
30
32
|
);
|
|
@@ -32,5 +34,5 @@ function q(r, e, p) {
|
|
|
32
34
|
}, []).filter((t) => t.length > 0);
|
|
33
35
|
}
|
|
34
36
|
export {
|
|
35
|
-
|
|
37
|
+
z as default
|
|
36
38
|
};
|
|
@@ -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
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@ancon/wildcat-types"),r=require("moment"),d=require("../date/createLocalTimezoneDate.js"),f=require("./constants.js"),x=require("./getOutletCurrentActiveOperatingHour.js"),D=require("./getMomentFromDateAndTimeString.js"),k=require("./searchNextOpeningMoment.js");require("../time/getTimeSpanParts.js");const M={0:127,1:1,2:2,3:4,4:8,5:16,6:32,7:64};function S(n,e){const o=n.isSame(e,"d"),a={[e.format(f.OutletMapKeyFormatter)]:{intervals:[],exception:null,metadata:{dayOfWeek:M[e.isoWeekday()]}}};for(let s=o?1:0;s<f.OutletTimelineDayCount;s+=1){const i=r(n).add(s,"d");a[i.format(f.OutletMapKeyFormatter)]={intervals:[],exception:null,metadata:{dayOfWeek:M[i.isoWeekday()]}}}return a}function T(n,e){const o=r(d(e.periodFrom)),t=r(d(e.periodTo));if(!o.isSame(t,"d"))Object.keys(n).forEach(s=>{const i=r(s);if(i.isSame(o,"d")||i.isSame(t,"d")||i.isBetween(o,t)){const l=n[s],c=l.exception?l.exception.position:0;e.position>c&&(l.exception=e)}});else{const s=o.format(f.OutletMapKeyFormatter),i=n[s];if(i){const y=i.exception?i.exception.position:0;e.position>y&&(i.exception=e)}}}function W(n,e){Object.keys(n).forEach(o=>{const t=n[o],{dayOfWeek:a}=t.metadata,{dayOfWeek:s}=e;(a&s)===a&&t.intervals.push(e)})}function q(n,e,o){const t=S(e,o);return n.forEach(a=>{a.type===v.IntervalType.Exception?T(t,a):W(t,a)}),t}function g(n,e,o,t){const a=q(n,o,t),s=t.format(f.OutletMapKeyFormatter),i=x(s,a[s],t)!==null,y=e;let l=null,c=null;if(e){const m=o.format(f.OutletMapKeyFormatter),p=x(m,a[m],o);if(p){const[u,O]=p.duration.split(":").map(Number);c=D(m,p.from),l=c.clone().add(u,"hours").add(O,"minutes")}}else c=k(a,o);if(!e&&!c){const m=n.filter(u=>u.state&&r(d(u.periodTo)).isAfter(o)),[p]=m.sort((u,O)=>t.valueOf()-(r(d(u.periodTo)).valueOf()-r(d(O.periodTo)).valueOf()));if(p)return g(n,e,r(d(p.periodTo)),t)}return{closingTime:l,openingTime:c,openDuringSpecifiedTime:y,openNow:i}}exports.DaysOfWeekMap=M;exports.default=g;
|