@tesouro/embedded-components-react 0.11.235 → 0.11.236

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 (75) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +12 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +24 -0
  5. package/dist/lib/WidgetSuite.d.ts +24 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +198 -118
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +76 -194
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +67 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +111 -69
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +459 -108
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +101 -449
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +9 -117
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +85 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +67 -73
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +246 -71
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +40 -251
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +237 -38
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +21 -244
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +529 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +4 -530
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +242 -41
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +3 -245
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +63 -4
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +386 -354
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +260 -258
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +219 -179
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -25
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +15 -0
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +31 -40
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -17
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +40 -8
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +30 -63
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +463 -27
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +15 -29
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -18
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +18 -18
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +19 -30
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +15 -66
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +66 -391
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +148 -2
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +173 -43
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +3 -71
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +37 -432
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +66 -188
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +455 -22
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +191 -5
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +23 -0
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +5 -265
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +261 -125
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +2 -27
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +122 -230
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +27 -3
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +216 -224
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +3 -30
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +228 -168
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +29 -21
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +152 -109
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +22 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +140 -43
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +2 -0
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index65.js +47 -0
  70. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/document-preview.js +1 -0
  71. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/document/documentPreview.js +122 -0
  73. package/package.json +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +0 -1
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +0 -2
@@ -1,44 +1,245 @@
1
- import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o } from "../../../util/dist/lib/billDetailLabels.js";
2
- import { BILL_DUE_DATE_LABELS_EN as s } from "../../../util/dist/lib/resolveBillDueDate.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 n } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
11
+ import { useLocalCalendarDay as r } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
12
+ import "../../../../shared/feature/dist/index.js";
13
+ import { mergeDecisionDialogCopy as i, mergePaymentHistoryMethodLabels as a } from "../../../util/dist/lib/billDetailLabels.js";
14
+ import { hasSuspectedPayableDuplicate as o } from "../../../util/dist/lib/payableDuplicates.js";
3
15
  import "../../../util/dist/index.js";
4
- import { APPROVAL_POLICY_RULE_COPY_EN as c } from "./index10.js";
5
- import { PAYABLE_AUDIT_HISTORY_LABELS_EN as l } from "./index30.js";
6
- import { BILL_DETAILS_SHEET_LABELS_EN as u } from "../../ui/dist/index33.js";
16
+ import { BillDecisionDialog as s } from "../../../ui/dist/index4.js";
17
+ import "../../../ui/dist/index.js";
18
+ import { usePayableAchInstructions as c } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
19
+ import "../../../../shared/counterpart-management/feature/dist/index.js";
20
+ import { mapPayableToBillDetails as l } from "./index27.js";
21
+ import { BillDetailsSheet as u } from "../../ui/dist/index34.js";
22
+ import { BillDuplicateNotice as d } from "../../ui/dist/index37.js";
7
23
  import "../../ui/dist/index.js";
