@wix/form-elements 1.160.0 → 1.161.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.
- package/dist/component/{appointment-rac-BmHu56e5.js → appointment-rac-BubC8I9X.js} +395 -388
- package/dist/component/{bookings-address-rac-DY9l2g0h.js → bookings-address-rac-BbwvVs86.js} +1 -1
- package/dist/component/{bookings-email-rac-B5vNSOsS.js → bookings-email-rac-C2HCkcfa.js} +1 -1
- package/dist/component/{bookings-first-name-rac-CJiefCNz.js → bookings-first-name-rac-Uy7c5EBs.js} +1 -1
- package/dist/component/{bookings-header-rac-BFu7Ko5w.js → bookings-header-rac-nmwsWRjS.js} +1 -1
- package/dist/component/{bookings-last-name-rac-DegMM13h.js → bookings-last-name-rac-BAioQLCg.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DrA-5tBH.js → bookings-login-bar-rac-CO6vOBjG.js} +7 -7
- package/dist/component/{bookings-phone-rac-DsaeqxCI.js → bookings-phone-rac-Cr16h-_R.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-jRHiwqi8.js → bookings-rich-text-rac-CHLH3jd7.js} +1 -1
- package/dist/component/{checkbox-field-rac-CyoBb6Yf.js → checkbox-field-rac-CMwmwFMD.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-Bv1gU3oL.js → checkbox-group-field-headless-BNs_S-nT.js} +24 -24
- package/dist/component/{checkbox-group-field-rac-DasArcdV.js → checkbox-group-field-rac-BA60EPAN.js} +12 -12
- package/dist/component/{checkbox-group-rac-CzmufV1U.js → checkbox-group-rac-BJZ4Oer9.js} +1 -1
- package/dist/component/{checkbox-rac-6C7XoUoZ.js → checkbox-rac-KsVlI6_V.js} +1 -1
- package/dist/component/{contacts-address-rac-BZobbFtz.js → contacts-address-rac-CRYkz87z.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DIzf41DS.js → contacts-birthdate-rac-BIz-1-ZX.js} +1 -1
- package/dist/component/{contacts-company-rac-BiBDO28r.js → contacts-company-rac-B8G__j6I.js} +1 -1
- package/dist/component/{contacts-email-rac-5mqokCSD.js → contacts-email-rac-Dztkvp5i.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BXe3_Nz5.js → contacts-first-name-rac-CVSEWpLU.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Cfqgh7u1.js → contacts-last-name-rac-Blz4M5bk.js} +1 -1
- package/dist/component/{contacts-phone-rac-cmLUWnAc.js → contacts-phone-rac-CPCE5soY.js} +1 -1
- package/dist/component/{contacts-position-rac-DTyvklfN.js → contacts-position-rac-Dd_kBjqG.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-D-ZEX1A3.js → contacts-subscribe-rac-C6AlsP10.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B4NYJwWt.js → contacts-tax-id-rac-CQ1n29zI.js} +1 -1
- package/dist/component/{date-availability-Dach9aRC.js → date-availability-DDj1j0z5.js} +1 -1
- package/dist/component/{date-input-field-rac-B72mHcya.js → date-input-field-rac-D5r1n_ah.js} +59 -59
- package/dist/component/{date-input-rac-CYix11gT.js → date-input-rac-Cyi5mU_P.js} +1 -1
- package/dist/component/{date-picker-field-rac-B8pvtPir.js → date-picker-field-rac-CeG391Zo.js} +34 -34
- package/dist/component/{date-picker-rac-D6cR0zH9.js → date-picker-rac-Ci9aHgav.js} +1 -1
- package/dist/component/{date-time-input-field-rac-B7Y3Yf5l.js → date-time-input-field-rac-CrbYEbJJ.js} +89 -89
- package/dist/component/{date-time-input-rac-DMN-noQX.js → date-time-input-rac-DDJLkqs0.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-Kq0GnteP.js → dext-checkbox-group-rac-C3ftVHBA.js} +4 -4
- package/dist/component/{dext-checkbox-rac-BY9GZ4n1.js → dext-checkbox-rac-BGLYWn68.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CXArIddp.js → dext-date-picker-rac-Cy9RlDlt.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-B39TtxGq.js → dext-date-time-input-rac-88ZoTd5e.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C3y0G8cS.js → dext-dropdown-rac-CPxDUuk9.js} +1 -1
- package/dist/component/{dext-email-rac-BIg3cq7Q.js → dext-email-rac-BAvQwDPA.js} +1 -1
- package/dist/component/{dext-number-input-rac-27sHJ7yN.js → dext-number-input-rac-D7HYQVKq.js} +1 -1
- package/dist/component/{dext-phone-rac-CcohoFQp.js → dext-phone-rac--FhcplSI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-eead3Gve.js → dext-radio-group-rac-DBz8iCKW.js} +2 -2
- package/dist/component/{dext-rating-input-rac-B_E6OcBr.js → dext-rating-input-rac-Cv7nThfe.js} +1 -1
- package/dist/component/{dext-tags-rac-Yd9aAtnF.js → dext-tags-rac-CRUUc5dr.js} +2 -2
- package/dist/component/{dext-text-area-rac-CMACri2C.js → dext-text-area-rac-DQBQXV1L.js} +1 -1
- package/dist/component/{dext-text-input-rac-sNjSCfQ-.js → dext-text-input-rac-4CpM581y.js} +1 -1
- package/dist/component/{dext-url-input-rac-DwhbzJty.js → dext-url-input-rac-0C1jTEr9.js} +1 -1
- package/dist/component/{donation-rac-BVAN3kMk.js → donation-rac-Cgt0ZE50.js} +68 -68
- package/dist/component/{dropdown-field-rac-DdoGigWx.js → dropdown-field-rac-DlGKR7pZ.js} +3 -3
- package/dist/component/{dropdown-rac-CRkt5w47.js → dropdown-rac-CYFW_3x_.js} +1 -1
- package/dist/component/{ecom-address-rac-C36hFHW0.js → ecom-address-rac-CQfQHpXC.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-BKfQ348w.js → ecom-subscription-checkbox-rac-D2v2Upvz.js} +2 -2
- package/dist/component/{email-input-field-rac-MOaISYxa.js → email-input-field-rac-CVw25yRo.js} +45 -45
- package/dist/component/{events-repeater-rac-D6p-NgE8.js → events-repeater-rac-BCVUcmFj.js} +22 -22
- package/dist/component/{events-rsvp-rac-DVpgN8gm.js → events-rsvp-rac-DwbqEr8z.js} +3 -3
- package/dist/component/{field-error-headless-XNWmDH3E.js → field-error-headless-XnVcMmsL.js} +3 -3
- package/dist/component/{field-label-headless-CORRAJGt.js → field-label-headless-BRTLT2Yt.js} +14 -14
- package/dist/component/{file-upload-rac-DRMr7E4b.js → file-upload-rac-Dkwg9Jk4.js} +115 -115
- package/dist/component/{fixed-payment-rac-BUXzNex9.js → fixed-payment-rac-ST98xAa2.js} +20 -20
- package/dist/component/{form-DSpx-AO8.js → form-BUqSKOvc.js} +235 -234
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CiDXlNsa.js → header-field-rac-CzNTGYWq.js} +5 -5
- package/dist/component/{header-rac-B5Rg-h8u.js → header-rac-DUt6AIAE.js} +1 -1
- package/dist/component/{image-choice-rac-CtoA_KDp.js → image-choice-rac-DuBgrSt2.js} +21 -21
- package/dist/component/{index-Bz7ZhQsF.js → index-CDO22hht.js} +106 -106
- package/dist/component/{index-CwruESwc.js → index-cZZeAuuu.js} +5 -5
- package/dist/component/{isObjectLike-C5dHxHP0.js → isObjectLike-cs4bARpC.js} +3 -3
- package/dist/component/{multiline-address-field-rac-Z-qF366L.js → multiline-address-field-rac-vcEWhUCV.js} +73 -73
- package/dist/component/{multiline-address-rac-CJIHTMw5.js → multiline-address-rac-WQaI2eUX.js} +1 -1
- package/dist/component/{number-input-field-rac-D4vf6I6N.js → number-input-field-rac-CBUMqATk.js} +26 -26
- package/dist/component/{number-input-rac-B2jW6JUQ.js → number-input-rac-B4j5hyzS.js} +1 -1
- package/dist/component/{password-rac-DGRZ17Jl.js → password-rac-DwLyf45N.js} +28 -28
- package/dist/component/{payment-input-rac-BtD-tAKv.js → payment-input-rac-D0Od---y.js} +28 -28
- package/dist/component/{phone-input-field-rac-KD4-APhr.js → phone-input-field-rac-COlu9IeC.js} +64 -64
- package/dist/component/{phone-rac-Cw2yccgg.js → phone-rac-Dh4RacOF.js} +1 -1
- package/dist/component/{product-list-rac-XbzTDdbp.js → product-list-rac-D7zHDE2D.js} +47 -47
- package/dist/component/{quiz-radio-group-rac-BDw_mAw5.js → quiz-radio-group-rac-1AaKphJt.js} +1 -1
- package/dist/component/{radio-button-module-classes-CFGf0Hzh.js → radio-button-module-classes-VqaP6vpA.js} +29 -29
- package/dist/component/{radio-group-field-rac-CXN7tyVu.js → radio-group-field-rac-Cp3LRN3C.js} +6 -6
- package/dist/component/{radio-group-rac-COHzqjBh.js → radio-group-rac-KhmhzYGf.js} +1 -1
- package/dist/component/{rating-input-field-rac-DCXNZgf1.js → rating-input-field-rac-10n6ciCr.js} +22 -22
- package/dist/component/{rating-input-rac-DwQt9ML7.js → rating-input-rac-XZjjY2Gp.js} +1 -1
- package/dist/component/{rich-content-rac.module-B7rPwNns.js → rich-content-rac.module-kMwDoLBa.js} +1 -1
- package/dist/component/{rich-text-field-rac-DlER7NRD.js → rich-text-field-rac-H5bd8fAt.js} +6 -6
- package/dist/component/{rich-text-rac-CjicsHA7.js → rich-text-rac-88GSQR62.js} +1 -1
- package/dist/component/{service-dropdown-rac-B81LC_6_.js → service-dropdown-rac-B1_Xr_X3.js} +31 -31
- package/dist/component/{services-multi-choice-rac-BR6gZeHk.js → services-multi-choice-rac-DWp_Llbi.js} +17 -17
- package/dist/component/{signature-rac-XFj7Ddtp.js → signature-rac-zN_6KRDp.js} +44 -44
- package/dist/component/{submit-button-rac-Bz7zs_3W.js → submit-button-rac-Dv6UarYX.js} +2 -2
- package/dist/component/{tags-field-rac-DWWkNKqc.js → tags-field-rac-sVN6MHfJ.js} +38 -38
- package/dist/component/{tags-rac-BXyiQ9i1.js → tags-rac-DhTHs_XN.js} +1 -1
- package/dist/component/{text-area-field-rac-DsIRYi0d.js → text-area-field-rac-DrWkww7W.js} +21 -21
- package/dist/component/{text-area-rac-CF9pDP9d.js → text-area-rac-CXXh-ZdY.js} +1 -1
- package/dist/component/{text-input-field-rac-BwIDZACz.js → text-input-field-rac-C2YiMr-g.js} +3 -3
- package/dist/component/{text-input-headless-5kQs2_Xu.js → text-input-headless-BJMNbsMY.js} +12 -12
- package/dist/component/{text-input-rac-CRmSuw1k.js → text-input-rac-CpsPh7FH.js} +1 -1
- package/dist/component/{time-input-rac-BRMNpe51.js → time-input-rac-DG_1KxS4.js} +23 -23
- package/dist/component/{url-input-field-rac-CKLS3QDk.js → url-input-field-rac-twxRREnl.js} +26 -26
- package/dist/component/{url-input-rac-Dv-kp50D.js → url-input-rac-BTStO0NP.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BQi_qE_-.js → use-dropdown-option-class-name-DbMMg1ws.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-bAK8aHiG.js → use-dropdown-trigger-class-name-Yes4kC_0.js} +17 -17
- package/dist/component/{use-element-state-class-name-rXM_lHug.js → use-element-state-class-name-DlncY4hk.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-BnV_uerV.js → use-hoverable-input-class-name-C__zqP5j.js} +2 -2
- package/dist/component/use-is-forced-open-dropdown-DnK_MQRO.js +53 -0
- package/dist/component/{use-service-options-base-CLeE9-Tx.js → use-service-options-base-DKJe52Vk.js} +6 -6
- package/dist/component/use-text-input-class-name-D9tJTR-b.js +6 -0
- package/dist/form.d.ts +3 -0
- package/package.json +2 -2
- package/dist/component/use-is-forced-open-dropdown-Bp-5Xpmw.js +0 -53
- package/dist/component/use-text-input-class-name-DIKWvfkm.js +0 -6
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import o, { useRef as X, useState as Q, useEffect as P, createContext as Ke, useContext as $e, useMemo as
|
|
1
|
+
import o, { useRef as X, useState as Q, useEffect as P, createContext as Ke, useContext as $e, useMemo as B, useCallback as re } from "react";
|
|
2
2
|
import { RicosViewer as it } from "@wix/ricos/viewer";
|
|
3
|
-
import
|
|
3
|
+
import g from "classnames";
|
|
4
4
|
import { C as he } from "./chevron-down-icon-CcpVm6B-.js";
|
|
5
5
|
import { E as lt } from "./error-icon-hZxQ6DEy.js";
|
|
6
6
|
import { g as ct, c as Ce } from "./calendar.module-CKCBG_Pg.js";
|
|
7
7
|
import { H as me } from "./custom-focus-class-_483Pkwp.js";
|
|
8
8
|
import { s as ue } from "./field-rac.module-DP0lkkEv.js";
|
|
9
|
-
import {
|
|
10
|
-
import { u as
|
|
11
|
-
import { ListBox as
|
|
12
|
-
import { f as
|
|
13
|
-
import { D as
|
|
14
|
-
import { L as
|
|
15
|
-
import { F as
|
|
9
|
+
import { bs as Ee, br as mt, bw as ge, bu as ut, bK as dt, bJ as Dt, bA as ie, bx as le, bC as ft, bz as Et, F as St, h as _t, W as Nt, ac as pt, g as At, j as We, i as yt, n as It, k as Ot, l as Lt, M as Tt, G as bt, m as gt } from "./form-BUqSKOvc.js";
|
|
10
|
+
import { u as vt } from "./use-element-state-class-name-DlncY4hk.js";
|
|
11
|
+
import { ListBox as Rt, Button as ve, ListBoxItem as kt, RadioGroup as Mt, RadioField as Ft, RadioButton as wt } from "react-aria-components";
|
|
12
|
+
import { f as v, a as Se } from "./find-child-C60k4CxG.js";
|
|
13
|
+
import { D as ht, E as Ct } from "./field-error-headless-XnVcMmsL.js";
|
|
14
|
+
import { L as Wt } from "./field-label-headless-BRTLT2Yt.js";
|
|
15
|
+
import { F as xt } from "./fieldset-headless-CD3fds9J.js";
|
|
16
16
|
import "date-fns";
|
|
17
17
|
import { V as Ge } from "./headless-styles-CmcyA_pi.js";
|
|
18
|
-
function
|
|
18
|
+
function Bt(e) {
|
|
19
19
|
return { evid: 40, src: 16, endpoint: "", params: e };
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var De = /* @__PURE__ */ (function(e) {
|
|
22
22
|
return e.BOOKING_NOT_INSTALL = "BOOKING_NOT_INSTALL", e.NO_AVAILABILITY_DATES_FOUND = "NO_AVAILABILITY_DATES_FOUND", e.GENERAL = "GENERAL", e;
|
|
23
|
-
})({}),
|
|
23
|
+
})({}), W = /* @__PURE__ */ (function(e) {
|
|
24
24
|
return e.LOADING = "LOADING", e.DONE = "DONE", e.ERROR = "ERROR", e;
|
|
25
25
|
})({});
|
|
26
26
|
const q = 4;
|
|
@@ -29,14 +29,14 @@ var J = /* @__PURE__ */ (function(e) {
|
|
|
29
29
|
})({}), ne = /* @__PURE__ */ (function(e) {
|
|
30
30
|
return e.LOAD = "load", e.CLICK = "click", e;
|
|
31
31
|
})({});
|
|
32
|
-
const
|
|
32
|
+
const Pt = (e) => {
|
|
33
33
|
var t;
|
|
34
34
|
return {
|
|
35
35
|
bookingsServiceId: e == null ? void 0 : e.id,
|
|
36
36
|
formGuid: (t = e == null ? void 0 : e.form) == null ? void 0 : t.id,
|
|
37
|
-
serviceProperties:
|
|
37
|
+
serviceProperties: Ut(e)
|
|
38
38
|
};
|
|
39
|
-
},
|
|
39
|
+
}, Ut = (e) => {
|
|
40
40
|
var t;
|
|
41
41
|
return JSON.stringify({
|
|
42
42
|
serviceId: e == null ? void 0 : e.id,
|
|
@@ -46,14 +46,14 @@ const xt = (e) => {
|
|
|
46
46
|
isOfferedAsPricingPlan: !1
|
|
47
47
|
});
|
|
48
48
|
}, Ze = (e) => {
|
|
49
|
-
var
|
|
50
|
-
const { appointmentFieldProps: t } =
|
|
49
|
+
var l;
|
|
50
|
+
const { appointmentFieldProps: t } = Re(), { isEditor: n, isComposer: a } = Ee(), r = mt(), s = e || ((l = t == null ? void 0 : t.initialData) == null ? void 0 : l.service);
|
|
51
51
|
if (!(n || a))
|
|
52
52
|
return {
|
|
53
|
-
...
|
|
54
|
-
report: (
|
|
55
|
-
...
|
|
56
|
-
...
|
|
53
|
+
...r,
|
|
54
|
+
report: (i) => r == null ? void 0 : r.report(Bt({
|
|
55
|
+
...Pt(s),
|
|
56
|
+
...i
|
|
57
57
|
}))
|
|
58
58
|
};
|
|
59
59
|
};
|
|
@@ -77,52 +77,52 @@ var Ue;
|
|
|
77
77
|
(function(e) {
|
|
78
78
|
e.ASC = "ASC", e.DESC = "DESC";
|
|
79
79
|
})(Ue || (Ue = {}));
|
|
80
|
-
const
|
|
80
|
+
const zt = (e) => {
|
|
81
81
|
const { service: t } = e || {};
|
|
82
82
|
return (t == null ? void 0 : t.id) ? null : {
|
|
83
|
-
type:
|
|
83
|
+
type: De.GENERAL,
|
|
84
84
|
message: "Service ID is missing"
|
|
85
85
|
};
|
|
86
|
-
},
|
|
87
|
-
const { initialData: a } = e,
|
|
86
|
+
}, Yt = ({ appointmentFieldProps: e, isEditor: t, isComposer: n }) => {
|
|
87
|
+
const { initialData: a } = e, r = $t();
|
|
88
88
|
if (t || n)
|
|
89
89
|
return {
|
|
90
|
-
...
|
|
90
|
+
...r,
|
|
91
91
|
timezone: Ve(),
|
|
92
|
-
dataStatus:
|
|
92
|
+
dataStatus: W.DONE
|
|
93
93
|
};
|
|
94
94
|
{
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
95
|
+
const s = zt(a);
|
|
96
|
+
if (s)
|
|
97
97
|
return {
|
|
98
|
-
dataStatus:
|
|
99
|
-
error:
|
|
98
|
+
dataStatus: W.ERROR,
|
|
99
|
+
error: s
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
|
-
...
|
|
104
|
-
dataStatus:
|
|
103
|
+
...r,
|
|
104
|
+
dataStatus: W.LOADING
|
|
105
105
|
};
|
|
106
|
-
},
|
|
106
|
+
}, Ht = (e, t) => {
|
|
107
107
|
const n = /* @__PURE__ */ new Date(), a = new Date(n);
|
|
108
108
|
a.setMonth(a.getMonth() + e);
|
|
109
|
-
const
|
|
109
|
+
const r = new Date(n.toLocaleString("en-US", {
|
|
110
110
|
timeZone: t
|
|
111
|
-
})),
|
|
111
|
+
})), s = new Date(a.toLocaleString("en-US", {
|
|
112
112
|
timeZone: t
|
|
113
113
|
}));
|
|
114
114
|
return {
|
|
115
|
-
startDate:
|
|
116
|
-
endDate:
|
|
115
|
+
startDate: r,
|
|
116
|
+
endDate: s
|
|
117
117
|
};
|
|
118
|
-
}, Ve = () => Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
118
|
+
}, Ve = () => Intl.DateTimeFormat().resolvedOptions().timeZone, Kt = (e) => {
|
|
119
119
|
var t, n, a;
|
|
120
120
|
if ((n = (t = e == null ? void 0 : e[0]) == null ? void 0 : t.slot) != null && n.startDate)
|
|
121
121
|
return new Date((a = e[0].slot) == null ? void 0 : a.startDate);
|
|
122
|
-
},
|
|
122
|
+
}, $t = ({ duration: e = 60, timezone: t = "UTC" } = {}) => {
|
|
123
123
|
var E, d;
|
|
124
|
-
const n = "267d1c11-8019-4e3d-b9c6-cd2b859c69e2", a = /* @__PURE__ */ new Date(),
|
|
125
|
-
let D = /* @__PURE__ */ new Date(`${
|
|
124
|
+
const n = "267d1c11-8019-4e3d-b9c6-cd2b859c69e2", a = /* @__PURE__ */ new Date(), r = [], s = [], l = a.toISOString().split("T")[0], i = 10, c = 18;
|
|
125
|
+
let D = /* @__PURE__ */ new Date(`${l}T${i}:00:00`), u = new Date(D);
|
|
126
126
|
u.setMinutes(u.getMinutes() + e);
|
|
127
127
|
let S = !1;
|
|
128
128
|
for (; u.getHours() < c || u.getHours() === c && u.getMinutes() === 0; ) {
|
|
@@ -145,78 +145,78 @@ const Pt = (e) => {
|
|
|
145
145
|
},
|
|
146
146
|
nestedSlots: []
|
|
147
147
|
};
|
|
148
|
-
|
|
148
|
+
s.push(b), S || (r.push(b), S = !0), D = new Date(u), u = new Date(D), u.setMinutes(u.getMinutes() + e);
|
|
149
149
|
}
|
|
150
150
|
return {
|
|
151
|
-
availabilitySlots:
|
|
152
|
-
availabilityDates:
|
|
151
|
+
availabilitySlots: s,
|
|
152
|
+
availabilityDates: r,
|
|
153
153
|
timezone: t,
|
|
154
154
|
currentSlotBulkSize: q,
|
|
155
|
-
selectedDate:
|
|
155
|
+
selectedDate: r.length > 0 && ((d = (E = r[0]) == null ? void 0 : E.slot) != null && d.startDate) ? new Date(r[0].slot.startDate) : void 0
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
|
-
function
|
|
158
|
+
function Gt(e) {
|
|
159
159
|
var d;
|
|
160
|
-
const { initialData: t, onChange: n, value: a } = e, { isEditor:
|
|
161
|
-
c.current =
|
|
162
|
-
const D = !!(
|
|
160
|
+
const { initialData: t, onChange: n, value: a } = e, { isEditor: r, isComposer: s } = Ee(), l = (d = t == null ? void 0 : t.service) == null ? void 0 : d.id, { actions: i } = ge(), c = X(i);
|
|
161
|
+
c.current = i;
|
|
162
|
+
const D = !!(i != null && i.getAvailabilityDates && (i != null && i.getAvailabilitySlots)), [u, S] = Q(null), E = Ze(t == null ? void 0 : t.service);
|
|
163
163
|
return P(() => {
|
|
164
|
-
|
|
165
|
-
var I,
|
|
166
|
-
const
|
|
164
|
+
l && !r && !s && D && (async () => {
|
|
165
|
+
var I, O, U, z, Y;
|
|
166
|
+
const M = Ve(), A = {
|
|
167
167
|
currentSlotBulkSize: q,
|
|
168
|
-
timezone:
|
|
169
|
-
dataStatus:
|
|
168
|
+
timezone: M,
|
|
169
|
+
dataStatus: W.LOADING
|
|
170
170
|
};
|
|
171
171
|
try {
|
|
172
|
-
const
|
|
173
|
-
var _,
|
|
174
|
-
const { startDate: $, endDate:
|
|
175
|
-
return (
|
|
176
|
-
serviceId:
|
|
172
|
+
const H = async (oe) => {
|
|
173
|
+
var _, N;
|
|
174
|
+
const { startDate: $, endDate: F } = Ht(oe, M);
|
|
175
|
+
return (N = (_ = c.current) == null ? void 0 : _.getAvailabilityDates) == null ? void 0 : N.call(_, {
|
|
176
|
+
serviceId: l,
|
|
177
177
|
fromDate: $,
|
|
178
|
-
toDate:
|
|
179
|
-
timeZone:
|
|
178
|
+
toDate: F,
|
|
179
|
+
timeZone: M
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
-
if (
|
|
182
|
+
if (A.availabilityDates = await H(2), (I = A.availabilityDates) != null && I.length || (A.availabilityDates = await H(6)), !((O = A.availabilityDates) != null && O.length)) {
|
|
183
183
|
E == null || E.report({
|
|
184
184
|
action: ne.LOAD,
|
|
185
185
|
component: J.NO_AVAILABILITY_AT_ALL
|
|
186
186
|
}), S({
|
|
187
|
-
dataStatus:
|
|
187
|
+
dataStatus: W.ERROR,
|
|
188
188
|
error: {
|
|
189
|
-
type:
|
|
189
|
+
type: De.NO_AVAILABILITY_DATES_FOUND,
|
|
190
190
|
message: "No availability dates found"
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
serviceId:
|
|
197
|
-
timeZone:
|
|
198
|
-
selectedDate:
|
|
195
|
+
A.selectedDate = Kt(A.availabilityDates), A.selectedDate && (A.availabilitySlots = await ((z = (U = c.current) == null ? void 0 : U.getAvailabilitySlots) == null ? void 0 : z.call(U, {
|
|
196
|
+
serviceId: l,
|
|
197
|
+
timeZone: M,
|
|
198
|
+
selectedDate: A.selectedDate
|
|
199
199
|
}))), E == null || E.report({
|
|
200
200
|
action: ne.LOAD,
|
|
201
|
-
component: (
|
|
201
|
+
component: (Y = A.availabilityDates) != null && Y.length ? J.FORM : J.NO_AVAILABILITY_FOR_DATE
|
|
202
202
|
}), a != null && a.startDate || n(void 0), S({
|
|
203
|
-
...
|
|
204
|
-
dataStatus:
|
|
203
|
+
...A,
|
|
204
|
+
dataStatus: W.DONE
|
|
205
205
|
});
|
|
206
|
-
} catch (
|
|
207
|
-
console.error(
|
|
208
|
-
dataStatus:
|
|
206
|
+
} catch (H) {
|
|
207
|
+
console.error(H), S({
|
|
208
|
+
dataStatus: W.ERROR,
|
|
209
209
|
error: {
|
|
210
|
-
type:
|
|
210
|
+
type: De.GENERAL,
|
|
211
211
|
message: "An error occurred in initialAppointmentState"
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
})();
|
|
216
216
|
}, [
|
|
217
|
-
s,
|
|
218
217
|
r,
|
|
219
|
-
|
|
218
|
+
s,
|
|
219
|
+
l,
|
|
220
220
|
D
|
|
221
221
|
]), u;
|
|
222
222
|
}
|
|
@@ -224,14 +224,21 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
224
224
|
appointmentState: {},
|
|
225
225
|
setAppointmentState: () => {
|
|
226
226
|
}
|
|
227
|
-
}),
|
|
228
|
-
|
|
227
|
+
}), Zt = {
|
|
228
|
+
dataStatus: W.ERROR,
|
|
229
|
+
error: {
|
|
230
|
+
type: De.NO_AVAILABILITY_DATES_FOUND,
|
|
231
|
+
message: "No availability dates found"
|
|
232
|
+
}
|
|
233
|
+
}, Vt = ({ appointmentFieldProps: e, children: t }) => {
|
|
234
|
+
var c;
|
|
235
|
+
const { isEditor: n, isComposer: a } = Ee(), r = ((c = ut().appointment) == null ? void 0 : c.noAvailability) === !0, [s, l] = Q(() => Yt({
|
|
229
236
|
appointmentFieldProps: e,
|
|
230
237
|
isEditor: n,
|
|
231
238
|
isComposer: a
|
|
232
|
-
})), i =
|
|
239
|
+
})), i = Gt(e);
|
|
233
240
|
return P(() => {
|
|
234
|
-
i &&
|
|
241
|
+
i && l({
|
|
235
242
|
...s,
|
|
236
243
|
...i
|
|
237
244
|
});
|
|
@@ -240,14 +247,14 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
240
247
|
]), /* @__PURE__ */ o.createElement(qe.Provider, {
|
|
241
248
|
value: {
|
|
242
249
|
appointmentFieldProps: e,
|
|
243
|
-
appointmentState: s,
|
|
244
|
-
setAppointmentState: (
|
|
250
|
+
appointmentState: r ? Zt : s,
|
|
251
|
+
setAppointmentState: (D) => l({
|
|
245
252
|
...s,
|
|
246
|
-
...
|
|
253
|
+
...D
|
|
247
254
|
})
|
|
248
255
|
}
|
|
249
256
|
}, t);
|
|
250
|
-
},
|
|
257
|
+
}, Re = () => $e(qe), qt = (e, t) => {
|
|
251
258
|
if (e.startOfWeek.getMonth() === e.endOfWeek.getMonth())
|
|
252
259
|
return new Intl.DateTimeFormat(t, {
|
|
253
260
|
month: "long",
|
|
@@ -260,17 +267,17 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
260
267
|
year: "numeric"
|
|
261
268
|
}).format(e.endOfWeek);
|
|
262
269
|
return `${n} - ${a}`;
|
|
263
|
-
},
|
|
270
|
+
}, jt = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) || !(e != null && e.timeZone) ? null : {
|
|
264
271
|
startDate: e == null ? void 0 : e.startDate,
|
|
265
272
|
endDate: e == null ? void 0 : e.endDate,
|
|
266
273
|
timeZone: e == null ? void 0 : e.timeZone
|
|
267
274
|
}, ze = ({ timezone: e, language: t, formatType: n }) => {
|
|
268
|
-
var
|
|
269
|
-
return (
|
|
275
|
+
var r;
|
|
276
|
+
return (r = new Intl.DateTimeFormat(t, {
|
|
270
277
|
timeZone: e,
|
|
271
278
|
timeZoneName: n === "name" ? "long" : "short"
|
|
272
|
-
}).formatToParts(/* @__PURE__ */ new Date()).find(({ type:
|
|
273
|
-
},
|
|
279
|
+
}).formatToParts(/* @__PURE__ */ new Date()).find(({ type: s }) => s === "timeZoneName")) == null ? void 0 : r.value;
|
|
280
|
+
}, Qt = ({ timezone: e, language: t }) => {
|
|
274
281
|
const n = ze({
|
|
275
282
|
timezone: e,
|
|
276
283
|
language: t,
|
|
@@ -281,7 +288,7 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
281
288
|
formatType: "offset"
|
|
282
289
|
});
|
|
283
290
|
return `${n} (${a})`;
|
|
284
|
-
}, ae = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(),
|
|
291
|
+
}, ae = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), Jt = (e, t) => {
|
|
285
292
|
const n = new Date(e);
|
|
286
293
|
n.setDate(e.getDate() - t);
|
|
287
294
|
const a = new Date(e);
|
|
@@ -289,21 +296,21 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
289
296
|
fromDate: n,
|
|
290
297
|
toDate: a
|
|
291
298
|
};
|
|
292
|
-
},
|
|
293
|
-
const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } =
|
|
299
|
+
}, Xt = ({ setIsReloadingSlots: e }) => {
|
|
300
|
+
const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } = Re(), { value: r } = t, { actions: s } = ge();
|
|
294
301
|
P(() => {
|
|
295
302
|
(async () => {
|
|
296
|
-
var
|
|
297
|
-
if (
|
|
303
|
+
var i, c;
|
|
304
|
+
if (r != null && r.startDate && (n != null && n.selectedDate) && (n == null ? void 0 : n.dataStatus) === W.DONE && !ae(new Date(r.startDate), n == null ? void 0 : n.selectedDate)) {
|
|
298
305
|
e(!0);
|
|
299
|
-
const u = new Date(
|
|
300
|
-
(
|
|
306
|
+
const u = new Date(r.startDate), { fromDate: S, toDate: E } = Jt(u, 8), [d, b] = await Promise.all([
|
|
307
|
+
(i = s == null ? void 0 : s.getAvailabilityDates) == null ? void 0 : i.call(s, {
|
|
301
308
|
serviceId: t == null ? void 0 : t.initialData.service.id,
|
|
302
309
|
timeZone: (n == null ? void 0 : n.timezone) || "",
|
|
303
310
|
fromDate: S,
|
|
304
311
|
toDate: E
|
|
305
312
|
}),
|
|
306
|
-
(c =
|
|
313
|
+
(c = s == null ? void 0 : s.getAvailabilitySlots) == null ? void 0 : c.call(s, {
|
|
307
314
|
serviceId: t == null ? void 0 : t.initialData.service.id,
|
|
308
315
|
timeZone: (n == null ? void 0 : n.timezone) || "",
|
|
309
316
|
selectedDate: u
|
|
@@ -317,197 +324,197 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
317
324
|
}
|
|
318
325
|
})();
|
|
319
326
|
}, [
|
|
320
|
-
|
|
327
|
+
r,
|
|
321
328
|
n == null ? void 0 : n.dataStatus
|
|
322
329
|
]);
|
|
323
|
-
},
|
|
330
|
+
}, en = (e, t) => !e || !t.length ? e : e.filter((n) => {
|
|
324
331
|
var a;
|
|
325
332
|
return !t.includes(((a = n == null ? void 0 : n.slot) == null ? void 0 : a.startDate) ?? "");
|
|
326
|
-
}), de = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) ? "" : `${e == null ? void 0 : e.startDate}_${e == null ? void 0 : e.endDate}`,
|
|
327
|
-
const
|
|
333
|
+
}), de = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) ? "" : `${e == null ? void 0 : e.startDate}_${e == null ? void 0 : e.endDate}`, tn = ({ locale: e, endDate: t, startDate: n, timezone: a }) => {
|
|
334
|
+
const r = {
|
|
328
335
|
hour: "numeric",
|
|
329
336
|
minute: "numeric",
|
|
330
337
|
timeZone: a
|
|
331
|
-
},
|
|
332
|
-
return `${
|
|
333
|
-
},
|
|
338
|
+
}, s = new Intl.DateTimeFormat(e, r).format(new Date(n)), l = new Intl.DateTimeFormat(e, r).format(new Date(t));
|
|
339
|
+
return `${s} - ${l}`;
|
|
340
|
+
}, nn = ({ selectedDate: e, locale: t, timezone: n }) => e ? new Intl.DateTimeFormat(t, {
|
|
334
341
|
weekday: "long",
|
|
335
342
|
month: "short",
|
|
336
343
|
day: "numeric",
|
|
337
344
|
timeZone: n
|
|
338
|
-
}).format(e) : "",
|
|
345
|
+
}).format(e) : "", an = (e, t) => {
|
|
339
346
|
let n;
|
|
340
|
-
return t.forEach((a,
|
|
341
|
-
var
|
|
347
|
+
return t.forEach((a, r) => {
|
|
348
|
+
var s, l;
|
|
342
349
|
de({
|
|
343
|
-
startDate: (
|
|
344
|
-
endDate: (
|
|
345
|
-
}) === e && (n =
|
|
350
|
+
startDate: (s = a == null ? void 0 : a.slot) == null ? void 0 : s.startDate,
|
|
351
|
+
endDate: (l = a == null ? void 0 : a.slot) == null ? void 0 : l.endDate
|
|
352
|
+
}) === e && (n = r);
|
|
346
353
|
}), n;
|
|
347
354
|
};
|
|
348
|
-
var
|
|
355
|
+
var on = /* @__PURE__ */ (function(e) {
|
|
349
356
|
return e.OS_LOCATION = "OS_LOCATION", e.CUSTOM_LOCATION = "CUSTOM_LOCATION", e;
|
|
350
357
|
})({});
|
|
351
|
-
const
|
|
358
|
+
const sn = "SLOT_UNAVAILABLE", rn = (e) => {
|
|
352
359
|
var t;
|
|
353
|
-
return ((t = e == null ? void 0 : e.params) == null ? void 0 : t.reason) ===
|
|
354
|
-
},
|
|
355
|
-
const [n, a] = Q([]),
|
|
360
|
+
return ((t = e == null ? void 0 : e.params) == null ? void 0 : t.reason) === sn;
|
|
361
|
+
}, ln = ({ error: e, selectedSlot: t }) => {
|
|
362
|
+
const [n, a] = Q([]), r = rn(e), s = t == null ? void 0 : t.startDate, l = X(!1);
|
|
356
363
|
return P(() => {
|
|
357
|
-
if (!
|
|
358
|
-
|
|
364
|
+
if (!r) {
|
|
365
|
+
l.current = !1;
|
|
359
366
|
return;
|
|
360
367
|
}
|
|
361
|
-
|
|
362
|
-
...
|
|
363
|
-
|
|
368
|
+
l.current || (l.current = !0, s && a((i) => i.includes(s) ? i : [
|
|
369
|
+
...i,
|
|
370
|
+
s
|
|
364
371
|
]));
|
|
365
372
|
}, [
|
|
366
|
-
|
|
367
|
-
|
|
373
|
+
r,
|
|
374
|
+
s
|
|
368
375
|
]), n;
|
|
369
376
|
}, j = 7, be = (e) => {
|
|
370
377
|
const t = new Date(e);
|
|
371
378
|
return t.setHours(0, 0, 0, 0), t;
|
|
372
|
-
},
|
|
379
|
+
}, cn = (e) => {
|
|
373
380
|
const t = new Date(e);
|
|
374
381
|
return t.setHours(23, 59, 59, 999), t;
|
|
375
382
|
}, te = (e, t) => {
|
|
376
383
|
const n = new Date(e);
|
|
377
384
|
return n.setDate(n.getDate() + t), n;
|
|
378
|
-
},
|
|
385
|
+
}, Ye = (e, t) => {
|
|
379
386
|
const n = be(e), a = (n.getDay() - t + j) % j;
|
|
380
387
|
return te(n, -a);
|
|
381
|
-
},
|
|
388
|
+
}, mn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, un = (e, t, n) => {
|
|
382
389
|
const a = new Intl.DateTimeFormat(n, {
|
|
383
390
|
month: "short",
|
|
384
391
|
day: "numeric"
|
|
385
392
|
});
|
|
386
393
|
return typeof a.formatRange == "function" ? a.formatRange(e, t) : `${a.format(e)} - ${a.format(t)}`;
|
|
387
|
-
},
|
|
394
|
+
}, dn = (e, t = []) => t.some((n) => {
|
|
388
395
|
var a;
|
|
389
396
|
return !!((a = n.slot) != null && a.startDate) && ae(new Date(n.slot.startDate), e);
|
|
390
|
-
}),
|
|
391
|
-
var
|
|
392
|
-
const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } =
|
|
393
|
-
|
|
397
|
+
}), Dn = () => {
|
|
398
|
+
var we;
|
|
399
|
+
const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } = Re(), { language: a, isEditor: r, isComposer: s } = Ee(), { t: l } = dt(), { actions: i } = ge(), c = Ze(), [D, u] = Q(!1), [S, E] = Q(!1), [d, b] = Q(), [M, A] = Q();
|
|
400
|
+
Xt({
|
|
394
401
|
setIsReloadingSlots: u
|
|
395
402
|
});
|
|
396
|
-
const { onChange: I, value:
|
|
403
|
+
const { onChange: I, value: O, target: U, initialData: z, formatDescription: Y, locationType: H, error: oe } = e, { availabilityDates: $, availabilitySlots: F, timezone: _ = "", selectedDate: N, currentSlotBulkSize: R, dataStatus: G, error: Z } = t, K = (we = z == null ? void 0 : z.service) == null ? void 0 : we.id, V = G === W.LOADING, ee = D || S, _e = !!Z, Me = ln({
|
|
397
404
|
error: oe,
|
|
398
|
-
selectedSlot:
|
|
399
|
-
}),
|
|
400
|
-
|
|
401
|
-
|
|
405
|
+
selectedSlot: O
|
|
406
|
+
}), y = B(() => en(F, Me), [
|
|
407
|
+
F,
|
|
408
|
+
Me
|
|
402
409
|
]);
|
|
403
410
|
P(() => {
|
|
404
|
-
I == null || I(
|
|
411
|
+
I == null || I(jt(O));
|
|
405
412
|
}, [
|
|
406
|
-
|
|
407
|
-
|
|
413
|
+
O == null ? void 0 : O.startDate,
|
|
414
|
+
O == null ? void 0 : O.endDate,
|
|
408
415
|
_
|
|
409
|
-
]),
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
availabilitySlots:
|
|
413
|
-
var
|
|
414
|
-
return ((
|
|
416
|
+
]), Dt((f) => {
|
|
417
|
+
const L = f == null ? void 0 : f[U];
|
|
418
|
+
F != null && F.length && n({
|
|
419
|
+
availabilitySlots: F.filter((T) => {
|
|
420
|
+
var k;
|
|
421
|
+
return ((k = T == null ? void 0 : T.slot) == null ? void 0 : k.startDate) !== (L == null ? void 0 : L.startDate);
|
|
415
422
|
})
|
|
416
423
|
});
|
|
417
424
|
}), P(() => {
|
|
418
|
-
if (
|
|
419
|
-
const f =
|
|
420
|
-
f && f + 1 >
|
|
425
|
+
if (y != null && y.length && R) {
|
|
426
|
+
const f = an(de(O ?? void 0), y);
|
|
427
|
+
f && f + 1 > R && n({
|
|
421
428
|
currentSlotBulkSize: f + 1
|
|
422
429
|
});
|
|
423
|
-
} else !(
|
|
430
|
+
} else !(y != null && y.length) && O && (I == null || I(void 0));
|
|
424
431
|
}, [
|
|
425
|
-
|
|
426
|
-
|
|
432
|
+
O,
|
|
433
|
+
y,
|
|
427
434
|
$
|
|
428
435
|
]);
|
|
429
|
-
const
|
|
436
|
+
const Ne = B(() => ct(a), [
|
|
430
437
|
a
|
|
431
|
-
]),
|
|
438
|
+
]), Fe = X(N);
|
|
432
439
|
P(() => {
|
|
433
|
-
const f =
|
|
434
|
-
|
|
440
|
+
const f = Fe.current;
|
|
441
|
+
Fe.current = N, !!N && (!f || !ae(f, N)) && b(void 0);
|
|
435
442
|
}, [
|
|
436
|
-
|
|
443
|
+
N
|
|
437
444
|
]);
|
|
438
|
-
const h =
|
|
445
|
+
const h = B(() => d ?? Ye(N ?? /* @__PURE__ */ new Date(), Ne), [
|
|
439
446
|
d,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
]), Xe =
|
|
443
|
-
const f = be(/* @__PURE__ */ new Date()),
|
|
447
|
+
N,
|
|
448
|
+
Ne
|
|
449
|
+
]), Xe = B(() => {
|
|
450
|
+
const f = be(/* @__PURE__ */ new Date()), L = new Intl.DateTimeFormat(a, {
|
|
444
451
|
weekday: "short"
|
|
445
452
|
}), T = new Intl.DateTimeFormat(a, {
|
|
446
453
|
day: "numeric"
|
|
447
|
-
}),
|
|
454
|
+
}), k = new Intl.DateTimeFormat(a, {
|
|
448
455
|
weekday: "long",
|
|
449
456
|
month: "long",
|
|
450
457
|
day: "numeric"
|
|
451
458
|
});
|
|
452
459
|
return Array.from({
|
|
453
460
|
length: j
|
|
454
|
-
}, (se,
|
|
455
|
-
const
|
|
461
|
+
}, (se, Oe) => {
|
|
462
|
+
const x = te(h, Oe), Le = !!N && ae(x, N), rt = be(x) < f;
|
|
456
463
|
return {
|
|
457
|
-
key:
|
|
458
|
-
date:
|
|
464
|
+
key: mn(x),
|
|
465
|
+
date: x,
|
|
459
466
|
isSelected: Le,
|
|
460
|
-
isAvailable: !V && !ee && !Le &&
|
|
467
|
+
isAvailable: !V && !ee && !Le && dn(x, $),
|
|
461
468
|
isDisabled: rt || ee && !Le,
|
|
462
|
-
isToday: ae(
|
|
463
|
-
dayOfMonthLabel: T.format(
|
|
464
|
-
weekdayLabel:
|
|
465
|
-
label:
|
|
466
|
-
availabilityLabel:
|
|
469
|
+
isToday: ae(x, f),
|
|
470
|
+
dayOfMonthLabel: T.format(x),
|
|
471
|
+
weekdayLabel: L.format(x),
|
|
472
|
+
label: k.format(x),
|
|
473
|
+
availabilityLabel: l("form.appointment.accessibility.calendar.has-availability.aria-label")
|
|
467
474
|
};
|
|
468
475
|
});
|
|
469
476
|
}, [
|
|
470
477
|
h,
|
|
471
|
-
|
|
478
|
+
N,
|
|
472
479
|
$,
|
|
473
480
|
V,
|
|
474
481
|
ee,
|
|
475
482
|
a,
|
|
476
|
-
|
|
477
|
-
]), pe = de(
|
|
478
|
-
const { startDate:
|
|
479
|
-
if (!
|
|
483
|
+
l
|
|
484
|
+
]), pe = de(O ?? void 0) || void 0, Ae = B(() => V || D ? [] : (y ?? []).slice(0, R).flatMap((f) => {
|
|
485
|
+
const { startDate: L, endDate: T } = f.slot ?? {};
|
|
486
|
+
if (!L || !T)
|
|
480
487
|
return [];
|
|
481
|
-
const
|
|
482
|
-
startDate:
|
|
488
|
+
const k = de({
|
|
489
|
+
startDate: L,
|
|
483
490
|
endDate: T
|
|
484
491
|
});
|
|
485
492
|
return [
|
|
486
493
|
{
|
|
487
|
-
key:
|
|
488
|
-
startDate:
|
|
494
|
+
key: k,
|
|
495
|
+
startDate: L,
|
|
489
496
|
endDate: T,
|
|
490
|
-
timeRange:
|
|
491
|
-
startDate:
|
|
497
|
+
timeRange: tn({
|
|
498
|
+
startDate: L,
|
|
492
499
|
endDate: T,
|
|
493
500
|
locale: a,
|
|
494
501
|
timezone: _
|
|
495
502
|
}),
|
|
496
|
-
isSelected:
|
|
503
|
+
isSelected: k === pe
|
|
497
504
|
}
|
|
498
505
|
];
|
|
499
506
|
}), [
|
|
500
|
-
|
|
501
|
-
|
|
507
|
+
y,
|
|
508
|
+
R,
|
|
502
509
|
V,
|
|
503
510
|
D,
|
|
504
511
|
a,
|
|
505
512
|
_,
|
|
506
513
|
pe
|
|
507
|
-
]), ye = !D && !!(
|
|
514
|
+
]), ye = !D && !!(y != null && y.length) && (R || q) < y.length, Ie = h > Ye(/* @__PURE__ */ new Date(), Ne), et = re(
|
|
508
515
|
async (f) => {
|
|
509
|
-
var
|
|
510
|
-
if (!(ee ||
|
|
516
|
+
var L;
|
|
517
|
+
if (!(ee || N && ae(f, N))) {
|
|
511
518
|
u(!0), I == null || I(void 0), n({
|
|
512
519
|
currentSlotBulkSize: q,
|
|
513
520
|
selectedDate: f,
|
|
@@ -517,7 +524,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
517
524
|
component: J.DATE
|
|
518
525
|
});
|
|
519
526
|
try {
|
|
520
|
-
const T = await ((
|
|
527
|
+
const T = await ((L = i == null ? void 0 : i.getAvailabilitySlots) == null ? void 0 : L.call(i, {
|
|
521
528
|
serviceId: K,
|
|
522
529
|
timeZone: _,
|
|
523
530
|
selectedDate: f
|
|
@@ -536,73 +543,73 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
536
543
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
537
544
|
[
|
|
538
545
|
ee,
|
|
539
|
-
|
|
546
|
+
N,
|
|
540
547
|
K,
|
|
541
548
|
_,
|
|
542
|
-
|
|
549
|
+
i,
|
|
543
550
|
I,
|
|
544
551
|
c
|
|
545
552
|
]
|
|
546
553
|
), ce = X(0), tt = re(
|
|
547
554
|
async (f) => {
|
|
548
555
|
var se;
|
|
549
|
-
if (f < 0 && !
|
|
556
|
+
if (f < 0 && !Ie)
|
|
550
557
|
return;
|
|
551
|
-
const
|
|
552
|
-
if (b(T),
|
|
558
|
+
const L = h, T = te(h, f * j);
|
|
559
|
+
if (b(T), r || s)
|
|
553
560
|
return;
|
|
554
|
-
const
|
|
561
|
+
const k = ++ce.current;
|
|
555
562
|
E(!0), c == null || c.report({
|
|
556
563
|
action: ne.CLICK,
|
|
557
564
|
component: J.PAGINATION
|
|
558
565
|
});
|
|
559
566
|
try {
|
|
560
|
-
const
|
|
567
|
+
const Oe = await ((se = i == null ? void 0 : i.getAvailabilityDates) == null ? void 0 : se.call(i, {
|
|
561
568
|
serviceId: K,
|
|
562
569
|
timeZone: _,
|
|
563
570
|
fromDate: T,
|
|
564
|
-
toDate:
|
|
571
|
+
toDate: cn(te(T, j - 1))
|
|
565
572
|
}));
|
|
566
|
-
|
|
567
|
-
availabilityDates:
|
|
573
|
+
k === ce.current && n({
|
|
574
|
+
availabilityDates: Oe
|
|
568
575
|
});
|
|
569
576
|
} catch {
|
|
570
|
-
|
|
577
|
+
k === ce.current && b(L);
|
|
571
578
|
} finally {
|
|
572
|
-
|
|
579
|
+
k === ce.current && E(!1);
|
|
573
580
|
}
|
|
574
581
|
},
|
|
575
582
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
576
583
|
[
|
|
577
|
-
|
|
584
|
+
Ie,
|
|
578
585
|
h,
|
|
579
|
-
s,
|
|
580
586
|
r,
|
|
587
|
+
s,
|
|
581
588
|
K,
|
|
582
589
|
_,
|
|
583
|
-
|
|
590
|
+
i,
|
|
584
591
|
c
|
|
585
592
|
]
|
|
586
593
|
), nt = re(
|
|
587
594
|
(f) => {
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
595
|
+
const L = Ae.find((se) => se.key === f);
|
|
596
|
+
if (!L)
|
|
590
597
|
return;
|
|
591
|
-
const { startDate: T, endDate:
|
|
598
|
+
const { startDate: T, endDate: k } = L;
|
|
592
599
|
c == null || c.report({
|
|
593
600
|
action: ne.CLICK,
|
|
594
601
|
component: J.SLOT,
|
|
595
602
|
startTime: new Date(T).valueOf(),
|
|
596
|
-
endTime: new Date(
|
|
603
|
+
endTime: new Date(k).valueOf()
|
|
597
604
|
}), I == null || I({
|
|
598
605
|
startDate: T,
|
|
599
|
-
endDate:
|
|
606
|
+
endDate: k,
|
|
600
607
|
timeZone: _
|
|
601
608
|
});
|
|
602
609
|
},
|
|
603
610
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
604
611
|
[
|
|
605
|
-
|
|
612
|
+
Ae,
|
|
606
613
|
_,
|
|
607
614
|
I,
|
|
608
615
|
c
|
|
@@ -610,77 +617,77 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
610
617
|
), at = re(() => {
|
|
611
618
|
if (!ye)
|
|
612
619
|
return;
|
|
613
|
-
const f =
|
|
620
|
+
const f = R || q;
|
|
614
621
|
c == null || c.report({
|
|
615
622
|
action: ne.CLICK,
|
|
616
623
|
component: J.SHOW_MORE
|
|
617
|
-
}),
|
|
624
|
+
}), A(f), n({
|
|
618
625
|
currentSlotBulkSize: f + q
|
|
619
626
|
});
|
|
620
627
|
}, [
|
|
621
628
|
ye,
|
|
622
|
-
|
|
629
|
+
R,
|
|
623
630
|
c
|
|
624
|
-
]), ot = re(() =>
|
|
625
|
-
if (
|
|
626
|
-
return
|
|
627
|
-
if (!V && !D && !(
|
|
628
|
-
return
|
|
631
|
+
]), ot = re(() => A(void 0), []), st = B(() => {
|
|
632
|
+
if (_e)
|
|
633
|
+
return l("form.appointment.empty-state.notification.text");
|
|
634
|
+
if (!V && !D && !(y != null && y.length))
|
|
635
|
+
return l("form.appointment.slots-not-found.text");
|
|
629
636
|
}, [
|
|
630
|
-
|
|
637
|
+
_e,
|
|
631
638
|
V,
|
|
632
639
|
D,
|
|
633
|
-
|
|
634
|
-
|
|
640
|
+
y == null ? void 0 : y.length,
|
|
641
|
+
l
|
|
635
642
|
]);
|
|
636
643
|
return {
|
|
637
644
|
days: Xe,
|
|
638
|
-
slots:
|
|
645
|
+
slots: Ae,
|
|
639
646
|
selectedSlotKey: pe,
|
|
640
647
|
selectDate: et,
|
|
641
648
|
selectSlot: nt,
|
|
642
649
|
changeWeek: tt,
|
|
643
650
|
showMoreSlots: at,
|
|
644
|
-
canGoToPreviousWeek:
|
|
651
|
+
canGoToPreviousWeek: Ie,
|
|
645
652
|
hasMoreSlots: ye,
|
|
646
|
-
hasError:
|
|
653
|
+
hasError: _e,
|
|
647
654
|
isLoading: V,
|
|
648
655
|
isRefetching: ee,
|
|
649
656
|
isReloadingSlots: D,
|
|
650
|
-
weekRangeLabel:
|
|
651
|
-
weekCaptionLabel:
|
|
657
|
+
weekRangeLabel: un(h, te(h, j - 1), a),
|
|
658
|
+
weekCaptionLabel: qt({
|
|
652
659
|
startOfWeek: h,
|
|
653
660
|
endOfWeek: te(h, j - 1)
|
|
654
661
|
}, a),
|
|
655
|
-
selectedDateLabel:
|
|
656
|
-
selectedDate:
|
|
662
|
+
selectedDateLabel: nn({
|
|
663
|
+
selectedDate: N,
|
|
657
664
|
locale: a,
|
|
658
665
|
timezone: _
|
|
659
666
|
}),
|
|
660
|
-
timezoneLabel: _ ? `${
|
|
667
|
+
timezoneLabel: _ ? `${l("form.appointment.timezone.label")}: ${Qt({
|
|
661
668
|
timezone: _,
|
|
662
669
|
language: a
|
|
663
670
|
})}` : "",
|
|
664
|
-
formatLabel:
|
|
671
|
+
formatLabel: H === on.OS_LOCATION ? l("form.appointment.meeting-format.in-person-location-method-os-location") : Y,
|
|
665
672
|
notificationMessage: st,
|
|
666
|
-
showMoreSlotsLabel:
|
|
667
|
-
previousWeekLabel:
|
|
668
|
-
nextWeekLabel:
|
|
669
|
-
pendingFocusIndex:
|
|
673
|
+
showMoreSlotsLabel: l("form.appointment.show-more-slots.text"),
|
|
674
|
+
previousWeekLabel: l("form.appointment.accessibility.calendar.previous-week.aria-label"),
|
|
675
|
+
nextWeekLabel: l("form.appointment.accessibility.calendar.next-week.aria-label"),
|
|
676
|
+
pendingFocusIndex: M,
|
|
670
677
|
consumePendingFocusIndex: ot
|
|
671
678
|
};
|
|
672
|
-
}, je = Ke(void 0), Qe = (e) => `${e}-timezone-note`, Je = (e) => `${e}-date-title`,
|
|
679
|
+
}, je = Ke(void 0), Qe = (e) => `${e}-timezone-note`, Je = (e) => `${e}-date-title`, w = () => {
|
|
673
680
|
const e = $e(je);
|
|
674
681
|
if (typeof e > "u")
|
|
675
682
|
throw new Error("Appointment parts must be used inside an <Appointment> component");
|
|
676
683
|
return e;
|
|
677
|
-
},
|
|
684
|
+
}, ke = () => {
|
|
678
685
|
const { disabled: e, readOnly: t } = ie();
|
|
679
686
|
return !!e || !!t;
|
|
680
687
|
}, C = ({ children: e, className: t }) => {
|
|
681
|
-
const { days: n, selectDate: a, weekRangeLabel:
|
|
688
|
+
const { days: n, selectDate: a, weekRangeLabel: r } = w(), s = v(e, C.PreviousWeek), l = v(e, C.Heading), i = v(e, C.NextWeek), c = v(e, C.Day) ?? /* @__PURE__ */ o.createElement(C.Day, null), D = B(() => n.filter((d) => d.isSelected).map((d) => d.key), [
|
|
682
689
|
n
|
|
683
|
-
]), u =
|
|
690
|
+
]), u = ke(), S = B(() => n.filter((d) => u || d.isDisabled).map((d) => d.key), [
|
|
684
691
|
n,
|
|
685
692
|
u
|
|
686
693
|
]), E = (d) => {
|
|
@@ -688,56 +695,56 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
688
695
|
return;
|
|
689
696
|
const [b] = [
|
|
690
697
|
...d
|
|
691
|
-
],
|
|
692
|
-
|
|
698
|
+
], M = n.find(({ key: A }) => A === b);
|
|
699
|
+
M && a(M.date);
|
|
693
700
|
};
|
|
694
701
|
return /* @__PURE__ */ o.createElement("div", {
|
|
695
702
|
className: t
|
|
696
|
-
},
|
|
697
|
-
"aria-label":
|
|
703
|
+
}, s, l, i, /* @__PURE__ */ o.createElement(Rt, {
|
|
704
|
+
"aria-label": r,
|
|
698
705
|
orientation: "horizontal",
|
|
699
706
|
selectionMode: "single",
|
|
700
707
|
selectedKeys: D,
|
|
701
708
|
disabledKeys: S,
|
|
702
709
|
onSelectionChange: E
|
|
703
|
-
}, n.map((d) =>
|
|
710
|
+
}, n.map((d) => Se(c, {
|
|
704
711
|
key: d.key,
|
|
705
712
|
day: d
|
|
706
713
|
}))));
|
|
707
|
-
},
|
|
708
|
-
const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel:
|
|
714
|
+
}, fn = ({ children: e, className: t }) => {
|
|
715
|
+
const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel: r, nextWeekLabel: s } = w(), l = ke(), i = X(null), c = X(!1);
|
|
709
716
|
return P(() => {
|
|
710
717
|
var S, E, d;
|
|
711
718
|
if (a || !c.current)
|
|
712
719
|
return;
|
|
713
720
|
c.current = !1;
|
|
714
721
|
const D = document.activeElement;
|
|
715
|
-
if (D !== document.body && D !==
|
|
722
|
+
if (D !== document.body && D !== i.current)
|
|
716
723
|
return;
|
|
717
|
-
const u = ((E = (S =
|
|
718
|
-
(d = Array.from(u).find((b) => b.getAttribute("aria-label") ===
|
|
724
|
+
const u = ((E = (S = i.current) == null ? void 0 : S.closest("fieldset")) == null ? void 0 : E.querySelectorAll("button")) ?? [];
|
|
725
|
+
(d = Array.from(u).find((b) => b.getAttribute("aria-label") === s)) == null || d.focus();
|
|
719
726
|
}, [
|
|
720
727
|
a,
|
|
721
|
-
|
|
728
|
+
s
|
|
722
729
|
]), /* @__PURE__ */ o.createElement(ve, {
|
|
723
|
-
ref:
|
|
730
|
+
ref: i,
|
|
724
731
|
className: t,
|
|
725
|
-
"aria-label":
|
|
726
|
-
isDisabled: !a ||
|
|
732
|
+
"aria-label": r,
|
|
733
|
+
isDisabled: !a || l,
|
|
727
734
|
onPress: () => {
|
|
728
735
|
c.current = !0, n(-1);
|
|
729
736
|
}
|
|
730
737
|
}, e ?? "‹");
|
|
731
|
-
},
|
|
732
|
-
const { changeWeek: n, nextWeekLabel: a } =
|
|
738
|
+
}, En = ({ children: e, className: t }) => {
|
|
739
|
+
const { changeWeek: n, nextWeekLabel: a } = w(), r = ke();
|
|
733
740
|
return /* @__PURE__ */ o.createElement(ve, {
|
|
734
741
|
className: t,
|
|
735
742
|
"aria-label": a,
|
|
736
|
-
isDisabled:
|
|
743
|
+
isDisabled: r,
|
|
737
744
|
onPress: () => n(1)
|
|
738
745
|
}, e ?? "›");
|
|
739
|
-
},
|
|
740
|
-
const { weekCaptionLabel: n, weekRangeLabel: a } =
|
|
746
|
+
}, Sn = ({ children: e, className: t }) => {
|
|
747
|
+
const { weekCaptionLabel: n, weekRangeLabel: a } = w();
|
|
741
748
|
return /* @__PURE__ */ o.createElement("span", {
|
|
742
749
|
className: t,
|
|
743
750
|
"aria-live": "polite"
|
|
@@ -749,9 +756,9 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
749
756
|
}, n), /* @__PURE__ */ o.createElement("span", {
|
|
750
757
|
style: Ge
|
|
751
758
|
}, a)));
|
|
752
|
-
},
|
|
759
|
+
}, _n = ({ children: e, className: t, ...n }) => {
|
|
753
760
|
const { day: a } = n;
|
|
754
|
-
return /* @__PURE__ */ o.createElement(
|
|
761
|
+
return /* @__PURE__ */ o.createElement(kt, {
|
|
755
762
|
id: a.key,
|
|
756
763
|
className: t,
|
|
757
764
|
textValue: a.label,
|
|
@@ -763,114 +770,114 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
763
770
|
date: new Date(a.date)
|
|
764
771
|
}) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", null, a.weekdayLabel), /* @__PURE__ */ o.createElement("span", null, a.dayOfMonthLabel)));
|
|
765
772
|
};
|
|
766
|
-
C.PreviousWeek =
|
|
767
|
-
C.Heading =
|
|
768
|
-
C.NextWeek =
|
|
769
|
-
C.Day =
|
|
770
|
-
const
|
|
771
|
-
const { hasTimezoneNote: a, hasDateTitle:
|
|
773
|
+
C.PreviousWeek = fn;
|
|
774
|
+
C.Heading = Sn;
|
|
775
|
+
C.NextWeek = En;
|
|
776
|
+
C.Day = _n;
|
|
777
|
+
const He = 'input[type="radio"]', fe = ({ children: e, className: t, ...n }) => {
|
|
778
|
+
const { hasTimezoneNote: a, hasDateTitle: r } = n, { slots: s, selectedSlotKey: l, selectSlot: i, selectedDateLabel: c, isReloadingSlots: D, timezoneLabel: u, pendingFocusIndex: S, consumePendingFocusIndex: E } = w(), { id: d, disabled: b, readOnly: M, required: A, hasError: I } = ie(), { inputId: O, labelId: U, ariaDescribedBy: z } = le(), Y = X(null), H = v(e, fe.Slot) ?? /* @__PURE__ */ o.createElement(fe.Slot, null), oe = !!r && !!c, $ = [
|
|
772
779
|
z,
|
|
773
|
-
a && u ? Qe(
|
|
774
|
-
].filter(Boolean).join(" ") || void 0,
|
|
775
|
-
var
|
|
776
|
-
(Z = (G = (
|
|
780
|
+
a && u ? Qe(O) : void 0
|
|
781
|
+
].filter(Boolean).join(" ") || void 0, F = (_, N) => {
|
|
782
|
+
var R, G, Z;
|
|
783
|
+
(Z = (G = (R = Y.current) == null ? void 0 : R.querySelectorAll(He)) == null ? void 0 : G[_]) == null || Z.focus(N);
|
|
777
784
|
};
|
|
778
785
|
return ft(() => {
|
|
779
786
|
var G, Z;
|
|
780
|
-
if (!!((G =
|
|
781
|
-
|
|
787
|
+
if (!!((G = Y.current) != null && G.querySelector(He))) {
|
|
788
|
+
F(0, {
|
|
782
789
|
preventScroll: !0
|
|
783
790
|
});
|
|
784
791
|
return;
|
|
785
792
|
}
|
|
786
|
-
const
|
|
787
|
-
|
|
793
|
+
const N = Array.from(((Z = document.getElementById(O)) == null ? void 0 : Z.querySelectorAll('[role="option"]')) ?? []), R = N.find((K) => K.getAttribute("aria-selected") === "true") ?? N.find((K) => K.getAttribute("aria-disabled") !== "true");
|
|
794
|
+
R == null || R.focus({
|
|
788
795
|
preventScroll: !0
|
|
789
796
|
});
|
|
790
797
|
}, d), P(() => {
|
|
791
|
-
S !== void 0 && (
|
|
798
|
+
S !== void 0 && (F(S), E());
|
|
792
799
|
}, [
|
|
793
800
|
S,
|
|
794
|
-
|
|
801
|
+
s.length
|
|
795
802
|
]), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
|
|
796
803
|
role: "status",
|
|
797
804
|
style: Ge
|
|
798
|
-
},
|
|
799
|
-
ref:
|
|
805
|
+
}, s.length > 0 ? c : void 0), /* @__PURE__ */ o.createElement(Mt, {
|
|
806
|
+
ref: Y,
|
|
800
807
|
className: t,
|
|
801
|
-
value:
|
|
802
|
-
onChange:
|
|
808
|
+
value: l ?? null,
|
|
809
|
+
onChange: i,
|
|
803
810
|
isDisabled: b,
|
|
804
|
-
isReadOnly:
|
|
805
|
-
isRequired:
|
|
811
|
+
isReadOnly: M,
|
|
812
|
+
isRequired: A,
|
|
806
813
|
isInvalid: I,
|
|
807
|
-
"aria-labelledby": oe ? Je(
|
|
814
|
+
"aria-labelledby": oe ? Je(O) : U,
|
|
808
815
|
"aria-describedby": $,
|
|
809
816
|
"data-refetch": D || void 0
|
|
810
|
-
},
|
|
817
|
+
}, s.map((_) => Se(H, {
|
|
811
818
|
key: _.key,
|
|
812
819
|
slot: _
|
|
813
820
|
}))));
|
|
814
|
-
},
|
|
821
|
+
}, Nn = ({ children: e, className: t, ...n }) => {
|
|
815
822
|
const { slot: a } = n;
|
|
816
|
-
return /* @__PURE__ */ o.createElement(
|
|
823
|
+
return /* @__PURE__ */ o.createElement(Ft, {
|
|
817
824
|
value: a.key,
|
|
818
825
|
"aria-label": a.timeRange
|
|
819
826
|
}, /* @__PURE__ */ o.createElement(wt, {
|
|
820
827
|
className: t
|
|
821
828
|
}, e ? e(a) : a.timeRange));
|
|
822
829
|
};
|
|
823
|
-
fe.Slot =
|
|
830
|
+
fe.Slot = Nn;
|
|
824
831
|
const m = ({ children: e, className: t }) => {
|
|
825
|
-
const n = ie(), { id: a, FieldLayout:
|
|
832
|
+
const n = ie(), { id: a, FieldLayout: r } = n, { labelId: s, inputId: l, ariaDescribedBy: i } = le(), c = Et(St.APPOINTMENT), D = B(() => ({
|
|
826
833
|
...n,
|
|
827
834
|
initialData: c,
|
|
828
|
-
inputId:
|
|
829
|
-
ariaLabelledBy:
|
|
830
|
-
ariaDescribedBy:
|
|
835
|
+
inputId: l,
|
|
836
|
+
ariaLabelledBy: s,
|
|
837
|
+
ariaDescribedBy: i,
|
|
831
838
|
fieldId: a
|
|
832
839
|
}), [
|
|
833
840
|
n,
|
|
834
841
|
c,
|
|
835
|
-
i,
|
|
836
|
-
r,
|
|
837
842
|
l,
|
|
843
|
+
s,
|
|
844
|
+
i,
|
|
838
845
|
a
|
|
839
|
-
]), u =
|
|
840
|
-
return /* @__PURE__ */ o.createElement(
|
|
846
|
+
]), u = v(e, m.Label), S = v(e, m.Description), E = v(e, m.Error);
|
|
847
|
+
return /* @__PURE__ */ o.createElement(r, {
|
|
841
848
|
fieldId: a,
|
|
842
|
-
renderLabel: () =>
|
|
849
|
+
renderLabel: () => Se(u, {
|
|
843
850
|
as: "div"
|
|
844
851
|
}),
|
|
845
|
-
renderInput: () => /* @__PURE__ */ o.createElement(
|
|
852
|
+
renderInput: () => /* @__PURE__ */ o.createElement(Vt, {
|
|
846
853
|
appointmentFieldProps: D
|
|
847
|
-
}, /* @__PURE__ */ o.createElement(
|
|
854
|
+
}, /* @__PURE__ */ o.createElement(An, {
|
|
848
855
|
className: t
|
|
849
856
|
}, e)),
|
|
850
857
|
renderDescription: () => /* @__PURE__ */ o.createElement(o.Fragment, null, E, S)
|
|
851
858
|
});
|
|
852
|
-
},
|
|
859
|
+
}, pn = {
|
|
853
860
|
visibility: "hidden"
|
|
854
|
-
},
|
|
855
|
-
const { required: n, onFocus: a, onBlur:
|
|
861
|
+
}, An = ({ children: e, className: t }) => {
|
|
862
|
+
const { required: n, onFocus: a, onBlur: r } = ie(), { inputId: s, labelId: l, ariaDescribedBy: i } = le(), c = Dn(), D = v(e, m.Loader), u = v(e, m.Notification), S = v(e, m.Dates), E = v(e, m.Timezone), d = v(e, m.Format), b = v(e, m.DateTitle), M = v(e, m.Slots), A = v(e, m.ShowMoreSlots);
|
|
856
863
|
return /* @__PURE__ */ o.createElement(je.Provider, {
|
|
857
864
|
value: c
|
|
858
|
-
}, /* @__PURE__ */ o.createElement(
|
|
859
|
-
id:
|
|
865
|
+
}, /* @__PURE__ */ o.createElement(xt, {
|
|
866
|
+
id: s,
|
|
860
867
|
className: t,
|
|
861
|
-
ariaLabelledBy:
|
|
862
|
-
ariaDescribedBy:
|
|
868
|
+
ariaLabelledBy: l,
|
|
869
|
+
ariaDescribedBy: i,
|
|
863
870
|
required: n,
|
|
864
871
|
onFocus: a,
|
|
865
|
-
onBlur:
|
|
872
|
+
onBlur: r
|
|
866
873
|
}, D, c.hasError ? u : /* @__PURE__ */ o.createElement("div", {
|
|
867
|
-
style: c.isLoading ?
|
|
868
|
-
}, S, E, d, b,
|
|
874
|
+
style: c.isLoading ? pn : void 0
|
|
875
|
+
}, S, E, d, b, Se(M, {
|
|
869
876
|
hasTimezoneNote: !!E,
|
|
870
877
|
hasDateTitle: !!b
|
|
871
|
-
}), u,
|
|
872
|
-
},
|
|
873
|
-
const { isLoading: n, isRefetching: a } =
|
|
878
|
+
}), u, A)));
|
|
879
|
+
}, yn = ({ children: e, className: t }) => {
|
|
880
|
+
const { isLoading: n, isRefetching: a } = w();
|
|
874
881
|
return !n && !a ? null : /* @__PURE__ */ o.createElement("div", {
|
|
875
882
|
className: t,
|
|
876
883
|
role: "status",
|
|
@@ -878,137 +885,137 @@ const m = ({ children: e, className: t }) => {
|
|
|
878
885
|
"data-initial": n || void 0,
|
|
879
886
|
"data-refetch": !n && a || void 0
|
|
880
887
|
}, e);
|
|
881
|
-
},
|
|
882
|
-
const { notificationMessage: n } =
|
|
888
|
+
}, In = ({ children: e, className: t }) => {
|
|
889
|
+
const { notificationMessage: n } = w();
|
|
883
890
|
return n ? /* @__PURE__ */ o.createElement("div", {
|
|
884
891
|
className: t,
|
|
885
892
|
role: "status"
|
|
886
893
|
}, e ? e({
|
|
887
894
|
message: n
|
|
888
895
|
}) : n) : null;
|
|
889
|
-
},
|
|
890
|
-
const { timezoneLabel: n } =
|
|
896
|
+
}, On = ({ children: e, className: t }) => {
|
|
897
|
+
const { timezoneLabel: n } = w(), { inputId: a } = le();
|
|
891
898
|
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
892
899
|
id: Qe(a),
|
|
893
900
|
className: t
|
|
894
901
|
}, e ? e({
|
|
895
902
|
label: n
|
|
896
903
|
}) : n) : null;
|
|
897
|
-
},
|
|
898
|
-
const { formatLabel: n } =
|
|
904
|
+
}, Ln = ({ children: e, className: t }) => {
|
|
905
|
+
const { formatLabel: n } = w();
|
|
899
906
|
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
900
907
|
className: t
|
|
901
908
|
}, e ? e({
|
|
902
909
|
label: n
|
|
903
910
|
}) : n) : null;
|
|
904
|
-
},
|
|
905
|
-
const { selectedDateLabel: n } =
|
|
911
|
+
}, Tn = ({ children: e, className: t }) => {
|
|
912
|
+
const { selectedDateLabel: n } = w(), { inputId: a } = le();
|
|
906
913
|
return n ? /* @__PURE__ */ o.createElement("div", {
|
|
907
914
|
id: Je(a),
|
|
908
915
|
className: t
|
|
909
916
|
}, e ? e({
|
|
910
917
|
label: n
|
|
911
918
|
}) : n) : null;
|
|
912
|
-
},
|
|
913
|
-
const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel:
|
|
919
|
+
}, bn = ({ children: e, className: t }) => {
|
|
920
|
+
const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel: r } = w(), { disabled: s, readOnly: l } = ie();
|
|
914
921
|
return n ? /* @__PURE__ */ o.createElement(ve, {
|
|
915
922
|
className: t,
|
|
916
|
-
isDisabled: !!
|
|
923
|
+
isDisabled: !!s || !!l,
|
|
917
924
|
onPress: a
|
|
918
925
|
}, e ? e({
|
|
919
|
-
label:
|
|
920
|
-
}) :
|
|
926
|
+
label: r
|
|
927
|
+
}) : r) : null;
|
|
921
928
|
};
|
|
922
|
-
m.Label =
|
|
923
|
-
m.Loader =
|
|
924
|
-
m.Notification =
|
|
929
|
+
m.Label = Wt;
|
|
930
|
+
m.Loader = yn;
|
|
931
|
+
m.Notification = In;
|
|
925
932
|
m.Dates = C;
|
|
926
|
-
m.Timezone =
|
|
927
|
-
m.Format =
|
|
928
|
-
m.DateTitle =
|
|
933
|
+
m.Timezone = On;
|
|
934
|
+
m.Format = Ln;
|
|
935
|
+
m.DateTitle = Tn;
|
|
929
936
|
m.Slots = fe;
|
|
930
|
-
m.ShowMoreSlots =
|
|
931
|
-
m.Description =
|
|
932
|
-
m.Error =
|
|
933
|
-
const
|
|
934
|
-
appointment:
|
|
935
|
-
dates:
|
|
936
|
-
weekHeading:
|
|
937
|
-
weekButton:
|
|
938
|
-
previousWeek:
|
|
939
|
-
nextWeek:
|
|
940
|
-
day:
|
|
941
|
-
weekdayLabel:
|
|
942
|
-
dayNumber:
|
|
943
|
-
indicator:
|
|
944
|
-
hint:
|
|
945
|
-
slots:
|
|
946
|
-
dateTitle:
|
|
947
|
-
slot:
|
|
948
|
-
slotHover:
|
|
949
|
-
slotSelected:
|
|
950
|
-
showMoreSlots:
|
|
951
|
-
loader:
|
|
952
|
-
notification:
|
|
953
|
-
},
|
|
937
|
+
m.ShowMoreSlots = bn;
|
|
938
|
+
m.Description = ht;
|
|
939
|
+
m.Error = Ct;
|
|
940
|
+
const gn = "_appointment_14etx_1", vn = "_dates_14etx_5", Rn = "_weekHeading_14etx_30", kn = "_weekButton_14etx_36", Mn = "_previousWeek_14etx_68", Fn = "_nextWeek_14etx_72", wn = "_day_14etx_84", hn = "_weekdayLabel_14etx_94", Cn = "_dayNumber_14etx_103", Wn = "_indicator_14etx_107", xn = "_hint_14etx_130", Bn = "_slots_14etx_143", Pn = "_dateTitle_14etx_157", Un = "_slot_14etx_143", zn = "_slotHover_14etx_199", Yn = "_slotSelected_14etx_207", Hn = "_showMoreSlots_14etx_261", Kn = "_loader_14etx_292", $n = "_notification_14etx_328", p = {
|
|
941
|
+
appointment: gn,
|
|
942
|
+
dates: vn,
|
|
943
|
+
weekHeading: Rn,
|
|
944
|
+
weekButton: kn,
|
|
945
|
+
previousWeek: Mn,
|
|
946
|
+
nextWeek: Fn,
|
|
947
|
+
day: wn,
|
|
948
|
+
weekdayLabel: hn,
|
|
949
|
+
dayNumber: Cn,
|
|
950
|
+
indicator: Wn,
|
|
951
|
+
hint: xn,
|
|
952
|
+
slots: Bn,
|
|
953
|
+
dateTitle: Pn,
|
|
954
|
+
slot: Un,
|
|
955
|
+
slotHover: zn,
|
|
956
|
+
slotSelected: Yn,
|
|
957
|
+
showMoreSlots: Hn,
|
|
958
|
+
loader: Kn,
|
|
959
|
+
notification: $n
|
|
960
|
+
}, Gn = ({ content: e, locale: t }) => /* @__PURE__ */ o.createElement(it, {
|
|
954
961
|
content: e,
|
|
955
962
|
locale: t
|
|
956
|
-
}),
|
|
957
|
-
base:
|
|
958
|
-
selected:
|
|
959
|
-
hover:
|
|
960
|
-
},
|
|
961
|
-
const e =
|
|
962
|
-
globalClasses:
|
|
963
|
-
moduleClasses:
|
|
963
|
+
}), Zn = {
|
|
964
|
+
base: p.slot,
|
|
965
|
+
selected: p.slotSelected,
|
|
966
|
+
hover: p.slotHover
|
|
967
|
+
}, Vn = () => {
|
|
968
|
+
const e = vt({
|
|
969
|
+
globalClasses: gt,
|
|
970
|
+
moduleClasses: Zn
|
|
964
971
|
});
|
|
965
972
|
return /* @__PURE__ */ o.createElement(m, {
|
|
966
|
-
className:
|
|
973
|
+
className: g(_t, p.appointment)
|
|
967
974
|
}, /* @__PURE__ */ o.createElement(m.Label, {
|
|
968
|
-
className:
|
|
975
|
+
className: g(Nt, ue.label)
|
|
969
976
|
}, /* @__PURE__ */ o.createElement(m.Label.Required, {
|
|
970
|
-
className:
|
|
977
|
+
className: g(pt, ue.requiredMark)
|
|
971
978
|
})), /* @__PURE__ */ o.createElement(m.Loader, {
|
|
972
|
-
className:
|
|
979
|
+
className: p.loader
|
|
973
980
|
}), /* @__PURE__ */ o.createElement(m.Dates, {
|
|
974
|
-
className:
|
|
981
|
+
className: g(At, p.dates)
|
|
975
982
|
}, /* @__PURE__ */ o.createElement(m.Dates.PreviousWeek, {
|
|
976
|
-
className:
|
|
983
|
+
className: g(me, p.weekButton, p.previousWeek)
|
|
977
984
|
}, /* @__PURE__ */ o.createElement(he, null)), /* @__PURE__ */ o.createElement(m.Dates.Heading, {
|
|
978
|
-
className:
|
|
985
|
+
className: p.weekHeading
|
|
979
986
|
}), /* @__PURE__ */ o.createElement(m.Dates.NextWeek, {
|
|
980
|
-
className:
|
|
987
|
+
className: g(me, p.weekButton, p.nextWeek)
|
|
981
988
|
}, /* @__PURE__ */ o.createElement(he, null)), /* @__PURE__ */ o.createElement(m.Dates.Day, {
|
|
982
|
-
className:
|
|
989
|
+
className: g(me, Ce.day, p.day)
|
|
983
990
|
}, (t) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
|
|
984
|
-
className:
|
|
991
|
+
className: p.weekdayLabel
|
|
985
992
|
}, t.weekdayLabel), /* @__PURE__ */ o.createElement("span", {
|
|
986
|
-
className:
|
|
993
|
+
className: g(Ce.dayNumber, p.dayNumber)
|
|
987
994
|
}, t.dayOfMonthLabel, /* @__PURE__ */ o.createElement("span", {
|
|
988
|
-
className:
|
|
995
|
+
className: p.indicator
|
|
989
996
|
}))))), /* @__PURE__ */ o.createElement(m.Timezone, {
|
|
990
|
-
className:
|
|
997
|
+
className: g(We, p.hint)
|
|
991
998
|
}), /* @__PURE__ */ o.createElement(m.Format, {
|
|
992
|
-
className:
|
|
999
|
+
className: g(We, p.hint)
|
|
993
1000
|
}), /* @__PURE__ */ o.createElement(m.DateTitle, {
|
|
994
|
-
className:
|
|
1001
|
+
className: g(yt, p.dateTitle)
|
|
995
1002
|
}), /* @__PURE__ */ o.createElement(m.Slots, {
|
|
996
|
-
className:
|
|
1003
|
+
className: g(It, p.slots)
|
|
997
1004
|
}, /* @__PURE__ */ o.createElement(m.Slots.Slot, {
|
|
998
|
-
className: ({ isSelected: t, isHovered: n, isFocused: a, isDisabled:
|
|
1005
|
+
className: ({ isSelected: t, isHovered: n, isFocused: a, isDisabled: r, isReadOnly: s }) => e({
|
|
999
1006
|
isSelected: t,
|
|
1000
|
-
isHovered: (n || a) && !t && !
|
|
1007
|
+
isHovered: (n || a) && !t && !r && !s
|
|
1001
1008
|
})
|
|
1002
1009
|
}, (t) => t.timeRange)), /* @__PURE__ */ o.createElement(m.Notification, {
|
|
1003
|
-
className:
|
|
1010
|
+
className: g(Ot, p.notification)
|
|
1004
1011
|
}), /* @__PURE__ */ o.createElement(m.ShowMoreSlots, {
|
|
1005
|
-
className:
|
|
1012
|
+
className: g(Lt, me, p.showMoreSlots)
|
|
1006
1013
|
}), /* @__PURE__ */ o.createElement(m.Error, {
|
|
1007
|
-
className:
|
|
1014
|
+
className: g(Tt, ue.error)
|
|
1008
1015
|
}, /* @__PURE__ */ o.createElement(lt, null), /* @__PURE__ */ o.createElement(m.Error.Text, null)), /* @__PURE__ */ o.createElement(m.Description, {
|
|
1009
|
-
className:
|
|
1010
|
-
},
|
|
1011
|
-
},
|
|
1016
|
+
className: g(bt, ue.description)
|
|
1017
|
+
}, Gn));
|
|
1018
|
+
}, da = () => /* @__PURE__ */ o.createElement(Vn, null);
|
|
1012
1019
|
export {
|
|
1013
|
-
|
|
1020
|
+
da as AppointmentRAC
|
|
1014
1021
|
};
|