@bahmni/appointments-app 0.0.1-dev.359 → 0.0.1-dev.362

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,9 +1,9 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { m as K, a as M, u as N, H as q, M as H, f as Q, R as k, S as w, r as j, s as x, e as z, L as P, t as D, D as J, v as Y, T as W, w as X, y as Z, z as ee } from "./index-DLLiLOmJ.js";
3
- import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as _, useMemo as T } from "react";
5
- const L = (a, n, d, l, b, r) => {
6
- const t = J(a, n, b), s = t.value, o = Y(s);
1
+ import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
+ import { g as B, K as q, u as N, o as M, q as H, i as Q, V as k, H as w, M as x, r as G, U as z, t as j, F, y as P, w as J, I as W, x as X, z as Z, A as ee } from "./index-DscasiBU.js";
3
+ import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
+ import { useRef as se, useEffect as $, useMemo as E } from "react";
5
+ const A = (t, n, d, l, b, r) => {
6
+ const a = P(t, n, b), s = a.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
9
  X,
@@ -22,54 +22,54 @@ const L = (a, n, d, l, b, r) => {
22
22
  }
23
23
  )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
24
  const m = b("OBSERVATIONS_RECORDED_BY", {
25
- provider: t.provider
26
- }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
25
+ provider: a.provider
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
28
  W,
29
29
  {
30
- header: t.header,
30
+ header: a.header,
31
31
  value: i,
32
32
  info: m,
33
33
  id: c,
34
34
  testId: c,
35
35
  ariaLabel: c
36
36
  },
37
- `obs-${a.id}`
37
+ `obs-${t.id}`
38
38
  );
39
- }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
40
- D,
39
+ }, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
40
+ F,
41
41
  {
42
- title: a.display,
43
- id: `grouped-obs-${a.display}-${l}`,
42
+ title: t.display,
43
+ id: `grouped-obs-${t.display}-${l}`,
44
44
  open: d,
45
- children: a.members?.map(
46
- (s, o) => L(
45
+ children: t.members?.map(
46
+ (s, o) => A(
47
47
  s,
48
48
  o,
49
49
  b,
50
50
  r,
51
51
  n,
52
- t
52
+ a
53
53
  )
54
54
  )
55
55
  },
56
- `grouped-obs-${a.id}`
56
+ `grouped-obs-${t.id}`
57
57
  ), oe = ({
58
- groupedData: a,
58
+ groupedData: t,
59
59
  title: n = "",
60
60
  hideThumbnail: d
61
61
  }) => {
62
- const { t: l } = N(), b = (r, t, s) => {
63
- const o = P(r.encounterDetails, l);
64
- return /* @__PURE__ */ I(
65
- D,
62
+ const { t: l } = N(), b = (r, a, s) => {
63
+ const o = j(r.encounterDetails, l);
64
+ return /* @__PURE__ */ S(
65
+ F,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
- open: t,
69
+ open: a,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => L(
72
+ (i, m) => A(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -82,7 +82,7 @@ const L = (a, n, d, l, b, r) => {
82
82
  (i, m) => re(
83
83
  i,
84
84
  l,
85
- t,
85
+ a,
86
86
  m,
87
87
  s,
88
88
  n,
@@ -100,90 +100,90 @@ const L = (a, n, d, l, b, r) => {
100
100
  id: "obs-by-encounter",
101
101
  "data-testid": "obs-by-encounter-test-id",
102
102
  "aria-label": "obs-by-encounter-aria-label",
103
- children: a.map(
104
- (r, t) => b(r, t === 0, t)
103
+ children: t.map(
104
+ (r, a) => b(r, a === 0, a)
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
- }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
112
- const n = a, {
111
+ }, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
112
+ const n = t, {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = K(), { addNotification: s } = M(), { t: o } = N(), i = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = q(), { t: o } = N(), i = te({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => q(e),
119
+ queryFn: () => M(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
- _(() => {
123
+ $(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const V = d[h];
126
+ const Y = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: Y }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
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]), {
135
+ const m = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: G,
138
- isError: E,
139
- refetch: f
140
- } = te({
141
- queryKey: le(t, p),
142
- queryFn: () => H(t, p),
143
- enabled: !!t && p.length > 0 && y
137
+ isLoading: D,
138
+ isError: g,
139
+ refetch: T
140
+ } = ae({
141
+ queryKey: le(a, p),
142
+ queryFn: () => H(a, p),
143
+ enabled: !!a && p.length > 0 && y
144
144
  });
145
145
  Q(
146
146
  (e) => {
147
- e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
+ e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
- ) && f();
149
+ ) && T();
150
150
  },
151
- [t, f]
152
- ), _(() => {
153
- E && s({
151
+ [a, T]
152
+ ), $(() => {
153
+ g && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [E]);
159
- const O = T(() => {
158
+ }, [g]);
159
+ const O = E(() => {
160
160
  if (!c) return [];
161
161
  const e = k(c), h = w(e);
162
- return j(h);
163
- }, [c]), F = [
162
+ return x(h);
163
+ }, [c]), L = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], g = G || !y, $ = E && 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 && !g && !$, R = n.titleTranslationKey, v = R ? o(R) : "";
168
- return /* @__PURE__ */ I(
167
+ ], f = D || !y, _ = g && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, V = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = U ? o("NO_OBSERVATIONS_FOUND") : void 0, K = O.length > 0 && !f && !_, R = n.titleTranslationKey, v = R ? o(R) : "";
168
+ return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
172
  "data-testid": R ? `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
- x,
177
+ G,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: R ? `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
+ K ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: O,
@@ -193,12 +193,12 @@ const L = (a, n, d, l, b, r) => {
193
193
  ) : /* @__PURE__ */ u(
194
194
  z,
195
195
  {
196
- headers: F,
196
+ headers: L,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: g,
200
- errorStateMessage: C,
201
- emptyStateMessage: U,
199
+ loading: f,
200
+ errorStateMessage: V,
201
+ emptyStateMessage: C,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-DLLiLOmJ.js";
1
+ import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-DscasiBU.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,10 +1,10 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
- import { Z as f, a0 as B, a1 as O, a2 as V, a3 as X, a4 as ee, a5 as te, a6 as ie, _ as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as U, ad as F, ae as C, af as Y, ag as k, ah as x, ai as H, $ as oe, a as de, G as $, aj as ce, I as me, ak as Ae, al as Ie, am as ue, K as _e, Q as Te, U as Le } from "./index-DLLiLOmJ.js";
3
- import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as E } from "react";
2
+ import { $ as f, a0 as O, a1 as B, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, _ as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as k, ah as x, ai as H, J as oe, K as de, O as $, aj as ce, P as me, ak as Ae, al as Ie, am as ue, S as _e, T as Te, W as Le } from "./index-DscasiBU.js";
3
+ import { useState as g, useMemo as N, useEffect as S, useRef as ve, useCallback as U } from "react";
4
4
  import { useQuery as M, useQueryClient as Ne } from "@tanstack/react-query";
5
5
  const be = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", De = () => {
6
6
  try {
7
- return X().uuid;
7
+ return Z().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
@@ -25,7 +25,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
25
25
  text: a,
26
26
  isSelectAll: !0
27
27
  }), n;
28
- }, Ue = (e, a) => {
28
+ }, Ee = (e, a) => {
29
29
  const n = e.map((t) => ({
30
30
  id: t.uuid,
31
31
  text: t.person?.display,
@@ -36,20 +36,20 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
36
36
  text: a,
37
37
  isSelectAll: !0
38
38
  }), n;
39
- }, Ee = (e, a) => ({
39
+ }, Ue = (e, a) => ({
40
40
  locationUuid: e.locationUuid,
41
41
  startDate: f(e.startDate, a, !1, V).formattedResult,
42
- startTime: O(
42
+ startTime: B(
43
43
  `${e.startTime} ${e.startTimePeriod}`
44
44
  ),
45
45
  endDate: f(e.endDate, a, !1, V).formattedResult,
46
- endTime: O(`${e.endTime} ${e.endTimePeriod}`)
46
+ endTime: B(`${e.endTime} ${e.endTimePeriod}`)
47
47
  }), ge = (e, a) => {
48
48
  const n = {}, t = a("ADMIN_UNAVAILABILITY_FORM_REQUIRED");
49
49
  if (e.locationUuid || (n.location = t), e.startDate || (n.startDate = t), e.startTime || (n.startTime = t), e.endDate || (n.endDate = t), e.endTime || (n.endTime = t), e.startDate && e.startTime && e.endDate && e.endTime && e.startDate.toDateString() === e.endDate.toDateString()) {
50
- const o = B(
50
+ const o = O(
51
51
  `${e.startTime} ${e.startTimePeriod}`
52
- ), c = B(
52
+ ), c = O(
53
53
  `${e.endTime} ${e.endTimePeriod}`
54
54
  );
55
55
  o !== null && c !== null && c <= o && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
@@ -63,7 +63,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
63
63
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
64
64
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
65
65
  }), w = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), Re = (e, a) => {
66
- const n = Ee(
66
+ const n = Ue(
67
67
  {
68
68
  locationUuid: e.locationUuid,
69
69
  startDate: e.startDate,
@@ -82,11 +82,11 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
82
82
  providerUuid: s
83
83
  }))
84
84
  );
85
- }, he = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
+ }, Se = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
86
86
  uuid: a.resource?.id ?? "",
87
87
  display: a.resource?.name ?? "",
88
88
  childLocations: []
89
- })), Se = () => {
89
+ })), he = () => {
90
90
  const {
91
91
  data: e,
92
92
  isLoading: a,
@@ -108,7 +108,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
108
108
  const u = await ie(
109
109
  G
110
110
  );
111
- return he(u);
111
+ return Se(u);
112
112
  }
113
113
  return I.filter(
114
114
  (u) => u.tags?.some((v) => v.display === G)
@@ -137,10 +137,10 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, Pe = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
140
+ }, Pe = "UnavailabilityForm-module_formContent__WmNHR", Oe = "UnavailabilityForm-module_formField__8he7o", Be = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
141
  formContent: Pe,
142
- formField: Be,
143
- loading: Oe,
142
+ formField: Oe,
143
+ loading: Be,
144
144
  error: Ve,
145
145
  grid: Fe,
146
146
  column: Ce,
@@ -152,7 +152,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
152
152
  formDataRef: a,
153
153
  onClearErrors: n
154
154
  }) => {
155
- const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = Se(), [l, s] = g({
155
+ const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = g({
156
156
  locationUuid: "",
157
157
  selectedServiceItems: [],
158
158
  selectedProviderItems: [],
@@ -199,7 +199,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
199
199
  () => R(
200
200
  !1,
201
201
  !1,
202
- Ue(
202
+ Ee(
203
203
  I,
204
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
205
205
  ),
@@ -212,7 +212,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
212
212
  ),
213
213
  [I]
214
214
  );
215
- return h(() => {
215
+ return S(() => {
216
216
  if (o.length === 0) return;
217
217
  const i = De(), b = o.some(
218
218
  (y) => y.uuid === i
@@ -221,12 +221,12 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
221
221
  ...y,
222
222
  locationUuid: b ? i : ""
223
223
  }));
224
- }, [o]), h(() => {
224
+ }, [o]), S(() => {
225
225
  _.length > 0 && s((i) => ({
226
226
  ...i,
227
227
  selectedServiceItems: v
228
228
  }));
229
- }, [v]), h(() => {
229
+ }, [v]), S(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
232
  selectedProviderItems: D
@@ -290,7 +290,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
290
290
  className: d.grid,
291
291
  children: [
292
292
  /* @__PURE__ */ p(
293
- U,
293
+ E,
294
294
  {
295
295
  id: "unavailability-form-start-date-time",
296
296
  "data-testid": "unavailability-form-start-date-time-test-id",
@@ -365,7 +365,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
365
365
  }
366
366
  ),
367
367
  /* @__PURE__ */ p(
368
- U,
368
+ E,
369
369
  {
370
370
  id: "unavailability-form-end-date-time",
371
371
  "data-testid": "unavailability-form-end-date-time-test-id",
@@ -440,7 +440,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
440
440
  }
441
441
  ),
442
442
  /* @__PURE__ */ r(
443
- U,
443
+ E,
444
444
  {
445
445
  id: "unavailability-form-service",
446
446
  "data-testid": "unavailability-form-service-test-id",
@@ -468,7 +468,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
468
468
  }
469
469
  ),
470
470
  /* @__PURE__ */ r(
471
- U,
471
+ E,
472
472
  {
473
473
  id: "unavailability-form-provider",
474
474
  "data-testid": "unavailability-form-provider-test-id",
@@ -537,7 +537,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
537
537
  key: "providerName",
538
538
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
539
539
  }
540
- ], [e]), y = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = E(
540
+ ], [e]), y = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), h = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -560,19 +560,19 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
560
560
  }
561
561
  },
562
562
  [t, a, e]
563
- ), j = E(async () => {
563
+ ), j = U(async () => {
564
564
  if (!m.current) return;
565
565
  const T = ge(m.current, e);
566
- s(T), !(Object.keys(T).length > 0) && await S(Re(m.current, e));
567
- }, [e, S]), W = E(
566
+ s(T), !(Object.keys(T).length > 0) && await h(Re(m.current, e));
567
+ }, [e, h]), W = U(
568
568
  (T) => {
569
- s((Z) => {
570
- const P = { ...Z };
571
- return T.forEach((J) => delete P[J]), P;
569
+ s((z) => {
570
+ const P = { ...z };
571
+ return T.forEach((X) => delete P[X]), P;
572
572
  });
573
573
  },
574
574
  []
575
- ), z = E(() => {
575
+ ), J = U(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -619,7 +619,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
619
619
  onPrimaryButtonClick: j,
620
620
  isPrimaryButtonDisabled: A,
621
621
  secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
622
- onSecondaryButtonClick: z,
622
+ onSecondaryButtonClick: J,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
625
  He,
@@ -1,19 +1,19 @@
1
- import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import { B as V, C as O, u as C, F as P, E as h, a as B, $ as G, G as L, _ as x, I as U, J as F, K as H, Q as q, U as $, V as j, W as k, Y as K } from "./index-DLLiLOmJ.js";
3
- import { useState as I, useMemo as c } from "react";
4
- import { useQueryClient as Q, useQuery as W } from "@tanstack/react-query";
5
- const Y = V(
1
+ import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
+ import { B as V, C as O, u as I, D as P, L as h, K as B, J as G, O as L, _ as x, P as U, Q as H, S as q, T as F, W as K, X as Q, Y as j, Z as k } from "./index-DscasiBU.js";
3
+ import { useState as C, useMemo as c } from "react";
4
+ import { useQueryClient as W, useQuery as Y } from "@tanstack/react-query";
5
+ const $ = V(
6
6
  O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), w = ({
9
+ ), Z = ({
10
10
  serviceName: e,
11
- isDeleting: a,
11
+ isDeleting: i,
12
12
  onConfirm: t,
13
13
  onCancel: s
14
14
  }) => {
15
- const { t: n } = C();
16
- return /* @__PURE__ */ i(
15
+ const { t: n } = I();
16
+ return /* @__PURE__ */ a(
17
17
  P,
18
18
  {
19
19
  id: "delete-service-modal",
@@ -25,7 +25,7 @@ const Y = V(
25
25
  onRequestSubmit: t,
26
26
  primaryButtonText: n("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
27
27
  secondaryButtonText: n("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
28
- primaryButtonDisabled: a,
28
+ primaryButtonDisabled: i,
29
29
  modalHeading: n("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
30
30
  children: n("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
31
31
  }
@@ -36,29 +36,29 @@ const Y = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Z = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
39
+ ], w = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
40
  page: J,
41
41
  noPrivilegeContainer: X,
42
42
  table: ee
43
43
  };
44
44
  function te(e) {
45
- return e.filter((a) => !u.includes(a));
45
+ return e.filter((i) => !u.includes(i));
46
46
  }
47
- function ae(e, a) {
47
+ function ie(e, i) {
48
48
  return [
49
49
  ...e.map((t) => ({
50
50
  key: t,
51
- header: a(
51
+ header: i(
52
52
  `ADMIN_ALL_SERVICES_COLUMN_${h(t)}`
53
53
  )
54
54
  })),
55
55
  {
56
56
  key: "actions",
57
- header: a("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
57
+ header: i("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
58
58
  }
59
59
  ];
60
60
  }
61
- function ie(e, a) {
61
+ function ae(e, i) {
62
62
  return e.map((t) => ({
63
63
  id: t.uuid,
64
64
  name: t.name,
@@ -67,7 +67,7 @@ function ie(e, a) {
67
67
  durationMins: t.durationMins,
68
68
  description: t.description,
69
69
  attributes: Object.fromEntries(
70
- a.map((s) => [
70
+ i.map((s) => [
71
71
  s,
72
72
  t.attributes?.find((n) => n.attributeType === s)?.value ?? null
73
73
  ])
@@ -75,33 +75,33 @@ function ie(e, a) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), a = Q(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = Y(), [E, _] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = I(), i = W(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = $(), [E, _] = C(null), [b, p] = C(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], m = L(s, z), M = L(
80
+ ], S = L(s, z), M = L(
81
81
  s,
82
- Z
83
- ), S = c(
82
+ w
83
+ ), m = c(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: D } = W({
86
+ ), { data: A, isLoading: v, isError: D } = Y({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
- enabled: m
89
+ enabled: S
90
90
  }), R = c(
91
- () => ae(l, e),
91
+ () => ie(l, e),
92
92
  [l]
93
93
  ), N = c(
94
- () => ie(A ?? [], S),
95
- [A, S]
94
+ () => ae(A ?? [], m),
95
+ [A, m]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await K(E.id), t({
99
+ await k(E.id), t({
100
100
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
101
101
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
102
102
  type: "success",
103
103
  timeout: 5e3
104
- }), _(null), a.invalidateQueries({ queryKey: ["allAppointmentServices"] });
104
+ }), _(null), i.invalidateQueries({ queryKey: ["allAppointmentServices"] });
105
105
  } catch {
106
106
  t({
107
107
  title: e("ADMIN_ALL_SERVICES_DELETE_ERROR_TITLE"),
@@ -111,8 +111,8 @@ const oe = () => {
111
111
  } finally {
112
112
  p(!1);
113
113
  }
114
- }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
- j,
114
+ }, T = (r, o) => o === "actions" ? /* @__PURE__ */ a(
115
+ Q,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -121,17 +121,17 @@ const oe = () => {
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
122
  disabled: !M,
123
123
  onClick: () => _(r),
124
- children: /* @__PURE__ */ i(k, {})
124
+ children: /* @__PURE__ */ a(j, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
127
  { id: "home", label: e("BREADCRUMB_HOME"), href: U },
128
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
129
129
  ];
130
- return /* @__PURE__ */ i(
131
- F,
130
+ return /* @__PURE__ */ a(
131
+ H,
132
132
  {
133
- header: /* @__PURE__ */ i(q, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i($, {}) }),
134
- main: m ? /* @__PURE__ */ y(
133
+ header: /* @__PURE__ */ a(F, { breadcrumbItems: f, userMenu: /* @__PURE__ */ a(K, {}) }),
134
+ main: S ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
137
137
  id: "all-appointment-service-page",
@@ -139,8 +139,8 @@ const oe = () => {
139
139
  "aria-label": "all-appointment-service-page-aria-label",
140
140
  className: d.page,
141
141
  children: [
142
- /* @__PURE__ */ i(
143
- H,
142
+ /* @__PURE__ */ a(
143
+ q,
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
@@ -154,8 +154,8 @@ const oe = () => {
154
154
  className: d.table
155
155
  }
156
156
  ),
157
- E && /* @__PURE__ */ i(
158
- w,
157
+ E && /* @__PURE__ */ a(
158
+ Z,
159
159
  {
160
160
  serviceName: E.name,
161
161
  isDeleting: b,
@@ -165,7 +165,7 @@ const oe = () => {
165
165
  )
166
166
  ]
167
167
  }
168
- ) : /* @__PURE__ */ i(
168
+ ) : /* @__PURE__ */ a(
169
169
  "div",
170
170
  {
171
171
  id: "all-appointment-service-no-view-privilege",