import { getStyleAndFilteredProps } from '../../theme/styled-system';
export const resolvePropsToStyle = (styledSystemProps, propStyle, theme, platform, debug, currentBreakpoint, strictMode, getResponsiveStyles, INTERNAL_themeStyle, stateProps) => {
  let flattenInternalThemeProps = INTERNAL_themeStyle;
  let fontSize;

  if (Array.isArray(flattenInternalThemeProps)) {
    var _flattenInternalTheme;

    flattenInternalThemeProps = flattenInternalThemeProps.flat();
    fontSize = (_flattenInternalTheme = flattenInternalThemeProps[0]) === null || _flattenInternalTheme === void 0 ? void 0 : _flattenInternalTheme.fontSize;
  } else {
    var _flattenInternalTheme2;

    fontSize = (_flattenInternalTheme2 = flattenInternalThemeProps) === null || _flattenInternalTheme2 === void 0 ? void 0 : _flattenInternalTheme2.fontSize;
  }

  const modifiedStyledSytemProps = {
    fontSize,
    ...styledSystemProps
  };
  const {
    unResolvedProps,
    styleFromProps,
    restDefaultProps,
    dataSet
  } = getStyleAndFilteredProps({
    styledSystemProps: modifiedStyledSytemProps,
    theme,
    debug,
    currentBreakpoint,
    strictMode,
    getResponsiveStyles,
    platform
  });
  const {
    // unResolvedProps: unResolvedProps1,
    styleFromProps: inlineStateStyleFromProps // restDefaultProps: restDefaultProps1,
    // dataSet: dataSet1,

  } = getStyleAndFilteredProps({
    styledSystemProps: stateProps,
    theme,
    debug,
    currentBreakpoint,
    strictMode,
    getResponsiveStyles,
    platform
  });

  if (propStyle) {
    return {
      style: [INTERNAL_themeStyle, styleFromProps, stateProps === null || stateProps === void 0 ? void 0 : stateProps.INTERNAL_themeStyle, inlineStateStyleFromProps, propStyle],
      styleFromProps,
      unResolvedProps,
      restDefaultProps,
      dataSet
    };
  } else {
    return {
      style: [INTERNAL_themeStyle, styleFromProps, stateProps === null || stateProps === void 0 ? void 0 : stateProps.INTERNAL_themeStyle, inlineStateStyleFromProps],
      styleFromProps,
      unResolvedProps,
      restDefaultProps,
      dataSet
    };
  }
};
//# sourceMappingURL=resolvePropsToStyle.js.map