@tesouro/embedded-components-react 0.3.63 → 0.4.1

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 (82) hide show
  1. package/README.md +1 -70
  2. package/dist/index.d.ts +67 -832
  3. package/dist/index.js +18 -34
  4. package/dist/lib/BillPayWidget.js +1 -1
  5. package/dist/lib/SettingsWidget.d.ts +53 -7
  6. package/dist/lib/SettingsWidget.js +4 -2
  7. package/dist/lib/WidgetSuite.d.ts +38 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +8 -14
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +7 -57
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +56 -16
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +18 -126
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +126 -14
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +22 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +4 -41
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +40 -4
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +5 -73
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +72 -48
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -91
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +91 -33
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +33 -167
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +167 -75
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +75 -21
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +23 -210
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +199 -203
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +198 -89
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +105 -13
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +12 -47
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +47 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +27 -198
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +198 -30
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +30 -234
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +240 -18
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +18 -341
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +343 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +4 -33
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +31 -83
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +78 -163
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +170 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +3 -4
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +2 -44
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +46 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +1 -8
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -9
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +9 -92
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +94 -3
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +3 -128
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +125 -8
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -7
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -46
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +43 -18
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +20 -28
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +27 -82
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +83 -47
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +47 -250
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +239 -101
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +107 -202
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +209 -3
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +4 -8
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +6 -113
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +115 -1
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +0 -24
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +25 -0
  64. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index.js +3 -3
  65. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/ui/dist/index.js +5 -5
  66. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index.js +4 -2
  67. package/dist/libs/tesouro-embedded-components-react/help-widget/ui/shadcn/dist/index.js +4 -4
  68. package/dist/libs/tesouro-embedded-components-react/help-widget/ui/shadcn/dist/index4.js +2 -3
  69. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +35 -32
  70. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  71. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/lib/ChartOfAccountsWidget.d.ts +0 -958
  74. package/dist/lib/ChartOfAccountsWidget.js +0 -9
  75. package/dist/lib/HelpWidget.d.ts +0 -739
  76. package/dist/lib/HelpWidget.js +0 -6
  77. package/dist/lib/ProfileWidget.d.ts +0 -672
  78. package/dist/lib/ProfileWidget.js +0 -3
  79. package/dist/lib/TagsWidget.d.ts +0 -719
  80. package/dist/lib/TagsWidget.js +0 -3
  81. package/dist/lib/TeamWidget.d.ts +0 -878
  82. package/dist/lib/TeamWidget.js +0 -3
