@tesouro/embedded-components-react 0.4.27 → 0.4.29

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 (94) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +2 -2
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +15 -82
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +87 -25
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js +36 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +12 -12
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +5 -70
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +64 -37
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +38 -110
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +104 -73
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +87 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +7 -21
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +17 -22
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +23 -63
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +66 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -77
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +78 -3
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +4 -5
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +3 -32
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +30 -39
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +37 -166
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +164 -39
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +48 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +1 -50
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +45 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +13 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -59
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +64 -8
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +8 -24
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +18 -136
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +139 -16
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +24 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +4 -41
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +39 -88
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +79 -85
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +96 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -49
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +47 -119
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +135 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +33 -186
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +186 -75
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +75 -21
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +22 -232
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +223 -210
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +14 -25
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +202 -103
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +121 -13
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +12 -47
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +47 -31
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +27 -198
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +198 -30
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +30 -234
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +240 -19
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -425
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +433 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +25 -24
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -38
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +35 -218
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +224 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +3 -4
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +2 -44
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +46 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -8
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +6 -10
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +10 -110
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +112 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +21 -57
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +3 -127
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +124 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +8 -7
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -46
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +43 -18
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +20 -28
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +27 -82
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +83 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +47 -250
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +239 -101
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +58 -5
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +107 -202
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +209 -3
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +4 -8
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +6 -113
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +115 -1
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +0 -24
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +25 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +5 -4
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +1 -1
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +3 -1
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  94. package/package.json +1 -1
@@ -1,427 +1,21 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
- import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
- import { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
- import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
- import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
- import "../../../shared/feature/dist/index.js";
13
- import { usePayableApprovalRequestsQuery as ie } from "../../data-access/dist/index8.js";
14
- import { usePayableHistoryQuery as ae } from "../../data-access/dist/index9.js";
15
- import { useAllPayableLineItemsQuery as oe } from "../../data-access/dist/index10.js";
16
- import { usePayableQuery as se } from "../../data-access/dist/index16.js";
17
- import "../../data-access/dist/index.js";
18
- import { hasUnpaidBalance as ce } from "./index7.js";
19
- import { resolveVendor as le } from "./index8.js";
20
- import { BillCreateScreen as ue } from "../../ui/dist/index50.js";
21
- import { BillDecisionDialog as n } from "../../ui/dist/index56.js";
22
- import { BillDuplicateNotice as de } from "../../ui/dist/index66.js";
23
- import { BillRejectedBanner as fe } from "../../ui/dist/index69.js";
24
- import { ExtractionNotice as pe } from "../../ui/dist/index87.js";
25
- import { MarkAsPaidDialog as me } from "../../ui/dist/index96.js";
26
- import { UnsavedBillDialog as he } from "../../ui/dist/index106.js";
27
- import "../../ui/dist/index.js";
28
- import { usePayableDuplicateReview as ge } from "./index13.js";
29
- import "./index14.js";
30
- import { canOverrideApprovalPolicy as _e, canReadCounterpartBankAccounts as ve } from "./index19.js";
31
- import { resolveAmountDueMinorUnits as ye } from "./index20.js";
32
- import { usePayableAchInstructions as be } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
33
- import "../../../shared/counterpart-management/feature/dist/index.js";
34
- import { PayBillFlow as xe } from "./index26.js";
35
- import "./index27.js";
36
- import { useMarkAsPaidFlow as Se } from "./index17.js";
37
- import "./index18.js";
38
- import { BILL_CREATE_MESSAGE_LABELS_EN as Ce, mergeBillCreateScreenCopy as we } from "./index45.js";
39
- import { useBillCreateController as Te } from "./index54.js";
40
- import { useBillForm as Ee } from "./index56.js";
41
- import { buildPaymentHistory as De } from "./index3.js";
42
- import { currentApprovalRound as Oe } from "./index4.js";
43
- import { usePayableApprovalRoundStart as ke } from "./index31.js";
44
- import { useApprovalPolicyCardView as Ae } from "./index32.js";
45
- import { resolveBillRejectionNotice as je } from "./index33.js";
46
- import { useCurrentApprovalRequestId as Me } from "./index34.js";
47
- import { usePayableDetailActions as Ne } from "./index35.js";
48
- import { useScheduledPayment as Pe } from "./index36.js";
49
- import { isEditablePayableStatus as Fe } from "./index37.js";
50
- import { useDraftDelete as Ie } from "./index38.js";
51
- import { buildBillDetailView as Le } from "./index40.js";
52
- import { resolveEditorDismissal as Re } from "./index41.js";
53
- import { buildBillHistory as ze } from "./index42.js";
54
- import { SourceDocumentContainer as Be } from "./index46.js";
55
- import { useVendorSectionProps as Ve } from "./index49.js";
56
- import { usePaymentInstructionsForm as He } from "./index50.js";
57
- import { billCreateTestIds as r } from "./index57.js";
58
- import { useCallback as i, useEffect as Ue, useMemo as a, useRef as We, useState as o } from "react";
59
- import { Fragment as Ge, jsx as s, jsxs as Ke } from "react/jsx-runtime";
60
- import { Trash2Icon as qe } from "lucide-react";
61
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
62
- function c({ open: c, onOpenChange: l, payableId: Je, readOnly: u = !1, copy: Ye, onCollapse: Xe, poweredByBankName: Ze }) {
63
- let d = a(() => we(Ye), [Ye]), [f, Qe] = o(), [p, $e] = o(!1), [et, tt] = o(!1), [m, h] = o(!1), [nt, rt] = o(), g = Je ?? nt, _ = se(g, { pollWhileOcrProcessing: !0 }), v = oe(g), { initResponse: y } = re(), it = !!y, b = e(y?.scopes, [t.AccountingConfigReadOrg]), x = ee({ enabled: b }), S = _.data, C = !g || !!S, w = !u && C && !!g && S?.status !== "draft", at = !u && !!S && !Fe(S?.status), T = u || at, E = Ee({
64
- payable: S,
65
- lineItems: v.lineItems
66
- }), D = S?.counterpart_id;
67
- Ue(() => {
68
- p || D && (Qe(D), $e(!0));
69
- }, [p, D]);
70
- let ot = i((e) => {
71
- $e(!0), Qe(e);
72
- }, []), O = Ve({
73
- payableId: u ? void 0 : g,
74
- counterpartId: u ? void 0 : f,
75
- payableCounterpartId: D,
76
- isVendorKnown: !u && C,
77
- onCounterpartChange: ot,
78
- requiredError: E.errors?.vendor,
79
- payableCounterpartBankAccountId: S?.counterpart_bank_account_id ?? void 0,
80
- extractedVendor: S?.counterpart_raw_data ?? void 0
81
- }), st = !!(g && p) && !f, ct = _.refetch, lt = i(async () => {
82
- let { data: e } = await ct();
83
- return e?.status ?? void 0;
84
- }, [ct]), ut = a(() => w ? { draftSaved: Ce.submittedSaved } : void 0, [w]), k = Te({
85
- payableId: Je,
86
- form: E,
87
- labels: ut,
88
- counterpartId: f,
89
- clearCounterpart: st,
90
- prepareVendorForSave: O.savePaymentInstructions,
91
- onPayableCreated: rt,
92
- onSaved: rt,
93
- onDraftSaved: () => l(!1),
94
- onFinalized: () => l(!1),
95
- readSavedStatus: w ? lt : void 0
96
- }), A = !!(k.isSavingDraft || k.isFinalizing), j = u ? g : void 0, M = Me({
97
- payableId: j,
98
- status: S?.status
99
- }), dt = We(null), N = Pe({
100
- payableId: g,
101
- scheduledPaymentDate: S?.scheduled_payment_date,
102
- enabled: u || w
103
- }), ft = le(S), P = ve(y?.scopes), F = be({
104
- counterpartId: u ? D : void 0,
105
- currency: S?.currency,
106
- currentBankAccountId: u ? S?.counterpart_bank_account_id ?? void 0 : void 0,
107
- enabled: P && u
108
- }), I = He({
109
- payableId: j,
110
- counterpartId: u ? D : void 0,
111
- currentBankAccountId: S?.counterpart_bank_account_id ?? void 0,
112
- canReadCounterpartBankAccounts: P,
113
- saveErrorMessage: d.detail.paymentInstructionsSaveError,
114
- linkErrorMessage: d.detail.paymentInstructionsLinkError
115
- }), pt = e(y?.scopes, [t.PayableWriteOrg]), L = e(y?.scopes, [t.CounterpartWriteOrg]) && pt, mt = L && ce(S?.status) && !N.hasScheduledPayment && !N.isResolving, R = Se({
116
- payableId: j,
117
- amountDueMinorUnits: ye(S) ?? 0,
118
- amountToPayMinorUnits: S?.amount_to_pay ?? void 0,
119
- currencyCode: S?.currency ?? void 0,
120
- dueDate: S?.due_date,
121
- hasScheduledPayment: N.hasScheduledPayment,
122
- labels: d.markAsPaid
123
- }), z = Ae({
124
- payableId: j,
125
- approvalPolicyId: S?.approval_policy_id,
126
- enabled: u,
127
- copy: d.approvalPolicyCopy
128
- }), ht = _e({
129
- status: S?.status,
130
- scopes: y?.scopes,
131
- hasWaitingRequest: M.hasWaitingRequest,
132
- arePendingApproversUnknown: z.isLoading
133
- }), { actions: B, decisionDialog: gt, isActionPending: _t } = Ne({
134
- payableId: u || w ? g : void 0,
135
- status: S?.status,
136
- currentApprovalRequestId: M.id,
137
- hasWaitingRequest: M.hasWaitingRequest,
138
- arePendingApproversUnknown: z.isLoading,
139
- hasScheduledPayment: N.hasScheduledPayment,
140
- scheduledPaymentIntentId: N.scheduledPaymentIntentId,
141
- isScheduledPaymentUnknown: N.isResolving,
142
- isPayabilityUnknown: F.isLoading,
143
- pendingApprovers: z.pendingApprovers,
144
- labels: d.actions,
145
- isMarkAsPaidPending: R.isPending,
146
- onMarkAsPaidSelect: R.open,
147
- onPayBillSelect: () => dt.current?.open(),
148
- onActionSucceeded: w ? () => l(!1) : void 0
149
- }), V = Ie({
150
- payableId: g,
151
- status: S?.status,
152
- enabled: !u,
153
- labels: d.deleteDraft,
154
- onDeleted: () => l(!1)
155
- }), H = A || _t, U = _.isLoading || v.isResolving || x.isResolving || F.isLoading, W = _.isError || v.isError || x.isError, vt = a(() => [...V.menuItems, ...w || u && !U && !W ? B.menu.map((e) => ({
156
- id: e.id,
157
- label: e.label,
158
- onSelect: e.onSelect,
159
- disabled: e.disabled,
160
- icon: e.icon,
161
- sectionHeading: e.sectionHeading
162
- })) : []], [
163
- B.menu,
164
- V.menuItems,
165
- w,
166
- u,
167
- U,
168
- W
169
- ]), G = a(() => (x.data?.data ?? []).map((e) => ({
170
- value: e.id,
171
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
172
- })), [x.data]), K;
173
- it && (b ? x.isError ? K = d.lineItemsGlCodeUnavailable.loadError : !x.isResolving && G.length === 0 && (K = d.lineItemsGlCodeUnavailable.empty) : K = d.lineItemsGlCodeUnavailable.noAccess);
174
- let yt = !it || !!K || x.isResolving, bt = b && !x.isResolving && !x.isError, q = ae(j), xt = S?.status === "rejected" || !u && w, St = e(y?.scopes, [t.ApprovalRequestReadOrg]), Ct = xt && St, wt = e(y?.scopes, [t.UserReadOrg]), J = te({ enabled: (u || xt) && wt }), Tt = a(() => ze(q.data?.data ?? [], J.data?.data ?? [], d.history), [
175
- q.data,
176
- J.data,
177
- d.history
178
- ]), Et = ke({
179
- payableId: g,
180
- enabled: Ct
181
- }), Dt = ie(g, { enabled: Ct }), Ot = a(() => Oe(Dt.data?.data, Et.roundStartedAt), [Dt.data, Et.roundStartedAt]), Y = a(() => je({
182
- payableStatus: S?.status,
183
- approvalRequests: Ot,
184
- users: J.data?.data ?? [],
185
- payableUpdatedAt: S?.updated_at,
186
- labels: d.detail
187
- }), [
188
- S?.status,
189
- S?.updated_at,
190
- Ot,
191
- J.data,
192
- d.detail
193
- ]), kt = a(() => De({
194
- records: N.paymentRecords,
195
- events: q.data?.data ?? [],
196
- currencyCode: S?.currency,
197
- labels: d.detail
198
- }), [
199
- N.paymentRecords,
200
- q.data,
201
- S?.currency,
202
- d.detail
203
- ]), At = a(() => u && S ? Le({
204
- payable: S,
205
- lineItems: v.lineItems,
206
- glCodeOptions: G,
207
- glCodeRosterAvailable: bt,
208
- history: Tt,
209
- paymentHistory: kt,
210
- approvalPolicy: z.view,
211
- labels: d.detail,
212
- hasScheduledPayment: N.hasScheduledPayment,
213
- rejection: Y,
214
- payableAchInstructions: F.achInstructions,
215
- payableAchInstructionsReadable: P && !F.isError
216
- }) : void 0, [
217
- N.hasScheduledPayment,
218
- z.view,
219
- P,
220
- d.detail,
221
- G,
222
- bt,
223
- Tt,
224
- v.lineItems,
225
- S,
226
- F.achInstructions,
227
- F.isError,
228
- kt,
229
- u,
230
- Y
231
- ]), jt = S?.source_of_payable_data === "ocr", X = ft?.name, Mt = u ? X ? d.viewTitle(X) : d.readOnlyTitle : X && (jt || w) ? d.extractedTitle(X) : d.newTitle, Nt = u && S?.created_at ? d.addedOn(ne(S.created_at.slice(0, 10))) : void 0, Z = i(() => {
232
- let e = E.isDirty || O.hasUnsavedVendorChanges || !!k.stagedFile || k.isFileDeletionPending;
233
- switch (Re({
234
- isUnsavedPromptOpen: m,
235
- isLocked: T,
236
- isDirty: e
237
- })) {
238
- case "dismiss-prompt":
239
- h(!1);
240
- return;
241
- case "prompt":
242
- h(!0);
243
- return;
244
- default: l(!1);
245
- }
246
- }, [
247
- k.isFileDeletionPending,
248
- k.stagedFile,
249
- E.isDirty,
250
- T,
251
- m,
252
- l,
253
- O.hasUnsavedVendorChanges
254
- ]), Pt = i(() => {
255
- h(!1), l(!1);
256
- }, [l]), Q = v.isResolving || O.mode === "creating", Ft = i(async () => {
257
- if (Q) return;
258
- let e = await k.saveDraft();
259
- h(!1), e && l(!1);
260
- }, [
261
- k,
262
- Q,
263
- l
264
- ]), $ = ge({
265
- payable: S,
266
- onRemoved: () => l(!1),
267
- canManage: pt
268
- }), It = i((e) => {
269
- if (!(H || $.isBusy)) return e ? l(!0) : Z();
270
- }, [
271
- $.isBusy,
272
- H,
273
- Z,
274
- l
275
- ]), Lt = $.isPossibleDuplicate, Rt = !u && jt && !et, zt = !u && !!Y, Bt = zt || Lt || Rt ? /* @__PURE__ */ Ke(Ge, { children: [
276
- zt && Y ? /* @__PURE__ */ s(fe, {
277
- ...Y,
278
- labels: d.rejectedBanner
279
- }) : null,
280
- Lt ? /* @__PURE__ */ s(de, {
281
- onNotADuplicate: $.onNotADuplicate,
282
- onRemoveBill: $.onRemoveBill,
283
- isActionDisabled: $.isBusy,
284
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
285
- testId: r.duplicateNotice
286
- }) : null,
287
- Rt ? /* @__PURE__ */ s(pe, { onDismiss: () => tt(!0) }) : null
288
- ] }) : void 0;
289
- return /* @__PURE__ */ Ke(Ge, { children: [
290
- /* @__PURE__ */ s(ue, {
291
- open: c,
292
- onOpenChange: It,
293
- title: Mt,
294
- subtitle: Nt,
295
- notice: Bt,
296
- vendor: {
297
- ...O,
298
- testId: r.vendorSection
299
- },
300
- values: E.values,
301
- errors: E.errors,
302
- onChange: E.onChange,
303
- lineItems: {
304
- items: E.lineItemRows,
305
- glCodeOptions: G,
306
- glCodeDisabled: yt,
307
- glCodeUnavailableMessage: K,
308
- discount: E.discount,
309
- onDiscountChange: E.onDiscountChange,
310
- tax: E.tax,
311
- onTaxChange: E.onTaxChange,
312
- total: E.total,
313
- onTotalChange: E.onTotalChange,
314
- onAddLineItem: E.onAddLineItem,
315
- errors: E.lineItemErrors,
316
- totalsErrors: E.totalsErrors,
317
- testId: r.lineItems
318
- },
319
- documentPanel: /* @__PURE__ */ s(Be, {
320
- payableId: g,
321
- readOnly: T,
322
- isDocumentPending: !!g && !S?.file && (_.isLoading || S?.ocr_status === "processing"),
323
- file: S?.file ? {
324
- id: S.file.id,
325
- name: S.file.name,
326
- url: S.file.url,
327
- mimetype: S.file.mimetype
328
- } : void 0,
329
- staging: {
330
- stagedFile: k.stagedFile,
331
- onFileStaged: k.stageFile,
332
- onClearStagedFile: k.clearStagedFile,
333
- isSaving: A
334
- },
335
- deletion: {
336
- isPending: k.isFileDeletionPending,
337
- onRequest: k.requestFileDeletion,
338
- onDetachNow: k.detachFileNow,
339
- isDeleting: k.isDeletingFile,
340
- hasFailed: k.hasFileDeletionFailed
341
- }
342
- }),
343
- menuItems: vt,
344
- readOnly: T,
345
- detail: u ? {
346
- view: At,
347
- actions: B,
348
- scheduledSummary: N.hasScheduledPayment && N.scheduledDateLabel ? d.scheduledSummary(N.scheduledDateLabel) : void 0,
349
- showApprovalOverrideNotice: ht,
350
- onEditPaymentInstructions: D && mt ? I.open : void 0,
351
- paymentInstructionsForm: D && (mt || L && S?.status === "rejected") ? {
352
- isOpen: I.isOpen,
353
- values: I.values,
354
- errors: I.errors,
355
- isSaving: I.isSaving,
356
- onOpen: I.open,
357
- onCancel: I.close,
358
- onChange: I.onChange,
359
- onSave: I.save
360
- } : void 0,
361
- hideMissingPaymentInstructions: S?.status === "paid" || S?.status === "canceled",
362
- isLoading: U,
363
- isError: W,
364
- paymentHistoryError: N.isError || q.isError,
365
- paymentHistoryLoading: N.isResolving || q.isLoading
366
- } : void 0,
367
- isLineItemsLoading: v.isResolving,
368
- isSaving: H,
369
- isSavingDraft: k.isSavingDraft,
370
- isSubmitting: k.isFinalizing,
371
- onCancel: Z,
372
- onCollapse: u ? Xe : void 0,
373
- onSaveDraft: k.saveDraft,
374
- onFinalize: k.finalize,
375
- scrollToErrorToken: k.scrollToErrorToken,
376
- showSubmit: !T && C,
377
- testId: r.dialog
378
- }),
379
- /* @__PURE__ */ s(he, {
380
- open: m,
381
- onSaveDraft: Ft,
382
- onDiscard: Pt,
383
- onCancel: () => h(!1),
384
- isSaving: k.isSavingDraft,
385
- isSaveDraftDisabled: Q,
386
- labels: d.unsavedChanges,
387
- testId: r.unsavedDialog,
388
- saveDraftTestId: r.unsavedSaveDraft,
389
- discardTestId: r.unsavedDiscard,
390
- closeTestId: r.unsavedClose
391
- }),
392
- /* @__PURE__ */ s(n, {
393
- ...gt,
394
- labels: { cancelButton: d.actions.decisionDialog.cancelButton },
395
- testId: r.decisionDialog,
396
- confirmTestId: r.decisionConfirm,
397
- reasonTestId: r.decisionReason
398
- }),
399
- /* @__PURE__ */ s(n, {
400
- ...V.dialog,
401
- labels: { cancelButton: d.actions.decisionDialog.cancelButton },
402
- testId: r.deleteDraftDialog,
403
- confirmTestId: r.deleteDraftConfirm
404
- }),
405
- /* @__PURE__ */ s(n, {
406
- open: $.removeConfirmation.open,
407
- copy: $.removeConfirmation.copy,
408
- onConfirm: $.removeConfirmation.onConfirm,
409
- onCancel: $.removeConfirmation.onCancel,
410
- isPending: $.removeConfirmation.isPending,
411
- confirmIcon: /* @__PURE__ */ s(qe, {}),
412
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
413
- testId: r.duplicateRemoveDialog,
414
- confirmTestId: r.duplicateRemoveConfirm
415
- }),
416
- /* @__PURE__ */ s(me, { ...R.dialogProps }),
417
- u && S ? /* @__PURE__ */ s(xe, {
418
- ref: dt,
419
- payable: S,
420
- onMissingAchInstructions: L ? I.open : void 0,
421
- poweredByBankName: Ze,
422
- labels: d.payBill
423
- }) : null
424
- ] });
425
- }
2
+ var e = {
3
+ dialog: "bill-pay-bill-create-dialog",
4
+ vendorSection: "bill-pay-bill-create-vendor",
5
+ lineItems: "bill-pay-bill-create-line-items",
6
+ documentPanel: "bill-pay-bill-create-document",
7
+ duplicateNotice: "bill-pay-bill-create-duplicate-notice",
8
+ duplicateRemoveDialog: "bill-pay-bill-create-duplicate-remove-dialog",
9
+ duplicateRemoveConfirm: "bill-pay-bill-create-duplicate-remove-confirm",
10
+ decisionDialog: "bill-pay-bill-decision-dialog",
11
+ decisionConfirm: "bill-pay-bill-decision-confirm",
12
+ decisionReason: "bill-pay-bill-decision-reason",
13
+ deleteDraftDialog: "bill-pay-bill-delete-draft-dialog",
14
+ deleteDraftConfirm: "bill-pay-bill-delete-draft-confirm",
15
+ unsavedDialog: "bill-pay-bill-unsaved-dialog",
16
+ unsavedSaveDraft: "bill-pay-bill-unsaved-save-draft",
17
+ unsavedDiscard: "bill-pay-bill-unsaved-discard",
18
+ unsavedClose: "bill-pay-bill-unsaved-close"
19
+ };
426
20
  //#endregion
427
- export { c as BillCreateDialog, c as default };
21
+ export { e as billCreateTestIds };