Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
library/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

28 lines
49 KiB
JavaScript

/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-workspace-tools",
factory: function (require) {
var plugin=(()=>{var Cr=Object.create,ge=Object.defineProperty,wr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptor,vr=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertyNames,Je=Object.getOwnPropertySymbols,$r=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable;var tt=(e,t,r)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t)=>{for(var r in t||(t={}))et.call(t,r)&&tt(e,r,t[r]);if(Je)for(var r of Je(t))Tr.call(t,r)&&tt(e,r,t[r]);return e},j=(e,t)=>wr(e,vr(t)),Lr=e=>ge(e,"__esModule",{value:!0});var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kr=(e,t)=>{for(var r in t)ge(e,r,{get:t[r],enumerable:!0})},Or=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Hr(t))!et.call(e,n)&&n!=="default"&&ge(e,n,{get:()=>t[n],enumerable:!(r=Sr(t,n))||r.enumerable});return e},Y=e=>Or(Lr(ge(e!=null?Cr($r(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var He=G(ee=>{"use strict";ee.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;ee.find=(e,t)=>e.nodes.find(r=>r.type===t);ee.exceedsLimit=(e,t,r=1,n)=>n===!1||!ee.isInteger(e)||!ee.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;ee.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];!n||(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ee.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):!1;ee.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0==0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;ee.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;ee.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);ee.flatten=(...e)=>{let t=[],r=n=>{for(let s=0;s<n.length;s++){let a=n[s];Array.isArray(a)?r(a,t):a!==void 0&&t.push(a)}return t};return r(e),t}});var $e=G((as,st)=>{"use strict";var at=He();st.exports=(e,t={})=>{let r=(n,s={})=>{let a=t.escapeInvalid&&at.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o="";if(n.value)return(a||i)&&at.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let h of n.nodes)o+=r(h);return o};return r(e)}});var ot=G((is,it)=>{"use strict";it.exports=function(e){return typeof e=="number"?e-e==0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var At=G((os,ut)=>{"use strict";var ct=ot(),pe=(e,t,r)=>{if(ct(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(ct(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n=O({relaxZeros:!0},r);typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),a=String(n.shorthand),i=String(n.capture),o=String(n.wrap),h=e+":"+t+"="+s+a+i+o;if(pe.cache.hasOwnProperty(h))return pe.cache[h].result;let g=Math.min(e,t),f=Math.max(e,t);if(Math.abs(g-f)===1){let m=e+"|"+t;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let R=pt(e)||pt(t),p={min:e,max:t,a:g,b:f},$=[],_=[];if(R&&(p.isPadded=R,p.maxLen=String(p.max).length),g<0){let m=f<0?Math.abs(f):1;_=lt(m,Math.abs(g),p,n),g=p.a=0}return f>=0&&($=lt(g,f,p,n)),p.negatives=_,p.positives=$,p.result=Nr(_,$,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&$.length+_.length>1&&(p.result=`(?:${p.result})`),pe.cache[h]=p,p.result};function Nr(e,t,r){let n=Me(e,t,"-",!1,r)||[],s=Me(t,e,"",!1,r)||[],a=Me(e,t,"-?",!0,r)||[];return n.concat(a).concat(s).join("|")}function Br(e,t){let r=1,n=1,s=ft(e,r),a=new Set([t]);for(;e<=s&&s<=t;)a.add(s),r+=1,s=ft(e,r);for(s=ht(t+1,n)-1;e<s&&s<=t;)a.add(s),n+=1,s=ht(t+1,n)-1;return a=[...a],a.sort(Ir),a}function Dr(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Mr(e,t),s=n.length,a="",i=0;for(let o=0;o<s;o++){let[h,g]=n[o];h===g?a+=h:h!=="0"||g!=="9"?a+=Pr(h,g,r):i++}return i&&(a+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[i],digits:s}}function lt(e,t,r,n){let s=Br(e,t),a=[],i=e,o;for(let h=0;h<s.length;h++){let g=s[h],f=Dr(String(i),String(g),n),R="";if(!r.isPadded&&o&&o.pattern===f.pattern){o.count.length>1&&o.count.pop(),o.count.push(f.count[0]),o.string=o.pattern+dt(o.count),i=g+1;continue}r.isPadded&&(R=Gr(g,r,n)),f.string=R+f.pattern+dt(f.count),a.push(f),i=g+1,o=f}return a}function Me(e,t,r,n,s){let a=[];for(let i of e){let{string:o}=i;!n&&!gt(t,"string",o)&&a.push(r+o),n&&gt(t,"string",o)&&a.push(r+o)}return a}function Mr(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Ir(e,t){return e>t?1:t>e?-1:0}function gt(e,t,r){return e.some(n=>n[t]===r)}function ft(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function ht(e,t){return e-e%Math.pow(10,t)}function dt(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Pr(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function pt(e){return/^-?(0+)\d/.test(e)}function Gr(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}pe.cache={};pe.clearCache=()=>pe.cache={};ut.exports=pe});var Ge=G((us,Rt)=>{"use strict";var Ur=require("util"),mt=At(),yt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),qr=e=>t=>e===!0?Number(t):String(t),Pe=e=>typeof e=="number"||typeof e=="string"&&e!=="",Re=e=>Number.isInteger(+e),De=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Kr=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Wr=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},_t=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},jr=(e,t)=>{e.negatives.sort((i,o)=>i<o?-1:i>o?1:0),e.positives.sort((i,o)=>i<o?-1:i>o?1:0);let r=t.capture?"":"?:",n="",s="",a;return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n&&s?a=`${n}|${s}`:a=n||s,t.wrap?`(${r}${a})`:a},Et=(e,t,r,n)=>{if(r)return mt(e,t,O({wrap:!1},n));let s=String.fromCharCode(e);if(e===t)return s;let a=String.fromCharCode(t);return`[${s}-${a}]`},xt=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${e.join("|")})`:e.join("|")}return mt(e,t,r)},bt=(...e)=>new RangeError("Invalid range arguments: "+Ur.inspect(...e)),Ct=(e,t,r)=>{if(r.strictRanges===!0)throw bt([e,t]);return[]},Fr=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Qr=(e,t,r=1,n={})=>{let s=Number(e),a=Number(t);if(!Number.isInteger(s)||!Number.isInteger(a)){if(n.strictRanges===!0)throw bt([e,t]);return[]}s===0&&(s=0),a===0&&(a=0);let i=s>a,o=String(e),h=String(t),g=String(r);r=Math.max(Math.abs(r),1);let f=De(o)||De(h)||De(g),R=f?Math.max(o.length,h.length,g.length):0,p=f===!1&&Kr(e,t,n)===!1,$=n.transform||qr(p);if(n.toRegex&&r===1)return Et(_t(e,R),_t(t,R),!0,n);let _={negatives:[],positives:[]},m=b=>_[b<0?"negatives":"positives"].push(Math.abs(b)),x=[],S=0;for(;i?s>=a:s<=a;)n.toRegex===!0&&r>1?m(s):x.push(Wr($(s,S),R,p)),s=i?s-r:s+r,S++;return n.toRegex===!0?r>1?jr(_,n):xt(x,null,O({wrap:!1},n)):x},Xr=(e,t,r=1,n={})=>{if(!Re(e)&&e.length>1||!Re(t)&&t.length>1)return Ct(e,t,n);let s=n.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),o=a>i,h=Math.min(a,i),g=Math.max(a,i);if(n.toRegex&&r===1)return Et(h,g,!1,n);let f=[],R=0;for(;o?a>=i:a<=i;)f.push(s(a,R)),a=o?a-r:a+r,R++;return n.toRegex===!0?xt(f,null,{wrap:!1,options:n}):f},Te=(e,t,r,n={})=>{if(t==null&&Pe(e))return[e];if(!Pe(e)||!Pe(t))return Ct(e,t,n);if(typeof r=="function")return Te(e,t,1,{transform:r});if(yt(r))return Te(e,t,0,r);let s=O({},n);return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Re(r)?Re(e)&&Re(t)?Qr(e,t,r,s):Xr(e,t,Math.max(Math.abs(r),1),s):r!=null&&!yt(r)?Fr(r,s):Te(e,t,1,r)};Rt.exports=Te});var vt=G((cs,wt)=>{"use strict";var Zr=Ge(),St=He(),Yr=(e,t={})=>{let r=(n,s={})=>{let a=St.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o=a===!0||i===!0,h=t.escapeInvalid===!0?"\\":"",g="";if(n.isOpen===!0||n.isClose===!0)return h+n.value;if(n.type==="open")return o?h+n.value:"(";if(n.type==="close")return o?h+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":o?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let f=St.reduce(n.nodes),R=Zr(...f,j(O({},t),{wrap:!1,toRegex:!0}));if(R.length!==0)return f.length>1&&R.length>1?`(${R})`:R}if(n.nodes)for(let f of n.nodes)g+=r(f,n);return g};return r(e)};wt.exports=Yr});var Tt=G((ls,Ht)=>{"use strict";var zr=Ge(),$t=$e(),he=He(),fe=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?he.flatten(t).map(s=>`{${s}}`):t;for(let s of e)if(Array.isArray(s))for(let a of s)n.push(fe(a,t,r));else for(let a of t)r===!0&&typeof a=="string"&&(a=`{${a}}`),n.push(Array.isArray(a)?fe(s,a,r):s+a);return he.flatten(n)},Vr=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(s,a={})=>{s.queue=[];let i=a,o=a.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,o=i.queue;if(s.invalid||s.dollar){o.push(fe(o.pop(),$t(s,t)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){o.push(fe(o.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let R=he.reduce(s.nodes);if(he.exceedsLimit(...R,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=zr(...R,t);p.length===0&&(p=$t(s,t)),o.push(fe(o.pop(),p)),s.nodes=[];return}let h=he.encloseBrace(s),g=s.queue,f=s;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,g=f.queue;for(let R=0;R<s.nodes.length;R++){let p=s.nodes[R];if(p.type==="comma"&&s.type==="brace"){R===1&&g.push(""),g.push("");continue}if(p.type==="close"){o.push(fe(o.pop(),g,h));continue}if(p.value&&p.type!=="open"){g.push(fe(g.pop(),p.value));continue}p.nodes&&n(p,s)}return g};return he.flatten(n(e))};Ht.exports=Vr});var kt=G((ps,Lt)=>{"use strict";Lt.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Mt=G((fs,Ot)=>{"use strict";var Jr=$e(),{MAX_LENGTH:Nt,CHAR_BACKSLASH:Ue,CHAR_BACKTICK:en,CHAR_COMMA:tn,CHAR_DOT:rn,CHAR_LEFT_PARENTHESES:nn,CHAR_RIGHT_PARENTHESES:sn,CHAR_LEFT_CURLY_BRACE:an,CHAR_RIGHT_CURLY_BRACE:on,CHAR_LEFT_SQUARE_BRACKET:It,CHAR_RIGHT_SQUARE_BRACKET:Bt,CHAR_DOUBLE_QUOTE:un,CHAR_SINGLE_QUOTE:cn,CHAR_NO_BREAK_SPACE:ln,CHAR_ZERO_WIDTH_NOBREAK_SPACE:pn}=kt(),fn=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Nt,r.maxLength):Nt;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let s={type:"root",input:e,nodes:[]},a=[s],i=s,o=s,h=0,g=e.length,f=0,R=0,p,$={},_=()=>e[f++],m=x=>{if(x.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&x.type==="text"){o.value+=x.value;return}return i.nodes.push(x),x.parent=i,x.prev=o,o=x,x};for(m({type:"bos"});f<g;)if(i=a[a.length-1],p=_(),!(p===pn||p===ln)){if(p===Ue){m({type:"text",value:(t.keepEscaping?p:"")+_()});continue}if(p===Bt){m({type:"text",value:"\\"+p});continue}if(p===It){h++;let x=!0,S;for(;f<g&&(S=_());){if(p+=S,S===It){h++;continue}if(S===Ue){p+=_();continue}if(S===Bt&&(h--,h===0))break}m({type:"text",value:p});continue}if(p===nn){i=m({type:"paren",nodes:[]}),a.push(i),m({type:"text",value:p});continue}if(p===sn){if(i.type!=="paren"){m({type:"text",value:p});continue}i=a.pop(),m({type:"text",value:p}),i=a[a.length-1];continue}if(p===un||p===cn||p===en){let x=p,S;for(t.keepQuotes!==!0&&(p="");f<g&&(S=_());){if(S===Ue){p+=S+_();continue}if(S===x){t.keepQuotes===!0&&(p+=S);break}p+=S}m({type:"text",value:p});continue}if(p===an){R++;let x=o.value&&o.value.slice(-1)==="$"||i.dollar===!0;i=m({type:"brace",open:!0,close:!1,dollar:x,depth:R,commas:0,ranges:0,nodes:[]}),a.push(i),m({type:"open",value:p});continue}if(p===on){if(i.type!=="brace"){m({type:"text",value:p});continue}let x="close";i=a.pop(),i.close=!0,m({type:x,value:p}),R--,i=a[a.length-1];continue}if(p===tn&&R>0){if(i.ranges>0){i.ranges=0;let x=i.nodes.shift();i.nodes=[x,{type:"text",value:Jr(i)}]}m({type:"comma",value:p}),i.commas++;continue}if(p===rn&&R>0&&i.commas===0){let x=i.nodes;if(R===0||x.length===0){m({type:"text",value:p});continue}if(o.type==="dot"){if(i.range=[],o.value+=p,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){x.pop();let S=x[x.length-1];S.value+=o.value+p,o=S,i.ranges--;continue}m({type:"dot",value:p});continue}m({type:"text",value:p})}do if(i=a.pop(),i.type!=="root"){i.nodes.forEach(b=>{b.nodes||(b.type==="open"&&(b.isOpen=!0),b.type==="close"&&(b.isClose=!0),b.nodes||(b.type="text"),b.invalid=!0)});let x=a[a.length-1],S=x.nodes.indexOf(i);x.nodes.splice(S,1,...i.nodes)}while(a.length>0);return m({type:"eos"}),s};Ot.exports=fn});var Gt=G((hs,Pt)=>{"use strict";var Dt=$e(),hn=vt(),dn=Tt(),gn=Mt(),z=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let s=z.create(n,t);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(z.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};z.parse=(e,t={})=>gn(e,t);z.stringify=(e,t={})=>typeof e=="string"?Dt(z.parse(e,t),t):Dt(e,t);z.compile=(e,t={})=>(typeof e=="string"&&(e=z.parse(e,t)),hn(e,t));z.expand=(e,t={})=>{typeof e=="string"&&(e=z.parse(e,t));let r=dn(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};z.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?z.compile(e,t):z.expand(e,t);Pt.exports=z});var me=G((ds,Ut)=>{"use strict";var An=require("path"),se="\\\\/",qt=`[^${se}]`,oe="\\.",Rn="\\+",mn="\\?",Le="\\/",yn="(?=.)",Kt="[^/]",qe=`(?:${Le}|$)`,Wt=`(?:^|${Le})`,Ke=`${oe}{1,2}${qe}`,_n=`(?!${oe})`,En=`(?!${Wt}${Ke})`,xn=`(?!${oe}{0,1}${qe})`,bn=`(?!${Ke})`,Cn=`[^.${Le}]`,wn=`${Kt}*?`,jt={DOT_LITERAL:oe,PLUS_LITERAL:Rn,QMARK_LITERAL:mn,SLASH_LITERAL:Le,ONE_CHAR:yn,QMARK:Kt,END_ANCHOR:qe,DOTS_SLASH:Ke,NO_DOT:_n,NO_DOTS:En,NO_DOT_SLASH:xn,NO_DOTS_SLASH:bn,QMARK_NO_DOT:Cn,STAR:wn,START_ANCHOR:Wt},Sn=j(O({},jt),{SLASH_LITERAL:`[${se}]`,QMARK:qt,STAR:`${qt}*?`,DOTS_SLASH:`${oe}{1,2}(?:[${se}]|$)`,NO_DOT:`(?!${oe})`,NO_DOTS:`(?!(?:^|[${se}])${oe}{1,2}(?:[${se}]|$))`,NO_DOT_SLASH:`(?!${oe}{0,1}(?:[${se}]|$))`,NO_DOTS_SLASH:`(?!${oe}{1,2}(?:[${se}]|$))`,QMARK_NO_DOT:`[^.${se}]`,START_ANCHOR:`(?:^|[${se}])`,END_ANCHOR:`(?:[${se}]|$)`}),vn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ut.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:vn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:An.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Sn:jt}}});var ye=G(Q=>{"use strict";var Hn=require("path"),$n=process.platform==="win32",{REGEX_BACKSLASH:Tn,REGEX_REMOVE_BACKSLASH:Ln,REGEX_SPECIAL_CHARS:kn,REGEX_SPECIAL_CHARS_GLOBAL:On}=me();Q.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);Q.hasRegexChars=e=>kn.test(e);Q.isRegexChar=e=>e.length===1&&Q.hasRegexChars(e);Q.escapeRegex=e=>e.replace(On,"\\$1");Q.toPosixSlashes=e=>e.replace(Tn,"/");Q.removeBackslashes=e=>e.replace(Ln,t=>t==="\\"?"":t);Q.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};Q.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:$n===!0||Hn.sep==="\\";Q.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?Q.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};Q.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};Q.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",a=`${n}(?:${e})${s}`;return t.negated===!0&&(a=`(?:^(?!${a}).*$)`),a}});var er=G((As,Ft)=>{"use strict";var Qt=ye(),{CHAR_ASTERISK:We,CHAR_AT:Nn,CHAR_BACKWARD_SLASH:_e,CHAR_COMMA:In,CHAR_DOT:je,CHAR_EXCLAMATION_MARK:Xt,CHAR_FORWARD_SLASH:Zt,CHAR_LEFT_CURLY_BRACE:Fe,CHAR_LEFT_PARENTHESES:Qe,CHAR_LEFT_SQUARE_BRACKET:Bn,CHAR_PLUS:Mn,CHAR_QUESTION_MARK:Yt,CHAR_RIGHT_CURLY_BRACE:Pn,CHAR_RIGHT_PARENTHESES:zt,CHAR_RIGHT_SQUARE_BRACKET:Dn}=me(),Vt=e=>e===Zt||e===_e,Jt=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?Infinity:1)},Gn=(e,t)=>{let r=t||{},n=e.length-1,s=r.parts===!0||r.scanToEnd===!0,a=[],i=[],o=[],h=e,g=-1,f=0,R=0,p=!1,$=!1,_=!1,m=!1,x=!1,S=!1,b=!1,T=!1,H=!1,X=0,K,y,E={value:"",depth:0,isGlob:!1},U=()=>g>=n,N=()=>h.charCodeAt(g+1),u=()=>(K=y,h.charCodeAt(++g));for(;g<n;){y=u();let c;if(y===_e){b=E.backslashes=!0,y=u(),y===Fe&&(S=!0);continue}if(S===!0||y===Fe){for(X++;U()!==!0&&(y=u());){if(y===_e){b=E.backslashes=!0,u();continue}if(y===Fe){X++;continue}if(S!==!0&&y===je&&(y=u())===je){if(p=E.isBrace=!0,_=E.isGlob=!0,H=!0,s===!0)continue;break}if(S!==!0&&y===In){if(p=E.isBrace=!0,_=E.isGlob=!0,H=!0,s===!0)continue;break}if(y===Pn&&(X--,X===0)){S=!1,p=E.isBrace=!0,H=!0;break}}if(s===!0)continue;break}if(y===Zt){if(a.push(g),i.push(E),E={value:"",depth:0,isGlob:!1},H===!0)continue;if(K===je&&g===f+1){f+=2;continue}R=g+1;continue}if(r.noext!==!0&&(y===Mn||y===Nn||y===We||y===Yt||y===Xt)===!0&&N()===Qe){if(_=E.isGlob=!0,m=E.isExtglob=!0,H=!0,s===!0){for(;U()!==!0&&(y=u());){if(y===_e){b=E.backslashes=!0,y=u();continue}if(y===zt){_=E.isGlob=!0,H=!0;break}}continue}break}if(y===We){if(K===We&&(x=E.isGlobstar=!0),_=E.isGlob=!0,H=!0,s===!0)continue;break}if(y===Yt){if(_=E.isGlob=!0,H=!0,s===!0)continue;break}if(y===Bn){for(;U()!==!0&&(c=u());){if(c===_e){b=E.backslashes=!0,u();continue}if(c===Dn){$=E.isBracket=!0,_=E.isGlob=!0,H=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&y===Xt&&g===f){T=E.negated=!0,f++;continue}if(r.noparen!==!0&&y===Qe){if(_=E.isGlob=!0,s===!0){for(;U()!==!0&&(y=u());){if(y===Qe){b=E.backslashes=!0,y=u();continue}if(y===zt){H=!0;break}}continue}break}if(_===!0){if(H=!0,s===!0)continue;break}}r.noext===!0&&(m=!1,_=!1);let C=h,F="",Z="";f>0&&(F=h.slice(0,f),h=h.slice(f),R-=f),C&&_===!0&&R>0?(C=h.slice(0,R),Z=h.slice(R)):_===!0?(C="",Z=h):C=h,C&&C!==""&&C!=="/"&&C!==h&&Vt(C.charCodeAt(C.length-1))&&(C=C.slice(0,-1)),r.unescape===!0&&(Z&&(Z=Qt.removeBackslashes(Z)),C&&b===!0&&(C=Qt.removeBackslashes(C)));let l={prefix:F,input:e,start:f,base:C,glob:Z,isBrace:p,isBracket:$,isGlob:_,isExtglob:m,isGlobstar:x,negated:T};if(r.tokens===!0&&(l.maxDepth=0,Vt(y)||i.push(E),l.tokens=i),r.parts===!0||r.tokens===!0){let c;for(let M=0;M<a.length;M++){let P=c?c+1:f,te=a[M],re=e.slice(P,te);r.tokens&&(M===0&&f!==0?(i[M].isPrefix=!0,i[M].value=F):i[M].value=re,Jt(i[M]),l.maxDepth+=i[M].depth),(M!==0||re!=="")&&o.push(re),c=te}if(c&&c+1<e.length){let M=e.slice(c+1);o.push(M),r.tokens&&(i[i.length-1].value=M,Jt(i[i.length-1]),l.maxDepth+=i[i.length-1].depth)}l.slashes=a,l.parts=o}return l};Ft.exports=Gn});var sr=G((Rs,tr)=>{"use strict";var ke=me(),V=ye(),{MAX_LENGTH:Oe,POSIX_REGEX_SOURCE:Un,REGEX_NON_SPECIAL_CHARS:qn,REGEX_SPECIAL_CHARS_BACKREF:Kn,REPLACEMENTS:rr}=ke,Wn=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(s=>V.escapeRegex(s)).join("..")}return r},de=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,nr=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=rr[e]||e;let r=O({},t),n=typeof r.maxLength=="number"?Math.min(Oe,r.maxLength):Oe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let a={type:"bos",value:"",output:r.prepend||""},i=[a],o=r.capture?"":"?:",h=V.isWindows(t),g=ke.globChars(h),f=ke.extglobChars(g),{DOT_LITERAL:R,PLUS_LITERAL:p,SLASH_LITERAL:$,ONE_CHAR:_,DOTS_SLASH:m,NO_DOT:x,NO_DOT_SLASH:S,NO_DOTS_SLASH:b,QMARK:T,QMARK_NO_DOT:H,STAR:X,START_ANCHOR:K}=g,y=A=>`(${o}(?:(?!${K}${A.dot?m:R}).)*?)`,E=r.dot?"":x,U=r.dot?T:H,N=r.bash===!0?y(r):X;r.capture&&(N=`(${N})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let u={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=V.removePrefix(e,u),s=e.length;let C=[],F=[],Z=[],l=a,c,M=()=>u.index===s-1,P=u.peek=(A=1)=>e[u.index+A],te=u.advance=()=>e[++u.index],re=()=>e.slice(u.index+1),ie=(A="",L=0)=>{u.consumed+=A,u.index+=L},be=A=>{u.output+=A.output!=null?A.output:A.value,ie(A.value)},xr=()=>{let A=1;for(;P()==="!"&&(P(2)!=="("||P(3)==="?");)te(),u.start++,A++;return A%2==0?!1:(u.negated=!0,u.start++,!0)},Ce=A=>{u[A]++,Z.push(A)},ce=A=>{u[A]--,Z.pop()},w=A=>{if(l.type==="globstar"){let L=u.braces>0&&(A.type==="comma"||A.type==="brace"),d=A.extglob===!0||C.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!L&&!d&&(u.output=u.output.slice(0,-l.output.length),l.type="star",l.value="*",l.output=N,u.output+=l.output)}if(C.length&&A.type!=="paren"&&!f[A.value]&&(C[C.length-1].inner+=A.value),(A.value||A.output)&&be(A),l&&l.type==="text"&&A.type==="text"){l.value+=A.value,l.output=(l.output||"")+A.value;return}A.prev=l,i.push(A),l=A},we=(A,L)=>{let d=j(O({},f[L]),{conditions:1,inner:""});d.prev=l,d.parens=u.parens,d.output=u.output;let v=(r.capture?"(":"")+d.open;Ce("parens"),w({type:A,value:L,output:u.output?"":_}),w({type:"paren",extglob:!0,value:te(),output:v}),C.push(d)},br=A=>{let L=A.close+(r.capture?")":"");if(A.type==="negate"){let d=N;A.inner&&A.inner.length>1&&A.inner.includes("/")&&(d=y(r)),(d!==N||M()||/^\)+$/.test(re()))&&(L=A.close=`)$))${d}`),A.prev.type==="bos"&&(u.negatedExtglob=!0)}w({type:"paren",extglob:!0,value:c,output:L}),ce("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let A=!1,L=e.replace(Kn,(d,v,I,W,D,Be)=>W==="\\"?(A=!0,d):W==="?"?v?v+W+(D?T.repeat(D.length):""):Be===0?U+(D?T.repeat(D.length):""):T.repeat(I.length):W==="."?R.repeat(I.length):W==="*"?v?v+W+(D?N:""):N:v?d:`\\${d}`);return A===!0&&(r.unescape===!0?L=L.replace(/\\/g,""):L=L.replace(/\\+/g,d=>d.length%2==0?"\\\\":d?"\\":"")),L===e&&r.contains===!0?(u.output=e,u):(u.output=V.wrapOutput(L,u,t),u)}for(;!M();){if(c=te(),c==="\0")continue;if(c==="\\"){let d=P();if(d==="/"&&r.bash!==!0||d==="."||d===";")continue;if(!d){c+="\\",w({type:"text",value:c});continue}let v=/^\\+/.exec(re()),I=0;if(v&&v[0].length>2&&(I=v[0].length,u.index+=I,I%2!=0&&(c+="\\")),r.unescape===!0?c=te()||"":c+=te()||"",u.brackets===0){w({type:"text",value:c});continue}}if(u.brackets>0&&(c!=="]"||l.value==="["||l.value==="[^")){if(r.posix!==!1&&c===":"){let d=l.value.slice(1);if(d.includes("[")&&(l.posix=!0,d.includes(":"))){let v=l.value.lastIndexOf("["),I=l.value.slice(0,v),W=l.value.slice(v+2),D=Un[W];if(D){l.value=I+D,u.backtrack=!0,te(),!a.output&&i.indexOf(l)===1&&(a.output=_);continue}}}(c==="["&&P()!==":"||c==="-"&&P()==="]")&&(c=`\\${c}`),c==="]"&&(l.value==="["||l.value==="[^")&&(c=`\\${c}`),r.posix===!0&&c==="!"&&l.value==="["&&(c="^"),l.value+=c,be({value:c});continue}if(u.quotes===1&&c!=='"'){c=V.escapeRegex(c),l.value+=c,be({value:c});continue}if(c==='"'){u.quotes=u.quotes===1?0:1,r.keepQuotes===!0&&w({type:"text",value:c});continue}if(c==="("){Ce("parens"),w({type:"paren",value:c});continue}if(c===")"){if(u.parens===0&&r.strictBrackets===!0)throw new SyntaxError(de("opening","("));let d=C[C.length-1];if(d&&u.parens===d.parens+1){br(C.pop());continue}w({type:"paren",value:c,output:u.parens?")":"\\)"}),ce("parens");continue}if(c==="["){if(r.nobracket===!0||!re().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(de("closing","]"));c=`\\${c}`}else Ce("brackets");w({type:"bracket",value:c});continue}if(c==="]"){if(r.nobracket===!0||l&&l.type==="bracket"&&l.value.length===1){w({type:"text",value:c,output:`\\${c}`});continue}if(u.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(de("opening","["));w({type:"text",value:c,output:`\\${c}`});continue}ce("brackets");let d=l.value.slice(1);if(l.posix!==!0&&d[0]==="^"&&!d.includes("/")&&(c=`/${c}`),l.value+=c,be({value:c}),r.literalBrackets===!1||V.hasRegexChars(d))continue;let v=V.escapeRegex(l.value);if(u.output=u.output.slice(0,-l.value.length),r.literalBrackets===!0){u.output+=v,l.value=v;continue}l.value=`(${o}${v}|${l.value})`,u.output+=l.value;continue}if(c==="{"&&r.nobrace!==!0){Ce("braces");let d={type:"brace",value:c,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};F.push(d),w(d);continue}if(c==="}"){let d=F[F.length-1];if(r.nobrace===!0||!d){w({type:"text",value:c,output:c});continue}let v=")";if(d.dots===!0){let I=i.slice(),W=[];for(let D=I.length-1;D>=0&&(i.pop(),I[D].type!=="brace");D--)I[D].type!=="dots"&&W.unshift(I[D].value);v=Wn(W,r),u.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let I=u.output.slice(0,d.outputIndex),W=u.tokens.slice(d.tokensIndex);d.value=d.output="\\{",c=v="\\}",u.output=I;for(let D of W)u.output+=D.output||D.value}w({type:"brace",value:c,output:v}),ce("braces"),F.pop();continue}if(c==="|"){C.length>0&&C[C.length-1].conditions++,w({type:"text",value:c});continue}if(c===","){let d=c,v=F[F.length-1];v&&Z[Z.length-1]==="braces"&&(v.comma=!0,d="|"),w({type:"comma",value:c,output:d});continue}if(c==="/"){if(l.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",i.pop(),l=a;continue}w({type:"slash",value:c,output:$});continue}if(c==="."){if(u.braces>0&&l.type==="dot"){l.value==="."&&(l.output=R);let d=F[F.length-1];l.type="dots",l.output+=c,l.value+=c,d.dots=!0;continue}if(u.braces+u.parens===0&&l.type!=="bos"&&l.type!=="slash"){w({type:"text",value:c,output:R});continue}w({type:"dot",value:c,output:R});continue}if(c==="?"){if(!(l&&l.value==="(")&&r.noextglob!==!0&&P()==="("&&P(2)!=="?"){we("qmark",c);continue}if(l&&l.type==="paren"){let v=P(),I=c;if(v==="<"&&!V.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(l.value==="("&&!/[!=<:]/.test(v)||v==="<"&&!/<([!=]|\w+>)/.test(re()))&&(I=`\\${c}`),w({type:"text",value:c,output:I});continue}if(r.dot!==!0&&(l.type==="slash"||l.type==="bos")){w({type:"qmark",value:c,output:H});continue}w({type:"qmark",value:c,output:T});continue}if(c==="!"){if(r.noextglob!==!0&&P()==="("&&(P(2)!=="?"||!/[!=<:]/.test(P(3)))){we("negate",c);continue}if(r.nonegate!==!0&&u.index===0){xr();continue}}if(c==="+"){if(r.noextglob!==!0&&P()==="("&&P(2)!=="?"){we("plus",c);continue}if(l&&l.value==="("||r.regex===!1){w({type:"plus",value:c,output:p});continue}if(l&&(l.type==="bracket"||l.type==="paren"||l.type==="brace")||u.parens>0){w({type:"plus",value:c});continue}w({type:"plus",value:p});continue}if(c==="@"){if(r.noextglob!==!0&&P()==="("&&P(2)!=="?"){w({type:"at",extglob:!0,value:c,output:""});continue}w({type:"text",value:c});continue}if(c!=="*"){(c==="$"||c==="^")&&(c=`\\${c}`);let d=qn.exec(re());d&&(c+=d[0],u.index+=d[0].length),w({type:"text",value:c});continue}if(l&&(l.type==="globstar"||l.star===!0)){l.type="star",l.star=!0,l.value+=c,l.output=N,u.backtrack=!0,u.globstar=!0,ie(c);continue}let A=re();if(r.noextglob!==!0&&/^\([^?]/.test(A)){we("star",c);continue}if(l.type==="star"){if(r.noglobstar===!0){ie(c);continue}let d=l.prev,v=d.prev,I=d.type==="slash"||d.type==="bos",W=v&&(v.type==="star"||v.type==="globstar");if(r.bash===!0&&(!I||A[0]&&A[0]!=="/")){w({type:"star",value:c,output:""});continue}let D=u.braces>0&&(d.type==="comma"||d.type==="brace"),Be=C.length&&(d.type==="pipe"||d.type==="paren");if(!I&&d.type!=="paren"&&!D&&!Be){w({type:"star",value:c,output:""});continue}for(;A.slice(0,3)==="/**";){let Se=e[u.index+4];if(Se&&Se!=="/")break;A=A.slice(3),ie("/**",3)}if(d.type==="bos"&&M()){l.type="globstar",l.value+=c,l.output=y(r),u.output=l.output,u.globstar=!0,ie(c);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!W&&M()){u.output=u.output.slice(0,-(d.output+l.output).length),d.output=`(?:${d.output}`,l.type="globstar",l.output=y(r)+(r.strictSlashes?")":"|$)"),l.value+=c,u.globstar=!0,u.output+=d.output+l.output,ie(c);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&A[0]==="/"){let Se=A[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(d.output+l.output).length),d.output=`(?:${d.output}`,l.type="globstar",l.output=`${y(r)}${$}|${$}${Se})`,l.value+=c,u.output+=d.output+l.output,u.globstar=!0,ie(c+te()),w({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&A[0]==="/"){l.type="globstar",l.value+=c,l.output=`(?:^|${$}|${y(r)}${$})`,u.output=l.output,u.globstar=!0,ie(c+te()),w({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-l.output.length),l.type="globstar",l.output=y(r),l.value+=c,u.output+=l.output,u.globstar=!0,ie(c);continue}let L={type:"star",value:c,output:N};if(r.bash===!0){L.output=".*?",(l.type==="bos"||l.type==="slash")&&(L.output=E+L.output),w(L);continue}if(l&&(l.type==="bracket"||l.type==="paren")&&r.regex===!0){L.output=c,w(L);continue}(u.index===u.start||l.type==="slash"||l.type==="dot")&&(l.type==="dot"?(u.output+=S,l.output+=S):r.dot===!0?(u.output+=b,l.output+=b):(u.output+=E,l.output+=E),P()!=="*"&&(u.output+=_,l.output+=_)),w(L)}for(;u.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing","]"));u.output=V.escapeLast(u.output,"["),ce("brackets")}for(;u.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing",")"));u.output=V.escapeLast(u.output,"("),ce("parens")}for(;u.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing","}"));u.output=V.escapeLast(u.output,"{"),ce("braces")}if(r.strictSlashes!==!0&&(l.type==="star"||l.type==="bracket")&&w({type:"maybe_slash",value:"",output:`${$}?`}),u.backtrack===!0){u.output="";for(let A of u.tokens)u.output+=A.output!=null?A.output:A.value,A.suffix&&(u.output+=A.suffix)}return u};nr.fastpaths=(e,t)=>{let r=O({},t),n=typeof r.maxLength=="number"?Math.min(Oe,r.maxLength):Oe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);e=rr[e]||e;let a=V.isWindows(t),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:h,DOTS_SLASH:g,NO_DOT:f,NO_DOTS:R,NO_DOTS_SLASH:p,STAR:$,START_ANCHOR:_}=ke.globChars(a),m=r.dot?R:f,x=r.dot?p:f,S=r.capture?"":"?:",b={negated:!1,prefix:""},T=r.bash===!0?".*?":$;r.capture&&(T=`(${T})`);let H=E=>E.noglobstar===!0?T:`(${S}(?:(?!${_}${E.dot?g:i}).)*?)`,X=E=>{switch(E){case"*":return`${m}${h}${T}`;case".*":return`${i}${h}${T}`;case"*.*":return`${m}${T}${i}${h}${T}`;case"*/*":return`${m}${T}${o}${h}${x}${T}`;case"**":return m+H(r);case"**/*":return`(?:${m}${H(r)}${o})?${x}${h}${T}`;case"**/*.*":return`(?:${m}${H(r)}${o})?${x}${T}${i}${h}${T}`;case"**/.*":return`(?:${m}${H(r)}${o})?${i}${h}${T}`;default:{let U=/^(.*?)\.(\w+)$/.exec(E);if(!U)return;let N=X(U[1]);return N?N+i+U[2]:void 0}}},K=V.removePrefix(e,b),y=X(K);return y&&r.strictSlashes!==!0&&(y+=`${o}?`),y};tr.exports=nr});var ir=G((ms,ar)=>{"use strict";var jn=require("path"),Fn=er(),Xe=sr(),Ze=ye(),Qn=me(),Xn=e=>e&&typeof e=="object"&&!Array.isArray(e),B=(e,t,r=!1)=>{if(Array.isArray(e)){let f=e.map(p=>B(p,t,r));return p=>{for(let $ of f){let _=$(p);if(_)return _}return!1}}let n=Xn(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=t||{},a=Ze.isWindows(t),i=n?B.compileRe(e,t):B.makeRe(e,t,!1,!0),o=i.state;delete i.state;let h=()=>!1;if(s.ignore){let f=j(O({},t),{ignore:null,onMatch:null,onResult:null});h=B(s.ignore,f,r)}let g=(f,R=!1)=>{let{isMatch:p,match:$,output:_}=B.test(f,i,t,{glob:e,posix:a}),m={glob:e,state:o,regex:i,posix:a,input:f,output:_,match:$,isMatch:p};return typeof s.onResult=="function"&&s.onResult(m),p===!1?(m.isMatch=!1,R?m:!1):h(f)?(typeof s.onIgnore=="function"&&s.onIgnore(m),m.isMatch=!1,R?m:!1):(typeof s.onMatch=="function"&&s.onMatch(m),R?m:!0)};return r&&(g.state=o),g};B.test=(e,t,r,{glob:n,posix:s}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let a=r||{},i=a.format||(s?Ze.toPosixSlashes:null),o=e===n,h=o&&i?i(e):e;return o===!1&&(h=i?i(e):e,o=h===n),(o===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?o=B.matchBase(e,t,r,s):o=t.exec(h)),{isMatch:Boolean(o),match:o,output:h}};B.matchBase=(e,t,r,n=Ze.isWindows(r))=>(t instanceof RegExp?t:B.makeRe(t,r)).test(jn.basename(e));B.isMatch=(e,t,r)=>B(t,r)(e);B.parse=(e,t)=>Array.isArray(e)?e.map(r=>B.parse(r,t)):Xe(e,j(O({},t),{fastpaths:!1}));B.scan=(e,t)=>Fn(e,t);B.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let s=t||{},a=s.contains?"":"^",i=s.contains?"":"$",o=`${a}(?:${e.output})${i}`;e&&e.negated===!0&&(o=`^(?!${o}).*$`);let h=B.toRegex(o,t);return n===!0&&(h.state=e),h};B.makeRe=(e,t,r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let s=t||{},a={negated:!1,fastpaths:!0},i="",o;return e.startsWith("./")&&(e=e.slice(2),i=a.prefix="./"),s.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o=Xe.fastpaths(e,t)),o===void 0?(a=Xe(e,t),a.prefix=i+(a.prefix||"")):a.output=o,B.compileRe(a,t,r,n)};B.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};B.constants=Qn;ar.exports=B});var ur=G((ys,or)=>{"use strict";or.exports=ir()});var hr=G((_s,cr)=>{"use strict";var lr=require("util"),pr=Gt(),ae=ur(),Ye=ye(),fr=e=>typeof e=="string"&&(e===""||e==="./"),k=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,s=new Set,a=new Set,i=0,o=f=>{a.add(f.output),r&&r.onResult&&r.onResult(f)};for(let f=0;f<t.length;f++){let R=ae(String(t[f]),j(O({},r),{onResult:o}),!0),p=R.state.negated||R.state.negatedExtglob;p&&i++;for(let $ of e){let _=R($,!0);!(p?!_.isMatch:_.isMatch)||(p?n.add(_.output):(n.delete(_.output),s.add(_.output)))}}let g=(i===t.length?[...a]:[...s]).filter(f=>!n.has(f));if(r&&g.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(f=>f.replace(/\\/g,"")):t}return g};k.match=k;k.matcher=(e,t)=>ae(e,t);k.isMatch=(e,t,r)=>ae(t,r)(e);k.any=k.isMatch;k.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,s=[],a=o=>{r.onResult&&r.onResult(o),s.push(o.output)},i=k(e,t,j(O({},r),{onResult:a}));for(let o of s)i.includes(o)||n.add(o);return[...n]};k.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${lr.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>k.contains(e,n,r));if(typeof t=="string"){if(fr(e)||fr(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return k.isMatch(e,t,j(O({},r),{contains:!0}))};k.matchKeys=(e,t,r)=>{if(!Ye.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=k(Object.keys(e),t,r),s={};for(let a of n)s[a]=e[a];return s};k.some=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=ae(String(s),r);if(n.some(i=>a(i)))return!0}return!1};k.every=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=ae(String(s),r);if(!n.every(i=>a(i)))return!1}return!0};k.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${lr.inspect(e)}"`);return[].concat(t).every(n=>ae(n,r)(e))};k.capture=(e,t,r)=>{let n=Ye.isWindows(r),a=ae.makeRe(String(e),j(O({},r),{capture:!0})).exec(n?Ye.toPosixSlashes(t):t);if(a)return a.slice(1).map(i=>i===void 0?"":i)};k.makeRe=(...e)=>ae.makeRe(...e);k.scan=(...e)=>ae.scan(...e);k.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let s of pr(String(n),t))r.push(ae.parse(s,t));return r};k.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!/\{.*\}/.test(e)?[e]:pr(e,t)};k.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return k.braces(e,j(O({},t),{expand:!0}))};cr.exports=k});var gr=G((Es,dr)=>{"use strict";dr.exports=(e,...t)=>new Promise(r=>{r(e(...t))})});var Rr=G((xs,ze)=>{"use strict";var Zn=gr(),Ar=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=[],r=0,n=()=>{r--,t.length>0&&t.shift()()},s=(o,h,...g)=>{r++;let f=Zn(o,...g);h(f),f.then(n,n)},a=(o,h,...g)=>{r<e?s(o,h,...g):t.push(s.bind(null,o,h,...g))},i=(o,...h)=>new Promise(g=>a(o,g,...h));return Object.defineProperties(i,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length}}),i};ze.exports=Ar;ze.exports.default=Ar});var zn={};kr(zn,{default:()=>Jn});var ve=Y(require("@yarnpkg/cli")),ne=Y(require("@yarnpkg/core")),rt=Y(require("@yarnpkg/core")),le=Y(require("clipanion")),Ae=class extends ve.BaseCommand{constructor(){super(...arguments);this.json=le.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.production=le.Option.Boolean("--production",!1,{description:"Only install regular dependencies by omitting dev dependencies"});this.all=le.Option.Boolean("-A,--all",!1,{description:"Install the entire project"});this.workspaces=le.Option.Rest()}async execute(){let t=await ne.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await ne.Project.find(t,this.context.cwd),s=await ne.Cache.find(t);await r.restoreInstallState({restoreResolutions:!1});let a;if(this.all)a=new Set(r.workspaces);else if(this.workspaces.length===0){if(!n)throw new ve.WorkspaceRequiredError(r.cwd,this.context.cwd);a=new Set([n])}else a=new Set(this.workspaces.map(o=>r.getWorkspaceByIdent(rt.structUtils.parseIdent(o))));for(let o of a)for(let h of this.production?["dependencies"]:ne.Manifest.hardDependencies)for(let g of o.manifest.getForScope(h).values()){let f=r.tryWorkspaceByDescriptor(g);f!==null&&a.add(f)}for(let o of r.workspaces)a.has(o)?this.production&&o.manifest.devDependencies.clear():(o.manifest.dependencies.clear(),o.manifest.devDependencies.clear(),o.manifest.peerDependencies.clear(),o.manifest.scripts.clear());return(await ne.StreamReport.start({configuration:t,json:this.json,stdout:this.context.stdout,includeLogs:!0},async o=>{await r.install({cache:s,report:o,persistProject:!1})})).exitCode()}};Ae.paths=[["workspaces","focus"]],Ae.usage=le.Command.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "});var nt=Ae;var Ne=Y(require("@yarnpkg/cli")),Ie=Y(require("@yarnpkg/core")),Ee=Y(require("@yarnpkg/core")),J=Y(require("@yarnpkg/core")),q=Y(require("clipanion")),Ve=Y(hr()),mr=Y(require("os")),yr=Y(Rr()),ue=Y(require("typanion")),xe=class extends Ne.BaseCommand{constructor(){super(...arguments);this.recursive=q.Option.Boolean("-R,--recursive",!1,{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"});this.all=q.Option.Boolean("-A,--all",!1,{description:"Run the command on all workspaces of a project"});this.verbose=q.Option.Boolean("-v,--verbose",!1,{description:"Prefix each output line with the name of the originating workspace"});this.parallel=q.Option.Boolean("-p,--parallel",!1,{description:"Run the commands in parallel"});this.interlaced=q.Option.Boolean("-i,--interlaced",!1,{description:"Print the output of commands in real-time instead of buffering it"});this.jobs=q.Option.String("-j,--jobs",{description:"The maximum number of parallel tasks that the execution will be limited to",validator:ue.applyCascade(ue.isNumber(),[ue.isInteger(),ue.isAtLeast(2)])});this.topological=q.Option.Boolean("-t,--topological",!1,{description:"Run the command after all workspaces it depends on (regular) have finished"});this.topologicalDev=q.Option.Boolean("--topological-dev",!1,{description:"Run the command after all workspaces it depends on (regular + dev) have finished"});this.include=q.Option.Array("--include",[],{description:"An array of glob pattern idents; only matching workspaces will be traversed"});this.exclude=q.Option.Array("--exclude",[],{description:"An array of glob pattern idents; matching workspaces won't be traversed"});this.publicOnly=q.Option.Boolean("--no-private",{description:"Avoid running the command on private workspaces"});this.commandName=q.Option.String();this.args=q.Option.Proxy()}async execute(){let t=await Ie.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await Ie.Project.find(t,this.context.cwd);if(!this.all&&!n)throw new Ne.WorkspaceRequiredError(r.cwd,this.context.cwd);let s=this.cli.process([this.commandName,...this.args]),a=s.path.length===1&&s.path[0]==="run"&&typeof s.scriptName!="undefined"?s.scriptName:null;if(s.path.length===0)throw new q.UsageError("Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script");let i=this.all?r.topLevelWorkspace:n,o=this.recursive?[i,...i.getRecursiveWorkspaceDependencies()]:[i,...i.getRecursiveWorkspaceChildren()],h=[];for(let b of o)a&&!b.manifest.scripts.has(a)&&!a.includes(":")||a===process.env.npm_lifecycle_event&&b.cwd===n.cwd||this.include.length>0&&!Ve.default.isMatch(J.structUtils.stringifyIdent(b.locator),this.include)||this.exclude.length>0&&Ve.default.isMatch(J.structUtils.stringifyIdent(b.locator),this.exclude)||this.publicOnly&&b.manifest.private===!0||h.push(b);let g=this.interlaced;this.parallel||(g=!0);let f=new Map,R=new Set,p=this.parallel?Math.max(1,(0,mr.cpus)().length/2):1,$=(0,yr.default)(this.jobs||p),_=0,m=null,x=!1,S=await Ee.StreamReport.start({configuration:t,stdout:this.context.stdout},async b=>{let T=async(H,{commandIndex:X})=>{if(x)return-1;!this.parallel&&this.verbose&&X>1&&b.reportSeparator();let K=Yn(H,{configuration:t,verbose:this.verbose,commandIndex:X}),[y,E]=_r(b,{prefix:K,interlaced:g}),[U,N]=_r(b,{prefix:K,interlaced:g});try{this.verbose&&b.reportInfo(null,`${K} Process started`);let u=Date.now(),C=await this.cli.run([this.commandName,...this.args],{cwd:H.cwd,stdout:y,stderr:U})||0;y.end(),U.end(),await E,await N;let F=Date.now();if(this.verbose){let Z=t.get("enableTimers")?`, completed in ${J.formatUtils.pretty(t,F-u,J.formatUtils.Type.DURATION)}`:"";b.reportInfo(null,`${K} Process exited (exit code ${C})${Z}`)}return C===130&&(x=!0,m=C),C}catch(u){throw y.end(),U.end(),await E,await N,u}};for(let H of h)f.set(H.anchoredLocator.locatorHash,H);for(;f.size>0&&!b.hasErrors();){let H=[];for(let[y,E]of f){if(R.has(E.anchoredDescriptor.descriptorHash))continue;let U=!0;if(this.topological||this.topologicalDev){let N=this.topologicalDev?new Map([...E.manifest.dependencies,...E.manifest.devDependencies]):E.manifest.dependencies;for(let u of N.values()){let C=r.tryWorkspaceByDescriptor(u);if(U=C===null||!f.has(C.anchoredLocator.locatorHash),!U)break}}if(!!U&&(R.add(E.anchoredDescriptor.descriptorHash),H.push($(async()=>{let N=await T(E,{commandIndex:++_});return f.delete(y),R.delete(E.anchoredDescriptor.descriptorHash),N})),!this.parallel))break}if(H.length===0){let y=Array.from(f.values()).map(E=>J.structUtils.prettyLocator(t,E.anchoredLocator)).join(", ");b.reportError(Ee.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected (${y})`);return}let K=(await Promise.all(H)).find(y=>y!==0);m===null&&(m=typeof K!="undefined"?1:m),(this.topological||this.topologicalDev)&&typeof K!="undefined"&&b.reportError(Ee.MessageName.UNNAMED,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return m!==null?m:S.exitCode()}};xe.paths=[["workspaces","foreach"]],xe.usage=q.Command.Usage({category:"Workspace-related commands",description:"run a command on all workspaces",details:"\n This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\n\n - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`.\n\n - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\n\n - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\n\n - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project. By default yarn runs the command only on current and all its descendant workspaces.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n Adding the `-v,--verbose` flag will cause Yarn to print more information; in particular the name of the workspace that generated the output will be printed at the front of each line.\n\n If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\n ",examples:[["Publish current and all descendant packages","yarn workspaces foreach npm publish --tolerate-republish"],["Run build script on current and all descendant packages","yarn workspaces foreach run build"],["Run build script on current and all descendant packages in parallel, building dependent packages first","yarn workspaces foreach -pt run build"]]});var Er=xe;function _r(e,{prefix:t,interlaced:r}){let n=e.createStreamReporter(t),s=new J.miscUtils.DefaultStream;s.pipe(n,{end:!1}),s.on("finish",()=>{n.end()});let a=new Promise(o=>{n.on("finish",()=>{o(s.active)})});if(r)return[s,a];let i=new J.miscUtils.BufferStream;return i.pipe(s,{end:!1}),i.on("finish",()=>{s.end()}),[i,a]}function Yn(e,{configuration:t,commandIndex:r,verbose:n}){if(!n)return null;let s=J.structUtils.convertToIdent(e.locator),i=`[${J.structUtils.stringifyIdent(s)}]:`,o=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],h=o[r%o.length];return J.formatUtils.pretty(t,i,h)}var Vn={commands:[nt,Er]},Jn=Vn;return zn;})();
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
return plugin;
}
};