@flatjs/evolve 1.2.97 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/index.js +2 -2
- package/package.json +10 -10
package/cjs/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*! @flatjs/forge MIT https://github.com/flatjs */
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("lodash");var r=require("@flatjs/mock");var n=require("babel-merge");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var a=require("cssnano");var i=require("webpack");var l=require("terser-webpack-plugin");var c=require("mini-css-extract-plugin");var u=require("case-sensitive-paths-webpack-plugin");var p=require("webpack-bundle-analyzer");var d=require("webpack-sources");var f=require("webpack/lib/util/extractUrlAndGlobal");var
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("lodash");var r=require("@flatjs/mock");var n=require("babel-merge");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var a=require("cssnano");var i=require("webpack");var l=require("terser-webpack-plugin");var c=require("mini-css-extract-plugin");var u=require("case-sensitive-paths-webpack-plugin");var p=require("webpack-bundle-analyzer");var d=require("webpack-sources");var f=require("webpack/lib/util/extractUrlAndGlobal");var h=require("html-webpack-plugin");var v=require("os");var m=require("webpack-dev-server");var g=require("express");var b=require("https");var y=require("fs");var w=require("better-opn");function j(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var k=j(n);var C=j(a);var O=j(i);var x=j(l);var M=j(c);var S=j(u);var P=j(f);var A=j(h);var E=j(v);var R=j(m);var B=j(g);var $=j(b);var T=j(w);function q(e){let t;const r=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(r?"../../../evolve-preset-babel/src/index":e);break}return t}const _=(e,t=false)=>{if(!t){return require(e)}else{return r.loadModule(e)}};const F=({usePreset:t,...r}={usePreset:"react"},n=[])=>{const o=n.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:s,infernoBabelPreset:a,vueBabelPreset:i}=_(q("@flatjs/evolve-preset-babel"));const l=t==="react"?s():t==="vue"?i():a();let c={};try{c=k["default"](l,r);if(c.plugins){c.plugins.unshift(...o)}else{c.plugins=o}}catch(t){e.printError(t)}return Object.assign({babelrc:false},c)};const D=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const I={reactDev:[`https://unpkg.com/react@17.0.2/umd/react.development.js`,`https://unpkg.com/history@5.2.0/umd/history.development.js`,`https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js`,`https://unpkg.com/react-router@6.2.1/umd/react-router.development.js`,`https://unpkg.com/react-router-dom@6.2.1/umd/react-router-dom.development.js`],reactProd:[`https://unpkg.com/react@17.0.2/umd/react.production.min.js`,`https://unpkg.com/history@5.2.0/umd/history.production.min.js`,`https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js`,`https://unpkg.com/react-router@6.2.1/umd/react-router.production.min.js`,`https://unpkg.com/react-router-dom@6.2.1/umd/react-router-dom.production.min.js`]};const N={reactDev:[`https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/history@5.2.0/umd/history.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.development.js`,`https://cdn.jsdelivr.net/npm/react-router@6.2.1/umd/react-router.development.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.2.1/umd/react-router-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/history@5.2.0/umd/history.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router@6.2.1/umd/react-router.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.2.1/umd/react-router-dom.production.min.js`]};const W={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.2.0/history.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.2.1/react-router.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.2.1/react-router-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.2.0/history.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.2.1/react-router.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.2.1/react-router-dom.production.min.js`]};const z={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:true,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},pluginLoaderOptions:{babelOptions:{usePreset:"react"},lessOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const L=(e={},t)=>{var r;const n=t[1];const o={vue:"Vue",react:"React","react-dom":"ReactDOM","react-router":"ReactRouter","react-router-dom":"ReactRouterDOM"};return Object.assign({},o,e,((r=n.options)==null?void 0:r.externals)||{})};const U=`(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector('meta[name="viewport"]');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);`;const G={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...D,...e==="development"?W.reactDev:W.reactProd],bodyAfterScripts:()=>[],viewport:U,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:o.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const H=(e,r,n)=>{let o;if(n){o=typeof n==="function"?n(r):n}if(t.isUndefined(o)){const t=G[e];return typeof t==="function"?t(r):t}return o};const V=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const J=(e,t={})=>{const r=[C["default"]({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e}]})];if(t.enabled!==false){r.push(s.forgePluginPostcssPixel(t))}return{plugins:r}};const Y=(e,t={})=>{const r={hints:e?false:"warning"};return Object.assign(r,t)};const K=(e={})=>({parallel:true,
|
3
3
|
// Disable Extract all or some (use /^\**!|@preserve|@license|@cc_on/i RegExp) comments.
|
4
|
-
extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const X=(r=process.cwd(),n)=>{const o=e.loadFlatjsConfig(r,"flatjsEvolve","flatjs.evolve.js");return t.merge({},z.flatjsEvolve,o.flatjsEvolve,n,{projectCwd:r})};const Q=e=>{try{T["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function Z(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function ee(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=t.exec(window.location.href);const n=r&&r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"prod";const o=e[n]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function te(e={},t="prod"){const r=e[t]||e["prod"]||[];return r[Math.floor(Math.random()*r.length)]}function re(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${ee.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function ne(e,r){const n=[];for(const[t,r]of Object.entries(e)){n.push({[t]:r.entry})}return n.map((e=>t.merge({},r,{name:Object.keys(e)[0],entry:e})))}const oe=(e,r)=>{var n,o;const s=t.merge({},r.pluginLoaderOptions);if((n=e.options)!=null&&n.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const a={...r,pluginLoaderOptions:s};return a};const se=(e,t)=>{var r,n,o;const s=(r=e.pluginLoaderOptions)==null?void 0:(n=r.pixelOptions)==null?void 0:n.enabled;const a=(o=t==null?void 0:t.allowPx2rem)!=null?o:s;return!!a};const ae=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[r,n]of Object.entries(e)){t=[r,n];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const ie=()=>Date.now().toString();const le=(e,t,r=true)=>{const n=e==="js"?".js":".css";if(t){return`bundle${n}`}if(r){return`bundle[contenthash]${n}`}return`bundle${n}?${ie()}`};const ce=/icons\//;const ue=/\.(jpe?g|png|gif|svg)$/;const pe=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const de=({projectCwd:e,projectVirtualPath:t},r,[n,s])=>{let a=o.dirname(o.join(t,r.replace(/^src/,"")));const i=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,r);const c=i.find((e=>l.startsWith(e)));if(c){a=o.dirname(o.join(n,o.relative(c,l)))}return`${a}/[name]-[contenthash:8][ext]`};const fe=(e,t)=>{const r={test(e){return pe.test(e)||ue.test(e)&&!ce.test(e)},type:"asset",generator:{filename({filename:r}){return de(e,r,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return r};const ve=()=>{const e={test(e){return ce.test(e)&&e.endsWith(".svg")},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};const he=(e={},t=[])=>{const r={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:"babel-loader",options:F(e,t)}]};return r};const me=(e,t={})=>{const r={test:/\.css$/i,use:[{loader:M["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};if(Array.isArray(r.use)){r.use.push({loader:"postcss-loader",options:{postcssOptions:J(e,t),sourceMap:e}})}return r};const ge=(e,t={},r={})=>{const n=me(e,r);n.test=/\.less$/i;if(Array.isArray(n.use)){n.use.push({loader:"less-loader",options:{sourceMap:e,lessOptions:V(e,t)}})}return n};const be=(e,t,r,n={})=>{const o=[ve(),fe(t,r),me(e,n.pixelOptions),ge(e,n.lessOptions,n.pixelOptions),he(n.babelOptions,n.modularImports)];return o};class ye{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const r=t.map((e=>e.name));const n=this.currentAssets.filter((e=>{const t=r.includes(e)===false;return t}));this.currentAssets=r.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&n.length!==0){o.push(...n)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const r=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){r.forEach((e=>{const t=o.relative(process.cwd(),e);const r="removed";console.warn(`clean-webpack-plugin: ${r} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const we=t=>new ye({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const je=(e,t)=>new M["default"]({filename:`[name]/${le("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const ke="ExternalTemplateRemotesPlugin";const Ce=e=>e.constructor.name==="ExternalModule";class Oe{apply(e){e.hooks.make.tap(ke,(e=>{const t=[];e.hooks.buildModule.tap(ke,(e=>{if(Ce(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(ke,(()=>{t.map((t=>{const r=P["default"](t.request)[0];const n=xe(r);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new d.RawSource(s.source().toString().replace(`"${r}"`,n));o.set("javascript",e)}}))}))}))}}function xe(e){const t=[];const r=[];let n=false;let o=false;for(const s of e){if(s==="["){if(n){o=true;break}n=true;if(r.length){t.push(`"${r.join("")}"`);r.length=0}}else if(s==="]"){if(!n){o=true;break}n=false;if(r.length){t.push(`${r.join("")}`);r.length=0}r.length=0}else{r.push(s)}}if(n||o){throw new Error(`Invalid template URL "${e}"`)}if(r.length){t.push(`"${r.join("")}"`)}return t.join(" + ")}const Me=`HtmlInjectScriptPlugin`;class Se{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${Me}_compilation`,(e=>{const t=A["default"].getHooks(e);t.alterAssetTags.tap(`${Me}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Pe=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Ae=e=>o.join(e,`micro-remote-module.js`);const Ee=(t,[r,n],o)=>{var s;const a=(s=n.options)==null?void 0:s.moduleFederation;const l=[];if(a){const{remotes:n,...s}=a;const c=Ae(r);const u=Pe(r);const p=(n||[]).map((({name:t,endpoint:r})=>{const n=Pe(t);const o=Ae(t);const s=r?e.ensureSlash(r(t),false):`[window.evolveFetchMicroWidgets()]`;return{[n]:`${n}@${s}/${o}`}}));l.push(new i.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Oe);if(!t){l.unshift(new Se([re(o)]))}}return l};const Re={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const Be=(e,t,[r,n],o)=>{const s=[];const{options:a}=n;const i=e?"development":"production";for(const e of o){s.push(new A["default"]({inject:"body",title:H("title",i,a==null?void 0:a.title),chunks:[r],minify:(a==null?void 0:a.minify)===false?false:["me","dev"].includes(e)?false:Re,filename:`${r}/index${e==="prod"?"":`-${e}`}.html`,template:H("template",i,a==null?void 0:a.template).replace(`{0}`,e),templateParameters:{title:H("title",i,a==null?void 0:a.title),favicon:H("favicon",i,a==null?void 0:a.favicon),inlineScripts:H("inlineScripts",i,a==null?void 0:a.inlineScripts),headBeforeStyles:H("headBeforeStyles",i,a==null?void 0:a.headBeforeStyles),headBeforeScripts:H("headBeforeScripts",i,a==null?void 0:a.headBeforeScripts),bodyAfterScripts:H("bodyAfterScripts",i,a==null?void 0:a.bodyAfterScripts),viewport:se(t,a)?H("viewport",i,a==null?void 0:a.viewport):""},multiCdn:{env:e,disabled:((a==null?void 0:a.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class $e{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=i.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,r)=>{var n;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(n=e.chunkGraph)==null?void 0:n.getTreeRuntimeRequirements(r);if(s&&s.has(i.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(i.Template.indent(`var flatjsMultiCdn = {`));o.push(i.Template.indent(i.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(i.Template.indent(i.Template.indent([`cdnFinder: ${ee.toString()}`])));o.push(i.Template.indent(`};`));o.push(i.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return i.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{A["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:r}=e.plugin;const n=r.multiCdn;const s=t.publicPath;const a=t.js.map((e=>{if(n.disabled){return o.basename(e)}const t=te(this.config,n.env);return Z(t,e.replace(s,""))}));const i=t.css.map((e=>{if(n.disabled){return o.basename(e)}const t=te(this.config,n.env);return Z(t,e.replace(s,""))}));e.assets.js=a;e.assets.css=i;return e}))}))}}const Te=(e,t,r)=>{const n=[new S["default"]];if(r.analyzer){n.push(new p.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...r.analyzer}))}n.push(je(e,r.pluginLoaderOptions));n.push(...Ee(e,t,r.multiHtmlCdn));if(!e){n.push(we(t));const o=Object.keys(r.multiHtmlCdn);n.push(...Be(e,r,t,o));n.push(new $e(r.multiHtmlCdn))}return n};const qe=(t,r,n,s)=>{process.env.NODE_ENV=t;r=e.ensureSlash(r,true);const a=t==="development";const i=s.projectCwd;const l=s.pluginLoaderOptions;const c=s.watchOptions;const u=ae(n);const p=[...be(a,s,u,l),...s.extraLoaders||[]];const d=[...Te(a,u,s),...s.extraPlugins||[]];const f={mode:t,target:s.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":false,plugins:d,watchOptions:c,context:i,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:s.resolveAlias||{}},module:{rules:p},externals:L(s.externals,u),performance:Y(a,s.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(i,"public"),publicPath:r,filename:`[name]/${le("js",a,l==null?void 0:l.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:s.minimize===false?false:a?false:true,minimizer:[new x["default"](K(s.minimizeTerserOptions))],splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return f};const _e=(e,t,r)=>{const n=qe("production",t,e,r);const o=ne(e,n);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{O["default"](s,((n,o)=>{var a,i;if(n){return t(n)}const l=o==null?void 0:o.toJson();if(l!=null&&(a=l.errors)!=null&&a.length){return t(l.errors)}if(r.forBuild.rejectWarnings&&l!=null&&(i=l.warnings)!=null&&i.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Fe=async(t,r)=>{var n;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:r.needVerifyPackages||{}});const o=((n=r.multiHtmlCdn)==null?void 0:n.prod)||[];const s=[];const a=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,n]of Object.entries(t)){const t=oe(n,r);const o={[e]:n};s.push(_e(o,a,t))}return Promise.all(s)};var De={exports:{}};var Ie=/[|\\{}()[\]^$+*?.]/g;var Ne=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(Ie,"\\$&")};var We={exports:{}};var ze={exports:{}};var Le={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Ue=Le;var Ge={};for(var He in Ue){if(Ue.hasOwnProperty(He)){Ge[Ue[He]]=He}}var Ve=ze.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Je in Ve){if(Ve.hasOwnProperty(Je)){if(!("channels"in Ve[Je])){throw new Error("missing channels property: "+Je)}if(!("labels"in Ve[Je])){throw new Error("missing channel labels property: "+Je)}if(Ve[Je].labels.length!==Ve[Je].channels){throw new Error("channel and label counts mismatch: "+Je)}var Ye=Ve[Je].channels;var Ke=Ve[Je].labels;delete Ve[Je].channels;delete Ve[Je].labels;Object.defineProperty(Ve[Je],"channels",{value:Ye});Object.defineProperty(Ve[Je],"labels",{value:Ke})}}Ve.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var s=Math.max(t,r,n);var a=s-o;var i;var l;var c;if(s===o){i=0}else if(t===s){i=(r-n)/a}else if(r===s){i=2+(n-t)/a}else if(n===s){i=4+(t-r)/a}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=a/(s+o)}else{l=a/(2-s-o)}return[i,l*100,c*100]};Ve.rgb.hsv=function(e){var t;var r;var n;var o;var s;var a=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(a,i,l);var u=c-Math.min(a,i,l);var p=function(e){return(c-e)/6/u+1/2};if(u===0){o=s=0}else{s=u/c;t=p(a);r=p(i);n=p(l);if(a===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};Ve.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=Ve.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};Ve.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var s;var a;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;s=(1-r-i)/(1-i)||0;a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function Xe(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}Ve.rgb.keyword=function(e){var t=Ge[e];if(t){return t}var r=Infinity;var n;for(var o in Ue){if(Ue.hasOwnProperty(o)){var s=Ue[o];var a=Xe(e,s);if(a<r){r=a;n=o}}}return n};Ve.keyword.rgb=function(e){return Ue[e]};Ve.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var a=t*.0193+r*.1192+n*.9505;return[o*100,s*100,a*100]};Ve.rgb.lab=function(e){var t=Ve.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var s;var a;var i;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=116*n-16;a=500*(r-n);i=200*(n-o);return[s,a,i]};Ve.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}o=2*n-s;i=[0,0,0];for(var c=0;c<3;c++){a=t+1/3*-(c-1);if(a<0){a++}if(a>1){a--}if(6*a<1){l=o+(s-o)*6*a}else if(2*a<1){l=s}else if(3*a<2){l=o+(s-o)*(2/3-a)*6}else{l=o}i[c]=l*255}return i};Ve.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var s=Math.max(n,.01);var a;var i;n*=2;r*=n<=1?n:2-n;o*=s<=1?s:2-s;i=(n+r)/2;a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};Ve.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var s=t-Math.floor(t);var a=255*n*(1-r);var i=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(o){case 0:return[n,l,a];case 1:return[i,n,a];case 2:return[a,n,l];case 3:return[a,i,n];case 4:return[l,a,n];case 5:return[n,a,i]}};Ve.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var s;var a;var i;i=(2-r)*n;s=(2-r)*o;a=r*o;a/=s<=1?s:2-s;a=a||0;i/=2;return[t,a*100,i*100]};Ve.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var s;var a;var i;var l;if(o>1){r/=o;n/=o}s=Math.floor(6*t);a=1-n;i=6*t-s;if((s&1)!==0){i=1-i}l=r+i*(a-r);var c;var u;var p;switch(s){default:case 6:case 0:c=a;u=l;p=r;break;case 1:c=l;u=a;p=r;break;case 2:c=r;u=a;p=l;break;case 3:c=r;u=l;p=a;break;case 4:c=l;u=r;p=a;break;case 5:c=a;u=r;p=l;break}return[c*255,u*255,p*255]};Ve.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var s;var a;var i;s=1-Math.min(1,t*(1-o)+o);a=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[s*255,a*255,i*255]};Ve.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;o=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;a=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};Ve.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;s=500*(t-r);a=200*(r-n);return[o,s,a]};Ve.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;s=(t+16)/116;o=r/500+s;a=s-n/200;var i=Math.pow(s,3);var l=Math.pow(o,3);var c=Math.pow(a,3);s=i>.008856?i:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;a=c>.008856?c:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};Ve.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;o=Math.atan2(n,r);s=o*360/2/Math.PI;if(s<0){s+=360}a=Math.sqrt(r*r+n*n);return[t,a,s]};Ve.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;a=n/360*2*Math.PI;o=r*Math.cos(a);s=r*Math.sin(a);return[t,o,s]};Ve.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:Ve.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){s+=60}return s};Ve.hsv.ansi16=function(e){return Ve.rgb.ansi16(Ve.hsv.rgb(e),e[2])};Ve.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};Ve.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,o,s]};Ve.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,o,s]};Ve.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ve.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var s=n>>8&255;var a=n&255;return[o,s,a]};Ve.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var a=o-s;var i;var l;if(a<1){i=s/(1-a)}else{i=0}if(a<=0){l=0}else if(o===t){l=(r-n)/a%6}else if(o===r){l=2+(n-t)/a}else{l=4+(t-r)/a+4}l/=6;l%=1;return[l*360,a*100,i*100]};Ve.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};Ve.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};Ve.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var s=t%1*6;var a=s%1;var i=1-a;var l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};Ve.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};Ve.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};Ve.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};Ve.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var s=0;if(o<1){s=(n-o)/(1-o)}return[e[0],o*100,s*100]};Ve.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ve.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ve.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ve.gray.hsl=Ve.gray.hsv=function(e){return[0,0,e[0]]};Ve.gray.hwb=function(e){return[0,100,e[0]]};Ve.gray.cmyk=function(e){return[0,0,0,e[0]]};Ve.gray.lab=function(e){return[e[0],0,0]};Ve.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ve.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var Qe=ze.exports;function Ze(){var e={};var t=Object.keys(Qe);for(var r=t.length,n=0;n<r;n++){e[t[n]]={distance:-1,parent:null}}return e}function et(e){var t=Ze();var r=[e];t[e].distance=0;while(r.length){var n=r.pop();var o=Object.keys(Qe[n]);for(var s=o.length,a=0;a<s;a++){var i=o[a];var l=t[i];if(l.distance===-1){l.distance=t[n].distance+1;l.parent=n;r.unshift(i)}}}return t}function tt(e,t){return function(r){return t(e(r))}}function rt(e,t){var r=[t[e].parent,e];var n=Qe[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);n=tt(Qe[t[o].parent][o],n);o=t[o].parent}n.conversion=r;return n}var nt=function(e){var t=et(e);var r={};var n=Object.keys(t);for(var o=n.length,s=0;s<o;s++){var a=n[s];var i=t[a];if(i.parent===null){continue}r[a]=rt(a,t)}return r};var ot=ze.exports;var st=nt;var at={};var it=Object.keys(ot);function lt(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function ct(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o<n;o++){r[o]=Math.round(r[o])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}it.forEach((function(e){at[e]={};Object.defineProperty(at[e],"channels",{value:ot[e].channels});Object.defineProperty(at[e],"labels",{value:ot[e].labels});var t=st(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];at[e][r]=ct(n);at[e][r].raw=lt(n)}))}));var ut=at;(function(e){const t=ut;const r=(e,r)=>function(){const n=e.apply(t,arguments);return`[${n+r}m`};const n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`};const o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};function s(){const e=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.grey=s.color.gray;for(const t of Object.keys(s)){const r=s[t];for(const t of Object.keys(r)){const n=r[t];s[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=s[t];e.set(n[0],n[1])}Object.defineProperty(s,t,{value:r,enumerable:false});Object.defineProperty(s,"codes",{value:e,enumerable:false})}const a=e=>e;const i=(e,t,r)=>[e,t,r];s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi={ansi:r(a,0)};s.color.ansi256={ansi256:n(a,0)};s.color.ansi16m={rgb:o(i,0)};s.bgColor.ansi={ansi:r(a,10)};s.bgColor.ansi256={ansi256:n(a,10)};s.bgColor.ansi16m={rgb:o(i,10)};for(let e of Object.keys(t)){if(typeof t[e]!=="object"){continue}const a=t[e];if(e==="ansi16"){e="ansi"}if("ansi16"in a){s.color.ansi[e]=r(a.ansi16,0);s.bgColor.ansi[e]=r(a.ansi16,10)}if("ansi256"in a){s.color.ansi256[e]=n(a.ansi256,0);s.bgColor.ansi256[e]=n(a.ansi256,10)}if("rgb"in a){s.color.ansi16m[e]=o(a.rgb,0);s.bgColor.ansi16m[e]=o(a.rgb,10)}}return s}Object.defineProperty(e,"exports",{enumerable:true,get:s})})(We);var pt=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n<o)};const dt=E["default"];const ft=pt;const vt=process.env;let ht;if(ft("no-color")||ft("no-colors")||ft("color=false")){ht=false}else if(ft("color")||ft("colors")||ft("color=true")||ft("color=always")){ht=true}if("FORCE_COLOR"in vt){ht=vt.FORCE_COLOR.length===0||parseInt(vt.FORCE_COLOR,10)!==0}function mt(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function gt(e){if(ht===false){return 0}if(ft("color=16m")||ft("color=full")||ft("color=truecolor")){return 3}if(ft("color=256")){return 2}if(e&&!e.isTTY&&ht!==true){return 0}const t=ht?1:0;if(process.platform==="win32"){const e=dt.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in vt){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in vt))||vt.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in vt){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(vt.TEAMCITY_VERSION)?1:0}if(vt.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in vt){const e=parseInt((vt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(vt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(vt.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(vt.TERM)){return 1}if("COLORTERM"in vt){return 1}if(vt.TERM==="dumb"){return t}return t}function bt(e){const t=gt(e);return mt(t)}var yt={supportsColor:bt,stdout:bt(process.stdout),stderr:bt(process.stderr)};const wt=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const jt=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const kt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const Ct=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const Ot=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function xt(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return Ot.get(e)||e}function Mt(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(kt)){r.push(o[2].replace(Ct,((e,t,r)=>t?xt(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function St(e){jt.lastIndex=0;const t=[];let r;while((r=jt.exec(e))!==null){const e=r[1];if(r[2]){const n=Mt(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function Pt(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}var At=(e,t)=>{const r=[];const n=[];let o=[];t.replace(wt,((t,s,a,i,l,c)=>{if(s){o.push(xt(s))}else if(i){const t=o.join("");o=[];n.push(r.length===0?t:Pt(e,r)(t));r.push({inverse:a,styles:St(i)})}else if(l){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}n.push(Pt(e,r)(o.join("")));o=[];r.pop()}else{o.push(c)}}));n.push(o.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};(function(e){const t=Ne;const r=We.exports;const n=yt.stdout;const o=At;const s=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const a=["ansi","ansi","ansi256","ansi16m"];const i=new Set(["gray"]);const l=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};c(t,e);t.template=function(){const e=[].slice.call(arguments);return v.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,u.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=u;return t.template}c(this,e)}if(s){r.blue.open="[94m"}for(const e of Object.keys(r)){r[e].closeRe=new RegExp(t(r[e].close),"g");l[e]={get(){const t=r[e];return d.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}l.visible={get(){return d.call(this,this._styles||[],true,"visible")}};r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi)){if(i.has(e)){continue}l[e]={get(){const t=this.level;return function(){const n=r.color[a[t]][e].apply(null,arguments);const o={open:n,close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(i.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const t=this.level;return function(){const n=r.bgColor[a[t]][e].apply(null,arguments);const o={open:n,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}const p=Object.defineProperties((()=>{}),l);function d(e,t,r){const n=function(){return f.apply(n,arguments)};n._styles=e;n._empty=t;const o=this;Object.defineProperty(n,"level",{enumerable:true,get(){return o.level},set(e){o.level=e}});Object.defineProperty(n,"enabled",{enumerable:true,get(){return o.enabled},set(e){o.enabled=e}});n.hasGrey=this.hasGrey||r==="gray"||r==="grey";n.__proto__=p;return n}function f(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let r=1;r<t;r++){n+=" "+e[r]}}if(!this.enabled||this.level<=0||!n){return this._empty?"":n}const o=r.dim.open;if(s&&this.hasGrey){r.dim.open=""}for(const e of this._styles.slice().reverse()){n=e.open+n.replace(e.closeRe,e.open)+e.close;n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`)}r.dim.open=o;return n}function v(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(u.prototype,l);e.exports=u();e.exports.supportsColor=n;e.exports.default=e.exports})(De);var Et=De.exports;const Rt=async(r,n,s)=>{const a=await e.getPackageDir(__dirname,process.cwd());const i=y.readFileSync(o.join(a,"./templates/main.html"),"utf-8");const l=[];for(const[t]of Object.entries(s.entryMap)){const o=Object.keys(r).includes(t);l.push({name:t.replace(s.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(n,["pages",t],{env:"me"}),flagText:o?"serve":"static",isServed:o?1:0})}const c={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(i)(c)};const Bt=async(r,n,s,a,i)=>{const l=i.entryMap;const c=Object.keys(l).sort(((e,t)=>t.length-e.length));const u=await e.getPackageDir(__dirname,process.cwd());const p=c.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!p){const e=y.readFileSync(o.join(u,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:u},{name:`served entry names`,value:JSON.stringify(c)},{name:`module path`,value:`${s.path}`}]})}const d=l[p];const f=d.options;const v=r[p];const h=(v==null?void 0:v.devServerHostUri)||a;const m=(f==null?void 0:f.serveModuleTemplate)||"./templates/module.html";const g=o.join(i.projectCwd,"./templates/module.html");const b=y.readFileSync(o.isAbsolute(m)?m:e.existsSync(g)?g:o.join(u,"./templates/module.html"),"utf-8");const w=i.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(d,a):{};const k={title:H("title",n,f==null?void 0:f.title),favicon:H("favicon",n,f==null?void 0:f.favicon),viewport:se(i,f)?H("viewport",n,f==null?void 0:f.viewport):"",inlineScripts:H("inlineScripts",n,f==null?void 0:f.inlineScripts),headBeforeStyles:H("headBeforeStyles",n,f==null?void 0:f.headBeforeStyles),headBeforeScripts:H("headBeforeScripts",n,f==null?void 0:f.headBeforeScripts),bodyAfterScripts:H("bodyAfterScripts",n,f==null?void 0:f.bodyAfterScripts),moduleFederationScripts:re({me:[e.urlJoin(a,["public"])]}),global:{hostUrl:a,apiBase:e.urlJoin(a,["api"]),routeBaseName:o.join(`/pages`,p),...j,...(f==null?void 0:f.serveGlobalData)||{}},styles:[e.urlJoin(h,[o.join("public",p,"bundle.css")])],scripts:[e.urlJoin(h,[o.join("public",p,"bundle.js")])]};return t.template(b)(k)};const $t=(e,t,r,n)=>{const o=async(o,s)=>{let a;if(o.path==="/"){a=await Rt(r,t,n)}else{a=await Bt(r,e,o,t,n)}s.send(a)};return(n.forServe.pageMiddlewares||[]).concat(o)};const Tt=t=>async(r,n)=>{const s=r.baseUrl;if(!s.startsWith("/public")){n.redirect("/pages")}else{const r=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const a=o.extname(s);const i=r.find((e=>o.extname(e)===a&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(i){n.sendFile(i)}else{n.sendFile(o.join(t,s))}}};const qt=(e,t="development",n,o,s,a,i)=>{const l=B["default"]();r.attachMockMiddlewares(l,i);l.set("hostUri",o);l.use("/pages",...$t(t,o,s,a));l.use("*",Tt(e));return new Promise((e=>{const t=a.https?$["default"].createServer(a.https,l):l;t.listen(n,(()=>{e(true)}))}))};const _t=(e,t,r)=>{const{projectCwd:n,https:s,liveReload:a}=r;const i=new R["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!a,liveReload:a,allowedHosts:"all",static:{directory:`${o.join(n,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{i.startCallback((r=>{if(r){return t(r)}e(true)}))}))};const Ft=async(n,s,a,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:a.needVerifyPackages||{}});if(a.https){l.https=a.https}const{mockPort:c,hostUri:u}=await r.prepareMockDomain(l);const p=e.urlJoin(u,["/pages"]);let d=c;const f=[];const v={};for(const[e]of Object.entries(s)){d=d+1;const{mockPort:n,hostUri:o}=await r.prepareMockDomain(t.merge({},l,{port:d}));v[e]={devServerPort:n,devServerHostUri:o}}for(const[t,r]of Object.entries(s)){var h,m;const s=((h=r.options)==null?void 0:(m=h.moduleFederation)==null?void 0:m.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var r;return e.urlJoin(((r=v[t])==null?void 0:r.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:c}=v[t];const d=e.urlJoin(c,["public"]);const g={[t]:r};const b=oe(r,a);const y=qe("development",d,g,b);const w=i.webpack(ne(g,y)[0]);f.push(_t(w,l,a));const j=Et.bgBlack(`[${Et.magenta("@flatjs")}:${Et.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${Et.cyan(o.relative(n,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${Et.cyan(p)}`)}))}await qt(n,"development",c,u,v,a,l);Q(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Dt=async(t,n,o)=>{if(n.https){o.https=n.https}const{mockPort:s,hostUri:a}=await r.prepareMockDomain(o);const i=e.urlJoin(a,["/pages"]);return qt(t,"development",s,a,{},n,o).then((e=>{const t=Et.bgBlack(`[${Et.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${Et.cyan(i)}`);return e}))};const It=(e={},r={})=>{const n={};for(const[o,s]of Object.entries(r)){const r={options:{}};if(e[o]){n[o]=t.merge({},r,s,e[o])}t.merge(s,r)}return n};const Nt=(e,t,r={})=>{const n=X(e,r);const o=It(t,n.entryMap);return Fe(o,n)};const Wt=(e,t,n={},o={})=>{const s=X(e,n);const a=r.loadMockConfiguration(e,o);const i=It(t,s.entryMap);return Ft(e,i,s,a)};const zt=(e,t={},n={})=>{const o=X(e,t);const s=r.loadMockConfiguration(e,n);return Dt(e,o,s)};exports.cdnBoot=W;exports.cdnJsDelivr=N;exports.cdnUnpkg=I;exports.createPageMiddleware=$t;exports.createPublicAssetsMiddleware=Tt;exports.defaultFlatjsConfig=z;exports.evolveBuild=Nt;exports.evolveServe=Wt;exports.evolveStatic=zt;exports.flatBabelOptions=F;exports.flatExternalOptions=L;exports.flatLessLoaderOptions=V;exports.flatPerformanceOptions=Y;exports.flatPostcssLoaderOptions=J;exports.getHtmlPluginConfig=H;exports.loadEvolveConfiguration=X;exports.loadModule=_;exports.normalizeEntries=It;exports.polyfill=D;exports.terserOptions=K;exports.viewportScripts=U;
|
4
|
+
extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const X=(r=process.cwd(),n)=>{const o=e.loadFlatjsConfig(r,"flatjsEvolve","flatjs.evolve.js");return t.merge({},z.flatjsEvolve,o.flatjsEvolve,n,{projectCwd:r})};const Q=e=>{try{T["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function Z(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function ee(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=t.exec(window.location.href);const n=r&&r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"prod";const o=e[n]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function te(e={},t="prod"){const r=e[t]||e["prod"]||[];return r[Math.floor(Math.random()*r.length)]}function re(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${ee.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function ne(e,r){const n=[];for(const[t,r]of Object.entries(e)){n.push({[t]:r.entry})}return n.map((e=>t.merge({},r,{name:Object.keys(e)[0],entry:e})))}const oe=(e,r)=>{var n,o;const s=t.merge({},r.pluginLoaderOptions);if((n=e.options)!=null&&n.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const a={...r,pluginLoaderOptions:s};return a};const se=(e,t)=>{var r,n,o;const s=(r=e.pluginLoaderOptions)==null?void 0:(n=r.pixelOptions)==null?void 0:n.enabled;const a=(o=t==null?void 0:t.allowPx2rem)!=null?o:s;return!!a};const ae=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[r,n]of Object.entries(e)){t=[r,n];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const ie=()=>Date.now().toString();const le=(e,t,r=true)=>{const n=e==="js"?".js":".css";if(t){return`bundle${n}`}if(r){return`bundle[contenthash]${n}`}return`bundle${n}?${ie()}`};const ce=/icons\//;const ue=/\.(jpe?g|png|gif|svg)$/;const pe=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const de=({projectCwd:e,projectVirtualPath:t},r,[n,s])=>{let a=o.dirname(o.join(t,r.replace(/^src/,"")));const i=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,r);const c=i.find((e=>l.startsWith(e)));if(c){a=o.dirname(o.join(n,o.relative(c,l)))}return`${a}/[name]-[contenthash:8][ext]`};const fe=(e,t)=>{const r={test(e){return pe.test(e)||ue.test(e)&&!ce.test(e)},type:"asset",generator:{filename({filename:r}){return de(e,r,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return r};const he=()=>{const e={test(e){return ce.test(e)&&e.endsWith(".svg")},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};const ve=(e={},t=[])=>{const r={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:"babel-loader",options:F(e,t)}]};return r};const me=(e,t={})=>{const r={test:/\.css$/i,use:[{loader:M["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};if(Array.isArray(r.use)){r.use.push({loader:"postcss-loader",options:{postcssOptions:J(e,t),sourceMap:e}})}return r};const ge=(e,t={},r={})=>{const n=me(e,r);n.test=/\.less$/i;if(Array.isArray(n.use)){n.use.push({loader:"less-loader",options:{sourceMap:e,lessOptions:V(e,t)}})}return n};const be=(e,t,r,n={})=>{const o=[he(),fe(t,r),me(e,n.pixelOptions),ge(e,n.lessOptions,n.pixelOptions),ve(n.babelOptions,n.modularImports)];return o};class ye{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const r=t.map((e=>e.name));const n=this.currentAssets.filter((e=>{const t=r.includes(e)===false;return t}));this.currentAssets=r.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&n.length!==0){o.push(...n)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const r=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){r.forEach((e=>{const t=o.relative(process.cwd(),e);const r="removed";console.warn(`clean-webpack-plugin: ${r} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const we=t=>new ye({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const je=(e,t)=>new M["default"]({filename:`[name]/${le("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const ke="ExternalTemplateRemotesPlugin";const Ce=e=>e.constructor.name==="ExternalModule";class Oe{apply(e){e.hooks.make.tap(ke,(e=>{const t=[];e.hooks.buildModule.tap(ke,(e=>{if(Ce(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(ke,(()=>{t.map((t=>{const r=P["default"](t.request)[0];const n=xe(r);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new d.RawSource(s.source().toString().replace(`"${r}"`,n));o.set("javascript",e)}}))}))}))}}function xe(e){const t=[];const r=[];let n=false;let o=false;for(const s of e){if(s==="["){if(n){o=true;break}n=true;if(r.length){t.push(`"${r.join("")}"`);r.length=0}}else if(s==="]"){if(!n){o=true;break}n=false;if(r.length){t.push(`${r.join("")}`);r.length=0}r.length=0}else{r.push(s)}}if(n||o){throw new Error(`Invalid template URL "${e}"`)}if(r.length){t.push(`"${r.join("")}"`)}return t.join(" + ")}const Me=`HtmlInjectScriptPlugin`;class Se{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${Me}_compilation`,(e=>{const t=A["default"].getHooks(e);t.alterAssetTags.tap(`${Me}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Pe=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Ae=e=>o.join(e,`micro-remote-module.js`);const Ee=(t,[r,n],o)=>{var s;const a=(s=n.options)==null?void 0:s.moduleFederation;const l=[];if(a){const{remotes:n,...s}=a;const c=Ae(r);const u=Pe(r);const p=(n||[]).map((({name:t,endpoint:r})=>{const n=Pe(t);const o=Ae(t);const s=r?e.ensureSlash(r(t),false):`[window.evolveFetchMicroWidgets()]`;return{[n]:`${n}@${s}/${o}`}}));l.push(new i.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Oe);if(!t){l.unshift(new Se([re(o)]))}}return l};const Re={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const Be=(e,t,[r,n],o)=>{const s=[];const{options:a}=n;const i=e?"development":"production";for(const e of o){s.push(new A["default"]({inject:"body",title:H("title",i,a==null?void 0:a.title),chunks:[r],minify:(a==null?void 0:a.minify)===false?false:["me","dev"].includes(e)?false:Re,filename:`${r}/index${e==="prod"?"":`-${e}`}.html`,template:H("template",i,a==null?void 0:a.template).replace(`{0}`,e),templateParameters:{title:H("title",i,a==null?void 0:a.title),favicon:H("favicon",i,a==null?void 0:a.favicon),inlineScripts:H("inlineScripts",i,a==null?void 0:a.inlineScripts),headBeforeStyles:H("headBeforeStyles",i,a==null?void 0:a.headBeforeStyles),headBeforeScripts:H("headBeforeScripts",i,a==null?void 0:a.headBeforeScripts),bodyAfterScripts:H("bodyAfterScripts",i,a==null?void 0:a.bodyAfterScripts),viewport:se(t,a)?H("viewport",i,a==null?void 0:a.viewport):""},multiCdn:{env:e,disabled:((a==null?void 0:a.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class $e{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=i.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,r)=>{var n;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(n=e.chunkGraph)==null?void 0:n.getTreeRuntimeRequirements(r);if(s&&s.has(i.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(i.Template.indent(`var flatjsMultiCdn = {`));o.push(i.Template.indent(i.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(i.Template.indent(i.Template.indent([`cdnFinder: ${ee.toString()}`])));o.push(i.Template.indent(`};`));o.push(i.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return i.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{A["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:r}=e.plugin;const n=r.multiCdn;const s=t.publicPath;const a=t.js.map((e=>{if(n.disabled){return o.basename(e)}const t=te(this.config,n.env);return Z(t,e.replace(s,""))}));const i=t.css.map((e=>{if(n.disabled){return o.basename(e)}const t=te(this.config,n.env);return Z(t,e.replace(s,""))}));e.assets.js=a;e.assets.css=i;return e}))}))}}const Te=(e,t,r)=>{const n=[new S["default"]];if(r.analyzer){n.push(new p.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...r.analyzer}))}n.push(je(e,r.pluginLoaderOptions));n.push(...Ee(e,t,r.multiHtmlCdn));if(!e){n.push(we(t));const o=Object.keys(r.multiHtmlCdn);n.push(...Be(e,r,t,o));n.push(new $e(r.multiHtmlCdn))}return n};const qe=(t,r,n,s)=>{process.env.NODE_ENV=t;r=e.ensureSlash(r,true);const a=t==="development";const i=s.projectCwd;const l=s.pluginLoaderOptions;const c=s.watchOptions;const u=ae(n);const p=[...be(a,s,u,l),...s.extraLoaders||[]];const d=[...Te(a,u,s),...s.extraPlugins||[]];const f={mode:t,target:s.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":false,plugins:d,watchOptions:c,context:i,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:s.resolveAlias||{}},module:{rules:p},externals:L(s.externals,u),performance:Y(a,s.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(i,"public"),publicPath:r,filename:`[name]/${le("js",a,l==null?void 0:l.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:s.minimize===false?false:a?false:true,minimizer:[new x["default"](K(s.minimizeTerserOptions))],splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return f};const _e=(e,t,r)=>{const n=qe("production",t,e,r);const o=ne(e,n);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{O["default"](s,((n,o)=>{var a,i;if(n){return t(n)}const l=o==null?void 0:o.toJson();if(l!=null&&(a=l.errors)!=null&&a.length){return t(l.errors)}if(r.forBuild.rejectWarnings&&l!=null&&(i=l.warnings)!=null&&i.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Fe=async(t,r)=>{var n;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:r.needVerifyPackages||{}});const o=((n=r.multiHtmlCdn)==null?void 0:n.prod)||[];const s=[];const a=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,n]of Object.entries(t)){const t=oe(n,r);const o={[e]:n};s.push(_e(o,a,t))}return Promise.all(s)};var De={exports:{}};var Ie=/[|\\{}()[\]^$+*?.]/g;var Ne=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(Ie,"\\$&")};var We={exports:{}};var ze={exports:{}};var Le={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Ue=Le;var Ge={};for(var He in Ue){if(Ue.hasOwnProperty(He)){Ge[Ue[He]]=He}}var Ve=ze.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Je in Ve){if(Ve.hasOwnProperty(Je)){if(!("channels"in Ve[Je])){throw new Error("missing channels property: "+Je)}if(!("labels"in Ve[Je])){throw new Error("missing channel labels property: "+Je)}if(Ve[Je].labels.length!==Ve[Je].channels){throw new Error("channel and label counts mismatch: "+Je)}var Ye=Ve[Je].channels;var Ke=Ve[Je].labels;delete Ve[Je].channels;delete Ve[Je].labels;Object.defineProperty(Ve[Je],"channels",{value:Ye});Object.defineProperty(Ve[Je],"labels",{value:Ke})}}Ve.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var s=Math.max(t,r,n);var a=s-o;var i;var l;var c;if(s===o){i=0}else if(t===s){i=(r-n)/a}else if(r===s){i=2+(n-t)/a}else if(n===s){i=4+(t-r)/a}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=a/(s+o)}else{l=a/(2-s-o)}return[i,l*100,c*100]};Ve.rgb.hsv=function(e){var t;var r;var n;var o;var s;var a=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(a,i,l);var u=c-Math.min(a,i,l);var p=function(e){return(c-e)/6/u+1/2};if(u===0){o=s=0}else{s=u/c;t=p(a);r=p(i);n=p(l);if(a===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};Ve.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=Ve.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};Ve.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var s;var a;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;s=(1-r-i)/(1-i)||0;a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function Xe(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}Ve.rgb.keyword=function(e){var t=Ge[e];if(t){return t}var r=Infinity;var n;for(var o in Ue){if(Ue.hasOwnProperty(o)){var s=Ue[o];var a=Xe(e,s);if(a<r){r=a;n=o}}}return n};Ve.keyword.rgb=function(e){return Ue[e]};Ve.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var a=t*.0193+r*.1192+n*.9505;return[o*100,s*100,a*100]};Ve.rgb.lab=function(e){var t=Ve.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var s;var a;var i;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=116*n-16;a=500*(r-n);i=200*(n-o);return[s,a,i]};Ve.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}o=2*n-s;i=[0,0,0];for(var c=0;c<3;c++){a=t+1/3*-(c-1);if(a<0){a++}if(a>1){a--}if(6*a<1){l=o+(s-o)*6*a}else if(2*a<1){l=s}else if(3*a<2){l=o+(s-o)*(2/3-a)*6}else{l=o}i[c]=l*255}return i};Ve.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var s=Math.max(n,.01);var a;var i;n*=2;r*=n<=1?n:2-n;o*=s<=1?s:2-s;i=(n+r)/2;a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};Ve.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var s=t-Math.floor(t);var a=255*n*(1-r);var i=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(o){case 0:return[n,l,a];case 1:return[i,n,a];case 2:return[a,n,l];case 3:return[a,i,n];case 4:return[l,a,n];case 5:return[n,a,i]}};Ve.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var s;var a;var i;i=(2-r)*n;s=(2-r)*o;a=r*o;a/=s<=1?s:2-s;a=a||0;i/=2;return[t,a*100,i*100]};Ve.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var s;var a;var i;var l;if(o>1){r/=o;n/=o}s=Math.floor(6*t);a=1-n;i=6*t-s;if((s&1)!==0){i=1-i}l=r+i*(a-r);var c;var u;var p;switch(s){default:case 6:case 0:c=a;u=l;p=r;break;case 1:c=l;u=a;p=r;break;case 2:c=r;u=a;p=l;break;case 3:c=r;u=l;p=a;break;case 4:c=l;u=r;p=a;break;case 5:c=a;u=r;p=l;break}return[c*255,u*255,p*255]};Ve.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var s;var a;var i;s=1-Math.min(1,t*(1-o)+o);a=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[s*255,a*255,i*255]};Ve.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;o=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;a=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};Ve.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;s=500*(t-r);a=200*(r-n);return[o,s,a]};Ve.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;s=(t+16)/116;o=r/500+s;a=s-n/200;var i=Math.pow(s,3);var l=Math.pow(o,3);var c=Math.pow(a,3);s=i>.008856?i:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;a=c>.008856?c:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};Ve.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;o=Math.atan2(n,r);s=o*360/2/Math.PI;if(s<0){s+=360}a=Math.sqrt(r*r+n*n);return[t,a,s]};Ve.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;a=n/360*2*Math.PI;o=r*Math.cos(a);s=r*Math.sin(a);return[t,o,s]};Ve.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:Ve.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){s+=60}return s};Ve.hsv.ansi16=function(e){return Ve.rgb.ansi16(Ve.hsv.rgb(e),e[2])};Ve.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};Ve.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,o,s]};Ve.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,o,s]};Ve.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ve.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var s=n>>8&255;var a=n&255;return[o,s,a]};Ve.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var a=o-s;var i;var l;if(a<1){i=s/(1-a)}else{i=0}if(a<=0){l=0}else if(o===t){l=(r-n)/a%6}else if(o===r){l=2+(n-t)/a}else{l=4+(t-r)/a+4}l/=6;l%=1;return[l*360,a*100,i*100]};Ve.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};Ve.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};Ve.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var s=t%1*6;var a=s%1;var i=1-a;var l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};Ve.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};Ve.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};Ve.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};Ve.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var s=0;if(o<1){s=(n-o)/(1-o)}return[e[0],o*100,s*100]};Ve.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ve.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ve.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ve.gray.hsl=Ve.gray.hsv=function(e){return[0,0,e[0]]};Ve.gray.hwb=function(e){return[0,100,e[0]]};Ve.gray.cmyk=function(e){return[0,0,0,e[0]]};Ve.gray.lab=function(e){return[e[0],0,0]};Ve.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ve.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var Qe=ze.exports;function Ze(){var e={};var t=Object.keys(Qe);for(var r=t.length,n=0;n<r;n++){e[t[n]]={distance:-1,parent:null}}return e}function et(e){var t=Ze();var r=[e];t[e].distance=0;while(r.length){var n=r.pop();var o=Object.keys(Qe[n]);for(var s=o.length,a=0;a<s;a++){var i=o[a];var l=t[i];if(l.distance===-1){l.distance=t[n].distance+1;l.parent=n;r.unshift(i)}}}return t}function tt(e,t){return function(r){return t(e(r))}}function rt(e,t){var r=[t[e].parent,e];var n=Qe[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);n=tt(Qe[t[o].parent][o],n);o=t[o].parent}n.conversion=r;return n}var nt=function(e){var t=et(e);var r={};var n=Object.keys(t);for(var o=n.length,s=0;s<o;s++){var a=n[s];var i=t[a];if(i.parent===null){continue}r[a]=rt(a,t)}return r};var ot=ze.exports;var st=nt;var at={};var it=Object.keys(ot);function lt(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function ct(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o<n;o++){r[o]=Math.round(r[o])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}it.forEach((function(e){at[e]={};Object.defineProperty(at[e],"channels",{value:ot[e].channels});Object.defineProperty(at[e],"labels",{value:ot[e].labels});var t=st(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];at[e][r]=ct(n);at[e][r].raw=lt(n)}))}));var ut=at;(function(e){const t=ut;const r=(e,r)=>function(){const n=e.apply(t,arguments);return`[${n+r}m`};const n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`};const o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};function s(){const e=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.grey=s.color.gray;for(const t of Object.keys(s)){const r=s[t];for(const t of Object.keys(r)){const n=r[t];s[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=s[t];e.set(n[0],n[1])}Object.defineProperty(s,t,{value:r,enumerable:false});Object.defineProperty(s,"codes",{value:e,enumerable:false})}const a=e=>e;const i=(e,t,r)=>[e,t,r];s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi={ansi:r(a,0)};s.color.ansi256={ansi256:n(a,0)};s.color.ansi16m={rgb:o(i,0)};s.bgColor.ansi={ansi:r(a,10)};s.bgColor.ansi256={ansi256:n(a,10)};s.bgColor.ansi16m={rgb:o(i,10)};for(let e of Object.keys(t)){if(typeof t[e]!=="object"){continue}const a=t[e];if(e==="ansi16"){e="ansi"}if("ansi16"in a){s.color.ansi[e]=r(a.ansi16,0);s.bgColor.ansi[e]=r(a.ansi16,10)}if("ansi256"in a){s.color.ansi256[e]=n(a.ansi256,0);s.bgColor.ansi256[e]=n(a.ansi256,10)}if("rgb"in a){s.color.ansi16m[e]=o(a.rgb,0);s.bgColor.ansi16m[e]=o(a.rgb,10)}}return s}Object.defineProperty(e,"exports",{enumerable:true,get:s})})(We);var pt=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n<o)};const dt=E["default"];const ft=pt;const ht=process.env;let vt;if(ft("no-color")||ft("no-colors")||ft("color=false")){vt=false}else if(ft("color")||ft("colors")||ft("color=true")||ft("color=always")){vt=true}if("FORCE_COLOR"in ht){vt=ht.FORCE_COLOR.length===0||parseInt(ht.FORCE_COLOR,10)!==0}function mt(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function gt(e){if(vt===false){return 0}if(ft("color=16m")||ft("color=full")||ft("color=truecolor")){return 3}if(ft("color=256")){return 2}if(e&&!e.isTTY&&vt!==true){return 0}const t=vt?1:0;if(process.platform==="win32"){const e=dt.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in ht){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in ht))||ht.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in ht){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ht.TEAMCITY_VERSION)?1:0}if(ht.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in ht){const e=parseInt((ht.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ht.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ht.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ht.TERM)){return 1}if("COLORTERM"in ht){return 1}if(ht.TERM==="dumb"){return t}return t}function bt(e){const t=gt(e);return mt(t)}var yt={supportsColor:bt,stdout:bt(process.stdout),stderr:bt(process.stderr)};const wt=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const jt=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const kt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const Ct=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const Ot=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function xt(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return Ot.get(e)||e}function Mt(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(kt)){r.push(o[2].replace(Ct,((e,t,r)=>t?xt(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function St(e){jt.lastIndex=0;const t=[];let r;while((r=jt.exec(e))!==null){const e=r[1];if(r[2]){const n=Mt(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function Pt(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}var At=(e,t)=>{const r=[];const n=[];let o=[];t.replace(wt,((t,s,a,i,l,c)=>{if(s){o.push(xt(s))}else if(i){const t=o.join("");o=[];n.push(r.length===0?t:Pt(e,r)(t));r.push({inverse:a,styles:St(i)})}else if(l){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}n.push(Pt(e,r)(o.join("")));o=[];r.pop()}else{o.push(c)}}));n.push(o.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};(function(e){const t=Ne;const r=We.exports;const n=yt.stdout;const o=At;const s=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const a=["ansi","ansi","ansi256","ansi16m"];const i=new Set(["gray"]);const l=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};c(t,e);t.template=function(){const e=[].slice.call(arguments);return h.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,u.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=u;return t.template}c(this,e)}if(s){r.blue.open="[94m"}for(const e of Object.keys(r)){r[e].closeRe=new RegExp(t(r[e].close),"g");l[e]={get(){const t=r[e];return d.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}l.visible={get(){return d.call(this,this._styles||[],true,"visible")}};r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi)){if(i.has(e)){continue}l[e]={get(){const t=this.level;return function(){const n=r.color[a[t]][e].apply(null,arguments);const o={open:n,close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(i.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const t=this.level;return function(){const n=r.bgColor[a[t]][e].apply(null,arguments);const o={open:n,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}const p=Object.defineProperties((()=>{}),l);function d(e,t,r){const n=function(){return f.apply(n,arguments)};n._styles=e;n._empty=t;const o=this;Object.defineProperty(n,"level",{enumerable:true,get(){return o.level},set(e){o.level=e}});Object.defineProperty(n,"enabled",{enumerable:true,get(){return o.enabled},set(e){o.enabled=e}});n.hasGrey=this.hasGrey||r==="gray"||r==="grey";n.__proto__=p;return n}function f(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let r=1;r<t;r++){n+=" "+e[r]}}if(!this.enabled||this.level<=0||!n){return this._empty?"":n}const o=r.dim.open;if(s&&this.hasGrey){r.dim.open=""}for(const e of this._styles.slice().reverse()){n=e.open+n.replace(e.closeRe,e.open)+e.close;n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`)}r.dim.open=o;return n}function h(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(u.prototype,l);e.exports=u();e.exports.supportsColor=n;e.exports.default=e.exports})(De);var Et=De.exports;const Rt=async(r,n,s)=>{const a=await e.getPackageDir(__dirname,process.cwd());const i=y.readFileSync(o.join(a,"./templates/main.html"),"utf-8");const l=[];for(const[t]of Object.entries(s.entryMap)){const o=Object.keys(r).includes(t);l.push({name:t.replace(s.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(n,["pages",t],{env:"me"}),flagText:o?"serve":"static",isServed:o?1:0})}const c={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(i)(c)};const Bt=async(r,n,s,a,i)=>{const l=i.entryMap;const c=Object.keys(l).sort(((e,t)=>t.length-e.length));const u=await e.getPackageDir(__dirname,process.cwd());const p=c.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!p){const e=y.readFileSync(o.join(u,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:u},{name:`served entry names`,value:JSON.stringify(c)},{name:`module path`,value:`${s.path}`}]})}const d=l[p];const f=d.options;const h=r[p];const v=(h==null?void 0:h.devServerHostUri)||a;const m=(f==null?void 0:f.serveModuleTemplate)||"./templates/module.html";const g=o.join(i.projectCwd,"./templates/module.html");const b=y.readFileSync(o.isAbsolute(m)?m:e.existsSync(g)?g:o.join(u,"./templates/module.html"),"utf-8");const w=i.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(d,a):{};const k={title:H("title",n,f==null?void 0:f.title),favicon:H("favicon",n,f==null?void 0:f.favicon),viewport:se(i,f)?H("viewport",n,f==null?void 0:f.viewport):"",inlineScripts:H("inlineScripts",n,f==null?void 0:f.inlineScripts),headBeforeStyles:H("headBeforeStyles",n,f==null?void 0:f.headBeforeStyles),headBeforeScripts:H("headBeforeScripts",n,f==null?void 0:f.headBeforeScripts),bodyAfterScripts:H("bodyAfterScripts",n,f==null?void 0:f.bodyAfterScripts),moduleFederationScripts:re({me:[e.urlJoin(a,["public"])]}),global:{hostUrl:a,apiBase:e.urlJoin(a,["api"]),routeBaseName:o.join(`/pages`,p),...j,...(f==null?void 0:f.serveGlobalData)||{}},styles:[e.urlJoin(v,[o.join("public",p,"bundle.css")])],scripts:[e.urlJoin(v,[o.join("public",p,"bundle.js")])]};return t.template(b)(k)};const $t=(e,t,r,n)=>{const o=async(o,s)=>{let a;if(o.path==="/"){a=await Rt(r,t,n)}else{a=await Bt(r,e,o,t,n)}s.send(a)};return(n.forServe.pageMiddlewares||[]).concat(o)};const Tt=t=>async(r,n)=>{const s=r.baseUrl;if(!s.startsWith("/public")){n.redirect("/pages")}else{const r=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const a=o.extname(s);const i=r.find((e=>o.extname(e)===a&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(i){n.sendFile(i)}else{n.sendFile(o.join(t,s))}}};const qt=(e,t="development",n,o,s,a,i)=>{const l=B["default"]();r.attachMockMiddlewares(l,i);l.set("hostUri",o);l.use("/pages",...$t(t,o,s,a));l.use("*",Tt(e));return new Promise((e=>{const t=a.https?$["default"].createServer(a.https,l):l;t.listen(n,(()=>{e(true)}))}))};const _t=(e,t,r)=>{const{projectCwd:n,https:s,liveReload:a}=r;const i=new R["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!a,liveReload:a,allowedHosts:"all",static:{directory:`${o.join(n,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{i.startCallback((r=>{if(r){return t(r)}e(true)}))}))};const Ft=async(n,s,a,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:a.needVerifyPackages||{}});if(a.https){l.https=a.https}const{mockPort:c,hostUri:u}=await r.prepareMockDomain(l);const p=e.urlJoin(u,["/pages"]);let d=c;const f=[];const h={};for(const[e]of Object.entries(s)){d=d+1;const{mockPort:n,hostUri:o}=await r.prepareMockDomain(t.merge({},l,{port:d}));h[e]={devServerPort:n,devServerHostUri:o}}for(const[t,r]of Object.entries(s)){var v,m;const s=((v=r.options)==null?void 0:(m=v.moduleFederation)==null?void 0:m.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var r;return e.urlJoin(((r=h[t])==null?void 0:r.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:c}=h[t];const d=e.urlJoin(c,["public"]);const g={[t]:r};const b=oe(r,a);const y=qe("development",d,g,b);const w=i.webpack(ne(g,y)[0]);f.push(_t(w,l,a));const j=Et.bgBlack(`[${Et.magenta("@flatjs")}:${Et.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${Et.cyan(o.relative(n,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${Et.cyan(p)}`)}))}await qt(n,"development",c,u,h,a,l);Q(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Dt=async(t,n,o)=>{if(n.https){o.https=n.https}const{mockPort:s,hostUri:a}=await r.prepareMockDomain(o);const i=e.urlJoin(a,["/pages"]);return qt(t,"development",s,a,{},n,o).then((e=>{const t=Et.bgBlack(`[${Et.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${Et.cyan(i)}`);return e}))};const It=(e={},r={})=>{const n={};for(const[o,s]of Object.entries(r)){const r={options:{}};if(e[o]){n[o]=t.merge({},r,s,e[o])}t.merge(s,r)}return n};const Nt=(e,t,r={})=>{const n=X(e,r);const o=It(t,n.entryMap);return Fe(o,n)};const Wt=(e,t,n={},o={})=>{const s=X(e,n);const a=r.loadMockConfiguration(e,o);const i=It(t,s.entryMap);return Ft(e,i,s,a)};const zt=(e,t={},n={})=>{const o=X(e,t);const s=r.loadMockConfiguration(e,n);return Dt(e,o,s)};exports.cdnBoot=W;exports.cdnJsDelivr=N;exports.cdnUnpkg=I;exports.createPageMiddleware=$t;exports.createPublicAssetsMiddleware=Tt;exports.defaultFlatjsConfig=z;exports.evolveBuild=Nt;exports.evolveServe=Wt;exports.evolveStatic=zt;exports.flatBabelOptions=F;exports.flatExternalOptions=L;exports.flatLessLoaderOptions=V;exports.flatPerformanceOptions=Y;exports.flatPostcssLoaderOptions=J;exports.getHtmlPluginConfig=H;exports.loadEvolveConfiguration=X;exports.loadModule=_;exports.normalizeEntries=It;exports.polyfill=D;exports.terserOptions=K;exports.viewportScripts=U;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flatjs/evolve",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.0",
|
4
4
|
"description": "the webpack based tools `evolve` of @flatjs",
|
5
5
|
"sideEffects": false,
|
6
6
|
"main": "index.js",
|
@@ -25,17 +25,17 @@
|
|
25
25
|
"node": ">=13.8.0"
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
|
-
"@babel/core": "^7.
|
28
|
+
"@babel/core": "^7.17.0",
|
29
29
|
"@flatjs/common": "^1.2.97",
|
30
|
-
"@flatjs/evolve-preset-babel": "^1.
|
31
|
-
"@flatjs/forge-plugin-postcss-pixel": "^1.
|
30
|
+
"@flatjs/evolve-preset-babel": "^1.3.0",
|
31
|
+
"@flatjs/forge-plugin-postcss-pixel": "^1.3.0",
|
32
32
|
"@flatjs/mock": "^1.2.97",
|
33
33
|
"babel-loader": "^8.2.3",
|
34
34
|
"babel-merge": "^3.0.0",
|
35
35
|
"babel-plugin-import": "^1.13.3",
|
36
36
|
"better-opn": "^3.0.2",
|
37
37
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
38
|
-
"css-loader": "^6.
|
38
|
+
"css-loader": "^6.6.0",
|
39
39
|
"cssnano": "^5.0.16",
|
40
40
|
"cssnano-preset-default": "^5.1.11",
|
41
41
|
"html-webpack-plugin": "^5.5.0",
|
@@ -43,13 +43,13 @@
|
|
43
43
|
"less-loader": "^10.2.0",
|
44
44
|
"lodash": "^4.17.21",
|
45
45
|
"mini-css-extract-plugin": "^2.5.3",
|
46
|
-
"postcss": "^8.4.
|
46
|
+
"postcss": "^8.4.6",
|
47
47
|
"postcss-loader": "^6.2.1",
|
48
48
|
"svgo": "^2.8.0",
|
49
|
-
"terser-webpack-plugin": "^5.3.
|
50
|
-
"webpack": "^5.
|
49
|
+
"terser-webpack-plugin": "^5.3.1",
|
50
|
+
"webpack": "^5.68.0",
|
51
51
|
"webpack-bundle-analyzer": "^4.5.0",
|
52
|
-
"webpack-dev-server": "4.7.
|
52
|
+
"webpack-dev-server": "4.7.4",
|
53
53
|
"webpack-sources": "^3.2.3"
|
54
54
|
},
|
55
55
|
"devDependencies": {
|
@@ -61,5 +61,5 @@
|
|
61
61
|
"publishConfig": {
|
62
62
|
"access": "public"
|
63
63
|
},
|
64
|
-
"gitHead": "
|
64
|
+
"gitHead": "e3533511ac416d93409d26ccc5f22f4f6605dbcd"
|
65
65
|
}
|