@visulima/packem 2.0.0-alpha.97 → 2.0.0-alpha.99

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.
@@ -1,2 +1,2 @@
1
1
  import{m as j,f as F,a as V,O as Y}from"./index-KXVG6Tyr.js";const B=0,O=1,$=2,M=3,U=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,W=/^-{1,2}(color=256)$/,H=/^-{1,2}(color=16m|color=full|color=truecolor)$/,K=/^-{1,2}(color|colors|color=true|color=always)$/,q=/-mono|dumb/i,z=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,J=/-256(color)?$/i,Q=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,Z=()=>{const t=globalThis.process?.getBuiltinModule;return typeof t!="function"?"":t("node:os").release()},_=(t,e={})=>{const{isTTY:s,sniffFlags:i=!0}=e,n=globalThis,l=n.Deno!=null,u=n.process??n.Deno??{},p=u.argv??u.args??[],T=i?p.indexOf("--"):-1,a=d=>{if(!i)return!1;const y=p.findIndex(D=>d.test(D));return y!==-1&&(T===-1||y<T)};let r={};try{r=l?u.env.toObject():u.env??{}}catch{}const o="FORCE_COLOR",g=o in r,c=r[o]??void 0,m=typeof c=="string",N=typeof c=="number";let h;if(c==="true")h=O;else if(c==="false")h=B;else if(m&&c.length===0)h=O;else if(m&&c.length>0){const d=Number.parseInt(c,10);h=Number.isNaN(d)?void 0:Math.min(d,3)}else N&&(h=Number.isNaN(c)?void 0:Math.min(c,3));if(c!=="true"&&c!=="false"&&h!==void 0&&h<4)return h;const L=g&&h!==void 0&&h>0;if(g&&h===0||a(U)||!L&&"NO_COLOR"in r)return B;if(a(W))return $;if(a(H))return M;if(a(K))return O;const I=h??B;if("TF_BUILD"in r&&"AGENT_NAME"in r)return O;if(r.TERM&&q.test(r.TERM))return I;if((l?n.Deno.build.os:u.platform)==="win32"){if("WT_SESSION"in r)return M;if("ANSICON"in r)return O;try{let d;l?d=n.Deno.osRelease():typeof u.os?.release=="function"?d=u.os.release():d=Z();const y=d.split(".");return Number(y[0])>=10&&Number(y[2])>=10586?Number(y[2])>=14931?M:$:O}catch{}}if("CI"in r)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(d=>d in r)?M:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(d=>d in r)||r.CI_NAME==="codeship"?O:I;if(r.TERMINAL_EMULATOR?.includes("JediTerm"))return M;if("TEAMCITY_VERSION"in r)return z.test(r.TEAMCITY_VERSION)?O:B;if(r.COLORTERM==="truecolor"||r.TERM==="xterm-kitty"||r.TERM==="xterm-ghostty"||r.TERM==="wezterm")return M;if("TERM_PROGRAM"in r){const d=Number.parseInt((r.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(r.TERM_PROGRAM==="iTerm.app")return d>=3?M:$;if(r.TERM_PROGRAM==="Apple_Terminal")return $}if(J.test(r.TERM))return $;let E;return s!==void 0?E=s:l?E=t==="out"?n.Deno.stdout.isTerminal():n.Deno.stderr.isTerminal():"PM2_HOME"in r&&"pm_id"in r?E=!0:E=!!u[`std${t}`]?.isTTY,E&&Q.test(r.TERM)||"COLORTERM"in r?O:I},X=()=>_("out"),ee=()=>_("err");function te({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}const S=(t,e,s)=>e>t?e:Math.min(t,s),re=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,ne=t=>{let[,e]=re.exec(t)??[];const s=e?e.length:0;if(s===3){const n=e.charAt(0),l=e.charAt(1),u=e.charAt(2);e=n+n+l+l+u+u}else if(s!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${t}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const i=Number.parseInt(e,16);return[i>>16&255,i>>8&255,i&255]},k=(t,e,s)=>t===e&&e===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/51)+6*Math.round(e/51)+Math.round(s/51),v=t=>{let e,s,i;if(t<8)return 30+t;if(t<16)return 90+(t-8);if(t>=232)e=s=i=((t-232)*10+8)/255;else{t-=16;const u=t%36;e=Math.floor(t/36)/5,s=Math.floor(u/6)/5,i=u%6/5}const n=Math.max(e,s,i)*2;if(n===0)return 30;const l=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(e));return n===2?l+60:l},A=(t,e,s)=>v(k(t,e,s)),f=39,b=49,x=10,C={close:"",open:""},w=t=>{const e=t>0?(o,g)=>({close:`\x1B[${String(g)}m`,open:`\x1B[${String(o)}m`}):()=>C,s=o=>(g,c,m)=>o(k(Number(g),Number(c),Number(m))),i=o=>g=>{const[c,m,N]=ne(g);return o(c,m,N)};let n=o=>e(`38;5;${String(o)}`,f),l=o=>e(`48;5;${String(o)}`,b),u=(o,g,c)=>e(`38;2;${String(o)};${String(g)};${String(c)}`,f),p=(o,g,c)=>e(`48;2;${String(o)};${String(g)};${String(c)}`,b);t===1?(n=o=>e(v(Number(o)),f),l=o=>e(v(Number(o))+x,b),u=(o,g,c)=>e(A(Number(o),Number(g),Number(c)),f),p=(o,g,c)=>e(A(Number(o),Number(g),Number(c))+x,b)):t===2&&(u=s(n),p=s(l));const T={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),visible:C},a={bgBlack:e(40,b),bgBlackBright:e(100,b),bgBlue:e(44,b),bgBlueBright:e(104,b),bgCyan:e(46,b),bgCyanBright:e(106,b),bgGray:e(100,b),bgGreen:e(42,b),bgGreenBright:e(102,b),bgGrey:e(100,b),bgMagenta:e(45,b),bgMagentaBright:e(105,b),bgRed:e(41,b),bgRedBright:e(101,b),bgWhite:e(47,b),bgWhiteBright:e(107,b),bgYellow:e(43,b),bgYellowBright:e(103,b),black:e(30,f),blackBright:e(90,f),blue:e(34,f),blueBright:e(94,f),cyan:e(36,f),cyanBright:e(96,f),gray:e(90,f),green:e(32,f),greenBright:e(92,f),grey:e(90,f),magenta:e(35,f),magentaBright:e(95,f),red:e(31,f),redBright:e(91,f),white:e(37,f),whiteBright:e(97,f),yellow:e(33,f),yellowBright:e(93,f)},r={bg:o=>l(S(o,0,255)),bgHex:i(p),bgRgb:(o,g,c)=>p(S(o,0,255),S(g,0,255),S(c,0,255)),fg:o=>n(S(o,0,255)),hex:i(u),rgb:(o,g,c)=>u(S(o,0,255),S(g,0,255),S(c,0,255))};return{baseColors:a,baseStyles:T,styleMethods:r}},G=X(),oe=ee();w(G);const ie=(t,e,s)=>{if(e==="")return t;let i=t.indexOf(e);if(i<0)return t;const n=e.length;let l=0,u="";for(;~i;)u+=t.slice(l,i)+s,l=i+n,i=t.indexOf(e,l);return u+t.slice(l)},se=(t,e,s)=>{if(!t)return"";let i;if(t.raw===void 0?i=String(t):i=String.raw(t,...e),i.includes("\x1B"))for(let n=s;n;n=n.props)i=ie(i,n.close,n.open);return i.includes(`
2
- `)&&(i=i.replace(/(\r*\n)/g,`${s.closeStack}$1${s.openStack}`)),s.openStack+i+s.closeStack},P=function(t){const e=t?.level??G,{baseColors:s,baseStyles:i,styleMethods:n}=w(e),l={};let u=null;const p=({props:a},{close:r,open:o})=>{const g=(a?.openStack??"")+o,c=r+(a?.closeStack??""),m=(N,...h)=>se(N,h,m.props);return Object.setPrototypeOf(m,u),m.props={close:r,closeStack:c,open:o,openStack:g,props:a},m.open=g,m.close=c,m},T=a=>String(a);T.strip=a=>a.replaceAll(te(),"");for(const a in s)l[a]={get(){const r=p(this,s[a]);return Object.defineProperty(this,a,{value:r}),r}};for(const a in i)l[a]={get(){const r=p(this,i[a]);return Object.defineProperty(this,a,{value:r}),r}};for(const a in n)l[a]={get(){return(...r)=>p(this,n[a](...r))}};return l.ansi256=l.fg,l.bgAnsi256=l.bg,u=Object.defineProperties({},l),Object.setPrototypeOf(T,u),T},R=new P;new P({level:oe});const ce=R.blue,ue=R.bold,ae=R.cyan,ge=R.dim,fe=R.gray,be=R.green,de=R.grey,he=R.magenta,me=R.red,pe=R.yellow,Oe=(t,e,s,i)=>{try{let n={};const l=j(e,"keystore.json");F(l)&&(n=V(l)),Object.hasOwn(n,t)||(n[t]=new Date().toISOString()),Y(l,n,{overwrite:!0})}catch(n){s.debug({context:[n],message:n instanceof Error?n.message:String(n),prefix:"cache-key-store"})}};export{ge as E,fe as F,be as I,de as K,ce as L,he as Q,me as V,R as e,Oe as f,ue as j,ae as q,pe as s};
2
+ `)&&(i=i.replace(/(\r*\n)/g,`${s.closeStack}$1${s.openStack}`)),s.openStack+i+s.closeStack},P=function(t){const e=t?.level??G,{baseColors:s,baseStyles:i,styleMethods:n}=w(e),l={};let u=null;const p=({props:a},{close:r,open:o})=>{const g=(a?.openStack??"")+o,c=r+(a?.closeStack??""),m=(N,...h)=>se(N,h,m.props);return Object.setPrototypeOf(m,u),m.props={close:r,closeStack:c,open:o,openStack:g,props:a},m.open=g,m.close=c,m},T=a=>String(a);T.strip=a=>a.replaceAll(te(),"");for(const a in s)l[a]={get(){const r=p(this,s[a]);return Object.defineProperty(this,a,{value:r}),r}};for(const a in i)l[a]={get(){const r=p(this,i[a]);return Object.defineProperty(this,a,{value:r}),r}};for(const a in n)l[a]={get(){return(...r)=>p(this,n[a](...r))}};return l.ansi256=l.fg,l.bgAnsi256=l.bg,u=Object.defineProperties({},l),Object.setPrototypeOf(T,u),T},R=new P;new P({level:oe});const ce=R.blue,ue=R.bold,ae=R.cyan,ge=R.dim,fe=R.gray,be=R.green,de=R.grey,he=R.magenta,me=R.red,pe=R.yellow,Oe=(t,e,s,i)=>{try{let n={};const l=j(e,"keystore.json");F(l)&&(n=V(l)),Object.hasOwn(n,t)||(n[t]=new Date().toISOString()),Y(l,n,{overwrite:!0})}catch(n){s.debug({context:[n],message:n instanceof Error?n.message:String(n),prefix:"cache-key-store"})}};export{ge as E,fe as F,be as I,de as K,ce as L,he as Q,me as V,Oe as f,ue as j,ae as q,pe as s};