valaxy 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/layouts/404.vue +1 -1
- package/dist/{chunk-HIQBR2L3.cjs → chunk-REL3TF3E.cjs} +9 -13
- package/dist/{chunk-MVNQ7S6C.mjs → chunk-ZLMYD4KI.mjs} +9 -13
- package/dist/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/package.json +8 -8
package/client/layouts/404.vue
CHANGED
|
@@ -14,7 +14,7 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
14
14
|
`)+r,i=n+1,n=e.indexOf(`
|
|
15
15
|
`,i)}while(n!==-1);return o+=e.substr(i),o};Sm.exports={stringReplaceAll:GS,stringEncaseCRLFWithFirstIndex:WS}});var Fm=v((_F,km)=>{"use strict";var YS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wm=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,KS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,JS=new Map([["n",`
|
|
16
16
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rm(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):JS.get(e)||e}function QS(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),i;for(let o of n){let s=Number(o);if(!Number.isNaN(s))r.push(s);else if(i=o.match(KS))r.push(i[2].replace(zS,(a,u,l)=>u?Rm(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return r}function XS(e){wm.lastIndex=0;let t=[],r;for(;(r=wm.exec(e))!==null;){let n=r[1];if(r[2]){let i=QS(n,r[2]);t.push([n].concat(i))}else t.push([n])}return t}function Am(e,t){let r={};for(let i of t)for(let o of i.styles)r[o[0]]=i.inverse?null:o.slice(1);let n=e;for(let[i,o]of Object.entries(r))if(!!Array.isArray(o)){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);n=o.length>0?n[i](...o):n[i]}return n}km.exports=(e,t)=>{let r=[],n=[],i=[];if(t.replace(YS,(o,s,a,u,l,c)=>{if(s)i.push(Rm(s));else if(u){let p=i.join("");i=[],n.push(r.length===0?p:Am(e,r)(p)),r.push({inverse:a,styles:XS(u)})}else if(l){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Am(e,r)(i.join(""))),i=[],r.pop()}else i.push(c)}),n.push(i.join("")),r.length>0){let o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")}});var Im=v((EF,Mm)=>{"use strict";var kr=ym(),{stdout:Us,stderr:Gs}=bm(),{stringReplaceAll:ZS,stringEncaseCRLFWithFirstIndex:eC}=Cm(),{isArray:Wn}=Array,Pm=["ansi","ansi","ansi256","ansi16m"],Xt=Object.create(null),tC=(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");let r=Us?Us.level:0;e.level=t.level===void 0?r:t.level},Ws=class{constructor(t){return Tm(t)}},Tm=e=>{let t={};return tC(t,e),t.template=(...r)=>Dm(t.template,...r),Object.setPrototypeOf(t,Yn.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Ws,t.template};function Yn(e){return Tm(e)}for(let[e,t]of Object.entries(kr))Xt[e]={get(){let r=Kn(this,Ys(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};Xt.visible={get(){let e=Kn(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var $m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of $m)Xt[e]={get(){let{level:t}=this;return function(...r){let n=Ys(kr.color[Pm[t]][e](...r),kr.color.close,this._styler);return Kn(this,n,this._isEmpty)}}};for(let e of $m){let t="bg"+e[0].toUpperCase()+e.slice(1);Xt[t]={get(){let{level:r}=this;return function(...n){let i=Ys(kr.bgColor[Pm[r]][e](...n),kr.bgColor.close,this._styler);return Kn(this,i,this._isEmpty)}}}}var rC=Object.defineProperties(()=>{},{...Xt,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ys=(e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Kn=(e,t,r)=>{let n=(...i)=>Wn(i[0])&&Wn(i[0].raw)?Om(n,Dm(n,...i)):Om(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,rC),n._generator=e,n._styler=t,n._isEmpty=r,n},Om=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=ZS(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
|
|
17
|
-
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _child_process = require('child_process');var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);var _vite = require('vite');var _open2 = require('open'); var _open3 = _interopRequireDefault(_open2);var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var _kolorist = require('kolorist');var _helpers = require('yargs/helpers');var Hr="0.14.
|
|
17
|
+
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _child_process = require('child_process');var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);var _vite = require('vite');var _open2 = require('open'); var _open3 = _interopRequireDefault(_open2);var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var _kolorist = require('kolorist');var _helpers = require('yargs/helpers');var Hr="0.14.4";var _net = require('net'); var _net2 = _interopRequireDefault(_net);async function gi(e){return await n1(e)?e:await gi(e+1)}function n1(e){return new Promise(t=>{let r=_net2.default.createServer(n=>{n.write(`Echo server\r
|
|
18
18
|
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var jp=Q(Ae(),1),Hp=Q(Ei(),1),Vp=Q(bn(),1);var _utils = require('@antfu/utils');function ns(e){return e!==null&&typeof e=="object"}function is(e,t,r=".",n){if(!ns(t))return is(e,{},r,n);let i=Object.assign({},t);for(let o in e){if(o==="__proto__"||o==="constructor")continue;let s=e[o];s!=null&&(n&&n(i,o,s,r)||(Array.isArray(s)&&Array.isArray(i[o])?i[o]=s.concat(i[o]):ns(s)&&ns(i[o])?i[o]=is(s,i[o],(r?`${r}.`:"")+o.toString(),n):i[o]=s))}return i}function mr(e){return(...t)=>t.reduce((r,n)=>is(r,n,"",e),{})}var $e=mr(),kw=mr((e,t,r,n)=>{if(typeof e[t]<"u"&&typeof r=="function")return e[t]=r(e[t]),!0}),Fw=mr((e,t,r,n)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});var os=()=>process.env.NODE_ENV==="production",ss=(e="development")=>{process.env.NODE_ENV=e,we.level=os()?2:3},hr=()=>ss("production");var we=_consola2.default.create({level:os()?2:3});var Tp=Q(bp(),1);var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);var _globaldirs = require('global-dirs'); var _globaldirs2 = _interopRequireDefault(_globaldirs);var _crossspawn = require('cross-spawn');function _r(e,t="updated"){return new Promise((r,n)=>{let i=["log"];t==="updated"&&i.push("-1"),i.push('--pretty="%ci"',e),t==="created"&&i.push("|","tail","-1");let o=_crossspawn.spawn.call(void 0, "git",i),s="";o.stdout.on("data",a=>s+=String(a)),o.on("close",()=>{r(+new Date(s))}),o.on("error",()=>{r(0)})})}var An="<!-- more -->",jt=/^https?:/i,Sp=/^pathname:\/\//;function Cp(e){return jt.test(e)}function it(e){return e.replace(/\\/g,"/")}function hs(e,t){return t.startsWith(e)?t:e+t}function te(e){return`/@fs${hs("/",it(e))}`}function wp(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}var _unconfig = require('unconfig');async function vt(e,t={}){let{config:r,sources:n}=await await _unconfig.loadConfig.call(void 0, {sources:{files:e,rewrite:t.rewrite},cwd:t.cwd||process.cwd()}),i=_vite.normalizePath.call(void 0, n[0]||"");return{config:r,configFile:i}}var Ht=mr((e,t,r)=>{if(_utils.isFunction.call(void 0, e[t])&&_utils.isFunction.call(void 0, r)&&(e[t]=function(...n){e[t].call(this,...n),r.call(this,...n)}),t==="vite")return e[t]=_vite.mergeConfig.call(void 0, e[t],r),!0});async function gs(e,t){return vt("valaxy.config",{rewrite(r){return typeof r=="function"?r(t||{}):r},cwd:e})}async function Rp(e){let{config:t,configFile:r}=await gs(e.userRoot||process.cwd());t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "valaxyConfig")} from ${_kolorist.dim.call(void 0, r)}`);let n=e.theme||t.theme||"yun";return{config:t,configFile:r,theme:n}}async function kp(e,t){let r={};for(let n of e){let{config:i,configFile:o}=await vt("index",{rewrite(s,a){return typeof s=="function"?s(n,t):s},cwd:n.root});!i||(n.configFile=o,r=Ht(i,r))}return r}var $p=e=>`JSON.parse(${JSON.stringify(JSON.stringify(e))})`;function Ge(e,t=!1,r={preserveSymlinks:!1}){try{return(0,Tp.sync)(e,r)}catch(n){_consola2.default.log(n)}if(_isinstalledglobally2.default){try{return I.resolve(_path.join.call(void 0, _globaldirs2.default.yarn.packages,e))}catch (e21){}try{return I.resolve(_path.join.call(void 0, _globaldirs2.default.npm.packages,e))}catch (e22){}}if(t)throw new Error(`Failed to resolve package ${e}`);_consola2.default.error(`Failed to resolve package ${e}`)}function RE(e){return e}var bA=RE;function kE(e){return e}var SA=kE;function wA(e){return e}function FE(e){return e}var AA=FE,ys= exports.t ={mode:"auto",url:"/",lang:"en",title:"Valaxy Blog",description:"A blog generated by Valaxy.",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://www.yunyoujun.cn/images/avatar.jpg",email:"i@valaxy.site",link:"https://valaxy.site",name:"VALAXY Developer",status:{emoji:"\u{1F30C}",message:"The moonlight is beautiful."}},favicon:"/favicon.svg",feed:{name:"",favicon:"/favicon.svg"},social:[],date:{format:""},lastUpdated:!0,license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u8D5E\u52A9",methods:[]},search:{enable:!1,type:"fuse"},comment:{enable:!1},cdn:{prefix:"https://unpkg.com/"},mediumZoom:{enable:!1,selector:"",options:{}}},Dp= exports.u ={ignoreDeadLinks:!0,siteConfig:ys,theme:"yun",themeConfig:{pkg:{name:"",version:""}},runtimeConfig:{addons:{}},features:{katex:!0},vite:{build:{rollupOptions:{external:[]}}}};function RA(e){return e}var vs=Q(Ae(),1);var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);function Rn(e,t){if(!e)return"";if(wp(e))if(t){let r=_fs2.default.lstatSync(t).isFile();return _path.resolve.call(void 0, r?_path.dirname.call(void 0, t):t,e)}else throw new Error(`entry is required when ${e} is path`);else return _path.dirname.call(void 0, Ge(`${e}/package.json`)||"")}async function Lp(e,t=process.cwd()){let r={},n=o=>{o&&(r[o.name]=$e(r[o.name]||{},o))};if(Array.isArray(e))for(let o of e){if(typeof o=="string"){n(await Ip(o,{cwd:t}));continue}typeof o=="object"&&n($e(await Ip(o.name,{cwd:t}),o||{}))}let i=Object.values(r).filter(o=>o.enable);return we.info(`Resolve ${_kolorist.cyan.call(void 0, "addons:")} ${_kolorist.yellow.call(void 0, i.map(o=>o.name).join(", "))}`),i}async function Ip(e,t={}){let r=ME(e,t.cwd||process.cwd()),n=_path.resolve.call(void 0, r,"./package.json");if(!vs.default.existsSync(n)){we.error(`No addon named ${e} found`);return}let i=await vs.default.readJSON(n);return{enable:!0,name:i.name,global:!!i.global,root:r,options:{},props:{}}}function ME(e,t){let r=e.startsWith("valaxy-addon")||e.startsWith(".")?e:`valaxy-addon-${e}`;return Rn(r,t)}function Np(e,t){let r=e.startsWith("valaxy-theme")||e.startsWith(".")?e:`valaxy-theme-${e}`;return Rn(r,t)}async function NE(e){return vt("site.config",{cwd:e})}async function kn(e){let{config:t,configFile:r}=await NE(e);return t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "siteConfig")} from ${_kolorist.dim.call(void 0, r)}`),{siteConfig:t,siteConfigFile:r}}async function jE(e){return vt("theme.config",{cwd:e})}async function qp(e){let{config:t,configFile:r}=await jE(e);return t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "themeConfig")} from ${_kolorist.dim.call(void 0, r)}`),{themeConfig:t,themeConfigFile:r}}var WE=(0,Hp.default)("valaxy:options");async function YE(e){let{config:t,themeRoot:r,theme:n}=e,i=t.siteConfig;i.url=_utils.ensureSuffix.call(void 0, "/",i.url||""),i.cdn.prefix=_utils.ensureSuffix.call(void 0, "/",i.cdn.prefix||"");let o=_path.resolve.call(void 0, r,"package.json");try{t.themeConfig.pkg=await jp.default.readJson(o,"utf-8")}catch (e23){console.error(`valaxy-theme-${n} doesn't have package.json`)}}async function _s(e,t){let{clientRoot:r,themeRoot:n,userRoot:i}=e,o=await Lp(t.addons||[],e.userRoot),s=await kp(o,e);t=Ht(t,s);let a=$e(t,Dp);e.config={...a,runtimeConfig:{addons:{}}},e.addons=o,o.forEach(p=>{e.config.runtimeConfig.addons[p.name]=p});let u=o.map(({root:p})=>p),l=o.map(({name:p})=>p);e.addonRoots=u,e.roots=_utils.uniq.call(void 0, [r,n,...u,i]);let c=_optionalChain([e, 'access', _3 => _3.config, 'access', _4 => _4.vite, 'optionalAccess', _5 => _5.build, 'optionalAccess', _6 => _6.rollupOptions, 'optionalAccess', _7 => _7.external])||[];return e.config.vite.build.rollupOptions.external=c.filter(p=>!l.includes(p)),await YE(e),e}async function De(e={userRoot:process.cwd()},t="dev"){let r=_path.dirname.call(void 0, Ge("valaxy/package.json",!0)),n=_path.resolve.call(void 0, r,"client"),i=_path.resolve.call(void 0, e.userRoot||process.cwd()),{config:o,configFile:s,theme:a}=await Rp(e),{siteConfig:u,siteConfigFile:l}=await kn(e.userRoot),{themeConfig:c,themeConfigFile:p}=await qp(e.userRoot);o=$e({siteConfig:u},{themeConfig:c},o);let f=Np(a,e.userRoot),y=(await(0,Vp.default)(["**.md"],{cwd:_path.resolve.call(void 0, i,"pages"),ignore:["**/node_modules"]})).sort(),h={mode:t,pkgRoot:r,clientRoot:n,userRoot:i,themeRoot:f,addonRoots:[],roots:[],theme:a,config:{...o,runtimeConfig:{addons:{}}},configFile:s||"",siteConfigFile:l||"",themeConfigFile:p||"",pages:y,addons:[]};WE(h);let _=await Es(h),E=Ht(o,_);return h=await _s(h,E),h}async function Es(e){we.info(`Resolve ${_kolorist.cyan.call(void 0, "valaxy.config.ts")} from ${_kolorist.yellow.call(void 0, `theme(${e.theme})`)}`);let{config:t}=await gs(e.themeRoot,e);return t}var _readline = require('readline'); var Gd = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);var _graymatter = require('gray-matter'); var _graymatter2 = _interopRequireDefault(_graymatter);var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);var _vitepluginpages = require('vite-plugin-pages'); var _vitepluginpages2 = _interopRequireDefault(_vitepluginpages);var _vitepluginvuelayouts = require('vite-plugin-vue-layouts'); var _vitepluginvuelayouts2 = _interopRequireDefault(_vitepluginvuelayouts);var _vite3 = require('unplugin-vue-components/vite'); var _vite4 = _interopRequireDefault(_vite3);var _vite5 = require('@intlify/unplugin-vue-i18n/vite'); var _vite6 = _interopRequireDefault(_vite5);var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);var _htmltotext = require('html-to-text');var _markdownitanchor = require('markdown-it-anchor'); var _markdownitanchor2 = _interopRequireDefault(_markdownitanchor);var _markdownitattrs = require('markdown-it-attrs'); var _markdownitattrs2 = _interopRequireDefault(_markdownitattrs);var _markdownitemoji = require('markdown-it-emoji'); var _markdownitemoji2 = _interopRequireDefault(_markdownitemoji);var _markdownittasklists = require('markdown-it-task-lists'); var _markdownittasklists2 = _interopRequireDefault(_markdownittasklists);var _html_blocksjs = require('markdown-it/lib/common/html_blocks.js'); var _html_blocksjs2 = _interopRequireDefault(_html_blocksjs);var zE="[a-zA-Z_:@][a-zA-Z0-9:._-]*",JE="[^\"'=<>`\\x00-\\x20]+",QE="'[^']*'",XE='"[^"]*"',ZE="(?:"+JE+"|"+QE+"|"+XE+")",xs="(?:\\s+"+zE+"(?:\\s*=\\s*"+ZE+")?)",Up="<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/?>",Gp="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ex="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",tx="<[?][\\s\\S]*?[?]>",rx="<![A-Z]+\\s+[^>]*>",nx="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ix=new RegExp("^(?:"+Up+"|"+Gp+"|"+ex+"|"+tx+"|"+rx+"|"+nx+")"),ox=new RegExp("^(?:"+Up+"|"+Gp+")"),sx=new RegExp("^<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/>"),ax=new RegExp("^<([A-Za-z][A-Za-z0-9\\-]*)"+xs+"*\\s*>.*<\\/\\1\\s*>"),ux=_html_blocksjs2.default,cx=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"],lx=["template","component","transition","transition-group","keep-alive","slot","teleport"],fx=({blockTags:e,inlineTags:t})=>{let r=[...e,...ux],n=[...t,...cx.filter(o=>!lx.includes(o))];return[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp("^</?(?!("+n.join("|")+")(?![\\w-]))[A-Za-z][A-Za-z0-9\\-]*(?=(\\s|/?>|$))"),/^$/,!0],[new RegExp(ox.source+"\\s*$"),/^$/,!1]]},px=e=>{let t=fx(e);return(r,n,i,o)=>{let s,a,u,l=r.bMarks[n]+r.tShift[n],c=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||!r.md.options.html||r.src.charCodeAt(l)!==60)return!1;for(u=r.src.slice(l,c),s=0;s<t.length&&!t[s][0].test(u);s++);if(s===t.length)return!1;if(o)return t[s][2];if(s===6){let f=_nullishCoalesce(u.match(sx), () => (u.match(ax)));if(f){r.line=n+1;let y=r.push("html_inline","",0);return y.content=f[0],y.map=[n,r.line],y=r.push("inline","",0),y.content=u.slice(f[0].length),y.map=[n,r.line],y.children=[],!0}}if(a=n+1,!t[s][1].test(u)){for(;a<i&&!(r.sCount[a]<r.blkIndent);a++)if(l=r.bMarks[a]+r.tShift[a],c=r.eMarks[a],u=r.src.slice(l,c),t[s][1].test(u)){u.length!==0&&a++;break}}r.line=a;let p=r.push("html_block","",0);return p.map=[n,a],p.content=r.getLines(n,a,r.blkIndent,!0),!0}},dx=e=>{let t=e|32;return t>=97&&t<=122},mx=(e,t)=>{let{pos:r}=e;if(!e.md.options.html)return!1;let n=e.posMax;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dx(i))return!1;let o=e.src.slice(r).match(ix);if(!o)return!1;if(!t){let s=e.push("html_inline","",0);s.content=e.src.slice(r,r+o[0].length)}return e.pos+=o[0].length,!0},Wp=(e,{blockTags:t=[],inlineTags:r=[]}={})=>{let n=px({blockTags:t,inlineTags:r});e.block.ruler.at("html_block",n,{alt:["paragraph","reference","blockquote"]}),e.inline.ruler.at("html_inline",mx)};var Yp=(e,{grayMatterOptions:t,renderExcerpt:r=!0}={})=>{let n=e.render.bind(e);e.render=(i,o={})=>{let{data:s,content:a,excerpt:u=""}=_graymatter2.default.call(void 0, i,t);return o.content=a,o.frontmatter={...o.frontmatter,...s},o.excerpt=r&&u?n(u,{...o}):u,n(a,o)}};var gx={"&":"&","<":"<",">":">","'":"'",'"':"""},yx=/[&<>'"]/g,_t=e=>e.replace(yx,t=>gx[t]);var Er=(e,{shouldAllowHtml:t,shouldEscapeText:r})=>{let n=_nullishCoalesce(e.children, () => ([])),i=["text","emoji","code_inline"];return t&&i.push("html_inline"),n.filter(s=>i.includes(s.type)&&!_optionalChain([s, 'access', _8 => _8.meta, 'optionalAccess', _9 => _9.isPermalinkSymbol])).reduce((s,a)=>r&&(a.type==="code_inline"||a.type==="text")?`${s}${_t(a.content)}`:`${s}${a.content}`,"").trim()},On=(e,{level:t,shouldAllowHtml:r,shouldEscapeText:n,slugify:i,format:o})=>{let s=[],a=[],u=l=>{for(;a.length!==0&&l.level<=a[0].level;)a.shift();a.length===0?(s.push(l),a.push(l)):(a[0].children.push(l),a.unshift(l))};for(let l=0;l<e.length;l+=1){let c=e[l];if(_optionalChain([c, 'optionalAccess', _10 => _10.type])!=="heading_open"||_optionalChain([c, 'optionalAccess', _11 => _11.level])!==0)continue;let p=Number.parseInt(c.tag.slice(1),10);if(!t.includes(p))continue;let f=e[l+1];if(!f)continue;let y=Er(f,{shouldAllowHtml:r,shouldEscapeText:n}),h=_nullishCoalesce(c.attrGet("id"), () => (i(y)));u({level:p,title:_nullishCoalesce(_optionalChain([o, 'optionalCall', _12 => _12(y)]), () => (y)),slug:h,link:`#${h}`,children:[]})}return s},vx=/[\u0000-\u001f]/g,_x=/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,Ex=/[\u0300-\u036F]/g,Pn=e=>e.normalize("NFKD").replace(Ex,"").replace(vx,"").replace(_x,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase();var Kp=(e,{level:t=[2,3],slugify:r=Pn,format:n}={})=>{let i=e.renderer.render.bind(e.renderer);e.renderer.render=(o,s,a)=>(a.headers=On(o,{level:t,shouldAllowHtml:!1,shouldEscapeText:!1,slugify:r,format:n}),i(o,s,a))};var zp="script",Jp="style",xr="template",xx=/^<script\s+.*?\bsetup\b.*?>$/is,bx=({customBlocks:e})=>{let t=Array.from(new Set([zp,Jp,...e])).join("|");return new RegExp(`^\\s*(?<content>(?<tagOpen><(?<type>${t})\\s?.*?>)(?<contentStripped>.*)(?<tagClose><\\/\\k<type>\\s*>))\\s*$`,"is")},Qp=(e,{customBlocks:t=[]}={})=>{let r=bx({customBlocks:t}),n=e.render.bind(e);e.render=(o,s={})=>{s.sfcBlocks={template:null,script:null,scriptSetup:null,scripts:[],styles:[],customBlocks:[]};let a=n(o,s);return s.sfcBlocks.template={type:xr,content:`<${xr}>${a}</${xr}>`,contentStripped:a,tagOpen:`<${xr}>`,tagClose:`</${xr}>`},a};let i=e.renderer.rules.html_block;e.renderer.rules.html_block=(o,s,a,u,l)=>{if(!u.sfcBlocks)return i(o,s,a,u,l);let f=o[s].content.match(r);if(!f)return i(o,s,a,u,l);let y=f.groups;return y.type===zp?(u.sfcBlocks.scripts.push(y),xx.test(y.tagOpen)?u.sfcBlocks.scriptSetup=y:u.sfcBlocks.script=y):y.type===Jp?u.sfcBlocks.styles.push(y):u.sfcBlocks.customBlocks.push(y),""}};var Xp=e=>{let t=e.renderer.render.bind(e.renderer);e.renderer.render=(r,n,i)=>{let o=r.findIndex(s=>s.tag==="h1");return i.title=o>-1?Er(r[o+1],{shouldAllowHtml:!1,shouldEscapeText:!1}):"",t(r,n,i)}};var Sx=({listTag:e,listClass:t,itemClass:r,linkTag:n,linkClass:i})=>{let o=_t(e),s=t?` class="${_t(t)}"`:"",a="li",u=r?` class="${_t(r)}"`:"",l=_t(n),c=i?` class="${_t(i)}"`:"",p=y=>n==="router-link"?` to="${y}"`:` href="${y}"`,f=y=>`<${o}${s}>${y.map(h=>`<${a}${u}${u}><${l}${c}${p(h.link)}>${h.title}</${l}>${h.children.length>0?f(h.children):""}</${a}>`).join("")}</${o}>`;return f},Cx=({pattern:e,containerTag:t,containerClass:r})=>(n,i,o,s)=>{if(n.sCount[i]-n.blkIndent>=4)return!1;let a=n.bMarks[i]+n.tShift[i],u=n.eMarks[i],l=n.src.slice(a,u).split(" ")[0];if(!e.test(l))return!1;if(s)return!0;n.line=i+1;let c=n.push("toc_open",t,1);c.markup="",c.map=[i,n.line],r&&c.attrSet("class",r);let p=n.push("toc_body","",0);p.markup=l,p.map=[i,n.line],p.hidden=!0;let f=n.push("toc_close",t,-1);return f.markup="",p.map=[i,n.line],!0},Zp=(e,{pattern:t=/^\[\[toc\]\]$/i,slugify:r=Pn,format:n,level:i=[2,3],containerTag:o="nav",containerClass:s="table-of-contents",listTag:a="ul",listClass:u="",itemClass:l="",linkTag:c="a",linkClass:p=""}={})=>{e.block.ruler.before("heading","toc",Cx({pattern:t,containerTag:o,containerClass:s}),{alt:["paragraph","reference","blockquote"]});let f=Sx({listTag:a,listClass:u,itemClass:l,linkTag:c,linkClass:p});e.renderer.rules.toc_body=y=>f(On(y,{level:i,shouldAllowHtml:!0,shouldEscapeText:!0,slugify:r,format:n}))};var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);function td(e,t){let r=e.posMax,n=!0,i=!0,o=t>0?e.src.charCodeAt(t-1):-1,s=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||s>=48&&s<=57)&&(i=!1),(s===32||s===9)&&(n=!1),{can_open:n,can_close:i}}function wx(e,t){let r,n,i,o;if(e.src[e.pos]!=="$")return!1;if(i=td(e,e.pos),!i.can_open)return t||(e.pending+="$"),e.pos+=1,!0;let s=e.pos+1;for(r=s;(r=e.src.indexOf("$",r))!==-1;){for(o=r-1;e.src[o]==="\\";)o-=1;if((r-o)%2===1)break;r+=1}return r===-1?(t||(e.pending+="$"),e.pos=s,!0):r-s===0?(t||(e.pending+="$$"),e.pos=s+1,!0):(i=td(e,r),i.can_close?(t||(n=e.push("math_inline","math",0),n.markup="$",n.content=e.src.slice(s,r)),e.pos=r+1,!0):(t||(e.pending+="$"),e.pos=s,!0))}function Ax(e,t,r,n){let i,o,s,a,u=!1,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+2>c||e.src.slice(l,l+2)!=="$$")return!1;if(l+=2,i=e.src.slice(l,c),n)return!0;for(i.trim().slice(-2)==="$$"&&(i=i.trim().slice(0,-2),u=!0),s=t;!u&&(s++,!(s>=r||(l=e.bMarks[s]+e.tShift[s],c=e.eMarks[s],l<c&&e.tShift[s]<e.blkIndent)));)e.src.slice(l,c).trim().slice(-2)==="$$"&&(a=e.src.slice(0,c).lastIndexOf("$$"),o=e.src.slice(l,a),u=!0);e.line=s+1;let p=e.push("math_block","math",0);return p.block=!0,p.content=(i&&i.trim()?`${i}
|
|
19
19
|
`:"")+e.getLines(t+1,s,e.tShift[t],!0)+(o&&o.trim()?o:""),p.map=[t,e.line],p.markup="$$",!0}function bs(e,t){t=t||{};let r=function(s){t.displayMode=!1;try{return _katex2.default.renderToString(s,t)}catch(a){return t.throwOnError&&console.warn(a),s}},n=function(s,a){return r(s[a].content)},i=function(s){t.displayMode=!0;try{return`<p>${_katex2.default.renderToString(s,t)}</p>`}catch(a){return t.throwOnError&&console.warn(a),s}},o=function(s,a){return`${i(s[a].content)}
|
|
20
20
|
`};e.inline.ruler.after("escape","math_inline",wx),e.block.ruler.after("blockquote","math_block",Ax,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=o}var _markdownitcontainer = require('markdown-it-container'); var _markdownitcontainer2 = _interopRequireDefault(_markdownitcontainer);function Rx(e,{icon:t,color:r,text:n,langs:i}={}){return[_markdownitcontainer2.default,e,{render(o,s){let a=o[s],u=a.info.trim().slice(e.length).trim();if(a.nesting===1){if(e==="details")return`<details class="${e} custom-block">${`<summary>${u}</summary>`}
|
|
@@ -30,23 +30,19 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
30
30
|
`),{code:r,lineOptions:i}}}function Ut(e,t,r){let n=new RegExp(`<${_nullishCoalesce(r, () => ("w+"))}[^>]*class="([\\w+-:;\\/* ]*)"`);return t=Array.isArray(t)?t:[t],e.replace(n,(i,o)=>i.replace(o,`${o} ${t}`))}function ld(e={}){let t=_nullishCoalesce(e.commonDiffClass, () => ("diff")),r=_nullishCoalesce(e.removedLinesClasses, () => (["remove"])),n=_nullishCoalesce(e.removedLinesClasses, () => (["add"])),i=_nullishCoalesce(e.removeLineTag, () => ("--")),o=_nullishCoalesce(e.addLineTag, () => ("++")),s=_nullishCoalesce(e.hasDiffClass, () => ("has-diff"));return{name:"diff",handler:Sr({[i]:[t,...r],[o]:[t,...n]},e),postProcess:({code:a})=>a.includes(t)?Ut(a,s,"pre"):a}}function fd(e={}){let t=_nullishCoalesce(e.hasFocusClass, () => ("has-focus")),r=_nullishCoalesce(e.hasFocusedLinesClass, () => ("has-focused-lines")),n=_nullishCoalesce(e.focusTag, () => ("focus"));return{name:"focus",handler:Sr({[n]:[t]},e),postProcess:({code:i})=>i.includes(t)?Ut(i,r,"pre"):i}}function pd(e={}){let t=_nullishCoalesce(e.hasHighlightClass, () => ("has-highlight")),r=_nullishCoalesce(e.hasHighlightedLinesClass, () => ("has-highlighted-lines")),n=_nullishCoalesce(e.highlightTag, () => ("hl"));return{name:"highlight",handler:Sr({[n]:[t]},e),postProcess:({code:i})=>i.includes(t)?Ut(i,r,"pre"):i}}function Nx(e,t,r){return e.reduce((n,i)=>{let{code:o,lineOptions:s}=_nullishCoalesce(_optionalChain([i, 'access', _13 => _13.handler, 'optionalCall', _14 => _14({code:n.code,lang:r})]), () => (n));return{code:o,lineOptions:[...n.lineOptions,...s]}},{code:t,lineOptions:[]})}function qx(e,t,r){return e.reduce((n,i)=>_nullishCoalesce(_optionalChain([i, 'access', _15 => _15.postProcess, 'optionalCall', _16 => _16({code:n,lang:r})]), () => (n)),t)}async function dd(e={}){let t=await _shiki.getHighlighter.call(void 0, e),r=_nullishCoalesce(e.processors, () => ([]));return{...t,codeToHtml:(n,i)=>{let o=typeof i=="object"?i.lang:i,s=typeof i=="object"?_nullishCoalesce(i.lineOptions, () => ([])):[],a=typeof i=="object"?i.theme:void 0,{code:u,lineOptions:l}=Nx(r,n,o),c=t.codeToHtml(u,{lang:o,theme:a,lineOptions:[...l,...s]});return qx(r,c,o)}}}var Bx=ad("abcdefghijklmnopqrstuvwxyz",10),jx=e=>{e=e.replace(/^(?:\[.*?\])?.*?([\d,-]+).*/,"$1").trim();let t=[];return e?(e.split(",").map(r=>r.split("-").map(n=>parseInt(n,10))).forEach(([r,n])=>{r&&n?t.push(...Array.from({length:n-r+1},(i,o)=>r+o)):t.push(r)}),t.map(r=>({line:r,classes:["highlighted"]}))):[]},Hx={name:"error-level",handler:Sr({error:["highlighted","error"],warning:["highlighted","warning"]})};async function hd(e="material-theme-palenight",t="txt"){let r=typeof e=="string"||"name"in e,n=p=>typeof p=="string"?p:p.name,i=[fd(),pd({hasHighlightClass:"highlighted"}),ld(),Hx],o=await dd({themes:r?[e]:[e.dark,e.light],processors:i}),s=/<pre[^>]*(style=".*?")/,a=/^<pre(.*?)>/,u=/-vue$/,l=/:(no-)?line-numbers$/,c=/\{\{.*?\}\}/g;return(p,f,y)=>{let h=u.test(f)?"":"v-pre";f=f.replace(l,"").replace(u,"").toLowerCase()||t,f&&(o.getLoadedLanguages().includes(f)||(f!==t&&console.warn(md.default.yellow(`The language '${f}' is not loaded, falling back to '${t}' for syntax highlighting.`)),f=t));let _=jx(y),E=L=>L.replace(a,(C,S)=>`<pre ${h}${S}>`).replace(s,(C,S)=>C.replace(S,"")),b=new Map,D=L=>h?L:L.replace(c,C=>{let S=b.get(C);return S||(S=Bx(),b.set(C,S)),S}),P=L=>(b.forEach((C,S)=>{L=L.replaceAll(C,S)}),L);if(r)return E(P(o.codeToHtml(D(p),{lang:f,lineOptions:_,theme:n(e)})));let V=Ut(E(o.codeToHtml(p,{lang:f,lineOptions:_,theme:n(e.dark)})),"va-code-dark","pre"),N=Ut(E(o.codeToHtml(p,{lang:f,lineOptions:_,theme:n(e.light)})),"va-code-light","pre");return V+N}}var Vx=/^<pre .*?><code>/,gd=e=>{let t=e.renderer.rules.fence;e.renderer.rules.fence=(...r)=>{let[n,i,o]=r,s=n[i],a=s.attrs&&s.attrs[0];if(!a)return t(...r);let u=a[0];if(!u||!/[\d,-]+/.test(u))return t(...r);let l=u.split(",").map(h=>h.split("-").map(_=>parseInt(_,10))),c=o.highlight?o.highlight(s.content,s.info,""):s.content;return`<div class="highlight-lines">${c.replace(Vx,"").split(`
|
|
31
31
|
`).map((h,_)=>{let E=_+1;return l.some(([D,P])=>D&&P?E>=D&&E<=P:E===D)?'<div class="highlighted"> </div>':"<br>"}).join("")}</div>`+c}},yd=e=>{let t=e.renderer.rules.fence;e.renderer.rules.fence=(...r)=>{let[n,i]=r,o=n[i],s=t(...r);return`<div class="language-${o.info.trim()}"><span class="copy"></span>${s}</div>`}};var _url = require('url');var Gx=/(^|.*\/)index.md(#?.*)$/i,vd=(e,t,r)=>{e.renderer.rules.link_open=(o,s,a,u,l)=>{let c=o[s],p=c.attrIndex("href");if(p>=0){let f=c.attrs[p],y=f[1];jt.test(y)?(Object.entries(t).forEach(([_,E])=>{c.attrSet(_,E)}),f[1]=y.replace(Sp,"")):!y.startsWith("#")&&!y.startsWith("mailto:")&&!/\.(?!html|md)\w+($|\?)/i.test(y)&&n(f,u),f[1]=f[1].replace(/\bimport\.meta/g,"import%2Emeta").replace(/\bprocess\.env/g,"process%2Eenv")}return l.renderToken(o,s,a)};function n(o,s){let a=o[1],u=a.match(Gx);if(u){let[,l,c]=u;a=l+c}else{let l=a.replace(/[?#].*$/,"");l.endsWith(".md")&&(l=l.replace(/\.md$/,s.cleanUrls==="disabled"?".html":"")),s.cleanUrls==="disabled"&&!l.endsWith(".html")&&!l.endsWith("/")&&(l+=".html");let c=new (0, _url.URL)(a,"http://a.com");a=l+c.search+c.hash}!a.startsWith("/")&&!/^\.\//.test(a)&&(a=`./${a}`),i(a.replace(/\.html$/,""),s),a.startsWith("/")&&(a=`${r}${a}`.replace(/\/+/g,"/")),o[1]=decodeURI(a)}function i(o,s){(s.links||(s.links=[])).push(o)}};async function ks(e,t={},r=!1,n="/"){return e.use(gd).use(yd).use(nd,t.blocks).use(vd,{target:"_blank",rel:"noreferrer",...t.externalLinks},n),_optionalChain([t, 'access', _17 => _17.attrs, 'optionalAccess', _18 => _18.disable])||e.use(_markdownitattrs2.default,t.attrs),e.use(bs,t.katex),e.use(_markdownitemoji2.default),r||e.use(_markdownitanchor2.default,{slugify:Mn,permalink:_markdownitanchor2.default.permalink.ariaHidden({}),...t.anchor}),e.use(Wp).use(Yp,{...t.frontmatter}).use(Kp,{slugify:Mn,...t.headers}).use(Qp,{...t.sfc}).use(Xp).use(Zp,{slugify:Mn,...t.toc}),e.use(_markdownittasklists2.default),t.config&&t.config(e),e}var Ed=async(e={})=>{let t=_markdownit2.default.call(void 0, {html:!0,linkify:!0,highlight:await hd(e.theme),...e.options});return await ks(t,e),t};var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);var _unocss = require('unocss');var xd=Q(Ae(),1);function bd(e,t,r=""){return e={...e},Object.keys(t).forEach(n=>{_utils.isObject.call(void 0, e[n])?e[n]=bd(e[n],t[n],r?`${r}.${n}`:n):Array.isArray(e[n])?e[n]=[...e[n],...t[n]]:e[n]=t[n]}),e}async function Sd(e,t,r,n,i=!0){let o=n;for(let s of e){let a=_path.resolve.call(void 0, s,"setup",t);if(xd.default.existsSync(a)){let{default:u}=_jiti2.default.call(void 0, __filename)(a),l=await u(r);l!==null&&(o=i?bd(o,l):l)}}return o}var ub=async e=>{let{config:t}=e,r=["i-ri-clipboard-line","i-ri-archive-line","i-ri-folder-2-line","i-ri-price-tag-3-line","i-ri-cloud-line"].concat(_optionalChain([e, 'access', _19 => _19.config, 'access', _20 => _20.unocss, 'optionalAccess', _21 => _21.safelist])||[]),n="animate-fade-in m-auto text-left".split(" ").concat(["rotate-y-180"]).concat(r),i=t.siteConfig;_optionalChain([i, 'access', _22 => _22.social, 'optionalAccess', _23 => _23.length])&&i.social.forEach(s=>n.push(_optionalChain([s, 'optionalAccess', _24 => _24.icon])||""));let o=_optionalChain([i, 'access', _25 => _25.sponsor, 'optionalAccess', _26 => _26.methods])||[];return o.length&&o.forEach(s=>n.push(_optionalChain([s, 'optionalAccess', _27 => _27.icon])||"")),n},cb=async e=>{let{config:t}=e;return{shortcuts:[["btn","px-4 py-1 rounded inline-block bg-$va-c-primary text-white cursor-pointer transition hover:bg-$va-c-primary-light disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50"],["icon-btn","inline-flex justify-center items-center cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-sky-600"],["va-card","shadow hover:shadow-lg"]],presets:[_unocss.presetUno.call(void 0, _optionalChain([t, 'access', _28 => _28.unocssPresets, 'optionalAccess', _29 => _29.uno])),_unocss.presetAttributify.call(void 0, _optionalChain([t, 'access', _30 => _30.unocssPresets, 'optionalAccess', _31 => _31.attributify])),_unocss.presetIcons.call(void 0, {scale:1.2,..._optionalChain([t, 'access', _32 => _32.unocssPresets, 'optionalAccess', _33 => _33.icons])}),_unocss.presetTypography.call(void 0, _optionalChain([t, 'access', _34 => _34.unocssPresets, 'optionalAccess', _35 => _35.typography]))],rules:[["font-serif",{"font-family":"var(--va-font-serif)"}],["font-sans",{"font-family":"var(--va-font-sans)"}],["font-mono",{"font-family":"var(--va-font-mono)"}]],transformers:[_unocss.transformerDirectives.call(void 0, ),_unocss.transformerVariantGroup.call(void 0, )],safelist:await ub(e)}},Cd=async e=>{let t=await Promise.resolve().then(() => require("unocss/vite")).then(f=>f.default),{unocss:r}=e.config,n=await cb(e),{themeRoot:i,clientRoot:o,roots:s}=e,a=["uno.config.ts","unocss.config.ts"],u=[];[i,o].forEach(f=>a.forEach(y=>u.push(_path.resolve.call(void 0, f,y))));let c={},p=[];return u.forEach(f=>{if(_fs.existsSync.call(void 0, f)){let y=_jiti2.default.call(void 0, __filename)(f);"default"in y&&(y=y.default),c=$e(c,y),p.push(f)}}),c=await Sd(s,"unocss.ts",{},c,!0),t({configDeps:p,configFile:!1,...$e(r||{},c,n)})};var Rd=Q(Ae(),1);var Cr=Q(Ae(),1);async function In({userRoot:e,themeRoot:t},r){let n={mode:"development",command:r},i={},o=_utils.uniq.call(void 0, [t,e]).map(s=>_path.join.call(void 0, s,"vite.config.ts"));for await(let s of o){if(!Cr.default.existsSync(s))continue;let a=await _vite.loadConfigFromFile.call(void 0, n,s);!_optionalChain([a, 'optionalAccess', _36 => _36.config])||(i=_vite.mergeConfig.call(void 0, i,a.config))}return i}async function Ln({clientRoot:e,themeRoot:t,userRoot:r,config:n}){let i=_path.resolve.call(void 0, e,"template.html"),o=await Cr.default.readFile(i,"utf-8"),s="",a="";n.siteConfig.favicon&&(s+=`<link rel="icon" href="${n.siteConfig.favicon}">`);let u=[r,t];n.siteConfig.mode==="auto"&&(s+=`
|
|
32
32
|
<script>
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
document.documentElement.classList.toggle('dark', true)
|
|
38
|
-
})()
|
|
33
|
+
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
34
|
+
const colorSchemeSetting = localStorage.getItem('vueuse-color-scheme') || 'auto'
|
|
35
|
+
if (colorSchemeSetting === 'dark' || (prefersDark && colorSchemeSetting !== 'light'))
|
|
36
|
+
document.documentElement.classList.toggle('dark', true)
|
|
39
37
|
<\/script>
|
|
40
38
|
`),n.siteConfig.lang&&(s+=`
|
|
41
39
|
<script>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
document.documentElement.setAttribute('lang', locale)
|
|
45
|
-
})()
|
|
40
|
+
const locale = localStorage.getItem('valaxy-locale') || '${n.siteConfig.lang}'
|
|
41
|
+
document.documentElement.setAttribute('lang', locale)
|
|
46
42
|
<\/script>
|
|
47
43
|
`);for(let l of u){let c=_path.join.call(void 0, l,"index.html");if(!Cr.default.existsSync(c))continue;let p=await Cr.default.readFile(c,"utf-8");s+=`
|
|
48
44
|
${(_optionalChain([p, 'access', _37 => _37.match, 'call', _38 => _38(/<head>([\s\S]*?)<\/head>/im), 'optionalAccess', _39 => _39[1]])||"").trim()}`,a+=`
|
|
49
|
-
${(_optionalChain([p, 'access', _40 => _40.match, 'call', _41 => _41(/<body>([\s\S]*?)<\/body>/im), 'optionalAccess', _42 => _42[1]])||"").trim()}`}return o=o.replace("__ENTRY__",te(_path.join.call(void 0, e,"main.ts"))).replace("<!-- head -->",s).replace("<!-- body -->",a),o}var vb=["@vueuse/head","@vueuse/integrations/useFuse","body-scroll-lock","dayjs","katex","nprogress","unocss","vue","vue-router","fuse.js","medium-zoom"],Ad=["@vueuse/core","@vueuse/shared","@unocss/reset","unocss","vue","vue-demi","valaxy","/@valaxyjs/config","/@valaxyjs/context"];function kd(e){return{name:"valaxy:site",config(t){let r={root:e.clientRoot,publicDir:_path.join.call(void 0, e.userRoot,"public"),define:Ps(e),resolve:{alias:_b(e),dedupe:["vue"]},optimizeDeps:{entries:[_path.resolve.call(void 0, e.clientRoot,"main.ts")],include:[...vb.filter(n=>!Ad.includes(n))],exclude:Ad},server:{fs:{allow:_utils.uniq.call(void 0, [_vite.searchForWorkspaceRoot.call(void 0, e.clientRoot),_vite.searchForWorkspaceRoot.call(void 0, e.themeRoot),_vite.searchForWorkspaceRoot.call(void 0, e.userRoot),_path.dirname.call(void 0, Ge("katex/package.json",!0))])}}};return _isinstalledglobally2.default&&(r.cacheDir=_path.join.call(void 0, e.pkgRoot,"node_modules/.vite"),r.resolve.alias.vue=`${Ge("vue/dist/vue.esm-browser.js",!0)}`),_vite.mergeConfig.call(void 0, t,r)},configureServer(t){return()=>{t.middlewares.use(async(r,n,i)=>{if(r.url.endsWith(".html")){n.setHeader("Content-Type","text/html"),n.statusCode=200,n.end(await Ln(e));return}if(r.url==="/atom.xml"){n.setHeader("Content-Type","application/xml"),n.statusCode=200,n.end(await Rd.default.readFile(_path.resolve.call(void 0, e.userRoot,"dist/atom.xml"),"utf-8"));return}i()})}}}}function Ps(e){return{__DEV__:e.mode==="dev"?"true":"false"}}function _b(e){let t=[{find:"~/",replacement:`${te(e.userRoot)}/`},{find:"valaxy/client/",replacement:`${te(e.clientRoot)}/`},{find:"valaxy/package.json",replacement:te(_path.resolve.call(void 0, e.clientRoot,"../package.json"))},{find:"valaxy",replacement:te(_path.resolve.call(void 0, e.clientRoot,"index.ts"))},{find:"@valaxyjs/client/",replacement:`${te(e.clientRoot)}/`},{find:`valaxy-theme-${e.theme}/`,replacement:`${te(_path.resolve.call(void 0, e.themeRoot))}/`},{find:`valaxy-theme-${e.theme}`,replacement:`${te(_path.resolve.call(void 0, e.themeRoot))}/client/index.ts`}];return e.addons.forEach(r=>{t.push({find:r.name,replacement:`${te(_path.resolve.call(void 0, r.root))}/client/index.ts`})}),t}function Fd({clientRoot:e,themeRoot:t,userRoot:r}){let n=_utils.slash.call(void 0, _path.resolve.call(void 0, e,"setup"));return{name:"valaxy:setup",enforce:"pre",async transform(i,o){if(o.startsWith(n)){let s=o.slice(n.length+1).replace(/\?.*$/,""),a=[],u=[];return _utils.uniq.call(void 0, [t,r]).map(c=>_path.join.call(void 0, c,"setup",s)).forEach((c,p)=>{if(!_fs.existsSync.call(void 0, c))return;a.push(`import __n${p} from '${te(c)}'`);let f=`__n${p}`;/\binjection_return\b/g.test(i)&&(f=`injection_return = ${f}`),/\binjection_arg\b/g.test(i)?f+="(injection_arg)":f+="()",u.push(`// ${c}`,f)}),i=i.replace("/* __imports__ */",a.join(`
|
|
45
|
+
${(_optionalChain([p, 'access', _40 => _40.match, 'call', _41 => _41(/<body>([\s\S]*?)<\/body>/im), 'optionalAccess', _42 => _42[1]])||"").trim()}`}return o=o.replace("__ENTRY__",te(_path.join.call(void 0, e,"main.ts"))).replace("<!-- head -->",s).replace("<!-- body -->",a),o}var vb=["@vueuse/head","@vueuse/integrations/useFuse","body-scroll-lock","dayjs","katex","nprogress","unocss","vue","vue-router","vue-i18n","fuse.js","medium-zoom"],Ad=["@vueuse/core","@vueuse/shared","@unocss/reset","unocss","vue","vue-demi","valaxy","/@valaxyjs/config","/@valaxyjs/context","/@valaxyjs/addons","/@valaxyjs/locales","/@valaxyjs/styles"];function kd(e){return{name:"valaxy:site",config(t){let r={root:e.clientRoot,publicDir:_path.join.call(void 0, e.userRoot,"public"),define:Ps(e),resolve:{alias:_b(e),dedupe:["vue"]},optimizeDeps:{entries:[_path.resolve.call(void 0, e.clientRoot,"main.ts")],include:[...vb.filter(n=>!Ad.includes(n))],exclude:Ad},server:{fs:{allow:_utils.uniq.call(void 0, [_vite.searchForWorkspaceRoot.call(void 0, e.clientRoot),_vite.searchForWorkspaceRoot.call(void 0, e.themeRoot),_vite.searchForWorkspaceRoot.call(void 0, e.userRoot),_path.dirname.call(void 0, Ge("katex/package.json",!0))])}}};return _isinstalledglobally2.default&&(r.cacheDir=_path.join.call(void 0, e.pkgRoot,"node_modules/.vite"),r.resolve.alias.vue=`${Ge("vue/dist/vue.esm-browser.js",!0)}`),_vite.mergeConfig.call(void 0, t,r)},configureServer(t){return()=>{t.middlewares.use(async(r,n,i)=>{if(r.url.endsWith(".html")){n.setHeader("Content-Type","text/html"),n.statusCode=200,n.end(await Ln(e));return}if(r.url==="/atom.xml"){n.setHeader("Content-Type","application/xml"),n.statusCode=200,n.end(await Rd.default.readFile(_path.resolve.call(void 0, e.userRoot,"dist/atom.xml"),"utf-8"));return}i()})}}}}function Ps(e){return{__DEV__:e.mode==="dev"?"true":"false"}}function _b(e){let t=[{find:"~/",replacement:`${te(e.userRoot)}/`},{find:"valaxy/client/",replacement:`${te(e.clientRoot)}/`},{find:"valaxy/package.json",replacement:te(_path.resolve.call(void 0, e.clientRoot,"../package.json"))},{find:"valaxy",replacement:te(_path.resolve.call(void 0, e.clientRoot,"index.ts"))},{find:"@valaxyjs/client/",replacement:`${te(e.clientRoot)}/`},{find:`valaxy-theme-${e.theme}/`,replacement:`${te(_path.resolve.call(void 0, e.themeRoot))}/`},{find:`valaxy-theme-${e.theme}`,replacement:`${te(_path.resolve.call(void 0, e.themeRoot))}/client/index.ts`}];return e.addons.forEach(r=>{t.push({find:r.name,replacement:`${te(_path.resolve.call(void 0, r.root))}/client/index.ts`})}),t}function Fd({clientRoot:e,themeRoot:t,userRoot:r}){let n=_utils.slash.call(void 0, _path.resolve.call(void 0, e,"setup"));return{name:"valaxy:setup",enforce:"pre",async transform(i,o){if(o.startsWith(n)){let s=o.slice(n.length+1).replace(/\?.*$/,""),a=[],u=[];return _utils.uniq.call(void 0, [t,r]).map(c=>_path.join.call(void 0, c,"setup",s)).forEach((c,p)=>{if(!_fs.existsSync.call(void 0, c))return;a.push(`import __n${p} from '${te(c)}'`);let f=`__n${p}`;/\binjection_return\b/g.test(i)&&(f=`injection_return = ${f}`),/\binjection_arg\b/g.test(i)?f+="(injection_arg)":f+="()",u.push(`// ${c}`,f)}),i=i.replace("/* __imports__ */",a.join(`
|
|
50
46
|
`)),i=i.replace("/* __injections__ */",u.join(`
|
|
51
47
|
`)),i}return null}}}function Od(e){let t=_utils.objectEntries.call(void 0, Ps(e));return[{name:"valaxy:flags",enforce:"pre",transform(r,n){if(n.match(/\.vue($|\?)/)){let i=r;if(t.forEach(([o,s])=>{r=r.replace(new RegExp(o,"g"),s)}),i!==r)return r}}}]}var Yt=Q(Ae(),1);var _pascalcase = require('pascal-case');var Gt=Q(Rs(),1),Md=Q(Ei(),1);var _lrucache = require('lru-cache'); var _lrucache2 = _interopRequireDefault(_lrucache);var Rb="\u200B",kb="<wbr>",Td=(0,Md.default)("vitepress:md"),$d=new (0, _lrucache2.default)({max:1024}),Fb=/<!--\s*@include:\s*(.*?)\s*-->/g;function Ob(e={},t){let r=["process.env"];return t&&r.push("import.meta",...Object.keys(e)),new RegExp(`\\b(${r.map(n=>n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|")})`,"g")}function Id(e,t,r){return e=e.replace(/<a (.*?)>(.*?)<\/a>/g,"<AppLink $1>$2</AppLink>"),e.replace(t,n=>`${n[0]}${r}${n.slice(1)}`)}var Pb=(e,t,r)=>{if(typeof t.title=="string"){let n=e.parseInline(t.title,{})[0];if(n)return Er(n,{shouldAllowHtml:!1,shouldEscapeText:!1})}return r},Tb=(e,t)=>{if(!e||!e.length)return;let r=e.find(([n,i={}])=>n==="meta"&&i.name===t&&i.content);return r&&r[1].content},$b=e=>{let{description:t,head:r}=e;return t!==void 0?t:r&&Tb(r,"description")||""};async function Ld(e,t={},r,n,i=!1,o=!1,s="with-subfolders"){let a=await Ed(t);r=r.map(l=>it(l.replace(/\.md$/,"")));let u=Ob(n,i);return async(l,c,p)=>{let f=it(_path2.default.relative(e,c)),y=_path2.default.dirname(c),h=$d.get(l);if(h)return Td(`[cache hit] ${f}`),h;let _=Date.now(),E=[];l=l.replace(Fb,(m,g)=>{try{let R=_path2.default.join(y,g),k=_fs2.default.readFileSync(R,"utf-8");return E.push(it(R)),k}catch (e24){return m}});let b={path:c,relativePath:f,cleanUrls:s},D=a.render(l,b),{frontmatter:P={},headers:V=[],links:N=[],sfcBlocks:L,title:C=""}=b,S=[],x=m=>{console.warn(Gt.default.yellow(`
|
|
52
48
|
(!) Found dead link ${Gt.default.cyan(m)} in file ${Gt.default.white(Gt.default.dim(c))}
|
|
@@ -69,7 +65,7 @@ export const __pageData = JSON.parse(${JSON.stringify(Id(n,r,Rb))})`,o=e.findInd
|
|
|
69
65
|
${a}`)}<\/script>`)}else e.unshift(`<script ${s?'lang="ts"':""}>${i}
|
|
70
66
|
${a}<\/script>`);return e}function Nd(e,t){e.includes("{%")&&e.includes("%}")&&_consola2.default.error(`${`${t}
|
|
71
67
|
`} Please ${_kolorist.red.call(void 0, "remove")} ${_kolorist.cyan.call(void 0, "{% %}")}, because it conflicts with ${_kolorist.yellow.call(void 0, "markdown-it-attrs")}.`)}function Yb(e,t){let r=[];_optionalChain([t, 'access', _52 => _52.config, 'access', _53 => _53.features, 'optionalAccess', _54 => _54.katex])&&(r.push(`import "${te(Ge("katex/dist/katex.min.css",!0))}"`),r.push(`import "${te(_path.join.call(void 0, t.clientRoot,"styles/third/katex.scss"))}"`));for(let n of e){let i=[];["index","css-vars"].forEach(s=>{i.push(_path.join.call(void 0, n,"styles",`${s}.css`)),i.push(_path.join.call(void 0, n,"styles",`${s}.scss`))});for(let s of i)Yt.default.existsSync(s)&&r.push(`import "${te(s)}"`)}return r.join(`
|
|
72
|
-
`)}function Kb(e){let t=['const messages = { "zh-CN": {}, en: {} }'],r=["zh-CN","en"];return e.forEach((n,i)=>{r.forEach(o=>{let s=`${n}/locales/${o}.yml`;if(Yt.default.existsSync(s)&&Yt.default.readFileSync(s,"utf-8")){let a=o.replace("-","")+i;t.
|
|
68
|
+
`)}function Kb(e){let t=['const messages = { "zh-CN": {}, en: {} }'],r=["zh-CN","en"];return e.forEach((n,i)=>{r.forEach(o=>{let s=`${n}/locales/${o}.yml`;if(Yt.default.existsSync(s)&&Yt.default.readFileSync(s,"utf-8")){let a=o.replace("-","")+i;t.unshift(`import ${a} from "${te(s)}"`),t.push(`Object.assign(messages['${o}'], ${a})`)}})}),t.push("export default messages"),t.join(`
|
|
73
69
|
`)}function zb(e){let t=e.addons.filter(o=>o.global).filter(o=>Yt.default.existsSync(_path.join.call(void 0, o.root,"./App.vue"))),r=o=>`Addon${_pascalcase.pascalCase.call(void 0, o)}App`,n=t.map(o=>`import ${r(o.name)} from "${o.name}/App.vue"`).join(`
|
|
74
70
|
`),i=t.map(o=>`{ component: ${r(o.name)}, props: ${JSON.stringify(o.props)} }`).join(",");return`${n}
|
|
75
71
|
export default [${i}]`}var Jb='import { defineComponent } from "vue"; export default defineComponent({ render: () => null });';function qd(e){let t=_path.join.call(void 0, e,"App.vue");return Yt.default.existsSync(t)?[`import AppVue from "${te(t)}"`,"export default AppVue"].join(`
|
|
@@ -14,7 +14,7 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
14
14
|
`)+r,i=n+1,n=e.indexOf(`
|
|
15
15
|
`,i)}while(n!==-1);return o+=e.substr(i),o};Sm.exports={stringReplaceAll:GS,stringEncaseCRLFWithFirstIndex:WS}});var Fm=v((_F,km)=>{"use strict";var YS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wm=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,KS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,JS=new Map([["n",`
|
|
16
16
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rm(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):JS.get(e)||e}function QS(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),i;for(let o of n){let s=Number(o);if(!Number.isNaN(s))r.push(s);else if(i=o.match(KS))r.push(i[2].replace(zS,(a,u,l)=>u?Rm(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return r}function XS(e){wm.lastIndex=0;let t=[],r;for(;(r=wm.exec(e))!==null;){let n=r[1];if(r[2]){let i=QS(n,r[2]);t.push([n].concat(i))}else t.push([n])}return t}function Am(e,t){let r={};for(let i of t)for(let o of i.styles)r[o[0]]=i.inverse?null:o.slice(1);let n=e;for(let[i,o]of Object.entries(r))if(!!Array.isArray(o)){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);n=o.length>0?n[i](...o):n[i]}return n}km.exports=(e,t)=>{let r=[],n=[],i=[];if(t.replace(YS,(o,s,a,u,l,c)=>{if(s)i.push(Rm(s));else if(u){let p=i.join("");i=[],n.push(r.length===0?p:Am(e,r)(p)),r.push({inverse:a,styles:XS(u)})}else if(l){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Am(e,r)(i.join(""))),i=[],r.pop()}else i.push(c)}),n.push(i.join("")),r.length>0){let o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")}});var Im=v((EF,Mm)=>{"use strict";var kr=ym(),{stdout:Us,stderr:Gs}=bm(),{stringReplaceAll:ZS,stringEncaseCRLFWithFirstIndex:eC}=Cm(),{isArray:Wn}=Array,Pm=["ansi","ansi","ansi256","ansi16m"],Xt=Object.create(null),tC=(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");let r=Us?Us.level:0;e.level=t.level===void 0?r:t.level},Ws=class{constructor(t){return Tm(t)}},Tm=e=>{let t={};return tC(t,e),t.template=(...r)=>Dm(t.template,...r),Object.setPrototypeOf(t,Yn.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Ws,t.template};function Yn(e){return Tm(e)}for(let[e,t]of Object.entries(kr))Xt[e]={get(){let r=Kn(this,Ys(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};Xt.visible={get(){let e=Kn(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var $m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of $m)Xt[e]={get(){let{level:t}=this;return function(...r){let n=Ys(kr.color[Pm[t]][e](...r),kr.color.close,this._styler);return Kn(this,n,this._isEmpty)}}};for(let e of $m){let t="bg"+e[0].toUpperCase()+e.slice(1);Xt[t]={get(){let{level:r}=this;return function(...n){let i=Ys(kr.bgColor[Pm[r]][e](...n),kr.bgColor.close,this._styler);return Kn(this,i,this._isEmpty)}}}}var rC=Object.defineProperties(()=>{},{...Xt,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ys=(e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Kn=(e,t,r)=>{let n=(...i)=>Wn(i[0])&&Wn(i[0].raw)?Om(n,Dm(n,...i)):Om(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,rC),n._generator=e,n._styler=t,n._isEmpty=r,n},Om=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=ZS(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
|
|
17
|
-
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);import Zt from"path";import{exec as mC}from"child_process";import hC from"yargs";import{mergeConfig as Ks}from"vite";import gC from"open";import Qn from"consola";import{yellow as yC}from"kolorist";import{hideBin as vC}from"yargs/helpers";var Hr="0.14.
|
|
17
|
+
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);import Zt from"path";import{exec as mC}from"child_process";import hC from"yargs";import{mergeConfig as Ks}from"vite";import gC from"open";import Qn from"consola";import{yellow as yC}from"kolorist";import{hideBin as vC}from"yargs/helpers";var Hr="0.14.4";import r1 from"net";async function gi(e){return await n1(e)?e:await gi(e+1)}function n1(e){return new Promise(t=>{let r=r1.createServer(n=>{n.write(`Echo server\r
|
|
18
18
|
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var jp=Q(Ae(),1),Hp=Q(Ei(),1),Vp=Q(bn(),1);import{dirname as HE,resolve as Fn}from"path";import{ensureSuffix as Bp,uniq as VE}from"@antfu/utils";function ns(e){return e!==null&&typeof e=="object"}function is(e,t,r=".",n){if(!ns(t))return is(e,{},r,n);let i=Object.assign({},t);for(let o in e){if(o==="__proto__"||o==="constructor")continue;let s=e[o];s!=null&&(n&&n(i,o,s,r)||(Array.isArray(s)&&Array.isArray(i[o])?i[o]=s.concat(i[o]):ns(s)&&ns(i[o])?i[o]=is(s,i[o],(r?`${r}.`:"")+o.toString(),n):i[o]=s))}return i}function mr(e){return(...t)=>t.reduce((r,n)=>is(r,n,"",e),{})}var $e=mr(),kw=mr((e,t,r,n)=>{if(typeof e[t]<"u"&&typeof r=="function")return e[t]=r(e[t]),!0}),Fw=mr((e,t,r,n)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});import{cyan as UE,yellow as GE}from"kolorist";import F_ from"consola";var os=()=>process.env.NODE_ENV==="production",ss=(e="development")=>{process.env.NODE_ENV=e,we.level=os()?2:3},hr=()=>ss("production");var we=F_.create({level:os()?2:3});var Tp=Q(bp(),1);import{join as Fp}from"path";import AE from"is-installed-globally";import Op from"global-dirs";import Pp from"consola";import{spawn as EE}from"cross-spawn";function _r(e,t="updated"){return new Promise((r,n)=>{let i=["log"];t==="updated"&&i.push("-1"),i.push('--pretty="%ci"',e),t==="created"&&i.push("|","tail","-1");let o=EE("git",i),s="";o.stdout.on("data",a=>s+=String(a)),o.on("close",()=>{r(+new Date(s))}),o.on("error",()=>{r(0)})})}var An="<!-- more -->",jt=/^https?:/i,Sp=/^pathname:\/\//;function Cp(e){return jt.test(e)}function it(e){return e.replace(/\\/g,"/")}function hs(e,t){return t.startsWith(e)?t:e+t}function te(e){return`/@fs${hs("/",it(e))}`}function wp(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}import{mergeConfig as SE}from"vite";import{isFunction as Ap}from"@antfu/utils";import{cyan as CE,dim as wE}from"kolorist";import{loadConfig as xE}from"unconfig";import{normalizePath as bE}from"vite";async function vt(e,t={}){let{config:r,sources:n}=await await xE({sources:{files:e,rewrite:t.rewrite},cwd:t.cwd||process.cwd()}),i=bE(n[0]||"");return{config:r,configFile:i}}var Ht=mr((e,t,r)=>{if(Ap(e[t])&&Ap(r)&&(e[t]=function(...n){e[t].call(this,...n),r.call(this,...n)}),t==="vite")return e[t]=SE(e[t],r),!0});async function gs(e,t){return vt("valaxy.config",{rewrite(r){return typeof r=="function"?r(t||{}):r},cwd:e})}async function Rp(e){let{config:t,configFile:r}=await gs(e.userRoot||process.cwd());t&&we.info(`Resolve ${CE("valaxyConfig")} from ${wE(r)}`);let n=e.theme||t.theme||"yun";return{config:t,configFile:r,theme:n}}async function kp(e,t){let r={};for(let n of e){let{config:i,configFile:o}=await vt("index",{rewrite(s,a){return typeof s=="function"?s(n,t):s},cwd:n.root});!i||(n.configFile=o,r=Ht(i,r))}return r}var $p=e=>`JSON.parse(${JSON.stringify(JSON.stringify(e))})`;function Ge(e,t=!1,r={preserveSymlinks:!1}){try{return(0,Tp.sync)(e,r)}catch(n){Pp.log(n)}if(AE){try{return I.resolve(Fp(Op.yarn.packages,e))}catch{}try{return I.resolve(Fp(Op.npm.packages,e))}catch{}}if(t)throw new Error(`Failed to resolve package ${e}`);Pp.error(`Failed to resolve package ${e}`)}function RE(e){return e}var bA=RE;function kE(e){return e}var SA=kE;function wA(e){return e}function FE(e){return e}var AA=FE,ys={mode:"auto",url:"/",lang:"en",title:"Valaxy Blog",description:"A blog generated by Valaxy.",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://www.yunyoujun.cn/images/avatar.jpg",email:"i@valaxy.site",link:"https://valaxy.site",name:"VALAXY Developer",status:{emoji:"\u{1F30C}",message:"The moonlight is beautiful."}},favicon:"/favicon.svg",feed:{name:"",favicon:"/favicon.svg"},social:[],date:{format:""},lastUpdated:!0,license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u8D5E\u52A9",methods:[]},search:{enable:!1,type:"fuse"},comment:{enable:!1},cdn:{prefix:"https://unpkg.com/"},mediumZoom:{enable:!1,selector:"",options:{}}},Dp={ignoreDeadLinks:!0,siteConfig:ys,theme:"yun",themeConfig:{pkg:{name:"",version:""}},runtimeConfig:{addons:{}},features:{katex:!0},vite:{build:{rollupOptions:{external:[]}}}};function RA(e){return e}var vs=Q(Ae(),1);import{resolve as TE}from"path";import{cyan as $E,yellow as DE}from"kolorist";import{dirname as Mp,resolve as OE}from"path";import PE from"fs";function Rn(e,t){if(!e)return"";if(wp(e))if(t){let r=PE.lstatSync(t).isFile();return OE(r?Mp(t):t,e)}else throw new Error(`entry is required when ${e} is path`);else return Mp(Ge(`${e}/package.json`)||"")}async function Lp(e,t=process.cwd()){let r={},n=o=>{o&&(r[o.name]=$e(r[o.name]||{},o))};if(Array.isArray(e))for(let o of e){if(typeof o=="string"){n(await Ip(o,{cwd:t}));continue}typeof o=="object"&&n($e(await Ip(o.name,{cwd:t}),o||{}))}let i=Object.values(r).filter(o=>o.enable);return we.info(`Resolve ${$E("addons:")} ${DE(i.map(o=>o.name).join(", "))}`),i}async function Ip(e,t={}){let r=ME(e,t.cwd||process.cwd()),n=TE(r,"./package.json");if(!vs.default.existsSync(n)){we.error(`No addon named ${e} found`);return}let i=await vs.default.readJSON(n);return{enable:!0,name:i.name,global:!!i.global,root:r,options:{},props:{}}}function ME(e,t){let r=e.startsWith("valaxy-addon")||e.startsWith(".")?e:`valaxy-addon-${e}`;return Rn(r,t)}function Np(e,t){let r=e.startsWith("valaxy-theme")||e.startsWith(".")?e:`valaxy-theme-${e}`;return Rn(r,t)}import{cyan as IE,dim as LE}from"kolorist";async function NE(e){return vt("site.config",{cwd:e})}async function kn(e){let{config:t,configFile:r}=await NE(e);return t&&we.info(`Resolve ${IE("siteConfig")} from ${LE(r)}`),{siteConfig:t,siteConfigFile:r}}import{cyan as qE,dim as BE}from"kolorist";async function jE(e){return vt("theme.config",{cwd:e})}async function qp(e){let{config:t,configFile:r}=await jE(e);return t&&we.info(`Resolve ${qE("themeConfig")} from ${BE(r)}`),{themeConfig:t,themeConfigFile:r}}var WE=(0,Hp.default)("valaxy:options");async function YE(e){let{config:t,themeRoot:r,theme:n}=e,i=t.siteConfig;i.url=Bp("/",i.url||""),i.cdn.prefix=Bp("/",i.cdn.prefix||"");let o=Fn(r,"package.json");try{t.themeConfig.pkg=await jp.default.readJson(o,"utf-8")}catch{console.error(`valaxy-theme-${n} doesn't have package.json`)}}async function _s(e,t){let{clientRoot:r,themeRoot:n,userRoot:i}=e,o=await Lp(t.addons||[],e.userRoot),s=await kp(o,e);t=Ht(t,s);let a=$e(t,Dp);e.config={...a,runtimeConfig:{addons:{}}},e.addons=o,o.forEach(p=>{e.config.runtimeConfig.addons[p.name]=p});let u=o.map(({root:p})=>p),l=o.map(({name:p})=>p);e.addonRoots=u,e.roots=VE([r,n,...u,i]);let c=e.config.vite?.build?.rollupOptions?.external||[];return e.config.vite.build.rollupOptions.external=c.filter(p=>!l.includes(p)),await YE(e),e}async function De(e={userRoot:process.cwd()},t="dev"){let r=HE(Ge("valaxy/package.json",!0)),n=Fn(r,"client"),i=Fn(e.userRoot||process.cwd()),{config:o,configFile:s,theme:a}=await Rp(e),{siteConfig:u,siteConfigFile:l}=await kn(e.userRoot),{themeConfig:c,themeConfigFile:p}=await qp(e.userRoot);o=$e({siteConfig:u},{themeConfig:c},o);let f=Np(a,e.userRoot),y=(await(0,Vp.default)(["**.md"],{cwd:Fn(i,"pages"),ignore:["**/node_modules"]})).sort(),h={mode:t,pkgRoot:r,clientRoot:n,userRoot:i,themeRoot:f,addonRoots:[],roots:[],theme:a,config:{...o,runtimeConfig:{addons:{}}},configFile:s||"",siteConfigFile:l||"",themeConfigFile:p||"",pages:y,addons:[]};WE(h);let _=await Es(h),E=Ht(o,_);return h=await _s(h,E),h}async function Es(e){we.info(`Resolve ${UE("valaxy.config.ts")} from ${GE(`theme(${e.theme})`)}`);let{config:t}=await gs(e.themeRoot,e);return t}import*as Gd from"readline";import cS from"path";import lS from"os";import{blue as Vd,bold as $s,cyan as fS,dim as We,gray as pS,green as dS,underline as Ds,yellow as mS}from"kolorist";import Ud from"consola";import{mergeConfig as hS}from"vite";import{createServer as aS,mergeConfig as uS}from"vite";import Nn from"fs";import{splitVendorChunkPlugin as Qb}from"vite";import Xb from"markdown-it";import Zb from"gray-matter";import eS from"@vitejs/plugin-vue";import tS from"vite-plugin-pages";import rS from"vite-plugin-vue-layouts";import nS from"unplugin-vue-components/vite";import iS from"@intlify/unplugin-vue-i18n/vite";import jd from"dayjs";import{convert as oS}from"html-to-text";import Wx from"markdown-it";import _d from"markdown-it-anchor";import Yx from"markdown-it-attrs";import Kx from"markdown-it-emoji";import zx from"markdown-it-task-lists";import KE from"markdown-it/lib/common/html_blocks.js";var zE="[a-zA-Z_:@][a-zA-Z0-9:._-]*",JE="[^\"'=<>`\\x00-\\x20]+",QE="'[^']*'",XE='"[^"]*"',ZE="(?:"+JE+"|"+QE+"|"+XE+")",xs="(?:\\s+"+zE+"(?:\\s*=\\s*"+ZE+")?)",Up="<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/?>",Gp="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ex="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",tx="<[?][\\s\\S]*?[?]>",rx="<![A-Z]+\\s+[^>]*>",nx="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ix=new RegExp("^(?:"+Up+"|"+Gp+"|"+ex+"|"+tx+"|"+rx+"|"+nx+")"),ox=new RegExp("^(?:"+Up+"|"+Gp+")"),sx=new RegExp("^<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/>"),ax=new RegExp("^<([A-Za-z][A-Za-z0-9\\-]*)"+xs+"*\\s*>.*<\\/\\1\\s*>"),ux=KE,cx=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"],lx=["template","component","transition","transition-group","keep-alive","slot","teleport"],fx=({blockTags:e,inlineTags:t})=>{let r=[...e,...ux],n=[...t,...cx.filter(o=>!lx.includes(o))];return[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp("^</?(?!("+n.join("|")+")(?![\\w-]))[A-Za-z][A-Za-z0-9\\-]*(?=(\\s|/?>|$))"),/^$/,!0],[new RegExp(ox.source+"\\s*$"),/^$/,!1]]},px=e=>{let t=fx(e);return(r,n,i,o)=>{let s,a,u,l=r.bMarks[n]+r.tShift[n],c=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||!r.md.options.html||r.src.charCodeAt(l)!==60)return!1;for(u=r.src.slice(l,c),s=0;s<t.length&&!t[s][0].test(u);s++);if(s===t.length)return!1;if(o)return t[s][2];if(s===6){let f=u.match(sx)??u.match(ax);if(f){r.line=n+1;let y=r.push("html_inline","",0);return y.content=f[0],y.map=[n,r.line],y=r.push("inline","",0),y.content=u.slice(f[0].length),y.map=[n,r.line],y.children=[],!0}}if(a=n+1,!t[s][1].test(u)){for(;a<i&&!(r.sCount[a]<r.blkIndent);a++)if(l=r.bMarks[a]+r.tShift[a],c=r.eMarks[a],u=r.src.slice(l,c),t[s][1].test(u)){u.length!==0&&a++;break}}r.line=a;let p=r.push("html_block","",0);return p.map=[n,a],p.content=r.getLines(n,a,r.blkIndent,!0),!0}},dx=e=>{let t=e|32;return t>=97&&t<=122},mx=(e,t)=>{let{pos:r}=e;if(!e.md.options.html)return!1;let n=e.posMax;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dx(i))return!1;let o=e.src.slice(r).match(ix);if(!o)return!1;if(!t){let s=e.push("html_inline","",0);s.content=e.src.slice(r,r+o[0].length)}return e.pos+=o[0].length,!0},Wp=(e,{blockTags:t=[],inlineTags:r=[]}={})=>{let n=px({blockTags:t,inlineTags:r});e.block.ruler.at("html_block",n,{alt:["paragraph","reference","blockquote"]}),e.inline.ruler.at("html_inline",mx)};import hx from"gray-matter";var Yp=(e,{grayMatterOptions:t,renderExcerpt:r=!0}={})=>{let n=e.render.bind(e);e.render=(i,o={})=>{let{data:s,content:a,excerpt:u=""}=hx(i,t);return o.content=a,o.frontmatter={...o.frontmatter,...s},o.excerpt=r&&u?n(u,{...o}):u,n(a,o)}};var gx={"&":"&","<":"<",">":">","'":"'",'"':"""},yx=/[&<>'"]/g,_t=e=>e.replace(yx,t=>gx[t]);var Er=(e,{shouldAllowHtml:t,shouldEscapeText:r})=>{let n=e.children??[],i=["text","emoji","code_inline"];return t&&i.push("html_inline"),n.filter(s=>i.includes(s.type)&&!s.meta?.isPermalinkSymbol).reduce((s,a)=>r&&(a.type==="code_inline"||a.type==="text")?`${s}${_t(a.content)}`:`${s}${a.content}`,"").trim()},On=(e,{level:t,shouldAllowHtml:r,shouldEscapeText:n,slugify:i,format:o})=>{let s=[],a=[],u=l=>{for(;a.length!==0&&l.level<=a[0].level;)a.shift();a.length===0?(s.push(l),a.push(l)):(a[0].children.push(l),a.unshift(l))};for(let l=0;l<e.length;l+=1){let c=e[l];if(c?.type!=="heading_open"||c?.level!==0)continue;let p=Number.parseInt(c.tag.slice(1),10);if(!t.includes(p))continue;let f=e[l+1];if(!f)continue;let y=Er(f,{shouldAllowHtml:r,shouldEscapeText:n}),h=c.attrGet("id")??i(y);u({level:p,title:o?.(y)??y,slug:h,link:`#${h}`,children:[]})}return s},vx=/[\u0000-\u001f]/g,_x=/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,Ex=/[\u0300-\u036F]/g,Pn=e=>e.normalize("NFKD").replace(Ex,"").replace(vx,"").replace(_x,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase();var Kp=(e,{level:t=[2,3],slugify:r=Pn,format:n}={})=>{let i=e.renderer.render.bind(e.renderer);e.renderer.render=(o,s,a)=>(a.headers=On(o,{level:t,shouldAllowHtml:!1,shouldEscapeText:!1,slugify:r,format:n}),i(o,s,a))};var zp="script",Jp="style",xr="template",xx=/^<script\s+.*?\bsetup\b.*?>$/is,bx=({customBlocks:e})=>{let t=Array.from(new Set([zp,Jp,...e])).join("|");return new RegExp(`^\\s*(?<content>(?<tagOpen><(?<type>${t})\\s?.*?>)(?<contentStripped>.*)(?<tagClose><\\/\\k<type>\\s*>))\\s*$`,"is")},Qp=(e,{customBlocks:t=[]}={})=>{let r=bx({customBlocks:t}),n=e.render.bind(e);e.render=(o,s={})=>{s.sfcBlocks={template:null,script:null,scriptSetup:null,scripts:[],styles:[],customBlocks:[]};let a=n(o,s);return s.sfcBlocks.template={type:xr,content:`<${xr}>${a}</${xr}>`,contentStripped:a,tagOpen:`<${xr}>`,tagClose:`</${xr}>`},a};let i=e.renderer.rules.html_block;e.renderer.rules.html_block=(o,s,a,u,l)=>{if(!u.sfcBlocks)return i(o,s,a,u,l);let f=o[s].content.match(r);if(!f)return i(o,s,a,u,l);let y=f.groups;return y.type===zp?(u.sfcBlocks.scripts.push(y),xx.test(y.tagOpen)?u.sfcBlocks.scriptSetup=y:u.sfcBlocks.script=y):y.type===Jp?u.sfcBlocks.styles.push(y):u.sfcBlocks.customBlocks.push(y),""}};var Xp=e=>{let t=e.renderer.render.bind(e.renderer);e.renderer.render=(r,n,i)=>{let o=r.findIndex(s=>s.tag==="h1");return i.title=o>-1?Er(r[o+1],{shouldAllowHtml:!1,shouldEscapeText:!1}):"",t(r,n,i)}};var Sx=({listTag:e,listClass:t,itemClass:r,linkTag:n,linkClass:i})=>{let o=_t(e),s=t?` class="${_t(t)}"`:"",a="li",u=r?` class="${_t(r)}"`:"",l=_t(n),c=i?` class="${_t(i)}"`:"",p=y=>n==="router-link"?` to="${y}"`:` href="${y}"`,f=y=>`<${o}${s}>${y.map(h=>`<${a}${u}${u}><${l}${c}${p(h.link)}>${h.title}</${l}>${h.children.length>0?f(h.children):""}</${a}>`).join("")}</${o}>`;return f},Cx=({pattern:e,containerTag:t,containerClass:r})=>(n,i,o,s)=>{if(n.sCount[i]-n.blkIndent>=4)return!1;let a=n.bMarks[i]+n.tShift[i],u=n.eMarks[i],l=n.src.slice(a,u).split(" ")[0];if(!e.test(l))return!1;if(s)return!0;n.line=i+1;let c=n.push("toc_open",t,1);c.markup="",c.map=[i,n.line],r&&c.attrSet("class",r);let p=n.push("toc_body","",0);p.markup=l,p.map=[i,n.line],p.hidden=!0;let f=n.push("toc_close",t,-1);return f.markup="",p.map=[i,n.line],!0},Zp=(e,{pattern:t=/^\[\[toc\]\]$/i,slugify:r=Pn,format:n,level:i=[2,3],containerTag:o="nav",containerClass:s="table-of-contents",listTag:a="ul",listClass:u="",itemClass:l="",linkTag:c="a",linkClass:p=""}={})=>{e.block.ruler.before("heading","toc",Cx({pattern:t,containerTag:o,containerClass:s}),{alt:["paragraph","reference","blockquote"]});let f=Sx({listTag:a,listClass:u,itemClass:l,linkTag:c,linkClass:p});e.renderer.rules.toc_body=y=>f(On(y,{level:i,shouldAllowHtml:!0,shouldEscapeText:!0,slugify:r,format:n}))};import ed from"katex";function td(e,t){let r=e.posMax,n=!0,i=!0,o=t>0?e.src.charCodeAt(t-1):-1,s=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||s>=48&&s<=57)&&(i=!1),(s===32||s===9)&&(n=!1),{can_open:n,can_close:i}}function wx(e,t){let r,n,i,o;if(e.src[e.pos]!=="$")return!1;if(i=td(e,e.pos),!i.can_open)return t||(e.pending+="$"),e.pos+=1,!0;let s=e.pos+1;for(r=s;(r=e.src.indexOf("$",r))!==-1;){for(o=r-1;e.src[o]==="\\";)o-=1;if((r-o)%2===1)break;r+=1}return r===-1?(t||(e.pending+="$"),e.pos=s,!0):r-s===0?(t||(e.pending+="$$"),e.pos=s+1,!0):(i=td(e,r),i.can_close?(t||(n=e.push("math_inline","math",0),n.markup="$",n.content=e.src.slice(s,r)),e.pos=r+1,!0):(t||(e.pending+="$"),e.pos=s,!0))}function Ax(e,t,r,n){let i,o,s,a,u=!1,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+2>c||e.src.slice(l,l+2)!=="$$")return!1;if(l+=2,i=e.src.slice(l,c),n)return!0;for(i.trim().slice(-2)==="$$"&&(i=i.trim().slice(0,-2),u=!0),s=t;!u&&(s++,!(s>=r||(l=e.bMarks[s]+e.tShift[s],c=e.eMarks[s],l<c&&e.tShift[s]<e.blkIndent)));)e.src.slice(l,c).trim().slice(-2)==="$$"&&(a=e.src.slice(0,c).lastIndexOf("$$"),o=e.src.slice(l,a),u=!0);e.line=s+1;let p=e.push("math_block","math",0);return p.block=!0,p.content=(i&&i.trim()?`${i}
|
|
19
19
|
`:"")+e.getLines(t+1,s,e.tShift[t],!0)+(o&&o.trim()?o:""),p.map=[t,e.line],p.markup="$$",!0}function bs(e,t){t=t||{};let r=function(s){t.displayMode=!1;try{return ed.renderToString(s,t)}catch(a){return t.throwOnError&&console.warn(a),s}},n=function(s,a){return r(s[a].content)},i=function(s){t.displayMode=!0;try{return`<p>${ed.renderToString(s,t)}</p>`}catch(a){return t.throwOnError&&console.warn(a),s}},o=function(s,a){return`${i(s[a].content)}
|
|
20
20
|
`};e.inline.ruler.after("escape","math_inline",wx),e.block.ruler.after("blockquote","math_block",Ax,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=o}import Ss from"markdown-it-container";function Rx(e,{icon:t,color:r,text:n,langs:i}={}){return[Ss,e,{render(o,s){let a=o[s],u=a.info.trim().slice(e.length).trim();if(a.nesting===1){if(e==="details")return`<details class="${e} custom-block">${`<summary>${u}</summary>`}
|
|
@@ -30,23 +30,19 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
30
30
|
`),{code:r,lineOptions:i}}}function Ut(e,t,r){let n=new RegExp(`<${r??"w+"}[^>]*class="([\\w+-:;\\/* ]*)"`);return t=Array.isArray(t)?t:[t],e.replace(n,(i,o)=>i.replace(o,`${o} ${t}`))}function ld(e={}){let t=e.commonDiffClass??"diff",r=e.removedLinesClasses??["remove"],n=e.removedLinesClasses??["add"],i=e.removeLineTag??"--",o=e.addLineTag??"++",s=e.hasDiffClass??"has-diff";return{name:"diff",handler:Sr({[i]:[t,...r],[o]:[t,...n]},e),postProcess:({code:a})=>a.includes(t)?Ut(a,s,"pre"):a}}function fd(e={}){let t=e.hasFocusClass??"has-focus",r=e.hasFocusedLinesClass??"has-focused-lines",n=e.focusTag??"focus";return{name:"focus",handler:Sr({[n]:[t]},e),postProcess:({code:i})=>i.includes(t)?Ut(i,r,"pre"):i}}function pd(e={}){let t=e.hasHighlightClass??"has-highlight",r=e.hasHighlightedLinesClass??"has-highlighted-lines",n=e.highlightTag??"hl";return{name:"highlight",handler:Sr({[n]:[t]},e),postProcess:({code:i})=>i.includes(t)?Ut(i,r,"pre"):i}}function Nx(e,t,r){return e.reduce((n,i)=>{let{code:o,lineOptions:s}=i.handler?.({code:n.code,lang:r})??n;return{code:o,lineOptions:[...n.lineOptions,...s]}},{code:t,lineOptions:[]})}function qx(e,t,r){return e.reduce((n,i)=>i.postProcess?.({code:n,lang:r})??n,t)}async function dd(e={}){let t=await Lx(e),r=e.processors??[];return{...t,codeToHtml:(n,i)=>{let o=typeof i=="object"?i.lang:i,s=typeof i=="object"?i.lineOptions??[]:[],a=typeof i=="object"?i.theme:void 0,{code:u,lineOptions:l}=Nx(r,n,o),c=t.codeToHtml(u,{lang:o,theme:a,lineOptions:[...l,...s]});return qx(r,c,o)}}}var Bx=ad("abcdefghijklmnopqrstuvwxyz",10),jx=e=>{e=e.replace(/^(?:\[.*?\])?.*?([\d,-]+).*/,"$1").trim();let t=[];return e?(e.split(",").map(r=>r.split("-").map(n=>parseInt(n,10))).forEach(([r,n])=>{r&&n?t.push(...Array.from({length:n-r+1},(i,o)=>r+o)):t.push(r)}),t.map(r=>({line:r,classes:["highlighted"]}))):[]},Hx={name:"error-level",handler:Sr({error:["highlighted","error"],warning:["highlighted","warning"]})};async function hd(e="material-theme-palenight",t="txt"){let r=typeof e=="string"||"name"in e,n=p=>typeof p=="string"?p:p.name,i=[fd(),pd({hasHighlightClass:"highlighted"}),ld(),Hx],o=await dd({themes:r?[e]:[e.dark,e.light],processors:i}),s=/<pre[^>]*(style=".*?")/,a=/^<pre(.*?)>/,u=/-vue$/,l=/:(no-)?line-numbers$/,c=/\{\{.*?\}\}/g;return(p,f,y)=>{let h=u.test(f)?"":"v-pre";f=f.replace(l,"").replace(u,"").toLowerCase()||t,f&&(o.getLoadedLanguages().includes(f)||(f!==t&&console.warn(md.default.yellow(`The language '${f}' is not loaded, falling back to '${t}' for syntax highlighting.`)),f=t));let _=jx(y),E=L=>L.replace(a,(C,S)=>`<pre ${h}${S}>`).replace(s,(C,S)=>C.replace(S,"")),b=new Map,D=L=>h?L:L.replace(c,C=>{let S=b.get(C);return S||(S=Bx(),b.set(C,S)),S}),P=L=>(b.forEach((C,S)=>{L=L.replaceAll(C,S)}),L);if(r)return E(P(o.codeToHtml(D(p),{lang:f,lineOptions:_,theme:n(e)})));let V=Ut(E(o.codeToHtml(p,{lang:f,lineOptions:_,theme:n(e.dark)})),"va-code-dark","pre"),N=Ut(E(o.codeToHtml(p,{lang:f,lineOptions:_,theme:n(e.light)})),"va-code-light","pre");return V+N}}var Vx=/^<pre .*?><code>/,gd=e=>{let t=e.renderer.rules.fence;e.renderer.rules.fence=(...r)=>{let[n,i,o]=r,s=n[i],a=s.attrs&&s.attrs[0];if(!a)return t(...r);let u=a[0];if(!u||!/[\d,-]+/.test(u))return t(...r);let l=u.split(",").map(h=>h.split("-").map(_=>parseInt(_,10))),c=o.highlight?o.highlight(s.content,s.info,""):s.content;return`<div class="highlight-lines">${c.replace(Vx,"").split(`
|
|
31
31
|
`).map((h,_)=>{let E=_+1;return l.some(([D,P])=>D&&P?E>=D&&E<=P:E===D)?'<div class="highlighted"> </div>':"<br>"}).join("")}</div>`+c}},yd=e=>{let t=e.renderer.rules.fence;e.renderer.rules.fence=(...r)=>{let[n,i]=r,o=n[i],s=t(...r);return`<div class="language-${o.info.trim()}"><span class="copy"></span>${s}</div>`}};import{URL as Ux}from"url";var Gx=/(^|.*\/)index.md(#?.*)$/i,vd=(e,t,r)=>{e.renderer.rules.link_open=(o,s,a,u,l)=>{let c=o[s],p=c.attrIndex("href");if(p>=0){let f=c.attrs[p],y=f[1];jt.test(y)?(Object.entries(t).forEach(([_,E])=>{c.attrSet(_,E)}),f[1]=y.replace(Sp,"")):!y.startsWith("#")&&!y.startsWith("mailto:")&&!/\.(?!html|md)\w+($|\?)/i.test(y)&&n(f,u),f[1]=f[1].replace(/\bimport\.meta/g,"import%2Emeta").replace(/\bprocess\.env/g,"process%2Eenv")}return l.renderToken(o,s,a)};function n(o,s){let a=o[1],u=a.match(Gx);if(u){let[,l,c]=u;a=l+c}else{let l=a.replace(/[?#].*$/,"");l.endsWith(".md")&&(l=l.replace(/\.md$/,s.cleanUrls==="disabled"?".html":"")),s.cleanUrls==="disabled"&&!l.endsWith(".html")&&!l.endsWith("/")&&(l+=".html");let c=new Ux(a,"http://a.com");a=l+c.search+c.hash}!a.startsWith("/")&&!/^\.\//.test(a)&&(a=`./${a}`),i(a.replace(/\.html$/,""),s),a.startsWith("/")&&(a=`${r}${a}`.replace(/\/+/g,"/")),o[1]=decodeURI(a)}function i(o,s){(s.links||(s.links=[])).push(o)}};async function ks(e,t={},r=!1,n="/"){return e.use(gd).use(yd).use(nd,t.blocks).use(vd,{target:"_blank",rel:"noreferrer",...t.externalLinks},n),t.attrs?.disable||e.use(Yx,t.attrs),e.use(bs,t.katex),e.use(Kx),r||e.use(_d,{slugify:Mn,permalink:_d.permalink.ariaHidden({}),...t.anchor}),e.use(Wp).use(Yp,{...t.frontmatter}).use(Kp,{slugify:Mn,...t.headers}).use(Qp,{...t.sfc}).use(Xp).use(Zp,{slugify:Mn,...t.toc}),e.use(zx),t.config&&t.config(e),e}var Ed=async(e={})=>{let t=Wx({html:!0,linkify:!0,highlight:await hd(e.theme),...e.options});return await ks(t,e),t};import{resolve as Zx}from"path";import{existsSync as eb}from"fs";import tb from"jiti";import{presetAttributify as rb,presetIcons as nb,presetTypography as ib,presetUno as ob,transformerDirectives as sb,transformerVariantGroup as ab}from"unocss";var xd=Q(Ae(),1);import{resolve as Jx}from"path";import{isObject as Qx}from"@antfu/utils";import Xx from"jiti";function bd(e,t,r=""){return e={...e},Object.keys(t).forEach(n=>{Qx(e[n])?e[n]=bd(e[n],t[n],r?`${r}.${n}`:n):Array.isArray(e[n])?e[n]=[...e[n],...t[n]]:e[n]=t[n]}),e}async function Sd(e,t,r,n,i=!0){let o=n;for(let s of e){let a=Jx(s,"setup",t);if(xd.default.existsSync(a)){let{default:u}=Xx(__filename)(a),l=await u(r);l!==null&&(o=i?bd(o,l):l)}}return o}var ub=async e=>{let{config:t}=e,r=["i-ri-clipboard-line","i-ri-archive-line","i-ri-folder-2-line","i-ri-price-tag-3-line","i-ri-cloud-line"].concat(e.config.unocss?.safelist||[]),n="animate-fade-in m-auto text-left".split(" ").concat(["rotate-y-180"]).concat(r),i=t.siteConfig;i.social?.length&&i.social.forEach(s=>n.push(s?.icon||""));let o=i.sponsor?.methods||[];return o.length&&o.forEach(s=>n.push(s?.icon||"")),n},cb=async e=>{let{config:t}=e;return{shortcuts:[["btn","px-4 py-1 rounded inline-block bg-$va-c-primary text-white cursor-pointer transition hover:bg-$va-c-primary-light disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50"],["icon-btn","inline-flex justify-center items-center cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-sky-600"],["va-card","shadow hover:shadow-lg"]],presets:[ob(t.unocssPresets?.uno),rb(t.unocssPresets?.attributify),nb({scale:1.2,...t.unocssPresets?.icons}),ib(t.unocssPresets?.typography)],rules:[["font-serif",{"font-family":"var(--va-font-serif)"}],["font-sans",{"font-family":"var(--va-font-sans)"}],["font-mono",{"font-family":"var(--va-font-mono)"}]],transformers:[sb(),ab()],safelist:await ub(e)}},Cd=async e=>{let t=await import("unocss/vite").then(f=>f.default),{unocss:r}=e.config,n=await cb(e),{themeRoot:i,clientRoot:o,roots:s}=e,a=["uno.config.ts","unocss.config.ts"],u=[];[i,o].forEach(f=>a.forEach(y=>u.push(Zx(f,y))));let c={},p=[];return u.forEach(f=>{if(eb(f)){let y=tb(__filename)(f);"default"in y&&(y=y.default),c=$e(c,y),p.push(f)}}),c=await Sd(s,"unocss.ts",{},c,!0),t({configDeps:p,configFile:!1,...$e(r||{},c,n)})};var Rd=Q(Ae(),1);import{dirname as mb,join as wd,resolve as xt}from"path";import{mergeConfig as hb,searchForWorkspaceRoot as Os}from"vite";import gb from"is-installed-globally";import{uniq as yb}from"@antfu/utils";var Cr=Q(Ae(),1);import{join as Fs,resolve as lb}from"path";import{uniq as fb}from"@antfu/utils";import{loadConfigFromFile as pb,mergeConfig as db}from"vite";async function In({userRoot:e,themeRoot:t},r){let n={mode:"development",command:r},i={},o=fb([t,e]).map(s=>Fs(s,"vite.config.ts"));for await(let s of o){if(!Cr.default.existsSync(s))continue;let a=await pb(n,s);!a?.config||(i=db(i,a.config))}return i}async function Ln({clientRoot:e,themeRoot:t,userRoot:r,config:n}){let i=lb(e,"template.html"),o=await Cr.default.readFile(i,"utf-8"),s="",a="";n.siteConfig.favicon&&(s+=`<link rel="icon" href="${n.siteConfig.favicon}">`);let u=[r,t];n.siteConfig.mode==="auto"&&(s+=`
|
|
32
32
|
<script>
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
document.documentElement.classList.toggle('dark', true)
|
|
38
|
-
})()
|
|
33
|
+
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
34
|
+
const colorSchemeSetting = localStorage.getItem('vueuse-color-scheme') || 'auto'
|
|
35
|
+
if (colorSchemeSetting === 'dark' || (prefersDark && colorSchemeSetting !== 'light'))
|
|
36
|
+
document.documentElement.classList.toggle('dark', true)
|
|
39
37
|
<\/script>
|
|
40
38
|
`),n.siteConfig.lang&&(s+=`
|
|
41
39
|
<script>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
document.documentElement.setAttribute('lang', locale)
|
|
45
|
-
})()
|
|
40
|
+
const locale = localStorage.getItem('valaxy-locale') || '${n.siteConfig.lang}'
|
|
41
|
+
document.documentElement.setAttribute('lang', locale)
|
|
46
42
|
<\/script>
|
|
47
43
|
`);for(let l of u){let c=Fs(l,"index.html");if(!Cr.default.existsSync(c))continue;let p=await Cr.default.readFile(c,"utf-8");s+=`
|
|
48
44
|
${(p.match(/<head>([\s\S]*?)<\/head>/im)?.[1]||"").trim()}`,a+=`
|
|
49
|
-
${(p.match(/<body>([\s\S]*?)<\/body>/im)?.[1]||"").trim()}`}return o=o.replace("__ENTRY__",te(Fs(e,"main.ts"))).replace("<!-- head -->",s).replace("<!-- body -->",a),o}var vb=["@vueuse/head","@vueuse/integrations/useFuse","body-scroll-lock","dayjs","katex","nprogress","unocss","vue","vue-router","fuse.js","medium-zoom"],Ad=["@vueuse/core","@vueuse/shared","@unocss/reset","unocss","vue","vue-demi","valaxy","/@valaxyjs/config","/@valaxyjs/context"];function kd(e){return{name:"valaxy:site",config(t){let r={root:e.clientRoot,publicDir:wd(e.userRoot,"public"),define:Ps(e),resolve:{alias:_b(e),dedupe:["vue"]},optimizeDeps:{entries:[xt(e.clientRoot,"main.ts")],include:[...vb.filter(n=>!Ad.includes(n))],exclude:Ad},server:{fs:{allow:yb([Os(e.clientRoot),Os(e.themeRoot),Os(e.userRoot),mb(Ge("katex/package.json",!0))])}}};return gb&&(r.cacheDir=wd(e.pkgRoot,"node_modules/.vite"),r.resolve.alias.vue=`${Ge("vue/dist/vue.esm-browser.js",!0)}`),hb(t,r)},configureServer(t){return()=>{t.middlewares.use(async(r,n,i)=>{if(r.url.endsWith(".html")){n.setHeader("Content-Type","text/html"),n.statusCode=200,n.end(await Ln(e));return}if(r.url==="/atom.xml"){n.setHeader("Content-Type","application/xml"),n.statusCode=200,n.end(await Rd.default.readFile(xt(e.userRoot,"dist/atom.xml"),"utf-8"));return}i()})}}}}function Ps(e){return{__DEV__:e.mode==="dev"?"true":"false"}}function _b(e){let t=[{find:"~/",replacement:`${te(e.userRoot)}/`},{find:"valaxy/client/",replacement:`${te(e.clientRoot)}/`},{find:"valaxy/package.json",replacement:te(xt(e.clientRoot,"../package.json"))},{find:"valaxy",replacement:te(xt(e.clientRoot,"index.ts"))},{find:"@valaxyjs/client/",replacement:`${te(e.clientRoot)}/`},{find:`valaxy-theme-${e.theme}/`,replacement:`${te(xt(e.themeRoot))}/`},{find:`valaxy-theme-${e.theme}`,replacement:`${te(xt(e.themeRoot))}/client/index.ts`}];return e.addons.forEach(r=>{t.push({find:r.name,replacement:`${te(xt(r.root))}/client/index.ts`})}),t}import{existsSync as Eb}from"fs";import{join as xb,resolve as bb}from"path";import{slash as Sb,uniq as Cb}from"@antfu/utils";function Fd({clientRoot:e,themeRoot:t,userRoot:r}){let n=Sb(bb(e,"setup"));return{name:"valaxy:setup",enforce:"pre",async transform(i,o){if(o.startsWith(n)){let s=o.slice(n.length+1).replace(/\?.*$/,""),a=[],u=[];return Cb([t,r]).map(c=>xb(c,"setup",s)).forEach((c,p)=>{if(!Eb(c))return;a.push(`import __n${p} from '${te(c)}'`);let f=`__n${p}`;/\binjection_return\b/g.test(i)&&(f=`injection_return = ${f}`),/\binjection_arg\b/g.test(i)?f+="(injection_arg)":f+="()",u.push(`// ${c}`,f)}),i=i.replace("/* __imports__ */",a.join(`
|
|
45
|
+
${(p.match(/<body>([\s\S]*?)<\/body>/im)?.[1]||"").trim()}`}return o=o.replace("__ENTRY__",te(Fs(e,"main.ts"))).replace("<!-- head -->",s).replace("<!-- body -->",a),o}var vb=["@vueuse/head","@vueuse/integrations/useFuse","body-scroll-lock","dayjs","katex","nprogress","unocss","vue","vue-router","vue-i18n","fuse.js","medium-zoom"],Ad=["@vueuse/core","@vueuse/shared","@unocss/reset","unocss","vue","vue-demi","valaxy","/@valaxyjs/config","/@valaxyjs/context","/@valaxyjs/addons","/@valaxyjs/locales","/@valaxyjs/styles"];function kd(e){return{name:"valaxy:site",config(t){let r={root:e.clientRoot,publicDir:wd(e.userRoot,"public"),define:Ps(e),resolve:{alias:_b(e),dedupe:["vue"]},optimizeDeps:{entries:[xt(e.clientRoot,"main.ts")],include:[...vb.filter(n=>!Ad.includes(n))],exclude:Ad},server:{fs:{allow:yb([Os(e.clientRoot),Os(e.themeRoot),Os(e.userRoot),mb(Ge("katex/package.json",!0))])}}};return gb&&(r.cacheDir=wd(e.pkgRoot,"node_modules/.vite"),r.resolve.alias.vue=`${Ge("vue/dist/vue.esm-browser.js",!0)}`),hb(t,r)},configureServer(t){return()=>{t.middlewares.use(async(r,n,i)=>{if(r.url.endsWith(".html")){n.setHeader("Content-Type","text/html"),n.statusCode=200,n.end(await Ln(e));return}if(r.url==="/atom.xml"){n.setHeader("Content-Type","application/xml"),n.statusCode=200,n.end(await Rd.default.readFile(xt(e.userRoot,"dist/atom.xml"),"utf-8"));return}i()})}}}}function Ps(e){return{__DEV__:e.mode==="dev"?"true":"false"}}function _b(e){let t=[{find:"~/",replacement:`${te(e.userRoot)}/`},{find:"valaxy/client/",replacement:`${te(e.clientRoot)}/`},{find:"valaxy/package.json",replacement:te(xt(e.clientRoot,"../package.json"))},{find:"valaxy",replacement:te(xt(e.clientRoot,"index.ts"))},{find:"@valaxyjs/client/",replacement:`${te(e.clientRoot)}/`},{find:`valaxy-theme-${e.theme}/`,replacement:`${te(xt(e.themeRoot))}/`},{find:`valaxy-theme-${e.theme}`,replacement:`${te(xt(e.themeRoot))}/client/index.ts`}];return e.addons.forEach(r=>{t.push({find:r.name,replacement:`${te(xt(r.root))}/client/index.ts`})}),t}import{existsSync as Eb}from"fs";import{join as xb,resolve as bb}from"path";import{slash as Sb,uniq as Cb}from"@antfu/utils";function Fd({clientRoot:e,themeRoot:t,userRoot:r}){let n=Sb(bb(e,"setup"));return{name:"valaxy:setup",enforce:"pre",async transform(i,o){if(o.startsWith(n)){let s=o.slice(n.length+1).replace(/\?.*$/,""),a=[],u=[];return Cb([t,r]).map(c=>xb(c,"setup",s)).forEach((c,p)=>{if(!Eb(c))return;a.push(`import __n${p} from '${te(c)}'`);let f=`__n${p}`;/\binjection_return\b/g.test(i)&&(f=`injection_return = ${f}`),/\binjection_arg\b/g.test(i)?f+="(injection_arg)":f+="()",u.push(`// ${c}`,f)}),i=i.replace("/* __imports__ */",a.join(`
|
|
50
46
|
`)),i=i.replace("/* __injections__ */",u.join(`
|
|
51
47
|
`)),i}return null}}}import{objectEntries as wb}from"@antfu/utils";function Od(e){let t=wb(Ps(e));return[{name:"valaxy:flags",enforce:"pre",transform(r,n){if(n.match(/\.vue($|\?)/)){let i=r;if(t.forEach(([o,s])=>{r=r.replace(new RegExp(o,"g"),s)}),i!==r)return r}}}]}var Yt=Q(Ae(),1);import{join as Wt,relative as Ub,resolve as Gb}from"path";import{pascalCase as Wb}from"pascal-case";var Gt=Q(Rs(),1),Md=Q(Ei(),1);import Pd from"fs";import ot from"path";import Ab from"lru-cache";var Rb="\u200B",kb="<wbr>",Td=(0,Md.default)("vitepress:md"),$d=new Ab({max:1024}),Fb=/<!--\s*@include:\s*(.*?)\s*-->/g;function Ob(e={},t){let r=["process.env"];return t&&r.push("import.meta",...Object.keys(e)),new RegExp(`\\b(${r.map(n=>n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|")})`,"g")}function Id(e,t,r){return e=e.replace(/<a (.*?)>(.*?)<\/a>/g,"<AppLink $1>$2</AppLink>"),e.replace(t,n=>`${n[0]}${r}${n.slice(1)}`)}var Pb=(e,t,r)=>{if(typeof t.title=="string"){let n=e.parseInline(t.title,{})[0];if(n)return Er(n,{shouldAllowHtml:!1,shouldEscapeText:!1})}return r},Tb=(e,t)=>{if(!e||!e.length)return;let r=e.find(([n,i={}])=>n==="meta"&&i.name===t&&i.content);return r&&r[1].content},$b=e=>{let{description:t,head:r}=e;return t!==void 0?t:r&&Tb(r,"description")||""};async function Ld(e,t={},r,n,i=!1,o=!1,s="with-subfolders"){let a=await Ed(t);r=r.map(l=>it(l.replace(/\.md$/,"")));let u=Ob(n,i);return async(l,c,p)=>{let f=it(ot.relative(e,c)),y=ot.dirname(c),h=$d.get(l);if(h)return Td(`[cache hit] ${f}`),h;let _=Date.now(),E=[];l=l.replace(Fb,(m,g)=>{try{let R=ot.join(y,g),k=Pd.readFileSync(R,"utf-8");return E.push(it(R)),k}catch{return m}});let b={path:c,relativePath:f,cleanUrls:s},D=a.render(l,b),{frontmatter:P={},headers:V=[],links:N=[],sfcBlocks:L,title:C=""}=b,S=[],x=m=>{console.warn(Gt.default.yellow(`
|
|
52
48
|
(!) Found dead link ${Gt.default.cyan(m)} in file ${Gt.default.white(Gt.default.dim(c))}
|
|
@@ -69,7 +65,7 @@ export const __pageData = JSON.parse(${JSON.stringify(Id(n,r,Rb))})`,o=e.findInd
|
|
|
69
65
|
${a}`)}<\/script>`)}else e.unshift(`<script ${s?'lang="ts"':""}>${i}
|
|
70
66
|
${a}<\/script>`);return e}import{cyan as Bb,red as jb,yellow as Hb}from"kolorist";import Vb from"consola";function Nd(e,t){e.includes("{%")&&e.includes("%}")&&Vb.error(`${`${t}
|
|
71
67
|
`} Please ${jb("remove")} ${Bb("{% %}")}, because it conflicts with ${Hb("markdown-it-attrs")}.`)}function Yb(e,t){let r=[];t.config.features?.katex&&(r.push(`import "${te(Ge("katex/dist/katex.min.css",!0))}"`),r.push(`import "${te(Wt(t.clientRoot,"styles/third/katex.scss"))}"`));for(let n of e){let i=[];["index","css-vars"].forEach(s=>{i.push(Wt(n,"styles",`${s}.css`)),i.push(Wt(n,"styles",`${s}.scss`))});for(let s of i)Yt.default.existsSync(s)&&r.push(`import "${te(s)}"`)}return r.join(`
|
|
72
|
-
`)}function Kb(e){let t=['const messages = { "zh-CN": {}, en: {} }'],r=["zh-CN","en"];return e.forEach((n,i)=>{r.forEach(o=>{let s=`${n}/locales/${o}.yml`;if(Yt.default.existsSync(s)&&Yt.default.readFileSync(s,"utf-8")){let a=o.replace("-","")+i;t.
|
|
68
|
+
`)}function Kb(e){let t=['const messages = { "zh-CN": {}, en: {} }'],r=["zh-CN","en"];return e.forEach((n,i)=>{r.forEach(o=>{let s=`${n}/locales/${o}.yml`;if(Yt.default.existsSync(s)&&Yt.default.readFileSync(s,"utf-8")){let a=o.replace("-","")+i;t.unshift(`import ${a} from "${te(s)}"`),t.push(`Object.assign(messages['${o}'], ${a})`)}})}),t.push("export default messages"),t.join(`
|
|
73
69
|
`)}function zb(e){let t=e.addons.filter(o=>o.global).filter(o=>Yt.default.existsSync(Wt(o.root,"./App.vue"))),r=o=>`Addon${Wb(o)}App`,n=t.map(o=>`import ${r(o.name)} from "${o.name}/App.vue"`).join(`
|
|
74
70
|
`),i=t.map(o=>`{ component: ${r(o.name)}, props: ${JSON.stringify(o.props)} }`).join(",");return`${n}
|
|
75
71
|
export default [${i}]`}var Jb='import { defineComponent } from "vue"; export default defineComponent({ render: () => null });';function qd(e){let t=Wt(e,"App.vue");return Yt.default.existsSync(t)?[`import AppVue from "${te(t)}"`,"export default AppVue"].join(`
|
package/dist/node/cli.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkREL3TF3Ecjs = require('../chunk-REL3TF3E.cjs');exports.cli = _chunkREL3TF3Ecjs.F; exports.run = _chunkREL3TF3Ecjs.G;
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as a,G as b}from"../chunk-
|
|
1
|
+
import{F as a,G as b}from"../chunk-ZLMYD4KI.mjs";export{a as cli,b as run};
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkREL3TF3Ecjs = require('../chunk-REL3TF3E.cjs');exports.build = _chunkREL3TF3Ecjs.C; exports.cli = _chunkREL3TF3Ecjs.F; exports.createServer = _chunkREL3TF3Ecjs.B; exports.defaultSiteConfig = _chunkREL3TF3Ecjs.t; exports.defaultValaxyConfig = _chunkREL3TF3Ecjs.u; exports.defineAddon = _chunkREL3TF3Ecjs.n; exports.defineConfig = _chunkREL3TF3Ecjs.s; exports.defineSiteConfig = _chunkREL3TF3Ecjs.q; exports.defineTheme = _chunkREL3TF3Ecjs.p; exports.defineUnoSetup = _chunkREL3TF3Ecjs.v; exports.defineValaxyAddon = _chunkREL3TF3Ecjs.m; exports.defineValaxyConfig = _chunkREL3TF3Ecjs.r; exports.defineValaxyTheme = _chunkREL3TF3Ecjs.o; exports.ensurePrefix = _chunkREL3TF3Ecjs.d; exports.getGitTimestamp = _chunkREL3TF3Ecjs.a; exports.getIndexHtml = _chunkREL3TF3Ecjs.A; exports.isExternal = _chunkREL3TF3Ecjs.b; exports.isPath = _chunkREL3TF3Ecjs.f; exports.mergeValaxyConfig = _chunkREL3TF3Ecjs.g; exports.mergeViteConfigs = _chunkREL3TF3Ecjs.z; exports.postProcessForSSG = _chunkREL3TF3Ecjs.E; exports.processValaxyOptions = _chunkREL3TF3Ecjs.w; exports.resolveAddonConfig = _chunkREL3TF3Ecjs.j; exports.resolveImportPath = _chunkREL3TF3Ecjs.l; exports.resolveOptions = _chunkREL3TF3Ecjs.x; exports.resolveThemeValaxyConfig = _chunkREL3TF3Ecjs.y; exports.resolveValaxyConfig = _chunkREL3TF3Ecjs.i; exports.resolveValaxyConfigFromRoot = _chunkREL3TF3Ecjs.h; exports.run = _chunkREL3TF3Ecjs.G; exports.slash = _chunkREL3TF3Ecjs.c; exports.ssgBuild = _chunkREL3TF3Ecjs.D; exports.toAtFS = _chunkREL3TF3Ecjs.e; exports.transformObject = _chunkREL3TF3Ecjs.k;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,a as o,b as r,c as m,d as p,e as t,f as e,g as f,h as x,i,j as a,k as b,l as c,m as d,n as g,o as h,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,a as o,b as r,c as m,d as p,e as t,f as e,g as f,h as x,i,j as a,k as b,l as c,m as d,n as g,o as h,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../chunk-ZLMYD4KI.mjs";export{C as build,F as cli,B as createServer,q as defaultSiteConfig,s as defaultValaxyConfig,g as defineAddon,n as defineConfig,k as defineSiteConfig,j as defineTheme,u as defineUnoSetup,d as defineValaxyAddon,l as defineValaxyConfig,h as defineValaxyTheme,p as ensurePrefix,o as getGitTimestamp,A as getIndexHtml,r as isExternal,e as isPath,f as mergeValaxyConfig,z as mergeViteConfigs,E as postProcessForSSG,v as processValaxyOptions,a as resolveAddonConfig,c as resolveImportPath,w as resolveOptions,y as resolveThemeValaxyConfig,i as resolveValaxyConfig,x as resolveValaxyConfigFromRoot,G as run,m as slash,D as ssgBuild,t as toAtFS,b as transformObject};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.4",
|
|
5
5
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "me@yunyoujun.cn",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/body-scroll-lock": "^3.1.0",
|
|
60
60
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
61
61
|
"@vueuse/core": "^9.12.0",
|
|
62
|
-
"@vueuse/head": "^1.0.
|
|
62
|
+
"@vueuse/head": "^1.0.24",
|
|
63
63
|
"@vueuse/integrations": "^9.12.0",
|
|
64
64
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
65
65
|
"consola": "^2.15.3",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"nprogress": "^0.2.0",
|
|
90
90
|
"open": "^8.4.0",
|
|
91
91
|
"pascal-case": "^3.1.2",
|
|
92
|
-
"pinia": "^2.0.
|
|
93
|
-
"sass": "^1.
|
|
94
|
-
"shiki": "^0.
|
|
92
|
+
"pinia": "^2.0.30",
|
|
93
|
+
"sass": "^1.58.0",
|
|
94
|
+
"shiki": "^0.14.0",
|
|
95
95
|
"star-markdown-css": "^0.4.1",
|
|
96
96
|
"unconfig": "^0.3.7",
|
|
97
|
-
"unocss": "^0.49.
|
|
97
|
+
"unocss": "^0.49.2",
|
|
98
98
|
"unplugin-vue-components": "^0.23.0",
|
|
99
99
|
"vite": "^4.0.4",
|
|
100
100
|
"vite-plugin-pages": "^0.28.0",
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"@types/katex": "^0.16.0",
|
|
121
121
|
"@types/markdown-it": "^12.2.3",
|
|
122
122
|
"@types/nprogress": "^0.2.0",
|
|
123
|
-
"@types/yargs": "^17.0.
|
|
123
|
+
"@types/yargs": "^17.0.22",
|
|
124
124
|
"debug": "^4.3.4",
|
|
125
125
|
"diacritics": "^1.3.0",
|
|
126
126
|
"https-localhost": "^4.7.1",
|
|
127
|
-
"shiki-processor": "^0.1.
|
|
127
|
+
"shiki-processor": "^0.1.3"
|
|
128
128
|
},
|
|
129
129
|
"scripts": {
|
|
130
130
|
"build": "rimraf dist && tsup --splitting",
|