@tesouro/embedded-components-react 0.9.41 → 0.9.44

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.
Files changed (24) hide show
  1. package/dist/experimental/ApprovalRequests.d.ts +15 -1
  2. package/dist/experimental/index.d.ts +15 -1
  3. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +5 -5
  4. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +9 -0
  5. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +29 -2
  6. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +30 -2
  7. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +45 -35
  8. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +17 -14
  9. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +8 -0
  10. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +76 -0
  11. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +4 -4
  12. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +53 -44
  13. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +2 -1
  14. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +13 -1
  15. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +91 -58
  16. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +44 -0
  17. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +159 -158
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index3.js +1 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +57 -52
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiUnprocessable.js +7 -0
  22. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +41 -38
  23. package/dist/packages/shared-ui-shadcn/dist/index.js +3432 -3332
  24. package/package.json +1 -1
@@ -5,18 +5,19 @@
5
5
  import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { isOrganizationOnItsWay as t } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
7
7
  import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { isApiUnprocessableError as r } from "../../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
8
9
  import "../../../../shared/data-access/dist/index.js";
9
10
  import "../../../../shared/ui/dist/index.js";
10
- import { useAnalyticsTrack as r } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
11
- import { useWidgetConfig as ee, useWidgetError as te, useWidgetLoading as ne } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import { useAnalyticsTrack as ee } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
12
+ import { useWidgetConfig as te, useWidgetError as ne, useWidgetLoading as re } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
13
  import "../../../../shared/feature/dist/index.js";
13
14
  import { AccountDetailsWidgetAnalyticsEvent as i } from "./index2.js";
14
- import { formatDateParam as re, getDefaultExportDateRange as ie, isExportRangeValid as a, startOfLocalDay as o, triggerCsvDownload as ae, yesterdayLocal as s } from "./index3.js";
15
- import { copyTextToClipboard as oe, formatAmountLabel as c, formatSignedTransactionAmountLabel as se, formatStatementPeriodLabel as ce, formatTransactionDateLabel as le, maskAccountNumber as ue } from "./index4.js";
15
+ import { formatDateParam as a, getDefaultExportDateRange as ie, isExportRangeValid as o, startOfLocalDay as s, triggerCsvDownload as ae, yesterdayLocal as c } from "./index3.js";
16
+ import { copyTextToClipboard as oe, formatAmountLabel as l, formatSignedTransactionAmountLabel as se, formatStatementPeriodLabel as ce, formatTransactionDateLabel as le, maskAccountNumber as ue } from "./index4.js";
16
17
  import { DEFAULT_FEATURE_LABELS as de } from "./index5.js";
17
18
  import { getBankAccountsPermissions as fe } from "./index6.js";
18
19
  import { getStatementsStartDate as pe } from "./index7.js";
19
- import { interpolateLabel as l } from "./index8.js";
20
+ import { interpolateLabel as u } from "./index8.js";
20
21
  import { useBankAccountDetailsQuery as me } from "../../data-access/dist/index2.js";
21
22
  import { useBankAccountStatementsQuery as he } from "../../data-access/dist/index3.js";
22
23
  import { useBankAccountTransactionsQuery as ge } from "../../data-access/dist/index4.js";
@@ -27,7 +28,7 @@ import "../../data-access/dist/index.js";
27
28
  import { DEFAULT_LABELS as be } from "../../ui/dist/index7.js";
28
29
  import { AccountDetailsWidgetUi as xe } from "../../ui/dist/index8.js";
29
30
  import "../../ui/dist/index.js";
30
- import { useCallback as u, useEffect as Se, useMemo as d, useState as f } from "react";
31
+ import { useCallback as d, useEffect as Se, useMemo as f, useState as p } from "react";
31
32
  import { jsx as Ce } from "react/jsx-runtime";
