@tesouro/embedded-components-react 0.2.327 → 0.2.329

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 (133) hide show
  1. package/dist/index.css +3 -0
  2. package/dist/index.d.ts +59 -59
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BillPayWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -10
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +119 -33
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +50 -21
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +39 -17
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +17 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -10
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +45 -17
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -21
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +9 -24
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +42 -9
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +25 -50
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +49 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +91 -63
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +20 -49
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +52 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -35
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +67 -113
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +46 -53
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +80 -205
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +32 -192
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +117 -62
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +54 -45
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +205 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +184 -143
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +63 -33
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +46 -100
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +32 -7
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +146 -182
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +38 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +102 -24
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +10 -80
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +200 -78
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +2 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +27 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +78 -41
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +132 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -53
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +2 -9
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +43 -16
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +1 -8
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +50 -77
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +8 -145
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +18 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +6 -6
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +78 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +138 -75
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +2 -0
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +6 -6
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -113
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -1
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +2 -24
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +115 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +25 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +33 -25
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -12
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +58 -13
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +2 -24
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +22 -2
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +23 -31
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +1 -262
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +15 -2
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +23 -6
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -49
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +41 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +271 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -286
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +9 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +47 -14
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -120
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +22 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +284 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +2 -96
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +16 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +118 -11
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +1 -57
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +10 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +93 -51
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +1 -138
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +12 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +56 -5
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -44
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +53 -1
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +137 -2
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -16
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +7 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +42 -59
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -238
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -202
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +61 -8
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -8
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -91
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +16 -0
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +67 -4
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +248 -25
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +204 -2
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +6 -3
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +6 -32
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +93 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +1 -105
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +7 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +28 -16
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -10
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +4 -167
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +34 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +2 -14
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -87
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +105 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +18 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +10 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +170 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +14 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +89 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -0
  126. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +20 -20
  127. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +142 -102
  130. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  131. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  132. package/package.json +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +0 -12
@@ -2,91 +2,213 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
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";
6
9
  import "../../../shared/data-access/dist/index.js";
7
- import { resolveVendor as t } from "./index3.js";
8
- import { BillDetailsSheet as n } from "../../ui/dist/index44.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 { resolveVendor as ie } from "./index3.js";
14
+ import { BillCreateScreen as ae } from "../../ui/dist/index40.js";
15
+ import { BillDecisionDialog as oe } from "../../ui/dist/index46.js";
16
+ import { ExtractionNotice as se } from "../../ui/dist/index60.js";
9
17
  import "../../ui/dist/index.js";
10
- import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index7.js";
11
- import { usePayableQuery as i } from "../../data-access/dist/index13.js";
18
+ import { usePayableHistoryQuery as ce } from "../../data-access/dist/index6.js";
19
+ import { useAllPayableLineItemsQuery as le } from "../../data-access/dist/index7.js";
20
+ import { usePayableQuery as ue } from "../../data-access/dist/index13.js";
12
21
  import "../../data-access/dist/index.js";
13
- import { PayBillFlow as a } from "./index10.js";
22
+ import { PayBillFlow as de } from "./index10.js";
14
23
  import "./index11.js";
