import e from"../../../../../_virtual/index19.mjs";import{isString as t,isRegExp as r}from"../../utils/validateTypes.mjs";import{declarationValueIndex as o}from"../../utils/nodeFieldIndices.mjs";import i from"../../utils/getDeclarationValue.mjs";import a from"../../utils/isStandardSyntaxDeclaration.mjs";import n from"../../utils/isStandardSyntaxValue.mjs";import s from"../../utils/optionsMatches.mjs";import d from"../../utils/report.mjs";import l from"../../utils/ruleMessages.mjs";import u from"../../utils/setDeclarationValue.mjs";import{singleValueColorProperties as c}from"../../reference/properties.mjs";import m from"../../utils/validateOptions.mjs";const p="declaration-property-value-keyword-no-deprecated",x=l(p,{expected:(e,t)=>`Expected "${e}" to be "${t}"`,rejected:(e,t)=>`Unexpected deprecated keyword "${t}" for property "${e}"`}),h={activecaption:"canvas",appworkspace:"canvas",background:"canvas",inactivecaption:"canvas",infobackground:"canvas",menu:"canvas",scrollbar:"canvas",window:"canvas",activeborder:"ButtonBorder",inactiveborder:"ButtonBorder",threeddarkshadow:"ButtonBorder",threedhighlight:"ButtonBorder",threedlightshadow:"ButtonBorder",threedshadow:"ButtonBorder",windowframe:"ButtonBorder",captiontext:"CanvasText",infotext:"CanvasText",menutext:"CanvasText",windowtext:"CanvasText",buttonhighlight:"ButtonFace",buttonshadow:"ButtonFace",threedface:"ButtonFace",inactivecaptiontext:"GrayText"},f=[...c.values()].map(e=>[e,h]),v=new Map([["appearance",{button:"auto",checkbox:"auto",listbox:"auto",menulist:"auto",meter:"auto","progress-bar":"auto","push-button":"auto",radio:"auto",searchfield:"auto","slider-horizontal":"auto","square-button":"auto",textarea:"auto"}],["image-rendering",{optimizeQuality:"smooth",optimizeSpeed:"pixelated"}],["overflow",{overlay:"auto"}],["overflow-x",{overlay:"auto"}],["overflow-y",{overlay:"auto"}],["text-justify",{distribute:"inter-character"}],["text-orientation",{"sideways-right":"sideways"}],["user-select",{element:"contain"}],["zoom",{reset:"1"}],["border-color",h],["scrollbar-color",h],["text-decoration",["blink"]],["text-decoration-line",["blink"]],["box-sizing",["padding-box"]],["image-orientation",["flip"]],["min-height",["intrinsic","min-intrinsic"]],["min-width",["intrinsic","min-intrinsic"]],["max-height",["intrinsic","min-intrinsic"]],["max-width",["intrinsic","min-intrinsic"]],["height",["intrinsic","min-intrinsic"]],["width",["intrinsic","min-intrinsic"]],["word-break",["break-word"]],...f]),w=(l,c)=>(h,f)=>{m(f,p,{actual:l},{optional:!0,actual:c,possible:{ignoreKeywords:[t,r]}})&&h.walkDecls(t=>{if(!a(t))return;const{prop:r,value:l}=t;if(s(c,"ignoreKeywords",l))return;const m=v.get(r.toLowerCase());if(!m)return;const h=e(i(t));let w=!0;h.walk(e=>{"comment"!==e.type&&(n(e.value)||(w=!1))}),w&&h.walk(e=>{if("word"!==e.type)return;const i=e.value,a=i.toLowerCase(),n=e.sourceIndex;let s,l,c=[];if(Array.isArray(m)){if(!m.includes(a))return;l=x.rejected,c=[r,i]}else{const r=m[a];if(!r)return;l=x.expected,c=[i,r],s=()=>{e.value=r,u(t,h.toString())}}const v=o(t)+n,w=v+i.length;d({message:l,messageArgs:c,node:t,result:f,ruleName:p,index:v,endIndex:w,fix:{apply:s,node:t}})})})};w.ruleName=p,w.messages=x,w.meta={url:"https://stylelint.io/user-guide/rules/declaration-property-value-keyword-no-deprecated",fixable:!0};export{w as default};