//#region ../@intlayer/cli/dist/esm/translation-alignment/normalizeBlock.mjs
const removeMarkdownFormatting = (text) => {
	return text.replace(/`{1,3}[^`]*`{1,3}/g, " ").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/~~([^~]+)~~/g, "$1").replace(/!?\[[^\]]*\]\([^)]*\)/g, " ").replace(/^\s*#{1,6}\s+/gm, "").replace(/^\s*>\s?/gm, "").replace(/^\s*[-*+]\s+/gm, "").replace(/^\s*\d+\.\s+/gm, "");
};
const collapseWhitespace = (text) => text.replace(/\s+/g, " ").trim();
const stripLettersKeepDigitsAndSymbols = (text) => {
	return text.replace(/\p{L}+/gu, "");
};
const normalizeBlock = (block) => {
	const semanticCollapsed = collapseWhitespace(removeMarkdownFormatting(block.content).toLowerCase());
	const anchorCollapsed = collapseWhitespace(stripLettersKeepDigitsAndSymbols(block.content));
	return {
		...block,
		semanticText: semanticCollapsed,
		anchorText: anchorCollapsed
	};
};

//#endregion
export { normalizeBlock };
//# sourceMappingURL=normalizeBlock.mjs.map