@tesouro/embedded-components-react 0.5.169 → 0.5.171
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.
- package/dist/index.css +39 -17
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +95 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +37 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +13 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +56 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +4 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +6 -115
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +202 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +84 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -84
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +36 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +167 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +40 -164
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +150 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +9 -152
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +25 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +19 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +32 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +68 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +3 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +143 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +44 -143
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +114 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +189 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +72 -186
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +31 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +89 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +406 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -411
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +84 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +67 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +222 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -223
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +245 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +5 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +23 -252
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +626 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -586
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +45 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +256 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -263
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +22 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +130 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -132
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +129 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +82 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +19 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +20 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +28 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +82 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +47 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +260 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +24 -251
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +382 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +294 -144
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +4 -223
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +112 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +37 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +1 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index91.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +18 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +126 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +1 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +33 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +7 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +126 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +11 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +106 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +2 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index110.js +50 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +2 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +154 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +343 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +5 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +28 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +32 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +12 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +104 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +31 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +2458 -2284
- package/package.json +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index92.js +0 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +0 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index114.js +0 -52
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index115.js +0 -2
|
@@ -1,7 +1,87 @@
|
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
4
|
+
import { isEditablePayableStatus as n } from "./index11.js";
|
|
5
|
+
import { BanIcon as r, CalendarXIcon as i, RotateCcwIcon as a, ThumbsDownIcon as o, ThumbsUpIcon as s } from "lucide-react";
|
|
1
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
function c(n) {
|
|
8
|
+
return e(n, [t.CounterpartReadOrg]);
|
|
9
|
+
}
|
|
10
|
+
function l({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
|
|
11
|
+
let s = e(r, [t.PayableApproveOrg]);
|
|
12
|
+
return !!(n === "approve_in_progress" && s);
|
|
13
|
+
}
|
|
14
|
+
function u({ status: u, scopes: d, canDecideApprovalRequest: f, hasScheduledPayment: p, scheduledPaymentIntentId: m, arePendingApproversUnknown: h, hasApprovalPolicy: g, hasWaitingRequest: _, isPayabilityUnknown: v, canEdit: y, labels: b }) {
|
|
15
|
+
let x = e(d, [t.PayablePayOrg]), S = e(d, [t.BankAccountReadOrg]), C = c(d), w = e(d, [t.PaymentRailAch]), T = e(d, [t.PayableWriteOrg]), E = x, D = [];
|
|
16
|
+
if (y && n(u) && T && D.push({
|
|
17
|
+
id: "edit",
|
|
18
|
+
label: b.edit,
|
|
19
|
+
variant: "default",
|
|
20
|
+
surface: "row"
|
|
21
|
+
}), u === "approve_in_progress" && f && (D.push({
|
|
22
|
+
id: "approve",
|
|
23
|
+
label: b.approve,
|
|
24
|
+
variant: "default",
|
|
25
|
+
surface: "row"
|
|
26
|
+
}), D.push({
|
|
27
|
+
id: "reject",
|
|
28
|
+
label: b.reject,
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
surface: "row"
|
|
31
|
+
})), l({
|
|
32
|
+
status: u,
|
|
33
|
+
scopes: d,
|
|
34
|
+
arePendingApproversUnknown: h,
|
|
35
|
+
hasApprovalPolicy: g,
|
|
36
|
+
hasWaitingRequest: _
|
|
37
|
+
})) {
|
|
38
|
+
let e = g === !1 ? void 0 : b.policyOverridesHeading;
|
|
39
|
+
D.push({
|
|
40
|
+
id: "forceApprove",
|
|
41
|
+
label: b.forceApprove,
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
surface: "menu",
|
|
44
|
+
icon: s,
|
|
45
|
+
sectionHeading: e
|
|
46
|
+
}), D.push({
|
|
47
|
+
id: "forceReject",
|
|
48
|
+
label: b.forceReject,
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
surface: "menu",
|
|
51
|
+
icon: o,
|
|
52
|
+
sectionHeading: e
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
let O = u === "waiting_to_be_paid" && x && !p, k = u === "waiting_to_be_paid" && x && S && C && w && !p && !v;
|
|
56
|
+
return O && D.push({
|
|
57
|
+
id: "markAsPaid",
|
|
58
|
+
label: b.markAsPaid,
|
|
59
|
+
variant: "outline",
|
|
60
|
+
surface: "row"
|
|
61
|
+
}), k && D.push({
|
|
62
|
+
id: "payBill",
|
|
63
|
+
label: b.payBill,
|
|
64
|
+
variant: "default",
|
|
65
|
+
surface: "row"
|
|
66
|
+
}), u === "new" && T && D.push({
|
|
67
|
+
id: "cancel",
|
|
68
|
+
label: b.cancel,
|
|
69
|
+
variant: "ghost",
|
|
70
|
+
surface: "menu",
|
|
71
|
+
icon: r
|
|
72
|
+
}), (u === "rejected" || u === "waiting_to_be_paid" && !p) && T && D.push({
|
|
73
|
+
id: "reopen",
|
|
74
|
+
label: b.reopen,
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
surface: "menu",
|
|
77
|
+
icon: a
|
|
78
|
+
}), u === "waiting_to_be_paid" && p && m && E && D.push({
|
|
79
|
+
id: "cancelScheduledPayment",
|
|
80
|
+
label: b.cancelScheduledPayment,
|
|
81
|
+
variant: "ghost",
|
|
82
|
+
surface: "menu",
|
|
83
|
+
icon: i
|
|
84
|
+
}), D;
|
|
5
85
|
}
|
|
6
86
|
//#endregion
|
|
7
|
-
export {
|
|
87
|
+
export { l as canOverrideApprovalPolicy, c as canReadCounterpartBankAccounts, u as getBillDetailActions };
|
|
@@ -1,87 +1,6 @@
|
|
|
1
|
-
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
-
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
-
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
import { isEditablePayableStatus as n } from "./index19.js";
|
|
5
|
-
import { BanIcon as r, CalendarXIcon as i, RotateCcwIcon as a, ThumbsDownIcon as o, ThumbsUpIcon as s } from "lucide-react";
|
|
6
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
|
|
7
|
-
function
|
|
8
|
-
return e
|
|
9
|
-
}
|
|
10
|
-
function l({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
|
|
11
|
-
let s = e(r, [t.PayableApproveOrg]);
|
|
12
|
-
return !!(n === "approve_in_progress" && s);
|
|
13
|
-
}
|
|
14
|
-
function u({ status: u, scopes: d, canDecideApprovalRequest: f, hasScheduledPayment: p, scheduledPaymentIntentId: m, arePendingApproversUnknown: h, hasApprovalPolicy: g, hasWaitingRequest: _, isPayabilityUnknown: v, canEdit: y, labels: b }) {
|
|
15
|
-
let x = e(d, [t.PayablePayOrg]), S = e(d, [t.BankAccountReadOrg]), C = c(d), w = e(d, [t.PaymentRailAch]), T = e(d, [t.PayableWriteOrg]), E = x, D = [];
|
|
16
|
-
if (y && n(u) && T && D.push({
|
|
17
|
-
id: "edit",
|
|
18
|
-
label: b.edit,
|
|
19
|
-
variant: "default",
|
|
20
|
-
surface: "row"
|
|
21
|
-
}), u === "approve_in_progress" && f && (D.push({
|
|
22
|
-
id: "approve",
|
|
23
|
-
label: b.approve,
|
|
24
|
-
variant: "default",
|
|
25
|
-
surface: "row"
|
|
26
|
-
}), D.push({
|
|
27
|
-
id: "reject",
|
|
28
|
-
label: b.reject,
|
|
29
|
-
variant: "ghost",
|
|
30
|
-
surface: "row"
|
|
31
|
-
})), l({
|
|
32
|
-
status: u,
|
|
33
|
-
scopes: d,
|
|
34
|
-
arePendingApproversUnknown: h,
|
|
35
|
-
hasApprovalPolicy: g,
|
|
36
|
-
hasWaitingRequest: _
|
|
37
|
-
})) {
|
|
38
|
-
let e = g === !1 ? void 0 : b.policyOverridesHeading;
|
|
39
|
-
D.push({
|
|
40
|
-
id: "forceApprove",
|
|
41
|
-
label: b.forceApprove,
|
|
42
|
-
variant: "ghost",
|
|
43
|
-
surface: "menu",
|
|
44
|
-
icon: s,
|
|
45
|
-
sectionHeading: e
|
|
46
|
-
}), D.push({
|
|
47
|
-
id: "forceReject",
|
|
48
|
-
label: b.forceReject,
|
|
49
|
-
variant: "ghost",
|
|
50
|
-
surface: "menu",
|
|
51
|
-
icon: o,
|
|
52
|
-
sectionHeading: e
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
let O = u === "waiting_to_be_paid" && x && !p, k = u === "waiting_to_be_paid" && x && S && C && w && !p && !v;
|
|
56
|
-
return O && D.push({
|
|
57
|
-
id: "markAsPaid",
|
|
58
|
-
label: b.markAsPaid,
|
|
59
|
-
variant: "outline",
|
|
60
|
-
surface: "row"
|
|
61
|
-
}), k && D.push({
|
|
62
|
-
id: "payBill",
|
|
63
|
-
label: b.payBill,
|
|
64
|
-
variant: "default",
|
|
65
|
-
surface: "row"
|
|
66
|
-
}), u === "new" && T && D.push({
|
|
67
|
-
id: "cancel",
|
|
68
|
-
label: b.cancel,
|
|
69
|
-
variant: "ghost",
|
|
70
|
-
surface: "menu",
|
|
71
|
-
icon: r
|
|
72
|
-
}), (u === "rejected" || u === "waiting_to_be_paid" && !p) && T && D.push({
|
|
73
|
-
id: "reopen",
|
|
74
|
-
label: b.reopen,
|
|
75
|
-
variant: "ghost",
|
|
76
|
-
surface: "menu",
|
|
77
|
-
icon: a
|
|
78
|
-
}), u === "waiting_to_be_paid" && p && m && E && D.push({
|
|
79
|
-
id: "cancelScheduledPayment",
|
|
80
|
-
label: b.cancelScheduledPayment,
|
|
81
|
-
variant: "ghost",
|
|
82
|
-
surface: "menu",
|
|
83
|
-
icon: i
|
|
84
|
-
}), D;
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e?.amount_due ?? e?.total_amount ?? void 0;
|
|
85
4
|
}
|
|
86
5
|
//#endregion
|
|
87
|
-
export {
|
|
6
|
+
export { e as resolveAmountDueMinorUnits };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var e = {
|
|
3
|
+
scheduleDialog: "pay-bill-schedule-dialog",
|
|
4
|
+
reviewDialog: "pay-bill-review-dialog"
|
|
5
|
+
};
|
|
5
6
|
//#endregion
|
|
6
|
-
export { e as
|
|
7
|
+
export { e as payBillFlowTestIds };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e ? `••••${e.slice(-4)}` : void 0;
|
|
4
|
+
}
|
|
6
5
|
//#endregion
|
|
7
|
-
export { e as
|
|
6
|
+
export { e as maskAccountNumber };
|
|
@@ -1,6 +1,35 @@
|
|
|
1
|
+
import { coerceAmountValueToMinorUnits as e } from "../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
|
|
2
|
+
import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
var n = {
|
|
5
|
+
unnamedSourceAccount: "Bank account",
|
|
6
|
+
availableBalancePrefix: (e) => `Available balance: ${e}`,
|
|
7
|
+
futureInsufficientFunds: "Not enough funds right now. Add funds before the payment date.",
|
|
8
|
+
todayInsufficientFunds: "Not enough funds to pay today. Choose a different account or a later date."
|
|
9
|
+
};
|
|
10
|
+
function r(e) {
|
|
11
|
+
return e.slice(-4);
|
|
12
|
+
}
|
|
13
|
+
function i(i, a = n) {
|
|
14
|
+
return i.filter((e) => e.status === "ACTIVE").map((n) => {
|
|
15
|
+
let i = e(n.balance.value), o = n.balance.currencyCode;
|
|
16
|
+
return {
|
|
17
|
+
id: n.id,
|
|
18
|
+
primaryLabel: `${n.nickname || a.unnamedSourceAccount} - ${r(n.accountNumber)}`,
|
|
19
|
+
secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
|
|
20
|
+
balanceMinorUnits: i
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
|
|
25
|
+
let a = e?.balanceMinorUnits;
|
|
26
|
+
return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
|
|
27
|
+
state: "error",
|
|
28
|
+
message: i.todayInsufficientFunds
|
|
29
|
+
} : {
|
|
30
|
+
state: "warning",
|
|
31
|
+
message: i.futureInsufficientFunds
|
|
32
|
+
};
|
|
4
33
|
}
|
|
5
34
|
//#endregion
|
|
6
|
-
export {
|
|
35
|
+
export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SOURCE_ACCOUNT_LABELS_EN as e } from "./index23.js";
|
|
2
|
+
import { REVIEW_TRANSACTION_DIALOG_LABELS_EN as t } from "../../ui/dist/index96.js";
|
|
3
|
+
import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as n, mergeSchedulePaymentDialogLabels as r } from "../../ui/dist/index102.js";
|
|
4
|
+
import "../../ui/dist/index.js";
|
|
3
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var i = {
|
|
7
|
+
amountDue: "Amount due",
|
|
8
|
+
paymentAmount: "Payment amount",
|
|
9
|
+
dueDateSuffix: (e) => `by ${e}`,
|
|
10
|
+
paymentDate: "Payment date",
|
|
11
|
+
sourceAccount: "Pay from",
|
|
12
|
+
accountHolder: "Account holder name",
|
|
13
|
+
routingNumber: "Routing number",
|
|
14
|
+
accountNumber: "Account number",
|
|
15
|
+
achMethod: "Pay by ACH bank transfer",
|
|
16
|
+
scheduledToast: "Payment scheduled",
|
|
17
|
+
submitError: "Couldn't schedule this payment. Try again.",
|
|
18
|
+
selectAccountError: "Select a source account.",
|
|
19
|
+
selectDateError: "Select a payment date.",
|
|
20
|
+
staleDateError: "That date has passed. Choose a new payment date.",
|
|
21
|
+
missingPaymentInstructionsError: "This vendor does not have ACH payment instructions on file.",
|
|
22
|
+
checkingPaymentInstructionsError: "Still checking this vendor's payment instructions. Try again in a moment.",
|
|
23
|
+
paymentInstructionsUnavailableError: "Couldn't check this vendor's payment instructions. Try again.",
|
|
24
|
+
missingVendorName: "Not provided",
|
|
25
|
+
...e,
|
|
26
|
+
scheduleDialog: n,
|
|
27
|
+
reviewDialog: t
|
|
9
28
|
};
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
|
|
20
|
-
balanceMinorUnits: i
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
|
|
25
|
-
let a = e?.balanceMinorUnits;
|
|
26
|
-
return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
|
|
27
|
-
state: "error",
|
|
28
|
-
message: i.todayInsufficientFunds
|
|
29
|
-
} : {
|
|
30
|
-
state: "warning",
|
|
31
|
-
message: i.futureInsufficientFunds
|
|
29
|
+
function a(e) {
|
|
30
|
+
return {
|
|
31
|
+
...i,
|
|
32
|
+
...e,
|
|
33
|
+
scheduleDialog: r(e?.scheduleDialog),
|
|
34
|
+
reviewDialog: {
|
|
35
|
+
...i.reviewDialog,
|
|
36
|
+
...e?.reviewDialog
|
|
37
|
+
}
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
//#endregion
|
|
35
|
-
export {
|
|
41
|
+
export { i as PAY_BILL_FLOW_LABELS_EN, a as mergePayBillFlowLabels };
|
|
@@ -1,41 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 { useAllBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
7
|
+
import "../../../shared/data-access/dist/index.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useAnalyticsCaptureException as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
10
|
+
import { formatCalendarDate as r } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
11
|
+
import { formatMoneyExact as i } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
12
|
+
import { extractApiErrorMessage as a } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
13
|
+
import "../../../shared/feature/dist/index.js";
|
|
14
|
+
import { useSchedulePaymentMutation as o } from "../../data-access/dist/index12.js";
|
|
15
|
+
import "../../data-access/dist/index.js";
|
|
16
|
+
import { dateToCalendarKey as s, getDefaultPaymentDate as c, isPastEasternDate as l, isTodayInEastern as u } from "./index16.js";
|
|
17
|
+
import { maskAccountNumber as d } from "./index22.js";
|
|
18
|
+
import { deriveSourceAccountFunds as f, mapSourceAccountOptions as p } from "./index23.js";
|
|
19
|
+
import { mergePayBillFlowLabels as m } from "./index24.js";
|
|
20
|
+
import { useMemo as h, useState as g } from "react";
|
|
5
21
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
function _(e) {
|
|
23
|
+
return !!(e?.account_holder_name && e.routing_number && e.account_number);
|
|
24
|
+
}
|
|
25
|
+
function v({ selectedDate: e, selectedAccount: t, amountDueMinorUnits: n, labels: r }) {
|
|
26
|
+
if (!e) return {
|
|
27
|
+
ok: !1,
|
|
28
|
+
error: r.selectDateError
|
|
29
|
+
};
|
|
30
|
+
if (l(e)) return {
|
|
31
|
+
ok: !1,
|
|
32
|
+
error: r.staleDateError
|
|
33
|
+
};
|
|
34
|
+
if (!t) return {
|
|
35
|
+
ok: !1,
|
|
36
|
+
error: r.selectAccountError
|
|
37
|
+
};
|
|
38
|
+
let i = f({
|
|
39
|
+
selectedAccount: t,
|
|
40
|
+
amountDueMinorUnits: n,
|
|
41
|
+
isToday: u(e),
|
|
42
|
+
labels: r
|
|
43
|
+
});
|
|
44
|
+
return i.state === "error" ? {
|
|
45
|
+
ok: !1,
|
|
46
|
+
error: i.message ?? r.todayInsufficientFunds
|
|
47
|
+
} : {
|
|
48
|
+
ok: !0,
|
|
49
|
+
date: e,
|
|
50
|
+
account: t
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function y({ payableId: l, amountDueMinorUnits: y, currencyCode: b = "USD", dueDate: x, vendorName: S, vendorEmail: C, vendorBankAccount: w, isVendorBankAccountLoading: T, isVendorBankAccountError: E, onMissingAchInstructions: D, poweredByBankName: O, labels: k }) {
|
|
54
|
+
let A = h(() => m(k), [k]), j = S ?? A.missingVendorName, [M, N] = g(!1), [P, F] = g(!1), [I, L] = g(() => c()), [R, z] = g(), B = t({ enabled: M || P }), V = o(), H = n(), U = h(() => p(B.data?.data ?? [], A), [B.data?.data, A]), W = U.find((e) => e.id === R), G = I ? u(I) : !1, K = { before: c() }, q = f({
|
|
55
|
+
selectedAccount: W,
|
|
56
|
+
amountDueMinorUnits: y,
|
|
57
|
+
isToday: G,
|
|
58
|
+
labels: A
|
|
59
|
+
}), J = i(y / 100, { currencyCode: b }), Y = I ? r(s(I)) : void 0, X = x ? A.dueDateSuffix(r(x)) : void 0, Z = () => v({
|
|
60
|
+
selectedDate: I,
|
|
61
|
+
selectedAccount: W,
|
|
62
|
+
amountDueMinorUnits: y,
|
|
63
|
+
labels: A
|
|
64
|
+
}), Q = () => {
|
|
65
|
+
if (T) {
|
|
66
|
+
e.error(A.checkingPaymentInstructionsError);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (E) {
|
|
70
|
+
e.error(A.paymentInstructionsUnavailableError);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!_(w)) {
|
|
74
|
+
D ? D() : e.error(A.missingPaymentInstructionsError);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
N(!0);
|
|
78
|
+
}, $ = () => {
|
|
79
|
+
F(!1), N(!1);
|
|
80
|
+
};
|
|
30
81
|
return {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
82
|
+
open: Q,
|
|
83
|
+
dialogProps: {
|
|
84
|
+
open: M,
|
|
85
|
+
onOpenChange: N,
|
|
86
|
+
amountDueLabel: A.amountDue,
|
|
87
|
+
amountDue: J,
|
|
88
|
+
dueDateSuffix: X,
|
|
89
|
+
paymentAmountLabel: A.paymentAmount,
|
|
90
|
+
paymentAmount: J,
|
|
91
|
+
selectedDate: I,
|
|
92
|
+
selectedDateLabel: Y,
|
|
93
|
+
calendarDisabled: K,
|
|
94
|
+
isToday: G,
|
|
95
|
+
selectedAccountId: R,
|
|
96
|
+
accounts: U,
|
|
97
|
+
poweredByBankName: O,
|
|
98
|
+
funds: q,
|
|
99
|
+
isAccountsLoading: B.isLoading,
|
|
100
|
+
isAccountsError: B.isError,
|
|
101
|
+
isSubmitting: V.isPending,
|
|
102
|
+
onDateChange: L,
|
|
103
|
+
onAccountChange: z,
|
|
104
|
+
onReview: () => {
|
|
105
|
+
let t = Z();
|
|
106
|
+
if (!t.ok) {
|
|
107
|
+
e.error(t.error);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
N(!1), F(!0);
|
|
111
|
+
},
|
|
112
|
+
onCancel: $,
|
|
113
|
+
labels: A.scheduleDialog
|
|
114
|
+
},
|
|
115
|
+
reviewProps: {
|
|
116
|
+
open: P,
|
|
117
|
+
onOpenChange: F,
|
|
118
|
+
amountLabel: A.paymentAmount,
|
|
119
|
+
amount: J,
|
|
120
|
+
rows: [{
|
|
121
|
+
label: A.sourceAccount,
|
|
122
|
+
value: W?.primaryLabel ?? ""
|
|
123
|
+
}, {
|
|
124
|
+
label: A.paymentDate,
|
|
125
|
+
value: Y ?? ""
|
|
126
|
+
}],
|
|
127
|
+
payTo: {
|
|
128
|
+
name: j,
|
|
129
|
+
email: C,
|
|
130
|
+
methodLabel: A.achMethod,
|
|
131
|
+
fields: _(w) ? [
|
|
132
|
+
{
|
|
133
|
+
label: A.routingNumber,
|
|
134
|
+
value: w.routing_number
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: A.accountNumber,
|
|
138
|
+
value: w.account_number,
|
|
139
|
+
maskedValue: d(w.account_number)
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: A.accountHolder,
|
|
143
|
+
value: w.account_holder_name
|
|
144
|
+
}
|
|
145
|
+
] : []
|
|
146
|
+
},
|
|
147
|
+
isSubmitting: V.isPending,
|
|
148
|
+
onBack: () => {
|
|
149
|
+
F(!1), N(!0);
|
|
150
|
+
},
|
|
151
|
+
onCancel: $,
|
|
152
|
+
onSubmit: async () => {
|
|
153
|
+
let t = Z();
|
|
154
|
+
if (!t.ok) {
|
|
155
|
+
F(!1), e.error(t.error), N(!0);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
await V.mutateAsync({
|
|
160
|
+
payableId: l,
|
|
161
|
+
paymentDate: s(t.date),
|
|
162
|
+
sourceBankAccountId: t.account.id
|
|
163
|
+
}), $(), e.success(A.scheduledToast);
|
|
164
|
+
} catch (t) {
|
|
165
|
+
H(t, { payable_id: l }), e.error(a(t) ?? A.submitError);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
labels: A.reviewDialog
|
|
37
169
|
}
|
|
38
170
|
};
|
|
39
171
|
}
|
|
40
172
|
//#endregion
|
|
41
|
-
export {
|
|
173
|
+
export { y as usePayBillFlow };
|