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

//#region ../../node_modules/.pnpm/validator@13.12.0/node_modules/validator/lib/isStrongPassword.js
var require_isStrongPassword = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/validator@13.12.0/node_modules/validator/lib/isStrongPassword.js": ((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.default = isStrongPassword;
	var _merge = _interopRequireDefault(require_merge$1.require_merge());
	var _assertString = _interopRequireDefault(require_assertString$1.require_assertString());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { default: obj };
	}
	var upperCaseRegex = /^[A-Z]$/;
	var lowerCaseRegex = /^[a-z]$/;
	var numberRegex = /^[0-9]$/;
	var symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/;
	var defaultOptions = {
		minLength: 8,
		minLowercase: 1,
		minUppercase: 1,
		minNumbers: 1,
		minSymbols: 1,
		returnScore: false,
		pointsPerUnique: 1,
		pointsPerRepeat: .5,
		pointsForContainingLower: 10,
		pointsForContainingUpper: 10,
		pointsForContainingNumber: 10,
		pointsForContainingSymbol: 10
	};
	function countChars(str) {
		var result = {};
		Array.from(str).forEach(function(char) {
			if (result[char]) result[char] += 1;
			else result[char] = 1;
		});
		return result;
	}
	function analyzePassword(password) {
		var charMap = countChars(password);
		var analysis = {
			length: password.length,
			uniqueChars: Object.keys(charMap).length,
			uppercaseCount: 0,
			lowercaseCount: 0,
			numberCount: 0,
			symbolCount: 0
		};
		Object.keys(charMap).forEach(function(char) {
			/* istanbul ignore else */
			if (upperCaseRegex.test(char)) analysis.uppercaseCount += charMap[char];
			else if (lowerCaseRegex.test(char)) analysis.lowercaseCount += charMap[char];
			else if (numberRegex.test(char)) analysis.numberCount += charMap[char];
			else if (symbolRegex.test(char)) analysis.symbolCount += charMap[char];
		});
		return analysis;
	}
	function scorePassword(analysis, scoringOptions) {
		var points = 0;
		points += analysis.uniqueChars * scoringOptions.pointsPerUnique;
		points += (analysis.length - analysis.uniqueChars) * scoringOptions.pointsPerRepeat;
		if (analysis.lowercaseCount > 0) points += scoringOptions.pointsForContainingLower;
		if (analysis.uppercaseCount > 0) points += scoringOptions.pointsForContainingUpper;
		if (analysis.numberCount > 0) points += scoringOptions.pointsForContainingNumber;
		if (analysis.symbolCount > 0) points += scoringOptions.pointsForContainingSymbol;
		return points;
	}
	function isStrongPassword(str) {
		var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
		(0, _assertString.default)(str);
		var analysis = analyzePassword(str);
		options = (0, _merge.default)(options || {}, defaultOptions);
		if (options.returnScore) return scorePassword(analysis, options);
		return analysis.length >= options.minLength && analysis.lowercaseCount >= options.minLowercase && analysis.uppercaseCount >= options.minUppercase && analysis.numberCount >= options.minNumbers && analysis.symbolCount >= options.minSymbols;
	}
	module.exports = exports.default;
	module.exports.default = exports.default;
}) });

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