@tesouro/embedded-components-react 0.11.179 → 0.11.181

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 (108) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  100. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  101. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  102. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
  107. package/package.json +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
@@ -1,201 +1,118 @@
1
- import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
2
- import { BILL_DUE_DATE_LABELS_EN as l } from "../../../util/dist/lib/resolveBillDueDate.js";
3
- import "../../../util/dist/index.js";
4
- import { APPROVAL_POLICY_RULE_COPY_EN as u } from "./index9.js";
5
- import { PAYABLE_AUDIT_HISTORY_LABELS_EN as d } from "./index29.js";
6
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as f } from "./index30.js";
7
- import { ACH_FIELD_GROUP_LABELS_EN as p } from "../../../../shared/counterpart-management/ui/dist/index2.js";
8
- import "../../../../shared/counterpart-management/ui/dist/index.js";
9
- import { BILL_REJECTED_BANNER_LABELS_EN as m } from "../../ui/dist/index39.js";
10
- import { DISCARD_CHANGES_DIALOG_LABELS_EN as h } from "../../ui/dist/index42.js";
11
- import { UNSAVED_BILL_DIALOG_LABELS_EN as g } from "../../ui/dist/index51.js";
12
- import "../../ui/dist/index.js";
1
+ import { resolvePdfWorkerSrc as e } from "../../../../shared/util/dist/lib/pdfWorkerSrc.js";
2
+ import "../../../../shared/util/dist/index.js";
3
+ import { useEffect as t, useRef as n, useState as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import "react-pdf/dist/Page/TextLayer.css";
13
6
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js
14
- var _ = {
15
- unmappedValidationError: (e, t) => `${e}: ${t}`,
16
- unknownValidationField: "(unknown field)",
17
- requiredField: "This field is required.",
18
- saveFailed: "We could not save this bill. Try again.",
19
- saveRejected: (e) => `We could not save this bill. ${e}`,
20
- discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
21
- vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
22
- finalizeFailed: "We could not submit this bill. Try again.",
23
- draftSaved: "Bill saved as a draft.",
24
- submittedSaved: "Bill updated.",
25
- submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
26
- billFinalized: "Bill submitted for approval.",
27
- numbersOnly: "Enter numbers only.",
28
- unreadableMoney: "Enter a valid amount.",
29
- unusableQuantity: "Enter a quantity greater than 0.",
30
- lineItemsNeedAttention: "Check the highlighted line items before saving.",
31
- unreadableDiscount: "Enter a valid discount amount.",
32
- unreadableTax: "Enter a valid tax amount.",
33
- unreadableTotal: "Enter a valid total amount.",
34
- totalNotGreaterThanZero: "Total amount must be greater than $0.",
35
- poNumberTooLong: "PO number must be 255 characters or fewer.",
36
- implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
37
- implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
38
- dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
39
- }, v = {
40
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
41
- noMethod: "No payment method on file",
42
- paymentMethodLoading: "Loading payment method...",
43
- paymentMethodUnavailable: "We could not load payment methods. Try again.",
44
- searchFailed: "We could not load vendors. Try again.",
45
- vendorDetailsFailed: "We could not load this vendor. Try again.",
46
- pendingVendorDescription: "Will be created when submitted",
47
- pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
48
- bankAccountSaveFailed: "We could not save these payment instructions. Try again."
49
- }, y = {
50
- attachFailed: "We could not attach that file. Try again.",
51
- deleteFailed: "We could not remove that document. Try again.",
52
- noDocument: "No document attached to this bill.",
53
- pendingDeletionNotice: "This document will be removed when you save this bill.",
54
- preview: f
55
- }, b = {
56
- ...r,
57
- notProvided: "Not provided",
58
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
59
- paymentInstructionsNotSet: "Not set",
60
- invoiceDateRow: "Invoice date",
61
- dueDateRow: "Due date",
62
- invoiceNumberRow: "Invoice number",
63
- glCodeMissing: "GL code not specified",
64
- glCodeUnavailable: "GL code unavailable",
65
- qtyPriceValue: (e, t) => `${e} x ${t}`,
66
- qtyOnlyValue: (e) => e,
67
- subtotalRow: "Subtotal",
68
- taxRow: "Tax",
69
- discountRow: "Discounts",
70
- totalRow: "Total",
71
- paidOnLabel: (e) => `Paid on ${e}`,
72
- paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
73
- paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
74
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
75
- rejectedOn: (e) => `Rejected on ${e}`,
76
- rejectionMessage: (e) => `"${e}"`
77
- }, x = {
78
- newTitle: "New bill",
79
- extractedTitle: (e) => `Bill from ${e}`,
80
- viewTitle: (e) => `Bill from ${e}`,
81
- readOnlyTitle: "Bill details",
82
- addedOn: (e) => `Added on ${e}`,
83
- unsavedChanges: g,
84
- discardChanges: h,
85
- scheduledRelativeDay: i,
86
- dueDate: l,
87
- scheduledSummary: o,
88
- scheduledStatusBadge: a,
89
- awaitingApprovalNotice: e,
90
- awaitingApprovalUnknownNotice: t,
91
- actions: n,
92
- detail: b,
93
- history: d,
94
- approvalPolicyCopy: u,
95
- deleteDraft: {
96
- menuItem: "Delete draft",
97
- dialog: {
98
- title: "Delete this draft?",
99
- description: "The draft and anything entered on it are removed. This can't be undone.",
100
- confirmButton: "Delete draft"
101
- },
102
- error: "Couldn't delete this draft. Try again."
103
- },
104
- lineItemsGlCodeUnavailable: {
105
- loadError: "Couldn't load GL codes",
106
- noAccess: "You don't have access to GL codes",
107
- empty: "No GL codes set up yet"
108
- },
109
- rejectedBanner: m
110
- };
111
- function S(e) {
112
- return {
113
- ...x,
114
- ...e,
115
- actions: s(e?.actions),
116
- detail: {
117
- ...x.detail,
118
- ...e?.detail,
119
- paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
120
- },
121
- history: {
122
- ...x.history,
123
- ...e?.history
124
- },
125
- lineItemsGlCodeUnavailable: {
126
- ...x.lineItemsGlCodeUnavailable,
127
- ...e?.lineItemsGlCodeUnavailable
128
- },
129
- unsavedChanges: {
130
- ...x.unsavedChanges,
131
- ...e?.unsavedChanges
132
- },
133
- discardChanges: {
134
- ...x.discardChanges,
135
- ...e?.discardChanges
136
- },
137
- rejectedBanner: {
138
- ...x.rejectedBanner,
139
- ...e?.rejectedBanner
140
- },
141
- approvalPolicyCopy: {
142
- ...x.approvalPolicyCopy,
143
- ...e?.approvalPolicyCopy
144
- },
145
- scheduledRelativeDay: {
146
- ...x.scheduledRelativeDay,
147
- ...e?.scheduledRelativeDay
148
- },
149
- dueDate: {
150
- ...x.dueDate,
151
- ...e?.dueDate
152
- },
153
- deleteDraft: {
154
- ...x.deleteDraft,
155
- ...e?.deleteDraft,
156
- dialog: (() => {
157
- let t = {
158
- ...x.deleteDraft.dialog,
159
- ...e?.deleteDraft?.dialog
160
- };
161
- return delete t.reason, t;
162
- })()
163
- }
164
- };
7
+ var o = {
8
+ previewUnavailable: "Preview not available for this file type.",
9
+ openFile: "Open file"
10
+ }, s = 720, c = 280, l = 1.3;
11
+ function u(e) {
12
+ return (e.trim().split(/\s+/)[0] ?? "").split("#")[0] ?? e;
13
+ }
14
+ function d({ url: e, labels: t }) {
15
+ return /* @__PURE__ */ a("div", {
16
+ className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
17
+ children: [/* @__PURE__ */ i("p", {
18
+ className: "ttw:text-sm ttw:text-muted-foreground",
19
+ children: t.previewUnavailable
20
+ }), /* @__PURE__ */ i("a", {
21
+ href: e,
22
+ target: "_blank",
23
+ rel: "noreferrer",
24
+ className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
25
+ children: t.openFile
26
+ })]
27
+ });
28
+ }
29
+ function f({ url: a, labels: o }) {
30
+ let f = n(null), p = n(/* @__PURE__ */ new Map()), [m, h] = r(0), [g, _] = r(s), [v, y] = r(null), [b, x] = r(!1), [S, C] = r(() => /* @__PURE__ */ new Set([1]));
31
+ if (t(() => {
32
+ let t = !0;
33
+ return import("react-pdf").then(({ Document: n, Page: r, pdfjs: i }) => {
34
+ t && (i.GlobalWorkerOptions.workerSrc = e(i.version), y({
35
+ Document: n,
36
+ Page: r
37
+ }));
38
+ }).catch(() => {
39
+ t && x(!0);
40
+ }), () => {
41
+ t = !1;
42
+ };
43
+ }, []), t(() => {
44
+ if (!v) return;
45
+ let e = f.current;
46
+ if (!e) return;
47
+ let t = () => {
48
+ let t = e.clientWidth;
49
+ t && _(Math.max(c, Math.min(t, s)));
50
+ };
51
+ if (t(), typeof ResizeObserver > "u") return;
52
+ let n = new ResizeObserver(t);
53
+ return n.observe(e), () => n.disconnect();
54
+ }, [v]), t(() => {
55
+ C(/* @__PURE__ */ new Set([1]));
56
+ }, [a]), t(() => {
57
+ let e = f.current;
58
+ if (!e || !m || typeof IntersectionObserver > "u") return;
59
+ let t = new IntersectionObserver((e) => {
60
+ let t = e.filter((e) => e.isIntersecting).map((e) => Number(e.target.getAttribute("data-page-number"))).filter((e) => e >= 1);
61
+ t.length && C((e) => {
62
+ let n = new Set(e);
63
+ return t.forEach((e) => n.add(e)), n.size === e.size ? e : n;
64
+ });
65
+ }, {
66
+ root: e,
67
+ rootMargin: "600px 0px"
68
+ });
69
+ return p.current.forEach((e) => t.observe(e)), () => t.disconnect();
70
+ }, [m, g]), b) return /* @__PURE__ */ i(d, {
71
+ url: a,
72
+ labels: o
73
+ });
74
+ if (!v) return null;
75
+ let { Document: w, Page: T } = v;
76
+ return /* @__PURE__ */ i("div", {
77
+ ref: f,
78
+ className: "ttw:flex ttw:h-full ttw:w-full ttw:justify-center ttw:overflow-auto ttw:bg-white",
79
+ children: /* @__PURE__ */ i(w, {
80
+ suspense: !1,
81
+ file: u(a),
82
+ onLoadSuccess: ({ numPages: e }) => h(e),
83
+ children: Array.from({ length: m }, (e, t) => {
84
+ let n = t + 1;
85
+ return /* @__PURE__ */ i("div", {
86
+ ref: (e) => {
87
+ e ? p.current.set(n, e) : p.current.delete(n);
88
+ },
89
+ "data-page-number": n,
90
+ style: { minHeight: S.has(n) ? void 0 : Math.round(g * l) },
91
+ children: S.has(n) ? /* @__PURE__ */ i(T, {
92
+ pageNumber: n,
93
+ width: g,
94
+ renderAnnotationLayer: !1
95
+ }) : null
96
+ }, n);
97
+ })
98
+ })
99
+ });
165
100
  }
166
- var C = {
167
- createTitle: "New vendor details",
168
- editTitle: "Edit vendor",
169
- switchVendorFieldLabel: "Switch to a different vendor",
170
- vendorFieldLabel: "Vendor",
171
- newVendorBadge: "New vendor",
172
- unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
173
- resultsHeading: "Your vendors",
174
- addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
175
- addAsNewVendorDescription: "Uses the details extracted from this bill",
176
- fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
177
- nameLabel: "Business name",
178
- cancel: "Cancel",
179
- save: "Save",
180
- cancelAriaLabel: "Cancel vendor",
181
- saveAriaLabel: "Save vendor",
182
- paymentInstructionsHeading: "Payment instructions",
183
- paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
184
- paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
185
- ach: p
186
- };
187
- function w(e) {
188
- return {
189
- ...C,
190
- ...e,
191
- ach: {
192
- ...C.ach,
193
- ...e?.ach,
194
- fieldMarkers: {
195
- ...C.ach.fieldMarkers,
196
- ...e?.ach?.fieldMarkers
197
- }
198
- }
101
+ function p(e, t = {}) {
102
+ let n = {
103
+ ...o,
104
+ ...t
199
105
  };
106
+ return e.mimetype === "application/pdf" ? /* @__PURE__ */ i(f, {
107
+ url: e.url,
108
+ labels: n
109
+ }) : e.mimetype.startsWith("image/") ? /* @__PURE__ */ i("img", {
110
+ src: e.url,
111
+ alt: e.name,
112
+ className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
113
+ }) : /* @__PURE__ */ i(d, {
114
+ url: e.url,
115
+ labels: n
116
+ });
200
117
  }
201
- export { _ as BILL_CREATE_MESSAGE_LABELS_EN, b as BILL_DETAIL_VIEW_LABELS_EN, x as BILL_DIALOG_COPY_EN, y as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, C as VENDOR_INLINE_FORM_LABELS_EN, v as VENDOR_SECTION_PROPS_LABELS_EN, S as mergeBillDialogCopy, w as mergeVendorInlineFormLabels };
118
+ export { o as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, p as createSourceDocumentPreview };
@@ -1,82 +1,201 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { createSourceDocumentPreview as e } from "./index30.js";
6
- import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
1
+ import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
2
+ import { BILL_DUE_DATE_LABELS_EN as l } from "../../../util/dist/lib/resolveBillDueDate.js";
3
+ import "../../../util/dist/index.js";
4
+ import { APPROVAL_POLICY_RULE_COPY_EN as u } from "./index10.js";
5
+ import { PAYABLE_AUDIT_HISTORY_LABELS_EN as d } from "./index30.js";
6
+ import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as f } from "./index31.js";
7
+ import { ACH_FIELD_GROUP_LABELS_EN as p } from "../../../../shared/counterpart-management/ui/dist/index2.js";
8
+ import "../../../../shared/counterpart-management/ui/dist/index.js";
9
+ import { BILL_REJECTED_BANNER_LABELS_EN as m } from "../../ui/dist/index39.js";
10
+ import { DISCARD_CHANGES_DIALOG_LABELS_EN as h } from "../../ui/dist/index42.js";
11
+ import { UNSAVED_BILL_DIALOG_LABELS_EN as g } from "../../ui/dist/index51.js";
7
12
  import "../../ui/dist/index.js";
8
- import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index31.js";
9
- import { useAttachPayableFileMutation as r } from "../../data-access/dist/index6.js";
10
- import "../../data-access/dist/index.js";
11
- import { useEffect as i, useState as a } from "react";
12
- import { jsx as o } from "react/jsx-runtime";
13
13
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js
14
- function s(e) {
15
- let [t, n] = a();
16
- return i(() => {
17
- if (!e) {
18
- n(void 0);
19
- return;
14
+ var _ = {
15
+ unmappedValidationError: (e, t) => `${e}: ${t}`,
16
+ unknownValidationField: "(unknown field)",
17
+ requiredField: "This field is required.",
18
+ saveFailed: "We could not save this bill. Try again.",
19
+ saveRejected: (e) => `We could not save this bill. ${e}`,
20
+ discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
21
+ vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
22
+ finalizeFailed: "We could not submit this bill. Try again.",
23
+ draftSaved: "Bill saved as a draft.",
24
+ submittedSaved: "Bill updated.",
25
+ submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
26
+ billFinalized: "Bill submitted for approval.",
27
+ numbersOnly: "Enter numbers only.",
28
+ unreadableMoney: "Enter a valid amount.",
29
+ unusableQuantity: "Enter a quantity greater than 0.",
30
+ lineItemsNeedAttention: "Check the highlighted line items before saving.",
31
+ unreadableDiscount: "Enter a valid discount amount.",
32
+ unreadableTax: "Enter a valid tax amount.",
33
+ unreadableTotal: "Enter a valid total amount.",
34
+ totalNotGreaterThanZero: "Total amount must be greater than $0.",
35
+ poNumberTooLong: "PO number must be 255 characters or fewer.",
36
+ implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
37
+ implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
38
+ dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
39
+ }, v = {
40
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
41
+ noMethod: "No payment method on file",
42
+ paymentMethodLoading: "Loading payment method...",
43
+ paymentMethodUnavailable: "We could not load payment methods. Try again.",
44
+ searchFailed: "We could not load vendors. Try again.",
45
+ vendorDetailsFailed: "We could not load this vendor. Try again.",
46
+ pendingVendorDescription: "Will be created when submitted",
47
+ pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
48
+ bankAccountSaveFailed: "We could not save these payment instructions. Try again."
49
+ }, y = {
50
+ attachFailed: "We could not attach that file. Try again.",
51
+ deleteFailed: "We could not remove that document. Try again.",
52
+ noDocument: "No document attached to this bill.",
53
+ pendingDeletionNotice: "This document will be removed when you save this bill.",
54
+ preview: f
55
+ }, b = {
56
+ ...r,
57
+ notProvided: "Not provided",
58
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
59
+ paymentInstructionsNotSet: "Not set",
60
+ invoiceDateRow: "Invoice date",
61
+ dueDateRow: "Due date",
62
+ invoiceNumberRow: "Invoice number",
63
+ glCodeMissing: "GL code not specified",
64
+ glCodeUnavailable: "GL code unavailable",
65
+ qtyPriceValue: (e, t) => `${e} x ${t}`,
66
+ qtyOnlyValue: (e) => e,
67
+ subtotalRow: "Subtotal",
68
+ taxRow: "Tax",
69
+ discountRow: "Discounts",
70
+ totalRow: "Total",
71
+ paidOnLabel: (e) => `Paid on ${e}`,
72
+ paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
73
+ paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
74
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
75
+ rejectedOn: (e) => `Rejected on ${e}`,
76
+ rejectionMessage: (e) => `"${e}"`
77
+ }, x = {
78
+ newTitle: "New bill",
79
+ extractedTitle: (e) => `Bill from ${e}`,
80
+ viewTitle: (e) => `Bill from ${e}`,
81
+ readOnlyTitle: "Bill details",
82
+ addedOn: (e) => `Added on ${e}`,
83
+ unsavedChanges: g,
84
+ discardChanges: h,
85
+ scheduledRelativeDay: i,
86
+ dueDate: l,
87
+ scheduledSummary: o,
88
+ scheduledStatusBadge: a,
89
+ awaitingApprovalNotice: e,
90
+ awaitingApprovalUnknownNotice: t,
91
+ actions: n,
92
+ detail: b,
93
+ history: d,
94
+ approvalPolicyCopy: u,
95
+ deleteDraft: {
96
+ menuItem: "Delete draft",
97
+ dialog: {
98
+ title: "Delete this draft?",
99
+ description: "The draft and anything entered on it are removed. This can't be undone.",
100
+ confirmButton: "Delete draft"
101
+ },
102
+ error: "Couldn't delete this draft. Try again."
103
+ },
104
+ lineItemsGlCodeUnavailable: {
105
+ loadError: "Couldn't load GL codes",
106
+ noAccess: "You don't have access to GL codes",
107
+ empty: "No GL codes set up yet"
108
+ },
109
+ rejectedBanner: m
110
+ };
111
+ function S(e) {
112
+ return {
113
+ ...x,
114
+ ...e,
115
+ actions: s(e?.actions),
116
+ detail: {
117
+ ...x.detail,
118
+ ...e?.detail,
119
+ paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
120
+ },
121
+ history: {
122
+ ...x.history,
123
+ ...e?.history
124
+ },
125
+ lineItemsGlCodeUnavailable: {
126
+ ...x.lineItemsGlCodeUnavailable,
127
+ ...e?.lineItemsGlCodeUnavailable
128
+ },
129
+ unsavedChanges: {
130
+ ...x.unsavedChanges,
131
+ ...e?.unsavedChanges
132
+ },
133
+ discardChanges: {
134
+ ...x.discardChanges,
135
+ ...e?.discardChanges
136
+ },
137
+ rejectedBanner: {
138
+ ...x.rejectedBanner,
139
+ ...e?.rejectedBanner
140
+ },
141
+ approvalPolicyCopy: {
142
+ ...x.approvalPolicyCopy,
143
+ ...e?.approvalPolicyCopy
144
+ },
145
+ scheduledRelativeDay: {
146
+ ...x.scheduledRelativeDay,
147
+ ...e?.scheduledRelativeDay
148
+ },
149
+ dueDate: {
150
+ ...x.dueDate,
151
+ ...e?.dueDate
152
+ },
153
+ deleteDraft: {
154
+ ...x.deleteDraft,
155
+ ...e?.deleteDraft,
156
+ dialog: (() => {
157
+ let t = {
158
+ ...x.deleteDraft.dialog,
159
+ ...e?.deleteDraft?.dialog
160
+ };
161
+ return delete t.reason, t;
162
+ })()
20
163
  }
21
- let t = URL.createObjectURL(e);
22
- return n(t), () => URL.revokeObjectURL(t);
23
- }, [e]), t;
164
+ };
24
165
  }
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
- ...n,
28
- ...p,
29
- preview: {
30
- ...n.preview,
31
- ...p?.preview
32
- }
33
- }, w = r(), T = s(m), E = !!(a && !v || m);
34
- if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
- mode: "loading",
36
- fileName: l,
37
- labels: p?.panel
38
- });
39
- if (!E && u) return /* @__PURE__ */ o("div", {
40
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
41
- children: C.noDocument
42
- });
43
- if (!E) return /* @__PURE__ */ o(t, {
44
- mode: "upload",
45
- labels: p?.panel,
46
- uploadStatus: w.isPending || x ? "uploading" : "idle",
47
- uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
48
- noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
49
- onFilesSelected: (e) => {
50
- let [t] = e;
51
- if (t) {
52
- if (i) {
53
- let e = () => w.mutate({
54
- path: { payable_id: i },
55
- file: t
56
- });
57
- if (v && b) {
58
- b().then(e, () => void 0);
59
- return;
60
- }
61
- e();
62
- } else h?.(t);
166
+ var C = {
167
+ createTitle: "New vendor details",
168
+ editTitle: "Edit vendor",
169
+ switchVendorFieldLabel: "Switch to a different vendor",
170
+ vendorFieldLabel: "Vendor",
171
+ newVendorBadge: "New vendor",
172
+ unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
173
+ resultsHeading: "Your vendors",
174
+ addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
175
+ addAsNewVendorDescription: "Uses the details extracted from this bill",
176
+ fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
177
+ nameLabel: "Business name",
178
+ cancel: "Cancel",
179
+ save: "Save",
180
+ cancelAriaLabel: "Cancel vendor",
181
+ saveAriaLabel: "Save vendor",
182
+ paymentInstructionsHeading: "Payment instructions",
183
+ paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
184
+ paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
185
+ ach: p
186
+ };
187
+ function w(e) {
188
+ return {
189
+ ...C,
190
+ ...e,
191
+ ach: {
192
+ ...C.ach,
193
+ ...e?.ach,
194
+ fieldMarkers: {
195
+ ...C.ach.fieldMarkers,
196
+ ...e?.ach?.fieldMarkers
63
197
  }
64
198
  }
65
- });
66
- let D = a?.name ?? m?.name ?? "", O = e(a || {
67
- name: D,
68
- url: T ?? "",
69
- mimetype: m?.type ?? ""
70
- }, C.preview);
71
- return /* @__PURE__ */ o(t, {
72
- mode: "document",
73
- labels: p?.panel,
74
- fileName: D,
75
- preview: O,
76
- isDeleting: x,
77
- deleteErrorMessage: S ? C.deleteFailed : void 0,
78
- onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
79
- onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
80
- });
199
+ };
81
200
  }
82
- export { c as SourceDocumentContainer, c as default };
201
+ export { _ as BILL_CREATE_MESSAGE_LABELS_EN, b as BILL_DETAIL_VIEW_LABELS_EN, x as BILL_DIALOG_COPY_EN, y as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, C as VENDOR_INLINE_FORM_LABELS_EN, v as VENDOR_SECTION_PROPS_LABELS_EN, S as mergeBillDialogCopy, w as mergeVendorInlineFormLabels };