@loczer/storefront-sdk 0.218.0 → 0.220.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/BookingFlowPageLayout/index.d.ts +13 -0
  2. package/dist/components/BookingFlowPageLayout/index.d.ts.map +1 -0
  3. package/dist/components/BookingFlowPageLayout/index.js +35 -0
  4. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
  5. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +10 -33
  6. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
  7. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -4
  8. package/dist/components/BookingPeriodSelector/index.d.ts +1 -1
  9. package/dist/components/BookingPeriodSelector/index.d.ts.map +1 -1
  10. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +0 -5
  11. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  12. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +150 -159
  13. package/dist/components/Footer/BusinessHours.d.ts +2 -1
  14. package/dist/components/Footer/BusinessHours.d.ts.map +1 -1
  15. package/dist/components/Footer/BusinessHours.js +19 -18
  16. package/dist/components/Footer/businessHoursStatus.d.ts +25 -0
  17. package/dist/components/Footer/businessHoursStatus.d.ts.map +1 -0
  18. package/dist/components/Footer/businessHoursStatus.js +99 -0
  19. package/dist/components/Footer/businessHoursUtils.d.ts +2 -1
  20. package/dist/components/Footer/businessHoursUtils.d.ts.map +1 -1
  21. package/dist/components/Footer/businessHoursUtils.js +52 -45
  22. package/dist/components/Footer/index.d.ts +2 -1
  23. package/dist/components/Footer/index.d.ts.map +1 -1
  24. package/dist/components/Footer/index.js +26 -25
  25. package/dist/components/Layout/index.d.ts.map +1 -1
  26. package/dist/components/Layout/index.js +2 -1
  27. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -1
  28. package/dist/components/StorefrontCancellationPolicyNotice/index.js +89 -86
  29. package/dist/components/StorefrontCartPanel/index.js +4 -4
  30. package/dist/components/StorefrontInsuranceNotice/index.d.ts +2 -1
  31. package/dist/components/StorefrontInsuranceNotice/index.d.ts.map +1 -1
  32. package/dist/components/StorefrontInsuranceNotice/index.js +155 -162
  33. package/dist/i18n/en.d.ts +7 -1
  34. package/dist/i18n/en.d.ts.map +1 -1
  35. package/dist/i18n/en.js +8 -2
  36. package/dist/i18n/fr.d.ts +7 -1
  37. package/dist/i18n/fr.d.ts.map +1 -1
  38. package/dist/i18n/fr.js +8 -2
  39. package/dist/index.d.ts +24 -10
  40. package/dist/index.js +66 -66
  41. package/dist/lib/checkoutPaymentDecision.d.ts +2 -6
  42. package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
  43. package/dist/lib/checkoutPaymentDecision.js +3 -4
  44. package/dist/lib/checkoutSubmit.d.ts +0 -3
  45. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  46. package/dist/lib/checkoutSubmit.js +41 -43
  47. package/dist/lib/pricing.d.ts.map +1 -1
  48. package/dist/lib/pricing.js +3 -1
  49. package/dist/lib/products.d.ts +6 -0
  50. package/dist/lib/products.d.ts.map +1 -1
  51. package/dist/lib/products.js +36 -32
  52. package/dist/pages/BookingPage.d.ts.map +1 -1
  53. package/dist/pages/BookingPage.js +306 -335
  54. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  55. package/dist/pages/CheckoutPage.js +172 -186
  56. package/dist/pages/HomePage.d.ts.map +1 -1
  57. package/dist/pages/HomePage.js +435 -378
  58. package/dist/storefront.css +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,99 @@
