@alfadocs/ui-kit-debug 1.98.0 → 1.99.1

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.
@@ -1,18 +1,18 @@
1
- import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
- import { forwardRef as Ae, useRef as E, useState as J, useEffect as q, useLayoutEffect as We, useMemo as le, useImperativeHandle as Pe, createContext as Qe, useCallback as Z, useId as Se, useContext as Fe } from "react";
1
+ import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
+ import { forwardRef as Te, useRef as R, useState as J, useEffect as q, useLayoutEffect as Ae, useMemo as le, useImperativeHandle as We, createContext as Pe, useCallback as Z, useId as _e, useContext as Qe } from "react";
3
3
  import { c as H } from "./index-D2ZczOXr.js";
4
- import { useTranslation as D } from "react-i18next";
5
- import { A as ke } from "./autocomplete-D10ydpgi.js";
6
- import { B as Ie } from "./button-DohK_Ak_.js";
4
+ import { useTranslation as V } from "react-i18next";
5
+ import { A as Se } from "./autocomplete-D10ydpgi.js";
6
+ import { B as Fe } from "./button-DohK_Ak_.js";
7
7
  import { C as ee } from "./card-C85_Ndhb.js";
8
- import { S as De } from "./slider-pZ95bEm7.js";
9
- import { A as ye } from "./alert-9kEwDza3.js";
8
+ import { S as Ie } from "./slider-pZ95bEm7.js";
9
+ import { a as Ve } from "./toast-BNoN8Qjh.js";
10
10
  import { D as Y } from "./dropdown-menu-CqxBthww.js";
11
- import { u as Ve } from "./registry-DvAUVLHh.js";
12
- import { S as Ne } from "./search-QbWPlY5f.js";
13
- import { X as Ce } from "./x-B5YnXwCz.js";
14
- import { c as Oe } from "./createLucideIcon-DhHxpK9K.js";
15
- import { M as Be } from "./map-pin-BaY37-Km.js";
11
+ import { u as Oe } from "./registry-DvAUVLHh.js";
12
+ import { S as ke } from "./search-QbWPlY5f.js";
13
+ import { X as Ne } from "./x-B5YnXwCz.js";
14
+ import { c as Be } from "./createLucideIcon-DhHxpK9K.js";
15
+ import { M as De } from "./map-pin-BaY37-Km.js";
16
16
  import { S as Ke } from "./stethoscope-sZXGC43m.js";
17
17
  import { C as ze } from "./chevron-down-DWE7GSq9.js";
18
18
  /**
@@ -28,7 +28,7 @@ const Me = [
28
28
  ["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }],
29
29
  ["circle", { cx: "12", cy: "12", r: "7", key: "fim9np" }],
30
30
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
31
- ], qe = Oe("locate-fixed", Me), He = {
31
+ ], qe = Be("locate-fixed", Me), He = {
32
32
  id: "patient-search",
33
33
  // `filter` is the conceptual capability of this search widget. Building the
34
34
  // actual query (WHO/WHERE/WHEN/facets/geo) is host-delegated: selection is
@@ -92,7 +92,7 @@ const K = [
92
92
  "tomorrow",
93
93
  "this_week",
94
94
  "anytime"
95
- ], $ = [1, 5, 10, 25, 50], ue = 5, Re = 200;
95
+ ], $ = [1, 5, 10, 25, 50], ue = 5, Ce = 200;
96
96
  function $e(e) {
97
97
  let r = 0, a = Number.POSITIVE_INFINITY;
98
98
  return $.forEach((o, p) => {
@@ -113,9 +113,9 @@ const Ue = H(
113
113
  },
114
114
  defaultVariants: { variant: "who-where" }
115
115
  }
116
- ), Ee = Qe(null);
117
- function Le(e) {
118
- const r = Fe(Ee), a = E(!1);
116
+ ), Re = Pe(null);
117
+ function Ee(e) {
118
+ const r = Qe(Re), a = R(!1);
119
119
  return r ? r[e] : a;
120
120
  }
121
121
  function te({
@@ -127,27 +127,27 @@ function te({
127
127
  query: i,
128
128
  onQueryChange: v
129
129
  }) {
130
- var m, u, c;
131
- const { t: h } = D("ui"), d = E((m = e.object) == null ? void 0 : m.value);
130
+ var m, f, d;
131
+ const { t: h } = V("ui"), c = R((m = e.object) == null ? void 0 : m.value);
132
132
  q(() => {
133
133
  var l, y, g;
134
- ((l = e.object) == null ? void 0 : l.value) !== d.current && (d.current = (y = e.object) == null ? void 0 : y.value, v(((g = e.object) == null ? void 0 : g.label) ?? ""));
135
- }, [(u = e.object) == null ? void 0 : u.value, (c = e.object) == null ? void 0 : c.label, v]);
134
+ ((l = e.object) == null ? void 0 : l.value) !== c.current && (c.current = (y = e.object) == null ? void 0 : y.value, v(((g = e.object) == null ? void 0 : g.label) ?? ""));
135
+ }, [(f = e.object) == null ? void 0 : f.value, (d = e.object) == null ? void 0 : d.label, v]);
136
136
  const s = Z(
137
137
  async (l, { signal: y }) => await a(l, { signal: y }),
138
138
  [a]
139
- ), f = (l) => {
139
+ ), u = (l) => {
140
140
  const y = {
141
141
  value: l.value,
142
142
  label: l.label,
143
143
  description: l.description,
144
144
  __payload: l.__payload
145
145
  };
146
- v(y.label), d.current = y.value, r({ ...e, object: y }), S("patient_search_object_selected", {
146
+ v(y.label), c.current = y.value, r({ ...e, object: y }), S("patient_search_object_selected", {
147
147
  value: y.value,
148
148
  type: y.__payload && typeof y.__payload == "object" ? y.__payload.type : void 0
149
149
  }), o == null || o(y);
150
- }, n = Le("who");
150
+ }, n = Ee("who");
151
151
  return /* @__PURE__ */ t(
152
152
  "div",
153
153
  {
@@ -160,26 +160,26 @@ function te({
160
160
  l.currentTarget && !l.currentTarget.contains(l.relatedTarget) && (n.current = !1);
161
161
  },
162
162
  children: /* @__PURE__ */ t(
163
- ke,
163
+ Se,
164
164
  {
165
165
  ref: p,
166
166
  size: "lg",
167
167
  value: i,
168
168
  onChange: (l) => {
169
- v(l), e.object && l !== e.object.label && (d.current = void 0, r({ ...e, object: void 0 }));
169
+ v(l), e.object && l !== e.object.label && (c.current = void 0, r({ ...e, object: void 0 }));
170
170
  },
171
- onSelect: f,
171
+ onSelect: u,
172
172
  loadOptions: s,
173
- debounceMs: Re,
173
+ debounceMs: Ce,
174
174
  placeholder: h("patientSearch.who.placeholder"),
175
175
  "aria-label": h("patientSearch.who.label"),
176
- startAdornment: /* @__PURE__ */ t(Ne, { "aria-hidden": "true" })
176
+ startAdornment: /* @__PURE__ */ t(ke, { "aria-hidden": "true" })
177
177
  }
178
178
  )
179
179
  }
180
180
  );
181
181
  }
