"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var render_1 = require("../dom/render");
var manaToXml_1 = require("../../helpers/manaToXml");
var VirtualNode_1 = require("./VirtualNode");
var HaikuHTMLRenderer = (function () {
    function HaikuHTMLRenderer(config) {
        this.config = config;
        this.doc = new VirtualNode_1.VirtualDoc({});
        if (!this.config.options) {
            throw new Error("HaikuHTMLRenderer requires config.options");
        }
        if (!this.config.options.size) {
            throw new Error("HaikuHTMLRenderer requires config.options.size");
        }
        if (!this.config.options.user) {
            throw new Error("HaikuHTMLRenderer requires config.options.user");
        }
    }
    HaikuHTMLRenderer.prototype.render = function (mount, virtualContainer, virtualTree, component) {
        var enhancedMana = render_1.default(mount || new VirtualNode_1.default('div', {}, [], this.doc), virtualContainer, virtualTree, component);
        return manaToXml_1.default('', enhancedMana, {}, {});
    };
    HaikuHTMLRenderer.prototype.hasSizing = function () {
        return false;
    };
    HaikuHTMLRenderer.prototype.createContainer = function () {
        return {
            isContainer: true,
            layout: {
                computed: {
                    size: this.config.options.size,
                },
            },
        };
    };
    HaikuHTMLRenderer.prototype.getLastContainer = function () {
        return this.createContainer();
    };
    HaikuHTMLRenderer.prototype.initialize = function () {
    };
    HaikuHTMLRenderer.prototype.removeListener = function () {
    };
    HaikuHTMLRenderer.prototype.getUser = function () {
        return this.config.options.user;
    };
    return HaikuHTMLRenderer;
}());
exports.default = HaikuHTMLRenderer;
//# sourceMappingURL=HaikuHTMLRenderer.js.map