'use client'
'use strict';

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

var _tslib = require('../../../../../_virtual/_tslib.cjs');
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var reactI18next = require('react-i18next');
var utils = require('@dynamic-labs/utils');
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
var IconButton = require('../../../components/IconButton/IconButton.cjs');
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
var Typography = require('../../../components/Typography/Typography.cjs');
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
var useDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
var getProperErrorMessage = require('../../../modals/SignMessageConfirmationModal/getProperErrorMessage.cjs');
var arrowLeft = require('../../../shared/assets/arrow-left.cjs');
var check = require('../../../shared/assets/check.cjs');
var close = require('../../../shared/assets/close.cjs');
var questionMark = require('../../../shared/assets/question-mark.cjs');
var question = require('../../../shared/assets/question.cjs');
var switchHorizontal = require('../../../shared/assets/switch-horizontal.cjs');
require('@dynamic-labs/iconic');
require('../../../context/ViewContext/ViewContext.cjs');
var logger = require('../../../shared/logger.cjs');
var useMutation = require('../../../utils/hooks/useMutation/useMutation.cjs');
var settingsUtils = require('../../../store/utils/settingsUtils/settingsUtils.cjs');
var WalletIconWithNetwork = require('../../../widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.cjs');
var useWalletDelegation = require('../../../utils/hooks/useWalletDelegation/useWalletDelegation.cjs');
var localStorage = require('../../../utils/constants/localStorage.cjs');
require('../../../utils/constants/colors.cjs');
require('../../../utils/constants/values.cjs');
var AgreementSection = require('./AgreementSection.cjs');

