just-bash 2.5.3 → 2.5.5

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.
@@ -0,0 +1,16 @@
1
+ function _(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,s)=>{if(i==="&")return n[0];if(s!==void 0)return n.groups?.[s]??"";let d=parseInt(i,10);return n[d]??""})}function F(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:s=!1,countOnly:d=!1,countMatches:$=!1,filename:h="",onlyMatching:I=!1,beforeContext:z=0,afterContext:O=0,maxCount:A=0,contextSeparator:Z="--",showColumn:P=!1,vimgrep:E=!1,showByteOffset:S=!1,replace:b=null,passthru:R=!1,multiline:T=!1,kResetGroup:k}=e;if(T)return K(t,n,{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:S,replace:b,kResetGroup:k});let m=t.split(`
2
+ `),j=m.length,v=j>0&&m[j-1]===""?j-1:j;if(d||$){let f=0,a=($||I)&&!i;for(let l=0;l<v;l++)if(n.lastIndex=0,a)for(let u=n.exec(m[l]);u!==null;u=n.exec(m[l]))f++,u[0].length===0&&n.lastIndex++;else n.test(m[l])!==i&&f++;return{output:`${h?`${h}:${f}`:String(f)}
3
+ `,matched:f>0,matchCount:f}}if(z===0&&O===0&&!R){let f=[],a=!1,o=0,l=0;for(let u=0;u<v&&!(A>0&&o>=A);u++){let L=m[u];if(n.lastIndex=0,n.test(L)!==i)if(a=!0,o++,I){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=k!==void 0?r[k]??"":r[0],N=b!==null?_(b,r):M,y=h?`${h}:`:"";S&&(y+=`${l+r.index}:`),s&&(y+=`${u+1}:`),P&&(y+=`${r.index+1}:`),f.push(y+N),r[0].length===0&&n.lastIndex++}}else if(E){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=h?`${h}:`:"";S&&(M+=`${l+r.index}:`),s&&(M+=`${u+1}:`),P&&(M+=`${r.index+1}:`),f.push(M+L),r[0].length===0&&n.lastIndex++}}else{n.lastIndex=0;let r=n.exec(L),M=r?r.index+1:1,N=L;b!==null&&(n.lastIndex=0,N=L.replace(n,(...w)=>{if(w[0].length===0)return"";let U=w,B=w[w.length-1];return typeof B=="object"&&B!==null?(U.groups=B,U.input=w[w.length-2],U.index=w[w.length-3]):(U.input=w[w.length-1],U.index=w[w.length-2]),_(b,U)}));let y=h?`${h}:`:"";S&&(y+=`${l+(r?r.index:0)}:`),s&&(y+=`${u+1}:`),P&&(y+=`${M}:`),f.push(y+N)}l+=L.length+1}return{output:f.length>0?`${f.join(`
4
+ `)}
5
+ `:"",matched:a,matchCount:o}}if(R){let f=[],a=!1,o=0;for(let l=0;l<v;l++){let u=m[l];n.lastIndex=0;let G=n.test(u)!==i;G&&(a=!0,o++);let r=G?":":"-",M=h?`${h}${r}`:"";s&&(M+=`${l+1}${r}`),f.push(M+u)}return{output:f.length>0?`${f.join(`
6
+ `)}
7
+ `:"",matched:a,matchCount:o}}let x=[],C=0,p=new Set,g=-1,c=[];for(let f=0;f<v&&!(A>0&&C>=A);f++)n.lastIndex=0,n.test(m[f])!==i&&(c.push(f),C++);for(let f of c){let a=Math.max(0,f-z);g>=0&&a>g+1&&x.push(Z);for(let l=a;l<f;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}if(!p.has(f)){p.add(f),g=f;let l=m[f];if(I){n.lastIndex=0;for(let u=n.exec(l);u!==null;u=n.exec(l)){let L=k!==void 0?u[k]??"":u[0],G=b!==null?b:L,r=h?`${h}:`:"";s&&(r+=`${f+1}:`),P&&(r+=`${u.index+1}:`),x.push(r+G),u[0].length===0&&n.lastIndex++}}else{let u=l;s&&(u=`${f+1}:${u}`),h&&(u=`${h}:${u}`),x.push(u)}}let o=Math.min(v-1,f+O);for(let l=f+1;l<=o;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}}return{output:x.length>0?`${x.join(`
8
+ `)}
9
+ `:"",matched:C>0,matchCount:C}}function K(t,n,e){let{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:E,replace:S,kResetGroup:b}=e,R=t.split(`
10
+ `),T=R.length,k=T>0&&R[T-1]===""?T-1:T,m=[0];for(let c=0;c<t.length;c++)t[c]===`
11
+ `&&m.push(c+1);let j=c=>{let f=0;for(let a=0;a<m.length&&!(m[a]>c);a++)f=a;return f},v=c=>{let f=j(c);return c-m[f]+1},x=[];n.lastIndex=0;for(let c=n.exec(t);c!==null&&!(A>0&&x.length>=A);c=n.exec(t)){let f=j(c.index),a=j(c.index+Math.max(0,c[0].length-1)),o=b!==void 0?c[b]??"":c[0];x.push({startLine:f,endLine:a,byteOffset:c.index,column:v(c.index),matchText:o}),c[0].length===0&&n.lastIndex++}if(d||$){let c;if($)c=i?0:x.length;else{let a=new Set;for(let o of x)for(let l=o.startLine;l<=o.endLine;l++)a.add(l);c=i?k-a.size:a.size}return{output:`${h?`${h}:${c}`:String(c)}
12
+ `,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let a of x)for(let o=a.startLine;o<=a.endLine;o++)c.add(o);let f=[];for(let a=0;a<k;a++)if(!c.has(a)){let o=R[a];s&&(o=`${a+1}:${o}`),h&&(o=`${h}:${o}`),f.push(o)}return{output:f.length>0?`${f.join(`
13
+ `)}
14
+ `:"",matched:f.length>0,matchCount:f.length}}if(x.length===0)return{output:"",matched:!1,matchCount:0};let C=new Set,p=-1,g=[];for(let c of x){let f=Math.max(0,c.startLine-z),a=Math.min(k-1,c.endLine+O);p>=0&&f>p+1&&g.push(Z);for(let o=f;o<c.startLine;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}if(I){let o=S!==null?S:c.matchText,l=h?`${h}:`:"";E&&(l+=`${c.byteOffset}:`),s&&(l+=`${c.startLine+1}:`),P&&(l+=`${c.column}:`),g.push(l+o);for(let u=c.startLine;u<=c.endLine;u++)C.add(u),p=u}else for(let o=c.startLine;o<=c.endLine&&o<k;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];S!==null&&o===c.startLine&&(n.lastIndex=0,l=l.replace(n,S));let u=h?`${h}:`:"";E&&o===c.startLine&&(u+=`${c.byteOffset}:`),s&&(u+=`${o+1}:`),P&&o===c.startLine&&(u+=`${c.column}:`),g.push(u+l)}for(let o=c.endLine+1;o<=a;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}}return{output:g.length>0?`${g.join(`
15
+ `)}
16
+ `:"",matched:!0,matchCount:x.length}}function Q(t,n){let e,i;switch(n.mode){case"fixed":e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=t.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),n.mode==="perl"){e=q(e),e=D(e),e=W(e);let $=X(e);e=$.pattern,i=$.kResetGroup}break}default:e=ne(t);break}n.wholeWord&&(e=`(?<![\\w])(?:${e})(?![\\w])`),n.lineRegexp&&(e=`^${e}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(e),d="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(s?"u":"");return{regex:new RegExp(e,d),kResetGroup:i}}function q(t){let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="Q"){e+=2;let i="";for(;e<t.length;){if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="E"){e+=2;break}i+=t[e],e++}n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else n+=t[e],e++;return n}function D(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function W(t){let n="",e=0;for(;e<t.length;){if(t[e]==="("&&e+1<t.length&&t[e+1]==="?"){let i=t.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let s=i[1]||"",d=i[2]||"",$=i[3];if($===":"){let h=e+i[0].length-1,I=H(t,e);if(I!==-1){let z=t.slice(h+1,I),O=J(z,s,d);n+=`(?:${O})`,e=I+1;continue}}else if($===")"||$===""){e+=i[0].length;continue}}}n+=t[e],e++}return n}function H(t,n){let e=0,i=n;for(;i<t.length;){if(t[i]==="\\"){i+=2;continue}if(t[i]==="["){for(i++;i<t.length&&t[i]!=="]";)t[i]==="\\"&&i++,i++;i++;continue}if(t[i]==="(")e++;else if(t[i]===")"&&(e--,e===0))return i;i++}return-1}function J(t,n,e){let i=t;return n.includes("i")&&(i=V(i)),i}function V(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"){e+1<t.length?(n+=i+t[e+1],e+=2):(n+=i,e++);continue}if(i==="["){n+=i,e++,e<t.length&&t[e]==="^"&&(n+=t[e],e++);let s=[];for(;e<t.length&&t[e]!=="]";)if(t[e]==="\\")s.push(t[e]),e++,e<t.length&&(s.push(t[e]),e++);else if(t[e]==="-"&&s.length>0&&e+1<t.length&&t[e+1]!=="]"){let d=s[s.length-1],$=t[e+1];s.push("-"),s.push($),/[a-z]/.test(d)&&/[a-z]/.test($)?(s.push(d.toUpperCase()),s.push("-"),s.push($.toUpperCase())):/[A-Z]/.test(d)&&/[A-Z]/.test($)&&(s.push(d.toLowerCase()),s.push("-"),s.push($.toLowerCase())),e+=2}else{let d=t[e];if(s.push(d),/[a-zA-Z]/.test(d)){let $=d===d.toLowerCase()?d.toUpperCase():d.toLowerCase();s.includes($)||s.push($)}e++}n+=s.join(""),e<t.length&&(n+=t[e],e++);continue}if(/[a-zA-Z]/.test(i)){let s=i.toLowerCase(),d=i.toUpperCase();n+=`[${d}${s}]`}else n+=i;e++}return n}function X(t){let n=Y(t);if(n===-1)return{pattern:t};let e=t.slice(0,n),i=t.slice(n+2),s=ee(e);return{pattern:`(?:${e})(${i})`,kResetGroup:s+1}}function Y(t){let n=0;for(;n<t.length-1;)if(t[n]==="\\"){if(t[n+1]==="K"){let e=0,i=n-1;for(;i>=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ee(t){let n=0,e=0;for(;e<t.length;){if(t[e]==="\\"){e+=2;continue}if(t[e]==="["){for(e++;e<t.length&&t[e]!=="]";)t[e]==="\\"&&e++,e++;e++;continue}if(t[e]==="(")if(e+1<t.length&&t[e+1]==="?"){if(e+2<t.length){let i=t[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<t.length){let s=t[e+3];if(s==="="||s==="!"){e++;continue}n++,e++;continue}}}else n++;e++}return n}function te(t){let n=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return n=n.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function ne(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"&&e+1<t.length){let s=t[e+1];if(s==="|"||s==="("||s===")"){n+=s,e+=2;continue}else if(s==="{"||s==="}"){n+=`\\${s}`,e+=2;continue}}i==="+"||i==="?"||i==="|"||i==="("||i===")"||i==="{"||i==="}"?n+=`\\${i}`:n+=i,e++}return n}export{F as a,Q as b,te as c};
@@ -1,4 +1,4 @@
1
- import{a as y}from"./chunk-UJMN5NLH.js";import{a as S,b as z}from"./chunk-PINJ2PBS.js";import{a as _,b as j,c as G}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
1
+ import{a as y}from"./chunk-UJMN5NLH.js";import{a as S,b as z}from"./chunk-BOJ3OAZB.js";import{a as _,b as j,c as G}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
2
2
  `,exitCode:2};let V=T?"fixed":u?"extended":p?"perl":"basic",U,b;try{let r=z(N,{mode:V,ignoreCase:o,wholeWord:d,lineRegexp:w});U=r.regex,b=r.kResetGroup}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${N}
