@module-federation/playground 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -14
- package/dist/esm/index.mjs +16 -15
- package/dist/mf/{117.js → 24.js} +2 -2
- package/dist/mf/{844.js → 453.js} +2 -2
- package/dist/mf/{427.js → 560.js} +2 -2
- package/dist/mf/{97.js → 952.js} +2 -2
- package/dist/mf/__federation_expose_default_export.js +3 -3
- package/dist/mf/__federation_expose_demo.js +1 -1
- package/dist/mf/index.js +7 -7
- package/dist/mf/mf-manifest.json +6 -6
- package/dist/mf/mf-stats.json +6 -6
- package/dist/mf/remoteEntry.js +6 -6
- package/dist/mf/ssr/__federation_expose_default_exportmf_playground.js +2 -2
- package/dist/mf/ssr/index.js +6 -6
- package/dist/mf/ssr/mf-manifest.json +2 -2
- package/dist/mf/ssr/mf-stats.json +2 -2
- package/dist/mf/ssr/remoteEntry.js +4 -4
- package/dist/{cjs/index.d.ts → types/App.d.ts} +24 -34
- package/dist/types/component.d.ts +3 -0
- package/dist/types/consumerCompiler.d.ts +11 -0
- package/dist/types/demo.d.ts +4 -0
- package/dist/types/generated/bridgeRuntimeFiles.d.ts +13 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/monacoEnvironment.d.ts +1 -0
- package/dist/types/sandbox.d.ts +30 -0
- package/package.json +9 -8
- package/dist/esm/index.d.ts +0 -34
- package/dist/mf/index.d.ts +0 -34
- /package/dist/mf/{117.js.LICENSE.txt → 24.js.LICENSE.txt} +0 -0
- /package/dist/mf/{844.js.LICENSE.txt → 453.js.LICENSE.txt} +0 -0
- /package/dist/mf/{427.js.LICENSE.txt → 560.js.LICENSE.txt} +0 -0
- /package/dist/mf/{97.js.LICENSE.txt → 952.js.LICENSE.txt} +0 -0
package/dist/mf/ssr/index.js
CHANGED
|
@@ -382,7 +382,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
382
382
|
${originalErrorMsg}`);return msg.join("\n")};exports.getShortErrorMsg=getShortErrorMsg},7110:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const require_error_codes=__webpack_require__(5045);const require_getShortErrorMsg=__webpack_require__(3357);const require_desc=__webpack_require__(7517);exports.BUILD_001=require_error_codes.BUILD_001;exports.BUILD_002=require_error_codes.BUILD_002;exports.RUNTIME_001=require_error_codes.RUNTIME_001;exports.RUNTIME_002=require_error_codes.RUNTIME_002;exports.RUNTIME_003=require_error_codes.RUNTIME_003;exports.RUNTIME_004=require_error_codes.RUNTIME_004;exports.RUNTIME_005=require_error_codes.RUNTIME_005;exports.RUNTIME_006=require_error_codes.RUNTIME_006;exports.RUNTIME_007=require_error_codes.RUNTIME_007;exports.RUNTIME_008=require_error_codes.RUNTIME_008;exports.RUNTIME_009=require_error_codes.RUNTIME_009;exports.RUNTIME_010=require_error_codes.RUNTIME_010;exports.RUNTIME_011=require_error_codes.RUNTIME_011;exports.RUNTIME_012=require_error_codes.RUNTIME_012;exports.RUNTIME_013=require_error_codes.RUNTIME_013;exports.RUNTIME_014=require_error_codes.RUNTIME_014;exports.RUNTIME_015=require_error_codes.RUNTIME_015;exports.TYPE_001=require_error_codes.TYPE_001;exports.buildDescMap=require_desc.buildDescMap;exports.errorDescMap=require_desc.errorDescMap;exports.getShortErrorMsg=require_getShortErrorMsg.getShortErrorMsg;exports.runtimeDescMap=require_desc.runtimeDescMap;exports.typeDescMap=require_desc.typeDescMap},4534:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperties(exports,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}});const nodeRuntimeImportCache=/* @__PURE__ */new Map;const CHUNK_PREVIEW_LENGTH=240;const getChunkPreview=content=>content.slice(0,CHUNK_PREVIEW_LENGTH).replace(/\s+/g," ").trim();const enrichChunkExecutionError=(error,options)=>{const normalizedError=error instanceof Error?error:new Error(String(error));const preview=getChunkPreview(options.content);const details=["Federated chunk execution failed.",`chunk: ${options.chunkName}`,`source: ${options.source}`,`location: ${options.location}`];if(options.hostName)details.push(`host: ${options.hostName}`);if(options.resolution){details.push(`resolved-from: ${options.resolution.resolvedFrom}`);if(options.resolution.remoteName)details.push(`remote: ${options.resolution.remoteName}`);if(options.resolution.publicPath)details.push(`public-path: ${options.resolution.publicPath}`);if(options.resolution.rootOutputDir)details.push(`root-output-dir: ${options.resolution.rootOutputDir}`);if(options.resolution.remoteEntryUrl)details.push(`remote-entry: ${options.resolution.remoteEntryUrl}`)}if(preview)details.push(`preview: ${preview}`);normalizedError.message=`${normalizedError.message}
|
|
383
383
|
${details.join("\n")}`;Object.assign(normalizedError,{chunkName:options.chunkName,chunkLocation:options.location,chunkSource:options.source,chunkPreview:preview,chunkHostName:options.hostName,chunkResolution:options.resolution});return normalizedError};function importNodeModule(name){if(!name)throw new Error("import specifier is required");if(nodeRuntimeImportCache.has(name))return nodeRuntimeImportCache.get(name);const promise=new Function("name","return import(name)")(name).then(res=>res.default).catch(error=>{console.error(`Error importing module ${name}:`,error);nodeRuntimeImportCache.delete(name);throw error});nodeRuntimeImportCache.set(name,promise);return promise}const resolveFile=(rootOutputDir,chunkId)=>require("path").join(__dirname,rootOutputDir+__webpack_require__.u(chunkId));const returnFromCache=remoteName=>{const federationInstances=new Function("return globalThis")()["__FEDERATION__"]["__INSTANCES__"];for(const instance of federationInstances){const moduleContainer=instance.moduleCache.get(remoteName);if(moduleContainer?.remoteInfo)return moduleContainer.remoteInfo.entry}return null};const returnFromGlobalInstances=remoteName=>{const federationInstances=new Function("return globalThis")()["__FEDERATION__"]["__INSTANCES__"];for(const instance of federationInstances)for(const remote of instance.options.remotes)if(remote.name===remoteName||remote.alias===remoteName){console.log("Backup remote entry found:",remote.entry);return remote.entry}return null};const loadFromFs=(filename,callback)=>{const fs=require("fs");const path=require("path");const vm=require("vm");if(fs.existsSync(filename))fs.readFile(filename,"utf-8",(err,content)=>{if(err)return callback(err,null);const chunk={};try{new vm.Script(`(function(exports, require, __dirname, __filename) {${content}
|
|
384
384
|
})`,{filename,importModuleDynamically:vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??importNodeModule}).runInThisContext()(chunk,require,path.dirname(filename),filename);callback(null,chunk)}catch(e){callback(enrichChunkExecutionError(e,{chunkName:path.basename(filename),location:filename,source:"filesystem",content}),null)}});else callback(/* @__PURE__ */new Error(`File ${filename} does not exist`),null)};const fetchAndRun=(url,chunkName,callback,args)=>{("undefined"==typeof fetch?importNodeModule("node-fetch").then(mod=>mod.default):Promise.resolve(fetch)).then(fetchFunction=>args.origin.loaderHook.lifecycle.fetch.emit(url.href,{}).then(res=>{if(!res||!(res instanceof Response))return fetchFunction(url.href).then(response=>response.text());return res.text()})).then(data=>{const chunk={};const hostName=args?.origin?.options?.name||args?.origin?.name;const resolution=url.mfMetadata;try{eval(`(function(exports, require, __dirname, __filename) {${data}
|
|
385
|
-
})`)(chunk,require,url.pathname.split("/").slice(0,-1).join("/"),chunkName);callback(null,chunk)}catch(e){callback(enrichChunkExecutionError(e,{chunkName,location:url.href,source:"remote-url",content:data,hostName,resolution}),null)}}).catch(err=>callback(err,null))};const resolveUrl=(remoteName,chunkName)=>{try{return Object.assign(new URL(chunkName,__webpack_require__.p),{mfMetadata:{chunkName,publicPath:__webpack_require__.p,remoteName,rootOutputDir:__webpack_require__.federation.rootOutputDir||"",resolvedFrom:"public-path"}})}catch{const entryUrl=returnFromCache(remoteName)||returnFromGlobalInstances(remoteName);if(!entryUrl)return null;const url=new URL(entryUrl);const path=require("path");const urlPath=url.pathname;const lastSlashIndex=urlPath.lastIndexOf("/");const directoryPath=lastSlashIndex>=0?urlPath.substring(0,lastSlashIndex+1):"/";const rootDir=__webpack_require__.federation.rootOutputDir||"";const combinedPath=path.join(directoryPath,rootDir,chunkName).replace(/\\/g,"/");return Object.assign(new URL(combinedPath,url.origin),{mfMetadata:{chunkName,publicPath:__webpack_require__.p,remoteName,rootOutputDir:rootDir,resolvedFrom:"remote-entry-fallback",remoteEntryUrl:entryUrl}})}};const loadChunk=(strategy,chunkId,rootOutputDir,callback,args)=>{if("filesystem"===strategy)return loadFromFs(resolveFile(rootOutputDir,chunkId),callback);const url=resolveUrl(rootOutputDir,chunkId);if(!url)return callback(null,{modules:{},ids:[],runtime:null});fetchAndRun(url,chunkId,callback,args)};const installChunk=(chunk,installedChunks)=>{for(const moduleId in chunk.modules)__webpack_require__.m[moduleId]=chunk.modules[moduleId];if(chunk.runtime)chunk.runtime(__webpack_require__);for(const chunkId of chunk.ids){if(installedChunks[chunkId])installedChunks[chunkId][0]();installedChunks[chunkId]=0}};const deleteChunk=(chunkId,installedChunks)=>{delete installedChunks[chunkId];return true};const setupScriptLoader=()=>{__webpack_require__.l=(url,done,key,chunkId)=>{if(!key||chunkId)throw new Error(`__webpack_require__.l name is required for ${url}`);__webpack_require__.federation.runtime.loadScriptNode(url,{attrs:{globalName:key}}).then(res=>{const enhancedRemote=__webpack_require__.federation.instance.initRawContainer(key,url,res);new Function("return globalThis")()[key]=enhancedRemote;done(enhancedRemote)}).catch(done)}};const setupChunkHandler=(installedChunks,args)=>(chunkId,promises)=>{let installedChunkData=installedChunks[chunkId];if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(__webpack_require__.federation.chunkMatcher?__webpack_require__.federation.chunkMatcher(chunkId):true){const promise=new Promise((resolve,reject)=>{installedChunkData=installedChunks[chunkId]=[resolve,reject];const fs="undefined"!=typeof process?require("fs"):false;const filename="undefined"!=typeof process?resolveFile(__webpack_require__.federation.rootOutputDir||"",chunkId):false;if(fs&&fs.existsSync(filename))loadChunk("filesystem",chunkId,__webpack_require__.federation.rootOutputDir||"",(err,chunk)=>{if(err)return deleteChunk(chunkId,installedChunks)&&reject(err);if(chunk)installChunk(chunk,installedChunks);resolve(chunk)},args);else{const chunkName=__webpack_require__.u(chunkId);loadChunk("undefined"==typeof process?"http-eval":"http-vm",chunkName,__webpack_require__.federation.initOptions.name,(err,chunk)=>{if(err)return deleteChunk(chunkId,installedChunks)&&reject(err);if(chunk)installChunk(chunk,installedChunks);resolve(chunk)},args)}});promises.push(installedChunkData[2]=promise)}else installedChunks[chunkId]=0};const setupWebpackRequirePatching=handle=>{if(__webpack_require__.f){if(__webpack_require__.f.require){console.warn("\x1b[33m%s\x1b[0m",'CAUTION: build target is not set to "async-node", attempting to patch additional chunk handlers. This may not work');__webpack_require__.f.require=handle}if(__webpack_require__.f.readFileVm)__webpack_require__.f.readFileVm=handle}};function runtimePlugin_default(){return{name:"node-federation-plugin",beforeInit(args){(()=>{const installedChunks={};setupScriptLoader();setupWebpackRequirePatching(setupChunkHandler(installedChunks,args))})();return args}}}exports["default"]=runtimePlugin_default;exports.deleteChunk=deleteChunk;exports.fetchAndRun=fetchAndRun;exports.importNodeModule=importNodeModule;exports.installChunk=installChunk;exports.loadChunk=loadChunk;exports.loadFromFs=loadFromFs;exports.nodeRuntimeImportCache=nodeRuntimeImportCache;exports.resolveFile=resolveFile;exports.resolveUrl=resolveUrl;exports.returnFromCache=returnFromCache;exports.returnFromGlobalInstances=returnFromGlobalInstances;exports.setupChunkHandler=setupChunkHandler;exports.setupScriptLoader=setupScriptLoader;exports.setupWebpackRequirePatching=setupWebpackRequirePatching},652:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{ModuleFederationPlayground:()=>App,default:()=>App});const App_module={"vp-root":"vp-root-o94tBV",vpRoot:"vp-root-o94tBV","vp-main":"vp-main-ukILls",vpMain:"vp-main-ukILls","vp-left":"vp-left-wWIJZj",vpLeft:"vp-left-wWIJZj","vp-splitter":"vp-splitter-C3LUiw",vpSplitter:"vp-splitter-C3LUiw","vp-card":"vp-card-OxIN8P",vpCard:"vp-card-OxIN8P","vp-cardHeader":"vp-cardHeader-yl8bmF",vpCardHeader:"vp-cardHeader-yl8bmF","vp-cardTitle":"vp-cardTitle-iRjbB2",vpCardTitle:"vp-cardTitle-iRjbB2","vp-editorTabs":"vp-editorTabs-P8EPHu",vpEditorTabs:"vp-editorTabs-P8EPHu","vp-editorTab":"vp-editorTab-en3Nbi",vpEditorTab:"vp-editorTab-en3Nbi","vp-editorTabActive":"vp-editorTabActive-j1OAlc",vpEditorTabActive:"vp-editorTabActive-j1OAlc","vp-cardBody":"vp-cardBody-UdVf2N",vpCardBody:"vp-cardBody-UdVf2N","vp-paneActions":"vp-paneActions-l5K74Q",vpPaneActions:"vp-paneActions-l5K74Q","vp-collapse":"vp-collapse-VViOM4",vpCollapse:"vp-collapse-VViOM4","vp-collapseItem":"vp-collapseItem-MtDnlb",vpCollapseItem:"vp-collapseItem-MtDnlb","vp-collapseHeader":"vp-collapseHeader-Y1drUL",vpCollapseHeader:"vp-collapseHeader-Y1drUL","vp-collapseHeaderActive":"vp-collapseHeaderActive-d5oo1z",vpCollapseHeaderActive:"vp-collapseHeaderActive-d5oo1z","vp-collapseLabel":"vp-collapseLabel-SYefMk",vpCollapseLabel:"vp-collapseLabel-SYefMk","vp-collapseArrow":"vp-collapseArrow-s7319m",vpCollapseArrow:"vp-collapseArrow-s7319m","vp-collapseArrowOpen":"vp-collapseArrowOpen-NQp4Jq",vpCollapseArrowOpen:"vp-collapseArrowOpen-NQp4Jq","vp-collapseBody":"vp-collapseBody-ig7Trn",vpCollapseBody:"vp-collapseBody-ig7Trn","vp-collapseBodyCode":"vp-collapseBodyCode-ACBnWh",vpCollapseBodyCode:"vp-collapseBodyCode-ACBnWh","vp-form":"vp-form-pITn1W",vpForm:"vp-form-pITn1W","vp-fieldGrid":"vp-fieldGrid-SR9eJh",vpFieldGrid:"vp-fieldGrid-SR9eJh","vp-field":"vp-field-NzMT8s",vpField:"vp-field-NzMT8s","vp-labelRow":"vp-labelRow-DlcEeA",vpLabelRow:"vp-labelRow-DlcEeA","vp-label":"vp-label-KGpsbl",vpLabel:"vp-label-KGpsbl","vp-hint":"vp-hint-fYzOU2",vpHint:"vp-hint-fYzOU2","vp-input":"vp-input-UHKU2F",vpInput:"vp-input-UHKU2F","vp-select":"vp-select-Tk6IhF",vpSelect:"vp-select-Tk6IhF","vp-codeEditor":"vp-codeEditor-bXbNn1",vpCodeEditor:"vp-codeEditor-bXbNn1","vp-editorToolbar":"vp-editorToolbar-SVglCq",vpEditorToolbar:"vp-editorToolbar-SVglCq","vp-loadingSimple":"vp-loadingSimple-t3py2h",vpLoadingSimple:"vp-loadingSimple-t3py2h","vp-loadingSpinner":"vp-loadingSpinner-YRww21",vpLoadingSpinner:"vp-loadingSpinner-YRww21","vp-spin":"vp-spin-vqXwPJ",vpSpin:"vp-spin-vqXwPJ","vp-previewFrame":"vp-previewFrame-K_cT99",vpPreviewFrame:"vp-previewFrame-K_cT99","vp-actions":"vp-actions-kW_pM2",vpActions:"vp-actions-kW_pM2","vp-button":"vp-button-jQtwaB",vpButton:"vp-button-jQtwaB","vp-buttonGhost":"vp-buttonGhost-wKOfIf",vpButtonGhost:"vp-buttonGhost-wKOfIf","vp-buttonPrimary":"vp-buttonPrimary-SYnJ9I",vpButtonPrimary:"vp-buttonPrimary-SYnJ9I",vpShimmer:"vpShimmer-XeNYGG","vp-codeBlock":"vp-codeBlock-CMSobd",vpCodeBlock:"vp-codeBlock-CMSobd","vp-emptyTitle":"vp-emptyTitle-LUdxhN",vpEmptyTitle:"vp-emptyTitle-LUdxhN","vp-copyBtn":"vp-copyBtn-rEbuE6",vpCopyBtn:"vp-copyBtn-rEbuE6","vp-copyIcon":"vp-copyIcon-C8ndDr",vpCopyIcon:"vp-copyIcon-C8ndDr","vp-right":"vp-right-Pdn7k6",vpRight:"vp-right-Pdn7k6","vp-ide":"vp-ide-MCK1rq",vpIde:"vp-ide-MCK1rq","vp-ideTitlebar":"vp-ideTitlebar-xV_SLu",vpIdeTitlebar:"vp-ideTitlebar-xV_SLu","vp-ideDots":"vp-ideDots-rmPPqM",vpIdeDots:"vp-ideDots-rmPPqM","vp-dot":"vp-dot-QAY3S7",vpDot:"vp-dot-QAY3S7","vp-dotRed":"vp-dotRed-qBSHb4",vpDotRed:"vp-dotRed-qBSHb4","vp-dotYellow":"vp-dotYellow-JiMbQd",vpDotYellow:"vp-dotYellow-JiMbQd","vp-dotGreen":"vp-dotGreen-p1oJVa",vpDotGreen:"vp-dotGreen-p1oJVa","vp-ideTitle":"vp-ideTitle-pyBOAZ",vpIdeTitle:"vp-ideTitle-pyBOAZ","vp-ideMeta":"vp-ideMeta-IwLWqJ",vpIdeMeta:"vp-ideMeta-IwLWqJ","vp-ideMetaText":"vp-ideMetaText-hM7Yjo",vpIdeMetaText:"vp-ideMetaText-hM7Yjo","vp-ideStatus":"vp-ideStatus-CNZYH6",vpIdeStatus:"vp-ideStatus-CNZYH6","vp-ideBody":"vp-ideBody-iRMqXK",vpIdeBody:"vp-ideBody-iRMqXK","vp-empty":"vp-empty-WMX1Vp",vpEmpty:"vp-empty-WMX1Vp","vp-kv":"vp-kv-HhceUA",vpKv:"vp-kv-HhceUA","vp-renderArea":"vp-renderArea-UsEDCB",vpRenderArea:"vp-renderArea-UsEDCB","vp-terminal":"vp-terminal-F6_CEQ",vpTerminal:"vp-terminal-F6_CEQ","vp-terminalHeader":"vp-terminalHeader-BG3x8z",vpTerminalHeader:"vp-terminalHeader-BG3x8z","vp-terminalClear":"vp-terminalClear-N0wY3l",vpTerminalClear:"vp-terminalClear-N0wY3l","vp-terminalBody":"vp-terminalBody-Fn12Co",vpTerminalBody:"vp-terminalBody-Fn12Co","vp-terminalLine":"vp-terminalLine-V8_M04",vpTerminalLine:"vp-terminalLine-V8_M04","vp-terminalLineError":"vp-terminalLineError-puKD3j",vpTerminalLineError:"vp-terminalLineError-puKD3j","vp-terminalLineWarn":"vp-terminalLineWarn-BIZDl_",vpTerminalLineWarn:"vp-terminalLineWarn-BIZDl_","vp-terminalEmpty":"vp-terminalEmpty-pYP34A",vpTerminalEmpty:"vp-terminalEmpty-pYP34A","vp-errorPanel":"vp-errorPanel-zDWm6k",vpErrorPanel:"vp-errorPanel-zDWm6k","vp-errorTitle":"vp-errorTitle-ykARVb",vpErrorTitle:"vp-errorTitle-ykARVb"};var jsx_runtime_js_=__webpack_require__(8460);function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true}):e[r]=t,e}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=true,o=false;try{if(i=(t=t.call(r)).next,0===l);else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=true,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),true).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&({}).propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if(({}).hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t=({}).toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function state_local_defineProperty(obj,key,value1){if(key in obj)Object.defineProperty(obj,key,{value:value1,enumerable:true,configurable:true,writable:true});else obj[key]=value1;return obj}function state_local_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function state_local_objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};if(i%2)state_local_ownKeys(Object(source),true).forEach(function(key){state_local_defineProperty(target,key,source[key])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));else state_local_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function state_local_compose(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}}function curry(fn){return function curried(){var _this=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return args.length>=fn.length?fn.apply(this,args):function(){for(var _len3=arguments.length,nextArgs=new Array(_len3),_key3=0;_key3<_len3;_key3++)nextArgs[_key3]=arguments[_key3];return curried.apply(_this,[].concat(args,nextArgs))}}}function isObject(value1){return({}).toString.call(value1).includes("Object")}function isEmpty(obj){return!Object.keys(obj).length}function isFunction(value1){return"function"==typeof value1}function state_local_hasOwnProperty(object,property){return Object.prototype.hasOwnProperty.call(object,property)}function validateChanges(initial,changes){if(!isObject(changes))errorHandler("changeType");if(Object.keys(changes).some(function(field){return!state_local_hasOwnProperty(initial,field)}))errorHandler("changeField");return changes}function validateSelector(selector){if(!isFunction(selector))errorHandler("selectorType")}function validateHandler(handler){if(!(isFunction(handler)||isObject(handler)))errorHandler("handlerType");if(isObject(handler)&&Object.values(handler).some(function(_handler){return!isFunction(_handler)}))errorHandler("handlersType")}function validateInitial(initial){if(!initial)errorHandler("initialIsRequired");if(!isObject(initial))errorHandler("initialType");if(isEmpty(initial))errorHandler("initialContent")}function throwError(errorMessages,type){throw new Error(errorMessages[type]||errorMessages["default"])}var state_local_errorMessages={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"};var errorHandler=curry(throwError)(state_local_errorMessages);var validators={changes:validateChanges,selector:validateSelector,handler:validateHandler,initial:validateInitial};function create(initial){var handler=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};validators.initial(initial);validators.handler(handler);var state={current:initial};var didUpdate=curry(didStateUpdate)(state,handler);var update=curry(updateState)(state);var validate=curry(validators.changes)(initial);var getChanges=curry(extractChanges)(state);function getState(){var selector=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(state){return state};validators.selector(selector);return selector(state.current)}function setState(causedChanges){state_local_compose(didUpdate,update,validate,getChanges)(causedChanges)}return[getState,setState]}function extractChanges(state,causedChanges){return isFunction(causedChanges)?causedChanges(state.current):causedChanges}function updateState(state,changes){state.current=state_local_objectSpread2(state_local_objectSpread2({},state.current),changes);return changes}function didStateUpdate(state,handler,changes){isFunction(handler)?handler(state.current):Object.keys(changes).forEach(function(field){var _handler$field;return null==(_handler$field=handler[field])?void 0:_handler$field.call(handler,state.current[field])});return changes}var index={create:create};const state_local=index;var config_config={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function curry_curry(fn){return function curried(){var _this=this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return args.length>=fn.length?fn.apply(this,args):function(){for(var _len2=arguments.length,nextArgs=new Array(_len2),_key2=0;_key2<_len2;_key2++)nextArgs[_key2]=arguments[_key2];return curried.apply(_this,[].concat(args,nextArgs))}}}function isObject_isObject(value1){return({}).toString.call(value1).includes("Object")}function validateConfig(config){if(!config)validators_errorHandler("configIsRequired");if(!isObject_isObject(config))validators_errorHandler("configType");if(config.urls){informAboutDeprecation();return{paths:{vs:config.urls.monacoBase}}}return config}function informAboutDeprecation(){console.warn(validators_errorMessages.deprecation)}function validators_throwError(errorMessages,type){throw new Error(errorMessages[type]||errorMessages["default"])}var validators_errorMessages={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "};var validators_errorHandler=curry_curry(validators_throwError)(validators_errorMessages);var validators_validators={config:validateConfig};var compose_compose=function(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}};function merge(target,source){Object.keys(source).forEach(function(key){if(source[key]instanceof Object){if(target[key])Object.assign(source[key],merge(target[key],source[key]))}});return _objectSpread2(_objectSpread2({},target),source)}var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(promise){var hasCanceled_=false;var wrappedPromise=new Promise(function(resolve,reject){promise.then(function(val){return hasCanceled_?reject(CANCELATION_MESSAGE):resolve(val)});promise["catch"](reject)});return wrappedPromise.cancel=function(){return hasCanceled_=true},wrappedPromise}var _excluded=["monaco"];var _state$create=state_local.create({config:config_config,isInitialized:false,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray(_state$create,2),loader_getState=_state$create2[0],loader_setState=_state$create2[1];function loader_config(globalConfig){var _validators$config=validators_validators.config(globalConfig),monaco=_validators$config.monaco,config=_objectWithoutProperties(_validators$config,_excluded);loader_setState(function(state){return{config:merge(state.config,config),monaco:monaco}})}function init(){var state=loader_getState(function(_ref){var monaco=_ref.monaco,isInitialized=_ref.isInitialized,resolve=_ref.resolve;return{monaco:monaco,isInitialized:isInitialized,resolve:resolve}});if(!state.isInitialized){loader_setState({isInitialized:true});if(state.monaco){state.resolve(state.monaco);return makeCancelable(wrapperPromise)}if(window.monaco&&window.monaco.editor){storeMonacoInstance(window.monaco);state.resolve(window.monaco);return makeCancelable(wrapperPromise)}compose_compose(injectScripts,getMonacoLoaderScript)(loader_configureLoader)}return makeCancelable(wrapperPromise)}function injectScripts(script){return document.body.appendChild(script)}function createScript(src){var script=document.createElement("script");return src&&(script.src=src),script}function getMonacoLoaderScript(configureLoader){var state=loader_getState(function(_ref2){var config=_ref2.config,reject=_ref2.reject;return{config:config,reject:reject}});var loaderScript=createScript("".concat(state.config.paths.vs,"/loader.js"));loaderScript.onload=function(){return configureLoader()};loaderScript.onerror=state.reject;return loaderScript}function loader_configureLoader(){var state=loader_getState(function(_ref3){var config=_ref3.config,resolve=_ref3.resolve,reject=_ref3.reject;return{config:config,resolve:resolve,reject:reject}});var require1=window.require;require1.config(state.config);require1(["vs/editor/editor.main"],function(loaded){var monaco=loaded.m||loaded;storeMonacoInstance(monaco);state.resolve(monaco)},function(error){state.reject(error)})}function storeMonacoInstance(monaco){if(!loader_getState().monaco)loader_setState({monaco:monaco})}function __getMonacoInstance(){return loader_getState(function(_ref4){var monaco=_ref4.monaco;return monaco})}var wrapperPromise=new Promise(function(resolve,reject){return loader_setState({resolve:resolve,reject:reject})});var loader={config:loader_config,init:init,__getMonacoInstance:__getMonacoInstance};var index_js_=__webpack_require__(3383);var le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v1=le;var ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:e}){return index_js_.createElement("div",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return index_js_.createElement("section",{style:{...v1.wrapper,width:e,height:r},...E},!n&&index_js_.createElement($,null,t),index_js_.createElement("div",{ref:a,style:{...v1.fullWidth,...!n&&v1.hide},className:m}))}var ee=Ee;var H=(0,index_js_.memo)(ee);function Ce(e){(0,index_js_.useEffect)(e,[])}var k=Ce;function he(e,r,n=!0){let t=(0,index_js_.useRef)(!0);(0,index_js_.useEffect)(t.current||!n?()=>{t.current=!1}:e,r)}var dist_l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x="light",loading:P="Loading...",options:y={},height:V="100%",width:z="100%",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=(0,index_js_.useState)(!1),[T,s]=(0,index_js_.useState)(!0),u=(0,index_js_.useRef)(null),c=(0,index_js_.useRef)(null),w=(0,index_js_.useRef)(null),d=(0,index_js_.useRef)(q),o=(0,index_js_.useRef)(A),b=(0,index_js_.useRef)(!1);k(()=>{let i=loader.init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>u.current?I():i.cancel()}),dist_l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||"",t||n||"text",m||"");f!==i.getModel()&&i.setModel(f)}},[m],M),dist_l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||"",a||n||"text",E||"");f!==i.getModel()&&i.setModel(f)}},[E],M),dist_l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||""):r!==i.getValue()&&(i.executeEdits("",[{range:i.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),dist_l(()=>{u.current?.getModel()?.original.setValue(e||"")},[e],M),dist_l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||"text"),c.current.editor.setModelLanguage(f,a||n||"text")},[n,t,a],M),dist_l(()=>{c.current?.editor.setTheme(x)},[x],M),dist_l(()=>{u.current?.updateOptions(y)},[y],M);let L=(0,index_js_.useCallback)(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||"",t||n||"text",m||""),f=h(c.current,r||"",a||n||"text",E||"");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=(0,index_js_.useCallback)(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);(0,index_js_.useEffect)(()=>{M&&d.current(u.current,c.current)},[M]),(0,index_js_.useEffect)(()=>{T||M||U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return index_js_.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;(0,index_js_.memo)(ie);function He(e){let r=(0,index_js_.useRef)();return(0,index_js_.useEffect)(()=>{r.current=e},[e]),r.current}var se=He;var dist_=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E="light",line:g,loading:N="Loading...",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z="100%",height:F="100%",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=(0,index_js_.useState)(!1),[c,w]=(0,index_js_.useState)(!0),d=(0,index_js_.useRef)(null),o=(0,index_js_.useRef)(null),b=(0,index_js_.useRef)(null),L=(0,index_js_.useRef)(M),U=(0,index_js_.useRef)(q),I=(0,index_js_.useRef)(),i=(0,index_js_.useRef)(t),f=se(m),Q=(0,index_js_.useRef)(!1),B=(0,index_js_.useRef)(!1);k(()=>{let p=loader.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>o.current?pe():p.cancel()}),dist_l(()=>{let p=h(d.current,e||t||"",r||a||"",m||n||"");p!==o.current?.getModel()&&(y&&dist_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(dist_.get(m)))},[m],s),dist_l(()=>{o.current?.updateOptions(x)},[x],s),dist_l(()=>{o.current&&void 0!==t&&(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits("",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),dist_l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),dist_l(()=>{void 0!==g&&o.current?.revealLine(g)},[g],s),dist_l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=(0,index_js_.useCallback)(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||"",r||a||"",p||"");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(dist_.get(p)),d.current.editor.setTheme(E),void 0!==g&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);(0,index_js_.useEffect)(()=>{s&&L.current(o.current,d.current)},[s]),(0,index_js_.useEffect)(()=>{c||s||X()},[c,s,X]),i.current=t,(0,index_js_.useEffect)(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),(0,index_js_.useEffect)(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&dist_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return index_js_.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=(0,index_js_.memo)(fe);var Ft=de;var react_index_js_=__webpack_require__(9251);var react_dom_index_js_=__webpack_require__(9926);var client_js_=__webpack_require__(3493);var typescript=__webpack_require__(3122);var typescript_default=/*#__PURE__*/__webpack_require__.n(typescript);const BRIDGE_RUNTIME_FILES={"bridge-base-CIOXqUYV.mjs":'import * as React from "react";\nimport { Component, createElement, createContext } from "react";\nimport { L as LoggerInstance, R as RouterContext } from "./index-Bs2NxD2z.mjs";\nimport { federationRuntime } from "./plugin.es.js";\nconst ErrorBoundaryContext = createContext(null);\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: "imperative-api"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: "keys"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === "function") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== void 0) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\nfunction createBaseBridgeComponent({\n createRoot,\n defaultRootOptions,\n ...bridgeInfo\n}) {\n return () => {\n const rootMap = /* @__PURE__ */ new Map();\n const instance = federationRuntime.instance;\n LoggerInstance.debug(\n `createBridgeComponent instance from props >>>`,\n instance\n );\n const RawComponent = (info) => {\n const { appInfo, propsInfo, ...restProps } = info;\n const { moduleName, memoryRoute, basename = "/" } = appInfo;\n return /* @__PURE__ */ React.createElement(RouterContext.Provider, { value: { moduleName, basename, memoryRoute } }, /* @__PURE__ */ React.createElement(\n bridgeInfo.rootComponent,\n {\n ...propsInfo,\n basename,\n ...restProps\n }\n ));\n };\n const DefaultFallback = ({ error }) => /* @__PURE__ */ React.createElement("div", { role: "alert" }, /* @__PURE__ */ React.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React.createElement("pre", { style: { color: "red" } }, error.message));\n const ErrorBoundaryComponent = ErrorBoundary;\n const omitHostFallback = (props) => {\n const nextProps = { ...props };\n delete nextProps.fallback;\n return nextProps;\n };\n const BridgeWrapper = ({\n basename,\n moduleName,\n memoryRoute,\n propsInfo\n }) => /* @__PURE__ */ React.createElement(ErrorBoundaryComponent, { FallbackComponent: DefaultFallback }, /* @__PURE__ */ React.createElement(\n RawComponent,\n {\n appInfo: {\n moduleName,\n basename,\n memoryRoute\n },\n propsInfo\n }\n ));\n return {\n async render(info) {\n var _a, _b, _c, _d, _e, _f;\n LoggerInstance.debug(`createBridgeComponent render Info`, info);\n const {\n moduleName,\n dom,\n basename,\n memoryRoute,\n rootOptions,\n ...propsInfo\n } = info;\n const mergedRootOptions = {\n ...defaultRootOptions,\n ...rootOptions\n };\n const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(info)) || {};\n const rootComponentWithErrorBoundary = /* @__PURE__ */ React.createElement(\n BridgeWrapper,\n {\n basename,\n moduleName,\n memoryRoute,\n propsInfo: {\n ...omitHostFallback(propsInfo),\n basename,\n ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps\n }\n }\n );\n if (bridgeInfo.render) {\n await Promise.resolve(\n bridgeInfo.render(rootComponentWithErrorBoundary, dom)\n ).then((root) => rootMap.set(dom, root));\n } else {\n let root = rootMap.get(dom);\n if (!root && createRoot) {\n root = createRoot(dom, mergedRootOptions);\n rootMap.set(dom, root);\n }\n if (root && "render" in root) {\n root.render(rootComponentWithErrorBoundary);\n }\n }\n ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info)) || {};\n },\n destroy(info) {\n var _a, _b, _c;\n const { dom } = info;\n LoggerInstance.debug(`createBridgeComponent destroy Info`, info);\n const root = rootMap.get(dom);\n if (root) {\n if ("unmount" in root) {\n root.unmount();\n } else {\n LoggerInstance.warn("Root does not have unmount method");\n }\n rootMap.delete(dom);\n }\n (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.afterBridgeDestroy) == null ? void 0 : _c.emit(info);\n }\n };\n };\n}\nexport {\n ErrorBoundary as E,\n createBaseBridgeComponent as c\n};\n',"createHelpers-BY5Uj9_Z.mjs":'import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-CIOXqUYV.mjs";\nimport ReactDOM from "react-dom";\nimport { L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-Bs2NxD2z.mjs";\nimport React__default, { forwardRef, useRef, useState, useEffect } from "react";\nimport { federationRuntime } from "./plugin.es.js";\nfunction createReact16Or17Root(container) {\n return {\n render(children) {\n const reactVersion = ReactDOM.version || "";\n const isReact18 = reactVersion.startsWith("18");\n const isReact19 = reactVersion.startsWith("19");\n if (isReact19) {\n throw new Error(\n `React 19 detected in legacy mode. This is not supported. Please use the version-specific import: import { createBridgeComponent } from \'@module-federation/bridge-react/v19\'`\n );\n }\n if (isReact18) {\n LoggerInstance.warn(\n `[Bridge-React] React 18 detected in legacy mode. For better compatibility, please use the version-specific import: import { createBridgeComponent } from \'@module-federation/bridge-react/v18\'`\n );\n }\n ReactDOM.render(children, container);\n },\n unmount() {\n ReactDOM.unmountComponentAtNode(container);\n }\n };\n}\nfunction createBridgeComponent(bridgeInfo) {\n const fullBridgeInfo = {\n createRoot: createReact16Or17Root,\n ...bridgeInfo\n };\n return createBaseBridgeComponent(fullBridgeInfo);\n}\nconst RemoteAppWrapper = forwardRef(function(props, ref) {\n const {\n moduleName,\n memoryRoute,\n basename,\n providerInfo,\n className,\n style,\n fallback,\n loading,\n ...resProps\n } = props;\n const instance = federationRuntime.instance;\n const rootRef = ref && "current" in ref ? ref : useRef(null);\n const renderDom = useRef(null);\n const providerInfoRef = useRef(null);\n const [initialized, setInitialized] = useState(false);\n LoggerInstance.debug(`RemoteAppWrapper instance from props >>>`, instance);\n useEffect(() => {\n if (initialized) return;\n const providerReturn = providerInfo();\n providerInfoRef.current = providerReturn;\n setInitialized(true);\n return () => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if ((_a = providerInfoRef.current) == null ? void 0 : _a.destroy) {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent destroy >>>`,\n { moduleName, basename, dom: renderDom.current }\n );\n (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit({\n moduleName,\n dom: renderDom.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n });\n (_e = providerInfoRef.current) == null ? void 0 : _e.destroy({\n moduleName,\n dom: renderDom.current\n });\n (_h = (_g = (_f = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _f.lifecycle) == null ? void 0 : _g.afterBridgeDestroy) == null ? void 0 : _h.emit({\n moduleName,\n dom: renderDom.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n });\n }\n };\n }, [moduleName]);\n useEffect(() => {\n var _a, _b, _c, _d, _e, _f;\n if (!initialized || !providerInfoRef.current) return;\n let renderProps = {\n moduleName,\n dom: rootRef.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n };\n renderDom.current = rootRef.current;\n const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(renderProps)) || {};\n renderProps = { ...renderProps, ...beforeBridgeRenderRes.extraProps };\n providerInfoRef.current.render(renderProps);\n (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps);\n }, [initialized, ...Object.values(props)]);\n const rootComponentClassName = `${getRootDomDefaultClassName(moduleName)} ${className || ""}`;\n return /* @__PURE__ */ React__default.createElement("div", { className: rootComponentClassName, style, ref: rootRef }, loading);\n});\nfunction createLazyRemoteComponentFactory(RemoteApp) {\n return function createLazyRemoteComponent(info) {\n const exportName = (info == null ? void 0 : info.export) || "default";\n return React__default.lazy(async () => {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent create >>>`,\n {\n lazyComponent: info.loader,\n exportName\n }\n );\n try {\n const m = await info.loader();\n const moduleName = m && m[Symbol.for("mf_module_id")];\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent loadRemote info >>>`,\n { name: moduleName, module: m, exportName }\n );\n const exportFn = m[exportName];\n if (exportName in m && typeof exportFn === "function") {\n const RemoteAppComponent = forwardRef((props, ref) => {\n return /* @__PURE__ */ React__default.createElement(\n RemoteApp,\n {\n moduleName,\n providerInfo: exportFn,\n exportName: info.export || "default",\n fallback: info.fallback,\n loading: info.loading,\n ref,\n ...props\n }\n );\n });\n return {\n default: RemoteAppComponent\n };\n } else {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent module not found >>>`,\n { name: moduleName, module: m, exportName }\n );\n throw Error(\n `Make sure that ${moduleName} has the correct export when export is ${String(\n exportName\n )}`\n );\n }\n } catch (error) {\n throw error;\n }\n });\n };\n}\nfunction createRemoteAppComponentFactory(RemoteApp) {\n const ErrorBoundaryComponent = ErrorBoundary;\n const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);\n return function createRemoteAppComponent(info) {\n const LazyComponent = createLazyRemoteComponent(info);\n return forwardRef((props, ref) => {\n return /* @__PURE__ */ React__default.createElement(\n ErrorBoundaryComponent,\n {\n FallbackComponent: info.fallback\n },\n /* @__PURE__ */ React__default.createElement(React__default.Suspense, { fallback: info.loading }, /* @__PURE__ */ React__default.createElement(LazyComponent, { ...props, ref }))\n );\n });\n };\n}\nfunction createDeprecatedRemoteComponentFactory(createFn) {\n return function createRemoteComponent(info) {\n LoggerInstance.warn(\n `createRemoteComponent is deprecated, please use createRemoteAppComponent instead!`\n );\n return createFn(info);\n };\n}\nexport {\n RemoteAppWrapper as R,\n createDeprecatedRemoteComponentFactory as a,\n createBridgeComponent as b,\n createRemoteAppComponentFactory as c\n};\n',"data-fetch-utils.es.js":'import { y as DATA_FETCH_FUNCTION } from "./utils-DGS4pYp8.mjs";\nimport { C, a, c, b, d, g, r } from "./utils-DGS4pYp8.mjs";\nimport { d as dataFetchFunction } from "./prefetch-BwRDb4SJ.mjs";\nimport { i, p } from "./prefetch-BwRDb4SJ.mjs";\nasync function callDataFetch() {\n const dataFetch = globalThis[DATA_FETCH_FUNCTION];\n if (dataFetch) {\n await Promise.all(\n dataFetch.map(async (options) => {\n await dataFetchFunction(options);\n })\n );\n }\n}\nexport {\n C as CacheSize,\n a as CacheTime,\n c as cache,\n callDataFetch,\n b as clearStore,\n d as configureCache,\n g as generateKey,\n i as injectDataFetch,\n p as prefetch,\n r as revalidateTag\n};\n',"index-Bs2NxD2z.mjs":'import React__default from "react";\nimport { c as createLogger } from "./logger-DwWkXsWl.mjs";\nconst RouterContext = React__default.createContext(null);\nconst LoggerInstance = createLogger(\n "[ Module Federation Bridge React ]"\n);\nfunction pathJoin(...args) {\n const res = args.reduce((res2, path) => {\n let nPath = path;\n if (!nPath || typeof nPath !== "string") {\n return res2;\n }\n if (nPath[0] !== "/") {\n nPath = `/${nPath}`;\n }\n const lastIndex = nPath.length - 1;\n if (nPath[lastIndex] === "/") {\n nPath = nPath.substring(0, lastIndex);\n }\n return res2 + nPath;\n }, "");\n return res || "/";\n}\nconst getModuleName = (id) => {\n if (!id) {\n return id;\n }\n const idArray = id.split("/");\n if (idArray.length < 2) {\n return id;\n }\n return idArray[0] + "/" + idArray[1];\n};\nconst getRootDomDefaultClassName = (moduleName) => {\n if (!moduleName) {\n return "";\n }\n const name = getModuleName(moduleName).replace(/\\@/, "").replace(/\\//, "-");\n return `bridge-root-component-${name}`;\n};\nexport {\n LoggerInstance as L,\n RouterContext as R,\n getRootDomDefaultClassName as g,\n pathJoin as p\n};\n',"index.es.js":'import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-BY5Uj9_Z.mjs";\nimport { b } from "./createHelpers-BY5Uj9_Z.mjs";\nimport { a, c, b as b2, l } from "./lazy-load-component-plugin-aj97Vt-4.mjs";\nimport { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DGS4pYp8.mjs";\nimport { callDataFetch } from "./data-fetch-utils.es.js";\nimport React__default, { forwardRef, useContext, useState, useEffect } from "react";\nimport * as ReactRouterDOM from "react-router-dom";\nimport { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";\nimport { p } from "./prefetch-BwRDb4SJ.mjs";\nfunction e() {\n const t = new PopStateEvent("popstate", { state: window.history.state });\n window.dispatchEvent(t);\n}\nfunction withRouterData(WrappedComponent) {\n const Component = forwardRef(function(props, ref) {\n var _a;\n if (props == null ? void 0 : props.basename) {\n return /* @__PURE__ */ React__default.createElement(WrappedComponent, { ...props, basename: props.basename, ref });\n }\n let enableDispathPopstate = false;\n let routerContextVal;\n try {\n ReactRouterDOM.useLocation();\n enableDispathPopstate = true;\n } catch {\n enableDispathPopstate = false;\n }\n let basename = "/";\n if (!props.basename && enableDispathPopstate) {\n const ReactRouterDOMAny = ReactRouterDOM;\n const useRouteMatch = ReactRouterDOMAny["useRouteMatch"];\n const useHistory = ReactRouterDOMAny["useHistory"];\n const useHref = ReactRouterDOMAny["useHref"];\n const UNSAFE_RouteContext = ReactRouterDOMAny["UNSAFE_RouteContext"];\n if (UNSAFE_RouteContext) {\n if (useHref) {\n basename = useHref == null ? void 0 : useHref("/");\n }\n routerContextVal = useContext(UNSAFE_RouteContext);\n if (routerContextVal && routerContextVal.matches && routerContextVal.matches.length > 0) {\n const matchIndex = routerContextVal.matches.length - 1;\n const pathnameBase = routerContextVal.matches[matchIndex].pathnameBase;\n basename = pathJoin(basename, pathnameBase || "/");\n }\n } else {\n const match = useRouteMatch == null ? void 0 : useRouteMatch();\n if (useHistory) {\n const history = useHistory == null ? void 0 : useHistory();\n basename = (_a = history == null ? void 0 : history.createHref) == null ? void 0 : _a.call(history, { pathname: "/" });\n }\n if (match) {\n basename = pathJoin(basename, (match == null ? void 0 : match.path) || "/");\n }\n }\n }\n LoggerInstance.debug(`createRemoteAppComponent withRouterData >>>`, {\n ...props,\n basename,\n routerContextVal,\n enableDispathPopstate\n });\n if (enableDispathPopstate) {\n const location = ReactRouterDOM.useLocation();\n const [pathname, setPathname] = useState(location.pathname);\n useEffect(() => {\n if (pathname !== "" && pathname !== location.pathname) {\n LoggerInstance.debug(\n `createRemoteAppComponent dispatchPopstateEnv >>>`,\n {\n name: props.name,\n pathname: location.pathname\n }\n );\n e();\n }\n setPathname(location.pathname);\n }, [location]);\n }\n return /* @__PURE__ */ React__default.createElement(WrappedComponent, { ...props, basename, ref });\n });\n return forwardRef(function(props, ref) {\n return /* @__PURE__ */ React__default.createElement(Component, { ...props, ref });\n });\n}\nconst RemoteApp = withRouterData(RemoteAppWrapper);\nconst createRemoteAppComponent = createRemoteAppComponentFactory(RemoteApp);\nconst createRemoteComponent = createDeprecatedRemoteComponentFactory(\n createRemoteAppComponent\n);\nexport {\n C as CacheSize,\n a2 as CacheTime,\n E as ERROR_TYPE,\n a as autoFetchDataPlugin,\n c2 as cache,\n callDataFetch,\n b3 as clearStore,\n c as collectSSRAssets,\n d as configureCache,\n b as createBridgeComponent,\n b2 as createLazyComponent,\n createRemoteAppComponent,\n createRemoteComponent,\n g as generateKey,\n l as lazyLoadComponentPlugin,\n p as prefetch,\n r as revalidateTag,\n s as setSSREnv\n};\n',"lazy-load-component-plugin-aj97Vt-4.mjs":'import { i as injectDataFetch, p as prefetch } from "./prefetch-BwRDb4SJ.mjs";\nimport { i as initDataFetchMap, k as isDataLoaderExpose, m as getDataFetchInfo, n as getDataFetchMapKey, l as logger, o as getDataFetchItem, p as DATA_FETCH_CLIENT_SUFFIX, q as MF_DATA_FETCH_TYPE, t as isCSROnly, M as MF_DATA_FETCH_STATUS, j as loadDataFetchModule, e as getDataFetchMap, u as isServerEnv, v as getDataFetchIdWithErrorMsgs, w as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, x as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, y as DATA_FETCH_FUNCTION, z as getLoadedRemoteInfos, h as fetchData$1, A as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-DGS4pYp8.mjs";\nimport React__default, { useRef, useState, Suspense, useEffect } from "react";\nconst autoFetchData = () => {\n initDataFetchMap();\n injectDataFetch();\n return {\n name: "auto-fetch-data-plugin",\n afterLoadSnapshot(args) {\n const { id, moduleInfo, remoteSnapshot, host } = args;\n if (typeof id === "string" && isDataLoaderExpose(id)) {\n return args;\n }\n if (!remoteSnapshot || !id || !("modules" in remoteSnapshot)) {\n return args;\n }\n const { name, alias } = moduleInfo;\n const dataFetchInfo = getDataFetchInfo({\n name,\n alias,\n id,\n remoteSnapshot\n });\n if (!dataFetchInfo) {\n return args;\n }\n const { dataFetchId, dataFetchName } = dataFetchInfo;\n const dataFetchMapKey = getDataFetchMapKey(dataFetchInfo, {\n name: host.name,\n version: host.options.version\n });\n logger.debug(\n "======= auto fetch plugin dataFetchMapKey: ",\n dataFetchMapKey\n );\n if (!dataFetchMapKey) {\n return args;\n }\n const dataFetchItem = getDataFetchItem(dataFetchMapKey);\n if (dataFetchItem) {\n return args;\n }\n const dataFetchMap = getDataFetchMap();\n const hasSSRAsset = Boolean(remoteSnapshot.ssrRemoteEntry);\n const hasDataFetchClient = Boolean(\n remoteSnapshot.modules.find(\n (module) => module.moduleName === `${dataFetchName}${DATA_FETCH_CLIENT_SUFFIX}`\n )\n );\n const downgradeType = hasDataFetchClient ? MF_DATA_FETCH_TYPE.FETCH_CLIENT : hasSSRAsset ? MF_DATA_FETCH_TYPE.FETCH_SERVER : MF_DATA_FETCH_TYPE.FETCH_CLIENT;\n let finalDataFetchId = dataFetchId;\n if (!isServerEnv()) {\n finalDataFetchId = downgradeType === MF_DATA_FETCH_TYPE.FETCH_CLIENT ? hasDataFetchClient ? `${dataFetchId}${DATA_FETCH_CLIENT_SUFFIX}` : dataFetchId : dataFetchId;\n }\n const getDataFetchGetter = () => loadDataFetchModule(host, finalDataFetchId);\n const dataFetchFnItem = [\n getDataFetchGetter,\n downgradeType\n ];\n if (typeof window === "undefined" || isCSROnly()) {\n dataFetchFnItem.push(getDataFetchGetter());\n }\n dataFetchMap[dataFetchMapKey] = [\n dataFetchFnItem,\n void 0,\n MF_DATA_FETCH_STATUS.AWAIT\n ];\n return args;\n }\n };\n};\nfunction isPromise(obj) {\n return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";\n}\nconst AWAIT_ERROR_PREFIX = "<Await /> caught the following error during render: ";\nconst transformError = (err) => {\n const errMsg = err instanceof Error ? err.message : err;\n const originalMsg = errMsg.replace(AWAIT_ERROR_PREFIX, "");\n const dataFetchMapKey = getDataFetchIdWithErrorMsgs(originalMsg);\n if (originalMsg.indexOf(DATA_FETCH_ERROR_PREFIX) === 0) {\n return {\n error: new Error(\n originalMsg.replace(DATA_FETCH_ERROR_PREFIX, "").replace(wrapDataFetchId(dataFetchMapKey), "")\n ),\n errorType: ERROR_TYPE.DATA_FETCH,\n dataFetchMapKey\n };\n }\n if (originalMsg.indexOf(LOAD_REMOTE_ERROR_PREFIX) === 0) {\n return {\n error: new Error(\n originalMsg.replace(LOAD_REMOTE_ERROR_PREFIX, "").replace(wrapDataFetchId(dataFetchMapKey), "")\n ),\n errorType: ERROR_TYPE.LOAD_REMOTE,\n dataFetchMapKey\n };\n }\n return {\n error: new Error(originalMsg.replace(wrapDataFetchId(dataFetchMapKey), "")),\n errorType: ERROR_TYPE.UNKNOWN,\n dataFetchMapKey\n };\n};\nconst DefaultLoading = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);\nconst DefaultErrorElement = (_data) => /* @__PURE__ */ React__default.createElement("div", null, "Error");\nfunction AwaitDataFetch({\n resolve,\n loading = DefaultLoading,\n errorElement = DefaultErrorElement,\n children,\n params,\n delayLoading\n}) {\n const dataRef = useRef();\n const data = dataRef.current || resolve;\n const getData = isPromise(data) ? fetchData(data, dataRef) : () => data;\n return /* @__PURE__ */ React__default.createElement(\n AwaitSuspense,\n {\n params,\n loading,\n errorElement,\n delayLoading,\n resolve: getData\n },\n children\n );\n}\nconst DelayedLoading = ({\n delayLoading,\n children\n}) => {\n const [show, setShow] = useState(false);\n const timerSet = useRef(false);\n if (!delayLoading) {\n return children;\n }\n if (typeof window !== "undefined" && !show && !timerSet.current) {\n timerSet.current = true;\n setTimeout(() => {\n setShow(true);\n }, delayLoading);\n }\n return show ? children : null;\n};\nfunction AwaitSuspense({\n resolve,\n children,\n loading = DefaultLoading,\n errorElement = DefaultErrorElement,\n delayLoading\n}) {\n return /* @__PURE__ */ React__default.createElement(\n Suspense,\n {\n fallback: /* @__PURE__ */ React__default.createElement(DelayedLoading, { delayLoading }, loading)\n },\n /* @__PURE__ */ React__default.createElement(ResolveAwait, { resolve, errorElement }, children)\n );\n}\nfunction ResolveAwait({\n children,\n resolve,\n errorElement,\n params\n}) {\n const data = resolve();\n logger.debug("resolve data: ", data);\n if (typeof data === "string" && data.indexOf(AWAIT_ERROR_PREFIX) === 0) {\n const transformedError = transformError(data);\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof errorElement === "function" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, globalThis.FEDERATION_SSR && /* @__PURE__ */ React__default.createElement(\n "script",\n {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: String.raw`\n globalThis[\'${DATA_FETCH_FUNCTION}\'] = globalThis[\'${DATA_FETCH_FUNCTION}\'] || []\n globalThis[\'${DATA_FETCH_FUNCTION}\'].push([${transformedError.dataFetchMapKey ? `\'${transformedError.dataFetchMapKey}\'` : ""},${params ? JSON.stringify(params) : null},true]);`\n }\n }\n ), errorElement(transformedError)) : errorElement);\n }\n const toRender = typeof children === "function" ? children(data) : children;\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toRender);\n}\nconst fetchData = (promise, ref) => {\n let data;\n let status = "pending";\n const suspender = promise.then((res) => {\n status = "success";\n data = res;\n ref.current = res;\n }).catch((e) => {\n status = "success";\n console.warn(e);\n data = AWAIT_ERROR_PREFIX + e;\n });\n return () => {\n if (status === "pending") {\n throw suspender;\n }\n return data;\n };\n};\nfunction getTargetModuleInfo(id, instance) {\n if (!instance) {\n return;\n }\n const loadedRemoteInfo = getLoadedRemoteInfos(id, instance);\n if (!loadedRemoteInfo) {\n return;\n }\n const { snapshot } = loadedRemoteInfo;\n if (!snapshot) {\n return;\n }\n const publicPath = "publicPath" in snapshot ? snapshot.publicPath : "getPublicPath" in snapshot ? new Function(snapshot.getPublicPath)() : "";\n if (!publicPath) {\n return;\n }\n const modules = "modules" in snapshot ? snapshot.modules : [];\n const targetModule = modules.find(\n (m) => m.modulePath === loadedRemoteInfo.expose\n );\n if (!targetModule) {\n return;\n }\n const remoteEntry = "remoteEntry" in snapshot ? snapshot.remoteEntry : "";\n if (!remoteEntry) {\n return;\n }\n return {\n module: targetModule,\n publicPath,\n remoteEntry\n };\n}\nfunction collectSSRAssets(options) {\n const {\n id,\n injectLink = true,\n injectScript = false\n } = typeof options === "string" ? { id: options } : options;\n const links = [];\n const scripts = [];\n const instance = options.instance;\n if (!instance || !injectLink && !injectScript) {\n return [...scripts, ...links];\n }\n const moduleAndPublicPath = getTargetModuleInfo(id, instance);\n if (!moduleAndPublicPath) {\n return [...scripts, ...links];\n }\n const { module: targetModule, publicPath, remoteEntry } = moduleAndPublicPath;\n if (injectLink) {\n [...targetModule.assets.css.sync, ...targetModule.assets.css.async].sort().forEach((file, index) => {\n links.push(\n /* @__PURE__ */ React__default.createElement(\n "link",\n {\n key: `${file.split(".")[0]}_${index}`,\n href: `${publicPath}${file}`,\n rel: "stylesheet",\n type: "text/css"\n }\n )\n );\n });\n }\n if (injectScript) {\n scripts.push(\n /* @__PURE__ */ React__default.createElement(\n "script",\n {\n async: true,\n key: remoteEntry.split(".")[0],\n src: `${publicPath}${remoteEntry}`,\n crossOrigin: "anonymous"\n }\n )\n );\n [...targetModule.assets.js.sync].sort().forEach((file, index) => {\n scripts.push(\n /* @__PURE__ */ React__default.createElement(\n "script",\n {\n key: `${file.split(".")[0]}_${index}`,\n async: true,\n src: `${publicPath}${file}`,\n crossOrigin: "anonymous"\n }\n )\n );\n });\n }\n return [...scripts, ...links];\n}\nfunction getServerNeedRemoteInfo(loadedRemoteInfo, id, noSSR) {\n var _a;\n if (noSSR || typeof window !== "undefined" && window.location.href !== window[FS_HREF]) {\n if (!(loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.version)) {\n throw new Error(`${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} version is empty`);\n }\n const { snapshot } = loadedRemoteInfo;\n if (!snapshot) {\n throw new Error(`${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} snapshot is empty`);\n }\n const dataFetchItem = getDataFetchItem(id);\n const isFetchServer = ((_a = dataFetchItem == null ? void 0 : dataFetchItem[0]) == null ? void 0 : _a[1]) === MF_DATA_FETCH_TYPE.FETCH_SERVER;\n if (isFetchServer && (!("ssrPublicPath" in snapshot) || !snapshot.ssrPublicPath)) {\n throw new Error(\n `ssrPublicPath is required while fetching ${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} data in SSR project!`\n );\n }\n if (isFetchServer && (!("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry)) {\n throw new Error(\n `ssrRemoteEntry is required while loading ${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} data loader in SSR project!`\n );\n }\n return {\n name: loadedRemoteInfo.name,\n version: loadedRemoteInfo.version,\n ssrPublicPath: "ssrPublicPath" in snapshot ? snapshot.ssrPublicPath || "" : "",\n ssrRemoteEntry: "ssrRemoteEntry" in snapshot ? snapshot.ssrRemoteEntry || "" : "",\n globalName: loadedRemoteInfo.entryGlobalName\n };\n }\n return void 0;\n}\nfunction createLazyComponent(options) {\n const { instance, injectScript, injectLink } = options;\n if (!instance) {\n throw new Error("instance is required for createLazyComponent!");\n }\n const exportName = (options == null ? void 0 : options.export) || "default";\n const callLoader = async () => {\n logger.debug("callLoader start", Date.now());\n const m = await options.loader();\n logger.debug("callLoader end", Date.now());\n if (!m) {\n throw new Error("load remote failed");\n }\n return m;\n };\n const getData = async (noSSR) => {\n let loadedRemoteInfo;\n let moduleId;\n try {\n const m = await callLoader();\n moduleId = m && m[Symbol.for("mf_module_id")];\n if (!moduleId) {\n throw new Error("moduleId is empty");\n }\n loadedRemoteInfo = getLoadedRemoteInfos(moduleId, instance);\n if (!loadedRemoteInfo) {\n throw new Error(`can not find loaded remote(\'${moduleId}\') info!`);\n }\n } catch (e) {\n const errMsg = `${LOAD_REMOTE_ERROR_PREFIX}${e}`;\n logger.debug(e);\n throw new Error(errMsg);\n }\n let dataFetchMapKey;\n try {\n dataFetchMapKey = getDataFetchMapKey(\n getDataFetchInfo({\n name: loadedRemoteInfo.name,\n alias: loadedRemoteInfo.alias,\n id: moduleId,\n remoteSnapshot: loadedRemoteInfo.snapshot\n }),\n { name: instance.name, version: instance.options.version }\n );\n logger.debug("getData dataFetchMapKey: ", dataFetchMapKey);\n if (!dataFetchMapKey) {\n return;\n }\n const data = await fetchData$1(\n dataFetchMapKey,\n {\n ...options.dataFetchParams,\n isDowngrade: false\n },\n getServerNeedRemoteInfo(loadedRemoteInfo, dataFetchMapKey, noSSR)\n );\n setDataFetchItemLoadedStatus(dataFetchMapKey);\n logger.debug("get data res: \\n", data);\n return data;\n } catch (err) {\n const errMsg = `${DATA_FETCH_ERROR_PREFIX}${wrapDataFetchId(dataFetchMapKey)}${err}`;\n logger.debug(errMsg);\n throw new Error(errMsg);\n }\n };\n const LazyComponent = React__default.lazy(async () => {\n const m = await callLoader();\n const moduleId = m && m[Symbol.for("mf_module_id")];\n const loadedRemoteInfo = getLoadedRemoteInfos(moduleId, instance);\n loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.snapshot;\n const dataFetchMapKey = loadedRemoteInfo ? getDataFetchMapKey(\n getDataFetchInfo({\n name: loadedRemoteInfo.name,\n alias: loadedRemoteInfo.alias,\n id: moduleId,\n remoteSnapshot: loadedRemoteInfo.snapshot\n }),\n { name: instance.name, version: instance == null ? void 0 : instance.options.version }\n ) : void 0;\n logger.debug("LazyComponent dataFetchMapKey: ", dataFetchMapKey);\n const assets = collectSSRAssets({\n id: moduleId,\n instance,\n injectLink,\n injectScript\n });\n const Com = m[exportName];\n if (exportName in m && typeof Com === "function") {\n return {\n default: (props) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, globalThis.FEDERATION_SSR && dataFetchMapKey && /* @__PURE__ */ React__default.createElement(\n "script",\n {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: String.raw`\n globalThis[\'${DATA_FETCH_FUNCTION}\'] = globalThis[\'${DATA_FETCH_FUNCTION}\'] || [];\n globalThis[\'${DATA_FETCH_FUNCTION}\'].push([\'${dataFetchMapKey}\',${JSON.stringify(props.mfData)}]);\n `\n }\n }\n ), globalThis.FEDERATION_SSR && assets, /* @__PURE__ */ React__default.createElement(Com, { ...props }))\n };\n } else {\n throw Error(\n `Make sure that ${moduleId} has the correct export when export is ${String(\n exportName\n )}`\n );\n }\n });\n return (props) => {\n const { key, ...args } = props;\n if (!options.noSSR) {\n return /* @__PURE__ */ React__default.createElement(\n AwaitDataFetch,\n {\n resolve: getData(options.noSSR),\n loading: options.loading,\n delayLoading: options.delayLoading,\n errorElement: options.fallback\n },\n (data) => /* @__PURE__ */ React__default.createElement(LazyComponent, { ...args, mfData: data })\n );\n } else {\n const [data, setData] = useState(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n useEffect(() => {\n let isMounted = true;\n const fetchDataAsync = async () => {\n try {\n setLoading(true);\n const result = await getData(options.noSSR);\n if (isMounted) {\n setData(result);\n }\n } catch (e) {\n if (isMounted) {\n setError(transformError(e));\n }\n } finally {\n if (isMounted) {\n setLoading(false);\n }\n }\n };\n fetchDataAsync();\n return () => {\n isMounted = false;\n };\n }, []);\n if (loading) {\n return /* @__PURE__ */ React__default.createElement(DelayedLoading, { delayLoading: options.delayLoading }, options.loading);\n }\n if (error) {\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof options.fallback === "function" ? options.fallback(error) : options.fallback);\n }\n return /* @__PURE__ */ React__default.createElement(LazyComponent, { ...args, mfData: data });\n }\n };\n}\nfunction lazyLoadComponentPlugin() {\n return {\n name: "lazy-load-component-plugin",\n apply(instance) {\n instance.registerPlugins([autoFetchData()]);\n instance.createLazyComponent = (options) => {\n return createLazyComponent({\n instance,\n ...options\n });\n };\n instance.prefetch = (options) => {\n return prefetch({\n instance,\n ...options\n });\n };\n instance.collectSSRAssets = (options) => {\n return collectSSRAssets({\n instance,\n ...options\n });\n };\n }\n };\n}\nexport {\n autoFetchData as a,\n createLazyComponent as b,\n collectSSRAssets as c,\n lazyLoadComponentPlugin as l\n};\n',"logger-DwWkXsWl.mjs":'const MANIFEST_EXT = ".json";\nconst BROWSER_LOG_KEY = "FEDERATION_DEBUG";\nconst SEPARATOR = ":";\nconst isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";\nfunction isBrowserEnv() {\n return isBrowserEnvValue;\n}\nfunction isBrowserDebug() {\n try {\n if (isBrowserEnv() && window.localStorage) return Boolean(localStorage.getItem(BROWSER_LOG_KEY));\n } catch (error) {\n return false;\n }\n return false;\n}\nfunction isDebugMode() {\n if (typeof process !== "undefined" && process.env && process.env["FEDERATION_DEBUG"]) return Boolean(process.env["FEDERATION_DEBUG"]);\n if (typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG)) return true;\n return isBrowserDebug();\n}\nconst PREFIX = "[ Module Federation ]";\nconst DEFAULT_DELEGATE = console;\nconst LOGGER_STACK_SKIP_TOKENS = [\n "logger.ts",\n "logger.js",\n "captureStackTrace",\n "Logger.emit",\n "Logger.log",\n "Logger.info",\n "Logger.warn",\n "Logger.error",\n "Logger.debug"\n];\nfunction captureStackTrace() {\n try {\n const stack = (/* @__PURE__ */ new Error()).stack;\n if (!stack) return;\n const [, ...rawLines] = stack.split("\\n");\n const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));\n if (!filtered.length) return;\n return `Stack trace:\n${filtered.slice(0, 5).join("\\n")}`;\n } catch {\n return;\n }\n}\nvar Logger = class {\n constructor(prefix, delegate = DEFAULT_DELEGATE) {\n this.prefix = prefix;\n this.delegate = delegate ?? DEFAULT_DELEGATE;\n }\n setPrefix(prefix) {\n this.prefix = prefix;\n }\n setDelegate(delegate) {\n this.delegate = delegate ?? DEFAULT_DELEGATE;\n }\n emit(method, args) {\n const delegate = this.delegate;\n const stackTrace = isDebugMode() ? captureStackTrace() : void 0;\n const enrichedArgs = stackTrace ? [...args, stackTrace] : args;\n const order = (() => {\n switch (method) {\n case "log":\n return ["log", "info"];\n case "info":\n return ["info", "log"];\n case "warn":\n return [\n "warn",\n "info",\n "log"\n ];\n case "error":\n return [\n "error",\n "warn",\n "log"\n ];\n default:\n return ["debug", "log"];\n }\n })();\n for (const candidate of order) {\n const handler = delegate[candidate];\n if (typeof handler === "function") {\n handler.call(delegate, this.prefix, ...enrichedArgs);\n return;\n }\n }\n for (const candidate of order) {\n const handler = DEFAULT_DELEGATE[candidate];\n if (typeof handler === "function") {\n handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);\n return;\n }\n }\n }\n log(...args) {\n this.emit("log", args);\n }\n warn(...args) {\n this.emit("warn", args);\n }\n error(...args) {\n this.emit("error", args);\n }\n success(...args) {\n this.emit("info", args);\n }\n info(...args) {\n this.emit("info", args);\n }\n ready(...args) {\n this.emit("info", args);\n }\n debug(...args) {\n if (isDebugMode()) this.emit("debug", args);\n }\n};\nfunction createLogger(prefix) {\n return new Logger(prefix);\n}\nfunction createInfrastructureLogger(prefix) {\n const infrastructureLogger = new Logger(prefix);\n Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {\n value: true,\n enumerable: false,\n configurable: false\n });\n return infrastructureLogger;\n}\ncreateInfrastructureLogger(PREFIX);\nexport {\n MANIFEST_EXT as M,\n SEPARATOR as S,\n createLogger as c,\n isBrowserEnvValue as i\n};\n',"plugin.es.js":'const federationRuntime = { instance: null };\nfunction BridgeReactPlugin() {\n return {\n name: "bridge-react-plugin",\n beforeInit(args) {\n federationRuntime.instance = args.origin;\n return args;\n }\n };\n}\nexport {\n BridgeReactPlugin as default,\n federationRuntime\n};\n',"prefetch-BwRDb4SJ.mjs":'import { B as warn, y as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger, e as getDataFetchMap, i as initDataFetchMap, o as getDataFetchItem, M as MF_DATA_FETCH_STATUS, q as MF_DATA_FETCH_TYPE, G as DOWNGRADE_KEY, H as callAllDowngrade, I as callDowngrade, J as getDowngradeTag, K as composeKeyWithSeparator, m as getDataFetchInfo, n as getDataFetchMapKey } from "./utils-DGS4pYp8.mjs";\nimport { i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";\nasync function safeWrapper(callback, disableWarn) {\n try {\n return await callback();\n } catch (e) {\n warn(e);\n return;\n }\n}\nfunction isStaticResourcesEqual(url1, url2) {\n const REG_EXP = /^(https?:)?\\/\\//i;\n return url1.replace(REG_EXP, "").replace(/\\/$/, "") === url2.replace(REG_EXP, "").replace(/\\/$/, "");\n}\nfunction createScript(info) {\n let script = null;\n let needAttach = true;\n let timeout = 2e4;\n let timeoutId;\n const scripts = document.getElementsByTagName("script");\n for (let i = 0; i < scripts.length; i++) {\n const s = scripts[i];\n const scriptSrc = s.getAttribute("src");\n if (scriptSrc && isStaticResourcesEqual(scriptSrc, info.url)) {\n script = s;\n needAttach = false;\n break;\n }\n }\n if (!script) {\n const attrs = info.attrs;\n script = document.createElement("script");\n script.type = (attrs == null ? void 0 : attrs["type"]) === "module" ? "module" : "text/javascript";\n let createScriptRes = void 0;\n if (info.createScriptHook) {\n createScriptRes = info.createScriptHook(info.url, info.attrs);\n if (createScriptRes instanceof HTMLScriptElement) script = createScriptRes;\n else if (typeof createScriptRes === "object") {\n if ("script" in createScriptRes && createScriptRes.script) script = createScriptRes.script;\n if ("timeout" in createScriptRes && createScriptRes.timeout) timeout = createScriptRes.timeout;\n }\n }\n if (!script.src) script.src = info.url;\n if (attrs && !createScriptRes) Object.keys(attrs).forEach((name) => {\n if (script) {\n if (name === "async" || name === "defer") script[name] = attrs[name];\n else if (!script.getAttribute(name)) script.setAttribute(name, attrs[name]);\n }\n });\n }\n let executionError = null;\n const executionErrorHandler = typeof window !== "undefined" ? (evt) => {\n if (evt.filename && isStaticResourcesEqual(evt.filename, info.url)) {\n const err = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);\n err.name = "ScriptExecutionError";\n executionError = err;\n }\n } : null;\n if (executionErrorHandler) window.addEventListener("error", executionErrorHandler);\n const onScriptComplete = async (prev, event) => {\n clearTimeout(timeoutId);\n if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);\n const onScriptCompleteCallback = () => {\n if ((event == null ? void 0 : event.type) === "error") {\n const networkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `ScriptNetworkError: Script "${info.url}" timed out.` : `ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);\n networkError.name = "ScriptNetworkError";\n (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));\n } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));\n else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n };\n if (script) {\n script.onerror = null;\n script.onload = null;\n safeWrapper(() => {\n const { needDeleteScript = true } = info;\n if (needDeleteScript) (script == null ? void 0 : script.parentNode) && script.parentNode.removeChild(script);\n });\n if (prev && typeof prev === "function") {\n const result = prev(event);\n if (result instanceof Promise) {\n const res = await result;\n onScriptCompleteCallback();\n return res;\n }\n onScriptCompleteCallback();\n return result;\n }\n }\n onScriptCompleteCallback();\n };\n script.onerror = onScriptComplete.bind(null, script.onerror);\n script.onload = onScriptComplete.bind(null, script.onload);\n timeoutId = setTimeout(() => {\n onScriptComplete(null, {\n type: "error",\n isTimeout: true\n });\n }, timeout);\n return {\n script,\n needAttach\n };\n}\nfunction createLink(info) {\n let link = null;\n let needAttach = true;\n let timeout = 2e4;\n let timeoutId;\n const links = document.getElementsByTagName("link");\n for (let i = 0; i < links.length; i++) {\n const l = links[i];\n const linkHref = l.getAttribute("href");\n const linkRel = l.getAttribute("rel");\n if (linkHref && isStaticResourcesEqual(linkHref, info.url) && linkRel === info.attrs["rel"]) {\n link = l;\n needAttach = false;\n break;\n }\n }\n if (!link) {\n link = document.createElement("link");\n link.setAttribute("href", info.url);\n let createLinkRes = void 0;\n let shouldApplyAttrs = true;\n const attrs = info.attrs;\n if (info.createLinkHook) {\n createLinkRes = info.createLinkHook(info.url, attrs);\n if (createLinkRes instanceof HTMLLinkElement) {\n link = createLinkRes;\n shouldApplyAttrs = false;\n } else if (typeof createLinkRes === "object") {\n if ("link" in createLinkRes && createLinkRes.link) {\n link = createLinkRes.link;\n shouldApplyAttrs = false;\n }\n if ("timeout" in createLinkRes && createLinkRes.timeout) timeout = createLinkRes.timeout;\n }\n }\n if (attrs && shouldApplyAttrs) Object.keys(attrs).forEach((name) => {\n if (link && !link.getAttribute(name)) link.setAttribute(name, attrs[name]);\n });\n }\n if (!needAttach) {\n Promise.resolve().then(() => {\n (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n });\n return {\n link,\n needAttach\n };\n }\n const onLinkComplete = (prev, event) => {\n if (timeoutId) clearTimeout(timeoutId);\n const onLinkCompleteCallback = () => {\n if ((event == null ? void 0 : event.type) === "error") {\n const linkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `LinkNetworkError: Link "${info.url}" timed out.` : `LinkNetworkError: Failed to load link "${info.url}" - the URL is unreachable or the server returned an error.`);\n linkError.name = "LinkNetworkError";\n (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(linkError));\n } else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n };\n if (link) {\n link.onerror = null;\n link.onload = null;\n safeWrapper(() => {\n const { needDeleteLink = true } = info;\n if (needDeleteLink) (link == null ? void 0 : link.parentNode) && link.parentNode.removeChild(link);\n });\n if (prev) {\n const res = prev(event);\n onLinkCompleteCallback();\n return res;\n }\n }\n onLinkCompleteCallback();\n };\n link.onerror = onLinkComplete.bind(null, link.onerror);\n link.onload = onLinkComplete.bind(null, link.onload);\n timeoutId = setTimeout(() => {\n onLinkComplete(null, {\n type: "error",\n isTimeout: true\n });\n }, timeout);\n return {\n link,\n needAttach\n };\n}\nfunction loadScript(url, info) {\n const { attrs = {}, createScriptHook } = info;\n return new Promise((resolve, reject) => {\n const { script, needAttach } = createScript({\n url,\n cb: resolve,\n onErrorCallback: reject,\n attrs: {\n fetchpriority: "high",\n ...attrs\n },\n createScriptHook,\n needDeleteScript: true\n });\n needAttach && document.head.appendChild(script);\n });\n}\nconst sdkImportCache = /* @__PURE__ */ new Map();\nfunction importNodeModule(name) {\n if (!name) throw new Error("import specifier is required");\n if (sdkImportCache.has(name)) return sdkImportCache.get(name);\n const promise = new Function("name", `return import(name)`)(name).then((res) => res).catch((error2) => {\n console.error(`Error importing module ${name}:`, error2);\n sdkImportCache.delete(name);\n throw error2;\n });\n sdkImportCache.set(name, promise);\n return promise;\n}\nconst lazyLoaderHookFetch = async (input, init, loaderHook) => {\n const hook = (url, init2) => {\n return loaderHook.lifecycle.fetch.emit(url, init2);\n };\n const res = await hook(input, init || {});\n if (!res || !(res instanceof Response)) return fetch(input, init || {});\n return res;\n};\nconst createScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {\n if (loaderHook == null ? void 0 : loaderHook.createScriptHook) {\n const hookResult = loaderHook.createScriptHook(url);\n if (hookResult && typeof hookResult === "object" && "url" in hookResult) url = hookResult.url;\n }\n let urlObj;\n try {\n urlObj = new URL(url);\n } catch (e) {\n console.error("Error constructing URL:", e);\n cb(/* @__PURE__ */ new Error(`Invalid URL: ${e}`));\n return;\n }\n const getFetch = async () => {\n if (loaderHook == null ? void 0 : loaderHook.fetch) return (input, init) => lazyLoaderHookFetch(input, init, loaderHook);\n return fetch;\n };\n const handleScriptFetch = async (f, urlObj2) => {\n var _a;\n try {\n const res = await f(urlObj2.href);\n const data = await res.text();\n const [path, vm] = await Promise.all([importNodeModule("path"), importNodeModule("vm")]);\n const scriptContext = {\n exports: {},\n module: { exports: {} }\n };\n const urlDirname = urlObj2.pathname.split("/").slice(0, -1).join("/");\n const filename = path.basename(urlObj2.pathname);\n const script = new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}\n})`, {\n filename,\n importModuleDynamically: ((_a = vm.constants) == null ? void 0 : _a.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? importNodeModule\n });\n let requireFn;\n requireFn = (await importNodeModule("node:module")).createRequire(urlObj2.protocol === "file:" || urlObj2.protocol === "node:" ? urlObj2.href : path.join(process.cwd(), "__mf_require_base__.js"));\n script.runInThisContext()(scriptContext.exports, scriptContext.module, requireFn, urlDirname, filename);\n const exportedInterface = scriptContext.module.exports || scriptContext.exports;\n if (attrs && exportedInterface && attrs["globalName"]) {\n cb(void 0, exportedInterface[attrs["globalName"]] || exportedInterface);\n return;\n }\n cb(void 0, exportedInterface);\n } catch (e) {\n cb(e instanceof Error ? e : /* @__PURE__ */ new Error(`Script execution error: ${e}`));\n }\n };\n getFetch().then(async (f) => {\n if ((attrs == null ? void 0 : attrs["type"]) === "esm" || (attrs == null ? void 0 : attrs["type"]) === "module") return loadModule(urlObj.href, {\n fetch: f,\n vm: await importNodeModule("vm")\n }).then(async (module) => {\n await module.evaluate();\n cb(void 0, module.namespace);\n }).catch((e) => {\n cb(e instanceof Error ? e : /* @__PURE__ */ new Error(`Script execution error: ${e}`));\n });\n handleScriptFetch(f, urlObj);\n }).catch((err) => {\n cb(err);\n });\n} : (url, cb, attrs, loaderHook) => {\n cb(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));\n};\nconst loadScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "web" ? (url, info) => {\n return new Promise((resolve, reject) => {\n createScriptNode(url, (error2, scriptContext) => {\n var _a, _b;\n if (error2) reject(error2);\n else {\n const remoteEntryKey = ((_a = info == null ? void 0 : info.attrs) == null ? void 0 : _a["globalName"]) || `__FEDERATION_${(_b = info == null ? void 0 : info.attrs) == null ? void 0 : _b["name"]}:custom__`;\n resolve(globalThis[remoteEntryKey] = scriptContext);\n }\n }, info.attrs, info.loaderHook);\n });\n} : (url, info) => {\n throw new Error("loadScriptNode is disabled in non-Node.js environment");\n};\nconst esmModuleCache = /* @__PURE__ */ new Map();\nconst isFetchableRemoteModuleUrl = (url) => url.startsWith("http:") || url.startsWith("https:");\nconst isBareModuleSpecifier = (specifier) => !specifier.startsWith("./") && !specifier.startsWith("../") && !specifier.startsWith("/") && !specifier.includes(":");\nfunction encodeRemoteModulePath(url) {\n const remoteUrl = new URL(url);\n const encodedProtocol = encodeURIComponent(remoteUrl.protocol.slice(0, -1));\n const encodedHost = encodeURIComponent(remoteUrl.host);\n const encodedPathname = remoteUrl.pathname.split("/").map((segment) => encodeURIComponent(segment)).join("/");\n const encodedSearchHash = encodeURIComponent(`${remoteUrl.search}${remoteUrl.hash}`);\n return `/${encodedProtocol}/${encodedHost}${encodedPathname}${encodedSearchHash ? `/${encodedSearchHash}` : ""}`;\n}\nfunction createImportMetaUrl(url, baseFileUrl) {\n const baseUrl = baseFileUrl.endsWith("/") ? baseFileUrl : `${baseFileUrl}/`;\n return new URL(`__module_federation_remote__${encodeRemoteModulePath(url)}`, baseUrl).href;\n}\nasync function isNodeBuiltinSpecifier(specifier) {\n if (specifier.startsWith("node:")) return true;\n if (!isBareModuleSpecifier(specifier)) return false;\n return (await importNodeModule("node:module")).builtinModules.includes(specifier);\n}\nfunction getSyntheticModuleExports(moduleExports) {\n const namespaceObject = moduleExports && (typeof moduleExports === "object" || typeof moduleExports === "function") ? moduleExports : { default: moduleExports };\n const effectiveExports = { ...namespaceObject };\n if (!Object.prototype.hasOwnProperty.call(effectiveExports, "default")) effectiveExports.default = namespaceObject;\n return effectiveExports;\n}\nasync function createSyntheticModuleFromExports(identifier, moduleExports, vm) {\n if (typeof vm.SyntheticModule !== "function") throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");\n const effectiveExports = getSyntheticModuleExports(moduleExports);\n const exportNames = Object.keys(effectiveExports);\n const syntheticModule = new vm.SyntheticModule(exportNames, function setSyntheticModuleExports() {\n for (const name of exportNames) this.setExport(name, effectiveExports[name]);\n }, { identifier });\n esmModuleCache.set(identifier, syntheticModule);\n await syntheticModule.link(async () => {\n throw new Error(`Node.js built-in module "${identifier}" should not request child modules.`);\n });\n await syntheticModule.evaluate();\n return syntheticModule;\n}\nasync function loadNodeBuiltinModule(specifier, vm) {\n const cacheKey = `node-builtin:${specifier}`;\n if (esmModuleCache.has(cacheKey)) return esmModuleCache.get(cacheKey);\n return createSyntheticModuleFromExports(cacheKey, await importNodeModule(specifier), vm);\n}\nasync function loadResolvedModule(specifier, parentUrl, options) {\n if (await isNodeBuiltinSpecifier(specifier)) return loadNodeBuiltinModule(specifier, options.vm);\n if (isBareModuleSpecifier(specifier)) throw new Error(`Unsupported ESM module specifier "${specifier}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);\n const resolvedUrl = new URL(specifier, parentUrl).href;\n if (!isFetchableRemoteModuleUrl(resolvedUrl)) throw new Error(`Unsupported ESM module specifier "${specifier}" resolved to "${resolvedUrl}". Only http(s) remote modules and Node.js built-in modules are supported.`);\n return loadModule(resolvedUrl, options);\n}\nasync function evaluateDynamicModule(module) {\n if (module.status === "linked") await module.evaluate();\n if (module.status === "errored") throw module.error;\n return module;\n}\nasync function loadModule(url, options) {\n if (esmModuleCache.has(url)) return esmModuleCache.get(url);\n const { fetch: fetch2, vm } = options;\n if (!isFetchableRemoteModuleUrl(url)) throw new Error(`Unsupported ESM module URL "${url}". Only http(s) remote modules and Node.js built-in modules are supported.`);\n const code = await (await fetch2(url)).text();\n const cwdFileUrl = (await importNodeModule("node:url")).pathToFileURL(process.cwd()).href;\n const sourceTextModule = new vm.SourceTextModule(code, {\n identifier: url,\n initializeImportMeta: (meta) => {\n meta.url = createImportMetaUrl(url, cwdFileUrl);\n },\n importModuleDynamically: async (specifier) => {\n return evaluateDynamicModule(await loadResolvedModule(specifier, url, options));\n }\n });\n esmModuleCache.set(url, sourceTextModule);\n await sourceTextModule.link(async (specifier) => {\n return loadResolvedModule(specifier, url, options);\n });\n return sourceTextModule;\n}\nconst dataFetchFunction = async function(options) {\n var _a, _b;\n const [id, data, downgrade] = options;\n logger.debug("==========call data fetch function!");\n if (data) {\n if (!id) {\n throw new Error("id is required!");\n }\n if (!getDataFetchMap()) {\n initDataFetchMap();\n }\n const dataFetchItem = getDataFetchItem(id);\n if (dataFetchItem) {\n (_b = (_a = dataFetchItem[1]) == null ? void 0 : _a[1]) == null ? void 0 : _b.call(_a, data);\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.LOADED;\n return;\n }\n if (!dataFetchItem) {\n const dataFetchMap = getDataFetchMap();\n let res;\n let rej;\n const p = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n dataFetchMap[id] = [\n [\n async () => async () => {\n return "";\n },\n MF_DATA_FETCH_TYPE.FETCH_SERVER\n ],\n [p, res, rej],\n MF_DATA_FETCH_STATUS.LOADED\n ];\n res && res(data);\n return;\n }\n }\n if (downgrade) {\n const mfDowngrade2 = getDowngradeTag();\n if (!mfDowngrade2) {\n globalThis[DOWNGRADE_KEY] = id ? [id] : true;\n } else if (Array.isArray(mfDowngrade2) && id && !mfDowngrade2.includes(id)) {\n mfDowngrade2.push(id);\n }\n }\n const mfDowngrade = getDowngradeTag();\n if (typeof mfDowngrade === "boolean") {\n return callAllDowngrade();\n }\n if (Array.isArray(mfDowngrade)) {\n if (!id) {\n globalThis[DOWNGRADE_KEY] = true;\n return callAllDowngrade();\n }\n if (!mfDowngrade.includes(id)) {\n mfDowngrade.push(id);\n }\n return callDowngrade(id);\n }\n};\nfunction injectDataFetch() {\n var _a;\n globalThis[_a = DATA_FETCH_FUNCTION] || (globalThis[_a] = []);\n const dataFetch = globalThis[DATA_FETCH_FUNCTION];\n if (dataFetch.push === dataFetchFunction) {\n return;\n }\n if (typeof window === "undefined") {\n return;\n }\n globalThis[FS_HREF] = window.location.href;\n dataFetch.push = dataFetchFunction;\n}\nconst getDocsUrl = (errorCode) => {\n return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;\n};\nconst getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {\n const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];\n args && msg.push(`args: ${JSON.stringify(args)}`);\n msg.push(getDocsUrl(errorCode));\n originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);\n return msg.join("\\n");\n};\nfunction logAndReport(code, descMap, args, logger2, originalErrorMsg, context) {\n return logger2(getShortErrorMsg(code, descMap, args, originalErrorMsg));\n}\nconst LOG_CATEGORY = "[ Federation Runtime ]";\nfunction error(msgOrCode, descMap, args, originalErrorMsg, context) {\n if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg2) => {\n throw new Error(`${LOG_CATEGORY}: ${msg2}`);\n }, originalErrorMsg);\n const msg = msgOrCode;\n if (msg instanceof Error) {\n if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;\n throw msg;\n }\n throw new Error(`${LOG_CATEGORY}: ${msg}`);\n}\nconst CurrentGlobal = typeof globalThis === "object" ? globalThis : window;\nconst nativeGlobal = (() => {\n try {\n return document.defaultView;\n } catch {\n return CurrentGlobal;\n }\n})();\nfunction definePropertyGlobalVal(target, key, val) {\n Object.defineProperty(target, key, {\n value: val,\n configurable: false,\n writable: true\n });\n}\nfunction includeOwnProperty(target, key) {\n return Object.hasOwnProperty.call(target, key);\n}\nif (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});\nconst globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;\nfunction setGlobalDefaultVal(target) {\n var _a, _b, _c, _d, _e, _f;\n if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);\n if (!includeOwnProperty(target, "__FEDERATION__")) {\n definePropertyGlobalVal(target, "__FEDERATION__", {\n __GLOBAL_PLUGIN__: [],\n __INSTANCES__: [],\n moduleInfo: {},\n __SHARE__: {},\n __MANIFEST_LOADING__: {},\n __PRELOADED_MAP__: /* @__PURE__ */ new Map()\n });\n definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);\n }\n (_a = target.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (_a.__GLOBAL_PLUGIN__ = []);\n (_b = target.__FEDERATION__).__INSTANCES__ ?? (_b.__INSTANCES__ = []);\n (_c = target.__FEDERATION__).moduleInfo ?? (_c.moduleInfo = {});\n (_d = target.__FEDERATION__).__SHARE__ ?? (_d.__SHARE__ = {});\n (_e = target.__FEDERATION__).__MANIFEST_LOADING__ ?? (_e.__MANIFEST_LOADING__ = {});\n (_f = target.__FEDERATION__).__PRELOADED_MAP__ ?? (_f.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());\n}\nsetGlobalDefaultVal(CurrentGlobal);\nsetGlobalDefaultVal(nativeGlobal);\nconst getRemoteEntryExports = (name, globalName) => {\n const remoteEntryKey = globalName || `__FEDERATION_${name}:custom__`;\n return {\n remoteEntryKey,\n entryExports: CurrentGlobal[remoteEntryKey]\n };\n};\nconst DEFAULT_SCOPE = "default";\nconst DEFAULT_REMOTE_TYPE = "global";\nfunction matchRemoteWithNameAndExpose(remotes, id) {\n for (const remote of remotes) {\n const isNameMatched = id.startsWith(remote.name);\n let expose = id.replace(remote.name, "");\n if (isNameMatched) {\n if (expose.startsWith("/")) {\n const pkgNameOrAlias = remote.name;\n expose = `.${expose}`;\n return {\n pkgNameOrAlias,\n expose,\n remote\n };\n } else if (expose === "") return {\n pkgNameOrAlias: remote.name,\n expose: ".",\n remote\n };\n }\n const isAliasMatched = remote.alias && id.startsWith(remote.alias);\n let exposeWithAlias = remote.alias && id.replace(remote.alias, "");\n if (remote.alias && isAliasMatched) {\n if (exposeWithAlias && exposeWithAlias.startsWith("/")) {\n const pkgNameOrAlias = remote.alias;\n exposeWithAlias = `.${exposeWithAlias}`;\n return {\n pkgNameOrAlias,\n expose: exposeWithAlias,\n remote\n };\n } else if (exposeWithAlias === "") return {\n pkgNameOrAlias: remote.alias,\n expose: ".",\n remote\n };\n }\n }\n}\nconst RUNTIME_001 = "RUNTIME-001";\nconst RUNTIME_002 = "RUNTIME-002";\nconst RUNTIME_003 = "RUNTIME-003";\nconst RUNTIME_004 = "RUNTIME-004";\nconst RUNTIME_005 = "RUNTIME-005";\nconst RUNTIME_006 = "RUNTIME-006";\nconst RUNTIME_007 = "RUNTIME-007";\nconst RUNTIME_008 = "RUNTIME-008";\nconst RUNTIME_009 = "RUNTIME-009";\nconst RUNTIME_010 = "RUNTIME-010";\nconst RUNTIME_011 = "RUNTIME-011";\nconst RUNTIME_012 = "RUNTIME-012";\nconst RUNTIME_013 = "RUNTIME-013";\nconst RUNTIME_014 = "RUNTIME-014";\nconst RUNTIME_015 = "RUNTIME-015";\nconst runtimeDescMap = {\n [RUNTIME_001]: "Failed to get remoteEntry exports.",\n [RUNTIME_002]: \'The remote entry interface does not contain "init"\',\n [RUNTIME_003]: "Failed to get manifest.",\n [RUNTIME_004]: "Failed to locate remote.",\n [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",\n [RUNTIME_006]: "Invalid loadShareSync function call from runtime",\n [RUNTIME_007]: "Failed to get remote snapshot.",\n [RUNTIME_008]: "Failed to load script resources.",\n [RUNTIME_009]: "Please call createInstance first.",\n [RUNTIME_010]: \'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.\',\n [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",\n [RUNTIME_012]: \'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.\',\n [RUNTIME_013]: "The manifest is not a valid Module Federation manifest.",\n [RUNTIME_014]: "The remote does not expose the requested module.",\n [RUNTIME_015]: "Remote container initialization failed."\n};\n({\n ...runtimeDescMap\n});\nconst importCallback = ".then(callbacks[0]).catch(callbacks[1])";\nasync function loadEsmEntry({ entry, remoteEntryExports }) {\n return new Promise((resolve, reject) => {\n try {\n if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${entry}")${importCallback}`)([resolve, reject]);\n else import(\n /* webpackIgnore: true */\n /* @vite-ignore */\n entry\n ).then(resolve).catch(reject);\n else resolve(remoteEntryExports);\n } catch (e) {\n error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n }\n });\n}\nasync function loadSystemJsEntry({ entry, remoteEntryExports }) {\n return new Promise((resolve, reject) => {\n try {\n if (!remoteEntryExports) if (typeof __system_context__ === "undefined") System.import(entry).then(resolve).catch(reject);\n else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);\n else resolve(remoteEntryExports);\n } catch (e) {\n error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n }\n });\n}\nfunction handleRemoteEntryLoaded(name, globalName, entry) {\n const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);\n if (!entryExports) error(RUNTIME_001, runtimeDescMap, {\n remoteName: name,\n remoteEntryUrl: entry,\n remoteEntryKey\n });\n return entryExports;\n}\nasync function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook, getEntryUrl, resourceContext }) {\n const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);\n if (remoteEntryExports) return remoteEntryExports;\n const url = getEntryUrl ? getEntryUrl(entry) : entry;\n return loadScript(url, {\n attrs: {},\n createScriptHook: (url2, attrs) => {\n const res = loaderHook.lifecycle.createScript.emit({\n url: url2,\n attrs,\n remoteInfo,\n resourceContext: resourceContext ? {\n ...resourceContext,\n url: url2\n } : void 0\n });\n if (!res) return;\n if (res instanceof HTMLScriptElement) return res;\n if ("script" in res || "timeout" in res) return res;\n }\n }).then(() => {\n return handleRemoteEntryLoaded(name, globalName, entry);\n }, (loadError) => {\n const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);\n error(RUNTIME_008, runtimeDescMap, {\n remoteName: name,\n resourceUrl: url\n }, originalMsg);\n });\n}\nasync function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl, resourceContext }) {\n const { entry, entryGlobalName: globalName, name, type } = remoteInfo;\n switch (type) {\n case "esm":\n case "module":\n return loadEsmEntry({\n entry,\n remoteEntryExports\n });\n case "system":\n return loadSystemJsEntry({\n entry,\n remoteEntryExports\n });\n default:\n return loadEntryScript({\n entry,\n globalName,\n name,\n remoteInfo,\n loaderHook,\n getEntryUrl,\n resourceContext\n });\n }\n}\nasync function loadEntryNode({ remoteInfo, loaderHook, resourceContext }) {\n const { entry, entryGlobalName: globalName, name, type } = remoteInfo;\n const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);\n if (remoteEntryExports) return remoteEntryExports;\n return loadScriptNode(entry, {\n attrs: {\n name,\n globalName,\n type\n },\n loaderHook: { createScriptHook: (url, attrs = {}) => {\n const res = loaderHook.lifecycle.createScript.emit({\n url,\n attrs,\n remoteInfo,\n resourceContext: resourceContext ? {\n ...resourceContext,\n url\n } : void 0\n });\n if (!res) return;\n if ("url" in res) return res;\n } }\n }).then(() => {\n return handleRemoteEntryLoaded(name, globalName, entry);\n }).catch((e) => {\n error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n });\n}\nfunction getRemoteEntryUniqueKey(remoteInfo) {\n const { entry, name } = remoteInfo;\n return composeKeyWithSeparator(name, entry);\n}\nasync function getRemoteEntry(params) {\n const { origin, remoteEntryExports, remoteInfo, getEntryUrl, resourceContext, _inErrorHandling = false } = params;\n const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);\n if (remoteEntryExports) return remoteEntryExports;\n if (!globalLoading[uniqueKey]) {\n const loadEntryHook = origin.remoteHandler.hooks.lifecycle.loadEntry;\n const loaderHook = origin.loaderHook;\n globalLoading[uniqueKey] = loadEntryHook.emit({\n origin,\n loaderHook,\n remoteInfo,\n remoteEntryExports\n }).then((res) => {\n if (res) return res;\n return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : isBrowserEnvValue) ? loadEntryDom({\n remoteInfo,\n remoteEntryExports,\n loaderHook,\n getEntryUrl,\n resourceContext\n }) : loadEntryNode({\n remoteInfo,\n loaderHook,\n resourceContext\n });\n }).then(async (res) => {\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n remoteEntryExports: res\n });\n return res;\n }).catch(async (err) => {\n const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);\n const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");\n if (err instanceof Error && err.message.includes(RUNTIME_008) && !isScriptExecutionError && !_inErrorHandling) {\n const wrappedGetRemoteEntry = (params2) => {\n return getRemoteEntry({\n ...params2,\n _inErrorHandling: true\n });\n };\n const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({\n getRemoteEntry: wrappedGetRemoteEntry,\n origin,\n remoteInfo,\n remoteEntryExports,\n globalLoading,\n uniqueKey: uniqueKey2\n });\n if (RemoteEntryExports) {\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n remoteEntryExports: RemoteEntryExports,\n recovered: true\n });\n return RemoteEntryExports;\n }\n }\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n error: err\n });\n throw err;\n });\n }\n return globalLoading[uniqueKey];\n}\nfunction getRemoteInfo(remote) {\n return {\n ...remote,\n entry: "entry" in remote ? remote.entry : "",\n type: remote.type || DEFAULT_REMOTE_TYPE,\n entryGlobalName: remote.entryGlobalName || remote.name,\n shareScope: remote.shareScope || DEFAULT_SCOPE\n };\n}\nfunction isTimeoutError(error2) {\n if (!(error2 instanceof Error)) return false;\n return error2.message.includes("timed out") || error2.name.includes("Timeout");\n}\nfunction createAssetResult(context, url, status, error2) {\n return {\n url,\n status,\n resourceType: context.resourceType,\n initiator: context.initiator,\n id: context.id,\n error: error2\n };\n}\nasync function waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, context) {\n const cachedRemote = host.moduleCache.get(entryRemoteInfo.name);\n const url = entryRemoteInfo.entry;\n if (cachedRemote == null ? void 0 : cachedRemote.remoteEntryExports) return createAssetResult(context, url, "cached");\n try {\n if (!await getRemoteEntry({\n origin: host,\n remoteInfo: entryRemoteInfo,\n remoteEntryExports: cachedRemote == null ? void 0 : cachedRemote.remoteEntryExports,\n resourceContext: {\n ...context,\n url\n }\n })) throw new Error(`Failed to load remoteEntry "${url}".`);\n return createAssetResult(context, url, "success");\n } catch (error2) {\n return createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2);\n }\n}\nfunction waitForLinkPreload({ host, remoteInfo, url, attrs, context, needDeleteLink }) {\n return new Promise((resolve) => {\n const { link, needAttach } = createLink({\n url,\n cb: () => {\n resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));\n },\n onErrorCallback: (error2) => {\n resolve(createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2));\n },\n attrs,\n createLinkHook: (hookUrl, hookAttrs) => {\n const res = host.loaderHook.lifecycle.createLink.emit({\n url: hookUrl,\n attrs: hookAttrs,\n remoteInfo,\n resourceContext: {\n ...context,\n url: hookUrl\n }\n });\n if (res instanceof HTMLLinkElement) return res;\n return res;\n },\n needDeleteLink\n });\n needAttach && document.head.appendChild(link);\n });\n}\nfunction waitForScriptPreload({ host, remoteInfo, url, attrs, context }) {\n return new Promise((resolve) => {\n const { script, needAttach } = createScript({\n url,\n cb: () => {\n resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));\n },\n onErrorCallback: (error2) => {\n resolve(createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2));\n },\n attrs,\n createScriptHook: (hookUrl, hookAttrs) => {\n const res = host.loaderHook.lifecycle.createScript.emit({\n url: hookUrl,\n attrs: hookAttrs,\n remoteInfo,\n resourceContext: {\n ...context,\n url: hookUrl\n }\n });\n if (res instanceof HTMLScriptElement) return res;\n return res;\n },\n needDeleteScript: true\n });\n needAttach && document.head.appendChild(script);\n });\n}\nfunction createResourceContext(baseContext, resourceType) {\n return {\n ...baseContext,\n resourceType\n };\n}\nfunction preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseContext = {\n initiator: "preloadRemote",\n id: remoteInfo.name\n}) {\n const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;\n const results = [];\n if (host.options.inBrowser) {\n entryAssets.forEach((asset) => {\n const { moduleInfo: entryRemoteInfo } = asset;\n results.push(waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, createResourceContext(baseContext, "remoteEntry")));\n });\n if (useLinkPreload) {\n const defaultAttrs = {\n rel: "preload",\n as: "style"\n };\n cssAssets.forEach((cssUrl) => {\n results.push(waitForLinkPreload({\n host,\n remoteInfo,\n url: cssUrl,\n attrs: defaultAttrs,\n context: createResourceContext(baseContext, "css")\n }));\n });\n } else {\n const defaultAttrs = {\n rel: "stylesheet",\n type: "text/css"\n };\n cssAssets.forEach((cssUrl) => {\n results.push(waitForLinkPreload({\n host,\n remoteInfo,\n url: cssUrl,\n attrs: defaultAttrs,\n needDeleteLink: false,\n context: createResourceContext(baseContext, "css")\n }));\n });\n }\n if (useLinkPreload) {\n const defaultAttrs = {\n rel: "preload",\n as: "script"\n };\n jsAssetsWithoutEntry.forEach((jsUrl) => {\n results.push(waitForLinkPreload({\n host,\n remoteInfo,\n url: jsUrl,\n attrs: defaultAttrs,\n context: createResourceContext(baseContext, "js")\n }));\n });\n } else {\n const defaultAttrs = {\n fetchpriority: "high",\n type: (remoteInfo == null ? void 0 : remoteInfo.type) === "module" ? "module" : "text/javascript"\n };\n jsAssetsWithoutEntry.forEach((jsUrl) => {\n results.push(waitForScriptPreload({\n host,\n remoteInfo,\n url: jsUrl,\n attrs: defaultAttrs,\n context: createResourceContext(baseContext, "js")\n }));\n });\n }\n }\n return Promise.all(results);\n}\nvar helpers_default = {\n utils: {\n matchRemoteWithNameAndExpose,\n preloadAssets,\n getRemoteInfo\n }\n};\ntypeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;\nconst helpers = helpers_default;\nconst utils = helpers.utils;\nconst runtimeHelpers = {\n utils\n};\nasync function prefetch(options) {\n const { instance, id, dataFetchParams, preloadComponentResource } = options;\n if (!id) {\n logger.error("id is required for prefetch!");\n return;\n }\n if (!instance) {\n logger.error("instance is required for prefetch!");\n return;\n }\n const matchedRemoteInfo = runtimeHelpers.utils.matchRemoteWithNameAndExpose(\n instance.options.remotes,\n id\n );\n if (!matchedRemoteInfo) {\n logger.error(`Can not found \'${id}\' in instance.options.remotes!`);\n return;\n }\n const { remote, expose } = matchedRemoteInfo;\n const { remoteSnapshot, globalSnapshot } = await instance.snapshotHandler.loadRemoteSnapshotInfo({\n moduleInfo: remote,\n id\n });\n if (preloadComponentResource) {\n const remoteInfo = runtimeHelpers.utils.getRemoteInfo(remote);\n Promise.resolve(\n instance.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({\n origin: instance,\n preloadOptions: {\n remote,\n preloadConfig: {\n nameOrAlias: remote.name,\n exposes: [expose]\n }\n },\n remote,\n remoteInfo,\n globalSnapshot,\n remoteSnapshot\n })\n ).then((assets) => {\n if (assets) {\n runtimeHelpers.utils.preloadAssets(remoteInfo, instance, assets);\n }\n });\n }\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n const dataFetchInfo = getDataFetchInfo({\n name: remote.name,\n alias: remote.alias,\n id,\n remoteSnapshot\n });\n const dataFetchMapKey = getDataFetchMapKey(dataFetchInfo, {\n name: instance.name,\n version: instance.options.version\n });\n if (!dataFetchMapKey) {\n return;\n }\n const dataFetchItem = dataFetchMap[dataFetchMapKey];\n if (!dataFetchItem) {\n return;\n }\n const [getDataFetchGetter, _type, getDataFetchPromise] = dataFetchItem[0];\n let _getDataFetchPromise = getDataFetchPromise;\n if (!getDataFetchPromise) {\n if (!getDataFetchGetter) {\n return;\n }\n _getDataFetchPromise = getDataFetchGetter();\n }\n _getDataFetchPromise.then((dataFetchFn) => {\n return dataFetchFn({\n ...dataFetchParams,\n _id: dataFetchMapKey,\n isDowngrade: false\n });\n });\n}\nexport {\n dataFetchFunction as d,\n injectDataFetch as i,\n prefetch as p\n};\n',"utils-DGS4pYp8.mjs":'var __defProp = Object.defineProperty;\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);\nvar __privateWrapper = (obj, member, setter, getter) => ({\n set _(value) {\n __privateSet(obj, member, value, setter);\n },\n get _() {\n return __privateGet(obj, member, getter);\n }\n});\nvar _a, _constructing, _b, _c, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;\nimport { S as SEPARATOR, c as createLogger, i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";\nconst LOG_CATEGORY = "[ Federation Runtime ]";\nconst composeKeyWithSeparator = function(...args) {\n if (!args.length) return "";\n return args.reduce((sum, cur) => {\n if (!cur) return sum;\n if (!sum) return cur;\n return `${sum}${SEPARATOR}${cur}`;\n }, "");\n};\nconst warn = (msg) => {\n console.warn(`${LOG_CATEGORY}: ${msg}`);\n};\nconst PLUGIN_IDENTIFIER = "[ Module Federation React ]";\nconst DOWNGRADE_KEY = "_mfSSRDowngrade";\nconst DATA_FETCH_FUNCTION = "_mfDataFetch";\nconst FS_HREF = "_mfFSHref";\nconst ERROR_TYPE = {\n DATA_FETCH: 1,\n LOAD_REMOTE: 2,\n UNKNOWN: 3\n};\nconst WRAP_DATA_FETCH_ID_IDENTIFIER = "wrap_dfip_identifier";\nvar MF_DATA_FETCH_TYPE = /* @__PURE__ */ ((MF_DATA_FETCH_TYPE2) => {\n MF_DATA_FETCH_TYPE2[MF_DATA_FETCH_TYPE2["FETCH_SERVER"] = 1] = "FETCH_SERVER";\n MF_DATA_FETCH_TYPE2[MF_DATA_FETCH_TYPE2["FETCH_CLIENT"] = 2] = "FETCH_CLIENT";\n return MF_DATA_FETCH_TYPE2;\n})(MF_DATA_FETCH_TYPE || {});\nvar MF_DATA_FETCH_STATUS = /* @__PURE__ */ ((MF_DATA_FETCH_STATUS2) => {\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["LOADED"] = 1] = "LOADED";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["LOADING"] = 2] = "LOADING";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["AWAIT"] = 0] = "AWAIT";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["ERROR"] = 3] = "ERROR";\n return MF_DATA_FETCH_STATUS2;\n})(MF_DATA_FETCH_STATUS || {});\nconst DATA_FETCH_IDENTIFIER = "data";\nconst DATA_FETCH_CLIENT_SUFFIX = ".client";\nconst DATA_FETCH_QUERY = "x-mf-data-fetch";\nconst DATA_FETCH_ERROR_PREFIX = "caught the following error during dataFetch: ";\nconst LOAD_REMOTE_ERROR_PREFIX = "caught the following error during loadRemote: ";\nconst logger = createLogger(PLUGIN_IDENTIFIER);\nconst perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;\nconst warned = /* @__PURE__ */ new Set();\nconst PROCESS = typeof process === "object" && !!process ? process : {};\nconst emitWarning = (msg, type, code, fn) => {\n typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);\n};\nlet AC = globalThis.AbortController;\nlet AS = globalThis.AbortSignal;\nif (typeof AC === "undefined") {\n AS = class AbortSignal {\n constructor() {\n __publicField(this, "onabort");\n __publicField(this, "_onabort", []);\n __publicField(this, "reason");\n __publicField(this, "aborted", false);\n }\n addEventListener(_, fn) {\n this._onabort.push(fn);\n }\n };\n AC = class AbortController {\n constructor() {\n __publicField(this, "signal", new AS());\n warnACPolyfill();\n }\n abort(reason) {\n var _a2, _b2;\n if (this.signal.aborted)\n return;\n this.signal.reason = reason;\n this.signal.aborted = true;\n for (const fn of this.signal._onabort) {\n fn(reason);\n }\n (_b2 = (_a2 = this.signal).onabort) == null ? void 0 : _b2.call(_a2, reason);\n }\n };\n let printACPolyfillWarning = ((_a = PROCESS.env) == null ? void 0 : _a.LRU_CACHE_IGNORE_AC_WARNING) !== "1";\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning)\n return;\n printACPolyfillWarning = false;\n emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);\n };\n}\nconst shouldWarn = (code) => !warned.has(code);\nconst isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);\nconst getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;\nclass ZeroArray extends Array {\n constructor(size) {\n super(size);\n this.fill(0);\n }\n}\nconst _Stack = class _Stack {\n constructor(max, HeapCls) {\n __publicField(this, "heap");\n __publicField(this, "length");\n if (!__privateGet(_Stack, _constructing)) {\n throw new TypeError("instantiate Stack using Stack.create(n)");\n }\n this.heap = new HeapCls(max);\n this.length = 0;\n }\n static create(max) {\n const HeapCls = getUintArray(max);\n if (!HeapCls)\n return [];\n __privateSet(_Stack, _constructing, true);\n const s = new _Stack(max, HeapCls);\n __privateSet(_Stack, _constructing, false);\n return s;\n }\n push(n) {\n this.heap[this.length++] = n;\n }\n pop() {\n return this.heap[--this.length];\n }\n};\n_constructing = new WeakMap();\n// private constructor\n__privateAdd(_Stack, _constructing, false);\nlet Stack = _Stack;\nconst _LRUCache = class _LRUCache {\n constructor(options) {\n __privateAdd(this, _LRUCache_instances);\n // options that cannot be changed without disaster\n __privateAdd(this, _max);\n __privateAdd(this, _maxSize);\n __privateAdd(this, _dispose);\n __privateAdd(this, _disposeAfter);\n __privateAdd(this, _fetchMethod);\n __privateAdd(this, _memoMethod);\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n __publicField(this, "ttl");\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n __publicField(this, "ttlResolution");\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n __publicField(this, "ttlAutopurge");\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n __publicField(this, "updateAgeOnGet");\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n __publicField(this, "updateAgeOnHas");\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n __publicField(this, "allowStale");\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n __publicField(this, "noDisposeOnSet");\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n __publicField(this, "noUpdateTTL");\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n __publicField(this, "maxEntrySize");\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n __publicField(this, "sizeCalculation");\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n __publicField(this, "noDeleteOnFetchRejection");\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n __publicField(this, "noDeleteOnStaleGet");\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n __publicField(this, "allowStaleOnFetchAbort");\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n __publicField(this, "allowStaleOnFetchRejection");\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n __publicField(this, "ignoreFetchAbort");\n // computed properties\n __privateAdd(this, _size);\n __privateAdd(this, _calculatedSize);\n __privateAdd(this, _keyMap);\n __privateAdd(this, _keyList);\n __privateAdd(this, _valList);\n __privateAdd(this, _next);\n __privateAdd(this, _prev);\n __privateAdd(this, _head);\n __privateAdd(this, _tail);\n __privateAdd(this, _free);\n __privateAdd(this, _disposed);\n __privateAdd(this, _sizes);\n __privateAdd(this, _starts);\n __privateAdd(this, _ttls);\n __privateAdd(this, _hasDispose);\n __privateAdd(this, _hasFetchMethod);\n __privateAdd(this, _hasDisposeAfter);\n // conditionally set private methods related to TTL\n __privateAdd(this, _updateItemAge, () => {\n });\n __privateAdd(this, _statusTTL, () => {\n });\n __privateAdd(this, _setItemTTL, () => {\n });\n /* c8 ignore stop */\n __privateAdd(this, _isStale, () => false);\n __privateAdd(this, _removeItemSize, (_i) => {\n });\n __privateAdd(this, _addItemSize, (_i, _s, _st) => {\n });\n __privateAdd(this, _requireSize, (_k, _v, size, sizeCalculation) => {\n if (size || sizeCalculation) {\n throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");\n }\n return 0;\n });\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n __publicField(this, _b, "LRUCache");\n const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError("max option must be a nonnegative integer");\n }\n const UintArray = max ? getUintArray(max) : Array;\n if (!UintArray) {\n throw new Error("invalid max value: " + max);\n }\n __privateSet(this, _max, max);\n __privateSet(this, _maxSize, maxSize);\n this.maxEntrySize = maxEntrySize || __privateGet(this, _maxSize);\n this.sizeCalculation = sizeCalculation;\n if (this.sizeCalculation) {\n if (!__privateGet(this, _maxSize) && !this.maxEntrySize) {\n throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");\n }\n if (typeof this.sizeCalculation !== "function") {\n throw new TypeError("sizeCalculation set to non-function");\n }\n }\n if (memoMethod !== void 0 && typeof memoMethod !== "function") {\n throw new TypeError("memoMethod must be a function if defined");\n }\n __privateSet(this, _memoMethod, memoMethod);\n if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {\n throw new TypeError("fetchMethod must be a function if specified");\n }\n __privateSet(this, _fetchMethod, fetchMethod);\n __privateSet(this, _hasFetchMethod, !!fetchMethod);\n __privateSet(this, _keyMap, /* @__PURE__ */ new Map());\n __privateSet(this, _keyList, new Array(max).fill(void 0));\n __privateSet(this, _valList, new Array(max).fill(void 0));\n __privateSet(this, _next, new UintArray(max));\n __privateSet(this, _prev, new UintArray(max));\n __privateSet(this, _head, 0);\n __privateSet(this, _tail, 0);\n __privateSet(this, _free, Stack.create(max));\n __privateSet(this, _size, 0);\n __privateSet(this, _calculatedSize, 0);\n if (typeof dispose === "function") {\n __privateSet(this, _dispose, dispose);\n }\n if (typeof disposeAfter === "function") {\n __privateSet(this, _disposeAfter, disposeAfter);\n __privateSet(this, _disposed, []);\n } else {\n __privateSet(this, _disposeAfter, void 0);\n __privateSet(this, _disposed, void 0);\n }\n __privateSet(this, _hasDispose, !!__privateGet(this, _dispose));\n __privateSet(this, _hasDisposeAfter, !!__privateGet(this, _disposeAfter));\n this.noDisposeOnSet = !!noDisposeOnSet;\n this.noUpdateTTL = !!noUpdateTTL;\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;\n this.ignoreFetchAbort = !!ignoreFetchAbort;\n if (this.maxEntrySize !== 0) {\n if (__privateGet(this, _maxSize) !== 0) {\n if (!isPosInt(__privateGet(this, _maxSize))) {\n throw new TypeError("maxSize must be a positive integer if specified");\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError("maxEntrySize must be a positive integer if specified");\n }\n __privateMethod(this, _LRUCache_instances, initializeSizeTracking_fn).call(this);\n }\n this.allowStale = !!allowStale;\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;\n this.updateAgeOnGet = !!updateAgeOnGet;\n this.updateAgeOnHas = !!updateAgeOnHas;\n this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;\n this.ttlAutopurge = !!ttlAutopurge;\n this.ttl = ttl || 0;\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError("ttl must be a positive integer if specified");\n }\n __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);\n }\n if (__privateGet(this, _max) === 0 && this.ttl === 0 && __privateGet(this, _maxSize) === 0) {\n throw new TypeError("At least one of max, maxSize, or ttl is required");\n }\n if (!this.ttlAutopurge && !__privateGet(this, _max) && !__privateGet(this, _maxSize)) {\n const code = "LRU_CACHE_UNBOUNDED";\n if (shouldWarn(code)) {\n warned.add(code);\n const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";\n emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);\n }\n }\n }\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals(c) {\n return {\n // properties\n starts: __privateGet(c, _starts),\n ttls: __privateGet(c, _ttls),\n sizes: __privateGet(c, _sizes),\n keyMap: __privateGet(c, _keyMap),\n keyList: __privateGet(c, _keyList),\n valList: __privateGet(c, _valList),\n next: __privateGet(c, _next),\n prev: __privateGet(c, _prev),\n get head() {\n return __privateGet(c, _head);\n },\n get tail() {\n return __privateGet(c, _tail);\n },\n free: __privateGet(c, _free),\n // methods\n isBackgroundFetch: (p) => {\n var _a2;\n return __privateMethod(_a2 = c, _LRUCache_instances, isBackgroundFetch_fn).call(_a2, p);\n },\n backgroundFetch: (k, index, options, context) => {\n var _a2;\n return __privateMethod(_a2 = c, _LRUCache_instances, backgroundFetch_fn).call(_a2, k, index, options, context);\n },\n moveToTail: (index) => {\n var _a2;\n return __privateMethod(_a2 = c, _LRUCache_instances, moveToTail_fn).call(_a2, index);\n },\n indexes: (options) => {\n var _a2;\n return __privateMethod(_a2 = c, _LRUCache_instances, indexes_fn).call(_a2, options);\n },\n rindexes: (options) => {\n var _a2;\n return __privateMethod(_a2 = c, _LRUCache_instances, rindexes_fn).call(_a2, options);\n },\n isStale: (index) => {\n var _a2;\n return __privateGet(_a2 = c, _isStale).call(_a2, index);\n }\n };\n }\n // Protected read-only members\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max() {\n return __privateGet(this, _max);\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize() {\n return __privateGet(this, _maxSize);\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize() {\n return __privateGet(this, _calculatedSize);\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size() {\n return __privateGet(this, _size);\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod() {\n return __privateGet(this, _fetchMethod);\n }\n get memoMethod() {\n return __privateGet(this, _memoMethod);\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return __privateGet(this, _dispose);\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return __privateGet(this, _disposeAfter);\n }\n /**\n * Return the number of ms left in the item\'s TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key) {\n return __privateGet(this, _keyMap).has(key) ? Infinity : 0;\n }\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {\n if (__privateGet(this, _valList)[i] !== void 0 && __privateGet(this, _keyList)[i] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield [__privateGet(this, _keyList)[i], __privateGet(this, _valList)[i]];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {\n if (__privateGet(this, _valList)[i] !== void 0 && __privateGet(this, _keyList)[i] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield [__privateGet(this, _keyList)[i], __privateGet(this, _valList)[i]];\n }\n }\n }\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {\n const k = __privateGet(this, _keyList)[i];\n if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield k;\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {\n const k = __privateGet(this, _keyList)[i];\n if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield k;\n }\n }\n }\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {\n const v = __privateGet(this, _valList)[i];\n if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield __privateGet(this, _valList)[i];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {\n const v = __privateGet(this, _valList)[i];\n if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {\n yield __privateGet(this, _valList)[i];\n }\n }\n }\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [(_c = Symbol.iterator, _b = Symbol.toStringTag, _c)]() {\n return this.entries();\n }\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(fn, getOptions = {}) {\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {\n const v = __privateGet(this, _valList)[i];\n const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n if (value === void 0)\n continue;\n if (fn(value, __privateGet(this, _keyList)[i], this)) {\n return this.get(__privateGet(this, _keyList)[i], getOptions);\n }\n }\n }\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(fn, thisp = this) {\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {\n const v = __privateGet(this, _valList)[i];\n const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n if (value === void 0)\n continue;\n fn.call(thisp, value, __privateGet(this, _keyList)[i], this);\n }\n }\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(fn, thisp = this) {\n for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {\n const v = __privateGet(this, _valList)[i];\n const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n if (value === void 0)\n continue;\n fn.call(thisp, value, __privateGet(this, _keyList)[i], this);\n }\n }\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false;\n for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {\n if (__privateGet(this, _isStale).call(this, i)) {\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[i], "expire");\n deleted = true;\n }\n }\n return deleted;\n }\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key) {\n const i = __privateGet(this, _keyMap).get(key);\n if (i === void 0)\n return void 0;\n const v = __privateGet(this, _valList)[i];\n const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n if (value === void 0)\n return void 0;\n const entry = { value };\n if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {\n const ttl = __privateGet(this, _ttls)[i];\n const start = __privateGet(this, _starts)[i];\n if (ttl && start) {\n const remain = ttl - (perf.now() - start);\n entry.ttl = remain;\n entry.start = Date.now();\n }\n }\n if (__privateGet(this, _sizes)) {\n entry.size = __privateGet(this, _sizes)[i];\n }\n return entry;\n }\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr = [];\n for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this, { allowStale: true })) {\n const key = __privateGet(this, _keyList)[i];\n const v = __privateGet(this, _valList)[i];\n const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n if (value === void 0 || key === void 0)\n continue;\n const entry = { value };\n if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {\n entry.ttl = __privateGet(this, _ttls)[i];\n const age = perf.now() - __privateGet(this, _starts)[i];\n entry.start = Math.floor(Date.now() - age);\n }\n if (__privateGet(this, _sizes)) {\n entry.size = __privateGet(this, _sizes)[i];\n }\n arr.unshift([key, entry]);\n }\n return arr;\n }\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr) {\n this.clear();\n for (const [key, entry] of arr) {\n if (entry.start) {\n const age = Date.now() - entry.start;\n entry.start = perf.now() - age;\n }\n this.set(key, entry.value, entry);\n }\n }\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(k, v, setOptions = {}) {\n var _a2, _b2, _c2, _d, _e;\n if (v === void 0) {\n this.delete(k);\n return this;\n }\n const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;\n let { noUpdateTTL = this.noUpdateTTL } = setOptions;\n const size = __privateGet(this, _requireSize).call(this, k, v, setOptions.size || 0, sizeCalculation);\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = "miss";\n status.maxEntrySizeExceeded = true;\n }\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "set");\n return this;\n }\n let index = __privateGet(this, _size) === 0 ? void 0 : __privateGet(this, _keyMap).get(k);\n if (index === void 0) {\n index = __privateGet(this, _size) === 0 ? __privateGet(this, _tail) : __privateGet(this, _free).length !== 0 ? __privateGet(this, _free).pop() : __privateGet(this, _size) === __privateGet(this, _max) ? __privateMethod(this, _LRUCache_instances, evict_fn).call(this, false) : __privateGet(this, _size);\n __privateGet(this, _keyList)[index] = k;\n __privateGet(this, _valList)[index] = v;\n __privateGet(this, _keyMap).set(k, index);\n __privateGet(this, _next)[__privateGet(this, _tail)] = index;\n __privateGet(this, _prev)[index] = __privateGet(this, _tail);\n __privateSet(this, _tail, index);\n __privateWrapper(this, _size)._++;\n __privateGet(this, _addItemSize).call(this, index, size, status);\n if (status)\n status.set = "add";\n noUpdateTTL = false;\n } else {\n __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);\n const oldVal = __privateGet(this, _valList)[index];\n if (v !== oldVal) {\n if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal)) {\n oldVal.__abortController.abort(new Error("replaced"));\n const { __staleWhileFetching: s } = oldVal;\n if (s !== void 0 && !noDisposeOnSet) {\n if (__privateGet(this, _hasDispose)) {\n (_a2 = __privateGet(this, _dispose)) == null ? void 0 : _a2.call(this, s, k, "set");\n }\n if (__privateGet(this, _hasDisposeAfter)) {\n (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([s, k, "set"]);\n }\n }\n } else if (!noDisposeOnSet) {\n if (__privateGet(this, _hasDispose)) {\n (_c2 = __privateGet(this, _dispose)) == null ? void 0 : _c2.call(this, oldVal, k, "set");\n }\n if (__privateGet(this, _hasDisposeAfter)) {\n (_d = __privateGet(this, _disposed)) == null ? void 0 : _d.push([oldVal, k, "set"]);\n }\n }\n __privateGet(this, _removeItemSize).call(this, index);\n __privateGet(this, _addItemSize).call(this, index, size, status);\n __privateGet(this, _valList)[index] = v;\n if (status) {\n status.set = "replace";\n const oldValue = oldVal && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal) ? oldVal.__staleWhileFetching : oldVal;\n if (oldValue !== void 0)\n status.oldValue = oldValue;\n }\n } else if (status) {\n status.set = "update";\n }\n }\n if (ttl !== 0 && !__privateGet(this, _ttls)) {\n __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);\n }\n if (__privateGet(this, _ttls)) {\n if (!noUpdateTTL) {\n __privateGet(this, _setItemTTL).call(this, index, ttl, start);\n }\n if (status)\n __privateGet(this, _statusTTL).call(this, status, index);\n }\n if (!noDisposeOnSet && __privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {\n const dt = __privateGet(this, _disposed);\n let task;\n while (task = dt == null ? void 0 : dt.shift()) {\n (_e = __privateGet(this, _disposeAfter)) == null ? void 0 : _e.call(this, ...task);\n }\n }\n return this;\n }\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop() {\n var _a2;\n try {\n while (__privateGet(this, _size)) {\n const val = __privateGet(this, _valList)[__privateGet(this, _head)];\n __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching;\n }\n } else if (val !== void 0) {\n return val;\n }\n }\n } finally {\n if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {\n const dt = __privateGet(this, _disposed);\n let task;\n while (task = dt == null ? void 0 : dt.shift()) {\n (_a2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _a2.call(this, ...task);\n }\n }\n }\n }\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k, hasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;\n const index = __privateGet(this, _keyMap).get(k);\n if (index !== void 0) {\n const v = __privateGet(this, _valList)[index];\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) && v.__staleWhileFetching === void 0) {\n return false;\n }\n if (!__privateGet(this, _isStale).call(this, index)) {\n if (updateAgeOnHas) {\n __privateGet(this, _updateItemAge).call(this, index);\n }\n if (status) {\n status.has = "hit";\n __privateGet(this, _statusTTL).call(this, status, index);\n }\n return true;\n } else if (status) {\n status.has = "stale";\n __privateGet(this, _statusTTL).call(this, status, index);\n }\n } else if (status) {\n status.has = "miss";\n }\n return false;\n }\n /**\n * Like {@link LRUCache#get} but doesn\'t update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k, peekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions;\n const index = __privateGet(this, _keyMap).get(k);\n if (index === void 0 || !allowStale && __privateGet(this, _isStale).call(this, index)) {\n return;\n }\n const v = __privateGet(this, _valList)[index];\n return __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;\n }\n async fetch(k, fetchOptions = {}) {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal\n } = fetchOptions;\n if (!__privateGet(this, _hasFetchMethod)) {\n if (status)\n status.fetch = "get";\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status\n });\n }\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal\n };\n let index = __privateGet(this, _keyMap).get(k);\n if (index === void 0) {\n if (status)\n status.fetch = "miss";\n const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context);\n return p.__returned = p;\n } else {\n const v = __privateGet(this, _valList)[index];\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n const stale = allowStale && v.__staleWhileFetching !== void 0;\n if (status) {\n status.fetch = "inflight";\n if (stale)\n status.returnedStale = true;\n }\n return stale ? v.__staleWhileFetching : v.__returned = v;\n }\n const isStale = __privateGet(this, _isStale).call(this, index);\n if (!forceRefresh && !isStale) {\n if (status)\n status.fetch = "hit";\n __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);\n if (updateAgeOnGet) {\n __privateGet(this, _updateItemAge).call(this, index);\n }\n if (status)\n __privateGet(this, _statusTTL).call(this, status, index);\n return v;\n }\n const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context);\n const hasStale = p.__staleWhileFetching !== void 0;\n const staleVal = hasStale && allowStale;\n if (status) {\n status.fetch = isStale ? "stale" : "refresh";\n if (staleVal && isStale)\n status.returnedStale = true;\n }\n return staleVal ? p.__staleWhileFetching : p.__returned = p;\n }\n }\n async forceFetch(k, fetchOptions = {}) {\n const v = await this.fetch(k, fetchOptions);\n if (v === void 0)\n throw new Error("fetch() returned undefined");\n return v;\n }\n memo(k, memoOptions = {}) {\n const memoMethod = __privateGet(this, _memoMethod);\n if (!memoMethod) {\n throw new Error("no memoMethod provided to constructor");\n }\n const { context, forceRefresh, ...options } = memoOptions;\n const v = this.get(k, options);\n if (!forceRefresh && v !== void 0)\n return v;\n const vv = memoMethod(k, v, {\n options,\n context\n });\n this.set(k, vv, options);\n return vv;\n }\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k, getOptions = {}) {\n const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;\n const index = __privateGet(this, _keyMap).get(k);\n if (index !== void 0) {\n const value = __privateGet(this, _valList)[index];\n const fetching = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, value);\n if (status)\n __privateGet(this, _statusTTL).call(this, status, index);\n if (__privateGet(this, _isStale).call(this, index)) {\n if (status)\n status.get = "stale";\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "expire");\n }\n if (status && allowStale)\n status.returnedStale = true;\n return allowStale ? value : void 0;\n } else {\n if (status && allowStale && value.__staleWhileFetching !== void 0) {\n status.returnedStale = true;\n }\n return allowStale ? value.__staleWhileFetching : void 0;\n }\n } else {\n if (status)\n status.get = "hit";\n if (fetching) {\n return value.__staleWhileFetching;\n }\n __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);\n if (updateAgeOnGet) {\n __privateGet(this, _updateItemAge).call(this, index);\n }\n return value;\n }\n } else if (status) {\n status.get = "miss";\n }\n }\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k) {\n return __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "delete");\n }\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return __privateMethod(this, _LRUCache_instances, clear_fn).call(this, "delete");\n }\n};\n_max = new WeakMap();\n_maxSize = new WeakMap();\n_dispose = new WeakMap();\n_disposeAfter = new WeakMap();\n_fetchMethod = new WeakMap();\n_memoMethod = new WeakMap();\n_size = new WeakMap();\n_calculatedSize = new WeakMap();\n_keyMap = new WeakMap();\n_keyList = new WeakMap();\n_valList = new WeakMap();\n_next = new WeakMap();\n_prev = new WeakMap();\n_head = new WeakMap();\n_tail = new WeakMap();\n_free = new WeakMap();\n_disposed = new WeakMap();\n_sizes = new WeakMap();\n_starts = new WeakMap();\n_ttls = new WeakMap();\n_hasDispose = new WeakMap();\n_hasFetchMethod = new WeakMap();\n_hasDisposeAfter = new WeakMap();\n_LRUCache_instances = new WeakSet();\ninitializeTTLTracking_fn = function() {\n const ttls = new ZeroArray(__privateGet(this, _max));\n const starts = new ZeroArray(__privateGet(this, _max));\n __privateSet(this, _ttls, ttls);\n __privateSet(this, _starts, starts);\n __privateSet(this, _setItemTTL, (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0;\n ttls[index] = ttl;\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (__privateGet(this, _isStale).call(this, index)) {\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[index], "expire");\n }\n }, ttl + 1);\n if (t.unref) {\n t.unref();\n }\n }\n });\n __privateSet(this, _updateItemAge, (index) => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0;\n });\n __privateSet(this, _statusTTL, (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index];\n const start = starts[index];\n if (!ttl || !start)\n return;\n status.ttl = ttl;\n status.start = start;\n status.now = cachedNow || getNow();\n const age = status.now - start;\n status.remainingTTL = ttl - age;\n }\n });\n let cachedNow = 0;\n const getNow = () => {\n const n = perf.now();\n if (this.ttlResolution > 0) {\n cachedNow = n;\n const t = setTimeout(() => cachedNow = 0, this.ttlResolution);\n if (t.unref) {\n t.unref();\n }\n }\n return n;\n };\n this.getRemainingTTL = (key) => {\n const index = __privateGet(this, _keyMap).get(key);\n if (index === void 0) {\n return 0;\n }\n const ttl = ttls[index];\n const start = starts[index];\n if (!ttl || !start) {\n return Infinity;\n }\n const age = (cachedNow || getNow()) - start;\n return ttl - age;\n };\n __privateSet(this, _isStale, (index) => {\n const s = starts[index];\n const t = ttls[index];\n return !!t && !!s && (cachedNow || getNow()) - s > t;\n });\n};\n_updateItemAge = new WeakMap();\n_statusTTL = new WeakMap();\n_setItemTTL = new WeakMap();\n_isStale = new WeakMap();\ninitializeSizeTracking_fn = function() {\n const sizes = new ZeroArray(__privateGet(this, _max));\n __privateSet(this, _calculatedSize, 0);\n __privateSet(this, _sizes, sizes);\n __privateSet(this, _removeItemSize, (index) => {\n __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) - sizes[index]);\n sizes[index] = 0;\n });\n __privateSet(this, _requireSize, (k, v, size, sizeCalculation) => {\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n return 0;\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== "function") {\n throw new TypeError("sizeCalculation must be a function");\n }\n size = sizeCalculation(v, k);\n if (!isPosInt(size)) {\n throw new TypeError("sizeCalculation return invalid (expect positive integer)");\n }\n } else {\n throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");\n }\n }\n return size;\n });\n __privateSet(this, _addItemSize, (index, size, status) => {\n sizes[index] = size;\n if (__privateGet(this, _maxSize)) {\n const maxSize = __privateGet(this, _maxSize) - sizes[index];\n while (__privateGet(this, _calculatedSize) > maxSize) {\n __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);\n }\n }\n __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) + sizes[index]);\n if (status) {\n status.entrySize = size;\n status.totalCalculatedSize = __privateGet(this, _calculatedSize);\n }\n });\n};\n_removeItemSize = new WeakMap();\n_addItemSize = new WeakMap();\n_requireSize = new WeakMap();\nindexes_fn = function* ({ allowStale = this.allowStale } = {}) {\n if (__privateGet(this, _size)) {\n for (let i = __privateGet(this, _tail); true; ) {\n if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i)) {\n break;\n }\n if (allowStale || !__privateGet(this, _isStale).call(this, i)) {\n yield i;\n }\n if (i === __privateGet(this, _head)) {\n break;\n } else {\n i = __privateGet(this, _prev)[i];\n }\n }\n }\n};\nrindexes_fn = function* ({ allowStale = this.allowStale } = {}) {\n if (__privateGet(this, _size)) {\n for (let i = __privateGet(this, _head); true; ) {\n if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i)) {\n break;\n }\n if (allowStale || !__privateGet(this, _isStale).call(this, i)) {\n yield i;\n }\n if (i === __privateGet(this, _tail)) {\n break;\n } else {\n i = __privateGet(this, _next)[i];\n }\n }\n }\n};\nisValidIndex_fn = function(index) {\n return index !== void 0 && __privateGet(this, _keyMap).get(__privateGet(this, _keyList)[index]) === index;\n};\nevict_fn = function(free) {\n var _a2, _b2;\n const head = __privateGet(this, _head);\n const k = __privateGet(this, _keyList)[head];\n const v = __privateGet(this, _valList)[head];\n if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n v.__abortController.abort(new Error("evicted"));\n } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {\n if (__privateGet(this, _hasDispose)) {\n (_a2 = __privateGet(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, "evict");\n }\n if (__privateGet(this, _hasDisposeAfter)) {\n (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, "evict"]);\n }\n }\n __privateGet(this, _removeItemSize).call(this, head);\n if (free) {\n __privateGet(this, _keyList)[head] = void 0;\n __privateGet(this, _valList)[head] = void 0;\n __privateGet(this, _free).push(head);\n }\n if (__privateGet(this, _size) === 1) {\n __privateSet(this, _head, __privateSet(this, _tail, 0));\n __privateGet(this, _free).length = 0;\n } else {\n __privateSet(this, _head, __privateGet(this, _next)[head]);\n }\n __privateGet(this, _keyMap).delete(k);\n __privateWrapper(this, _size)._--;\n return head;\n};\nbackgroundFetch_fn = function(k, index, options, context) {\n const v = index === void 0 ? void 0 : __privateGet(this, _valList)[index];\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n return v;\n }\n const ac = new AC();\n const { signal } = options;\n signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), {\n signal: ac.signal\n });\n const fetchOpts = {\n signal: ac.signal,\n options,\n context\n };\n const cb = (v2, updateCache = false) => {\n const { aborted } = ac.signal;\n const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0;\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true;\n options.status.fetchError = ac.signal.reason;\n if (ignoreAbort)\n options.status.fetchAbortIgnored = true;\n } else {\n options.status.fetchResolved = true;\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason);\n }\n const bf2 = p;\n if (__privateGet(this, _valList)[index] === p) {\n if (v2 === void 0) {\n if (bf2.__staleWhileFetching) {\n __privateGet(this, _valList)[index] = bf2.__staleWhileFetching;\n } else {\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");\n }\n } else {\n if (options.status)\n options.status.fetchUpdated = true;\n this.set(k, v2, fetchOpts.options);\n }\n }\n return v2;\n };\n const eb = (er) => {\n if (options.status) {\n options.status.fetchRejected = true;\n options.status.fetchError = er;\n }\n return fetchFail(er);\n };\n const fetchFail = (er) => {\n const { aborted } = ac.signal;\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;\n const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;\n const noDelete = allowStale || options.noDeleteOnFetchRejection;\n const bf2 = p;\n if (__privateGet(this, _valList)[index] === p) {\n const del = !noDelete || bf2.__staleWhileFetching === void 0;\n if (del) {\n __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");\n } else if (!allowStaleAborted) {\n __privateGet(this, _valList)[index] = bf2.__staleWhileFetching;\n }\n }\n if (allowStale) {\n if (options.status && bf2.__staleWhileFetching !== void 0) {\n options.status.returnedStale = true;\n }\n return bf2.__staleWhileFetching;\n } else if (bf2.__returned === bf2) {\n throw er;\n }\n };\n const pcall = (res, rej) => {\n var _a2;\n const fmp = (_a2 = __privateGet(this, _fetchMethod)) == null ? void 0 : _a2.call(this, k, v, fetchOpts);\n if (fmp && fmp instanceof Promise) {\n fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);\n }\n ac.signal.addEventListener("abort", () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(void 0);\n if (options.allowStaleOnFetchAbort) {\n res = (v2) => cb(v2, true);\n }\n }\n });\n };\n if (options.status)\n options.status.fetchDispatched = true;\n const p = new Promise(pcall).then(cb, eb);\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: void 0\n });\n if (index === void 0) {\n this.set(k, bf, { ...fetchOpts.options, status: void 0 });\n index = __privateGet(this, _keyMap).get(k);\n } else {\n __privateGet(this, _valList)[index] = bf;\n }\n return bf;\n};\nisBackgroundFetch_fn = function(p) {\n if (!__privateGet(this, _hasFetchMethod))\n return false;\n const b = p;\n return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC;\n};\nconnect_fn = function(p, n) {\n __privateGet(this, _prev)[n] = p;\n __privateGet(this, _next)[p] = n;\n};\nmoveToTail_fn = function(index) {\n if (index !== __privateGet(this, _tail)) {\n if (index === __privateGet(this, _head)) {\n __privateSet(this, _head, __privateGet(this, _next)[index]);\n } else {\n __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _prev)[index], __privateGet(this, _next)[index]);\n }\n __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _tail), index);\n __privateSet(this, _tail, index);\n }\n};\ndelete_fn = function(k, reason) {\n var _a2, _b2, _c2, _d;\n let deleted = false;\n if (__privateGet(this, _size) !== 0) {\n const index = __privateGet(this, _keyMap).get(k);\n if (index !== void 0) {\n deleted = true;\n if (__privateGet(this, _size) === 1) {\n __privateMethod(this, _LRUCache_instances, clear_fn).call(this, reason);\n } else {\n __privateGet(this, _removeItemSize).call(this, index);\n const v = __privateGet(this, _valList)[index];\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n v.__abortController.abort(new Error("deleted"));\n } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {\n if (__privateGet(this, _hasDispose)) {\n (_a2 = __privateGet(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);\n }\n if (__privateGet(this, _hasDisposeAfter)) {\n (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, reason]);\n }\n }\n __privateGet(this, _keyMap).delete(k);\n __privateGet(this, _keyList)[index] = void 0;\n __privateGet(this, _valList)[index] = void 0;\n if (index === __privateGet(this, _tail)) {\n __privateSet(this, _tail, __privateGet(this, _prev)[index]);\n } else if (index === __privateGet(this, _head)) {\n __privateSet(this, _head, __privateGet(this, _next)[index]);\n } else {\n const pi = __privateGet(this, _prev)[index];\n __privateGet(this, _next)[pi] = __privateGet(this, _next)[index];\n const ni = __privateGet(this, _next)[index];\n __privateGet(this, _prev)[ni] = __privateGet(this, _prev)[index];\n }\n __privateWrapper(this, _size)._--;\n __privateGet(this, _free).push(index);\n }\n }\n }\n if (__privateGet(this, _hasDisposeAfter) && ((_c2 = __privateGet(this, _disposed)) == null ? void 0 : _c2.length)) {\n const dt = __privateGet(this, _disposed);\n let task;\n while (task = dt == null ? void 0 : dt.shift()) {\n (_d = __privateGet(this, _disposeAfter)) == null ? void 0 : _d.call(this, ...task);\n }\n }\n return deleted;\n};\nclear_fn = function(reason) {\n var _a2, _b2, _c2;\n for (const index of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {\n const v = __privateGet(this, _valList)[index];\n if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {\n v.__abortController.abort(new Error("deleted"));\n } else {\n const k = __privateGet(this, _keyList)[index];\n if (__privateGet(this, _hasDispose)) {\n (_a2 = __privateGet(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);\n }\n if (__privateGet(this, _hasDisposeAfter)) {\n (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, reason]);\n }\n }\n }\n __privateGet(this, _keyMap).clear();\n __privateGet(this, _valList).fill(void 0);\n __privateGet(this, _keyList).fill(void 0);\n if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {\n __privateGet(this, _ttls).fill(0);\n __privateGet(this, _starts).fill(0);\n }\n if (__privateGet(this, _sizes)) {\n __privateGet(this, _sizes).fill(0);\n }\n __privateSet(this, _head, 0);\n __privateSet(this, _tail, 0);\n __privateGet(this, _free).length = 0;\n __privateSet(this, _calculatedSize, 0);\n __privateSet(this, _size, 0);\n if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {\n const dt = __privateGet(this, _disposed);\n let task;\n while (task = dt == null ? void 0 : dt.shift()) {\n (_c2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _c2.call(this, ...task);\n }\n }\n};\nlet LRUCache = _LRUCache;\nconst CacheSize = {\n KB: 1024,\n MB: 1024 * 1024,\n GB: 1024 * 1024 * 1024\n};\nconst CacheTime = {\n SECOND: 1e3,\n MINUTE: 60 * 1e3,\n HOUR: 60 * 60 * 1e3,\n DAY: 24 * 60 * 60 * 1e3,\n WEEK: 7 * 24 * 60 * 60 * 1e3,\n MONTH: 30 * 24 * 60 * 60 * 1e3\n};\nfunction getTagKeyMap() {\n const dataFetchCache = getDataFetchCache();\n if (!dataFetchCache || !dataFetchCache.tagKeyMap) {\n const tagKeyMap = /* @__PURE__ */ new Map();\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.tagKeyMap = tagKeyMap;\n return tagKeyMap;\n }\n return dataFetchCache.tagKeyMap;\n}\nfunction addTagKeyRelation(tag, key) {\n const tagKeyMap = getTagKeyMap();\n let keys = tagKeyMap.get(tag);\n if (!keys) {\n keys = /* @__PURE__ */ new Set();\n tagKeyMap.set(tag, keys);\n }\n keys.add(key);\n}\nfunction getCacheConfig() {\n const dataFetchCache = getDataFetchCache();\n if (!dataFetchCache || !dataFetchCache.cacheConfig) {\n const cacheConfig = {\n maxSize: CacheSize.GB\n };\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.cacheConfig = cacheConfig;\n return cacheConfig;\n }\n return dataFetchCache.cacheConfig;\n}\nfunction configureCache(config) {\n const cacheConfig = getCacheConfig();\n Object.assign(cacheConfig, config);\n}\nfunction getLRUCache() {\n const dataFetchCache = getDataFetchCache();\n const cacheConfig = getCacheConfig();\n if (!dataFetchCache || !dataFetchCache.cacheStore) {\n const cacheStore = new LRUCache({\n maxSize: cacheConfig.maxSize ?? CacheSize.GB,\n sizeCalculation: (value) => {\n if (!value.size) {\n return 1;\n }\n let size = 0;\n for (const [k, item] of value.entries()) {\n size += k.length * 2;\n size += estimateObjectSize(item.data);\n size += 8;\n }\n return size;\n },\n updateAgeOnGet: true,\n updateAgeOnHas: true\n });\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.cacheStore = cacheStore;\n return cacheStore;\n }\n return dataFetchCache.cacheStore;\n}\nfunction estimateObjectSize(data) {\n const type = typeof data;\n if (type === "number") return 8;\n if (type === "boolean") return 4;\n if (type === "string") return Math.max(data.length * 2, 1);\n if (data === null || data === void 0) return 1;\n if (ArrayBuffer.isView(data)) {\n return Math.max(data.byteLength, 1);\n }\n if (Array.isArray(data)) {\n return Math.max(\n data.reduce((acc, item) => acc + estimateObjectSize(item), 0),\n 1\n );\n }\n if (data instanceof Map || data instanceof Set) {\n return 1024;\n }\n if (data instanceof Date) {\n return 8;\n }\n if (type === "object") {\n return Math.max(\n Object.entries(data).reduce(\n (acc, [key, value]) => acc + key.length * 2 + estimateObjectSize(value),\n 0\n ),\n 1\n );\n }\n return 1;\n}\nfunction generateKey(dataFetchOptions) {\n return JSON.stringify(dataFetchOptions, (_, value) => {\n if (value && typeof value === "object" && !Array.isArray(value)) {\n return Object.keys(value).sort().reduce((result, key) => {\n result[key] = value[key];\n return result;\n }, {});\n }\n return value;\n });\n}\nfunction cache(fn, options) {\n const {\n tag = "default",\n maxAge = CacheTime.MINUTE * 5,\n revalidate = 0,\n onCache,\n getKey\n } = options || {};\n const tags = Array.isArray(tag) ? tag : [tag];\n return async (dataFetchOptions) => {\n if (dataFetchOptions.isDowngrade || !dataFetchOptions._id) {\n return fn(dataFetchOptions);\n }\n const store = getLRUCache();\n const now = Date.now();\n const storeKey = dataFetchOptions._id;\n const cacheKey = getKey ? getKey(dataFetchOptions) : generateKey(dataFetchOptions);\n tags.forEach((t) => addTagKeyRelation(t, cacheKey));\n let cacheStore = store.get(cacheKey);\n if (!cacheStore) {\n cacheStore = /* @__PURE__ */ new Map();\n }\n const cached = cacheStore.get(storeKey);\n if (cached) {\n const age = now - cached.timestamp;\n if (age < maxAge) {\n if (onCache) {\n const useCache = onCache({\n status: "hit",\n key: cacheKey,\n params: dataFetchOptions,\n result: cached.data\n });\n if (!useCache) {\n return fn(dataFetchOptions);\n }\n }\n return cached.data;\n }\n if (revalidate > 0 && age < maxAge + revalidate) {\n if (onCache) {\n onCache({\n status: "stale",\n key: cacheKey,\n params: dataFetchOptions,\n result: cached.data\n });\n }\n if (!cached.isRevalidating) {\n cached.isRevalidating = true;\n Promise.resolve().then(async () => {\n try {\n const newData = await fn(dataFetchOptions);\n cacheStore.set(storeKey, {\n data: newData,\n timestamp: Date.now(),\n isRevalidating: false\n });\n store.set(cacheKey, cacheStore);\n } catch (error) {\n cached.isRevalidating = false;\n console.error("Background revalidation failed:", error);\n }\n });\n }\n return cached.data;\n }\n }\n const data = await fn(dataFetchOptions);\n cacheStore.set(storeKey, {\n data,\n timestamp: now,\n isRevalidating: false\n });\n store.set(cacheKey, cacheStore);\n if (onCache) {\n onCache({\n status: "miss",\n key: cacheKey,\n params: dataFetchOptions,\n result: data\n });\n }\n return data;\n };\n}\nfunction revalidateTag(tag) {\n const tagKeyMap = getTagKeyMap();\n const keys = tagKeyMap.get(tag);\n const lruCache = getLRUCache();\n if (keys) {\n keys.forEach((key) => {\n lruCache == null ? void 0 : lruCache.delete(key);\n });\n }\n}\nfunction clearStore() {\n var _a2;\n const lruCache = getLRUCache();\n const tagKeyMap = getTagKeyMap();\n lruCache == null ? void 0 : lruCache.clear();\n (_a2 = globalThis.__MF_DATA_FETCH_CACHE__) == null ? true : delete _a2.cacheStore;\n tagKeyMap.clear();\n}\nconst getDataFetchInfo = ({\n name,\n alias,\n id,\n remoteSnapshot\n}) => {\n if (!remoteSnapshot) {\n return;\n }\n if (!("modules" in remoteSnapshot)) {\n return;\n }\n const regex = new RegExp(`^${name}(/[^/].*|)$`);\n const nameOrAlias = regex.test(id) ? name : alias || name;\n const expose = id.replace(nameOrAlias, "");\n let dataFetchName = "";\n let dataFetchId = "";\n let dataFetchKey = "";\n if (expose.startsWith("/")) {\n dataFetchName = `${expose.slice(1)}.${DATA_FETCH_IDENTIFIER}`;\n dataFetchId = `${id}.${DATA_FETCH_IDENTIFIER}`;\n dataFetchKey = `${name}${expose}.${DATA_FETCH_IDENTIFIER}`;\n } else if (expose === "") {\n dataFetchName = DATA_FETCH_IDENTIFIER;\n dataFetchId = `${id}/${DATA_FETCH_IDENTIFIER}`;\n dataFetchKey = `${name}/${DATA_FETCH_IDENTIFIER}`;\n } else {\n return;\n }\n if (!dataFetchName || !dataFetchId || !dataFetchKey) {\n return;\n }\n if (!remoteSnapshot.modules.find(\n (module) => module.moduleName === dataFetchName\n )) {\n return;\n }\n return {\n dataFetchName,\n dataFetchId,\n dataFetchKey\n };\n};\nfunction initDataFetchMap() {\n globalThis.__MF_DATA_FETCH_MAP__ || (globalThis.__MF_DATA_FETCH_MAP__ = {});\n}\nfunction getDataFetchItem(id) {\n var _a2;\n return (_a2 = globalThis.__MF_DATA_FETCH_MAP__) == null ? void 0 : _a2[id];\n}\nfunction getDataFetchMap() {\n return globalThis.__MF_DATA_FETCH_MAP__;\n}\nfunction getDataFetchCache() {\n return globalThis.__MF_DATA_FETCH_CACHE__;\n}\nconst flushDataFetch = () => {\n globalThis.__MF_DATA_FETCH_MAP__ = {};\n globalThis[DOWNGRADE_KEY] = void 0;\n clearStore();\n};\nfunction setDataFetchItemLoadedStatus(id) {\n const dataFetchItem = getDataFetchItem(id);\n if (!dataFetchItem) {\n return;\n }\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.LOADED;\n}\nconst wrapDataFetchId = (id) => {\n return `${WRAP_DATA_FETCH_ID_IDENTIFIER}${id}${WRAP_DATA_FETCH_ID_IDENTIFIER}`;\n};\nconst getDataFetchIdWithErrorMsgs = (errMsgs) => {\n const firstIdentifierIndex = errMsgs.indexOf(WRAP_DATA_FETCH_ID_IDENTIFIER);\n if (firstIdentifierIndex === -1) {\n return void 0;\n }\n const secondIdentifierIndex = errMsgs.indexOf(\n WRAP_DATA_FETCH_ID_IDENTIFIER,\n firstIdentifierIndex + WRAP_DATA_FETCH_ID_IDENTIFIER.length\n );\n if (secondIdentifierIndex === -1) {\n return void 0;\n }\n return errMsgs.substring(\n firstIdentifierIndex + WRAP_DATA_FETCH_ID_IDENTIFIER.length,\n secondIdentifierIndex\n );\n};\nasync function fetchData(id, params, remoteInfo) {\n var _a2;\n const callFetchData = async () => {\n const item = getDataFetchItem(id);\n if (!item) {\n return;\n }\n const [fetchDataFnArr, ..._rest] = item;\n const fetchDataFn = await fetchDataFnArr[2];\n if (!fetchDataFn) {\n return;\n }\n return fetchDataFn({\n ...params,\n _id: id\n });\n };\n if (isBrowserEnvValue) {\n const dataFetchItem = getDataFetchItem(id);\n if (!dataFetchItem) {\n throw new Error(`dataFetchItem not found, id: ${id}`);\n }\n if ((_a2 = dataFetchItem[1]) == null ? void 0 : _a2[0]) {\n return dataFetchItem[1][0];\n }\n if (isCSROnly()) {\n logger.debug("==========csr only!");\n return callFetchData();\n }\n if (remoteInfo) {\n return callDowngrade(id, params, remoteInfo);\n }\n const mfDowngrade = getDowngradeTag();\n if (mfDowngrade && (typeof mfDowngrade === "boolean" || mfDowngrade.includes(id))) {\n return callDowngrade(id, { ...params, isDowngrade: true });\n }\n let res;\n let rej;\n const p = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n dataFetchItem[1] = [p, res, rej];\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.AWAIT;\n return dataFetchItem[1][0];\n }\n return callFetchData();\n}\nfunction getDataFetchMapKey(dataFetchInfo, hostInfo) {\n if (!dataFetchInfo || !hostInfo) {\n return;\n }\n const { dataFetchKey } = dataFetchInfo;\n return composeKeyWithSeparator(dataFetchKey, hostInfo.name, hostInfo.version);\n}\nasync function loadDataFetchModule(instance, id) {\n return instance.loadRemote(id).then((m) => {\n if (m && typeof m === "object" && "fetchData" in m && typeof m.fetchData === "function") {\n return m.fetchData;\n }\n throw new Error(\n `fetchData not found in remote ${id}, ${JSON.stringify(m)}`\n );\n });\n}\nfunction isDataLoaderExpose(exposeKey) {\n return exposeKey.endsWith(DATA_FETCH_IDENTIFIER) || exposeKey.endsWith(DATA_FETCH_CLIENT_SUFFIX);\n}\nfunction getDowngradeTag() {\n return globalThis[DOWNGRADE_KEY];\n}\nfunction callAllDowngrade() {\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n Object.keys(dataFetchMap).forEach((key) => {\n callDowngrade(key);\n });\n}\nasync function callDowngrade(id, params, remoteInfo) {\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n const mfDataFetch = dataFetchMap[id];\n if ((mfDataFetch == null ? void 0 : mfDataFetch[2]) === MF_DATA_FETCH_STATUS.AWAIT) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADING;\n let promise;\n let res;\n let rej;\n if (mfDataFetch[1]) {\n promise = mfDataFetch[1][0];\n res = mfDataFetch[1][1];\n rej = mfDataFetch[1][2];\n } else {\n promise = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n mfDataFetch[1] = [promise, res, rej];\n }\n const dataFetchType = mfDataFetch[0][1];\n if (dataFetchType === MF_DATA_FETCH_TYPE.FETCH_CLIENT) {\n try {\n mfDataFetch[0][0]().then(async (getDataFetchFn) => {\n return getDataFetchFn({\n ...params,\n isDowngrade: true,\n _id: id\n }).then((data) => {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADED;\n res && res(data);\n });\n });\n } catch (e) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.ERROR;\n rej && rej(e);\n }\n } else if (dataFetchType === MF_DATA_FETCH_TYPE.FETCH_SERVER) {\n try {\n const currentUrl = new URL(window.location.href);\n currentUrl.searchParams.set(DATA_FETCH_QUERY, encodeURIComponent(id));\n if (params) {\n currentUrl.searchParams.set(\n "params",\n encodeURIComponent(JSON.stringify(params))\n );\n }\n if (remoteInfo) {\n currentUrl.searchParams.set(\n "remoteInfo",\n encodeURIComponent(JSON.stringify(remoteInfo))\n );\n }\n const fetchServerQuery = globalThis.FEDERATION_SERVER_QUERY;\n if (fetchServerQuery && typeof fetchServerQuery === "object") {\n Object.keys(fetchServerQuery).forEach((key) => {\n currentUrl.searchParams.set(\n key,\n JSON.stringify(fetchServerQuery[key])\n );\n });\n }\n const fetchUrl = currentUrl.toString();\n const data = await fetch(fetchUrl).then((res2) => res2.json());\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADED;\n res && res(data);\n } catch (e) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.ERROR;\n rej && rej(e);\n }\n }\n return promise;\n }\n}\nfunction isCSROnly() {\n return window._SSR_DATA === void 0;\n}\nfunction isServerEnv() {\n return typeof window === "undefined";\n}\nfunction setSSREnv({\n fetchServerQuery\n}) {\n globalThis.FEDERATION_SSR = true;\n globalThis.FEDERATION_SERVER_QUERY = fetchServerQuery;\n}\nfunction getLoadedRemoteInfos(id, instance) {\n if (!instance) {\n return;\n }\n const { name, expose } = instance.remoteHandler.idToRemoteMap[id] || {};\n if (!name) {\n return;\n }\n const module = instance.moduleCache.get(name);\n if (!module) {\n return;\n }\n const { remoteSnapshot } = instance.snapshotHandler.getGlobalRemoteInfo(\n module.remoteInfo\n );\n return {\n ...module.remoteInfo,\n snapshot: remoteSnapshot,\n expose\n };\n}\nexport {\n setDataFetchItemLoadedStatus as A,\n warn as B,\n CacheSize as C,\n DATA_FETCH_QUERY as D,\n ERROR_TYPE as E,\n FS_HREF as F,\n DOWNGRADE_KEY as G,\n callAllDowngrade as H,\n callDowngrade as I,\n getDowngradeTag as J,\n composeKeyWithSeparator as K,\n LOAD_REMOTE_ERROR_PREFIX as L,\n MF_DATA_FETCH_STATUS as M,\n getDataFetchCache as N,\n CacheTime as a,\n clearStore as b,\n cache as c,\n configureCache as d,\n getDataFetchMap as e,\n flushDataFetch as f,\n generateKey as g,\n fetchData as h,\n initDataFetchMap as i,\n loadDataFetchModule as j,\n isDataLoaderExpose as k,\n logger as l,\n getDataFetchInfo as m,\n getDataFetchMapKey as n,\n getDataFetchItem as o,\n DATA_FETCH_CLIENT_SUFFIX as p,\n MF_DATA_FETCH_TYPE as q,\n revalidateTag as r,\n setSSREnv as s,\n isCSROnly as t,\n isServerEnv as u,\n getDataFetchIdWithErrorMsgs as v,\n DATA_FETCH_ERROR_PREFIX as w,\n wrapDataFetchId as x,\n DATA_FETCH_FUNCTION as y,\n getLoadedRemoteInfos as z\n};\n'};const ENTRY_FILE="entry.ts";const APP_FILE="app.tsx";const BRIDGE_ROOT="bridge";const BRIDGE_INDEX_FILE=`${BRIDGE_ROOT}/index.es.js`;const BRIDGE_ROUTER_STUB_FILE=`${BRIDGE_ROOT}/react-router-dom-stub.js`;const BRIDGE_ROUTER_STUB_SOURCE=`export function useLocation() {
|
|
385
|
+
})`)(chunk,require,url.pathname.split("/").slice(0,-1).join("/"),chunkName);callback(null,chunk)}catch(e){callback(enrichChunkExecutionError(e,{chunkName,location:url.href,source:"remote-url",content:data,hostName,resolution}),null)}}).catch(err=>callback(err,null))};const resolveUrl=(remoteName,chunkName)=>{try{return Object.assign(new URL(chunkName,__webpack_require__.p),{mfMetadata:{chunkName,publicPath:__webpack_require__.p,remoteName,rootOutputDir:__webpack_require__.federation.rootOutputDir||"",resolvedFrom:"public-path"}})}catch{const entryUrl=returnFromCache(remoteName)||returnFromGlobalInstances(remoteName);if(!entryUrl)return null;const url=new URL(entryUrl);const path=require("path");const urlPath=url.pathname;const lastSlashIndex=urlPath.lastIndexOf("/");const directoryPath=lastSlashIndex>=0?urlPath.substring(0,lastSlashIndex+1):"/";const rootDir=__webpack_require__.federation.rootOutputDir||"";const combinedPath=path.join(directoryPath,rootDir,chunkName).replace(/\\/g,"/");return Object.assign(new URL(combinedPath,url.origin),{mfMetadata:{chunkName,publicPath:__webpack_require__.p,remoteName,rootOutputDir:rootDir,resolvedFrom:"remote-entry-fallback",remoteEntryUrl:entryUrl}})}};const loadChunk=(strategy,chunkId,rootOutputDir,callback,args)=>{if("filesystem"===strategy)return loadFromFs(resolveFile(rootOutputDir,chunkId),callback);const url=resolveUrl(rootOutputDir,chunkId);if(!url)return callback(null,{modules:{},ids:[],runtime:null});fetchAndRun(url,chunkId,callback,args)};const installChunk=(chunk,installedChunks)=>{for(const moduleId in chunk.modules)__webpack_require__.m[moduleId]=chunk.modules[moduleId];if(chunk.runtime)chunk.runtime(__webpack_require__);for(const chunkId of chunk.ids){if(installedChunks[chunkId])installedChunks[chunkId][0]();installedChunks[chunkId]=0}};const deleteChunk=(chunkId,installedChunks)=>{delete installedChunks[chunkId];return true};const setupScriptLoader=()=>{__webpack_require__.l=(url,done,key,chunkId)=>{if(!key||chunkId)throw new Error(`__webpack_require__.l name is required for ${url}`);__webpack_require__.federation.runtime.loadScriptNode(url,{attrs:{globalName:key}}).then(res=>{const enhancedRemote=__webpack_require__.federation.instance.initRawContainer(key,url,res);new Function("return globalThis")()[key]=enhancedRemote;done(enhancedRemote)}).catch(done)}};const setupChunkHandler=(installedChunks,args)=>(chunkId,promises)=>{let installedChunkData=installedChunks[chunkId];if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(__webpack_require__.federation.chunkMatcher?__webpack_require__.federation.chunkMatcher(chunkId):true){const promise=new Promise((resolve,reject)=>{installedChunkData=installedChunks[chunkId]=[resolve,reject];const fs="undefined"!=typeof process?require("fs"):false;const filename="undefined"!=typeof process?resolveFile(__webpack_require__.federation.rootOutputDir||"",chunkId):false;if(fs&&fs.existsSync(filename))loadChunk("filesystem",chunkId,__webpack_require__.federation.rootOutputDir||"",(err,chunk)=>{if(err)return deleteChunk(chunkId,installedChunks)&&reject(err);if(chunk)installChunk(chunk,installedChunks);resolve(chunk)},args);else{const chunkName=__webpack_require__.u(chunkId);loadChunk("undefined"==typeof process?"http-eval":"http-vm",chunkName,__webpack_require__.federation.initOptions.name,(err,chunk)=>{if(err)return deleteChunk(chunkId,installedChunks)&&reject(err);if(chunk)installChunk(chunk,installedChunks);resolve(chunk)},args)}});promises.push(installedChunkData[2]=promise)}else installedChunks[chunkId]=0};const setupWebpackRequirePatching=handle=>{if(__webpack_require__.f){if(__webpack_require__.f.require){console.warn("\x1b[33m%s\x1b[0m",'CAUTION: build target is not set to "async-node", attempting to patch additional chunk handlers. This may not work');__webpack_require__.f.require=handle}if(__webpack_require__.f.readFileVm)__webpack_require__.f.readFileVm=handle}};function runtimePlugin_default(){return{name:"node-federation-plugin",beforeInit(args){(()=>{const installedChunks={};setupScriptLoader();setupWebpackRequirePatching(setupChunkHandler(installedChunks,args))})();return args}}}exports["default"]=runtimePlugin_default;exports.deleteChunk=deleteChunk;exports.fetchAndRun=fetchAndRun;exports.importNodeModule=importNodeModule;exports.installChunk=installChunk;exports.loadChunk=loadChunk;exports.loadFromFs=loadFromFs;exports.nodeRuntimeImportCache=nodeRuntimeImportCache;exports.resolveFile=resolveFile;exports.resolveUrl=resolveUrl;exports.returnFromCache=returnFromCache;exports.returnFromGlobalInstances=returnFromGlobalInstances;exports.setupChunkHandler=setupChunkHandler;exports.setupScriptLoader=setupScriptLoader;exports.setupWebpackRequirePatching=setupWebpackRequirePatching},652:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{ModuleFederationPlayground:()=>App,default:()=>App});const App_module={"vp-root":"vp-root-o94tBV",vpRoot:"vp-root-o94tBV","vp-main":"vp-main-ukILls",vpMain:"vp-main-ukILls","vp-left":"vp-left-wWIJZj",vpLeft:"vp-left-wWIJZj","vp-splitter":"vp-splitter-C3LUiw",vpSplitter:"vp-splitter-C3LUiw","vp-card":"vp-card-OxIN8P",vpCard:"vp-card-OxIN8P","vp-cardHeader":"vp-cardHeader-yl8bmF",vpCardHeader:"vp-cardHeader-yl8bmF","vp-cardTitle":"vp-cardTitle-iRjbB2",vpCardTitle:"vp-cardTitle-iRjbB2","vp-editorTabs":"vp-editorTabs-P8EPHu",vpEditorTabs:"vp-editorTabs-P8EPHu","vp-editorTab":"vp-editorTab-en3Nbi",vpEditorTab:"vp-editorTab-en3Nbi","vp-editorTabActive":"vp-editorTabActive-j1OAlc",vpEditorTabActive:"vp-editorTabActive-j1OAlc","vp-cardBody":"vp-cardBody-UdVf2N",vpCardBody:"vp-cardBody-UdVf2N","vp-paneActions":"vp-paneActions-l5K74Q",vpPaneActions:"vp-paneActions-l5K74Q","vp-collapse":"vp-collapse-VViOM4",vpCollapse:"vp-collapse-VViOM4","vp-collapseItem":"vp-collapseItem-MtDnlb",vpCollapseItem:"vp-collapseItem-MtDnlb","vp-collapseHeader":"vp-collapseHeader-Y1drUL",vpCollapseHeader:"vp-collapseHeader-Y1drUL","vp-collapseHeaderActive":"vp-collapseHeaderActive-d5oo1z",vpCollapseHeaderActive:"vp-collapseHeaderActive-d5oo1z","vp-collapseLabel":"vp-collapseLabel-SYefMk",vpCollapseLabel:"vp-collapseLabel-SYefMk","vp-collapseArrow":"vp-collapseArrow-s7319m",vpCollapseArrow:"vp-collapseArrow-s7319m","vp-collapseArrowOpen":"vp-collapseArrowOpen-NQp4Jq",vpCollapseArrowOpen:"vp-collapseArrowOpen-NQp4Jq","vp-collapseBody":"vp-collapseBody-ig7Trn",vpCollapseBody:"vp-collapseBody-ig7Trn","vp-collapseBodyCode":"vp-collapseBodyCode-ACBnWh",vpCollapseBodyCode:"vp-collapseBodyCode-ACBnWh","vp-form":"vp-form-pITn1W",vpForm:"vp-form-pITn1W","vp-fieldGrid":"vp-fieldGrid-SR9eJh",vpFieldGrid:"vp-fieldGrid-SR9eJh","vp-field":"vp-field-NzMT8s",vpField:"vp-field-NzMT8s","vp-labelRow":"vp-labelRow-DlcEeA",vpLabelRow:"vp-labelRow-DlcEeA","vp-label":"vp-label-KGpsbl",vpLabel:"vp-label-KGpsbl","vp-hint":"vp-hint-fYzOU2",vpHint:"vp-hint-fYzOU2","vp-input":"vp-input-UHKU2F",vpInput:"vp-input-UHKU2F","vp-select":"vp-select-Tk6IhF",vpSelect:"vp-select-Tk6IhF","vp-codeEditor":"vp-codeEditor-bXbNn1",vpCodeEditor:"vp-codeEditor-bXbNn1","vp-editorToolbar":"vp-editorToolbar-SVglCq",vpEditorToolbar:"vp-editorToolbar-SVglCq","vp-loadingSimple":"vp-loadingSimple-t3py2h",vpLoadingSimple:"vp-loadingSimple-t3py2h","vp-loadingSpinner":"vp-loadingSpinner-YRww21",vpLoadingSpinner:"vp-loadingSpinner-YRww21","vp-spin":"vp-spin-vqXwPJ",vpSpin:"vp-spin-vqXwPJ","vp-previewFrame":"vp-previewFrame-K_cT99",vpPreviewFrame:"vp-previewFrame-K_cT99","vp-actions":"vp-actions-kW_pM2",vpActions:"vp-actions-kW_pM2","vp-button":"vp-button-jQtwaB",vpButton:"vp-button-jQtwaB","vp-buttonGhost":"vp-buttonGhost-wKOfIf",vpButtonGhost:"vp-buttonGhost-wKOfIf","vp-buttonPrimary":"vp-buttonPrimary-SYnJ9I",vpButtonPrimary:"vp-buttonPrimary-SYnJ9I",vpShimmer:"vpShimmer-XeNYGG","vp-codeBlock":"vp-codeBlock-CMSobd",vpCodeBlock:"vp-codeBlock-CMSobd","vp-emptyTitle":"vp-emptyTitle-LUdxhN",vpEmptyTitle:"vp-emptyTitle-LUdxhN","vp-copyBtn":"vp-copyBtn-rEbuE6",vpCopyBtn:"vp-copyBtn-rEbuE6","vp-copyIcon":"vp-copyIcon-C8ndDr",vpCopyIcon:"vp-copyIcon-C8ndDr","vp-right":"vp-right-Pdn7k6",vpRight:"vp-right-Pdn7k6","vp-ide":"vp-ide-MCK1rq",vpIde:"vp-ide-MCK1rq","vp-ideTitlebar":"vp-ideTitlebar-xV_SLu",vpIdeTitlebar:"vp-ideTitlebar-xV_SLu","vp-ideDots":"vp-ideDots-rmPPqM",vpIdeDots:"vp-ideDots-rmPPqM","vp-dot":"vp-dot-QAY3S7",vpDot:"vp-dot-QAY3S7","vp-dotRed":"vp-dotRed-qBSHb4",vpDotRed:"vp-dotRed-qBSHb4","vp-dotYellow":"vp-dotYellow-JiMbQd",vpDotYellow:"vp-dotYellow-JiMbQd","vp-dotGreen":"vp-dotGreen-p1oJVa",vpDotGreen:"vp-dotGreen-p1oJVa","vp-ideTitle":"vp-ideTitle-pyBOAZ",vpIdeTitle:"vp-ideTitle-pyBOAZ","vp-ideMeta":"vp-ideMeta-IwLWqJ",vpIdeMeta:"vp-ideMeta-IwLWqJ","vp-ideMetaText":"vp-ideMetaText-hM7Yjo",vpIdeMetaText:"vp-ideMetaText-hM7Yjo","vp-ideStatus":"vp-ideStatus-CNZYH6",vpIdeStatus:"vp-ideStatus-CNZYH6","vp-ideBody":"vp-ideBody-iRMqXK",vpIdeBody:"vp-ideBody-iRMqXK","vp-empty":"vp-empty-WMX1Vp",vpEmpty:"vp-empty-WMX1Vp","vp-kv":"vp-kv-HhceUA",vpKv:"vp-kv-HhceUA","vp-renderArea":"vp-renderArea-UsEDCB",vpRenderArea:"vp-renderArea-UsEDCB","vp-terminal":"vp-terminal-F6_CEQ",vpTerminal:"vp-terminal-F6_CEQ","vp-terminalHeader":"vp-terminalHeader-BG3x8z",vpTerminalHeader:"vp-terminalHeader-BG3x8z","vp-terminalClear":"vp-terminalClear-N0wY3l",vpTerminalClear:"vp-terminalClear-N0wY3l","vp-terminalBody":"vp-terminalBody-Fn12Co",vpTerminalBody:"vp-terminalBody-Fn12Co","vp-terminalLine":"vp-terminalLine-V8_M04",vpTerminalLine:"vp-terminalLine-V8_M04","vp-terminalLineError":"vp-terminalLineError-puKD3j",vpTerminalLineError:"vp-terminalLineError-puKD3j","vp-terminalLineWarn":"vp-terminalLineWarn-BIZDl_",vpTerminalLineWarn:"vp-terminalLineWarn-BIZDl_","vp-terminalEmpty":"vp-terminalEmpty-pYP34A",vpTerminalEmpty:"vp-terminalEmpty-pYP34A","vp-errorPanel":"vp-errorPanel-zDWm6k",vpErrorPanel:"vp-errorPanel-zDWm6k","vp-errorTitle":"vp-errorTitle-ykARVb",vpErrorTitle:"vp-errorTitle-ykARVb"};var jsx_runtime_js_=__webpack_require__(8460);function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true}):e[r]=t,e}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=true,o=false;try{if(i=(t=t.call(r)).next,0===l);else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=true,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),true).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&({}).propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if(({}).hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t=({}).toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function state_local_defineProperty(obj,key,value1){if(key in obj)Object.defineProperty(obj,key,{value:value1,enumerable:true,configurable:true,writable:true});else obj[key]=value1;return obj}function state_local_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function state_local_objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};if(i%2)state_local_ownKeys(Object(source),true).forEach(function(key){state_local_defineProperty(target,key,source[key])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));else state_local_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function state_local_compose(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}}function curry(fn){return function curried(){var _this=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return args.length>=fn.length?fn.apply(this,args):function(){for(var _len3=arguments.length,nextArgs=new Array(_len3),_key3=0;_key3<_len3;_key3++)nextArgs[_key3]=arguments[_key3];return curried.apply(_this,[].concat(args,nextArgs))}}}function isObject(value1){return({}).toString.call(value1).includes("Object")}function isEmpty(obj){return!Object.keys(obj).length}function isFunction(value1){return"function"==typeof value1}function state_local_hasOwnProperty(object,property){return Object.prototype.hasOwnProperty.call(object,property)}function validateChanges(initial,changes){if(!isObject(changes))errorHandler("changeType");if(Object.keys(changes).some(function(field){return!state_local_hasOwnProperty(initial,field)}))errorHandler("changeField");return changes}function validateSelector(selector){if(!isFunction(selector))errorHandler("selectorType")}function validateHandler(handler){if(!(isFunction(handler)||isObject(handler)))errorHandler("handlerType");if(isObject(handler)&&Object.values(handler).some(function(_handler){return!isFunction(_handler)}))errorHandler("handlersType")}function validateInitial(initial){if(!initial)errorHandler("initialIsRequired");if(!isObject(initial))errorHandler("initialType");if(isEmpty(initial))errorHandler("initialContent")}function throwError(errorMessages,type){throw new Error(errorMessages[type]||errorMessages["default"])}var state_local_errorMessages={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"};var errorHandler=curry(throwError)(state_local_errorMessages);var validators={changes:validateChanges,selector:validateSelector,handler:validateHandler,initial:validateInitial};function create(initial){var handler=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};validators.initial(initial);validators.handler(handler);var state={current:initial};var didUpdate=curry(didStateUpdate)(state,handler);var update=curry(updateState)(state);var validate=curry(validators.changes)(initial);var getChanges=curry(extractChanges)(state);function getState(){var selector=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(state){return state};validators.selector(selector);return selector(state.current)}function setState(causedChanges){state_local_compose(didUpdate,update,validate,getChanges)(causedChanges)}return[getState,setState]}function extractChanges(state,causedChanges){return isFunction(causedChanges)?causedChanges(state.current):causedChanges}function updateState(state,changes){state.current=state_local_objectSpread2(state_local_objectSpread2({},state.current),changes);return changes}function didStateUpdate(state,handler,changes){isFunction(handler)?handler(state.current):Object.keys(changes).forEach(function(field){var _handler$field;return null==(_handler$field=handler[field])?void 0:_handler$field.call(handler,state.current[field])});return changes}var index={create:create};const state_local=index;var config_config={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function curry_curry(fn){return function curried(){var _this=this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return args.length>=fn.length?fn.apply(this,args):function(){for(var _len2=arguments.length,nextArgs=new Array(_len2),_key2=0;_key2<_len2;_key2++)nextArgs[_key2]=arguments[_key2];return curried.apply(_this,[].concat(args,nextArgs))}}}function isObject_isObject(value1){return({}).toString.call(value1).includes("Object")}function validateConfig(config){if(!config)validators_errorHandler("configIsRequired");if(!isObject_isObject(config))validators_errorHandler("configType");if(config.urls){informAboutDeprecation();return{paths:{vs:config.urls.monacoBase}}}return config}function informAboutDeprecation(){console.warn(validators_errorMessages.deprecation)}function validators_throwError(errorMessages,type){throw new Error(errorMessages[type]||errorMessages["default"])}var validators_errorMessages={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "};var validators_errorHandler=curry_curry(validators_throwError)(validators_errorMessages);var validators_validators={config:validateConfig};var compose_compose=function(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}};function merge(target,source){Object.keys(source).forEach(function(key){if(source[key]instanceof Object){if(target[key])Object.assign(source[key],merge(target[key],source[key]))}});return _objectSpread2(_objectSpread2({},target),source)}var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(promise){var hasCanceled_=false;var wrappedPromise=new Promise(function(resolve,reject){promise.then(function(val){return hasCanceled_?reject(CANCELATION_MESSAGE):resolve(val)});promise["catch"](reject)});return wrappedPromise.cancel=function(){return hasCanceled_=true},wrappedPromise}var _excluded=["monaco"];var _state$create=state_local.create({config:config_config,isInitialized:false,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray(_state$create,2),loader_getState=_state$create2[0],loader_setState=_state$create2[1];function loader_config(globalConfig){var _validators$config=validators_validators.config(globalConfig),monaco=_validators$config.monaco,config=_objectWithoutProperties(_validators$config,_excluded);loader_setState(function(state){return{config:merge(state.config,config),monaco:monaco}})}function init(){var state=loader_getState(function(_ref){var monaco=_ref.monaco,isInitialized=_ref.isInitialized,resolve=_ref.resolve;return{monaco:monaco,isInitialized:isInitialized,resolve:resolve}});if(!state.isInitialized){loader_setState({isInitialized:true});if(state.monaco){state.resolve(state.monaco);return makeCancelable(wrapperPromise)}if(window.monaco&&window.monaco.editor){storeMonacoInstance(window.monaco);state.resolve(window.monaco);return makeCancelable(wrapperPromise)}compose_compose(injectScripts,getMonacoLoaderScript)(loader_configureLoader)}return makeCancelable(wrapperPromise)}function injectScripts(script){return document.body.appendChild(script)}function createScript(src){var script=document.createElement("script");return src&&(script.src=src),script}function getMonacoLoaderScript(configureLoader){var state=loader_getState(function(_ref2){var config=_ref2.config,reject=_ref2.reject;return{config:config,reject:reject}});var loaderScript=createScript("".concat(state.config.paths.vs,"/loader.js"));loaderScript.onload=function(){return configureLoader()};loaderScript.onerror=state.reject;return loaderScript}function loader_configureLoader(){var state=loader_getState(function(_ref3){var config=_ref3.config,resolve=_ref3.resolve,reject=_ref3.reject;return{config:config,resolve:resolve,reject:reject}});var require1=window.require;require1.config(state.config);require1(["vs/editor/editor.main"],function(loaded){var monaco=loaded.m||loaded;storeMonacoInstance(monaco);state.resolve(monaco)},function(error){state.reject(error)})}function storeMonacoInstance(monaco){if(!loader_getState().monaco)loader_setState({monaco:monaco})}function __getMonacoInstance(){return loader_getState(function(_ref4){var monaco=_ref4.monaco;return monaco})}var wrapperPromise=new Promise(function(resolve,reject){return loader_setState({resolve:resolve,reject:reject})});var loader={config:loader_config,init:init,__getMonacoInstance:__getMonacoInstance};var index_js_=__webpack_require__(3383);var le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v1=le;var ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:e}){return index_js_.createElement("div",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return index_js_.createElement("section",{style:{...v1.wrapper,width:e,height:r},...E},!n&&index_js_.createElement($,null,t),index_js_.createElement("div",{ref:a,style:{...v1.fullWidth,...!n&&v1.hide},className:m}))}var ee=Ee;var H=(0,index_js_.memo)(ee);function Ce(e){(0,index_js_.useEffect)(e,[])}var k=Ce;function he(e,r,n=!0){let t=(0,index_js_.useRef)(!0);(0,index_js_.useEffect)(t.current||!n?()=>{t.current=!1}:e,r)}var dist_l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x="light",loading:P="Loading...",options:y={},height:V="100%",width:z="100%",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=(0,index_js_.useState)(!1),[T,s]=(0,index_js_.useState)(!0),u=(0,index_js_.useRef)(null),c=(0,index_js_.useRef)(null),w=(0,index_js_.useRef)(null),d=(0,index_js_.useRef)(q),o=(0,index_js_.useRef)(A),b=(0,index_js_.useRef)(!1);k(()=>{let i=loader.init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>u.current?I():i.cancel()}),dist_l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||"",t||n||"text",m||"");f!==i.getModel()&&i.setModel(f)}},[m],M),dist_l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||"",a||n||"text",E||"");f!==i.getModel()&&i.setModel(f)}},[E],M),dist_l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||""):r!==i.getValue()&&(i.executeEdits("",[{range:i.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),dist_l(()=>{u.current?.getModel()?.original.setValue(e||"")},[e],M),dist_l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||"text"),c.current.editor.setModelLanguage(f,a||n||"text")},[n,t,a],M),dist_l(()=>{c.current?.editor.setTheme(x)},[x],M),dist_l(()=>{u.current?.updateOptions(y)},[y],M);let L=(0,index_js_.useCallback)(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||"",t||n||"text",m||""),f=h(c.current,r||"",a||n||"text",E||"");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=(0,index_js_.useCallback)(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);(0,index_js_.useEffect)(()=>{M&&d.current(u.current,c.current)},[M]),(0,index_js_.useEffect)(()=>{T||M||U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return index_js_.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;(0,index_js_.memo)(ie);function He(e){let r=(0,index_js_.useRef)();return(0,index_js_.useEffect)(()=>{r.current=e},[e]),r.current}var se=He;var dist_=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E="light",line:g,loading:N="Loading...",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z="100%",height:F="100%",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=(0,index_js_.useState)(!1),[c,w]=(0,index_js_.useState)(!0),d=(0,index_js_.useRef)(null),o=(0,index_js_.useRef)(null),b=(0,index_js_.useRef)(null),L=(0,index_js_.useRef)(M),U=(0,index_js_.useRef)(q),I=(0,index_js_.useRef)(),i=(0,index_js_.useRef)(t),f=se(m),Q=(0,index_js_.useRef)(!1),B=(0,index_js_.useRef)(!1);k(()=>{let p=loader.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>o.current?pe():p.cancel()}),dist_l(()=>{let p=h(d.current,e||t||"",r||a||"",m||n||"");p!==o.current?.getModel()&&(y&&dist_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(dist_.get(m)))},[m],s),dist_l(()=>{o.current?.updateOptions(x)},[x],s),dist_l(()=>{o.current&&void 0!==t&&(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits("",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),dist_l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),dist_l(()=>{void 0!==g&&o.current?.revealLine(g)},[g],s),dist_l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=(0,index_js_.useCallback)(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||"",r||a||"",p||"");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(dist_.get(p)),d.current.editor.setTheme(E),void 0!==g&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);(0,index_js_.useEffect)(()=>{s&&L.current(o.current,d.current)},[s]),(0,index_js_.useEffect)(()=>{c||s||X()},[c,s,X]),i.current=t,(0,index_js_.useEffect)(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),(0,index_js_.useEffect)(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&dist_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return index_js_.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=(0,index_js_.memo)(fe);var Ft=de;var react_index_js_=__webpack_require__(9251);var react_dom_index_js_=__webpack_require__(9926);var client_js_=__webpack_require__(3493);var typescript=__webpack_require__(3122);const BRIDGE_RUNTIME_FILES={"bridge-base-BaKy6CY_.mjs":'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\nimport * as React from "react";\nimport { L as LoggerInstance, R as RouterContext } from "./index-Bs2NxD2z.mjs";\nimport { federationRuntime } from "./plugin.es.js";\nconst initialState = { didCatch: false, error: null };\nclass ErrorBoundary extends React.Component {\n constructor() {\n super(...arguments);\n __publicField(this, "state", initialState);\n __publicField(this, "resetErrorBoundary", (..._args) => {\n if (this.state.didCatch) {\n this.setState(initialState);\n }\n });\n }\n static getDerivedStateFromError(error) {\n return { didCatch: true, error };\n }\n render() {\n if (this.state.didCatch) {\n return /* @__PURE__ */ React.createElement(\n this.props.FallbackComponent,\n {\n error: this.state.error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n );\n }\n return this.props.children;\n }\n}\nfunction createBaseBridgeComponent({\n createRoot,\n defaultRootOptions,\n ...bridgeInfo\n}) {\n return () => {\n const rootMap = /* @__PURE__ */ new Map();\n const instance = federationRuntime.instance;\n LoggerInstance.debug(\n `createBridgeComponent instance from props >>>`,\n instance\n );\n const RawComponent = (info) => {\n const { appInfo, propsInfo, ...restProps } = info;\n const { moduleName, memoryRoute, basename = "/" } = appInfo;\n return /* @__PURE__ */ React.createElement(RouterContext.Provider, { value: { moduleName, basename, memoryRoute } }, /* @__PURE__ */ React.createElement(\n bridgeInfo.rootComponent,\n {\n ...propsInfo,\n basename,\n ...restProps\n }\n ));\n };\n const DefaultFallback = ({ error }) => /* @__PURE__ */ React.createElement("div", { role: "alert" }, /* @__PURE__ */ React.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React.createElement("pre", { style: { color: "red" } }, error instanceof Error ? error.message : String(error)));\n const omitHostFallback = (props) => {\n const nextProps = { ...props };\n delete nextProps.fallback;\n return nextProps;\n };\n const BridgeWrapper = ({\n basename,\n moduleName,\n memoryRoute,\n propsInfo\n }) => /* @__PURE__ */ React.createElement(ErrorBoundary, { FallbackComponent: DefaultFallback }, /* @__PURE__ */ React.createElement(\n RawComponent,\n {\n appInfo: {\n moduleName,\n basename,\n memoryRoute\n },\n propsInfo\n }\n ));\n return {\n async render(info) {\n var _a, _b, _c, _d, _e, _f;\n LoggerInstance.debug(`createBridgeComponent render Info`, info);\n const {\n moduleName,\n dom,\n basename,\n memoryRoute,\n rootOptions,\n ...propsInfo\n } = info;\n const mergedRootOptions = {\n ...defaultRootOptions,\n ...rootOptions\n };\n const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(info)) || {};\n const rootComponentWithErrorBoundary = /* @__PURE__ */ React.createElement(\n BridgeWrapper,\n {\n basename,\n moduleName,\n memoryRoute,\n propsInfo: {\n ...omitHostFallback(propsInfo),\n basename,\n ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps\n }\n }\n );\n if (bridgeInfo.render) {\n await Promise.resolve(\n bridgeInfo.render(rootComponentWithErrorBoundary, dom)\n ).then((root) => rootMap.set(dom, root));\n } else {\n let root = rootMap.get(dom);\n if (!root && createRoot) {\n root = createRoot(dom, mergedRootOptions);\n rootMap.set(dom, root);\n }\n if (root && "render" in root) {\n root.render(rootComponentWithErrorBoundary);\n }\n }\n ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info)) || {};\n },\n destroy(info) {\n var _a, _b, _c;\n const { dom } = info;\n LoggerInstance.debug(`createBridgeComponent destroy Info`, info);\n const root = rootMap.get(dom);\n if (root) {\n if ("unmount" in root) {\n root.unmount();\n } else {\n LoggerInstance.warn("Root does not have unmount method");\n }\n rootMap.delete(dom);\n }\n (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.afterBridgeDestroy) == null ? void 0 : _c.emit(info);\n }\n };\n };\n}\nexport {\n ErrorBoundary as E,\n createBaseBridgeComponent as c\n};\n',"createHelpers-BSHeKyd-.mjs":'import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-BaKy6CY_.mjs";\nimport ReactDOM from "react-dom";\nimport { L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-Bs2NxD2z.mjs";\nimport React__default, { forwardRef, useRef, useState, useEffect } from "react";\nimport { federationRuntime } from "./plugin.es.js";\nfunction createReact16Or17Root(container) {\n return {\n render(children) {\n const reactVersion = ReactDOM.version || "";\n const isReact18 = reactVersion.startsWith("18");\n const isReact19 = reactVersion.startsWith("19");\n if (isReact19) {\n throw new Error(\n `React 19 detected in legacy mode. This is not supported. Please use the version-specific import: import { createBridgeComponent } from \'@module-federation/bridge-react/v19\'`\n );\n }\n if (isReact18) {\n LoggerInstance.warn(\n `[Bridge-React] React 18 detected in legacy mode. For better compatibility, please use the version-specific import: import { createBridgeComponent } from \'@module-federation/bridge-react/v18\'`\n );\n }\n ReactDOM.render(children, container);\n },\n unmount() {\n ReactDOM.unmountComponentAtNode(container);\n }\n };\n}\nfunction createBridgeComponent(bridgeInfo) {\n const fullBridgeInfo = {\n createRoot: createReact16Or17Root,\n ...bridgeInfo\n };\n return createBaseBridgeComponent(fullBridgeInfo);\n}\nconst RemoteAppWrapper = forwardRef(function(props, ref) {\n const {\n moduleName,\n memoryRoute,\n basename,\n providerInfo,\n className,\n style,\n fallback,\n loading,\n ...resProps\n } = props;\n const instance = federationRuntime.instance;\n const rootRef = ref && "current" in ref ? ref : useRef(null);\n const renderDom = useRef(null);\n const providerInfoRef = useRef(null);\n const [initialized, setInitialized] = useState(false);\n LoggerInstance.debug(`RemoteAppWrapper instance from props >>>`, instance);\n useEffect(() => {\n if (initialized) return;\n const providerReturn = providerInfo();\n providerInfoRef.current = providerReturn;\n setInitialized(true);\n return () => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if ((_a = providerInfoRef.current) == null ? void 0 : _a.destroy) {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent destroy >>>`,\n { moduleName, basename, dom: renderDom.current }\n );\n (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit({\n moduleName,\n dom: renderDom.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n });\n (_e = providerInfoRef.current) == null ? void 0 : _e.destroy({\n moduleName,\n dom: renderDom.current\n });\n (_h = (_g = (_f = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _f.lifecycle) == null ? void 0 : _g.afterBridgeDestroy) == null ? void 0 : _h.emit({\n moduleName,\n dom: renderDom.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n });\n }\n };\n }, [moduleName]);\n useEffect(() => {\n var _a, _b, _c, _d, _e, _f;\n if (!initialized || !providerInfoRef.current) return;\n let renderProps = {\n moduleName,\n dom: rootRef.current,\n basename,\n memoryRoute,\n fallback,\n ...resProps\n };\n renderDom.current = rootRef.current;\n const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(renderProps)) || {};\n renderProps = { ...renderProps, ...beforeBridgeRenderRes.extraProps };\n providerInfoRef.current.render(renderProps);\n (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps);\n }, [initialized, ...Object.values(props)]);\n const rootComponentClassName = `${getRootDomDefaultClassName(moduleName)} ${className || ""}`;\n return /* @__PURE__ */ React__default.createElement("div", { className: rootComponentClassName, style, ref: rootRef }, loading);\n});\nfunction createLazyRemoteComponentFactory(RemoteApp) {\n return function createLazyRemoteComponent(info) {\n const exportName = (info == null ? void 0 : info.export) || "default";\n return React__default.lazy(async () => {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent create >>>`,\n {\n lazyComponent: info.loader,\n exportName\n }\n );\n try {\n const m = await info.loader();\n const moduleName = m && m[Symbol.for("mf_module_id")];\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent loadRemote info >>>`,\n { name: moduleName, module: m, exportName }\n );\n const exportFn = m[exportName];\n if (exportName in m && typeof exportFn === "function") {\n const RemoteAppComponent = forwardRef((props, ref) => {\n return /* @__PURE__ */ React__default.createElement(\n RemoteApp,\n {\n moduleName,\n providerInfo: exportFn,\n exportName: info.export || "default",\n fallback: info.fallback,\n loading: info.loading,\n ref,\n ...props\n }\n );\n });\n return {\n default: RemoteAppComponent\n };\n } else {\n LoggerInstance.debug(\n `createRemoteAppComponent LazyComponent module not found >>>`,\n { name: moduleName, module: m, exportName }\n );\n throw Error(\n `Make sure that ${moduleName} has the correct export when export is ${String(\n exportName\n )}`\n );\n }\n } catch (error) {\n throw error;\n }\n });\n };\n}\nfunction createRemoteAppComponentFactory(RemoteApp) {\n const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);\n return function createRemoteAppComponent(info) {\n const LazyComponent = createLazyRemoteComponent(info);\n return forwardRef((props, ref) => {\n return /* @__PURE__ */ React__default.createElement(\n ErrorBoundary,\n {\n FallbackComponent: info.fallback\n },\n /* @__PURE__ */ React__default.createElement(React__default.Suspense, { fallback: info.loading }, /* @__PURE__ */ React__default.createElement(LazyComponent, { ...props, ref }))\n );\n });\n };\n}\nfunction createDeprecatedRemoteComponentFactory(createFn) {\n return function createRemoteComponent(info) {\n LoggerInstance.warn(\n `createRemoteComponent is deprecated, please use createRemoteAppComponent instead!`\n );\n return createFn(info);\n };\n}\nexport {\n RemoteAppWrapper as R,\n createDeprecatedRemoteComponentFactory as a,\n createBridgeComponent as b,\n createRemoteAppComponentFactory as c\n};\n',"data-fetch-utils.es.js":'import { y as DATA_FETCH_FUNCTION } from "./utils-BBP3hEeV.mjs";\nimport { C, a, c, b, d, g, r } from "./utils-BBP3hEeV.mjs";\nimport { d as dataFetchFunction } from "./prefetch-BzCq3MT3.mjs";\nimport { i, p } from "./prefetch-BzCq3MT3.mjs";\nasync function callDataFetch() {\n const dataFetch = globalThis[DATA_FETCH_FUNCTION];\n if (dataFetch) {\n await Promise.all(\n dataFetch.map(async (options) => {\n await dataFetchFunction(options);\n })\n );\n }\n}\nexport {\n C as CacheSize,\n a as CacheTime,\n c as cache,\n callDataFetch,\n b as clearStore,\n d as configureCache,\n g as generateKey,\n i as injectDataFetch,\n p as prefetch,\n r as revalidateTag\n};\n',"index-Bs2NxD2z.mjs":'import React__default from "react";\nimport { c as createLogger } from "./logger-DwWkXsWl.mjs";\nconst RouterContext = React__default.createContext(null);\nconst LoggerInstance = createLogger(\n "[ Module Federation Bridge React ]"\n);\nfunction pathJoin(...args) {\n const res = args.reduce((res2, path) => {\n let nPath = path;\n if (!nPath || typeof nPath !== "string") {\n return res2;\n }\n if (nPath[0] !== "/") {\n nPath = `/${nPath}`;\n }\n const lastIndex = nPath.length - 1;\n if (nPath[lastIndex] === "/") {\n nPath = nPath.substring(0, lastIndex);\n }\n return res2 + nPath;\n }, "");\n return res || "/";\n}\nconst getModuleName = (id) => {\n if (!id) {\n return id;\n }\n const idArray = id.split("/");\n if (idArray.length < 2) {\n return id;\n }\n return idArray[0] + "/" + idArray[1];\n};\nconst getRootDomDefaultClassName = (moduleName) => {\n if (!moduleName) {\n return "";\n }\n const name = getModuleName(moduleName).replace(/\\@/, "").replace(/\\//, "-");\n return `bridge-root-component-${name}`;\n};\nexport {\n LoggerInstance as L,\n RouterContext as R,\n getRootDomDefaultClassName as g,\n pathJoin as p\n};\n',"index.es.js":'import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-BSHeKyd-.mjs";\nimport { b } from "./createHelpers-BSHeKyd-.mjs";\nimport { a, c, b as b2, l } from "./lazy-load-component-plugin-DlagtX0O.mjs";\nimport { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-BBP3hEeV.mjs";\nimport { callDataFetch } from "./data-fetch-utils.es.js";\nimport React__default, { forwardRef, useContext, useState, useEffect } from "react";\nimport * as ReactRouterDOM from "react-router-dom";\nimport { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";\nimport { p } from "./prefetch-BzCq3MT3.mjs";\nfunction e() {\n const t = new PopStateEvent("popstate", { state: window.history.state });\n window.dispatchEvent(t);\n}\nfunction withRouterData(WrappedComponent) {\n const Component = forwardRef(function(props, ref) {\n var _a;\n if (props == null ? void 0 : props.basename) {\n return /* @__PURE__ */ React__default.createElement(WrappedComponent, { ...props, basename: props.basename, ref });\n }\n let enableDispathPopstate = false;\n let routerContextVal;\n try {\n ReactRouterDOM.useLocation();\n enableDispathPopstate = true;\n } catch {\n enableDispathPopstate = false;\n }\n let basename = "/";\n if (!props.basename && enableDispathPopstate) {\n const ReactRouterDOMAny = ReactRouterDOM;\n const useRouteMatch = ReactRouterDOMAny["useRouteMatch"];\n const useHistory = ReactRouterDOMAny["useHistory"];\n const useHref = ReactRouterDOMAny["useHref"];\n const UNSAFE_RouteContext = ReactRouterDOMAny["UNSAFE_RouteContext"];\n if (UNSAFE_RouteContext) {\n if (useHref) {\n basename = useHref == null ? void 0 : useHref("/");\n }\n routerContextVal = useContext(UNSAFE_RouteContext);\n if (routerContextVal && routerContextVal.matches && routerContextVal.matches.length > 0) {\n const matchIndex = routerContextVal.matches.length - 1;\n const pathnameBase = routerContextVal.matches[matchIndex].pathnameBase;\n basename = pathJoin(basename, pathnameBase || "/");\n }\n } else {\n const match = useRouteMatch == null ? void 0 : useRouteMatch();\n if (useHistory) {\n const history = useHistory == null ? void 0 : useHistory();\n basename = (_a = history == null ? void 0 : history.createHref) == null ? void 0 : _a.call(history, { pathname: "/" });\n }\n if (match) {\n basename = pathJoin(basename, (match == null ? void 0 : match.path) || "/");\n }\n }\n }\n LoggerInstance.debug(`createRemoteAppComponent withRouterData >>>`, {\n ...props,\n basename,\n routerContextVal,\n enableDispathPopstate\n });\n if (enableDispathPopstate) {\n const location = ReactRouterDOM.useLocation();\n const [pathname, setPathname] = useState(location.pathname);\n useEffect(() => {\n if (pathname !== "" && pathname !== location.pathname) {\n LoggerInstance.debug(\n `createRemoteAppComponent dispatchPopstateEnv >>>`,\n {\n name: props.name,\n pathname: location.pathname\n }\n );\n e();\n }\n setPathname(location.pathname);\n }, [location]);\n }\n return /* @__PURE__ */ React__default.createElement(WrappedComponent, { ...props, basename, ref });\n });\n return forwardRef(function(props, ref) {\n return /* @__PURE__ */ React__default.createElement(Component, { ...props, ref });\n });\n}\nconst RemoteApp = withRouterData(RemoteAppWrapper);\nconst createRemoteAppComponent = createRemoteAppComponentFactory(RemoteApp);\nconst createRemoteComponent = createDeprecatedRemoteComponentFactory(\n createRemoteAppComponent\n);\nexport {\n C as CacheSize,\n a2 as CacheTime,\n E as ERROR_TYPE,\n a as autoFetchDataPlugin,\n c2 as cache,\n callDataFetch,\n b3 as clearStore,\n c as collectSSRAssets,\n d as configureCache,\n b as createBridgeComponent,\n b2 as createLazyComponent,\n createRemoteAppComponent,\n createRemoteComponent,\n g as generateKey,\n l as lazyLoadComponentPlugin,\n p as prefetch,\n r as revalidateTag,\n s as setSSREnv\n};\n',"lazy-load-component-plugin-DlagtX0O.mjs":'import { i as injectDataFetch, p as prefetch } from "./prefetch-BzCq3MT3.mjs";\nimport { i as initDataFetchMap, k as isDataLoaderExpose, m as getDataFetchInfo, n as getDataFetchMapKey, l as logger, o as getDataFetchItem, p as DATA_FETCH_CLIENT_SUFFIX, q as MF_DATA_FETCH_TYPE, t as isCSROnly, M as MF_DATA_FETCH_STATUS, j as loadDataFetchModule, e as getDataFetchMap, u as isServerEnv, v as getDataFetchIdWithErrorMsgs, w as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, x as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, y as DATA_FETCH_FUNCTION, z as getLoadedRemoteInfos, h as fetchData$1, A as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-BBP3hEeV.mjs";\nimport React__default, { useRef, useState, Suspense, useEffect } from "react";\nconst autoFetchData = () => {\n initDataFetchMap();\n injectDataFetch();\n return {\n name: "auto-fetch-data-plugin",\n afterLoadSnapshot(args) {\n const { id, moduleInfo, remoteSnapshot, host } = args;\n if (typeof id === "string" && isDataLoaderExpose(id)) {\n return args;\n }\n if (!remoteSnapshot || !id || !("modules" in remoteSnapshot)) {\n return args;\n }\n const { name, alias } = moduleInfo;\n const dataFetchInfo = getDataFetchInfo({\n name,\n alias,\n id,\n remoteSnapshot\n });\n if (!dataFetchInfo) {\n return args;\n }\n const { dataFetchId, dataFetchName } = dataFetchInfo;\n const dataFetchMapKey = getDataFetchMapKey(dataFetchInfo, {\n name: host.name,\n version: host.options.version\n });\n logger.debug(\n "======= auto fetch plugin dataFetchMapKey: ",\n dataFetchMapKey\n );\n if (!dataFetchMapKey) {\n return args;\n }\n const dataFetchItem = getDataFetchItem(dataFetchMapKey);\n if (dataFetchItem) {\n return args;\n }\n const dataFetchMap = getDataFetchMap();\n const hasSSRAsset = Boolean(remoteSnapshot.ssrRemoteEntry);\n const hasDataFetchClient = Boolean(\n remoteSnapshot.modules.find(\n (module) => module.moduleName === `${dataFetchName}${DATA_FETCH_CLIENT_SUFFIX}`\n )\n );\n const downgradeType = hasDataFetchClient ? MF_DATA_FETCH_TYPE.FETCH_CLIENT : hasSSRAsset ? MF_DATA_FETCH_TYPE.FETCH_SERVER : MF_DATA_FETCH_TYPE.FETCH_CLIENT;\n let finalDataFetchId = dataFetchId;\n if (!isServerEnv()) {\n finalDataFetchId = downgradeType === MF_DATA_FETCH_TYPE.FETCH_CLIENT ? hasDataFetchClient ? `${dataFetchId}${DATA_FETCH_CLIENT_SUFFIX}` : dataFetchId : dataFetchId;\n }\n const getDataFetchGetter = () => loadDataFetchModule(host, finalDataFetchId);\n const dataFetchFnItem = [\n getDataFetchGetter,\n downgradeType\n ];\n if (typeof window === "undefined" || isCSROnly()) {\n dataFetchFnItem.push(getDataFetchGetter());\n }\n dataFetchMap[dataFetchMapKey] = [\n dataFetchFnItem,\n void 0,\n MF_DATA_FETCH_STATUS.AWAIT\n ];\n return args;\n }\n };\n};\nfunction isPromise(obj) {\n return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";\n}\nconst AWAIT_ERROR_PREFIX = "<Await /> caught the following error during render: ";\nconst transformError = (err) => {\n const errMsg = err instanceof Error ? err.message : err;\n const originalMsg = errMsg.replace(AWAIT_ERROR_PREFIX, "");\n const dataFetchMapKey = getDataFetchIdWithErrorMsgs(originalMsg);\n if (originalMsg.indexOf(DATA_FETCH_ERROR_PREFIX) === 0) {\n return {\n error: new Error(\n originalMsg.replace(DATA_FETCH_ERROR_PREFIX, "").replace(wrapDataFetchId(dataFetchMapKey), "")\n ),\n errorType: ERROR_TYPE.DATA_FETCH,\n dataFetchMapKey\n };\n }\n if (originalMsg.indexOf(LOAD_REMOTE_ERROR_PREFIX) === 0) {\n return {\n error: new Error(\n originalMsg.replace(LOAD_REMOTE_ERROR_PREFIX, "").replace(wrapDataFetchId(dataFetchMapKey), "")\n ),\n errorType: ERROR_TYPE.LOAD_REMOTE,\n dataFetchMapKey\n };\n }\n return {\n error: new Error(originalMsg.replace(wrapDataFetchId(dataFetchMapKey), "")),\n errorType: ERROR_TYPE.UNKNOWN,\n dataFetchMapKey\n };\n};\nconst DefaultLoading = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);\nconst DefaultErrorElement = (_data) => /* @__PURE__ */ React__default.createElement("div", null, "Error");\nfunction AwaitDataFetch({\n resolve,\n loading = DefaultLoading,\n errorElement = DefaultErrorElement,\n children,\n params,\n delayLoading\n}) {\n const dataRef = useRef();\n const data = dataRef.current || resolve;\n const getData = isPromise(data) ? fetchData(data, dataRef) : () => data;\n return /* @__PURE__ */ React__default.createElement(\n AwaitSuspense,\n {\n params,\n loading,\n errorElement,\n delayLoading,\n resolve: getData\n },\n children\n );\n}\nconst DelayedLoading = ({\n delayLoading,\n children\n}) => {\n const [show, setShow] = useState(false);\n const timerSet = useRef(false);\n if (!delayLoading) {\n return children;\n }\n if (typeof window !== "undefined" && !show && !timerSet.current) {\n timerSet.current = true;\n setTimeout(() => {\n setShow(true);\n }, delayLoading);\n }\n return show ? children : null;\n};\nfunction AwaitSuspense({\n resolve,\n children,\n loading = DefaultLoading,\n errorElement = DefaultErrorElement,\n delayLoading\n}) {\n return /* @__PURE__ */ React__default.createElement(\n Suspense,\n {\n fallback: /* @__PURE__ */ React__default.createElement(DelayedLoading, { delayLoading }, loading)\n },\n /* @__PURE__ */ React__default.createElement(ResolveAwait, { resolve, errorElement }, children)\n );\n}\nfunction ResolveAwait({\n children,\n resolve,\n errorElement,\n params\n}) {\n const data = resolve();\n logger.debug("resolve data: ", data);\n if (typeof data === "string" && data.indexOf(AWAIT_ERROR_PREFIX) === 0) {\n const transformedError = transformError(data);\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof errorElement === "function" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, globalThis.FEDERATION_SSR && /* @__PURE__ */ React__default.createElement(\n "script",\n {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: String.raw`\n globalThis[\'${DATA_FETCH_FUNCTION}\'] = globalThis[\'${DATA_FETCH_FUNCTION}\'] || []\n globalThis[\'${DATA_FETCH_FUNCTION}\'].push([${transformedError.dataFetchMapKey ? `\'${transformedError.dataFetchMapKey}\'` : ""},${params ? JSON.stringify(params) : null},true]);`\n }\n }\n ), errorElement(transformedError)) : errorElement);\n }\n const toRender = typeof children === "function" ? children(data) : children;\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toRender);\n}\nconst fetchData = (promise, ref) => {\n let data;\n let status = "pending";\n const suspender = promise.then((res) => {\n status = "success";\n data = res;\n ref.current = res;\n }).catch((e) => {\n status = "success";\n console.warn(e);\n data = AWAIT_ERROR_PREFIX + e;\n });\n return () => {\n if (status === "pending") {\n throw suspender;\n }\n return data;\n };\n};\nfunction getTargetModuleInfo(id, instance) {\n if (!instance) {\n return;\n }\n const loadedRemoteInfo = getLoadedRemoteInfos(id, instance);\n if (!loadedRemoteInfo) {\n return;\n }\n const { snapshot } = loadedRemoteInfo;\n if (!snapshot) {\n return;\n }\n const publicPath = "publicPath" in snapshot ? snapshot.publicPath : "getPublicPath" in snapshot ? new Function(snapshot.getPublicPath)() : "";\n if (!publicPath) {\n return;\n }\n const modules = "modules" in snapshot ? snapshot.modules : [];\n const targetModule = modules.find(\n (m) => m.modulePath === loadedRemoteInfo.expose\n );\n if (!targetModule) {\n return;\n }\n const remoteEntry = "remoteEntry" in snapshot ? snapshot.remoteEntry : "";\n if (!remoteEntry) {\n return;\n }\n return {\n module: targetModule,\n publicPath,\n remoteEntry\n };\n}\nfunction collectSSRAssets(options) {\n const {\n id,\n injectLink = true,\n injectScript = false\n } = typeof options === "string" ? { id: options } : options;\n const links = [];\n const scripts = [];\n const instance = options.instance;\n if (!instance || !injectLink && !injectScript) {\n return [...scripts, ...links];\n }\n const moduleAndPublicPath = getTargetModuleInfo(id, instance);\n if (!moduleAndPublicPath) {\n return [...scripts, ...links];\n }\n const { module: targetModule, publicPath, remoteEntry } = moduleAndPublicPath;\n if (injectLink) {\n [...targetModule.assets.css.sync, ...targetModule.assets.css.async].sort().forEach((file, index) => {\n links.push(\n /* @__PURE__ */ React__default.createElement(\n "link",\n {\n key: `${file.split(".")[0]}_${index}`,\n href: `${publicPath}${file}`,\n rel: "stylesheet",\n type: "text/css"\n }\n )\n );\n });\n }\n if (injectScript) {\n scripts.push(\n /* @__PURE__ */ React__default.createElement(\n "script",\n {\n async: true,\n key: remoteEntry.split(".")[0],\n src: `${publicPath}${remoteEntry}`,\n crossOrigin: "anonymous"\n }\n )\n );\n [...targetModule.assets.js.sync].sort().forEach((file, index) => {\n scripts.push(\n /* @__PURE__ */ React__default.createElement(\n "script",\n {\n key: `${file.split(".")[0]}_${index}`,\n async: true,\n src: `${publicPath}${file}`,\n crossOrigin: "anonymous"\n }\n )\n );\n });\n }\n return [...scripts, ...links];\n}\nfunction getServerNeedRemoteInfo(loadedRemoteInfo, id, noSSR) {\n var _a;\n if (noSSR || typeof window !== "undefined" && window.location.href !== window[FS_HREF]) {\n if (!(loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.version)) {\n throw new Error(`${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} version is empty`);\n }\n const { snapshot } = loadedRemoteInfo;\n if (!snapshot) {\n throw new Error(`${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} snapshot is empty`);\n }\n const dataFetchItem = getDataFetchItem(id);\n const isFetchServer = ((_a = dataFetchItem == null ? void 0 : dataFetchItem[0]) == null ? void 0 : _a[1]) === MF_DATA_FETCH_TYPE.FETCH_SERVER;\n if (isFetchServer && (!("ssrPublicPath" in snapshot) || !snapshot.ssrPublicPath)) {\n throw new Error(\n `ssrPublicPath is required while fetching ${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} data in SSR project!`\n );\n }\n if (isFetchServer && (!("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry)) {\n throw new Error(\n `ssrRemoteEntry is required while loading ${loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.name} data loader in SSR project!`\n );\n }\n return {\n name: loadedRemoteInfo.name,\n version: loadedRemoteInfo.version,\n ssrPublicPath: "ssrPublicPath" in snapshot ? snapshot.ssrPublicPath || "" : "",\n ssrRemoteEntry: "ssrRemoteEntry" in snapshot ? snapshot.ssrRemoteEntry || "" : "",\n globalName: loadedRemoteInfo.entryGlobalName\n };\n }\n return void 0;\n}\nfunction createLazyComponent(options) {\n const { instance, injectScript, injectLink } = options;\n if (!instance) {\n throw new Error("instance is required for createLazyComponent!");\n }\n const exportName = (options == null ? void 0 : options.export) || "default";\n const callLoader = async () => {\n logger.debug("callLoader start", Date.now());\n const m = await options.loader();\n logger.debug("callLoader end", Date.now());\n if (!m) {\n throw new Error("load remote failed");\n }\n return m;\n };\n const getData = async (noSSR) => {\n let loadedRemoteInfo;\n let moduleId;\n try {\n const m = await callLoader();\n moduleId = m && m[Symbol.for("mf_module_id")];\n if (!moduleId) {\n throw new Error("moduleId is empty");\n }\n loadedRemoteInfo = getLoadedRemoteInfos(moduleId, instance);\n if (!loadedRemoteInfo) {\n throw new Error(`can not find loaded remote(\'${moduleId}\') info!`);\n }\n } catch (e) {\n const errMsg = `${LOAD_REMOTE_ERROR_PREFIX}${e}`;\n logger.debug(e);\n throw new Error(errMsg);\n }\n let dataFetchMapKey;\n try {\n dataFetchMapKey = getDataFetchMapKey(\n getDataFetchInfo({\n name: loadedRemoteInfo.name,\n alias: loadedRemoteInfo.alias,\n id: moduleId,\n remoteSnapshot: loadedRemoteInfo.snapshot\n }),\n { name: instance.name, version: instance.options.version }\n );\n logger.debug("getData dataFetchMapKey: ", dataFetchMapKey);\n if (!dataFetchMapKey) {\n return;\n }\n const data = await fetchData$1(\n dataFetchMapKey,\n {\n ...options.dataFetchParams,\n isDowngrade: false\n },\n getServerNeedRemoteInfo(loadedRemoteInfo, dataFetchMapKey, noSSR)\n );\n setDataFetchItemLoadedStatus(dataFetchMapKey);\n logger.debug("get data res: \\n", data);\n return data;\n } catch (err) {\n const errMsg = `${DATA_FETCH_ERROR_PREFIX}${wrapDataFetchId(dataFetchMapKey)}${err}`;\n logger.debug(errMsg);\n throw new Error(errMsg);\n }\n };\n const LazyComponent = React__default.lazy(async () => {\n const m = await callLoader();\n const moduleId = m && m[Symbol.for("mf_module_id")];\n const loadedRemoteInfo = getLoadedRemoteInfos(moduleId, instance);\n loadedRemoteInfo == null ? void 0 : loadedRemoteInfo.snapshot;\n const dataFetchMapKey = loadedRemoteInfo ? getDataFetchMapKey(\n getDataFetchInfo({\n name: loadedRemoteInfo.name,\n alias: loadedRemoteInfo.alias,\n id: moduleId,\n remoteSnapshot: loadedRemoteInfo.snapshot\n }),\n { name: instance.name, version: instance == null ? void 0 : instance.options.version }\n ) : void 0;\n logger.debug("LazyComponent dataFetchMapKey: ", dataFetchMapKey);\n const assets = collectSSRAssets({\n id: moduleId,\n instance,\n injectLink,\n injectScript\n });\n const Com = m[exportName];\n if (exportName in m && typeof Com === "function") {\n return {\n default: (props) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, globalThis.FEDERATION_SSR && dataFetchMapKey && /* @__PURE__ */ React__default.createElement(\n "script",\n {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: String.raw`\n globalThis[\'${DATA_FETCH_FUNCTION}\'] = globalThis[\'${DATA_FETCH_FUNCTION}\'] || [];\n globalThis[\'${DATA_FETCH_FUNCTION}\'].push([\'${dataFetchMapKey}\',${JSON.stringify(props.mfData)}]);\n `\n }\n }\n ), globalThis.FEDERATION_SSR && assets, /* @__PURE__ */ React__default.createElement(Com, { ...props }))\n };\n } else {\n throw Error(\n `Make sure that ${moduleId} has the correct export when export is ${String(\n exportName\n )}`\n );\n }\n });\n return (props) => {\n const { key, ...args } = props;\n if (!options.noSSR) {\n return /* @__PURE__ */ React__default.createElement(\n AwaitDataFetch,\n {\n resolve: getData(options.noSSR),\n loading: options.loading,\n delayLoading: options.delayLoading,\n errorElement: options.fallback\n },\n (data) => /* @__PURE__ */ React__default.createElement(LazyComponent, { ...args, mfData: data })\n );\n } else {\n const [data, setData] = useState(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n useEffect(() => {\n let isMounted = true;\n const fetchDataAsync = async () => {\n try {\n setLoading(true);\n const result = await getData(options.noSSR);\n if (isMounted) {\n setData(result);\n }\n } catch (e) {\n if (isMounted) {\n setError(transformError(e));\n }\n } finally {\n if (isMounted) {\n setLoading(false);\n }\n }\n };\n fetchDataAsync();\n return () => {\n isMounted = false;\n };\n }, []);\n if (loading) {\n return /* @__PURE__ */ React__default.createElement(DelayedLoading, { delayLoading: options.delayLoading }, options.loading);\n }\n if (error) {\n return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof options.fallback === "function" ? options.fallback(error) : options.fallback);\n }\n return /* @__PURE__ */ React__default.createElement(LazyComponent, { ...args, mfData: data });\n }\n };\n}\nfunction lazyLoadComponentPlugin() {\n return {\n name: "lazy-load-component-plugin",\n apply(instance) {\n instance.registerPlugins([autoFetchData()]);\n instance.createLazyComponent = (options) => {\n return createLazyComponent({\n instance,\n ...options\n });\n };\n instance.prefetch = (options) => {\n return prefetch({\n instance,\n ...options\n });\n };\n instance.collectSSRAssets = (options) => {\n return collectSSRAssets({\n instance,\n ...options\n });\n };\n }\n };\n}\nexport {\n autoFetchData as a,\n createLazyComponent as b,\n collectSSRAssets as c,\n lazyLoadComponentPlugin as l\n};\n',"logger-DwWkXsWl.mjs":'const MANIFEST_EXT = ".json";\nconst BROWSER_LOG_KEY = "FEDERATION_DEBUG";\nconst SEPARATOR = ":";\nconst isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";\nfunction isBrowserEnv() {\n return isBrowserEnvValue;\n}\nfunction isBrowserDebug() {\n try {\n if (isBrowserEnv() && window.localStorage) return Boolean(localStorage.getItem(BROWSER_LOG_KEY));\n } catch (error) {\n return false;\n }\n return false;\n}\nfunction isDebugMode() {\n if (typeof process !== "undefined" && process.env && process.env["FEDERATION_DEBUG"]) return Boolean(process.env["FEDERATION_DEBUG"]);\n if (typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG)) return true;\n return isBrowserDebug();\n}\nconst PREFIX = "[ Module Federation ]";\nconst DEFAULT_DELEGATE = console;\nconst LOGGER_STACK_SKIP_TOKENS = [\n "logger.ts",\n "logger.js",\n "captureStackTrace",\n "Logger.emit",\n "Logger.log",\n "Logger.info",\n "Logger.warn",\n "Logger.error",\n "Logger.debug"\n];\nfunction captureStackTrace() {\n try {\n const stack = (/* @__PURE__ */ new Error()).stack;\n if (!stack) return;\n const [, ...rawLines] = stack.split("\\n");\n const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));\n if (!filtered.length) return;\n return `Stack trace:\n${filtered.slice(0, 5).join("\\n")}`;\n } catch {\n return;\n }\n}\nvar Logger = class {\n constructor(prefix, delegate = DEFAULT_DELEGATE) {\n this.prefix = prefix;\n this.delegate = delegate ?? DEFAULT_DELEGATE;\n }\n setPrefix(prefix) {\n this.prefix = prefix;\n }\n setDelegate(delegate) {\n this.delegate = delegate ?? DEFAULT_DELEGATE;\n }\n emit(method, args) {\n const delegate = this.delegate;\n const stackTrace = isDebugMode() ? captureStackTrace() : void 0;\n const enrichedArgs = stackTrace ? [...args, stackTrace] : args;\n const order = (() => {\n switch (method) {\n case "log":\n return ["log", "info"];\n case "info":\n return ["info", "log"];\n case "warn":\n return [\n "warn",\n "info",\n "log"\n ];\n case "error":\n return [\n "error",\n "warn",\n "log"\n ];\n default:\n return ["debug", "log"];\n }\n })();\n for (const candidate of order) {\n const handler = delegate[candidate];\n if (typeof handler === "function") {\n handler.call(delegate, this.prefix, ...enrichedArgs);\n return;\n }\n }\n for (const candidate of order) {\n const handler = DEFAULT_DELEGATE[candidate];\n if (typeof handler === "function") {\n handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);\n return;\n }\n }\n }\n log(...args) {\n this.emit("log", args);\n }\n warn(...args) {\n this.emit("warn", args);\n }\n error(...args) {\n this.emit("error", args);\n }\n success(...args) {\n this.emit("info", args);\n }\n info(...args) {\n this.emit("info", args);\n }\n ready(...args) {\n this.emit("info", args);\n }\n debug(...args) {\n if (isDebugMode()) this.emit("debug", args);\n }\n};\nfunction createLogger(prefix) {\n return new Logger(prefix);\n}\nfunction createInfrastructureLogger(prefix) {\n const infrastructureLogger = new Logger(prefix);\n Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {\n value: true,\n enumerable: false,\n configurable: false\n });\n return infrastructureLogger;\n}\ncreateInfrastructureLogger(PREFIX);\nexport {\n MANIFEST_EXT as M,\n SEPARATOR as S,\n createLogger as c,\n isBrowserEnvValue as i\n};\n',"plugin.es.js":'const federationRuntime = { instance: null };\nfunction BridgeReactPlugin() {\n return {\n name: "bridge-react-plugin",\n beforeInit(args) {\n federationRuntime.instance = args.origin;\n return args;\n }\n };\n}\nexport {\n BridgeReactPlugin as default,\n federationRuntime\n};\n',"prefetch-BzCq3MT3.mjs":'import { B as warn, y as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger, e as getDataFetchMap, i as initDataFetchMap, o as getDataFetchItem, M as MF_DATA_FETCH_STATUS, q as MF_DATA_FETCH_TYPE, G as DOWNGRADE_KEY, H as callAllDowngrade, I as callDowngrade, J as getDowngradeTag, K as composeKeyWithSeparator, N as safeToString, m as getDataFetchInfo, n as getDataFetchMapKey } from "./utils-BBP3hEeV.mjs";\nimport { i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";\nasync function safeWrapper(callback, disableWarn) {\n try {\n return await callback();\n } catch (e) {\n warn(e);\n return;\n }\n}\nfunction isStaticResourcesEqual(url1, url2) {\n const REG_EXP = /^(https?:)?\\/\\//i;\n return url1.replace(REG_EXP, "").replace(/\\/$/, "") === url2.replace(REG_EXP, "").replace(/\\/$/, "");\n}\nfunction createScript(info) {\n let script = null;\n let needAttach = true;\n let timeout = 2e4;\n let timeoutId;\n const scripts = document.getElementsByTagName("script");\n for (let i = 0; i < scripts.length; i++) {\n const s = scripts[i];\n const scriptSrc = s.getAttribute("src");\n if (scriptSrc && isStaticResourcesEqual(scriptSrc, info.url)) {\n script = s;\n needAttach = false;\n break;\n }\n }\n if (!script) {\n const attrs = info.attrs;\n script = document.createElement("script");\n script.type = (attrs == null ? void 0 : attrs["type"]) === "module" ? "module" : "text/javascript";\n let createScriptRes = void 0;\n if (info.createScriptHook) {\n createScriptRes = info.createScriptHook(info.url, info.attrs);\n if (createScriptRes instanceof HTMLScriptElement) script = createScriptRes;\n else if (typeof createScriptRes === "object") {\n if ("script" in createScriptRes && createScriptRes.script) script = createScriptRes.script;\n if ("timeout" in createScriptRes && createScriptRes.timeout) timeout = createScriptRes.timeout;\n }\n }\n if (!script.src) script.src = info.url;\n if (attrs && !createScriptRes) Object.keys(attrs).forEach((name) => {\n if (script) {\n if (name === "async" || name === "defer") script[name] = attrs[name];\n else if (!script.getAttribute(name)) script.setAttribute(name, attrs[name]);\n }\n });\n }\n let executionError = null;\n const executionErrorHandler = typeof window !== "undefined" ? (evt) => {\n if (evt.filename && isStaticResourcesEqual(evt.filename, info.url)) {\n const err = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);\n err.name = "ScriptExecutionError";\n executionError = err;\n }\n } : null;\n if (executionErrorHandler) window.addEventListener("error", executionErrorHandler);\n const onScriptComplete = async (prev, event) => {\n clearTimeout(timeoutId);\n if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);\n const onScriptCompleteCallback = () => {\n if ((event == null ? void 0 : event.type) === "error") {\n const networkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `ScriptNetworkError: Script "${info.url}" timed out.` : `ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);\n networkError.name = "ScriptNetworkError";\n (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));\n } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));\n else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n };\n if (script) {\n script.onerror = null;\n script.onload = null;\n safeWrapper(() => {\n const { needDeleteScript = true } = info;\n if (needDeleteScript) (script == null ? void 0 : script.parentNode) && script.parentNode.removeChild(script);\n });\n if (prev && typeof prev === "function") {\n const result = prev(event);\n if (result instanceof Promise) {\n const res = await result;\n onScriptCompleteCallback();\n return res;\n }\n onScriptCompleteCallback();\n return result;\n }\n }\n onScriptCompleteCallback();\n };\n script.onerror = onScriptComplete.bind(null, script.onerror);\n script.onload = onScriptComplete.bind(null, script.onload);\n timeoutId = setTimeout(() => {\n onScriptComplete(null, {\n type: "error",\n isTimeout: true\n });\n }, timeout);\n return {\n script,\n needAttach\n };\n}\nfunction createLink(info) {\n let link = null;\n let needAttach = true;\n let timeout = 2e4;\n let timeoutId;\n const links = document.getElementsByTagName("link");\n for (let i = 0; i < links.length; i++) {\n const l = links[i];\n const linkHref = l.getAttribute("href");\n const linkRel = l.getAttribute("rel");\n if (linkHref && isStaticResourcesEqual(linkHref, info.url) && linkRel === info.attrs["rel"]) {\n link = l;\n needAttach = false;\n break;\n }\n }\n if (!link) {\n link = document.createElement("link");\n link.setAttribute("href", info.url);\n let createLinkRes = void 0;\n let shouldApplyAttrs = true;\n const attrs = info.attrs;\n if (info.createLinkHook) {\n createLinkRes = info.createLinkHook(info.url, attrs);\n if (createLinkRes instanceof HTMLLinkElement) {\n link = createLinkRes;\n shouldApplyAttrs = false;\n } else if (typeof createLinkRes === "object") {\n if ("link" in createLinkRes && createLinkRes.link) {\n link = createLinkRes.link;\n shouldApplyAttrs = false;\n }\n if ("timeout" in createLinkRes && createLinkRes.timeout) timeout = createLinkRes.timeout;\n }\n }\n if (attrs && shouldApplyAttrs) Object.keys(attrs).forEach((name) => {\n if (link && !link.getAttribute(name)) link.setAttribute(name, attrs[name]);\n });\n }\n if (!needAttach) {\n Promise.resolve().then(() => {\n (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n });\n return {\n link,\n needAttach\n };\n }\n const onLinkComplete = (prev, event) => {\n if (timeoutId) clearTimeout(timeoutId);\n const onLinkCompleteCallback = () => {\n if ((event == null ? void 0 : event.type) === "error") {\n const linkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `LinkNetworkError: Link "${info.url}" timed out.` : `LinkNetworkError: Failed to load link "${info.url}" - the URL is unreachable or the server returned an error.`);\n linkError.name = "LinkNetworkError";\n (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(linkError));\n } else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());\n };\n if (link) {\n link.onerror = null;\n link.onload = null;\n safeWrapper(() => {\n const { needDeleteLink = true } = info;\n if (needDeleteLink) (link == null ? void 0 : link.parentNode) && link.parentNode.removeChild(link);\n });\n if (prev) {\n const res = prev(event);\n onLinkCompleteCallback();\n return res;\n }\n }\n onLinkCompleteCallback();\n };\n link.onerror = onLinkComplete.bind(null, link.onerror);\n link.onload = onLinkComplete.bind(null, link.onload);\n timeoutId = setTimeout(() => {\n onLinkComplete(null, {\n type: "error",\n isTimeout: true\n });\n }, timeout);\n return {\n link,\n needAttach\n };\n}\nfunction loadScript(url, info) {\n const { attrs = {}, createScriptHook } = info;\n return new Promise((resolve, reject) => {\n const { script, needAttach } = createScript({\n url,\n cb: resolve,\n onErrorCallback: reject,\n attrs: {\n fetchpriority: "high",\n ...attrs\n },\n createScriptHook,\n needDeleteScript: true\n });\n needAttach && document.head.appendChild(script);\n });\n}\nconst sdkImportCache = /* @__PURE__ */ new Map();\nfunction importNodeModule(name) {\n if (!name) throw new Error("import specifier is required");\n if (sdkImportCache.has(name)) return sdkImportCache.get(name);\n const promise = new Function("name", `return import(name)`)(name).then((res) => res).catch((error2) => {\n console.error(`Error importing module ${name}:`, error2);\n sdkImportCache.delete(name);\n throw error2;\n });\n sdkImportCache.set(name, promise);\n return promise;\n}\nconst lazyLoaderHookFetch = async (input, init, loaderHook) => {\n const hook = (url, init2) => {\n return loaderHook.lifecycle.fetch.emit(url, init2);\n };\n const res = await hook(input, init || {});\n if (!res || !(res instanceof Response)) return fetch(input, init || {});\n return res;\n};\nconst createScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {\n if (loaderHook == null ? void 0 : loaderHook.createScriptHook) {\n const hookResult = loaderHook.createScriptHook(url);\n if (hookResult && typeof hookResult === "object" && "url" in hookResult) url = hookResult.url;\n }\n let urlObj;\n try {\n urlObj = new URL(url);\n } catch (e) {\n console.error("Error constructing URL:", e);\n cb(/* @__PURE__ */ new Error(`Invalid URL: ${e}`));\n return;\n }\n const getFetch = async () => {\n if (loaderHook == null ? void 0 : loaderHook.fetch) return (input, init) => lazyLoaderHookFetch(input, init, loaderHook);\n return fetch;\n };\n const handleScriptFetch = async (f, urlObj2) => {\n var _a;\n try {\n const res = await f(urlObj2.href);\n const data = await res.text();\n const [path, vm] = await Promise.all([importNodeModule("path"), importNodeModule("vm")]);\n const scriptContext = {\n exports: {},\n module: { exports: {} }\n };\n const urlDirname = urlObj2.pathname.split("/").slice(0, -1).join("/");\n const filename = path.basename(urlObj2.pathname);\n const script = new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}\n})`, {\n filename,\n importModuleDynamically: ((_a = vm.constants) == null ? void 0 : _a.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? importNodeModule\n });\n let requireFn;\n requireFn = (await importNodeModule("node:module")).createRequire(urlObj2.protocol === "file:" || urlObj2.protocol === "node:" ? urlObj2.href : path.join(process.cwd(), "__mf_require_base__.js"));\n script.runInThisContext()(scriptContext.exports, scriptContext.module, requireFn, urlDirname, filename);\n const exportedInterface = scriptContext.module.exports || scriptContext.exports;\n if (attrs && exportedInterface && attrs["globalName"]) {\n cb(void 0, exportedInterface[attrs["globalName"]] || exportedInterface);\n return;\n }\n cb(void 0, exportedInterface);\n } catch (e) {\n cb(e instanceof Error ? e : /* @__PURE__ */ new Error(`Script execution error: ${e}`));\n }\n };\n getFetch().then(async (f) => {\n if ((attrs == null ? void 0 : attrs["type"]) === "esm" || (attrs == null ? void 0 : attrs["type"]) === "module") return loadModule(urlObj.href, {\n fetch: f,\n vm: await importNodeModule("vm")\n }).then(async (module) => {\n await module.evaluate();\n cb(void 0, module.namespace);\n }).catch((e) => {\n cb(e instanceof Error ? e : /* @__PURE__ */ new Error(`Script execution error: ${e}`));\n });\n handleScriptFetch(f, urlObj);\n }).catch((err) => {\n cb(err);\n });\n} : (url, cb, attrs, loaderHook) => {\n cb(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));\n};\nconst loadScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "web" ? (url, info) => {\n return new Promise((resolve, reject) => {\n createScriptNode(url, (error2, scriptContext) => {\n var _a, _b;\n if (error2) reject(error2);\n else {\n const remoteEntryKey = ((_a = info == null ? void 0 : info.attrs) == null ? void 0 : _a["globalName"]) || `__FEDERATION_${(_b = info == null ? void 0 : info.attrs) == null ? void 0 : _b["name"]}:custom__`;\n resolve(globalThis[remoteEntryKey] = scriptContext);\n }\n }, info.attrs, info.loaderHook);\n });\n} : (url, info) => {\n throw new Error("loadScriptNode is disabled in non-Node.js environment");\n};\nconst esmModuleCache = /* @__PURE__ */ new Map();\nconst isFetchableRemoteModuleUrl = (url) => url.startsWith("http:") || url.startsWith("https:");\nconst isBareModuleSpecifier = (specifier) => !specifier.startsWith("./") && !specifier.startsWith("../") && !specifier.startsWith("/") && !specifier.includes(":");\nfunction encodeRemoteModulePath(url) {\n const remoteUrl = new URL(url);\n const encodedProtocol = encodeURIComponent(remoteUrl.protocol.slice(0, -1));\n const encodedHost = encodeURIComponent(remoteUrl.host);\n const encodedPathname = remoteUrl.pathname.split("/").map((segment) => encodeURIComponent(segment)).join("/");\n const encodedSearchHash = encodeURIComponent(`${remoteUrl.search}${remoteUrl.hash}`);\n return `/${encodedProtocol}/${encodedHost}${encodedPathname}${encodedSearchHash ? `/${encodedSearchHash}` : ""}`;\n}\nfunction createImportMetaUrl(url, baseFileUrl) {\n const baseUrl = baseFileUrl.endsWith("/") ? baseFileUrl : `${baseFileUrl}/`;\n return new URL(`__module_federation_remote__${encodeRemoteModulePath(url)}`, baseUrl).href;\n}\nasync function isNodeBuiltinSpecifier(specifier) {\n if (specifier.startsWith("node:")) return true;\n if (!isBareModuleSpecifier(specifier)) return false;\n return (await importNodeModule("node:module")).builtinModules.includes(specifier);\n}\nfunction getSyntheticModuleExports(moduleExports) {\n const namespaceObject = moduleExports && (typeof moduleExports === "object" || typeof moduleExports === "function") ? moduleExports : { default: moduleExports };\n const effectiveExports = { ...namespaceObject };\n if (!Object.prototype.hasOwnProperty.call(effectiveExports, "default")) effectiveExports.default = namespaceObject;\n return effectiveExports;\n}\nasync function createSyntheticModuleFromExports(identifier, moduleExports, vm) {\n if (typeof vm.SyntheticModule !== "function") throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");\n const effectiveExports = getSyntheticModuleExports(moduleExports);\n const exportNames = Object.keys(effectiveExports);\n const syntheticModule = new vm.SyntheticModule(exportNames, function setSyntheticModuleExports() {\n for (const name of exportNames) this.setExport(name, effectiveExports[name]);\n }, { identifier });\n esmModuleCache.set(identifier, syntheticModule);\n await syntheticModule.link(async () => {\n throw new Error(`Node.js built-in module "${identifier}" should not request child modules.`);\n });\n await syntheticModule.evaluate();\n return syntheticModule;\n}\nasync function loadNodeBuiltinModule(specifier, vm) {\n const cacheKey = `node-builtin:${specifier}`;\n if (esmModuleCache.has(cacheKey)) return esmModuleCache.get(cacheKey);\n return createSyntheticModuleFromExports(cacheKey, await importNodeModule(specifier), vm);\n}\nasync function loadResolvedModule(specifier, parentUrl, options) {\n if (await isNodeBuiltinSpecifier(specifier)) return loadNodeBuiltinModule(specifier, options.vm);\n if (isBareModuleSpecifier(specifier)) throw new Error(`Unsupported ESM module specifier "${specifier}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);\n const resolvedUrl = new URL(specifier, parentUrl).href;\n if (!isFetchableRemoteModuleUrl(resolvedUrl)) throw new Error(`Unsupported ESM module specifier "${specifier}" resolved to "${resolvedUrl}". Only http(s) remote modules and Node.js built-in modules are supported.`);\n return loadModule(resolvedUrl, options);\n}\nasync function evaluateDynamicModule(module) {\n if (module.status === "linked") await module.evaluate();\n if (module.status === "errored") throw module.error;\n return module;\n}\nasync function loadModule(url, options) {\n if (esmModuleCache.has(url)) return esmModuleCache.get(url);\n const { fetch: fetch2, vm } = options;\n if (!isFetchableRemoteModuleUrl(url)) throw new Error(`Unsupported ESM module URL "${url}". Only http(s) remote modules and Node.js built-in modules are supported.`);\n const code = await (await fetch2(url)).text();\n const cwdFileUrl = (await importNodeModule("node:url")).pathToFileURL(process.cwd()).href;\n const sourceTextModule = new vm.SourceTextModule(code, {\n identifier: url,\n initializeImportMeta: (meta) => {\n meta.url = createImportMetaUrl(url, cwdFileUrl);\n },\n importModuleDynamically: async (specifier) => {\n return evaluateDynamicModule(await loadResolvedModule(specifier, url, options));\n }\n });\n esmModuleCache.set(url, sourceTextModule);\n await sourceTextModule.link(async (specifier) => {\n return loadResolvedModule(specifier, url, options);\n });\n return sourceTextModule;\n}\nconst dataFetchFunction = async function(options) {\n var _a, _b;\n const [id, data, downgrade] = options;\n logger.debug("==========call data fetch function!");\n if (data) {\n if (!id) {\n throw new Error("id is required!");\n }\n if (!getDataFetchMap()) {\n initDataFetchMap();\n }\n const dataFetchItem = getDataFetchItem(id);\n if (dataFetchItem) {\n (_b = (_a = dataFetchItem[1]) == null ? void 0 : _a[1]) == null ? void 0 : _b.call(_a, data);\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.LOADED;\n return;\n }\n if (!dataFetchItem) {\n const dataFetchMap = getDataFetchMap();\n let res;\n let rej;\n const p = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n dataFetchMap[id] = [\n [\n async () => async () => {\n return "";\n },\n MF_DATA_FETCH_TYPE.FETCH_SERVER\n ],\n [p, res, rej],\n MF_DATA_FETCH_STATUS.LOADED\n ];\n res && res(data);\n return;\n }\n }\n if (downgrade) {\n const mfDowngrade2 = getDowngradeTag();\n if (!mfDowngrade2) {\n globalThis[DOWNGRADE_KEY] = id ? [id] : true;\n } else if (Array.isArray(mfDowngrade2) && id && !mfDowngrade2.includes(id)) {\n mfDowngrade2.push(id);\n }\n }\n const mfDowngrade = getDowngradeTag();\n if (typeof mfDowngrade === "boolean") {\n return callAllDowngrade();\n }\n if (Array.isArray(mfDowngrade)) {\n if (!id) {\n globalThis[DOWNGRADE_KEY] = true;\n return callAllDowngrade();\n }\n if (!mfDowngrade.includes(id)) {\n mfDowngrade.push(id);\n }\n return callDowngrade(id);\n }\n};\nfunction injectDataFetch() {\n var _a;\n globalThis[_a = DATA_FETCH_FUNCTION] || (globalThis[_a] = []);\n const dataFetch = globalThis[DATA_FETCH_FUNCTION];\n if (dataFetch.push === dataFetchFunction) {\n return;\n }\n if (typeof window === "undefined") {\n return;\n }\n globalThis[FS_HREF] = window.location.href;\n dataFetch.push = dataFetchFunction;\n}\nconst getDocsUrl = (errorCode) => {\n return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;\n};\nconst getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {\n const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];\n args && msg.push(`args: ${JSON.stringify(args)}`);\n msg.push(getDocsUrl(errorCode));\n originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);\n return msg.join("\\n");\n};\nfunction logAndReport(code, descMap, args, logger2, originalErrorMsg, context) {\n return logger2(getShortErrorMsg(code, descMap, args, originalErrorMsg));\n}\nconst LOG_CATEGORY = "[ Federation Runtime ]";\nfunction assert(condition, msgOrCode, descMap, args, context) {\n if (!condition) error(msgOrCode);\n}\nfunction error(msgOrCode, descMap, args, originalErrorMsg, context) {\n if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg2) => {\n throw new Error(`${LOG_CATEGORY}: ${msg2}`);\n }, originalErrorMsg);\n const msg = msgOrCode;\n if (msg instanceof Error) {\n if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;\n throw msg;\n }\n throw new Error(`${LOG_CATEGORY}: ${msg}`);\n}\nconst processModuleAlias = (name, subPath) => {\n let moduleName;\n if (name.endsWith("/")) moduleName = name.slice(0, -1);\n else moduleName = name;\n if (subPath.startsWith(".")) subPath = subPath.slice(1);\n moduleName = moduleName + subPath;\n return moduleName;\n};\nconst CurrentGlobal = typeof globalThis === "object" ? globalThis : window;\nconst nativeGlobal = (() => {\n try {\n return document.defaultView;\n } catch {\n return CurrentGlobal;\n }\n})();\nfunction definePropertyGlobalVal(target, key, val) {\n Object.defineProperty(target, key, {\n value: val,\n configurable: false,\n writable: true\n });\n}\nfunction includeOwnProperty(target, key) {\n return Object.hasOwnProperty.call(target, key);\n}\nif (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});\nconst globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;\nfunction setGlobalDefaultVal(target) {\n var _a, _b, _c, _d, _e, _f;\n if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);\n if (!includeOwnProperty(target, "__FEDERATION__")) {\n definePropertyGlobalVal(target, "__FEDERATION__", {\n __GLOBAL_PLUGIN__: [],\n __INSTANCES__: [],\n moduleInfo: {},\n __SHARE__: {},\n __MANIFEST_LOADING__: {},\n __PRELOADED_MAP__: /* @__PURE__ */ new Map()\n });\n definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);\n }\n (_a = target.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (_a.__GLOBAL_PLUGIN__ = []);\n (_b = target.__FEDERATION__).__INSTANCES__ ?? (_b.__INSTANCES__ = []);\n (_c = target.__FEDERATION__).moduleInfo ?? (_c.moduleInfo = {});\n (_d = target.__FEDERATION__).__SHARE__ ?? (_d.__SHARE__ = {});\n (_e = target.__FEDERATION__).__MANIFEST_LOADING__ ?? (_e.__MANIFEST_LOADING__ = {});\n (_f = target.__FEDERATION__).__PRELOADED_MAP__ ?? (_f.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());\n}\nsetGlobalDefaultVal(CurrentGlobal);\nsetGlobalDefaultVal(nativeGlobal);\nconst getRemoteEntryExports = (name, globalName) => {\n const remoteEntryKey = globalName || `__FEDERATION_${name}:custom__`;\n return {\n remoteEntryKey,\n entryExports: CurrentGlobal[remoteEntryKey]\n };\n};\nconst DEFAULT_SCOPE = "default";\nconst DEFAULT_REMOTE_TYPE = "global";\nfunction composeRemoteRequestId(remoteName, expose) {\n if (!expose || expose === ".") return remoteName;\n return `${remoteName}/${expose.replace(/^\\.\\//, "")}`;\n}\nfunction matchRemoteWithNameAndExpose(remotes, id) {\n for (const remote of remotes) {\n const isNameMatched = id.startsWith(remote.name);\n let expose = id.replace(remote.name, "");\n if (isNameMatched) {\n if (expose.startsWith("/")) {\n const pkgNameOrAlias = remote.name;\n expose = `.${expose}`;\n return {\n pkgNameOrAlias,\n expose,\n remote\n };\n } else if (expose === "") return {\n pkgNameOrAlias: remote.name,\n expose: ".",\n remote\n };\n }\n const isAliasMatched = remote.alias && id.startsWith(remote.alias);\n let exposeWithAlias = remote.alias && id.replace(remote.alias, "");\n if (remote.alias && isAliasMatched) {\n if (exposeWithAlias && exposeWithAlias.startsWith("/")) {\n const pkgNameOrAlias = remote.alias;\n exposeWithAlias = `.${exposeWithAlias}`;\n return {\n pkgNameOrAlias,\n expose: exposeWithAlias,\n remote\n };\n } else if (exposeWithAlias === "") return {\n pkgNameOrAlias: remote.alias,\n expose: ".",\n remote\n };\n }\n }\n}\nconst RUNTIME_001 = "RUNTIME-001";\nconst RUNTIME_002 = "RUNTIME-002";\nconst RUNTIME_003 = "RUNTIME-003";\nconst RUNTIME_004 = "RUNTIME-004";\nconst RUNTIME_005 = "RUNTIME-005";\nconst RUNTIME_006 = "RUNTIME-006";\nconst RUNTIME_007 = "RUNTIME-007";\nconst RUNTIME_008 = "RUNTIME-008";\nconst RUNTIME_009 = "RUNTIME-009";\nconst RUNTIME_010 = "RUNTIME-010";\nconst RUNTIME_011 = "RUNTIME-011";\nconst RUNTIME_012 = "RUNTIME-012";\nconst RUNTIME_013 = "RUNTIME-013";\nconst RUNTIME_014 = "RUNTIME-014";\nconst RUNTIME_015 = "RUNTIME-015";\nconst runtimeDescMap = {\n [RUNTIME_001]: "Failed to get remoteEntry exports.",\n [RUNTIME_002]: \'The remote entry interface does not contain "init"\',\n [RUNTIME_003]: "Failed to get manifest.",\n [RUNTIME_004]: "Failed to locate remote.",\n [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",\n [RUNTIME_006]: "Invalid loadShareSync function call from runtime",\n [RUNTIME_007]: "Failed to get remote snapshot.",\n [RUNTIME_008]: "Failed to load script resources.",\n [RUNTIME_009]: "Please call createInstance first.",\n [RUNTIME_010]: \'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.\',\n [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",\n [RUNTIME_012]: \'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.\',\n [RUNTIME_013]: "The manifest is not a valid Module Federation manifest.",\n [RUNTIME_014]: "The remote does not expose the requested module.",\n [RUNTIME_015]: "Remote container initialization failed."\n};\n({\n ...runtimeDescMap\n});\nconst importCallback = ".then(callbacks[0]).catch(callbacks[1])";\nfunction isEsmRemoteType(type) {\n return type === "esm" || type === "module";\n}\nasync function loadEsmEntry({ entry, remoteEntryExports }) {\n return new Promise((resolve, reject) => {\n try {\n if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${entry}")${importCallback}`)([resolve, reject]);\n else import(\n /* webpackIgnore: true */\n /* @vite-ignore */\n entry\n ).then(resolve).catch(reject);\n else resolve(remoteEntryExports);\n } catch (e) {\n error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n }\n });\n}\nasync function loadSystemJsEntry({ entry, remoteEntryExports }) {\n return new Promise((resolve, reject) => {\n try {\n if (!remoteEntryExports) if (typeof __system_context__ === "undefined") System.import(entry).then(resolve).catch(reject);\n else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);\n else resolve(remoteEntryExports);\n } catch (e) {\n error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n }\n });\n}\nfunction handleRemoteEntryLoaded(name, globalName, entry) {\n const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);\n if (!entryExports) error(RUNTIME_001, runtimeDescMap, {\n remoteName: name,\n remoteEntryUrl: entry,\n remoteEntryKey\n });\n return entryExports;\n}\nasync function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook, getEntryUrl, resourceContext }) {\n const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);\n if (remoteEntryExports) return remoteEntryExports;\n const url = getEntryUrl ? getEntryUrl(entry) : entry;\n return loadScript(url, {\n attrs: {},\n createScriptHook: (url2, attrs) => {\n const res = loaderHook.lifecycle.createScript.emit({\n url: url2,\n attrs,\n remoteInfo,\n resourceContext: resourceContext ? {\n ...resourceContext,\n url: url2\n } : void 0\n });\n if (!res) return;\n if (res instanceof HTMLScriptElement) return res;\n if ("script" in res || "timeout" in res) return res;\n }\n }).then(() => {\n return handleRemoteEntryLoaded(name, globalName, entry);\n }, (loadError) => {\n const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);\n error(RUNTIME_008, runtimeDescMap, {\n remoteName: name,\n resourceUrl: url\n }, originalMsg);\n });\n}\nasync function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl, resourceContext }) {\n const { entry, entryGlobalName: globalName, name, type } = remoteInfo;\n if (isEsmRemoteType(type)) return loadEsmEntry({\n entry,\n remoteEntryExports\n });\n if (type === "system") return loadSystemJsEntry({\n entry,\n remoteEntryExports\n });\n return loadEntryScript({\n entry,\n globalName,\n name,\n remoteInfo,\n loaderHook,\n getEntryUrl,\n resourceContext\n });\n}\nasync function loadEntryNode({ remoteInfo, loaderHook, resourceContext }) {\n const { entry, entryGlobalName: globalName, name, type } = remoteInfo;\n const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);\n if (remoteEntryExports) return remoteEntryExports;\n return loadScriptNode(entry, {\n attrs: {\n name,\n globalName,\n type\n },\n loaderHook: { createScriptHook: (url, attrs = {}) => {\n const res = loaderHook.lifecycle.createScript.emit({\n url,\n attrs,\n remoteInfo,\n resourceContext: resourceContext ? {\n ...resourceContext,\n url\n } : void 0\n });\n if (!res) return;\n if ("url" in res) return res;\n } }\n }).then(() => {\n return handleRemoteEntryLoaded(name, globalName, entry);\n }).catch((e) => {\n error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error ? e.message : String(e)}`);\n });\n}\nfunction getRemoteEntryUniqueKey(remoteInfo) {\n const { entry, name } = remoteInfo;\n return composeKeyWithSeparator(name, entry);\n}\nasync function getRemoteEntry(params) {\n const { origin, remoteEntryExports, remoteInfo, getEntryUrl, resourceContext, _inErrorHandling = false } = params;\n const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);\n if (remoteEntryExports) return remoteEntryExports;\n if (!globalLoading[uniqueKey]) {\n const loadEntryHook = origin.remoteHandler.hooks.lifecycle.loadEntry;\n const loaderHook = origin.loaderHook;\n globalLoading[uniqueKey] = loadEntryHook.emit({\n origin,\n loaderHook,\n remoteInfo,\n remoteEntryExports\n }).then((res) => {\n if (res) return res;\n return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : isBrowserEnvValue) ? loadEntryDom({\n remoteInfo,\n remoteEntryExports,\n loaderHook,\n getEntryUrl,\n resourceContext\n }) : loadEntryNode({\n remoteInfo,\n loaderHook,\n resourceContext\n });\n }).then(async (res) => {\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n remoteEntryExports: res\n });\n return res;\n }).catch(async (err) => {\n const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);\n const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");\n if (err instanceof Error && err.message.includes(RUNTIME_008) && !isScriptExecutionError && !_inErrorHandling) {\n const wrappedGetRemoteEntry = (params2) => {\n return getRemoteEntry({\n ...params2,\n _inErrorHandling: true\n });\n };\n const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({\n getRemoteEntry: wrappedGetRemoteEntry,\n origin,\n remoteInfo,\n remoteEntryExports,\n globalLoading,\n uniqueKey: uniqueKey2\n });\n if (RemoteEntryExports) {\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n remoteEntryExports: RemoteEntryExports,\n recovered: true\n });\n return RemoteEntryExports;\n }\n }\n await origin.loaderHook.lifecycle.afterLoadEntry.emit({\n origin,\n remoteInfo,\n error: err\n });\n throw err;\n });\n }\n return globalLoading[uniqueKey];\n}\nfunction getRemoteInfo(remote) {\n return {\n ...remote,\n entry: "entry" in remote ? remote.entry : "",\n type: remote.type || DEFAULT_REMOTE_TYPE,\n entryGlobalName: remote.entryGlobalName || remote.name,\n shareScope: remote.shareScope || DEFAULT_SCOPE\n };\n}\nfunction remoteToEntry(r) {\n return {\n name: r.name,\n alias: r.alias,\n entry: "entry" in r ? r.entry : void 0,\n version: "version" in r ? r.version : void 0,\n type: r.type,\n entryGlobalName: r.entryGlobalName,\n shareScope: r.shareScope\n };\n}\nfunction optionsToMFContext(options) {\n var _a, _b, _c, _d, _e, _f;\n const shared = {};\n for (const [pkgName, versions] of Object.entries(options.shared)) {\n const first = versions[0];\n if (first) shared[pkgName] = {\n version: first.version,\n singleton: (_a = first.shareConfig) == null ? void 0 : _a.singleton,\n requiredVersion: ((_b = first.shareConfig) == null ? void 0 : _b.requiredVersion) === false ? false : (_c = first.shareConfig) == null ? void 0 : _c.requiredVersion,\n eager: first.eager,\n strictVersion: (_d = first.shareConfig) == null ? void 0 : _d.strictVersion\n };\n }\n return {\n project: {\n name: options.name,\n mfRole: ((_e = options.remotes) == null ? void 0 : _e.length) > 0 ? "host" : "unknown"\n },\n mfConfig: {\n name: options.name,\n remotes: ((_f = options.remotes) == null ? void 0 : _f.map(remoteToEntry)) ?? [],\n shared\n }\n };\n}\nfunction isTimeoutError(error2) {\n if (!(error2 instanceof Error)) return false;\n return error2.message.includes("timed out") || error2.name.includes("Timeout");\n}\nfunction createAssetResult(context, url, status, error2) {\n return {\n url,\n status,\n resourceType: context.resourceType,\n initiator: context.initiator,\n id: context.id,\n error: error2\n };\n}\nasync function waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, context) {\n const cachedRemote = host.moduleCache.get(entryRemoteInfo.name);\n const url = entryRemoteInfo.entry;\n if (cachedRemote == null ? void 0 : cachedRemote.remoteEntryExports) return createAssetResult(context, url, "cached");\n try {\n if (!await getRemoteEntry({\n origin: host,\n remoteInfo: entryRemoteInfo,\n remoteEntryExports: cachedRemote == null ? void 0 : cachedRemote.remoteEntryExports,\n resourceContext: {\n ...context,\n url\n }\n })) throw new Error(`Failed to load remoteEntry "${url}".`);\n return createAssetResult(context, url, "success");\n } catch (error2) {\n return createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2);\n }\n}\nfunction waitForLinkPreload({ host, remoteInfo, url, attrs, context, needDeleteLink }) {\n return new Promise((resolve) => {\n const { link, needAttach } = createLink({\n url,\n cb: () => {\n resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));\n },\n onErrorCallback: (error2) => {\n resolve(createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2));\n },\n attrs,\n createLinkHook: (hookUrl, hookAttrs) => {\n const res = host.loaderHook.lifecycle.createLink.emit({\n url: hookUrl,\n attrs: hookAttrs,\n remoteInfo,\n resourceContext: {\n ...context,\n url: hookUrl\n }\n });\n if (res instanceof HTMLLinkElement) return res;\n return res;\n },\n needDeleteLink\n });\n needAttach && document.head.appendChild(link);\n });\n}\nfunction waitForScriptPreload({ host, remoteInfo, url, attrs, context }) {\n return new Promise((resolve) => {\n const { script, needAttach } = createScript({\n url,\n cb: () => {\n resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));\n },\n onErrorCallback: (error2) => {\n resolve(createAssetResult(context, url, isTimeoutError(error2) ? "timeout" : "error", error2));\n },\n attrs,\n createScriptHook: (hookUrl, hookAttrs) => {\n const res = host.loaderHook.lifecycle.createScript.emit({\n url: hookUrl,\n attrs: hookAttrs,\n remoteInfo,\n resourceContext: {\n ...context,\n url: hookUrl\n }\n });\n if (res instanceof HTMLScriptElement) return res;\n return res;\n },\n needDeleteScript: true\n });\n needAttach && document.head.appendChild(script);\n });\n}\nfunction createResourceContext(baseContext, resourceType) {\n return {\n ...baseContext,\n resourceType\n };\n}\nfunction preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseContext = {\n initiator: "preloadRemote",\n id: remoteInfo.name\n}) {\n const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;\n const results = [];\n if (host.options.inBrowser) {\n entryAssets.forEach((asset) => {\n const { moduleInfo: entryRemoteInfo } = asset;\n results.push(waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, createResourceContext(baseContext, "remoteEntry")));\n });\n if (useLinkPreload) {\n const defaultAttrs2 = {\n rel: "preload",\n as: "style"\n };\n cssAssets.forEach((cssUrl) => {\n results.push(waitForLinkPreload({\n host,\n remoteInfo,\n url: cssUrl,\n attrs: defaultAttrs2,\n context: createResourceContext(baseContext, "css")\n }));\n });\n } else {\n const defaultAttrs2 = {\n rel: "stylesheet",\n type: "text/css"\n };\n cssAssets.forEach((cssUrl) => {\n results.push(waitForLinkPreload({\n host,\n remoteInfo,\n url: cssUrl,\n attrs: defaultAttrs2,\n needDeleteLink: false,\n context: createResourceContext(baseContext, "css")\n }));\n });\n }\n let preloadJsAsset = waitForScriptPreload;\n let defaultAttrs = {\n fetchpriority: "high",\n type: "text/javascript"\n };\n if (useLinkPreload) {\n preloadJsAsset = waitForLinkPreload;\n defaultAttrs = {\n rel: "preload",\n as: "script"\n };\n } else if (isEsmRemoteType(remoteInfo.type)) {\n preloadJsAsset = waitForLinkPreload;\n defaultAttrs = {\n rel: "modulepreload",\n fetchpriority: "high"\n };\n }\n jsAssetsWithoutEntry.forEach((jsUrl) => {\n results.push(preloadJsAsset({\n host,\n remoteInfo,\n url: jsUrl,\n attrs: defaultAttrs,\n context: createResourceContext(baseContext, "js")\n }));\n });\n }\n return Promise.all(results);\n}\nvar helpers_default = {\n utils: {\n matchRemoteWithNameAndExpose,\n preloadAssets,\n getRemoteInfo\n }\n};\nfunction getAvailableExposeNames(remoteSnapshot) {\n if (!remoteSnapshot || !("modules" in remoteSnapshot) || !Array.isArray(remoteSnapshot.modules)) return;\n const exposes = remoteSnapshot.modules.map((module) => module.moduleName).filter(Boolean);\n return exposes.length ? exposes.join(",") : void 0;\n}\nfunction createRemoteEntryInitOptions(remoteInfo, hostShareScopeMap, rawInitScope) {\n const localShareScopeMap = hostShareScopeMap;\n const shareScopeKeys = Array.isArray(remoteInfo.shareScope) ? remoteInfo.shareScope : [remoteInfo.shareScope];\n if (!shareScopeKeys.length) shareScopeKeys.push("default");\n shareScopeKeys.forEach((shareScopeKey) => {\n if (!localShareScopeMap[shareScopeKey]) localShareScopeMap[shareScopeKey] = {};\n });\n const remoteEntryInitOptions = {\n version: remoteInfo.version || "",\n shareScopeKeys: Array.isArray(remoteInfo.shareScope) ? shareScopeKeys : remoteInfo.shareScope || "default"\n };\n Object.defineProperty(remoteEntryInitOptions, "shareScopeMap", {\n value: localShareScopeMap,\n enumerable: false\n });\n return {\n remoteEntryInitOptions,\n shareScope: localShareScopeMap[shareScopeKeys[0]],\n initScope: rawInitScope ?? []\n };\n}\nvar Module$1 = class {\n constructor({ remoteInfo, host }) {\n this.inited = false;\n this.initing = false;\n this.lib = void 0;\n this.remoteInfo = remoteInfo;\n this.host = host;\n }\n async getEntry(expose) {\n if (this.remoteEntryExports) return this.remoteEntryExports;\n const remoteEntryExports = await getRemoteEntry({\n origin: this.host,\n remoteInfo: this.remoteInfo,\n remoteEntryExports: this.remoteEntryExports,\n resourceContext: {\n initiator: "loadRemote",\n id: composeRemoteRequestId(this.remoteInfo.name, expose),\n resourceType: "remoteEntry"\n }\n });\n assert(remoteEntryExports, `remoteEntryExports is undefined \n ${safeToString(this.remoteInfo)}`);\n this.remoteEntryExports = remoteEntryExports;\n return this.remoteEntryExports;\n }\n async init(id, remoteSnapshot, rawInitScope, expose) {\n const remoteEntryExports = await this.getEntry(expose);\n if (this.inited) {\n await this.host.loaderHook.lifecycle.afterInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n remoteEntryExports,\n cached: true,\n origin: this.host\n });\n return remoteEntryExports;\n }\n if (this.initPromise) {\n try {\n await this.initPromise;\n await this.host.loaderHook.lifecycle.afterInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n remoteEntryExports,\n cached: true,\n origin: this.host\n });\n } catch (initError) {\n await this.host.loaderHook.lifecycle.afterInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n remoteEntryExports,\n error: initError,\n cached: true,\n origin: this.host\n });\n throw initError;\n }\n return remoteEntryExports;\n }\n this.initing = true;\n this.initPromise = (async () => {\n await this.host.loaderHook.lifecycle.beforeInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n origin: this.host\n });\n const { remoteEntryInitOptions, shareScope, initScope } = createRemoteEntryInitOptions(this.remoteInfo, this.host.shareScopeMap, rawInitScope);\n const initContainerOptions = await this.host.hooks.lifecycle.beforeInitContainer.emit({\n shareScope,\n remoteEntryInitOptions,\n initScope,\n remoteInfo: this.remoteInfo,\n origin: this.host\n });\n if (typeof (remoteEntryExports == null ? void 0 : remoteEntryExports.init) === "undefined") error(RUNTIME_002, runtimeDescMap, {\n hostName: this.host.name,\n remoteName: this.remoteInfo.name,\n remoteEntryUrl: this.remoteInfo.entry,\n remoteEntryKey: this.remoteInfo.entryGlobalName\n }, void 0, optionsToMFContext(this.host.options));\n try {\n await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);\n } catch (initError) {\n error(RUNTIME_015, runtimeDescMap, {\n hostName: this.host.name,\n remoteName: this.remoteInfo.name,\n remoteEntryUrl: this.remoteInfo.entry,\n remoteEntryKey: this.remoteInfo.entryGlobalName,\n shareScope: this.remoteInfo.shareScope\n }, `${initError}`, optionsToMFContext(this.host.options));\n }\n await this.host.hooks.lifecycle.initContainer.emit({\n ...initContainerOptions,\n id,\n remoteSnapshot,\n remoteEntryExports\n });\n this.inited = true;\n })();\n try {\n await this.initPromise;\n await this.host.loaderHook.lifecycle.afterInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n remoteEntryExports,\n origin: this.host\n });\n } catch (initError) {\n await this.host.loaderHook.lifecycle.afterInitRemote.emit({\n id,\n remoteInfo: this.remoteInfo,\n remoteSnapshot,\n remoteEntryExports,\n error: initError,\n origin: this.host\n });\n throw initError;\n } finally {\n this.initing = false;\n this.initPromise = void 0;\n }\n return remoteEntryExports;\n }\n async get(id, expose, options, remoteSnapshot) {\n const { loadFactory = true } = options || { loadFactory: true };\n const remoteEntryExports = await this.init(id, remoteSnapshot, void 0, expose);\n this.lib = remoteEntryExports;\n await this.host.loaderHook.lifecycle.beforeGetExpose.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n remoteEntryExports,\n origin: this.host\n });\n let moduleFactory;\n try {\n const hookModuleFactory = await this.host.loaderHook.lifecycle.getModuleFactory.emit({\n remoteEntryExports,\n expose,\n moduleInfo: this.remoteInfo\n });\n moduleFactory = typeof hookModuleFactory === "function" ? hookModuleFactory : void 0;\n if (!moduleFactory) moduleFactory = await remoteEntryExports.get(expose);\n if (!moduleFactory) error(RUNTIME_014, runtimeDescMap, {\n hostName: this.host.name,\n remoteName: this.remoteInfo.name,\n remoteEntryUrl: this.remoteInfo.entry,\n expose,\n requestId: id,\n availableExposes: getAvailableExposeNames(remoteSnapshot)\n }, void 0, optionsToMFContext(this.host.options));\n await this.host.loaderHook.lifecycle.afterGetExpose.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n remoteEntryExports,\n moduleFactory,\n origin: this.host\n });\n } catch (getExposeError) {\n await this.host.loaderHook.lifecycle.afterGetExpose.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n remoteEntryExports,\n error: getExposeError,\n origin: this.host\n });\n throw getExposeError;\n }\n const symbolName = processModuleAlias(this.remoteInfo.name, expose);\n const wrapModuleFactory = this.wraperFactory(moduleFactory, symbolName);\n if (!loadFactory) return wrapModuleFactory;\n await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n loadFactory,\n origin: this.host\n });\n try {\n const exposeContent = await wrapModuleFactory();\n await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n loadFactory,\n exposeModule: exposeContent,\n origin: this.host\n });\n return exposeContent;\n } catch (executeFactoryError) {\n await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({\n id,\n expose,\n moduleInfo: this.remoteInfo,\n loadFactory,\n error: executeFactoryError,\n origin: this.host\n });\n throw executeFactoryError;\n }\n }\n wraperFactory(moduleFactory, id) {\n function defineModuleId(res, id2) {\n if (res && typeof res === "object" && Object.isExtensible(res) && !Object.getOwnPropertyDescriptor(res, Symbol.for("mf_module_id"))) Object.defineProperty(res, Symbol.for("mf_module_id"), {\n value: id2,\n enumerable: false\n });\n }\n return () => {\n const res = moduleFactory();\n if (res instanceof Promise) return res.then((asyncRes) => {\n defineModuleId(asyncRes, id);\n return asyncRes;\n });\n defineModuleId(res, id);\n return res;\n };\n }\n};\nconst REMOTE_DISABLED_MESSAGE = "Remote loading is disabled by experiments.optimization.disableRemote.";\nvar UnavailableRemoteModule = class {\n constructor() {\n throw new Error(REMOTE_DISABLED_MESSAGE);\n }\n};\ntypeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;\ntypeof FEDERATION_OPTIMIZE_NO_REMOTE === "boolean" ? !FEDERATION_OPTIMIZE_NO_REMOTE : true;\ntypeof FEDERATION_OPTIMIZE_NO_SHARED === "boolean" ? !FEDERATION_OPTIMIZE_NO_SHARED : true;\nconst helpers = helpers_default;\ntypeof FEDERATION_OPTIMIZE_NO_REMOTE === "boolean" && FEDERATION_OPTIMIZE_NO_REMOTE ? UnavailableRemoteModule : Module$1;\nconst utils = helpers.utils;\nconst runtimeHelpers = {\n utils\n};\nasync function prefetch(options) {\n const { instance, id, dataFetchParams, preloadComponentResource } = options;\n if (!id) {\n logger.error("id is required for prefetch!");\n return;\n }\n if (!instance) {\n logger.error("instance is required for prefetch!");\n return;\n }\n const matchedRemoteInfo = runtimeHelpers.utils.matchRemoteWithNameAndExpose(\n instance.options.remotes,\n id\n );\n if (!matchedRemoteInfo) {\n logger.error(`Can not found \'${id}\' in instance.options.remotes!`);\n return;\n }\n const { remote, expose } = matchedRemoteInfo;\n const { remoteSnapshot, globalSnapshot } = await instance.snapshotHandler.loadRemoteSnapshotInfo({\n moduleInfo: remote,\n id\n });\n if (preloadComponentResource) {\n const remoteInfo = runtimeHelpers.utils.getRemoteInfo(remote);\n Promise.resolve(\n instance.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({\n origin: instance,\n preloadOptions: {\n remote,\n preloadConfig: {\n nameOrAlias: remote.name,\n exposes: [expose]\n }\n },\n remote,\n remoteInfo,\n globalSnapshot,\n remoteSnapshot\n })\n ).then((assets) => {\n if (assets) {\n runtimeHelpers.utils.preloadAssets(remoteInfo, instance, assets);\n }\n });\n }\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n const dataFetchInfo = getDataFetchInfo({\n name: remote.name,\n alias: remote.alias,\n id,\n remoteSnapshot\n });\n const dataFetchMapKey = getDataFetchMapKey(dataFetchInfo, {\n name: instance.name,\n version: instance.options.version\n });\n if (!dataFetchMapKey) {\n return;\n }\n const dataFetchItem = dataFetchMap[dataFetchMapKey];\n if (!dataFetchItem) {\n return;\n }\n const [getDataFetchGetter, _type, getDataFetchPromise] = dataFetchItem[0];\n let _getDataFetchPromise = getDataFetchPromise;\n if (!getDataFetchPromise) {\n if (!getDataFetchGetter) {\n return;\n }\n _getDataFetchPromise = getDataFetchGetter();\n }\n _getDataFetchPromise.then((dataFetchFn) => {\n return dataFetchFn({\n ...dataFetchParams,\n _id: dataFetchMapKey,\n isDowngrade: false\n });\n });\n}\nexport {\n dataFetchFunction as d,\n injectDataFetch as i,\n prefetch as p\n};\n',"size-limited-cache.es.js":'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\nclass SizeLimitedCache {\n constructor(options) {\n __publicField(this, "maxSize");\n __publicField(this, "entries", /* @__PURE__ */ new Map());\n __publicField(this, "sizeCalculation");\n __publicField(this, "currentSize", 0);\n if (!Number.isInteger(options.maxSize) || options.maxSize <= 0) {\n throw new TypeError("maxSize must be a positive integer");\n }\n this.maxSize = options.maxSize;\n this.sizeCalculation = options.sizeCalculation;\n }\n get size() {\n return this.entries.size;\n }\n get calculatedSize() {\n return this.currentSize;\n }\n get(key) {\n const entry = this.entries.get(key);\n if (!entry) {\n return void 0;\n }\n this.refresh(key, entry);\n return entry.value;\n }\n has(key) {\n const entry = this.entries.get(key);\n if (!entry) {\n return false;\n }\n this.refresh(key, entry);\n return true;\n }\n set(key, value, options = {}) {\n var _a;\n const entrySize = options.size ?? ((_a = this.sizeCalculation) == null ? void 0 : _a.call(this, value, key)) ?? 1;\n if (!Number.isInteger(entrySize) || entrySize <= 0) {\n throw new TypeError("entry size must be a positive integer");\n }\n this.delete(key);\n if (entrySize > this.maxSize) {\n return this;\n }\n this.entries.set(key, { value, size: entrySize });\n this.currentSize += entrySize;\n this.evictUntilWithinLimit();\n return this;\n }\n delete(key) {\n const entry = this.entries.get(key);\n if (!entry) {\n return false;\n }\n this.currentSize -= entry.size;\n return this.entries.delete(key);\n }\n clear() {\n this.entries.clear();\n this.currentSize = 0;\n }\n refresh(key, entry) {\n this.entries.delete(key);\n this.entries.set(key, entry);\n }\n evictUntilWithinLimit() {\n while (this.currentSize > this.maxSize) {\n const oldest = this.entries.keys().next();\n if (oldest.done) {\n this.currentSize = 0;\n return;\n }\n this.delete(oldest.value);\n }\n }\n}\nexport {\n SizeLimitedCache\n};\n',"utils-BBP3hEeV.mjs":'import { S as SEPARATOR, c as createLogger, i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";\nimport { SizeLimitedCache } from "./size-limited-cache.es.js";\nconst LOG_CATEGORY = "[ Federation Runtime ]";\nconst composeKeyWithSeparator = function(...args) {\n if (!args.length) return "";\n return args.reduce((sum, cur) => {\n if (!cur) return sum;\n if (!sum) return cur;\n return `${sum}${SEPARATOR}${cur}`;\n }, "");\n};\nconst warn = (msg) => {\n console.warn(`${LOG_CATEGORY}: ${msg}`);\n};\nfunction safeToString(info) {\n try {\n return JSON.stringify(info, null, 2);\n } catch (e) {\n return "";\n }\n}\nconst PLUGIN_IDENTIFIER = "[ Module Federation React ]";\nconst DOWNGRADE_KEY = "_mfSSRDowngrade";\nconst DATA_FETCH_FUNCTION = "_mfDataFetch";\nconst FS_HREF = "_mfFSHref";\nconst ERROR_TYPE = {\n DATA_FETCH: 1,\n LOAD_REMOTE: 2,\n UNKNOWN: 3\n};\nconst WRAP_DATA_FETCH_ID_IDENTIFIER = "wrap_dfip_identifier";\nvar MF_DATA_FETCH_TYPE = /* @__PURE__ */ ((MF_DATA_FETCH_TYPE2) => {\n MF_DATA_FETCH_TYPE2[MF_DATA_FETCH_TYPE2["FETCH_SERVER"] = 1] = "FETCH_SERVER";\n MF_DATA_FETCH_TYPE2[MF_DATA_FETCH_TYPE2["FETCH_CLIENT"] = 2] = "FETCH_CLIENT";\n return MF_DATA_FETCH_TYPE2;\n})(MF_DATA_FETCH_TYPE || {});\nvar MF_DATA_FETCH_STATUS = /* @__PURE__ */ ((MF_DATA_FETCH_STATUS2) => {\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["LOADED"] = 1] = "LOADED";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["LOADING"] = 2] = "LOADING";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["AWAIT"] = 0] = "AWAIT";\n MF_DATA_FETCH_STATUS2[MF_DATA_FETCH_STATUS2["ERROR"] = 3] = "ERROR";\n return MF_DATA_FETCH_STATUS2;\n})(MF_DATA_FETCH_STATUS || {});\nconst DATA_FETCH_IDENTIFIER = "data";\nconst DATA_FETCH_CLIENT_SUFFIX = ".client";\nconst DATA_FETCH_QUERY = "x-mf-data-fetch";\nconst DATA_FETCH_ERROR_PREFIX = "caught the following error during dataFetch: ";\nconst LOAD_REMOTE_ERROR_PREFIX = "caught the following error during loadRemote: ";\nconst logger = createLogger(PLUGIN_IDENTIFIER);\nconst CacheSize = {\n KB: 1024,\n MB: 1024 * 1024,\n GB: 1024 * 1024 * 1024\n};\nconst CacheTime = {\n SECOND: 1e3,\n MINUTE: 60 * 1e3,\n HOUR: 60 * 60 * 1e3,\n DAY: 24 * 60 * 60 * 1e3,\n WEEK: 7 * 24 * 60 * 60 * 1e3,\n MONTH: 30 * 24 * 60 * 60 * 1e3\n};\nfunction getTagKeyMap() {\n const dataFetchCache = getDataFetchCache();\n if (!dataFetchCache || !dataFetchCache.tagKeyMap) {\n const tagKeyMap = /* @__PURE__ */ new Map();\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.tagKeyMap = tagKeyMap;\n return tagKeyMap;\n }\n return dataFetchCache.tagKeyMap;\n}\nfunction addTagKeyRelation(tag, key) {\n const tagKeyMap = getTagKeyMap();\n let keys = tagKeyMap.get(tag);\n if (!keys) {\n keys = /* @__PURE__ */ new Set();\n tagKeyMap.set(tag, keys);\n }\n keys.add(key);\n}\nfunction getCacheConfig() {\n const dataFetchCache = getDataFetchCache();\n if (!dataFetchCache || !dataFetchCache.cacheConfig) {\n const cacheConfig = {\n maxSize: CacheSize.GB\n };\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.cacheConfig = cacheConfig;\n return cacheConfig;\n }\n return dataFetchCache.cacheConfig;\n}\nfunction configureCache(config) {\n const cacheConfig = getCacheConfig();\n Object.assign(cacheConfig, config);\n}\nfunction getSizeLimitedCache() {\n const dataFetchCache = getDataFetchCache();\n const cacheConfig = getCacheConfig();\n if (!dataFetchCache || !dataFetchCache.cacheStore) {\n const cacheStore = new SizeLimitedCache({\n maxSize: cacheConfig.maxSize ?? CacheSize.GB,\n sizeCalculation: (value) => {\n if (!value.size) {\n return 1;\n }\n let size = 0;\n for (const [k, item] of value.entries()) {\n size += k.length * 2;\n size += estimateObjectSize(item.data);\n size += 8;\n }\n return size;\n }\n });\n globalThis.__MF_DATA_FETCH_CACHE__ || (globalThis.__MF_DATA_FETCH_CACHE__ = {});\n globalThis.__MF_DATA_FETCH_CACHE__.cacheStore = cacheStore;\n return cacheStore;\n }\n return dataFetchCache.cacheStore;\n}\nfunction estimateObjectSize(data) {\n const type = typeof data;\n if (type === "number") return 8;\n if (type === "boolean") return 4;\n if (type === "string") return Math.max(data.length * 2, 1);\n if (data === null || data === void 0) return 1;\n if (ArrayBuffer.isView(data)) {\n return Math.max(data.byteLength, 1);\n }\n if (Array.isArray(data)) {\n return Math.max(\n data.reduce((acc, item) => acc + estimateObjectSize(item), 0),\n 1\n );\n }\n if (data instanceof Map || data instanceof Set) {\n return 1024;\n }\n if (data instanceof Date) {\n return 8;\n }\n if (type === "object") {\n return Math.max(\n Object.entries(data).reduce(\n (acc, [key, value]) => acc + key.length * 2 + estimateObjectSize(value),\n 0\n ),\n 1\n );\n }\n return 1;\n}\nfunction generateKey(dataFetchOptions) {\n return JSON.stringify(dataFetchOptions, (_, value) => {\n if (value && typeof value === "object" && !Array.isArray(value)) {\n return Object.keys(value).sort().reduce((result, key) => {\n result[key] = value[key];\n return result;\n }, {});\n }\n return value;\n });\n}\nfunction cache(fn, options) {\n const {\n tag = "default",\n maxAge = CacheTime.MINUTE * 5,\n revalidate = 0,\n onCache,\n getKey\n } = options || {};\n const tags = Array.isArray(tag) ? tag : [tag];\n return async (dataFetchOptions) => {\n if (dataFetchOptions.isDowngrade || !dataFetchOptions._id) {\n return fn(dataFetchOptions);\n }\n const store = getSizeLimitedCache();\n const now = Date.now();\n const storeKey = dataFetchOptions._id;\n const cacheKey = getKey ? getKey(dataFetchOptions) : generateKey(dataFetchOptions);\n tags.forEach((t) => addTagKeyRelation(t, cacheKey));\n let cacheStore = store.get(cacheKey);\n if (!cacheStore) {\n cacheStore = /* @__PURE__ */ new Map();\n }\n const cached = cacheStore.get(storeKey);\n if (cached) {\n const age = now - cached.timestamp;\n if (age < maxAge) {\n if (onCache) {\n const useCache = onCache({\n status: "hit",\n key: cacheKey,\n params: dataFetchOptions,\n result: cached.data\n });\n if (!useCache) {\n return fn(dataFetchOptions);\n }\n }\n return cached.data;\n }\n if (revalidate > 0 && age < maxAge + revalidate) {\n if (onCache) {\n onCache({\n status: "stale",\n key: cacheKey,\n params: dataFetchOptions,\n result: cached.data\n });\n }\n if (!cached.isRevalidating) {\n cached.isRevalidating = true;\n Promise.resolve().then(async () => {\n try {\n const newData = await fn(dataFetchOptions);\n cacheStore.set(storeKey, {\n data: newData,\n timestamp: Date.now(),\n isRevalidating: false\n });\n store.set(cacheKey, cacheStore);\n } catch (error) {\n cached.isRevalidating = false;\n console.error("Background revalidation failed:", error);\n }\n });\n }\n return cached.data;\n }\n }\n const data = await fn(dataFetchOptions);\n cacheStore.set(storeKey, {\n data,\n timestamp: now,\n isRevalidating: false\n });\n store.set(cacheKey, cacheStore);\n if (onCache) {\n onCache({\n status: "miss",\n key: cacheKey,\n params: dataFetchOptions,\n result: data\n });\n }\n return data;\n };\n}\nfunction revalidateTag(tag) {\n const tagKeyMap = getTagKeyMap();\n const keys = tagKeyMap.get(tag);\n const cacheStore = getSizeLimitedCache();\n if (keys) {\n keys.forEach((key) => {\n cacheStore == null ? void 0 : cacheStore.delete(key);\n });\n }\n}\nfunction clearStore() {\n var _a;\n const cacheStore = getSizeLimitedCache();\n const tagKeyMap = getTagKeyMap();\n cacheStore == null ? void 0 : cacheStore.clear();\n (_a = globalThis.__MF_DATA_FETCH_CACHE__) == null ? true : delete _a.cacheStore;\n tagKeyMap.clear();\n}\nconst getDataFetchInfo = ({\n name,\n alias,\n id,\n remoteSnapshot\n}) => {\n if (!remoteSnapshot) {\n return;\n }\n if (!("modules" in remoteSnapshot)) {\n return;\n }\n const regex = new RegExp(`^${name}(/[^/].*|)$`);\n const nameOrAlias = regex.test(id) ? name : alias || name;\n const expose = id.replace(nameOrAlias, "");\n let dataFetchName = "";\n let dataFetchId = "";\n let dataFetchKey = "";\n if (expose.startsWith("/")) {\n dataFetchName = `${expose.slice(1)}.${DATA_FETCH_IDENTIFIER}`;\n dataFetchId = `${id}.${DATA_FETCH_IDENTIFIER}`;\n dataFetchKey = `${name}${expose}.${DATA_FETCH_IDENTIFIER}`;\n } else if (expose === "") {\n dataFetchName = DATA_FETCH_IDENTIFIER;\n dataFetchId = `${id}/${DATA_FETCH_IDENTIFIER}`;\n dataFetchKey = `${name}/${DATA_FETCH_IDENTIFIER}`;\n } else {\n return;\n }\n if (!dataFetchName || !dataFetchId || !dataFetchKey) {\n return;\n }\n if (!remoteSnapshot.modules.find(\n (module) => module.moduleName === dataFetchName\n )) {\n return;\n }\n return {\n dataFetchName,\n dataFetchId,\n dataFetchKey\n };\n};\nfunction initDataFetchMap() {\n globalThis.__MF_DATA_FETCH_MAP__ || (globalThis.__MF_DATA_FETCH_MAP__ = {});\n}\nfunction getDataFetchItem(id) {\n var _a;\n return (_a = globalThis.__MF_DATA_FETCH_MAP__) == null ? void 0 : _a[id];\n}\nfunction getDataFetchMap() {\n return globalThis.__MF_DATA_FETCH_MAP__;\n}\nfunction getDataFetchCache() {\n return globalThis.__MF_DATA_FETCH_CACHE__;\n}\nconst flushDataFetch = () => {\n globalThis.__MF_DATA_FETCH_MAP__ = {};\n globalThis[DOWNGRADE_KEY] = void 0;\n clearStore();\n};\nfunction setDataFetchItemLoadedStatus(id) {\n const dataFetchItem = getDataFetchItem(id);\n if (!dataFetchItem) {\n return;\n }\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.LOADED;\n}\nconst wrapDataFetchId = (id) => {\n return `${WRAP_DATA_FETCH_ID_IDENTIFIER}${id}${WRAP_DATA_FETCH_ID_IDENTIFIER}`;\n};\nconst getDataFetchIdWithErrorMsgs = (errMsgs) => {\n const firstIdentifierIndex = errMsgs.indexOf(WRAP_DATA_FETCH_ID_IDENTIFIER);\n if (firstIdentifierIndex === -1) {\n return void 0;\n }\n const secondIdentifierIndex = errMsgs.indexOf(\n WRAP_DATA_FETCH_ID_IDENTIFIER,\n firstIdentifierIndex + WRAP_DATA_FETCH_ID_IDENTIFIER.length\n );\n if (secondIdentifierIndex === -1) {\n return void 0;\n }\n return errMsgs.substring(\n firstIdentifierIndex + WRAP_DATA_FETCH_ID_IDENTIFIER.length,\n secondIdentifierIndex\n );\n};\nasync function fetchData(id, params, remoteInfo) {\n var _a;\n const callFetchData = async () => {\n const item = getDataFetchItem(id);\n if (!item) {\n return;\n }\n const [fetchDataFnArr, ..._rest] = item;\n const fetchDataFn = await fetchDataFnArr[2];\n if (!fetchDataFn) {\n return;\n }\n return fetchDataFn({\n ...params,\n _id: id\n });\n };\n if (isBrowserEnvValue) {\n const dataFetchItem = getDataFetchItem(id);\n if (!dataFetchItem) {\n throw new Error(`dataFetchItem not found, id: ${id}`);\n }\n if ((_a = dataFetchItem[1]) == null ? void 0 : _a[0]) {\n return dataFetchItem[1][0];\n }\n if (isCSROnly()) {\n logger.debug("==========csr only!");\n return callFetchData();\n }\n if (remoteInfo) {\n return callDowngrade(id, params, remoteInfo);\n }\n const mfDowngrade = getDowngradeTag();\n if (mfDowngrade && (typeof mfDowngrade === "boolean" || mfDowngrade.includes(id))) {\n return callDowngrade(id, { ...params, isDowngrade: true });\n }\n let res;\n let rej;\n const p = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n dataFetchItem[1] = [p, res, rej];\n dataFetchItem[2] = MF_DATA_FETCH_STATUS.AWAIT;\n return dataFetchItem[1][0];\n }\n return callFetchData();\n}\nfunction getDataFetchMapKey(dataFetchInfo, hostInfo) {\n if (!dataFetchInfo || !hostInfo) {\n return;\n }\n const { dataFetchKey } = dataFetchInfo;\n return composeKeyWithSeparator(dataFetchKey, hostInfo.name, hostInfo.version);\n}\nasync function loadDataFetchModule(instance, id) {\n return instance.loadRemote(id).then((m) => {\n if (m && typeof m === "object" && "fetchData" in m && typeof m.fetchData === "function") {\n return m.fetchData;\n }\n throw new Error(\n `fetchData not found in remote ${id}, ${JSON.stringify(m)}`\n );\n });\n}\nfunction isDataLoaderExpose(exposeKey) {\n return exposeKey.endsWith(DATA_FETCH_IDENTIFIER) || exposeKey.endsWith(DATA_FETCH_CLIENT_SUFFIX);\n}\nfunction getDowngradeTag() {\n return globalThis[DOWNGRADE_KEY];\n}\nfunction callAllDowngrade() {\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n Object.keys(dataFetchMap).forEach((key) => {\n callDowngrade(key);\n });\n}\nasync function callDowngrade(id, params, remoteInfo) {\n const dataFetchMap = getDataFetchMap();\n if (!dataFetchMap) {\n return;\n }\n const mfDataFetch = dataFetchMap[id];\n if ((mfDataFetch == null ? void 0 : mfDataFetch[2]) === MF_DATA_FETCH_STATUS.AWAIT) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADING;\n let promise;\n let res;\n let rej;\n if (mfDataFetch[1]) {\n promise = mfDataFetch[1][0];\n res = mfDataFetch[1][1];\n rej = mfDataFetch[1][2];\n } else {\n promise = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n mfDataFetch[1] = [promise, res, rej];\n }\n const dataFetchType = mfDataFetch[0][1];\n if (dataFetchType === MF_DATA_FETCH_TYPE.FETCH_CLIENT) {\n try {\n mfDataFetch[0][0]().then(async (getDataFetchFn) => {\n return getDataFetchFn({\n ...params,\n isDowngrade: true,\n _id: id\n }).then((data) => {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADED;\n res && res(data);\n });\n });\n } catch (e) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.ERROR;\n rej && rej(e);\n }\n } else if (dataFetchType === MF_DATA_FETCH_TYPE.FETCH_SERVER) {\n try {\n const currentUrl = new URL(window.location.href);\n currentUrl.searchParams.set(DATA_FETCH_QUERY, encodeURIComponent(id));\n if (params) {\n currentUrl.searchParams.set(\n "params",\n encodeURIComponent(JSON.stringify(params))\n );\n }\n if (remoteInfo) {\n currentUrl.searchParams.set(\n "remoteInfo",\n encodeURIComponent(JSON.stringify(remoteInfo))\n );\n }\n const fetchServerQuery = globalThis.FEDERATION_SERVER_QUERY;\n if (fetchServerQuery && typeof fetchServerQuery === "object") {\n Object.keys(fetchServerQuery).forEach((key) => {\n currentUrl.searchParams.set(\n key,\n JSON.stringify(fetchServerQuery[key])\n );\n });\n }\n const fetchUrl = currentUrl.toString();\n const data = await fetch(fetchUrl).then((res2) => res2.json());\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.LOADED;\n res && res(data);\n } catch (e) {\n mfDataFetch[2] = MF_DATA_FETCH_STATUS.ERROR;\n rej && rej(e);\n }\n }\n return promise;\n }\n}\nfunction isCSROnly() {\n return window._SSR_DATA === void 0;\n}\nfunction isServerEnv() {\n return typeof window === "undefined";\n}\nfunction setSSREnv({\n fetchServerQuery\n}) {\n globalThis.FEDERATION_SSR = true;\n globalThis.FEDERATION_SERVER_QUERY = fetchServerQuery;\n}\nfunction getLoadedRemoteInfos(id, instance) {\n if (!instance) {\n return;\n }\n const { name, expose } = instance.remoteHandler.idToRemoteMap[id] || {};\n if (!name) {\n return;\n }\n const module = instance.moduleCache.get(name);\n if (!module) {\n return;\n }\n const { remoteSnapshot } = instance.snapshotHandler.getGlobalRemoteInfo(\n module.remoteInfo\n );\n return {\n ...module.remoteInfo,\n snapshot: remoteSnapshot,\n expose\n };\n}\nexport {\n setDataFetchItemLoadedStatus as A,\n warn as B,\n CacheSize as C,\n DATA_FETCH_QUERY as D,\n ERROR_TYPE as E,\n FS_HREF as F,\n DOWNGRADE_KEY as G,\n callAllDowngrade as H,\n callDowngrade as I,\n getDowngradeTag as J,\n composeKeyWithSeparator as K,\n LOAD_REMOTE_ERROR_PREFIX as L,\n MF_DATA_FETCH_STATUS as M,\n safeToString as N,\n getDataFetchCache as O,\n CacheTime as a,\n clearStore as b,\n cache as c,\n configureCache as d,\n getDataFetchMap as e,\n flushDataFetch as f,\n generateKey as g,\n fetchData as h,\n initDataFetchMap as i,\n loadDataFetchModule as j,\n isDataLoaderExpose as k,\n logger as l,\n getDataFetchInfo as m,\n getDataFetchMapKey as n,\n getDataFetchItem as o,\n DATA_FETCH_CLIENT_SUFFIX as p,\n MF_DATA_FETCH_TYPE as q,\n revalidateTag as r,\n setSSREnv as s,\n isCSROnly as t,\n isServerEnv as u,\n getDataFetchIdWithErrorMsgs as v,\n DATA_FETCH_ERROR_PREFIX as w,\n wrapDataFetchId as x,\n DATA_FETCH_FUNCTION as y,\n getLoadedRemoteInfos as z\n};\n'};const ENTRY_FILE="entry.ts";const APP_FILE="app.tsx";const BRIDGE_ROOT="bridge";const BRIDGE_INDEX_FILE=`${BRIDGE_ROOT}/index.es.js`;const BRIDGE_ROUTER_STUB_FILE=`${BRIDGE_ROOT}/react-router-dom-stub.js`;const BRIDGE_ROUTER_STUB_SOURCE=`export function useLocation() {
|
|
386
386
|
throw new Error('react-router-dom is not available in playground bridge runtime.');
|
|
387
387
|
}
|
|
388
388
|
export const useRouteMatch = undefined;
|
|
@@ -413,7 +413,7 @@ export default ReactDOM;
|
|
|
413
413
|
export const createRoot = ReactDOM.createRoot;
|
|
414
414
|
export const render = ReactDOM.render;
|
|
415
415
|
export const unmountComponentAtNode = ReactDOM.unmountComponentAtNode;
|
|
416
|
-
`;const BRIDGE_SHIM_MODULES={react:BRIDGE_REACT_SHIM_SOURCE,"react-dom":BRIDGE_REACT_DOM_SHIM_SOURCE,"react-dom/client":BRIDGE_REACT_DOM_SHIM_SOURCE};function buildBridgeRuntimeFiles(){return{...Object.fromEntries(Object.entries(BRIDGE_RUNTIME_FILES).map(([filename,source])=>[`${BRIDGE_ROOT}/${filename}`,String(source).replace(/(["'])react-router-dom\1/g,"$1./react-router-dom-stub.js$1")])),[BRIDGE_ROUTER_STUB_FILE]:BRIDGE_ROUTER_STUB_SOURCE}}function transpileModule(filename,source){const result=
|
|
416
|
+
`;const BRIDGE_SHIM_MODULES={react:BRIDGE_REACT_SHIM_SOURCE,"react-dom":BRIDGE_REACT_DOM_SHIM_SOURCE,"react-dom/client":BRIDGE_REACT_DOM_SHIM_SOURCE};function buildBridgeRuntimeFiles(){return{...Object.fromEntries(Object.entries(BRIDGE_RUNTIME_FILES).map(([filename,source])=>[`${BRIDGE_ROOT}/${filename}`,String(source).replace(/(["'])react-router-dom\1/g,"$1./react-router-dom-stub.js$1")])),[BRIDGE_ROUTER_STUB_FILE]:BRIDGE_ROUTER_STUB_SOURCE}}function transpileModule(filename,source){const result=typescript.transpileModule(source,{fileName:filename,compilerOptions:{allowSyntheticDefaultImports:true,esModuleInterop:true,jsx:typescript.JsxEmit.React,module:typescript.ModuleKind.CommonJS,moduleResolution:typescript.ModuleResolutionKind.NodeJs,target:typescript.ScriptTarget.ES2020}});if(result.diagnostics?.length){const message=result.diagnostics.map(diagnostic=>"string"==typeof diagnostic.messageText?diagnostic.messageText:diagnostic.messageText.messageText).join("\n");if(message)throw new Error(message)}return result.outputText}function createModuleFactory(filename,source){return`${JSON.stringify(filename)}: function(require, module, exports) {
|
|
417
417
|
${transpileModule(filename,source)}
|
|
418
418
|
}`}function normalizeRuntimeFileName(value1){const normalized=value1.trim().replace(/^\.\/+/,"");if(!normalized||normalized.includes("/")||normalized.includes("\\"))return"mf.ts";return normalized.endsWith(".ts")?normalized:`${normalized}.ts`}function getRuntimeFileBaseName(filename){return filename.replace(/\.ts$/,"")}function normalizeGlobalName(value1){const normalized=value1.trim().replace(/[^\w$]/g,"_");if(!normalized||/^\d/.test(normalized))return"ModuleFederationRuntime";return normalized}function getRuntimeGlobalNames(primaryName){const names=[primaryName.trim()].filter(Boolean);return[...new Set(names)]}function createBridgeRuntimeBootstrap(){return`
|
|
419
419
|
var bridgeRuntimeFiles = ${JSON.stringify(buildBridgeRuntimeFiles())};
|
|
@@ -1081,9 +1081,9 @@ export {};
|
|
|
1081
1081
|
</body>
|
|
1082
1082
|
</html>`}class RenderErrorBoundary extends react_index_js_.Component{static getDerivedStateFromError(error){return{error:{message:error.message}}}componentDidCatch(error,info){this.props.onError?.({message:error.message,componentStack:info.componentStack})}render(){if(this.state.error)return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-errorPanel"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-errorTitle"),children:"Render Error"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("pre",{className:cx("vp-codeBlock"),children:this.state.error.message})]});return this.props.children}constructor(...args){super(...args),this.state={error:null}}}function AppInner(props){const{defaults}=props;const initialQueryConfig=(0,react_index_js_.useMemo)(()=>getInitialQueryConfig(defaults),[defaults]);const template=defaults.template;const initialGeneratedAppCode=(0,react_index_js_.useMemo)(()=>buildDefaultAppCode("","default","",DEFAULT_REACT_VERSION,template),[template]);const initialGeneratedMfCode=(0,react_index_js_.useMemo)(()=>buildDefaultMfCode("","",{react:DEFAULT_REACT_VERSION,"react-dom/client":DEFAULT_REACT_VERSION},template),[template]);const[manifestUrl,setManifestUrl]=(0,react_index_js_.useState)(initialQueryConfig.manifestUrl);const[exposeOptions,setExposeOptions]=(0,react_index_js_.useState)([]);const[expose,setExpose]=(0,react_index_js_.useState)(initialQueryConfig.expose);const[exportName,setExportName]=(0,react_index_js_.useState)(initialQueryConfig.exportName);const[previewRoute,setPreviewRoute]=(0,react_index_js_.useState)(initialQueryConfig.previewRoute);const[entryCode,setEntryCode]=(0,react_index_js_.useState)(DEFAULT_ENTRY_CODE);const[appCode,setAppCode]=(0,react_index_js_.useState)(initialGeneratedAppCode);const[lastGeneratedAppCode,setLastGeneratedAppCode]=(0,react_index_js_.useState)(initialGeneratedAppCode);const[mfCode,setMfCode]=(0,react_index_js_.useState)(initialGeneratedMfCode);const[lastGeneratedMfCode,setLastGeneratedMfCode]=(0,react_index_js_.useState)(initialGeneratedMfCode);const[rspackConfigCode,setRspackConfigCode]=(0,react_index_js_.useState)(()=>buildDefaultRspackConfigCode(template));const[openPanels,setOpenPanels]=(0,react_index_js_.useState)({control:true,code:false});const[leftPaneWidth,setLeftPaneWidth]=(0,react_index_js_.useState)(DEFAULT_LEFT_PANE_WIDTH);const[isDesktopLayout,setIsDesktopLayout]=(0,react_index_js_.useState)(()=>"undefined"==typeof window||window.innerWidth>980);const[activeFile,setActiveFile]=(0,react_index_js_.useState)("app.tsx");const[status,setStatus]=(0,react_index_js_.useState)("");const[isResolvingExpose,setIsResolvingExpose]=(0,react_index_js_.useState)(false);const[copiedKey,setCopiedKey]=(0,react_index_js_.useState)("");const[resolvedManifest,setResolvedManifest]=(0,react_index_js_.useState)(null);const[previewState,setPreviewState]=(0,react_index_js_.useState)(null);const[renderError,setRenderError]=(0,react_index_js_.useState)(null);const[terminalLines,setTerminalLines]=(0,react_index_js_.useState)([{id:0,level:"info",message:"Terminal ready. Compile and runtime errors will appear here after Run Sandbox."}]);const[runId,setRunId]=(0,react_index_js_.useState)(0);const runIdRef=(0,react_index_js_.useRef)(runId);const autoRunStartedRef=(0,react_index_js_.useRef)(false);const onRunRef=(0,react_index_js_.useRef)(null);const monacoRef=(0,react_index_js_.useRef)(null);const resizeStateRef=(0,react_index_js_.useRef)(null);const editorFiles=(0,react_index_js_.useMemo)(()=>({"app.tsx":appCode,"entry.ts":entryCode,runtime:mfCode,"rspack.config.mjs":rspackConfigCode}),[appCode,entryCode,mfCode,rspackConfigCode]);const fileTabs=(0,react_index_js_.useMemo)(()=>getFileTabs(template),[template]);(0,react_index_js_.useEffect)(()=>{loader.config({paths:{vs:defaults.monacoVsUrl}})},[defaults.monacoVsUrl]);(0,react_index_js_.useEffect)(()=>{if(monacoRef.current)syncEditorModels(monacoRef.current,editorFiles,template)},[editorFiles,template]);(0,react_index_js_.useEffect)(()=>{runIdRef.current=runId},[runId]);(0,react_index_js_.useEffect)(()=>{if("undefined"==typeof window)return;const handleResize=()=>{const nextIsDesktop=window.innerWidth>980;setIsDesktopLayout(nextIsDesktop);if(!nextIsDesktop){resizeStateRef.current=null;setLeftPaneWidth(DEFAULT_LEFT_PANE_WIDTH)}};handleResize();window.addEventListener("resize",handleResize);return()=>window.removeEventListener("resize",handleResize)},[]);(0,react_index_js_.useEffect)(()=>{if("undefined"==typeof window)return;window.__MF_PLAYGROUND_HOST_REACT__=react_index_js_;window.__MF_PLAYGROUND_HOST_REACT_DOM__={...react_dom_index_js_,...client_js_}},[]);(0,react_index_js_.useEffect)(()=>{if(!isDesktopLayout||"undefined"==typeof window)return;const handleMouseMove=event=>{const resizeState=resizeStateRef.current;if(!resizeState)return;const viewportWidth=window.innerWidth||1;const deltaRatio=(event.clientX-resizeState.startX)/viewportWidth*100;const nextWidth=Math.min(MAX_LEFT_PANE_WIDTH,Math.max(MIN_LEFT_PANE_WIDTH,resizeState.startWidth+deltaRatio));setLeftPaneWidth(nextWidth)};const handleMouseUp=()=>{resizeStateRef.current=null};window.addEventListener("mousemove",handleMouseMove);window.addEventListener("mouseup",handleMouseUp);return()=>{window.removeEventListener("mousemove",handleMouseMove);window.removeEventListener("mouseup",handleMouseUp)}},[isDesktopLayout]);(0,react_index_js_.useEffect)(()=>{const onMessage=event=>{const data=event.data;if(!data||"mf-playground-terminal"!==data.type||data.runId!==runIdRef.current)return;setTerminalLines(currentLines=>[...currentLines,{id:Date.now()+Math.random(),level:normalizeTerminalLevel(data.level),message:String(data.message||"")}].slice(-120))};window.addEventListener("message",onMessage);return()=>window.removeEventListener("message",onMessage)},[]);const appendTerminalLine=(level,message)=>{setTerminalLines(currentLines=>[...currentLines,{id:Date.now()+Math.random(),level,message}].slice(-120))};const manifestName=(0,react_index_js_.useMemo)(()=>{if(!resolvedManifest)return"";return resolvedManifest.metaData?.name||resolvedManifest.name||resolvedManifest.id||""},[resolvedManifest]);const syncGeneratedAppCode=(nextManifest,nextExpose,nextExportName)=>{const reactVersion=nextManifest?extractReactDependencyVersions(nextManifest).react:DEFAULT_REACT_VERSION;if(!nextManifest){const placeholderCode=buildDefaultAppCode("",nextExportName,nextExpose,reactVersion,template);setAppCode(currentCode=>currentCode===lastGeneratedAppCode?placeholderCode:currentCode);setLastGeneratedAppCode(placeholderCode);return}const resolvedRemoteName=guessRemoteName(nextManifest).trim();const nextLoadedTarget=formatLoadedTarget(resolvedRemoteName,normalizeExpose(nextExpose));const nextCode=buildDefaultAppCode(nextLoadedTarget,nextExportName,nextExpose,reactVersion,template);setAppCode(currentCode=>currentCode===lastGeneratedAppCode?nextCode:currentCode);setLastGeneratedAppCode(nextCode)};const syncGeneratedMfCode=(nextManifestUrl,nextManifest)=>{if(!nextManifest)return;const resolvedRemoteName=guessRemoteName(nextManifest).trim();const reactDependencyVersions=extractReactDependencyVersions(nextManifest);const nextCode=buildDefaultMfCode(nextManifestUrl,resolvedRemoteName,reactDependencyVersions,template);setMfCode(currentCode=>currentCode===lastGeneratedMfCode?nextCode:currentCode);setLastGeneratedMfCode(nextCode)};const syncGeneratedMfPlaceholder=()=>{const nextCode=buildDefaultMfCode("","",{react:DEFAULT_REACT_VERSION,"react-dom/client":DEFAULT_REACT_VERSION},template);setMfCode(currentCode=>currentCode===lastGeneratedMfCode?nextCode:currentCode);setLastGeneratedMfCode(nextCode)};const onManifestReady=async options=>{const appendTerminal=options?.appendTerminal??true;const silentStatus=options?.silentStatus??false;const nextManifestUrl=manifestUrl.trim();if(!nextManifestUrl){setResolvedManifest(null);setExposeOptions([]);setExpose("");setOpenPanels(current=>({...current,code:false}));syncGeneratedAppCode(null,"",exportName);syncGeneratedMfPlaceholder();throw new Error(isEn?"Manifest URL is required before running the sandbox.":"运行前请先填写 Manifest URL。")}setIsResolvingExpose(true);if(!silentStatus)setStatus(isEn?"Resolving manifest...":"解析 Manifest 中...");if(appendTerminal)appendTerminalLine("info",`Resolving manifest: ${nextManifestUrl}`);try{const manifest=await fetchManifest(nextManifestUrl);const options=manifest.exposes?.map(item=>item?.name?.trim()).filter(item=>Boolean(item))||[];const effectiveExpose=resolveExposeFromOptions(options,expose);setResolvedManifest(manifest);setExposeOptions(options);const reactDependencyVersions=extractReactDependencyVersions(manifest);const dependencyVersions={...reactDependencyVersions};setRspackConfigCode(currentCode=>updateDependencyVersionsInRspackConfig(currentCode,dependencyVersions));syncGeneratedAppCode(manifest,effectiveExpose,exportName);syncGeneratedMfCode(nextManifestUrl,manifest);setExpose(effectiveExpose);setOpenPanels(current=>({...current,code:true}));if(!silentStatus)setStatus(options.length>0?isEn?`Loaded ${options.length} expose entries`:`已加载 ${options.length} 个 expose`:isEn?"No exposes found in manifest":"Manifest 未提供 expose");return manifest}catch(error){const message=formatErrorForTerminal(error);setResolvedManifest(null);setExposeOptions([]);setExpose("");setOpenPanels(current=>({...current,code:false}));setStatus(error instanceof Error?error.message:String(error));syncGeneratedAppCode(null,"",exportName);syncGeneratedMfPlaceholder();if(appendTerminal)appendTerminalLine("error",`Resolve manifest failed:
|
|
1083
1083
|
${message}`);throw error}finally{setIsResolvingExpose(false)}};const onRun=async()=>{setPreviewState(null);setRenderError(null);setStatus("编译中...");setTerminalLines([{id:Date.now(),level:"info",message:"Compiling sandbox..."}]);try{const normalizedManifestUrl=manifestUrl.trim();const manifestForRun=await onManifestReady({appendTerminal:false,silentStatus:true});const reactDependencyVersions=manifestForRun?extractReactDependencyVersions(manifestForRun):getDefaultReactDependencyVersions();const dependencyVersions={...reactDependencyVersions};const nextRspackConfigCode=updateDependencyVersionsInRspackConfig(rspackConfigCode,dependencyVersions);if(nextRspackConfigCode!==rspackConfigCode)setRspackConfigCode(nextRspackConfigCode);const remoteNameForRun=manifestForRun?guessRemoteName(manifestForRun):manifestName||normalizedManifestUrl||"remote";const nextExposeForRun=normalizeExpose(expose||manifestForRun?.exposes?.[0]?.name||"");const nextGeneratedAppCode=buildDefaultAppCode(formatLoadedTarget(remoteNameForRun,nextExposeForRun),exportName,nextExposeForRun,reactDependencyVersions.react,template);const nextGeneratedMfCode=buildDefaultMfCode(normalizedManifestUrl,remoteNameForRun,reactDependencyVersions,template);const nextAppCode=appCode===lastGeneratedAppCode?nextGeneratedAppCode:appCode;const nextMfCode=mfCode===lastGeneratedMfCode?nextGeneratedMfCode:mfCode;if(nextGeneratedAppCode!==lastGeneratedAppCode)setLastGeneratedAppCode(nextGeneratedAppCode);if(nextAppCode!==appCode)setAppCode(nextAppCode);if(nextGeneratedMfCode!==lastGeneratedMfCode)setLastGeneratedMfCode(nextGeneratedMfCode);if(nextMfCode!==mfCode)setMfCode(nextMfCode);const bundle=await compilePlaygroundApp({appCode:nextAppCode,entryCode,mfCode:nextMfCode,runtimeModuleUrl:defaults.runtimeModuleUrl,runtimeFileName:template.runtimeFileName,runtimeGlobalName:template.runtimeGlobalName,runtimePackageName:template.runtimePackageName,rspackConfigCode:nextRspackConfigCode});const normalizedCurrentExpose=nextExposeForRun;const loadedTarget=formatLoadedTarget(remoteNameForRun,normalizedCurrentExpose);const nextRunId=runId+1;runIdRef.current=nextRunId;setRunId(nextRunId);setPreviewState({kind:"consumer",bundle,loadedTarget,manifest:manifestForRun,manifestUrl:normalizedManifestUrl,expose:normalizedCurrentExpose,previewRoute:normalizePreviewRoute(previewRoute),runtimeModuleUrl:defaults.runtimeModuleUrl,runId:nextRunId});setStatus("完成");appendTerminalLine("info","Sandbox bundle compiled. Preview is running.")}catch(error){const message=formatErrorForTerminal(error);setStatus(error instanceof Error?error.message:String(error));appendTerminalLine("error",`Run Sandbox failed:
|
|
1084
|
-
${message}`)}};onRunRef.current=onRun;(0,react_index_js_.useEffect)(()=>{if(!initialQueryConfig.autoRun||autoRunStartedRef.current)return;autoRunStartedRef.current=true;onRunRef.current?.()},[initialQueryConfig.autoRun]);const copyText=async(key,text,okMsg)=>{try{await navigator.clipboard.writeText(text);setCopiedKey(key);setStatus(okMsg);window.setTimeout(()=>setCopiedKey(""),1e3)}catch{setStatus("复制失败:浏览器不支持 clipboard API(可手动复制)")}};const CopyButton=props=>{const{copyKey,label,okMsg,text}=props;const done=copiedKey===copyKey;return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-copyBtn"),onClick:()=>void copyText(copyKey,text,okMsg),title:done?"Copied":"Copy",children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("svg",{"aria-hidden":"true",className:cx("vp-copyIcon"),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M8 7.5C8 6.119 9.119 5 10.5 5H18c1.381 0 2.5 1.119 2.5 2.5V15c0 1.381-1.119 2.5-2.5 2.5h-7.5C9.119 17.5 8 16.381 8 15V7.5Z",stroke:"currentColor",strokeWidth:"1.6"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M5 9.5C5 8.119 6.119 7 7.5 7H8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M5 18.5C5 19.881 6.119 21 7.5 21H15c1.381 0 2.5-1.119 2.5-2.5V18",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:done?"Copied":label||"Copy"})]})};const renderPreview=()=>{if(!previewState)return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-empty"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-emptyTitle"),children:"Ready."}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"1. Fill in the Manifest URL first.":"1. 先填写 Manifest URL。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"2. Click Run Sandbox. It resolves the manifest first, then starts the preview if everything is valid.":"2. 点击 Run Sandbox。它会先解析 Manifest,没问题再启动右侧预览。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"3. If manifest parsing fails, check the terminal below for the exact error.":"3. 如果 Manifest 解析失败,直接看下方 Terminal 里的具体报错。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"4. If you still need to adjust how the producer is loaded, edit the consumer code in the Code panel on the left. The Code panel only appears and loads after the first successful Manifest resolve.":"4. 如果还需要调整加载方式,再去修改左侧 Code 里的消费者代码。Code 只有在第一次解析 Manifest 成功后才会出现并加载。"})]});if("consumer"===previewState.kind){const{expose:currentExpose,runId:currentRunId}=previewState;return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-kv"),children:["Target:"," ",formatLoadedTarget(manifestName||"remote",currentExpose)]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-renderArea"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("iframe",{className:cx("vp-previewFrame"),title:"Sandbox Preview",srcDoc:buildPreviewDocument(previewState,defaults)},currentRunId)})]})}return null};const renderTerminal=()=>/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-terminal"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-terminalHeader"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:"Terminal"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:cx("vp-terminalClear"),onClick:()=>setTerminalLines([]),children:"Clear"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-terminalBody"),children:terminalLines.length>0?terminalLines.map(line=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("pre",{className:cx("vp-terminalLine","error"===line.level&&"vp-terminalLineError","warn"===line.level&&"vp-terminalLineWarn"),children:line.message},line.id)):/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-terminalEmpty"),children:"No output."})})]});const fileState={"app.tsx":{value:appCode,onChange:setAppCode},"entry.ts":{value:entryCode,onChange:setEntryCode},runtime:{value:mfCode,onChange:setMfCode},"rspack.config.mjs":{value:rspackConfigCode,onChange:setRspackConfigCode}};const activeTab=fileTabs.find(item=>item.key===activeFile)||fileTabs[0];const activeEditor=fileState[activeTab.key];const editorPath=getEditorPath(activeTab.key,template);const editorTheme=useEditorTheme();const locale=useLocale();const isEn="en"===locale;const canShowCodePanel=Boolean(resolvedManifest);const displayStatus=renderError?.message||status||"Idle";const visibleExposeOptions=expose&&!exposeOptions.includes(expose)?[expose,...exposeOptions]:exposeOptions;const moduleNameText=previewState?.kind==="consumer"?formatLoadedTarget(manifestName||"remote",previewState.expose):"editor mode";const mainStyle=isDesktopLayout?{gridTemplateColumns:`minmax(0, ${leftPaneWidth}fr) 10px minmax(0, ${100-leftPaneWidth}fr)`}:void 0;return/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-root"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("main",{className:cx("vp-main"),style:mainStyle,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("section",{className:cx("vp-left"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-card"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-cardHeader"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-cardTitle"),children:"Workspace"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-paneActions"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:cx("vp-button","vp-buttonPrimary"),onClick:onRun,title:"Run Sandbox",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:"Run Sandbox"})})})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-cardBody"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapse"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseItem"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-collapseHeader",openPanels.control&&"vp-collapseHeaderActive"),onClick:()=>setOpenPanels(current=>({...current,control:!current.control})),"aria-expanded":openPanels.control,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseLabel"),children:"Control Panel"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseArrow",openPanels.control&&"vp-collapseArrowOpen"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M4.5 6.5L8 10L11.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),openPanels.control?/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-collapseBody"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-form"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Manifest URL"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Run Sandbox resolves this automatically":"点击 Run Sandbox 时自动解析"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:manifestUrl,onChange:event=>{setManifestUrl(event.target.value);setResolvedManifest(null);setExposeOptions([]);setExpose("");setOpenPanels(current=>({...current,code:false}));syncGeneratedAppCode(null,"",exportName);syncGeneratedMfPlaceholder()},placeholder:"https://.../mf-manifest.json"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-fieldGrid"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Expose"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:manifestName?`Remote: ${manifestName}`:isEn?"Auto read from manifest":"从 manifest 自动读取"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("select",{className:cx("vp-select"),value:expose,onChange:event=>{const nextExpose=event.target.value;setExpose(nextExpose);syncGeneratedAppCode(resolvedManifest,nextExpose,exportName);syncGeneratedMfCode(manifestUrl.trim(),resolvedManifest)},disabled:isResolvingExpose,children:visibleExposeOptions.length>0?visibleExposeOptions.map(item=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("option",{value:item,children:item},item)):/*#__PURE__*/(0,jsx_runtime_js_.jsx)("option",{value:"",children:isEn?"Run Sandbox to load expose options":"点击 Run Sandbox 后加载 expose"})})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Export"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Default is default; you can switch to a named export":"默认 default,可改成具名导出"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:exportName,onChange:event=>{const nextExportName=event.target.value;setExportName(nextExportName);syncGeneratedAppCode(resolvedManifest,expose,nextExportName);syncGeneratedMfCode(manifestUrl.trim(),resolvedManifest)},placeholder:"default"})]})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Preview Route"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Match the basename used by export-app":"和 export-app 的 basename 保持一致"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:previewRoute,onChange:event=>{setPreviewRoute(event.target.value)},placeholder:"/"})]})]})}):null]}),canShowCodePanel?/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseItem"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-collapseHeader",openPanels.code&&"vp-collapseHeaderActive"),onClick:()=>setOpenPanels(current=>({...current,code:!current.code})),"aria-expanded":openPanels.code,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseLabel"),children:"Code"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseArrow",openPanels.code&&"vp-collapseArrowOpen"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M4.5 6.5L8 10L11.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),openPanels.code?/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseBody","vp-collapseBodyCode"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-editorToolbar"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-editorTabs"),role:"tablist","aria-label":"Files",children:fileTabs.map(item=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:item.key===activeTab.key?cx("vp-editorTab","vp-editorTabActive"):cx("vp-editorTab"),onClick:()=>setActiveFile(item.key),children:item.label||item.key},item.key))}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)(CopyButton,{copyKey:activeTab.copyKey,label:"Copy",okMsg:activeTab.copyMessage,text:activeEditor.value})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-codeEditor"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(Ft,{height:"100%",language:getEditorLanguage(activeTab.key),path:editorPath,theme:editorTheme,value:activeEditor.value,loading:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(EditorLoadingState,{}),options:{automaticLayout:true,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:13,lineHeight:21,minimap:{enabled:false},padding:{top:12,bottom:12},scrollBeyondLastLine:false,tabSize:2,wordWrap:"on"},beforeMount:monaco=>configureEditor(monaco,template),onMount:(_,monaco)=>{monacoRef.current=monaco;syncEditorModels(monaco,editorFiles,template)},onChange:value1=>activeEditor.onChange(value1||"")},editorPath)})]}):null]}):null]})})]})}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-splitter"),"aria-hidden":"true",onMouseDown:isDesktopLayout?event=>{resizeStateRef.current={startWidth:leftPaneWidth,startX:event.clientX}}:void 0}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("section",{className:cx("vp-right"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ide"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideTitlebar"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideDots"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotRed")}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotYellow")}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotGreen")})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-ideTitle"),children:"Sandbox Preview"}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideMeta"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-ideMetaText"),title:moduleNameText,children:moduleNameText}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-ideStatus"),title:displayStatus,children:displayStatus})]})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideBody"),children:[renderPreview(),renderTerminal()]})]})})]})})}function App(props){const defaults=(0,react_index_js_.useMemo)(()=>getPlaygroundDefaults(props),[props]);return/*#__PURE__*/(0,jsx_runtime_js_.jsx)(RenderErrorBoundary,{children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(AppInner,{defaults:defaults})})}},5617:function(__unused_webpack_module,exports){var __defProp=Object.defineProperty;var __exportAll=(all,no_symbols)=>{let target={};for(var name in all)__defProp(target,name,{get:all[name],enumerable:true});if(!no_symbols)__defProp(target,Symbol.toStringTag,{value:"Module"});return target};exports.__exportAll=__exportAll},1319:function(__unused_webpack_module,exports){const DEFAULT_SCOPE="default";const DEFAULT_REMOTE_TYPE="global";exports.DEFAULT_REMOTE_TYPE=DEFAULT_REMOTE_TYPE;exports.DEFAULT_SCOPE=DEFAULT_SCOPE},3906:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_env=__webpack_require__(8042);const require_plugin=__webpack_require__(3584);const require_load=__webpack_require__(5265);__webpack_require__(4011);const require_index$1=__webpack_require__(1518);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);const require_index$3=__webpack_require__(1625);const require_generate_preload_assets=__webpack_require__(6141);const require_SnapshotHandler=__webpack_require__(8281);const require_index$4=__webpack_require__(805);const require_index$5=__webpack_require__(8984);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);var ModuleFederation=class{constructor(userOptions){this.hooks=new require_pluginSystem.PluginSystem({beforeInit:new require_syncWaterfallHook.SyncWaterfallHook("beforeInit"),init:new require_syncHook.SyncHook,beforeInitContainer:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeInitContainer"),initContainer:new require_asyncWaterfallHooks.AsyncWaterfallHook("initContainer")});this.version="2.7.0";this.moduleCache=/* @__PURE__ */new Map;this.loaderHook=new require_pluginSystem.PluginSystem({getModuleInfo:new require_syncHook.SyncHook,createScript:new require_syncHook.SyncHook,createLink:new require_syncHook.SyncHook,fetch:new require_asyncHook.AsyncHook,loadEntryError:new require_asyncHook.AsyncHook,afterLoadEntry:new require_asyncHook.AsyncHook("afterLoadEntry"),beforeInitRemote:new require_asyncHook.AsyncHook("beforeInitRemote"),afterInitRemote:new require_asyncHook.AsyncHook("afterInitRemote"),beforeGetExpose:new require_asyncHook.AsyncHook("beforeGetExpose"),afterGetExpose:new require_asyncHook.AsyncHook("afterGetExpose"),beforeExecuteFactory:new require_asyncHook.AsyncHook("beforeExecuteFactory"),afterExecuteFactory:new require_asyncHook.AsyncHook("afterExecuteFactory"),getModuleFactory:new require_asyncHook.AsyncHook});this.bridgeHook=new require_pluginSystem.PluginSystem({beforeBridgeRender:new require_syncHook.SyncHook,afterBridgeRender:new require_syncHook.SyncHook,beforeBridgeDestroy:new require_syncHook.SyncHook,afterBridgeDestroy:new require_syncHook.SyncHook});const plugins=[require_index$3.snapshotPlugin(),require_generate_preload_assets.generatePreloadAssetsPlugin()];const defaultOptions={id:require_env.getBuilderId(),name:userOptions.name,plugins,remotes:[],shared:{},inBrowser:_module_federation_sdk.isBrowserEnvValue};this.name=userOptions.name;this.options=defaultOptions;this.snapshotHandler=new require_SnapshotHandler.SnapshotHandler(this);this.sharedHandler=new require_index$4.SharedHandler(this);this.remoteHandler=new require_index$5.RemoteHandler(this);this.shareScopeMap=this.sharedHandler.shareScopeMap;this.registerPlugins([...defaultOptions.plugins,...userOptions.plugins||[]]);this.options=this.formatOptions(defaultOptions,userOptions)}initOptions(userOptions){if(userOptions.name&&userOptions.name!==this.options.name)require_logger.error((0,_module_federation_error_codes.getShortErrorMsg)(_module_federation_error_codes.RUNTIME_010,_module_federation_error_codes.runtimeDescMap));this.registerPlugins(userOptions.plugins);const options=this.formatOptions(this.options,userOptions);this.options=options;return options}async loadShare(pkgName,extraOptions){return this.sharedHandler.loadShare(pkgName,extraOptions)}loadShareSync(pkgName,extraOptions){return this.sharedHandler.loadShareSync(pkgName,extraOptions)}initializeSharing(shareScopeName=require_constant.DEFAULT_SCOPE,extraOptions){return this.sharedHandler.initializeSharing(shareScopeName,extraOptions)}initRawContainer(name,url,container){const remoteInfo=require_load.getRemoteInfo({name,entry:url});const module1=new require_index$1.Module({host:this,remoteInfo});module1.remoteEntryExports=container;this.moduleCache.set(name,module1);return module1}async loadRemote(id,options){return this.remoteHandler.loadRemote(id,options)}async preloadRemote(preloadOptions){return this.remoteHandler.preloadRemote(preloadOptions)}initShareScopeMap(scopeName,shareScope,extraOptions={}){this.sharedHandler.initShareScopeMap(scopeName,shareScope,extraOptions)}formatOptions(globalOptions,userOptions){const{allShareInfos:shared}=require_share.formatShareConfigs(globalOptions,userOptions);const{userOptions:userOptionsRes,options:globalOptionsRes}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions,options:globalOptions,shareInfo:shared});const remotes=this.remoteHandler.formatAndRegisterRemote(globalOptionsRes,userOptionsRes);const{allShareInfos}=this.sharedHandler.registerShared(globalOptionsRes,userOptionsRes);const plugins=[...globalOptionsRes.plugins];if(userOptionsRes.plugins)userOptionsRes.plugins.forEach(plugin=>{if(!plugins.includes(plugin))plugins.push(plugin)});const optionsRes={...globalOptions,...userOptions,plugins,remotes,shared:allShareInfos,id:userOptionsRes.id||globalOptions.id};this.hooks.lifecycle.init.emit({origin:this,options:optionsRes});return optionsRes}registerPlugins(plugins){const pluginRes=require_plugin.registerPlugins(plugins,this);this.options.plugins=this.options.plugins.reduce((res,plugin)=>{if(!plugin)return res;if(res&&!res.find(item=>item.name===plugin.name))res.push(plugin);return res},pluginRes||[])}registerRemotes(remotes,options){return this.remoteHandler.registerRemotes(remotes,options)}registerShared(shared){this.sharedHandler.registerShared(this.options,{...this.options,shared})}};exports.ModuleFederation=ModuleFederation},7922:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);let _module_federation_sdk=__webpack_require__(1487);const CurrentGlobal="object"==typeof globalThis?globalThis:window;const nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})();const Global=nativeGlobal;function definePropertyGlobalVal(target,key,val){Object.defineProperty(target,key,{value:val,configurable:false,writable:true})}function includeOwnProperty(target,key){return Object.hasOwnProperty.call(target,key)}if(!includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__"))definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(target){if(includeOwnProperty(target,"__VMOK__")&&!includeOwnProperty(target,"__FEDERATION__"))definePropertyGlobalVal(target,"__FEDERATION__",target.__VMOK__);if(!includeOwnProperty(target,"__FEDERATION__")){definePropertyGlobalVal(target,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:/* @__PURE__ */new Map});definePropertyGlobalVal(target,"__VMOK__",target.__FEDERATION__)}target.__FEDERATION__.__GLOBAL_PLUGIN__??=[];target.__FEDERATION__.__INSTANCES__??=[];target.__FEDERATION__.moduleInfo??={};target.__FEDERATION__.__SHARE__??={};target.__FEDERATION__.__MANIFEST_LOADING__??={};target.__FEDERATION__.__PRELOADED_MAP__??=/* @__PURE__ */new Map}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function resetFederationGlobalInfo(){CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__=[];CurrentGlobal.__FEDERATION__.__INSTANCES__=[];CurrentGlobal.__FEDERATION__.moduleInfo={};CurrentGlobal.__FEDERATION__.__SHARE__={};CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__={};Object.keys(globalLoading).forEach(key=>{delete globalLoading[key]})}function setGlobalFederationInstance(FederationInstance){CurrentGlobal.__FEDERATION__.__INSTANCES__.push(FederationInstance)}function getGlobalFederationConstructor(){return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(FederationConstructor,isDebug=(0,_module_federation_sdk.isDebugMode)()){if(isDebug){CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=FederationConstructor;CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.7.0"}}function getInfoWithoutType(target,key){if("string"==typeof key)if(target[key])return{value:target[key],key};else{const targetKeys=Object.keys(target);for(const targetKey of targetKeys){const[targetTypeOrName,_]=targetKey.split(":");const nKey=`${targetTypeOrName}:${key}`;const typeWithKeyRes=target[nKey];if(typeWithKeyRes)return{value:typeWithKeyRes,key:nKey}}return{value:void 0,key}}require_logger.error(`getInfoWithoutType: "key" must be a string, got ${typeof key} (${JSON.stringify(key)}).`)}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo;const getTargetSnapshotInfoByModuleInfo=(moduleInfo,snapshot)=>{const getModuleInfo=getInfoWithoutType(snapshot,require_tool.getFMId(moduleInfo)).value;if(getModuleInfo&&!getModuleInfo.version&&"version"in moduleInfo&&moduleInfo["version"])getModuleInfo.version=moduleInfo["version"];if(getModuleInfo)return getModuleInfo;if("version"in moduleInfo&&moduleInfo["version"]){const{version,...resModuleInfo}=moduleInfo;const moduleKeyWithoutVersion=require_tool.getFMId(resModuleInfo);const getModuleInfoWithoutVersion=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,moduleKeyWithoutVersion).value;if(getModuleInfoWithoutVersion?.version===version)return getModuleInfoWithoutVersion}};const getGlobalSnapshotInfoByModuleInfo=moduleInfo=>getTargetSnapshotInfoByModuleInfo(moduleInfo,nativeGlobal.__FEDERATION__.moduleInfo);const setGlobalSnapshotInfoByModuleInfo=(remoteInfo,moduleDetailInfo)=>{const moduleKey=require_tool.getFMId(remoteInfo);nativeGlobal.__FEDERATION__.moduleInfo[moduleKey]=moduleDetailInfo;return nativeGlobal.__FEDERATION__.moduleInfo};const addGlobalSnapshot=moduleInfos=>{nativeGlobal.__FEDERATION__.moduleInfo={...nativeGlobal.__FEDERATION__.moduleInfo,...moduleInfos};return()=>{const keys=Object.keys(moduleInfos);for(const key of keys)delete nativeGlobal.__FEDERATION__.moduleInfo[key]}};const getRemoteEntryExports=(name,globalName)=>{const remoteEntryKey=globalName||`__FEDERATION_${name}:custom__`;return{remoteEntryKey,entryExports:CurrentGlobal[remoteEntryKey]}};const registerGlobalPlugins=plugins=>{const{__GLOBAL_PLUGIN__}=nativeGlobal.__FEDERATION__;plugins.forEach(plugin=>{if(-1===__GLOBAL_PLUGIN__.findIndex(p=>p.name===plugin.name))__GLOBAL_PLUGIN__.push(plugin);else require_logger.warn(`The plugin ${plugin.name} has been registered.`)})};const getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;const getPreloaded=id=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(id);const setPreloaded=id=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(id,true);exports.CurrentGlobal=CurrentGlobal;exports.Global=Global;exports.addGlobalSnapshot=addGlobalSnapshot;exports.getGlobalFederationConstructor=getGlobalFederationConstructor;exports.getGlobalHostPlugins=getGlobalHostPlugins;exports.getGlobalSnapshot=getGlobalSnapshot;exports.getGlobalSnapshotInfoByModuleInfo=getGlobalSnapshotInfoByModuleInfo;exports.getInfoWithoutType=getInfoWithoutType;exports.getPreloaded=getPreloaded;exports.getRemoteEntryExports=getRemoteEntryExports;exports.getTargetSnapshotInfoByModuleInfo=getTargetSnapshotInfoByModuleInfo;exports.globalLoading=globalLoading;exports.nativeGlobal=nativeGlobal;exports.registerGlobalPlugins=registerGlobalPlugins;exports.resetFederationGlobalInfo=resetFederationGlobalInfo;exports.setGlobalFederationConstructor=setGlobalFederationConstructor;exports.setGlobalFederationInstance=setGlobalFederationInstance;exports.setGlobalSnapshotInfoByModuleInfo=setGlobalSnapshotInfoByModuleInfo;exports.setPreloaded=setPreloaded},8366:function(__unused_webpack_module,exports,__webpack_require__){const require_global=__webpack_require__(7922);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const ShareUtils={getRegisteredShare:require_share.getRegisteredShare,getGlobalShareScope:require_share.getGlobalShareScope};const GlobalUtils={Global:require_global.Global,nativeGlobal:require_global.nativeGlobal,resetFederationGlobalInfo:require_global.resetFederationGlobalInfo,setGlobalFederationInstance:require_global.setGlobalFederationInstance,getGlobalFederationConstructor:require_global.getGlobalFederationConstructor,setGlobalFederationConstructor:require_global.setGlobalFederationConstructor,getInfoWithoutType:require_global.getInfoWithoutType,getGlobalSnapshot:require_global.getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo:require_global.getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo:require_global.getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo:require_global.setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot:require_global.addGlobalSnapshot,getRemoteEntryExports:require_global.getRemoteEntryExports,registerGlobalPlugins:require_global.registerGlobalPlugins,getGlobalHostPlugins:require_global.getGlobalHostPlugins,getPreloaded:require_global.getPreloaded,setPreloaded:require_global.setPreloaded};var helpers_default={global:GlobalUtils,share:ShareUtils,utils:{matchRemoteWithNameAndExpose:require_manifest.matchRemoteWithNameAndExpose,preloadAssets:require_preload.preloadAssets,getRemoteInfo:require_load.getRemoteInfo}};exports["default"]=helpers_default},5929:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_index=__webpack_require__(508);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);__webpack_require__(4011);const require_helpers=__webpack_require__(8366);const require_index$2=__webpack_require__(1518);const require_core=__webpack_require__(3906);const require_index$3=__webpack_require__(9998);let _module_federation_sdk=__webpack_require__(1487);const helpers=require_helpers.default;exports.CurrentGlobal=require_global.CurrentGlobal;exports.Global=require_global.Global;exports.Module=require_index$2.Module;exports.ModuleFederation=require_core.ModuleFederation;exports.addGlobalSnapshot=require_global.addGlobalSnapshot;exports.assert=require_logger.assert;exports.error=require_logger.error;exports.getGlobalFederationConstructor=require_global.getGlobalFederationConstructor;exports.getGlobalSnapshot=require_global.getGlobalSnapshot;exports.getInfoWithoutType=require_global.getInfoWithoutType;exports.getRegisteredShare=require_share.getRegisteredShare;exports.getRemoteEntry=require_load.getRemoteEntry;exports.getRemoteInfo=require_load.getRemoteInfo;exports.helpers=helpers;exports.isStaticResourcesEqual=require_tool.isStaticResourcesEqual;Object.defineProperty(exports,"loadScript",{enumerable:true,get:function(){return _module_federation_sdk.loadScript}});Object.defineProperty(exports,"loadScriptNode",{enumerable:true,get:function(){return _module_federation_sdk.loadScriptNode}});exports.matchRemoteWithNameAndExpose=require_manifest.matchRemoteWithNameAndExpose;exports.registerGlobalPlugins=require_global.registerGlobalPlugins;exports.resetFederationGlobalInfo=require_global.resetFederationGlobalInfo;exports.safeWrapper=require_tool.safeWrapper;exports.satisfy=require_index.satisfy;exports.setGlobalFederationConstructor=require_global.setGlobalFederationConstructor;exports.setGlobalFederationInstance=require_global.setGlobalFederationInstance;Object.defineProperty(exports,"types",{enumerable:true,get:function(){return require_index$3.type_exports}})},1518:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function getAvailableExposeNames(remoteSnapshot){if(!remoteSnapshot||!("modules"in remoteSnapshot)||!Array.isArray(remoteSnapshot.modules))return;const exposes=remoteSnapshot.modules.map(module1=>module1.moduleName).filter(Boolean);return exposes.length?exposes.join(","):void 0}function createRemoteEntryInitOptions(remoteInfo,hostShareScopeMap,rawInitScope){const localShareScopeMap=hostShareScopeMap;const shareScopeKeys=Array.isArray(remoteInfo.shareScope)?remoteInfo.shareScope:[remoteInfo.shareScope];if(!shareScopeKeys.length)shareScopeKeys.push("default");shareScopeKeys.forEach(shareScopeKey=>{if(!localShareScopeMap[shareScopeKey])localShareScopeMap[shareScopeKey]={}});const remoteEntryInitOptions={version:remoteInfo.version||"",shareScopeKeys:Array.isArray(remoteInfo.shareScope)?shareScopeKeys:remoteInfo.shareScope||"default"};Object.defineProperty(remoteEntryInitOptions,"shareScopeMap",{value:localShareScopeMap,enumerable:false});return{remoteEntryInitOptions,shareScope:localShareScopeMap[shareScopeKeys[0]],initScope:rawInitScope??[]}}var Module=class{constructor({remoteInfo,host}){this.inited=false;this.initing=false;this.lib=void 0;this.remoteInfo=remoteInfo;this.host=host}async getEntry(expose){if(this.remoteEntryExports)return this.remoteEntryExports;const remoteEntryExports=await require_load.getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:require_manifest.composeRemoteRequestId(this.remoteInfo.name,expose),resourceType:"remoteEntry"}});require_logger.assert(remoteEntryExports,`remoteEntryExports is undefined
|
|
1085
|
-
${(0,_module_federation_sdk.safeToString)(this.remoteInfo)}`);this.remoteEntryExports=remoteEntryExports;return this.remoteEntryExports}async init(id,remoteSnapshot,rawInitScope,expose){const remoteEntryExports=await this.getEntry(expose);if(this.inited){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,cached:true,origin:this.host});return remoteEntryExports}if(this.initPromise){try{await this.initPromise;await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,cached:true,origin:this.host})}catch(initError){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,error:initError,cached:true,origin:this.host});throw initError}return remoteEntryExports}this.initing=true;this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,origin:this.host});const{remoteEntryInitOptions,shareScope,initScope}=createRemoteEntryInitOptions(this.remoteInfo,this.host.shareScopeMap,rawInitScope);const initContainerOptions=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope,remoteEntryInitOptions,initScope,remoteInfo:this.remoteInfo,origin:this.host});if(void 0===remoteEntryExports?.init)require_logger.error(_module_federation_error_codes.RUNTIME_002,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,require_context.optionsToMFContext(this.host.options));try{await remoteEntryExports.init(initContainerOptions.shareScope,initContainerOptions.initScope,initContainerOptions.remoteEntryInitOptions)}catch(initError){require_logger.error(_module_federation_error_codes.RUNTIME_015,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${initError}`,require_context.optionsToMFContext(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...initContainerOptions,id,remoteSnapshot,remoteEntryExports});this.inited=true})();try{await this.initPromise;await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,origin:this.host})}catch(initError){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,error:initError,origin:this.host});throw initError}finally{this.initing=false;this.initPromise=void 0}return remoteEntryExports}async get(id,expose,options,remoteSnapshot){const{loadFactory=true}=options||{loadFactory:true};const remoteEntryExports=await this.init(id,remoteSnapshot,void 0,expose);this.lib=remoteEntryExports;await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,origin:this.host});let moduleFactory;try{const hookModuleFactory=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports,expose,moduleInfo:this.remoteInfo});moduleFactory="function"==typeof hookModuleFactory?hookModuleFactory:void 0;if(!moduleFactory)moduleFactory=await remoteEntryExports.get(expose);if(!moduleFactory)require_logger.error(_module_federation_error_codes.RUNTIME_014,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose,requestId:id,availableExposes:getAvailableExposeNames(remoteSnapshot)},void 0,require_context.optionsToMFContext(this.host.options));await this.host.loaderHook.lifecycle.afterGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,moduleFactory,origin:this.host})}catch(getExposeError){await this.host.loaderHook.lifecycle.afterGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,error:getExposeError,origin:this.host});throw getExposeError}const symbolName=require_tool.processModuleAlias(this.remoteInfo.name,expose);const wrapModuleFactory=this.wraperFactory(moduleFactory,symbolName);if(!loadFactory)return wrapModuleFactory;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,origin:this.host});try{const exposeContent=await wrapModuleFactory();await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,exposeModule:exposeContent,origin:this.host});return exposeContent}catch(executeFactoryError){await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,error:executeFactoryError,origin:this.host});throw executeFactoryError}}wraperFactory(moduleFactory,id){function defineModuleId(res,id){if(res&&"object"==typeof res&&Object.isExtensible(res)&&!Object.getOwnPropertyDescriptor(res,Symbol.for("mf_module_id")))Object.defineProperty(res,Symbol.for("mf_module_id"),{value:id,enumerable:false})}return()=>{const res=moduleFactory();if(res instanceof Promise)return res.then(asyncRes=>{defineModuleId(asyncRes,id);return asyncRes});defineModuleId(res,id);return res}}};exports.Module=Module},6141:function(__unused_webpack_module,exports,__webpack_require__){const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_share=__webpack_require__(9774);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const require_index$1=__webpack_require__(1625);let _module_federation_sdk=__webpack_require__(1487);function splitId(id){const splitInfo=id.split(":");if(1===splitInfo.length)return{name:splitInfo[0],version:void 0};if(2===splitInfo.length)return{name:splitInfo[0],version:splitInfo[1]};return{name:splitInfo[1],version:splitInfo[2]}}function traverseModuleInfo(globalSnapshot,remoteInfo,traverse,isRoot,memo={},remoteSnapshot){const{value:snapshotValue}=require_global.getInfoWithoutType(globalSnapshot,require_tool.getFMId(remoteInfo));const effectiveRemoteSnapshot=remoteSnapshot||snapshotValue;if(effectiveRemoteSnapshot&&!(0,_module_federation_sdk.isManifestProvider)(effectiveRemoteSnapshot)){traverse(effectiveRemoteSnapshot,remoteInfo,isRoot);if(effectiveRemoteSnapshot.remotesInfo){const remoteKeys=Object.keys(effectiveRemoteSnapshot.remotesInfo);for(const key of remoteKeys){if(memo[key])continue;memo[key]=true;const subRemoteInfo=splitId(key);const remoteValue=effectiveRemoteSnapshot.remotesInfo[key];traverseModuleInfo(globalSnapshot,{name:subRemoteInfo.name,version:remoteValue.matchedVersion},traverse,false,memo,void 0)}}}}const isExisted=(type,url)=>document.querySelector(`${type}[${"link"===type?"href":"src"}="${url}"]`);function generatePreloadAssets(origin,preloadOptions,remote,globalSnapshot,remoteSnapshot){const cssAssets=[];const jsAssets=[];const entryAssets=[];const loadedSharedJsAssets=/* @__PURE__ */new Set;const loadedSharedCssAssets=/* @__PURE__ */new Set;const{options}=origin;const{preloadConfig:rootPreloadConfig}=preloadOptions;const{depsRemote}=rootPreloadConfig;traverseModuleInfo(globalSnapshot,remote,(moduleInfoSnapshot,remoteInfo,isRoot)=>{let preloadConfig;if(isRoot)preloadConfig=rootPreloadConfig;else if(Array.isArray(depsRemote)){const findPreloadConfig=depsRemote.find(remoteConfig=>{if(remoteConfig.nameOrAlias===remoteInfo.name||remoteConfig.nameOrAlias===remoteInfo.alias)return true;return false});if(!findPreloadConfig)return;preloadConfig=require_preload.defaultPreloadArgs(findPreloadConfig)}else{if(true!==depsRemote)return;preloadConfig=rootPreloadConfig}const remoteEntryUrl=(0,_module_federation_sdk.getResourceUrl)(moduleInfoSnapshot,require_tool.getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);if(remoteEntryUrl)entryAssets.push({name:remoteInfo.name,moduleInfo:{name:remoteInfo.name,entry:remoteEntryUrl,type:"remoteEntryType"in moduleInfoSnapshot?moduleInfoSnapshot.remoteEntryType:"global",entryGlobalName:"globalName"in moduleInfoSnapshot?moduleInfoSnapshot.globalName:remoteInfo.name,shareScope:"",version:"version"in moduleInfoSnapshot?moduleInfoSnapshot.version:void 0},url:remoteEntryUrl});let moduleAssetsInfo="modules"in moduleInfoSnapshot?moduleInfoSnapshot.modules:[];const normalizedPreloadExposes=require_preload.normalizePreloadExposes(preloadConfig.exposes);if(normalizedPreloadExposes.length&&"modules"in moduleInfoSnapshot)moduleAssetsInfo=moduleInfoSnapshot?.modules?.reduce((assets,moduleAssetInfo)=>{if(normalizedPreloadExposes?.indexOf(moduleAssetInfo.moduleName)!==-1)assets.push(moduleAssetInfo);return assets},[]);function handleAssets(assets){const assetsRes=assets.map(asset=>(0,_module_federation_sdk.getResourceUrl)(moduleInfoSnapshot,asset));if(preloadConfig.filter)return assetsRes.filter(preloadConfig.filter);return assetsRes}if(moduleAssetsInfo){const assetsLength=moduleAssetsInfo.length;for(let index=0;index<assetsLength;index++){const assetsInfo=moduleAssetsInfo[index];const exposeFullPath=`${remoteInfo.name}/${assetsInfo.moduleName}`;origin.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===assetsInfo.moduleName?remoteInfo.name:exposeFullPath,name:remoteInfo.name,remoteSnapshot:moduleInfoSnapshot,preloadConfig,remote:remoteInfo,origin});if(!require_global.getPreloaded(exposeFullPath)){if("all"===preloadConfig.resourceCategory){cssAssets.push(...handleAssets(assetsInfo.assets.css.async));cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));jsAssets.push(...handleAssets(assetsInfo.assets.js.async));jsAssets.push(...handleAssets(assetsInfo.assets.js.sync))}else if("sync"===preloadConfig.resourceCategory){cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));jsAssets.push(...handleAssets(assetsInfo.assets.js.sync))}require_global.setPreloaded(exposeFullPath)}}}},true,{},remoteSnapshot);if(remoteSnapshot.shared&&remoteSnapshot.shared.length>0){const collectSharedAssets=(shareInfo,snapshotShared)=>{const{shared:registeredShared}=require_share.getRegisteredShare(origin.shareScopeMap,snapshotShared.sharedName,shareInfo,origin.sharedHandler.hooks.lifecycle.resolveShare)||{};if(registeredShared&&"function"==typeof registeredShared.lib){snapshotShared.assets.js.sync.forEach(asset=>{loadedSharedJsAssets.add(asset)});snapshotShared.assets.css.sync.forEach(asset=>{loadedSharedCssAssets.add(asset)})}};remoteSnapshot.shared.forEach(shared=>{const shareInfos=options.shared?.[shared.sharedName];if(!shareInfos)return;const sharedOptions=shared.version?shareInfos.find(s=>s.version===shared.version):shareInfos;if(!sharedOptions)return;require_tool.arrayOptions(sharedOptions).forEach(s=>{collectSharedAssets(s,shared)})})}const needPreloadJsAssets=jsAssets.filter(asset=>!loadedSharedJsAssets.has(asset)&&!isExisted("script",asset));return{cssAssets:cssAssets.filter(asset=>!loadedSharedCssAssets.has(asset)&&!isExisted("link",asset)),jsAssetsWithoutEntry:needPreloadJsAssets,entryAssets:entryAssets.filter(entry=>!isExisted("script",entry.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(args){const{origin,preloadOptions,remoteInfo,remote,globalSnapshot,remoteSnapshot}=args;if(!_module_federation_sdk.isBrowserEnvValue)return{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]};if(require_tool.isRemoteInfoWithEntry(remote)&&require_tool.isPureRemoteEntry(remote))return{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:remote.name,url:remote.entry,moduleInfo:{name:remoteInfo.name,entry:remote.entry,type:remoteInfo.type||"global",entryGlobalName:"",shareScope:""}}]};require_index$1.assignRemoteInfo(remoteInfo,remoteSnapshot);return generatePreloadAssets(origin,preloadOptions,remoteInfo,globalSnapshot,remoteSnapshot)}}};exports.generatePreloadAssetsPlugin=generatePreloadAssetsPlugin},8281:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_asyncHook=__webpack_require__(2119);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function getGlobalRemoteInfo(moduleInfo,origin){const hostGlobalSnapshot=require_global.getGlobalSnapshotInfoByModuleInfo({name:origin.name,version:origin.options.version});const globalRemoteInfo=hostGlobalSnapshot&&"remotesInfo"in hostGlobalSnapshot&&hostGlobalSnapshot.remotesInfo&&require_global.getInfoWithoutType(hostGlobalSnapshot.remotesInfo,moduleInfo.name).value;if(globalRemoteInfo&&globalRemoteInfo.matchedVersion)return{hostGlobalSnapshot,globalSnapshot:require_global.getGlobalSnapshot(),remoteSnapshot:require_global.getGlobalSnapshotInfoByModuleInfo({name:moduleInfo.name,version:globalRemoteInfo.matchedVersion})};return{hostGlobalSnapshot:void 0,globalSnapshot:require_global.getGlobalSnapshot(),remoteSnapshot:require_global.getGlobalSnapshotInfoByModuleInfo({name:moduleInfo.name,version:"version"in moduleInfo?moduleInfo.version:void 0})}}var SnapshotHandler=class{constructor(HostInstance){this.loadingHostSnapshot=null;this.manifestCache=/* @__PURE__ */new Map;this.hooks=new require_pluginSystem.PluginSystem({beforeLoadRemoteSnapshot:new require_asyncHook.AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("afterLoadSnapshot")});this.manifestLoading=require_global.Global.__FEDERATION__.__MANIFEST_LOADING__;this.HostInstance=HostInstance;this.loaderHook=HostInstance.loaderHook}async loadRemoteSnapshotInfo({moduleInfo,id,initiator="loadRemote"}){const{options}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options,moduleInfo,origin:this.HostInstance});let hostSnapshot=require_global.getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});if(!hostSnapshot){hostSnapshot={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}};require_global.addGlobalSnapshot({[this.HostInstance.options.name]:hostSnapshot})}if(hostSnapshot&&"remotesInfo"in hostSnapshot&&!require_global.getInfoWithoutType(hostSnapshot.remotesInfo,moduleInfo.name).value){if("version"in moduleInfo||"entry"in moduleInfo)hostSnapshot.remotesInfo={...hostSnapshot?.remotesInfo,[moduleInfo.name]:{matchedVersion:"version"in moduleInfo?moduleInfo.version:moduleInfo.entry}}}const{hostGlobalSnapshot,remoteSnapshot,globalSnapshot}=this.getGlobalRemoteInfo(moduleInfo);const{remoteSnapshot:globalRemoteSnapshot,globalSnapshot:globalSnapshotRes}=await this.hooks.lifecycle.loadSnapshot.emit({options,moduleInfo,hostGlobalSnapshot,remoteSnapshot,globalSnapshot});let mSnapshot;let gSnapshot;if(globalRemoteSnapshot)if((0,_module_federation_sdk.isManifestProvider)(globalRemoteSnapshot)){const remoteEntry=_module_federation_sdk.isBrowserEnvValue?globalRemoteSnapshot.remoteEntry:globalRemoteSnapshot.ssrRemoteEntry||globalRemoteSnapshot.remoteEntry||"";const moduleSnapshot=await this.loadManifestSnapshot(remoteEntry,moduleInfo,{},{initiator,id:id||moduleInfo.name});const globalSnapshotRes=require_global.setGlobalSnapshotInfoByModuleInfo({...moduleInfo,entry:remoteEntry},moduleSnapshot);mSnapshot=moduleSnapshot;gSnapshot=globalSnapshotRes}else{const{remoteSnapshot:remoteSnapshotRes}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo,remoteSnapshot:globalRemoteSnapshot,from:"global"});mSnapshot=remoteSnapshotRes;gSnapshot=globalSnapshotRes}else if(require_tool.isRemoteInfoWithEntry(moduleInfo)){const moduleSnapshot=await this.loadManifestSnapshot(moduleInfo.entry,moduleInfo,{},{initiator,id:id||moduleInfo.name});const globalSnapshotRes=require_global.setGlobalSnapshotInfoByModuleInfo(moduleInfo,moduleSnapshot);mSnapshot=moduleSnapshot;gSnapshot=globalSnapshotRes}else require_logger.error(_module_federation_error_codes.RUNTIME_007,_module_federation_error_codes.runtimeDescMap,{remoteName:moduleInfo.name,remoteVersion:moduleInfo.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(globalSnapshotRes)},void 0,require_context.optionsToMFContext(this.HostInstance.options));await this.hooks.lifecycle.afterLoadSnapshot.emit({id,host:this.HostInstance,options,moduleInfo,remoteSnapshot:mSnapshot});return{remoteSnapshot:mSnapshot,globalSnapshot:gSnapshot}}getGlobalRemoteInfo(moduleInfo){return getGlobalRemoteInfo(moduleInfo,this.HostInstance)}async getManifestJson(manifestUrl,moduleInfo,extraOptions,resourceOptions){const getManifest=async()=>{const remoteInfo=require_load.getRemoteInfo(moduleInfo);let manifestJson=this.manifestCache.get(manifestUrl);if(manifestJson)return manifestJson;try{let res=await this.loaderHook.lifecycle.fetch.emit(manifestUrl,{},remoteInfo,resourceOptions?{...resourceOptions,url:manifestUrl,resourceType:"manifest"}:void 0);if(!res||!(res instanceof Response))res=await fetch(manifestUrl,{});manifestJson=await res.json()}catch(err){manifestJson=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:manifestUrl,error:err,from:"runtime",lifecycle:"afterResolve",remote:remoteInfo,origin:this.HostInstance});if(!manifestJson){delete this.manifestLoading[manifestUrl];require_logger.error(_module_federation_error_codes.RUNTIME_003,_module_federation_error_codes.runtimeDescMap,{manifestUrl,moduleName:moduleInfo.name,hostName:this.HostInstance.options.name},`${err}`,require_context.optionsToMFContext(this.HostInstance.options))}}const missingRequiredFields=[!manifestJson.metaData&&"metaData",!manifestJson.exposes&&"exposes",!manifestJson.shared&&"shared"].filter(Boolean);if(missingRequiredFields.length>0)await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:manifestUrl,error:/* @__PURE__ */new Error(`"${manifestUrl}" is not a valid federation manifest for remote "${moduleInfo.name}". Missing required fields: ${missingRequiredFields.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:remoteInfo,origin:this.HostInstance});if(missingRequiredFields.length>0)require_logger.error(_module_federation_error_codes.RUNTIME_013,_module_federation_error_codes.runtimeDescMap,{manifestUrl,moduleName:moduleInfo.name,hostName:this.HostInstance.options.name,missingFields:missingRequiredFields.join(",")},void 0,require_context.optionsToMFContext(this.HostInstance.options));this.manifestCache.set(manifestUrl,manifestJson);return manifestJson};return getManifest()}async loadManifestSnapshot(manifestUrl,moduleInfo,extraOptions,resourceOptions){const asyncLoadProcess=async()=>{const manifestJson=await this.getManifestJson(manifestUrl,moduleInfo,extraOptions,resourceOptions);const remoteSnapshot=(0,_module_federation_sdk.generateSnapshotFromManifest)(manifestJson,{version:manifestUrl});const{remoteSnapshot:remoteSnapshotRes}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo,manifestJson,remoteSnapshot,manifestUrl,from:"manifest"});return remoteSnapshotRes};if(!this.manifestLoading[manifestUrl])this.manifestLoading[manifestUrl]=asyncLoadProcess().then(res=>res);return this.manifestLoading[manifestUrl]}};exports.SnapshotHandler=SnapshotHandler;exports.getGlobalRemoteInfo=getGlobalRemoteInfo},1625:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_manifest=__webpack_require__(90);__webpack_require__(4011);const require_preload=__webpack_require__(9064);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function assignRemoteInfo(remoteInfo,remoteSnapshot){const remoteEntryInfo=require_tool.getRemoteEntryInfoFromSnapshot(remoteSnapshot);if(!remoteEntryInfo.url)require_logger.error(_module_federation_error_codes.RUNTIME_011,_module_federation_error_codes.runtimeDescMap,{remoteName:remoteInfo.name});let entryUrl=(0,_module_federation_sdk.getResourceUrl)(remoteSnapshot,remoteEntryInfo.url);if(!_module_federation_sdk.isBrowserEnvValue&&!entryUrl.startsWith("http"))entryUrl=`https:${entryUrl}`;remoteInfo.type=remoteEntryInfo.type;remoteInfo.entryGlobalName=remoteEntryInfo.globalName;remoteInfo.entry=entryUrl;remoteInfo.version=remoteSnapshot.version;remoteInfo.buildVersion=remoteSnapshot.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(args){const{remote,pkgNameOrAlias,expose,origin,remoteInfo,id}=args;if(!require_tool.isRemoteInfoWithEntry(remote)||!require_tool.isPureRemoteEntry(remote)){const{remoteSnapshot,globalSnapshot}=await origin.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:remote,id:require_manifest.composeRemoteRequestId(remote.name,expose)});assignRemoteInfo(remoteInfo,remoteSnapshot);const preloadOptions={remote,preloadConfig:{nameOrAlias:pkgNameOrAlias,exposes:[expose],resourceCategory:"sync",share:false,depsRemote:false}};const assets=await origin.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin,preloadOptions,remoteInfo,remote,remoteSnapshot,globalSnapshot});if(assets)require_preload.preloadAssets(remoteInfo,origin,assets,false,{initiator:"loadRemote",id}).catch(()=>void 0);return{...args,remoteSnapshot}}return args}}}exports.assignRemoteInfo=assignRemoteInfo;exports.snapshotPlugin=snapshotPlugin},8984:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const require_index$1=__webpack_require__(1518);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);const require_SnapshotHandler=__webpack_require__(8281);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);var RemoteHandler=class{constructor(host){this.hooks=new require_pluginSystem.PluginSystem({beforeRegisterRemote:new require_syncWaterfallHook.SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new require_syncWaterfallHook.SyncWaterfallHook("registerRemote"),beforeRequest:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeRequest"),afterMatchRemote:new require_asyncHook.AsyncHook("afterMatchRemote"),onLoad:new require_asyncHook.AsyncHook("onLoad"),afterLoadRemote:new require_asyncHook.AsyncHook("afterLoadRemote"),handlePreloadModule:new require_syncHook.SyncHook("handlePreloadModule"),errorLoadRemote:new require_asyncHook.AsyncHook("errorLoadRemote"),beforePreloadRemote:new require_asyncHook.AsyncHook("beforePreloadRemote"),generatePreloadAssets:new require_asyncHook.AsyncHook("generatePreloadAssets"),afterPreloadRemote:new require_asyncHook.AsyncHook("afterPreloadRemote"),loadEntry:new require_asyncHook.AsyncHook});this.host=host;this.idToRemoteMap={}}formatAndRegisterRemote(globalOptions,userOptions){return(userOptions.remotes||[]).reduce((res,remote)=>{this.registerRemote(remote,res,{force:false});return res},globalOptions.remotes)}setIdToRemoteMap(id,remoteMatchInfo){const{remote,expose}=remoteMatchInfo;const{name,alias}=remote;this.idToRemoteMap[id]={name:remote.name,expose};if(alias&&id.startsWith(name)){const idWithAlias=id.replace(name,alias);this.idToRemoteMap[idWithAlias]={name:remote.name,expose};return}if(alias&&id.startsWith(alias)){const idWithName=id.replace(alias,name);this.idToRemoteMap[idWithName]={name:remote.name,expose}}}async loadRemote(id,options){const{host}=this;const startMatchInfo=require_manifest.matchRemoteWithNameAndExpose(host.options.remotes,id);let completeRequestId=id;let completeExpose=startMatchInfo?.expose;let completeRemote=startMatchInfo?require_load.getRemoteInfo(startMatchInfo.remote):void 0;let afterLoadRemoteArgs;try{const{loadFactory=true}=options||{loadFactory:true};const{module:module1,moduleOptions,remoteMatchInfo}=await this.getRemoteModuleAndOptions({id});const{pkgNameOrAlias,remote,expose,id:idRes,remoteSnapshot}=remoteMatchInfo;completeRequestId=idRes;completeExpose=expose;completeRemote=require_load.getRemoteInfo(remote);const moduleOrFactory=await module1.get(idRes,expose,options,remoteSnapshot);const moduleWrapper=await this.hooks.lifecycle.onLoad.emit({id:idRes,pkgNameOrAlias,expose,exposeModule:loadFactory?moduleOrFactory:void 0,exposeModuleFactory:loadFactory?void 0:moduleOrFactory,remote,options:moduleOptions,moduleInstance:module1,origin:host});this.setIdToRemoteMap(id,remoteMatchInfo);afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,origin:host};if("function"==typeof moduleWrapper)return moduleWrapper;return moduleOrFactory}catch(error){const{from="runtime"}=options||{from:"runtime"};let failOver;try{failOver=await this.hooks.lifecycle.errorLoadRemote.emit({id,error,from,lifecycle:"onLoad",expose:completeExpose,remote:completeRemote,origin:host})}catch(hookError){afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error:hookError,origin:host};throw hookError}if(!failOver){afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error,origin:host};throw error}afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error,origin:host,recovered:true};return failOver}finally{if(afterLoadRemoteArgs)await this.hooks.lifecycle.afterLoadRemote.emit(afterLoadRemoteArgs)}}async preloadRemote(preloadOptions){const{host}=this;const preloadResults=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:preloadOptions,options:host.options,origin:host});const preloadOps=require_preload.formatPreloadArgs(host.options.remotes,preloadOptions);const createPreloadAssetOps=ops=>{const{preloadConfig,remote}=ops;const exposes=preloadConfig.exposes||[];if(!exposes.length)return[{ops,id:`${remote.name}/*`}];return exposes.map(expose=>({ops:{...ops,preloadConfig:{...preloadConfig,exposes:[expose]}},id:require_manifest.composeRemoteRequestId(remote.name,expose)}))};let preloadError;await Promise.all(preloadOps.flatMap(createPreloadAssetOps).map(async assetOps=>{const{ops,id:preloadId}=assetOps;const{remote,preloadConfig}=ops;const remoteInfo=require_load.getRemoteInfo(remote);try{const{globalSnapshot,remoteSnapshot}=await host.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:remote,id:preloadId,initiator:"preloadRemote"});const assets=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:host,preloadOptions:ops,remote,remoteInfo,globalSnapshot,remoteSnapshot});if(!assets)return;const results=await require_preload.preloadAssets(remoteInfo,host,assets,true,{initiator:"preloadRemote",id:preloadId});preloadResults.push({remote,remoteInfo,preloadConfig,id:preloadId,results})}catch(error){preloadResults.push({remote,remoteInfo,preloadConfig,id:preloadId,results:[{url:remoteInfo.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(remoteInfo.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:preloadId,error}]})}}));const failedResults=preloadResults.flatMap(preloadResult=>preloadResult.results.filter(result=>"error"===result.status||"timeout"===result.status));if(failedResults.length>0){preloadError=/* @__PURE__ */new Error(`preloadRemote failed to load ${failedResults.length} resource(s).`);Object.assign(preloadError,{results:preloadResults,failedResults})}await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:preloadOptions,options:host.options,origin:host,results:preloadResults,error:preloadError});if(preloadError)throw preloadError}registerRemotes(remotes,options){const{host}=this;remotes.forEach(remote=>{this.registerRemote(remote,host.options.remotes,{force:options?.force})})}async getRemoteModuleAndOptions(options){const{host}=this;const{id}=options;let loadRemoteArgs;try{loadRemoteArgs=await this.hooks.lifecycle.beforeRequest.emit({id,options:host.options,origin:host})}catch(error){loadRemoteArgs=await this.hooks.lifecycle.errorLoadRemote.emit({id,options:host.options,origin:host,from:"runtime",error,lifecycle:"beforeRequest"});if(!loadRemoteArgs)throw error}const{id:idRes}=loadRemoteArgs;const remoteSplitInfo=require_manifest.matchRemoteWithNameAndExpose(host.options.remotes,idRes);if(!remoteSplitInfo)try{require_logger.error(_module_federation_error_codes.RUNTIME_004,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,requestId:idRes},void 0,require_context.optionsToMFContext(host.options))}catch(matchError){await this.hooks.lifecycle.afterMatchRemote.emit({id:idRes,options:host.options,error:matchError,origin:host});throw matchError}const{remote:rawRemote}=remoteSplitInfo;const remoteInfo=require_load.getRemoteInfo(rawRemote);await this.hooks.lifecycle.afterMatchRemote.emit({id:idRes,...remoteSplitInfo,options:host.options,remoteInfo,origin:host});const matchInfo=await host.sharedHandler.hooks.lifecycle.afterResolve.emit({id:idRes,...remoteSplitInfo,options:host.options,origin:host,remoteInfo});const{remote,expose}=matchInfo;require_logger.assert(remote&&expose,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${idRes}.`);let module1=host.moduleCache.get(remote.name);const moduleOptions={host,remoteInfo};if(!module1){module1=new require_index$1.Module(moduleOptions);host.moduleCache.set(remote.name,module1)}return{module:module1,moduleOptions,remoteMatchInfo:matchInfo}}registerRemote(remote,targetRemotes,options){const{host}=this;const normalizeRemote=()=>{if(remote.alias){const findEqual=targetRemotes.find(item=>remote.alias&&(item.name.startsWith(remote.alias)||item.alias?.startsWith(remote.alias)));require_logger.assert(!findEqual,`The alias ${remote.alias} of remote ${remote.name} is not allowed to be the prefix of ${findEqual&&findEqual.name} name or alias`)}if("entry"in remote){if(_module_federation_sdk.isBrowserEnvValue&&"undefined"!=typeof window&&!remote.entry.startsWith("http"))remote.entry=new URL(remote.entry,window.location.origin).href}if(!remote.shareScope)remote.shareScope=require_constant.DEFAULT_SCOPE;if(!remote.type)remote.type=require_constant.DEFAULT_REMOTE_TYPE};this.hooks.lifecycle.beforeRegisterRemote.emit({remote,origin:host});const registeredRemote=targetRemotes.find(item=>item.name===remote.name);if(registeredRemote){const messages=[`The remote "${remote.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];if(options?.force){this.removeRemote(registeredRemote);normalizeRemote();targetRemotes.push(remote);this.hooks.lifecycle.registerRemote.emit({remote,origin:host});(0,_module_federation_sdk.warn)(messages.join(" "))}}else{normalizeRemote();targetRemotes.push(remote);this.hooks.lifecycle.registerRemote.emit({remote,origin:host})}}removeRemote(remote){try{const{host}=this;const{name}=remote;const remoteIndex=host.options.remotes.findIndex(item=>item.name===name);if(-1!==remoteIndex)host.options.remotes.splice(remoteIndex,1);const globalSnapshotKey=require_global.getInfoWithoutType(require_global.CurrentGlobal.__FEDERATION__.moduleInfo,require_tool.getFMId(remote)).key;delete require_global.CurrentGlobal.__FEDERATION__.moduleInfo[globalSnapshotKey];if("entry"in remote){host.snapshotHandler.manifestCache.delete(remote.entry);delete require_global.Global.__FEDERATION__.__MANIFEST_LOADING__[remote.entry]}const{hostGlobalSnapshot}=require_SnapshotHandler.getGlobalRemoteInfo(remote,host);if(hostGlobalSnapshot){const remoteKey=hostGlobalSnapshot&&"remotesInfo"in hostGlobalSnapshot&&hostGlobalSnapshot.remotesInfo&&require_global.getInfoWithoutType(hostGlobalSnapshot.remotesInfo,remote.name).key;if(remoteKey)delete hostGlobalSnapshot.remotesInfo[remoteKey]}const loadedModule=host.moduleCache.get(remote.name);if(loadedModule){const remoteInfo=loadedModule.remoteInfo;const key=remoteInfo.entryGlobalName;if(require_global.CurrentGlobal[key])if(Object.getOwnPropertyDescriptor(require_global.CurrentGlobal,key)?.configurable)delete require_global.CurrentGlobal[key];else require_global.CurrentGlobal[key]=void 0;const remoteEntryUniqueKey=require_load.getRemoteEntryUniqueKey(loadedModule.remoteInfo);if(require_global.globalLoading[remoteEntryUniqueKey])delete require_global.globalLoading[remoteEntryUniqueKey];let remoteInsId=remoteInfo.buildVersion?(0,_module_federation_sdk.composeKeyWithSeparator)(remoteInfo.name,remoteInfo.buildVersion):remoteInfo.name;const remoteInsIndex=require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(ins=>{if(remoteInfo.buildVersion)return ins.options.id===remoteInsId;return ins.name===remoteInsId});if(-1!==remoteInsIndex){const remoteIns=require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__[remoteInsIndex];remoteInsId=remoteIns.options.id||remoteInsId;const globalShareScopeMap=require_share.getGlobalShareScope();let isAllSharedNotUsed=true;const needDeleteKeys=[];Object.keys(globalShareScopeMap).forEach(instId=>{const shareScopeMap=globalShareScopeMap[instId];shareScopeMap&&Object.keys(shareScopeMap).forEach(shareScope=>{const shareScopeVal=shareScopeMap[shareScope];shareScopeVal&&Object.keys(shareScopeVal).forEach(shareName=>{const sharedPkgs=shareScopeVal[shareName];sharedPkgs&&Object.keys(sharedPkgs).forEach(shareVersion=>{const shared=sharedPkgs[shareVersion];if(shared&&"object"==typeof shared&&shared.from===remoteInfo.name)if(shared.loaded||shared.loading){shared.useIn=shared.useIn.filter(usedHostName=>usedHostName!==remoteInfo.name);if(shared.useIn.length)isAllSharedNotUsed=false;else needDeleteKeys.push([instId,shareScope,shareName,shareVersion])}else needDeleteKeys.push([instId,shareScope,shareName,shareVersion])})})})});if(isAllSharedNotUsed){remoteIns.shareScopeMap={};delete globalShareScopeMap[remoteInsId]}needDeleteKeys.forEach(([insId,shareScope,shareName,shareVersion])=>{delete globalShareScopeMap[insId]?.[shareScope]?.[shareName]?.[shareVersion]});require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(remoteInsIndex,1)}host.moduleCache.delete(remote.name)}}catch(err){require_logger.logger.error(`removeRemote failed: ${err instanceof Error?err.message:String(err)}`)}}};exports.RemoteHandler=RemoteHandler},805:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);let _module_federation_error_codes=__webpack_require__(7110);var SharedHandler=class{constructor(host){this.hooks=new require_pluginSystem.PluginSystem({beforeRegisterShare:new require_syncWaterfallHook.SyncWaterfallHook("beforeRegisterShare"),afterResolve:new require_asyncWaterfallHooks.AsyncWaterfallHook("afterResolve"),beforeLoadShare:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeLoadShare"),loadShare:new require_asyncHook.AsyncHook,afterLoadShare:new require_syncHook.SyncHook("afterLoadShare"),errorLoadShare:new require_syncHook.SyncHook("errorLoadShare"),resolveShare:new require_syncWaterfallHook.SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new require_syncWaterfallHook.SyncWaterfallHook("initContainerShareScopeMap")});this.host=host;this.shareScopeMap={};this.initTokens={};this._setGlobalShareScopeMap(host.options)}emitAfterLoadShare({lifecycle,pkgName,shareInfo,selectedShared}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName,shareInfo,selectedShared,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle,origin:this.host})}catch(error){require_logger.warn(error)}}emitErrorLoadShare({lifecycle,pkgName,shareInfo,error,recovered}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName,shareInfo,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle,origin:this.host,error,recovered})}catch(hookError){require_logger.warn(hookError)}}registerShared(globalOptions,userOptions){const{newShareInfos,allShareInfos}=require_share.formatShareConfigs(globalOptions,userOptions);Object.keys(newShareInfos).forEach(sharedKey=>{newShareInfos[sharedKey].forEach(sharedVal=>{sharedVal.scope.forEach(sc=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:sharedKey,shared:sharedVal});if(!this.shareScopeMap[sc]?.[sharedKey])this.setShared({pkgName:sharedKey,lib:sharedVal.lib,get:sharedVal.get,loaded:sharedVal.loaded||Boolean(sharedVal.lib),shared:sharedVal,from:userOptions.name})})})});return{newShareInfos,allShareInfos}}async loadShare(pkgName,extraOptions){const{host}=this;const shareOptions=require_share.getTargetSharedOptions({pkgName,extraOptions,shareInfos:host.options.shared});let shareOptionsRes=shareOptions;try{if(shareOptions?.scope)await Promise.all(shareOptions.scope.map(async shareScope=>{await Promise.all(this.initializeSharing(shareScope,{strategy:shareOptions.strategy}))}));shareOptionsRes=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName,shareInfo:shareOptions,shared:host.options.shared,origin:host})).shareInfo;require_logger.assert(shareOptionsRes,`Cannot find shared "${pkgName}" in host "${host.options.name}". Ensure the shared config for "${pkgName}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const resolvedShareOptions=shareOptionsRes;const{shared:registeredShared,useTreesShaking}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,shareOptionsRes,this.hooks.lifecycle.resolveShare)||{};if(registeredShared){const targetShared=require_share.directShare(registeredShared,useTreesShaking);if(targetShared.lib){require_share.addUseIn(targetShared,host.options.name);this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return targetShared.lib}if(targetShared.loading&&!targetShared.loaded){const factory=await targetShared.loading;targetShared.loaded=true;if(!targetShared.lib)targetShared.lib=factory;require_share.addUseIn(targetShared,host.options.name);this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return factory}{const asyncLoadProcess=async()=>{const factory=await targetShared.get();require_share.addUseIn(targetShared,host.options.name);targetShared.loaded=true;targetShared.lib=factory;return factory};const loading=asyncLoadProcess();this.setShared({pkgName,loaded:false,shared:registeredShared,from:host.options.name,lib:null,loading,treeShaking:useTreesShaking?targetShared:void 0});const factory=await loading;this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return factory}}{if(extraOptions?.customShareInfo){this.emitErrorLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,recovered:true});return false}const _useTreeShaking=require_share.shouldUseTreeShaking(resolvedShareOptions.treeShaking);const targetShared=require_share.directShare(resolvedShareOptions,_useTreeShaking);const asyncLoadProcess=async()=>{const factory=await targetShared.get();targetShared.lib=factory;targetShared.loaded=true;require_share.addUseIn(targetShared,host.options.name);const{shared:gShared,useTreesShaking:gUseTreeShaking}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,resolvedShareOptions,this.hooks.lifecycle.resolveShare)||{};if(gShared){const targetGShared=require_share.directShare(gShared,gUseTreeShaking);targetGShared.lib=factory;targetGShared.loaded=true;gShared.from=resolvedShareOptions.from}return factory};const loading=asyncLoadProcess();this.setShared({pkgName,loaded:false,shared:resolvedShareOptions,from:host.options.name,lib:null,loading,treeShaking:_useTreeShaking?targetShared:void 0});const factory=await loading;this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:resolvedShareOptions});return factory}}catch(shareError){this.emitErrorLoadShare({lifecycle:"loadShare",pkgName,shareInfo:shareOptionsRes,error:shareError});throw shareError}}initializeSharing(shareScopeName=require_constant.DEFAULT_SCOPE,extraOptions){const{host}=this;const from=extraOptions?.from;const strategy=extraOptions?.strategy;let initScope=extraOptions?.initScope;const promises=[];if("build"!==from){const{initTokens}=this;if(!initScope)initScope=[];let initToken=initTokens[shareScopeName];if(!initToken)initToken=initTokens[shareScopeName]={from:this.host.name};if(initScope.indexOf(initToken)>=0)return promises;initScope.push(initToken)}const shareScope=this.shareScopeMap;const hostName=host.options.name;if(!shareScope[shareScopeName])shareScope[shareScopeName]={};const scope=shareScope[shareScopeName];const register=(name,shared)=>{const{version,eager}=shared;scope[name]=scope[name]||{};const versions=scope[name];const activeVersion=versions[version]&&require_share.directShare(versions[version]);const activeVersionEager=Boolean(activeVersion&&("eager"in activeVersion&&activeVersion.eager||"shareConfig"in activeVersion&&activeVersion.shareConfig?.eager));if(!activeVersion||"loaded-first"!==activeVersion.strategy&&!activeVersion.loaded&&(Boolean(!eager)!==!activeVersionEager?eager:hostName>versions[version].from))versions[version]=shared};const initRemoteModule=async key=>{const{module:module1}=await host.remoteHandler.getRemoteModuleAndOptions({id:key});let remoteEntryExports;try{remoteEntryExports=await module1.getEntry()}catch(error){remoteEntryExports=await host.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:key,error,from:"runtime",lifecycle:"beforeLoadShare",remote:module1.remoteInfo,origin:host});if(!remoteEntryExports)return}finally{if(remoteEntryExports?.init&&!module1.initing){module1.remoteEntryExports=remoteEntryExports;await module1.init(void 0,void 0,initScope)}}};Object.keys(host.options.shared).forEach(shareName=>{host.options.shared[shareName].forEach(shared=>{if(shared.scope.includes(shareScopeName))register(shareName,shared)})});if("version-first"===host.options.shareStrategy||"version-first"===strategy)host.options.remotes.forEach(remote=>{if(remote.shareScope===shareScopeName)promises.push(initRemoteModule(remote.name))});return promises}loadShareSync(pkgName,extraOptions){const{host}=this;const shareOptions=require_share.getTargetSharedOptions({pkgName,extraOptions,shareInfos:host.options.shared});try{if(shareOptions?.scope)shareOptions.scope.forEach(shareScope=>{this.initializeSharing(shareScope,{strategy:shareOptions.strategy})});const{shared:registeredShared}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,shareOptions,this.hooks.lifecycle.resolveShare)||{};if(registeredShared){if("function"==typeof registeredShared.lib){require_share.addUseIn(registeredShared,host.options.name);if(!registeredShared.loaded){registeredShared.loaded=true;if(registeredShared.from===host.options.name)shareOptions.loaded=true}this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:registeredShared});return registeredShared.lib}if("function"==typeof registeredShared.get){const module1=registeredShared.get();if(!(module1 instanceof Promise)){require_share.addUseIn(registeredShared,host.options.name);this.setShared({pkgName,loaded:true,from:host.options.name,lib:module1,shared:registeredShared});this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:registeredShared});return module1}}}if(shareOptions.lib){if(!shareOptions.loaded)shareOptions.loaded=true;this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:shareOptions});return shareOptions.lib}if(shareOptions.get){const module1=shareOptions.get();if(module1 instanceof Promise)require_logger.error(extraOptions?.from==="build"?_module_federation_error_codes.RUNTIME_005:_module_federation_error_codes.RUNTIME_006,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,sharedPkgName:pkgName},void 0,require_context.optionsToMFContext(host.options));shareOptions.lib=module1;this.setShared({pkgName,loaded:true,from:host.options.name,lib:shareOptions.lib,shared:shareOptions});this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:shareOptions});return shareOptions.lib}require_logger.error(_module_federation_error_codes.RUNTIME_006,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,sharedPkgName:pkgName},void 0,require_context.optionsToMFContext(host.options))}catch(shareError){this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,error:shareError});throw shareError}}initShareScopeMap(scopeName,shareScope,extraOptions={}){const{host}=this;this.shareScopeMap[scopeName]=shareScope;this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope,options:host.options,origin:host,scopeName,hostShareScopeMap:extraOptions.hostShareScopeMap})}setShared({pkgName,shared,from,lib,loading,loaded,get,treeShaking}){const{version,scope="default",...shareInfo}=shared;const scopes=Array.isArray(scope)?scope:[scope];const mergeAttrs=shared=>{const merge=(s,key,val)=>{if(val&&!s[key])s[key]=val};const targetShared=treeShaking?shared.treeShaking:shared;merge(targetShared,"loaded",loaded);merge(targetShared,"loading",loading);merge(targetShared,"get",get)};scopes.forEach(sc=>{if(!this.shareScopeMap[sc])this.shareScopeMap[sc]={};if(!this.shareScopeMap[sc][pkgName])this.shareScopeMap[sc][pkgName]={};if(!this.shareScopeMap[sc][pkgName][version])this.shareScopeMap[sc][pkgName][version]={version,scope:[sc],...shareInfo,lib};const registeredShared=this.shareScopeMap[sc][pkgName][version];mergeAttrs(registeredShared);if(from&®isteredShared.from!==from)registeredShared.from=from})}_setGlobalShareScopeMap(hostOptions){const globalShareScopeMap=require_share.getGlobalShareScope();const identifier=hostOptions.id||hostOptions.name;if(identifier&&!globalShareScopeMap[identifier])globalShareScopeMap[identifier]=this.shareScopeMap}};exports.SharedHandler=SharedHandler},9998:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(5617);var type_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"type_exports",{enumerable:true,get:function(){return type_exports}})},5086:function(__unused_webpack_module,exports){function remoteToEntry(r){return{name:r.name,alias:r.alias,entry:"entry"in r?r.entry:void 0,version:"version"in r?r.version:void 0,type:r.type,entryGlobalName:r.entryGlobalName,shareScope:r.shareScope}}function optionsToMFContext(options){const shared={};for(const[pkgName,versions]of Object.entries(options.shared)){const first=versions[0];if(first)shared[pkgName]={version:first.version,singleton:first.shareConfig?.singleton,requiredVersion:first.shareConfig?.requiredVersion===false?false:first.shareConfig?.requiredVersion,eager:first.eager,strictVersion:first.shareConfig?.strictVersion}}return{project:{name:options.name,mfRole:options.remotes?.length>0?"host":"unknown"},mfConfig:{name:options.name,remotes:options.remotes?.map(remoteToEntry)??[],shared}}}exports.optionsToMFContext=optionsToMFContext},8042:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(1487);function getBuilderId(){return"mf_playground:0.0.2"}exports.getBuilderId=getBuilderId},2119:function(__unused_webpack_module,exports,__webpack_require__){const require_syncHook=__webpack_require__(2734);var AsyncHook=class extends require_syncHook.SyncHook{emit(...data){let result;const ls=Array.from(this.listeners);if(ls.length>0){let i=0;const call=prev=>{if(false===prev)return false;if(i<ls.length)return Promise.resolve(ls[i++].apply(null,data)).then(result=>{if(void 0===result||1===data.length&&result===data[0])return call(prev);return call(result)});return prev};result=call()}return Promise.resolve(result)}};exports.AsyncHook=AsyncHook},2284:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_syncHook=__webpack_require__(2734);const require_syncWaterfallHook=__webpack_require__(8210);var AsyncWaterfallHook=class extends require_syncHook.SyncHook{constructor(type){super();this.onerror=require_logger.error;this.type=type}emit(data){if(!require_tool.isObject(data))require_logger.error(`The response data for the "${this.type}" hook must be an object.`);const ls=Array.from(this.listeners);if(ls.length>0){let i=0;const processError=e=>{require_logger.warn(e);this.onerror(e);return data};const call=prevData=>{if(void 0!==prevData&&require_syncWaterfallHook.checkReturnData(data,prevData))data=prevData;else if(void 0!==prevData){this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return data}if(i<ls.length)try{return Promise.resolve(ls[i++](data)).then(call,processError)}catch(e){return processError(e)}return data};return Promise.resolve(call(data))}return Promise.resolve(data)}};exports.AsyncWaterfallHook=AsyncWaterfallHook},2094:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(2734);__webpack_require__(2119);__webpack_require__(8210);__webpack_require__(2284);__webpack_require__(9560)},9560:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);__webpack_require__(4011);var PluginSystem=class{constructor(lifecycle){this.registerPlugins={};this.lifecycle=lifecycle;this.lifecycleKeys=Object.keys(lifecycle)}applyPlugin(plugin,instance){require_logger.assert(require_tool.isPlainObject(plugin),"Plugin configuration is invalid.");const pluginName=plugin.name;require_logger.assert(pluginName,"A name must be provided by the plugin.");if(!this.registerPlugins[pluginName]){this.registerPlugins[pluginName]=plugin;plugin.apply?.(instance);Object.keys(this.lifecycle).forEach(key=>{const pluginLife=plugin[key];if(pluginLife)this.lifecycle[key].on(pluginLife)})}}removePlugin(pluginName){require_logger.assert(pluginName,"A name is required.");const plugin=this.registerPlugins[pluginName];require_logger.assert(plugin,`The plugin "${pluginName}" is not registered.`);Object.keys(plugin).forEach(key=>{if("name"!==key)this.lifecycle[key].remove(plugin[key])})}};exports.PluginSystem=PluginSystem},2734:function(__unused_webpack_module,exports){var SyncHook=class{constructor(type){this.type="";this.listeners=/* @__PURE__ */new Set;if(type)this.type=type}on(fn){if("function"==typeof fn)this.listeners.add(fn)}once(fn){const self=this;this.on(function wrapper(...args){self.remove(wrapper);return fn.apply(null,args)})}emit(...data){let result;if(this.listeners.size>0)this.listeners.forEach(fn=>{const nextResult=fn(...data);if(void 0!==nextResult)result=nextResult});return result}remove(fn){this.listeners.delete(fn)}removeAll(){this.listeners.clear()}};exports.SyncHook=SyncHook},8210:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_syncHook=__webpack_require__(2734);function checkReturnData(originalData,returnedData){if(!require_tool.isObject(returnedData))return false;if(originalData!==returnedData){for(const key in originalData)if(!(key in returnedData))return false}return true}var SyncWaterfallHook=class extends require_syncHook.SyncHook{constructor(type){super();this.onerror=require_logger.error;this.type=type}emit(data){if(!require_tool.isObject(data))require_logger.error(`The data for the "${this.type}" hook should be an object.`);for(const fn of this.listeners)try{const tempData=fn(data);if(void 0===tempData)continue;if(checkReturnData(data,tempData))data=tempData;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){require_logger.warn(e);this.onerror(e)}return data}};exports.SyncWaterfallHook=SyncWaterfallHook;exports.checkReturnData=checkReturnData},4011:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(7657);__webpack_require__(8607);__webpack_require__(8042);__webpack_require__(90);__webpack_require__(3584);__webpack_require__(5265);__webpack_require__(5086);__webpack_require__(1487)},5265:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);const importCallback=".then(callbacks[0]).catch(callbacks[1])";async function loadEsmEntry({entry,remoteEntryExports}){return new Promise((resolve,reject)=>{try{if(remoteEntryExports)resolve(remoteEntryExports);else if("undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION)new Function("callbacks",`import("${entry}")${importCallback}`)([resolve,reject]);else import(/* @vite-ignore */entry).then(resolve).catch(reject)}catch(e){require_logger.error(`Failed to load ESM entry from "${entry}". ${e instanceof Error?e.message:String(e)}`)}})}async function loadSystemJsEntry({entry,remoteEntryExports}){return new Promise((resolve,reject)=>{try{if(remoteEntryExports)resolve(remoteEntryExports);else new Function("callbacks",`System.import("${entry}")${importCallback}`)([resolve,reject])}catch(e){require_logger.error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error?e.message:String(e)}`)}})}function handleRemoteEntryLoaded(name,globalName,entry){const{remoteEntryKey,entryExports}=require_global.getRemoteEntryExports(name,globalName);if(!entryExports)require_logger.error(_module_federation_error_codes.RUNTIME_001,_module_federation_error_codes.runtimeDescMap,{remoteName:name,remoteEntryUrl:entry,remoteEntryKey});return entryExports}async function loadEntryScript({name,globalName,entry,remoteInfo,loaderHook,getEntryUrl,resourceContext}){const{entryExports:remoteEntryExports}=require_global.getRemoteEntryExports(name,globalName);if(remoteEntryExports)return remoteEntryExports;const url=getEntryUrl?getEntryUrl(entry):entry;return(0,_module_federation_sdk.loadScript)(url,{attrs:{},createScriptHook:(url,attrs)=>{const res=loaderHook.lifecycle.createScript.emit({url,attrs,remoteInfo,resourceContext:resourceContext?{...resourceContext,url}:void 0});if(!res)return;if(res instanceof HTMLScriptElement)return res;if("script"in res||"timeout"in res)return res}}).then(()=>handleRemoteEntryLoaded(name,globalName,entry),loadError=>{const originalMsg=loadError instanceof Error?loadError.message:String(loadError);require_logger.error(_module_federation_error_codes.RUNTIME_008,_module_federation_error_codes.runtimeDescMap,{remoteName:name,resourceUrl:url},originalMsg)})}async function loadEntryDom({remoteInfo,remoteEntryExports,loaderHook,getEntryUrl,resourceContext}){const{entry,entryGlobalName:globalName,name,type}=remoteInfo;switch(type){case"esm":case"module":return loadEsmEntry({entry,remoteEntryExports});case"system":return loadSystemJsEntry({entry,remoteEntryExports});default:return loadEntryScript({entry,globalName,name,remoteInfo,loaderHook,getEntryUrl,resourceContext})}}async function loadEntryNode({remoteInfo,loaderHook,resourceContext}){const{entry,entryGlobalName:globalName,name,type}=remoteInfo;const{entryExports:remoteEntryExports}=require_global.getRemoteEntryExports(name,globalName);if(remoteEntryExports)return remoteEntryExports;return(0,_module_federation_sdk.loadScriptNode)(entry,{attrs:{name,globalName,type},loaderHook:{createScriptHook:(url,attrs={})=>{const res=loaderHook.lifecycle.createScript.emit({url,attrs,remoteInfo,resourceContext:resourceContext?{...resourceContext,url}:void 0});if(!res)return;if("url"in res)return res}}}).then(()=>handleRemoteEntryLoaded(name,globalName,entry)).catch(e=>{require_logger.error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error?e.message:String(e)}`)})}function getRemoteEntryUniqueKey(remoteInfo){const{entry,name}=remoteInfo;return(0,_module_federation_sdk.composeKeyWithSeparator)(name,entry)}async function getRemoteEntry(params){const{origin,remoteEntryExports,remoteInfo,getEntryUrl,resourceContext,_inErrorHandling=false}=params;const uniqueKey=getRemoteEntryUniqueKey(remoteInfo);if(remoteEntryExports)return remoteEntryExports;if(!require_global.globalLoading[uniqueKey]){const loadEntryHook=origin.remoteHandler.hooks.lifecycle.loadEntry;const loaderHook=origin.loaderHook;require_global.globalLoading[uniqueKey]=loadEntryHook.emit({origin,loaderHook,remoteInfo,remoteEntryExports}).then(res=>{if(res)return res;return("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:_module_federation_sdk.isBrowserEnvValue)?loadEntryDom({remoteInfo,remoteEntryExports,loaderHook,getEntryUrl,resourceContext}):loadEntryNode({remoteInfo,loaderHook,resourceContext})}).then(async res=>{await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,remoteEntryExports:res});return res}).catch(async err=>{const uniqueKey=getRemoteEntryUniqueKey(remoteInfo);const isScriptExecutionError=err instanceof Error&&err.message.includes("ScriptExecutionError");if(err instanceof Error&&err.message.includes(_module_federation_error_codes.RUNTIME_008)&&!isScriptExecutionError&&!_inErrorHandling){const wrappedGetRemoteEntry=params=>getRemoteEntry({...params,_inErrorHandling:true});const RemoteEntryExports=await origin.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:wrappedGetRemoteEntry,origin,remoteInfo,remoteEntryExports,globalLoading:require_global.globalLoading,uniqueKey});if(RemoteEntryExports){await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,remoteEntryExports:RemoteEntryExports,recovered:true});return RemoteEntryExports}}await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,error:err});throw err})}return require_global.globalLoading[uniqueKey]}function getRemoteInfo(remote){return{...remote,entry:"entry"in remote?remote.entry:"",type:remote.type||require_constant.DEFAULT_REMOTE_TYPE,entryGlobalName:remote.entryGlobalName||remote.name,shareScope:remote.shareScope||require_constant.DEFAULT_SCOPE}}exports.getRemoteEntry=getRemoteEntry;exports.getRemoteEntryUniqueKey=getRemoteEntryUniqueKey;exports.getRemoteInfo=getRemoteInfo},7657:function(__unused_webpack_module,exports,__webpack_require__){let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes_browser=__webpack_require__(6550);const LOG_CATEGORY="[ Federation Runtime ]";const logger=(0,_module_federation_sdk.createLogger)(LOG_CATEGORY);function assert(condition,msgOrCode,descMap,args,context){if(!condition)void 0!==descMap?error(msgOrCode,descMap,args,void 0,context):error(msgOrCode)}function error(msgOrCode,descMap,args,originalErrorMsg,context){if(void 0!==descMap)return(0,_module_federation_error_codes_browser.logAndReport)(msgOrCode,descMap,args??{},msg=>{throw new Error(`${LOG_CATEGORY}: ${msg}`)},originalErrorMsg,context);const msg=msgOrCode;if(msg instanceof Error){if(!msg.message.startsWith(LOG_CATEGORY))msg.message=`${LOG_CATEGORY}: ${msg.message}`;throw msg}throw new Error(`${LOG_CATEGORY}: ${msg}`)}function warn(msg){if(msg instanceof Error){if(!msg.message.startsWith(LOG_CATEGORY))msg.message=`${LOG_CATEGORY}: ${msg.message}`;logger.warn(msg)}else logger.warn(msg)}exports.assert=assert;exports.error=error;exports.logger=logger;exports.warn=warn},90:function(__unused_webpack_module,exports){function composeRemoteRequestId(remoteName,expose){if(!expose||"."===expose)return remoteName;return`${remoteName}/${expose.replace(/^\.\//,"")}`}function matchRemoteWithNameAndExpose(remotes,id){for(const remote of remotes){const isNameMatched=id.startsWith(remote.name);let expose=id.replace(remote.name,"");if(isNameMatched){if(expose.startsWith("/")){const pkgNameOrAlias=remote.name;expose=`.${expose}`;return{pkgNameOrAlias,expose,remote}}else if(""===expose)return{pkgNameOrAlias:remote.name,expose:".",remote}}const isAliasMatched=remote.alias&&id.startsWith(remote.alias);let exposeWithAlias=remote.alias&&id.replace(remote.alias,"");if(remote.alias&&isAliasMatched){if(exposeWithAlias&&exposeWithAlias.startsWith("/")){const pkgNameOrAlias=remote.alias;exposeWithAlias=`.${exposeWithAlias}`;return{pkgNameOrAlias,expose:exposeWithAlias,remote}}else if(""===exposeWithAlias)return{pkgNameOrAlias:remote.alias,expose:".",remote}}}}function matchRemote(remotes,nameOrAlias){for(const remote of remotes){if(nameOrAlias===remote.name)return remote;if(remote.alias&&nameOrAlias===remote.alias)return remote}}exports.composeRemoteRequestId=composeRemoteRequestId;exports.matchRemote=matchRemote;exports.matchRemoteWithNameAndExpose=matchRemoteWithNameAndExpose},3584:function(__unused_webpack_module,exports,__webpack_require__){const require_global=__webpack_require__(7922);function registerPlugins(plugins,instance){const globalPlugins=require_global.getGlobalHostPlugins();const hookInstances=[instance.hooks,instance.remoteHandler.hooks,instance.sharedHandler.hooks,instance.snapshotHandler.hooks,instance.loaderHook,instance.bridgeHook];if(globalPlugins.length>0)globalPlugins.forEach(plugin=>{if(plugins?.find(item=>item.name!==plugin.name))plugins.push(plugin)});if(plugins&&plugins.length>0)plugins.forEach(plugin=>{hookInstances.forEach(hookInstance=>{hookInstance.applyPlugin(plugin,instance)})});return plugins}exports.registerPlugins=registerPlugins},9064:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);let _module_federation_sdk=__webpack_require__(1487);function defaultPreloadArgs(preloadConfig){return{resourceCategory:"sync",share:true,depsRemote:true,...preloadConfig}}function formatPreloadArgs(remotes,preloadArgs){return preloadArgs.map(args=>{const remoteInfo=require_manifest.matchRemote(remotes,args.nameOrAlias);require_logger.assert(remoteInfo,`Unable to preload ${args.nameOrAlias} as it is not included in ${!remoteInfo&&(0,_module_federation_sdk.safeToString)({remoteInfo,remotes})}`);return{remote:remoteInfo,preloadConfig:defaultPreloadArgs(args)}})}function normalizePreloadExposes(exposes){if(!exposes)return[];return exposes.map(expose=>{if("."===expose)return expose;if(expose.startsWith("./"))return expose.replace("./","");return expose})}function isTimeoutError(error){if(!(error instanceof Error))return false;return error.message.includes("timed out")||error.name.includes("Timeout")}function createAssetResult(context,url,status,error){return{url,status,resourceType:context.resourceType,initiator:context.initiator,id:context.id,error}}async function waitForRemoteEntryPreload(host,remoteInfo,entryRemoteInfo,context){const cachedRemote=host.moduleCache.get(entryRemoteInfo.name);const url=entryRemoteInfo.entry;if(cachedRemote?.remoteEntryExports)return createAssetResult(context,url,"cached");try{if(!await require_load.getRemoteEntry({origin:host,remoteInfo:entryRemoteInfo,remoteEntryExports:cachedRemote?.remoteEntryExports,resourceContext:{...context,url}}))throw new Error(`Failed to load remoteEntry "${url}".`);return createAssetResult(context,url,"success")}catch(error){return createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error)}}function waitForLinkPreload({host,remoteInfo,url,attrs,context,needDeleteLink}){return new Promise(resolve=>{const{link,needAttach}=(0,_module_federation_sdk.createLink)({url,cb:()=>{resolve(createAssetResult(context,url,needAttach?"success":"cached"))},onErrorCallback:error=>{resolve(createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error))},attrs,createLinkHook:(hookUrl,hookAttrs)=>{const res=host.loaderHook.lifecycle.createLink.emit({url:hookUrl,attrs:hookAttrs,remoteInfo,resourceContext:{...context,url:hookUrl}});HTMLLinkElement;return res},needDeleteLink});needAttach&&document.head.appendChild(link)})}function waitForScriptPreload({host,remoteInfo,url,attrs,context}){return new Promise(resolve=>{const{script,needAttach}=(0,_module_federation_sdk.createScript)({url,cb:()=>{resolve(createAssetResult(context,url,needAttach?"success":"cached"))},onErrorCallback:error=>{resolve(createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error))},attrs,createScriptHook:(hookUrl,hookAttrs)=>{const res=host.loaderHook.lifecycle.createScript.emit({url:hookUrl,attrs:hookAttrs,remoteInfo,resourceContext:{...context,url:hookUrl}});HTMLScriptElement;return res},needDeleteScript:true});needAttach&&document.head.appendChild(script)})}function createResourceContext(baseContext,resourceType){return{...baseContext,resourceType}}function preloadAssets(remoteInfo,host,assets,useLinkPreload=true,baseContext={initiator:"preloadRemote",id:remoteInfo.name}){const{cssAssets,jsAssetsWithoutEntry,entryAssets}=assets;const results=[];if(host.options.inBrowser){entryAssets.forEach(asset=>{const{moduleInfo:entryRemoteInfo}=asset;results.push(waitForRemoteEntryPreload(host,remoteInfo,entryRemoteInfo,createResourceContext(baseContext,"remoteEntry")))});if(useLinkPreload){const defaultAttrs={rel:"preload",as:"style"};cssAssets.forEach(cssUrl=>{results.push(waitForLinkPreload({host,remoteInfo,url:cssUrl,attrs:defaultAttrs,context:createResourceContext(baseContext,"css")}))})}else{const defaultAttrs={rel:"stylesheet",type:"text/css"};cssAssets.forEach(cssUrl=>{results.push(waitForLinkPreload({host,remoteInfo,url:cssUrl,attrs:defaultAttrs,needDeleteLink:false,context:createResourceContext(baseContext,"css")}))})}if(useLinkPreload){const defaultAttrs={rel:"preload",as:"script"};jsAssetsWithoutEntry.forEach(jsUrl=>{results.push(waitForLinkPreload({host,remoteInfo,url:jsUrl,attrs:defaultAttrs,context:createResourceContext(baseContext,"js")}))})}else{const defaultAttrs={fetchpriority:"high",type:remoteInfo?.type==="module"?"module":"text/javascript"};jsAssetsWithoutEntry.forEach(jsUrl=>{results.push(waitForScriptPreload({host,remoteInfo,url:jsUrl,attrs:defaultAttrs,context:createResourceContext(baseContext,"js")}))})}}return Promise.all(results)}exports.defaultPreloadArgs=defaultPreloadArgs;exports.formatPreloadArgs=formatPreloadArgs;exports.normalizePreloadExposes=normalizePreloadExposes;exports.preloadAssets=preloadAssets},2197:function(__unused_webpack_module,exports){function compareAtom(rangeAtom,versionAtom){rangeAtom=Number(rangeAtom)||rangeAtom;versionAtom=Number(versionAtom)||versionAtom;if(rangeAtom>versionAtom)return 1;if(rangeAtom===versionAtom)return 0;return -1}function comparePreRelease(rangeAtom,versionAtom){const{preRelease:rangePreRelease}=rangeAtom;const{preRelease:versionPreRelease}=versionAtom;if(void 0===rangePreRelease&&Boolean(versionPreRelease))return 1;if(Boolean(rangePreRelease)&&void 0===versionPreRelease)return -1;if(void 0===rangePreRelease&&void 0===versionPreRelease)return 0;for(let i=0,n=rangePreRelease.length;i<=n;i++){const rangeElement=rangePreRelease[i];const versionElement=versionPreRelease[i];if(rangeElement!==versionElement){if(void 0===rangeElement&&void 0===versionElement)return 0;if(!rangeElement)return 1;if(!versionElement)return -1;return compareAtom(rangeElement,versionElement)}}return 0}function compareVersion(rangeAtom,versionAtom){return compareAtom(rangeAtom.major,versionAtom.major)||compareAtom(rangeAtom.minor,versionAtom.minor)||compareAtom(rangeAtom.patch,versionAtom.patch)||comparePreRelease(rangeAtom,versionAtom)}function eq(rangeAtom,versionAtom){return rangeAtom.version===versionAtom.version}function compare(rangeAtom,versionAtom){switch(rangeAtom.operator){case"":case"=":return eq(rangeAtom,versionAtom);case">":return compareVersion(rangeAtom,versionAtom)<0;case">=":return eq(rangeAtom,versionAtom)||compareVersion(rangeAtom,versionAtom)<0;case"<":return compareVersion(rangeAtom,versionAtom)>0;case"<=":return eq(rangeAtom,versionAtom)||compareVersion(rangeAtom,versionAtom)>0;case void 0:return true;default:return false}}exports.compare=compare},5567:function(__unused_webpack_module,exports){const buildIdentifier="[0-9A-Za-z-]+";const build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;const numericIdentifier="0|[1-9]\\d*";const numericIdentifierLoose="[0-9]+";const nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*";const preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;const preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`;const preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`;const preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`;const xRangeIdentifier=`${numericIdentifier}|x|X|\\*`;const xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;const hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`;const loosePlain=`[v=\\s]*${`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`}${preReleaseLoose}?${build}?`;const gtlt="((?:<|>)?=?)";const comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`;const loneTilde="(?:~>?)";const tildeTrim=`(\\s*)${loneTilde}\\s+`;const loneCaret="(?:\\^)";const caretTrim=`(\\s*)${loneCaret}\\s+`;const star="(<|>)?=?\\s*\\*";const caret=`^${loneCaret}${xRangePlain}$`;const fullPlain=`v?${`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`}${preRelease}?${build}?`;const tilde=`^${loneTilde}${xRangePlain}$`;const xRange=`^${gtlt}\\s*${xRangePlain}$`;const comparator=`^${gtlt}\\s*(${fullPlain})$|^$`;const gte0="^\\s*>=\\s*0.0.0\\s*$";exports.caret=caret;exports.caretTrim=caretTrim;exports.comparator=comparator;exports.comparatorTrim=comparatorTrim;exports.gte0=gte0;exports.hyphenRange=hyphenRange;exports.star=star;exports.tilde=tilde;exports.tildeTrim=tildeTrim;exports.xRange=xRange},508:function(__unused_webpack_module,exports,__webpack_require__){const require_utils=__webpack_require__(7383);const require_parser=__webpack_require__(7645);const require_compare=__webpack_require__(2197);function parseComparatorString(range){return require_utils.pipe(require_parser.parseCarets,require_parser.parseTildes,require_parser.parseXRanges,require_parser.parseStar)(range)}function parseRange(range){return require_utils.pipe(require_parser.parseHyphen,require_parser.parseComparatorTrim,require_parser.parseTildeTrim,require_parser.parseCaretTrim)(range.trim()).split(/\s+/).join(" ")}function satisfy(version,range){if(!version)return false;const extractedVersion=require_utils.extractComparator(version);if(!extractedVersion)return false;const[,versionOperator,,versionMajor,versionMinor,versionPatch,versionPreRelease]=extractedVersion;const versionAtom={operator:versionOperator,version:require_utils.combineVersion(versionMajor,versionMinor,versionPatch,versionPreRelease),major:versionMajor,minor:versionMinor,patch:versionPatch,preRelease:versionPreRelease?.split(".")};const orRanges=range.split("||");for(const orRange of orRanges){const trimmedOrRange=orRange.trim();if(!trimmedOrRange)return true;if("*"===trimmedOrRange||"x"===trimmedOrRange)return true;try{const parsedSubRange=parseRange(trimmedOrRange);if(!parsedSubRange.trim())return true;const parsedComparatorString=parsedSubRange.split(" ").map(rangeVersion=>parseComparatorString(rangeVersion)).join(" ");if(!parsedComparatorString.trim())return true;const comparators=parsedComparatorString.split(/\s+/).map(comparator=>require_parser.parseGTE0(comparator)).filter(Boolean);if(0===comparators.length)continue;let subRangeSatisfied=true;for(const comparator of comparators){const extractedComparator=require_utils.extractComparator(comparator);if(!extractedComparator){subRangeSatisfied=false;break}const[,rangeOperator,,rangeMajor,rangeMinor,rangePatch,rangePreRelease]=extractedComparator;if(!require_compare.compare({operator:rangeOperator,version:require_utils.combineVersion(rangeMajor,rangeMinor,rangePatch,rangePreRelease),major:rangeMajor,minor:rangeMinor,patch:rangePatch,preRelease:rangePreRelease?.split(".")},versionAtom)){subRangeSatisfied=false;break}}if(subRangeSatisfied)return true}catch(e){console.error(`[semver] Error processing range part "${trimmedOrRange}":`,e);continue}}return false}exports.satisfy=satisfy},7645:function(__unused_webpack_module,exports,__webpack_require__){const require_constants=__webpack_require__(5567);const require_utils=__webpack_require__(7383);function parseHyphen(range){return range.replace(require_utils.parseRegex(require_constants.hyphenRange),(_range,from,fromMajor,fromMinor,fromPatch,_fromPreRelease,_fromBuild,to,toMajor,toMinor,toPatch,toPreRelease)=>{from=require_utils.isXVersion(fromMajor)?"":require_utils.isXVersion(fromMinor)?`>=${fromMajor}.0.0`:require_utils.isXVersion(fromPatch)?`>=${fromMajor}.${fromMinor}.0`:`>=${from}`;to=require_utils.isXVersion(toMajor)?"":require_utils.isXVersion(toMinor)?`<${Number(toMajor)+1}.0.0-0`:require_utils.isXVersion(toPatch)?`<${toMajor}.${Number(toMinor)+1}.0-0`:toPreRelease?`<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`:`<=${to}`;return`${from} ${to}`.trim()})}function parseComparatorTrim(range){return range.replace(require_utils.parseRegex(require_constants.comparatorTrim),"$1$2$3")}function parseTildeTrim(range){return range.replace(require_utils.parseRegex(require_constants.tildeTrim),"$1~")}function parseCaretTrim(range){return range.replace(require_utils.parseRegex(require_constants.caretTrim),"$1^")}function parseCarets(range){return range.trim().split(/\s+/).map(rangeVersion=>rangeVersion.replace(require_utils.parseRegex(require_constants.caret),(_,major,minor,patch,preRelease)=>{if(require_utils.isXVersion(major))return"";if(require_utils.isXVersion(minor))return`>=${major}.0.0 <${Number(major)+1}.0.0-0`;if(require_utils.isXVersion(patch))if("0"===major)return`>=${major}.${minor}.0 <${major}.${Number(minor)+1}.0-0`;else return`>=${major}.${minor}.0 <${Number(major)+1}.0.0-0`;if(preRelease)if("0"!==major)return`>=${major}.${minor}.${patch}-${preRelease} <${Number(major)+1}.0.0-0`;else if("0"===minor)return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${minor}.${Number(patch)+1}-0`;else return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor)+1}.0-0`;if("0"===major)if("0"===minor)return`>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch)+1}-0`;else return`>=${major}.${minor}.${patch} <${major}.${Number(minor)+1}.0-0`;return`>=${major}.${minor}.${patch} <${Number(major)+1}.0.0-0`})).join(" ")}function parseTildes(range){return range.trim().split(/\s+/).map(rangeVersion=>rangeVersion.replace(require_utils.parseRegex(require_constants.tilde),(_,major,minor,patch,preRelease)=>{if(require_utils.isXVersion(major))return"";if(require_utils.isXVersion(minor))return`>=${major}.0.0 <${Number(major)+1}.0.0-0`;if(require_utils.isXVersion(patch))return`>=${major}.${minor}.0 <${major}.${Number(minor)+1}.0-0`;if(preRelease)return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor)+1}.0-0`;return`>=${major}.${minor}.${patch} <${major}.${Number(minor)+1}.0-0`})).join(" ")}function parseXRanges(range){return range.split(/\s+/).map(rangeVersion=>rangeVersion.trim().replace(require_utils.parseRegex(require_constants.xRange),(ret,gtlt,major,minor,patch,preRelease)=>{const isXMajor=require_utils.isXVersion(major);const isXMinor=isXMajor||require_utils.isXVersion(minor);const isXPatch=isXMinor||require_utils.isXVersion(patch);if("="===gtlt&&isXPatch)gtlt="";preRelease="";if(isXMajor)if(">"===gtlt||"<"===gtlt)return"<0.0.0-0";else return"*";if(gtlt&&isXPatch){if(isXMinor)minor=0;patch=0;if(">"===gtlt){gtlt=">=";if(isXMinor){major=Number(major)+1;minor=0;patch=0}else{minor=Number(minor)+1;patch=0}}else if("<="===gtlt){gtlt="<";if(isXMinor)major=Number(major)+1;else minor=Number(minor)+1}if("<"===gtlt)preRelease="-0";return`${gtlt+major}.${minor}.${patch}${preRelease}`}if(isXMinor)return`>=${major}.0.0${preRelease} <${Number(major)+1}.0.0-0`;if(isXPatch)return`>=${major}.${minor}.0${preRelease} <${major}.${Number(minor)+1}.0-0`;return ret})).join(" ")}function parseStar(range){return range.trim().replace(require_utils.parseRegex(require_constants.star),"")}function parseGTE0(comparatorString){return comparatorString.trim().replace(require_utils.parseRegex(require_constants.gte0),"")}exports.parseCaretTrim=parseCaretTrim;exports.parseCarets=parseCarets;exports.parseComparatorTrim=parseComparatorTrim;exports.parseGTE0=parseGTE0;exports.parseHyphen=parseHyphen;exports.parseStar=parseStar;exports.parseTildeTrim=parseTildeTrim;exports.parseTildes=parseTildes;exports.parseXRanges=parseXRanges},7383:function(__unused_webpack_module,exports,__webpack_require__){const require_constants=__webpack_require__(5567);function parseRegex(source){return new RegExp(source)}function isXVersion(version){return!version||"x"===version.toLowerCase()||"*"===version}function pipe(...fns){return x=>fns.reduce((v1,f)=>f(v1),x)}function extractComparator(comparatorString){return comparatorString.match(parseRegex(require_constants.comparator))}function combineVersion(major,minor,patch,preRelease){const mainVersion=`${major}.${minor}.${patch}`;if(preRelease)return`${mainVersion}-${preRelease}`;return mainVersion}exports.combineVersion=combineVersion;exports.extractComparator=extractComparator;exports.isXVersion=isXVersion;exports.parseRegex=parseRegex;exports.pipe=pipe},9774:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);const require_index=__webpack_require__(508);let _module_federation_sdk=__webpack_require__(1487);function formatShare(shareArgs,from,name,shareStrategy){let get;get="get"in shareArgs?shareArgs.get:"lib"in shareArgs?()=>Promise.resolve(shareArgs.lib):()=>Promise.resolve(()=>{require_logger.error(`Cannot get shared "${name}" from "${from}": neither "get" nor "lib" is provided in the share config.`)});if(shareArgs.shareConfig?.eager&&shareArgs.treeShaking?.mode)require_logger.error(`Invalid shared config for "${name}" from "${from}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`);return{deps:[],useIn:[],from,loading:null,...shareArgs,shareConfig:{requiredVersion:`^${shareArgs.version}`,singleton:false,eager:false,strictVersion:false,...shareArgs.shareConfig},get,loaded:shareArgs?.loaded||"lib"in shareArgs?true:void 0,version:shareArgs.version??"0",scope:Array.isArray(shareArgs.scope)?shareArgs.scope:[shareArgs.scope??"default"],strategy:(shareArgs.strategy??shareStrategy)||"version-first",treeShaking:shareArgs.treeShaking?{...shareArgs.treeShaking,mode:shareArgs.treeShaking.mode??"server-calc",status:shareArgs.treeShaking.status??_module_federation_sdk.TreeShakingStatus.UNKNOWN,useIn:[]}:void 0}}function formatShareConfigs(prevOptions,newOptions){const shareArgs=newOptions.shared||{};const from=newOptions.name;const newShareInfos=Object.keys(shareArgs).reduce((res,pkgName)=>{const arrayShareArgs=require_tool.arrayOptions(shareArgs[pkgName]);res[pkgName]=res[pkgName]||[];arrayShareArgs.forEach(shareConfig=>{res[pkgName].push(formatShare(shareConfig,from,pkgName,newOptions.shareStrategy))});return res},{});const allShareInfos={...prevOptions.shared};Object.keys(newShareInfos).forEach(shareKey=>{if(allShareInfos[shareKey])newShareInfos[shareKey].forEach(newUserSharedOptions=>{if(!allShareInfos[shareKey].find(sharedVal=>sharedVal.version===newUserSharedOptions.version))allShareInfos[shareKey].push(newUserSharedOptions)});else allShareInfos[shareKey]=newShareInfos[shareKey]});return{allShareInfos,newShareInfos}}function shouldUseTreeShaking(treeShaking,usedExports){if(!treeShaking)return false;const{status,mode}=treeShaking;if(status===_module_federation_sdk.TreeShakingStatus.NO_USE)return false;if(status===_module_federation_sdk.TreeShakingStatus.CALCULATED)return true;if("runtime-infer"===mode){if(!usedExports)return true;return isMatchUsedExports(treeShaking,usedExports)}return false}function versionLt(a,b){const transformInvalidVersion=version=>{if(!Number.isNaN(Number(version))){const splitArr=version.split(".");let validVersion=version;for(let i=0;i<3-splitArr.length;i++)validVersion+=".0";return validVersion}return version};if(require_index.satisfy(transformInvalidVersion(a),`<=${transformInvalidVersion(b)}`))return true;return false}const findVersion=(shareVersionMap,cb)=>{const callback=cb||function(prev,cur){return versionLt(prev,cur)};return Object.keys(shareVersionMap).reduce((prev,cur)=>{if(!prev)return cur;if(callback(prev,cur))return cur;if("0"===prev)return cur;return prev},0)};const isLoaded=shared=>Boolean(shared.loaded)||"function"==typeof shared.lib;const isLoading=shared=>Boolean(shared.loading);const isMatchUsedExports=(treeShaking,usedExports)=>{if(!treeShaking||!usedExports)return false;const{usedExports:treeShakingUsedExports}=treeShaking;if(!treeShakingUsedExports)return false;if(usedExports.every(e=>treeShakingUsedExports.includes(e)))return true;return false};function findSingletonVersionOrderByVersion(shareScopeMap,scope,pkgName,treeShaking){const versions=shareScopeMap[scope][pkgName];let version="";let useTreesShaking=shouldUseTreeShaking(treeShaking);const callback=function(prev,cur){if(useTreesShaking){if(!versions[prev].treeShaking)return true;if(!versions[cur].treeShaking)return false;return!isLoaded(versions[prev].treeShaking)&&versionLt(prev,cur)}return!isLoaded(versions[prev])&&versionLt(prev,cur)};if(useTreesShaking){version=findVersion(shareScopeMap[scope][pkgName],callback);if(version)return{version,useTreesShaking};useTreesShaking=false}return{version:findVersion(shareScopeMap[scope][pkgName],callback),useTreesShaking}}const isLoadingOrLoaded=shared=>isLoaded(shared)||isLoading(shared);function findSingletonVersionOrderByLoaded(shareScopeMap,scope,pkgName,treeShaking){const versions=shareScopeMap[scope][pkgName];let version="";let useTreesShaking=shouldUseTreeShaking(treeShaking);const callback=function(prev,cur){if(useTreesShaking){if(!versions[prev].treeShaking)return true;if(!versions[cur].treeShaking)return false;if(isLoadingOrLoaded(versions[cur].treeShaking))if(isLoadingOrLoaded(versions[prev].treeShaking))return Boolean(versionLt(prev,cur));else return true;if(isLoadingOrLoaded(versions[prev].treeShaking))return false}if(isLoadingOrLoaded(versions[cur]))if(isLoadingOrLoaded(versions[prev]))return Boolean(versionLt(prev,cur));else return true;if(isLoadingOrLoaded(versions[prev]))return false;return versionLt(prev,cur)};if(useTreesShaking){version=findVersion(shareScopeMap[scope][pkgName],callback);if(version)return{version,useTreesShaking};useTreesShaking=false}return{version:findVersion(shareScopeMap[scope][pkgName],callback),useTreesShaking}}function getFindShareFunction(strategy){if("loaded-first"===strategy)return findSingletonVersionOrderByLoaded;return findSingletonVersionOrderByVersion}function getRegisteredShare(localShareScopeMap,pkgName,shareInfo,resolveShare){if(!localShareScopeMap)return;const{shareConfig,scope=require_constant.DEFAULT_SCOPE,strategy,treeShaking}=shareInfo;const scopes=Array.isArray(scope)?scope:[scope];for(const sc of scopes)if(shareConfig&&localShareScopeMap[sc]&&localShareScopeMap[sc][pkgName]){const{requiredVersion}=shareConfig;const{version:maxOrSingletonVersion,useTreesShaking}=getFindShareFunction(strategy)(localShareScopeMap,sc,pkgName,treeShaking);const defaultResolver=()=>{const shared=localShareScopeMap[sc][pkgName][maxOrSingletonVersion];if(shareConfig.singleton){if("string"==typeof requiredVersion&&!require_index.satisfy(maxOrSingletonVersion,requiredVersion)){const msg=`Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion&&shared.from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;if(shareConfig.strictVersion)require_logger.error(msg);else require_logger.warn(msg)}return{shared,useTreesShaking}}{if(false===requiredVersion||"*"===requiredVersion)return{shared,useTreesShaking};if(require_index.satisfy(maxOrSingletonVersion,requiredVersion))return{shared,useTreesShaking};const _usedTreeShaking=shouldUseTreeShaking(treeShaking);if(_usedTreeShaking){for(const[versionKey,versionValue]of Object.entries(localShareScopeMap[sc][pkgName]))if(shouldUseTreeShaking(versionValue.treeShaking,treeShaking?.usedExports)){if(require_index.satisfy(versionKey,requiredVersion))return{shared:versionValue,useTreesShaking:_usedTreeShaking}}}for(const[versionKey,versionValue]of Object.entries(localShareScopeMap[sc][pkgName]))if(require_index.satisfy(versionKey,requiredVersion))return{shared:versionValue,useTreesShaking:false}}};const params={shareScopeMap:localShareScopeMap,scope:sc,pkgName,version:maxOrSingletonVersion,GlobalFederation:require_global.Global.__FEDERATION__,shareInfo,resolver:defaultResolver};return(resolveShare.emit(params)||params).resolver()}}function getGlobalShareScope(){return require_global.Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(options){const{pkgName,extraOptions,shareInfos}=options;const defaultResolver=sharedOptions=>{if(!sharedOptions)return;const shareVersionMap={};sharedOptions.forEach(shared=>{shareVersionMap[shared.version]=shared});const callback=function(prev,cur){return!isLoaded(shareVersionMap[prev])&&versionLt(prev,cur)};return shareVersionMap[findVersion(shareVersionMap,callback)]};const resolver=extraOptions?.resolver??defaultResolver;const isPlainObject=val=>null!==val&&"object"==typeof val&&!Array.isArray(val);const merge=(...sources)=>{const out={};for(const src of sources)if(src)for(const[key,value1]of Object.entries(src)){const prev=out[key];if(isPlainObject(prev)&&isPlainObject(value1))out[key]=merge(prev,value1);else if(void 0!==value1)out[key]=value1}return out};return merge(resolver(shareInfos[pkgName]),extraOptions?.customShareInfo)}const addUseIn=(shared,from)=>{if(!shared.useIn)shared.useIn=[];require_tool.addUniqueItem(shared.useIn,from)};function directShare(shared,useTreesShaking){if(useTreesShaking&&shared.treeShaking)return shared.treeShaking;return shared}exports.addUseIn=addUseIn;exports.directShare=directShare;exports.formatShareConfigs=formatShareConfigs;exports.getGlobalShareScope=getGlobalShareScope;exports.getRegisteredShare=getRegisteredShare;exports.getTargetSharedOptions=getTargetSharedOptions;exports.shouldUseTreeShaking=shouldUseTreeShaking},8607:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);let _module_federation_sdk=__webpack_require__(1487);function addUniqueItem(arr,item){if(-1===arr.findIndex(name=>name===item))arr.push(item);return arr}function getFMId(remoteInfo){if("version"in remoteInfo&&remoteInfo.version)return`${remoteInfo.name}:${remoteInfo.version}`;if("entry"in remoteInfo&&remoteInfo.entry)return`${remoteInfo.name}:${remoteInfo.entry}`;return`${remoteInfo.name}`}function isRemoteInfoWithEntry(remote){return void 0!==remote.entry}function isPureRemoteEntry(remote){return!remote.entry.includes(".json")}async function safeWrapper(callback,disableWarn){try{return await callback()}catch(e){disableWarn||require_logger.warn(e);return}}function isObject(val){return val&&"object"==typeof val}const objectToString=Object.prototype.toString;function isPlainObject(val){return"[object Object]"===objectToString.call(val)}function isStaticResourcesEqual(url1,url2){const REG_EXP=/^(https?:)?\/\//i;return url1.replace(REG_EXP,"").replace(/\/$/,"")===url2.replace(REG_EXP,"").replace(/\/$/,"")}function arrayOptions(options){return Array.isArray(options)?options:[options]}function getRemoteEntryInfoFromSnapshot(snapshot){const defaultRemoteEntryInfo={url:"",type:"global",globalName:""};if(_module_federation_sdk.isBrowserEnvValue||(0,_module_federation_sdk.isReactNativeEnv)()||!("ssrRemoteEntry"in snapshot))return"remoteEntry"in snapshot?{url:snapshot.remoteEntry,type:snapshot.remoteEntryType,globalName:snapshot.globalName}:defaultRemoteEntryInfo;if("ssrRemoteEntry"in snapshot)return{url:snapshot.ssrRemoteEntry||defaultRemoteEntryInfo.url,type:snapshot.ssrRemoteEntryType||defaultRemoteEntryInfo.type,globalName:snapshot.globalName};return defaultRemoteEntryInfo}const processModuleAlias=(name,subPath)=>{let moduleName;moduleName=name.endsWith("/")?name.slice(0,-1):name;if(subPath.startsWith("."))subPath=subPath.slice(1);moduleName+=subPath;return moduleName};exports.addUniqueItem=addUniqueItem;exports.arrayOptions=arrayOptions;exports.getFMId=getFMId;exports.getRemoteEntryInfoFromSnapshot=getRemoteEntryInfoFromSnapshot;exports.isObject=isObject;exports.isPlainObject=isPlainObject;exports.isPureRemoteEntry=isPureRemoteEntry;exports.isRemoteInfoWithEntry=isRemoteInfoWithEntry;exports.isStaticResourcesEqual=isStaticResourcesEqual;exports.objectToString=objectToString;exports.processModuleAlias=processModuleAlias;exports.safeWrapper=safeWrapper},8643:function(__unused_webpack_module,exports){var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(var keys=__getOwnPropNames(from),i=0,n=keys.length,key;i<n;i++){key=keys[i];if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:(k=>from[k]).bind(null,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp(target,"default",{value:mod,enumerable:true}),mod));exports.__toESM=__toESM},2600:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperties(exports,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}});__webpack_require__(8643);const require_utils=__webpack_require__(2040);let _module_federation_runtime_core=__webpack_require__(5929);const global1={..._module_federation_runtime_core.helpers.global,getGlobalFederationInstance:require_utils.getGlobalFederationInstance};const share=_module_federation_runtime_core.helpers.share;const utils=_module_federation_runtime_core.helpers.utils;const runtimeHelpers={global:global1,share,utils};exports["default"]=runtimeHelpers;exports.global=global1;exports.share=share;exports.utils=utils},1695:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});__webpack_require__(8643);const require_utils=__webpack_require__(2040);let _module_federation_runtime_core=__webpack_require__(5929);let _module_federation_error_codes=__webpack_require__(7110);function createInstance(options){const instance=new((0,_module_federation_runtime_core.getGlobalFederationConstructor)()||_module_federation_runtime_core.ModuleFederation)({id:`${options.name}@${options.version||Date.now()}`,...options});(0,_module_federation_runtime_core.setGlobalFederationInstance)(instance);return instance}let FederationInstance=null;function init(options){const instance=require_utils.getGlobalFederationInstance(options.name,options.version);const normalizedOptions={...options,id:options.id||""};if(instance){instance.initOptions(normalizedOptions);if(!FederationInstance)FederationInstance=instance;return instance}FederationInstance=createInstance(normalizedOptions);return FederationInstance}function loadRemote(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadRemote.apply(FederationInstance,args)}function loadShare(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadShare.apply(FederationInstance,args)}function loadShareSync(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadShareSync.apply(FederationInstance,args)}function preloadRemote(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.preloadRemote.apply(FederationInstance,args)}function registerRemotes(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerRemotes.apply(FederationInstance,args)}function registerPlugins(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerPlugins.apply(FederationInstance,args)}function getInstance(finder){if(!finder)return FederationInstance;return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(finder)||null}function registerShared(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerShared.apply(FederationInstance,args)}(0,_module_federation_runtime_core.setGlobalFederationConstructor)(_module_federation_runtime_core.ModuleFederation);Object.defineProperty(exports,"Module",{enumerable:true,get:function(){return _module_federation_runtime_core.Module}});exports.ModuleFederation=_module_federation_runtime_core.ModuleFederation;exports.createInstance=createInstance;exports.getInstance=getInstance;Object.defineProperty(exports,"getRemoteEntry",{enumerable:true,get:function(){return _module_federation_runtime_core.getRemoteEntry}});Object.defineProperty(exports,"getRemoteInfo",{enumerable:true,get:function(){return _module_federation_runtime_core.getRemoteInfo}});exports.init=init;exports.loadRemote=loadRemote;Object.defineProperty(exports,"loadScript",{enumerable:true,get:function(){return _module_federation_runtime_core.loadScript}});Object.defineProperty(exports,"loadScriptNode",{enumerable:true,get:function(){return _module_federation_runtime_core.loadScriptNode}});exports.loadShare=loadShare;exports.loadShareSync=loadShareSync;exports.preloadRemote=preloadRemote;Object.defineProperty(exports,"registerGlobalPlugins",{enumerable:true,get:function(){return _module_federation_runtime_core.registerGlobalPlugins}});exports.registerPlugins=registerPlugins;exports.registerRemotes=registerRemotes;exports.registerShared=registerShared},2040:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(8643);let _module_federation_runtime_core=__webpack_require__(5929);function getBuilderId(){return"mf_playground:0.0.2"}function getGlobalFederationInstance(name,version){const buildId=getBuilderId();return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(GMInstance=>{if(buildId&&GMInstance.options.id===buildId)return true;if(GMInstance.options.name===name&&!GMInstance.options.version&&!version)return true;if(GMInstance.options.name===name&&version&&GMInstance.options.version===version)return true;return false})}exports.getGlobalFederationInstance=getGlobalFederationInstance},3075:function(__unused_webpack_module,exports){var __defProp=Object.defineProperty;var __exportAll=(all,no_symbols)=>{let target={};for(var name in all)__defProp(target,name,{get:all[name],enumerable:true});if(!no_symbols)__defProp(target,Symbol.toStringTag,{value:"Module"});return target};exports.__exportAll=__exportAll},8609:function(__unused_webpack_module,exports){const FederationModuleManifest="federation-manifest.json";const MANIFEST_EXT=".json";const BROWSER_LOG_KEY="FEDERATION_DEBUG";const NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"};const NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"};const EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH};const SEPARATOR=":";const ManifestFileName="mf-manifest.json";const StatsFileName="mf-stats.json";const MFModuleType={NPM:"npm",APP:"app"};const MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__";const ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX";const TEMP_DIR=".federation";let TreeShakingStatus=/* @__PURE__ */function(TreeShakingStatus){TreeShakingStatus[TreeShakingStatus["UNKNOWN"]=1]="UNKNOWN";TreeShakingStatus[TreeShakingStatus["CALCULATED"]=2]="CALCULATED";TreeShakingStatus[TreeShakingStatus["NO_USE"]=0]="NO_USE";return TreeShakingStatus}({});exports.BROWSER_LOG_KEY=BROWSER_LOG_KEY;exports.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX;exports.EncodedNameTransformMap=EncodedNameTransformMap;exports.FederationModuleManifest=FederationModuleManifest;exports.MANIFEST_EXT=MANIFEST_EXT;exports.MFModuleType=MFModuleType;exports.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER;exports.ManifestFileName=ManifestFileName;exports.NameTransformMap=NameTransformMap;exports.NameTransformSymbol=NameTransformSymbol;exports.SEPARATOR=SEPARATOR;exports.StatsFileName=StatsFileName;exports.TEMP_DIR=TEMP_DIR;exports.TreeShakingStatus=TreeShakingStatus},348:function(__unused_webpack_module,exports){const createModuleFederationConfig=options=>options;exports.createModuleFederationConfig=createModuleFederationConfig},8351:function(__unused_webpack_module,exports,__webpack_require__){const require_utils=__webpack_require__(5080);async function safeWrapper(callback,disableWarn){try{return await callback()}catch(e){disableWarn||require_utils.warn(e);return}}function isStaticResourcesEqual(url1,url2){const REG_EXP=/^(https?:)?\/\//i;return url1.replace(REG_EXP,"").replace(/\/$/,"")===url2.replace(REG_EXP,"").replace(/\/$/,"")}function createScript(info){let script=null;let needAttach=true;let timeout=2e4;let timeoutId;const scripts=document.getElementsByTagName("script");for(let i=0;i<scripts.length;i++){const s=scripts[i];const scriptSrc=s.getAttribute("src");if(scriptSrc&&isStaticResourcesEqual(scriptSrc,info.url)){script=s;needAttach=false;break}}if(!script){const attrs=info.attrs;script=document.createElement("script");script.type=attrs?.["type"]==="module"?"module":"text/javascript";let createScriptRes;if(info.createScriptHook){createScriptRes=info.createScriptHook(info.url,info.attrs);if(createScriptRes instanceof HTMLScriptElement)script=createScriptRes;else if("object"==typeof createScriptRes){if("script"in createScriptRes&&createScriptRes.script)script=createScriptRes.script;if("timeout"in createScriptRes&&createScriptRes.timeout)timeout=createScriptRes.timeout}}if(!script.src)script.src=info.url;if(attrs&&!createScriptRes)Object.keys(attrs).forEach(name=>{if(script){if("async"===name||"defer"===name)script[name]=attrs[name];else if(!script.getAttribute(name))script.setAttribute(name,attrs[name])}})}let executionError=null;const executionErrorHandler="undefined"!=typeof window?evt=>{if(evt.filename&&isStaticResourcesEqual(evt.filename,info.url)){const err=/* @__PURE__ */new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);err.name="ScriptExecutionError";executionError=err}}:null;if(executionErrorHandler)window.addEventListener("error",executionErrorHandler);const onScriptComplete=async(prev,event)=>{clearTimeout(timeoutId);if(executionErrorHandler)window.removeEventListener("error",executionErrorHandler);const onScriptCompleteCallback=()=>{if(event?.type==="error"){const networkError=/* @__PURE__ */new Error(event?.isTimeout?`ScriptNetworkError: Script "${info.url}" timed out.`:`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);networkError.name="ScriptNetworkError";info?.onErrorCallback&&info?.onErrorCallback(networkError)}else if(executionError)info?.onErrorCallback&&info?.onErrorCallback(executionError);else info?.cb&&info?.cb()};if(script){script.onerror=null;script.onload=null;safeWrapper(()=>{const{needDeleteScript=true}=info;if(needDeleteScript)script?.parentNode&&script.parentNode.removeChild(script)});if(prev&&"function"==typeof prev){const result=prev(event);if(result instanceof Promise){const res=await result;onScriptCompleteCallback();return res}onScriptCompleteCallback();return result}}onScriptCompleteCallback()};script.onerror=onScriptComplete.bind(null,script.onerror);script.onload=onScriptComplete.bind(null,script.onload);timeoutId=setTimeout(()=>{onScriptComplete(null,{type:"error",isTimeout:true})},timeout);return{script,needAttach}}function createLink(info){let link=null;let needAttach=true;let timeout=2e4;let timeoutId;const links=document.getElementsByTagName("link");for(let i=0;i<links.length;i++){const l=links[i];const linkHref=l.getAttribute("href");const linkRel=l.getAttribute("rel");if(linkHref&&isStaticResourcesEqual(linkHref,info.url)&&linkRel===info.attrs["rel"]){link=l;needAttach=false;break}}if(!link){link=document.createElement("link");link.setAttribute("href",info.url);let createLinkRes;let shouldApplyAttrs=true;const attrs=info.attrs;if(info.createLinkHook){createLinkRes=info.createLinkHook(info.url,attrs);if(createLinkRes instanceof HTMLLinkElement){link=createLinkRes;shouldApplyAttrs=false}else if("object"==typeof createLinkRes){if("link"in createLinkRes&&createLinkRes.link){link=createLinkRes.link;shouldApplyAttrs=false}if("timeout"in createLinkRes&&createLinkRes.timeout)timeout=createLinkRes.timeout}}if(attrs&&shouldApplyAttrs)Object.keys(attrs).forEach(name=>{if(link&&!link.getAttribute(name))link.setAttribute(name,attrs[name])})}if(!needAttach){Promise.resolve().then(()=>{info?.cb&&info?.cb()});return{link,needAttach}}const onLinkComplete=(prev,event)=>{if(timeoutId)clearTimeout(timeoutId);const onLinkCompleteCallback=()=>{if(event?.type==="error"){const linkError=/* @__PURE__ */new Error(event?.isTimeout?`LinkNetworkError: Link "${info.url}" timed out.`:`LinkNetworkError: Failed to load link "${info.url}" - the URL is unreachable or the server returned an error.`);linkError.name="LinkNetworkError";info?.onErrorCallback&&info?.onErrorCallback(linkError)}else info?.cb&&info?.cb()};if(link){link.onerror=null;link.onload=null;safeWrapper(()=>{const{needDeleteLink=true}=info;if(needDeleteLink)link?.parentNode&&link.parentNode.removeChild(link)});if(prev){const res=prev(event);onLinkCompleteCallback();return res}}onLinkCompleteCallback()};link.onerror=onLinkComplete.bind(null,link.onerror);link.onload=onLinkComplete.bind(null,link.onload);timeoutId=setTimeout(()=>{onLinkComplete(null,{type:"error",isTimeout:true})},timeout);return{link,needAttach}}function loadScript(url,info){const{attrs={},createScriptHook}=info;return new Promise((resolve,reject)=>{const{script,needAttach}=createScript({url,cb:resolve,onErrorCallback:reject,attrs:{fetchpriority:"high",...attrs},createScriptHook,needDeleteScript:true});needAttach&&document.head.appendChild(script)})}exports.createLink=createLink;exports.createScript=createScript;exports.isStaticResourcesEqual=isStaticResourcesEqual;exports.loadScript=loadScript;exports.safeWrapper=safeWrapper},7454:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const isBrowserEnvValue="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function isBrowserEnv(){return isBrowserEnvValue}function isReactNativeEnv(){return"undefined"!=typeof navigator&&navigator?.product==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return Boolean(localStorage.getItem(require_constant.BROWSER_LOG_KEY))}catch(error){}return false}function isDebugMode(){if("undefined"!=typeof process&&process.env&&process.env["FEDERATION_DEBUG"])return Boolean(process.env["FEDERATION_DEBUG"]);if("undefined"!=typeof FEDERATION_DEBUG&&Boolean(FEDERATION_DEBUG))return true;return isBrowserDebug()}const getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}};exports.getProcessEnv=getProcessEnv;exports.isBrowserEnv=isBrowserEnv;exports.isBrowserEnvValue=isBrowserEnvValue;exports.isDebugMode=isDebugMode;exports.isReactNativeEnv=isReactNativeEnv},5227:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const simpleJoinRemoteEntry=(rPath,rName)=>{if(!rPath)return rName;const transformPath=str=>{if("."===str)return"";if(str.startsWith("./"))return str.replace("./","");if(str.startsWith("/")){const strWithoutSlash=str.slice(1);if(strWithoutSlash.endsWith("/"))return strWithoutSlash.slice(0,-1);return strWithoutSlash}return str};const transformedPath=transformPath(rPath);if(!transformedPath)return rName;if(transformedPath.endsWith("/"))return`${transformedPath}${rName}`;return`${transformedPath}/${rName}`};function inferAutoPublicPath(url){return url.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(manifest,options={}){const{remotes={},overrides={},version}=options;let remoteSnapshot;const getPublicPath=()=>{if(!("publicPath"in manifest.metaData))return manifest.metaData.getPublicPath;if(("auto"===manifest.metaData.publicPath||""===manifest.metaData.publicPath)&&version)return inferAutoPublicPath(version);return manifest.metaData.publicPath};const overridesKeys=Object.keys(overrides);let remotesInfo={};if(!Object.keys(remotes).length)remotesInfo=manifest.remotes?.reduce((res,next)=>{let matchedVersion;const name=next.federationContainerName;matchedVersion=overridesKeys.includes(name)?overrides[name]:"version"in next?next.version:next.entry;res[name]={matchedVersion};return res},{})||{};Object.keys(remotes).forEach(key=>remotesInfo[key]={matchedVersion:overridesKeys.includes(key)?overrides[key]:remotes[key]});const{remoteEntry:{path:remoteEntryPath,name:remoteEntryName,type:remoteEntryType},types:remoteTypes={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion},globalName,ssrRemoteEntry}=manifest.metaData;const{exposes}=manifest;let basicRemoteSnapshot={version:version?version:"",buildVersion,globalName,remoteEntry:simpleJoinRemoteEntry(remoteEntryPath,remoteEntryName),remoteEntryType,remoteTypes:simpleJoinRemoteEntry(remoteTypes.path,remoteTypes.name),remoteTypesZip:remoteTypes.zip||"",remoteTypesAPI:remoteTypes.api||"",remotesInfo,shared:manifest?.shared.map(item=>({assets:item.assets,sharedName:item.name,version:item.version,usedExports:item.referenceExports||[]})),modules:exposes?.map(expose=>({moduleName:expose.name,modulePath:expose.path,assets:expose.assets}))};if("publicPath"in manifest.metaData){remoteSnapshot={...basicRemoteSnapshot,publicPath:getPublicPath()};if("string"==typeof manifest.metaData.ssrPublicPath)remoteSnapshot.ssrPublicPath=manifest.metaData.ssrPublicPath}else remoteSnapshot={...basicRemoteSnapshot,getPublicPath:getPublicPath()};if(ssrRemoteEntry){const fullSSRRemoteEntry=simpleJoinRemoteEntry(ssrRemoteEntry.path,ssrRemoteEntry.name);remoteSnapshot.ssrRemoteEntry=fullSSRRemoteEntry;remoteSnapshot.ssrRemoteEntryType=ssrRemoteEntry.type||"commonjs-module"}return remoteSnapshot}function isManifestProvider(moduleInfo){if("remoteEntry"in moduleInfo&&moduleInfo.remoteEntry.includes(require_constant.MANIFEST_EXT))return true;return false}function getManifestFileName(manifestOptions){if(!manifestOptions)return{statsFileName:require_constant.StatsFileName,manifestFileName:require_constant.ManifestFileName};let filePath="boolean"==typeof manifestOptions?"":manifestOptions.filePath||"";let fileName="boolean"==typeof manifestOptions?"":manifestOptions.fileName||"";const JSON_EXT=".json";const addExt=name=>{if(name.endsWith(JSON_EXT))return name;return`${name}${JSON_EXT}`};const insertSuffix=(name,suffix)=>name.replace(JSON_EXT,`${suffix}${JSON_EXT}`);const manifestFileName=fileName?addExt(fileName):require_constant.ManifestFileName;return{statsFileName:simpleJoinRemoteEntry(filePath,fileName?insertSuffix(manifestFileName,"-stats"):require_constant.StatsFileName),manifestFileName:simpleJoinRemoteEntry(filePath,manifestFileName)}}exports.generateSnapshotFromManifest=generateSnapshotFromManifest;exports.getManifestFileName=getManifestFileName;exports.inferAutoPublicPath=inferAutoPublicPath;exports.isManifestProvider=isManifestProvider;exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry},1487:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const require_constant=__webpack_require__(8609);const require_ContainerPlugin=__webpack_require__(5780);const require_ContainerReferencePlugin=__webpack_require__(8869);const require_ModuleFederationPlugin=__webpack_require__(8862);const require_SharePlugin=__webpack_require__(5688);const require_ConsumeSharedPlugin=__webpack_require__(1944);const require_ProvideSharedPlugin=__webpack_require__(9901);const require_env=__webpack_require__(7454);const require_utils=__webpack_require__(5080);const require_generateSnapshotFromManifest=__webpack_require__(5227);const require_logger=__webpack_require__(4501);const require_dom=__webpack_require__(8351);const require_node=__webpack_require__(8165);const require_normalizeOptions=__webpack_require__(8740);const require_createModuleFederationConfig=__webpack_require__(348);exports.BROWSER_LOG_KEY=require_constant.BROWSER_LOG_KEY;exports.ENCODE_NAME_PREFIX=require_constant.ENCODE_NAME_PREFIX;exports.EncodedNameTransformMap=require_constant.EncodedNameTransformMap;exports.FederationModuleManifest=require_constant.FederationModuleManifest;exports.MANIFEST_EXT=require_constant.MANIFEST_EXT;exports.MFModuleType=require_constant.MFModuleType;exports.MODULE_DEVTOOL_IDENTIFIER=require_constant.MODULE_DEVTOOL_IDENTIFIER;exports.ManifestFileName=require_constant.ManifestFileName;exports.NameTransformMap=require_constant.NameTransformMap;exports.NameTransformSymbol=require_constant.NameTransformSymbol;exports.SEPARATOR=require_constant.SEPARATOR;exports.StatsFileName=require_constant.StatsFileName;exports.TEMP_DIR=require_constant.TEMP_DIR;exports.TreeShakingStatus=require_constant.TreeShakingStatus;exports.assert=require_utils.assert;exports.bindLoggerToCompiler=require_logger.bindLoggerToCompiler;exports.composeKeyWithSeparator=require_utils.composeKeyWithSeparator;Object.defineProperty(exports,"consumeSharedPlugin",{enumerable:true,get:function(){return require_ConsumeSharedPlugin.ConsumeSharedPlugin_exports}});Object.defineProperty(exports,"containerPlugin",{enumerable:true,get:function(){return require_ContainerPlugin.ContainerPlugin_exports}});Object.defineProperty(exports,"containerReferencePlugin",{enumerable:true,get:function(){return require_ContainerReferencePlugin.ContainerReferencePlugin_exports}});exports.createInfrastructureLogger=require_logger.createInfrastructureLogger;exports.createLink=require_dom.createLink;exports.createLogger=require_logger.createLogger;exports.createModuleFederationConfig=require_createModuleFederationConfig.createModuleFederationConfig;exports.createScript=require_dom.createScript;exports.createScriptNode=require_node.createScriptNode;exports.decodeName=require_utils.decodeName;exports.encodeName=require_utils.encodeName;exports.error=require_utils.error;exports.generateExposeFilename=require_utils.generateExposeFilename;exports.generateShareFilename=require_utils.generateShareFilename;exports.generateSnapshotFromManifest=require_generateSnapshotFromManifest.generateSnapshotFromManifest;exports.getManifestFileName=require_generateSnapshotFromManifest.getManifestFileName;exports.getProcessEnv=require_env.getProcessEnv;exports.getResourceUrl=require_utils.getResourceUrl;exports.inferAutoPublicPath=require_generateSnapshotFromManifest.inferAutoPublicPath;exports.infrastructureLogger=require_logger.infrastructureLogger;exports.isBrowserEnv=require_env.isBrowserEnv;exports.isBrowserEnvValue=require_env.isBrowserEnvValue;exports.isDebugMode=require_env.isDebugMode;exports.isManifestProvider=require_generateSnapshotFromManifest.isManifestProvider;exports.isReactNativeEnv=require_env.isReactNativeEnv;exports.isRequiredVersion=require_utils.isRequiredVersion;exports.isStaticResourcesEqual=require_dom.isStaticResourcesEqual;exports.loadScript=require_dom.loadScript;exports.loadScriptNode=require_node.loadScriptNode;exports.logger=require_logger.logger;Object.defineProperty(exports,"moduleFederationPlugin",{enumerable:true,get:function(){return require_ModuleFederationPlugin.ModuleFederationPlugin_exports}});exports.normalizeOptions=require_normalizeOptions.normalizeOptions;exports.parseEntry=require_utils.parseEntry;Object.defineProperty(exports,"provideSharedPlugin",{enumerable:true,get:function(){return require_ProvideSharedPlugin.ProvideSharedPlugin_exports}});exports.safeToString=require_utils.safeToString;exports.safeWrapper=require_dom.safeWrapper;Object.defineProperty(exports,"sharePlugin",{enumerable:true,get:function(){return require_SharePlugin.SharePlugin_exports}});exports.simpleJoinRemoteEntry=require_generateSnapshotFromManifest.simpleJoinRemoteEntry;exports.warn=require_utils.warn},4501:function(__unused_webpack_module,exports,__webpack_require__){const require_env=__webpack_require__(7454);const PREFIX="[ Module Federation ]";const DEFAULT_DELEGATE=console;const LOGGER_STACK_SKIP_TOKENS=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function captureStackTrace(){try{const stack=/* @__PURE__ */new Error().stack;if(!stack)return;const[,...rawLines]=stack.split("\n");const filtered=rawLines.filter(line=>!LOGGER_STACK_SKIP_TOKENS.some(token=>line.includes(token)));if(!filtered.length)return;return`Stack trace:
|
|
1084
|
+
${message}`)}};onRunRef.current=onRun;(0,react_index_js_.useEffect)(()=>{if(!initialQueryConfig.autoRun||autoRunStartedRef.current)return;autoRunStartedRef.current=true;onRunRef.current?.()},[initialQueryConfig.autoRun]);const copyText=async(key,text,okMsg)=>{try{await navigator.clipboard.writeText(text);setCopiedKey(key);setStatus(okMsg);window.setTimeout(()=>setCopiedKey(""),1e3)}catch{setStatus("复制失败:浏览器不支持 clipboard API(可手动复制)")}};const CopyButton=props=>{const{copyKey,label,okMsg,text}=props;const done=copiedKey===copyKey;return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-copyBtn"),onClick:()=>void copyText(copyKey,text,okMsg),title:done?"Copied":"Copy",children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("svg",{"aria-hidden":"true",className:cx("vp-copyIcon"),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M8 7.5C8 6.119 9.119 5 10.5 5H18c1.381 0 2.5 1.119 2.5 2.5V15c0 1.381-1.119 2.5-2.5 2.5h-7.5C9.119 17.5 8 16.381 8 15V7.5Z",stroke:"currentColor",strokeWidth:"1.6"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M5 9.5C5 8.119 6.119 7 7.5 7H8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M5 18.5C5 19.881 6.119 21 7.5 21H15c1.381 0 2.5-1.119 2.5-2.5V18",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:done?"Copied":label||"Copy"})]})};const renderPreview=()=>{if(!previewState)return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-empty"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-emptyTitle"),children:"Ready."}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"1. Fill in the Manifest URL first.":"1. 先填写 Manifest URL。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"2. Click Run Sandbox. It resolves the manifest first, then starts the preview if everything is valid.":"2. 点击 Run Sandbox。它会先解析 Manifest,没问题再启动右侧预览。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"3. If manifest parsing fails, check the terminal below for the exact error.":"3. 如果 Manifest 解析失败,直接看下方 Terminal 里的具体报错。"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{children:isEn?"4. If you still need to adjust how the producer is loaded, edit the consumer code in the Code panel on the left. The Code panel only appears and loads after the first successful Manifest resolve.":"4. 如果还需要调整加载方式,再去修改左侧 Code 里的消费者代码。Code 只有在第一次解析 Manifest 成功后才会出现并加载。"})]});if("consumer"===previewState.kind){const{expose:currentExpose,runId:currentRunId}=previewState;return/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-kv"),children:["Target:"," ",formatLoadedTarget(manifestName||"remote",currentExpose)]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-renderArea"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("iframe",{className:cx("vp-previewFrame"),title:"Sandbox Preview",srcDoc:buildPreviewDocument(previewState,defaults)},currentRunId)})]})}return null};const renderTerminal=()=>/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-terminal"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-terminalHeader"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:"Terminal"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:cx("vp-terminalClear"),onClick:()=>setTerminalLines([]),children:"Clear"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-terminalBody"),children:terminalLines.length>0?terminalLines.map(line=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("pre",{className:cx("vp-terminalLine","error"===line.level&&"vp-terminalLineError","warn"===line.level&&"vp-terminalLineWarn"),children:line.message},line.id)):/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-terminalEmpty"),children:"No output."})})]});const fileState={"app.tsx":{value:appCode,onChange:setAppCode},"entry.ts":{value:entryCode,onChange:setEntryCode},runtime:{value:mfCode,onChange:setMfCode},"rspack.config.mjs":{value:rspackConfigCode,onChange:setRspackConfigCode}};const activeTab=fileTabs.find(item=>item.key===activeFile)||fileTabs[0];const activeEditor=fileState[activeTab.key];const editorPath=getEditorPath(activeTab.key,template);const editorTheme=useEditorTheme();const locale=useLocale();const isEn="en"===locale;const canShowCodePanel=Boolean(resolvedManifest);const displayStatus=renderError?.message||status||"Idle";const visibleExposeOptions=expose&&!exposeOptions.includes(expose)?[expose,...exposeOptions]:exposeOptions;const moduleNameText=previewState?.kind==="consumer"?formatLoadedTarget(manifestName||"remote",previewState.expose):"editor mode";const mainStyle=isDesktopLayout?{gridTemplateColumns:`minmax(0, ${leftPaneWidth}fr) 10px minmax(0, ${100-leftPaneWidth}fr)`}:void 0;return/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-root"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("main",{className:cx("vp-main"),style:mainStyle,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("section",{className:cx("vp-left"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-card"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-cardHeader"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-cardTitle"),children:"Workspace"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-paneActions"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:cx("vp-button","vp-buttonPrimary"),onClick:onRun,title:"Run Sandbox",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{children:"Run Sandbox"})})})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-cardBody"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapse"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseItem"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-collapseHeader",openPanels.control&&"vp-collapseHeaderActive"),onClick:()=>setOpenPanels(current=>({...current,control:!current.control})),"aria-expanded":openPanels.control,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseLabel"),children:"Control Panel"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseArrow",openPanels.control&&"vp-collapseArrowOpen"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M4.5 6.5L8 10L11.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),openPanels.control?/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-collapseBody"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-form"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Manifest URL"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Run Sandbox resolves this automatically":"点击 Run Sandbox 时自动解析"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:manifestUrl,onChange:event=>{setManifestUrl(event.target.value);setResolvedManifest(null);setExposeOptions([]);setExpose("");setOpenPanels(current=>({...current,code:false}));syncGeneratedAppCode(null,"",exportName);syncGeneratedMfPlaceholder()},placeholder:"https://.../mf-manifest.json"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-fieldGrid"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Expose"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:manifestName?`Remote: ${manifestName}`:isEn?"Auto read from manifest":"从 manifest 自动读取"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("select",{className:cx("vp-select"),value:expose,onChange:event=>{const nextExpose=event.target.value;setExpose(nextExpose);syncGeneratedAppCode(resolvedManifest,nextExpose,exportName);syncGeneratedMfCode(manifestUrl.trim(),resolvedManifest)},disabled:isResolvingExpose,children:visibleExposeOptions.length>0?visibleExposeOptions.map(item=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("option",{value:item,children:item},item)):/*#__PURE__*/(0,jsx_runtime_js_.jsx)("option",{value:"",children:isEn?"Run Sandbox to load expose options":"点击 Run Sandbox 后加载 expose"})})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Export"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Default is default; you can switch to a named export":"默认 default,可改成具名导出"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:exportName,onChange:event=>{const nextExportName=event.target.value;setExportName(nextExportName);syncGeneratedAppCode(resolvedManifest,expose,nextExportName);syncGeneratedMfCode(manifestUrl.trim(),resolvedManifest)},placeholder:"default"})]})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-field"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-labelRow"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-label"),children:"Preview Route"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-hint"),children:isEn?"Match the basename used by export-app":"和 export-app 的 basename 保持一致"})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("input",{className:cx("vp-input"),value:previewRoute,onChange:event=>{setPreviewRoute(event.target.value)},placeholder:"/"})]})]})}):null]}),canShowCodePanel?/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseItem"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("button",{type:"button",className:cx("vp-collapseHeader",openPanels.code&&"vp-collapseHeaderActive"),onClick:()=>setOpenPanels(current=>({...current,code:!current.code})),"aria-expanded":openPanels.code,children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseLabel"),children:"Code"}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-collapseArrow",openPanels.code&&"vp-collapseArrowOpen"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)("path",{d:"M4.5 6.5L8 10L11.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),openPanels.code?/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-collapseBody","vp-collapseBodyCode"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-editorToolbar"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-editorTabs"),role:"tablist","aria-label":"Files",children:fileTabs.map(item=>/*#__PURE__*/(0,jsx_runtime_js_.jsx)("button",{type:"button",className:item.key===activeTab.key?cx("vp-editorTab","vp-editorTabActive"):cx("vp-editorTab"),onClick:()=>setActiveFile(item.key),children:item.label||item.key},item.key))}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)(CopyButton,{copyKey:activeTab.copyKey,label:"Copy",okMsg:activeTab.copyMessage,text:activeEditor.value})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-codeEditor"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(Ft,{height:"100%",language:getEditorLanguage(activeTab.key),path:editorPath,theme:editorTheme,value:activeEditor.value,loading:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(EditorLoadingState,{}),options:{automaticLayout:true,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:13,lineHeight:21,minimap:{enabled:false},padding:{top:12,bottom:12},scrollBeyondLastLine:false,tabSize:2,wordWrap:"on"},beforeMount:monaco=>configureEditor(monaco,template),onMount:(_,monaco)=>{monacoRef.current=monaco;syncEditorModels(monaco,editorFiles,template)},onChange:value1=>activeEditor.onChange(value1||"")},editorPath)})]}):null]}):null]})})]})}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-splitter"),"aria-hidden":"true",onMouseDown:isDesktopLayout?event=>{resizeStateRef.current={startWidth:leftPaneWidth,startX:event.clientX}}:void 0}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("section",{className:cx("vp-right"),children:/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ide"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideTitlebar"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideDots"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotRed")}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotYellow")}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-dot","vp-dotGreen")})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("div",{className:cx("vp-ideTitle"),children:"Sandbox Preview"}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideMeta"),children:[/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-ideMetaText"),title:moduleNameText,children:moduleNameText}),/*#__PURE__*/(0,jsx_runtime_js_.jsx)("span",{className:cx("vp-ideStatus"),title:displayStatus,children:displayStatus})]})]}),/*#__PURE__*/(0,jsx_runtime_js_.jsxs)("div",{className:cx("vp-ideBody"),children:[renderPreview(),renderTerminal()]})]})})]})})}function App(props){const defaults=(0,react_index_js_.useMemo)(()=>getPlaygroundDefaults(props),[props]);return/*#__PURE__*/(0,jsx_runtime_js_.jsx)(RenderErrorBoundary,{children:/*#__PURE__*/(0,jsx_runtime_js_.jsx)(AppInner,{defaults:defaults})})}},5617:function(__unused_webpack_module,exports){var __defProp=Object.defineProperty;var __exportAll=(all,no_symbols)=>{let target={};for(var name in all)__defProp(target,name,{get:all[name],enumerable:true});if(!no_symbols)__defProp(target,Symbol.toStringTag,{value:"Module"});return target};exports.__exportAll=__exportAll},1319:function(__unused_webpack_module,exports){const DEFAULT_SCOPE="default";const DEFAULT_REMOTE_TYPE="global";exports.DEFAULT_REMOTE_TYPE=DEFAULT_REMOTE_TYPE;exports.DEFAULT_SCOPE=DEFAULT_SCOPE},3906:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_env=__webpack_require__(8042);const require_plugin=__webpack_require__(3584);__webpack_require__(4011);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);__webpack_require__(1076);const require_index$2=__webpack_require__(1625);const require_generate_preload_assets=__webpack_require__(6141);const require_SnapshotHandler=__webpack_require__(8281);__webpack_require__(2455);const require_index$3=__webpack_require__(805);__webpack_require__(5411);const require_index$4=__webpack_require__(8984);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);var ModuleFederation=class{constructor(userOptions){this.hooks=new require_pluginSystem.PluginSystem({beforeInit:new require_syncWaterfallHook.SyncWaterfallHook("beforeInit"),init:new require_syncHook.SyncHook,beforeInitContainer:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeInitContainer"),initContainer:new require_asyncWaterfallHooks.AsyncWaterfallHook("initContainer")});this.version="2.8.1";this.moduleCache=/* @__PURE__ */new Map;this.loaderHook=new require_pluginSystem.PluginSystem({getModuleInfo:new require_syncHook.SyncHook,createScript:new require_syncHook.SyncHook,createLink:new require_syncHook.SyncHook,fetch:new require_asyncHook.AsyncHook,loadEntryError:new require_asyncHook.AsyncHook,afterLoadEntry:new require_asyncHook.AsyncHook("afterLoadEntry"),beforeInitRemote:new require_asyncHook.AsyncHook("beforeInitRemote"),afterInitRemote:new require_asyncHook.AsyncHook("afterInitRemote"),beforeGetExpose:new require_asyncHook.AsyncHook("beforeGetExpose"),afterGetExpose:new require_asyncHook.AsyncHook("afterGetExpose"),beforeExecuteFactory:new require_asyncHook.AsyncHook("beforeExecuteFactory"),afterExecuteFactory:new require_asyncHook.AsyncHook("afterExecuteFactory"),getModuleFactory:new require_asyncHook.AsyncHook});this.bridgeHook=new require_pluginSystem.PluginSystem({beforeBridgeRender:new require_syncHook.SyncHook,afterBridgeRender:new require_syncHook.SyncHook,beforeBridgeDestroy:new require_syncHook.SyncHook,afterBridgeDestroy:new require_syncHook.SyncHook});const plugins=[require_index$2.snapshotPlugin(),require_generate_preload_assets.generatePreloadAssetsPlugin()];const defaultOptions={id:require_env.getBuilderId(),name:userOptions.name,plugins,remotes:[],shared:{},inBrowser:_module_federation_sdk.isBrowserEnvValue};this.name=userOptions.name;this.options=defaultOptions;this.snapshotHandler=new require_SnapshotHandler.SnapshotHandler(this);this.sharedHandler=new require_index$3.SharedHandler(this);this.remoteHandler=new require_index$4.RemoteHandler(this);this.shareScopeMap=this.sharedHandler.shareScopeMap;this.registerPlugins([...defaultOptions.plugins,...userOptions.plugins||[]]);this.options=this.formatOptions(defaultOptions,userOptions)}initOptions(userOptions){if(userOptions.name&&userOptions.name!==this.options.name)require_logger.error((0,_module_federation_error_codes.getShortErrorMsg)(_module_federation_error_codes.RUNTIME_010,_module_federation_error_codes.runtimeDescMap));this.registerPlugins(userOptions.plugins);const options=this.formatOptions(this.options,userOptions);this.options=options;return options}async loadShare(pkgName,extraOptions){return this.sharedHandler.loadShare(pkgName,extraOptions)}loadShareSync(pkgName,extraOptions){return this.sharedHandler.loadShareSync(pkgName,extraOptions)}initializeSharing(shareScopeName=require_constant.DEFAULT_SCOPE,extraOptions){return this.sharedHandler.initializeSharing(shareScopeName,extraOptions)}initRawContainer(name,url,container){return this.remoteHandler.initRawContainer(name,url,container)}async loadRemote(id,options){return this.remoteHandler.loadRemote(id,options)}async preloadRemote(preloadOptions){return this.remoteHandler.preloadRemote(preloadOptions)}initShareScopeMap(scopeName,shareScope,extraOptions={}){this.sharedHandler.initShareScopeMap(scopeName,shareScope,extraOptions)}formatOptions(globalOptions,userOptions){const shared=require_share.formatShareConfigs(globalOptions,userOptions).allShareInfos;const{userOptions:userOptionsRes,options:globalOptionsRes}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions,options:globalOptions,shareInfo:shared});const remotes=this.remoteHandler.formatAndRegisterRemote(globalOptionsRes,userOptionsRes);const{allShareInfos}=this.sharedHandler.registerShared(globalOptionsRes,userOptionsRes);const plugins=[...globalOptionsRes.plugins];if(userOptionsRes.plugins)userOptionsRes.plugins.forEach(plugin=>{if(!plugins.includes(plugin))plugins.push(plugin)});const optionsRes={...globalOptions,...userOptions,plugins,remotes,shared:allShareInfos,id:userOptionsRes.id||globalOptions.id};this.hooks.lifecycle.init.emit({origin:this,options:optionsRes});return optionsRes}registerPlugins(plugins){const pluginRes=require_plugin.registerPlugins(plugins,this);this.options.plugins=this.options.plugins.reduce((res,plugin)=>{if(!plugin)return res;if(res&&!res.find(item=>item.name===plugin.name))res.push(plugin);return res},pluginRes||[])}registerRemotes(remotes,options){return this.remoteHandler.registerRemotes(remotes,options)}registerShared(shared){this.sharedHandler.registerShared(this.options,{...this.options,shared})}};exports.ModuleFederation=ModuleFederation},7922:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);let _module_federation_sdk=__webpack_require__(1487);const CurrentGlobal="object"==typeof globalThis?globalThis:window;const nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})();const Global=nativeGlobal;function definePropertyGlobalVal(target,key,val){Object.defineProperty(target,key,{value:val,configurable:false,writable:true})}function includeOwnProperty(target,key){return Object.hasOwnProperty.call(target,key)}if(!includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__"))definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(target){if(includeOwnProperty(target,"__VMOK__")&&!includeOwnProperty(target,"__FEDERATION__"))definePropertyGlobalVal(target,"__FEDERATION__",target.__VMOK__);if(!includeOwnProperty(target,"__FEDERATION__")){definePropertyGlobalVal(target,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:/* @__PURE__ */new Map});definePropertyGlobalVal(target,"__VMOK__",target.__FEDERATION__)}target.__FEDERATION__.__GLOBAL_PLUGIN__??=[];target.__FEDERATION__.__INSTANCES__??=[];target.__FEDERATION__.moduleInfo??={};target.__FEDERATION__.__SHARE__??={};target.__FEDERATION__.__MANIFEST_LOADING__??={};target.__FEDERATION__.__PRELOADED_MAP__??=/* @__PURE__ */new Map}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function resetFederationGlobalInfo(){CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__=[];CurrentGlobal.__FEDERATION__.__INSTANCES__=[];CurrentGlobal.__FEDERATION__.moduleInfo={};CurrentGlobal.__FEDERATION__.__SHARE__={};CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__={};Object.keys(globalLoading).forEach(key=>{delete globalLoading[key]})}function setGlobalFederationInstance(FederationInstance){CurrentGlobal.__FEDERATION__.__INSTANCES__.push(FederationInstance)}function getGlobalFederationConstructor(){return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(FederationConstructor,isDebug=(0,_module_federation_sdk.isDebugMode)()){if(isDebug){CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=FederationConstructor;CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.1"}}function getInfoWithoutType(target,key){if("string"==typeof key)if(target[key])return{value:target[key],key};else{const targetKeys=Object.keys(target);for(const targetKey of targetKeys){const[targetTypeOrName,_]=targetKey.split(":");const nKey=`${targetTypeOrName}:${key}`;const typeWithKeyRes=target[nKey];if(typeWithKeyRes)return{value:typeWithKeyRes,key:nKey}}return{value:void 0,key}}require_logger.error(`getInfoWithoutType: "key" must be a string, got ${typeof key} (${JSON.stringify(key)}).`)}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo;const getTargetSnapshotInfoByModuleInfo=(moduleInfo,snapshot)=>{const getModuleInfo=getInfoWithoutType(snapshot,require_tool.getFMId(moduleInfo)).value;if(getModuleInfo&&!getModuleInfo.version&&"version"in moduleInfo&&moduleInfo["version"])getModuleInfo.version=moduleInfo["version"];if(getModuleInfo)return getModuleInfo;if("version"in moduleInfo&&moduleInfo["version"]){const{version,...resModuleInfo}=moduleInfo;const moduleKeyWithoutVersion=require_tool.getFMId(resModuleInfo);const getModuleInfoWithoutVersion=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,moduleKeyWithoutVersion).value;if(getModuleInfoWithoutVersion?.version===version)return getModuleInfoWithoutVersion}};const getGlobalSnapshotInfoByModuleInfo=moduleInfo=>getTargetSnapshotInfoByModuleInfo(moduleInfo,nativeGlobal.__FEDERATION__.moduleInfo);const setGlobalSnapshotInfoByModuleInfo=(remoteInfo,moduleDetailInfo)=>{const moduleKey=require_tool.getFMId(remoteInfo);nativeGlobal.__FEDERATION__.moduleInfo[moduleKey]=moduleDetailInfo;return nativeGlobal.__FEDERATION__.moduleInfo};const addGlobalSnapshot=moduleInfos=>{nativeGlobal.__FEDERATION__.moduleInfo={...nativeGlobal.__FEDERATION__.moduleInfo,...moduleInfos};return()=>{const keys=Object.keys(moduleInfos);for(const key of keys)delete nativeGlobal.__FEDERATION__.moduleInfo[key]}};const getRemoteEntryExports=(name,globalName)=>{const remoteEntryKey=globalName||`__FEDERATION_${name}:custom__`;return{remoteEntryKey,entryExports:CurrentGlobal[remoteEntryKey]}};const registerGlobalPlugins=plugins=>{const{__GLOBAL_PLUGIN__}=nativeGlobal.__FEDERATION__;plugins.forEach(plugin=>{if(-1===__GLOBAL_PLUGIN__.findIndex(p=>p.name===plugin.name))__GLOBAL_PLUGIN__.push(plugin);else require_logger.warn(`The plugin ${plugin.name} has been registered.`)})};const getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;const getPreloaded=id=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(id);const setPreloaded=id=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(id,true);exports.CurrentGlobal=CurrentGlobal;exports.Global=Global;exports.addGlobalSnapshot=addGlobalSnapshot;exports.getGlobalFederationConstructor=getGlobalFederationConstructor;exports.getGlobalHostPlugins=getGlobalHostPlugins;exports.getGlobalSnapshot=getGlobalSnapshot;exports.getGlobalSnapshotInfoByModuleInfo=getGlobalSnapshotInfoByModuleInfo;exports.getInfoWithoutType=getInfoWithoutType;exports.getPreloaded=getPreloaded;exports.getRemoteEntryExports=getRemoteEntryExports;exports.getTargetSnapshotInfoByModuleInfo=getTargetSnapshotInfoByModuleInfo;exports.globalLoading=globalLoading;exports.nativeGlobal=nativeGlobal;exports.registerGlobalPlugins=registerGlobalPlugins;exports.resetFederationGlobalInfo=resetFederationGlobalInfo;exports.setGlobalFederationConstructor=setGlobalFederationConstructor;exports.setGlobalFederationInstance=setGlobalFederationInstance;exports.setGlobalSnapshotInfoByModuleInfo=setGlobalSnapshotInfoByModuleInfo;exports.setPreloaded=setPreloaded},8366:function(__unused_webpack_module,exports,__webpack_require__){const require_global=__webpack_require__(7922);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const ShareUtils={getRegisteredShare:require_share.getRegisteredShare,getGlobalShareScope:require_share.getGlobalShareScope};const GlobalUtils={Global:require_global.Global,nativeGlobal:require_global.nativeGlobal,resetFederationGlobalInfo:require_global.resetFederationGlobalInfo,setGlobalFederationInstance:require_global.setGlobalFederationInstance,getGlobalFederationConstructor:require_global.getGlobalFederationConstructor,setGlobalFederationConstructor:require_global.setGlobalFederationConstructor,getInfoWithoutType:require_global.getInfoWithoutType,getGlobalSnapshot:require_global.getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo:require_global.getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo:require_global.getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo:require_global.setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot:require_global.addGlobalSnapshot,getRemoteEntryExports:require_global.getRemoteEntryExports,registerGlobalPlugins:require_global.registerGlobalPlugins,getGlobalHostPlugins:require_global.getGlobalHostPlugins,getPreloaded:require_global.getPreloaded,setPreloaded:require_global.setPreloaded};var helpers_default={global:GlobalUtils,share:ShareUtils,utils:{matchRemoteWithNameAndExpose:require_manifest.matchRemoteWithNameAndExpose,preloadAssets:require_preload.preloadAssets,getRemoteInfo:require_load.getRemoteInfo}};exports["default"]=helpers_default},5929:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_index=__webpack_require__(508);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);__webpack_require__(4011);const require_helpers=__webpack_require__(8366);const require_index$2=__webpack_require__(1518);__webpack_require__(1076);const require_core=__webpack_require__(3906);const require_index$3=__webpack_require__(9998);let _module_federation_sdk=__webpack_require__(1487);const helpers=require_helpers.default;const Module=require_index$2.Module;exports.CurrentGlobal=require_global.CurrentGlobal;exports.Global=require_global.Global;exports.Module=Module;exports.ModuleFederation=require_core.ModuleFederation;exports.addGlobalSnapshot=require_global.addGlobalSnapshot;exports.assert=require_logger.assert;exports.error=require_logger.error;exports.getGlobalFederationConstructor=require_global.getGlobalFederationConstructor;exports.getGlobalSnapshot=require_global.getGlobalSnapshot;exports.getInfoWithoutType=require_global.getInfoWithoutType;exports.getRegisteredShare=require_share.getRegisteredShare;exports.getRemoteEntry=require_load.getRemoteEntry;exports.getRemoteInfo=require_load.getRemoteInfo;exports.helpers=helpers;exports.isStaticResourcesEqual=require_tool.isStaticResourcesEqual;Object.defineProperty(exports,"loadScript",{enumerable:true,get:function(){return _module_federation_sdk.loadScript}});Object.defineProperty(exports,"loadScriptNode",{enumerable:true,get:function(){return _module_federation_sdk.loadScriptNode}});exports.matchRemoteWithNameAndExpose=require_manifest.matchRemoteWithNameAndExpose;exports.registerGlobalPlugins=require_global.registerGlobalPlugins;exports.resetFederationGlobalInfo=require_global.resetFederationGlobalInfo;exports.safeWrapper=require_tool.safeWrapper;exports.satisfy=require_index.satisfy;exports.setGlobalFederationConstructor=require_global.setGlobalFederationConstructor;exports.setGlobalFederationInstance=require_global.setGlobalFederationInstance;Object.defineProperty(exports,"types",{enumerable:true,get:function(){return require_index$3.type_exports}})},1518:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function getAvailableExposeNames(remoteSnapshot){if(!remoteSnapshot||!("modules"in remoteSnapshot)||!Array.isArray(remoteSnapshot.modules))return;const exposes=remoteSnapshot.modules.map(module1=>module1.moduleName).filter(Boolean);return exposes.length?exposes.join(","):void 0}function createRemoteEntryInitOptions(remoteInfo,hostShareScopeMap,rawInitScope){const localShareScopeMap=hostShareScopeMap;const shareScopeKeys=Array.isArray(remoteInfo.shareScope)?remoteInfo.shareScope:[remoteInfo.shareScope];if(!shareScopeKeys.length)shareScopeKeys.push("default");shareScopeKeys.forEach(shareScopeKey=>{if(!localShareScopeMap[shareScopeKey])localShareScopeMap[shareScopeKey]={}});const remoteEntryInitOptions={version:remoteInfo.version||"",shareScopeKeys:Array.isArray(remoteInfo.shareScope)?shareScopeKeys:remoteInfo.shareScope||"default"};Object.defineProperty(remoteEntryInitOptions,"shareScopeMap",{value:localShareScopeMap,enumerable:false});return{remoteEntryInitOptions,shareScope:localShareScopeMap[shareScopeKeys[0]],initScope:rawInitScope??[]}}var Module=class{constructor({remoteInfo,host}){this.inited=false;this.initing=false;this.lib=void 0;this.remoteInfo=remoteInfo;this.host=host}async getEntry(expose){if(this.remoteEntryExports)return this.remoteEntryExports;const remoteEntryExports=await require_load.getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:require_manifest.composeRemoteRequestId(this.remoteInfo.name,expose),resourceType:"remoteEntry"}});require_logger.assert(remoteEntryExports,`remoteEntryExports is undefined
|
|
1085
|
+
${(0,_module_federation_sdk.safeToString)(this.remoteInfo)}`);this.remoteEntryExports=remoteEntryExports;return this.remoteEntryExports}async init(id,remoteSnapshot,rawInitScope,expose){const remoteEntryExports=await this.getEntry(expose);if(this.inited){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,cached:true,origin:this.host});return remoteEntryExports}if(this.initPromise){try{await this.initPromise;await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,cached:true,origin:this.host})}catch(initError){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,error:initError,cached:true,origin:this.host});throw initError}return remoteEntryExports}this.initing=true;this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,origin:this.host});const{remoteEntryInitOptions,shareScope,initScope}=createRemoteEntryInitOptions(this.remoteInfo,this.host.shareScopeMap,rawInitScope);const initContainerOptions=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope,remoteEntryInitOptions,initScope,remoteInfo:this.remoteInfo,origin:this.host});if(void 0===remoteEntryExports?.init)require_logger.error(_module_federation_error_codes.RUNTIME_002,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,require_context.optionsToMFContext(this.host.options));try{await remoteEntryExports.init(initContainerOptions.shareScope,initContainerOptions.initScope,initContainerOptions.remoteEntryInitOptions)}catch(initError){require_logger.error(_module_federation_error_codes.RUNTIME_015,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${initError}`,require_context.optionsToMFContext(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...initContainerOptions,id,remoteSnapshot,remoteEntryExports});this.inited=true})();try{await this.initPromise;await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,origin:this.host})}catch(initError){await this.host.loaderHook.lifecycle.afterInitRemote.emit({id,remoteInfo:this.remoteInfo,remoteSnapshot,remoteEntryExports,error:initError,origin:this.host});throw initError}finally{this.initing=false;this.initPromise=void 0}return remoteEntryExports}async get(id,expose,options,remoteSnapshot){const{loadFactory=true}=options||{loadFactory:true};const remoteEntryExports=await this.init(id,remoteSnapshot,void 0,expose);this.lib=remoteEntryExports;await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,origin:this.host});let moduleFactory;try{const hookModuleFactory=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports,expose,moduleInfo:this.remoteInfo});moduleFactory="function"==typeof hookModuleFactory?hookModuleFactory:void 0;if(!moduleFactory)moduleFactory=await remoteEntryExports.get(expose);if(!moduleFactory)require_logger.error(_module_federation_error_codes.RUNTIME_014,_module_federation_error_codes.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose,requestId:id,availableExposes:getAvailableExposeNames(remoteSnapshot)},void 0,require_context.optionsToMFContext(this.host.options));await this.host.loaderHook.lifecycle.afterGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,moduleFactory,origin:this.host})}catch(getExposeError){await this.host.loaderHook.lifecycle.afterGetExpose.emit({id,expose,moduleInfo:this.remoteInfo,remoteEntryExports,error:getExposeError,origin:this.host});throw getExposeError}const symbolName=require_tool.processModuleAlias(this.remoteInfo.name,expose);const wrapModuleFactory=this.wraperFactory(moduleFactory,symbolName);if(!loadFactory)return wrapModuleFactory;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,origin:this.host});try{const exposeContent=await wrapModuleFactory();await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,exposeModule:exposeContent,origin:this.host});return exposeContent}catch(executeFactoryError){await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id,expose,moduleInfo:this.remoteInfo,loadFactory,error:executeFactoryError,origin:this.host});throw executeFactoryError}}wraperFactory(moduleFactory,id){function defineModuleId(res,id){if(res&&"object"==typeof res&&Object.isExtensible(res)&&!Object.getOwnPropertyDescriptor(res,Symbol.for("mf_module_id")))Object.defineProperty(res,Symbol.for("mf_module_id"),{value:id,enumerable:false})}return()=>{const res=moduleFactory();if(res instanceof Promise)return res.then(asyncRes=>{defineModuleId(asyncRes,id);return asyncRes});defineModuleId(res,id);return res}}};exports.Module=Module},6141:function(__unused_webpack_module,exports,__webpack_require__){const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_share=__webpack_require__(9774);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const require_index$1=__webpack_require__(1625);let _module_federation_sdk=__webpack_require__(1487);function splitId(id){const splitInfo=id.split(":");if(1===splitInfo.length)return{name:splitInfo[0],version:void 0};if(2===splitInfo.length)return{name:splitInfo[0],version:splitInfo[1]};return{name:splitInfo[1],version:splitInfo[2]}}function traverseModuleInfo(globalSnapshot,remoteInfo,traverse,isRoot,memo={},remoteSnapshot){const{value:snapshotValue}=require_global.getInfoWithoutType(globalSnapshot,require_tool.getFMId(remoteInfo));const effectiveRemoteSnapshot=remoteSnapshot||snapshotValue;if(effectiveRemoteSnapshot&&!(0,_module_federation_sdk.isManifestProvider)(effectiveRemoteSnapshot)){traverse(effectiveRemoteSnapshot,remoteInfo,isRoot);if(effectiveRemoteSnapshot.remotesInfo){const remoteKeys=Object.keys(effectiveRemoteSnapshot.remotesInfo);for(const key of remoteKeys){if(memo[key])continue;memo[key]=true;const subRemoteInfo=splitId(key);const remoteValue=effectiveRemoteSnapshot.remotesInfo[key];traverseModuleInfo(globalSnapshot,{name:subRemoteInfo.name,version:remoteValue.matchedVersion},traverse,false,memo,void 0)}}}}const isExisted=(type,url)=>document.querySelector(`${type}[${"link"===type?"href":"src"}="${url}"]`);function generatePreloadAssets(origin,preloadOptions,remote,globalSnapshot,remoteSnapshot){const cssAssets=[];const jsAssets=[];const entryAssets=[];const loadedSharedJsAssets=/* @__PURE__ */new Set;const loadedSharedCssAssets=/* @__PURE__ */new Set;const{options}=origin;const{preloadConfig:rootPreloadConfig}=preloadOptions;const{depsRemote}=rootPreloadConfig;traverseModuleInfo(globalSnapshot,remote,(moduleInfoSnapshot,remoteInfo,isRoot)=>{let preloadConfig;if(isRoot)preloadConfig=rootPreloadConfig;else if(Array.isArray(depsRemote)){const findPreloadConfig=depsRemote.find(remoteConfig=>{if(remoteConfig.nameOrAlias===remoteInfo.name||remoteConfig.nameOrAlias===remoteInfo.alias)return true;return false});if(!findPreloadConfig)return;preloadConfig=require_preload.defaultPreloadArgs(findPreloadConfig)}else{if(true!==depsRemote)return;preloadConfig=rootPreloadConfig}const remoteEntryUrl=(0,_module_federation_sdk.getResourceUrl)(moduleInfoSnapshot,require_tool.getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);if(remoteEntryUrl)entryAssets.push({name:remoteInfo.name,moduleInfo:{name:remoteInfo.name,entry:remoteEntryUrl,type:"remoteEntryType"in moduleInfoSnapshot?moduleInfoSnapshot.remoteEntryType:"global",entryGlobalName:"globalName"in moduleInfoSnapshot?moduleInfoSnapshot.globalName:remoteInfo.name,shareScope:"",version:"version"in moduleInfoSnapshot?moduleInfoSnapshot.version:void 0},url:remoteEntryUrl});let moduleAssetsInfo="modules"in moduleInfoSnapshot?moduleInfoSnapshot.modules:[];const normalizedPreloadExposes=require_preload.normalizePreloadExposes(preloadConfig.exposes);if(normalizedPreloadExposes.length&&"modules"in moduleInfoSnapshot)moduleAssetsInfo=moduleInfoSnapshot?.modules?.reduce((assets,moduleAssetInfo)=>{if(normalizedPreloadExposes?.indexOf(moduleAssetInfo.moduleName)!==-1)assets.push(moduleAssetInfo);return assets},[]);function handleAssets(assets){const assetsRes=assets.map(asset=>(0,_module_federation_sdk.getResourceUrl)(moduleInfoSnapshot,asset));if(preloadConfig.filter)return assetsRes.filter(preloadConfig.filter);return assetsRes}if(moduleAssetsInfo){const assetsLength=moduleAssetsInfo.length;for(let index=0;index<assetsLength;index++){const assetsInfo=moduleAssetsInfo[index];const exposeFullPath=`${remoteInfo.name}/${assetsInfo.moduleName}`;origin.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===assetsInfo.moduleName?remoteInfo.name:exposeFullPath,name:remoteInfo.name,remoteSnapshot:moduleInfoSnapshot,preloadConfig,remote:remoteInfo,origin});if(!require_global.getPreloaded(exposeFullPath)){if("all"===preloadConfig.resourceCategory){cssAssets.push(...handleAssets(assetsInfo.assets.css.async));cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));jsAssets.push(...handleAssets(assetsInfo.assets.js.async));jsAssets.push(...handleAssets(assetsInfo.assets.js.sync))}else if("sync"===preloadConfig.resourceCategory){cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));jsAssets.push(...handleAssets(assetsInfo.assets.js.sync))}require_global.setPreloaded(exposeFullPath)}}}},true,{},remoteSnapshot);if(remoteSnapshot.shared&&remoteSnapshot.shared.length>0){const collectSharedAssets=(shareInfo,snapshotShared)=>{const{shared:registeredShared}=require_share.getRegisteredShare(origin.shareScopeMap,snapshotShared.sharedName,shareInfo,origin.sharedHandler.hooks.lifecycle.resolveShare)||{};if(registeredShared&&"function"==typeof registeredShared.lib){snapshotShared.assets.js.sync.forEach(asset=>{loadedSharedJsAssets.add(asset)});snapshotShared.assets.css.sync.forEach(asset=>{loadedSharedCssAssets.add(asset)})}};remoteSnapshot.shared.forEach(shared=>{const shareInfos=options.shared?.[shared.sharedName];if(!shareInfos)return;const sharedOptions=shared.version?shareInfos.find(s=>s.version===shared.version):shareInfos;if(!sharedOptions)return;require_tool.arrayOptions(sharedOptions).forEach(s=>{collectSharedAssets(s,shared)})})}const needPreloadJsAssets=jsAssets.filter(asset=>!loadedSharedJsAssets.has(asset)&&!isExisted("script",asset));return{cssAssets:cssAssets.filter(asset=>!loadedSharedCssAssets.has(asset)&&!isExisted("link",asset)),jsAssetsWithoutEntry:needPreloadJsAssets,entryAssets:entryAssets.filter(entry=>!isExisted("script",entry.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(args){const{origin,preloadOptions,remoteInfo,remote,globalSnapshot,remoteSnapshot}=args;if(!_module_federation_sdk.isBrowserEnvValue)return{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]};if(require_tool.isRemoteInfoWithEntry(remote)&&require_tool.isPureRemoteEntry(remote))return{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:remote.name,url:remote.entry,moduleInfo:{name:remoteInfo.name,entry:remote.entry,type:remoteInfo.type||"global",entryGlobalName:"",shareScope:""}}]};require_index$1.assignRemoteInfo(remoteInfo,remoteSnapshot);return generatePreloadAssets(origin,preloadOptions,remoteInfo,globalSnapshot,remoteSnapshot)}}};exports.generatePreloadAssetsPlugin=generatePreloadAssetsPlugin},8281:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_asyncHook=__webpack_require__(2119);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function getGlobalRemoteInfo(moduleInfo,origin){const hostGlobalSnapshot=require_global.getGlobalSnapshotInfoByModuleInfo({name:origin.name,version:origin.options.version});const globalRemoteInfo=hostGlobalSnapshot&&"remotesInfo"in hostGlobalSnapshot&&hostGlobalSnapshot.remotesInfo&&require_global.getInfoWithoutType(hostGlobalSnapshot.remotesInfo,moduleInfo.name).value;if(globalRemoteInfo&&globalRemoteInfo.matchedVersion)return{hostGlobalSnapshot,globalSnapshot:require_global.getGlobalSnapshot(),remoteSnapshot:require_global.getGlobalSnapshotInfoByModuleInfo({name:moduleInfo.name,version:globalRemoteInfo.matchedVersion})};return{hostGlobalSnapshot:void 0,globalSnapshot:require_global.getGlobalSnapshot(),remoteSnapshot:require_global.getGlobalSnapshotInfoByModuleInfo({name:moduleInfo.name,version:"version"in moduleInfo?moduleInfo.version:void 0})}}var SnapshotHandler=class{constructor(HostInstance){this.loadingHostSnapshot=null;this.manifestCache=/* @__PURE__ */new Map;this.hooks=new require_pluginSystem.PluginSystem({beforeLoadRemoteSnapshot:new require_asyncHook.AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new require_asyncWaterfallHooks.AsyncWaterfallHook("afterLoadSnapshot")});this.manifestLoading=require_global.Global.__FEDERATION__.__MANIFEST_LOADING__;this.HostInstance=HostInstance;this.loaderHook=HostInstance.loaderHook}async loadRemoteSnapshotInfo({moduleInfo,id,initiator="loadRemote"}){const{options}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options,moduleInfo,origin:this.HostInstance});let hostSnapshot=require_global.getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});if(!hostSnapshot){hostSnapshot={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}};require_global.addGlobalSnapshot({[this.HostInstance.options.name]:hostSnapshot})}if(hostSnapshot&&"remotesInfo"in hostSnapshot&&!require_global.getInfoWithoutType(hostSnapshot.remotesInfo,moduleInfo.name).value){if("version"in moduleInfo||"entry"in moduleInfo)hostSnapshot.remotesInfo={...hostSnapshot?.remotesInfo,[moduleInfo.name]:{matchedVersion:"version"in moduleInfo?moduleInfo.version:moduleInfo.entry}}}const{hostGlobalSnapshot,remoteSnapshot,globalSnapshot}=this.getGlobalRemoteInfo(moduleInfo);const{remoteSnapshot:globalRemoteSnapshot,globalSnapshot:globalSnapshotRes}=await this.hooks.lifecycle.loadSnapshot.emit({options,moduleInfo,hostGlobalSnapshot,remoteSnapshot,globalSnapshot});let mSnapshot;let gSnapshot;if(globalRemoteSnapshot)if((0,_module_federation_sdk.isManifestProvider)(globalRemoteSnapshot)){const remoteEntry=_module_federation_sdk.isBrowserEnvValue?globalRemoteSnapshot.remoteEntry:globalRemoteSnapshot.ssrRemoteEntry||globalRemoteSnapshot.remoteEntry||"";const moduleSnapshot=await this.loadManifestSnapshot(remoteEntry,moduleInfo,{},{initiator,id:id||moduleInfo.name});const globalSnapshotRes=require_global.setGlobalSnapshotInfoByModuleInfo({...moduleInfo,entry:remoteEntry},moduleSnapshot);mSnapshot=moduleSnapshot;gSnapshot=globalSnapshotRes}else{const{remoteSnapshot:remoteSnapshotRes}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo,remoteSnapshot:globalRemoteSnapshot,from:"global"});mSnapshot=remoteSnapshotRes;gSnapshot=globalSnapshotRes}else if(require_tool.isRemoteInfoWithEntry(moduleInfo)){const moduleSnapshot=await this.loadManifestSnapshot(moduleInfo.entry,moduleInfo,{},{initiator,id:id||moduleInfo.name});const globalSnapshotRes=require_global.setGlobalSnapshotInfoByModuleInfo(moduleInfo,moduleSnapshot);mSnapshot=moduleSnapshot;gSnapshot=globalSnapshotRes}else require_logger.error(_module_federation_error_codes.RUNTIME_007,_module_federation_error_codes.runtimeDescMap,{remoteName:moduleInfo.name,remoteVersion:moduleInfo.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(globalSnapshotRes)},void 0,require_context.optionsToMFContext(this.HostInstance.options));await this.hooks.lifecycle.afterLoadSnapshot.emit({id,host:this.HostInstance,options,moduleInfo,remoteSnapshot:mSnapshot});return{remoteSnapshot:mSnapshot,globalSnapshot:gSnapshot}}getGlobalRemoteInfo(moduleInfo){return getGlobalRemoteInfo(moduleInfo,this.HostInstance)}async getManifestJson(manifestUrl,moduleInfo,extraOptions,resourceOptions){const getManifest=async()=>{const remoteInfo=require_load.getRemoteInfo(moduleInfo);let manifestJson=this.manifestCache.get(manifestUrl);if(manifestJson)return manifestJson;try{let res=await this.loaderHook.lifecycle.fetch.emit(manifestUrl,{},remoteInfo,resourceOptions?{...resourceOptions,url:manifestUrl,resourceType:"manifest"}:void 0);if(!res||!(res instanceof Response))res=await fetch(manifestUrl,{});manifestJson=await res.json()}catch(err){manifestJson=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:manifestUrl,error:err,from:"runtime",lifecycle:"afterResolve",remote:remoteInfo,origin:this.HostInstance});if(!manifestJson){delete this.manifestLoading[manifestUrl];require_logger.error(_module_federation_error_codes.RUNTIME_003,_module_federation_error_codes.runtimeDescMap,{manifestUrl,moduleName:moduleInfo.name,hostName:this.HostInstance.options.name},`${err}`,require_context.optionsToMFContext(this.HostInstance.options))}}const missingRequiredFields=[!manifestJson.metaData&&"metaData",!manifestJson.exposes&&"exposes",!manifestJson.shared&&"shared"].filter(Boolean);if(missingRequiredFields.length>0)await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:manifestUrl,error:/* @__PURE__ */new Error(`"${manifestUrl}" is not a valid federation manifest for remote "${moduleInfo.name}". Missing required fields: ${missingRequiredFields.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:remoteInfo,origin:this.HostInstance});if(missingRequiredFields.length>0)require_logger.error(_module_federation_error_codes.RUNTIME_013,_module_federation_error_codes.runtimeDescMap,{manifestUrl,moduleName:moduleInfo.name,hostName:this.HostInstance.options.name,missingFields:missingRequiredFields.join(",")},void 0,require_context.optionsToMFContext(this.HostInstance.options));this.manifestCache.set(manifestUrl,manifestJson);return manifestJson};return getManifest()}async loadManifestSnapshot(manifestUrl,moduleInfo,extraOptions,resourceOptions){const asyncLoadProcess=async()=>{const manifestJson=await this.getManifestJson(manifestUrl,moduleInfo,extraOptions,resourceOptions);const remoteSnapshot=(0,_module_federation_sdk.generateSnapshotFromManifest)(manifestJson,{version:manifestUrl});const{remoteSnapshot:remoteSnapshotRes}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo,manifestJson,remoteSnapshot,manifestUrl,from:"manifest"});return remoteSnapshotRes};if(!this.manifestLoading[manifestUrl])this.manifestLoading[manifestUrl]=asyncLoadProcess().then(res=>res);return this.manifestLoading[manifestUrl]}};exports.SnapshotHandler=SnapshotHandler;exports.getGlobalRemoteInfo=getGlobalRemoteInfo},2455:function(__unused_webpack_module,exports,__webpack_require__){const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);var DisabledSnapshotHandler=class{constructor(){this.hooks=new require_pluginSystem.PluginSystem({})}};exports.DisabledSnapshotHandler=DisabledSnapshotHandler},1625:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_manifest=__webpack_require__(90);__webpack_require__(4011);const require_preload=__webpack_require__(9064);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);function assignRemoteInfo(remoteInfo,remoteSnapshot){const remoteEntryInfo=require_tool.getRemoteEntryInfoFromSnapshot(remoteSnapshot);if(!remoteEntryInfo.url)require_logger.error(_module_federation_error_codes.RUNTIME_011,_module_federation_error_codes.runtimeDescMap,{remoteName:remoteInfo.name});let entryUrl=(0,_module_federation_sdk.getResourceUrl)(remoteSnapshot,remoteEntryInfo.url);if(!_module_federation_sdk.isBrowserEnvValue&&!entryUrl.startsWith("http"))entryUrl=`https:${entryUrl}`;remoteInfo.type=remoteEntryInfo.type;remoteInfo.entryGlobalName=remoteEntryInfo.globalName;remoteInfo.entry=entryUrl;remoteInfo.version=remoteSnapshot.version;remoteInfo.buildVersion=remoteSnapshot.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(args){const{remote,pkgNameOrAlias,expose,origin,remoteInfo,id}=args;if(!require_tool.isRemoteInfoWithEntry(remote)||!require_tool.isPureRemoteEntry(remote)){const{remoteSnapshot,globalSnapshot}=await origin.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:remote,id:require_manifest.composeRemoteRequestId(remote.name,expose)});assignRemoteInfo(remoteInfo,remoteSnapshot);const preloadOptions={remote,preloadConfig:{nameOrAlias:pkgNameOrAlias,exposes:[expose],resourceCategory:"sync",share:false,depsRemote:false}};const assets=await origin.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin,preloadOptions,remoteInfo,remote,remoteSnapshot,globalSnapshot});if(assets)require_preload.preloadAssets(remoteInfo,origin,assets,false,{initiator:"loadRemote",id}).catch(()=>void 0);return{...args,remoteSnapshot}}return args}}}exports.assignRemoteInfo=assignRemoteInfo;exports.snapshotPlugin=snapshotPlugin},1076:function(__unused_webpack_module,exports,__webpack_require__){const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);const REMOTE_DISABLED_MESSAGE="Remote loading is disabled by experiments.optimization.disableRemote.";var UnavailableRemoteModule=class{constructor(){throw new Error(REMOTE_DISABLED_MESSAGE)}};var DisabledRemoteHandler=class{constructor(){this.hooks=new require_pluginSystem.PluginSystem({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(REMOTE_DISABLED_MESSAGE)}preloadRemote(){throw new Error(REMOTE_DISABLED_MESSAGE)}registerRemotes(){throw new Error(REMOTE_DISABLED_MESSAGE)}getRemoteModuleAndOptions(){throw new Error(REMOTE_DISABLED_MESSAGE)}initRawContainer(){throw new Error(REMOTE_DISABLED_MESSAGE)}};exports.DisabledRemoteHandler=DisabledRemoteHandler;exports.UnavailableRemoteModule=UnavailableRemoteModule},8984:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_preload=__webpack_require__(9064);const require_index$1=__webpack_require__(1518);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);const require_SnapshotHandler=__webpack_require__(8281);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);var RemoteHandler=class{constructor(host){this.hooks=new require_pluginSystem.PluginSystem({beforeRegisterRemote:new require_syncWaterfallHook.SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new require_syncWaterfallHook.SyncWaterfallHook("registerRemote"),beforeRequest:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeRequest"),afterMatchRemote:new require_asyncHook.AsyncHook("afterMatchRemote"),onLoad:new require_asyncHook.AsyncHook("onLoad"),afterLoadRemote:new require_asyncHook.AsyncHook("afterLoadRemote"),handlePreloadModule:new require_syncHook.SyncHook("handlePreloadModule"),errorLoadRemote:new require_asyncHook.AsyncHook("errorLoadRemote"),beforePreloadRemote:new require_asyncHook.AsyncHook("beforePreloadRemote"),generatePreloadAssets:new require_asyncHook.AsyncHook("generatePreloadAssets"),afterPreloadRemote:new require_asyncHook.AsyncHook("afterPreloadRemote"),loadEntry:new require_asyncHook.AsyncHook});this.host=host;this.idToRemoteMap={}}formatAndRegisterRemote(globalOptions,userOptions){return(userOptions.remotes||[]).reduce((res,remote)=>{this.registerRemote(remote,res,{force:false});return res},globalOptions.remotes)}setIdToRemoteMap(id,remoteMatchInfo){const{remote,expose}=remoteMatchInfo;const{name,alias}=remote;this.idToRemoteMap[id]={name:remote.name,expose};if(alias&&id.startsWith(name)){const idWithAlias=id.replace(name,alias);this.idToRemoteMap[idWithAlias]={name:remote.name,expose};return}if(alias&&id.startsWith(alias)){const idWithName=id.replace(alias,name);this.idToRemoteMap[idWithName]={name:remote.name,expose}}}async loadRemote(id,options){const{host}=this;const startMatchInfo=require_manifest.matchRemoteWithNameAndExpose(host.options.remotes,id);let completeRequestId=id;let completeExpose=startMatchInfo?.expose;let completeRemote=startMatchInfo?require_load.getRemoteInfo(startMatchInfo.remote):void 0;let afterLoadRemoteArgs;try{const{loadFactory=true}=options||{loadFactory:true};const{module:module1,moduleOptions,remoteMatchInfo}=await this.getRemoteModuleAndOptions({id});const{pkgNameOrAlias,remote,expose,id:idRes,remoteSnapshot}=remoteMatchInfo;completeRequestId=idRes;completeExpose=expose;completeRemote=require_load.getRemoteInfo(remote);const moduleOrFactory=await module1.get(idRes,expose,options,remoteSnapshot);const moduleWrapper=await this.hooks.lifecycle.onLoad.emit({id:idRes,pkgNameOrAlias,expose,exposeModule:loadFactory?moduleOrFactory:void 0,exposeModuleFactory:loadFactory?void 0:moduleOrFactory,remote,options:moduleOptions,moduleInstance:module1,origin:host});this.setIdToRemoteMap(id,remoteMatchInfo);afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,origin:host};if("function"==typeof moduleWrapper)return moduleWrapper;return moduleOrFactory}catch(error){const{from="runtime"}=options||{from:"runtime"};let failOver;try{failOver=await this.hooks.lifecycle.errorLoadRemote.emit({id,error,from,lifecycle:"onLoad",expose:completeExpose,remote:completeRemote,origin:host})}catch(hookError){afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error:hookError,origin:host};throw hookError}if(!failOver){afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error,origin:host};throw error}afterLoadRemoteArgs={id:completeRequestId,expose:completeExpose,remote:completeRemote,options,error,origin:host,recovered:true};return failOver}finally{if(afterLoadRemoteArgs)await this.hooks.lifecycle.afterLoadRemote.emit(afterLoadRemoteArgs)}}async preloadRemote(preloadOptions){const{host}=this;const preloadResults=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:preloadOptions,options:host.options,origin:host});const preloadOps=require_preload.formatPreloadArgs(host.options.remotes,preloadOptions);const createPreloadAssetOps=ops=>{const{preloadConfig,remote}=ops;const exposes=preloadConfig.exposes||[];if(!exposes.length)return[{ops,id:`${remote.name}/*`}];return exposes.map(expose=>({ops:{...ops,preloadConfig:{...preloadConfig,exposes:[expose]}},id:require_manifest.composeRemoteRequestId(remote.name,expose)}))};let preloadError;await Promise.all(preloadOps.flatMap(createPreloadAssetOps).map(async assetOps=>{const{ops,id:preloadId}=assetOps;const{remote,preloadConfig}=ops;const remoteInfo=require_load.getRemoteInfo(remote);try{const{globalSnapshot,remoteSnapshot}=await host.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:remote,id:preloadId,initiator:"preloadRemote"});const assets=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:host,preloadOptions:ops,remote,remoteInfo,globalSnapshot,remoteSnapshot});if(!assets)return;const results=await require_preload.preloadAssets(remoteInfo,host,assets,true,{initiator:"preloadRemote",id:preloadId});preloadResults.push({remote,remoteInfo,preloadConfig,id:preloadId,results})}catch(error){preloadResults.push({remote,remoteInfo,preloadConfig,id:preloadId,results:[{url:remoteInfo.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(remoteInfo.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:preloadId,error}]})}}));const failedResults=preloadResults.flatMap(preloadResult=>preloadResult.results.filter(result=>"error"===result.status||"timeout"===result.status));if(failedResults.length>0){preloadError=/* @__PURE__ */new Error(`preloadRemote failed to load ${failedResults.length} resource(s).`);Object.assign(preloadError,{results:preloadResults,failedResults})}await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:preloadOptions,options:host.options,origin:host,results:preloadResults,error:preloadError});if(preloadError)throw preloadError}registerRemotes(remotes,options){const{host}=this;remotes.forEach(remote=>{this.registerRemote(remote,host.options.remotes,{force:options?.force})})}initRawContainer(name,url,container){const{host}=this;const module1=new require_index$1.Module({host,remoteInfo:require_load.getRemoteInfo({name,entry:url})});module1.remoteEntryExports=container;host.moduleCache.set(name,module1);return module1}async getRemoteModuleAndOptions(options){const{host}=this;const{id}=options;let loadRemoteArgs;try{loadRemoteArgs=await this.hooks.lifecycle.beforeRequest.emit({id,options:host.options,origin:host})}catch(error){loadRemoteArgs=await this.hooks.lifecycle.errorLoadRemote.emit({id,options:host.options,origin:host,from:"runtime",error,lifecycle:"beforeRequest"});if(!loadRemoteArgs)throw error}const{id:idRes}=loadRemoteArgs;const remoteSplitInfo=require_manifest.matchRemoteWithNameAndExpose(host.options.remotes,idRes);if(!remoteSplitInfo)try{require_logger.error(_module_federation_error_codes.RUNTIME_004,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,requestId:idRes},void 0,require_context.optionsToMFContext(host.options))}catch(matchError){await this.hooks.lifecycle.afterMatchRemote.emit({id:idRes,options:host.options,error:matchError,origin:host});throw matchError}const{remote:rawRemote}=remoteSplitInfo;const remoteInfo=require_load.getRemoteInfo(rawRemote);await this.hooks.lifecycle.afterMatchRemote.emit({id:idRes,...remoteSplitInfo,options:host.options,remoteInfo,origin:host});const matchInfo=await host.sharedHandler.hooks.lifecycle.afterResolve.emit({id:idRes,...remoteSplitInfo,options:host.options,origin:host,remoteInfo});const{remote,expose}=matchInfo;require_logger.assert(remote&&expose,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${idRes}.`);let module1=host.moduleCache.get(remote.name);const moduleOptions={host,remoteInfo};if(!module1){module1=new require_index$1.Module(moduleOptions);host.moduleCache.set(remote.name,module1)}return{module:module1,moduleOptions,remoteMatchInfo:matchInfo}}registerRemote(remote,targetRemotes,options){const{host}=this;const normalizeRemote=()=>{if(remote.alias){const findEqual=targetRemotes.find(item=>remote.alias&&(item.name.startsWith(remote.alias)||item.alias?.startsWith(remote.alias)));require_logger.assert(!findEqual,`The alias ${remote.alias} of remote ${remote.name} is not allowed to be the prefix of ${findEqual&&findEqual.name} name or alias`)}if("entry"in remote){if(_module_federation_sdk.isBrowserEnvValue&&"undefined"!=typeof window&&!remote.entry.startsWith("http"))remote.entry=new URL(remote.entry,window.location.origin).href}if(!remote.shareScope)remote.shareScope=require_constant.DEFAULT_SCOPE;if(!remote.type)remote.type=require_constant.DEFAULT_REMOTE_TYPE};this.hooks.lifecycle.beforeRegisterRemote.emit({remote,origin:host});const registeredRemote=targetRemotes.find(item=>item.name===remote.name);if(registeredRemote){const messages=[`The remote "${remote.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];if(options?.force){this.removeRemote(registeredRemote);normalizeRemote();targetRemotes.push(remote);this.hooks.lifecycle.registerRemote.emit({remote,origin:host});(0,_module_federation_sdk.warn)(messages.join(" "))}}else{normalizeRemote();targetRemotes.push(remote);this.hooks.lifecycle.registerRemote.emit({remote,origin:host})}}removeRemote(remote){try{const{host}=this;const{name}=remote;const remoteIndex=host.options.remotes.findIndex(item=>item.name===name);if(-1!==remoteIndex)host.options.remotes.splice(remoteIndex,1);const globalSnapshotKey=require_global.getInfoWithoutType(require_global.CurrentGlobal.__FEDERATION__.moduleInfo,require_tool.getFMId(remote)).key;delete require_global.CurrentGlobal.__FEDERATION__.moduleInfo[globalSnapshotKey];if("entry"in remote){host.snapshotHandler.manifestCache.delete(remote.entry);delete require_global.Global.__FEDERATION__.__MANIFEST_LOADING__[remote.entry]}const{hostGlobalSnapshot}=require_SnapshotHandler.getGlobalRemoteInfo(remote,host);if(hostGlobalSnapshot){const remoteKey=hostGlobalSnapshot&&"remotesInfo"in hostGlobalSnapshot&&hostGlobalSnapshot.remotesInfo&&require_global.getInfoWithoutType(hostGlobalSnapshot.remotesInfo,remote.name).key;if(remoteKey)delete hostGlobalSnapshot.remotesInfo[remoteKey]}const loadedModule=host.moduleCache.get(remote.name);if(loadedModule){const remoteInfo=loadedModule.remoteInfo;const key=remoteInfo.entryGlobalName;if(require_global.CurrentGlobal[key])if(Object.getOwnPropertyDescriptor(require_global.CurrentGlobal,key)?.configurable)delete require_global.CurrentGlobal[key];else require_global.CurrentGlobal[key]=void 0;const remoteEntryUniqueKey=require_load.getRemoteEntryUniqueKey(loadedModule.remoteInfo);if(require_global.globalLoading[remoteEntryUniqueKey])delete require_global.globalLoading[remoteEntryUniqueKey];let remoteInsId=remoteInfo.buildVersion?(0,_module_federation_sdk.composeKeyWithSeparator)(remoteInfo.name,remoteInfo.buildVersion):remoteInfo.name;const remoteInsIndex=require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(ins=>{if(remoteInfo.buildVersion)return ins.options.id===remoteInsId;return ins.name===remoteInsId});if(-1!==remoteInsIndex){const remoteIns=require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__[remoteInsIndex];remoteInsId=remoteIns.options.id||remoteInsId;const globalShareScopeMap=require_share.getGlobalShareScope();let isAllSharedNotUsed=true;const needDeleteKeys=[];Object.keys(globalShareScopeMap).forEach(instId=>{const shareScopeMap=globalShareScopeMap[instId];shareScopeMap&&Object.keys(shareScopeMap).forEach(shareScope=>{const shareScopeVal=shareScopeMap[shareScope];shareScopeVal&&Object.keys(shareScopeVal).forEach(shareName=>{const sharedPkgs=shareScopeVal[shareName];sharedPkgs&&Object.keys(sharedPkgs).forEach(shareVersion=>{const shared=sharedPkgs[shareVersion];if(shared&&"object"==typeof shared&&shared.from===remoteInfo.name)if(shared.loaded||shared.loading){shared.useIn=shared.useIn.filter(usedHostName=>usedHostName!==remoteInfo.name);if(shared.useIn.length)isAllSharedNotUsed=false;else needDeleteKeys.push([instId,shareScope,shareName,shareVersion])}else needDeleteKeys.push([instId,shareScope,shareName,shareVersion])})})})});if(isAllSharedNotUsed){remoteIns.shareScopeMap={};delete globalShareScopeMap[remoteInsId]}needDeleteKeys.forEach(([insId,shareScope,shareName,shareVersion])=>{delete globalShareScopeMap[insId]?.[shareScope]?.[shareName]?.[shareVersion]});require_global.CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(remoteInsIndex,1)}host.moduleCache.delete(remote.name)}}catch(err){require_logger.logger.error(`removeRemote failed: ${err instanceof Error?err.message:String(err)}`)}}};exports.RemoteHandler=RemoteHandler},5411:function(__unused_webpack_module,exports,__webpack_require__){const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);var DisabledSharedHandler=class{constructor(){this.shareScopeMap={};this.hooks=new require_pluginSystem.PluginSystem({afterResolve:new require_asyncWaterfallHooks.AsyncWaterfallHook("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(scopeName,shareScope){this.shareScopeMap[scopeName]=shareScope}};exports.DisabledSharedHandler=DisabledSharedHandler},805:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_constant=__webpack_require__(1319);const require_share=__webpack_require__(9774);const require_context=__webpack_require__(5086);__webpack_require__(4011);const require_syncHook=__webpack_require__(2734);const require_asyncHook=__webpack_require__(2119);const require_syncWaterfallHook=__webpack_require__(8210);const require_asyncWaterfallHooks=__webpack_require__(2284);const require_pluginSystem=__webpack_require__(9560);__webpack_require__(2094);let _module_federation_error_codes=__webpack_require__(7110);var SharedHandler=class{constructor(host){this.hooks=new require_pluginSystem.PluginSystem({beforeRegisterShare:new require_syncWaterfallHook.SyncWaterfallHook("beforeRegisterShare"),afterResolve:new require_asyncWaterfallHooks.AsyncWaterfallHook("afterResolve"),beforeLoadShare:new require_asyncWaterfallHooks.AsyncWaterfallHook("beforeLoadShare"),loadShare:new require_asyncHook.AsyncHook,afterLoadShare:new require_syncHook.SyncHook("afterLoadShare"),errorLoadShare:new require_syncHook.SyncHook("errorLoadShare"),resolveShare:new require_syncWaterfallHook.SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new require_syncWaterfallHook.SyncWaterfallHook("initContainerShareScopeMap")});this.host=host;this.shareScopeMap={};this.initTokens={};this._setGlobalShareScopeMap(host.options)}emitAfterLoadShare({lifecycle,pkgName,shareInfo,selectedShared}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName,shareInfo,selectedShared,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle,origin:this.host})}catch(error){require_logger.warn(error)}}emitErrorLoadShare({lifecycle,pkgName,shareInfo,error,recovered}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName,shareInfo,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle,origin:this.host,error,recovered})}catch(hookError){require_logger.warn(hookError)}}registerShared(globalOptions,userOptions){const{newShareInfos,allShareInfos}=require_share.formatShareConfigs(globalOptions,userOptions);Object.keys(newShareInfos).forEach(sharedKey=>{newShareInfos[sharedKey].forEach(sharedVal=>{sharedVal.scope.forEach(sc=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:sharedKey,shared:sharedVal});if(!this.shareScopeMap[sc]?.[sharedKey])this.setShared({pkgName:sharedKey,lib:sharedVal.lib,get:sharedVal.get,loaded:sharedVal.loaded||Boolean(sharedVal.lib),shared:sharedVal,from:userOptions.name})})})});return{newShareInfos,allShareInfos}}async loadShare(pkgName,extraOptions){const{host}=this;const shareOptions=require_share.getTargetSharedOptions({pkgName,extraOptions,shareInfos:host.options.shared});let shareOptionsRes=shareOptions;try{if(shareOptions?.scope)await Promise.all(shareOptions.scope.map(async shareScope=>{await Promise.all(this.initializeSharing(shareScope,{strategy:shareOptions.strategy}))}));shareOptionsRes=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName,shareInfo:shareOptions,shared:host.options.shared,origin:host})).shareInfo;require_logger.assert(shareOptionsRes,`Cannot find shared "${pkgName}" in host "${host.options.name}". Ensure the shared config for "${pkgName}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const resolvedShareOptions=shareOptionsRes;const{shared:registeredShared,useTreesShaking}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,shareOptionsRes,this.hooks.lifecycle.resolveShare)||{};if(registeredShared){const targetShared=require_share.directShare(registeredShared,useTreesShaking);if(targetShared.lib){require_share.addUseIn(targetShared,host.options.name);this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return targetShared.lib}if(targetShared.loading&&!targetShared.loaded){const factory=await targetShared.loading;targetShared.loaded=true;if(!targetShared.lib)targetShared.lib=factory;require_share.addUseIn(targetShared,host.options.name);this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return factory}{const asyncLoadProcess=async()=>{const factory=await targetShared.get();require_share.addUseIn(targetShared,host.options.name);targetShared.loaded=true;targetShared.lib=factory;return factory};const loading=asyncLoadProcess();this.setShared({pkgName,loaded:false,shared:registeredShared,from:host.options.name,lib:null,loading,treeShaking:useTreesShaking?targetShared:void 0});const factory=await loading;this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:registeredShared});return factory}}{if(extraOptions?.customShareInfo){this.emitErrorLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,recovered:true});return false}const _useTreeShaking=require_share.shouldUseTreeShaking(resolvedShareOptions.treeShaking);const targetShared=require_share.directShare(resolvedShareOptions,_useTreeShaking);const asyncLoadProcess=async()=>{const factory=await targetShared.get();targetShared.lib=factory;targetShared.loaded=true;require_share.addUseIn(targetShared,host.options.name);const{shared:gShared,useTreesShaking:gUseTreeShaking}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,resolvedShareOptions,this.hooks.lifecycle.resolveShare)||{};if(gShared){const targetGShared=require_share.directShare(gShared,gUseTreeShaking);targetGShared.lib=factory;targetGShared.loaded=true;gShared.from=resolvedShareOptions.from}return factory};const loading=asyncLoadProcess();this.setShared({pkgName,loaded:false,shared:resolvedShareOptions,from:host.options.name,lib:null,loading,treeShaking:_useTreeShaking?targetShared:void 0});const factory=await loading;this.emitAfterLoadShare({lifecycle:"loadShare",pkgName,shareInfo:resolvedShareOptions,selectedShared:resolvedShareOptions});return factory}}catch(shareError){this.emitErrorLoadShare({lifecycle:"loadShare",pkgName,shareInfo:shareOptionsRes,error:shareError});throw shareError}}initializeSharing(shareScopeName=require_constant.DEFAULT_SCOPE,extraOptions){const{host}=this;const from=extraOptions?.from;const strategy=extraOptions?.strategy;let initScope=extraOptions?.initScope;const promises=[];if("build"!==from){const{initTokens}=this;if(!initScope)initScope=[];let initToken=initTokens[shareScopeName];if(!initToken)initToken=initTokens[shareScopeName]={from:this.host.name};if(initScope.indexOf(initToken)>=0)return promises;initScope.push(initToken)}const shareScope=this.shareScopeMap;const hostName=host.options.name;if(!shareScope[shareScopeName])shareScope[shareScopeName]={};const scope=shareScope[shareScopeName];const register=(name,shared)=>{const{version,eager}=shared;scope[name]=scope[name]||{};const versions=scope[name];const activeVersion=versions[version]&&require_share.directShare(versions[version]);const activeVersionEager=Boolean(activeVersion&&("eager"in activeVersion&&activeVersion.eager||"shareConfig"in activeVersion&&activeVersion.shareConfig?.eager));if(!activeVersion||"loaded-first"!==activeVersion.strategy&&!activeVersion.loaded&&(Boolean(!eager)!==!activeVersionEager?eager:hostName>versions[version].from))versions[version]=shared};const initRemoteModule=async key=>{const{module:module1}=await host.remoteHandler.getRemoteModuleAndOptions({id:key});let remoteEntryExports;try{remoteEntryExports=await module1.getEntry()}catch(error){remoteEntryExports=await host.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:key,error,from:"runtime",lifecycle:"beforeLoadShare",remote:module1.remoteInfo,origin:host});if(!remoteEntryExports)return}finally{if(remoteEntryExports?.init&&!module1.initing){module1.remoteEntryExports=remoteEntryExports;await module1.init(void 0,void 0,initScope)}}};Object.keys(host.options.shared).forEach(shareName=>{host.options.shared[shareName].forEach(shared=>{if(shared.scope.includes(shareScopeName))register(shareName,shared)})});if("version-first"===host.options.shareStrategy||"version-first"===strategy)host.options.remotes.forEach(remote=>{if(remote.shareScope===shareScopeName)promises.push(initRemoteModule(remote.name))});return promises}loadShareSync(pkgName,extraOptions){const{host}=this;const shareOptions=require_share.getTargetSharedOptions({pkgName,extraOptions,shareInfos:host.options.shared});try{if(shareOptions?.scope)shareOptions.scope.forEach(shareScope=>{this.initializeSharing(shareScope,{strategy:shareOptions.strategy})});const{shared:registeredShared}=require_share.getRegisteredShare(this.shareScopeMap,pkgName,shareOptions,this.hooks.lifecycle.resolveShare)||{};if(registeredShared){if("function"==typeof registeredShared.lib){require_share.addUseIn(registeredShared,host.options.name);if(!registeredShared.loaded){registeredShared.loaded=true;if(registeredShared.from===host.options.name)shareOptions.loaded=true}this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:registeredShared});return registeredShared.lib}if("function"==typeof registeredShared.get){const module1=registeredShared.get();if(!(module1 instanceof Promise)){require_share.addUseIn(registeredShared,host.options.name);this.setShared({pkgName,loaded:true,from:host.options.name,lib:module1,shared:registeredShared});this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:registeredShared});return module1}}}if(shareOptions.lib){if(!shareOptions.loaded)shareOptions.loaded=true;this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:shareOptions});return shareOptions.lib}if(shareOptions.get){const module1=shareOptions.get();if(module1 instanceof Promise)require_logger.error(extraOptions?.from==="build"?_module_federation_error_codes.RUNTIME_005:_module_federation_error_codes.RUNTIME_006,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,sharedPkgName:pkgName},void 0,require_context.optionsToMFContext(host.options));shareOptions.lib=module1;this.setShared({pkgName,loaded:true,from:host.options.name,lib:shareOptions.lib,shared:shareOptions});this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,selectedShared:shareOptions});return shareOptions.lib}require_logger.error(_module_federation_error_codes.RUNTIME_006,_module_federation_error_codes.runtimeDescMap,{hostName:host.options.name,sharedPkgName:pkgName},void 0,require_context.optionsToMFContext(host.options))}catch(shareError){this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName,shareInfo:shareOptions,error:shareError});throw shareError}}initShareScopeMap(scopeName,shareScope,extraOptions={}){const{host}=this;this.shareScopeMap[scopeName]=shareScope;this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope,options:host.options,origin:host,scopeName,hostShareScopeMap:extraOptions.hostShareScopeMap})}setShared({pkgName,shared,from,lib,loading,loaded,get,treeShaking}){const{version,scope="default",...shareInfo}=shared;const scopes=Array.isArray(scope)?scope:[scope];const mergeAttrs=shared=>{const merge=(s,key,val)=>{if(val&&!s[key])s[key]=val};const targetShared=treeShaking?shared.treeShaking:shared;merge(targetShared,"loaded",loaded);merge(targetShared,"loading",loading);merge(targetShared,"get",get)};scopes.forEach(sc=>{if(!this.shareScopeMap[sc])this.shareScopeMap[sc]={};if(!this.shareScopeMap[sc][pkgName])this.shareScopeMap[sc][pkgName]={};if(!this.shareScopeMap[sc][pkgName][version])this.shareScopeMap[sc][pkgName][version]={version,scope:[sc],...shareInfo,lib};const registeredShared=this.shareScopeMap[sc][pkgName][version];mergeAttrs(registeredShared);if(from&®isteredShared.from!==from)registeredShared.from=from})}_setGlobalShareScopeMap(hostOptions){const globalShareScopeMap=require_share.getGlobalShareScope();const identifier=hostOptions.id||hostOptions.name;if(identifier&&!globalShareScopeMap[identifier])globalShareScopeMap[identifier]=this.shareScopeMap}};exports.SharedHandler=SharedHandler},9998:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(5617);var type_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"type_exports",{enumerable:true,get:function(){return type_exports}})},5086:function(__unused_webpack_module,exports){function remoteToEntry(r){return{name:r.name,alias:r.alias,entry:"entry"in r?r.entry:void 0,version:"version"in r?r.version:void 0,type:r.type,entryGlobalName:r.entryGlobalName,shareScope:r.shareScope}}function optionsToMFContext(options){const shared={};for(const[pkgName,versions]of Object.entries(options.shared)){const first=versions[0];if(first)shared[pkgName]={version:first.version,singleton:first.shareConfig?.singleton,requiredVersion:first.shareConfig?.requiredVersion===false?false:first.shareConfig?.requiredVersion,eager:first.eager,strictVersion:first.shareConfig?.strictVersion}}return{project:{name:options.name,mfRole:options.remotes?.length>0?"host":"unknown"},mfConfig:{name:options.name,remotes:options.remotes?.map(remoteToEntry)??[],shared}}}exports.optionsToMFContext=optionsToMFContext},8042:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(1487);function getBuilderId(){return"mf_playground:0.0.4"}exports.getBuilderId=getBuilderId},2119:function(__unused_webpack_module,exports,__webpack_require__){const require_syncHook=__webpack_require__(2734);var AsyncHook=class extends require_syncHook.SyncHook{emit(...data){let result;const ls=Array.from(this.listeners);if(ls.length>0){let i=0;const call=prev=>{if(false===prev)return false;if(i<ls.length)return Promise.resolve(ls[i++].apply(null,data)).then(result=>{if(void 0===result||1===data.length&&result===data[0])return call(prev);return call(result)});return prev};result=call()}return Promise.resolve(result)}};exports.AsyncHook=AsyncHook},2284:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_syncHook=__webpack_require__(2734);const require_syncWaterfallHook=__webpack_require__(8210);var AsyncWaterfallHook=class extends require_syncHook.SyncHook{constructor(type){super();this.onerror=require_logger.error;this.type=type}emit(data){if(!require_tool.isObject(data))require_logger.error(`The response data for the "${this.type}" hook must be an object.`);const ls=Array.from(this.listeners);if(ls.length>0){let i=0;const processError=e=>{require_logger.warn(e);this.onerror(e);return data};const call=prevData=>{if(void 0!==prevData&&require_syncWaterfallHook.checkReturnData(data,prevData))data=prevData;else if(void 0!==prevData){this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return data}if(i<ls.length)try{return Promise.resolve(ls[i++](data)).then(call,processError)}catch(e){return processError(e)}return data};return Promise.resolve(call(data))}return Promise.resolve(data)}};exports.AsyncWaterfallHook=AsyncWaterfallHook},2094:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(2734);__webpack_require__(2119);__webpack_require__(8210);__webpack_require__(2284);__webpack_require__(9560)},9560:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);__webpack_require__(4011);var PluginSystem=class{constructor(lifecycle){this.registerPlugins={};this.lifecycle=lifecycle;this.lifecycleKeys=Object.keys(lifecycle)}applyPlugin(plugin,instance){require_logger.assert(require_tool.isPlainObject(plugin),"Plugin configuration is invalid.");const pluginName=plugin.name;require_logger.assert(pluginName,"A name must be provided by the plugin.");if(!this.registerPlugins[pluginName]){this.registerPlugins[pluginName]=plugin;plugin.apply?.(instance);Object.keys(this.lifecycle).forEach(key=>{const pluginLife=plugin[key];if(pluginLife)this.lifecycle[key].on(pluginLife)})}}removePlugin(pluginName){require_logger.assert(pluginName,"A name is required.");const plugin=this.registerPlugins[pluginName];require_logger.assert(plugin,`The plugin "${pluginName}" is not registered.`);Object.keys(plugin).forEach(key=>{if("name"!==key)this.lifecycle[key].remove(plugin[key])})}};exports.PluginSystem=PluginSystem},2734:function(__unused_webpack_module,exports){var SyncHook=class{constructor(type){this.type="";this.listeners=/* @__PURE__ */new Set;if(type)this.type=type}on(fn){if("function"==typeof fn)this.listeners.add(fn)}once(fn){const self=this;this.on(function wrapper(...args){self.remove(wrapper);return fn.apply(null,args)})}emit(...data){let result;if(this.listeners.size>0)this.listeners.forEach(fn=>{const nextResult=fn(...data);if(void 0!==nextResult)result=nextResult});return result}remove(fn){this.listeners.delete(fn)}removeAll(){this.listeners.clear()}};exports.SyncHook=SyncHook},8210:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_syncHook=__webpack_require__(2734);function checkReturnData(originalData,returnedData){if(!require_tool.isObject(returnedData))return false;if(originalData!==returnedData){for(const key in originalData)if(!(key in returnedData))return false}return true}var SyncWaterfallHook=class extends require_syncHook.SyncHook{constructor(type){super();this.onerror=require_logger.error;this.type=type}emit(data){if(!require_tool.isObject(data))require_logger.error(`The data for the "${this.type}" hook should be an object.`);for(const fn of this.listeners)try{const tempData=fn(data);if(void 0===tempData)continue;if(checkReturnData(data,tempData))data=tempData;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){require_logger.warn(e);this.onerror(e)}return data}};exports.SyncWaterfallHook=SyncWaterfallHook;exports.checkReturnData=checkReturnData},4011:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(7657);__webpack_require__(8607);__webpack_require__(8042);__webpack_require__(90);__webpack_require__(3584);__webpack_require__(5265);__webpack_require__(5086);__webpack_require__(1487)},5265:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes=__webpack_require__(7110);const importCallback=".then(callbacks[0]).catch(callbacks[1])";function isEsmRemoteType(type){return"esm"===type||"module"===type}async function loadEsmEntry({entry,remoteEntryExports}){return new Promise((resolve,reject)=>{try{if(remoteEntryExports)resolve(remoteEntryExports);else if("undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION)new Function("callbacks",`import("${entry}")${importCallback}`)([resolve,reject]);else import(/* @vite-ignore */entry).then(resolve).catch(reject)}catch(e){require_logger.error(`Failed to load ESM entry from "${entry}". ${e instanceof Error?e.message:String(e)}`)}})}async function loadSystemJsEntry({entry,remoteEntryExports}){return new Promise((resolve,reject)=>{try{if(remoteEntryExports)resolve(remoteEntryExports);else new Function("callbacks",`System.import("${entry}")${importCallback}`)([resolve,reject])}catch(e){require_logger.error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error?e.message:String(e)}`)}})}function handleRemoteEntryLoaded(name,globalName,entry){const{remoteEntryKey,entryExports}=require_global.getRemoteEntryExports(name,globalName);if(!entryExports)require_logger.error(_module_federation_error_codes.RUNTIME_001,_module_federation_error_codes.runtimeDescMap,{remoteName:name,remoteEntryUrl:entry,remoteEntryKey});return entryExports}async function loadEntryScript({name,globalName,entry,remoteInfo,loaderHook,getEntryUrl,resourceContext}){const{entryExports:remoteEntryExports}=require_global.getRemoteEntryExports(name,globalName);if(remoteEntryExports)return remoteEntryExports;const url=getEntryUrl?getEntryUrl(entry):entry;return(0,_module_federation_sdk.loadScript)(url,{attrs:{},createScriptHook:(url,attrs)=>{const res=loaderHook.lifecycle.createScript.emit({url,attrs,remoteInfo,resourceContext:resourceContext?{...resourceContext,url}:void 0});if(!res)return;if(res instanceof HTMLScriptElement)return res;if("script"in res||"timeout"in res)return res}}).then(()=>handleRemoteEntryLoaded(name,globalName,entry),loadError=>{const originalMsg=loadError instanceof Error?loadError.message:String(loadError);require_logger.error(_module_federation_error_codes.RUNTIME_008,_module_federation_error_codes.runtimeDescMap,{remoteName:name,resourceUrl:url},originalMsg)})}async function loadEntryDom({remoteInfo,remoteEntryExports,loaderHook,getEntryUrl,resourceContext}){const{entry,entryGlobalName:globalName,name,type}=remoteInfo;if(isEsmRemoteType(type))return loadEsmEntry({entry,remoteEntryExports});if("system"===type)return loadSystemJsEntry({entry,remoteEntryExports});return loadEntryScript({entry,globalName,name,remoteInfo,loaderHook,getEntryUrl,resourceContext})}async function loadEntryNode({remoteInfo,loaderHook,resourceContext}){const{entry,entryGlobalName:globalName,name,type}=remoteInfo;const{entryExports:remoteEntryExports}=require_global.getRemoteEntryExports(name,globalName);if(remoteEntryExports)return remoteEntryExports;return(0,_module_federation_sdk.loadScriptNode)(entry,{attrs:{name,globalName,type},loaderHook:{createScriptHook:(url,attrs={})=>{const res=loaderHook.lifecycle.createScript.emit({url,attrs,remoteInfo,resourceContext:resourceContext?{...resourceContext,url}:void 0});if(!res)return;if("url"in res)return res}}}).then(()=>handleRemoteEntryLoaded(name,globalName,entry)).catch(e=>{require_logger.error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error?e.message:String(e)}`)})}function getRemoteEntryUniqueKey(remoteInfo){const{entry,name}=remoteInfo;return(0,_module_federation_sdk.composeKeyWithSeparator)(name,entry)}async function getRemoteEntry(params){const{origin,remoteEntryExports,remoteInfo,getEntryUrl,resourceContext,_inErrorHandling=false}=params;const uniqueKey=getRemoteEntryUniqueKey(remoteInfo);if(remoteEntryExports)return remoteEntryExports;if(!require_global.globalLoading[uniqueKey]){const loadEntryHook=origin.remoteHandler.hooks.lifecycle.loadEntry;const loaderHook=origin.loaderHook;require_global.globalLoading[uniqueKey]=loadEntryHook.emit({origin,loaderHook,remoteInfo,remoteEntryExports}).then(res=>{if(res)return res;return("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:_module_federation_sdk.isBrowserEnvValue)?loadEntryDom({remoteInfo,remoteEntryExports,loaderHook,getEntryUrl,resourceContext}):loadEntryNode({remoteInfo,loaderHook,resourceContext})}).then(async res=>{await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,remoteEntryExports:res});return res}).catch(async err=>{const uniqueKey=getRemoteEntryUniqueKey(remoteInfo);const isScriptExecutionError=err instanceof Error&&err.message.includes("ScriptExecutionError");if(err instanceof Error&&err.message.includes(_module_federation_error_codes.RUNTIME_008)&&!isScriptExecutionError&&!_inErrorHandling){const wrappedGetRemoteEntry=params=>getRemoteEntry({...params,_inErrorHandling:true});const RemoteEntryExports=await origin.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:wrappedGetRemoteEntry,origin,remoteInfo,remoteEntryExports,globalLoading:require_global.globalLoading,uniqueKey});if(RemoteEntryExports){await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,remoteEntryExports:RemoteEntryExports,recovered:true});return RemoteEntryExports}}await origin.loaderHook.lifecycle.afterLoadEntry.emit({origin,remoteInfo,error:err});throw err})}return require_global.globalLoading[uniqueKey]}function getRemoteInfo(remote){return{...remote,entry:"entry"in remote?remote.entry:"",type:remote.type||require_constant.DEFAULT_REMOTE_TYPE,entryGlobalName:remote.entryGlobalName||remote.name,shareScope:remote.shareScope||require_constant.DEFAULT_SCOPE}}exports.getRemoteEntry=getRemoteEntry;exports.getRemoteEntryUniqueKey=getRemoteEntryUniqueKey;exports.getRemoteInfo=getRemoteInfo;exports.isEsmRemoteType=isEsmRemoteType},7657:function(__unused_webpack_module,exports,__webpack_require__){let _module_federation_sdk=__webpack_require__(1487);let _module_federation_error_codes_browser=__webpack_require__(6550);const LOG_CATEGORY="[ Federation Runtime ]";const logger=(0,_module_federation_sdk.createLogger)(LOG_CATEGORY);function assert(condition,msgOrCode,descMap,args,context){if(!condition)void 0!==descMap?error(msgOrCode,descMap,args,void 0,context):error(msgOrCode)}function error(msgOrCode,descMap,args,originalErrorMsg,context){if(void 0!==descMap)return(0,_module_federation_error_codes_browser.logAndReport)(msgOrCode,descMap,args??{},msg=>{throw new Error(`${LOG_CATEGORY}: ${msg}`)},originalErrorMsg,context);const msg=msgOrCode;if(msg instanceof Error){if(!msg.message.startsWith(LOG_CATEGORY))msg.message=`${LOG_CATEGORY}: ${msg.message}`;throw msg}throw new Error(`${LOG_CATEGORY}: ${msg}`)}function warn(msg){if(msg instanceof Error){if(!msg.message.startsWith(LOG_CATEGORY))msg.message=`${LOG_CATEGORY}: ${msg.message}`;logger.warn(msg)}else logger.warn(msg)}exports.assert=assert;exports.error=error;exports.logger=logger;exports.warn=warn},90:function(__unused_webpack_module,exports){function composeRemoteRequestId(remoteName,expose){if(!expose||"."===expose)return remoteName;return`${remoteName}/${expose.replace(/^\.\//,"")}`}function matchRemoteWithNameAndExpose(remotes,id){for(const remote of remotes){const isNameMatched=id.startsWith(remote.name);let expose=id.replace(remote.name,"");if(isNameMatched){if(expose.startsWith("/")){const pkgNameOrAlias=remote.name;expose=`.${expose}`;return{pkgNameOrAlias,expose,remote}}else if(""===expose)return{pkgNameOrAlias:remote.name,expose:".",remote}}const isAliasMatched=remote.alias&&id.startsWith(remote.alias);let exposeWithAlias=remote.alias&&id.replace(remote.alias,"");if(remote.alias&&isAliasMatched){if(exposeWithAlias&&exposeWithAlias.startsWith("/")){const pkgNameOrAlias=remote.alias;exposeWithAlias=`.${exposeWithAlias}`;return{pkgNameOrAlias,expose:exposeWithAlias,remote}}else if(""===exposeWithAlias)return{pkgNameOrAlias:remote.alias,expose:".",remote}}}}function matchRemote(remotes,nameOrAlias){for(const remote of remotes){if(nameOrAlias===remote.name)return remote;if(remote.alias&&nameOrAlias===remote.alias)return remote}}exports.composeRemoteRequestId=composeRemoteRequestId;exports.matchRemote=matchRemote;exports.matchRemoteWithNameAndExpose=matchRemoteWithNameAndExpose},3584:function(__unused_webpack_module,exports,__webpack_require__){const require_global=__webpack_require__(7922);function registerPlugins(plugins,instance){const globalPlugins=require_global.getGlobalHostPlugins();const hookInstances=[instance.hooks,instance.remoteHandler.hooks,instance.sharedHandler.hooks,instance.snapshotHandler.hooks,instance.loaderHook,instance.bridgeHook];if(globalPlugins.length>0)globalPlugins.forEach(plugin=>{if(plugins?.find(item=>item.name!==plugin.name))plugins.push(plugin)});if(plugins&&plugins.length>0)plugins.forEach(plugin=>{hookInstances.forEach(hookInstance=>{hookInstance.applyPlugin(plugin,instance)})});return plugins}exports.registerPlugins=registerPlugins},9064:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_manifest=__webpack_require__(90);const require_load=__webpack_require__(5265);let _module_federation_sdk=__webpack_require__(1487);function defaultPreloadArgs(preloadConfig){return{resourceCategory:"sync",share:true,depsRemote:true,...preloadConfig}}function formatPreloadArgs(remotes,preloadArgs){return preloadArgs.map(args=>{const remoteInfo=require_manifest.matchRemote(remotes,args.nameOrAlias);require_logger.assert(remoteInfo,`Unable to preload ${args.nameOrAlias} as it is not included in ${!remoteInfo&&(0,_module_federation_sdk.safeToString)({remoteInfo,remotes})}`);return{remote:remoteInfo,preloadConfig:defaultPreloadArgs(args)}})}function normalizePreloadExposes(exposes){if(!exposes)return[];return exposes.map(expose=>{if("."===expose)return expose;if(expose.startsWith("./"))return expose.replace("./","");return expose})}function isTimeoutError(error){if(!(error instanceof Error))return false;return error.message.includes("timed out")||error.name.includes("Timeout")}function createAssetResult(context,url,status,error){return{url,status,resourceType:context.resourceType,initiator:context.initiator,id:context.id,error}}async function waitForRemoteEntryPreload(host,remoteInfo,entryRemoteInfo,context){const cachedRemote=host.moduleCache.get(entryRemoteInfo.name);const url=entryRemoteInfo.entry;if(cachedRemote?.remoteEntryExports)return createAssetResult(context,url,"cached");try{if(!await require_load.getRemoteEntry({origin:host,remoteInfo:entryRemoteInfo,remoteEntryExports:cachedRemote?.remoteEntryExports,resourceContext:{...context,url}}))throw new Error(`Failed to load remoteEntry "${url}".`);return createAssetResult(context,url,"success")}catch(error){return createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error)}}function waitForLinkPreload({host,remoteInfo,url,attrs,context,needDeleteLink}){return new Promise(resolve=>{const{link,needAttach}=(0,_module_federation_sdk.createLink)({url,cb:()=>{resolve(createAssetResult(context,url,needAttach?"success":"cached"))},onErrorCallback:error=>{resolve(createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error))},attrs,createLinkHook:(hookUrl,hookAttrs)=>{const res=host.loaderHook.lifecycle.createLink.emit({url:hookUrl,attrs:hookAttrs,remoteInfo,resourceContext:{...context,url:hookUrl}});HTMLLinkElement;return res},needDeleteLink});needAttach&&document.head.appendChild(link)})}function waitForScriptPreload({host,remoteInfo,url,attrs,context}){return new Promise(resolve=>{const{script,needAttach}=(0,_module_federation_sdk.createScript)({url,cb:()=>{resolve(createAssetResult(context,url,needAttach?"success":"cached"))},onErrorCallback:error=>{resolve(createAssetResult(context,url,isTimeoutError(error)?"timeout":"error",error))},attrs,createScriptHook:(hookUrl,hookAttrs)=>{const res=host.loaderHook.lifecycle.createScript.emit({url:hookUrl,attrs:hookAttrs,remoteInfo,resourceContext:{...context,url:hookUrl}});HTMLScriptElement;return res},needDeleteScript:true});needAttach&&document.head.appendChild(script)})}function createResourceContext(baseContext,resourceType){return{...baseContext,resourceType}}function preloadAssets(remoteInfo,host,assets,useLinkPreload=true,baseContext={initiator:"preloadRemote",id:remoteInfo.name}){const{cssAssets,jsAssetsWithoutEntry,entryAssets}=assets;const results=[];if(host.options.inBrowser){entryAssets.forEach(asset=>{const{moduleInfo:entryRemoteInfo}=asset;results.push(waitForRemoteEntryPreload(host,remoteInfo,entryRemoteInfo,createResourceContext(baseContext,"remoteEntry")))});if(useLinkPreload){const defaultAttrs={rel:"preload",as:"style"};cssAssets.forEach(cssUrl=>{results.push(waitForLinkPreload({host,remoteInfo,url:cssUrl,attrs:defaultAttrs,context:createResourceContext(baseContext,"css")}))})}else{const defaultAttrs={rel:"stylesheet",type:"text/css"};cssAssets.forEach(cssUrl=>{results.push(waitForLinkPreload({host,remoteInfo,url:cssUrl,attrs:defaultAttrs,needDeleteLink:false,context:createResourceContext(baseContext,"css")}))})}let preloadJsAsset=waitForScriptPreload;let defaultAttrs={fetchpriority:"high",type:"text/javascript"};if(useLinkPreload){preloadJsAsset=waitForLinkPreload;defaultAttrs={rel:"preload",as:"script"}}else if(require_load.isEsmRemoteType(remoteInfo.type)){preloadJsAsset=waitForLinkPreload;defaultAttrs={rel:"modulepreload",fetchpriority:"high"}}jsAssetsWithoutEntry.forEach(jsUrl=>{results.push(preloadJsAsset({host,remoteInfo,url:jsUrl,attrs:defaultAttrs,context:createResourceContext(baseContext,"js")}))})}return Promise.all(results)}exports.defaultPreloadArgs=defaultPreloadArgs;exports.formatPreloadArgs=formatPreloadArgs;exports.normalizePreloadExposes=normalizePreloadExposes;exports.preloadAssets=preloadAssets},2197:function(__unused_webpack_module,exports){function compareAtom(rangeAtom,versionAtom){rangeAtom=Number(rangeAtom)||rangeAtom;versionAtom=Number(versionAtom)||versionAtom;if(rangeAtom>versionAtom)return 1;if(rangeAtom===versionAtom)return 0;return -1}function comparePreRelease(rangeAtom,versionAtom){const{preRelease:rangePreRelease}=rangeAtom;const{preRelease:versionPreRelease}=versionAtom;if(void 0===rangePreRelease&&Boolean(versionPreRelease))return 1;if(Boolean(rangePreRelease)&&void 0===versionPreRelease)return -1;if(void 0===rangePreRelease&&void 0===versionPreRelease)return 0;for(let i=0,n=rangePreRelease.length;i<=n;i++){const rangeElement=rangePreRelease[i];const versionElement=versionPreRelease[i];if(rangeElement!==versionElement){if(void 0===rangeElement&&void 0===versionElement)return 0;if(!rangeElement)return 1;if(!versionElement)return -1;return compareAtom(rangeElement,versionElement)}}return 0}function compareVersion(rangeAtom,versionAtom){return compareAtom(rangeAtom.major,versionAtom.major)||compareAtom(rangeAtom.minor,versionAtom.minor)||compareAtom(rangeAtom.patch,versionAtom.patch)||comparePreRelease(rangeAtom,versionAtom)}function eq(rangeAtom,versionAtom){return rangeAtom.version===versionAtom.version}function compare(rangeAtom,versionAtom){switch(rangeAtom.operator){case"":case"=":return eq(rangeAtom,versionAtom);case">":return compareVersion(rangeAtom,versionAtom)<0;case">=":return eq(rangeAtom,versionAtom)||compareVersion(rangeAtom,versionAtom)<0;case"<":return compareVersion(rangeAtom,versionAtom)>0;case"<=":return eq(rangeAtom,versionAtom)||compareVersion(rangeAtom,versionAtom)>0;case void 0:return true;default:return false}}exports.compare=compare},5567:function(__unused_webpack_module,exports){const buildIdentifier="[0-9A-Za-z-]+";const build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;const numericIdentifier="0|[1-9]\\d*";const numericIdentifierLoose="[0-9]+";const nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*";const preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;const preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`;const preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`;const preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`;const xRangeIdentifier=`${numericIdentifier}|x|X|\\*`;const xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;const hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`;const loosePlain=`[v=\\s]*${`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`}${preReleaseLoose}?${build}?`;const gtlt="((?:<|>)?=?)";const comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`;const loneTilde="(?:~>?)";const tildeTrim=`(\\s*)${loneTilde}\\s+`;const loneCaret="(?:\\^)";const caretTrim=`(\\s*)${loneCaret}\\s+`;const star="(<|>)?=?\\s*\\*";const caret=`^${loneCaret}${xRangePlain}$`;const fullPlain=`v?${`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`}${preRelease}?${build}?`;const tilde=`^${loneTilde}${xRangePlain}$`;const xRange=`^${gtlt}\\s*${xRangePlain}$`;const comparator=`^${gtlt}\\s*(${fullPlain})$|^$`;const gte0="^\\s*>=\\s*0.0.0\\s*$";exports.caret=caret;exports.caretTrim=caretTrim;exports.comparator=comparator;exports.comparatorTrim=comparatorTrim;exports.gte0=gte0;exports.hyphenRange=hyphenRange;exports.star=star;exports.tilde=tilde;exports.tildeTrim=tildeTrim;exports.xRange=xRange},508:function(__unused_webpack_module,exports,__webpack_require__){const require_utils=__webpack_require__(7383);const require_parser=__webpack_require__(7645);const require_compare=__webpack_require__(2197);function parseComparatorString(range){return require_utils.pipe(require_parser.parseCarets,require_parser.parseTildes,require_parser.parseXRanges,require_parser.parseStar)(range)}function parseRange(range){return require_utils.pipe(require_parser.parseHyphen,require_parser.parseComparatorTrim,require_parser.parseTildeTrim,require_parser.parseCaretTrim)(range.trim()).split(/\s+/).join(" ")}function satisfy(version,range){if(!version)return false;const extractedVersion=require_utils.extractComparator(version);if(!extractedVersion)return false;const[,versionOperator,,versionMajor,versionMinor,versionPatch,versionPreRelease]=extractedVersion;const versionAtom={operator:versionOperator,version:require_utils.combineVersion(versionMajor,versionMinor,versionPatch,versionPreRelease),major:versionMajor,minor:versionMinor,patch:versionPatch,preRelease:versionPreRelease?.split(".")};const orRanges=range.split("||");for(const orRange of orRanges){const trimmedOrRange=orRange.trim();if(!trimmedOrRange)return true;if("*"===trimmedOrRange||"x"===trimmedOrRange)return true;try{const parsedSubRange=parseRange(trimmedOrRange);if(!parsedSubRange.trim())return true;const parsedComparatorString=parsedSubRange.split(" ").map(rangeVersion=>parseComparatorString(rangeVersion)).join(" ");if(!parsedComparatorString.trim())return true;const comparators=parsedComparatorString.split(/\s+/).map(comparator=>require_parser.parseGTE0(comparator)).filter(Boolean);if(0===comparators.length)continue;let subRangeSatisfied=true;for(const comparator of comparators){const extractedComparator=require_utils.extractComparator(comparator);if(!extractedComparator){subRangeSatisfied=false;break}const[,rangeOperator,,rangeMajor,rangeMinor,rangePatch,rangePreRelease]=extractedComparator;if(!require_compare.compare({operator:rangeOperator,version:require_utils.combineVersion(rangeMajor,rangeMinor,rangePatch,rangePreRelease),major:rangeMajor,minor:rangeMinor,patch:rangePatch,preRelease:rangePreRelease?.split(".")},versionAtom)){subRangeSatisfied=false;break}}if(subRangeSatisfied)return true}catch(e){console.error(`[semver] Error processing range part "${trimmedOrRange}":`,e);continue}}return false}exports.satisfy=satisfy},7645:function(__unused_webpack_module,exports,__webpack_require__){const require_constants=__webpack_require__(5567);const require_utils=__webpack_require__(7383);function parseHyphen(range){return range.replace(require_utils.parseRegex(require_constants.hyphenRange),(_range,from,fromMajor,fromMinor,fromPatch,_fromPreRelease,_fromBuild,to,toMajor,toMinor,toPatch,toPreRelease)=>{from=require_utils.isXVersion(fromMajor)?"":require_utils.isXVersion(fromMinor)?`>=${fromMajor}.0.0`:require_utils.isXVersion(fromPatch)?`>=${fromMajor}.${fromMinor}.0`:`>=${from}`;to=require_utils.isXVersion(toMajor)?"":require_utils.isXVersion(toMinor)?`<${Number(toMajor)+1}.0.0-0`:require_utils.isXVersion(toPatch)?`<${toMajor}.${Number(toMinor)+1}.0-0`:toPreRelease?`<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`:`<=${to}`;return`${from} ${to}`.trim()})}function parseComparatorTrim(range){return range.replace(require_utils.parseRegex(require_constants.comparatorTrim),"$1$2$3")}function parseTildeTrim(range){return range.replace(require_utils.parseRegex(require_constants.tildeTrim),"$1~")}function parseCaretTrim(range){return range.replace(require_utils.parseRegex(require_constants.caretTrim),"$1^")}function parseCarets(range){return range.trim().split(/\s+/).map(rangeVersion=>rangeVersion.replace(require_utils.parseRegex(require_constants.caret),(_,major,minor,patch,preRelease)=>{if(require_utils.isXVersion(major))return"";if(require_utils.isXVersion(minor))return`>=${major}.0.0 <${Number(major)+1}.0.0-0`;if(require_utils.isXVersion(patch))if("0"===major)return`>=${major}.${minor}.0 <${major}.${Number(minor)+1}.0-0`;else return`>=${major}.${minor}.0 <${Number(major)+1}.0.0-0`;if(preRelease)if("0"!==major)return`>=${major}.${minor}.${patch}-${preRelease} <${Number(major)+1}.0.0-0`;else if("0"===minor)return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${minor}.${Number(patch)+1}-0`;else return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor)+1}.0-0`;if("0"===major)if("0"===minor)return`>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch)+1}-0`;else return`>=${major}.${minor}.${patch} <${major}.${Number(minor)+1}.0-0`;return`>=${major}.${minor}.${patch} <${Number(major)+1}.0.0-0`})).join(" ")}function parseTildes(range){return range.trim().split(/\s+/).map(rangeVersion=>rangeVersion.replace(require_utils.parseRegex(require_constants.tilde),(_,major,minor,patch,preRelease)=>{if(require_utils.isXVersion(major))return"";if(require_utils.isXVersion(minor))return`>=${major}.0.0 <${Number(major)+1}.0.0-0`;if(require_utils.isXVersion(patch))return`>=${major}.${minor}.0 <${major}.${Number(minor)+1}.0-0`;if(preRelease)return`>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor)+1}.0-0`;return`>=${major}.${minor}.${patch} <${major}.${Number(minor)+1}.0-0`})).join(" ")}function parseXRanges(range){return range.split(/\s+/).map(rangeVersion=>rangeVersion.trim().replace(require_utils.parseRegex(require_constants.xRange),(ret,gtlt,major,minor,patch,preRelease)=>{const isXMajor=require_utils.isXVersion(major);const isXMinor=isXMajor||require_utils.isXVersion(minor);const isXPatch=isXMinor||require_utils.isXVersion(patch);if("="===gtlt&&isXPatch)gtlt="";preRelease="";if(isXMajor)if(">"===gtlt||"<"===gtlt)return"<0.0.0-0";else return"*";if(gtlt&&isXPatch){if(isXMinor)minor=0;patch=0;if(">"===gtlt){gtlt=">=";if(isXMinor){major=Number(major)+1;minor=0;patch=0}else{minor=Number(minor)+1;patch=0}}else if("<="===gtlt){gtlt="<";if(isXMinor)major=Number(major)+1;else minor=Number(minor)+1}if("<"===gtlt)preRelease="-0";return`${gtlt+major}.${minor}.${patch}${preRelease}`}if(isXMinor)return`>=${major}.0.0${preRelease} <${Number(major)+1}.0.0-0`;if(isXPatch)return`>=${major}.${minor}.0${preRelease} <${major}.${Number(minor)+1}.0-0`;return ret})).join(" ")}function parseStar(range){return range.trim().replace(require_utils.parseRegex(require_constants.star),"")}function parseGTE0(comparatorString){return comparatorString.trim().replace(require_utils.parseRegex(require_constants.gte0),"")}exports.parseCaretTrim=parseCaretTrim;exports.parseCarets=parseCarets;exports.parseComparatorTrim=parseComparatorTrim;exports.parseGTE0=parseGTE0;exports.parseHyphen=parseHyphen;exports.parseStar=parseStar;exports.parseTildeTrim=parseTildeTrim;exports.parseTildes=parseTildes;exports.parseXRanges=parseXRanges},7383:function(__unused_webpack_module,exports,__webpack_require__){const require_constants=__webpack_require__(5567);function parseRegex(source){return new RegExp(source)}function isXVersion(version){return!version||"x"===version.toLowerCase()||"*"===version}function pipe(...fns){return x=>fns.reduce((v1,f)=>f(v1),x)}function extractComparator(comparatorString){return comparatorString.match(parseRegex(require_constants.comparator))}function combineVersion(major,minor,patch,preRelease){const mainVersion=`${major}.${minor}.${patch}`;if(preRelease)return`${mainVersion}-${preRelease}`;return mainVersion}exports.combineVersion=combineVersion;exports.extractComparator=extractComparator;exports.isXVersion=isXVersion;exports.parseRegex=parseRegex;exports.pipe=pipe},9774:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);const require_tool=__webpack_require__(8607);const require_global=__webpack_require__(7922);const require_constant=__webpack_require__(1319);const require_index=__webpack_require__(508);let _module_federation_sdk=__webpack_require__(1487);function formatShare(shareArgs,from,name,shareStrategy){let get;get="get"in shareArgs?shareArgs.get:"lib"in shareArgs?()=>Promise.resolve(shareArgs.lib):()=>Promise.resolve(()=>{require_logger.error(`Cannot get shared "${name}" from "${from}": neither "get" nor "lib" is provided in the share config.`)});if(shareArgs.shareConfig?.eager&&shareArgs.treeShaking?.mode)require_logger.error(`Invalid shared config for "${name}" from "${from}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`);return{deps:[],useIn:[],from,loading:null,...shareArgs,shareConfig:{requiredVersion:`^${shareArgs.version}`,singleton:false,eager:false,strictVersion:false,...shareArgs.shareConfig},get,loaded:shareArgs?.loaded||"lib"in shareArgs?true:void 0,version:shareArgs.version??"0",scope:Array.isArray(shareArgs.scope)?shareArgs.scope:[shareArgs.scope??"default"],strategy:(shareArgs.strategy??shareStrategy)||"version-first",treeShaking:shareArgs.treeShaking?{...shareArgs.treeShaking,mode:shareArgs.treeShaking.mode??"server-calc",status:shareArgs.treeShaking.status??_module_federation_sdk.TreeShakingStatus.UNKNOWN,useIn:[]}:void 0}}function formatShareConfigs(prevOptions,newOptions){const shareArgs=newOptions.shared||{};const from=newOptions.name;const newShareInfos=Object.keys(shareArgs).reduce((res,pkgName)=>{const arrayShareArgs=require_tool.arrayOptions(shareArgs[pkgName]);res[pkgName]=res[pkgName]||[];arrayShareArgs.forEach(shareConfig=>{res[pkgName].push(formatShare(shareConfig,from,pkgName,newOptions.shareStrategy))});return res},{});const allShareInfos={...prevOptions.shared};Object.keys(newShareInfos).forEach(shareKey=>{if(allShareInfos[shareKey])newShareInfos[shareKey].forEach(newUserSharedOptions=>{if(!allShareInfos[shareKey].find(sharedVal=>sharedVal.version===newUserSharedOptions.version))allShareInfos[shareKey].push(newUserSharedOptions)});else allShareInfos[shareKey]=newShareInfos[shareKey]});return{allShareInfos,newShareInfos}}function shouldUseTreeShaking(treeShaking,usedExports){if(!treeShaking)return false;const{status,mode}=treeShaking;if(status===_module_federation_sdk.TreeShakingStatus.NO_USE)return false;if(status===_module_federation_sdk.TreeShakingStatus.CALCULATED)return true;if("runtime-infer"===mode){if(!usedExports)return true;return isMatchUsedExports(treeShaking,usedExports)}return false}function versionLt(a,b){const transformInvalidVersion=version=>{if(!Number.isNaN(Number(version))){const splitArr=version.split(".");let validVersion=version;for(let i=0;i<3-splitArr.length;i++)validVersion+=".0";return validVersion}return version};if(require_index.satisfy(transformInvalidVersion(a),`<=${transformInvalidVersion(b)}`))return true;return false}const findVersion=(shareVersionMap,cb)=>{const callback=cb||function(prev,cur){return versionLt(prev,cur)};return Object.keys(shareVersionMap).reduce((prev,cur)=>{if(!prev)return cur;if(callback(prev,cur))return cur;if("0"===prev)return cur;return prev},0)};const isLoaded=shared=>Boolean(shared.loaded)||"function"==typeof shared.lib;const isLoading=shared=>Boolean(shared.loading);const isMatchUsedExports=(treeShaking,usedExports)=>{if(!treeShaking||!usedExports)return false;const{usedExports:treeShakingUsedExports}=treeShaking;if(!treeShakingUsedExports)return false;if(usedExports.every(e=>treeShakingUsedExports.includes(e)))return true;return false};function findSingletonVersionOrderByVersion(shareScopeMap,scope,pkgName,treeShaking){const versions=shareScopeMap[scope][pkgName];let version="";let useTreesShaking=shouldUseTreeShaking(treeShaking);const callback=function(prev,cur){if(useTreesShaking){if(!versions[prev].treeShaking)return true;if(!versions[cur].treeShaking)return false;return!isLoaded(versions[prev].treeShaking)&&versionLt(prev,cur)}return!isLoaded(versions[prev])&&versionLt(prev,cur)};if(useTreesShaking){version=findVersion(shareScopeMap[scope][pkgName],callback);if(version)return{version,useTreesShaking};useTreesShaking=false}return{version:findVersion(shareScopeMap[scope][pkgName],callback),useTreesShaking}}const isLoadingOrLoaded=shared=>isLoaded(shared)||isLoading(shared);function findSingletonVersionOrderByLoaded(shareScopeMap,scope,pkgName,treeShaking){const versions=shareScopeMap[scope][pkgName];let version="";let useTreesShaking=shouldUseTreeShaking(treeShaking);const callback=function(prev,cur){if(useTreesShaking){if(!versions[prev].treeShaking)return true;if(!versions[cur].treeShaking)return false;if(isLoadingOrLoaded(versions[cur].treeShaking))if(isLoadingOrLoaded(versions[prev].treeShaking))return Boolean(versionLt(prev,cur));else return true;if(isLoadingOrLoaded(versions[prev].treeShaking))return false}if(isLoadingOrLoaded(versions[cur]))if(isLoadingOrLoaded(versions[prev]))return Boolean(versionLt(prev,cur));else return true;if(isLoadingOrLoaded(versions[prev]))return false;return versionLt(prev,cur)};if(useTreesShaking){version=findVersion(shareScopeMap[scope][pkgName],callback);if(version)return{version,useTreesShaking};useTreesShaking=false}return{version:findVersion(shareScopeMap[scope][pkgName],callback),useTreesShaking}}function getFindShareFunction(strategy){if("loaded-first"===strategy)return findSingletonVersionOrderByLoaded;return findSingletonVersionOrderByVersion}function getRegisteredShare(localShareScopeMap,pkgName,shareInfo,resolveShare){if(!localShareScopeMap)return;const{shareConfig,scope=require_constant.DEFAULT_SCOPE,strategy,treeShaking}=shareInfo;const scopes=Array.isArray(scope)?scope:[scope];for(const sc of scopes)if(shareConfig&&localShareScopeMap[sc]&&localShareScopeMap[sc][pkgName]){const{requiredVersion}=shareConfig;const{version:maxOrSingletonVersion,useTreesShaking}=getFindShareFunction(strategy)(localShareScopeMap,sc,pkgName,treeShaking);const defaultResolver=()=>{const shared=localShareScopeMap[sc][pkgName][maxOrSingletonVersion];if(shareConfig.singleton){if("string"==typeof requiredVersion&&!require_index.satisfy(maxOrSingletonVersion,requiredVersion)){const msg=`Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion&&shared.from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;if(shareConfig.strictVersion)require_logger.error(msg);else require_logger.warn(msg)}return{shared,useTreesShaking}}{if(false===requiredVersion||"*"===requiredVersion)return{shared,useTreesShaking};if(require_index.satisfy(maxOrSingletonVersion,requiredVersion))return{shared,useTreesShaking};const _usedTreeShaking=shouldUseTreeShaking(treeShaking);if(_usedTreeShaking){for(const[versionKey,versionValue]of Object.entries(localShareScopeMap[sc][pkgName]))if(shouldUseTreeShaking(versionValue.treeShaking,treeShaking?.usedExports)){if(require_index.satisfy(versionKey,requiredVersion))return{shared:versionValue,useTreesShaking:_usedTreeShaking}}}for(const[versionKey,versionValue]of Object.entries(localShareScopeMap[sc][pkgName]))if(require_index.satisfy(versionKey,requiredVersion))return{shared:versionValue,useTreesShaking:false}}};const params={shareScopeMap:localShareScopeMap,scope:sc,pkgName,version:maxOrSingletonVersion,GlobalFederation:require_global.Global.__FEDERATION__,shareInfo,resolver:defaultResolver};return(resolveShare.emit(params)||params).resolver()}}function getGlobalShareScope(){return require_global.Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(options){const{pkgName,extraOptions,shareInfos}=options;const defaultResolver=sharedOptions=>{if(!sharedOptions)return;const shareVersionMap={};sharedOptions.forEach(shared=>{shareVersionMap[shared.version]=shared});const callback=function(prev,cur){return!isLoaded(shareVersionMap[prev])&&versionLt(prev,cur)};return shareVersionMap[findVersion(shareVersionMap,callback)]};const resolver=extraOptions?.resolver??defaultResolver;const isPlainObject=val=>null!==val&&"object"==typeof val&&!Array.isArray(val);const merge=(...sources)=>{const out={};for(const src of sources)if(src)for(const[key,value1]of Object.entries(src)){const prev=out[key];if(isPlainObject(prev)&&isPlainObject(value1))out[key]=merge(prev,value1);else if(void 0!==value1)out[key]=value1}return out};return merge(resolver(shareInfos[pkgName]),extraOptions?.customShareInfo)}const addUseIn=(shared,from)=>{if(!shared.useIn)shared.useIn=[];require_tool.addUniqueItem(shared.useIn,from)};function directShare(shared,useTreesShaking){if(useTreesShaking&&shared.treeShaking)return shared.treeShaking;return shared}exports.addUseIn=addUseIn;exports.directShare=directShare;exports.formatShareConfigs=formatShareConfigs;exports.getGlobalShareScope=getGlobalShareScope;exports.getRegisteredShare=getRegisteredShare;exports.getTargetSharedOptions=getTargetSharedOptions;exports.shouldUseTreeShaking=shouldUseTreeShaking},8607:function(__unused_webpack_module,exports,__webpack_require__){const require_logger=__webpack_require__(7657);let _module_federation_sdk=__webpack_require__(1487);function addUniqueItem(arr,item){if(-1===arr.findIndex(name=>name===item))arr.push(item);return arr}function getFMId(remoteInfo){if("version"in remoteInfo&&remoteInfo.version)return`${remoteInfo.name}:${remoteInfo.version}`;if("entry"in remoteInfo&&remoteInfo.entry)return`${remoteInfo.name}:${remoteInfo.entry}`;return`${remoteInfo.name}`}function isRemoteInfoWithEntry(remote){return void 0!==remote.entry}function isPureRemoteEntry(remote){return!remote.entry.includes(".json")}async function safeWrapper(callback,disableWarn){try{return await callback()}catch(e){disableWarn||require_logger.warn(e);return}}function isObject(val){return val&&"object"==typeof val}const objectToString=Object.prototype.toString;function isPlainObject(val){return"[object Object]"===objectToString.call(val)}function isStaticResourcesEqual(url1,url2){const REG_EXP=/^(https?:)?\/\//i;return url1.replace(REG_EXP,"").replace(/\/$/,"")===url2.replace(REG_EXP,"").replace(/\/$/,"")}function arrayOptions(options){return Array.isArray(options)?options:[options]}function getRemoteEntryInfoFromSnapshot(snapshot){const defaultRemoteEntryInfo={url:"",type:"global",globalName:""};if(_module_federation_sdk.isBrowserEnvValue||(0,_module_federation_sdk.isReactNativeEnv)()||!("ssrRemoteEntry"in snapshot))return"remoteEntry"in snapshot?{url:snapshot.remoteEntry,type:snapshot.remoteEntryType,globalName:snapshot.globalName}:defaultRemoteEntryInfo;if("ssrRemoteEntry"in snapshot)return{url:snapshot.ssrRemoteEntry||defaultRemoteEntryInfo.url,type:snapshot.ssrRemoteEntryType||defaultRemoteEntryInfo.type,globalName:snapshot.globalName};return defaultRemoteEntryInfo}const processModuleAlias=(name,subPath)=>{let moduleName;moduleName=name.endsWith("/")?name.slice(0,-1):name;if(subPath.startsWith("."))subPath=subPath.slice(1);moduleName+=subPath;return moduleName};exports.addUniqueItem=addUniqueItem;exports.arrayOptions=arrayOptions;exports.getFMId=getFMId;exports.getRemoteEntryInfoFromSnapshot=getRemoteEntryInfoFromSnapshot;exports.isObject=isObject;exports.isPlainObject=isPlainObject;exports.isPureRemoteEntry=isPureRemoteEntry;exports.isRemoteInfoWithEntry=isRemoteInfoWithEntry;exports.isStaticResourcesEqual=isStaticResourcesEqual;exports.objectToString=objectToString;exports.processModuleAlias=processModuleAlias;exports.safeWrapper=safeWrapper},8643:function(__unused_webpack_module,exports){var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(var keys=__getOwnPropNames(from),i=0,n=keys.length,key;i<n;i++){key=keys[i];if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:(k=>from[k]).bind(null,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp(target,"default",{value:mod,enumerable:true}),mod));exports.__toESM=__toESM},2600:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperties(exports,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}});__webpack_require__(8643);const require_utils=__webpack_require__(2040);let _module_federation_runtime_core=__webpack_require__(5929);const global1={..._module_federation_runtime_core.helpers.global,getGlobalFederationInstance:require_utils.getGlobalFederationInstance};const share=_module_federation_runtime_core.helpers.share;const utils=_module_federation_runtime_core.helpers.utils;const runtimeHelpers={global:global1,share,utils};exports["default"]=runtimeHelpers;exports.global=global1;exports.share=share;exports.utils=utils},1695:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});__webpack_require__(8643);const require_utils=__webpack_require__(2040);let _module_federation_runtime_core=__webpack_require__(5929);let _module_federation_error_codes=__webpack_require__(7110);function createInstance(options){const instance=new((0,_module_federation_runtime_core.getGlobalFederationConstructor)()||_module_federation_runtime_core.ModuleFederation)({id:`${options.name}@${options.version||Date.now()}`,...options});(0,_module_federation_runtime_core.setGlobalFederationInstance)(instance);return instance}let FederationInstance=null;function init(options){const instance=require_utils.getGlobalFederationInstance(options.name,options.version);const normalizedOptions={...options,id:options.id||""};if(instance){instance.initOptions(normalizedOptions);if(!FederationInstance)FederationInstance=instance;return instance}FederationInstance=createInstance(normalizedOptions);return FederationInstance}function loadRemote(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadRemote.apply(FederationInstance,args)}function loadShare(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadShare.apply(FederationInstance,args)}function loadShareSync(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.loadShareSync.apply(FederationInstance,args)}function preloadRemote(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.preloadRemote.apply(FederationInstance,args)}function registerRemotes(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerRemotes.apply(FederationInstance,args)}function registerPlugins(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerPlugins.apply(FederationInstance,args)}function getInstance(finder){if(!finder)return FederationInstance;return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(finder)||null}function registerShared(...args){(0,_module_federation_runtime_core.assert)(FederationInstance,_module_federation_error_codes.RUNTIME_009,_module_federation_error_codes.runtimeDescMap);return FederationInstance.registerShared.apply(FederationInstance,args)}(0,_module_federation_runtime_core.setGlobalFederationConstructor)(_module_federation_runtime_core.ModuleFederation);Object.defineProperty(exports,"Module",{enumerable:true,get:function(){return _module_federation_runtime_core.Module}});exports.ModuleFederation=_module_federation_runtime_core.ModuleFederation;exports.createInstance=createInstance;exports.getInstance=getInstance;Object.defineProperty(exports,"getRemoteEntry",{enumerable:true,get:function(){return _module_federation_runtime_core.getRemoteEntry}});Object.defineProperty(exports,"getRemoteInfo",{enumerable:true,get:function(){return _module_federation_runtime_core.getRemoteInfo}});exports.init=init;exports.loadRemote=loadRemote;Object.defineProperty(exports,"loadScript",{enumerable:true,get:function(){return _module_federation_runtime_core.loadScript}});Object.defineProperty(exports,"loadScriptNode",{enumerable:true,get:function(){return _module_federation_runtime_core.loadScriptNode}});exports.loadShare=loadShare;exports.loadShareSync=loadShareSync;exports.preloadRemote=preloadRemote;Object.defineProperty(exports,"registerGlobalPlugins",{enumerable:true,get:function(){return _module_federation_runtime_core.registerGlobalPlugins}});exports.registerPlugins=registerPlugins;exports.registerRemotes=registerRemotes;exports.registerShared=registerShared},2040:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(8643);let _module_federation_runtime_core=__webpack_require__(5929);function getBuilderId(){return"mf_playground:0.0.4"}function getGlobalFederationInstance(name,version){const buildId=getBuilderId();return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(GMInstance=>{if(buildId&&GMInstance.options.id===buildId)return true;if(GMInstance.options.name===name&&!GMInstance.options.version&&!version)return true;if(GMInstance.options.name===name&&version&&GMInstance.options.version===version)return true;return false})}exports.getGlobalFederationInstance=getGlobalFederationInstance},3075:function(__unused_webpack_module,exports){var __defProp=Object.defineProperty;var __exportAll=(all,no_symbols)=>{let target={};for(var name in all)__defProp(target,name,{get:all[name],enumerable:true});if(!no_symbols)__defProp(target,Symbol.toStringTag,{value:"Module"});return target};exports.__exportAll=__exportAll},8609:function(__unused_webpack_module,exports){const FederationModuleManifest="federation-manifest.json";const MANIFEST_EXT=".json";const BROWSER_LOG_KEY="FEDERATION_DEBUG";const NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"};const NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"};const EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH};const SEPARATOR=":";const ManifestFileName="mf-manifest.json";const StatsFileName="mf-stats.json";const MFModuleType={NPM:"npm",APP:"app"};const MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__";const ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX";const TEMP_DIR=".federation";let TreeShakingStatus=/* @__PURE__ */function(TreeShakingStatus){TreeShakingStatus[TreeShakingStatus["UNKNOWN"]=1]="UNKNOWN";TreeShakingStatus[TreeShakingStatus["CALCULATED"]=2]="CALCULATED";TreeShakingStatus[TreeShakingStatus["NO_USE"]=0]="NO_USE";return TreeShakingStatus}({});exports.BROWSER_LOG_KEY=BROWSER_LOG_KEY;exports.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX;exports.EncodedNameTransformMap=EncodedNameTransformMap;exports.FederationModuleManifest=FederationModuleManifest;exports.MANIFEST_EXT=MANIFEST_EXT;exports.MFModuleType=MFModuleType;exports.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER;exports.ManifestFileName=ManifestFileName;exports.NameTransformMap=NameTransformMap;exports.NameTransformSymbol=NameTransformSymbol;exports.SEPARATOR=SEPARATOR;exports.StatsFileName=StatsFileName;exports.TEMP_DIR=TEMP_DIR;exports.TreeShakingStatus=TreeShakingStatus},348:function(__unused_webpack_module,exports){const createModuleFederationConfig=options=>options;exports.createModuleFederationConfig=createModuleFederationConfig},8351:function(__unused_webpack_module,exports,__webpack_require__){const require_utils=__webpack_require__(5080);async function safeWrapper(callback,disableWarn){try{return await callback()}catch(e){disableWarn||require_utils.warn(e);return}}function isStaticResourcesEqual(url1,url2){const REG_EXP=/^(https?:)?\/\//i;return url1.replace(REG_EXP,"").replace(/\/$/,"")===url2.replace(REG_EXP,"").replace(/\/$/,"")}function createScript(info){let script=null;let needAttach=true;let timeout=2e4;let timeoutId;const scripts=document.getElementsByTagName("script");for(let i=0;i<scripts.length;i++){const s=scripts[i];const scriptSrc=s.getAttribute("src");if(scriptSrc&&isStaticResourcesEqual(scriptSrc,info.url)){script=s;needAttach=false;break}}if(!script){const attrs=info.attrs;script=document.createElement("script");script.type=attrs?.["type"]==="module"?"module":"text/javascript";let createScriptRes;if(info.createScriptHook){createScriptRes=info.createScriptHook(info.url,info.attrs);if(createScriptRes instanceof HTMLScriptElement)script=createScriptRes;else if("object"==typeof createScriptRes){if("script"in createScriptRes&&createScriptRes.script)script=createScriptRes.script;if("timeout"in createScriptRes&&createScriptRes.timeout)timeout=createScriptRes.timeout}}if(!script.src)script.src=info.url;if(attrs&&!createScriptRes)Object.keys(attrs).forEach(name=>{if(script){if("async"===name||"defer"===name)script[name]=attrs[name];else if(!script.getAttribute(name))script.setAttribute(name,attrs[name])}})}let executionError=null;const executionErrorHandler="undefined"!=typeof window?evt=>{if(evt.filename&&isStaticResourcesEqual(evt.filename,info.url)){const err=/* @__PURE__ */new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);err.name="ScriptExecutionError";executionError=err}}:null;if(executionErrorHandler)window.addEventListener("error",executionErrorHandler);const onScriptComplete=async(prev,event)=>{clearTimeout(timeoutId);if(executionErrorHandler)window.removeEventListener("error",executionErrorHandler);const onScriptCompleteCallback=()=>{if(event?.type==="error"){const networkError=/* @__PURE__ */new Error(event?.isTimeout?`ScriptNetworkError: Script "${info.url}" timed out.`:`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);networkError.name="ScriptNetworkError";info?.onErrorCallback&&info?.onErrorCallback(networkError)}else if(executionError)info?.onErrorCallback&&info?.onErrorCallback(executionError);else info?.cb&&info?.cb()};if(script){script.onerror=null;script.onload=null;safeWrapper(()=>{const{needDeleteScript=true}=info;if(needDeleteScript)script?.parentNode&&script.parentNode.removeChild(script)});if(prev&&"function"==typeof prev){const result=prev(event);if(result instanceof Promise){const res=await result;onScriptCompleteCallback();return res}onScriptCompleteCallback();return result}}onScriptCompleteCallback()};script.onerror=onScriptComplete.bind(null,script.onerror);script.onload=onScriptComplete.bind(null,script.onload);timeoutId=setTimeout(()=>{onScriptComplete(null,{type:"error",isTimeout:true})},timeout);return{script,needAttach}}function createLink(info){let link=null;let needAttach=true;let timeout=2e4;let timeoutId;const links=document.getElementsByTagName("link");for(let i=0;i<links.length;i++){const l=links[i];const linkHref=l.getAttribute("href");const linkRel=l.getAttribute("rel");if(linkHref&&isStaticResourcesEqual(linkHref,info.url)&&linkRel===info.attrs["rel"]){link=l;needAttach=false;break}}if(!link){link=document.createElement("link");link.setAttribute("href",info.url);let createLinkRes;let shouldApplyAttrs=true;const attrs=info.attrs;if(info.createLinkHook){createLinkRes=info.createLinkHook(info.url,attrs);if(createLinkRes instanceof HTMLLinkElement){link=createLinkRes;shouldApplyAttrs=false}else if("object"==typeof createLinkRes){if("link"in createLinkRes&&createLinkRes.link){link=createLinkRes.link;shouldApplyAttrs=false}if("timeout"in createLinkRes&&createLinkRes.timeout)timeout=createLinkRes.timeout}}if(attrs&&shouldApplyAttrs)Object.keys(attrs).forEach(name=>{if(link&&!link.getAttribute(name))link.setAttribute(name,attrs[name])})}if(!needAttach){Promise.resolve().then(()=>{info?.cb&&info?.cb()});return{link,needAttach}}const onLinkComplete=(prev,event)=>{if(timeoutId)clearTimeout(timeoutId);const onLinkCompleteCallback=()=>{if(event?.type==="error"){const linkError=/* @__PURE__ */new Error(event?.isTimeout?`LinkNetworkError: Link "${info.url}" timed out.`:`LinkNetworkError: Failed to load link "${info.url}" - the URL is unreachable or the server returned an error.`);linkError.name="LinkNetworkError";info?.onErrorCallback&&info?.onErrorCallback(linkError)}else info?.cb&&info?.cb()};if(link){link.onerror=null;link.onload=null;safeWrapper(()=>{const{needDeleteLink=true}=info;if(needDeleteLink)link?.parentNode&&link.parentNode.removeChild(link)});if(prev){const res=prev(event);onLinkCompleteCallback();return res}}onLinkCompleteCallback()};link.onerror=onLinkComplete.bind(null,link.onerror);link.onload=onLinkComplete.bind(null,link.onload);timeoutId=setTimeout(()=>{onLinkComplete(null,{type:"error",isTimeout:true})},timeout);return{link,needAttach}}function loadScript(url,info){const{attrs={},createScriptHook}=info;return new Promise((resolve,reject)=>{const{script,needAttach}=createScript({url,cb:resolve,onErrorCallback:reject,attrs:{fetchpriority:"high",...attrs},createScriptHook,needDeleteScript:true});needAttach&&document.head.appendChild(script)})}exports.createLink=createLink;exports.createScript=createScript;exports.isStaticResourcesEqual=isStaticResourcesEqual;exports.loadScript=loadScript;exports.safeWrapper=safeWrapper},7454:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const isBrowserEnvValue="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function isBrowserEnv(){return isBrowserEnvValue}function isReactNativeEnv(){return"undefined"!=typeof navigator&&navigator?.product==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return Boolean(localStorage.getItem(require_constant.BROWSER_LOG_KEY))}catch(error){}return false}function isDebugMode(){if("undefined"!=typeof process&&process.env&&process.env["FEDERATION_DEBUG"])return Boolean(process.env["FEDERATION_DEBUG"]);if("undefined"!=typeof FEDERATION_DEBUG&&Boolean(FEDERATION_DEBUG))return true;return isBrowserDebug()}const getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}};exports.getProcessEnv=getProcessEnv;exports.isBrowserEnv=isBrowserEnv;exports.isBrowserEnvValue=isBrowserEnvValue;exports.isDebugMode=isDebugMode;exports.isReactNativeEnv=isReactNativeEnv},5227:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const simpleJoinRemoteEntry=(rPath,rName)=>{if(!rPath)return rName;const transformPath=str=>{if("."===str)return"";if(str.startsWith("./"))return str.replace("./","");if(str.startsWith("/")){const strWithoutSlash=str.slice(1);if(strWithoutSlash.endsWith("/"))return strWithoutSlash.slice(0,-1);return strWithoutSlash}return str};const transformedPath=transformPath(rPath);if(!transformedPath)return rName;if(transformedPath.endsWith("/"))return`${transformedPath}${rName}`;return`${transformedPath}/${rName}`};function inferAutoPublicPath(url){return url.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(manifest,options={}){const{remotes={},overrides={},version}=options;let remoteSnapshot;const getPublicPath=()=>{if(!("publicPath"in manifest.metaData))return manifest.metaData.getPublicPath;if(("auto"===manifest.metaData.publicPath||""===manifest.metaData.publicPath)&&version)return inferAutoPublicPath(version);return manifest.metaData.publicPath};const overridesKeys=Object.keys(overrides);let remotesInfo={};if(!Object.keys(remotes).length)remotesInfo=manifest.remotes?.reduce((res,next)=>{let matchedVersion;const name=next.federationContainerName;matchedVersion=overridesKeys.includes(name)?overrides[name]:"version"in next?next.version:next.entry;res[name]={matchedVersion};return res},{})||{};Object.keys(remotes).forEach(key=>remotesInfo[key]={matchedVersion:overridesKeys.includes(key)?overrides[key]:remotes[key]});const{remoteEntry:{path:remoteEntryPath,name:remoteEntryName,type:remoteEntryType},types:remoteTypes={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion},globalName,ssrRemoteEntry}=manifest.metaData;const{exposes}=manifest;let basicRemoteSnapshot={version:version?version:"",buildVersion,globalName,remoteEntry:simpleJoinRemoteEntry(remoteEntryPath,remoteEntryName),remoteEntryType,remoteTypes:simpleJoinRemoteEntry(remoteTypes.path,remoteTypes.name),remoteTypesZip:remoteTypes.zip||"",remoteTypesAPI:remoteTypes.api||"",remotesInfo,shared:manifest?.shared.map(item=>({assets:item.assets,sharedName:item.name,version:item.version,usedExports:item.referenceExports||[]})),modules:exposes?.map(expose=>({moduleName:expose.name,modulePath:expose.path,assets:expose.assets}))};if("publicPath"in manifest.metaData){remoteSnapshot={...basicRemoteSnapshot,publicPath:getPublicPath()};if("string"==typeof manifest.metaData.ssrPublicPath)remoteSnapshot.ssrPublicPath=manifest.metaData.ssrPublicPath}else remoteSnapshot={...basicRemoteSnapshot,getPublicPath:getPublicPath()};if(ssrRemoteEntry){const fullSSRRemoteEntry=simpleJoinRemoteEntry(ssrRemoteEntry.path,ssrRemoteEntry.name);remoteSnapshot.ssrRemoteEntry=fullSSRRemoteEntry;remoteSnapshot.ssrRemoteEntryType=ssrRemoteEntry.type||"commonjs-module"}return remoteSnapshot}function isManifestProvider(moduleInfo){if("remoteEntry"in moduleInfo&&moduleInfo.remoteEntry.includes(require_constant.MANIFEST_EXT))return true;return false}function getManifestFileName(manifestOptions){if(!manifestOptions)return{statsFileName:require_constant.StatsFileName,manifestFileName:require_constant.ManifestFileName};let filePath="boolean"==typeof manifestOptions?"":manifestOptions.filePath||"";let fileName="boolean"==typeof manifestOptions?"":manifestOptions.fileName||"";const JSON_EXT=".json";const addExt=name=>{if(name.endsWith(JSON_EXT))return name;return`${name}${JSON_EXT}`};const insertSuffix=(name,suffix)=>name.replace(JSON_EXT,`${suffix}${JSON_EXT}`);const manifestFileName=fileName?addExt(fileName):require_constant.ManifestFileName;return{statsFileName:simpleJoinRemoteEntry(filePath,fileName?insertSuffix(manifestFileName,"-stats"):require_constant.StatsFileName),manifestFileName:simpleJoinRemoteEntry(filePath,manifestFileName)}}exports.generateSnapshotFromManifest=generateSnapshotFromManifest;exports.getManifestFileName=getManifestFileName;exports.inferAutoPublicPath=inferAutoPublicPath;exports.isManifestProvider=isManifestProvider;exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry},1487:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const require_constant=__webpack_require__(8609);const require_ContainerPlugin=__webpack_require__(5780);const require_ContainerReferencePlugin=__webpack_require__(8869);const require_ModuleFederationPlugin=__webpack_require__(8862);const require_SharePlugin=__webpack_require__(5688);const require_ConsumeSharedPlugin=__webpack_require__(1944);const require_ProvideSharedPlugin=__webpack_require__(9901);const require_env=__webpack_require__(7454);const require_utils=__webpack_require__(5080);const require_generateSnapshotFromManifest=__webpack_require__(5227);const require_logger=__webpack_require__(4501);const require_dom=__webpack_require__(8351);const require_node=__webpack_require__(8165);const require_normalizeOptions=__webpack_require__(8740);const require_createModuleFederationConfig=__webpack_require__(348);exports.BROWSER_LOG_KEY=require_constant.BROWSER_LOG_KEY;exports.ENCODE_NAME_PREFIX=require_constant.ENCODE_NAME_PREFIX;exports.EncodedNameTransformMap=require_constant.EncodedNameTransformMap;exports.FederationModuleManifest=require_constant.FederationModuleManifest;exports.MANIFEST_EXT=require_constant.MANIFEST_EXT;exports.MFModuleType=require_constant.MFModuleType;exports.MODULE_DEVTOOL_IDENTIFIER=require_constant.MODULE_DEVTOOL_IDENTIFIER;exports.ManifestFileName=require_constant.ManifestFileName;exports.NameTransformMap=require_constant.NameTransformMap;exports.NameTransformSymbol=require_constant.NameTransformSymbol;exports.SEPARATOR=require_constant.SEPARATOR;exports.StatsFileName=require_constant.StatsFileName;exports.TEMP_DIR=require_constant.TEMP_DIR;exports.TreeShakingStatus=require_constant.TreeShakingStatus;exports.assert=require_utils.assert;exports.bindLoggerToCompiler=require_logger.bindLoggerToCompiler;exports.composeKeyWithSeparator=require_utils.composeKeyWithSeparator;Object.defineProperty(exports,"consumeSharedPlugin",{enumerable:true,get:function(){return require_ConsumeSharedPlugin.ConsumeSharedPlugin_exports}});Object.defineProperty(exports,"containerPlugin",{enumerable:true,get:function(){return require_ContainerPlugin.ContainerPlugin_exports}});Object.defineProperty(exports,"containerReferencePlugin",{enumerable:true,get:function(){return require_ContainerReferencePlugin.ContainerReferencePlugin_exports}});exports.createInfrastructureLogger=require_logger.createInfrastructureLogger;exports.createLink=require_dom.createLink;exports.createLogger=require_logger.createLogger;exports.createModuleFederationConfig=require_createModuleFederationConfig.createModuleFederationConfig;exports.createScript=require_dom.createScript;exports.createScriptNode=require_node.createScriptNode;exports.decodeName=require_utils.decodeName;exports.encodeName=require_utils.encodeName;exports.error=require_utils.error;exports.generateExposeFilename=require_utils.generateExposeFilename;exports.generateShareFilename=require_utils.generateShareFilename;exports.generateSnapshotFromManifest=require_generateSnapshotFromManifest.generateSnapshotFromManifest;exports.getManifestFileName=require_generateSnapshotFromManifest.getManifestFileName;exports.getProcessEnv=require_env.getProcessEnv;exports.getResourceUrl=require_utils.getResourceUrl;exports.inferAutoPublicPath=require_generateSnapshotFromManifest.inferAutoPublicPath;exports.infrastructureLogger=require_logger.infrastructureLogger;exports.isBrowserEnv=require_env.isBrowserEnv;exports.isBrowserEnvValue=require_env.isBrowserEnvValue;exports.isDebugMode=require_env.isDebugMode;exports.isManifestProvider=require_generateSnapshotFromManifest.isManifestProvider;exports.isReactNativeEnv=require_env.isReactNativeEnv;exports.isRequiredVersion=require_utils.isRequiredVersion;exports.isStaticResourcesEqual=require_dom.isStaticResourcesEqual;exports.loadScript=require_dom.loadScript;exports.loadScriptNode=require_node.loadScriptNode;exports.logger=require_logger.logger;Object.defineProperty(exports,"moduleFederationPlugin",{enumerable:true,get:function(){return require_ModuleFederationPlugin.ModuleFederationPlugin_exports}});exports.normalizeOptions=require_normalizeOptions.normalizeOptions;exports.parseEntry=require_utils.parseEntry;Object.defineProperty(exports,"provideSharedPlugin",{enumerable:true,get:function(){return require_ProvideSharedPlugin.ProvideSharedPlugin_exports}});exports.safeToString=require_utils.safeToString;exports.safeWrapper=require_dom.safeWrapper;Object.defineProperty(exports,"sharePlugin",{enumerable:true,get:function(){return require_SharePlugin.SharePlugin_exports}});exports.simpleJoinRemoteEntry=require_generateSnapshotFromManifest.simpleJoinRemoteEntry;exports.warn=require_utils.warn},4501:function(__unused_webpack_module,exports,__webpack_require__){const require_env=__webpack_require__(7454);const PREFIX="[ Module Federation ]";const DEFAULT_DELEGATE=console;const LOGGER_STACK_SKIP_TOKENS=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function captureStackTrace(){try{const stack=/* @__PURE__ */new Error().stack;if(!stack)return;const[,...rawLines]=stack.split("\n");const filtered=rawLines.filter(line=>!LOGGER_STACK_SKIP_TOKENS.some(token=>line.includes(token)));if(!filtered.length)return;return`Stack trace:
|
|
1086
1086
|
${filtered.slice(0,5).join("\n")}`}catch{return}}var Logger=class{constructor(prefix,delegate=DEFAULT_DELEGATE){this.prefix=prefix;this.delegate=delegate??DEFAULT_DELEGATE}setPrefix(prefix){this.prefix=prefix}setDelegate(delegate){this.delegate=delegate??DEFAULT_DELEGATE}emit(method,args){const delegate=this.delegate;const stackTrace=require_env.isDebugMode()?captureStackTrace():void 0;const enrichedArgs=stackTrace?[...args,stackTrace]:args;const order=(()=>{switch(method){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 candidate of order){const handler=delegate[candidate];if("function"==typeof handler)return void handler.call(delegate,this.prefix,...enrichedArgs)}for(const candidate of order){const handler=DEFAULT_DELEGATE[candidate];if("function"==typeof handler)return void handler.call(DEFAULT_DELEGATE,this.prefix,...enrichedArgs)}}log(...args){this.emit("log",args)}warn(...args){this.emit("warn",args)}error(...args){this.emit("error",args)}success(...args){this.emit("info",args)}info(...args){this.emit("info",args)}ready(...args){this.emit("info",args)}debug(...args){if(require_env.isDebugMode())this.emit("debug",args)}};function createLogger(prefix){return new Logger(prefix)}function createInfrastructureLogger(prefix){const infrastructureLogger=new Logger(prefix);Object.defineProperty(infrastructureLogger,"__mf_infrastructure_logger__",{value:true,enumerable:false,configurable:false});return infrastructureLogger}function bindLoggerToCompiler(loggerInstance,compiler,name){if(!loggerInstance.__mf_infrastructure_logger__)return;if(!compiler?.getInfrastructureLogger)return;try{const infrastructureLogger=compiler.getInfrastructureLogger(name);if(infrastructureLogger&&"object"==typeof infrastructureLogger&&("function"==typeof infrastructureLogger.log||"function"==typeof infrastructureLogger.info||"function"==typeof infrastructureLogger.warn||"function"==typeof infrastructureLogger.error))loggerInstance.setDelegate(infrastructureLogger)}catch{loggerInstance.setDelegate(void 0)}}const logger=createLogger(PREFIX);const infrastructureLogger=createInfrastructureLogger(PREFIX);exports.bindLoggerToCompiler=bindLoggerToCompiler;exports.createInfrastructureLogger=createInfrastructureLogger;exports.createLogger=createLogger;exports.infrastructureLogger=infrastructureLogger;exports.logger=logger},8165:function(__unused_webpack_module,exports){const sdkImportCache=/* @__PURE__ */new Map;function importNodeModule(name){if(!name)throw new Error("import specifier is required");if(sdkImportCache.has(name))return sdkImportCache.get(name);const promise=new Function("name","return import(name)")(name).then(res=>res).catch(error=>{console.error(`Error importing module ${name}:`,error);sdkImportCache.delete(name);throw error});sdkImportCache.set(name,promise);return promise}const lazyLoaderHookFetch=async(input,init,loaderHook)=>{const hook=(url,init)=>loaderHook.lifecycle.fetch.emit(url,init);const res=await hook(input,init||{});if(!res||!(res instanceof Response))return fetch(input,init||{});return res};const createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{if(loaderHook?.createScriptHook){const hookResult=loaderHook.createScriptHook(url);if(hookResult&&"object"==typeof hookResult&&"url"in hookResult)url=hookResult.url}let urlObj;try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e);cb(/* @__PURE__ */new Error(`Invalid URL: ${e}`));return}const getFetch=async()=>{if(loaderHook?.fetch)return(input,init)=>lazyLoaderHookFetch(input,init,loaderHook);return fetch};const handleScriptFetch=async(f,urlObj)=>{try{const res=await f(urlObj.href);const data=await res.text();const[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]);const scriptContext={exports:{},module:{exports:{}}};const urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/");const filename=path.basename(urlObj.pathname);const script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
1087
|
-
})`,{filename,importModuleDynamically:vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??importNodeModule});let requireFn;requireFn=eval("require");script.runInThisContext()(scriptContext.exports,scriptContext.module,requireFn,urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs["globalName"])return void cb(void 0,exportedInterface[attrs["globalName"]]||exportedInterface);cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:/* @__PURE__ */new Error(`Script execution error: ${e}`))}};getFetch().then(async f=>{if(attrs?.["type"]==="esm"||attrs?.["type"]==="module")return loadModule(urlObj.href,{fetch:f,vm:await importNodeModule("vm")}).then(async module1=>{await module1.evaluate();cb(void 0,module1.namespace)}).catch(e=>{cb(e instanceof Error?e:/* @__PURE__ */new Error(`Script execution error: ${e}`))});handleScriptFetch(f,urlObj)}).catch(err=>{cb(err)})}:(url,cb,attrs,loaderHook)=>{cb(/* @__PURE__ */new Error("createScriptNode is disabled in non-Node.js environment"))};const loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,info)=>new Promise((resolve,reject)=>{createScriptNode(url,(error,scriptContext)=>{if(error)reject(error);else{const remoteEntryKey=info?.attrs?.["globalName"]||`__FEDERATION_${info?.attrs?.["name"]}:custom__`;resolve(globalThis[remoteEntryKey]=scriptContext)}},info.attrs,info.loaderHook)}):(url,info)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};const esmModuleCache=/* @__PURE__ */new Map;const isFetchableRemoteModuleUrl=url=>url.startsWith("http:")||url.startsWith("https:");const isBareModuleSpecifier=specifier=>!specifier.startsWith("./")&&!specifier.startsWith("../")&&!specifier.startsWith("/")&&!specifier.includes(":");function encodeRemoteModulePath(url){const remoteUrl=new URL(url);const encodedProtocol=encodeURIComponent(remoteUrl.protocol.slice(0,-1));const encodedHost=encodeURIComponent(remoteUrl.host);const encodedPathname=remoteUrl.pathname.split("/").map(segment=>encodeURIComponent(segment)).join("/");const encodedSearchHash=encodeURIComponent(`${remoteUrl.search}${remoteUrl.hash}`);return`/${encodedProtocol}/${encodedHost}${encodedPathname}${encodedSearchHash?`/${encodedSearchHash}`:""}`}function createImportMetaUrl(url,baseFileUrl){const baseUrl=baseFileUrl.endsWith("/")?baseFileUrl:`${baseFileUrl}/`;return new URL(`__module_federation_remote__${encodeRemoteModulePath(url)}`,baseUrl).href}async function isNodeBuiltinSpecifier(specifier){if(specifier.startsWith("node:"))return true;if(!isBareModuleSpecifier(specifier))return false;return(await importNodeModule("node:module")).builtinModules.includes(specifier)}function getSyntheticModuleExports(moduleExports){const namespaceObject=moduleExports&&("object"==typeof moduleExports||"function"==typeof moduleExports)?moduleExports:{default:moduleExports};const effectiveExports={...namespaceObject};if(!Object.prototype.hasOwnProperty.call(effectiveExports,"default"))effectiveExports.default=namespaceObject;return effectiveExports}async function createSyntheticModuleFromExports(identifier,moduleExports,vm){if("function"!=typeof vm.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const effectiveExports=getSyntheticModuleExports(moduleExports);const exportNames=Object.keys(effectiveExports);const syntheticModule=new vm.SyntheticModule(exportNames,function(){for(const name of exportNames)this.setExport(name,effectiveExports[name])},{identifier});esmModuleCache.set(identifier,syntheticModule);await syntheticModule.link(async()=>{throw new Error(`Node.js built-in module "${identifier}" should not request child modules.`)});await syntheticModule.evaluate();return syntheticModule}async function loadNodeBuiltinModule(specifier,vm){const cacheKey=`node-builtin:${specifier}`;if(esmModuleCache.has(cacheKey))return esmModuleCache.get(cacheKey);return createSyntheticModuleFromExports(cacheKey,await importNodeModule(specifier),vm)}async function loadResolvedModule(specifier,parentUrl,options){if(await isNodeBuiltinSpecifier(specifier))return loadNodeBuiltinModule(specifier,options.vm);if(isBareModuleSpecifier(specifier))throw new Error(`Unsupported ESM module specifier "${specifier}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const resolvedUrl=new URL(specifier,parentUrl).href;if(!isFetchableRemoteModuleUrl(resolvedUrl))throw new Error(`Unsupported ESM module specifier "${specifier}" resolved to "${resolvedUrl}". Only http(s) remote modules and Node.js built-in modules are supported.`);return loadModule(resolvedUrl,options)}async function evaluateDynamicModule(module1){if("linked"===module1.status)await module1.evaluate();if("errored"===module1.status)throw module1.error;return module1}async function loadModule(url,options){if(esmModuleCache.has(url))return esmModuleCache.get(url);const{fetch:fetch1,vm}=options;if(!isFetchableRemoteModuleUrl(url))throw new Error(`Unsupported ESM module URL "${url}". Only http(s) remote modules and Node.js built-in modules are supported.`);const code=await (await fetch1(url)).text();const cwdFileUrl=(await importNodeModule("node:url")).pathToFileURL(process.cwd()).href;const sourceTextModule=new vm.SourceTextModule(code,{identifier:url,initializeImportMeta:meta=>{meta.url=createImportMetaUrl(url,cwdFileUrl)},importModuleDynamically:async specifier=>evaluateDynamicModule(await loadResolvedModule(specifier,url,options))});esmModuleCache.set(url,sourceTextModule);await sourceTextModule.link(async specifier=>loadResolvedModule(specifier,url,options));return sourceTextModule}exports.createScriptNode=createScriptNode;exports.loadScriptNode=loadScriptNode},8740:function(__unused_webpack_module,exports){function normalizeOptions(enableDefault,defaultOptions,key){return function(options){if(false===options)return false;if(void 0===options)if(enableDefault)return defaultOptions;else return false;if(true===options)return defaultOptions;if(options&&"object"==typeof options)return{...defaultOptions,...options};throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`)}}exports.normalizeOptions=normalizeOptions},1944:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ConsumeSharedPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ConsumeSharedPlugin_exports",{enumerable:true,get:function(){return ConsumeSharedPlugin_exports}})},5780:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ContainerPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ContainerPlugin_exports",{enumerable:true,get:function(){return ContainerPlugin_exports}})},8869:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ContainerReferencePlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ContainerReferencePlugin_exports",{enumerable:true,get:function(){return ContainerReferencePlugin_exports}})},8862:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ModuleFederationPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ModuleFederationPlugin_exports",{enumerable:true,get:function(){return ModuleFederationPlugin_exports}})},9901:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ProvideSharedPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ProvideSharedPlugin_exports",{enumerable:true,get:function(){return ProvideSharedPlugin_exports}})},5688:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var SharePlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"SharePlugin_exports",{enumerable:true,get:function(){return SharePlugin_exports}})},5080:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const require_env=__webpack_require__(7454);const LOG_CATEGORY="[ Federation Runtime ]";const parseEntry=(str,devVerOrUrl,separator=require_constant.SEPARATOR)=>{const strSplit=str.split(separator);const devVersionOrUrl="development"===require_env.getProcessEnv()["NODE_ENV"]&&devVerOrUrl;const defaultVersion="*";const isEntry=s=>s.startsWith("http")||s.includes(require_constant.MANIFEST_EXT);if(strSplit.length>=2){let[name,...versionOrEntryArr]=strSplit;if(str.startsWith(separator)){name=strSplit.slice(0,2).join(separator);versionOrEntryArr=[devVersionOrUrl||strSplit.slice(2).join(separator)]}let versionOrEntry=devVersionOrUrl||versionOrEntryArr.join(separator);if(isEntry(versionOrEntry))return{name,entry:versionOrEntry};return{name,version:versionOrEntry||defaultVersion}}if(1===strSplit.length){const[name]=strSplit;if(devVersionOrUrl&&isEntry(devVersionOrUrl))return{name,entry:devVersionOrUrl};return{name,version:devVersionOrUrl||defaultVersion}}throw`Invalid entry value: ${str}`};const composeKeyWithSeparator=function(...args){if(!args.length)return"";return args.reduce((sum,cur)=>{if(!cur)return sum;if(!sum)return cur;return`${sum}${require_constant.SEPARATOR}${cur}`},"")};const encodeName=function(name,prefix="",withExt=false){try{const ext=withExt?".js":"";return`${prefix}${name.replace(new RegExp(`${require_constant.NameTransformSymbol.AT}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]).replace(new RegExp(`${require_constant.NameTransformSymbol.HYPHEN}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]).replace(new RegExp(`${require_constant.NameTransformSymbol.SLASH}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH])}${ext}`}catch(err){throw err}};const decodeName=function(name,prefix,withExt){try{let decodedName=name;if(prefix){if(!decodedName.startsWith(prefix))return decodedName;decodedName=decodedName.replace(new RegExp(prefix,"g"),"")}decodedName=decodedName.replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]]).replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH]]).replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]]);if(withExt)decodedName=decodedName.replace(".js","");return decodedName}catch(err){throw err}};const generateExposeFilename=(exposeName,withExt)=>{if(!exposeName)return"";let expose=exposeName;if("."===expose)expose="default_export";if(expose.startsWith("./"))expose=expose.replace("./","");return encodeName(expose,"__federation_expose_",withExt)};const generateShareFilename=(pkgName,withExt)=>{if(!pkgName)return"";return encodeName(pkgName,"__federation_shared_",withExt)};const getResourceUrl=(module1,sourceUrl)=>{if("getPublicPath"in module1){let publicPath;publicPath=module1.getPublicPath.startsWith("function")?new Function("return "+module1.getPublicPath)()():new Function(module1.getPublicPath)();return`${publicPath}${sourceUrl}`}if("publicPath"in module1){if(!require_env.isBrowserEnv()&&!require_env.isReactNativeEnv()&&"ssrPublicPath"in module1&&"string"==typeof module1.ssrPublicPath)return`${module1.ssrPublicPath}${sourceUrl}`;return`${module1.publicPath}${sourceUrl}`}console.warn("Cannot get resource URL. If in debug mode, please ignore.",module1,sourceUrl);return""};const assert=(condition,msg)=>{if(!condition)error(msg)};const error=msg=>{throw new Error(`${LOG_CATEGORY}: ${msg}`)};const warn=msg=>{console.warn(`${LOG_CATEGORY}: ${msg}`)};function safeToString(info){try{return JSON.stringify(info,null,2)}catch(e){return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(str){return VERSION_PATTERN_REGEXP.test(str)}exports.assert=assert;exports.composeKeyWithSeparator=composeKeyWithSeparator;exports.decodeName=decodeName;exports.encodeName=encodeName;exports.error=error;exports.generateExposeFilename=generateExposeFilename;exports.generateShareFilename=generateShareFilename;exports.getResourceUrl=getResourceUrl;exports.isRequiredVersion=isRequiredVersion;exports.parseEntry=parseEntry;exports.safeToString=safeToString;exports.warn=warn},2604:function(__unused_webpack_module,exports){var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(var keys=__getOwnPropNames(from),i=0,n=keys.length,key;i<n;i++){key=keys[i];if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:(k=>from[k]).bind(null,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp(target,"default",{value:mod,enumerable:true}),mod));exports.__toESM=__toESM},456:function(__unused_webpack_module,exports){function attachShareScopeMap(webpackRequire){if(!webpackRequire.S||webpackRequire.federation.hasAttachShareScopeMap||!webpackRequire.federation.instance||!webpackRequire.federation.instance.shareScopeMap)return;webpackRequire.S=webpackRequire.federation.instance.shareScopeMap;webpackRequire.federation.hasAttachShareScopeMap=true}exports.attachShareScopeMap=attachShareScopeMap},390:function(__unused_webpack_module,exports){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const FEDERATION_SUPPORTED_TYPES=["script"];exports.FEDERATION_SUPPORTED_TYPES=FEDERATION_SUPPORTED_TYPES},2127:function(__unused_webpack_module,exports,__webpack_require__){const require_attachShareScopeMap=__webpack_require__(456);const require_updateOptions=__webpack_require__(9741);const require_getUsedExports=__webpack_require__(694);const require_error_codes=__webpack_require__(7982);const require_getShortErrorMsg=__webpack_require__(4324);function consumes(options){require_updateOptions.updateConsumeOptions(options);const{chunkId,promises,installedModules,webpackRequire,chunkMapping,moduleToHandlerMapping}=options;require_attachShareScopeMap.attachShareScopeMap(webpackRequire);if(webpackRequire.o(chunkMapping,chunkId))chunkMapping[chunkId].forEach(id=>{if(webpackRequire.o(installedModules,id))return promises.push(installedModules[id]);const onFactory=factory=>{installedModules[id]=0;webpackRequire.m[id]=module1=>{delete webpackRequire.c[id];const result=factory();const{shareInfo}=moduleToHandlerMapping[id];if(shareInfo?.shareConfig?.layer&&result&&"object"==typeof result)try{if(!result.hasOwnProperty("layer")||void 0===result.layer)result.layer=shareInfo.shareConfig.layer}catch(e){}module1.exports=result}};const onError=error=>{delete installedModules[id];webpackRequire.m[id]=module1=>{delete webpackRequire.c[id];throw error}};try{const federationInstance=webpackRequire.federation.instance;if(!federationInstance)throw new Error("Federation instance not found!");const{shareKey,getter,shareInfo,treeShakingGetter}=moduleToHandlerMapping[id];const usedExports=require_getUsedExports.getUsedExports(webpackRequire,shareKey);const customShareInfo={...shareInfo};if(Array.isArray(customShareInfo.scope)&&Array.isArray(customShareInfo.scope[0]))customShareInfo.scope=customShareInfo.scope[0];if(usedExports)customShareInfo.treeShaking={usedExports,useIn:[federationInstance.options.name]};const promise=federationInstance.loadShare(shareKey,{customShareInfo}).then(factory=>{if(false===factory){if("function"!=typeof getter)throw new Error(require_getShortErrorMsg.getShortErrorMsg(require_error_codes.RUNTIME_012,{[require_error_codes.RUNTIME_012]:'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.'},{shareKey}));return treeShakingGetter?.()||getter()}return factory});if(promise.then)promises.push(installedModules[id]=promise.then(onFactory).catch(onError));else onFactory(promise)}catch(e){onError(e)}})}exports.consumes=consumes},7982:function(__unused_webpack_module,exports){const RUNTIME_012="RUNTIME-012";exports.RUNTIME_012=RUNTIME_012},4324:function(__unused_webpack_module,exports){const getDocsUrl=errorCode=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;const getShortErrorMsg=(errorCode,errorDescMap,args,originalErrorMsg)=>{const msg=[`${[errorDescMap[errorCode]]} #${errorCode}`];args&&msg.push(`args: ${JSON.stringify(args)}`);msg.push(getDocsUrl(errorCode));originalErrorMsg&&msg.push(`Original Error Message:
|
|
1088
|
-
${originalErrorMsg}`);return msg.join("\n")};exports.getShortErrorMsg=getShortErrorMsg},2930:function(__unused_webpack_module,exports){const getSharedFallbackGetter=({shareKey,factory,version,webpackRequire,libraryType="global"})=>{const{runtime,instance,bundlerRuntime,sharedFallback}=webpackRequire.federation;if(!sharedFallback)return factory;const fallbackItems=sharedFallback[shareKey];if(!fallbackItems)return factory;const fallbackItem=version?fallbackItems.find(item=>item[1]===version):fallbackItems[0];if(!fallbackItem)throw new Error(`No fallback item found for shareKey: ${shareKey} and version: ${version}`);return()=>runtime.getRemoteEntry({origin:webpackRequire.federation.instance,remoteInfo:{name:fallbackItem[2],entry:`${webpackRequire.p}${fallbackItem[0]}`,type:libraryType,entryGlobalName:fallbackItem[2],shareScope:"default"}}).then(shareEntry=>{if(!shareEntry)throw new Error(`Failed to load fallback entry for shareKey: ${shareKey} and version: ${version}`);return shareEntry.init(webpackRequire.federation.instance,bundlerRuntime).then(()=>shareEntry.get())})};exports.getSharedFallbackGetter=getSharedFallbackGetter},694:function(__unused_webpack_module,exports){function getUsedExports(webpackRequire,sharedName){const usedExports=webpackRequire.federation.usedExports;if(!usedExports)return;return usedExports[sharedName]}exports.getUsedExports=getUsedExports},6874:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperties(exports,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}});const require_runtime=__webpack_require__(2604);const require_attachShareScopeMap=__webpack_require__(456);const require_remotes=__webpack_require__(3987);const require_consumes=__webpack_require__(2127);const require_initializeSharing=__webpack_require__(2796);const require_installInitialConsumes=__webpack_require__(1644);const require_initContainerEntry=__webpack_require__(6875);const require_init=__webpack_require__(9488);const require_getSharedFallbackGetter=__webpack_require__(2930);let _module_federation_runtime=__webpack_require__(1695);_module_federation_runtime=require_runtime.__toESM(_module_federation_runtime);const federation={runtime:_module_federation_runtime,instance:void 0,initOptions:void 0,bundlerRuntime:{remotes:require_remotes.remotes,consumes:require_consumes.consumes,I:require_initializeSharing.initializeSharing,S:{},installInitialConsumes:require_installInitialConsumes.installInitialConsumes,initContainerEntry:require_initContainerEntry.initContainerEntry,init:require_init.init,getSharedFallbackGetter:require_getSharedFallbackGetter.getSharedFallbackGetter},attachShareScopeMap:require_attachShareScopeMap.attachShareScopeMap,bundlerRuntimeOptions:{}};const instance=federation.instance;const initOptions=federation.initOptions;const bundlerRuntime=federation.bundlerRuntime;const bundlerRuntimeOptions=federation.bundlerRuntimeOptions;exports.attachShareScopeMap=require_attachShareScopeMap.attachShareScopeMap;exports.bundlerRuntime=bundlerRuntime;exports.bundlerRuntimeOptions=bundlerRuntimeOptions;exports["default"]=federation;exports.initOptions=initOptions;exports.instance=instance;Object.defineProperty(exports,"runtime",{enumerable:true,get:function(){return _module_federation_runtime}})},9488:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(2604);let _module_federation_runtime=__webpack_require__(1695);let _module_federation_runtime_helpers=__webpack_require__(2600);_module_federation_runtime_helpers=require_runtime.__toESM(_module_federation_runtime_helpers);function init({webpackRequire}){const{initOptions,runtime,sharedFallback,bundlerRuntime,libraryType}=webpackRequire.federation;if(!initOptions)throw new Error("initOptions is required!");const treeShakingSharePlugin=function(){return{name:"tree-shake-plugin",beforeInit(args){const{userOptions,origin,options:registeredOptions}=args;const version=userOptions.version||registeredOptions.version;if(!sharedFallback)return args;const currentShared=userOptions.shared||{};const shared=[];Object.keys(currentShared).forEach(sharedName=>{(Array.isArray(currentShared[sharedName])?currentShared[sharedName]:[currentShared[sharedName]]).forEach(sharedArg=>{shared.push([sharedName,sharedArg]);if("get"in sharedArg){sharedArg.treeShaking||={};sharedArg.treeShaking.get=sharedArg.get;sharedArg.get=bundlerRuntime.getSharedFallbackGetter({shareKey:sharedName,factory:sharedArg.get,webpackRequire,libraryType,version:sharedArg.version})}})});const hostGlobalSnapshot=_module_federation_runtime_helpers.default.global.getGlobalSnapshotInfoByModuleInfo({name:origin.name,version});if(!hostGlobalSnapshot||!("shared"in hostGlobalSnapshot))return args;Object.keys(registeredOptions.shared||{}).forEach(pkgName=>{registeredOptions.shared[pkgName].forEach(sharedArg=>{shared.push([pkgName,sharedArg])})});const patchShared=(pkgName,shared)=>{const shareSnapshot=hostGlobalSnapshot.shared.find(item=>item.sharedName===pkgName);if(!shareSnapshot)return;const{treeShaking}=shared;if(!treeShaking)return;const{secondarySharedTreeShakingName,secondarySharedTreeShakingEntry,treeShakingStatus}=shareSnapshot;if(treeShaking.status===treeShakingStatus)return;treeShaking.status=treeShakingStatus;if(secondarySharedTreeShakingEntry&&libraryType&&secondarySharedTreeShakingName)treeShaking.get=async()=>{const shareEntry=await (0,_module_federation_runtime.getRemoteEntry)({origin,remoteInfo:{name:secondarySharedTreeShakingName,entry:secondarySharedTreeShakingEntry,type:libraryType,entryGlobalName:secondarySharedTreeShakingName,shareScope:"default"}});await shareEntry.init(origin,__webpack_require__.federation.bundlerRuntime);return shareEntry.get()}};shared.forEach(([pkgName,sharedArg])=>{patchShared(pkgName,sharedArg)});return args}}};initOptions.plugins||=[];initOptions.plugins.push(treeShakingSharePlugin());return runtime.init(initOptions)}exports.init=init},6875:function(__unused_webpack_module,exports){function initContainerEntry(options){const{webpackRequire,shareScope,initScope,shareScopeKey,remoteEntryInitOptions}=options;if(!webpackRequire.S)return;if(!webpackRequire.federation||!webpackRequire.federation.instance||!webpackRequire.federation.initOptions)return;const federationInstance=webpackRequire.federation.instance;federationInstance.initOptions({name:webpackRequire.federation.initOptions.name,remotes:[],...remoteEntryInitOptions});const hostShareScopeKeys=remoteEntryInitOptions?.shareScopeKeys;const hostShareScopeMap=remoteEntryInitOptions?.shareScopeMap;if(shareScopeKey&&"string"!=typeof shareScopeKey)shareScopeKey.forEach(key=>{if(!hostShareScopeKeys||!hostShareScopeMap)return void federationInstance.initShareScopeMap(key,shareScope,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}});if(!hostShareScopeMap[key])hostShareScopeMap[key]={};const sc=hostShareScopeMap[key];federationInstance.initShareScopeMap(key,sc,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})});else{const key=shareScopeKey||"default";if(Array.isArray(hostShareScopeKeys))hostShareScopeKeys.forEach(hostKey=>{if(!hostShareScopeMap[hostKey])hostShareScopeMap[hostKey]={};const sc=hostShareScopeMap[hostKey];federationInstance.initShareScopeMap(hostKey,sc,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})});else federationInstance.initShareScopeMap(key,shareScope,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})}if(webpackRequire.federation.attachShareScopeMap)webpackRequire.federation.attachShareScopeMap(webpackRequire);if(!Array.isArray(shareScopeKey))return webpackRequire.I(shareScopeKey||"default",initScope);if(Boolean(webpackRequire.federation.initOptions.shared))return webpackRequire.I(shareScopeKey,initScope);return Promise.all(shareScopeKey.map(key=>webpackRequire.I(key,initScope))).then(()=>true)}exports.initContainerEntry=initContainerEntry},2796:function(__unused_webpack_module,exports,__webpack_require__){const require_attachShareScopeMap=__webpack_require__(456);const require_constant=__webpack_require__(390);function initializeSharing({shareScopeName,webpackRequire,initPromises,initTokens,initScope}){const shareScopeKeys=Array.isArray(shareScopeName)?shareScopeName:[shareScopeName];var initializeSharingPromises=[];var _initializeSharing=function(shareScopeKey){if(!initScope)initScope=[];const mfInstance=webpackRequire.federation.instance;var initToken=initTokens[shareScopeKey];if(!initToken)initToken=initTokens[shareScopeKey]={from:mfInstance.name};if(initScope.indexOf(initToken)>=0)return;initScope.push(initToken);const promise=initPromises[shareScopeKey];if(promise)return promise;var warn=msg=>"undefined"!=typeof console&&console.warn&&console.warn(msg);var initExternal=id=>{var handleError=err=>warn("Initialization of sharing external failed: "+err);try{var module1=webpackRequire(id);if(!module1)return;var initFn=module1=>module1&&module1.init&&module1.init(webpackRequire.S[shareScopeKey],initScope,{shareScopeMap:webpackRequire.S||{},shareScopeKeys:shareScopeName});if(module1.then)return promises.push(module1.then(initFn,handleError));var initResult=initFn(module1);if(initResult&&"boolean"!=typeof initResult&&initResult.then)return promises.push(initResult["catch"](handleError))}catch(err){handleError(err)}};const promises=mfInstance.initializeSharing(shareScopeKey,{strategy:mfInstance.options.shareStrategy,initScope,from:"build"});require_attachShareScopeMap.attachShareScopeMap(webpackRequire);const bundlerRuntimeRemotesOptions=webpackRequire.federation.bundlerRuntimeOptions.remotes;if(bundlerRuntimeRemotesOptions)Object.keys(bundlerRuntimeRemotesOptions.idToRemoteMap).forEach(moduleId=>{const info=bundlerRuntimeRemotesOptions.idToRemoteMap[moduleId];const externalModuleId=bundlerRuntimeRemotesOptions.idToExternalAndNameMapping[moduleId][2];if(info.length>1)initExternal(externalModuleId);else if(1===info.length){const remoteInfo=info[0];if(!require_constant.FEDERATION_SUPPORTED_TYPES.includes(remoteInfo.externalType))initExternal(externalModuleId)}});if(!promises.length)return initPromises[shareScopeKey]=true;return initPromises[shareScopeKey]=Promise.all(promises).then(()=>initPromises[shareScopeKey]=true)};shareScopeKeys.forEach(key=>{initializeSharingPromises.push(_initializeSharing(key))});return Promise.all(initializeSharingPromises).then(()=>true)}exports.initializeSharing=initializeSharing},1644:function(__unused_webpack_module,exports,__webpack_require__){const require_updateOptions=__webpack_require__(9741);const require_getUsedExports=__webpack_require__(694);function handleInitialConsumes(options){const{moduleId,moduleToHandlerMapping,webpackRequire,asyncLoad}=options;const federationInstance=webpackRequire.federation.instance;if(!federationInstance)throw new Error("Federation instance not found!");const{shareKey,shareInfo}=moduleToHandlerMapping[moduleId];try{const usedExports=require_getUsedExports.getUsedExports(webpackRequire,shareKey);const customShareInfo={...shareInfo};if(usedExports)customShareInfo.treeShaking={usedExports,useIn:[federationInstance.options.name]};if(asyncLoad)return federationInstance.loadShare(shareKey,{customShareInfo});return federationInstance.loadShareSync(shareKey,{customShareInfo})}catch(err){console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.');console.error("The original error message is as follows: ");throw err}}function installInitialConsumes(options){require_updateOptions.updateConsumeOptions(options);const{moduleToHandlerMapping,webpackRequire,installedModules,initialConsumes,asyncLoad}=options;const factoryIdSets=[];initialConsumes.forEach(id=>{const factoryGetter=()=>handleInitialConsumes({moduleId:id,moduleToHandlerMapping,webpackRequire,asyncLoad});factoryIdSets.push([id,factoryGetter])});const setModule=(id,factoryGetter)=>{webpackRequire.m[id]=module1=>{installedModules[id]=0;delete webpackRequire.c[id];const factory=factoryGetter();if("function"!=typeof factory)throw new Error(`Shared module is not available for eager consumption: ${id}`);const result=factory();const{shareInfo}=moduleToHandlerMapping[id];if(shareInfo?.shareConfig?.layer&&result&&"object"==typeof result)try{if(!result.hasOwnProperty("layer")||void 0===result.layer)result.layer=shareInfo.shareConfig.layer}catch(e){}module1.exports=result}};if(asyncLoad)return Promise.all(factoryIdSets.map(async([id,factoryGetter])=>{const result=await factoryGetter();setModule(id,()=>result)}));factoryIdSets.forEach(([id,factoryGetter])=>{setModule(id,factoryGetter)})}exports.installInitialConsumes=installInitialConsumes},3987:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(2604);const require_attachShareScopeMap=__webpack_require__(456);const require_constant=__webpack_require__(390);const require_updateOptions=__webpack_require__(9741);let _module_federation_sdk=__webpack_require__(1487);function remotes(options){require_updateOptions.updateRemoteOptions(options);const{chunkId,promises,webpackRequire,chunkMapping,idToExternalAndNameMapping,idToRemoteMap}=options;require_attachShareScopeMap.attachShareScopeMap(webpackRequire);if(webpackRequire.o(chunkMapping,chunkId))chunkMapping[chunkId].forEach(id=>{let getScope=webpackRequire.R;if(!getScope)getScope=[];const data=idToExternalAndNameMapping[id];const remoteInfos=idToRemoteMap[id]||[];if(getScope.indexOf(data)>=0)return;getScope.push(data);if(data.p)return promises.push(data.p);const onError=error=>{if(!error)error=/* @__PURE__ */new Error("Container missing");if("string"==typeof error.message)error.message+=`
|
|
1087
|
+
})`,{filename,importModuleDynamically:vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??importNodeModule});let requireFn;requireFn=eval("require");script.runInThisContext()(scriptContext.exports,scriptContext.module,requireFn,urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs["globalName"])return void cb(void 0,exportedInterface[attrs["globalName"]]||exportedInterface);cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:/* @__PURE__ */new Error(`Script execution error: ${e}`))}};getFetch().then(async f=>{if(attrs?.["type"]==="esm"||attrs?.["type"]==="module")return loadModule(urlObj.href,{fetch:f,vm:await importNodeModule("vm")}).then(async module1=>{await module1.evaluate();cb(void 0,module1.namespace)}).catch(e=>{cb(e instanceof Error?e:/* @__PURE__ */new Error(`Script execution error: ${e}`))});handleScriptFetch(f,urlObj)}).catch(err=>{cb(err)})}:(url,cb,attrs,loaderHook)=>{cb(/* @__PURE__ */new Error("createScriptNode is disabled in non-Node.js environment"))};const loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,info)=>new Promise((resolve,reject)=>{createScriptNode(url,(error,scriptContext)=>{if(error)reject(error);else{const remoteEntryKey=info?.attrs?.["globalName"]||`__FEDERATION_${info?.attrs?.["name"]}:custom__`;resolve(globalThis[remoteEntryKey]=scriptContext)}},info.attrs,info.loaderHook)}):(url,info)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};const esmModuleCache=/* @__PURE__ */new Map;const isFetchableRemoteModuleUrl=url=>url.startsWith("http:")||url.startsWith("https:");const isBareModuleSpecifier=specifier=>!specifier.startsWith("./")&&!specifier.startsWith("../")&&!specifier.startsWith("/")&&!specifier.includes(":");function encodeRemoteModulePath(url){const remoteUrl=new URL(url);const encodedProtocol=encodeURIComponent(remoteUrl.protocol.slice(0,-1));const encodedHost=encodeURIComponent(remoteUrl.host);const encodedPathname=remoteUrl.pathname.split("/").map(segment=>encodeURIComponent(segment)).join("/");const encodedSearchHash=encodeURIComponent(`${remoteUrl.search}${remoteUrl.hash}`);return`/${encodedProtocol}/${encodedHost}${encodedPathname}${encodedSearchHash?`/${encodedSearchHash}`:""}`}function createImportMetaUrl(url,baseFileUrl){const baseUrl=baseFileUrl.endsWith("/")?baseFileUrl:`${baseFileUrl}/`;return new URL(`__module_federation_remote__${encodeRemoteModulePath(url)}`,baseUrl).href}async function isNodeBuiltinSpecifier(specifier){if(specifier.startsWith("node:"))return true;if(!isBareModuleSpecifier(specifier))return false;return(await importNodeModule("node:module")).builtinModules.includes(specifier)}function getSyntheticModuleExports(moduleExports){const namespaceObject=moduleExports&&("object"==typeof moduleExports||"function"==typeof moduleExports)?moduleExports:{default:moduleExports};const effectiveExports={...namespaceObject};if(!Object.prototype.hasOwnProperty.call(effectiveExports,"default"))effectiveExports.default=namespaceObject;return effectiveExports}async function createSyntheticModuleFromExports(identifier,moduleExports,vm){if("function"!=typeof vm.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const effectiveExports=getSyntheticModuleExports(moduleExports);const exportNames=Object.keys(effectiveExports);const syntheticModule=new vm.SyntheticModule(exportNames,function(){for(const name of exportNames)this.setExport(name,effectiveExports[name])},{identifier});esmModuleCache.set(identifier,syntheticModule);await syntheticModule.link(async()=>{throw new Error(`Node.js built-in module "${identifier}" should not request child modules.`)});await syntheticModule.evaluate();return syntheticModule}async function loadNodeBuiltinModule(specifier,vm){const cacheKey=`node-builtin:${specifier}`;if(esmModuleCache.has(cacheKey))return esmModuleCache.get(cacheKey);return createSyntheticModuleFromExports(cacheKey,await importNodeModule(specifier),vm)}async function loadResolvedModule(specifier,parentUrl,options){if(await isNodeBuiltinSpecifier(specifier))return loadNodeBuiltinModule(specifier,options.vm);if(isBareModuleSpecifier(specifier))throw new Error(`Unsupported ESM module specifier "${specifier}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const resolvedUrl=new URL(specifier,parentUrl).href;if(!isFetchableRemoteModuleUrl(resolvedUrl))throw new Error(`Unsupported ESM module specifier "${specifier}" resolved to "${resolvedUrl}". Only http(s) remote modules and Node.js built-in modules are supported.`);return loadModule(resolvedUrl,options)}async function evaluateDynamicModule(module1){if("linked"===module1.status)await module1.evaluate();if("errored"===module1.status)throw module1.error;return module1}async function loadModule(url,options){if(esmModuleCache.has(url))return esmModuleCache.get(url);const{fetch:fetch1,vm}=options;if(!isFetchableRemoteModuleUrl(url))throw new Error(`Unsupported ESM module URL "${url}". Only http(s) remote modules and Node.js built-in modules are supported.`);const code=await (await fetch1(url)).text();const cwdFileUrl=(await importNodeModule("node:url")).pathToFileURL(process.cwd()).href;const sourceTextModule=new vm.SourceTextModule(code,{identifier:url,initializeImportMeta:meta=>{meta.url=createImportMetaUrl(url,cwdFileUrl)},importModuleDynamically:async specifier=>evaluateDynamicModule(await loadResolvedModule(specifier,url,options))});esmModuleCache.set(url,sourceTextModule);await sourceTextModule.link(async specifier=>loadResolvedModule(specifier,url,options));return sourceTextModule}exports.createScriptNode=createScriptNode;exports.loadScriptNode=loadScriptNode},8740:function(__unused_webpack_module,exports){function normalizeOptions(enableDefault,defaultOptions,key){return function(options){if(false===options)return false;if(void 0===options)if(enableDefault)return defaultOptions;else return false;if(true===options)return defaultOptions;if(options&&"object"==typeof options)return{...defaultOptions,...options};throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`)}}exports.normalizeOptions=normalizeOptions},1944:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ConsumeSharedPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ConsumeSharedPlugin_exports",{enumerable:true,get:function(){return ConsumeSharedPlugin_exports}})},5780:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ContainerPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ContainerPlugin_exports",{enumerable:true,get:function(){return ContainerPlugin_exports}})},8869:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ContainerReferencePlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ContainerReferencePlugin_exports",{enumerable:true,get:function(){return ContainerReferencePlugin_exports}})},8862:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ModuleFederationPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ModuleFederationPlugin_exports",{enumerable:true,get:function(){return ModuleFederationPlugin_exports}})},9901:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var ProvideSharedPlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"ProvideSharedPlugin_exports",{enumerable:true,get:function(){return ProvideSharedPlugin_exports}})},5688:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(3075);var SharePlugin_exports=/* @__PURE__ */require_runtime.__exportAll({});Object.defineProperty(exports,"SharePlugin_exports",{enumerable:true,get:function(){return SharePlugin_exports}})},5080:function(__unused_webpack_module,exports,__webpack_require__){const require_constant=__webpack_require__(8609);const require_env=__webpack_require__(7454);const LOG_CATEGORY="[ Federation Runtime ]";const parseEntry=(str,devVerOrUrl,separator=require_constant.SEPARATOR)=>{const strSplit=str.split(separator);const devVersionOrUrl="development"===require_env.getProcessEnv()["NODE_ENV"]&&devVerOrUrl;const defaultVersion="*";const isEntry=s=>s.startsWith("http")||s.includes(require_constant.MANIFEST_EXT);if(strSplit.length>=2){let[name,...versionOrEntryArr]=strSplit;if(str.startsWith(separator)){name=strSplit.slice(0,2).join(separator);versionOrEntryArr=[devVersionOrUrl||strSplit.slice(2).join(separator)]}let versionOrEntry=devVersionOrUrl||versionOrEntryArr.join(separator);if(isEntry(versionOrEntry))return{name,entry:versionOrEntry};return{name,version:versionOrEntry||defaultVersion}}if(1===strSplit.length){const[name]=strSplit;if(devVersionOrUrl&&isEntry(devVersionOrUrl))return{name,entry:devVersionOrUrl};return{name,version:devVersionOrUrl||defaultVersion}}throw`Invalid entry value: ${str}`};const composeKeyWithSeparator=function(...args){if(!args.length)return"";return args.reduce((sum,cur)=>{if(!cur)return sum;if(!sum)return cur;return`${sum}${require_constant.SEPARATOR}${cur}`},"")};const encodeName=function(name,prefix="",withExt=false){try{const ext=withExt?".js":"";return`${prefix}${name.replace(new RegExp(`${require_constant.NameTransformSymbol.AT}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]).replace(new RegExp(`${require_constant.NameTransformSymbol.HYPHEN}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]).replace(new RegExp(`${require_constant.NameTransformSymbol.SLASH}`,"g"),require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH])}${ext}`}catch(err){throw err}};const decodeName=function(name,prefix,withExt){try{let decodedName=name;if(prefix){if(!decodedName.startsWith(prefix))return decodedName;decodedName=decodedName.replace(new RegExp(prefix,"g"),"")}decodedName=decodedName.replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.AT]]).replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.SLASH]]).replace(new RegExp(`${require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]}`,"g"),require_constant.EncodedNameTransformMap[require_constant.NameTransformMap[require_constant.NameTransformSymbol.HYPHEN]]);if(withExt)decodedName=decodedName.replace(".js","");return decodedName}catch(err){throw err}};const generateExposeFilename=(exposeName,withExt)=>{if(!exposeName)return"";let expose=exposeName;if("."===expose)expose="default_export";if(expose.startsWith("./"))expose=expose.replace("./","");return encodeName(expose,"__federation_expose_",withExt)};const generateShareFilename=(pkgName,withExt)=>{if(!pkgName)return"";return encodeName(pkgName,"__federation_shared_",withExt)};function getResourceUrl(module1,sourceUrl){if("getPublicPath"in module1){let publicPath;publicPath=module1.getPublicPath.startsWith("function")?new Function("return "+module1.getPublicPath)()():new Function(module1.getPublicPath)();return`${publicPath}${sourceUrl}`}if("publicPath"in module1){if(!require_env.isBrowserEnv()&&!require_env.isReactNativeEnv()&&"ssrPublicPath"in module1&&"string"==typeof module1.ssrPublicPath)return`${module1.ssrPublicPath}${sourceUrl}`;return`${module1.publicPath}${sourceUrl}`}console.warn("Cannot get resource URL. If in debug mode, please ignore.",module1,sourceUrl);return""}const assert=(condition,msg)=>{if(!condition)error(msg)};const error=msg=>{throw new Error(`${LOG_CATEGORY}: ${msg}`)};const warn=msg=>{console.warn(`${LOG_CATEGORY}: ${msg}`)};function safeToString(info){try{return JSON.stringify(info,null,2)}catch(e){return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(str){return VERSION_PATTERN_REGEXP.test(str)}exports.assert=assert;exports.composeKeyWithSeparator=composeKeyWithSeparator;exports.decodeName=decodeName;exports.encodeName=encodeName;exports.error=error;exports.generateExposeFilename=generateExposeFilename;exports.generateShareFilename=generateShareFilename;exports.getResourceUrl=getResourceUrl;exports.isRequiredVersion=isRequiredVersion;exports.parseEntry=parseEntry;exports.safeToString=safeToString;exports.warn=warn},2604:function(__unused_webpack_module,exports){var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(var keys=__getOwnPropNames(from),i=0,n=keys.length,key;i<n;i++){key=keys[i];if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:(k=>from[k]).bind(null,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp(target,"default",{value:mod,enumerable:true}),mod));exports.__toESM=__toESM},456:function(__unused_webpack_module,exports){function attachShareScopeMap(webpackRequire){if(!webpackRequire.S||webpackRequire.federation.hasAttachShareScopeMap||!webpackRequire.federation.instance||!webpackRequire.federation.instance.shareScopeMap)return;webpackRequire.S=webpackRequire.federation.instance.shareScopeMap;webpackRequire.federation.hasAttachShareScopeMap=true}exports.attachShareScopeMap=attachShareScopeMap},390:function(__unused_webpack_module,exports){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const FEDERATION_SUPPORTED_TYPES=["script"];exports.FEDERATION_SUPPORTED_TYPES=FEDERATION_SUPPORTED_TYPES},2127:function(__unused_webpack_module,exports,__webpack_require__){const require_attachShareScopeMap=__webpack_require__(456);const require_updateOptions=__webpack_require__(9741);const require_getUsedExports=__webpack_require__(694);const require_error_codes=__webpack_require__(7982);const require_getShortErrorMsg=__webpack_require__(4324);function consumes(options){require_updateOptions.updateConsumeOptions(options);const{chunkId,promises,installedModules,webpackRequire,chunkMapping,moduleToHandlerMapping}=options;require_attachShareScopeMap.attachShareScopeMap(webpackRequire);if(webpackRequire.o(chunkMapping,chunkId))chunkMapping[chunkId].forEach(id=>{if(webpackRequire.o(installedModules,id))return promises.push(installedModules[id]);const onFactory=factory=>{installedModules[id]=0;webpackRequire.m[id]=module1=>{delete webpackRequire.c[id];const result=factory();const{shareInfo}=moduleToHandlerMapping[id];if(shareInfo?.shareConfig?.layer&&result&&"object"==typeof result)try{if(!result.hasOwnProperty("layer")||void 0===result.layer)result.layer=shareInfo.shareConfig.layer}catch(e){}module1.exports=result}};const onError=error=>{delete installedModules[id];webpackRequire.m[id]=module1=>{delete webpackRequire.c[id];throw error}};try{const federationInstance=webpackRequire.federation.instance;if(!federationInstance)throw new Error("Federation instance not found!");const{shareKey,getter,shareInfo,treeShakingGetter}=moduleToHandlerMapping[id];const usedExports=require_getUsedExports.getUsedExports(webpackRequire,shareKey);const customShareInfo={...shareInfo};if(Array.isArray(customShareInfo.scope)&&Array.isArray(customShareInfo.scope[0]))customShareInfo.scope=customShareInfo.scope[0];if(usedExports)customShareInfo.treeShaking={usedExports,useIn:[federationInstance.options.name]};const promise=federationInstance.loadShare(shareKey,{customShareInfo}).then(factory=>{if(false===factory){if("function"!=typeof getter)throw new Error(require_getShortErrorMsg.getShortErrorMsg(require_error_codes.RUNTIME_012,{[require_error_codes.RUNTIME_012]:'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.'},{shareKey}));return treeShakingGetter?.()||getter()}return factory});if(promise.then)promises.push(installedModules[id]=promise.then(onFactory).catch(onError));else onFactory(promise)}catch(e){onError(e)}})}exports.consumes=consumes},7982:function(__unused_webpack_module,exports){const RUNTIME_012="RUNTIME-012";exports.RUNTIME_012=RUNTIME_012},4324:function(__unused_webpack_module,exports){const getDocsUrl=errorCode=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;const getShortErrorMsg=(errorCode,errorDescMap,args,originalErrorMsg)=>{const msg=[`${[errorDescMap[errorCode]]} #${errorCode}`];args&&msg.push(`args: ${JSON.stringify(args)}`);msg.push(getDocsUrl(errorCode));originalErrorMsg&&msg.push(`Original Error Message:
|
|
1088
|
+
${originalErrorMsg}`);return msg.join("\n")};exports.getShortErrorMsg=getShortErrorMsg},2930:function(__unused_webpack_module,exports){const getSharedFallbackGetter=({shareKey,factory,version,webpackRequire,libraryType="global"})=>{const{runtime,instance,bundlerRuntime,sharedFallback}=webpackRequire.federation;if(!sharedFallback)return factory;const fallbackItems=sharedFallback[shareKey];if(!fallbackItems)return factory;const fallbackItem=version?fallbackItems.find(item=>item[1]===version):fallbackItems[0];if(!fallbackItem)throw new Error(`No fallback item found for shareKey: ${shareKey} and version: ${version}`);return()=>runtime.getRemoteEntry({origin:webpackRequire.federation.instance,remoteInfo:{name:fallbackItem[2],entry:`${webpackRequire.p}${fallbackItem[0]}`,type:libraryType,entryGlobalName:fallbackItem[2],shareScope:"default"}}).then(shareEntry=>{if(!shareEntry)throw new Error(`Failed to load fallback entry for shareKey: ${shareKey} and version: ${version}`);return shareEntry.init(webpackRequire.federation.instance,bundlerRuntime).then(()=>shareEntry.get())})};exports.getSharedFallbackGetter=getSharedFallbackGetter},694:function(__unused_webpack_module,exports){function getUsedExports(webpackRequire,sharedName){const usedExports=webpackRequire.federation.usedExports;if(!usedExports)return;return usedExports[sharedName]}exports.getUsedExports=getUsedExports},6874:function(__unused_webpack_module,exports,__webpack_require__){Object.defineProperties(exports,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}});const require_runtime=__webpack_require__(2604);const require_attachShareScopeMap=__webpack_require__(456);const require_remotes=__webpack_require__(3987);const require_consumes=__webpack_require__(2127);const require_initializeSharing=__webpack_require__(2796);const require_installInitialConsumes=__webpack_require__(1644);const require_initContainerEntry=__webpack_require__(6875);const require_init=__webpack_require__(9488);const require_getSharedFallbackGetter=__webpack_require__(2930);let _module_federation_runtime=__webpack_require__(1695);_module_federation_runtime=require_runtime.__toESM(_module_federation_runtime);const bundlerRuntime={remotes:require_remotes.remotes,consumes:require_consumes.consumes,I:require_initializeSharing.initializeSharing,S:{},installInitialConsumes:require_installInitialConsumes.installInitialConsumes,initContainerEntry:require_initContainerEntry.initContainerEntry,init:require_init.init,getSharedFallbackGetter:require_getSharedFallbackGetter.getSharedFallbackGetter};const federation={runtime:_module_federation_runtime,instance:void 0,initOptions:void 0,bundlerRuntime,attachShareScopeMap:require_attachShareScopeMap.attachShareScopeMap,bundlerRuntimeOptions:{}};const instance=federation.instance;const initOptions=federation.initOptions;const bundlerRuntimeOptions=federation.bundlerRuntimeOptions;exports.attachShareScopeMap=require_attachShareScopeMap.attachShareScopeMap;exports.bundlerRuntime=bundlerRuntime;exports.bundlerRuntimeOptions=bundlerRuntimeOptions;exports["default"]=federation;exports.initOptions=initOptions;exports.instance=instance;Object.defineProperty(exports,"runtime",{enumerable:true,get:function(){return _module_federation_runtime}})},9488:function(__unused_webpack_module,exports,__webpack_require__){const require_runtime=__webpack_require__(2604);let _module_federation_runtime=__webpack_require__(1695);let _module_federation_runtime_helpers=__webpack_require__(2600);_module_federation_runtime_helpers=require_runtime.__toESM(_module_federation_runtime_helpers);function init({webpackRequire}){const{initOptions,runtime,sharedFallback,bundlerRuntime,libraryType}=webpackRequire.federation;if(!initOptions)throw new Error("initOptions is required!");{const treeShakingSharePlugin=function(){return{name:"tree-shake-plugin",beforeInit(args){const{userOptions,origin,options:registeredOptions}=args;const version=userOptions.version||registeredOptions.version;if(!sharedFallback)return args;const currentShared=userOptions.shared||{};const shared=[];Object.keys(currentShared).forEach(sharedName=>{(Array.isArray(currentShared[sharedName])?currentShared[sharedName]:[currentShared[sharedName]]).forEach(sharedArg=>{shared.push([sharedName,sharedArg]);if("get"in sharedArg){sharedArg.treeShaking||={};sharedArg.treeShaking.get=sharedArg.get;sharedArg.get=bundlerRuntime.getSharedFallbackGetter({shareKey:sharedName,factory:sharedArg.get,webpackRequire,libraryType,version:sharedArg.version})}})});const hostGlobalSnapshot=_module_federation_runtime_helpers.default.global.getGlobalSnapshotInfoByModuleInfo({name:origin.name,version});if(!hostGlobalSnapshot||!("shared"in hostGlobalSnapshot))return args;Object.keys(registeredOptions.shared||{}).forEach(pkgName=>{registeredOptions.shared[pkgName].forEach(sharedArg=>{shared.push([pkgName,sharedArg])})});const patchShared=(pkgName,shared)=>{const shareSnapshot=hostGlobalSnapshot.shared.find(item=>item.sharedName===pkgName);if(!shareSnapshot)return;const{treeShaking}=shared;if(!treeShaking)return;const{secondarySharedTreeShakingName,secondarySharedTreeShakingEntry,treeShakingStatus}=shareSnapshot;if(treeShaking.status===treeShakingStatus)return;treeShaking.status=treeShakingStatus;if(secondarySharedTreeShakingEntry&&libraryType&&secondarySharedTreeShakingName)treeShaking.get=async()=>{const shareEntry=await (0,_module_federation_runtime.getRemoteEntry)({origin,remoteInfo:{name:secondarySharedTreeShakingName,entry:secondarySharedTreeShakingEntry,type:libraryType,entryGlobalName:secondarySharedTreeShakingName,shareScope:"default"}});await shareEntry.init(origin,__webpack_require__.federation.bundlerRuntime);return shareEntry.get()}};shared.forEach(([pkgName,sharedArg])=>{patchShared(pkgName,sharedArg)});return args}}};initOptions.plugins||=[];initOptions.plugins.push(treeShakingSharePlugin())}return runtime.init(initOptions)}exports.init=init},6875:function(__unused_webpack_module,exports){function initContainerEntry(options){const{webpackRequire,shareScope,initScope,shareScopeKey,remoteEntryInitOptions}=options;if(!webpackRequire.S)return;if(!webpackRequire.federation||!webpackRequire.federation.instance||!webpackRequire.federation.initOptions)return;const federationInstance=webpackRequire.federation.instance;federationInstance.initOptions({name:webpackRequire.federation.initOptions.name,remotes:[],...remoteEntryInitOptions});const hostShareScopeKeys=remoteEntryInitOptions?.shareScopeKeys;const hostShareScopeMap=remoteEntryInitOptions?.shareScopeMap;if(shareScopeKey&&"string"!=typeof shareScopeKey)shareScopeKey.forEach(key=>{if(!hostShareScopeKeys||!hostShareScopeMap)return void federationInstance.initShareScopeMap(key,shareScope,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}});if(!hostShareScopeMap[key])hostShareScopeMap[key]={};const sc=hostShareScopeMap[key];federationInstance.initShareScopeMap(key,sc,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})});else{const key=shareScopeKey||"default";if(Array.isArray(hostShareScopeKeys))hostShareScopeKeys.forEach(hostKey=>{if(!hostShareScopeMap[hostKey])hostShareScopeMap[hostKey]={};const sc=hostShareScopeMap[hostKey];federationInstance.initShareScopeMap(hostKey,sc,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})});else federationInstance.initShareScopeMap(key,shareScope,{hostShareScopeMap:remoteEntryInitOptions?.shareScopeMap||{}})}if(webpackRequire.federation.attachShareScopeMap)webpackRequire.federation.attachShareScopeMap(webpackRequire);if(!Array.isArray(shareScopeKey))return webpackRequire.I(shareScopeKey||"default",initScope);if(Boolean(webpackRequire.federation.initOptions.shared))return webpackRequire.I(shareScopeKey,initScope);return Promise.all(shareScopeKey.map(key=>webpackRequire.I(key,initScope))).then(()=>true)}exports.initContainerEntry=initContainerEntry},2796:function(__unused_webpack_module,exports,__webpack_require__){const require_attachShareScopeMap=__webpack_require__(456);const require_constant=__webpack_require__(390);function initializeSharing({shareScopeName,webpackRequire,initPromises,initTokens,initScope}){const shareScopeKeys=Array.isArray(shareScopeName)?shareScopeName:[shareScopeName];var initializeSharingPromises=[];var _initializeSharing=function(shareScopeKey){if(!initScope)initScope=[];const mfInstance=webpackRequire.federation.instance;var initToken=initTokens[shareScopeKey];if(!initToken)initToken=initTokens[shareScopeKey]={from:mfInstance.name};if(initScope.indexOf(initToken)>=0)return;initScope.push(initToken);const promise=initPromises[shareScopeKey];if(promise)return promise;var warn=msg=>"undefined"!=typeof console&&console.warn&&console.warn(msg);var initExternal=id=>{var handleError=err=>warn("Initialization of sharing external failed: "+err);try{var module1=webpackRequire(id);if(!module1)return;var initFn=module1=>module1&&module1.init&&module1.init(webpackRequire.S[shareScopeKey],initScope,{shareScopeMap:webpackRequire.S||{},shareScopeKeys:shareScopeName});if(module1.then)return promises.push(module1.then(initFn,handleError));var initResult=initFn(module1);if(initResult&&"boolean"!=typeof initResult&&initResult.then)return promises.push(initResult["catch"](handleError))}catch(err){handleError(err)}};const promises=mfInstance.initializeSharing(shareScopeKey,{strategy:mfInstance.options.shareStrategy,initScope,from:"build"});require_attachShareScopeMap.attachShareScopeMap(webpackRequire);const bundlerRuntimeRemotesOptions=webpackRequire.federation.bundlerRuntimeOptions.remotes;if(bundlerRuntimeRemotesOptions)Object.keys(bundlerRuntimeRemotesOptions.idToRemoteMap).forEach(moduleId=>{const info=bundlerRuntimeRemotesOptions.idToRemoteMap[moduleId];const externalModuleId=bundlerRuntimeRemotesOptions.idToExternalAndNameMapping[moduleId][2];if(info.length>1)initExternal(externalModuleId);else if(1===info.length){const remoteInfo=info[0];if(!require_constant.FEDERATION_SUPPORTED_TYPES.includes(remoteInfo.externalType))initExternal(externalModuleId)}});if(!promises.length)return initPromises[shareScopeKey]=true;return initPromises[shareScopeKey]=Promise.all(promises).then(()=>initPromises[shareScopeKey]=true)};shareScopeKeys.forEach(key=>{initializeSharingPromises.push(_initializeSharing(key))});return Promise.all(initializeSharingPromises).then(()=>true)}exports.initializeSharing=initializeSharing},1644:function(__unused_webpack_module,exports,__webpack_require__){const require_updateOptions=__webpack_require__(9741);const require_getUsedExports=__webpack_require__(694);function handleInitialConsumes(options){const{moduleId,moduleToHandlerMapping,webpackRequire,asyncLoad}=options;const federationInstance=webpackRequire.federation.instance;if(!federationInstance)throw new Error("Federation instance not found!");const{shareKey,shareInfo}=moduleToHandlerMapping[moduleId];try{const usedExports=require_getUsedExports.getUsedExports(webpackRequire,shareKey);const customShareInfo={...shareInfo};if(usedExports)customShareInfo.treeShaking={usedExports,useIn:[federationInstance.options.name]};if(asyncLoad)return federationInstance.loadShare(shareKey,{customShareInfo});return federationInstance.loadShareSync(shareKey,{customShareInfo})}catch(err){console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.');console.error("The original error message is as follows: ");throw err}}function installInitialConsumes(options){require_updateOptions.updateConsumeOptions(options);const{moduleToHandlerMapping,webpackRequire,installedModules,initialConsumes,asyncLoad}=options;const factoryIdSets=[];initialConsumes.forEach(id=>{const factoryGetter=()=>handleInitialConsumes({moduleId:id,moduleToHandlerMapping,webpackRequire,asyncLoad});factoryIdSets.push([id,factoryGetter])});const setModule=(id,factoryGetter)=>{webpackRequire.m[id]=module1=>{installedModules[id]=0;delete webpackRequire.c[id];const factory=factoryGetter();if("function"!=typeof factory)throw new Error(`Shared module is not available for eager consumption: ${id}`);const result=factory();const{shareInfo}=moduleToHandlerMapping[id];if(shareInfo?.shareConfig?.layer&&result&&"object"==typeof result)try{if(!result.hasOwnProperty("layer")||void 0===result.layer)result.layer=shareInfo.shareConfig.layer}catch(e){}module1.exports=result}};if(asyncLoad)return Promise.all(factoryIdSets.map(async([id,factoryGetter])=>{const result=await factoryGetter();setModule(id,()=>result)}));factoryIdSets.forEach(([id,factoryGetter])=>{setModule(id,factoryGetter)})}exports.installInitialConsumes=installInitialConsumes},3987:function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__(2604);const require_attachShareScopeMap=__webpack_require__(456);const require_constant=__webpack_require__(390);const require_updateOptions=__webpack_require__(9741);let _module_federation_sdk=__webpack_require__(1487);function remotes(options){require_updateOptions.updateRemoteOptions(options);const{chunkId,promises,webpackRequire,chunkMapping,idToExternalAndNameMapping,idToRemoteMap}=options;require_attachShareScopeMap.attachShareScopeMap(webpackRequire);if(webpackRequire.o(chunkMapping,chunkId))chunkMapping[chunkId].forEach(id=>{let getScope=webpackRequire.R;if(!getScope)getScope=[];const data=idToExternalAndNameMapping[id];const remoteInfos=idToRemoteMap[id]||[];if(getScope.indexOf(data)>=0)return;getScope.push(data);if(data.p)return promises.push(data.p);const onError=error=>{if(!error)error=/* @__PURE__ */new Error("Container missing");if("string"==typeof error.message)error.message+=`
|
|
1089
1089
|
while loading "${data[1]}" from ${data[2]}`;webpackRequire.m[id]=()=>{throw error};data.p=0};const handleFunction=(fn,arg1,arg2,d,next,first)=>{try{const promise=fn(arg1,arg2);if(!promise||!promise.then)return next(promise,d,first);{const p=promise.then(result=>next(result,d),onError);if(!first)return p;promises.push(data.p=p)}}catch(error){onError(error)}};const onExternal=(external,_,first)=>external?handleFunction(webpackRequire.I,data[0],0,external,onInitialized,first):onError();var onInitialized=(_,external,first)=>handleFunction(external.get,data[1],getScope,0,onFactory,first);var onFactory=factory=>{data.p=1;webpackRequire.m[id]=module1=>{module1.exports=factory()}};const onRemoteLoaded=()=>{try{const remoteModuleName=(0,_module_federation_sdk.decodeName)(remoteInfos[0].name,_module_federation_sdk.ENCODE_NAME_PREFIX)+data[1].slice(1);const instance=webpackRequire.federation.instance;const loadRemote=()=>webpackRequire.federation.instance.loadRemote(remoteModuleName,{loadFactory:false,from:"build"});if("version-first"===instance.options.shareStrategy){const shareScopes=Array.isArray(data[0])?data[0]:[data[0]];return Promise.all(shareScopes.map(shareScope=>instance.sharedHandler.initializeSharing(shareScope))).then(()=>loadRemote())}return loadRemote()}catch(error){onError(error)}};1===remoteInfos.length&&require_constant.FEDERATION_SUPPORTED_TYPES.includes(remoteInfos[0].externalType)&&remoteInfos[0].name?handleFunction(onRemoteLoaded,data[2],0,0,onFactory,1):handleFunction(webpackRequire,data[2],0,0,onExternal,1)})}exports.remotes=remotes},9741:function(__unused_webpack_module,exports){function updateConsumeOptions(options){const{webpackRequire,moduleToHandlerMapping}=options;const{consumesLoadingData,initializeSharingData}=webpackRequire;const{sharedFallback,bundlerRuntime,libraryType}=webpackRequire.federation;if(consumesLoadingData&&!consumesLoadingData._updated){const{moduleIdToConsumeDataMapping:updatedModuleIdToConsumeDataMapping={},initialConsumes:updatedInitialConsumes=[],chunkMapping:updatedChunkMapping={}}=consumesLoadingData;Object.entries(updatedModuleIdToConsumeDataMapping).forEach(([id,data])=>{if(!moduleToHandlerMapping[id])moduleToHandlerMapping[id]={getter:sharedFallback?bundlerRuntime?.getSharedFallbackGetter({shareKey:data.shareKey,factory:data.fallback,webpackRequire,libraryType}):data.fallback,treeShakingGetter:sharedFallback?data.fallback:void 0,shareInfo:{shareConfig:{requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager,layer:data.layer},scope:Array.isArray(data.shareScope)?data.shareScope:[data.shareScope||"default"],treeShaking:sharedFallback?{get:data.fallback,mode:data.treeShakingMode}:void 0},shareKey:data.shareKey}});if("initialConsumes"in options){const{initialConsumes=[]}=options;updatedInitialConsumes.forEach(id=>{if(!initialConsumes.includes(id))initialConsumes.push(id)})}if("chunkMapping"in options){const{chunkMapping={}}=options;Object.entries(updatedChunkMapping).forEach(([id,chunkModules])=>{if(!chunkMapping[id])chunkMapping[id]=[];chunkModules.forEach(moduleId=>{if(!chunkMapping[id].includes(moduleId))chunkMapping[id].push(moduleId)})})}consumesLoadingData._updated=1}if(initializeSharingData&&!initializeSharingData._updated){const{federation}=webpackRequire;if(!federation.instance||!initializeSharingData.scopeToSharingDataMapping)return;const shared={};for(let[scope,stages]of Object.entries(initializeSharingData.scopeToSharingDataMapping))for(let stage of stages)if("object"==typeof stage&&null!==stage){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={requiredVersion:`^${version}`};const isValidValue=function(val){return void 0!==val};if(isValidValue(singleton))shareConfig.singleton=singleton;if(isValidValue(requiredVersion))shareConfig.requiredVersion=requiredVersion;if(isValidValue(eager))shareConfig.eager=eager;if(isValidValue(strictVersion))shareConfig.strictVersion=strictVersion;const options={version,scope:[scope],shareConfig,get:factory};if(shared[name])shared[name].push(options);else shared[name]=[options]}federation.instance.registerShared(shared);initializeSharingData._updated=1}}function updateRemoteOptions(options){const{webpackRequire,idToExternalAndNameMapping={},idToRemoteMap={},chunkMapping={}}=options;const{remotesLoadingData}=webpackRequire;const remoteInfos=webpackRequire.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!remotesLoadingData||remotesLoadingData._updated||!remoteInfos)return;const{chunkMapping:updatedChunkMapping,moduleIdToRemoteDataMapping}=remotesLoadingData;if(!updatedChunkMapping||!moduleIdToRemoteDataMapping)return;for(let[moduleId,data]of Object.entries(moduleIdToRemoteDataMapping)){if(!idToExternalAndNameMapping[moduleId])idToExternalAndNameMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId];if(!idToRemoteMap[moduleId]&&remoteInfos[data.remoteName]){const items=remoteInfos[data.remoteName];idToRemoteMap[moduleId]||=[];items.forEach(item=>{if(!idToRemoteMap[moduleId].includes(item))idToRemoteMap[moduleId].push(item)})}}if(chunkMapping)Object.entries(updatedChunkMapping).forEach(([id,chunkModules])=>{if(!chunkMapping[id])chunkMapping[id]=[];chunkModules.forEach(moduleId=>{if(!chunkMapping[id].includes(moduleId))chunkMapping[id].push(moduleId)})});remotesLoadingData._updated=1}exports.updateConsumeOptions=updateConsumeOptions;exports.updateRemoteOptions=updateRemoteOptions},1696:function(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__){"use strict";var _home_runner_work_core_core_packages_webpack_bundler_runtime_dist_index_cjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(6874);var _home_runner_work_core_core_packages_webpack_bundler_runtime_dist_index_cjs__WEBPACK_IMPORTED_MODULE_0___default=/*#__PURE__*/__webpack_require__.n(_home_runner_work_core_core_packages_webpack_bundler_runtime_dist_index_cjs__WEBPACK_IMPORTED_MODULE_0__);var _home_runner_work_core_core_packages_node_dist_src_runtimePlugin_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4534);var _home_runner_work_core_core_packages_node_dist_src_runtimePlugin_js__WEBPACK_IMPORTED_MODULE_1___default=/*#__PURE__*/__webpack_require__.n(_home_runner_work_core_core_packages_node_dist_src_runtimePlugin_js__WEBPACK_IMPORTED_MODULE_1__);const __module_federation_runtime_plugins__=[_home_runner_work_core_core_packages_node_dist_src_runtimePlugin_js__WEBPACK_IMPORTED_MODULE_1___default()()];const __module_federation_remote_infos__={};const __module_federation_container_name__="mf_playground";const __module_federation_share_strategy__="version-first";if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value1)=>{if(!obj)return;if(obj[key])obj[key]=value1};const merge=(obj,key,fn)=>{const value1=fn();if(Array.isArray(value1)){var _obj,_key;var _;null!=(_=(_obj=obj)[_key=key])||(_obj[_key]=[]);obj[key].push(...value1)}else if("object"==typeof value1&&null!==value1){var _obj1,_key1;var _1;null!=(_1=(_obj1=obj)[_key1=key])||(_obj1[_key1]={});Object.assign(obj[key],value1)}};const early=(obj,key,initial)=>{var _obj,_key;var _;null!=(_=(_obj=obj)[_key=key])||(_obj[_key]=initial())};var __webpack_require___remotesLoadingData_chunkMapping;const remotesLoadingChunkMapping=null!=(__webpack_require___remotesLoadingData_chunkMapping=null==(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)?void 0:__webpack_require___remotesLoadingData.chunkMapping)?__webpack_require___remotesLoadingData_chunkMapping:{};var __webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping;const remotesLoadingModuleIdToRemoteDataMapping=null!=(__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping=null==(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)?__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping:{};var __webpack_require___initializeSharingData_scopeToSharingDataMapping;const initializeSharingScopeToInitDataMapping=null!=(__webpack_require___initializeSharingData_scopeToSharingDataMapping=null==(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)?__webpack_require___initializeSharingData_scopeToSharingDataMapping:{};var __webpack_require___consumesLoadingData_chunkMapping;const consumesLoadingChunkMapping=null!=(__webpack_require___consumesLoadingData_chunkMapping=null==(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)?void 0:__webpack_require___consumesLoadingData.chunkMapping)?__webpack_require___consumesLoadingData_chunkMapping:{};var __webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping;const consumesLoadingModuleToConsumeDataMapping=null!=(__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping=null==(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)?__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=null==(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in _home_runner_work_core_core_packages_webpack_bundler_runtime_dist_index_cjs__WEBPACK_IMPORTED_MODULE_0___default())__webpack_require__.federation[key]=_home_runner_work_core_core_packages_webpack_bundler_runtime_dist_index_cjs__WEBPACK_IMPORTED_MODULE_0___default()[key];early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping))consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey};return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping))for(let stage of stages)if("object"==typeof stage&&null!==stage){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return void 0!==val};if(isValidValue(singleton))shareConfig.singleton=singleton;if(isValidValue(requiredVersion))shareConfig.requiredVersion=requiredVersion;if(isValidValue(eager))shareConfig.eager=eager;if(isValidValue(strictVersion))shareConfig.strictVersion=strictVersion;const options={version,scope:[scope],shareConfig,get:factory};if(shared[name])shared[name].push(options);else shared[name]=[options]}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>"script"===remote.externalType));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping))remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName];return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap)__webpack_require__.federation.attachShareScopeMap(__webpack_require__);override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error('Module "'+module1+'" does not exist in container.')});__webpack_require__.R=void 0;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);if(null==(__webpack_require___consumesLoadingData2=__webpack_require__.consumesLoadingData)?void 0:__webpack_require___consumesLoadingData2.initialConsumes)__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}},6982:function(module1){"use strict";module1.exports=require("crypto")},9896:function(module1){"use strict";module1.exports=require("fs")},264:function(module1){"use strict";module1.exports=require("inspector")},857:function(module1){"use strict";module1.exports=require("os")},6928:function(module1){"use strict";module1.exports=require("path")},2987:function(module1){"use strict";module1.exports=require("perf_hooks")}};var __webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module1=__webpack_module_cache__[moduleId]={id:moduleId,loaded:false,exports:{}};__webpack_modules__[moduleId](module1,module1.exports,__webpack_require__);module1.loaded=true;return module1.exports}__webpack_require__.m=__webpack_modules__;__webpack_require__.c=__webpack_module_cache__;__webpack_require__.x=()=>{var __webpack_exports__=__webpack_require__(652);return __webpack_exports__};(()=>{if(!__webpack_require__.federation)__webpack_require__.federation={chunkMatcher:function(chunkId){return true},rootOutputDir:""}})();(()=>{__webpack_require__.n=module1=>{var getter=module1&&module1.__esModule?()=>module1["default"]:()=>module1;__webpack_require__.d(getter,{a:getter});return getter}})();(()=>{__webpack_require__.d=(exports,definition)=>{for(var key in definition)if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key))Object.defineProperty(exports,key,{enumerable:true,get:definition[key]})}})();(()=>{var prevStartup=__webpack_require__.x;var hasRun=false;__webpack_require__.x=function(){if(!hasRun){hasRun=true;__webpack_require__(1696)}if("function"==typeof prevStartup)return prevStartup();console.warn("[MF] Invalid prevStartup")}})();(()=>{__webpack_require__.f={};__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises,key)=>{__webpack_require__.f[key](chunkId,promises);return promises},[]))})();(()=>{__webpack_require__.u=chunkId=>""+chunkId+"mf_playground.js"})();(()=>{__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop)})();(()=>{__webpack_require__.r=exports=>{if("undefined"!=typeof Symbol&&Symbol.toStringTag)Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});Object.defineProperty(exports,"__esModule",{value:true})}})();(()=>{__webpack_require__.nmd=module1=>{module1.paths=[];if(!module1.children)module1.children=[];return module1}})();(()=>{__webpack_require__.S={};__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"react-dom/client",version:"19.1.1",factory:()=>__webpack_require__.e("503").then(()=>()=>__webpack_require__(5655)),eager:0,singleton:1},{name:"react-dom",version:"19.1.1",factory:()=>__webpack_require__.e("315").then(()=>()=>__webpack_require__(9374)),eager:0,singleton:1},{name:"react/jsx-runtime",version:"19.1.1",factory:()=>__webpack_require__.e("105").then(()=>()=>__webpack_require__(1360)),eager:0,singleton:1},{name:"react",version:"19.1.1",factory:()=>__webpack_require__.e("349").then(()=>()=>__webpack_require__(6364)),eager:0,singleton:1}]},uniqueName:"@module-federation/playground"};__webpack_require__.I=__webpack_require__.I||function(){throw new Error("should have __webpack_require__.I")}})();(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{884:["4061"],410:["9251","9926","3493","3383","8460"],503:["9926","4061"],315:["4061"]},moduleIdToConsumeDataMapping:{3493:{shareScope:"default",shareKey:"react-dom/client",import:"react-dom/client",requiredVersion:"*",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("884").then(()=>()=>__webpack_require__(5655))},9926:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"*",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("315").then(()=>()=>__webpack_require__(9374))},9251:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"*",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("349").then(()=>()=>__webpack_require__(6364))},3383:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("349").then(()=>()=>__webpack_require__(6364))},8460:{shareScope:"default",shareKey:"react/jsx-runtime",import:"react/jsx-runtime",requiredVersion:"*",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("105").then(()=>()=>__webpack_require__(1360))},4061:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"^19.1.1",strictVersion:false,singleton:true,eager:false,fallback:()=>__webpack_require__.e("349").then(()=>()=>__webpack_require__(6364))}},initialConsumes:["9251","9926","3493","3383","8460"]};__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw new Error("should have __webpack_require__.f.consumes")}})();(()=>{var installedChunks={410:0};var installChunk=chunk=>{var moreModules=chunk.modules,chunkIds=chunk.ids,runtime=chunk.runtime;for(var moduleId in moreModules)if(__webpack_require__.o(moreModules,moduleId))__webpack_require__.m[moduleId]=moreModules[moduleId];if(runtime)runtime(__webpack_require__);for(var i=0;i<chunkIds.length;i++){if(installedChunks[chunkIds[i]])installedChunks[chunkIds[i]][0]();installedChunks[chunkIds[i]]=0}};__webpack_require__.f.readFileVm=function(chunkId,promises){var installedChunkData=installedChunks[chunkId];if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else{var promise=new Promise(function(resolve,reject){installedChunkData=installedChunks[chunkId]=[resolve,reject];var filename=require("path").join(__dirname,""+__webpack_require__.u(chunkId));require("fs").readFile(filename,"utf-8",function(err,content){if(err)return reject(err);var chunk={};require("vm").runInThisContext("(function(exports, require, __dirname, __filename) {"+content+"\n})",filename)(chunk,require,require("path").dirname(filename),filename);installChunk(chunk)})});promises.push(installedChunkData[2]=promise)}}})();var __webpack_exports__=__webpack_require__.x();module.exports=__webpack_exports__})();
|