%%% Loads all the AppleMintChoco styles
%%% written by Nova de Hi
\RequirePackage{l3keys2e}
\ExplSyntaxOn

\keys_define:nn { amcontribkorean }
{
	variorefopt		.tl_set:N = \opt_variorefopt_tl,
	cleverefopt	.tl_set:N = \opt_cleverefopt_tl,
	hyperrefopt		.tl_set:N = \opt_hyperrefopt_tl,
	kopunctopt		.tl_set:N = \opt_kopunctopt_tl,
	varioref		.bool_set:N = \opt_varioref_bool,
	cleveref		.bool_set:N = \opt_cleveref_bool,
	hyperref		.bool_set:N = \opt_hyperref_bool,
	kopunct			.bool_set:N = \opt_kopunct_bool
}

\keys_set:nn { amcontribkorean }
{
	variorefopt = {},
	cleverefopt = {},
	hyperrefopt = {},
	kopunctopt = {},
	varioref = true,
	cleveref = true,
	hyperref = true,
	kopunct = true
}

\ProcessKeysOptions { amcontribkorean }

\bool_if:NT \opt_kopunct_bool
{
	\tl_if_empty:NTF \opt_kopunctopt_tl
	{
		\RequirePackage { kopunct }
	}
	{
		\exp_last_unbraced:NNo 
		\RequirePackage [ \opt_kopunctopt_tl ] { kopunct }
	}
}

\clist_set:Nn \l_tmpa_clist { hyperref, varioref, cleveref }

\clist_map_inline:Nn \l_tmpa_clist
{
	\bool_if:cT { opt_#1_bool }
	{
		\@ifpackageloaded{ #1 }{}{\RequirePackage{#1}}
		\tl_if_empty:cTF { opt_#1opt_tl }
		{
			\RequirePackage { #1-korean }
		}
		{
			\exp_last_unbraced:NNo \RequirePackage [ \use:c { opt_#1opt_tl } ] { #1-korean }
		}
	}
}


\ExplSyntaxOff
