@tesouro/embedded-components-react 0.5.168 → 0.5.170

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 (129) hide show
  1. package/dist/index.css +39 -17
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -11
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +95 -80
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +37 -11
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +13 -15
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +56 -67
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +4 -43
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +6 -115
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +202 -63
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -4
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +84 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -84
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +36 -30
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +167 -35
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +40 -164
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -49
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +150 -18
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +9 -152
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +25 -9
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +19 -21
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +32 -14
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -39
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -16
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -4
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +68 -83
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +3 -83
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +143 -3
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +44 -143
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +114 -45
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +189 -111
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +13 -0
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +72 -186
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +31 -76
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +89 -32
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +406 -83
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -411
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +84 -12
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +67 -72
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +222 -73
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -223
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +245 -37
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +5 -23
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +23 -252
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +626 -21
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -586
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +45 -4
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +256 -41
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -263
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -3
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -2
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -46
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -1
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +22 -57
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -6
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +130 -11
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -132
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -3
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +129 -3
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -124
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +7 -8
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +82 -8
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +19 -48
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +20 -21
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +14 -6
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +28 -19
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +82 -27
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +47 -83
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +260 -47
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +24 -251
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +382 -25
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +294 -144
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +4 -223
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +7 -4
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +112 -5
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +37 -5
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +1 -114
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index91.js +26 -0
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +18 -21
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +126 -10
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +1 -105
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +33 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +7 -28
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +126 -73
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +11 -30
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +106 -8
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +2 -181
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +10 -2
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index110.js +50 -12
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +2 -108
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +6 -0
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +8 -4
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +8 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +154 -23
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +1 -0
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +343 -250
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +5 -123
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +28 -26
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -94
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +7 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +32 -5
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -30
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +12 -2
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +104 -5
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -34
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +31 -2
  121. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  122. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  123. package/dist/packages/shared-ui-shadcn/dist/index.js +2458 -2284
  124. package/package.json +2 -1
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index92.js +0 -27
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +0 -2
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +0 -10
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index114.js +0 -52
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index115.js +0 -2
@@ -1,7 +1,101 @@
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { derivePayableStatus as t } from "./index10.js";
3
+ import { resolveVendor as n, resolveVendorName as r } from "./index12.js";
4
+ import { formatBillMoney as i } from "./index2.js";
5
+ import { resolveLineItemAmountMinorUnits as a } from "./index41.js";
6
+ import { resolveLineItemQuantity as o } from "./index42.js";
1
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
2
- var e = (e) => typeof e == "number" && Number.isFinite(e) && e > 0;
3
- function t({ quantity: t, unit_price: n, subtotal: r }) {
4
- return e(t) ? t : e(n) && e(r) && r % n === 0 ? r / n : 1;
8
+ function s(e) {
9
+ return e.total_amount ?? e.amount_due ?? void 0;
10
+ }
11
+ function c(e) {
12
+ return typeof e == "string" ? e : "";
13
+ }
14
+ function l({ payable: l, lineItems: d, ledgerAccounts: f, labels: p, hasScheduledPayment: m, now: h, rejection: g, achInstructions: _, achInstructionsReadable: v = !1 }) {
15
+ let y = l.currency, b = (e) => i(e, y), x = t({
16
+ apiStatus: l.status,
17
+ dueDate: l.due_date,
18
+ scheduledPaymentDate: l.scheduled_payment_date,
19
+ hasScheduledPayment: m,
20
+ now: h
21
+ }), S = n(l), C = r(l), w = e(l.issued_at) || p.notProvided, T = e(l.due_date) || p.notProvided, E = [{
22
+ label: p.vendorRow,
23
+ value: C || p.notProvided,
24
+ secondaryValue: S?.email ?? void 0
25
+ }], D = v ? _?.account_number : void 0;
26
+ D && E.push({
27
+ label: p.bankAccountRow,
28
+ value: p.bankAccountValue(D.slice(-4))
29
+ });
30
+ let O = [
31
+ {
32
+ label: p.invoiceNumberRow,
33
+ value: l.document_id || p.notProvided
34
+ },
35
+ {
36
+ label: p.issueDateRow,
37
+ value: w
38
+ },
39
+ {
40
+ label: p.dueDateRow,
41
+ value: T
42
+ },
43
+ {
44
+ label: p.poNumberRow,
45
+ value: c(l.purchase_order_number) || p.notProvided
46
+ }
47
+ ], k = new Map(f.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), A = d.map((e) => {
48
+ let t = b(e.unit_price), n = String(o(e));
49
+ return {
50
+ id: e.id,
51
+ description: e.name ?? e.description ?? "",
52
+ glCodeLabel: (e.ledger_account_id ? k.get(e.ledger_account_id) : void 0) || p.glCodeMissing,
53
+ quantityLabel: t ? p.quantityValue(n, t) : p.quantityOnlyValue(n),
54
+ amountLabel: b(a(e)) ?? ""
55
+ };
56
+ }), j = [
57
+ {
58
+ label: p.subtotalRow,
59
+ value: l.subtotal
60
+ },
61
+ {
62
+ label: p.discountsRow,
63
+ value: l.discount
64
+ },
65
+ {
66
+ label: p.taxRow,
67
+ value: l.tax_amount
68
+ }
69
+ ].map(({ label: e, value: t }) => ({
70
+ label: e,
71
+ value: b(t)
72
+ })).filter((e) => !!e.value), M = b(s(l));
73
+ M && j.push({
74
+ label: p.totalRow,
75
+ value: M,
76
+ emphasis: !0
77
+ });
78
+ let N = u(l);
79
+ return {
80
+ title: C,
81
+ subtitle: p.subtitle,
82
+ status: x.status,
83
+ statusTone: x.tone,
84
+ amountDueLabel: b(l.amount_due) ?? b(l.total_amount) ?? "",
85
+ amountPaidLabel: N ? b(l.amount_paid) : void 0,
86
+ paidOnLabel: N ? p.paidOnLabel(N) : void 0,
87
+ invoiceDateLabel: w,
88
+ dueDateLabel: T,
89
+ dueDateTone: x.isOverdue ? "danger" : "default",
90
+ payToItems: E,
91
+ invoiceItems: O,
92
+ lineItems: A,
93
+ totals: j,
94
+ rejection: g
95
+ };
96
+ }
97
+ function u(t) {
98
+ return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
5
99
  }
6
100
  //#endregion
7
- export { t as resolveLineItemQuantity };
101
+ export { u as getPaidAtLabel, l as mapPayableToBillDetails, s as resolveInvoiceTotalMinorUnits };
@@ -1,101 +1,86 @@
1
1
  import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index7.js";
3
- import { resolveVendor as n, resolveVendorName as r } from "./index8.js";
2
+ import { derivePayableStatus as t } from "./index10.js";
3
+ import { resolveVendor as n } from "./index12.js";
4
+ import { resolveAmountDueMinorUnits as r } from "./index20.js";
4
5
  import { formatBillMoney as i } from "./index2.js";
5
- import { resolveLineItemAmountMinorUnits as a } from "./index42.js";
6
- import { resolveLineItemQuantity as o } from "./index43.js";
6
+ import { resolveLineItemAmountMinorUnits as a } from "./index41.js";
7
+ import { resolveLineItemQuantity as o } from "./index42.js";
8
+ import { getPaidAtLabel as s, resolveInvoiceTotalMinorUnits as c } from "./index43.js";
7
9
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
8
- function s(e) {
9
- return e.total_amount ?? e.amount_due ?? void 0;
10
- }
11
- function c(e) {
12
- return typeof e == "string" ? e : "";
13
- }
14
- function l({ payable: l, lineItems: d, ledgerAccounts: f, labels: p, hasScheduledPayment: m, now: h, rejection: g, achInstructions: _, achInstructionsReadable: v = !1 }) {
15
- let y = l.currency, b = (e) => i(e, y), x = t({
10
+ function l({ payable: l, lineItems: u, glCodeOptions: d, glCodeRosterAvailable: f = !0, history: p, paymentHistory: m, approvalPolicy: h, labels: g, hasScheduledPayment: _, rejection: v, payableAchInstructions: y, payableAchInstructionsReadable: b = !1 }) {
11
+ let x = l.currency, S = t({
16
12
  apiStatus: l.status,
17
13
  dueDate: l.due_date,
18
14
  scheduledPaymentDate: l.scheduled_payment_date,
19
- hasScheduledPayment: m,
20
- now: h
21
- }), S = n(l), C = r(l), w = e(l.issued_at) || p.notProvided, T = e(l.due_date) || p.notProvided, E = [{
22
- label: p.vendorRow,
23
- value: C || p.notProvided,
24
- secondaryValue: S?.email ?? void 0
25
- }], D = v ? _?.account_number : void 0;
26
- D && E.push({
27
- label: p.bankAccountRow,
28
- value: p.bankAccountValue(D.slice(-4))
29
- });
30
- let O = [
15
+ hasScheduledPayment: _
16
+ }), C = n(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
31
17
  {
32
- label: p.invoiceNumberRow,
33
- value: l.document_id || p.notProvided
18
+ label: g.subtotalRow,
19
+ minorUnits: l.subtotal
34
20
  },
35
21
  {
36
- label: p.issueDateRow,
37
- value: w
22
+ label: g.discountRow,
23
+ minorUnits: l.discount
38
24
  },
39
25
  {
40
- label: p.dueDateRow,
41
- value: T
42
- },
43
- {
44
- label: p.poNumberRow,
45
- value: c(l.purchase_order_number) || p.notProvided
26
+ label: g.taxRow,
27
+ minorUnits: l.tax_amount
46
28
  }
47
- ], k = new Map(f.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), A = d.map((e) => {
48
- let t = b(e.unit_price), n = String(o(e));
49
- return {
50
- id: e.id,
51
- description: e.name ?? e.description ?? "",
52
- glCodeLabel: (e.ledger_account_id ? k.get(e.ledger_account_id) : void 0) || p.glCodeMissing,
53
- quantityLabel: t ? p.quantityValue(n, t) : p.quantityOnlyValue(n),
54
- amountLabel: b(a(e)) ?? ""
55
- };
56
- }), j = [
57
- {
58
- label: p.subtotalRow,
59
- value: l.subtotal
60
- },
61
- {
62
- label: p.discountsRow,
63
- value: l.discount
64
- },
65
- {
66
- label: p.taxRow,
67
- value: l.tax_amount
68
- }
69
- ].map(({ label: e, value: t }) => ({
70
- label: e,
71
- value: b(t)
72
- })).filter((e) => !!e.value), M = b(s(l));
73
- M && j.push({
74
- label: p.totalRow,
75
- value: M,
29
+ ].map((e) => ({
30
+ label: e.label,
31
+ value: i(e.minorUnits, x)
32
+ })).filter((e) => !!e.value), j = i(c(l), x);
33
+ j && A.push({
34
+ label: g.totalRow,
35
+ value: j,
76
36
  emphasis: !0
77
37
  });
78
- let N = u(l);
38
+ let M = s(l);
79
39
  return {
80
- title: C,
81
- subtitle: p.subtitle,
82
- status: x.status,
83
- statusTone: x.tone,
84
- amountDueLabel: b(l.amount_due) ?? b(l.total_amount) ?? "",
85
- amountPaidLabel: N ? b(l.amount_paid) : void 0,
86
- paidOnLabel: N ? p.paidOnLabel(N) : void 0,
87
- invoiceDateLabel: w,
88
- dueDateLabel: T,
89
- dueDateTone: x.isOverdue ? "danger" : "default",
90
- payToItems: E,
91
- invoiceItems: O,
92
- lineItems: A,
93
- totals: j,
94
- rejection: g
40
+ amountDue: i(r(l), x) ?? "",
41
+ amountPaid: M ? i(l.amount_paid, x) : void 0,
42
+ paidOnLabel: M ? g.paidOnLabel(M) : void 0,
43
+ invoiceDateLabel: D,
44
+ dueDateLabel: O,
45
+ dueDateTone: S.isOverdue ? "danger" : "default",
46
+ status: S.status,
47
+ statusTone: S.tone,
48
+ payTo: {
49
+ name: C?.name || g.notProvided,
50
+ email: C?.email ?? "",
51
+ methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
52
+ hasPaymentInstructions: E
53
+ },
54
+ invoiceFields: [
55
+ {
56
+ label: g.invoiceDateRow,
57
+ value: D
58
+ },
59
+ {
60
+ label: g.dueDateRow,
61
+ value: O
62
+ },
63
+ {
64
+ label: g.invoiceNumberRow,
65
+ value: l.document_id || g.notProvided
66
+ }
67
+ ],
68
+ lineItems: u.map((e) => {
69
+ let t = i(e.unit_price, x), n = String(o(e));
70
+ return {
71
+ id: e.id,
72
+ description: e.name ?? e.description ?? "",
73
+ glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
74
+ qtyPriceLabel: t ? g.qtyPriceValue(n, t) : g.qtyOnlyValue(n),
75
+ amount: i(a(e), x) ?? ""
76
+ };
77
+ }),
78
+ amountRows: A,
79
+ approvalPolicy: h,
80
+ paymentHistory: m,
81
+ history: p,
82
+ rejection: v
95
83
  };
96
84
  }
97
- function u(t) {
98
- return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
99
- }
100
85
  //#endregion
101
- export { u as getPaidAtLabel, l as mapPayableToBillDetails, s as resolveInvoiceTotalMinorUnits };
86
+ export { l as buildBillDetailView };
@@ -1,86 +1,6 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index7.js";
3
- import { resolveVendor as n } from "./index8.js";
4
- import { resolveAmountDueMinorUnits as r } from "./index21.js";
5
- import { formatBillMoney as i } from "./index2.js";
6
- import { resolveLineItemAmountMinorUnits as a } from "./index42.js";
7
- import { resolveLineItemQuantity as o } from "./index43.js";
8
- import { getPaidAtLabel as s, resolveInvoiceTotalMinorUnits as c } from "./index44.js";
9
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
10
- function l({ payable: l, lineItems: u, glCodeOptions: d, glCodeRosterAvailable: f = !0, history: p, paymentHistory: m, approvalPolicy: h, labels: g, hasScheduledPayment: _, rejection: v, payableAchInstructions: y, payableAchInstructionsReadable: b = !1 }) {
11
- let x = l.currency, S = t({
12
- apiStatus: l.status,
13
- dueDate: l.due_date,
14
- scheduledPaymentDate: l.scheduled_payment_date,
15
- hasScheduledPayment: _
16
- }), C = n(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
17
- {
18
- label: g.subtotalRow,
19
- minorUnits: l.subtotal
20
- },
21
- {
22
- label: g.discountRow,
23
- minorUnits: l.discount
24
- },
25
- {
26
- label: g.taxRow,
27
- minorUnits: l.tax_amount
28
- }
29
- ].map((e) => ({
30
- label: e.label,
31
- value: i(e.minorUnits, x)
32
- })).filter((e) => !!e.value), j = i(c(l), x);
33
- j && A.push({
34
- label: g.totalRow,
35
- value: j,
36
- emphasis: !0
37
- });
38
- let M = s(l);
39
- return {
40
- amountDue: i(r(l), x) ?? "",
41
- amountPaid: M ? i(l.amount_paid, x) : void 0,
42
- paidOnLabel: M ? g.paidOnLabel(M) : void 0,
43
- invoiceDateLabel: D,
44
- dueDateLabel: O,
45
- dueDateTone: S.isOverdue ? "danger" : "default",
46
- status: S.status,
47
- statusTone: S.tone,
48
- payTo: {
49
- name: C?.name || g.notProvided,
50
- email: C?.email ?? "",
51
- methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
52
- hasPaymentInstructions: E
53
- },
54
- invoiceFields: [
55
- {
56
- label: g.invoiceDateRow,
57
- value: D
58
- },
59
- {
60
- label: g.dueDateRow,
61
- value: O
62
- },
63
- {
64
- label: g.invoiceNumberRow,
65
- value: l.document_id || g.notProvided
66
- }
67
- ],
68
- lineItems: u.map((e) => {
69
- let t = i(e.unit_price, x), n = String(o(e));
70
- return {
71
- id: e.id,
72
- description: e.name ?? e.description ?? "",
73
- glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
74
- qtyPriceLabel: t ? g.qtyPriceValue(n, t) : g.qtyOnlyValue(n),
75
- amount: i(a(e), x) ?? ""
76
- };
77
- }),
78
- amountRows: A,
79
- approvalPolicy: h,
80
- paymentHistory: m,
81
- history: p,
82
- rejection: v
83
- };
2
+ function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
+ return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
84
4
  }
85
5
  //#endregion
86
- export { l as buildBillDetailView };
6
+ export { e as resolveEditorDismissal };
@@ -1,6 +1,146 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js
2
- function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
- return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
2
+ var e = {
3
+ edit: "Edit bill",
4
+ payBill: "Pay bill",
5
+ markAsPaid: "Mark as paid",
6
+ reject: "Reject",
7
+ approve: "Approve",
8
+ cancel: "Cancel bill",
9
+ cancelScheduledPayment: "Cancel scheduled payment",
10
+ reopen: "Reopen bill",
11
+ forceApprove: "Approve",
12
+ forceReject: "Reject",
13
+ policyOverridesHeading: "Policy overrides",
14
+ decisionDialog: {
15
+ reject: {
16
+ title: "Reject this bill?",
17
+ description: "The bill goes back as rejected and nobody else is asked to approve it.",
18
+ confirmButton: "Reject bill",
19
+ reason: {
20
+ label: "Reason",
21
+ placeholder: "Tell the submitter what needs to change"
22
+ }
23
+ },
24
+ cancel: {
25
+ title: "Cancel this bill?",
26
+ description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
27
+ confirmButton: "Cancel bill"
28
+ },
29
+ cancelScheduledPayment: {
30
+ title: "Cancel this scheduled payment?",
31
+ description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
32
+ confirmButton: "Cancel payment"
33
+ },
34
+ forceApprove: {
35
+ title: "Override approval policy?",
36
+ description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
37
+ confirmButton: "Override and approve",
38
+ noApprovalPolicy: {
39
+ title: "Approve this bill?",
40
+ description: "This bill has no approval policy applied. Approving now will be recorded in the audit history and can't be undone.",
41
+ confirmButton: "Approve bill"
42
+ }
43
+ },
44
+ forceReject: {
45
+ title: "Override approval policy?",
46
+ description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
47
+ confirmButton: "Override and reject",
48
+ noApprovalPolicy: {
49
+ title: "Reject this bill?",
50
+ description: "This bill has no approval policy applied. Rejecting now will be recorded in the audit history and can't be undone.",
51
+ confirmButton: "Reject bill"
52
+ }
53
+ },
54
+ cancelButton: "Cancel"
55
+ },
56
+ actionError: "Couldn't update this bill. Try again.",
57
+ actionSuccess: {
58
+ approve: "Bill approved.",
59
+ reject: "Bill rejected.",
60
+ markAsPaid: "Bill marked as paid.",
61
+ cancel: "Bill canceled.",
62
+ cancelScheduledPayment: "Scheduled payment canceled.",
63
+ reopen: "Bill reopened.",
64
+ forceApprove: "Bill approved, overriding the approval policy.",
65
+ forceReject: "Bill rejected, overriding the approval policy.",
66
+ forceApproveNoApprovalPolicy: "Bill approved.",
67
+ forceRejectNoApprovalPolicy: "Bill rejected."
68
+ }
69
+ }, t = {
70
+ today: "today",
71
+ tomorrow: "tomorrow"
72
+ }, n = (e) => `Payment scheduled for ${e}`, r = (e) => `Scheduled - ${e}`, i = (e) => `Awaiting approval from ${new Intl.ListFormat("en", {
73
+ style: "long",
74
+ type: "conjunction"
75
+ }).format(e)}.`, a = "Awaiting approval.", o = [
76
+ "reject",
77
+ "cancel",
78
+ "cancelScheduledPayment",
79
+ "forceApprove",
80
+ "forceReject"
81
+ ];
82
+ function s(e, t) {
83
+ let n = e.reason ? {
84
+ ...e.reason,
85
+ ...t?.reason
86
+ } : void 0, r = e.noApprovalPolicy ? {
87
+ ...e.noApprovalPolicy,
88
+ ...t?.noApprovalPolicy
89
+ } : void 0, i = {
90
+ ...e,
91
+ ...t,
92
+ reason: n,
93
+ noApprovalPolicy: r
94
+ };
95
+ return n || delete i.reason, r || delete i.noApprovalPolicy, i;
96
+ }
97
+ function c(e, t) {
98
+ let n = {
99
+ ...e,
100
+ ...t
101
+ };
102
+ for (let r of o) n[r] = s(e[r], t?.[r]);
103
+ return n;
104
+ }
105
+ function l(t) {
106
+ let n = e;
107
+ return {
108
+ ...n,
109
+ ...t,
110
+ decisionDialog: c(n.decisionDialog, t?.decisionDialog),
111
+ actionSuccess: {
112
+ ...n.actionSuccess,
113
+ ...t?.actionSuccess
114
+ }
115
+ };
116
+ }
117
+ var u = {
118
+ paymentHistorySentLabel: "Payment sent",
119
+ paymentHistoryScheduledLabel: "Payment scheduled",
120
+ paymentHistoryCanceledLabel: "Payment canceled",
121
+ paymentHistoryOtherLabel: "Payment",
122
+ paymentHistoryMethodSuffix: (e, t) => `${e} via ${t}`,
123
+ paymentHistoryOverpaidLabel: (e) => `+${e} overpaid`,
124
+ paymentHistoryMarkedPaidExternalLabel: "Marked as paid manually",
125
+ paymentHistoryMarkedPaidLabel: "Marked as paid",
126
+ paymentHistoryPartiallyPaidExternalLabel: "Partial payment marked manually",
127
+ paymentHistoryPartiallyPaidLabel: "Partial payment",
128
+ paymentHistoryRevertedLabel: "Payment reverted",
129
+ paymentHistoryMethodLabels: {
130
+ ach: "ACH",
131
+ us_ach: "ACH",
132
+ wire: "Wire",
133
+ check: "Check",
134
+ paper_check: "Check",
135
+ bank_account: "Bank transfer",
136
+ card: "Card"
137
+ }
138
+ };
139
+ function d(e) {
140
+ return {
141
+ ...u.paymentHistoryMethodLabels,
142
+ ...e
143
+ };
4
144
  }
5
145
  //#endregion
6
- export { e as resolveEditorDismissal };
146
+ export { i as AWAITING_APPROVAL_LABEL_EN, a as AWAITING_APPROVAL_UNKNOWN_LABEL_EN, e as BILL_DETAIL_ACTIONS_LABELS_EN, u as PAYMENT_HISTORY_LABELS_EN, t as SCHEDULED_RELATIVE_DAY_LABELS_EN, r as SCHEDULED_STATUS_BADGE_LABEL_EN, n as SCHEDULED_SUMMARY_LABEL_EN, l as mergeBillDetailActionsLabels, c as mergeDecisionDialogCopy, d as mergePaymentHistoryMethodLabels };