@machinemetrics/mm-react-embeddable 2.0.1 → 2.0.2

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