'use client'
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
require('@dynamic-labs/sdk-api-core');
require('../../../../utils/constants/values.cjs');
require('@dynamic-labs/utils');
require('../../../../../../_virtual/_tslib.cjs');
require('@dynamic-labs/multi-wallet');
require('../../../../shared/logger.cjs');
require('react-international-phone');
require('../../../../utils/constants/colors.cjs');
require('@dynamic-labs/iconic');
require('@dynamic-labs/wallet-connector-core');
require('react/jsx-runtime');
require('../../../ViewContext/ViewContext.cjs');
require('@dynamic-labs/wallet-book');
require('../../../../shared/consts/index.cjs');
require('../../../../store/state/nonce/nonce.cjs');
var isEmailProviderEnabled = require('../../../../utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.cjs');
require('@dynamic-labs-wallet/browser-wallet-client');
require('@dynamic-labs-sdk/client/core');
require('eventemitter3');
require('@dynamic-labs-sdk/client');
require('../../../../config/ApiEndpoint.cjs');
require('../../../../events/dynamicEvents.cjs');
require('@dynamic-labs/locale');
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');

const useEmailLoginState = (providers, user) => {
    const [loginWithEmail, _setLoginWithEmail] = React.useState(null);
    const reset = () => {
        _setLoginWithEmail(null);
    };
    const setLoginWithEmail = React.useCallback((value) => {
        _setLoginWithEmail(value);
    }, [_setLoginWithEmail]);
    const defaultLoginWithEmail = React.useMemo(() => (user ? false : isEmailProviderEnabled.isEmailProviderEnabled(providers)), [providers, user]);
    return [loginWithEmail !== null && loginWithEmail !== void 0 ? loginWithEmail : defaultLoginWithEmail, setLoginWithEmail, reset];
};

exports.useEmailLoginState = useEmailLoginState;
