@tesouro/embedded-components-react 0.5.215 → 0.5.216

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 (53) hide show
  1. package/dist/index.d.ts +56 -2
  2. package/dist/index.js +13 -12
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +56 -2
  4. package/dist/lib/BankAccountOnboardingWidget.js +4 -3
  5. package/dist/lib/MarketingWidget.js +1 -1
  6. package/dist/lib/WidgetSuite.d.ts +53 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +72 -72
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +15 -15
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +60 -60
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +12 -12
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +16 -16
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +11 -11
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +8 -8
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +71 -5
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +95 -33
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +6 -17
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +16 -616
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +669 -0
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +15 -13
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +52 -37
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +31 -37
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +33 -89
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +39 -12
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +98 -2
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +14 -4
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -185
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +4 -30
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +183 -21
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +26 -66
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +21 -233
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +66 -27
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +233 -26
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +27 -72
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +26 -85
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +74 -8
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +83 -55
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +6 -7
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +37 -42
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +11 -0
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +64 -0
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +7 -33
  44. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +16 -19
  46. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +157 -16
  47. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/onboardingSuppressionReason.js +3 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +2 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/application/bankAccountApplication.js +26 -0
  51. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +0 -161
@@ -1,35 +1,9 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import * as e from "react";
6
- import { jsx as t } from "react/jsx-runtime";
7
- import n from "react-confetti";
8
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js
9
- function r() {
10
- let [r, i] = e.useState({
11
- width: typeof window < "u" ? window.innerWidth : 0,
12
- height: typeof window < "u" ? window.innerHeight : 0
13
- });
14
- return e.useEffect(() => {
15
- let e = () => {
16
- i({
17
- width: window.innerWidth,
18
- height: window.innerHeight
19
- });
20
- };
21
- return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
22
- }, []), /* @__PURE__ */ t(n, {
23
- width: r.width,
24
- height: r.height,
25
- recycle: !1,
26
- gravity: .6,
27
- numberOfPieces: 400,
28
- initialVelocityY: {
29
- min: 10,
30
- max: 12
31
- }
32
- });
33
- }
2
+ var e = {
3
+ title: "Business bank account application",
4
+ bankDisclosure: "",
5
+ chipLabel: "Application status",
6
+ body: []
7
+ };
34
8
  //#endregion
35
- export { r as ResultStepConfetti };
9
+ export { e as APPLICATION_STATUS_CARD_LABELS_EN };
@@ -1,5 +1,5 @@
1
1
  import { MARKETING_WIDGET_STATUS_LABELS_EN as e } from "./index4.js";
2
2
  import { MARKETING_WIDGET_LABELS_EN as t } from "../../ui/dist/index2.js";
3
3
  import { MarketingBenefitIcon as n } from "../../ui/dist/index3.js";
4
- import { MarketingWidget as r } from "./index7.js";
4
+ import { MarketingWidget as r } from "./index6.js";
5
5
  export { t as MARKETING_WIDGET_LABELS_EN, e as MARKETING_WIDGET_STATUS_LABELS_EN, n as MarketingBenefitIcon, r as MarketingWidget };
@@ -1,5 +1,7 @@
1
+ import { deniedNoticeExpiresAt as e } from "../../../shared/feature/dist/lib/application/bankAccountApplication.js";
2
+ import "../../../shared/feature/dist/index.js";
1
3
  //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js
