"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.insertYfmHtmlBlock = exports.insertMermaidDiagram = exports.insertHRule = exports.wrapToCheckbox = exports.insertBlockquoteLink = exports.wrapToBlockquote = void 0;
const helpers_1 = require("./helpers.js");
exports.wrapToBlockquote = (0, helpers_1.wrapPerLine)({ beforeText: '> ', skipEmptyLine: false });
const insertBlockquoteLink = ({ state, dispatch }) => {
    const markup = '> [link](url "title"){data-quotelink=true}\n> \n> ';
    const tr = (0, helpers_1.replaceOrInsertAfter)(state, markup);
    dispatch(state.update(tr));
    return true;
};
exports.insertBlockquoteLink = insertBlockquoteLink;
exports.wrapToCheckbox = (0, helpers_1.wrapPerLine)({ beforeText: '[ ] ' });
const insertHRule = ({ state, dispatch }) => {
    const hrMarkup = '---';
    const tr = (0, helpers_1.replaceOrInsertAfter)(state, hrMarkup);
    dispatch(state.update(tr));
    return true;
};
exports.insertHRule = insertHRule;
const insertMermaidDiagram = ({ state, dispatch }) => {
    const markup = `\`\`\`mermaid
sequenceDiagram
    Alice->>Bob: Hi Bob
    Bob->>Alice: Hi Alice
\`\`\``;
    const tr = (0, helpers_1.replaceOrInsertAfter)(state, markup);
    dispatch(state.update(tr));
    return true;
};
exports.insertMermaidDiagram = insertMermaidDiagram;
const insertYfmHtmlBlock = ({ state, dispatch }) => {
    const markup = `::: html

<div>Add HTML code here</div>

:::`;
    const tr = (0, helpers_1.replaceOrInsertAfter)(state, markup);
    dispatch(state.update(tr));
    return true;
};
exports.insertYfmHtmlBlock = insertYfmHtmlBlock;
//# sourceMappingURL=blocks.js.map
