@alfadocs/ui-kit-debug 1.80.0 → 1.82.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 (223) hide show
  1. package/dist/_chunks/{address-fields-GnoSkvh6.js → address-fields-CfnXK8RT.js} +4 -4
  2. package/dist/_chunks/{address-fields-GnoSkvh6.js.map → address-fields-CfnXK8RT.js.map} +1 -1
  3. package/dist/_chunks/{ai-prompt-input-M6u29f87.js → ai-prompt-input-DH_rnV-F.js} +33 -26
  4. package/dist/_chunks/{ai-prompt-input-M6u29f87.js.map → ai-prompt-input-DH_rnV-F.js.map} +1 -1
  5. package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js → anamnesis-summary-rows-6gMuu0ZK.js} +2 -2
  6. package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js.map → anamnesis-summary-rows-6gMuu0ZK.js.map} +1 -1
  7. package/dist/_chunks/{autocomplete-DosDnGie.js → autocomplete-CnB1mHGc.js} +65 -64
  8. package/dist/_chunks/{autocomplete-DosDnGie.js.map → autocomplete-CnB1mHGc.js.map} +1 -1
  9. package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js → balance-badge-cell-BHXJS8Ga.js} +2 -2
  10. package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js.map → balance-badge-cell-BHXJS8Ga.js.map} +1 -1
  11. package/dist/_chunks/{benefit-card-BWBClvdF.js → benefit-card-BcPtRHgM.js} +37 -36
  12. package/dist/_chunks/{benefit-card-BWBClvdF.js.map → benefit-card-BcPtRHgM.js.map} +1 -1
  13. package/dist/_chunks/booking-dsgiuhKg.js +4304 -0
  14. package/dist/_chunks/booking-dsgiuhKg.js.map +1 -0
  15. package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js → calendar-appointment-editor-dialog-BuumJbcv.js} +4 -4
  16. package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js.map → calendar-appointment-editor-dialog-BuumJbcv.js.map} +1 -1
  17. package/dist/_chunks/{city-input-3J3bz9EO.js → city-input-CJVGswxp.js} +2 -2
  18. package/dist/_chunks/{city-input-3J3bz9EO.js.map → city-input-CJVGswxp.js.map} +1 -1
  19. package/dist/_chunks/{combobox-vF9O-QoG.js → combobox-CDPm_n0p.js} +93 -92
  20. package/dist/_chunks/{combobox-vF9O-QoG.js.map → combobox-CDPm_n0p.js.map} +1 -1
  21. package/dist/_chunks/{command-palette-D9TBzmOG.js → command-palette-B3dVqm9D.js} +68 -68
  22. package/dist/_chunks/{command-palette-D9TBzmOG.js.map → command-palette-B3dVqm9D.js.map} +1 -1
  23. package/dist/_chunks/{contact-profile-card-DKk94l-d.js → contact-profile-card-Da1vmJQI.js} +115 -102
  24. package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +1 -0
  25. package/dist/_chunks/{country-select-CSE2Zm_s.js → country-select-DQ8q7ypA.js} +2 -2
  26. package/dist/_chunks/{country-select-CSE2Zm_s.js.map → country-select-DQ8q7ypA.js.map} +1 -1
  27. package/dist/_chunks/{face-scheme-BIPJqw9f.js → face-scheme-BgJGFDTa.js} +2 -2
  28. package/dist/_chunks/{face-scheme-BIPJqw9f.js.map → face-scheme-BgJGFDTa.js.map} +1 -1
  29. package/dist/_chunks/{header-settings-BYpVmLip.js → header-settings-CifwJEKB.js} +2 -2
  30. package/dist/_chunks/{header-settings-BYpVmLip.js.map → header-settings-CifwJEKB.js.map} +1 -1
  31. package/dist/_chunks/{link-cell-renderer-B0riA_h_.js → link-cell-renderer-C0ynDik7.js} +3 -3
  32. package/dist/_chunks/{link-cell-renderer-B0riA_h_.js.map → link-cell-renderer-C0ynDik7.js.map} +1 -1
  33. package/dist/_chunks/{locale-picker-DzdGDSBI.js → locale-picker-QbT1p60X.js} +39 -38
  34. package/dist/_chunks/{locale-picker-DzdGDSBI.js.map → locale-picker-QbT1p60X.js.map} +1 -1
  35. package/dist/_chunks/{map-view-C6MIVaqn.js → map-view-Bvi06RVh.js} +2 -2
  36. package/dist/_chunks/{map-view-C6MIVaqn.js.map → map-view-Bvi06RVh.js.map} +1 -1
  37. package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js → marketplace-app-shell-vON3WhD0.js} +2 -2
  38. package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js.map → marketplace-app-shell-vON3WhD0.js.map} +1 -1
  39. package/dist/_chunks/{multi-select-BOad3za9.js → multi-select-i5MFRpXg.js} +194 -187
  40. package/dist/_chunks/multi-select-i5MFRpXg.js.map +1 -0
  41. package/dist/_chunks/{otp-input-BgEZi0py.js → otp-input-gV1446Dw.js} +70 -70
  42. package/dist/_chunks/otp-input-gV1446Dw.js.map +1 -0
  43. package/dist/_chunks/{patient-details-B-I9Xkh9.js → patient-details-D0P5eog5.js} +2 -2
  44. package/dist/_chunks/{patient-details-B-I9Xkh9.js.map → patient-details-D0P5eog5.js.map} +1 -1
  45. package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js → patient-field-row-R73dZJY6.js} +5 -5
  46. package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js.map → patient-field-row-R73dZJY6.js.map} +1 -1
  47. package/dist/_chunks/{patient-search-CxqNcth4.js → patient-search-Dy0sxcwv.js} +2 -2
  48. package/dist/_chunks/{patient-search-CxqNcth4.js.map → patient-search-Dy0sxcwv.js.map} +1 -1
  49. package/dist/_chunks/{patient-summary-card-bhDo0gVX.js → patient-summary-card-6U74-ivO.js} +2 -2
  50. package/dist/_chunks/{patient-summary-card-bhDo0gVX.js.map → patient-summary-card-6U74-ivO.js.map} +1 -1
  51. package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js → payment-automation-upsell-D1YdO1xY.js} +2 -2
  52. package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js.map → payment-automation-upsell-D1YdO1xY.js.map} +1 -1
  53. package/dist/_chunks/{phone-input-C3NrD-nl.js → phone-input-DJ4BN8tG.js} +70 -63
  54. package/dist/_chunks/{phone-input-C3NrD-nl.js.map → phone-input-DJ4BN8tG.js.map} +1 -1
  55. package/dist/_chunks/{practice-results-CtOanuzZ.js → practice-results-B61krlwu.js} +2 -2
  56. package/dist/_chunks/{practice-results-CtOanuzZ.js.map → practice-results-B61krlwu.js.map} +1 -1
  57. package/dist/_chunks/{province-select-CDjs5obD.js → province-select-CPdTwEob.js} +2 -2
  58. package/dist/_chunks/{province-select-CDjs5obD.js.map → province-select-CPdTwEob.js.map} +1 -1
  59. package/dist/_chunks/{registration-form-CNBfUduG.js → registration-form-DmP3YUfp.js} +3 -3
  60. package/dist/_chunks/{registration-form-CNBfUduG.js.map → registration-form-DmP3YUfp.js.map} +1 -1
  61. package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js → send-registration-link-form-CZYOO7NO.js} +2 -2
  62. package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js.map → send-registration-link-form-CZYOO7NO.js.map} +1 -1
  63. package/dist/_chunks/{task-editor-Cpw-NmND.js → task-editor-BOETWbjU.js} +2 -2
  64. package/dist/_chunks/{task-editor-Cpw-NmND.js.map → task-editor-BOETWbjU.js.map} +1 -1
  65. package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js → use-appointment-details-read-CWN-nJCZ.js} +2 -2
  66. package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js.map → use-appointment-details-read-CWN-nJCZ.js.map} +1 -1
  67. package/dist/agent-catalog.json +4 -4
  68. package/dist/agent-i18n/en.json +1 -1
  69. package/dist/components/address-fields/index.js +1 -1
  70. package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
  71. package/dist/components/ai-prompt-input/index.js +1 -1
  72. package/dist/components/appointment-details-panel/index.js +1 -1
  73. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  74. package/dist/components/autocomplete/index.js +1 -1
  75. package/dist/components/benefit-card/benefit-card.d.ts +7 -1
  76. package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
  77. package/dist/components/benefit-card/index.js +1 -1
  78. package/dist/components/booking/booking-types.d.ts +35 -2
  79. package/dist/components/booking/booking-types.d.ts.map +1 -1
  80. package/dist/components/booking/booking.d.ts.map +1 -1
  81. package/dist/components/booking/code-step.d.ts +4 -2
  82. package/dist/components/booking/code-step.d.ts.map +1 -1
  83. package/dist/components/booking/details-form.d.ts +2 -0
  84. package/dist/components/booking/details-form.d.ts.map +1 -1
  85. package/dist/components/booking/handover.d.ts +12 -0
  86. package/dist/components/booking/handover.d.ts.map +1 -0
  87. package/dist/components/booking/index.js +1 -1
  88. package/dist/components/booking/reserved.d.ts +24 -0
  89. package/dist/components/booking/reserved.d.ts.map +1 -0
  90. package/dist/components/booking/use-booking-payment.d.ts +3 -1
  91. package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
  92. package/dist/components/city-input/index.js +1 -1
  93. package/dist/components/combobox/combobox.d.ts.map +1 -1
  94. package/dist/components/combobox/index.js +1 -1
  95. package/dist/components/command-palette/index.js +1 -1
  96. package/dist/components/contact-profile-card/contact-profile-card.d.ts +4 -1
  97. package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
  98. package/dist/components/contact-profile-card/index.js +1 -1
  99. package/dist/components/country-select/index.js +1 -1
  100. package/dist/components/data-table/index.js +1 -1
  101. package/dist/components/face-scheme/index.js +1 -1
  102. package/dist/components/header-settings/index.js +1 -1
  103. package/dist/components/locale-picker/index.js +1 -1
  104. package/dist/components/locale-picker/locale-picker.d.ts.map +1 -1
  105. package/dist/components/map-view/index.js +1 -1
  106. package/dist/components/multi-select/index.js +1 -1
  107. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  108. package/dist/components/otp-input/index.js +1 -1
  109. package/dist/components/otp-input/otp-input.d.ts +1 -1
  110. package/dist/components/otp-input/otp-input.d.ts.map +1 -1
  111. package/dist/components/patient-details/index.js +1 -1
  112. package/dist/components/patient-search/index.js +1 -1
  113. package/dist/components/patient-summary-card/index.js +1 -1
  114. package/dist/components/patient-table/index.js +1 -1
  115. package/dist/components/phone-input/index.js +1 -1
  116. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  117. package/dist/components/practice-results/index.js +1 -1
  118. package/dist/components/province-select/index.js +1 -1
  119. package/dist/components/task-editor/index.js +1 -1
  120. package/dist/i18n/locales/ar.d.ts +8 -0
  121. package/dist/i18n/locales/ar.d.ts.map +1 -1
  122. package/dist/i18n/locales/ar.js +8 -0
  123. package/dist/i18n/locales/ar.js.map +1 -1
  124. package/dist/i18n/locales/de.d.ts +8 -0
  125. package/dist/i18n/locales/de.d.ts.map +1 -1
  126. package/dist/i18n/locales/de.js +8 -0
  127. package/dist/i18n/locales/de.js.map +1 -1
  128. package/dist/i18n/locales/el.d.ts +8 -0
  129. package/dist/i18n/locales/el.d.ts.map +1 -1
  130. package/dist/i18n/locales/el.js +8 -0
  131. package/dist/i18n/locales/el.js.map +1 -1
  132. package/dist/i18n/locales/en.d.ts +8 -0
  133. package/dist/i18n/locales/en.d.ts.map +1 -1
  134. package/dist/i18n/locales/en.js +8 -0
  135. package/dist/i18n/locales/en.js.map +1 -1
  136. package/dist/i18n/locales/es.d.ts +8 -0
  137. package/dist/i18n/locales/es.d.ts.map +1 -1
  138. package/dist/i18n/locales/es.js +8 -0
  139. package/dist/i18n/locales/es.js.map +1 -1
  140. package/dist/i18n/locales/fr.d.ts +8 -0
  141. package/dist/i18n/locales/fr.d.ts.map +1 -1
  142. package/dist/i18n/locales/fr.js +8 -0
  143. package/dist/i18n/locales/fr.js.map +1 -1
  144. package/dist/i18n/locales/hi.d.ts +8 -0
  145. package/dist/i18n/locales/hi.d.ts.map +1 -1
  146. package/dist/i18n/locales/hi.js +8 -0
  147. package/dist/i18n/locales/hi.js.map +1 -1
  148. package/dist/i18n/locales/it.d.ts +8 -0
  149. package/dist/i18n/locales/it.d.ts.map +1 -1
  150. package/dist/i18n/locales/it.js +8 -0
  151. package/dist/i18n/locales/it.js.map +1 -1
  152. package/dist/i18n/locales/ja.d.ts +8 -0
  153. package/dist/i18n/locales/ja.d.ts.map +1 -1
  154. package/dist/i18n/locales/ja.js +8 -0
  155. package/dist/i18n/locales/ja.js.map +1 -1
  156. package/dist/i18n/locales/nl.d.ts +8 -0
  157. package/dist/i18n/locales/nl.d.ts.map +1 -1
  158. package/dist/i18n/locales/nl.js +8 -0
  159. package/dist/i18n/locales/nl.js.map +1 -1
  160. package/dist/i18n/locales/pl.d.ts +8 -0
  161. package/dist/i18n/locales/pl.d.ts.map +1 -1
  162. package/dist/i18n/locales/pl.js +8 -0
  163. package/dist/i18n/locales/pl.js.map +1 -1
  164. package/dist/i18n/locales/pt.d.ts +8 -0
  165. package/dist/i18n/locales/pt.d.ts.map +1 -1
  166. package/dist/i18n/locales/pt.js +8 -0
  167. package/dist/i18n/locales/pt.js.map +1 -1
  168. package/dist/i18n/locales/ro.d.ts +8 -0
  169. package/dist/i18n/locales/ro.d.ts.map +1 -1
  170. package/dist/i18n/locales/ro.js +8 -0
  171. package/dist/i18n/locales/ro.js.map +1 -1
  172. package/dist/i18n/locales/ru.d.ts +8 -0
  173. package/dist/i18n/locales/ru.d.ts.map +1 -1
  174. package/dist/i18n/locales/ru.js +8 -0
  175. package/dist/i18n/locales/ru.js.map +1 -1
  176. package/dist/i18n/locales/sq.d.ts +8 -0
  177. package/dist/i18n/locales/sq.d.ts.map +1 -1
  178. package/dist/i18n/locales/sq.js +8 -0
  179. package/dist/i18n/locales/sq.js.map +1 -1
  180. package/dist/i18n/locales/sv.d.ts +8 -0
  181. package/dist/i18n/locales/sv.d.ts.map +1 -1
  182. package/dist/i18n/locales/sv.js +8 -0
  183. package/dist/i18n/locales/sv.js.map +1 -1
  184. package/dist/i18n/locales/tr.d.ts +8 -0
  185. package/dist/i18n/locales/tr.d.ts.map +1 -1
  186. package/dist/i18n/locales/tr.js +8 -0
  187. package/dist/i18n/locales/tr.js.map +1 -1
  188. package/dist/i18n/locales/zh.d.ts +8 -0
  189. package/dist/i18n/locales/zh.d.ts.map +1 -1
  190. package/dist/i18n/locales/zh.js +8 -0
  191. package/dist/i18n/locales/zh.js.map +1 -1
  192. package/dist/index.js +30 -30
  193. package/dist/locales/ar.json +8 -0
  194. package/dist/locales/de.json +8 -0
  195. package/dist/locales/el.json +8 -0
  196. package/dist/locales/en.json +8 -0
  197. package/dist/locales/es.json +8 -0
  198. package/dist/locales/fr.json +8 -0
  199. package/dist/locales/hi.json +8 -0
  200. package/dist/locales/it.json +8 -0
  201. package/dist/locales/ja.json +8 -0
  202. package/dist/locales/nl.json +8 -0
  203. package/dist/locales/pl.json +8 -0
  204. package/dist/locales/pt.json +8 -0
  205. package/dist/locales/ro.json +8 -0
  206. package/dist/locales/ru.json +8 -0
  207. package/dist/locales/sq.json +8 -0
  208. package/dist/locales/sv.json +8 -0
  209. package/dist/locales/tr.json +8 -0
  210. package/dist/locales/zh.json +8 -0
  211. package/dist/patterns/anamnesis/index.js +1 -1
  212. package/dist/patterns/calendar/index.js +1 -1
  213. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  214. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  215. package/dist/patterns/registration-form/index.js +1 -1
  216. package/dist/patterns/send-registration-link-form/index.js +1 -1
  217. package/dist/tokens.css +1 -1
  218. package/package.json +1 -1
  219. package/dist/_chunks/booking-By4I_1A-.js +0 -4068
  220. package/dist/_chunks/booking-By4I_1A-.js.map +0 -1
  221. package/dist/_chunks/contact-profile-card-DKk94l-d.js.map +0 -1
  222. package/dist/_chunks/multi-select-BOad3za9.js.map +0 -1
  223. package/dist/_chunks/otp-input-BgEZi0py.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"map-view-C6MIVaqn.js","sources":["../../src/components/map-view/map-view.agent.ts","../../src/components/map-view/map-view.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — MapView. */\n/* */\n/* Read-safety actions on the kit's Google Maps wrapper. State is the */\n/* current centre / zoom / selected marker; actions pan, zoom, and */\n/* select markers programmatically. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { MapViewHandle, MapLatLng } from './map-view';\n\nexport const mapViewAgent: AgentAdapter<MapViewHandle> = {\n id: 'map-view',\n // pan → scroll (viewport move); set_zoom → set_value; select_marker → pick\n // (NON-persisting marker focus, no value state slot).\n capabilities: ['scroll', 'set_value', 'pick'],\n // Every action routes through the imperative bridge, which only exists\n // once the map has loaded: consent granted (the default is\n // `consentGranted={false}`) and Google Maps finished loading. Until then\n // all three actions are silent no-ops. `consentGranted` says whether the\n // gate is passed, and a null `center` after it means the map is still\n // loading. `center` / `zoom` are read off the live\n // map because Google clamps zoom and animates pans, so requested is not\n // applied; `selectedMarkerId` is the only confirmation the host accepted\n // a `select_marker` proposal.\n //\n // A9: marker ids only (`MapMarker.id` is a stable opaque id). Never\n // `MapMarker.label`, never the `address` prop (consumer-supplied free\n // text, PII in any patient-address deployment), never `apiKey`.\n state: {\n consentGranted: {\n type: 'boolean',\n descriptionKey: 'ui.agent.mapView.state.consentGranted',\n description:\n 'True when the GDPR consent gate has been passed. Read this FIRST: while it is false every action is a silent no-op against a placeholder, and nothing else in the surface says so. When it is true but `center` is still null, Google Maps is loading; wait for `center` before acting.',\n read: (handle) => handle.isConsentGranted(),\n },\n markerCount: {\n type: 'number',\n descriptionKey: 'ui.agent.mapView.state.markerCount',\n description:\n 'Number of markers the consumer passed. Zero means there is nothing for `select_marker` to select. A count only — no ids, labels or positions.',\n read: (handle) => handle.getMarkerCount(),\n },\n selectedMarkerId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.mapView.state.selectedMarkerId',\n description:\n 'Id of the marker the host currently holds as selected, or null. Selection is fully controlled by the consumer, so `select_marker` only proposes — this slot is the only way to see whether the proposal was accepted.',\n read: (handle) => handle.getSelectedMarkerId(),\n },\n center: {\n type: '{ lat: number; lng: number } | null',\n descriptionKey: 'ui.agent.mapView.state.center',\n description:\n 'Live map centre in lat/lng, or null until the map has loaded (consent not granted, or Google Maps still loading). The read-back for `pan_to`, and the sign that the map is ready.',\n read: (handle) => handle.getCenter(),\n },\n zoom: {\n type: 'number | null',\n descriptionKey: 'ui.agent.mapView.state.zoom',\n description:\n \"Live zoom level, or null until the map has loaded. Google clamps zoom to the map type's range, so this is not necessarily the value last passed to `set_zoom`.\",\n read: (handle) => handle.getZoom(),\n },\n },\n actions: {\n pan_to: {\n // Ephemeral viewport move, no data loss → read.\n safety: 'read',\n argsType: '{ position: { lat: number; lng: number } }',\n argsSchema: {\n type: 'object',\n properties: {\n position: {\n type: 'object',\n properties: {\n lat: { type: 'number', description: 'Latitude in degrees.' },\n lng: { type: 'number', description: 'Longitude in degrees.' },\n },\n required: ['lat', 'lng'],\n },\n },\n required: ['position'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.panTo',\n description:\n 'Pan the map to a new centre without changing zoom. Read the `center` slot back to confirm — Google animates the pan, so the applied centre settles after the call.',\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n ],\n invoke: (handle, args: { position: MapLatLng }) => {\n handle.panTo(args.position);\n },\n },\n set_zoom: {\n // Ephemeral viewport zoom, no data loss → read.\n safety: 'read',\n argsType: '{ zoom: number }',\n argsSchema: {\n type: 'object',\n properties: {\n zoom: {\n type: 'number',\n description: 'Zoom level, typical range 1–20.',\n },\n },\n required: ['zoom'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.setZoom',\n description:\n 'Set the map zoom level (typical range 1–20). Read the `zoom` slot back — Google clamps the request to the map type’s supported range, so requested and applied can differ.',\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n \"Requested zoom is clamped to the map type's range; `zoom` reports what was actually applied.\",\n ],\n invoke: (handle, args: { zoom: number }) => {\n handle.setZoom(args.zoom);\n },\n },\n select_marker: {\n // Ephemeral marker focus, no data loss → read.\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: ['string', 'null'],\n description: 'Marker id to select, or null to clear the selection.',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.selectMarker',\n description:\n \"Propose a marker selection by id, or pass null to clear it. Fires the host's `onMarkerClick`; selection is controlled by the host, so read the `selectedMarkerId` slot back to see whether it accepted.\",\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n 'The host owns `selectedMarkerId` and may ignore the proposal; `selectedMarkerId` is unchanged when it does.',\n ],\n invoke: (handle, args: { id: string | null }) => {\n handle.selectMarker(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'map-view',\n description: 'Marks the element as a kit MapView.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* MapView — kit wrapper over @vis.gl/react-google-maps. */\n/* */\n/* - Loads the Google Maps JS API on demand via the library's */\n/* `APIProvider`; consumer supplies the key (no kit-side cache). */\n/* - Defaults to a CONSENT-GATED placeholder (`consentGranted={false}`) */\n/* so the third-party load never happens before the consumer flips */\n/* the opt-in. GDPR-safe by default. */\n/* - Theme-reactive: the Google Maps `styles` JSON re-resolves on every */\n/* `documentElement.class` mutation (same pattern as Sparkline). */\n/* Consumers may pass `mapId` to switch to a cloud-styled map */\n/* instead, in which case `styles` is ignored. */\n/* - `data-component=\"map-view\"` lives on the outer span; the inner */\n/* `<Map>` mounts inside it. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { MapPin, ExternalLink } from 'lucide-react';\nimport {\n APIProvider,\n Map as GoogleMap,\n AdvancedMarker,\n Marker,\n Pin,\n useApiIsLoaded,\n useMap,\n useMapsLibrary,\n} from '@vis.gl/react-google-maps';\nimport { Button } from '../button';\nimport { Skeleton } from '../skeleton';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { mapViewAgent } from './map-view.agent';\nimport { lengthTokenPx } from '../_shared/length-token';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface MapLatLng {\n lat: number;\n lng: number;\n}\n\n/**\n * A point to fit the camera to. `id` is its identity (a result id): it\n * decides whether a new set only added points to the old one. Without\n * it the coordinates stand in, so two results at one address count as\n * one.\n */\nexport interface MapFitPoint extends MapLatLng {\n id?: string;\n}\n\nexport interface MapMarker {\n /** Stable id — used for keyed re-rendering and `onMarkerClick`. */\n id: string;\n /** Position in lat/lng. */\n position: MapLatLng;\n /** Optional accessible label — falls back to the id. */\n label?: string;\n}\n\nexport interface MapViewHandle {\n /** Pan the map to a new centre without changing zoom. */\n panTo: (position: MapLatLng) => void;\n /** Set zoom (typical range 1–20). */\n setZoom: (zoom: number) => void;\n /** Programmatically select a marker (fires `onMarkerClick`). */\n selectMarker: (id: string | null) => void;\n /* ---- read-back ------------------------------------------------- */\n /**\n * True once the consent gate has been passed. The map may still be\n * loading: the three actions above stay silent no-ops until\n * `getCenter` returns a value.\n */\n isConsentGranted: () => boolean;\n /** Live map centre, or `null` until the map has loaded. */\n getCenter: () => MapLatLng | null;\n /**\n * Live zoom level, or `null` until the map has loaded.\n * Google clamps to the map type's range, so this is not necessarily\n * the value last passed to `setZoom`.\n */\n getZoom: () => number | null;\n /**\n * The controlled `selectedMarkerId` prop as the host currently holds\n * it. `selectMarker` only proposes a selection — the host is free to\n * ignore it, and this is the only way to see whether it did.\n */\n getSelectedMarkerId: () => string | null;\n /** Number of markers passed to the component. Count only, no ids. */\n getMarkerCount: () => number;\n}\n\n/**\n * The slice of `MapViewHandle` that needs a live `google.maps.Map`.\n * Built inside the `APIProvider` subtree by `MapImperativeBridge`; the\n * outer component composes it with the props-derived getters, and holds\n * `null` whenever the subtree is unmounted.\n */\ntype MapBridgeHandle = Pick<\n MapViewHandle,\n 'panTo' | 'setZoom' | 'selectMarker' | 'getCenter' | 'getZoom'\n> & {\n /** Set centre and zoom in one step, never animated. Internal. */\n jumpTo: (center: MapLatLng, zoom: number) => void;\n};\n\nexport interface MapViewProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>,\n VariantProps<typeof mapViewVariants> {\n /** Opaque instance id — emitted as `data-component-id`. */\n id?: string;\n /** Google Maps JS API key. Consumer-owned; never cached by the kit. */\n apiKey: string;\n /** Map centre (lat/lng). Required so the consent placeholder can also use it. */\n center: MapLatLng;\n /** Initial zoom. Default 15 (city-block detail, matches booking site). */\n zoom?: number;\n /**\n * Markers to render. The first marker auto-selects when no\n * `selectedMarkerId` is given.\n */\n markers?: MapMarker[];\n /** Controlled selection — fires `onMarkerClick` with the new id (or null on map click). */\n selectedMarkerId?: string | null;\n /** Fires when a marker is clicked, or `null` when the map background is clicked. */\n onMarkerClick?: (id: string | null) => void;\n /**\n * GDPR consent gate. When `false` (default) the component renders a\n * placeholder with a translated CTA — the Maps JS API is **not**\n * loaded. Flip to `true` once the consumer has captured opt-in.\n */\n consentGranted?: boolean;\n /** Fires when the consumer clicks the \"Load map\" CTA in the placeholder. */\n onConsentRequest?: () => void;\n /**\n * Optional address string shown in the consent placeholder so the\n * surface is useful before the map loads. Also used to build the\n * fallback \"Open in Google Maps\" link target.\n */\n address?: string;\n /**\n * Cloud-styled-map id. When set, takes precedence over the JSON\n * `styles` array and disables the theme-bridge re-fire. Use when\n * you've provisioned a styled map in Google Cloud Console.\n */\n mapId?: string;\n /**\n * Override the consent-placeholder description text. The default\n * (`t('mapView.consentDescription')`) is a generic IP-disclosure\n * line. Consumers operating under specific GDPR / ePrivacy\n * disclosures (jurisdiction, named controller, policy link) should\n * supply their own text via this prop. Pass any `ReactNode` — a\n * paragraph, a localised `<Trans>` instance, etc.\n */\n consentDescription?: ReactNode;\n /**\n * Replace the kit-rendered \"Load map\" button with custom CTA chrome.\n * Use when the consent dialog needs a policy link, a specific\n * jurisdiction phrasing, or a different surface (Tooltip-wrapped\n * button, link to a settings page, etc.). When omitted the kit\n * renders its own `<Button>` — that button calls `onConsentRequest`\n * if provided, otherwise flips MapView's internal opt-in state so\n * the map loads inline.\n */\n consentCta?: ReactNode;\n /**\n * Visual surface. Default `bordered` (current behaviour: 1px\n * `--border` outline + `--radius-md`). `elevated` replaces the\n * border with `--shadow-card`, matching `<Card variant=\"elevated\">`.\n * `bare` drops both — map is flush against the page canvas.\n */\n surface?: 'bordered' | 'elevated' | 'bare';\n /** Accessible label for the map region. Falls back to `t('mapView.label')`. */\n ariaLabel?: string;\n /**\n * Points the camera fits into view, with a margin, once the map has\n * loaded, and again whenever `fitKey` changes. Use it to show every pin\n * of a result list without the patient moving the map.\n *\n * - One point (or several at the same place) centres on it at\n * `fitMaxZoom`.\n * - No points: no fit, the camera shows `center` / `zoom`. If the\n * points run out after a fit, or the prop is removed, the camera\n * goes back there in one step.\n * - Between key changes nothing refits, so a map the patient has\n * panned or zoomed stays where they left it.\n * - A key change that only adds points (a \"load more\": every fitted\n * point is still there, compared by `id`) refits only if the patient\n * has not moved the map. Any other change refits. Give each point the\n * `id` of its result: two results can share an address.\n * - The camera is set in one step, never animated.\n * - While there are points to fit, the fit owns the camera: later\n * changes to `center` or `zoom` do not move it.\n */\n fitToPoints?: MapFitPoint[];\n /**\n * Identity of the fitted set: the camera refits only when this\n * changes. Pass the ids of the listed results, so re-sorting the same\n * results does not refit. Defaults to the points themselves, in any\n * order.\n */\n fitKey?: string;\n /**\n * The closest a fit may zoom in, so one result does not open at street\n * level. Default 15.\n */\n fitMaxZoom?: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst mapViewVariants = cva(\n ['ds:relative ds:overflow-hidden ds:block', 'ds:bg-[var(--muted)]'].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:[--map-block-size:14rem]',\n md: 'ds:[--map-block-size:20rem]',\n lg: 'ds:[--map-block-size:28rem]',\n // `fill` defers sizing to the parent. The outer takes\n // `block-size: 100%` so the inner (also 100%) has something\n // to inherit from. Use inside a viewport-locked column —\n // `<PracticeResults variant=\"map-first\">` wires this through\n // automatically; standalone consumers must give the parent\n // a constrained block-size or the map collapses to 0.\n fill: 'ds:[block-size:100%]',\n },\n surface: {\n bordered:\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n elevated:\n 'ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)] ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)]',\n bare: 'ds:rounded-none ds:border-0',\n },\n },\n defaultVariants: { size: 'md', surface: 'bordered' },\n },\n);\n\n// Inner block-size: percentage when `size=\"fill\"`, rem-token otherwise.\n// Splitting this out (instead of compound-variants) keeps the size\n// switch readable and avoids enumerating every (size × surface) pair.\nconst innerSurfaceVariants = cva('ds:block ds:inline-size-full', {\n variants: {\n size: {\n sm: 'ds:[block-size:var(--map-block-size)]',\n md: 'ds:[block-size:var(--map-block-size)]',\n lg: 'ds:[block-size:var(--map-block-size)]',\n fill: 'ds:[block-size:100%]',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nconst consentChromeVariants = cva(\n [\n 'ds:absolute ds:inset-0',\n 'ds:flex ds:flex-col ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:bg-[var(--muted)] ds:text-[var(--foreground)]',\n 'ds:text-center',\n ].join(' '),\n);\n\nconst consentTitleVariants = cva('type-heading-3 ds:m-0');\n\nconst consentDescriptionVariants = cva(\n 'type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0',\n);\n\n/* ------------------------------------------------------------------ */\n/* Inner imperative bridge */\n/* */\n/* `useMap()` only resolves inside the APIProvider tree, so the */\n/* imperative actions live in a tiny inner component that the outer */\n/* `MapView` mounts conditionally. It exposes the `panTo` / `setZoom` */\n/* etc. to the forwardRef via a `useImperativeHandle` callback prop. */\n/* ------------------------------------------------------------------ */\n\ninterface MapImperativeBridgeProps {\n /** Called with the live handle on mount, and with `null` on unmount. */\n onHandleReady: (handle: MapBridgeHandle | null) => void;\n onMarkerSelect: (id: string | null) => void;\n}\n\nfunction MapImperativeBridge({\n onHandleReady,\n onMarkerSelect,\n}: MapImperativeBridgeProps): null {\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n onHandleReady({\n panTo: (position) => map.panTo(position),\n setZoom: (zoom) => map.setZoom(zoom),\n jumpTo: (center, zoom) => map.moveCamera({ center, zoom }),\n selectMarker: (id) => onMarkerSelect(id),\n // Read straight off the live map: Google clamps `setZoom` to the\n // map type's range and animates `panTo`, so requested and applied\n // are not the same value.\n getCenter: () => map.getCenter()?.toJSON() ?? null,\n getZoom: () => map.getZoom() ?? null,\n });\n // Drop the handle when the subtree unmounts (consent revoked, or the\n // component tears down) so the outer getters answer `null` instead of\n // reporting a dead map's last known position.\n return () => onHandleReady(null);\n }, [map, onHandleReady, onMarkerSelect]);\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Fit to points */\n/* */\n/* Lives inside <GoogleMap>, so it only runs once the `maps` library */\n/* has arrived and `useMap()` holds a real map: the load-race rule */\n/* below applies to it too. The camera is computed here (Web Mercator) */\n/* and set in one step, rather than through fitBounds: fitBounds takes */\n/* no zoom limit, and capping it afterwards needs an `idle` event that */\n/* Google may never send when the view does not change, so the cap */\n/* could fire on the patient's next zoom instead. Setting the camera */\n/* directly is synchronous and never animates (reduced motion). */\n/* */\n/* A map in a hidden column or a sheet still opening has no size yet, */\n/* so the fit waits for the map to be laid out. */\n/* ------------------------------------------------------------------ */\n\n/** Google's world is 256px wide at zoom 0. */\nconst WORLD_PX = 256;\n\nconst toRadians = (degrees: number): number => (degrees * Math.PI) / 180;\n\n/** Web Mercator y of a latitude: the world spans -π..π. */\nfunction mercatorY(lat: number): number {\n const sin = Math.min(Math.max(Math.sin(toRadians(lat)), -0.9999), 0.9999);\n return Math.log((1 + sin) / (1 - sin)) / 2;\n}\n\nconst latitudeOf = (y: number): number =>\n (Math.atan(Math.sinh(y)) * 180) / Math.PI;\n\n/** The box round `points` (not antimeridian-aware: the kit maps Europe). */\nfunction boundsOfPoints(points: MapLatLng[]): google.maps.LatLngBoundsLiteral {\n let north = -90;\n let south = 90;\n let east = -180;\n let west = 180;\n for (const { lat, lng } of points) {\n north = Math.max(north, lat);\n south = Math.min(south, lat);\n east = Math.max(east, lng);\n west = Math.min(west, lng);\n }\n return { north, south, east, west };\n}\n\n/**\n * The centre and the closest whole zoom that shows every point inside a\n * `width` x `height` map, `padding` px in from each edge, no closer than\n * `maxZoom`. Exported for tests.\n */\nexport function cameraForPoints(\n points: MapLatLng[],\n width: number,\n height: number,\n padding: number,\n maxZoom: number,\n): { center: MapLatLng; zoom: number } {\n const { north, south, east, west } = boundsOfPoints(points);\n if (north === south && east === west) {\n return { center: { lat: north, lng: east }, zoom: maxZoom };\n }\n const top = mercatorY(north);\n const bottom = mercatorY(south);\n const center = {\n lat: latitudeOf((top + bottom) / 2),\n lng: (east + west) / 2,\n };\n const fit = (px: number, fraction: number): number =>\n fraction > 0 ? Math.log2(Math.max(px, 1) / WORLD_PX / fraction) : maxZoom;\n const zoom = Math.min(\n fit(width - 2 * padding, (east - west) / 360),\n fit(height - 2 * padding, (top - bottom) / (2 * Math.PI)),\n maxZoom,\n );\n return { center, zoom: Math.max(0, Math.floor(zoom)) };\n}\n\n/** A fit point's identity: its id, or else its coordinates. */\nconst pointKey = ({ id, lat, lng }: MapFitPoint): string =>\n id != null ? `id:${id}` : `at:${lat},${lng}`;\n\ninterface MapFitterProps {\n points: MapFitPoint[];\n fitKey: string;\n maxZoom: number;\n}\n\nfunction MapFitter({ points, fitKey, maxZoom }: MapFitterProps): null {\n const map = useMap();\n const fitted = useRef<{\n map: google.maps.Map;\n key: string;\n points: Set<string>;\n } | null>(null);\n // Whether the patient has panned or zoomed since the last fit: any\n // camera the kit did not set counts. Comparing with the camera the kit\n // last set (rather than flagging the kit's own call) holds whether\n // Google reports the change at once or later, and catches keyboard and\n // control-button pans, which fire no `dragstart`.\n const userMoved = useRef(false);\n const ownCamera = useRef<{ center: MapLatLng; zoom: number } | null>(null);\n\n useEffect(() => {\n if (!map) return undefined;\n const check = (): void => {\n const own = ownCamera.current;\n const center = map.getCenter()?.toJSON();\n const zoom = map.getZoom();\n const same =\n own != null &&\n zoom === own.zoom &&\n center != null &&\n Math.abs(center.lat - own.center.lat) < 1e-6 &&\n Math.abs(center.lng - own.center.lng) < 1e-6;\n if (!same) userMoved.current = true;\n };\n const listeners = [\n map.addListener('dragstart', () => {\n userMoved.current = true;\n }),\n map.addListener('center_changed', check),\n map.addListener('zoom_changed', check),\n ];\n return () => listeners.forEach((listener) => listener.remove());\n }, [map]);\n\n useEffect(() => {\n if (!map) return undefined;\n const last = fitted.current?.map === map ? fitted.current : null;\n if (last?.key === fitKey) return undefined;\n const keys = new Set(points.map(pointKey));\n const moveCamera = (center: MapLatLng, zoom: number): void => {\n ownCamera.current = { center, zoom };\n // One step, never animated.\n map.moveCamera({ center, zoom });\n userMoved.current = false;\n };\n\n if (points.length === 0) {\n // Nothing to fit. MapView returns the camera to center/zoom when\n // fitting ends. Recording the empty set means the same results\n // coming back later count as a change and fit again.\n fitted.current = { map, key: fitKey, points: keys };\n return undefined;\n }\n\n // More of the same results (\"load more\"): every point already fitted\n // is still listed, by identity. If the patient has moved the map,\n // their view wins. A result replaced by another at the same address\n // is a different id, so that set refits.\n const grewOnly =\n last != null &&\n last.points.size > 0 &&\n [...last.points].every((point) => keys.has(point));\n if (grewOnly && userMoved.current) {\n fitted.current = { map, key: fitKey, points: keys };\n return undefined;\n }\n\n const div = map.getDiv();\n // Only a fake map has no element; there is nothing to measure.\n if (!(div instanceof Element)) return undefined;\n const fit = (): void => {\n fitted.current = { map, key: fitKey, points: keys };\n // Never more than a quarter of either side, so a small map still\n // has room to fit the points rather than zooming out to the world.\n const padding = Math.min(\n lengthTokenPx('--spacing-2xl', div, 48),\n div.clientWidth / 4,\n div.clientHeight / 4,\n );\n const { center, zoom } = cameraForPoints(\n points,\n div.clientWidth,\n div.clientHeight,\n padding,\n maxZoom,\n );\n moveCamera(center, zoom);\n };\n const laidOut = (): boolean => div.clientWidth > 0 && div.clientHeight > 0;\n if (laidOut() || typeof ResizeObserver === 'undefined') {\n fit();\n return undefined;\n }\n const observer = new ResizeObserver(() => {\n if (!laidOut()) return;\n observer.disconnect();\n fit();\n });\n observer.observe(div);\n return () => observer.disconnect();\n }, [map, fitKey, points, maxZoom]);\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Library gates */\n/* */\n/* APIProvider reports LOADED as soon as `google.maps.importLibrary` */\n/* exists when another loader installed it (Google's bootstrap, a host */\n/* Places loader), before the `maps` library itself has arrived. <Map> */\n/* would then run `new google.maps.Map` and throw, taking the host's */\n/* React tree down. The map waits for `maps`, and the markers for */\n/* `marker`, whoever loaded the API. Before the API loads, <Map> only */\n/* renders its empty container, and once a constructor exists nothing */\n/* can throw, so both pass straight through as they always did. */\n/* ------------------------------------------------------------------ */\n\ntype GoogleMapsGlobal = {\n google?: { maps?: { Map?: unknown; Marker?: unknown } };\n};\nconst hasConstructor = (name: 'Map' | 'Marker'): boolean =>\n typeof (globalThis as GoogleMapsGlobal).google?.maps?.[name] === 'function';\n\n/** What the map area shows while Google's map library is on its way.\n * Exported for its story; not part of the public API. */\nexport function MapViewLoading(): ReactNode {\n const { t } = useTranslation('ui');\n return (\n <div\n role=\"status\"\n data-testid=\"map-view-loading\"\n className=\"ds:[inline-size:100%] ds:[block-size:100%]\"\n >\n <Skeleton variant=\"rectangular\" width=\"100%\" height=\"100%\" />\n <VisuallyHidden>{t('common.loading')}</VisuallyHidden>\n </div>\n );\n}\n\nfunction MapsLibraryGate({ children }: { children: ReactNode }): ReactNode {\n const apiIsLoaded = useApiIsLoaded();\n const maps = useMapsLibrary('maps');\n if (maps || !apiIsLoaded || hasConstructor('Map')) return children;\n return <MapViewLoading />;\n}\n\nfunction MarkerLibraryGate({ children }: { children: ReactNode }): ReactNode {\n const marker = useMapsLibrary('marker');\n return marker || hasConstructor('Marker') ? children : null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Consent placeholder */\n/* ------------------------------------------------------------------ */\n\ninterface ConsentPlaceholderProps {\n address: string | undefined;\n description: ReactNode;\n /**\n * Click handler for the \"Load map\" button. Always rendered. When the\n * consumer provides `onConsentRequest` it owns the state transition\n * (typically: open a GDPR dialog, then flip `consentGranted` to true\n * after acceptance). When omitted, the kit's `MapView` falls back to\n * its own internal opt-in toggle — clicking grants consent for this\n * MapView instance only, no consumer plumbing required. This default\n * fixes a regression where the button was conditionally rendered and\n * any consumer omitting `onConsentRequest` left the patient with no\n * way to load the map (booking-website 0.31.0 hit this).\n */\n onLoadMap: () => void;\n openInGoogleMapsHref: string;\n /**\n * Custom CTA — replaces the kit-rendered `<Button>` when the consumer\n * needs a different surface (e.g. a Tooltip-wrapped button with a\n * policy link). The kit's button is still the recommended path; this\n * slot exists for consumers operating under specific compliance UX\n * requirements (jurisdiction, named controller, policy link). Pass\n * any `ReactNode`.\n */\n consentCta: ReactNode | undefined;\n}\n\nfunction ConsentPlaceholder({\n address,\n description,\n onLoadMap,\n openInGoogleMapsHref,\n consentCta,\n}: ConsentPlaceholderProps): ReactNode {\n const { t } = useTranslation('ui');\n return (\n <div className={consentChromeVariants()} data-testid=\"map-view-consent\">\n <MapPin\n aria-hidden=\"true\"\n className=\"ds:size-6 ds:text-[var(--muted-foreground)]\"\n />\n <p className={consentTitleVariants()}>{t('mapView.consentTitle')}</p>\n {address ? (\n <p\n className={consentDescriptionVariants()}\n data-testid=\"map-view-address\"\n >\n {address}\n </p>\n ) : null}\n <p className={consentDescriptionVariants()}>{description}</p>\n <div className=\"ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center\">\n {consentCta ?? (\n <Button\n type=\"button\"\n intent=\"primary\"\n size=\"sm\"\n onClick={onLoadMap}\n data-testid=\"map-view-load-cta\"\n >\n {t('mapView.consentCta')}\n </Button>\n )}\n <a\n href={openInGoogleMapsHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary)] ds:underline ds:underline-offset-2\"\n >\n {t('mapView.openInGoogleMaps')}\n <ExternalLink aria-hidden=\"true\" className=\"ds:size-3\" />\n </a>\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* MapView */\n/* ------------------------------------------------------------------ */\n\nexport const MapView = forwardRef<MapViewHandle, MapViewProps>(\n (\n {\n id,\n apiKey,\n center,\n zoom = 15,\n markers,\n selectedMarkerId,\n onMarkerClick,\n consentGranted = false,\n onConsentRequest,\n address,\n consentDescription,\n consentCta,\n mapId,\n size,\n surface,\n ariaLabel,\n fitToPoints,\n fitKey,\n fitMaxZoom = 15,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const fitPoints = useMemo(() => fitToPoints ?? [], [fitToPoints]);\n // Identity and place: a result that keeps its id but moves (a\n // corrected address) still refits. \"Only grew\" uses identity alone.\n const resolvedFitKey = useMemo(\n () =>\n fitKey ??\n fitPoints\n .map((point) => `${pointKey(point)}@${point.lat},${point.lng}`)\n .sort()\n .join('|'),\n [fitKey, fitPoints],\n );\n // While there are points, the fit owns the camera (see `fitToPoints`).\n const fitting = fitPoints.length > 0;\n const wasFitting = useRef(fitting);\n const rawId = useId();\n const instanceId = useMemo(\n () => `map-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n\n // Reduced-motion gating. Google's own pan / zoom animations\n // happen inside the Maps JS API and the kit can't reach into\n // those — but the kit's own programmatic `panTo` calls (triggered\n // by prop changes via the controlled-sync effect below) can be\n // suppressed. When `prefers-reduced-motion: reduce` is set, we\n // skip the synthetic `panTo` so the consumer's prop change\n // results in a hard recenter rather than an animated glide.\n const [reducedMotion, setReducedMotion] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined') return undefined;\n const mql = window.matchMedia('(prefers-reduced-motion: reduce)');\n const sync = (): void => setReducedMotion(mql.matches);\n sync();\n mql.addEventListener('change', sync);\n return () => mql.removeEventListener('change', sync);\n }, []);\n\n // The \"Open in Google Maps\" fallback link — works without any\n // third-party script load. Uses the modern `?api=1&query=…` form\n // which the booking site already employs.\n const openInGoogleMapsHref = useMemo(() => {\n const query = address\n ? encodeURIComponent(address)\n : `${center.lat},${center.lng}`;\n return `https://www.google.com/maps/search/?api=1&query=${query}`;\n }, [address, center.lat, center.lng]);\n\n // 0.33.5: removed the kit's `getGoogleMapsTheme()` JSON-styles\n // override. Previously, when `mapId` was absent the kit painted\n // water / roads / landscape with kit tokens — a calm muted-grey\n // palette that diverged from the standard Google Maps appearance\n // users expect in every other maps surface they touch. Google's\n // default (blue water, beige land, named-road colours) is more\n // familiar and reads as a \"real map\" rather than a stylised one.\n //\n // Consumers wanting brand-themed colours opt in via `mapId` and\n // configure the palette in Google Cloud Console — that's the\n // Google-recommended path. The `getGoogleMapsTheme` export stays\n // in `src/tokens/google-maps-theme.ts` so consumers wanting the\n // old behaviour can apply the styles themselves, but the kit\n // does NOT install them by default any more.\n //\n // Side benefit: dropped the MutationObserver that previously\n // watched documentElement.class for theme switches — no more\n // observer churn on every theme toggle.\n\n // Imperative handle plumbing — populated by the inner bridge once\n // the APIProvider tree resolves a `Map` instance.\n const handleRef = useRef<MapBridgeHandle | null>(null);\n const onHandleReady = useCallback((handle: MapBridgeHandle | null) => {\n handleRef.current = handle;\n }, []);\n\n // Read in the OUTER component, not through `handleRef` — these three\n // must still answer when the map subtree is unmounted, which is\n // exactly the situation an agent needs explaining. Assigned during\n // render, below, once `effectiveConsent` exists.\n const consentRef = useRef(false);\n const selectedMarkerIdRef = useRef<string | null>(null);\n const markerCountRef = useRef(0);\n\n const buildHandle = useCallback(\n (): MapViewHandle => ({\n panTo: (position) => handleRef.current?.panTo(position),\n setZoom: (z) => handleRef.current?.setZoom(z),\n selectMarker: (markerId) => handleRef.current?.selectMarker(markerId),\n // Without `isConsentGranted` an agent has no way to learn that\n // its pan / zoom / select was swallowed by the GDPR gate rather\n // than applied: under the default (`consentGranted={false}`) the\n // whole Maps subtree is unmounted and every action optional-chains\n // into nothing.\n isConsentGranted: () => consentRef.current,\n getCenter: () => handleRef.current?.getCenter() ?? null,\n getZoom: () => handleRef.current?.getZoom() ?? null,\n getSelectedMarkerId: () => selectedMarkerIdRef.current,\n getMarkerCount: () => markerCountRef.current,\n }),\n [],\n );\n useImperativeHandle(ref, buildHandle, [buildHandle]);\n\n const agentHandle = useMemo<MapViewHandle>(\n () => buildHandle(),\n [buildHandle],\n );\n useAgentRegistration(mapViewAgent, agentHandle, id);\n\n // Controlled-feeling propagation: vis.gl's `<Map>` reads `center`\n // and `zoom` as initial values only (via `defaultCenter` /\n // `defaultZoom`). To honour the documented \"live prop\" contract\n // we shim post-mount sync through the imperative bridge — a\n // parent that swaps offices by changing `center` re-centres the\n // map. User drag does NOT trigger this because the prop doesn't\n // change on user gesture, so the effect doesn't fire and the\n // map stays where the user left it.\n //\n // While fitting, the fit owns the camera and both syncs stand down.\n // `fitting` is a dependency, so when fitting ends (the points run out\n // or `fitToPoints` is removed) the camera returns to `center` / `zoom`\n // even if neither changed. That return is one step, not animated, so\n // it applies under reduced motion too.\n useEffect(() => {\n const fitEnded = wasFitting.current && !fitting;\n wasFitting.current = fitting;\n if (fitting) return;\n if (fitEnded) {\n handleRef.current?.jumpTo(center, zoom);\n return;\n }\n // Skip the animated pan under reduced-motion preference; the\n // map will still recentre on the next render via the agent\n // handle's `panTo`, but Google's own glide animation runs\n // either way (kit can't reach inside it). At least the kit's\n // own initiated pan is gated.\n if (reducedMotion) return;\n handleRef.current?.panTo(center);\n // Including `center` (the object reference) instead of\n // `center.lat`/`center.lng` would fire on every parent render\n // even when the coordinates are identical, fighting user drag.\n // `zoom` is read only when fitting ends; its own sync is below.\n // The destructured deps are intentional.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [center.lat, center.lng, reducedMotion, fitting]);\n useEffect(() => {\n if (fitting) return;\n handleRef.current?.setZoom(zoom);\n }, [zoom, fitting]);\n\n // Internal opt-in fallback. The `consentGranted` prop is the\n // controlled path — consumer flips it after capturing GDPR\n // acceptance through their own dialog and re-renders. When the\n // consumer omits `onConsentRequest` they're opting out of that\n // workflow, so the kit needs a sensible default click handler on\n // the placeholder's button. `internalConsent` tracks that opt-in\n // for this instance only; the map renders when either signal is\n // truthy. The 0.31.0 regression was conditionally rendering the\n // button on `onConsentRequest` — patients of consumers without the\n // hook saw the placeholder with no way to proceed.\n const [internalConsent, setInternalConsent] = useState(false);\n const effectiveConsent = consentGranted || internalConsent;\n // Mirror the three props-derived agent state slots. Assigned during\n // render so a read immediately after a prop change sees the settled\n // value. Ids and a count only — never `MapMarker.label`, never the\n // `address` prop (consumer-supplied free text, PII in any\n // patient-address deployment), never `apiKey`.\n consentRef.current = effectiveConsent;\n selectedMarkerIdRef.current = selectedMarkerId ?? null;\n markerCountRef.current = (markers ?? []).length;\n const handleLoadMap = useCallback(() => {\n if (onConsentRequest) {\n onConsentRequest();\n // The consumer typically flips `consentGranted` to true on the\n // next render. Flip the internal state too so the map still\n // loads if the consumer forgets to update its prop (the\n // common-case footgun this fallback exists to defuse).\n setInternalConsent(true);\n return;\n }\n setInternalConsent(true);\n }, [onConsentRequest]);\n\n return (\n <div\n className={mapViewVariants({ size, surface, className })}\n data-component=\"map-view\"\n data-component-id={id ?? instanceId}\n role=\"region\"\n aria-label={ariaLabel ?? t('mapView.label')}\n {...rest}\n >\n <div className={innerSurfaceVariants({ size })}>\n {effectiveConsent ? (\n <APIProvider\n apiKey={apiKey}\n // Pull the active i18next locale through so map UI text\n // (zoom controls, attribution) localises to match the\n // surrounding kit chrome.\n language={i18n.language}\n >\n <MapsLibraryGate>\n <GoogleMap\n defaultCenter={center}\n defaultZoom={zoom}\n mapId={mapId}\n gestureHandling=\"cooperative\"\n disableDefaultUI={false}\n onClick={() => onMarkerClick?.(null)}\n // `<Map>` reads its own bounding rect for tile sizing.\n // Without explicit dimensions it collapses to 0×0, so\n // we pass kit-class sizing through `className` — vis.gl\n // forwards `className` straight to the rendered root.\n className=\"ds:[inline-size:100%] ds:[block-size:100%]\"\n >\n <MapImperativeBridge\n onHandleReady={onHandleReady}\n onMarkerSelect={(markerId) => onMarkerClick?.(markerId)}\n />\n {fitToPoints ? (\n <MapFitter\n points={fitPoints}\n fitKey={resolvedFitKey}\n maxZoom={fitMaxZoom}\n />\n ) : null}\n <MarkerLibraryGate>\n {(markers ?? []).map((marker) => {\n // Selection state is exposed to the consumer via\n // `data-selected` on the marker root so consumers can\n // style their own InfoWindow / sidebar highlight from\n // it. The kit does NOT swap the Pin's fill colour on\n // selection — `--accent` (magenta-500 in light theme)\n // fails AA on white per 05-accessibility.mdx, and the\n // alternative tokens that pass (`--info`, `--success`)\n // carry semantic baggage. Visual selection state is\n // the consumer's call.\n const isSelected =\n selectedMarkerId != null &&\n selectedMarkerId === marker.id;\n const accessibleLabel = t('mapView.markerLabel', {\n label: marker.label ?? marker.id,\n });\n // Pin implementation switches on whether the\n // consumer supplied `mapId`. Google's\n // AdvancedMarkerElement requires the Map instance to\n // be initialised with a valid Map ID — without one\n // the API logs an error (\"La mappa è stata\n // inizializzata senza un ID mappa valido\") and any\n // AdvancedMarker rendered against that map fails to\n // appear. Cloud Map IDs are an opt-in feature; many\n // consumers (booking-website env without\n // GOOGLE_MAPS_MAP_ID, the OSS demo, etc.) legitimately\n // omit it.\n //\n // Fall back to the classic <Marker> (a thin wrapper\n // around google.maps.Marker) when mapId is absent.\n // Google has formally deprecated google.maps.Marker\n // but it still renders cleanly and produces no\n // console errors; the only loss is the brand-tinted\n // <Pin> chrome (which Marker doesn't accept as a\n // child). When a consumer wants the styled pin they\n // can opt back in by supplying `mapId`.\n if (mapId) {\n return (\n <AdvancedMarker\n key={marker.id}\n position={marker.position}\n // `title` becomes the HTML `title` attribute on\n // Google's marker wrapper — that's a tooltip, not\n // a reliable accessible name. The wrapper also\n // receives `aria-label` which Google honours as\n // the SR-announced name. Both are set so sighted\n // hover tooltips and SR labels stay aligned.\n title={accessibleLabel}\n aria-label={accessibleLabel}\n data-selected={isSelected ? 'true' : 'false'}\n onClick={() => onMarkerClick?.(marker.id)}\n >\n <Pin\n background={'var(--primary)'}\n borderColor={'var(--primary)'}\n glyphColor={'var(--primary-foreground)'}\n />\n </AdvancedMarker>\n );\n }\n return (\n <Marker\n key={marker.id}\n position={marker.position}\n title={accessibleLabel}\n onClick={() => onMarkerClick?.(marker.id)}\n />\n );\n })}\n </MarkerLibraryGate>\n </GoogleMap>\n </MapsLibraryGate>\n </APIProvider>\n ) : (\n <ConsentPlaceholder\n address={address}\n description={\n consentDescription ?? t('mapView.consentDescription')\n }\n onLoadMap={handleLoadMap}\n consentCta={consentCta}\n openInGoogleMapsHref={openInGoogleMapsHref}\n />\n )}\n </div>\n </div>\n );\n },\n);\nMapView.displayName = 'MapView';\n"],"names":["mapViewAgent","handle","args","mapViewVariants","cva","innerSurfaceVariants","consentChromeVariants","consentTitleVariants","consentDescriptionVariants","MapImperativeBridge","onHandleReady","onMarkerSelect","map","useMap","useEffect","position","zoom","center","id","_a","WORLD_PX","toRadians","degrees","mercatorY","lat","sin","latitudeOf","y","boundsOfPoints","points","north","south","east","west","lng","cameraForPoints","width","height","padding","maxZoom","top","bottom","fit","px","fraction","pointKey","MapFitter","fitKey","fitted","useRef","userMoved","ownCamera","check","own","listeners","listener","last","keys","moveCamera","point","div","lengthTokenPx","laidOut","observer","hasConstructor","name","_b","MapViewLoading","t","useTranslation","jsxs","jsx","Skeleton","VisuallyHidden","MapsLibraryGate","children","apiIsLoaded","useApiIsLoaded","useMapsLibrary","MarkerLibraryGate","ConsentPlaceholder","address","description","onLoadMap","openInGoogleMapsHref","consentCta","MapPin","Button","ExternalLink","MapView","forwardRef","apiKey","markers","selectedMarkerId","onMarkerClick","consentGranted","onConsentRequest","consentDescription","mapId","size","surface","ariaLabel","fitToPoints","fitMaxZoom","className","rest","ref","i18n","fitPoints","useMemo","resolvedFitKey","fitting","wasFitting","rawId","useId","instanceId","reducedMotion","setReducedMotion","useState","mql","sync","handleRef","useCallback","consentRef","selectedMarkerIdRef","markerCountRef","buildHandle","z","markerId","useImperativeHandle","agentHandle","useAgentRegistration","fitEnded","internalConsent","setInternalConsent","effectiveConsent","handleLoadMap","APIProvider","GoogleMap","marker","isSelected","accessibleLabel","AdvancedMarker","Pin","Marker"],"mappings":";;;;;;;;;;;;AAWO,MAAMA,KAA4C;AAAA,EACvD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,UAAU,aAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc5C,OAAO;AAAA,IACL,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,IAE5C,aAAa;AAAA,MACX,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,eAAA;AAAA,IAAe;AAAA,IAE1C,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,oBAAA;AAAA,IAAoB;AAAA,IAE/C,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;A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B7B,EAAE,4BAA4B;AAAA,YAEtD,WAAWoE;AAAA,YACX,YAAAnD;AAAA,YACA,sBAAAD;AAAA,UAAA;AAAA,QAAA,EACF,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAK,GAAQ,cAAc;"}
