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 { Component, Element, Prop, Event, State, Watch, h, Host } from '@stencil/core';
import { sanitizeVegaComponent } from '../../utils/component';
import { VegaTabGroupRenderer } from './slimmers/vega-tab-group/renderers/vega-tab-group-renderer';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, slotPlaceholder, } from 'vega-slimmer/core';
import { VegaTabGroupSelectedTargetController } from './slimmers/vega-tab-group/controllers/vega-tab-group-selected-target-controller';
import { VegaTabGroupPagesController } from './slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller';
import { VegaTabGroupPageIndexController } from './slimmers/vega-tab-group/controllers/vega-tab-group-page-index-controller';
import { VegaTabGroupCloseButtonRenderer } from './slimmers/vega-tab-group/renderers/vega-tab-group-close-button-renderer';
import { VegaTabGroupSwitchPageButtonRenderer } from './slimmers/vega-tab-group/renderers/vega-tab-group-direction-button-renderer';
import { VegaTabGroupPanelController } from './slimmers/vega-tab-group/controllers/vega-tab-group-panel-controller';
import { VegaTabGroupTabListRenderer } from './slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer';
import { VegaTabGroupContentRenderer } from './slimmers/vega-tab-group/renderers/vega-tab-group-content-renderer';
import { VegaTabGroupSliderStateController } from './slimmers/vega-tab-group/controllers/vega-tab-group-slider-state-controller';
import { ChildNodesEventPreventSlimmer } from '../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaClick } from '../../helpers/event-manager/event-id/vega-event-id';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
import { VegaTabGroupRuntimeMetricsPayloadDefinition } from '../../constants/runtime-metrics-payload-definition/vega-tab-group/runtime-metrics-payload-definition';
/**
 * @vegaVersion 1.0.6
 */
