@tesouro/embedded-components-react 0.5.2 → 0.5.4

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 (113) hide show
  1. package/README.md +15 -2
  2. package/dist/index.d.ts +120 -100
  3. package/dist/index.js +7 -4
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +214 -246
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/MarketingWidget.d.ts +684 -0
  7. package/dist/lib/MarketingWidget.js +4 -0
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +9 -8
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +0 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +183 -205
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +1 -4
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +13 -13
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +70 -5
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +37 -64
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +110 -38
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +73 -104
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -87
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +21 -7
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +22 -17
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +63 -23
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -66
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +81 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -78
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +39 -30
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +166 -37
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +39 -164
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -48
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +139 -18
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +16 -139
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -24
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +41 -4
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +14 -39
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +8 -16
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +91 -8
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +86 -80
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +3 -97
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +49 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +135 -47
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -135
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +186 -33
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +75 -186
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +21 -75
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -14
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +232 -22
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +210 -223
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +103 -202
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -121
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +31 -47
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +198 -27
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +31 -198
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -31
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +19 -240
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +24 -25
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +427 -19
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -433
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +38 -4
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +220 -35
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -224
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +10 -6
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +57 -21
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +110 -10
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -112
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -58
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +101 -239
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +202 -107
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -209
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +4 -5
  96. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +3 -0
  97. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js +8 -0
  98. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index26.js → marketing-widget/feature/dist/index3.js} +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +81 -0
  100. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +4 -0
  101. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index24.js → marketing-widget/ui/dist/index2.js} +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index25.js → marketing-widget/ui/dist/index3.js} +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index27.js → marketing-widget/ui/dist/index4.js} +36 -37
  104. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js +75 -0
  105. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +24 -22
  106. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index9.js → shared/data-access/dist/lib/onboardingSuppressionReason.js} +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index10.js → shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js} +5 -6
  108. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -0
  109. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  111. package/package.json +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +0 -75
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
@@ -1,21 +1,26 @@
1
- import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index95.js";
2
- import "../../ui/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js
4
- var t = {
5
- dueDateSuffix: (e) => `by ${e}`,
6
- paidToast: "Bill marked as paid",
7
- submitError: "Couldn't mark this bill as paid. Try again.",
8
- dialog: e
9
- };
2
+ var e = new Intl.DateTimeFormat("en-CA", {
3
+ timeZone: "America/New_York",
4
+ year: "numeric",
5
+ month: "2-digit",
6
+ day: "2-digit"
7
+ });
8
+ function t(t = /* @__PURE__ */ new Date()) {
9
+ let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
+ return `${r.year}-${r.month}-${r.day}`;
11
+ }
10
12
  function n(e) {
11
- return {
12
- ...t,
13
- ...e,
14
- dialog: {
15
- ...t.dialog,
16
- ...e?.dialog
17
- }
18
- };
13
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
+ }
15
+ function r(e, r = /* @__PURE__ */ new Date()) {
16
+ return n(e) === t(r);
17
+ }
18
+ function i(e = /* @__PURE__ */ new Date()) {
19
+ let [n, r, i] = t(e).split("-").map(Number);
20
+ return new Date(n, r - 1, i);
21
+ }
22
+ function a(e, r = /* @__PURE__ */ new Date()) {
23
+ return n(e) < t(r);
19
24
  }
20
25
  //#endregion
