@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,586 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import { useAllLedgerAccountsQuery as r } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import "../../../shared/ui/dist/index.js";
11
- import { formatCalendarDate as ee } from "../../../shared/util/dist/lib/formatCalendarDate.js";
12
- import { buildPayableAuditHistory as te, hasUnattributedAuditRows as ne } from "../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
13
- import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
14
- import { useOrganizationUserNames as ie } from "../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
15
- import "../../../shared/feature/dist/index.js";
16
- import { usePayableApprovalRequestsQuery as ae } from "../../data-access/dist/index8.js";
17
- import { usePayableHistoryQuery as oe } from "../../data-access/dist/index9.js";
18
- import { useAllPayableLineItemsQuery as se } from "../../data-access/dist/index10.js";
19
- import { useUpdatePayableMutation as ce } from "../../data-access/dist/index13.js";
20
- import { usePayableQuery as le } from "../../data-access/dist/index17.js";
21
- import "../../data-access/dist/index.js";
22
- import { hasUnpaidBalance as ue } from "./index7.js";
23
- import { resolveVendor as de } from "./index8.js";
24
- import { BillCreateScreen as fe } from "../../ui/dist/index59.js";
25
- import { BillDecisionDialog as i } from "../../ui/dist/index65.js";
26
- import { DiscardChangesDialog as pe } from "../../ui/dist/index69.js";
27
- import { BillDuplicateNotice as me } from "../../ui/dist/index74.js";
28
- import { BillRejectedBanner as he } from "../../ui/dist/index77.js";
29
- import { ExtractionNotice as ge } from "../../ui/dist/index95.js";
30
- import { MarkAsPaidDialog as _e } from "../../ui/dist/index104.js";
31
- import { UnsavedBillDialog as ve } from "../../ui/dist/index114.js";
32
- import "../../ui/dist/index.js";
33
- import { usePayableDuplicateReview as ye } from "./index13.js";
34
- import "./index14.js";
35
- import { isEditablePayableStatus as be } from "./index19.js";
36
- import { canOverrideApprovalPolicy as xe, canReadCounterpartBankAccounts as Se } from "./index20.js";
37
- import { resolveAmountDueMinorUnits as Ce } from "./index21.js";
38
- import { usePayableAchInstructions as we } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
39
- import "../../../shared/counterpart-management/feature/dist/index.js";
40
- import { PayBillFlow as Te } from "./index27.js";
41
- import "./index28.js";
42
- import { useMarkAsPaidFlow as Ee } from "./index17.js";
43
- import "./index18.js";
44
- import { BILL_CREATE_MESSAGE_LABELS_EN as De, mergeBillCreateScreenCopy as Oe } from "./index50.js";
45
- import { useBillCreateController as ke } from "./index58.js";
46
- import { useBillForm as Ae } from "./index60.js";
47
- import { buildPaymentHistory as je } from "./index3.js";
48
- import { currentApprovalRound as Me } from "./index4.js";
49
- import { usePayableApprovalRoundStart as Ne } from "./index32.js";
50
- import { useApprovalPolicyCardView as Pe } from "./index33.js";
51
- import { resolveBillRejectionNotice as Fe } from "./index34.js";
52
- import { useCurrentApprovalRequestId as Ie } from "./index35.js";
53
- import { usePayableDetailActions as Le } from "./index36.js";
54
- import { formatScheduledDateLabel as Re } from "./index37.js";
55
- import { useLocalCalendarDay as ze } from "./index38.js";
56
- import { useScheduledPayment as Be } from "./index39.js";
57
- import { useDraftDelete as Ve } from "./index40.js";
58
- import { buildBillDetailView as He } from "./index45.js";
59
- import { resolveEditorDismissal as Ue } from "./index46.js";
60
- import { SourceDocumentContainer as We } from "./index51.js";
61
- import { useVendorSectionProps as Ge } from "./index54.js";
62
- import { billCreateTestIds as a } from "./index61.js";
63
- import { cloneElement as Ke, isValidElement as qe, useCallback as o, useEffect as Je, useMemo as s, useRef as Ye, useState as c } from "react";
64
- import { Fragment as Xe, jsx as l, jsxs as Ze } from "react/jsx-runtime";
65
- import { Trash2Icon as Qe } from "lucide-react";
66
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js
67
- function $e(e) {
68
- let t = [...new Set(e)];
69
- return t.length > 0 ? t : void 0;
70
- }
71
- function u({ open: u, onOpenChange: d, payableId: et, initialCounterpartId: tt, readOnly: f = !1, copy: nt, onCollapse: rt, onEdit: it, poweredByBankName: at }) {
72
- let p = s(() => Oe(nt), [nt]), ot = et ? void 0 : tt, [st, ct] = c(ot), [m, lt] = c(!!ot), [ut, dt] = c(!1), [h, g] = c(!1), [ft, _] = c(), pt = o((e) => {
73
- _(() => e);
74
- }, []), [mt, ht] = c(), v = et ?? mt, y = le(v, { pollWhileOcrProcessing: !0 }), b = se(v), { initResponse: x } = re(), gt = !!x, _t = t(x?.scopes, [n.AccountingConfigReadOrg]), S = r({ enabled: _t }), C = y.data, w = !v || !!C, T = !f && w && !!v && C?.status !== "draft", vt = !f && !!C && !be(C?.status), E = f || vt, D = Ae({
75
- payable: C,
76
- lineItems: b.lineItems
77
- }), O = C?.counterpart_id;
78
- Je(() => {
79
- m || O && (ct(O), lt(!0));
80
- }, [m, O]);
81
- let yt = o((e) => {
82
- lt(!0), ct(e);
83
- }, []), k = Be({
84
- payableId: v,
85
- scheduledPaymentDate: C?.scheduled_payment_date,
86
- enabled: f || T
87
- }), bt = ze(), A = s(() => k.hasScheduledPayment && k.scheduledDate ? Re(k.scheduledDate, p.scheduledRelativeDay, bt) : void 0, [
88
- k.hasScheduledPayment,
89
- k.scheduledDate,
90
- p.scheduledRelativeDay,
91
- bt
92
- ]), j = Se(x?.scopes), xt = t(x?.scopes, [n.PayableWriteOrg]), St = t(x?.scopes, [n.CounterpartWriteOrg]) && xt, M = St && ue(C?.status) && !k.hasScheduledPayment && !k.isResolving, Ct = M && j, wt = M || St && C?.status === "rejected", Tt = !f && w && (!v || C?.status === "draft") && !k.hasScheduledPayment && !k.isResolving, N = Ge({
93
- payableId: v,
94
- counterpartId: f ? O : st,
95
- payableCounterpartId: O,
96
- isVendorKnown: f ? !!C : w,
97
- onCounterpartChange: yt,
98
- requiredError: D.errors?.vendor,
99
- payableCounterpartBankAccountId: C?.counterpart_bank_account_id ?? void 0,
100
- extractedVendor: C?.counterpart_raw_data ?? void 0,
101
- readOnly: f,
102
- canEditVendor: !f || Ct,
103
- canEditPaymentInstructions: !f || M,
104
- canAddPaymentInstructions: !f || wt,
105
- confirmDiscard: pt
106
- }), P = N.activePayToOperation === "missingInstructions" ? Tt || wt : N.activePayToOperation === "existingInstructions" ? Tt || M : N.activePayToOperation === "vendor" && f ? Ct : !1, Et = !!(v && m) && !st, F = y.refetch, Dt = o(async () => {
107
- let { data: e } = await F();
108
- return e?.status ?? void 0;
109
- }, [F]), Ot = ce(), [I, kt] = c(!1), L = Ye(void 0), At = o(async () => {
110
- if (L.current) return L.current;
111
- let t = (async () => {
112
- if (P) {
113
- kt(!0);
114
- try {
115
- let t;
116
- try {
117
- t = await N.prepareVendorForSave({ closeOnSuccess: !1 });
118
- } catch {
119
- e.error(p.detail.paymentInstructionsSaveError);
120
- return;
121
- }
122
- if (!t.ok) return;
123
- if (!v) {
124
- N.finalizePayToSave();
125
- return;
126
- }
127
- let n = t.counterpartId && t.counterpartId !== C?.counterpart_id ? t.counterpartId : void 0, r = t.counterpartBankAccountId && t.counterpartBankAccountId !== C?.counterpart_bank_account_id ? t.counterpartBankAccountId : void 0;
128
- if (n || r) {
129
- let t = {
130
- path: { payable_id: v },
131
- body: {
132
- ...n ? { counterpart_id: n } : {},
133
- ...r ? { counterpart_bank_account_id: r } : {}
134
- }
135
- };
136
- try {
137
- await Ot.mutateAsync(t);
138
- } catch {
139
- try {
140
- await Ot.mutateAsync(t);
141
- } catch {
142
- e.error(p.detail.paymentInstructionsLinkError);
143
- return;
144
- }
145
- }
146
- N.finalizePayToSave();
147
- return;
148
- }
149
- N.finalizePayToSave(), await F();
150
- } finally {
151
- kt(!1);
152
- }
153
- }
154
- })();
155
- L.current = t;
156
- try {
157
- await t;
158
- } finally {
159
- L.current = void 0;
160
- }
161
- }, [
162
- P,
163
- p.detail.paymentInstructionsLinkError,
164
- p.detail.paymentInstructionsSaveError,
165
- Ot,
166
- C?.counterpart_bank_account_id,
167
- C?.counterpart_id,
168
- v,
169
- F,
170
- N
171
- ]), R = s(() => P ? N.mode === "creating" && qe(N.newVendorForm) ? {
172
- ...N,
173
- newVendorForm: Ke(N.newVendorForm, {
174
- onSave: At,
175
- isSaving: I
176
- })
177
- } : N.mode === "resolved" && N.paymentInstructions ? {
178
- ...N,
179
- paymentInstructions: {
180
- ...N.paymentInstructions,
181
- onSave: At,
182
- isSaving: I
183
- }
184
- } : N : N, [
185
- P,
186
- I,
187
- At,
188
- N
189
- ]);
190
- Je(() => {
191
- f && N.isEditingPayTo && !P && N.discardPayToEdits();
192
- }, [
193
- P,
194
- f,
195
- N.discardPayToEdits,
196
- N.isEditingPayTo
197
- ]);
198
- let jt = s(() => T ? { draftSaved: De.submittedSaved } : void 0, [T]), z = ke({
199
- payableId: et,
200
- form: D,
201
- labels: jt,
202
- counterpartId: st,
203
- isVendorPending: N.mode === "creating" || N.isPendingVendor,
204
- clearCounterpart: Et,
205
- prepareVendorForSave: N.prepareVendorForSave,
206
- onPayableCreated: ht,
207
- onSaved: ht,
208
- onDraftSaved: () => d(!1),
209
- onFinalized: () => d(!1),
210
- readSavedStatus: T ? Dt : void 0
211
- }), Mt = !!(z.isSavingDraft || z.isFinalizing || N.isVendorSavePending), B = f ? v : void 0, V = Ie({
212
- payableId: B,
213
- status: C?.status
214
- }), Nt = Ye(null), Pt = de(C), H = we({
215
- counterpartId: f ? O : void 0,
216
- currency: C?.currency,
217
- currentBankAccountId: f ? C?.counterpart_bank_account_id ?? void 0 : void 0,
218
- enabled: j && f
219
- }), U = Ee({
220
- payableId: B,
221
- amountDueMinorUnits: Ce(C) ?? 0,
222
- amountToPayMinorUnits: C?.amount_to_pay ?? void 0,
223
- currencyCode: C?.currency ?? void 0,
224
- dueDate: C?.due_date,
225
- hasScheduledPayment: k.hasScheduledPayment,
226
- labels: p.markAsPaid
227
- }), W = Pe({
228
- payableId: B,
229
- approvalPolicyId: C?.approval_policy_id,
230
- enabled: f,
231
- copy: p.approvalPolicyCopy
232
- }), Ft = xe({
233
- status: C?.status,
234
- scopes: x?.scopes,
235
- arePendingApproversUnknown: W.isLoading,
236
- hasApprovalPolicy: !!C?.approval_policy_id,
237
- hasWaitingRequest: V.hasWaitingRequest
238
- }), It = !!V.id, Lt = V.isLoading || W.isLoading, Rt = s(() => $e(W.pendingApprovers.flatMap((e) => e.names)), [W.pendingApprovers]), zt = f || T ? v : void 0, Bt = f ? it : void 0, G = o((e) => {
239
- let t = () => {
240
- N.discardPayToEdits(), e?.();
241
- };
242
- N.hasUnsavedVendorChanges ? pt(t) : t();
243
- }, [pt, N]), { actions: K, decisionDialog: Vt, isActionPending: Ht } = Le({
244
- payableId: zt,
245
- status: C?.status,
246
- currentApprovalRequestId: V.id,
247
- arePendingApproversUnknown: W.isLoading,
248
- hasScheduledPayment: k.hasScheduledPayment,
249
- scheduledPaymentIntentId: k.scheduledPaymentIntentId,
250
- isScheduledPaymentUnknown: k.isResolving,
251
- isPayabilityUnknown: H.isLoading,
252
- hasApprovalPolicy: !!C?.approval_policy_id,
253
- hasWaitingRequest: V.hasWaitingRequest,
254
- pendingApprovers: W.pendingApprovers,
255
- labels: p.actions,
256
- isMarkAsPaidPending: U.isPending,
257
- onMarkAsPaidSelect: U.open,
258
- onPayBillSelect: () => G(() => Nt.current?.open()),
259
- onEditSelect: Bt,
260
- onActionSucceeded: (e) => {
261
- if (e === "reopen") {
262
- Bt?.();
263
- return;
264
- }
265
- T && d(!1);
266
- }
267
- }), Ut = Ve({
268
- payableId: v,
269
- status: C?.status,
270
- enabled: !f,
271
- labels: p.deleteDraft,
272
- onDeleted: () => d(!1)
273
- }), Wt = Mt || Ht, Gt = C?.ocr_status === "processing", Kt = y.isLoading || b.isResolving || Gt, qt = y.isLoading || b.isResolving || S.isResolving || H.isLoading, Jt = y.isError || b.isError || S.isError, Yt = s(() => [...Ut.menuItems, ...T || f && !qt && !Jt ? K.menu.map((e) => ({
274
- id: e.id,
275
- label: e.label,
276
- onSelect: e.onSelect,
277
- disabled: e.disabled,
278
- icon: e.icon,
279
- sectionHeading: e.sectionHeading
280
- })) : []], [
281
- K.menu,
282
- Ut.menuItems,
283
- T,
284
- f,
285
- qt,
286
- Jt
287
- ]), q = s(() => (S.data?.data ?? []).map((e) => ({
288
- value: e.id,
289
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
290
- })), [S.data]), J;
291
- gt && (_t ? S.isError ? J = p.lineItemsGlCodeUnavailable.loadError : !S.isResolving && q.length === 0 && (J = p.lineItemsGlCodeUnavailable.empty) : J = p.lineItemsGlCodeUnavailable.noAccess);
292
- let Xt = !gt || !!J || S.isResolving, Zt = _t && !S.isResolving && !S.isError, Y = oe(B), Qt = C?.status === "rejected" || !f && T, $t = t(x?.scopes, [n.ApprovalRequestReadOrg]), en = Qt && $t, tn = t(x?.scopes, [n.UserReadOrg]), { userNames: X, isError: nn, isResolving: rn } = ie({ enabled: (f || Qt) && tn }), an = s(() => te(Y.data?.data ?? [], X, p.history), [
293
- Y.data,
294
- X,
295
- p.history
296
- ]), on = tn && nn && ne(Y.data?.data ?? [], an, X), sn = Ne({
297
- payableId: v,
298
- enabled: en
299
- }), cn = ae(v, { enabled: en }), ln = s(() => Me(cn.data?.data, sn.roundStartedAt), [cn.data, sn.roundStartedAt]), Z = s(() => Fe({
300
- payableStatus: C?.status,
301
- approvalRequests: ln,
302
- userNames: X,
303
- payableUpdatedAt: C?.updated_at,
304
- labels: p.detail
305
- }), [
306
- C?.status,
307
- C?.updated_at,
308
- ln,
309
- X,
310
- p.detail
311
- ]), un = s(() => je({
312
- records: k.paymentRecords,
313
- events: Y.data?.data ?? [],
314
- currencyCode: C?.currency,
315
- labels: p.detail
316
- }), [
317
- k.paymentRecords,
318
- Y.data,
319
- C?.currency,
320
- p.detail
321
- ]), dn = s(() => {
322
- if (!f || !C) return;
323
- let e = He({
324
- payable: C,
325
- lineItems: b.lineItems,
326
- glCodeOptions: q,
327
- glCodeRosterAvailable: Zt,
328
- history: an,
329
- paymentHistory: un,
330
- approvalPolicy: W.view,
331
- labels: p.detail,
332
- hasScheduledPayment: k.hasScheduledPayment,
333
- rejection: Z,
334
- payableAchInstructions: H.achInstructions,
335
- payableAchInstructionsReadable: j && !H.isError
336
- });
337
- return N.mode === "resolved" && N.summary ? {
338
- ...e,
339
- payTo: N.summary
340
- } : e;
341
- }, [
342
- k.hasScheduledPayment,
343
- W.view,
344
- j,
345
- p.detail,
346
- q,
347
- Zt,
348
- an,
349
- b.lineItems,
350
- C,
351
- H.achInstructions,
352
- H.isError,
353
- un,
354
- f,
355
- Z,
356
- N.mode,
357
- N.summary
358
- ]), fn = C?.source_of_payable_data === "ocr", Q = Pt?.name, pn = f ? Q ? p.viewTitle(Q) : p.readOnlyTitle : Q && (fn || T) ? p.extractedTitle(Q) : p.newTitle, mn = f && C?.created_at ? p.addedOn(ee(C.created_at.slice(0, 10))) : void 0, hn = o(() => {
359
- if (f && N.isEditingPayTo) {
360
- G(() => d(!1));
361
- return;
362
- }
363
- let e = D.isDirty || N.hasUnsavedVendorChanges || !!z.stagedFile || z.isFileDeletionPending;
364
- switch (Ue({
365
- isUnsavedPromptOpen: h,
366
- isLocked: E,
367
- isDirty: e
368
- })) {
369
- case "dismiss-prompt":
370
- g(!1);
371
- return;
372
- case "prompt":
373
- g(!0);
374
- return;
375
- default: d(!1);
376
- }
377
- }, [
378
- z.isFileDeletionPending,
379
- z.stagedFile,
380
- D.isDirty,
381
- E,
382
- h,
383
- G,
384
- d,
385
- f,
386
- N.hasUnsavedVendorChanges,
387
- N.isEditingPayTo
388
- ]), gn = o(() => {
389
- if (N.isEditingPayTo) {
390
- G(rt);
391
- return;
392
- }
393
- rt?.();
394
- }, [
395
- G,
396
- rt,
397
- N.isEditingPayTo
398
- ]), _n = o(() => {
399
- g(!1), d(!1);
400
- }, [d]), vn = Kt || N.mode === "creating", yn = o(async () => {
401
- if (vn) return;
402
- let e = await z.saveDraft();
403
- g(!1), e && d(!1);
404
- }, [
405
- z,
406
- vn,
407
- d
408
- ]), $ = ye({
409
- payable: C,
410
- onRemoved: () => d(!1),
411
- canManage: xt
412
- }), bn = o((e) => {
413
- if (!(Wt || $.isBusy)) return e ? d(!0) : hn();
414
- }, [
415
- $.isBusy,
416
- Wt,
417
- hn,
418
- d
419
- ]), xn = $.isPossibleDuplicate, Sn = !f && fn && !ut, Cn = !f && !!Z, wn = Cn || xn || Sn ? /* @__PURE__ */ Ze(Xe, { children: [
420
- Cn && Z ? /* @__PURE__ */ l(he, {
421
- ...Z,
422
- labels: p.rejectedBanner
423
- }) : null,
424
- xn ? /* @__PURE__ */ l(me, {
425
- onNotADuplicate: $.onNotADuplicate,
426
- onRemoveBill: $.onRemoveBill,
427
- isActionDisabled: $.isBusy,
428
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
429
- testId: a.duplicateNotice
430
- }) : null,
431
- Sn ? /* @__PURE__ */ l(ge, { onDismiss: () => dt(!0) }) : null
432
- ] }) : void 0;
433
- return /* @__PURE__ */ Ze(Xe, { children: [
434
- /* @__PURE__ */ l(fe, {
435
- open: u,
436
- onOpenChange: bn,
437
- title: pn,
438
- subtitle: mn,
439
- notice: wn,
440
- vendor: {
441
- ...R,
442
- testId: a.vendorSection
443
- },
444
- values: D.values,
445
- errors: D.errors,
446
- onChange: D.onChange,
447
- lineItems: {
448
- items: D.lineItemRows,
449
- glCodeOptions: q,
450
- glCodeDisabled: Xt,
451
- glCodeUnavailableMessage: J,
452
- discount: D.discount,
453
- onDiscountChange: D.onDiscountChange,
454
- onDiscountBlur: D.onDiscountBlur,
455
- tax: D.tax,
456
- onTaxChange: D.onTaxChange,
457
- onTaxBlur: D.onTaxBlur,
458
- total: D.total,
459
- onTotalChange: D.onTotalChange,
460
- onTotalBlur: D.onTotalBlur,
461
- onAddLineItem: D.onAddLineItem,
462
- errors: D.lineItemErrors,
463
- totalsErrors: D.totalsErrors,
464
- testId: a.lineItems
465
- },
466
- documentPanel: /* @__PURE__ */ l(We, {
467
- payableId: v,
468
- readOnly: E,
469
- isDocumentPending: !!v && !C?.file && (y.isLoading || C?.ocr_status === "processing"),
470
- file: C?.file ? {
471
- id: C.file.id,
472
- name: C.file.name,
473
- url: C.file.url,
474
- mimetype: C.file.mimetype
475
- } : void 0,
476
- staging: {
477
- stagedFile: z.stagedFile,
478
- onFileStaged: z.stageFile,
479
- onClearStagedFile: z.clearStagedFile,
480
- isSaving: Mt
481
- },
482
- deletion: {
483
- isPending: z.isFileDeletionPending,
484
- onRequest: z.requestFileDeletion,
485
- onDetachNow: z.detachFileNow,
486
- isDeleting: z.isDeletingFile,
487
- hasFailed: z.hasFileDeletionFailed
488
- }
489
- }),
490
- menuItems: Yt,
491
- readOnly: E,
492
- detail: f ? {
493
- view: dn,
494
- actions: K,
495
- scheduledSummary: A ? p.scheduledSummary(A.label) : void 0,
496
- scheduledSummaryDate: A?.absoluteLabel,
497
- scheduledStatusLabel: A ? p.scheduledStatusBadge(A.label) : void 0,
498
- showApprovalOverrideNotice: !Lt && Ft,
499
- awaitingApprovalNotice: !Lt && !It && !Ft && C?.status === "approve_in_progress" && C?.approval_policy_id ? Rt ? p.awaitingApprovalNotice(Rt) : p.awaitingApprovalUnknownNotice : void 0,
500
- payTo: {
501
- onEdit: R.mode === "resolved" ? R.onEdit : void 0,
502
- paymentInstructions: R.paymentInstructions,
503
- detailsWarning: R.detailsWarning,
504
- editForm: R.mode === "creating" ? R.newVendorForm : void 0
505
- },
506
- hideMissingPaymentInstructions: C?.status === "paid" || C?.status === "canceled",
507
- isLoading: qt,
508
- isError: Jt,
509
- paymentHistoryError: k.isError || Y.isError,
510
- paymentHistoryLoading: k.isResolving || Y.isLoading,
511
- historyError: Y.isError,
512
- historyLoading: Y.isLoading || rn,
513
- historyNamesError: on
514
- } : void 0,
515
- isLineItemsLoading: Kt,
516
- isSaving: Wt || I,
517
- isSavingDraft: z.isSavingDraft,
518
- isSubmitting: z.isFinalizing,
519
- onCancel: hn,
520
- onCollapse: f ? gn : void 0,
521
- onSaveDraft: z.saveDraft,
522
- onFinalize: z.finalize,
523
- scrollToErrorToken: z.scrollToErrorToken,
524
- showSubmit: !E && w,
525
- testId: a.dialog
526
- }),
527
- /* @__PURE__ */ l(ve, {
528
- open: h,
529
- onSaveDraft: yn,
530
- onDiscard: _n,
531
- onCancel: () => g(!1),
532
- isSaving: z.isSavingDraft,
533
- isSaveDraftDisabled: vn,
534
- labels: p.unsavedChanges,
535
- testId: a.unsavedDialog,
536
- saveDraftTestId: a.unsavedSaveDraft,
537
- discardTestId: a.unsavedDiscard,
538
- closeTestId: a.unsavedClose
539
- }),
540
- /* @__PURE__ */ l(pe, {
541
- open: !!ft,
542
- onDiscard: () => {
543
- let e = ft;
544
- _(void 0), e?.();
545
- },
546
- onKeepEditing: () => _(void 0),
547
- labels: p.discardChanges,
548
- testId: a.discardDialog,
549
- discardTestId: a.discardConfirm
550
- }),
551
- /* @__PURE__ */ l(i, {
552
- ...Vt,
553
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
554
- testId: a.decisionDialog,
555
- confirmTestId: a.decisionConfirm,
556
- reasonTestId: a.decisionReason
557
- }),
558
- /* @__PURE__ */ l(i, {
559
- ...Ut.dialog,
560
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
561
- testId: a.deleteDraftDialog,
562
- confirmTestId: a.deleteDraftConfirm
563
- }),
564
- /* @__PURE__ */ l(i, {
565
- open: $.removeConfirmation.open,
566
- copy: $.removeConfirmation.copy,
567
- onConfirm: $.removeConfirmation.onConfirm,
568
- onCancel: $.removeConfirmation.onCancel,
569
- isPending: $.removeConfirmation.isPending,
570
- confirmIcon: /* @__PURE__ */ l(Qe, {}),
571
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
572
- testId: a.duplicateRemoveDialog,
573
- confirmTestId: a.duplicateRemoveConfirm
574
- }),
575
- /* @__PURE__ */ l(_e, { ...U.dialogProps }),
576
- f && C ? /* @__PURE__ */ l(Te, {
577
- ref: Nt,
578
- payable: C,
579
- onMissingAchInstructions: St ? N.openPaymentInstructions : void 0,
580
- poweredByBankName: at,
581
- labels: p.payBill
582
- }) : null
583
- ] });
584
- }
585
- //#endregion
586
- export { u as BillCreateDialog, u as default };
1
+ import "./index49.js";
2
+ import "./index57.js";
3
+ import "./index59.js";
4
+ import "./index61.js";
@@ -1,4 +1,45 @@
1
- import "./index50.js";
2
- import "./index58.js";
3
- import "./index60.js";
4
- import "./index62.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index38.js";
2
+ import "../../ui/dist/index.js";
3
+ import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index15.js";
4
+ import "./index18.js";
5
+ import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index28.js";
6
+ import { AWAITING_APPROVAL_LABEL_EN as r, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as i, BILL_DETAIL_ACTIONS_LABELS_EN as a, PAYMENT_HISTORY_LABELS_EN as o, SCHEDULED_RELATIVE_DAY_LABELS_EN as s, SCHEDULED_STATUS_BADGE_LABEL_EN as c, SCHEDULED_SUMMARY_LABEL_EN as l } from "./index46.js";
7
+ import { PAYABLE_AUDIT_HISTORY_LABELS_EN as u } from "./index47.js";
8
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
9
+ var d = {
10
+ subtitle: "Accounts payable",
11
+ vendorRow: "Vendor",
12
+ bankAccountRow: "ACH bank account",
13
+ bankAccountValue: (e) => `Account ending in ${e}`,
14
+ ...o,
15
+ invoiceNumberRow: "Number",
16
+ issueDateRow: "Issue date",
17
+ dueDateRow: "Due date",
18
+ poNumberRow: "PO number",
19
+ notProvided: "Not provided",
20
+ glCodeMissing: "GL code not specified",
21
+ quantityValue: (e, t) => `${e} x ${t}`,
22
+ quantityOnlyValue: (e) => e,
23
+ subtotalRow: "Subtotal",
24
+ discountsRow: "Discounts",
25
+ taxRow: "Tax",
26
+ totalRow: "Total",
27
+ actionError: a.actionError,
28
+ actionSuccess: a.actionSuccess,
29
+ scheduledRelativeDay: s,
30
+ scheduledSummary: l,
31
+ scheduledStatusBadge: c,
32
+ awaitingApprovalNotice: r,
33
+ awaitingApprovalUnknownNotice: i,
34
+ paidOnLabel: (e) => `Paid on ${e}`,
35
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
36
+ rejectedOn: (e) => `Rejected on ${e}`,
37
+ rejectionMessage: (e) => `"${e}"`,
38
+ sheet: e,
39
+ history: u,
40
+ decisionDialog: a.decisionDialog,
41
+ approvalPolicyCopy: n,
42
+ markAsPaid: t
43
+ };
44
+ //#endregion
45
+ export { d as BILL_DETAILS_LABELS_EN };