@alfadocs/ui-kit-debug 1.77.1 → 1.78.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.
@@ -1,34 +1,34 @@
1
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { forwardRef as de, useRef as N, useEffect as V, useMemo as X, useImperativeHandle as ce, useState as W, useCallback as z, useId as le } from "react";
3
- import { c as T } from "./index-D2ZczOXr.js";
4
- import { useTranslation as j } from "react-i18next";
5
- import { A as se } from "./autocomplete-DosDnGie.js";
6
- import { B as ue } from "./button-DohK_Ak_.js";
7
- import { C as M } from "./card-BA4Ig_kn.js";
8
- import { S as fe } from "./slider-pZ95bEm7.js";
9
- import { A as Z } from "./alert-9kEwDza3.js";
10
- import { D as F } from "./dropdown-menu-D1we7oAY.js";
11
- import { u as pe } from "./registry-DvAUVLHh.js";
12
- import { S as re } from "./search-QbWPlY5f.js";
13
- import { X as ne } from "./x-B5YnXwCz.js";
14
- import { c as me } from "./createLucideIcon-DhHxpK9K.js";
15
- import { M as he } from "./map-pin-BaY37-Km.js";
16
- import { S as ve } from "./stethoscope-sZXGC43m.js";
17
- import { C as ge } from "./chevron-down-DWE7GSq9.js";
1
+ import { jsx as a, jsxs as w } from "react/jsx-runtime";
2
+ import { forwardRef as ce, useRef as j, useEffect as K, useMemo as Y, useImperativeHandle as le, useState as z, useCallback as M, useId as ue } from "react";
3
+ import { c as L } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as C } from "react-i18next";
5
+ import { A as re } from "./autocomplete-DosDnGie.js";
6
+ import { B as fe } from "./button-DohK_Ak_.js";
7
+ import { C as H } from "./card-BA4Ig_kn.js";
8
+ import { S as pe } from "./slider-pZ95bEm7.js";
9
+ import { A as ee } from "./alert-9kEwDza3.js";
10
+ import { D as W } from "./dropdown-menu-D1we7oAY.js";
11
+ import { u as me } from "./registry-DvAUVLHh.js";
12
+ import { S as ne } from "./search-QbWPlY5f.js";
13
+ import { X as ie } from "./x-B5YnXwCz.js";
14
+ import { c as he } from "./createLucideIcon-DhHxpK9K.js";
15
+ import { M as ve } from "./map-pin-BaY37-Km.js";
16
+ import { S as ge } from "./stethoscope-sZXGC43m.js";
17
+ import { C as be } from "./chevron-down-DWE7GSq9.js";
18
18
  /**
19
19
  * @license lucide-react v1.22.0 - ISC
20
20
  *
21
21
  * This source code is licensed under the ISC license.
22
22
  * See the LICENSE file in the root directory of this source tree.
23
23
  */
