import{tokenize as e,ParseErrorWithToken as s,ParseErrorMessage as r}from"../../../../@csstools/css-tokenizer/dist/index.mjs";import{declarationValueIndex as t,atRuleParamIndex as i}from"../../utils/nodeFieldIndices.mjs";import n from"../../utils/isStandardSyntaxSelector.mjs";import o from"../../utils/optionsMatches.mjs";import a from"../../utils/report.mjs";import l from"../../utils/ruleMessages.mjs";import u from"../../utils/validateOptions.mjs";const m="string-no-newline",c=/\r?\n/,d=l(m,{rejected:"Unexpected newline in string"}),p=(l,p)=>(f,g)=>{function j(t,i,n){c.test(i)&&e({css:i},{onParseError:e=>{if(!(e instanceof s))return;if(e.message!==r.UnexpectedNewLineInString)return;const[,,i,o]=e.token,l=n(t);a({message:d.rejected,messageArgs:[],node:t,index:l+i,endIndex:l+o+1,result:g,ruleName:m})}})}u(g,m,{actual:l},{actual:p,possible:{ignore:["at-rule-preludes","declaration-values"]},optional:!0})&&f.walk(e=>{switch(e.type){case"atrule":if(o(p,"ignore","at-rule-preludes"))break;j(e,e.params,i);break;case"decl":if(o(p,"ignore","declaration-values"))break;j(e,e.value,t);break;case"rule":!function(e){if(!c.test(e.selector))return;if(!n(e.selector))return;j(e,e.selector,()=>0)}(e)}})};p.ruleName=m,p.messages=d,p.meta={url:"https://stylelint.io/user-guide/rules/string-no-newline"};export{p as default};