"use client";

// src/utils/funLogger.ts
import { FunLogger } from "@funkit/connect-core";

// src/utils/datadogBrowserLogsTransport.ts
import { datadogLogs } from "@datadog/browser-logs";
var DDOG_CLIENT_TOKEN = "pub4f86c6be8c792cb48dc156a8c17d9a47";
var DatadogBrowserLogsTransport = class {
  constructor() {
    datadogLogs.init({
      clientToken: DDOG_CLIENT_TOKEN,
      site: "datadoghq.com",
      forwardErrorsToLogs: false,
      sessionSampleRate: 100,
      service: "connect-sdk"
    });
  }
  setEnv(environment) {
    datadogLogs.setGlobalContextProperty("env", environment);
  }
  setTrackingConsent(consent) {
    datadogLogs.setTrackingConsent(consent);
  }
  log({ level, title, context, error }) {
    if (typeof window === "undefined") {
      return;
    }
    switch (level) {
      case "info":
        datadogLogs.logger.info(title, context);
        break;
      case "debug":
        datadogLogs.logger.debug(title, context);
        break;
      case "warn":
        datadogLogs.logger.warn(title, context);
        break;
      case "error":
        datadogLogs.logger.error(title, context, error);
        break;
    }
  }
};

// src/utils/funLogger.ts
var logger = new FunLogger(new DatadogBrowserLogsTransport());

export {
  logger
};
