@tesouro/embedded-components-react 0.3.49 → 0.3.51

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 (144) hide show
  1. package/dist/index.css +8 -2
  2. package/dist/index.js +2 -2
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/lib/LinkedAccountsWidget.js +1 -1
  5. package/dist/libs/shared/util-validation/dist/{index22.js → index23.js} +1 -1
  6. package/dist/libs/shared/util-validation/dist/index7.js +6 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -10
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
  132. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js +95 -94
  133. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index.js +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index10.js +45 -0
  135. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index7.js +18 -55
  136. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index8.js +46 -265
  137. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +273 -34
  138. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
  139. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
  140. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
  141. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  142. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index11.js +1 -1
  143. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  144. package/package.json +1 -1
@@ -1,34 +1,168 @@
1
- import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index32.js";
2
- import { isPersistableLineItem as t, parseMoneyToMinorUnits as n, parseQuantity as r } from "./index39.js";
1
+ import { UNSAVED_BILL_DIALOG_LABELS_EN as e } from "../../ui/dist/index96.js";
2
+ import "../../ui/dist/index.js";
3
+ import { PAY_BILL_FLOW_LABELS_EN as t, mergePayBillFlowLabels as n } from "./index20.js";
4
+ import { MARK_AS_PAID_FLOW_LABELS_EN as r, mergeMarkAsPaidFlowLabels as i } from "./index12.js";
5
+ import "./index15.js";
6
+ import { APPROVAL_POLICY_RULE_COPY_EN as a } from "./index24.js";
7
+ import { BILL_DETAIL_ACTIONS_LABELS_EN as o, SCHEDULED_SUMMARY_LABEL_EN as s, mergeBillDetailActionsLabels as c } from "./index38.js";
8
+ import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as l } from "./index39.js";
3
9
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js
4
- var i = /^(?:\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:\.\d+)?|\.\d+)$/;
5
- function a(e) {
6
- let t = e.trim();
7
- return !t || n(t) !== null ? !0 : i.test(t) ? Number(t.replaceAll(",", "")) === 0 : !1;
8
- }
9
- function o(t, i = e) {
10
- let a = {};
11
- for (let e of t) {
12
- let t = n(e.price), o = n(e.amount), s = {};
13
- e.price.trim() && t === null && (s.price = i.unreadableMoney), e.amount.trim() && o === null && (s.amount = i.unreadableMoney), (t !== null || o !== null) && r(e.quantity) === null && (s.quantity = i.unusableQuantity), Object.keys(s).length && (a[e.id] = s);
10
+ var u = {
11
+ unmappedValidationError: (e, t) => `${e}: ${t}`,
12
+ unknownValidationField: "(unknown field)",
13
+ requiredField: "This field is required.",
14
+ saveFailed: "We could not save this bill. Try again.",
15
+ finalizeFailed: "We could not submit this bill. Try again.",
16
+ draftSaved: "Bill saved as a draft.",
17
+ submittedSaved: "Bill updated.",
18
+ submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
19
+ billFinalized: "Bill submitted for approval.",
20
+ unreadableMoney: "Enter a valid amount.",
21
+ unusableQuantity: "Enter a quantity greater than 0.",
22
+ lineItemsNeedAttention: "Check the highlighted line items before saving.",
23
+ totalsNeedAttention: "Enter valid amounts for discount, tax, and total."
24
+ }, d = {
25
+ achMethod: "via ACH bank transfer",
26
+ noMethod: "No payment method on file",
27
+ accountHolder: "Account holder",
28
+ routingNumber: "Routing number",
29
+ accountNumber: "Account number",
30
+ paymentMethodLoading: "Loading payment method...",
31
+ paymentMethodUnavailable: "We could not load payment methods. Try again.",
32
+ searchFailed: "We could not load vendors. Try again.",
33
+ vendorDetailsFailed: "We could not load this vendor. Try again."
34
+ }, f = {
35
+ attachFailed: "We could not attach that file. Try again.",
36
+ deleteFailed: "We could not remove that document. Try again.",
37
+ noDocument: "No document attached to this bill.",
38
+ pendingDeletionNotice: "This document will be removed when you save this bill.",
39
+ preview: l
40
+ }, p = {
41
+ notProvided: "Not provided",
42
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
43
+ invoiceDateRow: "Invoice date",
44
+ dueDateRow: "Due date",
45
+ invoiceNumberRow: "Invoice number",
46
+ glCodeMissing: "GL code not specified",
47
+ glCodeUnavailable: "GL code unavailable",
48
+ qtyPriceValue: (e, t) => `${e} x ${t}`,
49
+ subtotalRow: "Subtotal",
50
+ taxRow: "Tax",
51
+ discountRow: "Discounts",
52
+ totalRow: "Total",
53
+ paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
54
+ paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again."
55
+ }, m = {
56
+ dateLabel: (e) => new Date(e).toLocaleString("en-US", {
57
+ month: "short",
58
+ day: "numeric",
59
+ year: "numeric",
60
+ hour: "numeric",
61
+ minute: "2-digit"
62
+ }),
63
+ byActor: (e, t) => `${e} by ${t}`,
64
+ billAdded: "Bill added",
65
+ billUploaded: "Bill uploaded",
66
+ billUpdated: "Bill updated",
67
+ attachmentAdded: "Attachment added",
68
+ submittedForApproval: "Submitted for approval",
69
+ approvalRequested: "Approval requested",
70
+ approved: "Approved",
71
+ autoApproved: "Approved automatically",
72
+ rejected: "Rejected",
73
+ rejectedWithReason: (e) => `Rejected: ${e}`,
74
+ reopened: "Reopened",
75
+ markedAsPaid: "Marked as paid",
76
+ markedAsPartiallyPaid: "Marked as partially paid",
77
+ paymentReverted: "Payment reverted",
78
+ statusChanged: (e) => `Status changed to ${e}`
79
+ }, h = {
80
+ newTitle: "New bill",
81
+ extractedTitle: (e) => `Bill from ${e}`,
82
+ viewTitle: (e) => `Bill from ${e}`,
83
+ readOnlyTitle: "Bill details",
84
+ addedOn: (e) => `Added on ${e}`,
85
+ submittedSaveButton: "Save changes",
86
+ unsavedChanges: e,
87
+ scheduledSummary: s,
88
+ actions: o,
89
+ detail: p,
90
+ history: m,
91
+ payBill: t,
92
+ markAsPaid: r,
93
+ approvalPolicyCopy: a,
94
+ deleteDraft: {
95
+ menuItem: "Delete draft",
96
+ dialog: {
97
+ title: "Delete this draft?",
98
+ description: "The draft and anything entered on it are removed. This can't be undone.",
99
+ confirmButton: "Delete draft"
100
+ },
101
+ error: "Couldn't delete this draft. Try again."
102
+ },
103
+ lineItemsGlCodeUnavailable: {
104
+ loadError: "Couldn't load GL codes",
105
+ noAccess: "You don't have access to GL codes",
106
+ empty: "No GL codes set up yet"
14
107
  }
15
- return Object.keys(a).length ? a : void 0;
16
- }
17
- function s(i, a, o, s = e) {
18
- let c = {};
19
- a || (c.vendor = s.requiredField), i.invoiceNumber.trim() || (c.invoiceNumber = s.requiredField), i.invoiceDate.trim() || (c.invoiceDate = s.requiredField), i.dueDate.trim() || (c.dueDate = s.requiredField);
20
- let l = {};
21
- return o.forEach((e, i) => {
22
- if (i > 0 && !t(e)) return;
23
- let a = {};
24
- e.description.trim() || (a.description = s.requiredField), r(e.quantity) === null && (a.quantity = s.requiredField), n(e.price) === null && n(e.amount) === null && (a.price = s.requiredField, a.amount = s.requiredField), Object.keys(a).length && (l[e.id] = a);
25
- }), {
26
- formErrors: Object.keys(c).length ? c : void 0,
27
- lineItemErrors: Object.keys(l).length ? l : void 0
108
+ };
109
+ function g(e) {
110
+ return {
111
+ ...h,
112
+ ...e,
113
+ actions: c(e?.actions),
114
+ detail: {
115
+ ...h.detail,
116
+ ...e?.detail
117
+ },
118
+ history: {
119
+ ...h.history,
120
+ ...e?.history
121
+ },
122
+ payBill: n(e?.payBill),
123
+ markAsPaid: i(e?.markAsPaid),
124
+ lineItemsGlCodeUnavailable: {
125
+ ...h.lineItemsGlCodeUnavailable,
126
+ ...e?.lineItemsGlCodeUnavailable
127
+ },
128
+ unsavedChanges: {
129
+ ...h.unsavedChanges,
130
+ ...e?.unsavedChanges
131
+ },
132
+ approvalPolicyCopy: {
133
+ ...h.approvalPolicyCopy,
134
+ ...e?.approvalPolicyCopy
135
+ },
136
+ deleteDraft: {
137
+ ...h.deleteDraft,
138
+ ...e?.deleteDraft,
139
+ dialog: (() => {
140
+ let t = {
141
+ ...h.deleteDraft.dialog,
142
+ ...e?.deleteDraft?.dialog
143
+ };
144
+ return delete t.reason, t;
145
+ })()
146
+ }
28
147
  };
29
148
  }
30
- function c(t, r, i, o = e) {
31
- return !a(t) || !a(r) || i !== void 0 && n(i) === null ? { form: o.totalsNeedAttention } : void 0;
32
- }
149
+ var _ = {
150
+ createTitle: "New vendor",
151
+ editTitle: "Edit vendor",
152
+ close: "Close the vendor form",
153
+ nameLabel: "Name",
154
+ addAddress: "Add address (optional)",
155
+ paymentMethodsHeading: "Accepted payment methods",
156
+ paymentMethodsDescription: "How and where will the money be sent. Don't have these yet? No problem. You can save this vendor and add their payment details later — you just won't be able to send payments until you do.",
157
+ achTitle: "ACH bank transfer",
158
+ achDescription: "Fast, direct deposit to the vendor's bank. Arrives in 1–3 business days.",
159
+ addBankAccount: "Add bank account",
160
+ accountHolderNameLabel: "Account holder name",
161
+ routingNumberLabel: "Routing number",
162
+ accountNumberLabel: "Account number",
163
+ achHelp: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
164
+ cancel: "Cancel",
165
+ save: "Save vendor"
166
+ };
33
167
  //#endregion
34
- export { s as validateBillCompleteness, c as validateBillTotals, o as validateLineItems };
168
+ export { u as BILL_CREATE_MESSAGE_LABELS_EN, h as BILL_CREATE_SCREEN_LABELS_EN, p as BILL_DETAIL_VIEW_LABELS_EN, m as BILL_HISTORY_LABELS_EN, f as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, _ as VENDOR_INLINE_FORM_LABELS_EN, d as VENDOR_SECTION_PROPS_LABELS_EN, g as mergeBillCreateScreenCopy };
@@ -2,193 +2,79 @@
2
2
  "use client";
3
3
  "use client";
4
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 { useReplacePayableLineItemsMutation as t } from "../../data-access/dist/index8.js";
8
- import { useCreatePayableMutation as n, useDeletePayableFileMutation as r, useSubmitPayableForApprovalMutation as i, useUpdatePayableMutation as a, useValidatePayableMutation as o } from "../../data-access/dist/index11.js";
5
+ import { useAttachPayableFileMutation as e } from "../../data-access/dist/index12.js";
9
6
  import "../../data-access/dist/index.js";
10
- import { BILL_CREATE_MESSAGE_LABELS_EN as s } from "./index32.js";
11
- import { encodeFileToBase64 as c } from "./index38.js";
12
- import { mapBillFormToPayload as l, mapLineItemsToPayload as u } from "./index39.js";
13
- import { validateBillCompleteness as d, validateBillTotals as f, validateLineItems as p } from "./index40.js";
14
- import { useCallback as m, useRef as h, useState as g } from "react";
7
+ import { SourceDocumentPanel as t } from "../../ui/dist/index94.js";
8
+ import "../../ui/dist/index.js";
9
+ import { createSourceDocumentPreview as n } from "./index39.js";
10
+ import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index40.js";
11
+ import { useEffect as i, useState as a } from "react";
12
+ import { jsx as o } from "react/jsx-runtime";
15
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
16
- var _ = {
17
- document_id: "invoiceNumber",
18
- issued_at: "invoiceDate",
19
- due_date: "dueDate",
20
- counterpart_id: "vendor"
21
- };
22
- function v(e) {
23
- return e.type === "type_error.none.not_allowed" || e.msg === "none is not an allowed value";
24
- }
25
- function y(e, t = s) {
26
- let n = {}, r = [];
27
- for (let i of e) {
28
- let e = i.loc[0] ?? t.unknownValidationField, a = _[e], o = v(i) ? t.requiredField : i.msg;
29
- a ? n[a] = o : r.push(t.unmappedValidationError(e, o));
30
- }
31
- return r.length && (n.form = r.join(" ")), n;
32
- }
33
- function b(e, t) {
34
- if (!e && !t) return;
35
- let n = {}, r = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
36
- for (let i of r) n[i] = {
37
- ...e?.[i],
38
- ...t?.[i]
39
- };
40
- return n;
14
+ function s(e) {
15
+ let [t, n] = a();
16
+ return i(() => {
17
+ if (!e) {
18
+ n(void 0);
19
+ return;
20
+ }
21
+ let t = URL.createObjectURL(e);
22
+ return n(t), () => URL.revokeObjectURL(t);
23
+ }, [e]), t;
41
24
  }
42
- function x({ payableId: _, form: v, counterpartId: x, clearCounterpart: S, prepareVendorForSave: C, onSaved: w, onPayableCreated: T, readSavedStatus: E, onDraftSaved: D, onFinalized: O, labels: k }) {
43
- let A = {
44
- ...s,
45
- ...k
46
- }, [j, M] = g(), N = _ ?? j, [P, F] = g(), I = m(() => F(void 0), []), [L, R] = g(!1), z = m(() => R(!0), []), [B, V] = g(), H = h(!1), U = n(), W = r(), G = a(), K = t(), q = o(), J = i(), Y = m(() => v.isTotalsDirty ? f(v.discount, v.tax, v.totalOverride, A) : void 0, [v, A]), X = m(() => {
47
- let t = p(v.lineItems, A), n = Y();
48
- return v.setLineItemErrors(t), !t && !n || (t ? (v.setErrors(void 0), e.error(A.lineItemsNeedAttention)) : v.setErrors(n), !1);
49
- }, [
50
- v,
51
- A,
52
- Y
53
- ]), Z = m(async (e) => {
54
- let t = !N && P ? {
55
- base64EncodedFile: await c(P),
56
- fileName: P.name
57
- } : void 0, n = l({
58
- values: v.values,
59
- counterpartId: x,
60
- clearCounterpart: S,
61
- counterpartBankAccountId: e,
62
- editedTotals: v.isTotalsDirty ? {
63
- discount: v.discount,
64
- tax: v.tax,
65
- total: v.totalOverride
66
- } : void 0,
67
- document: t
68
- }), r = N;
69
- if (r ? await G.mutateAsync({
70
- path: { payable_id: r },
71
- body: n
72
- }) : (r = (await U.mutateAsync({ body: n }))?.id, r && (M(r), T?.(r), t && F(void 0))), !r) throw Error("Payable was created without an id");
73
- if (L) {
74
- try {
75
- await W.mutateAsync({ path: { payable_id: r } });
76
- } catch {}
77
- R(!1);
25
+ function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
26
+ let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
27
+ ...r,
28
+ ...p,
29
+ preview: {
30
+ ...r.preview,
31
+ ...p?.preview
78
32
  }
79
- return await K.mutateAsync({
80
- path: { payable_id: r },
81
- body: { data: u(v.lineItems) }
82
- }), r;
83
- }, [
84
- x,
85
- S,
86
- U,
87
- W,
88
- L,
89
- v.discount,
90
- v.isTotalsDirty,
91
- v.lineItems,
92
- v.tax,
93
- v.totalOverride,
94
- v.values,
95
- T,
96
- N,
97
- K,
98
- P,
99
- G
100
- ]), Q = m(async () => {
101
- N && (await W.mutateAsync({ path: { payable_id: N } }), R(!1));
102
- }, [W, N]);
103
- return {
104
- saveDraft: m(async () => {
105
- if (!H.current && X()) {
106
- H.current = !0, V("draft");
107
- try {
108
- let t = await C?.();
109
- if (t && !t.ok) return;
110
- let n = await Z(t?.counterpartBankAccountId);
111
- v.setErrors(void 0), w?.(n), D?.(n);
112
- let r = await E?.();
113
- return e.success(r === "draft" ? A.submittedDemoted : A.draftSaved), n;
114
- } catch {
115
- v.setErrors({ form: A.saveFailed });
116
- return;
117
- } finally {
118
- V(void 0), H.current = !1;
119
- }
120
- }
121
- }, [
122
- v,
123
- X,
124
- A.draftSaved,
125
- A.saveFailed,
126
- A.submittedDemoted,
127
- D,
128
- w,
129
- E,
130
- C,
131
- Z
132
- ]),
133
- finalize: m(async () => {
134
- if (H.current) return;
135
- let t = p(v.lineItems, A), n = Y(), { formErrors: r, lineItemErrors: i } = d(v.values, x, v.lineItems, A), a = b(i, t);
136
- v.setLineItemErrors(a);
137
- let o = {
138
- ...r,
139
- ...n
140
- };
141
- if (v.setErrors(Object.keys(o).length ? o : void 0), t && e.error(A.lineItemsNeedAttention), !(a || Object.keys(o).length)) {
142
- H.current = !0, V("finalize");
143
- try {
144
- let t;
145
- try {
146
- let e = await C?.();
147
- if (e && !e.ok) return;
148
- t = await Z(e?.counterpartBankAccountId);
149
- } catch {
150
- v.setErrors({ form: A.saveFailed });
33
+ }, w = e(), T = s(m), E = !!(a && !v || m);
34
+ if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
+ mode: "loading",
36
+ fileName: l
37
+ });
38
+ if (!E && u) return /* @__PURE__ */ o("div", {
39
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
40
+ children: C.noDocument
41
+ });
42
+ if (!E) return /* @__PURE__ */ o(t, {
43
+ mode: "upload",
44
+ uploadStatus: w.isPending || x ? "uploading" : "idle",
45
+ uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
46
+ noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
47
+ onFilesSelected: (e) => {
48
+ let [t] = e;
49
+ if (t) {
50
+ if (i) {
51
+ let e = () => w.mutate({
52
+ path: { payable_id: i },
53
+ file: t
54
+ });
55
+ if (v && b) {
56
+ b().then(e, () => void 0);
151
57
  return;
152
58
  }
153
- w?.(t);
154
- try {
155
- let n = await q.mutateAsync({ path: { payable_id: t } });
156
- if (n.validation_errors.length) {
157
- v.setErrors(y(n.validation_errors, A));
158
- return;
159
- }
160
- await J.mutateAsync({ path: { payable_id: t } }), v.setErrors(void 0), O?.(t), e.success(A.billFinalized);
161
- } catch {
162
- v.setErrors({ form: A.finalizeFailed });
163
- }
164
- } finally {
165
- V(void 0), H.current = !1;
166
- }
59
+ e();
60
+ } else h?.(t);
167
61
  }
168
- }, [
169
- x,
170
- v,
171
- A,
172
- O,
173
- w,
174
- C,
175
- Z,
176
- J,
177
- Y,
178
- q
179
- ]),
180
- payableId: N,
181
- isSavingDraft: B === "draft",
182
- isFinalizing: B === "finalize",
183
- stagedFile: P,
184
- stageFile: F,
185
- clearStagedFile: I,
186
- isFileDeletionPending: L,
187
- requestFileDeletion: z,
188
- detachFileNow: Q,
189
- isDeletingFile: W.isPending,
190
- hasFileDeletionFailed: W.isError
191
- };
62
+ }
63
+ });
64
+ let D = a?.name ?? m?.name ?? "", O = n(a || {
65
+ name: D,
66
+ url: T ?? "",
67
+ mimetype: m?.type ?? ""
68
+ }, C.preview);
69
+ return /* @__PURE__ */ o(t, {
70
+ mode: "document",
71
+ fileName: D,
72
+ preview: O,
73
+ isDeleting: x,
74
+ deleteErrorMessage: S ? C.deleteFailed : void 0,
75
+ onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
76
+ onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
77
+ });
192
78
  }
193
79
  //#endregion
194
- export { y as mapValidationErrorsToForm, x as useBillCreateController };
80
+ export { c as SourceDocumentContainer, c as default };
@@ -1,38 +1,26 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
2
- function e() {
3
- return {
4
- id: crypto.randomUUID(),
5
- description: "",
6
- glCode: "",
7
- quantity: "1",
8
- price: "",
9
- amount: ""
10
- };
2
+ function e(e) {
3
+ return e?.trim() ?? "";
11
4
  }
12
- function t(e) {
13
- return typeof e == "number" ? (e / 100).toFixed(2) : "";
5
+ function t(t) {
6
+ let n = e(t);
7
+ return n.length === 2 ? n.toUpperCase() : "";
14
8
  }
15
- function n({ payable: n, lineItems: r }) {
16
- let i = {
17
- invoiceNumber: n.document_id ?? "",
18
- invoiceDate: n.issued_at ?? "",
19
- dueDate: n.due_date ?? "",
20
- poNumber: ""
21
- }, a = r.map((e) => ({
22
- id: e.id,
23
- description: e.name ?? "",
24
- glCode: e.ledger_account_id ?? "",
25
- quantity: e.quantity == null ? "" : String(e.quantity),
26
- price: t(e.unit_price),
27
- amount: t(e.subtotal)
28
- }));
29
- return {
30
- values: i,
31
- lineItems: a.length ? a : [e()],
32
- discount: t(n.discount),
33
- tax: t(n.tax_amount),
34
- total: n.total_amount ? t(n.total_amount) : ""
9
+ function n(n) {
10
+ if (!n) return;
11
+ let r = {
12
+ legalName: e(n.name),
13
+ email: e(n.email),
14
+ phone: e(n.phone),
15
+ address: {
16
+ line1: e(n.address?.line1),
17
+ line2: e(n.address?.line2),
18
+ city: e(n.address?.city),
19
+ state: t(n.address?.state),
20
+ postalCode: e(n.address?.postal_code)
21
+ }
35
22
  };
23
+ return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
36
24
  }
37
25
  //#endregion
38
- export { e as emptyLineItem, n as mapPayableToBillForm };
26
+ export { n as buildVendorPrefill };