@tesouro/embedded-components-react 0.11.275 → 0.11.276
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/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +106 -106
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +142 -146
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -3,179 +3,179 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { EmbedApiProvider as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { createEmbeddedClient as t } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
+
import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
9
8
|
import "../../../../data-access/dist/index.js";
|
|
10
|
-
import { resolveUIFramework as
|
|
9
|
+
import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
11
10
|
import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
12
11
|
import { useDesignSystemEnsurer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
13
12
|
import "../../../../ui/dist/index.js";
|
|
14
|
-
import { getGlobalSnapshot as
|
|
13
|
+
import { getGlobalSnapshot as i, subscribeToGlobal as ne } from "./globalStore.js";
|
|
15
14
|
import { configureEmbeddedClient as re } from "../analytics/client.js";
|
|
16
|
-
import { generateCorrelationId as
|
|
17
|
-
import { WidgetContext as
|
|
18
|
-
import { resolveOrgId as
|
|
19
|
-
import { useWidgetFetch as
|
|
20
|
-
import { deriveOrganizationStatus as
|
|
21
|
-
import { deriveWidgetInitState as
|
|
22
|
-
import { useTokenRefreshRef as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
15
|
+
import { generateCorrelationId as a } from "../analytics/ids.js";
|
|
16
|
+
import { WidgetContext as o } from "./WidgetContext.js";
|
|
17
|
+
import { resolveOrgId as s, useAuthEpoch as c } from "./utils.js";
|
|
18
|
+
import { useWidgetFetch as l } from "./useWidgetFetch.js";
|
|
19
|
+
import { deriveOrganizationStatus as u } from "./deriveOrganizationStatus.js";
|
|
20
|
+
import { deriveWidgetInitState as ie, useWidgetInitPublisher as ae } from "./useWidgetInitPublisher.js";
|
|
21
|
+
import { useTokenRefreshRef as oe } from "./useTokenRefreshRef.js";
|
|
22
|
+
import { useOwnedQueryClient as se } from "./useOwnedQueryClient.js";
|
|
23
|
+
import { useEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
24
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
25
|
+
import { QueryClient as ce, QueryClientProvider as le } from "@tanstack/react-query";
|
|
26
26
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
enabled:
|
|
30
|
-
organizationId:
|
|
31
|
-
rootCorrelationId:
|
|
32
|
-
}), [
|
|
27
|
+
function _({ children: _, baseUrl: v, widgetToken: y, organizationId: b, configClient: x, gatewayRouting: S, linkComponent: C, uiFramework: w, analytics: ue, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
|
|
28
|
+
let O = h(ne, i, i), k = v ?? O.baseUrl, A = y === void 0 ? O.widgetToken : y, j = b === void 0 ? O.organizationId : b, M = x ?? O.configClient, N = S ?? O.gatewayRouting, P = C ?? O.linkComponent, F = w ?? O.uiFramework, I = ue !== !1, [L] = m(a), R = p({
|
|
29
|
+
enabled: I,
|
|
30
|
+
organizationId: j,
|
|
31
|
+
rootCorrelationId: L
|
|
32
|
+
}), [z] = m(() => new ce({ defaultOptions: {
|
|
33
33
|
queries: {
|
|
34
34
|
retry: !1,
|
|
35
35
|
refetchOnWindowFocus: !1
|
|
36
36
|
},
|
|
37
37
|
mutations: { retry: !1 }
|
|
38
38
|
} }));
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
let e = re(
|
|
44
|
-
tokenRef:
|
|
45
|
-
analyticsContextRef:
|
|
46
|
-
clientSecretRef:
|
|
47
|
-
gatewayRouting:
|
|
48
|
-
refreshTokenRef:
|
|
39
|
+
se(z);
|
|
40
|
+
let B = p(A);
|
|
41
|
+
B.current = A;
|
|
42
|
+
let V = oe(), H = p(null), de = f(() => e(H), []), fe = c(A), U = f(() => {
|
|
43
|
+
let e = re(t(k), {
|
|
44
|
+
tokenRef: B,
|
|
45
|
+
analyticsContextRef: R,
|
|
46
|
+
clientSecretRef: H,
|
|
47
|
+
gatewayRouting: N,
|
|
48
|
+
refreshTokenRef: V
|
|
49
49
|
});
|
|
50
|
-
return
|
|
50
|
+
return M ? M(e) : e;
|
|
51
51
|
}, [
|
|
52
|
-
|
|
53
|
-
j,
|
|
52
|
+
k,
|
|
54
53
|
M,
|
|
55
|
-
|
|
54
|
+
N,
|
|
55
|
+
V
|
|
56
56
|
]);
|
|
57
|
-
|
|
58
|
-
if (!
|
|
57
|
+
d(() => {
|
|
58
|
+
if (!I || !("window" in globalThis)) return;
|
|
59
59
|
let e = !1;
|
|
60
60
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
61
61
|
e || t();
|
|
62
62
|
}), () => {
|
|
63
63
|
e = !0;
|
|
64
64
|
};
|
|
65
|
-
}, [
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
let { result:
|
|
65
|
+
}, [I]);
|
|
66
|
+
let W = te(r(F));
|
|
67
|
+
d(() => {
|
|
68
|
+
W && W().catch(() => {});
|
|
69
|
+
}, [W]);
|
|
70
|
+
let { result: pe, loading: G, error: K, initStaleForToken: me, initReplacementPending: he, refetch: q } = l(T ? null : U, A, R), J = A ? T ?? pe ?? void 0 : void 0, Y = !T && me, X = s(j, Y ? void 0 : J?.organizationId), ge = u({
|
|
71
71
|
organizationId: X,
|
|
72
|
-
cascadeOrgId:
|
|
72
|
+
cascadeOrgId: j,
|
|
73
73
|
ownsFetch: !0,
|
|
74
74
|
parentStatus: "none",
|
|
75
|
-
hasToken: !!
|
|
76
|
-
loading:
|
|
77
|
-
error:
|
|
75
|
+
hasToken: !!A,
|
|
76
|
+
loading: G,
|
|
77
|
+
error: K,
|
|
78
78
|
hasResult: !!J,
|
|
79
|
-
initReplacementPending:
|
|
80
|
-
}),
|
|
81
|
-
hasToken: !!
|
|
82
|
-
loading:
|
|
83
|
-
error:
|
|
79
|
+
initReplacementPending: he
|
|
80
|
+
}), _e = f(() => ie({
|
|
81
|
+
hasToken: !!A,
|
|
82
|
+
loading: G,
|
|
83
|
+
error: K,
|
|
84
84
|
initResponse: J,
|
|
85
85
|
initStaleForToken: Y
|
|
86
86
|
}), [
|
|
87
|
-
|
|
88
|
-
W,
|
|
87
|
+
A,
|
|
89
88
|
G,
|
|
89
|
+
K,
|
|
90
90
|
J,
|
|
91
91
|
Y
|
|
92
92
|
]);
|
|
93
|
-
|
|
94
|
-
let Z =
|
|
95
|
-
enabled:
|
|
93
|
+
ae(_e, A);
|
|
94
|
+
let Z = f(() => ({
|
|
95
|
+
enabled: I,
|
|
96
96
|
organizationId: X,
|
|
97
|
-
rootCorrelationId:
|
|
97
|
+
rootCorrelationId: L
|
|
98
98
|
}), [
|
|
99
|
-
|
|
99
|
+
I,
|
|
100
100
|
X,
|
|
101
|
-
|
|
101
|
+
L
|
|
102
102
|
]);
|
|
103
|
-
|
|
104
|
-
let Q =
|
|
105
|
-
baseUrl:
|
|
106
|
-
widgetToken:
|
|
107
|
-
organizationId:
|
|
108
|
-
configClient:
|
|
109
|
-
gatewayRouting:
|
|
110
|
-
linkComponent:
|
|
111
|
-
uiFramework:
|
|
103
|
+
R.current = Z;
|
|
104
|
+
let Q = f(() => ({
|
|
105
|
+
baseUrl: v,
|
|
106
|
+
widgetToken: y,
|
|
107
|
+
organizationId: b,
|
|
108
|
+
configClient: x,
|
|
109
|
+
gatewayRouting: S,
|
|
110
|
+
linkComponent: C,
|
|
111
|
+
uiFramework: w
|
|
112
112
|
}), [
|
|
113
|
-
g,
|
|
114
|
-
_,
|
|
115
113
|
v,
|
|
116
114
|
y,
|
|
117
115
|
b,
|
|
118
116
|
x,
|
|
119
|
-
S
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
S,
|
|
118
|
+
C,
|
|
119
|
+
w
|
|
120
|
+
]), $ = f(() => ({
|
|
121
|
+
baseUrl: k,
|
|
122
|
+
widgetToken: A,
|
|
123
123
|
organizationId: X,
|
|
124
|
-
configClient:
|
|
125
|
-
gatewayRouting:
|
|
126
|
-
linkComponent:
|
|
127
|
-
uiFramework:
|
|
124
|
+
configClient: M,
|
|
125
|
+
gatewayRouting: N,
|
|
126
|
+
linkComponent: P,
|
|
127
|
+
uiFramework: F,
|
|
128
128
|
initResponse: J
|
|
129
129
|
}), [
|
|
130
|
-
O,
|
|
131
130
|
k,
|
|
131
|
+
A,
|
|
132
132
|
X,
|
|
133
|
-
j,
|
|
134
133
|
M,
|
|
135
134
|
N,
|
|
136
135
|
P,
|
|
136
|
+
F,
|
|
137
137
|
J
|
|
138
|
-
]),
|
|
138
|
+
]), ve = f(() => ({
|
|
139
139
|
resolved: $,
|
|
140
140
|
own: Q,
|
|
141
141
|
refetch: q,
|
|
142
|
-
loading:
|
|
143
|
-
error:
|
|
142
|
+
loading: G,
|
|
143
|
+
error: K,
|
|
144
144
|
analytics: Z,
|
|
145
|
-
cascadeOrgId:
|
|
145
|
+
cascadeOrgId: j,
|
|
146
146
|
initResponseStaleForToken: Y,
|
|
147
|
-
disclosuresAcceptance:
|
|
148
|
-
providerLabels:
|
|
147
|
+
disclosuresAcceptance: E,
|
|
148
|
+
providerLabels: D
|
|
149
149
|
}), [
|
|
150
150
|
$,
|
|
151
151
|
Q,
|
|
152
152
|
q,
|
|
153
|
-
W,
|
|
154
153
|
G,
|
|
154
|
+
K,
|
|
155
155
|
Z,
|
|
156
|
-
|
|
156
|
+
j,
|
|
157
157
|
Y,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
E,
|
|
159
|
+
D
|
|
160
160
|
]);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
client:
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
client:
|
|
161
|
+
return /* @__PURE__ */ g(le, {
|
|
162
|
+
client: z,
|
|
163
|
+
children: /* @__PURE__ */ g(n, {
|
|
164
|
+
client: U,
|
|
165
165
|
organizationId: X,
|
|
166
|
-
widgetToken:
|
|
167
|
-
installClientSecret:
|
|
168
|
-
authEpoch:
|
|
169
|
-
organizationStatus:
|
|
170
|
-
children: /* @__PURE__ */
|
|
171
|
-
value:
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
linkComponent:
|
|
174
|
-
uiFramework:
|
|
175
|
-
children:
|
|
166
|
+
widgetToken: A,
|
|
167
|
+
installClientSecret: de,
|
|
168
|
+
authEpoch: fe,
|
|
169
|
+
organizationStatus: ge,
|
|
170
|
+
children: /* @__PURE__ */ g(o.Provider, {
|
|
171
|
+
value: ve,
|
|
172
|
+
children: /* @__PURE__ */ g(ee, {
|
|
173
|
+
linkComponent: P,
|
|
174
|
+
uiFramework: F,
|
|
175
|
+
children: _
|
|
176
176
|
})
|
|
177
177
|
})
|
|
178
178
|
})
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
export {
|
|
181
|
+
export { _ as RootWidgetProvider };
|
|
@@ -5,46 +5,46 @@
|
|
|
5
5
|
import { installStyleNonce as e } from "../../../../util/dist/lib/csp.js";
|
|
6
6
|
import "../../../../util/dist/index.js";
|
|
7
7
|
import { createClientSecretInstaller as t } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { EmbedApiProvider as a, useEmbedApi as o } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
9
|
+
import { EmbedApiProvider as r, useEmbedApi as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
11
10
|
import "../../../../data-access/dist/index.js";
|
|
12
|
-
import { resolveUIFramework as
|
|
13
|
-
import { UIProvider as
|
|
14
|
-
import { useDesignSystemEnsurer as
|
|
15
|
-
import { HostIsolationScope as
|
|
11
|
+
import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
12
|
+
import { UIProvider as o } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
13
|
+
import { useDesignSystemEnsurer as ee, useFrameworkRenderer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
14
|
+
import { HostIsolationScope as ne } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
16
15
|
import { ErrorState as s } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
17
16
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { getGlobalSnapshot as
|
|
19
|
-
import { EmbeddedAnalyticsEvent as
|
|
20
|
-
import { configureEmbeddedClient as
|
|
21
|
-
import { generateCorrelationId as
|
|
22
|
-
import { WidgetContext as
|
|
17
|
+
import { getGlobalSnapshot as re, subscribeToGlobal as ie } from "./globalStore.js";
|
|
18
|
+
import { EmbeddedAnalyticsEvent as c } from "../analytics/events.js";
|
|
19
|
+
import { configureEmbeddedClient as ae } from "../analytics/client.js";
|
|
20
|
+
import { generateCorrelationId as oe } from "../analytics/ids.js";
|
|
21
|
+
import { WidgetContext as se } from "./WidgetContext.js";
|
|
23
22
|
import { noop as ce, resolveOrgId as le, useAuthEpoch as ue } from "./utils.js";
|
|
24
23
|
import { useWidgetFetch as de } from "./useWidgetFetch.js";
|
|
25
24
|
import { deriveOrganizationStatus as fe } from "./deriveOrganizationStatus.js";
|
|
26
25
|
import { deriveWidgetInitState as pe, useWidgetInitPublisher as me } from "./useWidgetInitPublisher.js";
|
|
27
26
|
import { useTokenRefreshRef as he } from "./useTokenRefreshRef.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
27
|
+
import { useOwnedQueryClient as ge } from "./useOwnedQueryClient.js";
|
|
28
|
+
import { useAnalyticsTrack as l } from "../analytics/hooks.js";
|
|
29
|
+
import { resolveProviderLabels as _e } from "./labels.js";
|
|
30
|
+
import { WidgetErrorBoundary as ve } from "./WidgetErrorBoundary.js";
|
|
31
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as u, hasRenderableAcceptanceSurface as d, resolveDisclosuresBlockedReason as f, shouldGateOnDisclosuresAcceptance as ye } from "./isDisclosuresAcceptanceRequired.js";
|
|
32
|
+
import { useContext as be, useEffect as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as xe } from "react";
|
|
33
|
+
import { jsx as _, jsxs as Se } from "react/jsx-runtime";
|
|
34
|
+
import { QueryClient as Ce, QueryClientProvider as we } from "@tanstack/react-query";
|
|
35
35
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
36
|
-
function
|
|
36
|
+
function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, errorFallback: Ee, onError: De, analytics: y, disclosuresAcceptance: Oe, providerLabels: ke, widgetName: b, header: Ae }) {
|
|
37
37
|
e();
|
|
38
|
-
let
|
|
38
|
+
let x = be(se), S = xe(ie, re, re), C = x?.resolved ?? S, je = x?.refetch ?? ce, Me = x?.loading ?? !1, Ne = x?.error ?? null, w = s ?? C.baseUrl, T = c === void 0 ? C.widgetToken : c, Pe = x ? x.cascadeOrgId : S.organizationId, E = l === void 0 ? Pe : l, D = u ?? C.configClient, O = d ?? C.gatewayRouting, k = f ?? C.linkComponent, A = v ?? C.uiFramework, j = Oe ?? x?.disclosuresAcceptance, M = ke ?? x?.providerLabels, N = m(() => _e(M), [M]), P = x === null, F = P ? y !== !1 : x.analytics.enabled, [Fe] = g(oe), I = P ? Fe : x.analytics.rootCorrelationId, [Ie] = g(oe), L = b === void 0 ? x?.analytics.widgetName : b, R = b === void 0 ? x?.analytics.widgetInstanceId : Ie, z = h({
|
|
39
39
|
enabled: F,
|
|
40
|
-
organizationId:
|
|
40
|
+
organizationId: E,
|
|
41
41
|
rootCorrelationId: I,
|
|
42
42
|
widgetName: L,
|
|
43
43
|
widgetInstanceId: R
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
P ||
|
|
47
|
-
}, [
|
|
44
|
+
}), Le = h(!1);
|
|
45
|
+
p(() => {
|
|
46
|
+
P || y === void 0 || Le.current || (Le.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."));
|
|
47
|
+
}, [y, P]), p(() => {
|
|
48
48
|
if (!P || !F || !("window" in globalThis)) return;
|
|
49
49
|
let e = !1;
|
|
50
50
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -53,186 +53,182 @@ function b({ children: re, baseUrl: s, widgetToken: l, organizationId: d, config
|
|
|
53
53
|
e = !0;
|
|
54
54
|
};
|
|
55
55
|
}, [P, F]);
|
|
56
|
-
let B =
|
|
57
|
-
|
|
56
|
+
let B = ee(a(A));
|
|
57
|
+
p(() => {
|
|
58
58
|
B && B().catch(() => {});
|
|
59
59
|
}, [B]);
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
if (!
|
|
64
|
-
let e =
|
|
65
|
-
tokenRef:
|
|
60
|
+
let Re = x === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || b !== void 0, ze = h(T);
|
|
61
|
+
ze.current = T;
|
|
62
|
+
let Be = he(), Ve = h(null), He = m(() => t(Ve), []), Ue = i(), We = ue(T), V = m(() => {
|
|
63
|
+
if (!Re) return null;
|
|
64
|
+
let e = ae(n(w), {
|
|
65
|
+
tokenRef: ze,
|
|
66
66
|
analyticsContextRef: z,
|
|
67
|
-
clientSecretRef:
|
|
68
|
-
gatewayRouting:
|
|
69
|
-
refreshTokenRef:
|
|
67
|
+
clientSecretRef: Ve,
|
|
68
|
+
gatewayRouting: O,
|
|
69
|
+
refreshTokenRef: Be
|
|
70
70
|
});
|
|
71
|
-
return
|
|
71
|
+
return D ? D(e) : e;
|
|
72
72
|
}, [
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Re,
|
|
74
|
+
w,
|
|
75
|
+
D,
|
|
75
76
|
O,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
initStaleForToken: J
|
|
77
|
+
Be
|
|
78
|
+
]), H = x === null || s !== void 0 || c !== void 0, Ge = H ? We : Ue.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Ke, initStaleForToken: K, initReplacementPending: qe, refetch: Je } = de(H ? V : null, H ? T : void 0, z), Ye = H ? Je : je, Xe = H ? W : Me, q = H ? G : Ne, Ze = x?.resolved.initResponse, Qe = !H || !Ke && !G && !U && !!T && !W, J = Qe ? Ze : U ?? void 0, Y = Qe ? H || (x?.initResponseStaleForToken ?? !1) : K, $e = x === null, et = m(() => $e ? pe({
|
|
79
|
+
hasToken: !!T,
|
|
80
|
+
loading: W,
|
|
81
|
+
error: G,
|
|
82
|
+
initResponse: U ?? void 0,
|
|
83
|
+
initStaleForToken: K
|
|
84
84
|
}) : null, [
|
|
85
85
|
$e,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
q,
|
|
86
|
+
T,
|
|
87
|
+
W,
|
|
89
88
|
G,
|
|
90
|
-
|
|
89
|
+
U,
|
|
90
|
+
K
|
|
91
91
|
]);
|
|
92
|
-
me(et,
|
|
93
|
-
let
|
|
94
|
-
organizationId:
|
|
95
|
-
cascadeOrgId:
|
|
96
|
-
ownsFetch:
|
|
97
|
-
parentStatus:
|
|
98
|
-
hasToken: !!
|
|
99
|
-
loading:
|
|
100
|
-
error:
|
|
101
|
-
hasResult: !!
|
|
102
|
-
initReplacementPending:
|
|
103
|
-
}),
|
|
92
|
+
me(et, T);
|
|
93
|
+
let X = le(E, Y ? void 0 : J?.organizationId), tt = fe({
|
|
94
|
+
organizationId: X,
|
|
95
|
+
cascadeOrgId: E,
|
|
96
|
+
ownsFetch: H,
|
|
97
|
+
parentStatus: Ue.organizationStatus,
|
|
98
|
+
hasToken: !!T,
|
|
99
|
+
loading: W,
|
|
100
|
+
error: G,
|
|
101
|
+
hasResult: !!U,
|
|
102
|
+
initReplacementPending: qe
|
|
103
|
+
}), Z = m(() => ({
|
|
104
104
|
enabled: F,
|
|
105
|
-
organizationId:
|
|
105
|
+
organizationId: X,
|
|
106
106
|
rootCorrelationId: I,
|
|
107
107
|
widgetName: L,
|
|
108
108
|
widgetInstanceId: R
|
|
109
109
|
}), [
|
|
110
110
|
F,
|
|
111
|
-
|
|
111
|
+
X,
|
|
112
112
|
I,
|
|
113
113
|
L,
|
|
114
114
|
R
|
|
115
115
|
]);
|
|
116
|
-
z.current =
|
|
117
|
-
let [
|
|
116
|
+
z.current = Z;
|
|
117
|
+
let [Q] = g(() => x === null ? new Ce({ defaultOptions: {
|
|
118
118
|
queries: {
|
|
119
119
|
retry: !1,
|
|
120
120
|
refetchOnWindowFocus: !1
|
|
121
121
|
},
|
|
122
122
|
mutations: { retry: !1 }
|
|
123
123
|
} }) : null);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let e = $;
|
|
127
|
-
return n(e), () => r(e);
|
|
128
|
-
}, [$]);
|
|
129
|
-
let nt = g(() => ({
|
|
124
|
+
ge(Q);
|
|
125
|
+
let nt = m(() => ({
|
|
130
126
|
baseUrl: s,
|
|
131
|
-
widgetToken:
|
|
132
|
-
organizationId:
|
|
133
|
-
configClient:
|
|
134
|
-
gatewayRouting:
|
|
135
|
-
linkComponent:
|
|
136
|
-
uiFramework:
|
|
127
|
+
widgetToken: c,
|
|
128
|
+
organizationId: l,
|
|
129
|
+
configClient: u,
|
|
130
|
+
gatewayRouting: d,
|
|
131
|
+
linkComponent: f,
|
|
132
|
+
uiFramework: v
|
|
137
133
|
}), [
|
|
138
134
|
s,
|
|
135
|
+
c,
|
|
139
136
|
l,
|
|
137
|
+
u,
|
|
140
138
|
d,
|
|
141
139
|
f,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
uiFramework: j,
|
|
153
|
-
initResponse: Y
|
|
140
|
+
v
|
|
141
|
+
]), rt = m(() => ({
|
|
142
|
+
baseUrl: w,
|
|
143
|
+
widgetToken: T,
|
|
144
|
+
organizationId: X,
|
|
145
|
+
configClient: D,
|
|
146
|
+
gatewayRouting: O,
|
|
147
|
+
linkComponent: k,
|
|
148
|
+
uiFramework: A,
|
|
149
|
+
initResponse: J
|
|
154
150
|
}), [
|
|
151
|
+
w,
|
|
155
152
|
T,
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
X,
|
|
154
|
+
D,
|
|
158
155
|
O,
|
|
159
156
|
k,
|
|
160
157
|
A,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
]), it = g(() => ({
|
|
158
|
+
J
|
|
159
|
+
]), it = m(() => ({
|
|
164
160
|
resolved: rt,
|
|
165
161
|
own: nt,
|
|
166
|
-
refetch:
|
|
167
|
-
loading:
|
|
168
|
-
error:
|
|
169
|
-
analytics:
|
|
170
|
-
cascadeOrgId:
|
|
171
|
-
initResponseStaleForToken:
|
|
172
|
-
disclosuresAcceptance:
|
|
173
|
-
providerLabels:
|
|
162
|
+
refetch: Ye,
|
|
163
|
+
loading: Xe,
|
|
164
|
+
error: q,
|
|
165
|
+
analytics: Z,
|
|
166
|
+
cascadeOrgId: E,
|
|
167
|
+
initResponseStaleForToken: Y,
|
|
168
|
+
disclosuresAcceptance: j,
|
|
169
|
+
providerLabels: M
|
|
174
170
|
}), [
|
|
175
171
|
rt,
|
|
176
172
|
nt,
|
|
177
|
-
Je,
|
|
178
173
|
Ye,
|
|
179
174
|
Xe,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
q,
|
|
176
|
+
Z,
|
|
177
|
+
E,
|
|
178
|
+
Y,
|
|
179
|
+
j,
|
|
180
|
+
M
|
|
181
|
+
]), at = /* @__PURE__ */ _(se.Provider, {
|
|
186
182
|
value: it,
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
-
linkComponent:
|
|
189
|
-
uiFramework:
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
-
resetKeys: [
|
|
192
|
-
errorFallback:
|
|
193
|
-
onError:
|
|
194
|
-
labels:
|
|
195
|
-
children:
|
|
196
|
-
disclosuresAcceptance:
|
|
197
|
-
initStaleForToken:
|
|
198
|
-
labels:
|
|
199
|
-
}) :
|
|
183
|
+
children: /* @__PURE__ */ _(o, {
|
|
184
|
+
linkComponent: k,
|
|
185
|
+
uiFramework: A,
|
|
186
|
+
children: /* @__PURE__ */ Se(ne, { children: [Ae, /* @__PURE__ */ _(ve, {
|
|
187
|
+
resetKeys: [T],
|
|
188
|
+
errorFallback: Ee,
|
|
189
|
+
onError: De,
|
|
190
|
+
labels: N,
|
|
191
|
+
children: ye(J, b) ? /* @__PURE__ */ _(Te, {
|
|
192
|
+
disclosuresAcceptance: j,
|
|
193
|
+
initStaleForToken: Y,
|
|
194
|
+
labels: N
|
|
195
|
+
}) : te
|
|
200
196
|
})] })
|
|
201
197
|
})
|
|
202
|
-
}),
|
|
203
|
-
client:
|
|
204
|
-
organizationId:
|
|
205
|
-
widgetToken:
|
|
206
|
-
installClientSecret:
|
|
207
|
-
authEpoch:
|
|
198
|
+
}), $ = V ? /* @__PURE__ */ _(r, {
|
|
199
|
+
client: V,
|
|
200
|
+
organizationId: X,
|
|
201
|
+
widgetToken: T,
|
|
202
|
+
installClientSecret: He,
|
|
203
|
+
authEpoch: Ge,
|
|
208
204
|
organizationStatus: tt,
|
|
209
205
|
children: at
|
|
210
206
|
}) : at;
|
|
211
|
-
return
|
|
212
|
-
client:
|
|
213
|
-
children:
|
|
214
|
-
}) :
|
|
207
|
+
return Q ? /* @__PURE__ */ _(we, {
|
|
208
|
+
client: Q,
|
|
209
|
+
children: $
|
|
210
|
+
}) : $;
|
|
215
211
|
}
|
|
216
|
-
function
|
|
217
|
-
let r =
|
|
212
|
+
function Te({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
213
|
+
let r = te("error-state") ?? s, i = l(), a = d(e), o = f({
|
|
218
214
|
initStaleForToken: t,
|
|
219
215
|
hasAcceptanceSurface: a
|
|
220
216
|
});
|
|
221
|
-
return
|
|
222
|
-
i(
|
|
223
|
-
}, [o, i]), t ? /* @__PURE__ */
|
|
217
|
+
return p(() => {
|
|
218
|
+
i(c.WidgetDisclosuresBlocked, { reason: o }), console.info(`[disclosures] widget blocked: ${o}`);
|
|
219
|
+
}, [o, i]), t ? /* @__PURE__ */ _(r, {
|
|
224
220
|
title: n.disclosuresRefreshingTitle,
|
|
225
221
|
description: n.disclosuresRefreshingDescription,
|
|
226
|
-
testId:
|
|
222
|
+
testId: u,
|
|
227
223
|
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"
|
|
228
|
-
}) : a ? /* @__PURE__ */
|
|
229
|
-
"data-testid":
|
|
224
|
+
}) : a ? /* @__PURE__ */ _("div", {
|
|
225
|
+
"data-testid": u,
|
|
230
226
|
className: "ttw:w-full",
|
|
231
227
|
children: e
|
|
232
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ _(r, {
|
|
233
229
|
title: n.disclosuresRequiredTitle,
|
|
234
|
-
testId:
|
|
230
|
+
testId: u,
|
|
235
231
|
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"
|
|
236
232
|
});
|
|
237
233
|
}
|
|
238
|
-
export {
|
|
234
|
+
export { v as WidgetProvider, v as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import "../../../../data-access/dist/index.js";
|
|
7
|
+
import { useEffect as n, useRef as r } from "react";
|
|
8
|
+
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js
|
|
9
|
+
function i(i) {
|
|
10
|
+
let a = r(void 0);
|
|
11
|
+
n(() => {
|
|
12
|
+
if (i) return a.current?.(), e(i), () => {
|
|
13
|
+
t(i);
|
|
14
|
+
let e = !1, n, r = setTimeout(() => {
|
|
15
|
+
i.cancelQueries().then(() => {
|
|
16
|
+
if (e) return;
|
|
17
|
+
for (let e of i.getMutationCache().getAll()) e.destroy();
|
|
18
|
+
i.clear();
|
|
19
|
+
let t = i.getQueryCache(), r = !1;
|
|
20
|
+
n = t.subscribe((e) => {
|
|
21
|
+
e.type === "added" && !r ? t.remove(e.query) : e.type === "observerAdded" && (r = !0, t.add(e.query));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}, 0);
|
|
25
|
+
a.current = () => {
|
|
26
|
+
e = !0, clearTimeout(r), n?.();
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}, [i]);
|
|
30
|
+
}
|
|
31
|
+
export { i as useOwnedQueryClient };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.276", n = "906142414581e930d666b1e4c9960ddc711f9a99", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|