const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.js');
const require_assertString$1 = require('./util/assertString.js');

//#region ../../node_modules/.pnpm/validator@13.12.0/node_modules/validator/lib/isISIN.js
var require_isISIN = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/validator@13.12.0/node_modules/validator/lib/isISIN.js": ((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.default = isISIN;
	var _assertString = _interopRequireDefault(require_assertString$1.require_assertString());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { default: obj };
	}
	var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;
	function isISIN(str) {
		(0, _assertString.default)(str);
		if (!isin.test(str)) return false;
		var double = true;
		var sum = 0;
		for (var i = str.length - 2; i >= 0; i--) if (str[i] >= "A" && str[i] <= "Z") {
			var value = str[i].charCodeAt(0) - 55;
			var lo = value % 10;
			var hi = Math.trunc(value / 10);
			for (var _i = 0, _arr = [lo, hi]; _i < _arr.length; _i++) {
				var digit = _arr[_i];
				if (double) if (digit >= 5) sum += 1 + (digit - 5) * 2;
				else sum += digit * 2;
				else sum += digit;
				double = !double;
			}
		} else {
			var _digit = str[i].charCodeAt(0) - "0".charCodeAt(0);
			if (double) if (_digit >= 5) sum += 1 + (_digit - 5) * 2;
			else sum += _digit * 2;
			else sum += _digit;
			double = !double;
		}
		var check = Math.trunc((sum + 9) / 10) * 10 - sum;
		return +str[str.length - 1] === check;
	}
	module.exports = exports.default;
	module.exports.default = exports.default;
}) });

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