15
- import { useCurrentApprovalRequestId as o } from "./index12.js";
16
- import { usePayableDetailActions as s } from "./index14.js";
17
- import { useScheduledPayment as c } from "./index15.js";
18
- import { BILL_DETAILS_LABELS_EN as l } from "./index35.js";
19
- import { mapPayableToBillDetails as u } from "./index36.js";
20
- import { useMemo as d, useRef as f } from "react";
21
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
24
+ import { mergeBillCreateScreenCopy as fe } from "./index26.js";
25
+ import { useBillCreateController as pe } from "./index33.js";
26
+ import { useBillForm as n } from "./index35.js";
27
+ import { useApprovalPolicyCardView as r } from "./index15.js";
28
+ import { useCurrentApprovalRequestId as i } from "./index16.js";
29
+ import { usePayableDetailActions as a } from "./index18.js";
30
+ import { useScheduledPayment as o } from "./index19.js";
31
+ import { buildBillDetailView as s } from "./index22.js";
32
+ import { buildBillHistory as me } from "./index23.js";
33
+ import { SourceDocumentContainer as he } from "./index27.js";
34
+ import { useVendorSectionProps as ge } from "./index29.js";
35
+ import { usePaymentInstructionsForm as _e } from "./index30.js";
36
+ import { billCreateTestIds as c } from "./index36.js";
37
+ import { useCallback as l, useEffect as ve, useMemo as u, useRef as ye, useState as d } from "react";
38
+ import { Fragment as be, jsx as f, jsxs as xe } from "react/jsx-runtime";
22
39
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js
23
- function g(e) {
40
+ function Se(e) {
24
41
  return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
25
42
  }
26
- function _({ open: _, onOpenChange: v, payableId: y, onClose: b, onExpand: x, testId: S, labels: C, poweredByBankName: w }) {
27
- let T = d(() => ({
28
- ...l,
29
- ...C,
30
- sheet: {
31
- ...l.sheet,
32
- ...C?.sheet
33
- }
34
- }), [C]), E = i(y), D = r(y), O = e(), k = E.data, A = f(null), j = o({
35
- payableId: y,
36
- status: k?.status
37
- }), M = c({
38
- payableId: y,
39
- scheduledPaymentDate: k?.scheduled_payment_date
40
- }), { actions: N } = s({
41
- payableId: k ? y : void 0,
42
- status: k?.status,
43
- currentApprovalRequestId: j.id,
44
- hasScheduledPayment: M.hasScheduledPayment,
45
- isScheduledPaymentUnknown: M.isResolving,
46
- labels: {
47
- payBill: T.sheet.payButton,
48
- markAsPaid: T.sheet.markAsPaidButton,
49
- reject: T.sheet.rejectButton,
50
- actionError: T.actionError
51
- },
52
- onPayBillSelect: () => {
53
- if (!g(t(k)) && x) {
54
- x();
55
- return;
56
- }
57
- A.current?.open();
58
- }
59
- }), P = M.hasScheduledPayment && M.scheduledDateLabel ? /* @__PURE__ */ m("p", {
60
- className: "ttw:text-sm ttw:text-muted-foreground",
61
- children: T.scheduledSummary(M.scheduledDateLabel)
62
- }) : void 0, F = d(() => k ? u({
63
- payable: k,
64
- lineItems: D.lineItems,
65
- ledgerAccounts: O.data?.data ?? [],
66
- labels: T
43
+ function p({ open: p, onOpenChange: m, payableId: h, readOnly: g = !1, copy: _, poweredByBankName: Ce }) {
44
+ let v = u(() => fe(_), [_]), [y, b] = d(), [x, S] = d(!1), [C, w] = d(!1), [T, E] = d(), D = h ?? T, O = ue(D, { pollWhileOcrProcessing: !0 }), k = le(D), A = ee(), j = O.data, M = n({
45
+ payable: j,
46
+ lineItems: k.lineItems
47
+ }), N = j?.counterpart_id;
48
+ ve(() => {
49
+ x || N && (b(N), S(!0));
50
+ }, [x, N]);
51
+ let we = l((e) => {
52
+ S(!0), b(e);
53
+ }, []), P = ge({
54
+ payableId: g ? void 0 : D,
55
+ counterpartId: g ? void 0 : y,
56
+ payableCounterpartId: N,
57
+ onCounterpartChange: we,
58
+ requiredError: M.errors?.vendor
59
+ }), F = pe({
60
+ payableId: h,
61
+ form: M,
62
+ counterpartId: y,
63
+ clearCounterpart: !!(D && x) && !y,
64
+ prepareVendorForSave: P.savePaymentInstructions,
65
+ onPayableCreated: E,
66
+ onSaved: E,
67
+ onDraftSaved: () => m(!1),
68
+ onFinalized: () => m(!1)
69
+ }), I = !!(F.isSavingDraft || F.isFinalizing), L = g ? D : void 0, R = i({
70
+ payableId: L,
71
+ status: j?.status
72
+ }), z = ye(null), B = o({
73
+ payableId: D,
74
+ scheduledPaymentDate: j?.scheduled_payment_date,
75
+ enabled: g
76
+ }), V = ie(j), H = _e({
77
+ payableId: L,
78
+ counterpartId: g ? N : void 0,
79
+ saveErrorMessage: v.detail.paymentInstructionsSaveError
80
+ }), { initResponse: U } = re(), W = e(U?.scopes, [t.CounterpartWriteOrg]) && e(U?.scopes, [t.PayableWriteOrg]), { actions: Te, decisionDialog: Ee } = a({
81
+ payableId: L,
82
+ status: j?.status,
83
+ currentApprovalRequestId: R.id,
84
+ isPolicyApprover: R.isPolicyApprover,
85
+ hasWaitingRequest: R.hasWaitingRequest,
86
+ hasScheduledPayment: B.hasScheduledPayment,
87
+ isScheduledPaymentUnknown: B.isResolving,
88
+ labels: v.actions,
89
+ onPayBillSelect: () => Se(V) || !W ? z.current?.open() : H.open()
90
+ }), G = u(() => (A.data?.data ?? []).map((e) => ({
91
+ value: e.id,
92
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
93
+ })), [A.data]), K = ce(L), q = e(U?.scopes, [t.UserReadOrg]), J = te({ enabled: g && q }), Y = u(() => me(K.data?.data ?? [], J.data?.data ?? [], v.history), [
94
+ K.data,
95
+ J.data,
96
+ v.history
97
+ ]), X = r({
98
+ payableId: L,
99
+ approvalPolicyId: j?.approval_policy_id,
100
+ enabled: g,
101
+ copy: v.approvalPolicyCopy
102
+ }), De = u(() => g && j ? s({
103
+ payable: j,
104
+ lineItems: k.lineItems,
105
+ glCodeOptions: G,
106
+ history: Y,
107
+ approvalPolicy: X.view,
108
+ labels: v.detail
67
109
  }) : void 0, [
68
- k,
69
- D.lineItems,
70
- O.data,
71
- T
72
- ]), I = E.isLoading || D.isResolving || O.isResolving, L = E.isError || D.isError || O.isError;
73
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
74
- open: _,
75
- onOpenChange: v,
76
- details: F,
77
- actions: N,
78
- isLoading: I,
79
- isError: L,
80
- notice: P,
81
- onClose: b,
82
- onExpand: x,
83
- testId: S,
84
- labels: T.sheet
85
- }), k ? /* @__PURE__ */ m(a, {
86
- ref: A,
87
- payable: k,
88
- poweredByBankName: w
89
- }) : null] });
110
+ X.view,
111
+ v.detail,
112
+ G,
113
+ Y,
114
+ k.lineItems,
115
+ j,
116
+ g
117
+ ]), Z = j?.source_of_payable_data === "ocr", Q = V?.name, Oe = g ? Q ? v.viewTitle(Q) : v.readOnlyTitle : Z && Q ? v.extractedTitle(Q) : v.newTitle, ke = g && j?.created_at ? v.addedOn(ne(j.created_at.slice(0, 10))) : void 0, $ = l(() => {
118
+ let e = M.isDirty || P.hasUnsavedVendorChanges;
119
+ !g && e && !window.confirm(v.discardConfirm) || m(!1);
120
+ }, [
121
+ v.discardConfirm,
122
+ M.isDirty,
123
+ m,
124
+ g,
125
+ P.hasUnsavedVendorChanges
126
+ ]), Ae = l((e) => {
127
+ if (!I) return e ? m(!0) : $();
128
+ }, [
129
+ $,
130
+ I,
131
+ m
132
+ ]);
133
+ return /* @__PURE__ */ xe(be, { children: [
134
+ /* @__PURE__ */ f(ae, {
135
+ open: p,
136
+ onOpenChange: Ae,
137
+ title: Oe,
138
+ subtitle: ke,
139
+ notice: !g && Z && !C ? /* @__PURE__ */ f(se, { onDismiss: () => w(!0) }) : void 0,
140
+ vendor: {
141
+ ...P,
142
+ testId: c.vendorSection
143
+ },
144
+ values: M.values,
145
+ errors: M.errors,
146
+ onChange: M.onChange,
147
+ lineItems: {
148
+ items: M.lineItemRows,
149
+ glCodeOptions: G,
150
+ discount: M.discount,
151
+ onDiscountChange: M.onDiscountChange,
152
+ tax: M.tax,
153
+ onTaxChange: M.onTaxChange,
154
+ total: M.total,
155
+ onTotalChange: M.onTotalChange,
156
+ onAddLineItem: M.onAddLineItem,
157
+ errors: M.lineItemErrors,
158
+ testId: c.lineItems
159
+ },
160
+ documentPanel: /* @__PURE__ */ f(he, {
161
+ payableId: D,
162
+ readOnly: g,
163
+ isDocumentPending: !!D && !j?.file && (O.isLoading || j?.ocr_status === "processing"),
164
+ file: j?.file ? {
165
+ id: j.file.id,
166
+ name: j.file.name,
167
+ url: j.file.url,
168
+ mimetype: j.file.mimetype
169
+ } : void 0
170
+ }),
171
+ readOnly: g,
172
+ detail: g ? {
173
+ view: De,
174
+ actions: Te,
175
+ scheduledSummary: B.hasScheduledPayment && B.scheduledDateLabel ? v.scheduledSummary(B.scheduledDateLabel) : void 0,
176
+ paymentInstructionsForm: N && W ? {
177
+ isOpen: H.isOpen,
178
+ values: H.values,
179
+ errors: H.errors,
180
+ isSaving: H.isSaving,
181
+ onOpen: H.open,
182
+ onCancel: H.close,
183
+ onChange: H.onChange,
184
+ onSave: H.save
185
+ } : void 0,
186
+ isLoading: O.isLoading || k.isResolving || A.isResolving,
187
+ isError: O.isError || k.isError || A.isError
188
+ } : void 0,
189
+ isLineItemsLoading: k.isResolving,
190
+ isSaving: I,
191
+ isSavingDraft: F.isSavingDraft,
192
+ isFinalizing: F.isFinalizing,
193
+ onCancel: $,
194
+ onSaveDraft: F.saveDraft,
195
+ onFinalize: F.finalize,
196
+ testId: c.dialog
197
+ }),
198
+ /* @__PURE__ */ f(oe, {
199
+ ...Ee,
200
+ labels: { cancelButton: v.actions.decisionDialog.cancelButton },
201
+ testId: c.decisionDialog,
202
+ confirmTestId: c.decisionConfirm,
203
+ reasonTestId: c.decisionReason
204
+ }),
205
+ g && j ? /* @__PURE__ */ f(de, {
206
+ ref: z,
207
+ payable: j,
208
+ poweredByBankName: Ce,
209
+ labels: v.payBill
210
+ }) : null
211
+ ] });
90
212
  }