3
3
  `,exitCode:2}}if(I.length===0&&s.stdin){let r=S(s.stdin,U,{invertMatch:c,showLineNumbers:f,countOnly:h,filename:"",onlyMatching:x,beforeContext:R,afterContext:F,maxCount:M,kResetGroup:b});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
4
4
  `,exitCode:2};let $="",D="",H=!1,k=!1,P=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let n=await se(r,s);if(i)for(let C of n){let a=await O(C.path,s,W,A,Q,C.isFile);P.push(...a)}else P.push(...n)}else if(i){let n=await O(r,s,W,A,Q);P.push(...n)}else P.push({path:r});let X=(P.length>1||i)&&!q,Z=50;for(let r=0;r<P.length;r+=Z){let n=P.slice(r,r+Z),C=await Promise.all(n.map(async a=>{let g=a.path,e=g.split("/").pop()||g;if(A.length>0&&!i&&A.some(v=>y(e,v,{stripQuotes:!0}))||W.length>0&&!i&&!W.some(v=>y(e,v,{stripQuotes:!0})))return null;try{let v=s.fs.resolvePath(s.cwd,g),L=!1;if(a.isFile===void 0?L=(await s.fs.stat(v)).isDirectory:L=!a.isFile,L)return i?null:{error:`grep: ${g}: Is a directory
@@ -1,4 +1,4 @@
1
- import{a as E,b as A,c as z}from"./chunk-PINJ2PBS.js";import{a as L,b as _,c as j}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let s=t.slice(0,n),r=t.slice(n+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let o=this.types.get(s)||{extensions:[],globs:[]};o.extensions.push(...i.extensions),o.globs.push(...i.globs),this.types.set(s,o)}}else{let l=this.types.get(s)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(s,l)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let s=t.toLowerCase();for(let r of n){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let l=this.types.get(r);if(l){for(let i of l.extensions)if(s.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let o=i.replace(/\./g,"\\.").replace(/\*/g,".*");if(new RegExp(`^${o}$`,"i").test(t))return!0}else if(s===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let s of this.types.values()){for(let r of s.extensions)if(n.endsWith(r))return!0;for(let r of s.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).sort()){let s=[];for(let r of n.extensions)s.push(`*${r}`);for(let r of n.globs)s.push(r);e.push(`${t}: ${s.join(", ")}`)}return`${e.join(`
1
+ import{a as E,b as A,c as z}from"./chunk-BOJ3OAZB.js";import{a as L,b as _,c as j}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let s=t.slice(0,n),r=t.slice(n+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let o=this.types.get(s)||{extensions:[],globs:[]};o.extensions.push(...i.extensions),o.globs.push(...i.globs),this.types.set(s,o)}}else{let l=this.types.get(s)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(s,l)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let s=t.toLowerCase();for(let r of n){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let l=this.types.get(r);if(l){for(let i of l.extensions)if(s.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let o=i.replace(/\./g,"\\.").replace(/\*/g,".*");if(new RegExp(`^${o}$`,"i").test(t))return!0}else if(s===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let s of this.types.values()){for(let r of s.extensions)if(n.endsWith(r))return!0;for(let r of s.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).sort()){let s=[];for(let r of n.extensions)s.push(`*${r}`);for(let r of n.globs)s.push(r);e.push(`${t}: ${s.join(", ")}`)}return`${e.join(`
2
2
  `)}
3
3
  `}function U(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:1/0,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function X(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function Q(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
4
4
  `,exitCode:1}}function q(e){return null}var V=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:q},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:q},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:X,validate:Q},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",target:"maxDepth",parse:()=>1/0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],ee={i:e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1},"--ignore-case":e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1},s:e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1},"--case-sensitive":e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1},S:e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1},"--smart-case":e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1},F:e=>{e.fixedStrings=!0},"--fixed-strings":e=>{e.fixedStrings=!0},w:e=>{e.wordRegexp=!0},"--word-regexp":e=>{e.wordRegexp=!0},x:e=>{e.lineRegexp=!0},"--line-regexp":e=>{e.lineRegexp=!0},v:e=>{e.invertMatch=!0},"--invert-match":e=>{e.invertMatch=!0},U:e=>{e.multiline=!0},"--multiline":e=>{e.multiline=!0},"--multiline-dotall":e=>{e.multilineDotall=!0,e.multiline=!0},c:e=>{e.count=!0},"--count":e=>{e.count=!0},"--count-matches":e=>{e.countMatches=!0},l:e=>{e.filesWithMatches=!0},"--files":e=>{e.files=!0},"--files-with-matches":e=>{e.filesWithMatches=!0},"--files-without-match":e=>{e.filesWithoutMatch=!0},"--stats":e=>{e.stats=!0},o:e=>{e.onlyMatching=!0},"--only-matching":e=>{e.onlyMatching=!0},q:e=>{e.quiet=!0},"--quiet":e=>{e.quiet=!0},N:e=>{e.lineNumber=!1},"--no-line-number":e=>{e.lineNumber=!1},H:e=>{e.withFilename=!0},"--with-filename":e=>{e.withFilename=!0},I:e=>{e.noFilename=!0},"--no-filename":e=>{e.noFilename=!0},0:e=>{e.nullSeparator=!0},"--null":e=>{e.nullSeparator=!0},b:e=>{e.byteOffset=!0},"--byte-offset":e=>{e.byteOffset=!0},"--column":e=>{e.column=!0,e.lineNumber=!0},"--no-column":e=>{e.column=!1},"--vimgrep":e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0},"--json":e=>{e.json=!0},"--hidden":e=>{e.hidden=!0},"--no-ignore":e=>{e.noIgnore=!0},"--no-ignore-dot":e=>{e.noIgnoreDot=!0},"--no-ignore-vcs":e=>{e.noIgnoreVcs=!0},L:e=>{e.followSymlinks=!0},"--follow":e=>{e.followSymlinks=!0},z:e=>{e.searchZip=!0},"--search-zip":e=>{e.searchZip=!0},a:e=>{e.searchBinary=!0},"--text":e=>{e.searchBinary=!0},"--heading":e=>{e.heading=!0},"--passthru":e=>{e.passthru=!0},"--include-zero":e=>{e.includeZero=!0},"--glob-case-insensitive":e=>{e.globCaseInsensitive=!0}},te=new Set(["n","--line-number"]);function se(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function ne(e,t,n){let s=e[t];for(let r of V){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=D(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s.startsWith(`-${r.short}`)&&s.length>2){let l=s.slice(2),i=D(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s===`-${r.short}`||s===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=D(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function re(e){return V.find(t=>t.short===e)}function D(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ie(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let s=e[t+1];if(s==="path"||s==="none")return{value:s,newIndex:t+1}}if(n.startsWith("--sort=")){let s=n.slice(7);if(s==="path"||s==="none")return{value:s,newIndex:t}}return null}function le(e,t){let n=e[t],s=n.match(/^-([ABC])(\d+)$/);return s?{flag:s[1],value:parseInt(s[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function oe(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function Z(e){let t=U(),n=null,s=[],r=-1,l=-1,i=-1,o=!1;for(let c=0;c<e.length;c++){let a=e[c];if(a.startsWith("-")&&a!=="-"){let u=le(e,c);if(u){let{flag:f,value:x,newIndex:b}=u;f==="A"?r=Math.max(r,x):f==="B"?l=Math.max(l,x):i=x,c=b;continue}let m=oe(a);if(m!==null){t.maxCount=m;continue}let p=ne(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ie(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=a.startsWith("--")?[a]:a.slice(1).split(""),d=!1;for(let f of w){if(te.has(f)){t.lineNumber=!0,o=!0;continue}if(f==="u"||f==="--unrestricted"){se(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.