import{__module as t}from"../../_virtual/index36.mjs";var e;function r(){return e||(e=1,function(t){function e(t){return Array.isArray(t)?t:[t]}const r=/^\s+$/,s=/(?:[^\\]|^)\\$/,i=/^\\!/,n=/^\\#/,o=/\r?\n/g,h=/^\.{0,2}\/|^\.{1,2}$/,a=/\/$/,c="/";let u="node-ignore";"undefined"!=typeof Symbol&&(u=Symbol.for("node-ignore"));const l=u,d=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),g=/([0-z])-([0-z])/g,_=()=>!1,p=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(0===r.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(t,e)=>{const{length:r}=e;return e.slice(0,r-r%2)+" "}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>e+r.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,i)=>"\\"===e?`\\[${r}${(t=>{const{length:e}=t;return t.slice(0,e-e%2)})(s)}${i}`:"]"===i&&s.length%2==0?`[${(t=>t.replace(g,(t,e,r)=>e.charCodeAt(0)<=r.charCodeAt(0)?t:""))(r)}${s}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],f=/(^|\\\/)?\\\*$/,$="regex",x="checkRegex",C={[$]:(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`,[x]:(t,e)=>`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`},m=t=>"string"==typeof t;class v{constructor(t,e,r,s,i,n){this.pattern=t,this.mark=e,this.negative=i,d(this,"body",r),d(this,"ignoreCase",s),d(this,"regexPrefix",n)}get regex(){const t="_"+$;return this[t]?this[t]:this._make($,t)}get checkRegex(){const t="_"+x;return this[t]?this[t]:this._make(x,t)}_make(t,e){const r=this.regexPrefix.replace(f,C[t]),s=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return d(this,e,s)}}const b=({pattern:t,mark:e},r)=>{let s=!1,o=t;0===o.indexOf("!")&&(s=!0,o=o.substr(1)),o=o.replace(i,"!").replace(n,"#");const h=(t=>p.reduce((e,[r,s])=>e.replace(r,s.bind(t)),t))(o);return new v(t,e,o,r,s,h)};class y{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[l])return this._rules=this._rules.concat(t._rules._rules),void(this._added=!0);if(m(t)&&(t={pattern:t}),(t=>t&&m(t)&&!r.test(t)&&!s.test(t)&&0!==t.indexOf("#"))(t.pattern)){const e=b(t,this._ignoreCase);this._added=!0,this._rules.push(e)}}add(t){return this._added=!1,e(m(t)?(t=>t.split(o).filter(Boolean))(t):t).forEach(this._add,this),this._added}test(t,e,r){let s,i=!1,n=!1;this._rules.forEach(o=>{const{negative:h}=o;if(n===h&&i!==n||h&&!i&&!n&&!e)return;o[r].test(t)&&(i=!h,n=h,s=h?void 0:o)});const o={ignored:i,unignored:n};return s&&(o.rule=s),o}}const k=(t,e)=>{throw new e(t)},w=(t,e,r)=>{if(!m(t))return r(`path must be a string, but got \`${e}\``,TypeError);if(!t)return r("path must not be empty",TypeError);if(w.isNotRelative(t)){return r(`path should be a ${"`path.relative()`d"} string, but got "${e}"`,RangeError)}return!0},R=t=>h.test(t);w.isNotRelative=R,w.convert=t=>t;class E{constructor({ignorecase:t=!0,ignoreCase:e=t,allowRelativePaths:r=!1}={}){d(this,l,!0),this._rules=new y(e),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,e,r,s){const i=t&&w.convert(t);return w(i,t,this._strictPathCheck?k:_),this._t(i,e,r,s)}checkIgnore(t){if(!a.test(t))return this.test(t);const e=t.split(c).filter(Boolean);if(e.pop(),e.length){const t=this._t(e.join(c)+c,this._testCache,!0,e);if(t.ignored)return t}return this._rules.test(t,!1,x)}_t(t,e,r,s){if(t in e)return e[t];if(s||(s=t.split(c).filter(Boolean)),s.pop(),!s.length)return e[t]=this._rules.test(t,r,$);const i=this._t(s.join(c)+c,e,r,s);return e[t]=i.ignored?i:this._rules.test(t,r,$)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return e(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const P=t=>new E(t),j=()=>{w.convert=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");const t=/^[a-z]:\//i;w.isNotRelative=e=>t.test(e)||R(e)};"undefined"!=typeof process&&"win32"===process.platform&&j(),t.exports=P,P.default=P,t.exports.isPathValid=t=>w(t&&w.convert(t),t,_),d(t.exports,Symbol.for("setupWindows"),j)}(t)),t.exports}export{r as __require};