91
213
  //#endregion
92
- export { _ as BillDetailsContainer, _ as default };
214
+ export { p as BillCreateDialog, p as default };
@@ -1,3 +1,4 @@
1
+ import "./index26.js";
2
+ import "./index33.js";
1
3
  import "./index35.js";
2
- import "./index36.js";
3
4
  import "./index37.js";
@@ -1,4 +1,29 @@
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index51.js";
2
+ import "../../ui/dist/index.js";
3
+ import { APPROVAL_POLICY_RULE_COPY_EN as t } from "./index12.js";
4
+ import { BILL_DETAIL_ACTIONS_LABELS_EN as n, SCHEDULED_SUMMARY_LABEL_EN as r } from "./index24.js";
1
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
6
+ var i = {
7
+ subtitle: "Accounts payable",
8
+ vendorRow: "Vendor",
9
+ bankAccountRow: "ACH bank account",
10
+ bankAccountValue: (e) => `Account ending in ${e}`,
11
+ invoiceNumberRow: "Number",
12
+ issueDateRow: "Issue date",
13
+ dueDateRow: "Due date",
14
+ poNumberRow: "PO number",
15
+ notProvided: "Not provided",
16
+ glCodeMissing: "GL code not specified",
17
+ quantityValue: (e, t) => `${e} x ${t}`,
18
+ subtotalRow: "Subtotal",
19
+ discountsRow: "Discounts",
20
+ taxRow: "Tax",
21
+ totalRow: "Total",
22
+ actionError: n.actionError,
23
+ scheduledSummary: r,
24
+ sheet: e,
25
+ decisionDialog: n.decisionDialog,
26
+ approvalPolicyCopy: t
27
+ };
3
28
  //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
