import AComponent from '../a.js';
import Component from '../component.js';
import DivComponent from '../div.js';
import CoEuiBadge from './eui-badge.js';
import CoEuiButton from './eui-button.js';
import CoEuiDropdownContent from './eui-dropdown-content.js';
import CoEuiDropdown from './eui-dropdown.js';
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiInputCheckbox from './eui-input-checkbox.js';
import CoEuiLabel from './eui-label.js';
import CoEuiTreeNodeMetacontent from './eui-tree-node-metacontent.js';
import CoEuiTreeNodeMetadataContainerButton from './eui-tree-node-metadata-container-button.js';
import CoEuiTreeNodeWrapperContainerLeftChip from './eui-tree-node-wrapper-container-left-chip.js';
import CoEuiTreeNodeWrapperContainerRightBadge from './eui-tree-node-wrapper-container-right-badge.js';
import CoEuiTreeNodeWrapperContainerRightChip from './eui-tree-node-wrapper-container-right-chip.js';


export default class CoEuiTreeNodeTemplate extends Component {

  constructor(parent) {
    //let selector = '';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-tree/eui-tree.component.html?at=master
  }
  get containerLeftCO(){
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-tree-node-wrapper__container-left');
  }
  get containerLeftInputCO(){
    return new CoEuiInputCheckbox(this.containerLeftCO);
  }
  get containerLeftIconCO(){
    return new CoEuiIconSvg(this.containerLeftCO).addPredicateClassContains('eui-u-mr-xs');
  }
  async hasContainerLeftIconSvgName(){
    return await (await this.containerLeftIconCO.element()).isExisting();
  }
  get containerLeftChipCO(){
    return new CoEuiTreeNodeWrapperContainerLeftChip(this.containerLeftCO);
  }
  async hasContainerLeftChips(){
    return await (await this.containerLeftChipCO.element()).isExisting();
  }
  get containerLeftBadgeCO(){
    return new CoEuiBadge(this.containerLeftCO);
  }
  async hasContainerLeftBadge(){
    return await (await this.containerLeftBadgeCO.element()).isExisting();
  }
  get containerMiddleCO(){
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-tree-node-wrapper__container-middle');
  }
  get containerMiddleLabelCO(){
    return new CoEuiLabel(this.containerMiddleCO).addPredicateClassContains('eui-u-text-truncate');
  }
  get containerMiddleLinkCO(){
    return new AComponent(this.containerMiddleLabelCO).addSelectorPredicate('[contains(@class, "eui-u-text-link") and not(contains(@class, "external"))]');
  }
  get containerMiddleLinkExternalCO(){
    return new AComponent(this.containerMiddleLabelCO).addPredicateClassContains('eui-u-text-link-external');
  }
  async hasContainerMiddleNoLink(){
    return (await this.hasContainerMiddleLink() && await this.hasContainerMiddleLinkExternal);
  }
  async hasContainerMiddleLink(){
    return await ( await this.containerMiddleLinkCO.element()).isExisting();
  }
  async hasContainerMiddleLinkExternal(){
    return await ( await this.containerMiddleLinkExternalCO.element()).isExisting();
  }
  get containerRightCO(){
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-tree-node-wrapper__container-right');
  }
  get containerRightBagesCO(){
    return new CoEuiTreeNodeWrapperContainerRightBadge(this.containerRightCO);
  }
  get containerRightChipsCO(){
    return new CoEuiTreeNodeWrapperContainerRightChip(this.containerRightCO);
  }
  get containerRightDropdownCO(){
    return new CoEuiDropdown(this.containerRightCO).addPredicateClassContains('eui-u-ml-xs');
  }
  get containerRightBtnCO(){
    return new CoEuiButton(this.containerRightDropdownCO);
  }
  get containerRightBtnIconCO(){
    return new CoEuiIconSvg(this.containerRightBtnCO).addPredicateIconContains('ellipsis-vertical:sharp');
  }
  get containerRightDropdownContentCO(){
    return new CoEuiDropdownContent(this.containerRightDropdownCO);
  }
  get metadataBtnCO(){
    return new CoEuiTreeNodeMetadataContainerButton(this.currentPath);
  }
  get metadataContentCO(){
    return new CoEuiTreeNodeMetacontent(this.currentPath);
  }
}


