@tesouro/embedded-components-react 0.5.45 → 0.5.47

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 (79) hide show
  1. package/README.md +7 -5
  2. package/dist/index.d.ts +54 -24
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +15 -1
  5. package/dist/lib/BillPayWidget.d.ts +16 -1
  6. package/dist/lib/BillPayWidget.js +1 -1
  7. package/dist/lib/SettingsWidget.d.ts +1 -0
  8. package/dist/lib/WidgetSuite.d.ts +1 -0
  9. package/dist/lib/monite-sdk.d.ts +2 -0
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +12 -8
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +233 -211
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -59
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -208
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +126 -206
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -113
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +163 -151
  62. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +77 -77
  63. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +17 -10
  64. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js +2 -1
  65. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +1 -1
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +10 -4
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +1 -1
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +23 -23
  69. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index3.js +1 -0
  70. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +13 -4
  71. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +27 -29
  72. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +29 -28
  73. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +13 -13
  74. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
  75. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
  77. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
  78. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  79. package/package.json +1 -1
@@ -1,234 +1,42 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
- import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
- import { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
- import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { useWidgetConfig as ne } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { usePayableApprovalRequestsQuery as re } from "../../data-access/dist/index8.js";
13
- import { usePayableHistoryQuery as n } from "../../data-access/dist/index9.js";
14
- import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index10.js";
15
- import { usePayableQuery as i } from "../../data-access/dist/index17.js";
16
- import "../../data-access/dist/index.js";
17
- import { BillDecisionDialog as a } from "../../ui/dist/index56.js";
18
- import { BillDetailsSheet as o } from "../../ui/dist/index65.js";
19
- import { BillDuplicateNotice as s } from "../../ui/dist/index72.js";
20
- import { MarkAsPaidDialog as c } from "../../ui/dist/index102.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index64.js";
21
2
  import "../../ui/dist/index.js";
22
- import { usePayableDuplicateReview as l } from "./index13.js";
23
- import "./index14.js";
24
- import { canOverrideApprovalPolicy as u, canReadCounterpartBankAccounts as d } from "./index20.js";
25
- import { resolveAmountDueMinorUnits as f } from "./index21.js";
26
- import { usePayableAchInstructions as p } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
27
- import "../../../shared/counterpart-management/feature/dist/index.js";
28
- import { PayBillFlow as m } from "./index27.js";
29
- import "./index28.js";
30
- import { mapPayableToBillDetails as ie } from "./index42.js";
31
- import { mergeMarkAsPaidFlowLabels as ae } from "./index15.js";
32
- import { useMarkAsPaidFlow as oe } from "./index17.js";
3
+ import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index15.js";
33
4
  import "./index18.js";
34
- import { mergeDecisionDialogCopy as se, mergePaymentHistoryMethodLabels as ce } from "./index46.js";
35
- import { buildPaymentHistory as le } from "./index3.js";
36
- import { currentApprovalRound as ue } from "./index4.js";
37
- import { usePayableApprovalRoundStart as de } from "./index32.js";
38
- import { useApprovalPolicyCardView as fe } from "./index33.js";
39
- import { resolveBillRejectionNotice as pe } from "./index34.js";
40
- import { useCurrentApprovalRequestId as me } from "./index35.js";
41
- import { usePayableDetailActions as he } from "./index36.js";
42
- import { useScheduledPayment as ge } from "./index37.js";
43
- import { BILL_DETAILS_LABELS_EN as h } from "./index62.js";
44
- import { useMemo as g, useRef as _e } from "react";
45
- import { Fragment as ve, jsx as _, jsxs as ye } from "react/jsx-runtime";
5
+ import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index29.js";
6
+ import { AWAITING_APPROVAL_LABEL_EN as r, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as i, BILL_DETAIL_ACTIONS_LABELS_EN as a, PAYMENT_HISTORY_LABELS_EN as o, SCHEDULED_STATUS_BADGE_LABEL_EN as s, SCHEDULED_SUMMARY_LABEL_EN as c } from "./index46.js";
46
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
47
- function v({ open: v, onOpenChange: y, payableId: b, onClose: x, onExpand: S, onEdit: C, testId: w, labels: T, poweredByBankName: E }) {
48
- let D = g(() => ({
49
- ...h,
50
- ...T,
51
- sheet: {
52
- ...h.sheet,
53
- ...T?.sheet,
54
- statusBadge: {
55
- ...h.sheet.statusBadge,
56
- ...T?.sheet?.statusBadge
57
- },
58
- approvalPolicy: {
59
- ...h.sheet.approvalPolicy,
60
- ...T?.sheet?.approvalPolicy
61
- },
62
- dueDate: {
63
- ...h.sheet.dueDate,
64
- ...T?.sheet?.dueDate
65
- }
66
- },
67
- decisionDialog: se(h.decisionDialog, T?.decisionDialog),
68
- approvalPolicyCopy: {
69
- ...h.approvalPolicyCopy,
70
- ...T?.approvalPolicyCopy
71
- },
72
- markAsPaid: ae(T?.markAsPaid),
73
- actionSuccess: {
74
- ...h.actionSuccess,
75
- ...T?.actionSuccess
76
- },
77
- paymentHistoryMethodLabels: ce(T?.paymentHistoryMethodLabels)
78
- }), [T]), O = i(b), k = r(b), A = ee(), { initResponse: j } = ne(), M = O.data, N = _e(null), P = me({
79
- payableId: b,
80
- status: M?.status
81
- }), F = M?.status === "rejected", be = e(j?.scopes, [t.ApprovalRequestReadOrg]), I = F && be, L = de({
82
- payableId: b,
83
- enabled: I
84
- }), R = re(b, { enabled: I }), xe = e(j?.scopes, [t.UserReadOrg]), z = te({ enabled: F && xe }), B = g(() => ue(R.data?.data, L.roundStartedAt), [R.data, L.roundStartedAt]), V = g(() => pe({
85
- payableStatus: M?.status,
86
- approvalRequests: B,
87
- users: z.data?.data ?? [],
88
- payableUpdatedAt: M?.updated_at,
89
- labels: D
90
- }), [
91
- M?.status,
92
- M?.updated_at,
93
- B,
94
- z.data,
95
- D
96
- ]), H = fe({
97
- payableId: b,
98
- approvalPolicyId: M?.approval_policy_id,
99
- copy: D.approvalPolicyCopy
100
- }), U = u({
101
- status: M?.status,
102
- scopes: j?.scopes,
103
- arePendingApproversUnknown: H.isLoading,
104
- hasApprovalPolicy: !!M?.approval_policy_id,
105
- hasWaitingRequest: P.hasWaitingRequest
106
- }), W = !!P.id, G = P.isLoading || H.isLoading, K = g(() => H.pendingApprovers.length ? H.pendingApprovers.flatMap((e) => e.names) : void 0, [H.pendingApprovers]), q = ge({
107
- payableId: b,
108
- scheduledPaymentDate: M?.scheduled_payment_date
109
- }), J = d(j?.scopes), Y = p({
110
- counterpartId: M?.counterpart_id,
111
- currency: M?.currency,
112
- currentBankAccountId: M?.counterpart_bank_account_id,
113
- enabled: J
114
- }), X = oe({
115
- payableId: b,
116
- amountDueMinorUnits: f(M) ?? 0,
117
- amountToPayMinorUnits: M?.amount_to_pay ?? void 0,
118
- currencyCode: M?.currency ?? void 0,
119
- dueDate: M?.due_date,
120
- hasScheduledPayment: q.hasScheduledPayment,
121
- testId: w,
122
- labels: D.markAsPaid
123
- }), { actions: Se, decisionDialog: Ce } = he({
124
- payableId: M ? b : void 0,
125
- status: M?.status,
126
- currentApprovalRequestId: P.id,
127
- hasScheduledPayment: q.hasScheduledPayment,
128
- scheduledPaymentIntentId: q.scheduledPaymentIntentId,
129
- isScheduledPaymentUnknown: q.isResolving,
130
- isPayabilityUnknown: Y.isLoading,
131
- hasApprovalPolicy: !!M?.approval_policy_id,
132
- hasWaitingRequest: P.hasWaitingRequest,
133
- pendingApprovers: H.pendingApprovers,
134
- arePendingApproversUnknown: H.isLoading,
135
- labels: {
136
- edit: D.sheet.editButton,
137
- payBill: D.sheet.payButton,
138
- markAsPaid: D.sheet.markAsPaidButton,
139
- reject: D.sheet.rejectButton,
140
- approve: D.sheet.approveButton,
141
- cancel: D.sheet.cancelButton,
142
- cancelScheduledPayment: D.sheet.cancelScheduledPaymentButton,
143
- reopen: D.sheet.reopenButton,
144
- forceApprove: D.sheet.forceApproveButton,
145
- forceReject: D.sheet.forceRejectButton,
146
- policyOverridesHeading: D.sheet.policyOverridesGroup,
147
- decisionDialog: D.decisionDialog,
148
- actionError: D.actionError,
149
- actionSuccess: D.actionSuccess
150
- },
151
- isMarkAsPaidPending: X.isPending,
152
- onMarkAsPaidSelect: X.open,
153
- onPayBillSelect: () => N.current?.open(),
154
- onEditSelect: C,
155
- onActionSucceeded: (e) => {
156
- e === "reopen" && C?.();
157
- }
158
- }), we = q.hasScheduledPayment && q.scheduledDateLabel ? D.scheduledSummary(q.scheduledDateLabel) : void 0, Z = l({
159
- payable: M,
160
- canManage: e(j?.scopes, [t.PayableWriteOrg])
161
- }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ _(s, {
162
- onNotADuplicate: Z.onNotADuplicate,
163
- isActionDisabled: Z.isBusy
164
- }) : void 0, $ = n(b), Te = g(() => le({
165
- records: q.paymentRecords,
166
- events: $.data?.data ?? [],
167
- currencyCode: M?.currency,
168
- labels: D
169
- }), [
170
- q.paymentRecords,
171
- $.data,
172
- M?.currency,
173
- D
174
- ]), Ee = g(() => M ? ie({
175
- payable: M,
176
- lineItems: k.lineItems,
177
- ledgerAccounts: A.data?.data ?? [],
178
- labels: D,
179
- hasScheduledPayment: q.hasScheduledPayment,
180
- rejection: V,
181
- achInstructions: Y.achInstructions,
182
- achInstructionsReadable: J && !Y.isLoading && !Y.isError
183
- }) : void 0, [
184
- M,
185
- k.lineItems,
186
- A.data,
187
- D,
188
- q.hasScheduledPayment,
189
- V,
190
- Y.achInstructions,
191
- Y.isError,
192
- Y.isLoading,
193
- J
194
- ]), De = O.isLoading || k.isResolving || A.isResolving || Y.isLoading, Oe = O.isError || k.isError || A.isError;
195
- return /* @__PURE__ */ ye(ve, { children: [
196
- /* @__PURE__ */ _(o, {
197
- open: v,
198
- onOpenChange: y,
199
- details: Ee,
200
- actions: Se,
201
- approvalPolicy: H.view,
202
- showApprovalOverrideNotice: !G && !W && U && !!M?.approval_policy_id,
203
- awaitingApprovalNotice: !G && !W && !U && M?.status === "approve_in_progress" && M?.approval_policy_id ? K ? D.awaitingApprovalNotice(K) : D.awaitingApprovalUnknownNotice : void 0,
204
- scheduledSummary: we,
205
- paymentHistory: Te,
206
- paymentHistoryError: q.isError || $.isError,
207
- paymentHistoryLoading: q.isResolving || $.isLoading,
208
- isLoading: De,
209
- isError: Oe,
210
- notice: Q,
211
- onClose: x,
212
- onExpand: S,
213
- testId: w,
214
- labels: D.sheet
215
- }),
216
- /* @__PURE__ */ _(a, {
217
- ...Ce,
218
- labels: { cancelButton: D.decisionDialog.cancelButton },
219
- testId: w ? `${w}-decision-dialog` : void 0,
220
- confirmTestId: w ? `${w}-decision-confirm` : void 0,
221
- reasonTestId: w ? `${w}-decision-reason` : void 0,
222
- reasonFieldId: w ? `${w}-decision-reason-field` : void 0
223
- }),
224
- /* @__PURE__ */ _(c, { ...X.dialogProps }),
225
- M ? /* @__PURE__ */ _(m, {
226
- ref: N,
227
- payable: M,
228
- onMissingAchInstructions: S,
229
- poweredByBankName: E
230
- }) : null
231
- ] });
232
- }
8
+ var l = {
9
+ subtitle: "Accounts payable",
10
+ vendorRow: "Vendor",
11
+ bankAccountRow: "ACH bank account",
12
+ bankAccountValue: (e) => `Account ending in ${e}`,
13
+ ...o,
14
+ invoiceNumberRow: "Number",
15
+ issueDateRow: "Issue date",
16
+ dueDateRow: "Due date",
17
+ poNumberRow: "PO number",
18
+ notProvided: "Not provided",
19
+ glCodeMissing: "GL code not specified",
20
+ quantityValue: (e, t) => `${e} x ${t}`,
21
+ quantityOnlyValue: (e) => e,
22
+ subtotalRow: "Subtotal",
23
+ discountsRow: "Discounts",
24
+ taxRow: "Tax",
25
+ totalRow: "Total",
26
+ actionError: a.actionError,
27
+ actionSuccess: a.actionSuccess,
28
+ scheduledSummary: c,
29
+ scheduledStatusBadge: s,
30
+ awaitingApprovalNotice: r,
31
+ awaitingApprovalUnknownNotice: i,
32
+ paidOnLabel: (e) => `Paid on ${e}`,
33
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
34
+ rejectedOn: (e) => `Rejected on ${e}`,
35
+ rejectionMessage: (e) => `"${e}"`,
36
+ sheet: e,
37
+ decisionDialog: a.decisionDialog,
38
+ approvalPolicyCopy: n,
39
+ markAsPaid: t
40
+ };
233
41
  //#endregion
234
- export { v as BillDetailsContainer, v as default };
42
+ export { l as BILL_DETAILS_LABELS_EN };
@@ -1,3 +1,234 @@
1
- import "./index42.js";
2
- import "./index62.js";
3
- import "./index63.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import { useWidgetConfig as te } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import { useOrganizationUserNames as ne } from "../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { usePayableApprovalRequestsQuery as re } from "../../data-access/dist/index8.js";
13
+ import { usePayableHistoryQuery as n } from "../../data-access/dist/index9.js";
14
+ import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index10.js";
15
+ import { usePayableQuery as i } from "../../data-access/dist/index17.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { BillDecisionDialog as a } from "../../ui/dist/index56.js";
18
+ import { BillDetailsSheet as o } from "../../ui/dist/index65.js";
19
+ import { BillDuplicateNotice as s } from "../../ui/dist/index72.js";
20
+ import { MarkAsPaidDialog as c } from "../../ui/dist/index102.js";
21
+ import "../../ui/dist/index.js";
22
+ import { usePayableDuplicateReview as l } from "./index13.js";
23
+ import "./index14.js";
24
+ import { canOverrideApprovalPolicy as u, canReadCounterpartBankAccounts as d } from "./index20.js";
25
+ import { resolveAmountDueMinorUnits as f } from "./index21.js";
26
+ import { usePayableAchInstructions as p } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
27
+ import "../../../shared/counterpart-management/feature/dist/index.js";
28
+ import { PayBillFlow as m } from "./index27.js";
29
+ import "./index28.js";
30
+ import { mapPayableToBillDetails as ie } from "./index42.js";
31
+ import { mergeMarkAsPaidFlowLabels as ae } from "./index15.js";
32
+ import { useMarkAsPaidFlow as oe } from "./index17.js";
33
+ import "./index18.js";
34
+ import { mergeDecisionDialogCopy as se, mergePaymentHistoryMethodLabels as ce } from "./index46.js";
35
+ import { buildPaymentHistory as le } from "./index3.js";
36
+ import { currentApprovalRound as ue } from "./index4.js";
37
+ import { usePayableApprovalRoundStart as de } from "./index32.js";
38
+ import { useApprovalPolicyCardView as fe } from "./index33.js";
39
+ import { resolveBillRejectionNotice as pe } from "./index34.js";
40
+ import { useCurrentApprovalRequestId as me } from "./index35.js";
41
+ import { usePayableDetailActions as he } from "./index36.js";
42
+ import { useScheduledPayment as ge } from "./index37.js";
43
+ import { BILL_DETAILS_LABELS_EN as h } from "./index63.js";
44
+ import { useMemo as g, useRef as _e } from "react";
45
+ import { Fragment as ve, jsx as _, jsxs as ye } from "react/jsx-runtime";
46
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
47
+ function v({ open: v, onOpenChange: y, payableId: b, onClose: x, onExpand: S, onEdit: C, testId: w, labels: T, poweredByBankName: E }) {
48
+ let D = g(() => ({
49
+ ...h,
50
+ ...T,
51
+ sheet: {
52
+ ...h.sheet,
53
+ ...T?.sheet,
54
+ statusBadge: {
55
+ ...h.sheet.statusBadge,
56
+ ...T?.sheet?.statusBadge
57
+ },
58
+ approvalPolicy: {
59
+ ...h.sheet.approvalPolicy,
60
+ ...T?.sheet?.approvalPolicy
61
+ },
62
+ dueDate: {
63
+ ...h.sheet.dueDate,
64
+ ...T?.sheet?.dueDate
65
+ }
66
+ },
67
+ decisionDialog: se(h.decisionDialog, T?.decisionDialog),
68
+ approvalPolicyCopy: {
69
+ ...h.approvalPolicyCopy,
70
+ ...T?.approvalPolicyCopy
71
+ },
72
+ markAsPaid: ae(T?.markAsPaid),
73
+ actionSuccess: {
74
+ ...h.actionSuccess,
75
+ ...T?.actionSuccess
76
+ },
77
+ paymentHistoryMethodLabels: ce(T?.paymentHistoryMethodLabels)
78
+ }), [T]), O = i(b), k = r(b), A = ee(), { initResponse: j } = te(), M = O.data, N = _e(null), P = me({
79
+ payableId: b,
80
+ status: M?.status
81
+ }), F = M?.status === "rejected", be = e(j?.scopes, [t.ApprovalRequestReadOrg]), I = F && be, L = de({
82
+ payableId: b,
83
+ enabled: I
84
+ }), R = re(b, { enabled: I }), xe = e(j?.scopes, [t.UserReadOrg]), { userNames: z } = ne({ enabled: F && xe }), B = g(() => ue(R.data?.data, L.roundStartedAt), [R.data, L.roundStartedAt]), V = g(() => pe({
85
+ payableStatus: M?.status,
86
+ approvalRequests: B,
87
+ userNames: z,
88
+ payableUpdatedAt: M?.updated_at,
89
+ labels: D
90
+ }), [
91
+ M?.status,
92
+ M?.updated_at,
93
+ B,
94
+ z,
95
+ D
96
+ ]), H = fe({
97
+ payableId: b,
98
+ approvalPolicyId: M?.approval_policy_id,
99
+ copy: D.approvalPolicyCopy
100
+ }), U = u({
101
+ status: M?.status,
102
+ scopes: j?.scopes,
103
+ arePendingApproversUnknown: H.isLoading,
104
+ hasApprovalPolicy: !!M?.approval_policy_id,
105
+ hasWaitingRequest: P.hasWaitingRequest
106
+ }), W = !!P.id, G = P.isLoading || H.isLoading, K = g(() => H.pendingApprovers.length ? H.pendingApprovers.flatMap((e) => e.names) : void 0, [H.pendingApprovers]), q = ge({
107
+ payableId: b,
108
+ scheduledPaymentDate: M?.scheduled_payment_date
109
+ }), J = d(j?.scopes), Y = p({
110
+ counterpartId: M?.counterpart_id,
111
+ currency: M?.currency,
112
+ currentBankAccountId: M?.counterpart_bank_account_id,
113
+ enabled: J
114
+ }), X = oe({
115
+ payableId: b,
116
+ amountDueMinorUnits: f(M) ?? 0,
117
+ amountToPayMinorUnits: M?.amount_to_pay ?? void 0,
118
+ currencyCode: M?.currency ?? void 0,
119
+ dueDate: M?.due_date,
120
+ hasScheduledPayment: q.hasScheduledPayment,
121
+ testId: w,
122
+ labels: D.markAsPaid
123
+ }), { actions: Se, decisionDialog: Ce } = he({
124
+ payableId: M ? b : void 0,
125
+ status: M?.status,
126
+ currentApprovalRequestId: P.id,
127
+ hasScheduledPayment: q.hasScheduledPayment,
128
+ scheduledPaymentIntentId: q.scheduledPaymentIntentId,
129
+ isScheduledPaymentUnknown: q.isResolving,
130
+ isPayabilityUnknown: Y.isLoading,
131
+ hasApprovalPolicy: !!M?.approval_policy_id,
132
+ hasWaitingRequest: P.hasWaitingRequest,
133
+ pendingApprovers: H.pendingApprovers,
134
+ arePendingApproversUnknown: H.isLoading,
135
+ labels: {
136
+ edit: D.sheet.editButton,
137
+ payBill: D.sheet.payButton,
138
+ markAsPaid: D.sheet.markAsPaidButton,
139
+ reject: D.sheet.rejectButton,
140
+ approve: D.sheet.approveButton,
141
+ cancel: D.sheet.cancelButton,
142
+ cancelScheduledPayment: D.sheet.cancelScheduledPaymentButton,
143
+ reopen: D.sheet.reopenButton,
144
+ forceApprove: D.sheet.forceApproveButton,
145
+ forceReject: D.sheet.forceRejectButton,
146
+ policyOverridesHeading: D.sheet.policyOverridesGroup,
147
+ decisionDialog: D.decisionDialog,
148
+ actionError: D.actionError,
149
+ actionSuccess: D.actionSuccess
150
+ },
151
+ isMarkAsPaidPending: X.isPending,
152
+ onMarkAsPaidSelect: X.open,
153
+ onPayBillSelect: () => N.current?.open(),
154
+ onEditSelect: C,
155
+ onActionSucceeded: (e) => {
156
+ e === "reopen" && C?.();
157
+ }
158
+ }), we = q.hasScheduledPayment && q.scheduledDateLabel ? D.scheduledSummary(q.scheduledDateLabel) : void 0, Z = l({
159
+ payable: M,
160
+ canManage: e(j?.scopes, [t.PayableWriteOrg])
161
+ }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ _(s, {
162
+ onNotADuplicate: Z.onNotADuplicate,
163
+ isActionDisabled: Z.isBusy
164
+ }) : void 0, $ = n(b), Te = g(() => le({
165
+ records: q.paymentRecords,
166
+ events: $.data?.data ?? [],
167
+ currencyCode: M?.currency,
168
+ labels: D
169
+ }), [
170
+ q.paymentRecords,
171
+ $.data,
172
+ M?.currency,
173
+ D
174
+ ]), Ee = g(() => M ? ie({
175
+ payable: M,
176
+ lineItems: k.lineItems,
177
+ ledgerAccounts: A.data?.data ?? [],
178
+ labels: D,
179
+ hasScheduledPayment: q.hasScheduledPayment,
180
+ rejection: V,
181
+ achInstructions: Y.achInstructions,
182
+ achInstructionsReadable: J && !Y.isLoading && !Y.isError
183
+ }) : void 0, [
184
+ M,
185
+ k.lineItems,
186
+ A.data,
187
+ D,
188
+ q.hasScheduledPayment,
189
+ V,
190
+ Y.achInstructions,
191
+ Y.isError,
192
+ Y.isLoading,
193
+ J
194
+ ]), De = O.isLoading || k.isResolving || A.isResolving || Y.isLoading, Oe = O.isError || k.isError || A.isError;
195
+ return /* @__PURE__ */ ye(ve, { children: [
196
+ /* @__PURE__ */ _(o, {
197
+ open: v,
198
+ onOpenChange: y,
199
+ details: Ee,
200
+ actions: Se,
201
+ approvalPolicy: H.view,
202
+ showApprovalOverrideNotice: !G && !W && U && !!M?.approval_policy_id,
203
+ awaitingApprovalNotice: !G && !W && !U && M?.status === "approve_in_progress" && M?.approval_policy_id ? K ? D.awaitingApprovalNotice(K) : D.awaitingApprovalUnknownNotice : void 0,
204
+ scheduledSummary: we,
205
+ paymentHistory: Te,
206
+ paymentHistoryError: q.isError || $.isError,
207
+ paymentHistoryLoading: q.isResolving || $.isLoading,
208
+ isLoading: De,
209
+ isError: Oe,
210
+ notice: Q,
211
+ onClose: x,
212
+ onExpand: S,
213
+ testId: w,
214
+ labels: D.sheet
215
+ }),
216
+ /* @__PURE__ */ _(a, {
217
+ ...Ce,
218
+ labels: { cancelButton: D.decisionDialog.cancelButton },
219
+ testId: w ? `${w}-decision-dialog` : void 0,
220
+ confirmTestId: w ? `${w}-decision-confirm` : void 0,
221
+ reasonTestId: w ? `${w}-decision-reason` : void 0,
222
+ reasonFieldId: w ? `${w}-decision-reason-field` : void 0
223
+ }),
224
+ /* @__PURE__ */ _(c, { ...X.dialogProps }),
225
+ M ? /* @__PURE__ */ _(m, {
226
+ ref: N,
227
+ payable: M,
228
+ onMissingAchInstructions: S,
229
+ poweredByBankName: E
230
+ }) : null
231
+ ] });
232
+ }
233
+ //#endregion
234
+ export { v as BillDetailsContainer, v as default };
@@ -1,4 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
3
- //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
1
+ import "./index42.js";
2
+ import "./index63.js";
3
+ import "./index64.js";
@@ -1,46 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index65.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index445.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
14
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- gatewayRouting: l,
30
- linkComponent: u,
31
- implementation: d,
32
- uiFramework: f,
33
- errorFallback: p,
34
- onError: m,
35
- finopsThemeColors: h,
36
- analytics: g,
37
- disclosuresAcceptance: _,
38
- providerLabels: v,
39
- children: /* @__PURE__ */ o(c, {
40
- ...b,
41
- pageTitleComponent: y
42
- })
43
- });
44
- }
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
45
3
  //#endregion
46
- export { l as BillPayWidgetMonite, l as default };
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1 +1,46 @@
1
- import "./index66.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index66.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index445.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
14
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
37
+ disclosuresAcceptance: _,
38
+ providerLabels: v,
39
+ children: /* @__PURE__ */ o(c, {
40
+ ...b,
41
+ pageTitleComponent: y
42
+ })
43
+ });
44
+ }
45
+ //#endregion
46
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,8 +1 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
7
- //#endregion
8
- export { e as billPayUploadQueueKey };
1
+ import "./index67.js";
@@ -1,13 +1,8 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js
2
- var e = {
3
- uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
- completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
- readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
- duplicateCaption: (e) => `${e} possible ${e === 1 ? "duplicate" : "duplicates"}`,
7
- failedCaption: (e) => `${e} failed to upload`,
8
- tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
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
- billDeletedError: "This bill was already deleted"
11
- };
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
12
7
  //#endregion
13
- export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
8
+ export { e as billPayUploadQueueKey };