@tesouro/embedded-components-react 0.11.222 → 0.11.224

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