@tesouro/embedded-components-react 0.5.2 → 0.5.3

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 (26) hide show
  1. package/README.md +15 -2
  2. package/dist/index.d.ts +120 -100
  3. package/dist/index.js +6 -3
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +214 -246
  5. package/dist/lib/MarketingWidget.d.ts +684 -0
  6. package/dist/lib/MarketingWidget.js +4 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +9 -8
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +0 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +183 -205
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +1 -4
  11. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +3 -0
  12. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js +8 -0
  13. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index26.js → marketing-widget/feature/dist/index3.js} +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +81 -0
  15. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +4 -0
  16. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index24.js → marketing-widget/ui/dist/index2.js} +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index25.js → marketing-widget/ui/dist/index3.js} +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index27.js → marketing-widget/ui/dist/index4.js} +36 -37
  19. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js +75 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +24 -22
  21. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index9.js → shared/data-access/dist/lib/onboardingSuppressionReason.js} +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index10.js → shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js} +5 -6
  23. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -0
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/package.json +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +0 -75
@@ -1,9 +1,10 @@
1
- import { ApplicationClientSecretProvider as e, useApplicationClientSecret as t } from "./index2.js";
1
+ import { OnboardingSuppressionReason as e } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
2
+ import { useOrganizationOnboardingSuppression as t } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
3
+ import "../../../shared/data-access/dist/index.js";
4
+ import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r } from "./index2.js";
2
5
  import "./index3.js";
3
- import { useCreateApplication as n } from "./index4.js";
4
- import { useUpdateApplication as r } from "./index6.js";
5
- import { useSubmitApplication as i } from "./index7.js";
6
- import { usePollApplicationCompletion as a } from "./index8.js";
7
- import { OnboardingSuppressionReason as o } from "./index9.js";
8
- import { useOrganizationOnboardingSuppression as s } from "./index10.js";
9
- export { e as ApplicationClientSecretProvider, o as OnboardingSuppressionReason, t as useApplicationClientSecret, n as useCreateApplication, s as useOrganizationOnboardingSuppression, a as usePollApplicationCompletion, i as useSubmitApplication, r as useUpdateApplication };
6
+ import { useCreateApplication as i } from "./index4.js";
7
+ import { useUpdateApplication as a } from "./index6.js";
8
+ import { useSubmitApplication as o } from "./index7.js";
9
+ import { usePollApplicationCompletion as s } from "./index8.js";
10
+ export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, t as useOrganizationOnboardingSuppression, s as usePollApplicationCompletion, o as useSubmitApplication, a as useUpdateApplication };
@@ -1,8 +1,6 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js
2
2
  var e = {
3
3
  Mounted: "onboarding.mounted",
4
- OpenMarketing: "onboarding_widget_open_marketing_widget",
5
- BeginOnboarding: "onboarding_widget_begin_onboarding",
6
4
  Suppressed: "onboarding.suppressed"
7
5
  }, t = "onboarding";
8
6
  //#endregion
