@alfadocs/ui-kit-debug 1.72.0 → 1.73.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/_chunks/{booking-DNJO0tnU.js → booking-C-hRVLPy.js} +1404 -1373
- package/dist/_chunks/booking-C-hRVLPy.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/booking/booking-types.d.ts +8 -0
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +2 -0
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-DNJO0tnU.js.map +0 -1
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import { jsx as s, jsxs as v, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
import { A as
|
|
7
|
-
import { B as
|
|
8
|
-
import { C as
|
|
9
|
-
import { C as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { S as
|
|
29
|
-
import {
|
|
30
|
-
import { S as
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as v, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as fs, useId as Pt, useRef as F, useCallback as ke, useState as te, useEffect as z, useMemo as M, Fragment as Ks, useImperativeHandle as zs } from "react";
|
|
3
|
+
import { c as Nt } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Y, Trans as js } from "react-i18next";
|
|
5
|
+
import { u as Us } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { A as ne } from "./alert-9kEwDza3.js";
|
|
7
|
+
import { B as tt } from "./button-DohK_Ak_.js";
|
|
8
|
+
import { C as lt } from "./checkbox-BjDv-r3o.js";
|
|
9
|
+
import { C as Gs } from "./checkbox-group-Cw2H5qaq.js";
|
|
10
|
+
import { R as Hs } from "./radio-BZQs6_36.js";
|
|
11
|
+
import { R as Js } from "./radio-group-ChIKyeSJ.js";
|
|
12
|
+
import { D as Ws } from "./date-picker-KcoNNsM0.js";
|
|
13
|
+
import { E as Ys } from "./email-input-C7THAwh2.js";
|
|
14
|
+
import { F as Je } from "./form-field-Ani72sVY.js";
|
|
15
|
+
import { P as Zs } from "./phone-input-O9camxkq.js";
|
|
16
|
+
import { T as Qs } from "./text-area-COMVJ1yE.js";
|
|
17
|
+
import { T as Ot } from "./text-input-CaG9ApoE.js";
|
|
18
|
+
import { A as Xs } from "./address-fields-BUPRs3n-.js";
|
|
19
|
+
import { S as gs } from "./spinner-CoflYlEx.js";
|
|
20
|
+
import { a as Vt } from "./format-price-BcFBa-WP.js";
|
|
21
|
+
import { C as en } from "./credit-card-D9XZsHGA.js";
|
|
22
|
+
import { B as hs } from "./badge-BUk4RjTS.js";
|
|
23
|
+
import { I as rs } from "./icon-button-S8_weU3g.js";
|
|
24
|
+
import { S as $t } from "./select-4S-eYZUf.js";
|
|
25
|
+
import { C as Xt } from "./combobox-vF9O-QoG.js";
|
|
26
|
+
import { M as es } from "./multi-select-BOad3za9.js";
|
|
27
|
+
import { c as tn } from "./option-row-Dc7BrbK8.js";
|
|
28
|
+
import { S as Bt } from "./skeleton-tTWJpvAq.js";
|
|
29
|
+
import { E as vs } from "./empty-state-DwJ5YNzz.js";
|
|
30
|
+
import { S as sn } from "./stepper-accordion-DDTSOUHc.js";
|
|
31
|
+
import { S as nn } from "./stepper-progress-D6H8wQiV.js";
|
|
32
|
+
import { S as rn } from "./slot-grid-uA9j7Nik.js";
|
|
33
|
+
import { p as ye } from "./parseISO-y3LncvfO.js";
|
|
34
|
+
import { C as on } from "./chevron-down-DWE7GSq9.js";
|
|
35
|
+
import { r as ut, f as _t, b as os } from "./format-D-1gTdHF.js";
|
|
36
|
+
import { x as bs, d as pt, a as Jt, i as an, s as It, m as cn, y as Dt } from "./date-picker-variants-DN37Oj5-.js";
|
|
37
|
+
import { s as dn } from "./subDays-xH7cpN6B.js";
|
|
38
|
+
import { C as ln } from "./chevron-left-B8cOyH-V.js";
|
|
39
|
+
import { C as un } from "./chevron-right-I9AeSxH2.js";
|
|
40
|
+
import { c as Ee } from "./createLucideIcon-DhHxpK9K.js";
|
|
41
|
+
import { M as pn, S as mn } from "./sun-Bj9Mr553.js";
|
|
42
|
+
import { S as fn } from "./stethoscope-sZXGC43m.js";
|
|
43
|
+
import { H as gn } from "./heart-pulse-BCppJyN2.js";
|
|
44
|
+
import { E as hn } from "./eye-BjhN2nYf.js";
|
|
45
|
+
import { B as vn } from "./baby-Dku-Xvg9.js";
|
|
46
|
+
import { S as bn } from "./scan-line-CNseIHQ0.js";
|
|
47
|
+
import { A as yn } from "./astroid-BN4f5VXU.js";
|
|
48
|
+
import { C as kn } from "./clipboard-check-BeAGxDVT.js";
|
|
47
49
|
/**
|
|
48
50
|
* @license lucide-react v1.22.0 - ISC
|
|
49
51
|
*
|
|
50
52
|
* This source code is licensed under the ISC license.
|
|
51
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
54
|
*/
|
|
53
|
-
const
|
|
55
|
+
const Sn = [
|
|
54
56
|
[
|
|
55
57
|
"path",
|
|
56
58
|
{
|
|
@@ -58,14 +60,14 @@ const bn = [
|
|
|
58
60
|
key: "169zse"
|
|
59
61
|
}
|
|
60
62
|
]
|
|
61
|
-
],
|
|
63
|
+
], xn = Ee("activity", Sn);
|
|
62
64
|
/**
|
|
63
65
|
* @license lucide-react v1.22.0 - ISC
|
|
64
66
|
*
|
|
65
67
|
* This source code is licensed under the ISC license.
|
|
66
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
69
|
*/
|
|
68
|
-
const
|
|
70
|
+
const In = [
|
|
69
71
|
[
|
|
70
72
|
"path",
|
|
71
73
|
{
|
|
@@ -73,14 +75,14 @@ const kn = [
|
|
|
73
75
|
key: "w610uw"
|
|
74
76
|
}
|
|
75
77
|
]
|
|
76
|
-
],
|
|
78
|
+
], Nn = Ee("bone", In);
|
|
77
79
|
/**
|
|
78
80
|
* @license lucide-react v1.22.0 - ISC
|
|
79
81
|
*
|
|
80
82
|
* This source code is licensed under the ISC license.
|
|
81
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
84
|
*/
|
|
83
|
-
const
|
|
85
|
+
const wn = [
|
|
84
86
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
85
87
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
86
88
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -89,14 +91,14 @@ const xn = [
|
|
|
89
91
|
["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
|
|
90
92
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
91
93
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
92
|
-
],
|
|
94
|
+
], Cn = Ee("brain", wn);
|
|
93
95
|
/**
|
|
94
96
|
* @license lucide-react v1.22.0 - ISC
|
|
95
97
|
*
|
|
96
98
|
* This source code is licensed under the ISC license.
|
|
97
99
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
100
|
*/
|
|
99
|
-
const
|
|
101
|
+
const An = [
|
|
100
102
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
101
103
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
102
104
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -105,76 +107,76 @@ const Nn = [
|
|
|
105
107
|
["path", { d: "M13 18H7", key: "bb0bb7" }],
|
|
106
108
|
["path", { d: "M7 14h.01", key: "1qa3f1" }],
|
|
107
109
|
["path", { d: "M17 18h.01", key: "1bdyru" }]
|
|
108
|
-
],
|
|
110
|
+
], Tn = Ee("calendar-range", An);
|
|
109
111
|
/**
|
|
110
112
|
* @license lucide-react v1.22.0 - ISC
|
|
111
113
|
*
|
|
112
114
|
* This source code is licensed under the ISC license.
|
|
113
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
116
|
*/
|
|
115
|
-
const
|
|
117
|
+
const On = [
|
|
116
118
|
["path", { d: "M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0", key: "1dfaln" }],
|
|
117
119
|
["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
|
|
118
|
-
],
|
|
120
|
+
], Dn = Ee("ear", On);
|
|
119
121
|
/**
|
|
120
122
|
* @license lucide-react v1.22.0 - ISC
|
|
121
123
|
*
|
|
122
124
|
* This source code is licensed under the ISC license.
|
|
123
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
126
|
*/
|
|
125
|
-
const
|
|
127
|
+
const En = [
|
|
126
128
|
["path", { d: "M6 18h8", key: "1borvv" }],
|
|
127
129
|
["path", { d: "M3 22h18", key: "8prr45" }],
|
|
128
130
|
["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
|
|
129
131
|
["path", { d: "M9 14h2", key: "197e7h" }],
|
|
130
132
|
["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
|
|
131
133
|
["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
|
|
132
|
-
],
|
|
134
|
+
], Fn = Ee("microscope", En);
|
|
133
135
|
/**
|
|
134
136
|
* @license lucide-react v1.22.0 - ISC
|
|
135
137
|
*
|
|
136
138
|
* This source code is licensed under the ISC license.
|
|
137
139
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
140
|
*/
|
|
139
|
-
const
|
|
141
|
+
const Mn = [
|
|
140
142
|
[
|
|
141
143
|
"path",
|
|
142
144
|
{ d: "m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z", key: "wa1lgi" }
|
|
143
145
|
],
|
|
144
146
|
["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
|
|
145
|
-
],
|
|
147
|
+
], Ln = Ee("pill", Mn);
|
|
146
148
|
/**
|
|
147
149
|
* @license lucide-react v1.22.0 - ISC
|
|
148
150
|
*
|
|
149
151
|
* This source code is licensed under the ISC license.
|
|
150
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
153
|
*/
|
|
152
|
-
const
|
|
154
|
+
const _n = [
|
|
153
155
|
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
154
156
|
["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
|
|
155
157
|
["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
|
|
156
158
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
157
159
|
["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
|
|
158
|
-
],
|
|
160
|
+
], Bn = Ee("scissors", _n);
|
|
159
161
|
/**
|
|
160
162
|
* @license lucide-react v1.22.0 - ISC
|
|
161
163
|
*
|
|
162
164
|
* This source code is licensed under the ISC license.
|
|
163
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
164
166
|
*/
|
|
165
|
-
const
|
|
167
|
+
const Rn = [
|
|
166
168
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
167
169
|
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
|
|
168
170
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
169
171
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
170
|
-
],
|
|
172
|
+
], Pn = Ee("smile", Rn);
|
|
171
173
|
/**
|
|
172
174
|
* @license lucide-react v1.22.0 - ISC
|
|
173
175
|
*
|
|
174
176
|
* This source code is licensed under the ISC license.
|
|
175
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
178
|
*/
|
|
177
|
-
const
|
|
179
|
+
const Vn = [
|
|
178
180
|
["path", { d: "M12 10V2", key: "16sf7g" }],
|
|
179
181
|
["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
|
|
180
182
|
["path", { d: "M2 18h2", key: "j10viu" }],
|
|
@@ -183,25 +185,25 @@ const Bn = [
|
|
|
183
185
|
["path", { d: "M22 22H2", key: "19qnx5" }],
|
|
184
186
|
["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
|
|
185
187
|
["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
|
|
186
|
-
],
|
|
188
|
+
], $n = Ee("sunset", Vn);
|
|
187
189
|
/**
|
|
188
190
|
* @license lucide-react v1.22.0 - ISC
|
|
189
191
|
*
|
|
190
192
|
* This source code is licensed under the ISC license.
|
|
191
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
192
194
|
*/
|
|
193
|
-
const
|
|
195
|
+
const qn = [
|
|
194
196
|
["path", { d: "m18 2 4 4", key: "22kx64" }],
|
|
195
197
|
["path", { d: "m17 7 3-3", key: "1w1zoj" }],
|
|
196
198
|
["path", { d: "M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5", key: "1exhtz" }],
|
|
197
199
|
["path", { d: "m9 11 4 4", key: "rovt3i" }],
|
|
198
200
|
["path", { d: "m5 19-3 3", key: "59f2uf" }],
|
|
199
201
|
["path", { d: "m14 4 6 6", key: "yqp9t2" }]
|
|
200
|
-
], as =
|
|
201
|
-
function
|
|
202
|
-
return
|
|
202
|
+
], as = Ee("syringe", qn);
|
|
203
|
+
function Kn(e, t, n) {
|
|
204
|
+
return bs(e, -1, n);
|
|
203
205
|
}
|
|
204
|
-
const
|
|
206
|
+
const zn = {
|
|
205
207
|
id: "booking",
|
|
206
208
|
// `view_change` removed (0.69): the layout `variant` is a fixed prop — the
|
|
207
209
|
// handle exposes only `getVariant` (state), no action mutates it. The flow's
|
|
@@ -276,29 +278,29 @@ const $n = {
|
|
|
276
278
|
description: "Sourced from the id prop."
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
|
-
},
|
|
281
|
+
}, Zt = [
|
|
280
282
|
"email",
|
|
281
283
|
"whatsapp",
|
|
282
284
|
"sms"
|
|
283
|
-
],
|
|
284
|
-
function
|
|
285
|
+
], Re = "all", jn = "de";
|
|
286
|
+
function Un(e) {
|
|
285
287
|
const t = e.lockedOperatorId;
|
|
286
288
|
return [...t ? e.operatorsByService ? e.specialties.filter(
|
|
287
289
|
(r) => e.services.some(
|
|
288
290
|
(i) => {
|
|
289
|
-
var
|
|
290
|
-
return i.specialtyId === r.id && ((
|
|
291
|
+
var o;
|
|
292
|
+
return i.specialtyId === r.id && ((o = i.operatorIds) == null ? void 0 : o.includes(t));
|
|
291
293
|
}
|
|
292
294
|
)
|
|
293
295
|
) : e.specialties.filter((r) => {
|
|
294
296
|
var i;
|
|
295
297
|
return (i = r.operatorIds) == null ? void 0 : i.includes(t);
|
|
296
298
|
}) : e.specialties].sort((r, i) => {
|
|
297
|
-
const
|
|
298
|
-
return
|
|
299
|
+
const o = r.sequenceNumber ?? Number.POSITIVE_INFINITY, d = i.sequenceNumber ?? Number.POSITIVE_INFINITY;
|
|
300
|
+
return o - d;
|
|
299
301
|
});
|
|
300
302
|
}
|
|
301
|
-
function
|
|
303
|
+
function Gn(e) {
|
|
302
304
|
let t = e.services;
|
|
303
305
|
if (e.lockedOperatorId && (t = t.filter(
|
|
304
306
|
(r) => {
|
|
@@ -306,65 +308,65 @@ function zn(e) {
|
|
|
306
308
|
return (i = r.operatorIds) == null ? void 0 : i.includes(e.lockedOperatorId);
|
|
307
309
|
}
|
|
308
310
|
)), e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) {
|
|
309
|
-
const r =
|
|
311
|
+
const r = We(e.value);
|
|
310
312
|
r.length > 0 && (t = t.filter(
|
|
311
313
|
(i) => i.specialtyId !== void 0 && r.includes(i.specialtyId)
|
|
312
314
|
));
|
|
313
315
|
}
|
|
314
316
|
return t;
|
|
315
317
|
}
|
|
316
|
-
function
|
|
317
|
-
const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, n =
|
|
318
|
+
function Hn(e) {
|
|
319
|
+
const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, n = je(e.value);
|
|
318
320
|
if ((!t || e.operatorsByService) && n.length > 0)
|
|
319
321
|
return e.operators.filter(
|
|
320
322
|
(r) => {
|
|
321
323
|
var i;
|
|
322
|
-
return (i = r.appointmentBookingReasonIds) == null ? void 0 : i.some((
|
|
324
|
+
return (i = r.appointmentBookingReasonIds) == null ? void 0 : i.some((o) => n.includes(o));
|
|
323
325
|
}
|
|
324
326
|
);
|
|
325
327
|
if (t) {
|
|
326
|
-
const r =
|
|
328
|
+
const r = We(e.value);
|
|
327
329
|
if (r.length > 0)
|
|
328
330
|
return e.operators.filter(
|
|
329
331
|
(i) => {
|
|
330
|
-
var
|
|
331
|
-
return (
|
|
332
|
+
var o;
|
|
333
|
+
return (o = i.specialtyIds) == null ? void 0 : o.some((d) => r.includes(d));
|
|
332
334
|
}
|
|
333
335
|
);
|
|
334
336
|
}
|
|
335
337
|
return [];
|
|
336
338
|
}
|
|
337
|
-
function
|
|
338
|
-
const n = e.country ===
|
|
339
|
+
function Jn(e, t) {
|
|
340
|
+
const n = e.country === jn, r = !n || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && r, d = We(e.value).length > 0, m = !o || d, p = je(e.value).length > 0, h = !m || p, l = t.operators, c = !!e.allowOperatorSelection && h && p && !e.lockedOperatorId && l.length > 1, u = h && p, x = (!u || e.value.date !== void 0) && e.value.date !== void 0, E = (!x || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, N = p && l.length === 0;
|
|
339
341
|
return {
|
|
340
342
|
insurance: n,
|
|
341
|
-
specialty:
|
|
343
|
+
specialty: o,
|
|
342
344
|
service: m,
|
|
343
|
-
operator:
|
|
345
|
+
operator: c,
|
|
344
346
|
date: u,
|
|
345
347
|
slot: x,
|
|
346
348
|
details: E,
|
|
347
349
|
onboardingIncomplete: N
|
|
348
350
|
};
|
|
349
351
|
}
|
|
350
|
-
function
|
|
352
|
+
function Wn(e, t) {
|
|
351
353
|
const n = [];
|
|
352
354
|
return t.insurance && n.push(1), t.specialty && n.push(2), n.push(3), t.operator && n.push(4), n.push(5), n.push(6), n.push(7), {
|
|
353
355
|
currentStep: n.find(
|
|
354
|
-
(i) =>
|
|
356
|
+
(i) => !ze(i, e.value)
|
|
355
357
|
) ?? 7,
|
|
356
358
|
visibleSteps: n
|
|
357
359
|
};
|
|
358
360
|
}
|
|
359
|
-
function
|
|
361
|
+
function ze(e, t) {
|
|
360
362
|
switch (e) {
|
|
361
363
|
case 1:
|
|
362
364
|
return t.insuranceType !== void 0;
|
|
363
365
|
// 0.34.0: array-or-single — satisfied when EITHER form is present.
|
|
364
366
|
case 2:
|
|
365
|
-
return
|
|
367
|
+
return We(t).length > 0;
|
|
366
368
|
case 3:
|
|
367
|
-
return
|
|
369
|
+
return je(t).length > 0;
|
|
368
370
|
// Always satisfied, like its gate: "no preference" is a valid answer,
|
|
369
371
|
// whether it is the `'all'` sentinel or an empty multi-select.
|
|
370
372
|
case 4:
|
|
@@ -378,18 +380,18 @@ function $e(e, t) {
|
|
|
378
380
|
return !1;
|
|
379
381
|
}
|
|
380
382
|
}
|
|
381
|
-
function
|
|
383
|
+
function Yn(e) {
|
|
382
384
|
const t = {
|
|
383
|
-
specialties:
|
|
384
|
-
services:
|
|
385
|
-
operators:
|
|
386
|
-
}, n =
|
|
387
|
-
let
|
|
385
|
+
specialties: Un(e),
|
|
386
|
+
services: Gn(e),
|
|
387
|
+
operators: Hn(e)
|
|
388
|
+
}, n = Jn(e, t), { currentStep: r, visibleSteps: i } = Wn(e, n);
|
|
389
|
+
let o;
|
|
388
390
|
if (e.value.date && e.value.slotKey) {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
+
const h = e.availableSlots[e.value.date];
|
|
392
|
+
h && (o = h.find((l) => l.key === e.value.slotKey));
|
|
391
393
|
}
|
|
392
|
-
const
|
|
394
|
+
const d = je(e.value), f = d.length > 0 ? e.services.find((h) => h.id === d[0]) : void 0, m = We(e.value).length > 0, p = d.length > 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!n.insurance || e.value.insuranceType !== void 0) && (!n.specialty || m);
|
|
393
395
|
return {
|
|
394
396
|
gates: n,
|
|
395
397
|
filtered: t,
|
|
@@ -398,10 +400,10 @@ function Gn(e) {
|
|
|
398
400
|
visibleSteps: i,
|
|
399
401
|
isReadyToSubmit: p,
|
|
400
402
|
durationMin: f == null ? void 0 : f.durationMin,
|
|
401
|
-
selectedSlot:
|
|
403
|
+
selectedSlot: o
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
|
-
function
|
|
406
|
+
function ys(e, t) {
|
|
405
407
|
return {
|
|
406
408
|
...e,
|
|
407
409
|
insuranceType: t,
|
|
@@ -413,7 +415,7 @@ function bs(e, t) {
|
|
|
413
415
|
details: void 0
|
|
414
416
|
};
|
|
415
417
|
}
|
|
416
|
-
function
|
|
418
|
+
function ks(e, t) {
|
|
417
419
|
return {
|
|
418
420
|
...e,
|
|
419
421
|
specialtyId: t,
|
|
@@ -427,7 +429,7 @@ function ys(e, t) {
|
|
|
427
429
|
details: void 0
|
|
428
430
|
};
|
|
429
431
|
}
|
|
430
|
-
function
|
|
432
|
+
function Ss(e, t) {
|
|
431
433
|
return {
|
|
432
434
|
...e,
|
|
433
435
|
specialtyId: void 0,
|
|
@@ -441,7 +443,7 @@ function ks(e, t) {
|
|
|
441
443
|
details: void 0
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
|
-
function
|
|
446
|
+
function xs(e, t) {
|
|
445
447
|
return {
|
|
446
448
|
...e,
|
|
447
449
|
serviceId: t,
|
|
@@ -449,27 +451,27 @@ function Ss(e, t) {
|
|
|
449
451
|
// Default the operator to the "All operators" sentinel so a patient
|
|
450
452
|
// who doesn't care about picking lands on a satisfied step 4 without
|
|
451
453
|
// any further input.
|
|
452
|
-
operatorId: t ?
|
|
454
|
+
operatorId: t ? Re : void 0,
|
|
453
455
|
operatorIds: void 0,
|
|
454
456
|
date: void 0,
|
|
455
457
|
slotKey: void 0,
|
|
456
458
|
details: void 0
|
|
457
459
|
};
|
|
458
460
|
}
|
|
459
|
-
function
|
|
461
|
+
function Is(e, t) {
|
|
460
462
|
const n = !!t && t.length > 0;
|
|
461
463
|
return {
|
|
462
464
|
...e,
|
|
463
465
|
serviceId: void 0,
|
|
464
466
|
serviceIds: t,
|
|
465
|
-
operatorId: n ?
|
|
467
|
+
operatorId: n ? Re : void 0,
|
|
466
468
|
operatorIds: void 0,
|
|
467
469
|
date: void 0,
|
|
468
470
|
slotKey: void 0,
|
|
469
471
|
details: void 0
|
|
470
472
|
};
|
|
471
473
|
}
|
|
472
|
-
function
|
|
474
|
+
function Ns(e, t) {
|
|
473
475
|
return {
|
|
474
476
|
...e,
|
|
475
477
|
operatorId: t,
|
|
@@ -479,7 +481,7 @@ function Is(e, t) {
|
|
|
479
481
|
details: void 0
|
|
480
482
|
};
|
|
481
483
|
}
|
|
482
|
-
function
|
|
484
|
+
function ws(e, t) {
|
|
483
485
|
return {
|
|
484
486
|
...e,
|
|
485
487
|
operatorId: void 0,
|
|
@@ -489,16 +491,16 @@ function Ns(e, t) {
|
|
|
489
491
|
details: void 0
|
|
490
492
|
};
|
|
491
493
|
}
|
|
492
|
-
function
|
|
494
|
+
function We(e) {
|
|
493
495
|
return e.specialtyIds && e.specialtyIds.length > 0 ? e.specialtyIds : e.specialtyId ? [e.specialtyId] : [];
|
|
494
496
|
}
|
|
495
|
-
function
|
|
497
|
+
function je(e) {
|
|
496
498
|
return e.serviceIds && e.serviceIds.length > 0 ? e.serviceIds : e.serviceId ? [e.serviceId] : [];
|
|
497
499
|
}
|
|
498
|
-
function
|
|
500
|
+
function Qt(e) {
|
|
499
501
|
return e.operatorIds && e.operatorIds.length > 0 ? e.operatorIds : e.operatorId ? [e.operatorId] : [];
|
|
500
502
|
}
|
|
501
|
-
function
|
|
503
|
+
function qt(e, t) {
|
|
502
504
|
return {
|
|
503
505
|
...e,
|
|
504
506
|
date: t,
|
|
@@ -507,49 +509,49 @@ function $t(e, t) {
|
|
|
507
509
|
// since the user has already filled some fields.
|
|
508
510
|
};
|
|
509
511
|
}
|
|
510
|
-
function
|
|
512
|
+
function Cs(e, t) {
|
|
511
513
|
return {
|
|
512
514
|
...e,
|
|
513
515
|
slotKey: t
|
|
514
516
|
};
|
|
515
517
|
}
|
|
516
|
-
function
|
|
518
|
+
function Zn(e, t) {
|
|
517
519
|
let n = e;
|
|
518
520
|
if (t.lockedOperatorId && n.operatorId !== t.lockedOperatorId && (n = { ...n, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && n.specialtyId === void 0 && n.specialtyIds === void 0 && (n = { ...n, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
|
|
519
|
-
const i =
|
|
520
|
-
(
|
|
521
|
+
const i = We(n), o = i.length > 0 ? t.services.filter(
|
|
522
|
+
(d) => d.specialtyId && i.includes(d.specialtyId)
|
|
521
523
|
) : t.services;
|
|
522
|
-
|
|
524
|
+
o.length === 1 && n.serviceId === void 0 && n.serviceIds === void 0 && (n = { ...n, serviceId: o[0].id }, n.operatorId === void 0 && n.operatorIds === void 0 && (n = { ...n, operatorId: Re }));
|
|
523
525
|
}
|
|
524
526
|
return n;
|
|
525
527
|
}
|
|
526
|
-
function
|
|
527
|
-
if (e.operatorId && e.operatorId !==
|
|
528
|
+
function As(e) {
|
|
529
|
+
if (e.operatorId && e.operatorId !== Re)
|
|
528
530
|
return e.operatorId;
|
|
529
531
|
}
|
|
530
|
-
function
|
|
532
|
+
function Qn(e) {
|
|
531
533
|
if (!e) return !1;
|
|
532
534
|
const t = e.trim();
|
|
533
535
|
return /^\+?\d[\d\s\-()]{6,}$/.test(t);
|
|
534
536
|
}
|
|
535
|
-
function
|
|
537
|
+
function Ts(e) {
|
|
536
538
|
const t = e && e.length > 0 ? e : ["email"], n = new Set(t);
|
|
537
|
-
return
|
|
539
|
+
return Zt.filter((r) => n.has(r));
|
|
538
540
|
}
|
|
539
|
-
function
|
|
540
|
-
const r =
|
|
541
|
+
function Xn(e, t, n) {
|
|
542
|
+
const r = Ts(e), i = new Set(r);
|
|
541
543
|
if (n)
|
|
542
|
-
return
|
|
544
|
+
return Zt.filter(
|
|
543
545
|
(p) => n.includes(p) && i.has(p)
|
|
544
546
|
);
|
|
545
|
-
const
|
|
546
|
-
i.has("email") &&
|
|
547
|
-
const
|
|
548
|
-
f &&
|
|
549
|
-
const m = new Set(
|
|
550
|
-
return
|
|
551
|
-
}
|
|
552
|
-
const
|
|
547
|
+
const o = [];
|
|
548
|
+
i.has("email") && o.push("email");
|
|
549
|
+
const d = Qn(t), f = i.has("whatsapp");
|
|
550
|
+
f && d && o.push("whatsapp"), !f && i.has("sms") && o.push("sms");
|
|
551
|
+
const m = new Set(o);
|
|
552
|
+
return Zt.filter((p) => m.has(p));
|
|
553
|
+
}
|
|
554
|
+
const ei = /https?:\/\/(?:(?![.,;:!?'»›]https?:\/\/)[^\s<>"\u060C\u061B\u061F\u06D4\u2000-\u206F\u3000-\u303F\uFF00-\uFFEF])+/gi, ti = /* @__PURE__ */ new Set([
|
|
553
555
|
".",
|
|
554
556
|
",",
|
|
555
557
|
";",
|
|
@@ -559,15 +561,15 @@ const Zn = /https?:\/\/(?:(?![.,;:!?'»›]https?:\/\/)[^\s<>"\u060C\u061B\u061F
|
|
|
559
561
|
"'",
|
|
560
562
|
"»",
|
|
561
563
|
"›"
|
|
562
|
-
]),
|
|
563
|
-
function
|
|
564
|
+
]), si = { ")": "(", "]": "[", "}": "{" }, cs = (e, t) => e.split(t).length - 1;
|
|
565
|
+
function ni(e) {
|
|
564
566
|
const t = {};
|
|
565
|
-
for (const [r, i] of Object.entries(
|
|
566
|
-
t[r] =
|
|
567
|
+
for (const [r, i] of Object.entries(si))
|
|
568
|
+
t[r] = cs(e, r) - cs(e, i);
|
|
567
569
|
let n = e.length;
|
|
568
570
|
for (; n > 0; ) {
|
|
569
571
|
const r = e[n - 1];
|
|
570
|
-
if (
|
|
572
|
+
if (ti.has(r))
|
|
571
573
|
n -= 1;
|
|
572
574
|
else if (r in t && t[r] > 0)
|
|
573
575
|
t[r] -= 1, n -= 1;
|
|
@@ -576,12 +578,12 @@ function ei(e) {
|
|
|
576
578
|
}
|
|
577
579
|
return e.slice(0, n);
|
|
578
580
|
}
|
|
579
|
-
const
|
|
580
|
-
function
|
|
581
|
-
const t = e.search(
|
|
582
|
-
return t > 0 &&
|
|
581
|
+
const ii = /[\u0600-\u06FF\u3040-\u30FF\u3400-\u9FFF\uAC00-\uD7AF]/, ri = /[A-Za-z0-9]/;
|
|
582
|
+
function oi(e) {
|
|
583
|
+
const t = e.search(ii);
|
|
584
|
+
return t > 0 && ri.test(e[t - 1]) ? e.slice(0, t) : e;
|
|
583
585
|
}
|
|
584
|
-
function
|
|
586
|
+
function ai(e) {
|
|
585
587
|
try {
|
|
586
588
|
const { protocol: t, hostname: n } = new URL(e);
|
|
587
589
|
return (t === "http:" || t === "https:") && n !== "";
|
|
@@ -589,21 +591,21 @@ function ii(e) {
|
|
|
589
591
|
return !1;
|
|
590
592
|
}
|
|
591
593
|
}
|
|
592
|
-
function
|
|
594
|
+
function ci(e) {
|
|
593
595
|
const t = [];
|
|
594
596
|
let n = 0;
|
|
595
597
|
const r = (i) => {
|
|
596
598
|
if (i === "") return;
|
|
597
|
-
const
|
|
598
|
-
(
|
|
599
|
+
const o = t[t.length - 1];
|
|
600
|
+
(o == null ? void 0 : o.kind) === "text" ? o.text += i : t.push({ kind: "text", text: i });
|
|
599
601
|
};
|
|
600
|
-
for (const i of e.matchAll(
|
|
601
|
-
const
|
|
602
|
-
|
|
602
|
+
for (const i of e.matchAll(ei)) {
|
|
603
|
+
const o = i.index ?? 0, d = ni(oi(i[0]));
|
|
604
|
+
ai(d) && (r(e.slice(n, o)), t.push({ kind: "link", text: d, href: d }), n = o + d.length);
|
|
603
605
|
}
|
|
604
606
|
return r(e.slice(n)), t;
|
|
605
607
|
}
|
|
606
|
-
const
|
|
608
|
+
const ds = 500, di = /^[A-Z0-9]{16}$/, li = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ls = 300, Wt = "ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]", Et = (e) => e && /^https?:\/\//i.test(e) ? e : void 0, ui = (e, t) => ({
|
|
607
609
|
street: (e == null ? void 0 : e.address.line1) ?? "",
|
|
608
610
|
city: (e == null ? void 0 : e.address.city) ?? "",
|
|
609
611
|
postcode: (e == null ? void 0 : e.address.postalCode) ?? "",
|
|
@@ -611,7 +613,7 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
611
613
|
// The practice's country only until the patient has an address at all.
|
|
612
614
|
country: (e ? e.address.country : t).toLowerCase(),
|
|
613
615
|
formatted: ""
|
|
614
|
-
}),
|
|
616
|
+
}), pi = (e, t, n = null) => ({
|
|
615
617
|
name: t,
|
|
616
618
|
address: {
|
|
617
619
|
line1: e.street,
|
|
@@ -621,7 +623,7 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
621
623
|
postalCode: e.postcode,
|
|
622
624
|
country: e.country.toUpperCase()
|
|
623
625
|
}
|
|
624
|
-
}),
|
|
626
|
+
}), mi = Nt("ds:flex ds:flex-col ds:border", {
|
|
625
627
|
variants: {
|
|
626
628
|
noticeStyle: {
|
|
627
629
|
plain: "ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
|
|
@@ -629,17 +631,17 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
629
631
|
}
|
|
630
632
|
},
|
|
631
633
|
defaultVariants: { noticeStyle: "highlighted" }
|
|
632
|
-
}),
|
|
634
|
+
}), fi = ["it", "ch", "de", "at", "fr", "sm"], $ = {
|
|
633
635
|
country: "billing.country",
|
|
634
636
|
street: "billing.street",
|
|
635
637
|
city: "billing.city",
|
|
636
638
|
postcode: "billing.postcode",
|
|
637
639
|
province: "billing.province"
|
|
638
|
-
},
|
|
640
|
+
}, Os = /^\d{5}$/, gi = (e) => {
|
|
639
641
|
if (!e) return !1;
|
|
640
|
-
const { line1: t, city: n, postalCode: r, country: i, state:
|
|
641
|
-
return !t.trim() || !n.trim() || !r.trim() || !i.trim() ? !1 : i.toUpperCase() !== "IT" ? !0 : !!
|
|
642
|
-
},
|
|
642
|
+
const { line1: t, city: n, postalCode: r, country: i, state: o } = e.address;
|
|
643
|
+
return !t.trim() || !n.trim() || !r.trim() || !i.trim() ? !1 : i.toUpperCase() !== "IT" ? !0 : !!o.trim() && Os.test(r.trim());
|
|
644
|
+
}, hi = (e, t) => {
|
|
643
645
|
var n;
|
|
644
646
|
return {
|
|
645
647
|
name: t,
|
|
@@ -652,7 +654,7 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
652
654
|
country: e.address.country.trim().toUpperCase()
|
|
653
655
|
}
|
|
654
656
|
};
|
|
655
|
-
},
|
|
657
|
+
}, Ft = { state: "idle" }, us = [
|
|
656
658
|
"firstName",
|
|
657
659
|
"lastName",
|
|
658
660
|
"email",
|
|
@@ -660,28 +662,28 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
660
662
|
"codiceFiscale",
|
|
661
663
|
"dateOfBirth",
|
|
662
664
|
"insuranceNumber",
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
],
|
|
665
|
+
$.country,
|
|
666
|
+
$.street,
|
|
667
|
+
$.city,
|
|
668
|
+
$.postcode,
|
|
669
|
+
$.province
|
|
670
|
+
], vi = /* @__PURE__ */ new Set(), ts = fs(
|
|
669
671
|
({
|
|
670
672
|
value: e,
|
|
671
673
|
onChange: t,
|
|
672
674
|
onSubmit: n,
|
|
673
675
|
requireCodiceFiscale: r = !1,
|
|
674
676
|
requireDateOfBirth: i = !1,
|
|
675
|
-
requireInsuranceNumber:
|
|
676
|
-
insuranceType:
|
|
677
|
+
requireInsuranceNumber: o = !1,
|
|
678
|
+
insuranceType: d,
|
|
677
679
|
showNote: f = !1,
|
|
678
680
|
showReturningPatientFlag: m = !1,
|
|
679
681
|
privacyPolicyUrl: p,
|
|
680
|
-
termsUrl:
|
|
682
|
+
termsUrl: h,
|
|
681
683
|
practiceConsent: l,
|
|
682
|
-
payment:
|
|
684
|
+
payment: c,
|
|
683
685
|
paymentTermsUrl: u,
|
|
684
|
-
paymentBlocked:
|
|
686
|
+
paymentBlocked: b = !1,
|
|
685
687
|
billingInDetails: x = !1,
|
|
686
688
|
paymentNoticeStyle: k = "highlighted",
|
|
687
689
|
criticalInformationToAccept: E,
|
|
@@ -691,229 +693,237 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
691
693
|
summarySlot: w,
|
|
692
694
|
defaultPhoneCountry: O,
|
|
693
695
|
confirmationChannels: T,
|
|
694
|
-
defaultConfirmationChannels:
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
696
|
+
defaultConfirmationChannels: g,
|
|
697
|
+
singleConfirmationChannel: C = !1,
|
|
698
|
+
submitError: U
|
|
699
|
+
}, q) => {
|
|
700
|
+
var A, L, _, W, se;
|
|
701
|
+
const { t: y, i18n: K } = Y("ui"), B = Pt(), Se = F(null), R = ke(
|
|
702
|
+
(a) => {
|
|
703
|
+
Se.current = a, typeof q == "function" ? q(a) : q && (q.current = a);
|
|
701
704
|
},
|
|
702
|
-
[
|
|
703
|
-
), [
|
|
704
|
-
|
|
705
|
+
[q]
|
|
706
|
+
), [xe, st] = te(0);
|
|
707
|
+
z(() => {
|
|
705
708
|
var D;
|
|
706
|
-
if (
|
|
707
|
-
const
|
|
709
|
+
if (xe === 0) return;
|
|
710
|
+
const a = (D = Se.current) == null ? void 0 : D.querySelectorAll(
|
|
708
711
|
'[aria-invalid="true"], [role="checkbox"][aria-required="true"][aria-checked="false"], [data-unanswered] [role="checkbox"]'
|
|
709
712
|
);
|
|
710
|
-
for (const
|
|
711
|
-
if (
|
|
712
|
-
}, [
|
|
713
|
-
const
|
|
714
|
-
(
|
|
713
|
+
for (const H of a ?? [])
|
|
714
|
+
if (H.focus(), document.activeElement === H) return;
|
|
715
|
+
}, [xe]);
|
|
716
|
+
const he = F(!1), [Ye, ie] = te(!1), [Fe, Pe] = te(!1), Q = I || Ye, [re, Ie] = te(Ft), [Ne, Me] = te(Ft), [X, Ve] = te({}), de = ke(
|
|
717
|
+
(a) => Ve((D) => ({ ...D, [a]: !0 })),
|
|
715
718
|
[]
|
|
716
|
-
), [
|
|
719
|
+
), [le, we] = te(vi), Le = F(null), Ue = F(
|
|
717
720
|
null
|
|
718
721
|
);
|
|
719
|
-
|
|
722
|
+
z(
|
|
720
723
|
() => () => {
|
|
721
|
-
|
|
724
|
+
Le.current && clearTimeout(Le.current), Ue.current && clearTimeout(Ue.current);
|
|
722
725
|
},
|
|
723
726
|
[]
|
|
724
727
|
);
|
|
725
|
-
const
|
|
726
|
-
(
|
|
727
|
-
|
|
728
|
+
const V = ke(
|
|
729
|
+
(a) => {
|
|
730
|
+
Pe(!1), t({ ...e, ...a });
|
|
728
731
|
},
|
|
729
732
|
[e, t]
|
|
730
|
-
),
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
), ue = c ? JSON.stringify([
|
|
734
|
+
c.serviceId,
|
|
735
|
+
c.kind,
|
|
736
|
+
c.amountCents,
|
|
737
|
+
c.currencyCode,
|
|
735
738
|
u
|
|
736
|
-
]) : void 0, [
|
|
737
|
-
() => e.paymentAccepted ?
|
|
738
|
-
),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}, [
|
|
742
|
-
const
|
|
739
|
+
]) : void 0, [zt, nt] = te(
|
|
740
|
+
() => e.paymentAccepted ? ue : void 0
|
|
741
|
+
), it = F(ue), wt = !!(c && e.paymentAccepted && zt === ue);
|
|
742
|
+
z(() => {
|
|
743
|
+
it.current !== ue && (it.current = ue, nt(void 0), e.paymentAccepted !== void 0 && V({ paymentAccepted: c ? !1 : void 0 }));
|
|
744
|
+
}, [ue, c, V, e.paymentAccepted]);
|
|
745
|
+
const rt = typeof (l == null ? void 0 : l.label) == "string" && l.label.trim() !== "", G = l && rt ? JSON.stringify([
|
|
743
746
|
l.label,
|
|
744
747
|
l.url ?? null,
|
|
745
748
|
l.required
|
|
746
|
-
]) : void 0, [
|
|
747
|
-
() => e.practiceConsentAccepted ?
|
|
748
|
-
),
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}, [
|
|
752
|
-
const
|
|
749
|
+
]) : void 0, [jt, pe] = te(
|
|
750
|
+
() => e.practiceConsentAccepted ? G : void 0
|
|
751
|
+
), Ze = F(G), Ce = !!(G !== void 0 && e.practiceConsentAccepted && jt === G);
|
|
752
|
+
z(() => {
|
|
753
|
+
Ze.current !== G && (Ze.current = G, pe(void 0), e.practiceConsentAccepted !== void 0 && V({ practiceConsentAccepted: void 0 }));
|
|
754
|
+
}, [G, V, e.practiceConsentAccepted]);
|
|
755
|
+
const _e = c ? Vt(c.amountCents, c.currencyCode, K.language) : "", P = Et(u), Ae = x && !!c && !b, ve = r, Ct = (O || "it").toLowerCase(), me = !Ae || gi(e.billing), be = ui(e.billing, Ct), Qe = be.country === "it", ft = F(null), oe = F(
|
|
753
756
|
null
|
|
754
|
-
),
|
|
755
|
-
|
|
756
|
-
var
|
|
757
|
-
|
|
758
|
-
}, [
|
|
759
|
-
const
|
|
757
|
+
), $e = (A = e.billing) == null ? void 0 : A.address.line1.trim(), ot = ((_ = (L = e.billing) == null ? void 0 : L.address.line2) == null ? void 0 : _.trim()) || null;
|
|
758
|
+
z(() => {
|
|
759
|
+
var a;
|
|
760
|
+
$e !== void 0 && ot ? oe.current = { street: $e, line2: ot } : ($e === void 0 || $e === ((a = oe.current) == null ? void 0 : a.street)) && (oe.current = null);
|
|
761
|
+
}, [$e, ot]);
|
|
762
|
+
const Xe = (a) => (
|
|
760
763
|
// Nothing for a block not shown, nor for a province outside Italy.
|
|
761
|
-
!
|
|
764
|
+
!Ae || !X[$[a]] || a === "province" && !Qe ? void 0 : be[a].trim() ? (
|
|
762
765
|
// The one format the block itself checks: an Italian CAP.
|
|
763
|
-
|
|
764
|
-
) :
|
|
765
|
-
),
|
|
766
|
-
() =>
|
|
767
|
-
(
|
|
768
|
-
...
|
|
766
|
+
a === "postcode" && Qe && !Os.test(be.postcode.trim()) ? y("inputs.postalCode.invalid") : void 0
|
|
767
|
+
) : y("booking.details.fieldRequired")
|
|
768
|
+
), Ut = ke(
|
|
769
|
+
() => Ve(
|
|
770
|
+
(a) => a[$.province] ? a : {
|
|
771
|
+
...a,
|
|
769
772
|
codiceFiscale: !0,
|
|
770
773
|
...Object.fromEntries(
|
|
771
|
-
Object.values(
|
|
774
|
+
Object.values($).map((D) => [D, !0])
|
|
772
775
|
)
|
|
773
776
|
}
|
|
774
777
|
),
|
|
775
778
|
[]
|
|
776
|
-
),
|
|
777
|
-
() =>
|
|
779
|
+
), fe = M(
|
|
780
|
+
() => Ts(T),
|
|
778
781
|
[T]
|
|
779
|
-
),
|
|
780
|
-
|
|
781
|
-
if (
|
|
782
|
-
if (!
|
|
783
|
-
e.confirmationChannels !== void 0 &&
|
|
782
|
+
), Te = !c && !b && fe.length >= 2, J = F(!1);
|
|
783
|
+
z(() => {
|
|
784
|
+
if (c || b) return;
|
|
785
|
+
if (!Te) {
|
|
786
|
+
e.confirmationChannels !== void 0 && V({ confirmationChannels: void 0 });
|
|
784
787
|
return;
|
|
785
788
|
}
|
|
786
789
|
if (e.confirmationChannels !== void 0) {
|
|
787
|
-
|
|
790
|
+
J.current = !0, C && e.confirmationChannels.length > 1 && V({
|
|
791
|
+
confirmationChannels: e.confirmationChannels.slice(0, 1)
|
|
792
|
+
});
|
|
788
793
|
return;
|
|
789
794
|
}
|
|
790
|
-
const
|
|
791
|
-
|
|
795
|
+
const a = C ? [
|
|
796
|
+
(g == null ? void 0 : g.find(
|
|
797
|
+
(D) => fe.includes(D)
|
|
798
|
+
)) ?? fe[0]
|
|
799
|
+
] : Xn(
|
|
800
|
+
fe,
|
|
792
801
|
e.mobilePhone,
|
|
793
|
-
|
|
802
|
+
g
|
|
794
803
|
);
|
|
795
|
-
|
|
804
|
+
J.current = !0, V({ confirmationChannels: a });
|
|
796
805
|
}, [
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
806
|
+
Te,
|
|
807
|
+
c,
|
|
808
|
+
b,
|
|
809
|
+
fe,
|
|
801
810
|
e.mobilePhone,
|
|
802
|
-
|
|
811
|
+
g,
|
|
812
|
+
C
|
|
803
813
|
]);
|
|
804
|
-
const j =
|
|
814
|
+
const j = M(
|
|
805
815
|
() => e.confirmationChannels ?? [],
|
|
806
816
|
[e.confirmationChannels]
|
|
807
|
-
),
|
|
808
|
-
|
|
809
|
-
|
|
817
|
+
), at = Te && j.length === 0, ct = F(N), gt = F(S);
|
|
818
|
+
z(() => {
|
|
819
|
+
ct.current = N, gt.current = S;
|
|
810
820
|
}, [N, S]);
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
const
|
|
814
|
-
if (!
|
|
815
|
-
|
|
821
|
+
const ht = !!N, vt = !!S;
|
|
822
|
+
z(() => {
|
|
823
|
+
const a = e.codiceFiscale;
|
|
824
|
+
if (!ve || !ht || !a) {
|
|
825
|
+
Ie(Ft);
|
|
816
826
|
return;
|
|
817
827
|
}
|
|
818
|
-
if (!
|
|
819
|
-
|
|
828
|
+
if (!di.test(a)) {
|
|
829
|
+
Ie({
|
|
820
830
|
state: "invalid",
|
|
821
|
-
hint:
|
|
831
|
+
hint: y("booking.details.codiceFiscale.invalidFormat")
|
|
822
832
|
});
|
|
823
833
|
return;
|
|
824
834
|
}
|
|
825
|
-
|
|
835
|
+
Ie({ state: "pending" });
|
|
826
836
|
let D = !0;
|
|
827
|
-
return
|
|
837
|
+
return Le.current && clearTimeout(Le.current), Le.current = setTimeout(async () => {
|
|
828
838
|
try {
|
|
829
|
-
const
|
|
830
|
-
if (!
|
|
831
|
-
const
|
|
832
|
-
D &&
|
|
833
|
-
state:
|
|
834
|
-
hint:
|
|
835
|
-
value:
|
|
839
|
+
const H = ct.current;
|
|
840
|
+
if (!H) return;
|
|
841
|
+
const is = await H(a);
|
|
842
|
+
D && Ie({
|
|
843
|
+
state: is.valid ? "valid" : "invalid",
|
|
844
|
+
hint: is.hint,
|
|
845
|
+
value: a
|
|
836
846
|
});
|
|
837
847
|
} catch {
|
|
838
|
-
D &&
|
|
848
|
+
D && Ie({
|
|
839
849
|
state: "invalid",
|
|
840
|
-
hint:
|
|
841
|
-
value:
|
|
850
|
+
hint: y("booking.details.codiceFiscale.unavailable"),
|
|
851
|
+
value: a
|
|
842
852
|
});
|
|
843
853
|
}
|
|
844
|
-
},
|
|
845
|
-
D = !1,
|
|
854
|
+
}, ls), () => {
|
|
855
|
+
D = !1, Le.current && clearTimeout(Le.current);
|
|
846
856
|
};
|
|
847
|
-
}, [
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
const
|
|
851
|
-
if (!
|
|
852
|
-
|
|
857
|
+
}, [ve, ht, e.codiceFiscale, y]);
|
|
858
|
+
const Ge = o && d === "public";
|
|
859
|
+
z(() => {
|
|
860
|
+
const a = e.insuranceNumber;
|
|
861
|
+
if (!Ge || !vt || !a) {
|
|
862
|
+
Me(Ft);
|
|
853
863
|
return;
|
|
854
864
|
}
|
|
855
|
-
|
|
856
|
-
const D =
|
|
857
|
-
D && D(
|
|
858
|
-
(
|
|
859
|
-
|
|
865
|
+
Me({ state: "pending" }), Ue.current && clearTimeout(Ue.current), Ue.current = setTimeout(() => {
|
|
866
|
+
const D = gt.current;
|
|
867
|
+
D && D(a).then(
|
|
868
|
+
(H) => Me(
|
|
869
|
+
H.valid ? { state: "valid" } : { state: "invalid", hint: H.hint }
|
|
860
870
|
)
|
|
861
871
|
).catch(
|
|
862
|
-
() =>
|
|
872
|
+
() => Me({
|
|
863
873
|
state: "invalid",
|
|
864
|
-
hint:
|
|
874
|
+
hint: y("booking.details.insuranceNumber.unavailable")
|
|
865
875
|
})
|
|
866
876
|
);
|
|
867
|
-
},
|
|
868
|
-
}, [
|
|
869
|
-
const
|
|
870
|
-
() => !!(e.email &&
|
|
877
|
+
}, ls);
|
|
878
|
+
}, [Ge, vt, e.insuranceNumber, y]);
|
|
879
|
+
const dt = M(
|
|
880
|
+
() => !!(e.email && li.test(e.email)),
|
|
871
881
|
[e.email]
|
|
872
|
-
),
|
|
882
|
+
), qe = M(
|
|
873
883
|
() => !!(e.mobilePhone && e.mobilePhone.length >= 6),
|
|
874
884
|
[e.mobilePhone]
|
|
875
|
-
),
|
|
876
|
-
var
|
|
877
|
-
return !(!((
|
|
885
|
+
), At = M(() => {
|
|
886
|
+
var a, D;
|
|
887
|
+
return !(!((a = e.firstName) != null && a.trim()) || !((D = e.lastName) != null && D.trim()) || !dt || !qe || ve && (re.state !== "valid" || re.value !== e.codiceFiscale) || !me || i && !e.dateOfBirth || Ge && Ne.state !== "valid");
|
|
878
888
|
}, [
|
|
879
889
|
e.firstName,
|
|
880
890
|
e.lastName,
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
891
|
+
dt,
|
|
892
|
+
qe,
|
|
893
|
+
ve,
|
|
894
|
+
me,
|
|
895
|
+
re.state,
|
|
896
|
+
re.value,
|
|
887
897
|
e.codiceFiscale,
|
|
888
898
|
i,
|
|
889
899
|
e.dateOfBirth,
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
]),
|
|
893
|
-
firstName:
|
|
894
|
-
lastName:
|
|
895
|
-
email:
|
|
896
|
-
mobilePhone:
|
|
897
|
-
codiceFiscale:
|
|
898
|
-
dateOfBirth:
|
|
899
|
-
insuranceNumber:
|
|
900
|
-
[
|
|
901
|
-
[
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
[
|
|
905
|
-
},
|
|
906
|
-
(
|
|
900
|
+
Ge,
|
|
901
|
+
Ne.state
|
|
902
|
+
]), Ke = E != null && E.trim() ? E : void 0, bt = Ke !== void 0, Gt = !bt || !!e.criticalInformationAccepted, Oe = !rt || !(l != null && l.required) || Ce, Ht = !!(e.privacyConsent && e.termsConsent && Gt && Oe), yt = !Te || j.length > 0, Be = At && Ht && yt && (!c || wt) && !b && !Q, ge = !Be && !Q && !b, He = `${B}-submit-hint`, ee = {
|
|
903
|
+
firstName: X.firstName && !((W = e.firstName) != null && W.trim()) ? y("booking.details.firstName.required") : void 0,
|
|
904
|
+
lastName: X.lastName && !((se = e.lastName) != null && se.trim()) ? y("booking.details.lastName.required") : void 0,
|
|
905
|
+
email: X.email && !dt ? y("booking.details.email.invalid") : void 0,
|
|
906
|
+
mobilePhone: X.mobilePhone && !qe ? y("booking.details.mobilePhone.invalid") : void 0,
|
|
907
|
+
codiceFiscale: X.codiceFiscale && re.state === "invalid" ? re.hint ?? y("booking.details.codiceFiscale.invalid") : X.codiceFiscale && !e.codiceFiscale ? y("booking.details.fieldRequired") : void 0,
|
|
908
|
+
dateOfBirth: X.dateOfBirth && !e.dateOfBirth ? y("booking.details.dateOfBirth.required") : void 0,
|
|
909
|
+
insuranceNumber: X.insuranceNumber && Ne.state === "invalid" ? Ne.hint ?? y("booking.details.insuranceNumber.invalid") : void 0,
|
|
910
|
+
[$.country]: Xe("country"),
|
|
911
|
+
[$.street]: Xe("street"),
|
|
912
|
+
[$.city]: Xe("city"),
|
|
913
|
+
[$.postcode]: Xe("postcode"),
|
|
914
|
+
[$.province]: Xe("province")
|
|
915
|
+
}, kt = us.filter(
|
|
916
|
+
(a) => le.has(a) && ee[a] !== void 0
|
|
907
917
|
);
|
|
908
|
-
|
|
909
|
-
const ae = (
|
|
910
|
-
if (
|
|
918
|
+
kt.length !== le.size && we(new Set(kt));
|
|
919
|
+
const ae = (a) => !le.has(a), Tt = async (a) => {
|
|
920
|
+
if (a.preventDefault(), !Q && !he.current && !Be && we(
|
|
911
921
|
new Set(
|
|
912
|
-
|
|
913
|
-
(
|
|
922
|
+
us.filter(
|
|
923
|
+
(H) => le.has(H) || !ee[H]
|
|
914
924
|
)
|
|
915
925
|
)
|
|
916
|
-
),
|
|
926
|
+
), Ve({
|
|
917
927
|
firstName: !0,
|
|
918
928
|
lastName: !0,
|
|
919
929
|
email: !0,
|
|
@@ -922,11 +932,11 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
922
932
|
dateOfBirth: !0,
|
|
923
933
|
insuranceNumber: !0,
|
|
924
934
|
...Object.fromEntries(
|
|
925
|
-
Object.values(
|
|
935
|
+
Object.values($).map((H) => [H, !0])
|
|
926
936
|
)
|
|
927
|
-
}),
|
|
928
|
-
if (!
|
|
929
|
-
|
|
937
|
+
}), Q || he.current) return;
|
|
938
|
+
if (!Be) {
|
|
939
|
+
st((H) => H + 1);
|
|
930
940
|
return;
|
|
931
941
|
}
|
|
932
942
|
const D = {
|
|
@@ -938,11 +948,11 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
938
948
|
termsConsent: !0,
|
|
939
949
|
// Only present when the service carried text to accept — a
|
|
940
950
|
// reason without it leaves the key out of the payload entirely.
|
|
941
|
-
...
|
|
951
|
+
...bt ? { criticalInformationAccepted: !0 } : {},
|
|
942
952
|
// Sent whenever the practice's box is shown, ticked or not, so the
|
|
943
953
|
// server can record the answer; left out when there is no box.
|
|
944
|
-
...
|
|
945
|
-
...
|
|
954
|
+
...rt ? { practiceConsentAccepted: Ce } : {},
|
|
955
|
+
...c ? { paymentAccepted: !0 } : {},
|
|
946
956
|
codiceFiscale: e.codiceFiscale,
|
|
947
957
|
dateOfBirth: e.dateOfBirth,
|
|
948
958
|
insuranceNumber: e.insuranceNumber,
|
|
@@ -951,49 +961,49 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
951
961
|
// Only include when the picker was visible; otherwise the single
|
|
952
962
|
// implicit channel is inferred backend-side from the practice
|
|
953
963
|
// config.
|
|
954
|
-
confirmationChannels:
|
|
955
|
-
...
|
|
956
|
-
billing:
|
|
964
|
+
confirmationChannels: Te ? j : void 0,
|
|
965
|
+
...Ae && e.billing ? {
|
|
966
|
+
billing: hi(
|
|
957
967
|
e.billing,
|
|
958
968
|
`${e.firstName.trim()} ${e.lastName.trim()}`
|
|
959
969
|
)
|
|
960
970
|
} : {}
|
|
961
971
|
};
|
|
962
|
-
|
|
972
|
+
he.current = !0, ie(!0), Pe(!1);
|
|
963
973
|
try {
|
|
964
974
|
await n(D);
|
|
965
975
|
} catch {
|
|
966
|
-
|
|
976
|
+
Pe(!0);
|
|
967
977
|
} finally {
|
|
968
|
-
|
|
978
|
+
he.current = !1, ie(!1);
|
|
969
979
|
}
|
|
970
|
-
},
|
|
971
|
-
|
|
980
|
+
}, St = /* @__PURE__ */ s(
|
|
981
|
+
Je,
|
|
972
982
|
{
|
|
973
|
-
label:
|
|
983
|
+
label: y("booking.details.codiceFiscale.label"),
|
|
974
984
|
required: !0,
|
|
975
|
-
description:
|
|
976
|
-
error:
|
|
985
|
+
description: re.state === "pending" ? y("booking.details.codiceFiscale.checking") : y("booking.details.codiceFiscale.helper"),
|
|
986
|
+
error: ee.codiceFiscale,
|
|
977
987
|
announceError: ae("codiceFiscale"),
|
|
978
988
|
children: /* @__PURE__ */ s(
|
|
979
|
-
|
|
989
|
+
Ot,
|
|
980
990
|
{
|
|
981
991
|
value: e.codiceFiscale ?? "",
|
|
982
992
|
maxLength: 16,
|
|
983
|
-
onChange: (
|
|
984
|
-
codiceFiscale:
|
|
993
|
+
onChange: (a) => V({
|
|
994
|
+
codiceFiscale: a.target.value.slice(0, 16).toUpperCase()
|
|
985
995
|
}),
|
|
986
996
|
onBlur: () => de("codiceFiscale")
|
|
987
997
|
}
|
|
988
998
|
)
|
|
989
999
|
}
|
|
990
|
-
),
|
|
991
|
-
const
|
|
992
|
-
return
|
|
993
|
-
|
|
1000
|
+
), xt = (a, D) => {
|
|
1001
|
+
const H = Et(D);
|
|
1002
|
+
return H ? /* @__PURE__ */ s(
|
|
1003
|
+
js,
|
|
994
1004
|
{
|
|
995
1005
|
ns: "ui",
|
|
996
|
-
i18nKey:
|
|
1006
|
+
i18nKey: a,
|
|
997
1007
|
components: {
|
|
998
1008
|
// The `<Trans>` runtime injects link text from the i18n
|
|
999
1009
|
// string. The anchor renders empty at static-analysis time,
|
|
@@ -1005,64 +1015,64 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1005
1015
|
/* @__PURE__ */ s(
|
|
1006
1016
|
"a",
|
|
1007
1017
|
{
|
|
1008
|
-
href:
|
|
1018
|
+
href: H,
|
|
1009
1019
|
target: "_blank",
|
|
1010
1020
|
rel: "noopener noreferrer",
|
|
1011
|
-
className:
|
|
1021
|
+
className: Wt
|
|
1012
1022
|
}
|
|
1013
1023
|
)
|
|
1014
1024
|
)
|
|
1015
1025
|
}
|
|
1016
1026
|
}
|
|
1017
|
-
) :
|
|
1027
|
+
) : y(a);
|
|
1018
1028
|
};
|
|
1019
1029
|
return /* @__PURE__ */ v(
|
|
1020
1030
|
"form",
|
|
1021
1031
|
{
|
|
1022
|
-
ref:
|
|
1023
|
-
id:
|
|
1032
|
+
ref: R,
|
|
1033
|
+
id: B,
|
|
1024
1034
|
noValidate: !0,
|
|
1025
|
-
onSubmit:
|
|
1026
|
-
onFocus: (
|
|
1027
|
-
const D =
|
|
1028
|
-
!D || !
|
|
1035
|
+
onSubmit: Tt,
|
|
1036
|
+
onFocus: (a) => {
|
|
1037
|
+
const D = ft.current;
|
|
1038
|
+
!D || !a.currentTarget.contains(a.target) || !D.contains(a.target) && D.compareDocumentPosition(a.target) & Node.DOCUMENT_POSITION_FOLLOWING && Ut();
|
|
1029
1039
|
},
|
|
1030
|
-
"aria-busy":
|
|
1040
|
+
"aria-busy": Q || void 0,
|
|
1031
1041
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1032
1042
|
children: [
|
|
1033
1043
|
w,
|
|
1034
1044
|
/* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
|
|
1035
1045
|
/* @__PURE__ */ s(
|
|
1036
|
-
|
|
1046
|
+
Je,
|
|
1037
1047
|
{
|
|
1038
|
-
label:
|
|
1048
|
+
label: y("booking.details.firstName.label"),
|
|
1039
1049
|
required: !0,
|
|
1040
|
-
error:
|
|
1050
|
+
error: ee.firstName,
|
|
1041
1051
|
announceError: ae("firstName"),
|
|
1042
1052
|
children: /* @__PURE__ */ s(
|
|
1043
|
-
|
|
1053
|
+
Ot,
|
|
1044
1054
|
{
|
|
1045
1055
|
autoComplete: "given-name",
|
|
1046
1056
|
value: e.firstName ?? "",
|
|
1047
|
-
onChange: (
|
|
1057
|
+
onChange: (a) => V({ firstName: a.target.value }),
|
|
1048
1058
|
onBlur: () => de("firstName")
|
|
1049
1059
|
}
|
|
1050
1060
|
)
|
|
1051
1061
|
}
|
|
1052
1062
|
),
|
|
1053
1063
|
/* @__PURE__ */ s(
|
|
1054
|
-
|
|
1064
|
+
Je,
|
|
1055
1065
|
{
|
|
1056
|
-
label:
|
|
1066
|
+
label: y("booking.details.lastName.label"),
|
|
1057
1067
|
required: !0,
|
|
1058
|
-
error:
|
|
1068
|
+
error: ee.lastName,
|
|
1059
1069
|
announceError: ae("lastName"),
|
|
1060
1070
|
children: /* @__PURE__ */ s(
|
|
1061
|
-
|
|
1071
|
+
Ot,
|
|
1062
1072
|
{
|
|
1063
1073
|
autoComplete: "family-name",
|
|
1064
1074
|
value: e.lastName ?? "",
|
|
1065
|
-
onChange: (
|
|
1075
|
+
onChange: (a) => V({ lastName: a.target.value }),
|
|
1066
1076
|
onBlur: () => de("lastName")
|
|
1067
1077
|
}
|
|
1068
1078
|
)
|
|
@@ -1071,58 +1081,58 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1071
1081
|
] }),
|
|
1072
1082
|
/* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
|
|
1073
1083
|
/* @__PURE__ */ s(
|
|
1074
|
-
|
|
1084
|
+
Je,
|
|
1075
1085
|
{
|
|
1076
|
-
label:
|
|
1086
|
+
label: y("booking.details.email.label"),
|
|
1077
1087
|
required: !0,
|
|
1078
|
-
error:
|
|
1088
|
+
error: ee.email,
|
|
1079
1089
|
announceError: ae("email"),
|
|
1080
1090
|
children: /* @__PURE__ */ s(
|
|
1081
|
-
|
|
1091
|
+
Ys,
|
|
1082
1092
|
{
|
|
1083
1093
|
value: e.email ?? "",
|
|
1084
|
-
onChange: (
|
|
1094
|
+
onChange: (a) => V({ email: a.target.value }),
|
|
1085
1095
|
onBlur: () => de("email")
|
|
1086
1096
|
}
|
|
1087
1097
|
)
|
|
1088
1098
|
}
|
|
1089
1099
|
),
|
|
1090
1100
|
/* @__PURE__ */ s(
|
|
1091
|
-
|
|
1101
|
+
Je,
|
|
1092
1102
|
{
|
|
1093
|
-
label:
|
|
1103
|
+
label: y("booking.details.mobilePhone.label"),
|
|
1094
1104
|
required: !0,
|
|
1095
|
-
error:
|
|
1105
|
+
error: ee.mobilePhone,
|
|
1096
1106
|
announceError: ae("mobilePhone"),
|
|
1097
1107
|
children: /* @__PURE__ */ s(
|
|
1098
|
-
|
|
1108
|
+
Zs,
|
|
1099
1109
|
{
|
|
1100
1110
|
value: e.mobilePhone ?? "",
|
|
1101
1111
|
defaultCountry: O == null ? void 0 : O.toUpperCase(),
|
|
1102
|
-
onChange: (
|
|
1103
|
-
|
|
1112
|
+
onChange: (a) => {
|
|
1113
|
+
V({ mobilePhone: a }), de("mobilePhone");
|
|
1104
1114
|
}
|
|
1105
1115
|
}
|
|
1106
1116
|
)
|
|
1107
1117
|
}
|
|
1108
1118
|
)
|
|
1109
1119
|
] }),
|
|
1110
|
-
|
|
1111
|
-
|
|
1120
|
+
ve && !Ae || i ? /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
|
|
1121
|
+
ve && !Ae ? St : null,
|
|
1112
1122
|
i ? /* @__PURE__ */ s(
|
|
1113
|
-
|
|
1123
|
+
Je,
|
|
1114
1124
|
{
|
|
1115
|
-
label:
|
|
1125
|
+
label: y("booking.details.dateOfBirth.label"),
|
|
1116
1126
|
required: !0,
|
|
1117
|
-
error:
|
|
1127
|
+
error: ee.dateOfBirth,
|
|
1118
1128
|
announceError: ae("dateOfBirth"),
|
|
1119
1129
|
children: /* @__PURE__ */ s(
|
|
1120
|
-
|
|
1130
|
+
Ws,
|
|
1121
1131
|
{
|
|
1122
1132
|
value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
|
|
1123
|
-
onChange: (
|
|
1124
|
-
|
|
1125
|
-
dateOfBirth:
|
|
1133
|
+
onChange: (a) => {
|
|
1134
|
+
V({
|
|
1135
|
+
dateOfBirth: a ? a.toISOString().slice(0, 10) : void 0
|
|
1126
1136
|
}), de("dateOfBirth");
|
|
1127
1137
|
}
|
|
1128
1138
|
}
|
|
@@ -1130,94 +1140,94 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1130
1140
|
}
|
|
1131
1141
|
) : null
|
|
1132
1142
|
] }) : null,
|
|
1133
|
-
|
|
1134
|
-
|
|
1143
|
+
Ge ? /* @__PURE__ */ s(
|
|
1144
|
+
Je,
|
|
1135
1145
|
{
|
|
1136
|
-
label:
|
|
1146
|
+
label: y("booking.details.insuranceNumber.label"),
|
|
1137
1147
|
required: !0,
|
|
1138
|
-
description:
|
|
1139
|
-
error:
|
|
1148
|
+
description: Ne.state === "pending" ? y("booking.details.insuranceNumber.checking") : void 0,
|
|
1149
|
+
error: ee.insuranceNumber,
|
|
1140
1150
|
announceError: ae("insuranceNumber"),
|
|
1141
1151
|
children: /* @__PURE__ */ s(
|
|
1142
|
-
|
|
1152
|
+
Ot,
|
|
1143
1153
|
{
|
|
1144
1154
|
value: e.insuranceNumber ?? "",
|
|
1145
|
-
onChange: (
|
|
1155
|
+
onChange: (a) => V({ insuranceNumber: a.target.value }),
|
|
1146
1156
|
onBlur: () => de("insuranceNumber")
|
|
1147
1157
|
}
|
|
1148
1158
|
)
|
|
1149
1159
|
}
|
|
1150
1160
|
) : null,
|
|
1151
|
-
|
|
1161
|
+
Ae ? /* @__PURE__ */ v(
|
|
1152
1162
|
"div",
|
|
1153
1163
|
{
|
|
1154
|
-
ref:
|
|
1164
|
+
ref: ft,
|
|
1155
1165
|
"data-component": "booking-billing",
|
|
1156
1166
|
role: "group",
|
|
1157
|
-
"aria-labelledby": `${
|
|
1158
|
-
"aria-describedby": `${
|
|
1167
|
+
"aria-labelledby": `${B}-billing-heading`,
|
|
1168
|
+
"aria-describedby": `${B}-billing-intro`,
|
|
1159
1169
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:p-[var(--spacing-sm)]",
|
|
1160
|
-
onBlur: (
|
|
1161
|
-
var
|
|
1162
|
-
const D = (
|
|
1163
|
-
(D === "street" || D === "city" || D === "postcode") && de(
|
|
1170
|
+
onBlur: (a) => {
|
|
1171
|
+
var H;
|
|
1172
|
+
const D = (H = a.target.closest("[data-address-field]")) == null ? void 0 : H.getAttribute("data-address-field");
|
|
1173
|
+
(D === "street" || D === "city" || D === "postcode") && de($[D]);
|
|
1164
1174
|
},
|
|
1165
1175
|
children: [
|
|
1166
1176
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
1167
1177
|
/* @__PURE__ */ s(
|
|
1168
1178
|
"h3",
|
|
1169
1179
|
{
|
|
1170
|
-
id: `${
|
|
1180
|
+
id: `${B}-billing-heading`,
|
|
1171
1181
|
className: "type-label ds:m-0 ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
|
|
1172
|
-
children:
|
|
1182
|
+
children: y("booking.details.billing.heading")
|
|
1173
1183
|
}
|
|
1174
1184
|
),
|
|
1175
1185
|
/* @__PURE__ */ s(
|
|
1176
1186
|
"p",
|
|
1177
1187
|
{
|
|
1178
|
-
id: `${
|
|
1188
|
+
id: `${B}-billing-intro`,
|
|
1179
1189
|
className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]",
|
|
1180
|
-
children:
|
|
1190
|
+
children: y("booking.details.billing.intro")
|
|
1181
1191
|
}
|
|
1182
1192
|
)
|
|
1183
1193
|
] }),
|
|
1184
|
-
|
|
1194
|
+
ve ? St : null,
|
|
1185
1195
|
/* @__PURE__ */ s(
|
|
1186
|
-
|
|
1196
|
+
Xs,
|
|
1187
1197
|
{
|
|
1188
|
-
value:
|
|
1189
|
-
onChange: (
|
|
1198
|
+
value: be,
|
|
1199
|
+
onChange: (a) => {
|
|
1190
1200
|
var D;
|
|
1191
1201
|
return (
|
|
1192
1202
|
// The name is set from the patient's own on submit.
|
|
1193
|
-
|
|
1194
|
-
billing:
|
|
1195
|
-
|
|
1203
|
+
V({
|
|
1204
|
+
billing: pi(
|
|
1205
|
+
a,
|
|
1196
1206
|
"",
|
|
1197
1207
|
// A second line belongs to its street: it goes when the
|
|
1198
1208
|
// patient writes another, and returns with the first.
|
|
1199
|
-
|
|
1209
|
+
a.street.trim() === ((D = oe.current) == null ? void 0 : D.street) ? oe.current.line2 : null
|
|
1200
1210
|
)
|
|
1201
1211
|
})
|
|
1202
1212
|
);
|
|
1203
1213
|
},
|
|
1204
|
-
popularCountries:
|
|
1214
|
+
popularCountries: fi,
|
|
1205
1215
|
layout: "grid",
|
|
1206
|
-
fields:
|
|
1207
|
-
required:
|
|
1216
|
+
fields: Qe ? void 0 : ["street", "city", "postcode"],
|
|
1217
|
+
required: Qe ? ["country", "street", "city", "postcode", "province"] : ["country", "street", "city", "postcode"],
|
|
1208
1218
|
errors: {
|
|
1209
|
-
country:
|
|
1210
|
-
street:
|
|
1211
|
-
city:
|
|
1212
|
-
postcode:
|
|
1213
|
-
province:
|
|
1219
|
+
country: ee[$.country],
|
|
1220
|
+
street: ee[$.street],
|
|
1221
|
+
city: ee[$.city],
|
|
1222
|
+
postcode: ee[$.postcode],
|
|
1223
|
+
province: ee[$.province]
|
|
1214
1224
|
},
|
|
1215
1225
|
announceErrors: {
|
|
1216
|
-
country: ae(
|
|
1217
|
-
street: ae(
|
|
1218
|
-
city: ae(
|
|
1219
|
-
postcode: ae(
|
|
1220
|
-
province: ae(
|
|
1226
|
+
country: ae($.country),
|
|
1227
|
+
street: ae($.street),
|
|
1228
|
+
city: ae($.city),
|
|
1229
|
+
postcode: ae($.postcode),
|
|
1230
|
+
province: ae($.province)
|
|
1221
1231
|
}
|
|
1222
1232
|
}
|
|
1223
1233
|
)
|
|
@@ -1225,45 +1235,45 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1225
1235
|
}
|
|
1226
1236
|
) : null,
|
|
1227
1237
|
f ? /* @__PURE__ */ s(
|
|
1228
|
-
|
|
1238
|
+
Je,
|
|
1229
1239
|
{
|
|
1230
|
-
label:
|
|
1231
|
-
description:
|
|
1232
|
-
max:
|
|
1240
|
+
label: y("booking.details.note.label"),
|
|
1241
|
+
description: y("booking.details.note.helper", {
|
|
1242
|
+
max: ds
|
|
1233
1243
|
}),
|
|
1234
1244
|
children: /* @__PURE__ */ s(
|
|
1235
|
-
|
|
1245
|
+
Qs,
|
|
1236
1246
|
{
|
|
1237
1247
|
value: e.note ?? "",
|
|
1238
|
-
maxLength:
|
|
1248
|
+
maxLength: ds,
|
|
1239
1249
|
rows: 3,
|
|
1240
|
-
onChange: (
|
|
1250
|
+
onChange: (a) => V({ note: a.target.value })
|
|
1241
1251
|
}
|
|
1242
1252
|
)
|
|
1243
1253
|
}
|
|
1244
1254
|
) : null,
|
|
1245
1255
|
m ? /* @__PURE__ */ s(
|
|
1246
|
-
|
|
1256
|
+
lt,
|
|
1247
1257
|
{
|
|
1248
1258
|
checked: !!e.returningPatient,
|
|
1249
|
-
onCheckedChange: (
|
|
1250
|
-
label:
|
|
1259
|
+
onCheckedChange: (a) => V({ returningPatient: a === !0 }),
|
|
1260
|
+
label: y("booking.details.returningPatient.label")
|
|
1251
1261
|
}
|
|
1252
1262
|
) : null,
|
|
1253
|
-
|
|
1263
|
+
Ke !== void 0 ? /* @__PURE__ */ v(
|
|
1254
1264
|
"div",
|
|
1255
1265
|
{
|
|
1256
1266
|
"data-component": "booking-critical-information",
|
|
1257
1267
|
role: "group",
|
|
1258
|
-
"aria-labelledby": `${
|
|
1268
|
+
"aria-labelledby": `${B}-critical-information-heading`,
|
|
1259
1269
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
|
|
1260
1270
|
children: [
|
|
1261
1271
|
/* @__PURE__ */ s(
|
|
1262
1272
|
"h3",
|
|
1263
1273
|
{
|
|
1264
|
-
id: `${
|
|
1274
|
+
id: `${B}-critical-information-heading`,
|
|
1265
1275
|
className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0",
|
|
1266
|
-
children:
|
|
1276
|
+
children: y("booking.details.criticalInformation.heading")
|
|
1267
1277
|
}
|
|
1268
1278
|
),
|
|
1269
1279
|
/* @__PURE__ */ s(
|
|
@@ -1271,30 +1281,30 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1271
1281
|
{
|
|
1272
1282
|
dir: "auto",
|
|
1273
1283
|
className: "type-body-sm ds:m-0 ds:whitespace-pre-wrap ds:break-words ds:text-[var(--foreground)]",
|
|
1274
|
-
children:
|
|
1275
|
-
(
|
|
1284
|
+
children: ci(Ke).map(
|
|
1285
|
+
(a, D) => a.kind === "link" ? /* @__PURE__ */ s(
|
|
1276
1286
|
"a",
|
|
1277
1287
|
{
|
|
1278
|
-
href:
|
|
1288
|
+
href: a.href,
|
|
1279
1289
|
target: "_blank",
|
|
1280
1290
|
rel: "noopener noreferrer",
|
|
1281
1291
|
dir: "ltr",
|
|
1282
|
-
className:
|
|
1283
|
-
children:
|
|
1292
|
+
className: Wt,
|
|
1293
|
+
children: a.text
|
|
1284
1294
|
},
|
|
1285
1295
|
D
|
|
1286
|
-
) : /* @__PURE__ */ s(
|
|
1296
|
+
) : /* @__PURE__ */ s(Ks, { children: a.text }, D)
|
|
1287
1297
|
)
|
|
1288
1298
|
}
|
|
1289
1299
|
),
|
|
1290
1300
|
/* @__PURE__ */ s(
|
|
1291
|
-
|
|
1301
|
+
lt,
|
|
1292
1302
|
{
|
|
1293
1303
|
checked: !!e.criticalInformationAccepted,
|
|
1294
|
-
onCheckedChange: (
|
|
1304
|
+
onCheckedChange: (a) => V({ criticalInformationAccepted: a === !0 }),
|
|
1295
1305
|
"aria-required": !0,
|
|
1296
|
-
label: /* @__PURE__ */ v(
|
|
1297
|
-
|
|
1306
|
+
label: /* @__PURE__ */ v(ce, { children: [
|
|
1307
|
+
y("booking.details.criticalInformation.accept"),
|
|
1298
1308
|
/* @__PURE__ */ s(
|
|
1299
1309
|
"span",
|
|
1300
1310
|
{
|
|
@@ -1309,25 +1319,25 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1309
1319
|
]
|
|
1310
1320
|
}
|
|
1311
1321
|
) : null,
|
|
1312
|
-
|
|
1322
|
+
c ? /* @__PURE__ */ v(
|
|
1313
1323
|
"div",
|
|
1314
1324
|
{
|
|
1315
1325
|
"data-component": "booking-payment-notice",
|
|
1316
1326
|
role: "group",
|
|
1317
|
-
"aria-labelledby": `${
|
|
1327
|
+
"aria-labelledby": `${B}-payment-heading`,
|
|
1318
1328
|
"data-notice-style": k,
|
|
1319
|
-
className:
|
|
1329
|
+
className: mi({
|
|
1320
1330
|
noticeStyle: k
|
|
1321
1331
|
}),
|
|
1322
1332
|
children: [
|
|
1323
1333
|
k === "highlighted" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
1324
|
-
/* @__PURE__ */ s("span", { className: "ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]", children: /* @__PURE__ */ s(
|
|
1334
|
+
/* @__PURE__ */ s("span", { className: "ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]", children: /* @__PURE__ */ s(en, { "aria-hidden": "true", className: "ds:size-5" }) }),
|
|
1325
1335
|
/* @__PURE__ */ s(
|
|
1326
1336
|
"h3",
|
|
1327
1337
|
{
|
|
1328
|
-
id: `${
|
|
1338
|
+
id: `${B}-payment-heading`,
|
|
1329
1339
|
className: "type-title-item ds:m-0 ds:flex-1",
|
|
1330
|
-
children:
|
|
1340
|
+
children: y("booking.payment.noticeTitle")
|
|
1331
1341
|
}
|
|
1332
1342
|
),
|
|
1333
1343
|
/* @__PURE__ */ s(
|
|
@@ -1335,18 +1345,18 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1335
1345
|
{
|
|
1336
1346
|
"aria-hidden": "true",
|
|
1337
1347
|
className: "type-title-card ds:shrink-0 ds:text-[var(--foreground)]",
|
|
1338
|
-
children:
|
|
1348
|
+
children: _e
|
|
1339
1349
|
}
|
|
1340
1350
|
)
|
|
1341
1351
|
] }) : /* @__PURE__ */ s(
|
|
1342
1352
|
"h3",
|
|
1343
1353
|
{
|
|
1344
|
-
id: `${
|
|
1354
|
+
id: `${B}-payment-heading`,
|
|
1345
1355
|
className: "type-label ds:m-0",
|
|
1346
|
-
children:
|
|
1356
|
+
children: y("booking.payment.noticeTitle")
|
|
1347
1357
|
}
|
|
1348
1358
|
),
|
|
1349
|
-
/* @__PURE__ */ s("p", { className: "type-body-sm ds:m-0", children:
|
|
1359
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:m-0", children: y("booking.payment.noticeBody", { amount: _e }) }),
|
|
1350
1360
|
P ? /* @__PURE__ */ s(
|
|
1351
1361
|
"a",
|
|
1352
1362
|
{
|
|
@@ -1354,21 +1364,21 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1354
1364
|
target: "_blank",
|
|
1355
1365
|
rel: "noopener noreferrer",
|
|
1356
1366
|
className: "type-body-sm ds:inline-flex ds:items-center ds:self-start ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1357
|
-
children:
|
|
1367
|
+
children: y("booking.payment.terms")
|
|
1358
1368
|
}
|
|
1359
1369
|
) : null,
|
|
1360
1370
|
/* @__PURE__ */ s(
|
|
1361
|
-
|
|
1371
|
+
lt,
|
|
1362
1372
|
{
|
|
1363
|
-
checked:
|
|
1364
|
-
onCheckedChange: (
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
),
|
|
1373
|
+
checked: wt,
|
|
1374
|
+
onCheckedChange: (a) => {
|
|
1375
|
+
nt(
|
|
1376
|
+
a === !0 ? ue : void 0
|
|
1377
|
+
), V({ paymentAccepted: a === !0 });
|
|
1368
1378
|
},
|
|
1369
1379
|
"aria-required": !0,
|
|
1370
|
-
label: /* @__PURE__ */ v(
|
|
1371
|
-
|
|
1380
|
+
label: /* @__PURE__ */ v(ce, { children: [
|
|
1381
|
+
y("booking.payment.accept", { amount: _e }),
|
|
1372
1382
|
/* @__PURE__ */ s(
|
|
1373
1383
|
"span",
|
|
1374
1384
|
{
|
|
@@ -1385,13 +1395,13 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1385
1395
|
) : null,
|
|
1386
1396
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1387
1397
|
/* @__PURE__ */ s(
|
|
1388
|
-
|
|
1398
|
+
lt,
|
|
1389
1399
|
{
|
|
1390
1400
|
checked: !!e.privacyConsent,
|
|
1391
|
-
onCheckedChange: (
|
|
1401
|
+
onCheckedChange: (a) => V({ privacyConsent: a === !0 }),
|
|
1392
1402
|
"aria-required": !0,
|
|
1393
|
-
label: /* @__PURE__ */ v(
|
|
1394
|
-
|
|
1403
|
+
label: /* @__PURE__ */ v(ce, { children: [
|
|
1404
|
+
xt(
|
|
1395
1405
|
"booking.details.consent.privacy.label",
|
|
1396
1406
|
p
|
|
1397
1407
|
),
|
|
@@ -1407,15 +1417,15 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1407
1417
|
}
|
|
1408
1418
|
),
|
|
1409
1419
|
/* @__PURE__ */ s(
|
|
1410
|
-
|
|
1420
|
+
lt,
|
|
1411
1421
|
{
|
|
1412
1422
|
checked: !!e.termsConsent,
|
|
1413
|
-
onCheckedChange: (
|
|
1423
|
+
onCheckedChange: (a) => V({ termsConsent: a === !0 }),
|
|
1414
1424
|
"aria-required": !0,
|
|
1415
|
-
label: /* @__PURE__ */ v(
|
|
1416
|
-
|
|
1425
|
+
label: /* @__PURE__ */ v(ce, { children: [
|
|
1426
|
+
xt(
|
|
1417
1427
|
"booking.details.consent.terms.label",
|
|
1418
|
-
|
|
1428
|
+
h
|
|
1419
1429
|
),
|
|
1420
1430
|
/* @__PURE__ */ s(
|
|
1421
1431
|
"span",
|
|
@@ -1428,25 +1438,25 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1428
1438
|
] })
|
|
1429
1439
|
}
|
|
1430
1440
|
),
|
|
1431
|
-
l &&
|
|
1432
|
-
|
|
1441
|
+
l && rt ? /* @__PURE__ */ s(
|
|
1442
|
+
lt,
|
|
1433
1443
|
{
|
|
1434
|
-
checked:
|
|
1435
|
-
onCheckedChange: (
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
),
|
|
1444
|
+
checked: Ce,
|
|
1445
|
+
onCheckedChange: (a) => {
|
|
1446
|
+
pe(
|
|
1447
|
+
a === !0 ? G : void 0
|
|
1448
|
+
), V({ practiceConsentAccepted: a === !0 });
|
|
1439
1449
|
},
|
|
1440
1450
|
"aria-required": l.required || void 0,
|
|
1441
|
-
label: /* @__PURE__ */ v(
|
|
1442
|
-
|
|
1451
|
+
label: /* @__PURE__ */ v(ce, { children: [
|
|
1452
|
+
Et(l.url) ? /* @__PURE__ */ s(
|
|
1443
1453
|
"a",
|
|
1444
1454
|
{
|
|
1445
1455
|
dir: "auto",
|
|
1446
|
-
href:
|
|
1456
|
+
href: Et(l.url),
|
|
1447
1457
|
target: "_blank",
|
|
1448
1458
|
rel: "noopener noreferrer",
|
|
1449
|
-
className:
|
|
1459
|
+
className: Wt,
|
|
1450
1460
|
children: l.label
|
|
1451
1461
|
}
|
|
1452
1462
|
) : /* @__PURE__ */ s("span", { dir: "auto", children: l.label }),
|
|
@@ -1462,55 +1472,73 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1462
1472
|
}
|
|
1463
1473
|
) : null
|
|
1464
1474
|
] }),
|
|
1465
|
-
|
|
1475
|
+
Te ? /* @__PURE__ */ s(
|
|
1466
1476
|
"div",
|
|
1467
1477
|
{
|
|
1468
1478
|
"data-component": "booking-confirmation-channels",
|
|
1469
|
-
"data-unanswered":
|
|
1479
|
+
"data-unanswered": at || void 0,
|
|
1470
1480
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
1471
|
-
children: /* @__PURE__ */ s(
|
|
1472
|
-
|
|
1481
|
+
children: C ? /* @__PURE__ */ s(
|
|
1482
|
+
Js,
|
|
1483
|
+
{
|
|
1484
|
+
label: y("booking.confirmation.heading"),
|
|
1485
|
+
value: j[0] ?? "",
|
|
1486
|
+
onValueChange: (a) => V({
|
|
1487
|
+
confirmationChannels: [a]
|
|
1488
|
+
}),
|
|
1489
|
+
error: at ? y("booking.confirmation.atLeastOne") : void 0,
|
|
1490
|
+
children: fe.map((a) => /* @__PURE__ */ s(
|
|
1491
|
+
Hs,
|
|
1492
|
+
{
|
|
1493
|
+
value: a,
|
|
1494
|
+
label: y(`booking.confirmation.channel.${a}`)
|
|
1495
|
+
},
|
|
1496
|
+
a
|
|
1497
|
+
))
|
|
1498
|
+
}
|
|
1499
|
+
) : /* @__PURE__ */ s(
|
|
1500
|
+
Gs,
|
|
1473
1501
|
{
|
|
1474
|
-
label:
|
|
1475
|
-
helperText:
|
|
1502
|
+
label: y("booking.confirmation.heading"),
|
|
1503
|
+
helperText: y("booking.confirmation.helper"),
|
|
1476
1504
|
value: j,
|
|
1477
|
-
onChange: (
|
|
1478
|
-
confirmationChannels:
|
|
1505
|
+
onChange: (a) => V({
|
|
1506
|
+
confirmationChannels: a
|
|
1479
1507
|
}),
|
|
1480
1508
|
orientation: "vertical",
|
|
1481
|
-
options:
|
|
1482
|
-
value:
|
|
1483
|
-
label:
|
|
1509
|
+
options: fe.map((a) => ({
|
|
1510
|
+
value: a,
|
|
1511
|
+
label: y(`booking.confirmation.channel.${a}`)
|
|
1484
1512
|
})),
|
|
1485
|
-
error:
|
|
1513
|
+
error: at ? y("booking.confirmation.atLeastOne") : void 0
|
|
1486
1514
|
}
|
|
1487
1515
|
)
|
|
1488
1516
|
}
|
|
1489
1517
|
) : null,
|
|
1490
|
-
|
|
1491
|
-
|
|
1518
|
+
U || Fe || b ? /* @__PURE__ */ s(ne, { variant: "error", children: /* @__PURE__ */ s(ne.Description, { children: U ?? y(
|
|
1519
|
+
b ? "booking.payment.unavailable" : "booking.payment.submitFailed"
|
|
1492
1520
|
) }) }) : null,
|
|
1493
1521
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1494
|
-
|
|
1522
|
+
ge ? /* @__PURE__ */ s(
|
|
1495
1523
|
"p",
|
|
1496
1524
|
{
|
|
1497
1525
|
id: He,
|
|
1498
1526
|
"data-slot": "submit-hint",
|
|
1499
1527
|
className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
|
|
1500
|
-
children:
|
|
1528
|
+
children: y("booking.details.submitHint")
|
|
1501
1529
|
}
|
|
1502
1530
|
) : null,
|
|
1503
1531
|
/* @__PURE__ */ s(
|
|
1504
|
-
|
|
1532
|
+
tt,
|
|
1505
1533
|
{
|
|
1506
1534
|
intent: "primary",
|
|
1507
1535
|
size: "md",
|
|
1508
1536
|
type: "submit",
|
|
1509
|
-
disabled:
|
|
1510
|
-
"aria-disabled": !
|
|
1511
|
-
"aria-describedby":
|
|
1512
|
-
startIcon:
|
|
1513
|
-
children:
|
|
1537
|
+
disabled: Q || b,
|
|
1538
|
+
"aria-disabled": !Be || void 0,
|
|
1539
|
+
"aria-describedby": ge ? He : void 0,
|
|
1540
|
+
startIcon: Q ? /* @__PURE__ */ s(gs, { variant: "pulse", size: "sm" }) : void 0,
|
|
1541
|
+
children: c ? y("booking.payment.submit", { amount: _e }) : y("booking.details.submit")
|
|
1514
1542
|
}
|
|
1515
1543
|
)
|
|
1516
1544
|
] })
|
|
@@ -1519,8 +1547,8 @@ const cs = 500, ai = /^[A-Z0-9]{16}$/, oi = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ds = 3
|
|
|
1519
1547
|
);
|
|
1520
1548
|
}
|
|
1521
1549
|
);
|
|
1522
|
-
|
|
1523
|
-
function
|
|
1550
|
+
ts.displayName = "BookingDetailsForm";
|
|
1551
|
+
function Ds(e) {
|
|
1524
1552
|
const t = e.payment;
|
|
1525
1553
|
if (!t) return;
|
|
1526
1554
|
const n = (t.currencyCode ?? "EUR").toUpperCase();
|
|
@@ -1532,29 +1560,29 @@ function Os(e) {
|
|
|
1532
1560
|
currencyCode: n
|
|
1533
1561
|
};
|
|
1534
1562
|
}
|
|
1535
|
-
function
|
|
1563
|
+
function bi(e) {
|
|
1536
1564
|
var i;
|
|
1537
1565
|
const t = (i = e.priceLabel) != null && i.trim() ? e.priceLabel : void 0, n = t ? { label: t } : void 0;
|
|
1538
1566
|
if (!e.payment) return { price: n };
|
|
1539
|
-
const r =
|
|
1567
|
+
const r = Ds(e);
|
|
1540
1568
|
return r ? {
|
|
1541
1569
|
price: n ?? (r.kind === "full" ? { amount: r } : void 0),
|
|
1542
1570
|
payment: r
|
|
1543
1571
|
} : { price: n, payment: "unavailable" };
|
|
1544
1572
|
}
|
|
1545
|
-
function
|
|
1573
|
+
function yi(e, t, n) {
|
|
1546
1574
|
const r = e.filter(
|
|
1547
|
-
(
|
|
1575
|
+
(o) => t.includes(o.id)
|
|
1548
1576
|
), i = (n == null ? void 0 : n.serviceId) ?? (t.length === 1 ? t[0] : void 0);
|
|
1549
1577
|
if (i) {
|
|
1550
|
-
const
|
|
1551
|
-
if (!
|
|
1552
|
-
const
|
|
1553
|
-
return { payment:
|
|
1578
|
+
const o = r.find((f) => f.id === i);
|
|
1579
|
+
if (!o) return { blocked: !0 };
|
|
1580
|
+
const d = Ds(o);
|
|
1581
|
+
return { payment: d, blocked: !!(o.payment && !d) };
|
|
1554
1582
|
}
|
|
1555
|
-
return { blocked: r.some((
|
|
1583
|
+
return { blocked: r.some((o) => !!o.payment) };
|
|
1556
1584
|
}
|
|
1557
|
-
function
|
|
1585
|
+
function Mt(e) {
|
|
1558
1586
|
return e ? JSON.stringify([
|
|
1559
1587
|
e.serviceId,
|
|
1560
1588
|
e.kind,
|
|
@@ -1562,41 +1590,41 @@ function Ft(e) {
|
|
|
1562
1590
|
e.currencyCode
|
|
1563
1591
|
]) : "";
|
|
1564
1592
|
}
|
|
1565
|
-
function
|
|
1593
|
+
function ki({
|
|
1566
1594
|
services: e,
|
|
1567
1595
|
value: t,
|
|
1568
1596
|
availableSlots: n,
|
|
1569
1597
|
onSubmit: r,
|
|
1570
1598
|
onChange: i,
|
|
1571
|
-
paymentState:
|
|
1572
|
-
submitting:
|
|
1599
|
+
paymentState: o,
|
|
1600
|
+
submitting: d,
|
|
1573
1601
|
paymentTermsUrl: f,
|
|
1574
1602
|
renderPayment: m
|
|
1575
1603
|
}) {
|
|
1576
|
-
var
|
|
1604
|
+
var st, he, Ye;
|
|
1577
1605
|
const p = JSON.stringify([
|
|
1578
1606
|
t.insuranceType,
|
|
1579
1607
|
t.specialtyId,
|
|
1580
1608
|
t.specialtyIds,
|
|
1581
|
-
|
|
1609
|
+
je(t),
|
|
1582
1610
|
t.operatorId,
|
|
1583
1611
|
t.operatorIds,
|
|
1584
1612
|
t.date,
|
|
1585
1613
|
t.slotKey
|
|
1586
|
-
]),
|
|
1614
|
+
]), h = F(
|
|
1587
1615
|
void 0
|
|
1588
|
-
),
|
|
1616
|
+
), c = (t.date ? (st = n[t.date]) == null ? void 0 : st.find((ie) => ie.key === t.slotKey) : void 0) ?? (((he = h.current) == null ? void 0 : he.selection) === p ? h.current.slot : void 0), u = yi(
|
|
1589
1617
|
e,
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
),
|
|
1618
|
+
je(t),
|
|
1619
|
+
c
|
|
1620
|
+
), b = u.blocked || !!(u.payment && !m), x = JSON.stringify([
|
|
1593
1621
|
p,
|
|
1594
|
-
|
|
1595
|
-
|
|
1622
|
+
c == null ? void 0 : c.serviceId,
|
|
1623
|
+
Mt(u.payment),
|
|
1596
1624
|
f,
|
|
1597
|
-
|
|
1598
|
-
]), k = u.payment ? JSON.stringify([
|
|
1599
|
-
|
|
1625
|
+
b
|
|
1626
|
+
]), k = u.payment ? JSON.stringify([Mt(u.payment), f]) : "", E = F(void 0), N = !!((Ye = t.details) != null && Ye.paymentAccepted);
|
|
1627
|
+
z(() => {
|
|
1600
1628
|
if (!N) E.current = void 0;
|
|
1601
1629
|
else if (k) E.current === void 0 ? E.current = k : E.current !== k && (E.current = void 0, i({
|
|
1602
1630
|
...t,
|
|
@@ -1604,93 +1632,93 @@ function vi({
|
|
|
1604
1632
|
}));
|
|
1605
1633
|
else return;
|
|
1606
1634
|
}, [N, k, i, t]);
|
|
1607
|
-
const S =
|
|
1635
|
+
const S = F(x);
|
|
1608
1636
|
S.current = x;
|
|
1609
|
-
const [I, w] =
|
|
1610
|
-
|
|
1611
|
-
|
|
1637
|
+
const [I, w] = te({ status: "idle" }), O = F(0), T = F(!1), g = F(!0), C = F(!1), U = F(void 0), q = F(x);
|
|
1638
|
+
z(() => (g.current = !0, () => {
|
|
1639
|
+
g.current = !1, O.current += 1;
|
|
1612
1640
|
}), []);
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
}, [x,
|
|
1617
|
-
const
|
|
1618
|
-
() =>
|
|
1619
|
-
[
|
|
1641
|
+
const y = I.status === "payment" || I.status === "success";
|
|
1642
|
+
z(() => {
|
|
1643
|
+
q.current === x || C.current || y || (q.current = x, O.current += 1, T.current = !1, w({ status: "idle" }));
|
|
1644
|
+
}, [x, y]);
|
|
1645
|
+
const K = y || q.current === x ? I.session : void 0, B = M(
|
|
1646
|
+
() => K && (o == null ? void 0 : o.sessionId) === K.id ? o : K ? { sessionId: K.id, status: "ready" } : void 0,
|
|
1647
|
+
[K, o]
|
|
1620
1648
|
);
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
() =>
|
|
1624
|
-
sessionId:
|
|
1649
|
+
K && B && "phase" in B && B.phase === "completion" && (U.current = K.id);
|
|
1650
|
+
const Se = M(
|
|
1651
|
+
() => K && U.current === K.id && B && B.status !== "paid" && (!("phase" in B) || B.phase !== "completion") ? {
|
|
1652
|
+
sessionId: K.id,
|
|
1625
1653
|
status: "processing",
|
|
1626
1654
|
phase: "completion"
|
|
1627
|
-
} :
|
|
1628
|
-
[
|
|
1655
|
+
} : B,
|
|
1656
|
+
[K, B]
|
|
1629
1657
|
);
|
|
1630
|
-
|
|
1631
|
-
!
|
|
1658
|
+
z(() => {
|
|
1659
|
+
!K || !Se || C.current || (Se.status === "paid" ? (C.current = !0, w((ie) => ({ ...ie, status: "success" }))) : Se.status === "cancelled" && (O.current += 1, T.current = !1, h.current = void 0, i({
|
|
1632
1660
|
...t,
|
|
1633
1661
|
details: { ...t.details, paymentAccepted: !1 }
|
|
1634
1662
|
}), w({ status: "idle", cancelled: !0 })));
|
|
1635
|
-
}, [
|
|
1636
|
-
const
|
|
1637
|
-
O.current += 1, T.current = !1, C.current = !1,
|
|
1638
|
-
},
|
|
1639
|
-
var
|
|
1640
|
-
if (!(
|
|
1641
|
-
T.current = !0,
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1645
|
-
slot: { ...
|
|
1663
|
+
}, [K, Se, i, t]);
|
|
1664
|
+
const R = () => {
|
|
1665
|
+
O.current += 1, T.current = !1, C.current = !1, U.current = void 0, h.current = void 0, q.current = S.current, w({ status: "idle" });
|
|
1666
|
+
}, xe = async (ie) => {
|
|
1667
|
+
var Ne, Me, X, Ve, de;
|
|
1668
|
+
if (!(c != null && c.available) || b || d || T.current || I.status === "payment" || C.current || u.payment && !ie.paymentAccepted) return;
|
|
1669
|
+
T.current = !0, h.current = { selection: p, slot: { ...c } };
|
|
1670
|
+
const Fe = ++O.current, Pe = x;
|
|
1671
|
+
q.current = Pe;
|
|
1672
|
+
const Q = {
|
|
1673
|
+
slot: { ...c, meta: c.meta ? { ...c.meta } : void 0 },
|
|
1646
1674
|
value: {
|
|
1647
1675
|
...t,
|
|
1648
|
-
serviceIds: (
|
|
1649
|
-
specialtyIds: (
|
|
1650
|
-
operatorIds: (
|
|
1651
|
-
operatorId:
|
|
1652
|
-
details: { ...
|
|
1676
|
+
serviceIds: (Ne = t.serviceIds) == null ? void 0 : Ne.slice(),
|
|
1677
|
+
specialtyIds: (Me = t.specialtyIds) == null ? void 0 : Me.slice(),
|
|
1678
|
+
operatorIds: (X = t.operatorIds) == null ? void 0 : X.slice(),
|
|
1679
|
+
operatorId: As(t) ?? t.operatorId,
|
|
1680
|
+
details: { ...ie }
|
|
1653
1681
|
},
|
|
1654
1682
|
details: {
|
|
1655
|
-
...
|
|
1656
|
-
confirmationChannels: (
|
|
1683
|
+
...ie,
|
|
1684
|
+
confirmationChannels: (Ve = ie.confirmationChannels) == null ? void 0 : Ve.slice()
|
|
1657
1685
|
},
|
|
1658
1686
|
...u.payment ? { payment: { ...u.payment } } : {}
|
|
1659
|
-
},
|
|
1687
|
+
}, re = () => g.current && O.current === Fe && S.current === Pe;
|
|
1660
1688
|
w({ status: "submitting" });
|
|
1661
|
-
let
|
|
1689
|
+
let Ie = !1;
|
|
1662
1690
|
try {
|
|
1663
|
-
const
|
|
1664
|
-
if (!
|
|
1665
|
-
if (
|
|
1666
|
-
const
|
|
1667
|
-
if (!((
|
|
1691
|
+
const le = await r(Q);
|
|
1692
|
+
if (!re()) return;
|
|
1693
|
+
if (Q.payment) {
|
|
1694
|
+
const we = le == null ? void 0 : le.paymentSession;
|
|
1695
|
+
if (!((de = we == null ? void 0 : we.id) != null && de.trim()) || Mt(we.payment) !== Mt(Q.payment)) {
|
|
1668
1696
|
w({ status: "error" });
|
|
1669
1697
|
return;
|
|
1670
1698
|
}
|
|
1671
|
-
|
|
1699
|
+
Ie = !0, w({
|
|
1672
1700
|
status: "payment",
|
|
1673
|
-
snapshot:
|
|
1674
|
-
session: { id:
|
|
1701
|
+
snapshot: Q,
|
|
1702
|
+
session: { id: we.id, payment: { ...we.payment } }
|
|
1675
1703
|
});
|
|
1676
|
-
} else
|
|
1704
|
+
} else le != null && le.paymentSession ? w({ status: "error" }) : (C.current = !0, w({ status: "success", snapshot: Q }));
|
|
1677
1705
|
} catch {
|
|
1678
|
-
|
|
1706
|
+
re() && w({ status: "error" });
|
|
1679
1707
|
} finally {
|
|
1680
|
-
|
|
1708
|
+
re() && !Ie && (T.current = !1);
|
|
1681
1709
|
}
|
|
1682
1710
|
};
|
|
1683
1711
|
return {
|
|
1684
1712
|
...I,
|
|
1685
1713
|
payment: u.payment,
|
|
1686
|
-
blocked:
|
|
1687
|
-
state:
|
|
1688
|
-
activeSession:
|
|
1689
|
-
submit:
|
|
1690
|
-
reset:
|
|
1714
|
+
blocked: b,
|
|
1715
|
+
state: Se,
|
|
1716
|
+
activeSession: K,
|
|
1717
|
+
submit: xe,
|
|
1718
|
+
reset: R
|
|
1691
1719
|
};
|
|
1692
1720
|
}
|
|
1693
|
-
const
|
|
1721
|
+
const Si = Nt(
|
|
1694
1722
|
"ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
|
|
1695
1723
|
{
|
|
1696
1724
|
variants: {
|
|
@@ -1718,46 +1746,46 @@ const bi = It(
|
|
|
1718
1746
|
},
|
|
1719
1747
|
defaultVariants: { variant: "inline-list", surface: "flat" }
|
|
1720
1748
|
}
|
|
1721
|
-
),
|
|
1749
|
+
), xi = [
|
|
1722
1750
|
[
|
|
1723
1751
|
/\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
|
|
1724
1752
|
as
|
|
1725
1753
|
],
|
|
1726
|
-
[/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i,
|
|
1727
|
-
[/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i,
|
|
1728
|
-
[/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i,
|
|
1729
|
-
[/\b(otorin|udito|orecchi|hearing|ear)/i,
|
|
1730
|
-
[/\b(neuro|brain|cervello)/i,
|
|
1731
|
-
[/\b(pediatr|child|bambin)/i,
|
|
1732
|
-
[/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i,
|
|
1733
|
-
[/\b(lab|analis|test|sang|esami)/i,
|
|
1734
|
-
[/\b(farmaco|pharm|pillol|refill)/i,
|
|
1735
|
-
[/\b(chirurg|surg|intervent|operat)/i,
|
|
1736
|
-
[/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i,
|
|
1754
|
+
[/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, gn],
|
|
1755
|
+
[/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, Pn],
|
|
1756
|
+
[/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, hn],
|
|
1757
|
+
[/\b(otorin|udito|orecchi|hearing|ear)/i, Dn],
|
|
1758
|
+
[/\b(neuro|brain|cervello)/i, Cn],
|
|
1759
|
+
[/\b(pediatr|child|bambin)/i, vn],
|
|
1760
|
+
[/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, Nn],
|
|
1761
|
+
[/\b(lab|analis|test|sang|esami)/i, Fn],
|
|
1762
|
+
[/\b(farmaco|pharm|pillol|refill)/i, Ln],
|
|
1763
|
+
[/\b(chirurg|surg|intervent|operat)/i, Bn],
|
|
1764
|
+
[/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, bn],
|
|
1737
1765
|
[/\b(vacc|inject|inie|punto)/i, as],
|
|
1738
|
-
[/\b(derma|skin|pelle)/i,
|
|
1739
|
-
[/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i,
|
|
1740
|
-
[/\b(general|medicin|family|control|check[-\s]?up)/i,
|
|
1766
|
+
[/\b(derma|skin|pelle)/i, yn],
|
|
1767
|
+
[/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, kn],
|
|
1768
|
+
[/\b(general|medicin|family|control|check[-\s]?up)/i, xn]
|
|
1741
1769
|
];
|
|
1742
|
-
function
|
|
1743
|
-
for (const [t, n] of
|
|
1770
|
+
function Ii(e) {
|
|
1771
|
+
for (const [t, n] of xi)
|
|
1744
1772
|
if (t.test(e)) return n;
|
|
1745
1773
|
return null;
|
|
1746
1774
|
}
|
|
1747
|
-
function
|
|
1748
|
-
const t =
|
|
1775
|
+
function Ni(e) {
|
|
1776
|
+
const t = Ii(e.label) ?? fn;
|
|
1749
1777
|
return /* @__PURE__ */ s(t, { "aria-hidden": "true", className: "ds:size-5" });
|
|
1750
1778
|
}
|
|
1751
|
-
function
|
|
1752
|
-
const { t: e, i18n: t } =
|
|
1779
|
+
function Es() {
|
|
1780
|
+
const { t: e, i18n: t } = Y("ui");
|
|
1753
1781
|
return (n) => {
|
|
1754
|
-
const r =
|
|
1782
|
+
const r = bi(n), i = (d) => Vt(d.amountCents, d.currencyCode, t.language), o = r.price ? "label" in r.price ? r.price.label : i(r.price.amount) : void 0;
|
|
1755
1783
|
return r.payment === "unavailable" ? {
|
|
1756
|
-
price:
|
|
1784
|
+
price: o,
|
|
1757
1785
|
payment: e("booking.payment.unavailable"),
|
|
1758
1786
|
paymentTone: "error"
|
|
1759
1787
|
} : {
|
|
1760
|
-
price:
|
|
1788
|
+
price: o,
|
|
1761
1789
|
payment: r.payment ? e(`booking.payment.${r.payment.kind}`, {
|
|
1762
1790
|
amount: i(r.payment)
|
|
1763
1791
|
}) : void 0,
|
|
@@ -1765,10 +1793,10 @@ function Ds() {
|
|
|
1765
1793
|
};
|
|
1766
1794
|
};
|
|
1767
1795
|
}
|
|
1768
|
-
function
|
|
1796
|
+
function et(e) {
|
|
1769
1797
|
return _t(e, "yyyy-MM-dd");
|
|
1770
1798
|
}
|
|
1771
|
-
const
|
|
1799
|
+
const wi = [
|
|
1772
1800
|
"ds:relative ds:flex ds:items-center ds:justify-center",
|
|
1773
1801
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
1774
1802
|
"ds:rounded-[var(--radius-sm)]",
|
|
@@ -1778,7 +1806,7 @@ const xi = [
|
|
|
1778
1806
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
1779
1807
|
"ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1780
1808
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
1781
|
-
].join(" "),
|
|
1809
|
+
].join(" "), Ci = Nt(wi, {
|
|
1782
1810
|
variants: {
|
|
1783
1811
|
state: {
|
|
1784
1812
|
available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
|
|
@@ -1789,29 +1817,29 @@ const xi = [
|
|
|
1789
1817
|
},
|
|
1790
1818
|
defaultVariants: { state: "unavailable" }
|
|
1791
1819
|
});
|
|
1792
|
-
function
|
|
1820
|
+
function Ai({
|
|
1793
1821
|
availableDates: e,
|
|
1794
1822
|
selectedDate: t,
|
|
1795
1823
|
onSelectDate: n,
|
|
1796
1824
|
locale: r,
|
|
1797
1825
|
loading: i
|
|
1798
1826
|
}) {
|
|
1799
|
-
const { t:
|
|
1800
|
-
const N =
|
|
1827
|
+
const { t: o } = Y("ui"), d = M(() => t ? It(ye(t)) : e.length > 0 ? It(ye(e[0])) : It(/* @__PURE__ */ new Date()), [t, e]), [f, m] = te(d), [p, h] = te(null), l = M(() => {
|
|
1828
|
+
const N = It(f), S = cn(f), I = N.getDay(), w = S.getDate(), O = [];
|
|
1801
1829
|
for (let T = I; T > 0; T -= 1) {
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1830
|
+
const g = new Date(N);
|
|
1831
|
+
g.setDate(N.getDate() - T), O.push(g);
|
|
1804
1832
|
}
|
|
1805
1833
|
for (let T = 0; T < w; T += 1) {
|
|
1806
|
-
const
|
|
1807
|
-
|
|
1834
|
+
const g = new Date(N);
|
|
1835
|
+
g.setDate(N.getDate() + T), O.push(g);
|
|
1808
1836
|
}
|
|
1809
1837
|
for (; O.length < 42; ) {
|
|
1810
|
-
const T = O[O.length - 1],
|
|
1811
|
-
|
|
1838
|
+
const T = O[O.length - 1], g = new Date(T);
|
|
1839
|
+
g.setDate(T.getDate() + 1), O.push(g);
|
|
1812
1840
|
}
|
|
1813
1841
|
return O;
|
|
1814
|
-
}, [f]),
|
|
1842
|
+
}, [f]), c = M(() => {
|
|
1815
1843
|
try {
|
|
1816
1844
|
return new Intl.DateTimeFormat(r, {
|
|
1817
1845
|
month: "long",
|
|
@@ -1820,7 +1848,7 @@ function Ni({
|
|
|
1820
1848
|
} catch {
|
|
1821
1849
|
return _t(f, "MMMM yyyy");
|
|
1822
1850
|
}
|
|
1823
|
-
}, [f, r]), u =
|
|
1851
|
+
}, [f, r]), u = M(() => {
|
|
1824
1852
|
const N = new Date(2024, 0, 7);
|
|
1825
1853
|
return Array.from({ length: 7 }, (S, I) => {
|
|
1826
1854
|
const w = new Date(N);
|
|
@@ -1831,17 +1859,17 @@ function Ni({
|
|
|
1831
1859
|
return _t(w, "EEE");
|
|
1832
1860
|
}
|
|
1833
1861
|
});
|
|
1834
|
-
}, [r]),
|
|
1835
|
-
(N) =>
|
|
1836
|
-
[
|
|
1837
|
-
), k =
|
|
1862
|
+
}, [r]), b = M(() => new Set(e), [e]), x = ke(
|
|
1863
|
+
(N) => b.has(et(N)),
|
|
1864
|
+
[b]
|
|
1865
|
+
), k = M(() => {
|
|
1838
1866
|
if (p) return p;
|
|
1839
|
-
if (t) return
|
|
1867
|
+
if (t) return ye(t);
|
|
1840
1868
|
const N = l.find(
|
|
1841
|
-
(S) =>
|
|
1869
|
+
(S) => Dt(S, f) && x(S)
|
|
1842
1870
|
);
|
|
1843
|
-
return N || (l.find((S) =>
|
|
1844
|
-
}, [p, t, l, f, x]), E =
|
|
1871
|
+
return N || (l.find((S) => Dt(S, f)) ?? null);
|
|
1872
|
+
}, [p, t, l, f, x]), E = ke(
|
|
1845
1873
|
(N, S) => {
|
|
1846
1874
|
let I = null;
|
|
1847
1875
|
switch (N.key) {
|
|
@@ -1865,13 +1893,13 @@ function Ni({
|
|
|
1865
1893
|
break;
|
|
1866
1894
|
case "Enter":
|
|
1867
1895
|
case " ": {
|
|
1868
|
-
N.preventDefault(), x(S) && n(
|
|
1896
|
+
N.preventDefault(), x(S) && n(et(S));
|
|
1869
1897
|
return;
|
|
1870
1898
|
}
|
|
1871
1899
|
default:
|
|
1872
1900
|
return;
|
|
1873
1901
|
}
|
|
1874
|
-
I && (N.preventDefault(),
|
|
1902
|
+
I && (N.preventDefault(), Dt(I, f) || m(It(I)), h(I));
|
|
1875
1903
|
},
|
|
1876
1904
|
[x, n, f]
|
|
1877
1905
|
);
|
|
@@ -1880,25 +1908,25 @@ function Ni({
|
|
|
1880
1908
|
{
|
|
1881
1909
|
role: "status",
|
|
1882
1910
|
"aria-live": "polite",
|
|
1883
|
-
"aria-label":
|
|
1911
|
+
"aria-label": o("common.loading"),
|
|
1884
1912
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1885
1913
|
children: [
|
|
1886
|
-
/* @__PURE__ */ s(
|
|
1887
|
-
/* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (N, S) => /* @__PURE__ */ s(
|
|
1914
|
+
/* @__PURE__ */ s(Bt, { variant: "text", width: "40%" }),
|
|
1915
|
+
/* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (N, S) => /* @__PURE__ */ s(Bt, { variant: "rounded", height: "2.5rem" }, `mg-skel-${S}`)) })
|
|
1888
1916
|
]
|
|
1889
1917
|
}
|
|
1890
1918
|
) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1891
1919
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
1892
1920
|
/* @__PURE__ */ s(
|
|
1893
|
-
|
|
1921
|
+
rs,
|
|
1894
1922
|
{
|
|
1895
|
-
icon: /* @__PURE__ */ s(
|
|
1896
|
-
"aria-label":
|
|
1923
|
+
icon: /* @__PURE__ */ s(ln, {}),
|
|
1924
|
+
"aria-label": o("booking.previousMonth"),
|
|
1897
1925
|
size: "sm",
|
|
1898
1926
|
intent: "ghost",
|
|
1899
1927
|
flipIconInRtl: !0,
|
|
1900
1928
|
onClick: () => {
|
|
1901
|
-
m((N) =>
|
|
1929
|
+
m((N) => Kn(N)), h(null);
|
|
1902
1930
|
}
|
|
1903
1931
|
}
|
|
1904
1932
|
),
|
|
@@ -1907,19 +1935,19 @@ function Ni({
|
|
|
1907
1935
|
{
|
|
1908
1936
|
className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
|
|
1909
1937
|
"aria-live": "polite",
|
|
1910
|
-
children:
|
|
1938
|
+
children: c
|
|
1911
1939
|
}
|
|
1912
1940
|
),
|
|
1913
1941
|
/* @__PURE__ */ s(
|
|
1914
|
-
|
|
1942
|
+
rs,
|
|
1915
1943
|
{
|
|
1916
|
-
icon: /* @__PURE__ */ s(
|
|
1917
|
-
"aria-label":
|
|
1944
|
+
icon: /* @__PURE__ */ s(un, {}),
|
|
1945
|
+
"aria-label": o("booking.nextMonth"),
|
|
1918
1946
|
size: "sm",
|
|
1919
1947
|
intent: "ghost",
|
|
1920
1948
|
flipIconInRtl: !0,
|
|
1921
1949
|
onClick: () => {
|
|
1922
|
-
m((N) =>
|
|
1950
|
+
m((N) => bs(N, 1)), h(null);
|
|
1923
1951
|
}
|
|
1924
1952
|
}
|
|
1925
1953
|
)
|
|
@@ -1928,7 +1956,7 @@ function Ni({
|
|
|
1928
1956
|
"div",
|
|
1929
1957
|
{
|
|
1930
1958
|
role: "grid",
|
|
1931
|
-
"aria-label":
|
|
1959
|
+
"aria-label": o("booking.monthGridLabel"),
|
|
1932
1960
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
1933
1961
|
children: [
|
|
1934
1962
|
/* @__PURE__ */ s(
|
|
@@ -1953,7 +1981,7 @@ function Ni({
|
|
|
1953
1981
|
role: "row",
|
|
1954
1982
|
className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
|
|
1955
1983
|
children: l.slice(S * 7, S * 7 + 7).map((I, w) => {
|
|
1956
|
-
const O = S * 7 + w, T =
|
|
1984
|
+
const O = S * 7 + w, T = Dt(I, f), g = T && x(I), C = t ? os(I, ye(t)) : !1, U = T ? C ? "selected" : g ? "available" : "unavailable" : "outside", q = k ? os(k, I) : !1, y = (() => {
|
|
1957
1985
|
try {
|
|
1958
1986
|
return new Intl.DateTimeFormat(r, {
|
|
1959
1987
|
dateStyle: "full"
|
|
@@ -1967,16 +1995,16 @@ function Ni({
|
|
|
1967
1995
|
{
|
|
1968
1996
|
type: "button",
|
|
1969
1997
|
role: "gridcell",
|
|
1970
|
-
"aria-label":
|
|
1998
|
+
"aria-label": y,
|
|
1971
1999
|
"aria-selected": C || void 0,
|
|
1972
|
-
"aria-disabled": !
|
|
1973
|
-
tabIndex:
|
|
1974
|
-
disabled: !
|
|
2000
|
+
"aria-disabled": !g || void 0,
|
|
2001
|
+
tabIndex: q ? 0 : -1,
|
|
2002
|
+
disabled: !g,
|
|
1975
2003
|
onClick: () => {
|
|
1976
|
-
|
|
2004
|
+
g && n(et(I));
|
|
1977
2005
|
},
|
|
1978
|
-
onKeyDown: (
|
|
1979
|
-
className:
|
|
2006
|
+
onKeyDown: (K) => E(K, I),
|
|
2007
|
+
className: Ci({ state: U }),
|
|
1980
2008
|
children: /* @__PURE__ */ s("span", { "aria-hidden": "true", children: I.getDate() })
|
|
1981
2009
|
},
|
|
1982
2010
|
`mg-cell-${O}`
|
|
@@ -1990,7 +2018,7 @@ function Ni({
|
|
|
1990
2018
|
)
|
|
1991
2019
|
] });
|
|
1992
2020
|
}
|
|
1993
|
-
const
|
|
2021
|
+
const Ti = Nt(
|
|
1994
2022
|
[
|
|
1995
2023
|
"ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
|
|
1996
2024
|
"ds:min-h-[var(--min-target-size)]",
|
|
@@ -2016,81 +2044,81 @@ const wi = It(
|
|
|
2016
2044
|
defaultVariants: { state: "idle" }
|
|
2017
2045
|
}
|
|
2018
2046
|
);
|
|
2019
|
-
function
|
|
2047
|
+
function Oi({
|
|
2020
2048
|
services: e,
|
|
2021
2049
|
selectedServiceId: t,
|
|
2022
2050
|
onSelect: n,
|
|
2023
2051
|
showDuration: r
|
|
2024
2052
|
}) {
|
|
2025
|
-
const { t: i } =
|
|
2053
|
+
const { t: i } = Y("ui"), o = Es(), d = Pt(), [f, m] = te(() => {
|
|
2026
2054
|
if (t) {
|
|
2027
|
-
const
|
|
2028
|
-
if (
|
|
2055
|
+
const c = e.findIndex((u) => u.id === t);
|
|
2056
|
+
if (c >= 0) return c;
|
|
2029
2057
|
}
|
|
2030
2058
|
return 0;
|
|
2031
|
-
}), p =
|
|
2059
|
+
}), p = F(/* @__PURE__ */ new Map()), h = ke((c) => {
|
|
2032
2060
|
var u;
|
|
2033
|
-
(u = p.current.get(
|
|
2034
|
-
}, []), l =
|
|
2035
|
-
(
|
|
2061
|
+
(u = p.current.get(c)) == null || u.focus();
|
|
2062
|
+
}, []), l = ke(
|
|
2063
|
+
(c, u, b) => {
|
|
2036
2064
|
const x = e.length;
|
|
2037
2065
|
if (x !== 0)
|
|
2038
|
-
switch (
|
|
2066
|
+
switch (c.key) {
|
|
2039
2067
|
case "ArrowDown":
|
|
2040
2068
|
case "ArrowRight": {
|
|
2041
|
-
|
|
2069
|
+
c.preventDefault();
|
|
2042
2070
|
const k = (u + 1) % x;
|
|
2043
|
-
m(k),
|
|
2071
|
+
m(k), h(k);
|
|
2044
2072
|
break;
|
|
2045
2073
|
}
|
|
2046
2074
|
case "ArrowUp":
|
|
2047
2075
|
case "ArrowLeft": {
|
|
2048
|
-
|
|
2076
|
+
c.preventDefault();
|
|
2049
2077
|
const k = (u - 1 + x) % x;
|
|
2050
|
-
m(k),
|
|
2078
|
+
m(k), h(k);
|
|
2051
2079
|
break;
|
|
2052
2080
|
}
|
|
2053
2081
|
case "Home": {
|
|
2054
|
-
|
|
2082
|
+
c.preventDefault(), m(0), h(0);
|
|
2055
2083
|
break;
|
|
2056
2084
|
}
|
|
2057
2085
|
case "End": {
|
|
2058
|
-
|
|
2086
|
+
c.preventDefault();
|
|
2059
2087
|
const k = x - 1;
|
|
2060
|
-
m(k),
|
|
2088
|
+
m(k), h(k);
|
|
2061
2089
|
break;
|
|
2062
2090
|
}
|
|
2063
2091
|
case "Enter":
|
|
2064
2092
|
case " ": {
|
|
2065
|
-
|
|
2093
|
+
c.preventDefault(), n(b);
|
|
2066
2094
|
break;
|
|
2067
2095
|
}
|
|
2068
2096
|
}
|
|
2069
2097
|
},
|
|
2070
|
-
[e.length,
|
|
2098
|
+
[e.length, h, n]
|
|
2071
2099
|
);
|
|
2072
2100
|
return e.length === 0 ? null : /* @__PURE__ */ s(
|
|
2073
2101
|
"div",
|
|
2074
2102
|
{
|
|
2075
2103
|
role: "radiogroup",
|
|
2076
2104
|
"aria-label": i("booking.serviceListLabel"),
|
|
2077
|
-
id:
|
|
2105
|
+
id: d,
|
|
2078
2106
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
2079
|
-
children: e.map((
|
|
2080
|
-
const
|
|
2081
|
-
label:
|
|
2107
|
+
children: e.map((c, u) => {
|
|
2108
|
+
const b = t === c.id, x = f === u, { price: k, payment: E, paymentTone: N } = o(c), S = k ? E ? i("booking.serviceCardLabelPayment", {
|
|
2109
|
+
label: c.label,
|
|
2082
2110
|
price: k,
|
|
2083
2111
|
payment: E
|
|
2084
2112
|
}) : i("booking.serviceCardLabelPrice", {
|
|
2085
|
-
label:
|
|
2113
|
+
label: c.label,
|
|
2086
2114
|
price: k
|
|
2087
2115
|
}) : E ? i("booking.serviceCardLabelPaymentNoPrice", {
|
|
2088
|
-
label:
|
|
2116
|
+
label: c.label,
|
|
2089
2117
|
payment: E
|
|
2090
2118
|
}) : r ? i("booking.serviceCardLabel", {
|
|
2091
|
-
label:
|
|
2092
|
-
duration:
|
|
2093
|
-
}) :
|
|
2119
|
+
label: c.label,
|
|
2120
|
+
duration: c.durationMin
|
|
2121
|
+
}) : c.label, I = Ni(c);
|
|
2094
2122
|
return /* @__PURE__ */ v(
|
|
2095
2123
|
"button",
|
|
2096
2124
|
{
|
|
@@ -2099,14 +2127,14 @@ function Ci({
|
|
|
2099
2127
|
},
|
|
2100
2128
|
type: "button",
|
|
2101
2129
|
role: "radio",
|
|
2102
|
-
"aria-checked":
|
|
2130
|
+
"aria-checked": b,
|
|
2103
2131
|
"aria-label": S,
|
|
2104
2132
|
tabIndex: x ? 0 : -1,
|
|
2105
|
-
onClick: () => n(
|
|
2133
|
+
onClick: () => n(c.id),
|
|
2106
2134
|
onFocus: () => m(u),
|
|
2107
|
-
onKeyDown: (w) => l(w, u,
|
|
2108
|
-
className:
|
|
2109
|
-
state:
|
|
2135
|
+
onKeyDown: (w) => l(w, u, c.id),
|
|
2136
|
+
className: Ti({
|
|
2137
|
+
state: b ? "selected" : "idle"
|
|
2110
2138
|
}),
|
|
2111
2139
|
children: [
|
|
2112
2140
|
/* @__PURE__ */ s(
|
|
@@ -2123,17 +2151,17 @@ function Ci({
|
|
|
2123
2151
|
{
|
|
2124
2152
|
dir: "auto",
|
|
2125
2153
|
className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:break-words",
|
|
2126
|
-
children:
|
|
2154
|
+
children: c.label
|
|
2127
2155
|
}
|
|
2128
2156
|
),
|
|
2129
2157
|
E ? /* @__PURE__ */ s(
|
|
2130
2158
|
"span",
|
|
2131
2159
|
{
|
|
2132
|
-
className:
|
|
2160
|
+
className: tn({ tone: N }),
|
|
2133
2161
|
children: E
|
|
2134
2162
|
}
|
|
2135
2163
|
) : k || !r ? null : /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", {
|
|
2136
|
-
minutes:
|
|
2164
|
+
minutes: c.durationMin
|
|
2137
2165
|
}) })
|
|
2138
2166
|
] }),
|
|
2139
2167
|
k ? /* @__PURE__ */ s(
|
|
@@ -2141,18 +2169,18 @@ function Ci({
|
|
|
2141
2169
|
{
|
|
2142
2170
|
"aria-hidden": "true",
|
|
2143
2171
|
className: "ds:inline-flex ds:shrink-0 ds:items-center ds:ms-auto",
|
|
2144
|
-
children: /* @__PURE__ */ s(
|
|
2172
|
+
children: /* @__PURE__ */ s(hs, { variant: "accentSoft", size: "lg", children: k })
|
|
2145
2173
|
}
|
|
2146
2174
|
) : null
|
|
2147
2175
|
]
|
|
2148
2176
|
},
|
|
2149
|
-
|
|
2177
|
+
c.id
|
|
2150
2178
|
);
|
|
2151
2179
|
})
|
|
2152
2180
|
}
|
|
2153
2181
|
);
|
|
2154
2182
|
}
|
|
2155
|
-
const
|
|
2183
|
+
const Di = Nt(
|
|
2156
2184
|
[
|
|
2157
2185
|
"ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
|
|
2158
2186
|
"ds:min-h-[var(--min-target-size)]",
|
|
@@ -2178,58 +2206,58 @@ const Ai = It(
|
|
|
2178
2206
|
defaultVariants: { state: "idle" }
|
|
2179
2207
|
}
|
|
2180
2208
|
);
|
|
2181
|
-
function
|
|
2209
|
+
function Ei(e) {
|
|
2182
2210
|
const [t] = e.split(":").map((r) => parseInt(r, 10)), n = Number.isFinite(t) ? t : 0;
|
|
2183
2211
|
return n < 12 ? "morning" : n < 17 ? "afternoon" : "evening";
|
|
2184
2212
|
}
|
|
2185
|
-
const
|
|
2186
|
-
morning:
|
|
2187
|
-
afternoon:
|
|
2188
|
-
evening:
|
|
2213
|
+
const Fi = {
|
|
2214
|
+
morning: mn,
|
|
2215
|
+
afternoon: $n,
|
|
2216
|
+
evening: pn
|
|
2189
2217
|
};
|
|
2190
|
-
function
|
|
2218
|
+
function Mi({
|
|
2191
2219
|
date: e,
|
|
2192
2220
|
slots: t,
|
|
2193
2221
|
selectedSlotKey: n,
|
|
2194
2222
|
onSelect: r,
|
|
2195
2223
|
loading: i,
|
|
2196
|
-
locale:
|
|
2224
|
+
locale: o
|
|
2197
2225
|
}) {
|
|
2198
|
-
const { t:
|
|
2226
|
+
const { t: d } = Y("ui"), f = M(() => {
|
|
2199
2227
|
try {
|
|
2200
|
-
return new Intl.DateTimeFormat(
|
|
2228
|
+
return new Intl.DateTimeFormat(o, {
|
|
2201
2229
|
weekday: "long",
|
|
2202
2230
|
day: "numeric",
|
|
2203
2231
|
month: "long"
|
|
2204
|
-
}).format(
|
|
2232
|
+
}).format(ye(e));
|
|
2205
2233
|
} catch {
|
|
2206
2234
|
return e;
|
|
2207
2235
|
}
|
|
2208
|
-
}, [e,
|
|
2236
|
+
}, [e, o]), m = M(() => {
|
|
2209
2237
|
const l = {
|
|
2210
2238
|
morning: [],
|
|
2211
2239
|
afternoon: [],
|
|
2212
2240
|
evening: []
|
|
2213
2241
|
};
|
|
2214
|
-
for (const
|
|
2215
|
-
l[
|
|
2242
|
+
for (const c of t)
|
|
2243
|
+
l[Ei(c.time)].push(c);
|
|
2216
2244
|
return l;
|
|
2217
|
-
}, [t]), p = t.filter((l) => l.available).length,
|
|
2245
|
+
}, [t]), p = t.filter((l) => l.available).length, h = ["morning", "afternoon", "evening"];
|
|
2218
2246
|
return i ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2219
|
-
/* @__PURE__ */ s(
|
|
2247
|
+
/* @__PURE__ */ s(Bt, { variant: "text", width: "60%" }),
|
|
2220
2248
|
[0, 1].map((l) => /* @__PURE__ */ s(
|
|
2221
2249
|
"div",
|
|
2222
2250
|
{
|
|
2223
2251
|
className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
|
|
2224
|
-
children: [0, 1, 2].map((
|
|
2252
|
+
children: [0, 1, 2].map((c) => /* @__PURE__ */ s(Bt, { variant: "rounded", height: "44px" }, c))
|
|
2225
2253
|
},
|
|
2226
2254
|
l
|
|
2227
2255
|
))
|
|
2228
|
-
] }) : p === 0 ? /* @__PURE__ */ s(
|
|
2256
|
+
] }) : p === 0 ? /* @__PURE__ */ s(vs, { variant: "no-results", title: d("booking.noSlotsForDate") }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2229
2257
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
2230
2258
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
2231
2259
|
/* @__PURE__ */ s(
|
|
2232
|
-
|
|
2260
|
+
Tn,
|
|
2233
2261
|
{
|
|
2234
2262
|
"aria-hidden": "true",
|
|
2235
2263
|
className: "ds:size-4 ds:text-[color:var(--accent)]"
|
|
@@ -2237,12 +2265,12 @@ function Di({
|
|
|
2237
2265
|
),
|
|
2238
2266
|
/* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: f })
|
|
2239
2267
|
] }),
|
|
2240
|
-
/* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children:
|
|
2268
|
+
/* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: d("booking.slotsAvailable", { count: p }) })
|
|
2241
2269
|
] }),
|
|
2242
|
-
|
|
2243
|
-
const
|
|
2244
|
-
if (
|
|
2245
|
-
const u =
|
|
2270
|
+
h.map((l) => {
|
|
2271
|
+
const c = m[l];
|
|
2272
|
+
if (c.length === 0) return null;
|
|
2273
|
+
const u = Fi[l];
|
|
2246
2274
|
return /* @__PURE__ */ v(
|
|
2247
2275
|
"div",
|
|
2248
2276
|
{
|
|
@@ -2250,31 +2278,31 @@ function Di({
|
|
|
2250
2278
|
children: [
|
|
2251
2279
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
|
|
2252
2280
|
/* @__PURE__ */ s(u, { "aria-hidden": "true", className: "ds:size-3.5" }),
|
|
2253
|
-
/* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children:
|
|
2281
|
+
/* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: d(`booking.timeOfDay.${l}`) })
|
|
2254
2282
|
] }),
|
|
2255
2283
|
/* @__PURE__ */ s(
|
|
2256
2284
|
"div",
|
|
2257
2285
|
{
|
|
2258
2286
|
role: "group",
|
|
2259
|
-
"aria-label":
|
|
2287
|
+
"aria-label": d(`booking.timeOfDay.${l}`),
|
|
2260
2288
|
className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
|
|
2261
|
-
children:
|
|
2262
|
-
const x =
|
|
2289
|
+
children: c.map((b) => {
|
|
2290
|
+
const x = b.key === n, k = b.available ? x ? "selected" : "idle" : "unavailable";
|
|
2263
2291
|
return /* @__PURE__ */ s(
|
|
2264
2292
|
"button",
|
|
2265
2293
|
{
|
|
2266
2294
|
type: "button",
|
|
2267
|
-
"data-slot-id":
|
|
2268
|
-
disabled: !
|
|
2295
|
+
"data-slot-id": b.key,
|
|
2296
|
+
disabled: !b.available,
|
|
2269
2297
|
"aria-pressed": x,
|
|
2270
|
-
"aria-label":
|
|
2271
|
-
time:
|
|
2298
|
+
"aria-label": d("booking.slotAvailableLabel", {
|
|
2299
|
+
time: b.time
|
|
2272
2300
|
}),
|
|
2273
|
-
onClick: () =>
|
|
2274
|
-
className:
|
|
2275
|
-
children:
|
|
2301
|
+
onClick: () => b.available && r(b),
|
|
2302
|
+
className: Di({ state: k }),
|
|
2303
|
+
children: b.time
|
|
2276
2304
|
},
|
|
2277
|
-
|
|
2305
|
+
b.key
|
|
2278
2306
|
);
|
|
2279
2307
|
})
|
|
2280
2308
|
}
|
|
@@ -2286,83 +2314,83 @@ function Di({
|
|
|
2286
2314
|
})
|
|
2287
2315
|
] });
|
|
2288
2316
|
}
|
|
2289
|
-
const
|
|
2290
|
-
function
|
|
2317
|
+
const Lt = 4;
|
|
2318
|
+
function Li({
|
|
2291
2319
|
availableDates: e,
|
|
2292
2320
|
availableSlots: t,
|
|
2293
2321
|
value: n,
|
|
2294
2322
|
onChange: r,
|
|
2295
2323
|
onDateSelect: i,
|
|
2296
|
-
onWindowChange:
|
|
2297
|
-
loadingDates:
|
|
2324
|
+
onWindowChange: o,
|
|
2325
|
+
loadingDates: d,
|
|
2298
2326
|
loadingSlots: f,
|
|
2299
2327
|
locale: m,
|
|
2300
2328
|
agentIdBase: p
|
|
2301
2329
|
}) {
|
|
2302
|
-
const
|
|
2330
|
+
const h = M(() => ut(/* @__PURE__ */ new Date()), []), [l, c] = te(() => {
|
|
2303
2331
|
if (n.date) {
|
|
2304
|
-
const
|
|
2305
|
-
if (!
|
|
2332
|
+
const g = ut(ye(n.date));
|
|
2333
|
+
if (!pt(h, g)) return g;
|
|
2306
2334
|
}
|
|
2307
2335
|
if (e.length > 0) {
|
|
2308
|
-
const
|
|
2309
|
-
if (
|
|
2336
|
+
const g = ut(ye(e[0]));
|
|
2337
|
+
if (pt(g, h)) return g;
|
|
2310
2338
|
}
|
|
2311
|
-
return
|
|
2312
|
-
}), u =
|
|
2313
|
-
() =>
|
|
2339
|
+
return h;
|
|
2340
|
+
}), u = M(
|
|
2341
|
+
() => Jt(l, Lt - 1),
|
|
2314
2342
|
[l]
|
|
2315
|
-
),
|
|
2316
|
-
const
|
|
2317
|
-
id:
|
|
2343
|
+
), b = M(() => Array.from({ length: Lt }, (g, C) => {
|
|
2344
|
+
const U = Jt(l, C), q = et(U), K = (t[q] ?? []).map((B) => ({
|
|
2345
|
+
id: B.key,
|
|
2318
2346
|
// SlotGrid formats `start` as a time via Intl.DateTimeFormat —
|
|
2319
2347
|
// compose a full ISO from the column's date + the slot's HH:mm
|
|
2320
2348
|
// so the locale-formatter has a real timestamp to work with.
|
|
2321
|
-
start: `${
|
|
2322
|
-
available:
|
|
2349
|
+
start: `${q}T${B.time}:00`,
|
|
2350
|
+
available: B.available
|
|
2323
2351
|
}));
|
|
2324
|
-
return { date:
|
|
2325
|
-
}), [l, t]), x =
|
|
2326
|
-
|
|
2327
|
-
const C =
|
|
2328
|
-
return
|
|
2352
|
+
return { date: q, slots: K };
|
|
2353
|
+
}), [l, t]), x = pt(l, h), k = !0, E = ke(() => {
|
|
2354
|
+
c((g) => {
|
|
2355
|
+
const C = dn(g, Lt);
|
|
2356
|
+
return pt(h, C) ? h : C;
|
|
2329
2357
|
});
|
|
2330
|
-
}, [
|
|
2331
|
-
|
|
2358
|
+
}, [h]), N = ke(() => {
|
|
2359
|
+
c((g) => Jt(g, Lt));
|
|
2332
2360
|
}, []);
|
|
2333
|
-
|
|
2361
|
+
z(() => {
|
|
2334
2362
|
if (e.length === 0) return;
|
|
2335
|
-
const
|
|
2336
|
-
!
|
|
2337
|
-
const
|
|
2338
|
-
return !
|
|
2339
|
-
}) ||
|
|
2340
|
-
}, [e]),
|
|
2341
|
-
|
|
2342
|
-
}, [l, u,
|
|
2343
|
-
const S =
|
|
2344
|
-
(
|
|
2345
|
-
const
|
|
2363
|
+
const g = ut(ye(e[0]));
|
|
2364
|
+
!pt(g, h) || e.some((U) => {
|
|
2365
|
+
const q = ut(ye(U));
|
|
2366
|
+
return !pt(q, u) && !an(q, l);
|
|
2367
|
+
}) || c(g);
|
|
2368
|
+
}, [e]), z(() => {
|
|
2369
|
+
o == null || o(et(l), et(u));
|
|
2370
|
+
}, [l, u, o]);
|
|
2371
|
+
const S = ke(
|
|
2372
|
+
(g, C) => {
|
|
2373
|
+
const U = typeof C.date == "string" ? C.date : et(C.date);
|
|
2346
2374
|
r({
|
|
2347
|
-
...
|
|
2348
|
-
}), i == null || i(
|
|
2375
|
+
...Cs(qt(n, U), g.id)
|
|
2376
|
+
}), i == null || i(U);
|
|
2349
2377
|
},
|
|
2350
2378
|
[r, i, n]
|
|
2351
|
-
), I =
|
|
2379
|
+
), I = d || f ? "loading" : "default", w = b.some((g) => g.slots.length > 0), O = e[0];
|
|
2352
2380
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2353
2381
|
!w && !!O ? /* @__PURE__ */ s(
|
|
2354
|
-
|
|
2382
|
+
ss,
|
|
2355
2383
|
{
|
|
2356
2384
|
nextAvailableDate: O,
|
|
2357
|
-
onJump: () =>
|
|
2385
|
+
onJump: () => c(ut(ye(O))),
|
|
2358
2386
|
locale: m
|
|
2359
2387
|
}
|
|
2360
2388
|
) : null,
|
|
2361
2389
|
/* @__PURE__ */ s(
|
|
2362
|
-
|
|
2390
|
+
rn,
|
|
2363
2391
|
{
|
|
2364
2392
|
id: p ? `${p}-slots` : void 0,
|
|
2365
|
-
days:
|
|
2393
|
+
days: b,
|
|
2366
2394
|
state: I,
|
|
2367
2395
|
selectedSlotId: n.slotKey,
|
|
2368
2396
|
maxInitialSlotsPerDay: 6,
|
|
@@ -2376,69 +2404,69 @@ function Ei({
|
|
|
2376
2404
|
)
|
|
2377
2405
|
] });
|
|
2378
2406
|
}
|
|
2379
|
-
function
|
|
2407
|
+
function Fs(e) {
|
|
2380
2408
|
const {
|
|
2381
2409
|
inputs: t,
|
|
2382
2410
|
value: n,
|
|
2383
2411
|
onChange: r,
|
|
2384
2412
|
onDateSelect: i,
|
|
2385
|
-
onWindowChange:
|
|
2386
|
-
loadingDates:
|
|
2413
|
+
onWindowChange: o,
|
|
2414
|
+
loadingDates: d,
|
|
2387
2415
|
loadingSlots: f,
|
|
2388
2416
|
locale: m,
|
|
2389
2417
|
datePickerStyle: p,
|
|
2390
|
-
agentIdBase:
|
|
2418
|
+
agentIdBase: h
|
|
2391
2419
|
} = e;
|
|
2392
2420
|
return p === "four-day-grid" ? /* @__PURE__ */ s(
|
|
2393
|
-
|
|
2421
|
+
Li,
|
|
2394
2422
|
{
|
|
2395
2423
|
availableDates: t.availableDates,
|
|
2396
2424
|
availableSlots: t.availableSlots,
|
|
2397
2425
|
value: n,
|
|
2398
2426
|
onChange: r,
|
|
2399
2427
|
onDateSelect: i,
|
|
2400
|
-
onWindowChange:
|
|
2401
|
-
loadingDates:
|
|
2428
|
+
onWindowChange: o,
|
|
2429
|
+
loadingDates: d,
|
|
2402
2430
|
loadingSlots: f,
|
|
2403
2431
|
locale: m,
|
|
2404
|
-
agentIdBase:
|
|
2432
|
+
agentIdBase: h
|
|
2405
2433
|
}
|
|
2406
2434
|
) : /* @__PURE__ */ s(
|
|
2407
|
-
|
|
2435
|
+
Ai,
|
|
2408
2436
|
{
|
|
2409
2437
|
availableDates: t.availableDates,
|
|
2410
2438
|
selectedDate: n.date,
|
|
2411
2439
|
onSelectDate: (l) => {
|
|
2412
|
-
r(
|
|
2440
|
+
r(qt(n, l)), i == null || i(l);
|
|
2413
2441
|
},
|
|
2414
2442
|
locale: m,
|
|
2415
|
-
loading:
|
|
2443
|
+
loading: d ?? f
|
|
2416
2444
|
}
|
|
2417
2445
|
);
|
|
2418
2446
|
}
|
|
2419
|
-
function
|
|
2420
|
-
const { inputs: t, value: n, onChange: r, loadingSlots: i, locale:
|
|
2421
|
-
return
|
|
2422
|
-
|
|
2447
|
+
function Ms(e) {
|
|
2448
|
+
const { inputs: t, value: n, onChange: r, loadingSlots: i, locale: o, datePickerStyle: d } = e;
|
|
2449
|
+
return d === "four-day-grid" || !n.date ? null : /* @__PURE__ */ s(
|
|
2450
|
+
Mi,
|
|
2423
2451
|
{
|
|
2424
2452
|
date: n.date,
|
|
2425
2453
|
slots: t.availableSlots[n.date] ?? [],
|
|
2426
2454
|
selectedSlotKey: n.slotKey,
|
|
2427
|
-
onSelect: (f) => r(
|
|
2455
|
+
onSelect: (f) => r(Cs(n, f.key)),
|
|
2428
2456
|
loading: i,
|
|
2429
|
-
locale:
|
|
2457
|
+
locale: o
|
|
2430
2458
|
}
|
|
2431
2459
|
);
|
|
2432
2460
|
}
|
|
2433
|
-
function
|
|
2434
|
-
const { t: n } =
|
|
2461
|
+
function Ls({ value: e, onChange: t }) {
|
|
2462
|
+
const { t: n } = Y("ui"), r = [
|
|
2435
2463
|
{ value: "private", label: n("booking.insurance.private") },
|
|
2436
2464
|
{ value: "public", label: n("booking.insurance.public") }
|
|
2437
2465
|
];
|
|
2438
2466
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2439
2467
|
/* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.insurance.heading") }),
|
|
2440
2468
|
/* @__PURE__ */ s(
|
|
2441
|
-
|
|
2469
|
+
$t,
|
|
2442
2470
|
{
|
|
2443
2471
|
options: r,
|
|
2444
2472
|
value: e ?? "",
|
|
@@ -2457,83 +2485,83 @@ function _s({
|
|
|
2457
2485
|
valueIds: n,
|
|
2458
2486
|
onChange: r,
|
|
2459
2487
|
onChangeIds: i,
|
|
2460
|
-
pickerStyle:
|
|
2488
|
+
pickerStyle: o = "select"
|
|
2461
2489
|
}) {
|
|
2462
|
-
const { t:
|
|
2490
|
+
const { t: d } = Y("ui"), f = e.map((p) => ({
|
|
2463
2491
|
value: p.id,
|
|
2464
2492
|
label: p.label,
|
|
2465
2493
|
dir: "auto"
|
|
2466
|
-
})), m = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children:
|
|
2467
|
-
return
|
|
2494
|
+
})), m = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: d("booking.specialty.heading") });
|
|
2495
|
+
return o === "multi-select" && i ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2468
2496
|
m,
|
|
2469
2497
|
/* @__PURE__ */ s(
|
|
2470
|
-
|
|
2498
|
+
es,
|
|
2471
2499
|
{
|
|
2472
2500
|
options: f,
|
|
2473
2501
|
value: n ?? [],
|
|
2474
2502
|
onChange: i,
|
|
2475
|
-
placeholder:
|
|
2476
|
-
"aria-label":
|
|
2503
|
+
placeholder: d("booking.specialty.placeholder"),
|
|
2504
|
+
"aria-label": d("booking.specialty.heading"),
|
|
2477
2505
|
allowClear: !0
|
|
2478
2506
|
}
|
|
2479
2507
|
)
|
|
2480
|
-
] }) :
|
|
2508
|
+
] }) : o === "combobox" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2481
2509
|
m,
|
|
2482
2510
|
/* @__PURE__ */ s(
|
|
2483
|
-
|
|
2511
|
+
Xt,
|
|
2484
2512
|
{
|
|
2485
2513
|
options: f,
|
|
2486
2514
|
value: t ?? "",
|
|
2487
2515
|
onValueChange: (p) => r(p === "" ? "" : p),
|
|
2488
|
-
placeholder:
|
|
2489
|
-
"aria-label":
|
|
2516
|
+
placeholder: d("booking.specialty.placeholder"),
|
|
2517
|
+
"aria-label": d("booking.specialty.heading"),
|
|
2490
2518
|
clearable: !0
|
|
2491
2519
|
}
|
|
2492
2520
|
)
|
|
2493
2521
|
] }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2494
2522
|
m,
|
|
2495
2523
|
/* @__PURE__ */ s(
|
|
2496
|
-
|
|
2524
|
+
$t,
|
|
2497
2525
|
{
|
|
2498
2526
|
options: f,
|
|
2499
2527
|
value: t ?? "",
|
|
2500
2528
|
onValueChange: (p) => r(p),
|
|
2501
|
-
placeholder:
|
|
2502
|
-
"aria-label":
|
|
2529
|
+
placeholder: d("booking.specialty.placeholder"),
|
|
2530
|
+
"aria-label": d("booking.specialty.heading")
|
|
2503
2531
|
}
|
|
2504
2532
|
)
|
|
2505
2533
|
] });
|
|
2506
2534
|
}
|
|
2507
|
-
function
|
|
2535
|
+
function Bs({
|
|
2508
2536
|
services: e,
|
|
2509
2537
|
value: t,
|
|
2510
2538
|
valueIds: n,
|
|
2511
2539
|
onChange: r,
|
|
2512
2540
|
onChangeIds: i,
|
|
2513
|
-
pickerStyle:
|
|
2514
|
-
compact:
|
|
2541
|
+
pickerStyle: o,
|
|
2542
|
+
compact: d,
|
|
2515
2543
|
showDuration: f
|
|
2516
2544
|
}) {
|
|
2517
|
-
const { t: m } =
|
|
2518
|
-
const { price:
|
|
2545
|
+
const { t: m } = Y("ui"), p = Es(), h = o ?? (d ? "select" : "cards"), l = e.map((u) => {
|
|
2546
|
+
const { price: b, payment: x, paymentTone: k } = p(u);
|
|
2519
2547
|
return {
|
|
2520
2548
|
value: u.id,
|
|
2521
2549
|
// The practice's service name leads the label, so it decides the
|
|
2522
2550
|
// direction, even when the kit's duration is appended after it.
|
|
2523
2551
|
dir: "auto",
|
|
2524
|
-
label:
|
|
2552
|
+
label: b || x || !f ? u.label : `${u.label} · ${m("booking.serviceSummary", {
|
|
2525
2553
|
minutes: u.durationMin
|
|
2526
2554
|
})}`,
|
|
2527
|
-
...
|
|
2528
|
-
endContent: /* @__PURE__ */ s(
|
|
2555
|
+
...b ? {
|
|
2556
|
+
endContent: /* @__PURE__ */ s(hs, { variant: "accentSoft", size: "lg", children: b })
|
|
2529
2557
|
} : {},
|
|
2530
2558
|
...x ? { description: x, descriptionTone: k } : {}
|
|
2531
2559
|
};
|
|
2532
|
-
}),
|
|
2533
|
-
return
|
|
2534
|
-
|
|
2560
|
+
}), c = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m("booking.service.heading") });
|
|
2561
|
+
return h === "multi-select" && i ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2562
|
+
c,
|
|
2535
2563
|
/* @__PURE__ */ s(
|
|
2536
|
-
|
|
2564
|
+
es,
|
|
2537
2565
|
{
|
|
2538
2566
|
options: l,
|
|
2539
2567
|
value: n ?? [],
|
|
@@ -2544,10 +2572,10 @@ function Ls({
|
|
|
2544
2572
|
wrapOptionLabels: !0
|
|
2545
2573
|
}
|
|
2546
2574
|
)
|
|
2547
|
-
] }) :
|
|
2548
|
-
|
|
2575
|
+
] }) : h === "combobox" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2576
|
+
c,
|
|
2549
2577
|
/* @__PURE__ */ s(
|
|
2550
|
-
|
|
2578
|
+
Xt,
|
|
2551
2579
|
{
|
|
2552
2580
|
options: l,
|
|
2553
2581
|
value: t ?? "",
|
|
@@ -2558,10 +2586,10 @@ function Ls({
|
|
|
2558
2586
|
wrapOptionLabels: !0
|
|
2559
2587
|
}
|
|
2560
2588
|
)
|
|
2561
|
-
] }) :
|
|
2562
|
-
|
|
2589
|
+
] }) : h === "select" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2590
|
+
c,
|
|
2563
2591
|
/* @__PURE__ */ s(
|
|
2564
|
-
|
|
2592
|
+
$t,
|
|
2565
2593
|
{
|
|
2566
2594
|
options: l,
|
|
2567
2595
|
value: t ?? "",
|
|
@@ -2574,9 +2602,9 @@ function Ls({
|
|
|
2574
2602
|
}
|
|
2575
2603
|
)
|
|
2576
2604
|
] }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2577
|
-
|
|
2605
|
+
c,
|
|
2578
2606
|
/* @__PURE__ */ s(
|
|
2579
|
-
|
|
2607
|
+
Oi,
|
|
2580
2608
|
{
|
|
2581
2609
|
services: e,
|
|
2582
2610
|
selectedServiceId: t,
|
|
@@ -2586,178 +2614,178 @@ function Ls({
|
|
|
2586
2614
|
)
|
|
2587
2615
|
] });
|
|
2588
2616
|
}
|
|
2589
|
-
function
|
|
2617
|
+
function Rs({
|
|
2590
2618
|
operators: e,
|
|
2591
2619
|
value: t,
|
|
2592
2620
|
valueIds: n,
|
|
2593
2621
|
onChange: r,
|
|
2594
2622
|
onChangeIds: i,
|
|
2595
|
-
pickerStyle:
|
|
2623
|
+
pickerStyle: o = "select"
|
|
2596
2624
|
}) {
|
|
2597
|
-
const { t:
|
|
2598
|
-
if (
|
|
2599
|
-
const p = e.map((
|
|
2600
|
-
value:
|
|
2601
|
-
label:
|
|
2625
|
+
const { t: d } = Y("ui"), f = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: d("booking.operator.heading") });
|
|
2626
|
+
if (o === "multi-select" && i) {
|
|
2627
|
+
const p = e.map((h) => ({
|
|
2628
|
+
value: h.id,
|
|
2629
|
+
label: h.name,
|
|
2602
2630
|
dir: "auto"
|
|
2603
2631
|
}));
|
|
2604
2632
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2605
2633
|
f,
|
|
2606
2634
|
/* @__PURE__ */ s(
|
|
2607
|
-
|
|
2635
|
+
es,
|
|
2608
2636
|
{
|
|
2609
2637
|
options: p,
|
|
2610
2638
|
value: n ?? [],
|
|
2611
2639
|
onChange: i,
|
|
2612
|
-
placeholder:
|
|
2613
|
-
"aria-label":
|
|
2640
|
+
placeholder: d("booking.operator.placeholder"),
|
|
2641
|
+
"aria-label": d("booking.operator.heading"),
|
|
2614
2642
|
allowClear: !0
|
|
2615
2643
|
}
|
|
2616
2644
|
)
|
|
2617
2645
|
] });
|
|
2618
2646
|
}
|
|
2619
2647
|
const m = [
|
|
2620
|
-
{ value:
|
|
2648
|
+
{ value: Re, label: d("booking.operator.all") },
|
|
2621
2649
|
...e.map(
|
|
2622
2650
|
(p) => ({ value: p.id, label: p.name, dir: "auto" })
|
|
2623
2651
|
)
|
|
2624
2652
|
];
|
|
2625
|
-
return
|
|
2653
|
+
return o === "combobox" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2626
2654
|
f,
|
|
2627
2655
|
/* @__PURE__ */ s(
|
|
2628
|
-
|
|
2656
|
+
Xt,
|
|
2629
2657
|
{
|
|
2630
2658
|
options: m,
|
|
2631
|
-
value: t ??
|
|
2632
|
-
onValueChange: (p) => r(p === "" ?
|
|
2633
|
-
placeholder:
|
|
2634
|
-
"aria-label":
|
|
2659
|
+
value: t ?? Re,
|
|
2660
|
+
onValueChange: (p) => r(p === "" ? Re : p),
|
|
2661
|
+
placeholder: d("booking.operator.placeholder"),
|
|
2662
|
+
"aria-label": d("booking.operator.heading"),
|
|
2635
2663
|
clearable: !0
|
|
2636
2664
|
}
|
|
2637
2665
|
)
|
|
2638
2666
|
] }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2639
2667
|
f,
|
|
2640
2668
|
/* @__PURE__ */ s(
|
|
2641
|
-
|
|
2669
|
+
$t,
|
|
2642
2670
|
{
|
|
2643
2671
|
options: m,
|
|
2644
|
-
value: t ??
|
|
2672
|
+
value: t ?? Re,
|
|
2645
2673
|
onValueChange: (p) => r(p),
|
|
2646
|
-
placeholder:
|
|
2647
|
-
"aria-label":
|
|
2674
|
+
placeholder: d("booking.operator.placeholder"),
|
|
2675
|
+
"aria-label": d("booking.operator.heading")
|
|
2648
2676
|
}
|
|
2649
2677
|
)
|
|
2650
2678
|
] });
|
|
2651
2679
|
}
|
|
2652
|
-
function
|
|
2680
|
+
function Ps({
|
|
2653
2681
|
customSlot: e
|
|
2654
2682
|
}) {
|
|
2655
|
-
const { t } =
|
|
2656
|
-
return e ? /* @__PURE__ */ s(
|
|
2657
|
-
/* @__PURE__ */ s(
|
|
2658
|
-
/* @__PURE__ */ s(
|
|
2683
|
+
const { t } = Y("ui");
|
|
2684
|
+
return e ? /* @__PURE__ */ s(ce, { children: e }) : /* @__PURE__ */ v(ne, { variant: "warning", children: [
|
|
2685
|
+
/* @__PURE__ */ s(ne.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
|
|
2686
|
+
/* @__PURE__ */ s(ne.Description, { children: t("booking.onboardingIncomplete.description") })
|
|
2659
2687
|
] });
|
|
2660
2688
|
}
|
|
2661
|
-
function
|
|
2689
|
+
function ss({
|
|
2662
2690
|
nextAvailableDate: e,
|
|
2663
2691
|
onJump: t,
|
|
2664
2692
|
locale: n
|
|
2665
2693
|
}) {
|
|
2666
|
-
const { t: r } =
|
|
2694
|
+
const { t: r } = Y("ui"), i = M(() => {
|
|
2667
2695
|
try {
|
|
2668
2696
|
return new Intl.DateTimeFormat(n, { dateStyle: "long" }).format(
|
|
2669
|
-
|
|
2697
|
+
ye(e)
|
|
2670
2698
|
);
|
|
2671
2699
|
} catch {
|
|
2672
2700
|
return e;
|
|
2673
2701
|
}
|
|
2674
2702
|
}, [e, n]);
|
|
2675
|
-
return /* @__PURE__ */ v(
|
|
2676
|
-
/* @__PURE__ */ s(
|
|
2677
|
-
/* @__PURE__ */ s(
|
|
2703
|
+
return /* @__PURE__ */ v(ne, { variant: "info", children: [
|
|
2704
|
+
/* @__PURE__ */ s(ne.Description, { children: r("booking.nextAvailable.description", { date: i }) }),
|
|
2705
|
+
/* @__PURE__ */ s(ne.Action, { children: /* @__PURE__ */ s(tt, { intent: "secondary", size: "sm", onClick: t, children: r("booking.nextAvailable.cta") }) })
|
|
2678
2706
|
] });
|
|
2679
2707
|
}
|
|
2680
|
-
function
|
|
2708
|
+
function _i({
|
|
2681
2709
|
payment: e,
|
|
2682
2710
|
snapshot: t,
|
|
2683
2711
|
operators: n,
|
|
2684
2712
|
specialties: r,
|
|
2685
2713
|
services: i,
|
|
2686
|
-
locale:
|
|
2687
|
-
mode:
|
|
2714
|
+
locale: o,
|
|
2715
|
+
mode: d,
|
|
2688
2716
|
showModify: f,
|
|
2689
2717
|
onReset: m,
|
|
2690
2718
|
onModify: p,
|
|
2691
|
-
focusWasLost:
|
|
2719
|
+
focusWasLost: h
|
|
2692
2720
|
}) {
|
|
2693
|
-
const { t: l } =
|
|
2694
|
-
|
|
2695
|
-
const w =
|
|
2696
|
-
!e || !w || (O && (T != null && T.contains(O)) ||
|
|
2721
|
+
const { t: l } = Y("ui"), c = F(null);
|
|
2722
|
+
z(() => {
|
|
2723
|
+
const w = c.current, O = document.activeElement, T = w == null ? void 0 : w.closest('[data-component="booking"]');
|
|
2724
|
+
!e || !w || (O && (T != null && T.contains(O)) || h()) && w.focus();
|
|
2697
2725
|
}, []);
|
|
2698
|
-
const
|
|
2726
|
+
const b = (t.details.confirmationChannels ?? ["email"]).map(
|
|
2699
2727
|
(w) => l(`booking.confirmation.channel.${w}`)
|
|
2700
|
-
), x = e ?
|
|
2701
|
-
|
|
2728
|
+
), x = e ? Vt(e.amountCents, e.currencyCode, o) : "", k = e ? l(
|
|
2729
|
+
d === "demo" ? "booking.payment.paidDemo" : "booking.payment.paidBody",
|
|
2702
2730
|
{ amount: x }
|
|
2703
|
-
) :
|
|
2704
|
-
channels:
|
|
2705
|
-
}) : l("booking.success.descriptionSingle", { channel:
|
|
2731
|
+
) : d === "demo" ? l("booking.success.descriptionDemo") : b.length > 1 ? l("booking.success.descriptionMultiple", {
|
|
2732
|
+
channels: b.join(" · ")
|
|
2733
|
+
}) : l("booking.success.descriptionSingle", { channel: b[0] }), E = M(() => {
|
|
2706
2734
|
if (t.date)
|
|
2707
2735
|
try {
|
|
2708
|
-
return new Intl.DateTimeFormat(
|
|
2736
|
+
return new Intl.DateTimeFormat(o, {
|
|
2709
2737
|
weekday: "long",
|
|
2710
2738
|
day: "numeric",
|
|
2711
2739
|
month: "long"
|
|
2712
|
-
}).format(
|
|
2740
|
+
}).format(ye(t.date));
|
|
2713
2741
|
} catch {
|
|
2714
2742
|
return t.date;
|
|
2715
2743
|
}
|
|
2716
|
-
}, [t.date,
|
|
2717
|
-
const O = (t.operatorIds && t.operatorIds.length > 0 ? t.operatorIds : t.operatorId ? [t.operatorId] : []).filter((T) => T !==
|
|
2718
|
-
var
|
|
2719
|
-
return (
|
|
2744
|
+
}, [t.date, o]), N = M(() => {
|
|
2745
|
+
const O = (t.operatorIds && t.operatorIds.length > 0 ? t.operatorIds : t.operatorId ? [t.operatorId] : []).filter((T) => T !== Re).map((T) => {
|
|
2746
|
+
var g;
|
|
2747
|
+
return (g = n.find((C) => C.id === T)) == null ? void 0 : g.name;
|
|
2720
2748
|
}).filter((T) => T !== void 0);
|
|
2721
2749
|
if (O.length === 0) return [];
|
|
2722
2750
|
try {
|
|
2723
|
-
return new Intl.ListFormat(
|
|
2751
|
+
return new Intl.ListFormat(o === "en" ? "en-GB" : o, {
|
|
2724
2752
|
style: "long",
|
|
2725
2753
|
type: "conjunction"
|
|
2726
2754
|
}).formatToParts(O);
|
|
2727
2755
|
} catch {
|
|
2728
|
-
return O.flatMap((T,
|
|
2729
|
-
...
|
|
2756
|
+
return O.flatMap((T, g) => [
|
|
2757
|
+
...g > 0 ? [{ type: "literal", value: ", " }] : [],
|
|
2730
2758
|
{ type: "element", value: T }
|
|
2731
2759
|
]);
|
|
2732
2760
|
}
|
|
2733
|
-
}, [t.operatorIds, t.operatorId, n,
|
|
2761
|
+
}, [t.operatorIds, t.operatorId, n, o]), S = t.specialtyId ? r.find((w) => w.id === t.specialtyId) : void 0, I = t.serviceId ? i.find((w) => w.id === t.serviceId) : void 0;
|
|
2734
2762
|
return /* @__PURE__ */ v(
|
|
2735
2763
|
"div",
|
|
2736
2764
|
{
|
|
2737
2765
|
"data-component": "booking-success",
|
|
2738
2766
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
2739
2767
|
children: [
|
|
2740
|
-
/* @__PURE__ */ v(
|
|
2768
|
+
/* @__PURE__ */ v(ne, { variant: "success", children: [
|
|
2741
2769
|
/* @__PURE__ */ s(
|
|
2742
|
-
|
|
2770
|
+
ne.Title,
|
|
2743
2771
|
{
|
|
2744
2772
|
as: "h3",
|
|
2745
|
-
ref:
|
|
2773
|
+
ref: c,
|
|
2746
2774
|
tabIndex: e ? -1 : void 0,
|
|
2747
|
-
className: e ?
|
|
2775
|
+
className: e ? Rt : void 0,
|
|
2748
2776
|
children: l(
|
|
2749
|
-
e ?
|
|
2777
|
+
e ? d === "demo" ? "booking.payment.paidDemoTitle" : "booking.payment.paidTitle" : "booking.success.heading"
|
|
2750
2778
|
)
|
|
2751
2779
|
}
|
|
2752
2780
|
),
|
|
2753
|
-
/* @__PURE__ */ s(
|
|
2781
|
+
/* @__PURE__ */ s(ne.Description, { children: k })
|
|
2754
2782
|
] }),
|
|
2755
2783
|
/* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ v("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
|
|
2756
|
-
e &&
|
|
2784
|
+
e && d !== "demo" ? /* @__PURE__ */ v(ce, { children: [
|
|
2757
2785
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.payment.summaryPaid") }),
|
|
2758
2786
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: x })
|
|
2759
2787
|
] }) : null,
|
|
2760
|
-
S ? /* @__PURE__ */ v(
|
|
2788
|
+
S ? /* @__PURE__ */ v(ce, { children: [
|
|
2761
2789
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summarySpecialty") }),
|
|
2762
2790
|
/* @__PURE__ */ s(
|
|
2763
2791
|
"dd",
|
|
@@ -2768,7 +2796,7 @@ function Fi({
|
|
|
2768
2796
|
}
|
|
2769
2797
|
)
|
|
2770
2798
|
] }) : null,
|
|
2771
|
-
I ? /* @__PURE__ */ v(
|
|
2799
|
+
I ? /* @__PURE__ */ v(ce, { children: [
|
|
2772
2800
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summaryService") }),
|
|
2773
2801
|
/* @__PURE__ */ s(
|
|
2774
2802
|
"dd",
|
|
@@ -2779,13 +2807,13 @@ function Fi({
|
|
|
2779
2807
|
}
|
|
2780
2808
|
)
|
|
2781
2809
|
] }) : null,
|
|
2782
|
-
E ? /* @__PURE__ */ v(
|
|
2810
|
+
E ? /* @__PURE__ */ v(ce, { children: [
|
|
2783
2811
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summaryDate") }),
|
|
2784
2812
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: E })
|
|
2785
2813
|
] }) : null,
|
|
2786
2814
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summaryTime") }),
|
|
2787
2815
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: t.slot.time }),
|
|
2788
|
-
N.length > 0 ? /* @__PURE__ */ v(
|
|
2816
|
+
N.length > 0 ? /* @__PURE__ */ v(ce, { children: [
|
|
2789
2817
|
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summaryProvider") }),
|
|
2790
2818
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: N.map(
|
|
2791
2819
|
(w, O) => w.type === "element" ? /* @__PURE__ */ s("bdi", { children: w.value }, O) : w.value
|
|
@@ -2793,17 +2821,17 @@ function Fi({
|
|
|
2793
2821
|
] }) : null
|
|
2794
2822
|
] }) }),
|
|
2795
2823
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
2796
|
-
/* @__PURE__ */ s(
|
|
2797
|
-
f ? /* @__PURE__ */ s(
|
|
2824
|
+
/* @__PURE__ */ s(tt, { intent: "secondary", size: "md", onClick: m, children: l("booking.success.bookAnother") }),
|
|
2825
|
+
f ? /* @__PURE__ */ s(tt, { intent: "ghost", size: "md", onClick: p, children: l("booking.success.modifyBooking") }) : null
|
|
2798
2826
|
] })
|
|
2799
2827
|
]
|
|
2800
2828
|
}
|
|
2801
2829
|
);
|
|
2802
2830
|
}
|
|
2803
|
-
function
|
|
2804
|
-
const { t } =
|
|
2805
|
-
return e ? /* @__PURE__ */ s(
|
|
2806
|
-
|
|
2831
|
+
function Vs({ customSlot: e }) {
|
|
2832
|
+
const { t } = Y("ui");
|
|
2833
|
+
return e ? /* @__PURE__ */ s(ce, { children: e }) : /* @__PURE__ */ s(
|
|
2834
|
+
vs,
|
|
2807
2835
|
{
|
|
2808
2836
|
variant: "no-results",
|
|
2809
2837
|
title: t("booking.emptyServices.title"),
|
|
@@ -2811,14 +2839,14 @@ function Ps({ customSlot: e }) {
|
|
|
2811
2839
|
}
|
|
2812
2840
|
);
|
|
2813
2841
|
}
|
|
2814
|
-
const
|
|
2842
|
+
const $s = "data-booking-step-active", Bi = `[${$s}]`, Rt = [
|
|
2815
2843
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
2816
2844
|
"ds:focus-visible:outline-solid",
|
|
2817
2845
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
2818
2846
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
2819
2847
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
2820
2848
|
].join(" ");
|
|
2821
|
-
function
|
|
2849
|
+
function Z({
|
|
2822
2850
|
step: e,
|
|
2823
2851
|
active: t,
|
|
2824
2852
|
className: n,
|
|
@@ -2830,32 +2858,32 @@ function Y({
|
|
|
2830
2858
|
{
|
|
2831
2859
|
id: r,
|
|
2832
2860
|
"data-booking-step": String(e),
|
|
2833
|
-
...t ? { [
|
|
2861
|
+
...t ? { [$s]: "" } : null,
|
|
2834
2862
|
tabIndex: -1,
|
|
2835
|
-
className: n ? `${n} ${
|
|
2863
|
+
className: n ? `${n} ${Rt}` : Rt,
|
|
2836
2864
|
children: i
|
|
2837
2865
|
}
|
|
2838
2866
|
);
|
|
2839
2867
|
}
|
|
2840
|
-
function
|
|
2868
|
+
function ns(e, t) {
|
|
2841
2869
|
return t === "four-day-grid" ? e.filter((n) => n !== 6) : e;
|
|
2842
2870
|
}
|
|
2843
|
-
function
|
|
2871
|
+
function Ri(e) {
|
|
2844
2872
|
const {
|
|
2845
2873
|
cascade: t,
|
|
2846
2874
|
inputs: n,
|
|
2847
2875
|
value: r,
|
|
2848
2876
|
onChange: i,
|
|
2849
|
-
onSubmit:
|
|
2850
|
-
emptyServicesSlot:
|
|
2877
|
+
onSubmit: o,
|
|
2878
|
+
emptyServicesSlot: d,
|
|
2851
2879
|
onboardingIncompleteSlot: f,
|
|
2852
2880
|
loadingDates: m,
|
|
2853
2881
|
loadingSlots: p,
|
|
2854
|
-
onDateSelect:
|
|
2882
|
+
onDateSelect: h,
|
|
2855
2883
|
onWindowChange: l,
|
|
2856
|
-
datePickerStyle:
|
|
2884
|
+
datePickerStyle: c,
|
|
2857
2885
|
specialtyPickerStyle: u,
|
|
2858
|
-
servicePickerStyle:
|
|
2886
|
+
servicePickerStyle: b,
|
|
2859
2887
|
showServiceDuration: x,
|
|
2860
2888
|
operatorPickerStyle: k,
|
|
2861
2889
|
submitting: E,
|
|
@@ -2863,126 +2891,126 @@ function _i(e) {
|
|
|
2863
2891
|
detailsProps: S,
|
|
2864
2892
|
agentIdBase: I,
|
|
2865
2893
|
activeStep: w
|
|
2866
|
-
} = e, { t: O } =
|
|
2894
|
+
} = e, { t: O } = Y("ui"), T = mt(w, c), g = (C, U) => ({
|
|
2867
2895
|
step: C,
|
|
2868
2896
|
active: C === T,
|
|
2869
|
-
className:
|
|
2897
|
+
className: U
|
|
2870
2898
|
});
|
|
2871
2899
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2872
|
-
t.gates.insurance ? /* @__PURE__ */ s(
|
|
2873
|
-
|
|
2900
|
+
t.gates.insurance ? /* @__PURE__ */ s(Z, { ...g(1), children: /* @__PURE__ */ s(
|
|
2901
|
+
Ls,
|
|
2874
2902
|
{
|
|
2875
2903
|
value: r.insuranceType,
|
|
2876
|
-
onChange: (C) => i(
|
|
2904
|
+
onChange: (C) => i(ys(r, C))
|
|
2877
2905
|
}
|
|
2878
2906
|
) }) : null,
|
|
2879
|
-
t.gates.specialty ? /* @__PURE__ */ s(
|
|
2907
|
+
t.gates.specialty ? /* @__PURE__ */ s(Z, { ...g(2), children: /* @__PURE__ */ s(
|
|
2880
2908
|
_s,
|
|
2881
2909
|
{
|
|
2882
2910
|
specialties: t.filtered.specialties,
|
|
2883
2911
|
value: r.specialtyId,
|
|
2884
2912
|
valueIds: r.specialtyIds,
|
|
2885
|
-
onChange: (C) => i(
|
|
2886
|
-
onChangeIds: (C) => i(
|
|
2913
|
+
onChange: (C) => i(ks(r, C)),
|
|
2914
|
+
onChangeIds: (C) => i(Ss(r, C)),
|
|
2887
2915
|
pickerStyle: u
|
|
2888
2916
|
}
|
|
2889
2917
|
) }) : null,
|
|
2890
|
-
t.gates.service ? /* @__PURE__ */ s(
|
|
2891
|
-
|
|
2918
|
+
t.gates.service ? /* @__PURE__ */ s(Z, { ...g(3), children: t.filtered.services.length === 0 ? /* @__PURE__ */ s(Vs, { customSlot: d }) : /* @__PURE__ */ s(
|
|
2919
|
+
Bs,
|
|
2892
2920
|
{
|
|
2893
2921
|
services: t.filtered.services,
|
|
2894
2922
|
value: r.serviceId,
|
|
2895
2923
|
valueIds: r.serviceIds,
|
|
2896
|
-
onChange: (C) => i(
|
|
2897
|
-
onChangeIds: (C) => i(
|
|
2898
|
-
pickerStyle:
|
|
2924
|
+
onChange: (C) => i(xs(r, C)),
|
|
2925
|
+
onChangeIds: (C) => i(Is(r, C)),
|
|
2926
|
+
pickerStyle: b,
|
|
2899
2927
|
showDuration: x
|
|
2900
2928
|
}
|
|
2901
2929
|
) }) : null,
|
|
2902
|
-
t.gates.onboardingIncomplete ? /* @__PURE__ */ s(
|
|
2903
|
-
t.gates.operator ? /* @__PURE__ */ s(
|
|
2904
|
-
|
|
2930
|
+
t.gates.onboardingIncomplete ? /* @__PURE__ */ s(Ps, { customSlot: f }) : null,
|
|
2931
|
+
t.gates.operator ? /* @__PURE__ */ s(Z, { ...g(4), children: /* @__PURE__ */ s(
|
|
2932
|
+
Rs,
|
|
2905
2933
|
{
|
|
2906
2934
|
operators: t.filtered.operators,
|
|
2907
2935
|
value: r.operatorId,
|
|
2908
2936
|
valueIds: r.operatorIds,
|
|
2909
|
-
onChange: (C) => i(
|
|
2910
|
-
onChangeIds: (C) => i(
|
|
2937
|
+
onChange: (C) => i(Ns(r, C)),
|
|
2938
|
+
onChangeIds: (C) => i(ws(r, C)),
|
|
2911
2939
|
pickerStyle: k
|
|
2912
2940
|
}
|
|
2913
2941
|
) }) : null,
|
|
2914
2942
|
t.gates.date ? /* @__PURE__ */ v(
|
|
2915
|
-
|
|
2943
|
+
Z,
|
|
2916
2944
|
{
|
|
2917
|
-
...
|
|
2945
|
+
...g(5, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
|
|
2918
2946
|
children: [
|
|
2919
2947
|
/* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: O("booking.date.heading") }),
|
|
2920
2948
|
n.availableDates.length === 0 && n.nextAvailableDate ? /* @__PURE__ */ s(
|
|
2921
|
-
|
|
2949
|
+
ss,
|
|
2922
2950
|
{
|
|
2923
2951
|
nextAvailableDate: n.nextAvailableDate,
|
|
2924
|
-
onJump: () => i(
|
|
2952
|
+
onJump: () => i(qt(r, n.nextAvailableDate)),
|
|
2925
2953
|
locale: N
|
|
2926
2954
|
}
|
|
2927
|
-
) :
|
|
2955
|
+
) : Fs({
|
|
2928
2956
|
inputs: n,
|
|
2929
2957
|
value: r,
|
|
2930
2958
|
onChange: i,
|
|
2931
|
-
onDateSelect:
|
|
2959
|
+
onDateSelect: h,
|
|
2932
2960
|
onWindowChange: l,
|
|
2933
2961
|
loadingDates: m,
|
|
2934
2962
|
loadingSlots: p,
|
|
2935
2963
|
locale: N,
|
|
2936
|
-
datePickerStyle:
|
|
2964
|
+
datePickerStyle: c,
|
|
2937
2965
|
agentIdBase: I
|
|
2938
2966
|
})
|
|
2939
2967
|
]
|
|
2940
2968
|
}
|
|
2941
2969
|
) : null,
|
|
2942
|
-
t.gates.slot && r.date &&
|
|
2943
|
-
|
|
2970
|
+
t.gates.slot && r.date && c === "month-calendar" ? /* @__PURE__ */ v(
|
|
2971
|
+
Z,
|
|
2944
2972
|
{
|
|
2945
|
-
...
|
|
2973
|
+
...g(6, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
|
|
2946
2974
|
children: [
|
|
2947
2975
|
/* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: O("booking.slot.heading") }),
|
|
2948
|
-
|
|
2976
|
+
Ms({
|
|
2949
2977
|
inputs: n,
|
|
2950
2978
|
value: r,
|
|
2951
2979
|
onChange: i,
|
|
2952
2980
|
loadingSlots: p,
|
|
2953
2981
|
locale: N,
|
|
2954
|
-
datePickerStyle:
|
|
2982
|
+
datePickerStyle: c
|
|
2955
2983
|
})
|
|
2956
2984
|
]
|
|
2957
2985
|
}
|
|
2958
2986
|
) : null,
|
|
2959
|
-
t.gates.details && t.selectedSlot ? /* @__PURE__ */ s(
|
|
2960
|
-
|
|
2987
|
+
t.gates.details && t.selectedSlot ? /* @__PURE__ */ s(Z, { ...g(7), children: /* @__PURE__ */ s(
|
|
2988
|
+
ts,
|
|
2961
2989
|
{
|
|
2962
2990
|
...S,
|
|
2963
2991
|
value: r.details ?? {},
|
|
2964
2992
|
onChange: (C) => i({ ...r, details: C }),
|
|
2965
|
-
onSubmit:
|
|
2993
|
+
onSubmit: o,
|
|
2966
2994
|
submitting: E,
|
|
2967
2995
|
defaultPhoneCountry: e.policy.country
|
|
2968
2996
|
}
|
|
2969
2997
|
) }) : null
|
|
2970
2998
|
] });
|
|
2971
2999
|
}
|
|
2972
|
-
function
|
|
3000
|
+
function De(e, t, n = {}) {
|
|
2973
3001
|
const {
|
|
2974
3002
|
cascade: r,
|
|
2975
3003
|
inputs: i,
|
|
2976
|
-
value:
|
|
2977
|
-
onChange:
|
|
3004
|
+
value: o,
|
|
3005
|
+
onChange: d,
|
|
2978
3006
|
onSubmit: f,
|
|
2979
3007
|
emptyServicesSlot: m,
|
|
2980
3008
|
onboardingIncompleteSlot: p,
|
|
2981
|
-
loadingDates:
|
|
3009
|
+
loadingDates: h,
|
|
2982
3010
|
loadingSlots: l,
|
|
2983
|
-
onDateSelect:
|
|
3011
|
+
onDateSelect: c,
|
|
2984
3012
|
onWindowChange: u,
|
|
2985
|
-
datePickerStyle:
|
|
3013
|
+
datePickerStyle: b,
|
|
2986
3014
|
specialtyPickerStyle: x,
|
|
2987
3015
|
servicePickerStyle: k,
|
|
2988
3016
|
showServiceDuration: E,
|
|
@@ -2996,10 +3024,10 @@ function Te(e, t, n = {}) {
|
|
|
2996
3024
|
switch (e) {
|
|
2997
3025
|
case 1:
|
|
2998
3026
|
return /* @__PURE__ */ s(
|
|
2999
|
-
|
|
3027
|
+
Ls,
|
|
3000
3028
|
{
|
|
3001
|
-
value:
|
|
3002
|
-
onChange: (
|
|
3029
|
+
value: o.insuranceType,
|
|
3030
|
+
onChange: (g) => d(ys(o, g))
|
|
3003
3031
|
}
|
|
3004
3032
|
);
|
|
3005
3033
|
case 2:
|
|
@@ -3007,22 +3035,22 @@ function Te(e, t, n = {}) {
|
|
|
3007
3035
|
_s,
|
|
3008
3036
|
{
|
|
3009
3037
|
specialties: r.filtered.specialties,
|
|
3010
|
-
value:
|
|
3011
|
-
valueIds:
|
|
3012
|
-
onChange: (
|
|
3013
|
-
onChangeIds: (
|
|
3038
|
+
value: o.specialtyId,
|
|
3039
|
+
valueIds: o.specialtyIds,
|
|
3040
|
+
onChange: (g) => d(ks(o, g)),
|
|
3041
|
+
onChangeIds: (g) => d(Ss(o, g)),
|
|
3014
3042
|
pickerStyle: x
|
|
3015
3043
|
}
|
|
3016
3044
|
);
|
|
3017
3045
|
case 3:
|
|
3018
|
-
return r.filtered.services.length === 0 ? /* @__PURE__ */ s(
|
|
3019
|
-
|
|
3046
|
+
return r.filtered.services.length === 0 ? /* @__PURE__ */ s(Vs, { customSlot: m }) : r.gates.onboardingIncomplete ? /* @__PURE__ */ s(Ps, { customSlot: p }) : /* @__PURE__ */ s(
|
|
3047
|
+
Bs,
|
|
3020
3048
|
{
|
|
3021
3049
|
services: r.filtered.services,
|
|
3022
|
-
value:
|
|
3023
|
-
valueIds:
|
|
3024
|
-
onChange: (
|
|
3025
|
-
onChangeIds: (
|
|
3050
|
+
value: o.serviceId,
|
|
3051
|
+
valueIds: o.serviceIds,
|
|
3052
|
+
onChange: (g) => d(xs(o, g)),
|
|
3053
|
+
onChangeIds: (g) => d(Is(o, g)),
|
|
3026
3054
|
pickerStyle: k,
|
|
3027
3055
|
compact: n.compactService,
|
|
3028
3056
|
showDuration: E
|
|
@@ -3030,52 +3058,52 @@ function Te(e, t, n = {}) {
|
|
|
3030
3058
|
);
|
|
3031
3059
|
case 4:
|
|
3032
3060
|
return /* @__PURE__ */ s(
|
|
3033
|
-
|
|
3061
|
+
Rs,
|
|
3034
3062
|
{
|
|
3035
3063
|
operators: r.filtered.operators,
|
|
3036
|
-
value:
|
|
3037
|
-
valueIds:
|
|
3038
|
-
onChange: (
|
|
3039
|
-
onChangeIds: (
|
|
3064
|
+
value: o.operatorId,
|
|
3065
|
+
valueIds: o.operatorIds,
|
|
3066
|
+
onChange: (g) => d(Ns(o, g)),
|
|
3067
|
+
onChangeIds: (g) => d(ws(o, g)),
|
|
3040
3068
|
pickerStyle: N
|
|
3041
3069
|
}
|
|
3042
3070
|
);
|
|
3043
3071
|
case 5:
|
|
3044
3072
|
return i.availableDates.length === 0 && i.nextAvailableDate ? /* @__PURE__ */ s(
|
|
3045
|
-
|
|
3073
|
+
ss,
|
|
3046
3074
|
{
|
|
3047
3075
|
nextAvailableDate: i.nextAvailableDate,
|
|
3048
|
-
onJump: () =>
|
|
3076
|
+
onJump: () => d(qt(o, i.nextAvailableDate)),
|
|
3049
3077
|
locale: I
|
|
3050
3078
|
}
|
|
3051
|
-
) :
|
|
3079
|
+
) : Fs({
|
|
3052
3080
|
inputs: i,
|
|
3053
|
-
value:
|
|
3054
|
-
onChange:
|
|
3055
|
-
onDateSelect:
|
|
3081
|
+
value: o,
|
|
3082
|
+
onChange: d,
|
|
3083
|
+
onDateSelect: c,
|
|
3056
3084
|
onWindowChange: u,
|
|
3057
|
-
loadingDates:
|
|
3085
|
+
loadingDates: h,
|
|
3058
3086
|
loadingSlots: l,
|
|
3059
3087
|
locale: I,
|
|
3060
|
-
datePickerStyle:
|
|
3088
|
+
datePickerStyle: b,
|
|
3061
3089
|
agentIdBase: T
|
|
3062
3090
|
});
|
|
3063
3091
|
case 6:
|
|
3064
|
-
return
|
|
3092
|
+
return Ms({
|
|
3065
3093
|
inputs: i,
|
|
3066
|
-
value:
|
|
3067
|
-
onChange:
|
|
3094
|
+
value: o,
|
|
3095
|
+
onChange: d,
|
|
3068
3096
|
loadingSlots: l,
|
|
3069
3097
|
locale: I,
|
|
3070
|
-
datePickerStyle:
|
|
3098
|
+
datePickerStyle: b
|
|
3071
3099
|
});
|
|
3072
3100
|
case 7:
|
|
3073
3101
|
return r.selectedSlot ? /* @__PURE__ */ s(
|
|
3074
|
-
|
|
3102
|
+
ts,
|
|
3075
3103
|
{
|
|
3076
3104
|
...w,
|
|
3077
|
-
value:
|
|
3078
|
-
onChange: (
|
|
3105
|
+
value: o.details ?? {},
|
|
3106
|
+
onChange: (g) => d({ ...o, details: g }),
|
|
3079
3107
|
onSubmit: f,
|
|
3080
3108
|
submitting: S,
|
|
3081
3109
|
defaultPhoneCountry: O.country
|
|
@@ -3086,9 +3114,9 @@ function Te(e, t, n = {}) {
|
|
|
3086
3114
|
return null;
|
|
3087
3115
|
}
|
|
3088
3116
|
}
|
|
3089
|
-
function
|
|
3090
|
-
const { t: e } =
|
|
3091
|
-
return
|
|
3117
|
+
function Kt() {
|
|
3118
|
+
const { t: e } = Y("ui");
|
|
3119
|
+
return M(
|
|
3092
3120
|
() => ({
|
|
3093
3121
|
1: e("booking.insurance.heading"),
|
|
3094
3122
|
2: e("booking.specialty.heading"),
|
|
@@ -3101,77 +3129,77 @@ function qt() {
|
|
|
3101
3129
|
[e]
|
|
3102
3130
|
);
|
|
3103
3131
|
}
|
|
3104
|
-
function
|
|
3132
|
+
function mt(e, t) {
|
|
3105
3133
|
return t === "four-day-grid" && e === 6 ? 5 : e;
|
|
3106
3134
|
}
|
|
3107
|
-
function
|
|
3108
|
-
const { cascade: t, value: n, activeStep: r, setActiveStep: i, datePickerStyle:
|
|
3109
|
-
() =>
|
|
3110
|
-
[t.visibleSteps,
|
|
3111
|
-
),
|
|
3135
|
+
function Pi(e) {
|
|
3136
|
+
const { cascade: t, value: n, activeStep: r, setActiveStep: i, datePickerStyle: o } = e, d = Kt(), { t: f } = Y("ui"), m = f("booking.operator.all"), p = M(
|
|
3137
|
+
() => ns(t.visibleSteps, o),
|
|
3138
|
+
[t.visibleSteps, o]
|
|
3139
|
+
), h = mt(r, o), l = Math.max(0, p.indexOf(h)), c = M(
|
|
3112
3140
|
() => p.map((u) => ({
|
|
3113
|
-
label:
|
|
3114
|
-
summary:
|
|
3115
|
-
status:
|
|
3116
|
-
content: /* @__PURE__ */ s(
|
|
3141
|
+
label: d[u],
|
|
3142
|
+
summary: qs(u, n, t, m),
|
|
3143
|
+
status: Vi(u, n, t),
|
|
3144
|
+
content: /* @__PURE__ */ s(Z, { step: u, active: u === h, children: De(u, e, { compactService: !0 }) })
|
|
3117
3145
|
})),
|
|
3118
3146
|
[
|
|
3119
3147
|
p,
|
|
3120
3148
|
n,
|
|
3121
|
-
|
|
3149
|
+
d,
|
|
3122
3150
|
t,
|
|
3123
3151
|
e,
|
|
3124
|
-
|
|
3152
|
+
h,
|
|
3125
3153
|
m
|
|
3126
3154
|
]
|
|
3127
3155
|
);
|
|
3128
3156
|
return /* @__PURE__ */ s(
|
|
3129
|
-
|
|
3157
|
+
sn,
|
|
3130
3158
|
{
|
|
3131
3159
|
activeStep: l,
|
|
3132
|
-
steps:
|
|
3160
|
+
steps: c,
|
|
3133
3161
|
onStepChange: (u) => {
|
|
3134
|
-
const
|
|
3135
|
-
|
|
3162
|
+
const b = p[u];
|
|
3163
|
+
b && i(b);
|
|
3136
3164
|
}
|
|
3137
3165
|
}
|
|
3138
3166
|
);
|
|
3139
3167
|
}
|
|
3140
|
-
function
|
|
3141
|
-
return
|
|
3168
|
+
function Vi(e, t, n) {
|
|
3169
|
+
return ze(e, t) && e < n.currentStep ? "completed" : e <= n.currentStep ? "unlocked" : void 0;
|
|
3142
3170
|
}
|
|
3143
|
-
function
|
|
3144
|
-
return e !== 4 ?
|
|
3171
|
+
function ps(e, t) {
|
|
3172
|
+
return e !== 4 ? ze(e, t) : t.operatorIds && t.operatorIds.length > 0 ? !0 : As(t) !== void 0;
|
|
3145
3173
|
}
|
|
3146
|
-
function
|
|
3174
|
+
function Yt(e, t) {
|
|
3147
3175
|
const n = e.map((r) => {
|
|
3148
3176
|
var i;
|
|
3149
|
-
return (i = t.find((
|
|
3177
|
+
return (i = t.find((o) => o.id === r)) == null ? void 0 : i.label;
|
|
3150
3178
|
}).filter((r) => r !== void 0);
|
|
3151
3179
|
return n.length > 0 ? n.join(", ") : void 0;
|
|
3152
3180
|
}
|
|
3153
|
-
function
|
|
3181
|
+
function qs(e, t, n, r) {
|
|
3154
3182
|
var i;
|
|
3155
|
-
if (
|
|
3183
|
+
if (ze(e, t))
|
|
3156
3184
|
switch (e) {
|
|
3157
3185
|
case 1:
|
|
3158
3186
|
return t.insuranceType;
|
|
3159
3187
|
case 2:
|
|
3160
|
-
return
|
|
3161
|
-
|
|
3188
|
+
return Yt(
|
|
3189
|
+
We(t),
|
|
3162
3190
|
n.filtered.specialties
|
|
3163
3191
|
);
|
|
3164
3192
|
case 3:
|
|
3165
|
-
return
|
|
3193
|
+
return Yt(je(t), n.filtered.services);
|
|
3166
3194
|
case 4: {
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3195
|
+
const d = Qt(t).filter((m) => m !== Re), f = Yt(
|
|
3196
|
+
d,
|
|
3169
3197
|
n.filtered.operators.map((m) => ({
|
|
3170
3198
|
id: m.id,
|
|
3171
3199
|
label: m.name
|
|
3172
3200
|
}))
|
|
3173
3201
|
);
|
|
3174
|
-
return f !== void 0 ? f :
|
|
3202
|
+
return f !== void 0 ? f : d.length === 0 ? r : void 0;
|
|
3175
3203
|
}
|
|
3176
3204
|
case 5:
|
|
3177
3205
|
return t.date;
|
|
@@ -3181,35 +3209,35 @@ function $s(e, t, n, r) {
|
|
|
3181
3209
|
return;
|
|
3182
3210
|
}
|
|
3183
3211
|
}
|
|
3184
|
-
function
|
|
3185
|
-
const { cascade: t, value: n, activeStep: r, setActiveStep: i } = e, { t:
|
|
3212
|
+
function $i(e) {
|
|
3213
|
+
const { cascade: t, value: n, activeStep: r, setActiveStep: i } = e, { t: o } = Y("ui"), d = Kt(), f = o("booking.operator.all"), m = `${Pt()}-filter`, p = mt(r, e.datePickerStyle), h = t.visibleSteps.filter(
|
|
3186
3214
|
(u) => u === 1 || u === 2 || u === 3 || u === 4
|
|
3187
|
-
), l =
|
|
3188
|
-
(u) =>
|
|
3189
|
-
),
|
|
3215
|
+
), l = h.some(
|
|
3216
|
+
(u) => !ze(u, n)
|
|
3217
|
+
), c = h.some(
|
|
3190
3218
|
(u) => u === r
|
|
3191
|
-
) ? r :
|
|
3219
|
+
) ? r : h.find((u) => !ze(u, n));
|
|
3192
3220
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
3193
|
-
|
|
3221
|
+
h.length > 0 ? /* @__PURE__ */ s(
|
|
3194
3222
|
"div",
|
|
3195
3223
|
{
|
|
3196
3224
|
role: "group",
|
|
3197
|
-
"aria-label":
|
|
3225
|
+
"aria-label": o("booking.filtersLabel"),
|
|
3198
3226
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
3199
|
-
children:
|
|
3200
|
-
const
|
|
3227
|
+
children: h.map((u) => {
|
|
3228
|
+
const b = qs(
|
|
3201
3229
|
u,
|
|
3202
3230
|
n,
|
|
3203
3231
|
t,
|
|
3204
3232
|
f
|
|
3205
|
-
), x = u ===
|
|
3233
|
+
), x = u === c, k = ze(u, n);
|
|
3206
3234
|
return /* @__PURE__ */ s(
|
|
3207
|
-
|
|
3235
|
+
tt,
|
|
3208
3236
|
{
|
|
3209
3237
|
intent: x ? "primary" : "outline",
|
|
3210
3238
|
size: "sm",
|
|
3211
3239
|
endIcon: /* @__PURE__ */ s(
|
|
3212
|
-
|
|
3240
|
+
on,
|
|
3213
3241
|
{
|
|
3214
3242
|
"aria-hidden": "true",
|
|
3215
3243
|
className: x ? "ds:rotate-180" : void 0
|
|
@@ -3221,24 +3249,24 @@ function Ri(e) {
|
|
|
3221
3249
|
onClick: () => i(
|
|
3222
3250
|
k && x ? t.currentStep : u
|
|
3223
3251
|
),
|
|
3224
|
-
children:
|
|
3225
|
-
|
|
3252
|
+
children: b ? /* @__PURE__ */ v(ce, { children: [
|
|
3253
|
+
d[u],
|
|
3226
3254
|
": ",
|
|
3227
|
-
|
|
3228
|
-
] }) :
|
|
3255
|
+
b
|
|
3256
|
+
] }) : d[u]
|
|
3229
3257
|
},
|
|
3230
3258
|
`csc-${u}`
|
|
3231
3259
|
);
|
|
3232
3260
|
})
|
|
3233
3261
|
}
|
|
3234
3262
|
) : null,
|
|
3235
|
-
|
|
3236
|
-
|
|
3263
|
+
c !== void 0 ? /* @__PURE__ */ s(
|
|
3264
|
+
Z,
|
|
3237
3265
|
{
|
|
3238
|
-
step:
|
|
3239
|
-
active:
|
|
3266
|
+
step: c,
|
|
3267
|
+
active: c === p,
|
|
3240
3268
|
id: m,
|
|
3241
|
-
children:
|
|
3269
|
+
children: De(c, e, { compactService: !0 })
|
|
3242
3270
|
}
|
|
3243
3271
|
) : null,
|
|
3244
3272
|
!l && t.gates.date ? (
|
|
@@ -3246,32 +3274,32 @@ function Ri(e) {
|
|
|
3246
3274
|
// historic 2-col date|slot split collapses to a single column
|
|
3247
3275
|
// so the picker spans the full width instead of orphaning an
|
|
3248
3276
|
// empty right cell.
|
|
3249
|
-
e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s(
|
|
3277
|
+
e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s(Z, { step: 5, active: p === 5, children: De(5, e) }) : /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
|
|
3250
3278
|
/* @__PURE__ */ s(
|
|
3251
|
-
|
|
3279
|
+
Z,
|
|
3252
3280
|
{
|
|
3253
3281
|
step: 5,
|
|
3254
3282
|
active: p === 5,
|
|
3255
3283
|
className: "ds:min-w-0",
|
|
3256
|
-
children:
|
|
3284
|
+
children: De(5, e)
|
|
3257
3285
|
}
|
|
3258
3286
|
),
|
|
3259
3287
|
n.date ? /* @__PURE__ */ s(
|
|
3260
|
-
|
|
3288
|
+
Z,
|
|
3261
3289
|
{
|
|
3262
3290
|
step: 6,
|
|
3263
3291
|
active: p === 6,
|
|
3264
3292
|
className: "ds:min-w-0",
|
|
3265
|
-
children:
|
|
3293
|
+
children: De(6, e)
|
|
3266
3294
|
}
|
|
3267
3295
|
) : /* @__PURE__ */ s("div", { className: "ds:min-w-0" })
|
|
3268
3296
|
] })
|
|
3269
3297
|
) : null,
|
|
3270
|
-
t.gates.details ? /* @__PURE__ */ s(
|
|
3298
|
+
t.gates.details ? /* @__PURE__ */ s(Z, { step: 7, active: p === 7, children: De(7, e) }) : null
|
|
3271
3299
|
] });
|
|
3272
3300
|
}
|
|
3273
|
-
function
|
|
3274
|
-
const { cascade: t, datePickerStyle: n, activeStep: r } = e, i =
|
|
3301
|
+
function qi(e) {
|
|
3302
|
+
const { cascade: t, datePickerStyle: n, activeStep: r } = e, i = mt(r, n), o = t.visibleSteps.filter(
|
|
3275
3303
|
(f) => f === 1 || f === 2 || f === 3 || f === 4
|
|
3276
3304
|
);
|
|
3277
3305
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
@@ -3280,63 +3308,63 @@ function Pi(e) {
|
|
|
3280
3308
|
{
|
|
3281
3309
|
className: n === "four-day-grid" ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2",
|
|
3282
3310
|
children: [
|
|
3283
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children:
|
|
3311
|
+
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: o.map((f) => /* @__PURE__ */ s(Z, { step: f, active: f === i, children: De(f, e, { compactService: !0 }) }, `fbf-${f}`)) }),
|
|
3284
3312
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
3285
|
-
t.gates.date ? /* @__PURE__ */ s(
|
|
3286
|
-
t.gates.slot && e.value.date && n === "month-calendar" ? /* @__PURE__ */ s(
|
|
3313
|
+
t.gates.date ? /* @__PURE__ */ s(Z, { step: 5, active: i === 5, children: De(5, e) }) : null,
|
|
3314
|
+
t.gates.slot && e.value.date && n === "month-calendar" ? /* @__PURE__ */ s(Z, { step: 6, active: i === 6, children: De(6, e) }) : null
|
|
3287
3315
|
] })
|
|
3288
3316
|
]
|
|
3289
3317
|
}
|
|
3290
3318
|
),
|
|
3291
|
-
t.gates.details ? /* @__PURE__ */ s(
|
|
3319
|
+
t.gates.details ? /* @__PURE__ */ s(Z, { step: 7, active: i === 7, children: De(7, e) }) : null
|
|
3292
3320
|
] });
|
|
3293
3321
|
}
|
|
3294
|
-
function
|
|
3295
|
-
const { cascade: t, value: n, activeStep: r, setActiveStep: i, datePickerStyle:
|
|
3296
|
-
() =>
|
|
3297
|
-
[t.visibleSteps,
|
|
3298
|
-
), p =
|
|
3322
|
+
function Ki(e) {
|
|
3323
|
+
const { cascade: t, value: n, activeStep: r, setActiveStep: i, datePickerStyle: o } = e, { t: d } = Y("ui"), f = Kt(), m = M(
|
|
3324
|
+
() => ns(t.visibleSteps, o),
|
|
3325
|
+
[t.visibleSteps, o]
|
|
3326
|
+
), p = mt(r, o), h = Math.max(0, m.indexOf(p)), l = m.length, c = M(
|
|
3299
3327
|
() => m.map((k) => ({ label: f[k] })),
|
|
3300
3328
|
[m, f]
|
|
3301
|
-
), u =
|
|
3329
|
+
), u = h > 0, b = p === 5 && o === "four-day-grid", x = h < l - 1 && ze(p, n) && (!b || ze(6, n));
|
|
3302
3330
|
return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
3303
|
-
/* @__PURE__ */ s(
|
|
3304
|
-
/* @__PURE__ */ s(
|
|
3331
|
+
/* @__PURE__ */ s(nn, { activeStep: h, steps: c }),
|
|
3332
|
+
/* @__PURE__ */ s(Z, { step: p, active: !0, children: De(p, e, { compactService: !0 }) }),
|
|
3305
3333
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
3306
3334
|
/* @__PURE__ */ s(
|
|
3307
|
-
|
|
3335
|
+
tt,
|
|
3308
3336
|
{
|
|
3309
3337
|
intent: "ghost",
|
|
3310
3338
|
size: "md",
|
|
3311
3339
|
disabled: !u,
|
|
3312
3340
|
onClick: () => {
|
|
3313
|
-
const k = m[
|
|
3341
|
+
const k = m[h - 1];
|
|
3314
3342
|
k && i(k);
|
|
3315
3343
|
},
|
|
3316
|
-
children:
|
|
3344
|
+
children: d("booking.actions.back")
|
|
3317
3345
|
}
|
|
3318
3346
|
),
|
|
3319
3347
|
p < 7 ? /* @__PURE__ */ s(
|
|
3320
|
-
|
|
3348
|
+
tt,
|
|
3321
3349
|
{
|
|
3322
3350
|
intent: "primary",
|
|
3323
3351
|
size: "md",
|
|
3324
3352
|
disabled: !x,
|
|
3325
3353
|
onClick: () => {
|
|
3326
|
-
const k = m[
|
|
3354
|
+
const k = m[h + 1];
|
|
3327
3355
|
k && i(k);
|
|
3328
3356
|
},
|
|
3329
|
-
children:
|
|
3357
|
+
children: d("booking.actions.next")
|
|
3330
3358
|
}
|
|
3331
3359
|
) : null
|
|
3332
3360
|
] })
|
|
3333
3361
|
] });
|
|
3334
3362
|
}
|
|
3335
|
-
const
|
|
3336
|
-
function
|
|
3363
|
+
const zi = [], ji = [];
|
|
3364
|
+
function ms() {
|
|
3337
3365
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3338
3366
|
}
|
|
3339
|
-
const
|
|
3367
|
+
const Ui = fs(
|
|
3340
3368
|
({
|
|
3341
3369
|
variant: e = "inline-list",
|
|
3342
3370
|
country: t,
|
|
@@ -3346,16 +3374,16 @@ const Ki = ms(
|
|
|
3346
3374
|
useSpecialties: n,
|
|
3347
3375
|
allowOperatorSelection: r = !1,
|
|
3348
3376
|
lockedOperatorId: i,
|
|
3349
|
-
operatorsByService:
|
|
3350
|
-
autoSelectSingleService:
|
|
3377
|
+
operatorsByService: o = !1,
|
|
3378
|
+
autoSelectSingleService: d = !1,
|
|
3351
3379
|
specialties: f,
|
|
3352
3380
|
services: m,
|
|
3353
3381
|
operators: p,
|
|
3354
|
-
availableDates:
|
|
3382
|
+
availableDates: h,
|
|
3355
3383
|
availableSlots: l,
|
|
3356
|
-
nextAvailableDate:
|
|
3384
|
+
nextAvailableDate: c,
|
|
3357
3385
|
requireCodiceFiscale: u,
|
|
3358
|
-
requireDateOfBirth:
|
|
3386
|
+
requireDateOfBirth: b,
|
|
3359
3387
|
requireInsuranceNumber: x,
|
|
3360
3388
|
billingInDetails: k = !1,
|
|
3361
3389
|
paymentNoticeStyle: E = "highlighted",
|
|
@@ -3365,464 +3393,467 @@ const Ki = ms(
|
|
|
3365
3393
|
termsUrl: w,
|
|
3366
3394
|
practiceConsent: O,
|
|
3367
3395
|
paymentTermsUrl: T,
|
|
3368
|
-
paymentState:
|
|
3396
|
+
paymentState: g,
|
|
3369
3397
|
renderPayment: C,
|
|
3370
|
-
renderPaymentCompletion:
|
|
3371
|
-
validateCodiceFiscale:
|
|
3372
|
-
validateInsuranceNumber:
|
|
3373
|
-
confirmationChannels:
|
|
3374
|
-
defaultConfirmationChannels:
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3398
|
+
renderPaymentCompletion: U,
|
|
3399
|
+
validateCodiceFiscale: q,
|
|
3400
|
+
validateInsuranceNumber: y,
|
|
3401
|
+
confirmationChannels: K,
|
|
3402
|
+
defaultConfirmationChannels: B,
|
|
3403
|
+
singleConfirmationChannel: Se,
|
|
3404
|
+
value: R,
|
|
3405
|
+
onChange: xe,
|
|
3406
|
+
onSubmit: st,
|
|
3407
|
+
onStepChange: he,
|
|
3408
|
+
onDateSelect: Ye,
|
|
3409
|
+
onWindowChange: ie,
|
|
3410
|
+
datePickerStyle: Fe = "month-calendar",
|
|
3411
|
+
specialtyPickerStyle: Pe,
|
|
3412
|
+
servicePickerStyle: Q,
|
|
3413
|
+
showServiceDuration: re = !0,
|
|
3414
|
+
operatorPickerStyle: Ie,
|
|
3415
|
+
loadingDates: Ne,
|
|
3416
|
+
loadingSlots: Me,
|
|
3417
|
+
submitting: X,
|
|
3418
|
+
submitError: Ve,
|
|
3390
3419
|
mode: de = "live",
|
|
3391
|
-
showModifyOnSuccess:
|
|
3392
|
-
surface:
|
|
3393
|
-
emptyServicesSlot:
|
|
3394
|
-
onboardingIncompleteSlot:
|
|
3395
|
-
"aria-label":
|
|
3396
|
-
id:
|
|
3397
|
-
className:
|
|
3398
|
-
onFocus:
|
|
3399
|
-
onBlur:
|
|
3400
|
-
...
|
|
3401
|
-
},
|
|
3402
|
-
var
|
|
3403
|
-
const { t:
|
|
3404
|
-
|
|
3405
|
-
const A =
|
|
3420
|
+
showModifyOnSuccess: le = !0,
|
|
3421
|
+
surface: we = "flat",
|
|
3422
|
+
emptyServicesSlot: Le,
|
|
3423
|
+
onboardingIncompleteSlot: Ue,
|
|
3424
|
+
"aria-label": V,
|
|
3425
|
+
id: ue,
|
|
3426
|
+
className: zt,
|
|
3427
|
+
onFocus: nt,
|
|
3428
|
+
onBlur: it,
|
|
3429
|
+
...wt
|
|
3430
|
+
}, rt) => {
|
|
3431
|
+
var Tt, St, xt;
|
|
3432
|
+
const { t: G, i18n: jt } = Y("ui"), pe = e ?? "inline-list", Ze = jt.language ?? "en", Ce = f ?? zi, _e = p ?? ji;
|
|
3433
|
+
z(() => {
|
|
3434
|
+
const A = Zn(R, {
|
|
3406
3435
|
useSpecialties: n,
|
|
3407
3436
|
lockedOperatorId: i,
|
|
3408
|
-
autoSelectSingleService:
|
|
3409
|
-
specialties:
|
|
3437
|
+
autoSelectSingleService: d,
|
|
3438
|
+
specialties: Ce,
|
|
3410
3439
|
services: m
|
|
3411
3440
|
});
|
|
3412
|
-
(A.specialtyId !==
|
|
3441
|
+
(A.specialtyId !== R.specialtyId || A.operatorId !== R.operatorId || A.serviceId !== R.serviceId) && xe(A);
|
|
3413
3442
|
}, [
|
|
3414
3443
|
i,
|
|
3415
3444
|
n,
|
|
3416
|
-
|
|
3417
|
-
|
|
3445
|
+
d,
|
|
3446
|
+
Ce,
|
|
3418
3447
|
m
|
|
3419
3448
|
]);
|
|
3420
|
-
const P =
|
|
3421
|
-
() =>
|
|
3449
|
+
const P = M(
|
|
3450
|
+
() => Yn({
|
|
3422
3451
|
country: t,
|
|
3423
3452
|
useSpecialties: n,
|
|
3424
3453
|
allowOperatorSelection: r,
|
|
3425
3454
|
lockedOperatorId: i,
|
|
3426
|
-
operatorsByService:
|
|
3427
|
-
specialties:
|
|
3455
|
+
operatorsByService: o,
|
|
3456
|
+
specialties: Ce,
|
|
3428
3457
|
services: m,
|
|
3429
|
-
operators:
|
|
3458
|
+
operators: _e,
|
|
3430
3459
|
availableSlots: l,
|
|
3431
|
-
value:
|
|
3460
|
+
value: R
|
|
3432
3461
|
}),
|
|
3433
3462
|
[
|
|
3434
3463
|
t,
|
|
3435
3464
|
n,
|
|
3436
3465
|
r,
|
|
3437
3466
|
i,
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3467
|
+
o,
|
|
3468
|
+
d,
|
|
3469
|
+
Ce,
|
|
3441
3470
|
m,
|
|
3442
|
-
|
|
3443
|
-
|
|
3471
|
+
_e,
|
|
3472
|
+
h,
|
|
3444
3473
|
l,
|
|
3445
|
-
|
|
3474
|
+
R
|
|
3446
3475
|
]
|
|
3447
|
-
),
|
|
3476
|
+
), Ae = M(
|
|
3448
3477
|
() => [
|
|
3449
|
-
JSON.stringify(
|
|
3450
|
-
JSON.stringify(
|
|
3451
|
-
JSON.stringify(
|
|
3452
|
-
JSON.stringify(
|
|
3453
|
-
JSON.stringify(
|
|
3454
|
-
JSON.stringify(
|
|
3478
|
+
JSON.stringify(R.insuranceType),
|
|
3479
|
+
JSON.stringify(We(R)),
|
|
3480
|
+
JSON.stringify(je(R)),
|
|
3481
|
+
JSON.stringify(Qt(R)),
|
|
3482
|
+
JSON.stringify(R.date),
|
|
3483
|
+
JSON.stringify(R.slotKey)
|
|
3455
3484
|
],
|
|
3456
|
-
[
|
|
3457
|
-
),
|
|
3485
|
+
[R]
|
|
3486
|
+
), ve = pe === "progress", Ct = ke(
|
|
3458
3487
|
(A) => {
|
|
3459
|
-
if (A === 4 && P.visibleSteps.includes(4) &&
|
|
3488
|
+
if (A === 4 && P.visibleSteps.includes(4) && Qt(R).length === 0)
|
|
3460
3489
|
return Math.min(4, P.currentStep);
|
|
3461
|
-
if (!
|
|
3462
|
-
const
|
|
3463
|
-
(
|
|
3490
|
+
if (!ve) return P.currentStep;
|
|
3491
|
+
const L = P.visibleSteps.find(
|
|
3492
|
+
(_) => _ > A && !ps(_, R)
|
|
3464
3493
|
);
|
|
3465
|
-
return
|
|
3494
|
+
return L === void 0 ? P.currentStep : Math.min(L, P.currentStep);
|
|
3466
3495
|
},
|
|
3467
|
-
[
|
|
3468
|
-
), [
|
|
3496
|
+
[ve, P.visibleSteps, P.currentStep, R]
|
|
3497
|
+
), [me, be] = te(
|
|
3469
3498
|
P.currentStep
|
|
3470
|
-
),
|
|
3471
|
-
|
|
3472
|
-
const A =
|
|
3473
|
-
|
|
3474
|
-
const
|
|
3475
|
-
(
|
|
3499
|
+
), Qe = F(Ae), ft = F(P.visibleSteps);
|
|
3500
|
+
z(() => {
|
|
3501
|
+
const A = Qe.current, L = ft.current;
|
|
3502
|
+
Qe.current = Ae, ft.current = P.visibleSteps;
|
|
3503
|
+
const _ = Ae.findIndex(
|
|
3504
|
+
(se, a) => se !== A[a]
|
|
3476
3505
|
);
|
|
3477
|
-
if (
|
|
3478
|
-
|
|
3506
|
+
if (_ !== -1) {
|
|
3507
|
+
be(Ct(_ + 1));
|
|
3479
3508
|
return;
|
|
3480
3509
|
}
|
|
3481
|
-
const
|
|
3482
|
-
(
|
|
3510
|
+
const W = ve ? P.visibleSteps.find(
|
|
3511
|
+
(se) => se < me && !L.includes(se) && !ps(se, R)
|
|
3483
3512
|
) : void 0;
|
|
3484
|
-
if (
|
|
3485
|
-
|
|
3513
|
+
if (W !== void 0) {
|
|
3514
|
+
be(W);
|
|
3486
3515
|
return;
|
|
3487
3516
|
}
|
|
3488
|
-
P.visibleSteps.includes(
|
|
3517
|
+
P.visibleSteps.includes(me) || be(P.currentStep);
|
|
3489
3518
|
}, [
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3519
|
+
Ae,
|
|
3520
|
+
Ct,
|
|
3521
|
+
ve,
|
|
3493
3522
|
P.currentStep,
|
|
3494
3523
|
P.visibleSteps,
|
|
3495
|
-
|
|
3496
|
-
|
|
3524
|
+
me,
|
|
3525
|
+
R
|
|
3497
3526
|
]);
|
|
3498
|
-
const
|
|
3499
|
-
() =>
|
|
3500
|
-
[P.visibleSteps,
|
|
3501
|
-
),
|
|
3502
|
-
|
|
3503
|
-
const A =
|
|
3504
|
-
if (
|
|
3505
|
-
|
|
3527
|
+
const oe = F(null), $e = M(
|
|
3528
|
+
() => ns(P.visibleSteps, Fe),
|
|
3529
|
+
[P.visibleSteps, Fe]
|
|
3530
|
+
), ot = Kt(), [Xe, Ut] = te(""), fe = F(null), Te = F(null);
|
|
3531
|
+
z(() => {
|
|
3532
|
+
const A = mt(me, Fe);
|
|
3533
|
+
if (Te.current === null) {
|
|
3534
|
+
Te.current = A;
|
|
3506
3535
|
return;
|
|
3507
3536
|
}
|
|
3508
|
-
if (
|
|
3509
|
-
|
|
3510
|
-
const
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
current:
|
|
3514
|
-
total:
|
|
3515
|
-
label:
|
|
3537
|
+
if (Te.current === A) return;
|
|
3538
|
+
Te.current = A;
|
|
3539
|
+
const L = $e.indexOf(A);
|
|
3540
|
+
Ut(
|
|
3541
|
+
L === -1 ? "" : G("booking.stepAnnouncement", {
|
|
3542
|
+
current: L + 1,
|
|
3543
|
+
total: $e.length,
|
|
3544
|
+
label: ot[A]
|
|
3516
3545
|
})
|
|
3517
3546
|
);
|
|
3518
|
-
const
|
|
3519
|
-
if (!
|
|
3520
|
-
const
|
|
3521
|
-
if (!
|
|
3522
|
-
const
|
|
3523
|
-
if (!(
|
|
3524
|
-
const D =
|
|
3547
|
+
const _ = fe.current;
|
|
3548
|
+
if (!_ || _.isConnected) return;
|
|
3549
|
+
const W = oe.current;
|
|
3550
|
+
if (!W) return;
|
|
3551
|
+
const se = document.activeElement;
|
|
3552
|
+
if (!(se === null || se === document.body || !W.contains(se))) return;
|
|
3553
|
+
const D = W.querySelector(Bi) ?? W;
|
|
3525
3554
|
if (D.focus({ preventScroll: !0 }), typeof D.scrollIntoView == "function")
|
|
3526
3555
|
try {
|
|
3527
3556
|
D.scrollIntoView({
|
|
3528
|
-
behavior:
|
|
3557
|
+
behavior: ms() ? "auto" : "smooth",
|
|
3529
3558
|
block: "nearest"
|
|
3530
3559
|
});
|
|
3531
3560
|
} catch {
|
|
3532
3561
|
D.scrollIntoView();
|
|
3533
3562
|
}
|
|
3534
|
-
}, [
|
|
3535
|
-
const
|
|
3563
|
+
}, [me, Fe, $e, ot, G]);
|
|
3564
|
+
const J = ki({
|
|
3536
3565
|
services: m,
|
|
3537
|
-
value:
|
|
3566
|
+
value: R,
|
|
3538
3567
|
availableSlots: l,
|
|
3539
|
-
onSubmit:
|
|
3540
|
-
onChange:
|
|
3541
|
-
paymentState:
|
|
3542
|
-
submitting:
|
|
3568
|
+
onSubmit: st,
|
|
3569
|
+
onChange: xe,
|
|
3570
|
+
paymentState: g,
|
|
3571
|
+
submitting: X,
|
|
3543
3572
|
paymentTermsUrl: T,
|
|
3544
3573
|
renderPayment: C
|
|
3545
|
-
}), j =
|
|
3546
|
-
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3549
|
-
var A,
|
|
3574
|
+
}), j = J.status, at = J.submit, ct = F(J.reset);
|
|
3575
|
+
ct.current = J.reset;
|
|
3576
|
+
const gt = Pt(), ht = F(null), vt = F(null), Ge = ((Tt = J.state) == null ? void 0 : Tt.status) === "failed", dt = J.state && "phase" in J.state && J.state.phase === "completion";
|
|
3577
|
+
z(() => {
|
|
3578
|
+
var A, L;
|
|
3550
3579
|
if (j === "payment") {
|
|
3551
|
-
const
|
|
3552
|
-
(!
|
|
3580
|
+
const _ = document.activeElement;
|
|
3581
|
+
(!dt || !_ || _ === document.body || !((A = oe.current) != null && A.contains(_))) && ((L = ht.current) == null || L.focus());
|
|
3553
3582
|
}
|
|
3554
|
-
}, [j,
|
|
3583
|
+
}, [j, dt]), z(() => {
|
|
3555
3584
|
var A;
|
|
3556
|
-
j === "payment" &&
|
|
3557
|
-
}, [j,
|
|
3558
|
-
const
|
|
3559
|
-
|
|
3560
|
-
if (
|
|
3585
|
+
j === "payment" && Ge && ((A = vt.current) == null || A.focus());
|
|
3586
|
+
}, [j, Ge]), zs(rt, () => oe.current, []);
|
|
3587
|
+
const qe = j === "success" ? 8 : j === "payment" ? 7 : P.currentStep, At = F(null);
|
|
3588
|
+
z(() => {
|
|
3589
|
+
if (qe !== At.current && (At.current = qe, he == null || he(qe), qe === 8 && oe.current))
|
|
3561
3590
|
try {
|
|
3562
|
-
|
|
3563
|
-
behavior:
|
|
3591
|
+
oe.current.scrollIntoView({
|
|
3592
|
+
behavior: ms() ? "auto" : "smooth",
|
|
3564
3593
|
block: "start"
|
|
3565
3594
|
});
|
|
3566
3595
|
} catch {
|
|
3567
|
-
|
|
3596
|
+
oe.current.scrollIntoView();
|
|
3568
3597
|
}
|
|
3569
|
-
}, [
|
|
3570
|
-
const
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
}, [
|
|
3574
|
-
const
|
|
3598
|
+
}, [qe, he]);
|
|
3599
|
+
const Ke = F({ activeStep: me, cascade: P, submitState: j });
|
|
3600
|
+
z(() => {
|
|
3601
|
+
Ke.current = { activeStep: me, cascade: P, submitState: j };
|
|
3602
|
+
}, [me, P, j]);
|
|
3603
|
+
const bt = M(
|
|
3575
3604
|
() => ({
|
|
3576
|
-
getVariant: () =>
|
|
3605
|
+
getVariant: () => pe,
|
|
3577
3606
|
getCurrentStep: () => {
|
|
3578
|
-
const A =
|
|
3607
|
+
const A = Ke.current;
|
|
3579
3608
|
return A.submitState === "success" ? 8 : A.submitState === "payment" ? 7 : A.activeStep;
|
|
3580
3609
|
},
|
|
3581
3610
|
reset: () => {
|
|
3582
|
-
|
|
3611
|
+
Ke.current.submitState !== "payment" && (xe({}), ct.current(), be(1));
|
|
3583
3612
|
},
|
|
3584
3613
|
goToStep: (A) => {
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3614
|
+
const L = Ke.current, _ = L.cascade.visibleSteps.includes(A), W = L.cascade.currentStep, se = L.submitState === "payment" ? 7 : !_ || A > W ? W : A;
|
|
3615
|
+
Ke.current = { ...L, activeStep: se }, be(se);
|
|
3587
3616
|
}
|
|
3588
3617
|
}),
|
|
3589
|
-
[
|
|
3618
|
+
[pe, xe]
|
|
3590
3619
|
);
|
|
3591
|
-
|
|
3592
|
-
const
|
|
3593
|
-
|
|
3620
|
+
Us(zn, bt, ue);
|
|
3621
|
+
const Gt = V ?? G("booking.regionLabel"), Oe = J.snapshot, Ht = j === "success" && Oe ? /* @__PURE__ */ s(
|
|
3622
|
+
_i,
|
|
3594
3623
|
{
|
|
3595
|
-
payment:
|
|
3624
|
+
payment: Oe.payment,
|
|
3596
3625
|
snapshot: {
|
|
3597
|
-
...
|
|
3598
|
-
slot:
|
|
3599
|
-
details:
|
|
3600
|
-
serviceId: ((
|
|
3626
|
+
...Oe.value,
|
|
3627
|
+
slot: Oe.slot,
|
|
3628
|
+
details: Oe.details,
|
|
3629
|
+
serviceId: ((St = Oe.payment) == null ? void 0 : St.serviceId) ?? Oe.slot.serviceId ?? Oe.value.serviceId
|
|
3601
3630
|
},
|
|
3602
|
-
operators:
|
|
3603
|
-
specialties:
|
|
3631
|
+
operators: _e,
|
|
3632
|
+
specialties: Ce,
|
|
3604
3633
|
services: m,
|
|
3605
|
-
locale:
|
|
3634
|
+
locale: Ze,
|
|
3606
3635
|
mode: de,
|
|
3607
|
-
showModify:
|
|
3608
|
-
onReset: () =>
|
|
3636
|
+
showModify: le && !Oe.payment,
|
|
3637
|
+
onReset: () => bt.reset(),
|
|
3609
3638
|
focusWasLost: () => {
|
|
3610
|
-
const A =
|
|
3611
|
-
return !!(A && !A.isConnected) && (!
|
|
3639
|
+
const A = fe.current, L = document.activeElement;
|
|
3640
|
+
return !!(A && !A.isConnected) && (!L || L === document.body);
|
|
3612
3641
|
},
|
|
3613
3642
|
onModify: () => {
|
|
3614
|
-
|
|
3643
|
+
ct.current(), be(7);
|
|
3615
3644
|
}
|
|
3616
3645
|
}
|
|
3617
|
-
) : null,
|
|
3618
|
-
session:
|
|
3619
|
-
payment:
|
|
3620
|
-
state:
|
|
3621
|
-
billing: (
|
|
3622
|
-
} : void 0, He =
|
|
3646
|
+
) : null, yt = J.activeSession, Be = J.state, ge = yt && Be ? {
|
|
3647
|
+
session: yt,
|
|
3648
|
+
payment: yt.payment,
|
|
3649
|
+
state: Be,
|
|
3650
|
+
billing: (xt = J.snapshot) == null ? void 0 : xt.details.billing
|
|
3651
|
+
} : void 0, He = Be && "phase" in Be && Be.phase === "completion", ee = j === "payment" && ge ? /* @__PURE__ */ v(
|
|
3623
3652
|
"section",
|
|
3624
3653
|
{
|
|
3625
|
-
"aria-labelledby":
|
|
3654
|
+
"aria-labelledby": gt,
|
|
3626
3655
|
"data-component": "booking-payment",
|
|
3627
|
-
"data-payment-status":
|
|
3656
|
+
"data-payment-status": ge.state.status,
|
|
3628
3657
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
3629
3658
|
children: [
|
|
3630
3659
|
/* @__PURE__ */ s(
|
|
3631
3660
|
"h3",
|
|
3632
3661
|
{
|
|
3633
|
-
ref:
|
|
3634
|
-
id:
|
|
3662
|
+
ref: ht,
|
|
3663
|
+
id: gt,
|
|
3635
3664
|
tabIndex: -1,
|
|
3636
3665
|
className: "type-title-card ds:m-0",
|
|
3637
|
-
children:
|
|
3666
|
+
children: G(
|
|
3638
3667
|
He ? "booking.payment.confirming" : "booking.payment.heading"
|
|
3639
3668
|
)
|
|
3640
3669
|
}
|
|
3641
3670
|
),
|
|
3642
|
-
He ? null : /* @__PURE__ */ s("p", { className: "type-body ds:m-0", children:
|
|
3643
|
-
amount:
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3671
|
+
He ? null : /* @__PURE__ */ s("p", { className: "type-body ds:m-0", children: G("booking.payment.noticeBody", {
|
|
3672
|
+
amount: Vt(
|
|
3673
|
+
ge.payment.amountCents,
|
|
3674
|
+
ge.payment.currencyCode,
|
|
3675
|
+
Ze
|
|
3647
3676
|
)
|
|
3648
3677
|
}) }),
|
|
3649
3678
|
/* @__PURE__ */ s(
|
|
3650
3679
|
"p",
|
|
3651
3680
|
{
|
|
3652
3681
|
role: "status",
|
|
3653
|
-
className:
|
|
3654
|
-
children:
|
|
3655
|
-
/* @__PURE__ */ s(
|
|
3656
|
-
/* @__PURE__ */ s("span", { children:
|
|
3682
|
+
className: ge.state.status === "processing" ? "type-body ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-sm)]" : "ds:sr-only",
|
|
3683
|
+
children: ge.state.status === "processing" ? /* @__PURE__ */ v(ce, { children: [
|
|
3684
|
+
/* @__PURE__ */ s(gs, { variant: "pulse", size: "lg", "aria-hidden": "true" }),
|
|
3685
|
+
/* @__PURE__ */ s("span", { children: G(
|
|
3657
3686
|
He ? "booking.payment.confirming" : "booking.payment.processing"
|
|
3658
3687
|
) })
|
|
3659
3688
|
] }) : null
|
|
3660
3689
|
}
|
|
3661
3690
|
),
|
|
3662
|
-
|
|
3663
|
-
|
|
3691
|
+
ge.state.status === "failed" ? /* @__PURE__ */ s(
|
|
3692
|
+
ne,
|
|
3664
3693
|
{
|
|
3665
|
-
ref:
|
|
3694
|
+
ref: vt,
|
|
3666
3695
|
variant: "error",
|
|
3667
3696
|
tabIndex: -1,
|
|
3668
|
-
className:
|
|
3669
|
-
children: /* @__PURE__ */ s(
|
|
3697
|
+
className: Rt,
|
|
3698
|
+
children: /* @__PURE__ */ s(ne.Description, { children: ge.state.error ?? G(
|
|
3670
3699
|
He ? "booking.payment.completionFailed" : "booking.payment.failed"
|
|
3671
3700
|
) })
|
|
3672
3701
|
}
|
|
3673
3702
|
) : null,
|
|
3674
|
-
He ?
|
|
3703
|
+
He ? U == null ? void 0 : U(ge) : C == null ? void 0 : C(ge)
|
|
3675
3704
|
]
|
|
3676
3705
|
}
|
|
3677
|
-
) : null,
|
|
3678
|
-
const A = new Set(
|
|
3679
|
-
var
|
|
3706
|
+
) : null, kt = M(() => {
|
|
3707
|
+
const A = new Set(je(R)), L = m.filter((_) => A.has(_.id)).map((_) => {
|
|
3708
|
+
var W;
|
|
3680
3709
|
return {
|
|
3681
|
-
label:
|
|
3682
|
-
text: ((
|
|
3710
|
+
label: _.label,
|
|
3711
|
+
text: ((W = _.criticalInformationToAccept) == null ? void 0 : W.trim()) ?? ""
|
|
3683
3712
|
};
|
|
3684
|
-
}).filter((
|
|
3685
|
-
if (
|
|
3686
|
-
return
|
|
3713
|
+
}).filter((_) => _.text.length > 0);
|
|
3714
|
+
if (L.length !== 0)
|
|
3715
|
+
return L.length === 1 ? L[0].text : L.map((_) => `${_.label}: ${_.text}`).join(`
|
|
3687
3716
|
|
|
3688
3717
|
`);
|
|
3689
|
-
}, [m,
|
|
3718
|
+
}, [m, R]), ae = M(() => {
|
|
3690
3719
|
if (j === "success" || j === "payment") return null;
|
|
3691
|
-
const A =
|
|
3720
|
+
const A = pe === "accordion" ? Pi : pe === "calendar" ? $i : pe === "flexible" ? qi : pe === "progress" ? Ki : Ri, L = {
|
|
3692
3721
|
cascade: P,
|
|
3693
3722
|
inputs: {
|
|
3694
|
-
specialties:
|
|
3723
|
+
specialties: Ce,
|
|
3695
3724
|
services: m,
|
|
3696
|
-
operators:
|
|
3697
|
-
availableDates:
|
|
3725
|
+
operators: _e,
|
|
3726
|
+
availableDates: h,
|
|
3698
3727
|
availableSlots: l,
|
|
3699
|
-
nextAvailableDate:
|
|
3728
|
+
nextAvailableDate: c
|
|
3700
3729
|
},
|
|
3701
|
-
value:
|
|
3702
|
-
onChange:
|
|
3703
|
-
onSubmit:
|
|
3730
|
+
value: R,
|
|
3731
|
+
onChange: xe,
|
|
3732
|
+
onSubmit: at,
|
|
3704
3733
|
policy: { country: t, lockedOperatorId: i },
|
|
3705
3734
|
detailsProps: {
|
|
3706
3735
|
requireCodiceFiscale: u,
|
|
3707
|
-
requireDateOfBirth:
|
|
3736
|
+
requireDateOfBirth: b,
|
|
3708
3737
|
requireInsuranceNumber: x,
|
|
3709
|
-
insuranceType:
|
|
3738
|
+
insuranceType: R.insuranceType,
|
|
3710
3739
|
showNote: N,
|
|
3711
3740
|
showReturningPatientFlag: S,
|
|
3712
3741
|
privacyPolicyUrl: I,
|
|
3713
3742
|
termsUrl: w,
|
|
3714
3743
|
practiceConsent: O,
|
|
3715
|
-
criticalInformationToAccept:
|
|
3716
|
-
payment:
|
|
3744
|
+
criticalInformationToAccept: kt,
|
|
3745
|
+
payment: J.payment,
|
|
3717
3746
|
paymentTermsUrl: T,
|
|
3718
|
-
paymentBlocked:
|
|
3747
|
+
paymentBlocked: J.blocked,
|
|
3719
3748
|
billingInDetails: k,
|
|
3720
3749
|
paymentNoticeStyle: E,
|
|
3721
|
-
validateCodiceFiscale:
|
|
3722
|
-
validateInsuranceNumber:
|
|
3723
|
-
confirmationChannels:
|
|
3724
|
-
defaultConfirmationChannels:
|
|
3725
|
-
|
|
3750
|
+
validateCodiceFiscale: q,
|
|
3751
|
+
validateInsuranceNumber: y,
|
|
3752
|
+
confirmationChannels: K,
|
|
3753
|
+
defaultConfirmationChannels: B,
|
|
3754
|
+
singleConfirmationChannel: Se,
|
|
3755
|
+
submitError: Ve ?? (j === "error" ? G("booking.payment.submitFailed") : void 0)
|
|
3726
3756
|
},
|
|
3727
|
-
emptyServicesSlot:
|
|
3728
|
-
onboardingIncompleteSlot:
|
|
3729
|
-
loadingDates:
|
|
3730
|
-
loadingSlots:
|
|
3731
|
-
onDateSelect:
|
|
3732
|
-
onWindowChange:
|
|
3733
|
-
datePickerStyle:
|
|
3734
|
-
specialtyPickerStyle:
|
|
3735
|
-
servicePickerStyle:
|
|
3736
|
-
showServiceDuration:
|
|
3737
|
-
operatorPickerStyle:
|
|
3738
|
-
submitting:
|
|
3739
|
-
locale:
|
|
3740
|
-
activeStep:
|
|
3741
|
-
setActiveStep:
|
|
3742
|
-
agentIdBase:
|
|
3757
|
+
emptyServicesSlot: Le,
|
|
3758
|
+
onboardingIncompleteSlot: Ue,
|
|
3759
|
+
loadingDates: Ne,
|
|
3760
|
+
loadingSlots: Me,
|
|
3761
|
+
onDateSelect: Ye,
|
|
3762
|
+
onWindowChange: ie,
|
|
3763
|
+
datePickerStyle: Fe,
|
|
3764
|
+
specialtyPickerStyle: Pe,
|
|
3765
|
+
servicePickerStyle: Q,
|
|
3766
|
+
showServiceDuration: re,
|
|
3767
|
+
operatorPickerStyle: Ie,
|
|
3768
|
+
submitting: X || j === "submitting",
|
|
3769
|
+
locale: Ze,
|
|
3770
|
+
activeStep: me,
|
|
3771
|
+
setActiveStep: be,
|
|
3772
|
+
agentIdBase: ue
|
|
3743
3773
|
};
|
|
3744
|
-
return /* @__PURE__ */ s(A, { ...
|
|
3774
|
+
return /* @__PURE__ */ s(A, { ...L });
|
|
3745
3775
|
}, [
|
|
3746
3776
|
j,
|
|
3747
|
-
|
|
3748
|
-
|
|
3777
|
+
J.payment,
|
|
3778
|
+
J.blocked,
|
|
3749
3779
|
T,
|
|
3750
|
-
|
|
3751
|
-
|
|
3780
|
+
G,
|
|
3781
|
+
pe,
|
|
3752
3782
|
P,
|
|
3753
|
-
|
|
3783
|
+
Ce,
|
|
3754
3784
|
m,
|
|
3755
|
-
|
|
3756
|
-
|
|
3785
|
+
_e,
|
|
3786
|
+
h,
|
|
3757
3787
|
l,
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3788
|
+
c,
|
|
3789
|
+
R,
|
|
3790
|
+
xe,
|
|
3791
|
+
at,
|
|
3762
3792
|
t,
|
|
3763
3793
|
i,
|
|
3764
3794
|
u,
|
|
3765
|
-
|
|
3795
|
+
b,
|
|
3766
3796
|
x,
|
|
3767
3797
|
k,
|
|
3768
3798
|
E,
|
|
3769
|
-
|
|
3799
|
+
Ve,
|
|
3770
3800
|
N,
|
|
3771
3801
|
S,
|
|
3772
3802
|
I,
|
|
3773
3803
|
w,
|
|
3774
3804
|
O,
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3805
|
+
kt,
|
|
3806
|
+
q,
|
|
3807
|
+
y,
|
|
3808
|
+
K,
|
|
3809
|
+
B,
|
|
3810
|
+
Se,
|
|
3811
|
+
Le,
|
|
3812
|
+
Ue,
|
|
3813
|
+
Ne,
|
|
3814
|
+
Me,
|
|
3815
|
+
Ye,
|
|
3816
|
+
ie,
|
|
3817
|
+
Fe,
|
|
3818
|
+
Pe,
|
|
3780
3819
|
Q,
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
De,
|
|
3784
|
-
We,
|
|
3785
|
-
Ke,
|
|
3786
|
-
Z,
|
|
3787
|
-
ze,
|
|
3788
|
-
ce,
|
|
3820
|
+
re,
|
|
3821
|
+
Ie,
|
|
3789
3822
|
X,
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
pe,
|
|
3794
|
-
le
|
|
3823
|
+
Ze,
|
|
3824
|
+
me,
|
|
3825
|
+
ue
|
|
3795
3826
|
]);
|
|
3796
3827
|
return /* @__PURE__ */ v(
|
|
3797
3828
|
"div",
|
|
3798
3829
|
{
|
|
3799
|
-
ref:
|
|
3830
|
+
ref: oe,
|
|
3800
3831
|
role: "region",
|
|
3801
|
-
"aria-label":
|
|
3802
|
-
id:
|
|
3832
|
+
"aria-label": Gt,
|
|
3833
|
+
id: ue,
|
|
3803
3834
|
"data-component": "booking",
|
|
3804
|
-
"data-component-id":
|
|
3805
|
-
"data-variant":
|
|
3806
|
-
className:
|
|
3807
|
-
variant:
|
|
3808
|
-
surface:
|
|
3809
|
-
className:
|
|
3835
|
+
"data-component-id": ue,
|
|
3836
|
+
"data-variant": pe,
|
|
3837
|
+
className: Si({
|
|
3838
|
+
variant: pe,
|
|
3839
|
+
surface: we,
|
|
3840
|
+
className: zt
|
|
3810
3841
|
}),
|
|
3811
3842
|
tabIndex: -1,
|
|
3812
3843
|
onFocus: (A) => {
|
|
3813
|
-
|
|
3844
|
+
fe.current = A.target, nt == null || nt(A);
|
|
3814
3845
|
},
|
|
3815
3846
|
onBlur: (A) => {
|
|
3816
|
-
const
|
|
3847
|
+
const L = A.target;
|
|
3817
3848
|
window.setTimeout(() => {
|
|
3818
|
-
var
|
|
3819
|
-
const
|
|
3820
|
-
|
|
3821
|
-
}),
|
|
3849
|
+
var W;
|
|
3850
|
+
const _ = document.activeElement;
|
|
3851
|
+
fe.current === L && L.isConnected && !(_ && ((W = oe.current) != null && W.contains(_))) && (fe.current = null);
|
|
3852
|
+
}), it == null || it(A);
|
|
3822
3853
|
},
|
|
3823
|
-
...
|
|
3854
|
+
...wt,
|
|
3824
3855
|
children: [
|
|
3825
|
-
/* @__PURE__ */ s("div", { role: "status", className: "ds:sr-only", children:
|
|
3856
|
+
/* @__PURE__ */ s("div", { role: "status", className: "ds:sr-only", children: Xe }),
|
|
3826
3857
|
/* @__PURE__ */ v(
|
|
3827
3858
|
"div",
|
|
3828
3859
|
{
|
|
@@ -3835,23 +3866,23 @@ const Ki = ms(
|
|
|
3835
3866
|
"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
|
|
3836
3867
|
].join(" "),
|
|
3837
3868
|
children: [
|
|
3838
|
-
/* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children:
|
|
3839
|
-
/* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--foreground)] ds:m-0", children:
|
|
3869
|
+
/* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: G("booking.regionLabel") }),
|
|
3870
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--foreground)] ds:m-0", children: G("booking.headingSubtitle") })
|
|
3840
3871
|
]
|
|
3841
3872
|
}
|
|
3842
3873
|
),
|
|
3843
|
-
|
|
3844
|
-
Ht ??
|
|
3874
|
+
J.cancelled ? /* @__PURE__ */ s(ne, { variant: "info", children: /* @__PURE__ */ s(ne.Description, { children: G("booking.payment.cancelled") }) }) : null,
|
|
3875
|
+
Ht ?? ee ?? ae
|
|
3845
3876
|
]
|
|
3846
3877
|
}
|
|
3847
3878
|
);
|
|
3848
3879
|
}
|
|
3849
3880
|
);
|
|
3850
|
-
|
|
3881
|
+
Ui.displayName = "Booking";
|
|
3851
3882
|
export {
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3883
|
+
Ui as B,
|
|
3884
|
+
Zt as C,
|
|
3885
|
+
Re as O,
|
|
3886
|
+
zn as b
|
|
3856
3887
|
};
|
|
3857
|
-
//# sourceMappingURL=booking-
|
|
3888
|
+
//# sourceMappingURL=booking-C-hRVLPy.js.map
|