import{isString as e,isRegExp as s}from"../../utils/validateTypes.mjs";import t from"../../utils/getAtRuleParams.mjs";import r from"../../utils/getRuleSelector.mjs";import i from"../../utils/isStandardSyntaxAtRule.mjs";import l from"../../utils/isStandardSyntaxRule.mjs";import o from"../../utils/matchesStringOrRegExp.mjs";import a from"../../utils/parseSelector.mjs";import m from"../../utils/report.mjs";import u from"../../utils/ruleMessages.mjs";import n from"../../utils/validateOptions.mjs";import p from"../../utils/vendor.mjs";const d="selector-pseudo-class-disallowed-list",c=u(d,{rejected:e=>`Unexpected pseudo-class "${e}"`}),f=u=>(f,g)=>{function j(e,s,t=0){a(e,g,s)?.walkPseudos(({value:e,sourceIndex:r})=>{if("::"===e.slice(0,2))return;const i=e.slice(1);if(!o(p.unprefixed(i),u))return;const l=t+r;m({message:c.rejected,messageArgs:[e],node:s,result:g,ruleName:d,index:l,endIndex:l+e.length})})}n(g,d,{actual:u,possible:[e,s]})&&f.walk(e=>{switch(e.type){case"atrule":{if("page"!==e.name)return;if(!i(e))return;const s=t(e);if(!s.includes(":"))return;j(s,e,`@page${e.raws.afterName??""}`.length);break}case"rule":{if(!l(e))return;const s=r(e);if(!s.includes(":"))return;j(s,e);break}}})};f.primaryOptionArray=!0,f.ruleName=d,f.messages=c,f.meta={url:"https://stylelint.io/user-guide/rules/selector-pseudo-class-disallowed-list"};export{f as default};