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