'use client'
import { __awaiter } from '../../../../_virtual/_tslib.js';
import { jsx } from 'react/jsx-runtime';
import { CaptchaChallenge } from '../../components/CaptchaChallenge/CaptchaChallenge.js';
import { useCaptchaContext } from '../../context/CaptchaContext/CaptchaContext.js';

const CaptchaVerifyUser = () => {
    const { captchaAuthState, setCaptchaToken } = useCaptchaContext();
    const handleSuccess = (captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
        var _a;
        setCaptchaToken(captchaToken);
        yield ((_a = captchaAuthState === null || captchaAuthState === void 0 ? void 0 : captchaAuthState.onCaptchaSuccess) === null || _a === void 0 ? void 0 : _a.call(captchaAuthState, captchaToken));
    });
    return jsx(CaptchaChallenge, { onSuccess: handleSuccess });
};

export { CaptchaVerifyUser };
