@machinemetrics/mm-react-embeddable 2.0.0-6 → 2.0.0
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 +10 -0
- package/dist/mm-react-embeddable.cjs.js +4 -4
- package/dist/mm-react-embeddable.es.js +365 -352
- package/dist/mm-react-embeddable.umd.js +4 -4
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import $, { createContext as fe, useContext as V, useState as O, useRef as m, useCallback as h, useEffect as b, useMemo as ge } from "react";
|
|
2
|
+
import E from "prop-types";
|
|
3
3
|
import ie from "styled-components";
|
|
4
|
-
const ne =
|
|
4
|
+
const ne = fe(null), J = fe({
|
|
5
5
|
pending: [],
|
|
6
6
|
authorize: () => {
|
|
7
7
|
},
|
|
@@ -14,16 +14,16 @@ const ne = de(null), N = de({
|
|
|
14
14
|
originEpochs: {},
|
|
15
15
|
credentials: {},
|
|
16
16
|
unsupported: {}
|
|
17
|
-
}),
|
|
18
|
-
kind:
|
|
17
|
+
}), be = "access_token", ce = (t) => t ? t.kind ? t : t.accessToken ? {
|
|
18
|
+
kind: be,
|
|
19
19
|
accessToken: t.accessToken,
|
|
20
20
|
expiresAt: t.expiresAt || null
|
|
21
|
-
} : null : null,
|
|
21
|
+
} : null : null, Ee = 60, Re = 120, we = /* @__PURE__ */ new Set([
|
|
22
22
|
"host_not_allowed",
|
|
23
23
|
"unbound_host_bound_guest",
|
|
24
24
|
"invalid_token",
|
|
25
25
|
"provider_unavailable"
|
|
26
|
-
]),
|
|
26
|
+
]), te = typeof window != "undefined" && window.location.protocol === "https:", Te = 8e3, N = (t) => {
|
|
27
27
|
try {
|
|
28
28
|
return new URL(t).origin;
|
|
29
29
|
} catch {
|
|
@@ -31,7 +31,7 @@ const ne = de(null), N = de({
|
|
|
31
31
|
}
|
|
32
32
|
}, ue = (t, s) => {
|
|
33
33
|
const c = s == null ? void 0 : s.origin;
|
|
34
|
-
return !c ||
|
|
34
|
+
return !c || N(t == null ? void 0 : t.authUrl) !== c ? null : c;
|
|
35
35
|
}, le = (t) => {
|
|
36
36
|
if (!t || /^\d{1,3}(?:\.\d{1,3}){3}$/.test(t) || t.includes(":"))
|
|
37
37
|
return t;
|
|
@@ -53,166 +53,154 @@ const ne = de(null), N = de({
|
|
|
53
53
|
if (!d)
|
|
54
54
|
return s(), () => {
|
|
55
55
|
};
|
|
56
|
-
const
|
|
57
|
-
d.closed && (clearInterval(
|
|
56
|
+
const f = setInterval(() => {
|
|
57
|
+
d.closed && (clearInterval(f), c());
|
|
58
58
|
}, 1e3);
|
|
59
|
-
return () => clearInterval(
|
|
60
|
-
},
|
|
61
|
-
const d = V(ne), [
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const r =
|
|
59
|
+
return () => clearInterval(f);
|
|
60
|
+
}, pe = ({ children: t, launcher: s, broker: c }) => {
|
|
61
|
+
const d = V(ne), [f, g] = O({}), [P, B] = O({}), [W, H] = O({}), [k, z] = O({}), y = m(W);
|
|
62
|
+
y.current = W;
|
|
63
|
+
const U = m(f);
|
|
64
|
+
U.current = f;
|
|
65
|
+
const x = m(null), Y = m({}), R = m({}), G = m({}), v = m(c);
|
|
66
|
+
v.current = c;
|
|
67
|
+
const M = h((e) => {
|
|
68
|
+
const r = R.current[e];
|
|
69
69
|
if (!r)
|
|
70
70
|
return;
|
|
71
|
-
const n = (
|
|
72
|
-
|
|
73
|
-
}, []),
|
|
71
|
+
const n = (i) => !i[e] || i[e].clientId ? i : { ...i, [e]: { ...i[e], clientId: r } };
|
|
72
|
+
g(n), z(n);
|
|
73
|
+
}, []), L = h(
|
|
74
74
|
(e, r) => {
|
|
75
|
-
e && (
|
|
75
|
+
e && (z((n) => n[e] ? n : {
|
|
76
76
|
...n,
|
|
77
77
|
[e]: {
|
|
78
78
|
origin: e,
|
|
79
79
|
reason: r,
|
|
80
|
-
clientId:
|
|
80
|
+
clientId: R.current[e] || null
|
|
81
81
|
}
|
|
82
|
-
}),
|
|
82
|
+
}), M(e));
|
|
83
83
|
},
|
|
84
|
-
[
|
|
85
|
-
),
|
|
84
|
+
[M]
|
|
85
|
+
), S = h(
|
|
86
86
|
(e, { v2: r = !1, origin: n = null } = {}) => {
|
|
87
|
-
n && (r &&
|
|
88
|
-
...
|
|
87
|
+
n && (r && y.current[n] || (g((i) => i[n] ? i : {
|
|
88
|
+
...i,
|
|
89
89
|
[n]: {
|
|
90
90
|
origin: n,
|
|
91
91
|
authUrl: e.authUrl,
|
|
92
92
|
silentUrl: e.silentUrl || null,
|
|
93
|
-
|
|
94
|
-
// frame login (https). Otherwise (and for legacy signals) go straight to interactive,
|
|
95
|
-
// so an http host doesn't wait out a silent frame that can never load login.
|
|
96
|
-
status: r && P.current ? "broker" : r && e.silentUrl && re ? "silent" : "interactive",
|
|
93
|
+
status: r && v.current ? "broker" : r && e.silentUrl && te ? "silent" : "interactive",
|
|
97
94
|
v2: r,
|
|
98
|
-
// v1.9: the scope the guest asked for; forwarded verbatim to the broker.
|
|
99
95
|
scope: e.scope || null,
|
|
100
|
-
acceptsCredentials:
|
|
96
|
+
acceptsCredentials: G.current[n] || null,
|
|
101
97
|
consent: null,
|
|
102
98
|
error: null,
|
|
103
|
-
|
|
104
|
-
// the host resolves the display name from it.
|
|
105
|
-
clientId: e.clientId || C.current[n] || null,
|
|
99
|
+
clientId: e.clientId || R.current[n] || null,
|
|
106
100
|
popupBlocked: !1
|
|
107
101
|
}
|
|
108
|
-
}),
|
|
102
|
+
}), M(n)));
|
|
109
103
|
},
|
|
110
|
-
[
|
|
111
|
-
),
|
|
112
|
-
|
|
113
|
-
}, []),
|
|
104
|
+
[M]
|
|
105
|
+
), C = m({}), l = h((e) => {
|
|
106
|
+
C.current[e] && (clearTimeout(C.current[e]), delete C.current[e]);
|
|
107
|
+
}, []), u = h(
|
|
114
108
|
(e) => {
|
|
115
|
-
|
|
109
|
+
l(e), g((r) => {
|
|
116
110
|
if (!r[e])
|
|
117
111
|
return r;
|
|
118
112
|
const n = { ...r };
|
|
119
113
|
return delete n[e], n;
|
|
120
114
|
});
|
|
121
115
|
},
|
|
122
|
-
[
|
|
123
|
-
),
|
|
116
|
+
[l]
|
|
117
|
+
), o = h(
|
|
124
118
|
(e) => {
|
|
125
|
-
e && (
|
|
119
|
+
e && (u(e), B((r) => ({
|
|
126
120
|
...r,
|
|
127
121
|
[e]: (r[e] || 0) + 1
|
|
128
122
|
})));
|
|
129
123
|
},
|
|
130
|
-
[
|
|
131
|
-
),
|
|
132
|
-
|
|
124
|
+
[u]
|
|
125
|
+
), a = h((e) => {
|
|
126
|
+
g((r) => !r[e] || r[e].status === "interactive" ? r : {
|
|
133
127
|
...r,
|
|
134
128
|
[e]: { ...r[e], status: "interactive" }
|
|
135
129
|
});
|
|
136
|
-
}, []),
|
|
130
|
+
}, []), T = h(
|
|
137
131
|
(e) => {
|
|
138
|
-
|
|
132
|
+
u(e.origin);
|
|
139
133
|
},
|
|
140
|
-
[
|
|
141
|
-
),
|
|
134
|
+
[u]
|
|
135
|
+
), p = h(
|
|
142
136
|
(e, r) => {
|
|
143
137
|
const n = ue(e, r);
|
|
144
138
|
if (n) {
|
|
145
139
|
if (ae(n, window.location.origin)) {
|
|
146
|
-
|
|
140
|
+
L(n, "cross-site-legacy");
|
|
147
141
|
return;
|
|
148
142
|
}
|
|
149
|
-
|
|
143
|
+
S(e, { origin: n });
|
|
150
144
|
}
|
|
151
145
|
},
|
|
152
|
-
[
|
|
146
|
+
[S, L]
|
|
153
147
|
);
|
|
154
|
-
|
|
148
|
+
b(() => {
|
|
155
149
|
if (!d)
|
|
156
150
|
return;
|
|
157
151
|
const e = [
|
|
158
|
-
// `init` carries the app's OAuth clientId. Cache it by the ATTESTED app
|
|
159
|
-
// origin (payload `origin` is ignored) and attach it to any entry already
|
|
160
|
-
// showing. `init` is posted before the authorize/login/credential-request
|
|
161
|
-
// signals, so it is usually cached by the time an entry is created. The
|
|
162
|
-
// clientId is only a lookup key: the host resolves the display name from
|
|
163
|
-
// it, and a broker binds it to the attested origin server-side.
|
|
164
152
|
d.addListener("*", "init", (r, n) => {
|
|
165
|
-
n != null && n.origin && (r != null && r.clientId) && (
|
|
153
|
+
n != null && n.origin && (r != null && r.clientId) && (R.current[n.origin] = r.clientId, M(n.origin)), n != null && n.origin && Array.isArray(r == null ? void 0 : r.acceptsCredentials) ? G.current[n.origin] = r.acceptsCredentials : n != null && n.origin && ae(n.origin, window.location.origin) && L(n.origin, "cross-site-legacy");
|
|
166
154
|
}),
|
|
167
|
-
d.addListener("*", "authorize",
|
|
168
|
-
d.addListener("*", "login",
|
|
155
|
+
d.addListener("*", "authorize", p),
|
|
156
|
+
d.addListener("*", "login", p),
|
|
169
157
|
d.addListener(
|
|
170
158
|
"*",
|
|
171
159
|
"credential-request",
|
|
172
|
-
(r, n) =>
|
|
160
|
+
(r, n) => S(r, { v2: !0, origin: ue(r, n) })
|
|
173
161
|
)
|
|
174
162
|
];
|
|
175
163
|
return () => e.forEach((r) => r());
|
|
176
|
-
}, [d,
|
|
164
|
+
}, [d, p, S, M, L]), b(() => {
|
|
177
165
|
const e = (r) => {
|
|
178
166
|
const n = r == null ? void 0 : r.data;
|
|
179
167
|
if (!n || n.type !== "authorized" && n.type !== "authorize-failed")
|
|
180
168
|
return;
|
|
181
|
-
const
|
|
182
|
-
if (!(!
|
|
169
|
+
const i = N(n.authUrl);
|
|
170
|
+
if (!(!i || r.origin !== i)) {
|
|
183
171
|
if (n.type === "authorized") {
|
|
184
172
|
if (n.accessToken) {
|
|
185
|
-
if (!
|
|
173
|
+
if (!U.current[i])
|
|
186
174
|
return;
|
|
187
|
-
|
|
188
|
-
...
|
|
189
|
-
[
|
|
190
|
-
})),
|
|
175
|
+
H((_) => ({
|
|
176
|
+
..._,
|
|
177
|
+
[i]: ce({ accessToken: n.accessToken })
|
|
178
|
+
})), u(i);
|
|
191
179
|
} else
|
|
192
|
-
|
|
180
|
+
o(i);
|
|
193
181
|
return;
|
|
194
182
|
}
|
|
195
|
-
|
|
183
|
+
a(i);
|
|
196
184
|
}
|
|
197
185
|
};
|
|
198
186
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
199
|
-
}, [
|
|
200
|
-
const
|
|
187
|
+
}, [u, o, a]);
|
|
188
|
+
const F = h(
|
|
201
189
|
(e, r) => {
|
|
202
|
-
const n = e == null ? void 0 : e.origin,
|
|
203
|
-
!n || !
|
|
190
|
+
const n = e == null ? void 0 : e.origin, i = ce(r);
|
|
191
|
+
!n || !i || (H((_) => ({ ..._, [n]: i })), u(n));
|
|
204
192
|
},
|
|
205
|
-
[
|
|
206
|
-
),
|
|
207
|
-
|
|
208
|
-
}, []),
|
|
193
|
+
[u]
|
|
194
|
+
), w = h((e, r) => {
|
|
195
|
+
g((n) => n[e] ? { ...n, [e]: { ...n[e], ...r } } : n);
|
|
196
|
+
}, []), I = m({}), A = h(
|
|
209
197
|
async (e, { approve: r } = {}) => {
|
|
210
|
-
const n =
|
|
211
|
-
let
|
|
198
|
+
const n = v.current, { origin: i } = e;
|
|
199
|
+
let _;
|
|
212
200
|
try {
|
|
213
|
-
|
|
201
|
+
_ = await n(
|
|
214
202
|
{
|
|
215
|
-
origin:
|
|
203
|
+
origin: i,
|
|
216
204
|
clientId: e.clientId,
|
|
217
205
|
scope: e.scope,
|
|
218
206
|
authUrl: e.authUrl
|
|
@@ -220,127 +208,125 @@ const ne = de(null), N = de({
|
|
|
220
208
|
{ approve: r }
|
|
221
209
|
);
|
|
222
210
|
} catch {
|
|
223
|
-
r ?
|
|
224
|
-
status: e.silentUrl &&
|
|
211
|
+
r ? w(i, { error: { reason: "broker_unavailable" } }) : w(i, {
|
|
212
|
+
status: e.silentUrl && te ? "silent" : "interactive"
|
|
225
213
|
});
|
|
226
214
|
return;
|
|
227
215
|
}
|
|
228
|
-
const oe =
|
|
229
|
-
if (oe === 200 &&
|
|
230
|
-
|
|
216
|
+
const oe = _ == null ? void 0 : _.status, Z = (_ == null ? void 0 : _.body) || {};
|
|
217
|
+
if (oe === 200 && Z.credential) {
|
|
218
|
+
F(e, Z.credential);
|
|
231
219
|
return;
|
|
232
220
|
}
|
|
233
|
-
if (oe === 409 &&
|
|
234
|
-
|
|
221
|
+
if (oe === 409 && Z.consentRequired) {
|
|
222
|
+
w(i, {
|
|
235
223
|
status: "interactive",
|
|
236
224
|
consent: {
|
|
237
|
-
client:
|
|
238
|
-
stepUp: !!
|
|
239
|
-
scope:
|
|
225
|
+
client: Z.client || null,
|
|
226
|
+
stepUp: !!Z.stepUp,
|
|
227
|
+
scope: Z.scope || e.scope
|
|
240
228
|
},
|
|
241
229
|
error: null
|
|
242
230
|
});
|
|
243
231
|
return;
|
|
244
232
|
}
|
|
245
|
-
const ee =
|
|
246
|
-
if (!r &&
|
|
247
|
-
|
|
248
|
-
status: e.silentUrl &&
|
|
233
|
+
const ee = Z.error || "broker_error";
|
|
234
|
+
if (!r && we.has(ee)) {
|
|
235
|
+
w(i, {
|
|
236
|
+
status: e.silentUrl && te ? "silent" : "interactive"
|
|
249
237
|
});
|
|
250
238
|
return;
|
|
251
239
|
}
|
|
252
240
|
if (r && ee === "consent_denied") {
|
|
253
|
-
|
|
241
|
+
w(i, { error: null });
|
|
254
242
|
return;
|
|
255
243
|
}
|
|
256
244
|
if (ee === "rate_limited" && !e.rateLimitRetried) {
|
|
257
|
-
const
|
|
258
|
-
Number(
|
|
259
|
-
|
|
260
|
-
),
|
|
261
|
-
|
|
262
|
-
delete
|
|
263
|
-
delete
|
|
245
|
+
const re = Math.min(
|
|
246
|
+
Number(Z.retryAfter) > 0 ? Number(Z.retryAfter) : Ee,
|
|
247
|
+
Re
|
|
248
|
+
), me = { ...e, rateLimitRetried: !0 };
|
|
249
|
+
l(i), C.current[i] = setTimeout(() => {
|
|
250
|
+
delete C.current[i], I.current[i] = !0, D.current(me, { approve: r }).finally(() => {
|
|
251
|
+
delete I.current[i];
|
|
264
252
|
});
|
|
265
|
-
},
|
|
253
|
+
}, re * 1e3), w(i, { rateLimitRetried: !0 });
|
|
266
254
|
return;
|
|
267
255
|
}
|
|
268
|
-
|
|
269
|
-
...
|
|
270
|
-
[
|
|
271
|
-
origin:
|
|
256
|
+
u(i), z((re) => ({
|
|
257
|
+
...re,
|
|
258
|
+
[i]: {
|
|
259
|
+
origin: i,
|
|
272
260
|
reason: `broker:${ee}`,
|
|
273
|
-
detail:
|
|
274
|
-
clientId: e.clientId ||
|
|
261
|
+
detail: _ || null,
|
|
262
|
+
clientId: e.clientId || R.current[i] || null
|
|
275
263
|
}
|
|
276
264
|
}));
|
|
277
265
|
},
|
|
278
|
-
[
|
|
279
|
-
),
|
|
280
|
-
|
|
281
|
-
Object.values(
|
|
282
|
-
e.status !== "broker" ||
|
|
283
|
-
delete
|
|
266
|
+
[F, w, u, l]
|
|
267
|
+
), D = m(A);
|
|
268
|
+
D.current = A, b(() => {
|
|
269
|
+
Object.values(f).forEach((e) => {
|
|
270
|
+
e.status !== "broker" || I.current[e.origin] || C.current[e.origin] || (I.current[e.origin] = !0, A(e).finally(() => {
|
|
271
|
+
delete I.current[e.origin];
|
|
284
272
|
}));
|
|
285
273
|
});
|
|
286
|
-
}, [
|
|
287
|
-
const
|
|
288
|
-
(e) => !
|
|
289
|
-
[
|
|
274
|
+
}, [f, A]);
|
|
275
|
+
const Q = h(
|
|
276
|
+
(e) => !v.current || !(e != null && e.consent) ? Promise.resolve() : A(e, { approve: !0 }),
|
|
277
|
+
[A]
|
|
290
278
|
);
|
|
291
|
-
|
|
292
|
-
const e =
|
|
293
|
-
Object.values(
|
|
279
|
+
b(() => {
|
|
280
|
+
const e = Y.current;
|
|
281
|
+
Object.values(f).forEach((r) => {
|
|
294
282
|
r.status === "silent" && !e[r.origin] && (e[r.origin] = setTimeout(() => {
|
|
295
|
-
delete e[r.origin],
|
|
283
|
+
delete e[r.origin], a(r.origin);
|
|
296
284
|
}, Te));
|
|
297
285
|
}), Object.keys(e).forEach((r) => {
|
|
298
|
-
(!
|
|
286
|
+
(!f[r] || f[r].status !== "silent") && (clearTimeout(e[r]), delete e[r]);
|
|
299
287
|
});
|
|
300
|
-
}, [
|
|
301
|
-
|
|
288
|
+
}, [f, a]), b(() => () => {
|
|
289
|
+
x.current && x.current(), Object.values(Y.current).forEach(clearTimeout), Object.values(C.current).forEach(clearTimeout);
|
|
302
290
|
}, []);
|
|
303
|
-
const
|
|
291
|
+
const K = h(
|
|
304
292
|
(e) => {
|
|
305
|
-
|
|
293
|
+
x.current && (x.current(), x.current = null);
|
|
306
294
|
const r = s || ke;
|
|
307
|
-
|
|
295
|
+
x.current = r(e, {
|
|
308
296
|
onBlocked: () => {
|
|
309
|
-
|
|
297
|
+
g((n) => n[e.origin] ? {
|
|
310
298
|
...n,
|
|
311
299
|
[e.origin]: { ...n[e.origin], popupBlocked: !0 }
|
|
312
300
|
} : n);
|
|
313
301
|
},
|
|
314
302
|
onClosed: () => {
|
|
315
303
|
if (e.v2) {
|
|
316
|
-
|
|
304
|
+
te && g((n) => !n[e.origin] || !n[e.origin].silentUrl ? n : {
|
|
317
305
|
...n,
|
|
318
306
|
[e.origin]: { ...n[e.origin], status: "silent" }
|
|
319
307
|
});
|
|
320
308
|
return;
|
|
321
309
|
}
|
|
322
|
-
|
|
310
|
+
o(e.origin);
|
|
323
311
|
}
|
|
324
312
|
});
|
|
325
313
|
},
|
|
326
|
-
[s,
|
|
327
|
-
),
|
|
328
|
-
|
|
329
|
-
// invisible by design.
|
|
330
|
-
pending: Object.values(p).filter(
|
|
314
|
+
[s, o]
|
|
315
|
+
), j = {
|
|
316
|
+
pending: Object.values(f).filter(
|
|
331
317
|
(e) => e.status === "interactive"
|
|
332
318
|
),
|
|
333
|
-
authorize:
|
|
334
|
-
approve:
|
|
335
|
-
complete:
|
|
336
|
-
dismiss:
|
|
337
|
-
originEpochs:
|
|
338
|
-
credentials:
|
|
339
|
-
unsupported:
|
|
340
|
-
},
|
|
319
|
+
authorize: K,
|
|
320
|
+
approve: Q,
|
|
321
|
+
complete: F,
|
|
322
|
+
dismiss: T,
|
|
323
|
+
originEpochs: P,
|
|
324
|
+
credentials: W,
|
|
325
|
+
unsupported: k
|
|
326
|
+
}, q = Object.values(f).filter(
|
|
341
327
|
(e) => e.status === "silent" && e.silentUrl
|
|
342
328
|
);
|
|
343
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ $.createElement(J.Provider, { value: j }, t, q.map((e) => /* @__PURE__ */ $.createElement(
|
|
344
330
|
"iframe",
|
|
345
331
|
{
|
|
346
332
|
key: `mm-silent-auth-${e.origin}`,
|
|
@@ -352,9 +338,9 @@ const ne = de(null), N = de({
|
|
|
352
338
|
}
|
|
353
339
|
)));
|
|
354
340
|
};
|
|
355
|
-
|
|
356
|
-
children:
|
|
357
|
-
launcher:
|
|
341
|
+
pe.propTypes = {
|
|
342
|
+
children: E.node,
|
|
343
|
+
launcher: E.func,
|
|
358
344
|
/**
|
|
359
345
|
* `async (request, { approve }) => result` where request =
|
|
360
346
|
* `{ origin, clientId, scope, authUrl }` (origin is the zone-attested frame origin) and result
|
|
@@ -363,169 +349,192 @@ fe.propTypes = {
|
|
|
363
349
|
* on 200, `{ consentRequired: true, client: { name, hostname }, stepUp }` on 409, `{ error,
|
|
364
350
|
* … }` otherwise. Provided only by hosts that are themselves first-party clients.
|
|
365
351
|
*/
|
|
366
|
-
broker:
|
|
352
|
+
broker: E.func
|
|
367
353
|
};
|
|
368
|
-
const
|
|
369
|
-
const { originEpochs: s } = V(
|
|
354
|
+
const qe = () => V(J), Ie = (t) => {
|
|
355
|
+
const { originEpochs: s } = V(J), c = N(t);
|
|
370
356
|
return c && s[c] || 0;
|
|
371
|
-
}, Ie = (t) => {
|
|
372
|
-
const { credentials: s } = V(N), c = Q(t);
|
|
373
|
-
return c && s[c] || null;
|
|
374
357
|
}, _e = (t) => {
|
|
375
|
-
const {
|
|
358
|
+
const { credentials: s } = V(J), c = N(t);
|
|
376
359
|
return c && s[c] || null;
|
|
377
|
-
}, Ue = (
|
|
378
|
-
const
|
|
360
|
+
}, Ue = (t) => {
|
|
361
|
+
const { unsupported: s } = V(J), c = N(t);
|
|
362
|
+
return c && s[c] || null;
|
|
363
|
+
}, de = "MMEmbeddableZoneProvider requires a boolean `ready` prop (true once the host holds the bearer its credentialBroker needs). Embedded apps will not load until it is provided.", Me = ({
|
|
364
|
+
children: t,
|
|
365
|
+
authorizationLauncher: s,
|
|
366
|
+
credentialBroker: c,
|
|
367
|
+
ready: d
|
|
368
|
+
}) => {
|
|
369
|
+
const f = d === !0, g = m(!1);
|
|
370
|
+
b(() => {
|
|
371
|
+
d !== void 0 || g.current || (g.current = !0, console.error(de), typeof window != "undefined" && typeof window.alert == "function" && window.alert(de));
|
|
372
|
+
}, [d]);
|
|
373
|
+
const [P, B] = O({}), [W, H] = O({}), k = m({}), z = m({}), y = m({}), U = h((l, u) => {
|
|
379
374
|
var o;
|
|
380
|
-
return !!((o =
|
|
381
|
-
}, []),
|
|
382
|
-
|
|
383
|
-
}, []),
|
|
384
|
-
|
|
385
|
-
const o = { ...
|
|
386
|
-
return delete o[
|
|
387
|
-
}),
|
|
388
|
-
const o = { ...
|
|
389
|
-
return delete o[
|
|
390
|
-
}), delete
|
|
375
|
+
return !!((o = y.current[l]) != null && o.has(u));
|
|
376
|
+
}, []), x = h((l, u, o) => {
|
|
377
|
+
B((a) => ({ ...a, [l]: { origin: u, frameRef: o } }));
|
|
378
|
+
}, []), Y = h((l) => {
|
|
379
|
+
B((u) => {
|
|
380
|
+
const o = { ...u };
|
|
381
|
+
return delete o[l], o;
|
|
382
|
+
}), H((u) => {
|
|
383
|
+
const o = { ...u };
|
|
384
|
+
return delete o[l], o;
|
|
385
|
+
}), delete y.current[l];
|
|
391
386
|
}, []);
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
o.forEach((
|
|
395
|
-
},
|
|
396
|
-
var
|
|
397
|
-
if (!((
|
|
387
|
+
b(() => {
|
|
388
|
+
const l = (o = [], a, T) => {
|
|
389
|
+
o.forEach((p) => p(a, T));
|
|
390
|
+
}, u = (o) => {
|
|
391
|
+
var A, D, Q, K, j, q, e;
|
|
392
|
+
if (!((A = o == null ? void 0 : o.data) != null && A.instanceId))
|
|
398
393
|
return;
|
|
399
|
-
const { instanceId: a, type:
|
|
400
|
-
if (!
|
|
394
|
+
const { instanceId: a, type: T } = o.data, p = P[a], F = (Q = (D = p == null ? void 0 : p.frameRef) == null ? void 0 : D.current) == null ? void 0 : Q.contentWindow;
|
|
395
|
+
if (!F || o.source !== F || o.origin !== p.origin)
|
|
401
396
|
return;
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
404
|
-
const { callbackId:
|
|
405
|
-
|
|
397
|
+
const w = { origin: o.origin }, I = k.current;
|
|
398
|
+
if (T === "response") {
|
|
399
|
+
const { callbackId: r, response: n, error: i } = o.data, _ = z.current[r];
|
|
400
|
+
_ && (_(n, i), delete z.current[r]);
|
|
406
401
|
return;
|
|
407
402
|
}
|
|
408
|
-
if (
|
|
409
|
-
const { requestType:
|
|
410
|
-
|
|
403
|
+
if (T === "mark-registered") {
|
|
404
|
+
const { requestType: r } = o.data;
|
|
405
|
+
y.current[a] || (y.current[a] = /* @__PURE__ */ new Set()), y.current[a].add(r);
|
|
411
406
|
return;
|
|
412
407
|
}
|
|
413
|
-
|
|
408
|
+
T === "ready" && H((r) => ({ ...r, [a]: !0 })), l((K = I[a]) == null ? void 0 : K[T], o.data, w), l((j = I["*"]) == null ? void 0 : j[T], o.data, w), l((q = I[a]) == null ? void 0 : q["*"], o.data, w), l((e = I["*"]) == null ? void 0 : e["*"], o.data, w);
|
|
414
409
|
};
|
|
415
|
-
return window.addEventListener("message",
|
|
416
|
-
window.removeEventListener("message",
|
|
410
|
+
return window.addEventListener("message", u), () => {
|
|
411
|
+
window.removeEventListener("message", u);
|
|
417
412
|
};
|
|
418
|
-
}, [
|
|
419
|
-
const
|
|
420
|
-
(
|
|
421
|
-
var
|
|
422
|
-
const a =
|
|
413
|
+
}, [P]);
|
|
414
|
+
const R = h(
|
|
415
|
+
(l, u, o) => {
|
|
416
|
+
var T, p;
|
|
417
|
+
const a = P[l];
|
|
423
418
|
if (!a) {
|
|
424
|
-
console.warn(`Origin not set for id: ${
|
|
419
|
+
console.warn(`Origin not set for id: ${l}. Unable to send message.`);
|
|
425
420
|
return;
|
|
426
421
|
}
|
|
427
|
-
(
|
|
428
|
-
{ type:
|
|
422
|
+
(p = (T = a == null ? void 0 : a.frameRef) == null ? void 0 : T.current) != null && p.contentWindow && a.frameRef.current.contentWindow.postMessage(
|
|
423
|
+
{ type: u, ...o, instanceId: l },
|
|
429
424
|
a.origin
|
|
430
425
|
);
|
|
431
426
|
},
|
|
432
|
-
[
|
|
433
|
-
),
|
|
434
|
-
async (
|
|
435
|
-
const
|
|
436
|
-
delete
|
|
427
|
+
[P]
|
|
428
|
+
), G = m(0), v = h(() => `${Date.now()}-${++G.current}`, []), M = h(
|
|
429
|
+
async (l, u, o = {}) => new Promise((a, T) => {
|
|
430
|
+
const p = v(), F = (w, I) => {
|
|
431
|
+
delete z.current[p], I ? T(I) : a(w);
|
|
437
432
|
};
|
|
438
|
-
|
|
433
|
+
z.current[p] = F, R(l, "request", { callbackId: p, requestType: u, data: o });
|
|
439
434
|
}),
|
|
440
|
-
[
|
|
441
|
-
),
|
|
442
|
-
(
|
|
443
|
-
|
|
435
|
+
[R]
|
|
436
|
+
), L = h(
|
|
437
|
+
(l, u) => {
|
|
438
|
+
R(l, "load-options", u);
|
|
444
439
|
},
|
|
445
|
-
[
|
|
446
|
-
),
|
|
447
|
-
(
|
|
448
|
-
|
|
440
|
+
[R]
|
|
441
|
+
), S = h(
|
|
442
|
+
(l, u) => {
|
|
443
|
+
R(l, "validate", u);
|
|
449
444
|
},
|
|
450
|
-
[
|
|
451
|
-
),
|
|
445
|
+
[R]
|
|
446
|
+
), C = ge(
|
|
452
447
|
() => ({
|
|
453
|
-
registerFrame:
|
|
454
|
-
unregisterFrame:
|
|
455
|
-
sendMessage:
|
|
456
|
-
sendRequest:
|
|
457
|
-
loadOptions:
|
|
458
|
-
validate:
|
|
459
|
-
hasHandler:
|
|
460
|
-
readyFrames:
|
|
461
|
-
|
|
462
|
-
|
|
448
|
+
registerFrame: x,
|
|
449
|
+
unregisterFrame: Y,
|
|
450
|
+
sendMessage: R,
|
|
451
|
+
sendRequest: M,
|
|
452
|
+
loadOptions: L,
|
|
453
|
+
validate: S,
|
|
454
|
+
hasHandler: U,
|
|
455
|
+
readyFrames: W,
|
|
456
|
+
ready: f,
|
|
457
|
+
addListener: (l, u, o) => (k.current[l] || (k.current[l] = {}), k.current[l][u] || (k.current[l][u] = []), k.current[l][u].push(o), () => {
|
|
458
|
+
k.current[l][u] = k.current[l][u].filter((a) => a !== o);
|
|
463
459
|
})
|
|
464
460
|
}),
|
|
465
461
|
[
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
462
|
+
x,
|
|
463
|
+
Y,
|
|
464
|
+
R,
|
|
465
|
+
M,
|
|
466
|
+
L,
|
|
467
|
+
S,
|
|
468
|
+
U,
|
|
469
|
+
W,
|
|
470
|
+
f
|
|
474
471
|
]
|
|
475
472
|
);
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
|
|
473
|
+
return /* @__PURE__ */ $.createElement(ne.Provider, { value: C }, /* @__PURE__ */ $.createElement(
|
|
474
|
+
pe,
|
|
475
|
+
{
|
|
476
|
+
launcher: s,
|
|
477
|
+
broker: c
|
|
478
|
+
},
|
|
479
|
+
t
|
|
480
|
+
));
|
|
481
|
+
}, X = (t, s, c) => {
|
|
478
482
|
const d = V(ne);
|
|
479
483
|
if (d === null)
|
|
480
484
|
throw new Error(
|
|
481
485
|
"useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
|
|
482
486
|
);
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}, [c]),
|
|
487
|
+
const f = m(c);
|
|
488
|
+
b(() => {
|
|
489
|
+
f.current = c;
|
|
490
|
+
}, [c]), b(() => {
|
|
487
491
|
if (!(!t || !s)) {
|
|
488
492
|
if (s.startsWith("key:")) {
|
|
489
|
-
const
|
|
490
|
-
return d.readyFrames[t] && d.sendMessage(t, "subscribe-key", { keyChord:
|
|
493
|
+
const g = s.substring(4);
|
|
494
|
+
return d.readyFrames[t] && d.sendMessage(t, "subscribe-key", { keyChord: g }), d.addListener(
|
|
491
495
|
t,
|
|
492
|
-
`key-pressed:${
|
|
493
|
-
(...
|
|
496
|
+
`key-pressed:${g}`,
|
|
497
|
+
(...B) => f.current(...B)
|
|
494
498
|
);
|
|
495
499
|
}
|
|
496
500
|
return d.addListener(
|
|
497
501
|
t,
|
|
498
502
|
s,
|
|
499
|
-
(...
|
|
503
|
+
(...g) => f.current(...g)
|
|
500
504
|
);
|
|
501
505
|
}
|
|
502
506
|
}, [d, t, s]);
|
|
503
507
|
};
|
|
504
|
-
|
|
505
|
-
children:
|
|
508
|
+
Me.propTypes = {
|
|
509
|
+
children: E.node.isRequired,
|
|
510
|
+
/**
|
|
511
|
+
* Required. True once the host holds its bearer; zones mount no iframe until then. Missing =
|
|
512
|
+
* not ready, plus a one-time alert.
|
|
513
|
+
*/
|
|
514
|
+
ready: E.bool.isRequired,
|
|
506
515
|
/**
|
|
507
516
|
* Optional interactive-step launcher for embedded authorizations,
|
|
508
517
|
* `(entry, { onBlocked, onClosed }) => cleanup`. Defaults to a top-level
|
|
509
518
|
* popup. Hosts that cannot open windows (Android WebView shells) drive
|
|
510
519
|
* their own UI from useEmbeddedAuthorizations() instead.
|
|
511
520
|
*/
|
|
512
|
-
authorizationLauncher:
|
|
521
|
+
authorizationLauncher: E.func,
|
|
513
522
|
/**
|
|
514
523
|
* Optional credential broker for hosts that are first-party MachineMetrics clients
|
|
515
524
|
* (`async (request, { approve }) => result`, see EmbeddedAuthorizationManager). When present,
|
|
516
525
|
* v2 credential requests are brokered server-side (no popup, no hidden frame) and consent is
|
|
517
526
|
* rendered natively by the host from the broker's `client` identity.
|
|
518
527
|
*/
|
|
519
|
-
credentialBroker:
|
|
528
|
+
credentialBroker: E.func
|
|
520
529
|
};
|
|
521
|
-
const se = ie.default || ie, Le = 1e4,
|
|
530
|
+
const se = ie.default || ie, Le = 1e4, Ce = "credentials", Ae = (t, s) => `${t}/mm-embedded-interop?id=${encodeURIComponent(s)}&origin=${encodeURIComponent(
|
|
522
531
|
window.location.origin
|
|
523
|
-
)}&caps=${
|
|
532
|
+
)}&caps=${Ce}`, Oe = se.iframe`
|
|
524
533
|
width: 100%;
|
|
525
534
|
height: 100%;
|
|
526
535
|
border: none;
|
|
527
536
|
visibility: ${(t) => t.$isReady ? "visible" : "hidden"};
|
|
528
|
-
`,
|
|
537
|
+
`, ze = se.div`
|
|
529
538
|
width: 100%;
|
|
530
539
|
height: 100%;
|
|
531
540
|
display: flex;
|
|
@@ -538,7 +547,7 @@ const se = ie.default || ie, Le = 1e4, Me = "credentials", Ce = (t, s) => `${t}/
|
|
|
538
547
|
text-align: center;
|
|
539
548
|
color: #555;
|
|
540
549
|
font-size: 14px;
|
|
541
|
-
`,
|
|
550
|
+
`, xe = (t) => {
|
|
542
551
|
const s = t && t.origin || "This app", c = t && t.reason || "";
|
|
543
552
|
switch (c) {
|
|
544
553
|
case "broker:scope_above_ceiling":
|
|
@@ -566,154 +575,158 @@ const se = ie.default || ie, Le = 1e4, Me = "credentials", Ce = (t, s) => `${t}/
|
|
|
566
575
|
detail: "It needs an update to support embedding from a different domain."
|
|
567
576
|
};
|
|
568
577
|
}
|
|
569
|
-
},
|
|
570
|
-
const s =
|
|
571
|
-
return /* @__PURE__ */
|
|
578
|
+
}, he = ({ entry: t }) => {
|
|
579
|
+
const s = xe(t);
|
|
580
|
+
return /* @__PURE__ */ $.createElement(ze, { "data-reason": t && t.reason || void 0 }, /* @__PURE__ */ $.createElement("div", { style: { fontWeight: 600 } }, s.title), /* @__PURE__ */ $.createElement("div", { style: { fontSize: 12, color: "#888" } }, s.detail));
|
|
572
581
|
};
|
|
573
|
-
|
|
574
|
-
entry:
|
|
575
|
-
origin:
|
|
576
|
-
name:
|
|
577
|
-
reason:
|
|
578
|
-
detail:
|
|
582
|
+
he.propTypes = {
|
|
583
|
+
entry: E.shape({
|
|
584
|
+
origin: E.string,
|
|
585
|
+
name: E.string,
|
|
586
|
+
reason: E.string,
|
|
587
|
+
detail: E.object
|
|
579
588
|
})
|
|
580
589
|
};
|
|
581
|
-
const
|
|
590
|
+
const $e = se.div`
|
|
582
591
|
height: 100%;
|
|
583
592
|
display: flex;
|
|
584
593
|
flex: 1;
|
|
585
594
|
align-items: center;
|
|
586
595
|
justify-content: center;
|
|
587
|
-
`,
|
|
596
|
+
`, ye = () => /* @__PURE__ */ $.createElement($e, null, /* @__PURE__ */ $.createElement("div", { style: { textAlign: "center" } }, "This app couldn’t be loaded as an embeddable widget.")), Se = ({
|
|
588
597
|
id: t,
|
|
589
598
|
src: s,
|
|
590
599
|
path: c,
|
|
591
600
|
onInit: d = () => {
|
|
592
601
|
},
|
|
593
|
-
onTimeout:
|
|
594
|
-
context:
|
|
595
|
-
params:
|
|
596
|
-
renderUnsupported:
|
|
597
|
-
renderTimeout:
|
|
598
|
-
...
|
|
602
|
+
onTimeout: f,
|
|
603
|
+
context: g = {},
|
|
604
|
+
params: P = {},
|
|
605
|
+
renderUnsupported: B,
|
|
606
|
+
renderTimeout: W,
|
|
607
|
+
...H
|
|
599
608
|
}) => {
|
|
600
|
-
if ("isConfiguring" in
|
|
609
|
+
if ("isConfiguring" in H)
|
|
601
610
|
return console.error(
|
|
602
611
|
"isConfiguring must be passed via the params prop to MMEmbeddableZone"
|
|
603
612
|
), null;
|
|
604
|
-
if ("colorMode" in
|
|
613
|
+
if ("colorMode" in g)
|
|
605
614
|
return console.error(
|
|
606
615
|
"colorMode must be passed via the params prop to MMEmbeddableZone"
|
|
607
616
|
), null;
|
|
608
|
-
if ("isFullScreen" in
|
|
617
|
+
if ("isFullScreen" in g)
|
|
609
618
|
return console.error(
|
|
610
619
|
"isFullScreen must be passed via the params prop to MMEmbeddableZone"
|
|
611
620
|
), null;
|
|
612
|
-
const
|
|
621
|
+
const k = m(), [z, y] = O(), [U, x] = O(0), [Y, R] = O(!1), [G, v] = O(!1), M = Ie(s), L = _e(s), S = Ue(s), [C, l] = O(0), [u, o] = O(null), { registerFrame: a, unregisterFrame: T, sendMessage: p, ready: F } = V(
|
|
613
622
|
ne
|
|
614
|
-
), [
|
|
615
|
-
|
|
623
|
+
), [w, I] = O(), A = m(), D = m(f), Q = m(d), K = m(!1), j = h(() => {
|
|
624
|
+
K.current = !1, clearTimeout(A.current), x(0), R(!1), v(!1), o(null);
|
|
616
625
|
}, []);
|
|
617
|
-
|
|
618
|
-
(
|
|
619
|
-
}, [
|
|
620
|
-
|
|
621
|
-
}, [
|
|
622
|
-
|
|
623
|
-
}, [d]),
|
|
624
|
-
|
|
626
|
+
b(() => {
|
|
627
|
+
(M > 0 || C > 0) && j();
|
|
628
|
+
}, [M, C, j]), b(() => {
|
|
629
|
+
D.current = f;
|
|
630
|
+
}, [f]), b(() => {
|
|
631
|
+
Q.current = d;
|
|
632
|
+
}, [d]), b(() => {
|
|
633
|
+
U && p(t, "set-context", {
|
|
625
634
|
context: {
|
|
626
|
-
...
|
|
635
|
+
...g
|
|
627
636
|
}
|
|
628
637
|
});
|
|
629
|
-
}, [
|
|
630
|
-
|
|
631
|
-
}, [
|
|
632
|
-
c !== void 0 &&
|
|
633
|
-
}, [c]),
|
|
634
|
-
|
|
635
|
-
}, [
|
|
636
|
-
if (!s || !t || !
|
|
638
|
+
}, [g, t, U]), b(() => {
|
|
639
|
+
U && p(t, "set-params", { params: P });
|
|
640
|
+
}, [P, t, U]), b(() => {
|
|
641
|
+
c !== void 0 && I((c == null ? void 0 : c.indexOf("/")) === 0 ? c : `/${c}`);
|
|
642
|
+
}, [c]), b(() => {
|
|
643
|
+
w === void 0 || !U || p(t, "navigate", { path: w });
|
|
644
|
+
}, [w, U, t, p]), b(() => {
|
|
645
|
+
if (!s || !t || !k)
|
|
646
|
+
return;
|
|
647
|
+
if (!F) {
|
|
648
|
+
j(), y(void 0);
|
|
637
649
|
return;
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
650
|
+
}
|
|
651
|
+
j();
|
|
652
|
+
const r = new URL(s);
|
|
653
|
+
return a(t, r.origin, k), Q.current(), y(Ae(r.origin, t)), () => {
|
|
654
|
+
T(t);
|
|
642
655
|
};
|
|
643
|
-
}, [s, t,
|
|
644
|
-
if (!(!
|
|
645
|
-
return
|
|
646
|
-
|
|
647
|
-
}, Le), () => clearTimeout(
|
|
648
|
-
}, [
|
|
649
|
-
const
|
|
650
|
-
|
|
656
|
+
}, [s, t, F, a, k, j]), b(() => {
|
|
657
|
+
if (!(!z || K.current))
|
|
658
|
+
return A.current = setTimeout(() => {
|
|
659
|
+
R(!0), D.current && D.current();
|
|
660
|
+
}, Le), () => clearTimeout(A.current);
|
|
661
|
+
}, [z, s, M, C]);
|
|
662
|
+
const q = h(() => {
|
|
663
|
+
K.current = !0, clearTimeout(A.current), R(!1);
|
|
651
664
|
}, []);
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}),
|
|
655
|
-
|
|
656
|
-
}),
|
|
657
|
-
if (!
|
|
665
|
+
X(t, "init", (r) => {
|
|
666
|
+
q(), Array.isArray(r == null ? void 0 : r.acceptsCredentials) && o(r.acceptsCredentials);
|
|
667
|
+
}), X(t, "authorize", q), X(t, "login", q), X(t, "credential-request", () => {
|
|
668
|
+
q(), v(!0);
|
|
669
|
+
}), b(() => {
|
|
670
|
+
if (!G || !L)
|
|
658
671
|
return;
|
|
659
|
-
const
|
|
660
|
-
if (Array.isArray(
|
|
672
|
+
const r = u;
|
|
673
|
+
if (Array.isArray(r) && !r.includes(L.kind))
|
|
661
674
|
return;
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
}, [
|
|
665
|
-
|
|
675
|
+
const n = L.kind === "access_token" ? { accessToken: L.accessToken } : {};
|
|
676
|
+
p(t, "credential", { ...n, credential: L });
|
|
677
|
+
}, [G, L, u, t, p]), X(t, "ready", () => {
|
|
678
|
+
q(), x((r) => r + 1);
|
|
666
679
|
});
|
|
667
|
-
const
|
|
668
|
-
return
|
|
669
|
-
|
|
670
|
-
|
|
680
|
+
const e = m();
|
|
681
|
+
return X(t, "heartbeat", () => {
|
|
682
|
+
e.current && clearTimeout(e.current), e.current = setTimeout(() => {
|
|
683
|
+
l((r) => r + 1);
|
|
671
684
|
}, 6e3);
|
|
672
|
-
}),
|
|
673
|
-
|
|
674
|
-
}, []),
|
|
675
|
-
|
|
685
|
+
}), b(() => () => {
|
|
686
|
+
e.current && clearTimeout(e.current);
|
|
687
|
+
}, []), S ? B ? B(S) : /* @__PURE__ */ $.createElement(he, { entry: S }) : Y && !U ? W ? W() : /* @__PURE__ */ $.createElement(ye, null) : /* @__PURE__ */ $.createElement(
|
|
688
|
+
Oe,
|
|
676
689
|
{
|
|
677
|
-
key: `auth-epoch-${
|
|
678
|
-
$isReady:
|
|
679
|
-
ref:
|
|
680
|
-
src:
|
|
681
|
-
...
|
|
690
|
+
key: `auth-epoch-${M}-frame-${C}`,
|
|
691
|
+
$isReady: U,
|
|
692
|
+
ref: k,
|
|
693
|
+
src: z,
|
|
694
|
+
...H
|
|
682
695
|
}
|
|
683
696
|
);
|
|
684
697
|
};
|
|
685
698
|
Se.propTypes = {
|
|
686
|
-
id:
|
|
687
|
-
src:
|
|
688
|
-
path:
|
|
689
|
-
onInit:
|
|
690
|
-
onTimeout:
|
|
699
|
+
id: E.string,
|
|
700
|
+
src: E.string.isRequired,
|
|
701
|
+
path: E.string,
|
|
702
|
+
onInit: E.func,
|
|
703
|
+
onTimeout: E.func,
|
|
691
704
|
/**
|
|
692
705
|
* Optional host-styled renderer for the structurally-unsupported embed
|
|
693
706
|
* state (legacy app on a cross-site origin), `(entry) => ReactNode`. Falls
|
|
694
707
|
* back to a minimal built-in placeholder.
|
|
695
708
|
*/
|
|
696
|
-
renderUnsupported:
|
|
709
|
+
renderUnsupported: E.func,
|
|
697
710
|
/**
|
|
698
711
|
* Optional host-styled renderer for the handshake-timeout failure state
|
|
699
712
|
* (the app is not embeddable / could not load), `() => ReactNode`. Falls
|
|
700
713
|
* back to a minimal centered message.
|
|
701
714
|
*/
|
|
702
|
-
renderTimeout:
|
|
715
|
+
renderTimeout: E.func
|
|
703
716
|
};
|
|
704
717
|
export {
|
|
705
|
-
|
|
706
|
-
|
|
718
|
+
be as CREDENTIAL_KIND_ACCESS_TOKEN,
|
|
719
|
+
J as EmbeddedAuthorizationContext,
|
|
707
720
|
Se as MMEmbeddableZone,
|
|
708
721
|
ne as MMEmbeddableZoneContext,
|
|
709
|
-
|
|
722
|
+
Me as MMEmbeddableZoneProvider,
|
|
710
723
|
ae as isCrossSite,
|
|
711
724
|
ce as normalizeCredential,
|
|
712
725
|
ke as popupAuthorizationLauncher,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
726
|
+
xe as unsupportedCopy,
|
|
727
|
+
qe as useEmbeddedAuthorizations,
|
|
728
|
+
_e as useEmbeddedCredential,
|
|
729
|
+
X as useEmbeddedEffect,
|
|
730
|
+
Ie as useEmbeddedOriginEpoch,
|
|
731
|
+
Ue as useEmbeddedUnsupported
|
|
719
732
|
};
|