@eka-care/medassist-widget 0.1.83 → 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/README.md +2 -2
- package/dist/medassist-widget-CardList-BR2hjo_A.js +222 -0
- package/dist/medassist-widget-DoctorCard-BdLitZW0.js +460 -0
- package/dist/medassist-widget-FocusCarousel-BsLIZftX.js +90 -0
- package/dist/medassist-widget-MediaCard-DRUToQV3.js +85 -0
- package/dist/medassist-widget-MultiSelect-BnExX-Ty.js +414 -0
- package/dist/medassist-widget-VoiceAgentScreen-BK0p37RC.js +419 -0
- package/dist/medassist-widget-check-BaHLRs-2.js +5 -0
- package/dist/medassist-widget-chevron-right-CKYbGWbY.js +7 -0
- package/dist/medassist-widget-html2canvas.esm-CphxV6YW.js +4835 -0
- package/dist/medassist-widget-map-pin-Bx-5lPdC.js +14 -0
- package/dist/medassist-widget.css +1 -1
- package/dist/medassist-widget.js +12995 -67
- package/package.json +13 -7
|
@@ -0,0 +1,460 @@
|
|
|
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
|
+
import { C as pe } from "./medassist-widget-check-BaHLRs-2.js";
|
|
3
|
+
import { M as K } from "./medassist-widget-map-pin-Bx-5lPdC.js";
|
|
4
|
+
import { C as ue, a as fe } from "./medassist-widget-chevron-right-CKYbGWbY.js";
|
|
5
|
+
const xe = [
|
|
6
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
7
|
+
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
8
|
+
], J = _("arrow-right", xe);
|
|
9
|
+
const ge = [
|
|
10
|
+
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
11
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
12
|
+
], ye = _("clock", ge);
|
|
13
|
+
const be = [
|
|
14
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
15
|
+
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
16
|
+
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
17
|
+
], ve = _("ellipsis", be);
|
|
18
|
+
const we = [
|
|
19
|
+
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
20
|
+
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
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
|
+
], Ne = _("external-link", we);
|
|
23
|
+
const ke = [
|
|
24
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
25
|
+
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
26
|
+
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
27
|
+
], Ce = _("info", ke);
|
|
28
|
+
const _e = [
|
|
29
|
+
["path", { d: "m5 8 6 6", key: "1wu5hv" }],
|
|
30
|
+
["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
|
|
31
|
+
["path", { d: "M2 5h12", key: "or177f" }],
|
|
32
|
+
["path", { d: "M7 2h1", key: "1t2jsx" }],
|
|
33
|
+
["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
|
|
34
|
+
["path", { d: "M14 18h6", key: "1m8k6r" }]
|
|
35
|
+
], Me = _("languages", _e);
|
|
36
|
+
function Se({
|
|
37
|
+
value: l,
|
|
38
|
+
onValueChange: a,
|
|
39
|
+
placeholder: d = "Select an option",
|
|
40
|
+
className: u,
|
|
41
|
+
triggerClassName: $,
|
|
42
|
+
contentClassName: M,
|
|
43
|
+
disabled: s = !1,
|
|
44
|
+
options: w = [],
|
|
45
|
+
size: I = "default",
|
|
46
|
+
icon: B
|
|
47
|
+
}) {
|
|
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
|
+
};
|
|
53
|
+
return document.addEventListener("keydown", o), () => {
|
|
54
|
+
document.removeEventListener("keydown", o);
|
|
55
|
+
};
|
|
56
|
+
}, [n]);
|
|
57
|
+
const N = (o) => {
|
|
58
|
+
a?.(o), y(!1), x.current?.focus();
|
|
59
|
+
}, b = () => {
|
|
60
|
+
s || y(!n);
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ e("div", { className: p("relative w-full", u), children: [
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
ref: x,
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: b,
|
|
69
|
+
disabled: s,
|
|
70
|
+
className: p(
|
|
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
|
+
I === "default" ? "min-h-9" : "min-h-8",
|
|
73
|
+
$
|
|
74
|
+
),
|
|
75
|
+
"aria-expanded": n,
|
|
76
|
+
"aria-haspopup": "listbox",
|
|
77
|
+
children: [
|
|
78
|
+
B,
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
className: p(
|
|
83
|
+
"flex-1 text-left min-w-0 overflow-hidden break-words line-clamp-2",
|
|
84
|
+
!g && "text-muted-foreground"
|
|
85
|
+
),
|
|
86
|
+
children: g ? g.label : d
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
R,
|
|
91
|
+
{
|
|
92
|
+
className: p(
|
|
93
|
+
"size-4 opacity-50 pointer-events-none shrink-0 transition-transform duration-200",
|
|
94
|
+
n && "rotate-180"
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
n && /* @__PURE__ */ e(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
ref: m,
|
|
105
|
+
className: p(
|
|
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
|
+
M
|
|
108
|
+
),
|
|
109
|
+
role: "listbox",
|
|
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
|
+
return /* @__PURE__ */ e(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
onClick: () => N(o.value),
|
|
116
|
+
className: p(
|
|
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
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
119
|
+
"focus-visible:bg-accent focus-visible:text-accent-foreground",
|
|
120
|
+
"active:bg-accent/80",
|
|
121
|
+
f && "bg-accent/50 text-foreground",
|
|
122
|
+
s && "pointer-events-none opacity-50 cursor-not-allowed"
|
|
123
|
+
),
|
|
124
|
+
role: "option",
|
|
125
|
+
"aria-selected": f,
|
|
126
|
+
tabIndex: s ? -1 : 0,
|
|
127
|
+
onKeyDown: (k) => {
|
|
128
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), s || N(o.value));
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ e("span", { className: "flex-1 text-left min-w-0 break-words line-clamp-2", children: o.label }),
|
|
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
|
+
]
|
|
134
|
+
},
|
|
135
|
+
o.value
|
|
136
|
+
);
|
|
137
|
+
}) })
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] });
|
|
141
|
+
}
|
|
142
|
+
function ze({ doctor: l, doctorDetails: a, onSelect: d, disabled: u, isActive: $ = !0 }) {
|
|
143
|
+
const M = A(() => {
|
|
144
|
+
if (a?.hospitals?.[0]?.hospital_id)
|
|
145
|
+
return a?.hospitals?.[0]?.hospital_id;
|
|
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
|
+
try {
|
|
154
|
+
await d({ ...l, hospital_id: s });
|
|
155
|
+
} finally {
|
|
156
|
+
T(!1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, [f, S, d, a, r.length, s]), W = z(
|
|
160
|
+
(t) => {
|
|
161
|
+
a && (w(t), y(null), x(null), N(0), V.current = !1, d?.({ ...l, hospital_id: t }));
|
|
162
|
+
},
|
|
163
|
+
[l, d, a]
|
|
164
|
+
);
|
|
165
|
+
E(() => {
|
|
166
|
+
$ || k(!1);
|
|
167
|
+
}, [$]), E(() => {
|
|
168
|
+
if (!f || !r.length || V.current) return;
|
|
169
|
+
V.current = !0;
|
|
170
|
+
const t = l.preferred_date || r[0]?.date;
|
|
171
|
+
t && (y((c) => c ?? t), r.find((c) => c.date === t)?.slots?.length || d?.({ ...l, hospital_id: s, preferred_date: t }));
|
|
172
|
+
}, [r, f]);
|
|
173
|
+
const q = A(
|
|
174
|
+
() => r.find((t) => t.date === n)?.slots ?? [],
|
|
175
|
+
[r, n]
|
|
176
|
+
);
|
|
177
|
+
re(() => {
|
|
178
|
+
const t = H.current;
|
|
179
|
+
t && (t.scrollTop = 0, F(t.scrollHeight > t.clientHeight + 2));
|
|
180
|
+
}, [n, q.length]);
|
|
181
|
+
const X = z(() => {
|
|
182
|
+
const t = H.current;
|
|
183
|
+
t && F(t.scrollTop + t.clientHeight < t.scrollHeight - 4);
|
|
184
|
+
}, []), Y = () => {
|
|
185
|
+
H.current?.scrollBy({ top: 120, behavior: "smooth" });
|
|
186
|
+
}, Z = A(() => {
|
|
187
|
+
if (!r.length) return [];
|
|
188
|
+
const t = Math.min(g + 3, r.length);
|
|
189
|
+
return r.slice(g, t).map((i) => {
|
|
190
|
+
if (i.date)
|
|
191
|
+
return { ...i, ...ne(i.date) };
|
|
192
|
+
});
|
|
193
|
+
}, [r, g]), D = g > 0, ee = g < Math.max(0, (r || []).length - 3), te = z(
|
|
194
|
+
async (t) => {
|
|
195
|
+
y(t), x(null);
|
|
196
|
+
const i = r.find((c) => c.date === t);
|
|
197
|
+
if (!(i?.slots?.length || Array.isArray(i?.slots) && i?.slots.length === 0)) {
|
|
198
|
+
B(!0);
|
|
199
|
+
try {
|
|
200
|
+
await d?.({ ...l, hospital_id: s, preferred_date: t });
|
|
201
|
+
} catch {
|
|
202
|
+
} finally {
|
|
203
|
+
B(!1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
[l, s, d, r]
|
|
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;
|
|
212
|
+
o(!0);
|
|
213
|
+
const c = n && m ? ` on ${n} at ${m}.` : "";
|
|
214
|
+
d?.(
|
|
215
|
+
{ ...l, hospital_id: s, preferred_date: n ?? void 0, preferred_slot_time: m ?? void 0 },
|
|
216
|
+
`${t || `I want to book an appointment with Dr. ${a?.name}`}${c}`,
|
|
217
|
+
C?.tool_result,
|
|
218
|
+
!i
|
|
219
|
+
);
|
|
220
|
+
};
|
|
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: [
|
|
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) })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: [
|
|
228
|
+
/* @__PURE__ */ e("h3", { className: "font-bold text-slate-900 leading-tight", style: { fontSize: "0.95rem" }, children: [
|
|
229
|
+
/* @__PURE__ */ e("span", { children: a.name }),
|
|
230
|
+
a.profile_link && /* @__PURE__ */ e(
|
|
231
|
+
"a",
|
|
232
|
+
{
|
|
233
|
+
href: a.profile_link,
|
|
234
|
+
target: "_blank",
|
|
235
|
+
rel: "noreferrer",
|
|
236
|
+
"aria-label": "View profile",
|
|
237
|
+
className: "inline-block align-middle ml-2 text-primary hover:text-primary/70 transition-colors",
|
|
238
|
+
children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5 inline", "aria-hidden": !0 })
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ e(
|
|
243
|
+
"p",
|
|
244
|
+
{
|
|
245
|
+
className: "mt-0.5 text-xs text-slate-600 line-clamp-1 hover:line-clamp-none hover:whitespace-normal cursor-help",
|
|
246
|
+
title: `${a.specialty}${a.experience ? ` • ${a.experience}` : ""}`,
|
|
247
|
+
children: [
|
|
248
|
+
a.specialty,
|
|
249
|
+
a.experience && /* @__PURE__ */ e(G, { children: [
|
|
250
|
+
" • ",
|
|
251
|
+
a.experience
|
|
252
|
+
] })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] })
|
|
257
|
+
] }),
|
|
258
|
+
/* @__PURE__ */ e(de, { className: "px-3 py-2", children: [
|
|
259
|
+
/* @__PURE__ */ e("div", { className: "grid gap-1 pb-2 border-b border-border-subtle", children: [
|
|
260
|
+
a.timings && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
261
|
+
/* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5 text-primary mt-0.5 flex-shrink-0", "aria-hidden": !0 }),
|
|
262
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.timings })
|
|
263
|
+
] }),
|
|
264
|
+
a.languages && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
265
|
+
/* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
266
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.languages })
|
|
267
|
+
] }),
|
|
268
|
+
a.hospitals?.length > 1 && s ? /* @__PURE__ */ e(
|
|
269
|
+
Se,
|
|
270
|
+
{
|
|
271
|
+
options: a.hospitals.map((t) => ({ value: t.hospital_id, label: t.name || "" })),
|
|
272
|
+
placeholder: "Select Hospital",
|
|
273
|
+
disabled: u,
|
|
274
|
+
onValueChange: W,
|
|
275
|
+
value: s,
|
|
276
|
+
triggerClassName: "h-8 text-xs px-3 rounded-lg border-border text-primary font-medium",
|
|
277
|
+
icon: /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 })
|
|
278
|
+
}
|
|
279
|
+
) : /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
280
|
+
/* @__PURE__ */ e(K, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
281
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.hospitals?.[0]?.name || "" })
|
|
282
|
+
] }),
|
|
283
|
+
a.info && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
284
|
+
/* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
285
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: [
|
|
286
|
+
/* @__PURE__ */ e(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
className: p(
|
|
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",
|
|
291
|
+
!O && "line-clamp-1"
|
|
292
|
+
),
|
|
293
|
+
children: /* @__PURE__ */ e(me, { children: a.info })
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
/* @__PURE__ */ e(
|
|
297
|
+
"button",
|
|
298
|
+
{
|
|
299
|
+
type: "button",
|
|
300
|
+
onClick: () => Q((t) => !t),
|
|
301
|
+
"aria-expanded": O,
|
|
302
|
+
className: "mt-0.5 flex items-center gap-1 text-[11px] font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
305
|
+
O ? "View less" : "View more"
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
] })
|
|
310
|
+
] })
|
|
311
|
+
] }),
|
|
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: [
|
|
313
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
|
|
314
|
+
/* @__PURE__ */ e(
|
|
315
|
+
v,
|
|
316
|
+
{
|
|
317
|
+
type: "button",
|
|
318
|
+
variant: "outline",
|
|
319
|
+
size: "icon",
|
|
320
|
+
onClick: () => {
|
|
321
|
+
N((t) => Math.max(0, t - 3)), x(null);
|
|
322
|
+
},
|
|
323
|
+
disabled: u || !D,
|
|
324
|
+
"aria-label": "Previous 3 days",
|
|
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",
|
|
326
|
+
children: /* @__PURE__ */ e(ue, { className: "h-4 w-4" })
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
/* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children: Z.map((t, i) => {
|
|
330
|
+
if (!t || !t.date) return null;
|
|
331
|
+
const c = n === t.date, ae = (t?.slots || []).length > 0;
|
|
332
|
+
return /* @__PURE__ */ e(
|
|
333
|
+
v,
|
|
334
|
+
{
|
|
335
|
+
type: "button",
|
|
336
|
+
variant: "outline",
|
|
337
|
+
onClick: () => t.date && te(t.date),
|
|
338
|
+
disabled: u,
|
|
339
|
+
"aria-current": c ? "date" : void 0,
|
|
340
|
+
className: p(
|
|
341
|
+
"flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",
|
|
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"
|
|
343
|
+
),
|
|
344
|
+
children: [
|
|
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 })
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
`${t.date}-${i}`
|
|
350
|
+
);
|
|
351
|
+
}) }),
|
|
352
|
+
/* @__PURE__ */ e(
|
|
353
|
+
v,
|
|
354
|
+
{
|
|
355
|
+
type: "button",
|
|
356
|
+
variant: "outline",
|
|
357
|
+
size: "icon",
|
|
358
|
+
onClick: () => {
|
|
359
|
+
N((t) => Math.min(Math.max(0, r.length - 3), t + 3)), x(null);
|
|
360
|
+
},
|
|
361
|
+
disabled: u || !ee,
|
|
362
|
+
"aria-label": "Next 3 days",
|
|
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",
|
|
364
|
+
children: /* @__PURE__ */ e(fe, { className: "h-4 w-4" })
|
|
365
|
+
}
|
|
366
|
+
)
|
|
367
|
+
] }),
|
|
368
|
+
n && /* @__PURE__ */ e("div", { className: "mt-2", children: q.length > 0 ? /* @__PURE__ */ e("div", { className: "relative", children: [
|
|
369
|
+
/* @__PURE__ */ e(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
ref: H,
|
|
373
|
+
onScroll: X,
|
|
374
|
+
className: "grid grid-cols-3 gap-2 overflow-y-auto overscroll-contain",
|
|
375
|
+
style: { maxHeight: "108px" },
|
|
376
|
+
children: q.map((t, i) => {
|
|
377
|
+
if (!t) return null;
|
|
378
|
+
const c = m === t;
|
|
379
|
+
return /* @__PURE__ */ e(
|
|
380
|
+
v,
|
|
381
|
+
{
|
|
382
|
+
type: "button",
|
|
383
|
+
variant: "outline",
|
|
384
|
+
onClick: () => x(t),
|
|
385
|
+
"aria-pressed": c,
|
|
386
|
+
disabled: u,
|
|
387
|
+
className: p(
|
|
388
|
+
"h-9 rounded-lg px-2 text-xs font-medium transition-all",
|
|
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"
|
|
390
|
+
),
|
|
391
|
+
children: /* @__PURE__ */ e("span", { children: t })
|
|
392
|
+
},
|
|
393
|
+
t || `slot-${i}`
|
|
394
|
+
);
|
|
395
|
+
})
|
|
396
|
+
}
|
|
397
|
+
),
|
|
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(
|
|
399
|
+
"button",
|
|
400
|
+
{
|
|
401
|
+
type: "button",
|
|
402
|
+
onClick: Y,
|
|
403
|
+
className: "pointer-events-auto flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ e(R, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
406
|
+
"More slots"
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
) })
|
|
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." }) }),
|
|
411
|
+
/* @__PURE__ */ e(
|
|
412
|
+
v,
|
|
413
|
+
{
|
|
414
|
+
type: "button",
|
|
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"}`,
|
|
419
|
+
children: [
|
|
420
|
+
C?.title || "Book appointment",
|
|
421
|
+
/* @__PURE__ */ e(J, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
)
|
|
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,
|
|
443
|
+
{
|
|
444
|
+
type: "button",
|
|
445
|
+
variant: "outline",
|
|
446
|
+
onClick: U,
|
|
447
|
+
disabled: u || S,
|
|
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",
|
|
449
|
+
children: [
|
|
450
|
+
S ? "Loading..." : "Show available slots",
|
|
451
|
+
/* @__PURE__ */ e(R, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
452
|
+
]
|
|
453
|
+
}
|
|
454
|
+
) })
|
|
455
|
+
] })
|
|
456
|
+
] }) : null;
|
|
457
|
+
}
|
|
458
|
+
export {
|
|
459
|
+
ze as DoctorCard
|
|
460
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { d as l, A as d, y as N, _ as R, u as r, i as z } from "./medassist-widget.js";
|
|
2
|
+
import { C as A, a as M } from "./medassist-widget-chevron-right-CKYbGWbY.js";
|
|
3
|
+
const v = 12, T = 0.76, I = 3;
|
|
4
|
+
function k({ count: s, renderItem: h, className: u }) {
|
|
5
|
+
const [n, x] = l(0), [i, m] = l(0), [y, g] = l(() => Math.min(I, s)), b = d(null), f = d(0), p = d(0);
|
|
6
|
+
if (N(() => {
|
|
7
|
+
g((t) => Math.max(t, Math.min(n + 2, s)));
|
|
8
|
+
}, [n, s]), R(() => {
|
|
9
|
+
const t = b.current;
|
|
10
|
+
if (!t) return;
|
|
11
|
+
m(t.clientWidth);
|
|
12
|
+
const e = new ResizeObserver(([a]) => m(a.contentRect.width));
|
|
13
|
+
return e.observe(t), () => e.disconnect();
|
|
14
|
+
}, []), s === 0) return null;
|
|
15
|
+
const o = (t) => x(Math.max(0, Math.min(s - 1, t)));
|
|
16
|
+
if (s === 1)
|
|
17
|
+
return /* @__PURE__ */ r("div", { className: u ?? "mt-3", children: h(0, !0) });
|
|
18
|
+
const c = i * T, C = (i - c) / 2, w = i > 0 ? C - n * (c + v) : 0;
|
|
19
|
+
return /* @__PURE__ */ r("div", { ref: b, className: z("mt-3 w-full", u), children: i > 0 && /* Relative wrapper so buttons sit outside overflow but share the same stacking context */
|
|
20
|
+
/* @__PURE__ */ r("div", { className: "relative w-full", children: [
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: "w-full overflow-hidden py-3",
|
|
25
|
+
onTouchStart: (t) => {
|
|
26
|
+
f.current = t.touches[0].clientX, p.current = t.touches[0].clientY;
|
|
27
|
+
},
|
|
28
|
+
onTouchEnd: (t) => {
|
|
29
|
+
const e = t.changedTouches[0].clientX - f.current, a = t.changedTouches[0].clientY - p.current;
|
|
30
|
+
Math.abs(e) > Math.abs(a) && Math.abs(e) > 50 && o(n + (e < 0 ? 1 : -1));
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ r(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "flex items-stretch",
|
|
36
|
+
style: {
|
|
37
|
+
transform: `translateX(${w}px)`,
|
|
38
|
+
transition: "transform 400ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
39
|
+
gap: `${v}px`
|
|
40
|
+
},
|
|
41
|
+
"aria-live": "polite",
|
|
42
|
+
children: Array.from({ length: y }, (t, e) => {
|
|
43
|
+
const a = e === n;
|
|
44
|
+
return /* @__PURE__ */ r(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
"aria-hidden": !a,
|
|
48
|
+
style: {
|
|
49
|
+
flex: `0 0 ${c}px`,
|
|
50
|
+
position: "relative",
|
|
51
|
+
opacity: a ? 1 : 0.6,
|
|
52
|
+
transform: a ? "scale(1.05)" : "scale(0.9)",
|
|
53
|
+
zIndex: a ? 20 : 10,
|
|
54
|
+
transition: "all 400ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
55
|
+
borderRadius: 12
|
|
56
|
+
},
|
|
57
|
+
children: h(e, a)
|
|
58
|
+
},
|
|
59
|
+
e
|
|
60
|
+
);
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
n > 0 && /* @__PURE__ */ r(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
"aria-label": "Previous",
|
|
71
|
+
onClick: () => o(n - 1),
|
|
72
|
+
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 h-10 w-10 p-2 flex items-center justify-center rounded-full bg-background/90 shadow-md border border-primary text-primary hover:bg-muted transition-colors",
|
|
73
|
+
children: /* @__PURE__ */ r(A, { size: 18 })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
n < s - 1 && /* @__PURE__ */ r(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
"aria-label": "Next",
|
|
81
|
+
onClick: () => o(n + 1),
|
|
82
|
+
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 h-10 w-10 p-2 flex items-center justify-center rounded-full bg-background/90 shadow-md border border-primary text-primary hover:bg-muted transition-colors",
|
|
83
|
+
children: /* @__PURE__ */ r(M, { size: 18 })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }) });
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
k as FocusCarousel
|
|
90
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { c as m, A as u, u as e, s as h, p as f, S as p, B as g } from "./medassist-widget.js";
|
|
2
|
+
const x = [
|
|
3
|
+
[
|
|
4
|
+
"path",
|
|
5
|
+
{
|
|
6
|
+
d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
|
|
7
|
+
key: "18u6gg"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
11
|
+
], w = m("camera", x);
|
|
12
|
+
const b = [
|
|
13
|
+
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
14
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
15
|
+
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
16
|
+
], v = m("download", b);
|
|
17
|
+
function i(a) {
|
|
18
|
+
return a.toLowerCase().endsWith(".pdf");
|
|
19
|
+
}
|
|
20
|
+
function y(a) {
|
|
21
|
+
const n = document?.createElement("a");
|
|
22
|
+
n.href = a, n.download = a.split("/").pop() ?? "download.pdf", n.target = "_blank", n.click(), document?.body?.removeChild(n);
|
|
23
|
+
}
|
|
24
|
+
async function N(a) {
|
|
25
|
+
if (!a.current) return;
|
|
26
|
+
const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
|
|
27
|
+
t.href = o.toDataURL("image/png"), t.download = "card.png", t.click();
|
|
28
|
+
}
|
|
29
|
+
async function k(a) {
|
|
30
|
+
if (!a.current) return;
|
|
31
|
+
const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
|
|
32
|
+
t.href = o.toDataURL("image/png"), t.download = `screenshot-${Date.now()}.png`, t.click();
|
|
33
|
+
}
|
|
34
|
+
function _({ card: a }) {
|
|
35
|
+
const { title: n, description: o, tags_text: t, banner_text: l, action: c, link: r } = a, s = u(null), d = r && !i(r);
|
|
36
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
h,
|
|
39
|
+
{
|
|
40
|
+
ref: s,
|
|
41
|
+
className: "overflow-hidden rounded-xl border border-border bg-elicitationBg text-card-foreground shadow-sm",
|
|
42
|
+
children: /* @__PURE__ */ e(f, { className: "p-3 space-y-2", children: [
|
|
43
|
+
/* @__PURE__ */ e("div", { className: `flex items-start gap-3 ${d ? "justify-between" : "justify-center"}`, children: [
|
|
44
|
+
/* @__PURE__ */ e("div", { className: `space-y-2 ${d ? "min-w-0 flex-1" : "flex flex-col items-center"}`, children: [
|
|
45
|
+
n && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-sm font-semibold bg-primary text-primary-foreground", children: n }),
|
|
46
|
+
o && /* @__PURE__ */ e("p", { className: `text-sm text-foreground leading-snug ${d ? "" : "text-center"}`, children: o }),
|
|
47
|
+
l && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-xs font-semibold bg-green-600 text-white", children: l })
|
|
48
|
+
] }),
|
|
49
|
+
d && /* @__PURE__ */ e("div", { className: "shrink-0 h-24 w-24 rounded-lg overflow-hidden border border-border", children: /* @__PURE__ */ e(
|
|
50
|
+
"img",
|
|
51
|
+
{
|
|
52
|
+
src: r,
|
|
53
|
+
alt: n ?? "media",
|
|
54
|
+
className: "h-full w-full object-cover"
|
|
55
|
+
}
|
|
56
|
+
) })
|
|
57
|
+
] }),
|
|
58
|
+
t && /* @__PURE__ */ e(p, { children: [
|
|
59
|
+
/* @__PURE__ */ e("div", { className: "border-t border-border" }),
|
|
60
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t })
|
|
61
|
+
] })
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
c && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(
|
|
66
|
+
g,
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
variant: "outline",
|
|
70
|
+
size: "sm",
|
|
71
|
+
className: "rounded-md px-5 gap-1.5",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
c === "screenshot" ? k(s) : c === "download" && (r && i(r) ? y(r) : N(s));
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
c === "screenshot" ? /* @__PURE__ */ e(w, { className: "h-4 w-4" }) : /* @__PURE__ */ e(v, { className: "h-4 w-4" }),
|
|
77
|
+
c === "screenshot" ? "Screenshot" : "Download"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
_ as MediaCard
|
|
85
|
+
};
|