@@ -5,38 +5,37 @@
5
5
  import { Dialog as e, DialogContent as t, DialogTitle as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { useAcceptWidgetDisclosures as r } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
7
7
  import { useDisclosuresQuery as i } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
8
+ import { OnboardingSuppressionReason as a } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
9
+ import { useOrganizationOnboardingSuppression as o } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
8
10
  import "../../../shared/data-access/dist/index.js";
9
- import { OnboardingShell as a } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
11
+ import { OnboardingShell as s } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
10
12
  import "../../../shared/ui/dist/index.js";
11
- import { useAnalyticsTrack as o } from "../../../shared/feature/dist/lib/analytics/hooks.js";
12
- import { WidgetProvider as s } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
13
- import { getStateOptions as c } from "../../../shared/util/dist/lib/usStates.js";
14
- import { extractApiErrorMessage as l } from "../../../shared/util/dist/lib/apiErrors.js";
15
- import { useRefetchWidget as ee, useWidgetConfig as u } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
16
- import { getNaicsOptions as d } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
13
+ import { useAnalyticsTrack as c } from "../../../shared/feature/dist/lib/analytics/hooks.js";
14
+ import { WidgetProvider as l } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
15
+ import { getStateOptions as u } from "../../../shared/util/dist/lib/usStates.js";
16
+ import { extractApiErrorMessage as ee } from "../../../shared/util/dist/lib/apiErrors.js";
17
+ import { useRefetchWidget as te, useWidgetConfig as d } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
+ import { getNaicsOptions as f } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
17
19
  import "../../../shared/feature/dist/index.js";
18
- import { bankAccountOnboardingTestIds as f } from "./index9.js";
19
- import { ADDITIONAL_OWNERS_LABELS_EN as p } from "../../ui/dist/index4.js";
20
+ import { bankAccountOnboardingTestIds as p } from "./index9.js";
21
+ import { ADDITIONAL_OWNERS_LABELS_EN as ne } from "../../ui/dist/index4.js";
20
22
  import { interpolateBankName as m } from "../../ui/dist/index6.js";
21
- import { ResultStep as te } from "../../ui/dist/index11.js";
22
- import { MarketingWidget as ne } from "../../ui/dist/index28.js";
23
+ import { ResultStep as re } from "../../ui/dist/index11.js";
23
24
  import "../../ui/dist/index.js";
24
- import { BusinessDetailsStep as re } from "./index10.js";
25
- import { PersonalDetailsStep as ie } from "./index12.js";
26
- import { AdditionalOwnersStep as ae } from "./index14.js";
27
- import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index15.js";
28
- import { OnboardingAnalyticsEvent as h, WIDGET_NAME as g } from "./index16.js";
29
- import { DEFAULT_LABELS as _ } from "./index17.js";
30
- import { ApplicationClientSecretProvider as ce, useApplicationClientSecret as le } from "../../data-access/dist/index2.js";
31
- import { useCreateApplication as ue } from "../../data-access/dist/index4.js";
32
- import { useUpdateApplication as de } from "../../data-access/dist/index6.js";
33
- import { useSubmitApplication as fe } from "../../data-access/dist/index7.js";
34
- import { usePollApplicationCompletion as pe } from "../../data-access/dist/index8.js";
35
- import { OnboardingSuppressionReason as v } from "../../data-access/dist/index9.js";
36
- import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
25
+ import { BusinessDetailsStep as ie } from "./index10.js";
26
+ import { PersonalDetailsStep as ae } from "./index12.js";
27
+ import { AdditionalOwnersStep as oe } from "./index14.js";
28
+ import { buildCreateApplicationBody as se, buildUpdateApplicationBody as h } from "./index15.js";
29
+ import { OnboardingAnalyticsEvent as g, WIDGET_NAME as _ } from "./index16.js";
30
+ import { DEFAULT_LABELS as v } from "./index17.js";
31
+ import { ApplicationClientSecretProvider as y, useApplicationClientSecret as ce } from "../../data-access/dist/index2.js";
32
+ import { useCreateApplication as le } from "../../data-access/dist/index4.js";
33
+ import { useUpdateApplication as ue } from "../../data-access/dist/index6.js";
34
+ import { useSubmitApplication as de } from "../../data-access/dist/index7.js";
35
+ import { usePollApplicationCompletion as fe } from "../../data-access/dist/index8.js";
37
36
  import "../../data-access/dist/index.js";
38
- import { useCallback as y, useEffect as b, useMemo as x, useRef as he, useState as S } from "react";
39
- import { Fragment as ge, jsx as C, jsxs as w } from "react/jsx-runtime";
37
+ import { useCallback as pe, useEffect as b, useMemo as x, useRef as me, useState as S } from "react";
38
+ import { Fragment as he, jsx as C, jsxs as ge } from "react/jsx-runtime";
40
39
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js
41
40
  var _e = {
42
41
  companyLegalName: "",
@@ -76,7 +75,7 @@ function ye(e, t) {
76
75
  subtitle: t.personalReviewSubtitle
77
76
  };
78
77
  let n = {
79
- ...p,
78
+ ...ne,
80
79
  ...t.additionalOwners
81
80
  };
82
81
  return {
@@ -84,239 +83,218 @@ function ye(e, t) {
84
83
  subtitle: n.subheading
85
84
  };
86
85
  }
87
- function be({ onEmbeddedOnboardingCompletedSuccessfully: s, onNavigateToDashboard: p, labels: g, initialBusinessDetails: ce, initialPersonalDetails: be, initialAdditionalOwners: T, bankLogoSrc: xe, disclosureLinks: Se, marketingContent: E = null, open: D, defaultOpen: Ce, onOpenChange: we }) {
88
- let O = o();
86
+ function w({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard: ne, labels: _, initialBusinessDetails: y, initialPersonalDetails: w, initialAdditionalOwners: T, bankLogoSrc: E, disclosureLinks: be, open: D, defaultOpen: O, onOpenChange: k }) {
87
+ let A = c();
89
88
  b(() => {
90
- O(h.Mounted);
91
- }, [O]);
92
- let k = {
89
+ A(g.Mounted);
90
+ }, [A]);
91
+ let j = {
92
+ ...v,
93
93
  ..._,
94
- ...g,
95
94
  stepIndicator: {
96
- ..._.stepIndicator,
97
- ...g?.stepIndicator
95
+ ...v.stepIndicator,
96
+ ..._?.stepIndicator
98
97
  },
99
- businessDetails: g?.businessDetails ?? {},
100
- personalDetails: g?.personalDetails ?? {},
101
- additionalOwners: g?.additionalOwners ?? {},
98
+ businessDetails: _?.businessDetails ?? {},
99
+ personalDetails: _?.personalDetails ?? {},
100
+ additionalOwners: _?.additionalOwners ?? {},
102
101
  result: {
103
- ..._.result,
104
- ...g?.result
102
+ ...v.result,
103
+ ..._?.result
105
104
  }
106
- }, A = u().initResponse, { termsHref: Te, privacyHref: Ee, electronicCommunicationHref: De, patriotActHref: Oe } = Se ?? {}, ke = E !== null, j = D === void 0, [Ae, M] = S(!1), [je, Me] = S(!0), [Ne, Pe] = S(() => Ce ?? !1), Fe = xe ?? E?.bankLogoSrc ?? void 0, Ie = j ? Ne : D, Le = Ce ?? !1, N = y((e) => {
107
- j && Pe(e), we?.(e);
108
- }, [we, j]), Re = y(() => {
109
- O(h.OpenMarketing), M(!0);
110
- }, [O]), ze = y(() => {
111
- M(!1);
112
- }, []), Be = y(() => {
113
- O(h.BeginOnboarding), M(!1), N(!0);
114
- }, [N, O]), Ve = y(() => {
115
- Me(!1), s();
116
- }, [s]), He = ee(), [P, F] = S(0), [Ue, We] = S(() => ({
105
+ }, M = d().initResponse, { termsHref: xe, privacyHref: Se, electronicCommunicationHref: Ce, patriotActHref: we } = be ?? {}, N = D === void 0, [Te, Ee] = S(() => O ?? !1), P = N ? Te : D, De = O ?? !1, F = pe((e) => {
106
+ N && Ee(e), k?.(e);
107
+ }, [k, N]), Oe = pe(() => {
108
+ l();
109
+ }, [l]), ke = te(), [I, L] = S(0), [Ae, je] = S(() => ({
117
110
  ..._e,
118
- ...ce
119
- })), [I, Ge] = S(() => ({
111
+ ...y
112
+ })), [R, Me] = S(() => ({
120
113
  ...ve,
121
- ...be
122
- })), [Ke, qe] = S(() => T ?? []), [L, Je] = S(null), [R, Ye] = S(null), [z, Xe] = S(null), [B, Ze] = S(null), [Qe, V] = S(null), [H, U] = S(!1), [W, G] = S(null), K = ue(), q = de(), $e = fe(), et = pe(), { setClientSecret: tt } = le(), { data: nt, refetch: rt } = i(), { mutateAsync: it } = r(), J = me(), Y = he(null);
123
- b(() => () => Y.current?.abort(), []);
124
- let at = x(() => d(k.businessDetails.naicsTitles), [k.businessDetails.naicsTitles]), ot = x(() => c(k.businessDetails.stateTitles), [k.businessDetails.stateTitles]), st = x(() => c(k.personalDetails.stateTitles), [k.personalDetails.stateTitles]), ct = x(() => c(k.additionalOwners.stateTitles), [k.additionalOwners.stateTitles]), X = H || W !== null, lt = A?.status === "ACTIVE" || A?.status === "INACTIVE", ut = A?.status === "INVITED", Z = !!A && !X && (lt || ut || J.isSuppressed), Q = Z ? lt ? v.UserAlreadyOnboarded : ut ? v.UserInvitedToOrganization : J.reason : null;
114
+ ...w
115
+ })), [Ne, Pe] = S(() => T ?? []), [z, Fe] = S(null), [B, Ie] = S(null), [V, Le] = S(null), [H, Re] = S(null), [ze, U] = S(null), [W, Be] = S(!1), [Ve, G] = S(null), He = le(), K = ue(), Ue = de(), We = fe(), { setClientSecret: Ge } = ce(), { data: Ke, refetch: qe } = i(), { mutateAsync: Je } = r(), q = o(), J = me(null);
116
+ b(() => () => J.current?.abort(), []);
117
+ let Ye = x(() => f(j.businessDetails.naicsTitles), [j.businessDetails.naicsTitles]), Xe = x(() => u(j.businessDetails.stateTitles), [j.businessDetails.stateTitles]), Ze = x(() => u(j.personalDetails.stateTitles), [j.personalDetails.stateTitles]), Qe = x(() => u(j.additionalOwners.stateTitles), [j.additionalOwners.stateTitles]), Y = W || Ve !== null, $e = M?.status === "ACTIVE" || M?.status === "INACTIVE", et = M?.status === "INVITED", X = !!M && !Y && ($e || et || q.isSuppressed), Z = X ? $e ? a.UserAlreadyOnboarded : et ? a.UserInvitedToOrganization : q.reason : null;
125
118
  if (b(() => {
126
- !Z || !Q || (O(h.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
119
+ !X || !Z || (A(g.Suppressed, { reason: Z }), console.info(`[onboarding] not shown: ${Z}`));
127
120
  }, [
121
+ X,
128
122
  Z,
129
- Q,
130
- O
131
- ]), !A || !X && (Z || !J.isResolved)) return null;
132
- let dt = L?.companyStructure === "SOLE_PROPRIETORSHIP", ft = [
133
- k.stepIndicator.business,
134
- k.stepIndicator.personal,
135
- k.stepIndicator.ownership
136
- ], pt = P === 0 ? L : P === 1 ? R : P === 2 ? z : null, $ = K.isPending || q.isPending || $e.isPending || H, mt = () => {
137
- V(null), F((e) => e === 0 ? 0 : e - 1);
138
- }, ht = () => {
139
- N(!1);
140
- }, gt = async (e) => {
141
- U(!0), N(!0);
123
+ A
124
+ ]), !M || !Y && (X || !q.isResolved)) return null;
125
+ let tt = z?.companyStructure === "SOLE_PROPRIETORSHIP", nt = [
126
+ j.stepIndicator.business,
127
+ j.stepIndicator.personal,
128
+ j.stepIndicator.ownership
129
+ ], rt = I === 0 ? z : I === 1 ? B : I === 2 ? V : null, Q = He.isPending || K.isPending || Ue.isPending || W, it = () => {
130
+ U(null), L((e) => e === 0 ? 0 : e - 1);
131
+ }, $ = () => {
132
+ F(!1);
133
+ }, at = async (e) => {
134
+ Be(!0), F(!0);
142
135
  let t = new AbortController();
143
- Y.current = t;
136
+ J.current = t;
144
137
  let n = !1;
145
138
  try {
146
- let r = await $e.mutateAsync({ path: { id: e } });
139
+ let r = await Ue.mutateAsync({ path: { id: e } });
147
140
  if (t.signal.aborted) return;
148
- if (!r.id) throw Error(k.submitFailedError);
149
- if (n = !0, (await et(e, { signal: t.signal })).status === "complete") {
150
- let e = nt;
151
- if (e === void 0 && (e = (await rt()).data), t.signal.aborted) return;
141
+ if (!r.id) throw Error(j.submitFailedError);
142
+ if (n = !0, (await We(e, { signal: t.signal })).status === "complete") {
143
+ let e = Ke;
144
+ if (e === void 0 && (e = (await qe()).data), t.signal.aborted) return;
152
145
  if (e !== void 0) try {
153
- await it({ displayedVersion: e.version ?? null });
146
+ await Je({ displayedVersion: e.version ?? null });
154
147
  } catch {}
155
148
  if (t.signal.aborted) return;
156
- G("success"), He(), Ve();
149
+ G("success"), ke(), Oe();
157
150
  } else G("pending");
158
151
  } catch (e) {
159
152
  if (e instanceof DOMException && e.name === "AbortError") return;
160
153
  if (!n) throw e;
161
154
  G("pending");
162
155
  } finally {
163
- Y.current = null, U(!1);
156
+ J.current = null, Be(!1);
164
157
  }
165
- }, _t = async () => {
166
- V(null);
158
+ }, ot = async () => {
159
+ U(null);
167
160
  try {
168
- if (P === 0) {
169
- if (!L) return;
170
- let e = B;
161
+ if (I === 0) {
162
+ if (!z) return;
163
+ let e = H;
171
164
  if (!e) {
172
- let t = await K.mutateAsync({ body: oe(L) });
173
- e = t.id, Ze(e), t.clientSecret && tt(t.clientSecret);
165
+ let t = await He.mutateAsync({ body: se(z) });
166
+ e = t.id, Re(e), t.clientSecret && Ge(t.clientSecret);
174
167
  }
175
- F(1);
176
- } else if (P === 1) {
177
- if (!R || !L || !B) return;
178
- await q.mutateAsync({
179
- path: { id: B },
180
- body: se({
181
- businessDetails: L,
182
- applicant: R
168
+ L(1);
169
+ } else if (I === 1) {
170
+ if (!B || !z || !H) return;
171
+ await K.mutateAsync({
172
+ path: { id: H },
173
+ body: h({
174
+ businessDetails: z,
175
+ applicant: B
183
176
  })
184
- }), F(2);
185
- } else if (P === 2) {
186
- if (!z || !B) return;
187
- await q.mutateAsync({
188
- path: { id: B },
189
- body: se({ businessOwners: z })
190
- }), await gt(B);
177
+ }), L(2);
178
+ } else if (I === 2) {
179
+ if (!V || !H) return;
180
+ await K.mutateAsync({
181
+ path: { id: H },
182
+ body: h({ businessOwners: V })
183
+ }), await at(H);
191
184
  }
192
185
  } catch (e) {
193
- let t = l(e) ?? (e instanceof Error ? e.message : void 0) ?? k.genericRetryError;
194
- V(t);
186
+ let t = ee(e) ?? (e instanceof Error ? e.message : void 0) ?? j.genericRetryError;
187
+ U(t);
195
188
  }
196
- }, vt = ye(Math.min(P, 2), k), yt = A.bankName?.trim() || k.fallbackBankName, bt = m(k.shellFdicDisclaimer, yt);
197
- if (X) {
198
- let r = L?.companyLegalName ?? "", i = A.bankName?.trim() || k.fallbackBankName, a = W ?? "pending", o = a === "success", s = {
199
- ..._.result,
200
- ...k.result
189
+ }, st = ye(Math.min(I, 2), j), ct = M.bankName?.trim() || j.fallbackBankName, lt = m(j.shellFdicDisclaimer, ct);
190
+ if (Y) {
191
+ let r = z?.companyLegalName ?? "", i = M.bankName?.trim() || j.fallbackBankName, a = Ve ?? "pending", o = a === "success", s = {
192
+ ...v.result,
193
+ ...j.result
201
194
  };
202
195
  return /* @__PURE__ */ C(e, {
203
- open: Ie,
204
- onOpenChange: N,
205
- children: /* @__PURE__ */ w(t, {
196
+ open: P,
197
+ onOpenChange: F,
198
+ children: /* @__PURE__ */ ge(t, {
206
199
  className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
207
200
  children: [/* @__PURE__ */ C(n, {
208
201
  className: "ttw:sr-only",
209
- children: k.modalTitle
210
- }), /* @__PURE__ */ C(te, {
202
+ children: j.modalTitle
203
+ }), /* @__PURE__ */ C(re, {
211
204
  testIds: {
212
- processing: f.resultProcessing,
213
- dashboardButton: f.resultDashboardButton
205
+ processing: p.resultProcessing,
206
+ dashboardButton: p.resultDashboardButton
214
207
  },
215
208
  status: a,
216
- isLoading: H,
209
+ isLoading: W,
217
210
  loadingMessage: s.loadingMessage,
218
211
  headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
219
212
  headingLine2: `${r}!`,
220
213
  body: o ? s.successBody : s.pendingBody,
221
- followUpEmail: R?.workEmail ?? "",
214
+ followUpEmail: B?.workEmail ?? "",
222
215
  emailBoxLead: s.pendingEmailBoxLead,
223
216
  navigateToDashboardLabel: s.navigateToDashboard,
224
- bankLogoSrc: Fe,
217
+ bankLogoSrc: E,
225
218
  bankLogoAlt: m(s.bankLogoAlt, i),
226
219
  fdicDisclaimer: m(s.fdicDisclaimer, i),
227
- onNavigateToDashboard: p
220
+ onNavigateToDashboard: ne
228
221
  })]
229
222
  })
230
223
  });
231
224
  }
232
- let xt = P === 2 ? k.submit : k.next, St = pt === null || $;
233
- return /* @__PURE__ */ w(ge, { children: [ke && je && E ? /* @__PURE__ */ C(ne, {
234
- open: Ae,
235
- isVisible: !0,
236
- vspLogo: E.vspLogo,
237
- bankingText: E.bankingText,
238
- primaryCaption: E.primaryCaption,
239
- secondaryCaption: E.secondaryCaption,
240
- providedByCaption: E.providedByCaption,
241
- modalPrimaryImg: E.modalPrimaryImg,
242
- primaryModalHeader: E.primaryModalHeader,
243
- benefits: E.benefits,
244
- appearance: E.appearance,
245
- onOpenMarketingModal: Re,
246
- onCloseMarketingModal: ze,
247
- onPrimaryCtaClick: Be
248
- }) : null, /* @__PURE__ */ w(a, {
249
- open: Ie,
250
- defaultOpen: Le,
251
- onOpenChange: N,
252
- title: vt.title,
253
- subtitle: vt.subtitle,
254
- stepLabels: ft,
255
- activeStep: P,
256
- disclaimerText: bt,
257
- onBack: P === 0 ? ht : mt,
258
- onCancel: P > 0 ? ht : void 0,
259
- onNext: _t,
225
+ let ut = I === 2 ? j.submit : j.next, dt = rt === null || Q;
226
+ return /* @__PURE__ */ C(he, { children: /* @__PURE__ */ ge(s, {
227
+ open: P,
228
+ defaultOpen: De,
229
+ onOpenChange: F,
230
+ title: st.title,
231
+ subtitle: st.subtitle,
232
+ stepLabels: nt,
233
+ activeStep: I,
234
+ disclaimerText: lt,
235
+ onBack: I === 0 ? $ : it,
236
+ onCancel: I > 0 ? $ : void 0,
237
+ onNext: ot,
260
238
  showDismissButton: !1,
261
- isNextDisabled: St,
262
- isNextLoading: $,
263
- nextLabel: xt,
239
+ isNextDisabled: dt,
240
+ isNextLoading: Q,
241
+ nextLabel: ut,
264
242
  nextIcon: null,
265
- errorMessage: Qe,
243
+ errorMessage: ze,
266
244
  labels: {
267
- backButton: P === 0 ? k.cancel : k.back,
268
- cancelButton: k.cancel
245
+ backButton: I === 0 ? j.cancel : j.back,
246
+ cancelButton: j.cancel
269
247
  },
270
248
  testIds: {
271
- root: f.shell,
272
- dismiss: f.shellDismiss,
273
- back: f.shellBack,
274
- cancel: f.shellCancel,
275
- next: f.shellNext,
249
+ root: p.shell,
250
+ dismiss: p.shellDismiss,
251
+ back: p.shellBack,
252
+ cancel: p.shellCancel,
253
+ next: p.shellNext,
276
254
  scrollRegion: {
277
- root: f.shellScrollRegion,
278
- fade: f.shellScrollFade,
279
- hint: f.shellScrollHint
255
+ root: p.shellScrollRegion,
256
+ fade: p.shellScrollFade,
257
+ hint: p.shellScrollHint
280
258
  }
281
259
  },
282
260
  children: [
283
- P === 0 ? /* @__PURE__ */ C(re, {
284
- value: Ue,
285
- onValueChange: We,
286
- onSnapshotChange: Je,
287
- naicsOptions: at,
288
- stateOptions: ot,
289
- isSubmitting: $,
290
- labels: k.businessDetails,
291
- bankName: yt,
292
- termsHref: Te,
293
- privacyHref: Ee,
294
- electronicCommunicationHref: De,
295
- patriotActHref: Oe
261
+ I === 0 ? /* @__PURE__ */ C(ie, {
262
+ value: Ae,
263
+ onValueChange: je,
264
+ onSnapshotChange: Fe,
265
+ naicsOptions: Ye,
266
+ stateOptions: Xe,
267
+ isSubmitting: Q,
268
+ labels: j.businessDetails,
269
+ bankName: ct,
270
+ termsHref: xe,
271
+ privacyHref: Se,
272
+ electronicCommunicationHref: Ce,
273
+ patriotActHref: we
296
274
  }, "business") : null,
297
- P === 1 ? /* @__PURE__ */ C(ie, {
298
- value: I,
299
- onValueChange: Ge,
300
- onSnapshotChange: Ye,
301
- stateOptions: st,
302
- isSubmitting: $,
303
- labels: k.personalDetails
275
+ I === 1 ? /* @__PURE__ */ C(ae, {
276
+ value: R,
277
+ onValueChange: Me,
278
+ onSnapshotChange: Ie,
279
+ stateOptions: Ze,
280
+ isSubmitting: Q,
281
+ labels: j.personalDetails
304
282
  }, "personal") : null,
305
- P === 2 ? /* @__PURE__ */ C(ae, {
306
- owners: Ke,
307
- onOwnersChange: qe,
308
- primaryOwnerName: `${I.firstName} ${I.lastName}`.trim(),
309
- primaryOwnerPercentage: dt ? 100 : R?.ownsOver25Percent === !0 ? R.ownershipPercentage ?? 0 : 0,
310
- stateOptions: ct,
311
- onSnapshotChange: Xe,
312
- isSubmitting: $,
313
- labels: k.additionalOwners
283
+ I === 2 ? /* @__PURE__ */ C(oe, {
284
+ owners: Ne,
285
+ onOwnersChange: Pe,
286
+ primaryOwnerName: `${R.firstName} ${R.lastName}`.trim(),
287
+ primaryOwnerPercentage: tt ? 100 : B?.ownsOver25Percent === !0 ? B.ownershipPercentage ?? 0 : 0,
288
+ stateOptions: Qe,
289
+ onSnapshotChange: Le,
290
+ isSubmitting: Q,
291
+ labels: j.additionalOwners
314
292
  }) : null
315
293
  ]
316
- })] });
294
+ }) });
317
295
  }
318
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: c, errorFallback: l, onError: ee, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...p }) {
319
- return /* @__PURE__ */ C(s, {
296
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: u, analytics: ee, disclosuresAcceptance: te, providerLabels: d, ...f }) {
297
+ return /* @__PURE__ */ C(l, {
320
298
  baseUrl: e,
321
299
  widgetToken: t,
322
300
  organizationId: n,
@@ -324,19 +302,19 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
324
302
  gatewayRouting: i,
325
303
  linkComponent: a,
326
304
  implementation: o,
327
- uiFramework: c,
328
- errorFallback: l,
329
- onError: ee,
330
- analytics: u,
331
- disclosuresAcceptance: d,
332
- providerLabels: f,
333
- widgetName: g,
334
- children: /* @__PURE__ */ C(xe, { ...p })
305
+ uiFramework: s,
306
+ errorFallback: c,
307
+ onError: u,
308
+ analytics: ee,
309
+ disclosuresAcceptance: te,
310
+ providerLabels: d,
311
+ widgetName: _,
312
+ children: /* @__PURE__ */ C(E, { ...f })
335
313
  });
336
314
  }
337
- function xe(e) {
338
- let { initResponse: t } = u(), n = t?.userId ?? null, [r, i] = S(n), [a, o] = S(0);
339
- return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ C(ce, { children: /* @__PURE__ */ C(be, { ...e }, a) }, a);
315
+ function E(e) {
316
+ let { initResponse: t } = d(), n = t?.userId ?? null, [r, i] = S(n), [a, o] = S(0);
317
+ return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ C(y, { children: /* @__PURE__ */ C(w, { ...e }, a) }, a);
340
318
  }
341
319
  //#endregion
342
320
  export { T as BankAccountOnboardingWidget, T as default };
@@ -11,7 +11,4 @@ import { BusinessDetailsPanel as c } from "./index18.js";
11
11
  import { ABOUT_YOU_PANEL_LABELS_EN as l } from "./index21.js";
12
12
  import { AboutYouPanel as u } from "./index22.js";
13
13
  import { BusinessDisclosuresSection as d } from "./index23.js";
14
- import "./index24.js";
15
- import "./index27.js";
16
- import { MarketingWidget as f } from "./index28.js";
17
- export { l as ABOUT_YOU_PANEL_LABELS_EN, e as ADDITIONAL_OWNERS_LABELS_EN, u as AboutYouPanel, t as AdditionalOwnersForm, n as BUSINESS_DETAILS_LABELS_EN, s as BUSINESS_DETAILS_PANEL_LABELS_EN, c as BusinessDetailsPanel, d as BusinessDisclosuresSection, f as MarketingWidget, i as PERSONAL_DETAILS_LABELS_EN, o as RESULT_LABELS_EN, a as ResultStep, r as interpolateBankName };
14
+ export { l as ABOUT_YOU_PANEL_LABELS_EN, e as ADDITIONAL_OWNERS_LABELS_EN, u as AboutYouPanel, t as AdditionalOwnersForm, n as BUSINESS_DETAILS_LABELS_EN, s as BUSINESS_DETAILS_PANEL_LABELS_EN, c as BusinessDetailsPanel, d as BusinessDisclosuresSection, i as PERSONAL_DETAILS_LABELS_EN, o as RESULT_LABELS_EN, a as ResultStep, r as interpolateBankName };
@@ -0,0 +1,3 @@
1
+ import { MARKETING_WIDGET_LABELS_EN as e } from "../../ui/dist/index2.js";
2
+ import { MarketingWidget as t } from "./index4.js";
3
+ export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingWidget };
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js
2
+ var e = {
3
+ Mounted: "marketing.mounted",
4
+ OpenModal: "marketing.open_modal",
5
+ PrimaryCta: "marketing.primary_cta"
6
+ }, t = "marketing";
7
+ //#endregion
8
+ export { e as MarketingWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js
1
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js
2
2
  var e = {
3
3
  root: "marketing-widget",
4
4
  learnMoreButton: "marketing-widget-learn-more-button",
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useOrganizationOnboardingSuppression as e } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
8
+ import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
9
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { MarketingWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
12
+ import { marketingWidgetTestIds as o } from "./index3.js";
13
+ import { MARKETING_WIDGET_LABELS_EN as s } from "../../ui/dist/index2.js";
14
+ import { MarketingWidget as c } from "../../ui/dist/index5.js";
15
+ import "../../ui/dist/index.js";
16
+ import { useCallback as l, useEffect as u, useState as d } from "react";
17
+ import { jsx as f } from "react/jsx-runtime";
18
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js
19
+ var p = /* @__PURE__ */ new Set([
20
+ "ACTIVE",
21
+ "INACTIVE",
22
+ "INVITED"
23
+ ]);
24
+ function m({ content: n, onPrimaryCtaClick: a, labels: s }) {
25
+ let m = t(), { initResponse: h } = r(), g = e(), [_, v] = d(!1);
26
+ u(() => {
27
+ m(i.Mounted);
28
+ }, [m]);
29
+ let y = l(() => {
30
+ m(i.OpenModal), v(!0);
31
+ }, [m]), b = l(() => {
32
+ v(!1);
33
+ }, []), x = l(() => {
34
+ m(i.PrimaryCta), v(!1), a();
35
+ }, [a, m]);
36
+ return !h?.status || p.has(h.status) || g.isSuppressed || !g.isResolved ? null : /* @__PURE__ */ f(c, {
37
+ open: _,
38
+ vspLogo: n.vspLogo,
39
+ bankingText: n.bankingText,
40
+ primaryCaption: n.primaryCaption,
41
+ secondaryCaption: n.secondaryCaption,
42
+ providedByCaption: n.providedByCaption,
43
+ modalPrimaryImg: n.modalPrimaryImg,
44
+ primaryModalHeader: n.primaryModalHeader,
45
+ benefits: n.benefits,
46
+ appearance: n.appearance,
47
+ onOpenMarketingModal: y,
48
+ onCloseMarketingModal: b,
49
+ onPrimaryCtaClick: x,
50
+ labels: s,
51
+ testIds: {
52
+ root: o.root,
53
+ learnMoreButton: o.learnMoreButton,
54
+ modal: {
55
+ root: o.modal,
56
+ primaryCtaButton: o.primaryCtaButton
57
+ }
58
+ }
59
+ });
60
+ }
61
+ function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: p, disclosuresAcceptance: h, providerLabels: g, ..._ }) {
62
+ return /* @__PURE__ */ f(n, {
63
+ widgetName: a,
64
+ baseUrl: e,
65
+ widgetToken: t,
66
+ organizationId: r,
67
+ configClient: i,
68
+ gatewayRouting: o,
69
+ linkComponent: s,
70
+ implementation: c,
71
+ uiFramework: l,
72
+ errorFallback: u,
73
+ onError: d,
74
+ analytics: p,
75
+ disclosuresAcceptance: h,
76
+ providerLabels: g,
77
+ children: /* @__PURE__ */ f(m, { ..._ })
78
+ });
79
+ }
80
+ //#endregion
81
+ export { s as MARKETING_WIDGET_LABELS_EN, h as MarketingWidget };