var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { Button, Content, ModalBody, ModalFooter } from '@patternfly/react-core';
import { ChatbotDisplayMode } from '../Chatbot';
import ChatbotModal from '../ChatbotModal/ChatbotModal';
export const OnboardingBase = (_a) => {
    var { handleModalToggle, isModalOpen, onPrimaryAction, onSecondaryAction, primaryActionBtn = 'Continue', secondaryActionBtn = 'Skip', title = 'Onboarding', headerImage, headerImageAltText = '', displayMode = ChatbotDisplayMode.default, className, children, innerRef, ouiaId = 'Onboarding', isCompact } = _a, props = __rest(_a, ["handleModalToggle", "isModalOpen", "onPrimaryAction", "onSecondaryAction", "primaryActionBtn", "secondaryActionBtn", "title", "headerImage", "headerImageAltText", "displayMode", "className", "children", "innerRef", "ouiaId", "isCompact"]);
    const handlePrimaryAction = (_event) => {
        handleModalToggle(_event);
        onPrimaryAction && onPrimaryAction(_event);
    };
    const handleSecondaryAction = (_event) => {
        onSecondaryAction(_event);
    };
    const modal = (_jsx(ChatbotModal, Object.assign({ isOpen: isModalOpen, ouiaId: ouiaId, "aria-labelledby": "onboarding-title", "aria-describedby": "onboarding-modal", className: `pf-chatbot__onboarding-modal pf-chatbot__onboarding-modal--${displayMode} ${isCompact ? 'pf-m-compact' : ''} ${className ? className : ''}`, displayMode: displayMode, onClose: handleModalToggle }, props, { children: _jsx("section", { className: `pf-chatbot__onboarding--section`, "aria-label": title, tabIndex: -1, ref: innerRef, children: _jsxs(_Fragment, { children: [_jsxs(ModalBody, { className: "pf-chatbot__onboarding--modal-body", children: [!isCompact && headerImage && (_jsx("div", { className: "pf-chatbot__onboarding--header", children: _jsx("img", { src: headerImage, className: "pf-chatbot__onboarding--image", alt: headerImageAltText }) })), _jsxs("div", { className: "pf-chatbot__onboarding--modal-text", children: [_jsx("h1", { className: "pf-chatbot__onboarding--title", children: title }), _jsx(Content, { children: children })] })] }), _jsxs(ModalFooter, { className: "pf-chatbot__onboarding--footer", children: [_jsx(Button, { isBlock: true, variant: "primary", onClick: handlePrimaryAction, form: "onboarding-form", size: "lg", children: primaryActionBtn }, "onboarding-modal-primary"), _jsx(Button, { isBlock: true, variant: "secondary", onClick: handleSecondaryAction, size: "lg", children: secondaryActionBtn }, "onboarding-modal-secondary")] })] }) }) })));
    return modal;
};
const Onboarding = forwardRef((props, ref) => (_jsx(OnboardingBase, Object.assign({ innerRef: ref }, props))));
export default Onboarding;
