"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MobileNotificationListWrapper = exports.PriorityFeatureWrapper = exports.HeaderContent = exports.ExitButton = exports.ProfileWrapper = exports.ProductSwitcherWrapper = exports.HeaderContentSection = exports.HeaderSection = exports.MobileSidebarTogglerWrapper = exports.HeaderRoot = void 0;
const Button_1 = require("@mui/material/Button");
const DashboardLayoutNotificationList_1 = require("../../DashboardLayoutNotificationList");
const constants_1 = require("../../DashboardSidebar/constants");
const IconButton_1 = require("../../IconButton");
const constants_2 = require("../../MenuOrganization/constants");
const constants_3 = require("../../MenuOrganization/OrganizationButton/constants");
const constants_4 = require("../../Profile/constants");
const styled_1 = require("../../styled");
const constants_5 = require("../constants");
const constants_6 = require("./constants");
exports.HeaderRoot = (0, styled_1.styled)('header', {
    shouldForwardProp: (prop) => !['$isFocusedMode'].includes(prop),
}) `
  z-index: ${({ theme }) => theme.zIndex.appBar};

  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  height: ${constants_5.HEADER_HEIGHT_DESKTOP};
  margin-top: ${({ $isFocusedMode }) => $isFocusedMode ? `-${constants_5.HEADER_HEIGHT_DESKTOP}` : 0};
  margin-bottom: ${({ theme }) => theme.spacing(4)};

  transition: ${({ theme }) => {
    return theme.transitions.create(['margin-top'], {
        duration: theme.transitions.duration.complex,
    });
}};

  ${({ theme }) => theme.breakpoints.down('laptop')} {
    height: ${constants_5.HEADER_HEIGHT_LAPTOP};
  }

  ${({ theme }) => theme.breakpoints.down('sm')} {
    grid-row: 2;
    justify-content: flex-start;

    height: ${constants_5.HEADER_HEIGHT_MOBILE};
    margin-bottom: 0;
    padding: ${({ theme }) => theme.spacing(0, 2, 0, 1)};

    background-color: ${({ theme }) => theme.palette.background.default};
    border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};

    transition: unset;
  }
`;
exports.MobileSidebarTogglerWrapper = styled_1.styled.div `
  ${({ theme }) => theme.breakpoints.up('sm')} {
    display: none;
  }
  
  .${Button_1.buttonClasses.root} {
    padding: ${({ theme }) => theme.spacing(2)};
  }
  
  /* Причина игнора: Не критично для отображения */
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
  .${constants_5.dashboardLayoutClassnames.root}:not(:has(.${constants_1.dashboardSidebarClassnames.root}))
    & {
    display: none;
  }
`;
exports.HeaderSection = styled_1.styled.div `
  display: flex;
  gap: ${({ theme }) => theme.spacing(1)};
  align-items: center;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    flex-grow: 1;
  }
`;
exports.HeaderContentSection = (0, styled_1.styled)(exports.HeaderSection) `
  gap: ${({ theme }) => theme.spacing(6)};
  justify-content: flex-end;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    gap: ${({ theme }) => theme.spacing(2)};

    &.${constants_6.dashboardLayoutHeaderClassnames.priorityFeatureMenuOrg} {
      & .${constants_2.menuOrganizationClassnames.organizationData} {
        display: none;
      }
      & .${constants_2.menuOrganizationClassnames.button} {
        border-radius: ${({ theme }) => theme.shape.medium};
      }
    }
  }
`;
exports.ProductSwitcherWrapper = styled_1.styled.div `
  ${({ theme }) => theme.breakpoints.down('sm')} {
    display: none;
  }
`;
exports.ProfileWrapper = (0, styled_1.styled)('div', {
    shouldForwardProp: (prop) => !['$isShow'].includes(prop),
}) `
  display: contents;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    display: ${({ $isShow }) => ($isShow ? 'block' : 'none')};
  }
`;
exports.ExitButton = (0, styled_1.styled)(IconButton_1.IconButton, {
    shouldForwardProp: (prop) => !['$isShow'].includes(prop),
}) `
  display: none;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    display: ${({ $isShow }) => (!$isShow ? 'none' : 'flex')};
  }
`;
exports.HeaderContent = styled_1.styled.div `
  display: flex;
  flex-grow: 1;
  justify-content: space-between;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    padding: 0;
  }
`;
/**
 * Обертка для элементов которые должны быть в мобильном хедере или помещены в sidebar.
 */
exports.PriorityFeatureWrapper = styled_1.styled.div `
  ${({ theme }) => theme.breakpoints.down('sm')} {
    &.${constants_6.dashboardLayoutHeaderClassnames.featureInSidebar} {
      position: absolute;
      z-index: ${({ theme }) => theme.zIndex.appBar - 1};
      top: calc(var(--alert-height, 0px) + ${constants_5.HEADER_HEIGHT_MOBILE});
      left: 0;
      
      /* Необходимо для анимации компонента вместе с sidebar */
      transform: translateX(-100vw);

      display: flex;
      flex-direction: row;
      align-items: center;

      width: 100vw;

      background-color: ${({ theme }) => theme.palette.background.default};

      transition: ${({ theme }) => {
    return theme.transitions.create(['transform'], {
        duration: theme.transitions.duration.standard,
    });
}};

      &.${constants_6.dashboardLayoutHeaderClassnames.mobileSidebarPriorityFeatureVisible} {
        transform: translateX(0);
      }

      & .${constants_2.menuOrganizationClassnames.button}, & .${constants_4.profileClassnames.button} {
        height: ${constants_3.MOBILE_BUTTON_HEIGHT};
        padding: ${({ theme }) => theme.spacing(3, 4)};

        border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};

        &:hover {
          border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
        }

        &:active {
          border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
        }
      }

      &.${constants_6.dashboardLayoutHeaderClassnames.hasNotificationList} {
        gap: ${({ theme }) => theme.spacing(4)};

        height: ${constants_3.MOBILE_BUTTON_HEIGHT};
        padding: ${({ theme }) => theme.spacing(2, 3)};

        border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};

        & .${constants_2.menuOrganizationClassnames.button}, & .${constants_4.profileClassnames.button} {
          flex-grow: 1;

          height: unset;
          padding: unset;

          border-bottom: none;
        }
      }

      &.${constants_6.dashboardLayoutHeaderClassnames.priorityFeatureMenuOrg} {
        & .${constants_6.dashboardLayoutHeaderClassnames.profile} {
          display: block;
          flex-grow: 1;
        }


        & .${constants_4.profileClassnames.button} {
          width: 100%;
          max-width: unset;

          border-radius: 0;
        }

        & .${constants_4.profileClassnames.avatar} {
          display: none;
        }

        & .${constants_4.profileClassnames.user} {
          display: flex;
          align-items: center;
          justify-content: space-between;

          width: 100%;
        }
      }
    }
  }
`;
exports.MobileNotificationListWrapper = styled_1.styled.div `
  display: none;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    display: block;
    
    & .${DashboardLayoutNotificationList_1.dashboardLayoutNotificationListClassnames.root} {
      display: block;
    }
  }
`;
