import { _ as __rest } from './tslib.es6-ab63fd84.js';
import React__default, { useContext } from 'react';
import { createStyles, rem, Box, clsx } from '@mantine/core';
import './index-c3177e04.js';
import '@mantine/dates';
import './index-a8162282.js';
import './index-91c6a49c.js';
import './index-43584299.js';
import './index-4e6b8a2b.js';
import { T as Text } from './index-d0a1200e.js';
import { B as Button } from './index-f71a880f.js';
import './index-38e03570.js';
import './index.styles-3ba274d2.js';
import { u as useTranslations } from './index-960c3169.js';
import '@mantine/hooks';
import './utils-32d7d5af.js';
import './index-f21110d2.js';
import { C as CardWrapperContext } from './context-e9fa0aef.js';
import { H as HealthToolFormWrapper } from './index-70e81356.js';

var useStyles = createStyles((theme, { hasOnClickFn }) => {
    return {
        root: {
            position: 'relative',
            display: 'flex',
            flexDirection: 'column',
            gap: rem(16),
        },
        sponsorBox: {
            display: 'flex',
            gap: rem(12),
            alignItems: 'center',
            backgroundColor: theme.colors.neutral[0],
            border: `1px solid ${theme.colors.neutral[1]}`,
            borderRadius: rem(4),
            padding: '4px 12px',
            alignSelf: 'flex-start',
        },
        sponsorLogo: {
            maxHeight: rem(32),
        },
        btn: {
            minWidth: rem(180),
            [theme.fn.largerThan('sm')]: {
                alignSelf: 'flex-end',
            },
            visibility: hasOnClickFn ? 'visible' : 'hidden',
        },
    };
});

const BabyPoopForm = (_a) => {
    var { babyPoopPage, onClickFindOut, currentUrl, sponsorLogo, btnProps, styles, classNames } = _a, props = __rest(_a, ["babyPoopPage", "onClickFindOut", "currentUrl", "sponsorLogo", "btnProps", "styles", "classNames"]);
    const { t } = useTranslations();
    const { classes } = useStyles({ hasOnClickFn: Boolean(onClickFindOut) }, { name: 'BabyPoopForm', styles, classNames });
    const { classes: wrapperClasses = {} } = useContext(CardWrapperContext);
    return (React__default.createElement(HealthToolFormWrapper.FormRow, null,
        React__default.createElement(Box, Object.assign({ className: classes.root }, props),
            sponsorLogo && (React__default.createElement(Box, { className: classes.sponsorBox },
                React__default.createElement(Text, { size: "p4" }, t('common.sponsoredBy')),
                React__default.createElement("img", { loading: "lazy", src: sponsorLogo, alt: "sponsor", className: classes.sponsorLogo }))),
            React__default.createElement(Text, { size: "p3", as: "div", className: "description", dangerouslySetInnerHTML: {
                    __html: babyPoopPage.description,
                } }),
            React__default.createElement(Button, Object.assign({ className: clsx(classes.btn, wrapperClasses.submitBtn), onClick: onClickFindOut, dataEventCategory: "Health Tool", dataEventAction: "Baby Stool Inquiry", dataEventLabel: currentUrl }, btnProps), t('babyPoop.findOut')))));
};

export { BabyPoopForm as B };