export class VegaTabGroup {
  constructor() {
    this.globalSlimmers = {};
    this.vegaTabGroupRenderer = new VegaTabGroupRenderer();
    this.vegaTabGroupDirectionButtonRenderer = new VegaTabGroupSwitchPageButtonRenderer();
    this.vegaTabGroupTabListRenderer = new VegaTabGroupTabListRenderer();
    this.vegaTabGroupCloseButtonRenderer = new VegaTabGroupCloseButtonRenderer();
    this.vegaTabGroupPagesController = new VegaTabGroupPagesController();
    this.vegaTabGroupSelectedTargetController = new VegaTabGroupSelectedTargetController();
    this.vegaTabGroupPageIndexController = new VegaTabGroupPageIndexController();
    this.vegaTabGroupPanelController = new VegaTabGroupPanelController();
    this.vegaTabGroupContentRenderer = new VegaTabGroupContentRenderer();
    this.vegaTabGroupSliderStateController = new VegaTabGroupSliderStateController();
    this.clickEventEmitter = createEventEmitSlimmer(VegaTabGroup, VegaClick);
    this.dropdownEventPrevent = new ChildNodesEventPreventSlimmer([VegaClick], () => this.vegaTabGroupRenderer.getTabMenuContainer());
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaTabGroupRuntimeMetricsPayloadDefinition);
    this.tabPages = [];
    /* Record the initial value of the tab width */
    this.tabWidthArray = [];
    this.currentPageIndex = 0;
    /**
     * Defines the data target for the selected tab
     *    within the tab group.
     *
     * @vegaVersion 1.3.0
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.selectedTabDataTarget = '';
    /**
     * Defines the spacing between the tabs in
     *    the tab group.
     *
     * @vegaVersion 1.3.0
     */
    this.gap = 'size-8';
    /**
     * Specifies whether the tabs in the tab group include
     *    a close button for closing the tab.
     *
     * @vegaVersion 1.3.0
     */
    this.showCloseButton = false;
    /**
     * Defines the tab items that appear within the tab group.
     *
     * The `tabItems` property can only be set once during
     *    initialization and cannot be overridden or
     *    modified dynamically.
     *
     * @vegaVersion 1.3.0
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.tabItems = [];
    /**
     * Specifies the visual style and prominence of the tab group.
     *
     * @vegaVersion 1.39.0
     */
    this.variant = 'primary';
    /**
     * Specifies the overflow navigation for many tab items within the tab group.
     *
     * @vegaVersion 2.49.0
     */
    this.overflow = 'menu';
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-tab-group-with-tabPages-change}
   */
  /* istanbul ignore next */
  watchTabPagesChange() {
    methodPlaceholder();
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-tab-group-with-right-button}
   * @see{module:vega-tab-group-close-tab-with-more-tab}
   */
  /* istanbul ignore next */
  watchTabWidthArrayChange() {
    methodPlaceholder();
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-tab-group-with-right-button}
   */
  /* istanbul ignore next */
  async watchCurrentPageIndexChange(newIndex) {
    methodPlaceholder(newIndex);
  }
  watchSelectedTabDataTargetChange() {
    methodPlaceholder();
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-tab-group-with-gap-change}
   */
  /* istanbul ignore next */
  watchGapChange() {
    methodPlaceholder();
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-tab-group-watch-tab-items-on-change}
   */
  /* istanbul ignore next */
  watchTabItemsChange() {
    methodPlaceholder();
  }
  /**
   * Call the pager to return a two-dimensional array of page numbers.
   */
  componentDidLoad() {
    methodPlaceholder();
  }
  componentDidRender() {
    methodPlaceholder();
  }
  render() {
    slotPlaceholder(h("slot", null));
    return sanitizeVegaComponent(h(Host, null, this.vegaTabGroupRenderer.render()), this.host);
  }
  static get is() { return "vega-tab-group"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-tab-group.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-tab-group.css"]
  }; }
  static get properties() { return {
    "selectedTabDataTarget": {
      "type": "string",
      "mutable": true,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Defines the data target for the selected tab\n   within the tab group."
      },
      "attribute": "selected-tab-data-target",
      "reflect": false,
      "defaultValue": "''"
    },
    "gap": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "SpacingTokenType",
        "resolved": "\"0\" | \"size-112\" | \"size-12\" | \"size-16\" | \"size-2\" | \"size-20\" | \"size-24\" | \"size-32\" | \"size-4\" | \"size-40\" | \"size-48\" | \"size-64\" | \"size-72\" | \"size-8\" | \"size-80\"",
        "references": {
          "SpacingTokenType": {
            "location": "import",
            "path": "../../types/design-token.type"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Defines the spacing between the tabs in\n   the tab group."
      },
      "attribute": "gap",
      "reflect": false,
      "defaultValue": "'size-8'"
    },
    "showCloseButton": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies whether the tabs in the tab group include\n   a close button for closing the tab."
      },
      "attribute": "show-close-button",
      "reflect": false,
      "defaultValue": "false"
    },
    "tabItems": {
      "type": "unknown",
      "mutable": true,
      "complexType": {
        "original": "TabConfig[]",
        "resolved": "TabConfig[]",
        "references": {
          "TabConfig": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Defines the tab items that appear within the tab group.\n\nThe `tabItems` property can only be set once during\n   initialization and cannot be overridden or\n   modified dynamically."
      },
      "defaultValue": "[]"
    },
    "positionRelativeTo": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "VegaWarning",
            "text": "The value of this property should be an element that is\nthe parent of this component or an ancestor of the parent element.\nUsing any other element may lead to unexpected behavior."
          }, {
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Defines the selector of the element that will contain\n   the tab group popup.\n\n- If provided,\n     the popup will be positioned relative to this element.\n- If not provided,\n     the popup will be appended to the body element by default."
      },
      "attribute": "position-relative-to",
      "reflect": false
    },
    "variant": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "TabGroupVariant",
        "resolved": "\"primary\" | \"secondary\"",
        "references": {
          "TabGroupVariant": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.39.0"
          }],
        "text": "Specifies the visual style and prominence of the tab group."
      },
      "attribute": "variant",
      "reflect": false,
      "defaultValue": "'primary'"
    },
    "overflow": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "TabGroupOverflowType",
        "resolved": "\"menu\" | \"scroll\"",
        "references": {
          "TabGroupOverflowType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.49.0"
          }],
        "text": "Specifies the overflow navigation for many tab items within the tab group."
      },
      "attribute": "overflow",
      "reflect": false,
      "defaultValue": "'menu'"
    }
  }; }
  static get states() { return {
    "tabPages": {},
    "tabWidthArray": {},
    "currentPageIndex": {}
  }; }
  static get events() { return [{
      "method": "vegaClick",
      "name": "vegaClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.1.0"
          }],
        "text": "An event emitter notifying the click event of a tab\n   in the tab group."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }, {
      "method": "click",
      "name": "click",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying the click event of a tab\n   in the tab group."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }]; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "tabPages",
      "methodName": "watchTabPagesChange"
    }, {
      "propName": "tabWidthArray",
      "methodName": "watchTabWidthArrayChange"
    }, {
      "propName": "currentPageIndex",
      "methodName": "watchCurrentPageIndexChange"
    }, {
      "propName": "selectedTabDataTarget",
      "methodName": "watchSelectedTabDataTargetChange"
    }, {
      "propName": "gap",
      "methodName": "watchGapChange"
    }, {
      "propName": "tabItems",
      "methodName": "watchTabItemsChange"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaTabGroup.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupDirectionButtonRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupTabListRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupCloseButtonRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupPagesController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupSelectedTargetController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupPageIndexController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupPanelController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupContentRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaTabGroupSliderStateController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "clickEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "dropdownEventPrevent", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTabGroup.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
