import{isString as e,isRegExp as s}from"../../utils/validateTypes.mjs";import{atRuleParamIndex as t}from"../../utils/nodeFieldIndices.mjs";import{atRuleRegexes as r}from"../../utils/regexes.mjs";import{deprecatedMediaTypesNames as i}from"../../reference/mediaTypes.mjs";import{isMediaQueryWithType as o}from"../../../../@csstools/media-query-list-parser/dist/index.mjs";import m from"../../utils/isStandardSyntaxAtRule.mjs";import{isTokenIdent as a}from"../../../../@csstools/css-tokenizer/dist/index.mjs";import d from"../../utils/optionsMatches.mjs";import p from"../../utils/parseMediaQuery.mjs";import l from"../../utils/report.mjs";import n from"../../utils/ruleMessages.mjs";import{sourceIndices as u}from"../../../../@csstools/css-parser-algorithms/dist/index.mjs";import f from"../../utils/validateOptions.mjs";const c="media-type-no-deprecated",j=n(c,{rejected:e=>`Unexpected deprecated media type "${e}"`}),y=new RegExp(`\\b(${[...i].join("|")})\\b`,"i"),g=(n,g)=>(x,M)=>{f(M,c,{actual:n},{actual:g,possible:{ignoreMediaTypes:[e,s]},optional:!0})&&x.walkAtRules(r.mediaName,e=>{if(!m(e))return;if(!y.test(e.params))return;p(e).forEach(s=>{if(!o(s))return;const r=s.getMediaType();if(!i.has(r.toLowerCase()))return;if(d(g,"ignoreMediaTypes",r))return;const m=t(e),[p,n]=u({tokens:()=>s.mediaType.filter(a)});l({message:j.rejected,messageArgs:[r],node:e,index:m+p,endIndex:m+n+1,ruleName:c,result:M})})})};g.ruleName=c,g.messages=j,g.meta={url:"https://stylelint.io/user-guide/rules/media-type-no-deprecated"};export{g as default};