@tesouro/embedded-components-react 0.5.198 → 0.5.200
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/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +78 -77
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +258 -257
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/personDisclosure.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +27 -11
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { personDisclosure as e } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
2
|
+
import { useAcceptWidgetDisclosures as t } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
3
|
+
import { useDisclosuresQuery as n } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
3
4
|
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
export { e as
|
|
5
|
+
export { e as personDisclosure, t as useAcceptWidgetDisclosures, n as useDisclosuresQuery };
|
package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js
CHANGED
|
@@ -3,112 +3,113 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { personDisclosure as t } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
7
|
+
import { useAcceptWidgetDisclosures as n } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
8
|
+
import { useDisclosuresQuery as r } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
9
|
+
import { ErrorState as i } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
9
10
|
import "../../../shared/ui/dist/index.js";
|
|
10
|
-
import { useAnalyticsTrack as
|
|
11
|
-
import { WidgetProvider as
|
|
12
|
-
import { useRefetchWidget as
|
|
11
|
+
import { useAnalyticsTrack as a } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
12
|
+
import { WidgetProvider as o } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
13
|
+
import { useRefetchWidget as s, useWidgetConfig as c, useWidgetInitStaleForToken as l } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
14
|
import "../../../shared/feature/dist/index.js";
|
|
14
|
-
import { AcceptDisclosuresWidgetAnalyticsEvent as
|
|
15
|
-
import { mergeAcceptDisclosuresWidgetLabels as
|
|
16
|
-
import { AcceptDisclosuresWidget as
|
|
15
|
+
import { AcceptDisclosuresWidgetAnalyticsEvent as u, WIDGET_NAME as d } from "./index2.js";
|
|
16
|
+
import { mergeAcceptDisclosuresWidgetLabels as f } from "../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
17
|
+
import { AcceptDisclosuresWidget as p } from "../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
|
|
17
18
|
import "../../ui/dist/index.js";
|
|
18
|
-
import { resolveAcceptDisclosuresContent as
|
|
19
|
-
import { acceptDisclosuresWidgetTestIds as
|
|
19
|
+
import { resolveAcceptDisclosuresContent as m } from "./index3.js";
|
|
20
|
+
import { acceptDisclosuresWidgetTestIds as h } from "./index4.js";
|
|
20
21
|
import "../../data-access/dist/index.js";
|
|
21
|
-
import { useCallback as
|
|
22
|
-
import { Fragment as
|
|
22
|
+
import { useCallback as g, useEffect as _, useRef as v, useState as y } from "react";
|
|
23
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
23
24
|
//#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
function C(e, t, n) {
|
|
26
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
26
27
|
n.providerAttributionPrefix,
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ x("strong", { children: e }),
|
|
28
29
|
n.providerAttributionMiddle,
|
|
29
30
|
t,
|
|
30
31
|
n.providerAttributionSuffix
|
|
31
32
|
] });
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
title:
|
|
39
|
-
description: e(
|
|
40
|
-
retryLabel:
|
|
34
|
+
function w({ labels: n, onAccepted: o }) {
|
|
35
|
+
let s = a(), { initResponse: d } = c(), p = l(), h = f(n), { data: g, isError: v, error: y, refetch: b } = r({ userId: d?.userId ?? void 0 });
|
|
36
|
+
if (_(() => {
|
|
37
|
+
s(u.Mounted);
|
|
38
|
+
}, [s]), v) return /* @__PURE__ */ x(i, {
|
|
39
|
+
title: h.loadErrorTitle,
|
|
40
|
+
description: e(y) ?? h.loadErrorFallback,
|
|
41
|
+
retryLabel: h.loadErrorRetryLabel,
|
|
41
42
|
onRetry: () => {
|
|
42
|
-
|
|
43
|
+
b();
|
|
43
44
|
},
|
|
44
45
|
testId: "accept-disclosures-load-error"
|
|
45
46
|
});
|
|
46
|
-
let
|
|
47
|
-
documents:
|
|
48
|
-
vspName:
|
|
49
|
-
bankName:
|
|
50
|
-
labels:
|
|
47
|
+
let S = t(g), C = m({
|
|
48
|
+
documents: g ? S?.documents ?? [] : void 0,
|
|
49
|
+
vspName: d?.vspName,
|
|
50
|
+
bankName: d?.bankName,
|
|
51
|
+
labels: n
|
|
51
52
|
});
|
|
52
|
-
if (!
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
let
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
displayedVersion:
|
|
58
|
-
labelOverrides:
|
|
59
|
-
content:
|
|
60
|
-
labels:
|
|
61
|
-
onAccepted:
|
|
62
|
-
onDisclosuresVersionChanged:
|
|
63
|
-
},
|
|
53
|
+
if (!C) return null;
|
|
54
|
+
let w = S?.disclosureId ?? null;
|
|
55
|
+
if (p) return null;
|
|
56
|
+
let E = `${`user:${d?.userId ?? ""}`}:${w}:${C.vspName}:${C.bankName}:${C.agreementText}:${C.disclosureLinks.map((e) => e.href).join("|")}`;
|
|
57
|
+
return /* @__PURE__ */ x(T, {
|
|
58
|
+
displayedVersion: w,
|
|
59
|
+
labelOverrides: n,
|
|
60
|
+
content: C,
|
|
61
|
+
labels: h,
|
|
62
|
+
onAccepted: o,
|
|
63
|
+
onDisclosuresVersionChanged: b
|
|
64
|
+
}, E);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
let [l, u] =
|
|
67
|
-
|
|
68
|
-
}, []), O =
|
|
69
|
-
if (!(!l ||
|
|
70
|
-
|
|
66
|
+
function T({ displayedVersion: t, labelOverrides: r, content: i, labels: a, onAccepted: o, onDisclosuresVersionChanged: c }) {
|
|
67
|
+
let [l, u] = y(!1), [d, f] = y(), [m, _] = y(!1), [b, S] = y(!1), w = v(!1), { mutateAsync: T } = n(), E = s(), D = g((e) => {
|
|
68
|
+
f(void 0), u(e);
|
|
69
|
+
}, []), O = g(async () => {
|
|
70
|
+
if (!(!l || m || b)) {
|
|
71
|
+
f(void 0), _(!0);
|
|
71
72
|
try {
|
|
72
73
|
if (!w.current) try {
|
|
73
|
-
await T({ displayedVersion:
|
|
74
|
+
await T({ displayedVersion: t }), w.current = !0;
|
|
74
75
|
} catch (t) {
|
|
75
76
|
if (t instanceof Error && t.name === "DisclosuresVersionChangedError") {
|
|
76
|
-
|
|
77
|
+
f(a.disclosuresUpdatedFallback), c();
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
f(e(t) ?? a.acceptErrorFallback);
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
83
|
try {
|
|
83
|
-
await
|
|
84
|
+
await o?.();
|
|
84
85
|
} catch (t) {
|
|
85
|
-
|
|
86
|
+
f(e(t) ?? a.acceptErrorFallback);
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
E(),
|
|
89
|
+
E(), S(!0);
|
|
89
90
|
} finally {
|
|
90
|
-
|
|
91
|
+
_(!1);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}, [
|
|
94
95
|
T,
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
t,
|
|
97
|
+
b,
|
|
97
98
|
l,
|
|
98
|
-
|
|
99
|
+
m,
|
|
99
100
|
a.acceptErrorFallback,
|
|
100
101
|
a.disclosuresUpdatedFallback,
|
|
101
|
-
|
|
102
|
+
o,
|
|
102
103
|
c,
|
|
103
104
|
E
|
|
104
105
|
]);
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ x(p, {
|
|
106
107
|
labels: {
|
|
107
108
|
...r,
|
|
108
109
|
title: i.title,
|
|
109
110
|
agreementCheckboxAriaLabel: i.agreementCheckboxAriaLabel
|
|
110
111
|
},
|
|
111
|
-
providerAttribution:
|
|
112
|
+
providerAttribution: C(i.vspName, i.bankName, a),
|
|
112
113
|
agreementText: i.agreementText,
|
|
113
114
|
disclosureLinks: i.disclosureLinks,
|
|
114
115
|
isAgreed: l,
|
|
@@ -116,38 +117,38 @@ function w({ displayedVersion: n, labelOverrides: r, content: i, labels: a, onAc
|
|
|
116
117
|
onAccept: () => {
|
|
117
118
|
O();
|
|
118
119
|
},
|
|
119
|
-
isSubmitting:
|
|
120
|
-
isAccepted:
|
|
120
|
+
isSubmitting: m,
|
|
121
|
+
isAccepted: b,
|
|
121
122
|
errorMessage: d,
|
|
122
123
|
testIds: {
|
|
123
|
-
root:
|
|
124
|
-
providerAttribution:
|
|
125
|
-
disclosureLinks:
|
|
126
|
-
agreeCheckbox:
|
|
127
|
-
agreementText:
|
|
128
|
-
acceptButton:
|
|
129
|
-
error:
|
|
124
|
+
root: h.root,
|
|
125
|
+
providerAttribution: h.providerAttribution,
|
|
126
|
+
disclosureLinks: h.disclosureLinks,
|
|
127
|
+
agreeCheckbox: h.agreeCheckbox,
|
|
128
|
+
agreementText: h.agreementText,
|
|
129
|
+
acceptButton: h.acceptButton,
|
|
130
|
+
error: h.error
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
widgetName:
|
|
134
|
+
function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
135
|
+
return /* @__PURE__ */ x(o, {
|
|
136
|
+
widgetName: d,
|
|
136
137
|
baseUrl: e,
|
|
137
138
|
widgetToken: t,
|
|
138
139
|
organizationId: n,
|
|
139
140
|
configClient: r,
|
|
140
141
|
gatewayRouting: i,
|
|
141
|
-
linkComponent:
|
|
142
|
+
linkComponent: a,
|
|
142
143
|
implementation: s,
|
|
143
144
|
uiFramework: c,
|
|
144
145
|
errorFallback: l,
|
|
145
|
-
onError:
|
|
146
|
+
onError: u,
|
|
146
147
|
analytics: f,
|
|
147
148
|
disclosuresAcceptance: p,
|
|
148
149
|
providerLabels: m,
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ x(w, { ...h })
|
|
150
151
|
});
|
|
151
152
|
}
|
|
152
153
|
//#endregion
|
|
153
|
-
export {
|
|
154
|
+
export { E as AcceptDisclosuresWidget };
|
|
@@ -6,22 +6,23 @@ import { Dialog as e, DialogContent as t, DialogTitle as n, toast as r } from ".
|
|
|
6
6
|
import { getStateOptions as i } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
7
|
import { extractApiErrorMessage as a } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
8
8
|
import { useEmbedApi as o } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { personDisclosure as s } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
10
|
+
import { useAcceptWidgetDisclosures as c } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
11
|
+
import { useDisclosuresQuery as l } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
12
|
+
import { OnboardingSuppressionReason as u } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
13
|
+
import { useOrganizationOnboardingSuppression as ee } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
13
14
|
import "../../../shared/data-access/dist/index.js";
|
|
14
|
-
import { EmbeddedToaster as
|
|
15
|
-
import { OnboardingShell as
|
|
15
|
+
import { EmbeddedToaster as te } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
16
|
+
import { OnboardingShell as d } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
|
|
16
17
|
import "../../../shared/ui/dist/index.js";
|
|
17
|
-
import { useAnalyticsTrack as
|
|
18
|
-
import { WidgetProvider as
|
|
18
|
+
import { useAnalyticsTrack as ne } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
19
|
+
import { WidgetProvider as f } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
19
20
|
import { useRefetchWidget as re, useWidgetConfig as ie } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
20
21
|
import { getNaicsOptions as ae } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
21
22
|
import "../../../shared/feature/dist/index.js";
|
|
22
23
|
import { identifierLast4 as oe, isIdentifierEnteredOrStored as se } from "./index7.js";
|
|
23
|
-
import { bankAccountOnboardingTestIds as
|
|
24
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
24
|
+
import { bankAccountOnboardingTestIds as p } from "./index12.js";
|
|
25
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as m } from "../../ui/dist/index5.js";
|
|
25
26
|
import { interpolateBankName as ce } from "../../ui/dist/index7.js";
|
|
26
27
|
import { ResultStep as le } from "../../ui/dist/index12.js";
|
|
27
28
|
import { UnsavedApplicationDialog as ue } from "../../ui/dist/index26.js";
|
|
@@ -29,13 +30,13 @@ import { DeleteApplicationDialog as de } from "../../ui/dist/index28.js";
|
|
|
29
30
|
import "../../ui/dist/index.js";
|
|
30
31
|
import { BusinessDetailsStep as fe } from "./index13.js";
|
|
31
32
|
import { PersonalDetailsStep as pe } from "./index15.js";
|
|
32
|
-
import { valuesKey as
|
|
33
|
+
import { valuesKey as h } from "./index17.js";
|
|
33
34
|
import { AdditionalOwnersStep as me } from "./index18.js";
|
|
34
35
|
import { buildCreateApplicationBody as he, buildUpdateApplicationBody as ge } from "./index19.js";
|
|
35
36
|
import { buildOnboardingPrefill as _e } from "./index20.js";
|
|
36
37
|
import { acceptDraftedValues as ve, asCreateBody as ye, buildDraftApplicationBody as be, draftOwners as xe } from "./index21.js";
|
|
37
38
|
import { OnboardingAnalyticsEvent as Se, WIDGET_NAME as Ce } from "./index22.js";
|
|
38
|
-
import { DEFAULT_LABELS as
|
|
39
|
+
import { DEFAULT_LABELS as g } from "./index23.js";
|
|
39
40
|
import { withoutResumeOnlyOwnerFields as we, withoutStoredIdentifierMarkers as Te } from "./index24.js";
|
|
40
41
|
import { ApplicationClientSecretProvider as Ee, useApplicationClientSecret as De } from "../../data-access/dist/index3.js";
|
|
41
42
|
import { useCreateApplication as Oe } from "../../data-access/dist/index5.js";
|
|
@@ -46,10 +47,10 @@ import { usePollApplicationCompletion as Me } from "../../data-access/dist/index
|
|
|
46
47
|
import { useResumableBankAccountApplication as Ne } from "../../data-access/dist/index11.js";
|
|
47
48
|
import { useStartedBankAccountApplication as Pe } from "../../data-access/dist/index12.js";
|
|
48
49
|
import "../../data-access/dist/index.js";
|
|
49
|
-
import { useCallback as Fe, useEffect as
|
|
50
|
-
import { Fragment as Le, jsx as
|
|
50
|
+
import { useCallback as Fe, useEffect as _, useMemo as v, useRef as Ie, useState as y } from "react";
|
|
51
|
+
import { Fragment as Le, jsx as b, jsxs as Re } from "react/jsx-runtime";
|
|
51
52
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js
|
|
52
|
-
var ze = "DRAFT", Be = [],
|
|
53
|
+
var ze = "DRAFT", Be = [], x = (e) => se(e, void 0);
|
|
53
54
|
function Ve(e) {
|
|
54
55
|
return {
|
|
55
56
|
...e,
|
|
@@ -58,7 +59,7 @@ function Ve(e) {
|
|
|
58
59
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function S(e) {
|
|
62
63
|
return {
|
|
63
64
|
...e,
|
|
64
65
|
ssn: "",
|
|
@@ -106,7 +107,7 @@ function Ge(e, t) {
|
|
|
106
107
|
subtitle: t.personalReviewSubtitle
|
|
107
108
|
};
|
|
108
109
|
let n = {
|
|
109
|
-
...
|
|
110
|
+
...m,
|
|
110
111
|
...t.additionalOwners
|
|
111
112
|
};
|
|
112
113
|
return {
|
|
@@ -114,57 +115,57 @@ function Ge(e, t) {
|
|
|
114
115
|
subtitle: n.subheading
|
|
115
116
|
};
|
|
116
117
|
}
|
|
117
|
-
function Ke({ onEmbeddedOnboardingCompletedSuccessfully:
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
let
|
|
123
|
-
...
|
|
124
|
-
...
|
|
118
|
+
function Ke({ onEmbeddedOnboardingCompletedSuccessfully: f, onNavigateToDashboard: se, labels: m, initialBusinessDetails: _e, initialPersonalDetails: Ce, initialAdditionalOwners: Te, initialApplicationId: Ee = null, initialBoundAuthEpoch: Ne, onEditableDraftChange: Pe, onApplicationDeleted: ze, bankLogoSrc: Ke, disclosureLinks: qe, open: Je, defaultOpen: Ye, onOpenChange: C, isFullScreenInline: w = !1 }) {
|
|
119
|
+
let T = ne(), { authEpoch: Xe } = o();
|
|
120
|
+
_(() => {
|
|
121
|
+
T(Se.Mounted);
|
|
122
|
+
}, [T]);
|
|
123
|
+
let E = {
|
|
124
|
+
...g,
|
|
125
|
+
...m,
|
|
125
126
|
stepIndicator: {
|
|
126
|
-
...
|
|
127
|
-
...
|
|
127
|
+
...g.stepIndicator,
|
|
128
|
+
...m?.stepIndicator
|
|
128
129
|
},
|
|
129
|
-
businessDetails:
|
|
130
|
-
personalDetails:
|
|
131
|
-
additionalOwners:
|
|
130
|
+
businessDetails: m?.businessDetails ?? {},
|
|
131
|
+
personalDetails: m?.personalDetails ?? {},
|
|
132
|
+
additionalOwners: m?.additionalOwners ?? {},
|
|
132
133
|
result: {
|
|
133
|
-
...
|
|
134
|
-
...
|
|
134
|
+
...g.result,
|
|
135
|
+
...m?.result
|
|
135
136
|
},
|
|
136
|
-
unsavedApplicationDialog:
|
|
137
|
-
deleteApplicationDialog:
|
|
138
|
-
},
|
|
139
|
-
tt && rt(e),
|
|
140
|
-
}, [
|
|
141
|
-
|
|
142
|
-
}, [
|
|
137
|
+
unsavedApplicationDialog: m?.unsavedApplicationDialog ?? {},
|
|
138
|
+
deleteApplicationDialog: m?.deleteApplicationDialog ?? {}
|
|
139
|
+
}, D = ie().initResponse, { termsHref: Ze, privacyHref: Qe, electronicCommunicationHref: $e, patriotActHref: et } = qe ?? {}, tt = Je === void 0, [nt, rt] = y(() => Ye ?? !1), it = tt ? nt : Je, at = Ye ?? !1, O = Fe((e) => {
|
|
140
|
+
tt && rt(e), C?.(e);
|
|
141
|
+
}, [C, tt]), ot = Fe(() => {
|
|
142
|
+
f();
|
|
143
|
+
}, [f]), st = re(), [k, ct] = y(0), [A, j] = y(() => ({
|
|
143
144
|
...Ue,
|
|
144
145
|
..._e
|
|
145
|
-
})), [
|
|
146
|
+
})), [M, N] = y(() => ({
|
|
146
147
|
...We,
|
|
147
148
|
...Ce
|
|
148
|
-
})), [
|
|
149
|
-
business:
|
|
150
|
-
personal:
|
|
151
|
-
owners:
|
|
152
|
-
})), [
|
|
153
|
-
|
|
154
|
-
if (!
|
|
149
|
+
})), [P, F] = y(() => Te ?? []), [I, lt] = y(() => ({
|
|
150
|
+
business: A,
|
|
151
|
+
personal: M,
|
|
152
|
+
owners: P
|
|
153
|
+
})), [ut, dt] = y(null);
|
|
154
|
+
_(() => {
|
|
155
|
+
if (!ut) return;
|
|
155
156
|
let e = {
|
|
156
|
-
business:
|
|
157
|
-
personal:
|
|
158
|
-
owners:
|
|
157
|
+
business: A,
|
|
158
|
+
personal: M,
|
|
159
|
+
owners: P
|
|
159
160
|
};
|
|
160
|
-
lt((t) =>
|
|
161
|
+
lt((t) => ut.next(e, t)), dt(null);
|
|
161
162
|
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
ut,
|
|
164
|
+
A,
|
|
165
|
+
M,
|
|
166
|
+
P
|
|
166
167
|
]);
|
|
167
|
-
let
|
|
168
|
+
let ft = (e, { owners: t = "none" } = {}) => dt({ next: (n, r) => ({
|
|
168
169
|
business: e.includes("business") ? n.business : r.business,
|
|
169
170
|
personal: e.includes("personal") ? n.personal : r.personal,
|
|
170
171
|
owners: t === "cleared" ? Be : t === "restored" ? ve({
|
|
@@ -177,106 +178,106 @@ function Ke({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboa
|
|
|
177
178
|
},
|
|
178
179
|
ownersWrite: "list"
|
|
179
180
|
}).owners : e.includes("owners") ? n.owners : r.owners
|
|
180
|
-
}) }), [
|
|
181
|
+
}) }), [pt, mt] = y(null), [ht, gt] = y(0), [_t, L] = y(!1), [vt, yt] = y(!1), [R, bt] = y(null), [z, xt] = y(null), [St, Ct] = y(null), [B, wt] = y(Ee), [Tt, Et] = y(!1), [V, Dt] = y({}), Ot = (e) => Dt((t) => ({
|
|
181
182
|
...t,
|
|
182
|
-
...e.taxId &&
|
|
183
|
+
...e.taxId && x(e.taxId) && e.taxIdStructure ? {
|
|
183
184
|
taxId: e.taxId,
|
|
184
185
|
taxIdStructure: e.taxIdStructure
|
|
185
186
|
} : {},
|
|
186
|
-
...e.ssn &&
|
|
187
|
-
})),
|
|
188
|
-
let { taxId: t, taxIdStructure: n } = V, r = t !== void 0 && n !== void 0 && e.companyStructure !==
|
|
189
|
-
|
|
187
|
+
...e.ssn && x(e.ssn) ? { ssn: e.ssn } : {}
|
|
188
|
+
})), kt = (e) => {
|
|
189
|
+
let { taxId: t, taxIdStructure: n } = V, r = t !== void 0 && n !== void 0 && e.companyStructure !== A.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
|
|
190
|
+
j(r ? {
|
|
190
191
|
...e,
|
|
191
192
|
taxId: e.taxId === t ? "" : e.taxId,
|
|
192
193
|
taxIdOnFileLast4: oe(t),
|
|
193
194
|
taxIdOnFileStructure: n
|
|
194
195
|
} : e);
|
|
195
|
-
}, [
|
|
196
|
-
!
|
|
197
|
-
let [
|
|
198
|
-
|
|
199
|
-
let
|
|
200
|
-
|
|
201
|
-
K && q && (
|
|
196
|
+
}, [At, jt] = y(Ne ?? Xe), [Mt, H] = y(null), [Nt, Pt] = y(!1), [Ft, U] = y(!1);
|
|
197
|
+
!w && !it && Ft && U(!1);
|
|
198
|
+
let [It, Lt] = y(!1), [Rt, zt] = y(null), Bt = Oe(), W = ke(), Vt = Ae(), Ht = je(), Ut = Me(), { setClientSecret: Wt } = De(), { data: Gt, refetch: Kt } = l(), { mutateAsync: qt } = c(), Jt = ee(), Yt = Ie(null);
|
|
199
|
+
_(() => () => Yt.current?.abort(), []);
|
|
200
|
+
let Xt = v(() => ae(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), Zt = v(() => i(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), Qt = v(() => i(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), $t = v(() => i(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), G = It || Rt !== null, en = D?.status === "ACTIVE" || D?.status === "INACTIVE", tn = D?.status === "INVITED", K = !!D && !G && (en || tn || Jt.isSuppressed), q = K ? en ? u.UserAlreadyOnboarded : tn ? u.UserInvitedToOrganization : Jt.reason : null;
|
|
201
|
+
_(() => {
|
|
202
|
+
K && q && (T(Se.Suppressed, { reason: q }), console.info(`[onboarding] not shown: ${q}`));
|
|
202
203
|
}, [
|
|
203
204
|
K,
|
|
204
205
|
q,
|
|
205
|
-
|
|
206
|
-
]),
|
|
206
|
+
T
|
|
207
|
+
]), _(() => {
|
|
207
208
|
Pe?.(G || B === null ? null : {
|
|
208
209
|
applicationId: B,
|
|
209
|
-
authEpoch:
|
|
210
|
+
authEpoch: At
|
|
210
211
|
});
|
|
211
212
|
}, [
|
|
212
213
|
Pe,
|
|
213
214
|
G,
|
|
214
215
|
B,
|
|
215
|
-
|
|
216
|
+
At
|
|
216
217
|
]);
|
|
217
|
-
let
|
|
218
|
-
if (
|
|
219
|
-
let J = R?.companyStructure === "SOLE_PROPRIETORSHIP",
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
],
|
|
218
|
+
let nn = Ie(Xe);
|
|
219
|
+
if (nn.current = Xe, !D || !G && (K || !Jt.isResolved)) return null;
|
|
220
|
+
let J = R?.companyStructure === "SOLE_PROPRIETORSHIP", rn = [
|
|
221
|
+
E.stepIndicator.business,
|
|
222
|
+
E.stepIndicator.personal,
|
|
223
|
+
E.stepIndicator.ownership
|
|
224
|
+
], an = k === 0 ? R : k === 1 ? z : k === 2 ? St : null, Y = Bt.isPending || W.isPending || Vt.isPending || Ht.isPending || It, on = () => {
|
|
224
225
|
H(null), ct((e) => e === 0 ? 0 : e - 1);
|
|
225
226
|
}, X = {
|
|
226
|
-
business:
|
|
227
|
-
personal:
|
|
228
|
-
owners:
|
|
229
|
-
},
|
|
227
|
+
business: h(A) !== h(I.business),
|
|
228
|
+
personal: h(M) !== h(I.personal),
|
|
229
|
+
owners: h(A.companyStructure === "SOLE_PROPRIETORSHIP" ? Be : He(P, pt)) !== h(I.owners)
|
|
230
|
+
}, sn = X.business || X.personal || X.owners, Z = {
|
|
230
231
|
business: (e) => V.taxId && e.taxId === V.taxId ? Ve(e) : e,
|
|
231
|
-
personal: (e) => V.ssn && e.ssn === V.ssn ?
|
|
232
|
-
owners: (e) => e.map((e) => e.id &&
|
|
233
|
-
},
|
|
232
|
+
personal: (e) => V.ssn && e.ssn === V.ssn ? S(e) : e,
|
|
233
|
+
owners: (e) => e.map((e) => e.id && x(e.ssn) ? S(e) : e)
|
|
234
|
+
}, cn = () => lt((e) => ({
|
|
234
235
|
business: Z.business(e.business),
|
|
235
236
|
personal: Z.personal(e.personal),
|
|
236
237
|
owners: Z.owners(e.owners)
|
|
237
|
-
})),
|
|
238
|
-
Y || (
|
|
239
|
-
},
|
|
240
|
-
e ?
|
|
241
|
-
},
|
|
242
|
-
|
|
238
|
+
})), ln = () => {
|
|
239
|
+
Y || (sn ? L(!0) : (j(Z.business), N(Z.personal), F(Z.owners), cn(), O(!1)));
|
|
240
|
+
}, un = (e) => {
|
|
241
|
+
e ? O(!0) : ln();
|
|
242
|
+
}, dn = ln, fn = async (e) => {
|
|
243
|
+
Lt(!0), O(!0);
|
|
243
244
|
let t = new AbortController();
|
|
244
|
-
|
|
245
|
+
Yt.current = t;
|
|
245
246
|
let n = !1;
|
|
246
247
|
try {
|
|
247
|
-
let r = await
|
|
248
|
+
let r = await Vt.mutateAsync({ path: { id: e } });
|
|
248
249
|
if (t.signal.aborted) return;
|
|
249
|
-
if (!r.id) throw Error(
|
|
250
|
-
if (n = !0, (await
|
|
251
|
-
let e =
|
|
252
|
-
if (e === void 0 && (e = (await
|
|
250
|
+
if (!r.id) throw Error(E.submitFailedError);
|
|
251
|
+
if (n = !0, (await Ut(e, { signal: t.signal })).status === "complete") {
|
|
252
|
+
let e = Gt;
|
|
253
|
+
if (e === void 0 && (e = (await Kt()).data), t.signal.aborted) return;
|
|
253
254
|
if (e !== void 0) try {
|
|
254
|
-
await
|
|
255
|
+
await qt({ displayedVersion: s(e)?.disclosureId ?? null });
|
|
255
256
|
} catch {}
|
|
256
257
|
if (t.signal.aborted) return;
|
|
257
|
-
|
|
258
|
-
} else
|
|
258
|
+
zt("success"), st(), ot();
|
|
259
|
+
} else zt("pending");
|
|
259
260
|
} catch (e) {
|
|
260
261
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
261
262
|
if (!n) throw e;
|
|
262
|
-
|
|
263
|
+
zt("pending");
|
|
263
264
|
} finally {
|
|
264
|
-
|
|
265
|
+
Yt.current = null, Lt(!1);
|
|
265
266
|
}
|
|
266
267
|
}, Q = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
267
|
-
|
|
268
|
-
}, fn = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
269
|
-
M((t) => (t.ssnOnFileLast4 || e) && b(t.ssn) ? x(t) : t);
|
|
268
|
+
j((t) => (t.taxIdOnFileLast4 || e) && x(t.taxId) ? Ve(t) : t);
|
|
270
269
|
}, pn = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
271
|
-
|
|
272
|
-
}, mn = () => {
|
|
273
|
-
|
|
274
|
-
}, hn =
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
270
|
+
N((t) => (t.ssnOnFileLast4 || e) && x(t.ssn) ? S(t) : t);
|
|
271
|
+
}, mn = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
272
|
+
F((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && x(t.ssn) ? S(t) : t));
|
|
273
|
+
}, hn = () => {
|
|
274
|
+
F((e) => e.map(we));
|
|
275
|
+
}, gn = async (e) => {
|
|
276
|
+
let t = nn.current, n = await Bt.mutateAsync({ body: e });
|
|
277
|
+
return wt(n.id), jt(t), n.clientSecret && Wt(n.id, n.clientSecret), n.id;
|
|
278
|
+
}, _n = async () => {
|
|
279
|
+
let e = I.business.companyStructure === "SOLE_PROPRIETORSHIP" && !J ? xe(P) : [], t = e.length > 0 ? { businessOwners: e } : {};
|
|
280
|
+
if (k === 0) {
|
|
280
281
|
if (!R) return null;
|
|
281
282
|
let e = B;
|
|
282
283
|
return e ? await W.mutateAsync({
|
|
@@ -284,115 +285,115 @@ function Ke({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboa
|
|
|
284
285
|
body: {
|
|
285
286
|
...ge({
|
|
286
287
|
businessDetails: R,
|
|
287
|
-
carryConsent: !
|
|
288
|
+
carryConsent: !Tt
|
|
288
289
|
}),
|
|
289
290
|
...t
|
|
290
291
|
}
|
|
291
|
-
}) : (e = await
|
|
292
|
+
}) : (e = await gn(he(R)), Et(!0)), Ot({
|
|
292
293
|
taxId: R.taxId,
|
|
293
294
|
taxIdStructure: R.companyStructure
|
|
294
|
-
}), Q(), J &&
|
|
295
|
+
}), Q(), J && hn(), ft(["business"], { owners: J ? "cleared" : t.businessOwners ? "restored" : "none" }), e;
|
|
295
296
|
}
|
|
296
|
-
return
|
|
297
|
+
return k === 1 ? !z || !R || !B ? null : (await W.mutateAsync({
|
|
297
298
|
path: { id: B },
|
|
298
299
|
body: {
|
|
299
300
|
...ge({
|
|
300
301
|
businessDetails: R,
|
|
301
302
|
applicant: z,
|
|
302
|
-
carryConsent: !
|
|
303
|
+
carryConsent: !Tt
|
|
303
304
|
}),
|
|
304
305
|
...t
|
|
305
306
|
}
|
|
306
|
-
}),
|
|
307
|
+
}), Ot({
|
|
307
308
|
taxId: R.taxId,
|
|
308
309
|
taxIdStructure: R.companyStructure,
|
|
309
310
|
ssn: z.ssn
|
|
310
|
-
}), Q(),
|
|
311
|
+
}), Q(), pn(), ft(["business", "personal"], { owners: J ? "cleared" : t.businessOwners ? "restored" : "none" }), B) : k === 2 ? !St || !B ? null : (await W.mutateAsync({
|
|
311
312
|
path: { id: B },
|
|
312
|
-
body: ge({ businessOwners:
|
|
313
|
-
}),
|
|
314
|
-
}, $ = (e) => a(e) ?? (e instanceof Error ? e.message : void 0) ??
|
|
313
|
+
body: ge({ businessOwners: St })
|
|
314
|
+
}), mn(), ft(["owners"]), B) : null;
|
|
315
|
+
}, $ = (e) => a(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError, vn = async () => {
|
|
315
316
|
H(null);
|
|
316
317
|
try {
|
|
317
|
-
let e = await
|
|
318
|
+
let e = await _n();
|
|
318
319
|
if (e === null) return;
|
|
319
|
-
|
|
320
|
+
k === 2 ? await fn(e) : ct(k + 1);
|
|
320
321
|
} catch (e) {
|
|
321
322
|
H($(e));
|
|
322
323
|
}
|
|
323
|
-
},
|
|
324
|
-
H(null),
|
|
324
|
+
}, yn = async () => {
|
|
325
|
+
H(null), Pt(!0);
|
|
325
326
|
try {
|
|
326
|
-
if (await
|
|
327
|
-
Q({ evenWithoutMarker: !0 }),
|
|
327
|
+
if (await _n() === null) return;
|
|
328
|
+
Q({ evenWithoutMarker: !0 }), k >= 1 && pn({ evenWithoutMarker: !0 }), k === 2 && mn({ evenWithoutMarker: !0 }), r.success(E.applicationSavedToast), O(!1);
|
|
328
329
|
} catch (e) {
|
|
329
330
|
r.error($(e));
|
|
330
331
|
} finally {
|
|
331
|
-
|
|
332
|
+
Pt(!1);
|
|
332
333
|
}
|
|
333
|
-
},
|
|
334
|
-
let e = He(
|
|
335
|
-
businessDetails:
|
|
336
|
-
applicant:
|
|
334
|
+
}, bn = async () => {
|
|
335
|
+
let e = He(P, pt), t = be({
|
|
336
|
+
businessDetails: A,
|
|
337
|
+
applicant: M,
|
|
337
338
|
businessOwners: e,
|
|
338
|
-
savedBusinessDetails:
|
|
339
|
-
savedOwners:
|
|
339
|
+
savedBusinessDetails: I.business,
|
|
340
|
+
savedOwners: I.owners,
|
|
340
341
|
dirty: X
|
|
341
342
|
}), n = X;
|
|
342
|
-
|
|
343
|
+
yt(!0);
|
|
343
344
|
try {
|
|
344
345
|
if (!t) {
|
|
345
|
-
r.error(
|
|
346
|
+
r.error(E.saveDraftNothingValidError);
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
349
|
let i = !B;
|
|
349
350
|
B ? await W.mutateAsync({
|
|
350
351
|
path: { id: B },
|
|
351
352
|
body: t
|
|
352
|
-
}) : await
|
|
353
|
+
}) : await gn(ye(t)), pt && F(e), r.success(E.applicationSavedToast);
|
|
353
354
|
let a = t;
|
|
354
|
-
i && a.applicant?.isLegallyAuthorized && a.applicant?.hasAcceptedDisclosures &&
|
|
355
|
+
i && a.applicant?.isLegallyAuthorized && a.applicant?.hasAcceptedDisclosures && Et(!0), Ot({
|
|
355
356
|
taxId: a.businessDetails?.taxId?.value,
|
|
356
|
-
taxIdStructure:
|
|
357
|
+
taxIdStructure: A.companyStructure,
|
|
357
358
|
ssn: a.applicant?.personalIdentificationNumber?.value
|
|
358
|
-
}), a.businessDetails?.taxId !== void 0 && Q({ evenWithoutMarker: !0 }), a.applicant?.personalIdentificationNumber !== void 0 &&
|
|
359
|
+
}), a.businessDetails?.taxId !== void 0 && Q({ evenWithoutMarker: !0 }), a.applicant?.personalIdentificationNumber !== void 0 && pn({ evenWithoutMarker: !0 }), Array.isArray(a.businessOwners) && mn({ evenWithoutMarker: !0 }), a.businessOwners === null && e.length > 0 && hn();
|
|
359
360
|
let o = Array.isArray(a.businessOwners) ? "list" : a.businessOwners === null ? "cleared" : "none";
|
|
360
|
-
|
|
361
|
+
dt({ next: (e, t) => ve({
|
|
361
362
|
current: e,
|
|
362
363
|
saved: t,
|
|
363
364
|
dirty: n,
|
|
364
365
|
ownersWrite: o
|
|
365
|
-
}) }),
|
|
366
|
+
}) }), mt(null), gt((e) => e + 1), L(!1), O(!1);
|
|
366
367
|
} catch (e) {
|
|
367
368
|
r.error($(e));
|
|
368
369
|
} finally {
|
|
369
|
-
|
|
370
|
+
yt(!1);
|
|
370
371
|
}
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
},
|
|
372
|
+
}, xn = () => {
|
|
373
|
+
j(Z.business(I.business)), N(Z.personal(I.personal)), F(Z.owners(I.owners)), cn(), mt(null), gt((e) => e + 1), H(null), L(!1), O(!1);
|
|
374
|
+
}, Sn = async () => {
|
|
374
375
|
if (B !== null) {
|
|
375
376
|
try {
|
|
376
|
-
await
|
|
377
|
+
await Ht.mutateAsync({ path: { id: B } });
|
|
377
378
|
} catch (e) {
|
|
378
379
|
r.error($(e));
|
|
379
380
|
return;
|
|
380
381
|
}
|
|
381
|
-
r.success(
|
|
382
|
+
r.success(E.applicationDeletedToast);
|
|
382
383
|
}
|
|
383
|
-
U(!1),
|
|
384
|
-
},
|
|
384
|
+
U(!1), O(!1), ze?.();
|
|
385
|
+
}, Cn = Ge(Math.min(k, 2), E), wn = D.bankName?.trim() || E.fallbackBankName, Tn = ce(E.shellFdicDisclaimer, wn);
|
|
385
386
|
if (G) {
|
|
386
|
-
let r = R?.companyLegalName ?? "", i =
|
|
387
|
-
...
|
|
388
|
-
...
|
|
389
|
-
}, c = /* @__PURE__ */
|
|
387
|
+
let r = R?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = Rt ?? "pending", o = a === "success", s = {
|
|
388
|
+
...g.result,
|
|
389
|
+
...E.result
|
|
390
|
+
}, c = /* @__PURE__ */ b(le, {
|
|
390
391
|
testIds: {
|
|
391
|
-
processing:
|
|
392
|
-
dashboardButton:
|
|
392
|
+
processing: p.resultProcessing,
|
|
393
|
+
dashboardButton: p.resultDashboardButton
|
|
393
394
|
},
|
|
394
395
|
status: a,
|
|
395
|
-
isLoading:
|
|
396
|
+
isLoading: It,
|
|
396
397
|
loadingMessage: s.loadingMessage,
|
|
397
398
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
398
399
|
headingLine2: `${r}!`,
|
|
@@ -405,136 +406,136 @@ function Ke({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboa
|
|
|
405
406
|
fdicDisclaimer: ce(s.fdicDisclaimer, i),
|
|
406
407
|
onNavigateToDashboard: se
|
|
407
408
|
});
|
|
408
|
-
return
|
|
409
|
+
return w ? /* @__PURE__ */ b("div", {
|
|
409
410
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:grid-rows-[1fr] ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
|
|
410
411
|
children: c
|
|
411
|
-
}) : /* @__PURE__ */
|
|
412
|
+
}) : /* @__PURE__ */ b(e, {
|
|
412
413
|
open: it,
|
|
413
|
-
onOpenChange:
|
|
414
|
+
onOpenChange: O,
|
|
414
415
|
children: /* @__PURE__ */ Re(t, {
|
|
415
416
|
className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ b(n, {
|
|
417
418
|
className: "ttw:sr-only",
|
|
418
|
-
children:
|
|
419
|
+
children: E.modalTitle
|
|
419
420
|
}), c]
|
|
420
421
|
})
|
|
421
422
|
});
|
|
422
423
|
}
|
|
423
|
-
let
|
|
424
|
+
let En = k === 2 ? E.submit : E.next, Dn = an === null || Y;
|
|
424
425
|
return /* @__PURE__ */ Re(Le, { children: [
|
|
425
|
-
/* @__PURE__ */ Re(
|
|
426
|
+
/* @__PURE__ */ Re(d, {
|
|
426
427
|
open: it,
|
|
427
428
|
defaultOpen: at,
|
|
428
|
-
onOpenChange:
|
|
429
|
-
isFullScreenInline:
|
|
430
|
-
title:
|
|
431
|
-
subtitle:
|
|
432
|
-
stepLabels:
|
|
433
|
-
activeStep:
|
|
434
|
-
disclaimerText:
|
|
435
|
-
onBack:
|
|
436
|
-
onCancel:
|
|
437
|
-
onNext:
|
|
438
|
-
onSaveAndClose:
|
|
429
|
+
onOpenChange: un,
|
|
430
|
+
isFullScreenInline: w,
|
|
431
|
+
title: Cn.title,
|
|
432
|
+
subtitle: Cn.subtitle,
|
|
433
|
+
stepLabels: rn,
|
|
434
|
+
activeStep: k,
|
|
435
|
+
disclaimerText: Tn,
|
|
436
|
+
onBack: k === 0 ? dn : on,
|
|
437
|
+
onCancel: k > 0 ? dn : void 0,
|
|
438
|
+
onNext: vn,
|
|
439
|
+
onSaveAndClose: yn,
|
|
439
440
|
onDelete: () => U(!0),
|
|
440
441
|
showDismissButton: !1,
|
|
441
|
-
isNextDisabled:
|
|
442
|
-
isNextLoading: Y && !
|
|
443
|
-
isSaveAndCloseDisabled:
|
|
444
|
-
isSaveAndCloseLoading:
|
|
445
|
-
nextLabel:
|
|
442
|
+
isNextDisabled: Dn,
|
|
443
|
+
isNextLoading: Y && !Nt,
|
|
444
|
+
isSaveAndCloseDisabled: Dn,
|
|
445
|
+
isSaveAndCloseLoading: Nt,
|
|
446
|
+
nextLabel: En,
|
|
446
447
|
nextIcon: null,
|
|
447
|
-
errorMessage:
|
|
448
|
+
errorMessage: Mt,
|
|
448
449
|
labels: {
|
|
449
|
-
backButton:
|
|
450
|
-
cancelButton:
|
|
451
|
-
saveAndCloseButton:
|
|
452
|
-
deleteButton:
|
|
450
|
+
backButton: k === 0 ? E.cancel : E.back,
|
|
451
|
+
cancelButton: E.cancel,
|
|
452
|
+
saveAndCloseButton: E.saveAndClose,
|
|
453
|
+
deleteButton: E.deleteApplication
|
|
453
454
|
},
|
|
454
455
|
testIds: {
|
|
455
|
-
root:
|
|
456
|
-
dismiss:
|
|
457
|
-
back:
|
|
458
|
-
cancel:
|
|
459
|
-
saveAndClose:
|
|
460
|
-
delete:
|
|
461
|
-
next:
|
|
456
|
+
root: p.shell,
|
|
457
|
+
dismiss: p.shellDismiss,
|
|
458
|
+
back: p.shellBack,
|
|
459
|
+
cancel: p.shellCancel,
|
|
460
|
+
saveAndClose: p.shellSaveAndClose,
|
|
461
|
+
delete: p.shellDelete,
|
|
462
|
+
next: p.shellNext,
|
|
462
463
|
scrollRegion: {
|
|
463
|
-
root:
|
|
464
|
-
fade:
|
|
465
|
-
hint:
|
|
464
|
+
root: p.shellScrollRegion,
|
|
465
|
+
fade: p.shellScrollFade,
|
|
466
|
+
hint: p.shellScrollHint
|
|
466
467
|
}
|
|
467
468
|
},
|
|
468
469
|
children: [
|
|
469
|
-
|
|
470
|
-
value:
|
|
471
|
-
onValueChange:
|
|
472
|
-
onSnapshotChange:
|
|
473
|
-
naicsOptions:
|
|
474
|
-
stateOptions:
|
|
470
|
+
k === 0 ? /* @__PURE__ */ b(fe, {
|
|
471
|
+
value: A,
|
|
472
|
+
onValueChange: kt,
|
|
473
|
+
onSnapshotChange: bt,
|
|
474
|
+
naicsOptions: Xt,
|
|
475
|
+
stateOptions: Zt,
|
|
475
476
|
isSubmitting: Y,
|
|
476
|
-
labels:
|
|
477
|
-
bankName:
|
|
477
|
+
labels: E.businessDetails,
|
|
478
|
+
bankName: wn,
|
|
478
479
|
termsHref: Ze,
|
|
479
480
|
privacyHref: Qe,
|
|
480
481
|
electronicCommunicationHref: $e,
|
|
481
482
|
patriotActHref: et
|
|
482
483
|
}, "business") : null,
|
|
483
|
-
|
|
484
|
-
value:
|
|
485
|
-
onValueChange:
|
|
486
|
-
onSnapshotChange:
|
|
487
|
-
stateOptions:
|
|
484
|
+
k === 1 ? /* @__PURE__ */ b(pe, {
|
|
485
|
+
value: M,
|
|
486
|
+
onValueChange: N,
|
|
487
|
+
onSnapshotChange: xt,
|
|
488
|
+
stateOptions: Qt,
|
|
488
489
|
isSubmitting: Y,
|
|
489
|
-
labels:
|
|
490
|
+
labels: E.personalDetails
|
|
490
491
|
}, "personal") : null,
|
|
491
|
-
|
|
492
|
-
owners: J ? Be :
|
|
493
|
-
onOwnersChange:
|
|
494
|
-
primaryOwnerName: `${
|
|
492
|
+
k === 2 ? /* @__PURE__ */ b(me, {
|
|
493
|
+
owners: J ? Be : P,
|
|
494
|
+
onOwnersChange: F,
|
|
495
|
+
primaryOwnerName: `${M.firstName} ${M.lastName}`.trim(),
|
|
495
496
|
primaryOwnerPercentage: J ? 100 : z?.ownsOver25Percent === !0 ? z.ownershipPercentage ?? 0 : 0,
|
|
496
|
-
stateOptions:
|
|
497
|
-
onSnapshotChange:
|
|
498
|
-
onPendingOwnerChange:
|
|
497
|
+
stateOptions: $t,
|
|
498
|
+
onSnapshotChange: Ct,
|
|
499
|
+
onPendingOwnerChange: mt,
|
|
499
500
|
isSubmitting: Y,
|
|
500
|
-
labels:
|
|
501
|
-
},
|
|
501
|
+
labels: E.additionalOwners
|
|
502
|
+
}, ht) : null
|
|
502
503
|
]
|
|
503
504
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
open:
|
|
506
|
-
onSaveDraft:
|
|
507
|
-
onDiscard:
|
|
505
|
+
/* @__PURE__ */ b(ue, {
|
|
506
|
+
open: _t,
|
|
507
|
+
onSaveDraft: bn,
|
|
508
|
+
onDiscard: xn,
|
|
508
509
|
onCancel: () => L(!1),
|
|
509
|
-
isSaving:
|
|
510
|
-
labels:
|
|
510
|
+
isSaving: vt,
|
|
511
|
+
labels: E.unsavedApplicationDialog,
|
|
511
512
|
testIds: {
|
|
512
|
-
root:
|
|
513
|
-
saveDraft:
|
|
514
|
-
discard:
|
|
515
|
-
close:
|
|
513
|
+
root: p.unsavedDialog,
|
|
514
|
+
saveDraft: p.unsavedDialogSaveDraft,
|
|
515
|
+
discard: p.unsavedDialogDiscard,
|
|
516
|
+
close: p.unsavedDialogClose
|
|
516
517
|
}
|
|
517
518
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
open:
|
|
520
|
-
onConfirm:
|
|
519
|
+
/* @__PURE__ */ b(de, {
|
|
520
|
+
open: Ft,
|
|
521
|
+
onConfirm: Sn,
|
|
521
522
|
onCancel: () => U(!1),
|
|
522
|
-
isDeleting:
|
|
523
|
+
isDeleting: Ht.isPending,
|
|
523
524
|
labels: {
|
|
524
|
-
descriptionEmphasis:
|
|
525
|
-
...
|
|
525
|
+
descriptionEmphasis: E.saveAndClose,
|
|
526
|
+
...E.deleteApplicationDialog
|
|
526
527
|
},
|
|
527
528
|
testIds: {
|
|
528
|
-
root:
|
|
529
|
-
confirm:
|
|
530
|
-
cancel:
|
|
529
|
+
root: p.deleteDialog,
|
|
530
|
+
confirm: p.deleteDialogConfirm,
|
|
531
|
+
cancel: p.deleteDialogCancel
|
|
531
532
|
}
|
|
532
533
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ b(te, {})
|
|
534
535
|
] });
|
|
535
536
|
}
|
|
536
537
|
function qe({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: ee, providerLabels: te, ...d }) {
|
|
537
|
-
return /* @__PURE__ */
|
|
538
|
+
return /* @__PURE__ */ b(f, {
|
|
538
539
|
baseUrl: e,
|
|
539
540
|
widgetToken: t,
|
|
540
541
|
organizationId: n,
|
|
@@ -549,37 +550,37 @@ function qe({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
|
|
|
549
550
|
disclosuresAcceptance: ee,
|
|
550
551
|
providerLabels: te,
|
|
551
552
|
widgetName: Ce,
|
|
552
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ b(Je, { ...d })
|
|
553
554
|
});
|
|
554
555
|
}
|
|
555
556
|
function Je(e) {
|
|
556
|
-
let { initResponse: t } = ie(), { client: n } = o(), r = t?.userId ?? null, [i, a] =
|
|
557
|
+
let { initResponse: t } = ie(), { client: n } = o(), r = t?.userId ?? null, [i, a] = y(r), [s, c] = y(0);
|
|
557
558
|
r !== i && (a(r), i !== null && r !== null && c((e) => e + 1));
|
|
558
|
-
let [l, u] =
|
|
559
|
-
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */
|
|
559
|
+
let [l, u] = y(n);
|
|
560
|
+
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ b(Ye, { ...e }, s);
|
|
560
561
|
}
|
|
561
562
|
function Ye(e) {
|
|
562
|
-
let { authEpoch: t } = o(), { ownApplicationIds: n } = Ne(), [r, i] =
|
|
563
|
+
let { authEpoch: t } = o(), { ownApplicationIds: n } = Ne(), [r, i] = y(null), [a, s] = y(0), [c, l] = y(!1), u = Fe(() => {
|
|
563
564
|
i(null), l(!0), s((e) => e + 1);
|
|
564
565
|
}, []);
|
|
565
|
-
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), s((e) => e + 1)), /* @__PURE__ */
|
|
566
|
+
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), s((e) => e + 1)), /* @__PURE__ */ b(Ee, { children: /* @__PURE__ */ b(w, {
|
|
566
567
|
...e,
|
|
567
568
|
defaultOpen: !c && e.defaultOpen,
|
|
568
569
|
onEditableDraftChange: i,
|
|
569
570
|
onApplicationDeleted: u
|
|
570
571
|
}, a) }, a);
|
|
571
572
|
}
|
|
572
|
-
var
|
|
573
|
-
function
|
|
574
|
-
let { authEpoch: t } = o(), { applicationId: n, clientSecret: r, isResolved: i } = Ne(), { application: a, isResolved: s, isUnavailable: c } = Pe(n, r), [l, u] =
|
|
575
|
-
if (
|
|
573
|
+
var C = { canRender: !1 };
|
|
574
|
+
function w(e) {
|
|
575
|
+
let { authEpoch: t } = o(), { applicationId: n, clientSecret: r, isResolved: i } = Ne(), { application: a, isResolved: s, isUnavailable: c } = Pe(n, r), [l, u] = y(null);
|
|
576
|
+
if (_(() => {
|
|
576
577
|
if (l?.canRender !== !0 && i && s) {
|
|
577
578
|
if (c) {
|
|
578
|
-
u(
|
|
579
|
+
u(C);
|
|
579
580
|
return;
|
|
580
581
|
}
|
|
581
582
|
if (a !== null && a.status !== void 0 && a.status !== ze) {
|
|
582
|
-
u(
|
|
583
|
+
u(C);
|
|
583
584
|
return;
|
|
584
585
|
}
|
|
585
586
|
u({
|
|
@@ -599,7 +600,7 @@ function C(e) {
|
|
|
599
600
|
n
|
|
600
601
|
]), l === null || !l.canRender) return null;
|
|
601
602
|
let { applicationId: ee, authEpoch: te, prefill: d } = l;
|
|
602
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ b(Ke, {
|
|
603
604
|
...e,
|
|
604
605
|
initialApplicationId: ee,
|
|
605
606
|
initialBoundAuthEpoch: te,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js
|
|
2
2
|
function e(e) {
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
return i;
|
|
3
|
+
let t = (e?.disclosures ?? []).flatMap((e) => e.documents), n = /* @__PURE__ */ new Set(), r = [];
|
|
4
|
+
for (let e of t) n.has(e.url) || (n.add(e.url), r.push(e));
|
|
5
|
+
return r;
|
|
7
6
|
}
|
|
8
7
|
//#endregion
|
|
9
8
|
export { e as collectDisclosureDocuments };
|
|
@@ -36,8 +36,9 @@ import { usePaymentTermsQuery as $r } from "./lib/reference-data/usePaymentTerms
|
|
|
36
36
|
import { useAllOrganizationRolesQuery as ei } from "./lib/role/useAllOrganizationRolesQuery.js";
|
|
37
37
|
import { useRolePermissionsQueries as ti } from "./lib/role/useRolePermissionsQueries.js";
|
|
38
38
|
import { useAllOrganizationUsersQuery as ni } from "./lib/user/useAllOrganizationUsersQuery.js";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
39
|
+
import { personDisclosure as ri } from "./lib/disclosures/personDisclosure.js";
|
|
40
|
+
import { useAcceptWidgetDisclosures as ii } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
41
|
+
import { useDisclosuresQuery as ai } from "./lib/disclosures/useDisclosuresQuery.js";
|
|
42
|
+
import { OnboardingSuppressionReason as oi } from "./lib/onboardingSuppressionReason.js";
|
|
43
|
+
import { useOrganizationOnboardingSuppression as si } from "./lib/useOrganizationOnboardingSuppression.js";
|
|
44
|
+
export { Dr as EmbedApiProvider, oi as OnboardingSuppressionReason, Vr as Scope, Le as activateCreditCardMutation, Re as activateDebitCardMutation, hr as applicationStatusInvalidationKey, gr as applicationStatusQueryOptions, Er as attachTransportInterceptors, pr as authEpochPlaceholder, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, vr as cancelAllClients, wr as cloneEmbeddedClient, ze as connectExternalBankAccountMutation, Be as createAchMoneyMovementMutation, Ve as createApplicationMutation, He as createBankAccountMutation, Ue as createBookTransferMutation, We as createCheckDepositMutation, _r as createClientSecretInstaller, Ge as createDebitCardMutation, r as createDepartment, Tr as createEmbeddedClient, i as createLocation, a as createUser, Ke as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, qe as deleteApprovalPoliciesIdMutation, Je as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, Ye as deleteLedgerAccountsIdMutation, d as deleteMeasureUnitsId, f as deletePayablesId, p as deletePayablesIdFile, m as deleteProductsId, Xe as deleteReceiptsIdMutation, h as deleteReceivablesId, Ze as disableUserMutation, g as downloadBankAccountTransactions, jr as fetchWidgetInit, Ur as getAllPagesNextPageParam, Wr as getAllPagesNextPaginationTokenParam, Qe as getAnalyticsPayablesOptions, $e as getAnalyticsPayablesQueryKey, et as getAnalyticsReceiptsOptions, tt as getAnalyticsReceiptsQueryKey, nt as getAnalyticsReceivablesOptions, rt as getAnalyticsReceivablesQueryKey, it as getAnalyticsTransactionsOptions, at as getAnalyticsTransactionsQueryKey, _ as getApplicationStatus, v as getApprovalPolicies, ot as getApprovalPoliciesOptions, st as getApprovalPoliciesQueryKey, y as getApprovalRequests, ct as getApprovalRequestsOptions, lt as getApprovalRequestsQueryKey, b as getBankAccountAccess, ut as getBankAccountAccessQueryKey, dt as getBankAccountApplicationOptions, ft as getBankAccountOptions, pt as getBankAccountQueryKey, x as getBankAccountStatement, mt as getBankAccountStatementsOptions, ht as getBankAccountTransactionsOptions, gt as getBankAccountTransactionsQueryKey, _t as getBankAccountTransfersOptions, vt as getBankAccountTransfersQueryKey, yt as getBankAccountsQueryKey, S as getCounterparts, bt as getCounterpartsIdAddressesOptions, xt as getCounterpartsIdAddressesQueryKey, St as getCounterpartsIdBankAccountsOptions, Ct as getCounterpartsIdBankAccountsQueryKey, wt as getCounterpartsIdOptions, Tt as getCounterpartsIdQueryKey, Et as getCounterpartsOptions, Dt as getCounterpartsQueryKey, Ot as getCreditCardByIdOptions, kt as getCreditCardByIdQueryKey, At as getCreditCardsOptions, jt as getCreditCardsQueryKey, Mt as getDebitCardByIdOptions, Nt as getDebitCardByIdQueryKey, Pt as getDebitCardCredentialsOptions, Ft as getDebitCardsOptions, It as getDebitCardsQueryKey, C as getDepartment, Lt as getDepartmentOptions, Rt as getDepartmentQueryKey, w as getDepositableBankAccounts, zt as getDepositableBankAccountsOptions, Bt as getDocumentsIdNextNumbersOptions, Vt as getDocumentsIdNextNumbersQueryKey, Ht as getEntitiesIdSettingsOptions, Ut as getEntitiesIdSettingsQueryKey, Wt as getEntityUsersMyEntityOptions, Gt as getEntityUsersMyEntityQueryKey, Kt as getEntityUsersOptions, T as getExternalBankAccountAccess, qt as getExternalBankAccountAccessQueryKey, Jt as getExternalBankAccountsOptions, Yt as getExternalBankAccountsQueryKey, Xt as getLedgerAccountsQueryKey, E as getLocation, Zt as getLocationOptions, Qt as getLocationQueryKey, $t as getMeasureUnitsOptions, en as getMeasureUnitsQueryKey, tn as getOrganizationOptions, D as getPayables, O as getPayablesId, k as getPayablesIdHistory, nn as getPayablesIdHistoryOptions, rn as getPayablesIdHistoryQueryKey, A as getPayablesIdLineItems, an as getPayablesIdLineItemsOptions, on as getPayablesIdLineItemsQueryKey, sn as getPayablesIdOptions, cn as getPayablesIdQueryKey, ln as getPayablesIdSuggestionsOptions, un as getPayablesOptions, dn as getPayablesQueryKey, j as getPaymentRecords, fn as getPaymentRecordsOptions, pn as getPaymentRecordsQueryKey, M as getProducts, mn as getProductsIdOptions, hn as getProductsIdQueryKey, gn as getProductsOptions, _n as getProductsQueryKey, N as getReceipts, vn as getReceiptsIdQueryKey, yn as getReceiptsOptions, bn as getReceiptsQueryKey, P as getReceivables, xn as getReceivablesIdHistoryOptions, Sn as getReceivablesIdHistoryQueryKey, Cn as getReceivablesIdMailsOptions, wn as getReceivablesIdMailsQueryKey, Tn as getReceivablesIdOptions, En as getReceivablesIdPdfLinkOptions, Dn as getReceivablesIdPdfLinkQueryKey, On as getReceivablesIdQueryKey, kn as getReceivablesOptions, An as getReceivablesQueryKey, jn as getTransactionsIdExpenseHistoryOptions, Mn as getTransactionsIdExpenseHistoryQueryKey, Nn as getTransactionsIdOptions, Pn as getTransactionsIdQueryKey, Fn as getTransactionsOptions, In as getTransactionsQueryKey, Ln as getTransactionsValidationsOptions, Rn as getTransactionsValidationsQueryKey, F as getUsers, zn as getUsersOptions, Bn as getUsersQueryKey, Vn as getVelocityControlsQueryKey, Hn as grantBankAccountAccessMutation, Un as grantExternalBankAccountAccessMutation, Mr as hasAnyScope, yr as invalidateAllClients, Gr as isAllPagesResolving, Fr as isApiConflictError, Ir as isApiForbiddenError, Lr as isApiNotFoundError, Rr as isApiUnprocessableError, Hr as isScope, Wn as linkExternalBankAccountMutation, I as listDepartments, Gn as listDepartmentsOptions, Kn as listDepartmentsQueryKey, L as listLocations, qn as listLocationsOptions, Jn as listLocationsQueryKey, R as listRoles, Yn as listRolesQueryKey, z as manageBankAccountAccess, B as manageDebitCardAccess, Xn as manageDebitCardAccessMutation, kr as optionalOrganizationHeaders, Ar as organizationHeaders, Zn as patchApprovalPoliciesIdMutation, V as patchCounterpartsId, H as patchCounterpartsIdAddressesId, U as patchCounterpartsIdBankAccountsId, W as patchEntitiesIdSettings, Qn as patchLedgerAccountsIdMutation, G as patchMeasureUnitsId, K as patchPayablesId, q as patchProductsId, $n as patchReceiptsIdMutation, J as patchReceivablesId, Y as patchTransactionsId, ri as personDisclosure, er as postApprovalPoliciesMutation, X as postApprovalRequestsIdApprove, Z as postApprovalRequestsIdReject, Q as postCounterparts, $ as postCounterpartsIdAddresses, ee as postCounterpartsIdBankAccounts, te as postCounterpartsIdBankAccountsIdMakeDefault, tr as postLedgerAccountsMutation, ne as postMeasureUnits, re as postPayables, ie as postPayablesIdApprovePaymentOperation, ae as postPayablesIdAttachFile, oe as postPayablesIdCancel, se as postPayablesIdDuplicatesIdConfirm, ce as postPayablesIdDuplicatesIdDismiss, le as postPayablesIdMarkAsPaid, ue as postPayablesIdReject, de as postPayablesIdReopen, fe as postPayablesIdSchedulePayment, pe as postPayablesIdSubmitForApproval, me as postPayablesIdValidate, he as postPayablesUploadFromFile, ge as postPaymentIntentsIdCancel, _e as postProducts, nr as postReceiptsUploadFromFileMutation, ve as postReceivables, ye as postReceivablesIdAccept, be as postReceivablesIdCancel, xe as postReceivablesIdClone, Se as postReceivablesIdDecline, Ce as postReceivablesIdIssue, we as postReceivablesIdMarkAsPaid, Te as postReceivablesIdMarkAsPartiallyPaid, Ee as postReceivablesIdMarkAsUncollectible, De as postReceivablesIdSend, Oe as postTransactionsIdApprove, ke as postTransactionsIdReject, Ae as postTransactionsIdReopen, je as postTransactionsIdSubmit, Me as putEntitiesIdLogo, Ne as putPayablesIdLineItems, rr as putTransactionsValidationsMutation, br as registerQueryClient, xr as removeInactiveFromAllClients, Sr as setAllClientsQueriesData, ir as setDebitCardLockStatusMutation, ar as submitApplicationMutation, or as unlinkExternalBankAccountMutation, Cr as unregisterQueryClient, sr as updateApplicationMutation, cr as updateBankAccountMutation, lr as updateDebitCardMutation, Pe as updateDepartment, ur as updateExternalBankAccountMutation, Fe as updateLocation, Ie as updateUser, ii as useAcceptWidgetDisclosures, qr as useAllBankAccountsQuery, Jr as useAllDebitCardsQuery, Yr as useAllExternalBankAccountsQuery, Zr as useAllLedgerAccountsQuery, Xr as useAllMerchantCategoryGroupsQuery, ei as useAllOrganizationRolesQuery, ni as useAllOrganizationUsersQuery, Kr as useAutoFetchNextPage, Nr as useCurrentUserQuery, ai as useDisclosuresQuery, Or as useEmbedApi, zr as useGetUserDataQuery, Qr as useLedgerAccountsQuery, Pr as useMailboxAddress, si as useOrganizationOnboardingSuppression, $r as usePaymentTermsQuery, ti as useRolePermissionsQueries, Br as useUpsertUserDataMutation, dr as validateExternalBankAccountMutation, fr as verifyDebitCardMutation, mr as withAuthEpoch };
|
|
@@ -4,36 +4,37 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { getDisclosures as e, postApiWidgetGatewayDisclosureAcceptance as t } from "../rest/sdk.gen.js";
|
|
6
6
|
import { useEmbedApi as n } from "../EmbedApiContext.js";
|
|
7
|
-
import {
|
|
7
|
+
import { personDisclosure as r } from "./personDisclosure.js";
|
|
8
|
+
import { useMutation as i } from "@tanstack/react-query";
|
|
8
9
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js
|
|
9
|
-
var
|
|
10
|
+
var a = class extends Error {
|
|
10
11
|
constructor() {
|
|
11
12
|
super("Displayed disclosure version is no longer in force"), this.name = "DisclosuresVersionChangedError";
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
let { client:
|
|
16
|
-
return
|
|
17
|
-
if (!
|
|
18
|
-
let { data:
|
|
19
|
-
client:
|
|
20
|
-
headers: { "X-Widget-Token":
|
|
21
|
-
...n &&
|
|
15
|
+
function o() {
|
|
16
|
+
let { client: o, widgetToken: s } = n();
|
|
17
|
+
return i({ mutationFn: async ({ invitationToken: n, userId: i, displayedVersion: c }) => {
|
|
18
|
+
if (!s) throw Error("Widget token is required to accept disclosures");
|
|
19
|
+
let { data: l } = await e({
|
|
20
|
+
client: o,
|
|
21
|
+
headers: { "X-Widget-Token": s },
|
|
22
|
+
...n && i ? { query: {
|
|
22
23
|
invitationToken: n,
|
|
23
|
-
userId:
|
|
24
|
+
userId: i
|
|
24
25
|
} } : {},
|
|
25
26
|
throwOnError: !0
|
|
26
27
|
});
|
|
27
|
-
if (!
|
|
28
|
-
if (
|
|
29
|
-
let { data:
|
|
30
|
-
client:
|
|
31
|
-
headers: { "X-Widget-Token":
|
|
32
|
-
body: { version:
|
|
28
|
+
if (!l) throw Error("Unexpected disclosures response from widget gateway");
|
|
29
|
+
if ((r(l)?.disclosureId ?? null) !== c) throw new a();
|
|
30
|
+
let { data: u } = await t({
|
|
31
|
+
client: o,
|
|
32
|
+
headers: { "X-Widget-Token": s },
|
|
33
|
+
body: { version: c },
|
|
33
34
|
throwOnError: !0
|
|
34
35
|
});
|
|
35
|
-
return
|
|
36
|
+
return u;
|
|
36
37
|
} });
|
|
37
38
|
}
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { a as DisclosuresVersionChangedError, o as useAcceptWidgetDisclosures };
|
package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js
CHANGED
|
@@ -129,11 +129,27 @@ var p = {
|
|
|
129
129
|
accepted: !0,
|
|
130
130
|
documents: [],
|
|
131
131
|
requirement: "NOT_REQUIRED",
|
|
132
|
-
version: null
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
version: null,
|
|
133
|
+
disclosures: []
|
|
134
|
+
};
|
|
135
|
+
function m({ disclosureId: e, documents: t, accepted: n = !1, requirement: r = "REQUIRED" }) {
|
|
136
|
+
return {
|
|
137
|
+
accepted: n,
|
|
138
|
+
requirement: r,
|
|
139
|
+
version: e,
|
|
140
|
+
documents: t,
|
|
141
|
+
disclosures: [{
|
|
142
|
+
acceptanceScope: "PERSON",
|
|
143
|
+
disclosureId: e,
|
|
144
|
+
documents: t,
|
|
145
|
+
accepted: n,
|
|
146
|
+
canAccept: !0,
|
|
147
|
+
standing: "CLEAR"
|
|
148
|
+
}]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
var h = m({
|
|
152
|
+
disclosureId: "2026-02-01",
|
|
137
153
|
documents: [
|
|
138
154
|
{
|
|
139
155
|
title: "Terms of Use",
|
|
@@ -152,12 +168,12 @@ var p = {
|
|
|
152
168
|
url: "https://example.test/patriot-act.pdf"
|
|
153
169
|
}
|
|
154
170
|
]
|
|
155
|
-
},
|
|
171
|
+
}), g = {
|
|
156
172
|
disclosureRequirement: "REQUIRED",
|
|
157
173
|
status: "ACTIVE"
|
|
158
174
|
};
|
|
159
175
|
a.lastFourDigits, r.id;
|
|
160
|
-
var
|
|
176
|
+
var _ = {
|
|
161
177
|
id: "00000000-0000-4000-8000-000000000040",
|
|
162
178
|
created_at: "2026-01-15T09:00:00.000Z",
|
|
163
179
|
updated_at: "2026-01-15T09:00:00.000Z",
|
|
@@ -168,7 +184,7 @@ var g = {
|
|
|
168
184
|
legal_name: "Rivermill Supply Co.",
|
|
169
185
|
email: "ap@rivermill.example"
|
|
170
186
|
}
|
|
171
|
-
},
|
|
187
|
+
}, v = {
|
|
172
188
|
id: "00000000-0000-4000-8000-000000000041",
|
|
173
189
|
type: "invoice",
|
|
174
190
|
document_id: "INV-1042",
|
|
@@ -182,9 +198,9 @@ var g = {
|
|
|
182
198
|
total_amount_with_credit_notes: 128500,
|
|
183
199
|
total_tax_amount: 0,
|
|
184
200
|
due_date: "2026-03-15",
|
|
185
|
-
counterpart_id:
|
|
201
|
+
counterpart_id: _.id,
|
|
186
202
|
counterpart_type: "organization",
|
|
187
|
-
counterpart_name:
|
|
203
|
+
counterpart_name: _.organization.legal_name,
|
|
188
204
|
bank_account_id: u.id,
|
|
189
205
|
bank_account_type: "INTERNAL",
|
|
190
206
|
entity: {
|
|
@@ -202,4 +218,4 @@ var g = {
|
|
|
202
218
|
related_documents: {}
|
|
203
219
|
};
|
|
204
220
|
//#endregion
|
|
205
|
-
export { d as AN_EXTERNAL_BANK_ACCOUNT, n as AN_ORGANIZATION, r as AN_ORGANIZATION_ROLE,
|
|
221
|
+
export { d as AN_EXTERNAL_BANK_ACCOUNT, n as AN_ORGANIZATION, r as AN_ORGANIZATION_ROLE, v as AN_OUTSTANDING_INVOICE, u as A_BANK_ACCOUNT, f as A_BANK_ACCOUNT_TRANSFER, a as A_CREDIT_CARD, _ as A_CUSTOMER_COUNTERPART, s as A_DEBIT_CARD, c as A_DEBIT_CARD_CREDENTIALS, h as A_DISCLOSURES_SET, g as A_DISCLOSURE_ACCEPTANCE, o as A_PENDING_CREDIT_CARD, l as A_PENDING_DEBIT_CARD, i as A_WIDGET_INIT, p as NO_DISCLOSURES_OWED, m as aPersonDisclosuresRead };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.200", n = "2d0cb8a498d77268769d522f5dfe8e9a53e17b39", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|