"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RendererParser = void 0;
var tslib_1 = require("tslib");
var base_1 = require("./base");
var RendererParser = /** @class */ (function () {
    function RendererParser() {
    }
    RendererParser.prototype.onStart = function (context) {
        this.renderer = {};
    };
    RendererParser.prototype.parseModule = function (pageId, mod) {
        var _a;
        if (mod.name === '____index____')
            return;
        var _b = tslib_1.__read((_a = mod.path) === null || _a === void 0 ? void 0 : _a.split('/'), 3), folder = _b[2];
        if (folder) {
            this.renderer[pageId] = this.renderer[pageId] || {};
            this.renderer[pageId][folder] = (0, base_1.getDefaultModule)(mod.exports);
        }
        else
            this.renderer[pageId] = (0, base_1.getDefaultModule)(mod.exports);
    };
    RendererParser.prototype.onEnd = function (context) {
        context.renderer = this.renderer;
    };
    return RendererParser;
}());
exports.RendererParser = RendererParser;
//# sourceMappingURL=rendererParser.js.map