'use client'
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
import '../../../../constants/values.js';
import '@dynamic-labs/utils';
import '../../../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import '../../../../../shared/logger.js';
import 'react-international-phone';
import '../../../../constants/colors.js';
import '@dynamic-labs/iconic';
import '@dynamic-labs/wallet-connector-core';
import 'react';
import 'react/jsx-runtime';
import '../../../../../context/ViewContext/ViewContext.js';
import '@dynamic-labs/wallet-book';
import '../../../../../shared/consts/index.js';
import '../../../../../store/state/nonce/nonce.js';
import { isProviderEnabled } from '../../../../functions/isProviderEnabled/isProviderEnabled.js';
import '@dynamic-labs-wallet/browser-wallet-client';
import '@dynamic-labs-sdk/client/core';
import 'eventemitter3';
import '@dynamic-labs-sdk/client';
import '../../../../../config/ApiEndpoint.js';
import '../../../../../events/dynamicEvents.js';
import '@dynamic-labs/locale';
import '../../../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../../../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
import { ConnectorSetupError } from '../errors/ConnectorSetupError.js';

const magicEmailOtpWalletConnectorKey = 'magicemailotp';
const magicSocialWalletConnectorKey = 'magicsocial';
const verifyMagicIsSetup = (projectSettings, walletConnectors) => {
    var _a;
    const isMagicEnabled = isProviderEnabled((_a = projectSettings.providers) !== null && _a !== void 0 ? _a : [], ProviderEnum.MagicLink);
    const isMagicWalletConnectorPresent = walletConnectors.some(({ key }) => [magicEmailOtpWalletConnectorKey, magicSocialWalletConnectorKey].includes(key));
    if (isMagicEnabled && !isMagicWalletConnectorPresent) {
        throw new ConnectorSetupError('Magic', 'MagicWalletConnectors');
    }
};

export { verifyMagicIsSetup };