21
- export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
26
+ export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
@@ -1,26 +1,66 @@
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 "../../../shared/ui/dist/index.js";
7
+ import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
+ import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
+ import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
+ import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
+ import "../../data-access/dist/index.js";
12
+ import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index16.js";
13
+ import { mergeMarkAsPaidFlowLabels as c } from "./index15.js";
14
+ import { useEffect as l, useState as u } from "react";
1
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js
2
- var e = new Intl.DateTimeFormat("en-CA", {
3
- timeZone: "America/New_York",
4
- year: "numeric",
5
- month: "2-digit",
6
- day: "2-digit"
7
- });
8
- function t(t = /* @__PURE__ */ new Date()) {
9
- let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
- return `${r.year}-${r.month}-${r.day}`;
11
- }
12
- function n(e) {
13
- return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
- }
15
- function r(e, r = /* @__PURE__ */ new Date()) {
16
- return n(e) === t(r);
17
- }
18
- function i(e = /* @__PURE__ */ new Date()) {
19
- let [n, r, i] = t(e).split("-").map(Number);
20
- return new Date(n, r - 1, i);
21
- }
22
- function a(e, r = /* @__PURE__ */ new Date()) {
23
- return n(e) < t(r);
16
+ function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
+ let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
+ S(!1), w(void 0), E("");
19
+ };
20
+ return l(() => {
21
+ g && (S(!1), w(void 0), E(""));
22
+ }, [g]), {
23
+ open: () => {
24
+ w(o()), E(""), S(!0);
25
+ },
26
+ isPending: b.isPending,
27
+ dialogProps: {
28
+ open: D,
29
+ amountDue: O,
30
+ dueDateSuffix: j,
31
+ paymentAmount: k,
32
+ selectedDate: C,
33
+ selectedDateLabel: A,
34
+ isToday: C ? s(C) : !1,
35
+ comment: T,
36
+ isSubmitting: b.isPending,
37
+ onDateChange: w,
38
+ onCommentChange: E,
39
+ onConfirm: () => {
40
+ !d || !C || b.isPending || g || b.mutate({
41
+ path: { payable_id: d },
42
+ body: {
43
+ paid_at: `${a(C)}T12:00:00.000Z`,
44
+ is_external: !0,
45
+ ...T.trim() ? { comment: T.trim() } : {}
46
+ }
47
+ }, {
48
+ onSuccess: () => {
49
+ e.success(y.paidToast), M();
50
+ },
51
+ onError: (t) => {
52
+ e.error(r(t) ?? y.submitError);
53
+ }
54
+ });
55
+ },
56
+ onCancel: () => {
57
+ b.isPending || M();
58
+ },
59
+ testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
+ confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
+ labels: y.dialog
62
+ }
63
+ };
24
64
  }
25
65
  //#endregion
