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 { h, Host } from '@stencil/core';
import { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
import { DomNodeSubjectObserverFactory } from '../../../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-observer-factory';
import { VegaClick } from '../../../../../helpers/event-manager/event-id/vega-event-id';
export class VegaLeftNavSectionRenderer extends VegaSlimmer {
  render() {
    return (h(Host, { "data-key": this.itemKey },
      this.renderSectionHeader(),
      h("slot", null),
      this.renderListSeparator()));
  }
  renderListSeparator() {
    return (h("div", { class: "list-separator-container" },
      h("div", { class: "list-separator" })));
  }
  renderSectionHeader() {
    var _a;
    return (((_a = this.sectionHeader) === null || _a === void 0 ? void 0 : _a.title) && (h("div", { class: "section-header" },
      h("div", { class: "section-header-title" }, this.sectionHeader.title),
      this.sectionHeader.actionTitle && (h("vega-button-link", { label: this.sectionHeader.actionTitle, size: "small", link: this.sectionHeader.actionLink, eventful: this.sectionHeader.actionEventful, 
        /* eslint-disable-next-line react/jsx-no-bind */
        ref: (ref) => {
          DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
            this.actionClickEventEmitter.emit();
          });
        } })))));
  }
}
__decorate([
  MapToComponentField()
], VegaLeftNavSectionRenderer.prototype, "sectionHeader", void 0);
__decorate([
  MapToComponentField()
], VegaLeftNavSectionRenderer.prototype, "actionClickEventEmitter", void 0);
__decorate([
  MapToComponentField()
], VegaLeftNavSectionRenderer.prototype, "itemKey", void 0);
