@tesouro/embedded-components-react 0.3.26 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/experimental/WidgetSuite.d.ts +32 -3
- package/dist/experimental/index.d.ts +32 -3
- package/dist/index.d.ts +60 -25
- package/dist/lib/AcceptDisclosuresWidget.d.ts +32 -3
- package/dist/lib/BalancesWidget.d.ts +31 -2
- package/dist/lib/BankAccountOnboardingWidget.d.ts +32 -3
- package/dist/lib/BankAccountsWidget.d.ts +32 -3
- package/dist/lib/BillPayWidget.d.ts +31 -2
- package/dist/lib/CardDetailsWidget.d.ts +32 -3
- package/dist/lib/CardsWidget.d.ts +32 -3
- package/dist/lib/ChartOfAccountsWidget.d.ts +32 -3
- package/dist/lib/CounterpartsWidget.d.ts +32 -3
- package/dist/lib/CreateCardWidget.d.ts +32 -3
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +32 -3
- package/dist/lib/ExpenseManagementWidget.d.ts +32 -3
- package/dist/lib/ExpenseRequirementsWidget.d.ts +32 -3
- package/dist/lib/HelpWidget.d.ts +32 -3
- package/dist/lib/InsightsWidget.d.ts +31 -2
- package/dist/lib/InvoicingWidget.d.ts +32 -3
- package/dist/lib/LinkedAccountsWidget.d.ts +32 -3
- package/dist/lib/ProductsWidget.d.ts +32 -3
- package/dist/lib/ProfileWidget.d.ts +32 -3
- package/dist/lib/ReceiptMatchWidget.d.ts +32 -3
- package/dist/lib/ReceivablesWidget.d.ts +32 -3
- package/dist/lib/SettingsWidget.d.ts +32 -3
- package/dist/lib/TagsWidget.d.ts +32 -3
- package/dist/lib/TeamWidget.d.ts +32 -3
- package/dist/lib/TransfersWidget.d.ts +31 -2
- package/dist/lib/WidgetProvider.d.ts +39 -4
- package/dist/lib/WidgetProviderPublic.d.ts +31 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +131 -130
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +88 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +50 -48
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetErrorBoundary.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +174 -163
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/events.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +3 -2
- package/package.json +1 -1
|
@@ -4,40 +4,40 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
6
|
import { createEmbeddedClient as ee } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
-
import { EmbedApiProvider as
|
|
7
|
+
import { EmbedApiProvider as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import "../../../../data-access/dist/index.js";
|
|
9
|
-
import { getGlobalSnapshot as
|
|
10
|
-
import { configureEmbeddedClient as
|
|
11
|
-
import { generateCorrelationId as
|
|
12
|
-
import { WidgetContext as
|
|
13
|
-
import { resolveOrgId as
|
|
14
|
-
import { useWidgetFetch as
|
|
15
|
-
import { deriveWidgetInitState as
|
|
16
|
-
import { resolveUIFramework as
|
|
17
|
-
import { UIProvider as
|
|
18
|
-
import { useDesignSystemEnsurer as
|
|
9
|
+
import { getGlobalSnapshot as n, subscribeToGlobal as ne } from "./globalStore.js";
|
|
10
|
+
import { configureEmbeddedClient as re } from "../analytics/client.js";
|
|
11
|
+
import { generateCorrelationId as ie } from "../analytics/ids.js";
|
|
12
|
+
import { WidgetContext as r } from "./WidgetContext.js";
|
|
13
|
+
import { resolveOrgId as i, useAuthEpoch as ae } from "./utils.js";
|
|
14
|
+
import { useWidgetFetch as oe } from "./useWidgetFetch.js";
|
|
15
|
+
import { deriveWidgetInitState as se, useWidgetInitPublisher as ce } from "./useWidgetInitPublisher.js";
|
|
16
|
+
import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
17
|
+
import { UIProvider as o } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
18
|
+
import { useDesignSystemEnsurer as le } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
19
19
|
import "../../../../ui/dist/index.js";
|
|
20
|
-
import { useEffect as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { QueryClient as
|
|
20
|
+
import { useEffect as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
|
|
21
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
22
|
+
import { QueryClient as p, QueryClientProvider as m } from "@tanstack/react-query";
|
|
23
23
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
24
|
-
function
|
|
25
|
-
let O =
|
|
24
|
+
function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, implementation: C, analytics: w, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
|
|
25
|
+
let O = d(ne, n, n), k = g ?? O.baseUrl, A = _ === void 0 ? O.widgetToken : _, j = v === void 0 ? O.organizationId : v, M = y ?? O.configClient, N = b ?? O.gatewayRouting, P = x ?? O.linkComponent, F = S ?? O.uiFramework, I = C ?? O.implementation, L = w !== !1, [R] = u(ie), z = l({
|
|
26
26
|
enabled: L,
|
|
27
27
|
organizationId: j,
|
|
28
28
|
rootCorrelationId: R
|
|
29
|
-
}), [B] =
|
|
29
|
+
}), [B] = u(() => new p({ defaultOptions: {
|
|
30
30
|
queries: {
|
|
31
31
|
retry: !1,
|
|
32
32
|
refetchOnWindowFocus: !1
|
|
33
33
|
},
|
|
34
34
|
mutations: { retry: !1 }
|
|
35
35
|
} }));
|
|
36
|
-
|
|
37
|
-
let V =
|
|
36
|
+
s(() => (e(B), () => t(B)), [B]);
|
|
37
|
+
let V = l(A);
|
|
38
38
|
V.current = A;
|
|
39
|
-
let H =
|
|
40
|
-
let e =
|
|
39
|
+
let H = ae(A), U = c(() => {
|
|
40
|
+
let e = re(ee(k), {
|
|
41
41
|
tokenRef: V,
|
|
42
42
|
analyticsContextRef: z,
|
|
43
43
|
gatewayRouting: N
|
|
@@ -48,7 +48,7 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
48
48
|
M,
|
|
49
49
|
N
|
|
50
50
|
]);
|
|
51
|
-
|
|
51
|
+
s(() => {
|
|
52
52
|
if (!L || !("window" in globalThis)) return;
|
|
53
53
|
let e = !1;
|
|
54
54
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -57,11 +57,11 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
57
57
|
e = !0;
|
|
58
58
|
};
|
|
59
59
|
}, [L]);
|
|
60
|
-
let W =
|
|
61
|
-
|
|
60
|
+
let W = le(a(F));
|
|
61
|
+
s(() => {
|
|
62
62
|
W && W().catch(() => {});
|
|
63
63
|
}, [W]);
|
|
64
|
-
let { result:
|
|
64
|
+
let { result: ue, loading: G, error: K, initStaleForToken: de, refetch: q } = oe(T ? null : U, A, z), J = A ? T ?? ue ?? void 0 : void 0, Y = !T && de, X = i(j, Y ? void 0 : J?.organizationId), fe = c(() => se({
|
|
65
65
|
hasToken: !!A,
|
|
66
66
|
loading: G,
|
|
67
67
|
error: K,
|
|
@@ -74,8 +74,8 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
74
74
|
J,
|
|
75
75
|
Y
|
|
76
76
|
]);
|
|
77
|
-
|
|
78
|
-
let Z =
|
|
77
|
+
ce(fe, A);
|
|
78
|
+
let Z = c(() => ({
|
|
79
79
|
enabled: L,
|
|
80
80
|
organizationId: X,
|
|
81
81
|
rootCorrelationId: R
|
|
@@ -85,25 +85,25 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
85
85
|
R
|
|
86
86
|
]);
|
|
87
87
|
z.current = Z;
|
|
88
|
-
let Q =
|
|
89
|
-
baseUrl:
|
|
90
|
-
widgetToken:
|
|
91
|
-
organizationId:
|
|
92
|
-
configClient:
|
|
93
|
-
gatewayRouting:
|
|
94
|
-
linkComponent:
|
|
95
|
-
uiFramework:
|
|
96
|
-
implementation:
|
|
88
|
+
let Q = c(() => ({
|
|
89
|
+
baseUrl: g,
|
|
90
|
+
widgetToken: _,
|
|
91
|
+
organizationId: v,
|
|
92
|
+
configClient: y,
|
|
93
|
+
gatewayRouting: b,
|
|
94
|
+
linkComponent: x,
|
|
95
|
+
uiFramework: S,
|
|
96
|
+
implementation: C
|
|
97
97
|
}), [
|
|
98
|
+
g,
|
|
98
99
|
_,
|
|
99
100
|
v,
|
|
100
101
|
y,
|
|
101
102
|
b,
|
|
102
103
|
x,
|
|
103
104
|
S,
|
|
104
|
-
C
|
|
105
|
-
|
|
106
|
-
]), $ = u(() => ({
|
|
105
|
+
C
|
|
106
|
+
]), $ = c(() => ({
|
|
107
107
|
baseUrl: k,
|
|
108
108
|
widgetToken: A,
|
|
109
109
|
organizationId: X,
|
|
@@ -123,7 +123,7 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
123
123
|
F,
|
|
124
124
|
I,
|
|
125
125
|
J
|
|
126
|
-
]),
|
|
126
|
+
]), pe = c(() => ({
|
|
127
127
|
resolved: $,
|
|
128
128
|
own: Q,
|
|
129
129
|
refetch: q,
|
|
@@ -132,7 +132,8 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
132
132
|
analytics: Z,
|
|
133
133
|
cascadeOrgId: j,
|
|
134
134
|
initResponseStaleForToken: Y,
|
|
135
|
-
disclosuresAcceptance:
|
|
135
|
+
disclosuresAcceptance: E,
|
|
136
|
+
providerLabels: D
|
|
136
137
|
}), [
|
|
137
138
|
$,
|
|
138
139
|
Q,
|
|
@@ -142,25 +143,26 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
142
143
|
Z,
|
|
143
144
|
j,
|
|
144
145
|
Y,
|
|
146
|
+
E,
|
|
145
147
|
D
|
|
146
148
|
]);
|
|
147
|
-
return /* @__PURE__ */ m
|
|
149
|
+
return /* @__PURE__ */ f(m, {
|
|
148
150
|
client: B,
|
|
149
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ f(te, {
|
|
150
152
|
client: U,
|
|
151
153
|
organizationId: X,
|
|
152
154
|
widgetToken: A,
|
|
153
155
|
authEpoch: H,
|
|
154
|
-
children: /* @__PURE__ */
|
|
155
|
-
value:
|
|
156
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ f(r.Provider, {
|
|
157
|
+
value: pe,
|
|
158
|
+
children: /* @__PURE__ */ f(o, {
|
|
157
159
|
linkComponent: P,
|
|
158
160
|
uiFramework: F,
|
|
159
|
-
children:
|
|
161
|
+
children: h
|
|
160
162
|
})
|
|
161
163
|
})
|
|
162
164
|
})
|
|
163
165
|
});
|
|
164
166
|
}
|
|
165
167
|
//#endregion
|
|
166
|
-
export {
|
|
168
|
+
export { h as RootWidgetProvider };
|
|
@@ -11,34 +11,34 @@ import { QueryErrorResetBoundary as o } from "@tanstack/react-query";
|
|
|
11
11
|
import { ErrorBoundary as s } from "react-error-boundary";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetErrorBoundary.js
|
|
13
13
|
var c = 256, l = 1024;
|
|
14
|
-
function u() {
|
|
14
|
+
function u({ message: e }) {
|
|
15
15
|
return /* @__PURE__ */ a("div", {
|
|
16
16
|
role: "alert",
|
|
17
|
-
children:
|
|
17
|
+
children: e
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function d(e, t) {
|
|
21
21
|
return e.length > t ? `${e.slice(0, t)}...` : e;
|
|
22
22
|
}
|
|
23
|
-
function f({ resetKeys:
|
|
24
|
-
let
|
|
23
|
+
function f({ resetKeys: f, errorFallback: p, onError: m, labels: h = r, children: g }) {
|
|
24
|
+
let _ = n(), v = t(), y = i((t, n) => {
|
|
25
25
|
let r = t instanceof Error ? t : /* @__PURE__ */ Error("Unknown widget error"), i = d(n.componentStack ?? "", l);
|
|
26
|
-
|
|
26
|
+
_(e.WidgetError, {
|
|
27
27
|
error_name: r.name,
|
|
28
28
|
error_message: d(r.message, c),
|
|
29
29
|
component_stack: i
|
|
30
|
-
}),
|
|
30
|
+
}), v(r, { component_stack: i }), m?.(t, n);
|
|
31
31
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
_,
|
|
33
|
+
v,
|
|
34
|
+
m
|
|
35
35
|
]);
|
|
36
36
|
return /* @__PURE__ */ a(o, { children: ({ reset: e }) => /* @__PURE__ */ a(s, {
|
|
37
|
-
resetKeys: [...
|
|
37
|
+
resetKeys: [...f],
|
|
38
38
|
onReset: e,
|
|
39
|
-
onError:
|
|
40
|
-
...typeof
|
|
41
|
-
children:
|
|
39
|
+
onError: y,
|
|
40
|
+
...typeof p == "function" ? { fallbackRender: p } : p === void 0 ? { fallback: /* @__PURE__ */ a(u, { message: h.errorBoundaryFallback }) } : { fallback: p },
|
|
41
|
+
children: g
|
|
42
42
|
}) });
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
@@ -4,208 +4,219 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
6
|
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
-
import { EmbedApiProvider as
|
|
7
|
+
import { EmbedApiProvider as r, useEmbedApi as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import "../../../../data-access/dist/index.js";
|
|
9
|
-
import { getGlobalSnapshot as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
9
|
+
import { getGlobalSnapshot as a, subscribeToGlobal as o } from "./globalStore.js";
|
|
10
|
+
import { EmbeddedAnalyticsEvent as s } from "../analytics/events.js";
|
|
11
|
+
import { configureEmbeddedClient as ee } from "../analytics/client.js";
|
|
12
|
+
import { generateCorrelationId as te } from "../analytics/ids.js";
|
|
13
|
+
import { WidgetContext as ne } from "./WidgetContext.js";
|
|
14
|
+
import { noop as re, resolveOrgId as ie, useAuthEpoch as ae } from "./utils.js";
|
|
15
|
+
import { useWidgetFetch as oe } from "./useWidgetFetch.js";
|
|
16
|
+
import { deriveWidgetInitState as se, useWidgetInitPublisher as ce } from "./useWidgetInitPublisher.js";
|
|
17
|
+
import { resolveUIFramework as le } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
18
|
+
import { UIProvider as ue } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
19
|
+
import { useDesignSystemEnsurer as de, useFrameworkRenderer as c } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
20
|
+
import { HostIsolationScope as fe } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
21
|
+
import { ErrorState as l } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
21
22
|
import "../../../../ui/dist/index.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
23
|
+
import { useAnalyticsTrack as u } from "../analytics/hooks.js";
|
|
24
|
+
import { resolveProviderLabels as pe } from "./labels.js";
|
|
25
|
+
import { WidgetErrorBoundary as me } from "./WidgetErrorBoundary.js";
|
|
26
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as d, hasRenderableAcceptanceSurface as f, resolveDisclosuresBlockedReason as p, shouldGateOnDisclosuresAcceptance as he } from "./isDisclosuresAcceptanceRequired.js";
|
|
27
|
+
import { useContext as ge, useEffect as m, useMemo as h, useRef as g, useState as _, useSyncExternalStore as _e } from "react";
|
|
28
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
29
|
+
import { QueryClient as ve, QueryClientProvider as ye } from "@tanstack/react-query";
|
|
28
30
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
enabled:
|
|
32
|
-
organizationId:
|
|
33
|
-
rootCorrelationId:
|
|
34
|
-
widgetName:
|
|
35
|
-
widgetInstanceId:
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
if (!
|
|
31
|
+
function y({ children: s, baseUrl: c, widgetToken: l, organizationId: u, configClient: d, gatewayRouting: f, linkComponent: p, uiFramework: y, implementation: b, errorFallback: xe, onError: Se, analytics: x, disclosuresAcceptance: Ce, providerLabels: we, widgetName: S }) {
|
|
32
|
+
let C = ge(ne), Te = _e(o, a, a), w = C?.resolved ?? Te, Ee = C?.refetch ?? re, De = C?.loading ?? !1, Oe = C?.error ?? null, T = c ?? w.baseUrl, E = l === void 0 ? w.widgetToken : l, ke = C ? C.cascadeOrgId : Te.organizationId, D = u === void 0 ? ke : u, O = d ?? w.configClient, k = f ?? w.gatewayRouting, A = p ?? w.linkComponent, j = y ?? w.uiFramework, Ae = b ?? w.implementation, M = Ce ?? C?.disclosuresAcceptance, N = we ?? C?.providerLabels, je = h(() => pe(N), [N]), P = C === null, F = P ? x !== !1 : C.analytics.enabled, [Me] = _(te), I = P ? Me : C.analytics.rootCorrelationId, [Ne] = _(te), L = S === void 0 ? C?.analytics.widgetName : S, R = S === void 0 ? C?.analytics.widgetInstanceId : Ne, z = g({
|
|
33
|
+
enabled: F,
|
|
34
|
+
organizationId: D,
|
|
35
|
+
rootCorrelationId: I,
|
|
36
|
+
widgetName: L,
|
|
37
|
+
widgetInstanceId: R
|
|
38
|
+
}), Pe = g(!1);
|
|
39
|
+
m(() => {
|
|
40
|
+
P || x === void 0 || Pe.current || (Pe.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."));
|
|
41
|
+
}, [x, P]), m(() => {
|
|
42
|
+
if (!P || !F || !("window" in globalThis)) return;
|
|
41
43
|
let e = !1;
|
|
42
44
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
43
45
|
e || t();
|
|
44
46
|
}), () => {
|
|
45
47
|
e = !0;
|
|
46
48
|
};
|
|
47
|
-
}, [
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
let
|
|
55
|
-
if (!
|
|
56
|
-
let e =
|
|
57
|
-
tokenRef:
|
|
58
|
-
analyticsContextRef:
|
|
59
|
-
gatewayRouting:
|
|
49
|
+
}, [P, F]);
|
|
50
|
+
let B = de(le(j));
|
|
51
|
+
m(() => {
|
|
52
|
+
B && B().catch(() => {});
|
|
53
|
+
}, [B]);
|
|
54
|
+
let Fe = C === null || c !== void 0 || l !== void 0 || u !== void 0 || d != null || f !== void 0 || S !== void 0, Ie = g(E);
|
|
55
|
+
Ie.current = E;
|
|
56
|
+
let Le = i(), Re = ae(E), V = h(() => {
|
|
57
|
+
if (!Fe) return null;
|
|
58
|
+
let e = ee(n(T), {
|
|
59
|
+
tokenRef: Ie,
|
|
60
|
+
analyticsContextRef: z,
|
|
61
|
+
gatewayRouting: k
|
|
60
62
|
});
|
|
61
|
-
return
|
|
63
|
+
return O ? O(e) : e;
|
|
62
64
|
}, [
|
|
63
|
-
|
|
64
|
-
S,
|
|
65
|
+
Fe,
|
|
65
66
|
T,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
O,
|
|
68
|
+
k
|
|
69
|
+
]), H = C === null || c !== void 0 || l !== void 0, ze = H ? Re : Le.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Be, initStaleForToken: K, refetch: Ve } = oe(H ? V : null, H ? E : void 0, z), He = H ? Ve : Ee, Ue = H ? W : De, We = H ? G : Oe, Ge = C?.resolved.initResponse, Ke = !H || !Be && !G && !U && !!E && !W, q = Ke ? Ge : U ?? void 0, J = Ke ? H || (C?.initResponseStaleForToken ?? !1) : K, Y = C === null, qe = h(() => Y ? se({
|
|
70
|
+
hasToken: !!E,
|
|
71
|
+
loading: W,
|
|
72
|
+
error: G,
|
|
73
|
+
initResponse: U ?? void 0,
|
|
74
|
+
initStaleForToken: K
|
|
73
75
|
}) : null, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
Y,
|
|
77
|
+
E,
|
|
78
|
+
W,
|
|
79
|
+
G,
|
|
77
80
|
U,
|
|
78
|
-
|
|
79
|
-
W
|
|
81
|
+
K
|
|
80
82
|
]);
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
enabled:
|
|
84
|
-
organizationId:
|
|
85
|
-
rootCorrelationId:
|
|
86
|
-
widgetName:
|
|
87
|
-
widgetInstanceId:
|
|
83
|
+
ce(qe, E);
|
|
84
|
+
let X = ie(D, J ? void 0 : q?.organizationId), Z = h(() => ({
|
|
85
|
+
enabled: F,
|
|
86
|
+
organizationId: X,
|
|
87
|
+
rootCorrelationId: I,
|
|
88
|
+
widgetName: L,
|
|
89
|
+
widgetInstanceId: R
|
|
88
90
|
}), [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
F,
|
|
92
|
+
X,
|
|
93
|
+
I,
|
|
94
|
+
L,
|
|
95
|
+
R
|
|
94
96
|
]);
|
|
95
|
-
|
|
96
|
-
let [
|
|
97
|
+
z.current = Z;
|
|
98
|
+
let [Q] = _(() => C === null ? new ve({ defaultOptions: {
|
|
97
99
|
queries: {
|
|
98
100
|
retry: !1,
|
|
99
101
|
refetchOnWindowFocus: !1
|
|
100
102
|
},
|
|
101
103
|
mutations: { retry: !1 }
|
|
102
104
|
} }) : null);
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
let n =
|
|
105
|
+
m(() => {
|
|
106
|
+
if (!Q) return;
|
|
107
|
+
let n = Q;
|
|
106
108
|
return e(n), () => t(n);
|
|
107
|
-
}, [
|
|
108
|
-
let
|
|
109
|
-
baseUrl:
|
|
110
|
-
widgetToken:
|
|
111
|
-
organizationId:
|
|
112
|
-
configClient:
|
|
113
|
-
gatewayRouting:
|
|
114
|
-
linkComponent:
|
|
115
|
-
uiFramework:
|
|
116
|
-
implementation:
|
|
109
|
+
}, [Q]);
|
|
110
|
+
let Je = h(() => ({
|
|
111
|
+
baseUrl: c,
|
|
112
|
+
widgetToken: l,
|
|
113
|
+
organizationId: u,
|
|
114
|
+
configClient: d,
|
|
115
|
+
gatewayRouting: f,
|
|
116
|
+
linkComponent: p,
|
|
117
|
+
uiFramework: y,
|
|
118
|
+
implementation: b
|
|
117
119
|
}), [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
c,
|
|
121
|
+
l,
|
|
122
|
+
u,
|
|
123
|
+
d,
|
|
124
|
+
f,
|
|
121
125
|
p,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
implementation: k,
|
|
135
|
-
initResponse: Y
|
|
126
|
+
y,
|
|
127
|
+
b
|
|
128
|
+
]), Ye = h(() => ({
|
|
129
|
+
baseUrl: T,
|
|
130
|
+
widgetToken: E,
|
|
131
|
+
organizationId: X,
|
|
132
|
+
configClient: O,
|
|
133
|
+
gatewayRouting: k,
|
|
134
|
+
linkComponent: A,
|
|
135
|
+
uiFramework: j,
|
|
136
|
+
implementation: Ae,
|
|
137
|
+
initResponse: q
|
|
136
138
|
}), [
|
|
137
|
-
S,
|
|
138
|
-
C,
|
|
139
|
-
Z,
|
|
140
139
|
T,
|
|
141
140
|
E,
|
|
142
|
-
|
|
141
|
+
X,
|
|
143
142
|
O,
|
|
144
143
|
k,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
A,
|
|
145
|
+
j,
|
|
146
|
+
Ae,
|
|
147
|
+
q
|
|
148
|
+
]), Xe = h(() => ({
|
|
149
|
+
resolved: Ye,
|
|
150
|
+
own: Je,
|
|
151
|
+
refetch: He,
|
|
152
|
+
loading: Ue,
|
|
153
|
+
error: We,
|
|
154
|
+
analytics: Z,
|
|
155
|
+
cascadeOrgId: D,
|
|
156
|
+
initResponseStaleForToken: J,
|
|
157
|
+
disclosuresAcceptance: M,
|
|
158
|
+
providerLabels: N
|
|
156
159
|
}), [
|
|
157
|
-
|
|
160
|
+
Ye,
|
|
161
|
+
Je,
|
|
162
|
+
He,
|
|
158
163
|
Ue,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
children:
|
|
176
|
-
disclosuresAcceptance:
|
|
177
|
-
initStaleForToken:
|
|
178
|
-
|
|
164
|
+
We,
|
|
165
|
+
Z,
|
|
166
|
+
D,
|
|
167
|
+
J,
|
|
168
|
+
M,
|
|
169
|
+
N
|
|
170
|
+
]), Ze = /* @__PURE__ */ v(ne.Provider, {
|
|
171
|
+
value: Xe,
|
|
172
|
+
children: /* @__PURE__ */ v(ue, {
|
|
173
|
+
linkComponent: A,
|
|
174
|
+
uiFramework: j,
|
|
175
|
+
children: /* @__PURE__ */ v(fe, { children: /* @__PURE__ */ v(me, {
|
|
176
|
+
resetKeys: [E],
|
|
177
|
+
errorFallback: xe,
|
|
178
|
+
onError: Se,
|
|
179
|
+
labels: je,
|
|
180
|
+
children: he(q, S) ? /* @__PURE__ */ v(be, {
|
|
181
|
+
disclosuresAcceptance: M,
|
|
182
|
+
initStaleForToken: J,
|
|
183
|
+
labels: je
|
|
184
|
+
}) : s
|
|
179
185
|
}) })
|
|
180
186
|
})
|
|
181
|
-
}),
|
|
182
|
-
client:
|
|
183
|
-
organizationId:
|
|
184
|
-
widgetToken:
|
|
185
|
-
authEpoch:
|
|
186
|
-
children:
|
|
187
|
-
}) :
|
|
188
|
-
return
|
|
189
|
-
client:
|
|
190
|
-
children:
|
|
191
|
-
}) :
|
|
187
|
+
}), $ = V ? /* @__PURE__ */ v(r, {
|
|
188
|
+
client: V,
|
|
189
|
+
organizationId: X,
|
|
190
|
+
widgetToken: E,
|
|
191
|
+
authEpoch: ze,
|
|
192
|
+
children: Ze
|
|
193
|
+
}) : Ze;
|
|
194
|
+
return Q ? /* @__PURE__ */ v(ye, {
|
|
195
|
+
client: Q,
|
|
196
|
+
children: $
|
|
197
|
+
}) : $;
|
|
192
198
|
}
|
|
193
|
-
function
|
|
194
|
-
let
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
title:
|
|
202
|
-
|
|
199
|
+
function be({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
200
|
+
let r = c("error-state") ?? l, i = u(), a = f(e), o = p({
|
|
201
|
+
initStaleForToken: t,
|
|
202
|
+
hasAcceptanceSurface: a
|
|
203
|
+
});
|
|
204
|
+
return m(() => {
|
|
205
|
+
i(s.WidgetDisclosuresBlocked, { reason: o }), console.info(`[disclosures] widget blocked: ${o}`);
|
|
206
|
+
}, [o, i]), t ? /* @__PURE__ */ v(r, {
|
|
207
|
+
title: n.disclosuresRefreshingTitle,
|
|
208
|
+
description: n.disclosuresRefreshingDescription,
|
|
209
|
+
testId: d,
|
|
203
210
|
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
204
|
-
}) : /* @__PURE__ */
|
|
205
|
-
"data-testid":
|
|
211
|
+
}) : a ? /* @__PURE__ */ v("div", {
|
|
212
|
+
"data-testid": d,
|
|
206
213
|
className: "ttw:w-full",
|
|
207
214
|
children: e
|
|
215
|
+
}) : /* @__PURE__ */ v(r, {
|
|
216
|
+
title: n.disclosuresRequiredTitle,
|
|
217
|
+
testId: d,
|
|
218
|
+
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
208
219
|
});
|
|
209
220
|
}
|
|
210
221
|
//#endregion
|
|
211
|
-
export {
|
|
222
|
+
export { y as WidgetProvider, y as default };
|
|
@@ -13,5 +13,16 @@ function r(e) {
|
|
|
13
13
|
function i(e, t) {
|
|
14
14
|
return t !== void 0 && n(e) && !r(t);
|
|
15
15
|
}
|
|
16
|
+
function a(e) {
|
|
17
|
+
return e != null && typeof e != "boolean" && e !== "";
|
|
18
|
+
}
|
|
19
|
+
var o = {
|
|
20
|
+
AcceptanceSurfaceShown: "acceptance_surface_shown",
|
|
21
|
+
NoAcceptanceSurface: "no_acceptance_surface",
|
|
22
|
+
InitStaleForToken: "init_stale_for_token"
|
|
23
|
+
};
|
|
24
|
+
function s({ initStaleForToken: e, hasAcceptanceSurface: t }) {
|
|
25
|
+
return e ? o.InitStaleForToken : t ? o.AcceptanceSurfaceShown : o.NoAcceptanceSurface;
|
|
26
|
+
}
|
|
16
27
|
//#endregion
|
|
17
|
-
export { e as DISCLOSURES_REQUIRED_TEST_ID, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
|
|
28
|
+
export { e as DISCLOSURES_REQUIRED_TEST_ID, o as DisclosuresBlockedReason, a as hasRenderableAcceptanceSurface, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, s as resolveDisclosuresBlockedReason, i as shouldGateOnDisclosuresAcceptance };
|