29
+ export { i as BILL_DETAILS_LABELS_EN };
@@ -1,45 +1,82 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index39.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index438.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { resolveVendor as t, resolveVendorName as n } from "./index3.js";
3
+ import { derivePayableStatus as r } from "./index20.js";
4
+ import { formatBillMoney as i } from "./index21.js";
14
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, pageTitleComponent: v = s, ...y }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- gatewayRouting: l,
30
- linkComponent: u,
31
- implementation: d,
32
- uiFramework: f,
33
- errorFallback: p,
34
- onError: m,
35
- finopsThemeColors: h,
36
- analytics: g,
37
- disclosuresAcceptance: _,
38
- children: /* @__PURE__ */ o(c, {
39
- ...y,
40
- pageTitleComponent: v
41
- })
6
+ function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c }) {
7
+ let l = a.currency, u = (e) => i(e, l), d = r({
8
+ apiStatus: a.status,
9
+ dueDate: a.due_date,
10
+ scheduledPaymentDate: a.scheduled_payment_date
11
+ }), f = t(a), p = n(a), m = e(a.issued_at) || c.notProvided, h = e(a.due_date) || c.notProvided, g = [{
12
+ label: c.vendorRow,
13
+ value: p || c.notProvided,
14
+ secondaryValue: f?.email ?? void 0
15
+ }], _ = f?.bank_account?.account_number;
16
+ _ && g.push({
17
+ label: c.bankAccountRow,
18
+ value: c.bankAccountValue(_.slice(-4))
42
19
  });
20
+ let v = [
21
+ {
22
+ label: c.invoiceNumberRow,
23
+ value: a.document_id || c.notProvided
24
+ },
25
+ {
26
+ label: c.issueDateRow,
27
+ value: m
28
+ },
29
+ {
30
+ label: c.dueDateRow,
31
+ value: h
32
+ },
33
+ {
34
+ label: c.poNumberRow,
35
+ value: c.notProvided
36
+ }
37
+ ], y = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), b = o.map((e) => {
38
+ let t = u(e.unit_price);
39
+ return {
40
+ id: e.id,
41
+ description: e.name ?? e.description ?? "",
42
+ glCodeLabel: (e.ledger_account_id ? y.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
43
+ quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
44
+ amountLabel: u(e.subtotal) ?? ""
45
+ };
46
+ }), x = [
47
+ {
48
+ label: c.subtotalRow,
49
+ value: a.subtotal
50
+ },
51
+ {
52
+ label: c.discountsRow,
53
+ value: a.discount
54
+ },
55
+ {
56
+ label: c.taxRow,
57
+ value: a.tax_amount
58
+ }
59
+ ].map(({ label: e, value: t }) => ({
60
+ label: e,
61
+ value: u(t)
62
+ })).filter((e) => !!e.value), S = u(a.total_amount);
63
+ return S && x.push({
64
+ label: c.totalRow,
65
+ value: S,
66
+ emphasis: !0
67
+ }), {
68
+ title: p,
69
+ subtitle: c.subtitle,
70
+ status: d.status,
71
+ statusTone: d.tone,
72
+ amountDueLabel: u(a.amount_due) ?? u(a.total_amount) ?? "",
73
+ invoiceDateLabel: m,
74
+ dueDateLabel: h,
75
+ payToItems: g,
76
+ invoiceItems: v,
77
+ lineItems: b,
78
+ totals: x
79
+ };
43
80
  }
