@tesouro/embedded-components-react 0.7.53 → 0.7.57

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 (76) hide show
  1. package/README.md +13 -3
  2. package/dist/experimental/RemoteCheckCapture.d.ts +1 -32
  3. package/dist/experimental/index.d.ts +1 -32
  4. package/dist/index.css +12 -0
  5. package/dist/index.d.ts +58 -47
  6. package/dist/index.js +47 -46
  7. package/dist/lib/AcceptDisclosuresWidget.d.ts +1 -32
  8. package/dist/lib/BalancesWidget.d.ts +0 -31
  9. package/dist/lib/BankAccountOnboardingWidget.d.ts +1 -32
  10. package/dist/lib/BankAccountsWidget.d.ts +1 -32
  11. package/dist/lib/BankingComplianceBannerWidget.d.ts +643 -0
  12. package/dist/lib/BankingComplianceBannerWidget.js +5 -0
  13. package/dist/lib/BillPayWidget.d.ts +0 -31
  14. package/dist/lib/CardDetailsWidget.d.ts +1 -32
  15. package/dist/lib/CounterpartsWidget.d.ts +0 -31
  16. package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -31
  17. package/dist/lib/CreditCardsWidget.d.ts +0 -31
  18. package/dist/lib/CustomersWidget.d.ts +1 -33
  19. package/dist/lib/DebitCardsWidget.d.ts +0 -31
  20. package/dist/lib/ExpenseManagementWidget.d.ts +0 -31
  21. package/dist/lib/InsightsWidget.d.ts +0 -31
  22. package/dist/lib/LinkedAccountsWidget.d.ts +1 -32
  23. package/dist/lib/OfferWidget.d.ts +1 -32
  24. package/dist/lib/ProductsWidget.d.ts +1 -32
  25. package/dist/lib/ReceivablesWidget.d.ts +1 -32
  26. package/dist/lib/SettingsWidget.d.ts +0 -31
  27. package/dist/lib/TransfersWidget.d.ts +0 -31
  28. package/dist/lib/WidgetProvider.d.ts +2 -33
  29. package/dist/lib/WidgetProvider.js +9 -10
  30. package/dist/lib/WidgetProviderPublic.d.ts +0 -31
  31. package/dist/lib/WidgetSuite.d.ts +1 -32
  32. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +8 -9
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +395 -396
  34. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +8 -9
  35. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index.js +3 -0
  36. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index2.js +7 -0
  37. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index3.js +42 -0
  38. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/index.js +4 -0
  39. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/BankingComplianceBannerWidget/BankingComplianceBannerWidget.js +52 -0
  40. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/BankingComplianceBannerWidget/isFdicBacked.js +8 -0
  41. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/analytics/events.js +4 -0
  42. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/testIds.js +10 -0
  43. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index.js +3 -0
  44. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index2.js +40 -0
  45. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index3.js +10 -0
  46. package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index4.js +60 -0
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +16 -18
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index8.js +8 -9
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +8 -9
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +8 -9
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index14.js +8 -9
  52. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +83 -84
  53. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +15 -16
  54. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js +8 -9
  55. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +9 -10
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +25 -26
  57. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +8 -9
  58. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js +8 -9
  59. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +8 -9
  60. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js +9 -10
  61. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index8.js +8 -9
  62. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/feature/dist/index3.js +8 -9
  63. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +9 -10
  64. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +8 -9
  65. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +8 -9
  66. package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js +8 -9
  67. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +16 -17
  68. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +45 -49
  69. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +91 -95
  70. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +0 -1
  71. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/index.js +0 -1
  72. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +2 -1
  73. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js +120 -121
  75. package/package.json +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/types.js +0 -8