24
- const be = [
24
+ const ye = [
25
25
  ["line", { x1: "2", x2: "5", y1: "12", y2: "12", key: "bvdh0s" }],
26
26
  ["line", { x1: "19", x2: "22", y1: "12", y2: "12", key: "1tbv5k" }],
27
27
  ["line", { x1: "12", x2: "12", y1: "2", y2: "5", key: "11lu5j" }],
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
- ], xe = me("locate-fixed", be), ye = {
31
+ ], xe = he("locate-fixed", ye), we = {
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
@@ -87,20 +87,20 @@ function _(e, s) {
87
87
  } catch {
88
88
  }
89
89
  }
90
- const A = [
90
+ const T = [
91
91
  "today",
92
92
  "tomorrow",
93
93
  "this_week",
94
94
  "anytime"
95
- ], O = [1, 5, 10, 25, 50], Y = 5, ie = 200;
96
- function we(e) {
95
+ ], B = [1, 5, 10, 25, 50], J = 5, oe = 200;
96
+ function _e(e) {
97
97
  let s = 0, t = Number.POSITIVE_INFINITY;
98
- return O.forEach((i, p) => {
98
+ return B.forEach((i, p) => {
99
99
  const v = Math.abs(i - e);
100
100
  v < t && (t = v, s = p);
101
101
  }), s;
102
102
  }
103
- const _e = T(
103
+ const Se = L(
104
104
  "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
105
105
  {
106
106
  variants: {
@@ -114,65 +114,65 @@ const _e = T(
114
114
  defaultVariants: { variant: "who-where" }
115
115
  }
116
116
  );
117
- function H({
117
+ function $({
118
118
  value: e,
119
119
  onChange: s,
120
120
  loadObjects: t,
121
121
  onObjectSelect: i,
122
122
  inputRef: p
123
123
  }) {
124
- var d, f, m, b;
125
- const { t: v } = j("ui"), [g, u] = W(((d = e.object) == null ? void 0 : d.label) ?? ""), c = N((f = e.object) == null ? void 0 : f.value);
126
- V(() => {
127
- var h, o, S;
128
- ((h = e.object) == null ? void 0 : h.value) !== c.current && (c.current = (o = e.object) == null ? void 0 : o.value, u(((S = e.object) == null ? void 0 : S.label) ?? ""));
129
- }, [(m = e.object) == null ? void 0 : m.value, (b = e.object) == null ? void 0 : b.label]);
130
- const r = z(
131
- async (h, { signal: o }) => await t(h, { signal: o }),
124
+ var l, u, c, g;
125
+ const { t: v } = C("ui"), [b, h] = z(((l = e.object) == null ? void 0 : l.label) ?? ""), d = j((u = e.object) == null ? void 0 : u.value);
126
+ K(() => {
127
+ var m, o, S;
128
+ ((m = e.object) == null ? void 0 : m.value) !== d.current && (d.current = (o = e.object) == null ? void 0 : o.value, h(((S = e.object) == null ? void 0 : S.label) ?? ""));
129
+ }, [(c = e.object) == null ? void 0 : c.value, (g = e.object) == null ? void 0 : g.label]);
130
+ const n = M(
131
+ async (m, { signal: o }) => await t(m, { signal: o }),
132
132
  [t]
133
- ), l = (h) => {
133
+ ), f = (m) => {
134
134
  const o = {
135
- value: h.value,
136
- label: h.label,
137
- description: h.description,
138
- __payload: h.__payload
135
+ value: m.value,
136
+ label: m.label,
137
+ description: m.description,
138
+ __payload: m.__payload
139
139
  };
140
- u(o.label), c.current = o.value, s({ ...e, object: o }), _("patient_search_object_selected", {
140
+ h(o.label), d.current = o.value, s({ ...e, object: o }), _("patient_search_object_selected", {
141
141
  value: o.value,
142
142
  type: o.__payload && typeof o.__payload == "object" ? o.__payload.type : void 0
143
143
  }), i == null || i(o);
144
- }, n = N(!1);
144
+ }, r = j(!1);
145
145
  return /* @__PURE__ */ a(
146
146
  "div",
147
147
  {
148
148
  "data-component": "patient-search-field",
149
149
  "data-field": "who",
150
150
  onFocus: () => {
151
- n.current || (n.current = !0, _("patient_search_object_focused"));
151
+ r.current || (r.current = !0, _("patient_search_object_focused"));
152
152
  },
153
- onBlur: (h) => {
154
- h.currentTarget && !h.currentTarget.contains(h.relatedTarget) && (n.current = !1);
153
+ onBlur: (m) => {
154
+ m.currentTarget && !m.currentTarget.contains(m.relatedTarget) && (r.current = !1);
155
155
  },
156
156
  children: /* @__PURE__ */ a(
157
- se,
157
+ re,
158
158
  {
159
159
  ref: p,
160
- value: g,
161
- onChange: (h) => {
162
- u(h), e.object && h !== e.object.label && (c.current = void 0, s({ ...e, object: void 0 }));
160
+ value: b,
161
+ onChange: (m) => {
162
+ h(m), e.object && m !== e.object.label && (d.current = void 0, s({ ...e, object: void 0 }));
163
163
  },
164
- onSelect: l,
165
- loadOptions: r,
166
- debounceMs: ie,
164
+ onSelect: f,
165
+ loadOptions: n,
166
+ debounceMs: oe,
167
167
  placeholder: v("patientSearch.who.placeholder"),
168
168
  "aria-label": v("patientSearch.who.label"),
169
- startAdornment: /* @__PURE__ */ a(re, { "aria-hidden": "true" })
169
+ startAdornment: /* @__PURE__ */ a(ne, { "aria-hidden": "true" })
170
170
  }
171
171
  )
172
172
  }
173
173
  );
174
174
  }
175
- const ee = [
175
+ const ae = [
176
176
  "ds:inline-flex ds:items-center ds:justify-center",
177
177
  "ds:size-8 ds:rounded-[var(--radius-sm)]",
178
178
  "ds:text-[color:var(--muted-foreground)] ds:hover:text-[color:var(--primary)]",
@@ -189,118 +189,124 @@ function q({
189
189
  onChange: s,
190
190
  loadPlaces: t,
191
191
  onPlaceSelect: i,
192
- inputRef: p,
193
- defaultRadiusKm: v = Y,
194
- reverseGeocode: g
192
+ allowTypedPlace: p,
193
+ inputRef: v,
194
+ defaultRadiusKm: b = J,
195
+ reverseGeocode: h
195
196
  }) {
196
- var P, B, C, E;
197
- const { t: u } = j("ui"), [c, r] = W(((P = e.place) == null ? void 0 : P.label) ?? ""), l = N((B = e.place) == null ? void 0 : B.value), n = e.geo ? "granted" : "pristine", [d, f] = W(n);
198
- V(() => {
199
- var x, w, k;
200
- ((x = e.place) == null ? void 0 : x.value) !== l.current && (l.current = (w = e.place) == null ? void 0 : w.value, r(((k = e.place) == null ? void 0 : k.label) ?? ""));
201
- }, [(C = e.place) == null ? void 0 : C.value, (E = e.place) == null ? void 0 : E.label]);
202
- const m = z(
203
- async (x, { signal: w }) => await t(x, { signal: w }),
197
+ var O, F, E, P;
198
+ const { t: d } = C("ui"), [n, f] = z(((O = e.place) == null ? void 0 : O.label) ?? ""), r = j((F = e.place) == null ? void 0 : F.value), l = e.geo ? "granted" : "pristine", [u, c] = z(l);
199
+ K(() => {
200
+ var y, x, N;
201
+ ((y = e.place) == null ? void 0 : y.value) !== r.current && (r.current = (x = e.place) == null ? void 0 : x.value, f(((N = e.place) == null ? void 0 : N.label) ?? ""));
202
+ }, [(E = e.place) == null ? void 0 : E.value, (P = e.place) == null ? void 0 : P.label]);
203
+ const g = M(
204
+ async (y, { signal: x }) => await t(y, { signal: x }),
204
205
  [t]
205
- ), b = (x) => {
206
- const w = {
207
- value: x.value,
208
- label: x.label,
209
- lat: x.lat,
210
- lng: x.lng
206
+ ), m = (y) => {
207
+ const x = {
208
+ value: y.value,
209
+ label: y.label,
210
+ lat: y.lat,
211
+ lng: y.lng
211
212
  };
212
- r(w.label), l.current = w.value, s({ ...e, place: w, geo: void 0 }), d === "granted" && f("pristine"), _("patient_search_place_selected", { value: w.value }), i == null || i(w);
213
- }, h = () => {
213
+ f(x.label), r.current = x.value, s({ ...e, place: x, geo: void 0 }), u === "granted" && c("pristine"), _("patient_search_place_selected", { value: x.value }), i == null || i(x);
214
+ }, o = () => {
214
215
  if (typeof window > "u" || !(navigator != null && navigator.geolocation)) {
215
- f("denied"), _("patient_search_geo_denied", { reason: "unsupported" });
216
+ c("denied"), _("patient_search_geo_denied", { reason: "unsupported" });
216
217
  return;
217
218
  }
218
- f("requesting"), _("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
219
- async (x) => {
220
- const { latitude: w, longitude: k } = x.coords;
221
- let R;
219
+ c("requesting"), _("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
220
+ async (y) => {
221
+ const { latitude: x, longitude: N } = y.coords;
222
+ let k;
222
223
  try {
223
- R = await (g == null ? void 0 : g(w, k));
224
+ k = await (h == null ? void 0 : h(x, N));
224
225
  } catch {
225
- R = void 0;
226
+ k = void 0;
226
227
  }
227
- const K = v, I = R ?? u("patientSearch.geo.fallbackLabel"), oe = {
228
- value: `geo:${w.toFixed(4)},${k.toFixed(4)}`,
229
- label: I,
230
- lat: w,
231
- lng: k
228
+ const R = b, V = k ?? d("patientSearch.geo.fallbackLabel"), de = {
229
+ value: `geo:${x.toFixed(4)},${N.toFixed(4)}`,
230
+ label: V,
231
+ lat: x,
232
+ lng: N
232
233
  };
233
234
  s({
234
235
  ...e,
235
- place: oe,
236
+ place: de,
236
237
  geo: {
237
- lat: w,
238
- lng: k,
239
- radiusKm: K,
240
- label: I
238
+ lat: x,
239
+ lng: N,
240
+ radiusKm: R,
241
+ label: V
241
242
  }
242
- }), f("granted"), _("patient_search_geo_granted", { radiusKm: K });
243
+ }), c("granted"), _("patient_search_geo_granted", { radiusKm: R });
243
244
  },
244
245
  () => {
245
- f("denied"), _("patient_search_geo_denied", { reason: "user" });
246
+ c("denied"), _("patient_search_geo_denied", { reason: "user" });
246
247
  },
247
248
  { enableHighAccuracy: !1, maximumAge: 6e4, timeout: 1e4 }
248
249
  );
249
- }, o = () => {
250
- s({ ...e, geo: void 0, place: void 0 }), r(""), l.current = void 0, f("pristine");
251
- }, S = d === "granted" && !!e.geo, G = d === "requesting", L = d === "denied", D = N(!1), Q = L || !!!g ? null : /* @__PURE__ */ y("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: [
252
- S ? /* @__PURE__ */ a(
250
+ }, S = () => {
251
+ s({ ...e, geo: void 0, place: void 0 }), f(""), r.current = void 0, c("pristine");
252
+ }, A = u === "granted" && !!e.geo, Q = u === "requesting", D = u === "denied", I = j(!1), X = D || !!!h ? null : /* @__PURE__ */ w("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: [
253
+ A ? /* @__PURE__ */ a(
253
254
  "button",
254
255
  {
255
256
  type: "button",
256
- "aria-label": u("patientSearch.geo.clear"),
257
- onClick: o,
258
- className: ee,
259
- children: /* @__PURE__ */ a(ne, { "aria-hidden": "true", className: "ds:size-4" })
257
+ "aria-label": d("patientSearch.geo.clear"),
258
+ onClick: S,
259
+ className: ae,
260
+ children: /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-4" })
260
261
  }
261
262
  ) : null,
262
263
  /* @__PURE__ */ a(
263
264
  "button",
264
265
  {
265
266
  type: "button",
266
- "aria-label": u("patientSearch.geo.cta"),
267
- "aria-pressed": S || void 0,
268
- disabled: G,
269
- onClick: S ? o : h,
270
- className: ee,
267
+ "aria-label": d("patientSearch.geo.cta"),
268
+ "aria-pressed": A || void 0,
269
+ disabled: Q,
270
+ onClick: A ? S : o,
271
+ className: ae,
271
272
  children: /* @__PURE__ */ a(xe, { "aria-hidden": "true", className: "ds:size-4" })
272
273
  }
273
274
  )
274
275
  ] });
275
- return /* @__PURE__ */ y(
276
+ return /* @__PURE__ */ w(
276
277
  "div",
277
278
  {
278
279
  "data-component": "patient-search-field",
279
280
  "data-field": "where",
280
281
  onFocus: () => {
281
- D.current || (D.current = !0, _("patient_search_place_focused"));
282
+ I.current || (I.current = !0, _("patient_search_place_focused"));
282
283
  },
283
- onBlur: (x) => {
284
- x.currentTarget && !x.currentTarget.contains(x.relatedTarget) && (D.current = !1);
284
+ onBlur: (y) => {
285
+ y.currentTarget && !y.currentTarget.contains(y.relatedTarget) && (I.current = !1);
285
286
  },
286
287
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
287
288
  children: [
288
- /* @__PURE__ */ y("div", { className: "ds:relative", children: [
289
+ /* @__PURE__ */ w("div", { className: "ds:relative", children: [
289
290
  /* @__PURE__ */ a(
290
- se,
291
+ re,
291
292
  {
292
- ref: p,
293
- value: c,
294
- onChange: (x) => {
295
- r(x), e.place && x !== e.place.label && (l.current = void 0, s({ ...e, place: void 0, geo: void 0 }), d === "granted" && f("pristine"));
293
+ ref: v,
294
+ value: n,
295
+ onChange: (y) => {
296
+ var x, N;
297
+ if (f(y), (p || e.place) && y !== ((x = e.place) == null ? void 0 : x.label)) {
298
+ const k = y.trim(), R = p && k ? { value: `text:${k}`, label: k } : void 0;
299
+ if (r.current = R == null ? void 0 : R.value, (R == null ? void 0 : R.value) === ((N = e.place) == null ? void 0 : N.value) && !e.geo) return;
300
+ s({ ...e, place: R, geo: void 0 }), u === "granted" && c("pristine");
301
+ }
296
302
  },
297
- onSelect: b,
298
- loadOptions: m,
299
- debounceMs: ie,
300
- placeholder: u("patientSearch.where.placeholder"),
301
- "aria-label": u("patientSearch.where.label"),
302
- startAdornment: /* @__PURE__ */ a(he, { "aria-hidden": "true" }),
303
- endAdornment: L ? void 0 : (
303
+ onSelect: m,
304
+ loadOptions: g,
305
+ debounceMs: oe,
306
+ placeholder: d("patientSearch.where.placeholder"),
307
+ "aria-label": d("patientSearch.where.label"),
308
+ startAdornment: /* @__PURE__ */ a(ve, { "aria-hidden": "true" }),
309
+ endAdornment: D ? void 0 : (
304
310
  // Decorative spacer — reserves inline-end room so the typed
305
311
  // text doesn't run under the absolutely-positioned overlay.
306
312
  // Autocomplete wraps endAdornment in `aria-hidden`, which is
@@ -310,44 +316,44 @@ function q({
310
316
  "span",
311
317
  {
312
318
  "aria-hidden": "true",
313
- className: S ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
319
+ className: A ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
314
320
  }
315
321
  )
316
322
  )
317
323
  }
318
324
  ),
319
- Q
325
+ X
320
326
  ] }),
321
- L ? (
327
+ D ? (
322
328
  // Alert defaults to `role="status"` + `aria-live="polite"` for the
323
329
  // `info` variant — the user hears why the field reverted to plain
324
330
  // text when their browser blocked the geolocation prompt.
325
- /* @__PURE__ */ a(Z, { variant: "info", children: /* @__PURE__ */ a(Z.Description, { children: u("patientSearch.geo.denied") }) })
331
+ /* @__PURE__ */ a(ee, { variant: "info", children: /* @__PURE__ */ a(ee.Description, { children: d("patientSearch.geo.denied") }) })
326
332
  ) : null
327
333
  ]
328
334
  }
329
335
  );
330
336
  }
331
- function $({
337
+ function U({
332
338
  value: e,
333
339
  onChange: s,
334
- defaultRadiusKm: t = Y
340
+ defaultRadiusKm: t = J
335
341
  }) {
336
- const { t: i } = j("ui"), [p, v] = W(
342
+ const { t: i } = C("ui"), [p, v] = z(
337
343
  () => {
338
- var c;
339
- return we(((c = e.geo) == null ? void 0 : c.radiusKm) ?? t);
344
+ var d;
345
+ return _e(((d = e.geo) == null ? void 0 : d.radiusKm) ?? t);
340
346
  }
341
347
  );
342
348
  if (!e.geo) return null;
343
- const g = (c) => {
344
- const r = O[c] ?? t;
345
- s({ ...e, geo: { ...e.geo, radiusKm: r } }), _("patient_search_radius_changed", { radiusKm: r });
346
- }, u = (c) => {
347
- const r = O[Math.round(c)] ?? t;
348
- return i("patientSearch.geo.radiusFormat", { km: r });
349
+ const b = (d) => {
350
+ const n = B[d] ?? t;
351
+ s({ ...e, geo: { ...e.geo, radiusKm: n } }), _("patient_search_radius_changed", { radiusKm: n });
352
+ }, h = (d) => {
353
+ const n = B[Math.round(d)] ?? t;
354
+ return i("patientSearch.geo.radiusFormat", { km: n });
349
355
  };
350
- return /* @__PURE__ */ y(
356
+ return /* @__PURE__ */ w(
351
357
  "div",
352
358
  {
353
359
  "data-component": "patient-search-geo-radius-bar",
@@ -362,28 +368,28 @@ function $({
362
368
  }
363
369
  ),
364
370
  /* @__PURE__ */ a(
365
- fe,
371
+ pe,
366
372
  {
367
373
  value: [p],
368
374
  min: 0,
369
- max: O.length - 1,
375
+ max: B.length - 1,
370
376
  step: 1,
371
- marks: O.map((c, r) => ({
372
- value: r,
373
- label: `${c}`
377
+ marks: B.map((d, n) => ({
378
+ value: n,
379
+ label: `${d}`
374
380
  })),
375
- formatValue: u,
381
+ formatValue: h,
376
382
  alwaysShowValue: !0,
377
383
  "aria-labelledby": "patient-search-radius-label",
378
- onValueChange: (c) => v(c[0] ?? 0),
379
- onValueCommit: (c) => g(c[0] ?? 0)
384
+ onValueChange: (d) => v(d[0] ?? 0),
385
+ onValueCommit: (d) => b(d[0] ?? 0)
380
386
  }
381
387
  )
382
388
  ]
383
389
  }
384
390
  );
385
391
  }
386
- const Se = T(
392
+ const Ne = L(
387
393
  [
388
394
  "ds:inline-flex ds:items-center ds:justify-center",
389
395
  "ds:min-h-[var(--min-target-size)]",
@@ -406,44 +412,44 @@ const Se = T(
406
412
  defaultVariants: { state: "idle" }
407
413
  }
408
414
  );
409
- function Ne({ value: e, onChange: s }) {
410
- const { t, i18n: i } = j("ui"), p = le(), v = i.dir() === "rtl", g = N(/* @__PURE__ */ new Map()), u = z((n) => {
411
- var d;
412
- (d = g.current.get(n)) == null || d.focus();
413
- }, []), c = z(
414
- (n, d) => {
415
- const f = A.indexOf(d), m = A.length, b = v ? "ArrowLeft" : "ArrowRight", h = v ? "ArrowRight" : "ArrowLeft";
416
- switch (n.key) {
417
- case b:
415
+ function ke({ value: e, onChange: s }) {
416
+ const { t, i18n: i } = C("ui"), p = ue(), v = i.dir() === "rtl", b = j(/* @__PURE__ */ new Map()), h = M((r) => {
417
+ var l;
418
+ (l = b.current.get(r)) == null || l.focus();
419
+ }, []), d = M(
420
+ (r, l) => {
421
+ const u = T.indexOf(l), c = T.length, g = v ? "ArrowLeft" : "ArrowRight", m = v ? "ArrowRight" : "ArrowLeft";
422
+ switch (r.key) {
423
+ case g:
418
424
  case "ArrowDown": {
419
- n.preventDefault();
420
- const o = A[(f + 1) % m];
421
- s(o), _("patient_search_when_selected", { when: o }), u(o);
425
+ r.preventDefault();
426
+ const o = T[(u + 1) % c];
427
+ s(o), _("patient_search_when_selected", { when: o }), h(o);
422
428
  break;
423
429
  }
424
- case h:
430
+ case m:
425
431
  case "ArrowUp": {
426
- n.preventDefault();
427
- const o = A[(f - 1 + m) % m];
428
- s(o), _("patient_search_when_selected", { when: o }), u(o);
432
+ r.preventDefault();
433
+ const o = T[(u - 1 + c) % c];
434
+ s(o), _("patient_search_when_selected", { when: o }), h(o);
429
435
  break;
430
436
  }
431
437
  case "Home": {
432
- n.preventDefault();
433
- const o = A[0];
434
- s(o), _("patient_search_when_selected", { when: o }), u(o);
438
+ r.preventDefault();
439
+ const o = T[0];
440
+ s(o), _("patient_search_when_selected", { when: o }), h(o);
435
441
  break;
436
442
  }
437
443
  case "End": {
438
- n.preventDefault();
439
- const o = A[m - 1];
440
- s(o), _("patient_search_when_selected", { when: o }), u(o);
444
+ r.preventDefault();
445
+ const o = T[c - 1];
446
+ s(o), _("patient_search_when_selected", { when: o }), h(o);
441
447
  break;
442
448
  }
443
449
  }
444
450
  },
445
- [u, v, s]
446
- ), r = e ?? "anytime", l = {
451
+ [h, v, s]
452
+ ), n = e ?? "anytime", f = {
447
453
  today: "patientSearch.when.today",
448
454
  tomorrow: "patientSearch.when.tomorrow",
449
455
  this_week: "patientSearch.when.thisWeek",
@@ -456,35 +462,35 @@ function Ne({ value: e, onChange: s }) {
456
462
  "aria-label": t("patientSearch.when.label"),
457
463
  id: p,
458
464
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
459
- children: A.map((n) => {
460
- const d = e === n, f = r === n, m = t(l[n]);
465
+ children: T.map((r) => {
466
+ const l = e === r, u = n === r, c = t(f[r]);
461
467
  return /* @__PURE__ */ a(
462
468
  "button",
463
469
  {
464
470
  type: "button",
465
471
  role: "radio",
466
- "aria-checked": d,
467
- "aria-label": m,
468
- tabIndex: f ? 0 : -1,
469
- ref: (b) => {
470
- b ? g.current.set(n, b) : g.current.delete(n);
472
+ "aria-checked": l,
473
+ "aria-label": c,
474
+ tabIndex: u ? 0 : -1,
475
+ ref: (g) => {
476
+ g ? b.current.set(r, g) : b.current.delete(r);
471
477
  },
472
478
  onClick: () => {
473
- s(n), _("patient_search_when_selected", { when: n });
479
+ s(r), _("patient_search_when_selected", { when: r });
474
480
  },
475
- onKeyDown: (b) => c(b, n),
476
- className: Se({
477
- state: d ? "selected" : "idle"
481
+ onKeyDown: (g) => d(g, r),
482
+ className: Ne({
483
+ state: l ? "selected" : "idle"
478
484
  }),
479
- children: m
485
+ children: c
480
486
  },
481
- n
487
+ r
482
488
  );
483
489
  })
484
490
  }
485
491
  );
486
492
  }
487
- const ae = T(
493
+ const te = L(
488
494
  [
489
495
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
490
496
  "ds:min-h-[var(--min-target-size)]",
@@ -514,63 +520,63 @@ const ae = T(
514
520
  defaultVariants: { state: "idle" }
515
521
  }
516
522
  );
517
- function ke({ facets: e, value: s, onChange: t }) {
518
- const { t: i } = j("ui"), p = X(() => s ?? {}, [s]), v = X(
519
- () => Object.values(p).some((r) => r && r.length > 0),
523
+ function Re({ facets: e, value: s, onChange: t }) {
524
+ const { t: i } = C("ui"), p = Y(() => s ?? {}, [s]), v = Y(
525
+ () => Object.values(p).some((n) => n && n.length > 0),
520
526
  [p]
521
- ), g = (r, l) => {
522
- const n = { ...p };
523
- l.length === 0 ? delete n[r] : n[r] = l, t(n), _("patient_search_facet_changed", { key: r, values: l });
524
- }, u = (r) => {
525
- var n;
526
- const l = (((n = p[r]) == null ? void 0 : n.length) ?? 0) > 0;
527
- g(r, l ? [] : ["true"]);
528
- }, c = (r, l) => {
529
- const n = p[r.key] ?? [], d = n.includes(l);
530
- let f;
531
- r.multi ? f = d ? n.filter((m) => m !== l) : [...n, l] : f = d ? [] : [l], g(r.key, f);
527
+ ), b = (n, f) => {
528
+ const r = { ...p };
529
+ f.length === 0 ? delete r[n] : r[n] = f, t(r), _("patient_search_facet_changed", { key: n, values: f });
530
+ }, h = (n) => {
531
+ var r;
532
+ const f = (((r = p[n]) == null ? void 0 : r.length) ?? 0) > 0;
533
+ b(n, f ? [] : ["true"]);
534
+ }, d = (n, f) => {
535
+ const r = p[n.key] ?? [], l = r.includes(f);
536
+ let u;
537
+ n.multi ? u = l ? r.filter((c) => c !== f) : [...r, f] : u = l ? [] : [f], b(n.key, u);
532
538
  };
533
- return /* @__PURE__ */ y(
539
+ return /* @__PURE__ */ w(
534
540
  "div",
535
541
  {
536
542
  role: "group",
537
543
  "aria-label": i("patientSearch.facets.label"),
538
544
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
539
545
  children: [
540
- e.map((r) => {
541
- const l = r.options.length === 0, n = p[r.key] ?? [], d = n.length > 0;
542
- if (l)
546
+ e.map((n) => {
547
+ const f = n.options.length === 0, r = p[n.key] ?? [], l = r.length > 0;
548
+ if (f)
543
549
  return /* @__PURE__ */ a(
544
550
  "button",
545
551
  {
546
552
  type: "button",
547
- "aria-pressed": d,
548
- "aria-label": r.label,
549
- onClick: () => u(r.key),
550
- className: ae({
551
- state: d ? "active" : "idle"
553
+ "aria-pressed": l,
554
+ "aria-label": n.label,
555
+ onClick: () => h(n.key),
556
+ className: te({
557
+ state: l ? "active" : "idle"
552
558
  }),
553
- children: /* @__PURE__ */ a("span", { children: r.label })
559
+ children: /* @__PURE__ */ a("span", { children: n.label })
554
560
  },
555
- r.key
561
+ n.key
556
562
  );
557
- const f = d ? ` (${n.length})` : "";
558
- return /* @__PURE__ */ y(F.Root, { children: [
559
- /* @__PURE__ */ a(F.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
563
+ const u = l ? ` (${r.length})` : "";
564
+ return /* @__PURE__ */ w(W.Root, { children: [
565
+ /* @__PURE__ */ a(W.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
560
566
  "button",
561
567
  {
562
568
  type: "button",
563
- "aria-label": `${r.label}${f}`,
564
- className: ae({
565
- state: d ? "active" : "idle"
569
+ "aria-label": `${n.label}${u}`,
570
+ className: te({
571
+ state: l ? "active" : "idle"
566
572
  }),
567
573
  children: [
568
- /* @__PURE__ */ y("span", { children: [
569
- r.label,
570
- f
574
+ /* @__PURE__ */ w("span", { children: [
575
+ n.label,
576
+ u
571
577
  ] }),
572
578
  /* @__PURE__ */ a(
573
- ge,
579
+ be,
574
580
  {
575
581
  "aria-hidden": "true",
576
582
  className: "ds:size-3.5 ds:shrink-0"
@@ -579,20 +585,20 @@ function ke({ facets: e, value: s, onChange: t }) {
579
585
  ]
580
586
  }
581
587
  ) }),
582
- /* @__PURE__ */ a(F.Content, { sideOffset: 8, align: "start", children: r.options.map((m) => /* @__PURE__ */ a(
583
- F.CheckboxItem,
588
+ /* @__PURE__ */ a(W.Content, { sideOffset: 8, align: "start", children: n.options.map((c) => /* @__PURE__ */ a(
589
+ W.CheckboxItem,
584
590
  {
585
- checked: n.includes(m.value),
586
- onSelect: (b) => {
587
- r.multi && b.preventDefault(), c(r, m.value);
591
+ checked: r.includes(c.value),
592
+ onSelect: (g) => {
593
+ n.multi && g.preventDefault(), d(n, c.value);
588
594
  },
589
- children: m.label
595
+ children: c.label
590
596
  },
591
- m.value
597
+ c.value
592
598
  )) })
593
- ] }, r.key);
599
+ ] }, n.key);
594
600
  }),
595
- v ? /* @__PURE__ */ y(
601
+ v ? /* @__PURE__ */ w(
596
602
  "button",
597
603
  {
598
604
  type: "button",
@@ -609,7 +615,7 @@ function ke({ facets: e, value: s, onChange: t }) {
609
615
  "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
610
616
  ].join(" "),
611
617
  children: [
612
- /* @__PURE__ */ a(ne, { "aria-hidden": "true", className: "ds:size-3.5" }),
618
+ /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-3.5" }),
613
619
  i("patientSearch.facets.clear")
614
620
  ]
615
621
  }
@@ -618,7 +624,7 @@ function ke({ facets: e, value: s, onChange: t }) {
618
624
  }
619
625
  );
620
626
  }
621
- const te = ["violet", "purple", "magenta", "blue"], Re = T(
627
+ const se = ["violet", "purple", "magenta", "blue"], je = L(
622
628
  [
623
629
  "ds:relative ds:flex ds:h-full ds:flex-col ds:gap-[var(--spacing-sm)]",
624
630
  "ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
@@ -634,7 +640,7 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
634
640
  "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
635
641
  "ds:no-underline"
636
642
  ].join(" ")
637
- ), je = T(
643
+ ), Ae = L(
638
644
  // `inset-x-0` compiles to logical `inset-inline`; the `inset-inline-0`
639
645
  // spelling is not a Tailwind utility and compiled to nothing.
640
646
  "ds:absolute ds:inset-x-0 ds:top-0 ds:h-[3px] ds:pointer-events-none",
@@ -649,7 +655,7 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
649
655
  },
650
656
  defaultVariants: { accent: "violet" }
651
657
  }
652
- ), Ae = T(
658
+ ), Ce = L(
653
659
  "ds:inline-flex ds:size-9 ds:items-center ds:justify-center ds:rounded-[var(--radius-md)]",
654
660
  {
655
661
  variants: {
@@ -663,12 +669,12 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
663
669
  defaultVariants: { accent: "violet" }
664
670
  }
665
671
  );
666
- function Ce(e, s) {
667
- return e && e !== "auto" ? e : te[s % te.length];
672
+ function Te(e, s) {
673
+ return e && e !== "auto" ? e : se[s % se.length];
668
674
  }
669
675
  function Ee({ cards: e }) {
670
- const { t: s } = j("ui");
671
- return e.length === 0 ? /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: s("patientSearch.discovery.empty") }) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
676
+ const { t: s } = C("ui");
677
+ return e.length === 0 ? /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: s("patientSearch.discovery.empty") }) : /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
672
678
  /* @__PURE__ */ a("h3", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: s("patientSearch.discovery.heading") }),
673
679
  /* @__PURE__ */ a(
674
680
  "ul",
@@ -679,8 +685,8 @@ function Ee({ cards: e }) {
679
685
  "ds:m-0 ds:p-0 ds:list-none"
680
686
  ].join(" "),
681
687
  children: e.map((t, i) => {
682
- const p = Ce(t.accent, i);
683
- return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ y(
688
+ const p = Te(t.accent, i);
689
+ return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ w(
684
690
  "a",
685
691
  {
686
692
  href: t.href,
@@ -690,22 +696,22 @@ function Ee({ cards: e }) {
690
696
  onClick: () => _("patient_search_discovery_card_clicked", {
691
697
  cardId: t.id
692
698
  }),
693
- className: Re(),
699
+ className: je(),
694
700
  children: [
695
701
  /* @__PURE__ */ a(
696
702
  "span",
697
703
  {
698
704
  "aria-hidden": "true",
699
- className: je({ accent: p })
705
+ className: Ae({ accent: p })
700
706
  }
701
707
  ),
702
- /* @__PURE__ */ y("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
708
+ /* @__PURE__ */ w("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
703
709
  /* @__PURE__ */ a(
704
710
  "span",
705
711
  {
706
712
  "aria-hidden": "true",
707
- className: Ae({ accent: p }),
708
- children: t.icon ?? /* @__PURE__ */ a(ve, { className: "ds:size-4", "aria-hidden": "true" })
713
+ className: Ce({ accent: p }),
714
+ children: t.icon ?? /* @__PURE__ */ a(ge, { className: "ds:size-4", "aria-hidden": "true" })
709
715
  }
710
716
  ),
711
717
  t.badge ? (
@@ -729,7 +735,7 @@ function Ee({ cards: e }) {
729
735
  )
730
736
  ] });
731
737
  }
732
- function Te(e) {
738
+ function Pe(e) {
733
739
  if (e.object || e.place || e.geo || e.when && e.when !== "anytime") return !0;
734
740
  if (e.facets) {
735
741
  for (const s of Object.values(e.facets))
@@ -737,7 +743,7 @@ function Te(e) {
737
743
  }
738
744
  return !1;
739
745
  }
740
- function U({
746
+ function G({
741
747
  value: e,
742
748
  variant: s,
743
749
  submitting: t,
@@ -745,16 +751,16 @@ function U({
745
751
  allowEmptySubmit: p,
746
752
  onSubmit: v
747
753
  }) {
748
- const { t: g } = j("ui"), u = !t && !p && !Te(e), c = i ?? g("patientSearch.submit.cta");
754
+ const { t: b } = C("ui"), h = !t && !p && !Pe(e), d = i ?? b("patientSearch.submit.cta");
749
755
  return /* @__PURE__ */ a(
750
- ue,
756
+ fe,
751
757
  {
752
758
  type: "button",
753
759
  intent: "primary",
754
760
  size: "lg",
755
- startIcon: /* @__PURE__ */ a(re, { "aria-hidden": "true" }),
761
+ startIcon: /* @__PURE__ */ a(ne, { "aria-hidden": "true" }),
756
762
  loading: t,
757
- disabled: u,
763
+ disabled: h,
758
764
  onClick: () => {
759
765
  _("patient_search_submitted", {
760
766
  variant: s,
@@ -765,7 +771,7 @@ function U({
765
771
  facetKeys: e.facets ? Object.keys(e.facets) : []
766
772
  }), v(e);
767
773
  },
768
- children: c
774
+ children: d
769
775
  }
770
776
  );
771
777
  }
@@ -776,28 +782,29 @@ function Le(e) {
776
782
  onChange: i,
777
783
  onSubmit: p,
778
784
  loadObjects: v,
779
- loadPlaces: g,
780
- onObjectSelect: u,
781
- onPlaceSelect: c,
782
- submitting: r,
783
- submitLabel: l,
784
- allowEmptySubmit: n,
785
- whoRef: d,
786
- whereRef: f,
787
- defaultRadiusKm: m,
788
- reverseGeocode: b,
789
- cardLabel: h
785
+ loadPlaces: b,
786
+ onObjectSelect: h,
787
+ onPlaceSelect: d,
788
+ allowTypedPlace: n,
789
+ submitting: f,
790
+ submitLabel: r,
791
+ allowEmptySubmit: l,
792
+ whoRef: u,
793
+ whereRef: c,
794
+ defaultRadiusKm: g,
795
+ reverseGeocode: m,
796
+ cardLabel: o
790
797
  } = e;
791
- return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": h, children: /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
792
- /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
798
+ return /* @__PURE__ */ a(H, { variant: "elevated", "aria-label": o, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
799
+ /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
793
800
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
794
- H,
801
+ $,
795
802
  {
796
803
  value: t,
797
804
  onChange: i,
798
805
  loadObjects: v,
799
- onObjectSelect: u,
800
- inputRef: d
806
+ onObjectSelect: h,
807
+ inputRef: u
801
808
  }
802
809
  ) }),
803
810
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
@@ -805,31 +812,32 @@ function Le(e) {
805
812
  {
806
813
  value: t,
807
814
  onChange: i,
808
- loadPlaces: g,
809
- onPlaceSelect: c,
810
- defaultRadiusKm: m,
811
- reverseGeocode: b,
812
- inputRef: f
815
+ loadPlaces: b,
816
+ onPlaceSelect: d,
817
+ allowTypedPlace: n,
818
+ defaultRadiusKm: g,
819
+ reverseGeocode: m,
820
+ inputRef: c
813
821
  }
814
822
  ) }),
815
823
  /* @__PURE__ */ a(
816
- U,
824
+ G,
817
825
  {
818
826
  value: t,
819
827
  variant: s,
820
- submitting: r,
821
- submitLabel: l,
822
- allowEmptySubmit: n,
828
+ submitting: f,
829
+ submitLabel: r,
830
+ allowEmptySubmit: l,
823
831
  onSubmit: p
824
832
  }
825
833
  )
826
834
  ] }),
827
835
  /* @__PURE__ */ a(
828
- $,
836
+ U,
829
837
  {
830
838
  value: t,
831
839
  onChange: i,
832
- defaultRadiusKm: m
840
+ defaultRadiusKm: g
833
841
  }
834
842
  )
835
843
  ] }) });
@@ -841,28 +849,29 @@ function De(e) {
841
849
  onChange: i,
842
850
  onSubmit: p,
843
851
  loadObjects: v,
844
- loadPlaces: g,
845
- onObjectSelect: u,
846
- onPlaceSelect: c,
847
- submitting: r,
848
- submitLabel: l,
849
- allowEmptySubmit: n,
850
- whoRef: d,
851
- whereRef: f,
852
- defaultRadiusKm: m,
853
- reverseGeocode: b,
854
- cardLabel: h
852
+ loadPlaces: b,
853
+ onObjectSelect: h,
854
+ onPlaceSelect: d,
855
+ allowTypedPlace: n,
856
+ submitting: f,
857
+ submitLabel: r,
858
+ allowEmptySubmit: l,
859
+ whoRef: u,
860
+ whereRef: c,
861
+ defaultRadiusKm: g,
862
+ reverseGeocode: m,
863
+ cardLabel: o
855
864
  } = e;
856
- return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": h, children: /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
857
- /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
865
+ return /* @__PURE__ */ a(H, { variant: "elevated", "aria-label": o, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
866
+ /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
858
867
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
859
- H,
868
+ $,
860
869
  {
861
870
  value: t,
862
871
  onChange: i,
863
872
  loadObjects: v,
864
- onObjectSelect: u,
865
- inputRef: d
873
+ onObjectSelect: h,
874
+ inputRef: u
866
875
  }
867
876
  ) }),
868
877
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
@@ -870,72 +879,74 @@ function De(e) {
870
879
  {
871
880
  value: t,
872
881
  onChange: i,
873
- loadPlaces: g,
874
- onPlaceSelect: c,
875
- defaultRadiusKm: m,
876
- reverseGeocode: b,
877
- inputRef: f
882
+ loadPlaces: b,
883
+ onPlaceSelect: d,
884
+ allowTypedPlace: n,
885
+ defaultRadiusKm: g,
886
+ reverseGeocode: m,
887
+ inputRef: c
878
888
  }
879
889
  ) }),
880
890
  /* @__PURE__ */ a(
881
- U,
891
+ G,
882
892
  {
883
893
  value: t,
884
894
  variant: s,
885
- submitting: r,
886
- submitLabel: l,
887
- allowEmptySubmit: n,
895
+ submitting: f,
896
+ submitLabel: r,
897
+ allowEmptySubmit: l,
888
898
  onSubmit: p
889
899
  }
890
900
  )
891
901
  ] }),
892
902
  /* @__PURE__ */ a(
893
- $,
903
+ U,
894
904
  {
895
905
  value: t,
896
906
  onChange: i,
897
- defaultRadiusKm: m
907
+ defaultRadiusKm: g
898
908
  }
899
909
  ),
900
910
  /* @__PURE__ */ a(
901
- Ne,
911
+ ke,
902
912
  {
903
913
  value: t.when,
904
- onChange: (o) => i({ ...t, when: o })
914
+ onChange: (S) => i({ ...t, when: S })
905
915
  }
906
916
  )
907
917
  ] }) });
908
918
  }
909
- function Pe(e) {
919
+ function Ie(e) {
910
920
  const {
911
921
  variant: s,
912
922
  value: t,
913
923
  onChange: i,
914
924
  onSubmit: p,
915
925
  loadObjects: v,
916
- loadPlaces: g,
917
- onObjectSelect: u,
918
- onPlaceSelect: c,
919
- facets: r,
920
- submitting: l,
921
- submitLabel: n,
922
- allowEmptySubmit: d,
923
- whoRef: f,
924
- whereRef: m,
925
- defaultRadiusKm: b,
926
- reverseGeocode: h,
927
- cardLabel: o
926
+ loadPlaces: b,
927
+ onObjectSelect: h,
928
+ onPlaceSelect: d,
929
+ allowTypedPlace: n,
930
+ facets: f,
931
+ submitting: r,
932
+ submitLabel: l,
933
+ allowEmptySubmit: u,
934
+ whoRef: c,
935
+ whereRef: g,
936
+ defaultRadiusKm: m,
937
+ reverseGeocode: o,
938
+ cardLabel: S
928
939
  } = e;
929
- return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": o, children: /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
930
- /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
940
+ return /* @__PURE__ */ a(H, { variant: "elevated", "aria-label": S, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
941
+ /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
931
942
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
932
- H,
943
+ $,
933
944
  {
934
945
  value: t,
935
946
  onChange: i,
936
947
  loadObjects: v,
937
- onObjectSelect: u,
938
- inputRef: f
948
+ onObjectSelect: h,
949
+ inputRef: c
939
950
  }
940
951
  ) }),
941
952
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
@@ -943,74 +954,76 @@ function Pe(e) {
943
954
  {
944
955
  value: t,
945
956
  onChange: i,
946
- loadPlaces: g,
947
- onPlaceSelect: c,
948
- defaultRadiusKm: b,
949
- reverseGeocode: h,
950
- inputRef: m
957
+ loadPlaces: b,
958
+ onPlaceSelect: d,
959
+ allowTypedPlace: n,
960
+ defaultRadiusKm: m,
961
+ reverseGeocode: o,
962
+ inputRef: g
951
963
  }
952
964
  ) }),
953
965
  /* @__PURE__ */ a(
954
- U,
966
+ G,
955
967
  {
956
968
  value: t,
957
969
  variant: s,
958
- submitting: l,
959
- submitLabel: n,
960
- allowEmptySubmit: d,
970
+ submitting: r,
971
+ submitLabel: l,
972
+ allowEmptySubmit: u,
961
973
  onSubmit: p
962
974
  }
963
975
  )
964
976
  ] }),
965
977
  /* @__PURE__ */ a(
966
- $,
978
+ U,
967
979
  {
968
980
  value: t,
969
981
  onChange: i,
970
- defaultRadiusKm: b
982
+ defaultRadiusKm: m
971
983
  }
972
984
  ),
973
- r && r.length > 0 ? /* @__PURE__ */ a(
974
- ke,
985
+ f && f.length > 0 ? /* @__PURE__ */ a(
986
+ Re,
975
987
  {
976
- facets: r,
988
+ facets: f,
977
989
  value: t.facets,
978
- onChange: (S) => i({ ...t, facets: S })
990
+ onChange: (A) => i({ ...t, facets: A })
979
991
  }
980
992
  ) : null
981
993
  ] }) });
982
994
  }
983
- function Ie(e) {
995
+ function Oe(e) {
984
996
  const {
985
997
  variant: s,
986
998
  value: t,
987
999
  onChange: i,
988
1000
  onSubmit: p,
989
1001
  loadObjects: v,
990
- loadPlaces: g,
991
- onObjectSelect: u,
992
- onPlaceSelect: c,
993
- discoveryCards: r,
994
- submitting: l,
995
- submitLabel: n,
996
- allowEmptySubmit: d,
997
- whoRef: f,
998
- whereRef: m,
999
- defaultRadiusKm: b,
1000
- reverseGeocode: h,
1001
- cardLabel: o
1002
+ loadPlaces: b,
1003
+ onObjectSelect: h,
1004
+ onPlaceSelect: d,
1005
+ allowTypedPlace: n,
1006
+ discoveryCards: f,
1007
+ submitting: r,
1008
+ submitLabel: l,
1009
+ allowEmptySubmit: u,
1010
+ whoRef: c,
1011
+ whereRef: g,
1012
+ defaultRadiusKm: m,
1013
+ reverseGeocode: o,
1014
+ cardLabel: S
1002
1015
  } = e;
1003
- return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
1004
- /* @__PURE__ */ y(M, { variant: "elevated", "aria-label": o, children: [
1005
- /* @__PURE__ */ y("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: [
1016
+ return /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
1017
+ /* @__PURE__ */ w(H, { variant: "elevated", "aria-label": S, children: [
1018
+ /* @__PURE__ */ w("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: [
1006
1019
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
1007
- H,
1020
+ $,
1008
1021
  {
1009
1022
  value: t,
1010
1023
  onChange: i,
1011
1024
  loadObjects: v,
1012
- onObjectSelect: u,
1013
- inputRef: f
1025
+ onObjectSelect: h,
1026
+ inputRef: c
1014
1027
  }
1015
1028
  ) }),
1016
1029
  /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
@@ -1018,128 +1031,131 @@ function Ie(e) {
1018
1031
  {
1019
1032
  value: t,
1020
1033
  onChange: i,
1021
- loadPlaces: g,
1022
- onPlaceSelect: c,
1023
- defaultRadiusKm: b,
1024
- reverseGeocode: h,
1025
- inputRef: m
1034
+ loadPlaces: b,
1035
+ onPlaceSelect: d,
1036
+ allowTypedPlace: n,
1037
+ defaultRadiusKm: m,
1038
+ reverseGeocode: o,
1039
+ inputRef: g
1026
1040
  }
1027
1041
  ) }),
1028
1042
  /* @__PURE__ */ a(
1029
- U,
1043
+ G,
1030
1044
  {
1031
1045
  value: t,
1032
1046
  variant: s,
1033
- submitting: l,
1034
- submitLabel: n,
1035
- allowEmptySubmit: d,
1047
+ submitting: r,
1048
+ submitLabel: l,
1049
+ allowEmptySubmit: u,
1036
1050
  onSubmit: p
1037
1051
  }
1038
1052
  )
1039
1053
  ] }),
1040
1054
  /* @__PURE__ */ a(
1041
- $,
1055
+ U,
1042
1056
  {
1043
1057
  value: t,
1044
1058
  onChange: i,
1045
- defaultRadiusKm: b
1059
+ defaultRadiusKm: m
1046
1060
  }
1047
1061
  )
1048
1062
  ] }),
1049
- /* @__PURE__ */ a(Ee, { cards: r })
1063
+ /* @__PURE__ */ a(Ee, { cards: f })
1050
1064
  ] });
1051
1065
  }
1052
- const Oe = de(function({
1066
+ const Ve = ce(function({
1053
1067
  variant: s,
1054
1068
  loadObjects: t,
1055
1069
  loadPlaces: i,
1056
1070
  onObjectSelect: p,
1057
1071
  onPlaceSelect: v,
1058
- facets: g,
1059
- defaultRadiusKm: u = Y,
1060
- reverseGeocode: c,
1061
- discoveryCards: r,
1062
- countryCode: l,
1063
- value: n,
1064
- onChange: d,
1065
- onSubmit: f,
1066
- submitting: m,
1067
- submitLabel: b,
1068
- allowEmptySubmit: h,
1069
- "aria-label": o,
1070
- id: S,
1071
- className: G,
1072
- ...L
1073
- }, D) {
1074
- const { t: J } = j("ui"), Q = N(null), P = N(null), B = N(null), C = N(!1);
1075
- V(() => {
1076
- if (!C.current && s === "who-where-when") {
1077
- if (n.when !== void 0) {
1078
- C.current = !0;
1072
+ allowTypedPlace: b = !1,
1073
+ facets: h,
1074
+ defaultRadiusKm: d = J,
1075
+ reverseGeocode: n,
1076
+ discoveryCards: f,
1077
+ countryCode: r,
1078
+ value: l,
1079
+ onChange: u,
1080
+ onSubmit: c,
1081
+ submitting: g,
1082
+ submitLabel: m,
1083
+ allowEmptySubmit: o,
1084
+ "aria-label": S,
1085
+ id: A,
1086
+ className: Q,
1087
+ ...D
1088
+ }, I) {
1089
+ const { t: Z } = C("ui"), X = j(null), O = j(null), F = j(null), E = j(!1);
1090
+ K(() => {
1091
+ if (!E.current && s === "who-where-when") {
1092
+ if (l.when !== void 0) {
1093
+ E.current = !0;
1079
1094
  return;
1080
1095
  }
1081
- C.current = !0, d({ ...n, when: "anytime" });
1096
+ E.current = !0, u({ ...l, when: "anytime" });
1082
1097
  }
1083
1098
  }, [s]);
1084
- const E = N(!1);
1085
- V(() => {
1086
- if (!E.current && s === "faceted") {
1087
- if (n.facets !== void 0) {
1088
- E.current = !0;
1099
+ const P = j(!1);
1100
+ K(() => {
1101
+ if (!P.current && s === "faceted") {
1102
+ if (l.facets !== void 0) {
1103
+ P.current = !0;
1089
1104
  return;
1090
1105
  }
1091
- E.current = !0, d({ ...n, facets: {} });
1106
+ P.current = !0, u({ ...l, facets: {} });
1092
1107
  }
1093
1108
  }, [s]);
1094
- const x = N(null);
1095
- V(() => {
1096
- x.current !== s && (x.current = s, _("patient_search_variant_exposed", { variant: s, country: l }));
1097
- }, [s, l]);
1098
- const w = X(
1109
+ const y = j(null);
1110
+ K(() => {
1111
+ y.current !== s && (y.current = s, _("patient_search_variant_exposed", { variant: s, country: r }));
1112
+ }, [s, r]);
1113
+ const x = Y(
1099
1114
  () => ({
1100
1115
  getVariant: () => s,
1101
1116
  reset: () => {
1102
- d({});
1117
+ u({});
1103
1118
  },
1104
1119
  focusPrimary: () => {
1105
1120
  requestAnimationFrame(() => {
1106
- var I;
1107
- (I = P.current) == null || I.focus();
1121
+ var V;
1122
+ (V = O.current) == null || V.focus();
1108
1123
  });
1109
1124
  }
1110
1125
  }),
1111
- [s, d]
1126
+ [s, u]
1112
1127
  );
1113
- ce(D, () => w, [w]), pe(ye, w, S);
1114
- const k = o ?? J("patientSearch.regionLabel"), R = {
1128
+ le(I, () => x, [x]), me(we, x, A);
1129
+ const N = S ?? Z("patientSearch.regionLabel"), k = {
1115
1130
  variant: s,
1116
- value: n,
1117
- onChange: d,
1118
- onSubmit: f,
1131
+ value: l,
1132
+ onChange: u,
1133
+ onSubmit: c,
1119
1134
  loadObjects: t,
1120
1135
  loadPlaces: i,
1121
1136
  onObjectSelect: p,
1122
1137
  onPlaceSelect: v,
1123
- facets: g,
1124
- defaultRadiusKm: u,
1125
- reverseGeocode: c,
1126
- discoveryCards: r ?? [],
1127
- submitting: m,
1128
- submitLabel: b,
1129
- allowEmptySubmit: h,
1130
- whoRef: P,
1131
- whereRef: B,
1132
- cardLabel: k
1133
- }, K = (() => {
1138
+ allowTypedPlace: b,
1139
+ facets: h,
1140
+ defaultRadiusKm: d,
1141
+ reverseGeocode: n,
1142
+ discoveryCards: f ?? [],
1143
+ submitting: g,
1144
+ submitLabel: m,
1145
+ allowEmptySubmit: o,
1146
+ whoRef: O,
1147
+ whereRef: F,
1148
+ cardLabel: N
1149
+ }, R = (() => {
1134
1150
  switch (s) {
1135
1151
  case "who-where":
1136
- return /* @__PURE__ */ a(Le, { ...R });
1152
+ return /* @__PURE__ */ a(Le, { ...k });
1137
1153
  case "who-where-when":
1138
- return /* @__PURE__ */ a(De, { ...R });
1154
+ return /* @__PURE__ */ a(De, { ...k });
1139
1155
  case "faceted":
1140
- return /* @__PURE__ */ a(Pe, { ...R });
1156
+ return /* @__PURE__ */ a(Ie, { ...k });
1141
1157
  case "discovery":
1142
- return /* @__PURE__ */ a(Ie, { ...R });
1158
+ return /* @__PURE__ */ a(Oe, { ...k });
1143
1159
  /* c8 ignore next 2 */
1144
1160
  default:
1145
1161
  return null;
@@ -1148,22 +1164,22 @@ const Oe = de(function({
1148
1164
  return /* @__PURE__ */ a(
1149
1165
  "div",
1150
1166
  {
1151
- ref: Q,
1167
+ ref: X,
1152
1168
  role: "region",
1153
- "aria-label": k,
1154
- id: S,
1169
+ "aria-label": N,
1170
+ id: A,
1155
1171
  "data-component": "patient-search",
1156
- "data-component-id": S,
1172
+ "data-component-id": A,
1157
1173
  "data-variant": s,
1158
- className: _e({ variant: s, className: G }),
1159
- ...L,
1160
- children: K
1174
+ className: Se({ variant: s, className: Q }),
1175
+ ...D,
1176
+ children: R
1161
1177
  }
1162
1178
  );
1163
1179
  });
1164
- Oe.displayName = "PatientSearch";
1180
+ Ve.displayName = "PatientSearch";
1165
1181
  export {
1166
- Oe as P,
1167
- ye as p
1182
+ Ve as P,
1183
+ we as p
1168
1184
  };
1169
- //# sourceMappingURL=patient-search-DuBdxv1w.js.map
1185
+ //# sourceMappingURL=patient-search-CxqNcth4.js.map