@module-federation/bridge-vue3 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -3,12 +3,12 @@ import { defineComponent, ref, watch, onMounted, onBeforeUnmount, createVNode, d
3
3
  import * as VueRouter from "vue-router";
4
4
  import { useRoute } from "vue-router";
5
5
  var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __export = (r, t) => {
6
- for (var o in t)
7
- __defProp(r, o, { get: t[o], enumerable: !0 });
8
- }, __copyProps = (r, t, o, n) => {
6
+ for (var n in t)
7
+ __defProp(r, n, { get: t[n], enumerable: !0 });
8
+ }, __copyProps = (r, t, n, o) => {
9
9
  if (t && typeof t == "object" || typeof t == "function")
10
10
  for (let s of __getOwnPropNames(t))
11
- !__hasOwnProp.call(r, s) && s !== o && __defProp(r, s, { get: () => t[s], enumerable: !(n = __getOwnPropDesc(t, s)) || n.enumerable });
11
+ !__hasOwnProp.call(r, s) && s !== n && __defProp(r, s, { get: () => t[s], enumerable: !(o = __getOwnPropDesc(t, s)) || o.enumerable });
12
12
  return r;
13
13
  }, __toCommonJS = (r) => __copyProps(__defProp({}, "__esModule", { value: !0 }), r), browser_exports = {};
14
14
  __export(browser_exports, {
@@ -18,13 +18,16 @@ __export(browser_exports, {
18
18
  var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, supportColor = () => {
19
19
  if (typeof supportsSubstitutions < "u")
20
20
  return supportsSubstitutions;
21
+ const r = console.log;
21
22
  try {
22
- const r = "color test", t = "color: red;", o = console.log;
23
- console.log = (...n) => {
24
- n[0] === `%c${r}` && n[1] === t && (supportsSubstitutions = !0);
25
- }, console.log(`%c${r}`, t), console.log = o;
23
+ const t = "color test", n = "color: red;";
24
+ supportsSubstitutions = !1, console.log = (...o) => {
25
+ o[0] === `%c${t}` && o[1] === n && (supportsSubstitutions = !0);
26
+ }, console.log(`%c${t}`, n);
26
27
  } catch {
27
28
  supportsSubstitutions = !1;
29
+ } finally {
30
+ console.log = r;
28
31
  }
29
32
  return supportsSubstitutions;
30
33
  }, ansiToCss = {
@@ -37,18 +40,24 @@ var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, sup
37
40
  gray: "color: gray;"
38
41
  }, formatter = (r) => supportColor() ? (t) => {
39
42
  if (Array.isArray(t)) {
40
- const [o, n] = t;
41
- return [`%c${o.replace("%c", "")}`, n ? `${ansiToCss[r]}${n}` : `${ansiToCss[r] || ""}`];
43
+ const [n, o] = t;
44
+ return [`%c${n.replace("%c", "")}`, o ? `${ansiToCss[r]}${o}` : `${ansiToCss[r] || ""}`];
42
45
  }
43
46
  return [`%c${String(t).replace("%c", "")}`, ansiToCss[r] || ""];
44
47
  } : (t) => [String(t)], bold = formatter("bold"), red = formatter("red"), green = formatter("green"), orange = formatter("orange"), dodgerblue = formatter("dodgerblue"), magenta = formatter("magenta");
45
48
  formatter("gray");
46
- function getLabel(r, t, o) {
47
- let n = [""];
48
- return "label" in t && (n = [o[r] || t.label || ""], n = bold(t.color ? t.color(n) : n[0])), n = n.filter(Boolean), n;
49
+ function getLabel(r, t, n) {
50
+ let o = [""];
51
+ if ("label" in t)
52
+ if (o = [(r !== "log" ? n[r] : void 0) || t.label || ""], t.color) {
53
+ const a = t.color(o[0]);
54
+ Array.isArray(a) && a.length === 2 ? o = bold([a[0], a[1]]) : o = bold(a[0] || "");
55
+ } else
56
+ o = bold(o[0]);
57
+ return o = o.filter(Boolean), o;
49
58
  }
50
- function finalLog(r, t, o, n) {
51
- r.length ? Array.isArray(n) ? console.log(...r, ...n) : console.log(...r, t) : Array.isArray(n) ? console.log(...n) : console.log(t, ...o);
59
+ function finalLog(r, t, n, o) {
60
+ r.length ? Array.isArray(o) ? console.log(...r, ...o, ...n) : console.log(...r, t, ...n) : Array.isArray(o) ? console.log(...o) : console.log(t, ...n);
52
61
  }
53
62
  var LOG_LEVEL = {
54
63
  error: 0,
@@ -56,62 +65,72 @@ var LOG_LEVEL = {
56
65
  info: 2,
57
66
  log: 3,
58
67
  verbose: 4
59
- }, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r), createLogger$1 = (r = {}, { getLabel: t, handleError: o, finalLog: n, greet: s, LOG_TYPES: l }) => {
60
- let a = r.level || "log", i = r.labels || {}, c = (d, p, ...m) => {
61
- if (LOG_LEVEL[l[d].level] > LOG_LEVEL[a])
68
+ }, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r);
69
+ function validateOptions(r) {
70
+ const t = { ...r };
71
+ if (r.labels && typeof r.labels != "object")
72
+ throw new Error("Labels must be an object");
73
+ if (r.level && typeof r.level != "string")
74
+ throw new Error("Level must be a string");
75
+ return t;
76
+ }
77
+ var createLogger$1 = (r = {}, { getLabel: t, handleError: n, finalLog: o, greet: s, LOG_TYPES: a }) => {
78
+ const l = validateOptions(r);
79
+ let i = l.level || "log", c = l.labels || {}, u = (p, d, ...y) => {
80
+ if (LOG_LEVEL[a[p].level] > LOG_LEVEL[i])
62
81
  return;
63
- if (p == null)
82
+ if (d == null)
64
83
  return console.log();
65
- let y = l[d], _ = "";
66
- const R = t(d, y, i);
67
- if (p instanceof Error)
68
- if (p.stack) {
69
- let [g, ...E] = p.stack.split(`
84
+ let _ = a[p], E = "";
85
+ const g = t(p, _, c);
86
+ if (d instanceof Error)
87
+ if (d.stack) {
88
+ let [b, ...S] = d.stack.split(`
70
89
  `);
71
- g.startsWith("Error: ") && (g = g.slice(7)), _ = `${g}
72
- ${o(E.join(`
90
+ b.startsWith("Error: ") && (b = b.slice(7)), E = `${b}
91
+ ${n(S.join(`
73
92
  `))}`;
74
93
  } else
75
- _ = p.message;
94
+ E = d.message;
76
95
  else
77
- y.level === "error" && typeof p == "string" ? _ = p.split(`
78
- `).map((E) => isErrorStackMessage(E) ? o(E) : E).join(`
79
- `) : _ = `${p}`;
80
- n(R, _, m, p);
81
- }, u = {
96
+ _.level === "error" && typeof d == "string" ? E = d.split(`
97
+ `).map((S) => isErrorStackMessage(S) ? n(S) : S).join(`
98
+ `) : E = `${d}`;
99
+ o(g, E, y, d);
100
+ }, m = {
82
101
  // greet
83
- greet: (d) => c("log", s(d))
102
+ greet: (p) => u("log", s(p))
84
103
  };
85
- return Object.keys(l).forEach((d) => {
86
- u[d] = (...p) => c(d, ...p);
87
- }), Object.defineProperty(u, "level", {
88
- get: () => a,
89
- set(d) {
90
- a = d;
91
- }
92
- }), Object.defineProperty(u, "labels", {
104
+ return Object.keys(a).forEach((p) => {
105
+ m[p] = (...d) => u(p, ...d);
106
+ }), Object.defineProperty(m, "level", {
93
107
  get: () => i,
94
- set(d) {
95
- i = d;
108
+ set(p) {
109
+ i = p;
96
110
  }
97
- }), u.override = (d) => {
98
- Object.assign(u, d);
99
- }, u;
111
+ }), Object.defineProperty(m, "labels", {
112
+ get: () => c,
113
+ set(p) {
114
+ c = p;
115
+ }
116
+ }), m.override = (p) => {
117
+ Object.assign(m, p);
118
+ }, m;
100
119
  }, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (r) => !/[\s\n]/.test(r);
101
120
  function gradient(r) {
102
121
  if (!supportColor())
103
122
  return [r];
104
- const t = [...r], o = t.filter(isWord), n = o.length - 1;
105
- if (n === 0)
123
+ const t = [...r], n = t.filter(isWord), o = n.length - 1;
124
+ if (o === 0)
106
125
  return console.log(`%c${r}`, `color: rgb(${startColor.join(",")}); font-weight: bold;`), [r];
107
- let s = "", l = [];
108
- return t.forEach((a) => {
109
- if (isWord(a)) {
110
- const i = o.indexOf(a) / n, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), d = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
111
- s += `%c${a}`, l.push(`color: rgb(${c},${u},${d}); font-weight: bold;`);
126
+ let s = "", a = [];
127
+ return t.forEach((l) => {
128
+ if (isWord(l)) {
129
+ const i = n.indexOf(l) / o, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), m = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
130
+ s += `%c${l}`, a.push(`color: rgb(${c},${u},${m}); font-weight: bold;`);
112
131
  } else
113
- s += a;
114
- }), [s, ...l];
132
+ s += l;
133
+ }), [s, ...a];
115
134
  }
116
135
  var LOG_TYPES = {
117
136
  // Level error
@@ -171,10 +190,10 @@ function createLogger2(r = {}) {
171
190
  var logger$1 = createLogger2();
172
191
  function _extends$2() {
173
192
  return _extends$2 = Object.assign || function(t) {
174
- for (var o = 1; o < arguments.length; o++) {
175
- var n = arguments[o];
176
- for (var s in n)
177
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
193
+ for (var n = 1; n < arguments.length; n++) {
194
+ var o = arguments[n];
195
+ for (var s in o)
196
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
178
197
  }
179
198
  return t;
180
199
  }, _extends$2.apply(this, arguments);
@@ -224,11 +243,11 @@ function createLogger(r) {
224
243
  }
225
244
  createLogger(PREFIX);
226
245
  const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...r) {
227
- return r.length ? r.reduce((t, o) => o ? t ? `${t}${SEPARATOR}${o}` : o : t, "") : "";
246
+ return r.length ? r.reduce((t, n) => n ? t ? `${t}${SEPARATOR}${n}` : n : t, "") : "";
228
247
  }, getResourceUrl = (r, t) => {
229
248
  if ("getPublicPath" in r) {
230
- let o;
231
- return r.getPublicPath.startsWith("function") ? o = new Function("return " + r.getPublicPath)()() : o = new Function(r.getPublicPath)(), `${o}${t}`;
249
+ let n;
250
+ return r.getPublicPath.startsWith("function") ? n = new Function("return " + r.getPublicPath)()() : n = new Function(r.getPublicPath)(), `${n}${t}`;
232
251
  } else
233
252
  return "publicPath" in r ? `${r.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", r, t), "");
234
253
  }, warn$1 = (r) => {
@@ -244,84 +263,84 @@ function safeToString(r) {
244
263
  const simpleJoinRemoteEntry = (r, t) => {
245
264
  if (!r)
246
265
  return t;
247
- const n = ((s) => {
266
+ const o = ((s) => {
248
267
  if (s === ".")
249
268
  return "";
250
269
  if (s.startsWith("./"))
251
270
  return s.replace("./", "");
252
271
  if (s.startsWith("/")) {
253
- const l = s.slice(1);
254
- return l.endsWith("/") ? l.slice(0, -1) : l;
272
+ const a = s.slice(1);
273
+ return a.endsWith("/") ? a.slice(0, -1) : a;
255
274
  }
256
275
  return s;
257
276
  })(r);
258
- return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
277
+ return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
259
278
  };
260
279
  function inferAutoPublicPath(r) {
261
280
  return r.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
262
281
  }
263
282
  function generateSnapshotFromManifest(r, t = {}) {
264
- var o, n;
265
- const { remotes: s = {}, overrides: l = {}, version: a } = t;
283
+ var n, o;
284
+ const { remotes: s = {}, overrides: a = {}, version: l } = t;
266
285
  let i;
267
- const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && a ? inferAutoPublicPath(a) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(l);
268
- let d = {};
286
+ const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && l ? inferAutoPublicPath(l) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(a);
287
+ let m = {};
269
288
  if (!Object.keys(s).length) {
270
289
  var p;
271
- d = ((p = r.remotes) == null ? void 0 : p.reduce((b, $) => {
272
- let A;
290
+ m = ((p = r.remotes) == null ? void 0 : p.reduce((R, $) => {
291
+ let w;
273
292
  const O = $.federationContainerName;
274
- return u.includes(O) ? A = l[O] : "version" in $ ? A = $.version : A = $.entry, b[O] = {
275
- matchedVersion: A
276
- }, b;
293
+ return u.includes(O) ? w = a[O] : "version" in $ ? w = $.version : w = $.entry, R[O] = {
294
+ matchedVersion: w
295
+ }, R;
277
296
  }, {})) || {};
278
297
  }
279
- Object.keys(s).forEach((b) => d[b] = {
298
+ Object.keys(s).forEach((R) => m[R] = {
280
299
  // overrides will override dependencies
281
- matchedVersion: u.includes(b) ? l[b] : s[b]
300
+ matchedVersion: u.includes(R) ? a[R] : s[R]
282
301
  });
283
- const { remoteEntry: { path: m, name: y, type: _ }, types: R, buildInfo: { buildVersion: g }, globalName: E, ssrRemoteEntry: I } = r.metaData, { exposes: v } = r;
284
- let S = {
285
- version: a || "",
302
+ const { remoteEntry: { path: d, name: y, type: _ }, types: E, buildInfo: { buildVersion: g }, globalName: b, ssrRemoteEntry: S } = r.metaData, { exposes: I } = r;
303
+ let v = {
304
+ version: l || "",
286
305
  buildVersion: g,
287
- globalName: E,
288
- remoteEntry: simpleJoinRemoteEntry(m, y),
306
+ globalName: b,
307
+ remoteEntry: simpleJoinRemoteEntry(d, y),
289
308
  remoteEntryType: _,
290
- remoteTypes: simpleJoinRemoteEntry(R.path, R.name),
291
- remoteTypesZip: R.zip || "",
292
- remoteTypesAPI: R.api || "",
293
- remotesInfo: d,
294
- shared: r == null ? void 0 : r.shared.map((b) => ({
295
- assets: b.assets,
296
- sharedName: b.name,
297
- version: b.version
309
+ remoteTypes: simpleJoinRemoteEntry(E.path, E.name),
310
+ remoteTypesZip: E.zip || "",
311
+ remoteTypesAPI: E.api || "",
312
+ remotesInfo: m,
313
+ shared: r == null ? void 0 : r.shared.map((R) => ({
314
+ assets: R.assets,
315
+ sharedName: R.name,
316
+ version: R.version
298
317
  })),
299
- modules: v == null ? void 0 : v.map((b) => ({
300
- moduleName: b.name,
301
- modulePath: b.path,
302
- assets: b.assets
318
+ modules: I == null ? void 0 : I.map((R) => ({
319
+ moduleName: R.name,
320
+ modulePath: R.path,
321
+ assets: R.assets
303
322
  }))
304
323
  };
305
- if ((o = r.metaData) != null && o.prefetchInterface) {
306
- const b = r.metaData.prefetchInterface;
307
- S = _extends$2({}, S, {
308
- prefetchInterface: b
324
+ if ((n = r.metaData) != null && n.prefetchInterface) {
325
+ const R = r.metaData.prefetchInterface;
326
+ v = _extends$2({}, v, {
327
+ prefetchInterface: R
309
328
  });
310
329
  }
311
- if ((n = r.metaData) != null && n.prefetchEntry) {
312
- const { path: b, name: $, type: A } = r.metaData.prefetchEntry;
313
- S = _extends$2({}, S, {
314
- prefetchEntry: simpleJoinRemoteEntry(b, $),
315
- prefetchEntryType: A
330
+ if ((o = r.metaData) != null && o.prefetchEntry) {
331
+ const { path: R, name: $, type: w } = r.metaData.prefetchEntry;
332
+ v = _extends$2({}, v, {
333
+ prefetchEntry: simpleJoinRemoteEntry(R, $),
334
+ prefetchEntryType: w
316
335
  });
317
336
  }
318
- if ("publicPath" in r.metaData ? i = _extends$2({}, S, {
337
+ if ("publicPath" in r.metaData ? i = _extends$2({}, v, {
319
338
  publicPath: c()
320
- }) : i = _extends$2({}, S, {
339
+ }) : i = _extends$2({}, v, {
321
340
  getPublicPath: c()
322
- }), I) {
323
- const b = simpleJoinRemoteEntry(I.path, I.name);
324
- i.ssrRemoteEntry = b, i.ssrRemoteEntryType = I.type || "commonjs-module";
341
+ }), S) {
342
+ const R = simpleJoinRemoteEntry(S.path, S.name);
343
+ i.ssrRemoteEntry = R, i.ssrRemoteEntryType = S.type || "commonjs-module";
325
344
  }
326
345
  return i;
327
346
  }
@@ -331,22 +350,22 @@ function isManifestProvider(r) {
331
350
  async function safeWrapper(r, t) {
332
351
  try {
333
352
  return await r();
334
- } catch (o) {
335
- warn$1(o);
353
+ } catch (n) {
354
+ warn$1(n);
336
355
  return;
337
356
  }
338
357
  }
339
358
  function isStaticResourcesEqual(r, t) {
340
- const o = /^(https?:)?\/\//i, n = r.replace(o, "").replace(/\/$/, ""), s = t.replace(o, "").replace(/\/$/, "");
341
- return n === s;
359
+ const n = /^(https?:)?\/\//i, o = r.replace(n, "").replace(/\/$/, ""), s = t.replace(n, "").replace(/\/$/, "");
360
+ return o === s;
342
361
  }
343
362
  function createScript(r) {
344
- let t = null, o = !0, n = 2e4, s;
345
- const l = document.getElementsByTagName("script");
346
- for (let i = 0; i < l.length; i++) {
347
- const c = l[i], u = c.getAttribute("src");
363
+ let t = null, n = !0, o = 2e4, s;
364
+ const a = document.getElementsByTagName("script");
365
+ for (let i = 0; i < a.length; i++) {
366
+ const c = a[i], u = c.getAttribute("src");
348
367
  if (u && isStaticResourcesEqual(u, r.url)) {
349
- t = c, o = !1;
368
+ t = c, n = !1;
350
369
  break;
351
370
  }
352
371
  }
@@ -354,94 +373,94 @@ function createScript(r) {
354
373
  const i = r.attrs;
355
374
  t = document.createElement("script"), t.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
356
375
  let c;
357
- r.createScriptHook && (c = r.createScriptHook(r.url, r.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (n = c.timeout))), t.src || (t.src = r.url), i && !c && Object.keys(i).forEach((u) => {
376
+ r.createScriptHook && (c = r.createScriptHook(r.url, r.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (o = c.timeout))), t.src || (t.src = r.url), i && !c && Object.keys(i).forEach((u) => {
358
377
  t && (u === "async" || u === "defer" ? t[u] = i[u] : t.getAttribute(u) || t.setAttribute(u, i[u]));
359
378
  });
360
379
  }
361
- const a = async (i, c) => {
380
+ const l = async (i, c) => {
362
381
  var u;
363
382
  if (clearTimeout(s), t && (t.onerror = null, t.onload = null, safeWrapper(() => {
364
- const { needDeleteScript: m = !0 } = r;
365
- m && t != null && t.parentNode && t.parentNode.removeChild(t);
383
+ const { needDeleteScript: d = !0 } = r;
384
+ d && t != null && t.parentNode && t.parentNode.removeChild(t);
366
385
  }), i && typeof i == "function")) {
367
- var d;
368
- const m = i(c);
369
- if (m instanceof Promise) {
386
+ var m;
387
+ const d = i(c);
388
+ if (d instanceof Promise) {
370
389
  var p;
371
- const y = await m;
390
+ const y = await d;
372
391
  return r == null || (p = r.cb) == null || p.call(r), y;
373
392
  }
374
- return r == null || (d = r.cb) == null || d.call(r), m;
393
+ return r == null || (m = r.cb) == null || m.call(r), d;
375
394
  }
376
395
  r == null || (u = r.cb) == null || u.call(r);
377
396
  };
378
- return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), s = setTimeout(() => {
379
- a(null, new Error(`Remote script "${r.url}" time-outed.`));
380
- }, n), {
397
+ return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), s = setTimeout(() => {
398
+ l(null, new Error(`Remote script "${r.url}" time-outed.`));
399
+ }, o), {
381
400
  script: t,
382
- needAttach: o
401
+ needAttach: n
383
402
  };
384
403
  }
385
404
  function createLink(r) {
386
- let t = null, o = !0;
387
- const n = document.getElementsByTagName("link");
388
- for (let l = 0; l < n.length; l++) {
389
- const a = n[l], i = a.getAttribute("href"), c = a.getAttribute("ref");
405
+ let t = null, n = !0;
406
+ const o = document.getElementsByTagName("link");
407
+ for (let a = 0; a < o.length; a++) {
408
+ const l = o[a], i = l.getAttribute("href"), c = l.getAttribute("ref");
390
409
  if (i && isStaticResourcesEqual(i, r.url) && c === r.attrs.ref) {
391
- t = a, o = !1;
410
+ t = l, n = !1;
392
411
  break;
393
412
  }
394
413
  }
395
414
  if (!t) {
396
415
  t = document.createElement("link"), t.setAttribute("href", r.url);
397
- let l;
398
- const a = r.attrs;
399
- r.createLinkHook && (l = r.createLinkHook(r.url, a), l instanceof HTMLLinkElement && (t = l)), a && !l && Object.keys(a).forEach((i) => {
400
- t && !t.getAttribute(i) && t.setAttribute(i, a[i]);
416
+ let a;
417
+ const l = r.attrs;
418
+ r.createLinkHook && (a = r.createLinkHook(r.url, l), a instanceof HTMLLinkElement && (t = a)), l && !a && Object.keys(l).forEach((i) => {
419
+ t && !t.getAttribute(i) && t.setAttribute(i, l[i]);
401
420
  });
402
421
  }
403
- const s = (l, a) => {
422
+ const s = (a, l) => {
404
423
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
405
424
  const { needDeleteLink: i = !0 } = r;
406
425
  i && t != null && t.parentNode && t.parentNode.removeChild(t);
407
- }), l)) {
408
- const i = l(a);
426
+ }), a)) {
427
+ const i = a(l);
409
428
  return r.cb(), i;
410
429
  }
411
430
  r.cb();
412
431
  };
413
432
  return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
414
433
  link: t,
415
- needAttach: o
434
+ needAttach: n
416
435
  };
417
436
  }
418
437
  function loadScript(r, t) {
419
- const { attrs: o = {}, createScriptHook: n } = t;
420
- return new Promise((s, l) => {
421
- const { script: a, needAttach: i } = createScript({
438
+ const { attrs: n = {}, createScriptHook: o } = t;
439
+ return new Promise((s, a) => {
440
+ const { script: l, needAttach: i } = createScript({
422
441
  url: r,
423
442
  cb: s,
424
443
  attrs: _extends$2({
425
444
  fetchpriority: "high"
426
- }, o),
427
- createScriptHook: n,
445
+ }, n),
446
+ createScriptHook: o,
428
447
  needDeleteScript: !0
429
448
  });
430
- i && document.head.appendChild(a);
449
+ i && document.head.appendChild(l);
431
450
  });
432
451
  }
433
452
  function importNodeModule(r) {
434
453
  if (!r)
435
454
  throw new Error("import specifier is required");
436
- return new Function("name", "return import(name)")(r).then((o) => o).catch((o) => {
437
- throw console.error(`Error importing module ${r}:`, o), o;
455
+ return new Function("name", "return import(name)")(r).then((n) => n).catch((n) => {
456
+ throw console.error(`Error importing module ${r}:`, n), n;
438
457
  });
439
458
  }
440
459
  const loadNodeFetch = async () => {
441
460
  const r = await importNodeModule("node-fetch");
442
461
  return r.default || r;
443
- }, lazyLoaderHookFetch = async (r, t, o) => {
444
- const s = await ((l, a) => o.lifecycle.fetch.emit(l, a))(r, t || {});
462
+ }, lazyLoaderHookFetch = async (r, t, n) => {
463
+ const s = await ((a, l) => n.lifecycle.fetch.emit(a, l))(r, t || {});
445
464
  return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(r, t || {}) : s;
446
465
  };
447
466
  function createScriptNode(url, cb, attrs, loaderHook) {
@@ -502,38 +521,38 @@ function createScriptNode(url, cb, attrs, loaderHook) {
502
521
  });
503
522
  }
504
523
  function loadScriptNode(r, t) {
505
- return new Promise((o, n) => {
506
- createScriptNode(r, (s, l) => {
524
+ return new Promise((n, o) => {
525
+ createScriptNode(r, (s, a) => {
507
526
  if (s)
508
- n(s);
527
+ o(s);
509
528
  else {
510
- var a, i;
511
- const c = (t == null || (a = t.attrs) == null ? void 0 : a.globalName) || `__FEDERATION_${t == null || (i = t.attrs) == null ? void 0 : i.name}:custom__`, u = globalThis[c] = l;
512
- o(u);
529
+ var l, i;
530
+ const c = (t == null || (l = t.attrs) == null ? void 0 : l.globalName) || `__FEDERATION_${t == null || (i = t.attrs) == null ? void 0 : i.name}:custom__`, u = globalThis[c] = a;
531
+ n(u);
513
532
  }
514
533
  }, t.attrs, t.loaderHook);
515
534
  });
516
535
  }
517
536
  async function loadModule(r, t) {
518
- const { fetch: o, vm: n } = t, l = await (await o(r)).text(), a = new n.SourceTextModule(l, {
537
+ const { fetch: n, vm: o } = t, a = await (await n(r)).text(), l = new o.SourceTextModule(a, {
519
538
  // @ts-ignore
520
539
  importModuleDynamically: async (i, c) => {
521
540
  const u = new URL(i, r).href;
522
541
  return loadModule(u, t);
523
542
  }
524
543
  });
525
- return await a.link(async (i) => {
544
+ return await l.link(async (i) => {
526
545
  const c = new URL(i, r).href;
527
546
  return await loadModule(c, t);
528
- }), a;
547
+ }), l;
529
548
  }
530
549
  const LoggerInstance = createLogger("[ Module Federation Bridge Vue3 ]");
531
550
  function _extends$1() {
532
551
  return _extends$1 = Object.assign || function(t) {
533
- for (var o = 1; o < arguments.length; o++) {
534
- var n = arguments[o];
535
- for (var s in n)
536
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
552
+ for (var n = 1; n < arguments.length; n++) {
553
+ var o = arguments[n];
554
+ for (var s in o)
555
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
537
556
  }
538
557
  return t;
539
558
  }, _extends$1.apply(this, arguments);
@@ -541,10 +560,10 @@ function _extends$1() {
541
560
  function _object_without_properties_loose(r, t) {
542
561
  if (r == null)
543
562
  return {};
544
- var o = {}, n = Object.keys(r), s, l;
545
- for (l = 0; l < n.length; l++)
546
- s = n[l], !(t.indexOf(s) >= 0) && (o[s] = r[s]);
547
- return o;
563
+ var n = {}, o = Object.keys(r), s, a;
564
+ for (a = 0; a < o.length; a++)
565
+ s = o[a], !(t.indexOf(s) >= 0) && (n[s] = r[s]);
566
+ return n;
548
567
  }
549
568
  function getBuilderId() {
550
569
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
@@ -560,7 +579,7 @@ function warn(r) {
560
579
  r instanceof Error && (r.message = `${LOG_CATEGORY}: ${r.message}`), logger.warn(r);
561
580
  }
562
581
  function addUniqueItem(r, t) {
563
- return r.findIndex((o) => o === t) === -1 && r.push(t), r;
582
+ return r.findIndex((n) => n === t) === -1 && r.push(t), r;
564
583
  }
565
584
  function getFMId(r) {
566
585
  return "version" in r && r.version ? `${r.name}:${r.version}` : "entry" in r && r.entry ? `${r.name}:${r.entry}` : `${r.name}`;
@@ -600,8 +619,8 @@ function getRemoteEntryInfoFromSnapshot(r) {
600
619
  } : t;
601
620
  }
602
621
  const processModuleAlias = (r, t) => {
603
- let o;
604
- return r.endsWith("/") ? o = r.slice(0, -1) : o = r, t.startsWith(".") && (t = t.slice(1)), o = o + t, o;
622
+ let n;
623
+ return r.endsWith("/") ? n = r.slice(0, -1) : n = r, t.startsWith(".") && (t = t.slice(1)), n = n + t, n;
605
624
  }, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
606
625
  try {
607
626
  return document.defaultView;
@@ -609,9 +628,9 @@ const processModuleAlias = (r, t) => {
609
628
  return CurrentGlobal;
610
629
  }
611
630
  })(), Global = nativeGlobal;
612
- function definePropertyGlobalVal(r, t, o) {
631
+ function definePropertyGlobalVal(r, t, n) {
613
632
  Object.defineProperty(r, t, {
614
- value: o,
633
+ value: n,
615
634
  configurable: !1,
616
635
  writable: !0
617
636
  });
@@ -622,7 +641,7 @@ function includeOwnProperty(r, t) {
622
641
  includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
623
642
  const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
624
643
  function setGlobalDefaultVal(r) {
625
- var t, o, n, s, l, a;
644
+ var t, n, o, s, a, l;
626
645
  includeOwnProperty(r, "__VMOK__") && !includeOwnProperty(r, "__FEDERATION__") && definePropertyGlobalVal(r, "__FEDERATION__", r.__VMOK__), includeOwnProperty(r, "__FEDERATION__") || (definePropertyGlobalVal(r, "__FEDERATION__", {
627
646
  __GLOBAL_PLUGIN__: [],
628
647
  __INSTANCES__: [],
@@ -634,20 +653,20 @@ function setGlobalDefaultVal(r) {
634
653
  var i;
635
654
  (i = (t = r.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
636
655
  var c;
637
- (c = (o = r.__FEDERATION__).__INSTANCES__) != null || (o.__INSTANCES__ = []);
656
+ (c = (n = r.__FEDERATION__).__INSTANCES__) != null || (n.__INSTANCES__ = []);
638
657
  var u;
639
- (u = (n = r.__FEDERATION__).moduleInfo) != null || (n.moduleInfo = {});
640
- var d;
641
- (d = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
642
- var p;
643
- (p = (l = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (l.__MANIFEST_LOADING__ = {});
658
+ (u = (o = r.__FEDERATION__).moduleInfo) != null || (o.moduleInfo = {});
644
659
  var m;
645
- (m = (a = r.__FEDERATION__).__PRELOADED_MAP__) != null || (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
660
+ (m = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
661
+ var p;
662
+ (p = (a = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
663
+ var d;
664
+ (d = (l = r.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
646
665
  }
647
666
  setGlobalDefaultVal(CurrentGlobal);
648
667
  setGlobalDefaultVal(nativeGlobal);
649
668
  function setGlobalFederationConstructor(r, t = isDebugMode()) {
650
- t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.8.4");
669
+ t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.8.6");
651
670
  }
652
671
  function getInfoWithoutType(r, t) {
653
672
  if (typeof t == "string") {
@@ -657,9 +676,9 @@ function getInfoWithoutType(r, t) {
657
676
  key: t
658
677
  };
659
678
  {
660
- const n = Object.keys(r);
661
- for (const s of n) {
662
- const [l, a] = s.split(":"), i = `${l}:${t}`, c = r[i];
679
+ const o = Object.keys(r);
680
+ for (const s of o) {
681
+ const [a, l] = s.split(":"), i = `${a}:${t}`, c = r[i];
663
682
  if (c)
664
683
  return {
665
684
  value: c,
@@ -675,28 +694,28 @@ function getInfoWithoutType(r, t) {
675
694
  throw new Error("key must be string");
676
695
  }
677
696
  const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (r, t) => {
678
- const o = getFMId(r), n = getInfoWithoutType(t, o).value;
679
- if (n && !n.version && "version" in r && r.version && (n.version = r.version), n)
680
- return n;
697
+ const n = getFMId(r), o = getInfoWithoutType(t, n).value;
698
+ if (o && !o.version && "version" in r && r.version && (o.version = r.version), o)
699
+ return o;
681
700
  if ("version" in r && r.version) {
682
- const { version: s } = r, l = _object_without_properties_loose(r, [
701
+ const { version: s } = r, a = _object_without_properties_loose(r, [
683
702
  "version"
684
- ]), a = getFMId(l), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, a).value;
703
+ ]), l = getFMId(a), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, l).value;
685
704
  if ((i == null ? void 0 : i.version) === s)
686
705
  return i;
687
706
  }
688
707
  }, getGlobalSnapshotInfoByModuleInfo = (r) => getTargetSnapshotInfoByModuleInfo(r, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (r, t) => {
689
- const o = getFMId(r);
690
- return nativeGlobal.__FEDERATION__.moduleInfo[o] = t, nativeGlobal.__FEDERATION__.moduleInfo;
708
+ const n = getFMId(r);
709
+ return nativeGlobal.__FEDERATION__.moduleInfo[n] = t, nativeGlobal.__FEDERATION__.moduleInfo;
691
710
  }, addGlobalSnapshot = (r) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, r), () => {
692
711
  const t = Object.keys(r);
693
- for (const o of t)
694
- delete nativeGlobal.__FEDERATION__.moduleInfo[o];
712
+ for (const n of t)
713
+ delete nativeGlobal.__FEDERATION__.moduleInfo[n];
695
714
  }), getRemoteEntryExports = (r, t) => {
696
- const o = t || `__FEDERATION_${r}:custom__`, n = CurrentGlobal[o];
715
+ const n = t || `__FEDERATION_${r}:custom__`, o = CurrentGlobal[n];
697
716
  return {
698
- remoteEntryKey: o,
699
- entryExports: n
717
+ remoteEntryKey: n,
718
+ entryExports: o
700
719
  };
701
720
  }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(r), setPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(r, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
702
721
  function parseRegex(r) {
@@ -706,17 +725,17 @@ function isXVersion(r) {
706
725
  return !r || r.toLowerCase() === "x" || r === "*";
707
726
  }
708
727
  function pipe(...r) {
709
- return (t) => r.reduce((o, n) => n(o), t);
728
+ return (t) => r.reduce((n, o) => o(n), t);
710
729
  }
711
730
  function extractComparator(r) {
712
731
  return r.match(parseRegex(comparator));
713
732
  }
714
- function combineVersion(r, t, o, n) {
715
- const s = `${r}.${t}.${o}`;
716
- return n ? `${s}-${n}` : s;
733
+ function combineVersion(r, t, n, o) {
734
+ const s = `${r}.${t}.${n}`;
735
+ return o ? `${s}-${o}` : s;
717
736
  }
718
737
  function parseHyphen(r) {
719
- return r.replace(parseRegex(hyphenRange), (t, o, n, s, l, a, i, c, u, d, p, m) => (isXVersion(n) ? o = "" : isXVersion(s) ? o = `>=${n}.0.0` : isXVersion(l) ? o = `>=${n}.${s}.0` : o = `>=${o}`, isXVersion(u) ? c = "" : isXVersion(d) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(d) + 1}.0-0` : m ? c = `<=${u}.${d}.${p}-${m}` : c = `<=${c}`, `${o} ${c}`.trim()));
738
+ return r.replace(parseRegex(hyphenRange), (t, n, o, s, a, l, i, c, u, m, p, d) => (isXVersion(o) ? n = "" : isXVersion(s) ? n = `>=${o}.0.0` : isXVersion(a) ? n = `>=${o}.${s}.0` : n = `>=${n}`, isXVersion(u) ? c = "" : isXVersion(m) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(m) + 1}.0-0` : d ? c = `<=${u}.${m}.${p}-${d}` : c = `<=${c}`, `${n} ${c}`.trim()));
720
739
  }
721
740
  function parseComparatorTrim(r) {
722
741
  return r.replace(parseRegex(comparatorTrim), "$1$2$3");
@@ -728,15 +747,15 @@ function parseCaretTrim(r) {
728
747
  return r.replace(parseRegex(caretTrim), "$1^");
729
748
  }
730
749
  function parseCarets(r) {
731
- return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (o, n, s, l, a) => isXVersion(n) ? "" : isXVersion(s) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(l) ? n === "0" ? `>=${n}.${s}.0 <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.0 <${Number(n) + 1}.0.0-0` : a ? n === "0" ? s === "0" ? `>=${n}.${s}.${l}-${a} <${n}.${s}.${Number(l) + 1}-0` : `>=${n}.${s}.${l}-${a} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l}-${a} <${Number(n) + 1}.0.0-0` : n === "0" ? s === "0" ? `>=${n}.${s}.${l} <${n}.${s}.${Number(l) + 1}-0` : `>=${n}.${s}.${l} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l} <${Number(n) + 1}.0.0-0`)).join(" ");
750
+ return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (n, o, s, a, l) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(a) ? o === "0" ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.0 <${Number(o) + 1}.0.0-0` : l ? o === "0" ? s === "0" ? `>=${o}.${s}.${a}-${l} <${o}.${s}.${Number(a) + 1}-0` : `>=${o}.${s}.${a}-${l} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${a}-${l} <${Number(o) + 1}.0.0-0` : o === "0" ? s === "0" ? `>=${o}.${s}.${a} <${o}.${s}.${Number(a) + 1}-0` : `>=${o}.${s}.${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${a} <${Number(o) + 1}.0.0-0`)).join(" ");
732
751
  }
733
752
  function parseTildes(r) {
734
- return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (o, n, s, l, a) => isXVersion(n) ? "" : isXVersion(s) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(l) ? `>=${n}.${s}.0 <${n}.${Number(s) + 1}.0-0` : a ? `>=${n}.${s}.${l}-${a} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l} <${n}.${Number(s) + 1}.0-0`)).join(" ");
753
+ return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (n, o, s, a, l) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(a) ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : l ? `>=${o}.${s}.${a}-${l} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${a} <${o}.${Number(s) + 1}.0-0`)).join(" ");
735
754
  }
736
755
  function parseXRanges(r) {
737
- return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (o, n, s, l, a, i) => {
738
- const c = isXVersion(s), u = c || isXVersion(l), d = u || isXVersion(a);
739
- return n === "=" && d && (n = ""), i = "", c ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && d ? (u && (l = 0), a = 0, n === ">" ? (n = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : n === "<=" && (n = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), n === "<" && (i = "-0"), `${n + s}.${l}.${a}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${l}.0${i} <${s}.${Number(l) + 1}.0-0` : o;
756
+ return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (n, o, s, a, l, i) => {
757
+ const c = isXVersion(s), u = c || isXVersion(a), m = u || isXVersion(l);
758
+ return o === "=" && m && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && m ? (u && (a = 0), l = 0, o === ">" ? (o = ">=", u ? (s = Number(s) + 1, a = 0, l = 0) : (a = Number(a) + 1, l = 0)) : o === "<=" && (o = "<", u ? s = Number(s) + 1 : a = Number(a) + 1), o === "<" && (i = "-0"), `${o + s}.${a}.${l}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : m ? `>=${s}.${a}.0${i} <${s}.${Number(a) + 1}.0-0` : n;
740
759
  })).join(" ");
741
760
  }
742
761
  function parseStar(r) {
@@ -749,17 +768,17 @@ function compareAtom(r, t) {
749
768
  return r = Number(r) || r, t = Number(t) || t, r > t ? 1 : r === t ? 0 : -1;
750
769
  }
751
770
  function comparePreRelease(r, t) {
752
- const { preRelease: o } = r, { preRelease: n } = t;
753
- if (o === void 0 && n)
771
+ const { preRelease: n } = r, { preRelease: o } = t;
772
+ if (n === void 0 && o)
754
773
  return 1;
755
- if (o && n === void 0)
774
+ if (n && o === void 0)
756
775
  return -1;
757
- if (o === void 0 && n === void 0)
776
+ if (n === void 0 && o === void 0)
758
777
  return 0;
759
- for (let s = 0, l = o.length; s <= l; s++) {
760
- const a = o[s], i = n[s];
761
- if (a !== i)
762
- return a === void 0 && i === void 0 ? 0 : a ? i ? compareAtom(a, i) : -1 : 1;
778
+ for (let s = 0, a = n.length; s <= a; s++) {
779
+ const l = n[s], i = o[s];
780
+ if (l !== i)
781
+ return l === void 0 && i === void 0 ? 0 : l ? i ? compareAtom(l, i) : -1 : 1;
763
782
  }
764
783
  return 0;
765
784
  }
@@ -829,40 +848,40 @@ function parseRange(r) {
829
848
  function satisfy(r, t) {
830
849
  if (!r)
831
850
  return !1;
832
- const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), l = extractComparator(r);
833
- if (!l)
851
+ const s = parseRange(t).split(" ").map((d) => parseComparatorString(d)).join(" ").split(/\s+/).map((d) => parseGTE0(d)), a = extractComparator(r);
852
+ if (!a)
834
853
  return !1;
835
- const [, a, , i, c, u, d] = l, p = {
836
- operator: a,
837
- version: combineVersion(i, c, u, d),
854
+ const [, l, , i, c, u, m] = a, p = {
855
+ operator: l,
856
+ version: combineVersion(i, c, u, m),
838
857
  major: i,
839
858
  minor: c,
840
859
  patch: u,
841
- preRelease: d == null ? void 0 : d.split(".")
860
+ preRelease: m == null ? void 0 : m.split(".")
842
861
  };
843
- for (const m of s) {
844
- const y = extractComparator(m);
862
+ for (const d of s) {
863
+ const y = extractComparator(d);
845
864
  if (!y)
846
865
  return !1;
847
- const [, _, , R, g, E, I] = y, v = {
866
+ const [, _, , E, g, b, S] = y, I = {
848
867
  operator: _,
849
- version: combineVersion(R, g, E, I),
850
- major: R,
868
+ version: combineVersion(E, g, b, S),
869
+ major: E,
851
870
  minor: g,
852
- patch: E,
853
- preRelease: I == null ? void 0 : I.split(".")
871
+ patch: b,
872
+ preRelease: S == null ? void 0 : S.split(".")
854
873
  };
855
- if (!compare(v, p))
874
+ if (!compare(I, p))
856
875
  return !1;
857
876
  }
858
877
  return !0;
859
878
  }
860
- function formatShare(r, t, o, n) {
879
+ function formatShare(r, t, n, o) {
861
880
  let s;
862
881
  "get" in r ? s = r.get : "lib" in r ? s = () => Promise.resolve(r.lib) : s = () => Promise.resolve(() => {
863
- throw new Error(`Can not get shared '${o}'!`);
882
+ throw new Error(`Can not get shared '${n}'!`);
864
883
  }), r.strategy && warn('"shared.strategy is deprecated, please set in initOptions.shareStrategy instead!"');
865
- var l, a, i;
884
+ var a, l, i;
866
885
  return _extends$1({
867
886
  deps: [],
868
887
  useIn: [],
@@ -877,84 +896,84 @@ function formatShare(r, t, o, n) {
877
896
  }, r.shareConfig),
878
897
  get: s,
879
898
  loaded: r != null && r.loaded || "lib" in r ? !0 : void 0,
880
- version: (l = r.version) != null ? l : "0",
899
+ version: (a = r.version) != null ? a : "0",
881
900
  scope: Array.isArray(r.scope) ? r.scope : [
882
- (a = r.scope) != null ? a : "default"
901
+ (l = r.scope) != null ? l : "default"
883
902
  ],
884
- strategy: ((i = r.strategy) != null ? i : n) || "version-first"
903
+ strategy: ((i = r.strategy) != null ? i : o) || "version-first"
885
904
  });
886
905
  }
887
906
  function formatShareConfigs(r, t) {
888
- const o = t.shared || {}, n = t.name, s = Object.keys(o).reduce((a, i) => {
889
- const c = arrayOptions(o[i]);
890
- return a[i] = a[i] || [], c.forEach((u) => {
891
- a[i].push(formatShare(u, n, i, t.shareStrategy));
892
- }), a;
893
- }, {}), l = _extends$1({}, r.shared);
894
- return Object.keys(s).forEach((a) => {
895
- l[a] ? s[a].forEach((i) => {
896
- l[a].find((u) => u.version === i.version) || l[a].push(i);
897
- }) : l[a] = s[a];
907
+ const n = t.shared || {}, o = t.name, s = Object.keys(n).reduce((l, i) => {
908
+ const c = arrayOptions(n[i]);
909
+ return l[i] = l[i] || [], c.forEach((u) => {
910
+ l[i].push(formatShare(u, o, i, t.shareStrategy));
911
+ }), l;
912
+ }, {}), a = _extends$1({}, r.shared);
913
+ return Object.keys(s).forEach((l) => {
914
+ a[l] ? s[l].forEach((i) => {
915
+ a[l].find((u) => u.version === i.version) || a[l].push(i);
916
+ }) : a[l] = s[l];
898
917
  }), {
899
- shared: l,
918
+ shared: a,
900
919
  shareInfos: s
901
920
  };
902
921
  }
903
922
  function versionLt(r, t) {
904
- const o = (n) => {
905
- if (!Number.isNaN(Number(n))) {
906
- const l = n.split(".");
907
- let a = n;
908
- for (let i = 0; i < 3 - l.length; i++)
909
- a += ".0";
910
- return a;
923
+ const n = (o) => {
924
+ if (!Number.isNaN(Number(o))) {
925
+ const a = o.split(".");
926
+ let l = o;
927
+ for (let i = 0; i < 3 - a.length; i++)
928
+ l += ".0";
929
+ return l;
911
930
  }
912
- return n;
931
+ return o;
913
932
  };
914
- return !!satisfy(o(r), `<=${o(t)}`);
933
+ return !!satisfy(n(r), `<=${n(t)}`);
915
934
  }
916
935
  const findVersion = (r, t) => {
917
- const o = t || function(n, s) {
918
- return versionLt(n, s);
936
+ const n = t || function(o, s) {
937
+ return versionLt(o, s);
919
938
  };
920
- return Object.keys(r).reduce((n, s) => !n || o(n, s) || n === "0" ? s : n, 0);
939
+ return Object.keys(r).reduce((o, s) => !o || n(o, s) || o === "0" ? s : o, 0);
921
940
  }, isLoaded = (r) => !!r.loaded || typeof r.lib == "function", isLoading = (r) => !!r.loading;
922
- function findSingletonVersionOrderByVersion(r, t, o) {
923
- const n = r[t][o], s = function(l, a) {
924
- return !isLoaded(n[l]) && versionLt(l, a);
941
+ function findSingletonVersionOrderByVersion(r, t, n) {
942
+ const o = r[t][n], s = function(a, l) {
943
+ return !isLoaded(o[a]) && versionLt(a, l);
925
944
  };
926
- return findVersion(r[t][o], s);
945
+ return findVersion(r[t][n], s);
927
946
  }
928
- function findSingletonVersionOrderByLoaded(r, t, o) {
929
- const n = r[t][o], s = function(l, a) {
947
+ function findSingletonVersionOrderByLoaded(r, t, n) {
948
+ const o = r[t][n], s = function(a, l) {
930
949
  const i = (c) => isLoaded(c) || isLoading(c);
931
- return i(n[a]) ? i(n[l]) ? !!versionLt(l, a) : !0 : i(n[l]) ? !1 : versionLt(l, a);
950
+ return i(o[l]) ? i(o[a]) ? !!versionLt(a, l) : !0 : i(o[a]) ? !1 : versionLt(a, l);
932
951
  };
933
- return findVersion(r[t][o], s);
952
+ return findVersion(r[t][n], s);
934
953
  }
935
954
  function getFindShareFunction(r) {
936
955
  return r === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
937
956
  }
938
- function getRegisteredShare(r, t, o, n) {
957
+ function getRegisteredShare(r, t, n, o) {
939
958
  if (!r)
940
959
  return;
941
- const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } = o, i = Array.isArray(l) ? l : [
942
- l
960
+ const { shareConfig: s, scope: a = DEFAULT_SCOPE, strategy: l } = n, i = Array.isArray(a) ? a : [
961
+ a
943
962
  ];
944
963
  for (const c of i)
945
964
  if (s && r[c] && r[c][t]) {
946
- const { requiredVersion: u } = s, p = getFindShareFunction(a)(r, c, t), m = () => {
965
+ const { requiredVersion: u } = s, p = getFindShareFunction(l)(r, c, t), d = () => {
947
966
  if (s.singleton) {
948
967
  if (typeof u == "string" && !satisfy(p, u)) {
949
- const R = `Version ${p} from ${p && r[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;
950
- s.strictVersion ? error(R) : warn(R);
968
+ const E = `Version ${p} from ${p && r[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${u})`;
969
+ s.strictVersion ? error(E) : warn(E);
951
970
  }
952
971
  return r[c][t][p];
953
972
  } else {
954
973
  if (u === !1 || u === "*" || satisfy(p, u))
955
974
  return r[c][t][p];
956
- for (const [R, g] of Object.entries(r[c][t]))
957
- if (satisfy(R, u))
975
+ for (const [E, g] of Object.entries(r[c][t]))
976
+ if (satisfy(E, u))
958
977
  return g;
959
978
  }
960
979
  }, y = {
@@ -963,47 +982,47 @@ function getRegisteredShare(r, t, o, n) {
963
982
  pkgName: t,
964
983
  version: p,
965
984
  GlobalFederation: Global.__FEDERATION__,
966
- resolver: m
985
+ resolver: d
967
986
  };
968
- return (n.emit(y) || y).resolver();
987
+ return (o.emit(y) || y).resolver();
969
988
  }
970
989
  }
971
990
  function getGlobalShareScope() {
972
991
  return Global.__FEDERATION__.__SHARE__;
973
992
  }
974
993
  function getTargetSharedOptions(r) {
975
- const { pkgName: t, extraOptions: o, shareInfos: n } = r, s = (i) => {
994
+ const { pkgName: t, extraOptions: n, shareInfos: o } = r, s = (i) => {
976
995
  if (!i)
977
996
  return;
978
997
  const c = {};
979
998
  i.forEach((p) => {
980
999
  c[p.version] = p;
981
1000
  });
982
- const d = findVersion(c, function(p, m) {
983
- return !isLoaded(c[p]) && versionLt(p, m);
1001
+ const m = findVersion(c, function(p, d) {
1002
+ return !isLoaded(c[p]) && versionLt(p, d);
984
1003
  });
985
- return c[d];
1004
+ return c[m];
986
1005
  };
987
- var l;
988
- const a = (l = o == null ? void 0 : o.resolver) != null ? l : s;
989
- return Object.assign({}, a(n[t]), o == null ? void 0 : o.customShareInfo);
1006
+ var a;
1007
+ const l = (a = n == null ? void 0 : n.resolver) != null ? a : s;
1008
+ return Object.assign({}, l(o[t]), n == null ? void 0 : n.customShareInfo);
990
1009
  }
991
- const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", TYPE_001 = "TYPE-001", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, o, n) => {
1010
+ const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", TYPE_001 = "TYPE-001", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, n, o) => {
992
1011
  const s = [
993
1012
  `${[
994
1013
  t[r]
995
1014
  ]} #${r}`
996
1015
  ];
997
- return o && s.push(`args: ${JSON.stringify(o)}`), s.push(getDocsUrl(r)), n && s.push(`Original Error Message:
998
- ${n}`), s.join(`
1016
+ return n && s.push(`args: ${JSON.stringify(n)}`), s.push(getDocsUrl(r)), o && s.push(`Original Error Message:
1017
+ ${o}`), s.join(`
999
1018
  `);
1000
1019
  };
1001
1020
  function _extends() {
1002
1021
  return _extends = Object.assign || function(t) {
1003
- for (var o = 1; o < arguments.length; o++) {
1004
- var n = arguments[o];
1005
- for (var s in n)
1006
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
1022
+ for (var n = 1; n < arguments.length; n++) {
1023
+ var o = arguments[n];
1024
+ for (var s in o)
1025
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
1007
1026
  }
1008
1027
  return t;
1009
1028
  }, _extends.apply(this, arguments);
@@ -1021,139 +1040,139 @@ const runtimeDescMap = {
1021
1040
  };
1022
1041
  _extends({}, runtimeDescMap, typeDescMap);
1023
1042
  function matchRemoteWithNameAndExpose(r, t) {
1024
- for (const o of r) {
1025
- const n = t.startsWith(o.name);
1026
- let s = t.replace(o.name, "");
1027
- if (n) {
1043
+ for (const n of r) {
1044
+ const o = t.startsWith(n.name);
1045
+ let s = t.replace(n.name, "");
1046
+ if (o) {
1028
1047
  if (s.startsWith("/")) {
1029
- const i = o.name;
1048
+ const i = n.name;
1030
1049
  return s = `.${s}`, {
1031
1050
  pkgNameOrAlias: i,
1032
1051
  expose: s,
1033
- remote: o
1052
+ remote: n
1034
1053
  };
1035
1054
  } else if (s === "")
1036
1055
  return {
1037
- pkgNameOrAlias: o.name,
1056
+ pkgNameOrAlias: n.name,
1038
1057
  expose: ".",
1039
- remote: o
1058
+ remote: n
1040
1059
  };
1041
1060
  }
1042
- const l = o.alias && t.startsWith(o.alias);
1043
- let a = o.alias && t.replace(o.alias, "");
1044
- if (o.alias && l) {
1045
- if (a && a.startsWith("/")) {
1046
- const i = o.alias;
1047
- return a = `.${a}`, {
1061
+ const a = n.alias && t.startsWith(n.alias);
1062
+ let l = n.alias && t.replace(n.alias, "");
1063
+ if (n.alias && a) {
1064
+ if (l && l.startsWith("/")) {
1065
+ const i = n.alias;
1066
+ return l = `.${l}`, {
1048
1067
  pkgNameOrAlias: i,
1049
- expose: a,
1050
- remote: o
1068
+ expose: l,
1069
+ remote: n
1051
1070
  };
1052
- } else if (a === "")
1071
+ } else if (l === "")
1053
1072
  return {
1054
- pkgNameOrAlias: o.alias,
1073
+ pkgNameOrAlias: n.alias,
1055
1074
  expose: ".",
1056
- remote: o
1075
+ remote: n
1057
1076
  };
1058
1077
  }
1059
1078
  }
1060
1079
  }
1061
1080
  function matchRemote(r, t) {
1062
- for (const o of r)
1063
- if (t === o.name || o.alias && t === o.alias)
1064
- return o;
1081
+ for (const n of r)
1082
+ if (t === n.name || n.alias && t === n.alias)
1083
+ return n;
1065
1084
  }
1066
1085
  function registerPlugins$1(r, t) {
1067
- const o = getGlobalHostPlugins();
1068
- return o.length > 0 && o.forEach((n) => {
1069
- r != null && r.find((s) => s.name !== n.name) && r.push(n);
1070
- }), r && r.length > 0 && r.forEach((n) => {
1086
+ const n = getGlobalHostPlugins();
1087
+ return n.length > 0 && n.forEach((o) => {
1088
+ r != null && r.find((s) => s.name !== o.name) && r.push(o);
1089
+ }), r && r.length > 0 && r.forEach((o) => {
1071
1090
  t.forEach((s) => {
1072
- s.applyPlugin(n);
1091
+ s.applyPlugin(o);
1073
1092
  });
1074
1093
  }), r;
1075
1094
  }
1076
1095
  async function loadEsmEntry({ entry: r, remoteEntryExports: t }) {
1077
- return new Promise((o, n) => {
1096
+ return new Promise((n, o) => {
1078
1097
  try {
1079
- t ? o(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1080
- o,
1081
- n
1098
+ t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1099
+ n,
1100
+ o
1082
1101
  ]) : import(
1083
1102
  /* webpackIgnore: true */
1084
1103
  /* @vite-ignore */
1085
1104
  r
1086
- ).then(o).catch(n);
1105
+ ).then(n).catch(o);
1087
1106
  } catch (s) {
1088
- n(s);
1107
+ o(s);
1089
1108
  }
1090
1109
  });
1091
1110
  }
1092
1111
  async function loadSystemJsEntry({ entry: r, remoteEntryExports: t }) {
1093
- return new Promise((o, n) => {
1112
+ return new Promise((n, o) => {
1094
1113
  try {
1095
- t ? o(t) : typeof __system_context__ > "u" ? System.import(r).then(o).catch(n) : new Function("callbacks", `System.import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1096
- o,
1097
- n
1114
+ t ? n(t) : typeof __system_context__ > "u" ? System.import(r).then(n).catch(o) : new Function("callbacks", `System.import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1115
+ n,
1116
+ o
1098
1117
  ]);
1099
1118
  } catch (s) {
1100
- n(s);
1119
+ o(s);
1101
1120
  }
1102
1121
  });
1103
1122
  }
1104
- async function loadEntryScript({ name: r, globalName: t, entry: o, loaderHook: n }) {
1123
+ async function loadEntryScript({ name: r, globalName: t, entry: n, loaderHook: o }) {
1105
1124
  const { entryExports: s } = getRemoteEntryExports(r, t);
1106
- return s || loadScript(o, {
1125
+ return s || loadScript(n, {
1107
1126
  attrs: {},
1108
- createScriptHook: (l, a) => {
1109
- const i = n.lifecycle.createScript.emit({
1110
- url: l,
1111
- attrs: a
1127
+ createScriptHook: (a, l) => {
1128
+ const i = o.lifecycle.createScript.emit({
1129
+ url: a,
1130
+ attrs: l
1112
1131
  });
1113
1132
  if (i && (i instanceof HTMLScriptElement || "script" in i || "timeout" in i))
1114
1133
  return i;
1115
1134
  }
1116
1135
  }).then(() => {
1117
- const { remoteEntryKey: l, entryExports: a } = getRemoteEntryExports(r, t);
1118
- return assert(a, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
1136
+ const { remoteEntryKey: a, entryExports: l } = getRemoteEntryExports(r, t);
1137
+ return assert(l, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
1119
1138
  remoteName: r,
1120
- remoteEntryUrl: o,
1121
- remoteEntryKey: l
1122
- })), a;
1123
- }).catch((l) => {
1124
- throw l;
1139
+ remoteEntryUrl: n,
1140
+ remoteEntryKey: a
1141
+ })), l;
1142
+ }).catch((a) => {
1143
+ throw a;
1125
1144
  });
1126
1145
  }
1127
- async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: o }) {
1128
- const { entry: n, entryGlobalName: s, name: l, type: a } = r;
1129
- switch (a) {
1146
+ async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: n }) {
1147
+ const { entry: o, entryGlobalName: s, name: a, type: l } = r;
1148
+ switch (l) {
1130
1149
  case "esm":
1131
1150
  case "module":
1132
1151
  return loadEsmEntry({
1133
- entry: n,
1152
+ entry: o,
1134
1153
  remoteEntryExports: t
1135
1154
  });
1136
1155
  case "system":
1137
1156
  return loadSystemJsEntry({
1138
- entry: n,
1157
+ entry: o,
1139
1158
  remoteEntryExports: t
1140
1159
  });
1141
1160
  default:
1142
1161
  return loadEntryScript({
1143
- entry: n,
1162
+ entry: o,
1144
1163
  globalName: s,
1145
- name: l,
1146
- loaderHook: o
1164
+ name: a,
1165
+ loaderHook: n
1147
1166
  });
1148
1167
  }
1149
1168
  }
1150
1169
  async function loadEntryNode({ remoteInfo: r, loaderHook: t }) {
1151
- const { entry: o, entryGlobalName: n, name: s, type: l } = r, { entryExports: a } = getRemoteEntryExports(s, n);
1152
- return a || loadScriptNode(o, {
1170
+ const { entry: n, entryGlobalName: o, name: s, type: a } = r, { entryExports: l } = getRemoteEntryExports(s, o);
1171
+ return l || loadScriptNode(n, {
1153
1172
  attrs: {
1154
1173
  name: s,
1155
- globalName: n,
1156
- type: l
1174
+ globalName: o,
1175
+ type: a
1157
1176
  },
1158
1177
  loaderHook: {
1159
1178
  createScriptHook: (i, c = {}) => {
@@ -1166,10 +1185,10 @@ async function loadEntryNode({ remoteInfo: r, loaderHook: t }) {
1166
1185
  }
1167
1186
  }
1168
1187
  }).then(() => {
1169
- const { remoteEntryKey: i, entryExports: c } = getRemoteEntryExports(s, n);
1188
+ const { remoteEntryKey: i, entryExports: c } = getRemoteEntryExports(s, o);
1170
1189
  return assert(c, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
1171
1190
  remoteName: s,
1172
- remoteEntryUrl: o,
1191
+ remoteEntryUrl: n,
1173
1192
  remoteEntryKey: i
1174
1193
  })), c;
1175
1194
  }).catch((i) => {
@@ -1177,29 +1196,29 @@ async function loadEntryNode({ remoteInfo: r, loaderHook: t }) {
1177
1196
  });
1178
1197
  }
1179
1198
  function getRemoteEntryUniqueKey(r) {
1180
- const { entry: t, name: o } = r;
1181
- return composeKeyWithSeparator(o, t);
1199
+ const { entry: t, name: n } = r;
1200
+ return composeKeyWithSeparator(n, t);
1182
1201
  }
1183
- async function getRemoteEntry({ origin: r, remoteEntryExports: t, remoteInfo: o }) {
1184
- const n = getRemoteEntryUniqueKey(o);
1202
+ async function getRemoteEntry({ origin: r, remoteEntryExports: t, remoteInfo: n }) {
1203
+ const o = getRemoteEntryUniqueKey(n);
1185
1204
  if (t)
1186
1205
  return t;
1187
- if (!globalLoading[n]) {
1188
- const s = r.remoteHandler.hooks.lifecycle.loadEntry, l = r.loaderHook;
1189
- globalLoading[n] = s.emit({
1190
- loaderHook: l,
1191
- remoteInfo: o,
1206
+ if (!globalLoading[o]) {
1207
+ const s = r.remoteHandler.hooks.lifecycle.loadEntry, a = r.loaderHook;
1208
+ globalLoading[o] = s.emit({
1209
+ loaderHook: a,
1210
+ remoteInfo: n,
1192
1211
  remoteEntryExports: t
1193
- }).then((a) => a || (isBrowserEnv() ? loadEntryDom({
1194
- remoteInfo: o,
1212
+ }).then((l) => l || (isBrowserEnv() ? loadEntryDom({
1213
+ remoteInfo: n,
1195
1214
  remoteEntryExports: t,
1196
- loaderHook: l
1215
+ loaderHook: a
1197
1216
  }) : loadEntryNode({
1198
- remoteInfo: o,
1199
- loaderHook: l
1217
+ remoteInfo: n,
1218
+ loaderHook: a
1200
1219
  })));
1201
1220
  }
1202
- return globalLoading[n];
1221
+ return globalLoading[o];
1203
1222
  }
1204
1223
  function getRemoteInfo(r) {
1205
1224
  return _extends$1({}, r, {
@@ -1221,31 +1240,31 @@ let Module = class {
1221
1240
  remoteEntryExports: this.remoteEntryExports
1222
1241
  });
1223
1242
  } catch {
1224
- const n = getRemoteEntryUniqueKey(this.remoteInfo);
1243
+ const o = getRemoteEntryUniqueKey(this.remoteInfo);
1225
1244
  t = await this.host.loaderHook.lifecycle.loadEntryError.emit({
1226
1245
  getRemoteEntry,
1227
1246
  origin: this.host,
1228
1247
  remoteInfo: this.remoteInfo,
1229
1248
  remoteEntryExports: this.remoteEntryExports,
1230
1249
  globalLoading,
1231
- uniqueKey: n
1250
+ uniqueKey: o
1232
1251
  });
1233
1252
  }
1234
1253
  return assert(t, `remoteEntryExports is undefined
1235
1254
  ${safeToString(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
1236
1255
  }
1237
1256
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1238
- async get(t, o, n, s) {
1239
- const { loadFactory: l = !0 } = n || {
1257
+ async get(t, n, o, s) {
1258
+ const { loadFactory: a = !0 } = o || {
1240
1259
  loadFactory: !0
1241
- }, a = await this.getEntry();
1260
+ }, l = await this.getEntry();
1242
1261
  if (!this.inited) {
1243
- const p = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
1244
- p[m] || (p[m] = {});
1245
- const y = p[m], _ = [], R = {
1262
+ const p = this.host.shareScopeMap, d = this.remoteInfo.shareScope || "default";
1263
+ p[d] || (p[d] = {});
1264
+ const y = p[d], _ = [], E = {
1246
1265
  version: this.remoteInfo.version || ""
1247
1266
  };
1248
- Object.defineProperty(R, "shareScopeMap", {
1267
+ Object.defineProperty(E, "shareScopeMap", {
1249
1268
  value: p,
1250
1269
  // remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
1251
1270
  enumerable: !1
@@ -1253,48 +1272,48 @@ let Module = class {
1253
1272
  const g = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1254
1273
  shareScope: y,
1255
1274
  // @ts-ignore shareScopeMap will be set by Object.defineProperty
1256
- remoteEntryInitOptions: R,
1275
+ remoteEntryInitOptions: E,
1257
1276
  initScope: _,
1258
1277
  remoteInfo: this.remoteInfo,
1259
1278
  origin: this.host
1260
1279
  });
1261
- typeof (a == null ? void 0 : a.init) > "u" && error(getShortErrorMsg(RUNTIME_002, runtimeDescMap, {
1280
+ typeof (l == null ? void 0 : l.init) > "u" && error(getShortErrorMsg(RUNTIME_002, runtimeDescMap, {
1262
1281
  remoteName: name,
1263
1282
  remoteEntryUrl: this.remoteInfo.entry,
1264
1283
  remoteEntryKey: this.remoteInfo.entryGlobalName
1265
- })), await a.init(g.shareScope, g.initScope, g.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, g, {
1284
+ })), await l.init(g.shareScope, g.initScope, g.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, g, {
1266
1285
  id: t,
1267
1286
  remoteSnapshot: s,
1268
- remoteEntryExports: a
1287
+ remoteEntryExports: l
1269
1288
  }));
1270
1289
  }
1271
- this.lib = a, this.inited = !0;
1290
+ this.lib = l, this.inited = !0;
1272
1291
  let i;
1273
1292
  i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1274
- remoteEntryExports: a,
1275
- expose: o,
1293
+ remoteEntryExports: l,
1294
+ expose: n,
1276
1295
  moduleInfo: this.remoteInfo
1277
- }), i || (i = await a.get(o)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${o}.`);
1278
- const c = processModuleAlias(this.remoteInfo.name, o), u = this.wraperFactory(i, c);
1279
- return l ? await u() : u;
1296
+ }), i || (i = await l.get(n)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${n}.`);
1297
+ const c = processModuleAlias(this.remoteInfo.name, n), u = this.wraperFactory(i, c);
1298
+ return a ? await u() : u;
1280
1299
  }
1281
- wraperFactory(t, o) {
1282
- function n(s, l) {
1300
+ wraperFactory(t, n) {
1301
+ function o(s, a) {
1283
1302
  s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
1284
- value: l,
1303
+ value: a,
1285
1304
  enumerable: !1
1286
1305
  });
1287
1306
  }
1288
1307
  return t instanceof Promise ? async () => {
1289
1308
  const s = await t();
1290
- return n(s, o), s;
1309
+ return o(s, n), s;
1291
1310
  } : () => {
1292
1311
  const s = t();
1293
- return n(s, o), s;
1312
+ return o(s, n), s;
1294
1313
  };
1295
1314
  }
1296
- constructor({ remoteInfo: t, host: o }) {
1297
- this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = o;
1315
+ constructor({ remoteInfo: t, host: n }) {
1316
+ this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = n;
1298
1317
  }
1299
1318
  };
1300
1319
  class SyncHook {
@@ -1302,16 +1321,16 @@ class SyncHook {
1302
1321
  typeof t == "function" && this.listeners.add(t);
1303
1322
  }
1304
1323
  once(t) {
1305
- const o = this;
1306
- this.on(function n(...s) {
1307
- return o.remove(n), t.apply(null, s);
1324
+ const n = this;
1325
+ this.on(function o(...s) {
1326
+ return n.remove(o), t.apply(null, s);
1308
1327
  });
1309
1328
  }
1310
1329
  emit(...t) {
1311
- let o;
1312
- return this.listeners.size > 0 && this.listeners.forEach((n) => {
1313
- o = n(...t);
1314
- }), o;
1330
+ let n;
1331
+ return this.listeners.size > 0 && this.listeners.forEach((o) => {
1332
+ n = o(...t);
1333
+ }), n;
1315
1334
  }
1316
1335
  remove(t) {
1317
1336
  this.listeners.delete(t);
@@ -1325,22 +1344,22 @@ class SyncHook {
1325
1344
  }
1326
1345
  class AsyncHook extends SyncHook {
1327
1346
  emit(...t) {
1328
- let o;
1329
- const n = Array.from(this.listeners);
1330
- if (n.length > 0) {
1347
+ let n;
1348
+ const o = Array.from(this.listeners);
1349
+ if (o.length > 0) {
1331
1350
  let s = 0;
1332
- const l = (a) => a === !1 ? !1 : s < n.length ? Promise.resolve(n[s++].apply(null, t)).then(l) : a;
1333
- o = l();
1351
+ const a = (l) => l === !1 ? !1 : s < o.length ? Promise.resolve(o[s++].apply(null, t)).then(a) : l;
1352
+ n = a();
1334
1353
  }
1335
- return Promise.resolve(o);
1354
+ return Promise.resolve(n);
1336
1355
  }
1337
1356
  }
1338
1357
  function checkReturnData(r, t) {
1339
1358
  if (!isObject(t))
1340
1359
  return !1;
1341
1360
  if (r !== t) {
1342
- for (const o in r)
1343
- if (!(o in t))
1361
+ for (const n in r)
1362
+ if (!(n in t))
1344
1363
  return !1;
1345
1364
  }
1346
1365
  return !0;
@@ -1348,17 +1367,17 @@ function checkReturnData(r, t) {
1348
1367
  class SyncWaterfallHook extends SyncHook {
1349
1368
  emit(t) {
1350
1369
  isObject(t) || error(`The data for the "${this.type}" hook should be an object.`);
1351
- for (const o of this.listeners)
1370
+ for (const n of this.listeners)
1352
1371
  try {
1353
- const n = o(t);
1354
- if (checkReturnData(t, n))
1355
- t = n;
1372
+ const o = n(t);
1373
+ if (checkReturnData(t, o))
1374
+ t = o;
1356
1375
  else {
1357
1376
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1358
1377
  break;
1359
1378
  }
1360
- } catch (n) {
1361
- warn(n), this.onerror(n);
1379
+ } catch (o) {
1380
+ warn(o), this.onerror(o);
1362
1381
  }
1363
1382
  return t;
1364
1383
  }
@@ -1369,14 +1388,14 @@ class SyncWaterfallHook extends SyncHook {
1369
1388
  class AsyncWaterfallHook extends SyncHook {
1370
1389
  emit(t) {
1371
1390
  isObject(t) || error(`The response data for the "${this.type}" hook must be an object.`);
1372
- const o = Array.from(this.listeners);
1373
- if (o.length > 0) {
1374
- let n = 0;
1375
- const s = (a) => (warn(a), this.onerror(a), t), l = (a) => {
1376
- if (checkReturnData(t, a)) {
1377
- if (t = a, n < o.length)
1391
+ const n = Array.from(this.listeners);
1392
+ if (n.length > 0) {
1393
+ let o = 0;
1394
+ const s = (l) => (warn(l), this.onerror(l), t), a = (l) => {
1395
+ if (checkReturnData(t, l)) {
1396
+ if (t = l, o < n.length)
1378
1397
  try {
1379
- return Promise.resolve(o[n++](t)).then(l, s);
1398
+ return Promise.resolve(n[o++](t)).then(a, s);
1380
1399
  } catch (i) {
1381
1400
  return s(i);
1382
1401
  }
@@ -1384,7 +1403,7 @@ class AsyncWaterfallHook extends SyncHook {
1384
1403
  this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
1385
1404
  return t;
1386
1405
  };
1387
- return Promise.resolve(l(t));
1406
+ return Promise.resolve(a(t));
1388
1407
  }
1389
1408
  return Promise.resolve(t);
1390
1409
  }
@@ -1395,25 +1414,25 @@ class AsyncWaterfallHook extends SyncHook {
1395
1414
  class PluginSystem {
1396
1415
  applyPlugin(t) {
1397
1416
  assert(isPlainObject(t), "Plugin configuration is invalid.");
1398
- const o = t.name;
1399
- assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = t, Object.keys(this.lifecycle).forEach((n) => {
1400
- const s = t[n];
1401
- s && this.lifecycle[n].on(s);
1417
+ const n = t.name;
1418
+ assert(n, "A name must be provided by the plugin."), this.registerPlugins[n] || (this.registerPlugins[n] = t, Object.keys(this.lifecycle).forEach((o) => {
1419
+ const s = t[o];
1420
+ s && this.lifecycle[o].on(s);
1402
1421
  }));
1403
1422
  }
1404
1423
  removePlugin(t) {
1405
1424
  assert(t, "A name is required.");
1406
- const o = this.registerPlugins[t];
1407
- assert(o, `The plugin "${t}" is not registered.`), Object.keys(o).forEach((n) => {
1408
- n !== "name" && this.lifecycle[n].remove(o[n]);
1425
+ const n = this.registerPlugins[t];
1426
+ assert(n, `The plugin "${t}" is not registered.`), Object.keys(n).forEach((o) => {
1427
+ o !== "name" && this.lifecycle[o].remove(n[o]);
1409
1428
  });
1410
1429
  }
1411
1430
  // eslint-disable-next-line @typescript-eslint/no-shadow
1412
- inherit({ lifecycle: t, registerPlugins: o }) {
1413
- Object.keys(t).forEach((n) => {
1414
- assert(!this.lifecycle[n], `The hook "${n}" has a conflict and cannot be inherited.`), this.lifecycle[n] = t[n];
1415
- }), Object.keys(o).forEach((n) => {
1416
- assert(!this.registerPlugins[n], `The plugin "${n}" has a conflict and cannot be inherited.`), this.applyPlugin(o[n]);
1431
+ inherit({ lifecycle: t, registerPlugins: n }) {
1432
+ Object.keys(t).forEach((o) => {
1433
+ assert(!this.lifecycle[o], `The hook "${o}" has a conflict and cannot be inherited.`), this.lifecycle[o] = t[o];
1434
+ }), Object.keys(n).forEach((o) => {
1435
+ assert(!this.registerPlugins[o], `The plugin "${o}" has a conflict and cannot be inherited.`), this.applyPlugin(n[o]);
1417
1436
  });
1418
1437
  }
1419
1438
  constructor(t) {
@@ -1429,24 +1448,24 @@ function defaultPreloadArgs(r) {
1429
1448
  }, r);
1430
1449
  }
1431
1450
  function formatPreloadArgs(r, t) {
1432
- return t.map((o) => {
1433
- const n = matchRemote(r, o.nameOrAlias);
1434
- return assert(n, `Unable to preload ${o.nameOrAlias} as it is not included in ${!n && safeToString({
1435
- remoteInfo: n,
1451
+ return t.map((n) => {
1452
+ const o = matchRemote(r, n.nameOrAlias);
1453
+ return assert(o, `Unable to preload ${n.nameOrAlias} as it is not included in ${!o && safeToString({
1454
+ remoteInfo: o,
1436
1455
  remotes: r
1437
1456
  })}`), {
1438
- remote: n,
1439
- preloadConfig: defaultPreloadArgs(o)
1457
+ remote: o,
1458
+ preloadConfig: defaultPreloadArgs(n)
1440
1459
  };
1441
1460
  });
1442
1461
  }
1443
1462
  function normalizePreloadExposes(r) {
1444
1463
  return r ? r.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1445
1464
  }
1446
- function preloadAssets(r, t, o, n = !0) {
1447
- const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } = o;
1465
+ function preloadAssets(r, t, n, o = !0) {
1466
+ const { cssAssets: s, jsAssetsWithoutEntry: a, entryAssets: l } = n;
1448
1467
  if (t.options.inBrowser) {
1449
- if (a.forEach((i) => {
1468
+ if (l.forEach((i) => {
1450
1469
  const { moduleInfo: c } = i, u = t.moduleCache.get(r.name);
1451
1470
  getRemoteEntry(u ? {
1452
1471
  origin: t,
@@ -1457,27 +1476,27 @@ function preloadAssets(r, t, o, n = !0) {
1457
1476
  remoteInfo: c,
1458
1477
  remoteEntryExports: void 0
1459
1478
  });
1460
- }), n) {
1479
+ }), o) {
1461
1480
  const i = {
1462
1481
  rel: "preload",
1463
1482
  as: "style"
1464
1483
  };
1465
1484
  s.forEach((c) => {
1466
- const { link: u, needAttach: d } = createLink({
1485
+ const { link: u, needAttach: m } = createLink({
1467
1486
  url: c,
1468
1487
  cb: () => {
1469
1488
  },
1470
1489
  attrs: i,
1471
- createLinkHook: (p, m) => {
1490
+ createLinkHook: (p, d) => {
1472
1491
  const y = t.loaderHook.lifecycle.createLink.emit({
1473
1492
  url: p,
1474
- attrs: m
1493
+ attrs: d
1475
1494
  });
1476
1495
  if (y instanceof HTMLLinkElement)
1477
1496
  return y;
1478
1497
  }
1479
1498
  });
1480
- d && document.head.appendChild(u);
1499
+ m && document.head.appendChild(u);
1481
1500
  });
1482
1501
  } else {
1483
1502
  const i = {
@@ -1485,92 +1504,92 @@ function preloadAssets(r, t, o, n = !0) {
1485
1504
  type: "text/css"
1486
1505
  };
1487
1506
  s.forEach((c) => {
1488
- const { link: u, needAttach: d } = createLink({
1507
+ const { link: u, needAttach: m } = createLink({
1489
1508
  url: c,
1490
1509
  cb: () => {
1491
1510
  },
1492
1511
  attrs: i,
1493
- createLinkHook: (p, m) => {
1512
+ createLinkHook: (p, d) => {
1494
1513
  const y = t.loaderHook.lifecycle.createLink.emit({
1495
1514
  url: p,
1496
- attrs: m
1515
+ attrs: d
1497
1516
  });
1498
1517
  if (y instanceof HTMLLinkElement)
1499
1518
  return y;
1500
1519
  },
1501
1520
  needDeleteLink: !1
1502
1521
  });
1503
- d && document.head.appendChild(u);
1522
+ m && document.head.appendChild(u);
1504
1523
  });
1505
1524
  }
1506
- if (n) {
1525
+ if (o) {
1507
1526
  const i = {
1508
1527
  rel: "preload",
1509
1528
  as: "script"
1510
1529
  };
1511
- l.forEach((c) => {
1512
- const { link: u, needAttach: d } = createLink({
1530
+ a.forEach((c) => {
1531
+ const { link: u, needAttach: m } = createLink({
1513
1532
  url: c,
1514
1533
  cb: () => {
1515
1534
  },
1516
1535
  attrs: i,
1517
- createLinkHook: (p, m) => {
1536
+ createLinkHook: (p, d) => {
1518
1537
  const y = t.loaderHook.lifecycle.createLink.emit({
1519
1538
  url: p,
1520
- attrs: m
1539
+ attrs: d
1521
1540
  });
1522
1541
  if (y instanceof HTMLLinkElement)
1523
1542
  return y;
1524
1543
  }
1525
1544
  });
1526
- d && document.head.appendChild(u);
1545
+ m && document.head.appendChild(u);
1527
1546
  });
1528
1547
  } else {
1529
1548
  const i = {
1530
1549
  fetchpriority: "high",
1531
1550
  type: (r == null ? void 0 : r.type) === "module" ? "module" : "text/javascript"
1532
1551
  };
1533
- l.forEach((c) => {
1534
- const { script: u, needAttach: d } = createScript({
1552
+ a.forEach((c) => {
1553
+ const { script: u, needAttach: m } = createScript({
1535
1554
  url: c,
1536
1555
  cb: () => {
1537
1556
  },
1538
1557
  attrs: i,
1539
- createScriptHook: (p, m) => {
1558
+ createScriptHook: (p, d) => {
1540
1559
  const y = t.loaderHook.lifecycle.createScript.emit({
1541
1560
  url: p,
1542
- attrs: m
1561
+ attrs: d
1543
1562
  });
1544
1563
  if (y instanceof HTMLScriptElement)
1545
1564
  return y;
1546
1565
  },
1547
1566
  needDeleteScript: !0
1548
1567
  });
1549
- d && document.head.appendChild(u);
1568
+ m && document.head.appendChild(u);
1550
1569
  });
1551
1570
  }
1552
1571
  }
1553
1572
  }
1554
1573
  function assignRemoteInfo(r, t) {
1555
- const o = getRemoteEntryInfoFromSnapshot(t);
1556
- o.url || error(`The attribute remoteEntry of ${r.name} must not be undefined.`);
1557
- let n = getResourceUrl(t, o.url);
1558
- !isBrowserEnv() && !n.startsWith("http") && (n = `https:${n}`), r.type = o.type, r.entryGlobalName = o.globalName, r.entry = n, r.version = t.version, r.buildVersion = t.buildVersion;
1574
+ const n = getRemoteEntryInfoFromSnapshot(t);
1575
+ n.url || error(`The attribute remoteEntry of ${r.name} must not be undefined.`);
1576
+ let o = getResourceUrl(t, n.url);
1577
+ !isBrowserEnv() && !o.startsWith("http") && (o = `https:${o}`), r.type = n.type, r.entryGlobalName = n.globalName, r.entry = o, r.version = t.version, r.buildVersion = t.buildVersion;
1559
1578
  }
1560
1579
  function snapshotPlugin() {
1561
1580
  return {
1562
1581
  name: "snapshot-plugin",
1563
1582
  async afterResolve(r) {
1564
- const { remote: t, pkgNameOrAlias: o, expose: n, origin: s, remoteInfo: l } = r;
1583
+ const { remote: t, pkgNameOrAlias: n, expose: o, origin: s, remoteInfo: a } = r;
1565
1584
  if (!isRemoteInfoWithEntry(t) || !isPureRemoteEntry(t)) {
1566
- const { remoteSnapshot: a, globalSnapshot: i } = await s.snapshotHandler.loadRemoteSnapshotInfo(t);
1567
- assignRemoteInfo(l, a);
1585
+ const { remoteSnapshot: l, globalSnapshot: i } = await s.snapshotHandler.loadRemoteSnapshotInfo(t);
1586
+ assignRemoteInfo(a, l);
1568
1587
  const c = {
1569
1588
  remote: t,
1570
1589
  preloadConfig: {
1571
- nameOrAlias: o,
1590
+ nameOrAlias: n,
1572
1591
  exposes: [
1573
- n
1592
+ o
1574
1593
  ],
1575
1594
  resourceCategory: "sync",
1576
1595
  share: !1,
@@ -1579,13 +1598,13 @@ function snapshotPlugin() {
1579
1598
  }, u = await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1580
1599
  origin: s,
1581
1600
  preloadOptions: c,
1582
- remoteInfo: l,
1601
+ remoteInfo: a,
1583
1602
  remote: t,
1584
- remoteSnapshot: a,
1603
+ remoteSnapshot: l,
1585
1604
  globalSnapshot: i
1586
1605
  });
1587
- return u && preloadAssets(l, s, u, !1), _extends$1({}, r, {
1588
- remoteSnapshot: a
1606
+ return u && preloadAssets(a, s, u, !1), _extends$1({}, r, {
1607
+ remoteSnapshot: l
1589
1608
  });
1590
1609
  }
1591
1610
  return r;
@@ -1605,99 +1624,99 @@ function splitId(r) {
1605
1624
  version: t[2]
1606
1625
  };
1607
1626
  }
1608
- function traverseModuleInfo(r, t, o, n, s = {}, l) {
1609
- const a = getFMId(t), { value: i } = getInfoWithoutType(r, a), c = l || i;
1610
- if (c && !isManifestProvider(c) && (o(c, t, n), c.remotesInfo)) {
1627
+ function traverseModuleInfo(r, t, n, o, s = {}, a) {
1628
+ const l = getFMId(t), { value: i } = getInfoWithoutType(r, l), c = a || i;
1629
+ if (c && !isManifestProvider(c) && (n(c, t, o), c.remotesInfo)) {
1611
1630
  const u = Object.keys(c.remotesInfo);
1612
- for (const d of u) {
1613
- if (s[d])
1631
+ for (const m of u) {
1632
+ if (s[m])
1614
1633
  continue;
1615
- s[d] = !0;
1616
- const p = splitId(d), m = c.remotesInfo[d];
1634
+ s[m] = !0;
1635
+ const p = splitId(m), d = c.remotesInfo[m];
1617
1636
  traverseModuleInfo(r, {
1618
1637
  name: p.name,
1619
- version: m.matchedVersion
1620
- }, o, !1, s, void 0);
1638
+ version: d.matchedVersion
1639
+ }, n, !1, s, void 0);
1621
1640
  }
1622
1641
  }
1623
1642
  }
1624
- function generatePreloadAssets(r, t, o, n, s) {
1625
- const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = r, { preloadConfig: p } = t, { depsRemote: m } = p;
1626
- if (traverseModuleInfo(n, o, (g, E, I) => {
1627
- let v;
1628
- if (I)
1629
- v = p;
1630
- else if (Array.isArray(m)) {
1631
- const T = m.find((w) => w.nameOrAlias === E.name || w.nameOrAlias === E.alias);
1643
+ function generatePreloadAssets(r, t, n, o, s) {
1644
+ const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: m } = r, { preloadConfig: p } = t, { depsRemote: d } = p;
1645
+ if (traverseModuleInfo(o, n, (g, b, S) => {
1646
+ let I;
1647
+ if (S)
1648
+ I = p;
1649
+ else if (Array.isArray(d)) {
1650
+ const T = d.find((A) => A.nameOrAlias === b.name || A.nameOrAlias === b.alias);
1632
1651
  if (!T)
1633
1652
  return;
1634
- v = defaultPreloadArgs(T);
1635
- } else if (m === !0)
1636
- v = p;
1653
+ I = defaultPreloadArgs(T);
1654
+ } else if (d === !0)
1655
+ I = p;
1637
1656
  else
1638
1657
  return;
1639
- const S = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1640
- S && i.push({
1641
- name: E.name,
1658
+ const v = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1659
+ v && i.push({
1660
+ name: b.name,
1642
1661
  moduleInfo: {
1643
- name: E.name,
1644
- entry: S,
1662
+ name: b.name,
1663
+ entry: v,
1645
1664
  type: "remoteEntryType" in g ? g.remoteEntryType : "global",
1646
- entryGlobalName: "globalName" in g ? g.globalName : E.name,
1665
+ entryGlobalName: "globalName" in g ? g.globalName : b.name,
1647
1666
  shareScope: "",
1648
1667
  version: "version" in g ? g.version : void 0
1649
1668
  },
1650
- url: S
1669
+ url: v
1651
1670
  });
1652
- let b = "modules" in g ? g.modules : [];
1653
- const $ = normalizePreloadExposes(v.exposes);
1671
+ let R = "modules" in g ? g.modules : [];
1672
+ const $ = normalizePreloadExposes(I.exposes);
1654
1673
  if ($.length && "modules" in g) {
1655
- var A;
1656
- b = g == null || (A = g.modules) == null ? void 0 : A.reduce((T, w) => (($ == null ? void 0 : $.indexOf(w.moduleName)) !== -1 && T.push(w), T), []);
1674
+ var w;
1675
+ R = g == null || (w = g.modules) == null ? void 0 : w.reduce((T, A) => (($ == null ? void 0 : $.indexOf(A.moduleName)) !== -1 && T.push(A), T), []);
1657
1676
  }
1658
1677
  function O(T) {
1659
- const w = T.map((P) => getResourceUrl(g, P));
1660
- return v.filter ? w.filter(v.filter) : w;
1678
+ const A = T.map((P) => getResourceUrl(g, P));
1679
+ return I.filter ? A.filter(I.filter) : A;
1661
1680
  }
1662
- if (b) {
1663
- const T = b.length;
1664
- for (let w = 0; w < T; w++) {
1665
- const P = b[w], M = `${E.name}/${P.moduleName}`;
1681
+ if (R) {
1682
+ const T = R.length;
1683
+ for (let A = 0; A < T; A++) {
1684
+ const P = R[A], L = `${b.name}/${P.moduleName}`;
1666
1685
  r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1667
- id: P.moduleName === "." ? E.name : M,
1668
- name: E.name,
1686
+ id: P.moduleName === "." ? b.name : L,
1687
+ name: b.name,
1669
1688
  remoteSnapshot: g,
1670
- preloadConfig: v,
1671
- remote: E,
1689
+ preloadConfig: I,
1690
+ remote: b,
1672
1691
  origin: r
1673
- }), !getPreloaded(M) && (v.resourceCategory === "all" ? (l.push(...O(P.assets.css.async)), l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.async)), a.push(...O(P.assets.js.sync))) : (v.resourceCategory = "sync") && (l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.sync))), setPreloaded(M));
1692
+ }), !getPreloaded(L) && (I.resourceCategory === "all" ? (a.push(...O(P.assets.css.async)), a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.async)), l.push(...O(P.assets.js.sync))) : (I.resourceCategory = "sync") && (a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.sync))), setPreloaded(L));
1674
1693
  }
1675
1694
  }
1676
1695
  }, !0, {}, s), s.shared) {
1677
- const g = (E, I) => {
1678
- const v = getRegisteredShare(r.shareScopeMap, I.sharedName, E, r.sharedHandler.hooks.lifecycle.resolveShare);
1679
- v && typeof v.lib == "function" && (I.assets.js.sync.forEach((S) => {
1680
- c.add(S);
1681
- }), I.assets.css.sync.forEach((S) => {
1682
- u.add(S);
1696
+ const g = (b, S) => {
1697
+ const I = getRegisteredShare(r.shareScopeMap, S.sharedName, b, r.sharedHandler.hooks.lifecycle.resolveShare);
1698
+ I && typeof I.lib == "function" && (S.assets.js.sync.forEach((v) => {
1699
+ c.add(v);
1700
+ }), S.assets.css.sync.forEach((v) => {
1701
+ u.add(v);
1683
1702
  }));
1684
1703
  };
1685
- s.shared.forEach((E) => {
1686
- var I;
1687
- const v = (I = d.shared) == null ? void 0 : I[E.sharedName];
1688
- if (!v)
1704
+ s.shared.forEach((b) => {
1705
+ var S;
1706
+ const I = (S = m.shared) == null ? void 0 : S[b.sharedName];
1707
+ if (!I)
1689
1708
  return;
1690
- const S = E.version ? v.find(($) => $.version === E.version) : v;
1691
- if (!S)
1709
+ const v = b.version ? I.find(($) => $.version === b.version) : I;
1710
+ if (!v)
1692
1711
  return;
1693
- arrayOptions(S).forEach(($) => {
1694
- g($, E);
1712
+ arrayOptions(v).forEach(($) => {
1713
+ g($, b);
1695
1714
  });
1696
1715
  });
1697
1716
  }
1698
- const _ = a.filter((g) => !c.has(g));
1717
+ const _ = l.filter((g) => !c.has(g));
1699
1718
  return {
1700
- cssAssets: l.filter((g) => !u.has(g)),
1719
+ cssAssets: a.filter((g) => !u.has(g)),
1701
1720
  jsAssetsWithoutEntry: _,
1702
1721
  entryAssets: i
1703
1722
  };
@@ -1706,7 +1725,7 @@ const generatePreloadAssetsPlugin = function() {
1706
1725
  return {
1707
1726
  name: "generate-preload-assets-plugin",
1708
1727
  async generatePreloadAssets(r) {
1709
- const { origin: t, preloadOptions: o, remoteInfo: n, remote: s, globalSnapshot: l, remoteSnapshot: a } = r;
1728
+ const { origin: t, preloadOptions: n, remoteInfo: o, remote: s, globalSnapshot: a, remoteSnapshot: l } = r;
1710
1729
  return isRemoteInfoWithEntry(s) && isPureRemoteEntry(s) ? {
1711
1730
  cssAssets: [],
1712
1731
  jsAssetsWithoutEntry: [],
@@ -1715,29 +1734,29 @@ const generatePreloadAssetsPlugin = function() {
1715
1734
  name: s.name,
1716
1735
  url: s.entry,
1717
1736
  moduleInfo: {
1718
- name: n.name,
1737
+ name: o.name,
1719
1738
  entry: s.entry,
1720
- type: n.type || "global",
1739
+ type: o.type || "global",
1721
1740
  entryGlobalName: "",
1722
1741
  shareScope: ""
1723
1742
  }
1724
1743
  }
1725
1744
  ]
1726
- } : (assignRemoteInfo(n, a), generatePreloadAssets(t, o, n, l, a));
1745
+ } : (assignRemoteInfo(o, l), generatePreloadAssets(t, n, o, a, l));
1727
1746
  }
1728
1747
  };
1729
1748
  };
1730
1749
  function getGlobalRemoteInfo(r, t) {
1731
- const o = getGlobalSnapshotInfoByModuleInfo({
1750
+ const n = getGlobalSnapshotInfoByModuleInfo({
1732
1751
  name: t.options.name,
1733
1752
  version: t.options.version
1734
- }), n = o && "remotesInfo" in o && o.remotesInfo && getInfoWithoutType(o.remotesInfo, r.name).value;
1735
- return n && n.matchedVersion ? {
1736
- hostGlobalSnapshot: o,
1753
+ }), o = n && "remotesInfo" in n && n.remotesInfo && getInfoWithoutType(n.remotesInfo, r.name).value;
1754
+ return o && o.matchedVersion ? {
1755
+ hostGlobalSnapshot: n,
1737
1756
  globalSnapshot: getGlobalSnapshot(),
1738
1757
  remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1739
1758
  name: r.name,
1740
- version: n.matchedVersion
1759
+ version: o.matchedVersion
1741
1760
  })
1742
1761
  } : {
1743
1762
  hostGlobalSnapshot: void 0,
@@ -1750,56 +1769,56 @@ function getGlobalRemoteInfo(r, t) {
1750
1769
  }
1751
1770
  class SnapshotHandler {
1752
1771
  async loadSnapshot(t) {
1753
- const { options: o } = this.HostInstance, { hostGlobalSnapshot: n, remoteSnapshot: s, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: a, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
1754
- options: o,
1772
+ const { options: n } = this.HostInstance, { hostGlobalSnapshot: o, remoteSnapshot: s, globalSnapshot: a } = this.getGlobalRemoteInfo(t), { remoteSnapshot: l, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
1773
+ options: n,
1755
1774
  moduleInfo: t,
1756
- hostGlobalSnapshot: n,
1775
+ hostGlobalSnapshot: o,
1757
1776
  remoteSnapshot: s,
1758
- globalSnapshot: l
1777
+ globalSnapshot: a
1759
1778
  });
1760
1779
  return {
1761
- remoteSnapshot: a,
1780
+ remoteSnapshot: l,
1762
1781
  globalSnapshot: i
1763
1782
  };
1764
1783
  }
1765
1784
  // eslint-disable-next-line max-lines-per-function
1766
1785
  async loadRemoteSnapshotInfo(t) {
1767
- const { options: o } = this.HostInstance;
1786
+ const { options: n } = this.HostInstance;
1768
1787
  await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1769
- options: o,
1788
+ options: n,
1770
1789
  moduleInfo: t
1771
1790
  });
1772
- let n = getGlobalSnapshotInfoByModuleInfo({
1791
+ let o = getGlobalSnapshotInfoByModuleInfo({
1773
1792
  name: this.HostInstance.options.name,
1774
1793
  version: this.HostInstance.options.version
1775
1794
  });
1776
- n || (n = {
1795
+ o || (o = {
1777
1796
  version: this.HostInstance.options.version || "",
1778
1797
  remoteEntry: "",
1779
1798
  remotesInfo: {}
1780
1799
  }, addGlobalSnapshot({
1781
- [this.HostInstance.options.name]: n
1782
- })), n && "remotesInfo" in n && !getInfoWithoutType(n.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (n.remotesInfo = _extends$1({}, n == null ? void 0 : n.remotesInfo, {
1800
+ [this.HostInstance.options.name]: o
1801
+ })), o && "remotesInfo" in o && !getInfoWithoutType(o.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (o.remotesInfo = _extends$1({}, o == null ? void 0 : o.remotesInfo, {
1783
1802
  [t.name]: {
1784
1803
  matchedVersion: "version" in t ? t.version : t.entry
1785
1804
  }
1786
1805
  }));
1787
- const { hostGlobalSnapshot: s, remoteSnapshot: l, globalSnapshot: a } = this.getGlobalRemoteInfo(t), { remoteSnapshot: i, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1788
- options: o,
1806
+ const { hostGlobalSnapshot: s, remoteSnapshot: a, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: i, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1807
+ options: n,
1789
1808
  moduleInfo: t,
1790
1809
  hostGlobalSnapshot: s,
1791
- remoteSnapshot: l,
1792
- globalSnapshot: a
1810
+ remoteSnapshot: a,
1811
+ globalSnapshot: l
1793
1812
  });
1794
- let u, d;
1813
+ let u, m;
1795
1814
  if (i)
1796
1815
  if (isManifestProvider(i)) {
1797
- const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1816
+ const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", d = await this.getManifestJson(p, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1798
1817
  // The global remote may be overridden
1799
1818
  // Therefore, set the snapshot key to the global address of the actual request
1800
1819
  entry: p
1801
- }), m);
1802
- u = m, d = y;
1820
+ }), d);
1821
+ u = d, m = y;
1803
1822
  } else {
1804
1823
  const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1805
1824
  options: this.HostInstance.options,
@@ -1807,16 +1826,16 @@ class SnapshotHandler {
1807
1826
  remoteSnapshot: i,
1808
1827
  from: "global"
1809
1828
  });
1810
- u = p, d = c;
1829
+ u = p, m = c;
1811
1830
  }
1812
1831
  else if (isRemoteInfoWithEntry(t)) {
1813
- const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1832
+ const p = await this.getManifestJson(t.entry, t, {}), d = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1814
1833
  options: this.HostInstance.options,
1815
1834
  moduleInfo: t,
1816
1835
  remoteSnapshot: p,
1817
1836
  from: "global"
1818
1837
  });
1819
- u = y, d = m;
1838
+ u = y, m = d;
1820
1839
  } else
1821
1840
  error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1822
1841
  hostName: t.name,
@@ -1824,45 +1843,45 @@ class SnapshotHandler {
1824
1843
  globalSnapshot: JSON.stringify(c)
1825
1844
  }));
1826
1845
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1827
- options: o,
1846
+ options: n,
1828
1847
  moduleInfo: t,
1829
1848
  remoteSnapshot: u
1830
1849
  }), {
1831
1850
  remoteSnapshot: u,
1832
- globalSnapshot: d
1851
+ globalSnapshot: m
1833
1852
  };
1834
1853
  }
1835
1854
  getGlobalRemoteInfo(t) {
1836
1855
  return getGlobalRemoteInfo(t, this.HostInstance);
1837
1856
  }
1838
- async getManifestJson(t, o, n) {
1857
+ async getManifestJson(t, n, o) {
1839
1858
  const s = async () => {
1840
- let a = this.manifestCache.get(t);
1841
- if (a)
1842
- return a;
1859
+ let l = this.manifestCache.get(t);
1860
+ if (l)
1861
+ return l;
1843
1862
  try {
1844
1863
  let i = await this.loaderHook.lifecycle.fetch.emit(t, {});
1845
- return (!i || !(i instanceof Response)) && (i = await fetch(t, {})), a = await i.json(), assert(a.metaData && a.exposes && a.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, a), a;
1864
+ return (!i || !(i instanceof Response)) && (i = await fetch(t, {})), l = await i.json(), assert(l.metaData && l.exposes && l.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, l), l;
1846
1865
  } catch (i) {
1847
1866
  delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
1848
1867
  manifestUrl: t,
1849
- moduleName: o.name
1868
+ moduleName: n.name
1850
1869
  }, `${i}`));
1851
1870
  }
1852
- }, l = async () => {
1853
- const a = await s(), i = generateSnapshotFromManifest(a, {
1871
+ }, a = async () => {
1872
+ const l = await s(), i = generateSnapshotFromManifest(l, {
1854
1873
  version: t
1855
1874
  }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1856
1875
  options: this.HostInstance.options,
1857
- moduleInfo: o,
1858
- manifestJson: a,
1876
+ moduleInfo: n,
1877
+ manifestJson: l,
1859
1878
  remoteSnapshot: i,
1860
1879
  manifestUrl: t,
1861
1880
  from: "manifest"
1862
1881
  });
1863
1882
  return c;
1864
1883
  };
1865
- return this.manifestLoading[t] || (this.manifestLoading[t] = l().then((a) => a)), this.manifestLoading[t];
1884
+ return this.manifestLoading[t] || (this.manifestLoading[t] = a().then((l) => l)), this.manifestLoading[t];
1866
1885
  }
1867
1886
  constructor(t) {
1868
1887
  this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new PluginSystem({
@@ -1875,44 +1894,44 @@ class SnapshotHandler {
1875
1894
  }
1876
1895
  class SharedHandler {
1877
1896
  // register shared in shareScopeMap
1878
- registerShared(t, o) {
1879
- const { shareInfos: n, shared: s } = formatShareConfigs(t, o);
1880
- return Object.keys(n).forEach((a) => {
1881
- n[a].forEach((c) => {
1882
- !getRegisteredShare(this.shareScopeMap, a, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
1883
- pkgName: a,
1897
+ registerShared(t, n) {
1898
+ const { shareInfos: o, shared: s } = formatShareConfigs(t, n);
1899
+ return Object.keys(o).forEach((l) => {
1900
+ o[l].forEach((c) => {
1901
+ !getRegisteredShare(this.shareScopeMap, l, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
1902
+ pkgName: l,
1884
1903
  lib: c.lib,
1885
1904
  get: c.get,
1886
1905
  loaded: !0,
1887
1906
  shared: c,
1888
- from: o.name
1907
+ from: n.name
1889
1908
  });
1890
1909
  });
1891
1910
  }), {
1892
- shareInfos: n,
1911
+ shareInfos: o,
1893
1912
  shared: s
1894
1913
  };
1895
1914
  }
1896
- async loadShare(t, o) {
1897
- const { host: n } = this, s = getTargetSharedOptions({
1915
+ async loadShare(t, n) {
1916
+ const { host: o } = this, s = getTargetSharedOptions({
1898
1917
  pkgName: t,
1899
- extraOptions: o,
1900
- shareInfos: n.options.shared
1918
+ extraOptions: n,
1919
+ shareInfos: o.options.shared
1901
1920
  });
1902
1921
  s != null && s.scope && await Promise.all(s.scope.map(async (u) => {
1903
1922
  await Promise.all(this.initializeSharing(u, {
1904
1923
  strategy: s.strategy
1905
1924
  }));
1906
1925
  }));
1907
- const l = await this.hooks.lifecycle.beforeLoadShare.emit({
1926
+ const a = await this.hooks.lifecycle.beforeLoadShare.emit({
1908
1927
  pkgName: t,
1909
1928
  shareInfo: s,
1910
- shared: n.options.shared,
1911
- origin: n
1912
- }), { shareInfo: a } = l;
1913
- assert(a, `Cannot find ${t} Share in the ${n.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1914
- const i = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare), c = (u) => {
1915
- u.useIn || (u.useIn = []), addUniqueItem(u.useIn, n.options.name);
1929
+ shared: o.options.shared,
1930
+ origin: o
1931
+ }), { shareInfo: l } = a;
1932
+ assert(l, `Cannot find ${t} Share in the ${o.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1933
+ const i = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare), c = (u) => {
1934
+ u.useIn || (u.useIn = []), addUniqueItem(u.useIn, o.options.name);
1916
1935
  };
1917
1936
  if (i && i.lib)
1918
1937
  return c(i), i.lib;
@@ -1920,37 +1939,37 @@ class SharedHandler {
1920
1939
  const u = await i.loading;
1921
1940
  return i.loaded = !0, i.lib || (i.lib = u), c(i), u;
1922
1941
  } else if (i) {
1923
- const d = (async () => {
1942
+ const m = (async () => {
1924
1943
  const p = await i.get();
1925
- a.lib = p, a.loaded = !0, c(a);
1926
- const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1927
- return m && (m.lib = p, m.loaded = !0), p;
1944
+ l.lib = p, l.loaded = !0, c(l);
1945
+ const d = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1946
+ return d && (d.lib = p, d.loaded = !0), p;
1928
1947
  })();
1929
1948
  return this.setShared({
1930
1949
  pkgName: t,
1931
1950
  loaded: !1,
1932
1951
  shared: i,
1933
- from: n.options.name,
1952
+ from: o.options.name,
1934
1953
  lib: null,
1935
- loading: d
1936
- }), d;
1954
+ loading: m
1955
+ }), m;
1937
1956
  } else {
1938
- if (o != null && o.customShareInfo)
1957
+ if (n != null && n.customShareInfo)
1939
1958
  return !1;
1940
- const d = (async () => {
1941
- const p = await a.get();
1942
- a.lib = p, a.loaded = !0, c(a);
1943
- const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1944
- return m && (m.lib = p, m.loaded = !0), p;
1959
+ const m = (async () => {
1960
+ const p = await l.get();
1961
+ l.lib = p, l.loaded = !0, c(l);
1962
+ const d = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1963
+ return d && (d.lib = p, d.loaded = !0), p;
1945
1964
  })();
1946
1965
  return this.setShared({
1947
1966
  pkgName: t,
1948
1967
  loaded: !1,
1949
- shared: a,
1950
- from: n.options.name,
1968
+ shared: l,
1969
+ from: o.options.name,
1951
1970
  lib: null,
1952
- loading: d
1953
- }), d;
1971
+ loading: m
1972
+ }), m;
1954
1973
  }
1955
1974
  }
1956
1975
  /**
@@ -1959,53 +1978,53 @@ class SharedHandler {
1959
1978
  * If the share scope does not exist, it creates one.
1960
1979
  */
1961
1980
  // eslint-disable-next-line @typescript-eslint/member-ordering
1962
- initializeSharing(t = DEFAULT_SCOPE, o) {
1963
- const { host: n } = this, s = o == null ? void 0 : o.from, l = o == null ? void 0 : o.strategy;
1964
- let a = o == null ? void 0 : o.initScope;
1981
+ initializeSharing(t = DEFAULT_SCOPE, n) {
1982
+ const { host: o } = this, s = n == null ? void 0 : n.from, a = n == null ? void 0 : n.strategy;
1983
+ let l = n == null ? void 0 : n.initScope;
1965
1984
  const i = [];
1966
1985
  if (s !== "build") {
1967
1986
  const { initTokens: _ } = this;
1968
- a || (a = []);
1969
- let R = _[t];
1970
- if (R || (R = _[t] = {
1987
+ l || (l = []);
1988
+ let E = _[t];
1989
+ if (E || (E = _[t] = {
1971
1990
  from: this.host.name
1972
- }), a.indexOf(R) >= 0)
1991
+ }), l.indexOf(E) >= 0)
1973
1992
  return i;
1974
- a.push(R);
1993
+ l.push(E);
1975
1994
  }
1976
- const c = this.shareScopeMap, u = n.options.name;
1995
+ const c = this.shareScopeMap, u = o.options.name;
1977
1996
  c[t] || (c[t] = {});
1978
- const d = c[t], p = (_, R) => {
1997
+ const m = c[t], p = (_, E) => {
1979
1998
  var g;
1980
- const { version: E, eager: I } = R;
1981
- d[_] = d[_] || {};
1982
- const v = d[_], S = v[E], b = !!(S && (S.eager || (g = S.shareConfig) != null && g.eager));
1983
- (!S || S.strategy !== "loaded-first" && !S.loaded && (!I != !b ? I : u > S.from)) && (v[E] = R);
1984
- }, m = (_) => _ && _.init && _.init(c[t], a), y = async (_) => {
1985
- const { module: R } = await n.remoteHandler.getRemoteModuleAndOptions({
1999
+ const { version: b, eager: S } = E;
2000
+ m[_] = m[_] || {};
2001
+ const I = m[_], v = I[b], R = !!(v && (v.eager || (g = v.shareConfig) != null && g.eager));
2002
+ (!v || v.strategy !== "loaded-first" && !v.loaded && (!S != !R ? S : u > v.from)) && (I[b] = E);
2003
+ }, d = (_) => _ && _.init && _.init(c[t], l), y = async (_) => {
2004
+ const { module: E } = await o.remoteHandler.getRemoteModuleAndOptions({
1986
2005
  id: _
1987
2006
  });
1988
- if (R.getEntry) {
2007
+ if (E.getEntry) {
1989
2008
  let g;
1990
2009
  try {
1991
- g = await R.getEntry();
1992
- } catch (E) {
1993
- g = await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2010
+ g = await E.getEntry();
2011
+ } catch (b) {
2012
+ g = await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1994
2013
  id: _,
1995
- error: E,
2014
+ error: b,
1996
2015
  from: "runtime",
1997
2016
  lifecycle: "beforeLoadShare",
1998
- origin: n
2017
+ origin: o
1999
2018
  });
2000
2019
  }
2001
- R.inited || (await m(g), R.inited = !0);
2020
+ E.inited || (await d(g), E.inited = !0);
2002
2021
  }
2003
2022
  };
2004
- return Object.keys(n.options.shared).forEach((_) => {
2005
- n.options.shared[_].forEach((g) => {
2023
+ return Object.keys(o.options.shared).forEach((_) => {
2024
+ o.options.shared[_].forEach((g) => {
2006
2025
  g.scope.includes(t) && p(_, g);
2007
2026
  });
2008
- }), (n.options.shareStrategy === "version-first" || l === "version-first") && n.options.remotes.forEach((_) => {
2027
+ }), (o.options.shareStrategy === "version-first" || a === "version-first") && o.options.remotes.forEach((_) => {
2009
2028
  _.shareScope === t && i.push(y(_.name));
2010
2029
  }), i;
2011
2030
  }
@@ -2013,32 +2032,32 @@ class SharedHandler {
2013
2032
  // 1. If the loaded shared already exists globally, then it will be reused
2014
2033
  // 2. If lib exists in local shared, it will be used directly
2015
2034
  // 3. If the local get returns something other than Promise, then it will be used directly
2016
- loadShareSync(t, o) {
2017
- const { host: n } = this, s = getTargetSharedOptions({
2035
+ loadShareSync(t, n) {
2036
+ const { host: o } = this, s = getTargetSharedOptions({
2018
2037
  pkgName: t,
2019
- extraOptions: o,
2020
- shareInfos: n.options.shared
2038
+ extraOptions: n,
2039
+ shareInfos: o.options.shared
2021
2040
  });
2022
2041
  s != null && s.scope && s.scope.forEach((i) => {
2023
2042
  this.initializeSharing(i, {
2024
2043
  strategy: s.strategy
2025
2044
  });
2026
2045
  });
2027
- const l = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), a = (i) => {
2028
- i.useIn || (i.useIn = []), addUniqueItem(i.useIn, n.options.name);
2046
+ const a = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), l = (i) => {
2047
+ i.useIn || (i.useIn = []), addUniqueItem(i.useIn, o.options.name);
2029
2048
  };
2030
- if (l) {
2031
- if (typeof l.lib == "function")
2032
- return a(l), l.loaded || (l.loaded = !0, l.from === n.options.name && (s.loaded = !0)), l.lib;
2033
- if (typeof l.get == "function") {
2034
- const i = l.get();
2049
+ if (a) {
2050
+ if (typeof a.lib == "function")
2051
+ return l(a), a.loaded || (a.loaded = !0, a.from === o.options.name && (s.loaded = !0)), a.lib;
2052
+ if (typeof a.get == "function") {
2053
+ const i = a.get();
2035
2054
  if (!(i instanceof Promise))
2036
- return a(l), this.setShared({
2055
+ return l(a), this.setShared({
2037
2056
  pkgName: t,
2038
2057
  loaded: !0,
2039
- from: n.options.name,
2058
+ from: o.options.name,
2040
2059
  lib: i,
2041
- shared: l
2060
+ shared: a
2042
2061
  }), i;
2043
2062
  }
2044
2063
  }
@@ -2047,63 +2066,63 @@ class SharedHandler {
2047
2066
  if (s.get) {
2048
2067
  const i = s.get();
2049
2068
  if (i instanceof Promise) {
2050
- const c = (o == null ? void 0 : o.from) === "build" ? RUNTIME_005 : RUNTIME_006;
2069
+ const c = (n == null ? void 0 : n.from) === "build" ? RUNTIME_005 : RUNTIME_006;
2051
2070
  throw new Error(getShortErrorMsg(c, runtimeDescMap, {
2052
- hostName: n.options.name,
2071
+ hostName: o.options.name,
2053
2072
  sharedPkgName: t
2054
2073
  }));
2055
2074
  }
2056
2075
  return s.lib = i, this.setShared({
2057
2076
  pkgName: t,
2058
2077
  loaded: !0,
2059
- from: n.options.name,
2078
+ from: o.options.name,
2060
2079
  lib: s.lib,
2061
2080
  shared: s
2062
2081
  }), s.lib;
2063
2082
  }
2064
2083
  throw new Error(getShortErrorMsg(RUNTIME_006, runtimeDescMap, {
2065
- hostName: n.options.name,
2084
+ hostName: o.options.name,
2066
2085
  sharedPkgName: t
2067
2086
  }));
2068
2087
  }
2069
- initShareScopeMap(t, o, n = {}) {
2088
+ initShareScopeMap(t, n, o = {}) {
2070
2089
  const { host: s } = this;
2071
- this.shareScopeMap[t] = o, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2072
- shareScope: o,
2090
+ this.shareScopeMap[t] = n, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2091
+ shareScope: n,
2073
2092
  options: s.options,
2074
2093
  origin: s,
2075
2094
  scopeName: t,
2076
- hostShareScopeMap: n.hostShareScopeMap
2095
+ hostShareScopeMap: o.hostShareScopeMap
2077
2096
  });
2078
2097
  }
2079
- setShared({ pkgName: t, shared: o, from: n, lib: s, loading: l, loaded: a, get: i }) {
2080
- const { version: c, scope: u = "default" } = o, d = _object_without_properties_loose(o, [
2098
+ setShared({ pkgName: t, shared: n, from: o, lib: s, loading: a, loaded: l, get: i }) {
2099
+ const { version: c, scope: u = "default" } = n, m = _object_without_properties_loose(n, [
2081
2100
  "version",
2082
2101
  "scope"
2083
2102
  ]);
2084
2103
  (Array.isArray(u) ? u : [
2085
2104
  u
2086
- ]).forEach((m) => {
2087
- if (this.shareScopeMap[m] || (this.shareScopeMap[m] = {}), this.shareScopeMap[m][t] || (this.shareScopeMap[m][t] = {}), !this.shareScopeMap[m][t][c]) {
2088
- this.shareScopeMap[m][t][c] = _extends$1({
2105
+ ]).forEach((d) => {
2106
+ if (this.shareScopeMap[d] || (this.shareScopeMap[d] = {}), this.shareScopeMap[d][t] || (this.shareScopeMap[d][t] = {}), !this.shareScopeMap[d][t][c]) {
2107
+ this.shareScopeMap[d][t][c] = _extends$1({
2089
2108
  version: c,
2090
2109
  scope: [
2091
2110
  "default"
2092
2111
  ]
2093
- }, d, {
2112
+ }, m, {
2094
2113
  lib: s,
2095
- loaded: a,
2096
- loading: l
2097
- }), i && (this.shareScopeMap[m][t][c].get = i);
2114
+ loaded: l,
2115
+ loading: a
2116
+ }), i && (this.shareScopeMap[d][t][c].get = i);
2098
2117
  return;
2099
2118
  }
2100
- const y = this.shareScopeMap[m][t][c];
2101
- l && !y.loading && (y.loading = l);
2119
+ const y = this.shareScopeMap[d][t][c];
2120
+ a && !y.loading && (y.loading = a);
2102
2121
  });
2103
2122
  }
2104
2123
  _setGlobalShareScopeMap(t) {
2105
- const o = getGlobalShareScope(), n = t.id || t.name;
2106
- n && !o[n] && (o[n] = this.shareScopeMap);
2124
+ const n = getGlobalShareScope(), o = t.id || t.name;
2125
+ o && !n[o] && (n[o] = this.shareScopeMap);
2107
2126
  }
2108
2127
  constructor(t) {
2109
2128
  this.hooks = new PluginSystem({
@@ -2118,145 +2137,145 @@ class SharedHandler {
2118
2137
  }
2119
2138
  }
2120
2139
  class RemoteHandler {
2121
- formatAndRegisterRemote(t, o) {
2122
- return (o.remotes || []).reduce((s, l) => (this.registerRemote(l, s, {
2140
+ formatAndRegisterRemote(t, n) {
2141
+ return (n.remotes || []).reduce((s, a) => (this.registerRemote(a, s, {
2123
2142
  force: !1
2124
2143
  }), s), t.remotes);
2125
2144
  }
2126
- setIdToRemoteMap(t, o) {
2127
- const { remote: n, expose: s } = o, { name: l, alias: a } = n;
2145
+ setIdToRemoteMap(t, n) {
2146
+ const { remote: o, expose: s } = n, { name: a, alias: l } = o;
2128
2147
  if (this.idToRemoteMap[t] = {
2129
- name: n.name,
2148
+ name: o.name,
2130
2149
  expose: s
2131
- }, a && t.startsWith(l)) {
2132
- const i = t.replace(l, a);
2150
+ }, l && t.startsWith(a)) {
2151
+ const i = t.replace(a, l);
2133
2152
  this.idToRemoteMap[i] = {
2134
- name: n.name,
2153
+ name: o.name,
2135
2154
  expose: s
2136
2155
  };
2137
2156
  return;
2138
2157
  }
2139
- if (a && t.startsWith(a)) {
2140
- const i = t.replace(a, l);
2158
+ if (l && t.startsWith(l)) {
2159
+ const i = t.replace(l, a);
2141
2160
  this.idToRemoteMap[i] = {
2142
- name: n.name,
2161
+ name: o.name,
2143
2162
  expose: s
2144
2163
  };
2145
2164
  }
2146
2165
  }
2147
2166
  // eslint-disable-next-line max-lines-per-function
2148
2167
  // eslint-disable-next-line @typescript-eslint/member-ordering
2149
- async loadRemote(t, o) {
2150
- const { host: n } = this;
2168
+ async loadRemote(t, n) {
2169
+ const { host: o } = this;
2151
2170
  try {
2152
- const { loadFactory: s = !0 } = o || {
2171
+ const { loadFactory: s = !0 } = n || {
2153
2172
  loadFactory: !0
2154
- }, { module: l, moduleOptions: a, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2173
+ }, { module: a, moduleOptions: l, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2155
2174
  id: t
2156
- }), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, y = await l.get(p, d, o, m), _ = await this.hooks.lifecycle.onLoad.emit({
2175
+ }), { pkgNameOrAlias: c, remote: u, expose: m, id: p, remoteSnapshot: d } = i, y = await a.get(p, m, n, d), _ = await this.hooks.lifecycle.onLoad.emit({
2157
2176
  id: p,
2158
2177
  pkgNameOrAlias: c,
2159
- expose: d,
2178
+ expose: m,
2160
2179
  exposeModule: s ? y : void 0,
2161
2180
  exposeModuleFactory: s ? void 0 : y,
2162
2181
  remote: u,
2163
- options: a,
2164
- moduleInstance: l,
2165
- origin: n
2182
+ options: l,
2183
+ moduleInstance: a,
2184
+ origin: o
2166
2185
  });
2167
2186
  return this.setIdToRemoteMap(t, i), typeof _ == "function" ? _ : y;
2168
2187
  } catch (s) {
2169
- const { from: l = "runtime" } = o || {
2188
+ const { from: a = "runtime" } = n || {
2170
2189
  from: "runtime"
2171
- }, a = await this.hooks.lifecycle.errorLoadRemote.emit({
2190
+ }, l = await this.hooks.lifecycle.errorLoadRemote.emit({
2172
2191
  id: t,
2173
2192
  error: s,
2174
- from: l,
2193
+ from: a,
2175
2194
  lifecycle: "onLoad",
2176
- origin: n
2195
+ origin: o
2177
2196
  });
2178
- if (!a)
2197
+ if (!l)
2179
2198
  throw s;
2180
- return a;
2199
+ return l;
2181
2200
  }
2182
2201
  }
2183
2202
  // eslint-disable-next-line @typescript-eslint/member-ordering
2184
2203
  async preloadRemote(t) {
2185
- const { host: o } = this;
2204
+ const { host: n } = this;
2186
2205
  await this.hooks.lifecycle.beforePreloadRemote.emit({
2187
2206
  preloadOps: t,
2188
- options: o.options,
2189
- origin: o
2207
+ options: n.options,
2208
+ origin: n
2190
2209
  });
2191
- const n = formatPreloadArgs(o.options.remotes, t);
2192
- await Promise.all(n.map(async (s) => {
2193
- const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo(l), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2194
- origin: o,
2210
+ const o = formatPreloadArgs(n.options.remotes, t);
2211
+ await Promise.all(o.map(async (s) => {
2212
+ const { remote: a } = s, l = getRemoteInfo(a), { globalSnapshot: i, remoteSnapshot: c } = await n.snapshotHandler.loadRemoteSnapshotInfo(a), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2213
+ origin: n,
2195
2214
  preloadOptions: s,
2196
- remote: l,
2197
- remoteInfo: a,
2215
+ remote: a,
2216
+ remoteInfo: l,
2198
2217
  globalSnapshot: i,
2199
2218
  remoteSnapshot: c
2200
2219
  });
2201
- u && preloadAssets(a, o, u);
2220
+ u && preloadAssets(l, n, u);
2202
2221
  }));
2203
2222
  }
2204
- registerRemotes(t, o) {
2205
- const { host: n } = this;
2223
+ registerRemotes(t, n) {
2224
+ const { host: o } = this;
2206
2225
  t.forEach((s) => {
2207
- this.registerRemote(s, n.options.remotes, {
2208
- force: o == null ? void 0 : o.force
2226
+ this.registerRemote(s, o.options.remotes, {
2227
+ force: n == null ? void 0 : n.force
2209
2228
  });
2210
2229
  });
2211
2230
  }
2212
2231
  async getRemoteModuleAndOptions(t) {
2213
- const { host: o } = this, { id: n } = t;
2232
+ const { host: n } = this, { id: o } = t;
2214
2233
  let s;
2215
2234
  try {
2216
2235
  s = await this.hooks.lifecycle.beforeRequest.emit({
2217
- id: n,
2218
- options: o.options,
2219
- origin: o
2236
+ id: o,
2237
+ options: n.options,
2238
+ origin: n
2220
2239
  });
2221
2240
  } catch (_) {
2222
2241
  if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
2223
- id: n,
2224
- options: o.options,
2225
- origin: o,
2242
+ id: o,
2243
+ options: n.options,
2244
+ origin: n,
2226
2245
  from: "runtime",
2227
2246
  error: _,
2228
2247
  lifecycle: "beforeRequest"
2229
2248
  }), !s)
2230
2249
  throw _;
2231
2250
  }
2232
- const { id: l } = s, a = matchRemoteWithNameAndExpose(o.options.remotes, l);
2233
- assert(a, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
2234
- hostName: o.options.name,
2235
- requestId: l
2251
+ const { id: a } = s, l = matchRemoteWithNameAndExpose(n.options.remotes, a);
2252
+ assert(l, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
2253
+ hostName: n.options.name,
2254
+ requestId: a
2236
2255
  }));
2237
- const { remote: i } = a, c = getRemoteInfo(i), u = await o.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2238
- id: l
2239
- }, a, {
2240
- options: o.options,
2241
- origin: o,
2256
+ const { remote: i } = l, c = getRemoteInfo(i), u = await n.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2257
+ id: a
2258
+ }, l, {
2259
+ options: n.options,
2260
+ origin: n,
2242
2261
  remoteInfo: c
2243
- })), { remote: d, expose: p } = u;
2244
- assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);
2245
- let m = o.moduleCache.get(d.name);
2262
+ })), { remote: m, expose: p } = u;
2263
+ assert(m && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2264
+ let d = n.moduleCache.get(m.name);
2246
2265
  const y = {
2247
- host: o,
2266
+ host: n,
2248
2267
  remoteInfo: c
2249
2268
  };
2250
- return m || (m = new Module(y), o.moduleCache.set(d.name, m)), {
2251
- module: m,
2269
+ return d || (d = new Module(y), n.moduleCache.set(m.name, d)), {
2270
+ module: d,
2252
2271
  moduleOptions: y,
2253
2272
  remoteMatchInfo: u
2254
2273
  };
2255
2274
  }
2256
- registerRemote(t, o, n) {
2257
- const { host: s } = this, l = () => {
2275
+ registerRemote(t, n, o) {
2276
+ const { host: s } = this, a = () => {
2258
2277
  if (t.alias) {
2259
- const i = o.find((c) => {
2278
+ const i = n.find((c) => {
2260
2279
  var u;
2261
2280
  return t.alias && (c.name.startsWith(t.alias) || ((u = c.alias) == null ? void 0 : u.startsWith(t.alias)));
2262
2281
  });
@@ -2268,9 +2287,9 @@ class RemoteHandler {
2268
2287
  remote: t,
2269
2288
  origin: s
2270
2289
  });
2271
- const a = o.find((i) => i.name === t.name);
2272
- if (!a)
2273
- l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2290
+ const l = n.find((i) => i.name === t.name);
2291
+ if (!l)
2292
+ a(), n.push(t), this.hooks.lifecycle.registerRemote.emit({
2274
2293
  remote: t,
2275
2294
  origin: s
2276
2295
  });
@@ -2279,7 +2298,7 @@ class RemoteHandler {
2279
2298
  `The remote "${t.name}" is already registered.`,
2280
2299
  "Please note that overriding it may cause unexpected errors."
2281
2300
  ];
2282
- n != null && n.force && (this.removeRemote(a), l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2301
+ o != null && o.force && (this.removeRemote(l), a(), n.push(t), this.hooks.lifecycle.registerRemote.emit({
2283
2302
  remote: t,
2284
2303
  origin: s
2285
2304
  }), warn$1(i.join(" ")));
@@ -2287,61 +2306,61 @@ class RemoteHandler {
2287
2306
  }
2288
2307
  removeRemote(t) {
2289
2308
  try {
2290
- const { host: n } = this, { name: s } = t, l = n.options.remotes.findIndex((i) => i.name === s);
2291
- l !== -1 && n.options.remotes.splice(l, 1);
2292
- const a = n.moduleCache.get(t.name);
2293
- if (a) {
2294
- const i = a.remoteInfo, c = i.entryGlobalName;
2309
+ const { host: o } = this, { name: s } = t, a = o.options.remotes.findIndex((i) => i.name === s);
2310
+ a !== -1 && o.options.remotes.splice(a, 1);
2311
+ const l = o.moduleCache.get(t.name);
2312
+ if (l) {
2313
+ const i = l.remoteInfo, c = i.entryGlobalName;
2295
2314
  if (CurrentGlobal[c]) {
2296
- var o;
2297
- (o = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && o.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2315
+ var n;
2316
+ (n = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && n.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2298
2317
  }
2299
- const u = getRemoteEntryUniqueKey(a.remoteInfo);
2300
- globalLoading[u] && delete globalLoading[u], n.snapshotHandler.manifestCache.delete(i.entry);
2301
- let d = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2302
- const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === d : y.name === d);
2318
+ const u = getRemoteEntryUniqueKey(l.remoteInfo);
2319
+ globalLoading[u] && delete globalLoading[u], o.snapshotHandler.manifestCache.delete(i.entry);
2320
+ let m = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2321
+ const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === m : y.name === m);
2303
2322
  if (p !== -1) {
2304
2323
  const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
2305
- d = y.options.id || d;
2324
+ m = y.options.id || m;
2306
2325
  const _ = getGlobalShareScope();
2307
- let R = !0;
2326
+ let E = !0;
2308
2327
  const g = [];
2309
- Object.keys(_).forEach((E) => {
2310
- const I = _[E];
2311
- I && Object.keys(I).forEach((v) => {
2312
- const S = I[v];
2313
- S && Object.keys(S).forEach((b) => {
2314
- const $ = S[b];
2315
- $ && Object.keys($).forEach((A) => {
2316
- const O = $[A];
2317
- O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? R = !1 : g.push([
2318
- E,
2319
- v,
2328
+ Object.keys(_).forEach((b) => {
2329
+ const S = _[b];
2330
+ S && Object.keys(S).forEach((I) => {
2331
+ const v = S[I];
2332
+ v && Object.keys(v).forEach((R) => {
2333
+ const $ = v[R];
2334
+ $ && Object.keys($).forEach((w) => {
2335
+ const O = $[w];
2336
+ O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? E = !1 : g.push([
2320
2337
  b,
2321
- A
2338
+ I,
2339
+ R,
2340
+ w
2322
2341
  ])) : g.push([
2323
- E,
2324
- v,
2325
2342
  b,
2326
- A
2343
+ I,
2344
+ R,
2345
+ w
2327
2346
  ]));
2328
2347
  });
2329
2348
  });
2330
2349
  });
2331
- }), R && (y.shareScopeMap = {}, delete _[d]), g.forEach(([E, I, v, S]) => {
2332
- var b, $, A;
2333
- (A = _[E]) == null || ($ = A[I]) == null || (b = $[v]) == null || delete b[S];
2350
+ }), E && (y.shareScopeMap = {}, delete _[m]), g.forEach(([b, S, I, v]) => {
2351
+ var R, $, w;
2352
+ (w = _[b]) == null || ($ = w[S]) == null || (R = $[I]) == null || delete R[v];
2334
2353
  }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
2335
2354
  }
2336
- const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, n);
2337
- if (m) {
2338
- const y = m && "remotesInfo" in m && m.remotesInfo && getInfoWithoutType(m.remotesInfo, t.name).key;
2339
- y && (delete m.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2355
+ const { hostGlobalSnapshot: d } = getGlobalRemoteInfo(t, o);
2356
+ if (d) {
2357
+ const y = d && "remotesInfo" in d && d.remotesInfo && getInfoWithoutType(d.remotesInfo, t.name).key;
2358
+ y && (delete d.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2340
2359
  }
2341
- n.moduleCache.delete(t.name);
2360
+ o.moduleCache.delete(t.name);
2342
2361
  }
2343
- } catch (n) {
2344
- logger.log("removeRemote fail: ", n);
2362
+ } catch (o) {
2363
+ logger.log("removeRemote fail: ", o);
2345
2364
  }
2346
2365
  }
2347
2366
  constructor(t) {
@@ -2363,59 +2382,59 @@ class RemoteHandler {
2363
2382
  class FederationHost {
2364
2383
  initOptions(t) {
2365
2384
  this.registerPlugins(t.plugins);
2366
- const o = this.formatOptions(this.options, t);
2367
- return this.options = o, o;
2385
+ const n = this.formatOptions(this.options, t);
2386
+ return this.options = n, n;
2368
2387
  }
2369
- async loadShare(t, o) {
2370
- return this.sharedHandler.loadShare(t, o);
2388
+ async loadShare(t, n) {
2389
+ return this.sharedHandler.loadShare(t, n);
2371
2390
  }
2372
2391
  // The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
2373
2392
  // 1. If the loaded shared already exists globally, then it will be reused
2374
2393
  // 2. If lib exists in local shared, it will be used directly
2375
2394
  // 3. If the local get returns something other than Promise, then it will be used directly
2376
- loadShareSync(t, o) {
2377
- return this.sharedHandler.loadShareSync(t, o);
2395
+ loadShareSync(t, n) {
2396
+ return this.sharedHandler.loadShareSync(t, n);
2378
2397
  }
2379
- initializeSharing(t = DEFAULT_SCOPE, o) {
2380
- return this.sharedHandler.initializeSharing(t, o);
2398
+ initializeSharing(t = DEFAULT_SCOPE, n) {
2399
+ return this.sharedHandler.initializeSharing(t, n);
2381
2400
  }
2382
- initRawContainer(t, o, n) {
2401
+ initRawContainer(t, n, o) {
2383
2402
  const s = getRemoteInfo({
2384
2403
  name: t,
2385
- entry: o
2386
- }), l = new Module({
2404
+ entry: n
2405
+ }), a = new Module({
2387
2406
  host: this,
2388
2407
  remoteInfo: s
2389
2408
  });
2390
- return l.remoteEntryExports = n, this.moduleCache.set(t, l), l;
2409
+ return a.remoteEntryExports = o, this.moduleCache.set(t, a), a;
2391
2410
  }
2392
2411
  // eslint-disable-next-line max-lines-per-function
2393
2412
  // eslint-disable-next-line @typescript-eslint/member-ordering
2394
- async loadRemote(t, o) {
2395
- return this.remoteHandler.loadRemote(t, o);
2413
+ async loadRemote(t, n) {
2414
+ return this.remoteHandler.loadRemote(t, n);
2396
2415
  }
2397
2416
  // eslint-disable-next-line @typescript-eslint/member-ordering
2398
2417
  async preloadRemote(t) {
2399
2418
  return this.remoteHandler.preloadRemote(t);
2400
2419
  }
2401
- initShareScopeMap(t, o, n = {}) {
2402
- this.sharedHandler.initShareScopeMap(t, o, n);
2420
+ initShareScopeMap(t, n, o = {}) {
2421
+ this.sharedHandler.initShareScopeMap(t, n, o);
2403
2422
  }
2404
- formatOptions(t, o) {
2405
- const { shared: n } = formatShareConfigs(t, o), { userOptions: s, options: l } = this.hooks.lifecycle.beforeInit.emit({
2423
+ formatOptions(t, n) {
2424
+ const { shared: o } = formatShareConfigs(t, n), { userOptions: s, options: a } = this.hooks.lifecycle.beforeInit.emit({
2406
2425
  origin: this,
2407
- userOptions: o,
2426
+ userOptions: n,
2408
2427
  options: t,
2409
- shareInfo: n
2410
- }), a = this.remoteHandler.formatAndRegisterRemote(l, s), { shared: i } = this.sharedHandler.registerShared(l, s), c = [
2411
- ...l.plugins
2428
+ shareInfo: o
2429
+ }), l = this.remoteHandler.formatAndRegisterRemote(a, s), { shared: i } = this.sharedHandler.registerShared(a, s), c = [
2430
+ ...a.plugins
2412
2431
  ];
2413
- s.plugins && s.plugins.forEach((d) => {
2414
- c.includes(d) || c.push(d);
2432
+ s.plugins && s.plugins.forEach((m) => {
2433
+ c.includes(m) || c.push(m);
2415
2434
  });
2416
- const u = _extends$1({}, t, o, {
2435
+ const u = _extends$1({}, t, n, {
2417
2436
  plugins: c,
2418
- remotes: a,
2437
+ remotes: l,
2419
2438
  shared: i
2420
2439
  });
2421
2440
  return this.hooks.lifecycle.init.emit({
@@ -2424,7 +2443,7 @@ class FederationHost {
2424
2443
  }), u;
2425
2444
  }
2426
2445
  registerPlugins(t) {
2427
- const o = registerPlugins$1(t, [
2446
+ const n = registerPlugins$1(t, [
2428
2447
  this.hooks,
2429
2448
  this.remoteHandler.hooks,
2430
2449
  this.sharedHandler.hooks,
@@ -2432,10 +2451,10 @@ class FederationHost {
2432
2451
  this.loaderHook,
2433
2452
  this.bridgeHook
2434
2453
  ]);
2435
- this.options.plugins = this.options.plugins.reduce((n, s) => (s && n && !n.find((l) => l.name === s.name) && n.push(s), n), o || []);
2454
+ this.options.plugins = this.options.plugins.reduce((o, s) => (s && o && !o.find((a) => a.name === s.name) && o.push(s), o), n || []);
2436
2455
  }
2437
- registerRemotes(t, o) {
2438
- return this.remoteHandler.registerRemotes(t, o);
2456
+ registerRemotes(t, n) {
2457
+ return this.remoteHandler.registerRemotes(t, n);
2439
2458
  }
2440
2459
  constructor(t) {
2441
2460
  this.hooks = new PluginSystem({
@@ -2445,7 +2464,7 @@ class FederationHost {
2445
2464
  beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
2446
2465
  // maybe will change, temporarily for internal use only
2447
2466
  initContainer: new AsyncWaterfallHook("initContainer")
2448
- }), this.version = "0.8.4", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2467
+ }), this.version = "0.8.6", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2449
2468
  // FIXME: may not be suitable , not open to the public yet
2450
2469
  getModuleInfo: new SyncHook(),
2451
2470
  createScript: new SyncHook(),
@@ -2459,7 +2478,7 @@ class FederationHost {
2459
2478
  beforeBridgeDestroy: new SyncHook(),
2460
2479
  afterBridgeDestroy: new SyncHook()
2461
2480
  });
2462
- const o = {
2481
+ const n = {
2463
2482
  id: getBuilderId(),
2464
2483
  name: t.name,
2465
2484
  plugins: [
@@ -2470,41 +2489,49 @@ class FederationHost {
2470
2489
  shared: {},
2471
2490
  inBrowser: isBrowserEnv()
2472
2491
  };
2473
- this.name = t.name, this.options = o, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2474
- ...o.plugins,
2492
+ this.name = t.name, this.options = n, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2493
+ ...n.plugins,
2475
2494
  ...t.plugins || []
2476
- ]), this.options = this.formatOptions(o, t);
2495
+ ]), this.options = this.formatOptions(n, t);
2477
2496
  }
2478
2497
  }
2498
+ let FederationInstance = null;
2499
+ function getInstance() {
2500
+ return FederationInstance;
2501
+ }
2479
2502
  setGlobalFederationConstructor(FederationHost);
2480
2503
  function createBridgeComponent(r) {
2481
- const t = /* @__PURE__ */ new Map();
2504
+ const t = /* @__PURE__ */ new Map(), n = getInstance();
2482
2505
  return () => ({
2483
- __APP_VERSION__: "0.8.4",
2484
- render(o) {
2485
- LoggerInstance.log("createBridgeComponent render Info", o);
2486
- const n = Vue.createApp(r.rootComponent);
2487
- t.set(o.dom, n);
2488
- const s = {}, l = s && typeof s == "object" && (s != null && s.extraProps) ? s == null ? void 0 : s.extraProps : {}, a = r.appOptions({
2506
+ __APP_VERSION__: "0.8.6",
2507
+ async render(o) {
2508
+ var c, u, m;
2509
+ LoggerInstance.debug("createBridgeComponent render Info", o);
2510
+ const s = Vue.createApp(r.rootComponent);
2511
+ t.set(o.dom, s);
2512
+ const a = await ((m = (u = (c = n == null ? void 0 : n.bridgeHook) == null ? void 0 : c.lifecycle) == null ? void 0 : u.beforeBridgeRender) == null ? void 0 : m.emit(o)), l = a && typeof a == "object" && (a != null && a.extraProps) ? a == null ? void 0 : a.extraProps : {}, i = r.appOptions({
2513
+ app: s,
2489
2514
  basename: o.basename,
2490
2515
  memoryRoute: o.memoryRoute,
2491
2516
  ...l
2492
- }), i = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), c = VueRouter.createRouter({
2493
- ...a.router.options,
2494
- history: i,
2495
- routes: a.router.getRoutes()
2496
2517
  });
2497
- LoggerInstance.log("createBridgeComponent render router info>>>", {
2498
- name: o.moduleName,
2499
- router: c
2500
- }), o.memoryRoute ? c.push(o.memoryRoute.entryPath).then(() => {
2501
- n.use(c), n.mount(o.dom);
2502
- }) : (n.use(c), n.mount(o.dom));
2518
+ if (i != null && i.router) {
2519
+ const p = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), d = VueRouter.createRouter({
2520
+ ...i.router.options,
2521
+ history: p,
2522
+ routes: i.router.getRoutes()
2523
+ });
2524
+ LoggerInstance.log("createBridgeComponent render router info>>>", {
2525
+ name: o.moduleName,
2526
+ router: d
2527
+ }), o.memoryRoute && await d.push(o.memoryRoute.entryPath), s.use(d);
2528
+ }
2529
+ s.mount(o.dom);
2503
2530
  },
2504
2531
  destroy(o) {
2505
- LoggerInstance.log("createBridgeComponent destroy Info", o);
2506
- const n = t.get(o == null ? void 0 : o.dom);
2507
- n == null || n.unmount();
2532
+ LoggerInstance.debug("createBridgeComponent destroy Info", o);
2533
+ const s = t.get(o == null ? void 0 : o.dom);
2534
+ s == null || s.unmount();
2508
2535
  }
2509
2536
  });
2510
2537
  }
@@ -2521,33 +2548,33 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2521
2548
  providerInfo: Function
2522
2549
  },
2523
2550
  setup(r) {
2524
- const t = ref(null), o = ref(null), n = ref(""), s = useRoute(), l = () => {
2525
- var d;
2526
- const i = (d = r.providerInfo) == null ? void 0 : d.call(r);
2527
- o.value = i;
2551
+ const t = ref(null), n = ref(null), o = ref(""), s = useRoute(), a = () => {
2552
+ var m;
2553
+ const i = (m = r.providerInfo) == null ? void 0 : m.call(r);
2554
+ n.value = i;
2528
2555
  let c = {
2529
2556
  name: r.moduleName,
2530
2557
  dom: t.value,
2531
2558
  basename: r.basename,
2532
2559
  memoryRoute: r.memoryRoute
2533
2560
  };
2534
- LoggerInstance.log("createRemoteComponent LazyComponent render >>>", c), c = {
2561
+ LoggerInstance.debug("createRemoteComponent LazyComponent render >>>", c), c = {
2535
2562
  ...c,
2536
2563
  ...{}.extraProps
2537
2564
  }, i.render(c);
2538
- }, a = watch(() => s.path, (i) => {
2539
- i !== s.path && l(), n.value !== "" && n.value !== i && (LoggerInstance.log("createRemoteComponent dispatchPopstateEnv >>>", {
2565
+ }, l = watch(() => s.path, (i) => {
2566
+ i !== s.path && a(), o.value !== "" && o.value !== i && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2540
2567
  ...r,
2541
2568
  pathname: s.path
2542
- }), e()), n.value = i;
2569
+ }), e()), o.value = i;
2543
2570
  });
2544
2571
  return onMounted(() => {
2545
- l();
2572
+ a();
2546
2573
  }), onBeforeUnmount(() => {
2547
2574
  var i;
2548
- LoggerInstance.log("createRemoteComponent LazyComponent destroy >>>", {
2575
+ LoggerInstance.debug("createRemoteComponent LazyComponent destroy >>>", {
2549
2576
  ...r
2550
- }), a(), (i = o.value) == null || i.destroy({
2577
+ }), l(), (i = n.value) == null || i.destroy({
2551
2578
  dom: t.value
2552
2579
  });
2553
2580
  }), () => createVNode("div", {
@@ -2557,31 +2584,31 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2557
2584
  });
2558
2585
  function createRemoteComponent(r) {
2559
2586
  return defineAsyncComponent({
2560
- __APP_VERSION__: "0.8.4",
2587
+ __APP_VERSION__: "0.8.6",
2561
2588
  ...r.asyncComponentOptions,
2562
2589
  //@ts-ignore
2563
2590
  loader: async () => {
2564
2591
  var c;
2565
2592
  const t = useRoute();
2566
- let o = "/";
2567
- const n = (c = t.matched[0]) == null ? void 0 : c.path;
2568
- n && (n.endsWith("/:pathMatch(.*)*") ? o = n.replace("/:pathMatch(.*)*", "") : o = t.matched[0].path);
2593
+ let n = "/";
2594
+ const o = (c = t.matched[0]) == null ? void 0 : c.path;
2595
+ o && (o.endsWith("/:pathMatch(.*)*") ? n = o.replace("/:pathMatch(.*)*", "") : n = t.matched[0].path);
2569
2596
  const s = (r == null ? void 0 : r.export) || "default";
2570
- LoggerInstance.log("createRemoteComponent LazyComponent create >>>", {
2571
- basename: o,
2597
+ LoggerInstance.debug("createRemoteComponent LazyComponent create >>>", {
2598
+ basename: n,
2572
2599
  info: r
2573
2600
  });
2574
- const l = await r.loader(), a = l && l[Symbol.for("mf_module_id")], i = l[s];
2575
- if (LoggerInstance.log(
2601
+ const a = await r.loader(), l = a && a[Symbol.for("mf_module_id")], i = a[s];
2602
+ if (LoggerInstance.debug(
2576
2603
  "createRemoteComponent LazyComponent loadRemote info >>>",
2577
- { name: a, module: l, exportName: s, basename: o, route: t }
2578
- ), s in l && typeof i == "function")
2604
+ { name: l, module: a, exportName: s, basename: n, route: t }
2605
+ ), s in a && typeof i == "function")
2579
2606
  return {
2580
2607
  render() {
2581
2608
  return h(RemoteApp, {
2582
- moduleName: a,
2609
+ moduleName: l,
2583
2610
  providerInfo: i,
2584
- basename: o
2611
+ basename: n
2585
2612
  });
2586
2613
  }
2587
2614
  };