"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTrackingProviders = void 0;
const trackingProviderProxy_1 = __importDefault(require("./trackingProviderProxy"));
const console_tracking_provider_1 = require("./console_tracking_provider");
const segment_tracking_provider_1 = require("./segment_tracking_provider");
const posthog_tracking_provider_1 = require("./posthog_tracking_provider");
const umami_tracking_provider_1 = require("./umami_tracking_provider");
const getTrackingProviders = (initProps) => {
    const providers = [];
    providers.push(new segment_tracking_provider_1.SegmentTrackingProvider());
    providers.push(new posthog_tracking_provider_1.PosthogTrackingProvider());
    providers.push(new umami_tracking_provider_1.UmamiTrackingProvider());
    // TODO dynamically find and register providers
    // Initialize them
    const enabledProviders = [];
    for (const provider of providers) {
        const key = provider.getKey();
        if (Object.keys(initProps).indexOf(key) > -1) {
            provider.initialize(initProps);
            enabledProviders.push(provider);
        }
    }
    // Add the console provider
    const consoleTrackingProvider = new console_tracking_provider_1.ConsoleTrackingProvider();
    enabledProviders.push(consoleTrackingProvider); // TODO noop- provider?
    return new trackingProviderProxy_1.default(enabledProviders);
};
exports.getTrackingProviders = getTrackingProviders;
exports.default = exports.getTrackingProviders;
