"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    getModifierKey: ()=>getModifierKey,
    isMac: ()=>isMac,
    preserveNewlines: ()=>preserveNewlines
});
const preserveNewlines = (markdown)=>{
    const codeBlocks = [];
    let result = markdown.replace(/```[\s\S]*?```/g, (m)=>{
        codeBlocks.push(m);
        return `\n%%CODE_BLOCK_${codeBlocks.length - 1}%%\n`;
    });
    result = result.replace(/\n{3,}/g, (match)=>{
        const extraBreaks = match.length - 2;
        return `\n\n${'&nbsp;\n\n'.repeat(extraBreaks)}`;
    });
    result = result.replace(/%%CODE_BLOCK_(\d+)%%/g, (_, i)=>codeBlocks[Number(i)] ?? '');
    return result;
};
const isMac = ()=>"u" > typeof navigator && navigator.platform.includes('Mac');
const getModifierKey = ()=>isMac() ? '⌘' : 'Ctrl';
exports.getModifierKey = __webpack_exports__.getModifierKey;
exports.isMac = __webpack_exports__.isMac;
exports.preserveNewlines = __webpack_exports__.preserveNewlines;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "getModifierKey",
    "isMac",
    "preserveNewlines"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
