try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "916e57da-ab6a-4df0-a6bd-27baeccc4684", e._sentryDebugIdIdentifier = "sentry-dbid-916e57da-ab6a-4df0-a6bd-27baeccc4684");
} catch (e) {}
import { _ as hasText } from "./validatorUtils-Dz6AklT-.js";
//#region src/components/EFP/tasks/BusinessFinancingDropin/validate.ts
var validateLegalEntityIdentifier = (legalEntityIdentifier) => {
	if (!legalEntityIdentifier) return true;
	const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
	const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
	return isValidLength && hasLettersAndNumbers;
};
var validateDateNotInTheFuture = (selectedDate) => {
	if (!selectedDate) return true;
	return new Date(selectedDate) <= /* @__PURE__ */ new Date();
};
var businessFinancingCompanyDetailsValidations = {
	numberOfEmployees: {
		modes: ["blur"],
		validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)) && Number(numberOfEmployees) > 0,
		errorMessage: "atLeastOneEmployeeIsRequired"
	},
	balanceSheetTotal: {
		modes: ["blur"],
		validate: (value) => {
			const numValue = Number(value);
			return !Number.isNaN(numValue) && numValue > 0;
		},
		errorMessage: "fieldIsRequired"
	},
	annualTurnover: {
		modes: ["blur"],
		validate: (value) => {
			const numValue = Number(value);
			return !Number.isNaN(numValue) && numValue > 0;
		},
		errorMessage: "fieldIsRequired"
	},
	financialReportingDate: {
		modes: ["blur"],
		validate: (value) => validateDateNotInTheFuture(value),
		errorMessage: "dateCannotBeInTheFuture"
	},
	legalEntityIdentifier: {
		modes: ["blur"],
		validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
		errorMessage: "invalidFormat"
	},
	legalProceedingsDate: {
		modes: ["blur"],
		validate: (value) => validateDateNotInTheFuture(value),
		errorMessage: "dateCannotBeInTheFuture"
	}
};
var businessFinancingParentCompanyDetailsValidations = {
	numberOfEmployees: {
		modes: ["blur"],
		validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)) && Number(numberOfEmployees) > 0,
		errorMessage: "atLeastOneEmployeeIsRequired"
	},
	legalEntityIdentifier: {
		modes: ["blur"],
		validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
		errorMessage: "invalidFormat"
	},
	balanceSheetTotal: {
		modes: ["blur"],
		validate: (value) => {
			const numValue = Number(value);
			return !Number.isNaN(numValue) && numValue > 0;
		},
		errorMessage: "fieldIsRequired"
	},
	annualTurnover: {
		modes: ["blur"],
		validate: (value) => {
			const numValue = Number(value);
			return !Number.isNaN(numValue) && numValue > 0;
		},
		errorMessage: "fieldIsRequired"
	},
	financialReportingDate: {
		modes: ["blur"],
		validate: (value) => validateDateNotInTheFuture(value),
		errorMessage: "dateCannotBeInTheFuture"
	},
	legalProceedingsDate: {
		modes: ["blur"],
		validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
		errorMessage: "dateCannotBeInTheFuture"
	},
	registrationAddress: {
		modes: ["blur"],
		validate: (registrationAddress) => hasText(registrationAddress?.address),
		errorMessage: "fieldIsRequired"
	}
};
var businessFinancingMultiformRules = {
	company: businessFinancingCompanyDetailsValidations,
	soleProprietor: { legalProceedingsDate: {
		modes: ["blur"],
		validate: (value) => validateDateNotInTheFuture(value),
		errorMessage: "dateCannotBeInTheFuture"
	} },
	parentCompany: businessFinancingParentCompanyDetailsValidations,
	ultimateParentCompany: businessFinancingParentCompanyDetailsValidations
};
//#endregion
export { validateDateNotInTheFuture as n, businessFinancingMultiformRules as t };