24
+ import { useAllPayableLineItemsQuery as f } from "../../data-access/dist/index6.js";
25
+ import { usePayableQuery as p } from "../../data-access/dist/index24.js";
26
+ import "../../data-access/dist/index.js";
27
+ import { buildPaymentHistory as m } from "./index2.js";
28
+ import { canOverrideApprovalPolicy as h, canReadCounterpartBankAccounts as g } from "./index5.js";
29
+ import { useApprovalPolicyCardView as ne } from "./index15.js";
30
+ import { resolveApprovalNotices as re } from "./index17.js";
31
+ import { useBillRejectionNotice as ie } from "./index20.js";
32
+ import { useCurrentApprovalRequestId as ae } from "./index21.js";
33
+ import { usePayableAuditHistory as oe } from "./index22.js";
34
+ import { usePayableDetailActions as se } from "./index23.js";
35
+ import { useScheduledDateLabel as ce } from "./index24.js";
36
+ import { useScheduledPayment as le } from "./index25.js";
37
+ import { BILL_DETAILS_LABELS_EN as _ } from "./index46.js";
38
+ import { useMemo as v, useRef as ue, useState as de } from "react";
39
+ import { Fragment as fe, jsx as y, jsxs as b } from "react/jsx-runtime";
8
40
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js
9
- var d = {
10
- subtitle: "Accounts payable",
11
- vendorRow: "Vendor",
12
- bankAccountRow: "ACH bank account",
13
- bankAccountValue: (e) => `Account ending in ${e}`,
14
- ...r,
15
- invoiceNumberRow: "Number",
16
- issueDateRow: "Issue date",
17
- dueDateRow: "Due date",
18
- poNumberRow: "PO number",
19
- notProvided: "Not provided",
20
- glCodeMissing: "GL code not specified",
21
- quantityValue: (e, t) => `${e} x ${t}`,
22
- quantityOnlyValue: (e) => e,
23
- subtotalRow: "Subtotal",
24
- discountsRow: "Discounts",
25
- taxRow: "Tax",
26
- totalRow: "Total",
27
- actionError: n.actionError,
28
- actionSuccess: n.actionSuccess,
29
- scheduledRelativeDay: i,
30
- dueDate: s,
31
- scheduledSummary: o,
32
- scheduledStatusBadge: a,
33
- awaitingApprovalNotice: e,
34
- awaitingApprovalUnknownNotice: t,
35
- paidOnLabel: (e) => `Paid on ${e}`,
36
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
37
- rejectedOn: (e) => `Rejected on ${e}`,
38
- rejectionMessage: (e) => `"${e}"`,
39
- sheet: u,
40
- history: l,
41
- decisionDialog: n.decisionDialog,
42
- approvalPolicyCopy: c
43
- };
44
- export { d as BILL_DETAILS_LABELS_EN };
41
+ function x({ open: x, onOpenChange: S, payableId: C, onClose: w, onExpand: T, onEdit: E, testId: D, labels: O, renderPaymentFlows: k }) {
42
+ let A = v(() => ({
43
+ ..._,
44
+ ...O,
45
+ sheet: {
46
+ ..._.sheet,
47
+ ...O?.sheet,
48
+ statusBadge: {
49
+ ..._.sheet.statusBadge,
50
+ ...O?.sheet?.statusBadge
51
+ },
52
+ approvalPolicy: {
53
+ ..._.sheet.approvalPolicy,
54
+ ...O?.sheet?.approvalPolicy
55
+ },
56
+ auditHistory: {
57
+ ..._.sheet.auditHistory,
58
+ ...O?.sheet?.auditHistory
59
+ }
60
+ },
61
+ decisionDialog: i(_.decisionDialog, O?.decisionDialog),
62
+ approvalPolicyCopy: {
63
+ ..._.approvalPolicyCopy,
64
+ ...O?.approvalPolicyCopy
65
+ },
66
+ history: {
67
+ ..._.history,
68
+ ...O?.history
69
+ },
70
+ scheduledRelativeDay: {
71
+ ..._.scheduledRelativeDay,
72
+ ...O?.scheduledRelativeDay
73
+ },
74
+ dueDate: {
75
+ ..._.dueDate,
76
+ ...O?.dueDate
77
+ },
78
+ actionSuccess: {
79
+ ..._.actionSuccess,
80
+ ...O?.actionSuccess
81
+ },
82
+ paymentHistoryMethodLabels: a(O?.paymentHistoryMethodLabels)
83
+ }), [O]), j = p(C, { pollWhilePolicyAssignmentUnsettled: !0 }), M = f(C), N = ee(), { initResponse: P } = te(), F = j.data, I = ue(null), [L, R] = de(!1), z = ae({
84
+ payableId: C,
85
+ status: F?.status
86
+ }), B = F?.status === "rejected", V = e(P?.scopes, [t.ApprovalRequestReadOrg]), pe = B && V, H = e(P?.scopes, [t.UserReadOrg]), { userNames: U, isError: me, isResolving: he } = n({ enabled: H }), W = ie({
87
+ payableId: C,
88
+ payableStatus: F?.status,
89
+ payableUpdatedAt: F?.updated_at,
90
+ enabled: pe,
91
+ userNames: U,
92
+ labels: A
93
+ }), G = ne({
94
+ payableId: C,
95
+ approvalPolicyId: F?.approval_policy_id,
96
+ status: F?.status,
97
+ updatedAt: F?.updated_at,
98
+ payableFetchedAt: j.dataUpdatedAt,
99
+ copy: A.approvalPolicyCopy
100
+ }), ge = h({
101
+ status: F?.status,
102
+ scopes: P?.scopes,
103
+ arePendingApproversUnknown: G.isLoading,
104
+ hasApprovalPolicy: !!F?.approval_policy_id,
105
+ hasWaitingRequest: z.hasWaitingRequest
106
+ }), K = re({
107
+ isCapabilityUnknown: z.isLoading || G.isLoading,
108
+ canApproveNow: !!z.id,
109
+ canOverridePolicy: ge,
110
+ status: F?.status,
111
+ hasApprovalPolicy: !!F?.approval_policy_id,
112
+ pendingApproverNames: G.pendingApprovers.flatMap((e) => e.names),
113
+ labels: A
114
+ }), q = le({
115
+ payableId: C,
116
+ scheduledPaymentDate: F?.scheduled_payment_date
117
+ }), J = g(P?.scopes), Y = c({
118
+ counterpartId: F?.counterpart_id,
119
+ currency: F?.currency,
120
+ currentBankAccountId: F?.counterpart_bank_account_id,
121
+ enabled: J
122
+ }), { actions: _e, decisionDialog: ve } = se({
123
+ payableId: F ? C : void 0,
124
+ status: F?.status,
125
+ currentApprovalRequestId: z.id,
126
+ hasScheduledPayment: q.hasScheduledPayment,
127
+ scheduledPaymentIntentId: q.scheduledPaymentIntentId,
128
+ isScheduledPaymentUnknown: q.isResolving,
129
+ isPayabilityUnknown: Y.isLoading,
130
+ hasApprovalPolicy: !!F?.approval_policy_id,
131
+ hasWaitingRequest: z.hasWaitingRequest,
132
+ pendingApprovers: G.pendingApprovers,
133
+ arePendingApproversUnknown: G.isLoading,
134
+ labels: {
135
+ edit: A.sheet.editButton,
136
+ payBill: A.sheet.payButton,
137
+ markAsPaid: A.sheet.markAsPaidButton,
138
+ reject: A.sheet.rejectButton,
139
+ approve: A.sheet.approveButton,
140
+ cancel: A.sheet.cancelButton,
141
+ cancelScheduledPayment: A.sheet.cancelScheduledPaymentButton,
142
+ reopen: A.sheet.reopenButton,
143
+ forceApprove: A.sheet.forceApproveButton,
144
+ forceReject: A.sheet.forceRejectButton,
145
+ policyOverridesHeading: A.sheet.policyOverridesGroup,
146
+ decisionDialog: A.decisionDialog,
147
+ actionError: A.actionError,
148
+ actionSuccess: A.actionSuccess
149
+ },
150
+ isMarkAsPaidPending: L,
151
+ onMarkAsPaidSelect: () => I.current?.openMarkAsPaid(),
152
+ onPayBillSelect: () => I.current?.openPayBill(),
153
+ onEditSelect: E,
154
+ onActionSucceeded: (e) => {
155
+ e === "reopen" && E?.();
156
+ }
157
+ }), X = ce({
158
+ hasScheduledPayment: q.hasScheduledPayment,
159
+ scheduledDate: q.scheduledDate,
160
+ labels: A.scheduledRelativeDay
161
+ }), ye = X ? A.scheduledSummary(X.label) : void 0, be = o(F) ? /* @__PURE__ */ y(d, { onOpenFullScreen: T }) : void 0, { historyQuery: Z, rows: xe, namesError: Q } = oe({
162
+ payableId: C,
163
+ userNames: U,
164
+ isRosterError: H && me,
165
+ labels: A.history
166
+ }), Se = v(() => m({
167
+ records: q.paymentRecords,
168
+ events: Z.data?.data ?? [],
169
+ currencyCode: F?.currency,
170
+ labels: A
171
+ }), [
172
+ q.paymentRecords,
173
+ Z.data,
174
+ F?.currency,
175
+ A
176
+ ]), $ = r(), Ce = v(() => F ? l({
177
+ payable: F,
178
+ lineItems: M.lineItems,
179
+ ledgerAccounts: N.data?.data ?? [],
180
+ labels: A,
181
+ hasScheduledPayment: q.hasScheduledPayment,
182
+ today: $,
183
+ rejection: W,
184
+ achInstructions: Y.achInstructions,
185
+ achInstructionsReadable: J && !Y.isLoading && !Y.isError
186
+ }) : void 0, [
187
+ F,
188
+ M.lineItems,
189
+ N.data,
190
+ A,
191
+ q.hasScheduledPayment,
192
+ $,
193
+ W,
194
+ Y.achInstructions,
195
+ Y.isError,
196
+ Y.isLoading,
197
+ J
198
+ ]), we = j.isLoading || M.isResolving || N.isResolving || Y.isLoading, Te = j.isError || M.isError || N.isError;
199
+ return /* @__PURE__ */ b(fe, { children: [
200
+ /* @__PURE__ */ y(u, {
201
+ open: x,
202
+ onOpenChange: S,
203
+ details: Ce,
204
+ actions: _e,
205
+ approvalPolicy: G.view,
206
+ showApprovalOverrideNotice: K.showApprovalOverrideNotice,
207
+ awaitingApprovalNotice: K.awaitingApprovalNotice,
208
+ scheduledSummary: ye,
209
+ scheduledSummaryDate: X?.absoluteLabel,
210
+ auditHistory: xe,
211
+ auditHistoryError: Z.isError,
212
+ auditHistoryLoading: Z.isLoading || he,
213
+ auditHistoryNamesError: Q,
214
+ paymentHistory: Se,
215
+ paymentHistoryError: q.isError || Z.isError,
216
+ paymentHistoryLoading: q.isResolving || Z.isLoading,
217
+ isLoading: we,
218
+ isError: Te,
219
+ notice: be,
220
+ onClose: w,
221
+ onExpand: T,
222
+ testId: D,
223
+ labels: A.sheet
224
+ }),
225
+ /* @__PURE__ */ y(s, {
226
+ ...ve,
227
+ labels: { cancelButton: A.decisionDialog.cancelButton },
228
+ testId: D ? `${D}-decision-dialog` : void 0,
229
+ confirmTestId: D ? `${D}-decision-confirm` : void 0,
230
+ reasonTestId: D ? `${D}-decision-reason` : void 0,
231
+ reasonFieldId: D ? `${D}-decision-reason-field` : void 0
232
+ }),
233
+ k?.({
234
+ ref: I,
235
+ payable: F,
236
+ payableId: C,
237
+ isPayBillEnabled: !0,
238
+ hasScheduledPayment: q.hasScheduledPayment,
239
+ onMissingAchInstructions: T,
240
+ onMarkAsPaidPendingChange: R,
241
+ testId: D
242
+ })
243
+ ] });
244
+ }
245
+ export { x as BillDetailsContainer, x as default };
@@ -1,245 +1,3 @@
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 n } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
11
- import { useLocalCalendarDay as r } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
12
- import "../../../../shared/feature/dist/index.js";
13
- import { mergeDecisionDialogCopy as i, mergePaymentHistoryMethodLabels as a } from "../../../util/dist/lib/billDetailLabels.js";
14
- import { hasSuspectedPayableDuplicate as o } from "../../../util/dist/lib/payableDuplicates.js";
15
- import "../../../util/dist/index.js";
16
- import { BillDecisionDialog as s } from "../../../ui/dist/index4.js";
17
- import "../../../ui/dist/index.js";
18
- import { usePayableAchInstructions as c } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
19
- import "../../../../shared/counterpart-management/feature/dist/index.js";
20
- import { mapPayableToBillDetails as l } from "./index27.js";
21
- import { BillDetailsSheet as u } from "../../ui/dist/index34.js";
22
- import { BillDuplicateNotice as d } from "../../ui/dist/index37.js";
23
- import "../../ui/dist/index.js";
24
- import { useAllPayableLineItemsQuery as f } from "../../data-access/dist/index6.js";
25
- import { usePayableQuery as p } from "../../data-access/dist/index24.js";
26
- import "../../data-access/dist/index.js";
27
- import { buildPaymentHistory as m } from "./index2.js";
28
- import { canOverrideApprovalPolicy as h, canReadCounterpartBankAccounts as g } from "./index5.js";
29
- import { useApprovalPolicyCardView as ne } from "./index15.js";
30
- import { resolveApprovalNotices as re } from "./index17.js";
31
- import { useBillRejectionNotice as ie } from "./index20.js";
32
- import { useCurrentApprovalRequestId as ae } from "./index21.js";
33
- import { usePayableAuditHistory as oe } from "./index22.js";
34
- import { usePayableDetailActions as se } from "./index23.js";
35
- import { useScheduledDateLabel as ce } from "./index24.js";
36
- import { useScheduledPayment as le } from "./index25.js";
37
- import { BILL_DETAILS_LABELS_EN as _ } from "./index47.js";
38
- import { useMemo as v, useRef as ue, useState as de } from "react";
39
- import { Fragment as fe, jsx as y, jsxs as b } from "react/jsx-runtime";
40
- // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js
41
- function x({ open: x, onOpenChange: S, payableId: C, onClose: w, onExpand: T, onEdit: E, testId: D, labels: O, renderPaymentFlows: k }) {
42
- let A = v(() => ({
43
- ..._,
44
- ...O,
45
- sheet: {
46
- ..._.sheet,
47
- ...O?.sheet,
48
- statusBadge: {
49
- ..._.sheet.statusBadge,
50
- ...O?.sheet?.statusBadge
51
- },
52
- approvalPolicy: {
53
- ..._.sheet.approvalPolicy,
54
- ...O?.sheet?.approvalPolicy
55
- },
56
- auditHistory: {
57
- ..._.sheet.auditHistory,
58
- ...O?.sheet?.auditHistory
59
- }
60
- },
61
- decisionDialog: i(_.decisionDialog, O?.decisionDialog),
62
- approvalPolicyCopy: {
63
- ..._.approvalPolicyCopy,
64
- ...O?.approvalPolicyCopy
65
- },
66
- history: {
67
- ..._.history,
68
- ...O?.history
69
- },
70
- scheduledRelativeDay: {
71
- ..._.scheduledRelativeDay,
72
- ...O?.scheduledRelativeDay
73
- },
74
- dueDate: {
75
- ..._.dueDate,
76
- ...O?.dueDate
77
- },
78
- actionSuccess: {
79
- ..._.actionSuccess,
80
- ...O?.actionSuccess
81
- },
82
- paymentHistoryMethodLabels: a(O?.paymentHistoryMethodLabels)
83
- }), [O]), j = p(C, { pollWhilePolicyAssignmentUnsettled: !0 }), M = f(C), N = ee(), { initResponse: P } = te(), F = j.data, I = ue(null), [L, R] = de(!1), z = ae({
84
- payableId: C,
85
- status: F?.status
86
- }), B = F?.status === "rejected", V = e(P?.scopes, [t.ApprovalRequestReadOrg]), pe = B && V, H = e(P?.scopes, [t.UserReadOrg]), { userNames: U, isError: me, isResolving: he } = n({ enabled: H }), W = ie({
87
- payableId: C,
88
- payableStatus: F?.status,
89
- payableUpdatedAt: F?.updated_at,
90
- enabled: pe,
91
- userNames: U,
92
- labels: A
93
- }), G = ne({
94
- payableId: C,
95
- approvalPolicyId: F?.approval_policy_id,
96
- status: F?.status,
97
- updatedAt: F?.updated_at,
98
- payableFetchedAt: j.dataUpdatedAt,
99
- copy: A.approvalPolicyCopy
100
- }), ge = h({
101
- status: F?.status,
102
- scopes: P?.scopes,
103
- arePendingApproversUnknown: G.isLoading,
104
- hasApprovalPolicy: !!F?.approval_policy_id,
105
- hasWaitingRequest: z.hasWaitingRequest
106
- }), K = re({
107
- isCapabilityUnknown: z.isLoading || G.isLoading,
108
- canApproveNow: !!z.id,
109
- canOverridePolicy: ge,
110
- status: F?.status,
111
- hasApprovalPolicy: !!F?.approval_policy_id,
112
- pendingApproverNames: G.pendingApprovers.flatMap((e) => e.names),
113
- labels: A
114
- }), q = le({
115
- payableId: C,
116
- scheduledPaymentDate: F?.scheduled_payment_date
117
- }), J = g(P?.scopes), Y = c({
118
- counterpartId: F?.counterpart_id,
119
- currency: F?.currency,
120
- currentBankAccountId: F?.counterpart_bank_account_id,
121
- enabled: J
122
- }), { actions: _e, decisionDialog: ve } = se({
123
- payableId: F ? C : void 0,
124
- status: F?.status,
125
- currentApprovalRequestId: z.id,
126
- hasScheduledPayment: q.hasScheduledPayment,
127
- scheduledPaymentIntentId: q.scheduledPaymentIntentId,
128
- isScheduledPaymentUnknown: q.isResolving,
129
- isPayabilityUnknown: Y.isLoading,
130
- hasApprovalPolicy: !!F?.approval_policy_id,
131
- hasWaitingRequest: z.hasWaitingRequest,
132
- pendingApprovers: G.pendingApprovers,
133
- arePendingApproversUnknown: G.isLoading,
134
- labels: {
135
- edit: A.sheet.editButton,
136
- payBill: A.sheet.payButton,
137
- markAsPaid: A.sheet.markAsPaidButton,
138
- reject: A.sheet.rejectButton,
139
- approve: A.sheet.approveButton,
140
- cancel: A.sheet.cancelButton,
141
- cancelScheduledPayment: A.sheet.cancelScheduledPaymentButton,
142
- reopen: A.sheet.reopenButton,
143
- forceApprove: A.sheet.forceApproveButton,
144
- forceReject: A.sheet.forceRejectButton,
145
- policyOverridesHeading: A.sheet.policyOverridesGroup,
146
- decisionDialog: A.decisionDialog,
147
- actionError: A.actionError,
148
- actionSuccess: A.actionSuccess
149
- },
150
- isMarkAsPaidPending: L,
151
- onMarkAsPaidSelect: () => I.current?.openMarkAsPaid(),
152
- onPayBillSelect: () => I.current?.openPayBill(),
153
- onEditSelect: E,
154
- onActionSucceeded: (e) => {
155
- e === "reopen" && E?.();
156
- }
157
- }), X = ce({
158
- hasScheduledPayment: q.hasScheduledPayment,
159
- scheduledDate: q.scheduledDate,
160
- labels: A.scheduledRelativeDay
161
- }), ye = X ? A.scheduledSummary(X.label) : void 0, be = o(F) ? /* @__PURE__ */ y(d, { onOpenFullScreen: T }) : void 0, { historyQuery: Z, rows: xe, namesError: Q } = oe({
162
- payableId: C,
163
- userNames: U,
164
- isRosterError: H && me,
165
- labels: A.history
166
- }), Se = v(() => m({
167
- records: q.paymentRecords,
168
- events: Z.data?.data ?? [],
169
- currencyCode: F?.currency,
170
- labels: A
171
- }), [
172
- q.paymentRecords,
173
- Z.data,
174
- F?.currency,
175
- A
176
- ]), $ = r(), Ce = v(() => F ? l({
177
- payable: F,
178
- lineItems: M.lineItems,
179
- ledgerAccounts: N.data?.data ?? [],
180
- labels: A,
181
- hasScheduledPayment: q.hasScheduledPayment,
182
- today: $,
183
- rejection: W,
184
- achInstructions: Y.achInstructions,
185
- achInstructionsReadable: J && !Y.isLoading && !Y.isError
186
- }) : void 0, [
187
- F,
188
- M.lineItems,
189
- N.data,
190
- A,
191
- q.hasScheduledPayment,
192
- $,
193
- W,
194
- Y.achInstructions,
195
- Y.isError,
196
- Y.isLoading,
197
- J
198
- ]), we = j.isLoading || M.isResolving || N.isResolving || Y.isLoading, Te = j.isError || M.isError || N.isError;
199
- return /* @__PURE__ */ b(fe, { children: [
200
- /* @__PURE__ */ y(u, {
201
- open: x,
202
- onOpenChange: S,
203
- details: Ce,
204
- actions: _e,
205
- approvalPolicy: G.view,
206
- showApprovalOverrideNotice: K.showApprovalOverrideNotice,
207
- awaitingApprovalNotice: K.awaitingApprovalNotice,
208
- scheduledSummary: ye,
209
- scheduledSummaryDate: X?.absoluteLabel,
210
- auditHistory: xe,
211
- auditHistoryError: Z.isError,
212
- auditHistoryLoading: Z.isLoading || he,
213
- auditHistoryNamesError: Q,
214
- paymentHistory: Se,
215
- paymentHistoryError: q.isError || Z.isError,
216
- paymentHistoryLoading: q.isResolving || Z.isLoading,
217
- isLoading: we,
218
- isError: Te,
219
- notice: be,
220
- onClose: w,
221
- onExpand: T,
222
- testId: D,
223
- labels: A.sheet
224
- }),
225
- /* @__PURE__ */ y(s, {
226
- ...ve,
227
- labels: { cancelButton: A.decisionDialog.cancelButton },
228
- testId: D ? `${D}-decision-dialog` : void 0,
229
- confirmTestId: D ? `${D}-decision-confirm` : void 0,
230
- reasonTestId: D ? `${D}-decision-reason` : void 0,
231
- reasonFieldId: D ? `${D}-decision-reason-field` : void 0
232
- }),
233
- k?.({
234
- ref: I,
235
- payable: F,
236
- payableId: C,
237
- isPayBillEnabled: !0,
238
- hasScheduledPayment: q.hasScheduledPayment,
239
- onMissingAchInstructions: T,
240
- onMarkAsPaidPendingChange: R,
241
- testId: D
242
- })
243
- ] });
244
- }
245
- export { x as BillDetailsContainer, x as default };
1
+ import "./index27.js";
2
+ import "./index46.js";
3
+ import "./index47.js";
@@ -1,3 +1,5 @@
1
- import "./index27.js";
2
- import "./index47.js";
3
- import "./index48.js";
1
+ import { BILL_PAY_WIDGET_NAME as e } from "../../../util/dist/lib/widgetName.js";
2
+ import "../../../util/dist/index.js";
3
+ // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js
4
+ var t = `${e}.bill_detail`, n = { Mounted: `${t}.mounted` };
5
+ export { n as BillDetailWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,5 +1,64 @@
1
- import { BILL_PAY_WIDGET_NAME as e } from "../../../util/dist/lib/widgetName.js";
2
- import "../../../util/dist/index.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 { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
+ import "../../../../shared/feature/dist/index.js";
8
+ import { BillDialog as n } from "./index44.js";
9
+ import "./index45.js";
10
+ import { BillDetailsContainer as r } from "./index47.js";
11
+ import "./index48.js";
12
+ import { BillDetailWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index49.js";
13
+ import { useEffect as o } from "react";
14
+ import { jsx as s } from "react/jsx-runtime";
3
15
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js
4
- var t = `${e}.bill_detail`, n = { Mounted: `${t}.mounted` };
5
- export { n as BillDetailWidgetAnalyticsEvent, t as WIDGET_NAME };
16
+ function c() {
17
+ let t = e();
18
+ o(() => {
19
+ t(i.Mounted);
20
+ }, [t]);
21
+ }
22
+ function l(e) {
23
+ return c(), /* @__PURE__ */ s(n, { ...e });
24
+ }
25
+ function u(e) {
26
+ return c(), /* @__PURE__ */ s(r, { ...e });
27
+ }
28
+ function d({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, uiFramework: u, errorFallback: d, onError: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
29
+ return /* @__PURE__ */ s(t, {
30
+ widgetName: a,
31
+ baseUrl: e,
32
+ widgetToken: n,
33
+ organizationId: r,
34
+ configClient: i,
35
+ gatewayRouting: o,
36
+ linkComponent: c,
37
+ uiFramework: u,
38
+ errorFallback: d,
39
+ onError: f,
40
+ analytics: p,
41
+ disclosuresAcceptance: m,
42
+ providerLabels: h,
43
+ children: /* @__PURE__ */ s(l, { ...g })
44
+ });
45
+ }
46
+ function f({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, uiFramework: l, errorFallback: d, onError: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
47
+ return /* @__PURE__ */ s(t, {
48
+ widgetName: a,
49
+ baseUrl: e,
50
+ widgetToken: n,
51
+ organizationId: r,
52
+ configClient: i,
53
+ gatewayRouting: o,
54
+ linkComponent: c,
55
+ uiFramework: l,
56
+ errorFallback: d,
57
+ onError: f,
58
+ analytics: p,
59
+ disclosuresAcceptance: m,
60
+ providerLabels: h,
61
+ children: /* @__PURE__ */ s(u, { ...g })
62
+ });
63
+ }
64
+ export { f as BillDetailsWidget, d as BillDialogWidget };
@@ -1,64 +1 @@
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 { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
- import "../../../../shared/feature/dist/index.js";
8
- import { BillDialog as n } from "./index45.js";
9
- import "./index46.js";
10
- import { BillDetailsContainer as r } from "./index48.js";
11
- import "./index49.js";
12
- import { BillDetailWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index50.js";
13
- import { useEffect as o } from "react";
14
- import { jsx as s } from "react/jsx-runtime";
15
- // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js
16
- function c() {
17
- let t = e();
18
- o(() => {
19
- t(i.Mounted);
20
- }, [t]);
21
- }
22
- function l(e) {
23
- return c(), /* @__PURE__ */ s(n, { ...e });
24
- }
25
- function u(e) {
26
- return c(), /* @__PURE__ */ s(r, { ...e });
27
- }
28
- function d({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, uiFramework: u, errorFallback: d, onError: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
29
- return /* @__PURE__ */ s(t, {
30
- widgetName: a,
31
- baseUrl: e,
32
- widgetToken: n,
33
- organizationId: r,
34
- configClient: i,
35
- gatewayRouting: o,
36
- linkComponent: c,
37
- uiFramework: u,
38
- errorFallback: d,
39
- onError: f,
40
- analytics: p,
41
- disclosuresAcceptance: m,
42
- providerLabels: h,
43
- children: /* @__PURE__ */ s(l, { ...g })
44
- });
45
- }
46
- function f({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, uiFramework: l, errorFallback: d, onError: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
47
- return /* @__PURE__ */ s(t, {
48
- widgetName: a,
49
- baseUrl: e,
50
- widgetToken: n,
51
- organizationId: r,
52
- configClient: i,
53
- gatewayRouting: o,
54
- linkComponent: c,
55
- uiFramework: l,
56
- errorFallback: d,
57
- onError: f,
58
- analytics: p,
59
- disclosuresAcceptance: m,
60
- providerLabels: h,
61
- children: /* @__PURE__ */ s(u, { ...g })
62
- });
63
- }
64
- export { f as BillDetailsWidget, d as BillDialogWidget };
1
+ import "./index50.js";