44
81
  //#endregion
45
- export { l as BillPayWidgetMonite, l as default };
82
+ export { a as mapPayableToBillDetails };
@@ -1 +1,132 @@
1
- import "./index40.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { resolveVendor as t } from "./index3.js";
8
+ import { BillDecisionDialog as n } from "../../ui/dist/index46.js";
9
+ import { BillDetailsSheet as r } from "../../ui/dist/index52.js";
10
+ import "../../ui/dist/index.js";
11
+ import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index7.js";
12
+ import { usePayableQuery as a } from "../../data-access/dist/index13.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { PayBillFlow as o } from "./index10.js";
15
+ import "./index11.js";
16
+ import { mergeDecisionDialogCopy as s } from "./index24.js";
17
+ import { useApprovalPolicyCardView as c } from "./index15.js";
18
+ import { useCurrentApprovalRequestId as l } from "./index16.js";
19
+ import { usePayableDetailActions as u } from "./index18.js";
20
+ import { useScheduledPayment as d } from "./index19.js";
21
+ import { BILL_DETAILS_LABELS_EN as f } from "./index39.js";
22
+ import { mapPayableToBillDetails as p } from "./index40.js";
23
+ import { useMemo as m, useRef as h } from "react";
24
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
25
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
26
+ function y(e) {
27
+ return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
28
+ }
29
+ function b({ open: b, onOpenChange: x, payableId: S, onClose: C, onExpand: w, testId: T, labels: E, poweredByBankName: D }) {
30
+ let O = m(() => ({
31
+ ...f,
32
+ ...E,
33
+ sheet: {
34
+ ...f.sheet,
35
+ ...E?.sheet,
36
+ statusBadge: {
37
+ ...f.sheet.statusBadge,
38
+ ...E?.sheet?.statusBadge
39
+ },
40
+ approvalPolicy: {
41
+ ...f.sheet.approvalPolicy,
42
+ ...E?.sheet?.approvalPolicy
43
+ }
44
+ },
45
+ decisionDialog: s(f.decisionDialog, E?.decisionDialog),
46
+ approvalPolicyCopy: {
47
+ ...f.approvalPolicyCopy,
48
+ ...E?.approvalPolicyCopy
49
+ }
50
+ }), [E]), k = a(S), A = i(S), j = e(), M = k.data, N = h(null), P = l({
51
+ payableId: S,
52
+ status: M?.status
53
+ }), F = c({
54
+ payableId: S,
55
+ approvalPolicyId: M?.approval_policy_id,
56
+ copy: O.approvalPolicyCopy
57
+ }), I = d({
58
+ payableId: S,
59
+ scheduledPaymentDate: M?.scheduled_payment_date
60
+ }), { actions: L, decisionDialog: R } = u({
61
+ payableId: M ? S : void 0,
62
+ status: M?.status,
63
+ currentApprovalRequestId: P.id,
64
+ isPolicyApprover: P.isPolicyApprover,
65
+ hasWaitingRequest: P.hasWaitingRequest,
66
+ hasScheduledPayment: I.hasScheduledPayment,
67
+ isScheduledPaymentUnknown: I.isResolving,
68
+ labels: {
69
+ payBill: O.sheet.payButton,
70
+ markAsPaid: O.sheet.markAsPaidButton,
71
+ reject: O.sheet.rejectButton,
72
+ approve: O.sheet.approveButton,
73
+ cancel: O.sheet.cancelButton,
74
+ reopen: O.sheet.reopenButton,
75
+ forceApprove: O.sheet.forceApproveButton,
76
+ forceReject: O.sheet.forceRejectButton,
77
+ decisionDialog: O.decisionDialog,
78
+ actionError: O.actionError
79
+ },
80
+ onPayBillSelect: () => {
81
+ if (!y(t(M)) && w) {
82
+ w();
83
+ return;
84
+ }
85
+ N.current?.open();
86
+ }
87
+ }), z = I.hasScheduledPayment && I.scheduledDateLabel ? /* @__PURE__ */ _("p", {
88
+ className: "ttw:text-sm ttw:text-muted-foreground",
89
+ children: O.scheduledSummary(I.scheduledDateLabel)
90
+ }) : void 0, B = m(() => M ? p({
91
+ payable: M,
92
+ lineItems: A.lineItems,
93
+ ledgerAccounts: j.data?.data ?? [],
94
+ labels: O
95
+ }) : void 0, [
96
+ M,
97
+ A.lineItems,
98
+ j.data,
99
+ O
100
+ ]), V = k.isLoading || A.isResolving || j.isResolving, H = k.isError || A.isError || j.isError;
101
+ return /* @__PURE__ */ v(g, { children: [
102
+ /* @__PURE__ */ _(r, {
103
+ open: b,
104
+ onOpenChange: x,
105
+ details: B,
106
+ actions: L,
107
+ approvalPolicy: F.view,
108
+ isLoading: V,
109
+ isError: H,
110
+ notice: z,
111
+ onClose: C,
112
+ onExpand: w,
113
+ testId: T,
114
+ labels: O.sheet
115
+ }),
116
+ /* @__PURE__ */ _(n, {
117
+ ...R,
118
+ labels: { cancelButton: O.decisionDialog.cancelButton },
119
+ testId: T ? `${T}-decision-dialog` : void 0,
120
+ confirmTestId: T ? `${T}-decision-confirm` : void 0,
121
+ reasonTestId: T ? `${T}-decision-reason` : void 0,
122
+ reasonFieldId: T ? `${T}-decision-reason-field` : void 0
123
+ }),
124
+ M ? /* @__PURE__ */ _(o, {
125
+ ref: N,
126
+ payable: M,
127
+ poweredByBankName: D
128
+ }) : null
129
+ ] });
130
+ }
131
+ //#endregion
132
+ export { b as BillDetailsContainer, b as default };
@@ -1,53 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
2
- var e = {
3
- Drafts: "drafts",
4
- Pending: "pending",
5
- Scheduled: "scheduled",
6
- Paid: "paid",
7
- All: "all"
8
- }, t = {
9
- [e.Drafts]: ["draft"],
10
- [e.Pending]: [
11
- "new",
12
- "approve_in_progress",
13
- "waiting_to_be_paid",
14
- "partially_paid"
15
- ],
16
- [e.Scheduled]: [
17
- "new",
18
- "approve_in_progress",
19
- "waiting_to_be_paid",
20
- "partially_paid"
21
- ],
22
- [e.Paid]: ["paid"],
23
- [e.All]: void 0
24
- }, n = {
25
- [e.Drafts]: void 0,
26
- [e.Pending]: !1,
27
- [e.Scheduled]: !0,
28
- [e.Paid]: void 0,
29
- [e.All]: void 0
30
- }, r = e.Drafts, i = [
31
- e.Drafts,
32
- e.Pending,
33
- e.Scheduled,
34
- e.Paid,
35
- e.All
36
- ];
37
- function a(e) {
38
- let n = t[e];
39
- return n ? [...n] : void 0;
40
- }
41
- function o(e) {
42
- return n[e];
43
- }
44
- var s = {
45
- vendorLabel: "counterpart_name",
46
- dueDateLabel: "due_date",
47
- addedOnLabel: "created_at"
48
- };
49
- function c(e) {
50
- if (e) return s[e];
51
- }
52
- //#endregion
53
- export { n as BILL_QUEUE_HAS_SCHEDULED_PAYMENT, i as BILL_QUEUE_ORDER, t as BILL_QUEUE_STATUSES, s as BILL_SORT_FIELDS, e as BillQueue, r as DEFAULT_BILL_QUEUE, o as billQueueHasScheduledPayment, a as billQueueStatuses, c as billSortField };
1
+ import "./index39.js";
2
+ import "./index40.js";
3
+ import "./index41.js";
@@ -1,11 +1,4 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
2
- async function e(e) {
3
- if (!e.trim()) return !1;
4
- try {
5
- return await navigator.clipboard.writeText(e), !0;
6
- } catch {
7
- return !1;
8
- }
9
- }
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
10
3
  //#endregion
11
- export { e as copyTextToClipboard };
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };