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 { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
export class VegaLeftNavGroupOpenStateController extends VegaSlimmer {
  /**
   * Checks if the left nav group is currently open.
   * This method checks if the 'open' class is present in the group container.
   *
   * @returns {boolean} - Returns true if the group is open, false otherwise.
   */
  isOpen() {
    return this.renderer.getGroupContainer().classList.contains('open');
  }
  /**
   * Opens the left nav group.
   * This method adds the 'open' class to the group container.
   */
  open() {
    this.renderer.getGroupContainer().classList.add('open');
  }
  /**
   * Closes the left nav group.
   * This method removes the 'open' class from the group container.
   */
  close() {
    this.renderer.getGroupContainer().classList.remove('open');
  }
  /**
   * Toggle the left nav group.
   * This method toggle the 'open' class from the group container.
   */
  toggle() {
    if (this.isOpen()) {
      this.close();
    }
    else {
      this.open();
    }
  }
}
__decorate([
  MapToComponentField()
], VegaLeftNavGroupOpenStateController.prototype, "renderer", void 0);
