function generateFallbackLabel(key) {
    return key.replace(/-/g, " ").replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
}

function getMetricLang(metricKey, field) {
    const langKey = metricKey.replace(/-/g, "_");
    const value = getLang(`screener.metrics.${langKey}.${field}`, "");
    if (!value && field === "label") {
        return generateFallbackLabel(metricKey);
    }
    return value;
}

export function getPresets(type, rootNode = null) {
    const useAllPreset = {
        "overview": [ "candle-type", "candle-pattern", "price", "open", "high", "low", "change", "change-percent", "exchange", "signal-summary" ],
        "performance": [ "rank", "price", "24h-change", "change-percent", "weekly-perf", "monthly-perf", "3-months-perf", "6-months-perf", "yearly-perf", "ytd-perf", "5-year-perf", "all-time-perf", "perf-1w-marketcap", "perf-1m-marketcap", "perf-1y-marketcap", "52w-high", "52w-low" ],
        "oscillators": [ "rank", "price", "rsi", "macd", "stochastic", "adx", "ultimate-oscillator" ],
        "moving_averages": [ "rank", "price", "ema10", "ema25", "ema100", "ema200", "sma10", "sma25", "sma100", "sma200" ],
        "signals": [ "price", "signal-summary", "signal-confidence", "signal-trend", "parabolic-sar" ],
        "pivot_points": [ "price", "pivot-classic", "pivot-classic-r1", "pivot-classic-r2", "pivot-classic-r3", "pivot-classic-s1", "pivot-classic-s2", "pivot-classic-s3", "pivot-fibonacci", "pivot-camarilla", "pivot-woodie", "pivot-demark" ],
        "technical_analysis": [ "price", "signal-summary", "signal-confidence", "signal-trend", "rsi", "macd", "stochastic", "adx", "ultimate-oscillator", "parabolic-sar", "ema10", "ema25", "ema100", "ema200", "sma10", "sma25", "sma100", "sma200" ],
        "highs_lows": [ "price", "52w-high", "52w-low", "1m-high", "1m-low", "3m-high", "3m-low", "6m-high", "6m-low", "all-time-high", "all-time-low", "weekly-perf", "monthly-perf", "yearly-perf" ],
        "price_action": [ "price", "open", "high", "low", "change", "change-percent", "vwap", "candle-type", "candle-pattern", "candle-body-size", "candle-upper-shadow", "candle-lower-shadow", "candle-body-range" ],
        "volatility_analysis": [ "rank", "volatility-level", "change-percent", "daily-volatility", "weekly-volatility", "monthly-volatility", "beta-1y", "beta-3y", "beta-5y", "atr-percent", "true-range", "bollinger-width", "bollinger-position", "bollinger-middle", "bollinger-squeeze" ],
        "addresses": [ "rank", "price", "market-cap", "addresses-balance", "addresses-active", "addresses-new", "active-address-ratio" ],
        "trading": [ "price", "change-24h", "trading-volume-24h", "buy-volume-24h", "sell-volume-24h", "trading-volume-4h", "buy-volume-4h", "sell-volume-4h", "trading-volume-1h", "buy-volume-1h", "sell-volume-1h", "trading-volume-15m", "buy-volume-15m", "sell-volume-15m" ],
        "valuation": [ "perf-1y-marketcap", "enterprise-value", "pe-ratio", "pb-ratio", "eps-ttm", "eps-fy", "eps-fq", "dividend-yield", "52w-high", "52w-low", "beta-1y", "beta-3y", "beta-5y" ],
        "earnings": [ "fiscal-period-current", "fiscal-period-end-current", "perf-1y-marketcap", "eps-ttm", "eps-fy", "eps-fq", "pe-ratio", "total-revenue-ttm", "net-income-ttm", "operating-income-ttm", "ebitda-ttm", "free-cash-flow-ttm", "total-shares-outstanding", "float-shares" ],
        "income_statement": [ "fiscal-period-current", "fiscal-period-end-current", "total-revenue-ttm", "net-income-ttm", "gross-profit-ttm", "research-dev-ttm", "operating-income-ttm", "ebitda-ttm", "eps-ttm", "eps-fy", "eps-fq", "pe-ratio" ],
        "balance_sheet": [ "fiscal-period-current", "fiscal-period-end-current", "total-current-assets-fq", "total-current-assets-fy", "total-assets-fq", "total-assets-fy", "total-liabilities-fq", "total-liabilities-fy", "total-equity-fq", "total-equity-fy", "total-debt-fq", "total-debt-fy", "cash-equivalents-fq", "cash-equivalents-fy", "pb-ratio", "enterprise-value" ],
        "cash_flow": [ "fiscal-period-current", "fiscal-period-end-current", "free-cash-flow-ttm", "operating-income-ttm", "net-income-ttm", "capital-expenditures-ttm", "cash-financing-activities-ttm", "enterprise-value" ],
        "fundamentals": [ "perf-1y-marketcap", "pe-ratio", "pb-ratio", "eps-ttm", "dividend-yield-current", "beta-1y", "total-revenue-ttm", "net-income-ttm", "free-cash-flow-ttm", "total-debt-fq", "total-equity-fq", "total-shares-outstanding" ],
        "dividends": [ "price", "dps-fy", "dividend-yield-current", "dividend-yield-fq", "dividend-yield-fy", "continuous-dividend-growth", "continuous-dividend-payout" ],
        "volume_analysis": [ "price", "volume", "vwap", "avg-volume-10d", "avg-volume-30d", "avg-volume-60d", "avg-volume-90d", "relative-volume-10d" ],
        "sector_analysis": [ "price", "change-percent", "perf-1y-marketcap", "pe-ratio", "sector", "country", "region", "market", "weekly-perf", "monthly-perf", "yearly-perf" ],
        "extended_hours": [ "pre-market-price", "pre-market-change", "pre-market-change-percent", "pre-market-volume", "price", "change", "change-percent", "volume", "post-market-price", "post-market-change", "post-market-change-percent", "post-market-volume" ]
    };
    const PRESETS = {
        "crypto": {
            "overview": [ "exchange", "candle-type", "signal-summary", "price", "open", "high", "low", "24h-change", "volume-24h", "ask", "bid" ]
        },
        "dex": {
            "overview": [ "blockchain-network", "exchange", "price", "24h-change", "txs-count-24h", "trading-volume-24h", "total-liquidity", "signal-summary", "candle-type", "buy-volume-24h", "sell-volume-24h" ],
            "transactions": [ "price", "change-24h", "txs-count-24h", "buyers-24h", "sellers-24h", "txs-count-4h", "buyers-4h", "sellers-4h", "txs-count-1h", "buyers-1h", "sellers-1h", "txs-count-15m", "buyers-15m", "sellers-15m", "total-liquidity" ]
        },
        "coin": {
            "overview": [ "rank", "market-cap", "price", "change", "change-percent", "24h-vol-cmc", "max-supply", "total-supply", "circulating-supply", "socialdominance", "category" ],
            "transactions": [ "rank", "price", "market-cap", "market-cap-diluted", "txs-volume", "txs-volume-usd", "txs-count", "addresses-active" ]
        },
        "forex": {
            "overview": [ "candle-type", "signal-summary", "price", "open", "high", "low", "change", "change-percent", "daily-volatility", "ask", "bid", "exchange" ]
        },
        "stock": {
            "overview": [ "price", "change", "change-percent", "volume", "vwap", "market-cap-stock", "sector", "dividend-yield-current", "total-revenue-fq", "total-equity-fq", "total-shares-outstanding", "exchange" ]
        },
        "index": {
            "overview": [ "price", "change", "change-percent", "volume", "vwap", "exchange", "all-time-high", "all-time-low", "daily-volatility" ]
        },
        "dr": {
            "overview": [ "exchange", "market-cap-stock", "price", "change", "change-percent", "volume", "avg-volume-10d", "perf-1m-marketcap", "weekly-perf", "pe-ratio", "sector", "sub-type" ]
        },
        "fund": {
            "overview": [ "exchange", "price", "open", "high", "low", "change", "change-percent", "volume", "sector", "isin" ]
        }
    };
    const root = rootNode || document;
    const columnSetButtons = root.querySelectorAll(".data-controls .data-controls-left [data-coloumn-set]");
    if (columnSetButtons.length === 0) {
        return {
            ...useAllPreset,
            ...PRESETS[type] || {}
        };
    }
    const typePresets = PRESETS[type] || {};
    const filteredPresets = {};
    columnSetButtons.forEach(button => {
        const columnSet = button.dataset.coloumnSet;
        if (!columnSet) return;
        if (columnSet === "custom") return;
        if (typePresets[columnSet]) {
            filteredPresets[columnSet] = typePresets[columnSet];
        } else if (useAllPreset[columnSet]) {
            filteredPresets[columnSet] = useAllPreset[columnSet];
        } else {
            button.remove();
        }
    });
    return filteredPresets;
}

