import e from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/optionsMatches.mjs";import{__require as t}from"../../utils/hasNestedSibling.mjs";import{__require as s}from"../../utils/isType.mjs";import{__require as i}from"../../utils/parseSelector.mjs";import{__require as n}from"../../utils/validateTypes.mjs";import{__require as o}from"../../utils/namespace.mjs";import{__require as a}from"../../utils/ruleUrl.mjs";var u,l;function m(){if(l)return u;l=1;const{utils:m}=e,p=r(),c=t(),d=s(),_=i(),{isRegExp:f,isString:g}=n(),j=o(),x=a(),q=j("selector-no-redundant-nesting-selector"),v=m.ruleMessages(q,{rejected:"Unnecessary nesting selector (&)"}),y={url:x(q)};function b(e,r){return(t,s)=>{m.validateOptions(s,q,{actual:e},{actual:r,possible:{ignoreKeywords:[g,f]},optional:!0})&&t.walkRules(/&/,e=>{"&"!==e.selector&&_(e.selector,s,e,t=>{t.walkNesting(t=>{if(t.prev()||c(t))return;const i=t.next();if(!i&&t.parent.parent.nodes.length>1)return;if(!i&&"pseudo"===t.parent.parent.type)return;if(i&&"combinator"!==i.type)return;const n=i?i.next():null;d(n,"tag")&&p(r,"ignoreKeywords",n.value.trim())||d(n,"combinator")||m.report({ruleName:q,result:s,node:e,message:v.rejected,index:t.sourceIndex,endIndex:t.sourceIndex+t.value.length})})})})}}return b.ruleName=q,b.messages=v,b.meta=y,u=b}export{m as __require};