import{isMediaQueryInvalid as e,isMediaFeature as s}from"../../../../@csstools/media-query-list-parser/dist/index.mjs";import{atRuleParamIndex as t}from"../../utils/nodeFieldIndices.mjs";import{atRuleRegexes as r}from"../../utils/regexes.mjs";import m from"../../utils/isCustomMediaQuery.mjs";import o from"../../utils/parseCustomMediaQuery.mjs";import i from"../../utils/parseMediaQuery.mjs";import u from"../../utils/report.mjs";import a from"../../utils/ruleMessages.mjs";import n from"../../utils/validateOptions.mjs";const d="no-unknown-custom-media",l=a(d,{rejected:e=>`Unexpected unknown custom media "${e}"`}),p=a=>(p,c)=>{if(!n(c,d,{actual:a}))return;const f=new Set;p.walkAtRules(/^custom-media$/i,e=>{const s=o(e);s&&f.add(s.getName())}),p.walkAtRules(r.mediaName,r=>{i(r).forEach(o=>{e(o)||o.walk(({node:e})=>{if(!s(e))return;const[,o,i,a]=e.getNameToken();if(!m(o))return;if(f.has(o))return;const n=t(r),p=n+i,j=n+a+1;u({message:l.rejected,messageArgs:[o],node:r,index:p,endIndex:j,result:c,ruleName:d})})})})};p.ruleName=d,p.messages=l,p.meta={url:"https://stylelint.io/user-guide/rules/no-unknown-custom-media"};export{p as default};