@@ -30,85 +30,85 @@ import { useContext as ye, useEffect as p, useMemo as m, useRef as h, useState a
30
30
  import { jsx as _ } from "react/jsx-runtime";
31
31
  import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
32
32
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
33
- function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, implementation: y, errorFallback: we, onError: Te, analytics: b, disclosuresAcceptance: Ee, providerLabels: De, widgetName: x }) {
34
- let S = ye(ce), Oe = be(ae, ie, ie), C = S?.resolved ?? Oe, ke = S?.refetch ?? le, Ae = S?.loading ?? !1, je = S?.error ?? null, w = s ?? C.baseUrl, T = c === void 0 ? C.widgetToken : c, Me = S ? S.cascadeOrgId : Oe.organizationId, E = l === void 0 ? Me : l, D = u ?? C.configClient, O = d ?? C.gatewayRouting, k = f ?? C.linkComponent, A = v ?? C.uiFramework, j = y ?? C.implementation, M = Ee ?? S?.disclosuresAcceptance, N = De ?? S?.providerLabels, Ne = m(() => ge(N), [N]), P = S === null, F = P ? b !== !1 : S.analytics.enabled, [Pe] = g(se), I = P ? Pe : S.analytics.rootCorrelationId, [Fe] = g(se), L = x === void 0 ? S?.analytics.widgetName : x, R = x === void 0 ? S?.analytics.widgetInstanceId : Fe, z = h({
35
- enabled: F,
36
- organizationId: E,
37
- rootCorrelationId: I,
38
- widgetName: L,
39
- widgetInstanceId: R
40
- }), B = h(!1);
33
+ function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, errorFallback: we, onError: Te, analytics: y, disclosuresAcceptance: Ee, providerLabels: De, widgetName: b }) {
34
+ let x = ye(ce), Oe = be(ae, ie, ie), S = x?.resolved ?? Oe, ke = x?.refetch ?? le, Ae = x?.loading ?? !1, je = x?.error ?? null, C = s ?? S.baseUrl, w = c === void 0 ? S.widgetToken : c, Me = x ? x.cascadeOrgId : Oe.organizationId, T = l === void 0 ? Me : l, E = u ?? S.configClient, D = d ?? S.gatewayRouting, O = f ?? S.linkComponent, k = v ?? S.uiFramework, A = Ee ?? x?.disclosuresAcceptance, j = De ?? x?.providerLabels, M = m(() => ge(j), [j]), N = x === null, P = N ? y !== !1 : x.analytics.enabled, [Ne] = g(se), F = N ? Ne : x.analytics.rootCorrelationId, [Pe] = g(se), I = b === void 0 ? x?.analytics.widgetName : b, L = b === void 0 ? x?.analytics.widgetInstanceId : Pe, R = h({
35
+ enabled: P,
36
+ organizationId: T,
37
+ rootCorrelationId: F,
38
+ widgetName: I,
39
+ widgetInstanceId: L
40
+ }), z = h(!1);
41
41
  p(() => {
42
- P || b === void 0 || B.current || (B.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
43
- }, [b, P]), p(() => {
44
- if (!P || !F || !("window" in globalThis)) return;
42
+ N || y === void 0 || z.current || (z.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
43
+ }, [y, N]), p(() => {
44
+ if (!N || !P || !("window" in globalThis)) return;
45
45
  let e = !1;
46
46
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
47
47
  e || t();
48
48
  }), () => {
49
49
  e = !0;
50
50
  };
51
- }, [P, F]);
52
- let V = te(o(A));
51
+ }, [N, P]);
52
+ let B = te(o(k));
53
53
  p(() => {
54
- V && V().catch(() => {});
55
- }, [V]);
56
- let Ie = S === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || x !== void 0, Le = h(T);
57
- Le.current = T;
58
- let Re = h(null), ze = m(() => e(Re), []), Be = a(), Ve = de(T), H = m(() => {
59
- if (!Ie) return null;
60
- let e = oe(r(w), {
61
- tokenRef: Le,
62
- analyticsContextRef: z,
63
- clientSecretRef: Re,
64
- gatewayRouting: O
54
+ B && B().catch(() => {});
55
+ }, [B]);
56
+ let V = x === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || b !== void 0, Fe = h(w);
57
+ Fe.current = w;
58
+ let Ie = h(null), Le = m(() => e(Ie), []), Re = a(), ze = de(w), H = m(() => {
59
+ if (!V) return null;
60
+ let e = oe(r(C), {
61
+ tokenRef: Fe,
62
+ analyticsContextRef: R,
63
+ clientSecretRef: Ie,
64
+ gatewayRouting: D
65
65
  });
66
- return D ? D(e) : e;
66
+ return E ? E(e) : e;
67
67
  }, [
68
- Ie,
69
- w,
70
- D,
71
- O
72
- ]), U = S === null || s !== void 0 || c !== void 0, He = U ? Ve : Be.authEpoch, { result: W, loading: G, error: K, clearedForAuthChange: Ue, initStaleForToken: q, initReplacementPending: We, refetch: Ge } = fe(U ? H : null, U ? T : void 0, z), Ke = U ? Ge : ke, qe = U ? G : Ae, Je = U ? K : je, Ye = S?.resolved.initResponse, Xe = !U || !Ue && !K && !W && !!T && !G, J = Xe ? Ye : W ?? void 0, Y = Xe ? U || (S?.initResponseStaleForToken ?? !1) : q, Ze = S === null, Qe = m(() => Ze ? me({
73
- hasToken: !!T,
68
+ V,
69
+ C,
70
+ E,
71
+ D
72
+ ]), U = x === null || s !== void 0 || c !== void 0, Be = U ? ze : Re.authEpoch, { result: W, loading: G, error: K, clearedForAuthChange: Ve, initStaleForToken: q, initReplacementPending: He, refetch: Ue } = fe(U ? H : null, U ? w : void 0, R), We = U ? Ue : ke, Ge = U ? G : Ae, Ke = U ? K : je, qe = x?.resolved.initResponse, Je = !U || !Ve && !K && !W && !!w && !G, J = Je ? qe : W ?? void 0, Y = Je ? U || (x?.initResponseStaleForToken ?? !1) : q, Ye = x === null, Xe = m(() => Ye ? me({
73
+ hasToken: !!w,
74
74
  loading: G,
75
75
  error: K,
76
76
  initResponse: W ?? void 0,
77
77
  initStaleForToken: q
78
78
  }) : null, [
79
- Ze,
80
- T,
79
+ Ye,
80
+ w,
81
81
  G,
82
82
  K,
83
83
  W,
84
84
  q
85
85
  ]);
86
- he(Qe, T);
87
- let X = ue(E, Y ? void 0 : J?.organizationId), $e = pe({
86
+ he(Xe, w);
87
+ let X = ue(T, Y ? void 0 : J?.organizationId), Ze = pe({
88
88
  organizationId: X,
89
- cascadeOrgId: E,
89
+ cascadeOrgId: T,
90
90
  ownsFetch: U,
91
- parentStatus: Be.organizationStatus,
92
- hasToken: !!T,
91
+ parentStatus: Re.organizationStatus,
92
+ hasToken: !!w,
93
93
  loading: G,
94
94
  error: K,
95
95
  hasResult: !!W,
96
- initReplacementPending: We
96
+ initReplacementPending: He
97
97
  }), Z = m(() => ({
98
- enabled: F,
98
+ enabled: P,
99
99
  organizationId: X,
100
- rootCorrelationId: I,
101
- widgetName: L,
102
- widgetInstanceId: R
100
+ rootCorrelationId: F,
101
+ widgetName: I,
102
+ widgetInstanceId: L
103
103
  }), [
104
- F,
104
+ P,
105
105
  X,
106
+ F,
106
107
  I,
107
- L,
108
- R
108
+ L
109
109
  ]);
110
- z.current = Z;
111
- let [Q] = g(() => S === null ? new xe({ defaultOptions: {
110
+ R.current = Z;
111
+ let [Q] = g(() => x === null ? new xe({ defaultOptions: {
112
112
  queries: {
113
113
  retry: !1,
114
114
  refetchOnWindowFocus: !1
@@ -120,15 +120,14 @@ function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, config
120
120
  let e = Q;
121
121
  return t(e), () => n(e);
122
122
  }, [Q]);
123
- let et = m(() => ({
123
+ let Qe = m(() => ({
124
124
  baseUrl: s,
125
125
  widgetToken: c,
126
126
  organizationId: l,
127
127
  configClient: u,
128
128
  gatewayRouting: d,
129
129
  linkComponent: f,
130
- uiFramework: v,
131
- implementation: y
130
+ uiFramework: v
132
131
  }), [
133
132
  s,
134
133
  c,
@@ -136,76 +135,73 @@ function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, config
136
135
  u,
137
136
  d,
138
137
  f,
139
- v,
140
- y
141
- ]), tt = m(() => ({
142
- baseUrl: w,
143
- widgetToken: T,
138
+ v
139
+ ]), $e = m(() => ({
140
+ baseUrl: C,
141
+ widgetToken: w,
144
142
  organizationId: X,
145
- configClient: D,
146
- gatewayRouting: O,
147
- linkComponent: k,
148
- uiFramework: A,
149
- implementation: j,
143
+ configClient: E,
144
+ gatewayRouting: D,
145
+ linkComponent: O,
146
+ uiFramework: k,
150
147
  initResponse: J
151
148
  }), [
149
+ C,
152
150
  w,
153
- T,
154
151
  X,
152
+ E,
155
153
  D,
156
154
  O,
157
155
  k,
158
- A,
159
- j,
160
156
  J
161
- ]), nt = m(() => ({
162
- resolved: tt,
163
- own: et,
164
- refetch: Ke,
165
- loading: qe,
166
- error: Je,
157
+ ]), et = m(() => ({
158
+ resolved: $e,
159
+ own: Qe,
160
+ refetch: We,
161
+ loading: Ge,
162
+ error: Ke,
167
163
  analytics: Z,
168
- cascadeOrgId: E,
164
+ cascadeOrgId: T,
169
165
  initResponseStaleForToken: Y,
170
- disclosuresAcceptance: M,
171
- providerLabels: N
166
+ disclosuresAcceptance: A,
167
+ providerLabels: j
172
168
  }), [
173
- tt,
174
- et,
169
+ $e,
170
+ Qe,
171
+ We,
172
+ Ge,
175
173
  Ke,
176
- qe,
177
- Je,
178
174
  Z,
179
- E,
175
+ T,
180
176
  Y,
181
- M,
182
- N
183
- ]), rt = /* @__PURE__ */ _(ce.Provider, {
184
- value: nt,
177
+ A,
178
+ j
179
+ ]), tt = /* @__PURE__ */ _(ce.Provider, {
180
+ value: et,
185
181
  children: /* @__PURE__ */ _(ee, {
186
- linkComponent: k,
187
- uiFramework: A,
182
+ linkComponent: O,
183
+ uiFramework: k,
188
184
  children: /* @__PURE__ */ _(re, { children: /* @__PURE__ */ _(_e, {
189
- resetKeys: [T],
185
+ resetKeys: [w],
190
186
  errorFallback: we,
191
187
  onError: Te,
192
- labels: Ne,
193
- children: ve(J, x) ? /* @__PURE__ */ _(Ce, {
194
- disclosuresAcceptance: M,
188
+ labels: M,
189
+ children: ve(J, b) ? /* @__PURE__ */ _(Ce, {
190
+ disclosuresAcceptance: A,
195
191
  initStaleForToken: Y,
196
- labels: Ne
192
+ labels: M
197
193
  }) : ne
198
194
  }) })
199
195
  })
200
196
  }), $ = H ? /* @__PURE__ */ _(i, {
201
197
  client: H,
202
198
  organizationId: X,
203
- widgetToken: T,
204
- installClientSecret: ze,
205
- authEpoch: He,
206
- organizationStatus: $e,
207
- children: rt
208
- }) : rt;
199
+ widgetToken: w,
200
+ installClientSecret: Le,
201
+ authEpoch: Be,
202
+ organizationStatus: Ze,
203
+ children: tt
204
+ }) : tt;
209
205
  return Q ? /* @__PURE__ */ _(Se, {
210
206
  client: Q,
211
207
  children: $
@@ -1,4 +1,3 @@
1
- import "./types.js";
2
1
  import { getGlobalSnapshot as e, subscribeToGlobal as t } from "./globalStore.js";
3
2
  import { WidgetContext as n } from "./WidgetContext.js";
4
3
  import { noop as r } from "./utils.js";
@@ -1,4 +1,3 @@
1
- import "./types.js";
2
1
  import "./globalStore.js";
3
2
  import "./widgetInitChannel.js";
4
3
  import "./RootWidgetProvider.js";
@@ -3,7 +3,8 @@ var e = "widget-disclosures-required", t = /* @__PURE__ */ new Set([
3
3
  "accept_disclosures",
4
4
  "onboarding",
5
5
  "marketing",
6
- "widget_suite"
6
+ "widget_suite",
7
+ "banking_compliance_banner"
7
8
  ]);
8
9
  function n(e) {
9
10
  return e?.disclosuresRequired === "REQUIRED" && e?.disclosuresAccepted === !1;
@@ -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.7.53", n = "7578b8d55372de6e49003fd34e939eb610b5b66f", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.7.57", n = "5b361b9ab8a83f9f9e3afc8fed9495610a25615a", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -16,175 +16,174 @@ import { useOrganizationApplicationStatus as d } from "../../../../../shared/dat
16
16
  import "../../../../../shared/data-access/dist/index.js";
17
17
  import { ErrorState as f } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
18
18
  import "../../../../../shared/ui/dist/index.js";
19
- import { useAnalyticsTrack as p } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
20
- import { WidgetProvider as m } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
21
- import { useRefetchWidget as h, useWidgetConfig as ee, useWidgetError as g, useWidgetInitStaleForToken as _, useWidgetLoading as v } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
22
- import { deniedNoticeExpiresAt as te, selectBankAccountApplication as ne } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
19
+ import { useAnalyticsTrack as ee } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
20
+ import { WidgetProvider as p } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
21
+ import { useRefetchWidget as m, useWidgetConfig as te, useWidgetError as h, useWidgetInitStaleForToken as g, useWidgetLoading as _ } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
22
+ import { deniedNoticeExpiresAt as ne, selectBankAccountApplication as re } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
23
23
  import "../../../../../shared/feature/dist/index.js";
24
- import { WIDGET_SUITE_SECTIONS as re } from "./sections/index.js";
25
- import { WIDGET_NAME as y, WidgetSuiteAnalyticsEvent as b } from "../analytics/events.js";
26
- import { needsDisclosureAcceptance as x } from "./disclosureGate.js";
27
- import { AcceptDisclosuresWidget as ie } from "../../../../../accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
24
+ import { WIDGET_SUITE_SECTIONS as ie } from "./sections/index.js";
25
+ import { WIDGET_NAME as v, WidgetSuiteAnalyticsEvent as y } from "../analytics/events.js";
26
+ import { needsDisclosureAcceptance as b } from "./disclosureGate.js";
27
+ import { AcceptDisclosuresWidget as ae } from "../../../../../accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
28
28
  import "../../../../../accept-disclosures-widget/feature/dist/index.js";
29
- import { OnboardingApplicationView as S, onboardingApplicationViewFor as C } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js";
30
- import { BankAccountOnboardingWidget as ae } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js";
29
+ import { OnboardingApplicationView as x, onboardingApplicationViewFor as S } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js";
30
+ import { BankAccountOnboardingWidget as oe } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js";
31
31
  import "../../../../../bank-account-onboarding-widget/feature/dist/index.js";
32
- import { useCallback as w, useEffect as T, useMemo as oe, useReducer as E, useRef as D, useState as O } from "react";
33
- import { Fragment as se, jsx as k, jsxs as ce } from "react/jsx-runtime";
32
+ import { useCallback as C, useEffect as w, useMemo as se, useReducer as T, useRef as E, useState as D } from "react";
33
+ import { Fragment as ce, jsx as O, jsxs as le } from "react/jsx-runtime";
34
34
  //#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js
35
- var A = {
35
+ var k = {
36
36
  initFailed: "widget-suite-init-failed",
37
37
  disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
38
38
  applicationUnavailable: "widget-suite-application-unavailable"
39
- }, j = 2 ** 31 - 1;
40
- function M({ showSectionTitle: n = !0, onboardingDisclosureLinks: r, onApplicantLatchChange: a, onResultScreenHeldChange: s }) {
41
- let { availableSections: c, activeSection: p, labels: m, navigate: y } = o(), { initResponse: b } = ee(), M = g(), N = _(), P = v(), F = h(), I = u(), L = d(), R = oe(() => ne(L.applications), [L.applications]), z = D(null);
42
- L.isResolved && (z.current = { application: R });
43
- let B = L.isResolved ? R : z.current?.application ?? null, [le, ue] = E((e) => e + 1, 0), V = te(B);
44
- T(() => {
45
- if (V === null) return;
46
- let e = V - Date.now();
39
+ }, A = 2 ** 31 - 1;
40
+ function j({ showSectionTitle: n = !0, onboardingDisclosureLinks: r, onApplicantLatchChange: a, onResultScreenHeldChange: s }) {
41
+ let { availableSections: c, activeSection: ee, labels: p, navigate: v } = o(), { initResponse: y } = te(), j = h(), M = g(), N = _(), P = m(), F = u(), I = d(), L = se(() => re(I.applications), [I.applications]), R = E(null);
42
+ I.isResolved && (R.current = { application: L });
43
+ let z = I.isResolved ? L : R.current?.application ?? null, [ue, de] = T((e) => e + 1, 0), B = ne(z);
44
+ w(() => {
45
+ if (B === null) return;
46
+ let e = B - Date.now();
47
47
  if (e < 0) return;
48
- let t = setTimeout(ue, Math.min(e + 1, j));
48
+ let t = setTimeout(de, Math.min(e + 1, A));
49
49
  return () => clearTimeout(t);
50
- }, [V, le]);
51
- let H = C(B), [U, de] = O(!1), [W, fe] = O(!1), pe = I.isResolved || W, me = w((e) => y(e), [y]), [G, he] = O(!1), ge = w(() => he(!0), []), [K, _e] = O(!1), ve = K || U;
52
- T(() => {
53
- a(ve);
54
- }, [ve, a]);
55
- let [ye, be] = O(!1), xe = U && !ye;
56
- T(() => {
57
- s(xe);
58
- }, [xe, s]);
59
- let q = x(b), J = m.disclosure, Y = m.onboardingGate, X = b?.status === "INVITED", Se = b?.status === "ACTIVE" || b?.status === "INACTIVE", Ce = !!(b && N), we = Ce && (X || Se), Te = !b && !M || we && !M, Z = !!b && !Te && !Ce && !X && !Se && pe && I.reason === l.OrganizationApplicationComplete && !K, Q = D(!1), [Ee, De] = O(!1);
60
- T(() => {
61
- !q && G && he(!1);
62
- }, [G, q]), T(() => {
63
- I.isResolved && !W && fe(!0);
64
- }, [I.isResolved, W]), T(() => {
65
- Z ? Q.current || (Q.current = !0, De(!0), F()) : (Q.current = !1, De(!1));
66
- }, [Z, F]);
67
- let $ = () => /* @__PURE__ */ k(e, {
50
+ }, [B, ue]);
51
+ let V = S(z), [H, fe] = D(!1), [U, pe] = D(!1), me = F.isResolved || U, he = C((e) => v(e), [v]), [W, ge] = D(!1), _e = C(() => ge(!0), []), [G, ve] = D(!1), ye = G || H;
52
+ w(() => {
53
+ a(ye);
54
+ }, [ye, a]);
55
+ let [be, xe] = D(!1), Se = H && !be;
56
+ w(() => {
57
+ s(Se);
58
+ }, [Se, s]);
59
+ let K = b(y), q = p.disclosure, J = p.onboardingGate, Y = y?.status === "INVITED", X = y?.status === "ACTIVE" || y?.status === "INACTIVE", Ce = !!(y && M), we = Ce && (Y || X), Te = !y && !j || we && !j, Z = !!y && !Te && !Ce && !Y && !X && me && F.reason === l.OrganizationApplicationComplete && !G, Q = E(!1), [Ee, De] = D(!1);
60
+ w(() => {
61
+ !K && W && ge(!1);
62
+ }, [W, K]), w(() => {
63
+ F.isResolved && !U && pe(!0);
64
+ }, [F.isResolved, U]), w(() => {
65
+ Z ? Q.current || (Q.current = !0, De(!0), P()) : (Q.current = !1, De(!1));
66
+ }, [Z, P]);
67
+ let $ = () => /* @__PURE__ */ O(e, {
68
68
  isLoading: !0,
69
69
  sections: [],
70
70
  selectedSectionId: "",
71
- onSectionChange: me,
72
- labels: m.shell
71
+ onSectionChange: he,
72
+ labels: p.shell
73
73
  });
74
74
  if (Te) return $();
75
- if ((!b || we) && M) return /* @__PURE__ */ k(f, {
76
- title: J.initFailedState.title,
77
- description: J.initFailedState.body,
78
- retryLabel: J.initFailedState.retryButton,
79
- onRetry: F,
80
- testId: A.initFailed
75
+ if ((!y || we) && j) return /* @__PURE__ */ O(f, {
76
+ title: q.initFailedState.title,
77
+ description: q.initFailedState.body,
78
+ retryLabel: q.initFailedState.retryButton,
79
+ onRetry: P,
80
+ testId: k.initFailed
81
81
  });
82
- let Oe = () => G && M ? /* @__PURE__ */ k(f, {
83
- title: J.refreshFailedState.title,
84
- description: J.refreshFailedState.body,
85
- retryLabel: J.refreshFailedState.retryButton,
86
- onRetry: F,
87
- testId: A.disclosuresRefreshFailed
88
- }) : /* @__PURE__ */ k(ie, { onAccepted: ge });
89
- if (X || Se) {
90
- if (q) return Oe();
91
- } else return pe ? Z ? M || Ee && !P ? /* @__PURE__ */ k(f, {
92
- title: J.initFailedState.title,
93
- description: J.initFailedState.body,
94
- retryLabel: J.initFailedState.retryButton,
95
- onRetry: F,
96
- testId: A.initFailed
97
- }) : $() : !L.isResolved && H !== S.Form && !U ? $() : (H === S.Hidden || H === S.Form && I.isSuppressed) && B?.status !== "COMPLETE" && !U && !K ? /* @__PURE__ */ k(f, {
98
- title: Y.applicationUnavailableState.title,
99
- description: Y.applicationUnavailableState.body,
100
- retryLabel: Y.applicationUnavailableState.retryButton,
101
- onRetry: I.refetch,
102
- testId: A.applicationUnavailable
103
- }) : /* @__PURE__ */ k(ae, {
82
+ let Oe = () => W && j ? /* @__PURE__ */ O(f, {
83
+ title: q.refreshFailedState.title,
84
+ description: q.refreshFailedState.body,
85
+ retryLabel: q.refreshFailedState.retryButton,
86
+ onRetry: P,
87
+ testId: k.disclosuresRefreshFailed
88
+ }) : /* @__PURE__ */ O(ae, { onAccepted: _e });
89
+ if (Y || X) {
90
+ if (K) return Oe();
91
+ } else return me ? Z ? j || Ee && !N ? /* @__PURE__ */ O(f, {
92
+ title: q.initFailedState.title,
93
+ description: q.initFailedState.body,
94
+ retryLabel: q.initFailedState.retryButton,
95
+ onRetry: P,
96
+ testId: k.initFailed
97
+ }) : $() : !I.isResolved && V !== x.Form && !H ? $() : (V === x.Hidden || V === x.Form && F.isSuppressed) && z?.status !== "COMPLETE" && !H && !G ? /* @__PURE__ */ O(f, {
98
+ title: J.applicationUnavailableState.title,
99
+ description: J.applicationUnavailableState.body,
100
+ retryLabel: J.applicationUnavailableState.retryButton,
101
+ onRetry: F.refetch,
102
+ testId: k.applicationUnavailable
103
+ }) : /* @__PURE__ */ O(oe, {
104
104
  isFullScreenInline: !0,
105
105
  showApplicationStatusRefresh: !0,
106
- onResultPhaseChange: de,
107
- onEmbeddedOnboardingCompletedSuccessfully: () => _e(!0),
106
+ onResultPhaseChange: fe,
107
+ onEmbeddedOnboardingCompletedSuccessfully: () => ve(!0),
108
108
  onNavigateToDashboard: () => {
109
- be(!0), c.includes(i.Dashboard) && y(i.Dashboard), F();
109
+ xe(!0), c.includes(i.Dashboard) && v(i.Dashboard), P();
110
110
  },
111
111
  disclosureLinks: r,
112
- ...m.onboarding
112
+ ...p.onboarding
113
113
  }) : $();
114
- let ke = b?.bankName?.trim(), Ae = ke ? m.sectionTitle.bankTagline.replaceAll("{bankName}", ke) : void 0, je = c.map((e) => {
115
- let { Content: r, placesOwnTitle: a } = re[e], o = m.menu[e], s = e === i.Accounts ? void 0 : Ae, c = (e) => /* @__PURE__ */ k(t, {
114
+ let ke = y?.bankName?.trim(), Ae = ke ? p.sectionTitle.bankTagline.replaceAll("{bankName}", ke) : void 0, je = c.map((e) => {
115
+ let { Content: r, placesOwnTitle: a } = ie[e], o = p.menu[e], s = e === i.Accounts ? void 0 : Ae, c = (e) => /* @__PURE__ */ O(t, {
116
116
  title: o,
117
117
  bankTagline: s,
118
118
  children: e
119
- }), l = /* @__PURE__ */ k(r, {});
120
- return n && (l = a ? /* @__PURE__ */ k(r, { renderTitle: c }) : /* @__PURE__ */ ce(se, { children: [c(), /* @__PURE__ */ k(r, {})] })), {
119
+ }), l = /* @__PURE__ */ O(r, {});
120
+ return n && (l = a ? /* @__PURE__ */ O(r, { renderTitle: c }) : /* @__PURE__ */ le(ce, { children: [c(), /* @__PURE__ */ O(r, {})] })), {
121
121
  id: e,
122
122
  label: o,
123
123
  content: l
124
124
  };
125
125
  });
126
- return /* @__PURE__ */ k(e, {
126
+ return /* @__PURE__ */ O(e, {
127
127
  sections: je,
128
- selectedSectionId: p ?? "",
129
- onSectionChange: me,
130
- labels: m.shell
128
+ selectedSectionId: ee ?? "",
129
+ onSectionChange: he,
130
+ labels: p.shell
131
131
  });
132
132
  }
133
- function N({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, cardArtSrc: u, ...d }) {
134
- let f = p();
135
- T(() => {
136
- f(b.Mounted);
133
+ function M({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, cardArtSrc: u, ...d }) {
134
+ let f = ee();
135
+ w(() => {
136
+ f(y.Mounted);
137
137
  }, [f]);
138
- let { initResponse: m } = ee(), h = m?.scopes, { client: g, widgetToken: _ } = s(), v = m?.userId ?? null, [te, ne] = O(v), [y, x] = O(0);
139
- v !== te && (ne(v), te !== null && x((e) => e + 1));
140
- let [ie, S] = O(g);
141
- g !== ie && (S(g), x((e) => e + 1));
142
- let C = !!_, [ae, w] = O(C);
143
- C !== ae && (w(C), x((e) => e + 1));
144
- let E = m?.organizationId ?? null, [D, se] = O(E);
145
- E !== D && (se(E), D !== null && x((e) => e + 1));
146
- let [ce, A] = O(!1), [j, N] = O(!1), [P, F] = O(null), I = () => {
147
- A(!1), x((e) => e + 1);
148
- }, [L, R] = O(_);
149
- _ !== L && (R(_), ce && v === null && E === null && C === !!L && (j ? F(y) : I())), P !== null && !j && (F(null), P === y && v === null && E === null && I());
150
- let z = oe(() => n(l), [l]), B = e.filter((e) => {
151
- let t = re[e];
152
- return !!t && (!t.anyOfScopes || c(h, t.anyOfScopes));
138
+ let { initResponse: p } = te(), m = p?.scopes, { client: h, widgetToken: g } = s(), _ = p?.userId ?? null, [ne, re] = D(_), [v, b] = D(0);
139
+ _ !== ne && (re(_), ne !== null && b((e) => e + 1));
140
+ let [ae, x] = D(h);
141
+ h !== ae && (x(h), b((e) => e + 1));
142
+ let S = !!g, [oe, C] = D(S);
143
+ S !== oe && (C(S), b((e) => e + 1));
144
+ let T = p?.organizationId ?? null, [E, ce] = D(T);
145
+ T !== E && (ce(T), E !== null && b((e) => e + 1));
146
+ let [le, k] = D(!1), [A, M] = D(!1), [N, P] = D(null), F = () => {
147
+ k(!1), b((e) => e + 1);
148
+ }, [I, L] = D(g);
149
+ g !== I && (L(g), le && _ === null && T === null && S === !!I && (A ? P(v) : F())), N !== null && !A && (P(null), N === v && _ === null && T === null && F());
150
+ let R = se(() => n(l), [l]), z = e.filter((e) => {
151
+ let t = ie[e];
152
+ return !!t && (!t.anyOfScopes || c(m, t.anyOfScopes));
153
153
  });
154
- return /* @__PURE__ */ k(a, {
154
+ return /* @__PURE__ */ O(a, {
155
155
  sections: e,
156
- availableSections: B,
157
- grantedScopes: h,
158
- labels: z,
156
+ availableSections: z,
157
+ grantedScopes: m,
158
+ labels: R,
159
159
  section: t,
160
160
  defaultSection: i,
161
161
  onSectionChange: o,
162
162
  cardArtSrc: u,
163
- children: /* @__PURE__ */ k(M, {
164
- onApplicantLatchChange: A,
165
- onResultScreenHeldChange: N,
163
+ children: /* @__PURE__ */ O(j, {
164
+ onApplicantLatchChange: k,
165
+ onResultScreenHeldChange: M,
166
166
  ...d
167
- }, y)
167
+ }, v)
168
168
  });
169
169
  }
170
- function P({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...p }) {
171
- return /* @__PURE__ */ k(m, {
172
- widgetName: y,
170
+ function N({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: s, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: d, ...f }) {
171
+ return /* @__PURE__ */ O(p, {
172
+ widgetName: v,
173
173
  baseUrl: e,
174
174
  widgetToken: t,
175
175
  organizationId: n,
176
176
  configClient: r,
177
177
  gatewayRouting: i,
178
178
  linkComponent: a,
179
- implementation: o,
180
- uiFramework: s,
181
- errorFallback: c,
182
- onError: l,
183
- analytics: u,
184
- disclosuresAcceptance: d,
185
- providerLabels: f,
186
- children: /* @__PURE__ */ k(N, { ...p })
179
+ uiFramework: o,
180
+ errorFallback: s,
181
+ onError: c,
182
+ analytics: l,
183
+ disclosuresAcceptance: u,
184
+ providerLabels: d,
185
+ children: /* @__PURE__ */ O(M, { ...f })
187
186
  });
188
187
  }
189
188
  //#endregion
190
- export { A as WIDGET_SUITE_TEST_IDS, P as WidgetSuite, P as default };
189
+ export { k as WIDGET_SUITE_TEST_IDS, N as WidgetSuite, N as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.7.53",
3
+ "version": "0.7.57",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,8 +0,0 @@
1
- //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/types.js
2
- var e = {
3
- Native: "native",
4
- Monite: "monite"
5
- };
6
- e.Native;
7
- //#endregion
8
- export { e as Implementation };