@tesouro/embedded-components-react 0.4.19 → 0.4.21

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