26
- export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
66
+ export { d as useMarkAsPaidFlow };
@@ -1,66 +1,2 @@
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 "../../../shared/ui/dist/index.js";
7
- import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
- import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
- import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
- import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
- import "../../data-access/dist/index.js";
12
- import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index17.js";
13
- import { mergeMarkAsPaidFlowLabels as c } from "./index16.js";
14
- import { useEffect as l, useState as u } from "react";
15
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js
16
- function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
- let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
- S(!1), w(void 0), E("");
19
- };
20
- return l(() => {
21
- g && (S(!1), w(void 0), E(""));
22
- }, [g]), {
23
- open: () => {
24
- w(o()), E(""), S(!0);
25
- },
26
- isPending: b.isPending,
27
- dialogProps: {
28
- open: D,
29
- amountDue: O,
30
- dueDateSuffix: j,
31
- paymentAmount: k,
32
- selectedDate: C,
33
- selectedDateLabel: A,
34
- isToday: C ? s(C) : !1,
35
- comment: T,
36
- isSubmitting: b.isPending,
37
- onDateChange: w,
38
- onCommentChange: E,
39
- onConfirm: () => {
40
- !d || !C || b.isPending || g || b.mutate({
41
- path: { payable_id: d },
42
- body: {
43
- paid_at: `${a(C)}T12:00:00.000Z`,
44
- is_external: !0,
45
- ...T.trim() ? { comment: T.trim() } : {}
46
- }
47
- }, {
48
- onSuccess: () => {
49
- e.success(y.paidToast), M();
50
- },
51
- onError: (t) => {
52
- e.error(r(t) ?? y.submitError);
53
- }
54
- });
55
- },
56
- onCancel: () => {
57
- b.isPending || M();
58
- },
59
- testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
- confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
- labels: y.dialog
62
- }
63
- };
64
- }
65
- //#endregion
66
- export { d as useMarkAsPaidFlow };
1
+ import "./index15.js";
2
+ import "./index17.js";
@@ -1,2 +1,81 @@
1
- import "./index16.js";
2
- import "./index18.js";
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 { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
5
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
6
+ function s(n) {
7
+ return e(n, [t.CounterpartReadOrg]);
8
+ }
9
+ function c({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
10
+ let s = e(r, [t.PayableApproveOrg]);
11
+ return !!(n === "approve_in_progress" && s);
12
+ }
13
+ function l({ status: l, scopes: u, canDecideApprovalRequest: d, hasScheduledPayment: f, scheduledPaymentIntentId: p, arePendingApproversUnknown: m, hasApprovalPolicy: h, hasWaitingRequest: g, isPayabilityUnknown: _, labels: v }) {
14
+ let y = e(u, [t.PayablePayOrg]), b = e(u, [t.BankAccountReadOrg]), x = s(u), S = e(u, [t.PaymentRailAch]), C = e(u, [t.PayableWriteOrg]), w = y, T = [];
15
+ if (l === "approve_in_progress" && d && (T.push({
16
+ id: "approve",
17
+ label: v.approve,
18
+ variant: "default",
19
+ surface: "row"
20
+ }), T.push({
21
+ id: "reject",
22
+ label: v.reject,
23
+ variant: "ghost",
24
+ surface: "row"
25
+ })), c({
26
+ status: l,
27
+ scopes: u,
28
+ arePendingApproversUnknown: m,
29
+ hasApprovalPolicy: h,
30
+ hasWaitingRequest: g
31
+ })) {
32
+ let e = h === !1 ? void 0 : v.policyOverridesHeading;
33
+ T.push({
34
+ id: "forceApprove",
35
+ label: v.forceApprove,
36
+ variant: "ghost",
37
+ surface: "menu",
38
+ icon: o,
39
+ sectionHeading: e
40
+ }), T.push({
41
+ id: "forceReject",
42
+ label: v.forceReject,
43
+ variant: "ghost",
44
+ surface: "menu",
45
+ icon: a,
46
+ sectionHeading: e
47
+ });
48
+ }
49
+ let E = l === "waiting_to_be_paid" && y && !f, D = l === "waiting_to_be_paid" && y && b && x && S && !f && !_;
50
+ return E && T.push({
51
+ id: "markAsPaid",
52
+ label: v.markAsPaid,
53
+ variant: "outline",
54
+ surface: "row"
55
+ }), D && T.push({
56
+ id: "payBill",
57
+ label: v.payBill,
58
+ variant: "default",
59
+ surface: "row"
60
+ }), l === "new" && C && T.push({
61
+ id: "cancel",
62
+ label: v.cancel,
63
+ variant: "ghost",
64
+ surface: "menu",
65
+ icon: n
66
+ }), (l === "rejected" || l === "waiting_to_be_paid" && !f) && C && T.push({
67
+ id: "reopen",
68
+ label: v.reopen,
69
+ variant: "ghost",
70
+ surface: "menu",
71
+ icon: i
72
+ }), l === "waiting_to_be_paid" && f && p && w && T.push({
73
+ id: "cancelScheduledPayment",
74
+ label: v.cancelScheduledPayment,
75
+ variant: "ghost",
76
+ surface: "menu",
77
+ icon: r
78
+ }), T;
79
+ }
80
+ //#endregion
81
+ export { c as canOverrideApprovalPolicy, s as canReadCounterpartBankAccounts, l as getBillDetailActions };
@@ -1,81 +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 { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
5
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
6
- function s(n) {
7
- return e(n, [t.CounterpartReadOrg]);
8
- }
9
- function c({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
10
- let s = e(r, [t.PayableApproveOrg]);
11
- return !!(n === "approve_in_progress" && s && !i && (!a || o));
12
- }
13
- function l({ status: l, scopes: u, canDecideApprovalRequest: d, hasScheduledPayment: f, scheduledPaymentIntentId: p, arePendingApproversUnknown: m, hasApprovalPolicy: h, hasWaitingRequest: g, isPayabilityUnknown: _, labels: v }) {
14
- let y = e(u, [t.PayablePayOrg]), b = e(u, [t.BankAccountReadOrg]), x = s(u), S = e(u, [t.PaymentRailAch]), C = e(u, [t.PayableWriteOrg]), w = y, T = [];
15
- if (l === "approve_in_progress" && d && (T.push({
16
- id: "approve",
17
- label: v.approve,
18
- variant: "default",
19
- surface: "row"
20
- }), T.push({
21
- id: "reject",
22
- label: v.reject,
23
- variant: "ghost",
24
- surface: "row"
25
- })), c({
26
- status: l,
27
- scopes: u,
28
- arePendingApproversUnknown: m,
29
- hasApprovalPolicy: h,
30
- hasWaitingRequest: g
31
- })) {
32
- let e = h === !1 ? void 0 : v.policyOverridesHeading;
33
- T.push({
34
- id: "forceApprove",
35
- label: v.forceApprove,
36
- variant: "ghost",
37
- surface: "menu",
38
- icon: o,
39
- sectionHeading: e
40
- }), T.push({
41
- id: "forceReject",
42
- label: v.forceReject,
43
- variant: "ghost",
44
- surface: "menu",
45
- icon: a,
46
- sectionHeading: e
47
- });
48
- }
49
- let E = l === "waiting_to_be_paid" && y && !f, D = l === "waiting_to_be_paid" && y && b && x && S && !f && !_;
50
- return E && T.push({
51
- id: "markAsPaid",
52
- label: v.markAsPaid,
53
- variant: "outline",
54
- surface: "row"
55
- }), D && T.push({
56
- id: "payBill",
57
- label: v.payBill,
58
- variant: "default",
59
- surface: "row"
60
- }), l === "new" && C && T.push({
61
- id: "cancel",
62
- label: v.cancel,
63
- variant: "ghost",
64
- surface: "menu",
65
- icon: n
66
- }), (l === "rejected" || l === "waiting_to_be_paid" && !f) && C && T.push({
67
- id: "reopen",
68
- label: v.reopen,
69
- variant: "ghost",
70
- surface: "menu",
71
- icon: i
72
- }), l === "waiting_to_be_paid" && f && p && w && T.push({
73
- id: "cancelScheduledPayment",
74
- label: v.cancelScheduledPayment,
75
- variant: "ghost",
76
- surface: "menu",
77
- icon: r
78
- }), T;
2
+ function e(e) {
3
+ return e?.amount_due ?? e?.total_amount ?? void 0;
79
4
  }
80
5
  //#endregion
81
- export { c as canOverrideApprovalPolicy, s as canReadCounterpartBankAccounts, l as getBillDetailActions };
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
- function e(e) {
3
- return e?.amount_due ?? e?.total_amount ?? void 0;
4
- }
2
+ var e = {
3
+ scheduleDialog: "pay-bill-schedule-dialog",
4
+ reviewDialog: "pay-bill-review-dialog"
5
+ };
5
6
  //#endregion
6
- export { e as resolveAmountDueMinorUnits };
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
- var e = {
3
- scheduleDialog: "pay-bill-schedule-dialog",
4
- reviewDialog: "pay-bill-review-dialog"
5
- };
2
+ function e(e) {
3
+ return e ? `••••${e.slice(-4)}` : void 0;
4
+ }
6
5
  //#endregion
7
- export { e as payBillFlowTestIds };
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
- function e(e) {
3
- return e ? `••••${e.slice(-4)}` : void 0;
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 { e as maskAccountNumber };
35
+ export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
@@ -1,35 +1,44 @@
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
+ import { REVIEW_TRANSACTION_DIALOG_LABELS_EN as e } from "../../ui/dist/index92.js";
2
+ import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as t } from "../../ui/dist/index98.js";
3
+ import "../../ui/dist/index.js";
4
+ import { SOURCE_ACCOUNT_LABELS_EN as n } from "./index23.js";
3
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
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."
6
+ var r = {
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
+ ...n,
26
+ scheduleDialog: t,
27
+ reviewDialog: e
9
28
  };
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
29
+ function i(e) {
30
+ return {
31
+ ...r,
32
+ ...e,
33
+ scheduleDialog: {
34
+ ...r.scheduleDialog,
35
+ ...e?.scheduleDialog
36
+ },
37
+ reviewDialog: {
38
+ ...r.reviewDialog,
39
+ ...e?.reviewDialog
40
+ }
32
41
  };
33
42
  }
34
43
  //#endregion
35
- export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
44
+ export { r as PAY_BILL_FLOW_LABELS_EN, i as mergePayBillFlowLabels };