import purifier from "dompurify";
import { IC_CUSTOM_ALLOWED_COMPONENTS } from "./constants";
/* istanbul ignore next */
const getCustomElementHandling = (allowICPrefix) => ({
    CUSTOM_ELEMENT_HANDLING: {
        tagNameCheck: (tagName) => (allowICPrefix && tagName.startsWith("ic-")) ||
            IC_CUSTOM_ALLOWED_COMPONENTS.includes(tagName),
        attributeNameCheck: /.*/,
    },
});
export const sanitizeHTMLString = (html) => {
    return purifier.sanitize(html, getCustomElementHandling(true));
};
export const sanitizeHTMLIconString = (html) => {
    return purifier.sanitize(html, getCustomElementHandling(false));
};
//# sourceMappingURL=common-helpers.js.map