@@ -1,170 +1,85 @@
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 n } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import "../../../shared/feature/dist/index.js";
11
- import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
12
- import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
- import "../../data-access/dist/index.js";
14
- import { BillDecisionDialog as o } from "../../ui/dist/index51.js";
15
- import { BillDetailsSheet as s } from "../../ui/dist/index57.js";
16
- import { BillDuplicateNotice as c } from "../../ui/dist/index61.js";
17
- import { MarkAsPaidDialog as l } from "../../ui/dist/index88.js";
18
- import "../../ui/dist/index.js";
19
- import { usePayableDuplicateReview as u } from "./index10.js";
20
- import "./index11.js";
21
- import { resolveAmountDueMinorUnits as d } from "./index17.js";
22
- import { PayBillFlow as f } from "./index23.js";
23
- import "./index24.js";
24
- import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
25
- import { useMarkAsPaidFlow as m } from "./index14.js";
26
- import "./index15.js";
27
- import { mergeDecisionDialogCopy as h } from "./index38.js";
28
- import { useApprovalPolicyCardView as g } from "./index29.js";
29
- import { useCurrentApprovalRequestId as _ } from "./index30.js";
30
- import { usePayableDetailActions as v } from "./index31.js";
31
- import { useScheduledPayment as y } from "./index32.js";
32
- import { BILL_DETAILS_LABELS_EN as b } from "./index55.js";
33
- import { mapPayableToBillDetails as x } from "./index56.js";
34
- import { useMemo as S, useRef as C } from "react";
35
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { derivePayableStatus as t } from "./index4.js";
3
+ import { resolveVendor as n, resolveVendorName as r } from "./index5.js";
4
+ import { formatBillMoney as i } from "./index36.js";
36
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
37
- function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, testId: M, labels: N, poweredByBankName: P }) {
38
- let F = S(() => ({
39
- ...b,
40
- ...N,
41
- sheet: {
42
- ...b.sheet,
43
- ...N?.sheet,
44
- statusBadge: {
45
- ...b.sheet.statusBadge,
46
- ...N?.sheet?.statusBadge
47
- },
48
- approvalPolicy: {
49
- ...b.sheet.approvalPolicy,
50
- ...N?.sheet?.approvalPolicy
51
- },
52
- dueDate: {
53
- ...b.sheet.dueDate,
54
- ...N?.sheet?.dueDate
55
- }
6
+ function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c, hasScheduledPayment: l, now: u }) {
7
+ let d = a.currency, f = (e) => i(e, d), p = t({
8
+ apiStatus: a.status,
9
+ dueDate: a.due_date,
10
+ scheduledPaymentDate: a.scheduled_payment_date,
11
+ hasScheduledPayment: l,
12
+ now: u
13
+ }), m = n(a), h = r(a), g = e(a.issued_at) || c.notProvided, _ = e(a.due_date) || c.notProvided, v = [{
14
+ label: c.vendorRow,
15
+ value: h || c.notProvided,
16
+ secondaryValue: m?.email ?? void 0
17
+ }], y = m?.bank_account?.account_number;
18
+ y && v.push({
19
+ label: c.bankAccountRow,
20
+ value: c.bankAccountValue(y.slice(-4))
21
+ });
22
+ let b = [
23
+ {
24
+ label: c.invoiceNumberRow,
25
+ value: a.document_id || c.notProvided
56
26
  },
57
- decisionDialog: h(b.decisionDialog, N?.decisionDialog),
58
- approvalPolicyCopy: {
59
- ...b.approvalPolicyCopy,
60
- ...N?.approvalPolicyCopy
27
+ {
28
+ label: c.issueDateRow,
29
+ value: g
61
30
  },
62
- markAsPaid: p(N?.markAsPaid),
63
- actionSuccess: {
64
- ...b.actionSuccess,
65
- ...N?.actionSuccess
31
+ {
32
+ label: c.dueDateRow,
33
+ value: _
34
+ },
35
+ {
36
+ label: c.poNumberRow,
37
+ value: c.notProvided
66
38
  }
67
- }), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = _({
68
- payableId: k,
69
- status: z?.status
70
- }), H = g({
71
- payableId: k,
72
- approvalPolicyId: z?.approval_policy_id,
73
- copy: F.approvalPolicyCopy
74
- }), U = y({
75
- payableId: k,
76
- scheduledPaymentDate: z?.scheduled_payment_date
77
- }), W = m({
78
- payableId: k,
79
- amountDueMinorUnits: d(z) ?? 0,
80
- amountToPayMinorUnits: z?.amount_to_pay ?? void 0,
81
- currencyCode: z?.currency ?? void 0,
82
- dueDate: z?.due_date,
83
- hasScheduledPayment: U.hasScheduledPayment,
84
- testId: M,
85
- labels: F.markAsPaid
86
- }), { actions: G, decisionDialog: K } = v({
87
- payableId: z ? k : void 0,
88
- status: z?.status,
89
- currentApprovalRequestId: V.id,
90
- isPolicyApprover: V.isPolicyApprover,
91
- hasWaitingRequest: V.hasWaitingRequest,
92
- hasScheduledPayment: U.hasScheduledPayment,
93
- scheduledPaymentIntentId: U.scheduledPaymentIntentId,
94
- isScheduledPaymentUnknown: U.isResolving,
95
- pendingApprovers: H.pendingApprovers,
96
- arePendingApproversUnknown: H.isLoading,
97
- labels: {
98
- payBill: F.sheet.payButton,
99
- markAsPaid: F.sheet.markAsPaidButton,
100
- reject: F.sheet.rejectButton,
101
- approve: F.sheet.approveButton,
102
- cancel: F.sheet.cancelButton,
103
- cancelScheduledPayment: F.sheet.cancelScheduledPaymentButton,
104
- reopen: F.sheet.reopenButton,
105
- forceApprove: F.sheet.forceApproveButton,
106
- forceReject: F.sheet.forceRejectButton,
107
- policyOverridesHeading: F.sheet.policyOverridesGroup,
108
- decisionDialog: F.decisionDialog,
109
- actionError: F.actionError,
110
- actionSuccess: F.actionSuccess
39
+ ], x = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" ")])), S = o.map((e) => {
40
+ let t = f(e.unit_price);
41
+ return {
42
+ id: e.id,
43
+ description: e.name ?? e.description ?? "",
44
+ glCodeLabel: (e.ledger_account_id ? x.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
45
+ quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
46
+ amountLabel: f(e.subtotal) ?? ""
47
+ };
48
+ }), C = [
49
+ {
50
+ label: c.subtotalRow,
51
+ value: a.subtotal
52
+ },
53
+ {
54
+ label: c.discountsRow,
55
+ value: a.discount
111
56
  },
112
- isMarkAsPaidPending: W.isPending,
113
- onMarkAsPaidSelect: W.open,
114
- onPayBillSelect: () => B.current?.open()
115
- }), q = U.hasScheduledPayment && U.scheduledDateLabel ? /* @__PURE__ */ T("p", {
116
- className: "ttw:text-sm ttw:text-muted-foreground",
117
- children: F.scheduledSummary(U.scheduledDateLabel)
118
- }) : void 0, { initResponse: J } = r(), Y = u({
119
- payable: z,
120
- canManage: e(J?.scopes, [t.PayableWriteOrg])
121
- }), X = Y.isPossibleDuplicate ? /* @__PURE__ */ T(c, {
122
- onNotADuplicate: Y.onNotADuplicate,
123
- isActionDisabled: Y.isBusy
124
- }) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? x({
125
- payable: z,
126
- lineItems: L.lineItems,
127
- ledgerAccounts: R.data?.data ?? [],
128
- labels: F,
129
- hasScheduledPayment: U.hasScheduledPayment
130
- }) : void 0, [
131
- z,
132
- L.lineItems,
133
- R.data,
134
- F,
135
- U.hasScheduledPayment
136
- ]), $ = I.isLoading || L.isResolving || R.isResolving, ee = I.isError || L.isError || R.isError;
137
- return /* @__PURE__ */ E(w, { children: [
138
- /* @__PURE__ */ T(s, {
139
- open: D,
140
- onOpenChange: O,
141
- details: Q,
142
- actions: G,
143
- approvalPolicy: H.view,
144
- isLoading: $,
145
- isError: ee,
146
- notice: Z,
147
- onClose: A,
148
- onExpand: j,
149
- testId: M,
150
- labels: F.sheet
151
- }),
152
- /* @__PURE__ */ T(o, {
153
- ...K,
154
- labels: { cancelButton: F.decisionDialog.cancelButton },
155
- testId: M ? `${M}-decision-dialog` : void 0,
156
- confirmTestId: M ? `${M}-decision-confirm` : void 0,
157
- reasonTestId: M ? `${M}-decision-reason` : void 0,
158
- reasonFieldId: M ? `${M}-decision-reason-field` : void 0
159
- }),
160
- /* @__PURE__ */ T(l, { ...W.dialogProps }),
161
- z ? /* @__PURE__ */ T(f, {
162
- ref: B,
163
- payable: z,
164
- onMissingAchInstructions: j,
165
- poweredByBankName: P
166
- }) : null
167
- ] });
57
+ {
58
+ label: c.taxRow,
59
+ value: a.tax_amount
60
+ }
61
+ ].map(({ label: e, value: t }) => ({
62
+ label: e,
63
+ value: f(t)
64
+ })).filter((e) => !!e.value), w = f(a.total_amount);
65
+ return w && C.push({
66
+ label: c.totalRow,
67
+ value: w,
68
+ emphasis: !0
69
+ }), {
70
+ title: h,
71
+ subtitle: c.subtitle,
72
+ status: p.status,
73
+ statusTone: p.tone,
74
+ amountDueLabel: f(a.amount_due) ?? f(a.total_amount) ?? "",
75
+ invoiceDateLabel: g,
76
+ dueDateLabel: _,
77
+ dueDateTone: p.isOverdue ? "danger" : "default",
78
+ payToItems: v,
79
+ invoiceItems: b,
80
+ lineItems: S,
81
+ totals: C
82
+ };
168
83
  }
