"use strict";
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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OnboardingBase = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const react_core_1 = require("@patternfly/react-core");
const Chatbot_1 = require("../Chatbot");
const ChatbotModal_1 = __importDefault(require("../ChatbotModal/ChatbotModal"));
const OnboardingBase = (_a) => {
    var { handleModalToggle, isModalOpen, onPrimaryAction, onSecondaryAction, primaryActionBtn = 'Continue', secondaryActionBtn = 'Skip', title = 'Onboarding', headerImage, headerImageAltText = '', displayMode = Chatbot_1.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 = ((0, jsx_runtime_1.jsx)(ChatbotModal_1.default, 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: (0, jsx_runtime_1.jsx)("section", { className: `pf-chatbot__onboarding--section`, "aria-label": title, tabIndex: -1, ref: innerRef, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_core_1.ModalBody, { className: "pf-chatbot__onboarding--modal-body", children: [!isCompact && headerImage && ((0, jsx_runtime_1.jsx)("div", { className: "pf-chatbot__onboarding--header", children: (0, jsx_runtime_1.jsx)("img", { src: headerImage, className: "pf-chatbot__onboarding--image", alt: headerImageAltText }) })), (0, jsx_runtime_1.jsxs)("div", { className: "pf-chatbot__onboarding--modal-text", children: [(0, jsx_runtime_1.jsx)("h1", { className: "pf-chatbot__onboarding--title", children: title }), (0, jsx_runtime_1.jsx)(react_core_1.Content, { children: children })] })] }), (0, jsx_runtime_1.jsxs)(react_core_1.ModalFooter, { className: "pf-chatbot__onboarding--footer", children: [(0, jsx_runtime_1.jsx)(react_core_1.Button, { isBlock: true, variant: "primary", onClick: handlePrimaryAction, form: "onboarding-form", size: "lg", children: primaryActionBtn }, "onboarding-modal-primary"), (0, jsx_runtime_1.jsx)(react_core_1.Button, { isBlock: true, variant: "secondary", onClick: handleSecondaryAction, size: "lg", children: secondaryActionBtn }, "onboarding-modal-secondary")] })] }) }) })));
    return modal;
};
exports.OnboardingBase = OnboardingBase;
const Onboarding = (0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(exports.OnboardingBase, Object.assign({ innerRef: ref }, props))));
exports.default = Onboarding;