2
- var e = {
4
+ var t = {
3
5
  Offer: "offer",
4
6
  Resume: "resume",
5
7
  DraftStartedByOther: "draftStartedByOther",
@@ -8,27 +10,22 @@ var e = {
8
10
  DeniedByYou: "deniedByYou",
9
11
  DeniedByOther: "deniedByOther",
10
12
  Hidden: "hidden"
11
- }, t = 2592e6;
12
- function n(e) {
13
- if (e?.status !== "DENIED") return null;
14
- let n = Date.parse(e.deniedAt ?? e.updatedAt);
15
- return Number.isFinite(n) ? n + t : null;
16
- }
17
- function r(t, r = Date.now()) {
18
- if (!t) return e.Offer;
19
- let i = t.ownership === "STARTED_BY_YOU";
20
- switch (t.status) {
21
- case "COMPLETE": return e.Hidden;
22
- case "DRAFT": return i ? e.Resume : e.DraftStartedByOther;
23
- case "SUBMITTED": return i ? e.SubmittedByYou : e.SubmittedByOther;
13
+ };
14
+ function n(n, r = Date.now()) {
15
+ if (!n) return t.Offer;
16
+ let i = n.ownership === "STARTED_BY_YOU";
17
+ switch (n.status) {
18
+ case "COMPLETE": return t.Hidden;
19
+ case "DRAFT": return i ? t.Resume : t.DraftStartedByOther;
20
+ case "SUBMITTED": return i ? t.SubmittedByYou : t.SubmittedByOther;
24
21
  case "DENIED": {
25
- let a = n(t);
26
- return a !== null && r > a ? e.Hidden : i ? e.DeniedByYou : e.DeniedByOther;
22
+ let a = e(n);
23
+ return a !== null && r > a ? t.Hidden : i ? t.DeniedByYou : t.DeniedByOther;
27
24
  }
28
25
  case "DELETED":
29
- case "CANCELED": return e.Offer;
30
- default: return e.Hidden;
26
+ case "CANCELED": return t.Offer;
27
+ default: return t.Hidden;
31
28
  }
32
29
  }
33
30
  //#endregion
34
- export { t as DENIED_NOTICE_DURATION_MS, e as MarketingApplicationView, n as deniedNoticeExpiresAt, r as marketingApplicationViewFor };
31
+ export { t as MarketingApplicationView, n as marketingApplicationViewFor };
@@ -1,20 +1,161 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useOrganizationApplicationStatus as e } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.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, useWidgetInitStaleForToken as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import { deniedNoticeExpiresAt as a, selectBankAccountApplication as o } from "../../../shared/feature/dist/lib/application/bankAccountApplication.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { MARKETING_WIDGET_STATUS_LABELS_EN as s } from "./index4.js";
13
+ import { MarketingWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "./index2.js";
14
+ import { marketingWidgetTestIds as u } from "./index3.js";
15
+ import { MarketingApplicationView as d, marketingApplicationViewFor as f } from "./index5.js";
16
+ import { MARKETING_WIDGET_LABELS_EN as p } from "../../ui/dist/index2.js";
17
+ import { MarketingBenefitIcon as m, MarketingWidgetStatusTone as h } from "../../ui/dist/index3.js";
18
+ import { MarketingWidget as g } from "../../ui/dist/index9.js";
19
+ import "../../ui/dist/index.js";
20
+ import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
21
+ import { jsx as S } from "react/jsx-runtime";
1
22
  //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js
2
- var e = [
3
- "COMPLETE",
4
- "SUBMITTED",
5
- "DRAFT",
6
- "DENIED"
7
- ], t = /* @__PURE__ */ new Set(["DELETED", "CANCELED"]);
8
- function n(e) {
9
- return e.find((e) => e.ownership === "STARTED_BY_YOU") ?? e[0] ?? null;
23
+ var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
24
+ "ACTIVE",
25
+ "INACTIVE",
26
+ "INVITED"
27
+ ]), T = {
28
+ [d.DraftStartedByOther]: "draftStartedByOther",
29
+ [d.SubmittedByYou]: "submittedByYou",
30
+ [d.SubmittedByOther]: "submittedByOther",
31
+ [d.DeniedByYou]: "deniedByYou",
32
+ [d.DeniedByOther]: "deniedByOther"
33
+ }, E = {
34
+ [d.DraftStartedByOther]: h.Brand,
35
+ [d.SubmittedByYou]: h.Warning,
36
+ [d.SubmittedByOther]: h.Warning,
37
+ [d.DeniedByYou]: h.Danger,
38
+ [d.DeniedByOther]: h.Danger
39
+ };
40
+ function D(e) {
41
+ return e in T;
10
42
  }
11
- function r(r) {
12
- let i = r.filter((e) => e.product === "BANK_ACCOUNT" && !t.has(e.status));
13
- for (let t of e) {
14
- let e = i.filter((e) => e.status === t);
15
- if (e.length > 0) return n(e);
16
- }
17
- return n(i);
43
+ function O(e) {
44
+ let t = s, n = (n) => ({
45
+ ...t[n],
46
+ ...e?.[n]
47
+ });
48
+ return {
49
+ resumeApplication: e?.resumeApplication ?? t.resumeApplication,
50
+ bankNameFallback: e?.bankNameFallback ?? t.bankNameFallback,
51
+ formatDate: e?.formatDate ?? t.formatDate,
52
+ draftStartedByOther: n("draftStartedByOther"),
53
+ submittedByYou: n("submittedByYou"),
54
+ submittedByOther: n("submittedByOther"),
55
+ deniedByYou: n("deniedByYou"),
56
+ deniedByOther: n("deniedByOther")
57
+ };
58
+ }
59
+ function k(e, t, n) {
60
+ let r = (e) => e ? n(e) : void 0;
61
+ return {
62
+ bankName: t,
63
+ applicantName: [e?.applicantFirstName, e?.applicantLastName].map((e) => e?.trim()).filter(Boolean).join(" ") || void 0,
64
+ startedOn: r(e?.createdAt),
65
+ submittedOn: r(e?.submittedAt),
66
+ deniedOn: r(e?.deniedAt)
67
+ };
68
+ }
69
+ function A({ content: n, onPrimaryCtaClick: s, labels: l, statusLabels: p }) {
70
+ let m = t(), { initResponse: h } = r(), A = i(), j = e(), [M, N] = x(!1), [P, F] = b((e) => e + 1, 0), I = y(() => o(j.applications), [j.applications]), L = a(I), R = y(() => O(p), [p]), z = f(I), B = h?.bankName || R.bankNameFallback, V = y(() => {
71
+ if (!D(z)) return;
72
+ let e = R[T[z]], t = k(I, B, R.formatDate);
73
+ return {
74
+ chipLabel: e.chipLabel,
75
+ chipTone: E[z],
76
+ heading: e.heading?.(t),
77
+ body: e.body(t)
78
+ };
79
+ }, [
80
+ I,
81
+ B,
82
+ R,
83
+ z
84
+ ]), H = y(() => z === d.Resume ? {
85
+ ...l,
86
+ applyNow: R.resumeApplication,
87
+ primaryCta: R.resumeApplication
88
+ } : l, [
89
+ l,
90
+ R.resumeApplication,
91
+ z
92
+ ]);
93
+ v(() => {
94
+ m(c.Mounted);
95
+ }, [m]), v(() => {
96
+ if (L === null) return;
97
+ let e = L - Date.now();
98
+ if (e < 0) return;
99
+ let t = setTimeout(F, Math.min(e + 1, C));
100
+ return () => clearTimeout(t);
101
+ }, [L, P]);
102
+ let U = !V && z !== d.Hidden;
103
+ M && !U && N(!1);
104
+ let W = _(() => {
105
+ m(c.OpenModal), N(!0);
106
+ }, [m]), G = _(() => {
107
+ N(!1);
108
+ }, []), K = _(() => {
109
+ m(c.PrimaryCta), N(!1), s();
110
+ }, [s, m]);
111
+ return !h?.status || w.has(h.status) || A || !j.isResolved || z === d.Hidden ? null : /* @__PURE__ */ S(g, {
112
+ open: M,
113
+ vspLogo: n.vspLogo,
114
+ bankingText: n.bankingText,
115
+ primaryCaption: n.primaryCaption,
116
+ secondaryCaption: n.secondaryCaption,
117
+ providedByCaption: n.providedByCaption,
118
+ primaryModalHeader: n.primaryModalHeader,
119
+ howItWorksHeader: n.howItWorksHeader,
120
+ howItWorksSteps: n.howItWorksSteps,
121
+ fromDayOneHeader: n.fromDayOneHeader,
122
+ benefits: n.benefits,
123
+ appearance: n.appearance,
124
+ onOpenMarketingModal: W,
125
+ onCloseMarketingModal: G,
126
+ onPrimaryCtaClick: K,
127
+ statusMessage: V,
128
+ labels: H,
129
+ testIds: {
130
+ root: u.root,
131
+ learnMoreButton: u.learnMoreButton,
132
+ applyNowButton: u.applyNowButton,
133
+ statusMessage: u.statusMessage,
134
+ modal: {
135
+ root: u.modal,
136
+ primaryCtaButton: u.primaryCtaButton
137
+ }
138
+ }
139
+ });
140
+ }
141
+ function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
142
+ return /* @__PURE__ */ S(n, {
143
+ widgetName: l,
144
+ baseUrl: e,
145
+ widgetToken: t,
146
+ organizationId: r,
147
+ configClient: i,
148
+ gatewayRouting: a,
149
+ linkComponent: o,
150
+ implementation: s,
151
+ uiFramework: c,
152
+ errorFallback: u,
153
+ onError: d,
154
+ analytics: f,
155
+ disclosuresAcceptance: p,
156
+ providerLabels: m,
157
+ children: /* @__PURE__ */ S(A, { ...h })
158
+ });
18
159
  }
19
160
  //#endregion
20
- export { r as selectBankAccountApplication };
161
+ export { p as MARKETING_WIDGET_LABELS_EN, s as MARKETING_WIDGET_STATUS_LABELS_EN, m as MarketingBenefitIcon, j as MarketingWidget };
@@ -3,7 +3,9 @@ var e = {
3
3
  UserAlreadyOnboarded: "user_already_onboarded",
4
4
  UserInvitedToOrganization: "user_invited_to_organization",
5
5
  OrganizationApplicationComplete: "organization_application_complete",
6
- OrganizationApplicationStartedByOther: "organization_application_started_by_other"
6
+ OrganizationApplicationStartedByOther: "organization_application_started_by_other",
7
+ OrganizationApplicationDenialExpired: "organization_application_denial_expired",
8
+ OrganizationApplicationStatusUnrecognized: "organization_application_status_unrecognized"
7
9
  };
8
10
  //#endregion
9
11
  export { e as OnboardingSuppressionReason };
@@ -17,5 +17,6 @@ import { getNaicsOptions as S } from "./lib/naicsCodeMap.js";
17
17
  import { useOrganizationUserNames as C } from "./lib/user/useOrganizationUserNames.js";
18
18
  import { CardProgram as w } from "./lib/card/cardProgram.js";
19
19
  import { CARD_STATUS_LABELS_EN as T, CARD_STATUS_TONE as E, CARD_TYPE_LABELS_EN as D } from "./lib/card/cardPresentation.js";
20
+ import { deniedNoticeExpiresAt as O, selectBankAccountApplication as k } from "./lib/application/bankAccountApplication.js";
20
21
  import "./lib/analytics/index.js";
21
- export { T as CARD_STATUS_LABELS_EN, E as CARD_STATUS_TONE, D as CARD_TYPE_LABELS_EN, w as CardProgram, t as Implementation, m as RefreshingRootWidgetProvider, s as RootWidgetProvider, u as WidgetProvider, d as WidgetTokenRefreshProvider, e as cloneEmbeddedClient, n as getGlobalWidgetConfig, a as getGlobalWidgetInitState, S as getNaicsOptions, r as setGlobalWidgetConfig, o as subscribeToGlobalWidgetInitState, i as updateGlobalWidgetConfig, c as useAnalyticsCaptureException, l as useAnalyticsTrack, h as useDisclosuresAcceptanceSurface, f as useOptionalWidgetToken, C as useOrganizationUserNames, g as useOwnWidgetConfig, _ as useRefetchWidget, v as useWidgetConfig, y as useWidgetError, b as useWidgetInitStaleForToken, x as useWidgetLoading, p as useWidgetToken };
22
+ export { T as CARD_STATUS_LABELS_EN, E as CARD_STATUS_TONE, D as CARD_TYPE_LABELS_EN, w as CardProgram, t as Implementation, m as RefreshingRootWidgetProvider, s as RootWidgetProvider, u as WidgetProvider, d as WidgetTokenRefreshProvider, e as cloneEmbeddedClient, O as deniedNoticeExpiresAt, n as getGlobalWidgetConfig, a as getGlobalWidgetInitState, S as getNaicsOptions, k as selectBankAccountApplication, r as setGlobalWidgetConfig, o as subscribeToGlobalWidgetInitState, i as updateGlobalWidgetConfig, c as useAnalyticsCaptureException, l as useAnalyticsTrack, h as useDisclosuresAcceptanceSurface, f as useOptionalWidgetToken, C as useOrganizationUserNames, g as useOwnWidgetConfig, _ as useRefetchWidget, v as useWidgetConfig, y as useWidgetError, b as useWidgetInitStaleForToken, x as useWidgetLoading, p as useWidgetToken };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.215", n = "d084b6c10c9340b5694c454f4a59b939854e6ecd", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.216", n = "4ea8c77025c772bba27174f3a062b0e2d82ec29d", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -0,0 +1,26 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/application/bankAccountApplication.js
2
+ var e = [
3
+ "COMPLETE",
4
+ "SUBMITTED",
5
+ "DRAFT",
6
+ "DENIED"
7
+ ], t = /* @__PURE__ */ new Set(["DELETED", "CANCELED"]);
8
+ function n(e) {
9
+ return e.find((e) => e.ownership === "STARTED_BY_YOU") ?? e[0] ?? null;
10
+ }
11
+ function r(r) {
12
+ let i = r.filter((e) => e.product === "BANK_ACCOUNT" && !t.has(e.status));
13
+ for (let t of e) {
14
+ let e = i.filter((e) => e.status === t);
15
+ if (e.length > 0) return n(e);
16
+ }
17
+ return n(i);
18
+ }
19
+ var i = 2592e6;
20
+ function a(e) {
21
+ if (e?.status !== "DENIED") return null;
22
+ let t = Date.parse(e.deniedAt ?? e.updatedAt);
23
+ return Number.isFinite(t) ? t + i : null;
24
+ }
25
+ //#endregion
26
+ export { i as DENIED_NOTICE_DURATION_MS, a as deniedNoticeExpiresAt, r as selectBankAccountApplication };
@@ -24,7 +24,7 @@ import { WIDGET_NAME as b, WidgetSuiteAnalyticsEvent as x } from "./index2.js";
24
24
  import { needsDisclosureAcceptance as S } from "./index3.js";
25
25
  import { AcceptDisclosuresWidget as C } from "../../../accept-disclosures-widget/feature/dist/index5.js";
26
26
  import "../../../accept-disclosures-widget/feature/dist/index.js";
27
- import { BankAccountOnboardingWidget as w } from "../../../bank-account-onboarding-widget/feature/dist/index25.js";
27
+ import { BankAccountOnboardingWidget as w } from "../../../bank-account-onboarding-widget/feature/dist/index26.js";
28
28
  import "../../../bank-account-onboarding-widget/feature/dist/index.js";
29
29
  import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
30
30
  import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.215",
3
+ "version": "0.5.216",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {
@@ -1,161 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useOrganizationApplicationStatus as e } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.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, useWidgetInitStaleForToken as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import "../../../shared/feature/dist/index.js";
11
- import { MARKETING_WIDGET_STATUS_LABELS_EN as a } from "./index4.js";
12
- import { MarketingWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
13
- import { marketingWidgetTestIds as c } from "./index3.js";
14
- import { MarketingApplicationView as l, deniedNoticeExpiresAt as u, marketingApplicationViewFor as d } from "./index5.js";
15
- import { selectBankAccountApplication as f } from "./index6.js";
16
- import { MARKETING_WIDGET_LABELS_EN as p } from "../../ui/dist/index2.js";
17
- import { MarketingBenefitIcon as m, MarketingWidgetStatusTone as h } from "../../ui/dist/index3.js";
18
- import { MarketingWidget as g } from "../../ui/dist/index9.js";
19
- import "../../ui/dist/index.js";
20
- import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
21
- import { jsx as S } from "react/jsx-runtime";
22
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js
23
- var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
24
- "ACTIVE",
25
- "INACTIVE",
26
- "INVITED"
27
- ]), T = {
28
- [l.DraftStartedByOther]: "draftStartedByOther",
29
- [l.SubmittedByYou]: "submittedByYou",
30
- [l.SubmittedByOther]: "submittedByOther",
31
- [l.DeniedByYou]: "deniedByYou",
32
- [l.DeniedByOther]: "deniedByOther"
33
- }, E = {
34
- [l.DraftStartedByOther]: h.Brand,
35
- [l.SubmittedByYou]: h.Warning,
36
- [l.SubmittedByOther]: h.Warning,
37
- [l.DeniedByYou]: h.Danger,
38
- [l.DeniedByOther]: h.Danger
39
- };
40
- function D(e) {
41
- return e in T;
42
- }
43
- function O(e) {
44
- let t = a, n = (n) => ({
45
- ...t[n],
46
- ...e?.[n]
47
- });
48
- return {
49
- resumeApplication: e?.resumeApplication ?? t.resumeApplication,
50
- bankNameFallback: e?.bankNameFallback ?? t.bankNameFallback,
51
- formatDate: e?.formatDate ?? t.formatDate,
52
- draftStartedByOther: n("draftStartedByOther"),
53
- submittedByYou: n("submittedByYou"),
54
- submittedByOther: n("submittedByOther"),
55
- deniedByYou: n("deniedByYou"),
56
- deniedByOther: n("deniedByOther")
57
- };
58
- }
59
- function k(e, t, n) {
60
- let r = (e) => e ? n(e) : void 0;
61
- return {
62
- bankName: t,
63
- applicantName: [e?.applicantFirstName, e?.applicantLastName].map((e) => e?.trim()).filter(Boolean).join(" ") || void 0,
64
- startedOn: r(e?.createdAt),
65
- submittedOn: r(e?.submittedAt),
66
- deniedOn: r(e?.deniedAt)
67
- };
68
- }
69
- function A({ content: n, onPrimaryCtaClick: a, labels: s, statusLabels: p }) {
70
- let m = t(), { initResponse: h } = r(), A = i(), j = e(), [M, N] = x(!1), [P, F] = b((e) => e + 1, 0), I = y(() => f(j.applications), [j.applications]), L = u(I), R = y(() => O(p), [p]), z = d(I), B = h?.bankName || R.bankNameFallback, V = y(() => {
71
- if (!D(z)) return;
72
- let e = R[T[z]], t = k(I, B, R.formatDate);
73
- return {
74
- chipLabel: e.chipLabel,
75
- chipTone: E[z],
76
- heading: e.heading?.(t),
77
- body: e.body(t)
78
- };
79
- }, [
80
- I,
81
- B,
82
- R,
83
- z
84
- ]), H = y(() => z === l.Resume ? {
85
- ...s,
86
- applyNow: R.resumeApplication,
87
- primaryCta: R.resumeApplication
88
- } : s, [
89
- s,
90
- R.resumeApplication,
91
- z
92
- ]);
93
- v(() => {
94
- m(o.Mounted);
95
- }, [m]), v(() => {
96
- if (L === null) return;
97
- let e = L - Date.now();
98
- if (e < 0) return;
99
- let t = setTimeout(F, Math.min(e + 1, C));
100
- return () => clearTimeout(t);
101
- }, [L, P]);
102
- let U = !V && z !== l.Hidden;
103
- M && !U && N(!1);
104
- let W = _(() => {
105
- m(o.OpenModal), N(!0);
106
- }, [m]), G = _(() => {
107
- N(!1);
108
- }, []), K = _(() => {
109
- m(o.PrimaryCta), N(!1), a();
110
- }, [a, m]);
111
- return !h?.status || w.has(h.status) || A || !j.isResolved || z === l.Hidden ? null : /* @__PURE__ */ S(g, {
112
- open: M,
113
- vspLogo: n.vspLogo,
114
- bankingText: n.bankingText,
115
- primaryCaption: n.primaryCaption,
116
- secondaryCaption: n.secondaryCaption,
117
- providedByCaption: n.providedByCaption,
118
- primaryModalHeader: n.primaryModalHeader,
119
- howItWorksHeader: n.howItWorksHeader,
120
- howItWorksSteps: n.howItWorksSteps,
121
- fromDayOneHeader: n.fromDayOneHeader,
122
- benefits: n.benefits,
123
- appearance: n.appearance,
124
- onOpenMarketingModal: W,
125
- onCloseMarketingModal: G,
126
- onPrimaryCtaClick: K,
127
- statusMessage: V,
128
- labels: H,
129
- testIds: {
130
- root: c.root,
131
- learnMoreButton: c.learnMoreButton,
132
- applyNowButton: c.applyNowButton,
133
- statusMessage: c.statusMessage,
134
- modal: {
135
- root: c.modal,
136
- primaryCtaButton: c.primaryCtaButton
137
- }
138
- }
139
- });
140
- }
141
- function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
142
- return /* @__PURE__ */ S(n, {
143
- widgetName: s,
144
- baseUrl: e,
145
- widgetToken: t,
146
- organizationId: r,
147
- configClient: i,
148
- gatewayRouting: a,
149
- linkComponent: o,
150
- implementation: c,
151
- uiFramework: l,
152
- errorFallback: u,
153
- onError: d,
154
- analytics: f,
155
- disclosuresAcceptance: p,
156
- providerLabels: m,
157
- children: /* @__PURE__ */ S(A, { ...h })
158
- });
159
- }
160
- //#endregion
161
- export { p as MARKETING_WIDGET_LABELS_EN, a as MARKETING_WIDGET_STATUS_LABELS_EN, m as MarketingBenefitIcon, j as MarketingWidget };