@bahmni/appointments-app 0.0.1-dev.270 → 0.0.1-dev.271

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,7 +1,8 @@
1
- import { jsx as s, jsxs as p } from "react/jsx-runtime";
2
- import { U as g, V as S, Z as B, $ as P, a0 as X, b as M, a1 as ee, a2 as te, a3 as ie, P as ae, a4 as ne, a as K, a5 as f, a6 as re, a7 as se, a8 as le, a9 as E, aa as O, ab as V, ac as C, ad as F, ae as Y, af as x, f as de, B as oe, h as ce, D as k, E as me, ag as Ae, ah as Ie, ai as ue, H as _e, I as Te, aj as Le } from "./index-U58J_2Iy.js";
3
- import { useState as h, useMemo as N, useEffect as $, useRef as ve, useCallback as y } from "react";
4
- const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", De = () => {
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
+ import { P as g, U as S, V as B, W as P, Z as X, $ as ee, _ as te, a0 as ie, D as ae, a1 as ne, a as K, a2 as f, a3 as le, a4 as re, a5 as se, a6 as M, a7 as O, a8 as V, a9 as F, aa as C, ab as Y, ac as x, x as oe, h as de, B as k, ad as ce, E as me, ae as Ae, af as Ie, ag as ue, H as _e, I as Te } from "./index-DIOplafV.js";
3
+ import { useState as U, useMemo as N, useEffect as $, useRef as Le, useCallback as E } from "react";
4
+ import { useQuery as D, useQueryClient as ve } from "@tanstack/react-query";
5
+ const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", be = () => {
5
6
  try {
6
7
  return X().uuid;
7
8
  } catch {
@@ -10,10 +11,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
10
11
  }, G = (e) => ({
11
12
  id: "",
12
13
  text: e
13
- }), Me = (e) => ({
14
+ }), De = (e) => ({
14
15
  display: e,
15
16
  uuid: ""
16
- }), be = (e, a) => {
17
+ }), ye = (e, a) => {
17
18
  const n = e.map((t) => ({
18
19
  id: t.uuid,
19
20
  text: t.name,
@@ -24,7 +25,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
24
25
  text: a,
25
26
  isSelectAll: !0
26
27
  }), n;
27
- }, Ee = (e, a) => {
28
+ }, Me = (e, a) => {
28
29
  const n = e.map((t) => ({
29
30
  id: t.uuid,
30
31
  text: t.person?.display,
@@ -35,7 +36,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
35
36
  text: a,
36
37
  isSelectAll: !0
37
38
  }), n;
38
- }, ye = (e, a) => ({
39
+ }, Ee = (e, a) => ({
39
40
  locationUuid: e.locationUuid,
40
41
  startDate: g(e.startDate, a, !1, P).formattedResult,
41
42
  startTime: B(
@@ -43,15 +44,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
43
44
  ),
44
45
  endDate: g(e.endDate, a, !1, P).formattedResult,
45
46
  endTime: B(`${e.endTime} ${e.endTimePeriod}`)
46
- }), he = (e, a) => {
47
+ }), Ue = (e, a) => {
47
48
  const n = {}, t = a("ADMIN_UNAVAILABILITY_FORM_REQUIRED");
48
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()) {
49
- const d = S(
50
+ const o = S(
50
51
  `${e.startTime} ${e.startTimePeriod}`
51
52
  ), c = S(
52
53
  `${e.endTime} ${e.endTimePeriod}`
53
54
  );
54
- d !== null && c !== null && c <= d && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
55
+ o !== null && c !== null && c <= o && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
55
56
  }
56
57
  return n;
57
58
  }, ge = (e, a) => ({
@@ -62,7 +63,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
62
63
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
63
64
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
64
65
  }), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
65
- const n = ye(
66
+ const n = Ee(
66
67
  {
67
68
  locationUuid: e.locationUuid,
68
69
  startDate: e.startDate,
@@ -73,31 +74,31 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
73
74
  endTimePeriod: e.endTimePeriod
74
75
  },
75
76
  a
76
- ), t = H(e.selectedServiceItems), d = H(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = d.length === e.availableProvidersCount || d.length === 0 ? [void 0] : d;
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
78
  return A.flatMap(
78
- (r) => m.map((l) => ({
79
+ (l) => m.map((s) => ({
79
80
  ...n,
80
- appointmentServiceUuid: r,
81
- providerUuid: l
81
+ appointmentServiceUuid: l,
82
+ providerUuid: s
82
83
  }))
83
84
  );
84
- }, Ue = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
+ }, Re = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
86
  uuid: a.resource?.id ?? "",
86
87
  display: a.resource?.name ?? "",
87
88
  childLocations: []
88
- })), Re = () => {
89
+ })), he = () => {
89
90
  const {
90
91
  data: e,
91
92
  isLoading: a,
92
93
  isError: n
93
- } = M({
94
+ } = D({
94
95
  queryKey: ["currentUser"],
95
96
  queryFn: ee
96
97
  }), {
97
98
  data: t = [],
98
- isLoading: d,
99
+ isLoading: o,
99
100
  isError: c
100
- } = M({
101
+ } = D({
101
102
  queryKey: ["providerLoginLocations", e?.uuid],
102
103
  queryFn: async () => {
103
104
  const I = await te(
@@ -107,7 +108,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
107
108
  const u = await ie(
108
109
  w
109
110
  );
110
- return Ue(u);
111
+ return Re(u);
111
112
  }
112
113
  return I.filter(
113
114
  (u) => u.tags?.some((v) => v.display === w)
@@ -118,32 +119,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
118
119
  data: A = [],
119
120
  isLoading: L,
120
121
  isError: m
121
- } = M({
122
+ } = D({
122
123
  queryKey: ["appointmentServices"],
123
124
  queryFn: ae
124
125
  }), {
125
- data: r = [],
126
- isLoading: l,
126
+ data: l = [],
127
+ isLoading: s,
127
128
  isError: _
128
- } = M({
129
+ } = D({
129
130
  queryKey: ["providers"],
130
131
  queryFn: ne
131
132
  });
132
133
  return {
133
134
  loginLocations: t,
134
135
  services: A,
135
- providers: r,
136
- isLoading: a || d || L || l,
136
+ providers: l,
137
+ isLoading: a || o || L || s,
137
138
  isError: n || c || m || _
138
139
  };
139
- }, Se = "_formContent_1huph_1", Be = "_formField_1huph_7", Pe = "_loading_1huph_12", Oe = "_error_1huph_16", Ve = "_grid_1huph_27", Ce = "_column_1huph_31", Fe = "_dateTimeColumn_1huph_36", Ye = "_datePicker_1huph_41", xe = "_timePicker_1huph_55", o = {
140
+ }, Se = "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 = {
140
141
  formContent: Se,
141
142
  formField: Be,
142
143
  loading: Pe,
143
144
  error: Oe,
144
145
  grid: Ve,
145
- column: Ce,
146
- dateTimeColumn: Fe,
146
+ column: Fe,
147
+ dateTimeColumn: Ce,
147
148
  datePicker: Ye,
148
149
  timePicker: xe
149
150
  }, ke = ({
@@ -151,8 +152,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
151
152
  formDataRef: a,
152
153
  onClearErrors: n
153
154
  }) => {
154
- const { t } = K(), { loginLocations: d, services: c, providers: A, isLoading: L, isError: m } = Re(), [r, l] = h({
155
- locationUuid: De(),
155
+ const { t } = K(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = U({
156
+ locationUuid: be(),
156
157
  selectedServiceItems: [],
157
158
  selectedProviderItems: [],
158
159
  startDate: null,
@@ -162,27 +163,27 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
162
163
  endTime: "",
163
164
  endTimePeriod: "AM"
164
165
  }), _ = N(
165
- () => c.filter((i) => i.location?.uuid === r.locationUuid),
166
- [c, r.locationUuid]
166
+ () => c.filter((i) => i.location?.uuid === l.locationUuid),
167
+ [c, l.locationUuid]
167
168
  ), I = N(
168
169
  () => A.filter(
169
170
  (i) => i.attributes?.some(
170
- (b) => b.attributeType?.display === Ne && b.value
171
+ (y) => y.attributeType?.display === Ne && y.value
171
172
  )
172
173
  ),
173
174
  [A]
174
175
  ), u = N(
175
- () => f(!1, !1, d, Me, {
176
+ () => f(!1, !1, o, De, {
176
177
  loading: "",
177
178
  error: "",
178
179
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
179
180
  }),
180
- [d]
181
+ [o]
181
182
  ), v = N(
182
183
  () => f(
183
184
  !1,
184
185
  !1,
185
- be(
186
+ ye(
186
187
  _,
187
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
188
189
  ),
@@ -194,11 +195,11 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
194
195
  }
195
196
  ),
196
197
  [_]
197
- ), D = N(
198
+ ), b = N(
198
199
  () => f(
199
200
  !1,
200
201
  !1,
201
- Ee(
202
+ Me(
202
203
  I,
203
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
204
205
  ),
@@ -212,32 +213,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
212
213
  [I]
213
214
  );
214
215
  return $(() => {
215
- _.length > 0 && l((i) => ({
216
+ _.length > 0 && s((i) => ({
216
217
  ...i,
217
218
  selectedServiceItems: v
218
219
  }));
219
220
  }, [v]), $(() => {
220
- I.length > 0 && l((i) => ({
221
+ I.length > 0 && s((i) => ({
221
222
  ...i,
222
- selectedProviderItems: D
223
+ selectedProviderItems: b
223
224
  }));
224
- }, [D]), a.current = {
225
- ...r,
225
+ }, [b]), a.current = {
226
+ ...l,
226
227
  filteredServicesCount: _.length,
227
228
  availableProvidersCount: I.length
228
- }, L ? /* @__PURE__ */ s(
229
+ }, L ? /* @__PURE__ */ r(
229
230
  "div",
230
231
  {
231
232
  "data-testid": "unavailability-form-skeleton",
232
- className: o.formContent,
233
- children: /* @__PURE__ */ s(re, { type: "multi", className: o.loading })
233
+ className: d.formContent,
234
+ children: /* @__PURE__ */ r(le, { type: "multi", className: d.loading })
234
235
  }
235
- ) : m ? /* @__PURE__ */ s(
236
+ ) : m ? /* @__PURE__ */ r(
236
237
  "div",
237
238
  {
238
239
  id: "unavailability-form-error",
239
240
  "data-testid": "unavailability-form-error",
240
- className: o.error,
241
+ className: d.error,
241
242
  children: t("ADMIN_UNAVAILABILITY_FORM_LOAD_ERROR_MESSAGE")
242
243
  }
243
244
  ) : /* @__PURE__ */ p(
@@ -246,10 +247,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
246
247
  id: "unavailability-form-content",
247
248
  "data-testid": "unavailability-form-content-test-id",
248
249
  "aria-label": "unavailability-form-content-aria-label",
249
- className: o.formContent,
250
+ className: d.formContent,
250
251
  children: [
251
- /* @__PURE__ */ s("div", { className: o.formField, children: /* @__PURE__ */ s(
252
- se,
252
+ /* @__PURE__ */ r("div", { className: d.formField, children: /* @__PURE__ */ r(
253
+ re,
253
254
  {
254
255
  id: "location-dropdown",
255
256
  "data-testid": "location-dropdown",
@@ -257,12 +258,12 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
257
258
  titleText: t("ADMIN_UNAVAILABILITY_FORM_LOCATION_LABEL"),
258
259
  items: u,
259
260
  itemToString: (i) => i?.display ?? "",
260
- selectedItem: r.locationUuid ? d.find(
261
- (i) => i.uuid === r.locationUuid
261
+ selectedItem: l.locationUuid ? o.find(
262
+ (i) => i.uuid === l.locationUuid
262
263
  ) ?? null : null,
263
264
  onChange: (i) => {
264
- n(["location"]), l({
265
- ...r,
265
+ n(["location"]), s({
266
+ ...l,
266
267
  locationUuid: i.selectedItem?.uuid ?? "",
267
268
  selectedServiceItems: []
268
269
  });
@@ -272,15 +273,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
272
273
  }
273
274
  ) }),
274
275
  /* @__PURE__ */ p(
275
- le,
276
+ se,
276
277
  {
277
278
  id: "unavailability-form-grid",
278
279
  "data-testid": "unavailability-form-grid-test-id",
279
280
  "aria-label": "unavailability-form-grid-aria-label",
280
- className: o.grid,
281
+ className: d.grid,
281
282
  children: [
282
283
  /* @__PURE__ */ p(
283
- E,
284
+ M,
284
285
  {
285
286
  id: "unavailability-form-start-date-time",
286
287
  "data-testid": "unavailability-form-start-date-time-test-id",
@@ -288,23 +289,23 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
288
289
  sm: 2,
289
290
  md: 4,
290
291
  lg: 8,
291
- className: `${o.column} ${o.dateTimeColumn}`,
292
+ className: `${d.column} ${d.dateTimeColumn}`,
292
293
  children: [
293
- /* @__PURE__ */ s(
294
+ /* @__PURE__ */ r(
294
295
  O,
295
296
  {
296
297
  datePickerType: "single",
297
298
  minDate: V(),
298
- value: r.startDate ?? void 0,
299
+ value: l.startDate ?? void 0,
299
300
  onChange: (i) => {
300
- i[0] && (n(["startDate", "dateTime"]), l({
301
- ...r,
301
+ i[0] && (n(["startDate", "dateTime"]), s({
302
+ ...l,
302
303
  startDate: i[0]
303
304
  }));
304
305
  },
305
- className: o.datePicker,
306
- children: /* @__PURE__ */ s(
307
- C,
306
+ className: d.datePicker,
307
+ children: /* @__PURE__ */ r(
308
+ F,
308
309
  {
309
310
  id: "start-date",
310
311
  "data-testid": "start-date-input",
@@ -316,36 +317,36 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
316
317
  )
317
318
  }
318
319
  ),
319
- /* @__PURE__ */ s(
320
- F,
320
+ /* @__PURE__ */ r(
321
+ C,
321
322
  {
322
323
  id: "start-time",
323
324
  "data-testid": "start-time-input",
324
325
  labelText: t("ADMIN_UNAVAILABILITY_FORM_START_TIME_LABEL"),
325
326
  onChange: (i) => {
326
- n(["startTime", "dateTime"]), l({ ...r, startTime: i.target.value });
327
+ n(["startTime", "dateTime"]), s({ ...l, startTime: i.target.value });
327
328
  },
328
329
  invalid: !!e.startTime,
329
330
  invalidText: e.startTime,
330
331
  placeholder: "hh:mm",
331
332
  pattern: "(1[012]|[0-9]):[0-5][0-9]",
332
333
  use24HourFormat: !1,
333
- className: o.timePicker,
334
+ className: d.timePicker,
334
335
  children: /* @__PURE__ */ p(
335
336
  Y,
336
337
  {
337
338
  id: "start-time-period",
338
339
  "data-testid": "start-time-period-select",
339
340
  onChange: (i) => {
340
- n(["dateTime"]), l({
341
- ...r,
341
+ n(["dateTime"]), s({
342
+ ...l,
342
343
  startTimePeriod: i.target.value
343
344
  });
344
345
  },
345
- value: r.startTimePeriod,
346
+ value: l.startTimePeriod,
346
347
  children: [
347
- /* @__PURE__ */ s("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
348
- /* @__PURE__ */ s("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
348
+ /* @__PURE__ */ r("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
349
+ /* @__PURE__ */ r("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
349
350
  ]
350
351
  }
351
352
  )
@@ -355,7 +356,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
355
356
  }
356
357
  ),
357
358
  /* @__PURE__ */ p(
358
- E,
359
+ M,
359
360
  {
360
361
  id: "unavailability-form-end-date-time",
361
362
  "data-testid": "unavailability-form-end-date-time-test-id",
@@ -363,23 +364,23 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
363
364
  sm: 2,
364
365
  md: 4,
365
366
  lg: 8,
366
- className: `${o.column} ${o.dateTimeColumn}`,
367
+ className: `${d.column} ${d.dateTimeColumn}`,
367
368
  children: [
368
- /* @__PURE__ */ s(
369
+ /* @__PURE__ */ r(
369
370
  O,
370
371
  {
371
372
  datePickerType: "single",
372
- minDate: r.startDate ?? V(),
373
- value: r.endDate ?? void 0,
373
+ minDate: l.startDate ?? V(),
374
+ value: l.endDate ?? void 0,
374
375
  onChange: (i) => {
375
- i[0] && (n(["endDate", "dateTime"]), l({
376
- ...r,
376
+ i[0] && (n(["endDate", "dateTime"]), s({
377
+ ...l,
377
378
  endDate: i[0]
378
379
  }));
379
380
  },
380
- className: o.datePicker,
381
- children: /* @__PURE__ */ s(
382
- C,
381
+ className: d.datePicker,
382
+ children: /* @__PURE__ */ r(
383
+ F,
383
384
  {
384
385
  id: "end-date",
385
386
  "data-testid": "end-date-input",
@@ -391,36 +392,36 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
391
392
  )
392
393
  }
393
394
  ),
394
- /* @__PURE__ */ s(
395
- F,
395
+ /* @__PURE__ */ r(
396
+ C,
396
397
  {
397
398
  id: "end-time",
398
399
  "data-testid": "end-time-input",
399
400
  labelText: t("ADMIN_UNAVAILABILITY_FORM_END_TIME_LABEL"),
400
401
  onChange: (i) => {
401
- n(["endTime", "dateTime"]), l({ ...r, endTime: i.target.value });
402
+ n(["endTime", "dateTime"]), s({ ...l, endTime: i.target.value });
402
403
  },
403
404
  invalid: !!(e.endTime ?? e.dateTime),
404
405
  invalidText: e.dateTime ?? e.endTime,
405
406
  placeholder: "hh:mm",
406
407
  pattern: "(1[012]|[0-9]):[0-5][0-9]",
407
408
  use24HourFormat: !1,
408
- className: o.timePicker,
409
+ className: d.timePicker,
409
410
  children: /* @__PURE__ */ p(
410
411
  Y,
411
412
  {
412
413
  id: "end-time-period",
413
414
  "data-testid": "end-time-period-select",
414
415
  onChange: (i) => {
415
- n(["dateTime"]), l({
416
- ...r,
416
+ n(["dateTime"]), s({
417
+ ...l,
417
418
  endTimePeriod: i.target.value
418
419
  });
419
420
  },
420
- value: r.endTimePeriod,
421
+ value: l.endTimePeriod,
421
422
  children: [
422
- /* @__PURE__ */ s("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
423
- /* @__PURE__ */ s("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
423
+ /* @__PURE__ */ r("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
424
+ /* @__PURE__ */ r("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
424
425
  ]
425
426
  }
426
427
  )
@@ -429,8 +430,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
429
430
  ]
430
431
  }
431
432
  ),
432
- /* @__PURE__ */ s(
433
- E,
433
+ /* @__PURE__ */ r(
434
+ M,
434
435
  {
435
436
  id: "unavailability-form-service",
436
437
  "data-testid": "unavailability-form-service-test-id",
@@ -438,8 +439,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
438
439
  sm: 2,
439
440
  md: 4,
440
441
  lg: 8,
441
- className: o.column,
442
- children: /* @__PURE__ */ s(
442
+ className: d.column,
443
+ children: /* @__PURE__ */ r(
443
444
  x,
444
445
  {
445
446
  id: "service-multiselect",
@@ -448,17 +449,17 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
448
449
  placeholder: t("ADMIN_UNAVAILABILITY_FORM_SERVICE_LABEL"),
449
450
  items: v,
450
451
  itemToString: (i) => i?.text ?? "",
451
- selectedItems: r.selectedServiceItems,
452
- onChange: (i) => l({
453
- ...r,
452
+ selectedItems: l.selectedServiceItems,
453
+ onChange: (i) => s({
454
+ ...l,
454
455
  selectedServiceItems: i.selectedItems
455
456
  })
456
457
  }
457
458
  )
458
459
  }
459
460
  ),
460
- /* @__PURE__ */ s(
461
- E,
461
+ /* @__PURE__ */ r(
462
+ M,
462
463
  {
463
464
  id: "unavailability-form-provider",
464
465
  "data-testid": "unavailability-form-provider-test-id",
@@ -466,19 +467,19 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
466
467
  sm: 2,
467
468
  md: 4,
468
469
  lg: 8,
469
- className: o.column,
470
- children: /* @__PURE__ */ s(
470
+ className: d.column,
471
+ children: /* @__PURE__ */ r(
471
472
  x,
472
473
  {
473
474
  id: "provider-multiselect",
474
475
  "data-testid": "provider-multiselect",
475
476
  titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
476
477
  placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
477
- items: D,
478
+ items: b,
478
479
  itemToString: (i) => i?.text ?? "",
479
- selectedItems: r.selectedProviderItems,
480
- onChange: (i) => l({
481
- ...r,
480
+ selectedItems: l.selectedProviderItems,
481
+ onChange: (i) => s({
482
+ ...l,
482
483
  selectedProviderItems: i.selectedItems
483
484
  })
484
485
  }
@@ -491,18 +492,18 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
491
492
  ]
492
493
  }
493
494
  );
494
- }, $e = "_page_8pcnh_1", qe = {
495
+ }, $e = "index-module_page__s2h2y", qe = {
495
496
  page: $e
496
- }, Ke = () => {
497
- const { t: e } = K(), a = de(), { userPrivileges: n } = oe(), { addNotification: t } = ce(), [d, c] = h(!1), [A, L] = h(!1), m = ve(null), [r, l] = h({}), _ = k(
497
+ }, Qe = () => {
498
+ const { t: e } = K(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = U(!1), [A, L] = U(!1), m = Le(null), [l, s] = U({}), _ = k(
498
499
  n,
499
500
  q
500
501
  ), I = k(n, [
501
502
  pe,
502
503
  q
503
- ]), { data: u, isLoading: v, isError: D } = M({
504
+ ]), { data: u, isLoading: v, isError: b } = D({
504
505
  queryKey: ["appointmentUnavailabilities"],
505
- queryFn: Le,
506
+ queryFn: ce,
506
507
  enabled: _
507
508
  }), i = [
508
509
  { id: "home", label: e("BREADCRUMB_HOME"), href: me },
@@ -512,7 +513,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
512
513
  href: "/appointments"
513
514
  },
514
515
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
515
- ], b = N(() => [
516
+ ], y = N(() => [
516
517
  { key: "startDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_START") },
517
518
  { key: "endDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_END") },
518
519
  {
@@ -527,7 +528,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
527
528
  key: "providerName",
528
529
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
529
530
  }
530
- ], [e]), j = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), U = y(
531
+ ], [e]), Q = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), R = E(
531
532
  async (T) => {
532
533
  L(!0);
533
534
  try {
@@ -550,47 +551,47 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
550
551
  }
551
552
  },
552
553
  [t, a, e]
553
- ), Q = y(async () => {
554
+ ), j = E(async () => {
554
555
  if (!m.current) return;
555
- const T = he(m.current, e);
556
- l(T), !(Object.keys(T).length > 0) && await U(fe(m.current, e));
557
- }, [e, U]), z = y(
556
+ const T = Ue(m.current, e);
557
+ s(T), !(Object.keys(T).length > 0) && await R(fe(m.current, e));
558
+ }, [e, R]), W = E(
558
559
  (T) => {
559
- l((W) => {
560
- const R = { ...W };
561
- return T.forEach((Z) => delete R[Z]), R;
560
+ s((J) => {
561
+ const h = { ...J };
562
+ return T.forEach((Z) => delete h[Z]), h;
562
563
  });
563
564
  },
564
565
  []
565
- ), J = y(() => {
566
- c(!1), m.current = null, l({});
566
+ ), z = E(() => {
567
+ c(!1), m.current = null, s({});
567
568
  }, []);
568
- return /* @__PURE__ */ s(
569
+ return /* @__PURE__ */ r(
569
570
  Ie,
570
571
  {
571
- headerWSideNav: /* @__PURE__ */ s(Te, { breadcrumbItems: i }),
572
+ headerWSideNav: /* @__PURE__ */ r(Te, { breadcrumbItems: i }),
572
573
  hasSideNav: !1,
573
- mainDisplay: /* @__PURE__ */ s(
574
+ mainDisplay: /* @__PURE__ */ r(
574
575
  "div",
575
576
  {
576
577
  id: "appointment-unavailability-page",
577
578
  "data-testid": "appointment-unavailability-page-test-id",
578
579
  "aria-label": "appointment-unavailability-page-aria-label",
579
580
  className: qe.page,
580
- children: /* @__PURE__ */ s(
581
+ children: /* @__PURE__ */ r(
581
582
  _e,
582
583
  {
583
584
  id: "appointment-unavailability-actions-table",
584
585
  "data-testid": "appointment-unavailability-actions-table-test-id",
585
586
  "aria-label": "appointment-unavailability-actions-table-aria-label",
586
587
  title: e("ADMIN_UNAVAILABILITY_TITLE"),
587
- headers: b,
588
- rows: j,
588
+ headers: y,
589
+ rows: Q,
589
590
  ariaLabel: "unavailability-table",
590
591
  loading: v,
591
- errorStateMessage: D ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
592
+ errorStateMessage: b ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
592
593
  emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
593
- actionButton: !d && I ? {
594
+ actionButton: !o && I ? {
594
595
  label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
595
596
  onClick: () => c(!0),
596
597
  props: { id: "add-unavailability-btn", kind: "primary" }
@@ -599,32 +600,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
599
600
  )
600
601
  }
601
602
  ),
602
- actionArea: d && /* @__PURE__ */ s(
603
+ actionArea: o && /* @__PURE__ */ r(
603
604
  ue,
604
605
  {
605
606
  "data-testid": "appointment-unavailability-form-panel-test-id",
606
607
  "aria-label": "appointment-unavailability-form-panel-aria-label",
607
608
  title: e("ADMIN_UNAVAILABILITY_FORM_TITLE"),
608
609
  primaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_ADD"),
609
- onPrimaryButtonClick: Q,
610
+ onPrimaryButtonClick: j,
610
611
  isPrimaryButtonDisabled: A,
611
612
  secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
612
- onSecondaryButtonClick: J,
613
+ onSecondaryButtonClick: z,
613
614
  isSecondaryButtonDisabled: A,
614
- content: /* @__PURE__ */ s(
615
+ content: /* @__PURE__ */ r(
615
616
  ke,
616
617
  {
617
- errors: r,
618
+ errors: l,
618
619
  formDataRef: m,
619
- onClearErrors: z
620
+ onClearErrors: W
620
621
  }
621
622
  )
622
623
  }
623
624
  ),
624
- isActionAreaVisible: d
625
+ isActionAreaVisible: o
625
626
  }
626
627
  );
627
628
  };
628
629
  export {
629
- Ke as default
630
+ Qe as default
630
631
  };