const getSelectOption = (key, fallback) => window.LANG?.select_options?.[key] || fallback;

const DEFAULT_SELECT_OPTIONS = {
    "coins-category": {
        defi: "DeFi",
        gaming: "Gaming",
        stablecoins: "Stablecoins",
        "layer 1": "Layer 1",
        web3: "Web3",
        memes: "Memes",
        energy: "Energy",
        cryptocurrencies: "Cryptocurrencies",
        dao: "DAO",
        "animal memes": "Animal Memes",
        metaverse: "Metaverse",
        privacy: "Privacy",
        "made in america": "Made in America",
        payments: "Payments",
        "exchange tokens": "Exchange Tokens",
        "social media and content": "Social Media and Content",
        oracles: "Oracles",
        scaling: "Scaling"
    },
    "volatility-level": {
        high: "High",
        medium: "Medium",
        low: "Low"
    },
    "candle-type": {
        bullish: "Bullish",
        bearish: "Bearish",
        doji: "Doji"
    },
    "candle-pattern": {
        hammer: "Hammer",
        "shooting star": "Shooting Star",
        doji: "Doji",
        normal: "Normal"
    },
    "signal-trend": {
        strong: "Strong",
        weak: "Weak",
        moderate: "Moderate"
    },
    "squeeze": {
        squeeze: "Squeeze",
        normal: "Normal"
    },
    "signal-summary": {
        "strong buy": "Strong Buy",
        buy: "Buy",
        "weak buy": "Weak Buy",
        "strong sell": "Strong Sell",
        sell: "Sell",
        "weak sell": "Weak Sell",
        neutral: "Neutral"
    },
    "type-stock": {
        stock: "Stock",
        dr: "DR",
        fund: "Funds"
    }
};

const MARKET_SELECT_OPTIONS = {
    get coinsCategory() {
        return getSelectOption("coins-category", DEFAULT_SELECT_OPTIONS["coins-category"]);
    },
    get volatilityLevel() {
        return getSelectOption("volatility-level", DEFAULT_SELECT_OPTIONS["volatility-level"]);
    },
    get candleType() {
        return getSelectOption("candle-type", DEFAULT_SELECT_OPTIONS["candle-type"]);
    },
    get priceActionPattern() {
        return getSelectOption("candle-pattern", DEFAULT_SELECT_OPTIONS["candle-pattern"]);
    },
    get trend() {
        return getSelectOption("signal-trend", DEFAULT_SELECT_OPTIONS["signal-trend"]);
    },
    get squeeze() {
        return getSelectOption("squeeze", DEFAULT_SELECT_OPTIONS["squeeze"]);
    },
    get signal() {
        return getSelectOption("signal-summary", DEFAULT_SELECT_OPTIONS["signal-summary"]);
    },
    get signalWithoutWeek() {
        const options = getSelectOption("signal-summary", DEFAULT_SELECT_OPTIONS["signal-summary"]);
        const {"weak buy": _, "weak sell": __, ...rest} = options;
        return rest;
    },
    get typeStock() {
        return getSelectOption("type-stock", DEFAULT_SELECT_OPTIONS["type-stock"]);
    },
    blockchain_networks: [ {
        label: "Ethereum",
        value: "ethereum",
        icon: "ethereum"
    }, {
        label: "Binance Smart Chain (BEP20)",
        value: "bnb_smart_chain_bep20",
        icon: "bnb_smart_chain_bep20"
    }, {
        label: "Polygon",
        value: "polygon",
        icon: "polygon"
    }, {
        label: "Arbitrum",
        value: "arbitrum",
        icon: "arbitrum"
    }, {
        label: "Pulsechain",
        value: "pulsechain",
        icon: "pulsechain"
    }, {
        label: "Base",
        value: "base",
        icon: "base"
    }, {
        label: "Solana",
        value: "solana",
        icon: "solana"
    } ]
};

