import { v as u } from "../vendor-preact-DThS2ZQ_.js";
import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-Da_yP_Dr.js";
import { t as IncodeComponent } from "../incodeComponent-CCP7GTMj.js";
import { t as Spinner } from "../spinner-DqB4SGUV.js";
import { t as ExpiredId } from "../expiredId-B_gTnxQl.js";
import { t as registerIncodeModuleElement } from "../incodeModule-M8DszCee.js";
import { createIdVerificationManager } from "@incodetech/core/id-verification";
//#region src/modules/id-verification/id-verification.tsx
var IdVerificationContent = ({ config, onFinish }) => {
	const [state, manager] = useManager(() => createIdVerificationManager({ config }));
	useModuleTerminalCallbacks({
		status: state.status === "finished" ? "finished" : "loading",
		onFinish
	});
	if (state.status === "expired") return /* @__PURE__ */ u(ExpiredId, { onContinue: () => manager.continue() });
	return /* @__PURE__ */ u(Spinner, { fullScreen: true });
};
var IdVerification = ({ config, onFinish }) => /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IdVerificationContent, {
	config,
	onFinish
}) : null });
registerIncodeModuleElement(IdVerification, "incode-id-verification");
//#endregion
export { IdVerification };