169
84
  //#endregion
170
- export { D as BillDetailsContainer, D as default };
85
+ export { a as mapPayableToBillDetails };
@@ -1,3 +1,170 @@
1
- import "./index55.js";
2
- import "./index56.js";
3
- import "./index57.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 n } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
12
+ import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { BillDecisionDialog as o } from "../../ui/dist/index51.js";
15
+ import { BillDetailsSheet as s } from "../../ui/dist/index57.js";
16
+ import { BillDuplicateNotice as c } from "../../ui/dist/index61.js";
17
+ import { MarkAsPaidDialog as l } from "../../ui/dist/index88.js";
18
+ import "../../ui/dist/index.js";
19
+ import { usePayableDuplicateReview as u } from "./index10.js";
20
+ import "./index11.js";
21
+ import { resolveAmountDueMinorUnits as d } from "./index17.js";
22
+ import { PayBillFlow as f } from "./index23.js";
23
+ import "./index24.js";
24
+ import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
25
+ import { useMarkAsPaidFlow as m } from "./index14.js";
26
+ import "./index15.js";
27
+ import { mergeDecisionDialogCopy as h } from "./index39.js";
28
+ import { useApprovalPolicyCardView as g } from "./index30.js";
29
+ import { useCurrentApprovalRequestId as _ } from "./index31.js";
30
+ import { usePayableDetailActions as v } from "./index32.js";
31
+ import { useScheduledPayment as y } from "./index33.js";
32
+ import { BILL_DETAILS_LABELS_EN as b } from "./index56.js";
33
+ import { mapPayableToBillDetails as x } from "./index57.js";
34
+ import { useMemo as S, useRef as C } from "react";
35
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
36
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
37
+ function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, testId: M, labels: N, poweredByBankName: P }) {
38
+ let F = S(() => ({
39
+ ...b,
40
+ ...N,
41
+ sheet: {
42
+ ...b.sheet,
43
+ ...N?.sheet,
44
+ statusBadge: {
45
+ ...b.sheet.statusBadge,
46
+ ...N?.sheet?.statusBadge
47
+ },
48
+ approvalPolicy: {
49
+ ...b.sheet.approvalPolicy,
50
+ ...N?.sheet?.approvalPolicy
51
+ },
52
+ dueDate: {
53
+ ...b.sheet.dueDate,
54
+ ...N?.sheet?.dueDate
55
+ }
56
+ },
57
+ decisionDialog: h(b.decisionDialog, N?.decisionDialog),
58
+ approvalPolicyCopy: {
59
+ ...b.approvalPolicyCopy,
60
+ ...N?.approvalPolicyCopy
61
+ },
62
+ markAsPaid: p(N?.markAsPaid),
63
+ actionSuccess: {
64
+ ...b.actionSuccess,
65
+ ...N?.actionSuccess
66
+ }
67
+ }), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = _({
68
+ payableId: k,
69
+ status: z?.status
70
+ }), H = g({
71
+ payableId: k,
72
+ approvalPolicyId: z?.approval_policy_id,
73
+ copy: F.approvalPolicyCopy
74
+ }), U = y({
75
+ payableId: k,
76
+ scheduledPaymentDate: z?.scheduled_payment_date
77
+ }), W = m({
78
+ payableId: k,
79
+ amountDueMinorUnits: d(z) ?? 0,
80
+ amountToPayMinorUnits: z?.amount_to_pay ?? void 0,
81
+ currencyCode: z?.currency ?? void 0,
82
+ dueDate: z?.due_date,
83
+ hasScheduledPayment: U.hasScheduledPayment,
84
+ testId: M,
85
+ labels: F.markAsPaid
86
+ }), { actions: G, decisionDialog: K } = v({
87
+ payableId: z ? k : void 0,
88
+ status: z?.status,
89
+ currentApprovalRequestId: V.id,
90
+ isPolicyApprover: V.isPolicyApprover,
91
+ hasWaitingRequest: V.hasWaitingRequest,
92
+ hasScheduledPayment: U.hasScheduledPayment,
93
+ scheduledPaymentIntentId: U.scheduledPaymentIntentId,
94
+ isScheduledPaymentUnknown: U.isResolving,
95
+ pendingApprovers: H.pendingApprovers,
96
+ arePendingApproversUnknown: H.isLoading,
97
+ labels: {
98
+ payBill: F.sheet.payButton,
99
+ markAsPaid: F.sheet.markAsPaidButton,
100
+ reject: F.sheet.rejectButton,
101
+ approve: F.sheet.approveButton,
102
+ cancel: F.sheet.cancelButton,
103
+ cancelScheduledPayment: F.sheet.cancelScheduledPaymentButton,
104
+ reopen: F.sheet.reopenButton,
105
+ forceApprove: F.sheet.forceApproveButton,
106
+ forceReject: F.sheet.forceRejectButton,
107
+ policyOverridesHeading: F.sheet.policyOverridesGroup,
108
+ decisionDialog: F.decisionDialog,
109
+ actionError: F.actionError,
110
+ actionSuccess: F.actionSuccess
111
+ },
112
+ isMarkAsPaidPending: W.isPending,
113
+ onMarkAsPaidSelect: W.open,
114
+ onPayBillSelect: () => B.current?.open()
115
+ }), q = U.hasScheduledPayment && U.scheduledDateLabel ? /* @__PURE__ */ T("p", {
116
+ className: "ttw:text-sm ttw:text-muted-foreground",
117
+ children: F.scheduledSummary(U.scheduledDateLabel)
118
+ }) : void 0, { initResponse: J } = r(), Y = u({
119
+ payable: z,
120
+ canManage: e(J?.scopes, [t.PayableWriteOrg])
121
+ }), X = Y.isPossibleDuplicate ? /* @__PURE__ */ T(c, {
122
+ onNotADuplicate: Y.onNotADuplicate,
123
+ isActionDisabled: Y.isBusy
124
+ }) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? x({
125
+ payable: z,
126
+ lineItems: L.lineItems,
127
+ ledgerAccounts: R.data?.data ?? [],
128
+ labels: F,
129
+ hasScheduledPayment: U.hasScheduledPayment
130
+ }) : void 0, [
131
+ z,
132
+ L.lineItems,
133
+ R.data,
134
+ F,
135
+ U.hasScheduledPayment
136
+ ]), $ = I.isLoading || L.isResolving || R.isResolving, ee = I.isError || L.isError || R.isError;
137
+ return /* @__PURE__ */ E(w, { children: [
138
+ /* @__PURE__ */ T(s, {
139
+ open: D,
140
+ onOpenChange: O,
141
+ details: Q,
142
+ actions: G,
143
+ approvalPolicy: H.view,
144
+ isLoading: $,
145
+ isError: ee,
146
+ notice: Z,
147
+ onClose: A,
148
+ onExpand: j,
149
+ testId: M,
150
+ labels: F.sheet
151
+ }),
152
+ /* @__PURE__ */ T(o, {
153
+ ...K,
154
+ labels: { cancelButton: F.decisionDialog.cancelButton },
155
+ testId: M ? `${M}-decision-dialog` : void 0,
156
+ confirmTestId: M ? `${M}-decision-confirm` : void 0,
157
+ reasonTestId: M ? `${M}-decision-reason` : void 0,
158
+ reasonFieldId: M ? `${M}-decision-reason-field` : void 0
159
+ }),
160
+ /* @__PURE__ */ T(l, { ...W.dialogProps }),
161
+ z ? /* @__PURE__ */ T(f, {
162
+ ref: B,
163
+ payable: z,
164
+ onMissingAchInstructions: j,
165
+ poweredByBankName: P
166
+ }) : null
167
+ ] });
168
+ }
169
+ //#endregion
170
+ export { D as BillDetailsContainer, D as default };
@@ -1,4 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.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 "./index56.js";
2
+ import "./index57.js";
3
+ import "./index58.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 "./index59.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index444.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/index60.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 "./index60.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 "./index60.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index444.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/index61.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/index62.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
7
- //#endregion
8
- export { e as billPayUploadQueueKey };
1
+ import "./index61.js";
@@ -1,11 +1,8 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.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
- failedCaption: (e) => `${e} failed to upload`,
7
- tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
8
- 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`
9
- };
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
10
7
  //#endregion
11
- export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
8
+ export { e as billPayUploadQueueKey };
@@ -1,94 +1,11 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import "../../../shared/ui/dist/index.js";
8
- import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index12.js";
9
- import { usePayableOcrQueries as r } from "../../data-access/dist/index14.js";
10
- import "../../data-access/dist/index.js";
11
- import { billPayUploadQueueKey as i } from "./index62.js";
12
- import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index63.js";
13
- import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
14
- import { useQuery as u, useQueryClient as d } from "@tanstack/react-query";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
16
- function f({ onOpenBill: f, labels: p } = {}) {
17
- let m = {
18
- ...a,
19
- ...p
20
- }, h = p?.tooManyFilesError ?? a.tooManyFilesError, g = p?.remainingCapacityError ?? a.remainingCapacityError, { organizationId: _ } = t(), v = d(), y = c(() => i(_), [_]), b = n(), [x, S] = l(!1), { data: C = [] } = u({
21
- queryKey: y,
22
- queryFn: () => v.getQueryData(y) ?? [],
23
- staleTime: Infinity,
24
- gcTime: Infinity,
25
- initialData: []
26
- }), w = o((e, t) => {
27
- v.setQueryData(y, (n) => (n ?? []).map((n) => n.localId === e ? {
28
- ...n,
29
- ...t
30
- } : n));
31
- }, [v, y]), T = o((t) => {
32
- let n = (v.getQueryData(y) ?? []).filter((e) => e.status === "uploading").length;
33
- if (t.length + n > 10) {
34
- e.error(n > 0 ? g(10 - n) : h(10));
35
- return;
36
- }
37
- S(!1);
38
- for (let e of t) {
39
- let t = crypto.randomUUID();
40
- v.setQueryData(y, (n) => [...n ?? [], {
41
- localId: t,
42
- fileName: e.name,
43
- status: "uploading"
44
- }]), b.mutateAsync({ file: e }).then((e) => w(t, { payableId: e?.id })).catch(() => w(t, { status: "failed" }));
45
- }
46
- }, [
47
- w,
48
- v,
49
- y,
50
- g,
51
- h,
52
- b
53
- ]), E = r({ payableIds: C.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
54
- s(() => {
55
- for (let { payableId: e, ocrStatus: t, isError: n } of E) {
56
- let r = C.find((t) => t.payableId === e && t.status === "uploading");
57
- r && (t === "success" ? w(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && w(r.localId, { status: "failed" }));
58
- }
59
- }, [
60
- C,
61
- E,
62
- w
63
- ]);
64
- let D = C.filter((e) => e.status === "uploading"), O = C.filter((e) => e.status === "ready"), k = C.filter((e) => e.status === "failed"), A = (e) => ({
65
- id: e.localId,
66
- fileName: e.fileName,
67
- status: e.status,
68
- onOpen: e.status === "ready" && e.payableId && f ? () => f(e.payableId) : void 0
69
- }), j = D.length ? [{
70
- id: "in-progress",
71
- items: C.map(A)
72
- }] : [...O.length ? [{
73
- id: "ready",
74
- caption: m.readyCaption(O.length),
75
- items: O.map(A)
76
- }] : [], ...k.length ? [{
77
- id: "failed",
78
- caption: m.failedCaption(k.length),
79
- items: k.map(A)
80
- }] : []], M = D.length ? m.uploadingSummary(C.length) : O.length ? m.completeSummary(O.length) : m.failedCaption(k.length), N = o(() => {
81
- v.setQueryData(y, []);
82
- }, [v, y]);
83
- return {
84
- enqueue: T,
85
- sections: j,
86
- summaryLabel: M,
87
- collapsed: x,
88
- onToggleCollapsed: o(() => S((e) => !e), []),
89
- onClose: N,
90
- isVisible: C.length > 0
91
- };
92
- }
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
+ failedCaption: (e) => `${e} failed to upload`,
7
+ tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
8
+ 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`
9
+ };
93
10
  //#endregion
94
- export { f as useBillUploadQueue };
11
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };