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] = "2c03020d-f94c-4fa5-b2e6-e6ac73c824a4", e._sentryDebugIdIdentifier = "sentry-dbid-2c03020d-f94c-4fa5-b2e6-e6ac73c824a4");
} catch (e) {}
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
import { t as getNestedPropertyKeys } from "./getNestedPropertyKeys-hT40QMb1.js";
//#region src/stores/globalStore/isEmptyEntity.ts
/**
* These fields will be present on an empty (just created) entity of the given type.
* If any more fields than these are present, we consider the LE to not be "empty".
*/
var emptyFieldsForIndividual = [
	"name.firstName",
	"name.lastName",
	"residentialAddress.country"
];
var emptyFieldsForOrganization = ["legalName", "registeredAddress.country"];
var emptyFieldsForTrust = ["name", "registeredAddress.country"];
var emptyFieldsForSoleProp = ["name", "registeredAddress.country"];
var emptyFieldsForUnincorporatedPartnership = [
	"name",
	"countryOfGoverningLaw",
	"registeredAddress.country"
];
var emptyFieldsByEntityType = {
	[LegalEntityTypes.INDIVIDUAL]: emptyFieldsForIndividual,
	[LegalEntityTypes.ORGANIZATION]: emptyFieldsForOrganization,
	[LegalEntityTypes.TRUST]: emptyFieldsForTrust,
	[LegalEntityTypes.SOLE_PROPRIETORSHIP]: emptyFieldsForSoleProp,
	[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: emptyFieldsForUnincorporatedPartnership
};
function isEmptyEntity(legalEntity) {
	const type = legalEntity?.type;
	if (!type) return true;
	if (legalEntity.documentDetails?.length) return false;
	const minimumFields = emptyFieldsByEntityType[type];
	const typeSpecificSection = legalEntity[type];
	if (!typeSpecificSection) return true;
	const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection, false, false);
	const sortedMinimumFields = [...minimumFields].sort();
	return [...fieldsOnEntity].sort().every((value, index) => value === sortedMinimumFields[index]);
}
//#endregion
export { isEmptyEntity as t };
