@alfadocs/ui-kit 1.136.0 → 1.137.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.
Files changed (66) hide show
  1. package/dist/_chunks/appointment-details-panel.history-DrIMDQYf.js +314 -0
  2. package/dist/_chunks/appointment-details-panel.identity-C20Y9xNC.js +223 -0
  3. package/dist/_chunks/calendar-appointment-editor-dialog-D0n_bVsT.js +5518 -0
  4. package/dist/_chunks/calendar-editor-discard-host-1UfmMOEb.js +1336 -0
  5. package/dist/_chunks/calendar-editor-guard-9fShhNIA.js +31 -0
  6. package/dist/_chunks/calendar-waiting-list-panel-Ckd6tSeu.js +981 -0
  7. package/dist/_chunks/calendar-workspace.model-DrOoxY1b.js +1557 -0
  8. package/dist/_chunks/calendar.sheets-Datc0-IT.js +4585 -0
  9. package/dist/_chunks/color-picker-CC8ZfntU.js +582 -0
  10. package/dist/_chunks/{document-preview-DWlejd8A.js → document-preview-CirR3C_m.js} +2 -2
  11. package/dist/_chunks/{fiscal-code-input-BBvU7sAo.js → fiscal-code-input-DZlpaMGg.js} +2 -2
  12. package/dist/_chunks/{iban-input-DuTwKok5.js → iban-input-CdSLRzQN.js} +2 -2
  13. package/dist/_chunks/list-todo-KWvUhmT_.js +33 -0
  14. package/dist/_chunks/{notes-panel-BvjAo4RQ.js → notes-panel-DsEKNtsw.js} +2 -2
  15. package/dist/_chunks/palettes-CKVXYTzo.js +172 -0
  16. package/dist/_chunks/{patient-account-settings-Bmfeclpd.js → patient-account-settings-COybehKx.js} +2 -2
  17. package/dist/_chunks/{patient-check-in-resume-CYZ-SvsF.js → patient-check-in-resume-DZnyYDKH.js} +3 -3
  18. package/dist/_chunks/{patient-details-9eh9cNy7.js → patient-details-Dv7EiTCo.js} +2 -2
  19. package/dist/_chunks/{patient-field-row-B782eT0C.js → patient-field-row-DuHWGlLz.js} +2 -2
  20. package/dist/_chunks/patient-picker-BZJuOgMw.js +173 -0
  21. package/dist/_chunks/{patient-summary-card-K9zaMl1O.js → patient-summary-card-D-cDzOim.js} +2 -2
  22. package/dist/_chunks/{portal-details-DCIiGkHA.js → portal-details-DdzvroYP.js} +2 -2
  23. package/dist/_chunks/{portal-documents-DVKj6Sco.js → portal-documents-CNmoYWFc.js} +2 -2
  24. package/dist/_chunks/{privacy-mask-C19dJFMk.js → privacy-mask-C2ZLKrMh.js} +5 -5
  25. package/dist/_chunks/{rich-text-editor-DjHL1b3E.js → rich-text-editor-C48omVjq.js} +2 -2
  26. package/dist/_chunks/task-editor-wKbFbGqW.js +1093 -0
  27. package/dist/_chunks/use-appointment-details-read-jGkJalX8.js +1966 -0
  28. package/dist/agent-catalog.json +1 -1
  29. package/dist/appointment-editor-panel/index.js +100 -0
  30. package/dist/booking-tools-data/index.js +82 -0
  31. package/dist/browser-support.js +1 -1
  32. package/dist/calendar-action-buttons/index.js +178 -0
  33. package/dist/components/appointment-details-panel/index.js +6 -5
  34. package/dist/components/color-picker/index.js +5 -4
  35. package/dist/components/document-preview/index.js +1 -1
  36. package/dist/components/fiscal-code-input/index.js +1 -1
  37. package/dist/components/iban-input/index.js +1 -1
  38. package/dist/components/notes-panel/index.js +1 -1
  39. package/dist/components/patient-details/index.js +1 -1
  40. package/dist/components/patient-summary-card/index.js +1 -1
  41. package/dist/components/rich-text-editor/index.js +1 -1
  42. package/dist/components/task-editor/index.js +1 -1
  43. package/dist/find-free-slots-panel/index.js +58 -0
  44. package/dist/index.js +1328 -1322
  45. package/dist/online-bookings-panel/index.js +69 -0
  46. package/dist/patterns/calendar/booking-tools/appointment-editor-panel.d.ts +46 -0
  47. package/dist/patterns/calendar/booking-tools/booking-tools-data.d.ts +48 -0
  48. package/dist/patterns/calendar/booking-tools/calendar-action-buttons.d.ts +55 -0
  49. package/dist/patterns/calendar/booking-tools/find-free-slots-panel.d.ts +35 -0
  50. package/dist/patterns/calendar/booking-tools/online-bookings-panel.d.ts +61 -0
  51. package/dist/patterns/calendar/booking-tools/waiting-list-panel.d.ts +58 -0
  52. package/dist/patterns/calendar/calendar-editor-discard-host.d.ts +20 -0
  53. package/dist/patterns/calendar/calendar-print-sheet.d.ts +16 -0
  54. package/dist/patterns/calendar/calendar-workspace.model.d.ts +7 -0
  55. package/dist/patterns/calendar/calendar.model.d.ts +9 -0
  56. package/dist/patterns/calendar/calendar.sheets.d.ts +59 -17
  57. package/dist/patterns/calendar/index.js +24 -20
  58. package/dist/patterns/patient-account-settings/index.js +1 -1
  59. package/dist/patterns/patient-check-in/index.js +1 -1
  60. package/dist/patterns/patient-portal/index.js +2 -2
  61. package/dist/waiting-list-panel/index.js +158 -0
  62. package/package.json +27 -2
  63. package/dist/_chunks/calendar-appointment-editor-dialog-CB4cQOtc.js +0 -13773
  64. package/dist/_chunks/color-picker-AcaWuKah.js +0 -745
  65. package/dist/_chunks/task-editor-BfXSn6U1.js +0 -1257
  66. package/dist/_chunks/use-appointment-details-read-7J0j1FP7.js +0 -2476
