@module-federation/bridge-vue3 0.0.0-next-20250526033636 → 0.0.0-next-20250526062606

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.js CHANGED
@@ -4,14 +4,14 @@ import * as VueRouter from "vue-router";
4
4
  import { useRoute } from "vue-router";
5
5
  function _extends$2() {
6
6
  return _extends$2 = Object.assign || function(t) {
7
- for (var o = 1; o < arguments.length; o++) {
8
- var r = arguments[o];
9
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
7
+ for (var r = 1; r < arguments.length; r++) {
8
+ var o = arguments[r];
9
+ for (var s in o) Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
10
10
  }
11
11
  return t;
12
12
  }, _extends$2.apply(this, arguments);
13
13
  }
14
- const MANIFEST_EXT = ".json", BROWSER_LOG_KEY = "FEDERATION_DEBUG", SEPARATOR = ":";
14
+ const MANIFEST_EXT = ".json", BROWSER_LOG_KEY = "FEDERATION_DEBUG", BROWSER_LOG_VALUE = "1", SEPARATOR = ":";
15
15
  function isBrowserEnv() {
16
16
  return typeof window < "u" && typeof window.document < "u";
17
17
  }
@@ -22,7 +22,7 @@ function isReactNativeEnv() {
22
22
  function isBrowserDebug() {
23
23
  try {
24
24
  if (isBrowserEnv() && window.localStorage)
25
- return !!localStorage.getItem(BROWSER_LOG_KEY);
25
+ return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE;
26
26
  } catch {
27
27
  return !1;
28
28
  }
@@ -32,11 +32,11 @@ function isDebugMode() {
32
32
  return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : isBrowserDebug();
33
33
  }
34
34
  const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...n) {
35
- return n.length ? n.reduce((t, o) => o ? t ? `${t}${SEPARATOR}${o}` : o : t, "") : "";
35
+ return n.length ? n.reduce((t, r) => r ? t ? `${t}${SEPARATOR}${r}` : r : t, "") : "";
36
36
  }, getResourceUrl = (n, t) => {
37
37
  if ("getPublicPath" in n) {
38
- let o;
39
- return n.getPublicPath.startsWith("function") ? o = new Function("return " + n.getPublicPath)()() : o = new Function(n.getPublicPath)(), `${o}${t}`;
38
+ let r;
39
+ return n.getPublicPath.startsWith("function") ? r = new Function("return " + n.getPublicPath)()() : r = new Function(n.getPublicPath)(), `${r}${t}`;
40
40
  } else return "publicPath" in n ? !isBrowserEnv() && !isReactNativeEnv() && "ssrPublicPath" in n ? `${n.ssrPublicPath}${t}` : `${n.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", n, t), "");
41
41
  }, warn$1 = (n) => {
42
42
  console.warn(`${LOG_CATEGORY$1}: ${n}`);
@@ -51,75 +51,82 @@ function safeToString(n) {
51
51
  const simpleJoinRemoteEntry = (n, t) => {
52
52
  if (!n)
53
53
  return t;
54
- const r = ((s) => {
54
+ const o = ((s) => {
55
55
  if (s === ".")
56
56
  return "";
57
57
  if (s.startsWith("./"))
58
58
  return s.replace("./", "");
59
59
  if (s.startsWith("/")) {
60
- const a = s.slice(1);
61
- return a.endsWith("/") ? a.slice(0, -1) : a;
60
+ const l = s.slice(1);
61
+ return l.endsWith("/") ? l.slice(0, -1) : l;
62
62
  }
63
63
  return s;
64
64
  })(n);
65
- return r ? r.endsWith("/") ? `${r}${t}` : `${r}/${t}` : t;
65
+ return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
66
66
  };
67
67
  function inferAutoPublicPath(n) {
68
68
  return n.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
69
69
  }
70
70
  function generateSnapshotFromManifest(n, t = {}) {
71
- var o, r;
72
- const { remotes: s = {}, overrides: a = {}, version: l } = t;
71
+ var r, o;
72
+ const { remotes: s = {}, overrides: l = {}, version: a } = t;
73
73
  let i;
74
- const c = () => "publicPath" in n.metaData ? n.metaData.publicPath === "auto" && l ? inferAutoPublicPath(l) : n.metaData.publicPath : n.metaData.getPublicPath, u = Object.keys(a);
74
+ const c = () => "publicPath" in n.metaData ? n.metaData.publicPath === "auto" && a ? inferAutoPublicPath(a) : n.metaData.publicPath : n.metaData.getPublicPath, u = Object.keys(l);
75
75
  let d = {};
76
76
  if (!Object.keys(s).length) {
77
77
  var p;
78
- d = ((p = n.remotes) == null ? void 0 : p.reduce((R, A) => {
79
- let T;
80
- const $ = A.federationContainerName;
81
- return u.includes($) ? T = a[$] : "version" in A ? T = A.version : T = A.entry, R[$] = {
82
- matchedVersion: T
83
- }, R;
78
+ d = ((p = n.remotes) == null ? void 0 : p.reduce((g, A) => {
79
+ let $;
80
+ const T = A.federationContainerName;
81
+ return u.includes(T) ? $ = l[T] : "version" in A ? $ = A.version : $ = A.entry, g[T] = {
82
+ matchedVersion: $
83
+ }, g;
84
84
  }, {})) || {};
85
85
  }
86
- Object.keys(s).forEach((R) => d[R] = {
87
- // overrides will override dependencies
88
- matchedVersion: u.includes(R) ? a[R] : s[R]
86
+ Object.keys(s).forEach((g) => {
87
+ var A, $;
88
+ return d[g] = typeof s[g] == "string" ? {
89
+ // overrides will override dependencies
90
+ matchedVersion: u.includes(g) ? l[g] : s[g]
91
+ } : typeof s[g] == "object" ? _extends$2({}, s[g], {
92
+ matchedVersion: u.includes(g) ? l[g] : ((A = s[g]) == null ? void 0 : A.version) || (($ = s[g]) == null ? void 0 : $.entry)
93
+ }) : {
94
+ matchedVersion: "*"
95
+ };
89
96
  });
90
- const { remoteEntry: { path: m, name: y, type: E }, types: g, buildInfo: { buildVersion: _ }, globalName: b, ssrRemoteEntry: v } = n.metaData, { exposes: S } = n;
97
+ const { remoteEntry: { path: m, name: y, type: E }, types: R, buildInfo: { buildVersion: _ }, globalName: b, ssrRemoteEntry: v } = n.metaData, { exposes: S } = n;
91
98
  let I = {
92
- version: l || "",
99
+ version: a || "",
93
100
  buildVersion: _,
94
101
  globalName: b,
95
102
  remoteEntry: simpleJoinRemoteEntry(m, y),
96
103
  remoteEntryType: E,
97
- remoteTypes: simpleJoinRemoteEntry(g.path, g.name),
98
- remoteTypesZip: g.zip || "",
99
- remoteTypesAPI: g.api || "",
104
+ remoteTypes: simpleJoinRemoteEntry(R.path, R.name),
105
+ remoteTypesZip: R.zip || "",
106
+ remoteTypesAPI: R.api || "",
100
107
  remotesInfo: d,
101
- shared: n == null ? void 0 : n.shared.map((R) => ({
102
- assets: R.assets,
103
- sharedName: R.name,
104
- version: R.version
108
+ shared: n == null ? void 0 : n.shared.map((g) => ({
109
+ assets: g.assets,
110
+ sharedName: g.name,
111
+ version: g.version
105
112
  })),
106
- modules: S == null ? void 0 : S.map((R) => ({
107
- moduleName: R.name,
108
- modulePath: R.path,
109
- assets: R.assets
113
+ modules: S == null ? void 0 : S.map((g) => ({
114
+ moduleName: g.name,
115
+ modulePath: g.path,
116
+ assets: g.assets
110
117
  }))
111
118
  };
112
- if ((o = n.metaData) != null && o.prefetchInterface) {
113
- const R = n.metaData.prefetchInterface;
119
+ if ((r = n.metaData) != null && r.prefetchInterface) {
120
+ const g = n.metaData.prefetchInterface;
114
121
  I = _extends$2({}, I, {
115
- prefetchInterface: R
122
+ prefetchInterface: g
116
123
  });
117
124
  }
118
- if ((r = n.metaData) != null && r.prefetchEntry) {
119
- const { path: R, name: A, type: T } = n.metaData.prefetchEntry;
125
+ if ((o = n.metaData) != null && o.prefetchEntry) {
126
+ const { path: g, name: A, type: $ } = n.metaData.prefetchEntry;
120
127
  I = _extends$2({}, I, {
121
- prefetchEntry: simpleJoinRemoteEntry(R, A),
122
- prefetchEntryType: T
128
+ prefetchEntry: simpleJoinRemoteEntry(g, A),
129
+ prefetchEntryType: $
123
130
  });
124
131
  }
125
132
  if ("publicPath" in n.metaData ? i = _extends$2({}, I, {
@@ -128,8 +135,8 @@ function generateSnapshotFromManifest(n, t = {}) {
128
135
  }) : i = _extends$2({}, I, {
129
136
  getPublicPath: c()
130
137
  }), v) {
131
- const R = simpleJoinRemoteEntry(v.path, v.name);
132
- i.ssrRemoteEntry = R, i.ssrRemoteEntryType = v.type || "commonjs-module";
138
+ const g = simpleJoinRemoteEntry(v.path, v.name);
139
+ i.ssrRemoteEntry = g, i.ssrRemoteEntryType = v.type || "commonjs-module";
133
140
  }
134
141
  return i;
135
142
  }
@@ -171,22 +178,22 @@ function createLogger(n) {
171
178
  async function safeWrapper(n, t) {
172
179
  try {
173
180
  return await n();
174
- } catch (o) {
175
- warn$1(o);
181
+ } catch (r) {
182
+ warn$1(r);
176
183
  return;
177
184
  }
178
185
  }
179
186
  function isStaticResourcesEqual(n, t) {
180
- const o = /^(https?:)?\/\//i, r = n.replace(o, "").replace(/\/$/, ""), s = t.replace(o, "").replace(/\/$/, "");
181
- return r === s;
187
+ const r = /^(https?:)?\/\//i, o = n.replace(r, "").replace(/\/$/, ""), s = t.replace(r, "").replace(/\/$/, "");
188
+ return o === s;
182
189
  }
183
190
  function createScript(n) {
184
- let t = null, o = !0, r = 2e4, s;
185
- const a = document.getElementsByTagName("script");
186
- for (let i = 0; i < a.length; i++) {
187
- const c = a[i], u = c.getAttribute("src");
191
+ let t = null, r = !0, o = 2e4, s;
192
+ const l = document.getElementsByTagName("script");
193
+ for (let i = 0; i < l.length; i++) {
194
+ const c = l[i], u = c.getAttribute("src");
188
195
  if (u && isStaticResourcesEqual(u, n.url)) {
189
- t = c, o = !1;
196
+ t = c, r = !1;
190
197
  break;
191
198
  }
192
199
  }
@@ -194,11 +201,11 @@ function createScript(n) {
194
201
  const i = n.attrs;
195
202
  t = document.createElement("script"), t.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
196
203
  let c;
197
- n.createScriptHook && (c = n.createScriptHook(n.url, n.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (r = c.timeout))), t.src || (t.src = n.url), i && !c && Object.keys(i).forEach((u) => {
204
+ n.createScriptHook && (c = n.createScriptHook(n.url, n.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 = n.url), i && !c && Object.keys(i).forEach((u) => {
198
205
  t && (u === "async" || u === "defer" ? t[u] = i[u] : t.getAttribute(u) || t.setAttribute(u, i[u]));
199
206
  });
200
207
  }
201
- const l = async (i, c) => {
208
+ const a = async (i, c) => {
202
209
  clearTimeout(s);
203
210
  const u = () => {
204
211
  (c == null ? void 0 : c.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(c)) : n != null && n.cb && (n == null || n.cb());
@@ -216,77 +223,77 @@ function createScript(n) {
216
223
  }
217
224
  u();
218
225
  };
219
- return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), s = setTimeout(() => {
220
- l(null, new Error(`Remote script "${n.url}" time-outed.`));
221
- }, r), {
226
+ return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), s = setTimeout(() => {
227
+ a(null, new Error(`Remote script "${n.url}" time-outed.`));
228
+ }, o), {
222
229
  script: t,
223
- needAttach: o
230
+ needAttach: r
224
231
  };
225
232
  }
226
233
  function createLink(n) {
227
- let t = null, o = !0;
228
- const r = document.getElementsByTagName("link");
229
- for (let a = 0; a < r.length; a++) {
230
- const l = r[a], i = l.getAttribute("href"), c = l.getAttribute("rel");
234
+ let t = null, r = !0;
235
+ const o = document.getElementsByTagName("link");
236
+ for (let l = 0; l < o.length; l++) {
237
+ const a = o[l], i = a.getAttribute("href"), c = a.getAttribute("rel");
231
238
  if (i && isStaticResourcesEqual(i, n.url) && c === n.attrs.rel) {
232
- t = l, o = !1;
239
+ t = a, r = !1;
233
240
  break;
234
241
  }
235
242
  }
236
243
  if (!t) {
237
244
  t = document.createElement("link"), t.setAttribute("href", n.url);
238
- let a;
239
- const l = n.attrs;
240
- n.createLinkHook && (a = n.createLinkHook(n.url, l), a instanceof HTMLLinkElement && (t = a)), l && !a && Object.keys(l).forEach((i) => {
241
- t && !t.getAttribute(i) && t.setAttribute(i, l[i]);
245
+ let l;
246
+ const a = n.attrs;
247
+ n.createLinkHook && (l = n.createLinkHook(n.url, a), l instanceof HTMLLinkElement && (t = l)), a && !l && Object.keys(a).forEach((i) => {
248
+ t && !t.getAttribute(i) && t.setAttribute(i, a[i]);
242
249
  });
243
250
  }
244
- const s = (a, l) => {
251
+ const s = (l, a) => {
245
252
  const i = () => {
246
- (l == null ? void 0 : l.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(l)) : n != null && n.cb && (n == null || n.cb());
253
+ (a == null ? void 0 : a.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(a)) : n != null && n.cb && (n == null || n.cb());
247
254
  };
248
255
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
249
256
  const { needDeleteLink: c = !0 } = n;
250
257
  c && t != null && t.parentNode && t.parentNode.removeChild(t);
251
- }), a)) {
252
- const c = a(l);
258
+ }), l)) {
259
+ const c = l(a);
253
260
  return i(), c;
254
261
  }
255
262
  i();
256
263
  };
257
264
  return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
258
265
  link: t,
259
- needAttach: o
266
+ needAttach: r
260
267
  };
261
268
  }
262
269
  function loadScript(n, t) {
263
- const { attrs: o = {}, createScriptHook: r } = t;
264
- return new Promise((s, a) => {
265
- const { script: l, needAttach: i } = createScript({
270
+ const { attrs: r = {}, createScriptHook: o } = t;
271
+ return new Promise((s, l) => {
272
+ const { script: a, needAttach: i } = createScript({
266
273
  url: n,
267
274
  cb: s,
268
- onErrorCallback: a,
275
+ onErrorCallback: l,
269
276
  attrs: _extends$2({
270
277
  fetchpriority: "high"
271
- }, o),
272
- createScriptHook: r,
278
+ }, r),
279
+ createScriptHook: o,
273
280
  needDeleteScript: !0
274
281
  });
275
- i && document.head.appendChild(l);
282
+ i && document.head.appendChild(a);
276
283
  });
277
284
  }
278
285
  function importNodeModule(n) {
279
286
  if (!n)
280
287
  throw new Error("import specifier is required");
281
- return new Function("name", "return import(name)")(n).then((o) => o).catch((o) => {
282
- throw console.error(`Error importing module ${n}:`, o), o;
288
+ return new Function("name", "return import(name)")(n).then((r) => r).catch((r) => {
289
+ throw console.error(`Error importing module ${n}:`, r), r;
283
290
  });
284
291
  }
285
292
  const loadNodeFetch = async () => {
286
293
  const n = await importNodeModule("node-fetch");
287
294
  return n.default || n;
288
- }, lazyLoaderHookFetch = async (n, t, o) => {
289
- const s = await ((a, l) => o.lifecycle.fetch.emit(a, l))(n, t || {});
295
+ }, lazyLoaderHookFetch = async (n, t, r) => {
296
+ const s = await ((l, a) => r.lifecycle.fetch.emit(l, a))(n, t || {});
290
297
  return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(n, t || {}) : s;
291
298
  }, createScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {
292
299
  if (loaderHook != null && loaderHook.createScriptHook) {
@@ -344,66 +351,66 @@ const loadNodeFetch = async () => {
344
351
  }).catch((n) => {
345
352
  cb(n);
346
353
  });
347
- } : (n, t, o, r) => {
354
+ } : (n, t, r, o) => {
348
355
  t(new Error("createScriptNode is disabled in non-Node.js environment"));
349
- }, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (n, t) => new Promise((o, r) => {
350
- createScriptNode(n, (s, a) => {
356
+ }, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (n, t) => new Promise((r, o) => {
357
+ createScriptNode(n, (s, l) => {
351
358
  if (s)
352
- r(s);
359
+ o(s);
353
360
  else {
354
- var l, i;
355
- 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;
356
- o(u);
361
+ var a, i;
362
+ 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;
363
+ r(u);
357
364
  }
358
365
  }, t.attrs, t.loaderHook);
359
366
  }) : (n, t) => {
360
367
  throw new Error("loadScriptNode is disabled in non-Node.js environment");
361
368
  };
362
369
  async function loadModule(n, t) {
363
- const { fetch: o, vm: r } = t, a = await (await o(n)).text(), l = new r.SourceTextModule(a, {
370
+ const { fetch: r, vm: o } = t, l = await (await r(n)).text(), a = new o.SourceTextModule(l, {
364
371
  // @ts-ignore
365
372
  importModuleDynamically: async (i, c) => {
366
373
  const u = new URL(i, n).href;
367
374
  return loadModule(u, t);
368
375
  }
369
376
  });
370
- return await l.link(async (i) => {
377
+ return await a.link(async (i) => {
371
378
  const c = new URL(i, n).href;
372
379
  return await loadModule(c, t);
373
- }), l;
380
+ }), a;
374
381
  }
375
382
  const LoggerInstance = createLogger("[ Module Federation Bridge Vue3 ]");
376
383
  function _extends$1() {
377
384
  return _extends$1 = Object.assign || function(t) {
378
- for (var o = 1; o < arguments.length; o++) {
379
- var r = arguments[o];
380
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
385
+ for (var r = 1; r < arguments.length; r++) {
386
+ var o = arguments[r];
387
+ for (var s in o) Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
381
388
  }
382
389
  return t;
383
390
  }, _extends$1.apply(this, arguments);
384
391
  }
385
392
  function _object_without_properties_loose(n, t) {
386
393
  if (n == null) return {};
387
- var o = {}, r = Object.keys(n), s, a;
388
- for (a = 0; a < r.length; a++)
389
- s = r[a], !(t.indexOf(s) >= 0) && (o[s] = n[s]);
390
- return o;
394
+ var r = {}, o = Object.keys(n), s, l;
395
+ for (l = 0; l < o.length; l++)
396
+ s = o[l], !(t.indexOf(s) >= 0) && (r[s] = n[s]);
397
+ return r;
391
398
  }
392
- 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", RUNTIME_008 = "RUNTIME-008", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", getDocsUrl = (n) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${n.split("-")[0].toLowerCase()}/${n}`, getShortErrorMsg = (n, t, o, r) => {
399
+ 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", RUNTIME_008 = "RUNTIME-008", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", getDocsUrl = (n) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${n.split("-")[0].toLowerCase()}/${n}`, getShortErrorMsg = (n, t, r, o) => {
393
400
  const s = [
394
401
  `${[
395
402
  t[n]
396
403
  ]} #${n}`
397
404
  ];
398
- return o && s.push(`args: ${JSON.stringify(o)}`), s.push(getDocsUrl(n)), r && s.push(`Original Error Message:
399
- ${r}`), s.join(`
405
+ return r && s.push(`args: ${JSON.stringify(r)}`), s.push(getDocsUrl(n)), o && s.push(`Original Error Message:
406
+ ${o}`), s.join(`
400
407
  `);
401
408
  };
402
409
  function _extends() {
403
410
  return _extends = Object.assign || function(t) {
404
- for (var o = 1; o < arguments.length; o++) {
405
- var r = arguments[o];
406
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
411
+ for (var r = 1; r < arguments.length; r++) {
412
+ var o = arguments[r];
413
+ for (var s in o) Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
407
414
  }
408
415
  return t;
409
416
  }, _extends.apply(this, arguments);
@@ -434,7 +441,7 @@ function warn(n) {
434
441
  n instanceof Error && (n.message = `${LOG_CATEGORY}: ${n.message}`), logger.warn(n);
435
442
  }
436
443
  function addUniqueItem(n, t) {
437
- return n.findIndex((o) => o === t) === -1 && n.push(t), n;
444
+ return n.findIndex((r) => r === t) === -1 && n.push(t), n;
438
445
  }
439
446
  function getFMId(n) {
440
447
  return "version" in n && n.version ? `${n.name}:${n.version}` : "entry" in n && n.entry ? `${n.name}:${n.entry}` : `${n.name}`;
@@ -474,8 +481,8 @@ function getRemoteEntryInfoFromSnapshot(n) {
474
481
  } : t;
475
482
  }
476
483
  const processModuleAlias = (n, t) => {
477
- let o;
478
- return n.endsWith("/") ? o = n.slice(0, -1) : o = n, t.startsWith(".") && (t = t.slice(1)), o = o + t, o;
484
+ let r;
485
+ return n.endsWith("/") ? r = n.slice(0, -1) : r = n, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
479
486
  }, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
480
487
  try {
481
488
  return document.defaultView;
@@ -483,9 +490,9 @@ const processModuleAlias = (n, t) => {
483
490
  return CurrentGlobal;
484
491
  }
485
492
  })(), Global = nativeGlobal;
486
- function definePropertyGlobalVal(n, t, o) {
493
+ function definePropertyGlobalVal(n, t, r) {
487
494
  Object.defineProperty(n, t, {
488
- value: o,
495
+ value: r,
489
496
  configurable: !1,
490
497
  writable: !0
491
498
  });
@@ -496,7 +503,7 @@ function includeOwnProperty(n, t) {
496
503
  includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
497
504
  const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
498
505
  function setGlobalDefaultVal(n) {
499
- var t, o, r, s, a, l;
506
+ var t, r, o, s, l, a;
500
507
  includeOwnProperty(n, "__VMOK__") && !includeOwnProperty(n, "__FEDERATION__") && definePropertyGlobalVal(n, "__FEDERATION__", n.__VMOK__), includeOwnProperty(n, "__FEDERATION__") || (definePropertyGlobalVal(n, "__FEDERATION__", {
501
508
  __GLOBAL_PLUGIN__: [],
502
509
  __INSTANCES__: [],
@@ -508,20 +515,20 @@ function setGlobalDefaultVal(n) {
508
515
  var i;
509
516
  (i = (t = n.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
510
517
  var c;
511
- (c = (o = n.__FEDERATION__).__INSTANCES__) != null || (o.__INSTANCES__ = []);
518
+ (c = (r = n.__FEDERATION__).__INSTANCES__) != null || (r.__INSTANCES__ = []);
512
519
  var u;
513
- (u = (r = n.__FEDERATION__).moduleInfo) != null || (r.moduleInfo = {});
520
+ (u = (o = n.__FEDERATION__).moduleInfo) != null || (o.moduleInfo = {});
514
521
  var d;
515
522
  (d = (s = n.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
516
523
  var p;
517
- (p = (a = n.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
524
+ (p = (l = n.__FEDERATION__).__MANIFEST_LOADING__) != null || (l.__MANIFEST_LOADING__ = {});
518
525
  var m;
519
- (m = (l = n.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
526
+ (m = (a = n.__FEDERATION__).__PRELOADED_MAP__) != null || (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
520
527
  }
521
528
  setGlobalDefaultVal(CurrentGlobal);
522
529
  setGlobalDefaultVal(nativeGlobal);
523
530
  function setGlobalFederationConstructor(n, t = isDebugMode()) {
524
- t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.14.0");
531
+ t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.13.1");
525
532
  }
526
533
  function getInfoWithoutType(n, t) {
527
534
  if (typeof t == "string") {
@@ -531,9 +538,9 @@ function getInfoWithoutType(n, t) {
531
538
  key: t
532
539
  };
533
540
  {
534
- const r = Object.keys(n);
535
- for (const s of r) {
536
- const [a, l] = s.split(":"), i = `${a}:${t}`, c = n[i];
541
+ const o = Object.keys(n);
542
+ for (const s of o) {
543
+ const [l, a] = s.split(":"), i = `${l}:${t}`, c = n[i];
537
544
  if (c)
538
545
  return {
539
546
  value: c,
@@ -549,28 +556,28 @@ function getInfoWithoutType(n, t) {
549
556
  throw new Error("key must be string");
550
557
  }
551
558
  const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (n, t) => {
552
- const o = getFMId(n), r = getInfoWithoutType(t, o).value;
553
- if (r && !r.version && "version" in n && n.version && (r.version = n.version), r)
554
- return r;
559
+ const r = getFMId(n), o = getInfoWithoutType(t, r).value;
560
+ if (o && !o.version && "version" in n && n.version && (o.version = n.version), o)
561
+ return o;
555
562
  if ("version" in n && n.version) {
556
- const { version: s } = n, a = _object_without_properties_loose(n, [
563
+ const { version: s } = n, l = _object_without_properties_loose(n, [
557
564
  "version"
558
- ]), l = getFMId(a), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, l).value;
565
+ ]), a = getFMId(l), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, a).value;
559
566
  if ((i == null ? void 0 : i.version) === s)
560
567
  return i;
561
568
  }
562
569
  }, getGlobalSnapshotInfoByModuleInfo = (n) => getTargetSnapshotInfoByModuleInfo(n, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (n, t) => {
563
- const o = getFMId(n);
564
- return nativeGlobal.__FEDERATION__.moduleInfo[o] = t, nativeGlobal.__FEDERATION__.moduleInfo;
570
+ const r = getFMId(n);
571
+ return nativeGlobal.__FEDERATION__.moduleInfo[r] = t, nativeGlobal.__FEDERATION__.moduleInfo;
565
572
  }, addGlobalSnapshot = (n) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, n), () => {
566
573
  const t = Object.keys(n);
567
- for (const o of t)
568
- delete nativeGlobal.__FEDERATION__.moduleInfo[o];
574
+ for (const r of t)
575
+ delete nativeGlobal.__FEDERATION__.moduleInfo[r];
569
576
  }), getRemoteEntryExports = (n, t) => {
570
- const o = t || `__FEDERATION_${n}:custom__`, r = CurrentGlobal[o];
577
+ const r = t || `__FEDERATION_${n}:custom__`, o = CurrentGlobal[r];
571
578
  return {
572
- remoteEntryKey: o,
573
- entryExports: r
579
+ remoteEntryKey: r,
580
+ entryExports: o
574
581
  };
575
582
  }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(n), setPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(n, !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*$";
576
583
  function parseRegex(n) {
@@ -580,17 +587,17 @@ function isXVersion(n) {
580
587
  return !n || n.toLowerCase() === "x" || n === "*";
581
588
  }
582
589
  function pipe(...n) {
583
- return (t) => n.reduce((o, r) => r(o), t);
590
+ return (t) => n.reduce((r, o) => o(r), t);
584
591
  }
585
592
  function extractComparator(n) {
586
593
  return n.match(parseRegex(comparator));
587
594
  }
588
- function combineVersion(n, t, o, r) {
589
- const s = `${n}.${t}.${o}`;
590
- return r ? `${s}-${r}` : s;
595
+ function combineVersion(n, t, r, o) {
596
+ const s = `${n}.${t}.${r}`;
597
+ return o ? `${s}-${o}` : s;
591
598
  }
592
599
  function parseHyphen(n) {
593
- return n.replace(parseRegex(hyphenRange), (t, o, r, s, a, l, i, c, u, d, p, m) => (isXVersion(r) ? o = "" : isXVersion(s) ? o = `>=${r}.0.0` : isXVersion(a) ? o = `>=${r}.${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()));
600
+ return n.replace(parseRegex(hyphenRange), (t, r, o, s, l, a, i, c, u, d, p, m) => (isXVersion(o) ? r = "" : isXVersion(s) ? r = `>=${o}.0.0` : isXVersion(l) ? r = `>=${o}.${s}.0` : r = `>=${r}`, 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}`, `${r} ${c}`.trim()));
594
601
  }
595
602
  function parseComparatorTrim(n) {
596
603
  return n.replace(parseRegex(comparatorTrim), "$1$2$3");
@@ -602,15 +609,15 @@ function parseCaretTrim(n) {
602
609
  return n.replace(parseRegex(caretTrim), "$1^");
603
610
  }
604
611
  function parseCarets(n) {
605
- return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (o, r, s, a, l) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? r === "0" ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.0 <${Number(r) + 1}.0.0-0` : l ? r === "0" ? s === "0" ? `>=${r}.${s}.${a}-${l} <${r}.${s}.${Number(a) + 1}-0` : `>=${r}.${s}.${a}-${l} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a}-${l} <${Number(r) + 1}.0.0-0` : r === "0" ? s === "0" ? `>=${r}.${s}.${a} <${r}.${s}.${Number(a) + 1}-0` : `>=${r}.${s}.${a} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a} <${Number(r) + 1}.0.0-0`)).join(" ");
612
+ return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (r, o, s, l, a) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(l) ? o === "0" ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.0 <${Number(o) + 1}.0.0-0` : a ? o === "0" ? s === "0" ? `>=${o}.${s}.${l}-${a} <${o}.${s}.${Number(l) + 1}-0` : `>=${o}.${s}.${l}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l}-${a} <${Number(o) + 1}.0.0-0` : o === "0" ? s === "0" ? `>=${o}.${s}.${l} <${o}.${s}.${Number(l) + 1}-0` : `>=${o}.${s}.${l} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l} <${Number(o) + 1}.0.0-0`)).join(" ");
606
613
  }
607
614
  function parseTildes(n) {
608
- return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (o, r, s, a, l) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : l ? `>=${r}.${s}.${a}-${l} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a} <${r}.${Number(s) + 1}.0-0`)).join(" ");
615
+ return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (r, o, s, l, a) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(l) ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : a ? `>=${o}.${s}.${l}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l} <${o}.${Number(s) + 1}.0-0`)).join(" ");
609
616
  }
610
617
  function parseXRanges(n) {
611
- return n.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (o, r, s, a, l, i) => {
612
- const c = isXVersion(s), u = c || isXVersion(a), d = u || isXVersion(l);
613
- return r === "=" && d && (r = ""), i = "", c ? r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && d ? (u && (a = 0), l = 0, r === ">" ? (r = ">=", u ? (s = Number(s) + 1, a = 0, l = 0) : (a = Number(a) + 1, l = 0)) : r === "<=" && (r = "<", u ? s = Number(s) + 1 : a = Number(a) + 1), r === "<" && (i = "-0"), `${r + s}.${a}.${l}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${a}.0${i} <${s}.${Number(a) + 1}.0-0` : o;
618
+ return n.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (r, o, s, l, a, i) => {
619
+ const c = isXVersion(s), u = c || isXVersion(l), d = u || isXVersion(a);
620
+ return o === "=" && d && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && d ? (u && (l = 0), a = 0, o === ">" ? (o = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : o === "<=" && (o = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), o === "<" && (i = "-0"), `${o + 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` : r;
614
621
  })).join(" ");
615
622
  }
616
623
  function parseStar(n) {
@@ -623,17 +630,17 @@ function compareAtom(n, t) {
623
630
  return n = Number(n) || n, t = Number(t) || t, n > t ? 1 : n === t ? 0 : -1;
624
631
  }
625
632
  function comparePreRelease(n, t) {
626
- const { preRelease: o } = n, { preRelease: r } = t;
627
- if (o === void 0 && r)
633
+ const { preRelease: r } = n, { preRelease: o } = t;
634
+ if (r === void 0 && o)
628
635
  return 1;
629
- if (o && r === void 0)
636
+ if (r && o === void 0)
630
637
  return -1;
631
- if (o === void 0 && r === void 0)
638
+ if (r === void 0 && o === void 0)
632
639
  return 0;
633
- for (let s = 0, a = o.length; s <= a; s++) {
634
- const l = o[s], i = r[s];
635
- if (l !== i)
636
- return l === void 0 && i === void 0 ? 0 : l ? i ? compareAtom(l, i) : -1 : 1;
640
+ for (let s = 0, l = r.length; s <= l; s++) {
641
+ const a = r[s], i = o[s];
642
+ if (a !== i)
643
+ return a === void 0 && i === void 0 ? 0 : a ? i ? compareAtom(a, i) : -1 : 1;
637
644
  }
638
645
  return 0;
639
646
  }
@@ -703,10 +710,10 @@ function parseRange(n) {
703
710
  function satisfy(n, t) {
704
711
  if (!n)
705
712
  return !1;
706
- const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), a = extractComparator(n);
707
- if (!a)
713
+ const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), l = extractComparator(n);
714
+ if (!l)
708
715
  return !1;
709
- const [, l, , i, c, u, d] = a, p = {
716
+ const [, a, , i, c, u, d] = l, p = {
710
717
  version: combineVersion(i, c, u, d),
711
718
  major: i,
712
719
  minor: c,
@@ -717,10 +724,10 @@ function satisfy(n, t) {
717
724
  const y = extractComparator(m);
718
725
  if (!y)
719
726
  return !1;
720
- const [, E, , g, _, b, v] = y, S = {
727
+ const [, E, , R, _, b, v] = y, S = {
721
728
  operator: E,
722
- version: combineVersion(g, _, b, v),
723
- major: g,
729
+ version: combineVersion(R, _, b, v),
730
+ major: R,
724
731
  minor: _,
725
732
  patch: b,
726
733
  preRelease: v == null ? void 0 : v.split(".")
@@ -730,12 +737,12 @@ function satisfy(n, t) {
730
737
  }
731
738
  return !0;
732
739
  }
733
- function formatShare(n, t, o, r) {
740
+ function formatShare(n, t, r, o) {
734
741
  let s;
735
742
  "get" in n ? s = n.get : "lib" in n ? s = () => Promise.resolve(n.lib) : s = () => Promise.resolve(() => {
736
- throw new Error(`Can not get shared '${o}'!`);
743
+ throw new Error(`Can not get shared '${r}'!`);
737
744
  });
738
- var a, l, i;
745
+ var l, a, i;
739
746
  return _extends$1({
740
747
  deps: [],
741
748
  useIn: [],
@@ -750,84 +757,84 @@ function formatShare(n, t, o, r) {
750
757
  }, n.shareConfig),
751
758
  get: s,
752
759
  loaded: n != null && n.loaded || "lib" in n ? !0 : void 0,
753
- version: (a = n.version) != null ? a : "0",
760
+ version: (l = n.version) != null ? l : "0",
754
761
  scope: Array.isArray(n.scope) ? n.scope : [
755
- (l = n.scope) != null ? l : "default"
762
+ (a = n.scope) != null ? a : "default"
756
763
  ],
757
- strategy: ((i = n.strategy) != null ? i : r) || "version-first"
764
+ strategy: ((i = n.strategy) != null ? i : o) || "version-first"
758
765
  });
759
766
  }
760
767
  function formatShareConfigs(n, t) {
761
- const o = t.shared || {}, r = t.name, s = Object.keys(o).reduce((l, i) => {
762
- const c = arrayOptions(o[i]);
763
- return l[i] = l[i] || [], c.forEach((u) => {
764
- l[i].push(formatShare(u, r, i, t.shareStrategy));
765
- }), l;
766
- }, {}), a = _extends$1({}, n.shared);
767
- return Object.keys(s).forEach((l) => {
768
- a[l] ? s[l].forEach((i) => {
769
- a[l].find((u) => u.version === i.version) || a[l].push(i);
770
- }) : a[l] = s[l];
768
+ const r = t.shared || {}, o = t.name, s = Object.keys(r).reduce((a, i) => {
769
+ const c = arrayOptions(r[i]);
770
+ return a[i] = a[i] || [], c.forEach((u) => {
771
+ a[i].push(formatShare(u, o, i, t.shareStrategy));
772
+ }), a;
773
+ }, {}), l = _extends$1({}, n.shared);
774
+ return Object.keys(s).forEach((a) => {
775
+ l[a] ? s[a].forEach((i) => {
776
+ l[a].find((u) => u.version === i.version) || l[a].push(i);
777
+ }) : l[a] = s[a];
771
778
  }), {
772
- shared: a,
779
+ shared: l,
773
780
  shareInfos: s
774
781
  };
775
782
  }
776
783
  function versionLt(n, t) {
777
- const o = (r) => {
778
- if (!Number.isNaN(Number(r))) {
779
- const a = r.split(".");
780
- let l = r;
781
- for (let i = 0; i < 3 - a.length; i++)
782
- l += ".0";
783
- return l;
784
+ const r = (o) => {
785
+ if (!Number.isNaN(Number(o))) {
786
+ const l = o.split(".");
787
+ let a = o;
788
+ for (let i = 0; i < 3 - l.length; i++)
789
+ a += ".0";
790
+ return a;
784
791
  }
785
- return r;
792
+ return o;
786
793
  };
787
- return !!satisfy(o(n), `<=${o(t)}`);
794
+ return !!satisfy(r(n), `<=${r(t)}`);
788
795
  }
789
796
  const findVersion = (n, t) => {
790
- const o = t || function(r, s) {
791
- return versionLt(r, s);
797
+ const r = t || function(o, s) {
798
+ return versionLt(o, s);
792
799
  };
793
- return Object.keys(n).reduce((r, s) => !r || o(r, s) || r === "0" ? s : r, 0);
800
+ return Object.keys(n).reduce((o, s) => !o || r(o, s) || o === "0" ? s : o, 0);
794
801
  }, isLoaded = (n) => !!n.loaded || typeof n.lib == "function", isLoading = (n) => !!n.loading;
795
- function findSingletonVersionOrderByVersion(n, t, o) {
796
- const r = n[t][o], s = function(a, l) {
797
- return !isLoaded(r[a]) && versionLt(a, l);
802
+ function findSingletonVersionOrderByVersion(n, t, r) {
803
+ const o = n[t][r], s = function(l, a) {
804
+ return !isLoaded(o[l]) && versionLt(l, a);
798
805
  };
799
- return findVersion(n[t][o], s);
806
+ return findVersion(n[t][r], s);
800
807
  }
801
- function findSingletonVersionOrderByLoaded(n, t, o) {
802
- const r = n[t][o], s = function(a, l) {
808
+ function findSingletonVersionOrderByLoaded(n, t, r) {
809
+ const o = n[t][r], s = function(l, a) {
803
810
  const i = (c) => isLoaded(c) || isLoading(c);
804
- return i(r[l]) ? i(r[a]) ? !!versionLt(a, l) : !0 : i(r[a]) ? !1 : versionLt(a, l);
811
+ return i(o[a]) ? i(o[l]) ? !!versionLt(l, a) : !0 : i(o[l]) ? !1 : versionLt(l, a);
805
812
  };
806
- return findVersion(n[t][o], s);
813
+ return findVersion(n[t][r], s);
807
814
  }
808
815
  function getFindShareFunction(n) {
809
816
  return n === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
810
817
  }
811
- function getRegisteredShare(n, t, o, r) {
818
+ function getRegisteredShare(n, t, r, o) {
812
819
  if (!n)
813
820
  return;
814
- const { shareConfig: s, scope: a = DEFAULT_SCOPE, strategy: l } = o, i = Array.isArray(a) ? a : [
815
- a
821
+ const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } = r, i = Array.isArray(l) ? l : [
822
+ l
816
823
  ];
817
824
  for (const c of i)
818
825
  if (s && n[c] && n[c][t]) {
819
- const { requiredVersion: u } = s, p = getFindShareFunction(l)(n, c, t), m = () => {
826
+ const { requiredVersion: u } = s, p = getFindShareFunction(a)(n, c, t), m = () => {
820
827
  if (s.singleton) {
821
828
  if (typeof u == "string" && !satisfy(p, u)) {
822
- const g = `Version ${p} from ${p && n[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;
823
- s.strictVersion ? error(g) : warn(g);
829
+ const R = `Version ${p} from ${p && n[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
830
+ s.strictVersion ? error(R) : warn(R);
824
831
  }
825
832
  return n[c][t][p];
826
833
  } else {
827
834
  if (u === !1 || u === "*" || satisfy(p, u))
828
835
  return n[c][t][p];
829
- for (const [g, _] of Object.entries(n[c][t]))
830
- if (satisfy(g, u))
836
+ for (const [R, _] of Object.entries(n[c][t]))
837
+ if (satisfy(R, u))
831
838
  return _;
832
839
  }
833
840
  }, y = {
@@ -838,14 +845,14 @@ function getRegisteredShare(n, t, o, r) {
838
845
  GlobalFederation: Global.__FEDERATION__,
839
846
  resolver: m
840
847
  };
841
- return (r.emit(y) || y).resolver();
848
+ return (o.emit(y) || y).resolver();
842
849
  }
843
850
  }
844
851
  function getGlobalShareScope() {
845
852
  return Global.__FEDERATION__.__SHARE__;
846
853
  }
847
854
  function getTargetSharedOptions(n) {
848
- const { pkgName: t, extraOptions: o, shareInfos: r } = n, s = (i) => {
855
+ const { pkgName: t, extraOptions: r, shareInfos: o } = n, s = (i) => {
849
856
  if (!i)
850
857
  return;
851
858
  const c = {};
@@ -857,152 +864,152 @@ function getTargetSharedOptions(n) {
857
864
  });
858
865
  return c[d];
859
866
  };
860
- var a;
861
- const l = (a = o == null ? void 0 : o.resolver) != null ? a : s;
862
- return Object.assign({}, l(r[t]), o == null ? void 0 : o.customShareInfo);
867
+ var l;
868
+ const a = (l = r == null ? void 0 : r.resolver) != null ? l : s;
869
+ return Object.assign({}, a(o[t]), r == null ? void 0 : r.customShareInfo);
863
870
  }
864
871
  function getBuilderId() {
865
872
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
866
873
  }
867
874
  function matchRemoteWithNameAndExpose(n, t) {
868
- for (const o of n) {
869
- const r = t.startsWith(o.name);
870
- let s = t.replace(o.name, "");
871
- if (r) {
875
+ for (const r of n) {
876
+ const o = t.startsWith(r.name);
877
+ let s = t.replace(r.name, "");
878
+ if (o) {
872
879
  if (s.startsWith("/")) {
873
- const i = o.name;
880
+ const i = r.name;
874
881
  return s = `.${s}`, {
875
882
  pkgNameOrAlias: i,
876
883
  expose: s,
877
- remote: o
884
+ remote: r
878
885
  };
879
886
  } else if (s === "")
880
887
  return {
881
- pkgNameOrAlias: o.name,
888
+ pkgNameOrAlias: r.name,
882
889
  expose: ".",
883
- remote: o
890
+ remote: r
884
891
  };
885
892
  }
886
- const a = o.alias && t.startsWith(o.alias);
887
- let l = o.alias && t.replace(o.alias, "");
888
- if (o.alias && a) {
889
- if (l && l.startsWith("/")) {
890
- const i = o.alias;
891
- return l = `.${l}`, {
893
+ const l = r.alias && t.startsWith(r.alias);
894
+ let a = r.alias && t.replace(r.alias, "");
895
+ if (r.alias && l) {
896
+ if (a && a.startsWith("/")) {
897
+ const i = r.alias;
898
+ return a = `.${a}`, {
892
899
  pkgNameOrAlias: i,
893
- expose: l,
894
- remote: o
900
+ expose: a,
901
+ remote: r
895
902
  };
896
- } else if (l === "")
903
+ } else if (a === "")
897
904
  return {
898
- pkgNameOrAlias: o.alias,
905
+ pkgNameOrAlias: r.alias,
899
906
  expose: ".",
900
- remote: o
907
+ remote: r
901
908
  };
902
909
  }
903
910
  }
904
911
  }
905
912
  function matchRemote(n, t) {
906
- for (const o of n)
907
- if (t === o.name || o.alias && t === o.alias)
908
- return o;
913
+ for (const r of n)
914
+ if (t === r.name || r.alias && t === r.alias)
915
+ return r;
909
916
  }
910
917
  function registerPlugins(n, t) {
911
- const o = getGlobalHostPlugins();
912
- return o.length > 0 && o.forEach((r) => {
913
- n != null && n.find((s) => s.name !== r.name) && n.push(r);
914
- }), n && n.length > 0 && n.forEach((r) => {
918
+ const r = getGlobalHostPlugins();
919
+ return r.length > 0 && r.forEach((o) => {
920
+ n != null && n.find((s) => s.name !== o.name) && n.push(o);
921
+ }), n && n.length > 0 && n.forEach((o) => {
915
922
  t.forEach((s) => {
916
- s.applyPlugin(r);
923
+ s.applyPlugin(o);
917
924
  });
918
925
  }), n;
919
926
  }
920
927
  const importCallback = ".then(callbacks[0]).catch(callbacks[1])";
921
928
  async function loadEsmEntry({ entry: n, remoteEntryExports: t }) {
922
- return new Promise((o, r) => {
929
+ return new Promise((r, o) => {
923
930
  try {
924
- t ? o(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${n}")${importCallback}`)([
925
- o,
926
- r
931
+ t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${n}")${importCallback}`)([
932
+ r,
933
+ o
927
934
  ]) : import(
928
935
  /* webpackIgnore: true */
929
936
  /* @vite-ignore */
930
937
  n
931
- ).then(o).catch(r);
938
+ ).then(r).catch(o);
932
939
  } catch (s) {
933
- r(s);
940
+ o(s);
934
941
  }
