import{__require as e}from"../../../../postcss-media-query-parser/dist/index.mjs";import r from"../../../../../_virtual/index13.mjs";import{__require as t}from"../../utils/atRuleParamIndex.mjs";import{__require as s}from"../../utils/declarationValueIndex.mjs";import{__require as o}from"../../utils/eachRoot.mjs";import{__require as a}from"../../utils/findCommentsInRaws.mjs";import{__require as n}from"../../utils/sassValueParser/index.mjs";import{__require as u}from"../../utils/isWhitespace.mjs";import{__require as i}from"../../utils/namespace.mjs";import{__require as l}from"../../utils/ruleUrl.mjs";var c,d;function p(){if(d)return c;d=1;const p=e().default,{utils:m}=r,f=t(),x=s(),g=o(),I=a(),h=n(),v=u(),_=i(),b=l(),q=_("operator-no-unspaced"),j=m.ruleMessages(q,{expectedAfter:e=>`Expected single space after "${e}"`,expectedBefore:e=>`Expected single space before "${e}"`}),y={url:b(q)};function k({string:e,globalIndex:r,startIndex:t,endIndex:s,node:o,result:a}){const n=e.substring(t,s+1),u=" "===e[t-1]&&!v(e[t-2])||function(e,r){let t=r;for(;t&&v(e[t]);){if("\n"===e[t])return!0;t--}return!1}(e,t-1);if(!u){const e=r+t;m.report({ruleName:q,result:a,node:o,message:j.expectedBefore(n),index:e,endIndex:e+n.length})}if(!(" "===e[s+1]&&!v(e[s+2])||"\n"===e[s+1]||"\r\n"===e.substr(s+1,2))){const e=r+t;m.report({ruleName:q,result:a,node:o,message:j.expectedAfter(n),index:e,endIndex:e+n.length})}}function w(e){return(r,t)=>{m.validateOptions(t,q,{actual:e})&&g(r,function(e){const r=e.source.input.css;if(""===r.trim())return;E({root:e,result:t,checker:k})})}}function E({root:e,result:r,checker:t}){function s(e,r){const t=/#{(.*?)}/g,s=[];let o=t.exec(e);for(r=isNaN(r)?0:Number(r);null!==o;)s.push({source:o[0],operators:h({string:o[0],globalIndex:o.index+r})}),o=t.exec(e);return s}const o=/url\(\s*['"]?data:.+['"]?\s*\)/;e.walk(e=>{if("unicode-range"===e.prop)return;let a=[];if(void 0!==e.value){if(o.test(e.value))return a;a.push({source:e.value,operators:h({string:e.value,globalIndex:x(e),isAfterColon:"$"===e.prop[0]})})}if(void 0!==e.prop&&(a=a.concat(s(e.prop))),void 0!==e.selector&&(a=a.concat(s(e.selector))),"atrule"===e.type){if("forward"===e.name||"use"===e.name||"at-root"===e.name||"scope"===e.name)return;if("apply"===e.name||"custom-variant"===e.name||"reference"===e.name||"source"===e.name||"theme"===e.name||"utility"===e.name||"variant"===e.name)return;"media"===e.name||"import"===e.name?p(e.params).walk(r=>{const t=r.type;if(["keyword","media-type","media-feature"].includes(t))a=a.concat(s(r.value,f(e)+r.sourceIndex));else if("value"===t)a.push({source:r.value,operators:h({string:r.value,globalIndex:f(e)+r.sourceIndex,isAfterColon:!0})});else if("url"===t){const t='"'===r.value[0]||"'"===r.value[0],s=r.value.search(/\s/)>-1;(t||s)&&a.push({source:r.value,operators:h({string:r.value,globalIndex:f(e)+r.sourceIndex,isAfterColon:!0})})}}):a.push({source:e.params,operators:h({string:e.params,globalIndex:f(e),isAfterColon:!0})})}a.forEach(s=>{s.operators&&s.operators.length>0&&s.operators.forEach(o=>{t({string:s.source,globalIndex:o.globalIndex,startIndex:o.startIndex,endIndex:o.endIndex,node:e,result:r})})})}),I(e.source.input.css).forEach(o=>{const a=o.source.start+o.raws.startToken.length+o.raws.left.length;"css"===o.type&&s(o.text).forEach(s=>{s.operators&&s.operators.length>0&&s.operators.forEach(o=>{t({string:s.source,globalIndex:o.globalIndex+a,startIndex:o.startIndex,endIndex:o.endIndex,node:e,result:r})})})})}return w.ruleName=q,w.messages=j,w.meta=y,w.calculationOperatorSpaceChecker=E,c=w}export{p as __require};