// (C) 2026 GoodData Corporation
/**
 * @internal
 */
export const parseAcceptedTypes = (acceptedFileTypes) => {
    const extensions = [];
    const exactMimeTypes = [];
    const wildcardMimePrefixes = [];
    acceptedFileTypes.split(",").forEach((token) => {
        const type = token.trim().toLowerCase();
        if (!type) {
            return;
        }
        if (type.startsWith(".")) {
            extensions.push(type);
        }
        else if (type.endsWith("/*")) {
            wildcardMimePrefixes.push(type.slice(0, -1)); // e.g. "image/" from "image/*"
        }
        else {
            exactMimeTypes.push(type);
        }
    });
    return { extensions, exactMimeTypes, wildcardMimePrefixes };
};
