//#region src/components/ConfigureSSO/deriveInitialStep.ts
/**
* Decides where the ConfigureSSO wizard should mount on (re)load based on
* the current state of the user's enterprise connection.
*/
const deriveInitialStep = (enterpriseConnection, options) => {
	const { isDomainTakenByOtherOrg, hasSuccessfulTestRun } = options;
	if (isDomainTakenByOtherOrg) return "verify-domain";
	if (!enterpriseConnection) return "select-provider";
	if (enterpriseConnection?.active) return "confirmation";
	if (!checkHasMinimumIdPConfiguration(enterpriseConnection)) return "configure";
	if (!hasSuccessfulTestRun) return "test";
	return "confirmation";
};
const checkHasMinimumIdPConfiguration = (connection) => {
	return Boolean(connection.samlConnection?.idpSsoUrl && connection.samlConnection?.idpEntityId);
};

//#endregion
export { deriveInitialStep };
//# sourceMappingURL=deriveInitialStep.js.map