"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RenderInline = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Spoiler_1 = require("./Spoiler");
const Code_1 = require("./Code");
const Kbd_1 = require("./Kbd");
const Ins_1 = require("./Ins");
const Del_1 = require("./Del");
const Link_1 = require("./Link");
const RenderInline = (props) => {
    const { inline, children } = props;
    const attrs = inline.attr();
    let element = children;
    const a = attrs[-9 /* SliceTypeCon.a */];
    if (a)
        element = (React.createElement(Link_1.Link, { layers: a.length, stack: a }, element));
    if (attrs[-8 /* SliceTypeCon.mark */])
        element = React.createElement("mark", null, element);
    if (attrs[-13 /* SliceTypeCon.sup */])
        element = React.createElement("sup", null, element);
    if (attrs[-14 /* SliceTypeCon.sub */])
        element = React.createElement("sub", null, element);
    if (attrs[-15 /* SliceTypeCon.math */])
        element = React.createElement("code", null, element);
    if (attrs[-12 /* SliceTypeCon.ins */])
        element = React.createElement(Ins_1.Ins, null, element);
    if (attrs[-11 /* SliceTypeCon.del */])
        element = React.createElement(Del_1.Del, null, element);
    if (attrs[-7 /* SliceTypeCon.code */]) {
        const attr = attrs[-7 /* SliceTypeCon.code */][0];
        if (attr)
            element = React.createElement(Code_1.Code, { attr: attr }, element);
    }
    if (attrs[-19 /* SliceTypeCon.kbd */]) {
        const attr = attrs[-19 /* SliceTypeCon.kbd */][0];
        if (attr)
            element = React.createElement(Kbd_1.Kbd, { attr: attr }, element);
    }
    if (attrs[-20 /* SliceTypeCon.spoiler */])
        element = React.createElement(Spoiler_1.Spoiler, null, element);
    return element;
};
exports.RenderInline = RenderInline;
//# sourceMappingURL=RenderInline.js.map