import { _ as y, 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 registerIncodeModuleElement } from "../incodeModule-M8DszCee.js";
import { createAntifraudManager } from "@incodetech/core/antifraud";
//#region src/modules/antifraud/antifraud.tsx
var AntifraudContent = ({ manager: externalManager, onFinish }) => {
	const [state, manager] = useManager(() => externalManager ?? createAntifraudManager(), { manageLifecycle: !externalManager });
	y(() => {
		if (!externalManager) manager.load();
	}, [manager, externalManager]);
	useModuleTerminalCallbacks({
		status: state.status === "finished" ? "finished" : "loading",
		onFinish
	});
	return /* @__PURE__ */ u(Spinner, { fullScreen: true });
};
var Antifraud = ({ manager, onFinish }) => /* @__PURE__ */ u(IncodeComponent, { children: /* @__PURE__ */ u(AntifraudContent, {
	manager,
	onFinish
}) });
registerIncodeModuleElement(Antifraud, "incode-antifraud");
//#endregion
export { Antifraud };
