"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.commentReg = void 0;
exports.fillBlank = fillBlank;
exports.commentReg = /(?<=\/\*)[\s\S]*?(?=\*\/)|(?<=\/\/)[\s\S]*?(?=\n)/g;
const cssClassNameReg = /(?=(\.[a-z_][-\w]*)[\s.,+~>:#)[{])/gi;
const fragmentReg = /(?<={)[^{]*(?=(?<!\\);)/g;
const plugin = () => {
    return {
        version: 2.1,
        resolveStyleReferenceLinks(block) {
            const result = [];
            const content = fillBlank(block.content, exports.commentReg, fragmentReg);
            const matches = content.matchAll(cssClassNameReg);
            for (const match of matches) {
                const matchText = match[1];
                if (matchText) {
                    result.push({ text: matchText, offset: match.index });
                }
            }
            return result;
        },
    };
};
exports.default = plugin;
function fillBlank(css, ...regs) {
    for (const reg of regs) {
        css = css.replace(reg, match => ' '.repeat(match.length));
    }
    return css;
}
//# sourceMappingURL=vue-style-class-names.js.map