(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "react", "react-transition-group", "./components/HeaderRoll", "./components/SubHeaderRoll", "./styles"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importStar)(require("react"));
    var react_transition_group_1 = require("react-transition-group");
    var HeaderRoll_1 = (0, tslib_1.__importDefault)(require("./components/HeaderRoll"));
    var SubHeaderRoll_1 = (0, tslib_1.__importDefault)(require("./components/SubHeaderRoll"));
    var styles_1 = require("./styles");
    var Roll = (0, react_1.forwardRef)(function (_a, ref) {
        var style = _a.style, titleHeader = _a.titleHeader, subTitleHeader = _a.subTitleHeader, titleSubHeader = _a.titleSubHeader, size = _a.size, _b = _a.textOverflow, textOverflow = _b === void 0 ? "ellipsis" : _b, statusSubHeader = _a.statusSubHeader, labelSubHeader = _a.labelSubHeader, className = _a.className, isOpenRoll = _a.isOpenRoll, mainContent = _a.mainContent, rollContent = _a.rollContent, classNameContent = _a.classNameContent, footer = _a.footer, trailContentHeader = _a.trailContentHeader, isIconStatusSubHeader = _a.isIconStatusSubHeader, props = (0, tslib_1.__rest)(_a, ["style", "titleHeader", "subTitleHeader", "titleSubHeader", "size", "textOverflow", "statusSubHeader", "labelSubHeader", "className", "isOpenRoll", "mainContent", "rollContent", "classNameContent", "footer", "trailContentHeader", "isIconStatusSubHeader"]);
        return (react_1.default.createElement(styles_1.RollStyled, (0, tslib_1.__assign)({ style: style, ref: ref, className: className, isOpenRoll: isOpenRoll }, props),
            react_1.default.createElement(HeaderRoll_1.default, { textOverflow: textOverflow, title: titleHeader, subTitle: subTitleHeader, size: size, className: "roll__header", trailContent: trailContentHeader }),
            react_1.default.createElement(react_transition_group_1.SwitchTransition, null,
                react_1.default.createElement(react_transition_group_1.CSSTransition, { classNames: "roll-anim", key: String(isOpenRoll), addEndListener: function (node, done) {
                        return node.addEventListener("transitionend", done, false);
                    } },
                    react_1.default.createElement("div", { className: "roll-anim" },
                        react_1.default.createElement(styles_1.RollContentWrapper, { className: classNameContent, size: size, isOpenRoll: isOpenRoll }, isOpenRoll ? (react_1.default.createElement("div", null,
                            titleSubHeader && (react_1.default.createElement(SubHeaderRoll_1.default, { textOverflow: textOverflow, title: titleSubHeader, statusLabel: statusSubHeader, textLabel: labelSubHeader, isIconLabel: isIconStatusSubHeader })),
                            rollContent)) : (mainContent)),
                        isOpenRoll && footer && react_1.default.createElement(styles_1.FooterStyled, null, footer))))));
    });
    Roll.displayName = "Roll";
    exports.default = Roll;
});
