function formatPhoneNumber(
  modelValue,
  { regionCode, formatStrategy = 'international', formatCountryCodeStyle = 'default' },
) {
  // Do not format when not loaded
  if (!PhoneUtilManager.isLoaded) {
    return modelValue;
  }

  const AwesomePhoneNumber = PhoneUtilManager.PhoneUtil;

  let pn;
  try {
    pn = AwesomePhoneNumber.parsePhoneNumber(modelValue, { regionCode });
    // eslint-disable-next-line no-empty
  } catch (_) {}

  if (modelValue?.length >= 4 && modelValue?.length <= 16 && pn?.valid) {
    let formattedValue;

    switch (formatStrategy) {
      case 'e164':
        formattedValue = pn.number.e164; // -> '+46707123456' (default)
        break;
      case 'international':
        formattedValue = pn.number.international; // -> '+46 70 712 34 56'
        break;
      case 'national':
        formattedValue = pn.number.national; // -> '070-712 34 56'
        break;
      case 'rfc3966':
        formattedValue = pn.number.rfc3966; // -> 'tel:+46-70-712-34-56'
        break;
      case 'significant':
        formattedValue = pn.number.significant; // -> '707123456'
        break;
      default:
        break;
    }

    if (formatCountryCodeStyle !== 'default') {
      return getFormatCountryCodeStyle(formattedValue, { regionCode, formatCountryCodeStyle });
    }
    return formattedValue;
  }

  if (formatCountryCodeStyle !== 'default') {
    return getFormatCountryCodeStyle(modelValue, { regionCode, formatCountryCodeStyle });
  }
  return modelValue;
}
@param {string} modelValue
@param {object} options
@param {RegionCode} options.regionCode
@param {PhoneNumberFormat} [options.formatStrategy='international']
@param {string} [options.formatCountryCodeStyle='default']
@returns {string}