import { j as css, r as resetStyles, l as i, m as b, R as RouterController, O as OptionsController, q as ConstantsUtil$1 } from './swap-module-FeeWbpqO.js';
import { n, c as customElement } from './index-BYNzHJr1.js';
import { C as ConstantsUtil } from './ConstantsUtil-DtZPtFUa.js';

var styles = css `
  :host {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: ${({ spacing }) => spacing[1]};
    text-transform: uppercase;
    white-space: nowrap;
  }

  :host([data-variant='accent']) {
    background-color: ${({ tokens }) => tokens.core.foregroundAccent010};
    color: ${({ tokens }) => tokens.core.textAccentPrimary};
  }

  :host([data-variant='info']) {
    background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
    color: ${({ tokens }) => tokens.theme.textSecondary};
  }

  :host([data-variant='success']) {
    background-color: ${({ tokens }) => tokens.core.backgroundSuccess};
    color: ${({ tokens }) => tokens.core.textSuccess};
  }

  :host([data-variant='warning']) {
    background-color: ${({ tokens }) => tokens.core.backgroundWarning};
    color: ${({ tokens }) => tokens.core.textWarning};
  }

  :host([data-variant='error']) {
    background-color: ${({ tokens }) => tokens.core.backgroundError};
    color: ${({ tokens }) => tokens.core.textError};
  }

  :host([data-variant='certified']) {
    background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
    color: ${({ tokens }) => tokens.theme.textSecondary};
  }

  :host([data-size='md']) {
    height: 30px;
    padding: 0 ${({ spacing }) => spacing[2]};
    border-radius: ${({ borderRadius }) => borderRadius[2]};
  }

  :host([data-size='sm']) {
    height: 20px;
    padding: 0 ${({ spacing }) => spacing[1]};
    border-radius: ${({ borderRadius }) => borderRadius[1]};
  }
`;

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let WuiTag = class WuiTag extends i {
    constructor() {
        super(...arguments);
        this.variant = 'accent';
        this.size = 'md';
        this.icon = undefined;
    }
    render() {
        this.dataset['variant'] = this.variant;
        this.dataset['size'] = this.size;
        const textVariant = this.size === 'md' ? 'md-medium' : 'sm-medium';
        const iconSize = this.size === 'md' ? 'md' : 'sm';
        return b `
      ${this.icon ? b `<wui-icon size=${iconSize} name=${this.icon}></wui-icon>` : null}
      <wui-text
        display="inline"
        data-variant=${this.variant}
        variant=${textVariant}
        color="inherit"
      >
        <slot></slot>
      </wui-text>
    `;
    }
};
WuiTag.styles = [resetStyles, styles];
__decorate([
    n()
], WuiTag.prototype, "variant", void 0);
__decorate([
    n()
], WuiTag.prototype, "size", void 0);
__decorate([
    n()
], WuiTag.prototype, "icon", void 0);
WuiTag = __decorate([
    customElement('wui-tag')
], WuiTag);

const HelpersUtil = {
    getTabsByNamespace(namespace) {
        const isEVM = Boolean(namespace) && namespace === ConstantsUtil$1.CHAIN.EVM;
        if (!isEVM) {
            return [];
        }
        if (OptionsController.state.remoteFeatures?.activity === false) {
            return ConstantsUtil.ACCOUNT_TABS.filter(tab => tab.label !== 'Activity');
        }
        return ConstantsUtil.ACCOUNT_TABS;
    },
    isValidReownName(name) {
        return /^[a-zA-Z0-9]+$/gu.test(name);
    },
    isValidEmail(email) {
        return /^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(email);
    },
    validateReownName(name) {
        const sanitizedName = name.replace(/\^/gu, '').toLowerCase();
        return sanitizedName.replace(/[^a-zA-Z0-9]/gu, '');
    },
    hasFooter() {
        const view = RouterController.state.view;
        if (ConstantsUtil.VIEWS_WITH_LEGAL_FOOTER.includes(view)) {
            const { termsConditionsUrl, privacyPolicyUrl } = OptionsController.state;
            const legalCheckbox = OptionsController.state.features?.legalCheckbox;
            const showOnlyBranding = (!termsConditionsUrl && !privacyPolicyUrl) || legalCheckbox;
            if (showOnlyBranding) {
                return false;
            }
            return true;
        }
        return ConstantsUtil.VIEWS_WITH_DEFAULT_FOOTER.includes(view);
    }
};

export { HelpersUtil as H };
//# sourceMappingURL=HelpersUtil-BYZ-LH18.js.map

//# sourceMappingURL=HelpersUtil-BYZ-LH18.js.map