@perses-dev/timeseries-chart-plugin 0.10.0 → 0.10.1
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/__mf/js/TimeSeriesChart.2f8b193b.js +6 -0
- package/__mf/js/async/{109.bf4f02fe.js → 109.604f6c41.js} +2 -2
- package/__mf/js/main.42f3cc3e.js +6 -0
- package/lib/cjs/utils/data-transform.js +0 -49
- package/lib/utils/data-transform.d.ts +1 -5
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js +1 -49
- package/lib/utils/data-transform.js.map +1 -1
- package/mf-manifest.json +4 -4
- package/mf-stats.json +4 -4
- package/package.json +1 -1
- package/__mf/js/TimeSeriesChart.d3742b3b.js +0 -5
- package/__mf/js/main.2c598209.js +0 -5
- /package/__mf/js/async/{109.bf4f02fe.js.LICENSE.txt → 109.604f6c41.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(()=>{var __webpack_modules__={76523:function(e,t){"use strict";let r="RUNTIME-001",n="RUNTIME-002",o="RUNTIME-003",i="RUNTIME-004",a="RUNTIME-005",s="RUNTIME-006",l="RUNTIME-007",c="RUNTIME-008",u="RUNTIME-009",f="TYPE-001",d="BUILD-001",h="BUILD-002",p=e=>{let t=e.split("-")[0].toLowerCase();return`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t}/${e}`},m=(e,t,r,n)=>{let o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(p(e)),n&&o.push(`Original Error Message:
|
|
2
|
+
${n}`),o.join("\n")};function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let y={[r]:"Failed to get remoteEntry exports.",[n]:'The remote entry interface does not contain "init"',[o]:"Failed to get manifest.",[i]:"Failed to locate remote.",[a]:"Invalid loadShareSync function call from bundler runtime",[s]:"Invalid loadShareSync function call from runtime",[l]:"Failed to get remote snapshot.",[c]:"Failed to load script resources.",[u]:"Please call createInstance first."},_={[f]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},E={[d]:"Failed to find expose module.",[h]:"PublicPath is required in prod mode."},v=g({},y,_,E);t.BUILD_001=d,t.BUILD_002=h,t.RUNTIME_001=r,t.RUNTIME_002=n,t.RUNTIME_003=o,t.RUNTIME_004=i,t.RUNTIME_005=a,t.RUNTIME_006=s,t.RUNTIME_007=l,t.RUNTIME_008=c,t.RUNTIME_009=u,t.TYPE_001=f,t.buildDescMap=E,t.errorDescMap=v,t.getShortErrorMsg=m,t.runtimeDescMap=y,t.typeDescMap=_},85271:function(e,t,r){"use strict";var n=r(98501),o=r(47611),i=r(76523);let a="[ Federation Runtime ]",s=o.createLogger(a);function l(e,t){e||c(t)}function c(e){if(e instanceof Error)throw e.message.startsWith(a)||(e.message=`${a}: ${e.message}`),e;throw Error(`${a}: ${e}`)}function u(e){e instanceof Error&&(e.message.startsWith(a)||(e.message=`${a}: ${e.message}`)),s.warn(e)}function f(e,t){return -1===e.findIndex(e=>e===t)&&e.push(t),e}function d(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function h(e){return void 0!==e.entry}function p(e){return!e.entry.includes(".json")}async function m(e,t){try{return await e()}catch(e){t||u(e);return}}function g(e){return e&&"object"==typeof e}let y=Object.prototype.toString;function _(e){return"[object Object]"===y.call(e)}function E(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function v(e){return Array.isArray(e)?e:[e]}function b(e){let t={url:"",type:"global",globalName:""};return o.isBrowserEnv()||o.isReactNativeEnv()?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}let S=(e,t)=>{let r;return r=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),r+=t},N="object"==typeof globalThis?globalThis:window,R=(()=>{try{return document.defaultView}catch(e){return N}})(),I=R;function T(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function $(e,t){return Object.hasOwnProperty.call(e,t)}$(N,"__GLOBAL_LOADING_REMOTE_ENTRY__")||T(N,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});let A=N.__GLOBAL_LOADING_REMOTE_ENTRY__;function M(e){var t,r,n,o,i,a,s,l,c,u,f,d;$(e,"__VMOK__")&&!$(e,"__FEDERATION__")&&T(e,"__FEDERATION__",e.__VMOK__),$(e,"__FEDERATION__")||(T(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),T(e,"__VMOK__",e.__FEDERATION__)),null!=(s=(t=e.__FEDERATION__).__GLOBAL_PLUGIN__)||(t.__GLOBAL_PLUGIN__=[]),null!=(l=(r=e.__FEDERATION__).__INSTANCES__)||(r.__INSTANCES__=[]),null!=(c=(n=e.__FEDERATION__).moduleInfo)||(n.moduleInfo={}),null!=(u=(o=e.__FEDERATION__).__SHARE__)||(o.__SHARE__={}),null!=(f=(i=e.__FEDERATION__).__MANIFEST_LOADING__)||(i.__MANIFEST_LOADING__={}),null!=(d=(a=e.__FEDERATION__).__PRELOADED_MAP__)||(a.__PRELOADED_MAP__=new Map)}function w(){N.__FEDERATION__.__GLOBAL_PLUGIN__=[],N.__FEDERATION__.__INSTANCES__=[],N.__FEDERATION__.moduleInfo={},N.__FEDERATION__.__SHARE__={},N.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(A).forEach(e=>{delete A[e]})}function O(e){N.__FEDERATION__.__INSTANCES__.push(e)}function P(){return N.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.isDebugMode();t&&(N.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.19.1")}function D(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};for(let r of Object.keys(e)){let[n,o]=r.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}throw Error("key must be string")}M(N),M(R);let x=()=>R.__FEDERATION__.moduleInfo,L=(e,t)=>{let r=D(t,d(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){let{version:t}=e,r=d(n._object_without_properties_loose(e,["version"])),o=D(R.__FEDERATION__.moduleInfo,r).value;if((null==o?void 0:o.version)===t)return o}},F=e=>L(e,R.__FEDERATION__.moduleInfo),H=(e,t)=>{let r=d(e);return R.__FEDERATION__.moduleInfo[r]=t,R.__FEDERATION__.moduleInfo},j=e=>(R.__FEDERATION__.moduleInfo=n._extends({},R.__FEDERATION__.moduleInfo,e),()=>{for(let t of Object.keys(e))delete R.__FEDERATION__.moduleInfo[t]}),C=(e,t)=>{let r=t||`__FEDERATION_${e}:custom__`,n=N[r];return{remoteEntryKey:r,entryExports:n}},U=e=>{let{__GLOBAL_PLUGIN__:t}=R.__FEDERATION__;e.forEach(e=>{-1===t.findIndex(t=>t.name===e.name)?t.push(e):u(`The plugin ${e.name} has been registered.`)})},G=()=>R.__FEDERATION__.__GLOBAL_PLUGIN__,V=e=>N.__FEDERATION__.__PRELOADED_MAP__.get(e),q=e=>N.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),B="default",W="global",K="[0-9A-Za-z-]+",z=`(?:\\+(${K}(?:\\.${K})*))`,Y="0|[1-9]\\d*",X="[0-9]+",J="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Z=`(?:${X}|${J})`,Q=`(?:-?(${Z}(?:\\.${Z})*))`,ee=`(?:${Y}|${J})`,et=`(?:-(${ee}(?:\\.${ee})*))`,er=`${Y}|x|X|\\*`,en=`[v=\\s]*(${er})(?:\\.(${er})(?:\\.(${er})(?:${et})?${z}?)?)?`,eo=`^\\s*(${en})\\s+-\\s+(${en})\\s*$`,ei=`(${X})\\.(${X})\\.(${X})`,ea=`[v=\\s]*${ei}${Q}?${z}?`,es="((?:<|>)?=?)",el=`(\\s*)${es}\\s*(${ea}|${en})`,ec="(?:~>?)",eu=`(\\s*)${ec}\\s+`,ef="(?:\\^)",ed=`(\\s*)${ef}\\s+`,eh="(<|>)?=?\\s*\\*",ep=`^${ef}${en}$`,em=`(${Y})\\.(${Y})\\.(${Y})`,eg=`v?${em}${et}?${z}?`,ey=`^${ec}${en}$`,e_=`^${es}\\s*${en}$`,eE=`^${es}\\s*(${eg})$|^$`,ev="^\\s*>=\\s*0.0.0\\s*$";function eb(e){return new RegExp(e)}function eS(e){return!e||"x"===e.toLowerCase()||"*"===e}function eN(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce((e,t)=>t(e),e)}function eR(e){return e.match(eb(eE))}function eI(e,t,r,n){let o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function eT(e){return e.replace(eb(eo),(e,t,r,n,o,i,a,s,l,c,u,f)=>(t=eS(r)?"":eS(n)?`>=${r}.0.0`:eS(o)?`>=${r}.${n}.0`:`>=${t}`,s=eS(l)?"":eS(c)?`<${Number(l)+1}.0.0-0`:eS(u)?`<${l}.${Number(c)+1}.0-0`:f?`<=${l}.${c}.${u}-${f}`:`<=${s}`,`${t} ${s}`.trim()))}function e$(e){return e.replace(eb(el),"$1$2$3")}function eA(e){return e.replace(eb(eu),"$1~")}function eM(e){return e.replace(eb(ed),"$1^")}function ew(e){return e.trim().split(/\s+/).map(e=>e.replace(eb(ep),(e,t,r,n,o)=>{if(eS(t))return"";if(eS(r))return`>=${t}.0.0 <${Number(t)+1}.0.0-0`;if(eS(n))if("0"===t)return`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`;else return`>=${t}.${r}.0 <${Number(t)+1}.0.0-0`;if(o)if("0"!==t)return`>=${t}.${r}.${n}-${o} <${Number(t)+1}.0.0-0`;else if("0"===r)return`>=${t}.${r}.${n}-${o} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`;if("0"===t)if("0"===r)return`>=${t}.${r}.${n} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`;return`>=${t}.${r}.${n} <${Number(t)+1}.0.0-0`})).join(" ")}function eO(e){return e.trim().split(/\s+/).map(e=>e.replace(eb(ey),(e,t,r,n,o)=>eS(t)?"":eS(r)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:eS(n)?`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`:o?`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`:`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`)).join(" ")}function eP(e){return e.split(/\s+/).map(e=>e.trim().replace(eb(e_),(e,t,r,n,o,i)=>{let a=eS(r),s=a||eS(n),l=s||eS(o);if("="===t&&l&&(t=""),i="",a)if(">"===t||"<"===t)return"<0.0.0-0";else return"*";return t&&l?(s&&(n=0),o=0,">"===t?(t=">=",s?(r=Number(r)+1,n=0):n=Number(n)+1,o=0):"<="===t&&(t="<",s?r=Number(r)+1:n=Number(n)+1),"<"===t&&(i="-0"),`${t+r}.${n}.${o}${i}`):s?`>=${r}.0.0${i} <${Number(r)+1}.0.0-0`:l?`>=${r}.${n}.0${i} <${r}.${Number(n)+1}.0-0`:e})).join(" ")}function ek(e){return e.trim().replace(eb(eh),"")}function eD(e){return e.trim().replace(eb(ev),"")}function ex(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function eL(e,t){let{preRelease:r}=e,{preRelease:n}=t;if(void 0===r&&n)return 1;if(r&&void 0===n)return -1;if(void 0===r&&void 0===n)return 0;for(let e=0,t=r.length;e<=t;e++){let t=r[e],o=n[e];if(t!==o){if(void 0===t&&void 0===o)return 0;if(!t)return 1;if(!o)return -1;return ex(t,o)}}return 0}function eF(e,t){return ex(e.major,t.major)||ex(e.minor,t.minor)||ex(e.patch,t.patch)||eL(e,t)}function eH(e,t){return e.version===t.version}function ej(e,t){switch(e.operator){case"":case"=":return eH(e,t);case">":return 0>eF(e,t);case">=":return eH(e,t)||0>eF(e,t);case"<":return eF(e,t)>0;case"<=":return eH(e,t)||eF(e,t)>0;case void 0:return!0;default:return!1}}function eC(e){return eN(ew,eO,eP,ek)(e)}function eU(e){return eN(eT,e$,eA,eM)(e.trim()).split(/\s+/).join(" ")}function eG(e,t){if(!e)return!1;let r=eR(e);if(!r)return!1;let[,n,,o,i,a,s]=r,l={operator:n,version:eI(o,i,a,s),major:o,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};for(let e of t.split("||")){let t=e.trim();if(!t||"*"===t||"x"===t)return!0;try{let e=eU(t);if(!e.trim())return!0;let r=e.split(" ").map(e=>eC(e)).join(" ");if(!r.trim())return!0;let n=r.split(/\s+/).map(e=>eD(e)).filter(Boolean);if(0===n.length)continue;let o=!0;for(let e of n){let t=eR(e);if(!t){o=!1;break}let[,r,,n,i,a,s]=t,c={operator:r,version:eI(n,i,a,s),major:n,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};if(!ej(c,l)){o=!1;break}}if(o)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function eV(e,t,r,o){var i,a,s;let l;return l="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{throw Error(`Can not get shared '${r}'!`)}),n._extends({deps:[],useIn:[],from:t,loading:null},e,{shareConfig:n._extends({requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1},e.shareConfig),get:l,loaded:null!=e&&!!e.loaded||"lib"in e||void 0,version:null!=(i=e.version)?i:"0",scope:Array.isArray(e.scope)?e.scope:[null!=(a=e.scope)?a:"default"],strategy:(null!=(s=e.strategy)?s:o)||"version-first"})}function eq(e,t){let r=t.shared||{},o=t.name,i=Object.keys(r).reduce((e,n)=>{let i=v(r[n]);return e[n]=e[n]||[],i.forEach(r=>{e[n].push(eV(r,o,n,t.shareStrategy))}),e},{}),a=n._extends({},e.shared);return Object.keys(i).forEach(e=>{a[e]?i[e].forEach(t=>{a[e].find(e=>e.version===t.version)||a[e].push(t)}):a[e]=i[e]}),{shared:a,shareInfos:i}}function eB(e,t){let r=e=>{if(!Number.isNaN(Number(e))){let t=e.split("."),r=e;for(let e=0;e<3-t.length;e++)r+=".0";return r}return e};return!!eG(r(e),`<=${r(t)}`)}let eW=(e,t)=>{let r=t||function(e,t){return eB(e,t)};return Object.keys(e).reduce((e,t)=>!e||r(e,t)||"0"===e?t:e,0)},eK=e=>!!e.loaded||"function"==typeof e.lib,ez=e=>!!e.loading;function eY(e,t,r){let n=e[t][r],o=function(e,t){return!eK(n[e])&&eB(e,t)};return eW(e[t][r],o)}function eX(e,t,r){let n=e[t][r],o=function(e,t){let r=e=>eK(e)||ez(e);if(r(n[t]))if(r(n[e]))return!!eB(e,t);else return!0;return!r(n[e])&&eB(e,t)};return eW(e[t][r],o)}function eJ(e){return"loaded-first"===e?eX:eY}function eZ(e,t,r,n){if(!e)return;let{shareConfig:o,scope:i=B,strategy:a}=r;for(let s of Array.isArray(i)?i:[i])if(o&&e[s]&&e[s][t]){let{requiredVersion:i}=o,l=eJ(a)(e,s,t),f=()=>{if(o.singleton){if("string"==typeof i&&!eG(l,i)){let n=`Version ${l} from ${l&&e[s][t][l].from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${i})`;o.strictVersion?c(n):u(n)}return e[s][t][l]}if(!1===i||"*"===i||eG(l,i))return e[s][t][l];for(let[r,n]of Object.entries(e[s][t]))if(eG(r,i))return n},d={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:I.__FEDERATION__,resolver:f};return(n.emit(d)||d).resolver()}}function eQ(){return I.__FEDERATION__.__SHARE__}function e0(e){var t;let{pkgName:r,extraOptions:n,shareInfos:o}=e,i=e=>{if(!e)return;let t={};e.forEach(e=>{t[e.version]=e});let r=function(e,r){return!eK(t[e])&&eB(e,r)},n=eW(t,r);return t[n]};return Object.assign({},(null!=(t=null==n?void 0:n.resolver)?t:i)(o[r]),null==n?void 0:n.customShareInfo)}function e1(){return"TimeSeriesChart:0.10.1"}function e2(e,t){for(let r of e){let e=t.startsWith(r.name),n=t.replace(r.name,"");if(e){if(n.startsWith("/"))return{pkgNameOrAlias:r.name,expose:n=`.${n}`,remote:r};else if(""===n)return{pkgNameOrAlias:r.name,expose:".",remote:r}}let o=r.alias&&t.startsWith(r.alias),i=r.alias&&t.replace(r.alias,"");if(r.alias&&o){if(i&&i.startsWith("/"))return{pkgNameOrAlias:r.alias,expose:i=`.${i}`,remote:r};else if(""===i)return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function e7(e,t){for(let r of e)if(t===r.name||r.alias&&t===r.alias)return r}function e5(e,t){let r=G(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(t=>{(null==e?void 0:e.find(e=>e.name!==t.name))&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{n.forEach(r=>{r.applyPlugin(e,t)})}),e}let e9=".then(callbacks[0]).catch(callbacks[1])";async function e3(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?Function("callbacks",`import("${t}")${e9}`)([e,n]):import(t).then(e).catch(n)}catch(e){n(e)}})}async function e4(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):Function("callbacks",`System.import("${t}")${e9}`)([e,n])}catch(e){n(e)}})}function e8(e,t,r){let{remoteEntryKey:n,entryExports:o}=C(e,t);return l(o,i.getShortErrorMsg(i.RUNTIME_001,i.runtimeDescMap,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n})),o}async function e6(e){let{name:t,globalName:r,entry:n,loaderHook:a,getEntryUrl:s}=e,{entryExports:c}=C(t,r);if(c)return c;let u=s?s(n):n;return o.loadScript(u,{attrs:{},createScriptHook:(e,t)=>{let r=a.lifecycle.createScript.emit({url:e,attrs:t});if(r&&(r instanceof HTMLScriptElement||"script"in r||"timeout"in r))return r}}).then(()=>e8(t,r,n)).catch(e=>{throw l(void 0,i.getShortErrorMsg(i.RUNTIME_008,i.runtimeDescMap,{remoteName:t,resourceUrl:n})),e})}async function te(e){let{remoteInfo:t,remoteEntryExports:r,loaderHook:n,getEntryUrl:o}=e,{entry:i,entryGlobalName:a,name:s,type:l}=t;switch(l){case"esm":case"module":return e3({entry:i,remoteEntryExports:r});case"system":return e4({entry:i,remoteEntryExports:r});default:return e6({entry:i,globalName:a,name:s,loaderHook:n,getEntryUrl:o})}}async function tt(e){let{remoteInfo:t,loaderHook:r}=e,{entry:n,entryGlobalName:i,name:a,type:s}=t,{entryExports:l}=C(a,i);return l||o.loadScriptNode(n,{attrs:{name:a,globalName:i,type:s},loaderHook:{createScriptHook:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.lifecycle.createScript.emit({url:e,attrs:t});if(n&&"url"in n)return n}}}).then(()=>e8(a,i,n)).catch(e=>{throw e})}function tr(e){let{entry:t,name:r}=e;return o.composeKeyWithSeparator(r,t)}async function tn(e){let{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:i}=e,a=tr(n);if(r)return r;if(!A[a]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,s=t.loaderHook;A[a]=e.emit({loaderHook:s,remoteInfo:n,remoteEntryExports:r}).then(e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:o.isBrowserEnv())?te({remoteInfo:n,remoteEntryExports:r,loaderHook:s,getEntryUrl:i}):tt({remoteInfo:n,loaderHook:s})))}return A[a]}function to(e){return n._extends({},e,{entry:"entry"in e?e.entry:"",type:e.type||W,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||B})}function ti(e){return n._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},e)}function ta(e,t){return t.map(t=>{let r=e7(e,t.nameOrAlias);return l(r,`Unable to preload ${t.nameOrAlias} as it is not included in ${!r&&o.safeToString({remoteInfo:r,remotes:e})}`),{remote:r,preloadConfig:ti(t)}})}function ts(e){return e?e.map(e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e):[]}function tl(e,t,r){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:s}=r;if(t.options.inBrowser){if(s.forEach(r=>{let{moduleInfo:n}=r,o=t.moduleCache.get(e.name);o?tn({origin:t,remoteInfo:n,remoteEntryExports:o.remoteEntryExports}):tn({origin:t,remoteInfo:n,remoteEntryExports:void 0})}),n){let e={rel:"preload",as:"style"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let e={rel:"stylesheet",type:"text/css"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n},needDeleteLink:!1});i&&document.head.appendChild(n)})}if(n){let e={rel:"preload",as:"script"};a.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let r={fetchpriority:"high",type:(null==e?void 0:e.type)==="module"?"module":"text/javascript"};a.forEach(e=>{let{script:n,needAttach:i}=o.createScript({url:e,cb:()=>{},attrs:r,createScriptHook:(e,r)=>{let n=t.loaderHook.lifecycle.createScript.emit({url:e,attrs:r});if(n instanceof HTMLScriptElement)return n},needDeleteScript:!0});i&&document.head.appendChild(n)})}}}var tc={global:{Global:I,nativeGlobal:R,resetFederationGlobalInfo:w,setGlobalFederationInstance:O,getGlobalFederationConstructor:P,setGlobalFederationConstructor:k,getInfoWithoutType:D,getGlobalSnapshot:x,getTargetSnapshotInfoByModuleInfo:L,getGlobalSnapshotInfoByModuleInfo:F,setGlobalSnapshotInfoByModuleInfo:H,addGlobalSnapshot:j,getRemoteEntryExports:C,registerGlobalPlugins:U,getGlobalHostPlugins:G,getPreloaded:V,setPreloaded:q},share:{getRegisteredShare:eZ,getGlobalShareScope:eQ},utils:{matchRemoteWithNameAndExpose:e2,preloadAssets:tl,getRemoteInfo:to}};let tu=class{async getEntry(){let e;if(this.remoteEntryExports)return this.remoteEntryExports;try{e=await tn({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(r){let t=tr(this.remoteInfo);r instanceof Error&&r.message.includes(i.RUNTIME_008)&&(e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:tn,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading:A,uniqueKey:t}))}return l(e,`remoteEntryExports is undefined
|
|
3
|
+
${o.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,t,r,o){let a,{loadFactory:s=!0}=r||{loadFactory:!0},u=await this.getEntry();if(!this.inited){let t=this.host.shareScopeMap,r=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];r.length||r.push("default"),r.forEach(e=>{t[e]||(t[e]={})});let a=t[r[0]],s=[],l={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?r:this.remoteInfo.shareScope||"default"};Object.defineProperty(l,"shareScopeMap",{value:t,enumerable:!1});let f=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:l,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});void 0===(null==u?void 0:u.init)&&c(i.getShortErrorMsg(i.RUNTIME_002,i.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await u.init(f.shareScope,f.initScope,f.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(n._extends({},f,{id:e,remoteSnapshot:o,remoteEntryExports:u}))}this.lib=u,this.inited=!0,(a=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:u,expose:t,moduleInfo:this.remoteInfo}))||(a=await u.get(t)),l(a,`${d(this.remoteInfo)} remote don't export ${t}.`);let f=S(this.remoteInfo.name,t),h=this.wraperFactory(a,f);return s?await h():h}wraperFactory(e,t){function r(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return e instanceof Promise?async()=>{let n=await e();return r(n,t),n}:()=>{let n=e();return r(n,t),n}}constructor({remoteInfo:e,host:t}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}};class tf{on(e){"function"==typeof e&&this.listeners.add(e)}once(e){let t=this;this.on(function r(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.remove(r),e.apply(null,o)})}emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.listeners.size>0&&this.listeners.forEach(t=>{e=t(...r)}),e}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class td extends tf{emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=Array.from(this.listeners);if(o.length>0){let t=0,n=e=>!1!==e&&(t<o.length?Promise.resolve(o[t++].apply(null,r)).then(n):e);e=n()}return Promise.resolve(e)}}function th(e,t){if(!g(t))return!1;if(e!==t){for(let r in e)if(!(r in t))return!1}return!0}class tp extends tf{emit(e){for(let t of(g(e)||c(`The data for the "${this.type}" hook should be an object.`),this.listeners))try{let r=t(e);if(th(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){u(e),this.onerror(e)}return e}constructor(e){super(),this.onerror=c,this.type=e}}class tm extends tf{emit(e){g(e)||c(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let r=0,n=t=>(u(t),this.onerror(t),e),o=i=>{if(th(e,i)){if(e=i,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(e){return n(e)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=c,this.type=e}}class tg{applyPlugin(e,t){l(_(e),"Plugin configuration is invalid.");let r=e.name;l(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,null==e.apply||e.apply.call(e,t),Object.keys(this.lifecycle).forEach(t=>{let r=e[t];r&&this.lifecycle[t].on(r)}))}removePlugin(e){l(e,"A name is required.");let t=this.registerPlugins[e];l(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{"name"!==e&&this.lifecycle[e].remove(t[e])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function ty(e,t){let r=b(t);r.url||c(`The attribute remoteEntry of ${e.name} must not be undefined.`);let n=o.getResourceUrl(t,r.url);o.isBrowserEnv()||n.startsWith("http")||(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function t_(){return{name:"snapshot-plugin",async afterResolve(e){let{remote:t,pkgNameOrAlias:r,expose:o,origin:i,remoteInfo:a,id:s}=e;if(!h(t)||!p(t)){let{remoteSnapshot:l,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:s});ty(a,l);let u={remote:t,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},f=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:u,remoteInfo:a,remote:t,remoteSnapshot:l,globalSnapshot:c});return f&&tl(a,i,f,!1),n._extends({},e,{remoteSnapshot:l})}return e}}}function tE(e){let t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function tv(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5?arguments[5]:void 0,{value:s}=D(e,d(t)),l=a||s;if(l&&!o.isManifestProvider(l)&&(r(l,t,n),l.remotesInfo))for(let t of Object.keys(l.remotesInfo)){if(i[t])continue;i[t]=!0;let n=tE(t),o=l.remotesInfo[t];tv(e,{name:n.name,version:o.matchedVersion},r,!1,i,void 0)}}let tb=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function tS(e,t,r,n,i){let a=[],s=[],l=[],c=new Set,u=new Set,{options:f}=e,{preloadConfig:d}=t,{depsRemote:h}=d;if(tv(n,r,(t,r,n)=>{let i;if(n)i=d;else if(Array.isArray(h)){let e=h.find(e=>e.nameOrAlias===r.name||e.nameOrAlias===r.alias);if(!e)return;i=ti(e)}else{if(!0!==h)return;i=d}let c=o.getResourceUrl(t,b(t).url);c&&l.push({name:r.name,moduleInfo:{name:r.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:r.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let u="modules"in t?t.modules:[],f=ts(i.exposes);if(f.length&&"modules"in t){var p;u=null==t||null==(p=t.modules)?void 0:p.reduce((e,t)=>((null==f?void 0:f.indexOf(t.moduleName))!==-1&&e.push(t),e),[])}function m(e){let r=e.map(e=>o.getResourceUrl(t,e));return i.filter?r.filter(i.filter):r}if(u){let n=u.length;for(let o=0;o<n;o++){let n=u[o],l=`${r.name}/${n.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===n.moduleName?r.name:l,name:r.name,remoteSnapshot:t,preloadConfig:i,remote:r,origin:e}),V(l)||("all"===i.resourceCategory?(a.push(...m(n.assets.css.async)),a.push(...m(n.assets.css.sync)),s.push(...m(n.assets.js.async))):(i.resourceCategory="sync",a.push(...m(n.assets.css.sync))),s.push(...m(n.assets.js.sync)),q(l))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,r)=>{let n=eZ(e.shareScopeMap,r.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare);n&&"function"==typeof n.lib&&(r.assets.js.sync.forEach(e=>{c.add(e)}),r.assets.css.sync.forEach(e=>{u.add(e)}))};i.shared.forEach(e=>{var r;let n=null==(r=f.shared)?void 0:r[e.sharedName];if(!n)return;let o=e.version?n.find(t=>t.version===e.version):n;o&&v(o).forEach(r=>{t(r,e)})})}let p=s.filter(e=>!c.has(e)&&!tb("script",e));return{cssAssets:a.filter(e=>!u.has(e)&&!tb("link",e)),jsAssetsWithoutEntry:p,entryAssets:l.filter(e=>!tb("script",e.url))}}let tN=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){let{origin:t,preloadOptions:r,remoteInfo:n,remote:i,globalSnapshot:a,remoteSnapshot:s}=e;return o.isBrowserEnv()?h(i)&&p(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:n.name,entry:i.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(ty(n,s),tS(t,r,n,a,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function tR(e,t){let r=F({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&D(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:"version"in e?e.version:void 0})}}class tI{async loadRemoteSnapshotInfo(e){let t,r,{moduleInfo:a,id:s,expose:l}=e,{options:u}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:u,moduleInfo:a});let f=F({name:this.HostInstance.options.name,version:this.HostInstance.options.version});f||(f={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},j({[this.HostInstance.options.name]:f})),f&&"remotesInfo"in f&&!D(f.remotesInfo,a.name).value&&("version"in a||"entry"in a)&&(f.remotesInfo=n._extends({},null==f?void 0:f.remotesInfo,{[a.name]:{matchedVersion:"version"in a?a.version:a.entry}}));let{hostGlobalSnapshot:d,remoteSnapshot:p,globalSnapshot:m}=this.getGlobalRemoteInfo(a),{remoteSnapshot:g,globalSnapshot:y}=await this.hooks.lifecycle.loadSnapshot.emit({options:u,moduleInfo:a,hostGlobalSnapshot:d,remoteSnapshot:p,globalSnapshot:m});if(g)if(o.isManifestProvider(g)){let e=o.isBrowserEnv()?g.remoteEntry:g.ssrRemoteEntry||g.remoteEntry||"",i=await this.getManifestJson(e,a,{}),s=H(n._extends({},a,{entry:e}),i);t=i,r=s}else{let{remoteSnapshot:e}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:g,from:"global"});t=e,r=y}else if(h(a)){let e=await this.getManifestJson(a.entry,a,{}),n=H(a,e),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:e,from:"global"});t=o,r=n}else c(i.getShortErrorMsg(i.RUNTIME_007,i.runtimeDescMap,{hostName:a.name,hostVersion:a.version,globalSnapshot:JSON.stringify(y)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:s,host:this.HostInstance,options:u,moduleInfo:a,remoteSnapshot:t}),{remoteSnapshot:t,globalSnapshot:r}}getGlobalRemoteInfo(e){return tR(e,this.HostInstance)}async getManifestJson(e,t,r){let n=async()=>{let r=this.manifestCache.get(e);if(r)return r;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{});t&&t instanceof Response||(t=await fetch(e,{})),r=await t.json()}catch(n){(r=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}))||(delete this.manifestLoading[e],c(i.getShortErrorMsg(i.RUNTIME_003,i.runtimeDescMap,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${n}`)))}return l(r.metaData&&r.exposes&&r.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,r),r},a=async()=>{let r=await n(),i=o.generateSnapshotFromManifest(r,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:r,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new tg({beforeLoadRemoteSnapshot:new td("beforeLoadRemoteSnapshot"),loadSnapshot:new tm("loadGlobalSnapshot"),loadRemoteSnapshot:new tm("loadRemoteSnapshot"),afterLoadSnapshot:new tm("afterLoadSnapshot")}),this.manifestLoading=I.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}class tT{registerShared(e,t){let{shareInfos:r,shared:n}=eq(e,t);return Object.keys(r).forEach(e=>{r[e].forEach(r=>{!eZ(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)&&r&&r.lib&&this.setShared({pkgName:e,lib:r.lib,get:r.get,loaded:!0,shared:r,from:t.name})})}),{shareInfos:r,shared:n}}async loadShare(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&await Promise.all(n.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:n.strategy}))}));let{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});l(o,`Cannot find ${e} Share in the ${r.options.name}. Please ensure that the ${e} Share parameters have been injected`);let i=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),f(e.useIn,r.options.name)};if(i&&i.lib)return a(i),i.lib;if(i&&i.loading&&!i.loaded){let e=await i.loading;return i.loaded=!0,i.lib||(i.lib=e),a(i),e}if(i){let t=(async()=>{let e=await i.get();return a(i),i.loaded=!0,i.lib=e,e})();return this.setShared({pkgName:e,loaded:!1,shared:i,from:r.options.name,lib:null,loading:t}),t}{if(null==t?void 0:t.customShareInfo)return!1;let n=(async()=>{let t=await o.get();o.lib=t,o.loaded=!0,a(o);let r=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare);return r&&(r.lib=t,r.loaded=!0,r.from=o.from),t})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:n}),n}}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0,{host:r}=this,n=null==t?void 0:t.from,o=null==t?void 0:t.strategy,i=null==t?void 0:t.initScope,a=[];if("build"!==n){let{initTokens:t}=this;i||(i=[]);let r=t[e];if(r||(r=t[e]={from:this.host.name}),i.indexOf(r)>=0)return a;i.push(r)}let s=this.shareScopeMap,l=r.options.name;s[e]||(s[e]={});let c=s[e],u=(e,t)=>{var r;let{version:n,eager:o}=t;c[e]=c[e]||{};let i=c[e],a=i[n],s=!!(a&&(a.eager||(null==(r=a.shareConfig)?void 0:r.eager)));(!a||"loaded-first"!==a.strategy&&!a.loaded&&(!o!=!s?o:l>a.from))&&(i[n]=t)},f=t=>t&&t.init&&t.init(s[e],i),d=async e=>{let{module:t}=await r.remoteHandler.getRemoteModuleAndOptions({id:e});if(t.getEntry){let n;try{n=await t.getEntry()}catch(t){n=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:t,from:"runtime",lifecycle:"beforeLoadShare",origin:r})}t.inited||(await f(n),t.inited=!0)}};return Object.keys(r.options.shared).forEach(t=>{r.options.shared[t].forEach(r=>{r.scope.includes(e)&&u(t,r)})}),("version-first"===r.options.shareStrategy||"version-first"===o)&&r.options.remotes.forEach(t=>{t.shareScope===e&&a.push(d(t.name))}),a}loadShareSync(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&n.scope.forEach(e=>{this.initializeSharing(e,{strategy:n.strategy})});let o=eZ(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),f(e.useIn,r.options.name)};if(o){if("function"==typeof o.lib)return a(o),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if("function"==typeof o.get){let t=o.get();if(!(t instanceof Promise))return a(o),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:t,shared:o}),t}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){let o=n.get();if(o instanceof Promise){let n=(null==t?void 0:t.from)==="build"?i.RUNTIME_005:i.RUNTIME_006;throw Error(i.getShortErrorMsg(n,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}return n.lib=o,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}throw Error(i.getShortErrorMsg(i.RUNTIME_006,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared(e){let{pkgName:t,shared:r,from:o,lib:i,loading:a,loaded:s,get:l}=e,{version:c,scope:u="default"}=r,f=n._object_without_properties_loose(r,["version","scope"]);(Array.isArray(u)?u:[u]).forEach(e=>{if(this.shareScopeMap[e]||(this.shareScopeMap[e]={}),this.shareScopeMap[e][t]||(this.shareScopeMap[e][t]={}),!this.shareScopeMap[e][t][c]){this.shareScopeMap[e][t][c]=n._extends({version:c,scope:["default"]},f,{lib:i,loaded:s,loading:a}),l&&(this.shareScopeMap[e][t][c].get=l);return}let r=this.shareScopeMap[e][t][c];a&&!r.loading&&(r.loading=a),s&&!r.loaded&&(r.loaded=s),o&&r.from!==o&&(r.from=o)})}_setGlobalShareScopeMap(e){let t=eQ(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}constructor(e){this.hooks=new tg({afterResolve:new tm("afterResolve"),beforeLoadShare:new tm("beforeLoadShare"),loadShare:new td,resolveShare:new tp("resolveShare"),initContainerShareScopeMap:new tp("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}}class t${formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:r,expose:n}=t,{name:o,alias:i}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},i&&e.startsWith(o)){let t=e.replace(o,i);this.idToRemoteMap[t]={name:r.name,expose:n};return}if(i&&e.startsWith(i)){let t=e.replace(i,o);this.idToRemoteMap[t]={name:r.name,expose:n}}}async loadRemote(e,t){let{host:r}=this;try{let{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:i,remoteMatchInfo:a}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:s,remote:l,expose:c,id:u,remoteSnapshot:f}=a,d=await o.get(u,c,t,f),h=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:s,expose:c,exposeModule:n?d:void 0,exposeModuleFactory:n?void 0:d,remote:l,options:i,moduleInstance:o,origin:r});if(this.setIdToRemoteMap(e,a),"function"==typeof h)return h;return d}catch(i){let{from:n="runtime"}=t||{from:"runtime"},o=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:n,lifecycle:"onLoad",origin:r});if(!o)throw i;return o}}async preloadRemote(e){let{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=ta(t.options.remotes,e);await Promise.all(r.map(async e=>{let{remote:r}=e,n=to(r),{globalSnapshot:o,remoteSnapshot:i}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:r}),a=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:e,remote:r,remoteInfo:n,globalSnapshot:o,remoteSnapshot:i});a&&tl(n,t,a)}))}registerRemotes(e,t){let{host:r}=this;e.forEach(e=>{this.registerRemote(e,r.options.remotes,{force:null==t?void 0:t.force})})}async getRemoteModuleAndOptions(e){let t,{host:r}=this,{id:o}=e;try{t=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(e){if(!(t=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:e,lifecycle:"beforeRequest"})))throw e}let{id:a}=t,s=e2(r.options.remotes,a);l(s,i.getShortErrorMsg(i.RUNTIME_004,i.runtimeDescMap,{hostName:r.options.name,requestId:a}));let{remote:c}=s,u=to(c),f=await r.sharedHandler.hooks.lifecycle.afterResolve.emit(n._extends({id:a},s,{options:r.options,origin:r,remoteInfo:u})),{remote:d,expose:h}=f;l(d&&h,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let p=r.moduleCache.get(d.name),m={host:r,remoteInfo:u};return p||(p=new tu(m),r.moduleCache.set(d.name,p)),{module:p,moduleOptions:m,remoteMatchInfo:f}}registerRemote(e,t,r){let{host:n}=this,i=()=>{if(e.alias){let r=t.find(t=>{var r;return e.alias&&(t.name.startsWith(e.alias)||(null==(r=t.alias)?void 0:r.startsWith(e.alias)))});l(!r,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${r&&r.name} name or alias`)}"entry"in e&&o.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=B),e.type||(e.type=W)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});let a=t.find(t=>t.name===e.name);if(a){let s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];(null==r?void 0:r.force)&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),o.warn(s.join(" ")))}else i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n})}removeRemote(e){try{let{host:r}=this,{name:n}=e,i=r.options.remotes.findIndex(e=>e.name===n);-1!==i&&r.options.remotes.splice(i,1);let a=r.moduleCache.get(e.name);if(a){let n=a.remoteInfo,i=n.entryGlobalName;if(N[i]){var t;(null==(t=Object.getOwnPropertyDescriptor(N,i))?void 0:t.configurable)?delete N[i]:N[i]=void 0}let s=tr(a.remoteInfo);A[s]&&delete A[s],r.snapshotHandler.manifestCache.delete(n.entry);let l=n.buildVersion?o.composeKeyWithSeparator(n.name,n.buildVersion):n.name,c=N.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===l:e.name===l);if(-1!==c){let e=N.__FEDERATION__.__INSTANCES__[c];l=e.options.id||l;let t=eQ(),r=!0,o=[];Object.keys(t).forEach(e=>{let i=t[e];i&&Object.keys(i).forEach(t=>{let a=i[t];a&&Object.keys(a).forEach(i=>{let s=a[i];s&&Object.keys(s).forEach(a=>{let l=s[a];l&&"object"==typeof l&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:o.push([e,t,i,a])):o.push([e,t,i,a]))})})})}),r&&(e.shareScopeMap={},delete t[l]),o.forEach(e=>{var r,n,o;let[i,a,s,l]=e;null==(o=t[i])||null==(n=o[a])||null==(r=n[s])||delete r[l]}),N.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:u}=tR(e,r);if(u){let t=u&&"remotesInfo"in u&&u.remotesInfo&&D(u.remotesInfo,e.name).key;t&&(delete u.remotesInfo[t],I.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete I.__FEDERATION__.__MANIFEST_LOADING__[t])}r.moduleCache.delete(e.name)}}catch(e){s.log("removeRemote fail: ",e)}}constructor(e){this.hooks=new tg({beforeRegisterRemote:new tp("beforeRegisterRemote"),registerRemote:new tp("registerRemote"),beforeRequest:new tm("beforeRequest"),onLoad:new td("onLoad"),handlePreloadModule:new tf("handlePreloadModule"),errorLoadRemote:new td("errorLoadRemote"),beforePreloadRemote:new td("beforePreloadRemote"),generatePreloadAssets:new td("generatePreloadAssets"),afterPreloadRemote:new td,loadEntry:new td}),this.host=e,this.idToRemoteMap={}}}let tA=!0;class tM{initOptions(e){this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0;return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){let n=new tu({host:this,remoteInfo:to({name:e,entry:t})});return n.remoteEntryExports=r,this.moduleCache.set(e,n),n}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){let{shared:r}=eq(e,t),{userOptions:o,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),a=this.remoteHandler.formatAndRegisterRemote(i,o),{shared:s}=this.sharedHandler.registerShared(i,o),l=[...i.plugins];o.plugins&&o.plugins.forEach(e=>{l.includes(e)||l.push(e)});let c=n._extends({},e,t,{plugins:l,remotes:a,shared:s});return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){let t=e5(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,n._extends({},this.options,{shared:e}))}constructor(e){this.hooks=new tg({beforeInit:new tp("beforeInit"),init:new tf,beforeInitContainer:new tm("beforeInitContainer"),initContainer:new tm("initContainer")}),this.version="0.19.1",this.moduleCache=new Map,this.loaderHook=new tg({getModuleInfo:new tf,createScript:new tf,createLink:new tf,fetch:new td,loadEntryError:new td,getModuleFactory:new td}),this.bridgeHook=new tg({beforeBridgeRender:new tf,afterBridgeRender:new tf,beforeBridgeDestroy:new tf,afterBridgeDestroy:new tf});let t=tA?[t_(),tN()]:[],r={id:e1(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:o.isBrowserEnv()};this.name=e.name,this.options=r,this.snapshotHandler=new tI(this),this.sharedHandler=new tT(this),this.remoteHandler=new t$(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}}var tw=Object.freeze({__proto__:null});t.loadScript=o.loadScript,t.loadScriptNode=o.loadScriptNode,t.CurrentGlobal=N,t.Global=I,t.Module=tu,t.ModuleFederation=tM,t.addGlobalSnapshot=j,t.assert=l,t.getGlobalFederationConstructor=P,t.getGlobalSnapshot=x,t.getInfoWithoutType=D,t.getRegisteredShare=eZ,t.getRemoteEntry=tn,t.getRemoteInfo=to,t.helpers=tc,t.isStaticResourcesEqual=E,t.matchRemoteWithNameAndExpose=e2,t.registerGlobalPlugins=U,t.resetFederationGlobalInfo=w,t.safeWrapper=m,t.satisfy=eG,t.setGlobalFederationConstructor=k,t.setGlobalFederationInstance=O,t.types=tw},98501:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}t._extends=r,t._object_without_properties_loose=n},21300:function(e,t,r){"use strict";var n=r(85271),o=r(76523),i=r(37087);function a(e){let t=new(n.getGlobalFederationConstructor()||n.ModuleFederation)(e);return n.setGlobalFederationInstance(t),t}let s=null;function l(e){let t=i.getGlobalFederationInstance(e.name,e.version);return t?(t.initOptions(e),s||(s=t),t):s=a(e)}function c(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadRemote.apply(s,t)}function u(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShare.apply(s,t)}function f(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShareSync.apply(s,t)}function d(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.preloadRemote.apply(s,t)}function h(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerRemotes.apply(s,t)}function p(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerPlugins.apply(s,t)}function m(){return s}function g(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerShared.apply(s,t)}n.setGlobalFederationConstructor(n.ModuleFederation),t.Module=n.Module,t.ModuleFederation=n.ModuleFederation,t.getRemoteEntry=n.getRemoteEntry,t.getRemoteInfo=n.getRemoteInfo,t.loadScript=n.loadScript,t.loadScriptNode=n.loadScriptNode,t.registerGlobalPlugins=n.registerGlobalPlugins,t.createInstance=a,t.getInstance=m,t.init=l,t.loadRemote=c,t.loadShare=u,t.loadShareSync=f,t.preloadRemote=d,t.registerPlugins=p,t.registerRemotes=h,t.registerShared=g},37087:function(e,t,r){"use strict";var n=r(85271);function o(){return"TimeSeriesChart:0.10.1"}t.getGlobalFederationInstance=function(e,t){let r=o();return n.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&!!t&&n.options.version===t)}},47611:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var polyfills=__webpack_require__(92303);let FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return"undefined"!=typeof window&&void 0!==window.document}function isReactNativeEnv(){var e;return"undefined"!=typeof navigator&&(null==(e=navigator)?void 0:e.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch(e){}return!1}function isDebugMode(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:!!("undefined"!=typeof FEDERATION_DEBUG&&FEDERATION_DEBUG)||isBrowserDebug()}let getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SEPARATOR,n=e.split(r),o="development"===getProcessEnv().NODE_ENV&&t,i="*",a=e=>e.startsWith("http")||e.includes(MANIFEST_EXT);if(n.length>=2){let[t,...s]=n;e.startsWith(r)&&(t=n.slice(0,2).join(r),s=[o||n.slice(2).join(r)]);let l=o||s.join(r);return a(l)?{name:t,entry:l}:{name:t,version:l||i}}if(1===n.length){let[e]=n;return o&&a(o)?{name:e,entry:o}:{name:e,version:o||i}}throw`Invalid entry value: ${e}`},composeKeyWithSeparator=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length?t.reduce((e,t)=>t?e?`${e}${SEPARATOR}${t}`:t:e,""):""},encodeName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=r?".js":"";return`${t}${e.replace(RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${n}`}catch(e){throw e}},decodeName=function(e,t,r){try{let n=e;if(t){if(!n.startsWith(t))return n;n=n.replace(RegExp(t,"g"),"")}return n=n.replace(RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(e){throw e}},generateExposeFilename=(e,t)=>{if(!e)return"";let r=e;return"."===r&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",t)},generateShareFilename=(e,t)=>e?encodeName(e,"__federation_shared_",t):"",getResourceUrl=(e,t)=>{if("getPublicPath"in e){let r;return r=e.getPublicPath.startsWith("function")?Function("return "+e.getPublicPath)()():Function(e.getPublicPath)(),`${r}${t}`}return"publicPath"in e?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in e?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},assert=(e,t)=>{e||error(t)},error=e=>{throw Error(`${LOG_CATEGORY}: ${e}`)},warn=e=>{console.warn(`${LOG_CATEGORY}: ${e}`)};function safeToString(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(e){return VERSION_PATTERN_REGEXP.test(e)}let simpleJoinRemoteEntry=(e,t)=>{if(!e)return t;let r=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){let t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(e){var t,r,n;let o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{remotes:a={},overrides:s={},version:l}=i,c=()=>"publicPath"in e.metaData?"auto"===e.metaData.publicPath&&l?inferAutoPublicPath(l):e.metaData.publicPath:e.metaData.getPublicPath,u=Object.keys(s),f={};Object.keys(a).length||(f=(null==(n=e.remotes)?void 0:n.reduce((e,t)=>{let r,n=t.federationContainerName;return r=u.includes(n)?s[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:r},e},{}))||{}),Object.keys(a).forEach(e=>f[e]={matchedVersion:u.includes(e)?s[e]:a[e]});let{remoteEntry:{path:d,name:h,type:p},types:m,buildInfo:{buildVersion:g},globalName:y,ssrRemoteEntry:_}=e.metaData,{exposes:E}=e,v={version:l||"",buildVersion:g,globalName:y,remoteEntry:simpleJoinRemoteEntry(d,h),remoteEntryType:p,remoteTypes:simpleJoinRemoteEntry(m.path,m.name),remoteTypesZip:m.zip||"",remoteTypesAPI:m.api||"",remotesInfo:f,shared:null==e?void 0:e.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version})),modules:null==E?void 0:E.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(null==(t=e.metaData)?void 0:t.prefetchInterface){let t=e.metaData.prefetchInterface;v=polyfills._({},v,{prefetchInterface:t})}if(null==(r=e.metaData)?void 0:r.prefetchEntry){let{path:t,name:r,type:n}=e.metaData.prefetchEntry;v=polyfills._({},v,{prefetchEntry:simpleJoinRemoteEntry(t,r),prefetchEntryType:n})}return o="publicPath"in e.metaData?polyfills._({},v,{publicPath:c(),ssrPublicPath:e.metaData.ssrPublicPath}):polyfills._({},v,{getPublicPath:c()}),_&&(o.ssrRemoteEntry=simpleJoinRemoteEntry(_.path,_.name),o.ssrRemoteEntryType=_.type||"commonjs-module"),o}function isManifestProvider(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(MANIFEST_EXT))}let PREFIX="[ Module Federation ]",Logger=class{setPrefix(e){this.prefix=e}log(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}success(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}info(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}ready(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}debug(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];isDebugMode()&&console.log(this.prefix,...t)}constructor(e){this.prefix=e}};function createLogger(e){return new Logger(e)}let logger=createLogger(PREFIX);async function safeWrapper(e,t){try{return await e()}catch(e){t||warn(e);return}}function isStaticResourcesEqual(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function createScript(e){let t,r=null,n=!0,o=2e4,i=document.getElementsByTagName("script");for(let t=0;t<i.length;t++){let o=i[t],a=o.getAttribute("src");if(a&&isStaticResourcesEqual(a,e.url)){r=o,n=!1;break}}if(!r){let t,n=e.attrs;(r=document.createElement("script")).type=(null==n?void 0:n.type)==="module"?"module":"text/javascript",e.createScriptHook&&((t=e.createScriptHook(e.url,e.attrs))instanceof HTMLScriptElement?r=t:"object"==typeof t&&("script"in t&&t.script&&(r=t.script),"timeout"in t&&t.timeout&&(o=t.timeout))),r.src||(r.src=e.url),n&&!t&&Object.keys(n).forEach(e=>{r&&("async"===e||"defer"===e?r[e]=n[e]:r.getAttribute(e)||r.setAttribute(e,n[e]))})}let a=async(n,o)=>{clearTimeout(t);let i=()=>{(null==o?void 0:o.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(o)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(r&&(r.onerror=null,r.onload=null,safeWrapper(()=>{let{needDeleteScript:t=!0}=e;t&&(null==r?void 0:r.parentNode)&&r.parentNode.removeChild(r)}),n&&"function"==typeof n)){let e=n(o);if(e instanceof Promise){let t=await e;return i(),t}return i(),e}i()};return r.onerror=a.bind(null,r.onerror),r.onload=a.bind(null,r.onload),t=setTimeout(()=>{a(null,Error(`Remote script "${e.url}" time-outed.`))},o),{script:r,needAttach:n}}function createLink(e){let t=null,r=!0,n=document.getElementsByTagName("link");for(let o=0;o<n.length;o++){let i=n[o],a=i.getAttribute("href"),s=i.getAttribute("rel");if(a&&isStaticResourcesEqual(a,e.url)&&s===e.attrs.rel){t=i,r=!1;break}}if(!t){let r;(t=document.createElement("link")).setAttribute("href",e.url);let n=e.attrs;e.createLinkHook&&(r=e.createLinkHook(e.url,n))instanceof HTMLLinkElement&&(t=r),n&&!r&&Object.keys(n).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,n[e])})}let o=(r,n)=>{let o=()=>{(null==n?void 0:n.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(n)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{let{needDeleteLink:r=!0}=e;r&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}),r)){let e=r(n);return o(),e}o()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function loadScript(e,t){let{attrs:r={},createScriptHook:n}=t;return new Promise((t,o)=>{let{script:i,needAttach:a}=createScript({url:e,cb:t,onErrorCallback:o,attrs:polyfills._({fetchpriority:"high"},r),createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}let sdkImportCache=new Map;function importNodeModule(e){if(!e)throw Error("import specifier is required");if(sdkImportCache.has(e))return sdkImportCache.get(e);let t=Function("name","return import(name)")(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),sdkImportCache.delete(e),t});return sdkImportCache.set(e,t),t}let loadNodeFetch=async()=>{let e=await importNodeModule("node-fetch");return e.default||e},lazyLoaderHookFetch=async(e,t,r)=>{let n=(e,t)=>r.lifecycle.fetch.emit(e,t),o=await n(e,t||{});return o&&o instanceof Response?o:("undefined"==typeof fetch?await loadNodeFetch():fetch)(e,t||{})},createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{let urlObj;if(null==loaderHook?void 0:loaderHook.createScriptHook){let hookResult=loaderHook.createScriptHook(url);hookResult&&"object"==typeof hookResult&&"url"in hookResult&&(url=hookResult.url)}try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e),cb(Error(`Invalid URL: ${e}`));return}let getFetch=async()=>(null==loaderHook?void 0:loaderHook.fetch)?(e,t)=>lazyLoaderHookFetch(e,t,loaderHook):"undefined"==typeof fetch?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants,_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;let res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
4
|
+
})`,{filename,importModuleDynamically:null!=(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=null==(_vm_constants=vm.constants)?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);let exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){let container=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,container);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:Error(`Script execution error: ${e}`))}};getFetch().then(async e=>{if((null==attrs?void 0:attrs.type)==="esm"||(null==attrs?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:e,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:Error(`Script execution error: ${e}`))});handleScriptFetch(e,urlObj)}).catch(e=>{cb(e)})}:(e,t,r,n)=>{t(Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise((r,n)=>{createScriptNode(e,(e,o)=>{if(e)n(e);else{var i,a;let e=(null==t||null==(i=t.attrs)?void 0:i.globalName)||`__FEDERATION_${null==t||null==(a=t.attrs)?void 0:a.name}:custom__`;r(globalThis[e]=o)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(e,t){if(esmModuleCache.has(e))return esmModuleCache.get(e);let{fetch:r,vm:n}=t,o=await r(e),i=await o.text(),a=new n.SourceTextModule(i,{importModuleDynamically:async(r,n)=>loadModule(new URL(r,e).href,t)});return esmModuleCache.set(e,a),await a.link(async r=>{let n=new URL(r,e).href;return await loadModule(n,t)}),a}function normalizeOptions(e,t,r){return function(n){if(!1===n)return!1;if(void 0===n)if(e)return t;else return!1;if(!0===n)return t;if(n&&"object"==typeof n)return polyfills._({},t,n);throw Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}let createModuleFederationConfig=e=>e;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.MFPrefetchCommon=MFPrefetchCommon,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.assert=assert,exports.composeKeyWithSeparator=composeKeyWithSeparator,exports.containerPlugin=ContainerPlugin,exports.containerReferencePlugin=ContainerReferencePlugin,exports.createLink=createLink,exports.createLogger=createLogger,exports.createModuleFederationConfig=createModuleFederationConfig,exports.createScript=createScript,exports.createScriptNode=createScriptNode,exports.decodeName=decodeName,exports.encodeName=encodeName,exports.error=error,exports.generateExposeFilename=generateExposeFilename,exports.generateShareFilename=generateShareFilename,exports.generateSnapshotFromManifest=generateSnapshotFromManifest,exports.getProcessEnv=getProcessEnv,exports.getResourceUrl=getResourceUrl,exports.inferAutoPublicPath=inferAutoPublicPath,exports.isBrowserEnv=isBrowserEnv,exports.isDebugMode=isDebugMode,exports.isManifestProvider=isManifestProvider,exports.isReactNativeEnv=isReactNativeEnv,exports.isRequiredVersion=isRequiredVersion,exports.isStaticResourcesEqual=isStaticResourcesEqual,exports.loadScript=loadScript,exports.loadScriptNode=loadScriptNode,exports.logger=logger,exports.moduleFederationPlugin=ModuleFederationPlugin,exports.normalizeOptions=normalizeOptions,exports.parseEntry=parseEntry,exports.safeToString=safeToString,exports.safeWrapper=safeWrapper,exports.sharePlugin=SharePlugin,exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry,exports.warn=warn},92303:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t._=r},2721:function(e,t){"use strict";t.FEDERATION_SUPPORTED_TYPES=["script"]},51490:function(e,t,r){"use strict";var n=r(21300),o=r(2721),i=r(58576);function a(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}function s(e){let{chunkId:t,promises:r,chunkMapping:n,idToExternalAndNameMapping:s,webpackRequire:l,idToRemoteMap:c}=e;a(l),l.o(n,t)&&n[t].forEach(e=>{let t=l.R;t||(t=[]);let n=s[e],a=c[e];if(t.indexOf(n)>=0)return;if(t.push(n),n.p)return r.push(n.p);let u=t=>{t||(t=Error("Container missing")),"string"==typeof t.message&&(t.message+=`
|
|
5
|
+
while loading "${n[1]}" from ${n[2]}`),l.m[e]=()=>{throw t},n.p=0},f=(e,t,o,i,a,s)=>{try{let l=e(t,o);if(!l||!l.then)return a(l,i,s);{let e=l.then(e=>a(e,i),u);if(!s)return e;r.push(n.p=e)}}catch(e){u(e)}},d=(e,t,r)=>e?f(l.I,n[0],0,e,h,r):u();var h=(e,r,o)=>f(r.get,n[1],t,0,p,o),p=t=>{n.p=1,l.m[e]=e=>{e.exports=t()}};let m=()=>{try{let e=i.decodeName(a[0].name,i.ENCODE_NAME_PREFIX)+n[1].slice(1),t=l.federation.instance,r=()=>l.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===t.options.shareStrategy)return Promise.all(t.sharedHandler.initializeSharing(n[0])).then(()=>r());return r()}catch(e){u(e)}};1===a.length&&o.FEDERATION_SUPPORTED_TYPES.includes(a[0].externalType)&&a[0].name?f(m,n[2],0,0,p,1):f(l,n[2],0,0,d,1)})}function l(e){let{chunkId:t,promises:r,chunkMapping:n,installedModules:o,moduleToHandlerMapping:i,webpackRequire:s}=e;a(s),s.o(n,t)&&n[t].forEach(e=>{if(s.o(o,e))return r.push(o[e]);let t=t=>{o[e]=0,s.m[e]=r=>{var n;delete s.c[e];let o=t(),{shareInfo:a}=i[e];if((null==a||null==(n=a.shareConfig)?void 0:n.layer)&&o&&"object"==typeof o)try{o.hasOwnProperty("layer")&&void 0!==o.layer||(o.layer=a.shareConfig.layer)}catch(e){}r.exports=o}},n=t=>{delete o[e],s.m[e]=r=>{throw delete s.c[e],t}};try{let a=s.federation.instance;if(!a)throw Error("Federation instance not found!");let{shareKey:l,getter:c,shareInfo:u}=i[e],f=a.loadShare(l,{customShareInfo:u}).then(e=>!1===e?c():e);f.then?r.push(o[e]=f.then(t).catch(n)):t(f)}catch(e){n(e)}})}function c(e){let{shareScopeName:t,webpackRequire:r,initPromises:n,initTokens:i,initScope:s}=e,l=Array.isArray(t)?t:[t];var c=[],u=function(e){s||(s=[]);let l=r.federation.instance;var c=i[e];if(c||(c=i[e]={from:l.name}),s.indexOf(c)>=0)return;s.push(c);let u=n[e];if(u)return u;var f=e=>"undefined"!=typeof console&&console.warn&&console.warn(e),d=n=>{var o=e=>f("Initialization of sharing external failed: "+e);try{var i=r(n);if(!i)return;var a=n=>n&&n.init&&n.init(r.S[e],s,{shareScopeMap:r.S||{},shareScopeKeys:t});if(i.then)return h.push(i.then(a,o));var l=a(i);if(l&&"boolean"!=typeof l&&l.then)return h.push(l.catch(o))}catch(e){o(e)}};let h=l.initializeSharing(e,{strategy:l.options.shareStrategy,initScope:s,from:"build"});a(r);let p=r.federation.bundlerRuntimeOptions.remotes;return(p&&Object.keys(p.idToRemoteMap).forEach(e=>{let t=p.idToRemoteMap[e],r=p.idToExternalAndNameMapping[e][2];if(t.length>1)d(r);else if(1===t.length){let e=t[0];o.FEDERATION_SUPPORTED_TYPES.includes(e.externalType)||d(r)}}),h.length)?n[e]=Promise.all(h).then(()=>n[e]=!0):n[e]=!0};return l.forEach(e=>{c.push(u(e))}),Promise.all(c).then(()=>!0)}function u(e){let{moduleId:t,moduleToHandlerMapping:r,webpackRequire:n}=e,o=n.federation.instance;if(!o)throw Error("Federation instance not found!");let{shareKey:i,shareInfo:a}=r[t];try{return o.loadShareSync(i,{customShareInfo:a})}catch(e){throw 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: "),e}}function f(e){let{moduleToHandlerMapping:t,webpackRequire:r,installedModules:n,initialConsumes:o}=e;o.forEach(e=>{r.m[e]=o=>{var i;n[e]=0,delete r.c[e];let a=u({moduleId:e,moduleToHandlerMapping:t,webpackRequire:r});if("function"!=typeof a)throw Error(`Shared module is not available for eager consumption: ${e}`);let s=a(),{shareInfo:l}=t[e];if((null==l||null==(i=l.shareConfig)?void 0:i.layer)&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=l.shareConfig.layer)}catch(e){}o.exports=s}})}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(e){let{webpackRequire:t,shareScope:r,initScope:n,shareScopeKey:o,remoteEntryInitOptions:i}=e;if(!t.S||!t.federation||!t.federation.instance||!t.federation.initOptions)return;let a=t.federation.instance;a.initOptions(d({name:t.federation.initOptions.name,remotes:[]},i));let s=null==i?void 0:i.shareScopeKeys,l=null==i?void 0:i.shareScopeMap;if(o&&"string"!=typeof o)o.forEach(e=>{if(!s||!l)return void a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}});l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})});else{let e=o||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}):a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}return(t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),"function"==typeof t.federation.prefetch&&t.federation.prefetch(),Array.isArray(o))?t.federation.initOptions.shared?t.I(o,n):Promise.all(o.map(e=>t.I(e,n))).then(()=>!0):t.I(o||"default",n)}e.exports={runtime:function(e){var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}(n),instance:void 0,initOptions:void 0,bundlerRuntime:{remotes:s,consumes:l,I:c,S:{},installInitialConsumes:f,initContainerEntry:h},attachShareScopeMap:a,bundlerRuntimeOptions:{}}},58576:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var polyfills=__webpack_require__(33405);let FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return"undefined"!=typeof window&&void 0!==window.document}function isReactNativeEnv(){var e;return"undefined"!=typeof navigator&&(null==(e=navigator)?void 0:e.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch(e){}return!1}function isDebugMode(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:!!("undefined"!=typeof FEDERATION_DEBUG&&FEDERATION_DEBUG)||isBrowserDebug()}let getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SEPARATOR,n=e.split(r),o="development"===getProcessEnv().NODE_ENV&&t,i="*",a=e=>e.startsWith("http")||e.includes(MANIFEST_EXT);if(n.length>=2){let[t,...s]=n;e.startsWith(r)&&(t=n.slice(0,2).join(r),s=[o||n.slice(2).join(r)]);let l=o||s.join(r);return a(l)?{name:t,entry:l}:{name:t,version:l||i}}if(1===n.length){let[e]=n;return o&&a(o)?{name:e,entry:o}:{name:e,version:o||i}}throw`Invalid entry value: ${e}`},composeKeyWithSeparator=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length?t.reduce((e,t)=>t?e?`${e}${SEPARATOR}${t}`:t:e,""):""},encodeName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=r?".js":"";return`${t}${e.replace(RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${n}`}catch(e){throw e}},decodeName=function(e,t,r){try{let n=e;if(t){if(!n.startsWith(t))return n;n=n.replace(RegExp(t,"g"),"")}return n=n.replace(RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(e){throw e}},generateExposeFilename=(e,t)=>{if(!e)return"";let r=e;return"."===r&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",t)},generateShareFilename=(e,t)=>e?encodeName(e,"__federation_shared_",t):"",getResourceUrl=(e,t)=>{if("getPublicPath"in e){let r;return r=e.getPublicPath.startsWith("function")?Function("return "+e.getPublicPath)()():Function(e.getPublicPath)(),`${r}${t}`}return"publicPath"in e?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in e?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},assert=(e,t)=>{e||error(t)},error=e=>{throw Error(`${LOG_CATEGORY}: ${e}`)},warn=e=>{console.warn(`${LOG_CATEGORY}: ${e}`)};function safeToString(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(e){return VERSION_PATTERN_REGEXP.test(e)}let simpleJoinRemoteEntry=(e,t)=>{if(!e)return t;let r=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){let t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(e){var t,r,n;let o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{remotes:a={},overrides:s={},version:l}=i,c=()=>"publicPath"in e.metaData?"auto"===e.metaData.publicPath&&l?inferAutoPublicPath(l):e.metaData.publicPath:e.metaData.getPublicPath,u=Object.keys(s),f={};Object.keys(a).length||(f=(null==(n=e.remotes)?void 0:n.reduce((e,t)=>{let r,n=t.federationContainerName;return r=u.includes(n)?s[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:r},e},{}))||{}),Object.keys(a).forEach(e=>f[e]={matchedVersion:u.includes(e)?s[e]:a[e]});let{remoteEntry:{path:d,name:h,type:p},types:m,buildInfo:{buildVersion:g},globalName:y,ssrRemoteEntry:_}=e.metaData,{exposes:E}=e,v={version:l||"",buildVersion:g,globalName:y,remoteEntry:simpleJoinRemoteEntry(d,h),remoteEntryType:p,remoteTypes:simpleJoinRemoteEntry(m.path,m.name),remoteTypesZip:m.zip||"",remoteTypesAPI:m.api||"",remotesInfo:f,shared:null==e?void 0:e.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version})),modules:null==E?void 0:E.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(null==(t=e.metaData)?void 0:t.prefetchInterface){let t=e.metaData.prefetchInterface;v=polyfills._({},v,{prefetchInterface:t})}if(null==(r=e.metaData)?void 0:r.prefetchEntry){let{path:t,name:r,type:n}=e.metaData.prefetchEntry;v=polyfills._({},v,{prefetchEntry:simpleJoinRemoteEntry(t,r),prefetchEntryType:n})}return o="publicPath"in e.metaData?polyfills._({},v,{publicPath:c(),ssrPublicPath:e.metaData.ssrPublicPath}):polyfills._({},v,{getPublicPath:c()}),_&&(o.ssrRemoteEntry=simpleJoinRemoteEntry(_.path,_.name),o.ssrRemoteEntryType=_.type||"commonjs-module"),o}function isManifestProvider(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(MANIFEST_EXT))}let PREFIX="[ Module Federation ]",Logger=class{setPrefix(e){this.prefix=e}log(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}success(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}info(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}ready(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}debug(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];isDebugMode()&&console.log(this.prefix,...t)}constructor(e){this.prefix=e}};function createLogger(e){return new Logger(e)}let logger=createLogger(PREFIX);async function safeWrapper(e,t){try{return await e()}catch(e){t||warn(e);return}}function isStaticResourcesEqual(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function createScript(e){let t,r=null,n=!0,o=2e4,i=document.getElementsByTagName("script");for(let t=0;t<i.length;t++){let o=i[t],a=o.getAttribute("src");if(a&&isStaticResourcesEqual(a,e.url)){r=o,n=!1;break}}if(!r){let t,n=e.attrs;(r=document.createElement("script")).type=(null==n?void 0:n.type)==="module"?"module":"text/javascript",e.createScriptHook&&((t=e.createScriptHook(e.url,e.attrs))instanceof HTMLScriptElement?r=t:"object"==typeof t&&("script"in t&&t.script&&(r=t.script),"timeout"in t&&t.timeout&&(o=t.timeout))),r.src||(r.src=e.url),n&&!t&&Object.keys(n).forEach(e=>{r&&("async"===e||"defer"===e?r[e]=n[e]:r.getAttribute(e)||r.setAttribute(e,n[e]))})}let a=async(n,o)=>{clearTimeout(t);let i=()=>{(null==o?void 0:o.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(o)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(r&&(r.onerror=null,r.onload=null,safeWrapper(()=>{let{needDeleteScript:t=!0}=e;t&&(null==r?void 0:r.parentNode)&&r.parentNode.removeChild(r)}),n&&"function"==typeof n)){let e=n(o);if(e instanceof Promise){let t=await e;return i(),t}return i(),e}i()};return r.onerror=a.bind(null,r.onerror),r.onload=a.bind(null,r.onload),t=setTimeout(()=>{a(null,Error(`Remote script "${e.url}" time-outed.`))},o),{script:r,needAttach:n}}function createLink(e){let t=null,r=!0,n=document.getElementsByTagName("link");for(let o=0;o<n.length;o++){let i=n[o],a=i.getAttribute("href"),s=i.getAttribute("rel");if(a&&isStaticResourcesEqual(a,e.url)&&s===e.attrs.rel){t=i,r=!1;break}}if(!t){let r;(t=document.createElement("link")).setAttribute("href",e.url);let n=e.attrs;e.createLinkHook&&(r=e.createLinkHook(e.url,n))instanceof HTMLLinkElement&&(t=r),n&&!r&&Object.keys(n).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,n[e])})}let o=(r,n)=>{let o=()=>{(null==n?void 0:n.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(n)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{let{needDeleteLink:r=!0}=e;r&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}),r)){let e=r(n);return o(),e}o()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function loadScript(e,t){let{attrs:r={},createScriptHook:n}=t;return new Promise((t,o)=>{let{script:i,needAttach:a}=createScript({url:e,cb:t,onErrorCallback:o,attrs:polyfills._({fetchpriority:"high"},r),createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}let sdkImportCache=new Map;function importNodeModule(e){if(!e)throw Error("import specifier is required");if(sdkImportCache.has(e))return sdkImportCache.get(e);let t=Function("name","return import(name)")(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),sdkImportCache.delete(e),t});return sdkImportCache.set(e,t),t}let loadNodeFetch=async()=>{let e=await importNodeModule("node-fetch");return e.default||e},lazyLoaderHookFetch=async(e,t,r)=>{let n=(e,t)=>r.lifecycle.fetch.emit(e,t),o=await n(e,t||{});return o&&o instanceof Response?o:("undefined"==typeof fetch?await loadNodeFetch():fetch)(e,t||{})},createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{let urlObj;if(null==loaderHook?void 0:loaderHook.createScriptHook){let hookResult=loaderHook.createScriptHook(url);hookResult&&"object"==typeof hookResult&&"url"in hookResult&&(url=hookResult.url)}try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e),cb(Error(`Invalid URL: ${e}`));return}let getFetch=async()=>(null==loaderHook?void 0:loaderHook.fetch)?(e,t)=>lazyLoaderHookFetch(e,t,loaderHook):"undefined"==typeof fetch?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants,_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;let res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
6
|
+
})`,{filename,importModuleDynamically:null!=(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=null==(_vm_constants=vm.constants)?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);let exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){let container=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,container);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:Error(`Script execution error: ${e}`))}};getFetch().then(async e=>{if((null==attrs?void 0:attrs.type)==="esm"||(null==attrs?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:e,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:Error(`Script execution error: ${e}`))});handleScriptFetch(e,urlObj)}).catch(e=>{cb(e)})}:(e,t,r,n)=>{t(Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise((r,n)=>{createScriptNode(e,(e,o)=>{if(e)n(e);else{var i,a;let e=(null==t||null==(i=t.attrs)?void 0:i.globalName)||`__FEDERATION_${null==t||null==(a=t.attrs)?void 0:a.name}:custom__`;r(globalThis[e]=o)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(e,t){if(esmModuleCache.has(e))return esmModuleCache.get(e);let{fetch:r,vm:n}=t,o=await r(e),i=await o.text(),a=new n.SourceTextModule(i,{importModuleDynamically:async(r,n)=>loadModule(new URL(r,e).href,t)});return esmModuleCache.set(e,a),await a.link(async r=>{let n=new URL(r,e).href;return await loadModule(n,t)}),a}function normalizeOptions(e,t,r){return function(n){if(!1===n)return!1;if(void 0===n)if(e)return t;else return!1;if(!0===n)return t;if(n&&"object"==typeof n)return polyfills._({},t,n);throw Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}let createModuleFederationConfig=e=>e;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.MFPrefetchCommon=MFPrefetchCommon,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.assert=assert,exports.composeKeyWithSeparator=composeKeyWithSeparator,exports.containerPlugin=ContainerPlugin,exports.containerReferencePlugin=ContainerReferencePlugin,exports.createLink=createLink,exports.createLogger=createLogger,exports.createModuleFederationConfig=createModuleFederationConfig,exports.createScript=createScript,exports.createScriptNode=createScriptNode,exports.decodeName=decodeName,exports.encodeName=encodeName,exports.error=error,exports.generateExposeFilename=generateExposeFilename,exports.generateShareFilename=generateShareFilename,exports.generateSnapshotFromManifest=generateSnapshotFromManifest,exports.getProcessEnv=getProcessEnv,exports.getResourceUrl=getResourceUrl,exports.inferAutoPublicPath=inferAutoPublicPath,exports.isBrowserEnv=isBrowserEnv,exports.isDebugMode=isDebugMode,exports.isManifestProvider=isManifestProvider,exports.isReactNativeEnv=isReactNativeEnv,exports.isRequiredVersion=isRequiredVersion,exports.isStaticResourcesEqual=isStaticResourcesEqual,exports.loadScript=loadScript,exports.loadScriptNode=loadScriptNode,exports.logger=logger,exports.moduleFederationPlugin=ModuleFederationPlugin,exports.normalizeOptions=normalizeOptions,exports.parseEntry=parseEntry,exports.safeToString=safeToString,exports.safeWrapper=safeWrapper,exports.sharePlugin=SharePlugin,exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry,exports.warn=warn},33405:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t._=r},6023:function(e,t,r){Promise.all([r.e("677"),r.e("179"),r.e("863")]).then(r.bind(r,87102))},363:function(e,t,r){"use strict";var n,o,i,a,s,l,c,u,f,d,h,p,m=r(51490),g=r.n(m);let y=[],_={},E="TimeSeriesChart",v="version-first";if((r.initializeSharingData||r.initializeExposesData)&&r.federation){let e=(e,t,r)=>{e&&e[t]&&(e[t]=r)},t=(e,t,r)=>{var n,o,i,a,s,l;let c=r();Array.isArray(c)?(null!=(i=(n=e)[o=t])||(n[o]=[]),e[t].push(...c)):"object"==typeof c&&null!==c&&(null!=(l=(a=e)[s=t])||(a[s]={}),Object.assign(e[t],c))},m=(e,t,r)=>{var n,o,i;null!=(i=(n=e)[o=t])||(n[o]=r())},b=null!=(u=null==(n=r.remotesLoadingData)?void 0:n.chunkMapping)?u:{},S=null!=(f=null==(o=r.remotesLoadingData)?void 0:o.moduleIdToRemoteDataMapping)?f:{},N=null!=(d=null==(i=r.initializeSharingData)?void 0:i.scopeToSharingDataMapping)?d:{},R=null!=(h=null==(a=r.consumesLoadingData)?void 0:a.chunkMapping)?h:{},I=null!=(p=null==(s=r.consumesLoadingData)?void 0:s.moduleIdToConsumeDataMapping)?p:{},T={},$=[],A={},M=null==(l=r.initializeExposesData)?void 0:l.shareScope;for(let e in g())r.federation[e]=g()[e];m(r.federation,"consumesLoadingModuleToHandlerMapping",()=>{let e={};for(let[t,r]of Object.entries(I))e[t]={getter:r.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:r.requiredVersion,strictVersion:r.strictVersion,singleton:r.singleton,eager:r.eager},scope:[r.shareScope]},shareKey:r.shareKey};return e}),m(r.federation,"initOptions",()=>({})),m(r.federation.initOptions,"name",()=>E),m(r.federation.initOptions,"shareStrategy",()=>v),m(r.federation.initOptions,"shared",()=>{let e={};for(let[t,r]of Object.entries(N))for(let n of r)if("object"==typeof n&&null!==n){let{name:r,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:c}=n,u={},f=function(e){return void 0!==e};f(s)&&(u.singleton=s),f(l)&&(u.requiredVersion=l),f(a)&&(u.eager=a),f(c)&&(u.strictVersion=c);let d={version:o,scope:[t],shareConfig:u,get:i};e[r]?e[r].push(d):e[r]=[d]}return e}),t(r.federation.initOptions,"remotes",()=>Object.values(_).flat().filter(e=>"script"===e.externalType)),t(r.federation.initOptions,"plugins",()=>y),m(r.federation,"bundlerRuntimeOptions",()=>({})),m(r.federation.bundlerRuntimeOptions,"remotes",()=>({})),m(r.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>b),m(r.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{let e={};for(let[t,r]of Object.entries(S))e[t]=[r.shareScope,r.name,r.externalModuleId,r.remoteName];return e}),m(r.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>r),t(r.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{let e={};for(let[t,r]of Object.entries(S)){let n=_[r.remoteName];n&&(e[t]=n)}return e}),e(r,"S",r.federation.bundlerRuntime.S),r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),e(r.f,"remotes",(e,t)=>r.federation.bundlerRuntime.remotes({chunkId:e,promises:t,chunkMapping:b,idToExternalAndNameMapping:r.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:r.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:r})),e(r.f,"consumes",(e,t)=>r.federation.bundlerRuntime.consumes({chunkId:e,promises:t,chunkMapping:R,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping,installedModules:T,webpackRequire:r})),e(r,"I",(e,t)=>r.federation.bundlerRuntime.I({shareScopeName:e,initScope:t,initPromises:$,initTokens:A,webpackRequire:r})),e(r,"initContainer",(e,t,n)=>r.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:t,remoteEntryInitOptions:n,shareScopeKey:M,webpackRequire:r})),e(r,"getContainer",(e,t)=>{var n=r.initializeExposesData.moduleMap;return r.R=t,t=Object.prototype.hasOwnProperty.call(n,e)?n[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,t}),r.federation.instance=r.federation.runtime.init(r.federation.initOptions),(null==(c=r.consumesLoadingData)?void 0:c.initialConsumes)&&r.federation.bundlerRuntime.installInitialConsumes({webpackRequire:r,installedModules:T,initialConsumes:r.consumesLoadingData.initialConsumes,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping})}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.c=__webpack_module_cache__,__webpack_require__.x=()=>__webpack_require__(6023),(()=>{__webpack_require__.federation||(__webpack_require__.federation={chunkMatcher:function(e){return!/^(1(02|57|79)|263|421|494|677|759|987)$/.test(e)},rootOutputDir:"../../"})})(),(()=>{__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{var e=__webpack_require__.x,t=!1;__webpack_require__.x=function(){if(t||(t=!0,__webpack_require__(363)),"function"==typeof e)return e();console.warn("[MF] Invalid prevStartup")}})(),(()=>{__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,r)=>(__webpack_require__.f[r](e,t),t),[]))})(),(()=>{__webpack_require__.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({109:"604f6c41",118:"25a1f509",133:"c48c8cc8",173:"58a1dc61",214:"37696543",224:"2d3ce51f",238:"767e5398",292:"9efc6a73",409:"97dde548",476:"23a59a72",53:"8edfe937",547:"bb4f1e58",580:"5f4b0dbd",62:"f24fce0a",651:"e0c9e225",686:"0cd9a75c",694:"ebf24a00",738:"c37f7bca",740:"f0e8d499",75:"26ec5bee",770:"e129dd07",797:"72ff552e",863:"f147d2ba",960:"cd399075",964:"719c530c",981:"e360e7df"})[e]+".js"})(),(()=>{__webpack_require__.miniCssF=e=>"__mf/css/async/"+e+"."+({263:"9a1fa3dd",759:"9a1fa3dd"})[e]+".css"})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="TimeSeriesChart:";__webpack_require__.l=function(r,n,o,i){if(e[r])return void e[r].push(n);if(void 0!==o)for(var a,s,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+o){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.setAttribute("data-webpack",t+o),a.src=r),e[r]=[n];var f=function(t,n){a.onerror=a.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),s&&document.head.appendChild(a)}})(),(()=>{__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{__webpack_require__.nc=void 0})(),(()=>{__webpack_require__.p="/plugins/TimeSeriesChart/"})(),(()=>{__webpack_require__.S={},__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("960"),__webpack_require__.e("677"),__webpack_require__.e("651")]).then(()=>()=>__webpack_require__(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("694")]).then(()=>()=>__webpack_require__(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([__webpack_require__.e("292"),__webpack_require__.e("677"),__webpack_require__.e("214")]).then(()=>()=>__webpack_require__(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.52.0-beta.5",factory:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("292"),__webpack_require__.e("797"),__webpack_require__.e("476"),__webpack_require__.e("580"),__webpack_require__.e("547"),__webpack_require__.e("133"),__webpack_require__.e("686"),__webpack_require__.e("677"),__webpack_require__.e("179"),__webpack_require__.e("987"),__webpack_require__.e("157"),__webpack_require__.e("421"),__webpack_require__.e("759")]).then(()=>()=>__webpack_require__(53146)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.52.0-beta.5",factory:()=>Promise.all([__webpack_require__.e("118"),__webpack_require__.e("292"),__webpack_require__.e("580"),__webpack_require__.e("133"),__webpack_require__.e("109"),__webpack_require__.e("53"),__webpack_require__.e("677"),__webpack_require__.e("179"),__webpack_require__.e("987"),__webpack_require__.e("157"),__webpack_require__.e("421"),__webpack_require__.e("102"),__webpack_require__.e("62")]).then(()=>()=>__webpack_require__(82323)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([__webpack_require__.e("797"),__webpack_require__.e("476"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([__webpack_require__.e("173"),__webpack_require__.e("677")]).then(()=>()=>__webpack_require__(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react",version:"18.3.1",factory:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"TimeSeriesChart"},__webpack_require__.I=__webpack_require__.I||function(){throw Error("should have __webpack_require__.I")}})(),(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{179:["6085"],677:["54538"],157:["72116"],421:["93098","4665","45913"],102:["57751","55922","30156","84275","95417","74614","86720"],494:["57871"],987:["20461"]},moduleIdToConsumeDataMapping:{20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378))},93098:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"^4.17.21",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("224"),__webpack_require__.e("740"),__webpack_require__.e("494")]).then(()=>()=>__webpack_require__(48872))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("173").then(()=>()=>__webpack_require__(31542))},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("797"),__webpack_require__.e("476"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("770").then(()=>()=>__webpack_require__(51958))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("738").then(()=>()=>__webpack_require__(81228))},95417:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.52.0-beta.5",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("797"),__webpack_require__.e("476"),__webpack_require__.e("547"),__webpack_require__.e("686"),__webpack_require__.e("263")]).then(()=>()=>__webpack_require__(53146))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("770").then(()=>()=>__webpack_require__(51958))},86720:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.52.0-beta.5",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("960").then(()=>()=>__webpack_require__(96434))}},initialConsumes:[]},__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")}})(),(()=>{if("undefined"!=typeof document){var e=function(e,t,r,n,o){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",__webpack_require__.nc&&(i.nonce=__webpack_require__.nc);var a=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}};return i.onerror=i.onload=a,i.href=t,r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},r=function(r){return new Promise(function(n,o){var i=__webpack_require__.miniCssF(r),a=__webpack_require__.p+i;if(t(i,a))return n();e(r,a,null,n,o)})},n={909:0};__webpack_require__.f.miniCss=function(e,t){var o={263:1,759:1};n[e]?t.push(n[e]):0!==n[e]&&o[e]&&t.push(n[e]=r(e).then(function(){n[e]=0},function(t){throw delete n[e],t}))}}})(),(()=>{var e={909:0};__webpack_require__.f.j=function(t,r){var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(1(02|57|79)|263|421|494|677|759|987)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),a=Error(),s=function(r){if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}};__webpack_require__.l(i,s,"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,a,s]=r,l=0;if(i.some(t=>0!==e[t])){for(n in a)__webpack_require__.o(a,n)&&(__webpack_require__.m[n]=a[n]);s&&s(__webpack_require__)}for(t&&t(r);l<i.length;l++)o=i[l],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.chunk_TimeSeriesChart=self.chunk_TimeSeriesChart||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__=__webpack_require__.x()})();
|
|
@@ -39,9 +39,6 @@ _export(exports, {
|
|
|
39
39
|
getCommonTimeScaleForQueries: function() {
|
|
40
40
|
return getCommonTimeScaleForQueries;
|
|
41
41
|
},
|
|
42
|
-
getLineSeries: function() {
|
|
43
|
-
return getLineSeries;
|
|
44
|
-
},
|
|
45
42
|
getThresholdSeries: function() {
|
|
46
43
|
return getThresholdSeries;
|
|
47
44
|
},
|
|
@@ -66,52 +63,6 @@ function getCommonTimeScaleForQueries(queries) {
|
|
|
66
63
|
const seriesData = queries.map((query)=>query.data);
|
|
67
64
|
return (0, _core.getCommonTimeScale)(seriesData);
|
|
68
65
|
}
|
|
69
|
-
function getLineSeries(id, formattedName, data, visual, paletteColor) {
|
|
70
|
-
const lineWidth = visual.lineWidth ?? _timeserieschartmodel.DEFAULT_LINE_WIDTH;
|
|
71
|
-
const pointRadius = visual.pointRadius ?? _timeserieschartmodel.DEFAULT_POINT_RADIUS;
|
|
72
|
-
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
73
|
-
let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;
|
|
74
|
-
// Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)
|
|
75
|
-
if (visual.showPoints === 'always') {
|
|
76
|
-
showPoints = true;
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
type: 'line',
|
|
80
|
-
id: id,
|
|
81
|
-
name: formattedName,
|
|
82
|
-
data: data,
|
|
83
|
-
connectNulls: visual.connectNulls ?? _timeserieschartmodel.DEFAULT_CONNECT_NULLS,
|
|
84
|
-
color: paletteColor,
|
|
85
|
-
stack: visual.stack === 'all' ? visual.stack : undefined,
|
|
86
|
-
sampling: 'lttb',
|
|
87
|
-
progressiveThreshold: _components.OPTIMIZED_MODE_SERIES_LIMIT,
|
|
88
|
-
showSymbol: showPoints,
|
|
89
|
-
showAllSymbol: true,
|
|
90
|
-
symbolSize: pointRadius,
|
|
91
|
-
lineStyle: {
|
|
92
|
-
width: lineWidth,
|
|
93
|
-
opacity: 0.8
|
|
94
|
-
},
|
|
95
|
-
areaStyle: {
|
|
96
|
-
opacity: visual.areaOpacity ?? _timeserieschartmodel.DEFAULT_AREA_OPACITY
|
|
97
|
-
},
|
|
98
|
-
// https://echarts.apache.org/en/option.html#series-line.emphasis
|
|
99
|
-
emphasis: {
|
|
100
|
-
focus: 'series',
|
|
101
|
-
disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0,
|
|
102
|
-
lineStyle: {
|
|
103
|
-
width: lineWidth + 1.5,
|
|
104
|
-
opacity: 1
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
blur: {
|
|
108
|
-
lineStyle: {
|
|
109
|
-
width: lineWidth,
|
|
110
|
-
opacity: BLUR_FADEOUT_OPACITY
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
66
|
function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor) {
|
|
116
67
|
const lineWidth = visual.lineWidth ?? _timeserieschartmodel.DEFAULT_LINE_WIDTH;
|
|
117
68
|
const pointRadius = visual.pointRadius ?? _timeserieschartmodel.DEFAULT_POINT_RADIUS;
|
|
@@ -15,11 +15,7 @@ export declare const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export declare function getLineSeries(id: string, formattedName: string, data: LegacyTimeSeries['data'], visual: TimeSeriesChartVisualOptions, paletteColor?: string): LegacyTimeSeries;
|
|
21
|
-
/**
|
|
22
|
-
* Gets ECharts line series option properties for recommended TimeChart
|
|
18
|
+
* Gets ECharts line series option properties for regular trends
|
|
23
19
|
*/
|
|
24
20
|
export declare function getTimeSeries(id: string, datasetIndex: number, formattedName: string, visual: TimeSeriesChartVisualOptions, timeScale: TimeScale, paletteColor: string): TimeSeriesOption;
|
|
25
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-transform.d.ts","sourceRoot":"","sources":["../../../src/utils/data-transform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EAGV,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAQL,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAE,iBAI9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAG7G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,
|
|
1
|
+
{"version":3,"file":"data-transform.d.ts","sourceRoot":"","sources":["../../../src/utils/data-transform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EAGV,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAQL,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAE,iBAI9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAG7G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,4BAA4B,EACpC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,MAAM,GACnB,gBAAgB,CAuElB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CA2B9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,EAAE,GAAG,UAAU,EAAE,EACvC,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAMR;AA4BD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,2BAAgC,GAAG,oBAAoB,CA8BnG;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7C"}
|
|
@@ -29,55 +29,7 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
29
29
|
return getCommonTimeScale(seriesData);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*/ export function getLineSeries(id, formattedName, data, visual, paletteColor) {
|
|
34
|
-
const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
35
|
-
const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;
|
|
36
|
-
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
37
|
-
let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;
|
|
38
|
-
// Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)
|
|
39
|
-
if (visual.showPoints === 'always') {
|
|
40
|
-
showPoints = true;
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
type: 'line',
|
|
44
|
-
id: id,
|
|
45
|
-
name: formattedName,
|
|
46
|
-
data: data,
|
|
47
|
-
connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,
|
|
48
|
-
color: paletteColor,
|
|
49
|
-
stack: visual.stack === 'all' ? visual.stack : undefined,
|
|
50
|
-
sampling: 'lttb',
|
|
51
|
-
progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT,
|
|
52
|
-
showSymbol: showPoints,
|
|
53
|
-
showAllSymbol: true,
|
|
54
|
-
symbolSize: pointRadius,
|
|
55
|
-
lineStyle: {
|
|
56
|
-
width: lineWidth,
|
|
57
|
-
opacity: 0.8
|
|
58
|
-
},
|
|
59
|
-
areaStyle: {
|
|
60
|
-
opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY
|
|
61
|
-
},
|
|
62
|
-
// https://echarts.apache.org/en/option.html#series-line.emphasis
|
|
63
|
-
emphasis: {
|
|
64
|
-
focus: 'series',
|
|
65
|
-
disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0,
|
|
66
|
-
lineStyle: {
|
|
67
|
-
width: lineWidth + 1.5,
|
|
68
|
-
opacity: 1
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
blur: {
|
|
72
|
-
lineStyle: {
|
|
73
|
-
width: lineWidth,
|
|
74
|
-
opacity: BLUR_FADEOUT_OPACITY
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Gets ECharts line series option properties for recommended TimeChart
|
|
32
|
+
* Gets ECharts line series option properties for regular trends
|
|
81
33
|
*/ export function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor) {
|
|
82
34
|
const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
83
35
|
const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n StepOptions,\n TimeScale,\n TimeSeries,\n TimeSeriesValueTuple,\n getCommonTimeScale,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * [DEPRECATED] Gets ECharts line series option properties for legacy LineChart\n */\nexport function getLineSeries(\n id: string,\n formattedName: string,\n data: LegacyTimeSeries['data'],\n visual: TimeSeriesChartVisualOptions,\n paletteColor?: string\n): LegacyTimeSeries {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n return {\n type: 'line',\n id: id,\n name: formattedName,\n data: data,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.8,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1.5,\n opacity: 1,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Gets ECharts line series option properties for recommended TimeChart\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.95,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n },\n },\n selectedMode: 'single',\n select: {\n itemStyle: {\n borderColor: paletteColor,\n borderWidth: pointRadius + 0.5,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n const yAxis: YAXisComponentOption = {\n show: true,\n axisLabel: {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n },\n min: inputAxis?.min,\n max: inputAxis?.max,\n };\n\n // Set the y-axis minimum relative to the data\n if (inputAxis?.min === undefined) {\n // https://echarts.apache.org/en/option.html#yAxis.min\n yAxis.min = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["getCommonTimeScale","OPTIMIZED_MODE_SERIES_LIMIT","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getLineSeries","id","formattedName","visual","paletteColor","lineWidth","pointRadius","showPoints","undefined","length","type","name","connectNulls","color","stack","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","opacity","areaStyle","areaOpacity","emphasis","focus","disabled","blur","getTimeSeries","datasetIndex","timeScale","minuteMs","rangeMs","display","series","label","show","selectedMode","select","itemStyle","borderColor","borderWidth","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","values","forEach","valueTuple","_","value","convertPanelYAxis","inputAxis","yAxis","axisLabel","roundDown","num","magnitude","Math","floor","log10","abs","firstDigit","pow"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n StepOptions,\n TimeScale,\n TimeSeries,\n TimeSeriesValueTuple,\n getCommonTimeScale,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * Gets ECharts line series option properties for regular trends\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.95,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n },\n },\n selectedMode: 'single',\n select: {\n itemStyle: {\n borderColor: paletteColor,\n borderWidth: pointRadius + 0.5,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n const yAxis: YAXisComponentOption = {\n show: true,\n axisLabel: {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n },\n min: inputAxis?.min,\n max: inputAxis?.max,\n };\n\n // Set the y-axis minimum relative to the data\n if (inputAxis?.min === undefined) {\n // https://echarts.apache.org/en/option.html#yAxis.min\n yAxis.min = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["getCommonTimeScale","OPTIMIZED_MODE_SERIES_LIMIT","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","lineWidth","pointRadius","minuteMs","showPoints","rangeMs","display","series","type","name","color","stack","undefined","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","opacity","areaStyle","areaOpacity","emphasis","focus","disabled","selectedMode","select","itemStyle","borderColor","borderWidth","blur","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","value","convertPanelYAxis","inputAxis","yAxis","axisLabel","roundDown","num","magnitude","Math","floor","log10","abs","firstDigit","pow"],"mappings":"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"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TimeSeriesChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.10.
|
|
8
|
+
"buildVersion": "0.10.1",
|
|
9
9
|
"buildName": "@perses-dev/timeseries-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TimeSeriesChart.
|
|
12
|
+
"name": "__mf/js/TimeSeriesChart.2f8b193b.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"api": ""
|
|
21
21
|
},
|
|
22
22
|
"globalName": "TimeSeriesChart",
|
|
23
|
-
"pluginVersion": "0.
|
|
23
|
+
"pluginVersion": "0.19.1",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
25
|
"publicPath": "/plugins/TimeSeriesChart/"
|
|
26
26
|
},
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"js": {
|
|
114
114
|
"async": [],
|
|
115
115
|
"sync": [
|
|
116
|
-
"__mf/js/async/109.
|
|
116
|
+
"__mf/js/async/109.604f6c41.js"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
119
|
"css": {
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TimeSeriesChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.10.
|
|
8
|
+
"buildVersion": "0.10.1",
|
|
9
9
|
"buildName": "@perses-dev/timeseries-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TimeSeriesChart.
|
|
12
|
+
"name": "__mf/js/TimeSeriesChart.2f8b193b.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"api": ""
|
|
21
21
|
},
|
|
22
22
|
"globalName": "TimeSeriesChart",
|
|
23
|
-
"pluginVersion": "0.
|
|
23
|
+
"pluginVersion": "0.19.1",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
25
|
"publicPath": "/plugins/TimeSeriesChart/"
|
|
26
26
|
},
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"js": {
|
|
130
130
|
"async": [],
|
|
131
131
|
"sync": [
|
|
132
|
-
"__mf/js/async/109.
|
|
132
|
+
"__mf/js/async/109.604f6c41.js"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
135
|
"css": {
|