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