function generateCSSClasses(styleMap) {
  const keySet = new Set(styleMap.values());
  const classMap = new Map();
  let counter = 1;
  for (const key of keySet) {
    classMap.set(key, `c${counter++}`);
  }
  return classMap;
}
Generates CSS classes from a style map.

@param {Map} styleMap - Map of elements to style keys
@returns {Map} Map of style keys to class names