1
+ import { businessDateStringToDate as e, calendarDateToBusinessDateString as t, getWeekdayFromDateString as n, instantToBusinessDateTimeParts as r, normalizeBusinessDateString as i, parseTimeToMinutes as a } from "../../lib/booking-period.js";
2
+ //#region src/components/Footer/businessHoursStatus.ts
3
+ var o = 370, s = (n, r) => {
4
+ let i = e(n);
5
+ if (!Number.isNaN(i.getTime())) return i.setDate(i.getDate() + r), t(i);
6
+ }, c = (e) => Array.isArray(e) ? e.map((e) => {
7
+ let t = a(e.start), n = a(e.end);
8
+ return t == null || n == null || t >= 1440 || n > 1440 || n <= t ? null : {
9
+ startMinutes: t,
10
+ endMinutes: n,
11
+ startTime: e.start
12
+ };
13
+ }).filter((e) => e != null).sort((e, t) => e.startMinutes - t.startMinutes) : [], l = (e) => {
14
+ let t = /* @__PURE__ */ new Map();
15
+ return e.forEach((e) => {
16
+ let n = i(e.date);
17
+ n && t.set(n, e);
18
+ }), t;
19
+ }, u = (e, t, r) => {
20
+ let a = r.get(e);
21
+ if (a) return c(a.openingSlots);
22
+ let o = t.find((t) => {
23
+ let n = i(t.startDate), r = i(t.endDate);
24
+ return !n || !r ? !1 : e >= (n < r ? n : r) && e <= (n < r ? r : n);
25
+ });
26
+ if (!o) return [];
27
+ let s = n(e);
28
+ return c(o.openingHours.find((e) => e.day === s)?.openingSlots);
29
+ }, d = ({ openingHours: e, openingHoursOverrides: t, timeZone: n, referenceDate: i = /* @__PURE__ */ new Date() }) => {
30
+ if (e.length === 0 && t.length === 0) return { kind: "unknown" };
31
+ let a;
32
+ try {
33
+ a = r(i, n);
34
+ } catch {
35
+ return { kind: "unknown" };
36
+ }
37
+ if (!a) return { kind: "unknown" };
38
+ let c = l(t);
39
+ for (let t = 0; t <= o; t += 1) {
40
+ let n = s(a.dateString, t);
41
+ if (!n) return { kind: "unknown" };
42
+ let r = u(n, e, c);
43
+ if (t === 0 && r.some((e) => a.minutesFromMidnight >= e.startMinutes && a.minutesFromMidnight < e.endMinutes)) return { kind: "open" };
44
+ let i = r.find((e) => t > 0 || e.startMinutes > a.minutesFromMidnight);
45
+ if (i) return {
46
+ kind: "closed",
47
+ nextOpening: {
48
+ date: n,
49
+ daysFromToday: t,
50
+ time: i.startTime
51
+ }
52
+ };
53
+ }
54
+ return {
55
+ kind: "closed",
56
+ nextOpening: null
57
+ };
58
+ }, f = (e, t) => {
59
+ let n = a(e);
60
+ if (n == null || n >= 1440) return e;
61
+ let r = new Date(Date.UTC(2024, 0, 1, Math.floor(n / 60), n % 60));
62
+ try {
63
+ return new Intl.DateTimeFormat(t, {
64
+ hour: "numeric",
65
+ minute: "2-digit",
66
+ timeZone: "UTC"
67
+ }).format(r);
68
+ } catch {
69
+ return e;
70
+ }
71
+ }, p = (e, t) => {
72
+ let n = i(e);
73
+ if (!n) return e;
74
+ let [r, a, o] = n.split("-").map(Number), s = new Date(Date.UTC(r, a - 1, o));
75
+ try {
76
+ return new Intl.DateTimeFormat(t, {
77
+ weekday: "long",
78
+ timeZone: "UTC"
79
+ }).format(s);
80
+ } catch {
81
+ return e;
82
+ }
83
+ }, m = (e, t) => {
84
+ let n = i(e);
85
+ if (!n) return e;
86
+ let [r, a, o] = n.split("-").map(Number), s = new Date(Date.UTC(r, a - 1, o));
87
+ try {
88
+ return new Intl.DateTimeFormat(t, {
89
+ year: "numeric",
90
+ month: "long",
91
+ day: "numeric",
92
+ timeZone: "UTC"
93
+ }).format(s);
94
+ } catch {
95
+ return e;
96
+ }
97
+ };
98
+ //#endregion
99
+ export { m as formatBusinessHoursDate, f as formatBusinessHoursTime, p as formatBusinessHoursWeekday, d as getBusinessHoursStatus };
@@ -38,10 +38,11 @@ type BuildBusinessHoursSeasonSummaryOptions = {
38
38
  closedLabel: string;
39
39
  formatWeekdayRange: (startLabel: string, endLabel: string) => string;
40
40
  formatSeasonRange: (startDate: string, endDate: string) => string;
41
+ timeZone: string;
41
42
  includeReferenceDateOverrideInSeason?: boolean;
42
43
  referenceDate?: Date;
43
44
  };
