// #region Imports
// #endregion
const PHONE_REGEXP = /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/;
/**
 * Validator that requires the control's value to be a valid phone number.
 *
 * State:
 * * patternMismatch
 *
 * @public
 * @param control
 * @returns null if the validation check passes, otherwise an object containing information.
 */
export function phoneNumberValidator(element) {
    return element.value == null || element.value.length === 0
        ? null
        : PHONE_REGEXP.test(element.value)
            ? null
            : { patternMismatch: true };
}
/**
 * Checks if the value is a valid phone number.
 *
 * @param value - The value to check.
 * @returns True if the value is a valid phone number, false otherwise.
 */
export function isPhoneNumberValue(value) {
    return typeof value === 'string' && PHONE_REGEXP.test(value);
}
//# sourceMappingURL=PhoneNumberElementValidatorFn.js.map