"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LINK_TO_FILE_ATTRS_MAP = exports.fileNodeAttrsSpec = exports.REQUIRED_ATTRS = exports.KNOWN_ATTRS = exports.YFM_FILE_DIRECTIVE_ATTRS = exports.YfmFileAttr = exports.yfmFileNodeName = void 0;
const file_extension_1 = require("@diplodoc/file-extension");
exports.yfmFileNodeName = file_extension_1.FILE_TOKEN;
exports.YfmFileAttr = {
    Markup: 'data-markup',
    Name: file_extension_1.FileHtmlAttr.Download,
    Link: file_extension_1.FileHtmlAttr.Href,
    ReferrerPolicy: file_extension_1.FileHtmlAttr.ReferrerPolicy,
    Rel: file_extension_1.FileHtmlAttr.Rel,
    Target: file_extension_1.FileHtmlAttr.Target,
    Type: file_extension_1.FileHtmlAttr.Type,
    Lang: file_extension_1.FileHtmlAttr.HrefLang,
};
exports.YFM_FILE_DIRECTIVE_ATTRS = [
    exports.YfmFileAttr.ReferrerPolicy,
    exports.YfmFileAttr.Rel,
    exports.YfmFileAttr.Target,
    exports.YfmFileAttr.Type,
    exports.YfmFileAttr.Lang,
];
exports.KNOWN_ATTRS = file_extension_1.FILE_KNOWN_ATTRS.map((attrName) => {
    if (attrName in file_extension_1.FILE_TO_LINK_ATTRS_MAP)
        return file_extension_1.FILE_TO_LINK_ATTRS_MAP[attrName];
    return attrName;
});
exports.REQUIRED_ATTRS = file_extension_1.FILE_REQUIRED_ATTRS.map((attrName) => {
    if (attrName in file_extension_1.FILE_TO_LINK_ATTRS_MAP)
        return file_extension_1.FILE_TO_LINK_ATTRS_MAP[attrName];
    return attrName;
});
exports.fileNodeAttrsSpec = {
    [exports.YfmFileAttr.Markup]: { default: null },
};
for (const attrName of exports.KNOWN_ATTRS) {
    const attrSpec = (exports.fileNodeAttrsSpec[attrName] = {});
    if (!exports.REQUIRED_ATTRS.includes(attrName)) {
        attrSpec.default = null;
    }
}
exports.LINK_TO_FILE_ATTRS_MAP = {};
for (const [key, value] of Object.entries(file_extension_1.FILE_TO_LINK_ATTRS_MAP)) {
    exports.LINK_TO_FILE_ATTRS_MAP[value] = key;
}
//# sourceMappingURL=const.js.map
