@module-federation/bridge-vue3 2.2.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @module-federation/bridge-vue3
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [eb26065]
8
+ - Updated dependencies [8f2ec9b]
9
+ - @module-federation/sdk@2.3.0
10
+ - @module-federation/runtime@2.3.0
11
+ - @module-federation/bridge-shared@2.3.0
12
+
3
13
  ## 2.2.3
4
14
 
5
15
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("vue"),Oe=require("vue-router");function ze(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Gt=ze(v),ce=ze(Oe),xt=".json",Ut="FEDERATION_DEBUG",Vt=":";let $e=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const H=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function Je(){return H}function Xe(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function Bt(){try{if(Je()&&window.localStorage)return!!localStorage.getItem(Ut)}catch{return!1}return!1}function we(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Bt()}const Wt="[ Federation Runtime ]",Ye=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${Vt}${r}`:r:t,""):""},Ne=(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?!Je()&&!Xe()&&"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),"")},Ze=e=>{console.warn(`${Wt}: ${e}`)};function Qe(e){try{return JSON.stringify(e,null,2)}catch{return""}}const oe=(e,t)=>{if(!e)return t;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const s=o.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return o})(e);return n?n.endsWith("/")?`${n}${t}`:`${n}/${t}`:t};function jt(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function qt(e,t={}){var E,b,N;const{remotes:r={},overrides:n={},version:o}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&o?jt(o):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(n);let l={};Object.keys(r).length||(l=((E=e.remotes)==null?void 0:E.reduce((_,$)=>{let R;const w=$.federationContainerName;return a.includes(w)?R=n[w]:"version"in $?R=$.version:R=$.entry,_[w]={matchedVersion:R},_},{}))||{}),Object.keys(r).forEach(_=>l[_]={matchedVersion:a.includes(_)?n[_]:r[_]});const{remoteEntry:{path:c,name:f,type:h},types:u={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:d},globalName:m,ssrRemoteEntry:y}=e.metaData,{exposes:g}=e;let p={version:o||"",buildVersion:d,globalName:m,remoteEntry:oe(c,f),remoteEntryType:h,remoteTypes:oe(u.path,u.name),remoteTypesZip:u.zip||"",remoteTypesAPI:u.api||"",remotesInfo:l,shared:e==null?void 0:e.shared.map(_=>({assets:_.assets,sharedName:_.name,version:_.version,usedExports:_.referenceExports||[]})),modules:g==null?void 0:g.map(_=>({moduleName:_.name,modulePath:_.path,assets:_.assets}))};if((b=e.metaData)!=null&&b.prefetchInterface){const _=e.metaData.prefetchInterface;p={...p,prefetchInterface:_}}if((N=e.metaData)!=null&&N.prefetchEntry){const{path:_,name:$,type:R}=e.metaData.prefetchEntry;p={...p,prefetchEntry:oe(_,$),prefetchEntryType:R}}if("publicPath"in e.metaData?(s={...p,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...p,getPublicPath:i()},y){const _=oe(y.path,y.name);s.ssrRemoteEntry=_,s.ssrRemoteEntryType=y.type||"commonjs-module"}return s}function et(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(xt))}const Kt="[ Module Federation ]",X=console,zt=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Jt(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
2
2
  `),r=t.filter(n=>!zt.some(o=>n.includes(o)));return r.length?`Stack trace:
3
3
  ${r.slice(0,5).join(`
4
- `)}`:void 0}catch{return}}var tt=class{constructor(e,t=X){this.prefix=e,this.delegate=t??X}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??X}emit(e,t){const r=this.delegate,n=we()?Jt():void 0,o=n?[...t,n]: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,...o);return}}for(const i of s){const a=X[i];if(typeof a=="function"){a.call(X,this.prefix,...o);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){we()&&this.emit("debug",e)}};function rt(e){return new tt(e)}function Xt(e){const t=new tt(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Xt(Kt);async function nt(e,t){try{return await e()}catch(r){Ze(r);return}}function Ie(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function ot(e){let t=null,r=!0,n=2e4,o;const s=document.getElementsByTagName("script");for(let c=0;c<s.length;c++){const f=s[c],h=f.getAttribute("src");if(h&&Ie(h,e.url)){t=f,r=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=(c==null?void 0:c.type)==="module"?"module":"text/javascript";let f;e.createScriptHook&&(f=e.createScriptHook(e.url,e.attrs),f instanceof HTMLScriptElement?t=f:typeof f=="object"&&("script"in f&&f.script&&(t=f.script),"timeout"in f&&f.timeout&&(n=f.timeout))),t.src||(t.src=e.url),c&&!f&&Object.keys(c).forEach(h=>{t&&(h==="async"||h==="defer"?t[h]=c[h]:t.getAttribute(h)||t.setAttribute(h,c[h]))})}let i=null;const a=typeof window<"u"?c=>{if(c.filename&&Ie(c.filename,e.url)){const f=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);f.name="ScriptExecutionError",i=f}}:null;a&&window.addEventListener("error",a);const l=async(c,f)=>{clearTimeout(o),a&&window.removeEventListener("error",a);const h=()=>{if((f==null?void 0:f.type)==="error"){const u=new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);u.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}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,nt(()=>{const{needDeleteScript:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const u=c(f);if(u instanceof Promise){const d=await u;return h(),d}return h(),u}h()};return t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o=setTimeout(()=>{l(null,new Error(`Remote script "${e.url}" time-outed.`))},n),{script:t,needAttach:r}}function Ee(e){let t=null,r=!0;const n=document.getElementsByTagName("link");for(let s=0;s<n.length;s++){const i=n[s],a=i.getAttribute("href"),l=i.getAttribute("rel");if(a&&Ie(a,e.url)&&l===e.attrs.rel){t=i,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let s;const i=e.attrs;e.createLinkHook&&(s=e.createLinkHook(e.url,i),s instanceof HTMLLinkElement&&(t=s)),i&&!s&&Object.keys(i).forEach(a=>{t&&!t.getAttribute(a)&&t.setAttribute(a,i[a])})}const o=(s,i)=>{const a=()=>{(i==null?void 0:i.type)==="error"?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,nt(()=>{const{needDeleteLink:l=!0}=e;l&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),s)){const l=s(i);return a(),l}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function Yt(e,t){const{attrs:r={},createScriptHook:n}=t;return new Promise((o,s)=>{const{script:i,needAttach:a}=ot({url:e,cb:o,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}const se=new Map;function B(e){if(!e)throw new Error("import specifier is required");if(se.has(e))return se.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),se.delete(e),r});return se.set(e,t),t}const st=async()=>{const e=await B("node-fetch");return e.default||e},Zt=async(e,t,r)=>{const o=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!o||!(o instanceof Response)?(typeof fetch>"u"?await st():fetch)(e,t||{}):o},Qt=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,n)=>{if(n!=null&&n.createScriptHook){const a=n.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let o;try{o=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>n!=null&&n.fetch?(a,l)=>Zt(a,l,n):typeof fetch>"u"?st():fetch,i=async(a,l)=>{var c;try{const h=await(await a(l.href)).text(),[u,d]=await Promise.all([B("path"),B("vm")]),m={exports:{},module:{exports:{}}},y=l.pathname.split("/").slice(0,-1).join("/"),g=u.basename(l.pathname),p=new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
4
+ `)}`:void 0}catch{return}}var tt=class{constructor(e,t=X){this.prefix=e,this.delegate=t??X}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??X}emit(e,t){const r=this.delegate,n=we()?Jt():void 0,o=n?[...t,n]: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,...o);return}}for(const i of s){const a=X[i];if(typeof a=="function"){a.call(X,this.prefix,...o);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){we()&&this.emit("debug",e)}};function rt(e){return new tt(e)}function Xt(e){const t=new tt(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Xt(Kt);async function nt(e,t){try{return await e()}catch(r){Ze(r);return}}function Ie(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function ot(e){let t=null,r=!0,n=2e4,o;const s=document.getElementsByTagName("script");for(let c=0;c<s.length;c++){const f=s[c],h=f.getAttribute("src");if(h&&Ie(h,e.url)){t=f,r=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=(c==null?void 0:c.type)==="module"?"module":"text/javascript";let f;e.createScriptHook&&(f=e.createScriptHook(e.url,e.attrs),f instanceof HTMLScriptElement?t=f:typeof f=="object"&&("script"in f&&f.script&&(t=f.script),"timeout"in f&&f.timeout&&(n=f.timeout))),t.src||(t.src=e.url),c&&!f&&Object.keys(c).forEach(h=>{t&&(h==="async"||h==="defer"?t[h]=c[h]:t.getAttribute(h)||t.setAttribute(h,c[h]))})}let i=null;const a=typeof window<"u"?c=>{if(c.filename&&Ie(c.filename,e.url)){const f=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);f.name="ScriptExecutionError",i=f}}:null;a&&window.addEventListener("error",a);const l=async(c,f)=>{clearTimeout(o),a&&window.removeEventListener("error",a);const h=()=>{if((f==null?void 0:f.type)==="error"){const u=new Error(f!=null&&f.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.)`);u.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}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,nt(()=>{const{needDeleteScript:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const u=c(f);if(u instanceof Promise){const d=await u;return h(),d}return h(),u}h()};return t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o=setTimeout(()=>{l(null,{type:"error",isTimeout:!0})},n),{script:t,needAttach:r}}function Ee(e){let t=null,r=!0;const n=document.getElementsByTagName("link");for(let s=0;s<n.length;s++){const i=n[s],a=i.getAttribute("href"),l=i.getAttribute("rel");if(a&&Ie(a,e.url)&&l===e.attrs.rel){t=i,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let s;const i=e.attrs;e.createLinkHook&&(s=e.createLinkHook(e.url,i),s instanceof HTMLLinkElement&&(t=s)),i&&!s&&Object.keys(i).forEach(a=>{t&&!t.getAttribute(a)&&t.setAttribute(a,i[a])})}const o=(s,i)=>{const a=()=>{(i==null?void 0:i.type)==="error"?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,nt(()=>{const{needDeleteLink:l=!0}=e;l&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),s)){const l=s(i);return a(),l}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function Yt(e,t){const{attrs:r={},createScriptHook:n}=t;return new Promise((o,s)=>{const{script:i,needAttach:a}=ot({url:e,cb:o,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}const se=new Map;function B(e){if(!e)throw new Error("import specifier is required");if(se.has(e))return se.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),se.delete(e),r});return se.set(e,t),t}const st=async()=>{const e=await B("node-fetch");return e.default||e},Zt=async(e,t,r)=>{const o=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!o||!(o instanceof Response)?(typeof fetch>"u"?await st():fetch)(e,t||{}):o},Qt=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,n)=>{if(n!=null&&n.createScriptHook){const a=n.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let o;try{o=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>n!=null&&n.fetch?(a,l)=>Zt(a,l,n):typeof fetch>"u"?st():fetch,i=async(a,l)=>{var c;try{const h=await(await a(l.href)).text(),[u,d]=await Promise.all([B("path"),B("vm")]),m={exports:{},module:{exports:{}}},y=l.pathname.split("/").slice(0,-1).join("/"),g=u.basename(l.pathname),p=new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
5
5
  })`,{filename:g,importModuleDynamically:((c=d.constants)==null?void 0:c.USE_MAIN_CONTEXT_DEFAULT_LOADER)??B});let E;E=(await B("node:module")).createRequire(l.protocol==="file:"||l.protocol==="node:"?l.href:u.join(process.cwd(),"__mf_require_base__.js")),p.runInThisContext()(m.exports,m.module,E,y,g);const b=m.module.exports||m.exports;if(r&&b&&r.globalName){t(void 0,b[r.globalName]||b);return}t(void 0,b)}catch(f){t(f instanceof Error?f:new Error(`Script execution error: ${f}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return Te(o.href,{fetch:a,vm:await B("vm")}).then(async l=>{await l.evaluate(),t(void 0,l.namespace)}).catch(l=>{t(l instanceof Error?l:new Error(`Script execution error: ${l}`))});i(a,o)}).catch(a=>{t(a)})}:(e,t,r,n)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},er=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,n)=>{Qt(e,(o,s)=>{var i,a;if(o)n(o);else{const l=((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[l]=s)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},_e=new Map;async function Te(e,t){if(_e.has(e))return _e.get(e);const{fetch:r,vm:n}=t,o=await(await r(e)).text(),s=new n.SourceTextModule(o,{importModuleDynamically:async(i,a)=>{const l=new URL(i,e).href;return Te(l,t)}});return _e.set(e,s),await s.link(async i=>{const a=new URL(i,e).href;return await Te(a,t)}),s}const D=rt("[ Module Federation Bridge Vue3 ]"),tr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,it=(e,t,r,n)=>{const o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(tr(e)),n&&o.push(`Original Error Message:
6
6
  ${n}`),o.join(`
7
- `)};function rr(e,t,r,n,o,s){return n(it(e,t,r,o))}const G="[ Federation Runtime ]",ve=rt(G);function k(e,t,r,n,o){e||S(t)}function S(e,t,r,n,o){if(t!==void 0)return rr(e,t,r??{},i=>{throw new Error(`${G}: ${i}`)},n);const s=e;throw s instanceof Error?(s.message.startsWith(G)||(s.message=`${G}: ${s.message}`),s):new Error(`${G}: ${s}`)}function Le(e){e instanceof Error&&(e.message.startsWith(G)||(e.message=`${G}: ${e.message}`)),ve.warn(e)}function nr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function Q(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Me(e){return typeof e.entry<"u"}function at(e){return!e.entry.includes(".json")}function Ce(e){return e&&typeof e=="object"}const or=Object.prototype.toString;function sr(e){return or.call(e)==="[object Object]"}function ct(e){return Array.isArray(e)?e:[e]}function lt(e){const t={url:"",type:"global",globalName:""};return H||Xe()||!("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 ir=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},I=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return I}})(),ee=O;function le(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function ue(e,t){return Object.hasOwnProperty.call(e,t)}ue(I,"__GLOBAL_LOADING_REMOTE_ENTRY__")||le(I,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const W=I.__GLOBAL_LOADING_REMOTE_ENTRY__;function ut(e){var t,r,n,o,s,i;ue(e,"__VMOK__")&&!ue(e,"__FEDERATION__")&&le(e,"__FEDERATION__",e.__VMOK__),ue(e,"__FEDERATION__")||(le(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),le(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(n=e.__FEDERATION__).moduleInfo??(n.moduleInfo={}),(o=e.__FEDERATION__).__SHARE__??(o.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map)}ut(I);ut(O);function ar(e,t=we()){t&&(I.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.2.3")}function K(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const n of r){const[o,s]=n.split(":"),i=`${o}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const xe=()=>O.__FEDERATION__.moduleInfo,cr=(e,t)=>{const r=K(t,Q(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:n,...o}=e,s=Q(o),i=K(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===n)return i}},fe=e=>cr(e,O.__FEDERATION__.moduleInfo),Ue=(e,t)=>{const r=Q(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},lr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),De=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:I[r]}},ur=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,fr=e=>I.__FEDERATION__.__PRELOADED_MAP__.get(e),hr=e=>I.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Ve="[0-9A-Za-z-]+",Fe=`(?:\\+(${Ve}(?:\\.${Ve})*))`,Z="0|[1-9]\\d*",he="[0-9]+",ft="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Be=`(?:${he}|${ft})`,dr=`(?:-?(${Be}(?:\\.${Be})*))`,We=`(?:${Z}|${ft})`,ht=`(?:-(${We}(?:\\.${We})*))`,be=`${Z}|x|X|\\*`,z=`[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ht})?${Fe}?)?)?`,mr=`^\\s*(${z})\\s+-\\s+(${z})\\s*$`,pr=`[v=\\s]*${`(${he})\\.(${he})\\.(${he})`}${dr}?${Fe}?`,He="((?:<|>)?=?)",yr=`(\\s*)${He}\\s*(${pr}|${z})`,dt="(?:~>?)",gr=`(\\s*)${dt}\\s+`,mt="(?:\\^)",Er=`(\\s*)${mt}\\s+`,_r="(<|>)?=?\\s*\\*",br=`^${mt}${z}$`,Rr=`v?${`(${Z})\\.(${Z})\\.(${Z})`}${ht}?${Fe}?`,Sr=`^${dt}${z}$`,$r=`^${He}\\s*${z}$`,wr=`^${He}\\s*(${Rr})$|^$`,Nr="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function T(e){return!e||e.toLowerCase()==="x"||e==="*"}function pt(...e){return t=>e.reduce((r,n)=>n(r),t)}function je(e){return e.match(C(wr))}function qe(e,t,r,n){const o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function Ir(e){return e.replace(C(mr),(t,r,n,o,s,i,a,l,c,f,h,u)=>(T(n)?r="":T(o)?r=`>=${n}.0.0`:T(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,T(c)?l="":T(f)?l=`<${Number(c)+1}.0.0-0`:T(h)?l=`<${c}.${Number(f)+1}.0-0`:u?l=`<=${c}.${f}.${h}-${u}`:l=`<=${l}`,`${r} ${l}`.trim()))}function Tr(e){return e.replace(C(yr),"$1$2$3")}function vr(e){return e.replace(C(gr),"$1~")}function Ar(e){return e.replace(C(Er),"$1^")}function Pr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(br),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function kr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Sr),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function Or(e){return e.split(/\s+/).map(t=>t.trim().replace(C($r),(r,n,o,s,i,a)=>{const l=T(o),c=l||T(s),f=c||T(i);return n==="="&&f&&(n=""),a="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(s=0),i=0,n===">"?(n=">=",c?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",c?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):c?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:f?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).join(" ")}function Lr(e){return e.trim().replace(C(_r),"")}function Mr(e){return e.trim().replace(C(Nr),"")}function de(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Cr(e,t){const{preRelease:r}=e,{preRelease:n}=t;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?de(i,a):-1:1}return 0}function ie(e,t){return de(e.major,t.major)||de(e.minor,t.minor)||de(e.patch,t.patch)||Cr(e,t)}function Re(e,t){return e.version===t.version}function Dr(e,t){switch(e.operator){case"":case"=":return Re(e,t);case">":return ie(e,t)<0;case">=":return Re(e,t)||ie(e,t)<0;case"<":return ie(e,t)>0;case"<=":return Re(e,t)||ie(e,t)>0;case void 0:return!0;default:return!1}}function Fr(e){return pt(Pr,kr,Or,Lr)(e)}function Hr(e){return pt(Ir,Tr,vr,Ar)(e.trim()).split(/\s+/).join(" ")}function Y(e,t){if(!e)return!1;const r=je(e);if(!r)return!1;const[,n,,o,s,i,a]=r,l={operator:n,version:qe(o,s,i,a),major:o,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},c=t.split("||");for(const f of c){const h=f.trim();if(!h||h==="*"||h==="x")return!0;try{const u=Hr(h);if(!u.trim())return!0;const d=u.split(" ").map(g=>Fr(g)).join(" ");if(!d.trim())return!0;const m=d.split(/\s+/).map(g=>Mr(g)).filter(Boolean);if(m.length===0)continue;let y=!0;for(const g of m){const p=je(g);if(!p){y=!1;break}const[,E,,b,N,_,$]=p;if(!Dr({operator:E,version:qe(b,N,_,$),major:b,minor:N,patch:_,preRelease:$==null?void 0:$.split(".")},l)){y=!1;break}}if(y)return!0}catch(u){console.error(`[semver] Error processing range part "${h}":`,u);continue}}return!1}const ne="default",yt="global";function Gr(e,t,r,n){var s,i;let o;return"get"in e?o=e.get:"lib"in e?o=()=>Promise.resolve(e.lib):o=()=>Promise.resolve(()=>{S(`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)&&S(`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:o,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??n)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??$e.UNKNOWN,useIn:[]}:void 0}}function gt(e,t){const r=t.shared||{},n=t.name,o=Object.keys(r).reduce((i,a)=>{const l=ct(r[a]);return i[a]=i[a]||[],l.forEach(c=>{i[a].push(Gr(c,n,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(l=>l.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{allShareInfos:s,newShareInfos:o}}function te(e,t){if(!e)return!1;const{status:r,mode:n}=e;return r===$e.NO_USE?!1:r===$e.CALCULATED?!0:n==="runtime-infer"?t?Ur(e,t):!0:!1}function x(e,t){const r=n=>{if(!Number.isNaN(Number(n))){const o=n.split(".");let s=n;for(let i=0;i<3-o.length;i++)s+=".0";return s}return n};return!!Y(r(e),`<=${r(t)}`)}const re=(e,t)=>{const r=t||function(n,o){return x(n,o)};return Object.keys(e).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},pe=e=>!!e.loaded||typeof e.lib=="function",xr=e=>!!e.loading,Ur=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(n=>r.includes(n)):!1};function Vr(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){return i?o[l].treeShaking?o[c].treeShaking?!pe(o[l].treeShaking)&&x(l,c):!1:!0:!pe(o[l])&&x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}const U=e=>pe(e)||xr(e);function Br(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){if(i){if(!o[l].treeShaking)return!0;if(!o[c].treeShaking)return!1;if(U(o[c].treeShaking))return U(o[l].treeShaking)?!!x(l,c):!0;if(U(o[l].treeShaking))return!1}return U(o[c])?U(o[l])?!!x(l,c):!0:U(o[l])?!1:x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}function Wr(e){return e==="loaded-first"?Br:Vr}function me(e,t,r,n){if(!e)return;const{shareConfig:o,scope:s=ne,strategy:i,treeShaking:a}=r,l=Array.isArray(s)?s:[s];for(const c of l)if(o&&e[c]&&e[c][t]){const{requiredVersion:f}=o,{version:h,useTreesShaking:u}=Wr(i)(e,c,t,a),d=()=>{const y=e[c][t][h];if(o.singleton){if(typeof f=="string"&&!Y(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})`;o.strictVersion?S(g):Le(g)}return{shared:y,useTreesShaking:u}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:u};if(Y(h,f))return{shared:y,useTreesShaking:u};const g=te(a);if(g){for(const[p,E]of Object.entries(e[c][t]))if(te(E.treeShaking,a==null?void 0:a.usedExports)&&Y(p,f))return{shared:E,useTreesShaking:g}}for(const[p,E]of Object.entries(e[c][t]))if(Y(p,f))return{shared:E,useTreesShaking:!1}}},m={shareScopeMap:e,scope:c,pkgName:t,version:h,GlobalFederation:ee.__FEDERATION__,shareInfo:r,resolver:d};return(n.emit(m)||m).resolver()}}function Et(){return ee.__FEDERATION__.__SHARE__}function Ke(e){const{pkgName:t,extraOptions:r,shareInfos:n}=e,o=l=>{if(!l)return;const c={};return l.forEach(h=>{c[h.version]=h}),c[re(c,function(h,u){return!pe(c[h])&&x(h,u)})]},s=(r==null?void 0:r.resolver)??o,i=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),a=(...l)=>{const c={};for(const f of l)if(f)for(const[h,u]of Object.entries(f)){const d=c[h];i(d)&&i(u)?c[h]=a(d,u):u!==void 0&&(c[h]=u)}return c};return a(s(n[t]),r==null?void 0:r.customShareInfo)}const V=(e,t)=>{e.useIn||(e.useIn=[]),nr(e.useIn,t)};function ae(e,t){return t&&e.treeShaking?e.treeShaking:e}function jr(e,t){for(const r of e){const n=t.startsWith(r.name);let o=t.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")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 qr(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const _t="RUNTIME-001",bt="RUNTIME-002",Rt="RUNTIME-003",St="RUNTIME-004",$t="RUNTIME-005",Ae="RUNTIME-006",wt="RUNTIME-007",Ge="RUNTIME-008",Kr="RUNTIME-009",Nt="RUNTIME-010",It="RUNTIME-011",L={[_t]:"Failed to get remoteEntry exports.",[bt]:'The remote entry interface does not contain "init"',[Rt]:"Failed to get manifest.",[St]:"Failed to locate remote.",[$t]:"Invalid loadShareSync function call from bundler runtime",[Ae]:"Invalid loadShareSync function call from runtime",[wt]:"Failed to get remote snapshot.",[Ge]:"Failed to load script resources.",[Kr]:"Please call createInstance first.",[Nt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[It]:"The remoteEntry URL is missing from the remote snapshot."};({...L});const Tt=".then(callbacks[0]).catch(callbacks[1])";async function zr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Tt}`)([r,n]):import(e).then(r).catch(n)}catch(o){S(`Failed to load ESM entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}async function Jr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(n):new Function("callbacks",`System.import("${e}")${Tt}`)([r,n])}catch(o){S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}function vt(e,t,r){const{remoteEntryKey:n,entryExports:o}=De(e,t);return o||S(_t,L,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n}),o}async function Xr({name:e,globalName:t,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:s}=De(e,t);if(s)return s;const i=o?o(r):r;return Yt(i,{attrs:{},createScriptHook:(a,l)=>{const c=n.lifecycle.createScript.emit({url:a,attrs:l});if(c&&(c instanceof HTMLScriptElement||"script"in c||"timeout"in c))return c}}).then(()=>vt(e,t,r),a=>{const l=a instanceof Error?a.message:String(a);S(Ge,L,{remoteName:e,resourceUrl:i},l)})}async function Yr({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:s,name:i,type:a}=e;switch(a){case"esm":case"module":return zr({entry:o,remoteEntryExports:t});case"system":return Jr({entry:o,remoteEntryExports:t});default:return Xr({entry:o,globalName:s,name:i,loaderHook:r,getEntryUrl:n})}}async function Zr({remoteInfo:e,loaderHook:t}){const{entry:r,entryGlobalName:n,name:o,type:s}=e,{entryExports:i}=De(o,n);return i||er(r,{attrs:{name:o,globalName:n,type:s},loaderHook:{createScriptHook:(a,l={})=>{const c=t.lifecycle.createScript.emit({url:a,attrs:l});if(c&&"url"in c)return c}}}).then(()=>vt(o,n,r)).catch(a=>{S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error?a.message:String(a)}`)})}function Pe(e){const{entry:t,name:r}=e;return Ye(r,t)}async function ye(e){const{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:s=!1}=e,i=Pe(n);if(r)return r;if(!W[i]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;W[i]=a.emit({loaderHook:l,remoteInfo:n,remoteEntryExports:r}).then(c=>c||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":H)?Yr({remoteInfo:n,remoteEntryExports:r,loaderHook:l,getEntryUrl:o}):Zr({remoteInfo:n,loaderHook:l}))).catch(async c=>{const f=Pe(n),h=c instanceof Error&&c.message.includes("ScriptExecutionError");if(c instanceof Error&&c.message.includes(Ge)&&!h&&!s){const u=m=>ye({...m,_inErrorHandling:!0}),d=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:u,origin:t,remoteInfo:n,remoteEntryExports:r,globalLoading:W,uniqueKey:f});if(d)return d}throw c})}return W[i]}function ke(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||yt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||ne}}function Qr(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function en(e,t){const r=ur(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(o=>{e!=null&&e.find(s=>s.name!==o.name)&&e.push(o)}),e&&e.length>0&&e.forEach(o=>{n.forEach(s=>{s.applyPlugin(o,t)})}),e}function tn(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 J(e){var r,n,o,s,i,a;const t={};for(const[l,c]of Object.entries(e.shared)){const f=c[0];f&&(t[l]={version:f.version,singleton:(r=f.shareConfig)==null?void 0:r.singleton,requiredVersion:((n=f.shareConfig)==null?void 0:n.requiredVersion)===!1?!1:(o=f.shareConfig)==null?void 0:o.requiredVersion,eager:f.eager,strictVersion:(s=f.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(tn))??[],shared:t}}}function At(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...e}}function rn(e,t){return t.map(r=>{const n=qr(e,r.nameOrAlias);return k(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&Qe({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:At(r)}})}function nn(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Pt(e,t,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;if(t.options.inBrowser){if(i.forEach(a=>{const{moduleInfo:l}=a,c=t.moduleCache.get(e.name);ye(c?{origin:t,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:t,remoteInfo:l,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d},needDeleteLink:!1});f&&document.head.appendChild(c)})}if(n){const a={rel:"preload",as:"script"};s.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={fetchpriority:"high",type:(e==null?void 0:e.type)==="module"?"module":"text/javascript"};s.forEach(l=>{const{script:c,needAttach:f}=ot({url:l,cb:()=>{},attrs:a,createScriptHook:(h,u)=>{const d=t.loaderHook.lifecycle.createScript.emit({url:h,attrs:u});if(d instanceof HTMLScriptElement)return d},needDeleteScript:!0});f&&document.head.appendChild(c)})}}}function on(e,t,r){const n=t,o=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];o.length||o.push("default"),o.forEach(i=>{n[i]||(n[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?o:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:n,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:n[o[0]],initScope:r??[]}}var kt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await ye({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return k(e,`remoteEntryExports is undefined
8
- ${Qe(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=on(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&S(bt,L,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,J(this.host.options)),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),k(i,`${Q(this.remoteInfo)} remote don't export ${t}.`);const a=ir(this.remoteInfo.name,t),l=this.wraperFactory(i,a);return o?await l():l}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}},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(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},P=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n<r.length?Promise.resolve(r[n++].apply(null,e)).then(o):s;t=o()}return Promise.resolve(t)}};function Ot(e,t){if(!Ce(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var j=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(Ot(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){Le(r),this.onerror(r)}return e}},F=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`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 n=s=>(Le(s),this.onerror(s),e),o=s=>{if(Ot(e,s)){if(e=s,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(i){return n(i)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}},q=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var n;k(sr(e),"Plugin configuration is invalid.");const r=e.name;k(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,(n=e.apply)==null||n.call(e,t),Object.keys(this.lifecycle).forEach(o=>{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){k(e,"A name is required.");const t=this.registerPlugins[e];k(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};function Lt(e,t){const r=lt(t);r.url||S(It,L,{remoteName:e.name});let n=Ne(t,r.url);!H&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function sn(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!Me(t)||!at(t)){const{remoteSnapshot:a,globalSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Lt(s,a);const c={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},f=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:l});return f&&Pt(s,o,f,!1),{...e,remoteSnapshot:a}}return e}}}function an(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 Mt(e,t,r,n,o={},s){const{value:i}=K(e,Q(t)),a=s||i;if(a&&!et(a)&&(r(a,t,n),a.remotesInfo)){const l=Object.keys(a.remotesInfo);for(const c of l){if(o[c])continue;o[c]=!0;const f=an(c),h=a.remotesInfo[c];Mt(e,{name:f.name,version:h.matchedVersion},r,!1,o,void 0)}}}const Se=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function cn(e,t,r,n,o){const s=[],i=[],a=[],l=new Set,c=new Set,{options:f}=e,{preloadConfig:h}=t,{depsRemote:u}=h;if(Mt(n,r,(m,y,g)=>{var $;let p;if(g)p=h;else if(Array.isArray(u)){const R=u.find(w=>w.nameOrAlias===y.name||w.nameOrAlias===y.alias);if(!R)return;p=At(R)}else if(u===!0)p=h;else return;const E=Ne(m,lt(m).url);E&&a.push({name:y.name,moduleInfo:{name:y.name,entry:E,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:y.name,shareScope:"",version:"version"in m?m.version:void 0},url:E});let b="modules"in m?m.modules:[];const N=nn(p.exposes);N.length&&"modules"in m&&(b=($=m==null?void 0:m.modules)==null?void 0:$.reduce((R,w)=>((N==null?void 0:N.indexOf(w.moduleName))!==-1&&R.push(w),R),[]));function _(R){const w=R.map(M=>Ne(m,M));return p.filter?w.filter(p.filter):w}if(b){const R=b.length;for(let w=0;w<R;w++){const M=b[w],ge=`${y.name}/${M.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:M.moduleName==="."?y.name:ge,name:y.name,remoteSnapshot:m,preloadConfig:p,remote:y,origin:e}),!fr(ge)&&(p.resourceCategory==="all"?(s.push(..._(M.assets.css.async)),s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.async)),i.push(..._(M.assets.js.sync))):p.resourceCategory==="sync"&&(s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.sync))),hr(ge))}}},!0,{},o),o.shared&&o.shared.length>0){const m=(y,g)=>{const{shared:p}=me(e.shareScopeMap,g.sharedName,y,e.sharedHandler.hooks.lifecycle.resolveShare)||{};p&&typeof p.lib=="function"&&(g.assets.js.sync.forEach(E=>{l.add(E)}),g.assets.css.sync.forEach(E=>{c.add(E)}))};o.shared.forEach(y=>{var E;const g=(E=f.shared)==null?void 0:E[y.sharedName];if(!g)return;const p=y.version?g.find(b=>b.version===y.version):g;p&&ct(p).forEach(b=>{m(b,y)})})}const d=i.filter(m=>!l.has(m)&&!Se("script",m));return{cssAssets:s.filter(m=>!c.has(m)&&!Se("link",m)),jsAssetsWithoutEntry:d,entryAssets:a.filter(m=>!Se("script",m.url))}}const ln=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return H?Me(o)&&at(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Lt(n,i),cn(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Ct(e,t){const r=fe({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&K(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:"version"in e?e.version:void 0})}}var un=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new q({beforeLoadRemoteSnapshot:new P("beforeLoadRemoteSnapshot"),loadSnapshot:new F("loadGlobalSnapshot"),loadRemoteSnapshot:new F("loadRemoteSnapshot"),afterLoadSnapshot:new F("afterLoadSnapshot")}),this.manifestLoading=ee.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=fe({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},lr({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!K(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let f,h;if(l)if(et(l)){const u=H?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",d=await this.getManifestJson(u,e,{}),m=Ue({...e,entry:u},d);f=d,h=m}else{const{remoteSnapshot:u}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});f=u,h=c}else if(Me(e)){const u=await this.getManifestJson(e.entry,e,{}),d=Ue(e,u),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:u,from:"global"});f=m,h=d}else S(wt,L,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,J(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:h}}getGlobalRemoteInfo(e){return Ct(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],S(Rt,L,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,J(this.HostInstance.options)))}return k(s.metaData&&s.exposes&&s.shared,`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[!s.metaData&&"metaData",!s.exposes&&"exposes",!s.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=qt(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]=o().then(s=>s)),this.manifestLoading[e]}},fn=class{constructor(e){this.hooks=new q({beforeRegisterShare:new j("beforeRegisterShare"),afterResolve:new F("afterResolve"),beforeLoadShare:new F("beforeLoadShare"),loadShare:new P,resolveShare:new j("resolveShare"),initContainerShareScopeMap:new j("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=gt(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});k(o,`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{shared:s,useTreesShaking:i}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=ae(s,i);if(a.lib)return V(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const l=await a.loading;return a.loaded=!0,a.lib||(a.lib=l),V(a,r.options.name),l}else{const c=(async()=>{const f=await a.get();return V(a,r.options.name),a.loaded=!0,a.lib=f,f})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:c,treeShaking:i?a:void 0}),c}}else{if(t!=null&&t.customShareInfo)return!1;const a=te(o.treeShaking),l=ae(o,a),f=(async()=>{const h=await l.get();l.lib=h,l.loaded=!0,V(l,r.options.name);const{shared:u,useTreesShaking:d}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(u){const m=ae(u,d);m.lib=h,m.loaded=!0,u.from=o.from}return h})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:f,treeShaking:a?l:void 0}),f}}initializeSharing(e=ne,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:u}=this;s||(s=[]);let d=u[e];if(d||(d=u[e]={from:this.host.name}),s.indexOf(d)>=0)return i;s.push(d)}const a=this.shareScopeMap,l=r.options.name;a[e]||(a[e]={});const c=a[e],f=(u,d)=>{var b;const{version:m,eager:y}=d;c[u]=c[u]||{};const g=c[u],p=g[m]&&ae(g[m]),E=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&((b=p.shareConfig)!=null&&b.eager)));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!y!=!E?y:l>g[m].from))&&(g[m]=d)},h=async u=>{const{module:d}=await r.remoteHandler.getRemoteModuleAndOptions({id:u});let m;try{m=await d.getEntry()}catch(y){if(m=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:u,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:r}),!m)return}finally{m!=null&&m.init&&!d.initing&&(d.remoteEntryExports=m,await d.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(u=>{r.options.shared[u].forEach(d=>{d.scope.includes(e)&&f(u,d)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(u=>{u.shareScope===e&&i.push(h(u.name))}),i}loadShareSync(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=me(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return V(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return V(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&S((t==null?void 0:t.from)==="build"?$t:Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}S(Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:l,scope:c="default",...f}=t,h=Array.isArray(c)?c:[c],u=d=>{const m=(g,p,E)=>{E&&!g[p]&&(g[p]=E)},y=a?d.treeShaking:d;m(y,"loaded",s),m(y,"loading",o),m(y,"get",i)};h.forEach(d=>{this.shareScopeMap[d]||(this.shareScopeMap[d]={}),this.shareScopeMap[d][e]||(this.shareScopeMap[d][e]={}),this.shareScopeMap[d][e][l]||(this.shareScopeMap[d][e][l]={version:l,scope:[d],...f,lib:n});const m=this.shareScopeMap[d][e][l];u(m),r&&m.from!==r&&(m.from=r)})}_setGlobalShareScopeMap(e){const t=Et(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},hn=class{constructor(e){this.hooks=new q({beforeRegisterRemote:new j("beforeRegisterRemote"),registerRemote:new j("registerRemote"),beforeRequest:new F("beforeRequest"),onLoad:new P("onLoad"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new P("errorLoadRemote"),beforePreloadRemote:new P("beforePreloadRemote"),generatePreloadAssets:new P("generatePreloadAssets"),afterPreloadRemote:new P,loadEntry:new P}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:l,expose:c,id:f,remoteSnapshot:h}=i,u=await o.get(f,c,t,h),d=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:a,expose:c,exposeModule:n?u:void 0,exposeModuleFactory:n?void 0:u,remote:l,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof d=="function"?d:u}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=rn(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=ke(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});l&&Pt(s,t,l)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(d){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:d,lifecycle:"beforeRequest"}),!n)throw d}const{id:o}=n,s=jr(t.options.remotes,o);s||S(St,L,{hostName:t.options.name,requestId:o},void 0,J(t.options));const{remote:i}=s,a=ke(i),l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:c,expose:f}=l;k(c&&f,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let h=t.moduleCache.get(c.name);const u={host:t,remoteInfo:a};return h||(h=new kt(u),t.moduleCache.set(c.name,h)),{module:h,moduleOptions:u,remoteMatchInfo:l}}registerRemote(e,t,r){const{host:n}=this,o=()=>{if(e.alias){const i=t.find(a=>{var l;return e.alias&&(a.name.startsWith(e.alias)||((l=a.alias)==null?void 0:l.startsWith(e.alias)))});k(!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&&H&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ne),e.type||(e.type=yt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});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),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),Ze(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;I[a]&&((t=Object.getOwnPropertyDescriptor(I,a))!=null&&t.configurable?delete I[a]:I[a]=void 0);const l=Pe(s.remoteInfo);W[l]&&delete W[l],r.snapshotHandler.manifestCache.delete(i.entry);let c=i.buildVersion?Ye(i.name,i.buildVersion):i.name;const f=I.__FEDERATION__.__INSTANCES__.findIndex(u=>i.buildVersion?u.options.id===c:u.name===c);if(f!==-1){const u=I.__FEDERATION__.__INSTANCES__[f];c=u.options.id||c;const d=Et();let m=!0;const y=[];Object.keys(d).forEach(g=>{const p=d[g];p&&Object.keys(p).forEach(E=>{const b=p[E];b&&Object.keys(b).forEach(N=>{const _=b[N];_&&Object.keys(_).forEach($=>{const R=_[$];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter(w=>w!==i.name),R.useIn.length?m=!1:y.push([g,E,N,$])):y.push([g,E,N,$]))})})})}),m&&(u.shareScopeMap={},delete d[c]),y.forEach(([g,p,E,b])=>{var N,_,$;($=(_=(N=d[g])==null?void 0:N[p])==null?void 0:_[E])==null||delete $[b]}),I.__FEDERATION__.__INSTANCES__.splice(f,1)}const{hostGlobalSnapshot:h}=Ct(e,r);if(h){const u=h&&"remotesInfo"in h&&h.remotesInfo&&K(h.remotesInfo,e.name).key;u&&(delete h.remotesInfo[u],ee.__FEDERATION__.__MANIFEST_LOADING__[u]&&delete ee.__FEDERATION__.__MANIFEST_LOADING__[u])}r.moduleCache.delete(e.name)}}catch(r){ve.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const dn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var mn=class{constructor(e){this.hooks=new q({beforeInit:new j("beforeInit"),init:new A,beforeInitContainer:new F("beforeInitContainer"),initContainer:new F("initContainer")}),this.version="2.2.3",this.moduleCache=new Map,this.loaderHook=new q({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new P,loadEntryError:new P,getModuleFactory:new P}),this.bridgeHook=new q({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A});const t=dn?[sn(),ln()]:[],r={id:Qr(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:H};this.name=e.name,this.options=r,this.snapshotHandler=new un(this),this.sharedHandler=new fn(this),this.remoteHandler=new hn(this),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&&S(it(Nt,L)),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=ne,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=ke({name:e,entry:t}),o=new kt({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}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{allShareInfos:r}=gt(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(c=>{a.includes(c)||a.push(c)});const l={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){const t=en(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let pn=null;function Dt(){return pn}ar(mn);function Ft(e,t){const r=n=>{const o=n.length>1&&n.endsWith("/"),s=`${t}/${n}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return o?`${s}/`:s};return e.map(n=>{const o={...n,path:r(n.path)};return typeof n.redirect=="string"?o.redirect=r(n.redirect):n.redirect&&typeof n.redirect=="object"&&"path"in n.redirect&&typeof n.redirect.path=="string"&&(o.redirect={...n.redirect,path:r(n.redirect.path)}),n.children&&n.children.length>0&&(o.children=Ft(n.children,t)),o})}function yn(e){const{router:t,basename:r,memoryRoute:n,hashRoute:o}=e,s=t.getRoutes().sort((u,d)=>u.path.split("/").filter(m=>m).length-d.path.split("/").filter(m=>m).length),i=new Map,a=new Set;s.forEach(u=>{i.set(u.path,u)});const l=(u,d)=>`${u}/${d}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",c=(u,d="")=>{if(!u.children||u.children.length===0)return u;for(let m=0;m<u.children.length;m++){const y=u.children[m],g=l(d,y.path),p=i.get(g);if(p&&!a.has(p)){const E={...p,path:y.path};u.children[m]=E,a.add(p),c(E,g)}}return u};let f=[];for(const u of s)if(!a.has(u)){const d=c(u,u.path);a.add(u),f.push(d)}let h;return n?h=ce.createMemoryHistory(r):o?(h=ce.createWebHashHistory(),r&&(f=Ft(f,r))):h=ce.createWebHistory(r),{history:h,routes:f}}function gn(e){const t=new Map,r=Dt();return()=>({__APP_VERSION__:"2.2.3",async render(n){var m,y,g;D.debug("createBridgeComponent render Info",n);const{moduleName:o,dom:s,basename:i,memoryRoute:a,hashRoute:l,...c}=n,f=Gt.createApp(e.rootComponent,c);t.set(s,f);const h=await((g=(y=(m=r==null?void 0:r.bridgeHook)==null?void 0:m.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(n)),u=h&&typeof h=="object"&&(h!=null&&h.extraProps)?h==null?void 0:h.extraProps:{},d=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:l,...c,...u});if(d!=null&&d.router){const{history:p,routes:E}=yn({router:d.router,basename:n.basename,memoryRoute:n.memoryRoute,hashRoute:n.hashRoute}),b=ce.createRouter({...d.router.options,history:p,routes:E});D.debug("createBridgeComponent render router info>>>",{moduleName:o,router:b}),a&&await b.push(a.entryPath),f.use(b)}f.mount(s)},destroy(n){D.debug("createBridgeComponent destroy Info",n);const o=t.get(n==null?void 0:n.dom);o==null||o.unmount()}})}function En(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const _n=v.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=v.ref(null),r=v.ref(null),n=v.ref(""),o=Oe.useRoute(),s=Dt(),i=v.useAttrs(),a=async()=>{var u,d,m,y;const c=(u=e.providerInfo)==null?void 0:u.call(e);r.value=c;let f={...i,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",f);const h=await((y=(m=(d=s==null?void 0:s.bridgeHook)==null?void 0:d.lifecycle)==null?void 0:m.beforeBridgeRender)==null?void 0:y.emit(f))||{};f={...f,...h.extraProps},c.render(f)},l=v.watch(()=>o==null?void 0:o.path,c=>{c!==o.path&&a(),n.value!==""&&n.value!==c&&(D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:o.path}),En()),n.value=c});return v.onMounted(()=>{a()}),v.onBeforeUnmount(()=>{var c;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e}),l(),(c=r.value)==null||c.destroy({dom:t.value})}),()=>v.createVNode("div",v.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function Ht(e){return v.defineAsyncComponent({__APP_VERSION__:"2.2.3",...e.asyncComponentOptions,loader:async()=>{var l,c;const t=Oe.useRoute();let r="/";const n=(c=(l=t==null?void 0:t.matched)==null?void 0:l[0])==null?void 0:c.path;n&&(n.endsWith("/:pathMatch(.*)*")?r=n.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const o=(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[o];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:o,basename:r,route:t}),o in s&&typeof a=="function")return{render(){return v.h(_n,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function bn(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),Ht(e)}exports.createBridgeComponent=gn;exports.createRemoteAppComponent=Ht;exports.createRemoteComponent=bn;
7
+ `)};function rr(e,t,r,n,o,s){return n(it(e,t,r,o))}const G="[ Federation Runtime ]",ve=rt(G);function k(e,t,r,n,o){e||S(t)}function S(e,t,r,n,o){if(t!==void 0)return rr(e,t,r??{},i=>{throw new Error(`${G}: ${i}`)},n);const s=e;throw s instanceof Error?(s.message.startsWith(G)||(s.message=`${G}: ${s.message}`),s):new Error(`${G}: ${s}`)}function Le(e){e instanceof Error&&(e.message.startsWith(G)||(e.message=`${G}: ${e.message}`)),ve.warn(e)}function nr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function Q(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Me(e){return typeof e.entry<"u"}function at(e){return!e.entry.includes(".json")}function Ce(e){return e&&typeof e=="object"}const or=Object.prototype.toString;function sr(e){return or.call(e)==="[object Object]"}function ct(e){return Array.isArray(e)?e:[e]}function lt(e){const t={url:"",type:"global",globalName:""};return H||Xe()||!("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 ir=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},I=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return I}})(),ee=O;function le(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function ue(e,t){return Object.hasOwnProperty.call(e,t)}ue(I,"__GLOBAL_LOADING_REMOTE_ENTRY__")||le(I,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const W=I.__GLOBAL_LOADING_REMOTE_ENTRY__;function ut(e){var t,r,n,o,s,i;ue(e,"__VMOK__")&&!ue(e,"__FEDERATION__")&&le(e,"__FEDERATION__",e.__VMOK__),ue(e,"__FEDERATION__")||(le(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),le(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(n=e.__FEDERATION__).moduleInfo??(n.moduleInfo={}),(o=e.__FEDERATION__).__SHARE__??(o.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map)}ut(I);ut(O);function ar(e,t=we()){t&&(I.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.3.0")}function K(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const n of r){const[o,s]=n.split(":"),i=`${o}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const xe=()=>O.__FEDERATION__.moduleInfo,cr=(e,t)=>{const r=K(t,Q(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:n,...o}=e,s=Q(o),i=K(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===n)return i}},fe=e=>cr(e,O.__FEDERATION__.moduleInfo),Ue=(e,t)=>{const r=Q(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},lr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),De=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:I[r]}},ur=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,fr=e=>I.__FEDERATION__.__PRELOADED_MAP__.get(e),hr=e=>I.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Ve="[0-9A-Za-z-]+",Fe=`(?:\\+(${Ve}(?:\\.${Ve})*))`,Z="0|[1-9]\\d*",he="[0-9]+",ft="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Be=`(?:${he}|${ft})`,dr=`(?:-?(${Be}(?:\\.${Be})*))`,We=`(?:${Z}|${ft})`,ht=`(?:-(${We}(?:\\.${We})*))`,be=`${Z}|x|X|\\*`,z=`[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ht})?${Fe}?)?)?`,mr=`^\\s*(${z})\\s+-\\s+(${z})\\s*$`,pr=`[v=\\s]*${`(${he})\\.(${he})\\.(${he})`}${dr}?${Fe}?`,He="((?:<|>)?=?)",yr=`(\\s*)${He}\\s*(${pr}|${z})`,dt="(?:~>?)",gr=`(\\s*)${dt}\\s+`,mt="(?:\\^)",Er=`(\\s*)${mt}\\s+`,_r="(<|>)?=?\\s*\\*",br=`^${mt}${z}$`,Rr=`v?${`(${Z})\\.(${Z})\\.(${Z})`}${ht}?${Fe}?`,Sr=`^${dt}${z}$`,$r=`^${He}\\s*${z}$`,wr=`^${He}\\s*(${Rr})$|^$`,Nr="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function T(e){return!e||e.toLowerCase()==="x"||e==="*"}function pt(...e){return t=>e.reduce((r,n)=>n(r),t)}function je(e){return e.match(C(wr))}function qe(e,t,r,n){const o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function Ir(e){return e.replace(C(mr),(t,r,n,o,s,i,a,l,c,f,h,u)=>(T(n)?r="":T(o)?r=`>=${n}.0.0`:T(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,T(c)?l="":T(f)?l=`<${Number(c)+1}.0.0-0`:T(h)?l=`<${c}.${Number(f)+1}.0-0`:u?l=`<=${c}.${f}.${h}-${u}`:l=`<=${l}`,`${r} ${l}`.trim()))}function Tr(e){return e.replace(C(yr),"$1$2$3")}function vr(e){return e.replace(C(gr),"$1~")}function Ar(e){return e.replace(C(Er),"$1^")}function Pr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(br),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function kr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Sr),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function Or(e){return e.split(/\s+/).map(t=>t.trim().replace(C($r),(r,n,o,s,i,a)=>{const l=T(o),c=l||T(s),f=c||T(i);return n==="="&&f&&(n=""),a="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(s=0),i=0,n===">"?(n=">=",c?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",c?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):c?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:f?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).join(" ")}function Lr(e){return e.trim().replace(C(_r),"")}function Mr(e){return e.trim().replace(C(Nr),"")}function de(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Cr(e,t){const{preRelease:r}=e,{preRelease:n}=t;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?de(i,a):-1:1}return 0}function ie(e,t){return de(e.major,t.major)||de(e.minor,t.minor)||de(e.patch,t.patch)||Cr(e,t)}function Re(e,t){return e.version===t.version}function Dr(e,t){switch(e.operator){case"":case"=":return Re(e,t);case">":return ie(e,t)<0;case">=":return Re(e,t)||ie(e,t)<0;case"<":return ie(e,t)>0;case"<=":return Re(e,t)||ie(e,t)>0;case void 0:return!0;default:return!1}}function Fr(e){return pt(Pr,kr,Or,Lr)(e)}function Hr(e){return pt(Ir,Tr,vr,Ar)(e.trim()).split(/\s+/).join(" ")}function Y(e,t){if(!e)return!1;const r=je(e);if(!r)return!1;const[,n,,o,s,i,a]=r,l={operator:n,version:qe(o,s,i,a),major:o,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},c=t.split("||");for(const f of c){const h=f.trim();if(!h||h==="*"||h==="x")return!0;try{const u=Hr(h);if(!u.trim())return!0;const d=u.split(" ").map(g=>Fr(g)).join(" ");if(!d.trim())return!0;const m=d.split(/\s+/).map(g=>Mr(g)).filter(Boolean);if(m.length===0)continue;let y=!0;for(const g of m){const p=je(g);if(!p){y=!1;break}const[,E,,b,N,_,$]=p;if(!Dr({operator:E,version:qe(b,N,_,$),major:b,minor:N,patch:_,preRelease:$==null?void 0:$.split(".")},l)){y=!1;break}}if(y)return!0}catch(u){console.error(`[semver] Error processing range part "${h}":`,u);continue}}return!1}const ne="default",yt="global";function Gr(e,t,r,n){var s,i;let o;return"get"in e?o=e.get:"lib"in e?o=()=>Promise.resolve(e.lib):o=()=>Promise.resolve(()=>{S(`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)&&S(`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:o,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??n)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??$e.UNKNOWN,useIn:[]}:void 0}}function gt(e,t){const r=t.shared||{},n=t.name,o=Object.keys(r).reduce((i,a)=>{const l=ct(r[a]);return i[a]=i[a]||[],l.forEach(c=>{i[a].push(Gr(c,n,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(l=>l.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{allShareInfos:s,newShareInfos:o}}function te(e,t){if(!e)return!1;const{status:r,mode:n}=e;return r===$e.NO_USE?!1:r===$e.CALCULATED?!0:n==="runtime-infer"?t?Ur(e,t):!0:!1}function x(e,t){const r=n=>{if(!Number.isNaN(Number(n))){const o=n.split(".");let s=n;for(let i=0;i<3-o.length;i++)s+=".0";return s}return n};return!!Y(r(e),`<=${r(t)}`)}const re=(e,t)=>{const r=t||function(n,o){return x(n,o)};return Object.keys(e).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},pe=e=>!!e.loaded||typeof e.lib=="function",xr=e=>!!e.loading,Ur=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(n=>r.includes(n)):!1};function Vr(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){return i?o[l].treeShaking?o[c].treeShaking?!pe(o[l].treeShaking)&&x(l,c):!1:!0:!pe(o[l])&&x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}const U=e=>pe(e)||xr(e);function Br(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){if(i){if(!o[l].treeShaking)return!0;if(!o[c].treeShaking)return!1;if(U(o[c].treeShaking))return U(o[l].treeShaking)?!!x(l,c):!0;if(U(o[l].treeShaking))return!1}return U(o[c])?U(o[l])?!!x(l,c):!0:U(o[l])?!1:x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}function Wr(e){return e==="loaded-first"?Br:Vr}function me(e,t,r,n){if(!e)return;const{shareConfig:o,scope:s=ne,strategy:i,treeShaking:a}=r,l=Array.isArray(s)?s:[s];for(const c of l)if(o&&e[c]&&e[c][t]){const{requiredVersion:f}=o,{version:h,useTreesShaking:u}=Wr(i)(e,c,t,a),d=()=>{const y=e[c][t][h];if(o.singleton){if(typeof f=="string"&&!Y(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})`;o.strictVersion?S(g):Le(g)}return{shared:y,useTreesShaking:u}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:u};if(Y(h,f))return{shared:y,useTreesShaking:u};const g=te(a);if(g){for(const[p,E]of Object.entries(e[c][t]))if(te(E.treeShaking,a==null?void 0:a.usedExports)&&Y(p,f))return{shared:E,useTreesShaking:g}}for(const[p,E]of Object.entries(e[c][t]))if(Y(p,f))return{shared:E,useTreesShaking:!1}}},m={shareScopeMap:e,scope:c,pkgName:t,version:h,GlobalFederation:ee.__FEDERATION__,shareInfo:r,resolver:d};return(n.emit(m)||m).resolver()}}function Et(){return ee.__FEDERATION__.__SHARE__}function Ke(e){const{pkgName:t,extraOptions:r,shareInfos:n}=e,o=l=>{if(!l)return;const c={};return l.forEach(h=>{c[h.version]=h}),c[re(c,function(h,u){return!pe(c[h])&&x(h,u)})]},s=(r==null?void 0:r.resolver)??o,i=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),a=(...l)=>{const c={};for(const f of l)if(f)for(const[h,u]of Object.entries(f)){const d=c[h];i(d)&&i(u)?c[h]=a(d,u):u!==void 0&&(c[h]=u)}return c};return a(s(n[t]),r==null?void 0:r.customShareInfo)}const V=(e,t)=>{e.useIn||(e.useIn=[]),nr(e.useIn,t)};function ae(e,t){return t&&e.treeShaking?e.treeShaking:e}function jr(e,t){for(const r of e){const n=t.startsWith(r.name);let o=t.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")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 qr(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const _t="RUNTIME-001",bt="RUNTIME-002",Rt="RUNTIME-003",St="RUNTIME-004",$t="RUNTIME-005",Ae="RUNTIME-006",wt="RUNTIME-007",Ge="RUNTIME-008",Kr="RUNTIME-009",Nt="RUNTIME-010",It="RUNTIME-011",zr="RUNTIME-012",L={[_t]:"Failed to get remoteEntry exports.",[bt]:'The remote entry interface does not contain "init"',[Rt]:"Failed to get manifest.",[St]:"Failed to locate remote.",[$t]:"Invalid loadShareSync function call from bundler runtime",[Ae]:"Invalid loadShareSync function call from runtime",[wt]:"Failed to get remote snapshot.",[Ge]:"Failed to load script resources.",[Kr]:"Please call createInstance first.",[Nt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[It]:"The remoteEntry URL is missing from the remote snapshot.",[zr]:'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.'};({...L});const Tt=".then(callbacks[0]).catch(callbacks[1])";async function Jr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Tt}`)([r,n]):import(e).then(r).catch(n)}catch(o){S(`Failed to load ESM entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}async function Xr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(n):new Function("callbacks",`System.import("${e}")${Tt}`)([r,n])}catch(o){S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}function vt(e,t,r){const{remoteEntryKey:n,entryExports:o}=De(e,t);return o||S(_t,L,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n}),o}async function Yr({name:e,globalName:t,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:s}=De(e,t);if(s)return s;const i=o?o(r):r;return Yt(i,{attrs:{},createScriptHook:(a,l)=>{const c=n.lifecycle.createScript.emit({url:a,attrs:l});if(c&&(c instanceof HTMLScriptElement||"script"in c||"timeout"in c))return c}}).then(()=>vt(e,t,r),a=>{const l=a instanceof Error?a.message:String(a);S(Ge,L,{remoteName:e,resourceUrl:i},l)})}async function Zr({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:s,name:i,type:a}=e;switch(a){case"esm":case"module":return Jr({entry:o,remoteEntryExports:t});case"system":return Xr({entry:o,remoteEntryExports:t});default:return Yr({entry:o,globalName:s,name:i,loaderHook:r,getEntryUrl:n})}}async function Qr({remoteInfo:e,loaderHook:t}){const{entry:r,entryGlobalName:n,name:o,type:s}=e,{entryExports:i}=De(o,n);return i||er(r,{attrs:{name:o,globalName:n,type:s},loaderHook:{createScriptHook:(a,l={})=>{const c=t.lifecycle.createScript.emit({url:a,attrs:l});if(c&&"url"in c)return c}}}).then(()=>vt(o,n,r)).catch(a=>{S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error?a.message:String(a)}`)})}function Pe(e){const{entry:t,name:r}=e;return Ye(r,t)}async function ye(e){const{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:s=!1}=e,i=Pe(n);if(r)return r;if(!W[i]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;W[i]=a.emit({loaderHook:l,remoteInfo:n,remoteEntryExports:r}).then(c=>c||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":H)?Zr({remoteInfo:n,remoteEntryExports:r,loaderHook:l,getEntryUrl:o}):Qr({remoteInfo:n,loaderHook:l}))).catch(async c=>{const f=Pe(n),h=c instanceof Error&&c.message.includes("ScriptExecutionError");if(c instanceof Error&&c.message.includes(Ge)&&!h&&!s){const u=m=>ye({...m,_inErrorHandling:!0}),d=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:u,origin:t,remoteInfo:n,remoteEntryExports:r,globalLoading:W,uniqueKey:f});if(d)return d}throw c})}return W[i]}function ke(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||yt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||ne}}function en(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function tn(e,t){const r=ur(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(o=>{e!=null&&e.find(s=>s.name!==o.name)&&e.push(o)}),e&&e.length>0&&e.forEach(o=>{n.forEach(s=>{s.applyPlugin(o,t)})}),e}function rn(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 J(e){var r,n,o,s,i,a;const t={};for(const[l,c]of Object.entries(e.shared)){const f=c[0];f&&(t[l]={version:f.version,singleton:(r=f.shareConfig)==null?void 0:r.singleton,requiredVersion:((n=f.shareConfig)==null?void 0:n.requiredVersion)===!1?!1:(o=f.shareConfig)==null?void 0:o.requiredVersion,eager:f.eager,strictVersion:(s=f.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(rn))??[],shared:t}}}function At(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...e}}function nn(e,t){return t.map(r=>{const n=qr(e,r.nameOrAlias);return k(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&Qe({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:At(r)}})}function on(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Pt(e,t,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;if(t.options.inBrowser){if(i.forEach(a=>{const{moduleInfo:l}=a,c=t.moduleCache.get(e.name);ye(c?{origin:t,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:t,remoteInfo:l,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d},needDeleteLink:!1});f&&document.head.appendChild(c)})}if(n){const a={rel:"preload",as:"script"};s.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={fetchpriority:"high",type:(e==null?void 0:e.type)==="module"?"module":"text/javascript"};s.forEach(l=>{const{script:c,needAttach:f}=ot({url:l,cb:()=>{},attrs:a,createScriptHook:(h,u)=>{const d=t.loaderHook.lifecycle.createScript.emit({url:h,attrs:u});if(d instanceof HTMLScriptElement)return d},needDeleteScript:!0});f&&document.head.appendChild(c)})}}}function sn(e,t,r){const n=t,o=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];o.length||o.push("default"),o.forEach(i=>{n[i]||(n[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?o:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:n,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:n[o[0]],initScope:r??[]}}var kt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await ye({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return k(e,`remoteEntryExports is undefined
8
+ ${Qe(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=sn(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&S(bt,L,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,J(this.host.options)),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),k(i,`${Q(this.remoteInfo)} remote don't export ${t}.`);const a=ir(this.remoteInfo.name,t),l=this.wraperFactory(i,a);return o?await l():l}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}},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(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},P=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n<r.length?Promise.resolve(r[n++].apply(null,e)).then(o):s;t=o()}return Promise.resolve(t)}};function Ot(e,t){if(!Ce(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var j=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(Ot(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){Le(r),this.onerror(r)}return e}},F=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`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 n=s=>(Le(s),this.onerror(s),e),o=s=>{if(Ot(e,s)){if(e=s,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(i){return n(i)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}},q=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var n;k(sr(e),"Plugin configuration is invalid.");const r=e.name;k(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,(n=e.apply)==null||n.call(e,t),Object.keys(this.lifecycle).forEach(o=>{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){k(e,"A name is required.");const t=this.registerPlugins[e];k(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};function Lt(e,t){const r=lt(t);r.url||S(It,L,{remoteName:e.name});let n=Ne(t,r.url);!H&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function an(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!Me(t)||!at(t)){const{remoteSnapshot:a,globalSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Lt(s,a);const c={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},f=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:l});return f&&Pt(s,o,f,!1),{...e,remoteSnapshot:a}}return e}}}function cn(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 Mt(e,t,r,n,o={},s){const{value:i}=K(e,Q(t)),a=s||i;if(a&&!et(a)&&(r(a,t,n),a.remotesInfo)){const l=Object.keys(a.remotesInfo);for(const c of l){if(o[c])continue;o[c]=!0;const f=cn(c),h=a.remotesInfo[c];Mt(e,{name:f.name,version:h.matchedVersion},r,!1,o,void 0)}}}const Se=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function ln(e,t,r,n,o){const s=[],i=[],a=[],l=new Set,c=new Set,{options:f}=e,{preloadConfig:h}=t,{depsRemote:u}=h;if(Mt(n,r,(m,y,g)=>{var $;let p;if(g)p=h;else if(Array.isArray(u)){const R=u.find(w=>w.nameOrAlias===y.name||w.nameOrAlias===y.alias);if(!R)return;p=At(R)}else if(u===!0)p=h;else return;const E=Ne(m,lt(m).url);E&&a.push({name:y.name,moduleInfo:{name:y.name,entry:E,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:y.name,shareScope:"",version:"version"in m?m.version:void 0},url:E});let b="modules"in m?m.modules:[];const N=on(p.exposes);N.length&&"modules"in m&&(b=($=m==null?void 0:m.modules)==null?void 0:$.reduce((R,w)=>((N==null?void 0:N.indexOf(w.moduleName))!==-1&&R.push(w),R),[]));function _(R){const w=R.map(M=>Ne(m,M));return p.filter?w.filter(p.filter):w}if(b){const R=b.length;for(let w=0;w<R;w++){const M=b[w],ge=`${y.name}/${M.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:M.moduleName==="."?y.name:ge,name:y.name,remoteSnapshot:m,preloadConfig:p,remote:y,origin:e}),!fr(ge)&&(p.resourceCategory==="all"?(s.push(..._(M.assets.css.async)),s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.async)),i.push(..._(M.assets.js.sync))):p.resourceCategory==="sync"&&(s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.sync))),hr(ge))}}},!0,{},o),o.shared&&o.shared.length>0){const m=(y,g)=>{const{shared:p}=me(e.shareScopeMap,g.sharedName,y,e.sharedHandler.hooks.lifecycle.resolveShare)||{};p&&typeof p.lib=="function"&&(g.assets.js.sync.forEach(E=>{l.add(E)}),g.assets.css.sync.forEach(E=>{c.add(E)}))};o.shared.forEach(y=>{var E;const g=(E=f.shared)==null?void 0:E[y.sharedName];if(!g)return;const p=y.version?g.find(b=>b.version===y.version):g;p&&ct(p).forEach(b=>{m(b,y)})})}const d=i.filter(m=>!l.has(m)&&!Se("script",m));return{cssAssets:s.filter(m=>!c.has(m)&&!Se("link",m)),jsAssetsWithoutEntry:d,entryAssets:a.filter(m=>!Se("script",m.url))}}const un=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return H?Me(o)&&at(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Lt(n,i),ln(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Ct(e,t){const r=fe({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&K(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:"version"in e?e.version:void 0})}}var fn=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new q({beforeLoadRemoteSnapshot:new P("beforeLoadRemoteSnapshot"),loadSnapshot:new F("loadGlobalSnapshot"),loadRemoteSnapshot:new F("loadRemoteSnapshot"),afterLoadSnapshot:new F("afterLoadSnapshot")}),this.manifestLoading=ee.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=fe({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},lr({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!K(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let f,h;if(l)if(et(l)){const u=H?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",d=await this.getManifestJson(u,e,{}),m=Ue({...e,entry:u},d);f=d,h=m}else{const{remoteSnapshot:u}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});f=u,h=c}else if(Me(e)){const u=await this.getManifestJson(e.entry,e,{}),d=Ue(e,u),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:u,from:"global"});f=m,h=d}else S(wt,L,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,J(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:h}}getGlobalRemoteInfo(e){return Ct(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],S(Rt,L,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,J(this.HostInstance.options)))}return k(s.metaData&&s.exposes&&s.shared,`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[!s.metaData&&"metaData",!s.exposes&&"exposes",!s.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=qt(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]=o().then(s=>s)),this.manifestLoading[e]}},hn=class{constructor(e){this.hooks=new q({beforeRegisterShare:new j("beforeRegisterShare"),afterResolve:new F("afterResolve"),beforeLoadShare:new F("beforeLoadShare"),loadShare:new P,resolveShare:new j("resolveShare"),initContainerShareScopeMap:new j("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=gt(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});k(o,`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{shared:s,useTreesShaking:i}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=ae(s,i);if(a.lib)return V(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const l=await a.loading;return a.loaded=!0,a.lib||(a.lib=l),V(a,r.options.name),l}else{const c=(async()=>{const f=await a.get();return V(a,r.options.name),a.loaded=!0,a.lib=f,f})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:c,treeShaking:i?a:void 0}),c}}else{if(t!=null&&t.customShareInfo)return!1;const a=te(o.treeShaking),l=ae(o,a),f=(async()=>{const h=await l.get();l.lib=h,l.loaded=!0,V(l,r.options.name);const{shared:u,useTreesShaking:d}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(u){const m=ae(u,d);m.lib=h,m.loaded=!0,u.from=o.from}return h})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:f,treeShaking:a?l:void 0}),f}}initializeSharing(e=ne,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:u}=this;s||(s=[]);let d=u[e];if(d||(d=u[e]={from:this.host.name}),s.indexOf(d)>=0)return i;s.push(d)}const a=this.shareScopeMap,l=r.options.name;a[e]||(a[e]={});const c=a[e],f=(u,d)=>{var b;const{version:m,eager:y}=d;c[u]=c[u]||{};const g=c[u],p=g[m]&&ae(g[m]),E=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&((b=p.shareConfig)!=null&&b.eager)));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!y!=!E?y:l>g[m].from))&&(g[m]=d)},h=async u=>{const{module:d}=await r.remoteHandler.getRemoteModuleAndOptions({id:u});let m;try{m=await d.getEntry()}catch(y){if(m=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:u,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:r}),!m)return}finally{m!=null&&m.init&&!d.initing&&(d.remoteEntryExports=m,await d.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(u=>{r.options.shared[u].forEach(d=>{d.scope.includes(e)&&f(u,d)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(u=>{u.shareScope===e&&i.push(h(u.name))}),i}loadShareSync(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=me(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return V(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return V(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&S((t==null?void 0:t.from)==="build"?$t:Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}S(Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:l,scope:c="default",...f}=t,h=Array.isArray(c)?c:[c],u=d=>{const m=(g,p,E)=>{E&&!g[p]&&(g[p]=E)},y=a?d.treeShaking:d;m(y,"loaded",s),m(y,"loading",o),m(y,"get",i)};h.forEach(d=>{this.shareScopeMap[d]||(this.shareScopeMap[d]={}),this.shareScopeMap[d][e]||(this.shareScopeMap[d][e]={}),this.shareScopeMap[d][e][l]||(this.shareScopeMap[d][e][l]={version:l,scope:[d],...f,lib:n});const m=this.shareScopeMap[d][e][l];u(m),r&&m.from!==r&&(m.from=r)})}_setGlobalShareScopeMap(e){const t=Et(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},dn=class{constructor(e){this.hooks=new q({beforeRegisterRemote:new j("beforeRegisterRemote"),registerRemote:new j("registerRemote"),beforeRequest:new F("beforeRequest"),onLoad:new P("onLoad"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new P("errorLoadRemote"),beforePreloadRemote:new P("beforePreloadRemote"),generatePreloadAssets:new P("generatePreloadAssets"),afterPreloadRemote:new P,loadEntry:new P}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:l,expose:c,id:f,remoteSnapshot:h}=i,u=await o.get(f,c,t,h),d=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:a,expose:c,exposeModule:n?u:void 0,exposeModuleFactory:n?void 0:u,remote:l,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof d=="function"?d:u}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=nn(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=ke(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});l&&Pt(s,t,l)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(d){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:d,lifecycle:"beforeRequest"}),!n)throw d}const{id:o}=n,s=jr(t.options.remotes,o);s||S(St,L,{hostName:t.options.name,requestId:o},void 0,J(t.options));const{remote:i}=s,a=ke(i),l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:c,expose:f}=l;k(c&&f,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let h=t.moduleCache.get(c.name);const u={host:t,remoteInfo:a};return h||(h=new kt(u),t.moduleCache.set(c.name,h)),{module:h,moduleOptions:u,remoteMatchInfo:l}}registerRemote(e,t,r){const{host:n}=this,o=()=>{if(e.alias){const i=t.find(a=>{var l;return e.alias&&(a.name.startsWith(e.alias)||((l=a.alias)==null?void 0:l.startsWith(e.alias)))});k(!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&&H&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ne),e.type||(e.type=yt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});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),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),Ze(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;I[a]&&((t=Object.getOwnPropertyDescriptor(I,a))!=null&&t.configurable?delete I[a]:I[a]=void 0);const l=Pe(s.remoteInfo);W[l]&&delete W[l],r.snapshotHandler.manifestCache.delete(i.entry);let c=i.buildVersion?Ye(i.name,i.buildVersion):i.name;const f=I.__FEDERATION__.__INSTANCES__.findIndex(u=>i.buildVersion?u.options.id===c:u.name===c);if(f!==-1){const u=I.__FEDERATION__.__INSTANCES__[f];c=u.options.id||c;const d=Et();let m=!0;const y=[];Object.keys(d).forEach(g=>{const p=d[g];p&&Object.keys(p).forEach(E=>{const b=p[E];b&&Object.keys(b).forEach(N=>{const _=b[N];_&&Object.keys(_).forEach($=>{const R=_[$];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter(w=>w!==i.name),R.useIn.length?m=!1:y.push([g,E,N,$])):y.push([g,E,N,$]))})})})}),m&&(u.shareScopeMap={},delete d[c]),y.forEach(([g,p,E,b])=>{var N,_,$;($=(_=(N=d[g])==null?void 0:N[p])==null?void 0:_[E])==null||delete $[b]}),I.__FEDERATION__.__INSTANCES__.splice(f,1)}const{hostGlobalSnapshot:h}=Ct(e,r);if(h){const u=h&&"remotesInfo"in h&&h.remotesInfo&&K(h.remotesInfo,e.name).key;u&&(delete h.remotesInfo[u],ee.__FEDERATION__.__MANIFEST_LOADING__[u]&&delete ee.__FEDERATION__.__MANIFEST_LOADING__[u])}r.moduleCache.delete(e.name)}}catch(r){ve.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const mn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var pn=class{constructor(e){this.hooks=new q({beforeInit:new j("beforeInit"),init:new A,beforeInitContainer:new F("beforeInitContainer"),initContainer:new F("initContainer")}),this.version="2.3.0",this.moduleCache=new Map,this.loaderHook=new q({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new P,loadEntryError:new P,getModuleFactory:new P}),this.bridgeHook=new q({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A});const t=mn?[an(),un()]:[],r={id:en(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:H};this.name=e.name,this.options=r,this.snapshotHandler=new fn(this),this.sharedHandler=new hn(this),this.remoteHandler=new dn(this),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&&S(it(Nt,L)),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=ne,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=ke({name:e,entry:t}),o=new kt({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}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{allShareInfos:r}=gt(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(c=>{a.includes(c)||a.push(c)});const l={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){const t=tn(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let yn=null;function Dt(){return yn}ar(pn);function Ft(e,t){const r=n=>{const o=n.length>1&&n.endsWith("/"),s=`${t}/${n}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return o?`${s}/`:s};return e.map(n=>{const o={...n,path:r(n.path)};return typeof n.redirect=="string"?o.redirect=r(n.redirect):n.redirect&&typeof n.redirect=="object"&&"path"in n.redirect&&typeof n.redirect.path=="string"&&(o.redirect={...n.redirect,path:r(n.redirect.path)}),n.children&&n.children.length>0&&(o.children=Ft(n.children,t)),o})}function gn(e){const{router:t,basename:r,memoryRoute:n,hashRoute:o}=e,s=t.getRoutes().sort((u,d)=>u.path.split("/").filter(m=>m).length-d.path.split("/").filter(m=>m).length),i=new Map,a=new Set;s.forEach(u=>{i.set(u.path,u)});const l=(u,d)=>`${u}/${d}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",c=(u,d="")=>{if(!u.children||u.children.length===0)return u;for(let m=0;m<u.children.length;m++){const y=u.children[m],g=l(d,y.path),p=i.get(g);if(p&&!a.has(p)){const E={...p,path:y.path};u.children[m]=E,a.add(p),c(E,g)}}return u};let f=[];for(const u of s)if(!a.has(u)){const d=c(u,u.path);a.add(u),f.push(d)}let h;return n?h=ce.createMemoryHistory(r):o?(h=ce.createWebHashHistory(),r&&(f=Ft(f,r))):h=ce.createWebHistory(r),{history:h,routes:f}}function En(e){const t=new Map,r=Dt();return()=>({__APP_VERSION__:"2.3.0",async render(n){var m,y,g;D.debug("createBridgeComponent render Info",n);const{moduleName:o,dom:s,basename:i,memoryRoute:a,hashRoute:l,...c}=n,f=Gt.createApp(e.rootComponent,c);t.set(s,f);const h=await((g=(y=(m=r==null?void 0:r.bridgeHook)==null?void 0:m.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(n)),u=h&&typeof h=="object"&&(h!=null&&h.extraProps)?h==null?void 0:h.extraProps:{},d=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:l,...c,...u});if(d!=null&&d.router){const{history:p,routes:E}=gn({router:d.router,basename:n.basename,memoryRoute:n.memoryRoute,hashRoute:n.hashRoute}),b=ce.createRouter({...d.router.options,history:p,routes:E});D.debug("createBridgeComponent render router info>>>",{moduleName:o,router:b}),a&&await b.push(a.entryPath),f.use(b)}f.mount(s)},destroy(n){D.debug("createBridgeComponent destroy Info",n);const o=t.get(n==null?void 0:n.dom);o==null||o.unmount()}})}function _n(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const bn=v.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=v.ref(null),r=v.ref(null),n=v.ref(""),o=Oe.useRoute(),s=Dt(),i=v.useAttrs(),a=async()=>{var u,d,m,y;const c=(u=e.providerInfo)==null?void 0:u.call(e);r.value=c;let f={...i,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",f);const h=await((y=(m=(d=s==null?void 0:s.bridgeHook)==null?void 0:d.lifecycle)==null?void 0:m.beforeBridgeRender)==null?void 0:y.emit(f))||{};f={...f,...h.extraProps},c.render(f)},l=v.watch(()=>o==null?void 0:o.path,c=>{c!==o.path&&a(),n.value!==""&&n.value!==c&&(D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:o.path}),_n()),n.value=c});return v.onMounted(()=>{a()}),v.onBeforeUnmount(()=>{var c;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e}),l(),(c=r.value)==null||c.destroy({dom:t.value})}),()=>v.createVNode("div",v.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function Ht(e){return v.defineAsyncComponent({__APP_VERSION__:"2.3.0",...e.asyncComponentOptions,loader:async()=>{var l,c;const t=Oe.useRoute();let r="/";const n=(c=(l=t==null?void 0:t.matched)==null?void 0:l[0])==null?void 0:c.path;n&&(n.endsWith("/:pathMatch(.*)*")?r=n.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const o=(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[o];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:o,basename:r,route:t}),o in s&&typeof a=="function")return{render(){return v.h(bn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function Rn(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),Ht(e)}exports.createBridgeComponent=En;exports.createRemoteAppComponent=Ht;exports.createRemoteComponent=Rn;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Ft from "vue";
2
- import { defineComponent as Ht, ref as Ee, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Vt, createVNode as Bt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
2
+ import { defineComponent as Ht, ref as ge, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Vt, createVNode as Bt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
3
3
  import * as ae from "vue-router";
4
4
  import { useRoute as Ke } from "vue-router";
5
5
  const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
@@ -58,12 +58,12 @@ function Zt(e) {
58
58
  return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
59
59
  }
60
60
  function Qt(e, t = {}) {
61
- var g, b, N;
61
+ var E, b, N;
62
62
  const { remotes: r = {}, overrides: n = {}, version: o } = t;
63
63
  let s;
64
64
  const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Zt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
65
65
  let l = {};
66
- Object.keys(r).length || (l = ((g = e.remotes) == null ? void 0 : g.reduce((_, $) => {
66
+ Object.keys(r).length || (l = ((E = e.remotes) == null ? void 0 : E.reduce((_, $) => {
67
67
  let R;
68
68
  const w = $.federationContainerName;
69
69
  return a.includes(w) ? R = n[w] : "version" in $ ? R = $.version : R = $.entry, _[w] = { matchedVersion: R }, _;
@@ -73,7 +73,7 @@ function Qt(e, t = {}) {
73
73
  name: "",
74
74
  zip: "",
75
75
  api: ""
76
- }, buildInfo: { buildVersion: d }, globalName: m, ssrRemoteEntry: y } = e.metaData, { exposes: E } = e;
76
+ }, buildInfo: { buildVersion: d }, globalName: m, ssrRemoteEntry: y } = e.metaData, { exposes: g } = e;
77
77
  let p = {
78
78
  version: o || "",
79
79
  buildVersion: d,
@@ -90,7 +90,7 @@ function Qt(e, t = {}) {
90
90
  version: _.version,
91
91
  usedExports: _.referenceExports || []
92
92
  })),
93
- modules: E == null ? void 0 : E.map((_) => ({
93
+ modules: g == null ? void 0 : g.map((_) => ({
94
94
  moduleName: _.name,
95
95
  modulePath: _.path,
96
96
  assets: _.assets
@@ -274,7 +274,7 @@ function nt(e) {
274
274
  clearTimeout(o), a && window.removeEventListener("error", a);
275
275
  const h = () => {
276
276
  if ((f == null ? void 0 : f.type) === "error") {
277
- const u = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
277
+ const u = /* @__PURE__ */ new Error(f != null && f.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.)`);
278
278
  u.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
279
279
  } else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
280
280
  };
@@ -292,13 +292,16 @@ function nt(e) {
292
292
  h();
293
293
  };
294
294
  return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
295
- l(null, /* @__PURE__ */ new Error(`Remote script "${e.url}" time-outed.`));
295
+ l(null, {
296
+ type: "error",
297
+ isTimeout: !0
298
+ });
296
299
  }, n), {
297
300
  script: t,
298
301
  needAttach: r
299
302
  };
300
303
  }
301
- function ge(e) {
304
+ function Ee(e) {
302
305
  let t = null, r = !0;
303
306
  const n = document.getElementsByTagName("link");
304
307
  for (let s = 0; s < n.length; s++) {
@@ -384,13 +387,13 @@ const ot = async () => {
384
387
  const h = await (await a(l.href)).text(), [u, d] = await Promise.all([V("path"), V("vm")]), m = {
385
388
  exports: {},
386
389
  module: { exports: {} }
387
- }, y = l.pathname.split("/").slice(0, -1).join("/"), E = u.basename(l.pathname), p = new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
390
+ }, y = l.pathname.split("/").slice(0, -1).join("/"), g = u.basename(l.pathname), p = new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
388
391
  })`, {
389
- filename: E,
392
+ filename: g,
390
393
  importModuleDynamically: ((c = d.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? V
391
394
  });
392
- let g;
393
- g = (await V("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : u.join(process.cwd(), "__mf_require_base__.js")), p.runInThisContext()(m.exports, m.module, g, y, E);
395
+ let E;
396
+ E = (await V("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : u.join(process.cwd(), "__mf_require_base__.js")), p.runInThisContext()(m.exports, m.module, E, y, g);
394
397
  const b = m.module.exports || m.exports;
395
398
  if (r && b && r.globalName) {
396
399
  t(void 0, b[r.globalName] || b);
@@ -536,7 +539,7 @@ function lt(e) {
536
539
  lt(I);
537
540
  lt(k);
538
541
  function mr(e, t = we()) {
539
- t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.2.3");
542
+ t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.3.0");
540
543
  }
541
544
  function q(e, t) {
542
545
  if (typeof t == "string") {
@@ -582,7 +585,7 @@ const Ge = () => k.__FEDERATION__.moduleInfo, pr = (e, t) => {
582
585
  remoteEntryKey: r,
583
586
  entryExports: I[r]
584
587
  };
585
- }, Er = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, gr = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${fe}|${ut})`, br = `(?:-?(${Ve}(?:\\.${Ve})*))`, Be = `(?:${Y}|${ut})`, ft = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
588
+ }, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${fe}|${ut})`, br = `(?:-?(${Ve}(?:\\.${Ve})*))`, Be = `(?:${Y}|${ut})`, ft = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
586
589
  function M(e) {
587
590
  return new RegExp(e);
588
591
  }
@@ -693,20 +696,20 @@ function X(e, t) {
693
696
  try {
694
697
  const u = jr(h);
695
698
  if (!u.trim()) return !0;
696
- const d = u.split(" ").map((E) => Wr(E)).join(" ");
699
+ const d = u.split(" ").map((g) => Wr(g)).join(" ");
697
700
  if (!d.trim()) return !0;
698
- const m = d.split(/\s+/).map((E) => Ur(E)).filter(Boolean);
701
+ const m = d.split(/\s+/).map((g) => Ur(g)).filter(Boolean);
699
702
  if (m.length === 0) continue;
700
703
  let y = !0;
701
- for (const E of m) {
702
- const p = We(E);
704
+ for (const g of m) {
705
+ const p = We(g);
703
706
  if (!p) {
704
707
  y = !1;
705
708
  break;
706
709
  }
707
- const [, g, , b, N, _, $] = p;
710
+ const [, E, , b, N, _, $] = p;
708
711
  if (!Br({
709
- operator: g,
712
+ operator: E,
710
713
  version: je(b, N, _, $),
711
714
  major: b,
712
715
  minor: N,
@@ -854,8 +857,8 @@ function de(e, t, r, n) {
854
857
  const y = e[c][t][h];
855
858
  if (o.singleton) {
856
859
  if (typeof f == "string" && !X(h, f)) {
857
- const E = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
858
- o.strictVersion ? S(E) : Oe(E);
860
+ const g = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
861
+ o.strictVersion ? S(g) : Oe(g);
859
862
  }
860
863
  return {
861
864
  shared: y,
@@ -870,17 +873,17 @@ function de(e, t, r, n) {
870
873
  shared: y,
871
874
  useTreesShaking: u
872
875
  };
873
- const E = ee(a);
874
- if (E) {
875
- for (const [p, g] of Object.entries(e[c][t]))
876
- if (ee(g.treeShaking, a == null ? void 0 : a.usedExports) && X(p, f))
876
+ const g = ee(a);
877
+ if (g) {
878
+ for (const [p, E] of Object.entries(e[c][t]))
879
+ if (ee(E.treeShaking, a == null ? void 0 : a.usedExports) && X(p, f))
877
880
  return {
878
- shared: g,
879
- useTreesShaking: E
881
+ shared: E,
882
+ useTreesShaking: g
880
883
  };
881
884
  }
882
- for (const [p, g] of Object.entries(e[c][t])) if (X(p, f)) return {
883
- shared: g,
885
+ for (const [p, E] of Object.entries(e[c][t])) if (X(p, f)) return {
886
+ shared: E,
884
887
  useTreesShaking: !1
885
888
  };
886
889
  }
@@ -896,7 +899,7 @@ function de(e, t, r, n) {
896
899
  return (n.emit(m) || m).resolver();
897
900
  }
898
901
  }
899
- function Et() {
902
+ function gt() {
900
903
  return Q.__FEDERATION__.__SHARE__;
901
904
  }
902
905
  function qe(e) {
@@ -966,8 +969,8 @@ function Qr(e, t) {
966
969
  for (const r of e)
967
970
  if (t === r.name || r.alias && t === r.alias) return r;
968
971
  }
969
- const gt = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Ae = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", O = {
970
- [gt]: "Failed to get remoteEntry exports.",
972
+ const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Ae = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", tn = "RUNTIME-012", O = {
973
+ [Et]: "Failed to get remoteEntry exports.",
971
974
  [_t]: 'The remote entry interface does not contain "init"',
972
975
  [bt]: "Failed to get manifest.",
973
976
  [Rt]: "Failed to locate remote.",
@@ -977,13 +980,14 @@ const gt = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-
977
980
  [He]: "Failed to load script resources.",
978
981
  [en]: "Please call createInstance first.",
979
982
  [wt]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
980
- [Nt]: "The remoteEntry URL is missing from the remote snapshot."
983
+ [Nt]: "The remoteEntry URL is missing from the remote snapshot.",
984
+ [tn]: '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.'
981
985
  };
982
986
  ({
983
987
  ...O
984
988
  });
985
989
  const It = ".then(callbacks[0]).catch(callbacks[1])";
986
- async function tn({ entry: e, remoteEntryExports: t }) {
990
+ async function rn({ entry: e, remoteEntryExports: t }) {
987
991
  return new Promise((r, n) => {
988
992
  try {
989
993
  t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${It}`)([r, n]) : import(
@@ -996,7 +1000,7 @@ async function tn({ entry: e, remoteEntryExports: t }) {
996
1000
  }
997
1001
  });
998
1002
  }
999
- async function rn({ entry: e, remoteEntryExports: t }) {
1003
+ async function nn({ entry: e, remoteEntryExports: t }) {
1000
1004
  return new Promise((r, n) => {
1001
1005
  try {
1002
1006
  t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${It}`)([r, n]);
@@ -1007,13 +1011,13 @@ async function rn({ entry: e, remoteEntryExports: t }) {
1007
1011
  }
1008
1012
  function Tt(e, t, r) {
1009
1013
  const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
1010
- return o || S(gt, O, {
1014
+ return o || S(Et, O, {
1011
1015
  remoteName: e,
1012
1016
  remoteEntryUrl: r,
1013
1017
  remoteEntryKey: n
1014
1018
  }), o;
1015
1019
  }
1016
- async function nn({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl: o }) {
1020
+ async function on({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl: o }) {
1017
1021
  const { entryExports: s } = Ce(e, t);
1018
1022
  if (s) return s;
1019
1023
  const i = o ? o(r) : r;
@@ -1035,22 +1039,22 @@ async function nn({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl
1035
1039
  }, l);
1036
1040
  });
1037
1041
  }
1038
- async function on({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1042
+ async function sn({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1039
1043
  const { entry: o, entryGlobalName: s, name: i, type: a } = e;
1040
1044
  switch (a) {
1041
1045
  case "esm":
1042
1046
  case "module":
1043
- return tn({
1047
+ return rn({
1044
1048
  entry: o,
1045
1049
  remoteEntryExports: t
1046
1050
  });
1047
1051
  case "system":
1048
- return rn({
1052
+ return nn({
1049
1053
  entry: o,
1050
1054
  remoteEntryExports: t
1051
1055
  });
1052
1056
  default:
1053
- return nn({
1057
+ return on({
1054
1058
  entry: o,
1055
1059
  globalName: s,
1056
1060
  name: i,
@@ -1059,7 +1063,7 @@ async function on({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
1059
1063
  });
1060
1064
  }
1061
1065
  }
1062
- async function sn({ remoteInfo: e, loaderHook: t }) {
1066
+ async function an({ remoteInfo: e, loaderHook: t }) {
1063
1067
  const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Ce(o, n);
1064
1068
  return i || ar(r, {
1065
1069
  attrs: {
@@ -1092,12 +1096,12 @@ async function pe(e) {
1092
1096
  loaderHook: l,
1093
1097
  remoteInfo: n,
1094
1098
  remoteEntryExports: r
1095
- }).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? on({
1099
+ }).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? sn({
1096
1100
  remoteInfo: n,
1097
1101
  remoteEntryExports: r,
1098
1102
  loaderHook: l,
1099
1103
  getEntryUrl: o
1100
- }) : sn({
1104
+ }) : an({
1101
1105
  remoteInfo: n,
1102
1106
  loaderHook: l
1103
1107
  }))).catch(async (c) => {
@@ -1130,11 +1134,11 @@ function ke(e) {
1130
1134
  shareScope: e.shareScope || re
1131
1135
  };
1132
1136
  }
1133
- function an() {
1137
+ function cn() {
1134
1138
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1135
1139
  }
1136
- function cn(e, t) {
1137
- const r = Er(), n = [
1140
+ function ln(e, t) {
1141
+ const r = gr(), n = [
1138
1142
  t.hooks,
1139
1143
  t.remoteHandler.hooks,
1140
1144
  t.sharedHandler.hooks,
@@ -1150,7 +1154,7 @@ function cn(e, t) {
1150
1154
  });
1151
1155
  }), e;
1152
1156
  }
1153
- function ln(e) {
1157
+ function un(e) {
1154
1158
  return {
1155
1159
  name: e.name,
1156
1160
  alias: e.alias,
@@ -1181,7 +1185,7 @@ function z(e) {
1181
1185
  },
1182
1186
  mfConfig: {
1183
1187
  name: e.name,
1184
- remotes: ((a = e.remotes) == null ? void 0 : a.map(ln)) ?? [],
1188
+ remotes: ((a = e.remotes) == null ? void 0 : a.map(un)) ?? [],
1185
1189
  shared: t
1186
1190
  }
1187
1191
  };
@@ -1195,7 +1199,7 @@ function vt(e) {
1195
1199
  ...e
1196
1200
  };
1197
1201
  }
1198
- function un(e, t) {
1202
+ function fn(e, t) {
1199
1203
  return t.map((r) => {
1200
1204
  const n = Qr(e, r.nameOrAlias);
1201
1205
  return P(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Ze({
@@ -1207,7 +1211,7 @@ function un(e, t) {
1207
1211
  };
1208
1212
  });
1209
1213
  }
1210
- function fn(e) {
1214
+ function hn(e) {
1211
1215
  return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1212
1216
  }
1213
1217
  function At(e, t, r, n = !0) {
@@ -1230,7 +1234,7 @@ function At(e, t, r, n = !0) {
1230
1234
  as: "style"
1231
1235
  };
1232
1236
  o.forEach((l) => {
1233
- const { link: c, needAttach: f } = ge({
1237
+ const { link: c, needAttach: f } = Ee({
1234
1238
  url: l,
1235
1239
  cb: () => {
1236
1240
  },
@@ -1251,7 +1255,7 @@ function At(e, t, r, n = !0) {
1251
1255
  type: "text/css"
1252
1256
  };
1253
1257
  o.forEach((l) => {
1254
- const { link: c, needAttach: f } = ge({
1258
+ const { link: c, needAttach: f } = Ee({
1255
1259
  url: l,
1256
1260
  cb: () => {
1257
1261
  },
@@ -1274,7 +1278,7 @@ function At(e, t, r, n = !0) {
1274
1278
  as: "script"
1275
1279
  };
1276
1280
  s.forEach((l) => {
1277
- const { link: c, needAttach: f } = ge({
1281
+ const { link: c, needAttach: f } = Ee({
1278
1282
  url: l,
1279
1283
  cb: () => {
1280
1284
  },
@@ -1314,7 +1318,7 @@ function At(e, t, r, n = !0) {
1314
1318
  }
1315
1319
  }
1316
1320
  }
1317
- function hn(e, t, r) {
1321
+ function dn(e, t, r) {
1318
1322
  const n = t, o = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1319
1323
  o.length || o.push("default"), o.forEach((i) => {
1320
1324
  n[i] || (n[i] = {});
@@ -1352,7 +1356,7 @@ var Pt = class {
1352
1356
  if (this.initPromise)
1353
1357
  return await this.initPromise, n;
1354
1358
  this.initing = !0, this.initPromise = (async () => {
1355
- const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = hn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1359
+ const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = dn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1356
1360
  shareScope: s,
1357
1361
  remoteEntryInitOptions: o,
1358
1362
  initScope: i,
@@ -1517,7 +1521,7 @@ function Ot(e, t) {
1517
1521
  let n = Ne(t, r.url);
1518
1522
  !F && !n.startsWith("http") && (n = `https:${n}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = n, e.version = t.version, e.buildVersion = t.buildVersion;
1519
1523
  }
1520
- function dn() {
1524
+ function mn() {
1521
1525
  return {
1522
1526
  name: "snapshot-plugin",
1523
1527
  async afterResolve(e) {
@@ -1554,7 +1558,7 @@ function dn() {
1554
1558
  }
1555
1559
  };
1556
1560
  }
1557
- function mn(e) {
1561
+ function pn(e) {
1558
1562
  const t = e.split(":");
1559
1563
  return t.length === 1 ? {
1560
1564
  name: t[0],
@@ -1574,7 +1578,7 @@ function Lt(e, t, r, n, o = {}, s) {
1574
1578
  for (const c of l) {
1575
1579
  if (o[c]) continue;
1576
1580
  o[c] = !0;
1577
- const f = mn(c), h = a.remotesInfo[c];
1581
+ const f = pn(c), h = a.remotesInfo[c];
1578
1582
  Lt(e, {
1579
1583
  name: f.name,
1580
1584
  version: h.matchedVersion
@@ -1583,33 +1587,33 @@ function Lt(e, t, r, n, o = {}, s) {
1583
1587
  }
1584
1588
  }
1585
1589
  const Se = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1586
- function pn(e, t, r, n, o) {
1590
+ function yn(e, t, r, n, o) {
1587
1591
  const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: f } = e, { preloadConfig: h } = t, { depsRemote: u } = h;
1588
- if (Lt(n, r, (m, y, E) => {
1592
+ if (Lt(n, r, (m, y, g) => {
1589
1593
  var $;
1590
1594
  let p;
1591
- if (E) p = h;
1595
+ if (g) p = h;
1592
1596
  else if (Array.isArray(u)) {
1593
1597
  const R = u.find((w) => w.nameOrAlias === y.name || w.nameOrAlias === y.alias);
1594
1598
  if (!R) return;
1595
1599
  p = vt(R);
1596
1600
  } else if (u === !0) p = h;
1597
1601
  else return;
1598
- const g = Ne(m, ct(m).url);
1599
- g && a.push({
1602
+ const E = Ne(m, ct(m).url);
1603
+ E && a.push({
1600
1604
  name: y.name,
1601
1605
  moduleInfo: {
1602
1606
  name: y.name,
1603
- entry: g,
1607
+ entry: E,
1604
1608
  type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1605
1609
  entryGlobalName: "globalName" in m ? m.globalName : y.name,
1606
1610
  shareScope: "",
1607
1611
  version: "version" in m ? m.version : void 0
1608
1612
  },
1609
- url: g
1613
+ url: E
1610
1614
  });
1611
1615
  let b = "modules" in m ? m.modules : [];
1612
- const N = fn(p.exposes);
1616
+ const N = hn(p.exposes);
1613
1617
  N.length && "modules" in m && (b = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((R, w) => ((N == null ? void 0 : N.indexOf(w.moduleName)) !== -1 && R.push(w), R), []));
1614
1618
  function _(R) {
1615
1619
  const w = R.map((L) => Ne(m, L));
@@ -1626,23 +1630,23 @@ function pn(e, t, r, n, o) {
1626
1630
  preloadConfig: p,
1627
1631
  remote: y,
1628
1632
  origin: e
1629
- }), !gr(ye) && (p.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : p.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
1633
+ }), !Er(ye) && (p.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : p.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
1630
1634
  }
1631
1635
  }
1632
1636
  }, !0, {}, o), o.shared && o.shared.length > 0) {
1633
- const m = (y, E) => {
1634
- const { shared: p } = de(e.shareScopeMap, E.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1635
- p && typeof p.lib == "function" && (E.assets.js.sync.forEach((g) => {
1636
- l.add(g);
1637
- }), E.assets.css.sync.forEach((g) => {
1638
- c.add(g);
1637
+ const m = (y, g) => {
1638
+ const { shared: p } = de(e.shareScopeMap, g.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1639
+ p && typeof p.lib == "function" && (g.assets.js.sync.forEach((E) => {
1640
+ l.add(E);
1641
+ }), g.assets.css.sync.forEach((E) => {
1642
+ c.add(E);
1639
1643
  }));
1640
1644
  };
1641
1645
  o.shared.forEach((y) => {
1642
- var g;
1643
- const E = (g = f.shared) == null ? void 0 : g[y.sharedName];
1644
- if (!E) return;
1645
- const p = y.version ? E.find((b) => b.version === y.version) : E;
1646
+ var E;
1647
+ const g = (E = f.shared) == null ? void 0 : E[y.sharedName];
1648
+ if (!g) return;
1649
+ const p = y.version ? g.find((b) => b.version === y.version) : g;
1646
1650
  p && at(p).forEach((b) => {
1647
1651
  m(b, y);
1648
1652
  });
@@ -1655,7 +1659,7 @@ function pn(e, t, r, n, o) {
1655
1659
  entryAssets: a.filter((m) => !Se("script", m.url))
1656
1660
  };
1657
1661
  }
1658
- const yn = function() {
1662
+ const gn = function() {
1659
1663
  return {
1660
1664
  name: "generate-preload-assets-plugin",
1661
1665
  async generatePreloadAssets(e) {
@@ -1674,7 +1678,7 @@ const yn = function() {
1674
1678
  shareScope: ""
1675
1679
  }
1676
1680
  }]
1677
- } : (Ot(n, i), pn(t, r, n, s, i)) : {
1681
+ } : (Ot(n, i), yn(t, r, n, s, i)) : {
1678
1682
  cssAssets: [],
1679
1683
  jsAssetsWithoutEntry: [],
1680
1684
  entryAssets: []
@@ -1819,7 +1823,7 @@ var En = class {
1819
1823
  };
1820
1824
  return this.manifestLoading[e] || (this.manifestLoading[e] = o().then((s) => s)), this.manifestLoading[e];
1821
1825
  }
1822
- }, gn = class {
1826
+ }, _n = class {
1823
1827
  constructor(e) {
1824
1828
  this.hooks = new j({
1825
1829
  beforeRegisterShare: new W("beforeRegisterShare"),
@@ -1939,8 +1943,8 @@ var En = class {
1939
1943
  var b;
1940
1944
  const { version: m, eager: y } = d;
1941
1945
  c[u] = c[u] || {};
1942
- const E = c[u], p = E[m] && ie(E[m]), g = !!(p && ("eager" in p && p.eager || "shareConfig" in p && ((b = p.shareConfig) != null && b.eager)));
1943
- (!p || p.strategy !== "loaded-first" && !p.loaded && (!y != !g ? y : l > E[m].from)) && (E[m] = d);
1946
+ const g = c[u], p = g[m] && ie(g[m]), E = !!(p && ("eager" in p && p.eager || "shareConfig" in p && ((b = p.shareConfig) != null && b.eager)));
1947
+ (!p || p.strategy !== "loaded-first" && !p.loaded && (!y != !E ? y : l > g[m].from)) && (g[m] = d);
1944
1948
  }, h = async (u) => {
1945
1949
  const { module: d } = await r.remoteHandler.getRemoteModuleAndOptions({ id: u });
1946
1950
  let m;
@@ -2023,8 +2027,8 @@ var En = class {
2023
2027
  }
2024
2028
  setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
2025
2029
  const { version: l, scope: c = "default", ...f } = t, h = Array.isArray(c) ? c : [c], u = (d) => {
2026
- const m = (E, p, g) => {
2027
- g && !E[p] && (E[p] = g);
2030
+ const m = (g, p, E) => {
2031
+ E && !g[p] && (g[p] = E);
2028
2032
  }, y = a ? d.treeShaking : d;
2029
2033
  m(y, "loaded", s), m(y, "loading", o), m(y, "get", i);
2030
2034
  };
@@ -2040,10 +2044,10 @@ var En = class {
2040
2044
  });
2041
2045
  }
2042
2046
  _setGlobalShareScopeMap(e) {
2043
- const t = Et(), r = e.id || e.name;
2047
+ const t = gt(), r = e.id || e.name;
2044
2048
  r && !t[r] && (t[r] = this.shareScopeMap);
2045
2049
  }
2046
- }, _n = class {
2050
+ }, bn = class {
2047
2051
  constructor(e) {
2048
2052
  this.hooks = new j({
2049
2053
  beforeRegisterRemote: new W("beforeRegisterRemote"),
@@ -2116,7 +2120,7 @@ var En = class {
2116
2120
  options: t.options,
2117
2121
  origin: t
2118
2122
  });
2119
- const r = un(t.options.remotes, e);
2123
+ const r = fn(t.options.remotes, e);
2120
2124
  await Promise.all(r.map(async (n) => {
2121
2125
  const { remote: o } = n, s = ke(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
2122
2126
  origin: t,
@@ -2223,34 +2227,34 @@ var En = class {
2223
2227
  if (f !== -1) {
2224
2228
  const u = I.__FEDERATION__.__INSTANCES__[f];
2225
2229
  c = u.options.id || c;
2226
- const d = Et();
2230
+ const d = gt();
2227
2231
  let m = !0;
2228
2232
  const y = [];
2229
- Object.keys(d).forEach((E) => {
2230
- const p = d[E];
2231
- p && Object.keys(p).forEach((g) => {
2232
- const b = p[g];
2233
+ Object.keys(d).forEach((g) => {
2234
+ const p = d[g];
2235
+ p && Object.keys(p).forEach((E) => {
2236
+ const b = p[E];
2233
2237
  b && Object.keys(b).forEach((N) => {
2234
2238
  const _ = b[N];
2235
2239
  _ && Object.keys(_).forEach(($) => {
2236
2240
  const R = _[$];
2237
2241
  R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((w) => w !== i.name), R.useIn.length ? m = !1 : y.push([
2238
- E,
2239
2242
  g,
2243
+ E,
2240
2244
  N,
2241
2245
  $
2242
2246
  ])) : y.push([
2243
- E,
2244
2247
  g,
2248
+ E,
2245
2249
  N,
2246
2250
  $
2247
2251
  ]));
2248
2252
  });
2249
2253
  });
2250
2254
  });
2251
- }), m && (u.shareScopeMap = {}, delete d[c]), y.forEach(([E, p, g, b]) => {
2255
+ }), m && (u.shareScopeMap = {}, delete d[c]), y.forEach(([g, p, E, b]) => {
2252
2256
  var N, _, $;
2253
- ($ = (_ = (N = d[E]) == null ? void 0 : N[p]) == null ? void 0 : _[g]) == null || delete $[b];
2257
+ ($ = (_ = (N = d[g]) == null ? void 0 : N[p]) == null ? void 0 : _[E]) == null || delete $[b];
2254
2258
  }), I.__FEDERATION__.__INSTANCES__.splice(f, 1);
2255
2259
  }
2256
2260
  const { hostGlobalSnapshot: h } = Mt(e, r);
@@ -2265,15 +2269,15 @@ var En = class {
2265
2269
  }
2266
2270
  }
2267
2271
  };
2268
- const bn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2269
- var Rn = class {
2272
+ const Rn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2273
+ var Sn = class {
2270
2274
  constructor(e) {
2271
2275
  this.hooks = new j({
2272
2276
  beforeInit: new W("beforeInit"),
2273
2277
  init: new v(),
2274
2278
  beforeInitContainer: new D("beforeInitContainer"),
2275
2279
  initContainer: new D("initContainer")
2276
- }), this.version = "2.2.3", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2280
+ }), this.version = "2.3.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2277
2281
  getModuleInfo: new v(),
2278
2282
  createScript: new v(),
2279
2283
  createLink: new v(),
@@ -2286,15 +2290,15 @@ var Rn = class {
2286
2290
  beforeBridgeDestroy: new v(),
2287
2291
  afterBridgeDestroy: new v()
2288
2292
  });
2289
- const t = bn ? [dn(), yn()] : [], r = {
2290
- id: an(),
2293
+ const t = Rn ? [mn(), gn()] : [], r = {
2294
+ id: cn(),
2291
2295
  name: e.name,
2292
2296
  plugins: t,
2293
2297
  remotes: [],
2294
2298
  shared: {},
2295
2299
  inBrowser: F
2296
2300
  };
2297
- this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new gn(this), this.remoteHandler = new _n(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2301
+ this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new _n(this), this.remoteHandler = new bn(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2298
2302
  }
2299
2303
  initOptions(e) {
2300
2304
  e.name && e.name !== this.options.name && S(st(wt, O)), this.registerPlugins(e.plugins);
@@ -2352,7 +2356,7 @@ var Rn = class {
2352
2356
  }), l;
2353
2357
  }
2354
2358
  registerPlugins(e) {
2355
- const t = cn(e, this);
2359
+ const t = ln(e, this);
2356
2360
  this.options.plugins = this.options.plugins.reduce((r, n) => (n && r && !r.find((o) => o.name === n.name) && r.push(n), r), t || []);
2357
2361
  }
2358
2362
  registerRemotes(e, t) {
@@ -2365,11 +2369,11 @@ var Rn = class {
2365
2369
  });
2366
2370
  }
2367
2371
  };
2368
- let Sn = null;
2372
+ let $n = null;
2369
2373
  function Ct() {
2370
- return Sn;
2374
+ return $n;
2371
2375
  }
2372
- mr(Rn);
2376
+ mr(Sn);
2373
2377
  function Dt(e, t) {
2374
2378
  const r = (n) => {
2375
2379
  const o = n.length > 1 && n.endsWith("/"), s = `${t}/${n}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
@@ -2389,7 +2393,7 @@ function Dt(e, t) {
2389
2393
  )), o;
2390
2394
  });
2391
2395
  }
2392
- function $n(e) {
2396
+ function wn(e) {
2393
2397
  const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
2394
2398
  (u, d) => u.path.split("/").filter((m) => m).length - d.path.split("/").filter((m) => m).length
2395
2399
  ), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
@@ -2400,14 +2404,14 @@ function $n(e) {
2400
2404
  if (!u.children || u.children.length === 0)
2401
2405
  return u;
2402
2406
  for (let m = 0; m < u.children.length; m++) {
2403
- const y = u.children[m], E = l(d, y.path), p = i.get(E);
2407
+ const y = u.children[m], g = l(d, y.path), p = i.get(g);
2404
2408
  if (p && !a.has(p)) {
2405
- const g = {
2409
+ const E = {
2406
2410
  ...p,
2407
2411
  path: y.path
2408
2412
  // Keep the original relative path from static route
2409
2413
  };
2410
- u.children[m] = g, a.add(p), c(g, E);
2414
+ u.children[m] = E, a.add(p), c(E, g);
2411
2415
  }
2412
2416
  }
2413
2417
  return u;
@@ -2424,12 +2428,12 @@ function $n(e) {
2424
2428
  routes: f
2425
2429
  };
2426
2430
  }
2427
- function An(e) {
2431
+ function Pn(e) {
2428
2432
  const t = /* @__PURE__ */ new Map(), r = Ct();
2429
2433
  return () => ({
2430
- __APP_VERSION__: "2.2.3",
2434
+ __APP_VERSION__: "2.3.0",
2431
2435
  async render(n) {
2432
- var m, y, E;
2436
+ var m, y, g;
2433
2437
  C.debug("createBridgeComponent render Info", n);
2434
2438
  const {
2435
2439
  moduleName: o,
@@ -2440,7 +2444,7 @@ function An(e) {
2440
2444
  ...c
2441
2445
  } = n, f = Ft.createApp(e.rootComponent, c);
2442
2446
  t.set(s, f);
2443
- const h = await ((E = (y = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : E.emit(n)), u = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
2447
+ const h = await ((g = (y = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : g.emit(n)), u = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
2444
2448
  app: f,
2445
2449
  basename: i,
2446
2450
  memoryRoute: a,
@@ -2449,7 +2453,7 @@ function An(e) {
2449
2453
  ...u
2450
2454
  });
2451
2455
  if (d != null && d.router) {
2452
- const { history: p, routes: g } = $n({
2456
+ const { history: p, routes: E } = wn({
2453
2457
  router: d.router,
2454
2458
  basename: n.basename,
2455
2459
  memoryRoute: n.memoryRoute,
@@ -2457,7 +2461,7 @@ function An(e) {
2457
2461
  }), b = ae.createRouter({
2458
2462
  ...d.router.options,
2459
2463
  history: p,
2460
- routes: g
2464
+ routes: E
2461
2465
  });
2462
2466
  C.debug("createBridgeComponent render router info>>>", {
2463
2467
  moduleName: o,
@@ -2473,11 +2477,11 @@ function An(e) {
2473
2477
  }
2474
2478
  });
2475
2479
  }
2476
- function wn() {
2480
+ function Nn() {
2477
2481
  const e = new PopStateEvent("popstate", { state: window.history.state });
2478
2482
  window.dispatchEvent(e);
2479
2483
  }
2480
- const Nn = /* @__PURE__ */ Ht({
2484
+ const In = /* @__PURE__ */ Ht({
2481
2485
  name: "RemoteApp",
2482
2486
  props: {
2483
2487
  moduleName: String,
@@ -2489,7 +2493,7 @@ const Nn = /* @__PURE__ */ Ht({
2489
2493
  },
2490
2494
  inheritAttrs: !1,
2491
2495
  setup(e) {
2492
- const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2496
+ const t = ge(null), r = ge(null), n = ge(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2493
2497
  var u, d, m, y;
2494
2498
  const c = (u = e.providerInfo) == null ? void 0 : u.call(e);
2495
2499
  r.value = c;
@@ -2511,7 +2515,7 @@ const Nn = /* @__PURE__ */ Ht({
2511
2515
  c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2512
2516
  ...e,
2513
2517
  pathname: o.path
2514
- }), wn()), n.value = c;
2518
+ }), Nn()), n.value = c;
2515
2519
  });
2516
2520
  return Ut(() => {
2517
2521
  a();
@@ -2527,9 +2531,9 @@ const Nn = /* @__PURE__ */ Ht({
2527
2531
  }), null);
2528
2532
  }
2529
2533
  });
2530
- function In(e) {
2534
+ function Tn(e) {
2531
2535
  return jt({
2532
- __APP_VERSION__: "2.2.3",
2536
+ __APP_VERSION__: "2.3.0",
2533
2537
  ...e.asyncComponentOptions,
2534
2538
  //@ts-ignore
2535
2539
  loader: async () => {
@@ -2553,7 +2557,7 @@ function In(e) {
2553
2557
  ), o in s && typeof a == "function")
2554
2558
  return {
2555
2559
  render() {
2556
- return qt(Nn, {
2560
+ return qt(In, {
2557
2561
  moduleName: i,
2558
2562
  providerInfo: a,
2559
2563
  basename: r,
@@ -2567,13 +2571,13 @@ function In(e) {
2567
2571
  }
2568
2572
  });
2569
2573
  }
2570
- function Pn(e) {
2574
+ function kn(e) {
2571
2575
  return C.warn(
2572
2576
  "createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
2573
- ), In(e);
2577
+ ), Tn(e);
2574
2578
  }
2575
2579
  export {
2576
- An as createBridgeComponent,
2577
- In as createRemoteAppComponent,
2578
- Pn as createRemoteComponent
2580
+ Pn as createBridgeComponent,
2581
+ Tn as createRemoteAppComponent,
2582
+ kn as createRemoteComponent
2579
2583
  };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "git+https://github.com/module-federation/core.git",
8
8
  "directory": "packages/bridge/vue3-bridge"
9
9
  },
10
- "version": "2.2.3",
10
+ "version": "2.3.0",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -31,9 +31,9 @@
31
31
  "vue-router": "=4"
32
32
  },
33
33
  "dependencies": {
34
- "@module-federation/bridge-shared": "2.2.3",
35
- "@module-federation/sdk": "2.2.3",
36
- "@module-federation/runtime": "2.2.3"
34
+ "@module-federation/bridge-shared": "2.3.0",
35
+ "@module-federation/runtime": "2.3.0",
36
+ "@module-federation/sdk": "2.3.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^18.3.11",