"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Content = exports.Wrapper = void 0;
const constants_1 = require("../CardGridInfinite/constants");
const PdfViewer_1 = require("../PdfViewer");
const styled_1 = require("../styled");
const constants_2 = require("./constants");
const getPaddingContent = (theme, hasAside) => {
    return hasAside ? theme.spacing(4, 6, 4) : theme.spacing(0, 6, 4);
};
exports.Wrapper = (0, styled_1.styled)('article', {
    shouldForwardProp: (prop) => !['$isFullHeight', '$isSeparatorShown'].includes(prop),
}) `
  scroll-behavior: smooth;
  scrollbar-gutter: unset;

  overflow: hidden;
  display: flex;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;

  border-top: ${({ $isSeparatorShown, theme }) => $isSeparatorShown
    ? `1px solid ${theme.palette.components.border.default}`
    : 'none'};

  ${({ theme }) => theme.breakpoints.down('sm')} {
    overflow: unset;
    flex-grow: 1;
    order: 4;

    height: ${({ $isFullHeight }) => ($isFullHeight ? 'auto' : '100%')};

    border-top: none;
  }

  @keyframes ${constants_2.PAGE_CONTENT_ANIMATION} {
    0% {
      display: none;

      opacity: 0;
    }

    50% {
      display: none;

      opacity: 0;
    }

    100% {
      opacity: 1;
    }
  }

  &.${constants_2.pageContentClassnames.animation} > * {
    animation: ${({ theme }) => `${constants_2.PAGE_CONTENT_ANIMATION} ${theme.transitions.duration.complex * 2}ms`};
  }
`;
exports.Content = styled_1.styled.div `
  scroll-behavior: smooth;
  scrollbar-gutter: stable;

  overflow: auto;
  flex-grow: 1;

  padding: ${({ theme, $hasAside }) => getPaddingContent(theme, $hasAside)};

  ${({ theme }) => theme.breakpoints.down('laptop')} {
    padding-right: ${({ theme }) => theme.spacing(4)};
    padding-bottom: ${({ theme }) => theme.spacing(3)};
    padding-left: ${({ theme }) => theme.spacing(4)};
  }

  ${({ theme }) => theme.breakpoints.down('sm')} {
    scrollbar-gutter: unset;

    overflow: hidden;

    margin: ${({ theme }) => theme.spacing(0, 4, 4)};
    padding: ${({ theme }) => theme.spacing(4, 4, 3)};

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

    /* Причина игнора: Не критично для отображения */
    /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
    &:has(.${constants_1.cardGridClassnames.root}) {
      border: none;
    }

    &.${constants_2.pageContentClassnames.contentHasHeader} {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }
  }

  /* Причина игнора: Не критично для отображения */
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
  &:has(.${PdfViewer_1.pdfViewerClassnames.document}.${PdfViewer_1.pdfViewerClassnames.zoom}) {
    scroll-behavior: auto;
    scrollbar-gutter: auto;

    overflow: auto;

    padding-right: 0;

    ${({ theme }) => theme.breakpoints.down('sm')} {
      scrollbar-gutter: auto;

      padding: ${({ theme }) => theme.spacing(4, 4, 3)};
    }
  }

  ${({ theme }) => theme.breakpoints.down('sm')} {
    &&.${constants_2.pageContentClassnames.withPdfViewer} {
      margin: 0;
      padding-top: 0;
      padding-right: 0;
      padding-left: 0;

      background-color: ${({ theme }) => theme.palette.background.body};
      border: unset;
      border-radius: 0;
    }
  }
`;
