@alfadocs/ui-kit-debug 1.120.0 → 1.122.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 (227) hide show
  1. package/assets/map-pin@2x.png +0 -0
  2. package/assets/map-pin@2x.source.json +5 -0
  3. package/dist/_chunks/addDays-CuE8wLqb.js +9 -0
  4. package/dist/_chunks/addDays-CuE8wLqb.js.map +1 -0
  5. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js → anamnesis-summary-rows-CtcULkvc.js} +2 -2
  6. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js.map → anamnesis-summary-rows-CtcULkvc.js.map} +1 -1
  7. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js → antenatal-schedule-timeline-XHbig8On.js} +3 -3
  8. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js.map → antenatal-schedule-timeline-XHbig8On.js.map} +1 -1
  9. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js → appointment-timeline-Czd4PBkF.js} +2 -2
  10. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js.map → appointment-timeline-Czd4PBkF.js.map} +1 -1
  11. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js → balance-badge-cell-DtxbGJcA.js} +2 -2
  12. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js.map → balance-badge-cell-DtxbGJcA.js.map} +1 -1
  13. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js → bill-line-table-HrynB7ND.js} +2 -2
  14. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js.map → bill-line-table-HrynB7ND.js.map} +1 -1
  15. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js → calendar-appointment-editor-dialog-CiCmsBCH.js} +5 -5
  16. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js.map → calendar-appointment-editor-dialog-CiCmsBCH.js.map} +1 -1
  17. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js → cycle-calculator-WFhMfJHt.js} +4 -3
  18. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js.map → cycle-calculator-WFhMfJHt.js.map} +1 -1
  19. package/dist/_chunks/{data-grid-Bbf8t4z3.js → data-grid-C71BhGDw.js} +2 -2
  20. package/dist/_chunks/{data-grid-Bbf8t4z3.js.map → data-grid-C71BhGDw.js.map} +1 -1
  21. package/dist/_chunks/{date-picker-DBVTj6lO.js → date-picker-BmVBVpVu.js} +3 -3
  22. package/dist/_chunks/{date-picker-DBVTj6lO.js.map → date-picker-BmVBVpVu.js.map} +1 -1
  23. package/dist/_chunks/{date-picker-variants-J1EeAhIH.js → date-picker-variants-DmfVRNDB.js} +184 -188
  24. package/dist/_chunks/date-picker-variants-DmfVRNDB.js.map +1 -0
  25. package/dist/_chunks/{date-range-panel-CT6nXjRM.js → date-range-panel-CT9Pk-HF.js} +2 -2
  26. package/dist/_chunks/{date-range-panel-CT6nXjRM.js.map → date-range-panel-CT9Pk-HF.js.map} +1 -1
  27. package/dist/_chunks/{date-range-picker-PTRpDkXT.js → date-range-picker-2Up_FRrM.js} +40 -39
  28. package/dist/_chunks/{date-range-picker-PTRpDkXT.js.map → date-range-picker-2Up_FRrM.js.map} +1 -1
  29. package/dist/_chunks/{date-time-picker-CJnqiQoT.js → date-time-picker-C6b_Vymc.js} +2 -2
  30. package/dist/_chunks/{date-time-picker-CJnqiQoT.js.map → date-time-picker-C6b_Vymc.js.map} +1 -1
  31. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js → default-tabs-RvCI5uN0.js} +3 -3
  32. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js.map → default-tabs-RvCI5uN0.js.map} +1 -1
  33. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js → due-date-calculator-CALlODZe.js} +4 -4
  34. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js.map → due-date-calculator-CALlODZe.js.map} +1 -1
  35. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js → gestational-age-calculator-mB6brTlp.js} +5 -5
  36. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js.map → gestational-age-calculator-mB6brTlp.js.map} +1 -1
  37. package/dist/_chunks/{hcg-doubling-BjTa_77t.js → hcg-doubling-Dhdt3Jyd.js} +3 -3
  38. package/dist/_chunks/{hcg-doubling-BjTa_77t.js.map → hcg-doubling-Dhdt3Jyd.js.map} +1 -1
  39. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js → invoice-upload-list-C95s5Q7m.js} +3 -3
  40. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js.map → invoice-upload-list-C95s5Q7m.js.map} +1 -1
  41. package/dist/_chunks/{kit-extensions-C3oL0WTp.js → kit-extensions-DUaIYyMD.js} +4 -4
  42. package/dist/_chunks/{kit-extensions-C3oL0WTp.js.map → kit-extensions-DUaIYyMD.js.map} +1 -1
  43. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js → link-cell-renderer-BEaLczk2.js} +2 -2
  44. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js.map → link-cell-renderer-BEaLczk2.js.map} +1 -1
  45. package/dist/_chunks/{map-view-h6ngp2xi.js → map-view-QWdQLHi9.js} +543 -495
  46. package/dist/_chunks/map-view-QWdQLHi9.js.map +1 -0
  47. package/dist/_chunks/{parse-BLBWPIgE.js → parse-BFur8Byx.js} +2 -2
  48. package/dist/_chunks/{parse-BLBWPIgE.js.map → parse-BFur8Byx.js.map} +1 -1
  49. package/dist/_chunks/{patient-details-C4dHR4iu.js → patient-details-Cba9HQj_.js} +2 -2
  50. package/dist/_chunks/{patient-details-C4dHR4iu.js.map → patient-details-Cba9HQj_.js.map} +1 -1
  51. package/dist/_chunks/{patient-field-row-0QP8KCVp.js → patient-field-row-CtDihADs.js} +2 -2
  52. package/dist/_chunks/{patient-field-row-0QP8KCVp.js.map → patient-field-row-CtDihADs.js.map} +1 -1
  53. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js → patient-summary-card-DnLdbtsw.js} +2 -2
  54. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js.map → patient-summary-card-DnLdbtsw.js.map} +1 -1
  55. package/dist/_chunks/practice-results-BCLqPdgn.js +2683 -0
  56. package/dist/_chunks/practice-results-BCLqPdgn.js.map +1 -0
  57. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js → pregnancy-dating-BNI32qNw.js} +5 -5
  58. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js.map → pregnancy-dating-BNI32qNw.js.map} +1 -1
  59. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js → radiograph-panel.agent-B-r3BoqU.js} +3 -3
  60. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js.map → radiograph-panel.agent-B-r3BoqU.js.map} +1 -1
  61. package/dist/_chunks/{registration-form-CMXefBnC.js → registration-form-CwbhtKcy.js} +180 -165
  62. package/dist/_chunks/registration-form-CwbhtKcy.js.map +1 -0
  63. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js → reserved.agent-CCwsOb3M.js} +8 -7
  64. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js.map → reserved.agent-CCwsOb3M.js.map} +1 -1
  65. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js → send-registration-link-form-BjkXr0TD.js} +3 -3
  66. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js.map → send-registration-link-form-BjkXr0TD.js.map} +1 -1
  67. package/dist/_chunks/{slot-grid-b4eZXokb.js → slot-grid-DEZRB4Yb.js} +234 -207
  68. package/dist/_chunks/slot-grid-DEZRB4Yb.js.map +1 -0
  69. package/dist/_chunks/subDays-DC99JK7a.js +8 -0
  70. package/dist/_chunks/{subDays-Bsoy023P.js.map → subDays-DC99JK7a.js.map} +1 -1
  71. package/dist/_chunks/{task-editor-Czcx9B-3.js → task-editor-C05yx7JJ.js} +2 -2
  72. package/dist/_chunks/{task-editor-Czcx9B-3.js.map → task-editor-C05yx7JJ.js.map} +1 -1
  73. package/dist/_chunks/{toolbar-DoKcoE2q.js → toolbar-Dznu_Dou.js} +2 -2
  74. package/dist/_chunks/{toolbar-DoKcoE2q.js.map → toolbar-Dznu_Dou.js.map} +1 -1
  75. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js → use-appointment-details-read-Bm408XzX.js} +2 -2
  76. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js.map → use-appointment-details-read-Bm408XzX.js.map} +1 -1
  77. package/dist/_chunks/{workflow-webhook-action-dgUjv9T7.js → workflow-webhook-action-Cae02r_4.js} +264 -289
  78. package/dist/_chunks/workflow-webhook-action-Cae02r_4.js.map +1 -0
  79. package/dist/agent-catalog.json +3 -11
  80. package/dist/agent-i18n/en.json +1 -2
  81. package/dist/browser-support.js +1 -1
  82. package/dist/components/appointment-details-panel/index.js +1 -1
  83. package/dist/components/appointment-timeline/index.js +1 -1
  84. package/dist/components/bill-line-table/index.js +1 -1
  85. package/dist/components/bill-table/index.js +1 -1
  86. package/dist/components/booking/index.js +1 -1
  87. package/dist/components/cycle-calculator/index.js +1 -1
  88. package/dist/components/data-grid/index.js +2 -2
  89. package/dist/components/data-table/index.js +1 -1
  90. package/dist/components/date-picker/index.js +1 -1
  91. package/dist/components/date-range-picker/index.js +1 -1
  92. package/dist/components/date-time-picker/index.js +1 -1
  93. package/dist/components/due-date-calculator/index.js +2 -2
  94. package/dist/components/gestational-age-calculator/index.js +1 -1
  95. package/dist/components/hcg-doubling/index.js +1 -1
  96. package/dist/components/invoice-upload-list/index.js +1 -1
  97. package/dist/components/map-view/index.d.ts +1 -1
  98. package/dist/components/map-view/index.d.ts.map +1 -1
  99. package/dist/components/map-view/index.js +1 -1
  100. package/dist/components/map-view/map-view.d.ts +18 -0
  101. package/dist/components/map-view/map-view.d.ts.map +1 -1
  102. package/dist/components/patient-details/index.js +1 -1
  103. package/dist/components/patient-summary-card/index.js +1 -1
  104. package/dist/components/patient-table/index.js +1 -1
  105. package/dist/components/practice-results/index.js +1 -1
  106. package/dist/components/practice-results/practice-results-slot-card.d.ts +38 -0
  107. package/dist/components/practice-results/practice-results-slot-card.d.ts.map +1 -0
  108. package/dist/components/practice-results/practice-results.d.ts +32 -2
  109. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  110. package/dist/components/pregnancy-dating/index.js +1 -1
  111. package/dist/components/radiograph-panel/index.js +1 -1
  112. package/dist/components/rich-text-editor/index.js +1 -1
  113. package/dist/components/slot-grid/index.js +1 -1
  114. package/dist/components/slot-grid/slot-grid.d.ts +19 -0
  115. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  116. package/dist/components/task-editor/index.js +1 -1
  117. package/dist/core.css +1 -1
  118. package/dist/host-compat.css +9 -1
  119. package/dist/i18n/locales/ar.d.ts +7 -5
  120. package/dist/i18n/locales/ar.d.ts.map +1 -1
  121. package/dist/i18n/locales/ar.js +8 -6
  122. package/dist/i18n/locales/ar.js.map +1 -1
  123. package/dist/i18n/locales/de.d.ts +7 -5
  124. package/dist/i18n/locales/de.d.ts.map +1 -1
  125. package/dist/i18n/locales/de.js +8 -6
  126. package/dist/i18n/locales/de.js.map +1 -1
  127. package/dist/i18n/locales/el.d.ts +7 -5
  128. package/dist/i18n/locales/el.d.ts.map +1 -1
  129. package/dist/i18n/locales/el.js +8 -6
  130. package/dist/i18n/locales/el.js.map +1 -1
  131. package/dist/i18n/locales/en.d.ts +7 -5
  132. package/dist/i18n/locales/en.d.ts.map +1 -1
  133. package/dist/i18n/locales/en.js +7 -5
  134. package/dist/i18n/locales/en.js.map +1 -1
  135. package/dist/i18n/locales/es.d.ts +7 -5
  136. package/dist/i18n/locales/es.d.ts.map +1 -1
  137. package/dist/i18n/locales/es.js +8 -6
  138. package/dist/i18n/locales/es.js.map +1 -1
  139. package/dist/i18n/locales/fr.d.ts +7 -5
  140. package/dist/i18n/locales/fr.d.ts.map +1 -1
  141. package/dist/i18n/locales/fr.js +8 -6
  142. package/dist/i18n/locales/fr.js.map +1 -1
  143. package/dist/i18n/locales/hi.d.ts +7 -5
  144. package/dist/i18n/locales/hi.d.ts.map +1 -1
  145. package/dist/i18n/locales/hi.js +8 -6
  146. package/dist/i18n/locales/hi.js.map +1 -1
  147. package/dist/i18n/locales/it.d.ts +7 -5
  148. package/dist/i18n/locales/it.d.ts.map +1 -1
  149. package/dist/i18n/locales/it.js +8 -6
  150. package/dist/i18n/locales/it.js.map +1 -1
  151. package/dist/i18n/locales/ja.d.ts +7 -5
  152. package/dist/i18n/locales/ja.d.ts.map +1 -1
  153. package/dist/i18n/locales/ja.js +8 -6
  154. package/dist/i18n/locales/ja.js.map +1 -1
  155. package/dist/i18n/locales/nl.d.ts +7 -5
  156. package/dist/i18n/locales/nl.d.ts.map +1 -1
  157. package/dist/i18n/locales/nl.js +8 -6
  158. package/dist/i18n/locales/nl.js.map +1 -1
  159. package/dist/i18n/locales/pl.d.ts +7 -5
  160. package/dist/i18n/locales/pl.d.ts.map +1 -1
  161. package/dist/i18n/locales/pl.js +8 -6
  162. package/dist/i18n/locales/pl.js.map +1 -1
  163. package/dist/i18n/locales/pt.d.ts +7 -5
  164. package/dist/i18n/locales/pt.d.ts.map +1 -1
  165. package/dist/i18n/locales/pt.js +8 -6
  166. package/dist/i18n/locales/pt.js.map +1 -1
  167. package/dist/i18n/locales/ro.d.ts +7 -5
  168. package/dist/i18n/locales/ro.d.ts.map +1 -1
  169. package/dist/i18n/locales/ro.js +8 -6
  170. package/dist/i18n/locales/ro.js.map +1 -1
  171. package/dist/i18n/locales/ru.d.ts +7 -5
  172. package/dist/i18n/locales/ru.d.ts.map +1 -1
  173. package/dist/i18n/locales/ru.js +8 -6
  174. package/dist/i18n/locales/ru.js.map +1 -1
  175. package/dist/i18n/locales/sq.d.ts +7 -5
  176. package/dist/i18n/locales/sq.d.ts.map +1 -1
  177. package/dist/i18n/locales/sq.js +8 -6
  178. package/dist/i18n/locales/sq.js.map +1 -1
  179. package/dist/i18n/locales/sv.d.ts +7 -5
  180. package/dist/i18n/locales/sv.d.ts.map +1 -1
  181. package/dist/i18n/locales/sv.js +8 -6
  182. package/dist/i18n/locales/sv.js.map +1 -1
  183. package/dist/i18n/locales/tr.d.ts +7 -5
  184. package/dist/i18n/locales/tr.d.ts.map +1 -1
  185. package/dist/i18n/locales/tr.js +8 -6
  186. package/dist/i18n/locales/tr.js.map +1 -1
  187. package/dist/i18n/locales/zh.d.ts +7 -5
  188. package/dist/i18n/locales/zh.d.ts.map +1 -1
  189. package/dist/i18n/locales/zh.js +8 -6
  190. package/dist/i18n/locales/zh.js.map +1 -1
  191. package/dist/index.js +32 -32
  192. package/dist/locales/ar.json +8 -6
  193. package/dist/locales/de.json +8 -6
  194. package/dist/locales/el.json +8 -6
  195. package/dist/locales/en.json +7 -5
  196. package/dist/locales/es.json +8 -6
  197. package/dist/locales/fr.json +8 -6
  198. package/dist/locales/hi.json +8 -6
  199. package/dist/locales/it.json +8 -6
  200. package/dist/locales/ja.json +8 -6
  201. package/dist/locales/nl.json +8 -6
  202. package/dist/locales/pl.json +8 -6
  203. package/dist/locales/pt.json +8 -6
  204. package/dist/locales/ro.json +8 -6
  205. package/dist/locales/ru.json +8 -6
  206. package/dist/locales/sq.json +8 -6
  207. package/dist/locales/sv.json +8 -6
  208. package/dist/locales/tr.json +8 -6
  209. package/dist/locales/zh.json +8 -6
  210. package/dist/patterns/anamnesis/index.js +1 -1
  211. package/dist/patterns/calendar/index.js +1 -1
  212. package/dist/patterns/registration-form/index.js +1 -1
  213. package/dist/patterns/send-registration-link-form/index.js +1 -1
  214. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  215. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts.map +1 -1
  216. package/dist/tokens.css +1 -1
  217. package/package.json +1 -1
  218. package/dist/_chunks/date-picker-variants-J1EeAhIH.js.map +0 -1
  219. package/dist/_chunks/key-round-DIgsnJSg.js +0 -21
  220. package/dist/_chunks/key-round-DIgsnJSg.js.map +0 -1
  221. package/dist/_chunks/map-view-h6ngp2xi.js.map +0 -1
  222. package/dist/_chunks/practice-results-yCresv86.js +0 -2326
  223. package/dist/_chunks/practice-results-yCresv86.js.map +0 -1
  224. package/dist/_chunks/registration-form-CMXefBnC.js.map +0 -1
  225. package/dist/_chunks/slot-grid-b4eZXokb.js.map +0 -1
  226. package/dist/_chunks/subDays-Bsoy023P.js +0 -8
  227. package/dist/_chunks/workflow-webhook-action-dgUjv9T7.js.map +0 -1
