const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_parsePhoneNumber$1 = require('../parsePhoneNumber.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js
var require_matchPhoneNumberStringAgainstPhoneNumber = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports["default"] = matchPhoneNumberStringAgainstPhoneNumber;
	var _parsePhoneNumber = _interopRequireDefault(require_parsePhoneNumber$1.require_parsePhoneNumber());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	/**
	* Matches a phone number object against a phone number string.
	* @param  {string} phoneNumberString
	* @param  {PhoneNumber} phoneNumber
	* @param  {object} metadata — Metadata JSON
	* @return {'INVALID_NUMBER'|'NO_MATCH'|'SHORT_NSN_MATCH'|'NSN_MATCH'|'EXACT_MATCH'}
	*/
	function matchPhoneNumberStringAgainstPhoneNumber(phoneNumberString, phoneNumber, metadata) {
		var phoneNumberStringContainsCallingCode = true;
		var parsedPhoneNumber = (0, _parsePhoneNumber["default"])(phoneNumberString, metadata);
		if (!parsedPhoneNumber) {
			phoneNumberStringContainsCallingCode = false;
			parsedPhoneNumber = (0, _parsePhoneNumber["default"])(phoneNumberString, { defaultCallingCode: phoneNumber.countryCallingCode }, metadata);
		}
		if (!parsedPhoneNumber) return "INVALID_NUMBER";
		if (phoneNumber.ext) {
			if (parsedPhoneNumber.ext !== phoneNumber.ext) return "NO_MATCH";
		} else if (parsedPhoneNumber.ext) return "NO_MATCH";
		if (phoneNumberStringContainsCallingCode) {
			if (phoneNumber.countryCallingCode !== parsedPhoneNumber.countryCallingCode) return "NO_MATCH";
		}
		if (phoneNumber.number === parsedPhoneNumber.number) if (phoneNumberStringContainsCallingCode) return "EXACT_MATCH";
		else return "NSN_MATCH";
		if (phoneNumber.nationalNumber.indexOf(parsedPhoneNumber.nationalNumber) === 0 || parsedPhoneNumber.nationalNumber.indexOf(phoneNumber.nationalNumber) === 0) return "SHORT_NSN_MATCH";
		return "NO_MATCH";
	}
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_matchPhoneNumberStringAgainstPhoneNumber();
  }
});