"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckboxSpecs = exports.checkboxInputType = exports.checkboxLabelType = exports.checkboxType = exports.CheckboxNode = exports.CheckboxAttr = void 0;
const tslib_1 = require("tslib");
const index_js_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/plugins/checkbox/index.js"));
const const_1 = require("./const.js");
const parser_1 = require("./parser.js");
const schema_1 = require("./schema.js");
const serializer_1 = require("./serializer.js");
var const_2 = require("./const.js");
Object.defineProperty(exports, "CheckboxAttr", { enumerable: true, get: function () { return const_2.CheckboxAttr; } });
Object.defineProperty(exports, "CheckboxNode", { enumerable: true, get: function () { return const_2.CheckboxNode; } });
Object.defineProperty(exports, "checkboxType", { enumerable: true, get: function () { return const_2.checkboxType; } });
Object.defineProperty(exports, "checkboxLabelType", { enumerable: true, get: function () { return const_2.checkboxLabelType; } });
Object.defineProperty(exports, "checkboxInputType", { enumerable: true, get: function () { return const_2.checkboxInputType; } });
const CheckboxSpecs = (builder, opts) => {
    const schemaSpecs = (0, schema_1.getSchemaSpecs)(opts, builder.context.get('placeholder'));
    builder
        .configureMd((md) => md.use(index_js_1.default, { idPrefix: const_1.idPrefix, divClass: (0, const_1.b)() }))
        .addNode(const_1.CheckboxNode.Checkbox, () => ({
        spec: schemaSpecs[const_1.CheckboxNode.Checkbox],
        toMd: serializer_1.serializerTokens[const_1.CheckboxNode.Checkbox],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.CheckboxNode.Checkbox],
        },
        view: opts.checkboxView,
    }))
        .addNode(const_1.CheckboxNode.Input, () => ({
        spec: schemaSpecs[const_1.CheckboxNode.Input],
        toMd: serializer_1.serializerTokens[const_1.CheckboxNode.Input],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.CheckboxNode.Input],
        },
        view: opts.inputView,
    }))
        .addNode(const_1.CheckboxNode.Label, () => ({
        spec: schemaSpecs[const_1.CheckboxNode.Label],
        toMd: serializer_1.serializerTokens[const_1.CheckboxNode.Label],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.CheckboxNode.Label],
            tokenName: 'checkbox_label',
        },
        view: opts.labelView,
    }));
};
exports.CheckboxSpecs = CheckboxSpecs;
//# sourceMappingURL=index.js.map