@@ -0,0 +1,2683 @@
1
+ import { jsxs as v, jsx as n, Fragment as Ue } from "react/jsx-runtime";
2
+ import { createContext as sn, useRef as F, useState as J, useEffect as U, useCallback as $, forwardRef as rn, useMemo as q, useImperativeHandle as on, useContext as yt } from "react";
3
+ import { c as le } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as _ } from "react-i18next";
5
+ import { A as Ce } from "./alert-C4WKViaS.js";
6
+ import { A as We } from "./avatar-Dp5apm1d.js";
7
+ import { B as ve } from "./button-DohK_Ak_.js";
8
+ import { D as ce } from "./dropdown-menu-Dw6sgQwJ.js";
9
+ import { E as cn } from "./empty-state-DwJ5YNzz.js";
10
+ import { M as ln, i as Ze } from "./map-view-QWdQLHi9.js";
11
+ import { R as Xe } from "./rating-CGYpg5dj.js";
12
+ import { S as ae } from "./sheet-uZZXaO_S.js";
13
+ import { S as dn } from "./skeleton-tTWJpvAq.js";
14
+ import { S as un } from "./spinner-CoflYlEx.js";
15
+ import { B as se } from "./badge-BUk4RjTS.js";
16
+ import { u as Ye } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
17
+ import { u as Pe } from "./use-media-query-CcAx5SMM.js";
18
+ import { m as mn } from "./motion-is-off-BvAuNV5O.js";
19
+ import { l as ut } from "./length-token-DwMnGEYT.js";
20
+ import { b as bt, a as mt } from "./format-price-CIX0YJZn.js";
21
+ import { u as fn } from "./registry-DvAUVLHh.js";
22
+ import { S as pn } from "./slot-grid-DEZRB4Yb.js";
23
+ import { s as ft, f as Se, d as hn } from "./format-ql5WTsYT.js";
24
+ import { a as Ke } from "./addDays-CuE8wLqb.js";
25
+ import { p as ye } from "./parseISO-Dl4T9peU.js";
26
+ import { c as gn } from "./createLucideIcon-DhHxpK9K.js";
27
+ import { R as vn } from "./refresh-cw-DnI0cLFC.js";
28
+ import { C as xt } from "./chevron-down-DWE7GSq9.js";
29
+ import { L as wt } from "./languages-CGLX6Qpe.js";
30
+ import { S as kt } from "./shield-check-DCJALLVh.js";
31
+ import { H as Ct } from "./heart--qCA4ffe.js";
32
+ import { M as Ne } from "./map-pin-BaY37-Km.js";
33
+ import { C as yn } from "./calendar-clock-hbObjfGY.js";
34
+ import { C as bn } from "./calendar-plus-BFrIRE4r.js";
35
+ /**
36
+ * @license lucide-react v1.22.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */
41
+ const xn = [
42
+ [
43
+ "path",
44
+ {
45
+ d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
46
+ key: "169xi5"
47
+ }
48
+ ],
49
+ ["path", { d: "M15 5.764v15", key: "1pn4in" }],
50
+ ["path", { d: "M9 3.236v15", key: "1uimfh" }]
51
+ ], wn = gn("map", xn), kn = {
52
+ id: "practice-results",
53
+ // `scroll` backs scroll_to_result (light highlight, no selection). focus_pin
54
+ // follows the pin-click rules: on a map variant at `lg` and up it chooses the
55
+ // card and the choice persists until another pin, a card or the map is
56
+ // clicked, so it is `select_single`; elsewhere it is a light highlight. The active variant is consumer-owned via props, so there is
57
+ // no `view_change` action — variant is read-only state, not an operation; and
58
+ // there is no in-component routing, so no `navigate`.
59
+ capabilities: ["scroll", "select_single"],
60
+ state: {
61
+ variant: {
62
+ type: "string",
63
+ descriptionKey: "ui.agent.practiceResults.state.variant",
64
+ description: "Active variant — one of `split-list-map`, `map-first`, `rich-cards`, `slot-cards`.",
65
+ read: (e) => e.getVariant()
66
+ }
67
+ },
68
+ actions: {
69
+ scroll_to_result: {
70
+ safety: "read",
71
+ argsType: "{ id: string }",
72
+ argsSchema: {
73
+ type: "object",
74
+ properties: {
75
+ id: {
76
+ type: "string",
77
+ description: "Stable result id (the data-result-id of the card)."
78
+ }
79
+ },
80
+ required: ["id"]
81
+ },
82
+ idempotent: !0,
83
+ descriptionKey: "ui.agent.practiceResults.actions.scrollToResult",
84
+ description: 'Scroll the result card with the given id into the visible viewport and give it a light highlight. It does not choose the card: no "Selected on the map" tag.',
85
+ examples: [
86
+ { args: { id: "practice-42" }, note: "Scroll to a specific result." }
87
+ ],
88
+ invoke: (e, t) => {
89
+ e.scrollToResult(t.id);
90
+ }
91
+ },
92
+ focus_pin: {
93
+ safety: "read",
94
+ argsType: "{ id: string }",
95
+ argsSchema: {
96
+ type: "object",
97
+ properties: {
98
+ id: {
99
+ type: "string",
100
+ description: "Stable result id whose map pin to choose."
101
+ }
102
+ },
103
+ required: ["id"]
104
+ },
105
+ idempotent: !0,
106
+ descriptionKey: "ui.agent.practiceResults.actions.focusPin",
107
+ description: 'Choose the result with the given id as a pin click would. On a map variant at lg width and up the card gets the strong highlight and the "Selected on the map" tag, kept until another pin, a card or the map is clicked. On rich-cards or a narrow screen it gives a light highlight only.',
108
+ examples: [
109
+ {
110
+ args: { id: "practice-42" },
111
+ note: "Choose the matching result and pin, as a pin click does."
112
+ }
113
+ ],
114
+ invoke: (e, t) => {
115
+ e.focusPin(t.id);
116
+ }
117
+ }
118
+ },
119
+ domHooks: {
120
+ root: {
121
+ attr: "data-component",
122
+ value: "practice-results",
123
+ description: "Marks the PracticeResults root region. The headingLevel prop accepts 1 to 6 (default 2) for the optional results heading; use 1 when it is the page title. Card names and default error and empty-state titles use the next level, capped at 6."
124
+ },
125
+ instanceId: {
126
+ attr: "data-component-id",
127
+ sourceProp: "id",
128
+ description: "Sourced from the id prop."
129
+ },
130
+ item: {
131
+ attr: "data-result-id",
132
+ description: 'Stable result id emitted on each rendered result card. Used by scroll_to_result / focus_pin to address a single result. The non-focusable card group is labelled by the practice-result-{id}-name heading, which contains data-component="practice-result-name-link": a visible link to result.href that navigates without firing onResultSelect or click telemetry. Each card also carries up to two CTA anchors: data-component="practice-result-open-cta" (practice page; absent when the consumer sets showCardOpenButton=false) and data-component="practice-result-book-cta" (booking flow; data-slot-aware="true" when it deep-links to a next slot). Card content carries its own read-only hooks: data-component="practice-result-tagline", data-component="practice-result-description", data-component="practice-result-latest-review" (the newest approved review as one truncated line under the rating, from latestReview; its text span carries the language of the review as lang; absent without latestReview), and data-component="practice-result-price" (the kit-formatted first-visit cost: firstVisitPrice supports fixed, from and range amounts plus an optional practice-written label; it takes precedence over the older firstVisitPriceCents fixed-price field. Absent when neither price is set). In the slot-cards variant a card with firstVisit also carries data-component="practice-result-first-visit" (the service and its price) and data-component="practice-result-slots" (the booking grid; its time buttons carry data-slot-id and can be clicked directly), and the card root has data-slot-cards="true".'
133
+ }
134
+ }
135
+ }, Re = 4, Cn = 90, Rn = "400px 0px", Qe = sn(
136
+ null
137
+ );
138
+ function Sn(e) {
139
+ return Se(
140
+ typeof e == "string" ? ye(e) : e,
141
+ "yyyy-MM-dd"
142
+ );
143
+ }
144
+ function Nn(e, t, a) {
145
+ const r = /* @__PURE__ */ new Map();
146
+ for (const i of Array.isArray(e) ? e : [])
147
+ r.set(Sn(i.date), i);
148
+ return Array.from({ length: a }, (i, s) => {
149
+ const c = Ke(t, s), l = r.get(Se(c, "yyyy-MM-dd"));
150
+ return l ? { ...l, slots: Array.isArray(l.slots) ? l.slots : [] } : { date: c, slots: [] };
151
+ });
152
+ }
153
+ function Mn({
154
+ firstVisit: e,
155
+ currencyCode: t = "EUR"
156
+ }) {
157
+ const { t: a, i18n: r } = _("ui"), i = e.priceCents != null && Number.isFinite(e.priceCents) ? bt(
158
+ e.priceCents,
159
+ t,
160
+ r.language ?? "en",
161
+ a("common.freeOfCharge")
162
+ ) : void 0;
163
+ return /* @__PURE__ */ v(
164
+ "p",
165
+ {
166
+ "data-component": "practice-result-first-visit",
167
+ className: "type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-baseline ds:gap-x-[var(--spacing-xs)] ds:text-[var(--foreground)]",
168
+ children: [
169
+ /* @__PURE__ */ n("span", { dir: "auto", className: "ds:font-[var(--font-weight-semibold)]", children: e.label }),
170
+ i ? /* @__PURE__ */ v(Ue, { children: [
171
+ /* @__PURE__ */ n("span", { className: "ds:sr-only", children: ": " }),
172
+ /* @__PURE__ */ n("span", { className: "ds:text-[var(--muted-foreground)]", children: i })
173
+ ] }) : null
174
+ ]
175
+ }
176
+ );
177
+ }
178
+ function Ln({
179
+ result: e,
180
+ nameHeadingLevel: t,
181
+ context: a,
182
+ children: r
183
+ }) {
184
+ const { t: i, i18n: s } = _("ui"), c = s.language ?? "en", l = F(null), o = Pe("(min-width: 640px)") ? 5 : 3, [d, g] = J(() => ft(/* @__PURE__ */ new Date())), [p, w] = J(0), [b, k] = J(!1), [S, V] = J(
185
+ () => typeof IntersectionObserver > "u"
186
+ ), [E, P] = J(
187
+ () => a.cache.get(e.id) ?? {}
188
+ ), T = F(
189
+ new Map(
190
+ Object.keys(a.cache.get(e.id) ?? {}).map((u) => [
191
+ u,
192
+ "done"
193
+ ])
194
+ )
195
+ ), C = F(!0), h = F({ result: e, context: a });
196
+ U(() => {
197
+ h.current = { result: e, context: a };
198
+ }), U(() => (C.current = !0, () => {
199
+ C.current = !1;
200
+ }), []), U(() => {
201
+ if (S) return;
202
+ const u = l.current;
203
+ if (!u) return;
204
+ const N = new IntersectionObserver(
205
+ (I) => {
206
+ I.some((ee) => ee.isIntersecting) && (V(!0), N.disconnect());
207
+ },
208
+ { root: null, rootMargin: Rn }
209
+ );
210
+ return N.observe(u), () => N.disconnect();
211
+ }, [S]);
212
+ const R = $(
213
+ (u, N) => {
214
+ const I = Ke(d, u);
215
+ return { from: I, key: `${Se(I, "yyyy-MM-dd")}|${N}`, days: N };
216
+ },
217
+ [d]
218
+ ), L = $(
219
+ (u, N) => {
220
+ const I = T.current.get(u.key);
221
+ if (I === "pending" || I === "done" || I === "error" && !N) return;
222
+ T.current.set(u.key, "pending"), P((O) => ({ ...O, [u.key]: { status: "loading" } }));
223
+ const { result: ee, context: W } = h.current;
224
+ Promise.resolve().then(
225
+ () => W.loadResultSlots(ee, {
226
+ from: Se(u.from, "yyyy-MM-dd"),
227
+ days: u.days
228
+ })
229
+ ).then((O) => {
230
+ const A = Nn(O, u.from, u.days);
231
+ return T.current.set(u.key, "done"), W.cache.set(ee.id, {
232
+ ...W.cache.get(ee.id),
233
+ [u.key]: { status: "ready", days: A }
234
+ }), { status: "ready", days: A };
235
+ }).catch(() => (T.current.set(u.key, "error"), { status: "error" })).then((O) => {
236
+ C.current && P((A) => ({ ...A, [u.key]: O }));
237
+ });
238
+ },
239
+ []
240
+ ), H = R(p, o), X = R(0, o), G = $(() => {
241
+ const u = ft(/* @__PURE__ */ new Date());
242
+ return u.getTime() === d.getTime() ? !1 : (g(u), w(0), k(!1), !0);
243
+ }, [d]);
244
+ U(() => {
245
+ if (!S) return;
246
+ const u = () => {
247
+ document.visibilityState === "visible" && G();
248
+ };
249
+ return document.addEventListener("visibilitychange", u), () => document.removeEventListener("visibilitychange", u);
250
+ }, [S, G]), U(() => {
251
+ !S || G() || L(X, !1);
252
+ }, [S, X.key, L]), U(() => {
253
+ S && p > 0 && L(H, !1);
254
+ }, [S, H.key, L]);
255
+ const z = F(null), y = F(null), K = (u, N) => {
256
+ const I = Math.max(0, u);
257
+ y.current = {
258
+ kind: N,
259
+ key: R(I, o).key
260
+ }, w(I), k(!1), L(R(I, o), !0);
261
+ }, D = E[H.key], B = !S || !D || D.status === "loading", de = (D == null ? void 0 : D.status) === "error";
262
+ U(() => {
263
+ var oe;
264
+ const u = z.current, N = y.current;
265
+ if (!u || !N || B || N.key !== void 0 && N.key !== H.key) return;
266
+ y.current = null;
267
+ const I = N.kind;
268
+ if (I === "more") {
269
+ const Z = Array.from(
270
+ u.querySelectorAll('[role="group"]')
271
+ ).find(
272
+ (Y) => Y.querySelectorAll("button").length > Re
273
+ );
274
+ (oe = Z == null ? void 0 : Z.querySelectorAll("button")[Re]) == null || oe.focus();
275
+ return;
276
+ }
277
+ const ee = (Z) => i(Z === "next" ? "slotGrid.nextDays" : "slotGrid.previousDays"), W = (Z) => u.querySelector(
278
+ `button[aria-label="${CSS.escape(ee(Z))}"]`
279
+ ), O = W(I), A = W(I === "next" ? "previous" : "next"), re = O && !O.disabled ? O : A;
280
+ requestAnimationFrame(() => {
281
+ const Z = document.activeElement;
282
+ Z && Z !== document.body && !u.contains(Z) || re == null || re.focus();
283
+ });
284
+ }, [B, H.key, b, i]);
285
+ const he = (u, N) => {
286
+ const I = typeof u.start == "string" ? ye(u.start) : u.start, ee = typeof N.date == "string" ? ye(N.date) : N.date;
287
+ let W = u.label ?? "", O = N.label ?? "";
288
+ try {
289
+ if (!W) {
290
+ const A = new Intl.DateTimeFormat(c, {
291
+ hour: "numeric",
292
+ minute: "2-digit"
293
+ }), re = typeof u.end == "string" ? ye(u.end) : u.end;
294
+ W = re && typeof A.formatRange == "function" ? A.formatRange(I, re) : A.format(I);
295
+ }
296
+ O || (O = new Intl.DateTimeFormat(c, {
297
+ weekday: "long",
298
+ day: "numeric",
299
+ month: "long"
300
+ }).format(ee));
301
+ } catch {
302
+ W = W || String(u.start), O = O || String(N.date);
303
+ }
304
+ return i("practiceResults.slotCards.slotLabel", {
305
+ practice: e.name,
306
+ day: O,
307
+ time: W
308
+ });
309
+ };
310
+ let ie, ue = 0;
311
+ B ? ie = Array.from({ length: o }, (u, N) => ({
312
+ date: Ke(H.from, N),
313
+ slots: []
314
+ })) : de || !D || D.status !== "ready" ? ie = [] : ie = D.days.map((u) => {
315
+ const N = u.slots.map((I) => ({
316
+ ...I,
317
+ ariaLabel: I.ariaLabel ?? he(I, u)
318
+ }));
319
+ return b ? { ...u, slots: N } : (ue += Math.max(0, N.length - Re), { ...u, slots: N.slice(0, Re) });
320
+ });
321
+ const me = /* @__PURE__ */ v(
322
+ "div",
323
+ {
324
+ ref: (u) => {
325
+ l.current = u, z.current = u;
326
+ },
327
+ "data-component": "practice-result-slots",
328
+ className: "ds:flex ds:min-h-[16rem] ds:min-w-0 ds:basis-full ds:flex-col ds:gap-[var(--spacing-xs)] ds:@min-[800px]/result-card:basis-[28rem] ds:@min-[800px]/result-card:shrink-0",
329
+ children: [
330
+ de ? /* @__PURE__ */ v(
331
+ "div",
332
+ {
333
+ role: "alert",
334
+ className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-sm)]",
335
+ children: [
336
+ /* @__PURE__ */ n("p", { className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]", children: i("practiceResults.error.description") }),
337
+ /* @__PURE__ */ n(
338
+ ve,
339
+ {
340
+ intent: "secondary",
341
+ size: "sm",
342
+ onClick: () => {
343
+ y.current = null, L(H, !0);
344
+ },
345
+ children: i("practiceResults.error.retry")
346
+ }
347
+ )
348
+ ]
349
+ }
350
+ ) : /* @__PURE__ */ n(
351
+ pn,
352
+ {
353
+ role: "group",
354
+ size: "sm",
355
+ nowrapTimes: !0,
356
+ compactEmptyDays: !0,
357
+ ariaLabel: i("practiceResults.slotCards.gridLabel", {
358
+ practice: e.name
359
+ }),
360
+ days: ie,
361
+ state: B ? "loading" : "default",
362
+ dayHeadingLevel: Math.min(6, Math.max(3, t + 1)),
363
+ maxInitialSlotsPerDay: Number.MAX_SAFE_INTEGER,
364
+ hasPrevious: p > 0,
365
+ hasNext: p + o < Cn,
366
+ onPreviousDays: () => K(p - o, "previous"),
367
+ onNextDays: () => K(p + o, "next"),
368
+ onSlotSelect: (u, N) => a.onSlotSelect(e, u, N)
369
+ }
370
+ ),
371
+ ue > 0 ? /* @__PURE__ */ n(
372
+ ve,
373
+ {
374
+ intent: "ghost",
375
+ size: "sm",
376
+ className: "ds:self-start",
377
+ onClick: () => {
378
+ y.current = { kind: "more" }, k(!0);
379
+ },
380
+ children: i("practiceResults.slotCards.showMoreTimes")
381
+ }
382
+ ) : null
383
+ ]
384
+ }
385
+ );
386
+ return /* @__PURE__ */ n(Ue, { children: r(me) });
387
+ }
388
+ const Pn = 13, pt = [
389
+ "distance",
390
+ "rating",
391
+ "next-available",
392
+ "price",
393
+ "relevance"
394
+ ];
395
+ function Rt(e, t, a) {
396
+ const r = `languages.${e}`;
397
+ return a.exists(r) ? t(r) : e.toUpperCase();
398
+ }
399
+ function ne(e, t) {
400
+ if (typeof window > "u") return;
401
+ const a = window.track;
402
+ try {
403
+ a == null || a(e, t);
404
+ } catch {
405
+ }
406
+ }
407
+ function ge(e, t, a, r) {
408
+ const i = e.findIndex((c) => c.id === t);
409
+ if (i < 0) return;
410
+ const s = e[i];
411
+ s && (ne("serp_result_clicked", { resultId: t, source: a, position: i }), r(s, a));
412
+ }
413
+ function In(e, t) {
414
+ const r = (t.lat - e.lat) * Math.PI / 180, i = (t.lng - e.lng) * Math.PI / 180, s = e.lat * Math.PI / 180, c = t.lat * Math.PI / 180, l = Math.sin(r / 2), f = Math.sin(i / 2), o = l * l + Math.cos(s) * Math.cos(c) * f * f;
415
+ return 2 * 6371 * Math.asin(Math.min(1, Math.sqrt(o)));
416
+ }
417
+ function An(e, t, a) {
418
+ var i;
419
+ const r = [];
420
+ for (const s of e) {
421
+ const c = s.field ?? s.key, l = (((i = a == null ? void 0 : a[s.key]) == null ? void 0 : i.length) ?? 0) > 0, f = s.type === "boolean" || s.type !== "options" && s.options.length === 0 && (l || t.some(
422
+ (o) => typeof o[c] == "boolean"
423
+ ));
424
+ !f && s.options.length === 0 || r.push({ ...s, boolean: f, booleanField: c });
425
+ }
426
+ return r;
427
+ }
428
+ function Fn(e, t, a) {
429
+ return !t || Object.keys(t).length === 0 ? e : e.filter((r) => {
430
+ for (const i of a) {
431
+ const s = t[i.key];
432
+ if (!s || s.length === 0) continue;
433
+ if (i.boolean) {
434
+ if (r[i.booleanField] !== !0) return !1;
435
+ continue;
436
+ }
437
+ const c = i.key === "insurance" ? r.insurances : i.key === "language" ? r.languages : r[i.key];
438
+ if (!Array.isArray(c) || !(i.multi ? s.some((f) => c.includes(f)) : c.includes(s[0]))) return !1;
439
+ }
440
+ return !0;
441
+ });
442
+ }
443
+ function _n(e) {
444
+ const t = e.firstVisitPrice && Number.isFinite(e.firstVisitPrice.minCents) ? e.firstVisitPrice.minCents : e.firstVisitPriceCents;
445
+ return t != null && Number.isFinite(t) && t >= 0 ? t : 1 / 0;
446
+ }
447
+ function Tn(e) {
448
+ return e.firstVisitPrice && Number.isFinite(e.firstVisitPrice.minCents) ? e.firstVisitPrice.kind === "fixed" : !0;
449
+ }
450
+ function ht(e, t) {
451
+ return e == null && t == null ? 0 : e == null ? 1 : t == null ? -1 : e - t;
452
+ }
453
+ function Hn(e, t, a) {
454
+ const r = e.map((s) => {
455
+ const c = s.location ? s.location.distanceKm ?? (a ? In(a, s.location) : void 0) : void 0;
456
+ return {
457
+ result: s,
458
+ distanceKm: c,
459
+ price: t === "price" ? _n(s) : void 0,
460
+ fixed: t === "price" ? Tn(s) : !1
461
+ };
462
+ }), i = (s, c) => {
463
+ var l, f, o, d;
464
+ switch (t) {
465
+ case "distance":
466
+ return ht(s.distanceKm, c.distanceKm);
467
+ case "price": {
468
+ const g = s.price ?? 1 / 0, p = c.price ?? 1 / 0;
469
+ return g !== p ? g - p : g !== 1 / 0 && s.fixed !== c.fixed ? s.fixed ? -1 : 1 : ht(s.distanceKm, c.distanceKm);
470
+ }
471
+ case "rating": {
472
+ const g = ((l = s.result.rating) == null ? void 0 : l.value) ?? -1;
473
+ return (((f = c.result.rating) == null ? void 0 : f.value) ?? -1) - g;
474
+ }
475
+ case "next-available": {
476
+ const g = ((o = s.result.nextAvailableSlot) == null ? void 0 : o.dateTime) ?? "", p = ((d = c.result.nextAvailableSlot) == null ? void 0 : d.dateTime) ?? "";
477
+ return !g && !p ? 0 : g ? p ? g.localeCompare(p) : -1 : 1;
478
+ }
479
+ case "relevance":
480
+ default:
481
+ return 0;
482
+ }
483
+ };
484
+ return [...r].sort(i).map(
485
+ ({ result: s, distanceKm: c }) => c != null && s.location ? {
486
+ ...s,
487
+ location: { ...s.location, distanceKm: c }
488
+ } : s
489
+ );
490
+ }
491
+ function Dn(e) {
492
+ let t = -1 / 0, a = 1 / 0, r = -1 / 0, i = 1 / 0, s = !1;
493
+ for (const c of e) {
494
+ if (!c.location) continue;
495
+ s = !0;
496
+ const { lat: l, lng: f } = c.location;
497
+ l > t && (t = l), l < a && (a = l), f > r && (r = f), f < i && (i = f);
498
+ }
499
+ if (s)
500
+ return { north: t, south: a, east: r, west: i };
501
+ }
502
+ const On = le(
503
+ "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)] ds:gap-[var(--spacing-md)]",
504
+ {
505
+ variants: {
506
+ variant: {
507
+ "split-list-map": "",
508
+ "map-first": "",
509
+ "rich-cards": "",
510
+ "slot-cards": ""
511
+ }
512
+ },
513
+ defaultVariants: { variant: "split-list-map" }
514
+ }
515
+ );
516
+ function St({
517
+ heading: e,
518
+ headingLevel: t,
519
+ intro: a,
520
+ totalCount: r,
521
+ searchCentreLabel: i
522
+ }) {
523
+ const { t: s } = _("ui"), c = `h${t}`;
524
+ if (!e && !a && r == null) return null;
525
+ const l = r != null ? i ? s("practiceResults.results.heading", {
526
+ count: r,
527
+ place: i
528
+ }) : s("practiceResults.results.summary", { count: r }) : void 0;
529
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
530
+ e ? /* @__PURE__ */ n(c, { className: "type-title-section ds:m-0 ds:text-[var(--foreground)]", children: e }) : null,
531
+ a ? /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: a }) : null,
532
+ l ? /* @__PURE__ */ n(
533
+ "p",
534
+ {
535
+ className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
536
+ "aria-live": "polite",
537
+ children: l
538
+ }
539
+ ) : null
540
+ ] });
541
+ }
542
+ const Me = le(
543
+ [
544
+ "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
545
+ "ds:min-h-[var(--min-target-size)]",
546
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
547
+ "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
548
+ "ds:rounded-[var(--radius-full)]",
549
+ "type-label",
550
+ "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
551
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
552
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
553
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
554
+ ].join(" "),
555
+ {
556
+ variants: {
557
+ state: {
558
+ idle: "ds:bg-[var(--secondary)] ds:text-[var(--foreground)] ds:border ds:border-[color:var(--border)] ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,var(--secondary))]",
559
+ active: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
560
+ }
561
+ },
562
+ defaultVariants: { state: "idle" }
563
+ }
564
+ ), Vn = le(
565
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
566
+ {
567
+ variants: {
568
+ placement: {
569
+ inline: "",
570
+ // Floating chrome on map-first: soft `--popover` surface so chips
571
+ // read over the map without losing contrast. Same surface as
572
+ // dropdowns / sheets — themed and forced-colors safe.
573
+ floating: [
574
+ "ds:rounded-[var(--radius-full)]",
575
+ "ds:bg-[var(--popover)] ds:shadow-[var(--shadow-md)]",
576
+ "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
577
+ "ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]"
578
+ ].join(" ")
579
+ }
580
+ },
581
+ defaultVariants: { placement: "inline" }
582
+ }
583
+ ), En = le(
584
+ [
585
+ "ds:ms-[var(--spacing-xs)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
586
+ "ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]",
587
+ "type-label ds:text-[color:var(--muted-foreground)]",
588
+ "ds:rounded-[var(--radius-sm)]",
589
+ "ds:hover:text-[color:var(--foreground)]",
590
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
591
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
592
+ ].join(" ")
593
+ );
594
+ function Nt({
595
+ facets: e,
596
+ value: t,
597
+ onChange: a,
598
+ floating: r
599
+ }) {
600
+ const { t: i } = _("ui"), s = q(() => t ?? {}, [t]), c = q(
601
+ () => Object.values(s).some((d) => d && d.length > 0),
602
+ [s]
603
+ ), l = (d, g) => {
604
+ const p = { ...s };
605
+ g.length === 0 ? delete p[d] : p[d] = g, a(p), ne("serp_filter_changed", { key: d, values: g });
606
+ }, f = (d) => {
607
+ var p;
608
+ const g = (((p = s[d]) == null ? void 0 : p.length) ?? 0) > 0;
609
+ l(d, g ? [] : ["true"]);
610
+ }, o = (d, g) => {
611
+ const p = s[d.key] ?? [], w = p.includes(g);
612
+ let b;
613
+ d.multi ? b = w ? p.filter((k) => k !== g) : [...p, g] : b = w ? [] : [g], l(d.key, b);
614
+ };
615
+ return e.length === 0 ? null : /* @__PURE__ */ v(
616
+ "div",
617
+ {
618
+ "data-component": "practice-results-filters",
619
+ role: "group",
620
+ "aria-label": i("practiceResults.filters.label"),
621
+ className: Vn({
622
+ placement: r ? "floating" : "inline"
623
+ }),
624
+ children: [
625
+ e.map((d) => {
626
+ const g = d.boolean, p = s[d.key] ?? [], w = p.length > 0;
627
+ if (g)
628
+ return /* @__PURE__ */ n(
629
+ "button",
630
+ {
631
+ type: "button",
632
+ "aria-pressed": w,
633
+ "aria-label": d.label,
634
+ onClick: () => f(d.key),
635
+ className: Me({
636
+ state: w ? "active" : "idle"
637
+ }),
638
+ children: /* @__PURE__ */ n("span", { children: d.label })
639
+ },
640
+ d.key
641
+ );
642
+ const b = w ? ` (${p.length})` : "";
643
+ return /* @__PURE__ */ v(ce.Root, { children: [
644
+ /* @__PURE__ */ n(ce.Trigger, { asChild: !0, children: /* @__PURE__ */ v(
645
+ "button",
646
+ {
647
+ type: "button",
648
+ "aria-label": `${d.label}${b}`,
649
+ className: Me({
650
+ state: w ? "active" : "idle"
651
+ }),
652
+ children: [
653
+ /* @__PURE__ */ v("span", { children: [
654
+ d.label,
655
+ b
656
+ ] }),
657
+ /* @__PURE__ */ n(
658
+ xt,
659
+ {
660
+ "aria-hidden": "true",
661
+ className: "ds:size-3.5 ds:shrink-0"
662
+ }
663
+ )
664
+ ]
665
+ }
666
+ ) }),
667
+ /* @__PURE__ */ n(ce.Content, { sideOffset: 8, align: "start", children: d.options.map((k) => /* @__PURE__ */ n(
668
+ ce.CheckboxItem,
669
+ {
670
+ checked: p.includes(k.value),
671
+ onSelect: (S) => {
672
+ d.multi && S.preventDefault(), o(d, k.value);
673
+ },
674
+ children: k.label
675
+ },
676
+ k.value
677
+ )) })
678
+ ] }, d.key);
679
+ }),
680
+ c ? /* @__PURE__ */ n(
681
+ "button",
682
+ {
683
+ type: "button",
684
+ onClick: () => {
685
+ a({}), ne("serp_filter_changed", { key: "*", values: [] });
686
+ },
687
+ className: En(),
688
+ children: i("practiceResults.filters.clear")
689
+ }
690
+ ) : null
691
+ ]
692
+ }
693
+ );
694
+ }
695
+ function je({ value: e, options: t, onChange: a }) {
696
+ const { t: r } = _("ui"), i = (s) => {
697
+ switch (s) {
698
+ case "distance":
699
+ return r("practiceResults.sort.distance");
700
+ case "rating":
701
+ return r("practiceResults.sort.rating");
702
+ case "next-available":
703
+ return r("practiceResults.sort.nextAvailable");
704
+ case "price":
705
+ return r("practiceResults.sort.price");
706
+ case "relevance":
707
+ default:
708
+ return r("practiceResults.sort.relevance");
709
+ }
710
+ };
711
+ return /* @__PURE__ */ v(ce.Root, { children: [
712
+ /* @__PURE__ */ n(ce.Trigger, { asChild: !0, children: /* @__PURE__ */ v(
713
+ "button",
714
+ {
715
+ type: "button",
716
+ "aria-label": `${r("practiceResults.sort.label")}: ${i(e)}`,
717
+ className: Me({ state: "idle" }),
718
+ children: [
719
+ /* @__PURE__ */ v("span", { children: [
720
+ r("practiceResults.sort.label"),
721
+ ": ",
722
+ i(e)
723
+ ] }),
724
+ /* @__PURE__ */ n(xt, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" })
725
+ ]
726
+ }
727
+ ) }),
728
+ /* @__PURE__ */ n(ce.Content, { sideOffset: 8, align: "end", children: /* @__PURE__ */ n(
729
+ ce.RadioGroup,
730
+ {
731
+ value: e,
732
+ onValueChange: (s) => {
733
+ const c = s;
734
+ c !== e && (a(c), ne("serp_sort_changed", { sort: c }));
735
+ },
736
+ children: t.map((s) => /* @__PURE__ */ n(ce.RadioItem, { value: s, children: i(s) }, s))
737
+ }
738
+ ) })
739
+ ] });
740
+ }
741
+ function Bn({ distanceKm: e }) {
742
+ const { t, i18n: a } = _("ui"), r = q(() => {
743
+ if (e < 1) return t("practiceResults.distance.below");
744
+ const i = new Intl.NumberFormat(a.language, {
745
+ maximumFractionDigits: 1
746
+ }).format(e);
747
+ return t("practiceResults.distance.km", { distance: i });
748
+ }, [e, t, a.language]);
749
+ return /* @__PURE__ */ n(se, { variant: "neutral", leading: /* @__PURE__ */ n(Ne, { "aria-hidden": "true" }), children: r });
750
+ }
751
+ const qe = le(
752
+ [
753
+ "ds:w-[12rem] ds:h-[8rem] ds:shrink-0",
754
+ "ds:rounded-[var(--radius-md)] ds:overflow-hidden"
755
+ ].join(" "),
756
+ {
757
+ variants: {
758
+ state: {
759
+ // Tonal address-block placeholder — renders the MapPin glyph
760
+ // + address text on a `--muted` surface. Used when the consumer
761
+ // hasn't provided `googleMapsApiKey`; carries the spatial cue
762
+ // (location is here, even if we can't draw the map).
763
+ placeholder: "ds:flex ds:flex-col ds:items-start ds:justify-end ds:gap-[var(--spacing-2xs)] ds:bg-[var(--muted)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-sm)]",
764
+ image: "ds:[object-fit:cover]"
765
+ }
766
+ },
767
+ defaultVariants: { state: "placeholder" }
768
+ }
769
+ );
770
+ function $n() {
771
+ if (typeof document > "u") return "6761e5";
772
+ const e = getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color").trim(), t = /^#?([0-9a-fA-F]{6})$/.exec(e);
773
+ return t ? t[1] : "6761e5";
774
+ }
775
+ function gt({
776
+ address: e,
777
+ addressLang: t
778
+ }) {
779
+ return /* @__PURE__ */ v(
780
+ "div",
781
+ {
782
+ "aria-hidden": e ? void 0 : "true",
783
+ className: qe({ state: "placeholder" }),
784
+ children: [
785
+ /* @__PURE__ */ n(Ne, { "aria-hidden": "true", className: "ds:size-5 ds:shrink-0" }),
786
+ e ? /* @__PURE__ */ n(
787
+ "span",
788
+ {
789
+ lang: t,
790
+ dir: "auto",
791
+ className: "type-meta ds:[overflow-wrap:anywhere]",
792
+ children: e
793
+ }
794
+ ) : null
795
+ ]
796
+ }
797
+ );
798
+ }
799
+ function zn({
800
+ image: e,
801
+ apiKey: t,
802
+ center: a,
803
+ zoom: r = 14,
804
+ address: i,
805
+ addressLang: s
806
+ }) {
807
+ const { t: c } = _("ui"), [l, f] = J(null);
808
+ if (e && l !== e.src)
809
+ return /* @__PURE__ */ n(
810
+ "img",
811
+ {
812
+ src: e.src,
813
+ srcSet: e.srcSet,
814
+ alt: "",
815
+ loading: "lazy",
816
+ decoding: "async",
817
+ width: 240,
818
+ height: 160,
819
+ onError: () => f(e.src),
820
+ className: qe({ state: "image" })
821
+ }
822
+ );
823
+ if (e)
824
+ return /* @__PURE__ */ n(gt, { address: i, addressLang: s });
825
+ if (!t)
826
+ return /* @__PURE__ */ n(gt, { address: i, addressLang: s });
827
+ const o = $n(), d = `https://maps.googleapis.com/maps/api/staticmap?center=${a.lat},${a.lng}&zoom=${r}&size=240x160&scale=2&markers=color:0x${o}%7C${a.lat},${a.lng}&key=${encodeURIComponent(t)}`;
828
+ return /* @__PURE__ */ n(
829
+ "img",
830
+ {
831
+ src: d,
832
+ alt: c("practiceResults.thumbnail.alt"),
833
+ loading: "lazy",
834
+ decoding: "async",
835
+ width: 240,
836
+ height: 160,
837
+ className: qe({ state: "image" })
838
+ }
839
+ );
840
+ }
841
+ function Kn({ tagline: e, lang: t }) {
842
+ return e ? /* @__PURE__ */ n(
843
+ "span",
844
+ {
845
+ "data-component": "practice-result-tagline",
846
+ lang: t,
847
+ dir: "auto",
848
+ className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[var(--foreground)]",
849
+ children: e
850
+ }
851
+ ) : null;
852
+ }
853
+ function jn(e) {
854
+ if (typeof e != "string") return;
855
+ const t = e.trim().replace(/_/g, "-");
856
+ if (t)
857
+ try {
858
+ return Intl.getCanonicalLocales(t)[0] ? t : void 0;
859
+ } catch {
860
+ return;
861
+ }
862
+ }
863
+ function Mt({
864
+ review: e
865
+ }) {
866
+ const { t } = _("ui"), a = typeof (e == null ? void 0 : e.text) == "string" ? e.text.trim() : "";
867
+ return !e || !a ? null : /* @__PURE__ */ v(
868
+ "p",
869
+ {
870
+ "data-component": "practice-result-latest-review",
871
+ className: "type-body-sm ds:m-0 ds:flex ds:min-w-0 ds:gap-[var(--spacing-xs)] ds:text-[var(--muted-foreground)]",
872
+ children: [
873
+ /* @__PURE__ */ n("span", { className: "ds:shrink-0", children: t("practiceResults.card.latestReview") }),
874
+ " ",
875
+ /* @__PURE__ */ n(
876
+ "span",
877
+ {
878
+ lang: jn(e.lang),
879
+ dir: "auto",
880
+ className: "ds:min-w-0 ds:truncate",
881
+ children: a
882
+ }
883
+ )
884
+ ]
885
+ }
886
+ );
887
+ }
888
+ const qn = le(
889
+ "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)] ds:whitespace-pre-line ds:break-words",
890
+ {
891
+ variants: {
892
+ density: {
893
+ compact: "ds:line-clamp-2",
894
+ rich: "ds:line-clamp-3"
895
+ }
896
+ },
897
+ defaultVariants: { density: "compact" }
898
+ }
899
+ );
900
+ function Lt({
901
+ description: e,
902
+ density: t,
903
+ lang: a
904
+ }) {
905
+ return e ? /* @__PURE__ */ n(
906
+ "p",
907
+ {
908
+ "data-component": "practice-result-description",
909
+ lang: a,
910
+ dir: "auto",
911
+ className: qn({ density: t }),
912
+ children: e
913
+ }
914
+ ) : null;
915
+ }
916
+ function Gn(e, t, a, r) {
917
+ if (e.kind === "fixed")
918
+ return bt(
919
+ e.minCents,
920
+ t,
921
+ a,
922
+ r("common.freeOfCharge")
923
+ );
924
+ const i = mt(e.minCents, t, a);
925
+ return e.kind === "range" && e.maxCents != null && Number.isFinite(e.maxCents) && e.maxCents > e.minCents ? r("practiceResults.card.priceRange", {
926
+ min: i,
927
+ max: mt(e.maxCents, t, a)
928
+ }) : r("practiceResults.card.priceFrom", { price: i });
929
+ }
930
+ const Un = le(
931
+ "ds:min-w-0 ds:max-w-full ds:[overflow-wrap:anywhere]",
932
+ {
933
+ variants: {
934
+ practiceWritten: { true: "ds:truncate" }
935
+ }
936
+ }
937
+ );
938
+ function Wn({
939
+ price: e,
940
+ cents: t,
941
+ currencyCode: a = "EUR"
942
+ }) {
943
+ var p;
944
+ const { t: r, i18n: i } = _("ui"), s = e && Number.isFinite(e.minCents) ? e : void 0, c = (s == null ? void 0 : s.kind) ?? "fixed", l = (s == null ? void 0 : s.minCents) ?? t, f = s == null ? void 0 : s.maxCents, o = q(
945
+ () => l == null ? void 0 : Gn(
946
+ { kind: c, minCents: l, maxCents: f },
947
+ a,
948
+ i.language ?? "en",
949
+ r
950
+ ),
951
+ [c, l, f, a, i.language, r]
952
+ );
953
+ if (o === void 0) return null;
954
+ const d = (p = s == null ? void 0 : s.label) == null ? void 0 : p.trim().replace(/:$/, "").trim(), g = d || r("practiceResults.card.firstVisitPrice");
955
+ return /* @__PURE__ */ v(
956
+ "span",
957
+ {
958
+ "data-component": "practice-result-price",
959
+ className: "type-body-sm ds:flex ds:min-w-0 ds:max-w-full ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:text-start ds:text-[var(--muted-foreground)] ds:sm:@min-[280px]/result-heading:max-w-[45%] ds:sm:@min-[280px]/result-heading:items-end ds:sm:@min-[280px]/result-heading:text-end",
960
+ children: [
961
+ /* @__PURE__ */ n(
962
+ "span",
963
+ {
964
+ dir: "auto",
965
+ title: g,
966
+ className: Un({
967
+ practiceWritten: !!d
968
+ }),
969
+ children: g
970
+ }
971
+ ),
972
+ /* @__PURE__ */ n("span", { className: "ds:sr-only", children: ": " }),
973
+ /* @__PURE__ */ n(
974
+ se,
975
+ {
976
+ variant: "accentSoft",
977
+ size: "lg",
978
+ dir: "auto",
979
+ className: "ds:h-auto ds:min-h-6 ds:min-w-0 ds:max-w-full ds:whitespace-normal ds:[overflow-wrap:anywhere]",
980
+ children: o
981
+ }
982
+ )
983
+ ]
984
+ }
985
+ );
986
+ }
987
+ function Je({ time: e }) {
988
+ const { t } = _("ui");
989
+ return /* @__PURE__ */ v("span", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
990
+ /* @__PURE__ */ n(
991
+ yn,
992
+ {
993
+ "aria-hidden": "true",
994
+ className: "ds:size-4 ds:text-[var(--primary)]"
995
+ }
996
+ ),
997
+ t("practiceResults.nextSlot.summary", { time: e })
998
+ ] });
999
+ }
1000
+ function Pt({
1001
+ result: e,
1002
+ openLabel: t,
1003
+ bookLabel: a,
1004
+ nextSlotText: r,
1005
+ onOpenClick: i,
1006
+ onBookClick: s
1007
+ }) {
1008
+ const { t: c } = _("ui"), l = e.nextAvailableSlot, f = (l == null ? void 0 : l.bookingHref) ?? e.bookingHref ?? e.href, o = l && r ? c("practiceResults.nextSlot.cta", { time: r }) : a;
1009
+ return /* @__PURE__ */ v("div", { className: "ds:mt-[var(--spacing-xs)] ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)]", children: [
1010
+ t !== void 0 ? /* @__PURE__ */ n(ve, { intent: "secondary", size: "sm", asChild: !0, onClick: i, children: /* @__PURE__ */ v("a", { href: e.href, "data-component": "practice-result-open-cta", children: [
1011
+ t,
1012
+ " ",
1013
+ /* @__PURE__ */ n("span", { className: "ds:sr-only", children: e.name })
1014
+ ] }) }) : null,
1015
+ /* @__PURE__ */ n(
1016
+ ve,
1017
+ {
1018
+ intent: "primary",
1019
+ size: "sm",
1020
+ asChild: !0,
1021
+ startIcon: /* @__PURE__ */ n(bn, { "aria-hidden": "true" }),
1022
+ onClick: s,
1023
+ children: /* @__PURE__ */ v(
1024
+ "a",
1025
+ {
1026
+ href: f,
1027
+ "data-component": "practice-result-book-cta",
1028
+ "data-slot-aware": l ? "true" : void 0,
1029
+ children: [
1030
+ o,
1031
+ " ",
1032
+ /* @__PURE__ */ n("span", { className: "ds:sr-only", children: e.name })
1033
+ ]
1034
+ }
1035
+ )
1036
+ }
1037
+ )
1038
+ ] });
1039
+ }
1040
+ const It = le(
1041
+ [
1042
+ "ds:@container/result-card ds:relative ds:flex ds:w-full ds:cursor-pointer",
1043
+ "ds:rounded-[var(--radius-lg)]",
1044
+ "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
1045
+ "ds:border ds:border-[color:var(--card-border)]",
1046
+ "ds:p-[var(--spacing-md)]",
1047
+ "ds:gap-[var(--spacing-md)]",
1048
+ "ds:transition-[box-shadow,border-color] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
1049
+ "ds:hover:shadow-[var(--shadow-md)]",
1050
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1051
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1052
+ "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1053
+ // Use `data-highlighted` for the pin↔card sync visual so consumers
1054
+ // can override (e.g. dim siblings) without fighting the kit.
1055
+ "ds:data-[highlighted=true]:border-[color:var(--primary)]",
1056
+ "ds:data-[highlighted=true]:shadow-[var(--shadow-md)]",
1057
+ // HTP-7323: the card chosen by a pin click. Stronger than the hover
1058
+ // highlight: a brand border (one extra ring, no layout shift), a tinted
1059
+ // surface and the "Selected on the map" tag.
1060
+ "ds:data-[selected=true]:border-[color:var(--primary)]",
1061
+ "ds:data-[selected=true]:bg-[var(--primary-soft)]",
1062
+ "ds:data-[selected=true]:shadow-[0_0_0_1px_var(--primary),var(--shadow-md)]",
1063
+ // Extra room above the card when a pin click scrolls it to the top, for a
1064
+ // sticky header other than PublicHeader (which already sets the page's
1065
+ // `scroll-padding-block-start`). Default 0, so nothing is counted twice.
1066
+ "ds:[scroll-margin-block-start:var(--practice-results-scroll-offset,0)]",
1067
+ "ds:forced-colors:focus-visible:outline-[CanvasText]",
1068
+ // `slot-cards`: the grid wraps under the info until the card is wide.
1069
+ "ds:data-[slot-cards=true]:flex-wrap"
1070
+ ].join(" "),
1071
+ {
1072
+ variants: {
1073
+ density: {
1074
+ compact: "",
1075
+ rich: "ds:p-[var(--spacing-lg)] ds:gap-[var(--spacing-lg)]"
1076
+ }
1077
+ },
1078
+ defaultVariants: { density: "compact" }
1079
+ }
1080
+ ), Zn = le([
1081
+ "ds:text-[var(--foreground)] ds:no-underline ds:hover:underline",
1082
+ "ds:rounded-[var(--radius-xs)]",
1083
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1084
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1085
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
1086
+ ]);
1087
+ function Xn({
1088
+ result: e,
1089
+ headingLevel: t
1090
+ }) {
1091
+ const a = `h${Ie(t)}`;
1092
+ return /* @__PURE__ */ n(
1093
+ a,
1094
+ {
1095
+ id: `practice-result-${e.id}-name`,
1096
+ dir: "auto",
1097
+ className: "type-title-card ds:m-0 ds:min-w-0 ds:[overflow-wrap:anywhere] ds:text-[var(--foreground)]",
1098
+ children: /* @__PURE__ */ n(
1099
+ "a",
1100
+ {
1101
+ href: e.href,
1102
+ dir: "auto",
1103
+ "data-component": "practice-result-name-link",
1104
+ className: Zn(),
1105
+ children: e.name
1106
+ }
1107
+ )
1108
+ }
1109
+ );
1110
+ }
1111
+ function At({
1112
+ result: e,
1113
+ headingLevel: t,
1114
+ selected: a = !1
1115
+ }) {
1116
+ var i, s;
1117
+ const { t: r } = _("ui");
1118
+ return /* @__PURE__ */ n(
1119
+ "div",
1120
+ {
1121
+ "data-component": "practice-result-heading",
1122
+ className: "ds:@container/result-heading ds:min-w-0 ds:flex-1",
1123
+ children: /* @__PURE__ */ v("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:sm:@min-[280px]/result-heading:flex-row ds:sm:@min-[280px]/result-heading:gap-[var(--spacing-md)]", children: [
1124
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:min-w-0 ds:w-full ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1125
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1126
+ /* @__PURE__ */ n(Xn, { result: e, headingLevel: t }),
1127
+ ((i = e.location) == null ? void 0 : i.distanceKm) != null ? /* @__PURE__ */ n(Bn, { distanceKm: e.location.distanceKm }) : null,
1128
+ a ? /* @__PURE__ */ n(
1129
+ se,
1130
+ {
1131
+ variant: "brand",
1132
+ "data-component": "practice-result-selected-tag",
1133
+ leading: /* @__PURE__ */ n(Ne, { "aria-hidden": "true" }),
1134
+ children: r("practiceResults.selectedOnMap")
1135
+ }
1136
+ ) : null
1137
+ ] }),
1138
+ e.subtitle ? /* @__PURE__ */ n("span", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: e.subtitle }) : null,
1139
+ /* @__PURE__ */ n(Kn, { tagline: e.tagline, lang: e.contentLang }),
1140
+ (s = e.location) != null && s.address ? /* @__PURE__ */ v(
1141
+ "span",
1142
+ {
1143
+ "data-component": "practice-result-address",
1144
+ className: "type-meta ds:text-[var(--muted-foreground)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1145
+ children: [
1146
+ /* @__PURE__ */ n(Ne, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }),
1147
+ /* @__PURE__ */ n(
1148
+ "span",
1149
+ {
1150
+ lang: e.contentLang,
1151
+ dir: "auto",
1152
+ className: "ds:min-w-0 ds:[overflow-wrap:anywhere]",
1153
+ children: e.location.address
1154
+ }
1155
+ )
1156
+ ]
1157
+ }
1158
+ ) : null
1159
+ ] }),
1160
+ /* @__PURE__ */ n(
1161
+ Wn,
1162
+ {
1163
+ price: e.firstVisitPrice,
1164
+ cents: e.firstVisitPriceCents,
1165
+ currencyCode: e.currencyCode
1166
+ }
1167
+ )
1168
+ ] })
1169
+ }
1170
+ );
1171
+ }
1172
+ function Ft(e) {
1173
+ const t = e.target.closest(
1174
+ 'a, button, [role="button"], input, select, textarea, label'
1175
+ );
1176
+ return t !== null && t !== e.currentTarget && e.currentTarget.contains(t);
1177
+ }
1178
+ function Le() {
1179
+ return !(typeof window.matchMedia == "function" && !window.matchMedia("(hover: hover)").matches);
1180
+ }
1181
+ function _t(e) {
1182
+ if (e)
1183
+ return (t) => {
1184
+ const a = document.activeElement;
1185
+ a && t.currentTarget.contains(a) && Ze(a) || e();
1186
+ };
1187
+ }
1188
+ function Tt(e) {
1189
+ if (e)
1190
+ return (t) => {
1191
+ t.currentTarget.contains(t.relatedTarget) || e();
1192
+ };
1193
+ }
1194
+ function vt({
1195
+ result: e,
1196
+ headingLevel: t,
1197
+ highlighted: a,
1198
+ selected: r = !1,
1199
+ onSelect: i,
1200
+ onOpenClick: s,
1201
+ onHover: c,
1202
+ onLeave: l,
1203
+ density: f = "compact",
1204
+ openLabel: o,
1205
+ bookLabel: d,
1206
+ onBookClick: g,
1207
+ nextSlotText: p,
1208
+ maxInsuranceChips: w = 3,
1209
+ maxLanguageChips: b = 4,
1210
+ slotsPanel: k,
1211
+ children: S
1212
+ }) {
1213
+ var z, y, K, D;
1214
+ const { t: V, i18n: E } = _("ui"), P = e.rating, T = (((z = e.languages) == null ? void 0 : z.length) ?? 0) > 0, C = (((y = e.insurances) == null ? void 0 : y.length) ?? 0) > 0, h = e.specializedInFearPatients, R = T || C || h, L = (e.languages ?? []).slice(0, b), H = (((K = e.languages) == null ? void 0 : K.length) ?? 0) - L.length, X = (e.insurances ?? []).slice(0, w), G = (((D = e.insurances) == null ? void 0 : D.length) ?? 0) - X.length;
1215
+ return (
1216
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events -- card is role="group" by design (axe nested-interactive); click handler is mouse-only sync.
1217
+ /* @__PURE__ */ v(
1218
+ "div",
1219
+ {
1220
+ "data-component": "practice-result-card",
1221
+ "data-result-id": e.id,
1222
+ "data-highlighted": a ? "true" : "false",
1223
+ "data-selected": r ? "true" : "false",
1224
+ role: "group",
1225
+ "aria-labelledby": `practice-result-${e.id}-name`,
1226
+ onClick: (B) => {
1227
+ Ft(B) || i();
1228
+ },
1229
+ onMouseEnter: () => c(Le()),
1230
+ onFocus: (B) => c(Ze(B.target)),
1231
+ onMouseLeave: _t(l),
1232
+ onBlur: Tt(l),
1233
+ className: It({ density: f }),
1234
+ "data-slot-cards": k ? "true" : void 0,
1235
+ children: [
1236
+ /* @__PURE__ */ n(
1237
+ We,
1238
+ {
1239
+ src: e.imageUrl,
1240
+ alt: e.imageAlt,
1241
+ name: e.name,
1242
+ size: "lg",
1243
+ shape: "rounded",
1244
+ ratio: "4:3",
1245
+ width: 64,
1246
+ height: 48
1247
+ }
1248
+ ),
1249
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1250
+ /* @__PURE__ */ n(
1251
+ At,
1252
+ {
1253
+ result: e,
1254
+ headingLevel: t,
1255
+ selected: r
1256
+ }
1257
+ ),
1258
+ P && P.count > 0 ? /* @__PURE__ */ n(
1259
+ Xe,
1260
+ {
1261
+ value: P.value,
1262
+ reviews: { count: P.count },
1263
+ size: "sm"
1264
+ }
1265
+ ) : null,
1266
+ /* @__PURE__ */ n(Mt, { review: e.latestReview }),
1267
+ R ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1268
+ L.map((B) => /* @__PURE__ */ n(
1269
+ se,
1270
+ {
1271
+ variant: "neutral",
1272
+ leading: /* @__PURE__ */ n(wt, { "aria-hidden": "true" }),
1273
+ children: Rt(B, V, E)
1274
+ },
1275
+ `lang-${B}`
1276
+ )),
1277
+ H > 0 ? /* @__PURE__ */ n(se, { variant: "neutral", children: `+${H}` }) : null,
1278
+ X.map((B) => /* @__PURE__ */ n(
1279
+ se,
1280
+ {
1281
+ variant: "info",
1282
+ leading: /* @__PURE__ */ n(kt, { "aria-hidden": "true" }),
1283
+ children: B
1284
+ },
1285
+ `ins-${B}`
1286
+ )),
1287
+ G > 0 ? /* @__PURE__ */ n(se, { variant: "neutral", children: `+${G}` }) : null,
1288
+ h ? /* @__PURE__ */ n(se, { variant: "info", leading: /* @__PURE__ */ n(Ct, { "aria-hidden": "true" }), children: V("practiceResults.fearPatient.label") }) : null
1289
+ ] }) : null,
1290
+ /* @__PURE__ */ n(
1291
+ Lt,
1292
+ {
1293
+ description: e.description,
1294
+ density: "compact",
1295
+ lang: e.contentLang
1296
+ }
1297
+ ),
1298
+ e.nextAvailableSlot && p ? /* @__PURE__ */ n(Je, { time: p }) : null,
1299
+ S,
1300
+ /* @__PURE__ */ n(
1301
+ Pt,
1302
+ {
1303
+ result: e,
1304
+ openLabel: o,
1305
+ bookLabel: d,
1306
+ nextSlotText: p,
1307
+ onOpenClick: s,
1308
+ onBookClick: g
1309
+ }
1310
+ )
1311
+ ] }),
1312
+ k
1313
+ ]
1314
+ }
1315
+ )
1316
+ );
1317
+ }
1318
+ function Yn({
1319
+ result: e,
1320
+ headingLevel: t,
1321
+ apiKey: a,
1322
+ highlighted: r,
1323
+ selected: i = !1,
1324
+ onSelect: s,
1325
+ onOpenClick: c,
1326
+ onBookClick: l,
1327
+ onHover: f,
1328
+ onLeave: o,
1329
+ openLabel: d,
1330
+ bookLabel: g
1331
+ }) {
1332
+ var P, T;
1333
+ const { t: p, i18n: w } = _("ui"), b = q(() => {
1334
+ if (e.nextAvailableSlot)
1335
+ try {
1336
+ return new Intl.DateTimeFormat(w.language, {
1337
+ weekday: "short",
1338
+ hour: "numeric",
1339
+ minute: "numeric"
1340
+ }).format(new Date(e.nextAvailableSlot.dateTime));
1341
+ } catch {
1342
+ return e.nextAvailableSlot.dateTime;
1343
+ }
1344
+ }, [e.nextAvailableSlot, w.language]), k = (((P = e.languages) == null ? void 0 : P.length) ?? 0) > 0, S = (((T = e.insurances) == null ? void 0 : T.length) ?? 0) > 0, V = e.specializedInFearPatients, E = k || S || V;
1345
+ return (
1346
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events -- card is role="group" by design (axe nested-interactive); click handler is mouse-only sync.
1347
+ /* @__PURE__ */ v(
1348
+ "div",
1349
+ {
1350
+ "data-component": "practice-result-card",
1351
+ "data-result-id": e.id,
1352
+ "data-density": "rich",
1353
+ "data-highlighted": r ? "true" : "false",
1354
+ "data-selected": i ? "true" : "false",
1355
+ role: "group",
1356
+ "aria-labelledby": `practice-result-${e.id}-name`,
1357
+ onClick: (C) => {
1358
+ Ft(C) || s();
1359
+ },
1360
+ onMouseEnter: () => f(Le()),
1361
+ onFocus: (C) => f(Ze(C.target)),
1362
+ onMouseLeave: _t(o),
1363
+ onBlur: Tt(o),
1364
+ className: It({ density: "rich" }),
1365
+ children: [
1366
+ e.location ? /* @__PURE__ */ n("div", { className: "ds:hidden ds:@min-[640px]/result-card:block", children: /* @__PURE__ */ n(
1367
+ zn,
1368
+ {
1369
+ image: e.mapImage,
1370
+ apiKey: a,
1371
+ center: {
1372
+ lat: e.location.lat,
1373
+ lng: e.location.lng
1374
+ },
1375
+ address: e.location.address,
1376
+ addressLang: e.contentLang
1377
+ }
1378
+ ) }) : null,
1379
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1380
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-md)]", children: [
1381
+ /* @__PURE__ */ n(
1382
+ We,
1383
+ {
1384
+ src: e.imageUrl,
1385
+ alt: e.imageAlt,
1386
+ name: e.name,
1387
+ size: "md",
1388
+ shape: "rounded",
1389
+ ratio: "4:3",
1390
+ width: 53,
1391
+ height: 40
1392
+ }
1393
+ ),
1394
+ /* @__PURE__ */ n(
1395
+ At,
1396
+ {
1397
+ result: e,
1398
+ headingLevel: t,
1399
+ selected: i
1400
+ }
1401
+ )
1402
+ ] }),
1403
+ e.rating && e.rating.count > 0 ? /* @__PURE__ */ n(
1404
+ Xe,
1405
+ {
1406
+ value: e.rating.value,
1407
+ reviews: { count: e.rating.count },
1408
+ size: "md"
1409
+ }
1410
+ ) : null,
1411
+ /* @__PURE__ */ n(Mt, { review: e.latestReview }),
1412
+ E ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1413
+ k ? (e.languages ?? []).map((C) => /* @__PURE__ */ n(
1414
+ se,
1415
+ {
1416
+ variant: "neutral",
1417
+ leading: /* @__PURE__ */ n(wt, { "aria-hidden": "true" }),
1418
+ children: Rt(C, p, w)
1419
+ },
1420
+ `lang-${C}`
1421
+ )) : null,
1422
+ S ? (e.insurances ?? []).map((C) => /* @__PURE__ */ n(
1423
+ se,
1424
+ {
1425
+ variant: "info",
1426
+ leading: /* @__PURE__ */ n(kt, { "aria-hidden": "true" }),
1427
+ children: C
1428
+ },
1429
+ `ins-${C}`
1430
+ )) : null,
1431
+ V ? /* @__PURE__ */ n(se, { variant: "info", leading: /* @__PURE__ */ n(Ct, { "aria-hidden": "true" }), children: p("practiceResults.fearPatient.label") }) : null
1432
+ ] }) : null,
1433
+ /* @__PURE__ */ n(
1434
+ Lt,
1435
+ {
1436
+ description: e.description,
1437
+ density: "rich",
1438
+ lang: e.contentLang
1439
+ }
1440
+ ),
1441
+ e.nextAvailableSlot && b ? /* @__PURE__ */ n(Je, { time: b }) : null,
1442
+ /* @__PURE__ */ n(
1443
+ Pt,
1444
+ {
1445
+ result: e,
1446
+ openLabel: d,
1447
+ bookLabel: g,
1448
+ nextSlotText: b,
1449
+ onOpenClick: c,
1450
+ onBookClick: l
1451
+ }
1452
+ )
1453
+ ] })
1454
+ ]
1455
+ }
1456
+ )
1457
+ );
1458
+ }
1459
+ function et({
1460
+ results: e,
1461
+ headingLevel: t,
1462
+ hoveredId: a,
1463
+ selectedId: r,
1464
+ softId: i,
1465
+ onCardHover: s,
1466
+ onCardLeave: c,
1467
+ onCardSelect: l,
1468
+ onCardOpenClick: f,
1469
+ onCardBookClick: o,
1470
+ openLabel: d,
1471
+ bookLabel: g,
1472
+ formatNextSlot: p,
1473
+ onLoadMore: w,
1474
+ loadingMore: b,
1475
+ loadingSkeletons: k,
1476
+ density: S = "compact",
1477
+ apiKey: V,
1478
+ containerRef: E
1479
+ }) {
1480
+ const { t: P } = _("ui"), T = yt(Qe), C = F(null);
1481
+ return U(() => {
1482
+ if (!w) return;
1483
+ const h = C.current;
1484
+ if (!h || typeof IntersectionObserver > "u") return;
1485
+ const R = new IntersectionObserver(
1486
+ (L) => {
1487
+ for (const H of L)
1488
+ H.isIntersecting && (ne("serp_load_more", {
1489
+ currentCount: e.length
1490
+ }), w());
1491
+ },
1492
+ { root: null, rootMargin: "200px" }
1493
+ );
1494
+ return R.observe(h), () => R.disconnect();
1495
+ }, [w, e.length]), k ? /* @__PURE__ */ n(
1496
+ "div",
1497
+ {
1498
+ role: "status",
1499
+ "aria-live": "polite",
1500
+ "aria-label": P("practiceResults.loading"),
1501
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1502
+ children: Array.from({ length: 4 }).map((h, R) => /* @__PURE__ */ n(
1503
+ dn,
1504
+ {
1505
+ variant: "rounded",
1506
+ height: S === "rich" ? "11rem" : "7rem"
1507
+ },
1508
+ `pr-skel-${R}`
1509
+ ))
1510
+ }
1511
+ ) : /* @__PURE__ */ v(
1512
+ "div",
1513
+ {
1514
+ ref: E,
1515
+ "data-component": "practice-results-list",
1516
+ role: "list",
1517
+ "aria-label": P("practiceResults.list.label"),
1518
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:overflow-y-auto",
1519
+ children: [
1520
+ e.map((h) => /* @__PURE__ */ n("div", { role: "listitem", children: S === "rich" ? /* @__PURE__ */ n(
1521
+ Yn,
1522
+ {
1523
+ result: h,
1524
+ headingLevel: t,
1525
+ apiKey: V,
1526
+ highlighted: a === h.id || r === h.id || i === h.id,
1527
+ selected: r === h.id,
1528
+ onSelect: () => l(h.id),
1529
+ onOpenClick: () => f(h.id),
1530
+ onBookClick: () => o(h.id),
1531
+ onHover: (R) => s(h.id, R),
1532
+ onLeave: c,
1533
+ openLabel: d,
1534
+ bookLabel: g
1535
+ }
1536
+ ) : T && h.firstVisit ? /* @__PURE__ */ n(
1537
+ Ln,
1538
+ {
1539
+ result: h,
1540
+ nameHeadingLevel: Ie(t),
1541
+ context: T,
1542
+ children: (R) => /* @__PURE__ */ n(
1543
+ vt,
1544
+ {
1545
+ result: h,
1546
+ headingLevel: t,
1547
+ highlighted: a === h.id || r === h.id || i === h.id,
1548
+ selected: r === h.id,
1549
+ onSelect: () => l(h.id),
1550
+ onOpenClick: () => f(h.id),
1551
+ onBookClick: () => o(h.id),
1552
+ onHover: (L) => s(h.id, L),
1553
+ onLeave: c,
1554
+ openLabel: d,
1555
+ bookLabel: g,
1556
+ nextSlotText: p(h),
1557
+ slotsPanel: R,
1558
+ children: h.firstVisit ? /* @__PURE__ */ n(
1559
+ Mn,
1560
+ {
1561
+ firstVisit: h.firstVisit,
1562
+ currencyCode: h.currencyCode
1563
+ }
1564
+ ) : null
1565
+ }
1566
+ )
1567
+ }
1568
+ ) : /* @__PURE__ */ n(
1569
+ vt,
1570
+ {
1571
+ result: h,
1572
+ headingLevel: t,
1573
+ highlighted: a === h.id || r === h.id || i === h.id,
1574
+ selected: r === h.id,
1575
+ onSelect: () => l(h.id),
1576
+ onOpenClick: () => f(h.id),
1577
+ onBookClick: () => o(h.id),
1578
+ onHover: (R) => s(h.id, R),
1579
+ onLeave: c,
1580
+ openLabel: d,
1581
+ bookLabel: g,
1582
+ nextSlotText: p(h)
1583
+ }
1584
+ ) }, h.id)),
1585
+ w ? /* @__PURE__ */ n(
1586
+ "div",
1587
+ {
1588
+ ref: C,
1589
+ "aria-hidden": "true",
1590
+ className: "ds:flex ds:items-center ds:justify-center ds:py-[var(--spacing-md)]",
1591
+ children: b ? /* @__PURE__ */ n(un, { size: "md", variant: "pulse" }) : /* @__PURE__ */ n("span", { className: "ds:size-1" })
1592
+ }
1593
+ ) : null
1594
+ ]
1595
+ }
1596
+ );
1597
+ }
1598
+ function Qn({
1599
+ result: e,
1600
+ nextSlotText: t
1601
+ }) {
1602
+ const a = e.rating;
1603
+ return /* @__PURE__ */ v(
1604
+ "div",
1605
+ {
1606
+ "data-component": "practice-result-map-card",
1607
+ className: "ds:flex ds:[inline-size:16rem] ds:max-w-full ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--card-border)] ds:bg-[var(--card)] ds:p-[var(--spacing-sm)] ds:text-[var(--card-foreground)] ds:shadow-[var(--shadow-lg)]",
1608
+ children: [
1609
+ /* @__PURE__ */ n(
1610
+ We,
1611
+ {
1612
+ src: e.imageUrl,
1613
+ name: e.name,
1614
+ size: "lg",
1615
+ shape: "rounded",
1616
+ ratio: "4:3",
1617
+ width: 64,
1618
+ height: 48
1619
+ }
1620
+ ),
1621
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1622
+ /* @__PURE__ */ n(
1623
+ "span",
1624
+ {
1625
+ dir: "auto",
1626
+ className: "type-title-card ds:min-w-0 ds:[overflow-wrap:anywhere] ds:text-[var(--foreground)]",
1627
+ children: e.name
1628
+ }
1629
+ ),
1630
+ a && a.count > 0 ? /* @__PURE__ */ n(
1631
+ Xe,
1632
+ {
1633
+ value: a.value,
1634
+ reviews: { count: a.count },
1635
+ size: "sm"
1636
+ }
1637
+ ) : null,
1638
+ e.nextAvailableSlot && t ? /* @__PURE__ */ n(Je, { time: t }) : null
1639
+ ] })
1640
+ ]
1641
+ }
1642
+ );
1643
+ }
1644
+ function Ge({
1645
+ results: e,
1646
+ searchCentre: t,
1647
+ zoom: a,
1648
+ apiKey: r,
1649
+ mapId: i,
1650
+ clusterMarkers: s,
1651
+ hoveredId: c,
1652
+ selectedId: l,
1653
+ onMapClick: f,
1654
+ showMarkerCard: o = !1,
1655
+ formatNextSlot: d,
1656
+ onPinHoverChange: g,
1657
+ onPinClick: p,
1658
+ onPinHover: w,
1659
+ onPinFirstInteract: b,
1660
+ onBoundsChange: k,
1661
+ consentGranted: S,
1662
+ onConsentRequest: V,
1663
+ staticPreview: E,
1664
+ fitResultIds: P,
1665
+ mapHandleRef: T
1666
+ }) {
1667
+ const { t: C } = _("ui"), h = q(
1668
+ () => e.filter(
1669
+ (y) => !!y.location
1670
+ ).map((y) => ({
1671
+ id: y.id,
1672
+ position: {
1673
+ lat: y.location.lat,
1674
+ lng: y.location.lng
1675
+ },
1676
+ label: y.name
1677
+ })),
1678
+ [e]
1679
+ ), R = q(() => {
1680
+ if (!(P != null && P.length)) return h;
1681
+ const y = new Set(P), K = h.filter((D) => y.has(D.id));
1682
+ return K.length > 0 ? K : h;
1683
+ }, [h, P]), L = q(
1684
+ () => R.map((y) => ({ ...y.position, id: y.id })),
1685
+ [R]
1686
+ ), H = q(
1687
+ () => R.map((y) => y.id).sort().join("|"),
1688
+ [R]
1689
+ ), X = q(() => {
1690
+ if (t) return t;
1691
+ const y = Dn(e);
1692
+ return y ? {
1693
+ lat: (y.north + y.south) / 2,
1694
+ lng: (y.east + y.west) / 2
1695
+ } : { lat: 45.4642, lng: 9.19 };
1696
+ }, [e, t]), G = q(
1697
+ () => o ? (y) => {
1698
+ const K = e.find((D) => D.id === y);
1699
+ return K ? /* @__PURE__ */ n(
1700
+ Qn,
1701
+ {
1702
+ result: K,
1703
+ nextSlotText: d == null ? void 0 : d(K)
1704
+ }
1705
+ ) : null;
1706
+ } : void 0,
1707
+ [o, d, e]
1708
+ ), z = $(
1709
+ (y, { userInteraction: K }) => {
1710
+ k == null || k(y), K && ne("serp_map_panned", { bounds: y });
1711
+ },
1712
+ [k]
1713
+ );
1714
+ return /* @__PURE__ */ n(
1715
+ "div",
1716
+ {
1717
+ "data-component": "practice-results-map-panel",
1718
+ className: "ds:relative ds:flex ds:size-full ds:min-h-[24rem] ds:flex-col",
1719
+ children: /* @__PURE__ */ n(
1720
+ ln,
1721
+ {
1722
+ ref: T,
1723
+ apiKey: r ?? "",
1724
+ mapId: i,
1725
+ clusterMarkers: s,
1726
+ center: X,
1727
+ zoom: a,
1728
+ markers: h,
1729
+ fitToPoints: L,
1730
+ fitKey: H,
1731
+ selectedMarkerId: l,
1732
+ hoveredMarkerId: c,
1733
+ renderMarkerCard: G,
1734
+ onMarkerHover: o ? g : void 0,
1735
+ consentGranted: !!S,
1736
+ staticPreview: E,
1737
+ onConsentRequest: V,
1738
+ onBoundsChange: z,
1739
+ onClusterClick: ({ count: y }) => ne("serp_map_cluster_clicked", { count: y }),
1740
+ onMarkerClick: (y) => {
1741
+ if (y == null) {
1742
+ f();
1743
+ return;
1744
+ }
1745
+ w(y), b(y), p(y);
1746
+ },
1747
+ ariaLabel: C("practiceResults.map.label"),
1748
+ size: "fill",
1749
+ surface: "bordered",
1750
+ className: "ds:size-full"
1751
+ }
1752
+ )
1753
+ }
1754
+ );
1755
+ }
1756
+ function tt({
1757
+ variantBodyProps: e
1758
+ }) {
1759
+ const {
1760
+ facets: t,
1761
+ value: a,
1762
+ sortOptions: r,
1763
+ onChange: i,
1764
+ heading: s,
1765
+ intro: c,
1766
+ totalCount: l,
1767
+ searchCentre: f
1768
+ } = e;
1769
+ return !s && !c && l == null && t.length === 0 && r.length === 0 ? null : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1770
+ /* @__PURE__ */ n(
1771
+ St,
1772
+ {
1773
+ heading: s,
1774
+ headingLevel: e.headingLevel,
1775
+ intro: c,
1776
+ totalCount: l,
1777
+ searchCentreLabel: f == null ? void 0 : f.label
1778
+ }
1779
+ ),
1780
+ t.length > 0 ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1781
+ /* @__PURE__ */ n(
1782
+ Nt,
1783
+ {
1784
+ facets: t,
1785
+ value: a.facets,
1786
+ onChange: (o) => i({ ...a, facets: o })
1787
+ }
1788
+ ),
1789
+ r.length > 0 ? /* @__PURE__ */ n(
1790
+ je,
1791
+ {
1792
+ options: r,
1793
+ value: a.sort ?? "relevance",
1794
+ onChange: (o) => i({ ...a, sort: o })
1795
+ }
1796
+ ) : null
1797
+ ] }) : r.length > 0 ? /* @__PURE__ */ n("div", { className: "ds:flex ds:justify-end", children: /* @__PURE__ */ n(
1798
+ je,
1799
+ {
1800
+ options: r,
1801
+ value: a.sort ?? "relevance",
1802
+ onChange: (o) => i({ ...a, sort: o })
1803
+ }
1804
+ ) }) : null
1805
+ ] });
1806
+ }
1807
+ function Ie(e) {
1808
+ return Math.min(e + 1, 6);
1809
+ }
1810
+ function nt({
1811
+ headingLevel: e
1812
+ }) {
1813
+ const { t } = _("ui");
1814
+ return /* @__PURE__ */ n(
1815
+ cn,
1816
+ {
1817
+ variant: "no-results",
1818
+ headingLevel: Ie(e),
1819
+ title: t("practiceResults.empty.title"),
1820
+ description: t("practiceResults.empty.description")
1821
+ }
1822
+ );
1823
+ }
1824
+ function at({
1825
+ onRetry: e,
1826
+ headingLevel: t
1827
+ }) {
1828
+ const { t: a } = _("ui"), r = Ie(t);
1829
+ return /* @__PURE__ */ v(Ce, { variant: "error", children: [
1830
+ /* @__PURE__ */ n(Ce.Title, { as: `h${r}`, children: a("practiceResults.error.title") }),
1831
+ /* @__PURE__ */ n(Ce.Description, { children: a("practiceResults.error.description") }),
1832
+ e ? /* @__PURE__ */ n(Ce.Action, { children: /* @__PURE__ */ n(
1833
+ ve,
1834
+ {
1835
+ intent: "secondary",
1836
+ size: "sm",
1837
+ startIcon: /* @__PURE__ */ n(vn, { "aria-hidden": "true" }),
1838
+ onClick: e,
1839
+ children: a("practiceResults.error.retry")
1840
+ }
1841
+ ) }) : null
1842
+ ] });
1843
+ }
1844
+ function Jn(e) {
1845
+ const {
1846
+ results: t,
1847
+ apiKey: a,
1848
+ mapId: r,
1849
+ clusterMarkers: i,
1850
+ zoom: s,
1851
+ searchCentre: c,
1852
+ onLoadMore: l,
1853
+ loadingMore: f,
1854
+ loadingSkeletons: o,
1855
+ emptyResultsSlot: d,
1856
+ errorSlot: g,
1857
+ error: p,
1858
+ onRetry: w,
1859
+ hoveredId: b,
1860
+ selectedId: k,
1861
+ onCardHover: S,
1862
+ onPinClick: V,
1863
+ consentGranted: E,
1864
+ onConsentRequest: P,
1865
+ onBoundsChange: T,
1866
+ listContainerRef: C
1867
+ } = e, { t: h } = _("ui"), [R, L] = J(!1), H = Pe("(min-width: 1024px)"), X = yt(Qe) !== null, G = p ? g ?? /* @__PURE__ */ n(at, { onRetry: w, headingLevel: e.headingLevel }) : t.length === 0 && !o ? d ?? /* @__PURE__ */ n(nt, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
1868
+ et,
1869
+ {
1870
+ results: t,
1871
+ headingLevel: e.headingLevel,
1872
+ hoveredId: b,
1873
+ selectedId: k,
1874
+ softId: e.softId,
1875
+ onCardHover: S,
1876
+ onCardLeave: e.onCardLeave,
1877
+ onCardSelect: e.onCardSelect,
1878
+ onCardOpenClick: e.onCardOpenClick,
1879
+ onCardBookClick: e.onCardBookClick,
1880
+ openLabel: e.openLabel,
1881
+ bookLabel: e.bookLabel,
1882
+ formatNextSlot: e.formatNextSlot,
1883
+ onLoadMore: l,
1884
+ loadingMore: f,
1885
+ loadingSkeletons: o,
1886
+ density: "compact",
1887
+ containerRef: C
1888
+ }
1889
+ );
1890
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1891
+ /* @__PURE__ */ n(tt, { variantBodyProps: e }),
1892
+ /* @__PURE__ */ v(
1893
+ "div",
1894
+ {
1895
+ className: `ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:lg:grid ds:lg:gap-[var(--spacing-lg)] ds:lg:items-start ${X ? "ds:lg:grid-cols-[2fr_1fr]" : "ds:lg:grid-cols-[55fr_45fr]"}`,
1896
+ children: [
1897
+ /* @__PURE__ */ n("div", { className: "ds:min-w-0", children: G }),
1898
+ /* @__PURE__ */ n("div", { className: "ds:hidden ds:lg:block ds:sticky ds:top-[var(--spacing-md)] ds:h-[40rem]", children: /* @__PURE__ */ n(
1899
+ Ge,
1900
+ {
1901
+ results: t,
1902
+ searchCentre: c,
1903
+ zoom: s,
1904
+ apiKey: a,
1905
+ mapId: r,
1906
+ clusterMarkers: i,
1907
+ hoveredId: e.mapHoveredId,
1908
+ selectedId: e.mapSelectedId,
1909
+ onMapClick: e.onMapClick,
1910
+ showMarkerCard: H,
1911
+ formatNextSlot: e.formatNextSlot,
1912
+ onPinHoverChange: e.onPinHoverChange,
1913
+ onPinClick: (z) => {
1914
+ ge(t, z, "pin", e.onResultSelect), V(z);
1915
+ },
1916
+ onPinHover: e.onPinHover,
1917
+ onPinFirstInteract: e.onPinFirstInteract,
1918
+ onBoundsChange: T,
1919
+ consentGranted: E,
1920
+ staticPreview: e.mapPreview,
1921
+ fitResultIds: e.mapFitResultIds,
1922
+ onConsentRequest: P,
1923
+ mapHandleRef: e.mapHandleRef
1924
+ }
1925
+ ) })
1926
+ ]
1927
+ }
1928
+ ),
1929
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:lg:hidden ds:sticky ds:bottom-[var(--spacing-md)] ds:justify-center", children: /* @__PURE__ */ n(
1930
+ ve,
1931
+ {
1932
+ intent: "primary",
1933
+ size: "md",
1934
+ startIcon: /* @__PURE__ */ n(wn, { "aria-hidden": "true" }),
1935
+ onClick: () => L(!0),
1936
+ children: h("practiceResults.viewMap")
1937
+ }
1938
+ ) }),
1939
+ /* @__PURE__ */ n(ae.Root, { open: R, onOpenChange: L, children: /* @__PURE__ */ v(ae.Content, { side: "bottom", size: "lg", children: [
1940
+ /* @__PURE__ */ n(ae.Header, { children: /* @__PURE__ */ n(ae.Title, { children: h("practiceResults.map.label") }) }),
1941
+ /* @__PURE__ */ v(ae.Body, { children: [
1942
+ /* @__PURE__ */ n(ae.Description, { className: "ds:sr-only", children: h("practiceResults.sheet.description") }),
1943
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1944
+ /* @__PURE__ */ n("div", { className: "ds:h-[24rem]", children: /* @__PURE__ */ n(
1945
+ Ge,
1946
+ {
1947
+ results: t,
1948
+ searchCentre: c,
1949
+ zoom: s,
1950
+ apiKey: a,
1951
+ mapId: r,
1952
+ clusterMarkers: i,
1953
+ hoveredId: e.mapHoveredId,
1954
+ selectedId: e.mapSelectedId,
1955
+ onMapClick: e.onMapClick,
1956
+ onPinClick: (z) => {
1957
+ ge(t, z, "pin", e.onResultSelect), V(z);
1958
+ },
1959
+ onPinHover: e.onPinHover,
1960
+ onPinFirstInteract: e.onPinFirstInteract,
1961
+ onBoundsChange: T,
1962
+ consentGranted: E,
1963
+ staticPreview: e.mapPreview,
1964
+ fitResultIds: e.mapFitResultIds,
1965
+ onConsentRequest: P,
1966
+ mapHandleRef: e.mapHandleRef
1967
+ }
1968
+ ) }),
1969
+ G
1970
+ ] })
1971
+ ] })
1972
+ ] }) })
1973
+ ] });
1974
+ }
1975
+ const ea = {
1976
+ peek: "sm",
1977
+ half: "md",
1978
+ full: "lg"
1979
+ }, pe = [
1980
+ "peek",
1981
+ "half",
1982
+ "full"
1983
+ ];
1984
+ function ta({ value: e, onChange: t }) {
1985
+ const { t: a, i18n: r } = _("ui"), i = r.dir() === "rtl", s = F(
1986
+ /* @__PURE__ */ new Map()
1987
+ ), c = $((f) => {
1988
+ var o;
1989
+ (o = s.current.get(f)) == null || o.focus();
1990
+ }, []), l = $(
1991
+ (f, o) => {
1992
+ const d = pe.indexOf(o), g = pe.length, p = i ? "ArrowLeft" : "ArrowRight", w = i ? "ArrowRight" : "ArrowLeft";
1993
+ let b = null;
1994
+ switch (f.key) {
1995
+ case p:
1996
+ case "ArrowDown":
1997
+ b = pe[(d + 1) % g];
1998
+ break;
1999
+ case w:
2000
+ case "ArrowUp":
2001
+ b = pe[(d - 1 + g) % g];
2002
+ break;
2003
+ case "Home":
2004
+ b = pe[0];
2005
+ break;
2006
+ case "End":
2007
+ b = pe[g - 1];
2008
+ break;
2009
+ default:
2010
+ return;
2011
+ }
2012
+ f.preventDefault(), b && b !== o && t(b), b && c(b);
2013
+ },
2014
+ [c, i, t]
2015
+ );
2016
+ return /* @__PURE__ */ n(
2017
+ "div",
2018
+ {
2019
+ role: "radiogroup",
2020
+ "aria-label": a("practiceResults.sheet.snap.label"),
2021
+ className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]",
2022
+ children: pe.map((f) => {
2023
+ const o = e === f;
2024
+ return /* @__PURE__ */ n(
2025
+ "button",
2026
+ {
2027
+ ref: (d) => {
2028
+ d ? s.current.set(f, d) : s.current.delete(f);
2029
+ },
2030
+ type: "button",
2031
+ role: "radio",
2032
+ "aria-checked": o,
2033
+ "aria-label": a(`practiceResults.sheet.snap.${f}`),
2034
+ tabIndex: o ? 0 : -1,
2035
+ onClick: () => t(f),
2036
+ onKeyDown: (d) => l(d, f),
2037
+ className: Me({
2038
+ state: o ? "active" : "idle"
2039
+ }),
2040
+ children: a(`practiceResults.sheet.snap.${f}`)
2041
+ },
2042
+ f
2043
+ );
2044
+ })
2045
+ }
2046
+ );
2047
+ }
2048
+ function na(e, t, a) {
2049
+ const [r, i] = J(null), [s, c] = J(null);
2050
+ return Ye(() => {
2051
+ const l = e.current;
2052
+ if (!a || !l || typeof window > "u") {
2053
+ i(null), c(null);
2054
+ return;
2055
+ }
2056
+ let f = 0, o = null, d = null;
2057
+ const g = () => {
2058
+ const b = t.current;
2059
+ i(b ? b.offsetHeight : null);
2060
+ const k = l.querySelector(
2061
+ '[data-testid="map-view-preview-plate"]'
2062
+ ) ?? l.querySelector(
2063
+ '[data-testid="map-view-consent-actions"]'
2064
+ );
2065
+ if (k !== d && (d && (o == null || o.unobserve(d)), k && (o == null || o.observe(k, { box: "border-box" })), d = k), !k) {
2066
+ c(null);
2067
+ return;
2068
+ }
2069
+ const S = k.getBoundingClientRect().bottom;
2070
+ if (S <= 0) {
2071
+ c(null);
2072
+ return;
2073
+ }
2074
+ const V = window.innerHeight - S - ut("--spacing-sm", l, 8);
2075
+ c(
2076
+ Math.max(
2077
+ Math.round(V),
2078
+ ut("--min-target-size", l, 44) * 2
2079
+ )
2080
+ );
2081
+ }, p = () => {
2082
+ cancelAnimationFrame(f), f = requestAnimationFrame(g);
2083
+ };
2084
+ o = typeof ResizeObserver > "u" ? null : new ResizeObserver(p), g(), o == null || o.observe(l), t.current && (o == null || o.observe(t.current)), o == null || o.observe(document.body);
2085
+ const w = new MutationObserver(p);
2086
+ return w.observe(l, { childList: !0, subtree: !0 }), window.addEventListener("resize", p), window.addEventListener("scroll", p, { passive: !0 }), () => {
2087
+ cancelAnimationFrame(f), o == null || o.disconnect(), w.disconnect(), window.removeEventListener("resize", p), window.removeEventListener("scroll", p);
2088
+ };
2089
+ }, [a, e, t]), a ? {
2090
+ mapStyle: r === null ? void 0 : {
2091
+ "--map-preview-inset-block-start": `calc(var(--spacing-md) + ${r}px + var(--spacing-xs))`
2092
+ },
2093
+ sheetStyle: s === null ? void 0 : {
2094
+ "--map-first-sheet-max-block-size": `${s}px`
2095
+ }
2096
+ } : {};
2097
+ }
2098
+ function aa(e) {
2099
+ const {
2100
+ results: t,
2101
+ apiKey: a,
2102
+ mapId: r,
2103
+ clusterMarkers: i,
2104
+ zoom: s,
2105
+ searchCentre: c,
2106
+ onLoadMore: l,
2107
+ loadingMore: f,
2108
+ loadingSkeletons: o,
2109
+ emptyResultsSlot: d,
2110
+ errorSlot: g,
2111
+ error: p,
2112
+ onRetry: w,
2113
+ hoveredId: b,
2114
+ selectedId: k,
2115
+ onCardHover: S,
2116
+ onPinClick: V,
2117
+ consentGranted: E,
2118
+ onConsentRequest: P,
2119
+ onBoundsChange: T,
2120
+ listContainerRef: C,
2121
+ facets: h,
2122
+ value: R,
2123
+ onChange: L
2124
+ } = e, { t: H } = _("ui"), [X, G] = J(
2125
+ () => e.mapPreview && !E ? "peek" : "half"
2126
+ ), z = F(!1), y = $((u) => {
2127
+ z.current = !0, G(u);
2128
+ }, []);
2129
+ Ye(() => {
2130
+ E && !z.current && G((u) => u === "peek" ? "half" : u);
2131
+ }, [E]);
2132
+ const K = ea[X], D = Pe("(min-width: 1024px)"), B = F(null), de = F(null), he = na(
2133
+ B,
2134
+ de,
2135
+ !D && !!e.mapPreview
2136
+ ), ie = p ? g ?? /* @__PURE__ */ n(at, { onRetry: w, headingLevel: e.headingLevel }) : t.length === 0 && !o ? d ?? /* @__PURE__ */ n(nt, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
2137
+ et,
2138
+ {
2139
+ results: t,
2140
+ headingLevel: e.headingLevel,
2141
+ hoveredId: b,
2142
+ selectedId: k,
2143
+ softId: e.softId,
2144
+ onCardHover: S,
2145
+ onCardLeave: e.onCardLeave,
2146
+ onCardSelect: e.onCardSelect,
2147
+ onCardOpenClick: e.onCardOpenClick,
2148
+ onCardBookClick: e.onCardBookClick,
2149
+ openLabel: e.openLabel,
2150
+ bookLabel: e.bookLabel,
2151
+ formatNextSlot: e.formatNextSlot,
2152
+ onLoadMore: l,
2153
+ loadingMore: f,
2154
+ loadingSkeletons: o,
2155
+ density: "compact",
2156
+ apiKey: a,
2157
+ containerRef: C
2158
+ }
2159
+ ), ue = /* @__PURE__ */ n(
2160
+ Ge,
2161
+ {
2162
+ results: t,
2163
+ searchCentre: c,
2164
+ zoom: s,
2165
+ apiKey: a,
2166
+ mapId: r,
2167
+ clusterMarkers: i,
2168
+ hoveredId: e.mapHoveredId,
2169
+ selectedId: e.mapSelectedId,
2170
+ onMapClick: e.onMapClick,
2171
+ showMarkerCard: D,
2172
+ formatNextSlot: e.formatNextSlot,
2173
+ onPinHoverChange: e.onPinHoverChange,
2174
+ onPinClick: (u) => {
2175
+ ge(t, u, "pin", e.onResultSelect), V(u);
2176
+ },
2177
+ onPinHover: e.onPinHover,
2178
+ onPinFirstInteract: e.onPinFirstInteract,
2179
+ onBoundsChange: T,
2180
+ consentGranted: E,
2181
+ staticPreview: e.mapPreview,
2182
+ fitResultIds: e.mapFitResultIds,
2183
+ onConsentRequest: P,
2184
+ mapHandleRef: e.mapHandleRef
2185
+ }
2186
+ ), me = h.length > 0 ? /* @__PURE__ */ n(
2187
+ "div",
2188
+ {
2189
+ ref: de,
2190
+ className: "ds:absolute ds:start-[var(--spacing-md)] ds:top-[var(--spacing-md)] ds:max-w-[calc(100%-var(--spacing-lg))]",
2191
+ children: /* @__PURE__ */ n(
2192
+ Nt,
2193
+ {
2194
+ facets: h,
2195
+ value: R.facets,
2196
+ onChange: (u) => L({ ...R, facets: u }),
2197
+ floating: !0
2198
+ }
2199
+ )
2200
+ }
2201
+ ) : null;
2202
+ return /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: D ? (
2203
+ // Desktop: 65/35 map left + cards rail right. NO Sheet (the
2204
+ // Sheet would portal to body and occlude the desktop layout
2205
+ // regardless of the parent's `lg:hidden` class).
2206
+ //
2207
+ // 0.33.8: filters move from floating-over-the-map to an
2208
+ // inline `<HeaderRow>` above the grid (parity with
2209
+ // split-list-map). Floating chips read as ad-hoc on a real
2210
+ // Google tile and are easy to miss; an inline row sits in
2211
+ // the visual flow as a deliberate refinement control.
2212
+ //
2213
+ // 0.33.8: dropped `h-[calc(100dvh - chrome)] min-h-[40rem]`
2214
+ // on both columns + `overflow-y-auto` on the list rail. The
2215
+ // viewport-fill + internal scroll created a double-scroll
2216
+ // experience — patients scrolled the page AND the rail. Now
2217
+ // the map column is `lg:sticky lg:h-[44rem]` (stays visible
2218
+ // as the patient scrolls cards) and the rail renders at
2219
+ // natural height. Single page scroll.
2220
+ /* @__PURE__ */ v(Ue, { children: [
2221
+ /* @__PURE__ */ n(tt, { variantBodyProps: e }),
2222
+ /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-[65fr_35fr] ds:gap-[var(--spacing-lg)] ds:items-start", children: [
2223
+ /* @__PURE__ */ n("div", { className: "ds:sticky ds:top-[var(--spacing-md)] ds:h-[44rem]", children: ue }),
2224
+ /* @__PURE__ */ n("div", { className: "ds:min-w-0", children: ie })
2225
+ ] })
2226
+ ] })
2227
+ ) : (
2228
+ // Mobile: full-bleed map + persistent bottom sheet defaulting to
2229
+ // 'half' state. No X close button — the sheet is core to the
2230
+ // layout, not dismissible. Patient cycles peek / half / full
2231
+ // via the snap radiogroup at the top of the sheet body. Filters
2232
+ // stay floating on mobile — the full-bleed map IS the viewport
2233
+ // chrome, so floating chips are the only place for them.
2234
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2235
+ /* @__PURE__ */ n(
2236
+ St,
2237
+ {
2238
+ heading: e.heading,
2239
+ headingLevel: e.headingLevel,
2240
+ intro: e.intro,
2241
+ totalCount: e.totalCount,
2242
+ searchCentreLabel: c == null ? void 0 : c.label
2243
+ }
2244
+ ),
2245
+ /* @__PURE__ */ v(
2246
+ "div",
2247
+ {
2248
+ ref: B,
2249
+ className: "ds:relative ds:h-[60vh] ds:min-h-[20rem]",
2250
+ style: he.mapStyle,
2251
+ children: [
2252
+ ue,
2253
+ me
2254
+ ]
2255
+ }
2256
+ ),
2257
+ /* @__PURE__ */ n(ae.Root, { open: !0, modal: !1, children: /* @__PURE__ */ n(
2258
+ ae.Content,
2259
+ {
2260
+ side: "bottom",
2261
+ size: K,
2262
+ className: "ds:max-h-[var(--map-first-sheet-max-block-size,100dvh)] ds:[&_[data-radix-scroll-area-viewport]]:overscroll-contain",
2263
+ style: he.sheetStyle,
2264
+ onEscapeKeyDown: (u) => u.preventDefault(),
2265
+ onPointerDownOutside: (u) => u.preventDefault(),
2266
+ onInteractOutside: (u) => u.preventDefault(),
2267
+ onOpenAutoFocus: (u) => u.preventDefault(),
2268
+ children: /* @__PURE__ */ v(ae.Body, { children: [
2269
+ /* @__PURE__ */ n(ae.Description, { className: "ds:sr-only", children: H("practiceResults.sheet.descriptionMapFirst") }),
2270
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: [
2271
+ /* @__PURE__ */ n(ae.Title, { className: "type-title-card ds:m-0 ds:text-[var(--foreground)]", children: H("practiceResults.sheet.title", {
2272
+ count: e.totalCount ?? t.length
2273
+ }) }),
2274
+ /* @__PURE__ */ n(
2275
+ ta,
2276
+ {
2277
+ value: X,
2278
+ onChange: y
2279
+ }
2280
+ )
2281
+ ] }),
2282
+ e.sortOptions.length > 0 ? /* @__PURE__ */ n("div", { className: "ds:pb-[var(--spacing-sm)]", children: /* @__PURE__ */ n(
2283
+ je,
2284
+ {
2285
+ options: e.sortOptions,
2286
+ value: R.sort ?? "relevance",
2287
+ onChange: (u) => L({ ...R, sort: u })
2288
+ }
2289
+ ) }) : null,
2290
+ ie
2291
+ ] })
2292
+ }
2293
+ ) })
2294
+ ] })
2295
+ ) });
2296
+ }
2297
+ function sa(e) {
2298
+ const {
2299
+ results: t,
2300
+ apiKey: a,
2301
+ onLoadMore: r,
2302
+ loadingMore: i,
2303
+ loadingSkeletons: s,
2304
+ emptyResultsSlot: c,
2305
+ errorSlot: l,
2306
+ error: f,
2307
+ onRetry: o,
2308
+ hoveredId: d,
2309
+ selectedId: g,
2310
+ onCardHover: p,
2311
+ listContainerRef: w
2312
+ } = e, b = f ? l ?? /* @__PURE__ */ n(at, { onRetry: o, headingLevel: e.headingLevel }) : t.length === 0 && !s ? c ?? /* @__PURE__ */ n(nt, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
2313
+ et,
2314
+ {
2315
+ results: t,
2316
+ headingLevel: e.headingLevel,
2317
+ hoveredId: d,
2318
+ selectedId: g,
2319
+ softId: e.softId,
2320
+ onCardHover: p,
2321
+ onCardLeave: e.onCardLeave,
2322
+ onCardSelect: e.onCardSelect,
2323
+ onCardOpenClick: e.onCardOpenClick,
2324
+ onCardBookClick: e.onCardBookClick,
2325
+ openLabel: e.openLabel,
2326
+ bookLabel: e.bookLabel,
2327
+ formatNextSlot: e.formatNextSlot,
2328
+ onLoadMore: r,
2329
+ loadingMore: i,
2330
+ loadingSkeletons: s,
2331
+ density: "rich",
2332
+ apiKey: a,
2333
+ containerRef: w
2334
+ }
2335
+ );
2336
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2337
+ /* @__PURE__ */ n(tt, { variantBodyProps: e }),
2338
+ b
2339
+ ] });
2340
+ }
2341
+ const ia = rn(function({
2342
+ variant: t = "split-list-map",
2343
+ loadResultSlots: a,
2344
+ onResultSlotSelect: r,
2345
+ results: i,
2346
+ contentLang: s,
2347
+ totalCount: c,
2348
+ searchCentre: l,
2349
+ facets: f,
2350
+ googleMapsApiKey: o,
2351
+ mapId: d,
2352
+ clusterMarkers: g = "auto",
2353
+ defaultZoom: p = Pn,
2354
+ onBoundsChange: w,
2355
+ consentGranted: b,
2356
+ onConsentRequest: k,
2357
+ skipConsentGate: S = !1,
2358
+ mapPreview: V,
2359
+ mapFitResultIds: E,
2360
+ onLoadMore: P,
2361
+ loadingMore: T,
2362
+ value: C,
2363
+ onChange: h,
2364
+ sortOptions: R,
2365
+ onResultSelect: L,
2366
+ loading: H,
2367
+ emptyResultsSlot: X,
2368
+ errorSlot: G,
2369
+ error: z,
2370
+ onRetry: y,
2371
+ heading: K,
2372
+ headingLevel: D = 2,
2373
+ intro: B,
2374
+ cardOpenButtonLabel: de,
2375
+ cardBookButtonLabel: he,
2376
+ showCardOpenButton: ie = !0,
2377
+ "aria-label": ue,
2378
+ id: me,
2379
+ className: u,
2380
+ ...N
2381
+ }, I) {
2382
+ const { t: ee, i18n: W } = _("ui"), [O, A] = J(null), [re, oe] = J(null), [Z, Y] = J(null), [Ae, Ht] = J(null), Q = Pe("(min-width: 1024px)"), be = F(/* @__PURE__ */ new Set()), Fe = F(/* @__PURE__ */ new Set()), Dt = F(null), xe = F(null), _e = q(
2383
+ () => ({
2384
+ getVariant: () => t,
2385
+ scrollToResult: (m) => {
2386
+ const M = xe.current;
2387
+ if (!M) return;
2388
+ const x = M.querySelector(
2389
+ `[data-component="practice-result-card"][data-result-id="${CSS.escape(m)}"]`
2390
+ );
2391
+ x && (x.scrollIntoView({ behavior: "smooth", block: "nearest" }), Q || A(null), Y(m));
2392
+ },
2393
+ focusPin: (m) => {
2394
+ Q && t !== "rich-cards" ? (Y(null), oe(m)) : (Q || A(null), Y(m));
2395
+ }
2396
+ }),
2397
+ [t, Q]
2398
+ );
2399
+ on(I, () => _e, [_e]), fn(kn, _e, me);
2400
+ const Ot = ie ? de ?? ee("practiceResults.card.open") : void 0, Vt = he ?? ee("practiceResults.card.book"), Et = $(
2401
+ (m) => {
2402
+ if (m.nextAvailableSlot)
2403
+ try {
2404
+ return new Intl.DateTimeFormat(W.language, {
2405
+ weekday: "short",
2406
+ hour: "numeric",
2407
+ minute: "numeric"
2408
+ }).format(new Date(m.nextAvailableSlot.dateTime));
2409
+ } catch {
2410
+ return m.nextAvailableSlot.dateTime;
2411
+ }
2412
+ },
2413
+ [W.language]
2414
+ ), st = F(null);
2415
+ U(() => {
2416
+ st.current !== t && (st.current = t, ne("serp_variant_exposed", {
2417
+ variant: t,
2418
+ totalCount: c ?? i.length
2419
+ }), be.current = /* @__PURE__ */ new Set(), Fe.current = /* @__PURE__ */ new Set());
2420
+ }, [t]);
2421
+ const Te = F(!1), He = q(
2422
+ () => An(f ?? [], i, C.facets),
2423
+ [f, i, C.facets]
2424
+ ), we = q(
2425
+ () => R ? pt.filter((m) => R.includes(m)) : pt,
2426
+ [R]
2427
+ ), ke = l ? "distance" : "relevance", it = C.sort ?? ke, De = we.includes(it) ? it : we.includes(ke) ? ke : we[0] ?? ke, j = q(() => {
2428
+ const m = Fn(i, C.facets, He);
2429
+ return Hn(m, De, l);
2430
+ }, [i, C.facets, He, De, l]), Oe = q(
2431
+ () => s ? j.map(
2432
+ (m) => m.contentLang ? m : { ...m, contentLang: s }
2433
+ ) : j,
2434
+ [j, s]
2435
+ );
2436
+ U(() => {
2437
+ const m = j.length === 0;
2438
+ m && !Te.current ? (ne("serp_empty_results", {
2439
+ appliedFacets: C.facets ?? {}
2440
+ }), Te.current = !0) : m || (Te.current = !1);
2441
+ }, [j.length, C.facets]), U(() => {
2442
+ const m = new Set(j.map((x) => x.id)), M = (x) => x !== null && m.has(x) ? x : null;
2443
+ A(M), oe(M), Y(M);
2444
+ }, [j]), U(() => {
2445
+ A(null), oe(null), Y(null);
2446
+ }, [t]);
2447
+ const fe = F(null), rt = F(null);
2448
+ U(
2449
+ () => () => {
2450
+ fe.current && clearTimeout(fe.current);
2451
+ },
2452
+ []
2453
+ );
2454
+ const Ve = $((m) => {
2455
+ be.current.has(m) || rt.current === m && fe.current || (fe.current && clearTimeout(fe.current), rt.current = m, fe.current = setTimeout(() => {
2456
+ be.current.has(m) || (be.current.add(m), ne("serp_result_hovered_card", { resultId: m })), fe.current = null;
2457
+ }, 500));
2458
+ }, []), Bt = $(
2459
+ (m, M) => {
2460
+ Ve(m), M && (A(m), Y(null));
2461
+ },
2462
+ [Ve]
2463
+ ), $t = $(() => A(null), []);
2464
+ U(() => {
2465
+ if (O === null) return;
2466
+ const m = (M) => {
2467
+ M.key === "Escape" && A(null);
2468
+ };
2469
+ return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
2470
+ }, [O]);
2471
+ const zt = $(
2472
+ (m, M, x) => {
2473
+ if (!M) {
2474
+ A((te) => te === m ? null : te);
2475
+ return;
2476
+ }
2477
+ Q && (x === "pointer" && !Le() || (A(m), Y(null)));
2478
+ },
2479
+ [Q]
2480
+ ), ot = F(Q);
2481
+ U(() => {
2482
+ ot.current && !Q && A(null), ot.current = Q;
2483
+ }, [Q]);
2484
+ const Kt = $(() => {
2485
+ oe(null), Y(null);
2486
+ }, []), jt = $(
2487
+ (m) => {
2488
+ var M;
2489
+ if (!Q) {
2490
+ const x = (M = xe.current) == null ? void 0 : M.querySelector(
2491
+ `[data-component="practice-result-card"][data-result-id="${CSS.escape(m)}"]`
2492
+ );
2493
+ A(null), Y(m), x == null || x.scrollIntoView({ behavior: "smooth", block: "nearest" });
2494
+ return;
2495
+ }
2496
+ Y(null), oe(m), Ht((x) => ({ id: m, n: ((x == null ? void 0 : x.n) ?? 0) + 1 }));
2497
+ },
2498
+ [Q]
2499
+ );
2500
+ Ye(() => {
2501
+ if (!Ae) return;
2502
+ const m = xe.current, M = m == null ? void 0 : m.querySelector(
2503
+ `[data-component="practice-result-card"][data-result-id="${CSS.escape(Ae.id)}"]`
2504
+ );
2505
+ M == null || M.scrollIntoView({
2506
+ behavior: mn(M) ? "instant" : "smooth",
2507
+ block: "start"
2508
+ });
2509
+ }, [Ae]);
2510
+ const qt = $((m) => {
2511
+ Fe.current.has(m) || (Fe.current.add(m), ne("serp_result_hovered_pin", { resultId: m }));
2512
+ }, []), ct = F(null), Gt = $(
2513
+ (m) => {
2514
+ oe(null), Le() ? (Y(null), A(m)) : (A(null), Y(m));
2515
+ const M = j.find((x) => x.id === m);
2516
+ if (M) {
2517
+ if (M.location) {
2518
+ const x = ct.current;
2519
+ x == null || x.panTo({
2520
+ lat: M.location.lat,
2521
+ lng: M.location.lng
2522
+ }), x == null || x.setZoom(16);
2523
+ }
2524
+ ge(j, m, "card", L);
2525
+ }
2526
+ },
2527
+ [j, L]
2528
+ ), Ut = $(
2529
+ (m) => {
2530
+ ge(
2531
+ j,
2532
+ m,
2533
+ "open-button",
2534
+ L
2535
+ );
2536
+ },
2537
+ [j, L]
2538
+ ), Wt = $(
2539
+ (m) => {
2540
+ ge(
2541
+ j,
2542
+ m,
2543
+ "book-button",
2544
+ L
2545
+ );
2546
+ },
2547
+ [j, L]
2548
+ ), Zt = !!H && i.length === 0, Xt = $(
2549
+ (m, M) => {
2550
+ const x = j.find((te) => te.id === m.id);
2551
+ L(x ?? m, M);
2552
+ },
2553
+ [j, L]
2554
+ ), Ee = {
2555
+ results: Oe,
2556
+ totalCount: c,
2557
+ searchCentre: l,
2558
+ facets: He,
2559
+ value: { ...C, sort: De },
2560
+ sortOptions: we,
2561
+ onChange: h,
2562
+ onResultSelect: Xt,
2563
+ onLoadMore: P,
2564
+ loadingMore: T,
2565
+ apiKey: o,
2566
+ mapId: d,
2567
+ clusterMarkers: g,
2568
+ zoom: p,
2569
+ // 0.31.4: when `skipConsentGate` is true the kit synthesises
2570
+ // `consentGranted=true` for every internal MapView; the consumer's
2571
+ // CMP at the page level is responsible for whether the Google Maps
2572
+ // loader script is present at all. `onConsentRequest` is dropped
2573
+ // because no placeholder renders — nothing to fire it from.
2574
+ consentGranted: S ? !0 : b,
2575
+ onConsentRequest: S ? void 0 : k,
2576
+ mapPreview: V,
2577
+ mapFitResultIds: E,
2578
+ onBoundsChange: w,
2579
+ loadingSkeletons: Zt,
2580
+ emptyResultsSlot: X,
2581
+ errorSlot: G,
2582
+ error: z,
2583
+ onRetry: y,
2584
+ heading: K,
2585
+ headingLevel: D,
2586
+ intro: B,
2587
+ hoveredId: O,
2588
+ selectedId: re,
2589
+ softId: Z,
2590
+ mapHoveredId: Q ? O : null,
2591
+ mapSelectedId: Q ? re ?? Z : O ?? Z,
2592
+ onCardHover: Bt,
2593
+ onCardLeave: $t,
2594
+ onPinHover: Ve,
2595
+ onPinHoverChange: zt,
2596
+ onMapClick: Kt,
2597
+ onPinClick: jt,
2598
+ onPinFirstInteract: qt,
2599
+ onCardSelect: Gt,
2600
+ onCardOpenClick: Ut,
2601
+ onCardBookClick: Wt,
2602
+ openLabel: Ot,
2603
+ bookLabel: Vt,
2604
+ formatNextSlot: Et,
2605
+ listContainerRef: Dt,
2606
+ mapHandleRef: ct
2607
+ }, Be = F({
2608
+ loadResultSlots: a,
2609
+ onResultSlotSelect: r,
2610
+ displayResults: Oe,
2611
+ processedResults: j
2612
+ });
2613
+ U(() => {
2614
+ Be.current = {
2615
+ loadResultSlots: a,
2616
+ onResultSlotSelect: r,
2617
+ displayResults: Oe,
2618
+ processedResults: j
2619
+ };
2620
+ });
2621
+ const Yt = F(/* @__PURE__ */ new Map()), lt = !!a, Qt = q(
2622
+ () => t === "slot-cards" && lt ? {
2623
+ cache: Yt.current,
2624
+ loadResultSlots: (m, M) => {
2625
+ const x = Be.current, te = x.processedResults.find(
2626
+ ($e) => $e.id === m.id
2627
+ );
2628
+ return x.loadResultSlots(te ?? m, M);
2629
+ },
2630
+ onSlotSelect: (m, M, x) => {
2631
+ var dt;
2632
+ const te = Be.current, $e = te.displayResults.findIndex(
2633
+ (ze) => ze.id === m.id
2634
+ ), tn = typeof x.date == "string" ? ye(x.date) : x.date, nn = Math.max(
2635
+ 0,
2636
+ hn(tn, /* @__PURE__ */ new Date())
2637
+ );
2638
+ ne("serp_slot_selected", {
2639
+ resultId: m.id,
2640
+ position: $e,
2641
+ daysAhead: nn
2642
+ });
2643
+ const an = te.processedResults.find(
2644
+ (ze) => ze.id === m.id
2645
+ );
2646
+ (dt = te.onResultSlotSelect) == null || dt.call(te, an ?? m, M, x);
2647
+ }
2648
+ } : null,
2649
+ [t, lt]
2650
+ ), Jt = (() => {
2651
+ switch (t) {
2652
+ case "map-first":
2653
+ return /* @__PURE__ */ n(aa, { ...Ee });
2654
+ case "rich-cards":
2655
+ return /* @__PURE__ */ n(sa, { ...Ee });
2656
+ case "slot-cards":
2657
+ case "split-list-map":
2658
+ default:
2659
+ return /* @__PURE__ */ n(Jn, { ...Ee });
2660
+ }
2661
+ })(), en = ue ?? ee("practiceResults.regionLabel");
2662
+ return /* @__PURE__ */ n(
2663
+ "div",
2664
+ {
2665
+ ref: xe,
2666
+ role: "region",
2667
+ "aria-label": en,
2668
+ id: me,
2669
+ "data-component": "practice-results",
2670
+ "data-component-id": me,
2671
+ "data-variant": t,
2672
+ className: On({ variant: t, className: u }),
2673
+ ...N,
2674
+ children: /* @__PURE__ */ n(Qe.Provider, { value: Qt, children: Jt })
2675
+ }
2676
+ );
2677
+ });
2678
+ ia.displayName = "PracticeResults";
2679
+ export {
2680
+ ia as P,
2681
+ kn as p
2682
+ };
2683
+ //# sourceMappingURL=practice-results-BCLqPdgn.js.map