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