@module-federation/bridge-vue3 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +223 -221
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("vue"),He=require("vue-router");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ir=st(N),pe=st(He),ar=".json",cr="FEDERATION_DEBUG",lr=":";let Pe=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("vue"),He=require("vue-router");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ir=st(N),pe=st(He),ar=".json",cr="FEDERATION_DEBUG",lr=":";let Pe=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const j=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function it(){return j}function at(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function ur(){try{if(it()&&window.localStorage)return!!localStorage.getItem(cr)}catch{return!1}return!1}function ke(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:ur()}const fr="[ Federation Runtime ]",ct=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${lr}${r}`:r:t,""):""};function Le(e,t){if("getPublicPath"in e){let r;return e.getPublicPath.startsWith("function")?r=new Function("return "+e.getPublicPath)()():r=new Function(e.getPublicPath)(),`${r}${t}`}else return"publicPath"in e?!it()&&!at()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const lt=e=>{console.warn(`${fr}: ${e}`)};function ut(e){try{return JSON.stringify(e,null,2)}catch{return""}}const $e=(e,t)=>{if(!e)return t;const o=(n=>{if(n===".")return"";if(n.startsWith("./"))return n.replace("./","");if(n.startsWith("/")){const s=n.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return n})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function hr(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function dr(e,t={}){var _;const{remotes:r={},overrides:o={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&n?hr(n):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(o);let c={};Object.keys(r).length||(c=((_=e.remotes)==null?void 0:_.reduce((E,R)=>{let S;const b=R.federationContainerName;return a.includes(b)?S=o[b]:"version"in R?S=R.version:S=R.entry,E[b]={matchedVersion:S},E},{}))||{}),Object.keys(r).forEach(E=>c[E]={matchedVersion:a.includes(E)?o[E]:r[E]});const{remoteEntry:{path:l,name:u,type:f},types:h={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:m},globalName:d,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:m,globalName:d,remoteEntry:$e(l,u),remoteEntryType:f,remoteTypes:$e(h.path,h.name),remoteTypesZip:h.zip||"",remoteTypesAPI:h.api||"",remotesInfo:c,shared:e==null?void 0:e.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version,usedExports:E.referenceExports||[]})),modules:y==null?void 0:y.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const E=$e(p.path,p.name);s.ssrRemoteEntry=E,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}function ft(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(ar))}const mr="[ Module Federation ]",te=console,pr=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function yr(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
|
|
2
2
|
`),r=t.filter(o=>!pr.some(n=>o.includes(n)));return r.length?`Stack trace:
|
|
3
3
|
${r.slice(0,5).join(`
|
|
4
|
-
`)}`:void 0}catch{return}}var ht=class{constructor(e,t=te){this.prefix=e,this.delegate=t??te}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??te}emit(e,t){const r=this.delegate,o=ke()?yr():void 0,n=o?[...t,o]: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 i of s){const a=r[i];if(typeof a=="function"){a.call(r,this.prefix,...n);return}}for(const i of s){const a=te[i];if(typeof a=="function"){a.call(te,this.prefix,...n);return}}}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){ke()&&this.emit("debug",e)}};function dt(e){return new ht(e)}function Er(e){const t=new ht(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Er(mr);async function mt(e,t){try{return await e()}catch(r){lt(r);return}}function Oe(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function pt(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("script");for(let l=0;l<s.length;l++){const u=s[l],f=u.getAttribute("src");if(f&&Oe(f,e.url)){t=u,r=!1;break}}if(!t){const l=e.attrs;t=document.createElement("script"),t.type=(l==null?void 0:l.type)==="module"?"module":"text/javascript";let u;e.createScriptHook&&(u=e.createScriptHook(e.url,e.attrs),u instanceof HTMLScriptElement?t=u:typeof u=="object"&&("script"in u&&u.script&&(t=u.script),"timeout"in u&&u.timeout&&(o=u.timeout))),t.src||(t.src=e.url),l&&!u&&Object.keys(l).forEach(f=>{t&&(f==="async"||f==="defer"?t[f]=l[f]:t.getAttribute(f)||t.setAttribute(f,l[f]))})}let i=null;const a=typeof window<"u"?l=>{if(l.filename&&Oe(l.filename,e.url)){const u=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);u.name="ScriptExecutionError",i=u}}:null;a&&window.addEventListener("error",a);const c=async(l,u)=>{clearTimeout(n),a&&window.removeEventListener("error",a);const f=()=>{if((u==null?void 0:u.type)==="error"){const
|
|
5
|
-
})`,{filename:y,importModuleDynamically:((l=m.constants)==null?void 0:l.USE_MAIN_CONTEXT_DEFAULT_LOADER)??
|
|
4
|
+
`)}`:void 0}catch{return}}var ht=class{constructor(e,t=te){this.prefix=e,this.delegate=t??te}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??te}emit(e,t){const r=this.delegate,o=ke()?yr():void 0,n=o?[...t,o]: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 i of s){const a=r[i];if(typeof a=="function"){a.call(r,this.prefix,...n);return}}for(const i of s){const a=te[i];if(typeof a=="function"){a.call(te,this.prefix,...n);return}}}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){ke()&&this.emit("debug",e)}};function dt(e){return new ht(e)}function Er(e){const t=new ht(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Er(mr);async function mt(e,t){try{return await e()}catch(r){lt(r);return}}function Oe(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function pt(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("script");for(let l=0;l<s.length;l++){const u=s[l],f=u.getAttribute("src");if(f&&Oe(f,e.url)){t=u,r=!1;break}}if(!t){const l=e.attrs;t=document.createElement("script"),t.type=(l==null?void 0:l.type)==="module"?"module":"text/javascript";let u;e.createScriptHook&&(u=e.createScriptHook(e.url,e.attrs),u instanceof HTMLScriptElement?t=u:typeof u=="object"&&("script"in u&&u.script&&(t=u.script),"timeout"in u&&u.timeout&&(o=u.timeout))),t.src||(t.src=e.url),l&&!u&&Object.keys(l).forEach(f=>{t&&(f==="async"||f==="defer"?t[f]=l[f]:t.getAttribute(f)||t.setAttribute(f,l[f]))})}let i=null;const a=typeof window<"u"?l=>{if(l.filename&&Oe(l.filename,e.url)){const u=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);u.name="ScriptExecutionError",i=u}}:null;a&&window.addEventListener("error",a);const c=async(l,u)=>{clearTimeout(n),a&&window.removeEventListener("error",a);const f=()=>{if((u==null?void 0:u.type)==="error"){const h=new Error(u!=null&&u.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.)`);h.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(h))}else i?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(i)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteScript:h=!0}=e;h&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l&&typeof l=="function")){const h=l(u);if(h instanceof Promise){const m=await h;return f(),m}return f(),h}f()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),n=setTimeout(()=>{c(null,{type:"error",isTimeout:!0})},o),{script:t,needAttach:r}}function gr(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("link");for(let a=0;a<s.length;a++){const c=s[a],l=c.getAttribute("href"),u=c.getAttribute("rel");if(l&&Oe(l,e.url)&&u===e.attrs.rel){t=c,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let a,c=!0;const l=e.attrs;e.createLinkHook&&(a=e.createLinkHook(e.url,l),a instanceof HTMLLinkElement?(t=a,c=!1):typeof a=="object"&&("link"in a&&a.link&&(t=a.link,c=!1),"timeout"in a&&a.timeout&&(o=a.timeout))),l&&c&&Object.keys(l).forEach(u=>{t&&!t.getAttribute(u)&&t.setAttribute(u,l[u])})}if(!r)return Promise.resolve().then(()=>{e!=null&&e.cb&&(e==null||e.cb())}),{link:t,needAttach:r};const i=(a,c)=>{n&&clearTimeout(n);const l=()=>{if((c==null?void 0:c.type)==="error"){const u=new Error(c!=null&&c.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);u.name="LinkNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}else e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteLink:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),a)){const u=a(c);return l(),u}l()};return t.onerror=i.bind(null,t.onerror),t.onload=i.bind(null,t.onload),n=setTimeout(()=>{i(null,{type:"error",isTimeout:!0})},o),{link:t,needAttach:r}}function _r(e,t){const{attrs:r={},createScriptHook:o}=t;return new Promise((n,s)=>{const{script:i,needAttach:a}=pt({url:e,cb:n,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:o,needDeleteScript:!0});a&&document.head.appendChild(i)})}const ue=new Map;function U(e){if(!e)throw new Error("import specifier is required");if(ue.has(e))return ue.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),ue.delete(e),r});return ue.set(e,t),t}const Rr=async(e,t,r)=>{const n=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!n||!(n instanceof Response)?fetch(e,t||{}):n},Sr=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,o)=>{if(o!=null&&o.createScriptHook){const a=o.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let n;try{n=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>o!=null&&o.fetch?(a,c)=>Rr(a,c,o):fetch,i=async(a,c)=>{var l;try{const f=await(await a(c.href)).text(),[h,m]=await Promise.all([U("path"),U("vm")]),d={exports:{},module:{exports:{}}},p=c.pathname.split("/").slice(0,-1).join("/"),y=h.basename(c.pathname),g=new m.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
5
|
+
})`,{filename:y,importModuleDynamically:((l=m.constants)==null?void 0:l.USE_MAIN_CONTEXT_DEFAULT_LOADER)??U});let _;_=(await U("node:module")).createRequire(c.protocol==="file:"||c.protocol==="node:"?c.href:h.join(process.cwd(),"__mf_require_base__.js")),g.runInThisContext()(d.exports,d.module,_,p,y);const E=d.module.exports||d.exports;if(r&&E&&r.globalName){t(void 0,E[r.globalName]||E);return}t(void 0,E)}catch(u){t(u instanceof Error?u:new Error(`Script execution error: ${u}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return gt(n.href,{fetch:a,vm:await U("vm")}).then(async c=>{await c.evaluate(),t(void 0,c.namespace)}).catch(c=>{t(c instanceof Error?c:new Error(`Script execution error: ${c}`))});i(a,n)}).catch(a=>{t(a)})}:(e,t,r,o)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},br=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,o)=>{Sr(e,(n,s)=>{var i,a;if(n)o(n);else{const c=((i=t==null?void 0:t.attrs)==null?void 0:i.globalName)||`__FEDERATION_${(a=t==null?void 0:t.attrs)==null?void 0:a.name}:custom__`;r(globalThis[c]=s)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},X=new Map,yt=e=>e.startsWith("http:")||e.startsWith("https:"),Et=e=>!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("/")&&!e.includes(":");function wr(e){const t=new URL(e),r=encodeURIComponent(t.protocol.slice(0,-1)),o=encodeURIComponent(t.host),n=t.pathname.split("/").map(i=>encodeURIComponent(i)).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${r}/${o}${n}${s?`/${s}`:""}`}function Ir(e,t){const r=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${wr(e)}`,r).href}async function $r(e){return e.startsWith("node:")?!0:Et(e)?(await U("node:module")).builtinModules.includes(e):!1}function vr(e){const t=e&&(typeof e=="object"||typeof e=="function")?e:{default:e},r={...t};return Object.prototype.hasOwnProperty.call(r,"default")||(r.default=t),r}async function Tr(e,t,r){if(typeof r.SyntheticModule!="function")throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const o=vr(t),n=Object.keys(o),s=new r.SyntheticModule(n,function(){for(const a of n)this.setExport(a,o[a])},{identifier:e});return X.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}async function Nr(e,t){const r=`node-builtin:${e}`;return X.has(r)?X.get(r):Tr(r,await U(e),t)}async function qe(e,t,r){if(await $r(e))return Nr(e,r.vm);if(Et(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 o=new URL(e,t).href;if(!yt(o))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${o}". Only http(s) remote modules and Node.js built-in modules are supported.`);return gt(o,r)}async function Ar(e){if(e.status==="linked"&&await e.evaluate(),e.status==="errored")throw e.error;return e}async function gt(e,t){if(X.has(e))return X.get(e);const{fetch:r,vm:o}=t;if(!yt(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 r(e)).text(),s=(await U("node:url")).pathToFileURL(process.cwd()).href,i=new o.SourceTextModule(n,{identifier:e,initializeImportMeta:a=>{a.url=Ir(e,s)},importModuleDynamically:async a=>Ar(await qe(a,e,t))});return X.set(e,i),await i.link(async a=>qe(a,e,t)),i}const D=dt("[ Module Federation Bridge Vue3 ]"),Mr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,_t=(e,t,r,o)=>{const n=[`${[t[e]]} #${e}`];return r&&n.push(`args: ${JSON.stringify(r)}`),n.push(Mr(e)),o&&n.push(`Original Error Message:
|
|
6
6
|
${o}`),n.join(`
|
|
7
|
-
`)};function Pr(e,t,r,o,n,s){return o(_t(e,t,r,n))}const W="[ Federation Runtime ]",Ce=dt(W);function L(e,t,r,o,n){e||I(t)}function I(e,t,r,o,n){if(t!==void 0)return Pr(e,t,r??{},i=>{throw new Error(`${W}: ${i}`)},o);const s=e;throw s instanceof Error?(s.message.startsWith(W)||(s.message=`${W}: ${s.message}`),s):new Error(`${W}: ${s}`)}function se(e){e instanceof Error&&(e.message.startsWith(W)||(e.message=`${W}: ${e.message}`)),Ce.warn(e)}function kr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ie(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Fe(e){return typeof e.entry<"u"}function Rt(e){return!e.entry.includes(".json")}function xe(e){return e&&typeof e=="object"}const Lr=Object.prototype.toString;function St(e){return Lr.call(e)==="[object Object]"}function bt(e){return Array.isArray(e)?e:[e]}function wt(e){const t={url:"",type:"global",globalName:""};return B||at()||!("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 Or=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},Cr=2e3,T=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return T}})(),we=O;function ye(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function Ee(e,t){return Object.hasOwnProperty.call(e,t)}Ee(T,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ye(T,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const j=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function It(e){var t,r,o,n,s,i,a;Ee(e,"__VMOK__")&&!Ee(e,"__FEDERATION__")&&ye(e,"__FEDERATION__",e.__VMOK__),Ee(e,"__FEDERATION__")||(ye(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),ye(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(o=e.__FEDERATION__).moduleInfo??(o.moduleInfo={}),(n=e.__FEDERATION__).__SHARE__??(n.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map),(a=e.__FEDERATION__).__PRELOADED_ASSETS__??(a.__PRELOADED_ASSETS__=new Set)}It(T);It(O);function Dr(e,t=ke()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.9.0")}function q(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const o of r){const[n,s]=o.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else I(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const ze=()=>O.__FEDERATION__.moduleInfo,Hr=(e,t)=>{const r=q(t,ie(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:o,...n}=e,s=ie(n),i=q(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===o)return i}},ge=e=>Hr(e,O.__FEDERATION__.moduleInfo),Ke=(e,t)=>{const r=ie(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},Fr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),Ge=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:T[r]}},xr=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,Gr=e=>T.__FEDERATION__.__PRELOADED_MAP__.get(e),Ur=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Br=e=>T.__FEDERATION__.__PRELOADED_ASSETS__.has(e),jr=e=>{const t=T.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Cr){const r=t.values().next().value;r!==void 0&&t.delete(r)}},Je="[0-9A-Za-z-]+",Ue=`(?:\\+(${Je}(?:\\.${Je})*))`,ne="0|[1-9]\\d*",_e="[0-9]+",$t="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Ze=`(?:${_e}|${$t})`,Wr=`(?:-?(${Ze}(?:\\.${Ze})*))`,Xe=`(?:${ne}|${$t})`,vt=`(?:-(${Xe}(?:\\.${Xe})*))`,ve=`${ne}|x|X|\\*`,Q=`[v=\\s]*(${ve})(?:\\.(${ve})(?:\\.(${ve})(?:${vt})?${Ue}?)?)?`,Vr=`^\\s*(${Q})\\s+-\\s+(${Q})\\s*$`,qr=`[v=\\s]*${`(${_e})\\.(${_e})\\.(${_e})`}${Wr}?${Ue}?`,Be="((?:<|>)?=?)",zr=`(\\s*)${Be}\\s*(${qr}|${Q})`,Tt="(?:~>?)",Kr=`(\\s*)${Tt}\\s+`,Nt="(?:\\^)",Jr=`(\\s*)${Nt}\\s+`,Zr="(<|>)?=?\\s*\\*",Xr=`^${Nt}${Q}$`,Yr=`v?${`(${ne})\\.(${ne})\\.(${ne})`}${vt}?${Ue}?`,Qr=`^${Tt}${Q}$`,eo=`^${Be}\\s*${Q}$`,to=`^${Be}\\s*(${Yr})$|^$`,ro="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function M(e){return!e||e.toLowerCase()==="x"||e==="*"}function At(...e){return t=>e.reduce((r,o)=>o(r),t)}function Ye(e){return e.match(C(to))}function Qe(e,t,r,o){const n=`${e}.${t}.${r}`;return o?`${n}-${o}`:n}function oo(e){return e.replace(C(Vr),(t,r,o,n,s,i,a,c,l,u,f,d)=>(M(o)?r="":M(n)?r=`>=${o}.0.0`:M(s)?r=`>=${o}.${n}.0`:r=`>=${r}`,M(l)?c="":M(u)?c=`<${Number(l)+1}.0.0-0`:M(f)?c=`<${l}.${Number(u)+1}.0-0`:d?c=`<=${l}.${u}.${f}-${d}`:c=`<=${c}`,`${r} ${c}`.trim()))}function no(e){return e.replace(C(zr),"$1$2$3")}function so(e){return e.replace(C(Kr),"$1~")}function io(e){return e.replace(C(Jr),"$1^")}function ao(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Xr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:i?o==="0"?n==="0"?`>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s}-${i} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${s} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${Number(o)+1}.0.0-0`)).join(" ")}function co(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Qr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:i?`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`)).join(" ")}function lo(e){return e.split(/\s+/).map(t=>t.trim().replace(C(eo),(r,o,n,s,i,a)=>{const c=M(n),l=c||M(s),u=l||M(i);return o==="="&&u&&(o=""),a="",c?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(l&&(s=0),i=0,o===">"?(o=">=",l?(n=Number(n)+1,s=0,i=0):(s=Number(s)+1,i=0)):o==="<="&&(o="<",l?n=Number(n)+1:s=Number(s)+1),o==="<"&&(a="-0"),`${o+n}.${s}.${i}${a}`):l?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:u?`>=${n}.${s}.0${a} <${n}.${Number(s)+1}.0-0`:r})).join(" ")}function uo(e){return e.trim().replace(C(Zr),"")}function fo(e){return e.trim().replace(C(ro),"")}function Re(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function ho(e,t){const{preRelease:r}=e,{preRelease:o}=t;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let n=0,s=r.length;n<=s;n++){const i=r[n],a=o[n];if(i!==a)return i===void 0&&a===void 0?0:i?a?Re(i,a):-1:1}return 0}function fe(e,t){return Re(e.major,t.major)||Re(e.minor,t.minor)||Re(e.patch,t.patch)||ho(e,t)}function Te(e,t){return e.version===t.version}function mo(e,t){switch(e.operator){case"":case"=":return Te(e,t);case">":return fe(e,t)<0;case">=":return Te(e,t)||fe(e,t)<0;case"<":return fe(e,t)>0;case"<=":return Te(e,t)||fe(e,t)>0;case void 0:return!0;default:return!1}}function po(e){return At(ao,co,lo,uo)(e)}function yo(e){return At(oo,no,so,io)(e.trim()).split(/\s+/).join(" ")}function oe(e,t){if(!e)return!1;const r=Ye(e);if(!r)return!1;const[,o,,n,s,i,a]=r,c={operator:o,version:Qe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const u of l){const f=u.trim();if(!f||f==="*"||f==="x")return!0;try{const d=yo(f);if(!d.trim())return!0;const m=d.split(" ").map(y=>po(y)).join(" ");if(!m.trim())return!0;const h=m.split(/\s+/).map(y=>fo(y)).filter(Boolean);if(h.length===0)continue;let p=!0;for(const y of h){const g=Ye(y);if(!g){p=!1;break}const[,_,,E,R,S,b]=g;if(!mo({operator:_,version:Qe(E,R,S,b),major:E,minor:R,patch:S,preRelease:b==null?void 0:b.split(".")},c)){p=!1;break}}if(p)return!0}catch(d){console.error(`[semver] Error processing range part "${f}":`,d);continue}}return!1}const le="default",Mt="global";function Eo(e,t,r,o){var s,i;let n;return"get"in e?n=e.get:"lib"in e?n=()=>Promise.resolve(e.lib):n=()=>Promise.resolve(()=>{I(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode)&&I(`Invalid shared config for "${r}" 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:n,loaded:e!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Pe.UNKNOWN,useIn:[]}:void 0}}function Pt(e,t){const r=t.shared||{},o=t.name,n=Object.keys(r).reduce((i,a)=>{const c=bt(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(Eo(l,o,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(n).forEach(i=>{s[i]?n[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=n[i]}),{allShareInfos:s,newShareInfos:n}}function ae(e,t){if(!e)return!1;const{status:r,mode:o}=e;return r===Pe.NO_USE?!1:r===Pe.CALCULATED?!0:o==="runtime-infer"?t?_o(e,t):!0:!1}function V(e,t){const r=o=>{if(!Number.isNaN(Number(o))){const n=o.split(".");let s=o;for(let i=0;i<3-n.length;i++)s+=".0";return s}return o};return!!oe(r(e),`<=${r(t)}`)}const ce=(e,t)=>{const r=t||function(o,n){return V(o,n)};return Object.keys(e).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},be=e=>!!e.loaded||typeof e.lib=="function",go=e=>!!e.loading,_o=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(o=>r.includes(o)):!1};function Ro(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){return i?n[c].treeShaking?n[l].treeShaking?!be(n[c].treeShaking)&&V(c,l):!1:!0:!be(n[c])&&V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}const K=e=>be(e)||go(e);function So(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){if(i){if(!n[c].treeShaking)return!0;if(!n[l].treeShaking)return!1;if(K(n[l].treeShaking))return K(n[c].treeShaking)?!!V(c,l):!0;if(K(n[c].treeShaking))return!1}return K(n[l])?K(n[c])?!!V(c,l):!0:K(n[c])?!1:V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}function bo(e){return e==="loaded-first"?So:Ro}function Se(e,t,r,o,n){if(!e)return;const{shareConfig:s,scope:i=le,strategy:a,treeShaking:c}=r,l=Array.isArray(i)?i:[i];for(const u of l)if(s&&e[u]&&e[u][t]){const{requiredVersion:f}=s,{version:d,useTreesShaking:m}=bo(a)(e,u,t,c),h=()=>{const y=e[u][t][d];if(s.singleton){if(typeof f=="string"&&!oe(d,f)){const g=`Version ${d} from ${d&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;s.strictVersion?I(g):se(g)}return{shared:y,useTreesShaking:m}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:m};if(oe(d,f))return{shared:y,useTreesShaking:m};const g=ae(c);if(g){for(const[_,E]of Object.entries(e[u][t]))if(ae(E.treeShaking,c==null?void 0:c.usedExports)&&oe(_,f))return{shared:E,useTreesShaking:g}}for(const[_,E]of Object.entries(e[u][t]))if(oe(_,f))return{shared:E,useTreesShaking:!1}}},p={shareScopeMap:e,scope:u,pkgName:t,version:d,GlobalFederation:we.__FEDERATION__,shareInfo:r,resolver:h,loadContext:n};return(o.emit(p)||p).resolver()}}function kt(){return we.__FEDERATION__.__SHARE__}function et(e){const{pkgName:t,extraOptions:r,shareInfos:o}=e,n=c=>{if(!c)return;const l={};return c.forEach(f=>{l[f.version]=f}),l[ce(l,function(f,d){return!be(l[f])&&V(f,d)})]},s=(r==null?void 0:r.resolver)??n,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const u of c)if(u)for(const[f,d]of Object.entries(u)){const m=l[f];i(m)&&i(d)?l[f]=a(m,d):d!==void 0&&(l[f]=d)}return l};return a(s(o[t]),r==null?void 0:r.customShareInfo)}const J=(e,t)=>{e.useIn||(e.useIn=[]),kr(e.useIn,t)};function he(e,t){return t&&e.treeShaking?e.treeShaking:e}function je(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function tt(e,t){for(const r of e){const o=t.startsWith(r.name);let n=t.replace(r.name,"");if(o){if(n.startsWith("/")){const a=r.name;return n=`.${n}`,{pkgNameOrAlias:a,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let i=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function wo(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Lt="RUNTIME-001",Ot="RUNTIME-002",Ct="RUNTIME-003",Dt="RUNTIME-004",Ht="RUNTIME-005",De="RUNTIME-006",Ft="RUNTIME-007",Ie="RUNTIME-008",Io="RUNTIME-009",xt="RUNTIME-010",Gt="RUNTIME-011",$o="RUNTIME-012",Ut="RUNTIME-013",Bt="RUNTIME-014",jt="RUNTIME-015",P={[Lt]:"Failed to get remoteEntry exports.",[Ot]:'The remote entry interface does not contain "init"',[Ct]:"Failed to get manifest.",[Dt]:"Failed to locate remote.",[Ht]:"Invalid loadShareSync function call from bundler runtime",[De]:"Invalid loadShareSync function call from runtime",[Ft]:"Failed to get remote snapshot.",[Ie]:"Failed to load script resources.",[Io]:"Please call createInstance first.",[xt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Gt]:"The remoteEntry URL is missing from the remote snapshot.",[$o]:'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.',[Ut]:"The manifest is not a valid Module Federation manifest.",[Bt]:"The remote does not expose the requested module.",[jt]:"Remote container initialization failed."};({...P});const Wt=".then(callbacks[0]).catch(callbacks[1])",rt=new WeakMap,vo=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function To(e){return e instanceof TypeError?vo.some(t=>e.message.includes(t)):!1}function Vt(e){return e==="esm"||e==="module"}async function No({entry:e,remoteEntryExports:t,name:r,getEntryUrl:o}){return new Promise((n,s)=>{const i=c=>{if(To(c)){const l=c instanceof Error?c.message:String(c);try{I(Ie,P,{remoteName:r,resourceUrl:a},l)}catch(u){s(u);return}}s(c)},a=o?o(e):e;try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${a}")${Wt}`)([n,i]):import(a).then(n).catch(i)}catch(c){I(`Failed to load ESM entry from "${a}". ${c instanceof Error?c.message:String(c)}`)}})}async function Ao({entry:e,remoteEntryExports:t}){return new Promise((r,o)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(o):new Function("callbacks",`System.import("${e}")${Wt}`)([r,o])}catch(n){I(`Failed to load SystemJS entry from "${e}". ${n instanceof Error?n.message:String(n)}`)}})}function qt(e,t,r){const{remoteEntryKey:o,entryExports:n}=Ge(e,t);return n||I(Lt,P,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:o}),n}async function Mo({name:e,globalName:t,entry:r,remoteInfo:o,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=Ge(e,t);if(a)return a;const c=s?s(r):r;return _r(c,{attrs:{},createScriptHook:(l,u)=>{const f=n.lifecycle.createScript.emit({url:l,attrs:u,remoteInfo:o,resourceContext:i?{...i,url:l}:void 0});if(f&&(f instanceof HTMLScriptElement||"script"in f||"timeout"in f))return f}}).then(()=>qt(e,t,r),l=>{const u=l instanceof Error?l.message:String(l);I(Ie,P,{remoteName:e,resourceUrl:c},u)})}async function Po({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:o,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return Vt(c)?No({entry:s,remoteEntryExports:t,name:a,getEntryUrl:o}):c==="system"?Ao({entry:s,remoteEntryExports:t}):Mo({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:r,getEntryUrl:o,resourceContext:n})}async function ko({remoteInfo:e,loaderHook:t,resourceContext:r}){const{entry:o,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=Ge(s,n);return a||br(o,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(c,l={})=>{const u=t.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:e,resourceContext:r?{...r,url:c}:void 0});if(u&&"url"in u)return u}}}).then(()=>qt(s,n,o)).catch(c=>{I(`Failed to load Node.js entry for remote "${s}" from "${o}". ${c instanceof Error?c.message:String(c)}`)})}function zt(e){const{entry:t,name:r}=e;return ct(r,t)}async function We(e){const{origin:t,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=zt(o);if(r)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:r,resourceContext:s,cached:!0}),r;if(!j[a]){const l=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook;j[a]=l.emit({origin:t,loaderHook:u,remoteInfo:o,remoteEntryExports:r,resourceContext:s}).then(f=>f||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":B)?Po({remoteInfo:o,remoteEntryExports:r,loaderHook:u,getEntryUrl:n,resourceContext:s}):ko({remoteInfo:o,loaderHook:u,resourceContext:s}))).then(async f=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:f,resourceContext:s}),f)).catch(async f=>{const d=f instanceof Error&&f.message.includes("ScriptExecutionError");if(f instanceof Error&&f.message.includes(Ie)&&!d&&!i){const m=p=>We({...p,_inErrorHandling:!0}),h=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:m,origin:t,remoteInfo:o,remoteEntryExports:r,globalLoading:j,uniqueKey:a});if(h)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:h,resourceContext:s,error:f,recovered:!0}),h}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:f}),f}),rt.set(j[a],t)}const c=j[a];if(rt.get(c)!==t)try{const l=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:l,resourceContext:s}),l}catch(l){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:l}),l}return c}function Z(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||Mt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||le}}function Lo(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Oo(e){const t=new Map;return[...e||[],...xr()].forEach(r=>{r&&(L(St(r),"Plugin configuration is invalid."),L(r.name,"A name must be provided by the plugin."),t.has(r.name)||t.set(r.name,r))}),Array.from(t.values())}function Co(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Do(e,t){const r=new Map;t.options.plugins.forEach(n=>{n&&r.set(n.name,n)});const o=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Oo(e).forEach(n=>{var i;if(r.set(n.name,n),t.hooks.registerPlugins[n.name])return;const s=Co(n,(i=n.apply)==null?void 0:i.call(n,t));o.forEach(a=>{a.applyPlugin(s)})}),Array.from(r.values())}function Ho(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 H(e){var r,o,n,s,i,a;const t={};for(const[c,l]of Object.entries(e.shared)){const u=l[0];u&&(t[c]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((o=u.shareConfig)==null?void 0:o.requiredVersion)===!1?!1:(n=u.shareConfig)==null?void 0:n.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((i=e.remotes)==null?void 0:i.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((a=e.remotes)==null?void 0:a.map(Ho))??[],shared:t}}}function Kt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function Fo(e,t){return t.map(r=>{const o=wo(e,r.nameOrAlias);return L(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&ut({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Kt(r)}})}function xo(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Ve(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function U(e,t,r,o){return{url:t,status:r,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:o}}function Ne(e,t,r,o){return r?Br(t)?Promise.resolve(U(e,t,"cached")):(jr(t),o()):o()}async function Go(e,t,r,o){const n=e.moduleCache.get(r.name),s=r.entry;if(n!=null&&n.remoteEntryExports)return U(o,s,"cached");try{if(!await We({origin:e,remoteInfo:r,remoteEntryExports:n==null?void 0:n.remoteEntryExports,resourceContext:{...o,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return U(o,s,"success")}catch(i){return U(o,s,Ve(i)?"timeout":"error",i)}}function de({host:e,remoteInfo:t,url:r,attrs:o,context:n,needDeleteLink:s}){return new Promise(i=>{const{link:a,needAttach:c}=gr({url:r,cb:()=>{i(U(n,r,c?"success":"cached"))},onErrorCallback:l=>{i(U(n,r,Ve(l)?"timeout":"error",l))},attrs:o,createLinkHook:(l,u)=>{const f=e.loaderHook.lifecycle.createLink.emit({url:l,attrs:u,remoteInfo:t,resourceContext:{...n,url:l}});return f instanceof HTMLLinkElement,f},needDeleteLink:s});c&&document.head.appendChild(a)})}function Uo({host:e,remoteInfo:t,url:r,attrs:o,context:n}){return new Promise(s=>{const{script:i,needAttach:a}=pt({url:r,cb:()=>{s(U(n,r,a?"success":"cached"))},onErrorCallback:c=>{s(U(n,r,Ve(c)?"timeout":"error",c))},attrs:o,createScriptHook:(c,l)=>{const u=e.loaderHook.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:t,resourceContext:{...n,url:c}});return u instanceof HTMLScriptElement,u},needDeleteScript:!0});a&&document.head.appendChild(i)})}function me(e,t){return{...e,resourceType:t}}function Jt(e,t,r,o=!0,n={initiator:"preloadRemote",id:e.name},s=!0){const{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:c}=r,l=[];if(t.options.inBrowser){if(c.forEach(d=>{const{moduleInfo:m}=d;l.push(Go(t,e,m,me(n,"remoteEntry")))}),o){const d={rel:"preload",as:"style"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:d,context:h})))})}else{const d={rel:"stylesheet",type:"text/css"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:d,needDeleteLink:!1,context:h})))})}let u=Uo,f={fetchpriority:"high",type:"text/javascript"};o?(u=de,f={rel:"preload",as:"script"}):Vt(e.type)&&(u=de,f={rel:"modulepreload",fetchpriority:"high"}),a.forEach(d=>{const m=me(n,"js");l.push(Ne(m,d,s,()=>u({host:t,remoteInfo:e,url:d,attrs:f,context:m})))})}return Promise.all(l)}function Bo(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(r=>r.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function jo(e,t,r){const o=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach(i=>{o[i]||(o[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:o[n[0]],initScope:r??[]}}var ot=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,t){const r=t||{initiator:"loadRemote",id:je(this.remoteInfo.name,e),resourceType:"remoteEntry",url:this.remoteInfo.entry,expose:e},o=await We({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:r});return L(o,`remoteEntryExports is undefined
|
|
8
|
-
${ut(this.remoteInfo)}`),this.remoteEntryExports=o,this.remoteEntryExports}async init(e,t,r,o,n){const s=await this.getEntry(o,n);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,cached:!0,origin:this.host}),i}return s}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:i,shareScope:a,initScope:c}=jo(this.remoteInfo,this.host.shareScopeMap,r),l=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:i,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});typeof(s==null?void 0:s.init)>"u"&&I(Ot,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,H(this.host.options));try{await s.init(l.shareScope,l.initScope,l.remoteEntryInitOptions)}catch(u){I(jt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,H(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...l,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,origin:this.host}),i}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,r,o){const{loadFactory:n=!0}=r||{loadFactory:!0},s=await this.init(e,o,void 0,t);this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});let i;try{const l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i=typeof l=="function"?l:void 0,i||(i=await s.get(t)),i||I(Bt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bo(o)},void 0,H(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(l){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:l,origin:this.host}),l}const a=Or(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 l=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:l,origin:this.host}),l}catch(l){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:l,origin:this.host}),l}}wraperFactory(e,t){function r(o,n){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return()=>{const o=e();return o instanceof Promise?o.then(n=>(r(n,t),n)):(r(o,t),o)}}},F=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){L(St(e),"Plugin configuration is invalid.");const t=e.name;L(t,"A name must be provided by the plugin."),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(r=>{const o=e[r];o&&this.lifecycle[r].on(o)}))}removePlugin(e){L(e,"A name is required.");const t=this.registerPlugins[e];L(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(r=>{const o=t[r];o&&this.lifecycle[r].remove(o)}),delete this.registerPlugins[e]}},A=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...o){return t.remove(r),e.apply(null,o)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{const o=r(...e);o!==void 0&&(t=o)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},v=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=s=>s===!1?!1:o<r.length?Promise.resolve(r[o++].apply(null,e)).then(i=>i===void 0||e.length===1&&i===e[0]?n(s):n(i)):s;t=n()}return Promise.resolve(t)}};function Zt(e,t){if(!xe(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var Y=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(r===void 0)continue;if(Zt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){se(r),this.onerror(r)}return e}},x=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let r=0;const o=s=>(se(s),this.onerror(s),e),n=s=>{if(s!==void 0&&Zt(e,s))e=s;else if(s!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(r<t.length)try{return Promise.resolve(t[r++](e)).then(n,o)}catch(i){return o(i)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const re="Remote loading is disabled by experiments.optimization.disableRemote.";var Wo=class{constructor(){this.hooks=new F({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(re)}preloadRemote(){throw new Error(re)}registerRemotes(){throw new Error(re)}getRemoteModuleAndOptions(){throw new Error(re)}initRawContainer(){throw new Error(re)}};function Xt(e,t){const r=wt(t);r.url||I(Gt,P,{remoteName:e.name});let o=Le(t,r.url);!B&&!o.startsWith("http")&&(o=`https:${o}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=o,e.version=t.version,e.buildVersion=t.buildVersion}function Vo(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:s,id:i}=e;if(!Fe(t)||!Rt(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:je(t.name,o)});Xt(s,a);const l=[{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await n.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:n.options,origin:n});const[u]=l;if(u){const f={remote:t,preloadConfig:u},d=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:f,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});d&&Jt(s,n,d,!1,{initiator:"loadRemote",id:i},u.recordPreloadedAssets).catch(()=>{})}return{...e,remoteSnapshot:a}}return e}}}function qo(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function Yt(e,t,r,o,n={},s){const{value:i}=q(e,ie(t)),a=s||i;if(a&&!ft(a)&&(r(a,t,o),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(n[l])continue;n[l]=!0;const u=qo(l),f=a.remotesInfo[l];Yt(e,{name:u.name,version:f.matchedVersion},r,!1,n,void 0)}}}const Ae=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function zo(e,t,r,o,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:d}=f;if(Yt(o,r,(h,p,y)=>{var b;let g;if(y)g=f;else if(Array.isArray(d)){const $=d.find(w=>w.nameOrAlias===p.name||w.nameOrAlias===p.alias);if(!$)return;g=Kt($)}else if(d===!0)g=f;else return;const _=Le(h,wt(h).url);_&&a.push({name:p.name,moduleInfo:{name:p.name,entry:_,type:"remoteEntryType"in h?h.remoteEntryType:"global",entryGlobalName:"globalName"in h?h.globalName:p.name,shareScope:"",version:"version"in h?h.version:void 0},url:_});let E="modules"in h?h.modules:[];const R=xo(g.exposes);R.length&&"modules"in h&&(E=(b=h==null?void 0:h.modules)==null?void 0:b.reduce(($,w)=>((R==null?void 0:R.indexOf(w.moduleName))!==-1&&$.push(w),$),[]));function S($){const w=$.map(k=>Le(h,k));return g.filter?w.filter(g.filter):w}if(E){const $=E.length;for(let w=0;w<$;w++){const k=E[w],z=`${p.name}/${k.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:k.moduleName==="."?p.name:z,name:p.name,remoteSnapshot:h,preloadConfig:g,remote:p,origin:e}),!Gr(z)&&(g.resourceCategory==="all"?(s.push(...S(k.assets.css.async)),s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.async)),i.push(...S(k.assets.js.sync))):g.resourceCategory==="sync"&&(s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.sync))),Ur(z))}}},!0,{},n),n.shared&&n.shared.length>0){const h=(p,y)=>{const{shared:g}=Se(e.shareScopeMap,y.sharedName,p,e.sharedHandler.hooks.lifecycle.resolveShare)||{};g&&typeof g.lib=="function"&&(y.assets.js.sync.forEach(_=>{c.add(_)}),y.assets.css.sync.forEach(_=>{l.add(_)}))};n.shared.forEach(p=>{var _;const y=(_=u.shared)==null?void 0:_[p.sharedName];if(!y)return;const g=p.version?y.find(E=>E.version===p.version):y;g&&bt(g).forEach(E=>{h(E,p)})})}const m=i.filter(h=>!c.has(h)&&!Ae("script",h));return{cssAssets:s.filter(h=>!l.has(h)&&!Ae("link",h)),jsAssetsWithoutEntry:m,entryAssets:a.filter(h=>!Ae("script",h.url))}}const Ko=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return B?Fe(n)&&Rt(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Xt(o,i),zo(t,r,o,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Qt(e,t){const r=ge({name:t.name,version:t.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&q(r.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:"version"in e?e.version:void 0})}}var Jo=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new F({beforeLoadRemoteSnapshot:new v("beforeLoadRemoteSnapshot"),loadSnapshot:new x("loadGlobalSnapshot"),loadRemoteSnapshot:new x("loadRemoteSnapshot"),afterLoadSnapshot:new x("afterLoadSnapshot"),beforeLoadManifest:new v("beforeLoadManifest"),afterLoadManifest:new v("afterLoadManifest")}),this.manifestLoading=we.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:r="loadRemote"}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e,origin:this.HostInstance});let n=ge({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Fr({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!q(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n==null?void 0:n.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,f;if(c)if(ft(c)){const d=B?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",m=await this.loadManifestSnapshot(d,e,{},{initiator:r,id:t||e.name}),h=Ke({...e,entry:d},m);u=m,f=h}else{const{remoteSnapshot:d}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=d,f=l}else if(Fe(e)){const d=await this.loadManifestSnapshot(e.entry,e,{},{initiator:r,id:t||e.name}),m=Ke(e,d);u=d,f=m}else I(Ft,P,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,H(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:f}}getGlobalRemoteInfo(e){return Qt(e,this.HostInstance)}async getManifestJson(e,t,r,o){return(async()=>{const s=Z(t);let i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,origin:this.HostInstance});let a,c,l=!1;try{let d=await this.loaderHook.lifecycle.fetch.emit(e,{},s,o?{...o,url:e,resourceType:"manifest"}:void 0);(!d||!(d instanceof Response))&&(d=await fetch(e,{})),a=d,i=await d.json()}catch(d){c=d,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:d,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,response:a,error:d,origin:this.HostInstance}),I(Ct,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${d}`,H(this.HostInstance.options))),l=!0}const u=[!i.metaData&&"metaData",!i.exposes&&"exposes",!i.shared&&"shared"].filter(Boolean),f=u.length>0?new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${u.join(", ")}.`):void 0;return f&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,response:a,error:f||c,recovered:f?void 0:l||void 0,origin:this.HostInstance}),f&&I(Ut,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:u.join(",")},void 0,H(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,r,o){const n=async()=>{const s=await this.getManifestJson(e,t,r,o),i=dr(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=n().then(s=>s)),this.manifestLoading[e]}},Zo=class{constructor(){this.hooks=new F({})}},Xo=class{constructor(e){this.hooks=new F({beforeRegisterShare:new Y("beforeRegisterShare"),afterRegisterShare:new A("afterRegisterShare"),afterResolve:new x("afterResolve"),beforeLoadShare:new x("beforeLoadShare"),loadShare:new v,afterLoadShare:new A("afterLoadShare"),errorLoadShare:new A("errorLoadShare"),resolveShare:new Y("resolveShare"),initContainerShareScopeMap:new Y("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:r,selectedShared:o,loadContext:n}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:r,selectedShared:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:n,origin:this.host})}catch(s){se(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:r,error:o,recovered:n,loadContext:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:o,recovered:n,loadContext:s})}catch(i){se(i)}}registerShared(e,t){const{newShareInfos:r,allShareInfos:o}=Pt(e,t);return Object.keys(r).forEach(n=>{r[n].forEach(s=>{s.scope.forEach(i=>{var l,u,f;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:n,shared:s});const a=(l=this.shareScopeMap[i])==null?void 0:l[n],c=a==null?void 0:a[s.version];a||this.setShared({pkgName:n,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name}),this.emitAfterRegisterShare(n,{scope:i,shared:s,previousShared:c,registeredShared:(f=(u=this.shareScopeMap[i])==null?void 0:u[n])==null?void 0:f[s.version],trigger:"runtime"})})})}),{newShareInfos:r,allShareInfos:o}}async loadShare(e,t){const{host:r}=this;let o=t==null?void 0:t.context;const n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});let s=n;try{n!=null&&n.scope&&await Promise.all(n.scope.map(async u=>{await Promise.all(this.initializeSharing(u,{strategy:n.strategy,context:o}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r,loadContext:o});s=i.shareInfo,o=i.loadContext||o,L(s,`Cannot find shared "${e}" in host "${r.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 a=s,{shared:c,useTreesShaking:l}=Se(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,o)||{};if(c){const u=he(c,l);if(u.lib)return J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),u.lib;if(u.loading&&!u.loaded){const f=await u.loading;return u.loaded=!0,u.lib||(u.lib=f),J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),f}else{const d=(async()=>{const h=await u.get();return J(u,r.options.name),u.loaded=!0,u.lib=h,h})();this.setShared({pkgName:e,loaded:!1,shared:c,from:r.options.name,lib:null,loading:d,treeShaking:l?u:void 0});const m=await d;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),m}}else{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,recovered:!0,loadContext:o}),!1;const u=ae(a.treeShaking),f=he(a,u),m=(async()=>{const p=await f.get();f.lib=p,f.loaded=!0,J(f,r.options.name);const{shared:y,useTreesShaking:g}=Se(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,o)||{};if(y){const _=he(y,g);_.lib=p,_.loaded=!0,y.from=a.from}return p})();this.setShared({pkgName:e,loaded:!1,shared:a,from:r.options.name,lib:null,loading:m,treeShaking:u?f:void 0});const h=await m;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:a,loadContext:o}),h}}catch(i){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:i,loadContext:o}),i}}initializeSharing(e=le,t){var m;const{host:r}=this,o=t==null?void 0:t.from,n=t==null?void 0:t.strategy,s=((m=t==null?void 0:t.context)==null?void 0:m.trigger)||o||"runtime";let i=t==null?void 0:t.initScope;const a=[];if(o!=="build"){const{initTokens:h}=this;i||(i=[]);let p=h[e];if(p||(p=h[e]={from:this.host.name}),i.indexOf(p)>=0)return a;i.push(p)}const c=this.shareScopeMap,l=r.options.name;c[e]||(c[e]={});const u=c[e],f=(h,p)=>{var b;const{version:y,eager:g}=p;u[h]=u[h]||{};const _=u[h],E=_[y],R=E&&he(E),S=!!(R&&("eager"in R&&R.eager||"shareConfig"in R&&((b=R.shareConfig)!=null&&b.eager)));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!g!=!S?g:l>_[y].from))&&(_[y]=p),this.emitAfterRegisterShare(h,{scope:e,shared:p,previousShared:E,registeredShared:_[y],trigger:s})},d=async h=>{const{module:p}=await r.remoteHandler.getRemoteModuleAndOptions({id:h});let y;const g={initiator:"loadShare",id:h,resourceType:"remoteEntry",url:p.remoteInfo.entry};try{y=await p.getEntry(void 0,g)}catch(_){if(y=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:h,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:p.remoteInfo,origin:r}),!y)return}finally{y!=null&&y.init&&!p.initing&&(p.remoteEntryExports=y,await p.init(void 0,void 0,i,void 0,g))}};return Object.keys(r.options.shared).forEach(h=>{r.options.shared[h].forEach(p=>{p.scope.includes(e)&&f(h,p)})}),(r.options.shareStrategy==="version-first"||n==="version-first")&&r.options.remotes.forEach(h=>{h.shareScope===e&&a.push(d(h.name))}),a}loadShareSync(e,t){const{host:r}=this,o=t==null?void 0:t.context,n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});try{n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy,from:t==null?void 0:t.from,context:o})});const{shared:s}=Se(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare,o)||{};if(s){if(typeof s.lib=="function")return J(s,r.options.name),s.loaded||(s.loaded=!0,s.from===r.options.name&&(n.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),s.lib;if(typeof s.get=="function"){const i=s.get();if(!(i instanceof Promise))return J(s,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&I((t==null?void 0:t.from)==="build"?Ht:De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib}I(De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,error:s,loadContext:o}),s}}initShareScopeMap(e,t,r={}){const{host:o}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:o.options,origin:o,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:o,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,f=Array.isArray(l)?l:[l],d=m=>{const h=(y,g,_)=>{_&&!y[g]&&(y[g]=_)},p=a?m.treeShaking:m;h(p,"loaded",s),h(p,"loading",n),h(p,"get",i),h(p,"lib",o)};f.forEach(m=>{this.shareScopeMap[m]||(this.shareScopeMap[m]={}),this.shareScopeMap[m][e]||(this.shareScopeMap[m][e]={}),this.shareScopeMap[m][e][c]||(this.shareScopeMap[m][e][c]={version:c,scope:[m],...u,lib:o});const h=this.shareScopeMap[m][e][c];d(h),r&&h.from!==r&&(h.from=r)})}_setGlobalShareScopeMap(e){const t=kt(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},Yo=class{constructor(){this.shareScopeMap={},this.hooks=new F({afterResolve:new x("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}},Qo=class{constructor(e){this.hooks=new F({beforeRegisterRemote:new Y("beforeRegisterRemote"),registerRemote:new Y("registerRemote"),beforeRequest:new x("beforeRequest"),afterMatchRemote:new v("afterMatchRemote"),onLoad:new v("onLoad"),afterLoadRemote:new v("afterLoadRemote"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new v("errorLoadRemote"),beforePreloadRemote:new v("beforePreloadRemote"),generatePreloadAssets:new v("generatePreloadAssets"),afterPreloadRemote:new v("afterPreloadRemote"),loadEntry:new v}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,o)=>(this.registerRemote(o,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:o}=t,{name:n,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:o},s&&e.startsWith(n)){const i=e.replace(n,s);this.idToRemoteMap[i]={name:r.name,expose:o};return}if(s&&e.startsWith(s)){const i=e.replace(s,n);this.idToRemoteMap[i]={name:r.name,expose:o}}}async loadRemote(e,t){const{host:r}=this,o=tt(r.options.remotes,e);let n=e,s=o==null?void 0:o.expose,i=o?Z(o.remote):void 0,a;try{const{loadFactory:c=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:m,expose:h,id:p,remoteSnapshot:y}=f;n=p,s=h,i=Z(m);const g=await l.get(p,h,t,y),_=await this.hooks.lifecycle.onLoad.emit({id:p,pkgNameOrAlias:d,expose:h,exposeModule:c?g:void 0,exposeModuleFactory:c?void 0:g,remote:m,options:u,moduleInstance:l,origin:r});return this.setIdToRemoteMap(e,f),a={id:n,expose:s,remote:i,options:t,origin:r},typeof _=="function"?_:g}catch(c){const{from:l="runtime"}=t||{from:"runtime"};let u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:l,lifecycle:"onLoad",expose:s,remote:i,origin:r})}catch(f){throw a={id:n,expose:s,remote:i,options:t,error:f,origin:r},f}if(!u)throw a={id:n,expose:s,remote:i,options:t,error:c,origin:r},c;return a={id:n,expose:s,remote:i,options:t,error:c,origin:r,recovered:!0},u}finally{a&&await this.hooks.lifecycle.afterLoadRemote.emit(a)}}async preloadRemote(e){const{host:t}=this,r=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const o=Fo(t.options.remotes,e),n=a=>{const{preloadConfig:c,remote:l}=a,u=c.exposes||[];return u.length?u.map(f=>({ops:{...a,preloadConfig:{...c,exposes:[f]}},id:je(l.name,f)})):[{ops:a,id:`${l.name}/*`}]};let s;await Promise.all(o.flatMap(n).map(async a=>{const{ops:c,id:l}=a,{remote:u,preloadConfig:f}=c,d=Z(u);try{const{globalSnapshot:m,remoteSnapshot:h}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:u,id:l,initiator:"preloadRemote"}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:c,remote:u,remoteInfo:d,globalSnapshot:m,remoteSnapshot:h});if(!p)return;const y=await Jt(d,t,p,!0,{initiator:"preloadRemote",id:l},f.recordPreloadedAssets);r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:y})}catch(m){r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:[{url:d.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(d.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:l,error:m}]})}}));const i=r.flatMap(a=>a.results.filter(c=>c.status==="error"||c.status==="timeout"));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:r,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:r,error:s}),s)throw s}registerRemotes(e,t){const{host:r}=this;e.forEach(o=>{this.registerRemote(o,r.options.remotes,{force:t==null?void 0:t.force})})}initRawContainer(e,t,r){const{host:o}=this,n=new ot({host:o,remoteInfo:Z({name:e,entry:t})});return n.remoteEntryExports=r,o.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(m){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:m,lifecycle:"beforeRequest"}),!o)throw m}const{id:n}=o,s=tt(t.options.remotes,n);if(!s)try{I(Dt,P,{hostName:t.options.name,requestId:n},void 0,H(t.options))}catch(m){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:m,origin:t}),m}const{remote:i}=s,a=Z(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:u}=c;L(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let f=t.moduleCache.get(l.name);const d={host:t,remoteInfo:a};return f||(f=new ot(d),t.moduleCache.set(l.name,f)),{module:f,moduleOptions:d,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:o}=this,n=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});L(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&&B&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=le),e.type||(e.type=Mt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=t.find(i=>i.name===e.name);if(!s)n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),lt(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:o}=e,n=r.options.remotes.findIndex(c=>c.name===o);n!==-1&&r.options.remotes.splice(n,1);const s=q(T.__FEDERATION__.moduleInfo,ie(e)).key;delete T.__FEDERATION__.moduleInfo[s],"entry"in e&&(r.snapshotHandler.manifestCache.delete(e.entry),delete we.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:i}=Qt(e,r);if(i){const c=i&&"remotesInfo"in i&&i.remotesInfo&&q(i.remotesInfo,e.name).key;c&&delete i.remotesInfo[c]}const a=r.moduleCache.get(e.name);if(a){const c=a.remoteInfo,l=c.entryGlobalName;T[l]&&((t=Object.getOwnPropertyDescriptor(T,l))!=null&&t.configurable?delete T[l]:T[l]=void 0);const u=zt(a.remoteInfo);j[u]&&delete j[u];let f=c.buildVersion?ct(c.name,c.buildVersion):c.name;const d=T.__FEDERATION__.__INSTANCES__.findIndex(m=>c.buildVersion?m.options.id===f:m.name===f);if(d!==-1){const m=T.__FEDERATION__.__INSTANCES__[d];f=m.options.id||f;const h=kt();let p=!0;const y=[];Object.keys(h).forEach(g=>{const _=h[g];_&&Object.keys(_).forEach(E=>{const R=_[E];R&&Object.keys(R).forEach(S=>{const b=R[S];b&&Object.keys(b).forEach($=>{const w=b[$];w&&typeof w=="object"&&w.from===c.name&&(w.loaded||w.loading?(w.useIn=w.useIn.filter(k=>k!==c.name),w.useIn.length?p=!1:y.push([g,E,S,$])):y.push([g,E,S,$]))})})})}),p&&(m.shareScopeMap={},delete h[f]),y.forEach(([g,_,E,R])=>{var S,b,$;($=(b=(S=h[g])==null?void 0:S[_])==null?void 0:b[E])==null||delete $[R]}),T.__FEDERATION__.__INSTANCES__.splice(d,1)}r.moduleCache.delete(e.name)}}catch(r){Ce.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const en=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Me=typeof FEDERATION_OPTIMIZE_NO_REMOTE=="boolean"?!FEDERATION_OPTIMIZE_NO_REMOTE:!0,nt=typeof FEDERATION_OPTIMIZE_NO_SHARED=="boolean"?!FEDERATION_OPTIMIZE_NO_SHARED:!0;var tn=class{constructor(e){this.hooks=new F({beforeInit:new Y("beforeInit"),init:new A,beforeInitContainer:new x("beforeInitContainer"),initContainer:new x("initContainer")}),this.version="2.9.0",this.moduleCache=new Map,this.loaderHook=new F({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new v,loadEntryError:new v,afterLoadEntry:new v("afterLoadEntry"),beforeInitRemote:new v("beforeInitRemote"),afterInitRemote:new v("afterInitRemote"),beforeGetExpose:new v("beforeGetExpose"),afterGetExpose:new v("afterGetExpose"),beforeExecuteFactory:new v("beforeExecuteFactory"),afterExecuteFactory:new v("afterExecuteFactory"),getModuleFactory:new v}),this.bridgeHook=new F({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A,afterBridgeRouteSync:new A});const t=Me&&en?[Vo(),Ko()]:[],r={id:Lo(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:B};this.name=e.name,this.options=r,this.snapshotHandler=Me?new Jo(this):new Zo,this.sharedHandler=nt?new Xo(this):new Yo,this.remoteHandler=Me?new Qo(this):new Wo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&I(_t(xt,P)),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=le,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){return this.remoteHandler.initRawContainer(e,t,r)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const r=nt?Pt(e,t).allShareInfos:{},{userOptions:o,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(n,o),{allShareInfos:i}=this.sharedHandler.registerShared(n,o),a=[...n.plugins];o.plugins&&o.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Do(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let rn=null;function er(e){return rn}Dr(tn);function tr(e,t){const r=o=>{if(!o.startsWith("/"))return o;const n=o.length>1&&o.endsWith("/"),s=`${t}/${o}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return n?`${s}/`:s};return e.map(o=>{const n={...o,path:r(o.path)};return typeof o.redirect=="string"?n.redirect=r(o.redirect):o.redirect&&typeof o.redirect=="object"&&"path"in o.redirect&&typeof o.redirect.path=="string"&&(n.redirect={...o.redirect,path:r(o.redirect.path)}),o.children&&o.children.length>0&&(n.children=tr(o.children,t)),n})}function on(e){const t=e.replace(/\/+$/,""),r=s=>s.startsWith("/")&&s!==t&&!s.startsWith(t+"/"),o=s=>`${t}${s}`.replace(/\/+/g,"/"),n=s=>typeof s=="string"?r(s)?o(s):s:"path"in s&&typeof s.path=="string"&&r(s.path)?{...s,path:o(s.path)}:s;return s=>{const i=s.push.bind(s),a=s.replace.bind(s),c=s.resolve.bind(s);s.push=l=>i(n(l)),s.replace=l=>a(n(l)),s.resolve=(l,...u)=>c(n(l),...u)}}function nn(e){const{router:t,basename:r,memoryRoute:o,hashRoute:n}=e,s=t.getRoutes().sort((m,h)=>m.path.split("/").filter(p=>p).length-h.path.split("/").filter(p=>p).length),i=new Map,a=new Set;s.forEach(m=>{const h=i.get(m.path)||[];h.push(m),i.set(m.path,h)});const c=(m,h)=>`${m}/${h}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(m,h="")=>{if(!m.children||m.children.length===0)return m;for(let p=0;p<m.children.length;p++){const y=m.children[p],g=c(h,y.path),E=(i.get(g)||[]).find(R=>!a.has(R)&&R!==m&&(y.name==null||R.name===y.name));if(E){const R={...E,path:y.path};m.children[p]=R,a.add(E),l(R,g)}}return m};let u=[];for(const m of s)if(!a.has(m)){const h=l(m,m.path);a.add(m),u.push(h)}let f,d;return o?f=pe.createMemoryHistory(r):n?(f=pe.createWebHashHistory(),r&&(u=tr(u,r),d=on(r))):f=pe.createWebHistory(r),{history:f,routes:u,patchRouter:d}}function sn(e){const t=new Map,r=er();return()=>({__APP_VERSION__:"2.9.0",async render(o){var p,y,g,_,E,R,S,b,$;D.debug("createBridgeComponent render Info",o);const{moduleName:n,dom:s,basename:i,memoryRoute:a,hashRoute:c,...l}=o,u={side:"producer",framework:"vue",operation:t.has(s)?"update":"render",reason:"direct"},f=ir.createApp(e.rootComponent,l);t.set(s,f);const d=await((g=(y=(p=r==null?void 0:r.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(o,u)),m=d&&typeof d=="object"&&(d!=null&&d.extraProps)?d==null?void 0:d.extraProps:{},h=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:c,...l,...m});if(h!=null&&h.router){const{history:w,routes:k,patchRouter:z}=nn({router:h.router,basename:o.basename,memoryRoute:o.memoryRoute,hashRoute:o.hashRoute}),ee=pe.createRouter({...h.router.options,history:w,routes:k});if(z&&z(ee),h.afterRouterCreate&&h.afterRouterCreate(ee),D.debug("createBridgeComponent render router info>>>",{moduleName:n,router:ee}),a){const or={action:"memory-route-init",to:a.entryPath,basename:i},nr={side:"producer",framework:"vue",operation:"route-sync",moduleName:n,route:or},sr=await ee.push(a.entryPath);(R=(E=(_=r==null?void 0:r.bridgeHook)==null?void 0:_.lifecycle)==null?void 0:E.afterBridgeRouteSync)==null||R.emit({context:nr,result:sr})}f.use(ee)}f.mount(s),($=(b=(S=r==null?void 0:r.bridgeHook)==null?void 0:S.lifecycle)==null?void 0:b.afterBridgeRender)==null||$.emit(o,{context:u})},destroy(o){var i,a,c,l,u,f;D.debug("createBridgeComponent destroy Info",o);const n=t.get(o==null?void 0:o.dom),s={side:"producer",framework:"vue",operation:"destroy",reason:"direct"};(c=(a=(i=r==null?void 0:r.bridgeHook)==null?void 0:i.lifecycle)==null?void 0:a.beforeBridgeDestroy)==null||c.emit(o,s),n==null||n.unmount(),(f=(u=(l=r==null?void 0:r.bridgeHook)==null?void 0:l.lifecycle)==null?void 0:u.afterBridgeDestroy)==null||f.emit(o,{context:s})}})}function an(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const cn=N.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=N.ref(null),r=N.ref(null),o=N.ref(""),n=N.ref(!1),s=N.ref(!1),i=N.ref(!1),a=He.useRoute(),c=er(),l=N.useAttrs(),u=()=>({name:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute}),f=async()=>{var _,E,R,S,b,$,w;if(!t.value||n.value)return;const h=(_=e.providerInfo)==null?void 0:_.call(e);r.value=h;let p={...l,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",p);const y={side:"consumer",framework:"vue",operation:"render"},g=await((S=(R=(E=c==null?void 0:c.bridgeHook)==null?void 0:E.lifecycle)==null?void 0:R.beforeBridgeRender)==null?void 0:S.emit(p,y))||{};p={...p,...g.extraProps},h.render(p),n.value=!0,(w=($=(b=c==null?void 0:c.bridgeHook)==null?void 0:b.lifecycle)==null?void 0:$.afterBridgeRender)==null||w.emit(p,{context:y})},d=()=>{var g,_,E,R,S,b;const h=r.value;if(!h||!n.value)return;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e});const p=u(),y={side:"consumer",framework:"vue",operation:"destroy"};(E=(_=(g=c==null?void 0:c.bridgeHook)==null?void 0:g.lifecycle)==null?void 0:_.beforeBridgeDestroy)==null||E.emit(p,y),h.destroy({dom:t.value,moduleName:e.moduleName}),r.value=null,n.value=!1,(b=(S=(R=c==null?void 0:c.bridgeHook)==null?void 0:R.lifecycle)==null?void 0:S.afterBridgeDestroy)==null||b.emit(p,{context:y})},m=N.watch(()=>a==null?void 0:a.path,h=>{var p,y,g;if(s.value&&o.value!==""&&o.value!==h){D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:a.path});const _={action:"host-to-remote",mechanism:"popstate",from:o.value,to:h,basename:e.basename},E={side:"consumer",framework:"vue",operation:"route-sync",moduleName:e.moduleName,route:_};an(),(g=(y=(p=c==null?void 0:c.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.afterBridgeRouteSync)==null||g.emit({context:E})}o.value=h});return N.onMounted(()=>{s.value=!0,f()}),N.onActivated(async()=>{s.value=!0,i.value&&(i.value=!1,await N.nextTick(),f())}),N.onDeactivated(()=>{s.value=!1,i.value=!0,d()}),N.onBeforeUnmount(()=>{m(),d()}),()=>N.createVNode("div",N.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function rr(e){return N.defineAsyncComponent({__APP_VERSION__:"2.9.0",...e.asyncComponentOptions,loader:async()=>{var c,l;const t=He.useRoute();let r="/";const o=(l=(c=t==null?void 0:t.matched)==null?void 0:c[0])==null?void 0:l.path;o&&(o.endsWith("/:pathMatch(.*)*")?r=o.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const n=(e==null?void 0:e.export)||"default";D.debug("createRemoteAppComponent LazyComponent create >>>",{basename:r,info:e});const s=await e.loader(),i=s&&s[Symbol.for("mf_module_id")],a=s[n];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:n,basename:r,route:t}),n in s&&typeof a=="function")return{render(){return N.h(cn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function ln(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),rr(e)}exports.createBridgeComponent=sn;exports.createRemoteAppComponent=rr;exports.createRemoteComponent=ln;
|
|
7
|
+
`)};function Pr(e,t,r,o,n,s){return o(_t(e,t,r,n))}const W="[ Federation Runtime ]",Ce=dt(W);function L(e,t,r,o,n){e||I(t)}function I(e,t,r,o,n){if(t!==void 0)return Pr(e,t,r??{},i=>{throw new Error(`${W}: ${i}`)},o);const s=e;throw s instanceof Error?(s.message.startsWith(W)||(s.message=`${W}: ${s.message}`),s):new Error(`${W}: ${s}`)}function se(e){e instanceof Error&&(e.message.startsWith(W)||(e.message=`${W}: ${e.message}`)),Ce.warn(e)}function kr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ie(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Fe(e){return typeof e.entry<"u"}function Rt(e){return!e.entry.includes(".json")}function xe(e){return e&&typeof e=="object"}const Lr=Object.prototype.toString;function St(e){return Lr.call(e)==="[object Object]"}function bt(e){return Array.isArray(e)?e:[e]}function wt(e){const t={url:"",type:"global",globalName:""};return j||at()||!("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 Or=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},Cr=2e3,T=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return T}})(),we=O;function ye(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function Ee(e,t){return Object.hasOwnProperty.call(e,t)}Ee(T,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ye(T,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const G=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function It(e){var t,r,o,n,s,i,a;Ee(e,"__VMOK__")&&!Ee(e,"__FEDERATION__")&&ye(e,"__FEDERATION__",e.__VMOK__),Ee(e,"__FEDERATION__")||(ye(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),ye(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(o=e.__FEDERATION__).moduleInfo??(o.moduleInfo={}),(n=e.__FEDERATION__).__SHARE__??(n.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map),(a=e.__FEDERATION__).__PRELOADED_ASSETS__??(a.__PRELOADED_ASSETS__=new Set)}It(T);It(O);function Dr(e,t=ke()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.9.2")}function q(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const o of r){const[n,s]=o.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else I(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const ze=()=>O.__FEDERATION__.moduleInfo,Hr=(e,t)=>{const r=q(t,ie(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:o,...n}=e,s=ie(n),i=q(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===o)return i}},ge=e=>Hr(e,O.__FEDERATION__.moduleInfo),Ke=(e,t)=>{const r=ie(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},Fr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),Ge=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:T[r]}},xr=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,Gr=e=>T.__FEDERATION__.__PRELOADED_MAP__.get(e),Ur=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Br=e=>T.__FEDERATION__.__PRELOADED_ASSETS__.has(e),jr=e=>{const t=T.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Cr){const r=t.values().next().value;r!==void 0&&t.delete(r)}},Je="[0-9A-Za-z-]+",Ue=`(?:\\+(${Je}(?:\\.${Je})*))`,ne="0|[1-9]\\d*",_e="[0-9]+",$t="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Ze=`(?:${_e}|${$t})`,Wr=`(?:-?(${Ze}(?:\\.${Ze})*))`,Xe=`(?:${ne}|${$t})`,vt=`(?:-(${Xe}(?:\\.${Xe})*))`,ve=`${ne}|x|X|\\*`,Q=`[v=\\s]*(${ve})(?:\\.(${ve})(?:\\.(${ve})(?:${vt})?${Ue}?)?)?`,Vr=`^\\s*(${Q})\\s+-\\s+(${Q})\\s*$`,qr=`[v=\\s]*${`(${_e})\\.(${_e})\\.(${_e})`}${Wr}?${Ue}?`,Be="((?:<|>)?=?)",zr=`(\\s*)${Be}\\s*(${qr}|${Q})`,Tt="(?:~>?)",Kr=`(\\s*)${Tt}\\s+`,Nt="(?:\\^)",Jr=`(\\s*)${Nt}\\s+`,Zr="(<|>)?=?\\s*\\*",Xr=`^${Nt}${Q}$`,Yr=`v?${`(${ne})\\.(${ne})\\.(${ne})`}${vt}?${Ue}?`,Qr=`^${Tt}${Q}$`,eo=`^${Be}\\s*${Q}$`,to=`^${Be}\\s*(${Yr})$|^$`,ro="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function M(e){return!e||e.toLowerCase()==="x"||e==="*"}function At(...e){return t=>e.reduce((r,o)=>o(r),t)}function Ye(e){return e.match(C(to))}function Qe(e,t,r,o){const n=`${e}.${t}.${r}`;return o?`${n}-${o}`:n}function oo(e){return e.replace(C(Vr),(t,r,o,n,s,i,a,c,l,u,f,h)=>(M(o)?r="":M(n)?r=`>=${o}.0.0`:M(s)?r=`>=${o}.${n}.0`:r=`>=${r}`,M(l)?c="":M(u)?c=`<${Number(l)+1}.0.0-0`:M(f)?c=`<${l}.${Number(u)+1}.0-0`:h?c=`<=${l}.${u}.${f}-${h}`:c=`<=${c}`,`${r} ${c}`.trim()))}function no(e){return e.replace(C(zr),"$1$2$3")}function so(e){return e.replace(C(Kr),"$1~")}function io(e){return e.replace(C(Jr),"$1^")}function ao(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Xr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:i?o==="0"?n==="0"?`>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s}-${i} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${s} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${Number(o)+1}.0.0-0`)).join(" ")}function co(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Qr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:i?`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`)).join(" ")}function lo(e){return e.split(/\s+/).map(t=>t.trim().replace(C(eo),(r,o,n,s,i,a)=>{const c=M(n),l=c||M(s),u=l||M(i);return o==="="&&u&&(o=""),a="",c?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(l&&(s=0),i=0,o===">"?(o=">=",l?(n=Number(n)+1,s=0,i=0):(s=Number(s)+1,i=0)):o==="<="&&(o="<",l?n=Number(n)+1:s=Number(s)+1),o==="<"&&(a="-0"),`${o+n}.${s}.${i}${a}`):l?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:u?`>=${n}.${s}.0${a} <${n}.${Number(s)+1}.0-0`:r})).join(" ")}function uo(e){return e.trim().replace(C(Zr),"")}function fo(e){return e.trim().replace(C(ro),"")}function Re(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function ho(e,t){const{preRelease:r}=e,{preRelease:o}=t;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let n=0,s=r.length;n<=s;n++){const i=r[n],a=o[n];if(i!==a)return i===void 0&&a===void 0?0:i?a?Re(i,a):-1:1}return 0}function fe(e,t){return Re(e.major,t.major)||Re(e.minor,t.minor)||Re(e.patch,t.patch)||ho(e,t)}function Te(e,t){return e.version===t.version}function mo(e,t){switch(e.operator){case"":case"=":return Te(e,t);case">":return fe(e,t)<0;case">=":return Te(e,t)||fe(e,t)<0;case"<":return fe(e,t)>0;case"<=":return Te(e,t)||fe(e,t)>0;case void 0:return!0;default:return!1}}function po(e){return At(ao,co,lo,uo)(e)}function yo(e){return At(oo,no,so,io)(e.trim()).split(/\s+/).join(" ")}function oe(e,t){if(!e)return!1;const r=Ye(e);if(!r)return!1;const[,o,,n,s,i,a]=r,c={operator:o,version:Qe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const u of l){const f=u.trim();if(!f||f==="*"||f==="x")return!0;try{const h=yo(f);if(!h.trim())return!0;const m=h.split(" ").map(y=>po(y)).join(" ");if(!m.trim())return!0;const d=m.split(/\s+/).map(y=>fo(y)).filter(Boolean);if(d.length===0)continue;let p=!0;for(const y of d){const g=Ye(y);if(!g){p=!1;break}const[,_,,E,R,S,b]=g;if(!mo({operator:_,version:Qe(E,R,S,b),major:E,minor:R,patch:S,preRelease:b==null?void 0:b.split(".")},c)){p=!1;break}}if(p)return!0}catch(h){console.error(`[semver] Error processing range part "${f}":`,h);continue}}return!1}const le="default",Mt="global";function Eo(e,t,r,o){var s,i;let n;return"get"in e?n=e.get:"lib"in e?n=()=>Promise.resolve(e.lib):n=()=>Promise.resolve(()=>{I(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode)&&I(`Invalid shared config for "${r}" 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:n,loaded:e!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Pe.UNKNOWN,useIn:[]}:void 0}}function Pt(e,t){const r=t.shared||{},o=t.name,n=Object.keys(r).reduce((i,a)=>{const c=bt(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(Eo(l,o,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(n).forEach(i=>{s[i]?n[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=n[i]}),{allShareInfos:s,newShareInfos:n}}function ae(e,t){if(!e)return!1;const{status:r,mode:o}=e;return r===Pe.NO_USE?!1:r===Pe.CALCULATED?!0:o==="runtime-infer"?t?_o(e,t):!0:!1}function V(e,t){const r=o=>{if(!Number.isNaN(Number(o))){const n=o.split(".");let s=o;for(let i=0;i<3-n.length;i++)s+=".0";return s}return o};return!!oe(r(e),`<=${r(t)}`)}const ce=(e,t)=>{const r=t||function(o,n){return V(o,n)};return Object.keys(e).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},be=e=>!!e.loaded||typeof e.lib=="function",go=e=>!!e.loading,_o=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(o=>r.includes(o)):!1};function Ro(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){return i?n[c].treeShaking?n[l].treeShaking?!be(n[c].treeShaking)&&V(c,l):!1:!0:!be(n[c])&&V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}const K=e=>be(e)||go(e);function So(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){if(i){if(!n[c].treeShaking)return!0;if(!n[l].treeShaking)return!1;if(K(n[l].treeShaking))return K(n[c].treeShaking)?!!V(c,l):!0;if(K(n[c].treeShaking))return!1}return K(n[l])?K(n[c])?!!V(c,l):!0:K(n[c])?!1:V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}function bo(e){return e==="loaded-first"?So:Ro}function Se(e,t,r,o,n){if(!e)return;const{shareConfig:s,scope:i=le,strategy:a,treeShaking:c}=r,l=Array.isArray(i)?i:[i];for(const u of l)if(s&&e[u]&&e[u][t]){const{requiredVersion:f}=s,{version:h,useTreesShaking:m}=bo(a)(e,u,t,c),d=()=>{const y=e[u][t][h];if(s.singleton){if(typeof f=="string"&&!oe(h,f)){const g=`Version ${h} from ${h&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;s.strictVersion?I(g):se(g)}return{shared:y,useTreesShaking:m}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:m};if(oe(h,f))return{shared:y,useTreesShaking:m};const g=ae(c);if(g){for(const[_,E]of Object.entries(e[u][t]))if(ae(E.treeShaking,c==null?void 0:c.usedExports)&&oe(_,f))return{shared:E,useTreesShaking:g}}for(const[_,E]of Object.entries(e[u][t]))if(oe(_,f))return{shared:E,useTreesShaking:!1}}},p={shareScopeMap:e,scope:u,pkgName:t,version:h,GlobalFederation:we.__FEDERATION__,shareInfo:r,resolver:d,loadContext:n};return(o.emit(p)||p).resolver()}}function kt(){return we.__FEDERATION__.__SHARE__}function et(e){const{pkgName:t,extraOptions:r,shareInfos:o}=e,n=c=>{if(!c)return;const l={};return c.forEach(f=>{l[f.version]=f}),l[ce(l,function(f,h){return!be(l[f])&&V(f,h)})]},s=(r==null?void 0:r.resolver)??n,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const u of c)if(u)for(const[f,h]of Object.entries(u)){const m=l[f];i(m)&&i(h)?l[f]=a(m,h):h!==void 0&&(l[f]=h)}return l};return a(s(o[t]),r==null?void 0:r.customShareInfo)}const J=(e,t)=>{e.useIn||(e.useIn=[]),kr(e.useIn,t)};function he(e,t){return t&&e.treeShaking?e.treeShaking:e}function je(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function tt(e,t){for(const r of e){const o=t.startsWith(r.name);let n=t.replace(r.name,"");if(o){if(n.startsWith("/")){const a=r.name;return n=`.${n}`,{pkgNameOrAlias:a,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let i=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function wo(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Lt="RUNTIME-001",Ot="RUNTIME-002",Ct="RUNTIME-003",Dt="RUNTIME-004",Ht="RUNTIME-005",De="RUNTIME-006",Ft="RUNTIME-007",Ie="RUNTIME-008",Io="RUNTIME-009",xt="RUNTIME-010",Gt="RUNTIME-011",$o="RUNTIME-012",Ut="RUNTIME-013",Bt="RUNTIME-014",jt="RUNTIME-015",P={[Lt]:"Failed to get remoteEntry exports.",[Ot]:'The remote entry interface does not contain "init"',[Ct]:"Failed to get manifest.",[Dt]:"Failed to locate remote.",[Ht]:"Invalid loadShareSync function call from bundler runtime",[De]:"Invalid loadShareSync function call from runtime",[Ft]:"Failed to get remote snapshot.",[Ie]:"Failed to load script resources.",[Io]:"Please call createInstance first.",[xt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Gt]:"The remoteEntry URL is missing from the remote snapshot.",[$o]:'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.',[Ut]:"The manifest is not a valid Module Federation manifest.",[Bt]:"The remote does not expose the requested module.",[jt]:"Remote container initialization failed."};({...P});const Wt=".then(callbacks[0]).catch(callbacks[1])",rt=new WeakMap,vo=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function To(e){return e instanceof TypeError?vo.some(t=>e.message.includes(t)):!1}function Vt(e){return e==="esm"||e==="module"}async function No({entry:e,remoteEntryExports:t,name:r,getEntryUrl:o}){return new Promise((n,s)=>{const i=c=>{if(To(c)){const l=c instanceof Error?c.message:String(c);try{I(Ie,P,{remoteName:r,resourceUrl:a},l)}catch(u){s(u);return}}s(c)},a=o?o(e):e;try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${a}")${Wt}`)([n,i]):import(a).then(n).catch(i)}catch(c){I(`Failed to load ESM entry from "${a}". ${c instanceof Error?c.message:String(c)}`)}})}async function Ao({entry:e,remoteEntryExports:t}){return new Promise((r,o)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(o):new Function("callbacks",`System.import("${e}")${Wt}`)([r,o])}catch(n){I(`Failed to load SystemJS entry from "${e}". ${n instanceof Error?n.message:String(n)}`)}})}function qt(e,t,r){const{remoteEntryKey:o,entryExports:n}=Ge(e,t);return n||I(Lt,P,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:o}),n}async function Mo({name:e,globalName:t,entry:r,remoteInfo:o,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=Ge(e,t);if(a)return a;const c=s?s(r):r;return _r(c,{attrs:{},createScriptHook:(l,u)=>{const f=n.lifecycle.createScript.emit({url:l,attrs:u,remoteInfo:o,resourceContext:i?{...i,url:l}:void 0});if(f&&(f instanceof HTMLScriptElement||"script"in f||"timeout"in f))return f}}).then(()=>qt(e,t,r),l=>{const u=l instanceof Error?l.message:String(l);I(Ie,P,{remoteName:e,resourceUrl:c},u)})}async function Po({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:o,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return Vt(c)?No({entry:s,remoteEntryExports:t,name:a,getEntryUrl:o}):c==="system"?Ao({entry:s,remoteEntryExports:t}):Mo({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:r,getEntryUrl:o,resourceContext:n})}async function ko({remoteInfo:e,loaderHook:t,resourceContext:r}){const{entry:o,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=Ge(s,n);return a||br(o,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(c,l={})=>{const u=t.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:e,resourceContext:r?{...r,url:c}:void 0});if(u&&"url"in u)return u}}}).then(()=>qt(s,n,o)).catch(c=>{I(`Failed to load Node.js entry for remote "${s}" from "${o}". ${c instanceof Error?c.message:String(c)}`)})}function zt(e){const{entry:t,name:r}=e;return ct(r,t)}async function We(e){const{origin:t,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=zt(o);if(r)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:r,resourceContext:s,cached:!0}),r;if(!G[a]){const l=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook,f=l.emit({origin:t,loaderHook:u,remoteInfo:o,remoteEntryExports:r,resourceContext:s}).then(h=>h||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":j)?Po({remoteInfo:o,remoteEntryExports:r,loaderHook:u,getEntryUrl:n,resourceContext:s}):ko({remoteInfo:o,loaderHook:u,resourceContext:s}))).then(async h=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:h,resourceContext:s}),h)).catch(async h=>{const m=h instanceof Error&&h.message.includes("ScriptExecutionError");if(h instanceof Error&&h.message.includes(Ie)&&!m&&!i){const d=y=>We({...y,_inErrorHandling:!0}),p=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:d,origin:t,remoteInfo:o,remoteEntryExports:r,globalLoading:G,uniqueKey:a});if(p)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:p,resourceContext:s,error:h,recovered:!0}),p}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:h}),h});G[a]=f,f.then(void 0,()=>{G[a]===f&&delete G[a]}),rt.set(f,t)}const c=G[a];if(rt.get(c)!==t)try{const l=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:l,resourceContext:s}),l}catch(l){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:l}),l}return c}function Z(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||Mt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||le}}function Lo(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Oo(e){const t=new Map;return[...e||[],...xr()].forEach(r=>{r&&(L(St(r),"Plugin configuration is invalid."),L(r.name,"A name must be provided by the plugin."),t.has(r.name)||t.set(r.name,r))}),Array.from(t.values())}function Co(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Do(e,t){const r=new Map;t.options.plugins.forEach(n=>{n&&r.set(n.name,n)});const o=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Oo(e).forEach(n=>{var i;if(r.set(n.name,n),t.hooks.registerPlugins[n.name])return;const s=Co(n,(i=n.apply)==null?void 0:i.call(n,t));o.forEach(a=>{a.applyPlugin(s)})}),Array.from(r.values())}function Ho(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 H(e){var r,o,n,s,i,a;const t={};for(const[c,l]of Object.entries(e.shared)){const u=l[0];u&&(t[c]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((o=u.shareConfig)==null?void 0:o.requiredVersion)===!1?!1:(n=u.shareConfig)==null?void 0:n.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((i=e.remotes)==null?void 0:i.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((a=e.remotes)==null?void 0:a.map(Ho))??[],shared:t}}}function Kt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function Fo(e,t){return t.map(r=>{const o=wo(e,r.nameOrAlias);return L(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&ut({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Kt(r)}})}function xo(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Ve(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function B(e,t,r,o){return{url:t,status:r,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:o}}function Ne(e,t,r,o){return r?Br(t)?Promise.resolve(B(e,t,"cached")):(jr(t),o()):o()}async function Go(e,t,r,o){const n=e.moduleCache.get(r.name),s=r.entry;if(n!=null&&n.remoteEntryExports)return B(o,s,"cached");try{if(!await We({origin:e,remoteInfo:r,remoteEntryExports:n==null?void 0:n.remoteEntryExports,resourceContext:{...o,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return B(o,s,"success")}catch(i){return B(o,s,Ve(i)?"timeout":"error",i)}}function de({host:e,remoteInfo:t,url:r,attrs:o,context:n,needDeleteLink:s}){return new Promise(i=>{const{link:a,needAttach:c}=gr({url:r,cb:()=>{i(B(n,r,c?"success":"cached"))},onErrorCallback:l=>{i(B(n,r,Ve(l)?"timeout":"error",l))},attrs:o,createLinkHook:(l,u)=>{const f=e.loaderHook.lifecycle.createLink.emit({url:l,attrs:u,remoteInfo:t,resourceContext:{...n,url:l}});return f instanceof HTMLLinkElement,f},needDeleteLink:s});c&&document.head.appendChild(a)})}function Uo({host:e,remoteInfo:t,url:r,attrs:o,context:n}){return new Promise(s=>{const{script:i,needAttach:a}=pt({url:r,cb:()=>{s(B(n,r,a?"success":"cached"))},onErrorCallback:c=>{s(B(n,r,Ve(c)?"timeout":"error",c))},attrs:o,createScriptHook:(c,l)=>{const u=e.loaderHook.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:t,resourceContext:{...n,url:c}});return u instanceof HTMLScriptElement,u},needDeleteScript:!0});a&&document.head.appendChild(i)})}function me(e,t){return{...e,resourceType:t}}function Jt(e,t,r,o=!0,n={initiator:"preloadRemote",id:e.name},s=!0){const{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:c}=r,l=[];if(t.options.inBrowser){if(c.forEach(h=>{const{moduleInfo:m}=h;l.push(Go(t,e,m,me(n,"remoteEntry")))}),o){const h={rel:"preload",as:"style"};i.forEach(m=>{const d=me(n,"css");l.push(Ne(d,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:h,context:d})))})}else{const h={rel:"stylesheet",type:"text/css"};i.forEach(m=>{const d=me(n,"css");l.push(Ne(d,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:h,needDeleteLink:!1,context:d})))})}let u=Uo,f={fetchpriority:"high",type:"text/javascript"};o?(u=de,f={rel:"preload",as:"script"}):Vt(e.type)&&(u=de,f={rel:"modulepreload",fetchpriority:"high"}),a.forEach(h=>{const m=me(n,"js");l.push(Ne(m,h,s,()=>u({host:t,remoteInfo:e,url:h,attrs:f,context:m})))})}return Promise.all(l)}function Bo(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(r=>r.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function jo(e,t,r){const o=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach(i=>{o[i]||(o[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:o[n[0]],initScope:r??[]}}var ot=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,t){const r=t||{initiator:"loadRemote",id:je(this.remoteInfo.name,e),resourceType:"remoteEntry",url:this.remoteInfo.entry,expose:e},o=await We({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:r});return L(o,`remoteEntryExports is undefined
|
|
8
|
+
${ut(this.remoteInfo)}`),this.remoteEntryExports=o,this.remoteEntryExports}async init(e,t,r,o,n){const s=await this.getEntry(o,n);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,cached:!0,origin:this.host}),i}return s}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:i,shareScope:a,initScope:c}=jo(this.remoteInfo,this.host.shareScopeMap,r),l=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:i,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});typeof(s==null?void 0:s.init)>"u"&&I(Ot,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,H(this.host.options));try{await s.init(l.shareScope,l.initScope,l.remoteEntryInitOptions)}catch(u){I(jt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,H(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...l,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,origin:this.host}),i}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,r,o){const{loadFactory:n=!0}=r||{loadFactory:!0},s=await this.init(e,o,void 0,t);this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});let i;try{const l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i=typeof l=="function"?l:void 0,i||(i=await s.get(t)),i||I(Bt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bo(o)},void 0,H(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(l){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:l,origin:this.host}),l}const a=Or(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 l=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:l,origin:this.host}),l}catch(l){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:l,origin:this.host}),l}}wraperFactory(e,t){function r(o,n){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return()=>{const o=e();return o instanceof Promise?o.then(n=>(r(n,t),n)):(r(o,t),o)}}},F=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){L(St(e),"Plugin configuration is invalid.");const t=e.name;L(t,"A name must be provided by the plugin."),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(r=>{const o=e[r];o&&this.lifecycle[r].on(o)}))}removePlugin(e){L(e,"A name is required.");const t=this.registerPlugins[e];L(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(r=>{const o=t[r];o&&this.lifecycle[r].remove(o)}),delete this.registerPlugins[e]}},A=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...o){return t.remove(r),e.apply(null,o)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{const o=r(...e);o!==void 0&&(t=o)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},v=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=s=>s===!1?!1:o<r.length?Promise.resolve(r[o++].apply(null,e)).then(i=>i===void 0||e.length===1&&i===e[0]?n(s):n(i)):s;t=n()}return Promise.resolve(t)}};function Zt(e,t){if(!xe(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var Y=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(r===void 0)continue;if(Zt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){se(r),this.onerror(r)}return e}},x=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let r=0;const o=s=>(se(s),this.onerror(s),e),n=s=>{if(s!==void 0&&Zt(e,s))e=s;else if(s!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(r<t.length)try{return Promise.resolve(t[r++](e)).then(n,o)}catch(i){return o(i)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const re="Remote loading is disabled by experiments.optimization.disableRemote.";var Wo=class{constructor(){this.hooks=new F({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(re)}preloadRemote(){throw new Error(re)}registerRemotes(){throw new Error(re)}getRemoteModuleAndOptions(){throw new Error(re)}initRawContainer(){throw new Error(re)}};function Xt(e,t){const r=wt(t);r.url||I(Gt,P,{remoteName:e.name});let o=Le(t,r.url);!j&&!o.startsWith("http")&&(o=`https:${o}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=o,e.version=t.version,e.buildVersion=t.buildVersion}function Vo(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:s,id:i}=e;if(!Fe(t)||!Rt(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:je(t.name,o)});Xt(s,a);const l=[{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await n.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:n.options,origin:n});const[u]=l;if(u){const f={remote:t,preloadConfig:u},h=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:f,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});h&&Jt(s,n,h,!1,{initiator:"loadRemote",id:i},u.recordPreloadedAssets).catch(()=>{})}return{...e,remoteSnapshot:a}}return e}}}function qo(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function Yt(e,t,r,o,n={},s){const{value:i}=q(e,ie(t)),a=s||i;if(a&&!ft(a)&&(r(a,t,o),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(n[l])continue;n[l]=!0;const u=qo(l),f=a.remotesInfo[l];Yt(e,{name:u.name,version:f.matchedVersion},r,!1,n,void 0)}}}const Ae=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function zo(e,t,r,o,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:h}=f;if(Yt(o,r,(d,p,y)=>{var b;let g;if(y)g=f;else if(Array.isArray(h)){const $=h.find(w=>w.nameOrAlias===p.name||w.nameOrAlias===p.alias);if(!$)return;g=Kt($)}else if(h===!0)g=f;else return;const _=Le(d,wt(d).url);_&&a.push({name:p.name,moduleInfo:{name:p.name,entry:_,type:"remoteEntryType"in d?d.remoteEntryType:"global",entryGlobalName:"globalName"in d?d.globalName:p.name,shareScope:"",version:"version"in d?d.version:void 0},url:_});let E="modules"in d?d.modules:[];const R=xo(g.exposes);R.length&&"modules"in d&&(E=(b=d==null?void 0:d.modules)==null?void 0:b.reduce(($,w)=>((R==null?void 0:R.indexOf(w.moduleName))!==-1&&$.push(w),$),[]));function S($){const w=$.map(k=>Le(d,k));return g.filter?w.filter(g.filter):w}if(E){const $=E.length;for(let w=0;w<$;w++){const k=E[w],z=`${p.name}/${k.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:k.moduleName==="."?p.name:z,name:p.name,remoteSnapshot:d,preloadConfig:g,remote:p,origin:e}),!Gr(z)&&(g.resourceCategory==="all"?(s.push(...S(k.assets.css.async)),s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.async)),i.push(...S(k.assets.js.sync))):g.resourceCategory==="sync"&&(s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.sync))),Ur(z))}}},!0,{},n),n.shared&&n.shared.length>0){const d=(p,y)=>{const{shared:g}=Se(e.shareScopeMap,y.sharedName,p,e.sharedHandler.hooks.lifecycle.resolveShare)||{};g&&typeof g.lib=="function"&&(y.assets.js.sync.forEach(_=>{c.add(_)}),y.assets.css.sync.forEach(_=>{l.add(_)}))};n.shared.forEach(p=>{var _;const y=(_=u.shared)==null?void 0:_[p.sharedName];if(!y)return;const g=p.version?y.find(E=>E.version===p.version):y;g&&bt(g).forEach(E=>{d(E,p)})})}const m=i.filter(d=>!c.has(d)&&!Ae("script",d));return{cssAssets:s.filter(d=>!l.has(d)&&!Ae("link",d)),jsAssetsWithoutEntry:m,entryAssets:a.filter(d=>!Ae("script",d.url))}}const Ko=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return j?Fe(n)&&Rt(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Xt(o,i),zo(t,r,o,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Qt(e,t){const r=ge({name:t.name,version:t.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&q(r.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:"version"in e?e.version:void 0})}}var Jo=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new F({beforeLoadRemoteSnapshot:new v("beforeLoadRemoteSnapshot"),loadSnapshot:new x("loadGlobalSnapshot"),loadRemoteSnapshot:new x("loadRemoteSnapshot"),afterLoadSnapshot:new x("afterLoadSnapshot"),beforeLoadManifest:new v("beforeLoadManifest"),afterLoadManifest:new v("afterLoadManifest")}),this.manifestLoading=we.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:r="loadRemote"}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e,origin:this.HostInstance});let n=ge({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Fr({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!q(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n==null?void 0:n.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,f;if(c)if(ft(c)){const h=j?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",m=await this.loadManifestSnapshot(h,e,{},{initiator:r,id:t||e.name}),d=Ke({...e,entry:h},m);u=m,f=d}else{const{remoteSnapshot:h}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=h,f=l}else if(Fe(e)){const h=await this.loadManifestSnapshot(e.entry,e,{},{initiator:r,id:t||e.name}),m=Ke(e,h);u=h,f=m}else I(Ft,P,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,H(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:f}}getGlobalRemoteInfo(e){return Qt(e,this.HostInstance)}async getManifestJson(e,t,r,o){return(async()=>{const s=Z(t);let i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,origin:this.HostInstance});let a,c,l=!1;try{let h=await this.loaderHook.lifecycle.fetch.emit(e,{},s,o?{...o,url:e,resourceType:"manifest"}:void 0);(!h||!(h instanceof Response))&&(h=await fetch(e,{})),a=h,i=await h.json()}catch(h){c=h,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,response:a,error:h,origin:this.HostInstance}),I(Ct,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,H(this.HostInstance.options))),l=!0}const u=[!i.metaData&&"metaData",!i.exposes&&"exposes",!i.shared&&"shared"].filter(Boolean),f=u.length>0?new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${u.join(", ")}.`):void 0;return f&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,response:a,error:f||c,recovered:f?void 0:l||void 0,origin:this.HostInstance}),f&&I(Ut,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:u.join(",")},void 0,H(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,r,o){const n=async()=>{const s=await this.getManifestJson(e,t,r,o),i=dr(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=n().then(s=>s)),this.manifestLoading[e]}},Zo=class{constructor(){this.hooks=new F({})}},Xo=class{constructor(e){this.hooks=new F({beforeRegisterShare:new Y("beforeRegisterShare"),afterRegisterShare:new A("afterRegisterShare"),afterResolve:new x("afterResolve"),beforeLoadShare:new x("beforeLoadShare"),loadShare:new v,afterLoadShare:new A("afterLoadShare"),errorLoadShare:new A("errorLoadShare"),resolveShare:new Y("resolveShare"),initContainerShareScopeMap:new Y("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:r,selectedShared:o,loadContext:n}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:r,selectedShared:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:n,origin:this.host})}catch(s){se(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:r,error:o,recovered:n,loadContext:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:o,recovered:n,loadContext:s})}catch(i){se(i)}}registerShared(e,t){const{newShareInfos:r,allShareInfos:o}=Pt(e,t);return Object.keys(r).forEach(n=>{r[n].forEach(s=>{s.scope.forEach(i=>{var l,u,f;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:n,shared:s});const a=(l=this.shareScopeMap[i])==null?void 0:l[n],c=a==null?void 0:a[s.version];a||this.setShared({pkgName:n,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name}),this.emitAfterRegisterShare(n,{scope:i,shared:s,previousShared:c,registeredShared:(f=(u=this.shareScopeMap[i])==null?void 0:u[n])==null?void 0:f[s.version],trigger:"runtime"})})})}),{newShareInfos:r,allShareInfos:o}}async loadShare(e,t){const{host:r}=this;let o=t==null?void 0:t.context;const n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});let s=n;try{n!=null&&n.scope&&await Promise.all(n.scope.map(async u=>{await Promise.all(this.initializeSharing(u,{strategy:n.strategy,context:o}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r,loadContext:o});s=i.shareInfo,o=i.loadContext||o,L(s,`Cannot find shared "${e}" in host "${r.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 a=s,{shared:c,useTreesShaking:l}=Se(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,o)||{};if(c){const u=he(c,l);if(u.lib)return J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),u.lib;if(u.loading&&!u.loaded){const f=await u.loading;return u.loaded=!0,u.lib||(u.lib=f),J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),f}else{const h=(async()=>{const d=await u.get();return J(u,r.options.name),u.loaded=!0,u.lib=d,d})();this.setShared({pkgName:e,loaded:!1,shared:c,from:r.options.name,lib:null,loading:h,treeShaking:l?u:void 0});const m=await h;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),m}}else{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,recovered:!0,loadContext:o}),!1;const u=ae(a.treeShaking),f=he(a,u),m=(async()=>{const p=await f.get();f.lib=p,f.loaded=!0,J(f,r.options.name);const{shared:y,useTreesShaking:g}=Se(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,o)||{};if(y){const _=he(y,g);_.lib=p,_.loaded=!0,y.from=a.from}return p})();this.setShared({pkgName:e,loaded:!1,shared:a,from:r.options.name,lib:null,loading:m,treeShaking:u?f:void 0});const d=await m;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:a,loadContext:o}),d}}catch(i){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:i,loadContext:o}),i}}initializeSharing(e=le,t){var m;const{host:r}=this,o=t==null?void 0:t.from,n=t==null?void 0:t.strategy,s=((m=t==null?void 0:t.context)==null?void 0:m.trigger)||o||"runtime";let i=t==null?void 0:t.initScope;const a=[];if(o!=="build"){const{initTokens:d}=this;i||(i=[]);let p=d[e];if(p||(p=d[e]={from:this.host.name}),i.indexOf(p)>=0)return a;i.push(p)}const c=this.shareScopeMap,l=r.options.name;c[e]||(c[e]={});const u=c[e],f=(d,p)=>{var b;const{version:y,eager:g}=p;u[d]=u[d]||{};const _=u[d],E=_[y],R=E&&he(E),S=!!(R&&("eager"in R&&R.eager||"shareConfig"in R&&((b=R.shareConfig)!=null&&b.eager)));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!g!=!S?g:l>_[y].from))&&(_[y]=p),this.emitAfterRegisterShare(d,{scope:e,shared:p,previousShared:E,registeredShared:_[y],trigger:s})},h=async d=>{const{module:p}=await r.remoteHandler.getRemoteModuleAndOptions({id:d});let y;const g={initiator:"loadShare",id:d,resourceType:"remoteEntry",url:p.remoteInfo.entry};try{y=await p.getEntry(void 0,g)}catch(_){if(y=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:d,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:p.remoteInfo,origin:r}),!y)return}finally{y!=null&&y.init&&!p.initing&&(p.remoteEntryExports=y,await p.init(void 0,void 0,i,void 0,g))}};return Object.keys(r.options.shared).forEach(d=>{r.options.shared[d].forEach(p=>{p.scope.includes(e)&&f(d,p)})}),(r.options.shareStrategy==="version-first"||n==="version-first")&&r.options.remotes.forEach(d=>{d.shareScope===e&&a.push(h(d.name))}),a}loadShareSync(e,t){const{host:r}=this,o=t==null?void 0:t.context,n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});try{n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy,from:t==null?void 0:t.from,context:o})});const{shared:s}=Se(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare,o)||{};if(s){if(typeof s.lib=="function")return J(s,r.options.name),s.loaded||(s.loaded=!0,s.from===r.options.name&&(n.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),s.lib;if(typeof s.get=="function"){const i=s.get();if(!(i instanceof Promise))return J(s,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&I((t==null?void 0:t.from)==="build"?Ht:De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib}I(De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,error:s,loadContext:o}),s}}initShareScopeMap(e,t,r={}){const{host:o}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:o.options,origin:o,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:o,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,f=Array.isArray(l)?l:[l],h=m=>{const d=(y,g,_)=>{_&&!y[g]&&(y[g]=_)},p=a?m.treeShaking:m;d(p,"loaded",s),d(p,"loading",n),d(p,"get",i),d(p,"lib",o)};f.forEach(m=>{this.shareScopeMap[m]||(this.shareScopeMap[m]={}),this.shareScopeMap[m][e]||(this.shareScopeMap[m][e]={}),this.shareScopeMap[m][e][c]||(this.shareScopeMap[m][e][c]={version:c,scope:[m],...u,lib:o});const d=this.shareScopeMap[m][e][c];h(d),r&&d.from!==r&&(d.from=r)})}_setGlobalShareScopeMap(e){const t=kt(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},Yo=class{constructor(){this.shareScopeMap={},this.hooks=new F({afterResolve:new x("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}},Qo=class{constructor(e){this.hooks=new F({beforeRegisterRemote:new Y("beforeRegisterRemote"),registerRemote:new Y("registerRemote"),beforeRequest:new x("beforeRequest"),afterMatchRemote:new v("afterMatchRemote"),onLoad:new v("onLoad"),afterLoadRemote:new v("afterLoadRemote"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new v("errorLoadRemote"),beforePreloadRemote:new v("beforePreloadRemote"),generatePreloadAssets:new v("generatePreloadAssets"),afterPreloadRemote:new v("afterPreloadRemote"),loadEntry:new v}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,o)=>(this.registerRemote(o,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:o}=t,{name:n,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:o},s&&e.startsWith(n)){const i=e.replace(n,s);this.idToRemoteMap[i]={name:r.name,expose:o};return}if(s&&e.startsWith(s)){const i=e.replace(s,n);this.idToRemoteMap[i]={name:r.name,expose:o}}}async loadRemote(e,t){const{host:r}=this,o=tt(r.options.remotes,e);let n=e,s=o==null?void 0:o.expose,i=o?Z(o.remote):void 0,a;try{const{loadFactory:c=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:h,remote:m,expose:d,id:p,remoteSnapshot:y}=f;n=p,s=d,i=Z(m);const g=await l.get(p,d,t,y),_=await this.hooks.lifecycle.onLoad.emit({id:p,pkgNameOrAlias:h,expose:d,exposeModule:c?g:void 0,exposeModuleFactory:c?void 0:g,remote:m,options:u,moduleInstance:l,origin:r});return this.setIdToRemoteMap(e,f),a={id:n,expose:s,remote:i,options:t,origin:r},typeof _=="function"?_:g}catch(c){const{from:l="runtime"}=t||{from:"runtime"};let u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:l,lifecycle:"onLoad",expose:s,remote:i,origin:r})}catch(f){throw a={id:n,expose:s,remote:i,options:t,error:f,origin:r},f}if(!u)throw a={id:n,expose:s,remote:i,options:t,error:c,origin:r},c;return a={id:n,expose:s,remote:i,options:t,error:c,origin:r,recovered:!0},u}finally{a&&await this.hooks.lifecycle.afterLoadRemote.emit(a)}}async preloadRemote(e){const{host:t}=this,r=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const o=Fo(t.options.remotes,e),n=a=>{const{preloadConfig:c,remote:l}=a,u=c.exposes||[];return u.length?u.map(f=>({ops:{...a,preloadConfig:{...c,exposes:[f]}},id:je(l.name,f)})):[{ops:a,id:`${l.name}/*`}]};let s;await Promise.all(o.flatMap(n).map(async a=>{const{ops:c,id:l}=a,{remote:u,preloadConfig:f}=c,h=Z(u);try{const{globalSnapshot:m,remoteSnapshot:d}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:u,id:l,initiator:"preloadRemote"}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:c,remote:u,remoteInfo:h,globalSnapshot:m,remoteSnapshot:d});if(!p)return;const y=await Jt(h,t,p,!0,{initiator:"preloadRemote",id:l},f.recordPreloadedAssets);r.push({remote:u,remoteInfo:h,preloadConfig:f,id:l,results:y})}catch(m){r.push({remote:u,remoteInfo:h,preloadConfig:f,id:l,results:[{url:h.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(h.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:l,error:m}]})}}));const i=r.flatMap(a=>a.results.filter(c=>c.status==="error"||c.status==="timeout"));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:r,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:r,error:s}),s)throw s}registerRemotes(e,t){const{host:r}=this;e.forEach(o=>{this.registerRemote(o,r.options.remotes,{force:t==null?void 0:t.force})})}initRawContainer(e,t,r){const{host:o}=this,n=new ot({host:o,remoteInfo:Z({name:e,entry:t})});return n.remoteEntryExports=r,o.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(m){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:m,lifecycle:"beforeRequest"}),!o)throw m}const{id:n}=o,s=tt(t.options.remotes,n);if(!s)try{I(Dt,P,{hostName:t.options.name,requestId:n},void 0,H(t.options))}catch(m){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:m,origin:t}),m}const{remote:i}=s,a=Z(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:u}=c;L(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let f=t.moduleCache.get(l.name);const h={host:t,remoteInfo:a};return f||(f=new ot(h),t.moduleCache.set(l.name,f)),{module:f,moduleOptions:h,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:o}=this,n=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});L(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&&j&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=le),e.type||(e.type=Mt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=t.find(i=>i.name===e.name);if(!s)n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),lt(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:o}=e,n=r.options.remotes.findIndex(c=>c.name===o);n!==-1&&r.options.remotes.splice(n,1);const s=q(T.__FEDERATION__.moduleInfo,ie(e)).key;delete T.__FEDERATION__.moduleInfo[s],"entry"in e&&(r.snapshotHandler.manifestCache.delete(e.entry),delete we.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:i}=Qt(e,r);if(i){const c=i&&"remotesInfo"in i&&i.remotesInfo&&q(i.remotesInfo,e.name).key;c&&delete i.remotesInfo[c]}const a=r.moduleCache.get(e.name);if(a){const c=a.remoteInfo,l=c.entryGlobalName;T[l]&&((t=Object.getOwnPropertyDescriptor(T,l))!=null&&t.configurable?delete T[l]:T[l]=void 0);const u=zt(a.remoteInfo);G[u]&&delete G[u];let f=c.buildVersion?ct(c.name,c.buildVersion):c.name;const h=T.__FEDERATION__.__INSTANCES__.findIndex(m=>c.buildVersion?m.options.id===f:m.name===f);if(h!==-1){const m=T.__FEDERATION__.__INSTANCES__[h];f=m.options.id||f;const d=kt();let p=!0;const y=[];Object.keys(d).forEach(g=>{const _=d[g];_&&Object.keys(_).forEach(E=>{const R=_[E];R&&Object.keys(R).forEach(S=>{const b=R[S];b&&Object.keys(b).forEach($=>{const w=b[$];w&&typeof w=="object"&&w.from===c.name&&(w.loaded||w.loading?(w.useIn=w.useIn.filter(k=>k!==c.name),w.useIn.length?p=!1:y.push([g,E,S,$])):y.push([g,E,S,$]))})})})}),p&&(m.shareScopeMap={},delete d[f]),y.forEach(([g,_,E,R])=>{var S,b,$;($=(b=(S=d[g])==null?void 0:S[_])==null?void 0:b[E])==null||delete $[R]}),T.__FEDERATION__.__INSTANCES__.splice(h,1)}r.moduleCache.delete(e.name)}}catch(r){Ce.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const en=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Me=typeof FEDERATION_OPTIMIZE_NO_REMOTE=="boolean"?!FEDERATION_OPTIMIZE_NO_REMOTE:!0,nt=typeof FEDERATION_OPTIMIZE_NO_SHARED=="boolean"?!FEDERATION_OPTIMIZE_NO_SHARED:!0;var tn=class{constructor(e){this.hooks=new F({beforeInit:new Y("beforeInit"),init:new A,beforeInitContainer:new x("beforeInitContainer"),initContainer:new x("initContainer")}),this.version="2.9.2",this.moduleCache=new Map,this.loaderHook=new F({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new v,loadEntryError:new v,afterLoadEntry:new v("afterLoadEntry"),beforeInitRemote:new v("beforeInitRemote"),afterInitRemote:new v("afterInitRemote"),beforeGetExpose:new v("beforeGetExpose"),afterGetExpose:new v("afterGetExpose"),beforeExecuteFactory:new v("beforeExecuteFactory"),afterExecuteFactory:new v("afterExecuteFactory"),getModuleFactory:new v}),this.bridgeHook=new F({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A,afterBridgeRouteSync:new A});const t=Me&&en?[Vo(),Ko()]:[],r={id:Lo(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:j};this.name=e.name,this.options=r,this.snapshotHandler=Me?new Jo(this):new Zo,this.sharedHandler=nt?new Xo(this):new Yo,this.remoteHandler=Me?new Qo(this):new Wo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&I(_t(xt,P)),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=le,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){return this.remoteHandler.initRawContainer(e,t,r)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const r=nt?Pt(e,t).allShareInfos:{},{userOptions:o,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(n,o),{allShareInfos:i}=this.sharedHandler.registerShared(n,o),a=[...n.plugins];o.plugins&&o.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Do(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let rn=null;function er(e){return rn}Dr(tn);function tr(e,t){const r=o=>{if(!o.startsWith("/"))return o;const n=o.length>1&&o.endsWith("/"),s=`${t}/${o}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return n?`${s}/`:s};return e.map(o=>{const n={...o,path:r(o.path)};return typeof o.redirect=="string"?n.redirect=r(o.redirect):o.redirect&&typeof o.redirect=="object"&&"path"in o.redirect&&typeof o.redirect.path=="string"&&(n.redirect={...o.redirect,path:r(o.redirect.path)}),o.children&&o.children.length>0&&(n.children=tr(o.children,t)),n})}function on(e){const t=e.replace(/\/+$/,""),r=s=>s.startsWith("/")&&s!==t&&!s.startsWith(t+"/"),o=s=>`${t}${s}`.replace(/\/+/g,"/"),n=s=>typeof s=="string"?r(s)?o(s):s:"path"in s&&typeof s.path=="string"&&r(s.path)?{...s,path:o(s.path)}:s;return s=>{const i=s.push.bind(s),a=s.replace.bind(s),c=s.resolve.bind(s);s.push=l=>i(n(l)),s.replace=l=>a(n(l)),s.resolve=(l,...u)=>c(n(l),...u)}}function nn(e){const{router:t,basename:r,memoryRoute:o,hashRoute:n}=e,s=t.getRoutes().sort((m,d)=>m.path.split("/").filter(p=>p).length-d.path.split("/").filter(p=>p).length),i=new Map,a=new Set;s.forEach(m=>{const d=i.get(m.path)||[];d.push(m),i.set(m.path,d)});const c=(m,d)=>`${m}/${d}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(m,d="")=>{if(!m.children||m.children.length===0)return m;for(let p=0;p<m.children.length;p++){const y=m.children[p],g=c(d,y.path),E=(i.get(g)||[]).find(R=>!a.has(R)&&R!==m&&(y.name==null||R.name===y.name));if(E){const R={...E,path:y.path};m.children[p]=R,a.add(E),l(R,g)}}return m};let u=[];for(const m of s)if(!a.has(m)){const d=l(m,m.path);a.add(m),u.push(d)}let f,h;return o?f=pe.createMemoryHistory(r):n?(f=pe.createWebHashHistory(),r&&(u=tr(u,r),h=on(r))):f=pe.createWebHistory(r),{history:f,routes:u,patchRouter:h}}function sn(e){const t=new Map,r=er();return()=>({__APP_VERSION__:"2.9.2",async render(o){var p,y,g,_,E,R,S,b,$;D.debug("createBridgeComponent render Info",o);const{moduleName:n,dom:s,basename:i,memoryRoute:a,hashRoute:c,...l}=o,u={side:"producer",framework:"vue",operation:t.has(s)?"update":"render",reason:"direct"},f=ir.createApp(e.rootComponent,l);t.set(s,f);const h=await((g=(y=(p=r==null?void 0:r.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(o,u)),m=h&&typeof h=="object"&&(h!=null&&h.extraProps)?h==null?void 0:h.extraProps:{},d=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:c,...l,...m});if(d!=null&&d.router){const{history:w,routes:k,patchRouter:z}=nn({router:d.router,basename:o.basename,memoryRoute:o.memoryRoute,hashRoute:o.hashRoute}),ee=pe.createRouter({...d.router.options,history:w,routes:k});if(z&&z(ee),d.afterRouterCreate&&d.afterRouterCreate(ee),D.debug("createBridgeComponent render router info>>>",{moduleName:n,router:ee}),a){const or={action:"memory-route-init",to:a.entryPath,basename:i},nr={side:"producer",framework:"vue",operation:"route-sync",moduleName:n,route:or},sr=await ee.push(a.entryPath);(R=(E=(_=r==null?void 0:r.bridgeHook)==null?void 0:_.lifecycle)==null?void 0:E.afterBridgeRouteSync)==null||R.emit({context:nr,result:sr})}f.use(ee)}f.mount(s),($=(b=(S=r==null?void 0:r.bridgeHook)==null?void 0:S.lifecycle)==null?void 0:b.afterBridgeRender)==null||$.emit(o,{context:u})},destroy(o){var i,a,c,l,u,f;D.debug("createBridgeComponent destroy Info",o);const n=t.get(o==null?void 0:o.dom),s={side:"producer",framework:"vue",operation:"destroy",reason:"direct"};(c=(a=(i=r==null?void 0:r.bridgeHook)==null?void 0:i.lifecycle)==null?void 0:a.beforeBridgeDestroy)==null||c.emit(o,s),n==null||n.unmount(),(f=(u=(l=r==null?void 0:r.bridgeHook)==null?void 0:l.lifecycle)==null?void 0:u.afterBridgeDestroy)==null||f.emit(o,{context:s})}})}function an(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const cn=N.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=N.ref(null),r=N.ref(null),o=N.ref(""),n=N.ref(!1),s=N.ref(!1),i=N.ref(!1),a=He.useRoute(),c=er(),l=N.useAttrs(),u=()=>({name:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute}),f=async()=>{var _,E,R,S,b,$,w;if(!t.value||n.value)return;const d=(_=e.providerInfo)==null?void 0:_.call(e);r.value=d;let p={...l,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",p);const y={side:"consumer",framework:"vue",operation:"render"},g=await((S=(R=(E=c==null?void 0:c.bridgeHook)==null?void 0:E.lifecycle)==null?void 0:R.beforeBridgeRender)==null?void 0:S.emit(p,y))||{};p={...p,...g.extraProps},d.render(p),n.value=!0,(w=($=(b=c==null?void 0:c.bridgeHook)==null?void 0:b.lifecycle)==null?void 0:$.afterBridgeRender)==null||w.emit(p,{context:y})},h=()=>{var g,_,E,R,S,b;const d=r.value;if(!d||!n.value)return;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e});const p=u(),y={side:"consumer",framework:"vue",operation:"destroy"};(E=(_=(g=c==null?void 0:c.bridgeHook)==null?void 0:g.lifecycle)==null?void 0:_.beforeBridgeDestroy)==null||E.emit(p,y),d.destroy({dom:t.value,moduleName:e.moduleName}),r.value=null,n.value=!1,(b=(S=(R=c==null?void 0:c.bridgeHook)==null?void 0:R.lifecycle)==null?void 0:S.afterBridgeDestroy)==null||b.emit(p,{context:y})},m=N.watch(()=>a==null?void 0:a.path,d=>{var p,y,g;if(s.value&&o.value!==""&&o.value!==d){D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:a.path});const _={action:"host-to-remote",mechanism:"popstate",from:o.value,to:d,basename:e.basename},E={side:"consumer",framework:"vue",operation:"route-sync",moduleName:e.moduleName,route:_};an(),(g=(y=(p=c==null?void 0:c.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.afterBridgeRouteSync)==null||g.emit({context:E})}o.value=d});return N.onMounted(()=>{s.value=!0,f()}),N.onActivated(async()=>{s.value=!0,i.value&&(i.value=!1,await N.nextTick(),f())}),N.onDeactivated(()=>{s.value=!1,i.value=!0,h()}),N.onBeforeUnmount(()=>{m(),h()}),()=>N.createVNode("div",N.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function rr(e){return N.defineAsyncComponent({__APP_VERSION__:"2.9.2",...e.asyncComponentOptions,loader:async()=>{var c,l;const t=He.useRoute();let r="/";const o=(l=(c=t==null?void 0:t.matched)==null?void 0:c[0])==null?void 0:l.path;o&&(o.endsWith("/:pathMatch(.*)*")?r=o.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const n=(e==null?void 0:e.export)||"default";D.debug("createRemoteAppComponent LazyComponent create >>>",{basename:r,info:e});const s=await e.loader(),i=s&&s[Symbol.for("mf_module_id")],a=s[n];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:n,basename:r,route:t}),n in s&&typeof a=="function")return{render(){return N.h(cn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function ln(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),rr(e)}exports.createBridgeComponent=sn;exports.createRemoteAppComponent=rr;exports.createRemoteComponent=ln;
|