@alfadocs/ui-kit 1.136.0 → 1.138.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 (131) hide show
  1. package/dist/_chunks/{appointment-card-BT1cMZIX.js → appointment-card-CaxFXtSn.js} +196 -184
  2. package/dist/_chunks/appointment-details-panel.history-DrIMDQYf.js +314 -0
  3. package/dist/_chunks/appointment-details-panel.identity-C20Y9xNC.js +223 -0
  4. package/dist/_chunks/{appointment-timeline-Dy4YQJ17.js → appointment-timeline-BEwgbYyG.js} +113 -110
  5. package/dist/_chunks/{appointment-tray-B3gSHL1j.js → appointment-tray-DPpeR9JT.js} +8 -8
  6. package/dist/_chunks/calendar-appointment-editor-dialog-SxSkOTnO.js +5519 -0
  7. package/dist/_chunks/calendar-editor-discard-host-DjUhoFr2.js +1336 -0
  8. package/dist/_chunks/calendar-editor-guard-9fShhNIA.js +31 -0
  9. package/dist/_chunks/calendar-waiting-list-panel-331vzAdl.js +981 -0
  10. package/dist/_chunks/calendar-workspace.model-B8yPwuBv.js +1557 -0
  11. package/dist/_chunks/calendar.sheets-aodjllWd.js +4585 -0
  12. package/dist/_chunks/color-picker-CC8ZfntU.js +582 -0
  13. package/dist/_chunks/{document-preview-DWlejd8A.js → document-preview-CirR3C_m.js} +2 -2
  14. package/dist/_chunks/{fiscal-code-input-BBvU7sAo.js → fiscal-code-input-DZlpaMGg.js} +2 -2
  15. package/dist/_chunks/{iban-input-DuTwKok5.js → iban-input-CdSLRzQN.js} +2 -2
  16. package/dist/_chunks/list-todo-KWvUhmT_.js +33 -0
  17. package/dist/_chunks/{notes-panel-BvjAo4RQ.js → notes-panel-DsEKNtsw.js} +2 -2
  18. package/dist/_chunks/palettes-CKVXYTzo.js +172 -0
  19. package/dist/_chunks/{patient-account-settings-Bmfeclpd.js → patient-account-settings-Cs9y-pVA.js} +3 -3
  20. package/dist/_chunks/{patient-check-in-resume-CYZ-SvsF.js → patient-check-in-resume-4qi_klQV.js} +5 -5
  21. package/dist/_chunks/{patient-details-9eh9cNy7.js → patient-details-Dv7EiTCo.js} +2 -2
  22. package/dist/_chunks/{patient-field-row-B782eT0C.js → patient-field-row-DuHWGlLz.js} +2 -2
  23. package/dist/_chunks/patient-picker-BZJuOgMw.js +173 -0
  24. package/dist/_chunks/{patient-summary-card-K9zaMl1O.js → patient-summary-card-D-cDzOim.js} +2 -2
  25. package/dist/_chunks/{portal-details-DCIiGkHA.js → portal-details-BGc_FLQk.js} +3 -3
  26. package/dist/_chunks/{portal-documents-DVKj6Sco.js → portal-documents-BSI1U5lI.js} +3 -3
  27. package/dist/_chunks/{portal-parts-Br8wuala.js → portal-parts-C99CreYO.js} +2 -2
  28. package/dist/_chunks/{privacy-mask-C19dJFMk.js → privacy-mask-C2ZLKrMh.js} +5 -5
  29. package/dist/_chunks/{rich-text-editor-DjHL1b3E.js → rich-text-editor-C48omVjq.js} +2 -2
  30. package/dist/_chunks/task-editor-wKbFbGqW.js +1093 -0
  31. package/dist/_chunks/use-appointment-details-read-jGkJalX8.js +1966 -0
  32. package/dist/agent-catalog.json +2 -2
  33. package/dist/appointment-editor-panel/index.js +100 -0
  34. package/dist/booking-tools-data/index.js +82 -0
  35. package/dist/browser-support.js +1 -1
  36. package/dist/calendar-action-buttons/index.js +178 -0
  37. package/dist/components/appointment-card/appointment-card.d.ts +5 -2
  38. package/dist/components/appointment-card/index.js +2 -2
  39. package/dist/components/appointment-details-panel/index.js +6 -5
  40. package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
  41. package/dist/components/appointment-timeline/index.js +1 -1
  42. package/dist/components/color-picker/index.js +5 -4
  43. package/dist/components/document-preview/index.js +1 -1
  44. package/dist/components/fiscal-code-input/index.js +1 -1
  45. package/dist/components/iban-input/index.js +1 -1
  46. package/dist/components/notes-panel/index.js +1 -1
  47. package/dist/components/patient-details/index.js +1 -1
  48. package/dist/components/patient-summary-card/index.js +1 -1
  49. package/dist/components/rich-text-editor/index.js +1 -1
  50. package/dist/components/task-editor/index.js +1 -1
  51. package/dist/core.css +1 -1
  52. package/dist/find-free-slots-panel/index.js +58 -0
  53. package/dist/host-legacy.css +16 -0
  54. package/dist/i18n/locales/ar.d.ts +0 -1
  55. package/dist/i18n/locales/ar.js +0 -1
  56. package/dist/i18n/locales/de.d.ts +0 -1
  57. package/dist/i18n/locales/de.js +0 -1
  58. package/dist/i18n/locales/el.d.ts +0 -1
  59. package/dist/i18n/locales/el.js +0 -1
  60. package/dist/i18n/locales/en.d.ts +0 -1
  61. package/dist/i18n/locales/en.js +0 -1
  62. package/dist/i18n/locales/es.d.ts +0 -1
  63. package/dist/i18n/locales/es.js +0 -1
  64. package/dist/i18n/locales/fr.d.ts +0 -1
  65. package/dist/i18n/locales/fr.js +0 -1
  66. package/dist/i18n/locales/hi.d.ts +0 -1
  67. package/dist/i18n/locales/hi.js +0 -1
  68. package/dist/i18n/locales/it.d.ts +0 -1
  69. package/dist/i18n/locales/it.js +0 -1
  70. package/dist/i18n/locales/ja.d.ts +0 -1
  71. package/dist/i18n/locales/ja.js +0 -1
  72. package/dist/i18n/locales/nl.d.ts +0 -1
  73. package/dist/i18n/locales/nl.js +0 -1
  74. package/dist/i18n/locales/pl.d.ts +0 -1
  75. package/dist/i18n/locales/pl.js +0 -1
  76. package/dist/i18n/locales/pt.d.ts +0 -1
  77. package/dist/i18n/locales/pt.js +0 -1
  78. package/dist/i18n/locales/ro.d.ts +0 -1
  79. package/dist/i18n/locales/ro.js +0 -1
  80. package/dist/i18n/locales/ru.d.ts +0 -1
  81. package/dist/i18n/locales/ru.js +0 -1
  82. package/dist/i18n/locales/sq.d.ts +0 -1
  83. package/dist/i18n/locales/sq.js +0 -1
  84. package/dist/i18n/locales/sv.d.ts +0 -1
  85. package/dist/i18n/locales/sv.js +0 -1
  86. package/dist/i18n/locales/tr.d.ts +0 -1
  87. package/dist/i18n/locales/tr.js +0 -1
  88. package/dist/i18n/locales/zh.d.ts +0 -1
  89. package/dist/i18n/locales/zh.js +0 -1
  90. package/dist/index.js +1328 -1322
  91. package/dist/locales/ar.json +0 -1
  92. package/dist/locales/de.json +0 -1
  93. package/dist/locales/el.json +0 -1
  94. package/dist/locales/en.json +0 -1
  95. package/dist/locales/es.json +0 -1
  96. package/dist/locales/fr.json +0 -1
  97. package/dist/locales/hi.json +0 -1
  98. package/dist/locales/it.json +0 -1
  99. package/dist/locales/ja.json +0 -1
  100. package/dist/locales/nl.json +0 -1
  101. package/dist/locales/pl.json +0 -1
  102. package/dist/locales/pt.json +0 -1
  103. package/dist/locales/ro.json +0 -1
  104. package/dist/locales/ru.json +0 -1
  105. package/dist/locales/sq.json +0 -1
  106. package/dist/locales/sv.json +0 -1
  107. package/dist/locales/tr.json +0 -1
  108. package/dist/locales/zh.json +0 -1
  109. package/dist/online-bookings-panel/index.js +69 -0
  110. package/dist/patterns/calendar/booking-tools/appointment-editor-panel.d.ts +46 -0
  111. package/dist/patterns/calendar/booking-tools/booking-tools-data.d.ts +48 -0
  112. package/dist/patterns/calendar/booking-tools/calendar-action-buttons.d.ts +55 -0
  113. package/dist/patterns/calendar/booking-tools/find-free-slots-panel.d.ts +35 -0
  114. package/dist/patterns/calendar/booking-tools/online-bookings-panel.d.ts +61 -0
  115. package/dist/patterns/calendar/booking-tools/waiting-list-panel.d.ts +58 -0
  116. package/dist/patterns/calendar/calendar-editor-discard-host.d.ts +20 -0
  117. package/dist/patterns/calendar/calendar-print-sheet.d.ts +16 -0
  118. package/dist/patterns/calendar/calendar-workspace.model.d.ts +7 -0
  119. package/dist/patterns/calendar/calendar.model.d.ts +9 -0
  120. package/dist/patterns/calendar/calendar.sheets.d.ts +59 -17
  121. package/dist/patterns/calendar/index.js +24 -20
  122. package/dist/patterns/patient-account-settings/index.js +1 -1
  123. package/dist/patterns/patient-check-in/index.js +1 -1
  124. package/dist/patterns/patient-portal/index.js +2 -2
  125. package/dist/tokens.css +1 -1
  126. package/dist/waiting-list-panel/index.js +158 -0
  127. package/package.json +27 -2
  128. package/dist/_chunks/calendar-appointment-editor-dialog-CB4cQOtc.js +0 -13773
  129. package/dist/_chunks/color-picker-AcaWuKah.js +0 -745
  130. package/dist/_chunks/task-editor-BfXSn6U1.js +0 -1257
  131. package/dist/_chunks/use-appointment-details-read-7J0j1FP7.js +0 -2476
