@bahmni/reports-app 0.0.1-dev.461 → 0.0.1-dev.463

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,25 +1,25 @@
1
- import { jsx as n, jsxs as h, Fragment as _e } from "react/jsx-runtime";
2
- import { u as pe, a as Ee, z as ge, i as Ce, Q as Ne, w as Ie, T as v, b as Ae, c as be, K as fe, h as Le, O as ye, d as De, U as Q, J as ve, L as we, I as Oe, e as Se, N as Ue, X as J, G as ee } from "./index-CGSYweTe.js";
1
+ import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
2
+ import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, K as fe, w as Ae, O as w, t as Ie, r as Le, b as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, $ as Se, c as Re, d as Ue, Q as J, e as ee } from "./index-B6kNIS4-.js";
3
3
  import { useQuery as Me } from "@tanstack/react-query";
4
- import { useState as T, useRef as Re, useEffect as E, useMemo as g, useCallback as _ } from "react";
5
- const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", Be = "DocumentsTable-module_printContainer__rtarJ", Ge = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", xe = "DocumentsTable-module_attachmentLoading__FAR6p", qe = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Pe = "DocumentsTable-module_header__345GY", je = "DocumentsTable-module_documentTypeCell__uWGM8", Qe = "DocumentsTable-module_printAllButton__IVYUW", Je = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
4
+ import { useState as h, useRef as $e, useEffect as _, useMemo as E, useCallback as T } from "react";
5
+ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Ve = "DocumentsTable-module_attachmentItem__17KA7", We = "DocumentsTable-module_attachmentCounter__WFiI3", qe = "DocumentsTable-module_attachmentError__RI4U2", xe = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
6
  documentsTableBody: ke,
7
- viewAttachmentsLink: $e,
8
- documentViewerContainer: He,
9
- printContainer: Be,
10
- attachmentItem: Ge,
11
- attachmentCounter: ze,
12
- attachmentError: Ve,
13
- documentIframe: We,
7
+ viewAttachmentsLink: He,
8
+ documentViewerContainer: Be,
9
+ printContainer: ze,
10
+ attachmentItem: Ve,
11
+ attachmentCounter: We,
12
+ attachmentError: qe,
13
+ documentIframe: xe,
14
14
  attachmentContent: Fe,
