@bahmni/admin-app 0.0.1-dev.456 → 0.0.1-dev.457

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
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { G as o, L as a, O as s, P as t } from "./index-BhPzl7gM.js";
2
+ import { F as a, G as o, L as s, O as t } from "./index-C_3VFMYg.js";
3
3
  import "react";
4
4
  import "@tanstack/react-query";
5
- const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
6
- a,
5
+ const i = () => /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
6
+ o,
7
7
  {
8
8
  extensionPointId: t,
9
9
  appName: s,
@@ -1,10 +1,10 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { a7 as ee, a8 as te, a9 as se, aa as K, u as ae, ab as ne, ac as re, G as ie, a3 as oe, ad as ue, ae as de, af as C, a5 as H, ag as le } from "./index-BhPzl7gM.js";
3
- import { useState as l, useRef as P, useEffect as V, useMemo as ce, useCallback as me } from "react";
2
+ import { a7 as ee, a8 as te, a9 as se, aa as K, u as ae, ab as ne, ac as re, F as ie, a3 as oe, ad as ue, ae as de, af as C, a5 as V, ag as le } from "./index-C_3VFMYg.js";
3
+ import { useState as l, useRef as U, useEffect as k, useMemo as ce, useCallback as me } from "react";
4
4
  import { useQuery as Ee } from "@tanstack/react-query";
5
- const k = Symbol.for("constructDateFrom");
5
+ const q = Symbol.for("constructDateFrom");
6
6
  function y(e, t) {
7
- return typeof e == "function" ? e(t) : e && typeof e == "object" && k in e ? e[k](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
7
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && q in e ? e[q](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
8
8
  }
9
9
  function w(e, t) {
10
10
  return y(e, e);
@@ -32,15 +32,15 @@ const Le = (e, t) => {
32
32
  }
33
33
  if (!Number.isNaN(r.getTime()))
34
34
  return r.toISOString();
35
- }, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Te = "MATCHING_EVENTS_NOT_FOUND", Ie = () => {
35
+ }, G = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Ie = "MATCHING_EVENTS_NOT_FOUND", Te = () => {
36
36
  const [e, t] = l({
37
37
  startDate: ee(),
38
38
  startTime: "00:00",
39
39
  username: "",
40
40
  patientId: ""
41
- }), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R, p] = l(null), [b, f] = l(!1), [O, g] = l(!1), [F, M] = l(1), T = P(1), s = (c) => {
42
- T.current = c, M(c);
43
- }, o = P(0), [n, Q] = l(null), B = P(null), { data: N, isLoading: j, isFetching: L, isError: z } = Ee({
41
+ }), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), I = U(1), s = (c) => {
42
+ I.current = c, M(c);
43
+ }, o = U(0), [n, Q] = l(null), B = U(null), { data: N, isLoading: j, isFetching: L, isError: z } = Ee({
44
44
  queryKey: ["auditLogs", n?.requestId],
45
45
  queryFn: () => te(n.params),
46
46
  enabled: !!n,
@@ -48,10 +48,10 @@ const Le = (e, t) => {
48
48
  // (and audit logs must always be fetched fresh). Drop entries as soon as
49
49
  // they become inactive instead of retaining them for the default gcTime.
50
50
  gcTime: 0
51
- }), I = (c, G, m, h, D, W) => {
51
+ }), T = (c, H, m, h, D, W) => {
52
52
  o.current += 1, Q({
53
53
  action: c,
54
- params: G,
54
+ params: H,
55
55
  alwaysReplace: m,
56
56
  defaultFirstIndex: h,
57
57
  defaultLastIndex: D,
@@ -59,13 +59,13 @@ const Le = (e, t) => {
59
59
  requestId: o.current
60
60
  });
61
61
  }, A = Le(e.startDate, e.startTime), X = () => {
62
- I(
62
+ T(
63
63
  "init",
64
64
  { startFrom: A, defaultView: !0 },
65
65
  !0,
66
66
  0,
67
67
  0,
68
- q
68
+ G
69
69
  );
70
70
  }, v = () => !!r || !!i, Z = () => {
71
71
  if (!L) {
@@ -73,7 +73,7 @@ const Le = (e, t) => {
73
73
  x();
74
74
  return;
75
75
  }
76
- I(
76
+ T(
77
77
  "next",
78
78
  {
79
79
  lastAuditLogId: i,
@@ -94,7 +94,7 @@ const Le = (e, t) => {
94
94
  x();
95
95
  return;
96
96
  }
97
- I(
97
+ T(
98
98
  "prev",
99
99
  {
100
100
  lastAuditLogId: r,
@@ -109,7 +109,7 @@ const Le = (e, t) => {
109
109
  );
110
110
  }
111
111
  }, x = () => {
112
- L || I(
112
+ L || T(
113
113
  "runReport",
114
114
  {
115
115
  defaultView: !0,
@@ -120,7 +120,7 @@ const Le = (e, t) => {
120
120
  !0,
121
121
  0,
122
122
  0,
123
- Te
123
+ Ie
124
124
  );
125
125
  }, J = () => {
126
126
  L || (t({
@@ -128,11 +128,11 @@ const Le = (e, t) => {
128
128
  startTime: "",
129
129
  username: "",
130
130
  patientId: ""
131
- }), I("init", { defaultView: !0 }, !0, 0, 0, q));
131
+ }), T("init", { defaultView: !0 }, !0, 0, 0, G));
132
132
  };
133
- return V(() => {
133
+ return k(() => {
134
134
  X();
135
- }, []), V(() => {
135
+ }, []), k(() => {
136
136
  if (!n || N === void 0 || B.current === n.requestId) return;
137
137
  B.current = n.requestId;
138
138
  const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se), h = m.length === K;
@@ -140,10 +140,10 @@ const Le = (e, t) => {
140
140
  if (_(m), p(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
141
141
  g(!1), f(h), s(1);
142
142
  else if (n.action === "next")
143
- g(!0), f(h), s(T.current + 1);
143
+ g(!0), f(h), s(I.current + 1);
144
144
  else {
145
145
  f(!0);
146
- const D = Math.max(1, T.current - 1);
146
+ const D = Math.max(1, I.current - 1);
147
147
  g(D > 1), s(D);
148
148
  }
149
149
  else
@@ -159,14 +159,14 @@ const Le = (e, t) => {
159
159
  firstIndex: r,
160
160
  lastIndex: i,
161
161
  hasNext: b,
162
- hasPrevious: O,
163
- currentPageNumber: F,
162
+ hasPrevious: F,
163
+ currentPageNumber: O,
164
164
  next: Z,
165
165
  prev: $,
166
166
  runReport: x,
167
167
  reset: J
168
168
  };
169
- }, pe = "AuditLog-module_page__-FKzd", Ne = "AuditLog-module_filters__DA4tQ", Ae = "AuditLog-module_filterRow__x6DqE", U = {
169
+ }, pe = "AuditLog-module_page__-FKzd", Ne = "AuditLog-module_filters__DA4tQ", Ae = "AuditLog-module_filterRow__x6DqE", P = {
170
170
  page: pe,
171
171
  filters: Ne,
172
172
  filterRow: Ae
@@ -183,10 +183,10 @@ const Le = (e, t) => {
183
183
  hasPrevious: p,
184
184
  currentPageNumber: b,
185
185
  next: f,
186
- prev: O,
186
+ prev: F,
187
187
  runReport: g,
188
- reset: F
189
- } = Ie(), M = ce(
188
+ reset: O
189
+ } = Te(), M = ce(
190
190
  () => [
191
191
  { key: "auditLogId", header: e("EVENT_ID") },
192
192
  { key: "dateCreated", header: e("CREATED_AT") },
@@ -197,7 +197,7 @@ const Le = (e, t) => {
197
197
  { key: "module", header: e("MODULE") }
198
198
  ],
199
199
  [e]
200
- ), T = me(
200
+ ), I = me(
201
201
  (s, o) => {
202
202
  switch (o) {
203
203
  case "dateCreated":
@@ -228,11 +228,11 @@ const Le = (e, t) => {
228
228
  id: "admin-audit-log-page",
229
229
  "data-testid": "admin-audit-log-page-test-id",
230
230
  "aria-label": "admin-audit-log-page-aria-label",
231
- className: U.page,
231
+ className: P.page,
232
232
  children: [
233
- /* @__PURE__ */ S(oe, { className: U.filters, "aria-label": e("FILTERS_HEADER_LABEL"), children: [
233
+ /* @__PURE__ */ S(oe, { className: P.filters, "aria-label": e("FILTERS_HEADER_LABEL"), children: [
234
234
  /* @__PURE__ */ d("h2", { children: e("FILTERS_HEADER_LABEL") }),
235
- /* @__PURE__ */ S("div", { className: U.filterRow, children: [
235
+ /* @__PURE__ */ S("div", { className: P.filterRow, children: [
236
236
  /* @__PURE__ */ d(
237
237
  ue,
238
238
  {
@@ -298,17 +298,17 @@ const Le = (e, t) => {
298
298
  }
299
299
  ),
300
300
  /* @__PURE__ */ d(
301
- H,
301
+ V,
302
302
  {
303
303
  kind: "tertiary",
304
- onClick: F,
304
+ onClick: O,
305
305
  disabled: u,
306
306
  testId: "audit-log-reset-button",
307
307
  children: e("AUDIT_LOG_RESET_BUTTON_LABEL")
308
308
  }
309
309
  ),
310
310
  /* @__PURE__ */ d(
311
- H,
311
+ V,
312
312
  {
313
313
  kind: "primary",
314
314
  onClick: g,
@@ -328,7 +328,7 @@ const Le = (e, t) => {
328
328
  title: e("AUDIT_LOG_TABLE_HEADER_LABEL"),
329
329
  dataTestId: "audit-log-table",
330
330
  loading: i,
331
- renderCell: T,
331
+ renderCell: I,
332
332
  emptyStateMessage: _ ? e(_) : void 0,
333
333
  errorStateMessage: E ? e("ADMIN_ERROR_FETCH_CONFIG") : null,
334
334
  pagination: {
@@ -340,7 +340,7 @@ const Le = (e, t) => {
340
340
  disabled: u,
341
341
  previousLabel: e("AUDIT_LOG_PREV_BUTTON_LABEL"),
342
342
  nextLabel: e("AUDIT_LOG_NEXT_BUTTON_LABEL"),
343
- onSetChange: (s) => s === "next" ? f() : O()
343
+ onSetChange: (s) => s === "next" ? f() : F()
344
344
  }
345
345
  }
346
346
  ) })
@@ -1,22 +1,22 @@
1
1
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import { u as A, z as M, V as R, _ as h, a0 as O, a1 as P, a2 as g, G as D, a3 as V, a4 as f, a5 as x, a6 as y } from "./index-BhPzl7gM.js";
3
- import { useState as E, useMemo as b } from "react";
2
+ import { u as A, z as M, Q as R, V as h, a0 as O, a1 as P, a2 as g, F as V, a3 as D, a4 as f, a5 as x, a6 as b } from "./index-C_3VFMYg.js";
3
+ import { useState as E, useMemo as y } from "react";
4
4
  import { useQuery as L, useMutation as v } from "@tanstack/react-query";
5
- const X = "CsvExport-module_tile__yBrLM", G = "CsvExport-module_title__epZnI", B = "CsvExport-module_form__w-cN-", z = "CsvExport-module_search__G82i7", r = {
5
+ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", z = "CsvExport-module_form__w-cN-", G = "CsvExport-module_search__G82i7", r = {
6
6
  tile: X,
7
- title: G,
8
- form: B,
9
- search: z
10
- }, H = 300, p = 2, _ = 5e3, U = "custom:(uuid,setMembers:(uuid))", q = () => {
11
- const { t } = A(), { addNotification: i } = M(), [S, C] = E(""), [s, c] = E(
7
+ title: B,
8
+ form: z,
9
+ search: G
10
+ }, H = 300, S = 2, _ = 5e3, U = "custom:(uuid,setMembers:(uuid))", w = () => {
11
+ const { t } = A(), { addNotification: i } = M(), [p, C] = E(""), [s, c] = E(
12
12
  null
13
- ), n = R(S.trim(), H), { data: l = [] } = L({
13
+ ), n = R(p.trim(), H), { data: l = [] } = L({
14
14
  queryKey: ["csvExportConceptSearch", n],
15
15
  queryFn: () => h(n),
16
- enabled: n.length >= p && n !== s?.name,
16
+ enabled: n.length >= S && n !== s?.name,
17
17
  // Keep prior options visible while the next term loads, but not once the input is too short to search
18
- placeholderData: (e) => n.length >= p ? e : void 0
19
- }), T = b(
18
+ placeholderData: (e) => n.length >= S ? e : void 0
19
+ }), T = y(
20
20
  () => l.flatMap(
21
21
  (e) => e.name?.name ? [{ uuid: e.uuid, name: e.name.name }] : []
22
22
  ),
@@ -65,8 +65,8 @@ const X = "CsvExport-module_tile__yBrLM", G = "CsvExport-module_title__epZnI", B
65
65
  o.mutate(s);
66
66
  }
67
67
  };
68
- return /* @__PURE__ */ a(D, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
69
- V,
68
+ return /* @__PURE__ */ a(V, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
69
+ D,
70
70
  {
71
71
  id: "admin-csv-export-page",
72
72
  "data-testid": "admin-csv-export-page-test-id",
@@ -104,7 +104,7 @@ const X = "CsvExport-module_tile__yBrLM", G = "CsvExport-module_title__epZnI", B
104
104
  testId: "csv-export-button-test-id",
105
105
  disabled: o.isPending,
106
106
  children: o.isPending ? /* @__PURE__ */ a(
107
- y,
107
+ b,
108
108
  {
109
109
  description: t("ADMIN_CSV_EXPORT_IN_PROGRESS"),
110
110
  testId: "csv-export-loading-test-id"
@@ -118,5 +118,5 @@ const X = "CsvExport-module_tile__yBrLM", G = "CsvExport-module_title__epZnI", B
118
118
  ) });
119
119
  };
120
120
  export {
121
- q as CsvExport
121
+ w as CsvExport
122
122
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as e } from "react/jsx-runtime";
2
- import { u as d, G as o } from "./index-BhPzl7gM.js";
2
+ import { u as d, F as o } from "./index-C_3VFMYg.js";
3
3
  const t = "CsvUpload-module_page__AxMNv", i = {
4
4
  page: t
5
5
  }, n = () => {
@@ -1,10 +1,10 @@
1
1
  import { jsx as a, jsxs as T, Fragment as Ee } from "react/jsx-runtime";
2
- import { d as ge, u as Ne, z as fe, w as Ce, A as Ae, a as be, K as ye, h as De, T as Ie, b as Le, j as Q, E as Oe, c as we, I as ve, n as Ue, e as Se, f as J, U as te, N as Me, H as Re } from "./index-BhPzl7gM.js";
2
+ import { d as ge, u as Ne, z as Ce, w as fe, N as be, a as ye, K as Ae, h as De, T as Ie, b as Le, j as Q, E as Oe, c as we, I as ve, n as Ue, A as Se, e as J, U as te, _ as Me, x as Re } from "./index-C_3VFMYg.js";
3
3
  import { useQuery as $e } from "@tanstack/react-query";
4
- import { useState as p, useRef as ke, useEffect as g, useMemo as N, useCallback as _ } from "react";
5
- const He = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTable-module_viewAttachmentsLink__aQ1on", xe = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Fe = "DocumentsTable-module_attachmentItem__17KA7", Pe = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", qe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Ye = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ze = "DocumentsTable-module_attachmentHeader__yI2xn", d = {
6
- documentsTableBody: He,
7
- viewAttachmentsLink: Be,
4
+ import { useState as _, useRef as ke, useEffect as g, useMemo as N, useCallback as p } from "react";
5
+ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", xe = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Fe = "DocumentsTable-module_attachmentItem__17KA7", Pe = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", qe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Ye = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Xe = "DocumentsTable-module_attachmentHeader__yI2xn", d = {
6
+ documentsTableBody: Be,
7
+ viewAttachmentsLink: He,
8
8
  documentViewerContainer: xe,
9
9
  printContainer: ze,
10
10
  attachmentItem: Fe,
@@ -18,8 +18,8 @@ const He = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
18
18
  header: Ye,
19
19
  documentTypeCell: Qe,
20
20
  printAllButton: Je,
21
- attachmentHeader: Ze
22
- }, Xe = {
21
+ attachmentHeader: Xe
22
+ }, Ze = {
23
23
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
24
24
  documentType: "DOCUMENTS_TYPE",
25
25
  uploadedOn: "DOCUMENTS_UPLOADED_ON",
@@ -38,7 +38,7 @@ function I(n) {
38
38
  function tt(n, i) {
39
39
  return n.map((l) => ({
40
40
  key: l,
41
- header: i(Xe[l])
41
+ header: i(Ze[l])
42
42
  }));
43
43
  }
44
44
  const nt = {
@@ -60,18 +60,18 @@ function rt({ url: n }, i) {
60
60
  }
61
61
  async function dt(n, i, {
62
62
  container: l,
63
- signal: A
63
+ signal: b
64
64
  }) {
65
- const r = { container: l, focus: !1, signal: A };
66
- for (const f of n) {
67
- if (A.aborted) break;
68
- ot(f) ? await Me(ne(f.url), r) : await Re(
69
- rt(f, i),
65
+ const r = { container: l, focus: !1, signal: b };
66
+ for (const C of n) {
67
+ if (b.aborted) break;
68
+ ot(C) ? await Me(ne(C.url), r) : await Re(
69
+ rt(C, i),
70
70
  r
71
71
  );
72
72
  }
73
73
  }
74
- const st = "startConsultation", lt = "add", it = "documents", Z = "document-print-container", X = () => /* @__PURE__ */ a(te, {}), ct = /* @__PURE__ */ new Set([
74
+ const st = "startConsultation", lt = "add", it = "documents", X = "document-print-container", Z = () => /* @__PURE__ */ a(te, {}), ct = /* @__PURE__ */ new Set([
75
75
  "ArrowUp",
76
76
  "ArrowDown",
77
77
  "PageUp",
@@ -86,30 +86,30 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
86
86
  "uploadedOn",
87
87
  "uploadedBy"
88
88
  ], ht = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, ee = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], gt = ({ config: n, encounterUuids: i }) => {
89
- const [l, A] = p(!1), [r, f] = p(
89
+ const [l, b] = _(!1), [r, C] = _(
90
90
  null
91
- ), [L, S] = p(
91
+ ), [L, S] = _(
92
92
  /* @__PURE__ */ new Set()
93
- ), [O, M] = p(
93
+ ), [O, M] = _(
94
94
  /* @__PURE__ */ new Set()
95
- ), b = ke(null), [R, F] = p(
95
+ ), y = ke(null), [R, F] = _(
96
96
  null
97
97
  ), P = R !== null;
98
- g(() => () => b.current?.abort(), []);
99
- const C = ge(), { t: o } = Ne(), { addNotification: w } = fe(), m = N(
98
+ g(() => () => y.current?.abort(), []);
99
+ const f = ge(), { t: o } = Ne(), { addNotification: w } = Ce(), m = N(
100
100
  () => n?.actions?.find(
101
101
  (e) => e.type === lt
102
102
  ),
103
103
  [n?.actions]
104
- ), ae = Ce(m?.requiredPrivilege), oe = !!m && ae, re = Number(n?.pageSize) || 5, [$, k] = p(1), [y, de] = p(re), [se, H] = p(void 0), V = _((e) => {
105
- f(e), A(!0);
106
- }, []), le = _(() => {
107
- b.current?.abort(), M(/* @__PURE__ */ new Set()), A(!1), f(null), S(/* @__PURE__ */ new Set());
108
- }, []), W = _((e) => {
104
+ ), ae = fe(m?.requiredPrivilege), oe = !!m && ae, re = Number(n?.pageSize) || 5, [$, k] = _(1), [A, de] = _(re), [se, B] = _(void 0), V = p((e) => {
105
+ C(e), b(!0);
106
+ }, []), le = p(() => {
107
+ y.current?.abort(), M(/* @__PURE__ */ new Set()), b(!1), C(null), S(/* @__PURE__ */ new Set());
108
+ }, []), W = p((e) => {
109
109
  M((t) => new Set(t).add(e));
110
- }, []), q = _((e) => {
110
+ }, []), q = p((e) => {
111
111
  S((t) => new Set(t).add(e));
112
- }, []), ie = _(() => {
112
+ }, []), ie = p(() => {
113
113
  m && globalThis.dispatchEvent(
114
114
  new CustomEvent(st, {
115
115
  detail: {
@@ -119,38 +119,38 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
119
119
  }
120
120
  })
121
121
  );
122
- }, [m]), { data: D, isLoading: ce, isError: B, error: x, refetch: G } = $e({
122
+ }, [m]), { data: D, isLoading: ce, isError: H, error: x, refetch: G } = $e({
123
123
  queryKey: [
124
124
  "documents",
125
- C,
125
+ f,
126
126
  i,
127
127
  $,
128
- y
128
+ A
129
129
  ],
130
- enabled: !!C,
131
- queryFn: () => Ae(
132
- C,
130
+ enabled: !!f,
131
+ queryFn: () => be(
132
+ f,
133
133
  i,
134
- y,
134
+ A,
135
135
  $
136
136
  )
137
137
  });
138
- be(
138
+ ye(
139
139
  (e) => {
140
- e.patientUUID === C && e.updatedResources.documents && G();
140
+ e.patientUUID === f && e.updatedResources.documents && G();
141
141
  },
142
- [C, G]
142
+ [f, G]
143
143
  ), g(() => {
144
- D && H(D.total);
144
+ D && B(D.total);
145
145
  }, [D]), g(() => {
146
- k(1), H(void 0);
147
- }, [C]), g(() => {
148
- B && w({
146
+ k(1), B(void 0);
147
+ }, [f]), g(() => {
148
+ H && w({
149
149
  title: o("ERROR_DEFAULT_TITLE"),
150
150
  message: x?.message ?? "",
151
151
  type: "error"
152
152
  });
153
- }, [B, x, w, o]), g(() => {
153
+ }, [H, x, w, o]), g(() => {
154
154
  const e = new AbortController();
155
155
  return (async () => {
156
156
  if (!l || !r) return;
@@ -180,8 +180,8 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
180
180
  }, c = (U) => {
181
181
  U.target === e && s();
182
182
  }, h = (U) => {
183
- const _e = U.target;
184
- ct.has(U.key) && !_e?.closest("button, input, textarea, select, a") && s();
183
+ const pe = U.target;
184
+ ct.has(U.key) && !pe?.closest("button, input, textarea, select, a") && s();
185
185
  }, E = () => {
186
186
  !t && e.scrollTop !== 0 && (e.scrollTop = 0);
187
187
  };
@@ -189,11 +189,11 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
189
189
  e.removeEventListener("wheel", s), e.removeEventListener("touchmove", s), e.removeEventListener("mousedown", c), e.removeEventListener("keydown", h), e.removeEventListener("scroll", E);
190
190
  };
191
191
  }, [l, r]);
192
- const ue = _(
192
+ const ue = p(
193
193
  (e, t) => {
194
- t !== y ? (de(t), k(1), H(void 0)) : k(e);
194
+ t !== A ? (de(t), k(1), B(void 0)) : k(e);
195
195
  },
196
- [y]
196
+ [A]
197
197
  ), v = N(
198
198
  () => n?.fields ?? mt,
199
199
  [n?.fields]
@@ -217,12 +217,12 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
217
217
  );
218
218
  return () => clearTimeout(e);
219
219
  }, [l, u]);
220
- const K = _(
220
+ const K = p(
221
221
  async (e, t) => {
222
- if (!r || b.current) return;
222
+ if (!r || y.current) return;
223
223
  const s = new AbortController(), { signal: c } = s;
224
- b.current = s, F(t);
225
- const h = document.getElementById(Z);
224
+ y.current = s, F(t);
225
+ const h = document.getElementById(X);
226
226
  try {
227
227
  await dt(
228
228
  e,
@@ -236,7 +236,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
236
236
  type: "error"
237
237
  });
238
238
  } finally {
239
- b.current = null, F(null);
239
+ y.current = null, F(null);
240
240
  }
241
241
  },
242
242
  [r, w, o]
@@ -245,7 +245,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
245
245
  (e, t) => I(e.url) !== "#" && !L.has(t)
246
246
  ),
247
247
  [u, L]
248
- ), pe = _(
248
+ ), _e = p(
249
249
  (e, t) => {
250
250
  switch (t) {
251
251
  case "documentIdentifier":
@@ -273,7 +273,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
273
273
  return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
274
274
  case "attachments":
275
275
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ a(
276
- ye,
276
+ Ae,
277
277
  {
278
278
  onClick: () => V(e),
279
279
  className: d.viewAttachmentsLink,
@@ -310,13 +310,13 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
310
310
  ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
311
311
  rows: me,
312
312
  loading: ce,
313
- errorStateMessage: B ? x?.message : null,
313
+ errorStateMessage: H ? x?.message : null,
314
314
  sortable: Te,
315
315
  emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
316
- renderCell: pe,
316
+ renderCell: _e,
317
317
  className: d.documentsTableBody,
318
318
  dataTestId: "documents-table",
319
- pageSize: y,
319
+ pageSize: A,
320
320
  totalItems: se,
321
321
  page: $,
322
322
  onPageChange: ue
@@ -340,7 +340,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
340
340
  kind: "tertiary",
341
341
  size: "sm",
342
342
  className: d.printAllButton,
343
- renderIcon: R === "all" ? X : J,
343
+ renderIcon: R === "all" ? Z : J,
344
344
  disabled: P || !j,
345
345
  testId: "print-all-attachments",
346
346
  onClick: () => K(Y, "all"),
@@ -385,7 +385,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
385
385
  disabled: P || !j,
386
386
  testId: `print-attachment-${t}`,
387
387
  onClick: () => K([e], t),
388
- children: R === t ? /* @__PURE__ */ a(X, {}) : /* @__PURE__ */ a(J, {})
388
+ children: R === t ? /* @__PURE__ */ a(Z, {}) : /* @__PURE__ */ a(J, {})
389
389
  }
390
390
  )
391
391
  ] }),
@@ -428,7 +428,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
428
428
  `${r.id}-${e.url}`
429
429
  );
430
430
  }),
431
- /* @__PURE__ */ a("div", { id: Z, className: d.printContainer })
431
+ /* @__PURE__ */ a("div", { id: X, className: d.printContainer })
432
432
  ] })
433
433
  }
434
434
  )