@alfadocs/ui-kit 0.25.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/_chunks/{agenda-card-BmpaUG1h.js → agenda-card-CznB7K8e.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-DiInnVqk.js → agenda-tray-C_bha7oK.js} +4 -4
  3. package/dist/_chunks/{ai-prompt-input-B5MdixzR.js → ai-prompt-input-Bka3jX3i.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-CUi2UCbY.js → alia-sidebar-CnvXq95r.js} +92 -109
  5. package/dist/_chunks/{audio-recorder-D4xM3H5i.js → audio-recorder-OB6IV9B1.js} +2 -2
  6. package/dist/_chunks/{autocomplete-C7xq06bP.js → autocomplete-CUh0f7Dj.js} +2 -2
  7. package/dist/_chunks/{avatar-BpFohgWG.js → avatar-D_H4emLo.js} +7 -7
  8. package/dist/_chunks/{benefit-card-DXmrAyfn.js → benefit-card-CjYM8vNr.js} +29 -29
  9. package/dist/_chunks/booking-BYuc_8HV.js +2250 -0
  10. package/dist/_chunks/{calendar-zy0tUUVG.js → calendar-WWNx448i.js} +114 -142
  11. package/dist/_chunks/{card-C353dU-H.js → card-DKTMLVrw.js} +11 -11
  12. package/dist/_chunks/{carousel.agent-DnPiqijR.js → carousel.agent-C9swH-Uf.js} +2 -2
  13. package/dist/_chunks/{chat-input-B3XmFGDw.js → chat-input-BfDcz1Yi.js} +2 -2
  14. package/dist/_chunks/{chat-message-W3k8rLOA.js → chat-message-fg221-yx.js} +2 -2
  15. package/dist/_chunks/{command-palette-DkL-aW4O.js → command-palette-11BieSNq.js} +2 -2
  16. package/dist/_chunks/{contact-card-CjG7c-1q.js → contact-card-DYbp--s-.js} +3 -3
  17. package/dist/_chunks/{date-picker-BIoSLRly.js → date-picker-D0Ry1dMz.js} +26 -27
  18. package/dist/_chunks/{date-range-picker-9gANFNG9.js → date-range-picker-DYgHzMOo.js} +19 -20
  19. package/dist/_chunks/{date-time-picker-DG7BiGdb.js → date-time-picker-CGmGtcyc.js} +10 -11
  20. package/dist/_chunks/{description-list-Bsga4IW8.js → description-list-yl3y3QKg.js} +34 -24
  21. package/dist/_chunks/{dialog-DUomPCRS.js → dialog-BBXqpZIt.js} +2 -2
  22. package/dist/_chunks/{editable-currency-cell-renderer-DJB5MxAI.js → editable-currency-cell-renderer-DSReCae7.js} +7 -7
  23. package/dist/_chunks/{empty-state-3CLJIXSj.js → empty-state-BLy7tigq.js} +13 -33
  24. package/dist/_chunks/eye-LHlSU38h.js +21 -0
  25. package/dist/_chunks/{freemium-paywall-CM6V1zNf.js → freemium-paywall-B9c8Ylww.js} +11 -11
  26. package/dist/_chunks/{header-DqmKROIY.js → header-CkMb1TZS.js} +24 -24
  27. package/dist/_chunks/heart-pulse-CvuyFKHB.js +21 -0
  28. package/dist/_chunks/icon-button-BRHSSFmZ.js +70 -0
  29. package/dist/_chunks/{isSameDay-ecuM8PBB.js → isSameDay-DHG8Xade.js} +4 -4
  30. package/dist/_chunks/{key-value-pair-DBuOCtIc.js → key-value-pair-CqeKiP__.js} +2 -2
  31. package/dist/_chunks/{link-DmM5IevO.js → link-DrD_cRUg.js} +50 -45
  32. package/dist/_chunks/{locale-picker-BxEUUPW7.js → locale-picker-BHxbTNmR.js} +297 -208
  33. package/dist/_chunks/{map-view-CcwycFQX.js → map-view-DyB8tr6c.js} +9 -9
  34. package/dist/_chunks/{matrix-rain-CRPMXcVx.js → matrix-rain-sDOUUwZp.js} +35 -35
  35. package/dist/_chunks/{message-card-i61k1TGc.js → message-card-DjRtA8GG.js} +3 -3
  36. package/dist/_chunks/{message-tray-DrV7G-wR.js → message-tray-DfsAMncP.js} +3 -3
  37. package/dist/_chunks/monitor-D-SFdbrU.js +16 -0
  38. package/dist/_chunks/{notification-card-ejOw5g6g.js → notification-card-B_847w5g.js} +3 -3
  39. package/dist/_chunks/{notification-tray-D_69dXFY.js → notification-tray-6f7smmT1.js} +22 -19
  40. package/dist/_chunks/parseISO-Dk4xa7q6.js +120 -0
  41. package/dist/_chunks/patient-search-BhlxYAI3.js +1102 -0
  42. package/dist/_chunks/patient-shell-CAXYzbRw.js +173 -0
  43. package/dist/_chunks/{payment-form-F7uh0Rqr.js → payment-form-Ds3rxvad.js} +2 -2
  44. package/dist/_chunks/{pdf-viewer-CuYaVR1I.js → pdf-viewer-CIuaocnq.js} +2 -2
  45. package/dist/_chunks/{popover--derJ_wq.js → popover-D0slaBB9.js} +17 -13
  46. package/dist/_chunks/{privacy-lock-BKsI6ReN.js → privacy-lock-BI4vi9Ud.js} +2 -2
  47. package/dist/_chunks/public-footer.agent-CA29gxHJ.js +516 -0
  48. package/dist/_chunks/{public-header.agent-BQ3r6Hgq.js → public-header.agent-5U3S9QiC.js} +49 -41
  49. package/dist/_chunks/react-day-picker-D3yzgvDB.js +3127 -0
  50. package/dist/_chunks/{recaptcha-widget-Kp1XntuE.js → recaptcha-widget-BtBNb6tB.js} +2 -2
  51. package/dist/_chunks/reviews-panel-CFttsfuC.js +513 -0
  52. package/dist/_chunks/{search-bar-DORSAzNt.js → search-bar-BRMW1-WG.js} +2 -2
  53. package/dist/_chunks/{search-input-BtEJAJHa.js → search-input-CIA6pPfn.js} +2 -2
  54. package/dist/_chunks/{sheet-BT0izeoI.js → sheet-D8M8hf8B.js} +2 -2
  55. package/dist/_chunks/{sign-in-with-alfadocs-button-4zZC-I6y.js → sign-in-with-alfadocs-button-BI0fVonM.js} +2 -2
  56. package/dist/_chunks/slot-grid-B2zprPcv.js +387 -0
  57. package/dist/_chunks/sparkles-CuYXqQLg.js +23 -0
  58. package/dist/_chunks/{spinner-DirtWZNG.js → spinner-CCByyvcb.js} +2 -2
  59. package/dist/_chunks/stepper-accordion-BfS6lUB9.js +257 -0
  60. package/dist/_chunks/stepper-accordion.agent-C4quJ-MD.js +71 -0
  61. package/dist/_chunks/stethoscope-DT5qCW8Y.js +18 -0
  62. package/dist/_chunks/{sun-Eweh5fvi.js → sun-BuXE0xUS.js} +3 -15
  63. package/dist/_chunks/{task-tray-B3A2fRGR.js → task-tray-Bcmrrs8m.js} +3 -3
  64. package/dist/_chunks/{theme-toggle-FrotC2VI.js → theme-toggle-nPzb378f.js} +37 -36
  65. package/dist/_chunks/{timeline-jmd7lfDf.js → timeline-CR7HjZCK.js} +3 -3
  66. package/dist/_chunks/{toast.agent-32WNQ-_x.js → toast.agent-CTF6nIj5.js} +2 -2
  67. package/dist/_chunks/{transcript-panel-DUrjx5sa.js → transcript-panel-QUQ9XJmf.js} +2 -2
  68. package/dist/_chunks/{use-password-requirements-C9vKBSVn.js → use-password-requirements-E0sSfx5X.js} +38 -53
  69. package/dist/_chunks/use-theme-C2dHKUAN.js +145 -0
  70. package/dist/_chunks/{workflow-map-BR6txfFX.js → workflow-map-BKsKdYvZ.js} +5 -5
  71. package/dist/agent-catalog.json +151 -51
  72. package/dist/components/agenda-card/index.js +1 -1
  73. package/dist/components/agenda-tray/index.js +1 -1
  74. package/dist/components/ai-prompt-input/index.js +1 -1
  75. package/dist/components/audio-recorder/index.js +1 -1
  76. package/dist/components/autocomplete/index.js +1 -1
  77. package/dist/components/avatar/index.js +1 -1
  78. package/dist/components/benefit-card/index.js +1 -1
  79. package/dist/components/booking/booking-types.d.ts +145 -0
  80. package/dist/components/booking/booking.agent.d.ts +4 -0
  81. package/dist/components/booking/booking.d.ts +6 -0
  82. package/dist/components/booking/cascade.d.ts +96 -0
  83. package/dist/components/booking/details-form.d.ts +32 -0
  84. package/dist/components/booking/index.d.ts +5 -0
  85. package/dist/components/booking/index.js +8 -0
  86. package/dist/components/button/index.js +1 -1
  87. package/dist/components/calendar/index.js +1 -1
  88. package/dist/components/card/index.js +1 -1
  89. package/dist/components/carousel/index.js +1 -1
  90. package/dist/components/chat-input/index.js +1 -1
  91. package/dist/components/chat-message/index.js +1 -1
  92. package/dist/components/checkbox/checkbox.d.ts +6 -2
  93. package/dist/components/command-palette/index.js +1 -1
  94. package/dist/components/contact-card/index.js +1 -1
  95. package/dist/components/data-table/index.js +1 -1
  96. package/dist/components/date-picker/index.js +1 -1
  97. package/dist/components/date-range-picker/index.js +1 -1
  98. package/dist/components/date-time-picker/index.js +1 -1
  99. package/dist/components/description-list/index.js +1 -1
  100. package/dist/components/dialog/index.js +1 -1
  101. package/dist/components/empty-state/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/header/index.js +1 -1
  104. package/dist/components/header-settings/index.js +16 -15
  105. package/dist/components/icon-button/index.js +1 -1
  106. package/dist/components/index.d.ts +4 -1
  107. package/dist/components/key-value-pair/index.js +1 -1
  108. package/dist/components/link/index.js +1 -1
  109. package/dist/components/link/link.d.ts +7 -0
  110. package/dist/components/locale-picker/index.js +1 -1
  111. package/dist/components/map-view/index.js +1 -1
  112. package/dist/components/matrix-rain/index.js +1 -1
  113. package/dist/components/message-card/index.js +1 -1
  114. package/dist/components/message-tray/index.js +1 -1
  115. package/dist/components/notification-card/index.js +1 -1
  116. package/dist/components/notification-tray/index.js +1 -1
  117. package/dist/components/password-input/index.js +1 -1
  118. package/dist/components/patient-search/index.d.ts +4 -0
  119. package/dist/components/patient-search/index.js +6 -0
  120. package/dist/components/patient-search/patient-search.agent.d.ts +4 -0
  121. package/dist/components/patient-search/patient-search.d.ts +103 -0
  122. package/dist/components/payment-form/index.js +1 -1
  123. package/dist/components/pdf-viewer/index.js +1 -1
  124. package/dist/components/popover/index.js +1 -1
  125. package/dist/components/privacy-lock/index.js +1 -1
  126. package/dist/components/public-footer/index.d.ts +6 -0
  127. package/dist/components/public-footer/index.js +10 -0
  128. package/dist/components/public-footer/legal-urls.d.ts +18 -0
  129. package/dist/components/public-footer/public-footer.agent.d.ts +4 -0
  130. package/dist/components/public-footer/public-footer.d.ts +51 -0
  131. package/dist/components/public-footer/socials.d.ts +9 -0
  132. package/dist/components/public-header/index.js +1 -1
  133. package/dist/components/recaptcha-widget/index.js +1 -1
  134. package/dist/components/reviews-panel/index.d.ts +4 -0
  135. package/dist/components/reviews-panel/index.js +6 -0
  136. package/dist/components/reviews-panel/reviews-panel.agent.d.ts +4 -0
  137. package/dist/components/reviews-panel/reviews-panel.d.ts +76 -0
  138. package/dist/components/search-bar/index.js +1 -1
  139. package/dist/components/search-input/index.js +1 -1
  140. package/dist/components/sheet/index.js +1 -1
  141. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  142. package/dist/components/slot-grid/index.js +1 -1
  143. package/dist/components/spinner/index.js +1 -1
  144. package/dist/components/stepper-accordion/index.js +4 -3
  145. package/dist/components/task-tray/index.js +1 -1
  146. package/dist/components/theme-toggle/index.js +1 -1
  147. package/dist/components/timeline/index.js +1 -1
  148. package/dist/components/toast/index.js +1 -1
  149. package/dist/components/transcript-panel/index.js +1 -1
  150. package/dist/components/workflow/index.js +1 -1
  151. package/dist/hooks/index.js +1 -1
  152. package/dist/i18n/config.js +4923 -49
  153. package/dist/i18n/locales/ar.d.ts +272 -0
  154. package/dist/i18n/locales/de.d.ts +272 -0
  155. package/dist/i18n/locales/el.d.ts +272 -0
  156. package/dist/i18n/locales/es.d.ts +272 -0
  157. package/dist/i18n/locales/fr.d.ts +272 -0
  158. package/dist/i18n/locales/hi.d.ts +272 -0
  159. package/dist/i18n/locales/ja.d.ts +272 -0
  160. package/dist/i18n/locales/nl.d.ts +272 -0
  161. package/dist/i18n/locales/pl.d.ts +272 -0
  162. package/dist/i18n/locales/pt.d.ts +272 -0
  163. package/dist/i18n/locales/ro.d.ts +272 -0
  164. package/dist/i18n/locales/ru.d.ts +272 -0
  165. package/dist/i18n/locales/sq.d.ts +272 -0
  166. package/dist/i18n/locales/sv.d.ts +272 -0
  167. package/dist/i18n/locales/tr.d.ts +272 -0
  168. package/dist/i18n/locales/zh.d.ts +272 -0
  169. package/dist/i18n/resources.d.ts +544 -0
  170. package/dist/index.js +364 -348
  171. package/dist/locales/ar.json +273 -1
  172. package/dist/locales/de.json +273 -1
  173. package/dist/locales/el.json +273 -1
  174. package/dist/locales/en.json +273 -1
  175. package/dist/locales/es.json +273 -1
  176. package/dist/locales/fr.json +273 -1
  177. package/dist/locales/hi.json +273 -1
  178. package/dist/locales/it.json +273 -1
  179. package/dist/locales/ja.json +273 -1
  180. package/dist/locales/nl.json +273 -1
  181. package/dist/locales/pl.json +273 -1
  182. package/dist/locales/pt.json +273 -1
  183. package/dist/locales/ro.json +273 -1
  184. package/dist/locales/ru.json +273 -1
  185. package/dist/locales/sq.json +273 -1
  186. package/dist/locales/sv.json +273 -1
  187. package/dist/locales/tr.json +273 -1
  188. package/dist/locales/zh.json +273 -1
  189. package/dist/patterns/alia-assistant/index.js +1 -1
  190. package/dist/patterns/patient-shell/index.js +1 -1
  191. package/dist/tokens.css +1 -1
  192. package/package.json +17 -1
  193. package/dist/_chunks/icon-button-C4CGcYuz.js +0 -54
  194. package/dist/_chunks/isSameMonth-5wNF2f4I.js +0 -1307
  195. package/dist/_chunks/patient-shell-B164drIa.js +0 -173
  196. package/dist/_chunks/react-day-picker-C5F3-TTX.js +0 -1827
  197. package/dist/_chunks/slot-grid-CgpYgBkW.js +0 -502
  198. package/dist/_chunks/stepper-C-sIpRRU.js +0 -7
  199. package/dist/_chunks/stepper-accordion.agent-ckKYZCIP.js +0 -322
  200. package/dist/_chunks/stepper-calendar-BLOJUE0-.js +0 -648
  201. package/dist/_chunks/use-theme-B1cwAXJR.js +0 -145
  202. package/dist/components/stepper-calendar/index.d.ts +0 -4
  203. package/dist/components/stepper-calendar/index.js +0 -6
  204. package/dist/components/stepper-calendar/stepper-calendar.agent.d.ts +0 -4
  205. package/dist/components/stepper-calendar/stepper-calendar.d.ts +0 -62
