import e from"../../../_virtual/index13.mjs";import{__require as r}from"../../postcss-value-parser/lib/index.mjs";import n from"../../../_virtual/postcss.mjs";var t,a;function i(){if(a)return t;a=1;var i=e,u=r(),l=n;function s(e){return`less/${e}`}function o(e){return"each"===e.name||!!("variable"in e&&e.raws.afterName.includes(":")||e.mixin)}const c=/^#[0-9A-Za-z]+/;function d({type:e,value:r}){return"word"===e&&c.test(r)}const m=new Set(["url"]);function p({type:e,value:r}){return"function"===e&&m.has(r.toLowerCase())}function f(e){return!(!e.nodes&&""===e.params)&&((!("mixin"in e)||!e.mixin)&&!("variable"in e&&e.variable||!e.nodes&&""===e.raws.afterName&&"("===e.params[0]))}const v=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;const w=s("color-no-hex"),x=i.utils.ruleMessages(w,{rejected:function(e){return`Unexpected hex color "${e}"`},invalid:function(e){return`invalid variable "${e}"`}});const g=s("color-no-invalid-hex"),h=i.utils.ruleMessages(g,{rejected:function(e){return`Unexpected invalid hex color "${e}"`},invalid:function(e){return`invalid variable "${e}"`}});const b=s("color-hex-case"),j=i.utils.ruleMessages(b,{rejected:function(e,r){return`Expected "${e}" to be "${r}"`},invalid:function(e){return`invalid variable "${e}"`}});const N=s("no-duplicate-variables"),$=i.utils.ruleMessages(N,{rejected:function(e){return`unexpected duplicate property in "${e}"`},invalid:function(e){return`Unexpected Invalid variable  "${e}"`}});var k={"color-no-hex":function(e){return function(r,n){i.utils.validateOptions(n,w,{actual:e})&&r.walkAtRules(function(e){if(!f(e))if(o(e)){u(e.params).walk(r=>{if(p(r))return!1;d(r)&&i.utils.report({message:x.rejected(r.value),node:e,word:r.value,result:n,ruleName:w})})}else i.utils.report({result:n,ruleName:w,message:x.invalid(e.name),node:e,word:e.name})})}},"color-no-invalid-hex":function(e){return function(r,n){i.utils.validateOptions(n,g,{actual:e})&&r.walkAtRules(function(e){f(e)||(o(e)?u(e.params).walk(({value:r,type:t})=>{if("function"===t&&r.endsWith("url"))return!1;if("word"!==t)return;const a=/^#[0-9A-Za-z]+/.exec(r);if(!a)return;const u=a[0];(function(e){return v.test(e)})(u)||i.utils.report({message:h.rejected(u),node:e,word:e.params,result:n,ruleName:g})}):i.utils.report({result:n,ruleName:g,message:h.invalid(e.name),node:e,word:e.name}))})}},"no-duplicate-variables":function(e){return function(r,n){if(!i.utils.validateOptions(n,N,{actual:e}))return;let t=[];r.walkRules(e=>{let r=[];e.nodes.forEach(function(e){"atrule"===e.type&&(f(e)||(o(e)?r.includes(e.name)?i.utils.report({result:n,ruleName:N,message:$.rejected(e.name),node:e,word:e.name}):r.push(e.name):i.utils.report({result:n,ruleName:N,message:$.invalid(e.name),node:e,word:e.name})))})}),r.walkAtRules(e=>{"root"===e.parent.type&&(f(e)||(o(e)?t.includes(e.name)?i.utils.report({result:n,ruleName:N,message:$.rejected(e.name),node:e,word:e.name}):t.push(e.name):i.utils.report({result:n,ruleName:N,message:$.invalid(e.name),node:e,word:e.name})))})}},"color-hex-case":function(e){return function(r,n){i.utils.validateOptions(n,b,{actual:e,possible:["lower","upper"]})&&r.walkAtRules(function(r){const t=l.atRule(r);if(!f(t))if(o(t)){u(t.params).walk(r=>{if(p(r))return!1;if(!d(r))return;const a="lower"===e?r.value.toLowerCase():r.value.toUpperCase();r.value!==a&&i.utils.report({message:j.rejected(r.value,a),node:t,word:r.value,result:n,ruleName:b})})}else i.utils.report({result:n,ruleName:b,message:j.invalid(t.name),node:t,word:t.name})})}}},y=Object.keys(k).map(e=>i.createPlugin(s(e),k[e]));return t=y}export{i as __require};