export const METRICS = {
    "price": {
        path: "active.c",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        comma_format: true,
        socket_update: true
    },
    "bid": {
        path: "active.b",
        category: "price",
        comma_format: true,
        socket_update: true,
        assets: [ "forex", "crypto", "dex" ]
    },
    "ask": {
        path: "active.a",
        category: "price",
        comma_format: true,
        socket_update: true,
        assets: [ "forex", "crypto", "dex" ]
    },
    "open": {
        path: "active.o",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        comma_format: true,
        socket_update: true
    },
    "high": {
        path: "active.h",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        comma_format: true,
        socket_update: true
    },
    "low": {
        path: "active.l",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        comma_format: true,
        socket_update: true
    },
    "previous-close": {
        path: "previous.c",
        category: "price",
        subText: {
            path: "profile.currency"
        }
    },
    "vwap": {
        path: "active.vw",
        category: "price"
    },
    "pre-market-price": {
        path: "premarket.c",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "PRE",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-open": {
        path: "premarket.o",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "PRE",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-high": {
        path: "premarket.h",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "PRE",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-low": {
        path: "premarket.l",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "PRE",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-volume": {
        path: "premarket.v",
        category: "price",
        socket_update: true,
        class_prefix: "PRE",
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-price": {
        path: "postmarket.c",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "POST",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-open": {
        path: "postmarket.o",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "POST",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-high": {
        path: "postmarket.h",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "POST",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-low": {
        path: "postmarket.l",
        category: "price",
        comma_format: true,
        socket_update: true,
        class_prefix: "POST",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-volume": {
        path: "postmarket.v",
        category: "price",
        socket_update: true,
        class_prefix: "POST",
        assets: [ "stock", "dr", "fund" ]
    },
    "market-cap": {
        path: "perf.market_cap",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        assets: [ "coin" ]
    },
    "market-cap-stock": {
        path: "earnings.market_cap",
        category: "price",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "market-cap-diluted": {
        path: "perf.market_cap_diluted",
        category: "price",
        assets: [ "coin" ]
    },
    "change": {
        path: "active.ch",
        category: "change",
        color_change: "yes",
        socket_update: true
    },
    "change-percent": {
        path: "active.chp",
        category: "change",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        socket_update: true
    },
    "24h-change": {
        path: "perf.24h_change",
        category: "change",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "crypto", "dex" ]
    },
    "post-market-change": {
        path: "postmarket.ch",
        category: "price",
        color_change: "yes",
        socket_update: true,
        class_prefix: "POST",
        assets: [ "stock", "dr", "fund" ]
    },
    "post-market-change-percent": {
        path: "postmarket.chp",
        category: "price",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        socket_update: true,
        class_prefix: "POST",
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-change": {
        path: "premarket.ch",
        category: "price",
        color_change: "yes",
        socket_update: true,
        class_prefix: "PRE",
        assets: [ "stock", "dr", "fund" ]
    },
    "pre-market-change-percent": {
        path: "premarket.chp",
        category: "price",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        socket_update: true,
        class_prefix: "PRE",
        assets: [ "stock", "dr", "fund" ]
    },
    "volume": {
        path: "active.v",
        category: "volume",
        socket_update: true
    },
    "volume-24h": {
        path: "perf.24h_vol",
        category: "volume",
        assets: [ "crypto", "dex" ]
    },
    "avg-volume-10d": {
        path: "perf.avg_vol_10d",
        category: "volume",
        assets: [ "stock", "dr", "fund" ]
    },
    "avg-volume-30d": {
        path: "perf.avg_vol_30d",
        category: "volume",
        assets: [ "stock", "dr", "fund" ]
    },
    "avg-volume-60d": {
        path: "perf.avg_vol_60d",
        category: "volume",
        assets: [ "stock", "dr", "fund" ]
    },
    "avg-volume-90d": {
        path: "perf.avg_vol_90d",
        category: "volume",
        assets: [ "stock", "dr", "fund" ]
    },
    "relative-volume-10d": {
        path: "perf.relative_volume_10d_calc",
        category: "volume",
        assets: [ "stock", "dr", "fund" ]
    },
    "trading-volume-15m": {
        path: "perf.trading_volume_15m",
        category: "volume",
        assets: [ "dex" ]
    },
    "trading-volume-1h": {
        path: "perf.trading_volume_1h",
        category: "volume",
        assets: [ "dex" ]
    },
    "trading-volume-4h": {
        path: "perf.trading_volume_4h",
        category: "volume",
        assets: [ "dex" ]
    },
    "trading-volume-24h": {
        path: "perf.trading_volume_24h",
        category: "volume",
        assets: [ "dex" ]
    },
    "24h-vol-cmc": {
        path: "perf.24h_vol_cmc",
        category: "volume",
        assets: [ "coin" ]
    },
    "txs-volume": {
        path: "perf.txs_volume",
        category: "volume",
        assets: [ "coin" ]
    },
    "txs-volume-usd": {
        path: "perf.txs_volume_usd",
        category: "volume",
        assets: [ "coin" ]
    },
    "max-supply": {
        path: "perf.max_supply",
        category: "supply",
        assets: [ "coin" ]
    },
    "total-supply": {
        path: "perf.total_supply",
        category: "supply",
        assets: [ "coin" ]
    },
    "circulating-supply": {
        path: "perf.circulating_supply",
        category: "supply",
        assets: [ "coin" ]
    },
    "locked": {
        path: "perf.locked",
        category: "supply",
        assets: [ "coin" ]
    },
    "locked-ratio": {
        path: "perf.locked_ratio",
        category: "supply",
        currency: "%",
        type: "percentage",
        assets: [ "coin" ]
    },
    "rank": {
        path: "perf.rank",
        category: "performance",
        assets: [ "coin" ],
        type: "sameReturn"
    },
    "altrank": {
        path: "perf.altrank",
        category: "performance",
        assets: [ "coin" ],
        type: "sameReturn"
    },
    "weekly-perf": {
        path: "perf.perf_1w",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "monthly-perf": {
        path: "perf.perf_1m",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "3-months-perf": {
        path: "perf.perf_3m",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "6-months-perf": {
        path: "perf.perf_6m",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "ytd-perf": {
        path: "perf.perf_ytd",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "yearly-perf": {
        path: "perf.perf_1y",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "5-year-perf": {
        path: "perf.perf_5y",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "all-time-perf": {
        path: "perf.perf_all",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage"
    },
    "perf-1w-marketcap": {
        path: "perf.1w_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-1m-marketcap": {
        path: "perf.1m_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-3m-marketcap": {
        path: "perf.3m_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-6m-marketcap": {
        path: "perf.6m_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-ytd-marketcap": {
        path: "perf.ytd_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-1y-marketcap": {
        path: "perf.1y_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "perf-5y-marketcap": {
        path: "perf.5y_marketcap",
        category: "performance",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "velocity": {
        path: "perf.velocity",
        category: "performance",
        assets: [ "coin" ]
    },
    "vol-to-marketcap": {
        path: "perf.vol_to_marketcap",
        category: "performance",
        assets: [ "coin" ]
    },
    "socialdominance": {
        path: "perf.socialdominance",
        category: "performance",
        currency: "%",
        type: "percentage",
        assets: [ "coin" ]
    },
    "addresses-balance": {
        path: "perf.addresses_with_balance",
        category: "network",
        assets: [ "coin" ]
    },
    "addresses-active": {
        path: "perf.addresses_active",
        category: "network",
        assets: [ "coin" ]
    },
    "addresses-new": {
        path: "perf.addresses_new",
        category: "network",
        assets: [ "coin" ]
    },
    "active-address-ratio": {
        path: "perf.active_address_ratio",
        category: "network",
        assets: [ "coin" ]
    },
    "txs-count": {
        path: "perf.txs_count",
        category: "network",
        type: "sameReturn",
        assets: [ "coin" ]
    },
    "avg-txn-base": {
        path: "perf.avg_txn_base",
        category: "network",
        assets: [ "coin" ]
    },
    "avg-txn-usd": {
        path: "perf.avg_txn_usd",
        category: "network",
        assets: [ "coin" ]
    },
    "nvt": {
        path: "perf.nvt",
        category: "performance",
        assets: [ "coin" ]
    },
    "interactions": {
        path: "perf.interactions",
        category: "network",
        assets: [ "coin" ]
    },
    "1m-high": {
        path: "perf.high_1m",
        category: "highs_lows"
    },
    "1m-low": {
        path: "perf.low_1m",
        category: "highs_lows"
    },
    "3m-high": {
        path: "perf.high_3m",
        category: "highs_lows"
    },
    "3m-low": {
        path: "perf.low_3m",
        category: "highs_lows"
    },
    "6m-high": {
        path: "perf.high_6m",
        category: "highs_lows"
    },
    "6m-low": {
        path: "perf.low_6m",
        category: "highs_lows"
    },
    "52w-high": {
        path: "perf.high_52",
        category: "highs_lows"
    },
    "52w-low": {
        path: "perf.low_52",
        category: "highs_lows"
    },
    "all-time-high": {
        path: "perf.highest",
        category: "highs_lows"
    },
    "all-time-low": {
        path: "perf.lowest",
        category: "highs_lows"
    },
    "daily-volatility": {
        path: "perf.volt_d",
        category: "volatility",
        currency: "%",
        type: "percentage"
    },
    "weekly-volatility": {
        path: "perf.volt_w",
        category: "volatility",
        currency: "%",
        type: "percentage"
    },
    "monthly-volatility": {
        path: "perf.volt_m",
        category: "volatility",
        currency: "%",
        type: "percentage"
    },
    "atr-percent": {
        path: "indicators.volatility.atr_per",
        category: "volatility",
        currency: "%",
        type: "percentage"
    },
    "true-range": {
        path: "indicators.volatility.true_range",
        category: "volatility"
    },
    "volatility-level": {
        path: "indicators.volatility.level",
        category: "volatility",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.volatilityLevel
    },
    "rsi": {
        path: "oscillators.rsi.v",
        category: "oscillators",
        subText: {
            path: "oscillators.rsi.s",
            type: "icon"
        }
    },
    "rsi-signal": {
        path: "oscillators.rsi.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "stochastic": {
        path: "oscillators.stoch.v",
        category: "oscillators",
        subText: {
            path: "oscillators.stoch.s",
            type: "icon"
        }
    },
    "stochastic-signal": {
        path: "oscillators.stoch.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "macd": {
        path: "oscillators.macd.v",
        category: "oscillators",
        subText: {
            path: "oscillators.macd.s",
            type: "icon"
        }
    },
    "macd-signal": {
        path: "oscillators.macd.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "atr": {
        path: "oscillators.atr.v",
        category: "oscillators",
        subText: {
            path: "oscillators.atr.s",
            type: "icon"
        }
    },
    "atr-signal": {
        path: "oscillators.atr.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "adx": {
        path: "oscillators.adx.v",
        category: "oscillators",
        subText: {
            path: "oscillators.adx.s",
            type: "icon"
        }
    },
    "adx-signal": {
        path: "oscillators.adx.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "ultimate-oscillator": {
        path: "oscillators.uo.v",
        category: "oscillators",
        subText: {
            path: "oscillators.uo.s",
            type: "icon"
        }
    },
    "ultimate-oscillator-signal": {
        path: "oscillators.uo.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "parabolic-sar": {
        path: "oscillators.psar.v",
        category: "oscillators",
        subText: {
            path: "oscillators.psar.s",
            type: "icon"
        }
    },
    "parabolic-sar-signal": {
        path: "oscillators.psar.s",
        category: "oscillators",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "ema10": {
        path: "ma_avg.ema10.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.ema10.s",
            type: "icon"
        }
    },
    "ema10-signal": {
        path: "ma_avg.ema10.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "ema25": {
        path: "ma_avg.ema25.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.ema25.s",
            type: "icon"
        }
    },
    "ema25-signal": {
        path: "ma_avg.ema25.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "ema100": {
        path: "ma_avg.ema100.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.ema100.s",
            type: "icon"
        }
    },
    "ema100-signal": {
        path: "ma_avg.ema100.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "ema200": {
        path: "ma_avg.ema200.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.ema200.s",
            type: "icon"
        }
    },
    "ema200-signal": {
        path: "ma_avg.ema200.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "sma10": {
        path: "ma_avg.sma10.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.sma10.s",
            type: "icon"
        }
    },
    "sma10-signal": {
        path: "ma_avg.sma10.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "sma25": {
        path: "ma_avg.sma25.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.sma25.s",
            type: "icon"
        }
    },
    "sma25-signal": {
        path: "ma_avg.sma25.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "sma100": {
        path: "ma_avg.sma100.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.sma100.s",
            type: "icon"
        }
    },
    "sma100-signal": {
        path: "ma_avg.sma100.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "sma200": {
        path: "ma_avg.sma200.v",
        category: "moving_averages",
        subText: {
            path: "ma_avg.sma200.s",
            type: "icon"
        }
    },
    "sma200-signal": {
        path: "ma_avg.sma200.s",
        category: "moving_averages",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signalWithoutWeek,
        exclude_from_column: true
    },
    "pivot-classic": {
        path: "pivots.classic.P",
        category: "pivots"
    },
    "pivot-classic-r1": {
        path: "pivots.classic.R1",
        category: "pivots"
    },
    "pivot-classic-r2": {
        path: "pivots.classic.R2",
        category: "pivots"
    },
    "pivot-classic-r3": {
        path: "pivots.classic.R3",
        category: "pivots"
    },
    "pivot-classic-s1": {
        path: "pivots.classic.S1",
        category: "pivots"
    },
    "pivot-classic-s2": {
        path: "pivots.classic.S2",
        category: "pivots"
    },
    "pivot-classic-s3": {
        path: "pivots.classic.S3",
        category: "pivots"
    },
    "pivot-fibonacci": {
        path: "pivots.fibonacci.P",
        category: "pivots"
    },
    "pivot-fibonacci-r1": {
        path: "pivots.fibonacci.R1",
        category: "pivots"
    },
    "pivot-fibonacci-r2": {
        path: "pivots.fibonacci.R2",
        category: "pivots"
    },
    "pivot-fibonacci-r3": {
        path: "pivots.fibonacci.R3",
        category: "pivots"
    },
    "pivot-fibonacci-s1": {
        path: "pivots.fibonacci.S1",
        category: "pivots"
    },
    "pivot-fibonacci-s2": {
        path: "pivots.fibonacci.S2",
        category: "pivots"
    },
    "pivot-fibonacci-s3": {
        path: "pivots.fibonacci.S3",
        category: "pivots"
    },
    "pivot-camarilla": {
        path: "pivots.camarilla.P",
        category: "pivots"
    },
    "pivot-camarilla-r1": {
        path: "pivots.camarilla.R1",
        category: "pivots"
    },
    "pivot-camarilla-r2": {
        path: "pivots.camarilla.R2",
        category: "pivots"
    },
    "pivot-camarilla-r3": {
        path: "pivots.camarilla.R3",
        category: "pivots"
    },
    "pivot-camarilla-s1": {
        path: "pivots.camarilla.S1",
        category: "pivots"
    },
    "pivot-camarilla-s2": {
        path: "pivots.camarilla.S2",
        category: "pivots"
    },
    "pivot-camarilla-s3": {
        path: "pivots.camarilla.S3",
        category: "pivots"
    },
    "pivot-woodie": {
        path: "pivots.woodie.P",
        category: "pivots"
    },
    "pivot-woodie-r1": {
        path: "pivots.woodie.R1",
        category: "pivots"
    },
    "pivot-woodie-r2": {
        path: "pivots.woodie.R2",
        category: "pivots"
    },
    "pivot-woodie-r3": {
        path: "pivots.woodie.R3",
        category: "pivots"
    },
    "pivot-woodie-s1": {
        path: "pivots.woodie.S1",
        category: "pivots"
    },
    "pivot-woodie-s2": {
        path: "pivots.woodie.S2",
        category: "pivots"
    },
    "pivot-woodie-s3": {
        path: "pivots.woodie.S3",
        category: "pivots"
    },
    "pivot-demark": {
        path: "pivots.demark.P",
        category: "pivots"
    },
    "pivot-demark-r1": {
        path: "pivots.demark.R1",
        category: "pivots"
    },
    "pivot-demark-s1": {
        path: "pivots.demark.S1",
        category: "pivots"
    },
    "bollinger-width": {
        path: "indicators.bollinger.width_per",
        category: "indicators",
        currency: "%",
        type: "percentage"
    },
    "bollinger-position": {
        path: "indicators.bollinger.pos_per",
        category: "indicators",
        currency: "%",
        type: "percentage"
    },
    "bollinger-middle": {
        path: "indicators.bollinger.middle",
        category: "indicators"
    },
    "bollinger-squeeze": {
        path: "indicators.bollinger.squeeze",
        category: "indicators",
        text_align: "left"
    },
    "candle-body-size": {
        path: "indicators.price_action.body_size",
        category: "price_action"
    },
    "candle-upper-shadow": {
        path: "indicators.price_action.shadow_u",
        category: "price_action"
    },
    "candle-lower-shadow": {
        path: "indicators.price_action.shadow_l",
        category: "price_action"
    },
    "candle-body-range": {
        path: "indicators.price_action.body_range_per",
        category: "price_action",
        currency: "%",
        type: "percentage"
    },
    "candle-type": {
        path: "indicators.price_action.c_type",
        category: "price_action",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.candleType
    },
    "candle-pattern": {
        path: "indicators.price_action.pattern",
        category: "price_action",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.priceActionPattern
    },
    "signal-summary": {
        path: "signal.summary",
        category: "signal",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.signal,
        color_change: "yes",
        subText: {
            path: "signal.summary",
            type: "icon",
            align: "left"
        }
    },
    "signal-score": {
        path: "signal.score",
        category: "signal"
    },
    "signal-confidence": {
        path: "signal.confidence",
        category: "signal",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.volatilityLevel
    },
    "signal-trend": {
        path: "signal.trend",
        category: "signal",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.trend
    },
    "signal-volatility": {
        path: "signal.volatility",
        category: "signal",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.volatilityLevel
    },
    "enterprise-value": {
        path: "earnings.enterprise_value_current",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "pe-ratio": {
        path: "perf.price_earnings_ttm",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "pb-ratio": {
        path: "perf.price_book_fq",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "beta-1y": {
        path: "perf.beta_1y",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "beta-3y": {
        path: "perf.beta_3y",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "beta-5y": {
        path: "perf.beta_5y",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-ttm": {
        path: "earnings.earnings_per_share_diluted_ttm",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-fy": {
        path: "earnings.earnings_per_share_diluted_fy",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-fq": {
        path: "earnings.earnings_per_share_diluted_fq",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-fh": {
        path: "earnings.earnings_per_share_diluted_fh",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-yoy-growth-ttm": {
        path: "earnings.earnings_per_share_diluted_yoy_growth_ttm",
        category: "fundamentals",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-yoy-growth-fy": {
        path: "earnings.earnings_per_share_diluted_yoy_growth_fy",
        category: "fundamentals",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-qoq-growth-fq": {
        path: "earnings.earnings_per_share_diluted_qoq_growth_fq",
        category: "fundamentals",
        currency: "%",
        color_change: "yes",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "dividend-yield-current": {
        path: "earnings.dividends_yield_current",
        category: "fundamentals",
        currency: "%",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "dividend-yield-fy": {
        path: "earnings.dividends_yield_fy",
        category: "fundamentals",
        currency: "%",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "dividend-yield-fq": {
        path: "earnings.dividends_yield_fq",
        category: "fundamentals",
        currency: "%",
        type: "percentage",
        assets: [ "stock", "dr", "fund" ]
    },
    "dps-fy": {
        path: "earnings.dps_common_stock_prim_issue_fy",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "dps-fq": {
        path: "earnings.dps_common_stock_prim_issue_fq",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "dps-fh": {
        path: "earnings.dps_common_stock_prim_issue_fh",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "continuous-dividend-growth": {
        path: "earnings.continuous_dividend_growth",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "continuous-dividend-payout": {
        path: "earnings.continuous_dividend_payout",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-shares-outstanding": {
        path: "earnings.total_shares_outstanding_current",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "float-shares-outstanding": {
        path: "earnings.float_shares_outstanding_current",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "price-target-1y": {
        path: "earnings.price_target_1y",
        category: "fundamentals",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-assets-fq": {
        path: "earnings.total_assets_fq",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-assets-fy": {
        path: "earnings.total_assets_fy",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-current-assets-fq": {
        path: "earnings.total_current_assets_fq",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-current-assets-fy": {
        path: "earnings.total_current_assets_fy",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-liabilities-fq": {
        path: "earnings.total_liabilities_fq",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-liabilities-fy": {
        path: "earnings.total_liabilities_fy",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-current-liabilities-fq": {
        path: "earnings.total_current_liabilities_fq",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-current-liabilities-fy": {
        path: "earnings.total_current_liabilities_fy",
        category: "balance_sheet",
        assets: [ "stock", "dr", "fund" ]
    },
    "total-equity-fq": {
        path: "earnings.total_equity_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-equity-fy": {
        path: "earnings.total_equity_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-debt-fq": {
        path: "earnings.total_debt_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-debt-fy": {
        path: "earnings.total_debt_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "short-term-debt-fq": {
        path: "earnings.short_term_debt_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "short-term-debt-fy": {
        path: "earnings.short_term_debt_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "long-term-debt-fq": {
        path: "earnings.long_term_debt_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "long-term-debt-fy": {
        path: "earnings.long_term_debt_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-debt-fq": {
        path: "earnings.net_debt_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-debt-fy": {
        path: "earnings.net_debt_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-equivalents-fq": {
        path: "earnings.cash_n_equivalents_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-equivalents-fy": {
        path: "earnings.cash_n_equivalents_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-short-term-invest-fq": {
        path: "earnings.cash_n_short_term_invest_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-short-term-invest-fy": {
        path: "earnings.cash_n_short_term_invest_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "goodwill-fq": {
        path: "earnings.goodwill_fq",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "goodwill-fy": {
        path: "earnings.goodwill_fy",
        category: "balance_sheet",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-revenue-ttm": {
        path: "earnings.total_revenue_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-revenue-fy": {
        path: "earnings.total_revenue_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-revenue-fq": {
        path: "earnings.total_revenue_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "total-revenue-fh": {
        path: "earnings.total_revenue_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-income-ttm": {
        path: "earnings.net_income_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-income-fy": {
        path: "earnings.net_income_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-income-fq": {
        path: "earnings.net_income_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "net-income-fh": {
        path: "earnings.net_income_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "operating-income-ttm": {
        path: "earnings.oper_income_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "operating-income-fy": {
        path: "earnings.oper_income_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "operating-income-fq": {
        path: "earnings.oper_income_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "operating-income-fh": {
        path: "earnings.oper_income_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ebitda-ttm": {
        path: "earnings.ebitda_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ebitda-fy": {
        path: "earnings.ebitda_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ebitda-fq": {
        path: "earnings.ebitda_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ebitda-fh": {
        path: "earnings.ebitda_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "gross-profit-ttm": {
        path: "earnings.gross_profit_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "gross-profit-fy": {
        path: "earnings.gross_profit_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "gross-profit-fq": {
        path: "earnings.gross_profit_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "gross-profit-fh": {
        path: "earnings.gross_profit_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "research-dev-ttm": {
        path: "earnings.neg_research_and_dev_ttm",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "research-dev-fy": {
        path: "earnings.neg_research_and_dev_fy",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "research-dev-fq": {
        path: "earnings.neg_research_and_dev_fq",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "research-dev-fh": {
        path: "earnings.neg_research_and_dev_fh",
        category: "income_statement",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "free-cash-flow-ttm": {
        path: "earnings.free_cash_flow_ttm",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "free-cash-flow-fy": {
        path: "earnings.free_cash_flow_fy",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "free-cash-flow-fq": {
        path: "earnings.free_cash_flow_fq",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "free-cash-flow-fh": {
        path: "earnings.free_cash_flow_fh",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-operating-activities-ttm": {
        path: "earnings.cash_f_operating_activities_ttm",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-operating-activities-fy": {
        path: "earnings.cash_f_operating_activities_fy",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-operating-activities-fq": {
        path: "earnings.cash_f_operating_activities_fq",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-operating-activities-fh": {
        path: "earnings.cash_f_operating_activities_fh",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-investing-activities-ttm": {
        path: "earnings.cash_f_investing_activities_ttm",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-investing-activities-fy": {
        path: "earnings.cash_f_investing_activities_fy",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-investing-activities-fq": {
        path: "earnings.cash_f_investing_activities_fq",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-investing-activities-fh": {
        path: "earnings.cash_f_investing_activities_fh",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-financing-activities-ttm": {
        path: "earnings.cash_f_financing_activities_ttm",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-financing-activities-fy": {
        path: "earnings.cash_f_financing_activities_fy",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-financing-activities-fq": {
        path: "earnings.cash_f_financing_activities_fq",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "cash-financing-activities-fh": {
        path: "earnings.cash_f_financing_activities_fh",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "capital-expenditures-ttm": {
        path: "earnings.neg_capital_expenditures_ttm",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "capital-expenditures-fy": {
        path: "earnings.neg_capital_expenditures_fy",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "capital-expenditures-fq": {
        path: "earnings.neg_capital_expenditures_fq",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "capital-expenditures-fh": {
        path: "earnings.neg_capital_expenditures_fh",
        category: "cash_flow",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ev-to-fcf-ttm": {
        path: "earnings.enterprise_value_to_free_cash_flow_ttm",
        category: "valuation",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ev-to-gross-profit-ttm": {
        path: "earnings.enterprise_value_to_gross_profit_ttm",
        category: "valuation",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "ev-to-revenue-ttm": {
        path: "earnings.enterprise_value_to_revenue_ttm",
        category: "valuation",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-forecast-next-fq": {
        path: "earnings.earnings_per_share_forecast_next_fq",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-forecast-next-fy": {
        path: "earnings.earnings_per_share_forecast_next_fy",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "eps-forecast-next-fh": {
        path: "earnings.earnings_per_share_forecast_next_fh",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "revenue-forecast-next-fq": {
        path: "earnings.revenue_forecast_next_fq",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "revenue-forecast-next-fy": {
        path: "earnings.revenue_forecast_next_fy",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "revenue-forecast-next-fh": {
        path: "earnings.revenue_forecast_next_fh",
        category: "forecast",
        subText: {
            path: "profile.currency"
        },
        assets: [ "stock", "dr", "fund" ]
    },
    "fiscal-period-current": {
        path: "earnings.fiscal_period_current",
        category: "fiscal_info",
        text_align: "left",
        exclude_from_filter: true,
        type: "sameReturn",
        assets: [ "stock", "dr", "fund" ]
    },
    "fiscal-period-fy": {
        path: "earnings.fiscal_period_fy",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "sameReturn",
        assets: [ "stock", "dr", "fund" ]
    },
    "fiscal-period-end-current": {
        path: "earnings.fiscal_period_end_current",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "formatDate",
        text_align: "left",
        assets: [ "stock", "dr", "fund" ]
    },
    "fiscal-period-end-fy": {
        path: "earnings.fiscal_period_end_fy",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "fiscal-period-end-fq": {
        path: "earnings.fiscal_period_end_fq",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "earnings-release-date-fq": {
        path: "earnings.earnings_release_trading_date_fq",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "earnings-release-next-date-fq": {
        path: "earnings.earnings_release_next_trading_date_fq",
        category: "fiscal_info",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "number-shareholders-fy": {
        path: "earnings.number_of_shareholders_fy",
        category: "fiscal_info",
        assets: [ "stock", "dr", "fund" ]
    },
    "buys-15m": {
        path: "perf.buys_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sells-15m": {
        path: "perf.sells_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-15m": {
        path: "perf.txs_count_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-uniq-15m": {
        path: "perf.txs_count_uniq_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buyers-15m": {
        path: "perf.buyers_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sellers-15m": {
        path: "perf.sellers_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buy-volume-15m": {
        path: "perf.buy_volume_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sell-volume-15m": {
        path: "perf.sell_volume_15m",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buys-1h": {
        path: "perf.buys_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sells-1h": {
        path: "perf.sells_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-1h": {
        path: "perf.txs_count_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-uniq-1h": {
        path: "perf.txs_count_uniq_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buyers-1h": {
        path: "perf.buyers_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sellers-1h": {
        path: "perf.sellers_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buy-volume-1h": {
        path: "perf.buy_volume_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sell-volume-1h": {
        path: "perf.sell_volume_1h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buys-4h": {
        path: "perf.buys_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sells-4h": {
        path: "perf.sells_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-4h": {
        path: "perf.txs_count_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-uniq-4h": {
        path: "perf.txs_count_uniq_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buyers-4h": {
        path: "perf.buyers_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sellers-4h": {
        path: "perf.sellers_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buy-volume-4h": {
        path: "perf.buy_volume_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sell-volume-4h": {
        path: "perf.sell_volume_4h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buys-24h": {
        path: "perf.buys_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sells-24h": {
        path: "perf.sells_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-24h": {
        path: "perf.txs_count_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "txs-count-uniq-24h": {
        path: "perf.txs_count_uniq_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buyers-24h": {
        path: "perf.buyers_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sellers-24h": {
        path: "perf.sellers_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "buy-volume-24h": {
        path: "perf.buy_volume_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "sell-volume-24h": {
        path: "perf.sell_volume_24h",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "total-liquidity": {
        path: "perf.total_liquidity",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "fully-diluted-value": {
        path: "perf.fully_diluted_value",
        category: "trading_activity",
        assets: [ "dex" ]
    },
    "exchange": {
        path: "profile.exchange",
        category: "profile",
        text_align: "left",
        filter_type: "select",
        data_multiple: true,
        load_options: "exchange"
    },
    "currency": {
        path: "profile.currency",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true
    },
    "type": {
        path: "profile.type",
        category: "profile",
        text_align: "left",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.typeStock,
        assets: [ "stock", "dr", "fund" ]
    },
    "sub-type": {
        path: "profile.sub_type",
        category: "profile",
        text_align: "left",
        filter_type: "select",
        load_options: "sub_type"
    },
    "country": {
        path: "meta.country",
        category: "profile",
        text_align: "left",
        filter_type: "select",
        load_options: "countries",
        max_selected: 5,
        assets: [ "stock", "dr", "fund" ]
    },
    "sector": {
        path: "profile.sector",
        category: "profile",
        text_align: "left",
        filter_type: "select",
        data_multiple: true,
        load_options: "sector",
        max_selected: 5,
        assets: [ "stock", "dr", "fund" ]
    },
    "region": {
        path: "meta.origin",
        category: "profile",
        text_align: "left",
        assets: [ "stock", "dr", "fund" ],
        exclude_from_filter: true
    },
    "market": {
        path: "meta.market",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true
    },
    "isin": {
        path: "profile.isin",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true,
        assets: [ "stock", "dr", "fund" ]
    },
    "base-currency": {
        path: "meta.base_currency",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true,
        assets: [ "forex", "crypto", "dex" ]
    },
    "base-currency-desc": {
        path: "meta.base_currency_desc",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true,
        assets: [ "forex", "crypto", "dex" ]
    },
    "currency-desc": {
        path: "meta.currency_desc",
        category: "profile",
        text_align: "left",
        exclude_from_filter: true
    },
    "update-time": {
        path: "update",
        category: "others",
        text_align: "left",
        exclude_from_filter: true,
        type: "formatDateTime",
        socket_update: true
    },
    "trade-time": {
        path: "active.t",
        category: "others",
        text_align: "left",
        exclude_from_filter: true,
        type: "formatDateTime",
        socket_update: true
    },
    "pre-trade-time": {
        path: "premarket.t",
        category: "others",
        text_align: "left",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "post-trade-time": {
        path: "postmarket.t",
        category: "others",
        text_align: "left",
        exclude_from_filter: true,
        type: "formatDateTime",
        assets: [ "stock", "dr", "fund" ]
    },
    "category": {
        path: "perf.category",
        category: "others",
        assets: [ "coin" ],
        load_options: MARKET_SELECT_OPTIONS.coinsCategory,
        filter_type: "select",
        data_multiple: true,
        text_align: "left"
    },
    "ecosystem": {
        path: "perf.ecosystem",
        category: "others",
        assets: [ "coin" ],
        exclude_from_filter: true,
        text_align: "left"
    },
    "market-index": {
        path: "meta.indexes.proname",
        category: "others",
        text_align: "left",
        filter_type: "select",
        data_multiple: true,
        innerArrayIndex: "name",
        max_selected: 5,
        searchable: true,
        assets: [ "stock", "dr", "fund" ],
        load_options_api: {
            endpoint: "forex/search",
            params: {
                merge: "profile",
                per_page: 200,
                type: "indices"
            },
            dynamic_params: {
                country: "country"
            },
            response_path: "response",
            label_key: "profile.name",
            value_key: "ticker",
            icon_key: "profile.self_logo",
            icon_base_path: "",
            filter_condition: {
                key: "profile.stocks_count",
                operator: ">",
                value: 0
            }
        }
    },
    "blockchain-network": {
        path: "meta.blockchain_name",
        category: "others",
        filter_type: "select",
        load_options: MARKET_SELECT_OPTIONS.blockchain_networks,
        assets: [ "dex" ],
        text_align: "left"
    }
};

export function getMetrics() {
    const translatedMetrics = {};
    for (const [key, config] of Object.entries(METRICS)) {
        const metricKey = key;
        const originalLoadOptions = config.load_options;
        translatedMetrics[key] = {
            ...config,
            key: metricKey,
            get label() {
                return getMetricLang(metricKey, "label");
            },
            get tooltip() {
                return getMetricLang(metricKey, "tooltip");
            },
            get load_options() {
                if (typeof originalLoadOptions === "string") {
                    return originalLoadOptions;
                }
                if (originalLoadOptions) {
                    if (metricKey === "type") {
                        return MARKET_SELECT_OPTIONS.typeStock;
                    }
                    if (metricKey === "volatility-level" || metricKey === "daily-volatility") {
                        return MARKET_SELECT_OPTIONS.volatilityLevel;
                    }
                    if (metricKey === "candle-type") {
                        return MARKET_SELECT_OPTIONS.candleType;
                    }
                    if (metricKey === "candle-pattern") {
                        return MARKET_SELECT_OPTIONS.priceActionPattern;
                    }
                    if (metricKey === "signal-summary") {
                        return MARKET_SELECT_OPTIONS.signal;
                    }
                    if (metricKey === "signal-trend") {
                        return MARKET_SELECT_OPTIONS.trend;
                    }
                    if (metricKey === "coins-category") {
                        return MARKET_SELECT_OPTIONS.coinsCategory;
                    }
                    if (metricKey === "blockchain-network") {
                        return MARKET_SELECT_OPTIONS.blockchain_networks;
                    }
                    if (metricKey.includes("signal") && metricKey !== "signal-summary" && metricKey !== "signal-trend" && metricKey !== "signal-confidence") {
                        return MARKET_SELECT_OPTIONS.signalWithoutWeek;
                    }
                }
                return originalLoadOptions;
            }
        };
    }
    return translatedMetrics;
}

export function getMetric(metricKey) {
    const config = METRICS[metricKey];
    if (!config) return null;
    return {
        ...config,
        key: metricKey,
        get label() {
            return getMetricLang(metricKey, "label");
        },
        get tooltip() {
            return getMetricLang(metricKey, "tooltip");
        }
    };
}