@bahmni/appointments-app 0.0.1-dev.301 → 0.0.1-dev.302

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.
@@ -1,5 +1,5 @@
1
- import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
2
- import { h as x, u as G, Y as W, q as J, m as X, a as Z, c as ee, o as te } from "./index-DXWAUyAO.js";
1
+ import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
2
+ import { h as Y, u as x, Y as W, G as J, m as X, a as Z, c as ee, o as te } from "./index-CdyKXvT4.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
@@ -38,13 +38,13 @@ const Te = [
38
38
  null
39
39
  ), [$, D] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = x(), { t: n } = G(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = _((e) => {
41
+ ), E = Y(), { t: n } = x(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
42
  U(e), w(!0);
43
- }, []), F = _(() => {
43
+ }, []), H = _(() => {
44
44
  w(!1), U(null), D(/* @__PURE__ */ new Set());
45
45
  }, []), v = _((e) => {
46
46
  D((t) => new Set(t).add(e));
47
- }, []), { data: i, isLoading: H, isError: b, error: y } = ae({
47
+ }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
@@ -97,7 +97,7 @@ const Te = [
97
97
  ), f = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), P = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = p(() => ie(f, n), [f, n]), K = p(
100
+ ), G = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(f, n), [f, n]), z = p(
101
101
  () => f.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
@@ -106,7 +106,7 @@ const Te = [
106
106
  ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = _(
109
+ ), K = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -137,22 +137,22 @@ const Te = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ h(Y, { children: [
140
+ return /* @__PURE__ */ h(Q, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
- headers: z,
144
+ headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: P,
147
- loading: H,
146
+ rows: G,
147
+ loading: q,
148
148
  errorStateMessage: b ? y?.message : null,
149
- sortable: K,
149
+ sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
- renderCell: Q,
151
+ renderCell: K,
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
- totalItems: q,
155
+ totalItems: F,
156
156
  page: O,
157
157
  onPageChange: j
158
158
  }
@@ -163,7 +163,7 @@ const Te = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: F,
166
+ onRequestClose: H,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  size: "lg",
@@ -0,0 +1,234 @@
1
+ import { jsx as i, jsxs as re, Fragment as oe } from "react/jsx-runtime";
2
+ import { u as te, h as ae, y as se, K as ne, W as de, q as ie, U as le, e as me, _ as q, a as ue, m as ce, c as H, T as fe, O as ye, o as he, J as be, F as pe } from "./index-CdyKXvT4.js";
3
+ import { useQueryClient as ge, useQuery as h } from "@tanstack/react-query";
4
+ import { useState as K, useMemo as d, useCallback as b } from "react";
5
+ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", T = {
6
+ formsTableBody: Ne,
7
+ customAccordianItem: Oe
8
+ }, Ae = (u) => u ? u.extension?.find(
9
+ (l) => l.url === pe
10
+ )?.valueString : void 0, _e = ({
11
+ episodeOfCareUuids: u,
12
+ encounterUuids: l,
13
+ config: k
14
+ }) => {
15
+ const { t: n } = te(), c = ae(), [f, F] = K(!1), [a, I] = K(null), {
16
+ numberOfVisits: j,
17
+ hideThumbnail: w = !1,
18
+ forms: y
19
+ } = k ?? {}, E = se(
20
+ u,
21
+ l
22
+ ), x = ge(), {
23
+ data: _ = [],
24
+ isLoading: v,
25
+ isError: B,
26
+ error: V,
27
+ refetch: $
28
+ } = h({
29
+ queryKey: ["forms", c, u],
30
+ queryFn: () => ne(c, void 0, j),
31
+ enabled: !!c && !E
32
+ }), L = d(() => {
33
+ let e = _;
34
+ return l && l.length > 0 && (e = e.filter(
35
+ (r) => l.includes(r.encounterUuid)
36
+ )), Array.isArray(y) && y.length > 0 && (e = e.filter(
37
+ (r) => y.some((o) => o.toLowerCase() === r.formName.toLowerCase())
38
+ )), e;
39
+ }, [_, l, y]), { data: M = [] } = h({
40
+ queryKey: ["observationForms"],
41
+ queryFn: () => de()
42
+ }), S = b(
43
+ (e) => M.find((r) => r.name === e)?.uuid,
44
+ [M]
45
+ ), p = d(() => {
46
+ if (a)
47
+ return S(a.formName);
48
+ }, [a, S]), {
49
+ data: m,
50
+ isLoading: z,
51
+ isError: G,
52
+ error: g
53
+ } = h({
54
+ queryKey: ["formMetadata", p],
55
+ queryFn: () => ie(p),
56
+ enabled: !!p && f
57
+ }), {
58
+ data: N,
59
+ isLoading: Q,
60
+ isError: J,
61
+ error: O
62
+ } = h({
63
+ queryKey: ["formsEncounterFHIR", a?.encounterUuid],
64
+ queryFn: () => le(a.encounterUuid),
65
+ enabled: !!a?.encounterUuid && f
66
+ });
67
+ me(
68
+ (e) => {
69
+ e.patientUUID === c && e.updatedConcepts.size > 0 && ($(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
70
+ },
71
+ [c]
72
+ );
73
+ const W = d(() => !N?.entry || !a?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
74
+ const r = Ae(e);
75
+ return !r || r.includes(a.formName);
76
+ }), [N, a?.formName]), P = d(() => {
77
+ if (!m?.schema) return;
78
+ const e = [], r = (o) => {
79
+ (o ?? []).forEach((s) => {
80
+ const t = s;
81
+ t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
82
+ });
83
+ };
84
+ return r(
85
+ m.schema.controls ?? []
86
+ ), e.length > 0 ? e : void 0;
87
+ }, [m]), Y = d(() => {
88
+ if (!m?.schema) return;
89
+ const e = {}, r = (o, s) => {
90
+ for (const t of o)
91
+ if (t.type === "section") {
92
+ const A = t.label?.value ?? "Section";
93
+ r(t.controls ?? [], A);
94
+ } else
95
+ t.id != null && s && (e[String(t.id)] = s), t.controls && r(t.controls, s);
96
+ };
97
+ return r(
98
+ m.schema.controls ?? [],
99
+ null
100
+ ), Object.keys(e).length > 0 ? e : void 0;
101
+ }, [m]), X = d(() => {
102
+ if (g)
103
+ return q(g).message;
104
+ if (O)
105
+ return q(O).message;
106
+ }, [g, O]), U = d(
107
+ () => [
108
+ { key: "recordedOn", header: n("RECORDED_ON") },
109
+ { key: "recordedBy", header: n("RECORDED_BY") }
110
+ ],
111
+ [n]
112
+ ), Z = d(
113
+ () => [
114
+ { key: "recordedOn", sortable: !0 },
115
+ { key: "recordedBy", sortable: !0 }
116
+ ],
117
+ []
118
+ ), C = d(() => {
119
+ const e = L.reduce(
120
+ (r, o) => {
121
+ const s = o.formName;
122
+ r[s] ??= [];
123
+ const t = o.providers.map((A) => A.providerName).filter(Boolean).join(", ");
124
+ return r[s].push({
125
+ id: o.encounterUuid,
126
+ formName: o.formName,
127
+ recordedOn: ue(o.encounterDateTime, n, !0).formattedResult,
128
+ recordedBy: t ?? "--",
129
+ encounterDateTime: o.encounterDateTime,
130
+ encounterUuid: o.encounterUuid
131
+ }), r;
132
+ },
133
+ {}
134
+ );
135
+ return Object.entries(e).map(
136
+ ([r, o]) => ({
137
+ formName: r,
138
+ records: o.sort(
139
+ (s, t) => t.encounterDateTime - s.encounterDateTime
140
+ )
141
+ })
142
+ ).sort((r, o) => r.formName.localeCompare(o.formName));
143
+ }, [L, n]), D = b((e) => {
144
+ I(e), F(!0);
145
+ }, []), ee = b(() => {
146
+ F(!1), I(null);
147
+ }, []), R = b(
148
+ (e, r) => {
149
+ switch (r) {
150
+ case "recordedOn":
151
+ return /* @__PURE__ */ i(ce, { onClick: () => D(e), children: e.recordedOn });
152
+ case "recordedBy":
153
+ return e.recordedBy;
154
+ default:
155
+ return null;
156
+ }
157
+ },
158
+ [D]
159
+ );
160
+ return /* @__PURE__ */ re(oe, { children: [
161
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: v || B || C.length === 0 || E ? /* @__PURE__ */ i(
162
+ H,
163
+ {
164
+ headers: U,
165
+ ariaLabel: n("FORMS_HEADING"),
166
+ rows: [],
167
+ loading: v,
168
+ errorStateMessage: B ? V?.message : void 0,
169
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
170
+ renderCell: R,
171
+ className: T.formsTableBody,
172
+ dataTestId: "forms-table"
173
+ }
174
+ ) : /* @__PURE__ */ i(fe, { align: "start", children: C.map((e, r) => {
175
+ const { formName: o, records: s } = e;
176
+ return /* @__PURE__ */ i(
177
+ ye,
178
+ {
179
+ title: o,
180
+ className: T.customAccordianItem,
181
+ testId: `accordian-title-${o}`,
182
+ open: r === 0,
183
+ children: /* @__PURE__ */ i(
184
+ H,
185
+ {
186
+ headers: U,
187
+ ariaLabel: n("FORMS_HEADING"),
188
+ rows: s,
189
+ loading: !1,
190
+ errorStateMessage: "",
191
+ sortable: Z,
192
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
193
+ renderCell: R,
194
+ className: T.formsTableBody,
195
+ dataTestId: `forms-table-${o}`
196
+ }
197
+ )
198
+ },
199
+ o
200
+ );
201
+ }) }) }),
202
+ f && a && /* @__PURE__ */ i(
203
+ he,
204
+ {
205
+ id: "modalIdForActionAreaLayout",
206
+ portalId: "main-display-area",
207
+ open: f,
208
+ onRequestClose: ee,
209
+ modalHeading: a.formName,
210
+ modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
211
+ passiveModal: !0,
212
+ size: "md",
213
+ testId: "form-details-modal",
214
+ children: /* @__PURE__ */ i(
215
+ be,
216
+ {
217
+ observations: W,
218
+ isLoading: z || Q,
219
+ isError: G || J,
220
+ errorMessage: X,
221
+ emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
222
+ testIdPrefix: a.formName,
223
+ hideThumbnail: w,
224
+ controlOrder: P,
225
+ sectionMap: Y
226
+ }
227
+ )
228
+ }
229
+ )
230
+ ] });
231
+ };
232
+ export {
233
+ _e as default
234
+ };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-Bi8EVO-G.js";
2
- import { ah as d, ai as f, aj as e } from "./index-DXWAUyAO.js";
1
+ import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-DI4sX8te.js";
2
+ import { ah as d, ai as f, aj as e } from "./index-CdyKXvT4.js";
3
3
  var h = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-Bi8EVO-G.js";
2
- import { ah as h, ai as v, aj as e } from "./index-DXWAUyAO.js";
1
+ import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-DI4sX8te.js";
2
+ import { ah as h, ai as v, aj as e } from "./index-CdyKXvT4.js";
3
3
  var C = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,12 +1,12 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { h as V, Y as k, u as N, k as Q, P as q, e as x, Q as M, b as w, t as z, X as P, c as Y, J as G, H, d as J, g as X, f as j, x as W, S as Z, z as ee } from "./index-DXWAUyAO.js";
1
+ import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
+ import { h as M, Y as V, u as N, P as Q, j as q, e as j, t as k, r as w, n as P, X as x, c as G, Q as X, b as A, d as Y, f as z, g as Z, A as J, Z as W, i as ee } from "./index-CdyKXvT4.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as g } from "react";
4
+ import { useRef as se, useEffect as $, useMemo as T } from "react";
5
5
  const D = (t, n, d, l, b, r) => {
6
- const a = J(t, n, b), s = a.value, o = X(s);
6
+ const a = Y(t, n, b), s = a.value, o = z(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
- W,
9
+ J,
10
10
  {
11
11
  imageSrc: s,
12
12
  alt: s,
@@ -14,7 +14,7 @@ const D = (t, n, d, l, b, r) => {
14
14
  hideThumbnail: r
15
15
  }
16
16
  )), o === "Video" && (i = /* @__PURE__ */ u(
17
- Z,
17
+ W,
18
18
  {
19
19
  id: `${s}-video`,
20
20
  videoSrc: s,
@@ -25,7 +25,7 @@ const D = (t, n, d, l, b, r) => {
25
25
  provider: a.provider
26
26
  }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- j,
28
+ Z,
29
29
  {
30
30
  header: a.header,
31
31
  value: i,
@@ -37,7 +37,7 @@ const D = (t, n, d, l, b, r) => {
37
37
  `obs-${t.id}`
38
38
  );
39
39
  }, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
40
- H,
40
+ A,
41
41
  {
42
42
  title: t.display,
43
43
  id: `grouped-obs-${t.display}-${l}`,
@@ -60,9 +60,9 @@ const D = (t, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, a, s) => {
63
- const o = G(r.encounterDetails, l);
64
- return /* @__PURE__ */ I(
65
- H,
63
+ const o = X(r.encounterDetails, l);
64
+ return /* @__PURE__ */ S(
65
+ A,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
@@ -105,7 +105,7 @@ const D = (t, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
@@ -113,7 +113,7 @@ const D = (t, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = N(), i = te({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), a = M(), { addNotification: s } = V(), { t: o } = N(), i = te({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
119
  queryFn: () => Q(e),
@@ -132,23 +132,23 @@ const D = (t, n, d, l, b, r) => {
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
135
- const m = g(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
+ const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
137
  isLoading: F,
138
138
  isError: R,
139
- refetch: T
139
+ refetch: g
140
140
  } = ae({
141
141
  queryKey: le(a, p),
142
142
  queryFn: () => q(a, p),
143
143
  enabled: !!a && p.length > 0 && y
144
144
  });
145
- x(
145
+ j(
146
146
  (e) => {
147
147
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
- ) && T();
149
+ ) && g();
150
150
  },
151
- [a, T]
151
+ [a, g]
152
152
  ), $(() => {
153
153
  R && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
@@ -156,34 +156,34 @@ const D = (t, n, d, l, b, r) => {
156
156
  type: "error"
157
157
  });
158
158
  }, [R]);
159
- const O = g(() => {
159
+ const O = T(() => {
160
160
  if (!c) return [];
161
- const e = M(c), h = w(e);
162
- return z(h);
161
+ const e = k(c), h = w(e);
162
+ return P(h);
163
163
  }, [c]), L = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], f = F || !y, _ = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ I(
167
+ ], f = F || !y, _ = R && y, C = (!c || c.entry?.length === 0 || p.length === 0) && y, U = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, B = C ? o("NO_OBSERVATIONS_FOUND") : void 0, H = O.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
+ return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
172
  "data-testid": E ? `observations-${v}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
- className: S.observations,
174
+ className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- P,
177
+ x,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${v}` : "observations-title",
181
181
  title: v,
182
- className: S.title,
182
+ className: I.title,
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- B ? /* @__PURE__ */ u(
186
+ H ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: O,
@@ -191,14 +191,14 @@ const D = (t, n, d, l, b, r) => {
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- Y,
194
+ G,
195
195
  {
196
196
  headers: L,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
199
  loading: f,
200
- errorStateMessage: C,
201
- emptyStateMessage: U,
200
+ errorStateMessage: U,
201
+ emptyStateMessage: B,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { ak as we, al as z, am as xt, an as B, ai as q, aj as y, ao as Ro, ap as ye, aq as R, ar as _, as as k, at as N, au as A, av as bs, aw as ir, ax as $e, ay as U, az as Hn, aA as Vn, aB as dt, aC as D, aD as xs, aE as cn, aF as Be, aG as ws, aH as qt, aI as zt, aJ as $s, aK as Cs, aL as $n, aM as Ss, aN as Nr, aO as Bt, aP as zo, aQ as ks, aR as Es, aS as j, aT as Ur, aU as Ms, aV as Ds, aW as sr, aX as As, aY as Ts, aZ as zn, a_ as Fs, a$ as Is, b0 as Z, b1 as Ps, b2 as Ls } from "./index-DXWAUyAO.js";
1
+ import { ak as we, al as z, am as xt, an as B, ai as q, aj as y, ao as Ro, ap as ye, aq as R, ar as _, as as k, at as N, au as A, av as bs, aw as ir, ax as $e, ay as U, az as Hn, aA as Vn, aB as dt, aC as D, aD as xs, aE as cn, aF as Be, aG as ws, aH as qt, aI as zt, aJ as $s, aK as Cs, aL as $n, aM as Ss, aN as Nr, aO as Bt, aP as zo, aQ as ks, aR as Es, aS as j, aT as Ur, aU as Ms, aV as Ds, aW as sr, aX as As, aY as Ts, aZ as zn, a_ as Fs, a$ as Is, b0 as Z, b1 as Ps, b2 as Ls } from "./index-CdyKXvT4.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,14 +1,14 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { K as f, L as P, M as O, N as V, R as J, V as ee, Z as te, a0 as ie, E as ae, a1 as ne, u as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as k, ab as x, ac as w, i as oe, Y as de, l as $, ad as ce, p as me, ae as Ae, af as Ie, ag as ue, r as _e, v as Te } from "./index-DXWAUyAO.js";
2
+ import { H as f, L as P, M as O, S as V, N as Z, R as ee, V as te, a0 as ie, E as ae, a1 as ne, u as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as w, p as oe, Y as de, s as $, ad as ce, v as me, ae as Ae, af as Ie, ag as ue, B as _e, x as Te } from "./index-CdyKXvT4.js";
3
3
  import { useState as g, useMemo as N, useEffect as S, useRef as Le, useCallback as U } from "react";
4
4
  import { useQuery as D, useQueryClient as ve } from "@tanstack/react-query";
5
5
  const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", be = () => {
6
6
  try {
7
- return J().uuid;
7
+ return Z().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
11
- }, K = (e) => ({
11
+ }, H = (e) => ({
12
12
  id: "",
13
13
  text: e
14
14
  }), ye = (e) => ({
@@ -62,7 +62,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
62
62
  locationName: e.location.name,
63
63
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
64
64
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
65
- }), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
65
+ }), K = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
66
66
  const n = Ee(
67
67
  {
68
68
  locationUuid: e.locationUuid,
@@ -74,7 +74,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
74
74
  endTimePeriod: e.endTimePeriod
75
75
  },
76
76
  a
77
- ), t = H(e.selectedServiceItems), o = H(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = o.length === e.availableProvidersCount || o.length === 0 ? [void 0] : o;
77
+ ), t = K(e.selectedServiceItems), o = K(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = o.length === e.availableProvidersCount || o.length === 0 ? [void 0] : o;
78
78
  return A.flatMap(
79
79
  (l) => m.map((s) => ({
80
80
  ...n,
@@ -137,7 +137,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, he = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
140
+ }, he = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
141
  formContent: he,
142
142
  formField: Be,
143
143
  loading: Pe,
@@ -146,8 +146,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
146
146
  column: Fe,
147
147
  dateTimeColumn: Ce,
148
148
  datePicker: Ye,
149
- timePicker: ke
150
- }, xe = ({
149
+ timePicker: xe
150
+ }, ke = ({
151
151
  errors: e,
152
152
  formDataRef: a,
153
153
  onClearErrors: n
@@ -187,7 +187,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
190
- K,
190
+ H,
191
191
  {
192
192
  loading: "",
193
193
  error: "",
@@ -203,7 +203,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
203
203
  I,
204
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
205
205
  ),
206
- K,
206
+ H,
207
207
  {
208
208
  loading: "",
209
209
  error: "",
@@ -327,7 +327,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
327
327
  }
328
328
  ),
329
329
  /* @__PURE__ */ r(
330
- k,
330
+ x,
331
331
  {
332
332
  id: "start-time",
333
333
  "data-testid": "start-time-input",
@@ -342,7 +342,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
342
342
  use24HourFormat: !1,
343
343
  className: d.timePicker,
344
344
  children: /* @__PURE__ */ b(
345
- x,
345
+ k,
346
346
  {
347
347
  id: "start-time-period",
348
348
  "data-testid": "start-time-period-select",
@@ -402,7 +402,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
402
402
  }
403
403
  ),
404
404
  /* @__PURE__ */ r(
405
- k,
405
+ x,
406
406
  {
407
407
  id: "end-time",
408
408
  "data-testid": "end-time-input",
@@ -417,7 +417,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
417
417
  use24HourFormat: !1,
418
418
  className: d.timePicker,
419
419
  children: /* @__PURE__ */ b(
420
- x,
420
+ k,
421
421
  {
422
422
  id: "end-time-period",
423
423
  "data-testid": "end-time-period-select",
@@ -566,9 +566,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
566
566
  s(T), !(Object.keys(T).length > 0) && await h(fe(m.current, e));
567
567
  }, [e, h]), W = U(
568
568
  (T) => {
569
- s((Z) => {
570
- const B = { ...Z };
571
- return T.forEach((z) => delete B[z]), B;
569
+ s((z) => {
570
+ const B = { ...z };
571
+ return T.forEach((J) => delete B[J]), B;
572
572
  });
573
573
  },
574
574
  []
@@ -622,7 +622,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
622
622
  onSecondaryButtonClick: X,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
- xe,
625
+ ke,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,