@tesouro/embedded-components-react 0.11.170 → 0.11.175

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 (43) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/lib/ReceivablesWidget.d.ts +6 -0
  3. package/dist/lib/WidgetSuite.d.ts +6 -0
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +75 -66
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +62 -53
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +44 -38
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +331 -326
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +10 -8
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +190 -187
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +12 -19
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +25 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +4 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +23 -24
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +5 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +196 -187
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +6 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +20 -17
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +11 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +157 -161
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -29
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +7 -6
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/resolveBillDueDate.js +22 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +116 -98
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -92
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +7 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +15 -24
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +59 -69
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  35. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DateDisclosure/DateDisclosure.js +28 -0
  36. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +19 -0
  37. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +28 -27
  38. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/dueDateDisplay.js +23 -0
  39. package/package.json +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -6
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
@@ -10,189 +10,190 @@ import { useAllLedgerAccountsQuery as ee } from "../../../../shared/data-access/
10
10
  import "../../../../shared/data-access/dist/index.js";
11
11
  import { useWidgetConfig as te } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
12
  import { useOrganizationUserNames as ne } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
13
+ import { useLocalCalendarDay as re } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
13
14
  import "../../../../shared/feature/dist/index.js";
14
- import { isEditablePayableStatus as re } from "../../../util/dist/lib/isEditablePayableStatus.js";
15
- import { resolveVendor as ie } from "../../../util/dist/lib/resolveVendor.js";
15
+ import { isEditablePayableStatus as ie } from "../../../util/dist/lib/isEditablePayableStatus.js";
16
+ import { resolveVendor as ae } from "../../../util/dist/lib/resolveVendor.js";
16
17
  import "../../../util/dist/index.js";
17
- import { formatGlCodeLabel as ae, resolveGlCodeAvailability as oe } from "./index15.js";
18
- import { hasUnpaidBalance as se } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
18
+ import { formatGlCodeLabel as oe, resolveGlCodeAvailability as se } from "./index15.js";
19
+ import { hasUnpaidBalance as ce } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
19
20
  import { BillDecisionDialog as r } from "../../../ui/dist/index4.js";
20
21
  import "../../../ui/dist/index.js";
21
- import { BillDialogScreen as ce } from "../../ui/dist/index31.js";
22
- import { BillDuplicateNotice as le } from "../../ui/dist/index37.js";
23
- import { BillRejectedBanner as ue } from "../../ui/dist/index40.js";
24
- import { DiscardChangesDialog as de } from "../../ui/dist/index43.js";
25
- import { ExtractionNotice as fe } from "../../ui/dist/index46.js";
26
- import { UnsavedBillDialog as pe } from "../../ui/dist/index52.js";
22
+ import { BillDialogScreen as le } from "../../ui/dist/index31.js";
23
+ import { BillDuplicateNotice as ue } from "../../ui/dist/index37.js";
24
+ import { BillRejectedBanner as de } from "../../ui/dist/index40.js";
25
+ import { DiscardChangesDialog as fe } from "../../ui/dist/index43.js";
26
+ import { ExtractionNotice as pe } from "../../ui/dist/index46.js";
27
+ import { UnsavedBillDialog as me } from "../../ui/dist/index52.js";
27
28
  import "../../ui/dist/index.js";
28
- import { BILL_CREATE_MESSAGE_LABELS_EN as me, mergeBillDialogCopy as he } from "./index31.js";
29
- import { useAllPayableLineItemsQuery as ge } from "../../data-access/dist/index5.js";
30
- import { usePayableQuery as _e } from "../../data-access/dist/index23.js";
29
+ import { BILL_CREATE_MESSAGE_LABELS_EN as he, mergeBillDialogCopy as ge } from "./index31.js";
30
+ import { useAllPayableLineItemsQuery as _e } from "../../data-access/dist/index5.js";
31
+ import { usePayableQuery as ve } from "../../data-access/dist/index23.js";
31
32
  import "../../data-access/dist/index.js";
32
- import { useBillCreateController as ve } from "./index40.js";
33
- import { useBillForm as ye } from "./index42.js";
34
- import { buildPaymentHistory as be } from "./index2.js";
35
- import { usePayableDuplicateReview as xe } from "./index4.js";
36
- import { canOverrideApprovalPolicy as Se, canReadCounterpartBankAccounts as Ce } from "./index5.js";
37
- import { useApprovalPolicyCardView as we } from "./index14.js";
38
- import { resolveApprovalNotices as Te } from "./index16.js";
39
- import { resolvePaymentInstructionsGestures as Ee } from "./index17.js";
40
- import { useBillRejectionNotice as De } from "./index19.js";
41
- import { useCurrentApprovalRequestId as Oe } from "./index20.js";
42
- import { usePayableAuditHistory as ke } from "./index21.js";
43
- import { usePayableDetailActions as Ae } from "./index22.js";
44
- import { useScheduledDateLabel as je } from "./index23.js";
45
- import { useScheduledPayment as Me } from "./index24.js";
46
- import { useDraftDelete as Ne } from "./index25.js";
47
- import { buildBillDetailView as Pe } from "./index27.js";
48
- import { resolveEditorDismissal as Fe } from "./index28.js";
49
- import { SourceDocumentContainer as Ie } from "./index32.js";
50
- import { usePayableAchInstructions as Le } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
33
+ import { useBillCreateController as ye } from "./index40.js";
34
+ import { useBillForm as be } from "./index42.js";
35
+ import { buildPaymentHistory as xe } from "./index2.js";
36
+ import { usePayableDuplicateReview as Se } from "./index4.js";
37
+ import { canOverrideApprovalPolicy as Ce, canReadCounterpartBankAccounts as we } from "./index5.js";
38
+ import { useApprovalPolicyCardView as Te } from "./index14.js";
39
+ import { resolveApprovalNotices as Ee } from "./index16.js";
40
+ import { resolvePaymentInstructionsGestures as De } from "./index17.js";
41
+ import { useBillRejectionNotice as Oe } from "./index19.js";
42
+ import { useCurrentApprovalRequestId as ke } from "./index20.js";
43
+ import { usePayableAuditHistory as Ae } from "./index21.js";
44
+ import { usePayableDetailActions as je } from "./index22.js";
45
+ import { useScheduledDateLabel as Me } from "./index23.js";
46
+ import { useScheduledPayment as Ne } from "./index24.js";
47
+ import { useDraftDelete as Pe } from "./index25.js";
48
+ import { buildBillDetailView as Fe } from "./index27.js";
49
+ import { resolveEditorDismissal as Ie } from "./index28.js";
50
+ import { SourceDocumentContainer as Le } from "./index32.js";
51
+ import { usePayableAchInstructions as Re } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
51
52
  import "../../../../shared/counterpart-management/feature/dist/index.js";
