@tesouro/embedded-components-react 0.4.4 → 0.4.6

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 (69) hide show
  1. package/README.md +37 -37
  2. package/dist/index.d.ts +14 -8
  3. package/dist/lib/CreditCardsWidget.d.ts +4 -2
  4. package/dist/lib/DebitCardsWidget.d.ts +4 -2
  5. package/dist/lib/WidgetSuite.d.ts +14 -8
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +8 -8
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +50 -29
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +39 -30
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +26 -311
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +326 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +13 -27
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +28 -245
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +256 -92
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +86 -73
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +77 -14
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +18 -63
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +4 -4
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +72 -56
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +77 -48
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +47 -91
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +91 -33
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +33 -167
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +168 -75
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +75 -21
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +23 -210
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +199 -203
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +198 -89
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +105 -13
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +12 -47
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +47 -31
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +27 -198
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +198 -30
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +30 -234
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +240 -18
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +19 -341
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +344 -4
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +4 -33
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +32 -83
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +25 -25
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +2 -2
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +2 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +28 -3
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +152 -131
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +32 -27
  64. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +84 -87
  65. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +0 -1
  66. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  67. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +2 -2
  68. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +12 -10
  69. package/package.json +1 -1
@@ -1,4 +1,344 @@
1
- import "./index41.js";
2
- import "./index50.js";
3
- import "./index52.js";
4
- import "./index54.js";
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 { usePayableHistoryQuery as ie } from "../../data-access/dist/index9.js";
14
+ import { useAllPayableLineItemsQuery as ae } from "../../data-access/dist/index10.js";
15
+ import { usePayableQuery as oe } from "../../data-access/dist/index15.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { resolveVendor as se } from "./index5.js";
18
+ import { BillCreateScreen as ce } from "../../ui/dist/index45.js";
19
+ import { BillDecisionDialog as n } from "../../ui/dist/index51.js";
20
+ import { BillDuplicateNotice as le } from "../../ui/dist/index61.js";
21
+ import { ExtractionNotice as ue } from "../../ui/dist/index79.js";
22
+ import { MarkAsPaidDialog as de } from "../../ui/dist/index88.js";
23
+ import { UnsavedBillDialog as fe } from "../../ui/dist/index98.js";
24
+ import "../../ui/dist/index.js";
25
+ import { usePayableDuplicateReview as pe } from "./index10.js";
26
+ import "./index11.js";
27
+ import { resolveAmountDueMinorUnits as me } from "./index17.js";
28
+ import { PayBillFlow as he } from "./index23.js";
29
+ import "./index24.js";
30
+ import { useMarkAsPaidFlow as ge } from "./index14.js";
31
+ import "./index15.js";
32
+ import { BILL_CREATE_MESSAGE_LABELS_EN as _e, mergeBillCreateScreenCopy as ve } from "./index42.js";
33
+ import { useBillCreateController as ye } from "./index51.js";
34
+ import { useBillForm as be } from "./index53.js";
35
+ import { useApprovalPolicyCardView as xe } from "./index30.js";
36
+ import { useCurrentApprovalRequestId as Se } from "./index31.js";
37
+ import { usePayableDetailActions as Ce } from "./index32.js";
38
+ import { useScheduledPayment as we } from "./index33.js";
39
+ import { isEditablePayableStatus as Te } from "./index34.js";
40
+ import { useDraftDelete as Ee } from "./index35.js";
41
+ import { buildBillDetailView as De } from "./index38.js";
42
+ import { buildBillHistory as Oe } from "./index39.js";
43
+ import { SourceDocumentContainer as ke } from "./index43.js";
44
+ import { useVendorSectionProps as Ae } from "./index46.js";
45
+ import { usePaymentInstructionsForm as je } from "./index47.js";
46
+ import { billCreateTestIds as r } from "./index54.js";
47
+ import { useCallback as i, useEffect as Me, useMemo as a, useRef as Ne, useState as o } from "react";
48
+ import { Fragment as Pe, jsx as s, jsxs as Fe } from "react/jsx-runtime";
49
+ import { Trash2Icon as Ie } from "lucide-react";
50
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
51
+ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Le, poweredByBankName: Re }) {
52
+ let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [ze, Be] = o(!1), [Ve, v] = o(!1), [He, y] = o(), b = u ?? He, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", Ue = !d && !!D && !Te(D?.status), A = d || Ue, j = be({
53
+ payable: D,
54
+ lineItems: S.lineItems
55
+ }), M = D?.counterpart_id;
56
+ Me(() => {
57
+ g || M && (h(M), _(!0));
58
+ }, [g, M]);
59
+ let We = i((e) => {
60
+ _(!0), h(e);
61
+ }, []), N = Ae({
62
+ payableId: d ? void 0 : b,
63
+ counterpartId: d ? void 0 : m,
64
+ payableCounterpartId: M,
65
+ onCounterpartChange: We,
66
+ requiredError: j.errors?.vendor,
67
+ payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
68
+ extractedVendor: D?.counterpart_raw_data ?? void 0
69
+ }), Ge = !!(b && g) && !m, Ke = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), qe = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Je = i(async () => {
70
+ let { data: e } = await P();
71
+ return e?.status ?? void 0;
72
+ }, [P]), F = ye({
73
+ payableId: u,
74
+ form: j,
75
+ labels: qe,
76
+ counterpartId: m,
77
+ clearCounterpart: Ge,
78
+ prepareVendorForSave: N.savePaymentInstructions,
79
+ onPayableCreated: y,
80
+ onSaved: y,
81
+ onDraftSaved: () => l(!1),
82
+ onFinalized: () => l(!1),
83
+ readSavedStatus: k ? Je : void 0
84
+ }), I = !!(F.isSavingDraft || F.isFinalizing), L = d ? b : void 0, R = Se({
85
+ payableId: L,
86
+ status: D?.status
87
+ }), Ye = Ne(null), z = we({
88
+ payableId: b,
89
+ scheduledPaymentDate: D?.scheduled_payment_date,
90
+ enabled: d || k
91
+ }), Xe = se(D), B = je({
92
+ payableId: L,
93
+ counterpartId: d ? M : void 0,
94
+ saveErrorMessage: p.detail.paymentInstructionsSaveError,
95
+ linkErrorMessage: p.detail.paymentInstructionsLinkError
96
+ }), Ze = e(C?.scopes, [t.PayableWriteOrg]), Qe = e(C?.scopes, [t.CounterpartWriteOrg]) && Ze, V = ge({
97
+ payableId: L,
98
+ amountDueMinorUnits: me(D) ?? 0,
99
+ amountToPayMinorUnits: D?.amount_to_pay ?? void 0,
100
+ currencyCode: D?.currency ?? void 0,
101
+ dueDate: D?.due_date,
102
+ hasScheduledPayment: z.hasScheduledPayment,
103
+ labels: p.markAsPaid
104
+ }), H = xe({
105
+ payableId: L,
106
+ approvalPolicyId: D?.approval_policy_id,
107
+ enabled: d,
108
+ copy: p.approvalPolicyCopy
109
+ }), { actions: U, decisionDialog: $e, isActionPending: et } = Ce({
110
+ payableId: d || k ? b : void 0,
111
+ status: D?.status,
112
+ currentApprovalRequestId: R.id,
113
+ isPolicyApprover: R.isPolicyApprover,
114
+ hasWaitingRequest: R.hasWaitingRequest,
115
+ arePendingApproversUnknown: H.isLoading,
116
+ hasScheduledPayment: z.hasScheduledPayment,
117
+ scheduledPaymentIntentId: z.scheduledPaymentIntentId,
118
+ isScheduledPaymentUnknown: z.isResolving,
119
+ pendingApprovers: H.pendingApprovers,
120
+ labels: p.actions,
121
+ isMarkAsPaidPending: V.isPending,
122
+ onMarkAsPaidSelect: V.open,
123
+ onPayBillSelect: () => Ye.current?.open(),
124
+ onActionSucceeded: k ? () => l(!1) : void 0
125
+ }), W = Ee({
126
+ payableId: b,
127
+ status: D?.status,
128
+ enabled: !d,
129
+ labels: p.deleteDraft,
130
+ onDeleted: () => l(!1)
131
+ }), G = I || et, tt = a(() => [...W.menuItems, ...k ? U.menu.map((e) => ({
132
+ id: e.id,
133
+ label: e.label,
134
+ onSelect: e.onSelect,
135
+ disabled: e.disabled
136
+ })) : []], [
137
+ U.menu,
138
+ W.menuItems,
139
+ k
140
+ ]), K = a(() => (E.data?.data ?? []).map((e) => ({
141
+ value: e.id,
142
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
143
+ })), [E.data]), q;
144
+ w && (T ? E.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !E.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
145
+ let nt = !w || !!q || E.isResolving, rt = T && !E.isResolving && !E.isError, it = ie(L), at = e(C?.scopes, [t.UserReadOrg]), ot = te({ enabled: d && at }), J = a(() => Oe(it.data?.data ?? [], ot.data?.data ?? [], p.history), [
146
+ it.data,
147
+ ot.data,
148
+ p.history
149
+ ]), st = a(() => d && D ? De({
150
+ payable: D,
151
+ lineItems: S.lineItems,
152
+ glCodeOptions: K,
153
+ glCodeRosterAvailable: rt,
154
+ history: J,
155
+ approvalPolicy: H.view,
156
+ labels: p.detail,
157
+ hasScheduledPayment: z.hasScheduledPayment
158
+ }) : void 0, [
159
+ z.hasScheduledPayment,
160
+ H.view,
161
+ p.detail,
162
+ K,
163
+ rt,
164
+ J,
165
+ S.lineItems,
166
+ D,
167
+ d
168
+ ]), ct = D?.source_of_payable_data === "ocr", Y = Xe?.name, lt = d ? Y ? p.viewTitle(Y) : p.readOnlyTitle : Y && (ct || k) ? p.extractedTitle(Y) : p.newTitle, ut = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, X = i(() => {
169
+ let e = j.isDirty || N.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
170
+ if (!A && e) {
171
+ v(!0);
172
+ return;
173
+ }
174
+ l(!1);
175
+ }, [
176
+ F.isFileDeletionPending,
177
+ F.stagedFile,
178
+ j.isDirty,
179
+ A,
180
+ l,
181
+ N.hasUnsavedVendorChanges
182
+ ]), dt = i(() => {
183
+ v(!1), l(!1);
184
+ }, [l]), Z = S.isResolving || N.mode === "creating", ft = i(async () => {
185
+ if (Z) return;
186
+ let e = await F.saveDraft();
187
+ v(!1), e && l(!1);
188
+ }, [
189
+ F,
190
+ Z,
191
+ l
192
+ ]), Q = pe({
193
+ payable: D,
194
+ onRemoved: () => l(!1),
195
+ canManage: Ze
196
+ }), pt = i((e) => {
197
+ if (!(G || Q.isBusy)) return e ? l(!0) : X();
198
+ }, [
199
+ Q.isBusy,
200
+ G,
201
+ X,
202
+ l
203
+ ]), mt = Q.isPossibleDuplicate, $ = !d && ct && !ze, ht = mt || $ ? /* @__PURE__ */ Fe(Pe, { children: [mt ? /* @__PURE__ */ s(le, {
204
+ onNotADuplicate: Q.onNotADuplicate,
205
+ onRemoveBill: Q.onRemoveBill,
206
+ isActionDisabled: Q.isBusy,
207
+ labels: Q.removeBillLabel ? { removeBillButton: Q.removeBillLabel } : void 0,
208
+ testId: r.duplicateNotice
209
+ }) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () => Be(!0) }) : null] }) : void 0;
210
+ return /* @__PURE__ */ Fe(Pe, { children: [
211
+ /* @__PURE__ */ s(ce, {
212
+ open: c,
213
+ onOpenChange: pt,
214
+ title: lt,
215
+ subtitle: ut,
216
+ notice: ht,
217
+ vendor: {
218
+ ...N,
219
+ testId: r.vendorSection
220
+ },
221
+ values: j.values,
222
+ errors: j.errors,
223
+ onChange: j.onChange,
224
+ lineItems: {
225
+ items: j.lineItemRows,
226
+ glCodeOptions: K,
227
+ glCodeDisabled: nt,
228
+ glCodeUnavailableMessage: q,
229
+ discount: j.discount,
230
+ onDiscountChange: j.onDiscountChange,
231
+ tax: j.tax,
232
+ onTaxChange: j.onTaxChange,
233
+ total: j.total,
234
+ onTotalChange: j.onTotalChange,
235
+ onAddLineItem: j.onAddLineItem,
236
+ errors: j.lineItemErrors,
237
+ totalsErrors: j.totalsErrors,
238
+ testId: r.lineItems
239
+ },
240
+ documentPanel: /* @__PURE__ */ s(ke, {
241
+ payableId: b,
242
+ readOnly: A,
243
+ isDocumentPending: !!b && !D?.file && (x.isLoading || D?.ocr_status === "processing"),
244
+ file: D?.file ? {
245
+ id: D.file.id,
246
+ name: D.file.name,
247
+ url: D.file.url,
248
+ mimetype: D.file.mimetype
249
+ } : void 0,
250
+ staging: {
251
+ stagedFile: F.stagedFile,
252
+ onFileStaged: F.stageFile,
253
+ onClearStagedFile: F.clearStagedFile,
254
+ isSaving: I
255
+ },
256
+ deletion: {
257
+ isPending: F.isFileDeletionPending,
258
+ onRequest: F.requestFileDeletion,
259
+ onDetachNow: F.detachFileNow,
260
+ isDeleting: F.isDeletingFile,
261
+ hasFailed: F.hasFileDeletionFailed
262
+ }
263
+ }),
264
+ menuItems: tt,
265
+ readOnly: A,
266
+ detail: d ? {
267
+ view: st,
268
+ actions: U,
269
+ scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? p.scheduledSummary(z.scheduledDateLabel) : void 0,
270
+ paymentInstructionsForm: M && Qe ? {
271
+ isOpen: B.isOpen,
272
+ values: B.values,
273
+ errors: B.errors,
274
+ isSaving: B.isSaving,
275
+ onOpen: B.open,
276
+ onCancel: B.close,
277
+ onChange: B.onChange,
278
+ onSave: B.save
279
+ } : void 0,
280
+ isLoading: x.isLoading || S.isResolving || E.isResolving,
281
+ isError: x.isError || S.isError || E.isError
282
+ } : void 0,
283
+ isLineItemsLoading: S.isResolving,
284
+ isSaving: G,
285
+ isSavingDraft: F.isSavingDraft,
286
+ isFinalizing: F.isFinalizing,
287
+ onCancel: X,
288
+ onCollapse: d ? Le : void 0,
289
+ onSaveDraft: F.saveDraft,
290
+ onFinalize: F.finalize,
291
+ scrollToErrorToken: F.scrollToErrorToken,
292
+ showFinalize: !k && O,
293
+ labels: Ke,
294
+ testId: r.dialog
295
+ }),
296
+ /* @__PURE__ */ s(fe, {
297
+ open: Ve,
298
+ onSaveDraft: ft,
299
+ onDiscard: dt,
300
+ onCancel: () => v(!1),
301
+ isSaving: F.isSavingDraft,
302
+ isSaveDraftDisabled: Z,
303
+ labels: p.unsavedChanges,
304
+ testId: r.unsavedDialog,
305
+ saveDraftTestId: r.unsavedSaveDraft,
306
+ discardTestId: r.unsavedDiscard,
307
+ closeTestId: r.unsavedClose
308
+ }),
309
+ /* @__PURE__ */ s(n, {
310
+ ...$e,
311
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
312
+ testId: r.decisionDialog,
313
+ confirmTestId: r.decisionConfirm,
314
+ reasonTestId: r.decisionReason
315
+ }),
316
+ /* @__PURE__ */ s(n, {
317
+ ...W.dialog,
318
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
319
+ testId: r.deleteDraftDialog,
320
+ confirmTestId: r.deleteDraftConfirm
321
+ }),
322
+ /* @__PURE__ */ s(n, {
323
+ open: Q.removeConfirmation.open,
324
+ copy: Q.removeConfirmation.copy,
325
+ onConfirm: Q.removeConfirmation.onConfirm,
326
+ onCancel: Q.removeConfirmation.onCancel,
327
+ isPending: Q.removeConfirmation.isPending,
328
+ confirmIcon: /* @__PURE__ */ s(Ie, {}),
329
+ labels: { cancelButton: Q.removeConfirmation.cancelButtonLabel },
330
+ testId: r.duplicateRemoveDialog,
331
+ confirmTestId: r.duplicateRemoveConfirm
332
+ }),
333
+ /* @__PURE__ */ s(de, { ...V.dialogProps }),
334
+ d && D ? /* @__PURE__ */ s(he, {
335
+ ref: Ye,
336
+ payable: D,
337
+ onMissingAchInstructions: Qe ? B.open : void 0,
338
+ poweredByBankName: Re,
339
+ labels: p.payBill
340
+ }) : null
341
+ ] });
342
+ }
343
+ //#endregion
344
+ export { c as BillCreateDialog, c as default };
@@ -1,33 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index56.js";
2
- import "../../ui/dist/index.js";
3
- import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
4
- import "./index15.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
6
- import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index39.js";
7
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
8
- var a = {
9
- subtitle: "Accounts payable",
10
- vendorRow: "Vendor",
11
- bankAccountRow: "ACH bank account",
12
- bankAccountValue: (e) => `Account ending in ${e}`,
13
- invoiceNumberRow: "Number",
14
- issueDateRow: "Issue date",
15
- dueDateRow: "Due date",
16
- poNumberRow: "PO number",
17
- notProvided: "Not provided",
18
- glCodeMissing: "GL code not specified",
19
- quantityValue: (e, t) => `${e} x ${t}`,
20
- subtotalRow: "Subtotal",
21
- discountsRow: "Discounts",
22
- taxRow: "Tax",
23
- totalRow: "Total",
24
- actionError: r.actionError,
25
- actionSuccess: r.actionSuccess,
26
- scheduledSummary: i,
27
- sheet: e,
28
- decisionDialog: r.decisionDialog,
29
- approvalPolicyCopy: n,
30
- markAsPaid: t
31
- };
32
- //#endregion
33
- export { a as BILL_DETAILS_LABELS_EN };
1
+ import "./index42.js";
2
+ import "./index51.js";
3
+ import "./index53.js";
4
+ import "./index55.js";
@@ -1,85 +1,34 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index4.js";
3
- import { resolveVendor as n, resolveVendorName as r } from "./index5.js";
4
- import { formatBillMoney as i } from "./index36.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index56.js";
2
+ import "../../ui/dist/index.js";
3
+ import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
4
+ import "./index15.js";
5
+ import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
6
+ import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index40.js";
5
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
6
- function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c, hasScheduledPayment: l, now: u }) {
7
- let d = a.currency, f = (e) => i(e, d), p = t({
8
- apiStatus: a.status,
9
- dueDate: a.due_date,
10
- scheduledPaymentDate: a.scheduled_payment_date,
11
- hasScheduledPayment: l,
12
- now: u
13
- }), m = n(a), h = r(a), g = e(a.issued_at) || c.notProvided, _ = e(a.due_date) || c.notProvided, v = [{
14
- label: c.vendorRow,
15
- value: h || c.notProvided,
16
- secondaryValue: m?.email ?? void 0
17
- }], y = m?.bank_account?.account_number;
18
- y && v.push({
19
- label: c.bankAccountRow,
20
- value: c.bankAccountValue(y.slice(-4))
21
- });
22
- let b = [
23
- {
24
- label: c.invoiceNumberRow,
25
- value: a.document_id || c.notProvided
26
- },
27
- {
28
- label: c.issueDateRow,
29
- value: g
30
- },
31
- {
32
- label: c.dueDateRow,
33
- value: _
34
- },
35
- {
36
- label: c.poNumberRow,
37
- value: c.notProvided
38
- }
39
- ], x = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), S = o.map((e) => {
40
- let t = f(e.unit_price);
41
- return {
42
- id: e.id,
43
- description: e.name ?? e.description ?? "",
44
- glCodeLabel: (e.ledger_account_id ? x.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
45
- quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
46
- amountLabel: f(e.subtotal) ?? ""
47
- };
48
- }), C = [
49
- {
50
- label: c.subtotalRow,
51
- value: a.subtotal
52
- },
53
- {
54
- label: c.discountsRow,
55
- value: a.discount
56
- },
57
- {
58
- label: c.taxRow,
59
- value: a.tax_amount
60
- }
61
- ].map(({ label: e, value: t }) => ({
62
- label: e,
63
- value: f(t)
64
- })).filter((e) => !!e.value), w = f(a.total_amount);
65
- return w && C.push({
66
- label: c.totalRow,
67
- value: w,
68
- emphasis: !0
69
- }), {
70
- title: h,
71
- subtitle: c.subtitle,
72
- status: p.status,
73
- statusTone: p.tone,
74
- amountDueLabel: f(a.amount_due) ?? f(a.total_amount) ?? "",
75
- invoiceDateLabel: g,
76
- dueDateLabel: _,
77
- dueDateTone: p.isOverdue ? "danger" : "default",
78
- payToItems: v,
79
- invoiceItems: b,
80
- lineItems: S,
81
- totals: C
82
- };
83
- }
8
+ var a = {
9
+ subtitle: "Accounts payable",
10
+ vendorRow: "Vendor",
11
+ bankAccountRow: "ACH bank account",
12
+ bankAccountValue: (e) => `Account ending in ${e}`,
13
+ invoiceNumberRow: "Number",
14
+ issueDateRow: "Issue date",
15
+ dueDateRow: "Due date",
16
+ poNumberRow: "PO number",
17
+ notProvided: "Not provided",
18
+ glCodeMissing: "GL code not specified",
19
+ quantityValue: (e, t) => `${e} x ${t}`,
20
+ subtotalRow: "Subtotal",
21
+ discountsRow: "Discounts",
22
+ taxRow: "Tax",
23
+ totalRow: "Total",
24
+ actionError: r.actionError,
25
+ actionSuccess: r.actionSuccess,
26
+ scheduledSummary: i,
27
+ paidOnLabel: (e) => `Paid on ${e}`,
28
+ sheet: e,
29
+ decisionDialog: r.decisionDialog,
30
+ approvalPolicyCopy: n,
31
+ markAsPaid: t
32
+ };
84
33
  //#endregion