1
+ {"version":3,"file":"map-view-Bvi06RVh.js","sources":["../../src/components/map-view/map-view.agent.ts","../../src/components/map-view/map-view.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — MapView. */\n/* */\n/* Read-safety actions on the kit's Google Maps wrapper. State is the */\n/* current centre / zoom / selected marker; actions pan, zoom, and */\n/* select markers programmatically. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { MapViewHandle, MapLatLng } from './map-view';\n\nexport const mapViewAgent: AgentAdapter<MapViewHandle> = {\n id: 'map-view',\n // pan → scroll (viewport move); set_zoom → set_value; select_marker → pick\n // (NON-persisting marker focus, no value state slot).\n capabilities: ['scroll', 'set_value', 'pick'],\n // Every action routes through the imperative bridge, which only exists\n // once the map has loaded: consent granted (the default is\n // `consentGranted={false}`) and Google Maps finished loading. Until then\n // all three actions are silent no-ops. `consentGranted` says whether the\n // gate is passed, and a null `center` after it means the map is still\n // loading. `center` / `zoom` are read off the live\n // map because Google clamps zoom and animates pans, so requested is not\n // applied; `selectedMarkerId` is the only confirmation the host accepted\n // a `select_marker` proposal.\n //\n // A9: marker ids only (`MapMarker.id` is a stable opaque id). Never\n // `MapMarker.label`, never the `address` prop (consumer-supplied free\n // text, PII in any patient-address deployment), never `apiKey`.\n state: {\n consentGranted: {\n type: 'boolean',\n descriptionKey: 'ui.agent.mapView.state.consentGranted',\n description:\n 'True when the GDPR consent gate has been passed. Read this FIRST: while it is false every action is a silent no-op against a placeholder, and nothing else in the surface says so. When it is true but `center` is still null, Google Maps is loading; wait for `center` before acting.',\n read: (handle) => handle.isConsentGranted(),\n },\n markerCount: {\n type: 'number',\n descriptionKey: 'ui.agent.mapView.state.markerCount',\n description:\n 'Number of markers the consumer passed. Zero means there is nothing for `select_marker` to select. A count only — no ids, labels or positions.',\n read: (handle) => handle.getMarkerCount(),\n },\n selectedMarkerId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.mapView.state.selectedMarkerId',\n description:\n 'Id of the marker the host currently holds as selected, or null. Selection is fully controlled by the consumer, so `select_marker` only proposes — this slot is the only way to see whether the proposal was accepted.',\n read: (handle) => handle.getSelectedMarkerId(),\n },\n center: {\n type: '{ lat: number; lng: number } | null',\n descriptionKey: 'ui.agent.mapView.state.center',\n description:\n 'Live map centre in lat/lng, or null until the map has loaded (consent not granted, or Google Maps still loading). The read-back for `pan_to`, and the sign that the map is ready.',\n read: (handle) => handle.getCenter(),\n },\n zoom: {\n type: 'number | null',\n descriptionKey: 'ui.agent.mapView.state.zoom',\n description:\n \"Live zoom level, or null until the map has loaded. Google clamps zoom to the map type's range, so this is not necessarily the value last passed to `set_zoom`.\",\n read: (handle) => handle.getZoom(),\n },\n },\n actions: {\n pan_to: {\n // Ephemeral viewport move, no data loss → read.\n safety: 'read',\n argsType: '{ position: { lat: number; lng: number } }',\n argsSchema: {\n type: 'object',\n properties: {\n position: {\n type: 'object',\n properties: {\n lat: { type: 'number', description: 'Latitude in degrees.' },\n lng: { type: 'number', description: 'Longitude in degrees.' },\n },\n required: ['lat', 'lng'],\n },\n },\n required: ['position'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.panTo',\n description:\n 'Pan the map to a new centre without changing zoom. Read the `center` slot back to confirm — Google animates the pan, so the applied centre settles after the call.',\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n ],\n invoke: (handle, args: { position: MapLatLng }) => {\n handle.panTo(args.position);\n },\n },\n set_zoom: {\n // Ephemeral viewport zoom, no data loss → read.\n safety: 'read',\n argsType: '{ zoom: number }',\n argsSchema: {\n type: 'object',\n properties: {\n zoom: {\n type: 'number',\n description: 'Zoom level, typical range 1–20.',\n },\n },\n required: ['zoom'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.setZoom',\n description:\n 'Set the map zoom level (typical range 1–20). Read the `zoom` slot back — Google clamps the request to the map type’s supported range, so requested and applied can differ.',\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n \"Requested zoom is clamped to the map type's range; `zoom` reports what was actually applied.\",\n ],\n invoke: (handle, args: { zoom: number }) => {\n handle.setZoom(args.zoom);\n },\n },\n select_marker: {\n // Ephemeral marker focus, no data loss → read.\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: ['string', 'null'],\n description: 'Marker id to select, or null to clear the selection.',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.mapView.actions.selectMarker',\n description:\n \"Propose a marker selection by id, or pass null to clear it. Fires the host's `onMarkerClick`; selection is controlled by the host, so read the `selectedMarkerId` slot back to see whether it accepted.\",\n errors: [\n 'Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).',\n 'The host owns `selectedMarkerId` and may ignore the proposal; `selectedMarkerId` is unchanged when it does.',\n ],\n invoke: (handle, args: { id: string | null }) => {\n handle.selectMarker(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'map-view',\n description: 'Marks the element as a kit MapView.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* MapView — kit wrapper over @vis.gl/react-google-maps. */\n/* */\n/* - Loads the Google Maps JS API on demand via the library's */\n/* `APIProvider`; consumer supplies the key (no kit-side cache). */\n/* - Defaults to a CONSENT-GATED placeholder (`consentGranted={false}`) */\n/* so the third-party load never happens before the consumer flips */\n/* the opt-in. GDPR-safe by default. */\n/* - Theme-reactive: the Google Maps `styles` JSON re-resolves on every */\n/* `documentElement.class` mutation (same pattern as Sparkline). */\n/* Consumers may pass `mapId` to switch to a cloud-styled map */\n/* instead, in which case `styles` is ignored. */\n/* - `data-component=\"map-view\"` lives on the outer span; the inner */\n/* `<Map>` mounts inside it. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { MapPin, ExternalLink } from 'lucide-react';\nimport {\n APIProvider,\n Map as GoogleMap,\n AdvancedMarker,\n Marker,\n Pin,\n useApiIsLoaded,\n useMap,\n useMapsLibrary,\n} from '@vis.gl/react-google-maps';\nimport { Button } from '../button';\nimport { Skeleton } from '../skeleton';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { mapViewAgent } from './map-view.agent';\nimport { lengthTokenPx } from '../_shared/length-token';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface MapLatLng {\n lat: number;\n lng: number;\n}\n\n/**\n * A point to fit the camera to. `id` is its identity (a result id): it\n * decides whether a new set only added points to the old one. Without\n * it the coordinates stand in, so two results at one address count as\n * one.\n */\nexport interface MapFitPoint extends MapLatLng {\n id?: string;\n}\n\nexport interface MapMarker {\n /** Stable id — used for keyed re-rendering and `onMarkerClick`. */\n id: string;\n /** Position in lat/lng. */\n position: MapLatLng;\n /** Optional accessible label — falls back to the id. */\n label?: string;\n}\n\nexport interface MapViewHandle {\n /** Pan the map to a new centre without changing zoom. */\n panTo: (position: MapLatLng) => void;\n /** Set zoom (typical range 1–20). */\n setZoom: (zoom: number) => void;\n /** Programmatically select a marker (fires `onMarkerClick`). */\n selectMarker: (id: string | null) => void;\n /* ---- read-back ------------------------------------------------- */\n /**\n * True once the consent gate has been passed. The map may still be\n * loading: the three actions above stay silent no-ops until\n * `getCenter` returns a value.\n */\n isConsentGranted: () => boolean;\n /** Live map centre, or `null` until the map has loaded. */\n getCenter: () => MapLatLng | null;\n /**\n * Live zoom level, or `null` until the map has loaded.\n * Google clamps to the map type's range, so this is not necessarily\n * the value last passed to `setZoom`.\n */\n getZoom: () => number | null;\n /**\n * The controlled `selectedMarkerId` prop as the host currently holds\n * it. `selectMarker` only proposes a selection — the host is free to\n * ignore it, and this is the only way to see whether it did.\n */\n getSelectedMarkerId: () => string | null;\n /** Number of markers passed to the component. Count only, no ids. */\n getMarkerCount: () => number;\n}\n\n/**\n * The slice of `MapViewHandle` that needs a live `google.maps.Map`.\n * Built inside the `APIProvider` subtree by `MapImperativeBridge`; the\n * outer component composes it with the props-derived getters, and holds\n * `null` whenever the subtree is unmounted.\n */\ntype MapBridgeHandle = Pick<\n MapViewHandle,\n 'panTo' | 'setZoom' | 'selectMarker' | 'getCenter' | 'getZoom'\n> & {\n /** Set centre and zoom in one step, never animated. Internal. */\n jumpTo: (center: MapLatLng, zoom: number) => void;\n};\n\nexport interface MapViewProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>,\n VariantProps<typeof mapViewVariants> {\n /** Opaque instance id — emitted as `data-component-id`. */\n id?: string;\n /** Google Maps JS API key. Consumer-owned; never cached by the kit. */\n apiKey: string;\n /** Map centre (lat/lng). Required so the consent placeholder can also use it. */\n center: MapLatLng;\n /** Initial zoom. Default 15 (city-block detail, matches booking site). */\n zoom?: number;\n /**\n * Markers to render. The first marker auto-selects when no\n * `selectedMarkerId` is given.\n */\n markers?: MapMarker[];\n /** Controlled selection — fires `onMarkerClick` with the new id (or null on map click). */\n selectedMarkerId?: string | null;\n /** Fires when a marker is clicked, or `null` when the map background is clicked. */\n onMarkerClick?: (id: string | null) => void;\n /**\n * GDPR consent gate. When `false` (default) the component renders a\n * placeholder with a translated CTA — the Maps JS API is **not**\n * loaded. Flip to `true` once the consumer has captured opt-in.\n */\n consentGranted?: boolean;\n /** Fires when the consumer clicks the \"Load map\" CTA in the placeholder. */\n onConsentRequest?: () => void;\n /**\n * Optional address string shown in the consent placeholder so the\n * surface is useful before the map loads. Also used to build the\n * fallback \"Open in Google Maps\" link target.\n */\n address?: string;\n /**\n * Cloud-styled-map id. When set, takes precedence over the JSON\n * `styles` array and disables the theme-bridge re-fire. Use when\n * you've provisioned a styled map in Google Cloud Console.\n */\n mapId?: string;\n /**\n * Override the consent-placeholder description text. The default\n * (`t('mapView.consentDescription')`) is a generic IP-disclosure\n * line. Consumers operating under specific GDPR / ePrivacy\n * disclosures (jurisdiction, named controller, policy link) should\n * supply their own text via this prop. Pass any `ReactNode` — a\n * paragraph, a localised `<Trans>` instance, etc.\n */\n consentDescription?: ReactNode;\n /**\n * Replace the kit-rendered \"Load map\" button with custom CTA chrome.\n * Use when the consent dialog needs a policy link, a specific\n * jurisdiction phrasing, or a different surface (Tooltip-wrapped\n * button, link to a settings page, etc.). When omitted the kit\n * renders its own `<Button>` — that button calls `onConsentRequest`\n * if provided, otherwise flips MapView's internal opt-in state so\n * the map loads inline.\n */\n consentCta?: ReactNode;\n /**\n * Visual surface. Default `bordered` (current behaviour: 1px\n * `--border` outline + `--radius-md`). `elevated` replaces the\n * border with `--shadow-card`, matching `<Card variant=\"elevated\">`.\n * `bare` drops both — map is flush against the page canvas.\n */\n surface?: 'bordered' | 'elevated' | 'bare';\n /** Accessible label for the map region. Falls back to `t('mapView.label')`. */\n ariaLabel?: string;\n /**\n * Points the camera fits into view, with a margin, once the map has\n * loaded, and again whenever `fitKey` changes. Use it to show every pin\n * of a result list without the patient moving the map.\n *\n * - One point (or several at the same place) centres on it at\n * `fitMaxZoom`.\n * - No points: no fit, the camera shows `center` / `zoom`. If the\n * points run out after a fit, or the prop is removed, the camera\n * goes back there in one step.\n * - Between key changes nothing refits, so a map the patient has\n * panned or zoomed stays where they left it.\n * - A key change that only adds points (a \"load more\": every fitted\n * point is still there, compared by `id`) refits only if the patient\n * has not moved the map. Any other change refits. Give each point the\n * `id` of its result: two results can share an address.\n * - The camera is set in one step, never animated.\n * - While there are points to fit, the fit owns the camera: later\n * changes to `center` or `zoom` do not move it.\n */\n fitToPoints?: MapFitPoint[];\n /**\n * Identity of the fitted set: the camera refits only when this\n * changes. Pass the ids of the listed results, so re-sorting the same\n * results does not refit. Defaults to the points themselves, in any\n * order.\n */\n fitKey?: string;\n /**\n * The closest a fit may zoom in, so one result does not open at street\n * level. Default 15.\n */\n fitMaxZoom?: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst mapViewVariants = cva(\n ['ds:relative ds:overflow-hidden ds:block', 'ds:bg-[var(--muted)]'].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:[--map-block-size:14rem]',\n md: 'ds:[--map-block-size:20rem]',\n lg: 'ds:[--map-block-size:28rem]',\n // `fill` defers sizing to the parent. The outer takes\n // `block-size: 100%` so the inner (also 100%) has something\n // to inherit from. Use inside a viewport-locked column —\n // `<PracticeResults variant=\"map-first\">` wires this through\n // automatically; standalone consumers must give the parent\n // a constrained block-size or the map collapses to 0.\n fill: 'ds:[block-size:100%]',\n },\n surface: {\n bordered:\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n elevated:\n 'ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)] ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)]',\n bare: 'ds:rounded-none ds:border-0',\n },\n },\n defaultVariants: { size: 'md', surface: 'bordered' },\n },\n);\n\n// Inner block-size: percentage when `size=\"fill\"`, rem-token otherwise.\n// Splitting this out (instead of compound-variants) keeps the size\n// switch readable and avoids enumerating every (size × surface) pair.\nconst innerSurfaceVariants = cva('ds:block ds:inline-size-full', {\n variants: {\n size: {\n sm: 'ds:[block-size:var(--map-block-size)]',\n md: 'ds:[block-size:var(--map-block-size)]',\n lg: 'ds:[block-size:var(--map-block-size)]',\n fill: 'ds:[block-size:100%]',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nconst consentChromeVariants = cva(\n [\n 'ds:absolute ds:inset-0',\n 'ds:flex ds:flex-col ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:bg-[var(--muted)] ds:text-[var(--foreground)]',\n 'ds:text-center',\n ].join(' '),\n);\n\nconst consentTitleVariants = cva('type-heading-3 ds:m-0');\n\nconst consentDescriptionVariants = cva(\n 'type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0',\n);\n\n/* ------------------------------------------------------------------ */\n/* Inner imperative bridge */\n/* */\n/* `useMap()` only resolves inside the APIProvider tree, so the */\n/* imperative actions live in a tiny inner component that the outer */\n/* `MapView` mounts conditionally. It exposes the `panTo` / `setZoom` */\n/* etc. to the forwardRef via a `useImperativeHandle` callback prop. */\n/* ------------------------------------------------------------------ */\n\ninterface MapImperativeBridgeProps {\n /** Called with the live handle on mount, and with `null` on unmount. */\n onHandleReady: (handle: MapBridgeHandle | null) => void;\n onMarkerSelect: (id: string | null) => void;\n}\n\nfunction MapImperativeBridge({\n onHandleReady,\n onMarkerSelect,\n}: MapImperativeBridgeProps): null {\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n onHandleReady({\n panTo: (position) => map.panTo(position),\n setZoom: (zoom) => map.setZoom(zoom),\n jumpTo: (center, zoom) => map.moveCamera({ center, zoom }),\n selectMarker: (id) => onMarkerSelect(id),\n // Read straight off the live map: Google clamps `setZoom` to the\n // map type's range and animates `panTo`, so requested and applied\n // are not the same value.\n getCenter: () => map.getCenter()?.toJSON() ?? null,\n getZoom: () => map.getZoom() ?? null,\n });\n // Drop the handle when the subtree unmounts (consent revoked, or the\n // component tears down) so the outer getters answer `null` instead of\n // reporting a dead map's last known position.\n return () => onHandleReady(null);\n }, [map, onHandleReady, onMarkerSelect]);\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Fit to points */\n/* */\n/* Lives inside <GoogleMap>, so it only runs once the `maps` library */\n/* has arrived and `useMap()` holds a real map: the load-race rule */\n/* below applies to it too. The camera is computed here (Web Mercator) */\n/* and set in one step, rather than through fitBounds: fitBounds takes */\n/* no zoom limit, and capping it afterwards needs an `idle` event that */\n/* Google may never send when the view does not change, so the cap */\n/* could fire on the patient's next zoom instead. Setting the camera */\n/* directly is synchronous and never animates (reduced motion). */\n/* */\n/* A map in a hidden column or a sheet still opening has no size yet, */\n/* so the fit waits for the map to be laid out. */\n/* ------------------------------------------------------------------ */\n\n/** Google's world is 256px wide at zoom 0. */\nconst WORLD_PX = 256;\n\nconst toRadians = (degrees: number): number => (degrees * Math.PI) / 180;\n\n/** Web Mercator y of a latitude: the world spans -π..π. */\nfunction mercatorY(lat: number): number {\n const sin = Math.min(Math.max(Math.sin(toRadians(lat)), -0.9999), 0.9999);\n return Math.log((1 + sin) / (1 - sin)) / 2;\n}\n\nconst latitudeOf = (y: number): number =>\n (Math.atan(Math.sinh(y)) * 180) / Math.PI;\n\n/** The box round `points` (not antimeridian-aware: the kit maps Europe). */\nfunction boundsOfPoints(points: MapLatLng[]): google.maps.LatLngBoundsLiteral {\n let north = -90;\n let south = 90;\n let east = -180;\n let west = 180;\n for (const { lat, lng } of points) {\n north = Math.max(north, lat);\n south = Math.min(south, lat);\n east = Math.max(east, lng);\n west = Math.min(west, lng);\n }\n return { north, south, east, west };\n}\n\n/**\n * The centre and the closest whole zoom that shows every point inside a\n * `width` x `height` map, `padding` px in from each edge, no closer than\n * `maxZoom`. Exported for tests.\n */\nexport function cameraForPoints(\n points: MapLatLng[],\n width: number,\n height: number,\n padding: number,\n maxZoom: number,\n): { center: MapLatLng; zoom: number } {\n const { north, south, east, west } = boundsOfPoints(points);\n if (north === south && east === west) {\n return { center: { lat: north, lng: east }, zoom: maxZoom };\n }\n const top = mercatorY(north);\n const bottom = mercatorY(south);\n const center = {\n lat: latitudeOf((top + bottom) / 2),\n lng: (east + west) / 2,\n };\n const fit = (px: number, fraction: number): number =>\n fraction > 0 ? Math.log2(Math.max(px, 1) / WORLD_PX / fraction) : maxZoom;\n const zoom = Math.min(\n fit(width - 2 * padding, (east - west) / 360),\n fit(height - 2 * padding, (top - bottom) / (2 * Math.PI)),\n maxZoom,\n );\n return { center, zoom: Math.max(0, Math.floor(zoom)) };\n}\n\n/** A fit point's identity: its id, or else its coordinates. */\nconst pointKey = ({ id, lat, lng }: MapFitPoint): string =>\n id != null ? `id:${id}` : `at:${lat},${lng}`;\n\ninterface MapFitterProps {\n points: MapFitPoint[];\n fitKey: string;\n maxZoom: number;\n}\n\nfunction MapFitter({ points, fitKey, maxZoom }: MapFitterProps): null {\n const map = useMap();\n const fitted = useRef<{\n map: google.maps.Map;\n key: string;\n points: Set<string>;\n } | null>(null);\n // Whether the patient has panned or zoomed since the last fit: any\n // camera the kit did not set counts. Comparing with the camera the kit\n // last set (rather than flagging the kit's own call) holds whether\n // Google reports the change at once or later, and catches keyboard and\n // control-button pans, which fire no `dragstart`.\n const userMoved = useRef(false);\n const ownCamera = useRef<{ center: MapLatLng; zoom: number } | null>(null);\n\n useEffect(() => {\n if (!map) return undefined;\n const check = (): void => {\n const own = ownCamera.current;\n const center = map.getCenter()?.toJSON();\n const zoom = map.getZoom();\n const same =\n own != null &&\n zoom === own.zoom &&\n center != null &&\n Math.abs(center.lat - own.center.lat) < 1e-6 &&\n Math.abs(center.lng - own.center.lng) < 1e-6;\n if (!same) userMoved.current = true;\n };\n const listeners = [\n map.addListener('dragstart', () => {\n userMoved.current = true;\n }),\n map.addListener('center_changed', check),\n map.addListener('zoom_changed', check),\n ];\n return () => listeners.forEach((listener) => listener.remove());\n }, [map]);\n\n useEffect(() => {\n if (!map) return undefined;\n const last = fitted.current?.map === map ? fitted.current : null;\n if (last?.key === fitKey) return undefined;\n const keys = new Set(points.map(pointKey));\n const moveCamera = (center: MapLatLng, zoom: number): void => {\n ownCamera.current = { center, zoom };\n // One step, never animated.\n map.moveCamera({ center, zoom });\n userMoved.current = false;\n };\n\n if (points.length === 0) {\n // Nothing to fit. MapView returns the camera to center/zoom when\n // fitting ends. Recording the empty set means the same results\n // coming back later count as a change and fit again.\n fitted.current = { map, key: fitKey, points: keys };\n return undefined;\n }\n\n // More of the same results (\"load more\"): every point already fitted\n // is still listed, by identity. If the patient has moved the map,\n // their view wins. A result replaced by another at the same address\n // is a different id, so that set refits.\n const grewOnly =\n last != null &&\n last.points.size > 0 &&\n [...last.points].every((point) => keys.has(point));\n if (grewOnly && userMoved.current) {\n fitted.current = { map, key: fitKey, points: keys };\n return undefined;\n }\n\n const div = map.getDiv();\n // Only a fake map has no element; there is nothing to measure.\n if (!(div instanceof Element)) return undefined;\n const fit = (): void => {\n fitted.current = { map, key: fitKey, points: keys };\n // Never more than a quarter of either side, so a small map still\n // has room to fit the points rather than zooming out to the world.\n const padding = Math.min(\n lengthTokenPx('--spacing-2xl', div, 48),\n div.clientWidth / 4,\n div.clientHeight / 4,\n );\n const { center, zoom } = cameraForPoints(\n points,\n div.clientWidth,\n div.clientHeight,\n padding,\n maxZoom,\n );\n moveCamera(center, zoom);\n };\n const laidOut = (): boolean => div.clientWidth > 0 && div.clientHeight > 0;\n if (laidOut() || typeof ResizeObserver === 'undefined') {\n fit();\n return undefined;\n }\n const observer = new ResizeObserver(() => {\n if (!laidOut()) return;\n observer.disconnect();\n fit();\n });\n observer.observe(div);\n return () => observer.disconnect();\n }, [map, fitKey, points, maxZoom]);\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Library gates */\n/* */\n/* APIProvider reports LOADED as soon as `google.maps.importLibrary` */\n/* exists when another loader installed it (Google's bootstrap, a host */\n/* Places loader), before the `maps` library itself has arrived. <Map> */\n/* would then run `new google.maps.Map` and throw, taking the host's */\n/* React tree down. The map waits for `maps`, and the markers for */\n/* `marker`, whoever loaded the API. Before the API loads, <Map> only */\n/* renders its empty container, and once a constructor exists nothing */\n/* can throw, so both pass straight through as they always did. */\n/* ------------------------------------------------------------------ */\n\ntype GoogleMapsGlobal = {\n google?: { maps?: { Map?: unknown; Marker?: unknown } };\n};\nconst hasConstructor = (name: 'Map' | 'Marker'): boolean =>\n typeof (globalThis as GoogleMapsGlobal).google?.maps?.[name] === 'function';\n\n/** What the map area shows while Google's map library is on its way.\n * Exported for its story; not part of the public API. */\nexport function MapViewLoading(): ReactNode {\n const { t } = useTranslation('ui');\n return (\n <div\n role=\"status\"\n data-testid=\"map-view-loading\"\n className=\"ds:[inline-size:100%] ds:[block-size:100%]\"\n >\n <Skeleton variant=\"rectangular\" width=\"100%\" height=\"100%\" />\n <VisuallyHidden>{t('common.loading')}</VisuallyHidden>\n </div>\n );\n}\n\nfunction MapsLibraryGate({ children }: { children: ReactNode }): ReactNode {\n const apiIsLoaded = useApiIsLoaded();\n const maps = useMapsLibrary('maps');\n if (maps || !apiIsLoaded || hasConstructor('Map')) return children;\n return <MapViewLoading />;\n}\n\nfunction MarkerLibraryGate({ children }: { children: ReactNode }): ReactNode {\n const marker = useMapsLibrary('marker');\n return marker || hasConstructor('Marker') ? children : null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Consent placeholder */\n/* ------------------------------------------------------------------ */\n\ninterface ConsentPlaceholderProps {\n address: string | undefined;\n description: ReactNode;\n /**\n * Click handler for the \"Load map\" button. Always rendered. When the\n * consumer provides `onConsentRequest` it owns the state transition\n * (typically: open a GDPR dialog, then flip `consentGranted` to true\n * after acceptance). When omitted, the kit's `MapView` falls back to\n * its own internal opt-in toggle — clicking grants consent for this\n * MapView instance only, no consumer plumbing required. This default\n * fixes a regression where the button was conditionally rendered and\n * any consumer omitting `onConsentRequest` left the patient with no\n * way to load the map (booking-website 0.31.0 hit this).\n */\n onLoadMap: () => void;\n openInGoogleMapsHref: string;\n /**\n * Custom CTA — replaces the kit-rendered `<Button>` when the consumer\n * needs a different surface (e.g. a Tooltip-wrapped button with a\n * policy link). The kit's button is still the recommended path; this\n * slot exists for consumers operating under specific compliance UX\n * requirements (jurisdiction, named controller, policy link). Pass\n * any `ReactNode`.\n */\n consentCta: ReactNode | undefined;\n}\n\nfunction ConsentPlaceholder({\n address,\n description,\n onLoadMap,\n openInGoogleMapsHref,\n consentCta,\n}: ConsentPlaceholderProps): ReactNode {\n const { t } = useTranslation('ui');\n return (\n <div className={consentChromeVariants()} data-testid=\"map-view-consent\">\n <MapPin\n aria-hidden=\"true\"\n className=\"ds:size-6 ds:text-[var(--muted-foreground)]\"\n />\n <p className={consentTitleVariants()}>{t('mapView.consentTitle')}</p>\n {address ? (\n <p\n className={consentDescriptionVariants()}\n data-testid=\"map-view-address\"\n >\n {address}\n </p>\n ) : null}\n <p className={consentDescriptionVariants()}>{description}</p>\n <div className=\"ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center\">\n {consentCta ?? (\n <Button\n type=\"button\"\n intent=\"primary\"\n size=\"sm\"\n onClick={onLoadMap}\n data-testid=\"map-view-load-cta\"\n >\n {t('mapView.consentCta')}\n </Button>\n )}\n <a\n href={openInGoogleMapsHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary-readable)] ds:underline ds:underline-offset-2\"\n >\n {t('mapView.openInGoogleMaps')}\n <ExternalLink aria-hidden=\"true\" className=\"ds:size-3\" />\n </a>\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* MapView */\n/* ------------------------------------------------------------------ */\n\nexport const MapView = forwardRef<MapViewHandle, MapViewProps>(\n (\n {\n id,\n apiKey,\n center,\n zoom = 15,\n markers,\n selectedMarkerId,\n onMarkerClick,\n consentGranted = false,\n onConsentRequest,\n address,\n consentDescription,\n consentCta,\n mapId,\n size,\n surface,\n ariaLabel,\n fitToPoints,\n fitKey,\n fitMaxZoom = 15,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const fitPoints = useMemo(() => fitToPoints ?? [], [fitToPoints]);\n // Identity and place: a result that keeps its id but moves (a\n // corrected address) still refits. \"Only grew\" uses identity alone.\n const resolvedFitKey = useMemo(\n () =>\n fitKey ??\n fitPoints\n .map((point) => `${pointKey(point)}@${point.lat},${point.lng}`)\n .sort()\n .join('|'),\n [fitKey, fitPoints],\n );\n // While there are points, the fit owns the camera (see `fitToPoints`).\n const fitting = fitPoints.length > 0;\n const wasFitting = useRef(fitting);\n const rawId = useId();\n const instanceId = useMemo(\n () => `map-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n\n // Reduced-motion gating. Google's own pan / zoom animations\n // happen inside the Maps JS API and the kit can't reach into\n // those — but the kit's own programmatic `panTo` calls (triggered\n // by prop changes via the controlled-sync effect below) can be\n // suppressed. When `prefers-reduced-motion: reduce` is set, we\n // skip the synthetic `panTo` so the consumer's prop change\n // results in a hard recenter rather than an animated glide.\n const [reducedMotion, setReducedMotion] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined') return undefined;\n const mql = window.matchMedia('(prefers-reduced-motion: reduce)');\n const sync = (): void => setReducedMotion(mql.matches);\n sync();\n mql.addEventListener('change', sync);\n return () => mql.removeEventListener('change', sync);\n }, []);\n\n // The \"Open in Google Maps\" fallback link — works without any\n // third-party script load. Uses the modern `?api=1&query=…` form\n // which the booking site already employs.\n const openInGoogleMapsHref = useMemo(() => {\n const query = address\n ? encodeURIComponent(address)\n : `${center.lat},${center.lng}`;\n return `https://www.google.com/maps/search/?api=1&query=${query}`;\n }, [address, center.lat, center.lng]);\n\n // 0.33.5: removed the kit's `getGoogleMapsTheme()` JSON-styles\n // override. Previously, when `mapId` was absent the kit painted\n // water / roads / landscape with kit tokens — a calm muted-grey\n // palette that diverged from the standard Google Maps appearance\n // users expect in every other maps surface they touch. Google's\n // default (blue water, beige land, named-road colours) is more\n // familiar and reads as a \"real map\" rather than a stylised one.\n //\n // Consumers wanting brand-themed colours opt in via `mapId` and\n // configure the palette in Google Cloud Console — that's the\n // Google-recommended path. The `getGoogleMapsTheme` export stays\n // in `src/tokens/google-maps-theme.ts` so consumers wanting the\n // old behaviour can apply the styles themselves, but the kit\n // does NOT install them by default any more.\n //\n // Side benefit: dropped the MutationObserver that previously\n // watched documentElement.class for theme switches — no more\n // observer churn on every theme toggle.\n\n // Imperative handle plumbing — populated by the inner bridge once\n // the APIProvider tree resolves a `Map` instance.\n const handleRef = useRef<MapBridgeHandle | null>(null);\n const onHandleReady = useCallback((handle: MapBridgeHandle | null) => {\n handleRef.current = handle;\n }, []);\n\n // Read in the OUTER component, not through `handleRef` — these three\n // must still answer when the map subtree is unmounted, which is\n // exactly the situation an agent needs explaining. Assigned during\n // render, below, once `effectiveConsent` exists.\n const consentRef = useRef(false);\n const selectedMarkerIdRef = useRef<string | null>(null);\n const markerCountRef = useRef(0);\n\n const buildHandle = useCallback(\n (): MapViewHandle => ({\n panTo: (position) => handleRef.current?.panTo(position),\n setZoom: (z) => handleRef.current?.setZoom(z),\n selectMarker: (markerId) => handleRef.current?.selectMarker(markerId),\n // Without `isConsentGranted` an agent has no way to learn that\n // its pan / zoom / select was swallowed by the GDPR gate rather\n // than applied: under the default (`consentGranted={false}`) the\n // whole Maps subtree is unmounted and every action optional-chains\n // into nothing.\n isConsentGranted: () => consentRef.current,\n getCenter: () => handleRef.current?.getCenter() ?? null,\n getZoom: () => handleRef.current?.getZoom() ?? null,\n getSelectedMarkerId: () => selectedMarkerIdRef.current,\n getMarkerCount: () => markerCountRef.current,\n }),\n [],\n );\n useImperativeHandle(ref, buildHandle, [buildHandle]);\n\n const agentHandle = useMemo<MapViewHandle>(\n () => buildHandle(),\n [buildHandle],\n );\n useAgentRegistration(mapViewAgent, agentHandle, id);\n\n // Controlled-feeling propagation: vis.gl's `<Map>` reads `center`\n // and `zoom` as initial values only (via `defaultCenter` /\n // `defaultZoom`). To honour the documented \"live prop\" contract\n // we shim post-mount sync through the imperative bridge — a\n // parent that swaps offices by changing `center` re-centres the\n // map. User drag does NOT trigger this because the prop doesn't\n // change on user gesture, so the effect doesn't fire and the\n // map stays where the user left it.\n //\n // While fitting, the fit owns the camera and both syncs stand down.\n // `fitting` is a dependency, so when fitting ends (the points run out\n // or `fitToPoints` is removed) the camera returns to `center` / `zoom`\n // even if neither changed. That return is one step, not animated, so\n // it applies under reduced motion too.\n useEffect(() => {\n const fitEnded = wasFitting.current && !fitting;\n wasFitting.current = fitting;\n if (fitting) return;\n if (fitEnded) {\n handleRef.current?.jumpTo(center, zoom);\n return;\n }\n // Skip the animated pan under reduced-motion preference; the\n // map will still recentre on the next render via the agent\n // handle's `panTo`, but Google's own glide animation runs\n // either way (kit can't reach inside it). At least the kit's\n // own initiated pan is gated.\n if (reducedMotion) return;\n handleRef.current?.panTo(center);\n // Including `center` (the object reference) instead of\n // `center.lat`/`center.lng` would fire on every parent render\n // even when the coordinates are identical, fighting user drag.\n // `zoom` is read only when fitting ends; its own sync is below.\n // The destructured deps are intentional.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [center.lat, center.lng, reducedMotion, fitting]);\n useEffect(() => {\n if (fitting) return;\n handleRef.current?.setZoom(zoom);\n }, [zoom, fitting]);\n\n // Internal opt-in fallback. The `consentGranted` prop is the\n // controlled path — consumer flips it after capturing GDPR\n // acceptance through their own dialog and re-renders. When the\n // consumer omits `onConsentRequest` they're opting out of that\n // workflow, so the kit needs a sensible default click handler on\n // the placeholder's button. `internalConsent` tracks that opt-in\n // for this instance only; the map renders when either signal is\n // truthy. The 0.31.0 regression was conditionally rendering the\n // button on `onConsentRequest` — patients of consumers without the\n // hook saw the placeholder with no way to proceed.\n const [internalConsent, setInternalConsent] = useState(false);\n const effectiveConsent = consentGranted || internalConsent;\n // Mirror the three props-derived agent state slots. Assigned during\n // render so a read immediately after a prop change sees the settled\n // value. Ids and a count only — never `MapMarker.label`, never the\n // `address` prop (consumer-supplied free text, PII in any\n // patient-address deployment), never `apiKey`.\n consentRef.current = effectiveConsent;\n selectedMarkerIdRef.current = selectedMarkerId ?? null;\n markerCountRef.current = (markers ?? []).length;\n const handleLoadMap = useCallback(() => {\n if (onConsentRequest) {\n onConsentRequest();\n // The consumer typically flips `consentGranted` to true on the\n // next render. Flip the internal state too so the map still\n // loads if the consumer forgets to update its prop (the\n // common-case footgun this fallback exists to defuse).\n setInternalConsent(true);\n return;\n }\n setInternalConsent(true);\n }, [onConsentRequest]);\n\n return (\n <div\n className={mapViewVariants({ size, surface, className })}\n data-component=\"map-view\"\n data-component-id={id ?? instanceId}\n role=\"region\"\n aria-label={ariaLabel ?? t('mapView.label')}\n {...rest}\n >\n <div className={innerSurfaceVariants({ size })}>\n {effectiveConsent ? (\n <APIProvider\n apiKey={apiKey}\n // Pull the active i18next locale through so map UI text\n // (zoom controls, attribution) localises to match the\n // surrounding kit chrome.\n language={i18n.language}\n >\n <MapsLibraryGate>\n <GoogleMap\n defaultCenter={center}\n defaultZoom={zoom}\n mapId={mapId}\n gestureHandling=\"cooperative\"\n disableDefaultUI={false}\n onClick={() => onMarkerClick?.(null)}\n // `<Map>` reads its own bounding rect for tile sizing.\n // Without explicit dimensions it collapses to 0×0, so\n // we pass kit-class sizing through `className` — vis.gl\n // forwards `className` straight to the rendered root.\n className=\"ds:[inline-size:100%] ds:[block-size:100%]\"\n >\n <MapImperativeBridge\n onHandleReady={onHandleReady}\n onMarkerSelect={(markerId) => onMarkerClick?.(markerId)}\n />\n {fitToPoints ? (\n <MapFitter\n points={fitPoints}\n fitKey={resolvedFitKey}\n maxZoom={fitMaxZoom}\n />\n ) : null}\n <MarkerLibraryGate>\n {(markers ?? []).map((marker) => {\n // Selection state is exposed to the consumer via\n // `data-selected` on the marker root so consumers can\n // style their own InfoWindow / sidebar highlight from\n // it. The kit does NOT swap the Pin's fill colour on\n // selection — `--accent` (magenta-500 in light theme)\n // fails AA on white per 05-accessibility.mdx, and the\n // alternative tokens that pass (`--info`, `--success`)\n // carry semantic baggage. Visual selection state is\n // the consumer's call.\n const isSelected =\n selectedMarkerId != null &&\n selectedMarkerId === marker.id;\n const accessibleLabel = t('mapView.markerLabel', {\n label: marker.label ?? marker.id,\n });\n // Pin implementation switches on whether the\n // consumer supplied `mapId`. Google's\n // AdvancedMarkerElement requires the Map instance to\n // be initialised with a valid Map ID — without one\n // the API logs an error (\"La mappa è stata\n // inizializzata senza un ID mappa valido\") and any\n // AdvancedMarker rendered against that map fails to\n // appear. Cloud Map IDs are an opt-in feature; many\n // consumers (booking-website env without\n // GOOGLE_MAPS_MAP_ID, the OSS demo, etc.) legitimately\n // omit it.\n //\n // Fall back to the classic <Marker> (a thin wrapper\n // around google.maps.Marker) when mapId is absent.\n // Google has formally deprecated google.maps.Marker\n // but it still renders cleanly and produces no\n // console errors; the only loss is the brand-tinted\n // <Pin> chrome (which Marker doesn't accept as a\n // child). When a consumer wants the styled pin they\n // can opt back in by supplying `mapId`.\n if (mapId) {\n return (\n <AdvancedMarker\n key={marker.id}\n position={marker.position}\n // `title` becomes the HTML `title` attribute on\n // Google's marker wrapper — that's a tooltip, not\n // a reliable accessible name. The wrapper also\n // receives `aria-label` which Google honours as\n // the SR-announced name. Both are set so sighted\n // hover tooltips and SR labels stay aligned.\n title={accessibleLabel}\n aria-label={accessibleLabel}\n data-selected={isSelected ? 'true' : 'false'}\n onClick={() => onMarkerClick?.(marker.id)}\n >\n <Pin\n background={'var(--primary)'}\n borderColor={'var(--primary)'}\n glyphColor={'var(--primary-foreground)'}\n />\n </AdvancedMarker>\n );\n }\n return (\n <Marker\n key={marker.id}\n position={marker.position}\n title={accessibleLabel}\n onClick={() => onMarkerClick?.(marker.id)}\n />\n );\n })}\n </MarkerLibraryGate>\n </GoogleMap>\n </MapsLibraryGate>\n </APIProvider>\n ) : (\n <ConsentPlaceholder\n address={address}\n description={\n consentDescription ?? t('mapView.consentDescription')\n }\n onLoadMap={handleLoadMap}\n consentCta={consentCta}\n openInGoogleMapsHref={openInGoogleMapsHref}\n />\n )}\n </div>\n </div>\n );\n },\n);\nMapView.displayName = 'MapView';\n"],"names":["mapViewAgent","handle","args","mapViewVariants","cva","innerSurfaceVariants","consentChromeVariants","consentTitleVariants","consentDescriptionVariants","MapImperativeBridge","onHandleReady","onMarkerSelect","map","useMap","useEffect","position","zoom","center","id","_a","WORLD_PX","toRadians","degrees","mercatorY","lat","sin","latitudeOf","y","boundsOfPoints","points","north","south","east","west","lng","cameraForPoints","width","height","padding","maxZoom","top","bottom","fit","px","fraction","pointKey","MapFitter","fitKey","fitted","useRef","userMoved","ownCamera","check","own","listeners","listener","last","keys","moveCamera","point","div","lengthTokenPx","laidOut","observer","hasConstructor","name","_b","MapViewLoading","t","useTranslation","jsxs","jsx","Skeleton","VisuallyHidden","MapsLibraryGate","children","apiIsLoaded","useApiIsLoaded","useMapsLibrary","MarkerLibraryGate","ConsentPlaceholder","address","description","onLoadMap","openInGoogleMapsHref","consentCta","MapPin","Button","ExternalLink","MapView","forwardRef","apiKey","markers","selectedMarkerId","onMarkerClick","consentGranted","onConsentRequest","consentDescription","mapId","size","surface","ariaLabel","fitToPoints","fitMaxZoom","className","rest","ref","i18n","fitPoints","useMemo","resolvedFitKey","fitting","wasFitting","rawId","useId","instanceId","reducedMotion","setReducedMotion","useState","mql","sync","handleRef","useCallback","consentRef","selectedMarkerIdRef","markerCountRef","buildHandle","z","markerId","useImperativeHandle","agentHandle","useAgentRegistration","fitEnded","internalConsent","setInternalConsent","effectiveConsent","handleLoadMap","APIProvider","GoogleMap","marker","isSelected","accessibleLabel","AdvancedMarker","Pin","Marker"],"mappings":";;;;;;;;;;;;AAWO,MAAMA,KAA4C;AAAA,EACvD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,UAAU,aAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc5C,OAAO;AAAA,IACL,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,iBAAA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Aa;AAAA,4BACb,YAAY;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBACd;AAAA,sBAjBKJ,EAAO;AAAA,oBAAA,IAsBhB,gBAAApE;AAAA,sBAACyE;AAAA,sBAAA;AAAA,wBAEC,UAAUL,EAAO;AAAA,wBACjB,OAAOE;AAAA,wBACP,SAAS,MAAM/C,KAAA,gBAAAA,EAAgB6C,EAAO;AAAA,sBAAE;AAAA,sBAHnCA,EAAO;AAAA,oBAAA;AAAA,kBAMlB,CAAC,EAAA,CACH;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,EACF,CACF;AAAA,UAAA;AAAA,QAAA,IAGF,gBAAApE;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,SAAAC;AAAA,YACA,aACEgB,KAAsB7B,EAAE,4BAA4B;AAAA,YAEtD,WAAWoE;AAAA,YACX,YAAAnD;AAAA,YACA,sBAAAD;AAAA,UAAA;AAAA,QAAA,EACF,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAK,GAAQ,cAAc;"}
@@ -9,7 +9,7 @@ import { C as U } from "./card-BA4Ig_kn.js";
9
9
  import { D as u } from "./dropdown-menu-D1we7oAY.js";
10
10
  import { T as ke } from "./tab-bar-BEODTG6k.js";
11
11
  import { a as Y, H as we, g as Ne, f as G, e as ye, c as Se, d as Ce } from "./header-l_B8MV0g.js";
12
- import { H as Ae } from "./header-settings-BYpVmLip.js";
12
+ import { H as Ae } from "./header-settings-CifwJEKB.js";
13
13
  import { S as Te } from "./sign-in-with-alfadocs-button-DzrNgbWv.js";
14
14
  import { S as Ee, a as ee, v as ze, h as Ie, c as Me, r as Le, b as He, l as Ve, m as Be, k as Re, j as J } from "./sidebar-BS24EnYd.js";
15
15
  import { N as De } from "./navigation-dismiss-B1mcW1CT.js";
@@ -656,4 +656,4 @@ export {
656
656
  na as M,
657
657
  y as P
658
658
  };
659
- //# sourceMappingURL=marketplace-app-shell-mS7Q2-81.js.map
659
+ //# sourceMappingURL=marketplace-app-shell-vON3WhD0.js.map