52
- import { useVendorSectionProps as Re } from "./index35.js";
53
- import { usePayToSave as ze } from "./index36.js";
53
+ import { useVendorSectionProps as ze } from "./index35.js";
54
+ import { usePayToSave as Be } from "./index36.js";
54
55
  import { billDialogTestIds as i } from "./index43.js";
55
- import { useCallback as a, useEffect as Be, useMemo as o, useRef as Ve, useState as s } from "react";
56
- import { Fragment as He, jsx as c, jsxs as Ue } from "react/jsx-runtime";
57
- import { Trash2Icon as We } from "lucide-react";
56
+ import { useCallback as a, useEffect as Ve, useMemo as o, useRef as He, useState as s } from "react";
57
+ import { Fragment as Ue, jsx as c, jsxs as We } from "react/jsx-runtime";
58
+ import { Trash2Icon as Ge } from "lucide-react";
58
59
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js
59
- function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, readOnly: f = !1, copy: p, onCollapse: m, onEdit: Ke, onOpenBill: h, renderPaymentFlows: qe }) {
60
- let g = o(() => he(p), [p]), _ = p?.messages, v = o(() => ({
61
- ...me,
62
- ..._
63
- }), [_]), Je = d ? void 0 : Ge, [Ye, Xe] = s(Je), [y, Ze] = s(!!Je), [Qe, $e] = s(!1), [b, x] = s(!1), [et, tt] = s(), S = a((e) => {
64
- tt(() => e);
65
- }, []), [nt, rt] = s(), C = d ?? nt, w = _e(C, {
60
+ function Ke({ open: Ke, onOpenChange: l, payableId: qe, initialCounterpartId: Je, readOnly: u = !1, copy: d, onCollapse: Ye, onEdit: Xe, onOpenBill: f, renderPaymentFlows: Ze }) {
61
+ let p = o(() => ge(d), [d]), m = d?.messages, h = o(() => ({
62
+ ...he,
63
+ ...m
64
+ }), [m]), Qe = qe ? void 0 : Je, [g, $e] = s(Qe), [_, et] = s(!!Qe), [tt, nt] = s(!1), [v, y] = s(!1), [rt, b] = s(), x = a((e) => {
65
+ b(() => e);
66
+ }, []), [it, at] = s(), S = qe ?? it, C = ve(S, {
66
67
  pollWhileOcrProcessing: !0,
67
68
  pollWhilePolicyAssignmentUnsettled: !0
68
- }), T = ge(C), { initResponse: E } = te(), it = !!E, at = t(E?.scopes, [n.AccountingConfigReadOrg]), D = ee({ enabled: at }), O = w.data, k = !C || !!O, A = !f && k && !!C && O?.status !== "draft", ot = !f && !!O && !re(O?.status), j = f || ot, M = ye({
69
- payable: O,
70
- lineItems: T.lineItems,
71
- labels: v
72
- }), N = O?.counterpart_id ?? void 0;
73
- Be(() => {
74
- y || N && (Xe(N), Ze(!0));
75
- }, [y, N]);
76
- let st = a((e) => {
77
- Ze(!0), Xe(e);
78
- }, []), P = Me({
79
- payableId: C,
80
- scheduledPaymentDate: O?.scheduled_payment_date,
81
- enabled: f || A
82
- }), F = je({
83
- hasScheduledPayment: P.hasScheduledPayment,
84
- scheduledDate: P.scheduledDate,
85
- labels: g.scheduledRelativeDay
86
- }), I = Ce(E?.scopes), ct = t(E?.scopes, [n.PayableWriteOrg]), lt = t(E?.scopes, [n.CounterpartWriteOrg]) && ct, L = lt && se(O?.status) && !P.hasScheduledPayment && !P.isResolving, ut = L && I, dt = L || lt && O?.status === "rejected", ft = !f && k && (!C || O?.status === "draft") && !P.hasScheduledPayment && !P.isResolving, R = Re({
87
- payableId: C,
88
- counterpartId: f ? N : Ye,
89
- payableCounterpartId: N,
90
- isVendorKnown: f ? !!O : k,
91
- onCounterpartChange: st,
92
- requiredError: M.errors?.vendor,
93
- payableCounterpartBankAccountId: O?.counterpart_bank_account_id ?? void 0,
94
- extractedVendor: O?.counterpart_raw_data ?? void 0,
95
- readOnly: f,
96
- canEditVendor: !f || ut,
97
- canEditPaymentInstructions: !f || L,
98
- canAddPaymentInstructions: !f || dt,
99
- confirmDiscard: S,
100
- labels: p?.vendorSection
101
- }), pt = R.activePayToOperation === "missingInstructions" ? ft || dt : R.activePayToOperation === "existingInstructions" ? ft || L : R.activePayToOperation === "vendor" && f ? ut : !1, mt = !!(C && y) && !Ye, z = w.refetch, ht = a(async () => {
69
+ }), w = _e(S), { initResponse: T } = te(), ot = !!T, st = t(T?.scopes, [n.AccountingConfigReadOrg]), E = ee({ enabled: st }), D = C.data, O = !S || !!D, k = !u && O && !!S && D?.status !== "draft", ct = !u && !!D && !ie(D?.status), A = u || ct, j = be({
70
+ payable: D,
71
+ lineItems: w.lineItems,
72
+ labels: h
73
+ }), M = D?.counterpart_id ?? void 0;
74
+ Ve(() => {
75
+ _ || M && ($e(M), et(!0));
76
+ }, [_, M]);
77
+ let lt = a((e) => {
78
+ et(!0), $e(e);
79
+ }, []), N = Ne({
80
+ payableId: S,
81
+ scheduledPaymentDate: D?.scheduled_payment_date,
82
+ enabled: u || k
83
+ }), P = Me({
84
+ hasScheduledPayment: N.hasScheduledPayment,
85
+ scheduledDate: N.scheduledDate,
86
+ labels: p.scheduledRelativeDay
87
+ }), F = we(T?.scopes), ut = t(T?.scopes, [n.PayableWriteOrg]), I = t(T?.scopes, [n.CounterpartWriteOrg]) && ut, L = I && ce(D?.status) && !N.hasScheduledPayment && !N.isResolving, dt = L && F, ft = L || I && D?.status === "rejected", pt = !u && O && (!S || D?.status === "draft") && !N.hasScheduledPayment && !N.isResolving, R = ze({
88
+ payableId: S,
89
+ counterpartId: u ? M : g,
90
+ payableCounterpartId: M,
91
+ isVendorKnown: u ? !!D : O,
92
+ onCounterpartChange: lt,
93
+ requiredError: j.errors?.vendor,
94
+ payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
95
+ extractedVendor: D?.counterpart_raw_data ?? void 0,
96
+ readOnly: u,
97
+ canEditVendor: !u || dt,
98
+ canEditPaymentInstructions: !u || L,
99
+ canAddPaymentInstructions: !u || ft,
100
+ confirmDiscard: x,
101
+ labels: d?.vendorSection
102
+ }), mt = R.activePayToOperation === "missingInstructions" ? pt || ft : R.activePayToOperation === "existingInstructions" ? pt || L : R.activePayToOperation === "vendor" && u ? dt : !1, ht = !!(S && _) && !g, z = C.refetch, gt = a(async () => {
102
103
  let { data: e } = await z();
103
104
  return e?.status ?? void 0;
104
- }, [z]), { vendorWithInlineSave: B, isSavingPayToEdits: gt } = ze({
105
+ }, [z]), { vendorWithInlineSave: B, isSavingPayToEdits: _t } = Be({
105
106
  vendor: R,
106
- payableId: C,
107
- linkedCounterpartId: O?.counterpart_id,
108
- linkedBankAccountId: O?.counterpart_bank_account_id,
109
- canSavePayToEdits: pt,
110
- readOnly: f,
107
+ payableId: S,
108
+ linkedCounterpartId: D?.counterpart_id,
109
+ linkedBankAccountId: D?.counterpart_bank_account_id,
110
+ canSavePayToEdits: mt,
111
+ readOnly: u,
111
112
  refreshPayable: z,
112
- labels: g.detail
113
- }), _t = o(() => A ? {
114
- ..._,
115
- draftSaved: v.submittedSaved
116
- } : _, [
117
- A,
118
- _,
119
- v.submittedSaved
120
- ]), V = ve({
121
- payableId: d,
122
- form: M,
123
- labels: _t,
124
- counterpartId: Ye,
113
+ labels: p.detail
114
+ }), vt = o(() => k ? {
115
+ ...m,
116
+ draftSaved: h.submittedSaved
117
+ } : m, [
118
+ k,
119
+ m,
120
+ h.submittedSaved
121
+ ]), V = ye({
122
+ payableId: qe,
123
+ form: j,
124
+ labels: vt,
125
+ counterpartId: g,
125
126
  isVendorPending: R.mode === "creating" || R.isPendingVendor,
126
127
  onVendorIncomplete: R.revealIncompleteVendor,
127
- clearCounterpart: mt,
128
+ clearCounterpart: ht,
128
129
  prepareVendorForSave: R.prepareVendorForSave,
129
- onPayableCreated: rt,
130
- onSaved: rt,
131
- onDraftSaved: () => u(!1),
132
- onFinalized: () => u(!1),
133
- readSavedStatus: A ? ht : void 0
134
- }), vt = !!(V.isSavingDraft || V.isFinalizing || R.isVendorSavePending), H = f ? C : void 0, U = Oe({
130
+ onPayableCreated: at,
131
+ onSaved: at,
132
+ onDraftSaved: () => l(!1),
133
+ onFinalized: () => l(!1),
134
+ readSavedStatus: k ? gt : void 0
135
+ }), yt = !!(V.isSavingDraft || V.isFinalizing || R.isVendorSavePending), H = u ? S : void 0, U = ke({
135
136
  payableId: H,
136
- status: O?.status
137
- }), W = Ve(null), [yt, bt] = s(!1), xt = ie(O), G = Le({
138
- counterpartId: f ? N : void 0,
139
- currency: O?.currency,
140
- currentBankAccountId: f ? O?.counterpart_bank_account_id ?? void 0 : void 0,
141
- enabled: I && f
142
- }), K = we({
137
+ status: D?.status
138
+ }), W = He(null), [bt, xt] = s(!1), St = ae(D), G = Re({
139
+ counterpartId: u ? M : void 0,
140
+ currency: D?.currency,
141
+ currentBankAccountId: u ? D?.counterpart_bank_account_id ?? void 0 : void 0,
142
+ enabled: F && u
143
+ }), K = Te({
143
144
  payableId: H,
144
- approvalPolicyId: O?.approval_policy_id,
145
- status: O?.status,
146
- updatedAt: O?.updated_at,
147
- payableFetchedAt: w.dataUpdatedAt,
148
- enabled: f,
149
- copy: g.approvalPolicyCopy
150
- }), St = Se({
151
- status: O?.status,
152
- scopes: E?.scopes,
145
+ approvalPolicyId: D?.approval_policy_id,
146
+ status: D?.status,
147
+ updatedAt: D?.updated_at,
148
+ payableFetchedAt: C.dataUpdatedAt,
149
+ enabled: u,
150
+ copy: p.approvalPolicyCopy
151
+ }), Ct = Ce({
152
+ status: D?.status,
153
+ scopes: T?.scopes,
153
154
  arePendingApproversUnknown: K.isLoading,
154
- hasApprovalPolicy: !!O?.approval_policy_id,
155
+ hasApprovalPolicy: !!D?.approval_policy_id,
155
156
  hasWaitingRequest: U.hasWaitingRequest
156
- }), Ct = Te({
157
+ }), wt = Ee({
157
158
  isCapabilityUnknown: U.isLoading || K.isLoading,
158
159
  canApproveNow: !!U.id,
159
- canOverridePolicy: St,
160
- status: O?.status,
161
- hasApprovalPolicy: !!O?.approval_policy_id,
160
+ canOverridePolicy: Ct,
161
+ status: D?.status,
162
+ hasApprovalPolicy: !!D?.approval_policy_id,
162
163
  pendingApproverNames: K.pendingApprovers.flatMap((e) => e.names),
163
- labels: g
164
- }), wt = f || A ? C : void 0, Tt = f ? Ke : void 0, q = a((e) => {
164
+ labels: p
165
+ }), Tt = u || k ? S : void 0, Et = u ? Xe : void 0, q = a((e) => {
165
166
  let t = () => {
166
167
  R.discardPayToEdits(), e?.();
167
168
  };
168
- R.hasUnsavedVendorChanges ? S(t) : t();
169
- }, [S, R]), { actions: Et, decisionDialog: Dt, isActionPending: Ot } = Ae({
170
- payableId: wt,
171
- status: O?.status,
169
+ R.hasUnsavedVendorChanges ? x(t) : t();
170
+ }, [x, R]), { actions: Dt, decisionDialog: Ot, isActionPending: kt } = je({
171
+ payableId: Tt,
172
+ status: D?.status,
172
173
  currentApprovalRequestId: U.id,
173
174
  arePendingApproversUnknown: K.isLoading,
174
- hasScheduledPayment: P.hasScheduledPayment,
175
- scheduledPaymentIntentId: P.scheduledPaymentIntentId,
176
- isScheduledPaymentUnknown: P.isResolving,
175
+ hasScheduledPayment: N.hasScheduledPayment,
176
+ scheduledPaymentIntentId: N.scheduledPaymentIntentId,
177
+ isScheduledPaymentUnknown: N.isResolving,
177
178
  isPayabilityUnknown: G.isLoading,
178
- hasApprovalPolicy: !!O?.approval_policy_id,
179
+ hasApprovalPolicy: !!D?.approval_policy_id,
179
180
  hasWaitingRequest: U.hasWaitingRequest,
180
181
  pendingApprovers: K.pendingApprovers,
181
- labels: g.actions,
182
- isMarkAsPaidPending: yt,
182
+ labels: p.actions,
183
+ isMarkAsPaidPending: bt,
183
184
  onMarkAsPaidSelect: () => W.current?.openMarkAsPaid(),
184
185
  onPayBillSelect: () => q(() => W.current?.openPayBill()),
185
- onEditSelect: Tt,
186
+ onEditSelect: Et,
186
187
  onActionSucceeded: (e) => {
187
- e === "reopen" ? Tt?.() : A && u(!1);
188
+ e === "reopen" ? Et?.() : k && l(!1);
188
189
  }
189
- }), kt = Ne({
190
- payableId: C,
191
- status: O?.status,
192
- enabled: !f,
193
- labels: g.deleteDraft,
194
- onDeleted: () => u(!1)
195
- }), At = vt || Ot, jt = O?.ocr_status === "processing", Mt = w.isLoading || T.isResolving || jt, Nt = w.isLoading || T.isResolving || D.isResolving || G.isLoading, Pt = w.isError || T.isError || D.isError, Ft = o(() => [...kt.menuItems, ...A || f && !Nt && !Pt ? Et.menu.map((e) => ({
190
+ }), At = Pe({
191
+ payableId: S,
192
+ status: D?.status,
193
+ enabled: !u,
194
+ labels: p.deleteDraft,
195
+ onDeleted: () => l(!1)
196
+ }), jt = yt || kt, Mt = D?.ocr_status === "processing", Nt = C.isLoading || w.isResolving || Mt, Pt = C.isLoading || w.isResolving || E.isResolving || G.isLoading, Ft = C.isError || w.isError || E.isError, It = o(() => [...At.menuItems, ...k || u && !Pt && !Ft ? Dt.menu.map((e) => ({
196
197
  id: e.id,
197
198
  label: e.label,
198
199
  onSelect: e.onSelect,
@@ -200,150 +201,154 @@ function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, r
200
201
  icon: e.icon,
201
202
  sectionHeading: e.sectionHeading
202
203
  })) : []], [
203
- Et.menu,
204
- kt.menuItems,
205
- A,
206
- f,
207
- Nt,
208
- Pt
209
- ]), J = o(() => (D.data?.data ?? []).map((e) => ({
204
+ Dt.menu,
205
+ At.menuItems,
206
+ k,
207
+ u,
208
+ Pt,
209
+ Ft
210
+ ]), J = o(() => (E.data?.data ?? []).map((e) => ({
210
211
  value: e.id,
211
- label: ae(e)
212
- })), [D.data]), { unavailableMessage: It, disabled: Lt, rosterAvailable: Rt } = oe({
213
- isInitResolved: it,
214
- canReadGlCodes: at,
215
- isResolving: D.isResolving,
216
- isError: D.isError,
212
+ label: oe(e)
213
+ })), [E.data]), { unavailableMessage: Lt, disabled: Rt, rosterAvailable: zt } = se({
214
+ isInitResolved: ot,
215
+ canReadGlCodes: st,
216
+ isResolving: E.isResolving,
217
+ isError: E.isError,
217
218
  optionCount: J.length,
218
- labels: g.lineItemsGlCodeUnavailable
219
- }), zt = O?.status === "rejected" || !f && A, Bt = t(E?.scopes, [n.ApprovalRequestReadOrg]), Vt = zt && Bt, Ht = t(E?.scopes, [n.UserReadOrg]), { userNames: Ut, isError: Wt, isResolving: Gt } = ne({ enabled: (f || zt) && Ht }), { historyQuery: Y, rows: Kt, namesError: qt } = ke({
219
+ labels: p.lineItemsGlCodeUnavailable
220
+ }), Bt = D?.status === "rejected" || !u && k, Vt = t(T?.scopes, [n.ApprovalRequestReadOrg]), Ht = Bt && Vt, Ut = t(T?.scopes, [n.UserReadOrg]), { userNames: Wt, isError: Gt, isResolving: Kt } = ne({ enabled: (u || Bt) && Ut }), { historyQuery: Y, rows: qt, namesError: Jt } = Ae({
220
221
  payableId: H,
221
- userNames: Ut,
222
- isRosterError: Ht && Wt,
223
- labels: g.history
224
- }), X = De({
225
- payableId: C,
226
- payableStatus: O?.status,
227
- payableUpdatedAt: O?.updated_at,
228
- enabled: Vt,
229
- userNames: Ut,
230
- labels: g.detail
231
- }), Jt = o(() => be({
232
- records: P.paymentRecords,
222
+ userNames: Wt,
223
+ isRosterError: Ut && Gt,
224
+ labels: p.history
225
+ }), X = Oe({
226
+ payableId: S,
227
+ payableStatus: D?.status,
228
+ payableUpdatedAt: D?.updated_at,
229
+ enabled: Ht,
230
+ userNames: Wt,
231
+ labels: p.detail
232
+ }), Yt = o(() => xe({
233
+ records: N.paymentRecords,
233
234
  events: Y.data?.data ?? [],
234
- currencyCode: O?.currency,
235
- labels: g.detail
235
+ currencyCode: D?.currency,
236
+ labels: p.detail
236
237
  }), [
237
- P.paymentRecords,
238
+ N.paymentRecords,
238
239
  Y.data,
239
- O?.currency,
240
- g.detail
241
- ]), Yt = o(() => {
242
- if (!f || !O) return;
243
- let e = Pe({
244
- payable: O,
245
- lineItems: T.lineItems,
240
+ D?.currency,
241
+ p.detail
242
+ ]), Xt = re(), Zt = o(() => {
243
+ if (!u || !D) return;
244
+ let e = Fe({
245
+ payable: D,
246
+ lineItems: w.lineItems,
246
247
  glCodeOptions: J,
247
- glCodeRosterAvailable: Rt,
248
- history: Kt,
249
- paymentHistory: Jt,
248
+ glCodeRosterAvailable: zt,
249
+ history: qt,
250
+ paymentHistory: Yt,
250
251
  approvalPolicy: K.view,
251
- labels: g.detail,
252
- hasScheduledPayment: P.hasScheduledPayment,
252
+ labels: p.detail,
253
+ dueDateLabels: p.dueDate,
254
+ today: Xt,
255
+ hasScheduledPayment: N.hasScheduledPayment,
253
256
  rejection: X,
254
257
  payableAchInstructions: G.achInstructions,
255
- payableAchInstructionsReadable: I && !G.isError
258
+ payableAchInstructionsReadable: F && !G.isError
256
259
  });
257
260
  return R.mode === "resolved" && R.summary ? {
258
261
  ...e,
259
262
  payTo: R.summary
260
263
  } : e;
261
264
  }, [
262
- P.hasScheduledPayment,
265
+ N.hasScheduledPayment,
263
266
  K.view,
264
- I,
265
- g.detail,
267
+ Xt,
268
+ F,
269
+ p.detail,
270
+ p.dueDate,
266
271
  J,
267
- Rt,
268
- Kt,
269
- T.lineItems,
270
- O,
272
+ zt,
273
+ qt,
274
+ w.lineItems,
275
+ D,
271
276
  G.achInstructions,
272
277
  G.isError,
273
- Jt,
274
- f,
278
+ Yt,
279
+ u,
275
280
  X,
276
281
  R.mode,
277
282
  R.summary
278
- ]), Xt = O?.source_of_payable_data === "ocr", Z = xt?.name, Zt = f ? Z ? g.viewTitle(Z) : g.readOnlyTitle : Z && (Xt || A) ? g.extractedTitle(Z) : g.newTitle, Qt = f && O?.created_at ? g.addedOn(e(O.created_at.slice(0, 10))) : void 0, Q = M.isDirty || R.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending, $t = a(() => {
279
- if (f && R.isEditingPayTo) q(() => u(!1));
280
- else switch (Fe({
281
- isUnsavedPromptOpen: b,
282
- isLocked: j,
283
+ ]), Qt = D?.source_of_payable_data === "ocr", Z = St?.name, $t = u ? Z ? p.viewTitle(Z) : p.readOnlyTitle : Z && (Qt || k) ? p.extractedTitle(Z) : p.newTitle, en = u && D?.created_at ? p.addedOn(e(D.created_at.slice(0, 10))) : void 0, Q = j.isDirty || R.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending, tn = a(() => {
284
+ if (u && R.isEditingPayTo) q(() => l(!1));
285
+ else switch (Ie({
286
+ isUnsavedPromptOpen: v,
287
+ isLocked: A,
283
288
  isDirty: Q
284
289
  })) {
285
290
  case "dismiss-prompt":
286
- x(!1);
291
+ y(!1);
287
292
  return;
288
293
  case "prompt":
289
- x(!0);
294
+ y(!0);
290
295
  return;
291
- default: u(!1);
296
+ default: l(!1);
292
297
  }
293
298
  }, [
294
299
  Q,
295
- j,
296
- b,
300
+ A,
301
+ v,
297
302
  q,
303
+ l,
298
304
  u,
299
- f,
300
305
  R.isEditingPayTo
301
- ]), en = a((e, t) => {
302
- if (!h) return;
303
- let n = () => h(e, t);
304
- f && R.isEditingPayTo ? q(n) : !j && Q ? S(n) : n();
306
+ ]), nn = a((e, t) => {
307
+ if (!f) return;
308
+ let n = () => f(e, t);
309
+ u && R.isEditingPayTo ? q(n) : !A && Q ? x(n) : n();
305
310
  }, [
306
- S,
311
+ x,
307
312
  Q,
308
- j,
313
+ A,
309
314
  q,
310
- h,
311
315
  f,
316
+ u,
312
317
  R.isEditingPayTo
313
- ]), tn = a(() => {
314
- R.isEditingPayTo ? q(m) : m?.();
318
+ ]), rn = a(() => {
319
+ R.isEditingPayTo ? q(Ye) : Ye?.();
315
320
  }, [
316
321
  q,
317
- m,
322
+ Ye,
318
323
  R.isEditingPayTo
319
- ]), nn = a(() => {
320
- x(!1), u(!1);
321
- }, [u]), rn = Mt || R.mode === "creating", an = a(async () => {
322
- if (rn) return;
324
+ ]), an = a(() => {
325
+ y(!1), l(!1);
326
+ }, [l]), on = Nt || R.mode === "creating", sn = a(async () => {
327
+ if (on) return;
323
328
  let e = await V.saveDraft();
324
- x(!1), e && u(!1);
329
+ y(!1), e && l(!1);
325
330
  }, [
326
331
  V,
327
- rn,
328
- u
329
- ]), $ = xe({
330
- payable: O,
331
- onOpenPayable: h ? en : void 0,
332
- onRemoved: () => u(!1),
333
- canManage: ct
334
- }), on = a((e) => {
335
- if (!(At || $.isBusy)) return e ? u(!0) : $t();
332
+ on,
333
+ l
334
+ ]), $ = Se({
335
+ payable: D,
336
+ onOpenPayable: f ? nn : void 0,
337
+ onRemoved: () => l(!1),
338
+ canManage: ut
339
+ }), cn = a((e) => {
340
+ if (!(jt || $.isBusy)) return e ? l(!0) : tn();
336
341
  }, [
337
342
  $.isBusy,
338
- At,
339
- $t,
340
- u
341
- ]), sn = $.isPossibleDuplicate, cn = !f && Xt && !Qe, ln = !f && !!X, un = ln || sn || cn ? /* @__PURE__ */ Ue(He, { children: [
342
- ln && X ? /* @__PURE__ */ c(ue, {
343
+ jt,
344
+ tn,
345
+ l
346
+ ]), ln = $.isPossibleDuplicate, un = !u && Qt && !tt, dn = !u && !!X, fn = dn || ln || un ? /* @__PURE__ */ We(Ue, { children: [
347
+ dn && X ? /* @__PURE__ */ c(de, {
343
348
  ...X,
344
- labels: g.rejectedBanner
349
+ labels: p.rejectedBanner
345
350
  }) : null,
346
- sn ? /* @__PURE__ */ c(le, {
351
+ ln ? /* @__PURE__ */ c(ue, {
347
352
  title: $.title,
348
353
  meta: $.meta,
349
354
  onNotADuplicate: $.onNotADuplicate,
@@ -356,59 +361,59 @@ function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, r
356
361
  labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
357
362
  testId: i.duplicateNotice
358
363
  }) : null,
359
- cn ? /* @__PURE__ */ c(fe, {
360
- onDismiss: () => $e(!0),
361
- labels: p?.extractionNotice
364
+ un ? /* @__PURE__ */ c(pe, {
365
+ onDismiss: () => nt(!0),
366
+ labels: d?.extractionNotice
362
367
  }) : null
363
368
  ] }) : void 0;
364
- return /* @__PURE__ */ Ue(He, { children: [
365
- /* @__PURE__ */ c(ce, {
366
- open: l,
367
- onOpenChange: on,
368
- title: Zt,
369
- subtitle: Qt,
370
- notice: un,
369
+ return /* @__PURE__ */ We(Ue, { children: [
370
+ /* @__PURE__ */ c(le, {
371
+ open: Ke,
372
+ onOpenChange: cn,
373
+ title: $t,
374
+ subtitle: en,
375
+ notice: fn,
371
376
  vendor: {
372
377
  ...B,
373
378
  testId: i.vendorSection
374
379
  },
375
- values: M.values,
376
- errors: M.errors,
377
- onChange: M.onChange,
380
+ values: j.values,
381
+ errors: j.errors,
382
+ onChange: j.onChange,
378
383
  lineItems: {
379
- items: M.lineItemRows,
384
+ items: j.lineItemRows,
380
385
  glCodeOptions: J,
381
- glCodeDisabled: Lt,
382
- glCodeUnavailableMessage: It,
383
- discount: M.discount,
384
- onDiscountChange: M.onDiscountChange,
385
- onDiscountBlur: M.onDiscountBlur,
386
- tax: M.tax,
387
- onTaxChange: M.onTaxChange,
388
- onTaxBlur: M.onTaxBlur,
389
- total: M.total,
390
- onTotalChange: M.onTotalChange,
391
- onTotalBlur: M.onTotalBlur,
392
- onAddLineItem: M.onAddLineItem,
393
- errors: M.lineItemErrors,
394
- totalsErrors: M.totalsErrors,
386
+ glCodeDisabled: Rt,
387
+ glCodeUnavailableMessage: Lt,
388
+ discount: j.discount,
389
+ onDiscountChange: j.onDiscountChange,
390
+ onDiscountBlur: j.onDiscountBlur,
391
+ tax: j.tax,
392
+ onTaxChange: j.onTaxChange,
393
+ onTaxBlur: j.onTaxBlur,
394
+ total: j.total,
395
+ onTotalChange: j.onTotalChange,
396
+ onTotalBlur: j.onTotalBlur,
397
+ onAddLineItem: j.onAddLineItem,
398
+ errors: j.lineItemErrors,
399
+ totalsErrors: j.totalsErrors,
395
400
  testId: i.lineItems
396
401
  },
397
- documentPanel: /* @__PURE__ */ c(Ie, {
398
- payableId: C,
399
- readOnly: j,
400
- isDocumentPending: !!C && !O?.file && (w.isLoading || O?.ocr_status === "processing"),
401
- file: O?.file ? {
402
- id: O.file.id,
403
- name: O.file.name,
404
- url: O.file.url,
405
- mimetype: O.file.mimetype
402
+ documentPanel: /* @__PURE__ */ c(Le, {
403
+ payableId: S,
404
+ readOnly: A,
405
+ isDocumentPending: !!S && !D?.file && (C.isLoading || D?.ocr_status === "processing"),
406
+ file: D?.file ? {
407
+ id: D.file.id,
408
+ name: D.file.name,
409
+ url: D.file.url,
410
+ mimetype: D.file.mimetype
406
411
  } : void 0,
407
412
  staging: {
408
413
  stagedFile: V.stagedFile,
409
414
  onFileStaged: V.stageFile,
410
415
  onClearStagedFile: V.clearStagedFile,
411
- isSaving: vt
416
+ isSaving: yt
412
417
  },
413
418
  deletion: {
414
419
  isPending: V.isFileDeletionPending,
@@ -417,78 +422,78 @@ function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, r
417
422
  isDeleting: V.isDeletingFile,
418
423
  hasFailed: V.hasFileDeletionFailed
419
424
  },
420
- labels: p?.sourceDocument
425
+ labels: d?.sourceDocument
421
426
  }),
422
- menuItems: Ft,
423
- readOnly: j,
424
- detail: f ? {
425
- view: Yt,
426
- actions: Et,
427
- scheduledSummary: F ? g.scheduledSummary(F.label) : void 0,
428
- scheduledSummaryDate: F?.absoluteLabel,
429
- scheduledStatusLabel: F ? g.scheduledStatusBadge(F.label) : void 0,
430
- ...Ct,
427
+ menuItems: It,
428
+ readOnly: A,
429
+ detail: u ? {
430
+ view: Zt,
431
+ actions: Dt,
432
+ scheduledSummary: P ? p.scheduledSummary(P.label) : void 0,
433
+ scheduledSummaryDate: P?.absoluteLabel,
434
+ scheduledStatusLabel: P ? p.scheduledStatusBadge(P.label) : void 0,
435
+ ...wt,
431
436
  payTo: {
432
437
  onEdit: B.mode === "resolved" ? B.onEdit : void 0,
433
- paymentInstructions: O?.status === "paid" || O?.status === "canceled" ? void 0 : Ee(B.paymentInstructionsEditor, !!Yt?.payTo.hasPaymentInstructions),
438
+ paymentInstructions: D?.status === "paid" || D?.status === "canceled" ? void 0 : De(B.paymentInstructionsEditor, !!Zt?.payTo.hasPaymentInstructions),
434
439
  detailsWarning: B.detailsWarning,
435
440
  editForm: B.mode === "creating" ? B.newVendorForm : void 0
436
441
  },
437
- isLoading: Nt,
438
- isError: Pt,
439
- paymentHistoryError: P.isError || Y.isError,
440
- paymentHistoryLoading: P.isResolving || Y.isLoading,
442
+ isLoading: Pt,
443
+ isError: Ft,
444
+ paymentHistoryError: N.isError || Y.isError,
445
+ paymentHistoryLoading: N.isResolving || Y.isLoading,
441
446
  historyError: Y.isError,
442
- historyLoading: Y.isLoading || Gt,
443
- historyNamesError: qt
447
+ historyLoading: Y.isLoading || Kt,
448
+ historyNamesError: Jt
444
449
  } : void 0,
445
- isLineItemsLoading: Mt,
446
- isSaving: At || gt,
450
+ isLineItemsLoading: Nt,
451
+ isSaving: jt || _t,
447
452
  isSavingDraft: V.isSavingDraft,
448
453
  isSubmitting: V.isFinalizing,
449
- onCancel: $t,
450
- onCollapse: f ? tn : void 0,
454
+ onCancel: tn,
455
+ onCollapse: u ? rn : void 0,
451
456
  onSaveDraft: V.saveDraft,
452
457
  onFinalize: V.finalize,
453
458
  scrollToErrorToken: V.scrollToErrorToken,
454
- showSubmit: !j && k,
459
+ showSubmit: !A && O,
455
460
  testId: i.dialog,
456
- labels: p?.screen
461
+ labels: d?.screen
457
462
  }),
458
- /* @__PURE__ */ c(pe, {
459
- open: b,
460
- onSaveDraft: an,
461
- onDiscard: nn,
462
- onCancel: () => x(!1),
463
+ /* @__PURE__ */ c(me, {
464
+ open: v,
465
+ onSaveDraft: sn,
466
+ onDiscard: an,
467
+ onCancel: () => y(!1),
463
468
  isSaving: V.isSavingDraft,
464
- isSaveDraftDisabled: rn,
465
- labels: g.unsavedChanges,
469
+ isSaveDraftDisabled: on,
470
+ labels: p.unsavedChanges,
466
471
  testId: i.unsavedDialog,
467
472
  saveDraftTestId: i.unsavedSaveDraft,
468
473
  discardTestId: i.unsavedDiscard,
469
474
  closeTestId: i.unsavedClose
470
475
  }),
471
- /* @__PURE__ */ c(de, {
472
- open: !!et,
476
+ /* @__PURE__ */ c(fe, {
477
+ open: !!rt,
473
478
  onDiscard: () => {
474
- let e = et;
475
- tt(void 0), e?.();
479
+ let e = rt;
480
+ b(void 0), e?.();
476
481
  },
477
- onKeepEditing: () => tt(void 0),
478
- labels: g.discardChanges,
482
+ onKeepEditing: () => b(void 0),
483
+ labels: p.discardChanges,
479
484
  testId: i.discardDialog,
480
485
  discardTestId: i.discardConfirm
481
486
  }),
482
487
  /* @__PURE__ */ c(r, {
483
- ...Dt,
484
- labels: { cancelButton: g.actions.decisionDialog.cancelButton },
488
+ ...Ot,
489
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
485
490
  testId: i.decisionDialog,
486
491
  confirmTestId: i.decisionConfirm,
487
492
  reasonTestId: i.decisionReason
488
493
  }),
489
494
  /* @__PURE__ */ c(r, {
490
- ...kt.dialog,
491
- labels: { cancelButton: g.actions.decisionDialog.cancelButton },
495
+ ...At.dialog,
496
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
492
497
  testId: i.deleteDraftDialog,
493
498
  confirmTestId: i.deleteDraftConfirm
494
499
  }),
@@ -498,7 +503,7 @@ function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, r
498
503
  onConfirm: $.removeConfirmation.onConfirm,
499
504
  onCancel: $.removeConfirmation.onCancel,
500
505
  isPending: $.removeConfirmation.isPending,
501
- confirmIcon: $.isRemoveBillDestructive ? /* @__PURE__ */ c(We, {}) : void 0,
506
+ confirmIcon: $.isRemoveBillDestructive ? /* @__PURE__ */ c(Ge, {}) : void 0,
502
507
  labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
503
508
  testId: i.duplicateRemoveDialog,
504
509
  confirmTestId: i.duplicateRemoveConfirm
@@ -511,15 +516,15 @@ function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, r
511
516
  isPending: $.keepRowConfirmation.isPending,
512
517
  labels: { cancelButton: $.keepRowConfirmation.cancelButtonLabel }
513
518
  }),
514
- qe?.({
519
+ Ze?.({
515
520
  ref: W,
516
- payable: O,
521
+ payable: D,
517
522
  payableId: H,
518
- isPayBillEnabled: f,
519
- hasScheduledPayment: P.hasScheduledPayment,
520
- onMissingAchInstructions: lt ? R.openPaymentInstructions : void 0,
521
- onMarkAsPaidPendingChange: bt
523
+ isPayBillEnabled: u,
524
+ hasScheduledPayment: N.hasScheduledPayment,
525
+ onMissingAchInstructions: I ? R.openPaymentInstructions : void 0,
526
+ onMarkAsPaidPendingChange: xt
522
527
  })
523
528
  ] });
524
529
  }
525
- export { l as BillDialog, l as default };
530
+ export { Ke as BillDialog, Ke as default };