@eka-care/medassist-widget 0.1.81 → 0.1.82

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.
@@ -0,0 +1,84 @@
1
+ import { h as x, d as f, y as h, u as e, b as a } from "./medassist-widget-main-CvBx4wsw.js";
2
+ function y({
3
+ className: r = "",
4
+ onRetry: d,
5
+ showRetryButton: i,
6
+ startNewConnection: n,
7
+ clearError: o,
8
+ error: t,
9
+ isConnected: c
10
+ }) {
11
+ const { isOnline: s } = x(), [m, l] = f(!0);
12
+ return h(() => {
13
+ if (!n && !i && !!t) {
14
+ l(!0);
15
+ const u = setTimeout(() => l(!1), 5e3);
16
+ return () => clearTimeout(u);
17
+ }
18
+ l(!0);
19
+ }, [t, n, i]), n ? /* @__PURE__ */ e("div", { className: a("flex flex-col items-center synapse-chat-widget-footer px-3 pt-3 pb-2 ", r), children: /* @__PURE__ */ e("p", { className: "text-text-secondary text-sm max-w-sm mx-auto text-center w-250 mx-4 text-balance", children: "The conversation is now closed. Start a new session to continue." }) }) : i && t?.title ? /* @__PURE__ */ e(
20
+ "div",
21
+ {
22
+ className: a(
23
+ "mx-4 mb-3 p-2 bg-surface border border-[#F7B500] rounded-lg",
24
+ r
25
+ ),
26
+ children: /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: [
27
+ /* @__PURE__ */ e("div", { className: "w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
28
+ /* @__PURE__ */ e("div", { className: "flex-1", children: [
29
+ /* @__PURE__ */ e("div", { className: "text-text-primary font-semibold text-sm", children: t?.title }),
30
+ /* @__PURE__ */ e("div", { className: "text-text-secondary text-xs mt-1", children: t?.description ?? "Please check your connection and try again" })
31
+ ] }),
32
+ /* @__PURE__ */ e(
33
+ "button",
34
+ {
35
+ onClick: () => {
36
+ o(), d?.();
37
+ },
38
+ className: "px-4 py-2 bg-primary text-primary-foreground text-sm font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center gap-2 flex-shrink-0",
39
+ children: [
40
+ /* @__PURE__ */ e(
41
+ "svg",
42
+ {
43
+ className: "w-4 h-4",
44
+ fill: "none",
45
+ stroke: "currentColor",
46
+ viewBox: "0 0 24 24",
47
+ children: /* @__PURE__ */ e(
48
+ "path",
49
+ {
50
+ strokeLinecap: "round",
51
+ strokeLinejoin: "round",
52
+ strokeWidth: 2,
53
+ d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
54
+ }
55
+ )
56
+ }
57
+ ),
58
+ "Retry"
59
+ ]
60
+ }
61
+ )
62
+ ] })
63
+ }
64
+ ) : c && s && !t?.title || !n && !i && !m || !c && !t?.title ? null : /* @__PURE__ */ e(
65
+ "div",
66
+ {
67
+ className: a(
68
+ "mx-4 mb-3 p-2 bg-surface border border-border-subtle rounded-lg transition-opacity duration-500",
69
+ r
70
+ ),
71
+ children: /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: [
72
+ /* @__PURE__ */ e("div", { className: "w-5 h-5 bg-primary rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
73
+ /* @__PURE__ */ e("div", { className: "flex-1", children: [
74
+ /* @__PURE__ */ e("div", { className: "text-text-primary font-semibold text-sm", children: s ? t?.title : "No internet connection" }),
75
+ /* @__PURE__ */ e("div", { className: "text-text-secondary text-xs mt-1", children: s ? t?.description ?? "Please wait while we try to connect" : "Please check your internet connection" })
76
+ ] }),
77
+ !s && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin" }) })
78
+ ] })
79
+ }
80
+ );
81
+ }
82
+ export {
83
+ y as ConnectionStatus
84
+ };
@@ -0,0 +1,69 @@
1
+ import { u as e, S as n, e as a, q as i, y as l } from "./medassist-widget-main-CvBx4wsw.js";
2
+ import { X as d } from "./medassist-widget-x-DptkIHzh.js";
3
+ function u({ message: t, onDismiss: r }) {
4
+ return /* @__PURE__ */ e(n, { children: [
5
+ /* @__PURE__ */ e(
6
+ "div",
7
+ {
8
+ className: "pointer-events-none absolute inset-0 z-[55] bg-black-600",
9
+ "aria-hidden": !0
10
+ }
11
+ ),
12
+ /* @__PURE__ */ e(
13
+ "div",
14
+ {
15
+ className: "pointer-events-none absolute inset-x-3 top-3 z-[60]",
16
+ role: "presentation",
17
+ children: /* @__PURE__ */ e(
18
+ "div",
19
+ {
20
+ role: "alertdialog",
21
+ "aria-modal": "true",
22
+ "aria-labelledby": "synapse-disp-toast-msg",
23
+ className: "pointer-events-auto flex w-full flex-row items-center gap-3 rounded-lg border border-border bg-surface p-3 text-left text-foreground opacity-100",
24
+ onClick: (s) => s.stopPropagation(),
25
+ children: [
26
+ /* @__PURE__ */ e(
27
+ "p",
28
+ {
29
+ id: "synapse-disp-toast-msg",
30
+ className: "min-w-0 flex-1 text-sm font-medium whitespace-pre-wrap",
31
+ children: t
32
+ }
33
+ ),
34
+ /* @__PURE__ */ e(
35
+ "button",
36
+ {
37
+ type: "button",
38
+ onClick: r,
39
+ className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",
40
+ "aria-label": "Close",
41
+ children: /* @__PURE__ */ e(d, { className: "h-4 w-4", strokeWidth: 2.5 })
42
+ }
43
+ )
44
+ ]
45
+ }
46
+ )
47
+ }
48
+ )
49
+ ] });
50
+ }
51
+ function p() {
52
+ const t = a((o) => o.toastMessage), r = a((o) => o.setToastMessage), s = i(() => {
53
+ r(null);
54
+ }, [r]);
55
+ return l(() => {
56
+ if (!t) return;
57
+ const o = window.setTimeout(s, 3e3);
58
+ return () => window.clearTimeout(o);
59
+ }, [t, s]), t ? /* @__PURE__ */ e(
60
+ u,
61
+ {
62
+ message: t,
63
+ onDismiss: s
64
+ }
65
+ ) : null;
66
+ }
67
+ export {
68
+ p as default
69
+ };
@@ -0,0 +1,443 @@
1
+ import { c as k, d as m, A as B, y as z, u as e, b as h, C as V, T as O, q as H, _ as ee, s as te, t as ae, v as re, S as ne, w as ie, B as N, f as le } from "./medassist-widget-main-CvBx4wsw.js";
2
+ import { A as se, b as oe, a as ce } from "./medassist-widget-avatar-CIkxqi_7.js";
3
+ import { C as de } from "./medassist-widget-check-CBkqbFAl.js";
4
+ import { M as F } from "./medassist-widget-map-pin-QqnPVlgB.js";
5
+ import { M as me } from "./medassist-widget-ChatMessages-CwUlThlh.js";
6
+ import { C as he, a as pe } from "./medassist-widget-chevron-right-DXVez3hJ.js";
7
+ const ue = [
8
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
9
+ ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
10
+ ], fe = k("arrow-right", ue);
11
+ const xe = [
12
+ ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
13
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
14
+ ], ge = k("clock", xe);
15
+ const ye = [
16
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
17
+ ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
18
+ ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
19
+ ], be = k("ellipsis", ye);
20
+ const ve = [
21
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
22
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
23
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
24
+ ], we = k("external-link", ve);
25
+ const Ne = [
26
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
27
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
28
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
29
+ ], ke = k("info", Ne);
30
+ const Ce = [
31
+ ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
32
+ ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
33
+ ["path", { d: "M2 5h12", key: "or177f" }],
34
+ ["path", { d: "M7 2h1", key: "1t2jsx" }],
35
+ ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
36
+ ["path", { d: "M14 18h6", key: "1m8k6r" }]
37
+ ], _e = k("languages", Ce);
38
+ function Me({
39
+ value: n,
40
+ onValueChange: a,
41
+ placeholder: c = "Select an option",
42
+ className: u,
43
+ triggerClassName: S,
44
+ contentClassName: C,
45
+ disabled: l = !1,
46
+ options: b = [],
47
+ size: L = "default",
48
+ icon: $
49
+ }) {
50
+ const [i, y] = m(!1), g = B(null), f = B(null), x = b.find((s) => s.value === n);
51
+ z(() => {
52
+ const s = (p) => {
53
+ i && p.key === "Escape" && (y(!1), f.current?.focus());
54
+ };
55
+ return document.addEventListener("keydown", s), () => {
56
+ document.removeEventListener("keydown", s);
57
+ };
58
+ }, [i]);
59
+ const v = (s) => {
60
+ a?.(s), y(!1), f.current?.focus();
61
+ }, _ = () => {
62
+ l || y(!i);
63
+ };
64
+ return /* @__PURE__ */ e("div", { className: h("relative w-full", u), children: [
65
+ /* @__PURE__ */ e(
66
+ "button",
67
+ {
68
+ ref: f,
69
+ type: "button",
70
+ onClick: _,
71
+ disabled: l,
72
+ className: h(
73
+ 'border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*="text-"])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 overflow-hidden',
74
+ L === "default" ? "min-h-9" : "min-h-8",
75
+ S
76
+ ),
77
+ "aria-expanded": i,
78
+ "aria-haspopup": "listbox",
79
+ children: [
80
+ $,
81
+ /* @__PURE__ */ e(
82
+ "span",
83
+ {
84
+ className: h(
85
+ "flex-1 text-left min-w-0 overflow-hidden break-words line-clamp-2",
86
+ !x && "text-muted-foreground"
87
+ ),
88
+ children: x ? x.label : c
89
+ }
90
+ ),
91
+ /* @__PURE__ */ e(
92
+ V,
93
+ {
94
+ className: h(
95
+ "size-4 opacity-50 pointer-events-none shrink-0 transition-transform duration-200",
96
+ i && "rotate-180"
97
+ )
98
+ }
99
+ )
100
+ ]
101
+ }
102
+ ),
103
+ i && /* @__PURE__ */ e(
104
+ "div",
105
+ {
106
+ ref: g,
107
+ className: h(
108
+ "bg-surface text-foreground animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 relative z-50 max-h-[136px] min-w-[8rem] w-full overflow-x-hidden overflow-y-auto overscroll-contain rounded-md shadow-md mt-1",
109
+ C
110
+ ),
111
+ role: "listbox",
112
+ children: /* @__PURE__ */ e("div", { className: "p-1", children: b.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-muted-foreground text-center", children: "No options available" }) : b.map((s) => {
113
+ const p = s.value === n;
114
+ return /* @__PURE__ */ e(
115
+ "div",
116
+ {
117
+ onClick: () => v(s.value),
118
+ className: h(
119
+ "relative flex w-full cursor-pointer items-center gap-1 rounded-sm py-2.5 px-3 text-sm outline-none select-none transition-colors duration-150",
120
+ "hover:bg-accent hover:text-accent-foreground",
121
+ "focus-visible:bg-accent focus-visible:text-accent-foreground",
122
+ "active:bg-accent/80",
123
+ p && "bg-accent/50 text-foreground",
124
+ l && "pointer-events-none opacity-50 cursor-not-allowed"
125
+ ),
126
+ role: "option",
127
+ "aria-selected": p,
128
+ tabIndex: l ? -1 : 0,
129
+ onKeyDown: (w) => {
130
+ (w.key === "Enter" || w.key === " ") && (w.preventDefault(), l || v(s.value));
131
+ },
132
+ children: [
133
+ /* @__PURE__ */ e("span", { className: "flex-1 text-left min-w-0 break-words line-clamp-2", children: s.label }),
134
+ p && /* @__PURE__ */ e("span", { className: "absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none", children: /* @__PURE__ */ e(de, { className: "size-4 text-foreground" }) })
135
+ ]
136
+ },
137
+ s.value
138
+ );
139
+ }) })
140
+ }
141
+ )
142
+ ] });
143
+ }
144
+ function Le({ doctor: n, doctorDetails: a, onSelect: c, disabled: u, isActive: S = !0 }) {
145
+ const C = O(() => {
146
+ if (a?.hospitals?.[0]?.hospital_id)
147
+ return a?.hospitals?.[0]?.hospital_id;
148
+ }, [a?.hospitals]), [l, b] = m(C), [L, $] = m(!1), [i, y] = m(null), [g, f] = m(null), [x, v] = m(0), [_, s] = m(!1), [p, w] = m(!1), [M, q] = m(!1), [R, T] = m(!1), [E, P] = m(!1), I = B(!1), A = B(null);
149
+ z(() => {
150
+ b(C);
151
+ }, [C]);
152
+ const r = n.availability ?? [], G = H(async () => {
153
+ if (!M && (w(!0), !r.length && c && a)) {
154
+ q(!0);
155
+ try {
156
+ await c({ ...n, hospital_id: l });
157
+ } finally {
158
+ q(!1);
159
+ }
160
+ }
161
+ }, [p, M, c, a, r.length, l]), K = H(
162
+ (t) => {
163
+ a && (b(t), y(null), f(null), v(0), I.current = !1, c?.({ ...n, hospital_id: t }));
164
+ },
165
+ [n, c, a]
166
+ );
167
+ z(() => {
168
+ S || w(!1);
169
+ }, [S]), z(() => {
170
+ if (!p || !r.length || I.current) return;
171
+ I.current = !0;
172
+ const t = n.preferred_date || r[0]?.date;
173
+ t && (y((d) => d ?? t), r.find((d) => d.date === t)?.slots?.length || c?.({ ...n, hospital_id: l, preferred_date: t }));
174
+ }, [r, p]);
175
+ const j = O(
176
+ () => r.find((t) => t.date === i)?.slots ?? [],
177
+ [r, i]
178
+ );
179
+ ee(() => {
180
+ const t = A.current;
181
+ t && (t.scrollTop = 0, T(t.scrollHeight > t.clientHeight + 2));
182
+ }, [i, j.length]);
183
+ const J = H(() => {
184
+ const t = A.current;
185
+ t && T(t.scrollTop + t.clientHeight < t.scrollHeight - 4);
186
+ }, []), Q = () => {
187
+ A.current?.scrollBy({ top: 120, behavior: "smooth" });
188
+ }, U = O(() => {
189
+ if (!r.length) return [];
190
+ const t = Math.min(x + 3, r.length);
191
+ return r.slice(x, t).map((o) => {
192
+ if (o.date)
193
+ return { ...o, ...te(o.date) };
194
+ });
195
+ }, [r, x]), W = x > 0, X = x < Math.max(0, (r || []).length - 3), Y = H(
196
+ async (t) => {
197
+ y(t), f(null);
198
+ const o = r.find((d) => d.date === t);
199
+ if (!(o?.slots?.length || Array.isArray(o?.slots) && o?.slots.length === 0)) {
200
+ $(!0);
201
+ try {
202
+ await c?.({ ...n, hospital_id: l, preferred_date: t });
203
+ } catch {
204
+ } finally {
205
+ $(!1);
206
+ }
207
+ }
208
+ },
209
+ [n, l, c, r]
210
+ ), Z = () => {
211
+ if (!g || !i || _) return;
212
+ s(!0);
213
+ const t = n.cta?.text;
214
+ c?.(
215
+ { ...n, hospital_id: l, preferred_date: i, preferred_slot_time: g },
216
+ `${t || `I want to book an appointment with Dr. ${a?.name}`} on ${i} at ${g}.`,
217
+ n.cta?.tool_result
218
+ );
219
+ };
220
+ return a ? /* @__PURE__ */ e(le, { className: "max-w-md h-full rounded-xl border border-black-200 dark:border-white-200 shadow-none p-0 bg-elicitationBg overflow-hidden", children: [
221
+ /* @__PURE__ */ e(ae, { className: "flex flex-row items-center gap-3 bg-primary/[20%] rounded-t-xl p-2 border-b border-border-subtle overflow-hidden", children: [
222
+ /* @__PURE__ */ e(se, { className: "h-12 w-12 ring-2 ring-primary/20 flex-shrink-0", children: [
223
+ a.profile_pic && /* @__PURE__ */ e(oe, { src: a.profile_pic, alt: `${a.name} profile photo`, crossOrigin: "anonymous" }),
224
+ /* @__PURE__ */ e(ce, { className: "bg-secondary text-primary", children: re(a.name) })
225
+ ] }),
226
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: [
227
+ /* @__PURE__ */ e("h3", { className: "font-bold text-slate-900 leading-tight", style: { fontSize: "0.95rem" }, children: [
228
+ /* @__PURE__ */ e("span", { children: a.name }),
229
+ a.profile_link && /* @__PURE__ */ e(
230
+ "a",
231
+ {
232
+ href: a.profile_link,
233
+ target: "_blank",
234
+ rel: "noreferrer",
235
+ "aria-label": "View profile",
236
+ className: "inline-block align-middle ml-2 text-primary hover:text-primary/70 transition-colors",
237
+ children: /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5 inline", "aria-hidden": !0 })
238
+ }
239
+ )
240
+ ] }),
241
+ /* @__PURE__ */ e(
242
+ "p",
243
+ {
244
+ className: "mt-0.5 text-xs text-slate-600 line-clamp-1 hover:line-clamp-none hover:whitespace-normal cursor-help",
245
+ title: `${a.specialty}${a.experience ? ` • ${a.experience}` : ""}`,
246
+ children: [
247
+ a.specialty,
248
+ a.experience && /* @__PURE__ */ e(ne, { children: [
249
+ " • ",
250
+ a.experience
251
+ ] })
252
+ ]
253
+ }
254
+ )
255
+ ] })
256
+ ] }),
257
+ /* @__PURE__ */ e(ie, { className: "px-3 py-2", children: [
258
+ /* @__PURE__ */ e("div", { className: "grid gap-1 pb-2 border-b border-border-subtle", children: [
259
+ a.timings && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
260
+ /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5 text-primary mt-0.5 flex-shrink-0", "aria-hidden": !0 }),
261
+ /* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.timings })
262
+ ] }),
263
+ a.languages && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 min-w-0", children: [
264
+ /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
265
+ /* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.languages })
266
+ ] }),
267
+ a.hospitals?.length > 1 && l ? /* @__PURE__ */ e(
268
+ Me,
269
+ {
270
+ options: a.hospitals.map((t) => ({ value: t.hospital_id, label: t.name || "" })),
271
+ placeholder: "Select Hospital",
272
+ disabled: u,
273
+ onValueChange: K,
274
+ value: l,
275
+ triggerClassName: "h-8 text-xs px-3 rounded-lg border-border text-primary font-medium",
276
+ icon: /* @__PURE__ */ e(F, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 })
277
+ }
278
+ ) : /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-0", children: [
279
+ /* @__PURE__ */ e(F, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
280
+ /* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.hospitals?.[0]?.name || "" })
281
+ ] }),
282
+ a.info && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
283
+ /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
284
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: [
285
+ /* @__PURE__ */ e(
286
+ "div",
287
+ {
288
+ className: h(
289
+ "text-text-secondary text-xs leading-snug prose prose-sm max-w-none prose-strong:font-semibold prose-p:my-0 break-words overflow-hidden",
290
+ !E && "line-clamp-1"
291
+ ),
292
+ children: /* @__PURE__ */ e(me, { children: a.info })
293
+ }
294
+ ),
295
+ /* @__PURE__ */ e(
296
+ "button",
297
+ {
298
+ type: "button",
299
+ onClick: () => P((t) => !t),
300
+ "aria-expanded": E,
301
+ className: "mt-0.5 flex items-center gap-1 text-[11px] font-semibold text-primary hover:text-primary/80 transition-colors",
302
+ children: [
303
+ /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
304
+ E ? "View less" : "View more"
305
+ ]
306
+ }
307
+ )
308
+ ] })
309
+ ] })
310
+ ] }),
311
+ p ? M ? /* @__PURE__ */ e("p", { className: "pt-3 text-sm text-text-secondary text-center", children: "Loading..." }) : r.length > 0 ? /* @__PURE__ */ e("div", { className: "pt-3", children: [
312
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
313
+ /* @__PURE__ */ e(
314
+ N,
315
+ {
316
+ type: "button",
317
+ variant: "outline",
318
+ size: "icon",
319
+ onClick: () => {
320
+ v((t) => Math.max(0, t - 3)), f(null);
321
+ },
322
+ disabled: u || !W,
323
+ "aria-label": "Previous 3 days",
324
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-surface-secondary disabled:opacity-50",
325
+ children: /* @__PURE__ */ e(he, { className: "h-4 w-4" })
326
+ }
327
+ ),
328
+ /* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children: U.map((t, o) => {
329
+ if (!t || !t.date) return null;
330
+ const d = i === t.date, D = (t?.slots || []).length > 0;
331
+ return /* @__PURE__ */ e(
332
+ N,
333
+ {
334
+ type: "button",
335
+ variant: "outline",
336
+ onClick: () => t.date && Y(t.date),
337
+ disabled: u,
338
+ "aria-current": d ? "date" : void 0,
339
+ className: h(
340
+ "flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",
341
+ d ? "border-primary border-2 ring-2 ring-primary/20 bg-primary/[20%] shadow-sm hover:text-accent-foreground" : D ? "border-primary/30 bg-elicitationBg hover:bg-primary/10 hover:text-accent-foreground hover:border-primary/40" : "border-border bg-elicitationBg opacity-60 hover:bg-primary/10 hover:text-accent-foreground hover:border-primary/30"
342
+ ),
343
+ children: [
344
+ /* @__PURE__ */ e("span", { className: h("text-[10px] tracking-wide w-full text-center font-medium"), children: t.weekday }),
345
+ /* @__PURE__ */ e("span", { className: h("text-xs font-bold w-full text-center"), children: t.dayNum })
346
+ ]
347
+ },
348
+ `${t.date}-${o}`
349
+ );
350
+ }) }),
351
+ /* @__PURE__ */ e(
352
+ N,
353
+ {
354
+ type: "button",
355
+ variant: "outline",
356
+ size: "icon",
357
+ onClick: () => {
358
+ v((t) => Math.min(Math.max(0, r.length - 3), t + 3)), f(null);
359
+ },
360
+ disabled: u || !X,
361
+ "aria-label": "Next 3 days",
362
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-surface-secondary disabled:opacity-50",
363
+ children: /* @__PURE__ */ e(pe, { className: "h-4 w-4" })
364
+ }
365
+ )
366
+ ] }),
367
+ i && /* @__PURE__ */ e("div", { className: "mt-2", children: j.length > 0 ? /* @__PURE__ */ e("div", { className: "relative", children: [
368
+ /* @__PURE__ */ e(
369
+ "div",
370
+ {
371
+ ref: A,
372
+ onScroll: J,
373
+ className: "grid grid-cols-3 gap-2 overflow-y-auto overscroll-contain",
374
+ style: { maxHeight: "108px" },
375
+ children: j.map((t, o) => {
376
+ if (!t) return null;
377
+ const d = g === t;
378
+ return /* @__PURE__ */ e(
379
+ N,
380
+ {
381
+ type: "button",
382
+ variant: "outline",
383
+ onClick: () => f(t),
384
+ "aria-pressed": d,
385
+ disabled: u,
386
+ className: h(
387
+ "h-9 rounded-lg px-2 text-xs font-medium transition-all",
388
+ d ? "border-primary bg-primary/20 text-primary shadow-sm hover:bg-primary/10" : "border-border bg-elicitationBg text-text-primary hover:bg-primary/10 hover:border-primary/30"
389
+ ),
390
+ children: /* @__PURE__ */ e("span", { children: t })
391
+ },
392
+ t || `slot-${o}`
393
+ );
394
+ })
395
+ }
396
+ ),
397
+ R && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-elicitationBg via-elicitationBg to-transparent pointer-events-none flex items-end justify-center pb-1", children: /* @__PURE__ */ e(
398
+ "button",
399
+ {
400
+ type: "button",
401
+ onClick: Q,
402
+ className: "pointer-events-auto flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80 transition-colors",
403
+ children: [
404
+ /* @__PURE__ */ e(V, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
405
+ "More slots"
406
+ ]
407
+ }
408
+ ) })
409
+ ] }) : L ? /* @__PURE__ */ e("p", { className: "text-sm text-text-secondary px-1", children: "Fetching slots..." }) : /* @__PURE__ */ e("p", { className: "text-sm text-text-secondary px-1", children: "No slots available." }) }),
410
+ /* @__PURE__ */ e(
411
+ N,
412
+ {
413
+ type: "button",
414
+ onClick: Z,
415
+ disabled: !g || u || _,
416
+ "aria-disabled": !g || _,
417
+ className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${R ? "" : " mt-2"}`,
418
+ children: [
419
+ n.cta?.title || "Book appointment",
420
+ /* @__PURE__ */ e(fe, { className: "h-4 w-4", "aria-hidden": !0 })
421
+ ]
422
+ }
423
+ )
424
+ ] }) : /* @__PURE__ */ e("p", { className: "pt-3 text-sm text-text-secondary text-center", children: "No slots available." }) : /* @__PURE__ */ e("div", { className: "pt-3", children: /* @__PURE__ */ e(
425
+ N,
426
+ {
427
+ type: "button",
428
+ variant: "outline",
429
+ onClick: G,
430
+ disabled: u || M,
431
+ className: "w-full h-8 gap-1.5 text-xs border-primary/40 text-primary hover:bg-primary/10 disabled:opacity-60 font-medium rounded-lg",
432
+ children: [
433
+ M ? "Loading..." : "Show available slots",
434
+ /* @__PURE__ */ e(V, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
435
+ ]
436
+ }
437
+ ) })
438
+ ] })
439
+ ] }) : null;
440
+ }
441
+ export {
442
+ Le as DoctorCard
443
+ };