import{__exports as t}from"../../../../_virtual/tasks.mjs";import{__require as e}from"../utils/index.mjs";var r;function n(){if(r)return t;r=1,Object.defineProperty(t,"__esModule",{value:!0}),t.convertPatternGroupToTask=t.convertPatternGroupsToTasks=t.groupPatternsByBaseDirectory=t.getNegativePatternsAsPositive=t.getPositivePatterns=t.convertPatternsToTasks=t.generate=void 0;const n=e();function a(t,e){let r=t;return e.braceExpansion&&(r=n.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(t=>t.includes("/")?t:`**/${t}`)),r.map(t=>n.pattern.removeDuplicateSlashes(t))}function s(t,e,r){const a=[],s=n.pattern.getPatternsOutsideCurrentDirectory(t),o=n.pattern.getPatternsInsideCurrentDirectory(t),i=c(s),P=c(o);return a.push(...u(i,e,r)),"."in P?a.push(p(".",o,e,r)):a.push(...u(P,e,r)),a}function o(t){return n.pattern.getPositivePatterns(t)}function i(t,e){return n.pattern.getNegativePatterns(t).concat(e).map(n.pattern.convertToPositivePattern)}function c(t){return t.reduce((t,e)=>{const r=n.pattern.getBaseDirectory(e);return r in t?t[r].push(e):t[r]=[e],t},{})}function u(t,e,r){return Object.keys(t).map(n=>p(n,t[n],e,r))}function p(t,e,r,a){return{dynamic:a,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(n.pattern.convertToNegativePattern))}}return t.generate=function(t,e){const r=a(t,e),c=a(e.ignore,e),u=o(r),p=i(r,c),P=u.filter(t=>n.pattern.isStaticPattern(t,e)),v=u.filter(t=>n.pattern.isDynamicPattern(t,e)),g=s(P,p,!1),f=s(v,p,!0);return g.concat(f)},t.convertPatternsToTasks=s,t.getPositivePatterns=o,t.getNegativePatternsAsPositive=i,t.groupPatternsByBaseDirectory=c,t.convertPatternGroupsToTasks=u,t.convertPatternGroupToTask=p,t}export{n as __require};