/**
 * Shared alert helpers.
 *
 * Bootstrap has no `alert-error` class — `alert-danger` is the equivalent for
 * error states. Callers that accept a generic `type` (often `'error'` from
 * application code) must map it before composing the className. Keeping this
 * mapping in one place ensures every alert generator stays in sync.
 *
 * Exposes window.LdrAlertHelpers. Consumers should destructure at the top
 * of their IIFE/function, e.g.
 *     const { mapAlertType } = window.LdrAlertHelpers;
 */
(function() {
    'use strict';

    function mapAlertType(type) {
        return type === 'error' ? 'danger' : type;
    }

    window.LdrAlertHelpers = {
        mapAlertType,
    };
})();
