import{isString as e,isRegExp as t}from"../../utils/validateTypes.mjs";import{declarationValueIndex as o}from"../../utils/nodeFieldIndices.mjs";import s from"../../utils/findFontFamily.mjs";import{fontFamilyKeywords as i}from"../../reference/keywords.mjs";import n from"../../utils/optionsMatches.mjs";import a from"../../utils/report.mjs";import m from"../../utils/ruleMessages.mjs";import l from"../../utils/validateOptions.mjs";const r="font-family-no-duplicate-names",u=m(r,{rejected:e=>`Unexpected duplicate font-family name ${e}`}),f=e=>!("quote"in e)&&i.has(e.value.toLowerCase()),d=(i,m)=>(d,c)=>{function p(e,t,o,s){a({result:c,ruleName:r,message:u.rejected,messageArgs:[e],node:s,index:t,endIndex:t+o})}l(c,r,{actual:i},{actual:m,possible:{ignoreFontFamilyNames:[e,t]},optional:!0})&&d.walkDecls(/^font(-family)?$/i,e=>{const t=new Set,i=new Set,a=s(e.value);if(0!==a.length)for(const s of a){const a=s.value.trim();if(n(m,"ignoreFontFamilyNames",a))continue;const l="quote"in s?s.quote+a+s.quote:a;if(f(s)){if(t.has(a.toLowerCase())){p(a,o(e)+s.sourceIndex,l.length,e);continue}t.add(a)}else i.has(a)?p(a,o(e)+s.sourceIndex,l.length,e):i.add(a)}})};d.ruleName=r,d.messages=u,d.meta={url:"https://stylelint.io/user-guide/rules/font-family-no-duplicate-names"};export{d as default};