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