function getAttributeMap(attributes = []) {
  const map = new Map();

  for (let i = 0; i < attributes.length; i += 2) {
    const name = attributes[i];
    const value = attributes[i + 1];
    if (!name || !value) continue;

    const normalizedValue = value.trim();

    if (normalizedValue) {
      map.set(name.toLowerCase(), normalizedValue);
    }
  }

  return map;
}
@param {Array<string|undefined>=} attributes
@return {Map<string, string>}