valaxy 0.10.2 → 0.10.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/composables/comments/index.ts +0 -2
- package/client/composables/layout.ts +5 -2
- package/client/composables/sidebar.ts +4 -2
- package/client/index.html +16 -0
- package/client/utils/cdn.ts +1 -1
- package/dist/chunk-4DDESE24.mjs +100 -0
- package/dist/chunk-LLT2PKQ2.js +100 -0
- package/dist/{config-1d500fb4.d.ts → config-a8e39079.d.ts} +1 -1
- package/dist/node/cli.js +7 -7
- package/dist/node/cli.mjs +3 -3
- package/dist/node/index.d.ts +3 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +26 -26
- package/types/config.ts +1 -1
- package/client/composables/comments/waline.ts +0 -82
- package/dist/chunk-6PDG5NQV.mjs +0 -102
- package/dist/chunk-S7EBKLNL.js +0 -102
package/dist/node/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkS7EBKLNLjs = require('../chunk-S7EBKLNL.js');var Le=_chunkS7EBKLNLjs.b.call(void 0, (zn,_e)=>{"use strict";_e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ne=_chunkS7EBKLNLjs.b.call(void 0, (Un,Ne)=>{var E=Le(),qe={};for(let e of Object.keys(E))qe[E[e]]=e;var l={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ne.exports=l;for(let e of Object.keys(l)){if(!("channels"in l[e]))throw new Error("missing channels property: "+e);if(!("labels"in l[e]))throw new Error("missing channel labels property: "+e);if(l[e].labels.length!==l[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=l[e];delete l[e].channels,delete l[e].labels,Object.defineProperty(l[e],"channels",{value:t}),Object.defineProperty(l[e],"labels",{value:r})}l.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),i=s-o,a,c;s===o?a=0:t===s?a=(r-n)/i:r===s?a=2+(n-t)/i:n===s&&(a=4+(t-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let u=(o+s)/2;return s===o?c=0:u<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,u*100]};l.rgb.hsv=function(e){let t,r,n,o,s,i=e[0]/255,a=e[1]/255,c=e[2]/255,u=Math.max(i,a,c),p=u-Math.min(i,a,c),m=function(B){return(u-B)/6/p+1/2};return p===0?(o=0,s=0):(s=p/u,t=m(i),r=m(a),n=m(c),i===u?o=n-r:a===u?o=1/3+t-n:c===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]};l.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],o=l.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]};l.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,i=(1-r-o)/(1-o)||0,a=(1-n-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function Lt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}l.rgb.keyword=function(e){let t=qe[e];if(t)return t;let r=1/0,n;for(let o of Object.keys(E)){let s=E[o],i=Lt(e,s);i<r&&(r=i,n=o)}return n};l.keyword.rgb=function(e){return E[e]};l.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,i=t*.0193+r*.1192+n*.9505;return[o*100,s*100,i*100]};l.rgb.lab=function(e){let t=l.rgb.xyz(e),r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*n-16,i=500*(r-n),a=200*(n-o);return[s,i,a]};l.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o,s,i;if(r===0)return i=n*255,[i,i,i];n<.5?o=n*(1+r):o=n+r-n*r;let a=2*n-o,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[u]=i*255;return c};l.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;let i=(n+r)/2,a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};l.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,s=t-Math.floor(t),i=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,c,i];case 1:return[a,n,i];case 2:return[i,n,c];case 3:return[i,a,n];case 4:return[c,i,n];case 5:return[n,i,a]}};l.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01),s,i;i=(2-r)*n;let a=(2-r)*o;return s=r*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]};l.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o=r+n,s;o>1&&(r/=o,n/=o);let i=Math.floor(6*t),a=1-n;s=6*t-i,(i&1)!==0&&(s=1-s);let c=r+s*(a-r),u,p,m;switch(i){default:case 6:case 0:u=a,p=c,m=r;break;case 1:u=c,p=a,m=r;break;case 2:u=r,p=a,m=c;break;case 3:u=r,p=c,m=a;break;case 4:u=c,p=r,m=a;break;case 5:u=a,p=r,m=c;break}return[u*255,p*255,m*255]};l.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,r*(1-o)+o),a=1-Math.min(1,n*(1-o)+o);return[s*255,i*255,a*255]};l.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o,s,i;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,i=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]};l.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,s=500*(t-r),i=200*(r-n);return[o,s,i]};l.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],o,s,i;s=(t+16)/116,o=r/500+s,i=s-n/200;let a=s**3,c=o**3,u=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]};l.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);let i=Math.sqrt(r*r+n*n);return[t,i,o]};l.lch.lab=function(e){let t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),i=r*Math.sin(o);return[t,s,i]};l.rgb.ansi16=function(e,t=null){let[r,n,o]=e,s=t===null?l.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(i+=60),i};l.hsv.ansi16=function(e){return l.rgb.ansi16(l.hsv.rgb(e),e[2])};l.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};l.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]};l.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]};l.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};l.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),o=n>>16&255,s=n>>8&255,i=n&255;return[o,s,i]};l.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),i=o-s,a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(r-n)/i%6:o===r?c=2+(n-t)/i:c=4+(t-r)/i,c/=6,c%=1,[c*360,i*100,a*100]};l.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]};l.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]};l.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let o=[0,0,0],s=t%1*6,i=s%1,a=1-i,c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-r)*n,[(r*o[0]+c)*255,(r*o[1]+c)*255,(r*o[2]+c)*255]};l.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]};l.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]};l.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};l.hwb.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=1-r,o=n-t,s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]};l.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};l.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};l.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};l.gray.hsl=function(e){return[0,0,e[0]]};l.gray.hsv=l.gray.hsl;l.gray.hwb=function(e){return[0,100,e[0]]};l.gray.cmyk=function(e){return[0,0,0,e[0]]};l.gray.lab=function(e){return[e[0],0,0]};l.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};l.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var Ve=_chunkS7EBKLNLjs.b.call(void 0, (Hn,De)=>{var N=ne();function qt(){let e={},t=Object.keys(N);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Nt(e){let t=qt(),r=[e];for(t[e].distance=0;r.length;){let n=r.pop(),o=Object.keys(N[n]);for(let s=o.length,i=0;i<s;i++){let a=o[i],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function Dt(e,t){return function(r){return t(e(r))}}function Vt(e,t){let r=[t[e].parent,e],n=N[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Dt(N[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}De.exports=function(e){let t=Nt(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){let i=n[s];t[i].parent!==null&&(r[i]=Vt(i,t))}return r}});var Ge=_chunkS7EBKLNLjs.b.call(void 0, (Wn,Ye)=>{var re=ne(),Yt=Ve(),k={},Gt=Object.keys(re);function zt(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ut(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let o=e(r);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}Gt.forEach(e=>{k[e]={},Object.defineProperty(k[e],"channels",{value:re[e].channels}),Object.defineProperty(k[e],"labels",{value:re[e].labels});let t=Yt(e);Object.keys(t).forEach(n=>{let o=t[n];k[e][n]=Ut(o),k[e][n].raw=zt(o)})});Ye.exports=k});var Xe=_chunkS7EBKLNLjs.b.call(void 0, (Kn,Ke)=>{"use strict";var ze=(e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,Ue=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},He=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},D=e=>e,We=(e,t,r)=>[e,t,r],O=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},oe,C=(e,t,r,n)=>{oe===void 0&&(oe=Ge());let o=n?10:0,s={};for(let[i,a]of Object.entries(oe)){let c=i==="ansi16"?"ansi":i;i===t?s[c]=e(r,o):typeof a=="object"&&(s[c]=e(a[t],o))}return s};function Ht(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,s]of Object.entries(n))t[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[o]=t[o],e.set(s[0],s[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",O(t.color,"ansi",()=>C(ze,"ansi16",D,!1)),O(t.color,"ansi256",()=>C(Ue,"ansi256",D,!1)),O(t.color,"ansi16m",()=>C(He,"rgb",We,!1)),O(t.bgColor,"ansi",()=>C(ze,"ansi16",D,!0)),O(t.bgColor,"ansi256",()=>C(Ue,"ansi256",D,!0)),O(t.bgColor,"ansi16m",()=>C(He,"rgb",We,!0)),t}Object.defineProperty(Ke,"exports",{enumerable:!0,get:Ht})});var Qe=_chunkS7EBKLNLjs.b.call(void 0, (Xn,Je)=>{"use strict";Je.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var tt=_chunkS7EBKLNLjs.b.call(void 0, (Jn,et)=>{"use strict";var Wt=_chunkS7EBKLNLjs.a.call(void 0, "os"),Ze=_chunkS7EBKLNLjs.a.call(void 0, "tty"),g=Qe(),{env:f}=process,w;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?w=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(w=1);"FORCE_COLOR"in f&&(f.FORCE_COLOR==="true"?w=1:f.FORCE_COLOR==="false"?w=0:w=f.FORCE_COLOR.length===0?1:Math.min(parseInt(f.FORCE_COLOR,10),3));function se(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ie(e,t){if(w===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!t&&w===void 0)return 0;let r=w||0;if(f.TERM==="dumb")return r;if(process.platform==="win32"){let n=Wt.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in f)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in f)||f.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in f){let n=parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:r}function Kt(e){let t=ie(e,e&&e.isTTY);return se(t)}et.exports={supportsColor:Kt,stdout:se(ie(!0,Ze.isatty(1))),stderr:se(ie(!0,Ze.isatty(2)))}});var rt=_chunkS7EBKLNLjs.b.call(void 0, (Qn,nt)=>{"use strict";var Xt=(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let o=t.length,s=0,i="";do i+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return i+=e.substr(s),i},Jt=(e,t,r,n)=>{let o=0,s="";do{let i=e[n-1]==="\r";s+=e.substr(o,(i?n-1:n)-o)+t+(i?`\r
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkLLT2PKQ2js = require('../chunk-LLT2PKQ2.js');var Le=_chunkLLT2PKQ2js.b.call(void 0, (zn,_e)=>{"use strict";_e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ne=_chunkLLT2PKQ2js.b.call(void 0, (Un,Ne)=>{var E=Le(),qe={};for(let e of Object.keys(E))qe[E[e]]=e;var l={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ne.exports=l;for(let e of Object.keys(l)){if(!("channels"in l[e]))throw new Error("missing channels property: "+e);if(!("labels"in l[e]))throw new Error("missing channel labels property: "+e);if(l[e].labels.length!==l[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=l[e];delete l[e].channels,delete l[e].labels,Object.defineProperty(l[e],"channels",{value:t}),Object.defineProperty(l[e],"labels",{value:r})}l.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),i=s-o,a,c;s===o?a=0:t===s?a=(r-n)/i:r===s?a=2+(n-t)/i:n===s&&(a=4+(t-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let u=(o+s)/2;return s===o?c=0:u<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,u*100]};l.rgb.hsv=function(e){let t,r,n,o,s,i=e[0]/255,a=e[1]/255,c=e[2]/255,u=Math.max(i,a,c),p=u-Math.min(i,a,c),m=function(B){return(u-B)/6/p+1/2};return p===0?(o=0,s=0):(s=p/u,t=m(i),r=m(a),n=m(c),i===u?o=n-r:a===u?o=1/3+t-n:c===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]};l.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],o=l.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]};l.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,i=(1-r-o)/(1-o)||0,a=(1-n-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function Lt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}l.rgb.keyword=function(e){let t=qe[e];if(t)return t;let r=1/0,n;for(let o of Object.keys(E)){let s=E[o],i=Lt(e,s);i<r&&(r=i,n=o)}return n};l.keyword.rgb=function(e){return E[e]};l.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,i=t*.0193+r*.1192+n*.9505;return[o*100,s*100,i*100]};l.rgb.lab=function(e){let t=l.rgb.xyz(e),r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*n-16,i=500*(r-n),a=200*(n-o);return[s,i,a]};l.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o,s,i;if(r===0)return i=n*255,[i,i,i];n<.5?o=n*(1+r):o=n+r-n*r;let a=2*n-o,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[u]=i*255;return c};l.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;let i=(n+r)/2,a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};l.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,s=t-Math.floor(t),i=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,c,i];case 1:return[a,n,i];case 2:return[i,n,c];case 3:return[i,a,n];case 4:return[c,i,n];case 5:return[n,i,a]}};l.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01),s,i;i=(2-r)*n;let a=(2-r)*o;return s=r*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]};l.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o=r+n,s;o>1&&(r/=o,n/=o);let i=Math.floor(6*t),a=1-n;s=6*t-i,(i&1)!==0&&(s=1-s);let c=r+s*(a-r),u,p,m;switch(i){default:case 6:case 0:u=a,p=c,m=r;break;case 1:u=c,p=a,m=r;break;case 2:u=r,p=a,m=c;break;case 3:u=r,p=c,m=a;break;case 4:u=c,p=r,m=a;break;case 5:u=a,p=r,m=c;break}return[u*255,p*255,m*255]};l.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,r*(1-o)+o),a=1-Math.min(1,n*(1-o)+o);return[s*255,i*255,a*255]};l.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o,s,i;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,i=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]};l.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,s=500*(t-r),i=200*(r-n);return[o,s,i]};l.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],o,s,i;s=(t+16)/116,o=r/500+s,i=s-n/200;let a=s**3,c=o**3,u=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]};l.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);let i=Math.sqrt(r*r+n*n);return[t,i,o]};l.lch.lab=function(e){let t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),i=r*Math.sin(o);return[t,s,i]};l.rgb.ansi16=function(e,t=null){let[r,n,o]=e,s=t===null?l.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(i+=60),i};l.hsv.ansi16=function(e){return l.rgb.ansi16(l.hsv.rgb(e),e[2])};l.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};l.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]};l.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]};l.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};l.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),o=n>>16&255,s=n>>8&255,i=n&255;return[o,s,i]};l.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),i=o-s,a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(r-n)/i%6:o===r?c=2+(n-t)/i:c=4+(t-r)/i,c/=6,c%=1,[c*360,i*100,a*100]};l.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]};l.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]};l.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let o=[0,0,0],s=t%1*6,i=s%1,a=1-i,c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-r)*n,[(r*o[0]+c)*255,(r*o[1]+c)*255,(r*o[2]+c)*255]};l.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]};l.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]};l.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};l.hwb.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=1-r,o=n-t,s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]};l.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};l.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};l.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};l.gray.hsl=function(e){return[0,0,e[0]]};l.gray.hsv=l.gray.hsl;l.gray.hwb=function(e){return[0,100,e[0]]};l.gray.cmyk=function(e){return[0,0,0,e[0]]};l.gray.lab=function(e){return[e[0],0,0]};l.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};l.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var Ve=_chunkLLT2PKQ2js.b.call(void 0, (Hn,De)=>{var N=ne();function qt(){let e={},t=Object.keys(N);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Nt(e){let t=qt(),r=[e];for(t[e].distance=0;r.length;){let n=r.pop(),o=Object.keys(N[n]);for(let s=o.length,i=0;i<s;i++){let a=o[i],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function Dt(e,t){return function(r){return t(e(r))}}function Vt(e,t){let r=[t[e].parent,e],n=N[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Dt(N[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}De.exports=function(e){let t=Nt(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){let i=n[s];t[i].parent!==null&&(r[i]=Vt(i,t))}return r}});var Ge=_chunkLLT2PKQ2js.b.call(void 0, (Wn,Ye)=>{var re=ne(),Yt=Ve(),k={},Gt=Object.keys(re);function zt(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ut(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let o=e(r);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}Gt.forEach(e=>{k[e]={},Object.defineProperty(k[e],"channels",{value:re[e].channels}),Object.defineProperty(k[e],"labels",{value:re[e].labels});let t=Yt(e);Object.keys(t).forEach(n=>{let o=t[n];k[e][n]=Ut(o),k[e][n].raw=zt(o)})});Ye.exports=k});var Xe=_chunkLLT2PKQ2js.b.call(void 0, (Kn,Ke)=>{"use strict";var ze=(e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,Ue=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},He=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},D=e=>e,We=(e,t,r)=>[e,t,r],O=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},oe,C=(e,t,r,n)=>{oe===void 0&&(oe=Ge());let o=n?10:0,s={};for(let[i,a]of Object.entries(oe)){let c=i==="ansi16"?"ansi":i;i===t?s[c]=e(r,o):typeof a=="object"&&(s[c]=e(a[t],o))}return s};function Ht(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,s]of Object.entries(n))t[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[o]=t[o],e.set(s[0],s[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",O(t.color,"ansi",()=>C(ze,"ansi16",D,!1)),O(t.color,"ansi256",()=>C(Ue,"ansi256",D,!1)),O(t.color,"ansi16m",()=>C(He,"rgb",We,!1)),O(t.bgColor,"ansi",()=>C(ze,"ansi16",D,!0)),O(t.bgColor,"ansi256",()=>C(Ue,"ansi256",D,!0)),O(t.bgColor,"ansi16m",()=>C(He,"rgb",We,!0)),t}Object.defineProperty(Ke,"exports",{enumerable:!0,get:Ht})});var Qe=_chunkLLT2PKQ2js.b.call(void 0, (Xn,Je)=>{"use strict";Je.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var tt=_chunkLLT2PKQ2js.b.call(void 0, (Jn,et)=>{"use strict";var Wt=_chunkLLT2PKQ2js.a.call(void 0, "os"),Ze=_chunkLLT2PKQ2js.a.call(void 0, "tty"),g=Qe(),{env:f}=process,w;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?w=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(w=1);"FORCE_COLOR"in f&&(f.FORCE_COLOR==="true"?w=1:f.FORCE_COLOR==="false"?w=0:w=f.FORCE_COLOR.length===0?1:Math.min(parseInt(f.FORCE_COLOR,10),3));function se(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ie(e,t){if(w===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!t&&w===void 0)return 0;let r=w||0;if(f.TERM==="dumb")return r;if(process.platform==="win32"){let n=Wt.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in f)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in f)||f.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in f){let n=parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:r}function Kt(e){let t=ie(e,e&&e.isTTY);return se(t)}et.exports={supportsColor:Kt,stdout:se(ie(!0,Ze.isatty(1))),stderr:se(ie(!0,Ze.isatty(2)))}});var rt=_chunkLLT2PKQ2js.b.call(void 0, (Qn,nt)=>{"use strict";var Xt=(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let o=t.length,s=0,i="";do i+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return i+=e.substr(s),i},Jt=(e,t,r,n)=>{let o=0,s="";do{let i=e[n-1]==="\r";s+=e.substr(o,(i?n-1:n)-o)+t+(i?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+r,o=n+1,n=e.indexOf(`
|
|
4
|
-
`,o)}while(n!==-1);return s+=e.substr(o),s};nt.exports={stringReplaceAll:Xt,stringEncaseCRLFWithFirstIndex:Jt}});var lt=
|
|
5
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function it(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)):tn.get(e)||e}function nn(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let s of n){let i=Number(s);if(!Number.isNaN(i))r.push(i);else if(o=s.match(Zt))r.push(o[2].replace(en,(a,c,u)=>c?it(c):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return r}function rn(e){ot.lastIndex=0;let t=[],r;for(;(r=ot.exec(e))!==null;){let n=r[1];if(r[2]){let o=nn(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function st(e,t){let r={};for(let o of t)for(let s of o.styles)r[s[0]]=o.inverse?null:s.slice(1);let n=e;for(let[o,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=s.length>0?n[o](...s):n[o]}return n}at.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(Qt,(s,i,a,c,u,p)=>{if(i)o.push(it(i));else if(c){let m=o.join("");o=[],n.push(r.length===0?m:st(e,r)(m)),r.push({inverse:a,styles:rn(c)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(st(e,r)(o.join(""))),o=[],r.pop()}else o.push(p)}),n.push(o.join("")),r.length>0){let s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var ht=
|
|
6
|
-
`);return s!==-1&&(t=sn(t,o,n,s)),n+t+o},ae,mt=(e,...t)=>{let[r]=t;if(!V(r)||!V(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return ae===void 0&&(ae=lt()),ae(e,o.join(""))};Object.defineProperties(Y.prototype,R);var z=Y();z.supportsColor=le;z.stderr=Y({level:ce?ce.level:0});z.stderr.supportsColor=ce;dt.exports=z});var M=
|
|
7
|
-
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var _readline = require('readline'); var Te = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var q;function te(e,t,r){console.log(),console.log(` ${_kolorist.bold.call(void 0, "\u{1F30C} Valaxy")} ${_kolorist.blue.call(void 0, `v${L}`)}`),console.log(),console.log(`${_kolorist.dim.call(void 0, " \u{1FA90} theme ")} > ${e.theme?_kolorist.green.call(void 0, e.theme):_kolorist.gray.call(void 0, "none")}`),console.log(` ${_kolorist.dim.call(void 0, "\u{1F4C1}")} ${_kolorist.dim.call(void 0, _path2.default.resolve(e.userRoot))}`),t&&(console.log(),console.log(`${_kolorist.dim.call(void 0, " Preview ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, t)}/`)}`),r&&Object.values(_os2.default.networkInterfaces()).forEach(n=>(n||[]).filter(o=>o.family==="IPv4"&&!o.address.includes("127.0.0.1")).forEach(({address:o})=>{console.log(`${_kolorist.dim.call(void 0, " Network ")} > ${_kolorist.blue.call(void 0, `http://${o}:${_kolorist.bold.call(void 0, t)}/`)}`)})),console.log(),console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`)),console.log()}async function P(e,t){q&&await q.close();let r=_vite.mergeConfig.call(void 0, await
|
|
8
|
-
`),console.error(n),process.exit(1)}}function Ae(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),Te.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(t,r)=>{if(r.ctrl&&r.name==="c")process.exit();else{let[n]=e.filter(o=>o.name===t);if(n)try{n.action()}catch(o){console.error(`Failed to execute shortcut ${n.fullName}`,o)}}})}var wt=
|
|
4
|
+
`,o)}while(n!==-1);return s+=e.substr(o),s};nt.exports={stringReplaceAll:Xt,stringEncaseCRLFWithFirstIndex:Jt}});var lt=_chunkLLT2PKQ2js.b.call(void 0, (Zn,at)=>{"use strict";var Qt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ot=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Zt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,en=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,tn=new Map([["n",`
|
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function it(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)):tn.get(e)||e}function nn(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let s of n){let i=Number(s);if(!Number.isNaN(i))r.push(i);else if(o=s.match(Zt))r.push(o[2].replace(en,(a,c,u)=>c?it(c):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return r}function rn(e){ot.lastIndex=0;let t=[],r;for(;(r=ot.exec(e))!==null;){let n=r[1];if(r[2]){let o=nn(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function st(e,t){let r={};for(let o of t)for(let s of o.styles)r[s[0]]=o.inverse?null:s.slice(1);let n=e;for(let[o,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=s.length>0?n[o](...s):n[o]}return n}at.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(Qt,(s,i,a,c,u,p)=>{if(i)o.push(it(i));else if(c){let m=o.join("");o=[],n.push(r.length===0?m:st(e,r)(m)),r.push({inverse:a,styles:rn(c)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(st(e,r)(o.join(""))),o=[],r.pop()}else o.push(p)}),n.push(o.join("")),r.length>0){let s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var ht=_chunkLLT2PKQ2js.b.call(void 0, (er,dt)=>{"use strict";var I=Xe(),{stdout:le,stderr:ce}=tt(),{stringReplaceAll:on,stringEncaseCRLFWithFirstIndex:sn}=rt(),{isArray:V}=Array,ut=["ansi","ansi","ansi256","ansi16m"],R=Object.create(null),an=(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=le?le.level:0;e.level=t.level===void 0?r:t.level},ue=class{constructor(t){return ft(t)}},ft=e=>{let t={};return an(t,e),t.template=(...r)=>mt(t.template,...r),Object.setPrototypeOf(t,Y.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=ue,t.template};function Y(e){return ft(e)}for(let[e,t]of Object.entries(I))R[e]={get(){let r=G(this,fe(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};R.visible={get(){let e=G(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var pt=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of pt)R[e]={get(){let{level:t}=this;return function(...r){let n=fe(I.color[ut[t]][e](...r),I.color.close,this._styler);return G(this,n,this._isEmpty)}}};for(let e of pt){let t="bg"+e[0].toUpperCase()+e.slice(1);R[t]={get(){let{level:r}=this;return function(...n){let o=fe(I.bgColor[ut[r]][e](...n),I.bgColor.close,this._styler);return G(this,o,this._isEmpty)}}}}var ln=Object.defineProperties(()=>{},{...R,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),fe=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},G=(e,t,r)=>{let n=(...o)=>V(o[0])&&V(o[0].raw)?ct(n,mt(n,...o)):ct(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,ln),n._generator=e,n._styler=t,n._isEmpty=r,n},ct=(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:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=on(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
|
|
6
|
+
`);return s!==-1&&(t=sn(t,o,n,s)),n+t+o},ae,mt=(e,...t)=>{let[r]=t;if(!V(r)||!V(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return ae===void 0&&(ae=lt()),ae(e,o.join(""))};Object.defineProperties(Y.prototype,R);var z=Y();z.supportsColor=le;z.stderr=Y({level:ce?ce.level:0});z.stderr.supportsColor=ce;dt.exports=z});var M=_chunkLLT2PKQ2js.c.call(void 0, _chunkLLT2PKQ2js.g.call(void 0, ));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 _open = require('open'); var _open2 = _interopRequireDefault(_open);var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var _kolorist = require('kolorist');var L="0.10.4";var _net = require('net'); var _net2 = _interopRequireDefault(_net);async function Q(e){return await Et(e)?e:await Q(e+1)}function Et(e){return new Promise(t=>{let r=_net2.default.createServer(n=>{n.write(`Echo server\r
|
|
7
|
+
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var _readline = require('readline'); var Te = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var q;function te(e,t,r){console.log(),console.log(` ${_kolorist.bold.call(void 0, "\u{1F30C} Valaxy")} ${_kolorist.blue.call(void 0, `v${L}`)}`),console.log(),console.log(`${_kolorist.dim.call(void 0, " \u{1FA90} theme ")} > ${e.theme?_kolorist.green.call(void 0, e.theme):_kolorist.gray.call(void 0, "none")}`),console.log(` ${_kolorist.dim.call(void 0, "\u{1F4C1}")} ${_kolorist.dim.call(void 0, _path2.default.resolve(e.userRoot))}`),t&&(console.log(),console.log(`${_kolorist.dim.call(void 0, " Preview ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, t)}/`)}`),r&&Object.values(_os2.default.networkInterfaces()).forEach(n=>(n||[]).filter(o=>o.family==="IPv4"&&!o.address.includes("127.0.0.1")).forEach(({address:o})=>{console.log(`${_kolorist.dim.call(void 0, " Network ")} > ${_kolorist.blue.call(void 0, `http://${o}:${_kolorist.bold.call(void 0, t)}/`)}`)})),console.log(),console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`)),console.log()}async function P(e,t){q&&await q.close();let r=_vite.mergeConfig.call(void 0, await _chunkLLT2PKQ2js.e.call(void 0, e,"serve"),t);try{q=await _chunkLLT2PKQ2js.s.call(void 0, e,r,{async onConfigReload(n,o,s=!1){s&&(_consola2.default.info("[valaxy]",`${_kolorist.yellow.call(void 0, "force")} reload the server`),P(e,t));let i=!1;n.theme!==o.theme&&(i=!0),i&&P(e,t)}}),await q.listen()}catch(n){_consola2.default.error(`failed to start server. error:
|
|
8
|
+
`),console.error(n),process.exit(1)}}function Ae(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),Te.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(t,r)=>{if(r.ctrl&&r.name==="c")process.exit();else{let[n]=e.filter(o=>o.name===t);if(n)try{n.action()}catch(o){console.error(`Failed to execute shortcut ${n.fullName}`,o)}}})}var wt=_chunkLLT2PKQ2js.c.call(void 0, ht());var _promises = require('fs/promises');var _ejs = require('ejs');var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);var _utils = require('@antfu/utils');async function U(e){try{return await _promises.access.call(void 0, e),!0}catch (e2){return!1}}var S=process.cwd(),gt=`---
|
|
9
9
|
layout: <%=layout%>
|
|
10
10
|
title: <%=title%>
|
|
11
11
|
date: <%=date%>
|
|
12
12
|
---
|
|
13
|
-
`;var bt=async e=>{let{clientRoot:t,themeRoot:r}=await
|
|
13
|
+
`;var bt=async e=>{let{clientRoot:t,themeRoot:r}=await _chunkLLT2PKQ2js.p.call(void 0, {userRoot:S}),n=[S,r,t];for(let o of n){let s=_path2.default.resolve(o,"scaffolds",`${e}.md`);if(await U(s))return _promises.readFile.call(void 0, s,"utf-8")}return!1};var bn=_path.resolve.call(void 0, S,"pages"),vt=async e=>{let{path:t,title:r}=e,n=t||_path.join.call(void 0, "posts",r),o=0;for(;;){let s=_path.join.call(void 0, bn,n);if(o&&(s=`${s}-${o}`),s=_utils.ensureSuffix.call(void 0, ".md",s),!await U(s)){let i=await yn(e);return _promises.writeFile.call(void 0, s,i,"utf-8"),s}o++}};async function yn({date:e,title:t,layout:r="post"}){let n=await bt(r);return n||(n=gt),_ejs.render.call(void 0, n,{title:t,layout:r,date:e?_dayjs2.default.call(void 0, ).format("YYYY-MM-DD hh:mm:ss"):""})}var xt=e=>{e.command("new <title>","Draft a new post",t=>{t.usage("$0 <title> -p [path] -l [layout]").positional("title",{describe:"The title of the new post",required:!0}).option("path",{alias:"p",type:"string",describe:"the path to generate new post. Customize the path of post to generate"}).option("layout",{alias:"l",type:"string",default:"post"}).option("date",{alias:"d",type:"boolean",describe:"Generate post with the current date"}).strict().help()},async({title:t,path:r,date:n,layout:o})=>{let s=await vt({title:t,date:n,layout:o,path:r});_consola2.default.success(`[valaxy new]: successfully generated file ${(0,wt.magenta)(s)}}`)})};var Ct=_chunkLLT2PKQ2js.c.call(void 0, _chunkLLT2PKQ2js.h.call(void 0, )),W=_chunkLLT2PKQ2js.c.call(void 0, _chunkLLT2PKQ2js.g.call(void 0, ));var _graymatter = require('gray-matter'); var _graymatter2 = _interopRequireDefault(_graymatter);var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);var _feed = require('feed');var pe=_chunkLLT2PKQ2js.c.call(void 0, _chunkLLT2PKQ2js.g.call(void 0, ));async function wn(e){return await _chunkLLT2PKQ2js.d.call(void 0, e,"created")||(await pe.default.stat(e)).ctime}async function xn(e){return await _chunkLLT2PKQ2js.d.call(void 0, e,"created")||(await pe.default.stat(e)).mtime}async function Ot(e,t,r="YYYY-MM-DD HH:mm:ss",n=!0){e.date||(e.date=await wn(t)),e.date=_dayjs2.default.call(void 0, e.date).format(r),n&&(e.updated||(e.updated=await xn(t)),e.updated=_dayjs2.default.call(void 0, e.updated).format(r))}var jn=_markdownit2.default.call(void 0, {html:!0,breaks:!0,linkify:!0});async function Rt(e){var B,he,ge,be,ye,ve,we,xe,ke,Oe,Ce,Re,$e,Me;let{config:t}=e;if(!t.url||t.url==="/"){_consola2.default.error("You must set `url` (like `https://example.com`) in `valaxy.config.ts` to generate rss.");return}let r=t.url,n=t.url.slice(0,-1),o={name:(B=t==null?void 0:t.author)==null?void 0:B.name,email:(he=t==null?void 0:t.author)==null?void 0:he.email,link:(ge=t==null?void 0:t.author)==null?void 0:ge.link};_consola2.default.info(`RSS Site Url: ${_kolorist.cyan.call(void 0, r)}`);let s=((be=t.license)==null?void 0:be.type)==="zero"?"1.0":"4.0",i={title:t.title||"Valaxy Blog",description:t.description,id:r||"valaxy",link:r,copyright:`CC ${(ve=(ye=t.license)==null?void 0:ye.type)==null?void 0:ve.toUpperCase()} ${s} ${new Date().getFullYear()} \xA9 ${(we=t.author)==null?void 0:we.name}`,feedLinks:{json:`${r}feed.json`,atom:`${r}feed.atom`,rss:`${r}feed.xml`}},a=await(0,Ct.default)(`${e.userRoot}/pages/posts/**/*.md`),c=[];for await(let d of a){let y=W.default.readFileSync(d,"utf-8"),{data:h,content:T,excerpt:A}=_graymatter2.default.call(void 0, y,{excerpt_separator:"<!-- more -->"});if(h.draft){_consola2.default.warn(`Ignore draft post: ${_kolorist.dim.call(void 0, d)}`);continue}await Ot(h,d,(xe=t.date)==null?void 0:xe.format,t.lastUpdated);let $t=jn.render(A||T).replace('src="/',`src="${n}/`);(ke=h.image)!=null&&ke.startsWith("/")&&(h.image=n+h.image),c.push({title:"",...h,id:(h.id||"").toString(),date:new Date(h.date),published:new Date(h.updated||h.date),content:$t,author:[o],link:n+d.replace(`${e.userRoot}/pages`,"").replace(/\.md$/,"")})}c.sort((d,y)=>+new Date(y.published||y.date)-+new Date(d.published||d.date)),i.author=o,i.image=(Ce=(Oe=t.author)==null?void 0:Oe.avatar)!=null&&Ce.startsWith("http")?t.author.avatar:`${n}${(Re=t.author)==null?void 0:Re.avatar}`,i.favicon=`${n}${(($e=t.feed)==null?void 0:$e.favicon)||t.favicon}`;let u=new (0, _feed.Feed)(i);c.forEach(d=>u.addItem(d)),await W.default.ensureDir(_path.dirname.call(void 0, `./dist/${(Me=t.feed)==null?void 0:Me.name}`));let p="./dist";["xml","atom","json"].forEach(d=>{var T,A;let y="",h=`${p}/${((T=t.feed)==null?void 0:T.name)||"feed"}.${d}`;d==="xml"?y=u.rss2():d==="atom"?((A=t.feed)!=null&&A.name||(h=`${p}/atom.xml`),y=u.atom1()):d==="json"&&(y=u.json1()),W.default.writeFileSync(h,y,"utf-8"),_consola2.default.info(`${d}: ${h}`)})}var F=_yargs2.default.scriptName("valaxy").usage("$0 [args]").version(L).showHelpOnFail(!1).alias("h","help").alias("v","version");F.command("* [root]","Start a local server for Valaxy",e=>de(e).option("port",{alias:"p",type:"number",describe:"port"}).option("open",{alias:"o",default:!1,type:"boolean",describe:"open in browser"}).option("remote",{default:!0,type:"boolean",describe:"listen public host and enable remote control"}).option("log",{default:"warn",type:"string",choices:["error","warn","info","silent"],describe:"log level"}).strict().help(),async({root:e,port:t,open:r,remote:n,log:o})=>{M.default.existsSync(_path2.default.resolve(e,"pages"))||process.exit(0);let s=t||await Q(4859),i=await _chunkLLT2PKQ2js.p.call(void 0, {userRoot:e}),a=_vite.mergeConfig.call(void 0, {configFile:_path2.default.resolve(i.clientRoot,"vite.config.ts"),server:{watch:{ignored:[`!${i.themeRoot}/**`,`${i.userRoot}/**.md`]},port:s,strictPort:!0,open:r,host:n?"0.0.0.0":"localhost"},logLevel:o},i.config.vite||{});await P(i,a),te(i,s,n),Ae([{name:"r",fullName:"restart",action(){P(i,a)}},{name:"o",fullName:"open",action(){_open2.default.call(void 0, `http://localhost:${s}`)}},{name:"e",fullName:"edit",action(){_child_process.exec.call(void 0, `code "${e}"`)}}])});F.command("build [root]","build your blog to static content",e=>de(e).option("ssg",{alias:"s",type:"boolean",default:!1,describe:"static site generate"}).option("output",{alias:"o",type:"string",default:"dist",describe:"output dir"}).strict().help(),async({ssg:e,root:t,output:r})=>{let n=await _chunkLLT2PKQ2js.p.call(void 0, {userRoot:t},"build");te(n);let o=_vite.mergeConfig.call(void 0, await _chunkLLT2PKQ2js.e.call(void 0, n,"build"),n.config.vite||{}),s=_vite.mergeConfig.call(void 0, o,{configFile:_path2.default.resolve(n.clientRoot,"vite.config.ts"),build:{emptyOutDir:!0,outDir:_path2.default.resolve(n.userRoot,r)}}),i=_path2.default.resolve(n.clientRoot,"template.html"),a=_path2.default.resolve(n.clientRoot,"index.html");M.default.existsSync(i)&&await M.default.copyFile(i,a),await M.default.writeFile(a,await _chunkLLT2PKQ2js.f.call(void 0, n),"utf-8");try{if(e){_consola2.default.info(`use ${_kolorist.yellow.call(void 0, "vite-ssg")} to do ssg build...`);try{await _chunkLLT2PKQ2js.r.call(void 0, n,s)}catch(c){_consola2.default.error("[vite-ssg] An internal error occurred."),console.log(c)}}else _consola2.default.info("use vite do spa build..."),await _chunkLLT2PKQ2js.q.call(void 0, n,s)}finally{await M.default.copyFile(i,a)}});F.command("rss [root]","generate rss feed",e=>de(e).strict().help(),async({root:e})=>{_consola2.default.info("Generate RSS ...");let t=await _chunkLLT2PKQ2js.p.call(void 0, {userRoot:e},"build");await Rt(t)});function de(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}xt(F);function Wr(){F.help().parse()}exports.run = Wr;
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{a as je,b,c as j,d as X,e as _,f as Pe,g as J,h as Mt,p as x,q as Ee,r as Ie,s as Se}from"../chunk-6PDG5NQV.mjs";var Le=b((zn,_e)=>{"use strict";_e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ne=b((Un,Ne)=>{var E=Le(),qe={};for(let e of Object.keys(E))qe[E[e]]=e;var l={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ne.exports=l;for(let e of Object.keys(l)){if(!("channels"in l[e]))throw new Error("missing channels property: "+e);if(!("labels"in l[e]))throw new Error("missing channel labels property: "+e);if(l[e].labels.length!==l[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=l[e];delete l[e].channels,delete l[e].labels,Object.defineProperty(l[e],"channels",{value:t}),Object.defineProperty(l[e],"labels",{value:r})}l.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),i=s-o,a,c;s===o?a=0:t===s?a=(r-n)/i:r===s?a=2+(n-t)/i:n===s&&(a=4+(t-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let u=(o+s)/2;return s===o?c=0:u<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,u*100]};l.rgb.hsv=function(e){let t,r,n,o,s,i=e[0]/255,a=e[1]/255,c=e[2]/255,u=Math.max(i,a,c),p=u-Math.min(i,a,c),m=function(B){return(u-B)/6/p+1/2};return p===0?(o=0,s=0):(s=p/u,t=m(i),r=m(a),n=m(c),i===u?o=n-r:a===u?o=1/3+t-n:c===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]};l.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],o=l.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]};l.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,i=(1-r-o)/(1-o)||0,a=(1-n-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function Lt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}l.rgb.keyword=function(e){let t=qe[e];if(t)return t;let r=1/0,n;for(let o of Object.keys(E)){let s=E[o],i=Lt(e,s);i<r&&(r=i,n=o)}return n};l.keyword.rgb=function(e){return E[e]};l.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,i=t*.0193+r*.1192+n*.9505;return[o*100,s*100,i*100]};l.rgb.lab=function(e){let t=l.rgb.xyz(e),r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*n-16,i=500*(r-n),a=200*(n-o);return[s,i,a]};l.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o,s,i;if(r===0)return i=n*255,[i,i,i];n<.5?o=n*(1+r):o=n+r-n*r;let a=2*n-o,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[u]=i*255;return c};l.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;let i=(n+r)/2,a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};l.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,s=t-Math.floor(t),i=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,c,i];case 1:return[a,n,i];case 2:return[i,n,c];case 3:return[i,a,n];case 4:return[c,i,n];case 5:return[n,i,a]}};l.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01),s,i;i=(2-r)*n;let a=(2-r)*o;return s=r*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]};l.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o=r+n,s;o>1&&(r/=o,n/=o);let i=Math.floor(6*t),a=1-n;s=6*t-i,(i&1)!==0&&(s=1-s);let c=r+s*(a-r),u,p,m;switch(i){default:case 6:case 0:u=a,p=c,m=r;break;case 1:u=c,p=a,m=r;break;case 2:u=r,p=a,m=c;break;case 3:u=r,p=c,m=a;break;case 4:u=c,p=r,m=a;break;case 5:u=a,p=r,m=c;break}return[u*255,p*255,m*255]};l.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,r*(1-o)+o),a=1-Math.min(1,n*(1-o)+o);return[s*255,i*255,a*255]};l.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o,s,i;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,i=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]};l.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,s=500*(t-r),i=200*(r-n);return[o,s,i]};l.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],o,s,i;s=(t+16)/116,o=r/500+s,i=s-n/200;let a=s**3,c=o**3,u=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]};l.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);let i=Math.sqrt(r*r+n*n);return[t,i,o]};l.lch.lab=function(e){let t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),i=r*Math.sin(o);return[t,s,i]};l.rgb.ansi16=function(e,t=null){let[r,n,o]=e,s=t===null?l.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(i+=60),i};l.hsv.ansi16=function(e){return l.rgb.ansi16(l.hsv.rgb(e),e[2])};l.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};l.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]};l.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]};l.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};l.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),o=n>>16&255,s=n>>8&255,i=n&255;return[o,s,i]};l.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),i=o-s,a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(r-n)/i%6:o===r?c=2+(n-t)/i:c=4+(t-r)/i,c/=6,c%=1,[c*360,i*100,a*100]};l.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]};l.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]};l.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let o=[0,0,0],s=t%1*6,i=s%1,a=1-i,c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-r)*n,[(r*o[0]+c)*255,(r*o[1]+c)*255,(r*o[2]+c)*255]};l.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]};l.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]};l.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};l.hwb.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=1-r,o=n-t,s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]};l.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};l.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};l.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};l.gray.hsl=function(e){return[0,0,e[0]]};l.gray.hsv=l.gray.hsl;l.gray.hwb=function(e){return[0,100,e[0]]};l.gray.cmyk=function(e){return[0,0,0,e[0]]};l.gray.lab=function(e){return[e[0],0,0]};l.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};l.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var Ve=b((Hn,De)=>{var N=ne();function qt(){let e={},t=Object.keys(N);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Nt(e){let t=qt(),r=[e];for(t[e].distance=0;r.length;){let n=r.pop(),o=Object.keys(N[n]);for(let s=o.length,i=0;i<s;i++){let a=o[i],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function Dt(e,t){return function(r){return t(e(r))}}function Vt(e,t){let r=[t[e].parent,e],n=N[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Dt(N[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}De.exports=function(e){let t=Nt(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){let i=n[s];t[i].parent!==null&&(r[i]=Vt(i,t))}return r}});var Ge=b((Wn,Ye)=>{var re=ne(),Yt=Ve(),k={},Gt=Object.keys(re);function zt(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ut(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let o=e(r);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}Gt.forEach(e=>{k[e]={},Object.defineProperty(k[e],"channels",{value:re[e].channels}),Object.defineProperty(k[e],"labels",{value:re[e].labels});let t=Yt(e);Object.keys(t).forEach(n=>{let o=t[n];k[e][n]=Ut(o),k[e][n].raw=zt(o)})});Ye.exports=k});var Xe=b((Kn,Ke)=>{"use strict";var ze=(e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,Ue=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},He=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},D=e=>e,We=(e,t,r)=>[e,t,r],O=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},oe,C=(e,t,r,n)=>{oe===void 0&&(oe=Ge());let o=n?10:0,s={};for(let[i,a]of Object.entries(oe)){let c=i==="ansi16"?"ansi":i;i===t?s[c]=e(r,o):typeof a=="object"&&(s[c]=e(a[t],o))}return s};function Ht(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,s]of Object.entries(n))t[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[o]=t[o],e.set(s[0],s[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",O(t.color,"ansi",()=>C(ze,"ansi16",D,!1)),O(t.color,"ansi256",()=>C(Ue,"ansi256",D,!1)),O(t.color,"ansi16m",()=>C(He,"rgb",We,!1)),O(t.bgColor,"ansi",()=>C(ze,"ansi16",D,!0)),O(t.bgColor,"ansi256",()=>C(Ue,"ansi256",D,!0)),O(t.bgColor,"ansi16m",()=>C(He,"rgb",We,!0)),t}Object.defineProperty(Ke,"exports",{enumerable:!0,get:Ht})});var Qe=b((Xn,Je)=>{"use strict";Je.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var tt=b((Jn,et)=>{"use strict";var Wt=je("os"),Ze=je("tty"),g=Qe(),{env:f}=process,w;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?w=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(w=1);"FORCE_COLOR"in f&&(f.FORCE_COLOR==="true"?w=1:f.FORCE_COLOR==="false"?w=0:w=f.FORCE_COLOR.length===0?1:Math.min(parseInt(f.FORCE_COLOR,10),3));function se(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ie(e,t){if(w===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!t&&w===void 0)return 0;let r=w||0;if(f.TERM==="dumb")return r;if(process.platform==="win32"){let n=Wt.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in f)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in f)||f.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in f){let n=parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:r}function Kt(e){let t=ie(e,e&&e.isTTY);return se(t)}et.exports={supportsColor:Kt,stdout:se(ie(!0,Ze.isatty(1))),stderr:se(ie(!0,Ze.isatty(2)))}});var rt=b((Qn,nt)=>{"use strict";var Xt=(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let o=t.length,s=0,i="";do i+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return i+=e.substr(s),i},Jt=(e,t,r,n)=>{let o=0,s="";do{let i=e[n-1]==="\r";s+=e.substr(o,(i?n-1:n)-o)+t+(i?`\r
|
|
1
|
+
import{a as je,b,c as j,d as X,e as _,f as Pe,g as J,h as Mt,p as x,q as Ee,r as Ie,s as Se}from"../chunk-4DDESE24.mjs";var Le=b((zn,_e)=>{"use strict";_e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ne=b((Un,Ne)=>{var E=Le(),qe={};for(let e of Object.keys(E))qe[E[e]]=e;var l={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ne.exports=l;for(let e of Object.keys(l)){if(!("channels"in l[e]))throw new Error("missing channels property: "+e);if(!("labels"in l[e]))throw new Error("missing channel labels property: "+e);if(l[e].labels.length!==l[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=l[e];delete l[e].channels,delete l[e].labels,Object.defineProperty(l[e],"channels",{value:t}),Object.defineProperty(l[e],"labels",{value:r})}l.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),i=s-o,a,c;s===o?a=0:t===s?a=(r-n)/i:r===s?a=2+(n-t)/i:n===s&&(a=4+(t-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let u=(o+s)/2;return s===o?c=0:u<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,u*100]};l.rgb.hsv=function(e){let t,r,n,o,s,i=e[0]/255,a=e[1]/255,c=e[2]/255,u=Math.max(i,a,c),p=u-Math.min(i,a,c),m=function(B){return(u-B)/6/p+1/2};return p===0?(o=0,s=0):(s=p/u,t=m(i),r=m(a),n=m(c),i===u?o=n-r:a===u?o=1/3+t-n:c===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]};l.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],o=l.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]};l.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,i=(1-r-o)/(1-o)||0,a=(1-n-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function Lt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}l.rgb.keyword=function(e){let t=qe[e];if(t)return t;let r=1/0,n;for(let o of Object.keys(E)){let s=E[o],i=Lt(e,s);i<r&&(r=i,n=o)}return n};l.keyword.rgb=function(e){return E[e]};l.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,i=t*.0193+r*.1192+n*.9505;return[o*100,s*100,i*100]};l.rgb.lab=function(e){let t=l.rgb.xyz(e),r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*n-16,i=500*(r-n),a=200*(n-o);return[s,i,a]};l.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o,s,i;if(r===0)return i=n*255,[i,i,i];n<.5?o=n*(1+r):o=n+r-n*r;let a=2*n-o,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[u]=i*255;return c};l.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;let i=(n+r)/2,a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};l.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,s=t-Math.floor(t),i=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,c,i];case 1:return[a,n,i];case 2:return[i,n,c];case 3:return[i,a,n];case 4:return[c,i,n];case 5:return[n,i,a]}};l.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01),s,i;i=(2-r)*n;let a=(2-r)*o;return s=r*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]};l.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o=r+n,s;o>1&&(r/=o,n/=o);let i=Math.floor(6*t),a=1-n;s=6*t-i,(i&1)!==0&&(s=1-s);let c=r+s*(a-r),u,p,m;switch(i){default:case 6:case 0:u=a,p=c,m=r;break;case 1:u=c,p=a,m=r;break;case 2:u=r,p=a,m=c;break;case 3:u=r,p=c,m=a;break;case 4:u=c,p=r,m=a;break;case 5:u=a,p=r,m=c;break}return[u*255,p*255,m*255]};l.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,r*(1-o)+o),a=1-Math.min(1,n*(1-o)+o);return[s*255,i*255,a*255]};l.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o,s,i;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,i=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]};l.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,s=500*(t-r),i=200*(r-n);return[o,s,i]};l.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],o,s,i;s=(t+16)/116,o=r/500+s,i=s-n/200;let a=s**3,c=o**3,u=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]};l.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);let i=Math.sqrt(r*r+n*n);return[t,i,o]};l.lch.lab=function(e){let t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),i=r*Math.sin(o);return[t,s,i]};l.rgb.ansi16=function(e,t=null){let[r,n,o]=e,s=t===null?l.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(i+=60),i};l.hsv.ansi16=function(e){return l.rgb.ansi16(l.hsv.rgb(e),e[2])};l.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};l.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]};l.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]};l.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};l.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),o=n>>16&255,s=n>>8&255,i=n&255;return[o,s,i]};l.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),i=o-s,a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(r-n)/i%6:o===r?c=2+(n-t)/i:c=4+(t-r)/i,c/=6,c%=1,[c*360,i*100,a*100]};l.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]};l.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]};l.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let o=[0,0,0],s=t%1*6,i=s%1,a=1-i,c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-r)*n,[(r*o[0]+c)*255,(r*o[1]+c)*255,(r*o[2]+c)*255]};l.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]};l.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]};l.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};l.hwb.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=1-r,o=n-t,s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]};l.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};l.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};l.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};l.gray.hsl=function(e){return[0,0,e[0]]};l.gray.hsv=l.gray.hsl;l.gray.hwb=function(e){return[0,100,e[0]]};l.gray.cmyk=function(e){return[0,0,0,e[0]]};l.gray.lab=function(e){return[e[0],0,0]};l.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};l.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var Ve=b((Hn,De)=>{var N=ne();function qt(){let e={},t=Object.keys(N);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Nt(e){let t=qt(),r=[e];for(t[e].distance=0;r.length;){let n=r.pop(),o=Object.keys(N[n]);for(let s=o.length,i=0;i<s;i++){let a=o[i],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function Dt(e,t){return function(r){return t(e(r))}}function Vt(e,t){let r=[t[e].parent,e],n=N[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Dt(N[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}De.exports=function(e){let t=Nt(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){let i=n[s];t[i].parent!==null&&(r[i]=Vt(i,t))}return r}});var Ge=b((Wn,Ye)=>{var re=ne(),Yt=Ve(),k={},Gt=Object.keys(re);function zt(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ut(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let o=e(r);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}Gt.forEach(e=>{k[e]={},Object.defineProperty(k[e],"channels",{value:re[e].channels}),Object.defineProperty(k[e],"labels",{value:re[e].labels});let t=Yt(e);Object.keys(t).forEach(n=>{let o=t[n];k[e][n]=Ut(o),k[e][n].raw=zt(o)})});Ye.exports=k});var Xe=b((Kn,Ke)=>{"use strict";var ze=(e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,Ue=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},He=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},D=e=>e,We=(e,t,r)=>[e,t,r],O=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},oe,C=(e,t,r,n)=>{oe===void 0&&(oe=Ge());let o=n?10:0,s={};for(let[i,a]of Object.entries(oe)){let c=i==="ansi16"?"ansi":i;i===t?s[c]=e(r,o):typeof a=="object"&&(s[c]=e(a[t],o))}return s};function Ht(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,s]of Object.entries(n))t[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[o]=t[o],e.set(s[0],s[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",O(t.color,"ansi",()=>C(ze,"ansi16",D,!1)),O(t.color,"ansi256",()=>C(Ue,"ansi256",D,!1)),O(t.color,"ansi16m",()=>C(He,"rgb",We,!1)),O(t.bgColor,"ansi",()=>C(ze,"ansi16",D,!0)),O(t.bgColor,"ansi256",()=>C(Ue,"ansi256",D,!0)),O(t.bgColor,"ansi16m",()=>C(He,"rgb",We,!0)),t}Object.defineProperty(Ke,"exports",{enumerable:!0,get:Ht})});var Qe=b((Xn,Je)=>{"use strict";Je.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var tt=b((Jn,et)=>{"use strict";var Wt=je("os"),Ze=je("tty"),g=Qe(),{env:f}=process,w;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?w=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(w=1);"FORCE_COLOR"in f&&(f.FORCE_COLOR==="true"?w=1:f.FORCE_COLOR==="false"?w=0:w=f.FORCE_COLOR.length===0?1:Math.min(parseInt(f.FORCE_COLOR,10),3));function se(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ie(e,t){if(w===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!t&&w===void 0)return 0;let r=w||0;if(f.TERM==="dumb")return r;if(process.platform==="win32"){let n=Wt.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in f)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in f)||f.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in f){let n=parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:r}function Kt(e){let t=ie(e,e&&e.isTTY);return se(t)}et.exports={supportsColor:Kt,stdout:se(ie(!0,Ze.isatty(1))),stderr:se(ie(!0,Ze.isatty(2)))}});var rt=b((Qn,nt)=>{"use strict";var Xt=(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let o=t.length,s=0,i="";do i+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return i+=e.substr(s),i},Jt=(e,t,r,n)=>{let o=0,s="";do{let i=e[n-1]==="\r";s+=e.substr(o,(i?n-1:n)-o)+t+(i?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+r,o=n+1,n=e.indexOf(`
|
|
4
4
|
`,o)}while(n!==-1);return s+=e.substr(o),s};nt.exports={stringReplaceAll:Xt,stringEncaseCRLFWithFirstIndex:Jt}});var lt=b((Zn,at)=>{"use strict";var Qt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ot=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Zt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,en=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,tn=new Map([["n",`
|
|
5
5
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function it(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)):tn.get(e)||e}function nn(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let s of n){let i=Number(s);if(!Number.isNaN(i))r.push(i);else if(o=s.match(Zt))r.push(o[2].replace(en,(a,c,u)=>c?it(c):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return r}function rn(e){ot.lastIndex=0;let t=[],r;for(;(r=ot.exec(e))!==null;){let n=r[1];if(r[2]){let o=nn(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function st(e,t){let r={};for(let o of t)for(let s of o.styles)r[s[0]]=o.inverse?null:s.slice(1);let n=e;for(let[o,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=s.length>0?n[o](...s):n[o]}return n}at.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(Qt,(s,i,a,c,u,p)=>{if(i)o.push(it(i));else if(c){let m=o.join("");o=[],n.push(r.length===0?m:st(e,r)(m)),r.push({inverse:a,styles:rn(c)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(st(e,r)(o.join(""))),o=[],r.pop()}else o.push(p)}),n.push(o.join("")),r.length>0){let s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var ht=b((er,dt)=>{"use strict";var I=Xe(),{stdout:le,stderr:ce}=tt(),{stringReplaceAll:on,stringEncaseCRLFWithFirstIndex:sn}=rt(),{isArray:V}=Array,ut=["ansi","ansi","ansi256","ansi16m"],R=Object.create(null),an=(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=le?le.level:0;e.level=t.level===void 0?r:t.level},ue=class{constructor(t){return ft(t)}},ft=e=>{let t={};return an(t,e),t.template=(...r)=>mt(t.template,...r),Object.setPrototypeOf(t,Y.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=ue,t.template};function Y(e){return ft(e)}for(let[e,t]of Object.entries(I))R[e]={get(){let r=G(this,fe(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};R.visible={get(){let e=G(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var pt=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of pt)R[e]={get(){let{level:t}=this;return function(...r){let n=fe(I.color[ut[t]][e](...r),I.color.close,this._styler);return G(this,n,this._isEmpty)}}};for(let e of pt){let t="bg"+e[0].toUpperCase()+e.slice(1);R[t]={get(){let{level:r}=this;return function(...n){let o=fe(I.bgColor[ut[r]][e](...n),I.bgColor.close,this._styler);return G(this,o,this._isEmpty)}}}}var ln=Object.defineProperties(()=>{},{...R,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),fe=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},G=(e,t,r)=>{let n=(...o)=>V(o[0])&&V(o[0].raw)?ct(n,mt(n,...o)):ct(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,ln),n._generator=e,n._styler=t,n._isEmpty=r,n},ct=(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:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=on(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
|
|
6
|
-
`);return s!==-1&&(t=sn(t,o,n,s)),n+t+o},ae,mt=(e,...t)=>{let[r]=t;if(!V(r)||!V(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return ae===void 0&&(ae=lt()),ae(e,o.join(""))};Object.defineProperties(Y.prototype,R);var z=Y();z.supportsColor=le;z.stderr=Y({level:ce?ce.level:0});z.stderr.supportsColor=ce;dt.exports=z});var M=j(J());import $ from"path";import{exec as Pn}from"child_process";import En from"yargs";import{mergeConfig as me}from"vite";import In from"open";import K from"consola";import{yellow as Sn}from"kolorist";var L="0.10.
|
|
6
|
+
`);return s!==-1&&(t=sn(t,o,n,s)),n+t+o},ae,mt=(e,...t)=>{let[r]=t;if(!V(r)||!V(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return ae===void 0&&(ae=lt()),ae(e,o.join(""))};Object.defineProperties(Y.prototype,R);var z=Y();z.supportsColor=le;z.stderr=Y({level:ce?ce.level:0});z.stderr.supportsColor=ce;dt.exports=z});var M=j(J());import $ from"path";import{exec as Pn}from"child_process";import En from"yargs";import{mergeConfig as me}from"vite";import In from"open";import K from"consola";import{yellow as Sn}from"kolorist";var L="0.10.4";import Pt from"net";async function Q(e){return await Et(e)?e:await Q(e+1)}function Et(e){return new Promise(t=>{let r=Pt.createServer(n=>{n.write(`Echo server\r
|
|
7
7
|
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}import*as Te from"readline";import It from"path";import St from"os";import{blue as Fe,bold as Z,cyan as Ft,dim as v,gray as Bt,green as Tt,underline as ee,yellow as At}from"kolorist";import Be from"consola";import{mergeConfig as _t}from"vite";var q;function te(e,t,r){console.log(),console.log(` ${Z("\u{1F30C} Valaxy")} ${Fe(`v${L}`)}`),console.log(),console.log(`${v(" \u{1FA90} theme ")} > ${e.theme?Tt(e.theme):Bt("none")}`),console.log(` ${v("\u{1F4C1}")} ${v(It.resolve(e.userRoot))}`),t&&(console.log(),console.log(`${v(" Preview ")} > ${Ft(`http://localhost:${Z(t)}/`)}`),r&&Object.values(St.networkInterfaces()).forEach(n=>(n||[]).filter(o=>o.family==="IPv4"&&!o.address.includes("127.0.0.1")).forEach(({address:o})=>{console.log(`${v(" Network ")} > ${Fe(`http://${o}:${Z(t)}/`)}`)})),console.log(),console.log(`${v(" shortcuts ")} > ${ee("r")}${v("estart | ")}${ee("o")}${v("pen | ")}${ee("e")}${v("dit")}`)),console.log()}async function P(e,t){q&&await q.close();let r=_t(await _(e,"serve"),t);try{q=await Se(e,r,{async onConfigReload(n,o,s=!1){s&&(Be.info("[valaxy]",`${At("force")} reload the server`),P(e,t));let i=!1;n.theme!==o.theme&&(i=!0),i&&P(e,t)}}),await q.listen()}catch(n){Be.error(`failed to start server. error:
|
|
8
8
|
`),console.error(n),process.exit(1)}}function Ae(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),Te.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(t,r)=>{if(r.ctrl&&r.name==="c")process.exit();else{let[n]=e.filter(o=>o.name===t);if(n)try{n.action()}catch(o){console.error(`Failed to execute shortcut ${n.fullName}`,o)}}})}var wt=j(ht());import vn from"consola";import{writeFile as pn}from"fs/promises";import{join as yt,resolve as mn}from"path";import{render as dn}from"ejs";import hn from"dayjs";import{ensureSuffix as gn}from"@antfu/utils";import{access as cn}from"fs/promises";async function U(e){try{return await cn(e),!0}catch{return!1}}import un from"path";import{readFile as fn}from"fs/promises";var S=process.cwd(),gt=`---
|
|
9
9
|
layout: <%=layout%>
|
|
10
10
|
title: <%=title%>
|
|
11
11
|
date: <%=date%>
|
|
12
12
|
---
|
|
13
|
-
`;var bt=async e=>{let{clientRoot:t,themeRoot:r}=await x({userRoot:S}),n=[S,r,t];for(let o of n){let s=un.resolve(o,"scaffolds",`${e}.md`);if(await U(s))return fn(s,"utf-8")}return!1};var bn=mn(S,"pages"),vt=async e=>{let{path:t,title:r}=e,n=t||yt("posts",r),o=0;for(;;){let s=yt(bn,n);if(o&&(s=`${s}-${o}`),s=gn(".md",s),!await U(s)){let i=await yn(e);return pn(s,i,"utf-8"),s}o++}};async function yn({date:e,title:t,layout:r="post"}){let n=await bt(r);return n||(n=gt),dn(n,{title:t,layout:r,date:e?hn().format("YYYY-MM-DD hh:mm:ss"):""})}var xt=e=>{e.command("new <title>","Draft a new post",t=>{t.usage("$0 <title> -p [path] -l [layout]").positional("title",{describe:"The title of the new post",required:!0}).option("path",{alias:"p",type:"string",describe:"the path to generate new post. Customize the path of post to generate"}).option("layout",{alias:"l",type:"string",default:"post"}).option("date",{alias:"d",type:"boolean",describe:"Generate post with the current date"}).strict().help()},async({title:t,path:r,date:n,layout:o})=>{let s=await vt({title:t,date:n,layout:o,path:r});vn.success(`[valaxy new]: successfully generated file ${(0,wt.magenta)(s)}}`)})};var Ct=j(Mt()),W=j(J());import{dirname as kn}from"path";import{cyan as On,dim as Cn}from"kolorist";import Rn from"gray-matter";import $n from"markdown-it";import{Feed as Mn}from"feed";import H from"consola";var pe=j(J());import kt from"dayjs";async function wn(e){return await X(e,"created")||(await pe.default.stat(e)).ctime}async function xn(e){return await X(e,"created")||(await pe.default.stat(e)).mtime}async function Ot(e,t,r="YYYY-MM-DD HH:mm:ss",n=!0){e.date||(e.date=await wn(t)),e.date=kt(e.date).format(r),n&&(e.updated||(e.updated=await xn(t)),e.updated=kt(e.updated).format(r))}var jn=$n({html:!0,breaks:!0,linkify:!0});async function Rt(e){var B,he,ge,be,ye,ve,we,xe,ke,Oe,Ce,Re,$e,Me;let{config:t}=e;if(!t.url||t.url==="/"){H.error(
|
|
13
|
+
`;var bt=async e=>{let{clientRoot:t,themeRoot:r}=await x({userRoot:S}),n=[S,r,t];for(let o of n){let s=un.resolve(o,"scaffolds",`${e}.md`);if(await U(s))return fn(s,"utf-8")}return!1};var bn=mn(S,"pages"),vt=async e=>{let{path:t,title:r}=e,n=t||yt("posts",r),o=0;for(;;){let s=yt(bn,n);if(o&&(s=`${s}-${o}`),s=gn(".md",s),!await U(s)){let i=await yn(e);return pn(s,i,"utf-8"),s}o++}};async function yn({date:e,title:t,layout:r="post"}){let n=await bt(r);return n||(n=gt),dn(n,{title:t,layout:r,date:e?hn().format("YYYY-MM-DD hh:mm:ss"):""})}var xt=e=>{e.command("new <title>","Draft a new post",t=>{t.usage("$0 <title> -p [path] -l [layout]").positional("title",{describe:"The title of the new post",required:!0}).option("path",{alias:"p",type:"string",describe:"the path to generate new post. Customize the path of post to generate"}).option("layout",{alias:"l",type:"string",default:"post"}).option("date",{alias:"d",type:"boolean",describe:"Generate post with the current date"}).strict().help()},async({title:t,path:r,date:n,layout:o})=>{let s=await vt({title:t,date:n,layout:o,path:r});vn.success(`[valaxy new]: successfully generated file ${(0,wt.magenta)(s)}}`)})};var Ct=j(Mt()),W=j(J());import{dirname as kn}from"path";import{cyan as On,dim as Cn}from"kolorist";import Rn from"gray-matter";import $n from"markdown-it";import{Feed as Mn}from"feed";import H from"consola";var pe=j(J());import kt from"dayjs";async function wn(e){return await X(e,"created")||(await pe.default.stat(e)).ctime}async function xn(e){return await X(e,"created")||(await pe.default.stat(e)).mtime}async function Ot(e,t,r="YYYY-MM-DD HH:mm:ss",n=!0){e.date||(e.date=await wn(t)),e.date=kt(e.date).format(r),n&&(e.updated||(e.updated=await xn(t)),e.updated=kt(e.updated).format(r))}var jn=$n({html:!0,breaks:!0,linkify:!0});async function Rt(e){var B,he,ge,be,ye,ve,we,xe,ke,Oe,Ce,Re,$e,Me;let{config:t}=e;if(!t.url||t.url==="/"){H.error("You must set `url` (like `https://example.com`) in `valaxy.config.ts` to generate rss.");return}let r=t.url,n=t.url.slice(0,-1),o={name:(B=t==null?void 0:t.author)==null?void 0:B.name,email:(he=t==null?void 0:t.author)==null?void 0:he.email,link:(ge=t==null?void 0:t.author)==null?void 0:ge.link};H.info(`RSS Site Url: ${On(r)}`);let s=((be=t.license)==null?void 0:be.type)==="zero"?"1.0":"4.0",i={title:t.title||"Valaxy Blog",description:t.description,id:r||"valaxy",link:r,copyright:`CC ${(ve=(ye=t.license)==null?void 0:ye.type)==null?void 0:ve.toUpperCase()} ${s} ${new Date().getFullYear()} \xA9 ${(we=t.author)==null?void 0:we.name}`,feedLinks:{json:`${r}feed.json`,atom:`${r}feed.atom`,rss:`${r}feed.xml`}},a=await(0,Ct.default)(`${e.userRoot}/pages/posts/**/*.md`),c=[];for await(let d of a){let y=W.default.readFileSync(d,"utf-8"),{data:h,content:T,excerpt:A}=Rn(y,{excerpt_separator:"<!-- more -->"});if(h.draft){H.warn(`Ignore draft post: ${Cn(d)}`);continue}await Ot(h,d,(xe=t.date)==null?void 0:xe.format,t.lastUpdated);let $t=jn.render(A||T).replace('src="/',`src="${n}/`);(ke=h.image)!=null&&ke.startsWith("/")&&(h.image=n+h.image),c.push({title:"",...h,id:(h.id||"").toString(),date:new Date(h.date),published:new Date(h.updated||h.date),content:$t,author:[o],link:n+d.replace(`${e.userRoot}/pages`,"").replace(/\.md$/,"")})}c.sort((d,y)=>+new Date(y.published||y.date)-+new Date(d.published||d.date)),i.author=o,i.image=(Ce=(Oe=t.author)==null?void 0:Oe.avatar)!=null&&Ce.startsWith("http")?t.author.avatar:`${n}${(Re=t.author)==null?void 0:Re.avatar}`,i.favicon=`${n}${(($e=t.feed)==null?void 0:$e.favicon)||t.favicon}`;let u=new Mn(i);c.forEach(d=>u.addItem(d)),await W.default.ensureDir(kn(`./dist/${(Me=t.feed)==null?void 0:Me.name}`));let p="./dist";["xml","atom","json"].forEach(d=>{var T,A;let y="",h=`${p}/${((T=t.feed)==null?void 0:T.name)||"feed"}.${d}`;d==="xml"?y=u.rss2():d==="atom"?((A=t.feed)!=null&&A.name||(h=`${p}/atom.xml`),y=u.atom1()):d==="json"&&(y=u.json1()),W.default.writeFileSync(h,y,"utf-8"),H.info(`${d}: ${h}`)})}var F=En.scriptName("valaxy").usage("$0 [args]").version(L).showHelpOnFail(!1).alias("h","help").alias("v","version");F.command("* [root]","Start a local server for Valaxy",e=>de(e).option("port",{alias:"p",type:"number",describe:"port"}).option("open",{alias:"o",default:!1,type:"boolean",describe:"open in browser"}).option("remote",{default:!0,type:"boolean",describe:"listen public host and enable remote control"}).option("log",{default:"warn",type:"string",choices:["error","warn","info","silent"],describe:"log level"}).strict().help(),async({root:e,port:t,open:r,remote:n,log:o})=>{M.default.existsSync($.resolve(e,"pages"))||process.exit(0);let s=t||await Q(4859),i=await x({userRoot:e}),a=me({configFile:$.resolve(i.clientRoot,"vite.config.ts"),server:{watch:{ignored:[`!${i.themeRoot}/**`,`${i.userRoot}/**.md`]},port:s,strictPort:!0,open:r,host:n?"0.0.0.0":"localhost"},logLevel:o},i.config.vite||{});await P(i,a),te(i,s,n),Ae([{name:"r",fullName:"restart",action(){P(i,a)}},{name:"o",fullName:"open",action(){In(`http://localhost:${s}`)}},{name:"e",fullName:"edit",action(){Pn(`code "${e}"`)}}])});F.command("build [root]","build your blog to static content",e=>de(e).option("ssg",{alias:"s",type:"boolean",default:!1,describe:"static site generate"}).option("output",{alias:"o",type:"string",default:"dist",describe:"output dir"}).strict().help(),async({ssg:e,root:t,output:r})=>{let n=await x({userRoot:t},"build");te(n);let o=me(await _(n,"build"),n.config.vite||{}),s=me(o,{configFile:$.resolve(n.clientRoot,"vite.config.ts"),build:{emptyOutDir:!0,outDir:$.resolve(n.userRoot,r)}}),i=$.resolve(n.clientRoot,"template.html"),a=$.resolve(n.clientRoot,"index.html");M.default.existsSync(i)&&await M.default.copyFile(i,a),await M.default.writeFile(a,await Pe(n),"utf-8");try{if(e){K.info(`use ${Sn("vite-ssg")} to do ssg build...`);try{await Ie(n,s)}catch(c){K.error("[vite-ssg] An internal error occurred."),console.log(c)}}else K.info("use vite do spa build..."),await Ee(n,s)}finally{await M.default.copyFile(i,a)}});F.command("rss [root]","generate rss feed",e=>de(e).strict().help(),async({root:e})=>{K.info("Generate RSS ...");let t=await x({userRoot:e},"build");await Rt(t)});function de(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}xt(F);function Wr(){F.help().parse()}export{Wr as run};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ViteSSGOptions } from 'vite-ssg';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
3
|
import { UserConfig as UserConfig$1, InlineConfig } from 'vite';
|
|
4
|
-
import { D as DefaultThemeConfig, U as UserSiteConfig, P as PartialDeep, S as SiteConfig } from '../config-
|
|
4
|
+
import { D as DefaultThemeConfig, U as UserSiteConfig, P as PartialDeep, S as SiteConfig } from '../config-a8e39079.js';
|
|
5
5
|
import Vue from '@vitejs/plugin-vue';
|
|
6
6
|
import Components from 'unplugin-vue-components/vite';
|
|
7
7
|
import { VitePluginConfig } from 'unocss/vite';
|
|
@@ -98,6 +98,7 @@ interface ValaxyExtendConfig {
|
|
|
98
98
|
extendMd?: (ctx: {
|
|
99
99
|
route: any;
|
|
100
100
|
data: Record<string, any>;
|
|
101
|
+
content: string;
|
|
101
102
|
excerpt?: string;
|
|
102
103
|
path: string;
|
|
103
104
|
}) => void;
|
|
@@ -209,7 +210,7 @@ declare function defineSiteWithTheme<ThemeConfig>(config: UserSiteConfig<ThemeCo
|
|
|
209
210
|
* Type valaxy config helper
|
|
210
211
|
*/
|
|
211
212
|
declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>;
|
|
212
|
-
declare type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd';
|
|
213
|
+
declare type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd' | 'addons';
|
|
213
214
|
declare type ValaxyPickConfig = Pick<ValaxyConfig, ValaxyConfigExtendKey>;
|
|
214
215
|
declare type ValaxyTheme<ThemeConfig = DefaultThemeConfig> = ValaxyPickConfig & {
|
|
215
216
|
themeConfig?: ThemeConfig;
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLLT2PKQ2js = require('../chunk-LLT2PKQ2.js');exports.build = _chunkLLT2PKQ2js.q; exports.createServer = _chunkLLT2PKQ2js.s; exports.defaultSiteConfig = _chunkLLT2PKQ2js.n; exports.defineAddon = _chunkLLT2PKQ2js.m; exports.defineConfig = _chunkLLT2PKQ2js.k; exports.defineSite = _chunkLLT2PKQ2js.i; exports.defineSiteWithTheme = _chunkLLT2PKQ2js.j; exports.defineTheme = _chunkLLT2PKQ2js.l; exports.defineUnoSetup = _chunkLLT2PKQ2js.o; exports.getIndexHtml = _chunkLLT2PKQ2js.f; exports.mergeViteConfigs = _chunkLLT2PKQ2js.e; exports.resolveOptions = _chunkLLT2PKQ2js.p; exports.ssgBuild = _chunkLLT2PKQ2js.r;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,f as r,i as m,j as p,k as t,l as e,m as f,n as x,o as i,p as a,q as b,r as c,s as d}from"../chunk-
|
|
1
|
+
import{e as o,f as r,i as m,j as p,k as t,l as e,m as f,n as x,o as i,p as a,q as b,r as c,s as d}from"../chunk-4DDESE24.mjs";export{b as build,d as createServer,x as defaultSiteConfig,f as defineAddon,t as defineConfig,m as defineSite,p as defineSiteWithTheme,e as defineTheme,i as defineUnoSetup,r as getIndexHtml,o as mergeViteConfigs,a as resolveOptions,c as ssgBuild};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AlgoliaSearchOptions, D as DefaultThemeConfig, P as PartialDeep, S as SiteConfig, a as SocialLink, U as UserSiteConfig } from '../config-
|
|
1
|
+
export { A as AlgoliaSearchOptions, D as DefaultThemeConfig, P as PartialDeep, S as SiteConfig, a as SocialLink, U as UserSiteConfig } from '../config-a8e39079.js';
|
|
2
2
|
|
|
3
3
|
interface Post extends Record<string, any> {
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "me@yunyoujun.cn",
|
|
@@ -51,52 +51,52 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@antfu/utils": "^0.5.2",
|
|
53
53
|
"@ctrl/tinycolor": "^3.4.1",
|
|
54
|
-
"@iconify-json/carbon": "^1.1.
|
|
54
|
+
"@iconify-json/carbon": "^1.1.7",
|
|
55
55
|
"@iconify-json/ri": "^1.1.3",
|
|
56
|
-
"@intlify/vite-plugin-vue-i18n": "^
|
|
56
|
+
"@intlify/vite-plugin-vue-i18n": "^6.0.1",
|
|
57
57
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
58
|
-
"@vueuse/core": "^
|
|
59
|
-
"@vueuse/head": "^0.7.
|
|
58
|
+
"@vueuse/core": "^9.2.0",
|
|
59
|
+
"@vueuse/head": "^0.7.12",
|
|
60
60
|
"consola": "^2.15.3",
|
|
61
61
|
"critters": "^0.0.16",
|
|
62
62
|
"cross-spawn": "^7.0.3",
|
|
63
|
-
"dayjs": "^1.11.
|
|
63
|
+
"dayjs": "^1.11.5",
|
|
64
64
|
"ejs": "^3.1.8",
|
|
65
65
|
"escape-html": "^1.0.3",
|
|
66
66
|
"feed": "^4.2.2",
|
|
67
67
|
"global-dirs": "^3.0.0",
|
|
68
68
|
"gray-matter": "^4.0.3",
|
|
69
69
|
"is-installed-globally": "^0.4.0",
|
|
70
|
-
"jiti": "^1.
|
|
71
|
-
"katex": "^0.16.
|
|
72
|
-
"kolorist": "^1.
|
|
73
|
-
"lru-cache": "^7.
|
|
70
|
+
"jiti": "^1.15.0",
|
|
71
|
+
"katex": "^0.16.2",
|
|
72
|
+
"kolorist": "^1.6.0",
|
|
73
|
+
"lru-cache": "^7.14.0",
|
|
74
74
|
"markdown-it": "^13.0.1",
|
|
75
|
-
"markdown-it-anchor": "^8.6.
|
|
75
|
+
"markdown-it-anchor": "^8.6.5",
|
|
76
76
|
"markdown-it-attrs": "^4.1.4",
|
|
77
77
|
"markdown-it-container": "^3.0.0",
|
|
78
78
|
"markdown-it-emoji": "^2.0.2",
|
|
79
|
-
"markdown-it-link-attributes": "^4.0.
|
|
79
|
+
"markdown-it-link-attributes": "^4.0.1",
|
|
80
80
|
"markdown-it-table-of-contents": "^0.6.0",
|
|
81
81
|
"markdown-it-task-lists": "^2.1.1",
|
|
82
82
|
"nprogress": "^0.2.0",
|
|
83
83
|
"open": "^8.4.0",
|
|
84
84
|
"pascal-case": "^3.1.2",
|
|
85
|
-
"pinia": "^2.0.
|
|
86
|
-
"sass": "^1.
|
|
87
|
-
"shiki": "^0.
|
|
88
|
-
"star-markdown-css": "^0.4.
|
|
89
|
-
"unconfig": "^0.3.
|
|
90
|
-
"unocss": "^0.
|
|
91
|
-
"unplugin-vue-components": "^0.
|
|
85
|
+
"pinia": "^2.0.22",
|
|
86
|
+
"sass": "^1.54.9",
|
|
87
|
+
"shiki": "^0.11.1",
|
|
88
|
+
"star-markdown-css": "^0.4.1",
|
|
89
|
+
"unconfig": "^0.3.6",
|
|
90
|
+
"unocss": "^0.45.21",
|
|
91
|
+
"unplugin-vue-components": "^0.22.7",
|
|
92
92
|
"vite": "^2.9.14",
|
|
93
|
-
"vite-plugin-pages": "^0.
|
|
94
|
-
"vite-plugin-vue-layouts": "^0.
|
|
93
|
+
"vite-plugin-pages": "^0.26.0",
|
|
94
|
+
"vite-plugin-vue-layouts": "^0.7.0",
|
|
95
95
|
"vite-ssg": "0.19.2",
|
|
96
|
-
"vite-ssg-sitemap": "0.
|
|
97
|
-
"vue": "^3.2.
|
|
98
|
-
"vue-i18n": "^9.
|
|
99
|
-
"vue-router": "^4.1.
|
|
96
|
+
"vite-ssg-sitemap": "0.4.1",
|
|
97
|
+
"vue": "^3.2.39",
|
|
98
|
+
"vue-i18n": "^9.2.2",
|
|
99
|
+
"vue-router": "^4.1.5",
|
|
100
100
|
"yargs": "^17.5.1"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@types/markdown-it": "^12.2.3",
|
|
107
107
|
"@types/markdown-it-link-attributes": "^3.0.1",
|
|
108
108
|
"@types/nprogress": "^0.2.0",
|
|
109
|
-
"@types/yargs": "^17.0.
|
|
109
|
+
"@types/yargs": "^17.0.12",
|
|
110
110
|
"debug": "^4.3.4",
|
|
111
111
|
"diacritics": "^1.3.0",
|
|
112
112
|
"https-localhost": "^4.7.1"
|
package/types/config.ts
CHANGED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { isClient } from '@vueuse/core'
|
|
2
|
-
import { onMounted, onUnmounted, watch } from 'vue'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import { useRoute } from 'vue-router'
|
|
5
|
-
|
|
6
|
-
import type { WalineInitOptions, WalineInstance } from '@waline/client'
|
|
7
|
-
import { cdnPrefix } from '../../utils'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A Simple, Safe Comment System.
|
|
11
|
-
* @public
|
|
12
|
-
* @see https://github.com/walinejs/waline
|
|
13
|
-
* @see https://waline.js.org/
|
|
14
|
-
* @param options
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export function useWaline(options: {} = {}, cdn = cdnPrefix) {
|
|
18
|
-
if (!isClient)
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
// import css
|
|
22
|
-
import('@waline/client/dist/waline.css')
|
|
23
|
-
|
|
24
|
-
const route = useRoute()
|
|
25
|
-
|
|
26
|
-
const { locale } = useI18n()
|
|
27
|
-
|
|
28
|
-
let waline: WalineInstance | null | undefined
|
|
29
|
-
|
|
30
|
-
onMounted(() => {
|
|
31
|
-
initWaline(options)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* init waline
|
|
36
|
-
* @param options waline options
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
function initWaline(options: {} = {}) {
|
|
40
|
-
const defaultOptions: WalineInitOptions = {
|
|
41
|
-
el: '.comment #waline',
|
|
42
|
-
serverURL: '',
|
|
43
|
-
lang: locale.value,
|
|
44
|
-
dark: 'html.dark',
|
|
45
|
-
emoji: [
|
|
46
|
-
`${cdn}@waline/emojis/bilibili/`,
|
|
47
|
-
`${cdn}@waline/emojis/qq/`,
|
|
48
|
-
`${cdn}@waline/emojis/weibo/`,
|
|
49
|
-
],
|
|
50
|
-
path: route.path,
|
|
51
|
-
}
|
|
52
|
-
const walineOptions = Object.assign(defaultOptions, options)
|
|
53
|
-
|
|
54
|
-
import('@waline/client').then(({ init }) => {
|
|
55
|
-
waline = init(walineOptions)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
watch(() => route.path, (path) => {
|
|
60
|
-
if (!waline)
|
|
61
|
-
return
|
|
62
|
-
waline.update({
|
|
63
|
-
path,
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
watch(locale, (lang) => {
|
|
68
|
-
if (!waline)
|
|
69
|
-
return
|
|
70
|
-
waline.update({
|
|
71
|
-
lang,
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
onUnmounted(() => {
|
|
76
|
-
if (!waline)
|
|
77
|
-
return
|
|
78
|
-
waline.destroy()
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
return waline
|
|
82
|
-
}
|