@@ -0,0 +1,1557 @@
1
+ import { useState as ne, useCallback as oe } from "react";
2
+ import { G, b as P, c as ie, A as se } from "./palettes-CKVXYTzo.js";
3
+ import { s as ae } from "./signature-status-chip-DS9hHwIt.js";
4
+ import { b as re } from "./appointment-workflow-status-S-lx81Yz.js";
5
+ import { b as ce, a as w, c as de, d as ue, A as le } from "./appointment-details-panel.identity-C20Y9xNC.js";
6
+ import { A as W } from "./entity-card-p-LANpYt.js";
7
+ const pe = "grp-none";
8
+ function pt(e) {
9
+ const t = new Map(e.operators.map((c) => [c.id, c])), n = new Set(e.inactiveIds), o = (c) => c.sequenceNumber ?? Number.MAX_SAFE_INTEGER, i = (c) => [...c].sort((d, u) => {
10
+ const l = Number(n.has(d.id)) - Number(n.has(u.id));
11
+ return l !== 0 ? l : o(d) - o(u);
12
+ }), s = /* @__PURE__ */ new Set(), r = [];
13
+ for (const c of e.groups) {
14
+ const d = c.operatorIds.map((u) => t.get(u)).filter((u) => u !== void 0);
15
+ d.length !== 0 && (d.forEach((u) => s.add(u.id)), r.push({
16
+ id: c.id,
17
+ name: c.name,
18
+ operators: i(d)
19
+ }));
20
+ }
21
+ const a = e.operators.filter((c) => !s.has(c.id));
22
+ return a.length > 0 && r.push({
23
+ id: pe,
24
+ name: e.withoutGroupLabel,
25
+ operators: i(a)
26
+ }), r.sort((c, d) => c.name.localeCompare(d.name, e.locale));
27
+ }
28
+ function ft(e, t) {
29
+ const n = new Set(t), o = (s) => s.sequenceNumber ?? Number.MAX_SAFE_INTEGER;
30
+ return [...new Map(
31
+ e.flatMap((s) => s.operators).map((s) => [s.id, s])
32
+ ).values()].sort(
33
+ (s, r) => Number(n.has(s.id)) - Number(n.has(r.id)) || o(s) - o(r)
34
+ );
35
+ }
36
+ function N(e, t) {
37
+ var r;
38
+ const n = (a) => a.phases && a.phases.length > 0 ? ` [${a.phases.join(", ")}]` : "", o = (a) => {
39
+ switch (t) {
40
+ case "name":
41
+ return `${a.name}${n(a)}`;
42
+ case "code":
43
+ return a.code ?? a.name;
44
+ case "nameCode":
45
+ return `${a.name}${a.code ? ` (${a.code})` : ""}${n(a)}`;
46
+ default:
47
+ return "";
48
+ }
49
+ }, i = t === "off" ? "" : (e.cares ?? []).map(o).join(", "), s = [((r = e.description) == null ? void 0 : r.trim()) ?? "", i].filter(
50
+ (a) => a.length > 0
51
+ );
52
+ return s.length > 0 ? s.join(" / ") : void 0;
53
+ }
54
+ function mt(e) {
55
+ return N({ cares: e }, "name") ?? "";
56
+ }
57
+ function x(e, t, n) {
58
+ var o, i, s, r;
59
+ switch (e) {
60
+ case "operator":
61
+ return (o = n.operators.find((a) => a.id === t.operatorId)) == null ? void 0 : o.color;
62
+ case "chair":
63
+ return (i = n.chairs.find((a) => a.id === t.chairId)) == null ? void 0 : i.color;
64
+ case "care": {
65
+ const a = (s = t.cares) == null ? void 0 : s.find((c) => c.careId);
66
+ return a ? (r = n.cares.find((c) => c.id === a.careId)) == null ? void 0 : r.colorHex : void 0;
67
+ }
68
+ default:
69
+ return;
70
+ }
71
+ }
72
+ function E(e) {
73
+ return e == null ? "" : String(e);
74
+ }
75
+ function fe(e, t) {
76
+ const n = E(e), o = n ? t : void 0;
77
+ return {
78
+ id: n,
79
+ record: o,
80
+ assigned: n !== "",
81
+ unresolved: n !== "" && o === void 0
82
+ };
83
+ }
84
+ function me(e, t, n) {
85
+ var o;
86
+ return [(o = e.record) == null ? void 0 : o.name, t].find(
87
+ (i) => i !== void 0 && i.trim() !== ""
88
+ ) ?? n;
89
+ }
90
+ function F(e, t) {
91
+ const n = e.record;
92
+ if (!n) return "unknown";
93
+ const o = t === "sms" ? n.phone : n.email;
94
+ return o === void 0 ? "unknown" : o.trim() === "" ? "none" : (t === "sms" ? n.smsEnabled : n.emailEnabled) === !1 ? "optedOut" : "ready";
95
+ }
96
+ function ht(e) {
97
+ return e === "ready";
98
+ }
99
+ function gt(e) {
100
+ return e === "ready" || e === "unknown";
101
+ }
102
+ function It(e, t) {
103
+ return e === "optedOut" ? t.optedOut : e === "none" ? t.none : null;
104
+ }
105
+ function he(e) {
106
+ return e === void 0 ? "unknown" : e.length === 0 ? "none" : "ready";
107
+ }
108
+ function Dt(e) {
109
+ return e === "ready";
110
+ }
111
+ const C = /* @__PURE__ */ new Map(), V = {
112
+ get: (e) => C.get(e),
113
+ set: (e, t) => {
114
+ C.set(e, t);
115
+ },
116
+ clear: () => {
117
+ C.clear();
118
+ }
119
+ };
120
+ function vt() {
121
+ V.clear();
122
+ }
123
+ const Tt = {
124
+ view: "calendarWorkspace.view",
125
+ display: "calendarWorkspace.display",
126
+ /** The old Show weekends switch. Still READ: a user who has not chosen
127
+ * days yet keeps it as the matching hidden set. Never written. */
128
+ showWeekends: "calendarWorkspace.showWeekends",
129
+ /** The weekdays this user hides, 0 (Sunday) to 6 (Saturday). */
130
+ hiddenDays: "calendarWorkspace.hiddenDays",
131
+ chairIds: "calendarWorkspace.chairIds",
132
+ operatorIds: "calendarWorkspace.operatorIds"
133
+ };
134
+ function yt(e, t, n, o = V) {
135
+ const [i, s] = ne(() => {
136
+ const a = n(o.get(e));
137
+ return a !== void 0 ? a : typeof t == "function" ? t() : t;
138
+ }), r = oe(
139
+ (a) => {
140
+ s((c) => {
141
+ const d = typeof a == "function" ? a(c) : a;
142
+ return o.set(e, d), d;
143
+ });
144
+ },
145
+ [o, e]
146
+ );
147
+ return [i, r];
148
+ }
149
+ function v(e) {
150
+ return (t) => typeof t == "string" && e.includes(t) ? t : void 0;
151
+ }
152
+ function k(e) {
153
+ return typeof e == "boolean" ? e : void 0;
154
+ }
155
+ function j(e) {
156
+ const t = new Set(e.map((n) => n.id));
157
+ return (n) => {
158
+ if (!Array.isArray(n)) return;
159
+ const o = [];
160
+ for (const i of n)
161
+ typeof i == "string" && t.has(i) && !o.includes(i) && o.push(i);
162
+ return o;
163
+ };
164
+ }
165
+ const St = re;
166
+ function Mt(e) {
167
+ return !!(e.isTask || e.isInternal || E(e.patientId) === "");
168
+ }
169
+ function _(e, t) {
170
+ const n = E(e);
171
+ return fe(n, n ? t.patientById(n) : void 0);
172
+ }
173
+ function z(e, t) {
174
+ return _(e.patientId, t);
175
+ }
176
+ const bt = [
177
+ { id: "day", stem: "Day" },
178
+ { id: "threeDays", stem: "ThreeDays" },
179
+ { id: "workingWeek", stem: "Week", workingWeek: !0 },
180
+ { id: "week", stem: "Week" },
181
+ { id: "month", stem: "Month" }
182
+ ], ge = {
183
+ resourceKind: "chair",
184
+ orientation: "vertical",
185
+ zebraRows: !1,
186
+ showTime: !0,
187
+ slotDensity: "compact",
188
+ eventColorStyle: "tinted",
189
+ showCardContext: !1,
190
+ slotDuration: "00:30",
191
+ /* Extended, not working: the practice's own hours ARE the working
192
+ window, so at 08:00–19:00 every wash would sit outside the visible
193
+ axis and the shading would only appear after a cog visit. */
194
+ window: "extended",
195
+ /* Name, not the platform's 'disabled' default — that would blank every
196
+ card's care line on first paint. */
197
+ careDescription: "name",
198
+ colorAssociation: "appointment"
199
+ }, X = {
200
+ resourceKind: v(["chair", "operator", "none"]),
201
+ orientation: v(["vertical", "horizontal"]),
202
+ zebraRows: k,
203
+ showTime: k,
204
+ slotDensity: v(["compact", "comfortable"]),
205
+ eventColorStyle: v(["solid", "tinted"]),
206
+ showCardContext: k,
207
+ slotDuration: v(["00:10", "00:15", "00:20", "00:30", "01:00"]),
208
+ window: v(["working", "extended", "full"]),
209
+ careDescription: v(["off", "name", "code", "nameCode"]),
210
+ colorAssociation: v([
211
+ "appointment",
212
+ "care",
213
+ "operator",
214
+ "chair",
215
+ "status"
216
+ ])
217
+ };
218
+ function Ie(e, t, n) {
219
+ const o = X[t](n);
220
+ o !== void 0 && (e[t] = o);
221
+ }
222
+ function Et(e) {
223
+ return j(e.chairs);
224
+ }
225
+ function At(e) {
226
+ return j(e.operators);
227
+ }
228
+ function kt(e, t) {
229
+ const n = t.filter((o) => e.includes(o)).length;
230
+ return n === 0 ? !1 : n === t.length ? !0 : "indeterminate";
231
+ }
232
+ const Q = {
233
+ working: { min: "08:00", max: "19:00" },
234
+ extended: { min: "07:00", max: "21:00" },
235
+ full: { min: "00:00", max: "24:00" }
236
+ };
237
+ function wt(e, t) {
238
+ return de(e, t.nowIso);
239
+ }
240
+ const Ot = 100, Ct = [
241
+ "daily",
242
+ "weekly",
243
+ "monthly",
244
+ "quarterly",
245
+ "semiannual",
246
+ "yearly"
247
+ ], Nt = [
248
+ "SU",
249
+ "MO",
250
+ "TU",
251
+ "WE",
252
+ "TH",
253
+ "FR",
254
+ "SA"
255
+ ];
256
+ function _t(e) {
257
+ const t = e.getDate(), n = new Date(
258
+ e.getFullYear(),
259
+ e.getMonth() + 1,
260
+ 0
261
+ ).getDate();
262
+ return { nth: Math.ceil(t / 7), last: t + 7 > n };
263
+ }
264
+ function Rt(e, t) {
265
+ const n = new Date(e), o = n.getDate();
266
+ n.setDate(1), n.setMonth(n.getMonth() + t);
267
+ const i = new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate();
268
+ return n.setDate(Math.min(o, i)), n;
269
+ }
270
+ function De(e) {
271
+ const t = new Date(String(e.event.start)), n = e.event.end ? new Date(String(e.event.end)) : void 0;
272
+ return {
273
+ editEventId: e.event.id,
274
+ patientId: E(e.event.patientId) || void 0,
275
+ isTelehealth: e.event.isTelehealth,
276
+ date: t,
277
+ time: { hours: t.getHours(), minutes: t.getMinutes() },
278
+ /* Carry the all-day flag: without it an all-day event re-opens in the
279
+ form as a timed appointment and Save would silently convert it. */
280
+ allDay: e.event.allDay,
281
+ durationMin: n ? Math.round((n.getTime() - t.getTime()) / 6e4) : void 0,
282
+ operatorId: e.operatorId,
283
+ chairId: e.chairId,
284
+ colorHex: e.event.backgroundColor,
285
+ care: e.description,
286
+ cares: e.cares,
287
+ careLink: e.careLink,
288
+ status: e.event.status,
289
+ /* Carried through so a host with no `loadAppointmentDetails` — which
290
+ never sets `detailsMode`, and seeds the editor straight from this
291
+ prefill instead — still routes a task row to the task editor and
292
+ not the appointment editor underneath it. */
293
+ isTask: e.event.isTask
294
+ };
295
+ }
296
+ const ve = "00:15", Lt = (e) => e === "00:10" || e === "00:20" ? e : ve, H = "none", Pt = [15, 30, 45, 60, 90, 120];
297
+ function Wt(e, t) {
298
+ const n = t.replace(/\D/g, "");
299
+ return n.length === 0 || e.replace(/\D/g, "").startsWith(n) ? 1 : 0;
300
+ }
301
+ function xt(e) {
302
+ return (e == null ? void 0 : e.colorHex) ?? "";
303
+ }
304
+ const Te = [
305
+ ...new Set(
306
+ se.map((e) => e.textColor).filter(
307
+ (e) => !!e
308
+ )
309
+ )
310
+ ];
311
+ function ye(e) {
312
+ if (!e) return;
313
+ const t = P(e);
314
+ let n, o = 0;
315
+ for (const i of Te) {
316
+ const s = ie(P(i), t);
317
+ s > o && (o = s, n = i);
318
+ }
319
+ return n;
320
+ }
321
+ function Ft(e, t, n, o) {
322
+ if (e.event.isTask) return {};
323
+ const i = e.event.backgroundColor, s = {
324
+ operatorId: e.operatorId,
325
+ chairId: e.chairId,
326
+ cares: e.cares
327
+ }, r = e.event.status, a = t === "appointment" ? i ? void 0 : x("care", s, n) : t === "status" ? r ? o == null ? void 0 : o[r] : void 0 : x(t, s, n);
328
+ if (!a || a.toLowerCase() === (i == null ? void 0 : i.toLowerCase())) return {};
329
+ const c = (n.appointmentPalette ?? G).find(
330
+ (d) => d.hex.toLowerCase() === a.toLowerCase()
331
+ );
332
+ return {
333
+ backgroundColor: a,
334
+ textColor: (c == null ? void 0 : c.textColor) ?? ye(a),
335
+ borderColor: void 0
336
+ };
337
+ }
338
+ function Ht(e) {
339
+ var n;
340
+ const t = {};
341
+ for (const o of e) {
342
+ if (((n = o.careLink) == null ? void 0 : n.kind) !== "plan") continue;
343
+ const i = new Date(String(o.event.start)).toISOString();
344
+ for (const s of o.careLink.entryIds)
345
+ (t[s] ?? (t[s] = [])).push({ eventId: o.event.id, startIso: i });
346
+ }
347
+ for (const o of Object.values(t))
348
+ o.sort((i, s) => i.startIso.localeCompare(s.startIso));
349
+ return t;
350
+ }
351
+ function B(e, t, n) {
352
+ const o = e.phaseShares;
353
+ if (!o || !n || n.length === 0) return t;
354
+ const i = n.reduce((s, r) => s + (o[r] ?? 0), 0);
355
+ return i > 0 ? Math.round(t * i / 100) : t;
356
+ }
357
+ function Bt(e, t) {
358
+ var o;
359
+ if (!e) return {};
360
+ const n = [];
361
+ if (e.kind === "plan") {
362
+ const i = t.carePlanById(e.planId);
363
+ for (const s of (i == null ? void 0 : i.entries) ?? []) {
364
+ if (!e.entryIds.includes(s.id)) continue;
365
+ const r = t.careById(s.careId);
366
+ r && n.push({
367
+ name: r.name,
368
+ colorHex: r.colorHex,
369
+ durationMin: B(
370
+ r,
371
+ s.durationMin ?? r.durationMin,
372
+ (o = e.phasesByEntry) == null ? void 0 : o[s.id]
373
+ )
374
+ });
375
+ }
376
+ } else
377
+ for (const i of e.items) {
378
+ const s = t.careById(i.careId);
379
+ s && n.push({
380
+ name: s.name,
381
+ colorHex: s.colorHex,
382
+ durationMin: B(s, s.durationMin, i.phases)
383
+ });
384
+ }
385
+ return n.length === 0 ? {} : {
386
+ durationMin: n.reduce((i, s) => i + s.durationMin, 0),
387
+ colorHex: n[0].colorHex,
388
+ description: n.map((i) => i.name).join(", ")
389
+ };
390
+ }
391
+ function Ut(e) {
392
+ const t = e.filter((n) => {
393
+ const o = ae(n.operator, n.patient);
394
+ return o !== "signed" && o !== "notRequired";
395
+ }).length;
396
+ return { toSign: t, allSigned: e.length > 0 && t === 0 };
397
+ }
398
+ function Kt(e, t, n) {
399
+ const o = [];
400
+ t.status && e.event.status && t.status !== e.event.status && o.push({ kind: "status", from: e.event.status, to: t.status });
401
+ const i = [];
402
+ if (!t.allDay && !e.event.allDay) {
403
+ const c = new Date(String(e.event.start)), d = new Date(t.date);
404
+ d.setHours(t.time.hours, t.time.minutes, 0, 0), d.getTime() !== c.getTime() && o.push({
405
+ kind: "moved",
406
+ fromIso: c.toISOString(),
407
+ toIso: d.toISOString()
408
+ });
409
+ const u = e.event.end ? Math.round(
410
+ (new Date(String(e.event.end)).getTime() - c.getTime()) / 6e4
411
+ ) : void 0;
412
+ u !== void 0 && u !== t.durationMin && o.push({ kind: "resized", fromMin: u, toMin: t.durationMin });
413
+ } else !!t.allDay != !!e.event.allDay && i.push("time");
414
+ const r = E(e.event.patientId) || void 0;
415
+ (t.patientId ?? void 0) !== r && i.push("patient"), !!t.isTelehealth != !!e.event.isTelehealth && i.push("type");
416
+ const a = t.careLink ? n.careEntriesFromLink(t.careLink) : t.cares ?? e.cares;
417
+ return N({ description: t.care, cares: a }, "name") !== N({ description: e.description, cares: e.cares }, "name") && i.push("care"), (t.operatorId ?? void 0) !== e.operatorId && i.push("operator"), (t.chairId ?? void 0) !== e.chairId && i.push("chair"), t.colorHex.toLowerCase() !== (e.event.backgroundColor ?? "").toLowerCase() && i.push("colour"), i.length > 0 && o.push({ kind: "edited", fields: i }), o;
418
+ }
419
+ const Yt = {};
420
+ function $t(e) {
421
+ return he(e.priceLists);
422
+ }
423
+ function Gt(e, t) {
424
+ var i, s, r;
425
+ const n = t.priceLists ?? [], o = e ? (i = t.patientById(e)) == null ? void 0 : i.priceList : void 0;
426
+ return ((s = n.find((a) => a.name === o)) == null ? void 0 : s.id) ?? ((r = n[0]) == null ? void 0 : r.id);
427
+ }
428
+ const A = (e) => ({
429
+ variant: le[e],
430
+ tone: W[e].tone,
431
+ Icon: W[e].Icon
432
+ });
433
+ A("confirmed"), A("waiting"), A("in_care"), A("done"), A("cancelled"), A("absent");
434
+ function R(e) {
435
+ return new Date(e.length === 10 ? `${e}T00:00:00` : e).getTime();
436
+ }
437
+ function Se(e, t) {
438
+ return e.appointmentId ? t.baseEvents.find((n) => n.event.id === e.appointmentId) : void 0;
439
+ }
440
+ const Vt = [
441
+ "all",
442
+ "noAppointment",
443
+ "scheduledOver30",
444
+ "waitingOver30"
445
+ ], jt = {
446
+ all: "quickViewAll",
447
+ noAppointment: "quickViewNoAppointment",
448
+ scheduledOver30: "quickViewScheduledOver30",
449
+ waitingOver30: "quickViewWaitingOver30"
450
+ }, Me = 30;
451
+ function J(e, t, n) {
452
+ if (t === "all") return !0;
453
+ if (t === "noAppointment")
454
+ return !e.appointmentId && !!e.patientId;
455
+ const o = Me * 864e5, i = new Date(n.nowIso).getTime();
456
+ if (t === "waitingOver30")
457
+ return i - R(n.waitingSinceIso(e)) > o;
458
+ const s = Se(e, n);
459
+ return s ? i - R(String(s.event.start)) > o : !1;
460
+ }
461
+ function zt(e, t) {
462
+ const n = t.bookingContacts[e.event.id], o = n ? t.patients.find(
463
+ (s) => s.name.toLowerCase() === n.typedName.toLowerCase()
464
+ ) : void 0, i = E(e.event.patientId) || void 0;
465
+ return {
466
+ ...De(e),
467
+ bookingContact: n,
468
+ patientId: (o == null ? void 0 : o.id) ?? i,
469
+ callToAction: "processBooking"
470
+ };
471
+ }
472
+ function Xt(e, t) {
473
+ switch (e) {
474
+ case "processBooking":
475
+ return !!(t.patientId && t.operatorId);
476
+ case "assignOperator":
477
+ return !!t.operatorId;
478
+ default:
479
+ return !0;
480
+ }
481
+ }
482
+ function Qt(e) {
483
+ var t;
484
+ return !!e.patientId || !!((t = e.description) != null && t.trim());
485
+ }
486
+ const Jt = "any", Zt = 20, be = 30, qt = 185, en = 30, tn = 30;
487
+ function nn(e, t) {
488
+ return Math.round((t.getTime() - e.getTime()) / 864e5);
489
+ }
490
+ function M(e) {
491
+ const t = (n) => String(n).padStart(2, "0");
492
+ return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
493
+ }
494
+ function on(e, t) {
495
+ const n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
496
+ if (n) {
497
+ const [i, s, r] = [+n[1], +n[2], +n[3]], a = new Date(i, s - 1, r);
498
+ if (a.getFullYear() === i && a.getMonth() === s - 1 && a.getDate() === r)
499
+ return a;
500
+ }
501
+ const o = new Date(t);
502
+ return new Date(o.getFullYear(), o.getMonth(), o.getDate());
503
+ }
504
+ function U(e) {
505
+ if (!e) return [{ startMin: 0, endMin: 1440 }];
506
+ const t = [];
507
+ return e.startMin > 0 && t.push({ startMin: 0, endMin: e.startMin }), e.endMin < 1440 && t.push({ startMin: e.endMin, endMin: 1440 }), t;
508
+ }
509
+ function Z(e, t) {
510
+ if (!e || !t) return;
511
+ const n = Math.max(e.startMin, t.startMin), o = Math.min(e.endMin, t.endMin);
512
+ return n < o ? { startMin: n, endMin: o } : void 0;
513
+ }
514
+ function sn(e, t) {
515
+ var r, a;
516
+ const n = [], o = (c, d, u) => {
517
+ var I;
518
+ const l = M(c);
519
+ if (e.wholeDayOnly) {
520
+ const g = U(d);
521
+ if (!(g.length === 1 && g[0].startMin === 0 && g[0].endMin === 1440)) return;
522
+ n.push({
523
+ id: `unavail-${l}-${u ?? "all"}-day`,
524
+ title: "",
525
+ start: l,
526
+ allDay: !0,
527
+ isInternal: !0,
528
+ ...u === void 0 ? {} : { resourceId: u }
529
+ });
530
+ return;
531
+ }
532
+ const m = U(d), h = d ? ((I = t.closedIntervals) == null ? void 0 : I[l]) ?? [] : [];
533
+ [...m, ...h].forEach((g, y) => {
534
+ const T = new Date(c);
535
+ T.setMinutes(g.startMin);
536
+ const D = new Date(c);
537
+ D.setMinutes(g.endMin), n.push({
538
+ id: `unavail-${l}-${u ?? "all"}-${y < m.length ? y : `closed-${y - m.length}`}`,
539
+ title: "",
540
+ start: T.toISOString(),
541
+ end: D.toISOString(),
542
+ isInternal: !0,
543
+ ...u === void 0 ? {} : { resourceId: u }
544
+ });
545
+ });
546
+ }, i = new Date(e.rangeStart);
547
+ i.setHours(0, 0, 0, 0);
548
+ const s = new Date(e.rangeEnd);
549
+ for (s.setHours(0, 0, 0, 0); i.getTime() <= s.getTime(); ) {
550
+ const c = t.practiceClosedOn(M(i)) ? void 0 : t.businessHours.practice[i.getDay()];
551
+ if (e.axisKind === "none")
552
+ o(i, c);
553
+ else if (e.axisKind === "chair")
554
+ for (const d of e.visibleChairIds)
555
+ o(i, c, d);
556
+ else {
557
+ const d = M(i);
558
+ for (const u of e.visibleOperatorIds) {
559
+ if ((r = t.operatorAbsences[u]) != null && r.includes(d)) {
560
+ e.columnsHiddenWhenAbsent || o(i, void 0, u);
561
+ continue;
562
+ }
563
+ o(
564
+ i,
565
+ Z(
566
+ c,
567
+ (a = t.businessHours.operators[u]) == null ? void 0 : a[i.getDay()]
568
+ ),
569
+ u
570
+ );
571
+ }
572
+ }
573
+ i.setDate(i.getDate() + 1);
574
+ }
575
+ return n;
576
+ }
577
+ const Ee = "var(--warning)";
578
+ function Ae(e) {
579
+ return e.id.startsWith("closure-");
580
+ }
581
+ function an(e, t) {
582
+ var c;
583
+ const n = [], o = G[10], i = (d, u, l, m, h) => {
584
+ n.push({
585
+ id: `closure-${d}-${u}-${h ?? "all"}`,
586
+ title: l,
587
+ start: u,
588
+ allDay: !0,
589
+ editable: !1,
590
+ startEditable: !1,
591
+ ...m,
592
+ ...h === void 0 ? {} : { resourceId: h }
593
+ });
594
+ }, s = e.axisKind === "chair" ? e.visibleChairIds : e.axisKind === "operator" ? e.visibleOperatorIds : [void 0], r = new Date(e.rangeStart);
595
+ r.setHours(0, 0, 0, 0);
596
+ const a = new Date(e.rangeEnd);
597
+ for (a.setHours(0, 0, 0, 0); r.getTime() <= a.getTime(); ) {
598
+ const d = M(r), u = t.holidays.find((l) => l.dateIso === d);
599
+ if (t.closedDates.includes(d))
600
+ for (const l of s)
601
+ i(
602
+ "closed",
603
+ d,
604
+ e.labels.closed,
605
+ {
606
+ backgroundColor: o.hex,
607
+ textColor: o.textColor
608
+ },
609
+ l
610
+ );
611
+ else if (u)
612
+ for (const l of s)
613
+ i(
614
+ "holiday",
615
+ d,
616
+ e.labels.holiday(u.name),
617
+ {
618
+ backgroundColor: Ee
619
+ },
620
+ l
621
+ );
622
+ if (e.axisKind === "operator" && !e.columnsHiddenWhenAbsent && !t.practiceClosedOn(d))
623
+ for (const l of e.visibleOperatorIds)
624
+ (c = t.operatorAbsences[l]) != null && c.includes(d) && i(
625
+ "absence",
626
+ d,
627
+ e.labels.absence(t.operatorAbsenceTitles[l]),
628
+ { backgroundColor: o.hex, textColor: o.textColor },
629
+ l
630
+ );
631
+ r.setDate(r.getDate() + 1);
632
+ }
633
+ return n;
634
+ }
635
+ function L(e, t) {
636
+ if (!t) return e.title;
637
+ const n = e.privacyModeTitle;
638
+ return n !== void 0 && n.trim() !== "" ? n : "•••";
639
+ }
640
+ function ke(e, t, n) {
641
+ const { event: o } = e, i = z(o, n).record, s = n.bookingContacts[o.id];
642
+ let r = [];
643
+ return t || (r = i ? ue(i) : [], r.length === 0 && s && (r = [{ label: "mobile", number: s.phone }])), {
644
+ id: o.id,
645
+ start: w(o.start),
646
+ end: o.end ? w(o.end) : void 0,
647
+ allDay: !!o.allDay,
648
+ patientName: L(o, t),
649
+ phones: r,
650
+ yearlyNumber: t ? void 0 : (i == null ? void 0 : i.yearlyNumber) || void 0,
651
+ description: e.description,
652
+ careLines: e.cares ?? [],
653
+ chairId: e.chairId,
654
+ operatorId: e.operatorId,
655
+ status: o.status,
656
+ unassigned: o.hasUnassignedPatient === !0
657
+ };
658
+ }
659
+ function we(e, t) {
660
+ return e.allDay !== t.allDay ? e.allDay ? -1 : 1 : e.start.getTime() - t.start.getTime();
661
+ }
662
+ function rn(e, t) {
663
+ const { rows: n, days: o, axisKind: i, visibleChairIds: s, visibleOperatorIds: r, privacy: a } = e, c = n.filter(
664
+ (l) => (!l.chairId || s.includes(l.chairId)) && (!l.operatorId || r.includes(l.operatorId))
665
+ ), d = t.chairs.filter((l) => s.includes(l.id)), u = t.operators.filter(
666
+ (l) => r.includes(l.id)
667
+ );
668
+ return o.map((l) => {
669
+ const m = M(l), h = c.filter(
670
+ (p) => M(w(p.event.start)) === m
671
+ ), I = h.filter(
672
+ (p) => !p.event.isTask && !p.event.isInternal && !p.event.isDraft && !Ae(p.event)
673
+ ).map((p) => ke(p, a, t)).sort(we);
674
+ let g;
675
+ if (i === "chair")
676
+ g = d.map((p) => ({
677
+ id: p.id,
678
+ kind: "chair",
679
+ title: p.title,
680
+ rows: I.filter((f) => f.chairId === p.id)
681
+ }));
682
+ else if (i === "operator") {
683
+ g = u.map((f) => ({
684
+ id: f.id,
685
+ kind: "operator",
686
+ title: f.title,
687
+ rows: I.filter((O) => O.operatorId === f.id)
688
+ }));
689
+ const p = I.filter((f) => !f.operatorId);
690
+ p.length > 0 && g.push({
691
+ id: "no-operator",
692
+ kind: "no-operator",
693
+ rows: p
694
+ });
695
+ } else
696
+ g = [{ id: "all", kind: "all", rows: I }];
697
+ const y = h.filter((p) => p.event.isTask).map((p) => ({
698
+ id: p.event.id,
699
+ start: w(p.event.start),
700
+ allDay: !!p.event.allDay,
701
+ title: L(p.event, a)
702
+ })).sort(
703
+ (p, f) => p.allDay !== f.allDay ? p.allDay ? -1 : 1 : p.start.getTime() - f.start.getTime()
704
+ ), T = [], D = t.closureOn(m);
705
+ if (D ? T.push(D) : t.businessHours.practice[l.getDay()] || T.push({ kind: "nonWorking" }), !t.practiceClosedOn(m))
706
+ for (const p of u) {
707
+ const f = t.closureOn(m, p.id);
708
+ (f == null ? void 0 : f.kind) === "absence" && T.push(f);
709
+ }
710
+ return { date: l, groups: g, tasks: y, notes: T };
711
+ });
712
+ }
713
+ const Oe = 26, Ce = 10, Ne = 22, _e = 20, cn = "ds:[--ag-cell-horizontal-padding:var(--spacing-sm)]";
714
+ function dn(e, t = 1) {
715
+ const n = e.patientName.length + (e.yearlyNumber ? e.yearlyNumber.length + 3 : 0), o = Math.max(1, Math.ceil(n / _e)) + e.phones.length + (e.unassigned ? 2 : 0), i = (e.description ? Math.ceil(e.description.length / Ne) : 0) + e.careLines.reduce(
716
+ (s, r) => {
717
+ var a;
718
+ return s + 1 + ((a = r.elements) != null && a.length ? 1 : 0);
719
+ },
720
+ 0
721
+ );
722
+ return Ce + Oe * Math.max(o, i, t, 1);
723
+ }
724
+ function un(e, t, n, o, i) {
725
+ var r;
726
+ const s = ce(t, o);
727
+ switch (n.kind) {
728
+ case "closed":
729
+ return e("calendarWorkspace.closures.closedReason", { date: s });
730
+ case "holiday":
731
+ return e("calendarWorkspace.closures.holidayReason", {
732
+ date: s,
733
+ name: n.name
734
+ });
735
+ case "absence":
736
+ return e("calendarWorkspace.closures.absenceReason", {
737
+ date: s,
738
+ operator: ((r = i.operators.find((a) => a.id === n.operatorId)) == null ? void 0 : r.title) ?? ""
739
+ });
740
+ }
741
+ }
742
+ function Re(e, t) {
743
+ const n = /* @__PURE__ */ new Map();
744
+ for (const i of e) {
745
+ const r = M(i.start), a = n.get(r) ?? { resourceId: void 0, slots: [] };
746
+ a.slots.push(i), n.set(r, a);
747
+ }
748
+ const o = [];
749
+ for (const [i, s] of n) {
750
+ const r = [...s.slots].sort(
751
+ (c, d) => c.start.getTime() - d.start.getTime()
752
+ );
753
+ let a = null;
754
+ for (const c of r) {
755
+ const d = c.start.getTime(), u = d + c.durationMin * 6e4;
756
+ if (a && d <= a.end.getTime()) {
757
+ u > a.end.getTime() && (a.end = new Date(u));
758
+ continue;
759
+ }
760
+ a = {
761
+ key: `${i}:${d}`,
762
+ start: new Date(d),
763
+ end: new Date(u),
764
+ ...s.resourceId ? { resourceId: s.resourceId } : {}
765
+ }, o.push(a);
766
+ }
767
+ }
768
+ return o.sort((i, s) => i.start.getTime() - s.start.getTime());
769
+ }
770
+ function ln(e) {
771
+ const t = e.filter(
772
+ (o) => Number.isFinite(o.start.getTime()) && Number.isFinite(o.durationMin) && o.durationMin > 0 && Number.isFinite(
773
+ new Date(o.start.getTime() + o.durationMin * 6e4).getTime()
774
+ )
775
+ ), n = [];
776
+ for (const o of t) {
777
+ const i = o.start.getTime() + o.durationMin * 6e4;
778
+ if (Number.isFinite(i))
779
+ for (let s = o.start.getTime(); s < i; ) {
780
+ const r = new Date(s);
781
+ r.setHours(24, 0, 0, 0);
782
+ const a = Math.min(i, r.getTime());
783
+ n.push({
784
+ ...o,
785
+ start: new Date(s),
786
+ durationMin: (a - s) / 6e4
787
+ }), s = a;
788
+ }
789
+ }
790
+ return Re(n).map((o) => {
791
+ const i = [
792
+ ...new Map(
793
+ t.filter(
794
+ (s) => s.start.getTime() < o.end.getTime() && s.start.getTime() + s.durationMin * 6e4 > o.start.getTime()
795
+ ).map((s) => [
796
+ JSON.stringify([
797
+ s.start.getTime(),
798
+ s.durationMin,
799
+ s.chairId,
800
+ s.operatorId,
801
+ s.careId,
802
+ s.medicalDeviceId
803
+ ]),
804
+ s
805
+ ])
806
+ ).values()
807
+ ];
808
+ return {
809
+ ...o,
810
+ options: i,
811
+ optionCount: new Set(
812
+ i.map((s) => JSON.stringify([s.chairId, s.operatorId]))
813
+ ).size
814
+ };
815
+ });
816
+ }
817
+ function pn(e, t) {
818
+ const n = /* @__PURE__ */ new Map();
819
+ for (const o of e) {
820
+ if (!Number.isFinite(o.start.getTime()) || !Number.isFinite(o.durationMin) || o.durationMin <= 0)
821
+ continue;
822
+ const i = t === "operator" ? o.operatorId : t === "chair" ? o.chairId : void 0, s = o.start.getTime(), r = s + o.durationMin * 6e4;
823
+ if (!Number.isFinite(r)) continue;
824
+ const a = `${i ?? ""}:${s}:${r}`, c = JSON.stringify([o.chairId, o.operatorId]), d = JSON.stringify([
825
+ o.chairId,
826
+ o.operatorId,
827
+ o.careId,
828
+ o.medicalDeviceId
829
+ ]), u = n.get(a);
830
+ u ? (u.combos.add(c), u.answers.add(d)) : n.set(a, {
831
+ start: new Date(s),
832
+ end: new Date(r),
833
+ resourceId: i,
834
+ combos: /* @__PURE__ */ new Set([c]),
835
+ answers: /* @__PURE__ */ new Set([d])
836
+ });
837
+ }
838
+ return [...n.entries()].map(([o, i]) => ({
839
+ key: o,
840
+ start: i.start,
841
+ end: i.end,
842
+ optionCount: i.combos.size,
843
+ slotCount: i.answers.size,
844
+ ...i.resourceId ? { resourceId: i.resourceId } : {}
845
+ })).sort((o, i) => o.start.getTime() - i.start.getTime());
846
+ }
847
+ function fn(e, t) {
848
+ var d;
849
+ const n = e.durationMin, o = new Date(t.nowIso).getTime(), i = Number.isNaN(o) ? Number.NEGATIVE_INFINITY : o, s = e.rows.filter((u) => !u.event.allDay && u.event.end).map((u) => ({
850
+ chairId: u.chairId,
851
+ operatorId: u.event.isTask ? void 0 : u.operatorId,
852
+ start: new Date(String(u.event.start)).getTime(),
853
+ end: new Date(String(u.event.end)).getTime()
854
+ })), r = [], a = new Date(e.fromDate);
855
+ a.setHours(0, 0, 0, 0);
856
+ const c = new Date(e.toDate);
857
+ for (c.setHours(0, 0, 0, 0); a.getTime() <= c.getTime(); ) {
858
+ const u = M(a);
859
+ if (t.dayLoadState && t.dayLoadState[u] !== "ready") {
860
+ a.setDate(a.getDate() + 1);
861
+ continue;
862
+ }
863
+ const l = t.businessHours.practice[a.getDay()];
864
+ if (!l || t.practiceClosedOn(u)) {
865
+ a.setDate(a.getDate() + 1);
866
+ continue;
867
+ }
868
+ const m = e.operators.filter(
869
+ (I) => !(t.operatorAbsences[I.id] ?? []).includes(u)
870
+ ), h = ((d = t.closedIntervals) == null ? void 0 : d[u]) ?? [];
871
+ for (const I of e.chairs)
872
+ for (const g of m) {
873
+ const y = t.businessHours.operators[g.id], T = y ? Z(l, y[a.getDay()]) : l;
874
+ if (T)
875
+ for (let D = T.startMin; D + n <= T.endMin; D += be) {
876
+ if (h.some(
877
+ (b) => D < b.endMin && D + n > b.startMin
878
+ ))
879
+ continue;
880
+ const p = new Date(a);
881
+ p.setHours(Math.floor(D / 60), D % 60, 0, 0);
882
+ const f = p.getTime();
883
+ if (f < i) continue;
884
+ const O = f + n * 6e4;
885
+ s.some(
886
+ (b) => f < b.end && O > b.start && (b.chairId === I.id || b.operatorId === g.id)
887
+ ) || r.push({
888
+ start: p,
889
+ durationMin: n,
890
+ chairId: I.id,
891
+ operatorId: g.id,
892
+ careId: e.careId
893
+ });
894
+ }
895
+ }
896
+ a.setDate(a.getDate() + 1);
897
+ }
898
+ return r.sort((u, l) => u.start.getTime() - l.start.getTime()), r;
899
+ }
900
+ const S = {
901
+ appointments: "appointments",
902
+ editor: "appointment-editor",
903
+ waitingList: "waiting-list",
904
+ notes: "patient-notes",
905
+ bookings: "online-bookings",
906
+ findSlots: "find-slots",
907
+ settings: "settings"
908
+ }, q = [
909
+ S.appointments,
910
+ S.editor,
911
+ S.waitingList,
912
+ S.notes,
913
+ S.bookings,
914
+ S.findSlots,
915
+ S.settings
916
+ ];
917
+ function mn(e) {
918
+ const t = new Set(
919
+ q.filter((n) => e.includes(n))
920
+ );
921
+ return t.add(S.appointments), t.add(S.settings), t;
922
+ }
923
+ const Le = new Set(q);
924
+ function Pe(e) {
925
+ return Le.has(e);
926
+ }
927
+ function hn(e) {
928
+ const t = [], n = [], o = /* @__PURE__ */ new Set();
929
+ for (const i of e) {
930
+ const s = i == null ? void 0 : i.id;
931
+ typeof s != "string" || s.trim() === "" ? n.push({ id: typeof s == "string" ? s : "", reason: "empty" }) : Pe(s) ? n.push({ id: s, reason: "reserved" }) : o.has(s) ? n.push({ id: s, reason: "duplicate" }) : (o.add(s), t.push(i));
932
+ }
933
+ return { tools: t, rejected: n };
934
+ }
935
+ const ee = [
936
+ "day",
937
+ "threeDays",
938
+ "week",
939
+ "month"
940
+ ], gn = {
941
+ day: "Day",
942
+ threeDays: "ThreeDays",
943
+ week: "Week",
944
+ month: "Month"
945
+ }, We = {
946
+ day: "D",
947
+ threeDays: "X",
948
+ week: "W",
949
+ month: "M"
950
+ }, In = v(ee);
951
+ function xe(e) {
952
+ const t = e.toUpperCase();
953
+ return ee.find((n) => We[n] === t);
954
+ }
955
+ const Fe = [
956
+ "input",
957
+ "textarea",
958
+ "select",
959
+ '[contenteditable=""]',
960
+ '[contenteditable="true"]',
961
+ '[role="menu"]',
962
+ '[role="menubar"]',
963
+ '[role="listbox"]',
964
+ '[role="combobox"]',
965
+ '[role="textbox"]',
966
+ '[role="dialog"]',
967
+ '[role="alertdialog"]'
968
+ ].join(", ");
969
+ function He(e) {
970
+ return e instanceof Element ? e.closest(Fe) === null : !0;
971
+ }
972
+ function Dn(e) {
973
+ if (!(e.defaultPrevented || e.repeat) && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) && He(e.target))
974
+ return xe(e.key);
975
+ }
976
+ const vn = [0];
977
+ function Tn(e) {
978
+ return e ? [] : [0, 6];
979
+ }
980
+ const yn = [1, 2, 3, 4, 5, 6, 0];
981
+ function Sn(e) {
982
+ if (!Array.isArray(e)) return;
983
+ const t = /* @__PURE__ */ new Set();
984
+ for (const n of e) {
985
+ if (!Number.isInteger(n) || n < 0 || n > 6) return;
986
+ t.add(n);
987
+ }
988
+ return t.size >= 7 ? void 0 : [...t].sort((n, o) => n - o);
989
+ }
990
+ const K = { min: 5, max: 240 }, Be = {
991
+ ...ge,
992
+ /* The My calendar defaults follow the business-rules table (11 Nov):
993
+ Extended hours, no care text on cards, coloured by care. A saved
994
+ value always wins over these. */
995
+ window: "extended",
996
+ careDescription: "off",
997
+ colorAssociation: "care",
998
+ defaultDurationMin: 30,
999
+ operatorNameDisplay: "initials",
1000
+ chairNameDisplay: "full",
1001
+ mapsLink: !1,
1002
+ showCancelled: !1,
1003
+ operatorListMode: "grouped"
1004
+ }, Ue = v([
1005
+ "full",
1006
+ "initials"
1007
+ ]), Ke = v(["full", "short"]), Ye = v(["grouped", "flat"]);
1008
+ function $e(e) {
1009
+ if (typeof e != "number" || !Number.isFinite(e)) return;
1010
+ const t = Math.round(e);
1011
+ return t >= K.min && t <= K.max ? t : void 0;
1012
+ }
1013
+ function Mn(e) {
1014
+ if (!e || typeof e != "object") return;
1015
+ const t = e, n = { ...Be };
1016
+ for (const d of Object.keys(X))
1017
+ Ie(n, d, t[d]);
1018
+ const o = $e(t.defaultDurationMin);
1019
+ o !== void 0 && (n.defaultDurationMin = o);
1020
+ const i = Ue(t.operatorNameDisplay);
1021
+ i !== void 0 && (n.operatorNameDisplay = i);
1022
+ const s = Ke(t.chairNameDisplay);
1023
+ s !== void 0 && (n.chairNameDisplay = s);
1024
+ const r = k(t.mapsLink);
1025
+ r !== void 0 && (n.mapsLink = r);
1026
+ const a = k(t.showCancelled);
1027
+ a !== void 0 && (n.showCancelled = a);
1028
+ const c = Ye(t.operatorListMode);
1029
+ return c !== void 0 && (n.operatorListMode = c), n;
1030
+ }
1031
+ function Y(e) {
1032
+ const t = (n) => String(n).padStart(2, "0");
1033
+ return `${t(Math.floor(e / 60))}:${t(e % 60)}`;
1034
+ }
1035
+ function Ge(e) {
1036
+ const t = Object.values(e.businessHours.practice).filter(
1037
+ (i) => i !== void 0
1038
+ );
1039
+ if (t.length === 0) return Q.working;
1040
+ const n = Math.min(...t.map((i) => i.startMin)), o = Math.max(...t.map((i) => i.endMin));
1041
+ return { min: Y(n), max: Y(o) };
1042
+ }
1043
+ function bn(e, t) {
1044
+ return e === "working" ? Ge(t) : Q[e];
1045
+ }
1046
+ function En(e, t) {
1047
+ return e.length > 0 ? [...e] : [...t];
1048
+ }
1049
+ function An(e, t, n) {
1050
+ return n === !0 ? [...e, ...t.filter((o) => !e.includes(o))] : e.filter((o) => !t.includes(o));
1051
+ }
1052
+ function kn(e, t) {
1053
+ return e.length + t.length;
1054
+ }
1055
+ function wn(e, t, n) {
1056
+ if (!n) return [];
1057
+ const o = new Set(t), i = /* @__PURE__ */ new Set();
1058
+ for (const s of e) {
1059
+ const r = s.operatorId;
1060
+ if (!r || !o.has(r) || i.has(r) || s.event.isTask || s.event.isInternal) continue;
1061
+ const a = new Date(String(s.event.start)).getTime();
1062
+ a >= n.start && a < n.end && i.add(r);
1063
+ }
1064
+ return t.filter((s) => i.has(s));
1065
+ }
1066
+ function On(e) {
1067
+ const t = new Set(e.inactiveIds), n = new Set(e.keepIds);
1068
+ return e.operators.filter((o) => !t.has(o.id) || e.showDisabled || n.has(o.id)).map((o) => o.id);
1069
+ }
1070
+ function Cn(e, t, n) {
1071
+ if (n) return [...e];
1072
+ const o = new Set(t);
1073
+ return e.filter((i) => !o.has(i.id));
1074
+ }
1075
+ function Nn(e, t) {
1076
+ return t === "full" ? e.title : e.shortTitle ?? e.title.replace(/\s+/g, "").slice(0, 2);
1077
+ }
1078
+ function _n(e, t, n) {
1079
+ return t ? `${e.title} · ${n}` : e.title;
1080
+ }
1081
+ function Rn(e, t) {
1082
+ return Math.round(
1083
+ (new Date(t).getTime() - new Date(e).getTime()) / 6e4
1084
+ );
1085
+ }
1086
+ function Ln(e, t, n) {
1087
+ return e.map(
1088
+ (o) => o.event.id === t ? { ...o, event: { ...o.event, end: n } } : o
1089
+ );
1090
+ }
1091
+ const Pn = [
1092
+ "this",
1093
+ "following",
1094
+ "all"
1095
+ ], Wn = {
1096
+ this: "scopeThis",
1097
+ following: "scopeFollowing",
1098
+ all: "scopeAll"
1099
+ };
1100
+ function xn(e, t) {
1101
+ const n = (o) => o && e.options.some((i) => i.id === o && !i.busy) ? o : void 0;
1102
+ return n(t) ?? n(e.assignedId);
1103
+ }
1104
+ function Fn(e) {
1105
+ return !!(e != null && e.series && !e.series.detached);
1106
+ }
1107
+ function Hn(e, t, n) {
1108
+ const o = e.find((s) => s.event.id === t);
1109
+ if (!(o != null && o.series) || n === "this") return [t];
1110
+ const i = o.series;
1111
+ return e.filter(
1112
+ (s) => {
1113
+ var r;
1114
+ return ((r = s.series) == null ? void 0 : r.id) === i.id && (n === "all" || s.series.index >= i.index);
1115
+ }
1116
+ ).sort((s, r) => {
1117
+ var a, c;
1118
+ return (((a = s.series) == null ? void 0 : a.index) ?? 0) - (((c = r.series) == null ? void 0 : c.index) ?? 0);
1119
+ }).map((s) => s.event.id);
1120
+ }
1121
+ function Bn(e, t) {
1122
+ const n = t.start.getTime(), o = t.end.getTime();
1123
+ let i = !1, s = !1;
1124
+ for (const r of e) {
1125
+ const a = r.event;
1126
+ if (a.id === t.excludeEventId || a.isTask || a.isInternal || a.allDay || !a.end || a.status === "cancelled" || a.status === "absent") continue;
1127
+ const c = new Date(a.start).getTime(), d = new Date(a.end).getTime();
1128
+ c < o && n < d && (t.chairId && r.chairId === t.chairId && (i = !0), t.operatorId && r.operatorId === t.operatorId && (s = !0));
1129
+ }
1130
+ return { chairBusy: i, operatorBusy: s };
1131
+ }
1132
+ function Un(e, t) {
1133
+ const n = [];
1134
+ for (const o of e ?? [])
1135
+ for (const i of o.careId ? t[o.careId] ?? [] : [])
1136
+ n.includes(i) || n.push(i);
1137
+ return n;
1138
+ }
1139
+ function Kn(e) {
1140
+ return {
1141
+ sms: F(e, "sms"),
1142
+ email: F(e, "email")
1143
+ };
1144
+ }
1145
+ function Yn() {
1146
+ return "none";
1147
+ }
1148
+ function $n(e, t, n, o) {
1149
+ const i = new Date(e.event.start), s = e.event.end ? new Date(e.event.end) : void 0, r = s ? s.getTime() - i.getTime() : 0, a = (m) => String(m).padStart(2, "0"), c = new Date(t.start), d = e.event.allDay ? `${c.getFullYear()}-${a(c.getMonth() + 1)}-${a(c.getDate())}` : c.toISOString(), u = e.event.allDay || !s ? void 0 : new Date(c.getTime() + r).toISOString();
1150
+ return {
1151
+ event: {
1152
+ ...e.event,
1153
+ id: n,
1154
+ /* C5: the status is not copied; the copy starts as any new one. */
1155
+ status: "confirmed",
1156
+ start: d,
1157
+ end: u,
1158
+ resourceId: void 0,
1159
+ isRecurring: void 0,
1160
+ isRecurrenceParent: void 0
1161
+ },
1162
+ chairId: e.chairId,
1163
+ operatorId: e.operatorId,
1164
+ description: e.description,
1165
+ cares: o ? e.cares : void 0,
1166
+ careLink: o ? e.careLink : void 0,
1167
+ series: void 0,
1168
+ /* A copy stays in the archive it was copied from (rule H7). */
1169
+ ...e.archiveId ? { archiveId: e.archiveId } : {}
1170
+ };
1171
+ }
1172
+ function Gn(e, t, n, o, i) {
1173
+ if (o.length === 0 || n.allDay) return [...e];
1174
+ const s = new Date(t.event.start), r = new Date(n.date);
1175
+ r.setHours(n.time.hours, n.time.minutes, 0, 0);
1176
+ const a = r.getTime() - s.getTime(), c = n.careLink ? i.careEntriesFromLink(n.careLink) : void 0;
1177
+ return e.map((d) => {
1178
+ if (!o.includes(d.event.id) || d.event.allDay) return d;
1179
+ const u = new Date(new Date(d.event.start).getTime() + a), l = new Date(u.getTime() + n.durationMin * 6e4);
1180
+ return {
1181
+ ...d,
1182
+ chairId: n.chairId ?? void 0,
1183
+ operatorId: n.operatorId ?? void 0,
1184
+ description: n.care,
1185
+ cares: c ?? n.cares ?? d.cares,
1186
+ event: {
1187
+ ...d.event,
1188
+ start: u.toISOString(),
1189
+ end: l.toISOString(),
1190
+ status: n.status ?? d.event.status,
1191
+ backgroundColor: n.colorHex || void 0,
1192
+ isTelehealth: n.isTelehealth || void 0,
1193
+ operatorId: n.operatorId ?? void 0
1194
+ }
1195
+ };
1196
+ });
1197
+ }
1198
+ function Vn(e, t) {
1199
+ const n = [], o = e.date.getTime();
1200
+ return (!t.visibleRange || o < t.visibleRange.start || o >= t.visibleRange.end) && n.push("range"), t.hiddenDays.includes(e.date.getDay()) && n.push("day"), e.chairId && t.selectedChairIds.length > 0 && !t.selectedChairIds.includes(e.chairId) && n.push("chair"), e.operatorId && t.selectedOperatorIds.length > 0 && !t.selectedOperatorIds.includes(e.operatorId) && n.push("operator"), n;
1201
+ }
1202
+ const Ve = 7, je = 7, te = 180, jn = {
1203
+ backDays: 0,
1204
+ forwardDays: Ve
1205
+ };
1206
+ function ze(e, t) {
1207
+ const n = new Date(e);
1208
+ n.setHours(0, 0, 0, 0);
1209
+ const o = new Date(t);
1210
+ return o.setHours(0, 0, 0, 0), Math.round((o.getTime() - n.getTime()) / 864e5);
1211
+ }
1212
+ function zn(e, t) {
1213
+ const n = new Date(e);
1214
+ n.setDate(n.getDate() - t.backDays), n.setHours(0, 0, 0, 0);
1215
+ const o = new Date(e);
1216
+ return o.setDate(o.getDate() + t.forwardDays), o.setHours(23, 59, 59, 999), { startMs: n.getTime(), endMs: o.getTime() };
1217
+ }
1218
+ function Xn(e, t) {
1219
+ const n = (o) => Math.min(te, o + je);
1220
+ return t === "earlier" ? { ...e, backDays: n(e.backDays) } : { ...e, forwardDays: n(e.forwardDays) };
1221
+ }
1222
+ function Qn(e, t, n) {
1223
+ const o = ze(t, n), i = (s, r) => Math.min(te, Math.max(s, r));
1224
+ return o < 0 ? { ...e, backDays: i(e.backDays, -o) } : { ...e, forwardDays: i(e.forwardDays, o) };
1225
+ }
1226
+ function Jn(e, t) {
1227
+ return e.filter((n) => {
1228
+ const o = n.event;
1229
+ if (o.isTask || o.isInternal || o.isDraft || o.status === "cancelled") return !1;
1230
+ const i = new Date(o.start).getTime();
1231
+ return i >= t.startMs && i <= t.endMs;
1232
+ }).sort(
1233
+ (n, o) => new Date(n.event.start).getTime() - new Date(o.event.start).getTime()
1234
+ );
1235
+ }
1236
+ function Zn(e, t, n, o, i) {
1237
+ var m;
1238
+ const s = e.event, r = new Date(s.start), a = s.end ? new Date(s.end) : r, c = n.operators.find((h) => h.id === e.operatorId), d = n.chairs.find((h) => h.id === e.chairId), u = z(s, n), l = t ? L(s, !0) : me(u, s.title, o);
1239
+ return {
1240
+ id: s.id,
1241
+ startIso: typeof s.start == "string" ? s.start : r.toISOString(),
1242
+ durationMin: Math.max(
1243
+ 0,
1244
+ Math.round((a.getTime() - r.getTime()) / 6e4)
1245
+ ),
1246
+ state: s.status,
1247
+ type: s.isTelehealth ? "telehealth" : "inPractice",
1248
+ operator: c ? { name: c.title } : void 0,
1249
+ chair: d == null ? void 0 : d.title,
1250
+ /* Still loading: the row says so in its own words rather than read
1251
+ as an appointment nobody is booked into. */
1252
+ patient: s.detailsPending ? { name: i ?? o } : u.assigned ? { name: l } : void 0,
1253
+ treatments: (m = e.cares) == null ? void 0 : m.map((h) => ({
1254
+ careName: h.name,
1255
+ elements: h.elements
1256
+ })),
1257
+ flags: {
1258
+ bookedOnline: s.isBookedOnline,
1259
+ noPatientAssigned: s.hasUnassignedPatient,
1260
+ highlightedAnamnesis: s.hasHighlightedAnamnesis,
1261
+ billable: s.hasBillableAmount
1262
+ }
1263
+ };
1264
+ }
1265
+ function Xe(e, t) {
1266
+ const n = e.event;
1267
+ return n.isTask || n.status === "cancelled" ? !1 : n.hasUnassignedPatient === !0 || !e.operatorId || t.chairs.length > 0 && !e.chairId;
1268
+ }
1269
+ function Qe(e, t) {
1270
+ return e.filter((n) => Xe(n, t));
1271
+ }
1272
+ function Je(e, t, n, o) {
1273
+ const i = e.event, s = String(i.id), r = t.bookingContacts[s], a = o ?? (r == null ? void 0 : r.bookedAtIso), c = a ? new Date(a) : null, d = t.chairs.find((u) => u.id === e.chairId);
1274
+ return {
1275
+ row: e,
1276
+ eventId: s,
1277
+ start: new Date(i.start),
1278
+ bookedAt: c && Number.isFinite(c.getTime()) ? c : null,
1279
+ reason: e.description ?? null,
1280
+ chairTitle: (d == null ? void 0 : d.title) ?? null,
1281
+ paidOnline: t.paidOnline[s] ?? null,
1282
+ needsPatient: i.hasUnassignedPatient === !0,
1283
+ needsOperator: !e.operatorId,
1284
+ needsChair: t.chairs.length > 0 && !e.chairId,
1285
+ bookedOnline: i.isBookedOnline === !0,
1286
+ isNew: c && n != null ? c.getTime() >= n : !1
1287
+ };
1288
+ }
1289
+ const qn = {
1290
+ patient: !0,
1291
+ operator: !0,
1292
+ chair: !0
1293
+ };
1294
+ function eo(e, t, n, o) {
1295
+ const i = (n == null ? void 0 : n.rows) ?? Qe(e, t), s = n != null && n.lastSeenIso ? new Date(n.lastSeenIso).getTime() : null, r = i.map(
1296
+ (a) => {
1297
+ var c;
1298
+ return Je(a, t, s, (c = n == null ? void 0 : n.createdAtById) == null ? void 0 : c[a.event.id]);
1299
+ }
1300
+ );
1301
+ return Ze(r, o).map((a) => a.row);
1302
+ }
1303
+ function Ze(e, t) {
1304
+ return e.filter(
1305
+ (n) => t.patient && n.needsPatient || t.operator && n.needsOperator || t.chair && n.needsChair
1306
+ );
1307
+ }
1308
+ const to = {
1309
+ patientId: "",
1310
+ patientAssigned: "",
1311
+ operatorId: "",
1312
+ appointmentScheduled: "",
1313
+ description: ""
1314
+ };
1315
+ function no(e) {
1316
+ return [
1317
+ e.patientId,
1318
+ e.patientAssigned,
1319
+ e.operatorId,
1320
+ e.appointmentScheduled,
1321
+ e.appointmentFrom,
1322
+ e.appointmentTo,
1323
+ e.waitingFrom,
1324
+ e.waitingTo,
1325
+ e.description.trim()
1326
+ ].filter(Boolean).length;
1327
+ }
1328
+ function qe(e, t, n) {
1329
+ var c, d, u;
1330
+ const o = e.appointmentId ? t.find((l) => l.event.id === e.appointmentId) : void 0, i = _(e.patientId, n), s = _(
1331
+ o == null ? void 0 : o.event.patientId,
1332
+ n
1333
+ ), r = e.operatorId ? (c = n.operators.find((l) => l.id === e.operatorId)) == null ? void 0 : c.title : void 0, a = i.assigned || s.assigned;
1334
+ return {
1335
+ entry: e,
1336
+ patientRef: i,
1337
+ patient: i.record,
1338
+ appointment: o,
1339
+ appointmentPatientRef: s,
1340
+ appointmentPatient: s.record,
1341
+ operatorTitle: r,
1342
+ avatarSrc: ((d = i.record ?? s.record) == null ? void 0 : d.avatarSrc) ?? e.patientAvatarUrl,
1343
+ appointmentName: o ? ((u = o.cares) == null ? void 0 : u.map((l) => l.name).join(", ")) || o.description || String(o.event.title) : void 0,
1344
+ patientAssigned: a,
1345
+ /* "No link" is an EXISTENCE claim, so it keys on the ids: an entry
1346
+ whose patient id we could not resolve is linked to a patient, and
1347
+ saying otherwise is the same lie as "no patient assigned". */
1348
+ noConnection: !a && !o && !r
1349
+ };
1350
+ }
1351
+ function $(e, t, n) {
1352
+ if (!t && !n || e === void 0) return !0;
1353
+ const o = R(
1354
+ typeof e == "string" ? e : e.toISOString()
1355
+ );
1356
+ return !(t && o < et(t) || n && o > tt(n));
1357
+ }
1358
+ function et(e) {
1359
+ const t = new Date(e);
1360
+ return t.setHours(0, 0, 0, 0), t.getTime();
1361
+ }
1362
+ function tt(e) {
1363
+ const t = new Date(e);
1364
+ return t.setHours(23, 59, 59, 999), t.getTime();
1365
+ }
1366
+ function nt(e, t, n) {
1367
+ var s;
1368
+ const { entry: o } = e;
1369
+ if (t.patientId && ![e.patientRef.id, e.appointmentPatientRef.id].includes(t.patientId))
1370
+ return !1;
1371
+ if (t.patientAssigned) {
1372
+ const r = e.patientAssigned;
1373
+ if (t.patientAssigned === "yes" && !r || t.patientAssigned === "no" && r) return !1;
1374
+ }
1375
+ if (t.operatorId && (t.operatorId === H && o.operatorId || t.operatorId !== H && o.operatorId !== t.operatorId))
1376
+ return !1;
1377
+ if (t.appointmentScheduled) {
1378
+ const r = !!o.appointmentId;
1379
+ if (t.appointmentScheduled === "yes" && !r || t.appointmentScheduled === "no" && r) return !1;
1380
+ }
1381
+ if (!$(
1382
+ e.appointment ? String(e.appointment.event.start) : void 0,
1383
+ t.appointmentFrom,
1384
+ t.appointmentTo
1385
+ ) || !$(
1386
+ n.waitingSinceIso(o),
1387
+ t.waitingFrom,
1388
+ t.waitingTo
1389
+ ))
1390
+ return !1;
1391
+ const i = t.description.trim().toLocaleLowerCase();
1392
+ return !(i && !(((s = o.description) == null ? void 0 : s.toLocaleLowerCase()) ?? "").includes(i));
1393
+ }
1394
+ function oo(e, t, n, o, i) {
1395
+ return e.filter((s) => J(s, n, i)).map((s) => qe(s, t, i)).filter((s) => nt(s, o, i));
1396
+ }
1397
+ const ot = [
1398
+ "linked",
1399
+ "patient",
1400
+ "memo"
1401
+ ];
1402
+ function it(e) {
1403
+ return e.appointmentId ? "linked" : E(e.patientId) !== "" ? "patient" : "memo";
1404
+ }
1405
+ function io(e) {
1406
+ return ot.map((t) => ({
1407
+ kind: t,
1408
+ rows: e.filter((n) => it(n.entry) === t)
1409
+ })).filter((t) => t.rows.length > 0);
1410
+ }
1411
+ function so(e, t) {
1412
+ const n = (o) => e.filter((i) => J(i, o, t)).length;
1413
+ return {
1414
+ all: n("all"),
1415
+ noAppointment: n("noAppointment"),
1416
+ scheduledOver30: n("scheduledOver30"),
1417
+ waitingOver30: n("waitingOver30")
1418
+ };
1419
+ }
1420
+ function ao(e) {
1421
+ const { entry: t } = e;
1422
+ if (t.whatsappPhoneNumber !== void 0)
1423
+ return t.whatsappPhoneNumber.trim();
1424
+ const n = e.patientRef.assigned ? e.patientRef.record : e.appointmentPatientRef.record;
1425
+ return t.whatsappCapable ? (n == null ? void 0 : n.phone) ?? "" : "";
1426
+ }
1427
+ export {
1428
+ Jt as $,
1429
+ Gt as A,
1430
+ $t as B,
1431
+ Tt as C,
1432
+ ge as D,
1433
+ to as E,
1434
+ Bt as F,
1435
+ Rt as G,
1436
+ xn as H,
1437
+ M as I,
1438
+ Xt as J,
1439
+ _ as K,
1440
+ Yn as L,
1441
+ Kn as M,
1442
+ H as N,
1443
+ It as O,
1444
+ Un as P,
1445
+ Bn as Q,
1446
+ Pn as R,
1447
+ St as S,
1448
+ Yt as T,
1449
+ mt as U,
1450
+ bt as V,
1451
+ S as W,
1452
+ un as X,
1453
+ Ct as Y,
1454
+ Ot as Z,
1455
+ tn as _,
1456
+ Be as a,
1457
+ Lt as a$,
1458
+ en as a0,
1459
+ nn as a1,
1460
+ Je as a2,
1461
+ gt as a3,
1462
+ Dt as a4,
1463
+ Pt as a5,
1464
+ Wt as a6,
1465
+ pt as a7,
1466
+ fn as a8,
1467
+ Zt as a9,
1468
+ bn as aA,
1469
+ rn as aB,
1470
+ N as aC,
1471
+ Ft as aD,
1472
+ an as aE,
1473
+ pn as aF,
1474
+ sn as aG,
1475
+ _n as aH,
1476
+ Nn as aI,
1477
+ ye as aJ,
1478
+ L as aK,
1479
+ E as aL,
1480
+ zt as aM,
1481
+ De as aN,
1482
+ Ae as aO,
1483
+ Ln as aP,
1484
+ ht as aQ,
1485
+ Mt as aR,
1486
+ Rn as aS,
1487
+ Fn as aT,
1488
+ Hn as aU,
1489
+ $n as aV,
1490
+ Cn as aW,
1491
+ ft as aX,
1492
+ kn as aY,
1493
+ Ge as aZ,
1494
+ We as a_,
1495
+ An as aa,
1496
+ kt as ab,
1497
+ Ut as ac,
1498
+ wt as ad,
1499
+ F as ae,
1500
+ Qt as af,
1501
+ jn as ag,
1502
+ Jn as ah,
1503
+ zn as ai,
1504
+ Qn as aj,
1505
+ te as ak,
1506
+ Xn as al,
1507
+ cn as am,
1508
+ dn as an,
1509
+ ln as ao,
1510
+ In as ap,
1511
+ Sn as aq,
1512
+ k as ar,
1513
+ vn as as,
1514
+ Tn as at,
1515
+ Et as au,
1516
+ At as av,
1517
+ gn as aw,
1518
+ wn as ax,
1519
+ On as ay,
1520
+ En as az,
1521
+ ee as b,
1522
+ Dn as b0,
1523
+ Mn as b1,
1524
+ q as b2,
1525
+ mn as b3,
1526
+ hn as b4,
1527
+ Pe as b5,
1528
+ Gn as b6,
1529
+ Kt as b7,
1530
+ Ht as b8,
1531
+ qt as b9,
1532
+ qn as c,
1533
+ no as d,
1534
+ Vt as e,
1535
+ oo as f,
1536
+ io as g,
1537
+ Vn as h,
1538
+ jt as i,
1539
+ it as j,
1540
+ ao as k,
1541
+ K as l,
1542
+ V as m,
1543
+ yn as n,
1544
+ eo as o,
1545
+ me as p,
1546
+ Wn as q,
1547
+ vt as r,
1548
+ _t as s,
1549
+ Nt as t,
1550
+ yt as u,
1551
+ Zn as v,
1552
+ so as w,
1553
+ z as x,
1554
+ on as y,
1555
+ xt as z
1556
+ };
1557
+ //# sourceMappingURL=calendar-workspace.model-B8yPwuBv.js.map