const WalletDelegationView = ({ wallets, }) => {
    const { setShowAuthFlow, handleLogOut } = useInternalDynamicContext.useInternalDynamicContext();
    const { user } = useDynamicContext.useDynamicContext();
    const appName = settingsUtils.useAppName();
    const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation.useWalletDelegation();
    const { requiresDelegation, denyWalletDelegation, getWalletsDelegatedStatus, } = useWalletDelegation.useWalletDelegation();
    const [selectedWallets, setSelectedWallets] = React.useState(new Set());
    const [showEditView, setShowEditView] = React.useState(false);
    const [showLearnMoreView, setShowLearnMoreView] = React.useState(false);
    const [agreementChecked, setAgreementChecked] = React.useState(false);
    const [selectionInitialized, setSelectionInitialized] = React.useState(false);
    // Get waas wallets that are not yet delegated or use provided wallets override
    const waasWallets = React.useMemo(() => getWalletsToDelegate(wallets, getWalletsDelegatedStatus), [wallets, getWalletsDelegatedStatus]);
    // Auto-select wallets only on initial load
    React.useEffect(() => {
        if (selectionInitialized)
            return;
        if (waasWallets.length === 1) {
            setSelectedWallets(new Set([waasWallets[0].id]));
            setSelectionInitialized(true);
        }
        else if (waasWallets.length > 1) {
            setSelectedWallets(new Set(waasWallets.map((w) => w.id)));
            setSelectionInitialized(true);
        }
    }, [waasWallets, selectionInitialized]);
    const handleWalletToggle = (walletId, event) => {
        // Prevent event propagation if called from checkbox
        if (event) {
            event.stopPropagation();
        }
        setSelectionInitialized(true);
        setSelectedWallets((prev) => {
            const newSet = new Set(prev);
            if (newSet.has(walletId)) {
                newSet.delete(walletId);
            }
            else {
                newSet.add(walletId);
            }
            return newSet;
        });
    };
    const handleSelectAll = () => {
        setSelectionInitialized(true);
        setSelectedWallets(new Set(waasWallets.map((wallet) => wallet.id)));
    };
    const handleDeselectAll = () => {
        setSelectionInitialized(true);
        setSelectedWallets(new Set());
    };
    const handleDenySelectedWallets = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
        try {
            // Deny each selected wallet
            for (const walletId of selectedWallets) {
                yield denyWalletDelegation(walletId);
            }
            // Close the auth flow after successful denial
            setShowAuthFlow(false);
        }
        catch (error) {
            logger.logger.error('Failed to deny wallet delegation', error);
            // Still close the flow even on error to avoid blocking the user
            setShowAuthFlow(false);
        }
    });
    const { mutate: handleDelegateWallets, isLoading, error, data: isSuccess, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
        if (selectedWallets.size === 0) {
            throw new utils.DynamicError('No wallets selected for delegation');
        }
        const selectedWalletObjects = waasWallets.filter((wallet) => selectedWallets.has(wallet.id));
        // Prepare delegation array
        const walletsToDelegate = selectedWalletObjects.map((wallet) => ({
            accountAddress: wallet.address,
            chainName: wallet.chain,
        }));
        try {
            // Delegate all wallets at once
            yield delegateKeyShares(walletsToDelegate);
            // Emit success event for each wallet
            selectedWalletObjects.forEach((wallet) => {
                dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationCompleted', wallet);
            });
        }
        catch (error) {
            logger.logger.error('Failed to delegate wallets', error);
            throw error;
        }
        // Delegation completion is tracked by the backend through keyShares
        // No need to update local storage
        // Emit overall success event
        dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationCompleted', selectedWalletObjects[0]);
        return true;
    }), {
        onFailure: (err) => {
            logger.logger.error('Failed to delegate wallets', err);
            dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationFailed', err);
        },
    });
    const errorText = React.useMemo(() => {
        if (!error) {
            return undefined;
        }
        if (error instanceof utils.DynamicError) {
            return error.message;
        }
        try {
            return getProperErrorMessage.getProperErrorMessage(error, user);
        }
        catch (e) {
            logger.logger.error('Error getting proper error message', e);
            return;
        }
    }, [error, user]);
    const { t } = reactI18next.useTranslation();
    const getSelectButtonText = () => {
        if (selectedWallets.size === waasWallets.length) {
            return t('dyn_wallet_delegation.deselect_all');
        }
        if (selectedWallets.size === 0) {
            return t('dyn_wallet_delegation.select_all');
        }
        return t('dyn_wallet_delegation.clear');
    };
    // Loading state content
    const loadingContent = (jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__description', children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__approval-section', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__approval-icon', children: jsxRuntime.jsx(switchHorizontal.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', className: 'embedded-delegated-view__approval-title', children: t('dyn_wallet_delegation.approving_permissions', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'embedded-delegated-view__approval-description', children: t('dyn_wallet_delegation.revoke_note') })] }) }));
    // Success state content
    const successContent = (jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__description', children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__approval-section', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__approval-icon', children: jsxRuntime.jsx(check.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', className: 'embedded-delegated-view__approval-title', children: t('dyn_wallet_delegation.permissions_granted', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'embedded-delegated-view__approval-description', children: t('dyn_wallet_delegation.revoke_note') })] }) }));
    // Error state content
    const errorContent = (jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__description', children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__approval-section', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__error-icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', className: 'embedded-delegated-view__approval-title', children: t('dyn_wallet_delegation.something_went_wrong') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'embedded-delegated-view__approval-description', children: t('dyn_wallet_delegation.delegation_timeout_message') })] }) }));
    // Initial state content
    const initialContent = (jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__description', children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__approval-section', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__approval-icon', children: jsxRuntime.jsx(switchHorizontal.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', className: 'embedded-delegated-view__approval-title', copykey: 'dyn_wallet_delegation.approval_required', children: requiresDelegation
                        ? t('dyn_wallet_delegation.approval_required')
                        : t('dyn_wallet_delegation.approval_requested') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'embedded-delegated-view__approval-description', copykey: 'dyn_wallet_delegation.approval_description', children: t('dyn_wallet_delegation.approval_description', {
                        appName,
                    }) })] }) }));
    // Single wallet view
    const displaySingleWallet = () => {
        const [wallet] = waasWallets;
        if (!wallet)
            return null;
        return (jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-card-container', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-card', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', color: 'primary', children: t('dyn_wallet_delegation.my_wallet') }), jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-address', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-address-dot' }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [wallet.address.slice(0, 6), "...", wallet.address.slice(-4)] })] })] }), jsxRuntime.jsx(AgreementSection.AgreementSection, { checked: agreementChecked, onToggle: () => setAgreementChecked(!agreementChecked), text: t('dyn_wallet_delegation.agreement_text') })] }));
    };
    // Multi-wallet initial view
    const displayMultiWalletSummary = () => (jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-card-container', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-card', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-card-header', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', color: 'primary', children: t(selectedWallets.size === waasWallets.length
                                    ? 'dyn_wallet_delegation.all_wallets'
                                    : 'dyn_wallet_delegation.selected_wallets') }), selectedWallets.size !== waasWallets.length && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'tertiary', children: selectedWallets.size.toString().padStart(2, '0') }))] }), jsxRuntime.jsx("button", { onClick: () => setShowEditView(true), className: 'embedded-delegated-view__edit-selections-button', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_wallet_delegation.edit_selections') }) })] }), jsxRuntime.jsx(AgreementSection.AgreementSection, { checked: agreementChecked, onToggle: () => setAgreementChecked(!agreementChecked), text: t('dyn_wallet_delegation.agreement_text') })] }));
    // Edit view (full wallet selection)
    const displayWaasWallets = () => (jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-selection', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-selection__header', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-selection__header-text', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_wallet_delegation.selected_wallets') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: selectedWallets.size.toString().padStart(2, '0') })] }), jsxRuntime.jsx("button", { onClick: selectedWallets.size === waasWallets.length
                            ? handleDeselectAll
                            : handleSelectAll, className: 'embedded-delegated-view__wallet-selection__deselect-all', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: getSelectButtonText() }) })] }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-list', children: waasWallets === null || waasWallets === void 0 ? void 0 : waasWallets.map((wallet) => {
                    var _a, _b;
                    return (jsxRuntime.jsx("div", { className: `embedded-delegated-view__wallet-item${selectedWallets.has(wallet.id)
                            ? ' embedded-delegated-view__wallet-item--selected'
                            : ''}`, onClick: () => handleWalletToggle(wallet.id), children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-item__content', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__icon', children: jsxRuntime.jsx(WalletIconWithNetwork.WalletIconWithNetwork, { walletKey: wallet.key, Icon: null, iconUrl: (_b = (_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.icon, chainName: wallet.chain, iconSize: 24, showNetwork: true }) }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__info', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', weight: 'medium', children: [wallet.address.slice(0, 6), "...", wallet.address.slice(-4)] }) }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__checkbox', children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: selectedWallets.has(wallet.id), onChange: (e) => e.stopPropagation(), value: wallet.id }) })] }) }, wallet.id));
                }) })] }));
    const navigationButton = showEditView || showLearnMoreView ? (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => {
            setShowEditView(false);
            setShowLearnMoreView(false);
            // Reset agreement when coming back from edit view
            setAgreementChecked(false);
        }, type: 'button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) })) : (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => {
            // Mark prompt as dismissed until logout (unified state + legacy)
            const state = utils.StorageService.getItem(localStorage.DELEGATION_STATE) || { completed: {}, denied: {}, dismissed: false };
            state.dismissed = true;
            utils.StorageService.setItem(localStorage.DELEGATION_STATE, state);
            // No legacy mirror; unified state only
            setShowAuthFlow(false);
        }, type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
    const learnMoreButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowLearnMoreView(true), type: 'button', children: jsxRuntime.jsx(questionMark.ReactComponent, {}) }));
    const learnMoreContent = () => (jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__learn-more-content', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__learn-more-content-icon', children: jsxRuntime.jsx(question.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', className: 'embedded-delegated-view__learn-more-content-description', children: t('dyn_wallet_delegation.learn_more_description') })] }));
    // Determine which content to show based on state
    const getContentHeader = () => {
        if (isLoading)
            return loadingContent;
        if (isSuccess)
            return successContent;
        if (error)
            return errorContent;
        return initialContent;
    };
    // Determine which buttons to show based on state
    const getButtons = () => {
        if (showLearnMoreView) {
            return (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'secondary', typographyProps: {
                    color: 'primary',
                    weight: 'medium',
                }, onClick: () => {
                    setShowLearnMoreView(false);
                    setShowEditView(false);
                    setAgreementChecked(false);
                }, dataTestId: 'embedded-delegation-okay-button', copykey: 'dyn_wallet_delegation.learn_more_okay_button', style: {
                    backgroundColor: 'var(--dynamic-base-2)',
                    border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                    width: '100%',
                }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.learn_more_okay_button') }));
        }
        if (isSuccess) {
            return (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
                    color: 'primary',
                    weight: 'bold',
                }, onClick: () => setShowAuthFlow(false), dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
                    backgroundColor: 'var(--dynamic-base-2)',
                    border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                    width: '100%',
                }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
        }
        if (error) {
            return (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
                    color: 'primary',
                    weight: 'bold',
                }, onClick: () => handleDelegateWallets(), dataTestId: 'embedded-delegation-try-again-button', copykey: 'dyn_wallet_delegation.try_again_button', style: {
                    backgroundColor: 'var(--dynamic-base-2)',
                    border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                    width: '100%',
                }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.try_again_button') }));
        }
        // If in edit view, show Done button
        if (showEditView) {
            return (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'secondary', typographyProps: {
                    color: 'primary',
                    weight: 'medium',
                }, onClick: () => {
                    setShowEditView(false);
                    setAgreementChecked(false);
                    setShowLearnMoreView(false);
                }, dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
                    backgroundColor: 'var(--dynamic-base-2)',
                    border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                    width: '100%',
                }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
        }
        return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
                        color: 'inherit',
                    }, onClick: () => handleDelegateWallets(), loading: isLoading, disabled: selectedWallets.size === 0 || !agreementChecked, dataTestId: 'embedded-delegation-button', copykey: 'dyn_wallet_delegation.approve_button', style: { width: '100%' }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.approve_button') }), !isLoading && !requiresDelegation && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
                        color: 'primary',
                        weight: 'bold',
                    }, onClick: () => handleDenySelectedWallets(), dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
                        backgroundColor: 'var(--dynamic-base-2)',
                        border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                        width: '100%',
                    }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__deny-button', expanded: true, children: t('dyn_wallet_delegation.deny_button') })), !isLoading && requiresDelegation && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
                        color: 'primary',
                        weight: 'bold',
                    }, onClick: () => {
                        handleLogOut();
                    }, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
                        backgroundColor: 'var(--dynamic-base-2)',
                        border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
                        width: '100%',
                    }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__logout-button', expanded: true, children: t('dyn_wallet_delegation.logout_button') }))] }));
    };
    // Header configuration
    let headerLeading;
    let headerTrailing;
    if (showEditView || showLearnMoreView) {
        headerLeading = navigationButton;
        headerTrailing = undefined;
    }
    else {
        // Only show learn more button on initial screen (not loading, success, or error states)
        if (!isLoading && !isSuccess && !error) {
            headerTrailing = learnMoreButton;
        }
        if (!requiresDelegation) {
            headerLeading = navigationButton;
        }
        else {
            headerLeading = undefined;
        }
    }
    const getHeaderChildren = () => {
        if (showEditView) {
            return (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'primary', children: t('dyn_wallet_delegation.edit_wallets_to_delegate') }));
        }
        if (showLearnMoreView) {
            return (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'primary', children: t('dyn_wallet_delegation.learn_more') }));
        }
        return undefined;
    };
    const headerChildren = getHeaderChildren();
    return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: headerLeading, trailing: headerTrailing, style: {
                    paddingBottom: showEditView || showLearnMoreView ? '24px' : 0,
                }, children: headerChildren }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view', children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__body', children: [!showEditView && !showLearnMoreView && getContentHeader(), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), !isLoading && !isSuccess && !error && (jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__card', children: (() => {
                                if (showEditView)
                                    return displayWaasWallets();
                                if (showLearnMoreView)
                                    return learnMoreContent();
                                if (waasWallets.length === 1)
                                    return displaySingleWallet();
                                if (waasWallets.length > 1)
                                    return displayMultiWalletSummary();
                                return null;
                            })() })), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__body__button_section', children: getButtons() })] }) })] }));
};

exports.WalletDelegationView = WalletDelegationView;
