import { isBreakpointsForPrefixType, isFlexJustifyContentType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { FlexJustifyContent } from '../../../constants/ui';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
/**
 * A class for format FlexJustifyContentType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveFlexJustifyContentFormatter extends ResponsiveClassStringFormatter {
  /**
   * This function takes a FlexJustifyContentType and a breakpoint and returns CSS class string.
   *
   * @param {FlexJustifyContentType} input - FlexJustifyContentType input
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} - A string.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isFlexJustifyContentType(input)) {
      const mappedInput = this.mapInput(input);
      return `${prefix}v-justify-${mappedInput}`;
    }
    else {
      LogUtility.warn(`The flex justifyContent value ${input} is invalid, it must be a value of: `, FlexJustifyContent);
      return '';
    }
  }
  /**
   * The function maps a FlexJustifyContentType input to a corresponding string value.
   *
   * @param {FlexJustifyContentType} input - The input parameter is of type FlexJustifyContentType, which
   * is likely an enum or a string type that represents the different options for justifying content
   * within a flex container. The function maps these options to their corresponding values in CSS.
   * @returns {string} The function `mapInput` takes in a parameter `input` of type `FlexJustifyContentType` and
   * returns a string based on the value of `input`. If `input` is `"start"`, `"center"`, or `"end"`, the
   * function returns the same string. If `input` is `"space-around"`, `"space-between"`, or
   * `"space-evenly"`,
   */
  mapInput(input) {
    switch (input) {
      case 'start':
        return 'start';
      case 'center':
        return 'center';
      case 'end':
        return 'end';
      case 'space-around':
        return 'around';
      case 'space-between':
        return 'between';
      case 'space-evenly':
        return 'evenly';
    }
  }
}
export default new ResponsiveFlexJustifyContentFormatter();