@@ -0,0 +1,2250 @@
1
+ import { jsxs as g, jsx as a, Fragment as ie } from "react/jsx-runtime";
2
+ import { forwardRef as Ve, useId as Fe, useState as z, useCallback as ee, useRef as ne, useEffect as se, useMemo as I, useImperativeHandle as ot } from "react";
3
+ import { c as xe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as M, Trans as rt } from "react-i18next";
5
+ import { u as dt } from "./registry-C9nwlNyL.js";
6
+ import { B as oe } from "./button-DD_0Xdmr.js";
7
+ import { C as we } from "./checkbox-mwbrPZDY.js";
8
+ import { C as lt } from "./checkbox-group-Bwmt1ovQ.js";
9
+ import { D as ct } from "./date-picker-D0Ry1dMz.js";
10
+ import { E as mt } from "./email-input-DvJ_kPKL.js";
11
+ import { F as U } from "./form-field-BOm9hK35.js";
12
+ import { P as ut } from "./phone-input-DKSHX7NQ.js";
13
+ import { T as pt } from "./text-area-D5GAe8pV.js";
14
+ import { T as fe } from "./text-input-CakysYnD.js";
15
+ import { S as gt } from "./spinner-CCByyvcb.js";
16
+ import { A as $ } from "./alert-ywPR59NE.js";
17
+ import { I as Be } from "./icon-button-BRHSSFmZ.js";
18
+ import { S as Se } from "./select-C92AT_OZ.js";
19
+ import { S as ye } from "./skeleton-CZbwyJAA.js";
20
+ import { E as Re } from "./empty-state-BLy7tigq.js";
21
+ import { S as ft } from "./stepper-accordion-BfS6lUB9.js";
22
+ import { S as ht } from "./stepper-progress-jFY8BSf7.js";
23
+ import { p as Q } from "./parseISO-Dk4xa7q6.js";
24
+ import { o as ze, f as me, d as vt, h as be, q as he } from "./react-day-picker-D3yzgvDB.js";
25
+ import { C as bt } from "./chevron-left-CX1jqD2M.js";
26
+ import { C as yt } from "./chevron-right-BrpYejk0.js";
27
+ import { i as Oe } from "./isSameDay-DHG8Xade.js";
28
+ import { c as O } from "./createLucideIcon-CrFbzy84.js";
29
+ import { M as kt, S as xt } from "./sun-BuXE0xUS.js";
30
+ import { S as St } from "./stethoscope-DT5qCW8Y.js";
31
+ import { H as Nt } from "./heart-pulse-CvuyFKHB.js";
32
+ import { E as It } from "./eye-LHlSU38h.js";
33
+ import { S as wt } from "./sparkles-CuYXqQLg.js";
34
+ /**
35
+ * @license lucide-react v1.8.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */
40
+ const Ct = [
41
+ [
42
+ "path",
43
+ {
44
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
45
+ key: "169zse"
46
+ }
47
+ ]
48
+ ], Mt = O("activity", Ct);
49
+ /**
50
+ * @license lucide-react v1.8.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */
55
+ const Dt = [
56
+ ["path", { d: "M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5", key: "1u7htd" }],
57
+ ["path", { d: "M15 12h.01", key: "1k8ypt" }],
58
+ [
59
+ "path",
60
+ {
61
+ d: "M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",
62
+ key: "11xh7x"
63
+ }
64
+ ],
65
+ ["path", { d: "M9 12h.01", key: "157uk2" }]
66
+ ], Tt = O("baby", Dt);
67
+ /**
68
+ * @license lucide-react v1.8.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */
73
+ const _t = [
74
+ [
75
+ "path",
76
+ {
77
+ d: "M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",
78
+ key: "w610uw"
79
+ }
80
+ ]
81
+ ], At = O("bone", _t);
82
+ /**
83
+ * @license lucide-react v1.8.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */
88
+ const Bt = [
89
+ ["path", { d: "M12 18V5", key: "adv99a" }],
90
+ ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
91
+ ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
92
+ ["path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77", key: "iwvgf7" }],
93
+ ["path", { d: "M18 18a4 4 0 0 0 2-7.464", key: "efp6ie" }],
94
+ ["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
95
+ ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
96
+ ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
97
+ ], Ot = O("brain", Bt);
98
+ /**
99
+ * @license lucide-react v1.8.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */
104
+ const Et = [
105
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
106
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
107
+ ["path", { d: "M3 10h18", key: "8toen8" }],
108
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
109
+ ["path", { d: "M17 14h-6", key: "bkmgh3" }],
110
+ ["path", { d: "M13 18H7", key: "bb0bb7" }],
111
+ ["path", { d: "M7 14h.01", key: "1qa3f1" }],
112
+ ["path", { d: "M17 18h.01", key: "1bdyru" }]
113
+ ], Pt = O("calendar-range", Et);
114
+ /**
115
+ * @license lucide-react v1.8.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+ const Lt = [
121
+ ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
122
+ [
123
+ "path",
124
+ {
125
+ d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
126
+ key: "116196"
127
+ }
128
+ ],
129
+ ["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
130
+ ], Vt = O("clipboard-check", Lt);
131
+ /**
132
+ * @license lucide-react v1.8.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */
137
+ const Ft = [
138
+ ["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" }],
139
+ ["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
140
+ ], Rt = O("ear", Ft);
141
+ /**
142
+ * @license lucide-react v1.8.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */
147
+ const zt = [
148
+ ["path", { d: "M6 18h8", key: "1borvv" }],
149
+ ["path", { d: "M3 22h18", key: "8prr45" }],
150
+ ["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
151
+ ["path", { d: "M9 14h2", key: "197e7h" }],
152
+ ["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
153
+ ["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
154
+ ], $t = O("microscope", zt);
155
+ /**
156
+ * @license lucide-react v1.8.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */
161
+ const Kt = [
162
+ [
163
+ "path",
164
+ { 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" }
165
+ ],
166
+ ["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
167
+ ], jt = O("pill", Kt);
168
+ /**
169
+ * @license lucide-react v1.8.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */
174
+ const qt = [
175
+ ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
176
+ ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
177
+ ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
178
+ ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
179
+ ["path", { d: "M7 12h10", key: "b7w52i" }]
180
+ ], Ht = O("scan-line", qt);
181
+ /**
182
+ * @license lucide-react v1.8.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */
187
+ const Gt = [
188
+ ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
189
+ ["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
190
+ ["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
191
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
192
+ ["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
193
+ ], Ut = O("scissors", Gt);
194
+ /**
195
+ * @license lucide-react v1.8.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */
200
+ const Yt = [
201
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
202
+ ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
203
+ ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
204
+ ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
205
+ ], Zt = O("smile", Yt);
206
+ /**
207
+ * @license lucide-react v1.8.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */
212
+ const Jt = [
213
+ ["path", { d: "M12 10V2", key: "16sf7g" }],
214
+ ["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
215
+ ["path", { d: "M2 18h2", key: "j10viu" }],
216
+ ["path", { d: "M20 18h2", key: "wocana" }],
217
+ ["path", { d: "m19.07 10.93-1.41 1.41", key: "15zs5n" }],
218
+ ["path", { d: "M22 22H2", key: "19qnx5" }],
219
+ ["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
220
+ ["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
221
+ ], Xt = O("sunset", Jt);
222
+ /**
223
+ * @license lucide-react v1.8.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */
228
+ const Wt = [
229
+ ["path", { d: "m18 2 4 4", key: "22kx64" }],
230
+ ["path", { d: "m17 7 3-3", key: "1w1zoj" }],
231
+ ["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" }],
232
+ ["path", { d: "m9 11 4 4", key: "rovt3i" }],
233
+ ["path", { d: "m5 19-3 3", key: "59f2uf" }],
234
+ ["path", { d: "m14 4 6 6", key: "yqp9t2" }]
235
+ ], Ee = O("syringe", Wt);
236
+ function Qt(e, t, s) {
237
+ return ze(e, -1, s);
238
+ }
239
+ const ea = {
240
+ id: "booking",
241
+ capabilities: ["navigate", "view_change"],
242
+ state: {
243
+ variant: {
244
+ type: "string",
245
+ descriptionKey: "ui.agent.booking.state.variant",
246
+ description: "Active variant — one of `inline-list`, `accordion`, `calendar`, `flexible`, `progress`.",
247
+ read: (e) => e.getVariant()
248
+ }
249
+ },
250
+ actions: {
251
+ reset: {
252
+ safety: "write",
253
+ descriptionKey: "ui.agent.booking.actions.reset",
254
+ description: "Clear the booking value back to an empty state. Use to abandon an in-progress flow.",
255
+ invoke: (e) => {
256
+ e.reset();
257
+ }
258
+ },
259
+ goto_step: {
260
+ safety: "read",
261
+ argsType: "{ step: 1 | 2 | 3 | 4 | 5 | 6 | 7 }",
262
+ descriptionKey: "ui.agent.booking.actions.gotoStep",
263
+ description: "Jump to the given step. Implementations may clamp to the first incomplete step if the requested one is not reachable yet.",
264
+ invoke: (e, t) => {
265
+ e.goToStep(t.step);
266
+ }
267
+ }
268
+ },
269
+ domHooks: {
270
+ root: {
271
+ attr: "data-component",
272
+ value: "booking",
273
+ description: "Marks the Booking root region."
274
+ },
275
+ instanceId: {
276
+ attr: "data-component-id",
277
+ sourceProp: "id",
278
+ description: "Sourced from the id prop."
279
+ }
280
+ }
281
+ }, Me = [
282
+ "email",
283
+ "whatsapp",
284
+ "sms"
285
+ ], ue = "all", ta = "de";
286
+ function aa(e) {
287
+ return [...e.lockedOperatorId ? e.specialties.filter(
288
+ (s) => {
289
+ var n;
290
+ return (n = s.operatorIds) == null ? void 0 : n.includes(e.lockedOperatorId);
291
+ }
292
+ ) : e.specialties].sort((s, n) => {
293
+ const i = s.sequenceNumber ?? Number.POSITIVE_INFINITY, o = n.sequenceNumber ?? Number.POSITIVE_INFINITY;
294
+ return i - o;
295
+ });
296
+ }
297
+ function sa(e) {
298
+ let t = e.services;
299
+ return e.lockedOperatorId && (t = t.filter(
300
+ (s) => {
301
+ var n;
302
+ return (n = s.operatorIds) == null ? void 0 : n.includes(e.lockedOperatorId);
303
+ }
304
+ )), e.useSpecialties && e.value.specialtyId && (t = t.filter((s) => s.specialtyId === e.value.specialtyId)), t;
305
+ }
306
+ function na(e) {
307
+ if (e.useSpecialties && e.value.specialtyId) {
308
+ const t = e.value.specialtyId;
309
+ return e.operators.filter(
310
+ (s) => {
311
+ var n;
312
+ return (n = s.specialtyIds) == null ? void 0 : n.includes(t);
313
+ }
314
+ );
315
+ }
316
+ if (!e.useSpecialties && e.value.serviceId) {
317
+ const t = e.value.serviceId;
318
+ return e.operators.filter(
319
+ (s) => {
320
+ var n;
321
+ return (n = s.appointmentBookingReasonIds) == null ? void 0 : n.includes(t);
322
+ }
323
+ );
324
+ }
325
+ return [];
326
+ }
327
+ function ia(e, t) {
328
+ const s = e.country === ta, n = !s || e.value.insuranceType !== void 0, i = !!e.useSpecialties && n, l = !i || e.value.specialtyId !== void 0, c = !l || e.value.serviceId !== void 0, d = t.operators, h = !!e.allowOperatorSelection && c && e.value.serviceId !== void 0 && !e.lockedOperatorId && d.length > 1, u = c && e.value.serviceId !== void 0, y = (!u || e.value.date !== void 0) && e.value.date !== void 0, x = (!y || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, k = !!e.value.serviceId && d.length === 0;
329
+ return {
330
+ insurance: s,
331
+ specialty: i,
332
+ service: l,
333
+ operator: h,
334
+ date: u,
335
+ slot: y,
336
+ details: x,
337
+ onboardingIncomplete: k
338
+ };
339
+ }
340
+ function oa(e, t) {
341
+ const s = [];
342
+ t.insurance && s.push(1), t.specialty && s.push(2), s.push(3), t.operator && s.push(4), s.push(5), s.push(6), s.push(7);
343
+ const n = {
344
+ 1: e.value.insuranceType !== void 0,
345
+ 2: e.value.specialtyId !== void 0,
346
+ 3: e.value.serviceId !== void 0,
347
+ 4: e.value.operatorId !== void 0,
348
+ 5: e.value.date !== void 0,
349
+ 6: e.value.slotKey !== void 0,
350
+ 7: !1
351
+ // details fulfilment is owned by the form's own validation
352
+ };
353
+ return {
354
+ currentStep: s.find((o) => !n[o]) ?? 7,
355
+ visibleSteps: s
356
+ };
357
+ }
358
+ function ra(e) {
359
+ const t = {
360
+ specialties: aa(e),
361
+ services: sa(e),
362
+ operators: na(e)
363
+ }, s = ia(e, t), { currentStep: n, visibleSteps: i } = oa(e, s);
364
+ let o;
365
+ if (e.value.date && e.value.slotKey) {
366
+ const d = e.availableSlots[e.value.date];
367
+ d && (o = d.find((h) => h.key === e.value.slotKey));
368
+ }
369
+ const l = e.value.serviceId ? e.services.find((d) => d.id === e.value.serviceId) : void 0, c = e.value.serviceId !== void 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!s.insurance || e.value.insuranceType !== void 0) && (!s.specialty || e.value.specialtyId !== void 0);
370
+ return {
371
+ gates: s,
372
+ filtered: t,
373
+ currentStep: n,
374
+ totalSteps: i.length,
375
+ visibleSteps: i,
376
+ isReadyToSubmit: c,
377
+ durationMin: l == null ? void 0 : l.durationMin,
378
+ selectedSlot: o
379
+ };
380
+ }
381
+ function $e(e, t) {
382
+ return {
383
+ ...e,
384
+ insuranceType: t,
385
+ specialtyId: void 0,
386
+ serviceId: void 0,
387
+ operatorId: void 0,
388
+ date: void 0,
389
+ slotKey: void 0,
390
+ details: void 0
391
+ };
392
+ }
393
+ function Ke(e, t) {
394
+ return {
395
+ ...e,
396
+ specialtyId: t,
397
+ serviceId: void 0,
398
+ operatorId: void 0,
399
+ date: void 0,
400
+ slotKey: void 0,
401
+ details: void 0
402
+ };
403
+ }
404
+ function je(e, t) {
405
+ return {
406
+ ...e,
407
+ serviceId: t,
408
+ // Default the operator to the "All operators" sentinel so a patient
409
+ // who doesn't care about picking lands on a satisfied step 4 without
410
+ // any further input.
411
+ operatorId: t ? ue : void 0,
412
+ date: void 0,
413
+ slotKey: void 0,
414
+ details: void 0
415
+ };
416
+ }
417
+ function qe(e, t) {
418
+ return {
419
+ ...e,
420
+ operatorId: t,
421
+ date: void 0,
422
+ slotKey: void 0,
423
+ details: void 0
424
+ };
425
+ }
426
+ function ke(e, t) {
427
+ return {
428
+ ...e,
429
+ date: t,
430
+ slotKey: void 0
431
+ // Keep details — date/slot changes shouldn't wipe the patient form
432
+ // since the user has already filled some fields.
433
+ };
434
+ }
435
+ function He(e, t) {
436
+ return {
437
+ ...e,
438
+ slotKey: t
439
+ };
440
+ }
441
+ function da(e, t) {
442
+ let s = e;
443
+ if (t.lockedOperatorId && s.operatorId !== t.lockedOperatorId && (s = { ...s, operatorId: t.lockedOperatorId }), t.useSpecialties && t.specialties.length === 1 && s.specialtyId === void 0 && (s = { ...s, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
444
+ const n = s.specialtyId ? t.services.filter((i) => i.specialtyId === s.specialtyId) : t.services;
445
+ n.length === 1 && s.serviceId === void 0 && (s = { ...s, serviceId: n[0].id }, s.operatorId === void 0 && (s = { ...s, operatorId: ue }));
446
+ }
447
+ return s;
448
+ }
449
+ function De(e) {
450
+ if (e.operatorId && e.operatorId !== ue)
451
+ return e.operatorId;
452
+ }
453
+ function la(e) {
454
+ if (!e) return !1;
455
+ const t = e.trim();
456
+ return /^\+?\d[\d\s\-()]{6,}$/.test(t);
457
+ }
458
+ function Ge(e) {
459
+ const t = e && e.length > 0 ? e : ["email"], s = new Set(t);
460
+ return Me.filter((n) => s.has(n));
461
+ }
462
+ function ca(e, t, s) {
463
+ const n = Ge(e), i = new Set(n);
464
+ if (s)
465
+ return Me.filter(
466
+ (h) => s.includes(h) && i.has(h)
467
+ );
468
+ const o = [];
469
+ i.has("email") && o.push("email");
470
+ const l = la(t), c = i.has("whatsapp");
471
+ c && l && o.push("whatsapp"), !c && i.has("sms") && o.push("sms");
472
+ const d = new Set(o);
473
+ return Me.filter((h) => d.has(h));
474
+ }
475
+ const Pe = 500, ma = /^[A-Z0-9]{16}$/, ua = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Le = 300, ve = { state: "idle" }, Te = Ve(
476
+ ({
477
+ value: e,
478
+ onChange: t,
479
+ onSubmit: s,
480
+ requireCodiceFiscale: n = !1,
481
+ requireDateOfBirth: i = !1,
482
+ requireInsuranceNumber: o = !1,
483
+ insuranceType: l,
484
+ showNote: c = !1,
485
+ showReturningPatientFlag: d = !1,
486
+ privacyPolicyUrl: h,
487
+ termsUrl: u,
488
+ validateCodiceFiscale: p,
489
+ validateInsuranceNumber: y,
490
+ submitting: f = !1,
491
+ summarySlot: x,
492
+ defaultPhoneCountry: k,
493
+ confirmationChannels: _,
494
+ defaultConfirmationChannels: Y
495
+ }, S) => {
496
+ var X, W;
497
+ const { t: r } = M(), b = Fe(), [D, C] = z(ve), [v, N] = z(ve), [E, Z] = z({}), P = ee(
498
+ (m) => Z((w) => ({ ...w, [m]: !0 })),
499
+ []
500
+ ), V = ne(null), F = ne(
501
+ null
502
+ );
503
+ se(
504
+ () => () => {
505
+ V.current && clearTimeout(V.current), F.current && clearTimeout(F.current);
506
+ },
507
+ []
508
+ );
509
+ const T = ee(
510
+ (m) => t({ ...e, ...m }),
511
+ [e, t]
512
+ ), K = I(
513
+ () => Ge(_),
514
+ [_]
515
+ ), j = K.length >= 2, ge = ne(!1);
516
+ se(() => {
517
+ if (!j) {
518
+ e.confirmationChannels !== void 0 && T({ confirmationChannels: void 0 });
519
+ return;
520
+ }
521
+ if (e.confirmationChannels !== void 0) {
522
+ ge.current = !0;
523
+ return;
524
+ }
525
+ const m = ca(
526
+ K,
527
+ e.mobilePhone,
528
+ Y
529
+ );
530
+ ge.current = !0, T({ confirmationChannels: m });
531
+ }, [
532
+ j,
533
+ K,
534
+ e.mobilePhone,
535
+ Y
536
+ ]);
537
+ const te = I(
538
+ () => e.confirmationChannels ?? [],
539
+ [e.confirmationChannels]
540
+ ), re = j && te.length === 0;
541
+ se(() => {
542
+ const m = e.codiceFiscale;
543
+ if (!n || !p || !m) {
544
+ C(ve);
545
+ return;
546
+ }
547
+ if (!ma.test(m)) {
548
+ C({
549
+ state: "invalid",
550
+ hint: r("booking.details.codiceFiscale.invalidFormat")
551
+ });
552
+ return;
553
+ }
554
+ C({ state: "pending" }), V.current && clearTimeout(V.current), V.current = setTimeout(() => {
555
+ p(m).then(
556
+ (w) => C(
557
+ w.valid ? { state: "valid" } : { state: "invalid", hint: w.hint }
558
+ )
559
+ ).catch(
560
+ () => C({
561
+ state: "invalid",
562
+ hint: r("booking.details.codiceFiscale.unavailable")
563
+ })
564
+ );
565
+ }, Le);
566
+ }, [n, p, e.codiceFiscale, r]);
567
+ const J = o && l === "public";
568
+ se(() => {
569
+ const m = e.insuranceNumber;
570
+ if (!J || !y || !m) {
571
+ N(ve);
572
+ return;
573
+ }
574
+ N({ state: "pending" }), F.current && clearTimeout(F.current), F.current = setTimeout(() => {
575
+ y(m).then(
576
+ (w) => N(
577
+ w.valid ? { state: "valid" } : { state: "invalid", hint: w.hint }
578
+ )
579
+ ).catch(
580
+ () => N({
581
+ state: "invalid",
582
+ hint: r("booking.details.insuranceNumber.unavailable")
583
+ })
584
+ );
585
+ }, Le);
586
+ }, [J, y, e.insuranceNumber, r]);
587
+ const A = I(
588
+ () => !!(e.email && ua.test(e.email)),
589
+ [e.email]
590
+ ), q = I(
591
+ () => !!(e.mobilePhone && e.mobilePhone.length >= 6),
592
+ [e.mobilePhone]
593
+ ), H = I(() => {
594
+ var m, w;
595
+ return !(!((m = e.firstName) != null && m.trim()) || !((w = e.lastName) != null && w.trim()) || !A || !q || n && D.state !== "valid" || i && !e.dateOfBirth || J && v.state !== "valid");
596
+ }, [
597
+ e.firstName,
598
+ e.lastName,
599
+ A,
600
+ q,
601
+ n,
602
+ D.state,
603
+ i,
604
+ e.dateOfBirth,
605
+ J,
606
+ v.state
607
+ ]), G = !!(e.privacyConsent && e.termsConsent), B = !j || te.length > 0, de = H && G && B && !f, ae = (m) => {
608
+ if (m.preventDefault(), Z({
609
+ firstName: !0,
610
+ lastName: !0,
611
+ email: !0,
612
+ mobilePhone: !0,
613
+ codiceFiscale: !0,
614
+ dateOfBirth: !0,
615
+ insuranceNumber: !0
616
+ }), !de) return;
617
+ const w = {
618
+ firstName: e.firstName.trim(),
619
+ lastName: e.lastName.trim(),
620
+ email: e.email.trim(),
621
+ mobilePhone: e.mobilePhone,
622
+ privacyConsent: !0,
623
+ termsConsent: !0,
624
+ codiceFiscale: e.codiceFiscale,
625
+ dateOfBirth: e.dateOfBirth,
626
+ insuranceNumber: e.insuranceNumber,
627
+ note: e.note,
628
+ returningPatient: e.returningPatient,
629
+ // Only include when the picker was visible; otherwise the single
630
+ // implicit channel is inferred backend-side from the practice
631
+ // config.
632
+ confirmationChannels: j ? te : void 0
633
+ };
634
+ s(w);
635
+ }, le = (m, w) => {
636
+ const ce = w && /^https?:\/\//i.test(w) ? w : void 0;
637
+ return ce ? /* @__PURE__ */ a(
638
+ rt,
639
+ {
640
+ i18nKey: m,
641
+ components: {
642
+ // The `<Trans>` runtime injects link text from the i18n
643
+ // string. The anchor renders empty at static-analysis time,
644
+ // so `jsx-a11y/anchor-has-content` would false-flag — silence
645
+ // it; the runtime content is the localised policy / terms
646
+ // label.
647
+ policyLink: (
648
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
649
+ /* @__PURE__ */ a(
650
+ "a",
651
+ {
652
+ href: ce,
653
+ target: "_blank",
654
+ rel: "noopener noreferrer",
655
+ className: "ds:underline ds:text-[var(--primary)]"
656
+ }
657
+ )
658
+ )
659
+ }
660
+ }
661
+ ) : r(m);
662
+ };
663
+ return /* @__PURE__ */ g(
664
+ "form",
665
+ {
666
+ ref: S,
667
+ id: b,
668
+ noValidate: !0,
669
+ onSubmit: ae,
670
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
671
+ children: [
672
+ x,
673
+ /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
674
+ /* @__PURE__ */ a(
675
+ U,
676
+ {
677
+ label: r("booking.details.firstName.label"),
678
+ required: !0,
679
+ error: E.firstName && !((X = e.firstName) != null && X.trim()) ? r("booking.details.firstName.required") : void 0,
680
+ children: /* @__PURE__ */ a(
681
+ fe,
682
+ {
683
+ autoComplete: "given-name",
684
+ value: e.firstName ?? "",
685
+ onChange: (m) => T({ firstName: m.target.value }),
686
+ onBlur: () => P("firstName")
687
+ }
688
+ )
689
+ }
690
+ ),
691
+ /* @__PURE__ */ a(
692
+ U,
693
+ {
694
+ label: r("booking.details.lastName.label"),
695
+ required: !0,
696
+ error: E.lastName && !((W = e.lastName) != null && W.trim()) ? r("booking.details.lastName.required") : void 0,
697
+ children: /* @__PURE__ */ a(
698
+ fe,
699
+ {
700
+ autoComplete: "family-name",
701
+ value: e.lastName ?? "",
702
+ onChange: (m) => T({ lastName: m.target.value }),
703
+ onBlur: () => P("lastName")
704
+ }
705
+ )
706
+ }
707
+ )
708
+ ] }),
709
+ /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
710
+ /* @__PURE__ */ a(
711
+ U,
712
+ {
713
+ label: r("booking.details.email.label"),
714
+ required: !0,
715
+ error: E.email && !A ? r("booking.details.email.invalid") : void 0,
716
+ children: /* @__PURE__ */ a(
717
+ mt,
718
+ {
719
+ value: e.email ?? "",
720
+ onChange: (m) => T({ email: m.target.value }),
721
+ onBlur: () => P("email")
722
+ }
723
+ )
724
+ }
725
+ ),
726
+ /* @__PURE__ */ a(
727
+ U,
728
+ {
729
+ label: r("booking.details.mobilePhone.label"),
730
+ required: !0,
731
+ error: E.mobilePhone && !q ? r("booking.details.mobilePhone.invalid") : void 0,
732
+ children: /* @__PURE__ */ a(
733
+ ut,
734
+ {
735
+ value: e.mobilePhone ?? "",
736
+ defaultCountry: k == null ? void 0 : k.toUpperCase(),
737
+ onChange: (m) => {
738
+ T({ mobilePhone: m }), P("mobilePhone");
739
+ }
740
+ }
741
+ )
742
+ }
743
+ )
744
+ ] }),
745
+ n || i ? /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
746
+ n ? /* @__PURE__ */ a(
747
+ U,
748
+ {
749
+ label: r("booking.details.codiceFiscale.label"),
750
+ required: !0,
751
+ description: D.state === "pending" ? r("booking.details.codiceFiscale.checking") : r("booking.details.codiceFiscale.helper"),
752
+ error: E.codiceFiscale && D.state === "invalid" ? D.hint ?? r("booking.details.codiceFiscale.invalid") : void 0,
753
+ children: /* @__PURE__ */ a(
754
+ fe,
755
+ {
756
+ value: e.codiceFiscale ?? "",
757
+ maxLength: 16,
758
+ onChange: (m) => T({
759
+ codiceFiscale: m.target.value.slice(0, 16).toUpperCase()
760
+ }),
761
+ onBlur: () => P("codiceFiscale")
762
+ }
763
+ )
764
+ }
765
+ ) : null,
766
+ i ? /* @__PURE__ */ a(
767
+ U,
768
+ {
769
+ label: r("booking.details.dateOfBirth.label"),
770
+ required: !0,
771
+ error: E.dateOfBirth && !e.dateOfBirth ? r("booking.details.dateOfBirth.required") : void 0,
772
+ children: /* @__PURE__ */ a(
773
+ ct,
774
+ {
775
+ value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
776
+ onChange: (m) => {
777
+ T({
778
+ dateOfBirth: m ? m.toISOString().slice(0, 10) : void 0
779
+ }), P("dateOfBirth");
780
+ }
781
+ }
782
+ )
783
+ }
784
+ ) : null
785
+ ] }) : null,
786
+ J ? /* @__PURE__ */ a(
787
+ U,
788
+ {
789
+ label: r("booking.details.insuranceNumber.label"),
790
+ required: !0,
791
+ description: v.state === "pending" ? r("booking.details.insuranceNumber.checking") : void 0,
792
+ error: E.insuranceNumber && v.state === "invalid" ? v.hint ?? r("booking.details.insuranceNumber.invalid") : void 0,
793
+ children: /* @__PURE__ */ a(
794
+ fe,
795
+ {
796
+ value: e.insuranceNumber ?? "",
797
+ onChange: (m) => T({ insuranceNumber: m.target.value }),
798
+ onBlur: () => P("insuranceNumber")
799
+ }
800
+ )
801
+ }
802
+ ) : null,
803
+ c ? /* @__PURE__ */ a(
804
+ U,
805
+ {
806
+ label: r("booking.details.note.label"),
807
+ description: r("booking.details.note.helper", {
808
+ max: Pe
809
+ }),
810
+ children: /* @__PURE__ */ a(
811
+ pt,
812
+ {
813
+ value: e.note ?? "",
814
+ maxLength: Pe,
815
+ rows: 3,
816
+ onChange: (m) => T({ note: m.target.value })
817
+ }
818
+ )
819
+ }
820
+ ) : null,
821
+ d ? /* @__PURE__ */ a(
822
+ we,
823
+ {
824
+ checked: !!e.returningPatient,
825
+ onCheckedChange: (m) => T({ returningPatient: m === !0 }),
826
+ label: r("booking.details.returningPatient.label")
827
+ }
828
+ ) : null,
829
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
830
+ /* @__PURE__ */ a(
831
+ we,
832
+ {
833
+ checked: !!e.privacyConsent,
834
+ onCheckedChange: (m) => T({ privacyConsent: m === !0 }),
835
+ label: /* @__PURE__ */ g(ie, { children: [
836
+ le(
837
+ "booking.details.consent.privacy.label",
838
+ h
839
+ ),
840
+ /* @__PURE__ */ a(
841
+ "span",
842
+ {
843
+ "aria-hidden": "true",
844
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
845
+ children: "*"
846
+ }
847
+ )
848
+ ] })
849
+ }
850
+ ),
851
+ /* @__PURE__ */ a(
852
+ we,
853
+ {
854
+ checked: !!e.termsConsent,
855
+ onCheckedChange: (m) => T({ termsConsent: m === !0 }),
856
+ label: /* @__PURE__ */ g(ie, { children: [
857
+ le(
858
+ "booking.details.consent.terms.label",
859
+ u
860
+ ),
861
+ /* @__PURE__ */ a(
862
+ "span",
863
+ {
864
+ "aria-hidden": "true",
865
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
866
+ children: "*"
867
+ }
868
+ )
869
+ ] })
870
+ }
871
+ )
872
+ ] }),
873
+ j ? /* @__PURE__ */ a(
874
+ "div",
875
+ {
876
+ "data-component": "booking-confirmation-channels",
877
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
878
+ children: /* @__PURE__ */ a(
879
+ lt,
880
+ {
881
+ label: r("booking.confirmation.heading"),
882
+ helperText: r("booking.confirmation.helper"),
883
+ value: te,
884
+ onChange: (m) => T({
885
+ confirmationChannels: m
886
+ }),
887
+ orientation: "vertical",
888
+ options: K.map((m) => ({
889
+ value: m,
890
+ label: r(`booking.confirmation.channel.${m}`)
891
+ })),
892
+ error: re ? r("booking.confirmation.atLeastOne") : void 0
893
+ }
894
+ )
895
+ }
896
+ ) : null,
897
+ /* @__PURE__ */ a(
898
+ oe,
899
+ {
900
+ intent: "primary",
901
+ size: "md",
902
+ type: "submit",
903
+ disabled: !de,
904
+ startIcon: f ? /* @__PURE__ */ a(gt, { size: "sm" }) : void 0,
905
+ children: r("booking.details.submit")
906
+ }
907
+ )
908
+ ]
909
+ }
910
+ );
911
+ }
912
+ );
913
+ Te.displayName = "BookingDetailsForm";
914
+ const pa = xe(
915
+ "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
916
+ {
917
+ variants: {
918
+ variant: {
919
+ "inline-list": "ds:gap-[var(--spacing-md)]",
920
+ accordion: "ds:gap-[var(--spacing-md)]",
921
+ calendar: "ds:gap-[var(--spacing-md)]",
922
+ flexible: "ds:gap-[var(--spacing-lg)]",
923
+ progress: "ds:gap-[var(--spacing-sm)]"
924
+ }
925
+ },
926
+ defaultVariants: { variant: "inline-list" }
927
+ }
928
+ ), ga = [
929
+ [
930
+ /\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
931
+ Ee
932
+ ],
933
+ [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Nt],
934
+ [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, Zt],
935
+ [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, It],
936
+ [/\b(otorin|udito|orecchi|hearing|ear)/i, Rt],
937
+ [/\b(neuro|brain|cervello)/i, Ot],
938
+ [/\b(pediatr|child|bambin)/i, Tt],
939
+ [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, At],
940
+ [/\b(lab|analis|test|sang|esami)/i, $t],
941
+ [/\b(farmaco|pharm|pillol|refill)/i, jt],
942
+ [/\b(chirurg|surg|intervent|operat)/i, Ut],
943
+ [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, Ht],
944
+ [/\b(vacc|inject|inie|punto)/i, Ee],
945
+ [/\b(derma|skin|pelle)/i, wt],
946
+ [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, Vt],
947
+ [/\b(general|medicin|family|control|check[-\s]?up)/i, Mt]
948
+ ];
949
+ function fa(e) {
950
+ for (const [t, s] of ga)
951
+ if (t.test(e)) return s;
952
+ return null;
953
+ }
954
+ function ha(e) {
955
+ const t = fa(e.label) ?? St;
956
+ return /* @__PURE__ */ a(t, { "aria-hidden": "true", className: "ds:size-5" });
957
+ }
958
+ function Ce(e) {
959
+ return be(e, "yyyy-MM-dd");
960
+ }
961
+ const va = [
962
+ "ds:relative ds:flex ds:items-center ds:justify-center",
963
+ "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
964
+ "ds:rounded-[var(--radius-sm)]",
965
+ "ds:text-[length:var(--font-size-sm)]",
966
+ "ds:transition-colors ds:duration-[var(--animation-duration)]",
967
+ "ds:motion-reduce:transition-none",
968
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
969
+ "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
970
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
971
+ ].join(" "), ba = xe(va, {
972
+ variants: {
973
+ state: {
974
+ available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
975
+ unavailable: "ds:cursor-not-allowed ds:text-[var(--muted-foreground)]/60",
976
+ selected: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:font-[var(--font-weight-semibold)]",
977
+ outside: "ds:text-[var(--muted-foreground)]/40"
978
+ }
979
+ },
980
+ defaultVariants: { state: "unavailable" }
981
+ });
982
+ function Ue({
983
+ availableDates: e,
984
+ selectedDate: t,
985
+ onSelectDate: s,
986
+ locale: n,
987
+ loading: i
988
+ }) {
989
+ const { t: o } = M(), l = I(() => t ? me(Q(t)) : e.length > 0 ? me(Q(e[0])) : me(/* @__PURE__ */ new Date()), [t, e]), [c, d] = z(l), [h, u] = z(null), p = I(() => {
990
+ const S = me(c), r = vt(c), b = S.getDay(), D = r.getDate(), C = [];
991
+ for (let v = b; v > 0; v -= 1) {
992
+ const N = new Date(S);
993
+ N.setDate(S.getDate() - v), C.push(N);
994
+ }
995
+ for (let v = 0; v < D; v += 1) {
996
+ const N = new Date(S);
997
+ N.setDate(S.getDate() + v), C.push(N);
998
+ }
999
+ for (; C.length < 42; ) {
1000
+ const v = C[C.length - 1], N = new Date(v);
1001
+ N.setDate(v.getDate() + 1), C.push(N);
1002
+ }
1003
+ return C;
1004
+ }, [c]), y = I(() => {
1005
+ try {
1006
+ return new Intl.DateTimeFormat(n, {
1007
+ month: "long",
1008
+ year: "numeric"
1009
+ }).format(c);
1010
+ } catch {
1011
+ return be(c, "MMMM yyyy");
1012
+ }
1013
+ }, [c, n]), f = I(() => {
1014
+ const S = new Date(2024, 0, 7);
1015
+ return Array.from({ length: 7 }, (r, b) => {
1016
+ const D = new Date(S);
1017
+ D.setDate(S.getDate() + b);
1018
+ try {
1019
+ return new Intl.DateTimeFormat(n, { weekday: "short" }).format(D);
1020
+ } catch {
1021
+ return be(D, "EEE");
1022
+ }
1023
+ });
1024
+ }, [n]), x = I(() => new Set(e), [e]), k = ee(
1025
+ (S) => x.has(Ce(S)),
1026
+ [x]
1027
+ ), _ = I(() => {
1028
+ if (h) return h;
1029
+ if (t) return Q(t);
1030
+ const S = p.find(
1031
+ (r) => he(r, c) && k(r)
1032
+ );
1033
+ return S || (p.find((r) => he(r, c)) ?? null);
1034
+ }, [h, t, p, c, k]), Y = ee(
1035
+ (S, r) => {
1036
+ let b = null;
1037
+ switch (S.key) {
1038
+ case "ArrowLeft":
1039
+ b = new Date(r), b.setDate(r.getDate() - 1);
1040
+ break;
1041
+ case "ArrowRight":
1042
+ b = new Date(r), b.setDate(r.getDate() + 1);
1043
+ break;
1044
+ case "ArrowUp":
1045
+ b = new Date(r), b.setDate(r.getDate() - 7);
1046
+ break;
1047
+ case "ArrowDown":
1048
+ b = new Date(r), b.setDate(r.getDate() + 7);
1049
+ break;
1050
+ case "Home":
1051
+ b = new Date(r), b.setDate(r.getDate() - r.getDay());
1052
+ break;
1053
+ case "End":
1054
+ b = new Date(r), b.setDate(r.getDate() + (6 - r.getDay()));
1055
+ break;
1056
+ case "Enter":
1057
+ case " ": {
1058
+ S.preventDefault(), k(r) && s(Ce(r));
1059
+ return;
1060
+ }
1061
+ default:
1062
+ return;
1063
+ }
1064
+ b && (S.preventDefault(), he(b, c) || d(me(b)), u(b));
1065
+ },
1066
+ [k, s, c]
1067
+ );
1068
+ return i ? /* @__PURE__ */ g(
1069
+ "div",
1070
+ {
1071
+ role: "status",
1072
+ "aria-live": "polite",
1073
+ "aria-label": o("common.loading"),
1074
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1075
+ children: [
1076
+ /* @__PURE__ */ a(ye, { variant: "text", width: "40%" }),
1077
+ /* @__PURE__ */ a("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (S, r) => /* @__PURE__ */ a(ye, { variant: "rounded", height: "2.5rem" }, `mg-skel-${r}`)) })
1078
+ ]
1079
+ }
1080
+ ) : /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1081
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1082
+ /* @__PURE__ */ a(
1083
+ Be,
1084
+ {
1085
+ icon: /* @__PURE__ */ a(bt, {}),
1086
+ "aria-label": o("booking.previousMonth"),
1087
+ size: "sm",
1088
+ intent: "ghost",
1089
+ flipIconInRtl: !0,
1090
+ onClick: () => {
1091
+ d((S) => Qt(S)), u(null);
1092
+ }
1093
+ }
1094
+ ),
1095
+ /* @__PURE__ */ a(
1096
+ "span",
1097
+ {
1098
+ className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
1099
+ "aria-live": "polite",
1100
+ children: y
1101
+ }
1102
+ ),
1103
+ /* @__PURE__ */ a(
1104
+ Be,
1105
+ {
1106
+ icon: /* @__PURE__ */ a(yt, {}),
1107
+ "aria-label": o("booking.nextMonth"),
1108
+ size: "sm",
1109
+ intent: "ghost",
1110
+ flipIconInRtl: !0,
1111
+ onClick: () => {
1112
+ d((S) => ze(S, 1)), u(null);
1113
+ }
1114
+ }
1115
+ )
1116
+ ] }),
1117
+ /* @__PURE__ */ g(
1118
+ "div",
1119
+ {
1120
+ role: "grid",
1121
+ "aria-label": o("booking.monthGridLabel"),
1122
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
1123
+ children: [
1124
+ /* @__PURE__ */ a(
1125
+ "div",
1126
+ {
1127
+ role: "row",
1128
+ className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1129
+ children: f.map((S, r) => /* @__PURE__ */ a(
1130
+ "div",
1131
+ {
1132
+ role: "columnheader",
1133
+ className: "type-meta ds:text-center ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-medium)]",
1134
+ children: S
1135
+ },
1136
+ `wd-${r}`
1137
+ ))
1138
+ }
1139
+ ),
1140
+ Array.from({ length: 6 }, (S, r) => /* @__PURE__ */ a(
1141
+ "div",
1142
+ {
1143
+ role: "row",
1144
+ className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1145
+ children: p.slice(r * 7, r * 7 + 7).map((b, D) => {
1146
+ const C = r * 7 + D, v = he(b, c), N = v && k(b), E = t ? Oe(b, Q(t)) : !1, Z = v ? E ? "selected" : N ? "available" : "unavailable" : "outside", P = _ ? Oe(_, b) : !1, V = (() => {
1147
+ try {
1148
+ return new Intl.DateTimeFormat(n, {
1149
+ dateStyle: "full"
1150
+ }).format(b);
1151
+ } catch {
1152
+ return be(b, "PPP");
1153
+ }
1154
+ })();
1155
+ return /* @__PURE__ */ a(
1156
+ "button",
1157
+ {
1158
+ type: "button",
1159
+ role: "gridcell",
1160
+ "aria-label": V,
1161
+ "aria-selected": E || void 0,
1162
+ "aria-disabled": !N || void 0,
1163
+ tabIndex: P ? 0 : -1,
1164
+ disabled: !N,
1165
+ onClick: () => {
1166
+ N && s(Ce(b));
1167
+ },
1168
+ onKeyDown: (F) => Y(F, b),
1169
+ className: ba({ state: Z }),
1170
+ children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: b.getDate() })
1171
+ },
1172
+ `mg-cell-${C}`
1173
+ );
1174
+ })
1175
+ },
1176
+ `mg-row-${r}`
1177
+ ))
1178
+ ]
1179
+ }
1180
+ )
1181
+ ] });
1182
+ }
1183
+ const ya = xe(
1184
+ [
1185
+ "ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
1186
+ "ds:min-h-[var(--min-target-size)]",
1187
+ "ds:rounded-[var(--radius-md)]",
1188
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
1189
+ "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
1190
+ "ds:text-start",
1191
+ "ds:transition-[background-color,box-shadow]",
1192
+ "ds:duration-[var(--animation-duration)]",
1193
+ "ds:motion-reduce:transition-none",
1194
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1195
+ "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1196
+ "ds:forced-colors:[outline:1px_solid_CanvasText]",
1197
+ "ds:cursor-pointer"
1198
+ ].join(" "),
1199
+ {
1200
+ variants: {
1201
+ state: {
1202
+ idle: "ds:bg-[var(--card)] ds:shadow-[var(--shadow-sm)] ds:hover:shadow-[var(--shadow-md)]",
1203
+ selected: "ds:bg-[color-mix(in_srgb,var(--primary)_8%,var(--card))] ds:shadow-[var(--shadow-sm)]"
1204
+ }
1205
+ },
1206
+ defaultVariants: { state: "idle" }
1207
+ }
1208
+ );
1209
+ function ka({
1210
+ services: e,
1211
+ selectedServiceId: t,
1212
+ onSelect: s
1213
+ }) {
1214
+ const { t: n } = M(), i = Fe(), [o, l] = z(() => {
1215
+ if (t) {
1216
+ const u = e.findIndex((p) => p.id === t);
1217
+ if (u >= 0) return u;
1218
+ }
1219
+ return 0;
1220
+ }), c = ne(/* @__PURE__ */ new Map()), d = ee((u) => {
1221
+ var p;
1222
+ (p = c.current.get(u)) == null || p.focus();
1223
+ }, []), h = ee(
1224
+ (u, p, y) => {
1225
+ const f = e.length;
1226
+ if (f !== 0)
1227
+ switch (u.key) {
1228
+ case "ArrowDown":
1229
+ case "ArrowRight": {
1230
+ u.preventDefault();
1231
+ const x = (p + 1) % f;
1232
+ l(x), d(x);
1233
+ break;
1234
+ }
1235
+ case "ArrowUp":
1236
+ case "ArrowLeft": {
1237
+ u.preventDefault();
1238
+ const x = (p - 1 + f) % f;
1239
+ l(x), d(x);
1240
+ break;
1241
+ }
1242
+ case "Home": {
1243
+ u.preventDefault(), l(0), d(0);
1244
+ break;
1245
+ }
1246
+ case "End": {
1247
+ u.preventDefault();
1248
+ const x = f - 1;
1249
+ l(x), d(x);
1250
+ break;
1251
+ }
1252
+ case "Enter":
1253
+ case " ": {
1254
+ u.preventDefault(), s(y);
1255
+ break;
1256
+ }
1257
+ }
1258
+ },
1259
+ [e.length, d, s]
1260
+ );
1261
+ return e.length === 0 ? null : /* @__PURE__ */ a(
1262
+ "div",
1263
+ {
1264
+ role: "radiogroup",
1265
+ "aria-label": n("booking.serviceListLabel"),
1266
+ id: i,
1267
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1268
+ children: e.map((u, p) => {
1269
+ const y = t === u.id, f = o === p, x = n("booking.serviceCardLabel", {
1270
+ label: u.label,
1271
+ duration: u.durationMin
1272
+ }), k = ha(u);
1273
+ return /* @__PURE__ */ g(
1274
+ "button",
1275
+ {
1276
+ ref: (_) => {
1277
+ _ ? c.current.set(p, _) : c.current.delete(p);
1278
+ },
1279
+ type: "button",
1280
+ role: "radio",
1281
+ "aria-checked": y,
1282
+ "aria-label": x,
1283
+ tabIndex: f ? 0 : -1,
1284
+ onClick: () => s(u.id),
1285
+ onFocus: () => l(p),
1286
+ onKeyDown: (_) => h(_, p, u.id),
1287
+ className: ya({
1288
+ state: y ? "selected" : "idle"
1289
+ }),
1290
+ children: [
1291
+ /* @__PURE__ */ a(
1292
+ "span",
1293
+ {
1294
+ "aria-hidden": "true",
1295
+ className: "ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[var(--primary)]/10 ds:text-[var(--primary)]",
1296
+ children: k
1297
+ }
1298
+ ),
1299
+ /* @__PURE__ */ g("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1300
+ /* @__PURE__ */ a("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: u.label }),
1301
+ /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: n("booking.serviceSummary", { minutes: u.durationMin }) })
1302
+ ] })
1303
+ ]
1304
+ },
1305
+ u.id
1306
+ );
1307
+ })
1308
+ }
1309
+ );
1310
+ }
1311
+ const xa = xe(
1312
+ [
1313
+ "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
1314
+ "ds:min-h-[var(--min-target-size)]",
1315
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
1316
+ "ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]",
1317
+ "ds:rounded-[var(--radius-md)]",
1318
+ "ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]",
1319
+ "ds:transition-[background-color,color,box-shadow] ds:duration-[var(--animation-duration)]",
1320
+ "ds:motion-reduce:transition-none",
1321
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1322
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1323
+ "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
1324
+ "ds:forced-colors:[border:1px_solid_ButtonText] ds:forced-colors:text-[ButtonText]"
1325
+ ].join(" "),
1326
+ {
1327
+ variants: {
1328
+ state: {
1329
+ idle: "ds:bg-[color:var(--card)] ds:text-[color:var(--foreground)] ds:shadow-[var(--shadow-sm)] ds:hover:enabled:bg-[color:var(--muted)]/40 ds:hover:enabled:shadow-[var(--shadow-md)]",
1330
+ selected: "ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:shadow-[var(--shadow-sm)]",
1331
+ unavailable: "ds:[outline:1px_dashed_color:var(--border)] ds:[outline-offset:-1px] ds:bg-transparent ds:text-[color:var(--muted-foreground)]"
1332
+ }
1333
+ },
1334
+ defaultVariants: { state: "idle" }
1335
+ }
1336
+ );
1337
+ function Sa(e) {
1338
+ const [t] = e.split(":").map((n) => parseInt(n, 10)), s = Number.isFinite(t) ? t : 0;
1339
+ return s < 12 ? "morning" : s < 17 ? "afternoon" : "evening";
1340
+ }
1341
+ const Na = {
1342
+ morning: xt,
1343
+ afternoon: Xt,
1344
+ evening: kt
1345
+ };
1346
+ function Ye({
1347
+ date: e,
1348
+ slots: t,
1349
+ selectedSlotKey: s,
1350
+ onSelect: n,
1351
+ loading: i,
1352
+ locale: o
1353
+ }) {
1354
+ const { t: l } = M(), c = I(() => {
1355
+ try {
1356
+ return new Intl.DateTimeFormat(o, {
1357
+ weekday: "long",
1358
+ day: "numeric",
1359
+ month: "long"
1360
+ }).format(Q(e));
1361
+ } catch {
1362
+ return e;
1363
+ }
1364
+ }, [e, o]), d = I(() => {
1365
+ const p = {
1366
+ morning: [],
1367
+ afternoon: [],
1368
+ evening: []
1369
+ };
1370
+ for (const y of t)
1371
+ p[Sa(y.time)].push(y);
1372
+ return p;
1373
+ }, [t]), h = t.filter((p) => p.available).length, u = ["morning", "afternoon", "evening"];
1374
+ return i ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1375
+ /* @__PURE__ */ a(ye, { variant: "text", width: "60%" }),
1376
+ [0, 1].map((p) => /* @__PURE__ */ a(
1377
+ "div",
1378
+ {
1379
+ className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
1380
+ children: [0, 1, 2].map((y) => /* @__PURE__ */ a(ye, { variant: "rounded", height: "44px" }, y))
1381
+ },
1382
+ p
1383
+ ))
1384
+ ] }) : h === 0 ? /* @__PURE__ */ a(Re, { variant: "no-results", title: l("booking.noSlotsForDate") }) : /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1385
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1386
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1387
+ /* @__PURE__ */ a(
1388
+ Pt,
1389
+ {
1390
+ "aria-hidden": "true",
1391
+ className: "ds:size-4 ds:text-[color:var(--accent)]"
1392
+ }
1393
+ ),
1394
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: c })
1395
+ ] }),
1396
+ /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: l("booking.slotsAvailable", { count: h }) })
1397
+ ] }),
1398
+ u.map((p) => {
1399
+ const y = d[p];
1400
+ if (y.length === 0) return null;
1401
+ const f = Na[p];
1402
+ return /* @__PURE__ */ g(
1403
+ "div",
1404
+ {
1405
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1406
+ children: [
1407
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
1408
+ /* @__PURE__ */ a(f, { "aria-hidden": "true", className: "ds:size-3.5" }),
1409
+ /* @__PURE__ */ a("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: l(`booking.timeOfDay.${p}`) })
1410
+ ] }),
1411
+ /* @__PURE__ */ a(
1412
+ "div",
1413
+ {
1414
+ role: "group",
1415
+ "aria-label": l(`booking.timeOfDay.${p}`),
1416
+ className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
1417
+ children: y.map((x) => {
1418
+ const k = x.key === s, _ = x.available ? k ? "selected" : "idle" : "unavailable";
1419
+ return /* @__PURE__ */ a(
1420
+ "button",
1421
+ {
1422
+ type: "button",
1423
+ "data-slot-id": x.key,
1424
+ disabled: !x.available,
1425
+ "aria-pressed": k,
1426
+ "aria-label": l("booking.slotAvailableLabel", {
1427
+ time: x.time
1428
+ }),
1429
+ onClick: () => x.available && n(x),
1430
+ className: xa({ state: _ }),
1431
+ children: x.time
1432
+ },
1433
+ x.key
1434
+ );
1435
+ })
1436
+ }
1437
+ )
1438
+ ]
1439
+ },
1440
+ p
1441
+ );
1442
+ })
1443
+ ] });
1444
+ }
1445
+ function Ze({ value: e, onChange: t }) {
1446
+ const { t: s } = M(), n = [
1447
+ { value: "private", label: s("booking.insurance.private") },
1448
+ { value: "public", label: s("booking.insurance.public") }
1449
+ ];
1450
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1451
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: s("booking.insurance.heading") }),
1452
+ /* @__PURE__ */ a(
1453
+ Se,
1454
+ {
1455
+ options: n,
1456
+ value: e ?? "",
1457
+ onValueChange: (i) => {
1458
+ (i === "private" || i === "public") && t(i);
1459
+ },
1460
+ placeholder: s("booking.insurance.placeholder"),
1461
+ "aria-label": s("booking.insurance.heading")
1462
+ }
1463
+ )
1464
+ ] });
1465
+ }
1466
+ function Je({ specialties: e, value: t, onChange: s }) {
1467
+ const { t: n } = M(), i = e.map((o) => ({
1468
+ value: o.id,
1469
+ label: o.label
1470
+ }));
1471
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1472
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.specialty.heading") }),
1473
+ /* @__PURE__ */ a(
1474
+ Se,
1475
+ {
1476
+ options: i,
1477
+ value: t ?? "",
1478
+ onValueChange: (o) => s(o),
1479
+ placeholder: n("booking.specialty.placeholder"),
1480
+ "aria-label": n("booking.specialty.heading")
1481
+ }
1482
+ )
1483
+ ] });
1484
+ }
1485
+ function Xe({ services: e, value: t, onChange: s, compact: n }) {
1486
+ const { t: i } = M();
1487
+ if (n) {
1488
+ const o = e.map((l) => ({
1489
+ value: l.id,
1490
+ label: `${l.label} · ${i("booking.serviceSummary", {
1491
+ minutes: l.durationMin
1492
+ })}`
1493
+ }));
1494
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1495
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.service.heading") }),
1496
+ /* @__PURE__ */ a(
1497
+ Se,
1498
+ {
1499
+ options: o,
1500
+ value: t ?? "",
1501
+ onValueChange: (l) => s(l),
1502
+ placeholder: i("booking.service.placeholder"),
1503
+ "aria-label": i("booking.service.heading")
1504
+ }
1505
+ )
1506
+ ] });
1507
+ }
1508
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1509
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.service.heading") }),
1510
+ /* @__PURE__ */ a(
1511
+ ka,
1512
+ {
1513
+ services: e,
1514
+ selectedServiceId: t,
1515
+ onSelect: s
1516
+ }
1517
+ )
1518
+ ] });
1519
+ }
1520
+ function We({ operators: e, value: t, onChange: s }) {
1521
+ const { t: n } = M(), i = [
1522
+ { value: ue, label: n("booking.operator.all") },
1523
+ ...e.map((o) => ({ value: o.id, label: o.name }))
1524
+ ];
1525
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1526
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.operator.heading") }),
1527
+ /* @__PURE__ */ a(
1528
+ Se,
1529
+ {
1530
+ options: i,
1531
+ value: t ?? ue,
1532
+ onValueChange: (o) => s(o),
1533
+ placeholder: n("booking.operator.placeholder"),
1534
+ "aria-label": n("booking.operator.heading")
1535
+ }
1536
+ )
1537
+ ] });
1538
+ }
1539
+ function Qe({
1540
+ customSlot: e
1541
+ }) {
1542
+ const { t } = M();
1543
+ return e ? /* @__PURE__ */ a(ie, { children: e }) : /* @__PURE__ */ g($, { variant: "warning", children: [
1544
+ /* @__PURE__ */ a($.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
1545
+ /* @__PURE__ */ a($.Description, { children: t("booking.onboardingIncomplete.description") })
1546
+ ] });
1547
+ }
1548
+ function et({
1549
+ nextAvailableDate: e,
1550
+ onJump: t,
1551
+ locale: s
1552
+ }) {
1553
+ const { t: n } = M(), i = I(() => {
1554
+ try {
1555
+ return new Intl.DateTimeFormat(s, { dateStyle: "long" }).format(
1556
+ Q(e)
1557
+ );
1558
+ } catch {
1559
+ return e;
1560
+ }
1561
+ }, [e, s]);
1562
+ return /* @__PURE__ */ g($, { variant: "info", children: [
1563
+ /* @__PURE__ */ a($.Description, { children: n("booking.nextAvailable.description", { date: i }) }),
1564
+ /* @__PURE__ */ a($.Action, { children: /* @__PURE__ */ a(oe, { intent: "secondary", size: "sm", onClick: t, children: n("booking.nextAvailable.cta") }) })
1565
+ ] });
1566
+ }
1567
+ function Ia({
1568
+ snapshot: e,
1569
+ operators: t,
1570
+ locale: s,
1571
+ onReset: n
1572
+ }) {
1573
+ const { t: i } = M(), l = (e.details.confirmationChannels ?? ["email"]).map(
1574
+ (u) => i(`booking.confirmation.channel.${u}`)
1575
+ ), c = l.length > 1 ? i("booking.success.descriptionMultiple", {
1576
+ channels: l.join(" · ")
1577
+ }) : i("booking.success.descriptionSingle", { channel: l[0] }), d = I(() => {
1578
+ if (e.date)
1579
+ try {
1580
+ return new Intl.DateTimeFormat(s, {
1581
+ weekday: "long",
1582
+ day: "numeric",
1583
+ month: "long"
1584
+ }).format(Q(e.date));
1585
+ } catch {
1586
+ return e.date;
1587
+ }
1588
+ }, [e.date, s]), h = e.operatorId ? t.find((u) => u.id === e.operatorId) : void 0;
1589
+ return /* @__PURE__ */ g(
1590
+ "div",
1591
+ {
1592
+ "data-component": "booking-success",
1593
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1594
+ children: [
1595
+ /* @__PURE__ */ g($, { variant: "success", children: [
1596
+ /* @__PURE__ */ a($.Title, { as: "h3", children: i("booking.success.heading") }),
1597
+ /* @__PURE__ */ a($.Description, { children: c })
1598
+ ] }),
1599
+ /* @__PURE__ */ a("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ g("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: [
1600
+ d ? /* @__PURE__ */ g(ie, { children: [
1601
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: i("booking.success.summaryDate") }),
1602
+ /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: d })
1603
+ ] }) : null,
1604
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: i("booking.success.summaryTime") }),
1605
+ /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: e.slot.time }),
1606
+ h ? /* @__PURE__ */ g(ie, { children: [
1607
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: i("booking.success.summaryProvider") }),
1608
+ /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: h.name })
1609
+ ] }) : null
1610
+ ] }) }),
1611
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(oe, { intent: "secondary", size: "md", onClick: n, children: i("booking.success.bookAnother") }) })
1612
+ ]
1613
+ }
1614
+ );
1615
+ }
1616
+ function tt({ customSlot: e }) {
1617
+ const { t } = M();
1618
+ return e ? /* @__PURE__ */ a(ie, { children: e }) : /* @__PURE__ */ a(
1619
+ Re,
1620
+ {
1621
+ variant: "no-results",
1622
+ title: t("booking.emptyServices.title"),
1623
+ description: t("booking.emptyServices.description")
1624
+ }
1625
+ );
1626
+ }
1627
+ function wa(e) {
1628
+ const {
1629
+ cascade: t,
1630
+ inputs: s,
1631
+ value: n,
1632
+ onChange: i,
1633
+ onSubmit: o,
1634
+ emptyServicesSlot: l,
1635
+ onboardingIncompleteSlot: c,
1636
+ loadingSlots: d,
1637
+ submitting: h,
1638
+ locale: u,
1639
+ detailsProps: p
1640
+ } = e, { t: y } = M();
1641
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1642
+ t.gates.insurance ? /* @__PURE__ */ a(
1643
+ Ze,
1644
+ {
1645
+ value: n.insuranceType,
1646
+ onChange: (f) => i($e(n, f))
1647
+ }
1648
+ ) : null,
1649
+ t.gates.specialty ? /* @__PURE__ */ a(
1650
+ Je,
1651
+ {
1652
+ specialties: t.filtered.specialties,
1653
+ value: n.specialtyId,
1654
+ onChange: (f) => i(Ke(n, f))
1655
+ }
1656
+ ) : null,
1657
+ t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ a(tt, { customSlot: l }) : /* @__PURE__ */ a(
1658
+ Xe,
1659
+ {
1660
+ services: t.filtered.services,
1661
+ value: n.serviceId,
1662
+ onChange: (f) => i(je(n, f))
1663
+ }
1664
+ ) : null,
1665
+ t.gates.onboardingIncomplete ? /* @__PURE__ */ a(Qe, { customSlot: c }) : null,
1666
+ t.gates.operator ? /* @__PURE__ */ a(
1667
+ We,
1668
+ {
1669
+ operators: t.filtered.operators,
1670
+ value: n.operatorId,
1671
+ onChange: (f) => i(qe(n, f))
1672
+ }
1673
+ ) : null,
1674
+ t.gates.date ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1675
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: y("booking.date.heading") }),
1676
+ s.availableDates.length === 0 && s.nextAvailableDate ? /* @__PURE__ */ a(
1677
+ et,
1678
+ {
1679
+ nextAvailableDate: s.nextAvailableDate,
1680
+ onJump: () => i(ke(n, s.nextAvailableDate)),
1681
+ locale: u
1682
+ }
1683
+ ) : /* @__PURE__ */ a(
1684
+ Ue,
1685
+ {
1686
+ availableDates: s.availableDates,
1687
+ selectedDate: n.date,
1688
+ onSelectDate: (f) => i(ke(n, f)),
1689
+ locale: u,
1690
+ loading: d
1691
+ }
1692
+ )
1693
+ ] }) : null,
1694
+ t.gates.slot && n.date ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1695
+ /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: y("booking.slot.heading") }),
1696
+ /* @__PURE__ */ a(
1697
+ Ye,
1698
+ {
1699
+ date: n.date,
1700
+ slots: s.availableSlots[n.date] ?? [],
1701
+ selectedSlotKey: n.slotKey,
1702
+ onSelect: (f) => i(He(n, f.key)),
1703
+ loading: d,
1704
+ locale: u
1705
+ }
1706
+ )
1707
+ ] }) : null,
1708
+ t.gates.details && t.selectedSlot ? /* @__PURE__ */ a(
1709
+ Te,
1710
+ {
1711
+ ...p,
1712
+ value: n.details ?? {},
1713
+ onChange: (f) => i({ ...n, details: f }),
1714
+ onSubmit: o,
1715
+ submitting: h,
1716
+ defaultPhoneCountry: e.policy.country
1717
+ }
1718
+ ) : null
1719
+ ] });
1720
+ }
1721
+ function R(e, t, s = {}) {
1722
+ const {
1723
+ cascade: n,
1724
+ inputs: i,
1725
+ value: o,
1726
+ onChange: l,
1727
+ onSubmit: c,
1728
+ emptyServicesSlot: d,
1729
+ onboardingIncompleteSlot: h,
1730
+ loadingSlots: u,
1731
+ submitting: p,
1732
+ locale: y,
1733
+ detailsProps: f,
1734
+ policy: x
1735
+ } = t;
1736
+ switch (e) {
1737
+ case 1:
1738
+ return /* @__PURE__ */ a(
1739
+ Ze,
1740
+ {
1741
+ value: o.insuranceType,
1742
+ onChange: (k) => l($e(o, k))
1743
+ }
1744
+ );
1745
+ case 2:
1746
+ return /* @__PURE__ */ a(
1747
+ Je,
1748
+ {
1749
+ specialties: n.filtered.specialties,
1750
+ value: o.specialtyId,
1751
+ onChange: (k) => l(Ke(o, k))
1752
+ }
1753
+ );
1754
+ case 3:
1755
+ return n.filtered.services.length === 0 ? /* @__PURE__ */ a(tt, { customSlot: d }) : n.gates.onboardingIncomplete ? /* @__PURE__ */ a(Qe, { customSlot: h }) : /* @__PURE__ */ a(
1756
+ Xe,
1757
+ {
1758
+ services: n.filtered.services,
1759
+ value: o.serviceId,
1760
+ onChange: (k) => l(je(o, k)),
1761
+ compact: s.compactService
1762
+ }
1763
+ );
1764
+ case 4:
1765
+ return /* @__PURE__ */ a(
1766
+ We,
1767
+ {
1768
+ operators: n.filtered.operators,
1769
+ value: o.operatorId,
1770
+ onChange: (k) => l(qe(o, k))
1771
+ }
1772
+ );
1773
+ case 5:
1774
+ return i.availableDates.length === 0 && i.nextAvailableDate ? /* @__PURE__ */ a(
1775
+ et,
1776
+ {
1777
+ nextAvailableDate: i.nextAvailableDate,
1778
+ onJump: () => l(ke(o, i.nextAvailableDate)),
1779
+ locale: y
1780
+ }
1781
+ ) : /* @__PURE__ */ a(
1782
+ Ue,
1783
+ {
1784
+ availableDates: i.availableDates,
1785
+ selectedDate: o.date,
1786
+ onSelectDate: (k) => l(ke(o, k)),
1787
+ locale: y,
1788
+ loading: u
1789
+ }
1790
+ );
1791
+ case 6:
1792
+ return o.date ? /* @__PURE__ */ a(
1793
+ Ye,
1794
+ {
1795
+ date: o.date,
1796
+ slots: i.availableSlots[o.date] ?? [],
1797
+ selectedSlotKey: o.slotKey,
1798
+ onSelect: (k) => l(He(o, k.key)),
1799
+ loading: u,
1800
+ locale: y
1801
+ }
1802
+ ) : null;
1803
+ case 7:
1804
+ return n.selectedSlot ? /* @__PURE__ */ a(
1805
+ Te,
1806
+ {
1807
+ ...f,
1808
+ value: o.details ?? {},
1809
+ onChange: (k) => l({ ...o, details: k }),
1810
+ onSubmit: c,
1811
+ submitting: p,
1812
+ defaultPhoneCountry: x.country
1813
+ }
1814
+ ) : null;
1815
+ /* c8 ignore next 2 */
1816
+ default:
1817
+ return null;
1818
+ }
1819
+ }
1820
+ function _e() {
1821
+ const { t: e } = M();
1822
+ return I(
1823
+ () => ({
1824
+ 1: e("booking.insurance.heading"),
1825
+ 2: e("booking.specialty.heading"),
1826
+ 3: e("booking.service.heading"),
1827
+ 4: e("booking.operator.heading"),
1828
+ 5: e("booking.date.heading"),
1829
+ 6: e("booking.slot.heading"),
1830
+ 7: e("booking.details.heading")
1831
+ }),
1832
+ [e]
1833
+ );
1834
+ }
1835
+ function Ca(e) {
1836
+ const { cascade: t, value: s, activeStep: n, setActiveStep: i } = e, o = _e(), l = I(
1837
+ () => t.visibleSteps.map((d) => ({
1838
+ label: o[d],
1839
+ summary: at(d, s, t),
1840
+ status: pe(d, s) && d < t.currentStep ? "completed" : void 0,
1841
+ content: R(d, e, { compactService: !0 })
1842
+ })),
1843
+ [t, s, o, e]
1844
+ ), c = Math.max(0, t.visibleSteps.indexOf(n));
1845
+ return /* @__PURE__ */ a(
1846
+ ft,
1847
+ {
1848
+ activeStep: c,
1849
+ steps: l,
1850
+ onStepChange: (d) => {
1851
+ const h = t.visibleSteps[d];
1852
+ h && i(h);
1853
+ }
1854
+ }
1855
+ );
1856
+ }
1857
+ function pe(e, t) {
1858
+ switch (e) {
1859
+ case 1:
1860
+ return t.insuranceType !== void 0;
1861
+ case 2:
1862
+ return t.specialtyId !== void 0;
1863
+ case 3:
1864
+ return t.serviceId !== void 0;
1865
+ case 4:
1866
+ return t.operatorId !== void 0;
1867
+ case 5:
1868
+ return t.date !== void 0;
1869
+ case 6:
1870
+ return t.slotKey !== void 0;
1871
+ case 7:
1872
+ return !1;
1873
+ }
1874
+ }
1875
+ function at(e, t, s) {
1876
+ var n;
1877
+ if (pe(e, t))
1878
+ switch (e) {
1879
+ case 1:
1880
+ return t.insuranceType;
1881
+ case 2: {
1882
+ const i = s.filtered.specialties.find(
1883
+ (o) => o.id === t.specialtyId
1884
+ );
1885
+ return i == null ? void 0 : i.label;
1886
+ }
1887
+ case 3: {
1888
+ const i = s.filtered.services.find(
1889
+ (o) => o.id === t.serviceId
1890
+ );
1891
+ return i == null ? void 0 : i.label;
1892
+ }
1893
+ case 4: {
1894
+ const i = De(t);
1895
+ if (!i) return;
1896
+ const o = s.filtered.operators.find((l) => l.id === i);
1897
+ return o == null ? void 0 : o.name;
1898
+ }
1899
+ case 5:
1900
+ return t.date;
1901
+ case 6:
1902
+ return (n = s.selectedSlot) == null ? void 0 : n.time;
1903
+ case 7:
1904
+ return;
1905
+ }
1906
+ }
1907
+ function Ma(e) {
1908
+ const { cascade: t, value: s, setActiveStep: n } = e, { t: i } = M(), o = _e(), l = t.visibleSteps.filter(
1909
+ (d) => d === 1 || d === 2 || d === 3 || d === 4
1910
+ ), c = l.some(
1911
+ (d) => !pe(d, s)
1912
+ );
1913
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1914
+ c ? l.filter((d) => !pe(d, s)).slice(0, 1).map((d) => /* @__PURE__ */ a("div", { children: R(d, e, { compactService: !0 }) }, `csf-${d}`)) : /* @__PURE__ */ a(
1915
+ "div",
1916
+ {
1917
+ role: "group",
1918
+ "aria-label": i("booking.regionLabel"),
1919
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
1920
+ children: l.map((d) => {
1921
+ const h = at(d, s, t);
1922
+ return h ? /* @__PURE__ */ g(
1923
+ oe,
1924
+ {
1925
+ intent: "tonal",
1926
+ size: "sm",
1927
+ onClick: () => n(d),
1928
+ children: [
1929
+ o[d],
1930
+ ": ",
1931
+ h
1932
+ ]
1933
+ },
1934
+ `csc-${d}`
1935
+ ) : null;
1936
+ })
1937
+ }
1938
+ ),
1939
+ !c && t.gates.date ? /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
1940
+ /* @__PURE__ */ a("div", { className: "ds:min-w-0", children: R(5, e) }),
1941
+ /* @__PURE__ */ a("div", { className: "ds:min-w-0", children: s.date ? R(6, e) : null })
1942
+ ] }) : null,
1943
+ t.gates.details ? /* @__PURE__ */ a("div", { children: R(7, e) }) : null
1944
+ ] });
1945
+ }
1946
+ function Da(e) {
1947
+ const { cascade: t } = e, s = t.visibleSteps.filter(
1948
+ (n) => n === 1 || n === 2 || n === 3 || n === 4
1949
+ );
1950
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1951
+ /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
1952
+ /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: s.map((n) => /* @__PURE__ */ a("div", { children: R(n, e, { compactService: !0 }) }, `fbf-${n}`)) }),
1953
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1954
+ t.gates.date ? R(5, e) : null,
1955
+ t.gates.slot && e.value.date ? R(6, e) : null
1956
+ ] })
1957
+ ] }),
1958
+ t.gates.details ? R(7, e) : null
1959
+ ] });
1960
+ }
1961
+ function Ta(e) {
1962
+ const { cascade: t, value: s, activeStep: n, setActiveStep: i } = e, { t: o } = M(), l = _e(), c = t.visibleSteps, d = Math.max(0, c.indexOf(n)), h = c.length, u = I(
1963
+ () => c.map((f) => ({ label: l[f] })),
1964
+ [c, l]
1965
+ ), p = d > 0, y = d < h - 1 && pe(n, s);
1966
+ return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1967
+ /* @__PURE__ */ a(ht, { activeStep: d, steps: u }),
1968
+ /* @__PURE__ */ a("div", { children: R(n, e, { compactService: !0 }) }),
1969
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1970
+ /* @__PURE__ */ a(
1971
+ oe,
1972
+ {
1973
+ intent: "ghost",
1974
+ size: "md",
1975
+ disabled: !p,
1976
+ onClick: () => {
1977
+ const f = c[d - 1];
1978
+ f && i(f);
1979
+ },
1980
+ children: o("booking.actions.back")
1981
+ }
1982
+ ),
1983
+ n < 7 ? /* @__PURE__ */ a(
1984
+ oe,
1985
+ {
1986
+ intent: "primary",
1987
+ size: "md",
1988
+ disabled: !y,
1989
+ onClick: () => {
1990
+ const f = c[d + 1];
1991
+ f && i(f);
1992
+ },
1993
+ children: o("booking.actions.next")
1994
+ }
1995
+ ) : null
1996
+ ] })
1997
+ ] });
1998
+ }
1999
+ const _a = [], Aa = [], Ba = Ve(
2000
+ ({
2001
+ variant: e = "inline-list",
2002
+ country: t,
2003
+ useSpecialties: s = !1,
2004
+ allowOperatorSelection: n = !1,
2005
+ lockedOperatorId: i,
2006
+ autoSelectSingleService: o = !1,
2007
+ specialties: l,
2008
+ services: c,
2009
+ operators: d,
2010
+ availableDates: h,
2011
+ availableSlots: u,
2012
+ nextAvailableDate: p,
2013
+ requireCodiceFiscale: y,
2014
+ requireDateOfBirth: f,
2015
+ requireInsuranceNumber: x,
2016
+ showNote: k,
2017
+ showReturningPatientFlag: _,
2018
+ privacyPolicyUrl: Y,
2019
+ termsUrl: S,
2020
+ validateCodiceFiscale: r,
2021
+ validateInsuranceNumber: b,
2022
+ confirmationChannels: D,
2023
+ defaultConfirmationChannels: C,
2024
+ value: v,
2025
+ onChange: N,
2026
+ onSubmit: E,
2027
+ loadingSlots: Z,
2028
+ submitting: P,
2029
+ emptyServicesSlot: V,
2030
+ onboardingIncompleteSlot: F,
2031
+ "aria-label": T,
2032
+ id: K,
2033
+ className: j,
2034
+ ...ge
2035
+ }, te) => {
2036
+ const { t: re, i18n: J } = M(), A = e ?? "inline-list", q = J.language ?? "en", H = l ?? _a, G = d ?? Aa;
2037
+ se(() => {
2038
+ const L = da(v, {
2039
+ useSpecialties: s,
2040
+ lockedOperatorId: i,
2041
+ autoSelectSingleService: o,
2042
+ specialties: H,
2043
+ services: c
2044
+ });
2045
+ (L.specialtyId !== v.specialtyId || L.operatorId !== v.operatorId || L.serviceId !== v.serviceId) && N(L);
2046
+ }, [
2047
+ i,
2048
+ s,
2049
+ o,
2050
+ H,
2051
+ c
2052
+ ]);
2053
+ const B = I(
2054
+ () => ra({
2055
+ country: t,
2056
+ useSpecialties: s,
2057
+ allowOperatorSelection: n,
2058
+ lockedOperatorId: i,
2059
+ specialties: H,
2060
+ services: c,
2061
+ operators: G,
2062
+ availableSlots: u,
2063
+ value: v
2064
+ }),
2065
+ [
2066
+ t,
2067
+ s,
2068
+ n,
2069
+ i,
2070
+ o,
2071
+ H,
2072
+ c,
2073
+ G,
2074
+ h,
2075
+ u,
2076
+ v
2077
+ ]
2078
+ ), [de, ae] = z(
2079
+ B.currentStep
2080
+ ), le = ne(B.currentStep);
2081
+ se(() => {
2082
+ B.currentStep > le.current && ae(B.currentStep), le.current = B.currentStep;
2083
+ }, [B.currentStep]);
2084
+ const [X, W] = z("idle"), [m, w] = z(null), ce = ee(
2085
+ async (L) => {
2086
+ if (!B.selectedSlot) return;
2087
+ const Ie = {
2088
+ slot: B.selectedSlot,
2089
+ value: {
2090
+ ...v,
2091
+ details: L,
2092
+ operatorId: De(v) ?? v.operatorId
2093
+ },
2094
+ details: L
2095
+ };
2096
+ W("submitting");
2097
+ try {
2098
+ await E(Ie), w({
2099
+ slot: B.selectedSlot,
2100
+ details: L,
2101
+ insuranceType: v.insuranceType,
2102
+ operatorId: De(v),
2103
+ date: v.date
2104
+ }), W("success");
2105
+ } catch {
2106
+ throw W("error"), new Error("Booking submission failed");
2107
+ }
2108
+ },
2109
+ [B.selectedSlot, E, v]
2110
+ ), Ae = ne(null);
2111
+ ot(te, () => Ae.current, []);
2112
+ const Ne = I(
2113
+ () => ({
2114
+ getVariant: () => A,
2115
+ reset: () => {
2116
+ N({}), w(null), W("idle"), ae(1);
2117
+ },
2118
+ goToStep: (L) => {
2119
+ ae(L);
2120
+ }
2121
+ }),
2122
+ [A, N]
2123
+ );
2124
+ dt(ea, Ne, K);
2125
+ const st = T ?? re("booking.regionLabel"), nt = I(() => X !== "success" || !m ? null : /* @__PURE__ */ a(
2126
+ Ia,
2127
+ {
2128
+ snapshot: m,
2129
+ operators: G,
2130
+ locale: q,
2131
+ onReset: () => Ne.reset()
2132
+ }
2133
+ ), [X, m, G, q, Ne]), it = I(() => {
2134
+ if (X === "success") return null;
2135
+ const L = A === "accordion" ? Ca : A === "calendar" ? Ma : A === "flexible" ? Da : A === "progress" ? Ta : wa, Ie = {
2136
+ cascade: B,
2137
+ inputs: {
2138
+ specialties: H,
2139
+ services: c,
2140
+ operators: G,
2141
+ availableDates: h,
2142
+ availableSlots: u,
2143
+ nextAvailableDate: p
2144
+ },
2145
+ value: v,
2146
+ onChange: N,
2147
+ onSubmit: ce,
2148
+ policy: { country: t, lockedOperatorId: i },
2149
+ detailsProps: {
2150
+ requireCodiceFiscale: y,
2151
+ requireDateOfBirth: f,
2152
+ requireInsuranceNumber: x,
2153
+ insuranceType: v.insuranceType,
2154
+ showNote: k,
2155
+ showReturningPatientFlag: _,
2156
+ privacyPolicyUrl: Y,
2157
+ termsUrl: S,
2158
+ validateCodiceFiscale: r,
2159
+ validateInsuranceNumber: b,
2160
+ confirmationChannels: D,
2161
+ defaultConfirmationChannels: C
2162
+ },
2163
+ emptyServicesSlot: V,
2164
+ onboardingIncompleteSlot: F,
2165
+ loadingSlots: Z,
2166
+ submitting: P,
2167
+ locale: q,
2168
+ activeStep: de,
2169
+ setActiveStep: ae
2170
+ };
2171
+ return /* @__PURE__ */ a(L, { ...Ie });
2172
+ }, [
2173
+ X,
2174
+ A,
2175
+ B,
2176
+ H,
2177
+ c,
2178
+ G,
2179
+ h,
2180
+ u,
2181
+ p,
2182
+ v,
2183
+ N,
2184
+ ce,
2185
+ t,
2186
+ i,
2187
+ y,
2188
+ f,
2189
+ x,
2190
+ k,
2191
+ _,
2192
+ Y,
2193
+ S,
2194
+ r,
2195
+ b,
2196
+ D,
2197
+ C,
2198
+ V,
2199
+ F,
2200
+ Z,
2201
+ P,
2202
+ q,
2203
+ de
2204
+ ]);
2205
+ return /* @__PURE__ */ g(
2206
+ "div",
2207
+ {
2208
+ ref: Ae,
2209
+ role: "region",
2210
+ "aria-label": st,
2211
+ id: K,
2212
+ "data-component": "booking",
2213
+ "data-component-id": K,
2214
+ "data-variant": A,
2215
+ className: pa({ variant: A, className: j }),
2216
+ ...ge,
2217
+ children: [
2218
+ /* @__PURE__ */ g(
2219
+ "div",
2220
+ {
2221
+ className: [
2222
+ "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
2223
+ A === "inline-list" ? [
2224
+ "ds:rounded-[var(--radius-md)]",
2225
+ "ds:bg-[color-mix(in_srgb,var(--primary)_35%,var(--background))]",
2226
+ "ds:bg-[image:var(--gradient-hero-brand)]",
2227
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
2228
+ "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
2229
+ ].join(" ") : ""
2230
+ ].filter(Boolean).join(" "),
2231
+ children: [
2232
+ /* @__PURE__ */ a("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: re("booking.regionLabel") }),
2233
+ /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: re("booking.headingSubtitle") })
2234
+ ]
2235
+ }
2236
+ ),
2237
+ nt ?? it
2238
+ ]
2239
+ }
2240
+ );
2241
+ }
2242
+ );
2243
+ Ba.displayName = "Booking";
2244
+ export {
2245
+ Ba as B,
2246
+ Me as C,
2247
+ ue as O,
2248
+ ea as b
2249
+ };
2250
+ //# sourceMappingURL=booking-BYuc_8HV.js.map