@ancon/wildcat-utils 1.43.0-timezone-refactor.2 → 1.43.0-timezone-refactor.4
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/currency/getFormattedCurrency.js +1 -1
- package/currency/getFormattedCurrency.mjs +1 -1
- package/currency/getFormattedCurrencyPostfix.d.ts +1 -1
- package/currency/getFormattedCurrencyPostfix.js +1 -1
- package/currency/getFormattedCurrencyPostfix.mjs +1 -1
- package/currency/index.d.ts +2 -1
- package/currency/index.js +1 -1
- package/currency/index.mjs +4 -3
- package/date/createLocalTimezoneDate.js +1 -1
- package/date/createLocalTimezoneDate.mjs +5 -5
- package/date/createLocalTimezoneMoment.d.ts +9 -0
- package/date/createLocalTimezoneMoment.js +1 -0
- package/date/createLocalTimezoneMoment.mjs +8 -0
- package/date/index.d.ts +2 -1
- package/date/index.js +1 -1
- package/date/index.mjs +3 -1
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +279 -269
- package/license/getLicenseUIState.d.ts +4 -1
- package/license/getLicenseUIState.js +1 -1
- package/license/getLicenseUIState.mjs +17 -5
- package/license/index.d.ts +2 -2
- package/license/index.js +1 -1
- package/license/index.mjs +5 -2
- package/license/types.d.ts +2 -1
- package/license/types.js +1 -1
- package/license/types.mjs +1 -1
- package/outlet/getExpressAvailableOrderFormats.js +1 -1
- package/outlet/getExpressAvailableOrderFormats.mjs +34 -40
- package/outlet/getExpressNextAvailabilityShiftTime.d.ts +2 -2
- package/outlet/getExpressNextAvailabilityShiftTime.js +1 -1
- package/outlet/getExpressNextAvailabilityShiftTime.mjs +15 -22
- package/outlet/getExpressServiceIntervalEnd.d.ts +2 -2
- package/outlet/getExpressServiceIntervalEnd.js +1 -1
- package/outlet/getExpressServiceIntervalEnd.mjs +5 -11
- package/outlet/getExpressServiceIntervalStart.d.ts +2 -2
- package/outlet/getExpressServiceIntervalStart.js +1 -1
- package/outlet/getExpressServiceIntervalStart.mjs +5 -11
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +62 -61
- 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/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +2 -2
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +8 -7
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +2 -2
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +10 -10
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +1 -1
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +1 -1
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +51 -53
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +20 -19
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +16 -18
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +49 -52
- package/package.json +21 -1
- package/ticketItem/index.d.ts +3 -0
- package/ticketItem/index.js +1 -0
- package/ticketItem/index.mjs +7 -0
- package/ticketItem/isTicketItemClosed.d.ts +9 -0
- package/ticketItem/isTicketItemClosed.js +1 -0
- package/ticketItem/isTicketItemClosed.mjs +7 -0
- package/ticketItem/isTicketItemReady.d.ts +6 -0
- package/ticketItem/isTicketItemReady.js +1 -0
- package/ticketItem/isTicketItemReady.mjs +7 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import i from "moment";
|
|
1
|
+
import { DayOfWeek as u, IntervalType as r, IntervalState as m } from "@ancon/wildcat-types";
|
|
3
2
|
import { DaysOfWeekMap as y } from "../shared/constants.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import i from "../date/createLocalTimezoneMoment.mjs";
|
|
4
|
+
import "moment";
|
|
5
|
+
function O(s, c, p) {
|
|
6
|
+
const f = c.reduce(
|
|
6
7
|
(o, e) => {
|
|
7
8
|
if ((e.orderFormat & p) === p)
|
|
8
9
|
switch (e.type) {
|
|
9
10
|
case r.Exception:
|
|
10
11
|
{
|
|
11
|
-
const n = i(
|
|
12
|
-
|
|
12
|
+
const n = i(
|
|
13
|
+
e.periodFrom
|
|
14
|
+
), l = i(e.periodTo);
|
|
15
|
+
s.isBetween(n, l, "day", "[]") && (e.state === m.Closed ? o.closedExceptions.push(e) : o.openExceptions.push(e));
|
|
13
16
|
}
|
|
14
17
|
break;
|
|
15
|
-
case r.
|
|
18
|
+
case r.Normal:
|
|
16
19
|
default:
|
|
17
20
|
// Every day in the week
|
|
18
|
-
(e.dayOfWeek ===
|
|
21
|
+
(e.dayOfWeek === u.Everyday || // Specific day in the week
|
|
19
22
|
e.dayOfWeek === y[s.isoWeekday()]) && o.openIntervals.push(e);
|
|
20
23
|
break;
|
|
21
24
|
}
|
|
@@ -26,8 +29,8 @@ function k(s, f, p) {
|
|
|
26
29
|
openExceptions: [],
|
|
27
30
|
openIntervals: []
|
|
28
31
|
}
|
|
29
|
-
), { closedExceptions:
|
|
30
|
-
if (!
|
|
32
|
+
), { closedExceptions: a, openExceptions: t, openIntervals: d } = f;
|
|
33
|
+
if (!a.length) {
|
|
31
34
|
if (t.length) {
|
|
32
35
|
if (t.length > 1) {
|
|
33
36
|
const [o] = t.sort(
|
|
@@ -37,9 +40,9 @@ function k(s, f, p) {
|
|
|
37
40
|
}
|
|
38
41
|
return t[0];
|
|
39
42
|
}
|
|
40
|
-
return
|
|
43
|
+
return d[0];
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
export {
|
|
44
|
-
|
|
47
|
+
O as default
|
|
45
48
|
};
|
|
@@ -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 o=require("moment"),s=require("@ancon/wildcat-types"),m=60;var u=(e=>(e[e.Today=0]="Today",e[e.Tomorrow=1]="Tomorrow",e))(u||{});function n(e,l,r=!1){let t=null;if(e.openNow&&e.closingTime!==null)(e.closingTime.diff(l,"minutes")<m||r)&&(t={time:e.closingTime.format("LT"),state:s.OutletState.Closed});else if(!e.openNow&&e.openingTime)if(e.openingTime.isSame(l,"d"))t={time:o(e.openingTime).calendar(),state:s.OutletState.Opened};else{const d=o().add(1,"day"),i=o(e.openingTime);i.isSame(d,"d")?t={time:i.format("LT"),state:s.OutletState.Opened,day:1}:i.isAfter(l.clone().add(1,"week"))?t={time:i.format("D MMMM LT"),state:s.OutletState.Opened}:i&&(t={time:i.format("ddd LT"),state:s.OutletState.Opened})}return t}exports.OutletAvailabilityDay=u;exports.default=n;
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OutletState as
|
|
3
|
-
const
|
|
4
|
-
var
|
|
5
|
-
function
|
|
1
|
+
import m from "moment";
|
|
2
|
+
import { OutletState as t } from "@ancon/wildcat-types";
|
|
3
|
+
const r = 60;
|
|
4
|
+
var T = /* @__PURE__ */ ((e) => (e[e.Today = 0] = "Today", e[e.Tomorrow = 1] = "Tomorrow", e))(T || {});
|
|
5
|
+
function p(e, o, l = !1) {
|
|
6
6
|
let s = null;
|
|
7
7
|
if (e.openNow && e.closingTime !== null)
|
|
8
|
-
(e.closingTime.diff(
|
|
9
|
-
time: e.closingTime.
|
|
10
|
-
state:
|
|
8
|
+
(e.closingTime.diff(o, "minutes") < r || l) && (s = {
|
|
9
|
+
time: e.closingTime.format("LT"),
|
|
10
|
+
state: t.Closed
|
|
11
11
|
});
|
|
12
12
|
else if (!e.openNow && e.openingTime)
|
|
13
|
-
if (e.openingTime.isSame(
|
|
13
|
+
if (e.openingTime.isSame(o, "d"))
|
|
14
14
|
s = {
|
|
15
|
-
time:
|
|
16
|
-
state:
|
|
15
|
+
time: m(e.openingTime).calendar(),
|
|
16
|
+
state: t.Opened
|
|
17
17
|
};
|
|
18
18
|
else {
|
|
19
|
-
const d =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
time: f.format("LT"),
|
|
24
|
-
state: i.Opened,
|
|
19
|
+
const d = m().add(1, "day"), i = m(e.openingTime);
|
|
20
|
+
i.isSame(d, "d") ? s = {
|
|
21
|
+
time: i.format("LT"),
|
|
22
|
+
state: t.Opened,
|
|
25
23
|
day: 1
|
|
26
24
|
/* Tomorrow */
|
|
27
|
-
} :
|
|
28
|
-
time:
|
|
29
|
-
state:
|
|
30
|
-
} :
|
|
31
|
-
time:
|
|
32
|
-
state:
|
|
25
|
+
} : i.isAfter(o.clone().add(1, "week")) ? s = {
|
|
26
|
+
time: i.format("D MMMM LT"),
|
|
27
|
+
state: t.Opened
|
|
28
|
+
} : i && (s = {
|
|
29
|
+
time: i.format("ddd LT"),
|
|
30
|
+
state: t.Opened
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
return s;
|
|
36
34
|
}
|
|
37
35
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
T as OutletAvailabilityDay,
|
|
37
|
+
p as default
|
|
40
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("@ancon/wildcat-types"),T=require("moment"),u=require("./getOutletTagInformation.js"),p=require("./getOutletAvailabilityInfo.js");require("../date/
|
|
1
|
+
"use strict";const f=require("@ancon/wildcat-types"),T=require("moment"),u=require("./getOutletTagInformation.js"),p=require("./getOutletAvailabilityInfo.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function a(o,e){let{openingTime:n}=o,{closingTime:i}=o;return!!e.openingTime&&!!e.closingTime?(o.openingTime?o.openingTime.isBetween(e.openingTime,e.closingTime)&&(n=e.openingTime):n=e.openingTime,o.closingTime?o.closingTime.isBetween(e.openingTime,e.closingTime)&&(i=e.closingTime):i=e.closingTime):((!n&&e.openingTime||e.openingTime&&n&&e.openingTime.isBefore(n))&&(n=e.openingTime),!i&&e.closingTime?i=e.closingTime:e.closingTime&&i&&(e.closingTime.isBefore(i)||(i=e.closingTime))),{openingTime:n,closingTime:i}}function d(o){const{serviceDateTimes:e,state:n}=o,i=T(),g=n===f.OutletState.Opened,r=e.reduce((s,l)=>{const m=(l==null?void 0:l.intervals)||[],t=u.default(m,g,i,i);return s?s.openNow&&!t.openNow?s:{...a(s,t),openNow:s.openNow||t.openNow,openDuringSpecifiedTime:s.openDuringSpecifiedTime||t.openDuringSpecifiedTime}:t},void 0);return r?p.default(r,i,!1):null}module.exports=d;
|
|
@@ -2,10 +2,10 @@ import { OutletState as p } from "@ancon/wildcat-types";
|
|
|
2
2
|
import f from "moment";
|
|
3
3
|
import T from "./getOutletTagInformation.mjs";
|
|
4
4
|
import a from "./getOutletAvailabilityInfo.mjs";
|
|
5
|
-
import "../date/
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
6
|
+
import "../time/getTimeSpanParts.mjs";
|
|
6
7
|
import "./constants.mjs";
|
|
7
8
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
8
|
-
import "../time/getTimeSpanParts.mjs";
|
|
9
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
10
10
|
import "./searchNextOpeningMoment.mjs";
|
|
11
11
|
function d(n, i) {
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
"use strict";const t=require("moment"),d=require("./getOutletTodayOpeningTimes.js");require("../_baseIteratee-075c204c.js");require("../_getTag-b8923c48.js");require("../isArray-640f9811.js");require("../_baseIsEqual-bcac9024.js");require("../identity-1bae7cf8.js");require("../toString-9eae9442.js");require("../noop-7ea3b37b.js");require("./getListOutletOpeningHoursTable.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function m(q,c){const n=t(),u=d(q);if(u){const s=u.find(e=>{const r=t(e.start),i=t(e.end);return n.isBetween(r,i)});if(s){const{end:e}=s,r=t(e),i=n.isSame(r,"day"),o=r.format(i?"LT":"ddd LT");return c("untilTime",{time:o})||""}}}module.exports=m;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "moment";
|
|
2
2
|
import c from "./getOutletTodayOpeningTimes.mjs";
|
|
3
3
|
import "../_baseIteratee-4c4d0995.mjs";
|
|
4
4
|
import "../_getTag-4e44633b.mjs";
|
|
@@ -13,19 +13,20 @@ import "../shared/isWithinFlag.mjs";
|
|
|
13
13
|
import "../shared/generateId.mjs";
|
|
14
14
|
import "react";
|
|
15
15
|
import "../time/getTimeSpanParts.mjs";
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
17
|
+
function H(p, d) {
|
|
18
|
+
const n = e(), r = c(p);
|
|
18
19
|
if (r) {
|
|
19
20
|
const m = r.find((t) => {
|
|
20
|
-
const
|
|
21
|
-
return n.isBetween(
|
|
21
|
+
const o = e(t.start), i = e(t.end);
|
|
22
|
+
return n.isBetween(o, i);
|
|
22
23
|
});
|
|
23
24
|
if (m) {
|
|
24
|
-
const { end: t } = m,
|
|
25
|
+
const { end: t } = m, o = e(t), i = n.isSame(o, "day"), s = o.format(i ? "LT" : "ddd LT");
|
|
25
26
|
return d("untilTime", { time: s }) || "";
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
H as default
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("@ancon/wildcat-types"),g=require("moment"),f=require("./getOutletTagInformation.js");require("../date/
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types"),g=require("moment"),f=require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.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,10 +1,10 @@
|
|
|
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/
|
|
4
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
5
|
+
import "../time/getTimeSpanParts.mjs";
|
|
5
6
|
import "./constants.mjs";
|
|
6
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
|
-
import "../time/getTimeSpanParts.mjs";
|
|
8
8
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
9
9
|
import "./searchNextOpeningMoment.mjs";
|
|
10
10
|
function N(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const i=require("moment"),o=require("./getOutletNextOpeningTagInformation.js");require("@ancon/wildcat-types");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function u(t,r){const e=o(t);if(e&&!e.openNow&&e.openingTime){const n=i(e.openingTime).calendar({sameDay:"[Today] [at] LT",nextDay:"[Tomorrow] [at] LT",nextWeek:"ddd [at] LT"});return r("openingTime",{time:n})}return null}module.exports=u;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import i from "moment";
|
|
2
|
+
import m from "./getOutletNextOpeningTagInformation.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "./getOutletTagInformation.mjs";
|
|
5
|
-
import "../date/
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
6
|
+
import "../time/getTimeSpanParts.mjs";
|
|
6
7
|
import "./constants.mjs";
|
|
7
8
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
8
|
-
import "../time/getTimeSpanParts.mjs";
|
|
9
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
10
10
|
import "./searchNextOpeningMoment.mjs";
|
|
11
|
-
function
|
|
12
|
-
const
|
|
11
|
+
function c(e, o) {
|
|
12
|
+
const t = m(e);
|
|
13
13
|
if (t && !t.openNow && t.openingTime) {
|
|
14
|
-
const
|
|
14
|
+
const n = i(t.openingTime).calendar({
|
|
15
15
|
sameDay: "[Today] [at] LT",
|
|
16
16
|
nextDay: "[Tomorrow] [at] LT",
|
|
17
17
|
nextWeek: "ddd [at] LT"
|
|
18
18
|
});
|
|
19
|
-
return
|
|
20
|
-
time:
|
|
19
|
+
return o("openingTime", {
|
|
20
|
+
time: n
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
c as default
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/createLocalTimezoneMoment.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=_;
|
|
@@ -6,7 +6,7 @@ import T from "./isOutletAcceptingPreOrders.mjs";
|
|
|
6
6
|
import S from "./getOutletTagInformation.mjs";
|
|
7
7
|
import v from "./getNextTenthMinute.mjs";
|
|
8
8
|
import x from "./getServiceIntervalsForOrderFormat.mjs";
|
|
9
|
-
import "../date/
|
|
9
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
10
10
|
import "./constants.mjs";
|
|
11
11
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
12
12
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/createLocalTimezoneMoment.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;
|
|
@@ -7,7 +7,7 @@ import T from "./generatePickerTimesForDay.mjs";
|
|
|
7
7
|
import F from "./getServiceIntervalEnd.mjs";
|
|
8
8
|
import x from "./getOutletNextReadyToOrderTime.mjs";
|
|
9
9
|
import "../shared/constants.mjs";
|
|
10
|
-
import "../date/
|
|
10
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
11
11
|
import "./getServiceIntervalsForOrderFormat.mjs";
|
|
12
12
|
import "../time/getTimeSpanParts.mjs";
|
|
13
13
|
import "./getNextTenthMinute.mjs";
|
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/createLocalTimezoneMoment.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;
|
|
@@ -6,7 +6,7 @@ import "../time/getTimeSpanParts.mjs";
|
|
|
6
6
|
import "./getSettingsForOrderFormat.mjs";
|
|
7
7
|
import "./isOutletAcceptingPreOrders.mjs";
|
|
8
8
|
import "./getOutletTagInformation.mjs";
|
|
9
|
-
import "../date/
|
|
9
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
10
10
|
import "./constants.mjs";
|
|
11
11
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
12
12
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@ancon/wildcat-types"),x=require("moment"),u=require("../date/createLocalTimezoneMoment.js"),D=require("../time/getTimeSpanParts.js"),d=require("./constants.js"),M=require("./getOutletCurrentActiveOperatingHour.js"),k=require("./getMomentFromDateAndTimeString.js"),S=require("./searchNextOpeningMoment.js"),O={0:127,1:1,2:2,3:4,4:8,5:16,6:32,7:64};function T(n,e){const o=n.isSame(e,"d"),a={[e.format(d.OutletMapKeyFormatter)]:{intervals:[],exception:null,metadata:{dayOfWeek:O[e.isoWeekday()]}}};for(let s=o?1:0;s<d.OutletTimelineDayCount;s+=1){const i=x(n).add(s,"d");a[i.format(d.OutletMapKeyFormatter)]={intervals:[],exception:null,metadata:{dayOfWeek:O[i.isoWeekday()]}}}return a}function W(n,e){const o=u(e.periodFrom),t=u(e.periodTo);if(!o.isSame(t,"d"))Object.keys(n).forEach(s=>{const i=x(s);if(i.isSame(o,"d")||i.isSame(t,"d")||i.isBetween(o,t)){const c=n[s],r=c.exception?c.exception.position:0;e.position>r&&(c.exception=e)}});else{const s=o.format(d.OutletMapKeyFormatter),i=n[s];if(i){const m=i.exception?i.exception.position:0;e.position>m&&(i.exception=e)}}}function q(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 E(n,e,o){const t=T(e,o);return n.forEach(a=>{a.type===v.IntervalType.Exception?W(t,a):q(t,a)}),t}function g(n,e,o,t){const a=E(n,o,t),s=t.format(d.OutletMapKeyFormatter),i=M(s,a[s],t)!==null,m=e;let c=null,r=null;if(e){const f=o.format(d.OutletMapKeyFormatter),l=M(f,a[f],o);if(l){const{hours:p,minutes:y}=D(l.duration);r=k(f,l.from),c=r.clone().add(p,"hours").add(y,"minutes")}}else r=S(a,o);if(!e&&!r){const f=n.filter(p=>p.state&&u(p.periodTo).isAfter(o)),[l]=f.sort((p,y)=>t.valueOf()-(u(p.periodTo).valueOf()-u(y.periodTo).valueOf()));if(l)return g(n,e,u(l.periodTo),t)}return{closingTime:c,openingTime:r,openDuringSpecifiedTime:m,openNow:i}}exports.DaysOfWeekMap=O;exports.default=g;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IntervalType as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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";
|
|
6
7
|
import k from "./getMomentFromDateAndTimeString.mjs";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
const D = {
|
|
8
|
+
import S from "./searchNextOpeningMoment.mjs";
|
|
9
|
+
const x = {
|
|
10
10
|
0: 127,
|
|
11
11
|
1: 1,
|
|
12
12
|
2: 2,
|
|
@@ -18,44 +18,42 @@ const D = {
|
|
|
18
18
|
// WEEKDAYS: 31,
|
|
19
19
|
// WEEKENDS: 96,
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function T(n, e) {
|
|
22
22
|
const o = n.isSame(e, "d"), a = {
|
|
23
|
-
[e.format(
|
|
23
|
+
[e.format(d)]: {
|
|
24
24
|
intervals: [],
|
|
25
25
|
exception: null,
|
|
26
|
-
metadata: { dayOfWeek:
|
|
26
|
+
metadata: { dayOfWeek: x[e.isoWeekday()] }
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
for (let s = o ? 1 : 0; s <
|
|
30
|
-
const i =
|
|
31
|
-
a[i.format(
|
|
29
|
+
for (let s = o ? 1 : 0; s < M; s += 1) {
|
|
30
|
+
const i = g(n).add(s, "d");
|
|
31
|
+
a[i.format(d)] = {
|
|
32
32
|
intervals: [],
|
|
33
33
|
exception: null,
|
|
34
|
-
metadata: { dayOfWeek:
|
|
34
|
+
metadata: { dayOfWeek: x[i.isoWeekday()] }
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
return a;
|
|
38
38
|
}
|
|
39
39
|
function W(n, e) {
|
|
40
|
-
const o =
|
|
41
|
-
f(e.periodFrom)
|
|
42
|
-
), t = r(f(e.periodTo));
|
|
40
|
+
const o = l(e.periodFrom), t = l(e.periodTo);
|
|
43
41
|
if (!o.isSame(
|
|
44
42
|
t,
|
|
45
43
|
"d"
|
|
46
44
|
))
|
|
47
45
|
Object.keys(n).forEach((s) => {
|
|
48
|
-
const i =
|
|
46
|
+
const i = g(s);
|
|
49
47
|
if (i.isSame(o, "d") || i.isSame(t, "d") || i.isBetween(o, t)) {
|
|
50
|
-
const
|
|
51
|
-
e.position >
|
|
48
|
+
const p = n[s], r = p.exception ? p.exception.position : 0;
|
|
49
|
+
e.position > r && (p.exception = e);
|
|
52
50
|
}
|
|
53
51
|
});
|
|
54
52
|
else {
|
|
55
|
-
const s = o.format(
|
|
53
|
+
const s = o.format(d), i = n[s];
|
|
56
54
|
if (i) {
|
|
57
|
-
const
|
|
58
|
-
e.position >
|
|
55
|
+
const u = i.exception ? i.exception.position : 0;
|
|
56
|
+
e.position > u && (i.exception = e);
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
}
|
|
@@ -66,56 +64,56 @@ function E(n, e) {
|
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
66
|
function I(n, e, o) {
|
|
69
|
-
const t =
|
|
67
|
+
const t = T(e, o);
|
|
70
68
|
return n.forEach((a) => {
|
|
71
|
-
a.type ===
|
|
69
|
+
a.type === v.Exception ? W(t, a) : E(t, a);
|
|
72
70
|
}), t;
|
|
73
71
|
}
|
|
74
|
-
function
|
|
72
|
+
function h(n, e, o, t) {
|
|
75
73
|
const a = I(
|
|
76
74
|
n,
|
|
77
75
|
o,
|
|
78
76
|
t
|
|
79
|
-
), s = t.format(
|
|
77
|
+
), s = t.format(d), i = O(
|
|
80
78
|
s,
|
|
81
79
|
a[s],
|
|
82
80
|
t
|
|
83
|
-
) !== null,
|
|
84
|
-
let
|
|
81
|
+
) !== null, u = e;
|
|
82
|
+
let p = null, r = null;
|
|
85
83
|
if (e) {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
a[
|
|
84
|
+
const f = o.format(d), c = O(
|
|
85
|
+
f,
|
|
86
|
+
a[f],
|
|
89
87
|
o
|
|
90
88
|
);
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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");
|
|
97
97
|
}
|
|
98
98
|
} else
|
|
99
|
-
|
|
100
|
-
if (!e && !
|
|
101
|
-
const
|
|
102
|
-
(m) => m.state &&
|
|
103
|
-
|
|
104
|
-
)
|
|
105
|
-
), [l] = d.sort(
|
|
106
|
-
(m, O) => t.valueOf() - (r(f(m.periodTo)).valueOf() - r(f(O.periodTo)).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())
|
|
107
105
|
);
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
106
|
+
if (c)
|
|
107
|
+
return h(
|
|
110
108
|
n,
|
|
111
109
|
e,
|
|
112
|
-
|
|
110
|
+
l(c.periodTo),
|
|
113
111
|
t
|
|
114
112
|
);
|
|
115
113
|
}
|
|
116
|
-
return { closingTime:
|
|
114
|
+
return { closingTime: p, openingTime: r, openDuringSpecifiedTime: u, openNow: i };
|
|
117
115
|
}
|
|
118
116
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
x as DaysOfWeekMap,
|
|
118
|
+
h as default
|
|
121
119
|
};
|
|
@@ -1 +1 @@
|
|
|
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");function p(e,n,t,i){for(var r=e.length,
|
|
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;
|
|
@@ -12,10 +12,11 @@ import "../shared/isWithinFlag.mjs";
|
|
|
12
12
|
import "../shared/generateId.mjs";
|
|
13
13
|
import "react";
|
|
14
14
|
import "../time/getTimeSpanParts.mjs";
|
|
15
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
15
16
|
function S(n, e, t, i) {
|
|
16
|
-
for (var r = n.length,
|
|
17
|
-
if (e(n[
|
|
18
|
-
return
|
|
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;
|
|
19
20
|
return -1;
|
|
20
21
|
}
|
|
21
22
|
function T(n) {
|
|
@@ -46,45 +47,45 @@ var W = 1 / 0, k = c && 1 / m(new c([, -0]))[1] == W ? function(n) {
|
|
|
46
47
|
const q = k;
|
|
47
48
|
var v = 200;
|
|
48
49
|
function C(n, e, t) {
|
|
49
|
-
var i = -1, r = H,
|
|
50
|
+
var i = -1, r = H, o = n.length, h = !0, u = [], s = u;
|
|
50
51
|
if (t)
|
|
51
52
|
h = !1, r = N;
|
|
52
|
-
else if (
|
|
53
|
+
else if (o >= v) {
|
|
53
54
|
var p = e ? null : q(n);
|
|
54
55
|
if (p)
|
|
55
56
|
return m(p);
|
|
56
|
-
h = !1, r = b,
|
|
57
|
+
h = !1, r = b, s = new a();
|
|
57
58
|
} else
|
|
58
|
-
|
|
59
|
+
s = e ? [] : u;
|
|
59
60
|
n:
|
|
60
|
-
for (; ++i <
|
|
61
|
+
for (; ++i < o; ) {
|
|
61
62
|
var f = n[i], l = e ? e(f) : f;
|
|
62
63
|
if (f = t || f !== 0 ? f : 0, h && l === l) {
|
|
63
|
-
for (var g =
|
|
64
|
-
if (
|
|
64
|
+
for (var g = s.length; g--; )
|
|
65
|
+
if (s[g] === l)
|
|
65
66
|
continue n;
|
|
66
|
-
e &&
|
|
67
|
+
e && s.push(l), u.push(f);
|
|
67
68
|
} else
|
|
68
|
-
r(
|
|
69
|
+
r(s, l, t) || (s !== u && s.push(l), u.push(f));
|
|
69
70
|
}
|
|
70
71
|
return u;
|
|
71
72
|
}
|
|
72
73
|
function E(n, e) {
|
|
73
74
|
return n && n.length ? C(n, I(e)) : [];
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function K(n) {
|
|
76
77
|
const e = O(n), i = d().isoWeekday(), r = e.reduce(
|
|
77
|
-
(
|
|
78
|
-
var
|
|
79
|
-
const u = (
|
|
78
|
+
(o, { openingHours: h }) => {
|
|
79
|
+
var s;
|
|
80
|
+
const u = (s = h.find(
|
|
80
81
|
(p) => p.isoWeekday === i
|
|
81
|
-
)) == null ? void 0 :
|
|
82
|
-
return u &&
|
|
82
|
+
)) == null ? void 0 : s.open;
|
|
83
|
+
return u && o.push(...u), o;
|
|
83
84
|
},
|
|
84
85
|
[]
|
|
85
86
|
);
|
|
86
87
|
return r ? E(r, ["start", "end"]) : null;
|
|
87
88
|
}
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
+
K as default
|
|
90
91
|
};
|
|
@@ -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;
|