182
- const we = [
182
+ const ye = [
183
183
  "ds:inline-flex ds:items-center ds:justify-center",
184
184
  "ds:size-8 ds:rounded-[var(--radius-sm)]",
185
185
  "ds:text-[color:var(--muted-foreground)] ds:hover:text-[color:var(--primary)]",
@@ -200,89 +200,89 @@ function re({
200
200
  inputRef: i,
201
201
  defaultRadiusKm: v = ue,
202
202
  reverseGeocode: h,
203
- query: d,
203
+ query: c,
204
204
  onQueryChange: s
205
205
  }) {
206
- var M, I, V;
207
- const { t: f } = D("ui"), n = E((M = e.place) == null ? void 0 : M.value), m = e.geo ? "granted" : "pristine", [u, c] = J(m);
206
+ var M, I, O;
207
+ const { t: u } = V("ui"), n = R((M = e.place) == null ? void 0 : M.value), m = e.geo ? "granted" : "pristine", [f, d] = J(m);
208
208
  q(() => {
209
- var w, _, T;
210
- ((w = e.place) == null ? void 0 : w.value) !== n.current && (n.current = (_ = e.place) == null ? void 0 : _.value, s(((T = e.place) == null ? void 0 : T.label) ?? ""));
211
- }, [(I = e.place) == null ? void 0 : I.value, (V = e.place) == null ? void 0 : V.label, s]);
209
+ var w, x, j;
210
+ ((w = e.place) == null ? void 0 : w.value) !== n.current && (n.current = (x = e.place) == null ? void 0 : x.value, s(((j = e.place) == null ? void 0 : j.label) ?? ""));
211
+ }, [(I = e.place) == null ? void 0 : I.value, (O = e.place) == null ? void 0 : O.label, s]);
212
212
  const l = Z(
213
- async (w, { signal: _ }) => await a(w, { signal: _ }),
213
+ async (w, { signal: x }) => await a(w, { signal: x }),
214
214
  [a]
215
215
  ), y = (w) => {
216
- const _ = {
216
+ const x = {
217
217
  value: w.value,
218
218
  label: w.label,
219
219
  lat: w.lat,
220
220
  lng: w.lng
221
221
  };
222
- s(_.label), n.current = _.value, r({ ...e, place: _, geo: void 0 }), u === "granted" && c("pristine"), S("patient_search_place_selected", { value: _.value }), o == null || o(_);
223
- }, g = () => {
222
+ s(x.label), n.current = x.value, r({ ...e, place: x, geo: void 0 }), f === "granted" && d("pristine"), S("patient_search_place_selected", { value: x.value }), o == null || o(x);
223
+ }, g = (w) => {
224
+ d("pristine"), Ve(u("patientSearch.geo.denied")), S("patient_search_geo_denied", { reason: w });
225
+ }, A = () => {
224
226
  if (typeof window > "u" || !(navigator != null && navigator.geolocation)) {
225
- c("denied"), S("patient_search_geo_denied", { reason: "unsupported" });
227
+ g("unsupported");
226
228
  return;
227
229
  }
228
- c("requesting"), S("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
230
+ d("requesting"), S("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
229
231
  async (w) => {
230
- const { latitude: _, longitude: T } = w.coords;
232
+ const { latitude: x, longitude: j } = w.coords;
231
233
  let Q;
232
234
  try {
233
- Q = await (h == null ? void 0 : h(_, T));
235
+ Q = await (h == null ? void 0 : h(x, j));
234
236
  } catch {
235
237
  Q = void 0;
236
238
  }
237
- const N = v, U = Q ?? f("patientSearch.geo.fallbackLabel"), G = {
238
- value: `geo:${_.toFixed(4)},${T.toFixed(4)}`,
239
+ const N = v, U = Q ?? u("patientSearch.geo.fallbackLabel"), G = {
240
+ value: `geo:${x.toFixed(4)},${j.toFixed(4)}`,
239
241
  label: U,
240
- lat: _,
241
- lng: T
242
+ lat: x,
243
+ lng: j
242
244
  };
243
245
  r({
244
246
  ...e,
245
247
  place: G,
246
248
  geo: {
247
- lat: _,
248
- lng: T,
249
+ lat: x,
250
+ lng: j,
249
251
  radiusKm: N,
250
252
  label: U
251
253
  }
252
- }), c("granted"), S("patient_search_geo_granted", { radiusKm: N });
253
- },
254
- () => {
255
- c("denied"), S("patient_search_geo_denied", { reason: "user" });
254
+ }), d("granted"), S("patient_search_geo_granted", { radiusKm: N });
256
255
  },
256
+ () => g("user"),
257
257
  { enableHighAccuracy: !1, maximumAge: 6e4, timeout: 1e4 }
258
258
  );
259
- }, j = () => {
260
- r({ ...e, geo: void 0, place: void 0 }), s(""), n.current = void 0, c("pristine");
261
- }, k = u === "granted" && !!e.geo, C = u === "requesting", R = u === "denied", W = Le("where"), ne = R || !!!h ? null : /* @__PURE__ */ x("span", { className: "ds:absolute ds:end-[var(--spacing-xs)] ds:top-1/2 ds:-translate-y-1/2 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
259
+ }, C = () => {
260
+ r({ ...e, geo: void 0, place: void 0 }), s(""), n.current = void 0, d("pristine");
261
+ }, k = f === "granted" && !!e.geo, L = f === "requesting", W = Ee("where"), ne = !!h ? /* @__PURE__ */ _("span", { className: "ds:absolute ds:end-[var(--spacing-xs)] ds:top-1/2 ds:-translate-y-1/2 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
262
262
  k ? /* @__PURE__ */ t(
263
263
  "button",
264
264
  {
265
265
  type: "button",
266
- "aria-label": f("patientSearch.geo.clear"),
267
- onClick: j,
268
- className: we,
269
- children: /* @__PURE__ */ t(Ce, { "aria-hidden": "true", className: "ds:size-4" })
266
+ "aria-label": u("patientSearch.geo.clear"),
267
+ onClick: C,
268
+ className: ye,
269
+ children: /* @__PURE__ */ t(Ne, { "aria-hidden": "true", className: "ds:size-4" })
270
270
  }
271
271
  ) : null,
272
272
  /* @__PURE__ */ t(
273
273
  "button",
274
274
  {
275
275
  type: "button",
276
- "aria-label": f("patientSearch.geo.cta"),
276
+ "aria-label": u("patientSearch.geo.cta"),
277
277
  "aria-pressed": k || void 0,
278
- disabled: C,
279
- onClick: k ? j : g,
280
- className: we,
278
+ disabled: L,
279
+ onClick: k ? C : A,
280
+ className: ye,
281
281
  children: /* @__PURE__ */ t(qe, { "aria-hidden": "true", className: "ds:size-4" })
282
282
  }
283
283
  )
284
- ] });
285
- return /* @__PURE__ */ x(
284
+ ] }) : null;
285
+ return /* @__PURE__ */ t(
286
286
  "div",
287
287
  {
288
288
  "data-component": "patient-search-field",
@@ -294,53 +294,45 @@ function re({
294
294
  w.currentTarget && !w.currentTarget.contains(w.relatedTarget) && (W.current = !1);
295
295
  },
296
296
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
297
- children: [
298
- /* @__PURE__ */ x("div", { className: "ds:relative", children: [
299
- /* @__PURE__ */ t(
300
- ke,
301
- {
302
- ref: i,
303
- size: "lg",
304
- value: d,
305
- onChange: (w) => {
306
- var _, T;
307
- if (s(w), (p || e.place) && w !== ((_ = e.place) == null ? void 0 : _.label)) {
308
- const Q = w.trim(), N = p && Q ? { value: `text:${Q}`, label: Q } : void 0;
309
- if (n.current = N == null ? void 0 : N.value, (N == null ? void 0 : N.value) === ((T = e.place) == null ? void 0 : T.value) && !e.geo) return;
310
- r({ ...e, place: N, geo: void 0 }), u === "granted" && c("pristine");
297
+ children: /* @__PURE__ */ _("div", { className: "ds:relative", children: [
298
+ /* @__PURE__ */ t(
299
+ Se,
300
+ {
301
+ ref: i,
302
+ size: "lg",
303
+ value: c,
304
+ onChange: (w) => {
305
+ var x, j;
306
+ if (s(w), (p || e.place) && w !== ((x = e.place) == null ? void 0 : x.label)) {
307
+ const Q = w.trim(), N = p && Q ? { value: `text:${Q}`, label: Q } : void 0;
308
+ if (n.current = N == null ? void 0 : N.value, (N == null ? void 0 : N.value) === ((j = e.place) == null ? void 0 : j.value) && !e.geo) return;
309
+ r({ ...e, place: N, geo: void 0 }), f === "granted" && d("pristine");
310
+ }
311
+ },
312
+ onSelect: y,
313
+ loadOptions: l,
314
+ debounceMs: Ce,
315
+ placeholder: u("patientSearch.where.placeholder"),
316
+ "aria-label": u("patientSearch.where.label"),
317
+ startAdornment: /* @__PURE__ */ t(De, { "aria-hidden": "true" }),
318
+ endAdornment: (
319
+ // Decorative spacer — reserves inline-end room so the typed
320
+ // text doesn't run under the absolutely-positioned overlay.
321
+ // Autocomplete wraps endAdornment in `aria-hidden`, which is
322
+ // correct for this empty span. Granted-state shows an extra
323
+ // clear-X chip, so the spacer doubles in width when granted.
324
+ /* @__PURE__ */ t(
325
+ "span",
326
+ {
327
+ "aria-hidden": "true",
328
+ className: k ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
311
329
  }
312
- },
313
- onSelect: y,
314
- loadOptions: l,
315
- debounceMs: Re,
316
- placeholder: f("patientSearch.where.placeholder"),
317
- "aria-label": f("patientSearch.where.label"),
318
- startAdornment: /* @__PURE__ */ t(Be, { "aria-hidden": "true" }),
319
- endAdornment: R ? void 0 : (
320
- // Decorative spacer — reserves inline-end room so the typed
321
- // text doesn't run under the absolutely-positioned overlay.
322
- // Autocomplete wraps endAdornment in `aria-hidden`, which is
323
- // correct for this empty span. Granted-state shows an extra
324
- // clear-X chip, so the spacer doubles in width when granted.
325
- /* @__PURE__ */ t(
326
- "span",
327
- {
328
- "aria-hidden": "true",
329
- className: k ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
330
- }
331
- )
332
330
  )
333
- }
334
- ),
335
- ne
336
- ] }),
337
- R ? (
338
- // Alert defaults to `role="status"` + `aria-live="polite"` for the
339
- // `info` variant — the user hears why the field reverted to plain
340
- // text when their browser blocked the geolocation prompt.
341
- /* @__PURE__ */ t(ye, { variant: "info", children: /* @__PURE__ */ t(ye.Description, { children: f("patientSearch.geo.denied") }) })
342
- ) : null
343
- ]
331
+ )
332
+ }
333
+ ),
334
+ ne
335
+ ] })
344
336
  }
345
337
  );
346
338
  }
@@ -349,21 +341,21 @@ function ae({
349
341
  onChange: r,
350
342
  defaultRadiusKm: a = ue
351
343
  }) {
352
- const { t: o } = D("ui"), [p, i] = J(
344
+ const { t: o } = V("ui"), [p, i] = J(
353
345
  () => {
354
- var d;
355
- return $e(((d = e.geo) == null ? void 0 : d.radiusKm) ?? a);
346
+ var c;
347
+ return $e(((c = e.geo) == null ? void 0 : c.radiusKm) ?? a);
356
348
  }
357
349
  );
358
350
  if (!e.geo) return null;
359
- const v = (d) => {
360
- const s = $[d] ?? a;
351
+ const v = (c) => {
352
+ const s = $[c] ?? a;
361
353
  r({ ...e, geo: { ...e.geo, radiusKm: s } }), S("patient_search_radius_changed", { radiusKm: s });
362
- }, h = (d) => {
363
- const s = $[Math.round(d)] ?? a;
354
+ }, h = (c) => {
355
+ const s = $[Math.round(c)] ?? a;
364
356
  return o("patientSearch.geo.radiusFormat", { km: s });
365
357
  };
366
- return /* @__PURE__ */ x(
358
+ return /* @__PURE__ */ _(
367
359
  "div",
368
360
  {
369
361
  "data-component": "patient-search-geo-radius-bar",
@@ -378,21 +370,21 @@ function ae({
378
370
  }
379
371
  ),
380
372
  /* @__PURE__ */ t(
381
- De,
373
+ Ie,
382
374
  {
383
375
  value: [p],
384
376
  min: 0,
385
377
  max: $.length - 1,
386
378
  step: 1,
387
- marks: $.map((d, s) => ({
379
+ marks: $.map((c, s) => ({
388
380
  value: s,
389
- label: `${d}`
381
+ label: `${c}`
390
382
  })),
391
383
  formatValue: h,
392
384
  alwaysShowValue: !0,
393
385
  "aria-labelledby": "patient-search-radius-label",
394
- onValueChange: (d) => i(d[0] ?? 0),
395
- onValueCommit: (d) => v(d[0] ?? 0)
386
+ onValueChange: (c) => i(c[0] ?? 0),
387
+ onValueCommit: (c) => v(c[0] ?? 0)
396
388
  }
397
389
  )
398
390
  ]
@@ -423,24 +415,24 @@ const Ge = H(
423
415
  }
424
416
  );
425
417
  function Xe({ value: e, onChange: r }) {
426
- const { t: a, i18n: o } = D("ui"), p = Se(), i = o.dir() === "rtl", v = E(/* @__PURE__ */ new Map()), h = Z((n) => {
418
+ const { t: a, i18n: o } = V("ui"), p = _e(), i = o.dir() === "rtl", v = R(/* @__PURE__ */ new Map()), h = Z((n) => {
427
419
  var m;
428
420
  (m = v.current.get(n)) == null || m.focus();
429
- }, []), d = Z(
421
+ }, []), c = Z(
430
422
  (n, m) => {
431
- const u = K.indexOf(m), c = K.length, l = i ? "ArrowLeft" : "ArrowRight", y = i ? "ArrowRight" : "ArrowLeft";
423
+ const f = K.indexOf(m), d = K.length, l = i ? "ArrowLeft" : "ArrowRight", y = i ? "ArrowRight" : "ArrowLeft";
432
424
  switch (n.key) {
433
425
  case l:
434
426
  case "ArrowDown": {
435
427
  n.preventDefault();
436
- const g = K[(u + 1) % c];
428
+ const g = K[(f + 1) % d];
437
429
  r(g), S("patient_search_when_selected", { when: g }), h(g);
438
430
  break;
439
431
  }
440
432
  case y:
441
433
  case "ArrowUp": {
442
434
  n.preventDefault();
443
- const g = K[(u - 1 + c) % c];
435
+ const g = K[(f - 1 + d) % d];
444
436
  r(g), S("patient_search_when_selected", { when: g }), h(g);
445
437
  break;
446
438
  }
@@ -452,14 +444,14 @@ function Xe({ value: e, onChange: r }) {
452
444
  }
453
445
  case "End": {
454
446
  n.preventDefault();
455
- const g = K[c - 1];
447
+ const g = K[d - 1];
456
448
  r(g), S("patient_search_when_selected", { when: g }), h(g);
457
449
  break;
458
450
  }
459
451
  }
460
452
  },
461
453
  [h, i, r]
462
- ), s = e ?? "anytime", f = {
454
+ ), s = e ?? "anytime", u = {
463
455
  today: "patientSearch.when.today",
464
456
  tomorrow: "patientSearch.when.tomorrow",
465
457
  this_week: "patientSearch.when.thisWeek",
@@ -473,26 +465,26 @@ function Xe({ value: e, onChange: r }) {
473
465
  id: p,
474
466
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
475
467
  children: K.map((n) => {
476
- const m = e === n, u = s === n, c = a(f[n]);
468
+ const m = e === n, f = s === n, d = a(u[n]);
477
469
  return /* @__PURE__ */ t(
478
470
  "button",
479
471
  {
480
472
  type: "button",
481
473
  role: "radio",
482
474
  "aria-checked": m,
483
- "aria-label": c,
484
- tabIndex: u ? 0 : -1,
475
+ "aria-label": d,
476
+ tabIndex: f ? 0 : -1,
485
477
  ref: (l) => {
486
478
  l ? v.current.set(n, l) : v.current.delete(n);
487
479
  },
488
480
  onClick: () => {
489
481
  r(n), S("patient_search_when_selected", { when: n });
490
482
  },
491
- onKeyDown: (l) => d(l, n),
483
+ onKeyDown: (l) => c(l, n),
492
484
  className: Ge({
493
485
  state: m ? "selected" : "idle"
494
486
  }),
495
- children: c
487
+ children: d
496
488
  },
497
489
  n
498
490
  );
@@ -500,7 +492,7 @@ function Xe({ value: e, onChange: r }) {
500
492
  }
501
493
  );
502
494
  }
503
- const xe = H(
495
+ const we = H(
504
496
  [
505
497
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
506
498
  "ds:min-h-[var(--min-target-size)]",
@@ -531,22 +523,22 @@ const xe = H(
531
523
  }
532
524
  );
533
525
  function Ye({ facets: e, value: r, onChange: a }) {
534
- const { t: o } = D("ui"), p = le(() => r ?? {}, [r]), i = le(
526
+ const { t: o } = V("ui"), p = le(() => r ?? {}, [r]), i = le(
535
527
  () => Object.values(p).some((s) => s && s.length > 0),
536
528
  [p]
537
- ), v = (s, f) => {
529
+ ), v = (s, u) => {
538
530
  const n = { ...p };
539
- f.length === 0 ? delete n[s] : n[s] = f, a(n), S("patient_search_facet_changed", { key: s, values: f });
531
+ u.length === 0 ? delete n[s] : n[s] = u, a(n), S("patient_search_facet_changed", { key: s, values: u });
540
532
  }, h = (s) => {
541
533
  var n;
542
- const f = (((n = p[s]) == null ? void 0 : n.length) ?? 0) > 0;
543
- v(s, f ? [] : ["true"]);
544
- }, d = (s, f) => {
545
- const n = p[s.key] ?? [], m = n.includes(f);
546
- let u;
547
- s.multi ? u = m ? n.filter((c) => c !== f) : [...n, f] : u = m ? [] : [f], v(s.key, u);
534
+ const u = (((n = p[s]) == null ? void 0 : n.length) ?? 0) > 0;
535
+ v(s, u ? [] : ["true"]);
536
+ }, c = (s, u) => {
537
+ const n = p[s.key] ?? [], m = n.includes(u);
538
+ let f;
539
+ s.multi ? f = m ? n.filter((d) => d !== u) : [...n, u] : f = m ? [] : [u], v(s.key, f);
548
540
  };
549
- return /* @__PURE__ */ x(
541
+ return /* @__PURE__ */ _(
550
542
  "div",
551
543
  {
552
544
  role: "group",
@@ -554,8 +546,8 @@ function Ye({ facets: e, value: r, onChange: a }) {
554
546
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
555
547
  children: [
556
548
  e.map((s) => {
557
- const f = s.options.length === 0, n = p[s.key] ?? [], m = n.length > 0;
558
- if (f)
549
+ const u = s.options.length === 0, n = p[s.key] ?? [], m = n.length > 0;
550
+ if (u)
559
551
  return /* @__PURE__ */ t(
560
552
  "button",
561
553
  {
@@ -563,27 +555,27 @@ function Ye({ facets: e, value: r, onChange: a }) {
563
555
  "aria-pressed": m,
564
556
  "aria-label": s.label,
565
557
  onClick: () => h(s.key),
566
- className: xe({
558
+ className: we({
567
559
  state: m ? "active" : "idle"
568
560
  }),
569
561
  children: /* @__PURE__ */ t("span", { children: s.label })
570
562
  },
571
563
  s.key
572
564
  );
573
- const u = m ? ` (${n.length})` : "";
574
- return /* @__PURE__ */ x(Y.Root, { children: [
575
- /* @__PURE__ */ t(Y.Trigger, { asChild: !0, children: /* @__PURE__ */ x(
565
+ const f = m ? ` (${n.length})` : "";
566
+ return /* @__PURE__ */ _(Y.Root, { children: [
567
+ /* @__PURE__ */ t(Y.Trigger, { asChild: !0, children: /* @__PURE__ */ _(
576
568
  "button",
577
569
  {
578
570
  type: "button",
579
- "aria-label": `${s.label}${u}`,
580
- className: xe({
571
+ "aria-label": `${s.label}${f}`,
572
+ className: we({
581
573
  state: m ? "active" : "idle"
582
574
  }),
583
575
  children: [
584
- /* @__PURE__ */ x("span", { children: [
576
+ /* @__PURE__ */ _("span", { children: [
585
577
  s.label,
586
- u
578
+ f
587
579
  ] }),
588
580
  /* @__PURE__ */ t(
589
581
  ze,
@@ -595,20 +587,20 @@ function Ye({ facets: e, value: r, onChange: a }) {
595
587
  ]
596
588
  }
597
589
  ) }),
598
- /* @__PURE__ */ t(Y.Content, { sideOffset: 8, align: "start", children: s.options.map((c) => /* @__PURE__ */ t(
590
+ /* @__PURE__ */ t(Y.Content, { sideOffset: 8, align: "start", children: s.options.map((d) => /* @__PURE__ */ t(
599
591
  Y.CheckboxItem,
600
592
  {
601
- checked: n.includes(c.value),
593
+ checked: n.includes(d.value),
602
594
  onSelect: (l) => {
603
- s.multi && l.preventDefault(), d(s, c.value);
595
+ s.multi && l.preventDefault(), c(s, d.value);
604
596
  },
605
- children: c.label
597
+ children: d.label
606
598
  },
607
- c.value
599
+ d.value
608
600
  )) })
609
601
  ] }, s.key);
610
602
  }),
611
- i ? /* @__PURE__ */ x(
603
+ i ? /* @__PURE__ */ _(
612
604
  "button",
613
605
  {
614
606
  type: "button",
@@ -625,7 +617,7 @@ function Ye({ facets: e, value: r, onChange: a }) {
625
617
  "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
626
618
  ].join(" "),
627
619
  children: [
628
- /* @__PURE__ */ t(Ce, { "aria-hidden": "true", className: "ds:size-3.5" }),
620
+ /* @__PURE__ */ t(Ne, { "aria-hidden": "true", className: "ds:size-3.5" }),
629
621
  o("patientSearch.facets.clear")
630
622
  ]
631
623
  }
@@ -634,7 +626,7 @@ function Ye({ facets: e, value: r, onChange: a }) {
634
626
  }
635
627
  );
636
628
  }
637
- const _e = ["violet", "purple", "magenta", "blue"], Je = H(
629
+ const xe = ["violet", "purple", "magenta", "blue"], Je = H(
638
630
  [
639
631
  "ds:relative ds:flex ds:h-full ds:flex-col ds:gap-[var(--spacing-sm)]",
640
632
  "ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
@@ -680,11 +672,11 @@ const _e = ["violet", "purple", "magenta", "blue"], Je = H(
680
672
  }
681
673
  );
682
674
  function tt(e, r) {
683
- return e && e !== "auto" ? e : _e[r % _e.length];
675
+ return e && e !== "auto" ? e : xe[r % xe.length];
684
676
  }
685
677
  function rt({ cards: e, headingLevel: r }) {
686
- const { t: a } = D("ui"), o = `h${r}`, p = Se();
687
- return e.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: a("patientSearch.discovery.empty") }) : /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
678
+ const { t: a } = V("ui"), o = `h${r}`, p = _e();
679
+ return e.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: a("patientSearch.discovery.empty") }) : /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
688
680
  /* @__PURE__ */ t(o, { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: a("patientSearch.discovery.heading") }),
689
681
  /* @__PURE__ */ t(
690
682
  "ul",
@@ -695,15 +687,15 @@ function rt({ cards: e, headingLevel: r }) {
695
687
  "ds:m-0 ds:p-0 ds:list-none"
696
688
  ].join(" "),
697
689
  children: e.map((i, v) => {
698
- const h = tt(i.accent, v), d = i.description ? `${p}-${i.id}-description` : void 0;
699
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ x(
690
+ const h = tt(i.accent, v), c = i.description ? `${p}-${i.id}-description` : void 0;
691
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ _(
700
692
  "a",
701
693
  {
702
694
  href: i.href,
703
695
  "data-component": "patient-search-card",
704
696
  "data-card-id": i.id,
705
697
  "aria-label": i.label,
706
- "aria-describedby": d,
698
+ "aria-describedby": c,
707
699
  onClick: () => S("patient_search_discovery_card_clicked", {
708
700
  cardId: i.id
709
701
  }),
@@ -716,7 +708,7 @@ function rt({ cards: e, headingLevel: r }) {
716
708
  className: Ze({ accent: h })
717
709
  }
718
710
  ),
719
- /* @__PURE__ */ x("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
711
+ /* @__PURE__ */ _("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
720
712
  /* @__PURE__ */ t(
721
713
  "span",
722
714
  {
@@ -740,7 +732,7 @@ function rt({ cards: e, headingLevel: r }) {
740
732
  i.description ? /* @__PURE__ */ t(
741
733
  "span",
742
734
  {
743
- id: d,
735
+ id: c,
744
736
  className: "type-body-sm ds:text-[color:var(--muted-foreground)]",
745
737
  children: i.description
746
738
  }
@@ -769,14 +761,14 @@ function se({
769
761
  allowEmptySubmit: p,
770
762
  onSubmit: i
771
763
  }) {
772
- const { t: v } = D("ui"), h = !a && !p && !at(e), d = o ?? v("patientSearch.submit.cta");
764
+ const { t: v } = V("ui"), h = !a && !p && !at(e), c = o ?? v("patientSearch.submit.cta");
773
765
  return /* @__PURE__ */ t(
774
- Ie,
766
+ Fe,
775
767
  {
776
768
  type: "button",
777
769
  intent: "primary",
778
770
  size: "lg",
779
- startIcon: /* @__PURE__ */ t(Ne, { "aria-hidden": "true" }),
771
+ startIcon: /* @__PURE__ */ t(ke, { "aria-hidden": "true" }),
780
772
  loading: a,
781
773
  disabled: h,
782
774
  onClick: () => {
@@ -789,7 +781,7 @@ function se({
789
781
  facetKeys: e.facets ? Object.keys(e.facets) : []
790
782
  }), i(e);
791
783
  },
792
- children: d
784
+ children: c
793
785
  }
794
786
  );
795
787
  }
@@ -802,23 +794,23 @@ function st(e) {
802
794
  loadObjects: i,
803
795
  loadPlaces: v,
804
796
  onObjectSelect: h,
805
- onPlaceSelect: d,
797
+ onPlaceSelect: c,
806
798
  allowTypedPlace: s,
807
- submitting: f,
799
+ submitting: u,
808
800
  submitLabel: n,
809
801
  allowEmptySubmit: m,
810
- whoRef: u,
811
- whereRef: c,
802
+ whoRef: f,
803
+ whereRef: d,
812
804
  whoQuery: l,
813
805
  onWhoQueryChange: y,
814
806
  whereQuery: g,
815
- onWhereQueryChange: j,
816
- defaultRadiusKm: k,
817
- reverseGeocode: C,
818
- cardLabel: R
807
+ onWhereQueryChange: A,
808
+ defaultRadiusKm: C,
809
+ reverseGeocode: k,
810
+ cardLabel: L
819
811
  } = e;
820
- return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": R, children: /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
821
- /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
812
+ return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": L, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
813
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
822
814
  /* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ t(
823
815
  te,
824
816
  {
@@ -826,7 +818,7 @@ function st(e) {
826
818
  onChange: o,
827
819
  loadObjects: i,
828
820
  onObjectSelect: h,
829
- inputRef: u,
821
+ inputRef: f,
830
822
  query: l,
831
823
  onQueryChange: y
832
824
  }
@@ -837,13 +829,13 @@ function st(e) {
837
829
  value: a,
838
830
  onChange: o,
839
831
  loadPlaces: v,
840
- onPlaceSelect: d,
832
+ onPlaceSelect: c,
841
833
  allowTypedPlace: s,
842
- defaultRadiusKm: k,
843
- reverseGeocode: C,
844
- inputRef: c,
834
+ defaultRadiusKm: C,
835
+ reverseGeocode: k,
836
+ inputRef: d,
845
837
  query: g,
846
- onQueryChange: j
838
+ onQueryChange: A
847
839
  }
848
840
  ) }),
849
841
  /* @__PURE__ */ t(
@@ -851,7 +843,7 @@ function st(e) {
851
843
  {
852
844
  value: a,
853
845
  variant: r,
854
- submitting: f,
846
+ submitting: u,
855
847
  submitLabel: n,
856
848
  allowEmptySubmit: m,
857
849
  onSubmit: p
@@ -863,7 +855,7 @@ function st(e) {
863
855
  {
864
856
  value: a,
865
857
  onChange: o,
866
- defaultRadiusKm: k
858
+ defaultRadiusKm: C
867
859
  }
868
860
  )
869
861
  ] }) });
@@ -877,23 +869,23 @@ function nt(e) {
877
869
  loadObjects: i,
878
870
  loadPlaces: v,
879
871
  onObjectSelect: h,
880
- onPlaceSelect: d,
872
+ onPlaceSelect: c,
881
873
  allowTypedPlace: s,
882
- submitting: f,
874
+ submitting: u,
883
875
  submitLabel: n,
884
876
  allowEmptySubmit: m,
885
- whoRef: u,
886
- whereRef: c,
877
+ whoRef: f,
878
+ whereRef: d,
887
879
  whoQuery: l,
888
880
  onWhoQueryChange: y,
889
881
  whereQuery: g,
890
- onWhereQueryChange: j,
891
- defaultRadiusKm: k,
892
- reverseGeocode: C,
893
- cardLabel: R
882
+ onWhereQueryChange: A,
883
+ defaultRadiusKm: C,
884
+ reverseGeocode: k,
885
+ cardLabel: L
894
886
  } = e;
895
- return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": R, children: /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
896
- /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
887
+ return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": L, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
888
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
897
889
  /* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ t(
898
890
  te,
899
891
  {
@@ -901,7 +893,7 @@ function nt(e) {
901
893
  onChange: o,
902
894
  loadObjects: i,
903
895
  onObjectSelect: h,
904
- inputRef: u,
896
+ inputRef: f,
905
897
  query: l,
906
898
  onQueryChange: y
907
899
  }
@@ -912,13 +904,13 @@ function nt(e) {
912
904
  value: a,
913
905
  onChange: o,
914
906
  loadPlaces: v,
915
- onPlaceSelect: d,
907
+ onPlaceSelect: c,
916
908
  allowTypedPlace: s,
917
- defaultRadiusKm: k,
918
- reverseGeocode: C,
919
- inputRef: c,
909
+ defaultRadiusKm: C,
910
+ reverseGeocode: k,
911
+ inputRef: d,
920
912
  query: g,
921
- onQueryChange: j
913
+ onQueryChange: A
922
914
  }
923
915
  ) }),
924
916
  /* @__PURE__ */ t(
@@ -926,7 +918,7 @@ function nt(e) {
926
918
  {
927
919
  value: a,
928
920
  variant: r,
929
- submitting: f,
921
+ submitting: u,
930
922
  submitLabel: n,
931
923
  allowEmptySubmit: m,
932
924
  onSubmit: p
@@ -938,7 +930,7 @@ function nt(e) {
938
930
  {
939
931
  value: a,
940
932
  onChange: o,
941
- defaultRadiusKm: k
933
+ defaultRadiusKm: C
942
934
  }
943
935
  ),
944
936
  /* @__PURE__ */ t(
@@ -959,24 +951,24 @@ function ot(e) {
959
951
  loadObjects: i,
960
952
  loadPlaces: v,
961
953
  onObjectSelect: h,
962
- onPlaceSelect: d,
954
+ onPlaceSelect: c,
963
955
  allowTypedPlace: s,
964
- facets: f,
956
+ facets: u,
965
957
  submitting: n,
966
958
  submitLabel: m,
967
- allowEmptySubmit: u,
968
- whoRef: c,
959
+ allowEmptySubmit: f,
960
+ whoRef: d,
969
961
  whereRef: l,
970
962
  whoQuery: y,
971
963
  onWhoQueryChange: g,
972
- whereQuery: j,
973
- onWhereQueryChange: k,
974
- defaultRadiusKm: C,
975
- reverseGeocode: R,
964
+ whereQuery: A,
965
+ onWhereQueryChange: C,
966
+ defaultRadiusKm: k,
967
+ reverseGeocode: L,
976
968
  cardLabel: W
977
969
  } = e;
978
- return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": W, children: /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
979
- /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
970
+ return /* @__PURE__ */ t(ee, { variant: "elevated", "aria-label": W, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
971
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
980
972
  /* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ t(
981
973
  te,
982
974
  {
@@ -984,7 +976,7 @@ function ot(e) {
984
976
  onChange: o,
985
977
  loadObjects: i,
986
978
  onObjectSelect: h,
987
- inputRef: c,
979
+ inputRef: d,
988
980
  query: y,
989
981
  onQueryChange: g
990
982
  }
@@ -995,13 +987,13 @@ function ot(e) {
995
987
  value: a,
996
988
  onChange: o,
997
989
  loadPlaces: v,
998
- onPlaceSelect: d,
990
+ onPlaceSelect: c,
999
991
  allowTypedPlace: s,
1000
- defaultRadiusKm: C,
1001
- reverseGeocode: R,
992
+ defaultRadiusKm: k,
993
+ reverseGeocode: L,
1002
994
  inputRef: l,
1003
- query: j,
1004
- onQueryChange: k
995
+ query: A,
996
+ onQueryChange: C
1005
997
  }
1006
998
  ) }),
1007
999
  /* @__PURE__ */ t(
@@ -1011,7 +1003,7 @@ function ot(e) {
1011
1003
  variant: r,
1012
1004
  submitting: n,
1013
1005
  submitLabel: m,
1014
- allowEmptySubmit: u,
1006
+ allowEmptySubmit: f,
1015
1007
  onSubmit: p
1016
1008
  }
1017
1009
  )
@@ -1021,13 +1013,13 @@ function ot(e) {
1021
1013
  {
1022
1014
  value: a,
1023
1015
  onChange: o,
1024
- defaultRadiusKm: C
1016
+ defaultRadiusKm: k
1025
1017
  }
1026
1018
  ),
1027
- f && f.length > 0 ? /* @__PURE__ */ t(
1019
+ u && u.length > 0 ? /* @__PURE__ */ t(
1028
1020
  Ye,
1029
1021
  {
1030
- facets: f,
1022
+ facets: u,
1031
1023
  value: a.facets,
1032
1024
  onChange: (z) => o({ ...a, facets: z })
1033
1025
  }
@@ -1043,26 +1035,26 @@ function it(e) {
1043
1035
  loadObjects: i,
1044
1036
  loadPlaces: v,
1045
1037
  onObjectSelect: h,
1046
- onPlaceSelect: d,
1038
+ onPlaceSelect: c,
1047
1039
  allowTypedPlace: s,
1048
- discoveryCards: f,
1040
+ discoveryCards: u,
1049
1041
  discoveryHeadingLevel: n,
1050
1042
  submitting: m,
1051
- submitLabel: u,
1052
- allowEmptySubmit: c,
1043
+ submitLabel: f,
1044
+ allowEmptySubmit: d,
1053
1045
  whoRef: l,
1054
1046
  whereRef: y,
1055
1047
  whoQuery: g,
1056
- onWhoQueryChange: j,
1057
- whereQuery: k,
1058
- onWhereQueryChange: C,
1059
- defaultRadiusKm: R,
1048
+ onWhoQueryChange: A,
1049
+ whereQuery: C,
1050
+ onWhereQueryChange: k,
1051
+ defaultRadiusKm: L,
1060
1052
  reverseGeocode: W,
1061
1053
  cardLabel: z
1062
1054
  } = e;
1063
- return /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
1064
- /* @__PURE__ */ x(ee, { variant: "elevated", "aria-label": z, children: [
1065
- /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:md:flex-row ds:md:items-stretch", children: [
1055
+ return /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
1056
+ /* @__PURE__ */ _(ee, { variant: "elevated", "aria-label": z, children: [
1057
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:md:flex-row ds:md:items-stretch", children: [
1066
1058
  /* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ t(
1067
1059
  te,
1068
1060
  {
@@ -1072,7 +1064,7 @@ function it(e) {
1072
1064
  onObjectSelect: h,
1073
1065
  inputRef: l,
1074
1066
  query: g,
1075
- onQueryChange: j
1067
+ onQueryChange: A
1076
1068
  }
1077
1069
  ) }),
1078
1070
  /* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ t(
@@ -1081,13 +1073,13 @@ function it(e) {
1081
1073
  value: a,
1082
1074
  onChange: o,
1083
1075
  loadPlaces: v,
1084
- onPlaceSelect: d,
1076
+ onPlaceSelect: c,
1085
1077
  allowTypedPlace: s,
1086
- defaultRadiusKm: R,
1078
+ defaultRadiusKm: L,
1087
1079
  reverseGeocode: W,
1088
1080
  inputRef: y,
1089
- query: k,
1090
- onQueryChange: C
1081
+ query: C,
1082
+ onQueryChange: k
1091
1083
  }
1092
1084
  ) }),
1093
1085
  /* @__PURE__ */ t(
@@ -1096,8 +1088,8 @@ function it(e) {
1096
1088
  value: a,
1097
1089
  variant: r,
1098
1090
  submitting: m,
1099
- submitLabel: u,
1100
- allowEmptySubmit: c,
1091
+ submitLabel: f,
1092
+ allowEmptySubmit: d,
1101
1093
  onSubmit: p
1102
1094
  }
1103
1095
  )
@@ -1107,20 +1099,20 @@ function it(e) {
1107
1099
  {
1108
1100
  value: a,
1109
1101
  onChange: o,
1110
- defaultRadiusKm: R
1102
+ defaultRadiusKm: L
1111
1103
  }
1112
1104
  )
1113
1105
  ] }),
1114
1106
  /* @__PURE__ */ t(
1115
1107
  rt,
1116
1108
  {
1117
- cards: f,
1109
+ cards: u,
1118
1110
  headingLevel: n
1119
1111
  }
1120
1112
  )
1121
1113
  ] });
1122
1114
  }
1123
- const ct = Ae(function({
1115
+ const ct = Te(function({
1124
1116
  variant: r,
1125
1117
  loadObjects: a,
1126
1118
  loadPlaces: o,
@@ -1128,101 +1120,101 @@ const ct = Ae(function({
1128
1120
  onPlaceSelect: i,
1129
1121
  allowTypedPlace: v = !1,
1130
1122
  facets: h,
1131
- defaultRadiusKm: d = ue,
1123
+ defaultRadiusKm: c = ue,
1132
1124
  reverseGeocode: s,
1133
- discoveryCards: f,
1125
+ discoveryCards: u,
1134
1126
  discoveryHeadingLevel: n = 3,
1135
1127
  countryCode: m,
1136
- value: u,
1137
- onChange: c,
1128
+ value: f,
1129
+ onChange: d,
1138
1130
  onSubmit: l,
1139
1131
  submitting: y,
1140
1132
  submitLabel: g,
1141
- allowEmptySubmit: j,
1142
- "aria-label": k,
1143
- id: C,
1144
- className: R,
1133
+ allowEmptySubmit: A,
1134
+ "aria-label": C,
1135
+ id: k,
1136
+ className: L,
1145
1137
  ...W
1146
1138
  }, z) {
1147
1139
  var ge, ve;
1148
- const { t: ne } = D("ui"), M = E(null), I = E(null), V = E(null), [w, _] = J(((ge = u.object) == null ? void 0 : ge.label) ?? ""), [T, Q] = J(
1149
- ((ve = u.place) == null ? void 0 : ve.label) ?? ""
1150
- ), N = E(null), U = E(
1140
+ const { t: ne } = V("ui"), M = R(null), I = R(null), O = R(null), [w, x] = J(((ge = f.object) == null ? void 0 : ge.label) ?? ""), [j, Q] = J(
1141
+ ((ve = f.place) == null ? void 0 : ve.label) ?? ""
1142
+ ), N = R(null), U = R(
1151
1143
  { who: { current: !1 }, where: { current: !1 } }
1152
1144
  ), G = (b) => {
1153
- const L = b === I.current ? "who" : b === V.current ? "where" : null;
1154
- if (!L) {
1145
+ const E = b === I.current ? "who" : b === O.current ? "where" : null;
1146
+ if (!E) {
1155
1147
  N.current = null;
1156
1148
  return;
1157
1149
  }
1158
1150
  const P = b;
1159
1151
  N.current = {
1160
- field: L,
1152
+ field: E,
1161
1153
  start: P.selectionStart,
1162
1154
  end: P.selectionEnd
1163
1155
  };
1164
- }, je = (b, L) => {
1156
+ }, Le = (b, E) => {
1165
1157
  var P;
1166
- L && ((P = M.current) != null && P.contains(L)) || setTimeout(() => {
1158
+ E && ((P = M.current) != null && P.contains(E)) || setTimeout(() => {
1167
1159
  b.isConnected && (N.current = null);
1168
1160
  }, 0);
1169
- }, oe = E(null), fe = (b, L, P) => {
1170
- const F = (b === "who" ? I : V).current;
1161
+ }, oe = R(null), fe = (b, E, P) => {
1162
+ const F = (b === "who" ? I : O).current;
1171
1163
  if (!F) return;
1172
1164
  F.focus();
1173
- const O = F.value.length;
1165
+ const B = F.value.length;
1174
1166
  F.setSelectionRange(
1175
- Math.min(L ?? O, O),
1176
- Math.min(P ?? O, O)
1167
+ Math.min(E ?? B, B),
1168
+ Math.min(P ?? B, B)
1177
1169
  );
1178
1170
  };
1179
1171
  q(() => {
1180
1172
  const b = M.current;
1181
1173
  if (!b) return;
1182
- const L = (A) => {
1183
- const B = oe.current;
1184
- if (B && performance.now() < B.until && (A.target === I.current && B.field === "where" || A.target === V.current && B.field === "who")) {
1185
- fe(B.field, B.start, B.end);
1174
+ const E = (T) => {
1175
+ const D = oe.current;
1176
+ if (D && performance.now() < D.until && (T.target === I.current && D.field === "where" || T.target === O.current && D.field === "who")) {
1177
+ fe(D.field, D.start, D.end);
1186
1178
  return;
1187
1179
  }
1188
- G(A.target);
1189
- }, P = (A) => G(A.target), F = () => {
1180
+ G(T.target);
1181
+ }, P = (T) => G(T.target), F = () => {
1190
1182
  oe.current = null;
1191
- }, O = (A) => je(A.target, A.relatedTarget), be = ["select", "keyup", "input"];
1192
- return b.addEventListener("focusin", L), be.forEach((A) => b.addEventListener(A, P)), b.addEventListener("pointerdown", F), b.addEventListener("keydown", F), b.addEventListener("focusout", O), () => {
1193
- b.removeEventListener("focusin", L), be.forEach((A) => b.removeEventListener(A, P)), b.removeEventListener("pointerdown", F), b.removeEventListener("keydown", F), b.removeEventListener("focusout", O);
1183
+ }, B = (T) => Le(T.target, T.relatedTarget), be = ["select", "keyup", "input"];
1184
+ return b.addEventListener("focusin", E), be.forEach((T) => b.addEventListener(T, P)), b.addEventListener("pointerdown", F), b.addEventListener("keydown", F), b.addEventListener("focusout", B), () => {
1185
+ b.removeEventListener("focusin", E), be.forEach((T) => b.removeEventListener(T, P)), b.removeEventListener("pointerdown", F), b.removeEventListener("keydown", F), b.removeEventListener("focusout", B);
1194
1186
  };
1195
1187
  }, []);
1196
- const he = E(r);
1197
- We(() => {
1188
+ const he = R(r);
1189
+ Ae(() => {
1198
1190
  if (he.current === r) return;
1199
1191
  he.current = r;
1200
1192
  const b = N.current;
1201
1193
  if (!b) return;
1202
- const L = document.activeElement;
1203
- L && L !== document.body || (oe.current = { ...b, until: performance.now() + 500 }, fe(b.field, b.start, b.end));
1194
+ const E = document.activeElement;
1195
+ E && E !== document.body || (oe.current = { ...b, until: performance.now() + 500 }, fe(b.field, b.start, b.end));
1204
1196
  }, [r]);
1205
- const ie = E(!1);
1197
+ const ie = R(!1);
1206
1198
  q(() => {
1207
1199
  if (!ie.current && r === "who-where-when") {
1208
- if (u.when !== void 0) {
1200
+ if (f.when !== void 0) {
1209
1201
  ie.current = !0;
1210
1202
  return;
1211
1203
  }
1212
- ie.current = !0, c({ ...u, when: "anytime" });
1204
+ ie.current = !0, d({ ...f, when: "anytime" });
1213
1205
  }
1214
1206
  }, [r]);
1215
- const ce = E(!1);
1207
+ const ce = R(!1);
1216
1208
  q(() => {
1217
1209
  if (!ce.current && r === "faceted") {
1218
- if (u.facets !== void 0) {
1210
+ if (f.facets !== void 0) {
1219
1211
  ce.current = !0;
1220
1212
  return;
1221
1213
  }
1222
- ce.current = !0, c({ ...u, facets: {} });
1214
+ ce.current = !0, d({ ...f, facets: {} });
1223
1215
  }
1224
1216
  }, [r]);
1225
- const pe = E(null);
1217
+ const pe = R(null);
1226
1218
  q(() => {
1227
1219
  pe.current !== r && (pe.current = r, S("patient_search_variant_exposed", { variant: r, country: m }));
1228
1220
  }, [r, m]);
@@ -1230,7 +1222,7 @@ const ct = Ae(function({
1230
1222
  () => ({
1231
1223
  getVariant: () => r,
1232
1224
  reset: () => {
1233
- c({});
1225
+ d({});
1234
1226
  },
1235
1227
  focusPrimary: () => {
1236
1228
  requestAnimationFrame(() => {
@@ -1239,13 +1231,13 @@ const ct = Ae(function({
1239
1231
  });
1240
1232
  }
1241
1233
  }),
1242
- [r, c]
1234
+ [r, d]
1243
1235
  );
1244
- Pe(z, () => de, [de]), Ve(He, de, C);
1245
- const me = k ?? ne("patientSearch.regionLabel"), X = {
1236
+ We(z, () => de, [de]), Oe(He, de, k);
1237
+ const me = C ?? ne("patientSearch.regionLabel"), X = {
1246
1238
  variant: r,
1247
- value: u,
1248
- onChange: c,
1239
+ value: f,
1240
+ onChange: d,
1249
1241
  onSubmit: l,
1250
1242
  loadObjects: a,
1251
1243
  loadPlaces: o,
@@ -1253,21 +1245,21 @@ const ct = Ae(function({
1253
1245
  onPlaceSelect: i,
1254
1246
  allowTypedPlace: v,
1255
1247
  facets: h,
1256
- defaultRadiusKm: d,
1248
+ defaultRadiusKm: c,
1257
1249
  reverseGeocode: s,
1258
- discoveryCards: f ?? [],
1250
+ discoveryCards: u ?? [],
1259
1251
  discoveryHeadingLevel: n,
1260
1252
  submitting: y,
1261
1253
  submitLabel: g,
1262
- allowEmptySubmit: j,
1254
+ allowEmptySubmit: A,
1263
1255
  whoRef: I,
1264
- whereRef: V,
1256
+ whereRef: O,
1265
1257
  whoQuery: w,
1266
- onWhoQueryChange: _,
1267
- whereQuery: T,
1258
+ onWhoQueryChange: x,
1259
+ whereQuery: j,
1268
1260
  onWhereQueryChange: Q,
1269
1261
  cardLabel: me
1270
- }, Te = (() => {
1262
+ }, je = (() => {
1271
1263
  switch (r) {
1272
1264
  case "who-where":
1273
1265
  return /* @__PURE__ */ t(st, { ...X });
@@ -1282,19 +1274,19 @@ const ct = Ae(function({
1282
1274
  return null;
1283
1275
  }
1284
1276
  })();
1285
- return /* @__PURE__ */ t(Ee.Provider, { value: U.current, children: /* @__PURE__ */ t(
1277
+ return /* @__PURE__ */ t(Re.Provider, { value: U.current, children: /* @__PURE__ */ t(
1286
1278
  "div",
1287
1279
  {
1288
1280
  ref: M,
1289
1281
  role: "region",
1290
1282
  "aria-label": me,
1291
- id: C,
1283
+ id: k,
1292
1284
  "data-component": "patient-search",
1293
- "data-component-id": C,
1285
+ "data-component-id": k,
1294
1286
  "data-variant": r,
1295
- className: Ue({ variant: r, className: R }),
1287
+ className: Ue({ variant: r, className: L }),
1296
1288
  ...W,
1297
- children: Te
1289
+ children: je
1298
1290
  }
1299
1291
  ) });
1300
1292
  });
@@ -1303,4 +1295,4 @@ export {
1303
1295
  ct as P,
1304
1296
  He as p
1305
1297
  };
1306
- //# sourceMappingURL=patient-search-DJy0IZSx.js.map
1298
+ //# sourceMappingURL=patient-search-DaZ9NzrL.js.map