import e from"../../../../stylelint/lib/index.mjs";import{ruleName as t,ruleMessages as r,ruleMeta as i}from"./base.mjs";import{vendorPrefixes as l}from"../../utils/vendorPrefixes.mjs";import{physicalProperties as s}from"../../utils/physical.mjs";import{isPhysicalProperty as a}from"../../utils/isPhysicalProperty.mjs";import{isPhysicalValue as o}from"../../utils/isPhysicalValue.mjs";import{physicalPropertiesMap as u}from"../../utils/physicalPropertiesMap.mjs";import{physicalValuesMap as p}from"../../utils/physicalValuesMap.mjs";const n=(i,n,m)=>(i,c)=>{e.utils.validateOptions(c,t)&&i.walkDecls(i=>{let f=i.prop;if(Array.isArray(n?.ignore)&&n?.ignore.includes(f))return;l.forEach(e=>f=f.replace(e,""));if(![...Object.values(s),"transition"].includes(f))return;const d="caption-side"===f&&["top","bottom"].includes(i.value),v="transition"===f&&Object.values(s).filter(e=>!(n?.ignore||[]).includes(e)).flatMap(e=>{const t=new RegExp(`(^|[^\\w-])${e}([^\\w-]|$)`);return i.value.match(t)}).filter(e=>e&&e.trim()),h=a(i.prop),g=o(i.value);if(!h&&!g&&!v.length||d)return;let j;if(h&&(j=r.unexpectedProp(i.prop,u[f])),g&&(j=r.unexpectedValue(i.prop,i.value,p[f][i.value])),v.length){const e=v[0].trim();j=r.unexpectedTransitionValue(e,u[e])}if(m.fix){if(h&&(i.prop=u[f]),g&&(i.value=p[f][i.value]),v.length){let e=i.value;v.forEach(t=>{e=e.replace(t.trim(),u[t.trim()])}),i.value=e}}else e.utils.report({message:j,node:i,result:c,ruleName:t})})};n.ruleName=t,n.messages=r,n.meta=i;const m=e.createPlugin(t,n);export{m as default};