import React, { useMemo } from 'react';
import { UdpFormRenderer } from '../UdpFormsPrivateForm/UdpFormRenderer';
import { useHistory } from 'react-router-dom';
import { useUser } from '../../../utilities/auth/useUser';
import { useTenant } from '../../../utilities/tenant/useTenant';
import { useActions } from '../../../hooks/useActions';
import { useSnackbar } from 'notistack';
import { useUdpFormParameters } from '../UdpFormsUtils/Utils';
export const UdpPublicForm = (props) => {
    const history = useHistory();
    const { enqueueSnackbar, closeSnackbar } = useSnackbar();
    const { formId, formVersion, submissionId, tenantId, urlContext } = useUdpFormParameters();
    const mergedContext = useMemo(() => (Object.assign(Object.assign({}, urlContext), { generic1: props.generic1 || urlContext.generic1, generic2: props.generic2 || urlContext.generic2, generic3: props.generic3 || urlContext.generic3 })), [urlContext, props.generic1, props.generic2, props.generic3]);
    return (React.createElement(UdpFormRenderer, Object.assign({ isPublicMode: true, formId: formId, formVersion: formVersion, submissionId: submissionId, tenantId: tenantId, urlContext: mergedContext, callbackUrl: null, history: history, enqueueSnackbar: enqueueSnackbar, closeSnackbar: closeSnackbar }, props)));
};
//# sourceMappingURL=UdpPublicForm.js.map