85
- export { a as mapPayableToBillDetails };
34
+ export { a as BILL_DETAILS_LABELS_EN };
@@ -8,7 +8,7 @@ import { useAllLedgerAccountsQuery as n } from "../../../shared/data-access/dist
8
8
  import "../../../shared/data-access/dist/index.js";
9
9
  import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
10
  import "../../../shared/feature/dist/index.js";
11
- import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
11
+ import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index10.js";
12
12
  import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
13
  import "../../data-access/dist/index.js";
14
14
  import { BillDecisionDialog as o } from "../../ui/dist/index51.js";
@@ -21,60 +21,60 @@ import "./index11.js";
21
21
  import { resolveAmountDueMinorUnits as d } from "./index17.js";
22
22
  import { PayBillFlow as f } from "./index23.js";
23
23
  import "./index24.js";
24
- import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
25
- import { useMarkAsPaidFlow as m } from "./index14.js";
24
+ import { mapPayableToBillDetails as p } from "./index37.js";
25
+ import { mergeMarkAsPaidFlowLabels as m } from "./index12.js";
26
+ import { useMarkAsPaidFlow as h } from "./index14.js";
26
27
  import "./index15.js";
27
- import { mergeDecisionDialogCopy as h } from "./index39.js";
28
- import { useApprovalPolicyCardView as g } from "./index30.js";
29
- import { useCurrentApprovalRequestId as _ } from "./index31.js";
30
- import { usePayableDetailActions as v } from "./index32.js";
31
- import { useScheduledPayment as y } from "./index33.js";
32
- import { BILL_DETAILS_LABELS_EN as b } from "./index56.js";
33
- import { mapPayableToBillDetails as x } from "./index57.js";
28
+ import { mergeDecisionDialogCopy as g } from "./index40.js";
29
+ import { useApprovalPolicyCardView as _ } from "./index30.js";
30
+ import { useCurrentApprovalRequestId as v } from "./index31.js";
31
+ import { usePayableDetailActions as y } from "./index32.js";
32
+ import { useScheduledPayment as b } from "./index33.js";
33
+ import { BILL_DETAILS_LABELS_EN as x } from "./index57.js";
34
34
  import { useMemo as S, useRef as C } from "react";
