@tesouro/embedded-components-react 0.7.34 → 0.7.36
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.
- package/README.md +10 -8
- package/dist/index.d.ts +31 -32
- package/dist/index.js +5 -5
- package/dist/lib/CounterpartsWidget.d.ts +0 -1
- package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -1
- package/dist/lib/CustomersWidget.d.ts +0 -1
- package/dist/lib/{MarketingWidget.d.ts → OfferWidget.d.ts} +31 -31
- package/dist/lib/OfferWidget.js +6 -0
- package/dist/lib/ReceivablesWidget.d.ts +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +109 -110
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/index.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/MarketingWidget.js → offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js} +11 -11
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget → offer-widget/feature/dist/lib/OfferWidget}/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/marketingApplicationView.js → offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/lib/testIds.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/mocks/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/mocks/marketing.js → offer-widget/feature/dist/mocks/offer.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/scenarios.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index7.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index8.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index9.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index4.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +48 -50
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +4 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +3 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +48 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +4 -48
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +28 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/mocks/widgetSuite.js +2 -2
- package/dist/scenarios/index.d.ts +2 -2
- package/dist/scenarios/index.js +3 -3
- package/package.json +1 -1
- package/dist/lib/MarketingWidget.js +0 -6
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/analytics/events.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/scenarios.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js +0 -10
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index6.js +0 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +0 -92
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +0 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +0 -28
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +0 -4
|
@@ -14,81 +14,81 @@ import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index19.
|
|
|
14
14
|
import "../../data-access/dist/index.js";
|
|
15
15
|
import { resolvePaymentInstructionsGestures as a } from "./index15.js";
|
|
16
16
|
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
17
|
-
import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as s, getCounterpartEmail as
|
|
18
|
-
import { useCounterpartsQuery as
|
|
19
|
-
import { useCreateCounterpartBankAccountMutation as
|
|
20
|
-
import { useCounterpartDetails as
|
|
21
|
-
import { useCounterpartForm as
|
|
17
|
+
import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as s, getCounterpartEmail as re, getCounterpartName as ie, getPayableAchInstructions as ae, hasCounterpartFormErrors as oe, isAchCompatibleBankAccount as c, resolveCounterpartBankAccountWrite as se, validateAchFormValues as ce, validateCounterpartForm as le } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
18
|
+
import { useCounterpartsQuery as ue } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
19
|
+
import { useCreateCounterpartBankAccountMutation as de, useUpdateCounterpartBankAccountMutation as fe } from "../../../../shared/counterpart-management/data-access/dist/index4.js";
|
|
20
|
+
import { useCounterpartDetails as pe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
21
|
+
import { useCounterpartForm as me } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
22
22
|
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
23
|
-
import { buildVendorPrefill as
|
|
24
|
-
import { VendorInlineForm as
|
|
25
|
-
import { useCallback as
|
|
26
|
-
import { jsx as
|
|
23
|
+
import { buildVendorPrefill as he, canAutoCreateVendor as ge, toCounterpartRawData as _e } from "./index31.js";
|
|
24
|
+
import { VendorInlineForm as ve } from "./index32.js";
|
|
25
|
+
import { useCallback as l, useEffect as u, useLayoutEffect as ye, useMemo as d, useRef as f, useState as p } from "react";
|
|
26
|
+
import { jsx as be } from "react/jsx-runtime";
|
|
27
27
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js
|
|
28
|
-
var
|
|
28
|
+
var xe = 10, Se = 300, m = {
|
|
29
29
|
accountHolderName: "",
|
|
30
30
|
routingNumber: "",
|
|
31
31
|
accountNumber: ""
|
|
32
32
|
};
|
|
33
|
-
function
|
|
33
|
+
function Ce(e) {
|
|
34
34
|
return {
|
|
35
35
|
accountHolderName: e.account_holder_name ?? "",
|
|
36
36
|
routingNumber: e.routing_number ?? "",
|
|
37
37
|
accountNumber: e.account_number ?? ""
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function h(e, t) {
|
|
41
41
|
return e.accountHolderName.trim() === t.accountHolderName.trim() && e.routingNumber.trim() === t.routingNumber.trim() && e.accountNumber.trim() === t.accountNumber.trim();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return e?.find((e) => e.id === t &&
|
|
43
|
+
function we(e, t) {
|
|
44
|
+
return e?.find((e) => e.id === t && c(e)) ?? s(e);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
let S = {
|
|
46
|
+
function g({ payableId: s, counterpartId: c, payableCounterpartId: g, payableCounterpartBankAccountId: Te, isVendorKnown: Ee = !0, onCounterpartChange: De, requiredError: Oe, extractedVendor: _, readOnly: v = !1, canEditVendor: y = !0, canEditPaymentInstructions: ke = !0, canAddPaymentInstructions: Ae = !0, confirmDiscard: b = (e) => e(), labels: x }) {
|
|
47
|
+
let S = d(() => ({
|
|
48
48
|
...r,
|
|
49
|
-
...
|
|
50
|
-
}, je =
|
|
49
|
+
...x
|
|
50
|
+
}), [x]), je = x?.messages, C = d(() => ({
|
|
51
51
|
...o,
|
|
52
52
|
...je
|
|
53
|
-
}), [je]), { initResponse: Me } = n(), Ne = t(Me?.scopes, [ee.CounterpartReadOrg]), [w, Pe] =
|
|
53
|
+
}), [je]), { initResponse: Me } = n(), Ne = t(Me?.scopes, [ee.CounterpartReadOrg]), [w, Pe] = p(""), [T, Fe] = p(""), Ie = f(T), [E, Le] = p(), [Re, ze] = p("none"), [Be, Ve] = p(), [He, D] = p(!1), [O, k] = p(!1), [A, Ue] = p(m), j = f(A);
|
|
54
54
|
j.current = A;
|
|
55
|
-
let M =
|
|
56
|
-
k(!1), Ue(
|
|
57
|
-
}, []), L =
|
|
58
|
-
Xe(!0),
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
!
|
|
55
|
+
let M = f(m), [We, N] = p(), [Ge, Ke] = p(), qe = Ge?.bankAccountId, P = f(void 0), Je = f(c), [Ye, Xe] = p(!1), [Ze, Qe] = p(!1), F = f(void 0), I = l(() => {
|
|
56
|
+
k(!1), Ue(m), M.current = m, N(void 0);
|
|
57
|
+
}, []), L = l((e) => {
|
|
58
|
+
Xe(!0), De(e);
|
|
59
|
+
}, [De]), $e = i(s, { enabled: !v && !!s && !c && !g }), R = $e.data?.suggested_counterpart?.id, et = _?.name;
|
|
60
|
+
u(() => {
|
|
61
|
+
!v && !Ye && !c && !g && R && L(R);
|
|
62
62
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
c,
|
|
64
|
+
g,
|
|
65
|
+
v,
|
|
66
66
|
Ye,
|
|
67
67
|
R,
|
|
68
68
|
L
|
|
69
|
-
]),
|
|
70
|
-
Je.current !==
|
|
71
|
-
}, [
|
|
69
|
+
]), u(() => {
|
|
70
|
+
Je.current !== c && (Je.current = c, I(), Ke((e) => e?.counterpartId === c ? e : void 0));
|
|
71
|
+
}, [c, I]), u(() => {
|
|
72
72
|
let e = setTimeout(() => {
|
|
73
73
|
Fe(w.trim());
|
|
74
|
-
},
|
|
74
|
+
}, Se);
|
|
75
75
|
return () => clearTimeout(e);
|
|
76
76
|
}, [w]);
|
|
77
|
-
let z =
|
|
77
|
+
let z = d(() => he(_), [_]), B = z?.bankAccount, tt = d(() => ge(_), [_]), nt = E === "create" ? !h(A, B ?? m) : O && !h(A, M.current), rt = !v && (E === "edit" || E === "create" && !!z), V = ue({
|
|
78
78
|
sort: "counterpart_name",
|
|
79
79
|
order: "asc",
|
|
80
|
-
limit:
|
|
80
|
+
limit: xe,
|
|
81
81
|
counterpart_name__icontains: T || void 0,
|
|
82
82
|
is_vendor: !0,
|
|
83
|
-
enabled: (rt || !
|
|
83
|
+
enabled: (rt || !v && !E && !c) && Ee && Ne
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
u(() => {
|
|
86
86
|
V.isPlaceholderData || (Ie.current = T);
|
|
87
87
|
}, [T, V.isPlaceholderData]);
|
|
88
|
-
let it = V.isPlaceholderData && Ie.current !== T, H =
|
|
89
|
-
selectedId:
|
|
88
|
+
let it = V.isPlaceholderData && Ie.current !== T, H = pe({
|
|
89
|
+
selectedId: c,
|
|
90
90
|
enabled: Ne
|
|
91
|
-
}), at =
|
|
91
|
+
}), at = de(), ot = fe(), U = me({
|
|
92
92
|
view: Re,
|
|
93
93
|
setView: ze,
|
|
94
94
|
selectedId: Be,
|
|
@@ -98,25 +98,25 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
98
98
|
counterpart: H.counterpart,
|
|
99
99
|
primaryAddress: H.primaryAddress,
|
|
100
100
|
includeBankAccount: !1
|
|
101
|
-
}), { openCreate: st, openEdit: ct, close: lt, setValues: W, submit: ut, values: dt } = U, G =
|
|
101
|
+
}), { openCreate: st, openEdit: ct, close: lt, setValues: W, submit: ut, values: dt } = U, G = d(() => {
|
|
102
102
|
let e = H.counterpart;
|
|
103
103
|
if (!e) return;
|
|
104
104
|
if (H.isBankAccountsLoading) return {
|
|
105
|
-
name:
|
|
106
|
-
email:
|
|
105
|
+
name: ie(e),
|
|
106
|
+
email: re(e),
|
|
107
107
|
methodLabel: S.paymentMethodLoading,
|
|
108
108
|
hasPaymentInstructions: !1
|
|
109
109
|
};
|
|
110
110
|
if (H.isBankAccountsError) return {
|
|
111
|
-
name:
|
|
112
|
-
email:
|
|
111
|
+
name: ie(e),
|
|
112
|
+
email: re(e),
|
|
113
113
|
methodLabel: S.paymentMethodUnavailable,
|
|
114
114
|
hasPaymentInstructions: !1
|
|
115
115
|
};
|
|
116
|
-
let t =
|
|
116
|
+
let t = ae(H.bankAccounts);
|
|
117
117
|
return {
|
|
118
|
-
name:
|
|
119
|
-
email:
|
|
118
|
+
name: ie(e),
|
|
119
|
+
email: re(e),
|
|
120
120
|
methodLabel: t ? S.paymentInstructionsValue(t.account_number?.slice(-4) ?? "") : S.noMethod,
|
|
121
121
|
hasPaymentInstructions: !!t
|
|
122
122
|
};
|
|
@@ -126,31 +126,29 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
126
126
|
H.isBankAccountsError,
|
|
127
127
|
H.isBankAccountsLoading,
|
|
128
128
|
S
|
|
129
|
-
]), K =
|
|
129
|
+
]), K = d(() => {
|
|
130
130
|
let e = et?.trim();
|
|
131
|
-
if (!e ||
|
|
131
|
+
if (!e || c || E) return;
|
|
132
132
|
let t = B?.accountNumber;
|
|
133
133
|
return {
|
|
134
134
|
name: e,
|
|
135
|
-
email:
|
|
135
|
+
email: _?.email ?? "",
|
|
136
136
|
description: tt ? S.pendingVendorDescription : S.pendingVendorIncompleteDescription,
|
|
137
137
|
methodLabel: t ? S.paymentInstructionsValue(t.slice(-4)) : "",
|
|
138
138
|
hasPaymentInstructions: !!t
|
|
139
139
|
};
|
|
140
140
|
}, [
|
|
141
|
-
|
|
141
|
+
c,
|
|
142
142
|
B?.accountNumber,
|
|
143
|
-
|
|
143
|
+
_?.email,
|
|
144
144
|
et,
|
|
145
145
|
E,
|
|
146
146
|
tt,
|
|
147
|
-
S
|
|
148
|
-
|
|
149
|
-
S.pendingVendorIncompleteDescription
|
|
150
|
-
]), ft = !!K && !tt, q = l === _ ? we : void 0, J = f(() => Ce(H.bankAccounts, q), [H.bankAccounts, q]), pt = f(() => ie(H.bankAccounts)?.id, [H.bankAccounts]), mt = !H.counterpart || H.isLoading || H.isFetching || H.isError || H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError, ht = mt || H.isAddressesLoading || H.isAddressesFetching || H.isAddressesError, gt = b && !mt && H.isAddressesError ? { onRetry: H.refetchAddresses } : void 0, Y = u(() => {
|
|
147
|
+
S
|
|
148
|
+
]), ft = !!K && !tt, q = c === g ? Te : void 0, J = d(() => we(H.bankAccounts, q), [H.bankAccounts, q]), pt = d(() => ae(H.bankAccounts)?.id, [H.bankAccounts]), mt = !H.counterpart || H.isLoading || H.isFetching || H.isError || H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError, ht = mt || H.isAddressesLoading || H.isAddressesFetching || H.isAddressesError, gt = y && !mt && H.isAddressesError ? { onRetry: H.refetchAddresses } : void 0, Y = l(() => {
|
|
151
149
|
lt(), Le(void 0), D(!1), P.current = void 0;
|
|
152
|
-
}, [lt]), X =
|
|
153
|
-
if (D(!1), P.current = void 0, e === "edit") Ve(
|
|
150
|
+
}, [lt]), X = l((e) => {
|
|
151
|
+
if (D(!1), P.current = void 0, e === "edit") Ve(c), ct();
|
|
154
152
|
else {
|
|
155
153
|
st();
|
|
156
154
|
let e = w.trim();
|
|
@@ -161,83 +159,83 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
161
159
|
email: z?.email || t.email,
|
|
162
160
|
phone: z?.phone || t.phone,
|
|
163
161
|
address: z?.address ?? t.address
|
|
164
|
-
})), Ue(B ??
|
|
162
|
+
})), Ue(B ?? m), N(void 0), M.current = m;
|
|
165
163
|
}
|
|
166
164
|
Le(e);
|
|
167
165
|
}, [
|
|
168
|
-
|
|
166
|
+
c,
|
|
169
167
|
B,
|
|
170
168
|
st,
|
|
171
169
|
ct,
|
|
172
170
|
w,
|
|
173
171
|
W,
|
|
174
172
|
z
|
|
175
|
-
]), _t = U.revealErrors, vt =
|
|
173
|
+
]), _t = U.revealErrors, vt = l(() => {
|
|
176
174
|
Xe(!0), X("create"), _t();
|
|
177
|
-
let e = B ?
|
|
175
|
+
let e = B ? ce(B, C) : {};
|
|
178
176
|
Object.keys(e).length && N(e);
|
|
179
177
|
}, [
|
|
180
178
|
B,
|
|
181
179
|
C,
|
|
182
180
|
X,
|
|
183
181
|
_t
|
|
184
|
-
]), yt =
|
|
185
|
-
|
|
182
|
+
]), yt = f(!1), bt = !yt.current && !v && y && Ee && !g && !R && !Ye && ft, xt = bt && !$e.isLoading;
|
|
183
|
+
ye(() => {
|
|
186
184
|
xt && (yt.current = !0, vt());
|
|
187
185
|
}, [vt, xt]);
|
|
188
|
-
let St =
|
|
189
|
-
let e = J ?
|
|
186
|
+
let St = l(() => {
|
|
187
|
+
let e = J ? Ce(J) : m;
|
|
190
188
|
M.current = e, Ue(e), N(void 0), k(!0);
|
|
191
|
-
}, [J]), Ct =
|
|
189
|
+
}, [J]), Ct = l((e) => {
|
|
192
190
|
let t = {
|
|
193
191
|
...j.current,
|
|
194
192
|
...e
|
|
195
193
|
};
|
|
196
194
|
j.current = t, Ue(t);
|
|
197
|
-
let ee =
|
|
195
|
+
let ee = ce(t, C);
|
|
198
196
|
N((e) => {
|
|
199
197
|
if (!e) return e;
|
|
200
198
|
let t = { ...e };
|
|
201
199
|
for (let e of Object.keys(t)) ee[e] || delete t[e];
|
|
202
200
|
return Object.keys(t).length ? t : void 0;
|
|
203
201
|
});
|
|
204
|
-
}, [C]), wt =
|
|
205
|
-
nt ?
|
|
202
|
+
}, [C]), wt = l(() => {
|
|
203
|
+
nt ? b(I) : I();
|
|
206
204
|
}, [
|
|
207
205
|
I,
|
|
208
|
-
|
|
206
|
+
b,
|
|
209
207
|
nt
|
|
210
|
-
]), Z =
|
|
208
|
+
]), Z = l(() => {
|
|
211
209
|
Y(), I();
|
|
212
|
-
}, [I, Y]), Q = He || nt, $ =
|
|
210
|
+
}, [I, Y]), Q = He || nt, $ = l((e) => {
|
|
213
211
|
let t = () => {
|
|
214
212
|
Z(), e();
|
|
215
213
|
};
|
|
216
|
-
Q ?
|
|
214
|
+
Q ? b(t) : t();
|
|
217
215
|
}, [
|
|
218
|
-
|
|
216
|
+
b,
|
|
219
217
|
Z,
|
|
220
218
|
Q
|
|
221
|
-
]), Tt =
|
|
222
|
-
Q ?
|
|
219
|
+
]), Tt = l(() => {
|
|
220
|
+
Q ? b(Z) : Z();
|
|
223
221
|
}, [
|
|
224
|
-
|
|
222
|
+
b,
|
|
225
223
|
Z,
|
|
226
224
|
Q
|
|
227
|
-
]), Et =
|
|
225
|
+
]), Et = l(async ({ closeOnSuccess: t = !0, allowIncompleteVendor: ee = !1 } = {}) => {
|
|
228
226
|
if (ee && E === "create" && !P.current) {
|
|
229
|
-
let e = j.current, t =
|
|
227
|
+
let e = j.current, t = le({
|
|
230
228
|
...dt,
|
|
231
229
|
bankAccount: e
|
|
232
230
|
}, "create", C, "vendor");
|
|
233
|
-
if (
|
|
231
|
+
if (oe(t)) return He || !h(e, B ?? m) ? {
|
|
234
232
|
ok: !0,
|
|
235
|
-
counterpartRawData:
|
|
233
|
+
counterpartRawData: _e(dt, e, _)
|
|
236
234
|
} : { ok: !0 };
|
|
237
235
|
}
|
|
238
|
-
let n =
|
|
239
|
-
if (!
|
|
240
|
-
let e =
|
|
236
|
+
let n = c, r = !1, i = j.current;
|
|
237
|
+
if (!h(i, M.current)) {
|
|
238
|
+
let e = ce(i, C);
|
|
241
239
|
if (Object.keys(e).length > 0) return N(e), E !== "create" && k(!0), { ok: !1 };
|
|
242
240
|
}
|
|
243
241
|
if (E === "edit" && ht) return { ok: !1 };
|
|
@@ -252,7 +250,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
252
250
|
}
|
|
253
251
|
if (!n) return { ok: !0 };
|
|
254
252
|
let a = H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError;
|
|
255
|
-
if (
|
|
253
|
+
if (h(i, M.current)) {
|
|
256
254
|
let e = qe ?? q;
|
|
257
255
|
return e ? (t && (k(!1), E && Y()), r && L(n), {
|
|
258
256
|
ok: !0,
|
|
@@ -269,7 +267,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
269
267
|
}
|
|
270
268
|
if (a) return { ok: !1 };
|
|
271
269
|
N(void 0);
|
|
272
|
-
let o =
|
|
270
|
+
let o = se(H.bankAccounts, qe ?? J?.id), s;
|
|
273
271
|
try {
|
|
274
272
|
o.kind === "update" ? (await ot.mutateAsync({
|
|
275
273
|
path: {
|
|
@@ -297,18 +295,19 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
297
295
|
};
|
|
298
296
|
}, [
|
|
299
297
|
Y,
|
|
300
|
-
|
|
298
|
+
c,
|
|
301
299
|
at,
|
|
302
300
|
H.bankAccounts,
|
|
303
301
|
H.isBankAccountsError,
|
|
304
302
|
H.isBankAccountsFetching,
|
|
305
303
|
H.isBankAccountsLoading,
|
|
306
304
|
B,
|
|
307
|
-
|
|
305
|
+
_,
|
|
308
306
|
E,
|
|
309
307
|
dt,
|
|
310
308
|
He,
|
|
311
309
|
ht,
|
|
310
|
+
S.bankAccountSaveFailed,
|
|
312
311
|
q,
|
|
313
312
|
C,
|
|
314
313
|
pt,
|
|
@@ -317,7 +316,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
317
316
|
ut,
|
|
318
317
|
ot,
|
|
319
318
|
qe
|
|
320
|
-
]), Dt =
|
|
319
|
+
]), Dt = l((e) => {
|
|
321
320
|
if (F.current) return F.current;
|
|
322
321
|
let t = (async () => {
|
|
323
322
|
Qe(!0);
|
|
@@ -328,11 +327,11 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
328
327
|
}
|
|
329
328
|
})();
|
|
330
329
|
return F.current = t, t;
|
|
331
|
-
}, [Et]), Ot =
|
|
330
|
+
}, [Et]), Ot = l(() => {
|
|
332
331
|
k(!1), E && Y();
|
|
333
|
-
}, [E, Y]), kt =
|
|
334
|
-
name:
|
|
335
|
-
email:
|
|
332
|
+
}, [E, Y]), kt = d(() => (V.data?.data ?? []).map((e) => ({
|
|
333
|
+
name: ie(e),
|
|
334
|
+
email: re(e),
|
|
336
335
|
onSelect: () => {
|
|
337
336
|
$(() => L(e.id));
|
|
338
337
|
}
|
|
@@ -340,7 +339,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
340
339
|
V.data,
|
|
341
340
|
$,
|
|
342
341
|
L
|
|
343
|
-
]), At =
|
|
342
|
+
]), At = l((e) => {
|
|
344
343
|
D(!0), W((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
345
344
|
...t,
|
|
346
345
|
...e,
|
|
@@ -354,7 +353,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
354
353
|
...t,
|
|
355
354
|
...e
|
|
356
355
|
});
|
|
357
|
-
}, [W]), jt =
|
|
356
|
+
}, [W]), jt = l((e) => {
|
|
358
357
|
D(!0), W((t) => ({
|
|
359
358
|
...t,
|
|
360
359
|
address: {
|
|
@@ -365,7 +364,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
365
364
|
}, [W]), Mt = {
|
|
366
365
|
query: w,
|
|
367
366
|
onQueryChange: Pe,
|
|
368
|
-
isLoading: bt || !
|
|
367
|
+
isLoading: bt || !Ee || !Me || !!c && H.isLoading || V.isLoading || V.isFetching && it,
|
|
369
368
|
onAddVendor: () => {
|
|
370
369
|
if (E === "create") {
|
|
371
370
|
let e = w.trim(), [t, ...ee] = e.split(/\s+/);
|
|
@@ -382,7 +381,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
382
381
|
$(() => X("create"));
|
|
383
382
|
},
|
|
384
383
|
results: kt
|
|
385
|
-
}, Nt =
|
|
384
|
+
}, Nt = Ae && (E === "create" || !mt) ? {
|
|
386
385
|
isOpen: O,
|
|
387
386
|
values: A,
|
|
388
387
|
errors: We,
|
|
@@ -392,7 +391,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
392
391
|
} : void 0, Pt = E !== "create" && Nt ? {
|
|
393
392
|
...Nt,
|
|
394
393
|
onOpen: E === "edit" ? () => $(St) : Nt.onOpen,
|
|
395
|
-
canEditExisting:
|
|
394
|
+
canEditExisting: ke
|
|
396
395
|
} : void 0, Ft = U.isSubmitting || at.isPending || ot.isPending, It = {
|
|
397
396
|
prepareVendorForSave: Dt,
|
|
398
397
|
isVendorSavePending: Ze || Ft,
|
|
@@ -407,16 +406,16 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
407
406
|
paymentInstructions: a(Pt, !!G?.hasPaymentInstructions),
|
|
408
407
|
paymentInstructionsEditor: Pt,
|
|
409
408
|
detailsWarning: gt
|
|
410
|
-
}, Lt = E === "create" &&
|
|
409
|
+
}, Lt = E === "create" && Ae ? {
|
|
411
410
|
values: A,
|
|
412
411
|
errors: We,
|
|
413
412
|
onChange: Ct,
|
|
414
|
-
isExtracted: !!(B &&
|
|
413
|
+
isExtracted: !!(B && h(A, B))
|
|
415
414
|
} : void 0;
|
|
416
415
|
if (E) return {
|
|
417
416
|
mode: "creating",
|
|
418
417
|
summary: G,
|
|
419
|
-
newVendorForm: /* @__PURE__ */
|
|
418
|
+
newVendorForm: /* @__PURE__ */ be(ve, {
|
|
420
419
|
mode: E,
|
|
421
420
|
values: U.values,
|
|
422
421
|
errors: U.errors,
|
|
@@ -429,20 +428,20 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
429
428
|
isSaving: Ft,
|
|
430
429
|
search: rt ? Mt : void 0,
|
|
431
430
|
paymentInstructions: Lt,
|
|
432
|
-
labels:
|
|
431
|
+
labels: x?.inlineForm
|
|
433
432
|
}),
|
|
434
433
|
...It
|
|
435
434
|
};
|
|
436
435
|
if (G) return {
|
|
437
436
|
mode: "resolved",
|
|
438
437
|
summary: G,
|
|
439
|
-
onEdit:
|
|
438
|
+
onEdit: y && !ht ? () => $(() => X("edit")) : void 0,
|
|
440
439
|
...It
|
|
441
440
|
};
|
|
442
441
|
if (K && !bt) {
|
|
443
442
|
let e = () => $(() => {
|
|
444
443
|
Xe(!0), X("create");
|
|
445
|
-
}), t =
|
|
444
|
+
}), t = y && Ae ? {
|
|
446
445
|
isOpen: !1,
|
|
447
446
|
values: A,
|
|
448
447
|
errors: We,
|
|
@@ -454,8 +453,8 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
454
453
|
return {
|
|
455
454
|
mode: "resolved",
|
|
456
455
|
summary: K,
|
|
457
|
-
onEdit:
|
|
458
|
-
error:
|
|
456
|
+
onEdit: y ? e : void 0,
|
|
457
|
+
error: Oe,
|
|
459
458
|
...It,
|
|
460
459
|
showPaymentInstructions: !0,
|
|
461
460
|
paymentInstructions: a(t, K.hasPaymentInstructions),
|
|
@@ -464,10 +463,10 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
|
|
|
464
463
|
}
|
|
465
464
|
return {
|
|
466
465
|
mode: "selecting",
|
|
467
|
-
error: V.isError ? S.searchFailed : H.isError ? S.vendorDetailsFailed :
|
|
466
|
+
error: V.isError ? S.searchFailed : H.isError ? S.vendorDetailsFailed : Oe,
|
|
468
467
|
search: Mt,
|
|
469
468
|
...It
|
|
470
469
|
};
|
|
471
470
|
}
|
|
472
471
|
//#endregion
|
|
473
|
-
export {
|
|
472
|
+
export { g as useVendorSectionProps };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { BankAccountFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/
|
|
6
|
-
import { ConfirmDeleteDialog as t } from "../../../../../shared/counterpart-management/ui/dist/
|
|
5
|
+
import { BankAccountFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/index11.js";
|
|
6
|
+
import { ConfirmDeleteDialog as t } from "../../../../../shared/counterpart-management/ui/dist/index13.js";
|
|
7
7
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
8
|
import { EDIT_FORM_FIELD_KEYS as n, addressFormLabelOverrides as r, buildCounterpartEditFormView as i, editFormLabelOverrides as a, withAddressLabelOverrides as o } from "./viewModels.js";
|
|
9
9
|
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as s } from "../../../../ui/dist/index2.js";
|
|
@@ -6,7 +6,7 @@ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/
|
|
|
6
6
|
import "../../../../../shared/ui/dist/index.js";
|
|
7
7
|
import { buildAnalyticsMap as t, buildCounterpartRows as n } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
8
|
import { useCounterpartsQuery as r } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
9
|
-
import { useCounterpartAddressesForRowsQuery as i } from "../../../../../shared/counterpart-management/data-access/dist/
|
|
9
|
+
import { useCounterpartAddressesForRowsQuery as i } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
10
10
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
11
|
import { PAYABLES_BILLED_STATUSES as a, PAYABLES_OWED_STATUSES as o, RECEIVABLES_BILLED_STATUSES as s, RECEIVABLES_DUE_STATUSES as c } from "./constants.js";
|
|
12
12
|
import { usePayablesAnalyticsByCounterpartQuery as l, useReceivablesAnalyticsByCounterpartQuery as u } from "../../../../data-access/dist/index2.js";
|
|
@@ -9,7 +9,7 @@ import "../../../../../shared/ui/dist/index.js";
|
|
|
9
9
|
import { COUNTERPART_MESSAGE_LABELS_EN as r } from "../../../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
10
10
|
import { getCounterpartEmail as i } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
11
11
|
import { useCounterpartQuery as a, useCreateCounterpartMutation as o } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
12
|
-
import { useCounterpartAddressesQuery as s } from "../../../../../shared/counterpart-management/data-access/dist/
|
|
12
|
+
import { useCounterpartAddressesQuery as s } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
13
13
|
import { useCounterpartForm as c } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
14
14
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
15
15
|
import "../../../../ui/dist/index20.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OFFER_WIDGET_STATUS_LABELS_EN as e } from "./lib/OfferWidget/labels.js";
|
|
2
|
+
import { OFFER_WIDGET_LABELS_EN as t } from "../../ui/dist/index2.js";
|
|
3
|
+
import { OfferBenefitIcon as n } from "../../ui/dist/index3.js";
|
|
4
|
+
import { OfferWidget as r } from "./lib/OfferWidget/OfferWidget.js";
|
|
5
|
+
export { t as OFFER_WIDGET_LABELS_EN, e as OFFER_WIDGET_STATUS_LABELS_EN, n as OfferBenefitIcon, r as OfferWidget };
|
|
@@ -9,17 +9,17 @@ import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/Widg
|
|
|
9
9
|
import { useWidgetConfig as r, useWidgetInitStaleForToken as i } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
10
|
import { deniedNoticeExpiresAt as a, selectBankAccountApplication as o } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
11
11
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { OFFER_WIDGET_STATUS_LABELS_EN as s } from "./labels.js";
|
|
13
|
+
import { OfferWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
|
|
14
|
+
import { offerWidgetTestIds as u } from "../testIds.js";
|
|
15
|
+
import { OfferApplicationView as d, offerApplicationViewFor as f } from "./offerApplicationView.js";
|
|
16
|
+
import { OFFER_WIDGET_LABELS_EN as p } from "../../../../ui/dist/index2.js";
|
|
17
|
+
import { OfferBenefitIcon as m, OfferWidgetStatusTone as h } from "../../../../ui/dist/index3.js";
|
|
18
|
+
import { OfferWidget as g } from "../../../../ui/dist/index9.js";
|
|
19
19
|
import "../../../../ui/dist/index.js";
|
|
20
20
|
import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
|
|
21
21
|
import { jsx as S } from "react/jsx-runtime";
|
|
22
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
22
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js
|
|
23
23
|
var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
|
|
24
24
|
"ACTIVE",
|
|
25
25
|
"INACTIVE",
|
|
@@ -120,8 +120,8 @@ function A({ content: n, onPrimaryCtaClick: s, labels: l, statusLabels: p }) {
|
|
|
120
120
|
howItWorksSteps: n.howItWorksSteps,
|
|
121
121
|
fromDayOneHeader: n.fromDayOneHeader,
|
|
122
122
|
benefits: n.benefits,
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
onOpenOfferModal: W,
|
|
124
|
+
onCloseOfferModal: G,
|
|
125
125
|
onPrimaryCtaClick: K,
|
|
126
126
|
statusMessage: V,
|
|
127
127
|
labels: H,
|
|
@@ -157,4 +157,4 @@ function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
//#endregion
|
|
160
|
-
export { p as
|
|
160
|
+
export { p as OFFER_WIDGET_LABELS_EN, s as OFFER_WIDGET_STATUS_LABELS_EN, m as OfferBenefitIcon, j as OfferWidget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/labels.js
|
|
2
2
|
function e(e) {
|
|
3
3
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
4
4
|
}
|
|
@@ -34,4 +34,4 @@ var n = {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
|
-
export { r as
|
|
37
|
+
export { r as OFFER_WIDGET_STATUS_LABELS_EN };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { deniedNoticeExpiresAt as e } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
2
2
|
import "../../../../../shared/feature/dist/index.js";
|
|
3
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js
|
|
4
4
|
var t = {
|
|
5
5
|
Offer: "offer",
|
|
6
6
|
Resume: "resume",
|
|
@@ -28,4 +28,4 @@ function n(n, r = Date.now()) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export { t as
|
|
31
|
+
export { t as OfferApplicationView, n as offerApplicationViewFor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js
|
|
2
|
+
var e = {
|
|
3
|
+
Mounted: "marketing.mounted",
|
|
4
|
+
OpenModal: "marketing.open_modal",
|
|
5
|
+
PrimaryCta: "marketing.primary_cta"
|
|
6
|
+
}, t = "marketing";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as OfferWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/testIds.js
|
|
2
2
|
var e = {
|
|
3
3
|
root: "marketing-widget",
|
|
4
4
|
learnMoreButton: "marketing-widget-learn-more-button",
|
|
@@ -8,4 +8,4 @@ var e = {
|
|
|
8
8
|
primaryCtaButton: "marketing-widget-primary-cta-button"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
|
-
export { e as
|
|
11
|
+
export { e as offerWidgetTestIds };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/labels.js
|
|
2
2
|
var e = { scenarios: {
|
|
3
3
|
default: {
|
|
4
4
|
label: "Available",
|
|
@@ -26,4 +26,4 @@ var e = { scenarios: {
|
|
|
26
26
|
}
|
|
27
27
|
} };
|
|
28
28
|
//#endregion
|
|
29
|
-
export { e as
|
|
29
|
+
export { e as OFFER_LABELS };
|