"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NormalModuleParser = void 0;
var tslib_1 = require("tslib");
var base_1 = require("./base");
var NormalModuleParser = /** @class */ (function () {
    function NormalModuleParser() {
    }
    NormalModuleParser.prototype.onStart = function (context) {
        this.common = {};
    };
    NormalModuleParser.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.common[pageId] = this.common[pageId] || {};
            this.common[pageId][folder] = (0, base_1.getDefaultModule)(mod.exports);
        }
        else {
            this.common[pageId] = (0, base_1.getDefaultModule)(mod.exports);
        }
    };
    NormalModuleParser.prototype.onEnd = function (context) {
        context.common = this.common;
    };
    return NormalModuleParser;
}());
exports.NormalModuleParser = NormalModuleParser;
//# sourceMappingURL=normalModuleParser.js.map