import { h } from './index-dd1fc9a4.js';
import { B as Blockquote } from './Blockquote-1d6ee92f.js';
import './IntersectionHelper-2c725527.js';
import { h as htmlSerializer, P as PrismicRichText } from './PrismicResponsiveImage-274c411c.js';
var SliceNormalText = function (_a) {
    var slice = _a.slice;
    return (h(PrismicRichText, { richText: slice.primary.content, htmlSerializer: htmlSerializer }));
};
var SliceRawHtml = function (_a) {
    var slice = _a.slice;
    return (h("div", { class: "prismic-raw-html", innerHTML: slice.primary.html_content.map(function (c) { return c.text; }).join('') }));
};
var SliceQuote = function (_a) {
    var slice = _a.slice;
    return (h(Blockquote, null, h("div", null, h(PrismicRichText, { richText: slice.primary.quote })), slice.primary.name ? (h("cite", null, slice.primary.name, h("span", null, slice.primary.description))) : null));
};
var SliceFloatingImage = function (_a) {
    var slice = _a.slice;
    return (h("figure", null, h("img", { loading: 'lazy', src: slice.primary.illustration.url, alt: slice.primary.illustration.alt })));
};
var SliceAd = function (_a) {
    var slice = _a.slice;
    return (h("aside", { class: "prismic-ad" }, h("a", { href: slice.primary.link.url, target: slice.primary.link.target }, h(PrismicRichText, { richText: slice.primary.text }), h("img", { class: "prismic-ad__image", loading: 'lazy', alt: slice.primary.image.alt, height: parseInt(slice.primary.image.dimensions.height, 10) / 2, width: parseInt(slice.primary.image.dimensions.width, 10) / 2, src: slice.primary.image.url, srcset: slice.primary.image['1x'].url + " 1x, " + slice.primary.image.url + " 2x" }))));
};
var PrismicBodySlice = function (_a) {
    var slice = _a.slice, key = _a.key;
    switch (slice.slice_type) {
        case 'normal_text':
            return h(SliceNormalText, { slice: slice, key: key });
        case 'raw_html':
            return h(SliceRawHtml, { slice: slice, key: key });
        case 'quote':
            return h(SliceQuote, { slice: slice, key: key });
        case 'floating_image':
            return h(SliceFloatingImage, { slice: slice, key: key });
        case 'ad':
            return h(SliceAd, { slice: slice, key: key });
    }
    return null;
};
var PrismicContent = function (_a) {
    var content = _a.content;
    return content.map(function (c, i) { return h(PrismicBodySlice, { slice: c, key: i }); });
};
export { PrismicContent as P, PrismicBodySlice as a };
