/**
 * Converts text to a URL/ID-friendly slug.
 * Lowercase, replaces spaces/hyphens with underscores, removes special chars, collapses underscores.
 *
 * @example
 * slugify('Check PAYG Coverage') // 'check_payg_coverage'
 * slugify('Hello--World!!') // 'hello_world'
 */
export function slugify(text) {
    return text
        .toLowerCase()
        .replace(/[\s-]+/g, '_') // spaces and hyphens to underscores
        .replace(/[^a-z0-9_]/g, '') // remove special chars
        .replace(/_+/g, '_') // collapse multiple underscores
        .replace(/^_|_$/g, ''); // trim leading/trailing underscores
}
//# sourceMappingURL=slugify.js.map