@appshell/loader 1.0.0-alpha.12 → 1.0.0-alpha.14
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/CHANGELOG.md +14 -0
- package/dist/main.js +1 -1
- package/dist/types/config/src/types.d.ts +13 -0
- package/dist/types/config/src/types.d.ts.map +1 -1
- package/dist/types/loader/src/loadAppshellComponent.d.ts +1 -5
- package/dist/types/loader/src/loadAppshellComponent.d.ts.map +1 -1
- package/dist/types/loader/src/remoteLoader.d.ts +1 -3
- package/dist/types/loader/src/remoteLoader.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/loadAppshellComponent.ts +10 -32
- package/src/remoteLoader.ts +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.14](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2026-08-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @appshell/loader
|
|
9
|
+
|
|
10
|
+
# [1.0.0-alpha.13](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2026-08-22)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **loader,react:** stop forcing a full page reload on remote updates ([36b96c4](https://github.com/appshell-org/appshell/commit/36b96c471dcedf1d29847ef5e41fb21c04864d45))
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- **hmr:** checkpoint current composed app hot reload work ([165788d](https://github.com/appshell-org/appshell/commit/165788d2f276e5f82b750d84abf6cab2e73f8f64))
|
|
19
|
+
|
|
6
20
|
# [1.0.0-alpha.12](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2026-08-21)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{chainResolvers:()=>ko,default:()=>To,inlineResolver:()=>No,legacyManifestResolver:()=>Ro,registryResolver:()=>vo});const o=".json",r="FEDERATION_DEBUG";let n=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const s="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function i(){return s}function a(){return"undefined"!=typeof navigator&&"ReactNative"===navigator?.product}function c(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?Boolean(process.env.FEDERATION_DEBUG):!("undefined"==typeof FEDERATION_DEBUG||!Boolean(FEDERATION_DEBUG))||function(){try{if(i()&&window.localStorage)return Boolean(localStorage.getItem(r))}catch(e){return!1}return!1}()}const l="[ Module Federation ]",h=console,m=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];var f=class{constructor(e,t=h){this.prefix=e,this.delegate=t??h}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??h}emit(e,t){const o=this.delegate,r=c()?function(){try{const e=(new Error).stack;if(!e)return;const[,...t]=e.split("\n"),o=t.filter((e=>!m.some((t=>e.includes(t)))));if(!o.length)return;return`Stack trace:\n${o.slice(0,5).join("\n")}`}catch{return}}():void 0,n=r?[...t,r]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const e of s){const t=o[e];if("function"==typeof t)return void t.call(o,this.prefix,...n)}for(const e of s){const t=h[e];if("function"==typeof t)return void t.call(h,this.prefix,...n)}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){c()&&this.emit("debug",e)}};function u(e){return new f(e)}u(l),function(e){const t=new f(e);Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1})}(l);const d=(e,t,o,r)=>{const n=[`${[t[e]]} #${e}`];return o&&n.push(`args: ${JSON.stringify(o)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),r&&n.push(`Original Error Message:\n ${r}`),n.join("\n")},p="[ Federation Runtime ]",y=u(p);function g(e,t,o,r,n){e||(void 0!==o?E(t,o,r,void 0):E(t))}function E(e,t,o,r,n){if(void 0!==t)return function(e,t,o,r,n){return(e=>{throw new Error(`${p}: ${e}`)})(d(e,t,o,n))}(e,t,o??{},0,r);const s=e;if(s instanceof Error)throw s.message.startsWith(p)||(s.message=`${p}: ${s.message}`),s;throw new Error(`${p}: ${s}`)}function S(e){e instanceof Error?(e.message.startsWith(p)||(e.message=`${p}: ${e.message}`),y.warn(e)):y.warn(e)}function _(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function I(e){return void 0!==e.entry}function b(e){return!e.entry.includes(".json")}function w(e){return e&&"object"==typeof e}const $=Object.prototype.toString;function N(e){return Array.isArray(e)?e:[e]}function v(e){const t={url:"",type:"global",globalName:""};return s||a()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const R="object"==typeof globalThis?globalThis:window,k=(()=>{try{return document.defaultView}catch{return R}})(),O=k;function T(e,t,o){Object.defineProperty(e,t,{value:o,configurable:!1,writable:!0})}function A(e,t){return Object.hasOwnProperty.call(e,t)}A(R,"__GLOBAL_LOADING_REMOTE_ENTRY__")||T(R,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const x=R.__GLOBAL_LOADING_REMOTE_ENTRY__;function M(e){A(e,"__VMOK__")&&!A(e,"__FEDERATION__")&&T(e,"__FEDERATION__",e.__VMOK__),A(e,"__FEDERATION__")||(T(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),T(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}function L(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};{const o=Object.keys(e);for(const r of o){const[o,n]=r.split(":"),s=`${o}:${t}`,i=e[s];if(i)return{value:i,key:s}}return{value:void 0,key:t}}}E(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}M(R),M(k);const P=()=>k.__FEDERATION__.moduleInfo,D=e=>((e,t)=>{const o=L(t,_(e)).value;if(o&&!o.version&&"version"in e&&e.version&&(o.version=e.version),o)return o;if("version"in e&&e.version){const{version:t,...o}=e,r=_(o),n=L(k.__FEDERATION__.moduleInfo,r).value;if(n?.version===t)return n}})(e,k.__FEDERATION__.moduleInfo),H=(e,t)=>{const o=_(e);return k.__FEDERATION__.moduleInfo[o]=t,k.__FEDERATION__.moduleInfo},F=(e,t)=>{const o=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:o,entryExports:R[o]}},C=e=>R.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),j="default",U="global",G="[0-9A-Za-z-]+",B=`(?:\\+(${G}(?:\\.${G})*))`,V="0|[1-9]\\d*",W="[0-9]+",q="\\d*[a-zA-Z-][a-zA-Z0-9-]*",z=`(?:${W}|${q})`,K=`(?:${V}|${q})`,Z=`(?:-(${K}(?:\\.${K})*))`,J=`${V}|x|X|\\*`,Y=`[v=\\s]*(${J})(?:\\.(${J})(?:\\.(${J})(?:${Z})?${B}?)?)?`,X=`^\\s*(${Y})\\s+-\\s+(${Y})\\s*$`,Q="((?:<|>)?=?)",ee=`(\\s*)${Q}\\s*([v=\\s]*(${W})\\.(${W})\\.(${W})(?:-?(${z}(?:\\.${z})*))?${B}?|${Y})`,te="(?:~>?)",oe=`(\\s*)${te}\\s+`,re="(?:\\^)",ne=`(\\s*)${re}\\s+`,se="(<|>)?=?\\s*\\*",ie=`^${re}${Y}$`,ae=`^${te}${Y}$`,ce=`^${Q}\\s*${Y}$`,le=`^${Q}\\s*(v?(${V})\\.(${V})\\.(${V})${Z}?${B}?)$|^$`,he="^\\s*>=\\s*0.0.0\\s*$";function me(e){return new RegExp(e)}function fe(e){return!e||"x"===e.toLowerCase()||"*"===e}function ue(...e){return t=>e.reduce(((e,t)=>t(e)),t)}function de(e){return e.match(me(le))}function pe(e,t,o,r){const n=`${e}.${t}.${o}`;return r?`${n}-${r}`:n}function ye(e){return e.replace(me(X),((e,t,o,r,n,s,i,a,c,l,h,m)=>`${t=fe(o)?"":fe(r)?`>=${o}.0.0`:fe(n)?`>=${o}.${r}.0`:`>=${t}`} ${a=fe(c)?"":fe(l)?`<${Number(c)+1}.0.0-0`:fe(h)?`<${c}.${Number(l)+1}.0-0`:m?`<=${c}.${l}.${h}-${m}`:`<=${a}`}`.trim()))}function ge(e){return e.replace(me(ee),"$1$2$3")}function Ee(e){return e.replace(me(oe),"$1~")}function Se(e){return e.replace(me(ne),"$1^")}function _e(e){return e.trim().split(/\s+/).map((e=>e.replace(me(ie),((e,t,o,r,n)=>fe(t)?"":fe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:fe(r)?"0"===t?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.0 <${Number(t)+1}.0.0-0`:n?"0"===t?"0"===o?`>=${t}.${o}.${r}-${n} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r}-${n} <${Number(t)+1}.0.0-0`:"0"===t?"0"===o?`>=${t}.${o}.${r} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${Number(t)+1}.0.0-0`)))).join(" ")}function Ie(e){return e.trim().split(/\s+/).map((e=>e.replace(me(ae),((e,t,o,r,n)=>fe(t)?"":fe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:fe(r)?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:n?`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`)))).join(" ")}function be(e){return e.split(/\s+/).map((e=>e.trim().replace(me(ce),((e,t,o,r,n,s)=>{const i=fe(o),a=i||fe(r),c=a||fe(n);return"="===t&&c&&(t=""),s="",i?">"===t||"<"===t?"<0.0.0-0":"*":t&&c?(a&&(r=0),n=0,">"===t?(t=">=",a?(o=Number(o)+1,r=0,n=0):(r=Number(r)+1,n=0)):"<="===t&&(t="<",a?o=Number(o)+1:r=Number(r)+1),"<"===t&&(s="-0"),`${t+o}.${r}.${n}${s}`):a?`>=${o}.0.0${s} <${Number(o)+1}.0.0-0`:c?`>=${o}.${r}.0${s} <${o}.${Number(r)+1}.0-0`:e})))).join(" ")}function we(e){return e.trim().replace(me(se),"")}function $e(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function Ne(e,t){return $e(e.major,t.major)||$e(e.minor,t.minor)||$e(e.patch,t.patch)||function(e,t){const{preRelease:o}=e,{preRelease:r}=t;if(void 0===o&&Boolean(r))return 1;if(Boolean(o)&&void 0===r)return-1;if(void 0===o&&void 0===r)return 0;for(let e=0,t=o.length;e<=t;e++){const t=o[e],n=r[e];if(t!==n)return void 0===t&&void 0===n?0:t?n?$e(t,n):-1:1}return 0}(e,t)}function ve(e,t){return e.version===t.version}function Re(e,t){switch(e.operator){case"":case"=":return ve(e,t);case">":return Ne(e,t)<0;case">=":return ve(e,t)||Ne(e,t)<0;case"<":return Ne(e,t)>0;case"<=":return ve(e,t)||Ne(e,t)>0;case void 0:return!0;default:return!1}}function ke(e){return ue(_e,Ie,be,we)(e)}function Oe(e){return ue(ye,ge,Ee,Se)(e.trim()).split(/\s+/).join(" ")}function Te(e,t){if(!e)return!1;const o=de(e);if(!o)return!1;const[,r,,n,s,i,a]=o,c={operator:r,version:pe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a?.split(".")},l=t.split("||");for(const e of l){const t=e.trim();if(!t)return!0;if("*"===t||"x"===t)return!0;try{const e=Oe(t);if(!e.trim())return!0;const o=e.split(" ").map((e=>ke(e))).join(" ");if(!o.trim())return!0;const r=o.split(/\s+/).map((e=>e.trim().replace(me(he),""))).filter(Boolean);if(0===r.length)continue;let n=!0;for(const e of r){const t=de(e);if(!t){n=!1;break}const[,o,,r,s,i,a]=t;if(!Re({operator:o,version:pe(r,s,i,a),major:r,minor:s,patch:i,preRelease:a?.split(".")},c)){n=!1;break}}if(n)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function Ae(e,t){const o=t.shared||{},r=t.name,s=Object.keys(o).reduce(((e,s)=>{const i=N(o[s]);return e[s]=e[s]||[],i.forEach((o=>{e[s].push(function(e,t,o,r){let s;return s="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve((()=>{E(`Cannot get shared "${o}" from "${t}": neither "get" nor "lib" is provided in the share config.`)})),e.shareConfig?.eager&&e.treeShaking?.mode&&E(`Invalid shared config for "${o}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:s,loaded:!(!e?.loaded&&!("lib"in e))||void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??r)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??n.UNKNOWN,useIn:[]}:void 0}}(o,r,s,t.shareStrategy))})),e}),{}),i={...e.shared};return Object.keys(s).forEach((e=>{i[e]?s[e].forEach((t=>{i[e].find((e=>e.version===t.version))||i[e].push(t)})):i[e]=s[e]})),{allShareInfos:i,newShareInfos:s}}function xe(e,t){if(!e)return!1;const{status:o,mode:r}=e;return o!==n.NO_USE&&(o===n.CALCULATED||"runtime-infer"===r&&(!t||De(e,t)))}function Me(e,t){const o=e=>{if(!Number.isNaN(Number(e))){const t=e.split(".");let o=e;for(let e=0;e<3-t.length;e++)o+=".0";return o}return e};return!!Te(o(e),`<=${o(t)}`)}const Le=(e,t)=>{const o=t||function(e,t){return Me(e,t)};return Object.keys(e).reduce(((e,t)=>e?o(e,t)||"0"===e?t:e:t),0)},Pe=e=>Boolean(e.loaded)||"function"==typeof e.lib,De=(e,t)=>{if(!e||!t)return!1;const{usedExports:o}=e;return!!o&&!!t.every((e=>o.includes(e)))};function He(e,t,o,r){const n=e[t][o];let s="",i=xe(r);const a=function(e,t){return i?!n[e].treeShaking||!!n[t].treeShaking&&!Pe(n[e].treeShaking)&&Me(e,t):!Pe(n[e])&&Me(e,t)};if(i){if(s=Le(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Le(e[t][o],a),useTreesShaking:i}}const Fe=e=>Pe(e)||(e=>Boolean(e.loading))(e);function Ce(e,t,o,r){const n=e[t][o];let s="",i=xe(r);const a=function(e,t){if(i){if(!n[e].treeShaking)return!0;if(!n[t].treeShaking)return!1;if(Fe(n[t].treeShaking))return!Fe(n[e].treeShaking)||Boolean(Me(e,t));if(Fe(n[e].treeShaking))return!1}return Fe(n[t])?!Fe(n[e])||Boolean(Me(e,t)):!Fe(n[e])&&Me(e,t)};if(i){if(s=Le(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Le(e[t][o],a),useTreesShaking:i}}function je(e){return"loaded-first"===e?Ce:He}function Ue(e,t,o,r){if(!e)return;const{shareConfig:n,scope:s=j,strategy:i,treeShaking:a}=o,c=Array.isArray(s)?s:[s];for(const s of c)if(n&&e[s]&&e[s][t]){const{requiredVersion:c}=n,{version:l,useTreesShaking:h}=je(i)(e,s,t,a),m=()=>{const r=e[s][t][l];if(n.singleton){if("string"==typeof c&&!Te(l,c)){const e=`Version ${l} from ${l&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${c})`;n.strictVersion?E(e):S(e)}return{shared:r,useTreesShaking:h}}{if(!1===c||"*"===c)return{shared:r,useTreesShaking:h};if(Te(l,c))return{shared:r,useTreesShaking:h};const o=xe(a);if(o)for(const[r,n]of Object.entries(e[s][t]))if(xe(n.treeShaking,a?.usedExports)&&Te(r,c))return{shared:n,useTreesShaking:o};for(const[o,r]of Object.entries(e[s][t]))if(Te(o,c))return{shared:r,useTreesShaking:!1}}},f={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:O.__FEDERATION__,shareInfo:o,resolver:m};return(r.emit(f)||f).resolver()}}function Ge(){return O.__FEDERATION__.__SHARE__}function Be(e){const{pkgName:t,extraOptions:o,shareInfos:r}=e,n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=(...e)=>{const t={};for(const o of e)if(o)for(const[e,r]of Object.entries(o)){const o=t[e];n(o)&&n(r)?t[e]=s(o,r):void 0!==r&&(t[e]=r)}return t};return s((o?.resolver??(e=>{if(!e)return;const t={};return e.forEach((e=>{t[e.version]=e})),t[Le(t,(function(e,o){return!Pe(t[e])&&Me(e,o)}))]}))(r[t]),o?.customShareInfo)}const Ve=(e,t)=>{var o,r;e.useIn||(e.useIn=[]),o=e.useIn,r=t,-1===o.findIndex((e=>e===r))&&o.push(r)};function We(e,t){return t&&e.treeShaking?e.treeShaking:e}const qe=function(...e){return e.length?e.reduce(((e,t)=>t?e?`${e}:${t}`:t:e),""):""};function ze(e,t){if("getPublicPath"in e){let o;return o=e.getPublicPath.startsWith("function")?new Function("return "+e.getPublicPath)()():new Function(e.getPublicPath)(),`${o}${t}`}return"publicPath"in e?i()||a()||!("ssrPublicPath"in e)||"string"!=typeof e.ssrPublicPath?`${e.publicPath}${t}`:`${e.ssrPublicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const Ke=e=>{console.warn(`[ Federation Runtime ]: ${e}`)};function Ze(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}async function Je(e,t){try{return await e()}catch(e){return void(!t&&Ke(e))}}function Ye(e,t){const o=/^(https?:)?\/\//i;return e.replace(o,"").replace(/\/$/,"")===t.replace(o,"").replace(/\/$/,"")}function Xe(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("script");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("src");if(i&&Ye(i,e.url)){o=n,r=!1;break}}if(!o){const t=e.attrs;let r;o=document.createElement("script"),o.type="module"===t?.type?"module":"text/javascript",e.createScriptHook&&(r=e.createScriptHook(e.url,e.attrs),r instanceof HTMLScriptElement?o=r:"object"==typeof r&&("script"in r&&r.script&&(o=r.script),"timeout"in r&&r.timeout&&(n=r.timeout))),o.src||(o.src=e.url),t&&!r&&Object.keys(t).forEach((e=>{o&&("async"===e||"defer"===e?o[e]=t[e]:o.getAttribute(e)||o.setAttribute(e,t[e]))}))}let i=null;const a="undefined"!=typeof window?t=>{if(t.filename&&Ye(t.filename,e.url)){const o=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);o.name="ScriptExecutionError",i=o}}:null;a&&window.addEventListener("error",a);const c=async(r,n)=>{clearTimeout(t),a&&window.removeEventListener("error",a);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else i?e?.onErrorCallback&&e?.onErrorCallback(i):e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Je((()=>{const{needDeleteScript:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r&&"function"==typeof r)){const e=r(n);if(e instanceof Promise){const t=await e;return s(),t}return s(),e}s()};return o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),t=setTimeout((()=>{c(null,{type:"error",isTimeout:!0})}),n),{script:o,needAttach:r}}const Qe=new Map;function et(e){if(!e)throw new Error("import specifier is required");if(Qe.has(e))return Qe.get(e);const t=new Function("name","return import(name)")(e).then((e=>e)).catch((t=>{throw console.error(`Error importing module ${e}:`,t),Qe.delete(e),t}));return Qe.set(e,t),t}const tt="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t,o,r)=>{if(r?.createScriptHook){const t=r.createScriptHook(e);t&&"object"==typeof t&&"url"in t&&(e=t.url)}let n;try{n=new URL(e)}catch(e){return console.error("Error constructing URL:",e),void t(new Error(`Invalid URL: ${e}`))}(async()=>r?.fetch?(e,t)=>(async(e,t,o)=>{const r=await((e,t)=>o.lifecycle.fetch.emit(e,t))(e,t||{});return r&&r instanceof Response?r:fetch(e,t||{})})(e,t,r):fetch)().then((async e=>{if("esm"===o?.type||"module"===o?.type)return at(n.href,{fetch:e,vm:await et("vm")}).then((async e=>{await e.evaluate(),t(void 0,e.namespace)})).catch((e=>{t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}));(async(e,r)=>{try{const n=await e(r.href),s=await n.text(),[i,a]=await Promise.all([et("path"),et("vm")]),c={exports:{},module:{exports:{}}},l=r.pathname.split("/").slice(0,-1).join("/"),h=i.basename(r.pathname),m=new a.Script(`(function(exports, module, require, __dirname, __filename) {${s}\n})`,{filename:h,importModuleDynamically:a.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??et});let f;f=(await et("node:module")).createRequire("file:"===r.protocol||"node:"===r.protocol?r.href:i.join(process.cwd(),"__mf_require_base__.js")),m.runInThisContext()(c.exports,c.module,f,l,h);const u=c.module.exports||c.exports;if(o&&u&&o.globalName)return void t(void 0,u[o.globalName]||u);t(void 0,u)}catch(e){t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}})(e,n)})).catch((e=>{t(e)}))}:(e,t,o,r)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},ot="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise(((o,r)=>{tt(e,((e,n)=>{e?r(e):o(globalThis[t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`]=n)}),t.attrs,t.loaderHook)})):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},rt=new Map,nt=e=>e.startsWith("http:")||e.startsWith("https:"),st=e=>!(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes(":"));async function it(e,t,o){if(await async function(e){return!!e.startsWith("node:")||!!st(e)&&(await et("node:module")).builtinModules.includes(e)}(e))return async function(e,t){const o=`node-builtin:${e}`;return rt.has(o)?rt.get(o):async function(e,t,o){if("function"!=typeof o.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const r=function(e){const t=!e||"object"!=typeof e&&"function"!=typeof e?{default:e}:e,o={...t};return Object.prototype.hasOwnProperty.call(o,"default")||(o.default=t),o}(t),n=Object.keys(r),s=new o.SyntheticModule(n,(function(){for(const e of n)this.setExport(e,r[e])}),{identifier:e});return rt.set(e,s),await s.link((async()=>{throw new Error(`Node.js built-in module "${e}" should not request child modules.`)})),await s.evaluate(),s}(o,await et(e),t)}(e,o.vm);if(st(e))throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const r=new URL(e,t).href;if(!nt(r))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return at(r,o)}async function at(e,t){if(rt.has(e))return rt.get(e);const{fetch:o,vm:r}=t;if(!nt(e))throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);const n=await(await o(e)).text(),s=(await et("node:url")).pathToFileURL(process.cwd()).href,i=new r.SourceTextModule(n,{identifier:e,initializeImportMeta:t=>{t.url=function(e,t){const o=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${function(e){const t=new URL(e),o=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),n=t.pathname.split("/").map((e=>encodeURIComponent(e))).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${o}/${r}${n}${s?`/${s}`:""}`}(e)}`,o).href}(e,s)},importModuleDynamically:async o=>async function(e){if("linked"===e.status&&await e.evaluate(),"errored"===e.status)throw e.error;return e}(await it(o,e,t))});return rt.set(e,i),await i.link((async o=>it(o,e,t))),i}const ct="RUNTIME-001",lt="RUNTIME-002",ht="RUNTIME-003",mt="RUNTIME-004",ft="RUNTIME-005",ut="RUNTIME-006",dt="RUNTIME-007",pt="RUNTIME-008",yt="RUNTIME-009",gt="RUNTIME-010",Et="RUNTIME-011",St="RUNTIME-012",_t="RUNTIME-013",It="RUNTIME-014",bt="RUNTIME-015",wt={[ct]:"Failed to get remoteEntry exports.",[lt]:'The remote entry interface does not contain "init"',[ht]:"Failed to get manifest.",[mt]:"Failed to locate remote.",[ft]:"Invalid loadShareSync function call from bundler runtime",[ut]:"Invalid loadShareSync function call from runtime",[dt]:"Failed to get remote snapshot.",[pt]:"Failed to load script resources.",[yt]:"Please call createInstance first.",[gt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Et]:"The remoteEntry URL is missing from the remote snapshot.",[St]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',[_t]:"The manifest is not a valid Module Federation manifest.",[It]:"The remote does not expose the requested module.",[bt]:"Remote container initialization failed."},$t=".then(callbacks[0]).catch(callbacks[1])",Nt=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function vt(e){return"esm"===e||"module"===e}function Rt(e,t,o){const{remoteEntryKey:r,entryExports:n}=F(e,t);return n||E(ct,wt,{remoteName:e,remoteEntryUrl:o,remoteEntryKey:r}),n}async function kt({remoteInfo:e,remoteEntryExports:t,loaderHook:o,getEntryUrl:r,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return vt(c)?async function({entry:e,remoteEntryExports:t,name:o,getEntryUrl:r}){return new Promise(((n,s)=>{const i=e=>{if((t=e)instanceof TypeError&&Nt.some((e=>t.message.includes(e)))){const t=e instanceof Error?e.message:String(e);try{E(pt,wt,{remoteName:o,resourceUrl:a},t)}catch(e){return void s(e)}}var t;s(e)},a=r?r(e):e;try{t?n(t):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?new Function("callbacks",`import("${a}")${$t}`)([n,i]):import(a).then(n).catch(i)}catch(e){E(`Failed to load ESM entry from "${a}". ${e instanceof Error?e.message:String(e)}`)}}))}({entry:s,remoteEntryExports:t,name:a,getEntryUrl:r}):"system"===c?async function({entry:e,remoteEntryExports:t}){return new Promise(((o,r)=>{try{t?o(t):new Function("callbacks",`System.import("${e}")${$t}`)([o,r])}catch(t){E(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}}))}({entry:s,remoteEntryExports:t}):async function({name:e,globalName:t,entry:o,remoteInfo:r,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=F(e,t);if(a)return a;const c=s?s(o):o;return function(e,t){const{attrs:o={},createScriptHook:r}=t;return new Promise(((t,n)=>{const{script:s,needAttach:i}=Xe({url:e,cb:t,onErrorCallback:n,attrs:{fetchpriority:"high",...o},createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(s)}))}(c,{attrs:{},createScriptHook:(e,t)=>{const o=n.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:i?{...i,url:e}:void 0});if(o)return o instanceof HTMLScriptElement||"script"in o||"timeout"in o?o:void 0}}).then((()=>Rt(e,t,o)),(t=>{const o=t instanceof Error?t.message:String(t);E(pt,wt,{remoteName:e,resourceUrl:c},o)}))}({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:o,getEntryUrl:r,resourceContext:n})}function Ot(e){const{entry:t,name:o}=e;return qe(o,t)}async function Tt(e){const{origin:t,remoteEntryExports:o,remoteInfo:r,getEntryUrl:n,resourceContext:i,_inErrorHandling:a=!1}=e,c=Ot(r);if(o)return o;if(!x[c]){const e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;x[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:o}).then((e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:s)?kt({remoteInfo:r,remoteEntryExports:o,loaderHook:l,getEntryUrl:n,resourceContext:i}):async function({remoteInfo:e,loaderHook:t,resourceContext:o}){const{entry:r,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=F(s,n);return a||ot(r,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(r,n={})=>{const s=t.lifecycle.createScript.emit({url:r,attrs:n,remoteInfo:e,resourceContext:o?{...o,url:r}:void 0});if(s)return"url"in s?s:void 0}}}).then((()=>Rt(s,n,r))).catch((e=>{E(`Failed to load Node.js entry for remote "${s}" from "${r}". ${e instanceof Error?e.message:String(e)}`)}))}({remoteInfo:r,loaderHook:l,resourceContext:i})))).then((async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e))).catch((async e=>{const n=Ot(r),s=e instanceof Error&&e.message.includes("ScriptExecutionError");if(e instanceof Error&&e.message.includes(pt)&&!s&&!a){const e=e=>Tt({...e,_inErrorHandling:!0}),s=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e,origin:t,remoteInfo:r,remoteEntryExports:o,globalLoading:x,uniqueKey:n});if(s)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:s,recovered:!0}),s}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e}))}return x[c]}function At(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||U,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||j}}function xt(e,t){return t&&"."!==t?`${e}/${t.replace(/^\.\//,"")}`:e}function Mt(e,t){for(const o of e){const e=t.startsWith(o.name);let r=t.replace(o.name,"");if(e){if(r.startsWith("/"))return r=`.${r}`,{pkgNameOrAlias:o.name,expose:r,remote:o};if(""===r)return{pkgNameOrAlias:o.name,expose:".",remote:o}}const n=o.alias&&t.startsWith(o.alias);let s=o.alias&&t.replace(o.alias,"");if(o.alias&&n){if(s&&s.startsWith("/"))return s=`.${s}`,{pkgNameOrAlias:o.alias,expose:s,remote:o};if(""===s)return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function Lt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Pt(e){return e instanceof Error&&(e.message.includes("timed out")||e.name.includes("Timeout"))}function Dt(e,t,o,r){return{url:t,status:o,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Ht({host:e,remoteInfo:t,url:o,attrs:r,context:n,needDeleteLink:s}){return new Promise((i=>{const{link:a,needAttach:c}=function(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("link");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("href"),a=n.getAttribute("rel");if(i&&Ye(i,e.url)&&a===e.attrs.rel){o=n,r=!1;break}}if(!o){let t;o=document.createElement("link"),o.setAttribute("href",e.url);let r=!0;const s=e.attrs;e.createLinkHook&&(t=e.createLinkHook(e.url,s),t instanceof HTMLLinkElement?(o=t,r=!1):"object"==typeof t&&("link"in t&&t.link&&(o=t.link,r=!1),"timeout"in t&&t.timeout&&(n=t.timeout))),s&&r&&Object.keys(s).forEach((e=>{o&&!o.getAttribute(e)&&o.setAttribute(e,s[e])}))}if(!r)return Promise.resolve().then((()=>{e?.cb&&e?.cb()})),{link:o,needAttach:r};const i=(r,n)=>{t&&clearTimeout(t);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Je((()=>{const{needDeleteLink:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r)){const e=r(n);return s(),e}s()};return o.onerror=i.bind(null,o.onerror),o.onload=i.bind(null,o.onload),t=setTimeout((()=>{i(null,{type:"error",isTimeout:!0})}),n),{link:o,needAttach:r}}({url:o,cb:()=>{i(Dt(n,o,c?"success":"cached"))},onErrorCallback:e=>{i(Dt(n,o,Pt(e)?"timeout":"error",e))},attrs:r,createLinkHook:(o,r)=>{const s=e.loaderHook.lifecycle.createLink.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLLinkElement,s},needDeleteLink:s});c&&document.head.appendChild(a)}))}function Ft({host:e,remoteInfo:t,url:o,attrs:r,context:n}){return new Promise((s=>{const{script:i,needAttach:a}=Xe({url:o,cb:()=>{s(Dt(n,o,a?"success":"cached"))},onErrorCallback:e=>{s(Dt(n,o,Pt(e)?"timeout":"error",e))},attrs:r,createScriptHook:(o,r)=>{const s=e.loaderHook.lifecycle.createScript.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLScriptElement,s},needDeleteScript:!0});a&&document.head.appendChild(i)}))}function Ct(e,t){return{...e,resourceType:t}}function jt(e,t,o,r=!0,n={initiator:"preloadRemote",id:e.name}){const{cssAssets:s,jsAssetsWithoutEntry:i,entryAssets:a}=o,c=[];if(t.options.inBrowser){if(a.forEach((e=>{const{moduleInfo:o}=e;c.push(async function(e,t,o,r){const n=e.moduleCache.get(o.name),s=o.entry;if(n?.remoteEntryExports)return Dt(r,s,"cached");try{if(!await Tt({origin:e,remoteInfo:o,remoteEntryExports:n?.remoteEntryExports,resourceContext:{...r,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return Dt(r,s,"success")}catch(e){return Dt(r,s,Pt(e)?"timeout":"error",e)}}(t,0,o,Ct(n,"remoteEntry")))})),r){const o={rel:"preload",as:"style"};s.forEach((r=>{c.push(Ht({host:t,remoteInfo:e,url:r,attrs:o,context:Ct(n,"css")}))}))}else{const o={rel:"stylesheet",type:"text/css"};s.forEach((r=>{c.push(Ht({host:t,remoteInfo:e,url:r,attrs:o,needDeleteLink:!1,context:Ct(n,"css")}))}))}let o=Ft,l={fetchpriority:"high",type:"text/javascript"};r?(o=Ht,l={rel:"preload",as:"script"}):vt(e.type)&&(o=Ht,l={rel:"modulepreload",fetchpriority:"high"}),i.forEach((r=>{c.push(o({host:t,remoteInfo:e,url:r,attrs:l,context:Ct(n,"js")}))}))}return Promise.all(c)}function Ut(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Gt(e){const t={};for(const[o,r]of Object.entries(e.shared)){const e=r[0];e&&(t[o]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:!1!==e.shareConfig?.requiredVersion&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(Ut)??[],shared:t}}}function Bt(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map((e=>e.moduleName)).filter(Boolean);return t.length?t.join(","):void 0}var Vt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await Tt({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:xt(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return g(t,`remoteEntryExports is undefined \n ${Ze(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,o,r){const n=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host}),n;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,cached:!0,origin:this.host}),o}return n}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:r,shareScope:s,initScope:i}=function(e,t,o){const r=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach((e=>{r[e]||(r[e]={})}));const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:r[n[0]],initScope:o??[]}}(this.remoteInfo,this.host.shareScopeMap,o),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:r,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});void 0===n?.init&&E(lt,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Gt(this.host.options));try{await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions)}catch(e){E(bt,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Gt(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,origin:this.host}),o}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,o,r){const{loadFactory:n=!0}=o||{loadFactory:!0},s=await this.init(e,r,void 0,t);let i;this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});try{const o=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i="function"==typeof o?o:void 0,i||(i=await s.get(t)),i||E(It,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bt(r)},void 0,Gt(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:i,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:o,origin:this.host}),o}const a=((e,t)=>{let o;return o=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),o+=t,o})(this.remoteInfo.name,t),c=this.wraperFactory(i,a);if(!n)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const o=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:o,origin:this.host}),o}catch(o){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:o,origin:this.host}),o}}wraperFactory(e,t){function o(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return()=>{const r=e();return r instanceof Promise?r.then((e=>(o(e,t),e))):(o(r,t),r)}}},Wt=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var o;g((o=e,"[object Object]"===$.call(o)),"Plugin configuration is invalid.");const r=e.name;g(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach((t=>{const o=e[t];o&&this.lifecycle[t].on(o)})))}removePlugin(e){g(e,"A name is required.");const t=this.registerPlugins[e];g(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach((e=>{"name"!==e&&this.lifecycle[e].remove(t[e])}))}},qt=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){"function"==typeof e&&this.listeners.add(e)}once(e){const t=this;this.on((function o(...r){return t.remove(o),e.apply(null,r)}))}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach((o=>{const r=o(...e);void 0!==r&&(t=r)})),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};function zt(e,t){if(!w(t))return!1;if(e!==t)for(const o in e)if(!(o in t))return!1;return!0}var Kt=class extends qt{constructor(e){super(),this.onerror=E,this.type=e}emit(e){w(e)||E(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const o=t(e);if(void 0===o)continue;if(!zt(e,o)){this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}e=o}catch(e){S(e),this.onerror(e)}return e}},Zt=class extends qt{constructor(e){super(),this.onerror=E,this.type=e}emit(e){w(e)||E(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let o=0;const r=t=>(S(t),this.onerror(t),e),n=s=>{if(void 0!==s&&zt(e,s))e=s;else if(void 0!==s)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(o<t.length)try{return Promise.resolve(t[o++](e)).then(n,r)}catch(e){return r(e)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const Jt="Remote loading is disabled by experiments.optimization.disableRemote.";var Yt=class{constructor(){this.hooks=new Wt({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(Jt)}preloadRemote(){throw new Error(Jt)}registerRemotes(){throw new Error(Jt)}getRemoteModuleAndOptions(){throw new Error(Jt)}initRawContainer(){throw new Error(Jt)}},Xt=class extends qt{emit(...e){let t;const o=Array.from(this.listeners);if(o.length>0){let r=0;const n=t=>!1!==t&&(r<o.length?Promise.resolve(o[r++].apply(null,e)).then((o=>void 0===o||1===e.length&&o===e[0]?n(t):n(o))):t);t=n()}return Promise.resolve(t)}};function Qt(e,t){const o=v(t);o.url||E(Et,wt,{remoteName:e.name});let r=ze(t,o.url);s||r.startsWith("http")||(r=`https:${r}`),e.type=o.type,e.entryGlobalName=o.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}const eo=(e,t)=>{if(!e)return t;const o=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){const t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function to(e){return!(!("remoteEntry"in e)||!e.remoteEntry.includes(o))}function oo(e){const t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function ro(e,t,o,r,n={},s){const{value:i}=L(e,_(t)),a=s||i;if(a&&!to(a)&&(o(a,t,r),a.remotesInfo)){const t=Object.keys(a.remotesInfo);for(const r of t){if(n[r])continue;n[r]=!0;const t=oo(r),s=a.remotesInfo[r];ro(e,{name:t.name,version:s.matchedVersion},o,!1,n,void 0)}}}const no=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function so(e,t,o,r,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:h}=e,{preloadConfig:m}=t,{depsRemote:f}=m;if(ro(r,o,((t,o,r)=>{let n;if(r)n=m;else if(Array.isArray(f)){const e=f.find((e=>e.nameOrAlias===o.name||e.nameOrAlias===o.alias));if(!e)return;n=Lt(e)}else{if(!0!==f)return;n=m}const c=ze(t,v(t).url);c&&a.push({name:o.name,moduleInfo:{name:o.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:o.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let l="modules"in t?t.modules:[];const h=(u=n.exposes)?u.map((e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e)):[];var u,d;function p(e){const o=e.map((e=>ze(t,e)));return n.filter?o.filter(n.filter):o}if(h.length&&"modules"in t&&(l=t?.modules?.reduce(((e,t)=>(-1!==h?.indexOf(t.moduleName)&&e.push(t),e)),[])),l){const r=l.length;for(let a=0;a<r;a++){const r=l[a],c=`${o.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===r.moduleName?o.name:c,name:o.name,remoteSnapshot:t,preloadConfig:n,remote:o,origin:e}),d=c,R.__FEDERATION__.__PRELOADED_MAP__.get(d)||("all"===n.resourceCategory?(s.push(...p(r.assets.css.async)),s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.async)),i.push(...p(r.assets.js.sync))):"sync"===n.resourceCategory&&(s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.sync))),C(c))}}}),!0,{},n),n.shared&&n.shared.length>0){const t=(t,o)=>{const{shared:r}=Ue(e.shareScopeMap,o.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&"function"==typeof r.lib&&(o.assets.js.sync.forEach((e=>{c.add(e)})),o.assets.css.sync.forEach((e=>{l.add(e)})))};n.shared.forEach((e=>{const o=h.shared?.[e.sharedName];if(!o)return;const r=e.version?o.find((t=>t.version===e.version)):o;r&&N(r).forEach((o=>{t(o,e)}))}))}const u=i.filter((e=>!c.has(e)&&!no("script",e)));return{cssAssets:s.filter((e=>!l.has(e)&&!no("link",e))),jsAssetsWithoutEntry:u,entryAssets:a.filter((e=>!no("script",e.url)))}}function io(e,t){const o=D({name:t.name,version:t.options.version}),r=o&&"remotesInfo"in o&&o.remotesInfo&&L(o.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:P(),remoteSnapshot:D({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:P(),remoteSnapshot:D({name:e.name,version:"version"in e?e.version:void 0})}}var ao=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Wt({beforeLoadRemoteSnapshot:new Xt("beforeLoadRemoteSnapshot"),loadSnapshot:new Zt("loadGlobalSnapshot"),loadRemoteSnapshot:new Zt("loadRemoteSnapshot"),afterLoadSnapshot:new Zt("afterLoadSnapshot")}),this.manifestLoading=O.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:o="loadRemote"}){const{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let n=D({name:this.HostInstance.options.name,version:this.HostInstance.options.version});var i;n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},i={[this.HostInstance.options.name]:n},k.__FEDERATION__.moduleInfo={...k.__FEDERATION__.moduleInfo,...i}),n&&"remotesInfo"in n&&!L(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:a,remoteSnapshot:c,globalSnapshot:l}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:m}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:c,globalSnapshot:l});let f,u;if(h)if(to(h)){const r=s?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",n=await this.loadManifestSnapshot(r,e,{},{initiator:o,id:t||e.name});f=n,u=H({...e,entry:r},n)}else{const{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});f=t,u=m}else if(I(e)){const r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:o,id:t||e.name});f=r,u=H(e,r)}else E(dt,wt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(m)},void 0,Gt(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:u}}getGlobalRemoteInfo(e){return io(e,this.HostInstance)}async getManifestJson(e,t,o,r){return(async()=>{const o=At(t);let n=this.manifestCache.get(e);if(n)return n;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},o,r?{...r,url:e,resourceType:"manifest"}:void 0);t&&t instanceof Response||(t=await fetch(e,{})),n=await t.json()}catch(r){n=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),n||(delete this.manifestLoading[e],E(ht,wt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Gt(this.HostInstance.options)))}const s=[!n.metaData&&"metaData",!n.exposes&&"exposes",!n.shared&&"shared"].filter(Boolean);return s.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${s.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),s.length>0&&E(_t,wt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:s.join(",")},void 0,Gt(this.HostInstance.options)),this.manifestCache.set(e,n),n})()}async loadManifestSnapshot(e,t,o,r){return this.manifestLoading[e]||(this.manifestLoading[e]=(async()=>{const n=await this.getManifestJson(e,t,o,r),s=function(e,t={}){const{remotes:o={},overrides:r={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?"auto"!==e.metaData.publicPath&&""!==e.metaData.publicPath||!n?e.metaData.publicPath:n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"):e.metaData.getPublicPath,a=Object.keys(r);let c={};Object.keys(o).length||(c=e.remotes?.reduce(((e,t)=>{let o;const n=t.federationContainerName;return o=a.includes(n)?r[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:o},e}),{})||{}),Object.keys(o).forEach((e=>c[e]={matchedVersion:a.includes(e)?r[e]:o[e]}));const{remoteEntry:{path:l,name:h,type:m},types:f={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:u},globalName:d,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:u,globalName:d,remoteEntry:eo(l,h),remoteEntryType:m,remoteTypes:eo(f.path,f.name),remoteTypesZip:f.zip||"",remoteTypesAPI:f.api||"",remotesInfo:c,shared:e?.shared.map((e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]}))),modules:y?.map((e=>({moduleName:e.name,modulePath:e.path,assets:e.assets})))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},"string"==typeof e.metaData.ssrPublicPath&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const e=eo(p.path,p.name);s.ssrRemoteEntry=e,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}(n,{version:e}),{remoteSnapshot:i}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:n,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return i})().then((e=>e))),this.manifestLoading[e]}},co=class{constructor(){this.hooks=new Wt({})}},lo=class{constructor(e){this.hooks=new Wt({beforeRegisterShare:new Kt("beforeRegisterShare"),afterResolve:new Zt("afterResolve"),beforeLoadShare:new Zt("beforeLoadShare"),loadShare:new Xt,afterLoadShare:new qt("afterLoadShare"),errorLoadShare:new qt("errorLoadShare"),resolveShare:new Kt("resolveShare"),initContainerShareScopeMap:new Kt("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:o,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:o,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){S(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:o,error:r,recovered:n}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:n})}catch(e){S(e)}}registerShared(e,t){const{newShareInfos:o,allShareInfos:r}=Ae(e,t);return Object.keys(o).forEach((e=>{o[e].forEach((o=>{o.scope.forEach((r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:o}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:o.lib,get:o.get,loaded:o.loaded||Boolean(o.lib),shared:o,from:t.name})}))}))})),{newShareInfos:o,allShareInfos:r}}async loadShare(e,t){const{host:o}=this,r=Be({pkgName:e,extraOptions:t,shareInfos:o.options.shared});let n=r;try{r?.scope&&await Promise.all(r.scope.map((async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))}))),n=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:o.options.shared,origin:o})).shareInfo,g(n,`Cannot find shared "${e}" in host "${o.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const s=n,{shared:i,useTreesShaking:a}=Ue(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(i){const t=We(i,a);if(t.lib)return Ve(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),t.lib;if(t.loading&&!t.loaded){const r=await t.loading;return t.loaded=!0,t.lib||(t.lib=r),Ve(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),r}{const r=async()=>{const e=await t.get();return Ve(t,o.options.name),t.loaded=!0,t.lib=e,e},n=r();this.setShared({pkgName:e,loaded:!1,shared:i,from:o.options.name,lib:null,loading:n,treeShaking:a?t:void 0});const c=await n;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),c}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,recovered:!0}),!1;const r=xe(s.treeShaking),n=We(s,r),i=async()=>{const t=await n.get();n.lib=t,n.loaded=!0,Ve(n,o.options.name);const{shared:r,useTreesShaking:i}=Ue(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(r){const e=We(r,i);e.lib=t,e.loaded=!0,r.from=s.from}return t},a=i();this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:a,treeShaking:r?n:void 0});const c=await a;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:s}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:n,error:t}),t}}initializeSharing(e=j,t){const{host:o}=this,r=t?.from,n=t?.strategy;let s=t?.initScope;const i=[];if("build"!==r){const{initTokens:t}=this;s||(s=[]);let o=t[e];if(o||(o=t[e]={from:this.host.name}),s.indexOf(o)>=0)return i;s.push(o)}const a=this.shareScopeMap,c=o.options.name;a[e]||(a[e]={});const l=a[e];return Object.keys(o.options.shared).forEach((t=>{o.options.shared[t].forEach((o=>{o.scope.includes(e)&&((e,t)=>{const{version:o,eager:r}=t;l[e]=l[e]||{};const n=l[e],s=n[o]&&We(n[o]),i=Boolean(s&&("eager"in s&&s.eager||"shareConfig"in s&&s.shareConfig?.eager));(!s||"loaded-first"!==s.strategy&&!s.loaded&&(Boolean(!r)!==!i?r:c>n[o].from))&&(n[o]=t)})(t,o)}))})),"version-first"!==o.options.shareStrategy&&"version-first"!==n||o.options.remotes.forEach((t=>{t.shareScope===e&&i.push((async e=>{const{module:t}=await o.remoteHandler.getRemoteModuleAndOptions({id:e});let r;try{r=await t.getEntry()}catch(n){if(r=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"beforeLoadShare",remote:t.remoteInfo,origin:o}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,s))}})(t.name))})),i}loadShareSync(e,t){const{host:o}=this,r=Be({pkgName:e,extraOptions:t,shareInfos:o.options.shared});try{r?.scope&&r.scope.forEach((e=>{this.initializeSharing(e,{strategy:r.strategy})}));const{shared:n}=Ue(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(n){if("function"==typeof n.lib)return Ve(n,o.options.name),n.loaded||(n.loaded=!0,n.from===o.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),n.lib;if("function"==typeof n.get){const t=n.get();if(!(t instanceof Promise))return Ve(n,o.options.name),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:t,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),t}}if(r.lib)return r.loaded||(r.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){const n=r.get();return n instanceof Promise&&E("build"===t?.from?ft:ut,wt,{hostName:o.options.name,sharedPkgName:e},void 0,Gt(o.options)),r.lib=n,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib}E(ut,wt,{hostName:o.options.name,sharedPkgName:e},void 0,Gt(o.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,o={}){const{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:o,lib:r,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...h}=t;(Array.isArray(l)?l:[l]).forEach((t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...h,lib:r});const l=this.shareScopeMap[t][e][c];(e=>{const t=(e,t,o)=>{o&&!e[t]&&(e[t]=o)},o=a?e.treeShaking:e;t(o,"loaded",s),t(o,"loading",n),t(o,"get",i)})(l),o&&l.from!==o&&(l.from=o)}))}_setGlobalShareScopeMap(e){const t=Ge(),o=e.id||e.name;o&&!t[o]&&(t[o]=this.shareScopeMap)}},ho=class{constructor(){this.shareScopeMap={},this.hooks=new Wt({afterResolve:new Zt("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},mo=class{constructor(e){this.hooks=new Wt({beforeRegisterRemote:new Kt("beforeRegisterRemote"),registerRemote:new Kt("registerRemote"),beforeRequest:new Zt("beforeRequest"),afterMatchRemote:new Xt("afterMatchRemote"),onLoad:new Xt("onLoad"),afterLoadRemote:new Xt("afterLoadRemote"),handlePreloadModule:new qt("handlePreloadModule"),errorLoadRemote:new Xt("errorLoadRemote"),beforePreloadRemote:new Xt("beforePreloadRemote"),generatePreloadAssets:new Xt("generatePreloadAssets"),afterPreloadRemote:new Xt("afterPreloadRemote"),loadEntry:new Xt}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce(((e,t)=>(this.registerRemote(t,e,{force:!1}),e)),e.remotes)}setIdToRemoteMap(e,t){const{remote:o,expose:r}=t,{name:n,alias:s}=o;if(this.idToRemoteMap[e]={name:o.name,expose:r},s&&e.startsWith(n)){const t=e.replace(n,s);this.idToRemoteMap[t]={name:o.name,expose:r}}else if(s&&e.startsWith(s)){const t=e.replace(s,n);this.idToRemoteMap[t]={name:o.name,expose:r}}}async loadRemote(e,t){const{host:o}=this,r=Mt(o.options.remotes,e);let n,s=e,i=r?.expose,a=r?At(r.remote):void 0;try{const{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:h}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:m,remote:f,expose:u,id:d,remoteSnapshot:p}=h;s=d,i=u,a=At(f);const y=await c.get(d,u,t,p),g=await this.hooks.lifecycle.onLoad.emit({id:d,pkgNameOrAlias:m,expose:u,exposeModule:r?y:void 0,exposeModuleFactory:r?void 0:y,remote:f,options:l,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,h),n={id:s,expose:i,remote:a,options:t,origin:o},"function"==typeof g?g:y}catch(r){const{from:c="runtime"}=t||{from:"runtime"};let l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:"onLoad",expose:i,remote:a,origin:o})}catch(e){throw n={id:s,expose:i,remote:a,options:t,error:e,origin:o},e}if(!l)throw n={id:s,expose:i,remote:a,options:t,error:r,origin:o},r;return n={id:s,expose:i,remote:a,options:t,error:r,origin:o,recovered:!0},l}finally{n&&await this.hooks.lifecycle.afterLoadRemote.emit(n)}}async preloadRemote(e){const{host:t}=this,o=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=(n=t.options.remotes,e.map((e=>{const t=function(e,t){for(const o of e){if(t===o.name)return o;if(o.alias&&t===o.alias)return o}}(n,e.nameOrAlias);return g(t,`Unable to preload ${e.nameOrAlias} as it is not included in ${!t&&Ze({remoteInfo:t,remotes:n})}`),{remote:t,preloadConfig:Lt(e)}})));var n;let s;await Promise.all(r.flatMap((e=>{const{preloadConfig:t,remote:o}=e,r=t.exposes||[];return r.length?r.map((r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:xt(o.name,r)}))):[{ops:e,id:`${o.name}/*`}]})).map((async e=>{const{ops:r,id:n}=e,{remote:s,preloadConfig:i}=r,a=At(s);try{const{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:s,id:n,initiator:"preloadRemote"}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:s,remoteInfo:a,globalSnapshot:e,remoteSnapshot:c});if(!l)return;const h=await jt(a,t,l,!0,{initiator:"preloadRemote",id:n});o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:h})}catch(e){o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:[{url:a.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(a.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:n,error:e}]})}})));const i=o.flatMap((e=>e.results.filter((e=>"error"===e.status||"timeout"===e.status))));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:o,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:o,error:s}),s)throw s}registerRemotes(e,t){const{host:o}=this;e.forEach((e=>{this.registerRemote(e,o.options.remotes,{force:t?.force})}))}initRawContainer(e,t,o){const{host:r}=this,n=new Vt({host:r,remoteInfo:At({name:e,entry:t})});return n.remoteEntryExports=o,r.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:o}=e;let r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:t.options,origin:t,from:"runtime",error:e,lifecycle:"beforeRequest"}),!r)throw e}const{id:n}=r,s=Mt(t.options.remotes,n);if(!s)try{E(mt,wt,{hostName:t.options.name,requestId:n},void 0,Gt(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:e,origin:t}),e}const{remote:i}=s,a=At(i);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:a,origin:t});const c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:h}=c;g(l&&h,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let m=t.moduleCache.get(l.name);const f={host:t,remoteInfo:a};return m||(m=new Vt(f),t.moduleCache.set(l.name,m)),{module:m,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,o){const{host:r}=this,n=()=>{if(e.alias){const o=t.find((t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias))));g(!o,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${o&&o.name} name or alias`)}"entry"in e&&s&&"undefined"!=typeof window&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=j),e.type||(e.type=U)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});const i=t.find((t=>t.name===e.name));if(i){const s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(i),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),Ke(s.join(" ")))}else n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r})}removeRemote(e){try{const{host:t}=this,{name:o}=e,r=t.options.remotes.findIndex((e=>e.name===o));-1!==r&&t.options.remotes.splice(r,1);const n=L(R.__FEDERATION__.moduleInfo,_(e)).key;delete R.__FEDERATION__.moduleInfo[n],"entry"in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete O.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:s}=io(e,t);if(s){const t=s&&"remotesInfo"in s&&s.remotesInfo&&L(s.remotesInfo,e.name).key;t&&delete s.remotesInfo[t]}const i=t.moduleCache.get(e.name);if(i){const o=i.remoteInfo,r=o.entryGlobalName;R[r]&&(Object.getOwnPropertyDescriptor(R,r)?.configurable?delete R[r]:R[r]=void 0);const n=Ot(i.remoteInfo);x[n]&&delete x[n];let s=o.buildVersion?qe(o.name,o.buildVersion):o.name;const a=R.__FEDERATION__.__INSTANCES__.findIndex((e=>o.buildVersion?e.options.id===s:e.name===s));if(-1!==a){const e=R.__FEDERATION__.__INSTANCES__[a];s=e.options.id||s;const t=Ge();let r=!0;const n=[];Object.keys(t).forEach((e=>{const s=t[e];s&&Object.keys(s).forEach((t=>{const i=s[t];i&&Object.keys(i).forEach((s=>{const a=i[s];a&&Object.keys(a).forEach((i=>{const c=a[i];c&&"object"==typeof c&&c.from===o.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter((e=>e!==o.name)),c.useIn.length?r=!1:n.push([e,t,s,i])):n.push([e,t,s,i]))}))}))}))})),r&&(e.shareScopeMap={},delete t[s]),n.forEach((([e,o,r,n])=>{delete t[e]?.[o]?.[r]?.[n]})),R.__FEDERATION__.__INSTANCES__.splice(a,1)}t.moduleCache.delete(e.name)}}catch(e){y.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}};const fo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,uo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_REMOTE||!FEDERATION_OPTIMIZE_NO_REMOTE,po="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SHARED||!FEDERATION_OPTIMIZE_NO_SHARED;var yo=class{constructor(e){this.hooks=new Wt({beforeInit:new Kt("beforeInit"),init:new qt,beforeInitContainer:new Zt("beforeInitContainer"),initContainer:new Zt("initContainer")}),this.version="2.8.2",this.moduleCache=new Map,this.loaderHook=new Wt({getModuleInfo:new qt,createScript:new qt,createLink:new qt,fetch:new Xt,loadEntryError:new Xt,afterLoadEntry:new Xt("afterLoadEntry"),beforeInitRemote:new Xt("beforeInitRemote"),afterInitRemote:new Xt("afterInitRemote"),beforeGetExpose:new Xt("beforeGetExpose"),afterGetExpose:new Xt("afterGetExpose"),beforeExecuteFactory:new Xt("beforeExecuteFactory"),afterExecuteFactory:new Xt("afterExecuteFactory"),getModuleFactory:new Xt}),this.bridgeHook=new Wt({beforeBridgeRender:new qt,afterBridgeRender:new qt,beforeBridgeDestroy:new qt,afterBridgeDestroy:new qt});const t=uo&&fo?[{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:o,expose:r,origin:n,remoteInfo:s,id:i}=e;if(!I(t)||!b(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:xt(t.name,r)});Qt(s,a);const l={remote:t,preloadConfig:{nameOrAlias:o,exposes:[r],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return h&&jt(s,n,h,!1,{initiator:"loadRemote",id:i}).catch((()=>{})),{...e,remoteSnapshot:a}}return e}},{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:o,remoteInfo:r,remote:n,globalSnapshot:i,remoteSnapshot:a}=e;return s?I(n)&&b(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:r.name,entry:n.entry,type:r.type||"global",entryGlobalName:"",shareScope:""}}]}:(Qt(r,a),so(t,o,r,i,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}]:[],o={id:"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"",name:e.name,plugins:t,remotes:[],shared:{},inBrowser:s};this.name=e.name,this.options=o,this.snapshotHandler=uo?new ao(this):new co,this.sharedHandler=po?new lo(this):new ho,this.remoteHandler=uo?new mo(this):new Yt,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){e.name&&e.name!==this.options.name&&E(d(gt,wt)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=j,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,o){return this.remoteHandler.initRawContainer(e,t,o)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,o={}){this.sharedHandler.initShareScopeMap(e,t,o)}formatOptions(e,t){const o=po?Ae(e,t).allShareInfos:{},{userOptions:r,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:o}),s=this.remoteHandler.formatAndRegisterRemote(n,r),{allShareInfos:i}=this.sharedHandler.registerShared(n,r),a=[...n.plugins];r.plugins&&r.plugins.forEach((e=>{a.includes(e)||a.push(e)}));const c={...e,...t,plugins:a,remotes:s,shared:i,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=function(e,t){const o=k.__FEDERATION__.__GLOBAL_PLUGIN__,r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return o.length>0&&o.forEach((t=>{e?.find((e=>e.name!==t.name))&&e.push(t)})),e&&e.length>0&&e.forEach((e=>{r.forEach((o=>{o.applyPlugin(e,t)}))})),e}(e,this);this.options.plugins=this.options.plugins.reduce(((e,t)=>t?(e&&!e.find((e=>e.name===t.name))&&e.push(t),e):e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Object.defineProperty,"boolean"==typeof FEDERATION_OPTIMIZE_NO_REMOTE&&FEDERATION_OPTIMIZE_NO_REMOTE;let go=null;function Eo(e){const t=function(e,t){const o="undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"";return R.__FEDERATION__.__INSTANCES__.find((r=>!(!o||r.options.id!==o)||r.options.name===e&&!r.options.version&&!t||!(r.options.name!==e||!t||r.options.version!==t)))}(e.name,e.version),o={...e,id:e.id||""};return t?(t.initOptions(o),go||(go=t),t):(go=function(e){const t=new(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__||yo)({id:`${e.name}@${e.version||Date.now()}`,...e});return function(e){R.__FEDERATION__.__INSTANCES__.push(e)}(t),t}(o),go)}function So(...e){return g(go,yt,wt),go.registerRemotes.apply(go,e)}!function(e,t=c()){t&&(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,R.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.2")}(yo);let _o=!1;const Io=new Set,bo=new Map,wo=async(e,t,o,r="default",n={})=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${r} }`),_o||(_o=!0,go||Eo({name:"appshell-host",remotes:[]}));const s=((e,t)=>{if(!t)return e;try{const o=new URL(e);return o.searchParams.set("__appshell_hmr",t),o.toString()}catch{return e}})(o,n.cacheBust),i=Boolean(n.forceReload||n.cacheBust);Io.has(e)?(i||bo.get(e)!==s)&&(console.log(`[appshell-hmr] force re-register remote ${e} -> ${s}`),bo.set(e,s),So([{name:e,entry:s}],{force:!0})):(Io.add(e),bo.set(e,s),So([{name:e,entry:s}]));const a=t.replace(/^\.\//,""),c=await function(...e){return g(go,yt,wt),go.loadRemote.apply(go,e)}(`${e}/${a}`);if(!c)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${t}, shareScope: ${r} }`),c.default};(Object.getOwnPropertyDescriptor(wo,"name")||{}).writable||Object.defineProperty(wo,"name",{value:"default",configurable:!0});const $o=(e,t)=>({remotes:t,environment:e.environment,modules:{}}),No=e=>async t=>{const o=e?.remotes[t];if(e&&o)return{remote:o,environment:e.environment[o.scope]??{},manifest:$o(e,e.remotes)}},vo=(e,t="")=>async o=>{if(!e)return;const r=`${t}/v1/environments/${e.environmentId}/remotes/${o}`,n=await fetch(r,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,environment:e.environment[s.scope]??{},manifest:$o(e,{[o]:s})}},Ro=e=>{const t=new Map;return async o=>{const r=e.index?.[o];if(!r)return;const n=await(e=>{const o=t.get(e);if(o)return o;const r=fetch(e,{credentials:"include"}).then((async t=>{if(!t.ok)throw new Error(`Failed to get manifest from ${e}. ${await t.text()}`);return t.json()}));return t.set(e,r),r})(r),s=n?.remotes[o];return s?{remote:s,environment:{...n.environment[s.scope]??{},...e.overrides?.environment?.[s.scope]??{}},manifest:n}:void 0}},ko=(...e)=>async t=>{for(const o of e){const e=await o(t);if(e)return e}},Oo=(e,t={})=>{const o=t.composition??("undefined"==typeof window?void 0:window.__appshell_config__),r=t.resolver??ko(No(o),vo(o),Ro(e));return async(e,t={})=>{const o=t=>new Error(`Failed to load component '${e}'. ${t?.toString()}`);let n;try{n=await r(e)}catch(e){throw o(e)}if(!n)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:s,environment:i,manifest:a}=n;try{return window[`__appshell_env__${s.scope}`]=i,[await wo(s.scope,s.module,s.remoteEntryUrl,s.shareScope,t),a]}catch(e){throw o(e)}}};(Object.getOwnPropertyDescriptor(Oo,"name")||{}).writable||Object.defineProperty(Oo,"name",{value:"default",configurable:!0});const To=Oo;return t})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{chainResolvers:()=>vo,default:()=>ko,inlineResolver:()=>wo,legacyManifestResolver:()=>$o,registryResolver:()=>No});const o=".json",r="FEDERATION_DEBUG";let n=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const s="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function i(){return s}function a(){return"undefined"!=typeof navigator&&"ReactNative"===navigator?.product}function c(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?Boolean(process.env.FEDERATION_DEBUG):!("undefined"==typeof FEDERATION_DEBUG||!Boolean(FEDERATION_DEBUG))||function(){try{if(i()&&window.localStorage)return Boolean(localStorage.getItem(r))}catch(e){return!1}return!1}()}const l="[ Module Federation ]",h=console,m=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];var f=class{constructor(e,t=h){this.prefix=e,this.delegate=t??h}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??h}emit(e,t){const o=this.delegate,r=c()?function(){try{const e=(new Error).stack;if(!e)return;const[,...t]=e.split("\n"),o=t.filter((e=>!m.some((t=>e.includes(t)))));if(!o.length)return;return`Stack trace:\n${o.slice(0,5).join("\n")}`}catch{return}}():void 0,n=r?[...t,r]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const e of s){const t=o[e];if("function"==typeof t)return void t.call(o,this.prefix,...n)}for(const e of s){const t=h[e];if("function"==typeof t)return void t.call(h,this.prefix,...n)}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){c()&&this.emit("debug",e)}};function d(e){return new f(e)}d(l),function(e){const t=new f(e);Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1})}(l);const u=(e,t,o,r)=>{const n=[`${[t[e]]} #${e}`];return o&&n.push(`args: ${JSON.stringify(o)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),r&&n.push(`Original Error Message:\n ${r}`),n.join("\n")},p="[ Federation Runtime ]",y=d(p);function g(e,t,o,r,n){e||(void 0!==o?E(t,o,r,void 0):E(t))}function E(e,t,o,r,n){if(void 0!==t)return function(e,t,o,r,n){return(e=>{throw new Error(`${p}: ${e}`)})(u(e,t,o,n))}(e,t,o??{},0,r);const s=e;if(s instanceof Error)throw s.message.startsWith(p)||(s.message=`${p}: ${s.message}`),s;throw new Error(`${p}: ${s}`)}function S(e){e instanceof Error?(e.message.startsWith(p)||(e.message=`${p}: ${e.message}`),y.warn(e)):y.warn(e)}function _(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function I(e){return void 0!==e.entry}function b(e){return!e.entry.includes(".json")}function w(e){return e&&"object"==typeof e}const N=Object.prototype.toString;function $(e){return Array.isArray(e)?e:[e]}function v(e){const t={url:"",type:"global",globalName:""};return s||a()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const R="object"==typeof globalThis?globalThis:window,k=(()=>{try{return document.defaultView}catch{return R}})(),O=k;function T(e,t,o){Object.defineProperty(e,t,{value:o,configurable:!1,writable:!0})}function A(e,t){return Object.hasOwnProperty.call(e,t)}A(R,"__GLOBAL_LOADING_REMOTE_ENTRY__")||T(R,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const x=R.__GLOBAL_LOADING_REMOTE_ENTRY__;function M(e){A(e,"__VMOK__")&&!A(e,"__FEDERATION__")&&T(e,"__FEDERATION__",e.__VMOK__),A(e,"__FEDERATION__")||(T(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),T(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}function L(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};{const o=Object.keys(e);for(const r of o){const[o,n]=r.split(":"),s=`${o}:${t}`,i=e[s];if(i)return{value:i,key:s}}return{value:void 0,key:t}}}E(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}M(R),M(k);const P=()=>k.__FEDERATION__.moduleInfo,D=e=>((e,t)=>{const o=L(t,_(e)).value;if(o&&!o.version&&"version"in e&&e.version&&(o.version=e.version),o)return o;if("version"in e&&e.version){const{version:t,...o}=e,r=_(o),n=L(k.__FEDERATION__.moduleInfo,r).value;if(n?.version===t)return n}})(e,k.__FEDERATION__.moduleInfo),H=(e,t)=>{const o=_(e);return k.__FEDERATION__.moduleInfo[o]=t,k.__FEDERATION__.moduleInfo},F=(e,t)=>{const o=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:o,entryExports:R[o]}},C=e=>R.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),j="default",U="global",G="[0-9A-Za-z-]+",B=`(?:\\+(${G}(?:\\.${G})*))`,V="0|[1-9]\\d*",W="[0-9]+",q="\\d*[a-zA-Z-][a-zA-Z0-9-]*",z=`(?:${W}|${q})`,K=`(?:${V}|${q})`,Z=`(?:-(${K}(?:\\.${K})*))`,J=`${V}|x|X|\\*`,Y=`[v=\\s]*(${J})(?:\\.(${J})(?:\\.(${J})(?:${Z})?${B}?)?)?`,X=`^\\s*(${Y})\\s+-\\s+(${Y})\\s*$`,Q="((?:<|>)?=?)",ee=`(\\s*)${Q}\\s*([v=\\s]*(${W})\\.(${W})\\.(${W})(?:-?(${z}(?:\\.${z})*))?${B}?|${Y})`,te="(?:~>?)",oe=`(\\s*)${te}\\s+`,re="(?:\\^)",ne=`(\\s*)${re}\\s+`,se="(<|>)?=?\\s*\\*",ie=`^${re}${Y}$`,ae=`^${te}${Y}$`,ce=`^${Q}\\s*${Y}$`,le=`^${Q}\\s*(v?(${V})\\.(${V})\\.(${V})${Z}?${B}?)$|^$`,he="^\\s*>=\\s*0.0.0\\s*$";function me(e){return new RegExp(e)}function fe(e){return!e||"x"===e.toLowerCase()||"*"===e}function de(...e){return t=>e.reduce(((e,t)=>t(e)),t)}function ue(e){return e.match(me(le))}function pe(e,t,o,r){const n=`${e}.${t}.${o}`;return r?`${n}-${r}`:n}function ye(e){return e.replace(me(X),((e,t,o,r,n,s,i,a,c,l,h,m)=>`${t=fe(o)?"":fe(r)?`>=${o}.0.0`:fe(n)?`>=${o}.${r}.0`:`>=${t}`} ${a=fe(c)?"":fe(l)?`<${Number(c)+1}.0.0-0`:fe(h)?`<${c}.${Number(l)+1}.0-0`:m?`<=${c}.${l}.${h}-${m}`:`<=${a}`}`.trim()))}function ge(e){return e.replace(me(ee),"$1$2$3")}function Ee(e){return e.replace(me(oe),"$1~")}function Se(e){return e.replace(me(ne),"$1^")}function _e(e){return e.trim().split(/\s+/).map((e=>e.replace(me(ie),((e,t,o,r,n)=>fe(t)?"":fe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:fe(r)?"0"===t?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.0 <${Number(t)+1}.0.0-0`:n?"0"===t?"0"===o?`>=${t}.${o}.${r}-${n} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r}-${n} <${Number(t)+1}.0.0-0`:"0"===t?"0"===o?`>=${t}.${o}.${r} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${Number(t)+1}.0.0-0`)))).join(" ")}function Ie(e){return e.trim().split(/\s+/).map((e=>e.replace(me(ae),((e,t,o,r,n)=>fe(t)?"":fe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:fe(r)?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:n?`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`)))).join(" ")}function be(e){return e.split(/\s+/).map((e=>e.trim().replace(me(ce),((e,t,o,r,n,s)=>{const i=fe(o),a=i||fe(r),c=a||fe(n);return"="===t&&c&&(t=""),s="",i?">"===t||"<"===t?"<0.0.0-0":"*":t&&c?(a&&(r=0),n=0,">"===t?(t=">=",a?(o=Number(o)+1,r=0,n=0):(r=Number(r)+1,n=0)):"<="===t&&(t="<",a?o=Number(o)+1:r=Number(r)+1),"<"===t&&(s="-0"),`${t+o}.${r}.${n}${s}`):a?`>=${o}.0.0${s} <${Number(o)+1}.0.0-0`:c?`>=${o}.${r}.0${s} <${o}.${Number(r)+1}.0-0`:e})))).join(" ")}function we(e){return e.trim().replace(me(se),"")}function Ne(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function $e(e,t){return Ne(e.major,t.major)||Ne(e.minor,t.minor)||Ne(e.patch,t.patch)||function(e,t){const{preRelease:o}=e,{preRelease:r}=t;if(void 0===o&&Boolean(r))return 1;if(Boolean(o)&&void 0===r)return-1;if(void 0===o&&void 0===r)return 0;for(let e=0,t=o.length;e<=t;e++){const t=o[e],n=r[e];if(t!==n)return void 0===t&&void 0===n?0:t?n?Ne(t,n):-1:1}return 0}(e,t)}function ve(e,t){return e.version===t.version}function Re(e,t){switch(e.operator){case"":case"=":return ve(e,t);case">":return $e(e,t)<0;case">=":return ve(e,t)||$e(e,t)<0;case"<":return $e(e,t)>0;case"<=":return ve(e,t)||$e(e,t)>0;case void 0:return!0;default:return!1}}function ke(e){return de(_e,Ie,be,we)(e)}function Oe(e){return de(ye,ge,Ee,Se)(e.trim()).split(/\s+/).join(" ")}function Te(e,t){if(!e)return!1;const o=ue(e);if(!o)return!1;const[,r,,n,s,i,a]=o,c={operator:r,version:pe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a?.split(".")},l=t.split("||");for(const e of l){const t=e.trim();if(!t)return!0;if("*"===t||"x"===t)return!0;try{const e=Oe(t);if(!e.trim())return!0;const o=e.split(" ").map((e=>ke(e))).join(" ");if(!o.trim())return!0;const r=o.split(/\s+/).map((e=>e.trim().replace(me(he),""))).filter(Boolean);if(0===r.length)continue;let n=!0;for(const e of r){const t=ue(e);if(!t){n=!1;break}const[,o,,r,s,i,a]=t;if(!Re({operator:o,version:pe(r,s,i,a),major:r,minor:s,patch:i,preRelease:a?.split(".")},c)){n=!1;break}}if(n)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function Ae(e,t){const o=t.shared||{},r=t.name,s=Object.keys(o).reduce(((e,s)=>{const i=$(o[s]);return e[s]=e[s]||[],i.forEach((o=>{e[s].push(function(e,t,o,r){let s;return s="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve((()=>{E(`Cannot get shared "${o}" from "${t}": neither "get" nor "lib" is provided in the share config.`)})),e.shareConfig?.eager&&e.treeShaking?.mode&&E(`Invalid shared config for "${o}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:s,loaded:!(!e?.loaded&&!("lib"in e))||void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??r)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??n.UNKNOWN,useIn:[]}:void 0}}(o,r,s,t.shareStrategy))})),e}),{}),i={...e.shared};return Object.keys(s).forEach((e=>{i[e]?s[e].forEach((t=>{i[e].find((e=>e.version===t.version))||i[e].push(t)})):i[e]=s[e]})),{allShareInfos:i,newShareInfos:s}}function xe(e,t){if(!e)return!1;const{status:o,mode:r}=e;return o!==n.NO_USE&&(o===n.CALCULATED||"runtime-infer"===r&&(!t||De(e,t)))}function Me(e,t){const o=e=>{if(!Number.isNaN(Number(e))){const t=e.split(".");let o=e;for(let e=0;e<3-t.length;e++)o+=".0";return o}return e};return!!Te(o(e),`<=${o(t)}`)}const Le=(e,t)=>{const o=t||function(e,t){return Me(e,t)};return Object.keys(e).reduce(((e,t)=>e?o(e,t)||"0"===e?t:e:t),0)},Pe=e=>Boolean(e.loaded)||"function"==typeof e.lib,De=(e,t)=>{if(!e||!t)return!1;const{usedExports:o}=e;return!!o&&!!t.every((e=>o.includes(e)))};function He(e,t,o,r){const n=e[t][o];let s="",i=xe(r);const a=function(e,t){return i?!n[e].treeShaking||!!n[t].treeShaking&&!Pe(n[e].treeShaking)&&Me(e,t):!Pe(n[e])&&Me(e,t)};if(i){if(s=Le(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Le(e[t][o],a),useTreesShaking:i}}const Fe=e=>Pe(e)||(e=>Boolean(e.loading))(e);function Ce(e,t,o,r){const n=e[t][o];let s="",i=xe(r);const a=function(e,t){if(i){if(!n[e].treeShaking)return!0;if(!n[t].treeShaking)return!1;if(Fe(n[t].treeShaking))return!Fe(n[e].treeShaking)||Boolean(Me(e,t));if(Fe(n[e].treeShaking))return!1}return Fe(n[t])?!Fe(n[e])||Boolean(Me(e,t)):!Fe(n[e])&&Me(e,t)};if(i){if(s=Le(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Le(e[t][o],a),useTreesShaking:i}}function je(e){return"loaded-first"===e?Ce:He}function Ue(e,t,o,r){if(!e)return;const{shareConfig:n,scope:s=j,strategy:i,treeShaking:a}=o,c=Array.isArray(s)?s:[s];for(const s of c)if(n&&e[s]&&e[s][t]){const{requiredVersion:c}=n,{version:l,useTreesShaking:h}=je(i)(e,s,t,a),m=()=>{const r=e[s][t][l];if(n.singleton){if("string"==typeof c&&!Te(l,c)){const e=`Version ${l} from ${l&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${c})`;n.strictVersion?E(e):S(e)}return{shared:r,useTreesShaking:h}}{if(!1===c||"*"===c)return{shared:r,useTreesShaking:h};if(Te(l,c))return{shared:r,useTreesShaking:h};const o=xe(a);if(o)for(const[r,n]of Object.entries(e[s][t]))if(xe(n.treeShaking,a?.usedExports)&&Te(r,c))return{shared:n,useTreesShaking:o};for(const[o,r]of Object.entries(e[s][t]))if(Te(o,c))return{shared:r,useTreesShaking:!1}}},f={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:O.__FEDERATION__,shareInfo:o,resolver:m};return(r.emit(f)||f).resolver()}}function Ge(){return O.__FEDERATION__.__SHARE__}function Be(e){const{pkgName:t,extraOptions:o,shareInfos:r}=e,n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=(...e)=>{const t={};for(const o of e)if(o)for(const[e,r]of Object.entries(o)){const o=t[e];n(o)&&n(r)?t[e]=s(o,r):void 0!==r&&(t[e]=r)}return t};return s((o?.resolver??(e=>{if(!e)return;const t={};return e.forEach((e=>{t[e.version]=e})),t[Le(t,(function(e,o){return!Pe(t[e])&&Me(e,o)}))]}))(r[t]),o?.customShareInfo)}const Ve=(e,t)=>{var o,r;e.useIn||(e.useIn=[]),o=e.useIn,r=t,-1===o.findIndex((e=>e===r))&&o.push(r)};function We(e,t){return t&&e.treeShaking?e.treeShaking:e}const qe=function(...e){return e.length?e.reduce(((e,t)=>t?e?`${e}:${t}`:t:e),""):""};function ze(e,t){if("getPublicPath"in e){let o;return o=e.getPublicPath.startsWith("function")?new Function("return "+e.getPublicPath)()():new Function(e.getPublicPath)(),`${o}${t}`}return"publicPath"in e?i()||a()||!("ssrPublicPath"in e)||"string"!=typeof e.ssrPublicPath?`${e.publicPath}${t}`:`${e.ssrPublicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const Ke=e=>{console.warn(`[ Federation Runtime ]: ${e}`)};function Ze(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}async function Je(e,t){try{return await e()}catch(e){return void(!t&&Ke(e))}}function Ye(e,t){const o=/^(https?:)?\/\//i;return e.replace(o,"").replace(/\/$/,"")===t.replace(o,"").replace(/\/$/,"")}function Xe(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("script");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("src");if(i&&Ye(i,e.url)){o=n,r=!1;break}}if(!o){const t=e.attrs;let r;o=document.createElement("script"),o.type="module"===t?.type?"module":"text/javascript",e.createScriptHook&&(r=e.createScriptHook(e.url,e.attrs),r instanceof HTMLScriptElement?o=r:"object"==typeof r&&("script"in r&&r.script&&(o=r.script),"timeout"in r&&r.timeout&&(n=r.timeout))),o.src||(o.src=e.url),t&&!r&&Object.keys(t).forEach((e=>{o&&("async"===e||"defer"===e?o[e]=t[e]:o.getAttribute(e)||o.setAttribute(e,t[e]))}))}let i=null;const a="undefined"!=typeof window?t=>{if(t.filename&&Ye(t.filename,e.url)){const o=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);o.name="ScriptExecutionError",i=o}}:null;a&&window.addEventListener("error",a);const c=async(r,n)=>{clearTimeout(t),a&&window.removeEventListener("error",a);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else i?e?.onErrorCallback&&e?.onErrorCallback(i):e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Je((()=>{const{needDeleteScript:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r&&"function"==typeof r)){const e=r(n);if(e instanceof Promise){const t=await e;return s(),t}return s(),e}s()};return o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),t=setTimeout((()=>{c(null,{type:"error",isTimeout:!0})}),n),{script:o,needAttach:r}}const Qe=new Map;function et(e){if(!e)throw new Error("import specifier is required");if(Qe.has(e))return Qe.get(e);const t=new Function("name","return import(name)")(e).then((e=>e)).catch((t=>{throw console.error(`Error importing module ${e}:`,t),Qe.delete(e),t}));return Qe.set(e,t),t}const tt="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t,o,r)=>{if(r?.createScriptHook){const t=r.createScriptHook(e);t&&"object"==typeof t&&"url"in t&&(e=t.url)}let n;try{n=new URL(e)}catch(e){return console.error("Error constructing URL:",e),void t(new Error(`Invalid URL: ${e}`))}(async()=>r?.fetch?(e,t)=>(async(e,t,o)=>{const r=await((e,t)=>o.lifecycle.fetch.emit(e,t))(e,t||{});return r&&r instanceof Response?r:fetch(e,t||{})})(e,t,r):fetch)().then((async e=>{if("esm"===o?.type||"module"===o?.type)return at(n.href,{fetch:e,vm:await et("vm")}).then((async e=>{await e.evaluate(),t(void 0,e.namespace)})).catch((e=>{t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}));(async(e,r)=>{try{const n=await e(r.href),s=await n.text(),[i,a]=await Promise.all([et("path"),et("vm")]),c={exports:{},module:{exports:{}}},l=r.pathname.split("/").slice(0,-1).join("/"),h=i.basename(r.pathname),m=new a.Script(`(function(exports, module, require, __dirname, __filename) {${s}\n})`,{filename:h,importModuleDynamically:a.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??et});let f;f=(await et("node:module")).createRequire("file:"===r.protocol||"node:"===r.protocol?r.href:i.join(process.cwd(),"__mf_require_base__.js")),m.runInThisContext()(c.exports,c.module,f,l,h);const d=c.module.exports||c.exports;if(o&&d&&o.globalName)return void t(void 0,d[o.globalName]||d);t(void 0,d)}catch(e){t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}})(e,n)})).catch((e=>{t(e)}))}:(e,t,o,r)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},ot="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise(((o,r)=>{tt(e,((e,n)=>{e?r(e):o(globalThis[t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`]=n)}),t.attrs,t.loaderHook)})):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},rt=new Map,nt=e=>e.startsWith("http:")||e.startsWith("https:"),st=e=>!(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes(":"));async function it(e,t,o){if(await async function(e){return!!e.startsWith("node:")||!!st(e)&&(await et("node:module")).builtinModules.includes(e)}(e))return async function(e,t){const o=`node-builtin:${e}`;return rt.has(o)?rt.get(o):async function(e,t,o){if("function"!=typeof o.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const r=function(e){const t=!e||"object"!=typeof e&&"function"!=typeof e?{default:e}:e,o={...t};return Object.prototype.hasOwnProperty.call(o,"default")||(o.default=t),o}(t),n=Object.keys(r),s=new o.SyntheticModule(n,(function(){for(const e of n)this.setExport(e,r[e])}),{identifier:e});return rt.set(e,s),await s.link((async()=>{throw new Error(`Node.js built-in module "${e}" should not request child modules.`)})),await s.evaluate(),s}(o,await et(e),t)}(e,o.vm);if(st(e))throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const r=new URL(e,t).href;if(!nt(r))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return at(r,o)}async function at(e,t){if(rt.has(e))return rt.get(e);const{fetch:o,vm:r}=t;if(!nt(e))throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);const n=await(await o(e)).text(),s=(await et("node:url")).pathToFileURL(process.cwd()).href,i=new r.SourceTextModule(n,{identifier:e,initializeImportMeta:t=>{t.url=function(e,t){const o=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${function(e){const t=new URL(e),o=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),n=t.pathname.split("/").map((e=>encodeURIComponent(e))).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${o}/${r}${n}${s?`/${s}`:""}`}(e)}`,o).href}(e,s)},importModuleDynamically:async o=>async function(e){if("linked"===e.status&&await e.evaluate(),"errored"===e.status)throw e.error;return e}(await it(o,e,t))});return rt.set(e,i),await i.link((async o=>it(o,e,t))),i}const ct="RUNTIME-001",lt="RUNTIME-002",ht="RUNTIME-003",mt="RUNTIME-004",ft="RUNTIME-005",dt="RUNTIME-006",ut="RUNTIME-007",pt="RUNTIME-008",yt="RUNTIME-009",gt="RUNTIME-010",Et="RUNTIME-011",St="RUNTIME-012",_t="RUNTIME-013",It="RUNTIME-014",bt="RUNTIME-015",wt={[ct]:"Failed to get remoteEntry exports.",[lt]:'The remote entry interface does not contain "init"',[ht]:"Failed to get manifest.",[mt]:"Failed to locate remote.",[ft]:"Invalid loadShareSync function call from bundler runtime",[dt]:"Invalid loadShareSync function call from runtime",[ut]:"Failed to get remote snapshot.",[pt]:"Failed to load script resources.",[yt]:"Please call createInstance first.",[gt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Et]:"The remoteEntry URL is missing from the remote snapshot.",[St]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',[_t]:"The manifest is not a valid Module Federation manifest.",[It]:"The remote does not expose the requested module.",[bt]:"Remote container initialization failed."},Nt=".then(callbacks[0]).catch(callbacks[1])",$t=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function vt(e){return"esm"===e||"module"===e}function Rt(e,t,o){const{remoteEntryKey:r,entryExports:n}=F(e,t);return n||E(ct,wt,{remoteName:e,remoteEntryUrl:o,remoteEntryKey:r}),n}async function kt({remoteInfo:e,remoteEntryExports:t,loaderHook:o,getEntryUrl:r,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return vt(c)?async function({entry:e,remoteEntryExports:t,name:o,getEntryUrl:r}){return new Promise(((n,s)=>{const i=e=>{if((t=e)instanceof TypeError&&$t.some((e=>t.message.includes(e)))){const t=e instanceof Error?e.message:String(e);try{E(pt,wt,{remoteName:o,resourceUrl:a},t)}catch(e){return void s(e)}}var t;s(e)},a=r?r(e):e;try{t?n(t):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?new Function("callbacks",`import("${a}")${Nt}`)([n,i]):import(a).then(n).catch(i)}catch(e){E(`Failed to load ESM entry from "${a}". ${e instanceof Error?e.message:String(e)}`)}}))}({entry:s,remoteEntryExports:t,name:a,getEntryUrl:r}):"system"===c?async function({entry:e,remoteEntryExports:t}){return new Promise(((o,r)=>{try{t?o(t):new Function("callbacks",`System.import("${e}")${Nt}`)([o,r])}catch(t){E(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}}))}({entry:s,remoteEntryExports:t}):async function({name:e,globalName:t,entry:o,remoteInfo:r,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=F(e,t);if(a)return a;const c=s?s(o):o;return function(e,t){const{attrs:o={},createScriptHook:r}=t;return new Promise(((t,n)=>{const{script:s,needAttach:i}=Xe({url:e,cb:t,onErrorCallback:n,attrs:{fetchpriority:"high",...o},createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(s)}))}(c,{attrs:{},createScriptHook:(e,t)=>{const o=n.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:i?{...i,url:e}:void 0});if(o)return o instanceof HTMLScriptElement||"script"in o||"timeout"in o?o:void 0}}).then((()=>Rt(e,t,o)),(t=>{const o=t instanceof Error?t.message:String(t);E(pt,wt,{remoteName:e,resourceUrl:c},o)}))}({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:o,getEntryUrl:r,resourceContext:n})}function Ot(e){const{entry:t,name:o}=e;return qe(o,t)}async function Tt(e){const{origin:t,remoteEntryExports:o,remoteInfo:r,getEntryUrl:n,resourceContext:i,_inErrorHandling:a=!1}=e,c=Ot(r);if(o)return o;if(!x[c]){const e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;x[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:o}).then((e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:s)?kt({remoteInfo:r,remoteEntryExports:o,loaderHook:l,getEntryUrl:n,resourceContext:i}):async function({remoteInfo:e,loaderHook:t,resourceContext:o}){const{entry:r,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=F(s,n);return a||ot(r,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(r,n={})=>{const s=t.lifecycle.createScript.emit({url:r,attrs:n,remoteInfo:e,resourceContext:o?{...o,url:r}:void 0});if(s)return"url"in s?s:void 0}}}).then((()=>Rt(s,n,r))).catch((e=>{E(`Failed to load Node.js entry for remote "${s}" from "${r}". ${e instanceof Error?e.message:String(e)}`)}))}({remoteInfo:r,loaderHook:l,resourceContext:i})))).then((async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e))).catch((async e=>{const n=Ot(r),s=e instanceof Error&&e.message.includes("ScriptExecutionError");if(e instanceof Error&&e.message.includes(pt)&&!s&&!a){const e=e=>Tt({...e,_inErrorHandling:!0}),s=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e,origin:t,remoteInfo:r,remoteEntryExports:o,globalLoading:x,uniqueKey:n});if(s)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:s,recovered:!0}),s}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e}))}return x[c]}function At(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||U,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||j}}function xt(e,t){return t&&"."!==t?`${e}/${t.replace(/^\.\//,"")}`:e}function Mt(e,t){for(const o of e){const e=t.startsWith(o.name);let r=t.replace(o.name,"");if(e){if(r.startsWith("/"))return r=`.${r}`,{pkgNameOrAlias:o.name,expose:r,remote:o};if(""===r)return{pkgNameOrAlias:o.name,expose:".",remote:o}}const n=o.alias&&t.startsWith(o.alias);let s=o.alias&&t.replace(o.alias,"");if(o.alias&&n){if(s&&s.startsWith("/"))return s=`.${s}`,{pkgNameOrAlias:o.alias,expose:s,remote:o};if(""===s)return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function Lt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Pt(e){return e instanceof Error&&(e.message.includes("timed out")||e.name.includes("Timeout"))}function Dt(e,t,o,r){return{url:t,status:o,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Ht({host:e,remoteInfo:t,url:o,attrs:r,context:n,needDeleteLink:s}){return new Promise((i=>{const{link:a,needAttach:c}=function(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("link");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("href"),a=n.getAttribute("rel");if(i&&Ye(i,e.url)&&a===e.attrs.rel){o=n,r=!1;break}}if(!o){let t;o=document.createElement("link"),o.setAttribute("href",e.url);let r=!0;const s=e.attrs;e.createLinkHook&&(t=e.createLinkHook(e.url,s),t instanceof HTMLLinkElement?(o=t,r=!1):"object"==typeof t&&("link"in t&&t.link&&(o=t.link,r=!1),"timeout"in t&&t.timeout&&(n=t.timeout))),s&&r&&Object.keys(s).forEach((e=>{o&&!o.getAttribute(e)&&o.setAttribute(e,s[e])}))}if(!r)return Promise.resolve().then((()=>{e?.cb&&e?.cb()})),{link:o,needAttach:r};const i=(r,n)=>{t&&clearTimeout(t);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Je((()=>{const{needDeleteLink:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r)){const e=r(n);return s(),e}s()};return o.onerror=i.bind(null,o.onerror),o.onload=i.bind(null,o.onload),t=setTimeout((()=>{i(null,{type:"error",isTimeout:!0})}),n),{link:o,needAttach:r}}({url:o,cb:()=>{i(Dt(n,o,c?"success":"cached"))},onErrorCallback:e=>{i(Dt(n,o,Pt(e)?"timeout":"error",e))},attrs:r,createLinkHook:(o,r)=>{const s=e.loaderHook.lifecycle.createLink.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLLinkElement,s},needDeleteLink:s});c&&document.head.appendChild(a)}))}function Ft({host:e,remoteInfo:t,url:o,attrs:r,context:n}){return new Promise((s=>{const{script:i,needAttach:a}=Xe({url:o,cb:()=>{s(Dt(n,o,a?"success":"cached"))},onErrorCallback:e=>{s(Dt(n,o,Pt(e)?"timeout":"error",e))},attrs:r,createScriptHook:(o,r)=>{const s=e.loaderHook.lifecycle.createScript.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLScriptElement,s},needDeleteScript:!0});a&&document.head.appendChild(i)}))}function Ct(e,t){return{...e,resourceType:t}}function jt(e,t,o,r=!0,n={initiator:"preloadRemote",id:e.name}){const{cssAssets:s,jsAssetsWithoutEntry:i,entryAssets:a}=o,c=[];if(t.options.inBrowser){if(a.forEach((e=>{const{moduleInfo:o}=e;c.push(async function(e,t,o,r){const n=e.moduleCache.get(o.name),s=o.entry;if(n?.remoteEntryExports)return Dt(r,s,"cached");try{if(!await Tt({origin:e,remoteInfo:o,remoteEntryExports:n?.remoteEntryExports,resourceContext:{...r,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return Dt(r,s,"success")}catch(e){return Dt(r,s,Pt(e)?"timeout":"error",e)}}(t,0,o,Ct(n,"remoteEntry")))})),r){const o={rel:"preload",as:"style"};s.forEach((r=>{c.push(Ht({host:t,remoteInfo:e,url:r,attrs:o,context:Ct(n,"css")}))}))}else{const o={rel:"stylesheet",type:"text/css"};s.forEach((r=>{c.push(Ht({host:t,remoteInfo:e,url:r,attrs:o,needDeleteLink:!1,context:Ct(n,"css")}))}))}let o=Ft,l={fetchpriority:"high",type:"text/javascript"};r?(o=Ht,l={rel:"preload",as:"script"}):vt(e.type)&&(o=Ht,l={rel:"modulepreload",fetchpriority:"high"}),i.forEach((r=>{c.push(o({host:t,remoteInfo:e,url:r,attrs:l,context:Ct(n,"js")}))}))}return Promise.all(c)}function Ut(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Gt(e){const t={};for(const[o,r]of Object.entries(e.shared)){const e=r[0];e&&(t[o]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:!1!==e.shareConfig?.requiredVersion&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(Ut)??[],shared:t}}}function Bt(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map((e=>e.moduleName)).filter(Boolean);return t.length?t.join(","):void 0}var Vt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await Tt({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:xt(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return g(t,`remoteEntryExports is undefined \n ${Ze(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,o,r){const n=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host}),n;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,cached:!0,origin:this.host}),o}return n}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:r,shareScope:s,initScope:i}=function(e,t,o){const r=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach((e=>{r[e]||(r[e]={})}));const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:r[n[0]],initScope:o??[]}}(this.remoteInfo,this.host.shareScopeMap,o),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:r,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});void 0===n?.init&&E(lt,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Gt(this.host.options));try{await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions)}catch(e){E(bt,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Gt(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,origin:this.host}),o}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,o,r){const{loadFactory:n=!0}=o||{loadFactory:!0},s=await this.init(e,r,void 0,t);let i;this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});try{const o=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i="function"==typeof o?o:void 0,i||(i=await s.get(t)),i||E(It,wt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bt(r)},void 0,Gt(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:i,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:o,origin:this.host}),o}const a=((e,t)=>{let o;return o=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),o+=t,o})(this.remoteInfo.name,t),c=this.wraperFactory(i,a);if(!n)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const o=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:o,origin:this.host}),o}catch(o){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:o,origin:this.host}),o}}wraperFactory(e,t){function o(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return()=>{const r=e();return r instanceof Promise?r.then((e=>(o(e,t),e))):(o(r,t),r)}}},Wt=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var o;g((o=e,"[object Object]"===N.call(o)),"Plugin configuration is invalid.");const r=e.name;g(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach((t=>{const o=e[t];o&&this.lifecycle[t].on(o)})))}removePlugin(e){g(e,"A name is required.");const t=this.registerPlugins[e];g(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach((e=>{"name"!==e&&this.lifecycle[e].remove(t[e])}))}},qt=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){"function"==typeof e&&this.listeners.add(e)}once(e){const t=this;this.on((function o(...r){return t.remove(o),e.apply(null,r)}))}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach((o=>{const r=o(...e);void 0!==r&&(t=r)})),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};function zt(e,t){if(!w(t))return!1;if(e!==t)for(const o in e)if(!(o in t))return!1;return!0}var Kt=class extends qt{constructor(e){super(),this.onerror=E,this.type=e}emit(e){w(e)||E(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const o=t(e);if(void 0===o)continue;if(!zt(e,o)){this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}e=o}catch(e){S(e),this.onerror(e)}return e}},Zt=class extends qt{constructor(e){super(),this.onerror=E,this.type=e}emit(e){w(e)||E(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let o=0;const r=t=>(S(t),this.onerror(t),e),n=s=>{if(void 0!==s&&zt(e,s))e=s;else if(void 0!==s)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(o<t.length)try{return Promise.resolve(t[o++](e)).then(n,r)}catch(e){return r(e)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const Jt="Remote loading is disabled by experiments.optimization.disableRemote.";var Yt=class{constructor(){this.hooks=new Wt({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(Jt)}preloadRemote(){throw new Error(Jt)}registerRemotes(){throw new Error(Jt)}getRemoteModuleAndOptions(){throw new Error(Jt)}initRawContainer(){throw new Error(Jt)}},Xt=class extends qt{emit(...e){let t;const o=Array.from(this.listeners);if(o.length>0){let r=0;const n=t=>!1!==t&&(r<o.length?Promise.resolve(o[r++].apply(null,e)).then((o=>void 0===o||1===e.length&&o===e[0]?n(t):n(o))):t);t=n()}return Promise.resolve(t)}};function Qt(e,t){const o=v(t);o.url||E(Et,wt,{remoteName:e.name});let r=ze(t,o.url);s||r.startsWith("http")||(r=`https:${r}`),e.type=o.type,e.entryGlobalName=o.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}const eo=(e,t)=>{if(!e)return t;const o=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){const t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function to(e){return!(!("remoteEntry"in e)||!e.remoteEntry.includes(o))}function oo(e){const t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function ro(e,t,o,r,n={},s){const{value:i}=L(e,_(t)),a=s||i;if(a&&!to(a)&&(o(a,t,r),a.remotesInfo)){const t=Object.keys(a.remotesInfo);for(const r of t){if(n[r])continue;n[r]=!0;const t=oo(r),s=a.remotesInfo[r];ro(e,{name:t.name,version:s.matchedVersion},o,!1,n,void 0)}}}const no=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function so(e,t,o,r,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:h}=e,{preloadConfig:m}=t,{depsRemote:f}=m;if(ro(r,o,((t,o,r)=>{let n;if(r)n=m;else if(Array.isArray(f)){const e=f.find((e=>e.nameOrAlias===o.name||e.nameOrAlias===o.alias));if(!e)return;n=Lt(e)}else{if(!0!==f)return;n=m}const c=ze(t,v(t).url);c&&a.push({name:o.name,moduleInfo:{name:o.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:o.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let l="modules"in t?t.modules:[];const h=(d=n.exposes)?d.map((e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e)):[];var d,u;function p(e){const o=e.map((e=>ze(t,e)));return n.filter?o.filter(n.filter):o}if(h.length&&"modules"in t&&(l=t?.modules?.reduce(((e,t)=>(-1!==h?.indexOf(t.moduleName)&&e.push(t),e)),[])),l){const r=l.length;for(let a=0;a<r;a++){const r=l[a],c=`${o.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===r.moduleName?o.name:c,name:o.name,remoteSnapshot:t,preloadConfig:n,remote:o,origin:e}),u=c,R.__FEDERATION__.__PRELOADED_MAP__.get(u)||("all"===n.resourceCategory?(s.push(...p(r.assets.css.async)),s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.async)),i.push(...p(r.assets.js.sync))):"sync"===n.resourceCategory&&(s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.sync))),C(c))}}}),!0,{},n),n.shared&&n.shared.length>0){const t=(t,o)=>{const{shared:r}=Ue(e.shareScopeMap,o.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&"function"==typeof r.lib&&(o.assets.js.sync.forEach((e=>{c.add(e)})),o.assets.css.sync.forEach((e=>{l.add(e)})))};n.shared.forEach((e=>{const o=h.shared?.[e.sharedName];if(!o)return;const r=e.version?o.find((t=>t.version===e.version)):o;r&&$(r).forEach((o=>{t(o,e)}))}))}const d=i.filter((e=>!c.has(e)&&!no("script",e)));return{cssAssets:s.filter((e=>!l.has(e)&&!no("link",e))),jsAssetsWithoutEntry:d,entryAssets:a.filter((e=>!no("script",e.url)))}}function io(e,t){const o=D({name:t.name,version:t.options.version}),r=o&&"remotesInfo"in o&&o.remotesInfo&&L(o.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:P(),remoteSnapshot:D({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:P(),remoteSnapshot:D({name:e.name,version:"version"in e?e.version:void 0})}}var ao=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Wt({beforeLoadRemoteSnapshot:new Xt("beforeLoadRemoteSnapshot"),loadSnapshot:new Zt("loadGlobalSnapshot"),loadRemoteSnapshot:new Zt("loadRemoteSnapshot"),afterLoadSnapshot:new Zt("afterLoadSnapshot")}),this.manifestLoading=O.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:o="loadRemote"}){const{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let n=D({name:this.HostInstance.options.name,version:this.HostInstance.options.version});var i;n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},i={[this.HostInstance.options.name]:n},k.__FEDERATION__.moduleInfo={...k.__FEDERATION__.moduleInfo,...i}),n&&"remotesInfo"in n&&!L(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:a,remoteSnapshot:c,globalSnapshot:l}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:m}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:c,globalSnapshot:l});let f,d;if(h)if(to(h)){const r=s?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",n=await this.loadManifestSnapshot(r,e,{},{initiator:o,id:t||e.name});f=n,d=H({...e,entry:r},n)}else{const{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});f=t,d=m}else if(I(e)){const r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:o,id:t||e.name});f=r,d=H(e,r)}else E(ut,wt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(m)},void 0,Gt(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:d}}getGlobalRemoteInfo(e){return io(e,this.HostInstance)}async getManifestJson(e,t,o,r){return(async()=>{const o=At(t);let n=this.manifestCache.get(e);if(n)return n;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},o,r?{...r,url:e,resourceType:"manifest"}:void 0);t&&t instanceof Response||(t=await fetch(e,{})),n=await t.json()}catch(r){n=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),n||(delete this.manifestLoading[e],E(ht,wt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Gt(this.HostInstance.options)))}const s=[!n.metaData&&"metaData",!n.exposes&&"exposes",!n.shared&&"shared"].filter(Boolean);return s.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${s.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),s.length>0&&E(_t,wt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:s.join(",")},void 0,Gt(this.HostInstance.options)),this.manifestCache.set(e,n),n})()}async loadManifestSnapshot(e,t,o,r){return this.manifestLoading[e]||(this.manifestLoading[e]=(async()=>{const n=await this.getManifestJson(e,t,o,r),s=function(e,t={}){const{remotes:o={},overrides:r={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?"auto"!==e.metaData.publicPath&&""!==e.metaData.publicPath||!n?e.metaData.publicPath:n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"):e.metaData.getPublicPath,a=Object.keys(r);let c={};Object.keys(o).length||(c=e.remotes?.reduce(((e,t)=>{let o;const n=t.federationContainerName;return o=a.includes(n)?r[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:o},e}),{})||{}),Object.keys(o).forEach((e=>c[e]={matchedVersion:a.includes(e)?r[e]:o[e]}));const{remoteEntry:{path:l,name:h,type:m},types:f={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:d},globalName:u,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:d,globalName:u,remoteEntry:eo(l,h),remoteEntryType:m,remoteTypes:eo(f.path,f.name),remoteTypesZip:f.zip||"",remoteTypesAPI:f.api||"",remotesInfo:c,shared:e?.shared.map((e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]}))),modules:y?.map((e=>({moduleName:e.name,modulePath:e.path,assets:e.assets})))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},"string"==typeof e.metaData.ssrPublicPath&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const e=eo(p.path,p.name);s.ssrRemoteEntry=e,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}(n,{version:e}),{remoteSnapshot:i}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:n,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return i})().then((e=>e))),this.manifestLoading[e]}},co=class{constructor(){this.hooks=new Wt({})}},lo=class{constructor(e){this.hooks=new Wt({beforeRegisterShare:new Kt("beforeRegisterShare"),afterResolve:new Zt("afterResolve"),beforeLoadShare:new Zt("beforeLoadShare"),loadShare:new Xt,afterLoadShare:new qt("afterLoadShare"),errorLoadShare:new qt("errorLoadShare"),resolveShare:new Kt("resolveShare"),initContainerShareScopeMap:new Kt("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:o,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:o,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){S(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:o,error:r,recovered:n}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:n})}catch(e){S(e)}}registerShared(e,t){const{newShareInfos:o,allShareInfos:r}=Ae(e,t);return Object.keys(o).forEach((e=>{o[e].forEach((o=>{o.scope.forEach((r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:o}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:o.lib,get:o.get,loaded:o.loaded||Boolean(o.lib),shared:o,from:t.name})}))}))})),{newShareInfos:o,allShareInfos:r}}async loadShare(e,t){const{host:o}=this,r=Be({pkgName:e,extraOptions:t,shareInfos:o.options.shared});let n=r;try{r?.scope&&await Promise.all(r.scope.map((async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))}))),n=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:o.options.shared,origin:o})).shareInfo,g(n,`Cannot find shared "${e}" in host "${o.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const s=n,{shared:i,useTreesShaking:a}=Ue(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(i){const t=We(i,a);if(t.lib)return Ve(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),t.lib;if(t.loading&&!t.loaded){const r=await t.loading;return t.loaded=!0,t.lib||(t.lib=r),Ve(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),r}{const r=async()=>{const e=await t.get();return Ve(t,o.options.name),t.loaded=!0,t.lib=e,e},n=r();this.setShared({pkgName:e,loaded:!1,shared:i,from:o.options.name,lib:null,loading:n,treeShaking:a?t:void 0});const c=await n;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),c}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,recovered:!0}),!1;const r=xe(s.treeShaking),n=We(s,r),i=async()=>{const t=await n.get();n.lib=t,n.loaded=!0,Ve(n,o.options.name);const{shared:r,useTreesShaking:i}=Ue(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(r){const e=We(r,i);e.lib=t,e.loaded=!0,r.from=s.from}return t},a=i();this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:a,treeShaking:r?n:void 0});const c=await a;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:s}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:n,error:t}),t}}initializeSharing(e=j,t){const{host:o}=this,r=t?.from,n=t?.strategy;let s=t?.initScope;const i=[];if("build"!==r){const{initTokens:t}=this;s||(s=[]);let o=t[e];if(o||(o=t[e]={from:this.host.name}),s.indexOf(o)>=0)return i;s.push(o)}const a=this.shareScopeMap,c=o.options.name;a[e]||(a[e]={});const l=a[e];return Object.keys(o.options.shared).forEach((t=>{o.options.shared[t].forEach((o=>{o.scope.includes(e)&&((e,t)=>{const{version:o,eager:r}=t;l[e]=l[e]||{};const n=l[e],s=n[o]&&We(n[o]),i=Boolean(s&&("eager"in s&&s.eager||"shareConfig"in s&&s.shareConfig?.eager));(!s||"loaded-first"!==s.strategy&&!s.loaded&&(Boolean(!r)!==!i?r:c>n[o].from))&&(n[o]=t)})(t,o)}))})),"version-first"!==o.options.shareStrategy&&"version-first"!==n||o.options.remotes.forEach((t=>{t.shareScope===e&&i.push((async e=>{const{module:t}=await o.remoteHandler.getRemoteModuleAndOptions({id:e});let r;try{r=await t.getEntry()}catch(n){if(r=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"beforeLoadShare",remote:t.remoteInfo,origin:o}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,s))}})(t.name))})),i}loadShareSync(e,t){const{host:o}=this,r=Be({pkgName:e,extraOptions:t,shareInfos:o.options.shared});try{r?.scope&&r.scope.forEach((e=>{this.initializeSharing(e,{strategy:r.strategy})}));const{shared:n}=Ue(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(n){if("function"==typeof n.lib)return Ve(n,o.options.name),n.loaded||(n.loaded=!0,n.from===o.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),n.lib;if("function"==typeof n.get){const t=n.get();if(!(t instanceof Promise))return Ve(n,o.options.name),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:t,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),t}}if(r.lib)return r.loaded||(r.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){const n=r.get();return n instanceof Promise&&E("build"===t?.from?ft:dt,wt,{hostName:o.options.name,sharedPkgName:e},void 0,Gt(o.options)),r.lib=n,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib}E(dt,wt,{hostName:o.options.name,sharedPkgName:e},void 0,Gt(o.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,o={}){const{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:o,lib:r,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...h}=t;(Array.isArray(l)?l:[l]).forEach((t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...h,lib:r});const l=this.shareScopeMap[t][e][c];(e=>{const t=(e,t,o)=>{o&&!e[t]&&(e[t]=o)},o=a?e.treeShaking:e;t(o,"loaded",s),t(o,"loading",n),t(o,"get",i)})(l),o&&l.from!==o&&(l.from=o)}))}_setGlobalShareScopeMap(e){const t=Ge(),o=e.id||e.name;o&&!t[o]&&(t[o]=this.shareScopeMap)}},ho=class{constructor(){this.shareScopeMap={},this.hooks=new Wt({afterResolve:new Zt("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},mo=class{constructor(e){this.hooks=new Wt({beforeRegisterRemote:new Kt("beforeRegisterRemote"),registerRemote:new Kt("registerRemote"),beforeRequest:new Zt("beforeRequest"),afterMatchRemote:new Xt("afterMatchRemote"),onLoad:new Xt("onLoad"),afterLoadRemote:new Xt("afterLoadRemote"),handlePreloadModule:new qt("handlePreloadModule"),errorLoadRemote:new Xt("errorLoadRemote"),beforePreloadRemote:new Xt("beforePreloadRemote"),generatePreloadAssets:new Xt("generatePreloadAssets"),afterPreloadRemote:new Xt("afterPreloadRemote"),loadEntry:new Xt}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce(((e,t)=>(this.registerRemote(t,e,{force:!1}),e)),e.remotes)}setIdToRemoteMap(e,t){const{remote:o,expose:r}=t,{name:n,alias:s}=o;if(this.idToRemoteMap[e]={name:o.name,expose:r},s&&e.startsWith(n)){const t=e.replace(n,s);this.idToRemoteMap[t]={name:o.name,expose:r}}else if(s&&e.startsWith(s)){const t=e.replace(s,n);this.idToRemoteMap[t]={name:o.name,expose:r}}}async loadRemote(e,t){const{host:o}=this,r=Mt(o.options.remotes,e);let n,s=e,i=r?.expose,a=r?At(r.remote):void 0;try{const{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:h}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:m,remote:f,expose:d,id:u,remoteSnapshot:p}=h;s=u,i=d,a=At(f);const y=await c.get(u,d,t,p),g=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:m,expose:d,exposeModule:r?y:void 0,exposeModuleFactory:r?void 0:y,remote:f,options:l,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,h),n={id:s,expose:i,remote:a,options:t,origin:o},"function"==typeof g?g:y}catch(r){const{from:c="runtime"}=t||{from:"runtime"};let l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:"onLoad",expose:i,remote:a,origin:o})}catch(e){throw n={id:s,expose:i,remote:a,options:t,error:e,origin:o},e}if(!l)throw n={id:s,expose:i,remote:a,options:t,error:r,origin:o},r;return n={id:s,expose:i,remote:a,options:t,error:r,origin:o,recovered:!0},l}finally{n&&await this.hooks.lifecycle.afterLoadRemote.emit(n)}}async preloadRemote(e){const{host:t}=this,o=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=(n=t.options.remotes,e.map((e=>{const t=function(e,t){for(const o of e){if(t===o.name)return o;if(o.alias&&t===o.alias)return o}}(n,e.nameOrAlias);return g(t,`Unable to preload ${e.nameOrAlias} as it is not included in ${!t&&Ze({remoteInfo:t,remotes:n})}`),{remote:t,preloadConfig:Lt(e)}})));var n;let s;await Promise.all(r.flatMap((e=>{const{preloadConfig:t,remote:o}=e,r=t.exposes||[];return r.length?r.map((r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:xt(o.name,r)}))):[{ops:e,id:`${o.name}/*`}]})).map((async e=>{const{ops:r,id:n}=e,{remote:s,preloadConfig:i}=r,a=At(s);try{const{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:s,id:n,initiator:"preloadRemote"}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:s,remoteInfo:a,globalSnapshot:e,remoteSnapshot:c});if(!l)return;const h=await jt(a,t,l,!0,{initiator:"preloadRemote",id:n});o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:h})}catch(e){o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:[{url:a.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(a.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:n,error:e}]})}})));const i=o.flatMap((e=>e.results.filter((e=>"error"===e.status||"timeout"===e.status))));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:o,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:o,error:s}),s)throw s}registerRemotes(e,t){const{host:o}=this;e.forEach((e=>{this.registerRemote(e,o.options.remotes,{force:t?.force})}))}initRawContainer(e,t,o){const{host:r}=this,n=new Vt({host:r,remoteInfo:At({name:e,entry:t})});return n.remoteEntryExports=o,r.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:o}=e;let r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:t.options,origin:t,from:"runtime",error:e,lifecycle:"beforeRequest"}),!r)throw e}const{id:n}=r,s=Mt(t.options.remotes,n);if(!s)try{E(mt,wt,{hostName:t.options.name,requestId:n},void 0,Gt(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:e,origin:t}),e}const{remote:i}=s,a=At(i);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:a,origin:t});const c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:h}=c;g(l&&h,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let m=t.moduleCache.get(l.name);const f={host:t,remoteInfo:a};return m||(m=new Vt(f),t.moduleCache.set(l.name,m)),{module:m,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,o){const{host:r}=this,n=()=>{if(e.alias){const o=t.find((t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias))));g(!o,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${o&&o.name} name or alias`)}"entry"in e&&s&&"undefined"!=typeof window&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=j),e.type||(e.type=U)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});const i=t.find((t=>t.name===e.name));if(i){const s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(i),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),Ke(s.join(" ")))}else n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r})}removeRemote(e){try{const{host:t}=this,{name:o}=e,r=t.options.remotes.findIndex((e=>e.name===o));-1!==r&&t.options.remotes.splice(r,1);const n=L(R.__FEDERATION__.moduleInfo,_(e)).key;delete R.__FEDERATION__.moduleInfo[n],"entry"in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete O.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:s}=io(e,t);if(s){const t=s&&"remotesInfo"in s&&s.remotesInfo&&L(s.remotesInfo,e.name).key;t&&delete s.remotesInfo[t]}const i=t.moduleCache.get(e.name);if(i){const o=i.remoteInfo,r=o.entryGlobalName;R[r]&&(Object.getOwnPropertyDescriptor(R,r)?.configurable?delete R[r]:R[r]=void 0);const n=Ot(i.remoteInfo);x[n]&&delete x[n];let s=o.buildVersion?qe(o.name,o.buildVersion):o.name;const a=R.__FEDERATION__.__INSTANCES__.findIndex((e=>o.buildVersion?e.options.id===s:e.name===s));if(-1!==a){const e=R.__FEDERATION__.__INSTANCES__[a];s=e.options.id||s;const t=Ge();let r=!0;const n=[];Object.keys(t).forEach((e=>{const s=t[e];s&&Object.keys(s).forEach((t=>{const i=s[t];i&&Object.keys(i).forEach((s=>{const a=i[s];a&&Object.keys(a).forEach((i=>{const c=a[i];c&&"object"==typeof c&&c.from===o.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter((e=>e!==o.name)),c.useIn.length?r=!1:n.push([e,t,s,i])):n.push([e,t,s,i]))}))}))}))})),r&&(e.shareScopeMap={},delete t[s]),n.forEach((([e,o,r,n])=>{delete t[e]?.[o]?.[r]?.[n]})),R.__FEDERATION__.__INSTANCES__.splice(a,1)}t.moduleCache.delete(e.name)}}catch(e){y.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}};const fo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,uo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_REMOTE||!FEDERATION_OPTIMIZE_NO_REMOTE,po="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SHARED||!FEDERATION_OPTIMIZE_NO_SHARED;var yo=class{constructor(e){this.hooks=new Wt({beforeInit:new Kt("beforeInit"),init:new qt,beforeInitContainer:new Zt("beforeInitContainer"),initContainer:new Zt("initContainer")}),this.version="2.8.2",this.moduleCache=new Map,this.loaderHook=new Wt({getModuleInfo:new qt,createScript:new qt,createLink:new qt,fetch:new Xt,loadEntryError:new Xt,afterLoadEntry:new Xt("afterLoadEntry"),beforeInitRemote:new Xt("beforeInitRemote"),afterInitRemote:new Xt("afterInitRemote"),beforeGetExpose:new Xt("beforeGetExpose"),afterGetExpose:new Xt("afterGetExpose"),beforeExecuteFactory:new Xt("beforeExecuteFactory"),afterExecuteFactory:new Xt("afterExecuteFactory"),getModuleFactory:new Xt}),this.bridgeHook=new Wt({beforeBridgeRender:new qt,afterBridgeRender:new qt,beforeBridgeDestroy:new qt,afterBridgeDestroy:new qt});const t=uo&&fo?[{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:o,expose:r,origin:n,remoteInfo:s,id:i}=e;if(!I(t)||!b(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:xt(t.name,r)});Qt(s,a);const l={remote:t,preloadConfig:{nameOrAlias:o,exposes:[r],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return h&&jt(s,n,h,!1,{initiator:"loadRemote",id:i}).catch((()=>{})),{...e,remoteSnapshot:a}}return e}},{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:o,remoteInfo:r,remote:n,globalSnapshot:i,remoteSnapshot:a}=e;return s?I(n)&&b(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:r.name,entry:n.entry,type:r.type||"global",entryGlobalName:"",shareScope:""}}]}:(Qt(r,a),so(t,o,r,i,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}]:[],o={id:"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"",name:e.name,plugins:t,remotes:[],shared:{},inBrowser:s};this.name=e.name,this.options=o,this.snapshotHandler=uo?new ao(this):new co,this.sharedHandler=po?new lo(this):new ho,this.remoteHandler=uo?new mo(this):new Yt,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){e.name&&e.name!==this.options.name&&E(u(gt,wt)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=j,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,o){return this.remoteHandler.initRawContainer(e,t,o)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,o={}){this.sharedHandler.initShareScopeMap(e,t,o)}formatOptions(e,t){const o=po?Ae(e,t).allShareInfos:{},{userOptions:r,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:o}),s=this.remoteHandler.formatAndRegisterRemote(n,r),{allShareInfos:i}=this.sharedHandler.registerShared(n,r),a=[...n.plugins];r.plugins&&r.plugins.forEach((e=>{a.includes(e)||a.push(e)}));const c={...e,...t,plugins:a,remotes:s,shared:i,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=function(e,t){const o=k.__FEDERATION__.__GLOBAL_PLUGIN__,r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return o.length>0&&o.forEach((t=>{e?.find((e=>e.name!==t.name))&&e.push(t)})),e&&e.length>0&&e.forEach((e=>{r.forEach((o=>{o.applyPlugin(e,t)}))})),e}(e,this);this.options.plugins=this.options.plugins.reduce(((e,t)=>t?(e&&!e.find((e=>e.name===t.name))&&e.push(t),e):e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Object.defineProperty,"boolean"==typeof FEDERATION_OPTIMIZE_NO_REMOTE&&FEDERATION_OPTIMIZE_NO_REMOTE;let go=null;function Eo(e){const t=function(e,t){const o="undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"";return R.__FEDERATION__.__INSTANCES__.find((r=>!(!o||r.options.id!==o)||r.options.name===e&&!r.options.version&&!t||!(r.options.name!==e||!t||r.options.version!==t)))}(e.name,e.version),o={...e,id:e.id||""};return t?(t.initOptions(o),go||(go=t),t):(go=function(e){const t=new(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__||yo)({id:`${e.name}@${e.version||Date.now()}`,...e});return function(e){R.__FEDERATION__.__INSTANCES__.push(e)}(t),t}(o),go)}!function(e,t=c()){t&&(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,R.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.2")}(yo);let So=!1;const _o=new Set,Io=async(e,t,o,r="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${r} }`),So||(So=!0,go||Eo({name:"Appshell",remotes:[]})),_o.has(e)||(_o.add(e),function(...e){g(go,yt,wt),go.registerRemotes.apply(go,e)}([{name:e,entry:o}]));const n=t.replace(/^\.\//,""),s=await function(...e){return g(go,yt,wt),go.loadRemote.apply(go,e)}(`${e}/${n}`);if(!s)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${t}, shareScope: ${r} }`),s.default};(Object.getOwnPropertyDescriptor(Io,"name")||{}).writable||Object.defineProperty(Io,"name",{value:"default",configurable:!0});const bo=(e,t)=>({remotes:t,environment:e.environment,modules:{}}),wo=e=>async t=>{const o=e?.remotes[t];if(e&&o)return{remote:o,environment:e.environment[o.scope]??{},manifest:bo(e,e.remotes)}},No=(e,t="")=>async o=>{if(!e)return;const r=`${t}/v1/environments/${e.environmentId}/remotes/${o}`,n=await fetch(r,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,environment:e.environment[s.scope]??{},manifest:bo(e,{[o]:s})}},$o=e=>{const t=new Map;return async o=>{const r=e.index?.[o];if(!r)return;const n=await(e=>{const o=t.get(e);if(o)return o;const r=fetch(e,{credentials:"include"}).then((async t=>{if(!t.ok)throw new Error(`Failed to get manifest from ${e}. ${await t.text()}`);return t.json()}));return t.set(e,r),r})(r),s=n?.remotes[o];return s?{remote:s,environment:{...n.environment[s.scope]??{},...e.overrides?.environment?.[s.scope]??{}},manifest:n}:void 0}},vo=(...e)=>async t=>{for(const o of e){const e=await o(t);if(e)return e}},Ro=(e,t={})=>{const o=t.composition??("undefined"==typeof window?void 0:window.__appshell_config__),r=t.resolver??vo(wo(o),No(o),$o(e));return async e=>{const t=t=>new Error(`Failed to load component '${e}'. ${t?.toString()}`);let o;try{o=await r(e)}catch(e){throw t(e)}if(!o)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:n,environment:s,manifest:i}=o;try{return window[`__appshell_env__${n.scope}`]=s,[await Io(n.scope,n.module,n.remoteEntryUrl,n.shareScope),i]}catch(e){throw t(e)}}};(Object.getOwnPropertyDescriptor(Ro,"name")||{}).writable||Object.defineProperty(Ro,"name",{value:"default",configurable:!0});const ko=Ro;return t})()));
|
|
@@ -115,6 +115,19 @@ export type AppshellComposition<TMetadata = Metadata> = {
|
|
|
115
115
|
index: AppshellIndex;
|
|
116
116
|
remotes: Record<string, ResolvedRemote<TMetadata>>;
|
|
117
117
|
environment: Record<string, Record<string, string | number | undefined>>;
|
|
118
|
+
/**
|
|
119
|
+
* Present whenever a per-developer overlay changed anything about this render — a
|
|
120
|
+
* redirected remote, a different shell bundle, or both. The shell is expected to
|
|
121
|
+
* surface it: a page that quietly runs code from somewhere else is the one thing
|
|
122
|
+
* this feature must never be, and swapping the shell out counts.
|
|
123
|
+
*
|
|
124
|
+
* `shellFlavor` is what was actually served, not what was asked for.
|
|
125
|
+
*/
|
|
126
|
+
overlay?: {
|
|
127
|
+
id: string;
|
|
128
|
+
remotes: string[];
|
|
129
|
+
shellFlavor: 'prod' | 'dev';
|
|
130
|
+
};
|
|
118
131
|
};
|
|
119
132
|
/**
|
|
120
133
|
* Advanced configuration for modules that should be exposed by this container.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":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@@
|
|
|
1
|
-
|
|
2
|
-
forceReload?: boolean;
|
|
3
|
-
cacheBust?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: <TComponent>(scope: string, module: string, remoteEntryUrl: string, shareScope?: string, options?: LoadAppshellComponentOptions) => Promise<TComponent>;
|
|
1
|
+
declare const _default: <TComponent>(scope: string, module: string, remoteEntryUrl: string, shareScope?: string) => Promise<TComponent>;
|
|
6
2
|
export default _default;
|
|
7
3
|
//# sourceMappingURL=loadAppshellComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadAppshellComponent.d.ts","sourceRoot":"","sources":["../../../../src/loadAppshellComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadAppshellComponent.d.ts","sourceRoot":"","sources":["../../../../src/loadAppshellComponent.ts"],"names":[],"mappings":"yBAyBsB,UAAU,SACvB,MAAM,UACL,MAAM,kBACE,MAAM;AAHxB,wBAwCE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AppshellComposition, AppshellGlobalConfig } from '@appshell/config';
|
|
2
|
-
import { type LoadAppshellComponentOptions } from './loadAppshellComponent';
|
|
3
2
|
import { type RemoteResolver } from './resolvers';
|
|
4
3
|
declare global {
|
|
5
4
|
interface Window {
|
|
@@ -12,7 +11,6 @@ export type RemoteLoaderOptions = {
|
|
|
12
11
|
/** Replaces the resolver chain outright; a seam for tests and embedders. */
|
|
13
12
|
resolver?: RemoteResolver;
|
|
14
13
|
};
|
|
15
|
-
|
|
16
|
-
declare const _default: (config: AppshellGlobalConfig, options?: RemoteLoaderOptions) => <TComponent>(key: string, loadOptions?: RemoteComponentLoadOptions) => Promise<readonly [Awaited<TComponent>, import("@appshell/config").AppshellManifest]>;
|
|
14
|
+
declare const _default: (config: AppshellGlobalConfig, options?: RemoteLoaderOptions) => <TComponent>(key: string) => Promise<readonly [Awaited<TComponent>, import("@appshell/config").AppshellManifest]>;
|
|
17
15
|
export default _default;
|
|
18
16
|
//# sourceMappingURL=remoteLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteLoader.d.ts","sourceRoot":"","sources":["../../../../src/remoteLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"remoteLoader.d.ts","sourceRoot":"","sources":["../../../../src/remoteLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAElF,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;KAC3C;CACF;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;iCAEsB,oBAAoB,YAAW,mBAAmB,MAY1D,UAAU,OAAO,MAAM;AAZvC,wBA4CE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appshell/loader",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.14",
|
|
4
4
|
"description": "Utility for loading Appshell components",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/loader/src/index.d.ts",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@module-federation/enhanced": "^2.8.2"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "7dc77badfed56201b3e177f62e55609a360f7e0e"
|
|
31
31
|
}
|
|
@@ -5,29 +5,11 @@ import {
|
|
|
5
5
|
registerRemotes,
|
|
6
6
|
} from '@module-federation/enhanced/runtime';
|
|
7
7
|
|
|
8
|
-
const HOST_NAME = '
|
|
8
|
+
const HOST_NAME = 'Appshell';
|
|
9
9
|
|
|
10
10
|
// The runtime instance and each remote's registration only need to happen once per page load.
|
|
11
11
|
let initialized = false;
|
|
12
12
|
const registeredScopes = new Set<string>();
|
|
13
|
-
const registeredEntries = new Map<string, string>();
|
|
14
|
-
|
|
15
|
-
export type LoadAppshellComponentOptions = {
|
|
16
|
-
forceReload?: boolean;
|
|
17
|
-
cacheBust?: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const withCacheBust = (url: string, cacheBust?: string): string => {
|
|
21
|
-
if (!cacheBust) return url;
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const parsed = new URL(url);
|
|
25
|
-
parsed.searchParams.set('__appshell_hmr', cacheBust);
|
|
26
|
-
return parsed.toString();
|
|
27
|
-
} catch {
|
|
28
|
-
return url;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
13
|
|
|
32
14
|
const ensureInitialized = () => {
|
|
33
15
|
if (initialized) return;
|
|
@@ -46,7 +28,6 @@ export default async <TComponent>(
|
|
|
46
28
|
module: string,
|
|
47
29
|
remoteEntryUrl: string,
|
|
48
30
|
shareScope = 'default',
|
|
49
|
-
options: LoadAppshellComponentOptions = {},
|
|
50
31
|
) => {
|
|
51
32
|
// eslint-disable-next-line no-console
|
|
52
33
|
console.debug(
|
|
@@ -55,20 +36,17 @@ export default async <TComponent>(
|
|
|
55
36
|
|
|
56
37
|
ensureInitialized();
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
// Registered exactly once, and never re-registered or cache-busted afterwards.
|
|
40
|
+
//
|
|
41
|
+
// A remote served by a dev server updates itself: its `remoteEntry` already carries
|
|
42
|
+
// webpack's HMR runtime and a dev-server client, so an edit is applied in place
|
|
43
|
+
// behind a container identity that does not move. Re-registering the same scope, or
|
|
44
|
+
// appending a cache-busting query to its entry, changes that identity and the
|
|
45
|
+
// `publicPath` derived from it mid-flight, which strands the `*.hot-update.json` and
|
|
46
|
+
// `*.hot-update.js` requests the remote is midway through making.
|
|
63
47
|
if (!registeredScopes.has(scope)) {
|
|
64
48
|
registeredScopes.add(scope);
|
|
65
|
-
|
|
66
|
-
registerRemotes([{ name: scope, entry }]);
|
|
67
|
-
} else if (shouldForceReload || registeredEntries.get(scope) !== entry) {
|
|
68
|
-
// eslint-disable-next-line no-console
|
|
69
|
-
console.log(`[appshell-hmr] force re-register remote ${scope} -> ${entry}`);
|
|
70
|
-
registeredEntries.set(scope, entry);
|
|
71
|
-
registerRemotes([{ name: scope, entry }], { force: true });
|
|
49
|
+
registerRemotes([{ name: scope, entry: remoteEntryUrl }]);
|
|
72
50
|
}
|
|
73
51
|
|
|
74
52
|
// Federation ids drop the leading `./` that `exposes` keys use.
|
package/src/remoteLoader.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
import type { AppshellComposition, AppshellGlobalConfig } from '@appshell/config';
|
|
3
|
-
import loadAppshellComponent
|
|
3
|
+
import loadAppshellComponent from './loadAppshellComponent';
|
|
4
4
|
import {
|
|
5
5
|
chainResolvers,
|
|
6
6
|
inlineResolver,
|
|
@@ -22,8 +22,6 @@ export type RemoteLoaderOptions = {
|
|
|
22
22
|
resolver?: RemoteResolver;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export type RemoteComponentLoadOptions = LoadAppshellComponentOptions;
|
|
26
|
-
|
|
27
25
|
export default (config: AppshellGlobalConfig, options: RemoteLoaderOptions = {}) => {
|
|
28
26
|
const composition =
|
|
29
27
|
options.composition ?? (typeof window === 'undefined' ? undefined : window.__appshell_config__);
|
|
@@ -36,7 +34,7 @@ export default (config: AppshellGlobalConfig, options: RemoteLoaderOptions = {})
|
|
|
36
34
|
legacyManifestResolver(config),
|
|
37
35
|
);
|
|
38
36
|
|
|
39
|
-
return async <TComponent>(key: string
|
|
37
|
+
return async <TComponent>(key: string) => {
|
|
40
38
|
const failed = (err: unknown) =>
|
|
41
39
|
new Error(`Failed to load component '${key}'. ${err?.toString()}`);
|
|
42
40
|
|
|
@@ -61,7 +59,6 @@ export default (config: AppshellGlobalConfig, options: RemoteLoaderOptions = {})
|
|
|
61
59
|
remote.module,
|
|
62
60
|
remote.remoteEntryUrl,
|
|
63
61
|
remote.shareScope,
|
|
64
|
-
loadOptions,
|
|
65
62
|
);
|
|
66
63
|
|
|
67
64
|
return [Component, manifest] as const;
|