35
35
  import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
36
36
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
37
37
  function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, testId: M, labels: N, poweredByBankName: P }) {
38
38
  let F = S(() => ({
39
- ...b,
39
+ ...x,
40
40
  ...N,
41
41
  sheet: {
42
- ...b.sheet,
42
+ ...x.sheet,
43
43
  ...N?.sheet,
44
44
  statusBadge: {
45
- ...b.sheet.statusBadge,
45
+ ...x.sheet.statusBadge,
46
46
  ...N?.sheet?.statusBadge
47
47
  },
48
48
  approvalPolicy: {
49
- ...b.sheet.approvalPolicy,
49
+ ...x.sheet.approvalPolicy,
50
50
  ...N?.sheet?.approvalPolicy
51
51
  },
52
52
  dueDate: {
53
- ...b.sheet.dueDate,
53
+ ...x.sheet.dueDate,
54
54
  ...N?.sheet?.dueDate
55
55
  }
56
56
  },
57
- decisionDialog: h(b.decisionDialog, N?.decisionDialog),
57
+ decisionDialog: g(x.decisionDialog, N?.decisionDialog),
58
58
  approvalPolicyCopy: {
59
- ...b.approvalPolicyCopy,
59
+ ...x.approvalPolicyCopy,
60
60
  ...N?.approvalPolicyCopy
61
61
  },
62
- markAsPaid: p(N?.markAsPaid),
62
+ markAsPaid: m(N?.markAsPaid),
63
63
  actionSuccess: {
64
- ...b.actionSuccess,
64
+ ...x.actionSuccess,
65
65
  ...N?.actionSuccess
66
66
  }
67
- }), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = _({
67
+ }), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = v({
68
68
  payableId: k,
69
69
  status: z?.status
70
- }), H = g({
70
+ }), H = _({
71
71
  payableId: k,
72
72
  approvalPolicyId: z?.approval_policy_id,
73
73
  copy: F.approvalPolicyCopy
74
- }), U = y({
74
+ }), U = b({
75
75
  payableId: k,
76
76
  scheduledPaymentDate: z?.scheduled_payment_date
77
- }), W = m({
77
+ }), W = h({
78
78
  payableId: k,
79
79
  amountDueMinorUnits: d(z) ?? 0,
80
80
  amountToPayMinorUnits: z?.amount_to_pay ?? void 0,
@@ -83,7 +83,7 @@ function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, te
83
83
  hasScheduledPayment: U.hasScheduledPayment,
84
84
  testId: M,
85
85
  labels: F.markAsPaid
86
- }), { actions: G, decisionDialog: K } = v({
86
+ }), { actions: G, decisionDialog: K } = y({
87
87
  payableId: z ? k : void 0,
88
88
  status: z?.status,
89
89
  currentApprovalRequestId: V.id,
@@ -121,7 +121,7 @@ function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, te
121
121
  }), X = Y.isPossibleDuplicate ? /* @__PURE__ */ T(c, {
122
122
  onNotADuplicate: Y.onNotADuplicate,
123
123
  isActionDisabled: Y.isBusy
124
- }) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? x({
124
+ }) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? p({
125
125
  payable: z,
126
126
  lineItems: L.lineItems,
127
127
  ledgerAccounts: R.data?.data ?? [],
@@ -1,3 +1,3 @@
1
- import "./index56.js";
1
+ import "./index37.js";
2
2
  import "./index57.js";
3
3
  import "./index58.js";
@@ -5,7 +5,7 @@
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
7
  import "../../../shared/ui/dist/index.js";
8
- import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index12.js";
8
+ import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index13.js";
9
9
  import { usePayableOcrQueries as r } from "../../data-access/dist/index14.js";
10
10
  import "../../data-access/dist/index.js";
11
11
  import { billPayUploadQueueKey as i } from "./index63.js";
@@ -4,7 +4,7 @@
4
4
  "use client";
5
5
  import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
6
  import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
- import { suspectedPayableDuplicates as n } from "../../data-access/dist/index6.js";
7
+ import { suspectedPayableDuplicates as n } from "../../data-access/dist/index7.js";
8
8
  import { useAllSuspectedDuplicatePayablesQuery as r, usePayablesQuery as i } from "../../data-access/dist/index15.js";
9
9
  import "../../data-access/dist/index.js";
10
10
  import { groupSuspectedDuplicates as a } from "./index3.js";
@@ -4,7 +4,7 @@
4
4
  "use client";
5
5
  import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
6
  import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
- import { hasSuspectedPayableDuplicate as n } from "../../data-access/dist/index6.js";
7
+ import { hasSuspectedPayableDuplicate as n } from "../../data-access/dist/index7.js";
8
8
  import { usePayablesQuery as r, usePayablesTotalCountQuery as i } from "../../data-access/dist/index15.js";
9
9
  import "../../data-access/dist/index.js";
10
10
  import { derivePayableStatus as a } from "./index4.js";
@@ -15,8 +15,8 @@ import { BillsScreen as o } from "../../ui/dist/index68.js";
15
15
  import "../../ui/dist/index.js";
16
16
  import { DuplicateBillsContainer as te } from "./index9.js";
17
17
  import "./index11.js";
18
- import { BillCreateDialog as s } from "./index54.js";
19
- import "./index55.js";
18
+ import { BillCreateDialog as s } from "./index55.js";
19
+ import "./index56.js";
20
20
  import { BillDetailsContainer as c } from "./index58.js";
21
21
  import "./index59.js";
22
22
  import "./index65.js";
@@ -5,7 +5,7 @@
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import "../../../shared/ui/dist/index.js";
7
7
  import { DUPLICATE_BILLS_LABELS_EN as t } from "./index2.js";
8
- import { DuplicateVerdict as n, useApplyDuplicateVerdictsMutation as r } from "../../data-access/dist/index6.js";
8
+ import { DuplicateVerdict as n, useApplyDuplicateVerdictsMutation as r } from "../../data-access/dist/index7.js";
9
9
  import "../../data-access/dist/index.js";
10
10
  import { useDuplicateBills as i } from "./index7.js";
11
11
  import { useDuplicateBillsSelection as a } from "./index8.js";