@flatjs/evolve 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
package/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! @flatjs/forge MIT @flatjs/evolve */
2
2
  "use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("lodash");var n=require("@flatjs/mock");var r=require("babel-merge");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var i=require("cssnano");var a=require("webpack");var l=require("mini-css-extract-plugin");var c=require("os");var u=require("tty");var p=require("image-minimizer-webpack-plugin");var d=require("terser-webpack-plugin");var f=require("@pmmmwh/react-refresh-webpack-plugin");var h=require("case-sensitive-paths-webpack-plugin");var m=require("webpack-bundle-analyzer");var g=require("webpack-sources");var b=require("webpack/lib/util/extractUrlAndGlobal");var v=require("html-webpack-plugin");var y=require("webpack-dev-server");var w=require("express");var j=require("https");var k=require("fs");var C=require("better-opn");function O(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var x=O(r);var P=O(i);var M=O(a);var S=O(l);var A=O(c);var E=O(u);var B=O(p);var R=O(d);var $=O(f);var q=O(h);var F=O(b);var T=O(v);var I=O(y);var _=O(w);var D=O(j);var N=O(C);function L(e){let t;const n=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(n?"../../../evolve-preset-babel/src/index":e);break}return t}const z=(e,t=false)=>{if(!t){return require(e)}else{return n.loadModule(e)}};const W=(t={usePreset:"react"},n=[])=>{const{usePreset:r,...o}=t;const s=n.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:i,infernoBabelPreset:a,vueBabelPreset:l}=z(L("@flatjs/evolve-preset-babel"));const c=r==="react"?i():r==="vue"?l():a();let u={};try{u=x["default"](c,o);if(u.plugins){u.plugins.unshift(...s)}else{u.plugins=s}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const U=[`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 H={reactDev:[`https://unpkg.com/react@18.0.0/umd/react.development.js`,`https://unpkg.com/history@5.3.0/umd/history.development.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.development.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.development.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://unpkg.com/react@18.0.0/umd/react.production.min.js`,`https://unpkg.com/history@5.3.0/umd/history.production.min.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.production.min.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const G={reactDev:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.development.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.development.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const V={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.production.min.js`]};const J={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:{usePreset:"react"},lessOptions:{},cssnanoOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const Y=(e,n={},r)=>{var o,s,i;const a=r[1];const l={vue:"Vue",react:"React","react-dom":"ReactDOM"};const c=t.isFunction(n)?n(e):n;const u=t.isFunction((o=a.options)==null?void 0:o.externals)?(s=a.options)==null?void 0:s.externals(e):(i=a.options)==null?void 0:i.externals;return Object.assign({},l,c,u||{})};const K=`(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 X={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...U,...e==="development"?V.reactDev:V.reactProd],bodyAfterScripts:()=>[],viewport:K,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:o.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const Q=(e,n,r)=>{let o;if(r){o=typeof r==="function"?r(n):r}if(t.isUndefined(o)){const t=X[e];return typeof t==="function"?t(n):t}return o};const Z=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const ee=(e,t={},n={})=>{const r=[P["default"]({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e,...n}]})];if(t.enabled!==false){r.push(s.forgePluginPostcssPixel(t))}return{plugins:r}};const te=(e,t={})=>{const n={hints:e?false:"warning"};return Object.assign(n,t)};const ne=(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 re=(n=process.cwd(),r)=>{const o=e.loadFlatjsConfig(n,"flatjsEvolve","flatjs.evolve.js");return t.merge({},J.flatjsEvolve,o.flatjsEvolve,r,{projectCwd:n})};const oe=e=>{try{N["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function se(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function ie(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const n=t.exec(window.location.href);const r=n&&n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"prod";const o=e[r]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function ae(e={},t="prod"){const n=e[t]||e["prod"]||[];return n[Math.floor(Math.random()*n.length)]}function le(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${ie.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function ce(e,n){const r=[];for(const[t,n]of Object.entries(e)){r.push({[t]:n.entry})}return r.map((e=>t.merge({},n,{name:Object.keys(e)[0],entry:e})))}const ue=(e,n)=>{var r,o;const s=t.merge({},n.pluginLoaderOptions);if((r=e.options)!=null&&r.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const i={...n,pluginLoaderOptions:s};return i};const pe=(e,t)=>{var n,r;const o=(n=e.pluginLoaderOptions)==null?void 0:(r=n.pixelOptions)==null?void 0:r.enabled;const s=(t==null?void 0:t.allowPx2rem)??o;return!!s};const de=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[n,r]of Object.entries(e)){t=[n,r];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const fe=()=>Date.now().toString();const he=(e,t,n=true)=>{const r=e==="js"?".js":".css";if(t){return`bundle${r}`}if(n){return`bundle[contenthash]${r}`}return`bundle${r}?${fe()}`};const me=/svg-icons\//;const ge=/\.(jpe?g|png|gif|svg)$/;const be=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const ve=e=>me.test(e)&&e.endsWith(".svg");const ye=({projectCwd:e,projectVirtualPath:t},n,[r,s])=>{let i=o.dirname(o.join(t,n.replace(/^src/,"")));const a=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,n);const c=a.find((e=>l.startsWith(e)));if(c){i=o.dirname(o.join(r,o.relative(c,l)))}return`${i}/[name]-[contenthash:8][ext]`};const we=(e,t)=>{const n={test(e){return be.test(e)||ge.test(e)&&!ve(e)},type:"asset",generator:{filename({filename:n}){return ye(e,n,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return n};const je=()=>{const e={test(e){return ve(e)},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function ke(e,n){const r=t.isFunction(e)?e(n):e;if(r.usePreset==="react"&&n){if(r.plugins){r.plugins.push(require.resolve("react-refresh/babel"))}else{r.plugins=[require.resolve("react-refresh/babel")]}}return r}const Ce=(e,n={})=>{const{babelOptions:r={},modularImports:o=[]}=n;const s=ke(r,e);const i=t.isFunction(o)?o(e):o;const a=W(s,i);const l={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:require.resolve("babel-loader"),options:a}]};return l};const Oe=(e,t={})=>{const n={test:/\.css$/i,use:[{loader:S["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};const{pixelOptions:r,cssnanoOptions:o}=t;if(Array.isArray(n.use)){n.use.push({loader:"postcss-loader",options:{postcssOptions:ee(e,r,o),sourceMap:e}})}return n};const xe=(e,t={})=>{const n=Oe(e,t);n.test=/\.less$/i;const r=t.lessOptions;if(Array.isArray(n.use)){n.use.push({loader:require.resolve("less-loader"),options:{sourceMap:e,lessOptions:Z(e,r)}})}return n};const Pe=(e,t,n,r={})=>{const o=[je(),we(t,n),Oe(e,r),xe(e,r),Ce(e,r)];return o};var Me={exports:{}};var Se;var Ae;function Ee(){if(Ae)return Se;Ae=1;Se={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]};return Se}var Be;var Re;function $e(){if(Re)return Be;Re=1;const e=Ee();const t={};for(const n of Object.keys(e)){t[e[n]]=n}const n={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"]}};Be=n;for(const e of Object.keys(n)){if(!("channels"in n[e])){throw new Error("missing channels property: "+e)}if(!("labels"in n[e])){throw new Error("missing channel labels property: "+e)}if(n[e].labels.length!==n[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:r}=n[e];delete n[e].channels;delete n[e].labels;Object.defineProperty(n[e],"channels",{value:t});Object.defineProperty(n[e],"labels",{value:r})}n.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.min(t,n,r);const s=Math.max(t,n,r);const i=s-o;let a;let l;if(s===o){a=0}else if(t===s){a=(n-r)/i}else if(n===s){a=2+(r-t)/i}else if(r===s){a=4+(t-n)/i}a=Math.min(a*60,360);if(a<0){a+=360}const c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=i/(s+o)}else{l=i/(2-s-o)}return[a,l*100,c*100]};n.rgb.hsv=function(e){let t;let n;let r;let o;let s;const i=e[0]/255;const a=e[1]/255;const l=e[2]/255;const c=Math.max(i,a,l);const u=c-Math.min(i,a,l);const p=function(e){return(c-e)/6/u+1/2};if(u===0){o=0;s=0}else{s=u/c;t=p(i);n=p(a);r=p(l);if(i===c){o=r-n}else if(a===c){o=1/3+t-r}else if(l===c){o=2/3+n-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};n.rgb.hwb=function(e){const t=e[0];const r=e[1];let o=e[2];const s=n.rgb.hsl(e)[0];const i=1/255*Math.min(t,Math.min(r,o));o=1-1/255*Math.max(t,Math.max(r,o));return[s,i*100,o*100]};n.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.min(1-t,1-n,1-r);const s=(1-t-o)/(1-o)||0;const i=(1-n-o)/(1-o)||0;const a=(1-r-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function r(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}n.rgb.keyword=function(n){const o=t[n];if(o){return o}let s=Infinity;let i;for(const t of Object.keys(e)){const o=e[t];const a=r(n,o);if(a<s){s=a;i=t}}return i};n.keyword.rgb=function(t){return e[t]};n.rgb.xyz=function(e){let t=e[0]/255;let n=e[1]/255;let r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805;const s=t*.2126+n*.7152+r*.0722;const i=t*.0193+n*.1192+r*.9505;return[o*100,s*100,i*100]};n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0];let o=t[1];let s=t[2];r/=95.047;o/=100;s/=108.883;r=r>.008856?r**(1/3):7.787*r+16/116;o=o>.008856?o**(1/3):7.787*o+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;const i=116*o-16;const a=500*(r-o);const l=200*(o-s);return[i,a,l]};n.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;let o;let s;let i;if(n===0){i=r*255;return[i,i,i]}if(r<.5){o=r*(1+n)}else{o=r+n-r*n}const a=2*r-o;const l=[0,0,0];for(let e=0;e<3;e++){s=t+1/3*-(e-1);if(s<0){s++}if(s>1){s--}if(6*s<1){i=a+(o-a)*6*s}else if(2*s<1){i=o}else if(3*s<2){i=a+(o-a)*(2/3-s)*6}else{i=a}l[e]=i*255}return l};n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let r=e[2]/100;let o=n;const s=Math.max(r,.01);r*=2;n*=r<=1?r:2-r;o*=s<=1?s:2-s;const i=(r+n)/2;const a=r===0?2*o/(s+o):2*n/(r+n);return[t,a*100,i*100]};n.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6;const s=t-Math.floor(t);const i=255*r*(1-n);const a=255*r*(1-n*s);const l=255*r*(1-n*(1-s));r*=255;switch(o){case 0:return[r,l,i];case 1:return[a,r,i];case 2:return[i,r,l];case 3:return[i,a,r];case 4:return[l,i,r];case 5:return[r,i,a]}};n.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const r=e[2]/100;const o=Math.max(r,.01);let s;let i;i=(2-n)*r;const a=(2-n)*o;s=n*o;s/=a<=1?a:2-a;s=s||0;i/=2;return[t,s*100,i*100]};n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let r=e[2]/100;const o=n+r;let s;if(o>1){n/=o;r/=o}const i=Math.floor(6*t);const a=1-r;s=6*t-i;if((i&1)!==0){s=1-s}const l=n+s*(a-n);let c;let u;let p;switch(i){default:case 6:case 0:c=a;u=l;p=n;break;case 1:c=l;u=a;p=n;break;case 2:c=n;u=a;p=l;break;case 3:c=n;u=l;p=a;break;case 4:c=l;u=n;p=a;break;case 5:c=a;u=n;p=l;break}return[c*255,u*255,p*255]};n.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;const o=e[3]/100;const s=1-Math.min(1,t*(1-o)+o);const i=1-Math.min(1,n*(1-o)+o);const a=1-Math.min(1,r*(1-o)+o);return[s*255,i*255,a*255]};n.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;let o;let s;let i;o=t*3.2406+n*-1.5372+r*-.4986;s=t*-.9689+n*1.8758+r*.0415;i=t*.0557+n*-.204+r*1.057;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);i=Math.min(Math.max(0,i),1);return[o*255,s*255,i*255]};n.xyz.lab=function(e){let t=e[0];let n=e[1];let r=e[2];t/=95.047;n/=100;r/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16;const s=500*(t-n);const i=200*(n-r);return[o,s,i]};n.lab.xyz=function(e){const t=e[0];const n=e[1];const r=e[2];let o;let s;let i;s=(t+16)/116;o=n/500+s;i=s-r/200;const a=s**3;const l=o**3;const c=i**3;s=a>.008856?a:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;i=c>.008856?c:(i-16/116)/7.787;o*=95.047;s*=100;i*=108.883;return[o,s,i]};n.lab.lch=function(e){const t=e[0];const n=e[1];const r=e[2];let o;const s=Math.atan2(r,n);o=s*360/2/Math.PI;if(o<0){o+=360}const i=Math.sqrt(n*n+r*r);return[t,i,o]};n.lch.lab=function(e){const t=e[0];const n=e[1];const r=e[2];const o=r/360*2*Math.PI;const s=n*Math.cos(o);const i=n*Math.sin(o);return[t,s,i]};n.rgb.ansi16=function(e,t=null){const[r,o,s]=e;let i=t===null?n.rgb.hsv(e)[2]:t;i=Math.round(i/50);if(i===0){return 30}let a=30+(Math.round(s/255)<<2|Math.round(o/255)<<1|Math.round(r/255));if(i===2){a+=60}return a};n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])};n.rgb.ansi256=function(e){const t=e[0];const n=e[1];const r=e[2];if(t===n&&n===r){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const o=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return o};n.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const r=(t&1)*n*255;const o=(t>>1&1)*n*255;const s=(t>>2&1)*n*255;return[r,o,s]};n.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const r=Math.floor((t=e%36)/6)/5*255;const o=t%6/5*255;return[n,r,o]};n.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map((e=>e+e)).join("")}const r=parseInt(n,16);const o=r>>16&255;const s=r>>8&255;const i=r&255;return[o,s,i]};n.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.max(Math.max(t,n),r);const s=Math.min(Math.min(t,n),r);const i=o-s;let a;let l;if(i<1){a=s/(1-i)}else{a=0}if(i<=0){l=0}else if(o===t){l=(n-r)/i%6}else if(o===n){l=2+(r-t)/i}else{l=4+(t-n)/i}l/=6;l%=1;return[l*360,i*100,a*100]};n.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=n<.5?2*t*n:2*t*(1-n);let o=0;if(r<1){o=(n-.5*r)/(1-r)}return[e[0],r*100,o*100]};n.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=t*n;let o=0;if(r<1){o=(n-r)/(1-r)}return[e[0],r*100,o*100]};n.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;if(n===0){return[r*255,r*255,r*255]}const o=[0,0,0];const s=t%1*6;const i=s%1;const a=1-i;let l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=i;o[2]=0;break;case 1:o[0]=a;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=i;break;case 3:o[0]=0;o[1]=a;o[2]=1;break;case 4:o[0]=i;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=a}l=(1-n)*r;return[(n*o[0]+l)*255,(n*o[1]+l)*255,(n*o[2]+l)*255]};n.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);let o=0;if(r>0){o=t/r}return[e[0],o*100,r*100]};n.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const r=n*(1-t)+.5*t;let o=0;if(r>0&&r<.5){o=t/(2*r)}else if(r>=.5&&r<1){o=t/(2*(1-r))}return[e[0],o*100,r*100]};n.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};n.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=1-n;const o=r-t;let s=0;if(o<1){s=(r-o)/(1-o)}return[e[0],o*100,s*100]};n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};n.gray.hsl=function(e){return[0,0,e[0]]};n.gray.hsv=n.gray.hsl;n.gray.hwb=function(e){return[0,100,e[0]]};n.gray.cmyk=function(e){return[0,0,0,e[0]]};n.gray.lab=function(e){return[e[0],0,0]};n.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};n.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]};return Be}var qe;var Fe;function Te(){if(Fe)return qe;Fe=1;const e=$e();function t(){const t={};const n=Object.keys(e);for(let e=n.length,r=0;r<e;r++){t[n[r]]={distance:-1,parent:null}}return t}function n(n){const r=t();const o=[n];r[n].distance=0;while(o.length){const t=o.pop();const n=Object.keys(e[t]);for(let e=n.length,s=0;s<e;s++){const e=n[s];const i=r[e];if(i.distance===-1){i.distance=r[t].distance+1;i.parent=t;o.unshift(e)}}}return r}function r(e,t){return function(n){return t(e(n))}}function o(t,n){const o=[n[t].parent,t];let s=e[n[t].parent][t];let i=n[t].parent;while(n[i].parent){o.unshift(n[i].parent);s=r(e[n[i].parent][i],s);i=n[i].parent}s.conversion=o;return s}qe=function(e){const t=n(e);const r={};const s=Object.keys(t);for(let e=s.length,n=0;n<e;n++){const e=s[n];const i=t[e];if(i.parent===null){continue}r[e]=o(e,t)}return r};return qe}var Ie;var _e;function De(){if(_e)return Ie;_e=1;const e=$e();const t=Te();const n={};const r=Object.keys(e);function o(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function s(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const r=e(t);if(typeof r==="object"){for(let e=r.length,t=0;t<e;t++){r[t]=Math.round(r[t])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}r.forEach((r=>{n[r]={};Object.defineProperty(n[r],"channels",{value:e[r].channels});Object.defineProperty(n[r],"labels",{value:e[r].labels});const i=t(r);const a=Object.keys(i);a.forEach((e=>{const t=i[e];n[r][e]=s(t);n[r][e].raw=o(t)}))}));Ie=n;return Ie}(function(e){const t=(e,t)=>(...n)=>{const r=e(...n);return`[${r+t}m`};const n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`};const r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};const o=e=>e;const s=(e,t,n)=>[e,t,n];const i=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true});return r},enumerable:true,configurable:true})};let a;const l=(e,t,n,r)=>{if(a===undefined){a=De()}const o=r?10:0;const s={};for(const[r,i]of Object.entries(a)){const a=r==="ansi16"?"ansi":r;if(r===t){s[a]=e(n,o)}else if(typeof i==="object"){s[a]=e(i[t],o)}}return s};function c(){const e=new Map;const a={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],blackBright:[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]}};a.color.gray=a.color.blackBright;a.bgColor.bgGray=a.bgColor.bgBlackBright;a.color.grey=a.color.blackBright;a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[t,n]of Object.entries(a)){for(const[t,r]of Object.entries(n)){a[t]={open:`[${r[0]}m`,close:`[${r[1]}m`};n[t]=a[t];e.set(r[0],r[1])}Object.defineProperty(a,t,{value:n,enumerable:false})}Object.defineProperty(a,"codes",{value:e,enumerable:false});a.color.close="";a.bgColor.close="";i(a.color,"ansi",(()=>l(t,"ansi16",o,false)));i(a.color,"ansi256",(()=>l(n,"ansi256",o,false)));i(a.color,"ansi16m",(()=>l(r,"rgb",s,false)));i(a.bgColor,"ansi",(()=>l(t,"ansi16",o,true)));i(a.bgColor,"ansi256",(()=>l(n,"ansi256",o,true)));i(a.bgColor,"ansi16m",(()=>l(r,"rgb",s,true)));return a}Object.defineProperty(e,"exports",{enumerable:true,get:c})})(Me);var Ne=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const r=t.indexOf(n+e);const o=t.indexOf("--");return r!==-1&&(o===-1||r<o)};const Le=A["default"];const ze=E["default"];const We=Ne;const{env:Ue}=process;let He;if(We("no-color")||We("no-colors")||We("color=false")||We("color=never")){He=0}else if(We("color")||We("colors")||We("color=true")||We("color=always")){He=1}if("FORCE_COLOR"in Ue){if(Ue.FORCE_COLOR==="true"){He=1}else if(Ue.FORCE_COLOR==="false"){He=0}else{He=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3)}}function Ge(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function Ve(e,t){if(He===0){return 0}if(We("color=16m")||We("color=full")||We("color=truecolor")){return 3}if(We("color=256")){return 2}if(e&&!t&&He===undefined){return 0}const n=He||0;if(Ue.TERM==="dumb"){return n}if(process.platform==="win32"){const e=Le.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in Ue){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in Ue))||Ue.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in Ue){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0}if(Ue.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in Ue){const e=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ue.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)){return 1}if("COLORTERM"in Ue){return 1}return n}function Je(e){const t=Ve(e,e&&e.isTTY);return Ge(t)}var Ye={supportsColor:Je,stdout:Ge(Ve(true,ze.isatty(1))),stderr:Ge(Ve(true,ze.isatty(2)))};const Ke=(e,t,n)=>{let r=e.indexOf(t);if(r===-1){return e}const o=t.length;let s=0;let i="";do{i+=e.substr(s,r-s)+t+n;s=r+o;r=e.indexOf(t,s)}while(r!==-1);i+=e.substr(s);return i};const Xe=(e,t,n,r)=>{let o=0;let s="";do{const i=e[r-1]==="\r";s+=e.substr(o,(i?r-1:r)-o)+t+(i?"\r\n":"\n")+n;o=r+1;r=e.indexOf("\n",o)}while(r!==-1);s+=e.substr(o);return s};var Qe={stringReplaceAll:Ke,stringEncaseCRLFWithFirstIndex:Xe};var Ze;var et;function tt(){if(et)return Ze;et=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function s(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return o.get(e)||e}function i(e,t){const o=[];const i=t.trim().split(/\s*,\s*/g);let a;for(const t of i){const i=Number(t);if(!Number.isNaN(i)){o.push(i)}else if(a=t.match(n)){o.push(a[2].replace(r,((e,t,n)=>t?s(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return o}function a(e){t.lastIndex=0;const n=[];let r;while((r=t.exec(e))!==null){const e=r[1];if(r[2]){const t=i(e,r[2]);n.push([e].concat(t))}else{n.push([e])}}return n}function l(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let r=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in r)){throw new Error(`Unknown Chalk style: ${e}`)}r=t.length>0?r[e](...t):r[e]}return r}Ze=(t,n)=>{const r=[];const o=[];let i=[];n.replace(e,((e,n,c,u,p,d)=>{if(n){i.push(s(n))}else if(u){const e=i.join("");i=[];o.push(r.length===0?e:l(t,r)(e));r.push({inverse:c,styles:a(u)})}else if(p){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}o.push(l(t,r)(i.join("")));i=[];r.pop()}else{i.push(d)}}));o.push(i.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 o.join("")};return Ze}const nt=Me.exports;const{stdout:rt,stderr:ot}=Ye;const{stringReplaceAll:st,stringEncaseCRLFWithFirstIndex:it}=Qe;const{isArray:at}=Array;const lt=["ansi","ansi","ansi256","ansi16m"];const ct=Object.create(null);const ut=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const n=rt?rt.level:0;e.level=t.level===undefined?n:t.level};class pt{constructor(e){return dt(e)}}const dt=e=>{const t={};ut(t,e);t.template=(...e)=>wt(t.template,...e);Object.setPrototypeOf(t,ft.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=pt;return t.template};function ft(e){return dt(e)}for(const[e,t]of Object.entries(nt)){ct[e]={get(){const n=bt(this,gt(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}ct.visible={get(){const e=bt(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const ht=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of ht){ct[e]={get(){const{level:t}=this;return function(...n){const r=gt(nt.color[lt[t]][e](...n),nt.color.close,this._styler);return bt(this,r,this._isEmpty)}}}}for(const e of ht){const t="bg"+e[0].toUpperCase()+e.slice(1);ct[t]={get(){const{level:t}=this;return function(...n){const r=gt(nt.bgColor[lt[t]][e](...n),nt.bgColor.close,this._styler);return bt(this,r,this._isEmpty)}}}}const mt=Object.defineProperties((()=>{}),{...ct,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const gt=(e,t,n)=>{let r;let o;if(n===undefined){r=e;o=t}else{r=n.openAll+e;o=t+n.closeAll}return{open:e,close:t,openAll:r,closeAll:o,parent:n}};const bt=(e,t,n)=>{const r=(...e)=>{if(at(e[0])&&at(e[0].raw)){return vt(r,wt(r,...e))}return vt(r,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(r,mt);r._generator=e;r._styler=t;r._isEmpty=n;return r};const vt=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:r,closeAll:o}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=st(t,n.close,n.open);n=n.parent}}const s=t.indexOf("\n");if(s!==-1){t=it(t,o,r,s)}return r+t+o};let yt;const wt=(e,...t)=>{const[n]=t;if(!at(n)||!at(n.raw)){return t.join(" ")}const r=t.slice(1);const o=[n.raw[0]];for(let e=1;e<n.length;e++){o.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]))}if(yt===undefined){yt=tt()}return yt(e,o.join(""))};Object.defineProperties(ft.prototype,ct);const jt=ft();jt.supportsColor=rt;jt.stderr=ft({level:ot?ot.level:0});jt.stderr.supportsColor=ot;var kt=jt;const Ct=new Map;const Ot=()=>{const t=[["svgo",{}],["gifsicle",{}],["jpegtran",{}],["pngquant",{}]];const n=t.map((t=>{const n=t[0];try{require.resolve(`imagemin-${n}`);return t}catch(t){if(!Ct.get(n)){Ct.set(n,true);const t=kt.magenta(`"npm install imagemin-${n} -D"`);e.Logger.warn(`Execute ${t} for assets optimization`,"@flatjs/evolve")}return null}})).filter(Boolean);if(n.length){return new B["default"]({minimizer:{implementation:B["default"].imageminMinify,options:{plugins:n}}})}return null};const xt=e=>new R["default"](ne(e.minimizeTerserOptions));const Pt=(e,t)=>{if(e){return[]}return[xt(t),Ot()].filter(Boolean)};class Mt{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 n=t.map((e=>e.name));const r=this.currentAssets.filter((e=>{const t=n.includes(e)===false;return t}));this.currentAssets=n.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&r.length!==0){o.push(...r)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const n=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){n.forEach((e=>{const t=o.relative(process.cwd(),e);const n="removed";console.warn(`clean-webpack-plugin: ${n} ${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 St=t=>new Mt({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const At=(e,t)=>new S["default"]({filename:`[name]/${he("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const Et="ExternalTemplateRemotesPlugin";const Bt=e=>e.constructor.name==="ExternalModule";class Rt{apply(e){e.hooks.make.tap(Et,(e=>{const t=[];e.hooks.buildModule.tap(Et,(e=>{if(Bt(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(Et,(()=>{t.map((t=>{const n=F["default"](t.request)[0];const r=$t(n);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new g.RawSource(s.source().toString().replace(`"${n}"`,r));o.set("javascript",e)}}))}))}))}}function $t(e){const t=[];const n=[];let r=false;let o=false;for(const s of e){if(s==="["){if(r){o=true;break}r=true;if(n.length){t.push(`"${n.join("")}"`);n.length=0}}else if(s==="]"){if(!r){o=true;break}r=false;if(n.length){t.push(`${n.join("")}`);n.length=0}n.length=0}else{n.push(s)}}if(r||o){throw new Error(`Invalid template URL "${e}"`)}if(n.length){t.push(`"${n.join("")}"`)}return t.join(" + ")}const qt=`HtmlInjectScriptPlugin`;class Ft{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(`${qt}_compilation`,(e=>{const t=T["default"].getHooks(e);t.alterAssetTags.tap(`${qt}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Tt=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const It=e=>o.join(e,`micro-remote-module.js`);const _t=(t,[n,r],o)=>{var s;const i=(s=r.options)==null?void 0:s.moduleFederation;const l=[];if(i){const{remotes:r,...s}=i;const c=It(n);const u=Tt(n);const p=(r||[]).map((({name:t,endpoint:n})=>{const r=Tt(t);const o=It(t);const s=n?e.ensureSlash(n(t),false):`[window.evolveFetchMicroWidgets()]`;return{[r]:`${r}@${s}/${o}`}}));l.push(new a.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Rt);if(!t){l.unshift(new Ft([le(o)]))}}return l};const Dt={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const Nt=(e,t,[n,r],o)=>{const s=[];const{options:i}=r;const a=e?"development":"production";for(const e of o){s.push(new T["default"]({inject:"body",title:Q("title",a,i==null?void 0:i.title),chunks:[n],minify:(i==null?void 0:i.minify)===false?false:["me","dev"].includes(e)?false:Dt,filename:`${n}/index${e==="prod"?"":`-${e}`}.html`,template:Q("template",a,i==null?void 0:i.template).replace(`{0}`,e),templateParameters:{title:Q("title",a,i==null?void 0:i.title),favicon:Q("favicon",a,i==null?void 0:i.favicon),inlineScripts:Q("inlineScripts",a,i==null?void 0:i.inlineScripts),headBeforeStyles:Q("headBeforeStyles",a,i==null?void 0:i.headBeforeStyles),headBeforeScripts:Q("headBeforeScripts",a,i==null?void 0:i.headBeforeScripts),bodyAfterScripts:Q("bodyAfterScripts",a,i==null?void 0:i.bodyAfterScripts),viewport:pe(t,i)?Q("viewport",a,i==null?void 0:i.viewport):""},multiCdn:{env:e,disabled:((i==null?void 0:i.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class Lt{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=a.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,n)=>{var r;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(r=e.chunkGraph)==null?void 0:r.getTreeRuntimeRequirements(n);if(s&&s.has(a.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(a.Template.indent(`var flatjsMultiCdn = {`));o.push(a.Template.indent(a.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(a.Template.indent(a.Template.indent([`cdnFinder: ${ie.toString()}`])));o.push(a.Template.indent(`};`));o.push(a.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return a.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{T["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:n}=e.plugin;const r=n.multiCdn;const s=t.publicPath;const i=t.js.map((e=>{if(r.disabled){return o.basename(e)}const t=ae(this.config,r.env);return se(t,e.replace(s,""))}));const a=t.css.map((e=>{if(r.disabled){return o.basename(e)}const t=ae(this.config,r.env);return se(t,e.replace(s,""))}));e.assets.js=i;e.assets.css=a;return e}))}))}}const zt=(e,t,n)=>{var r;const o=[new q["default"]];if(n.analyzer){o.push(new m.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...n.analyzer}))}o.push(At(e,n.pluginLoaderOptions));o.push(..._t(e,t,n.multiHtmlCdn));if(!e){o.push(St(t));const r=Object.keys(n.multiHtmlCdn);o.push(...Nt(e,n,t,r));o.push(new Lt(n.multiHtmlCdn))}const s=ke(((r=n.pluginLoaderOptions)==null?void 0:r.babelOptions)||{},e);if(s.usePreset==="react"&&e){o.push(new $["default"]({overlay:false}))}return o};const Wt=(n,r,s,i)=>{process.env.NODE_ENV=n;r=r==="auto"?"auto":e.ensureSlash(r,true);const a=n==="development";const l=i.projectCwd;const c=i.pluginLoaderOptions;const u=i.watchOptions;const p=de(s);const d=t.isFunction(i.extraLoaders)?i.extraLoaders(a):i.extraLoaders;const f=[...Pe(a,i,p,c),...d||[]];const h=t.isFunction(i.extraPlugins)?i.extraPlugins(a):i.extraPlugins;const m=[...zt(a,p,i),...h||[]];const g={mode:n,target:i.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":false,plugins:m,watchOptions:u,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:i.resolveAlias||{}},module:{rules:f},externals:Y(a,i.externals,p),performance:te(a,i.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(l,"public"),publicPath:r,filename:`[name]/${he("js",a,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:i.minimize===false?false:a?false:true,minimizer:Pt(a,i),splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return g};const Ut=(e,t,n)=>{const r=Wt("production",t,e,n);const o=ce(e,r);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{M["default"](s,((r,o)=>{var i,a;if(r){return t(r)}const l=o==null?void 0:o.toJson();if(l!=null&&(i=l.errors)!=null&&i.length){return t(l.errors)}if(n.forBuild.rejectWarnings&&l!=null&&(a=l.warnings)!=null&&a.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Ht=async(t,n)=>{var r;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:n.needVerifyPackages||{}});const o=((r=n.multiHtmlCdn)==null?void 0:r.prod)||[];const s=[];const i=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,r]of Object.entries(t)){var a;const t=ue(r,n);const o={[e]:r};const l=(a=r.options)==null?void 0:a.useRelativeAssetPath;s.push(Ut(o,l?"auto":i,t))}return Promise.all(s)};const Gt=async(n,r,s)=>{const i=await e.getPackageDir(__dirname,process.cwd());const a=k.readFileSync(o.join(i,"./templates/main.html"),"utf-8");const l=[];for(const[t]of Object.entries(s.entryMap)){const o=Object.keys(n).includes(t);l.push({name:t.replace(s.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(r,["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(a)(c)};const Vt=async(n,r,s,i,a,l)=>{const c=l.entryMap;const u=Object.keys(c).sort(((e,t)=>t.length-e.length));const p=await e.getPackageDir(__dirname,process.cwd());const d=u.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=k.readFileSync(o.join(p,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:p},{name:`served entry names`,value:JSON.stringify(u)},{name:`module path`,value:`${s.path}`}]})}const f=c[d];const h=f.options;const m=n[d];const g=(m==null?void 0:m.devServerHostUri)||i;const b=(h==null?void 0:h.serveModuleTemplate)||"./templates/module.html";const v=o.join(l.projectCwd,"./templates/module.html");const y=k.readFileSync(o.isAbsolute(b)?b:e.existsSync(v)?v:o.join(p,"./templates/module.html"),"utf-8");const w=l.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(f,i):{};const C={title:Q("title",r,h==null?void 0:h.title),favicon:Q("favicon",r,h==null?void 0:h.favicon),viewport:pe(l,h)?Q("viewport",r,h==null?void 0:h.viewport):"",inlineScripts:Q("inlineScripts",r,h==null?void 0:h.inlineScripts),headBeforeStyles:Q("headBeforeStyles",r,h==null?void 0:h.headBeforeStyles),headBeforeScripts:Q("headBeforeScripts",r,h==null?void 0:h.headBeforeScripts),bodyAfterScripts:Q("bodyAfterScripts",r,h==null?void 0:h.bodyAfterScripts),moduleFederationScripts:le({me:[e.urlJoin(i,["public"])]}),global:{hostUrl:i,apiBase:e.urlJoin(i,[a]),routeBaseName:o.join(`/pages`,d),moduleName:d.replace(l.projectVirtualPath,"").replace(/^\//,""),...j,...(h==null?void 0:h.serveGlobalData)||{}},styles:[e.urlJoin(g,[o.join("public",d,"bundle.css")])],scripts:[e.urlJoin(g,[o.join("public",d,"bundle.js")])]};return t.template(y)(C)};const Jt=(e,t,n,r,o)=>{const s=async(s,i)=>{let a;if(s.path==="/"){a=await Gt(r,t,o)}else{a=await Vt(r,e,s,t,n,o)}i.send(a)};return(o.forServe.pageMiddlewares||[]).concat(s)};const Yt=t=>async(n,r)=>{const s=n.baseUrl;if(!s.startsWith("/public")){r.redirect("/pages")}else{const n=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const i=o.extname(s);const a=n.find((e=>o.extname(e)===i&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(a){r.sendFile(a)}else{r.sendFile(o.join(t,s))}}};const Kt=(e,t="development",r,o,s,i,a)=>{const l=_["default"]();n.attachMockMiddlewares(l,a);l.set("hostUri",o);l.use("/pages",...Jt(t,o,a.apiContext||"api",s,i));l.use("*",Yt(e));return new Promise((e=>{const t=i.https?D["default"].createServer(i.https,l):l;t.listen(r,(()=>{e(true)}))}))};const Xt=(e,t,n)=>{const{projectCwd:r,https:s,liveReload:i}=n;const a=new I["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!i,liveReload:i,allowedHosts:"all",static:{directory:`${o.join(r,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{a.startCallback((n=>{if(n){return t(n)}e(true)}))}))};const Qt=async(r,s,i,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:i.needVerifyPackages||{}});if(i.https){l.https=i.https}const{mockPort:c,hostUri:u}=await n.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:r,hostUri:o}=await n.prepareMockDomain(t.merge({},l,{port:d}));h[e]={devServerPort:r,devServerHostUri:o}}for(const[t,n]of Object.entries(s)){var m,g;const s=((m=n.options)==null?void 0:(g=m.moduleFederation)==null?void 0:g.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var n;return e.urlJoin(((n=h[t])==null?void 0:n.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:c}=h[t];const d=e.urlJoin(c,["public"]);const b={[t]:n};const v=ue(n,i);const y=Wt("development",d,b,v);const w=a.webpack(ce(b,y)[0]);f.push(Xt(w,l,i));const j=kt.bgBlack(`[${kt.magenta("@flatjs")}:${kt.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${kt.cyan(o.relative(r,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${kt.cyan(p)}`)}))}await Kt(r,"development",c,u,h,i,l);oe(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Zt=async(t,r,o)=>{if(r.https){o.https=r.https}const{mockPort:s,hostUri:i}=await n.prepareMockDomain(o);const a=e.urlJoin(i,["/pages"]);return Kt(t,"development",s,i,{},r,o).then((e=>{const t=kt.bgBlack(`[${kt.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${kt.cyan(a)}`);return e}))};const en=(e={},n={})=>{const r={};for(const[o,s]of Object.entries(n)){const n={options:{}};if(e[o]){r[o]=t.merge({},n,s,e[o])}t.merge(s,n)}return r};const tn=(e,t,n={})=>{const r=re(e,n);const o=en(t,r.entryMap);return Ht(o,r)};const nn=(e,t,r={},o={})=>{const s=re(e,r);const i=n.loadMockConfiguration(e,o);const a=en(t,s.entryMap);return Qt(e,a,s,i)};const rn=(e,t={},r={})=>{const o=re(e,t);const s=n.loadMockConfiguration(e,r);return Zt(e,o,s)};exports.cdnBoot=V;exports.cdnJsDelivr=G;exports.cdnUnpkg=H;exports.createPageMiddleware=Jt;exports.createPublicAssetsMiddleware=Yt;exports.defaultFlatjsConfig=J;exports.evolveBuild=tn;exports.evolveServe=nn;exports.evolveStatic=rn;exports.flatBabelOptions=W;exports.flatExternalOptions=Y;exports.flatLessLoaderOptions=Z;exports.flatPerformanceOptions=te;exports.flatPostcssLoaderOptions=ee;exports.getHtmlPluginConfig=Q;exports.loadEvolveConfiguration=re;exports.loadModule=z;exports.normalizeEntries=en;exports.polyfill=U;exports.terserOptions=ne;exports.viewportScripts=K;
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 re=(n=process.cwd(),r)=>{const o=e.loadFlatjsConfig(n,"flatjsEvolve","flatjs.evolve.js");return t.merge({},J.flatjsEvolve,o.flatjsEvolve,r,{projectCwd:n})};const oe=e=>{try{N["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function se(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function ie(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const n=t.exec(window.location.href);const r=n&&n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"prod";const o=e[r]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function ae(e={},t="prod"){const n=e[t]||e["prod"]||[];return n[Math.floor(Math.random()*n.length)]}function le(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${ie.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function ce(e,n){const r=[];for(const[t,n]of Object.entries(e)){r.push({[t]:n.entry})}return r.map((e=>t.merge({},n,{name:Object.keys(e)[0],entry:e})))}const ue=(e,n)=>{var r,o;const s=t.merge({},n.pluginLoaderOptions);if((r=e.options)!=null&&r.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const i={...n,pluginLoaderOptions:s};return i};const pe=(e,t)=>{var n,r;const o=(n=e.pluginLoaderOptions)==null?void 0:(r=n.pixelOptions)==null?void 0:r.enabled;const s=(t==null?void 0:t.allowPx2rem)??o;return!!s};const de=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[n,r]of Object.entries(e)){t=[n,r];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const fe=()=>Date.now().toString();const he=(e,t,n=true)=>{const r=e==="js"?".js":".css";if(t){return`bundle${r}`}if(n){return`bundle[contenthash]${r}`}return`bundle${r}?${fe()}`};const me=/svg-icons\//;const ge=/\.(jpe?g|png|gif|svg)$/;const be=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const ve=e=>me.test(e)&&e.endsWith(".svg");const ye=({projectCwd:e,projectVirtualPath:t},n,[r,s])=>{let i=o.dirname(o.join(t,n.replace(/^src/,"")));const a=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,n);const c=a.find((e=>l.startsWith(e)));if(c){i=o.dirname(o.join(r,o.relative(c,l)))}return`${i}/[name]-[contenthash:8][ext]`};const we=(e,t)=>{const n={test(e){return be.test(e)||ge.test(e)&&!ve(e)},type:"asset",generator:{filename({filename:n}){return ye(e,n,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return n};const je=()=>{const e={test(e){return ve(e)},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function ke(e,n){const r=t.isFunction(e)?e(n):e;if(r.usePreset==="react"&&n){if(r.plugins){r.plugins.push(require.resolve("react-refresh/babel"))}else{r.plugins=[require.resolve("react-refresh/babel")]}}return r}const Ce=(e,n={})=>{const{babelOptions:r={},modularImports:o=[]}=n;const s=ke(r,e);const i=t.isFunction(o)?o(e):o;const a=W(s,i);const l={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:require.resolve("babel-loader"),options:a}]};return l};const Oe=(e,t={})=>{const n={test:/\.css$/i,use:[{loader:S["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};const{pixelOptions:r,cssnanoOptions:o}=t;if(Array.isArray(n.use)){n.use.push({loader:"postcss-loader",options:{postcssOptions:ee(e,r,o),sourceMap:e}})}return n};const xe=(e,t={})=>{const n=Oe(e,t);n.test=/\.less$/i;const r=t.lessOptions;if(Array.isArray(n.use)){n.use.push({loader:require.resolve("less-loader"),options:{sourceMap:e,lessOptions:Z(e,r)}})}return n};const Pe=(e,t,n,r={})=>{const o=[je(),we(t,n),Oe(e,r),xe(e,r),Ce(e,r)];return o};var Me={exports:{}};var Se;var Ae;function Ee(){if(Ae)return Se;Ae=1;Se={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]};return Se}var Be;var Re;function $e(){if(Re)return Be;Re=1;const e=Ee();const t={};for(const n of Object.keys(e)){t[e[n]]=n}const n={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"]}};Be=n;for(const e of Object.keys(n)){if(!("channels"in n[e])){throw new Error("missing channels property: "+e)}if(!("labels"in n[e])){throw new Error("missing channel labels property: "+e)}if(n[e].labels.length!==n[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:r}=n[e];delete n[e].channels;delete n[e].labels;Object.defineProperty(n[e],"channels",{value:t});Object.defineProperty(n[e],"labels",{value:r})}n.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.min(t,n,r);const s=Math.max(t,n,r);const i=s-o;let a;let l;if(s===o){a=0}else if(t===s){a=(n-r)/i}else if(n===s){a=2+(r-t)/i}else if(r===s){a=4+(t-n)/i}a=Math.min(a*60,360);if(a<0){a+=360}const c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=i/(s+o)}else{l=i/(2-s-o)}return[a,l*100,c*100]};n.rgb.hsv=function(e){let t;let n;let r;let o;let s;const i=e[0]/255;const a=e[1]/255;const l=e[2]/255;const c=Math.max(i,a,l);const u=c-Math.min(i,a,l);const p=function(e){return(c-e)/6/u+1/2};if(u===0){o=0;s=0}else{s=u/c;t=p(i);n=p(a);r=p(l);if(i===c){o=r-n}else if(a===c){o=1/3+t-r}else if(l===c){o=2/3+n-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};n.rgb.hwb=function(e){const t=e[0];const r=e[1];let o=e[2];const s=n.rgb.hsl(e)[0];const i=1/255*Math.min(t,Math.min(r,o));o=1-1/255*Math.max(t,Math.max(r,o));return[s,i*100,o*100]};n.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.min(1-t,1-n,1-r);const s=(1-t-o)/(1-o)||0;const i=(1-n-o)/(1-o)||0;const a=(1-r-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function r(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}n.rgb.keyword=function(n){const o=t[n];if(o){return o}let s=Infinity;let i;for(const t of Object.keys(e)){const o=e[t];const a=r(n,o);if(a<s){s=a;i=t}}return i};n.keyword.rgb=function(t){return e[t]};n.rgb.xyz=function(e){let t=e[0]/255;let n=e[1]/255;let r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805;const s=t*.2126+n*.7152+r*.0722;const i=t*.0193+n*.1192+r*.9505;return[o*100,s*100,i*100]};n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0];let o=t[1];let s=t[2];r/=95.047;o/=100;s/=108.883;r=r>.008856?r**(1/3):7.787*r+16/116;o=o>.008856?o**(1/3):7.787*o+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;const i=116*o-16;const a=500*(r-o);const l=200*(o-s);return[i,a,l]};n.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;let o;let s;let i;if(n===0){i=r*255;return[i,i,i]}if(r<.5){o=r*(1+n)}else{o=r+n-r*n}const a=2*r-o;const l=[0,0,0];for(let e=0;e<3;e++){s=t+1/3*-(e-1);if(s<0){s++}if(s>1){s--}if(6*s<1){i=a+(o-a)*6*s}else if(2*s<1){i=o}else if(3*s<2){i=a+(o-a)*(2/3-s)*6}else{i=a}l[e]=i*255}return l};n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let r=e[2]/100;let o=n;const s=Math.max(r,.01);r*=2;n*=r<=1?r:2-r;o*=s<=1?s:2-s;const i=(r+n)/2;const a=r===0?2*o/(s+o):2*n/(r+n);return[t,a*100,i*100]};n.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6;const s=t-Math.floor(t);const i=255*r*(1-n);const a=255*r*(1-n*s);const l=255*r*(1-n*(1-s));r*=255;switch(o){case 0:return[r,l,i];case 1:return[a,r,i];case 2:return[i,r,l];case 3:return[i,a,r];case 4:return[l,i,r];case 5:return[r,i,a]}};n.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const r=e[2]/100;const o=Math.max(r,.01);let s;let i;i=(2-n)*r;const a=(2-n)*o;s=n*o;s/=a<=1?a:2-a;s=s||0;i/=2;return[t,s*100,i*100]};n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let r=e[2]/100;const o=n+r;let s;if(o>1){n/=o;r/=o}const i=Math.floor(6*t);const a=1-r;s=6*t-i;if((i&1)!==0){s=1-s}const l=n+s*(a-n);let c;let u;let p;switch(i){default:case 6:case 0:c=a;u=l;p=n;break;case 1:c=l;u=a;p=n;break;case 2:c=n;u=a;p=l;break;case 3:c=n;u=l;p=a;break;case 4:c=l;u=n;p=a;break;case 5:c=a;u=n;p=l;break}return[c*255,u*255,p*255]};n.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;const o=e[3]/100;const s=1-Math.min(1,t*(1-o)+o);const i=1-Math.min(1,n*(1-o)+o);const a=1-Math.min(1,r*(1-o)+o);return[s*255,i*255,a*255]};n.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;let o;let s;let i;o=t*3.2406+n*-1.5372+r*-.4986;s=t*-.9689+n*1.8758+r*.0415;i=t*.0557+n*-.204+r*1.057;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);i=Math.min(Math.max(0,i),1);return[o*255,s*255,i*255]};n.xyz.lab=function(e){let t=e[0];let n=e[1];let r=e[2];t/=95.047;n/=100;r/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16;const s=500*(t-n);const i=200*(n-r);return[o,s,i]};n.lab.xyz=function(e){const t=e[0];const n=e[1];const r=e[2];let o;let s;let i;s=(t+16)/116;o=n/500+s;i=s-r/200;const a=s**3;const l=o**3;const c=i**3;s=a>.008856?a:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;i=c>.008856?c:(i-16/116)/7.787;o*=95.047;s*=100;i*=108.883;return[o,s,i]};n.lab.lch=function(e){const t=e[0];const n=e[1];const r=e[2];let o;const s=Math.atan2(r,n);o=s*360/2/Math.PI;if(o<0){o+=360}const i=Math.sqrt(n*n+r*r);return[t,i,o]};n.lch.lab=function(e){const t=e[0];const n=e[1];const r=e[2];const o=r/360*2*Math.PI;const s=n*Math.cos(o);const i=n*Math.sin(o);return[t,s,i]};n.rgb.ansi16=function(e,t=null){const[r,o,s]=e;let i=t===null?n.rgb.hsv(e)[2]:t;i=Math.round(i/50);if(i===0){return 30}let a=30+(Math.round(s/255)<<2|Math.round(o/255)<<1|Math.round(r/255));if(i===2){a+=60}return a};n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])};n.rgb.ansi256=function(e){const t=e[0];const n=e[1];const r=e[2];if(t===n&&n===r){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const o=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return o};n.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const r=(t&1)*n*255;const o=(t>>1&1)*n*255;const s=(t>>2&1)*n*255;return[r,o,s]};n.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const r=Math.floor((t=e%36)/6)/5*255;const o=t%6/5*255;return[n,r,o]};n.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map((e=>e+e)).join("")}const r=parseInt(n,16);const o=r>>16&255;const s=r>>8&255;const i=r&255;return[o,s,i]};n.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const o=Math.max(Math.max(t,n),r);const s=Math.min(Math.min(t,n),r);const i=o-s;let a;let l;if(i<1){a=s/(1-i)}else{a=0}if(i<=0){l=0}else if(o===t){l=(n-r)/i%6}else if(o===n){l=2+(r-t)/i}else{l=4+(t-n)/i}l/=6;l%=1;return[l*360,i*100,a*100]};n.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=n<.5?2*t*n:2*t*(1-n);let o=0;if(r<1){o=(n-.5*r)/(1-r)}return[e[0],r*100,o*100]};n.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=t*n;let o=0;if(r<1){o=(n-r)/(1-r)}return[e[0],r*100,o*100]};n.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;if(n===0){return[r*255,r*255,r*255]}const o=[0,0,0];const s=t%1*6;const i=s%1;const a=1-i;let l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=i;o[2]=0;break;case 1:o[0]=a;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=i;break;case 3:o[0]=0;o[1]=a;o[2]=1;break;case 4:o[0]=i;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=a}l=(1-n)*r;return[(n*o[0]+l)*255,(n*o[1]+l)*255,(n*o[2]+l)*255]};n.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);let o=0;if(r>0){o=t/r}return[e[0],o*100,r*100]};n.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const r=n*(1-t)+.5*t;let o=0;if(r>0&&r<.5){o=t/(2*r)}else if(r>=.5&&r<1){o=t/(2*(1-r))}return[e[0],o*100,r*100]};n.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};n.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=1-n;const o=r-t;let s=0;if(o<1){s=(r-o)/(1-o)}return[e[0],o*100,s*100]};n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};n.gray.hsl=function(e){return[0,0,e[0]]};n.gray.hsv=n.gray.hsl;n.gray.hwb=function(e){return[0,100,e[0]]};n.gray.cmyk=function(e){return[0,0,0,e[0]]};n.gray.lab=function(e){return[e[0],0,0]};n.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};n.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]};return Be}var qe;var Fe;function Te(){if(Fe)return qe;Fe=1;const e=$e();function t(){const t={};const n=Object.keys(e);for(let e=n.length,r=0;r<e;r++){t[n[r]]={distance:-1,parent:null}}return t}function n(n){const r=t();const o=[n];r[n].distance=0;while(o.length){const t=o.pop();const n=Object.keys(e[t]);for(let e=n.length,s=0;s<e;s++){const e=n[s];const i=r[e];if(i.distance===-1){i.distance=r[t].distance+1;i.parent=t;o.unshift(e)}}}return r}function r(e,t){return function(n){return t(e(n))}}function o(t,n){const o=[n[t].parent,t];let s=e[n[t].parent][t];let i=n[t].parent;while(n[i].parent){o.unshift(n[i].parent);s=r(e[n[i].parent][i],s);i=n[i].parent}s.conversion=o;return s}qe=function(e){const t=n(e);const r={};const s=Object.keys(t);for(let e=s.length,n=0;n<e;n++){const e=s[n];const i=t[e];if(i.parent===null){continue}r[e]=o(e,t)}return r};return qe}var Ie;var _e;function De(){if(_e)return Ie;_e=1;const e=$e();const t=Te();const n={};const r=Object.keys(e);function o(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function s(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const r=e(t);if(typeof r==="object"){for(let e=r.length,t=0;t<e;t++){r[t]=Math.round(r[t])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}r.forEach((r=>{n[r]={};Object.defineProperty(n[r],"channels",{value:e[r].channels});Object.defineProperty(n[r],"labels",{value:e[r].labels});const i=t(r);const a=Object.keys(i);a.forEach((e=>{const t=i[e];n[r][e]=s(t);n[r][e].raw=o(t)}))}));Ie=n;return Ie}(function(e){const t=(e,t)=>(...n)=>{const r=e(...n);return`[${r+t}m`};const n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`};const r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};const o=e=>e;const s=(e,t,n)=>[e,t,n];const i=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true});return r},enumerable:true,configurable:true})};let a;const l=(e,t,n,r)=>{if(a===undefined){a=De()}const o=r?10:0;const s={};for(const[r,i]of Object.entries(a)){const a=r==="ansi16"?"ansi":r;if(r===t){s[a]=e(n,o)}else if(typeof i==="object"){s[a]=e(i[t],o)}}return s};function c(){const e=new Map;const a={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],blackBright:[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]}};a.color.gray=a.color.blackBright;a.bgColor.bgGray=a.bgColor.bgBlackBright;a.color.grey=a.color.blackBright;a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[t,n]of Object.entries(a)){for(const[t,r]of Object.entries(n)){a[t]={open:`[${r[0]}m`,close:`[${r[1]}m`};n[t]=a[t];e.set(r[0],r[1])}Object.defineProperty(a,t,{value:n,enumerable:false})}Object.defineProperty(a,"codes",{value:e,enumerable:false});a.color.close="";a.bgColor.close="";i(a.color,"ansi",(()=>l(t,"ansi16",o,false)));i(a.color,"ansi256",(()=>l(n,"ansi256",o,false)));i(a.color,"ansi16m",(()=>l(r,"rgb",s,false)));i(a.bgColor,"ansi",(()=>l(t,"ansi16",o,true)));i(a.bgColor,"ansi256",(()=>l(n,"ansi256",o,true)));i(a.bgColor,"ansi16m",(()=>l(r,"rgb",s,true)));return a}Object.defineProperty(e,"exports",{enumerable:true,get:c})})(Me);var Ne=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const r=t.indexOf(n+e);const o=t.indexOf("--");return r!==-1&&(o===-1||r<o)};const Le=A["default"];const ze=E["default"];const We=Ne;const{env:Ue}=process;let He;if(We("no-color")||We("no-colors")||We("color=false")||We("color=never")){He=0}else if(We("color")||We("colors")||We("color=true")||We("color=always")){He=1}if("FORCE_COLOR"in Ue){if(Ue.FORCE_COLOR==="true"){He=1}else if(Ue.FORCE_COLOR==="false"){He=0}else{He=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3)}}function Ge(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function Ve(e,t){if(He===0){return 0}if(We("color=16m")||We("color=full")||We("color=truecolor")){return 3}if(We("color=256")){return 2}if(e&&!t&&He===undefined){return 0}const n=He||0;if(Ue.TERM==="dumb"){return n}if(process.platform==="win32"){const e=Le.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in Ue){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in Ue))||Ue.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in Ue){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0}if(Ue.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in Ue){const e=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ue.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)){return 1}if("COLORTERM"in Ue){return 1}return n}function Je(e){const t=Ve(e,e&&e.isTTY);return Ge(t)}var Ye={supportsColor:Je,stdout:Ge(Ve(true,ze.isatty(1))),stderr:Ge(Ve(true,ze.isatty(2)))};const Ke=(e,t,n)=>{let r=e.indexOf(t);if(r===-1){return e}const o=t.length;let s=0;let i="";do{i+=e.substr(s,r-s)+t+n;s=r+o;r=e.indexOf(t,s)}while(r!==-1);i+=e.substr(s);return i};const Xe=(e,t,n,r)=>{let o=0;let s="";do{const i=e[r-1]==="\r";s+=e.substr(o,(i?r-1:r)-o)+t+(i?"\r\n":"\n")+n;o=r+1;r=e.indexOf("\n",o)}while(r!==-1);s+=e.substr(o);return s};var Qe={stringReplaceAll:Ke,stringEncaseCRLFWithFirstIndex:Xe};var Ze;var et;function tt(){if(et)return Ze;et=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function s(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return o.get(e)||e}function i(e,t){const o=[];const i=t.trim().split(/\s*,\s*/g);let a;for(const t of i){const i=Number(t);if(!Number.isNaN(i)){o.push(i)}else if(a=t.match(n)){o.push(a[2].replace(r,((e,t,n)=>t?s(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return o}function a(e){t.lastIndex=0;const n=[];let r;while((r=t.exec(e))!==null){const e=r[1];if(r[2]){const t=i(e,r[2]);n.push([e].concat(t))}else{n.push([e])}}return n}function l(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let r=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in r)){throw new Error(`Unknown Chalk style: ${e}`)}r=t.length>0?r[e](...t):r[e]}return r}Ze=(t,n)=>{const r=[];const o=[];let i=[];n.replace(e,((e,n,c,u,p,d)=>{if(n){i.push(s(n))}else if(u){const e=i.join("");i=[];o.push(r.length===0?e:l(t,r)(e));r.push({inverse:c,styles:a(u)})}else if(p){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}o.push(l(t,r)(i.join("")));i=[];r.pop()}else{i.push(d)}}));o.push(i.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 o.join("")};return Ze}const nt=Me.exports;const{stdout:rt,stderr:ot}=Ye;const{stringReplaceAll:st,stringEncaseCRLFWithFirstIndex:it}=Qe;const{isArray:at}=Array;const lt=["ansi","ansi","ansi256","ansi16m"];const ct=Object.create(null);const ut=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const n=rt?rt.level:0;e.level=t.level===undefined?n:t.level};class pt{constructor(e){return dt(e)}}const dt=e=>{const t={};ut(t,e);t.template=(...e)=>wt(t.template,...e);Object.setPrototypeOf(t,ft.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=pt;return t.template};function ft(e){return dt(e)}for(const[e,t]of Object.entries(nt)){ct[e]={get(){const n=bt(this,gt(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}ct.visible={get(){const e=bt(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const ht=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of ht){ct[e]={get(){const{level:t}=this;return function(...n){const r=gt(nt.color[lt[t]][e](...n),nt.color.close,this._styler);return bt(this,r,this._isEmpty)}}}}for(const e of ht){const t="bg"+e[0].toUpperCase()+e.slice(1);ct[t]={get(){const{level:t}=this;return function(...n){const r=gt(nt.bgColor[lt[t]][e](...n),nt.bgColor.close,this._styler);return bt(this,r,this._isEmpty)}}}}const mt=Object.defineProperties((()=>{}),{...ct,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const gt=(e,t,n)=>{let r;let o;if(n===undefined){r=e;o=t}else{r=n.openAll+e;o=t+n.closeAll}return{open:e,close:t,openAll:r,closeAll:o,parent:n}};const bt=(e,t,n)=>{const r=(...e)=>{if(at(e[0])&&at(e[0].raw)){return vt(r,wt(r,...e))}return vt(r,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(r,mt);r._generator=e;r._styler=t;r._isEmpty=n;return r};const vt=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:r,closeAll:o}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=st(t,n.close,n.open);n=n.parent}}const s=t.indexOf("\n");if(s!==-1){t=it(t,o,r,s)}return r+t+o};let yt;const wt=(e,...t)=>{const[n]=t;if(!at(n)||!at(n.raw)){return t.join(" ")}const r=t.slice(1);const o=[n.raw[0]];for(let e=1;e<n.length;e++){o.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]))}if(yt===undefined){yt=tt()}return yt(e,o.join(""))};Object.defineProperties(ft.prototype,ct);const jt=ft();jt.supportsColor=rt;jt.stderr=ft({level:ot?ot.level:0});jt.stderr.supportsColor=ot;var kt=jt;const Ct=new Map;const Ot=()=>{const t=[["svgo",{}],["gifsicle",{}],["jpegtran",{}],["pngquant",{}]];const n=t.map((t=>{const n=t[0];try{require.resolve(`imagemin-${n}`);return t}catch(t){if(!Ct.get(n)){Ct.set(n,true);const t=kt.magenta(`"npm install imagemin-${n} -D"`);e.Logger.warn(`Execute ${t} for assets optimization`,"@flatjs/evolve")}return null}})).filter(Boolean);if(n.length){return new B["default"]({minimizer:{implementation:B["default"].imageminMinify,options:{plugins:n}}})}return null};const xt=e=>new R["default"](ne(e.minimizeTerserOptions));const Pt=(e,t)=>{if(e){return[]}return[xt(t),Ot()].filter(Boolean)};class Mt{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 n=t.map((e=>e.name));const r=this.currentAssets.filter((e=>{const t=n.includes(e)===false;return t}));this.currentAssets=n.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&r.length!==0){o.push(...r)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const n=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){n.forEach((e=>{const t=o.relative(process.cwd(),e);const n="removed";console.warn(`clean-webpack-plugin: ${n} ${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 St=t=>new Mt({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const At=(e,t)=>new S["default"]({filename:`[name]/${he("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const Et="ExternalTemplateRemotesPlugin";const Bt=e=>e.constructor.name==="ExternalModule";class Rt{apply(e){e.hooks.make.tap(Et,(e=>{const t=[];e.hooks.buildModule.tap(Et,(e=>{if(Bt(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(Et,(()=>{t.map((t=>{const n=F["default"](t.request)[0];const r=$t(n);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new g.RawSource(s.source().toString().replace(`"${n}"`,r));o.set("javascript",e)}}))}))}))}}function $t(e){const t=[];const n=[];let r=false;let o=false;for(const s of e){if(s==="["){if(r){o=true;break}r=true;if(n.length){t.push(`"${n.join("")}"`);n.length=0}}else if(s==="]"){if(!r){o=true;break}r=false;if(n.length){t.push(`${n.join("")}`);n.length=0}n.length=0}else{n.push(s)}}if(r||o){throw new Error(`Invalid template URL "${e}"`)}if(n.length){t.push(`"${n.join("")}"`)}return t.join(" + ")}const qt=`HtmlInjectScriptPlugin`;class Ft{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(`${qt}_compilation`,(e=>{const t=T["default"].getHooks(e);t.alterAssetTags.tap(`${qt}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Tt=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const It=e=>o.join(e,`micro-remote-module.js`);const _t=(t,[n,r],o)=>{var s;const i=(s=r.options)==null?void 0:s.moduleFederation;const l=[];if(i){const{remotes:r,...s}=i;const c=It(n);const u=Tt(n);const p=(r||[]).map((({name:t,endpoint:n})=>{const r=Tt(t);const o=It(t);const s=n?e.ensureSlash(n(t),false):`[window.evolveFetchMicroWidgets()]`;return{[r]:`${r}@${s}/${o}`}}));l.push(new a.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Rt);if(!t){l.unshift(new Ft([le(o)]))}}return l};const Dt={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const Nt=(e,t,[n,r],o)=>{const s=[];const{options:i}=r;const a=e?"development":"production";for(const e of o){s.push(new T["default"]({inject:"body",title:Q("title",a,i==null?void 0:i.title),chunks:[n],minify:(i==null?void 0:i.minify)===false?false:["me","dev"].includes(e)?false:Dt,filename:`${n}/index${e==="prod"?"":`-${e}`}.html`,template:Q("template",a,i==null?void 0:i.template).replace(`{0}`,e),templateParameters:{title:Q("title",a,i==null?void 0:i.title),favicon:Q("favicon",a,i==null?void 0:i.favicon),inlineScripts:Q("inlineScripts",a,i==null?void 0:i.inlineScripts),headBeforeStyles:Q("headBeforeStyles",a,i==null?void 0:i.headBeforeStyles),headBeforeScripts:Q("headBeforeScripts",a,i==null?void 0:i.headBeforeScripts),bodyAfterScripts:Q("bodyAfterScripts",a,i==null?void 0:i.bodyAfterScripts),viewport:pe(t,i)?Q("viewport",a,i==null?void 0:i.viewport):""},multiCdn:{env:e,disabled:((i==null?void 0:i.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class Lt{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=a.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,n)=>{var r;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(r=e.chunkGraph)==null?void 0:r.getTreeRuntimeRequirements(n);if(s&&s.has(a.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(a.Template.indent(`var flatjsMultiCdn = {`));o.push(a.Template.indent(a.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(a.Template.indent(a.Template.indent([`cdnFinder: ${ie.toString()}`])));o.push(a.Template.indent(`};`));o.push(a.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return a.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{T["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:n}=e.plugin;const r=n.multiCdn;const s=t.publicPath;const i=t.js.map((e=>{if(r.disabled){return o.basename(e)}const t=ae(this.config,r.env);return se(t,e.replace(s,""))}));const a=t.css.map((e=>{if(r.disabled){return o.basename(e)}const t=ae(this.config,r.env);return se(t,e.replace(s,""))}));e.assets.js=i;e.assets.css=a;return e}))}))}}const zt=(e,t,n)=>{var r;const o=[new q["default"]];if(n.analyzer){o.push(new m.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...n.analyzer}))}o.push(At(e,n.pluginLoaderOptions));o.push(..._t(e,t,n.multiHtmlCdn));if(!e){o.push(St(t));const r=Object.keys(n.multiHtmlCdn);o.push(...Nt(e,n,t,r));o.push(new Lt(n.multiHtmlCdn))}const s=ke(((r=n.pluginLoaderOptions)==null?void 0:r.babelOptions)||{},e);if(s.usePreset==="react"&&e){o.push(new $["default"]({overlay:false}))}return o};const Wt=(n,r,s,i)=>{process.env.NODE_ENV=n;r=r==="auto"?"auto":e.ensureSlash(r,true);const a=n==="development";const l=i.projectCwd;const c=i.pluginLoaderOptions;const u=i.watchOptions;const p=de(s);const d=t.isFunction(i.extraLoaders)?i.extraLoaders(a):i.extraLoaders;const f=[...Pe(a,i,p,c),...d||[]];const h=t.isFunction(i.extraPlugins)?i.extraPlugins(a):i.extraPlugins;const m=[...zt(a,p,i),...h||[]];const g={mode:n,target:i.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":false,plugins:m,watchOptions:u,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:i.resolveAlias||{}},module:{rules:f},externals:Y(a,i.externals,p),performance:te(a,i.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(l,"public"),publicPath:r,filename:`[name]/${he("js",a,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:i.minimize===false?false:a?false:true,minimizer:Pt(a,i),splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return g};const Ut=(e,t,n)=>{const r=Wt("production",t,e,n);const o=ce(e,r);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{M["default"](s,((r,o)=>{var i,a;if(r){return t(r)}const l=o==null?void 0:o.toJson();if(l!=null&&(i=l.errors)!=null&&i.length){return t(l.errors)}if(n.forBuild.rejectWarnings&&l!=null&&(a=l.warnings)!=null&&a.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Ht=async(t,n)=>{var r;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:n.needVerifyPackages||{}});const o=((r=n.multiHtmlCdn)==null?void 0:r.prod)||[];const s=[];const i=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,r]of Object.entries(t)){var a;const t=ue(r,n);const o={[e]:r};const l=(a=r.options)==null?void 0:a.useRelativeAssetPath;s.push(Ut(o,l?"auto":i,t))}return Promise.all(s)};const Gt=async(n,r,s)=>{const i=await e.getPackageDir(__dirname,process.cwd());const a=k.readFileSync(o.join(i,"./templates/main.html"),"utf-8");const l=[];for(const[t,o]of Object.entries(s.entryMap)){var c;const i=((c=o.options)==null?void 0:c.servePageMainLinkFn)||(e=>e);const a=Object.keys(n).includes(t);const u=s.projectVirtualPath.replace(/^\//,"");l.push({name:t.replace(u,"").replace(/^\//,""),link:i(e.urlJoin(r,["pages",t],{env:"me"}),{hostUri:r,entryName:t,virtualPath:u}),flagText:a?"serve":"static",isServed:a?1:0})}const u={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(a)(u)};const Vt=async(n,r,s,i,a,l)=>{const c=l.entryMap;const u=Object.keys(c).sort(((e,t)=>t.length-e.length));const p=await e.getPackageDir(__dirname,process.cwd());const d=u.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=k.readFileSync(o.join(p,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:p},{name:`served entry names`,value:JSON.stringify(u)},{name:`module path`,value:`${s.path}`}]})}const f=c[d];const h=f.options;const m=n[d];const g=(m==null?void 0:m.devServerHostUri)||i;const b=(h==null?void 0:h.serveModuleTemplate)||"./templates/module.html";const v=o.join(l.projectCwd,"./templates/module.html");const y=k.readFileSync(o.isAbsolute(b)?b:e.existsSync(v)?v:o.join(p,"./templates/module.html"),"utf-8");const w=l.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(f,i):{};const C={title:Q("title",r,h==null?void 0:h.title),favicon:Q("favicon",r,h==null?void 0:h.favicon),viewport:pe(l,h)?Q("viewport",r,h==null?void 0:h.viewport):"",inlineScripts:Q("inlineScripts",r,h==null?void 0:h.inlineScripts),headBeforeStyles:Q("headBeforeStyles",r,h==null?void 0:h.headBeforeStyles),headBeforeScripts:Q("headBeforeScripts",r,h==null?void 0:h.headBeforeScripts),bodyAfterScripts:Q("bodyAfterScripts",r,h==null?void 0:h.bodyAfterScripts),moduleFederationScripts:le({me:[e.urlJoin(i,["public"])]}),global:{hostUrl:i,apiBase:e.urlJoin(i,[a]),routeBaseName:o.join(`/pages`,d),moduleName:d.replace(l.projectVirtualPath,"").replace(/^\//,""),...j,...(h==null?void 0:h.serveGlobalData)||{}},styles:[e.urlJoin(g,[o.join("public",d,"bundle.css")])],scripts:[e.urlJoin(g,[o.join("public",d,"bundle.js")])]};return t.template(y)(C)};const Jt=(e,t,n,r,o)=>{const s=async(s,i)=>{let a;if(s.path==="/"){a=await Gt(r,t,o)}else{a=await Vt(r,e,s,t,n,o)}i.send(a)};return(o.forServe.pageMiddlewares||[]).concat(s)};const Yt=t=>async(n,r)=>{const s=n.baseUrl;if(!s.startsWith("/public")){r.redirect("/pages")}else{const n=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const i=o.extname(s);const a=n.find((e=>o.extname(e)===i&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(a){r.sendFile(a)}else{r.sendFile(o.join(t,s))}}};const Kt=(e,t="development",r,o,s,i,a)=>{const l=_["default"]();n.attachMockMiddlewares(l,a);l.set("hostUri",o);l.use("/pages",...Jt(t,o,a.apiContext||"api",s,i));l.use("*",Yt(e));return new Promise((e=>{const t=i.https?D["default"].createServer(i.https,l):l;t.listen(r,(()=>{e(true)}))}))};const Xt=(e,t,n)=>{const{projectCwd:r,https:s,liveReload:i}=n;const a=new I["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!i,liveReload:i,allowedHosts:"all",static:{directory:`${o.join(r,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{a.startCallback((n=>{if(n){return t(n)}e(true)}))}))};const Qt=async(r,s,i,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:i.needVerifyPackages||{}});if(i.https){l.https=i.https}const{mockPort:c,hostUri:u}=await n.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:r,hostUri:o}=await n.prepareMockDomain(t.merge({},l,{port:d}));h[e]={devServerPort:r,devServerHostUri:o}}for(const[t,n]of Object.entries(s)){var m,g;const s=((m=n.options)==null?void 0:(g=m.moduleFederation)==null?void 0:g.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var n;return e.urlJoin(((n=h[t])==null?void 0:n.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:c}=h[t];const d=e.urlJoin(c,["public"]);const b={[t]:n};const v=ue(n,i);const y=Wt("development",d,b,v);const w=a.webpack(ce(b,y)[0]);f.push(Xt(w,l,i));const j=kt.bgBlack(`[${kt.magenta("@flatjs")}:${kt.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${kt.cyan(o.relative(r,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${kt.cyan(p)}`)}))}await Kt(r,"development",c,u,h,i,l);oe(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Zt=async(t,r,o)=>{if(r.https){o.https=r.https}const{mockPort:s,hostUri:i}=await n.prepareMockDomain(o);const a=e.urlJoin(i,["/pages"]);return Kt(t,"development",s,i,{},r,o).then((e=>{const t=kt.bgBlack(`[${kt.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${kt.cyan(a)}`);return e}))};const en=(e={},n={})=>{const r={};for(const[o,s]of Object.entries(n)){const n={options:{}};if(e[o]){r[o]=t.merge({},n,s,e[o])}t.merge(s,n)}return r};const tn=(e,t,n={})=>{const r=re(e,n);const o=en(t,r.entryMap);return Ht(o,r)};const nn=(e,t,r={},o={})=>{const s=re(e,r);const i=n.loadMockConfiguration(e,o);const a=en(t,s.entryMap);return Qt(e,a,s,i)};const rn=(e,t={},r={})=>{const o=re(e,t);const s=n.loadMockConfiguration(e,r);return Zt(e,o,s)};exports.cdnBoot=V;exports.cdnJsDelivr=G;exports.cdnUnpkg=H;exports.createPageMiddleware=Jt;exports.createPublicAssetsMiddleware=Yt;exports.defaultFlatjsConfig=J;exports.evolveBuild=tn;exports.evolveServe=nn;exports.evolveStatic=rn;exports.flatBabelOptions=W;exports.flatExternalOptions=Y;exports.flatLessLoaderOptions=Z;exports.flatPerformanceOptions=te;exports.flatPostcssLoaderOptions=ee;exports.getHtmlPluginConfig=Q;exports.loadEvolveConfiguration=re;exports.loadModule=z;exports.normalizeEntries=en;exports.polyfill=U;exports.terserOptions=ne;exports.viewportScripts=K;
package/index.d.ts CHANGED
@@ -190,6 +190,15 @@ export interface EvolveEntryItemOption extends MultiHtmlCDNEntryItem {
190
190
  * @default true
191
191
  */
192
192
  enableBundleHashName?: boolean;
193
+ /**
194
+ * Allow customized module `link` on `/pages`
195
+ * @default undefined
196
+ */
197
+ servePageMainLinkFn?: (link: string, options: {
198
+ entryName: string;
199
+ hostUri: string;
200
+ virtualPath: string;
201
+ }) => string;
193
202
  /**
194
203
  * For `serve`
195
204
  * Customized module template to proxy the modules template.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
4
4
  "description": "the webpack based tools `evolve` of @flatjs",
5
5
  "keywords": [
6
6
  "shared",
@@ -23,10 +23,10 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@babel/core": "^7.20.5",
26
- "@flatjs/common": "^1.5.8",
26
+ "@flatjs/common": "^1.5.9",
27
27
  "@flatjs/evolve-preset-babel": "^1.5.8",
28
28
  "@flatjs/forge-plugin-postcss-pixel": "^1.4.1",
29
- "@flatjs/mock": "^1.5.8",
29
+ "@flatjs/mock": "^1.5.9",
30
30
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
31
31
  "babel-loader": "^9.1.0",
32
32
  "babel-merge": "^3.0.0",
@@ -42,8 +42,8 @@
42
42
  "less": "^4.1.3",
43
43
  "less-loader": "^11.1.0",
44
44
  "lodash": "^4.17.21",
45
- "mini-css-extract-plugin": "^2.7.1",
46
- "postcss": "^8.4.19",
45
+ "mini-css-extract-plugin": "^2.7.2",
46
+ "postcss": "^8.4.20",
47
47
  "postcss-loader": "^7.0.2",
48
48
  "react-refresh": "^0.14.0",
49
49
  "svgo": "^3.0.2",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "50b0e71c604dacff6ef399ef61b8e577a0fb2e66"
74
+ "gitHead": "bb844fb9b23de544125debae28cfb06397f1db81"
75
75
  }