var __decorate = (this && this.__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;
};
import { VegaInternalTranslation } from './internal-translation-controller';
import { InjectVegaTelemetrySlimmer } from 'vega-slimmer/core';
import { createPublicAPIRuntimeMetricsSlimmer } from '../slimmers/runtime-metrics/create-public-api-runtime-metrics-slimmer';
import { VegaTranslationRuntimeMetricsPayloadDefinition } from '../../constants/runtime-metrics-payload-definition/public-api/VegaTranslation/runtime-metrics-payload-definition';
/**
 * Vega Translation Public API
 *
 * @vegaVersion 2.27.0
 */
class TranslationController {
  constructor() {
    this.vegaPublicAPIRuntimeMetricsSlimmer = createPublicAPIRuntimeMetricsSlimmer(TranslationController, ['init', 'changeLanguage'], VegaTranslationRuntimeMetricsPayloadDefinition);
  }
  /**
   * Get current language
   *
   * @returns {string} current language
   * @vegaVersion 2.27.0
   */
  get currentLanguage() {
    return VegaInternalTranslation.currentLanguage;
  }
  /**
   * Initializes the translation controller with provided resources and language.
   *
   * @param {VegaTranslationConfig} config - Configuration object containing resources and initial language.
   * @vegaVersion 2.27.0
   */
  init(config) {
    VegaInternalTranslation.init(config);
  }
  /**
   * Changes the current language if it exists in the resources.
   *
   * @param {string} language - The language code to change to.
   * @vegaVersion 2.27.0
   */
  changeLanguage(language) {
    VegaInternalTranslation.changeLanguage(language);
  }
}
__decorate([
  InjectVegaTelemetrySlimmer()
], TranslationController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
export const VegaTranslation = new TranslationController();
