import { helper } from '@ember/component/helper';
import { assert } from '@ember/debug';
import mapping from '../utils/css-mappings/index.js';

/**
 * Joins a list of classes
 *
 * @param classes - List of classes that will be joined
 */
function classNames(classNames = [], options) {
  let {
    componentName,
    ...rest
  } = options;
  let includeBase = options.addBase !== false;
  let str = `${classNames.join(' ')}`;
  if (options.componentName) {
    assert(`The component '${options.componentName}' doesn't have mappings defined`, mapping[options.componentName] !== undefined);
    const component = mapping[options.componentName];
    if (includeBase) {
      str = `${str} ${component.base}`;
    }
    for (let key in rest) {
      //@ts-expect-error
      if (component.properties[key] && component.properties[key]?.[rest[key]]) {
        //@ts-expect-error
        str = `${str} ${component.properties[key]?.[rest[key]]}`;
      }
    }
  }
  return str;
}
var classNames$1 = helper(classNames);

export { classNames, classNames$1 as default };
//# sourceMappingURL=class-names.js.map