32
33
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js
33
34
  var we = 3e3, Te = 5e3, Ee = [
@@ -35,255 +36,255 @@ var we = 3e3, Te = 5e3, Ee = [
35
36
  25,
36
37
  50
37
38
  ], De = 10, Oe = 6e5, ke = { nickname: "" };
38
- function p({ accountId: p, onBack: Ae, labels: je, featureLabels: Me, isBankingTaglineVisible: Ne = !0, bankLogoSrc: Pe, bankLogoAlt: Fe, bankAddress: Ie, supportTeamUrl: Le }) {
39
- let m = {
39
+ function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingTaglineVisible: Ne = !0, bankLogoSrc: Pe, bankLogoAlt: Fe, bankAddress: Ie, supportTeamUrl: Le }) {
40
+ let h = {
40
41
  ...be,
41
42
  ...je
42
- }, h = {
43
+ }, g = {
43
44
  ...de,
44
45
  ...Me
45
- }, g = r(), { organizationId: Re, widgetToken: ze, initResponse: _ } = ee(), Be = ne(), Ve = t(n().organizationStatus), v = !!te(), y = !!(Re && ze), b = d(() => fe(_?.scopes), [_?.scopes]), x = b.canRead && !!_, S = y && x, C = x && !y, [w, He] = f("transactions"), [Ue, T] = f(!1), [E, D] = f(ke), [We, Ge] = f(!1), [Ke, qe] = f(!1), [Je, Ye] = f(!1), [Xe, Ze] = f(!1), [Qe, $e] = f(!1), [O, k] = f(), [A, j] = f(), [M, et] = f(De), [N, P] = f(() => ({
46
- accountId: p,
46
+ }, _ = ee(), { organizationId: Re, widgetToken: ze, initResponse: v } = te(), Be = re(), Ve = t(n().organizationStatus), y = !!ne(), b = !!(Re && ze), x = f(() => fe(v?.scopes), [v?.scopes]), S = x.canRead && !!v, C = b && S, w = S && !b, [T, He] = p("transactions"), [Ue, E] = p(!1), [D, O] = p(ke), [We, Ge] = p(!1), [Ke, k] = p(!1), [qe, A] = p(!1), [Je, Ye] = p(!1), [Xe, j] = p(!1), [M, N] = p(), [P, F] = p(), [I, Ze] = p(De), [L, R] = p(() => ({
47
+ accountId: m,
47
48
  token: void 0
48
49
  }));
49
- N.accountId !== p && P({
50
- accountId: p,
50
+ L.accountId !== m && R({
51
+ accountId: m,
51
52
  token: void 0
52
53
  });
53
- let tt = N.accountId === p ? N.token : void 0, F = u((e) => {
54
- P((t) => ({
54
+ let Qe = L.accountId === m ? L.token : void 0, z = d((e) => {
55
+ R((t) => ({
55
56
  ...t,
56
57
  token: e
57
58
  }));
58
- }, []), [I, L] = f(() => /* @__PURE__ */ new Set());
59
+ }, []), [B, V] = p(() => /* @__PURE__ */ new Set());
59
60
  Se(() => {
60
- g(i.Mounted);
61
- }, [g]);
62
- let R = me({
63
- id: p,
64
- enabled: S
65
- }), z = ge({
66
- id: p,
67
- enabled: S && w === "transactions",
61
+ _(i.Mounted);
62
+ }, [_]);
63
+ let H = me({
64
+ id: m,
65
+ enabled: C
66
+ }), U = ge({
67
+ id: m,
68
+ enabled: C && T === "transactions",
68
69
  limit: 25,
69
70
  sortBy: "DATE",
70
71
  sortOrder: "DESC"
71
- }), [nt] = f(pe), B = he({
72
- id: p,
73
- startDate: nt,
74
- enabled: S && w === "statements",
75
- limit: M,
76
- pagination_token: tt,
72
+ }), [$e] = p(pe), W = he({
73
+ id: m,
74
+ startDate: $e,
75
+ enabled: C && T === "statements",
76
+ limit: I,
77
+ pagination_token: Qe,
77
78
  category: "STATEMENTS"
78
- }), rt = ye(), it = _e(), at = ve(), { mutate: ot, isPending: st, isError: V, reset: H } = rt, { mutateAsync: U, isPending: ct } = it, { mutateAsync: W } = at, G = x ? R.data : void 0, K = _?.bankName?.trim() ?? "", q = Ie?.trim() || void 0, J = { bankName: K }, lt = d(() => l(m.domesticWireIntro, J), [m.domesticWireIntro, K]), ut = d(() => l(m.domesticWireNote, J), [m.domesticWireNote, K]), dt = d(() => l(m.thingsToKnowBody, J), [m.thingsToKnowBody, K]), ft = G?.nickname?.trim() || h.accountFallback, pt = c(G?.balance), Y = d(() => (z.data?.data ?? []).map((e, t) => ({
79
+ }), et = ye(), tt = _e(), nt = ve(), { mutate: rt, isPending: it, isError: G, reset: K } = et, { mutateAsync: at, isPending: ot } = tt, { mutateAsync: st } = nt, q = S ? H.data : void 0, J = v?.bankName?.trim() ?? "", ct = Ie?.trim() || void 0, Y = { bankName: J }, lt = f(() => u(h.domesticWireIntro, Y), [h.domesticWireIntro, J]), ut = f(() => u(h.domesticWireNote, Y), [h.domesticWireNote, J]), dt = f(() => u(h.thingsToKnowBody, Y), [h.thingsToKnowBody, J]), ft = q?.nickname?.trim() || g.accountFallback, pt = l(q?.balance), mt = f(() => (U.data?.data ?? []).map((e, t) => ({
79
80
  key: `${e.date}-${t}`,
80
81
  descriptionLabel: e.description,
81
82
  dateLabel: le(e.date),
82
83
  amountLabel: se(e.amount, e.direction),
83
84
  amountVariant: e.direction === "CREDIT" ? "positive" : "default",
84
- balanceLabel: c(e.runningBalance)
85
- })), [z.data?.data]), mt = b.canRead && Y.length > 0, X = u((t) => {
86
- if (!y || !b.canRead) return;
85
+ balanceLabel: l(e.runningBalance)
86
+ })), [U.data?.data]), ht = x.canRead && mt.length > 0, gt = d((t) => {
87
+ if (!b || !x.canRead) return;
87
88
  let n = window.open("", "_blank");
88
89
  if (!n) {
89
- e.error(h.viewStatementErrorToast);
90
+ e.error(g.viewStatementErrorToast);
90
91
  return;
91
92
  }
92
- n.opener = null, L((e) => new Set(e).add(t)), W({
93
- id: p,
93
+ n.opener = null, V((e) => new Set(e).add(t)), st({
94
+ id: m,
94
95
  statementId: t
95
96
  }).then((e) => {
96
97
  let t = URL.createObjectURL(e);
97
98
  n.location.href = t, window.setTimeout(() => URL.revokeObjectURL(t), Oe);
98
99
  }).catch(() => {
99
- n.close(), e.error(h.viewStatementErrorToast);
100
+ n.close(), e.error(g.viewStatementErrorToast);
100
101
  }).finally(() => {
101
- L((e) => {
102
+ V((e) => {
102
103
  if (!e.has(t)) return e;
103
104
  let n = new Set(e);
104
105
  return n.delete(t), n;
105
106
  });
106
107
  });
107
108
  }, [
108
- p,
109
- h.viewStatementErrorToast,
110
- y,
111
- b.canRead,
112
- W
113
- ]), ht = d(() => (B.data?.data ?? []).map((e) => {
109
+ m,
110
+ g.viewStatementErrorToast,
111
+ b,
112
+ x.canRead,
113
+ st
114
+ ]), _t = f(() => (W.data?.data ?? []).map((e) => {
114
115
  let t = ce(e.statementDate);
115
116
  return {
116
117
  key: e.statementId,
117
118
  label: t,
118
- viewButtonAriaLabel: l(m.viewStatementButtonAriaLabel, { date: t }),
119
- isViewDisabled: I.has(e.statementId),
120
- onView: () => X(e.statementId)
119
+ viewButtonAriaLabel: u(h.viewStatementButtonAriaLabel, { date: t }),
120
+ isViewDisabled: B.has(e.statementId),
121
+ onView: () => gt(e.statementId)
121
122
  };
122
123
  }), [
123
- B.data?.data,
124
- m.viewStatementButtonAriaLabel,
125
- I,
126
- X
127
- ]), Z = B.data?.nextPaginationToken ?? void 0, Q = B.data?.prevPaginationToken ?? void 0, gt = S && w === "statements" && !!B.data && !B.isError, _t = S && w === "statements" && B.isLoading, vt = S && w === "statements" && B.isError, yt = u(() => {
128
- B.refetch();
129
- }, [B.refetch]), bt = u((e) => {
130
- et(e), F(void 0);
131
- }, []), xt = u(() => {
132
- F(Q);
133
- }, [Q]), St = u(() => {
134
- F(Z);
135
- }, [Z]), Ct = C || !a(O, A), wt = d(() => {
136
- let e = [{ after: s() }];
137
- return A && e.push({ after: o(A) }), e;
138
- }, [A]), Tt = d(() => {
139
- let e = [{ after: s() }];
140
- return O && e.push({ before: o(O) }), e;
141
- }, [O]), Et = u((e) => {
124
+ W.data?.data,
125
+ h.viewStatementButtonAriaLabel,
126
+ B,
127
+ gt
128
+ ]), X = W.data?.nextPaginationToken ?? void 0, Z = W.data?.prevPaginationToken ?? void 0, vt = C && T === "statements" && !!W.data && !W.isError, yt = C && T === "statements" && W.isLoading, bt = C && T === "statements" && W.isError && !r(W.error), xt = d(() => {
129
+ W.refetch();
130
+ }, [W.refetch]), St = d((e) => {
131
+ Ze(e), z(void 0);
132
+ }, []), Ct = d(() => {
133
+ z(Z);
134
+ }, [Z]), wt = d(() => {
135
+ z(X);
136
+ }, [X]), Tt = w || !o(M, P), Et = f(() => {
137
+ let e = [{ after: c() }];
138
+ return P && e.push({ after: s(P) }), e;
139
+ }, [P]), Dt = f(() => {
140
+ let e = [{ after: c() }];
141
+ return M && e.push({ before: s(M) }), e;
142
+ }, [M]), Ot = d((e) => {
142
143
  if (e) {
143
144
  let { startDate: e, endDate: t } = ie();
144
- k(e), j(t);
145
+ N(e), F(t);
145
146
  }
146
- $e(e);
147
- }, []), Dt = u(async () => {
148
- if (!y || !b.canRead || !O || !A || !a(O, A)) return;
149
- $e(!1);
150
- let t = e.loading(h.exportLoadingToast);
147
+ j(e);
148
+ }, []), kt = d(async () => {
149
+ if (!b || !x.canRead || !M || !P || !o(M, P)) return;
150
+ j(!1);
151
+ let t = e.loading(g.exportLoadingToast);
151
152
  try {
152
- let n = await U({
153
- id: p,
154
- startDate: re(O),
155
- endDate: re(A)
153
+ let n = await at({
154
+ id: m,
155
+ startDate: a(M),
156
+ endDate: a(P)
156
157
  });
157
- ae(n.csv, n.filename), e.success(h.exportSuccessToast, {
158
+ ae(n.csv, n.filename), e.success(g.exportSuccessToast, {
158
159
  id: t,
159
160
  duration: we
160
161
  });
161
162
  } catch {
162
- e.error(h.exportErrorToast, {
163
+ e.error(g.exportErrorToast, {
163
164
  id: t,
164
165
  duration: Te
165
166
  });
166
167
  }
167
168
  }, [
168
- p,
169
- U,
170
- A,
171
- O,
172
- h.exportErrorToast,
173
- h.exportLoadingToast,
174
- h.exportSuccessToast,
175
- y,
176
- b.canRead
177
- ]), $ = u(async (t, n) => {
169
+ m,
170
+ at,
171
+ P,
172
+ M,
173
+ g.exportErrorToast,
174
+ g.exportLoadingToast,
175
+ g.exportSuccessToast,
176
+ b,
177
+ x.canRead
178
+ ]), Q = d(async (t, n) => {
178
179
  if (!await oe(t)) return;
179
180
  let r = {
180
- account: h.copyAccountNumberToast,
181
- routing: h.copyRoutingNumberToast,
182
- bankName: h.copyBankNameToast,
183
- bankAddress: h.copyBankAddressToast
181
+ account: g.copyAccountNumberToast,
182
+ routing: g.copyRoutingNumberToast,
183
+ bankName: g.copyBankNameToast,
184
+ bankAddress: g.copyBankAddressToast
184
185
  };
185
186
  if (e.success(r[n]), n === "account") {
186
- qe(!0), window.setTimeout(() => qe(!1), 2e3);
187
+ k(!0), window.setTimeout(() => k(!1), 2e3);
187
188
  return;
188
189
  }
189
- n === "routing" && (Ye(!0), window.setTimeout(() => Ye(!1), 2e3));
190
+ n === "routing" && (A(!0), window.setTimeout(() => A(!1), 2e3));
190
191
  }, [
191
- h.copyAccountNumberToast,
192
- h.copyBankAddressToast,
193
- h.copyBankNameToast,
194
- h.copyRoutingNumberToast
195
- ]), Ot = (e) => {
196
- e && (D({ nickname: G?.nickname?.trim() ?? "" }), H()), T(e);
192
+ g.copyAccountNumberToast,
193
+ g.copyBankAddressToast,
194
+ g.copyBankNameToast,
195
+ g.copyRoutingNumberToast
196
+ ]), $ = (e) => {
197
+ e && (O({ nickname: q?.nickname?.trim() ?? "" }), K()), E(e);
197
198
  };
198
199
  return /* @__PURE__ */ Ce(xe, {
199
- labels: m,
200
+ labels: h,
200
201
  title: ft,
201
- bankDisplayName: K,
202
+ bankDisplayName: J,
202
203
  bankLogoSrc: Pe,
203
204
  bankLogoAlt: Fe,
204
205
  balanceLabel: pt,
205
206
  balanceTestId: "bank-accounts-widget-detail-balance",
206
207
  isBankingTaglineVisible: Ne,
207
- activeTab: w,
208
- transactionRows: Y,
209
- statementRows: ht,
210
- isStatementsLoading: _t,
211
- isStatementsError: vt,
212
- onStatementsRetry: yt,
213
- isStatementsPaginationVisible: gt,
214
- statementsPageSize: M,
208
+ activeTab: T,
209
+ transactionRows: mt,
210
+ statementRows: _t,
211
+ isStatementsLoading: yt,
212
+ isStatementsError: bt,
213
+ onStatementsRetry: xt,
214
+ isStatementsPaginationVisible: vt,
215
+ statementsPageSize: I,
215
216
  statementsPageSizeOptions: Ee,
216
- isStatementsPreviousPageDisabled: !Q,
217
- isStatementsNextPageDisabled: !Z,
218
- onStatementsPageSizeChange: bt,
219
- onStatementsPreviousPageClick: xt,
220
- onStatementsNextPageClick: St,
221
- showExport: mt,
222
- isExportOpen: Qe,
223
- exportStartDate: O,
224
- exportEndDate: A,
225
- isExportDownloading: ct,
226
- isExportDownloadDisabled: Ct,
227
- disabledExportStartDates: wt,
228
- disabledExportEndDates: Tt,
229
- accountNumberLabel: G?.accountNumber ?? "",
230
- maskedAccountNumberLabel: ue(G?.accountNumber ?? ""),
217
+ isStatementsPreviousPageDisabled: !Z,
218
+ isStatementsNextPageDisabled: !X,
219
+ onStatementsPageSizeChange: St,
220
+ onStatementsPreviousPageClick: Ct,
221
+ onStatementsNextPageClick: wt,
222
+ showExport: ht,
223
+ isExportOpen: Xe,
224
+ exportStartDate: M,
225
+ exportEndDate: P,
226
+ isExportDownloading: ot,
227
+ isExportDownloadDisabled: Tt,
228
+ disabledExportStartDates: Et,
229
+ disabledExportEndDates: Dt,
230
+ accountNumberLabel: q?.accountNumber ?? "",
231
+ maskedAccountNumberLabel: ue(q?.accountNumber ?? ""),
231
232
  accountNumberTestId: "bank-accounts-widget-detail-account-number",
232
- wireAccountNumberLabel: G?.accountNumber ?? "",
233
- routingNumberLabel: G?.routingNumber ?? "",
234
- bankAddressLabel: q,
233
+ wireAccountNumberLabel: q?.accountNumber ?? "",
234
+ routingNumberLabel: q?.routingNumber ?? "",
235
+ bankAddressLabel: ct,
235
236
  domesticWireIntroLabel: lt,
236
237
  domesticWireNoteLabel: ut,
237
238
  thingsToKnowBodyLabel: dt,
238
239
  supportTeamHref: Le,
239
240
  isAccountNumberVisible: We,
240
241
  isAccountNumberCopied: Ke,
241
- isRoutingNumberCopied: Je,
242
- isDomesticWireExpanded: Xe,
243
- isLoading: !v && (Ve && !G || Be && !_ || S && (R.isLoading || w === "transactions" && z.isLoading)),
244
- isError: v || S && (R.isError || w === "transactions" && z.isError),
242
+ isRoutingNumberCopied: qe,
243
+ isDomesticWireExpanded: Je,
244
+ isLoading: !y && (Ve && !q || Be && !v || C && (H.isLoading || T === "transactions" && U.isLoading)),
245
+ isError: y || C && (H.isError || T === "transactions" && U.isError),
245
246
  isEditOpen: Ue,
246
- isEditDisabled: !b.canWrite,
247
- isEditError: V,
248
- isSubmitting: st,
249
- isEditSaveDisabled: C,
250
- editForm: E,
251
- canEdit: b.canWrite,
247
+ isEditDisabled: !x.canWrite,
248
+ isEditError: G,
249
+ isSubmitting: it,
250
+ isEditSaveDisabled: w,
251
+ editForm: D,
252
+ canEdit: x.canWrite,
252
253
  onBack: Ae,
253
254
  onTabChange: He,
254
255
  onToggleAccountNumberVisibility: () => Ge((e) => !e),
255
- onCopyAccountNumber: () => void $(G?.accountNumber ?? "", "account"),
256
- onCopyRoutingNumber: () => void $(G?.routingNumber ?? "", "routing"),
257
- onCopyBankName: () => void $(K, "bankName"),
258
- onCopyBankAddress: () => void $(q ?? "", "bankAddress"),
259
- onDomesticWireExpandedChange: Ze,
260
- onEditOpenChange: Ot,
256
+ onCopyAccountNumber: () => void Q(q?.accountNumber ?? "", "account"),
257
+ onCopyRoutingNumber: () => void Q(q?.routingNumber ?? "", "routing"),
258
+ onCopyBankName: () => void Q(J, "bankName"),
259
+ onCopyBankAddress: () => void Q(ct ?? "", "bankAddress"),
260
+ onDomesticWireExpandedChange: Ye,
261
+ onEditOpenChange: $,
261
262
  onEditFormChange: (e) => {
262
- V && H(), D(e);
263
+ G && K(), O(e);
263
264
  },
264
265
  onEditSubmit: () => {
265
- if (!y || !b.canWrite) return;
266
- let t = E.nickname.trim();
267
- t && ot({
268
- path: { id: p },
266
+ if (!b || !x.canWrite) return;
267
+ let t = D.nickname.trim();
268
+ t && rt({
269
+ path: { id: m },
269
270
  body: { nickname: t }
270
271
  }, {
271
272
  onSuccess: () => {
272
- g(i.AccountUpdated, { accountId: p }), e.success(h.editSuccessToast), T(!1);
273
+ _(i.AccountUpdated, { accountId: m }), e.success(g.editSuccessToast), E(!1);
273
274
  },
274
275
  onError: () => {
275
- e.error(h.editErrorToast);
276
+ e.error(g.editErrorToast);
276
277
  }
277
278
  });
278
279
  },
279
- onEditNicknameClick: () => Ot(!0),
280
- onExportOpenChange: Et,
281
- onExportStartDateChange: k,
282
- onExportEndDateChange: j,
280
+ onEditNicknameClick: () => $(!0),
281
+ onExportOpenChange: Ot,
282
+ onExportStartDateChange: N,
283
+ onExportEndDateChange: F,
283
284
  onExportDownload: () => {
284
- Dt();
285
+ kt();
285
286
  }
286
287
  });
287
288
  }
288
289
  //#endregion
289
- export { p as AccountDetailsWidget };
290
+ export { m as AccountDetailsWidget };
@@ -7,6 +7,7 @@ var e = {
7
7
  failedCaption: (e) => `${e} failed to upload`,
8
8
  tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
9
9
  remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`,
10
+ fileTooLargeError: (e) => `Each file must be ${e} MB or smaller`,
10
11
  billDeletedError: "This bill was already deleted"
11
12
  };
12
13
  //#endregion
@@ -23,110 +23,115 @@ function g({ onOpenBill: g, labels: _ } = {}) {
23
23
  let v = {
24
24
  ...s,
25
25
  ..._
26
- }, y = _?.tooManyFilesError ?? s.tooManyFilesError, b = _?.remainingCapacityError ?? s.remainingCapacityError, { client: x, organizationId: S, authEpoch: C, organizationStatus: w } = r(), T = h(), E = f(() => o(S), [S]), D = l(), [O, k] = p(!1), { data: A = [] } = m({
27
- queryKey: E,
28
- queryFn: () => T.getQueryData(E) ?? [],
26
+ }, y = _?.tooManyFilesError ?? s.tooManyFilesError, b = _?.remainingCapacityError ?? s.remainingCapacityError, x = _?.fileTooLargeError ?? s.fileTooLargeError, { client: S, organizationId: C, authEpoch: w, organizationStatus: T } = r(), E = h(), D = f(() => o(C), [C]), O = l(), [k, A] = p(!1), { data: j = [] } = m({
27
+ queryKey: D,
28
+ queryFn: () => E.getQueryData(D) ?? [],
29
29
  staleTime: Infinity,
30
30
  gcTime: Infinity,
31
31
  initialData: []
32
- }), j = u((e, t) => {
33
- T.setQueryData(E, (n) => (n ?? []).map((n) => n.localId === e ? {
32
+ }), M = u((e, t) => {
33
+ E.setQueryData(D, (n) => (n ?? []).map((n) => n.localId === e ? {
34
34
  ...n,
35
35
  ...t
36
36
  } : n));
37
- }, [T, E]), M = u((e) => {
38
- T.setQueryData(E, (t) => (t ?? []).filter((t) => t.localId !== e));
39
- }, [T, E]), N = u((t) => {
40
- let n = (T.getQueryData(E) ?? []).filter((e) => e.status === "uploading").length;
37
+ }, [E, D]), N = u((e) => {
38
+ E.setQueryData(D, (t) => (t ?? []).filter((t) => t.localId !== e));
39
+ }, [E, D]), P = u((t) => {
40
+ let n = (E.getQueryData(D) ?? []).filter((e) => e.status === "uploading").length;
41
41
  if (t.length + n > 10) {
42
42
  e.error(n > 0 ? b(10 - n) : y(10));
43
43
  return;
44
44
  }
45
- k(!1);
45
+ if (t.some((e) => e.size > 20971520)) {
46
+ e.error(x(20));
47
+ return;
48
+ }
49
+ A(!1);
46
50
  for (let e of t) {
47
51
  let t = crypto.randomUUID();
48
- T.setQueryData(E, (n) => [...n ?? [], {
52
+ E.setQueryData(D, (n) => [...n ?? [], {
49
53
  localId: t,
50
54
  fileName: e.name,
51
55
  status: "uploading"
52
- }]), D.mutateAsync({ file: e }).then((e) => j(t, { payableId: e?.id })).catch(() => j(t, { status: "failed" }));
56
+ }]), O.mutateAsync({ file: e }).then((e) => M(t, { payableId: e?.id })).catch(() => M(t, { status: "failed" }));
53
57
  }
54
58
  }, [
55
- j,
56
- T,
59
+ x,
60
+ M,
57
61
  E,
62
+ D,
58
63
  b,
59
64
  y,
60
- D
61
- ]), P = c({ payableIds: A.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
65
+ O
66
+ ]), F = c({ payableIds: j.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
62
67
  d(() => {
63
68
  let e = /* @__PURE__ */ new Set();
64
- for (let t of P) if (t.suspectedDuplicateOf.length !== 0) {
69
+ for (let t of F) if (t.suspectedDuplicateOf.length !== 0) {
65
70
  e.add(t.payableId);
66
71
  for (let n of t.suspectedDuplicateOf) e.add(n);
67
72
  }
68
- for (let { payableId: t, ocrStatus: n, isError: r } of P) {
69
- let i = A.find((e) => e.payableId === t && e.status === "uploading");
70
- i && (n === "success" ? j(i.localId, { status: e.has(t) ? "duplicate" : "ready" }) : (r || n === "error" || n === "canceled") && j(i.localId, { status: "failed" }));
73
+ for (let { payableId: t, ocrStatus: n, isError: r } of F) {
74
+ let i = j.find((e) => e.payableId === t && e.status === "uploading");
75
+ i && (n === "success" ? M(i.localId, { status: e.has(t) ? "duplicate" : "ready" }) : (r || n === "error" || n === "canceled") && M(i.localId, { status: "failed" }));
71
76
  }
72
- for (let t of A) t.status === "ready" && t.payableId && e.has(t.payableId) && j(t.localId, { status: "duplicate" });
77
+ for (let t of j) t.status === "ready" && t.payableId && e.has(t.payableId) && M(t.localId, { status: "duplicate" });
73
78
  }, [
74
- A,
75
- P,
76
- j
79
+ j,
80
+ F,
81
+ M
77
82
  ]);
78
- let F = A.filter((e) => e.status === "uploading"), I = A.filter((e) => e.status === "ready"), L = A.filter((e) => e.status === "duplicate"), R = A.filter((e) => e.status === "failed"), z = (r) => ({
83
+ let I = j.filter((e) => e.status === "uploading"), L = j.filter((e) => e.status === "ready"), R = j.filter((e) => e.status === "duplicate"), z = j.filter((e) => e.status === "failed"), B = (r) => ({
79
84
  id: r.localId,
80
85
  fileName: r.fileName,
81
86
  status: r.status,
82
87
  onOpen: (r.status === "ready" || r.status === "duplicate") && r.payableId && g ? () => {
83
88
  let o = r.payableId;
84
- T.fetchQuery({
89
+ E.fetchQuery({
85
90
  ...n(t({
86
- client: x,
87
- headers: i(S),
91
+ client: S,
92
+ headers: i(C),
88
93
  path: { payable_id: o }
89
94
  }), {
90
- authEpoch: C,
91
- organizationStatus: w
95
+ authEpoch: w,
96
+ organizationStatus: T
92
97
  }),
93
98
  retry: !1
94
99
  }).catch((e) => {
95
100
  if (a(e)) return "deleted";
96
101
  }).then((t) => {
97
- t === "deleted" ? e.error(v.billDeletedError) : g(o), M(r.localId);
102
+ t === "deleted" ? e.error(v.billDeletedError) : g(o), N(r.localId);
98
103
  });
99
104
  } : void 0
100
- }), B = F.length ? [{
105
+ }), V = I.length ? [{
101
106
  id: "in-progress",
102
- items: A.map(z)
107
+ items: j.map(B)
103
108
  }] : [
104
- ...I.length ? [{
109
+ ...L.length ? [{
105
110
  id: "ready",
106
- caption: v.readyCaption(I.length),
107
- items: I.map(z)
111
+ caption: v.readyCaption(L.length),
112
+ items: L.map(B)
108
113
  }] : [],
109
- ...L.length ? [{
114
+ ...R.length ? [{
110
115
  id: "duplicate",
111
- caption: v.duplicateCaption(L.length),
112
- items: L.map(z)
116
+ caption: v.duplicateCaption(R.length),
117
+ items: R.map(B)
113
118
  }] : [],
114
- ...R.length ? [{
119
+ ...z.length ? [{
115
120
  id: "failed",
116
- caption: v.failedCaption(R.length),
117
- items: R.map(z)
121
+ caption: v.failedCaption(z.length),
122
+ items: z.map(B)
118
123
  }] : []
119
- ], V = I.length + L.length, H = F.length ? v.uploadingSummary(A.length) : V ? v.completeSummary(V) : v.failedCaption(R.length), U = u(() => {
120
- T.setQueryData(E, []);
121
- }, [T, E]);
124
+ ], H = L.length + R.length, U = I.length ? v.uploadingSummary(j.length) : H ? v.completeSummary(H) : v.failedCaption(z.length), W = u(() => {
125
+ E.setQueryData(D, []);
126
+ }, [E, D]);
122
127
  return {
123
- enqueue: N,
124
- sections: B,
125
- summaryLabel: H,
126
- collapsed: O,
127
- onToggleCollapsed: u(() => k((e) => !e), []),
128
- onClose: U,
129
- isVisible: A.length > 0
128
+ enqueue: P,
129
+ sections: V,
130
+ summaryLabel: U,
131
+ collapsed: k,
132
+ onToggleCollapsed: u(() => A((e) => !e), []),
133
+ onClose: W,
134
+ isVisible: j.length > 0
130
135
  };
131
136
  }
132
137
  //#endregion
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.9.41", n = "64c2e0da0918115a4ccbe3e956c8e197a3a4fc85", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.9.44", n = "0566ca36c3657385b52cd990c71145af70b75966", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -0,0 +1,7 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiUnprocessable.js
2
+ var e = /* @__PURE__ */ new Set(["GET /embedded-banking/v1/bank-accounts/{id}/statements"]);
3
+ function t(t, n, r) {
4
+ return t === 422 && n !== void 0 && r !== void 0 && e.has(`${n.toUpperCase()} ${r}`);
5
+ }
6
+ //#endregion
7
+ export { t as isExpectedApiUnprocessable };