@tesouro/embedded-components-react 0.5.232 → 0.5.235
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 +16 -14
- package/dist/index.d.ts +66 -15
- package/dist/lib/BankAccountOnboardingWidget.d.ts +39 -1
- package/dist/lib/ReceivablesWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +65 -15
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +15 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +441 -409
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +26 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +35 -35
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +6 -3
- 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/index16.js +123 -92
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +12 -5
- package/package.json +1 -1
|
@@ -2,78 +2,78 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { getStateOptions as
|
|
7
|
-
import { extractApiErrorMessage as
|
|
8
|
-
import { useEmbedApi as
|
|
9
|
-
import { personDisclosure as
|
|
10
|
-
import { useAcceptWidgetDisclosures as
|
|
11
|
-
import { useDisclosuresQuery as
|
|
5
|
+
import { Button as e, Dialog as t, DialogContent as n, DialogTitle as r, cn as i, toast as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { getStateOptions as o } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
|
+
import { extractApiErrorMessage as s } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
8
|
+
import { useEmbedApi as c } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
|
+
import { personDisclosure as l } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
10
|
+
import { useAcceptWidgetDisclosures as u } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
11
|
+
import { useDisclosuresQuery as ee } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
12
12
|
import { OnboardingSuppressionReason as d } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
13
|
-
import { useOrganizationOnboardingSuppression as
|
|
14
|
-
import { useOrganizationApplicationStatus as
|
|
13
|
+
import { useOrganizationOnboardingSuppression as f } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
14
|
+
import { useOrganizationApplicationStatus as te } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
|
|
15
15
|
import "../../../shared/data-access/dist/index.js";
|
|
16
|
-
import { EmbeddedToaster as
|
|
17
|
-
import { OnboardingShell as
|
|
16
|
+
import { EmbeddedToaster as ne } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
17
|
+
import { OnboardingShell as re } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
|
|
18
18
|
import "../../../shared/ui/dist/index.js";
|
|
19
|
-
import { useAnalyticsTrack as
|
|
20
|
-
import { WidgetProvider as
|
|
21
|
-
import { useRefetchWidget as
|
|
22
|
-
import { getNaicsOptions as
|
|
23
|
-
import { deniedNoticeExpiresAt as
|
|
19
|
+
import { useAnalyticsTrack as ie } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
20
|
+
import { WidgetProvider as ae } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
21
|
+
import { useRefetchWidget as oe, useWidgetConfig as se, useWidgetInitStaleForToken as ce, useWidgetLoading as le } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
22
|
+
import { getNaicsOptions as ue } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
23
|
+
import { deniedNoticeExpiresAt as de, selectBankAccountApplication as fe } from "../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
24
24
|
import "../../../shared/feature/dist/index.js";
|
|
25
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
26
|
-
import { interpolateBankName as
|
|
27
|
-
import { ApplicationStatusCard as
|
|
28
|
-
import { ResultStep as
|
|
29
|
-
import { UnsavedApplicationDialog as
|
|
30
|
-
import { DeleteApplicationDialog as
|
|
25
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as pe } from "../../ui/dist/index5.js";
|
|
26
|
+
import { interpolateBankName as me } from "../../ui/dist/index7.js";
|
|
27
|
+
import { ApplicationStatusCard as he } from "../../ui/dist/index10.js";
|
|
28
|
+
import { ResultStep as ge } from "../../ui/dist/index14.js";
|
|
29
|
+
import { UnsavedApplicationDialog as _e } from "../../ui/dist/index28.js";
|
|
30
|
+
import { DeleteApplicationDialog as ve } from "../../ui/dist/index30.js";
|
|
31
31
|
import "../../ui/dist/index.js";
|
|
32
|
-
import { DEFAULT_LABELS as
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { OnboardingAnalyticsEvent as
|
|
44
|
-
import { withoutResumeOnlyOwnerFields as
|
|
45
|
-
import { ApplicationClientSecretProvider as
|
|
46
|
-
import { useCreateApplication as
|
|
47
|
-
import { useUpdateApplication as
|
|
48
|
-
import { useSubmitApplication as
|
|
49
|
-
import { useDeleteApplication as
|
|
50
|
-
import { usePollApplicationCompletion as
|
|
51
|
-
import { useResumableBankAccountApplication as
|
|
52
|
-
import { useStartedBankAccountApplication as
|
|
32
|
+
import { DEFAULT_LABELS as ye } from "./index22.js";
|
|
33
|
+
import { OnboardingApplicationView as be, applicationStatusNoticeFor as xe, hiddenViewReason as Se, isNoticeView as Ce, mergeApplicationStatusLabels as we, onboardingApplicationViewFor as Te } from "./index23.js";
|
|
34
|
+
import { identifierLast4 as Ee, isIdentifierEnteredOrStored as p } from "./index7.js";
|
|
35
|
+
import { bankAccountOnboardingTestIds as m } from "./index12.js";
|
|
36
|
+
import { BusinessDetailsStep as De } from "./index13.js";
|
|
37
|
+
import { PersonalDetailsStep as Oe } from "./index15.js";
|
|
38
|
+
import { valuesKey as h } from "./index17.js";
|
|
39
|
+
import { AdditionalOwnersStep as ke } from "./index18.js";
|
|
40
|
+
import { buildCreateApplicationBody as Ae, buildUpdateApplicationBody as je } from "./index19.js";
|
|
41
|
+
import { buildOnboardingPrefill as Me } from "./index20.js";
|
|
42
|
+
import { acceptDraftedValues as Ne, asCreateBody as Pe, buildDraftApplicationBody as Fe, draftOwners as Ie, withApplicantWorkEmail as Le } from "./index21.js";
|
|
43
|
+
import { OnboardingAnalyticsEvent as Re, WIDGET_NAME as ze } from "./index24.js";
|
|
44
|
+
import { withoutResumeOnlyOwnerFields as Be, withoutStoredIdentifierMarkers as Ve } from "./index25.js";
|
|
45
|
+
import { ApplicationClientSecretProvider as He, useApplicationClientSecret as Ue } from "../../data-access/dist/index3.js";
|
|
46
|
+
import { useCreateApplication as We } from "../../data-access/dist/index5.js";
|
|
47
|
+
import { useUpdateApplication as Ge } from "../../data-access/dist/index6.js";
|
|
48
|
+
import { useSubmitApplication as Ke } from "../../data-access/dist/index7.js";
|
|
49
|
+
import { useDeleteApplication as qe } from "../../data-access/dist/index8.js";
|
|
50
|
+
import { usePollApplicationCompletion as Je } from "../../data-access/dist/index9.js";
|
|
51
|
+
import { useResumableBankAccountApplication as Ye } from "../../data-access/dist/index11.js";
|
|
52
|
+
import { useStartedBankAccountApplication as Xe } from "../../data-access/dist/index12.js";
|
|
53
53
|
import "../../data-access/dist/index.js";
|
|
54
|
-
import { useCallback as
|
|
55
|
-
import { Fragment as
|
|
54
|
+
import { useCallback as Ze, useEffect as g, useMemo as _, useReducer as Qe, useRef as v, useState as y } from "react";
|
|
55
|
+
import { Fragment as $e, jsx as b, jsxs as et } from "react/jsx-runtime";
|
|
56
56
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js
|
|
57
|
-
var
|
|
58
|
-
function
|
|
57
|
+
var tt = 2 ** 31 - 1, nt = "DRAFT", rt = [], x = (e) => p(e, void 0);
|
|
58
|
+
function it(e) {
|
|
59
59
|
return {
|
|
60
60
|
...e,
|
|
61
61
|
taxId: "",
|
|
62
|
-
taxIdOnFileLast4:
|
|
62
|
+
taxIdOnFileLast4: Ee(e.taxId),
|
|
63
63
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function at(e) {
|
|
67
67
|
return {
|
|
68
68
|
...e,
|
|
69
69
|
ssn: "",
|
|
70
|
-
ssnOnFileLast4:
|
|
70
|
+
ssnOnFileLast4: Ee(e.ssn)
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ot(e, t) {
|
|
74
74
|
return t ? t.index === null ? [...e, t.owner] : e.map((e, n) => n === t.index ? t.owner : e) : e;
|
|
75
75
|
}
|
|
76
|
-
var
|
|
76
|
+
var st = {
|
|
77
77
|
companyLegalName: "",
|
|
78
78
|
companyDbaName: "",
|
|
79
79
|
businessAddress: "",
|
|
@@ -87,7 +87,7 @@ var it = {
|
|
|
87
87
|
naicsCode: "",
|
|
88
88
|
isAuthorized: null,
|
|
89
89
|
isCheckboxChecked: !1
|
|
90
|
-
},
|
|
90
|
+
}, ct = {
|
|
91
91
|
firstName: "",
|
|
92
92
|
lastName: "",
|
|
93
93
|
dateOfBirth: void 0,
|
|
@@ -101,7 +101,7 @@ var it = {
|
|
|
101
101
|
ownsOver25Percent: null,
|
|
102
102
|
ownershipPercentage: null
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function lt(e, t) {
|
|
105
105
|
if (e === 0) return {
|
|
106
106
|
title: t.businessReviewTitle,
|
|
107
107
|
subtitle: t.businessReviewSubtitle
|
|
@@ -111,7 +111,7 @@ function ot(e, t) {
|
|
|
111
111
|
subtitle: t.personalReviewSubtitle
|
|
112
112
|
};
|
|
113
113
|
let n = {
|
|
114
|
-
...
|
|
114
|
+
...pe,
|
|
115
115
|
...t.additionalOwners
|
|
116
116
|
};
|
|
117
117
|
return {
|
|
@@ -119,61 +119,61 @@ function ot(e, t) {
|
|
|
119
119
|
subtitle: n.subheading
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
let
|
|
122
|
+
function ut({ onEmbeddedOnboardingCompletedSuccessfully: ae, onNavigateToDashboard: pe, labels: p, initialBusinessDetails: Me, initialPersonalDetails: ze, initialAdditionalOwners: Ve, initialApplicationId: He = null, initialBoundAuthEpoch: Ye, onEditableDraftChange: Xe, onApplicationDeleted: nt, onNoticeReplacedByForm: ut, bankLogoSrc: dt, disclosureLinks: ft, open: pt, defaultOpen: mt, onOpenChange: ht, isFullScreenInline: S = !1, showApplicationStatusRefresh: gt = !1, onResultPhaseChange: _t }) {
|
|
123
|
+
let C = ie(), { authEpoch: vt } = c();
|
|
124
|
+
g(() => {
|
|
125
|
+
C(Re.Mounted);
|
|
126
|
+
}, [C]);
|
|
127
|
+
let w = {
|
|
128
|
+
...ye,
|
|
128
129
|
...p,
|
|
129
|
-
...m,
|
|
130
130
|
stepIndicator: {
|
|
131
|
-
...
|
|
132
|
-
...
|
|
131
|
+
...ye.stepIndicator,
|
|
132
|
+
...p?.stepIndicator
|
|
133
133
|
},
|
|
134
|
-
businessDetails:
|
|
135
|
-
personalDetails:
|
|
136
|
-
additionalOwners:
|
|
134
|
+
businessDetails: p?.businessDetails ?? {},
|
|
135
|
+
personalDetails: p?.personalDetails ?? {},
|
|
136
|
+
additionalOwners: p?.additionalOwners ?? {},
|
|
137
137
|
result: {
|
|
138
|
-
...
|
|
139
|
-
...
|
|
138
|
+
...ye.result,
|
|
139
|
+
...p?.result
|
|
140
140
|
},
|
|
141
|
-
unsavedApplicationDialog:
|
|
142
|
-
deleteApplicationDialog:
|
|
143
|
-
applicationStatus:
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
...
|
|
150
|
-
...
|
|
151
|
-
})), [
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
})), [
|
|
155
|
-
business:
|
|
156
|
-
personal:
|
|
157
|
-
owners:
|
|
158
|
-
})), [
|
|
159
|
-
|
|
160
|
-
if (!
|
|
141
|
+
unsavedApplicationDialog: p?.unsavedApplicationDialog ?? {},
|
|
142
|
+
deleteApplicationDialog: p?.deleteApplicationDialog ?? {},
|
|
143
|
+
applicationStatus: we(p?.applicationStatus)
|
|
144
|
+
}, T = se().initResponse, { termsHref: yt, privacyHref: bt, electronicCommunicationHref: xt, patriotActHref: St } = ft ?? {}, Ct = pt === void 0, [wt, Tt] = y(() => mt ?? !1), E = Ct ? wt : pt, Et = mt ?? !1, D = Ze((e) => {
|
|
145
|
+
Ct && Tt(e), ht?.(e);
|
|
146
|
+
}, [ht, Ct]), Dt = Ze(() => {
|
|
147
|
+
ae();
|
|
148
|
+
}, [ae]), Ot = oe(), [O, kt] = y(0), [k, At] = y(() => ({
|
|
149
|
+
...st,
|
|
150
|
+
...Me
|
|
151
|
+
})), [A, jt] = y(() => ({
|
|
152
|
+
...ct,
|
|
153
|
+
...ze
|
|
154
|
+
})), [j, M] = y(() => Ve ?? []), [N, Mt] = y(() => ({
|
|
155
|
+
business: k,
|
|
156
|
+
personal: A,
|
|
157
|
+
owners: j
|
|
158
|
+
})), [Nt, Pt] = y(null);
|
|
159
|
+
g(() => {
|
|
160
|
+
if (!Nt) return;
|
|
161
161
|
let e = {
|
|
162
|
-
business:
|
|
163
|
-
personal:
|
|
164
|
-
owners:
|
|
162
|
+
business: k,
|
|
163
|
+
personal: A,
|
|
164
|
+
owners: j
|
|
165
165
|
};
|
|
166
|
-
|
|
166
|
+
Mt((t) => Nt.next(e, t)), Pt(null);
|
|
167
167
|
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
Nt,
|
|
169
|
+
k,
|
|
170
|
+
A,
|
|
171
|
+
j
|
|
172
172
|
]);
|
|
173
|
-
let
|
|
173
|
+
let Ft = (e, { owners: t = "none" } = {}) => Pt({ next: (n, r) => ({
|
|
174
174
|
business: e.includes("business") ? n.business : r.business,
|
|
175
175
|
personal: e.includes("personal") ? n.personal : r.personal,
|
|
176
|
-
owners: t === "cleared" ?
|
|
176
|
+
owners: t === "cleared" ? rt : t === "restored" ? Ne({
|
|
177
177
|
current: n,
|
|
178
178
|
saved: r,
|
|
179
179
|
dirty: {
|
|
@@ -183,409 +183,438 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: ie, onNavigateToDashboa
|
|
|
183
183
|
},
|
|
184
184
|
ownersWrite: "list"
|
|
185
185
|
}).owners : e.includes("owners") ? n.owners : r.owners
|
|
186
|
-
}) }), [
|
|
186
|
+
}) }), [It, Lt] = y(null), [Rt, zt] = y(0), [Bt, Vt] = y(!1), [Ht, Ut] = y(!1), [P, Wt] = y(null), [F, Gt] = y(null), [Kt, qt] = y(null), [I, Jt] = y(He), [Yt, Xt] = y(!1), [L, Zt] = y({}), Qt = (e) => Zt((t) => ({
|
|
187
187
|
...t,
|
|
188
188
|
...e.taxId && x(e.taxId) && e.taxIdStructure ? {
|
|
189
189
|
taxId: e.taxId,
|
|
190
190
|
taxIdStructure: e.taxIdStructure
|
|
191
191
|
} : {},
|
|
192
192
|
...e.ssn && x(e.ssn) ? { ssn: e.ssn } : {}
|
|
193
|
-
})),
|
|
194
|
-
let { taxId: t, taxIdStructure: n } =
|
|
195
|
-
|
|
193
|
+
})), $t = (e) => {
|
|
194
|
+
let { taxId: t, taxIdStructure: n } = L, r = t !== void 0 && n !== void 0 && e.companyStructure !== k.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
|
|
195
|
+
At(r ? {
|
|
196
196
|
...e,
|
|
197
197
|
taxId: e.taxId === t ? "" : e.taxId,
|
|
198
|
-
taxIdOnFileLast4:
|
|
198
|
+
taxIdOnFileLast4: Ee(t),
|
|
199
199
|
taxIdOnFileStructure: n
|
|
200
200
|
} : e);
|
|
201
|
-
}, [
|
|
202
|
-
!
|
|
203
|
-
let [
|
|
204
|
-
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
let e =
|
|
201
|
+
}, [en, tn] = y(Ye ?? vt), [nn, R] = y(null), [rn, an] = y(!1), [on, sn] = y(!1);
|
|
202
|
+
!S && !E && on && sn(!1);
|
|
203
|
+
let [cn, ln] = y(!1), [un, dn] = y(null), fn = We(), z = Ge(), pn = Ke(), mn = qe(), hn = Je(), { setClientSecret: gn } = Ue(), { data: _n, refetch: vn } = ee(), { mutateAsync: yn } = u(), bn = f(), B = te(), xn = ce(), [Sn, Cn] = Qe((e) => e + 1, 0), wn = _(() => fe(B.applications), [B.applications]), Tn = v(null);
|
|
204
|
+
B.isResolved && (Tn.current = { application: wn });
|
|
205
|
+
let V = B.isResolved ? wn : Tn.current?.application ?? null, En = de(V), H = Te(V), Dn = B.isResolved || Tn.current !== null && H === be.Form;
|
|
206
|
+
g(() => {
|
|
207
|
+
if (En === null) return;
|
|
208
|
+
let e = En - Date.now();
|
|
209
209
|
if (e < 0) return;
|
|
210
|
-
let t = setTimeout(
|
|
210
|
+
let t = setTimeout(Cn, Math.min(e + 1, tt));
|
|
211
211
|
return () => clearTimeout(t);
|
|
212
|
-
}, [
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
}, [En, Sn]);
|
|
213
|
+
let On = v(null);
|
|
214
|
+
g(() => () => On.current?.abort(), []);
|
|
215
|
+
let kn = _(() => ue(w.businessDetails.naicsTitles), [w.businessDetails.naicsTitles]), An = _(() => o(w.businessDetails.stateTitles), [w.businessDetails.stateTitles]), jn = _(() => o(w.personalDetails.stateTitles), [w.personalDetails.stateTitles]), Mn = _(() => o(w.additionalOwners.stateTitles), [w.additionalOwners.stateTitles]), U = cn || un !== null, Nn = v(_t);
|
|
216
|
+
Nn.current = _t, g(() => {
|
|
217
|
+
if (U) return Nn.current?.(!0), () => Nn.current?.(!1);
|
|
218
|
+
}, [U]);
|
|
219
|
+
let Pn = T?.status === "ACTIVE" || T?.status === "INACTIVE", Fn = T?.status === "INVITED", In = Pn || Fn, W = bn.isResolved && Dn, Ln = T && !U && !In && W && Ce(H) ? H : null, G = !!T && !U && Ln === null && (In || W && (bn.isSuppressed || H === be.Hidden)), K = G ? Pn ? d.UserAlreadyOnboarded : Fn ? d.UserInvitedToOrganization : H === be.Hidden ? Se(V) : bn.reason ?? Se(V) : null, Rn = !!T && W && !U, [zn, Bn] = y(!1), Vn = zn && G && !In && K !== d.OrganizationApplicationDenialExpired, q = Ln ?? (Vn ? "unavailable" : null);
|
|
220
|
+
Rn && zn !== (q !== null) && Bn(q !== null);
|
|
221
|
+
let J = Vn && K === d.OrganizationApplicationComplete, Hn = le(), [Y, Un] = y("idle"), [Wn, Gn] = y(!1);
|
|
222
|
+
Rn && J !== Wn && (Gn(J), J && Un("requested")), Y === "requested" && Hn && Un("inFlight"), Y === "inFlight" && !Hn && Un("idle");
|
|
223
|
+
let Kn = J && Y !== "idle";
|
|
224
|
+
g(() => {
|
|
225
|
+
G && K && (C(Re.Suppressed, { reason: K }), console.info(`[onboarding] not shown: ${K}`));
|
|
218
226
|
}, [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
G,
|
|
228
|
+
K,
|
|
229
|
+
C
|
|
222
230
|
]);
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}, [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
let qn = xn || !(S || E) ? null : Ln;
|
|
232
|
+
g(() => {
|
|
233
|
+
qn && C(Re.ApplicationStatusShown, { view: qn });
|
|
234
|
+
}, [qn, C]);
|
|
235
|
+
let Jn = v(q), Yn = v(ut);
|
|
236
|
+
Yn.current = ut;
|
|
237
|
+
let Xn = v(Ot);
|
|
238
|
+
Xn.current = Ot, g(() => {
|
|
239
|
+
if (!W || U) return;
|
|
240
|
+
let e = Jn.current !== null;
|
|
241
|
+
Jn.current = q, e && q === null && H === be.Form && Yn.current?.();
|
|
242
|
+
}, [
|
|
243
|
+
H,
|
|
244
|
+
U,
|
|
245
|
+
W,
|
|
246
|
+
q
|
|
247
|
+
]), g(() => {
|
|
248
|
+
Y === "requested" && Xn.current();
|
|
249
|
+
}, [Y]), g(() => {
|
|
250
|
+
Xe?.(U || I === null ? null : {
|
|
251
|
+
applicationId: I,
|
|
252
|
+
authEpoch: en
|
|
230
253
|
});
|
|
231
254
|
}, [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
255
|
+
Xe,
|
|
256
|
+
U,
|
|
257
|
+
I,
|
|
258
|
+
en
|
|
236
259
|
]);
|
|
237
|
-
let
|
|
238
|
-
if (
|
|
239
|
-
if (!
|
|
240
|
-
if (
|
|
241
|
-
if (
|
|
242
|
-
if (
|
|
243
|
-
let
|
|
244
|
-
...
|
|
245
|
-
className:
|
|
260
|
+
let Zn = v(vt);
|
|
261
|
+
if (Zn.current = vt, !T) return null;
|
|
262
|
+
if (!U) {
|
|
263
|
+
if (G && !q || Kn || !W) return null;
|
|
264
|
+
if (q) {
|
|
265
|
+
if (xn) return null;
|
|
266
|
+
let a = xe(q, V, T.bankName?.trim() || w.fallbackBankName, w.applicationStatus), o = /* @__PURE__ */ b(he, {
|
|
267
|
+
...a,
|
|
268
|
+
className: i("ttw:max-w-2xl", !S && "ttw:pr-12"),
|
|
246
269
|
testIds: {
|
|
247
|
-
root:
|
|
248
|
-
chip:
|
|
249
|
-
}
|
|
270
|
+
root: m.statusCard,
|
|
271
|
+
chip: m.statusCardChip
|
|
272
|
+
},
|
|
273
|
+
action: gt ? /* @__PURE__ */ b(e, {
|
|
274
|
+
variant: "outline",
|
|
275
|
+
onClick: J ? () => Un("requested") : bn.refetch,
|
|
276
|
+
"data-testid": m.statusCardCheckAgain,
|
|
277
|
+
children: w.applicationStatus.checkAgain
|
|
278
|
+
}) : void 0
|
|
250
279
|
});
|
|
251
|
-
return
|
|
280
|
+
return S ? /* @__PURE__ */ b("div", {
|
|
252
281
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
|
|
253
|
-
children:
|
|
254
|
-
}) : /* @__PURE__ */ b(
|
|
255
|
-
open:
|
|
256
|
-
onOpenChange:
|
|
257
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: o
|
|
283
|
+
}) : /* @__PURE__ */ b(t, {
|
|
284
|
+
open: E,
|
|
285
|
+
onOpenChange: D,
|
|
286
|
+
children: /* @__PURE__ */ et(n, {
|
|
258
287
|
showCloseButton: !0,
|
|
259
|
-
closeButtonTestId:
|
|
260
|
-
labels: { close:
|
|
288
|
+
closeButtonTestId: m.statusCardClose,
|
|
289
|
+
labels: { close: w.applicationStatus.close },
|
|
261
290
|
className: "ttw:max-h-[90vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:gap-0 ttw:overflow-y-auto ttw:rounded-2xl ttw:border-0 ttw:p-0",
|
|
262
|
-
children: [/* @__PURE__ */ b(
|
|
291
|
+
children: [/* @__PURE__ */ b(r, {
|
|
263
292
|
className: "ttw:sr-only",
|
|
264
|
-
children:
|
|
265
|
-
}),
|
|
293
|
+
children: w.modalTitle
|
|
294
|
+
}), o]
|
|
266
295
|
})
|
|
267
296
|
});
|
|
268
297
|
}
|
|
269
298
|
}
|
|
270
|
-
let X =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
],
|
|
275
|
-
|
|
299
|
+
let X = P?.companyStructure === "SOLE_PROPRIETORSHIP", Qn = [
|
|
300
|
+
w.stepIndicator.business,
|
|
301
|
+
w.stepIndicator.personal,
|
|
302
|
+
w.stepIndicator.ownership
|
|
303
|
+
], $n = O === 0 ? P : O === 1 ? F : O === 2 ? Kt : null, Z = fn.isPending || z.isPending || pn.isPending || mn.isPending || cn, er = () => {
|
|
304
|
+
R(null), kt((e) => e === 0 ? 0 : e - 1);
|
|
276
305
|
}, Q = {
|
|
277
|
-
business:
|
|
278
|
-
personal:
|
|
279
|
-
owners:
|
|
280
|
-
},
|
|
281
|
-
business: (e) =>
|
|
282
|
-
personal: (e) =>
|
|
283
|
-
owners: (e) => e.map((e) => e.id && x(e.ssn) ?
|
|
284
|
-
},
|
|
306
|
+
business: h(k) !== h(N.business),
|
|
307
|
+
personal: h(A) !== h(N.personal),
|
|
308
|
+
owners: h(k.companyStructure === "SOLE_PROPRIETORSHIP" ? rt : ot(j, It)) !== h(N.owners)
|
|
309
|
+
}, tr = Q.business || Q.personal || Q.owners, $ = {
|
|
310
|
+
business: (e) => L.taxId && e.taxId === L.taxId ? it(e) : e,
|
|
311
|
+
personal: (e) => L.ssn && e.ssn === L.ssn ? at(e) : e,
|
|
312
|
+
owners: (e) => e.map((e) => e.id && x(e.ssn) ? at(e) : e)
|
|
313
|
+
}, nr = () => Mt((e) => ({
|
|
285
314
|
business: $.business(e.business),
|
|
286
315
|
personal: $.personal(e.personal),
|
|
287
316
|
owners: $.owners(e.owners)
|
|
288
|
-
})),
|
|
289
|
-
Z || (
|
|
290
|
-
},
|
|
291
|
-
e ?
|
|
292
|
-
},
|
|
293
|
-
|
|
317
|
+
})), rr = () => {
|
|
318
|
+
Z || (tr ? Vt(!0) : (At($.business), jt($.personal), M($.owners), nr(), D(!1)));
|
|
319
|
+
}, ir = (e) => {
|
|
320
|
+
e ? D(!0) : rr();
|
|
321
|
+
}, ar = rr, or = async (e) => {
|
|
322
|
+
ln(!0), D(!0);
|
|
294
323
|
let t = new AbortController();
|
|
295
|
-
|
|
324
|
+
On.current = t;
|
|
296
325
|
let n = !1;
|
|
297
326
|
try {
|
|
298
|
-
let r = await
|
|
327
|
+
let r = await pn.mutateAsync({ path: { id: e } });
|
|
299
328
|
if (t.signal.aborted) return;
|
|
300
|
-
if (!r.id) throw Error(
|
|
301
|
-
if (n = !0, (await
|
|
302
|
-
let e =
|
|
303
|
-
if (e === void 0 && (e = (await
|
|
329
|
+
if (!r.id) throw Error(w.submitFailedError);
|
|
330
|
+
if (n = !0, (await hn(e, { signal: t.signal })).status === "complete") {
|
|
331
|
+
let e = _n;
|
|
332
|
+
if (e === void 0 && (e = (await vn()).data), t.signal.aborted) return;
|
|
304
333
|
if (e !== void 0) try {
|
|
305
|
-
await
|
|
334
|
+
await yn({ displayedVersion: l(e)?.disclosureId ?? null });
|
|
306
335
|
} catch {}
|
|
307
336
|
if (t.signal.aborted) return;
|
|
308
|
-
|
|
309
|
-
} else
|
|
337
|
+
dn("success"), Ot(), Dt();
|
|
338
|
+
} else dn("pending");
|
|
310
339
|
} catch (e) {
|
|
311
340
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
312
341
|
if (!n) throw e;
|
|
313
|
-
|
|
342
|
+
dn("pending");
|
|
314
343
|
} finally {
|
|
315
|
-
|
|
344
|
+
On.current = null, ln(!1);
|
|
316
345
|
}
|
|
317
|
-
},
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
let t =
|
|
327
|
-
return
|
|
328
|
-
},
|
|
329
|
-
let e =
|
|
330
|
-
if (
|
|
331
|
-
if (!
|
|
332
|
-
let e =
|
|
333
|
-
return e ? await
|
|
346
|
+
}, sr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
347
|
+
At((t) => (t.taxIdOnFileLast4 || e) && x(t.taxId) ? it(t) : t);
|
|
348
|
+
}, cr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
349
|
+
jt((t) => (t.ssnOnFileLast4 || e) && x(t.ssn) ? at(t) : t);
|
|
350
|
+
}, lr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
351
|
+
M((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && x(t.ssn) ? at(t) : t));
|
|
352
|
+
}, ur = () => {
|
|
353
|
+
M((e) => e.map(Be));
|
|
354
|
+
}, dr = async (e) => {
|
|
355
|
+
let t = Zn.current, n = await fn.mutateAsync({ body: Le(e, A) });
|
|
356
|
+
return Jt(n.id), tn(t), n.clientSecret && gn(n.id, n.clientSecret), n.id;
|
|
357
|
+
}, fr = async () => {
|
|
358
|
+
let e = N.business.companyStructure === "SOLE_PROPRIETORSHIP" && !X ? Ie(j) : [], t = e.length > 0 ? { businessOwners: e } : {};
|
|
359
|
+
if (O === 0) {
|
|
360
|
+
if (!P) return null;
|
|
361
|
+
let e = I;
|
|
362
|
+
return e ? await z.mutateAsync({
|
|
334
363
|
path: { id: e },
|
|
335
364
|
body: {
|
|
336
|
-
...
|
|
337
|
-
businessDetails:
|
|
338
|
-
carryConsent: !
|
|
365
|
+
...je({
|
|
366
|
+
businessDetails: P,
|
|
367
|
+
carryConsent: !Yt
|
|
339
368
|
}),
|
|
340
369
|
...t
|
|
341
370
|
}
|
|
342
|
-
}) : (e = await
|
|
343
|
-
taxId:
|
|
344
|
-
taxIdStructure:
|
|
345
|
-
}),
|
|
371
|
+
}) : (e = await dr(Ae(P)), Xt(!0)), Qt({
|
|
372
|
+
taxId: P.taxId,
|
|
373
|
+
taxIdStructure: P.companyStructure
|
|
374
|
+
}), sr(), X && ur(), Ft(["business"], { owners: X ? "cleared" : t.businessOwners ? "restored" : "none" }), e;
|
|
346
375
|
}
|
|
347
|
-
return
|
|
348
|
-
path: { id:
|
|
376
|
+
return O === 1 ? !F || !P || !I ? null : (await z.mutateAsync({
|
|
377
|
+
path: { id: I },
|
|
349
378
|
body: {
|
|
350
|
-
...
|
|
351
|
-
businessDetails:
|
|
352
|
-
applicant:
|
|
353
|
-
carryConsent: !
|
|
379
|
+
...je({
|
|
380
|
+
businessDetails: P,
|
|
381
|
+
applicant: F,
|
|
382
|
+
carryConsent: !Yt
|
|
354
383
|
}),
|
|
355
384
|
...t
|
|
356
385
|
}
|
|
357
|
-
}),
|
|
358
|
-
taxId:
|
|
359
|
-
taxIdStructure:
|
|
360
|
-
ssn:
|
|
361
|
-
}),
|
|
362
|
-
path: { id:
|
|
363
|
-
body:
|
|
364
|
-
}),
|
|
365
|
-
},
|
|
366
|
-
|
|
386
|
+
}), Qt({
|
|
387
|
+
taxId: P.taxId,
|
|
388
|
+
taxIdStructure: P.companyStructure,
|
|
389
|
+
ssn: F.ssn
|
|
390
|
+
}), sr(), cr(), Ft(["business", "personal"], { owners: X ? "cleared" : t.businessOwners ? "restored" : "none" }), I) : O === 2 ? !Kt || !I ? null : (await z.mutateAsync({
|
|
391
|
+
path: { id: I },
|
|
392
|
+
body: je({ businessOwners: Kt })
|
|
393
|
+
}), lr(), Ft(["owners"]), I) : null;
|
|
394
|
+
}, pr = (e) => s(e) ?? (e instanceof Error ? e.message : void 0) ?? w.genericRetryError, mr = async () => {
|
|
395
|
+
R(null);
|
|
367
396
|
try {
|
|
368
|
-
let e = await
|
|
397
|
+
let e = await fr();
|
|
369
398
|
if (e === null) return;
|
|
370
|
-
|
|
399
|
+
O === 2 ? await or(e) : kt(O + 1);
|
|
371
400
|
} catch (e) {
|
|
372
|
-
|
|
401
|
+
R(pr(e));
|
|
373
402
|
}
|
|
374
|
-
},
|
|
375
|
-
|
|
403
|
+
}, hr = async () => {
|
|
404
|
+
R(null), an(!0);
|
|
376
405
|
try {
|
|
377
|
-
if (await
|
|
378
|
-
|
|
406
|
+
if (await fr() === null) return;
|
|
407
|
+
sr({ evenWithoutMarker: !0 }), O >= 1 && cr({ evenWithoutMarker: !0 }), O === 2 && lr({ evenWithoutMarker: !0 }), a.success(w.applicationSavedToast), D(!1);
|
|
379
408
|
} catch (e) {
|
|
380
|
-
|
|
409
|
+
a.error(pr(e));
|
|
381
410
|
} finally {
|
|
382
|
-
|
|
411
|
+
an(!1);
|
|
383
412
|
}
|
|
384
|
-
},
|
|
385
|
-
let e =
|
|
386
|
-
businessDetails:
|
|
387
|
-
applicant:
|
|
413
|
+
}, gr = async () => {
|
|
414
|
+
let e = ot(j, It), t = Fe({
|
|
415
|
+
businessDetails: k,
|
|
416
|
+
applicant: A,
|
|
388
417
|
businessOwners: e,
|
|
389
|
-
savedBusinessDetails:
|
|
390
|
-
savedOwners:
|
|
418
|
+
savedBusinessDetails: N.business,
|
|
419
|
+
savedOwners: N.owners,
|
|
391
420
|
dirty: Q
|
|
392
421
|
}), n = Q;
|
|
393
|
-
|
|
422
|
+
Ut(!0);
|
|
394
423
|
try {
|
|
395
424
|
if (!t) {
|
|
396
|
-
|
|
425
|
+
a.error(w.saveDraftNothingValidError);
|
|
397
426
|
return;
|
|
398
427
|
}
|
|
399
|
-
let r = !
|
|
400
|
-
|
|
401
|
-
path: { id:
|
|
428
|
+
let r = !I;
|
|
429
|
+
I ? await z.mutateAsync({
|
|
430
|
+
path: { id: I },
|
|
402
431
|
body: t
|
|
403
|
-
}) : await
|
|
404
|
-
let
|
|
405
|
-
r &&
|
|
406
|
-
taxId:
|
|
407
|
-
taxIdStructure:
|
|
408
|
-
ssn:
|
|
409
|
-
}),
|
|
410
|
-
let o = Array.isArray(
|
|
411
|
-
|
|
432
|
+
}) : await dr(Pe(t)), It && M(e), a.success(w.applicationSavedToast);
|
|
433
|
+
let i = t;
|
|
434
|
+
r && i.applicant?.isLegallyAuthorized && i.applicant?.hasAcceptedDisclosures && Xt(!0), Qt({
|
|
435
|
+
taxId: i.businessDetails?.taxId?.value,
|
|
436
|
+
taxIdStructure: k.companyStructure,
|
|
437
|
+
ssn: i.applicant?.personalIdentificationNumber?.value
|
|
438
|
+
}), i.businessDetails?.taxId !== void 0 && sr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && cr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && lr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && ur();
|
|
439
|
+
let o = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
|
|
440
|
+
Pt({ next: (e, t) => Ne({
|
|
412
441
|
current: e,
|
|
413
442
|
saved: t,
|
|
414
443
|
dirty: n,
|
|
415
444
|
ownersWrite: o
|
|
416
|
-
}) }),
|
|
445
|
+
}) }), Lt(null), zt((e) => e + 1), Vt(!1), D(!1);
|
|
417
446
|
} catch (e) {
|
|
418
|
-
|
|
447
|
+
a.error(pr(e));
|
|
419
448
|
} finally {
|
|
420
|
-
|
|
449
|
+
Ut(!1);
|
|
421
450
|
}
|
|
422
|
-
},
|
|
423
|
-
|
|
424
|
-
},
|
|
425
|
-
if (
|
|
451
|
+
}, _r = () => {
|
|
452
|
+
At($.business(N.business)), jt($.personal(N.personal)), M($.owners(N.owners)), nr(), Lt(null), zt((e) => e + 1), R(null), Vt(!1), D(!1);
|
|
453
|
+
}, vr = async () => {
|
|
454
|
+
if (I !== null) {
|
|
426
455
|
try {
|
|
427
|
-
await
|
|
456
|
+
await mn.mutateAsync({ path: { id: I } });
|
|
428
457
|
} catch (e) {
|
|
429
|
-
|
|
458
|
+
a.error(pr(e));
|
|
430
459
|
return;
|
|
431
460
|
}
|
|
432
|
-
|
|
461
|
+
a.success(w.applicationDeletedToast);
|
|
433
462
|
}
|
|
434
|
-
|
|
435
|
-
},
|
|
436
|
-
if (
|
|
437
|
-
let
|
|
438
|
-
...
|
|
439
|
-
...
|
|
440
|
-
}, c = /* @__PURE__ */ b(
|
|
463
|
+
sn(!1), D(!1), nt?.();
|
|
464
|
+
}, yr = lt(Math.min(O, 2), w), br = T.bankName?.trim() || w.fallbackBankName, xr = me(w.shellFdicDisclaimer, br);
|
|
465
|
+
if (U) {
|
|
466
|
+
let e = P?.companyLegalName ?? "", i = T.bankName?.trim() || w.fallbackBankName, a = un ?? "pending", o = a === "success", s = {
|
|
467
|
+
...ye.result,
|
|
468
|
+
...w.result
|
|
469
|
+
}, c = /* @__PURE__ */ b(ge, {
|
|
441
470
|
testIds: {
|
|
442
|
-
processing:
|
|
443
|
-
dashboardButton:
|
|
471
|
+
processing: m.resultProcessing,
|
|
472
|
+
dashboardButton: m.resultDashboardButton
|
|
444
473
|
},
|
|
445
474
|
status: a,
|
|
446
|
-
isLoading:
|
|
475
|
+
isLoading: cn,
|
|
447
476
|
loadingMessage: s.loadingMessage,
|
|
448
477
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
449
|
-
headingLine2: `${
|
|
478
|
+
headingLine2: `${e}!`,
|
|
450
479
|
body: o ? s.successBody : s.pendingBody,
|
|
451
|
-
followUpEmail:
|
|
480
|
+
followUpEmail: F?.workEmail ?? "",
|
|
452
481
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
453
482
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
454
|
-
bankLogoSrc:
|
|
455
|
-
bankLogoAlt:
|
|
456
|
-
fdicDisclaimer:
|
|
457
|
-
onNavigateToDashboard:
|
|
483
|
+
bankLogoSrc: dt,
|
|
484
|
+
bankLogoAlt: me(s.bankLogoAlt, i),
|
|
485
|
+
fdicDisclaimer: me(s.fdicDisclaimer, i),
|
|
486
|
+
onNavigateToDashboard: pe
|
|
458
487
|
});
|
|
459
|
-
return
|
|
488
|
+
return S ? /* @__PURE__ */ b("div", {
|
|
460
489
|
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",
|
|
461
490
|
children: c
|
|
462
|
-
}) : /* @__PURE__ */ b(
|
|
463
|
-
open:
|
|
464
|
-
onOpenChange:
|
|
465
|
-
children: /* @__PURE__ */
|
|
491
|
+
}) : /* @__PURE__ */ b(t, {
|
|
492
|
+
open: E,
|
|
493
|
+
onOpenChange: D,
|
|
494
|
+
children: /* @__PURE__ */ et(n, {
|
|
466
495
|
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",
|
|
467
|
-
children: [/* @__PURE__ */ b(
|
|
496
|
+
children: [/* @__PURE__ */ b(r, {
|
|
468
497
|
className: "ttw:sr-only",
|
|
469
|
-
children:
|
|
498
|
+
children: w.modalTitle
|
|
470
499
|
}), c]
|
|
471
500
|
})
|
|
472
501
|
});
|
|
473
502
|
}
|
|
474
|
-
let
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
open:
|
|
478
|
-
defaultOpen:
|
|
479
|
-
onOpenChange:
|
|
480
|
-
isFullScreenInline:
|
|
481
|
-
title:
|
|
482
|
-
subtitle:
|
|
483
|
-
stepLabels:
|
|
484
|
-
activeStep:
|
|
485
|
-
disclaimerText:
|
|
486
|
-
onBack:
|
|
487
|
-
onCancel:
|
|
488
|
-
onNext:
|
|
489
|
-
onSaveAndClose:
|
|
490
|
-
onDelete: () =>
|
|
503
|
+
let Sr = O === 2 ? w.submit : w.next, Cr = $n === null || Z;
|
|
504
|
+
return /* @__PURE__ */ et($e, { children: [
|
|
505
|
+
/* @__PURE__ */ et(re, {
|
|
506
|
+
open: E,
|
|
507
|
+
defaultOpen: Et,
|
|
508
|
+
onOpenChange: ir,
|
|
509
|
+
isFullScreenInline: S,
|
|
510
|
+
title: yr.title,
|
|
511
|
+
subtitle: yr.subtitle,
|
|
512
|
+
stepLabels: Qn,
|
|
513
|
+
activeStep: O,
|
|
514
|
+
disclaimerText: xr,
|
|
515
|
+
onBack: O === 0 ? ar : er,
|
|
516
|
+
onCancel: O > 0 ? ar : void 0,
|
|
517
|
+
onNext: mr,
|
|
518
|
+
onSaveAndClose: hr,
|
|
519
|
+
onDelete: () => sn(!0),
|
|
491
520
|
showDismissButton: !1,
|
|
492
|
-
isNextDisabled:
|
|
493
|
-
isNextLoading: Z && !
|
|
494
|
-
isSaveAndCloseDisabled:
|
|
495
|
-
isSaveAndCloseLoading:
|
|
496
|
-
nextLabel:
|
|
521
|
+
isNextDisabled: Cr,
|
|
522
|
+
isNextLoading: Z && !rn,
|
|
523
|
+
isSaveAndCloseDisabled: Cr,
|
|
524
|
+
isSaveAndCloseLoading: rn,
|
|
525
|
+
nextLabel: Sr,
|
|
497
526
|
nextIcon: null,
|
|
498
|
-
errorMessage:
|
|
527
|
+
errorMessage: nn,
|
|
499
528
|
labels: {
|
|
500
|
-
backButton:
|
|
501
|
-
cancelButton:
|
|
502
|
-
saveAndCloseButton:
|
|
503
|
-
deleteButton:
|
|
529
|
+
backButton: O === 0 ? w.cancel : w.back,
|
|
530
|
+
cancelButton: w.cancel,
|
|
531
|
+
saveAndCloseButton: w.saveAndClose,
|
|
532
|
+
deleteButton: w.deleteApplication
|
|
504
533
|
},
|
|
505
534
|
testIds: {
|
|
506
|
-
root:
|
|
507
|
-
dismiss:
|
|
508
|
-
back:
|
|
509
|
-
cancel:
|
|
510
|
-
saveAndClose:
|
|
511
|
-
delete:
|
|
512
|
-
next:
|
|
535
|
+
root: m.shell,
|
|
536
|
+
dismiss: m.shellDismiss,
|
|
537
|
+
back: m.shellBack,
|
|
538
|
+
cancel: m.shellCancel,
|
|
539
|
+
saveAndClose: m.shellSaveAndClose,
|
|
540
|
+
delete: m.shellDelete,
|
|
541
|
+
next: m.shellNext,
|
|
513
542
|
scrollRegion: {
|
|
514
|
-
root:
|
|
515
|
-
fade:
|
|
516
|
-
hint:
|
|
543
|
+
root: m.shellScrollRegion,
|
|
544
|
+
fade: m.shellScrollFade,
|
|
545
|
+
hint: m.shellScrollHint
|
|
517
546
|
}
|
|
518
547
|
},
|
|
519
548
|
children: [
|
|
520
|
-
|
|
521
|
-
value:
|
|
522
|
-
onValueChange:
|
|
523
|
-
onSnapshotChange:
|
|
524
|
-
naicsOptions:
|
|
525
|
-
stateOptions:
|
|
549
|
+
O === 0 ? /* @__PURE__ */ b(De, {
|
|
550
|
+
value: k,
|
|
551
|
+
onValueChange: $t,
|
|
552
|
+
onSnapshotChange: Wt,
|
|
553
|
+
naicsOptions: kn,
|
|
554
|
+
stateOptions: An,
|
|
526
555
|
isSubmitting: Z,
|
|
527
|
-
labels:
|
|
528
|
-
bankName:
|
|
529
|
-
termsHref:
|
|
530
|
-
privacyHref:
|
|
531
|
-
electronicCommunicationHref:
|
|
532
|
-
patriotActHref:
|
|
556
|
+
labels: w.businessDetails,
|
|
557
|
+
bankName: br,
|
|
558
|
+
termsHref: yt,
|
|
559
|
+
privacyHref: bt,
|
|
560
|
+
electronicCommunicationHref: xt,
|
|
561
|
+
patriotActHref: St
|
|
533
562
|
}, "business") : null,
|
|
534
|
-
|
|
535
|
-
value:
|
|
536
|
-
onValueChange:
|
|
537
|
-
onSnapshotChange:
|
|
538
|
-
stateOptions:
|
|
563
|
+
O === 1 ? /* @__PURE__ */ b(Oe, {
|
|
564
|
+
value: A,
|
|
565
|
+
onValueChange: jt,
|
|
566
|
+
onSnapshotChange: Gt,
|
|
567
|
+
stateOptions: jn,
|
|
539
568
|
isSubmitting: Z,
|
|
540
|
-
labels:
|
|
569
|
+
labels: w.personalDetails
|
|
541
570
|
}, "personal") : null,
|
|
542
|
-
|
|
543
|
-
owners: X ?
|
|
544
|
-
onOwnersChange:
|
|
545
|
-
primaryOwnerName: `${
|
|
546
|
-
primaryOwnerPercentage: X ? 100 :
|
|
547
|
-
stateOptions:
|
|
548
|
-
onSnapshotChange:
|
|
549
|
-
onPendingOwnerChange:
|
|
571
|
+
O === 2 ? /* @__PURE__ */ b(ke, {
|
|
572
|
+
owners: X ? rt : j,
|
|
573
|
+
onOwnersChange: M,
|
|
574
|
+
primaryOwnerName: `${A.firstName} ${A.lastName}`.trim(),
|
|
575
|
+
primaryOwnerPercentage: X ? 100 : F?.ownsOver25Percent === !0 ? F.ownershipPercentage ?? 0 : 0,
|
|
576
|
+
stateOptions: Mn,
|
|
577
|
+
onSnapshotChange: qt,
|
|
578
|
+
onPendingOwnerChange: Lt,
|
|
550
579
|
isSubmitting: Z,
|
|
551
|
-
labels:
|
|
552
|
-
},
|
|
580
|
+
labels: w.additionalOwners
|
|
581
|
+
}, Rt) : null
|
|
553
582
|
]
|
|
554
583
|
}),
|
|
555
|
-
/* @__PURE__ */ b(
|
|
556
|
-
open:
|
|
557
|
-
onSaveDraft:
|
|
558
|
-
onDiscard:
|
|
559
|
-
onCancel: () =>
|
|
560
|
-
isSaving:
|
|
561
|
-
labels:
|
|
584
|
+
/* @__PURE__ */ b(_e, {
|
|
585
|
+
open: Bt,
|
|
586
|
+
onSaveDraft: gr,
|
|
587
|
+
onDiscard: _r,
|
|
588
|
+
onCancel: () => Vt(!1),
|
|
589
|
+
isSaving: Ht,
|
|
590
|
+
labels: w.unsavedApplicationDialog,
|
|
562
591
|
testIds: {
|
|
563
|
-
root:
|
|
564
|
-
saveDraft:
|
|
565
|
-
discard:
|
|
566
|
-
close:
|
|
592
|
+
root: m.unsavedDialog,
|
|
593
|
+
saveDraft: m.unsavedDialogSaveDraft,
|
|
594
|
+
discard: m.unsavedDialogDiscard,
|
|
595
|
+
close: m.unsavedDialogClose
|
|
567
596
|
}
|
|
568
597
|
}),
|
|
569
|
-
/* @__PURE__ */ b(
|
|
570
|
-
open:
|
|
571
|
-
onConfirm:
|
|
572
|
-
onCancel: () =>
|
|
573
|
-
isDeleting:
|
|
598
|
+
/* @__PURE__ */ b(ve, {
|
|
599
|
+
open: on,
|
|
600
|
+
onConfirm: vr,
|
|
601
|
+
onCancel: () => sn(!1),
|
|
602
|
+
isDeleting: mn.isPending,
|
|
574
603
|
labels: {
|
|
575
|
-
descriptionEmphasis:
|
|
576
|
-
...
|
|
604
|
+
descriptionEmphasis: w.saveAndClose,
|
|
605
|
+
...w.deleteApplicationDialog
|
|
577
606
|
},
|
|
578
607
|
testIds: {
|
|
579
|
-
root:
|
|
580
|
-
confirm:
|
|
581
|
-
cancel:
|
|
608
|
+
root: m.deleteDialog,
|
|
609
|
+
confirm: m.deleteDialogConfirm,
|
|
610
|
+
cancel: m.deleteDialogCancel
|
|
582
611
|
}
|
|
583
612
|
}),
|
|
584
|
-
/* @__PURE__ */ b(
|
|
613
|
+
/* @__PURE__ */ b(ne, {})
|
|
585
614
|
] });
|
|
586
615
|
}
|
|
587
|
-
function
|
|
588
|
-
return /* @__PURE__ */ b(
|
|
616
|
+
function dt({ 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: d, ...f }) {
|
|
617
|
+
return /* @__PURE__ */ b(ae, {
|
|
589
618
|
baseUrl: e,
|
|
590
619
|
widgetToken: t,
|
|
591
620
|
organizationId: n,
|
|
@@ -597,47 +626,50 @@ function ct({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
|
|
|
597
626
|
errorFallback: c,
|
|
598
627
|
onError: l,
|
|
599
628
|
analytics: u,
|
|
600
|
-
disclosuresAcceptance:
|
|
601
|
-
providerLabels:
|
|
602
|
-
widgetName:
|
|
603
|
-
children: /* @__PURE__ */ b(
|
|
629
|
+
disclosuresAcceptance: ee,
|
|
630
|
+
providerLabels: d,
|
|
631
|
+
widgetName: ze,
|
|
632
|
+
children: /* @__PURE__ */ b(ft, { ...f })
|
|
604
633
|
});
|
|
605
634
|
}
|
|
606
|
-
function
|
|
607
|
-
let { initResponse: t } =
|
|
608
|
-
r !== i && (a(r), i !== null && r !== null &&
|
|
635
|
+
function ft(e) {
|
|
636
|
+
let { initResponse: t } = se(), { client: n } = c(), r = t?.userId ?? null, [i, a] = y(r), [o, s] = y(0);
|
|
637
|
+
r !== i && (a(r), i !== null && r !== null && s((e) => e + 1));
|
|
609
638
|
let [l, u] = y(n);
|
|
610
|
-
return n !== l && (u(n),
|
|
639
|
+
return n !== l && (u(n), s((e) => e + 1)), /* @__PURE__ */ b(pt, { ...e }, o);
|
|
611
640
|
}
|
|
612
|
-
function
|
|
613
|
-
let { authEpoch: t } =
|
|
641
|
+
function pt(e) {
|
|
642
|
+
let { authEpoch: t } = c(), { ownApplicationIds: n } = Ye(), [r, i] = y(null), [a, o] = y(0), [s, l] = y(!1), u = Ze(() => {
|
|
643
|
+
i(null), o((e) => e + 1);
|
|
644
|
+
}, []), ee = Ze(() => {
|
|
614
645
|
i(null), l(!0), o((e) => e + 1);
|
|
615
646
|
}, []);
|
|
616
|
-
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), o((e) => e + 1)), /* @__PURE__ */ b(
|
|
647
|
+
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), o((e) => e + 1)), /* @__PURE__ */ b(He, { children: /* @__PURE__ */ b(ht, {
|
|
617
648
|
...e,
|
|
618
|
-
defaultOpen: !
|
|
649
|
+
defaultOpen: !s && e.defaultOpen,
|
|
619
650
|
onEditableDraftChange: i,
|
|
620
|
-
onApplicationDeleted:
|
|
651
|
+
onApplicationDeleted: ee,
|
|
652
|
+
onNoticeReplacedByForm: u
|
|
621
653
|
}, a) }, a);
|
|
622
654
|
}
|
|
623
|
-
var
|
|
624
|
-
function
|
|
625
|
-
let { authEpoch: t } =
|
|
626
|
-
if (
|
|
655
|
+
var mt = { canRender: !1 };
|
|
656
|
+
function ht(e) {
|
|
657
|
+
let { authEpoch: t } = c(), { applicationId: n, clientSecret: r, isResolved: i } = Ye(), { application: a, isResolved: o, isUnavailable: s } = Xe(n, r), [l, u] = y(null);
|
|
658
|
+
if (g(() => {
|
|
627
659
|
if (l?.canRender !== !0 && i && o) {
|
|
628
|
-
if (
|
|
629
|
-
u(
|
|
660
|
+
if (s) {
|
|
661
|
+
u(mt);
|
|
630
662
|
return;
|
|
631
663
|
}
|
|
632
|
-
if (a !== null && a.status !== void 0 && a.status !==
|
|
633
|
-
u(
|
|
664
|
+
if (a !== null && a.status !== void 0 && a.status !== nt) {
|
|
665
|
+
u(mt);
|
|
634
666
|
return;
|
|
635
667
|
}
|
|
636
668
|
u({
|
|
637
669
|
canRender: !0,
|
|
638
670
|
applicationId: a === null ? null : n,
|
|
639
671
|
authEpoch: t,
|
|
640
|
-
prefill:
|
|
672
|
+
prefill: Me(a)
|
|
641
673
|
});
|
|
642
674
|
}
|
|
643
675
|
}, [
|
|
@@ -645,25 +677,25 @@ function w(e) {
|
|
|
645
677
|
l,
|
|
646
678
|
i,
|
|
647
679
|
o,
|
|
648
|
-
|
|
680
|
+
s,
|
|
649
681
|
a,
|
|
650
682
|
n
|
|
651
683
|
]), l === null || !l.canRender) return null;
|
|
652
|
-
let { applicationId:
|
|
653
|
-
return /* @__PURE__ */ b(
|
|
684
|
+
let { applicationId: ee, authEpoch: d, prefill: f } = l;
|
|
685
|
+
return /* @__PURE__ */ b(ut, {
|
|
654
686
|
...e,
|
|
655
|
-
initialApplicationId:
|
|
656
|
-
initialBoundAuthEpoch:
|
|
687
|
+
initialApplicationId: ee,
|
|
688
|
+
initialBoundAuthEpoch: d,
|
|
657
689
|
initialBusinessDetails: {
|
|
658
|
-
...
|
|
690
|
+
...Ve(e.initialBusinessDetails),
|
|
659
691
|
...f?.businessDetails
|
|
660
692
|
},
|
|
661
693
|
initialPersonalDetails: {
|
|
662
|
-
...
|
|
694
|
+
...Ve(e.initialPersonalDetails),
|
|
663
695
|
...f?.personalDetails
|
|
664
696
|
},
|
|
665
|
-
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(
|
|
697
|
+
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Be)
|
|
666
698
|
});
|
|
667
699
|
}
|
|
668
700
|
//#endregion
|
|
669
|
-
export {
|
|
701
|
+
export { dt as BankAccountOnboardingWidget, dt as default };
|