import Component from '../component.js'
import DivComponent from '../div.js';
import SpanComponent from '../span.js';
import StrongComponent from '../strong.js';
import CoEuiAvatar from './eui-avatar.js';
import CoEuiAvatarText from './eui-avatar-text.js';
import CoEuiAvatarImage from './eui-avatar-image.js';
import CoEuiBadge from './eui-badge.js';
import CoEuiAvatarBadge from './eui-avatar-badge.js';
import CoEuiIconSvg from './eui-icon-svg.js';


export default class CoEuiUserProfileContent extends Component {
    constructor(parent) {
        let selector = 'button[contains(@class, "eui-user-profile-content")]';
        super(parent, selector);
        //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-user-profile/user-profile.component.html
    }
    get infosCO() {
        return new DivComponent(this.currentPath).addPredicateClassContains('eui-user-profile__infos');
    }
    async isShowUserInfos(){
        return await (await this.infosCO.element()).isExisting()
    }
    get impersonatedInfosWelcomeCO(){
        return new DivComponent(this.infosCO).addPredicateClassContains('eui-user-profile__infos-welcome');
    }
    async isImpersonatingUser(){
        return await (await this.impersonatedInfosWelcomeCO.element()).isExisting()
    }
    get impersonatedInfosWelcomeLabelCO() {
        return new SpanComponent(this.impersonatedInfosWelcomeCO).addPredicateClassContains('eui-u-mr-2xs');
    }
    async hasImpersonatedWelcomeLabel() {
        return await (await this.impersonatedInfosWelcomeLabelCO.element()).isExisting();
    }
    get impersonatedUserInfosCO() {
        return new StrongComponent(this.impersonatedInfosWelcomeCO);
    }
    get impersonatedLabelCO() {
        return new SpanComponent(this.impersonatedInfosWelcomeCO).addPredicateClassContains('eui-u-ml-2xs');
    }
    get impersonatedInfosNameCO() {
        return new DivComponent(this.infosCO).addPredicateClassContains('eui-user-profile__infos-name');
    }
    get impersonatedInfosLastNameCO(){
        return new StrongComponent(this.impersonatedInfosNameCO);
    }
    get impersonatedSubInfosCO() {
        return new DivComponent(this.infosCO).addPredicateClassContains("eui-user-profile__infos-subinfos");
    }
    async hasImpersonatedSubInfos(){
        return await (await this.impersonatedSubInfosCO.element()).isExisting()
    }
    get infosWelcomeCO() {
        return new DivComponent(this.infosCO).addPredicateClassContains('eui-user-profile__infos-welcome');
    }
    async hasWelcomeLabel(){
        return await (await this.infosWelcomeCO.element()).isExisting();
    }
    get infosNameCO() {
        return new DivComponent(this.infosCO).addPredicateClassContains('eui-user-profile__infos-welcome');
    }
    get subInfos() {
        return new DivComponent(this.infosCO).addPredicateClassContains('eui-user-profile__infos-subinfos');
    }
    async hasSubInfos(){
        return await (this.subInfos.element()).isExisting();
    }
    get avatarCO() {
        return new CoEuiAvatar(this.currentPath);
    }
    get avatarTextCO() {
        return new CoEuiAvatarText(this.avatarCO);
    }
    async isShowAvatarInitials() {
        return await (await this.avatarTextCO.element()).isExisting();
    }
    get avatarImageCO() {
        return new CoEuiAvatarImage(this.avatarCO);
    }
    get avatarBadgeCO() {
        return new CoEuiAvatarBadge(this.avatarCO);
    }
    async isStatusSecondarySuccessOrDanger(){
        return await (await this.avatarBadgeCO.element()).isExisting();
    }
    get badgeSuccessCO() {
        return new CoEuiBadge(this.avatarBadgeCO).addSelectorPredicate('[@euiSuccess]');
    }
    get badgeSuccessIconCO() {
        return new CoEuiIconSvg(this.badgeSuccessCO).addPredicateIconContains('checkmark');
    }
    async isSuccessStatus(){
        return await (await this.badgeSuccessCO.element()).isExisting()
    }
    get badgeDangerCO() {
        return new CoEuiBadge(this.avatarBadgeCO).addSelectorPredicate('[@euiDanger]');
    }
    get badgeDangerIconCO() {
        return new CoEuiIconSvg(this.badgeDangerCO).addPredicateIconContains('remove');
    }
    async isDangerStatus(){
        return await (await this.badgeDangerCO.element()).isExisting()
    }
    get badgeSecondaryCO() {
        return new CoEuiBadge(this.avatarBadgeCO).addSelectorPredicate('[@euiSecondary]');
    }
    get badgeSecondaryconCO() {
        return new CoEuiIconSvg(this.badgeSecondaryCO).addPredicateIconContains('close-circle');
    }
    async isSecondaryStatus(){
        return await (await this.badgeSecondaryCO.element()).isExisting()
    }
    get expandedUserProfileCO(){
        return new CoEuiIconSvg(this.currentPath).addPredicateIconContains('chevron-up');
    }
    async isDropdownOpen(){
        return await (await this.expandedUserProfileCO.element()).isExisting();
    }
    get expandUserProfileCO(){
        return new CoEuiIconSvg(this.currentPath).addPredicateIconContains('chevron-down');
    }
}

