import {
  CubeAnalyticsBackend
} from "./chunk-7B3RYX45.js";
import {
  ANALYTICS_QUERY,
  CUBE_API_SECRET,
  CUBE_API_URL
} from "./chunk-6I7ULIN6.js";
import {
  NoopAnalyticsBackend
} from "./chunk-J37YWU7Y.js";
import {
  __decorateClass
} from "./chunk-2E224ZSN.js";

// runtime/subsystems/analytics/analytics.module.ts
import { Module } from "@nestjs/common";
var AnalyticsModule = class {
  static forRoot(options = { backend: "noop" }) {
    if (options.backend === "cube") {
      return {
        module: AnalyticsModule,
        global: true,
        providers: [
          {
            provide: CUBE_API_URL,
            useValue: process.env["CUBE_API_URL"] ?? "http://localhost:4000/cubejs-api/v1"
          },
          {
            provide: CUBE_API_SECRET,
            useValue: process.env["CUBE_API_SECRET"] ?? ""
          },
          { provide: ANALYTICS_QUERY, useClass: CubeAnalyticsBackend }
        ],
        exports: [ANALYTICS_QUERY]
      };
    }
    return {
      module: AnalyticsModule,
      global: true,
      providers: [{ provide: ANALYTICS_QUERY, useClass: NoopAnalyticsBackend }],
      exports: [ANALYTICS_QUERY]
    };
  }
};
AnalyticsModule = __decorateClass([
  Module({})
], AnalyticsModule);

export {
  AnalyticsModule
};
//# sourceMappingURL=chunk-CZQUOIDY.js.map