"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Renderables_1 = require("../Renderables");
/**
 * Implementation of the 'transition' type markup element.
 */
var Transition = /** @class */ (function () {
    function Transition(message) {
        this.spec = message;
    }
    /**
     * @inheritDoc
     */
    Transition.prototype.render = function (renderer, isNested) {
        var div = document.createElement('div');
        div.classList.add("lto-transition");
        div.setAttribute("wrapped", this.spec.wrapped || "in");
        div.setAttribute("direction", this.spec.direction || "down");
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e); });
        elements.forEach(function (e) { return e.forEach(function (x) { return div.appendChild(x); }); });
        var suggestions = div.querySelectorAll(".lto-suggestion");
        suggestions.forEach(function (suggestion) {
            div.removeChild(suggestion);
            renderer.appendSuggest(suggestion);
        });
        if (isNested) {
            div.classList.add("lto-nested");
        }
        return div;
    };
    return Transition;
}());
exports.Transition = Transition;
Renderables_1.default.register("transition", Transition);
//# sourceMappingURL=index.js.map