@@ -0,0 +1,314 @@
1
+ import { c as A } from "./createLucideIcon-DhHxpK9K.js";
2
+ import { jsx as s, jsxs as p } from "react/jsx-runtime";
3
+ import { useTranslation as P } from "react-i18next";
4
+ import { s as F, D as $ } from "./appointment-details-panel.identity-C20Y9xNC.js";
5
+ import { E as L } from "./empty-state-DwJ5YNzz.js";
6
+ import { T as v } from "./timeline-DXko0M1t.js";
7
+ import { a as W } from "./workflow-status-CO0mxXs2.js";
8
+ import { u as j } from "./appointment-workflow-status-S-lx81Yz.js";
9
+ import { C as R } from "./calendar-clock-hbObjfGY.js";
10
+ import { T as B } from "./trash-2-uumy3fy1.js";
11
+ import { A as g } from "./entity-card-p-LANpYt.js";
12
+ import { C as H } from "./calendar-plus-BFrIRE4r.js";
13
+ import { P as k } from "./pencil-B1sKKyuT.js";
14
+ import { C as T } from "./clock-Drd4Wtis.js";
15
+ import { A as G } from "./arrow-right-KsIrLdt0.js";
16
+ /**
17
+ * @license lucide-react v1.22.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */
22
+ const K = [
23
+ ["path", { d: "M11 14h10", key: "1w8e9d" }],
24
+ ["path", { d: "M16 4h2a2 2 0 0 1 2 2v1.344", key: "1e62lh" }],
25
+ ["path", { d: "m17 18 4-4-4-4", key: "z2g111" }],
26
+ ["path", { d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113", key: "bjbb7m" }],
27
+ ["rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", key: "ublpy" }]
28
+ ], ft = A("clipboard-paste", K);
29
+ /**
30
+ * @license lucide-react v1.22.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */
35
+ const Y = [
36
+ ["path", { d: "M12 2v20", key: "t6zp3m" }],
37
+ ["path", { d: "m15 19-3 3-3-3", key: "11eu04" }],
38
+ ["path", { d: "m19 9 3 3-3 3", key: "1mg7y2" }],
39
+ ["path", { d: "M2 12h20", key: "9i4pu4" }],
40
+ ["path", { d: "m5 9-3 3 3 3", key: "j64kie" }],
41
+ ["path", { d: "m9 5 3-3 3 3", key: "l8vdw6" }]
42
+ ], S = A("move", Y), i = (o) => `calendarWorkspace.details.${o}`, U = /* @__PURE__ */ new Set(["patient", "care"]), C = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i, V = (o) => {
43
+ switch (o.field) {
44
+ case "time":
45
+ return !!(o.fromIso || o.toIso);
46
+ case "duration":
47
+ return o.fromMin !== void 0 || o.toMin !== void 0;
48
+ default:
49
+ return !!(o.from || o.to);
50
+ }
51
+ };
52
+ function X(o) {
53
+ const f = o.kind === "moved" ? [{ field: "time", fromIso: o.fromIso, toIso: o.toIso }] : o.kind === "resized" ? [{ field: "duration", fromMin: o.fromMin, toMin: o.toMin }] : o.kind === "status" ? [{ field: "status", from: o.from, to: o.to }] : [], w = ("changes" in o ? o.changes ?? [] : []).filter(
54
+ V
55
+ ), y = new Set(f.map((e) => e.field));
56
+ return [
57
+ ...f,
58
+ ...w.filter((e) => y.has(e.field) ? !1 : (y.add(e.field), !0))
59
+ ];
60
+ }
61
+ const q = (o, f) => o.getFullYear() === f.getFullYear() && o.getMonth() === f.getMonth() && o.getDate() === f.getDate();
62
+ function ut({
63
+ history: o,
64
+ locale: f,
65
+ noteUnrecordedEdits: w = !1,
66
+ privacy: y = !1
67
+ }) {
68
+ const { t: e, i18n: D } = P("ui"), { optionFor: I } = j(null), z = f ?? D.language, N = (t, d) => {
69
+ try {
70
+ return new Intl.DateTimeFormat(z, d).format(
71
+ new Date(t)
72
+ );
73
+ } catch {
74
+ return t;
75
+ }
76
+ }, M = (t) => N(t, $), b = e(i("history.notSet")), x = (t) => {
77
+ switch (t.field) {
78
+ case "status":
79
+ return {
80
+ from: t.from && I(t.from).label,
81
+ to: t.to && I(t.to).label
82
+ };
83
+ case "time": {
84
+ const d = t.fromIso && new Date(t.fromIso), a = t.toIso && new Date(t.toIso), l = d && a && q(d, a) ? N(t.toIso, {
85
+ hour: "2-digit",
86
+ minute: "2-digit"
87
+ }) : void 0;
88
+ return {
89
+ from: t.fromIso && M(t.fromIso),
90
+ to: l ?? (t.toIso && M(t.toIso))
91
+ };
92
+ }
93
+ case "duration":
94
+ return {
95
+ from: t.fromMin === void 0 ? void 0 : e(i("history.minutes"), { n: t.fromMin }),
96
+ to: t.toMin === void 0 ? void 0 : e(i("history.minutes"), { n: t.toMin })
97
+ };
98
+ default:
99
+ return { from: t.from || void 0, to: t.to || void 0 };
100
+ }
101
+ }, O = (t) => {
102
+ const d = e(i(`history.fields.${t.field}`)), { from: a, to: l } = x(t);
103
+ return t.field === "colour" && [a, l].some((u) => u && C.test(u)) ? e(i("history.changed.colour")) : a && !l ? e(i("history.changeCleared"), { field: d, from: a }) : !a && l ? e(i("history.changeSet"), { field: d, to: l }) : e(i("history.changeFromTo"), {
104
+ field: d,
105
+ from: a ?? b,
106
+ to: l ?? b
107
+ });
108
+ }, h = (t) => {
109
+ const d = (n, c) => n && t.field === "colour" && C.test(n) ? /* @__PURE__ */ s(
110
+ "span",
111
+ {
112
+ className: "ds:inline-block ds:size-4 ds:shrink-0 ds:rounded-[var(--radius-full)] ds:border ds:border-[color:var(--border)] ds:[background-color:var(--history-swatch)] ds:forced-colors:[forced-color-adjust:none]",
113
+ style: {
114
+ "--history-swatch": n.startsWith("#") ? n : `#${n}`
115
+ }
116
+ }
117
+ ) : n ? /* @__PURE__ */ s(
118
+ "span",
119
+ {
120
+ className: c ? "ds:min-w-0 ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]" : "ds:min-w-0 ds:text-[color:var(--muted-foreground)]",
121
+ children: n
122
+ }
123
+ ) : /* @__PURE__ */ s("span", { className: "ds:min-w-0 ds:text-[color:var(--muted-foreground)]", children: b }), a = (n) => n ? /* @__PURE__ */ s(
124
+ W,
125
+ {
126
+ value: n,
127
+ option: I(n),
128
+ size: "sm"
129
+ }
130
+ ) : d(void 0, !1), { from: l, to: u } = x(t);
131
+ return /* @__PURE__ */ p("div", { className: "ds:min-w-0", "data-history-change": t.field, children: [
132
+ /* @__PURE__ */ s("span", { className: "ds:sr-only", children: O(t) }),
133
+ /* @__PURE__ */ p(
134
+ "div",
135
+ {
136
+ "aria-hidden": "true",
137
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
138
+ children: [
139
+ t.field === "status" ? a(t.from) : d(l, !1),
140
+ /* @__PURE__ */ s(
141
+ G,
142
+ {
143
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:rtl:rotate-180",
144
+ "aria-hidden": "true"
145
+ }
146
+ ),
147
+ t.field === "status" ? a(t.to) : d(u, !0)
148
+ ]
149
+ }
150
+ )
151
+ ] });
152
+ }, _ = (t) => {
153
+ switch (t.kind) {
154
+ case "created":
155
+ return {
156
+ title: e(i("history.created")),
157
+ type: "success",
158
+ icon: /* @__PURE__ */ s(H, { size: 16, "aria-hidden": "true" })
159
+ };
160
+ case "confirmedByPatient": {
161
+ const r = g.confirmed.Icon;
162
+ return {
163
+ title: e(i("history.confirmedByPatient")),
164
+ type: "success",
165
+ icon: /* @__PURE__ */ s(r, { size: 16, "aria-hidden": "true" })
166
+ };
167
+ }
168
+ case "deleted":
169
+ return {
170
+ title: e(i("history.deleted")),
171
+ type: "error",
172
+ icon: /* @__PURE__ */ s(B, { size: 16, "aria-hidden": "true" })
173
+ };
174
+ }
175
+ const d = X(t), a = y ? d.filter((r) => !U.has(r.field)) : d, l = new Set(a.map((r) => r.field)), u = [
176
+ ...t.kind === "edited" ? t.fields : [],
177
+ ...d.filter((r) => !l.has(r.field)).map((r) => r.field)
178
+ ].filter(
179
+ (r, m, E) => r !== "status" && !l.has(r) && E.indexOf(r) === m
180
+ ), n = u.length > 0 ? e(i("history.editedDetail"), {
181
+ fields: u.map((r) => e(i(`history.fields.${r}`))).join(", ")
182
+ }) : void 0, [c] = a;
183
+ if (a.length === 1 && c && !n)
184
+ switch (c.field) {
185
+ case "status": {
186
+ const { to: r } = c, m = r ? g[r].Icon : k;
187
+ return {
188
+ title: e(i("history.status")),
189
+ type: r === "cancelled" || r === "absent" ? "warning" : "neutral",
190
+ icon: /* @__PURE__ */ s(m, { size: 16, "aria-hidden": "true" }),
191
+ detail: h(c)
192
+ };
193
+ }
194
+ case "time":
195
+ return {
196
+ title: e(i("history.moved")),
197
+ type: "info",
198
+ icon: /* @__PURE__ */ s(S, { size: 16, "aria-hidden": "true" }),
199
+ detail: h(c)
200
+ };
201
+ case "duration":
202
+ return {
203
+ title: e(i("history.resized")),
204
+ type: "info",
205
+ icon: /* @__PURE__ */ s(T, { size: 16, "aria-hidden": "true" }),
206
+ detail: h(c)
207
+ };
208
+ default:
209
+ return {
210
+ title: e(i(`history.changed.${c.field}`)),
211
+ type: "neutral",
212
+ icon: /* @__PURE__ */ s(k, { size: 16, "aria-hidden": "true" }),
213
+ detail: h(c)
214
+ };
215
+ }
216
+ if (a.length > 0) {
217
+ const r = t.kind === "moved" ? {
218
+ title: "history.moved",
219
+ icon: /* @__PURE__ */ s(S, { size: 16, "aria-hidden": "true" })
220
+ } : t.kind === "resized" ? {
221
+ title: "history.resized",
222
+ icon: /* @__PURE__ */ s(T, { size: 16, "aria-hidden": "true" })
223
+ } : t.kind === "status" ? {
224
+ title: "history.status",
225
+ icon: (() => {
226
+ const m = g[t.to].Icon;
227
+ return /* @__PURE__ */ s(m, { size: 16, "aria-hidden": "true" });
228
+ })()
229
+ } : {
230
+ title: "history.edited",
231
+ icon: /* @__PURE__ */ s(k, { size: 16, "aria-hidden": "true" })
232
+ };
233
+ return {
234
+ title: e(i(r.title)),
235
+ type: t.kind === "moved" || t.kind === "resized" ? "info" : t.kind === "status" && (t.to === "cancelled" || t.to === "absent") ? "warning" : "neutral",
236
+ icon: r.icon,
237
+ detail: /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
238
+ /* @__PURE__ */ s(
239
+ "dl",
240
+ {
241
+ "aria-label": e(i("history.changesLabel")),
242
+ className: "ds:m-0 ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:items-baseline ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-xs)]",
243
+ children: a.map((m) => /* @__PURE__ */ p("div", { className: "ds:contents", children: [
244
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[color:var(--muted-foreground)]", children: e(i(`history.fields.${m.field}`)) }),
245
+ /* @__PURE__ */ s("dd", { className: "ds:m-0 ds:min-w-0", children: h(m) })
246
+ ] }, m.field))
247
+ }
248
+ ),
249
+ n ? /* @__PURE__ */ s("p", { className: "ds:m-0", children: n }) : null
250
+ ] })
251
+ };
252
+ }
253
+ return {
254
+ title: e(i("history.edited")),
255
+ type: "neutral",
256
+ icon: /* @__PURE__ */ s(k, { size: 16, "aria-hidden": "true" }),
257
+ detail: n || (w ? /* @__PURE__ */ s("span", { className: "ds:text-[color:var(--muted-foreground)]", children: e(i("history.notRecorded")) }) : void 0)
258
+ };
259
+ };
260
+ return o.length === 0 ? /* @__PURE__ */ s(
261
+ L,
262
+ {
263
+ variant: "first-use",
264
+ size: "sm",
265
+ title: e(i("historyEmpty"))
266
+ }
267
+ ) : /* @__PURE__ */ s(v, { order: "newest-first", "aria-label": e(i("historyTitle")), children: F(o).map((t) => {
268
+ const d = _(t);
269
+ return /* @__PURE__ */ p(
270
+ v.Event,
271
+ {
272
+ eventId: t.id,
273
+ type: d.type,
274
+ className: "ds:[column-gap:var(--spacing-sm)] ds:[padding-block-end:var(--spacing-lg)] ds:before:bg-[var(--primary)]",
275
+ children: [
276
+ /* @__PURE__ */ s(v.Dot, { icon: d.icon }),
277
+ /* @__PURE__ */ s(
278
+ v.Content,
279
+ {
280
+ title: d.title,
281
+ description: d.detail,
282
+ className: "ds:[padding-block-end:0] ds:[&>[data-component=card]]:border-[color:var(--card-border)] ds:[&>[data-component=card]]:shadow-[var(--shadow-card)]",
283
+ actor: t.actor.trim() ? { name: t.actor } : void 0,
284
+ children: /* @__PURE__ */ p("span", { className: "ds:mt-[var(--spacing-sm)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
285
+ /* @__PURE__ */ s(
286
+ R,
287
+ {
288
+ "aria-hidden": "true",
289
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
290
+ }
291
+ ),
292
+ /* @__PURE__ */ s(
293
+ v.Timestamp,
294
+ {
295
+ date: t.atIso,
296
+ relative: !1,
297
+ locale: z
298
+ }
299
+ )
300
+ ] })
301
+ }
302
+ )
303
+ ]
304
+ },
305
+ t.id
306
+ );
307
+ }) });
308
+ }
309
+ export {
310
+ ut as A,
311
+ ft as C,
312
+ S as M
313
+ };
314
+ //# sourceMappingURL=appointment-details-panel.history-DrIMDQYf.js.map
@@ -0,0 +1,223 @@
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import { useTranslation as v } from "react-i18next";
3
+ import { A as b } from "./alert-C4WKViaS.js";
4
+ import { A as I } from "./avatar-Dp5apm1d.js";
5
+ import { B as A } from "./badge-BUk4RjTS.js";
6
+ import { B as R } from "./button-DohK_Ak_.js";
7
+ import { u as k } from "./appointment-workflow-status-S-lx81Yz.js";
8
+ import { H as w } from "./heart-pulse-BCppJyN2.js";
9
+ import { G as E } from "./globe-sHBW1JN5.js";
10
+ import { T as S } from "./triangle-alert-CBnO6nq_.js";
11
+ import { E as $ } from "./euro-Dsuz4ixO.js";
12
+ import { V as B } from "./video-BheNGvsu.js";
13
+ import { R as F } from "./repeat-CvQa5rZt.js";
14
+ function x(e) {
15
+ return typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e) ? /* @__PURE__ */ new Date(`${e}T00:00:00`) : new Date(e);
16
+ }
17
+ function _(e, n) {
18
+ try {
19
+ return new Intl.DateTimeFormat(e, {
20
+ weekday: "long",
21
+ day: "numeric",
22
+ month: "long",
23
+ year: "numeric"
24
+ }).format(x(n));
25
+ } catch {
26
+ return "";
27
+ }
28
+ }
29
+ function X(e, n, a) {
30
+ const t = new Date(n), s = a ? new Date(a) : t;
31
+ try {
32
+ const r = new Intl.DateTimeFormat(e, {
33
+ hour: "2-digit",
34
+ minute: "2-digit",
35
+ hour12: !1
36
+ });
37
+ return typeof r.formatRange == "function" ? r.formatRange(t, s) : `${r.format(t)} – ${r.format(s)}`;
38
+ } catch {
39
+ return "";
40
+ }
41
+ }
42
+ const Z = {
43
+ weekday: "short",
44
+ day: "numeric",
45
+ month: "short",
46
+ hour: "2-digit",
47
+ minute: "2-digit"
48
+ };
49
+ function ee(e, n) {
50
+ const a = x(e), t = x(n);
51
+ let s = t.getFullYear() - a.getFullYear();
52
+ const r = t.getMonth() - a.getMonth();
53
+ return (r < 0 || r === 0 && t.getDate() < a.getDate()) && (s -= 1), Math.max(0, s);
54
+ }
55
+ const M = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/;
56
+ function ne(e) {
57
+ const n = typeof e == "string" ? M.exec(e) : null;
58
+ if (!n) return;
59
+ const [a, t, s, r, u, p] = n.slice(1).map(Number), f = /* @__PURE__ */ new Date(0);
60
+ if (f.setFullYear(a, t, 0), t < 1 || t > 12 || s < 1 || s > f.getDate() || r > 23 || u > 59 || p > 59)
61
+ return;
62
+ const l = /* @__PURE__ */ new Date(0);
63
+ return l.setFullYear(a, t - 1, s), l.setHours(r, u, p, 0), l;
64
+ }
65
+ function te(e) {
66
+ return e.map((n) => {
67
+ const a = Date.parse(n.atIso);
68
+ return { entry: n, time: Number.isFinite(a) ? a : -1 / 0 };
69
+ }).sort((n, a) => n.time === a.time ? 0 : a.time - n.time).map(({ entry: n }) => n);
70
+ }
71
+ const ae = {
72
+ daily: "recurrenceDaily",
73
+ weekly: "recurrenceWeekly",
74
+ monthly: "recurrenceMonthly",
75
+ quarterly: "recurrenceQuarterly",
76
+ semiannual: "recurrenceSemiannual",
77
+ yearly: "recurrenceYearly"
78
+ };
79
+ function ie(e) {
80
+ return e.phones ? e.phones : e.phone ? [{ label: "mobile", number: e.phone }] : [];
81
+ }
82
+ function Y(e) {
83
+ return [e.address, e.postalCode, e.city].filter((n) => !!n).join(", ");
84
+ }
85
+ function se(e) {
86
+ return [e.address, e.city].filter((n) => !!n).join(", ");
87
+ }
88
+ function re(e) {
89
+ const n = Y(e);
90
+ return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(n)}`;
91
+ }
92
+ const C = {
93
+ confirmed: "success",
94
+ waiting: "info",
95
+ in_care: "accentSoft",
96
+ done: "success",
97
+ cancelled: "error",
98
+ absent: "warning"
99
+ };
100
+ function H({ event: e }) {
101
+ const { t: n } = v("ui"), a = (s) => `calendarWorkspace.details.indicators.${s}`, t = [];
102
+ return e.isBookedOnline && t.push({
103
+ id: "online",
104
+ icon: /* @__PURE__ */ i(E, { "aria-hidden": "true" }),
105
+ label: n(a("bookedOnline")),
106
+ variant: "info"
107
+ }), e.hasUnassignedPatient && t.push({
108
+ id: "unassigned",
109
+ icon: /* @__PURE__ */ i(S, { "aria-hidden": "true" }),
110
+ label: n(a("unassignedPatient")),
111
+ variant: "warning"
112
+ }), e.hasHighlightedAnamnesis && t.push({
113
+ id: "anamnesis",
114
+ icon: /* @__PURE__ */ i(w, { "aria-hidden": "true" }),
115
+ label: n(a("anamnesis")),
116
+ variant: "accentSoft"
117
+ }), e.hasBillableAmount && t.push({
118
+ id: "billable",
119
+ icon: /* @__PURE__ */ i($, { "aria-hidden": "true" }),
120
+ label: n(a("billable")),
121
+ variant: "warning"
122
+ }), e.isTelehealth && t.push({
123
+ id: "telehealth",
124
+ icon: /* @__PURE__ */ i(B, { "aria-hidden": "true" }),
125
+ label: n(a("telehealth")),
126
+ variant: "info"
127
+ }), e.isRecurring && t.push({
128
+ id: "recurring",
129
+ icon: /* @__PURE__ */ i(F, { "aria-hidden": "true" }),
130
+ label: n(a("recurring")),
131
+ variant: "info"
132
+ }), t.length === 0 ? null : /* @__PURE__ */ i("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: t.map((s) => /* @__PURE__ */ i(
133
+ A,
134
+ {
135
+ variant: s.variant,
136
+ size: "sm",
137
+ leading: s.icon,
138
+ children: s.label
139
+ },
140
+ s.id
141
+ )) });
142
+ }
143
+ function oe({
144
+ name: e,
145
+ avatarSrc: n,
146
+ unresolved: a = !1,
147
+ status: t,
148
+ flags: s,
149
+ age: r,
150
+ onOpenPatient: u,
151
+ highlightedAnamnesisCount: p = 0,
152
+ expiredAnamnesisCount: f = 0,
153
+ anamnesisAnswers: l = [],
154
+ locale: T
155
+ }) {
156
+ const { t: d, i18n: D } = v("ui"), c = (o) => `calendarWorkspace.details.${o}`, { optionFor: N } = k(t), h = t ? N(t) : void 0, g = p, y = f;
157
+ return /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:pb-0", children: [
158
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
159
+ /* @__PURE__ */ i(I, { name: e, src: n }),
160
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[min-inline-size:0]", children: [
161
+ /* @__PURE__ */ m("span", { className: "ds:flex ds:flex-wrap ds:items-baseline ds:gap-[var(--spacing-2xs)] ds:text-start", children: [
162
+ u ? /* @__PURE__ */ i(R, { size: "sm", intent: "link", onClick: () => u(), children: e }) : /* @__PURE__ */ i("span", { className: "ds:font-[var(--font-weight-semibold)] ds:truncate", children: e }),
163
+ r !== void 0 ? /* @__PURE__ */ i("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: d(c("patientAge"), { n: r }) }) : null
164
+ ] }),
165
+ a ? /* @__PURE__ */ i("span", { className: "type-body-sm ds:text-start ds:text-[color:var(--muted-foreground)]", children: d(c("patientNotLoaded")) }) : null,
166
+ t && h ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(
167
+ A,
168
+ {
169
+ variant: C[t],
170
+ size: "sm",
171
+ leading: h.icon,
172
+ children: h.label
173
+ }
174
+ ) }) : null,
175
+ /* @__PURE__ */ i(H, { event: s })
176
+ ] })
177
+ ] }),
178
+ g + y > 0 ? /* @__PURE__ */ m(
179
+ b,
180
+ {
181
+ variant: "warning",
182
+ announce: "off",
183
+ icon: /* @__PURE__ */ i(w, { "aria-hidden": "true" }),
184
+ children: [
185
+ /* @__PURE__ */ i(b.Title, { as: "p", children: d(c("anamnesisTitle")) }),
186
+ /* @__PURE__ */ i(b.Description, { children: [
187
+ g > 0 ? d(c("anamnesisHighlighted"), { n: g }) : null,
188
+ y > 0 ? d(c("anamnesisExpired"), { n: y }) : null
189
+ ].filter((o) => o !== null).join(" · ") }),
190
+ l.length > 0 ? (
191
+ /* Question · yes or no · answer · interview date, as the
192
+ platform's details dialog lists them. A list, not a
193
+ Description, which renders a <p>. */
194
+ /* @__PURE__ */ i("ul", { className: "type-body-sm ds:m-0 ds:mt-[var(--spacing-xs)] ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-0", children: l.map((o) => /* @__PURE__ */ m("li", { className: "ds:text-start", children: [
195
+ /* @__PURE__ */ i("span", { className: "ds:font-[var(--font-weight-semibold)]", children: o.question }),
196
+ ` · ${d(c(o.yes ? "anamnesisYes" : "anamnesisNo"))}`,
197
+ o.answer ? ` · ${o.answer}` : "",
198
+ ` · ${_(T ?? D.language, o.interviewIso)}`
199
+ ] }, o.question)) })
200
+ ) : null
201
+ ]
202
+ }
203
+ ) : null
204
+ ] });
205
+ }
206
+ export {
207
+ C as A,
208
+ Z as D,
209
+ H as I,
210
+ ae as R,
211
+ x as a,
212
+ _ as b,
213
+ ee as c,
214
+ ie as d,
215
+ Y as e,
216
+ X as f,
217
+ se as g,
218
+ re as h,
219
+ oe as i,
220
+ ne as p,
221
+ te as s
222
+ };
223
+ //# sourceMappingURL=appointment-details-panel.identity-C20Y9xNC.js.map