935
942
  });
936
943
  }
937
944
  async function loadSystemJsEntry({ entry: n, remoteEntryExports: t }) {
938
- return new Promise((o, r) => {
945
+ return new Promise((r, o) => {
939
946
  try {
940
- t ? o(t) : typeof __system_context__ > "u" ? System.import(n).then(o).catch(r) : new Function("callbacks", `System.import("${n}")${importCallback}`)([
941
- o,
942
- r
947
+ t ? r(t) : typeof __system_context__ > "u" ? System.import(n).then(r).catch(o) : new Function("callbacks", `System.import("${n}")${importCallback}`)([
948
+ r,
949
+ o
943
950
  ]);
944
951
  } catch (s) {
945
- r(s);
952
+ o(s);
946
953
  }
947
954
  });
948
955
  }
949
- function handleRemoteEntryLoaded(n, t, o) {
950
- const { remoteEntryKey: r, entryExports: s } = getRemoteEntryExports(n, t);
956
+ function handleRemoteEntryLoaded(n, t, r) {
957
+ const { remoteEntryKey: o, entryExports: s } = getRemoteEntryExports(n, t);
951
958
  return assert(s, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
952
959
  remoteName: n,
953
- remoteEntryUrl: o,
954
- remoteEntryKey: r
960
+ remoteEntryUrl: r,
961
+ remoteEntryKey: o
955
962
  })), s;
956
963
  }
957
- async function loadEntryScript({ name: n, globalName: t, entry: o, loaderHook: r }) {
964
+ async function loadEntryScript({ name: n, globalName: t, entry: r, loaderHook: o }) {
958
965
  const { entryExports: s } = getRemoteEntryExports(n, t);
959
- return s || loadScript(o, {
966
+ return s || loadScript(r, {
960
967
  attrs: {},
961
- createScriptHook: (a, l) => {
962
- const i = r.lifecycle.createScript.emit({
963
- url: a,
964
- attrs: l
968
+ createScriptHook: (l, a) => {
969
+ const i = o.lifecycle.createScript.emit({
970
+ url: l,
971
+ attrs: a
965
972
  });
966
973
  if (i && (i instanceof HTMLScriptElement || "script" in i || "timeout" in i))
967
974
  return i;
968
975
  }
969
- }).then(() => handleRemoteEntryLoaded(n, t, o)).catch((a) => {
976
+ }).then(() => handleRemoteEntryLoaded(n, t, r)).catch((l) => {
970
977
  throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
971
978
  remoteName: n,
972
- resourceUrl: o
973
- })), a;
979
+ resourceUrl: r
980
+ })), l;
974
981
  });
975
982
  }
976
- async function loadEntryDom({ remoteInfo: n, remoteEntryExports: t, loaderHook: o }) {
977
- const { entry: r, entryGlobalName: s, name: a, type: l } = n;
978
- switch (l) {
983
+ async function loadEntryDom({ remoteInfo: n, remoteEntryExports: t, loaderHook: r }) {
984
+ const { entry: o, entryGlobalName: s, name: l, type: a } = n;
985
+ switch (a) {
979
986
  case "esm":
980
987
  case "module":
981
988
  return loadEsmEntry({
982
- entry: r,
989
+ entry: o,
983
990
  remoteEntryExports: t
984
991
  });
985
992
  case "system":
986
993
  return loadSystemJsEntry({
987
- entry: r,
994
+ entry: o,
988
995
  remoteEntryExports: t
989
996
  });
990
997
  default:
991
998
  return loadEntryScript({
992
- entry: r,
999
+ entry: o,
993
1000
  globalName: s,
994
- name: a,
995
- loaderHook: o
1001
+ name: l,
1002
+ loaderHook: r
996
1003
  });
997
1004
  }
998
1005
  }
999
1006
  async function loadEntryNode({ remoteInfo: n, loaderHook: t }) {
1000
- const { entry: o, entryGlobalName: r, name: s, type: a } = n, { entryExports: l } = getRemoteEntryExports(s, r);
1001
- return l || loadScriptNode(o, {
1007
+ const { entry: r, entryGlobalName: o, name: s, type: l } = n, { entryExports: a } = getRemoteEntryExports(s, o);
1008
+ return a || loadScriptNode(r, {
1002
1009
  attrs: {
1003
1010
  name: s,
1004
- globalName: r,
1005
- type: a
1011
+ globalName: o,
1012
+ type: l
1006
1013
  },
1007
1014
  loaderHook: {
1008
1015
  createScriptHook: (i, c = {}) => {
@@ -1014,34 +1021,34 @@ async function loadEntryNode({ remoteInfo: n, loaderHook: t }) {
1014
1021
  return u;
1015
1022
  }
1016
1023
  }
1017
- }).then(() => handleRemoteEntryLoaded(s, r, o)).catch((i) => {
1024
+ }).then(() => handleRemoteEntryLoaded(s, o, r)).catch((i) => {
1018
1025
  throw i;
1019
1026
  });
1020
1027
  }
1021
1028
  function getRemoteEntryUniqueKey(n) {
1022
- const { entry: t, name: o } = n;
1023
- return composeKeyWithSeparator(o, t);
1029
+ const { entry: t, name: r } = n;
1030
+ return composeKeyWithSeparator(r, t);
1024
1031
  }
1025
- async function getRemoteEntry({ origin: n, remoteEntryExports: t, remoteInfo: o }) {
1026
- const r = getRemoteEntryUniqueKey(o);
1032
+ async function getRemoteEntry({ origin: n, remoteEntryExports: t, remoteInfo: r }) {
1033
+ const o = getRemoteEntryUniqueKey(r);
1027
1034
  if (t)
1028
1035
  return t;
1029
- if (!globalLoading[r]) {
1030
- const s = n.remoteHandler.hooks.lifecycle.loadEntry, a = n.loaderHook;
1031
- globalLoading[r] = s.emit({
1032
- loaderHook: a,
1033
- remoteInfo: o,
1036
+ if (!globalLoading[o]) {
1037
+ const s = n.remoteHandler.hooks.lifecycle.loadEntry, l = n.loaderHook;
1038
+ globalLoading[o] = s.emit({
1039
+ loaderHook: l,
1040
+ remoteInfo: r,
1034
1041
  remoteEntryExports: t
1035
- }).then((l) => l || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : isBrowserEnv()) ? loadEntryDom({
1036
- remoteInfo: o,
1042
+ }).then((a) => a || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : isBrowserEnv()) ? loadEntryDom({
1043
+ remoteInfo: r,
1037
1044
  remoteEntryExports: t,
1038
- loaderHook: a
1045
+ loaderHook: l
1039
1046
  }) : loadEntryNode({
1040
- remoteInfo: o,
1041
- loaderHook: a
1047
+ remoteInfo: r,
1048
+ loaderHook: l
1042
1049
  })));
1043
1050
  }
1044
- return globalLoading[r];
1051
+ return globalLoading[o];
1045
1052
  }
1046
1053
  function getRemoteInfo(n) {
1047
1054
  return _extends$1({}, n, {
@@ -1063,24 +1070,24 @@ let Module = class {
1063
1070
  remoteEntryExports: this.remoteEntryExports
1064
1071
  });
1065
1072
  } catch {
1066
- const r = getRemoteEntryUniqueKey(this.remoteInfo);
1073
+ const o = getRemoteEntryUniqueKey(this.remoteInfo);
1067
1074
  t = await this.host.loaderHook.lifecycle.loadEntryError.emit({
1068
1075
  getRemoteEntry,
1069
1076
  origin: this.host,
1070
1077
  remoteInfo: this.remoteInfo,
1071
1078
  remoteEntryExports: this.remoteEntryExports,
1072
1079
  globalLoading,
1073
- uniqueKey: r
1080
+ uniqueKey: o
1074
1081
  });
1075
1082
  }
1076
1083
  return assert(t, `remoteEntryExports is undefined
1077
1084
  ${safeToString(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
1078
1085
  }
1079
1086
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1080
- async get(t, o, r, s) {
1081
- const { loadFactory: a = !0 } = r || {
1087
+ async get(t, r, o, s) {
1088
+ const { loadFactory: l = !0 } = o || {
1082
1089
  loadFactory: !0
1083
- }, l = await this.getEntry();
1090
+ }, a = await this.getEntry();
1084
1091
  if (!this.inited) {
1085
1092
  const p = this.host.shareScopeMap, m = Array.isArray(this.remoteInfo.shareScope) ? this.remoteInfo.shareScope : [
1086
1093
  this.remoteInfo.shareScope
@@ -1088,11 +1095,11 @@ let Module = class {
1088
1095
  m.length || m.push("default"), m.forEach((b) => {
1089
1096
  p[b] || (p[b] = {});
1090
1097
  });
1091
- const y = p[m[0]], E = [], g = {
1098
+ const y = p[m[0]], E = [], R = {
1092
1099
  version: this.remoteInfo.version || "",
1093
1100
  shareScopeKeys: Array.isArray(this.remoteInfo.shareScope) ? m : this.remoteInfo.shareScope || "default"
1094
1101
  };
1095
- Object.defineProperty(g, "shareScopeMap", {
1102
+ Object.defineProperty(R, "shareScopeMap", {
1096
1103
  value: p,
1097
1104
  // remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
1098
1105
  enumerable: !1
@@ -1100,48 +1107,48 @@ let Module = class {
1100
1107
  const _ = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1101
1108
  shareScope: y,
1102
1109
  // @ts-ignore shareScopeMap will be set by Object.defineProperty
1103
- remoteEntryInitOptions: g,
1110
+ remoteEntryInitOptions: R,
1104
1111
  initScope: E,
1105
1112
  remoteInfo: this.remoteInfo,
1106
1113
  origin: this.host
1107
1114
  });
1108
- typeof (l == null ? void 0 : l.init) > "u" && error(getShortErrorMsg(RUNTIME_002, runtimeDescMap, {
1115
+ typeof (a == null ? void 0 : a.init) > "u" && error(getShortErrorMsg(RUNTIME_002, runtimeDescMap, {
1109
1116
  remoteName: name,
1110
1117
  remoteEntryUrl: this.remoteInfo.entry,
1111
1118
  remoteEntryKey: this.remoteInfo.entryGlobalName
1112
- })), await l.init(_.shareScope, _.initScope, _.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, _, {
1119
+ })), await a.init(_.shareScope, _.initScope, _.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, _, {
1113
1120
  id: t,
1114
1121
  remoteSnapshot: s,
1115
- remoteEntryExports: l
1122
+ remoteEntryExports: a
1116
1123
  }));
1117
1124
  }
1118
- this.lib = l, this.inited = !0;
1125
+ this.lib = a, this.inited = !0;
1119
1126
  let i;
1120
1127
  i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1121
- remoteEntryExports: l,
1122
- expose: o,
1128
+ remoteEntryExports: a,
1129
+ expose: r,
1123
1130
  moduleInfo: this.remoteInfo
1124
- }), i || (i = await l.get(o)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${o}.`);
1125
- const c = processModuleAlias(this.remoteInfo.name, o), u = this.wraperFactory(i, c);
1126
- return a ? await u() : u;
1131
+ }), i || (i = await a.get(r)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${r}.`);
1132
+ const c = processModuleAlias(this.remoteInfo.name, r), u = this.wraperFactory(i, c);
1133
+ return l ? await u() : u;
1127
1134
  }
1128
- wraperFactory(t, o) {
1129
- function r(s, a) {
1135
+ wraperFactory(t, r) {
1136
+ function o(s, l) {
1130
1137
  s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
1131
- value: a,
1138
+ value: l,
1132
1139
  enumerable: !1
1133
1140
  });
1134
1141
  }
1135
1142
  return t instanceof Promise ? async () => {
1136
1143
  const s = await t();
1137
- return r(s, o), s;
1144
+ return o(s, r), s;
1138
1145
  } : () => {
1139
1146
  const s = t();
1140
- return r(s, o), s;
1147
+ return o(s, r), s;
1141
1148
  };
1142
1149
  }
1143
- constructor({ remoteInfo: t, host: o }) {
1144
- this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = o;
1150
+ constructor({ remoteInfo: t, host: r }) {
1151
+ this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = r;
1145
1152
  }
1146
1153
  };
1147
1154
  class SyncHook {
@@ -1149,16 +1156,16 @@ class SyncHook {
1149
1156
  typeof t == "function" && this.listeners.add(t);
1150
1157
  }
1151
1158
  once(t) {
1152
- const o = this;
1153
- this.on(function r(...s) {
1154
- return o.remove(r), t.apply(null, s);
1159
+ const r = this;
1160
+ this.on(function o(...s) {
1161
+ return r.remove(o), t.apply(null, s);
1155
1162
  });
1156
1163
  }
1157
1164
  emit(...t) {
1158
- let o;
1159
- return this.listeners.size > 0 && this.listeners.forEach((r) => {
1160
- o = r(...t);
1161
- }), o;
1165
+ let r;
1166
+ return this.listeners.size > 0 && this.listeners.forEach((o) => {
1167
+ r = o(...t);
1168
+ }), r;
1162
1169
  }
1163
1170
  remove(t) {
1164
1171
  this.listeners.delete(t);
@@ -1172,22 +1179,22 @@ class SyncHook {
1172
1179
  }
1173
1180
  class AsyncHook extends SyncHook {
1174
1181
  emit(...t) {
1175
- let o;
1176
- const r = Array.from(this.listeners);
1177
- if (r.length > 0) {
1182
+ let r;
1183
+ const o = Array.from(this.listeners);
1184
+ if (o.length > 0) {
1178
1185
  let s = 0;
1179
- const a = (l) => l === !1 ? !1 : s < r.length ? Promise.resolve(r[s++].apply(null, t)).then(a) : l;
1180
- o = a();
1186
+ const l = (a) => a === !1 ? !1 : s < o.length ? Promise.resolve(o[s++].apply(null, t)).then(l) : a;
1187
+ r = l();
1181
1188
  }
1182
- return Promise.resolve(o);
1189
+ return Promise.resolve(r);
1183
1190
  }
1184
1191
  }
1185
1192
  function checkReturnData(n, t) {
1186
1193
  if (!isObject(t))
1187
1194
  return !1;
1188
1195
  if (n !== t) {
1189
- for (const o in n)
1190
- if (!(o in t))
1196
+ for (const r in n)
1197
+ if (!(r in t))
1191
1198
  return !1;
1192
1199
  }
1193
1200
  return !0;
@@ -1195,17 +1202,17 @@ function checkReturnData(n, t) {
1195
1202
  class SyncWaterfallHook extends SyncHook {
1196
1203
  emit(t) {
1197
1204
  isObject(t) || error(`The data for the "${this.type}" hook should be an object.`);
1198
- for (const o of this.listeners)
1205
+ for (const r of this.listeners)
1199
1206
  try {
1200
- const r = o(t);
1201
- if (checkReturnData(t, r))
1202
- t = r;
1207
+ const o = r(t);
1208
+ if (checkReturnData(t, o))
1209
+ t = o;
1203
1210
  else {
1204
1211
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1205
1212
  break;
1206
1213
  }
1207
- } catch (r) {
1208
- warn(r), this.onerror(r);
1214
+ } catch (o) {
1215
+ warn(o), this.onerror(o);
1209
1216
  }
1210
1217
  return t;
1211
1218
  }
@@ -1216,14 +1223,14 @@ class SyncWaterfallHook extends SyncHook {
1216
1223
  class AsyncWaterfallHook extends SyncHook {
1217
1224
  emit(t) {
1218
1225
  isObject(t) || error(`The response data for the "${this.type}" hook must be an object.`);
1219
- const o = Array.from(this.listeners);
1220
- if (o.length > 0) {
1221
- let r = 0;
1222
- const s = (l) => (warn(l), this.onerror(l), t), a = (l) => {
1223
- if (checkReturnData(t, l)) {
1224
- if (t = l, r < o.length)
1226
+ const r = Array.from(this.listeners);
1227
+ if (r.length > 0) {
1228
+ let o = 0;
1229
+ const s = (a) => (warn(a), this.onerror(a), t), l = (a) => {
1230
+ if (checkReturnData(t, a)) {
1231
+ if (t = a, o < r.length)
1225
1232
  try {
1226
- return Promise.resolve(o[r++](t)).then(a, s);
1233
+ return Promise.resolve(r[o++](t)).then(l, s);
1227
1234
  } catch (i) {
1228
1235
  return s(i);
1229
1236
  }
@@ -1231,7 +1238,7 @@ class AsyncWaterfallHook extends SyncHook {
1231
1238
  this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
1232
1239
  return t;
1233
1240
  };
1234
- return Promise.resolve(a(t));
1241
+ return Promise.resolve(l(t));
1235
1242
  }
1236
1243
  return Promise.resolve(t);
1237
1244
  }
@@ -1242,25 +1249,25 @@ class AsyncWaterfallHook extends SyncHook {
1242
1249
  class PluginSystem {
1243
1250
  applyPlugin(t) {
1244
1251
  assert(isPlainObject(t), "Plugin configuration is invalid.");
1245
- const o = t.name;
1246
- assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = t, Object.keys(this.lifecycle).forEach((r) => {
1247
- const s = t[r];
1248
- s && this.lifecycle[r].on(s);
1252
+ const r = t.name;
1253
+ assert(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = t, Object.keys(this.lifecycle).forEach((o) => {
1254
+ const s = t[o];
1255
+ s && this.lifecycle[o].on(s);
1249
1256
  }));
1250
1257
  }
1251
1258
  removePlugin(t) {
1252
1259
  assert(t, "A name is required.");
1253
- const o = this.registerPlugins[t];
1254
- assert(o, `The plugin "${t}" is not registered.`), Object.keys(o).forEach((r) => {
1255
- r !== "name" && this.lifecycle[r].remove(o[r]);
1260
+ const r = this.registerPlugins[t];
1261
+ assert(r, `The plugin "${t}" is not registered.`), Object.keys(r).forEach((o) => {
1262
+ o !== "name" && this.lifecycle[o].remove(r[o]);
1256
1263
  });
1257
1264
  }
1258
1265
  // eslint-disable-next-line @typescript-eslint/no-shadow
1259
- inherit({ lifecycle: t, registerPlugins: o }) {
1260
- Object.keys(t).forEach((r) => {
1261
- assert(!this.lifecycle[r], `The hook "${r}" has a conflict and cannot be inherited.`), this.lifecycle[r] = t[r];
1262
- }), Object.keys(o).forEach((r) => {
1263
- assert(!this.registerPlugins[r], `The plugin "${r}" has a conflict and cannot be inherited.`), this.applyPlugin(o[r]);
1266
+ inherit({ lifecycle: t, registerPlugins: r }) {
1267
+ Object.keys(t).forEach((o) => {
1268
+ assert(!this.lifecycle[o], `The hook "${o}" has a conflict and cannot be inherited.`), this.lifecycle[o] = t[o];
1269
+ }), Object.keys(r).forEach((o) => {
1270
+ assert(!this.registerPlugins[o], `The plugin "${o}" has a conflict and cannot be inherited.`), this.applyPlugin(r[o]);
1264
1271
  });
1265
1272
  }
1266
1273
  constructor(t) {
@@ -1276,24 +1283,24 @@ function defaultPreloadArgs(n) {
1276
1283
  }, n);
1277
1284
  }
1278
1285
  function formatPreloadArgs(n, t) {
1279
- return t.map((o) => {
1280
- const r = matchRemote(n, o.nameOrAlias);
1281
- return assert(r, `Unable to preload ${o.nameOrAlias} as it is not included in ${!r && safeToString({
1282
- remoteInfo: r,
1286
+ return t.map((r) => {
1287
+ const o = matchRemote(n, r.nameOrAlias);
1288
+ return assert(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && safeToString({
1289
+ remoteInfo: o,
1283
1290
  remotes: n
1284
1291
  })}`), {
1285
- remote: r,
1286
- preloadConfig: defaultPreloadArgs(o)
1292
+ remote: o,
1293
+ preloadConfig: defaultPreloadArgs(r)
1287
1294
  };
1288
1295
  });
1289
1296
  }
1290
1297
  function normalizePreloadExposes(n) {
1291
1298
  return n ? n.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1292
1299
  }
1293
- function preloadAssets(n, t, o, r = !0) {
1294
- const { cssAssets: s, jsAssetsWithoutEntry: a, entryAssets: l } = o;
1300
+ function preloadAssets(n, t, r, o = !0) {
1301
+ const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } = r;
1295
1302
  if (t.options.inBrowser) {
1296
- if (l.forEach((i) => {
1303
+ if (a.forEach((i) => {
1297
1304
  const { moduleInfo: c } = i, u = t.moduleCache.get(n.name);
1298
1305
  getRemoteEntry(u ? {
1299
1306
  origin: t,
@@ -1304,7 +1311,7 @@ function preloadAssets(n, t, o, r = !0) {
1304
1311
  remoteInfo: c,
1305
1312
  remoteEntryExports: void 0
1306
1313
  });
1307
- }), r) {
1314
+ }), o) {
1308
1315
  const i = {
1309
1316
  rel: "preload",
1310
1317
  as: "style"
@@ -1350,12 +1357,12 @@ function preloadAssets(n, t, o, r = !0) {
1350
1357
  d && document.head.appendChild(u);
1351
1358
  });
1352
1359
  }
1353
- if (r) {
1360
+ if (o) {
1354
1361
  const i = {
1355
1362
  rel: "preload",
1356
1363
  as: "script"
1357
1364
  };
1358
- a.forEach((c) => {
1365
+ l.forEach((c) => {
1359
1366
  const { link: u, needAttach: d } = createLink({
1360
1367
  url: c,
1361
1368
  cb: () => {
@@ -1377,7 +1384,7 @@ function preloadAssets(n, t, o, r = !0) {
1377
1384
  fetchpriority: "high",
1378
1385
  type: (n == null ? void 0 : n.type) === "module" ? "module" : "text/javascript"
1379
1386
  };
1380
- a.forEach((c) => {
1387
+ l.forEach((c) => {
1381
1388
  const { script: u, needAttach: d } = createScript({
1382
1389
  url: c,
1383
1390
  cb: () => {
@@ -1399,43 +1406,40 @@ function preloadAssets(n, t, o, r = !0) {
1399
1406
  }
1400
1407
  }
1401
1408
  function assignRemoteInfo(n, t) {
1402
- const o = getRemoteEntryInfoFromSnapshot(t);
1403
- o.url || error(`The attribute remoteEntry of ${n.name} must not be undefined.`);
1404
- let r = getResourceUrl(t, o.url);
1405
- !isBrowserEnv() && !r.startsWith("http") && (r = `https:${r}`), n.type = o.type, n.entryGlobalName = o.globalName, n.entry = r, n.version = t.version, n.buildVersion = t.buildVersion;
1409
+ const r = getRemoteEntryInfoFromSnapshot(t);
1410
+ r.url || error(`The attribute remoteEntry of ${n.name} must not be undefined.`);
1411
+ let o = getResourceUrl(t, r.url);
1412
+ !isBrowserEnv() && !o.startsWith("http") && (o = `https:${o}`), n.type = r.type, n.entryGlobalName = r.globalName, n.entry = o, n.version = t.version, n.buildVersion = t.buildVersion;
1406
1413
  }
1407
1414
  function snapshotPlugin() {
1408
1415
  return {
1409
1416
  name: "snapshot-plugin",
1410
1417
  async afterResolve(n) {
1411
- const { remote: t, pkgNameOrAlias: o, expose: r, origin: s, remoteInfo: a, id: l } = n;
1418
+ const { remote: t, pkgNameOrAlias: r, expose: o, origin: s, remoteInfo: l } = n;
1412
1419
  if (!isRemoteInfoWithEntry(t) || !isPureRemoteEntry(t)) {
1413
- const { remoteSnapshot: i, globalSnapshot: c } = await s.snapshotHandler.loadRemoteSnapshotInfo({
1414
- moduleInfo: t,
1415
- id: l
1416
- });
1417
- assignRemoteInfo(a, i);
1418
- const u = {
1420
+ const { remoteSnapshot: a, globalSnapshot: i } = await s.snapshotHandler.loadRemoteSnapshotInfo(t);
1421
+ assignRemoteInfo(l, a);
1422
+ const c = {
1419
1423
  remote: t,
1420
1424
  preloadConfig: {
1421
- nameOrAlias: o,
1425
+ nameOrAlias: r,
1422
1426
  exposes: [
1423
- r
1427
+ o
1424
1428
  ],
1425
1429
  resourceCategory: "sync",
1426
1430
  share: !1,
1427
1431
  depsRemote: !1
1428
1432
  }
1429
- }, d = await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1433
+ }, u = await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1430
1434
  origin: s,
1431
- preloadOptions: u,
1432
- remoteInfo: a,
1435
+ preloadOptions: c,
1436
+ remoteInfo: l,
1433
1437
  remote: t,
1434
- remoteSnapshot: i,
1435
- globalSnapshot: c
1438
+ remoteSnapshot: a,
1439
+ globalSnapshot: i
1436
1440
  });
1437
- return d && preloadAssets(a, s, d, !1), _extends$1({}, n, {
1438
- remoteSnapshot: i
1441
+ return u && preloadAssets(l, s, u, !1), _extends$1({}, n, {
1442
+ remoteSnapshot: a
1439
1443
  });
1440
1444
  }
1441
1445
  return n;
@@ -1455,9 +1459,9 @@ function splitId(n) {
1455
1459
  version: t[2]
1456
1460
  };
1457
1461
  }
1458
- function traverseModuleInfo(n, t, o, r, s = {}, a) {
1459
- const l = getFMId(t), { value: i } = getInfoWithoutType(n, l), c = a || i;
1460
- if (c && !isManifestProvider(c) && (o(c, t, r), c.remotesInfo)) {
1462
+ function traverseModuleInfo(n, t, r, o, s = {}, l) {
1463
+ const a = getFMId(t), { value: i } = getInfoWithoutType(n, a), c = l || i;
1464
+ if (c && !isManifestProvider(c) && (r(c, t, o), c.remotesInfo)) {
1461
1465
  const u = Object.keys(c.remotesInfo);
1462
1466
  for (const d of u) {
1463
1467
  if (s[d])
@@ -1467,22 +1471,22 @@ function traverseModuleInfo(n, t, o, r, s = {}, a) {
1467
1471
  traverseModuleInfo(n, {
1468
1472
  name: p.name,
1469
1473
  version: m.matchedVersion
1470
- }, o, !1, s, void 0);
1474
+ }, r, !1, s, void 0);
1471
1475
  }
1472
1476
  }
1473
1477
  }
1474
1478
  const isExisted = (n, t) => document.querySelector(`${n}[${n === "link" ? "href" : "src"}="${t}"]`);
1475
- function generatePreloadAssets(n, t, o, r, s) {
1476
- const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = n, { preloadConfig: p } = t, { depsRemote: m } = p;
1477
- if (traverseModuleInfo(r, o, (_, b, v) => {
1479
+ function generatePreloadAssets(n, t, r, o, s) {
1480
+ const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = n, { preloadConfig: p } = t, { depsRemote: m } = p;
1481
+ if (traverseModuleInfo(o, r, (_, b, v) => {
1478
1482
  let S;
1479
1483
  if (v)
1480
1484
  S = p;
1481
1485
  else if (Array.isArray(m)) {
1482
- const w = m.find((N) => N.nameOrAlias === b.name || N.nameOrAlias === b.alias);
1483
- if (!w)
1486
+ const N = m.find((O) => O.nameOrAlias === b.name || O.nameOrAlias === b.alias);
1487
+ if (!N)
1484
1488
  return;
1485
- S = defaultPreloadArgs(w);
1489
+ S = defaultPreloadArgs(N);
1486
1490
  } else if (m === !0)
1487
1491
  S = p;
1488
1492
  else
@@ -1500,28 +1504,28 @@ function generatePreloadAssets(n, t, o, r, s) {
1500
1504
  },
1501
1505
  url: I
1502
1506
  });
1503
- let R = "modules" in _ ? _.modules : [];
1507
+ let g = "modules" in _ ? _.modules : [];
1504
1508
  const A = normalizePreloadExposes(S.exposes);
1505
1509
  if (A.length && "modules" in _) {
1506
- var T;
1507
- R = _ == null || (T = _.modules) == null ? void 0 : T.reduce((w, N) => ((A == null ? void 0 : A.indexOf(N.moduleName)) !== -1 && w.push(N), w), []);
1510
+ var $;
1511
+ g = _ == null || ($ = _.modules) == null ? void 0 : $.reduce((N, O) => ((A == null ? void 0 : A.indexOf(O.moduleName)) !== -1 && N.push(O), N), []);
1508
1512
  }
1509
- function $(w) {
1510
- const N = w.map((O) => getResourceUrl(_, O));
1511
- return S.filter ? N.filter(S.filter) : N;
1513
+ function T(N) {
1514
+ const O = N.map((w) => getResourceUrl(_, w));
1515
+ return S.filter ? O.filter(S.filter) : O;
1512
1516
  }
1513
- if (R) {
1514
- const w = R.length;
1515
- for (let N = 0; N < w; N++) {
1516
- const O = R[N], P = `${b.name}/${O.moduleName}`;
1517
+ if (g) {
1518
+ const N = g.length;
1519
+ for (let O = 0; O < N; O++) {
1520
+ const w = g[O], P = `${b.name}/${w.moduleName}`;
1517
1521
  n.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1518
- id: O.moduleName === "." ? b.name : P,
1522
+ id: w.moduleName === "." ? b.name : P,
1519
1523
  name: b.name,
1520
1524
  remoteSnapshot: _,
1521
1525
  preloadConfig: S,
1522
1526
  remote: b,
1523
1527
  origin: n
1524
- }), !getPreloaded(P) && (S.resourceCategory === "all" ? (a.push(...$(O.assets.css.async)), a.push(...$(O.assets.css.sync)), l.push(...$(O.assets.js.async)), l.push(...$(O.assets.js.sync))) : (S.resourceCategory = "sync") && (a.push(...$(O.assets.css.sync)), l.push(...$(O.assets.js.sync))), setPreloaded(P));
1528
+ }), !getPreloaded(P) && (S.resourceCategory === "all" ? (l.push(...T(w.assets.css.async)), l.push(...T(w.assets.css.sync)), a.push(...T(w.assets.js.async)), a.push(...T(w.assets.js.sync))) : (S.resourceCategory = "sync") && (l.push(...T(w.assets.css.sync)), a.push(...T(w.assets.js.sync))), setPreloaded(P));
1525
1529
  }
1526
1530
  }
1527
1531
  }, !0, {}, s), s.shared) {
@@ -1546,9 +1550,9 @@ function generatePreloadAssets(n, t, o, r, s) {
1546
1550
  });
1547
1551
  });
1548
1552
  }
1549
- const E = l.filter((_) => !c.has(_) && !isExisted("script", _));
1553
+ const E = a.filter((_) => !c.has(_) && !isExisted("script", _));
1550
1554
  return {
1551
- cssAssets: a.filter((_) => !u.has(_) && !isExisted("link", _)),
1555
+ cssAssets: l.filter((_) => !u.has(_) && !isExisted("link", _)),
1552
1556
  jsAssetsWithoutEntry: E,
1553
1557
  entryAssets: i.filter((_) => !isExisted("script", _.url))
1554
1558
  };
@@ -1557,7 +1561,7 @@ const generatePreloadAssetsPlugin = function() {
1557
1561
  return {
1558
1562
  name: "generate-preload-assets-plugin",
1559
1563
  async generatePreloadAssets(n) {
1560
- const { origin: t, preloadOptions: o, remoteInfo: r, remote: s, globalSnapshot: a, remoteSnapshot: l } = n;
1564
+ const { origin: t, preloadOptions: r, remoteInfo: o, remote: s, globalSnapshot: l, remoteSnapshot: a } = n;
1561
1565
  return isBrowserEnv() ? isRemoteInfoWithEntry(s) && isPureRemoteEntry(s) ? {
1562
1566
  cssAssets: [],
1563
1567
  jsAssetsWithoutEntry: [],
@@ -1566,15 +1570,15 @@ const generatePreloadAssetsPlugin = function() {
1566
1570
  name: s.name,
1567
1571
  url: s.entry,
1568
1572
  moduleInfo: {
1569
- name: r.name,
1573
+ name: o.name,
1570
1574
  entry: s.entry,
1571
- type: r.type || "global",
1575
+ type: o.type || "global",
1572
1576
  entryGlobalName: "",
1573
1577
  shareScope: ""
1574
1578
  }
1575
1579
  }
1576
1580
  ]
1577
- } : (assignRemoteInfo(r, l), generatePreloadAssets(t, o, r, a, l)) : {
1581
+ } : (assignRemoteInfo(o, a), generatePreloadAssets(t, r, o, l, a)) : {
1578
1582
  cssAssets: [],
1579
1583
  jsAssetsWithoutEntry: [],
1580
1584
  entryAssets: []
@@ -1583,16 +1587,16 @@ const generatePreloadAssetsPlugin = function() {
1583
1587
  };
1584
1588
  };
1585
1589
  function getGlobalRemoteInfo(n, t) {
1586
- const o = getGlobalSnapshotInfoByModuleInfo({
1587
- name: t.name,
1590
+ const r = getGlobalSnapshotInfoByModuleInfo({
1591
+ name: t.options.name,
1588
1592
  version: t.options.version
1589
- }), r = o && "remotesInfo" in o && o.remotesInfo && getInfoWithoutType(o.remotesInfo, n.name).value;
1590
- return r && r.matchedVersion ? {
1591
- hostGlobalSnapshot: o,
1593
+ }), o = r && "remotesInfo" in r && r.remotesInfo && getInfoWithoutType(r.remotesInfo, n.name).value;
1594
+ return o && o.matchedVersion ? {
1595
+ hostGlobalSnapshot: r,
1592
1596
  globalSnapshot: getGlobalSnapshot(),
1593
1597
  remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1594
1598
  name: n.name,
1595
- version: r.matchedVersion
1599
+ version: o.matchedVersion
1596
1600
  })
1597
1601
  } : {
1598
1602
  hostGlobalSnapshot: void 0,
@@ -1604,117 +1608,128 @@ function getGlobalRemoteInfo(n, t) {
1604
1608
  };
1605
1609
  }
1606
1610
  class SnapshotHandler {
1611
+ async loadSnapshot(t) {
1612
+ const { options: r } = this.HostInstance, { hostGlobalSnapshot: o, remoteSnapshot: s, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: a, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
1613
+ options: r,
1614
+ moduleInfo: t,
1615
+ hostGlobalSnapshot: o,
1616
+ remoteSnapshot: s,
1617
+ globalSnapshot: l
1618
+ });
1619
+ return {
1620
+ remoteSnapshot: a,
1621
+ globalSnapshot: i
1622
+ };
1623
+ }
1607
1624
  // eslint-disable-next-line max-lines-per-function
1608
- async loadRemoteSnapshotInfo({ moduleInfo: t, id: o, expose: r }) {
1609
- const { options: s } = this.HostInstance;
1625
+ async loadRemoteSnapshotInfo(t) {
1626
+ const { options: r } = this.HostInstance;
1610
1627
  await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1611
- options: s,
1628
+ options: r,
1612
1629
  moduleInfo: t
1613
1630
  });
1614
- let a = getGlobalSnapshotInfoByModuleInfo({
1631
+ let o = getGlobalSnapshotInfoByModuleInfo({
1615
1632
  name: this.HostInstance.options.name,
1616
1633
  version: this.HostInstance.options.version
1617
1634
  });
1618
- a || (a = {
1635
+ o || (o = {
1619
1636
  version: this.HostInstance.options.version || "",
1620
1637
  remoteEntry: "",
1621
1638
  remotesInfo: {}
1622
1639
  }, addGlobalSnapshot({
1623
- [this.HostInstance.options.name]: a
1624
- })), a && "remotesInfo" in a && !getInfoWithoutType(a.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (a.remotesInfo = _extends$1({}, a == null ? void 0 : a.remotesInfo, {
1640
+ [this.HostInstance.options.name]: o
1641
+ })), 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, {
1625
1642
  [t.name]: {
1626
1643
  matchedVersion: "version" in t ? t.version : t.entry
1627
1644
  }
1628
1645
  }));
1629
- const { hostGlobalSnapshot: l, remoteSnapshot: i, globalSnapshot: c } = this.getGlobalRemoteInfo(t), { remoteSnapshot: u, globalSnapshot: d } = await this.hooks.lifecycle.loadSnapshot.emit({
1630
- options: s,
1646
+ const { hostGlobalSnapshot: s, remoteSnapshot: l, globalSnapshot: a } = this.getGlobalRemoteInfo(t), { remoteSnapshot: i, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1647
+ options: r,
1631
1648
  moduleInfo: t,
1632
- hostGlobalSnapshot: l,
1633
- remoteSnapshot: i,
1634
- globalSnapshot: c
1649
+ hostGlobalSnapshot: s,
1650
+ remoteSnapshot: l,
1651
+ globalSnapshot: a
1635
1652
  });
1636
- let p, m;
1637
- if (u)
1638
- if (isManifestProvider(u)) {
1639
- const y = isBrowserEnv() ? u.remoteEntry : u.ssrRemoteEntry || u.remoteEntry || "", E = await this.getManifestJson(y, t, {}), g = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1653
+ let u, d;
1654
+ if (i)
1655
+ if (isManifestProvider(i)) {
1656
+ const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1640
1657
  // The global remote may be overridden
1641
1658
  // Therefore, set the snapshot key to the global address of the actual request
1642
- entry: y
1643
- }), E);
1644
- p = E, m = g;
1659
+ entry: p
1660
+ }), m);
1661
+ u = m, d = y;
1645
1662
  } else {
1646
- const { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1663
+ const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1647
1664
  options: this.HostInstance.options,
1648
1665
  moduleInfo: t,
1649
- remoteSnapshot: u,
1666
+ remoteSnapshot: i,
1650
1667
  from: "global"
1651
1668
  });
1652
- p = y, m = d;
1669
+ u = p, d = c;
1653
1670
  }
1654
1671
  else if (isRemoteInfoWithEntry(t)) {
1655
- const y = await this.getManifestJson(t.entry, t, {}), E = setGlobalSnapshotInfoByModuleInfo(t, y), { remoteSnapshot: g } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1672
+ const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1656
1673
  options: this.HostInstance.options,
1657
1674
  moduleInfo: t,
1658
- remoteSnapshot: y,
1675
+ remoteSnapshot: p,
1659
1676
  from: "global"
1660
1677
  });
1661
- p = g, m = E;
1678
+ u = y, d = m;
1662
1679
  } else
1663
1680
  error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1664
1681
  hostName: t.name,
1665
1682
  hostVersion: t.version,
1666
- globalSnapshot: JSON.stringify(d)
1683
+ globalSnapshot: JSON.stringify(c)
1667
1684
  }));
1668
1685
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1669
- id: o,
1670
- host: this.HostInstance,
1671
- options: s,
1686
+ options: r,
1672
1687
  moduleInfo: t,
1673
- remoteSnapshot: p
1688
+ remoteSnapshot: u
1674
1689
  }), {
1675
- remoteSnapshot: p,
1676
- globalSnapshot: m
1690
+ remoteSnapshot: u,
1691
+ globalSnapshot: d
1677
1692
  };
1678
1693
  }
1679
1694
  getGlobalRemoteInfo(t) {
1680
1695
  return getGlobalRemoteInfo(t, this.HostInstance);
1681
1696
  }
1682
- async getManifestJson(t, o, r) {
1697
+ async getManifestJson(t, r, o) {
1683
1698
  const s = async () => {
1684
- let l = this.manifestCache.get(t);
1685
- if (l)
1686
- return l;
1699
+ let a = this.manifestCache.get(t);
1700
+ if (a)
1701
+ return a;
1687
1702
  try {
1688
1703
  let i = await this.loaderHook.lifecycle.fetch.emit(t, {});
1689
- (!i || !(i instanceof Response)) && (i = await fetch(t, {})), l = await i.json();
1704
+ (!i || !(i instanceof Response)) && (i = await fetch(t, {})), a = await i.json();
1690
1705
  } catch (i) {
1691
- l = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1706
+ a = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1692
1707
  id: t,
1693
1708
  error: i,
1694
1709
  from: "runtime",
1695
1710
  lifecycle: "afterResolve",
1696
1711
  origin: this.HostInstance
1697
- }), l || (delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
1712
+ }), a || (delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
1698
1713
  manifestUrl: t,
1699
- moduleName: o.name,
1714
+ moduleName: r.name,
1700
1715
  hostName: this.HostInstance.options.name
1701
1716
  }, `${i}`)));
1702
1717
  }
1703
- return assert(l.metaData && l.exposes && l.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, l), l;
1704
- }, a = async () => {
1705
- const l = await s(), i = generateSnapshotFromManifest(l, {
1718
+ return assert(a.metaData && a.exposes && a.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, a), a;
1719
+ }, l = async () => {
1720
+ const a = await s(), i = generateSnapshotFromManifest(a, {
1706
1721
  version: t
1707
1722
  }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1708
1723
  options: this.HostInstance.options,
1709
- moduleInfo: o,
1710
- manifestJson: l,
1724
+ moduleInfo: r,
1725
+ manifestJson: a,
1711
1726
  remoteSnapshot: i,
1712
1727
  manifestUrl: t,
1713
1728
  from: "manifest"
1714
1729
  });
1715
1730
  return c;
1716
1731
  };
1717
- return this.manifestLoading[t] || (this.manifestLoading[t] = a().then((l) => l)), this.manifestLoading[t];
1732
+ return this.manifestLoading[t] || (this.manifestLoading[t] = l().then((a) => a)), this.manifestLoading[t];
1718
1733
  }
1719
1734
  constructor(t) {
1720
1735
  this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new PluginSystem({
@@ -1727,44 +1742,44 @@ class SnapshotHandler {
1727
1742
  }
1728
1743
  class SharedHandler {
1729
1744
  // register shared in shareScopeMap
1730
- registerShared(t, o) {
1731
- const { shareInfos: r, shared: s } = formatShareConfigs(t, o);
1732
- return Object.keys(r).forEach((l) => {
1733
- r[l].forEach((c) => {
1734
- !getRegisteredShare(this.shareScopeMap, l, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
1735
- pkgName: l,
1745
+ registerShared(t, r) {
1746
+ const { shareInfos: o, shared: s } = formatShareConfigs(t, r);
1747
+ return Object.keys(o).forEach((a) => {
1748
+ o[a].forEach((c) => {
1749
+ !getRegisteredShare(this.shareScopeMap, a, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
1750
+ pkgName: a,
1736
1751
  lib: c.lib,
1737
1752
  get: c.get,
1738
1753
  loaded: !0,
1739
1754
  shared: c,
1740
- from: o.name
1755
+ from: r.name
1741
1756
  });
1742
1757
  });
1743
1758
  }), {
1744
- shareInfos: r,
1759
+ shareInfos: o,
1745
1760
  shared: s
1746
1761
  };
1747
1762
  }
1748
- async loadShare(t, o) {
1749
- const { host: r } = this, s = getTargetSharedOptions({
1763
+ async loadShare(t, r) {
1764
+ const { host: o } = this, s = getTargetSharedOptions({
1750
1765
  pkgName: t,
1751
- extraOptions: o,
1752
- shareInfos: r.options.shared
1766
+ extraOptions: r,
1767
+ shareInfos: o.options.shared
1753
1768
  });
1754
1769
  s != null && s.scope && await Promise.all(s.scope.map(async (u) => {
1755
1770
  await Promise.all(this.initializeSharing(u, {
1756
1771
  strategy: s.strategy
1757
1772
  }));
1758
1773
  }));
1759
- const a = await this.hooks.lifecycle.beforeLoadShare.emit({
1774
+ const l = await this.hooks.lifecycle.beforeLoadShare.emit({
1760
1775
  pkgName: t,
1761
1776
  shareInfo: s,
1762
- shared: r.options.shared,
1763
- origin: r
1764
- }), { shareInfo: l } = a;
1765
- assert(l, `Cannot find ${t} Share in the ${r.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1766
- const i = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare), c = (u) => {
1767
- u.useIn || (u.useIn = []), addUniqueItem(u.useIn, r.options.name);
1777
+ shared: o.options.shared,
1778
+ origin: o
1779
+ }), { shareInfo: a } = l;
1780
+ assert(a, `Cannot find ${t} Share in the ${o.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1781
+ const i = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare), c = (u) => {
1782
+ u.useIn || (u.useIn = []), addUniqueItem(u.useIn, o.options.name);
1768
1783
  };
1769
1784
  if (i && i.lib)
1770
1785
  return c(i), i.lib;
@@ -1774,32 +1789,32 @@ class SharedHandler {
1774
1789
  } else if (i) {
1775
1790
  const d = (async () => {
1776
1791
  const p = await i.get();
1777
- l.lib = p, l.loaded = !0, c(l);
1778
- const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1792
+ a.lib = p, a.loaded = !0, c(a);
1793
+ const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1779
1794
  return m && (m.lib = p, m.loaded = !0), p;
1780
1795
  })();
1781
1796
  return this.setShared({
1782
1797
  pkgName: t,
1783
1798
  loaded: !1,
1784
1799
  shared: i,
1785
- from: r.options.name,
1800
+ from: o.options.name,
1786
1801
  lib: null,
1787
1802
  loading: d
1788
1803
  }), d;
1789
1804
  } else {
1790
- if (o != null && o.customShareInfo)
1805
+ if (r != null && r.customShareInfo)
1791
1806
  return !1;
1792
1807
  const d = (async () => {
1793
- const p = await l.get();
1794
- l.lib = p, l.loaded = !0, c(l);
1795
- const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1808
+ const p = await a.get();
1809
+ a.lib = p, a.loaded = !0, c(a);
1810
+ const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1796
1811
  return m && (m.lib = p, m.loaded = !0), p;
1797
1812
  })();
1798
1813
  return this.setShared({
1799
1814
  pkgName: t,
1800
1815
  loaded: !1,
1801
- shared: l,
1802
- from: r.options.name,
1816
+ shared: a,
1817
+ from: o.options.name,
1803
1818
  lib: null,
1804
1819
  loading: d
1805
1820
  }), d;
@@ -1811,52 +1826,52 @@ class SharedHandler {
1811
1826
  * If the share scope does not exist, it creates one.
1812
1827
  */
1813
1828
  // eslint-disable-next-line @typescript-eslint/member-ordering
1814
- initializeSharing(t = DEFAULT_SCOPE, o) {
1815
- const { host: r } = this, s = o == null ? void 0 : o.from, a = o == null ? void 0 : o.strategy;
1816
- let l = o == null ? void 0 : o.initScope;
1829
+ initializeSharing(t = DEFAULT_SCOPE, r) {
1830
+ const { host: o } = this, s = r == null ? void 0 : r.from, l = r == null ? void 0 : r.strategy;
1831
+ let a = r == null ? void 0 : r.initScope;
1817
1832
  const i = [];
1818
1833
  if (s !== "build") {
1819
1834
  const { initTokens: E } = this;
1820
- l || (l = []);
1821
- let g = E[t];
1822
- if (g || (g = E[t] = {
1835
+ a || (a = []);
1836
+ let R = E[t];
1837
+ if (R || (R = E[t] = {
1823
1838
  from: this.host.name
1824
- }), l.indexOf(g) >= 0) return i;
1825
- l.push(g);
1839
+ }), a.indexOf(R) >= 0) return i;
1840
+ a.push(R);
1826
1841
  }
1827
- const c = this.shareScopeMap, u = r.options.name;
1842
+ const c = this.shareScopeMap, u = o.options.name;
1828
1843
  c[t] || (c[t] = {});
1829
- const d = c[t], p = (E, g) => {
1844
+ const d = c[t], p = (E, R) => {
1830
1845
  var _;
1831
- const { version: b, eager: v } = g;
1846
+ const { version: b, eager: v } = R;
1832
1847
  d[E] = d[E] || {};
1833
- const S = d[E], I = S[b], R = !!(I && (I.eager || (_ = I.shareConfig) != null && _.eager));
1834
- (!I || I.strategy !== "loaded-first" && !I.loaded && (!v != !R ? v : u > I.from)) && (S[b] = g);
1835
- }, m = (E) => E && E.init && E.init(c[t], l), y = async (E) => {
1836
- const { module: g } = await r.remoteHandler.getRemoteModuleAndOptions({
1848
+ const S = d[E], I = S[b], g = !!(I && (I.eager || (_ = I.shareConfig) != null && _.eager));
1849
+ (!I || I.strategy !== "loaded-first" && !I.loaded && (!v != !g ? v : u > I.from)) && (S[b] = R);
1850
+ }, m = (E) => E && E.init && E.init(c[t], a), y = async (E) => {
1851
+ const { module: R } = await o.remoteHandler.getRemoteModuleAndOptions({
1837
1852
  id: E
1838
1853
  });
1839
- if (g.getEntry) {
1854
+ if (R.getEntry) {
1840
1855
  let _;
1841
1856
  try {
1842
- _ = await g.getEntry();
1857
+ _ = await R.getEntry();
1843
1858
  } catch (b) {
1844
- _ = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1859
+ _ = await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1845
1860
  id: E,
1846
1861
  error: b,
1847
1862
  from: "runtime",
1848
1863
  lifecycle: "beforeLoadShare",
1849
- origin: r
1864
+ origin: o
1850
1865
  });
1851
1866
  }
1852
- g.inited || (await m(_), g.inited = !0);
1867
+ R.inited || (await m(_), R.inited = !0);
1853
1868
  }
1854
1869
  };
1855
- return Object.keys(r.options.shared).forEach((E) => {
1856
- r.options.shared[E].forEach((_) => {
1870
+ return Object.keys(o.options.shared).forEach((E) => {
1871
+ o.options.shared[E].forEach((_) => {
1857
1872
  _.scope.includes(t) && p(E, _);
1858
1873
  });
1859
- }), (r.options.shareStrategy === "version-first" || a === "version-first") && r.options.remotes.forEach((E) => {
1874
+ }), (o.options.shareStrategy === "version-first" || l === "version-first") && o.options.remotes.forEach((E) => {
1860
1875
  E.shareScope === t && i.push(y(E.name));
1861
1876
  }), i;
1862
1877
  }
@@ -1864,32 +1879,32 @@ class SharedHandler {
1864
1879
  // 1. If the loaded shared already exists globally, then it will be reused
1865
1880
  // 2. If lib exists in local shared, it will be used directly
1866
1881
  // 3. If the local get returns something other than Promise, then it will be used directly
1867
- loadShareSync(t, o) {
1868
- const { host: r } = this, s = getTargetSharedOptions({
1882
+ loadShareSync(t, r) {
1883
+ const { host: o } = this, s = getTargetSharedOptions({
1869
1884
  pkgName: t,
1870
- extraOptions: o,
1871
- shareInfos: r.options.shared
1885
+ extraOptions: r,
1886
+ shareInfos: o.options.shared
1872
1887
  });
1873
1888
  s != null && s.scope && s.scope.forEach((i) => {
1874
1889
  this.initializeSharing(i, {
1875
1890
  strategy: s.strategy
1876
1891
  });
1877
1892
  });
1878
- const a = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), l = (i) => {
1879
- i.useIn || (i.useIn = []), addUniqueItem(i.useIn, r.options.name);
1893
+ const l = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), a = (i) => {
1894
+ i.useIn || (i.useIn = []), addUniqueItem(i.useIn, o.options.name);
1880
1895
  };
1881
- if (a) {
1882
- if (typeof a.lib == "function")
1883
- return l(a), a.loaded || (a.loaded = !0, a.from === r.options.name && (s.loaded = !0)), a.lib;
1884
- if (typeof a.get == "function") {
1885
- const i = a.get();
1896
+ if (l) {
1897
+ if (typeof l.lib == "function")
1898
+ return a(l), l.loaded || (l.loaded = !0, l.from === o.options.name && (s.loaded = !0)), l.lib;
1899
+ if (typeof l.get == "function") {
1900
+ const i = l.get();
1886
1901
  if (!(i instanceof Promise))
1887
- return l(a), this.setShared({
1902
+ return a(l), this.setShared({
1888
1903
  pkgName: t,
1889
1904
  loaded: !0,
1890
- from: r.options.name,
1905
+ from: o.options.name,
1891
1906
  lib: i,
1892
- shared: a
1907
+ shared: l
1893
1908
  }), i;
1894
1909
  }
1895
1910
  }
@@ -1898,37 +1913,37 @@ class SharedHandler {
1898
1913
  if (s.get) {
1899
1914
  const i = s.get();
1900
1915
  if (i instanceof Promise) {
1901
- const c = (o == null ? void 0 : o.from) === "build" ? RUNTIME_005 : RUNTIME_006;
1916
+ const c = (r == null ? void 0 : r.from) === "build" ? RUNTIME_005 : RUNTIME_006;
1902
1917
  throw new Error(getShortErrorMsg(c, runtimeDescMap, {
1903
- hostName: r.options.name,
1918
+ hostName: o.options.name,
1904
1919
  sharedPkgName: t
1905
1920
  }));
1906
1921
  }
1907
1922
  return s.lib = i, this.setShared({
1908
1923
  pkgName: t,
1909
1924
  loaded: !0,
1910
- from: r.options.name,
1925
+ from: o.options.name,
1911
1926
  lib: s.lib,
1912
1927
  shared: s
1913
1928
  }), s.lib;
1914
1929
  }
1915
1930
  throw new Error(getShortErrorMsg(RUNTIME_006, runtimeDescMap, {
1916
- hostName: r.options.name,
1931
+ hostName: o.options.name,
1917
1932
  sharedPkgName: t
1918
1933
  }));
1919
1934
  }
1920
- initShareScopeMap(t, o, r = {}) {
1935
+ initShareScopeMap(t, r, o = {}) {
1921
1936
  const { host: s } = this;
1922
- this.shareScopeMap[t] = o, this.hooks.lifecycle.initContainerShareScopeMap.emit({
1923
- shareScope: o,
1937
+ this.shareScopeMap[t] = r, this.hooks.lifecycle.initContainerShareScopeMap.emit({
1938
+ shareScope: r,
1924
1939
  options: s.options,
1925
1940
  origin: s,
1926
1941
  scopeName: t,
1927
- hostShareScopeMap: r.hostShareScopeMap
1942
+ hostShareScopeMap: o.hostShareScopeMap
1928
1943
  });
1929
1944
  }
1930
- setShared({ pkgName: t, shared: o, from: r, lib: s, loading: a, loaded: l, get: i }) {
1931
- const { version: c, scope: u = "default" } = o, d = _object_without_properties_loose(o, [
1945
+ setShared({ pkgName: t, shared: r, from: o, lib: s, loading: l, loaded: a, get: i }) {
1946
+ const { version: c, scope: u = "default" } = r, d = _object_without_properties_loose(r, [
1932
1947
  "version",
1933
1948
  "scope"
1934
1949
  ]);
@@ -1943,18 +1958,18 @@ class SharedHandler {
1943
1958
  ]
1944
1959
  }, d, {
1945
1960
  lib: s,
1946
- loaded: l,
1947
- loading: a
1961
+ loaded: a,
1962
+ loading: l
1948
1963
  }), i && (this.shareScopeMap[m][t][c].get = i);
1949
1964
  return;
1950
1965
  }
1951
1966
  const y = this.shareScopeMap[m][t][c];
1952
- a && !y.loading && (y.loading = a);
1967
+ l && !y.loading && (y.loading = l);
1953
1968
  });
1954
1969
  }
1955
1970
  _setGlobalShareScopeMap(t) {
1956
- const o = getGlobalShareScope(), r = t.id || t.name;
1957
- r && !o[r] && (o[r] = this.shareScopeMap);
1971
+ const r = getGlobalShareScope(), o = t.id || t.name;
1972
+ o && !r[o] && (r[o] = this.shareScopeMap);
1958
1973
  }
1959
1974
  constructor(t) {
1960
1975
  this.hooks = new PluginSystem({
@@ -1969,147 +1984,145 @@ class SharedHandler {
1969
1984
  }
1970
1985
  }
1971
1986
  class RemoteHandler {
1972
- formatAndRegisterRemote(t, o) {
1973
- return (o.remotes || []).reduce((s, a) => (this.registerRemote(a, s, {
1987
+ formatAndRegisterRemote(t, r) {
1988
+ return (r.remotes || []).reduce((s, l) => (this.registerRemote(l, s, {
1974
1989
  force: !1
1975
1990
  }), s), t.remotes);
1976
1991
  }
1977
- setIdToRemoteMap(t, o) {
1978
- const { remote: r, expose: s } = o, { name: a, alias: l } = r;
1992
+ setIdToRemoteMap(t, r) {
1993
+ const { remote: o, expose: s } = r, { name: l, alias: a } = o;
1979
1994
  if (this.idToRemoteMap[t] = {
1980
- name: r.name,
1995
+ name: o.name,
1981
1996
  expose: s
1982
- }, l && t.startsWith(a)) {
1983
- const i = t.replace(a, l);
1997
+ }, a && t.startsWith(l)) {
1998
+ const i = t.replace(l, a);
1984
1999
  this.idToRemoteMap[i] = {
1985
- name: r.name,
2000
+ name: o.name,
1986
2001
  expose: s
1987
2002
  };
1988
2003
  return;
1989
2004
  }
1990
- if (l && t.startsWith(l)) {
1991
- const i = t.replace(l, a);
2005
+ if (a && t.startsWith(a)) {
2006
+ const i = t.replace(a, l);
1992
2007
  this.idToRemoteMap[i] = {
1993
- name: r.name,
2008
+ name: o.name,
1994
2009
  expose: s
1995
2010
  };
1996
2011
  }
1997
2012
  }
1998
2013
  // eslint-disable-next-line max-lines-per-function
1999
2014
  // eslint-disable-next-line @typescript-eslint/member-ordering
2000
- async loadRemote(t, o) {
2001
- const { host: r } = this;
2015
+ async loadRemote(t, r) {
2016
+ const { host: o } = this;
2002
2017
  try {
2003
- const { loadFactory: s = !0 } = o || {
2018
+ const { loadFactory: s = !0 } = r || {
2004
2019
  loadFactory: !0
2005
- }, { module: a, moduleOptions: l, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2020
+ }, { module: l, moduleOptions: a, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2006
2021
  id: t
2007
- }), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, y = await a.get(p, d, o, m), E = await this.hooks.lifecycle.onLoad.emit({
2022
+ }), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, y = await l.get(p, d, r, m), E = await this.hooks.lifecycle.onLoad.emit({
2008
2023
  id: p,
2009
2024
  pkgNameOrAlias: c,
2010
2025
  expose: d,
2011
2026
  exposeModule: s ? y : void 0,
2012
2027
  exposeModuleFactory: s ? void 0 : y,
2013
2028
  remote: u,
2014
- options: l,
2015
- moduleInstance: a,
2016
- origin: r
2029
+ options: a,
2030
+ moduleInstance: l,
2031
+ origin: o
2017
2032
  });
2018
2033
  return this.setIdToRemoteMap(t, i), typeof E == "function" ? E : y;
2019
2034
  } catch (s) {
2020
- const { from: a = "runtime" } = o || {
2035
+ const { from: l = "runtime" } = r || {
2021
2036
  from: "runtime"
2022
- }, l = await this.hooks.lifecycle.errorLoadRemote.emit({
2037
+ }, a = await this.hooks.lifecycle.errorLoadRemote.emit({
2023
2038
  id: t,
2024
2039
  error: s,
2025
- from: a,
2040
+ from: l,
2026
2041
  lifecycle: "onLoad",
2027
- origin: r
2042
+ origin: o
2028
2043
  });
2029
- if (!l)
2044
+ if (!a)
2030
2045
  throw s;
2031
- return l;
2046
+ return a;
2032
2047
  }
2033
2048
  }
2034
2049
  // eslint-disable-next-line @typescript-eslint/member-ordering
2035
2050
  async preloadRemote(t) {
2036
- const { host: o } = this;
2051
+ const { host: r } = this;
2037
2052
  await this.hooks.lifecycle.beforePreloadRemote.emit({
2038
2053
  preloadOps: t,
2039
- options: o.options,
2040
- origin: o
2054
+ options: r.options,
2055
+ origin: r
2041
2056
  });
2042
- const r = formatPreloadArgs(o.options.remotes, t);
2043
- await Promise.all(r.map(async (s) => {
2044
- const { remote: a } = s, l = getRemoteInfo(a), { globalSnapshot: i, remoteSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo({
2045
- moduleInfo: a
2046
- }), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2047
- origin: o,
2057
+ const o = formatPreloadArgs(r.options.remotes, t);
2058
+ await Promise.all(o.map(async (s) => {
2059
+ const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await r.snapshotHandler.loadRemoteSnapshotInfo(l), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2060
+ origin: r,
2048
2061
  preloadOptions: s,
2049
- remote: a,
2050
- remoteInfo: l,
2062
+ remote: l,
2063
+ remoteInfo: a,
2051
2064
  globalSnapshot: i,
2052
2065
  remoteSnapshot: c
2053
2066
  });
2054
- u && preloadAssets(l, o, u);
2067
+ u && preloadAssets(a, r, u);
2055
2068
  }));
2056
2069
  }
2057
- registerRemotes(t, o) {
2058
- const { host: r } = this;
2070
+ registerRemotes(t, r) {
2071
+ const { host: o } = this;
2059
2072
  t.forEach((s) => {
2060
- this.registerRemote(s, r.options.remotes, {
2061
- force: o == null ? void 0 : o.force
2073
+ this.registerRemote(s, o.options.remotes, {
2074
+ force: r == null ? void 0 : r.force
2062
2075
  });
2063
2076
  });
2064
2077
  }
2065
2078
  async getRemoteModuleAndOptions(t) {
2066
- const { host: o } = this, { id: r } = t;
2079
+ const { host: r } = this, { id: o } = t;
2067
2080
  let s;
2068
2081
  try {
2069
2082
  s = await this.hooks.lifecycle.beforeRequest.emit({
2070
- id: r,
2071
- options: o.options,
2072
- origin: o
2083
+ id: o,
2084
+ options: r.options,
2085
+ origin: r
2073
2086
  });
2074
2087
  } catch (E) {
2075
2088
  if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
2076
- id: r,
2077
- options: o.options,
2078
- origin: o,
2089
+ id: o,
2090
+ options: r.options,
2091
+ origin: r,
2079
2092
  from: "runtime",
2080
2093
  error: E,
2081
2094
  lifecycle: "beforeRequest"
2082
2095
  }), !s)
2083
2096
  throw E;
2084
2097
  }
2085
- const { id: a } = s, l = matchRemoteWithNameAndExpose(o.options.remotes, a);
2086
- assert(l, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
2087
- hostName: o.options.name,
2088
- requestId: a
2098
+ const { id: l } = s, a = matchRemoteWithNameAndExpose(r.options.remotes, l);
2099
+ assert(a, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
2100
+ hostName: r.options.name,
2101
+ requestId: l
2089
2102
  }));
2090
- const { remote: i } = l, c = getRemoteInfo(i), u = await o.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2091
- id: a
2092
- }, l, {
2093
- options: o.options,
2094
- origin: o,
2103
+ const { remote: i } = a, c = getRemoteInfo(i), u = await r.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2104
+ id: l
2105
+ }, a, {
2106
+ options: r.options,
2107
+ origin: r,
2095
2108
  remoteInfo: c
2096
2109
  })), { remote: d, expose: p } = u;
2097
- assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2098
- let m = o.moduleCache.get(d.name);
2110
+ assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);
2111
+ let m = r.moduleCache.get(d.name);
2099
2112
  const y = {
2100
- host: o,
2113
+ host: r,
2101
2114
  remoteInfo: c
2102
2115
  };
2103
- return m || (m = new Module(y), o.moduleCache.set(d.name, m)), {
2116
+ return m || (m = new Module(y), r.moduleCache.set(d.name, m)), {
2104
2117
  module: m,
2105
2118
  moduleOptions: y,
2106
2119
  remoteMatchInfo: u
2107
2120
  };
2108
2121
  }
2109
- registerRemote(t, o, r) {
2110
- const { host: s } = this, a = () => {
2122
+ registerRemote(t, r, o) {
2123
+ const { host: s } = this, l = () => {
2111
2124
  if (t.alias) {
2112
- const i = o.find((c) => {
2125
+ const i = r.find((c) => {
2113
2126
  var u;
2114
2127
  return t.alias && (c.name.startsWith(t.alias) || ((u = c.alias) == null ? void 0 : u.startsWith(t.alias)));
2115
2128
  });
@@ -2121,9 +2134,9 @@ class RemoteHandler {
2121
2134
  remote: t,
2122
2135
  origin: s
2123
2136
  });
2124
- const l = o.find((i) => i.name === t.name);
2125
- if (!l)
2126
- a(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2137
+ const a = r.find((i) => i.name === t.name);
2138
+ if (!a)
2139
+ l(), r.push(t), this.hooks.lifecycle.registerRemote.emit({
2127
2140
  remote: t,
2128
2141
  origin: s
2129
2142
  });
@@ -2132,7 +2145,7 @@ class RemoteHandler {
2132
2145
  `The remote "${t.name}" is already registered.`,
2133
2146
  "Please note that overriding it may cause unexpected errors."
2134
2147
  ];
2135
- r != null && r.force && (this.removeRemote(l), a(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2148
+ o != null && o.force && (this.removeRemote(a), l(), r.push(t), this.hooks.lifecycle.registerRemote.emit({
2136
2149
  remote: t,
2137
2150
  origin: s
2138
2151
  }), warn$1(i.join(" ")));
@@ -2140,61 +2153,61 @@ class RemoteHandler {
2140
2153
  }
2141
2154
  removeRemote(t) {
2142
2155
  try {
2143
- const { host: r } = this, { name: s } = t, a = r.options.remotes.findIndex((i) => i.name === s);
2144
- a !== -1 && r.options.remotes.splice(a, 1);
2145
- const l = r.moduleCache.get(t.name);
2146
- if (l) {
2147
- const i = l.remoteInfo, c = i.entryGlobalName;
2156
+ const { host: o } = this, { name: s } = t, l = o.options.remotes.findIndex((i) => i.name === s);
2157
+ l !== -1 && o.options.remotes.splice(l, 1);
2158
+ const a = o.moduleCache.get(t.name);
2159
+ if (a) {
2160
+ const i = a.remoteInfo, c = i.entryGlobalName;
2148
2161
  if (CurrentGlobal[c]) {
2149
- var o;
2150
- (o = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && o.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2162
+ var r;
2163
+ (r = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && r.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2151
2164
  }
2152
- const u = getRemoteEntryUniqueKey(l.remoteInfo);
2153
- globalLoading[u] && delete globalLoading[u], r.snapshotHandler.manifestCache.delete(i.entry);
2165
+ const u = getRemoteEntryUniqueKey(a.remoteInfo);
2166
+ globalLoading[u] && delete globalLoading[u], o.snapshotHandler.manifestCache.delete(i.entry);
2154
2167
  let d = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2155
2168
  const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === d : y.name === d);
2156
2169
  if (p !== -1) {
2157
2170
  const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
2158
2171
  d = y.options.id || d;
2159
2172
  const E = getGlobalShareScope();
2160
- let g = !0;
2173
+ let R = !0;
2161
2174
  const _ = [];
2162
2175
  Object.keys(E).forEach((b) => {
2163
2176
  const v = E[b];
2164
2177
  v && Object.keys(v).forEach((S) => {
2165
2178
  const I = v[S];
2166
- I && Object.keys(I).forEach((R) => {
2167
- const A = I[R];
2168
- A && Object.keys(A).forEach((T) => {
2169
- const $ = A[T];
2170
- $ && typeof $ == "object" && $.from === i.name && ($.loaded || $.loading ? ($.useIn = $.useIn.filter((w) => w !== i.name), $.useIn.length ? g = !1 : _.push([
2179
+ I && Object.keys(I).forEach((g) => {
2180
+ const A = I[g];
2181
+ A && Object.keys(A).forEach(($) => {
2182
+ const T = A[$];
2183
+ T && typeof T == "object" && T.from === i.name && (T.loaded || T.loading ? (T.useIn = T.useIn.filter((N) => N !== i.name), T.useIn.length ? R = !1 : _.push([
2171
2184
  b,
2172
2185
  S,
2173
- R,
2174
- T
2186
+ g,
2187
+ $
2175
2188
  ])) : _.push([
2176
2189
  b,
2177
2190
  S,
2178
- R,
2179
- T
2191
+ g,
2192
+ $
2180
2193
  ]));
2181
2194
  });
2182
2195
  });
2183
2196
  });
2184
- }), g && (y.shareScopeMap = {}, delete E[d]), _.forEach(([b, v, S, I]) => {
2185
- var R, A, T;
2186
- (T = E[b]) == null || (A = T[v]) == null || (R = A[S]) == null || delete R[I];
2197
+ }), R && (y.shareScopeMap = {}, delete E[d]), _.forEach(([b, v, S, I]) => {
2198
+ var g, A, $;
2199
+ ($ = E[b]) == null || (A = $[v]) == null || (g = A[S]) == null || delete g[I];
2187
2200
  }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
2188
2201
  }
2189
- const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, r);
2202
+ const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, o);
2190
2203
  if (m) {
2191
2204
  const y = m && "remotesInfo" in m && m.remotesInfo && getInfoWithoutType(m.remotesInfo, t.name).key;
2192
2205
  y && (delete m.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2193
2206
  }
2194
- r.moduleCache.delete(t.name);
2207
+ o.moduleCache.delete(t.name);
2195
2208
  }
2196
- } catch (r) {
2197
- logger.log("removeRemote fail: ", r);
2209
+ } catch (o) {
2210
+ logger.log("removeRemote fail: ", o);
2198
2211
  }
2199
2212
  }
2200
2213
  constructor(t) {
@@ -2217,59 +2230,59 @@ const USE_SNAPSHOT = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean"
2217
2230
  class FederationHost {
2218
2231
  initOptions(t) {
2219
2232
  this.registerPlugins(t.plugins);
2220
- const o = this.formatOptions(this.options, t);
2221
- return this.options = o, o;
2233
+ const r = this.formatOptions(this.options, t);
2234
+ return this.options = r, r;
2222
2235
  }
2223
- async loadShare(t, o) {
2224
- return this.sharedHandler.loadShare(t, o);
2236
+ async loadShare(t, r) {
2237
+ return this.sharedHandler.loadShare(t, r);
2225
2238
  }
2226
2239
  // The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
2227
2240
  // 1. If the loaded shared already exists globally, then it will be reused
2228
2241
  // 2. If lib exists in local shared, it will be used directly
2229
2242
  // 3. If the local get returns something other than Promise, then it will be used directly
2230
- loadShareSync(t, o) {
2231
- return this.sharedHandler.loadShareSync(t, o);
2243
+ loadShareSync(t, r) {
2244
+ return this.sharedHandler.loadShareSync(t, r);
2232
2245
  }
2233
- initializeSharing(t = DEFAULT_SCOPE, o) {
2234
- return this.sharedHandler.initializeSharing(t, o);
2246
+ initializeSharing(t = DEFAULT_SCOPE, r) {
2247
+ return this.sharedHandler.initializeSharing(t, r);
2235
2248
  }
2236
- initRawContainer(t, o, r) {
2249
+ initRawContainer(t, r, o) {
2237
2250
  const s = getRemoteInfo({
2238
2251
  name: t,
2239
- entry: o
2240
- }), a = new Module({
2252
+ entry: r
2253
+ }), l = new Module({
2241
2254
  host: this,
2242
2255
  remoteInfo: s
2243
2256
  });
2244
- return a.remoteEntryExports = r, this.moduleCache.set(t, a), a;
2257
+ return l.remoteEntryExports = o, this.moduleCache.set(t, l), l;
2245
2258
  }
2246
2259
  // eslint-disable-next-line max-lines-per-function
2247
2260
  // eslint-disable-next-line @typescript-eslint/member-ordering
2248
- async loadRemote(t, o) {
2249
- return this.remoteHandler.loadRemote(t, o);
2261
+ async loadRemote(t, r) {
2262
+ return this.remoteHandler.loadRemote(t, r);
2250
2263
  }
2251
2264
  // eslint-disable-next-line @typescript-eslint/member-ordering
2252
2265
  async preloadRemote(t) {
2253
2266
  return this.remoteHandler.preloadRemote(t);
2254
2267
  }
2255
- initShareScopeMap(t, o, r = {}) {
2256
- this.sharedHandler.initShareScopeMap(t, o, r);
2268
+ initShareScopeMap(t, r, o = {}) {
2269
+ this.sharedHandler.initShareScopeMap(t, r, o);
2257
2270
  }
2258
- formatOptions(t, o) {
2259
- const { shared: r } = formatShareConfigs(t, o), { userOptions: s, options: a } = this.hooks.lifecycle.beforeInit.emit({
2271
+ formatOptions(t, r) {
2272
+ const { shared: o } = formatShareConfigs(t, r), { userOptions: s, options: l } = this.hooks.lifecycle.beforeInit.emit({
2260
2273
  origin: this,
2261
- userOptions: o,
2274
+ userOptions: r,
2262
2275
  options: t,
2263
- shareInfo: r
2264
- }), l = this.remoteHandler.formatAndRegisterRemote(a, s), { shared: i } = this.sharedHandler.registerShared(a, s), c = [
2265
- ...a.plugins
2276
+ shareInfo: o
2277
+ }), a = this.remoteHandler.formatAndRegisterRemote(l, s), { shared: i } = this.sharedHandler.registerShared(l, s), c = [
2278
+ ...l.plugins
2266
2279
  ];
2267
2280
  s.plugins && s.plugins.forEach((d) => {
2268
2281
  c.includes(d) || c.push(d);
2269
2282
  });
2270
- const u = _extends$1({}, t, o, {
2283
+ const u = _extends$1({}, t, r, {
2271
2284
  plugins: c,
2272
- remotes: l,
2285
+ remotes: a,
2273
2286
  shared: i
2274
2287
  });
2275
2288
  return this.hooks.lifecycle.init.emit({
@@ -2278,7 +2291,7 @@ class FederationHost {
2278
2291
  }), u;
2279
2292
  }
2280
2293
  registerPlugins(t) {
2281
- const o = registerPlugins(t, [
2294
+ const r = registerPlugins(t, [
2282
2295
  this.hooks,
2283
2296
  this.remoteHandler.hooks,
2284
2297
  this.sharedHandler.hooks,
@@ -2286,10 +2299,10 @@ class FederationHost {
2286
2299
  this.loaderHook,
2287
2300
  this.bridgeHook
2288
2301
  ]);
2289
- this.options.plugins = this.options.plugins.reduce((r, s) => (s && r && !r.find((a) => a.name === s.name) && r.push(s), r), o || []);
2302
+ this.options.plugins = this.options.plugins.reduce((o, s) => (s && o && !o.find((l) => l.name === s.name) && o.push(s), o), r || []);
2290
2303
  }
2291
- registerRemotes(t, o) {
2292
- return this.remoteHandler.registerRemotes(t, o);
2304
+ registerRemotes(t, r) {
2305
+ return this.remoteHandler.registerRemotes(t, r);
2293
2306
  }
2294
2307
  constructor(t) {
2295
2308
  this.hooks = new PluginSystem({
@@ -2299,7 +2312,7 @@ class FederationHost {
2299
2312
  beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
2300
2313
  // maybe will change, temporarily for internal use only
2301
2314
  initContainer: new AsyncWaterfallHook("initContainer")
2302
- }), this.version = "0.14.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2315
+ }), this.version = "0.13.1", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2303
2316
  // FIXME: may not be suitable , not open to the public yet
2304
2317
  getModuleInfo: new SyncHook(),
2305
2318
  createScript: new SyncHook(),
@@ -2313,21 +2326,21 @@ class FederationHost {
2313
2326
  beforeBridgeDestroy: new SyncHook(),
2314
2327
  afterBridgeDestroy: new SyncHook()
2315
2328
  });
2316
- const o = USE_SNAPSHOT ? [
2329
+ const r = USE_SNAPSHOT ? [
2317
2330
  snapshotPlugin(),
2318
2331
  generatePreloadAssetsPlugin()
2319
- ] : [], r = {
2332
+ ] : [], o = {
2320
2333
  id: getBuilderId(),
2321
2334
  name: t.name,
2322
- plugins: o,
2335
+ plugins: r,
2323
2336
  remotes: [],
2324
2337
  shared: {},
2325
2338
  inBrowser: isBrowserEnv()
2326
2339
  };
2327
- this.name = t.name, this.options = r, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2328
- ...r.plugins,
2340
+ 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([
2341
+ ...o.plugins,
2329
2342
  ...t.plugins || []
2330
- ]), this.options = this.formatOptions(r, t);
2343
+ ]), this.options = this.formatOptions(o, t);
2331
2344
  }
2332
2345
  }
2333
2346
  let FederationInstance = null;
@@ -2336,24 +2349,24 @@ function getInstance() {
2336
2349
  }
2337
2350
  setGlobalFederationConstructor(FederationHost);
2338
2351
  function createBridgeComponent(n) {
2339
- const t = /* @__PURE__ */ new Map(), o = getInstance();
2352
+ const t = /* @__PURE__ */ new Map(), r = getInstance();
2340
2353
  return () => ({
2341
- __APP_VERSION__: "0.14.0",
2342
- async render(r) {
2343
- var E, g, _;
2344
- LoggerInstance.debug("createBridgeComponent render Info", r);
2354
+ __APP_VERSION__: "0.13.1",
2355
+ async render(o) {
2356
+ var E, R, _;
2357
+ LoggerInstance.debug("createBridgeComponent render Info", o);
2345
2358
  const {
2346
2359
  moduleName: s,
2347
- dom: a,
2348
- basename: l,
2360
+ dom: l,
2361
+ basename: a,
2349
2362
  memoryRoute: i,
2350
2363
  hashRoute: c,
2351
2364
  ...u
2352
- } = r, d = Vue.createApp(n.rootComponent, u);
2353
- t.set(a, d);
2354
- const p = await ((_ = (g = (E = o == null ? void 0 : o.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : g.beforeBridgeRender) == null ? void 0 : _.emit(r)), m = p && typeof p == "object" && (p != null && p.extraProps) ? p == null ? void 0 : p.extraProps : {}, y = n.appOptions({
2365
+ } = o, d = Vue.createApp(n.rootComponent, u);
2366
+ t.set(l, d);
2367
+ const p = await ((_ = (R = (E = r == null ? void 0 : r.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : R.beforeBridgeRender) == null ? void 0 : _.emit(o)), m = p && typeof p == "object" && (p != null && p.extraProps) ? p == null ? void 0 : p.extraProps : {}, y = n.appOptions({
2355
2368
  app: d,
2356
- basename: l,
2369
+ basename: a,
2357
2370
  memoryRoute: i,
2358
2371
  hashRoute: c,
2359
2372
  ...u,
@@ -2361,10 +2374,10 @@ function createBridgeComponent(n) {
2361
2374
  });
2362
2375
  if (y != null && y.router) {
2363
2376
  let b, v = y.router.getRoutes();
2364
- r.memoryRoute ? b = VueRouter.createMemoryHistory(r.basename) : r.hashRoute ? (b = VueRouter.createWebHashHistory(), v = v.map((I) => ({
2377
+ o.memoryRoute ? b = VueRouter.createMemoryHistory(o.basename) : o.hashRoute ? (b = VueRouter.createWebHashHistory(), v = v.map((I) => ({
2365
2378
  ...I,
2366
- path: r.basename + I.path
2367
- }))) : b = VueRouter.createWebHistory(r.basename);
2379
+ path: o.basename + I.path
2380
+ }))) : b = VueRouter.createWebHistory(o.basename);
2368
2381
  const S = VueRouter.createRouter({
2369
2382
  ...y.router.options,
2370
2383
  history: b,
@@ -2375,11 +2388,11 @@ function createBridgeComponent(n) {
2375
2388
  router: S
2376
2389
  }), i && await S.push(i.entryPath), d.use(S);
2377
2390
  }
2378
- d.mount(a);
2391
+ d.mount(l);
2379
2392
  },
2380
- destroy(r) {
2381
- LoggerInstance.debug("createBridgeComponent destroy Info", r);
2382
- const s = t.get(r == null ? void 0 : r.dom);
2393
+ destroy(o) {
2394
+ LoggerInstance.debug("createBridgeComponent destroy Info", o);
2395
+ const s = t.get(o == null ? void 0 : o.dom);
2383
2396
  s == null || s.unmount();
2384
2397
  }
2385
2398
  });
@@ -2400,12 +2413,12 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2400
2413
  },
2401
2414
  inheritAttrs: !1,
2402
2415
  setup(n) {
2403
- const t = ref(null), o = ref(null), r = ref(""), s = useRoute(), a = getInstance(), l = useAttrs(), i = async () => {
2404
- var m, y, E, g;
2416
+ const t = ref(null), r = ref(null), o = ref(""), s = useRoute(), l = getInstance(), a = useAttrs(), i = async () => {
2417
+ var m, y, E, R;
2405
2418
  const u = (m = n.providerInfo) == null ? void 0 : m.call(n);
2406
- o.value = u;
2419
+ r.value = u;
2407
2420
  let d = {
2408
- ...l,
2421
+ ...a,
2409
2422
  moduleName: n.moduleName,
2410
2423
  dom: t.value,
2411
2424
  basename: n.basename,
@@ -2413,16 +2426,16 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2413
2426
  hashRoute: n.hashRoute
2414
2427
  };
2415
2428
  LoggerInstance.debug("createRemoteComponent LazyComponent render >>>", d);
2416
- const p = await ((g = (E = (y = a == null ? void 0 : a.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : E.beforeBridgeRender) == null ? void 0 : g.emit(d)) || {};
2429
+ const p = await ((R = (E = (y = l == null ? void 0 : l.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : E.beforeBridgeRender) == null ? void 0 : R.emit(d)) || {};
2417
2430
  d = {
2418
2431
  ...d,
2419
2432
  ...p.extraProps
2420
2433
  }, u.render(d);
2421
2434
  }, c = watch(() => s == null ? void 0 : s.path, (u) => {
2422
- u !== s.path && i(), r.value !== "" && r.value !== u && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2435
+ u !== s.path && i(), o.value !== "" && o.value !== u && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2423
2436
  ...n,
2424
2437
  pathname: s.path
2425
- }), e()), r.value = u;
2438
+ }), e()), o.value = u;
2426
2439
  });
2427
2440
  return onMounted(() => {
2428
2441
  i();
@@ -2430,7 +2443,7 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2430
2443
  var u;
2431
2444
  LoggerInstance.debug("createRemoteComponent LazyComponent destroy >>>", {
2432
2445
  ...n
2433
- }), c(), (u = o.value) == null || u.destroy({
2446
+ }), c(), (u = r.value) == null || u.destroy({
2434
2447
  dom: t.value
2435
2448
  });
2436
2449
  }), () => createVNode("div", mergeProps(n.rootAttrs || {}, {
@@ -2440,31 +2453,31 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2440
2453
  });
2441
2454
  function createRemoteComponent(n) {
2442
2455
  return defineAsyncComponent({
2443
- __APP_VERSION__: "0.14.0",
2456
+ __APP_VERSION__: "0.13.1",
2444
2457
  ...n.asyncComponentOptions,
2445
2458
  //@ts-ignore
2446
2459
  loader: async () => {
2447
2460
  var c, u;
2448
2461
  const t = useRoute();
2449
- let o = "/";
2450
- const r = (u = (c = t == null ? void 0 : t.matched) == null ? void 0 : c[0]) == null ? void 0 : u.path;
2451
- r && (r.endsWith("/:pathMatch(.*)*") ? o = r.replace("/:pathMatch(.*)*", "") : o = t.matched[0].path);
2462
+ let r = "/";
2463
+ const o = (u = (c = t == null ? void 0 : t.matched) == null ? void 0 : c[0]) == null ? void 0 : u.path;
2464
+ o && (o.endsWith("/:pathMatch(.*)*") ? r = o.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
2452
2465
  const s = (n == null ? void 0 : n.export) || "default";
2453
2466
  LoggerInstance.debug("createRemoteComponent LazyComponent create >>>", {
2454
- basename: o,
2467
+ basename: r,
2455
2468
  info: n
2456
2469
  });
2457
- const a = await n.loader(), l = a && a[Symbol.for("mf_module_id")], i = a[s];
2470
+ const l = await n.loader(), a = l && l[Symbol.for("mf_module_id")], i = l[s];
2458
2471
  if (LoggerInstance.debug(
2459
2472
  "createRemoteComponent LazyComponent loadRemote info >>>",
2460
- { moduleName: l, module: a, exportName: s, basename: o, route: t }
2461
- ), s in a && typeof i == "function")
2473
+ { moduleName: a, module: l, exportName: s, basename: r, route: t }
2474
+ ), s in l && typeof i == "function")
2462
2475
  return {
2463
2476
  render() {
2464
2477
  return h(RemoteApp, {
2465
- moduleName: l,
2478
+ moduleName: a,
2466
2479
  providerInfo: i,
2467
- basename: o,
2480
+ basename: r,
2468
2481
  rootAttrs: n.rootAttrs
2469
2482
  });
2470
2483
  }