'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var isAnsiColorSupported = require('@visulima/is-ansi-color-supported'); function y({onlyFirst:r=!1}={}){let n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(n,r?void 0:"g")}var g=(r,e,n)=>e>r?e:r>n?n:r;var D=r=>{let[,e]=/([a-f\d]{3,6})/i.exec(r)??[],n=e?e.length:0;if(n===3)e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2];else if(n!==6)return [0,0,0];let o=Number.parseInt(e,16);return [o>>16&255,o>>8&255,o&255]};var f=(r,e,n)=>r===e&&e===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/51)+6*Math.round(e/51)+Math.round(n/51),c=r=>{let e,n,o;if(r<8)return 30+r;if(r<16)return 90+(r-8);if(r>=232)e=n=o=((r-232)*10+8)/255;else {r-=16;let b=r%36;e=Math.floor(r/36)/5,n=Math.floor(b/6)/5,o=b%6/5;}let a=Math.max(e,n,o)*2;if(a===0)return 30;let l=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(e));return a===2?l+60:l},C=(r,e,n)=>c(f(r,e,n));var s=39,i=49,T=10,d=isAnsiColorSupported.isStdoutColorSupported(),P={close:"",open:""},t=d>0?(r,e)=>({close:"\x1B["+e+"m",open:"\x1B["+r+"m"}):()=>P,w=r=>(e,n,o)=>r(f(Number(e),Number(n),Number(o))),M=r=>e=>{let[n,o,a]=D(e);return r(n,o,a)},h=r=>t("38;5;"+r,s),x=r=>t("48;5;"+r,i),m=(r,e,n)=>t("38;2;"+r+";"+e+";"+n,s),p=(r,e,n)=>t("48;2;"+r+";"+e+";"+n,i);d===1?(h=r=>t(c(Number(r)),s),x=r=>t(c(Number(r))+T,i),m=(r,e,n)=>t(C(Number(r),Number(e),Number(n)),s),p=(r,e,n)=>t(C(Number(r),Number(e),Number(n))+T,i)):d===2&&(m=w(h),p=w(x));var A={bold:t(1,22),dim:t(2,22),hidden:t(8,28),inverse:t(7,27),italic:t(3,23),overline:t(53,55),reset:t(0,0),strike:t(9,29),strikethrough:t(9,29),underline:t(4,24),visible:P},k={bgBlack:t(40,i),bgBlackBright:t(100,i),bgBlue:t(44,i),bgBlueBright:t(104,i),bgCyan:t(46,i),bgCyanBright:t(106,i),bgGray:t(100,i),bgGreen:t(42,i),bgGreenBright:t(102,i),bgGrey:t(100,i),bgMagenta:t(45,i),bgMagentaBright:t(105,i),bgRed:t(41,i),bgRedBright:t(101,i),bgWhite:t(47,i),bgWhiteBright:t(107,i),bgYellow:t(43,i),bgYellowBright:t(103,i),black:t(30,s),blackBright:t(90,s),blue:t(34,s),blueBright:t(94,s),cyan:t(36,s),cyanBright:t(96,s),gray:t(90,s),green:t(32,s),greenBright:t(92,s),grey:t(90,s),magenta:t(35,s),magentaBright:t(95,s),red:t(31,s),redBright:t(91,s),white:t(37,s),whiteBright:t(97,s),yellow:t(33,s),yellowBright:t(93,s)},B={bg:r=>x(g(r,0,255)),bgHex:M(p),bgRgb:(r,e,n)=>p(g(r,0,255),g(e,0,255),g(n,0,255)),fg:r=>h(g(r,0,255)),hex:M(m),rgb:(r,e,n)=>m(g(r,0,255),g(e,0,255),g(n,0,255))};var v=(r,e,n)=>{if(e==="")return r;let o=r.indexOf(e);if(o<0)return r;let a=e.length,l=0,b="";for(;~o;)b+=r.slice(l,o)+n,l=o+a,o=r.indexOf(e,l);return b+r.slice(l)};var u={},R=null,j=(r,e,n)=>{if(!r)return "";let o=r.raw==null?r+"":String.raw(r,...e);if(o.includes("\x1B"))for(let a=n;a;a=a.props)o=v(o,a.close,a.open);return o.includes(` `)&&(o=o.replace(/(\r*\n)/g,n.closeStack+"$1"+n.openStack)),n.openStack+o+n.closeStack},S=({props:r},{close:e,open:n})=>{let o=(r?.openStack??"")+n,a=e+(r?.closeStack??""),l=(b,...N)=>j(b,N,l.props);return Object.setPrototypeOf(l,R),l.props={close:e,closeStack:a,open:n,openStack:o,props:r},l.open=o,l.close=a,l},O=function(){let r=e=>e+"";r.strip=e=>e.replaceAll(y(),"");for(let e in k)u[e]={get(){let n=S(this,k[e]);return Object.defineProperty(this,e,{value:n}),n}};for(let e in A)u[e]={get(){let n=S(this,A[e]);return Object.defineProperty(this,e,{value:n}),n}};return R=Object.defineProperties({},u),Object.setPrototypeOf(r,R),r};for(let r in B)u[r]={get(){return (...e)=>S(this,B[r](...e))}};u.ansi256=u.fg;u.bgAnsi256=u.bg;var z=O;var L=new z,_=L,rr=z; module.exports = _; module.exports.Colorize = rr; //# sourceMappingURL=index.server.cjs.map //# sourceMappingURL=index.server.cjs.map