@loczer/storefront-sdk 0.157.0 → 0.159.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.
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAsEA,eAAO,MAAM,mBAAmB,+CA0iB/B,CAAA"}
1
+ {"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAqJA,eAAO,MAAM,mBAAmB,+CAkiB/B,CAAA"}
@@ -1,87 +1,128 @@
1
- import { jsxs as J, jsx as s } from "react/jsx-runtime";
2
- import { differenceInCalendarDays as ue } from "date-fns";
3
- import { useRef as S, useState as O, useEffect as E, useMemo as Q } from "react";
4
- import { cn as b, DayPickerField as le } from "@rpcbase/ui";
5
- import { useMorphingModalWizardOverlayLayer as fe } from "../../../chunks/ui/dist/MorphingModalWizard-D7hc-dDP.js";
6
- import { DayPicker as me } from "../../../ui/day-picker.js";
7
- import { Label as pe } from "../../../ui/label.js";
8
- import { Root as ye, TooltipTrigger as Ee, Content as he, Provider as ge } from "../../../ui/tooltip.js";
9
- import { useBookingPeriod as De } from "../BookingPeriodContext.js";
10
- import { BookingPeriodFieldErrorMessage as be } from "./BookingPeriodFieldErrorMessage.js";
11
- import { ModalDayPickerField as ve } from "./internal/ModalDayPickerField.js";
12
- const X = (o) => String(o).padStart(2, "0"), x = (o) => `${o.getFullYear()}-${X(o.getMonth() + 1)}-${X(o.getDate())}`, H = (o) => o.getFullYear() * 12 + o.getMonth(), te = (o) => new Date(Math.floor(o / 12), o % 12, 1), C = (o) => te(H(o)), Z = (o, i, a) => {
13
- const g = H(o), d = H(i), f = Math.max(0, a - 1), v = g + f;
14
- if (d < g)
15
- return C(i);
16
- if (d > v) {
17
- const u = d - f;
18
- return u === g ? o : te(u);
1
+ import { jsxs as ne, jsx as s } from "react/jsx-runtime";
2
+ import { differenceInCalendarDays as me } from "date-fns";
3
+ import { createContext as pe, useRef as F, useState as X, useEffect as v, useContext as ye } from "react";
4
+ import { cn as k, DayPickerField as De } from "@rpcbase/ui";
5
+ import { useMorphingModalWizardOverlayLayer as Ee } from "../../../chunks/ui/dist/MorphingModalWizard-D7hc-dDP.js";
6
+ import { DayPicker as he } from "../../../ui/day-picker.js";
7
+ import { Label as ve } from "../../../ui/label.js";
8
+ import { Provider as be, Root as ge, TooltipTrigger as Me, Content as ke } from "../../../ui/tooltip.js";
9
+ import { useBookingPeriod as Te } from "../BookingPeriodContext.js";
10
+ import { BookingPeriodFieldErrorMessage as Pe } from "./BookingPeriodFieldErrorMessage.js";
11
+ import { ModalDayPickerField as we } from "./internal/ModalDayPickerField.js";
12
+ const Z = (t) => String(t).padStart(2, "0"), $ = (t) => `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}`, z = (t) => t.getFullYear() * 12 + t.getMonth(), oe = (t) => new Date(Math.floor(t / 12), t % 12, 1), N = (t) => oe(z(t)), ee = (t, i, r) => {
13
+ const c = z(t), d = z(i), f = Math.max(0, r - 1), b = c + f;
14
+ if (d < c)
15
+ return N(i);
16
+ if (d > b) {
17
+ const m = d - f;
18
+ return m === c ? t : oe(m);
19
19
  }
20
- return o;
21
- }, Me = (o) => {
20
+ return t;
21
+ }, Ce = (t) => {
22
22
  if (typeof PointerEvent == "function") {
23
- o.dispatchEvent(new PointerEvent("pointermove", { bubbles: !0, pointerType: "mouse" }));
23
+ t.dispatchEvent(new PointerEvent("pointermove", { bubbles: !0, pointerType: "mouse" }));
24
24
  return;
25
25
  }
26
- o.dispatchEvent(new MouseEvent("mousemove", { bubbles: !0 }));
27
- }, ee = (o) => {
26
+ t.dispatchEvent(new MouseEvent("mousemove", { bubbles: !0 }));
27
+ }, te = (t) => {
28
28
  if (typeof PointerEvent == "function") {
29
- o.dispatchEvent(new PointerEvent("pointerout", { bubbles: !0, pointerType: "mouse" })), o.dispatchEvent(new PointerEvent("pointerleave", { bubbles: !0, pointerType: "mouse" }));
29
+ t.dispatchEvent(new PointerEvent("pointerout", { bubbles: !0, pointerType: "mouse" })), t.dispatchEvent(new PointerEvent("pointerleave", { bubbles: !0, pointerType: "mouse" }));
30
30
  return;
31
31
  }
32
- o.dispatchEvent(new MouseEvent("mouseout", { bubbles: !0 })), o.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
33
- }, xe = () => {
32
+ t.dispatchEvent(new MouseEvent("mouseout", { bubbles: !0 })), t.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
33
+ }, re = pe(null), ae = (t) => {
34
+ const i = ye(re), { day: r, modifiers: c, className: d, ...f } = t, b = c.disabled ? "cursor-not-allowed" : "cursor-pointer", m = F(null);
35
+ v(() => {
36
+ c.focused && m.current?.focus();
37
+ }, [c.focused]);
38
+ const p = /* @__PURE__ */ s(
39
+ "button",
40
+ {
41
+ ref: m,
42
+ ...f,
43
+ className: k(d, b)
44
+ }
45
+ );
46
+ if (!i)
47
+ return p;
48
+ const { labels: y, startDate: L, hoveredEndDate: T, keyboardTooltipDay: P, numberOfMonths: g, overlayLayer: M } = i;
49
+ if (!L || c.disabled || g === 1)
50
+ return p;
51
+ const l = me(r.date, L);
52
+ if (l < 0)
53
+ return p;
54
+ const B = $(r.date), I = P === B || (!P && T ? $(T) === B : !1), O = y.selectedDaysTooltip?.({ count: l + 1 });
55
+ return O ? /* @__PURE__ */ ne(ge, { open: I, children: [
56
+ /* @__PURE__ */ s(Me, { asChild: !0, children: p }),
57
+ /* @__PURE__ */ s(
58
+ ke,
59
+ {
60
+ container: M ?? void 0,
61
+ side: "top",
62
+ align: "center",
63
+ disableAnimation: !0,
64
+ positionerClassName: M ? "z-[120]" : "z-[80]",
65
+ className: k(
66
+ "pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
67
+ M ? "z-[120]" : "z-[70]"
68
+ ),
69
+ children: /* @__PURE__ */ s("span", { children: O })
70
+ }
71
+ )
72
+ ] }) : p;
73
+ };
74
+ ae.displayName = "BookingEndDateDayButton";
75
+ const qe = () => {
34
76
  const {
35
- labels: o,
77
+ labels: t,
36
78
  startDate: i,
37
- endDate: a,
38
- selectEndDate: g,
79
+ endDate: r,
80
+ selectEndDate: c,
39
81
  isEndDatePopoverOpen: d,
40
82
  setIsEndDatePopoverOpen: f,
41
- setIsStartTimeSelectOpen: v,
42
- hoveredEndDate: u,
43
- setHoveredEndDate: M,
44
- resetHoveredEndDate: m,
45
- labelClassName: ne,
46
- inputClassName: N,
47
- buttonClassName: A,
48
- errors: k,
49
- dateLocale: K,
50
- numberOfMonths: p,
51
- isMobile: oe,
52
- isHydrated: q,
53
- openDatePickerOnFocus: re,
83
+ setIsStartTimeSelectOpen: b,
84
+ hoveredEndDate: m,
85
+ setHoveredEndDate: p,
86
+ resetHoveredEndDate: y,
87
+ labelClassName: L,
88
+ inputClassName: T,
89
+ buttonClassName: P,
90
+ errors: g,
91
+ dateLocale: M,
92
+ numberOfMonths: l,
93
+ isMobile: B,
94
+ isHydrated: I,
95
+ openDatePickerOnFocus: O,
54
96
  withMobileDateDrawer: ie,
55
- minSelectableDate: Y
56
- } = De(), l = ie && oe, y = S(null), h = S(!1), [ae, de] = O(!1), [F, I] = O(null), [$, B] = O(
57
- () => C(i ?? a ?? /* @__PURE__ */ new Date())
58
- ), D = fe(), se = !!D || !ae;
59
- E(() => {
60
- de(!0);
61
- }, []), E(() => {
97
+ selectionFlow: x,
98
+ minSelectableDate: U
99
+ } = Te(), D = ie && B, E = F(null), h = F(!1), [V, A] = X(null), [j, K] = X(
100
+ () => N(i ?? r ?? /* @__PURE__ */ new Date())
101
+ ), S = Ee(), de = !!S;
102
+ v(() => {
62
103
  if (typeof document > "u")
63
104
  return;
64
105
  const e = document.getElementById("end-date-picker");
65
106
  if (!(e instanceof HTMLInputElement))
66
107
  return;
67
- const t = (n) => {
68
- h.current = n.key === "ArrowUp" || n.key === "ArrowDown";
108
+ const n = (o) => {
109
+ h.current = o.key === "ArrowUp" || o.key === "ArrowDown";
69
110
  };
70
- return e.addEventListener("keydown", t, !0), () => {
71
- e.removeEventListener("keydown", t, !0);
111
+ return e.addEventListener("keydown", n, !0), () => {
112
+ e.removeEventListener("keydown", n, !0);
72
113
  };
73
- }, []), E(() => {
74
- if (!d || l)
114
+ }, []), v(() => {
115
+ if (!d || D)
75
116
  return;
76
- const e = C(i ?? a ?? /* @__PURE__ */ new Date()), t = a ?? i;
77
- B(t ? Z(e, t, p) : e);
78
- }, [a, d, p, i]), E(() => {
117
+ const e = N(i ?? r ?? /* @__PURE__ */ new Date()), n = r ?? i;
118
+ K(n ? ee(e, n, l) : e);
119
+ }, [r, d, l, i]), v(() => {
79
120
  if (!d)
80
121
  return;
81
- const e = u ?? a;
82
- e && B((t) => Z(t, e, p));
83
- }, [a, u, d, p]), E(() => {
84
- if (!d || typeof document > "u" || (m(), l))
122
+ const e = m ?? r;
123
+ e && K((n) => ee(n, e, l));
124
+ }, [r, m, d, l]), v(() => {
125
+ if (!d || typeof document > "u" || (y(), D))
85
126
  return;
86
127
  const e = document.getElementById("end-date-picker");
87
128
  if (!(e instanceof HTMLElement)) {
@@ -89,268 +130,267 @@ const X = (o) => String(o).padStart(2, "0"), x = (o) => `${o.getFullYear()}-${X(
89
130
  return;
90
131
  }
91
132
  document.activeElement !== e && requestAnimationFrame(() => {
92
- e.focus({ preventScroll: !0 }), e.click();
133
+ e.focus({ preventScroll: !0 }), x === "chained-times" && e.click();
93
134
  });
94
- }, [d, m, f]), E(() => {
135
+ }, [d, y, x, f]), v(() => {
95
136
  if (typeof document > "u")
96
137
  return;
97
138
  const e = document.getElementById("end-date-picker");
98
- if (!(e instanceof HTMLInputElement))
139
+ if (!(e instanceof HTMLInputElement) || x !== "chained-times")
99
140
  return;
100
- const t = () => {
101
- v(!1);
141
+ const n = () => {
142
+ b(!1);
102
143
  };
103
- return e.addEventListener("focus", t, !0), () => {
104
- e.removeEventListener("focus", t, !0);
144
+ return e.addEventListener("focus", n, !0), () => {
145
+ e.removeEventListener("focus", n, !0);
105
146
  };
106
- }, [v]), E(() => {
147
+ }, [x, b]), v(() => {
107
148
  if (d || typeof document > "u")
108
149
  return;
109
- const e = y.current;
150
+ const e = E.current;
110
151
  if (!e)
111
152
  return;
112
- const n = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
113
- n instanceof HTMLElement && ee(n), y.current = null, I(null);
153
+ const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
154
+ o instanceof HTMLElement && te(o), E.current = null, A(null);
114
155
  }, [d]);
115
- const z = Q(() => {
116
- const e = (t) => {
117
- const { day: n, modifiers: r, className: c, ...T } = t, P = r.disabled ? "cursor-not-allowed" : "cursor-pointer", j = S(null);
118
- E(() => {
119
- r.focused && j.current?.focus();
120
- }, [r.focused]);
121
- const w = /* @__PURE__ */ s(
122
- "button",
156
+ const W = F({
157
+ labels: t,
158
+ startDate: i,
159
+ endDate: r,
160
+ hoveredEndDate: m,
161
+ keyboardTooltipDay: V,
162
+ numberOfMonths: l,
163
+ overlayLayer: S,
164
+ calendarMonth: j,
165
+ resetHoveredEndDate: y,
166
+ setHoveredEndDate: p
167
+ });
168
+ W.current = {
169
+ labels: t,
170
+ startDate: i,
171
+ endDate: r,
172
+ hoveredEndDate: m,
173
+ keyboardTooltipDay: V,
174
+ numberOfMonths: l,
175
+ overlayLayer: S,
176
+ calendarMonth: j,
177
+ resetHoveredEndDate: y,
178
+ setHoveredEndDate: p
179
+ };
180
+ const q = F(null);
181
+ if (!q.current) {
182
+ const e = (n) => {
183
+ const {
184
+ labels: o,
185
+ startDate: a,
186
+ endDate: u,
187
+ hoveredEndDate: w,
188
+ keyboardTooltipDay: H,
189
+ numberOfMonths: Q,
190
+ overlayLayer: se,
191
+ calendarMonth: ce,
192
+ resetHoveredEndDate: le,
193
+ setHoveredEndDate: ue
194
+ } = W.current, fe = {
195
+ labels: o,
196
+ startDate: a,
197
+ hoveredEndDate: w,
198
+ keyboardTooltipDay: H,
199
+ numberOfMonths: Q,
200
+ overlayLayer: se
201
+ };
202
+ return /* @__PURE__ */ s(re.Provider, { value: fe, children: /* @__PURE__ */ s(be, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: le, children: /* @__PURE__ */ s(
203
+ he,
123
204
  {
124
- ref: j,
125
- ...T,
126
- className: b(c, P)
127
- }
128
- );
129
- if (!i || r.disabled || p === 1)
130
- return w;
131
- const W = ue(n.date, i);
132
- if (W < 0)
133
- return w;
134
- const _ = x(n.date), ce = F === _ || (!F && u ? x(u) === _ : !1), G = o.selectedDaysTooltip?.({ count: W + 1 });
135
- return G ? /* @__PURE__ */ J(ye, { open: ce, children: [
136
- /* @__PURE__ */ s(Ee, { asChild: !0, children: w }),
137
- /* @__PURE__ */ s(
138
- he,
139
- {
140
- container: D ?? void 0,
141
- side: "top",
142
- align: "center",
143
- disableAnimation: !0,
144
- positionerClassName: D ? "z-[120]" : "z-[80]",
145
- className: b(
146
- "pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
147
- D ? "z-[120]" : "z-[70]"
148
- ),
149
- children: /* @__PURE__ */ s("span", { children: G })
205
+ ...n,
206
+ mode: "range",
207
+ month: ce,
208
+ onMonthChange: (C) => {
209
+ K(N(C));
210
+ },
211
+ selected: {
212
+ from: a,
213
+ to: w || u
214
+ },
215
+ components: {
216
+ ...n.components,
217
+ DayButton: ae
218
+ },
219
+ onSelect: (C, Y) => {
220
+ n.onSelect?.(Y);
221
+ },
222
+ onDayMouseEnter: (C, Y) => {
223
+ Q !== 1 && a && !Y.disabled && C >= a && ue(C);
150
224
  }
151
- )
152
- ] }) : w;
153
- };
154
- return e.displayName = "BookingEndDateDayButton", e;
155
- }, [u, F, o, D, i]), R = Q(() => {
156
- const e = (t) => /* @__PURE__ */ s(ge, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: m, children: /* @__PURE__ */ s(
157
- me,
158
- {
159
- ...t,
160
- mode: "range",
161
- month: $,
162
- onMonthChange: (n) => {
163
- B(C(n));
164
- },
165
- selected: {
166
- from: i,
167
- to: u || a
168
- },
169
- components: {
170
- ...t.components,
171
- DayButton: z
172
- },
173
- onSelect: (n, r) => {
174
- t.onSelect?.(r);
175
- },
176
- onDayMouseEnter: (n, r) => {
177
- p !== 1 && i && !r.disabled && n >= i && M(n);
178
225
  }
179
- }
180
- ) }) });
181
- return e.displayName = "BookingEndDateDayPicker", e;
182
- }, [
183
- z,
184
- i,
185
- a,
186
- u,
187
- $,
188
- m,
189
- M
190
- ]), L = () => {
226
+ ) }) }) });
227
+ };
228
+ e.displayName = "BookingEndDateDayPicker", q.current = e;
229
+ }
230
+ const _ = q.current, R = () => {
191
231
  if (typeof document > "u") {
192
- y.current = null;
232
+ E.current = null;
193
233
  return;
194
234
  }
195
- const e = y.current;
235
+ const e = E.current;
196
236
  if (!e)
197
237
  return;
198
- const n = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
199
- n instanceof HTMLElement && ee(n), y.current = null, I(null);
200
- }, U = (e) => {
238
+ const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
239
+ o instanceof HTMLElement && te(o), E.current = null, A(null);
240
+ }, G = (e) => {
201
241
  if (typeof document > "u")
202
242
  return;
203
- const t = x(e);
204
- if (y.current === t)
243
+ const n = $(e);
244
+ if (E.current === n)
205
245
  return;
206
- L(), y.current = t, I(t);
207
- let n = 0;
208
- const r = 6, c = () => {
209
- if (y.current !== t)
246
+ R(), E.current = n, A(n);
247
+ let o = 0;
248
+ const a = 6, u = () => {
249
+ if (E.current !== n)
210
250
  return;
211
- const T = document.getElementById("end-date-calendar");
212
- if (!(T instanceof HTMLElement)) {
213
- n += 1, n <= r && requestAnimationFrame(c);
251
+ const w = document.getElementById("end-date-calendar");
252
+ if (!(w instanceof HTMLElement)) {
253
+ o += 1, o <= a && requestAnimationFrame(u);
214
254
  return;
215
255
  }
216
- const P = T.querySelector(`[data-day="${t}"] button:not([disabled])`);
217
- if (P instanceof HTMLElement) {
218
- Me(P);
256
+ const H = w.querySelector(`[data-day="${n}"] button:not([disabled])`);
257
+ if (H instanceof HTMLElement) {
258
+ Ce(H);
219
259
  return;
220
260
  }
221
- n += 1, n <= r && requestAnimationFrame(c);
261
+ o += 1, o <= a && requestAnimationFrame(u);
222
262
  };
223
- requestAnimationFrame(c);
224
- }, V = () => {
225
- l && f(!0);
263
+ requestAnimationFrame(u);
264
+ }, J = () => {
265
+ D && f(!0);
226
266
  };
227
- return /* @__PURE__ */ J(
267
+ return /* @__PURE__ */ ne(
228
268
  "div",
229
269
  {
230
- className: b("group/form-item relative flex-grow", l && "cursor-pointer rounded-md"),
231
- onPointerDownCapture: V,
232
- onClick: V,
270
+ className: k("group/form-item relative flex-grow", D && "cursor-pointer rounded-md"),
271
+ onPointerDownCapture: J,
272
+ onClick: J,
233
273
  children: [
234
274
  /* @__PURE__ */ s(
235
- pe,
275
+ ve,
236
276
  {
237
277
  htmlFor: "end-date-picker",
238
- className: b("mb-1 block text-sm font-medium", l && "cursor-pointer", ne),
239
- children: /* @__PURE__ */ s("span", { children: o.endDate })
278
+ className: k("mb-1 block text-sm font-medium", D && "cursor-pointer", L),
279
+ children: /* @__PURE__ */ s("span", { children: t.endDate })
240
280
  }
241
281
  ),
242
- se ? /* @__PURE__ */ s(
243
- ve,
282
+ de ? /* @__PURE__ */ s(
283
+ we,
244
284
  {
245
285
  id: "end-date-picker",
246
- value: a ?? null,
247
- placeholder: o.pickEndDate,
286
+ value: r ?? null,
287
+ placeholder: t.pickEndDate,
248
288
  triggerTestId: "end-date-trigger",
249
- isHydrated: q,
250
- open: l ? !1 : d,
289
+ isHydrated: I,
290
+ open: D ? !1 : d,
251
291
  onOpenChange: f,
252
- readOnly: l,
253
- openOnFocus: re,
292
+ readOnly: D,
293
+ openOnFocus: O,
254
294
  onValueUpdate: (e) => {
255
- const t = (() => {
295
+ const n = (() => {
256
296
  if (!d || typeof document > "u")
257
297
  return !1;
258
- const n = document.activeElement;
259
- return n instanceof HTMLElement && n.id === "end-date-picker";
298
+ const o = document.activeElement;
299
+ return o instanceof HTMLElement && o.id === "end-date-picker";
260
300
  })();
261
301
  if (!i || !e || e < i) {
262
- m(), t && L();
302
+ y(), n && R();
263
303
  return;
264
304
  }
265
- M(e), t && U(e);
305
+ p(e), n && G(e);
266
306
  },
267
307
  onChange: (e) => {
268
- if (m(), (() => {
308
+ if (y(), (() => {
269
309
  if (typeof document > "u")
270
310
  return h.current = !1, !1;
271
- const r = document.activeElement, c = h.current && r instanceof HTMLElement && r.id === "end-date-picker";
272
- return h.current = !1, c;
273
- })() || e && a && e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate())
311
+ const a = document.activeElement, u = h.current && a instanceof HTMLElement && a.id === "end-date-picker";
312
+ return h.current = !1, u;
313
+ })() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
274
314
  return;
275
- const n = (() => {
315
+ const o = (() => {
276
316
  if (!e || typeof document > "u")
277
317
  return !1;
278
- const r = document.activeElement;
279
- return r instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(r) || r.id === "end-date-picker") : !1;
318
+ const a = document.activeElement;
319
+ return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
280
320
  })();
281
- g(e ?? void 0, { openTimePicker: n });
321
+ c(e ?? void 0, { openTimePicker: o ? void 0 : !1 });
282
322
  },
283
- inputClassName: b(k.endDate && "border-destructive", N, A),
284
- dayPickerComponent: R,
323
+ inputClassName: k(g.endDate && "border-destructive", T, P),
324
+ dayPickerComponent: _,
285
325
  dayPickerProps: {
286
326
  id: "end-date-calendar",
287
- locale: K,
327
+ locale: M,
288
328
  showOutsideDays: !1,
289
- numberOfMonths: p,
290
- disabled: (e) => i && e < i || e < Y,
329
+ numberOfMonths: l,
330
+ disabled: (e) => i && e < i || e < U,
291
331
  initialFocus: !0,
292
332
  "data-testid": "end-date-calendar"
293
333
  },
294
- portalContainer: D
334
+ portalContainer: S
295
335
  }
296
336
  ) : /* @__PURE__ */ s(
297
- le,
337
+ De,
298
338
  {
299
339
  id: "end-date-picker",
300
- value: a ?? null,
301
- placeholder: o.pickEndDate,
340
+ value: r ?? null,
341
+ placeholder: t.pickEndDate,
302
342
  triggerTestId: "end-date-trigger",
303
- isHydrated: q,
304
- open: l ? !1 : d,
343
+ isHydrated: I,
344
+ open: D ? !1 : d,
305
345
  onOpenChange: f,
306
- readOnly: l,
346
+ readOnly: D,
307
347
  onValueUpdate: (e) => {
308
- const t = (() => {
348
+ const n = (() => {
309
349
  if (!d || typeof document > "u")
310
350
  return !1;
311
- const n = document.activeElement;
312
- return n instanceof HTMLElement && n.id === "end-date-picker";
351
+ const o = document.activeElement;
352
+ return o instanceof HTMLElement && o.id === "end-date-picker";
313
353
  })();
314
354
  if (!i || !e || e < i) {
315
- m(), t && L();
355
+ y(), n && R();
316
356
  return;
317
357
  }
318
- M(e), t && U(e);
358
+ p(e), n && G(e);
319
359
  },
320
360
  onChange: (e) => {
321
- if (m(), (() => {
361
+ if (y(), (() => {
322
362
  if (typeof document > "u")
323
363
  return h.current = !1, !1;
324
- const r = document.activeElement, c = h.current && r instanceof HTMLElement && r.id === "end-date-picker";
325
- return h.current = !1, c;
326
- })() || e && a && e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate())
364
+ const a = document.activeElement, u = h.current && a instanceof HTMLElement && a.id === "end-date-picker";
365
+ return h.current = !1, u;
366
+ })() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
327
367
  return;
328
- const n = (() => {
368
+ const o = (() => {
329
369
  if (!e || typeof document > "u")
330
370
  return !1;
331
- const r = document.activeElement;
332
- return r instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(r) || r.id === "end-date-picker") : !1;
371
+ const a = document.activeElement;
372
+ return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
333
373
  })();
334
- g(e ?? void 0, { openTimePicker: n });
374
+ c(e ?? void 0, { openTimePicker: o ? void 0 : !1 });
335
375
  },
336
- inputClassName: b(k.endDate && "border-destructive", N, A),
337
- dayPickerComponent: R,
376
+ inputClassName: k(g.endDate && "border-destructive", T, P),
377
+ dayPickerComponent: _,
338
378
  dayPickerProps: {
339
379
  id: "end-date-calendar",
340
- locale: K,
380
+ locale: M,
341
381
  showOutsideDays: !1,
342
- numberOfMonths: p,
343
- disabled: (e) => i && e < i || e < Y,
382
+ numberOfMonths: l,
383
+ disabled: (e) => i && e < i || e < U,
344
384
  initialFocus: !0,
345
385
  "data-testid": "end-date-calendar"
346
386
  }
347
387
  }
348
388
  ),
349
- k.endDate && /* @__PURE__ */ s(be, { children: k.endDate })
389
+ g.endDate && /* @__PURE__ */ s(Pe, { children: g.endDate })
350
390
  ]
351
391
  }
352
392
  );
353
393
  };
354
394
  export {
355
- xe as BookingEndDateField
395
+ qe as BookingEndDateField
356
396
  };
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CAmK/B,CAAA"}
1
+ {"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CA8J/B,CAAA"}