import { HeadlessOAuthClient as HeadlessOAuthClient$1 } from '../../core/src/HeadlessClients/HeadlessOAuthClient.mjs';
import '../../core/src/HeadlessClients/b2b/HeadlessB2BMagicLinkClient.mjs';
import '../../core/src/HeadlessClients/b2b/HeadlessB2BPasswordsClient.mjs';
import '../../core/src/HeadlessClients/HeadlessCryptoWalletClient.mjs';
import '../../core/src/HeadlessClients/HeadlessMagicLinkClient.mjs';
import '../../core/src/HeadlessClients/HeadlessPasswordClient.mjs';
import { OneTapPositions } from '../../core/src/public/ui.mjs';

class HeadlessOAuthClient extends HeadlessOAuthClient$1 {
    _oneTap;
    constructor(_networkClient, _subscriptionService, _pkceManager, _dynamicConfig, _config, _oneTap){
        super(_networkClient, _subscriptionService, _pkceManager, _dynamicConfig, _config), this._oneTap = _oneTap;
    }
    startOneTap = async (options)=>{
        const clientResult = await this._oneTap.createOneTapClient();
        if (!clientResult.success) {
            throw new Error(`One Tap could not load: ${clientResult.reason}`);
        }
        const { client } = clientResult;
        const onSuccessCallback = this._oneTap.createOnSuccessHandler({
            signupRedirectUrl: options.signup_redirect_url,
            loginRedirectUrl: options.login_redirect_url,
            onSuccess: this._oneTap.redirectOnSuccess
        });
        return client.render({
            style: {
                position: OneTapPositions.floating
            },
            onOneTapCancelled: options.onOneTapCancelled,
            callback: onSuccessCallback,
            cancelOnTapOutside: options.cancel_on_tap_outside
        });
    };
    googleOneTap = {
        start: this.startOneTap
    };
}

export { HeadlessOAuthClient };
//# sourceMappingURL=HeadlessOAuthClient.mjs.map
