@tesouro/embedded-components-react 0.11.31 → 0.11.33
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/index.d.ts +12 -1
- package/dist/lib/BankAccountOnboardingWidget.d.ts +12 -1
- package/dist/lib/WidgetSuite.d.ts +12 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +371 -350
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2338,6 +2338,12 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
2338
2338
|
* under. Set by the resume layer, not by hosts.
|
|
2339
2339
|
*/
|
|
2340
2340
|
initialBoundAuthEpoch?: number;
|
|
2341
|
+
/**
|
|
2342
|
+
* Which sections the resumed application already holds everything on screen
|
|
2343
|
+
* for. Set by the resume layer, not by hosts; without it nothing counts as
|
|
2344
|
+
* held, so a save sends what it can.
|
|
2345
|
+
*/
|
|
2346
|
+
initialWrittenSections?: WrittenSections;
|
|
2341
2347
|
/**
|
|
2342
2348
|
* The application this session may still write to, with the auth epoch it
|
|
2343
2349
|
* was bound under, or null once there is none. Reported up to the session
|
|
@@ -2399,11 +2405,16 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
2399
2405
|
*/
|
|
2400
2406
|
onResultPhaseChange?: (isInResultPhase: boolean) => void;
|
|
2401
2407
|
}
|
|
2402
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
2408
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialWrittenSections' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
2403
2409
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
2404
2410
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
2405
2411
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
2406
2412
|
};
|
|
2413
|
+
/** Which sections the server holds as the form shows them. */
|
|
2414
|
+
interface WrittenSections {
|
|
2415
|
+
business: boolean;
|
|
2416
|
+
owners: boolean;
|
|
2417
|
+
}
|
|
2407
2418
|
declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
|
|
2408
2419
|
|
|
2409
2420
|
interface BalancesWidgetLabels {
|
|
@@ -1290,6 +1290,12 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1290
1290
|
* under. Set by the resume layer, not by hosts.
|
|
1291
1291
|
*/
|
|
1292
1292
|
initialBoundAuthEpoch?: number;
|
|
1293
|
+
/**
|
|
1294
|
+
* Which sections the resumed application already holds everything on screen
|
|
1295
|
+
* for. Set by the resume layer, not by hosts; without it nothing counts as
|
|
1296
|
+
* held, so a save sends what it can.
|
|
1297
|
+
*/
|
|
1298
|
+
initialWrittenSections?: WrittenSections;
|
|
1293
1299
|
/**
|
|
1294
1300
|
* The application this session may still write to, with the auth epoch it
|
|
1295
1301
|
* was bound under, or null once there is none. Reported up to the session
|
|
@@ -1351,11 +1357,16 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1351
1357
|
*/
|
|
1352
1358
|
onResultPhaseChange?: (isInResultPhase: boolean) => void;
|
|
1353
1359
|
}
|
|
1354
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
1360
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialWrittenSections' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
1355
1361
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
1356
1362
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
1357
1363
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
1358
1364
|
};
|
|
1365
|
+
/** Which sections the server holds as the form shows them. */
|
|
1366
|
+
interface WrittenSections {
|
|
1367
|
+
business: boolean;
|
|
1368
|
+
owners: boolean;
|
|
1369
|
+
}
|
|
1359
1370
|
declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
|
|
1360
1371
|
|
|
1361
1372
|
export { ADDITIONAL_OWNERS_LABELS_EN, APPLICATION_STATUS_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BankAccountOnboardingWidget, OnboardingSuppressionReason, PERSONAL_DETAILS_LABELS_EN, RESULT_LABELS_EN };
|
|
@@ -1339,6 +1339,12 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1339
1339
|
* under. Set by the resume layer, not by hosts.
|
|
1340
1340
|
*/
|
|
1341
1341
|
initialBoundAuthEpoch?: number;
|
|
1342
|
+
/**
|
|
1343
|
+
* Which sections the resumed application already holds everything on screen
|
|
1344
|
+
* for. Set by the resume layer, not by hosts; without it nothing counts as
|
|
1345
|
+
* held, so a save sends what it can.
|
|
1346
|
+
*/
|
|
1347
|
+
initialWrittenSections?: WrittenSections;
|
|
1342
1348
|
/**
|
|
1343
1349
|
* The application this session may still write to, with the auth epoch it
|
|
1344
1350
|
* was bound under, or null once there is none. Reported up to the session
|
|
@@ -1400,11 +1406,16 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1400
1406
|
*/
|
|
1401
1407
|
onResultPhaseChange?: (isInResultPhase: boolean) => void;
|
|
1402
1408
|
}
|
|
1403
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
1409
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialWrittenSections' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted' | 'onNoticeReplacedByForm' | 'focusFormOnMount' | 'onFocusFormOnMountDone'> & {
|
|
1404
1410
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
1405
1411
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
1406
1412
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
1407
1413
|
};
|
|
1414
|
+
/** Which sections the server holds as the form shows them. */
|
|
1415
|
+
interface WrittenSections {
|
|
1416
|
+
business: boolean;
|
|
1417
|
+
owners: boolean;
|
|
1418
|
+
}
|
|
1408
1419
|
|
|
1409
1420
|
interface BalancesWidgetLabels {
|
|
1410
1421
|
/** Card header title, beside the bank icon */
|
|
@@ -17,51 +17,51 @@ import { EmbeddedToaster as d } from "../../../../../shared/ui/dist/lib/Embedded
|
|
|
17
17
|
import { OnboardingShell as ee } from "../../../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
|
|
18
18
|
import "../../../../../shared/ui/dist/index.js";
|
|
19
19
|
import { useAnalyticsTrack as f } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
20
|
-
import { WidgetProvider as
|
|
21
|
-
import { useRefetchWidget as
|
|
22
|
-
import { getNaicsOptions as
|
|
23
|
-
import { deniedNoticeExpiresAt as
|
|
20
|
+
import { WidgetProvider as p } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
21
|
+
import { useRefetchWidget as te, useWidgetConfig as ne, useWidgetInitStaleForToken as re, useWidgetLoading as ie } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
22
|
+
import { getNaicsOptions as ae } from "../../../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
23
|
+
import { deniedNoticeExpiresAt as oe, selectBankAccountApplication as se } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
24
24
|
import "../../../../../shared/feature/dist/index.js";
|
|
25
|
-
import { interpolateBankName as
|
|
26
|
-
import { ApplicationStatusCard as
|
|
27
|
-
import { ResultStep as
|
|
28
|
-
import { DeleteApplicationDialog as
|
|
29
|
-
import { ApplicationDeletedScreen as
|
|
25
|
+
import { interpolateBankName as ce } from "../../../../ui/dist/index12.js";
|
|
26
|
+
import { ApplicationStatusCard as le } from "../../../../ui/dist/index15.js";
|
|
27
|
+
import { ResultStep as ue } from "../../../../ui/dist/index19.js";
|
|
28
|
+
import { DeleteApplicationDialog as de } from "../../../../ui/dist/index33.js";
|
|
29
|
+
import { ApplicationDeletedScreen as fe } from "../../../../ui/dist/index35.js";
|
|
30
30
|
import "../../../../ui/dist/index.js";
|
|
31
|
-
import { DEFAULT_LABELS as
|
|
32
|
-
import { OnboardingApplicationView as
|
|
33
|
-
import { identifierLast4 as
|
|
34
|
-
import { isConsentGiven as
|
|
35
|
-
import { bankAccountOnboardingTestIds as
|
|
36
|
-
import { BusinessDetailsStep as
|
|
37
|
-
import { PersonalDetailsStep as
|
|
38
|
-
import { ReviewStep as
|
|
39
|
-
import { TermsStep as
|
|
40
|
-
import { valuesKey as
|
|
41
|
-
import { AdditionalOwnersStep as
|
|
42
|
-
import { buildCreateApplicationBody as
|
|
43
|
-
import { buildOnboardingPrefill as
|
|
44
|
-
import { acceptDraftedValues as
|
|
45
|
-
import { OnboardingAnalyticsEvent as
|
|
46
|
-
import { withoutResumeOnlyOwnerFields as
|
|
47
|
-
import { ApplicationClientSecretProvider as
|
|
48
|
-
import { useCreateApplication as
|
|
49
|
-
import { useUpdateApplication as
|
|
50
|
-
import { useSubmitApplication as
|
|
51
|
-
import { useDeleteApplication as
|
|
52
|
-
import { usePollApplicationCompletion as
|
|
53
|
-
import { useResumableBankAccountApplication as
|
|
54
|
-
import { useStartedBankAccountApplication as
|
|
31
|
+
import { DEFAULT_LABELS as m } from "./labels.js";
|
|
32
|
+
import { OnboardingApplicationView as pe, applicationStatusNoticeFor as me, hiddenViewReason as he, isNoticeView as ge, mergeApplicationStatusLabels as _e, onboardingApplicationViewFor as ve } from "./applicationStatusView.js";
|
|
33
|
+
import { identifierLast4 as ye, isIdentifierEnteredOrStored as be } from "./fieldInput/storedIdentifier.js";
|
|
34
|
+
import { isConsentGiven as xe } from "./stepSchemas.js";
|
|
35
|
+
import { bankAccountOnboardingTestIds as h } from "./testIds.js";
|
|
36
|
+
import { BusinessDetailsStep as Se } from "./BusinessDetailsStep.js";
|
|
37
|
+
import { PersonalDetailsStep as Ce } from "./PersonalDetailsStep.js";
|
|
38
|
+
import { ReviewStep as we } from "./ReviewStep.js";
|
|
39
|
+
import { TermsStep as Te } from "./TermsStep.js";
|
|
40
|
+
import { valuesKey as g } from "./valuesKey.js";
|
|
41
|
+
import { AdditionalOwnersStep as Ee } from "./AdditionalOwnersStep.js";
|
|
42
|
+
import { buildCreateApplicationBody as De, buildUpdateApplicationBody as Oe } from "./apiMapping.js";
|
|
43
|
+
import { buildOnboardingPrefill as _ } from "./buildOnboardingPrefill.js";
|
|
44
|
+
import { acceptDraftedValues as ke, asCreateBody as Ae, buildDraftApplicationBody as je, withApplicantWorkEmail as Me } from "./draftApplicationMapping.js";
|
|
45
|
+
import { OnboardingAnalyticsEvent as Ne, WIDGET_NAME as Pe } from "../analytics/events.js";
|
|
46
|
+
import { withoutResumeOnlyOwnerFields as Fe, withoutStoredIdentifierMarkers as Ie } from "./hostInitialValues.js";
|
|
47
|
+
import { ApplicationClientSecretProvider as Le, useApplicationClientSecret as Re } from "../../../../data-access/dist/index3.js";
|
|
48
|
+
import { useCreateApplication as ze } from "../../../../data-access/dist/index5.js";
|
|
49
|
+
import { useUpdateApplication as Be } from "../../../../data-access/dist/index6.js";
|
|
50
|
+
import { useSubmitApplication as Ve } from "../../../../data-access/dist/index7.js";
|
|
51
|
+
import { useDeleteApplication as He } from "../../../../data-access/dist/index8.js";
|
|
52
|
+
import { usePollApplicationCompletion as Ue } from "../../../../data-access/dist/index9.js";
|
|
53
|
+
import { useResumableBankAccountApplication as We } from "../../../../data-access/dist/index11.js";
|
|
54
|
+
import { useStartedBankAccountApplication as Ge } from "../../../../data-access/dist/index12.js";
|
|
55
55
|
import "../../../../data-access/dist/index.js";
|
|
56
|
-
import { useCallback as
|
|
57
|
-
import { Fragment as
|
|
56
|
+
import { useCallback as v, useEffect as y, useMemo as b, useReducer as Ke, useRef as x, useState as S } from "react";
|
|
57
|
+
import { Fragment as qe, jsx as C, jsxs as Je } from "react/jsx-runtime";
|
|
58
58
|
// ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
|
|
59
|
-
var Ye = 2 ** 31 - 1, Xe = "DRAFT", Ze = [], Qe = "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6", w = (e) =>
|
|
59
|
+
var Ye = 2 ** 31 - 1, Xe = "DRAFT", Ze = [], Qe = "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6", w = (e) => be(e, void 0);
|
|
60
60
|
function $e(e) {
|
|
61
61
|
return {
|
|
62
62
|
...e,
|
|
63
63
|
taxId: "",
|
|
64
|
-
taxIdOnFileLast4:
|
|
64
|
+
taxIdOnFileLast4: ye(e.taxId),
|
|
65
65
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -69,7 +69,7 @@ function et(e) {
|
|
|
69
69
|
return {
|
|
70
70
|
...e,
|
|
71
71
|
ssn: "",
|
|
72
|
-
ssnOnFileLast4:
|
|
72
|
+
ssnOnFileLast4: ye(e.ssn)
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
function tt(e, t) {
|
|
@@ -130,369 +130,386 @@ function at(e, t) {
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
function ot({ callback: e }) {
|
|
133
|
-
return
|
|
133
|
+
return y(() => {
|
|
134
134
|
e?.();
|
|
135
135
|
}, [e]), null;
|
|
136
136
|
}
|
|
137
|
-
function st({ onEmbeddedOnboardingCompletedSuccessfully:
|
|
138
|
-
let D = f(), { authEpoch:
|
|
139
|
-
|
|
140
|
-
D(
|
|
137
|
+
function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboard: fe, onSuppressed: be, labels: _, initialBusinessDetails: Pe, initialPersonalDetails: Ie, initialAdditionalOwners: Le, initialApplicationId: We = null, initialWrittenSections: Ge, initialBoundAuthEpoch: Xe, onEditableDraftChange: st, onApplicationDeleted: ct, onNoticeReplacedByForm: lt, focusFormOnMount: E = !1, onFocusFormOnMountDone: ut, bankLogoSrc: dt, disclosureLinks: ft, showApplicationStatusRefresh: pt = !1, onResultPhaseChange: mt }) {
|
|
138
|
+
let D = f(), { authEpoch: ht } = i();
|
|
139
|
+
y(() => {
|
|
140
|
+
D(Ne.Mounted);
|
|
141
141
|
}, [D]);
|
|
142
142
|
let O = {
|
|
143
|
-
...
|
|
144
|
-
...
|
|
145
|
-
deleteFailedError:
|
|
143
|
+
...m,
|
|
144
|
+
..._,
|
|
145
|
+
deleteFailedError: _?.deleteFailedError ?? m.deleteFailedError,
|
|
146
146
|
stepIndicator: {
|
|
147
|
-
...
|
|
148
|
-
...
|
|
147
|
+
...m.stepIndicator,
|
|
148
|
+
..._?.stepIndicator
|
|
149
149
|
},
|
|
150
150
|
nextToStep: {
|
|
151
|
-
...
|
|
152
|
-
...
|
|
151
|
+
...m.nextToStep,
|
|
152
|
+
..._?.nextToStep
|
|
153
153
|
},
|
|
154
154
|
backToStepAriaLabel: {
|
|
155
|
-
...
|
|
156
|
-
...
|
|
155
|
+
...m.backToStepAriaLabel,
|
|
156
|
+
..._?.backToStepAriaLabel
|
|
157
157
|
},
|
|
158
|
-
businessDetails:
|
|
159
|
-
personalDetails:
|
|
160
|
-
additionalOwners:
|
|
161
|
-
applicationReview:
|
|
158
|
+
businessDetails: _?.businessDetails ?? {},
|
|
159
|
+
personalDetails: _?.personalDetails ?? {},
|
|
160
|
+
additionalOwners: _?.additionalOwners ?? {},
|
|
161
|
+
applicationReview: _?.applicationReview ?? {},
|
|
162
162
|
result: {
|
|
163
|
-
...
|
|
164
|
-
...
|
|
163
|
+
...m.result,
|
|
164
|
+
..._?.result
|
|
165
165
|
},
|
|
166
|
-
deleteApplicationDialog:
|
|
167
|
-
applicationStatus:
|
|
168
|
-
}, k =
|
|
169
|
-
|
|
170
|
-
}, [
|
|
166
|
+
deleteApplicationDialog: _?.deleteApplicationDialog ?? {},
|
|
167
|
+
applicationStatus: _e(_?.applicationStatus)
|
|
168
|
+
}, k = ne().initResponse, { termsHref: gt, privacyHref: _t, electronicCommunicationHref: vt, patriotActHref: yt } = ft ?? {}, bt = v(() => {
|
|
169
|
+
p();
|
|
170
|
+
}, [p]), xt = te(), [A, St] = S(T.personal), [j, Ct] = S(() => ({
|
|
171
171
|
...rt,
|
|
172
|
-
...
|
|
173
|
-
})), [M,
|
|
172
|
+
...Pe
|
|
173
|
+
})), [M, wt] = S(() => ({
|
|
174
174
|
...it,
|
|
175
|
-
...
|
|
176
|
-
})), [N, P] =
|
|
175
|
+
...Ie
|
|
176
|
+
})), [N, P] = S(() => Le ?? []), [F, Tt] = S(() => ({
|
|
177
177
|
business: j,
|
|
178
178
|
personal: M,
|
|
179
179
|
owners: N
|
|
180
|
-
})), [
|
|
181
|
-
|
|
182
|
-
if (!
|
|
180
|
+
})), [Et, Dt] = S(null);
|
|
181
|
+
y(() => {
|
|
182
|
+
if (!Et) return;
|
|
183
183
|
let e = {
|
|
184
184
|
business: j,
|
|
185
185
|
personal: M,
|
|
186
186
|
owners: N
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
Tt((t) => Et.next(e, t)), Dt(null);
|
|
189
189
|
}, [
|
|
190
|
-
|
|
190
|
+
Et,
|
|
191
191
|
j,
|
|
192
192
|
M,
|
|
193
193
|
N
|
|
194
194
|
]);
|
|
195
|
-
let
|
|
195
|
+
let Ot = (e, { ownersCleared: t = !1 } = {}) => Dt({ next: (n, r) => ({
|
|
196
196
|
business: e.includes("business") ? n.business : r.business,
|
|
197
197
|
personal: e.includes("personal") ? n.personal : r.personal,
|
|
198
198
|
owners: t ? Ze : e.includes("owners") ? n.owners : r.owners
|
|
199
|
-
}) }), [I,
|
|
199
|
+
}) }), [I, kt] = S(null), [At, jt] = S(0), [Mt, Nt] = S(null), [Pt, Ft] = S(!1), [L, It] = S(null), [R, Lt] = S(null), [Rt, zt] = S(null), [z, Bt] = S(We), [Vt, Ht] = S(() => Ge ?? {
|
|
200
|
+
business: !1,
|
|
201
|
+
owners: !1
|
|
202
|
+
}), [Ut, Wt] = S({}), Gt = (e) => Wt((t) => ({
|
|
200
203
|
...t,
|
|
201
204
|
...e.taxId && w(e.taxId) && e.taxIdStructure ? {
|
|
202
205
|
taxId: e.taxId,
|
|
203
206
|
taxIdStructure: e.taxIdStructure
|
|
204
207
|
} : {},
|
|
205
208
|
...e.ssn && w(e.ssn) ? { ssn: e.ssn } : {}
|
|
206
|
-
})),
|
|
207
|
-
let { taxId: t, taxIdStructure: n } =
|
|
208
|
-
|
|
209
|
+
})), Kt = (e) => {
|
|
210
|
+
let { taxId: t, taxIdStructure: n } = Ut, r = t !== void 0 && n !== void 0 && e.companyStructure !== j.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
|
|
211
|
+
Ct(r ? {
|
|
209
212
|
...e,
|
|
210
213
|
taxId: e.taxId === t ? "" : e.taxId,
|
|
211
|
-
taxIdOnFileLast4:
|
|
214
|
+
taxIdOnFileLast4: ye(t),
|
|
212
215
|
taxIdOnFileStructure: n
|
|
213
216
|
} : e);
|
|
214
|
-
}, [
|
|
215
|
-
|
|
216
|
-
if (
|
|
217
|
-
let e =
|
|
217
|
+
}, [qt, Jt] = S(Xe ?? ht), [Yt, B] = S(null), [Xt, Zt] = S(null), [Qt, $t] = S(0), en = x(null);
|
|
218
|
+
y(() => {
|
|
219
|
+
if (Qt === 0) return;
|
|
220
|
+
let e = en.current;
|
|
218
221
|
(e?.querySelector("[aria-invalid=\"true\"]") ?? e?.querySelector("[data-needs-attention]"))?.focus();
|
|
219
|
-
}, [
|
|
220
|
-
let [
|
|
221
|
-
H.isResolved && (
|
|
222
|
-
let U = H.isResolved ?
|
|
223
|
-
|
|
224
|
-
if (
|
|
225
|
-
let e =
|
|
222
|
+
}, [Qt]);
|
|
223
|
+
let [tn, nn] = S(!1), [rn, an] = S(!1), [on, sn] = S(!1), [cn, ln] = S(null), un = ze(), V = Be(), dn = Ve(), fn = He(), pn = Ue(), { setClientSecret: mn } = Re(), { data: hn, refetch: gn } = s(), { mutateAsync: _n } = o(), vn = l(), H = u(), yn = re(), [bn, xn] = Ke((e) => e + 1, 0), Sn = b(() => se(H.applications), [H.applications]), Cn = x(null);
|
|
224
|
+
H.isResolved && (Cn.current = { application: Sn });
|
|
225
|
+
let U = H.isResolved ? Sn : Cn.current?.application ?? null, wn = oe(U), W = ve(U), Tn = H.isResolved || Cn.current !== null && W === pe.Form;
|
|
226
|
+
y(() => {
|
|
227
|
+
if (wn === null) return;
|
|
228
|
+
let e = wn - Date.now();
|
|
226
229
|
if (e < 0) return;
|
|
227
|
-
let t = setTimeout(
|
|
230
|
+
let t = setTimeout(xn, Math.min(e + 1, Ye));
|
|
228
231
|
return () => clearTimeout(t);
|
|
229
|
-
}, [
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
if (G) return
|
|
232
|
+
}, [wn, bn]);
|
|
233
|
+
let En = x(null);
|
|
234
|
+
y(() => () => En.current?.abort(), []);
|
|
235
|
+
let Dn = b(() => ae(O.businessDetails.naicsTitles), [O.businessDetails.naicsTitles]), On = b(() => r(O.businessDetails.stateTitles), [O.businessDetails.stateTitles]), kn = b(() => r(O.personalDetails.stateTitles), [O.personalDetails.stateTitles]), An = b(() => r(O.additionalOwners.stateTitles), [O.additionalOwners.stateTitles]), G = on || cn !== null, jn = x(mt);
|
|
236
|
+
jn.current = mt, y(() => {
|
|
237
|
+
if (G) return jn.current?.(!0), () => jn.current?.(!1);
|
|
235
238
|
}, [G]);
|
|
236
|
-
let
|
|
237
|
-
|
|
238
|
-
let Y =
|
|
239
|
-
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
let
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
let Mn = k?.status === "ACTIVE" || k?.status === "INACTIVE", Nn = k?.status === "INVITED", Pn = Mn || Nn, K = vn.isResolved && Tn, Fn = k && !G && !Pn && K && ge(W) ? W : null, In = !!k && !G && Fn === null && (Pn || K && (vn.isSuppressed || W === pe.Hidden)), q = In ? Mn ? c.UserAlreadyOnboarded : Nn ? c.UserInvitedToOrganization : W === pe.Hidden ? he(U) : vn.reason ?? he(U) : null, Ln = !!k && K && !G, [Rn, zn] = S(!1), Bn = Rn && In && !Pn && q !== c.OrganizationApplicationDenialExpired, J = Fn ?? (Bn ? "unavailable" : null);
|
|
240
|
+
Ln && Rn !== (J !== null) && zn(J !== null);
|
|
241
|
+
let Y = Bn && q === c.OrganizationApplicationComplete, Vn = ie(), [Hn, Un] = S("idle"), [Wn, Gn] = S(!1);
|
|
242
|
+
Ln && Y !== Wn && (Gn(Y), Y && Un("requested")), Hn === "requested" && Vn && Un("inFlight"), Hn === "inFlight" && !Vn && Un("idle");
|
|
243
|
+
let Kn = Y && Hn !== "idle", qn = x(be);
|
|
244
|
+
qn.current = be;
|
|
245
|
+
let Jn = In && J === null;
|
|
246
|
+
y(() => {
|
|
247
|
+
Jn && q && (D(Ne.Suppressed, { reason: q }), console.info(`[onboarding] not shown: ${q}`), qn.current?.(q));
|
|
245
248
|
}, [
|
|
246
|
-
|
|
249
|
+
Jn,
|
|
247
250
|
q,
|
|
248
251
|
D
|
|
249
252
|
]);
|
|
250
|
-
let
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}, [
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
|
|
253
|
+
let Yn = yn ? null : Fn;
|
|
254
|
+
y(() => {
|
|
255
|
+
Yn && D(Ne.ApplicationStatusShown, { view: Yn });
|
|
256
|
+
}, [Yn, D]);
|
|
257
|
+
let Xn = x(J), Zn = x(lt);
|
|
258
|
+
Zn.current = lt;
|
|
259
|
+
let Qn = x(xt);
|
|
260
|
+
Qn.current = xt, y(() => {
|
|
258
261
|
if (!K || G) return;
|
|
259
|
-
let e =
|
|
260
|
-
|
|
262
|
+
let e = Xn.current !== null;
|
|
263
|
+
Xn.current = J, e && J === null && W === pe.Form && Zn.current?.();
|
|
261
264
|
}, [
|
|
262
265
|
W,
|
|
263
266
|
G,
|
|
264
267
|
K,
|
|
265
268
|
J
|
|
266
|
-
]),
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
|
|
269
|
+
]), y(() => {
|
|
270
|
+
Hn === "requested" && Qn.current();
|
|
271
|
+
}, [Hn]), y(() => {
|
|
272
|
+
st?.(G || z === null ? null : {
|
|
270
273
|
applicationId: z,
|
|
271
|
-
authEpoch:
|
|
274
|
+
authEpoch: qt
|
|
272
275
|
});
|
|
273
276
|
}, [
|
|
274
|
-
|
|
277
|
+
st,
|
|
275
278
|
G,
|
|
276
279
|
z,
|
|
277
|
-
|
|
280
|
+
qt
|
|
278
281
|
]);
|
|
279
|
-
let
|
|
280
|
-
if (
|
|
282
|
+
let $n = x(ht);
|
|
283
|
+
if ($n.current = ht, !k) return null;
|
|
281
284
|
if (!G) {
|
|
282
|
-
if (
|
|
285
|
+
if (In && !J || Kn || !K) return null;
|
|
283
286
|
if (J) {
|
|
284
|
-
if (
|
|
285
|
-
let t =
|
|
287
|
+
if (yn) return null;
|
|
288
|
+
let t = me(J, U, k.bankName?.trim() || O.fallbackBankName, O.applicationStatus), n = /* @__PURE__ */ C(le, {
|
|
286
289
|
...t,
|
|
287
290
|
className: "ttw:max-w-2xl",
|
|
288
291
|
focusTitleOnMount: E,
|
|
289
292
|
testIds: {
|
|
290
|
-
root:
|
|
291
|
-
chip:
|
|
293
|
+
root: h.statusCard,
|
|
294
|
+
chip: h.statusCardChip
|
|
292
295
|
},
|
|
293
|
-
action:
|
|
296
|
+
action: pt ? /* @__PURE__ */ C(e, {
|
|
294
297
|
variant: "outline",
|
|
295
|
-
onClick: Y ? () =>
|
|
296
|
-
"data-testid":
|
|
298
|
+
onClick: Y ? () => Un("requested") : vn.refetch,
|
|
299
|
+
"data-testid": h.statusCardCheckAgain,
|
|
297
300
|
children: O.applicationStatus.checkAgain
|
|
298
301
|
}) : void 0
|
|
299
302
|
});
|
|
300
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ Je("div", {
|
|
301
304
|
className: Qe,
|
|
302
|
-
children: [n, E ? /* @__PURE__ */
|
|
305
|
+
children: [n, E ? /* @__PURE__ */ C(ot, { callback: ut }) : null]
|
|
303
306
|
});
|
|
304
307
|
}
|
|
305
308
|
}
|
|
306
|
-
let
|
|
309
|
+
let X = j.companyStructure === "SOLE_PROPRIETORSHIP", er = j.companyStructure !== "" && !X, tr = er ? Rt : Ze, Z = R && {
|
|
307
310
|
...R,
|
|
308
311
|
ownsOver25Percent: M.ownsOver25Percent,
|
|
309
312
|
ownershipPercentage: M.ownershipPercentage
|
|
310
|
-
},
|
|
313
|
+
}, nr = [
|
|
311
314
|
O.stepIndicator.personal,
|
|
312
315
|
O.stepIndicator.business,
|
|
313
316
|
O.stepIndicator.review,
|
|
314
317
|
O.stepIndicator.terms
|
|
315
|
-
],
|
|
316
|
-
|
|
318
|
+
], rr = R !== null && L !== null && tr !== null, ir = A === T.personal ? R !== null : A === T.business ? L !== null && tr !== null : A === T.review ? rr : rr && xe(j), Q = un.isPending || V.isPending || dn.isPending || fn.isPending || on, ar = () => {
|
|
319
|
+
Ct((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
|
|
317
320
|
...e,
|
|
318
321
|
isAuthorized: null,
|
|
319
322
|
isCheckboxChecked: !1
|
|
320
323
|
});
|
|
321
|
-
},
|
|
322
|
-
B(null),
|
|
323
|
-
},
|
|
324
|
-
B(null),
|
|
325
|
-
},
|
|
326
|
-
B(null), A === T.review &&
|
|
327
|
-
},
|
|
328
|
-
business:
|
|
329
|
-
personal:
|
|
330
|
-
owners:
|
|
331
|
-
},
|
|
332
|
-
|
|
324
|
+
}, or = () => {
|
|
325
|
+
B(null), ar(), St(T.personal);
|
|
326
|
+
}, sr = () => {
|
|
327
|
+
B(null), ar(), St(T.business);
|
|
328
|
+
}, cr = () => {
|
|
329
|
+
B(null), A === T.review && ar(), I && P(tt(N, I)), St((e) => e === T.personal ? e : e - 1);
|
|
330
|
+
}, $ = {
|
|
331
|
+
business: g(j) !== g(F.business),
|
|
332
|
+
personal: g(M) !== g(F.personal),
|
|
333
|
+
owners: g(nt(j.companyStructure === "SOLE_PROPRIETORSHIP" ? Ze : tt(N, I))) !== g(nt(F.owners))
|
|
334
|
+
}, lr = $.business || $.personal || $.owners, ur = async (e) => {
|
|
335
|
+
sn(!0);
|
|
333
336
|
let t = new AbortController();
|
|
334
|
-
|
|
337
|
+
En.current = t;
|
|
335
338
|
let n = !1;
|
|
336
339
|
try {
|
|
337
|
-
let r = await
|
|
340
|
+
let r = await dn.mutateAsync({ path: { id: e } });
|
|
338
341
|
if (t.signal.aborted) return;
|
|
339
342
|
if (!r.id) throw Error(O.submitFailedError);
|
|
340
|
-
if (n = !0, (await
|
|
341
|
-
let e =
|
|
342
|
-
if (e === void 0 && (e = (await
|
|
343
|
+
if (n = !0, (await pn(e, { signal: t.signal })).status === "complete") {
|
|
344
|
+
let e = hn;
|
|
345
|
+
if (e === void 0 && (e = (await gn()).data), t.signal.aborted) return;
|
|
343
346
|
if (e !== void 0) try {
|
|
344
|
-
await
|
|
347
|
+
await _n({ displayedVersion: a(e)?.disclosureId ?? null });
|
|
345
348
|
} catch {}
|
|
346
349
|
if (t.signal.aborted) return;
|
|
347
|
-
|
|
348
|
-
} else
|
|
350
|
+
ln("success"), xt(), bt();
|
|
351
|
+
} else ln("pending");
|
|
349
352
|
} catch (e) {
|
|
350
353
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
351
354
|
if (!n) throw e;
|
|
352
|
-
|
|
355
|
+
ln("pending");
|
|
353
356
|
} finally {
|
|
354
|
-
|
|
357
|
+
En.current = null, sn(!1);
|
|
355
358
|
}
|
|
356
|
-
},
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
},
|
|
359
|
+
}, dr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
360
|
+
Ct((t) => (t.taxIdOnFileLast4 || e) && w(t.taxId) ? $e(t) : t);
|
|
361
|
+
}, fr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
362
|
+
wt((t) => (t.ssnOnFileLast4 || e) && w(t.ssn) ? et(t) : t);
|
|
363
|
+
}, pr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
361
364
|
P((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && w(t.ssn) ? et(t) : t));
|
|
362
|
-
},
|
|
363
|
-
P((e) => e.map(
|
|
364
|
-
},
|
|
365
|
-
let t =
|
|
366
|
-
return
|
|
367
|
-
},
|
|
365
|
+
}, mr = () => {
|
|
366
|
+
P((e) => e.map(Fe));
|
|
367
|
+
}, hr = async (e) => {
|
|
368
|
+
let t = $n.current, n = await un.mutateAsync({ body: Me(e, M) });
|
|
369
|
+
return Bt(n.id), Jt(t), n.clientSecret && mn(n.id, n.clientSecret), n.id;
|
|
370
|
+
}, gr = async () => {
|
|
368
371
|
if (A === T.personal) {
|
|
369
|
-
if (!
|
|
372
|
+
if (!Z) return null;
|
|
370
373
|
let e = F.business.companyStructure === "SOLE_PROPRIETORSHIP", t = z;
|
|
371
374
|
return t ? await V.mutateAsync({
|
|
372
375
|
path: { id: t },
|
|
373
|
-
body:
|
|
374
|
-
applicant:
|
|
376
|
+
body: Oe({
|
|
377
|
+
applicant: Z,
|
|
375
378
|
isSoleProprietor: e
|
|
376
379
|
})
|
|
377
|
-
}) : t = await
|
|
378
|
-
applicant:
|
|
380
|
+
}) : t = await hr(De({
|
|
381
|
+
applicant: Z,
|
|
379
382
|
isSoleProprietor: e
|
|
380
|
-
})),
|
|
383
|
+
})), Gt({ ssn: Z.ssn }), fr(), Ot(["personal"]), t;
|
|
381
384
|
}
|
|
382
385
|
if (A === T.business) {
|
|
383
|
-
if (!
|
|
386
|
+
if (!Z || !L || !tr) return null;
|
|
384
387
|
let e = {
|
|
385
388
|
businessDetails: L,
|
|
386
|
-
applicant:
|
|
387
|
-
businessOwners:
|
|
389
|
+
applicant: Z,
|
|
390
|
+
businessOwners: tr
|
|
388
391
|
}, t = z;
|
|
389
392
|
return t ? await V.mutateAsync({
|
|
390
393
|
path: { id: t },
|
|
391
|
-
body:
|
|
392
|
-
}) : t = await
|
|
394
|
+
body: Oe(e)
|
|
395
|
+
}) : t = await hr(Oe(e)), Gt({
|
|
393
396
|
taxId: L.taxId,
|
|
394
397
|
taxIdStructure: L.companyStructure,
|
|
395
|
-
ssn:
|
|
396
|
-
}),
|
|
398
|
+
ssn: Z.ssn
|
|
399
|
+
}), dr(), fr(), X ? mr() : pr(), Ot([
|
|
397
400
|
"business",
|
|
398
401
|
"personal",
|
|
399
402
|
"owners"
|
|
400
|
-
], { ownersCleared:
|
|
403
|
+
], { ownersCleared: X }), Ht({
|
|
404
|
+
business: !0,
|
|
405
|
+
owners: !0
|
|
406
|
+
}), t;
|
|
401
407
|
}
|
|
402
|
-
return A === T.review ?
|
|
408
|
+
return A === T.review ? rr ? z : null : !z || !xe(j) ? null : (await V.mutateAsync({
|
|
403
409
|
path: { id: z },
|
|
404
|
-
body:
|
|
410
|
+
body: Oe({ consent: {
|
|
405
411
|
isLegallyAuthorized: !0,
|
|
406
412
|
hasAcceptedDisclosures: !0
|
|
407
413
|
} })
|
|
408
|
-
}),
|
|
409
|
-
},
|
|
410
|
-
if (B(null), !
|
|
411
|
-
|
|
414
|
+
}), Ot(["business"]), z);
|
|
415
|
+
}, _r = async () => {
|
|
416
|
+
if (B(null), !ir) {
|
|
417
|
+
Zt(A), $t((e) => e + 1);
|
|
412
418
|
return;
|
|
413
419
|
}
|
|
414
420
|
let e;
|
|
415
421
|
try {
|
|
416
|
-
e = await
|
|
422
|
+
e = await gr();
|
|
417
423
|
} catch {
|
|
418
424
|
B(O.genericRetryError);
|
|
419
425
|
return;
|
|
420
426
|
}
|
|
421
427
|
if (e !== null) {
|
|
422
|
-
if (
|
|
423
|
-
await
|
|
428
|
+
if (Zt(null), A === T.terms) try {
|
|
429
|
+
await ur(e);
|
|
424
430
|
} catch {
|
|
425
431
|
B(O.submitFailedError);
|
|
426
432
|
}
|
|
427
|
-
else
|
|
433
|
+
else St(A + 1);
|
|
428
434
|
}
|
|
429
|
-
},
|
|
430
|
-
B(null),
|
|
435
|
+
}, vr = async () => {
|
|
436
|
+
B(null), nn(!0);
|
|
431
437
|
try {
|
|
432
|
-
if (await
|
|
433
|
-
|
|
438
|
+
if (await gr() === null) return;
|
|
439
|
+
fr({ evenWithoutMarker: !0 }), A >= T.business && (dr({ evenWithoutMarker: !0 }), pr({ evenWithoutMarker: !0 })), n.success(O.applicationSavedToast);
|
|
434
440
|
} catch {
|
|
435
441
|
n.error(O.genericRetryError);
|
|
436
442
|
} finally {
|
|
437
|
-
|
|
443
|
+
nn(!1);
|
|
438
444
|
}
|
|
439
|
-
},
|
|
440
|
-
let e = tt(N, I), t =
|
|
445
|
+
}, yr = async () => {
|
|
446
|
+
let e = tt(N, I), t = {
|
|
447
|
+
...$,
|
|
448
|
+
business: $.business || z !== null && !Vt.business,
|
|
449
|
+
owners: $.owners || z !== null && !Vt.owners
|
|
450
|
+
}, r = je({
|
|
441
451
|
businessDetails: j,
|
|
442
452
|
applicant: M,
|
|
443
453
|
businessOwners: e,
|
|
444
454
|
savedBusinessDetails: F.business,
|
|
445
455
|
savedOwners: F.owners,
|
|
446
|
-
dirty:
|
|
447
|
-
})
|
|
448
|
-
|
|
456
|
+
dirty: t
|
|
457
|
+
});
|
|
458
|
+
Ft(!0);
|
|
449
459
|
try {
|
|
450
|
-
if (!
|
|
460
|
+
if (!r) {
|
|
461
|
+
if (!lr) {
|
|
462
|
+
n.success(O.applicationSavedToast);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
451
465
|
n.error(O.saveDraftNothingValidError);
|
|
452
466
|
return;
|
|
453
467
|
}
|
|
454
468
|
z ? await V.mutateAsync({
|
|
455
469
|
path: { id: z },
|
|
456
|
-
body:
|
|
457
|
-
}) : await
|
|
458
|
-
let i =
|
|
459
|
-
|
|
470
|
+
body: r
|
|
471
|
+
}) : await hr(Ae(r)), I && P(e), n.success(O.applicationSavedToast);
|
|
472
|
+
let i = r;
|
|
473
|
+
Gt({
|
|
460
474
|
taxId: i.businessDetails?.taxId?.value,
|
|
461
475
|
taxIdStructure: j.companyStructure,
|
|
462
476
|
ssn: i.applicant?.personalIdentificationNumber?.value
|
|
463
|
-
}), i.businessDetails?.taxId !== void 0 &&
|
|
477
|
+
}), i.businessDetails?.taxId !== void 0 && dr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && fr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && pr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && mr(), Ht((e) => ({
|
|
478
|
+
business: e.business || i.businessDetails !== void 0,
|
|
479
|
+
owners: e.owners || i.businessOwners !== void 0
|
|
480
|
+
}));
|
|
464
481
|
let a = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
|
|
465
|
-
|
|
482
|
+
Dt({ next: (e, n) => ke({
|
|
466
483
|
current: e,
|
|
467
|
-
saved:
|
|
468
|
-
dirty:
|
|
484
|
+
saved: n,
|
|
485
|
+
dirty: t,
|
|
469
486
|
ownersWrite: a
|
|
470
|
-
}) }),
|
|
487
|
+
}) }), kt(null), jt((e) => e + 1);
|
|
471
488
|
} catch {
|
|
472
489
|
n.error(O.genericRetryError);
|
|
473
490
|
} finally {
|
|
474
|
-
|
|
491
|
+
Ft(!1);
|
|
475
492
|
}
|
|
476
|
-
},
|
|
493
|
+
}, br = async () => {
|
|
477
494
|
if (z !== null) try {
|
|
478
|
-
await
|
|
495
|
+
await fn.mutateAsync({ path: { id: z } });
|
|
479
496
|
} catch {
|
|
480
497
|
n.error(O.deleteFailedError);
|
|
481
498
|
return;
|
|
482
499
|
}
|
|
483
|
-
|
|
484
|
-
},
|
|
500
|
+
an(!1), ct?.();
|
|
501
|
+
}, xr = at(A, O), Sr = k.bankName?.trim() || O.fallbackBankName, Cr = ce(O.shellFdicDisclaimer, Sr);
|
|
485
502
|
if (G) {
|
|
486
|
-
let e = L?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n =
|
|
487
|
-
...
|
|
503
|
+
let e = L?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n = cn ?? "pending", r = n === "success", i = {
|
|
504
|
+
...m.result,
|
|
488
505
|
...O.result
|
|
489
|
-
}, a = /* @__PURE__ */
|
|
506
|
+
}, a = /* @__PURE__ */ C(ue, {
|
|
490
507
|
testIds: {
|
|
491
|
-
processing:
|
|
492
|
-
dashboardButton:
|
|
508
|
+
processing: h.resultProcessing,
|
|
509
|
+
dashboardButton: h.resultDashboardButton
|
|
493
510
|
},
|
|
494
511
|
status: n,
|
|
495
|
-
isLoading:
|
|
512
|
+
isLoading: on,
|
|
496
513
|
loadingMessage: i.loadingMessage,
|
|
497
514
|
headingLine1: r ? i.successHeadingLine1 : i.pendingHeadingLine1,
|
|
498
515
|
headingLine2: `${e}!`,
|
|
@@ -500,165 +517,165 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: te, onNavigateToDashboa
|
|
|
500
517
|
followUpEmail: R?.workEmail ?? "",
|
|
501
518
|
emailBoxLead: i.pendingEmailBoxLead,
|
|
502
519
|
navigateToDashboardLabel: i.navigateToDashboard,
|
|
503
|
-
bankLogoSrc:
|
|
504
|
-
bankLogoAlt:
|
|
505
|
-
fdicDisclaimer:
|
|
506
|
-
onNavigateToDashboard:
|
|
520
|
+
bankLogoSrc: dt,
|
|
521
|
+
bankLogoAlt: ce(i.bankLogoAlt, t),
|
|
522
|
+
fdicDisclaimer: ce(i.fdicDisclaimer, t),
|
|
523
|
+
onNavigateToDashboard: fe
|
|
507
524
|
});
|
|
508
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ C("div", {
|
|
509
526
|
className: "ttw:grid ttw:w-full ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
|
|
510
527
|
children: a
|
|
511
528
|
});
|
|
512
529
|
}
|
|
513
|
-
let
|
|
514
|
-
return /* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
title:
|
|
517
|
-
subtitle:
|
|
530
|
+
let wr = A === T.personal ? O.nextToStep.business : A === T.business ? O.nextToStep.review : A === T.review ? O.nextToStep.terms : O.submit, Tr = A === T.business ? O.backToStepAriaLabel.personal : A === T.review ? O.backToStepAriaLabel.business : A === T.terms ? O.backToStepAriaLabel.review : void 0, Er = Q, Dr = Xt === A, Or = ir ? vr : yr, kr = Q || Pt || !ir && !lr && z === null, Ar = `${M.firstName} ${M.lastName}`.trim(), jr = X ? 100 : M.ownsOver25Percent === !0 ? M.ownershipPercentage ?? 0 : 0, Mr = j.companyDbaName.trim() || j.companyLegalName.trim(), Nr = X ? Ze : N, Pr = Xt === T.business && A === T.business && Nr.some((e) => !e.reviewed) ? O.ownersNeedReviewError : null;
|
|
531
|
+
return /* @__PURE__ */ Je(qe, { children: [
|
|
532
|
+
/* @__PURE__ */ C(ee, {
|
|
533
|
+
title: xr.title,
|
|
534
|
+
subtitle: xr.subtitle,
|
|
518
535
|
focusTitleOnMount: E,
|
|
519
|
-
stepLabels:
|
|
536
|
+
stepLabels: nr,
|
|
520
537
|
activeStep: A,
|
|
521
|
-
disclaimerText:
|
|
522
|
-
onBack:
|
|
538
|
+
disclaimerText: Cr,
|
|
539
|
+
onBack: cr,
|
|
523
540
|
showBackButton: A !== T.personal,
|
|
524
|
-
backAriaLabel:
|
|
525
|
-
onNext:
|
|
526
|
-
onSaveAndClose:
|
|
527
|
-
onDelete: () =>
|
|
528
|
-
isNextDisabled:
|
|
529
|
-
isNextLoading:
|
|
530
|
-
isSaveAndCloseDisabled:
|
|
531
|
-
isSaveAndCloseLoading:
|
|
532
|
-
nextLabel:
|
|
541
|
+
backAriaLabel: Tr,
|
|
542
|
+
onNext: _r,
|
|
543
|
+
onSaveAndClose: Or,
|
|
544
|
+
onDelete: () => an(!0),
|
|
545
|
+
isNextDisabled: Er,
|
|
546
|
+
isNextLoading: Q && !tn,
|
|
547
|
+
isSaveAndCloseDisabled: kr,
|
|
548
|
+
isSaveAndCloseLoading: tn || Pt,
|
|
549
|
+
nextLabel: wr,
|
|
533
550
|
nextIcon: null,
|
|
534
551
|
nextTone: A === T.terms ? "success" : "primary",
|
|
535
552
|
isTitleVisuallyHidden: A === T.terms,
|
|
536
|
-
errorMessage:
|
|
553
|
+
errorMessage: Yt,
|
|
537
554
|
labels: {
|
|
538
555
|
backButton: O.back,
|
|
539
556
|
saveAndCloseButton: O.saveAndClose,
|
|
540
557
|
deleteButton: O.deleteApplication
|
|
541
558
|
},
|
|
542
559
|
testIds: {
|
|
543
|
-
root:
|
|
544
|
-
back:
|
|
545
|
-
saveAndClose:
|
|
546
|
-
delete:
|
|
547
|
-
next:
|
|
560
|
+
root: h.shell,
|
|
561
|
+
back: h.shellBack,
|
|
562
|
+
saveAndClose: h.shellSaveAndClose,
|
|
563
|
+
delete: h.shellDelete,
|
|
564
|
+
next: h.shellNext,
|
|
548
565
|
scrollRegion: {
|
|
549
|
-
root:
|
|
550
|
-
fade:
|
|
566
|
+
root: h.shellScrollRegion,
|
|
567
|
+
fade: h.shellScrollFade
|
|
551
568
|
}
|
|
552
569
|
},
|
|
553
|
-
children: /* @__PURE__ */
|
|
554
|
-
ref:
|
|
570
|
+
children: /* @__PURE__ */ Je("div", {
|
|
571
|
+
ref: en,
|
|
555
572
|
className: "ttw:contents",
|
|
556
573
|
children: [
|
|
557
|
-
A === T.personal ? /* @__PURE__ */
|
|
574
|
+
A === T.personal ? /* @__PURE__ */ C("div", {
|
|
558
575
|
className: "ttw:max-w-2xl",
|
|
559
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ C(Ce, {
|
|
560
577
|
value: M,
|
|
561
|
-
onValueChange:
|
|
562
|
-
onSnapshotChange:
|
|
563
|
-
stateOptions:
|
|
564
|
-
isSubmitting:
|
|
565
|
-
showAllErrors:
|
|
578
|
+
onValueChange: wt,
|
|
579
|
+
onSnapshotChange: Lt,
|
|
580
|
+
stateOptions: kn,
|
|
581
|
+
isSubmitting: Q,
|
|
582
|
+
showAllErrors: Dr,
|
|
566
583
|
labels: O.personalDetails
|
|
567
584
|
}, "personal")
|
|
568
585
|
}) : null,
|
|
569
|
-
A === T.business ? /* @__PURE__ */
|
|
586
|
+
A === T.business ? /* @__PURE__ */ Je("div", {
|
|
570
587
|
className: "ttw:flex ttw:max-w-2xl ttw:flex-col ttw:gap-10",
|
|
571
|
-
children: [/* @__PURE__ */
|
|
588
|
+
children: [/* @__PURE__ */ C(Se, {
|
|
572
589
|
value: j,
|
|
573
|
-
onValueChange:
|
|
574
|
-
onSnapshotChange:
|
|
575
|
-
naicsOptions:
|
|
576
|
-
stateOptions:
|
|
577
|
-
isSubmitting:
|
|
578
|
-
showAllErrors:
|
|
590
|
+
onValueChange: Kt,
|
|
591
|
+
onSnapshotChange: It,
|
|
592
|
+
naicsOptions: Dn,
|
|
593
|
+
stateOptions: On,
|
|
594
|
+
isSubmitting: Q,
|
|
595
|
+
showAllErrors: Dr,
|
|
579
596
|
labels: O.businessDetails
|
|
580
|
-
}, "business"),
|
|
581
|
-
owners:
|
|
597
|
+
}, "business"), er ? /* @__PURE__ */ Je(qe, { children: [/* @__PURE__ */ C(t, {}), /* @__PURE__ */ C(Ee, {
|
|
598
|
+
owners: Nr,
|
|
582
599
|
onOwnersChange: P,
|
|
583
|
-
primaryOwnerName:
|
|
600
|
+
primaryOwnerName: Ar,
|
|
584
601
|
applicantOwnership: {
|
|
585
602
|
ownsOver25Percent: M.ownsOver25Percent,
|
|
586
603
|
ownershipPercentage: M.ownershipPercentage
|
|
587
604
|
},
|
|
588
|
-
onApplicantOwnershipChange: (e) =>
|
|
605
|
+
onApplicantOwnershipChange: (e) => wt((t) => ({
|
|
589
606
|
...t,
|
|
590
607
|
...e
|
|
591
608
|
})),
|
|
592
|
-
applicantOwnershipBaseline:
|
|
593
|
-
onApplicantOwnershipBaselineChange:
|
|
594
|
-
businessName:
|
|
609
|
+
applicantOwnershipBaseline: Mt,
|
|
610
|
+
onApplicantOwnershipBaselineChange: Nt,
|
|
611
|
+
businessName: Mr,
|
|
595
612
|
applicantPersonalDetails: M,
|
|
596
|
-
onEditPersonalDetails:
|
|
597
|
-
stateOptions:
|
|
598
|
-
onSnapshotChange:
|
|
599
|
-
onPendingOwnerChange:
|
|
600
|
-
isSubmitting:
|
|
601
|
-
showAllErrors:
|
|
602
|
-
revealErrorsAttempt:
|
|
603
|
-
reviewError:
|
|
613
|
+
onEditPersonalDetails: or,
|
|
614
|
+
stateOptions: An,
|
|
615
|
+
onSnapshotChange: zt,
|
|
616
|
+
onPendingOwnerChange: kt,
|
|
617
|
+
isSubmitting: Q,
|
|
618
|
+
showAllErrors: Dr,
|
|
619
|
+
revealErrorsAttempt: Qt,
|
|
620
|
+
reviewError: Pr,
|
|
604
621
|
labels: O.additionalOwners
|
|
605
|
-
},
|
|
622
|
+
}, At)] }) : null]
|
|
606
623
|
}) : null,
|
|
607
|
-
A === T.review ? /* @__PURE__ */
|
|
624
|
+
A === T.review ? /* @__PURE__ */ C("div", {
|
|
608
625
|
className: "ttw:max-w-2xl",
|
|
609
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ C(we, {
|
|
610
627
|
personalDetails: M,
|
|
611
628
|
businessDetails: j,
|
|
612
|
-
additionalOwners:
|
|
613
|
-
primaryOwnerName:
|
|
614
|
-
primaryOwnerPercentage:
|
|
615
|
-
isSoleProprietor:
|
|
616
|
-
personalStateOptions:
|
|
617
|
-
businessStateOptions:
|
|
618
|
-
naicsOptions:
|
|
619
|
-
onEditPersonal:
|
|
620
|
-
onEditBusiness:
|
|
629
|
+
additionalOwners: Nr,
|
|
630
|
+
primaryOwnerName: Ar,
|
|
631
|
+
primaryOwnerPercentage: jr,
|
|
632
|
+
isSoleProprietor: X,
|
|
633
|
+
personalStateOptions: kn,
|
|
634
|
+
businessStateOptions: On,
|
|
635
|
+
naicsOptions: Dn,
|
|
636
|
+
onEditPersonal: or,
|
|
637
|
+
onEditBusiness: sr,
|
|
621
638
|
ownersEditAriaLabel: O.reviewOwnersEditAriaLabel,
|
|
622
|
-
isSubmitting:
|
|
639
|
+
isSubmitting: Q,
|
|
623
640
|
labels: O
|
|
624
641
|
})
|
|
625
642
|
}) : null,
|
|
626
|
-
A === T.terms ? /* @__PURE__ */
|
|
643
|
+
A === T.terms ? /* @__PURE__ */ C(Te, {
|
|
627
644
|
value: j,
|
|
628
|
-
onValueChange:
|
|
629
|
-
isSubmitting:
|
|
630
|
-
showAllErrors:
|
|
645
|
+
onValueChange: Ct,
|
|
646
|
+
isSubmitting: Q,
|
|
647
|
+
showAllErrors: Dr,
|
|
631
648
|
labels: O.businessDetails,
|
|
632
|
-
bankName:
|
|
633
|
-
termsHref:
|
|
634
|
-
privacyHref:
|
|
635
|
-
electronicCommunicationHref:
|
|
636
|
-
patriotActHref:
|
|
649
|
+
bankName: Sr,
|
|
650
|
+
termsHref: gt,
|
|
651
|
+
privacyHref: _t,
|
|
652
|
+
electronicCommunicationHref: vt,
|
|
653
|
+
patriotActHref: yt
|
|
637
654
|
}) : null
|
|
638
655
|
]
|
|
639
656
|
})
|
|
640
657
|
}),
|
|
641
|
-
E ? /* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
open:
|
|
644
|
-
onConfirm:
|
|
645
|
-
onCancel: () =>
|
|
646
|
-
isDeleting:
|
|
658
|
+
E ? /* @__PURE__ */ C(ot, { callback: ut }) : null,
|
|
659
|
+
/* @__PURE__ */ C(de, {
|
|
660
|
+
open: rn,
|
|
661
|
+
onConfirm: br,
|
|
662
|
+
onCancel: () => an(!1),
|
|
663
|
+
isDeleting: fn.isPending,
|
|
647
664
|
labels: {
|
|
648
665
|
descriptionEmphasis: O.saveAndClose,
|
|
649
666
|
...O.deleteApplicationDialog
|
|
650
667
|
},
|
|
651
668
|
testIds: {
|
|
652
|
-
root:
|
|
653
|
-
confirm:
|
|
654
|
-
cancel:
|
|
669
|
+
root: h.deleteDialog,
|
|
670
|
+
confirm: h.deleteDialogConfirm,
|
|
671
|
+
cancel: h.deleteDialogCancel
|
|
655
672
|
}
|
|
656
673
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ C(d, {})
|
|
658
675
|
] });
|
|
659
676
|
}
|
|
660
677
|
function ct({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: s, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: d, ...ee }) {
|
|
661
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ C(p, {
|
|
662
679
|
baseUrl: e,
|
|
663
680
|
widgetToken: t,
|
|
664
681
|
organizationId: n,
|
|
@@ -671,55 +688,55 @@ function ct({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
|
|
|
671
688
|
analytics: l,
|
|
672
689
|
disclosuresAcceptance: u,
|
|
673
690
|
providerLabels: d,
|
|
674
|
-
widgetName:
|
|
675
|
-
children: /* @__PURE__ */
|
|
691
|
+
widgetName: Pe,
|
|
692
|
+
children: /* @__PURE__ */ C(lt, { ...ee })
|
|
676
693
|
});
|
|
677
694
|
}
|
|
678
|
-
function
|
|
679
|
-
let { initResponse: t } =
|
|
695
|
+
function lt(e) {
|
|
696
|
+
let { initResponse: t } = ne(), { client: n } = i(), r = t?.userId ?? null, [a, o] = S(r), [s, c] = S(0);
|
|
680
697
|
r !== a && (o(r), a !== null && r !== null && c((e) => e + 1));
|
|
681
|
-
let [l, u] =
|
|
682
|
-
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */
|
|
698
|
+
let [l, u] = S(n);
|
|
699
|
+
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ C(E, { ...e }, s);
|
|
683
700
|
}
|
|
684
|
-
function
|
|
685
|
-
let { authEpoch: t } = i(), { ownApplicationIds: n } =
|
|
701
|
+
function E(e) {
|
|
702
|
+
let { authEpoch: t } = i(), { ownApplicationIds: n } = We(), [r, a] = S(null), [o, s] = S(0), [c, l] = S(null), [u, d] = S(null), [ee, f] = S(null), p = v(() => {
|
|
686
703
|
f(null);
|
|
687
|
-
}, []),
|
|
704
|
+
}, []), te = v(() => {
|
|
688
705
|
a(null), s((e) => e + 1);
|
|
689
|
-
}, []),
|
|
706
|
+
}, []), ne = v(() => {
|
|
690
707
|
d(r?.applicationId ?? null), a(null), l(t);
|
|
691
|
-
}, [t, r]),
|
|
708
|
+
}, [t, r]), re = v(() => {
|
|
692
709
|
l(null), d(null), f(o + 1), s(o + 1);
|
|
693
710
|
}, [o]);
|
|
694
|
-
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), c !== null && t !== c && n !== null && n.some((e) => e !== u) && (l(null), d(null), f(o + 1), s(o + 1)), c === null ? /* @__PURE__ */
|
|
711
|
+
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), c !== null && t !== c && n !== null && n.some((e) => e !== u) && (l(null), d(null), f(o + 1), s(o + 1)), c === null ? /* @__PURE__ */ C(Le, { children: /* @__PURE__ */ C(dt, {
|
|
695
712
|
...e,
|
|
696
713
|
onEditableDraftChange: a,
|
|
697
|
-
onApplicationDeleted:
|
|
698
|
-
onNoticeReplacedByForm:
|
|
714
|
+
onApplicationDeleted: ne,
|
|
715
|
+
onNoticeReplacedByForm: te,
|
|
699
716
|
focusFormOnMount: ee === o,
|
|
700
|
-
onFocusFormOnMountDone:
|
|
701
|
-
}, o) }, o) : /* @__PURE__ */
|
|
717
|
+
onFocusFormOnMountDone: p
|
|
718
|
+
}, o) }, o) : /* @__PURE__ */ C("div", {
|
|
702
719
|
className: Qe,
|
|
703
|
-
children: /* @__PURE__ */
|
|
720
|
+
children: /* @__PURE__ */ C(fe, {
|
|
704
721
|
className: "ttw:max-w-2xl",
|
|
705
|
-
onStartNewApplication:
|
|
722
|
+
onStartNewApplication: re,
|
|
706
723
|
labels: e.labels?.applicationDeleted,
|
|
707
724
|
testIds: {
|
|
708
|
-
root:
|
|
709
|
-
startNewApplication:
|
|
725
|
+
root: h.applicationDeletedScreen,
|
|
726
|
+
startNewApplication: h.applicationDeletedStartNew
|
|
710
727
|
}
|
|
711
728
|
})
|
|
712
729
|
});
|
|
713
730
|
}
|
|
714
731
|
var ut = { canRender: !1 };
|
|
715
732
|
function dt(e) {
|
|
716
|
-
let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } =
|
|
717
|
-
if (
|
|
733
|
+
let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = We(), { application: o, isResolved: s, isUnavailable: c } = Ge(n, r), [l, u] = S(null);
|
|
734
|
+
if (y(() => {
|
|
718
735
|
l?.canRender !== !0 && a && s && (c || o !== null && o.status !== void 0 && o.status !== Xe ? u(ut) : u({
|
|
719
736
|
canRender: !0,
|
|
720
737
|
applicationId: o === null ? null : n,
|
|
721
738
|
authEpoch: t,
|
|
722
|
-
prefill:
|
|
739
|
+
prefill: _(o)
|
|
723
740
|
}));
|
|
724
741
|
}, [
|
|
725
742
|
t,
|
|
@@ -730,20 +747,24 @@ function dt(e) {
|
|
|
730
747
|
o,
|
|
731
748
|
n
|
|
732
749
|
]), l === null || !l.canRender) return null;
|
|
733
|
-
let { applicationId: d, authEpoch: ee, prefill: f } = l;
|
|
734
|
-
return /* @__PURE__ */
|
|
750
|
+
let { applicationId: d, authEpoch: ee, prefill: f } = l, p = Ie(e.initialBusinessDetails);
|
|
751
|
+
return /* @__PURE__ */ C(st, {
|
|
735
752
|
...e,
|
|
736
753
|
initialApplicationId: d,
|
|
737
754
|
initialBoundAuthEpoch: ee,
|
|
755
|
+
initialWrittenSections: d === null ? void 0 : {
|
|
756
|
+
business: Object.entries(p ?? {}).every(([e, t]) => t === void 0 || f?.businessDetails !== void 0 && e in f.businessDetails),
|
|
757
|
+
owners: f?.additionalOwners !== void 0 || !e.initialAdditionalOwners?.length
|
|
758
|
+
},
|
|
738
759
|
initialBusinessDetails: {
|
|
739
|
-
...
|
|
760
|
+
...p,
|
|
740
761
|
...f?.businessDetails
|
|
741
762
|
},
|
|
742
763
|
initialPersonalDetails: {
|
|
743
|
-
...
|
|
764
|
+
...Ie(e.initialPersonalDetails),
|
|
744
765
|
...f?.personalDetails
|
|
745
766
|
},
|
|
746
|
-
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(
|
|
767
|
+
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Fe)
|
|
747
768
|
});
|
|
748
769
|
}
|
|
749
770
|
export { ct as BankAccountOnboardingWidget, ct as default, c as OnboardingSuppressionReason };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.33", n = "02894d554b0866f41be8cb6b5a8683886caf6e74", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|