/// Helper for `o-brand` function.
/// @access private
@function _oMessageGet($variables, $from: null) {
	@return oBrandGet($component: 'o-message', $variables: $variables, $from: $from);
}

/// Helper for `o-brand` function.
/// @access private
@function _oMessageSupports($variant) {
	@return oBrandSupportsVariant($component: 'o-message', $variant: $variant);
}

/// Shared variables between all brands
/// @access private
$_o-message-shared-brand-variables: (
	'success': (
		'foreground-color': oPrivateColorsMix('o3-color-palette-black', 'o3-color-palette-jade', $percentage: 43),
		'background-color': oPrivateColorsMix('o3-color-palette-jade', $percentage: 20),
		'icon': 'tick'
	),
	'error': (
		'foreground-color': oPrivateColorsMix('o3-color-palette-black', 'o3-color-palette-crimson', $percentage: 12.5),
		'background-color': oPrivateColorsMix('o3-color-palette-crimson', $percentage: 10),
		'icon': 'warning-alt'
	)
);

@if oBrandIs('core') {
	@include oBrandDefine('o-message', 'core', (
		'variables': map-merge($_o-message-shared-brand-variables, (
			'feedback': (
				'foreground-color': oPrivateFoundationGet('o3-color-use-case-body-text'),
				'highlight-color': oPrivateFoundationGet('o3-color-palette-teal'),
				'button-type': 'primary',
				'background-color': oPrivateFoundationGet('o3-color-palette-white'),
				'align': center
			),
			'neutral': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-white-60',
				'icon': 'info'
			),
			'inform': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-wheat',
			),
		)),
		'supports-variants': (
			'alert',
			'error',
			'inform',
			'neutral',
			'notice',
			'success',
			'feedback'
		)
	));
}

@if oBrandIs('internal') {
	@include oBrandDefine('o-message', 'internal', (
		'variables': map-merge($_o-message-shared-brand-variables, (
			'feedback': (
				'foreground-color': oPrivateFoundationGet('o3-color-use-case-body-text'),
				'highlight-color': oPrivateFoundationGet('o3-color-palette-teal'),
				'button-type': 'primary',
				'background-color': oPrivateFoundationGet('o3-color-palette-white'),
				'align': center
			),
			'neutral': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-slate-white-15',
				'icon': 'info'
			),
			'inform': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-slate-white-15',
			),
			'inform-inverse': (
				'foreground-color': 'o3-color-palette-white',
				'background-color': 'o3-color-palette-slate'
			),
			'warning': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-lemon'
			),
			'warning-light': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': oPrivateColorsMix('o3-color-palette-lemon', 'o3-color-palette-white', $percentage: 60)
			)
		)),
		'supports-variants': (
			'action',
			'alert',
			'error',
			'inform',
			'inform-inverse',
			'neutral',
			'notice',
			'success',
			'warning',
			'warning-light',
			'feedback'
		)
	));
}

@if oBrandIs('whitelabel') {
	@include oBrandDefine('o-message', 'whitelabel', (
		'variables': map-merge($_o-message-shared-brand-variables, (
			'neutral': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-white',
				'icon': 'info'
			),
			'inform': (
				'foreground-color': 'o3-color-palette-black',
				'background-color': 'o3-color-palette-white',
			)
		)),
		'supports-variants': (
			'alert',
			'notice',
			'error',
			'inform',
			'neutral',
			'success'
		)
	));
}