15
- attachmentLoading: xe,
16
- hiddenWhileLoading: qe,
17
- documentImage: Ke,
18
- header: Pe,
19
- documentTypeCell: je,
20
- printAllButton: Qe,
21
- attachmentHeader: Je
22
- }, Xe = "startConsultation", Ye = "add", Ze = "documents", X = "document-print-container", Y = () => /* @__PURE__ */ n(ee, {}), et = /* @__PURE__ */ new Set([
15
+ attachmentLoading: Ge,
16
+ hiddenWhileLoading: Ke,
17
+ documentImage: Pe,
18
+ header: je,
19
+ documentTypeCell: Qe,
20
+ printAllButton: Je,
21
+ attachmentHeader: Ye
22
+ }, Ze = "add", Y = "document-print-container", Z = () => /* @__PURE__ */ n(ee, {}), Xe = /* @__PURE__ */ new Set([
23
23
  "ArrowUp",
24
24
  "ArrowDown",
25
25
  "PageUp",
@@ -27,86 +27,81 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
27
27
  "Home",
28
28
  "End",
29
29
  " "
30
- ]), tt = 15e3, nt = [
30
+ ]), et = 15e3, tt = [
31
31
  "documentType",
32
32
  "documentIdentifier",
33
33
  "attachments",
34
34
  "uploadedOn",
35
35
  "uploadedBy"
36
- ], at = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, Z = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], lt = ({ config: l, encounterUuids: H }) => {
37
- const [m, B] = T(!1), [r, G] = T(
36
+ ], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: H }) => {
37
+ const [i, B] = h(!1), [r, z] = h(
38
38
  null
39
- ), [b, w] = T(
39
+ ), [I, v] = h(
40
40
  /* @__PURE__ */ new Set()
41
- ), [f, O] = T(
41
+ ), [L, O] = h(
42
42
  /* @__PURE__ */ new Set()
43
- ), N = Re(null), [S, z] = T(
43
+ ), C = $e(null), [S, V] = h(
44
44
  null
45
- ), V = S !== null;
46
- E(() => () => N.current?.abort(), []);
47
- const C = pe(), { t: a } = Ee(), { addNotification: L } = ge(), c = g(
45
+ ), W = S !== null;
46
+ _(() => () => C.current?.abort(), []);
47
+ const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), N = E(
48
48
  () => l?.actions?.find(
49
- (e) => e.type === Ye
49
+ (e) => e.type === Ze
50
50
  ),
51
51
  [l?.actions]
52
- ), te = Ce(c?.requiredPrivilege), ne = !!c && te, ae = Number(l?.pageSize) || 5, [U, M] = T(1), [I, oe] = T(ae), [re, R] = T(void 0), W = _((e) => {
53
- G(e), B(!0);
54
- }, []), de = _(() => {
55
- N.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), w(/* @__PURE__ */ new Set());
56
- }, []), F = _((e) => {
52
+ ), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [f, oe] = h(ae), [re, M] = h(void 0), q = T((e) => {
53
+ z(e), B(!0);
54
+ }, []), de = T(() => {
55
+ C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), z(null), v(/* @__PURE__ */ new Set());
56
+ }, []), x = T((e) => {
57
57
  O((t) => new Set(t).add(e));
58
- }, []), x = _((e) => {
59
- w((t) => new Set(t).add(e));
60
- }, []), se = _(() => {
61
- c && globalThis.dispatchEvent(
62
- new CustomEvent(Xe, {
63
- detail: {
64
- encounterType: c.encounterType,
65
- editOnly: c.editOnly ?? Ze,
66
- ...c.editTitle ? { editTitle: c.editTitle } : {}
67
- }
68
- })
69
- );
70
- }, [c]), { data: A, isLoading: le, isError: k, error: $, refetch: q } = Me({
58
+ }, []), F = T((e) => {
59
+ v((t) => new Set(t).add(e));
60
+ }, []), se = T(() => {
61
+ N && Ce({
62
+ context: { encounterType: N.encounterType },
63
+ action: { type: "create", resourceType: "DocumentReference" }
64
+ });
65
+ }, [N]), { data: A, isLoading: le, isError: $, error: k, refetch: G } = Me({
71
66
  queryKey: [
72
67
  "documents",
73
- C,
68
+ g,
74
69
  H,
75
- U,
76
- I
70
+ R,
71
+ f
77
72
  ],
78
- enabled: !!C,
79
- queryFn: () => Ne(
80
- C,
73
+ enabled: !!g,
74
+ queryFn: () => fe(
75
+ g,
81
76
  H,
82
- I,
83
- U
77
+ f,
78
+ R
84
79
  )
85
80
  });
86
- Ie(
81
+ Ae(
87
82
  (e) => {
88
- e.patientUUID === C && e.updatedResources.documents && q();
83
+ e.patientUUID === g && e.updatedResources.documents && G();
89
84
  },
90
- [C, q]
91
- ), E(() => {
92
- A && R(A.total);
93
- }, [A]), E(() => {
94
- M(1), R(void 0);
95
- }, [C]), E(() => {
96
- k && L({
85
+ [g, G]
86
+ ), _(() => {
87
+ A && M(A.total);
88
+ }, [A]), _(() => {
89
+ U(1), M(void 0);
90
+ }, [g]), _(() => {
91
+ $ && b({
97
92
  title: a("ERROR_DEFAULT_TITLE"),
98
- message: $?.message ?? "",
93
+ message: k?.message ?? "",
99
94
  type: "error"
100
95
  });
101
- }, [k, $, L, a]), E(() => {
96
+ }, [$, k, b, a]), _(() => {
102
97
  const e = new AbortController();
103
98
  return (async () => {
104
- if (!m || !r) return;
105
- const t = /* @__PURE__ */ new Set(), d = Z(r);
99
+ if (!i || !r) return;
100
+ const t = /* @__PURE__ */ new Set(), d = X(r);
106
101
  for (let s = 0; s < d.length; s++) {
107
- const u = v(d[s].url);
102
+ const m = w(d[s].url);
108
103
  try {
109
- (await fetch(u, {
104
+ (await fetch(m, {
110
105
  method: "HEAD",
111
106
  signal: e.signal
112
107
  })).ok || t.add(s);
@@ -114,10 +109,10 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
114
109
  p instanceof Error && p.name !== "AbortError" && t.add(s);
115
110
  }
116
111
  }
117
- e.signal.aborted || w(t);
112
+ e.signal.aborted || v(t);
118
113
  })(), () => e.abort();
119
- }, [m, r]), E(() => {
120
- if (!m || !r) return;
114
+ }, [i, r]), _(() => {
115
+ if (!i || !r) return;
121
116
  const e = document.querySelector(
122
117
  '[data-testid="document-view-modal"] .cds--modal-content'
123
118
  );
@@ -125,81 +120,81 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
125
120
  let t = !1;
126
121
  const d = () => {
127
122
  t = !0;
128
- }, s = (D) => {
129
- D.target === e && d();
130
- }, u = (D) => {
131
- const Te = D.target;
132
- et.has(D.key) && !Te?.closest("button, input, textarea, select, a") && d();
123
+ }, s = (y) => {
124
+ y.target === e && d();
125
+ }, m = (y) => {
126
+ const Te = y.target;
127
+ Xe.has(y.key) && !Te?.closest("button, input, textarea, select, a") && d();
133
128
  }, p = () => {
134
129
  !t && e.scrollTop !== 0 && (e.scrollTop = 0);
135
130
  };
136
- return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchmove", d, { passive: !0 }), e.addEventListener("mousedown", s), e.addEventListener("keydown", u), e.addEventListener("scroll", p), () => {
137
- e.removeEventListener("wheel", d), e.removeEventListener("touchmove", d), e.removeEventListener("mousedown", s), e.removeEventListener("keydown", u), e.removeEventListener("scroll", p);
131
+ return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchmove", d, { passive: !0 }), e.addEventListener("mousedown", s), e.addEventListener("keydown", m), e.addEventListener("scroll", p), () => {
132
+ e.removeEventListener("wheel", d), e.removeEventListener("touchmove", d), e.removeEventListener("mousedown", s), e.removeEventListener("keydown", m), e.removeEventListener("scroll", p);
138
133
  };
139
- }, [m, r]);
140
- const ie = _(
134
+ }, [i, r]);
135
+ const ce = T(
141
136
  (e, t) => {
142
- t !== I ? (oe(t), M(1), R(void 0)) : M(e);
137
+ t !== f ? (oe(t), U(1), M(void 0)) : U(e);
143
138
  },
144
- [I]
145
- ), y = g(
146
- () => l?.fields ?? nt,
139
+ [f]
140
+ ), D = E(
141
+ () => l?.fields ?? tt,
147
142
  [l?.fields]
148
- ), ce = g(() => [...A?.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), [A]), me = g(() => Ae(y, a), [y, a]), ue = g(
149
- () => y.map((e) => ({
143
+ ), ie = E(() => [...A?.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), [A]), me = E(() => Ie(D, a), [D, a]), ue = E(
144
+ () => D.map((e) => ({
150
145
  key: e,
151
146
  sortable: e !== "attachments"
152
147
  })),
153
- [y]
154
- ), i = g(
155
- () => r ? Z(r) : [],
148
+ [D]
149
+ ), c = E(
150
+ () => r ? X(r) : [],
156
151
  [r]
157
- ), K = i.every(
158
- (e, t) => f.has(t) || b.has(t) || v(e.url) === "#"
152
+ ), K = c.every(
153
+ (e, t) => L.has(t) || I.has(t) || w(e.url) === "#"
159
154
  );
160
- E(() => {
161
- if (!m || i.length === 0) return;
155
+ _(() => {
156
+ if (!i || c.length === 0) return;
162
157
  const e = setTimeout(
163
- () => O(new Set(i.keys())),
164
- tt
158
+ () => O(new Set(c.keys())),
159
+ et
165
160
  );
166
161
  return () => clearTimeout(e);
167
- }, [m, i]);
168
- const P = _(
162
+ }, [i, c]);
163
+ const P = T(
169
164
  async (e, t) => {
170
- if (!r || N.current) return;
165
+ if (!r || C.current) return;
171
166
  const d = new AbortController(), { signal: s } = d;
172
- N.current = d, z(t);
173
- const u = document.getElementById(X);
167
+ C.current = d, V(t);
168
+ const m = document.getElementById(Y);
174
169
  try {
175
- await be(
170
+ await Le(
176
171
  e,
177
172
  r.documentIdentifier,
178
- { container: u, signal: s }
173
+ { container: m, signal: s }
179
174
  );
180
175
  } catch {
181
- s.aborted || L({
176
+ s.aborted || b({
182
177
  title: a("ERROR_DEFAULT_TITLE"),
183
178
  message: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT"),
184
179
  type: "error"
185
180
  });
186
181
  } finally {
187
- N.current = null, z(null);
182
+ C.current = null, V(null);
188
183
  }
189
184
  },
190
- [r, L, a]
191
- ), j = g(
192
- () => i.filter(
193
- (e, t) => v(e.url) !== "#" && !b.has(t)
185
+ [r, b, a]
186
+ ), j = E(
187
+ () => c.filter(
188
+ (e, t) => w(e.url) !== "#" && !I.has(t)
194
189
  ),
195
- [i, b]
196
- ), he = _(
190
+ [c, I]
191
+ ), he = T(
197
192
  (e, t) => {
198
193
  switch (t) {
199
194
  case "documentIdentifier":
200
195
  return /* @__PURE__ */ n("span", { children: e.documentIdentifier?.trim() || "-" });
201
196
  case "documentType":
202
- return /* @__PURE__ */ h("div", { className: o.documentTypeCell, children: [
197
+ return /* @__PURE__ */ u("div", { className: o.documentTypeCell, children: [
203
198
  /* @__PURE__ */ n("span", { children: e.documentType ?? a("DOCUMENTS_NOT_AVAILABLE") }),
204
199
  e.description && /* @__PURE__ */ n(
205
200
  ye,
@@ -212,7 +207,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
212
207
  )
213
208
  ] });
214
209
  case "uploadedOn":
215
- return Le(
210
+ return De(
216
211
  e.uploadedOn,
217
212
  a,
218
213
  !0
@@ -221,9 +216,9 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
221
216
  return e.uploadedBy ?? a("DOCUMENTS_NOT_AVAILABLE");
222
217
  case "attachments":
223
218
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
224
- fe,
219
+ be,
225
220
  {
226
- onClick: () => W(e),
221
+ onClick: () => q(e),
227
222
  className: o.viewAttachmentsLink,
228
223
  "data-testid": `view-attachments-${e.id}`,
229
224
  children: a("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -233,10 +228,10 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
233
228
  return null;
234
229
  }
235
230
  },
236
- [W, a]
231
+ [q, a]
237
232
  );
238
- return /* @__PURE__ */ h(_e, { children: [
239
- ne && /* @__PURE__ */ h(De, { className: o.header, testId: "documents-header", children: [
233
+ return /* @__PURE__ */ u(pe, { children: [
234
+ ne && /* @__PURE__ */ u(we, { className: o.header, testId: "documents-header", children: [
240
235
  /* @__PURE__ */ n("p", { children: a("DOCUMENTS_TABLE_HEADING") }),
241
236
  /* @__PURE__ */ n(
242
237
  Q,
@@ -244,83 +239,83 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
244
239
  autoAlign: !0,
245
240
  size: "lg",
246
241
  kind: "ghost",
247
- label: a(c.label),
242
+ label: a(N.label),
248
243
  testId: "documents-add-button",
249
244
  onClick: se,
250
- children: /* @__PURE__ */ n(ve, { id: "documents-add-icon", name: "fa-plus", size: we.LG })
245
+ children: /* @__PURE__ */ n(ve, { id: "documents-add-icon", name: "fa-plus", size: Oe.LG })
251
246
  }
252
247
  )
253
248
  ] }),
254
249
  /* @__PURE__ */ n("div", { "data-testid": "documents-table", children: /* @__PURE__ */ n(
255
- Oe,
250
+ Se,
256
251
  {
257
252
  headers: me,
258
253
  ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
259
- rows: ce,
254
+ rows: ie,
260
255
  loading: le,
261
- errorStateMessage: k ? $?.message : null,
256
+ errorStateMessage: $ ? k?.message : null,
262
257
  sortable: ue,
263
258
  emptyStateMessage: a("DOCUMENTS_NO_RECORDS"),
264
259
  renderCell: he,
265
260
  className: o.documentsTableBody,
266
261
  dataTestId: "documents-table",
267
- pageSize: I,
262
+ pageSize: f,
268
263
  totalItems: re,
269
- page: U,
270
- onPageChange: ie
264
+ page: R,
265
+ onPageChange: ce
271
266
  }
272
267
  ) }),
273
- m && r && /* @__PURE__ */ n(
274
- Se,
268
+ i && r && /* @__PURE__ */ n(
269
+ Re,
275
270
  {
276
271
  id: "modalIdForActionAreaLayout",
277
272
  portalId: "main-display-area",
278
- open: m,
273
+ open: i,
279
274
  onRequestClose: de,
280
275
  modalHeading: r.documentIdentifier,
281
276
  passiveModal: !0,
282
277
  size: "lg",
283
278
  testId: "document-view-modal",
284
- children: /* @__PURE__ */ h("div", { className: o.documentViewerContainer, children: [
279
+ children: /* @__PURE__ */ u("div", { className: o.documentViewerContainer, children: [
285
280
  j.length > 1 && /* @__PURE__ */ n(
286
281
  Ue,
287
282
  {
288
283
  kind: "tertiary",
289
284
  size: "sm",
290
285
  className: o.printAllButton,
291
- renderIcon: S === "all" ? Y : J,
292
- disabled: V || !K,
286
+ renderIcon: S === "all" ? Z : J,
287
+ disabled: W || !K,
293
288
  testId: "print-all-attachments",
294
289
  onClick: () => P(j, "all"),
295
290
  children: a("DOCUMENTS_PRINT_ALL")
296
291
  }
297
292
  ),
298
- i.map((e, t) => {
299
- const d = v(e.url), s = e.contentType?.toLowerCase().includes("pdf"), u = (e.contentType?.toLowerCase().includes("image") ?? !1) || at.test(e.url ?? ""), p = b.has(t);
300
- return d === "#" || p ? /* @__PURE__ */ h(
293
+ c.map((e, t) => {
294
+ const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = I.has(t);
295
+ return d === "#" || p ? /* @__PURE__ */ u(
301
296
  "div",
302
297
  {
303
298
  className: o.attachmentError,
304
299
  "data-testid": `attachment-error-${t}`,
305
300
  children: [
306
- i.length > 1 && /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
301
+ c.length > 1 && /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
307
302
  current: t + 1,
308
- total: i.length
303
+ total: c.length
309
304
  }) }),
310
305
  /* @__PURE__ */ n("p", { children: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
311
306
  ]
312
307
  },
313
308
  `${r.id}-${e.url}`
314
- ) : /* @__PURE__ */ h(
309
+ ) : /* @__PURE__ */ u(
315
310
  "div",
316
311
  {
317
312
  className: o.attachmentItem,
318
313
  "data-testid": `attachment-item-${t}`,
319
314
  children: [
320
- /* @__PURE__ */ h("div", { className: o.attachmentHeader, children: [
321
- i.length > 1 ? /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
315
+ /* @__PURE__ */ u("div", { className: o.attachmentHeader, children: [
316
+ c.length > 1 ? /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
322
317
  current: t + 1,
323
- total: i.length
318
+ total: c.length
324
319
  }) }) : /* @__PURE__ */ n("span", {}),
325
320
  /* @__PURE__ */ n(
326
321
  Q,
@@ -330,15 +325,15 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
330
325
  label: a("DOCUMENTS_PRINT_ATTACHMENT", {
331
326
  index: t + 1
332
327
  }),
333
- disabled: V || !K,
328
+ disabled: W || !K,
334
329
  testId: `print-attachment-${t}`,
335
330
  onClick: () => P([e], t),
336
- children: S === t ? /* @__PURE__ */ n(Y, {}) : /* @__PURE__ */ n(J, {})
331
+ children: S === t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ n(J, {})
337
332
  }
338
333
  )
339
334
  ] }),
340
- /* @__PURE__ */ h("div", { className: o.attachmentContent, children: [
341
- !f.has(t) && /* @__PURE__ */ n(
335
+ /* @__PURE__ */ u("div", { className: o.attachmentContent, children: [
336
+ !L.has(t) && /* @__PURE__ */ n(
342
337
  "div",
343
338
  {
344
339
  className: o.attachmentLoading,
@@ -351,23 +346,23 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
351
346
  )
352
347
  }
353
348
  ),
354
- u ? /* @__PURE__ */ n(
349
+ m ? /* @__PURE__ */ n(
355
350
  "img",
356
351
  {
357
352
  src: d,
358
353
  alt: r.documentIdentifier,
359
- className: `${o.documentImage} ${f.has(t) ? "" : o.hiddenWhileLoading}`,
360
- onLoad: () => F(t),
361
- onError: () => x(t)
354
+ className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
355
+ onLoad: () => x(t),
356
+ onError: () => F(t)
362
357
  }
363
358
  ) : /* @__PURE__ */ n(
364
359
  "iframe",
365
360
  {
366
361
  src: s ? `${d}#toolbar=0` : d,
367
- className: `${o.documentIframe} ${f.has(t) ? "" : o.hiddenWhileLoading}`,
362
+ className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
368
363
  title: r.documentIdentifier,
369
- onLoad: () => F(t),
370
- onError: () => x(t)
364
+ onLoad: () => x(t),
365
+ onError: () => F(t)
371
366
  }
372
367
  )
373
368
  ] })
@@ -376,12 +371,12 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
376
371
  `${r.id}-${e.url}`
377
372
  );
378
373
  }),
379
- /* @__PURE__ */ n("div", { id: X, className: o.printContainer })
374
+ /* @__PURE__ */ n("div", { id: Y, className: o.printContainer })
380
375
  ] })
381
376
  }
382
377
  )
383
378
  ] });
384
379
  };
385
380
  export {
386
- lt as default
381
+ st as default
387
382
  };