'use client'
import '../../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
import { getUserProfileFields } from '../../functions/getUserProfileFields/getUserProfileFields.js';
import '@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 { isSocialKycEnabled } from '../../functions/isSocialKycEnabled/isSocialKycEnabled.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 { useAuthMode } from '../../../store/state/authMode/authMode.js';

/* eslint-disable max-len */
/**
 * A custom React hook that checks if KYC fields are enabled in the project settings or defined in the user profile.
 *
 * @returns {boolean} - A boolean value indicating whether the KYC fields are enabled in the project settings or defined in the user profile.
 */
const useKYCFlag = () => {
    const { projectSettings, user } = useInternalDynamicContext();
    const authMode = useAuthMode();
    const isOnlyConnectedMode = authMode === 'connect-only' && !user;
    if (isOnlyConnectedMode) {
        return false;
    }
    const hasAnyKYCFields = getUserProfileFields({
        customFields: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.customFields,
        projectSettingsKyc: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc,
        user,
    });
    return hasAnyKYCFields.length > 0 || isSocialKycEnabled(projectSettings);
};

export { useKYCFlag };