44
- export declare const buildBusinessHoursSeasonSummary: ({ openingHours, openingHoursOverrides, language, closedLabel, formatWeekdayRange, formatSeasonRange, includeReferenceDateOverrideInSeason, referenceDate, }: BuildBusinessHoursSeasonSummaryOptions) => {
45
+ export declare const buildBusinessHoursSeasonSummary: ({ openingHours, openingHoursOverrides, language, closedLabel, formatWeekdayRange, formatSeasonRange, timeZone, includeReferenceDateOverrideInSeason, referenceDate, }: BuildBusinessHoursSeasonSummaryOptions) => {
45
46
  seasons: BusinessHoursSeasonOption[];
46
47
  exceptions: BusinessHoursExceptionOption[];
47
48
  defaultSeasonId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"businessHoursUtils.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/businessHoursUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACb,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAGtE,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,wBAAwB,EAAE,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,sBAAsB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAA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BAAwB,EA4C1B,CAAA;AAiED,KAAK,sCAAsC,GAAG;IAC5C,YAAY,EAAE,iBAAiB,CAAA;IAC/B,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IACpE,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IACjE,QAAQ,EAAE,MAAM,CAAA;IAChB,oCAAoC,CAAC,EAAE,OAAO,CAAA;IAC9C,aAAa,CAAC,EAAE,IAAI,CAAA;CACrB,CAAA;AAWD,eAAO,MAAM,+BAA+B,GAAI,uKAU7C,sCAAsC,KAAG;IAC1C,OAAO,EAAE,yBAAyB,EAAE,CAAA;IACpC,UAAU,EAAE,4BAA4B,EAAE,CAAA;IAC1C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAoH/B,CAAA"}
@@ -1,24 +1,25 @@
1
- import { businessDateStringToDate as e, calendarDateToBusinessDateString as t, minutesToTimeString as n, normalizeBusinessDateString as r, normalizeOpeningHours as i, parseTimeToMinutes as a } from "../../lib/booking-period.js";
1
+ import { businessDateStringToDate as e, calendarDateToBusinessDateString as t, instantToBusinessDateString as n, minutesToTimeString as r, normalizeBusinessDateString as i, normalizeOpeningHours as a, parseTimeToMinutes as o } from "../../lib/booking-period.js";
2
+ import { addMonths as s } from "date-fns";
2
3
  //#region src/components/Footer/businessHoursUtils.ts
3
- var o = (e) => (Math.trunc(e) % 7 + 7) % 7, s = (e) => Array.isArray(e) ? e.map((e) => ({
4
+ var c = 3, l = 6, u = (e) => (Math.trunc(e) % 7 + 7) % 7, d = (e) => Array.isArray(e) ? e.map((e) => ({
4
5
  name: e.name,
5
6
  startDate: e.startDate,
6
7
  endDate: e.endDate,
7
8
  openingHours: e.openingHours.map((e) => ({
8
- day: o(e.day),
9
+ day: u(e.day),
9
10
  openingSlots: e.openingSlots.map((e) => ({
10
11
  start: e.start,
11
12
  end: e.end
12
13
  }))
13
14
  }))
14
- })) : [], c = (e) => Array.isArray(e) ? e.map((e) => ({
15
+ })) : [], f = (e) => Array.isArray(e) ? e.map((e) => ({
15
16
  date: e.date,
16
17
  openingSlots: e.openingSlots.map((e) => ({
17
18
  start: e.start,
18
19
  end: e.end
19
20
  }))
20
- })) : [], l = (e) => e <= 4, u = (e) => e === 5 || e === 6, d = (e, t) => {
21
- let n = [...e].sort((e, t) => e.weekday - t.weekday), r = n.filter((e) => l(e.weekday)), i = n.filter((e) => u(e.weekday)), a = [], o = 0;
21
+ })) : [], p = (e) => e <= 4, m = (e) => e === 5 || e === 6, h = (e, t) => {
22
+ let n = [...e].sort((e, t) => e.weekday - t.weekday), r = n.filter((e) => p(e.weekday)), i = n.filter((e) => m(e.weekday)), a = [], o = 0;
22
23
  for (; o < r.length;) {
23
24
  let e = r[o], n = e.value, i = o;
24
25
  for (; i + 1 < r.length && r[i + 1].value === n;) i += 1;
@@ -37,19 +38,19 @@ var o = (e) => (Math.trunc(e) % 7 + 7) % 7, s = (e) => Array.isArray(e) ? e.map(
37
38
  value: e.value
38
39
  }));
39
40
  return [...a, ...s];
40
- }, f = (e, t) => {
41
+ }, g = (e, t) => {
41
42
  let n = new Date(2024, 0, 8, 12);
42
43
  n.setDate(n.getDate() + e);
43
44
  let r = new Intl.DateTimeFormat(t, { weekday: "long" }).format(n);
44
45
  return r && `${r.charAt(0).toLocaleUpperCase(t)}${r.slice(1)}`;
45
- }, p = (t, n) => {
46
+ }, _ = (t, n) => {
46
47
  let r = e(t);
47
48
  return Number.isNaN(r.getTime()) ? t : new Intl.DateTimeFormat(n, {
48
49
  year: "numeric",
49
50
  month: "short",
50
51
  day: "2-digit"
51
52
  }).format(r);
52
- }, m = (t, n) => {
53
+ }, v = (t, n) => {
53
54
  let r = e(t);
54
55
  if (Number.isNaN(r.getTime())) return t;
55
56
  let i = new Intl.DateTimeFormat(n, {
@@ -59,63 +60,69 @@ var o = (e) => (Math.trunc(e) % 7 + 7) % 7, s = (e) => Array.isArray(e) ? e.map(
59
60
  day: "numeric"
60
61
  }).format(r);
61
62
  return i && `${i.charAt(0).toLocaleUpperCase(n)}${i.slice(1)}`;
62
- }, h = (e, t) => {
63
- let r = e.map((e) => {
64
- let t = a(e.start), r = a(e.end);
65
- return t == null || r == null || r <= t ? null : {
63
+ }, y = (e, t) => {
64
+ let n = e.map((e) => {
65
+ let t = o(e.start), n = o(e.end);
66
+ return t == null || n == null || n <= t ? null : {
66
67
  startMinutes: t,
67
- label: `${n(t)} - ${n(r)}`
68
+ label: `${r(t)} - ${r(n)}`
68
69
  };
69
70
  }).filter((e) => !!e).sort((e, t) => e.startMinutes - t.startMinutes).map((e) => e.label);
70
- return r.length > 0 ? r.join(" / ") : t;
71
- }, g = ({ openingHours: n, openingHoursOverrides: a, language: s, closedLabel: c, formatWeekdayRange: l, formatSeasonRange: u, includeReferenceDateOverrideInSeason: g = !0, referenceDate: _ = /* @__PURE__ */ new Date() }) => {
72
- let v = i(n, g ? a : [], { referenceDate: _ }), y = v.season, b = v.days.map((e) => ({
71
+ return n.length > 0 ? n.join(" / ") : t;
72
+ }, b = (e, r) => {
73
+ try {
74
+ return n(e, r);
75
+ } catch {
76
+ return t(e);
77
+ }
78
+ }, x = ({ openingHours: n, openingHoursOverrides: r, language: o, closedLabel: d, formatWeekdayRange: f, formatSeasonRange: p, timeZone: m, includeReferenceDateOverrideInSeason: x = !0, referenceDate: S = /* @__PURE__ */ new Date() }) => {
79
+ let C = a(n, x ? r : [], { referenceDate: S }), w = C.season, T = C.days.map((e) => ({
73
80
  weekday: e.day,
74
- label: f(e.day, s),
75
- value: e.summaryLabel ?? c
76
- })), x = new Date(_);
77
- x.setHours(0, 0, 0, 0);
78
- let S = n.map((t, n) => {
79
- let r = t.startDate === y?.startDate && t.endDate === y?.endDate, i = /* @__PURE__ */ new Map();
81
+ label: g(e.day, o),
82
+ value: e.summaryLabel ?? d
83
+ })), E = new Date(S);
84
+ E.setHours(0, 0, 0, 0);
85
+ let D = n.map((t, n) => {
86
+ let r = t.startDate === w?.startDate && t.endDate === w?.endDate, i = /* @__PURE__ */ new Map();
80
87
  r || t.openingHours.forEach((e) => {
81
- i.set(o(e.day), e.openingSlots);
88
+ i.set(u(e.day), e.openingSlots);
82
89
  });
83
- let a = r ? b : Array.from({ length: 7 }, (e, t) => {
90
+ let a = r ? T : Array.from({ length: 7 }, (e, t) => {
84
91
  let n = t;
85
92
  return {
86
93
  weekday: n,
87
- label: f(n, s),
88
- value: h(i.get(n) ?? [], c)
94
+ label: g(n, o),
95
+ value: y(i.get(n) ?? [], d)
89
96
  };
90
- }), m = u(p(t.startDate, s), p(t.endDate, s)), g = e(t.startDate), _ = e(t.endDate);
91
- g.setHours(0, 0, 0, 0), _.setHours(0, 0, 0, 0);
92
- let v = !Number.isNaN(g.getTime()) && !Number.isNaN(_.getTime()) && g.getTime() <= x.getTime() && _.getTime() >= x.getTime();
97
+ }), s = p(_(t.startDate, o), _(t.endDate, o)), c = e(t.startDate), l = e(t.endDate);
98
+ c.setHours(0, 0, 0, 0), l.setHours(0, 0, 0, 0);
99
+ let m = !Number.isNaN(c.getTime()) && !Number.isNaN(l.getTime()) && c.getTime() <= E.getTime() && l.getTime() >= E.getTime();
93
100
  return {
94
101
  id: String(n),
95
- label: t.name || m,
96
- rangeLabel: m,
102
+ label: t.name || s,
103
+ rangeLabel: s,
97
104
  startDate: t.startDate,
98
105
  endDate: t.endDate,
99
- isCurrent: v,
100
- items: d(a, l)
106
+ isCurrent: m,
107
+ items: h(a, f)
101
108
  };
102
109
  }).filter((t) => {
103
110
  let n = e(t.endDate);
104
- return Number.isNaN(n.getTime()) ? !0 : (n.setHours(0, 0, 0, 0), n.getTime() >= x.getTime());
105
- }).sort((e, t) => e.startDate.localeCompare(t.startDate)), C = S.length > 0 ? S.find((e) => e.startDate === y?.startDate && e.endDate === y?.endDate)?.id ?? S[0].id : null, w = t(_), T = /* @__PURE__ */ new Map();
106
- return a.forEach((e) => {
107
- let t = r(e.date);
108
- !t || w && t < w || T.set(t, e);
111
+ return Number.isNaN(n.getTime()) ? !0 : (n.setHours(0, 0, 0, 0), n.getTime() >= E.getTime());
112
+ }).sort((e, t) => e.startDate.localeCompare(t.startDate)), O = D.length > 0 ? D.find((e) => e.startDate === w?.startDate && e.endDate === w?.endDate)?.id ?? D[0].id : null, k = b(S, m), A = k ? t(s(e(k), l)) : void 0, j = /* @__PURE__ */ new Map();
113
+ return r.forEach((e) => {
114
+ let t = i(e.date);
115
+ !t || k && t < k || A && t > A || j.set(t, e);
109
116
  }), {
110
- seasons: S,
111
- exceptions: Array.from(T.entries()).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => ({
117
+ seasons: D,
118
+ exceptions: Array.from(j.entries()).sort(([e], [t]) => e.localeCompare(t)).slice(0, c).map(([e, t]) => ({
112
119
  id: e,
113
120
  date: e,
114
- label: m(e, s),
115
- value: h(t.openingSlots, c)
121
+ label: v(e, o),
122
+ value: y(t.openingSlots, d)
116
123
  })),
117
- defaultSeasonId: C
124
+ defaultSeasonId: O
118
125
  };
119
126
  };
120
127
  //#endregion
121
- export { g as buildBusinessHoursSeasonSummary, d as groupBusinessHoursItems, s as normalizeStorefrontOpeningHours, c as normalizeStorefrontOpeningHoursOverrides };
128
+ export { x as buildBusinessHoursSeasonSummary, h as groupBusinessHoursItems, d as normalizeStorefrontOpeningHours, f as normalizeStorefrontOpeningHoursOverrides };
@@ -6,7 +6,8 @@ type FooterProps = {
6
6
  whatsappPhoneDisplay?: string;
7
7
  openingHours?: StorefrontConfiguration["bookingEngine"]["shop"]["openingHours"];
8
8
  openingHoursOverrides?: StorefrontConfiguration["bookingEngine"]["shop"]["openingHoursOverrides"];
9
+ timeZone?: string;
9
10
  };
10
- export declare function Footer({ storeSlug, shop, whatsappHref, whatsappPhoneDisplay, openingHours, openingHoursOverrides, }: FooterProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Footer({ storeSlug, shop, whatsappHref, whatsappPhoneDisplay, openingHours, openingHoursOverrides, timeZone, }: FooterProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAetF,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAA;IAC/E,qBAAqB,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAA;CAClG,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,GACtB,EAAE,WAAW,2CAoJb"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAetF,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAA;IAC/E,qBAAqB,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAA;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,QAAQ,GACT,EAAE,WAAW,2CAqJb"}
@@ -10,8 +10,8 @@ import { cn as p } from "@rpcbase/ui";
10
10
  import { Clock as m, Mail as h, MapPin as g, Phone as _ } from "lucide-react";
11
11
  //#region src/components/Footer/index.tsx
12
12
  var v = "group inline-flex gap-2 text-sm font-normal text-slate-600 decoration-current underline-offset-4 transition-colors hover:text-slate-800 hover:underline", y = "inline-flex text-sm font-normal text-slate-600 decoration-current underline-offset-4 transition-colors hover:text-slate-800 hover:underline", b = "mt-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center text-current transition-colors";
13
- function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, openingHours: T, openingHoursOverrides: E }) {
14
- let { t: D } = f(), O = t(S), k = S?.emailAddress?.trim() ?? "", A = S?.address?.trim() ?? "", j = e(S), M = o(T), N = s(E), P = M.length > 0, F = x?.trim() || S?.slug?.trim() || "", I = F ? `/${encodeURIComponent(F)}/rental-terms` : "rental-terms";
13
+ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, openingHours: T, openingHoursOverrides: E, timeZone: D }) {
14
+ let { t: O } = f(), k = t(S), A = S?.emailAddress?.trim() ?? "", j = S?.address?.trim() ?? "", M = e(S), N = o(T), P = s(E), F = N.length > 0, I = x?.trim() || S?.slug?.trim() || "", L = I ? `/${encodeURIComponent(I)}/rental-terms` : "rental-terms";
15
15
  return /* @__PURE__ */ l("footer", {
16
16
  className: "border-t bg-white",
17
17
  children: /* @__PURE__ */ u("div", {
@@ -21,14 +21,14 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
21
21
  className: "space-y-2",
22
22
  children: [/* @__PURE__ */ l("p", {
23
23
  className: "text-sm font-semibold text-slate-950",
24
- children: /* @__PURE__ */ l("span", { children: D("footer_information_title") })
24
+ children: /* @__PURE__ */ l("span", { children: O("footer_information_title") })
25
25
  }), /* @__PURE__ */ l("nav", {
26
26
  className: "grid gap-2",
27
- "aria-label": D("footer_information_title"),
27
+ "aria-label": O("footer_information_title"),
28
28
  children: /* @__PURE__ */ l(d, {
29
29
  className: y,
30
- to: I,
31
- children: /* @__PURE__ */ l("span", { children: D("rental_terms_title") })
30
+ to: L,
31
+ children: /* @__PURE__ */ l("span", { children: O("rental_terms_title") })
32
32
  })
33
33
  })]
34
34
  }),
@@ -36,7 +36,7 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
36
36
  className: "space-y-2",
37
37
  children: [/* @__PURE__ */ l("p", {
38
38
  className: "text-sm font-semibold text-slate-950",
39
- children: /* @__PURE__ */ l("span", { children: D("footer_contact_title") })
39
+ children: /* @__PURE__ */ l("span", { children: O("footer_contact_title") })
40
40
  }), /* @__PURE__ */ u("div", {
41
41
  className: "grid gap-2",
42
42
  children: [
@@ -55,24 +55,24 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
55
55
  "aria-hidden": "true"
56
56
  })
57
57
  }),
58
- /* @__PURE__ */ l("span", { children: D("footer_whatsapp_link") }),
58
+ /* @__PURE__ */ l("span", { children: O("footer_whatsapp_link") }),
59
59
  w ? /* @__PURE__ */ l("span", {
60
60
  className: "text-slate-500",
61
61
  children: w
62
62
  }) : null
63
63
  ]
64
64
  }) : null,
65
- O ? /* @__PURE__ */ u("a", {
65
+ k ? /* @__PURE__ */ u("a", {
66
66
  className: p(v, "items-center"),
67
- href: O.href,
68
- "aria-label": O.phoneDisplay,
67
+ href: k.href,
68
+ "aria-label": k.phoneDisplay,
69
69
  children: [/* @__PURE__ */ l("span", {
70
70
  className: b,
71
71
  children: /* @__PURE__ */ l(_, {
72
72
  className: "h-4 w-4",
73
73
  "aria-hidden": "true"
74
74
  })
75
- }), /* @__PURE__ */ l("span", { children: O.phoneDisplay })]
75
+ }), /* @__PURE__ */ l("span", { children: k.phoneDisplay })]
76
76
  }) : /* @__PURE__ */ u("div", {
77
77
  className: p(v, "items-center text-destructive hover:text-destructive hover:no-underline"),
78
78
  children: [/* @__PURE__ */ l("span", {
@@ -83,17 +83,17 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
83
83
  })
84
84
  }), /* @__PURE__ */ l("span", { children: a })]
85
85
  }),
86
- k ? /* @__PURE__ */ u("a", {
86
+ A ? /* @__PURE__ */ u("a", {
87
87
  className: p(v, "items-center"),
88
- href: `mailto:${k}`,
89
- "aria-label": k,
88
+ href: `mailto:${A}`,
89
+ "aria-label": A,
90
90
  children: [/* @__PURE__ */ l("span", {
91
91
  className: b,
92
92
  children: /* @__PURE__ */ l(h, {
93
93
  className: "h-4 w-4",
94
94
  "aria-hidden": "true"
95
95
  })
96
- }), /* @__PURE__ */ l("span", { children: k })]
96
+ }), /* @__PURE__ */ l("span", { children: A })]
97
97
  }) : /* @__PURE__ */ u("div", {
98
98
  className: p(v, "items-center text-destructive hover:text-destructive hover:no-underline"),
99
99
  children: [/* @__PURE__ */ l("span", {
@@ -104,9 +104,9 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
104
104
  })
105
105
  }), /* @__PURE__ */ l("span", { children: i })]
106
106
  }),
107
- j && A ? /* @__PURE__ */ u("a", {
107
+ M && j ? /* @__PURE__ */ u("a", {
108
108
  className: p(v, "items-start"),
109
- href: j,
109
+ href: M,
110
110
  target: "_blank",
111
111
  rel: "noreferrer",
112
112
  children: [/* @__PURE__ */ l("span", {
@@ -115,7 +115,7 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
115
115
  className: "h-4 w-4",
116
116
  "aria-hidden": "true"
117
117
  })
118
- }), /* @__PURE__ */ l("span", { children: A })]
118
+ }), /* @__PURE__ */ l("span", { children: j })]
119
119
  }) : /* @__PURE__ */ u("div", {
120
120
  className: p(v, "items-start text-destructive hover:text-destructive hover:no-underline"),
121
121
  children: [/* @__PURE__ */ l("span", {
@@ -133,10 +133,11 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
133
133
  className: "space-y-2",
134
134
  children: [/* @__PURE__ */ l("p", {
135
135
  className: "text-sm font-semibold text-slate-950",
136
- children: /* @__PURE__ */ l("span", { children: D("footer_hours_title") })
137
- }), P ? /* @__PURE__ */ l(c, {
138
- openingHours: M,
139
- openingHoursOverrides: N
136
+ children: /* @__PURE__ */ l("span", { children: O("footer_hours_title") })
137
+ }), F ? /* @__PURE__ */ l(c, {
138
+ openingHours: N,
139
+ openingHoursOverrides: P,
140
+ timeZone: D ?? S?.timeZone ?? "UTC"
140
141
  }) : /* @__PURE__ */ u("div", {
141
142
  className: "grid gap-1 text-sm text-slate-700",
142
143
  children: [/* @__PURE__ */ u("p", {
@@ -144,13 +145,13 @@ function x({ storeSlug: x, shop: S, whatsappHref: C, whatsappPhoneDisplay: w, op
144
145
  children: [/* @__PURE__ */ l(m, {
145
146
  className: "h-4 w-4 text-slate-400",
146
147
  "aria-hidden": "true"
147
- }), /* @__PURE__ */ l("span", { children: D("footer_hours_week") })]
148
+ }), /* @__PURE__ */ l("span", { children: O("footer_hours_week") })]
148
149
  }), /* @__PURE__ */ u("p", {
149
150
  className: "inline-flex items-center gap-2",
150
151
  children: [/* @__PURE__ */ l(m, {
151
152
  className: "h-4 w-4 text-slate-400",
152
153
  "aria-hidden": "true"
153
- }), /* @__PURE__ */ l("span", { children: D("footer_hours_weekend") })]
154
+ }), /* @__PURE__ */ l("span", { children: O("footer_hours_weekend") })]
154
155
  })]
155
156
  })]
156
157
  })
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAGvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,2CAkEb"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAGvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,2CAmEb"}
@@ -54,7 +54,8 @@ function b({ storefrontConfiguration: b, storefrontProducts: x }) {
54
54
  whatsappHref: D,
55
55
  whatsappPhoneDisplay: E?.phoneDisplay,
56
56
  openingHours: b?.bookingEngine.shop.openingHours,
57
- openingHoursOverrides: b?.bookingEngine.shop.openingHoursOverrides
57
+ openingHoursOverrides: b?.bookingEngine.shop.openingHoursOverrides,
58
+ timeZone: b?.bookingEngine.shop.timeZone
58
59
  }),
59
60
  /* @__PURE__ */ f(i, {}),
60
61
  D && b?.content?.showWhatsappFloatingButton !== !1 ? /* @__PURE__ */ f(s, { href: D }) : null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCancellationPolicyNotice/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAOtE,KAAK,kBAAkB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,CAAA;AACxF,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,KAAK,uCAAuC,GAAG;IAC7C,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAOD,eAAO,MAAM,6CAA6C,GACxD,QAAQ,kBAAkB,KACzB,sBAAsB,GAAG,IAG3B,CAAA;AAaD,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,SAAS,GACV,EAAE,uCAAuC,kDA4GzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCancellationPolicyNotice/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAOtE,KAAK,kBAAkB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,CAAA;AACxF,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,KAAK,uCAAuC,GAAG;IAC7C,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAOD,eAAO,MAAM,6CAA6C,GACxD,QAAQ,kBAAkB,KACzB,sBAAsB,GAAG,IAG3B,CAAA;AAaD,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,SAAS,GACV,EAAE,uCAAuC,kDAmHzC"}