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

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

// Define shared brand configurations
$_o-labels-shared-brand-config: (
	font-scale: -1,
	padding-vertical: oPrivateSpacingByName('s1'),
	padding-horizontal: oPrivateSpacingByName('s2'),
	border-width: 1px,
	'big': (
		font-scale: 0,
		padding-vertical: oPrivateSpacingByName('s2'),
		padding-horizontal: oPrivateSpacingByName('s2')
	),
	'small': (
		font-scale: -1,
		padding-vertical: 2px,
		padding-horizontal: 4px
	)
);

// Define core brand
@if oBrandIs('core') {
	@include oBrandDefine('o-labels', 'core', (
		'variables': map-merge($_o-labels-shared-brand-config, (
			text-color: oPrivateFoundationGet('o3-color-palette-black'),
			background-color: oPrivateFoundationGet('o3-color-palette-wheat'),
			'content-commercial': (
				background-color: oPrivateColorsMix('o3-color-palette-jade', 'o3-color-palette-black', $percentage: 83.334)
			),
			'content-premium': (
				background-color: oPrivateFoundationGet('o3-color-palette-black')
			),
			'lifecycle-beta': (
				background-color: oPrivateFoundationGet('o3-color-palette-paper'),
				border-color: oPrivateFoundationGet('o3-color-palette-black-20'),
				text-color: oPrivateFoundationGet('o3-color-palette-black-80'),
				text-transform: uppercase,
				padding-vertical: oPrivateSpacingByName('s1'),
				padding-horizontal: oPrivateSpacingByName('s3'),
			)
		)),
		'supports-variants': (
			'indicators',
			'timestamps',
			'big',
			'small',
			'content-commercial',
			'content-premium',
			'lifecycle-beta'
		)
	));
}

// Define internal brand
@if oBrandIs('internal') {
	@include oBrandDefine('o-labels', 'internal', (
		'variables': map-merge($_o-labels-shared-brand-config, (
			background-color: oPrivateColorsMix('o3-color-palette-black', 'o3-color-palette-white', 10),
			'support-active': (
				background-color: oPrivateColorsMix('o3-color-palette-jade', 'o3-color-palette-black', 70)
			),
			'support-dead': (
				background-color: oPrivateFoundationGet('o3-color-palette-black')
			),
			'support-deprecated': (
				background-color: oPrivateFoundationGet('o3-color-palette-crimson')
			),
			'support-experimental': (
				background-color: oPrivateFoundationGet('o3-color-palette-lemon')
			),
			'support-maintained': (
				background-color: oPrivateColorsMix('o3-color-palette-jade', 'o3-color-palette-black', 70)
			),
			'tier-bronze': (
				// NOTE: service tiers not in o-colors yet, will be moved if another
				// component needs to use these colours
				background-color: #b78d83
			),
			'tier-gold': (
				// NOTE: service tiers not in o-colors yet, will be moved if another
				// component needs to use these colours
				background-color: #b89d62
			),
			'tier-platinum': (
				// NOTE: service tiers not in o-colors yet, will be moved if another
				// component needs to use these colours
				background-color: #e5e4e2
			),
			'tier-silver': (
				// NOTE: service tiers not in o-colors yet, will be moved if another
				// component needs to use these colours
				background-color: #c0c0c0
			),
			'oxford': (
				background-color: oPrivateFoundationGet('o3-color-palette-oxford')
			),
			'teal': (
				background-color: oPrivateFoundationGet('o3-color-palette-teal-50')
			),
			'lemon': (
				background-color: oPrivateFoundationGet('o3-color-palette-lemon')
			),
			'slate': (
				background-color: oPrivateFoundationGet('o3-color-palette-slate')
			),
			'jade': (
				background-color: oPrivateFoundationGet('o3-color-palette-jade')
			),
			'crimson': (
				background-color: oPrivateFoundationGet('o3-color-palette-crimson')
			),
			'mandarin': (
				background-color: oPrivateFoundationGet('o3-color-palette-mandarin')
			)
		)),
		'supports-variants': (
			'big',
			'small',
			'support-active',
			'support-dead',
			'support-deprecated',
			'support-experimental',
			'support-maintained',
			'tier-bronze',
			'tier-gold',
			'tier-platinum',
			'tier-silver',
			'oxford',
			'teal',
			'lemon',
			'slate',
			'jade',
			'crimson',
			'mandarin'
		)
	));
}

// Define whitelabel brand
@if oBrandIs('whitelabel') {
	@include oBrandDefine('o-labels', 'whitelabel', (
		'variables': map-merge($_o-labels-shared-brand-config, (
			background-color: oPrivateColorsMix('o3-color-palette-black', 'o3-color-palette-white', 10)
		)),
		'supports-variants': (
			'big',
			'small'
		)
	));
}
