import { built_default } from "../config/dist/esm/built.mjs";
import { CachedIntl } from "../utils/intl.mjs";

//#region ../react-intlayer/dist/esm/@intlayer/core/dist/esm/formatters/list.mjs
/**
* Formats an array of values into a localized list string using the Intl API.
*
* @example
* list(['apple', 'banana', 'orange']);
* // "apple, banana, and orange"
*
* @example
* list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });
* // "rouge, vert ou bleu"
*
* @example
* list([1, 2, 3], { type: 'unit' });
* // "1, 2, 3"
*/
const list = (values, options) => new CachedIntl.ListFormat(options?.locale ?? built_default?.internationalization?.defaultLocale, {
	type: options?.type ?? "conjunction",
	style: options?.style ?? "long",
	...options
}).format(values.map(String));

//#endregion
export { list };
//# sourceMappingURL=list.mjs.map