"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkKU2ZI6TIcjs = require('./chunk-KU2ZI6TI.cjs');


var _chunkTXDLUYVGcjs = require('./chunk-TXDLUYVG.cjs');




var _chunkMFKERIW4cjs = require('./chunk-MFKERIW4.cjs');


var _chunkZU72XWNEcjs = require('./chunk-ZU72XWNE.cjs');







var _chunkRSHN4K6Ncjs = require('./chunk-RSHN4K6N.cjs');


var _chunkOBHJBBPCcjs = require('./chunk-OBHJBBPC.cjs');



var _chunkKW3JYLRIcjs = require('./chunk-KW3JYLRI.cjs');

// src/components/CardPage.tsx
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _react = require('react');
var _jsxruntime = require('@emotion/react/jsx-runtime');
function CardPage(props) {
  const initiallyExpanded = _react.useRef.call(void 0, Boolean(props.expandRight));
  const [wasExpanded, setWasExpanded] = _react.useState.call(void 0, Boolean(props.expandRight));
  const bp2 = _chunkKW3JYLRIcjs.useBreakpoints.call(void 0, );
  const header = props.title ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardPageHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKU2ZI6TIcjs.Heading, { type: "h1", m0: true, children: props.title }) }) : null;
  _react.useEffect.call(void 0, () => {
    if (props.expandRight) {
      setWasExpanded(true);
    }
  }, [props.expandRight]);
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, 
    CardPageContainer,
    {
      id: props.id,
      bp: bp2,
      hasRightContent: Boolean(props.rightContent),
      wasExpanded,
      expandRight: Boolean(props.expandRight),
      minContentHeight: props.minContentHeight,
      initiallyExpanded: initiallyExpanded.current,
      children: [
        /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: props.minContentWidth ? _chunkMFKERIW4cjs.overflowAutoWithoutScrollbars : null, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, 
          CardPageContent,
          {
            hasPreHeaderContent: Boolean(props.preHeaderContent),
            minContentHeight: props.minContentHeight,
            maxContentWidth: props.maxContentWidth,
            children: [
              props.preHeaderContent,
              header,
              props.children
            ]
          }
        ) }),
        props.rightContent && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardPageRightContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
          CardPageRightContentInner,
          {
            hasRightContent: Boolean(props.rightContent),
            children: props.rightContent
          }
        ) })
      ]
    }
  ) });
}
CardPage.defaultProps = {
  minContentHeight: void 0,
  minContentWidth: void 0,
  maxContentWidth: void 0
};
var CardPageFullContent = _styled2.default.div``;
var CardPageFullWidth = _styled2.default.div``;
var CardPageRightContentInner = _styled2.default.div`
  ${_chunkMFKERIW4cjs.flexCenter}
  height: 100%;
  padding: 150px 25px;
  ${({ hasRightContent }) => hasRightContent && `justify-content: space-evenly;`}
`;
var CardPageRightContent = _styled2.default.div`
  display: flex;
  position: relative;
  ${CardPageRightContentInner} {
    ${_chunkRSHN4K6Ncjs.darkGradientBg};
    position: relative;
    height: calc(100% + 80px);
    margin-top: -40px;
    margin-bottom: -40px;
    margin-right: -40px;
    overflow: hidden;
    width: 100%;

    ${_chunkKW3JYLRIcjs.bp.minSm(`
      ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, [0, _chunkRSHN4K6Ncjs.cardBorderRadiusPx, _chunkRSHN4K6Ncjs.cardBorderRadiusPx, 0])};
    `)}
  }
`;
var vCardPaddingPx = 40;
var expandTiming = `0.65s ease-in-out`;
var CardPageContainer = _styled2.default.div`
  ${_chunkRSHN4K6Ncjs.standardContentInset.css}
  ${({ theme }) => _chunkOBHJBBPCcjs.themeOr.call(void 0, `background-color: ${theme.bg}`, "transparent")({ theme })};
  position: relative;
  z-index: ${_chunkZU72XWNEcjs.z.card};

  ${({ minContentHeight }) => `
    min-height: ${minContentHeight !== void 0 && minContentHeight !== null ? `${minContentHeight}px` : "250px"};
  `}

  ${_chunkKW3JYLRIcjs.bp.sm(`
    width: 100% !important;
  `)}

  & > * {
    ${_chunkRSHN4K6Ncjs.standardContentInset.css}
  }

  & ${CardPageFullContent}, & ${CardPageFullWidth} {
    ${_chunkKW3JYLRIcjs.bp.sm(`
      width: calc(100% + ${_chunkRSHN4K6Ncjs.standardContentInset.smPx * 2}px);
      margin-left: -${_chunkRSHN4K6Ncjs.standardContentInset.smPx}px;
    `)}

    ${_chunkKW3JYLRIcjs.bp.minSmMaxLg(`
      width: calc(100% + ${_chunkRSHN4K6Ncjs.standardContentInset.minSmMaxLgPx * 2}px);
      margin-left: -${_chunkRSHN4K6Ncjs.standardContentInset.minSmMaxLgPx}px;
    `)}

    ${_chunkKW3JYLRIcjs.bp.lg(`
      width: calc(100% + ${_chunkRSHN4K6Ncjs.standardContentInset.lgPx * 2}px);
      margin-left: -${_chunkRSHN4K6Ncjs.standardContentInset.lgPx}px;
    `)}
  }

  & ${CardPageFullContent} {
    & > * {
      padding-top: ${vCardPaddingPx}px;
      padding-bottom: ${vCardPaddingPx}px;
      ${_chunkKW3JYLRIcjs.bp.sm(`
        padding-top: 0;
        padding-bottom: 0;
      `)}
    }

    margin-top: -${vCardPaddingPx}px;
    ${_chunkKW3JYLRIcjs.bp.sm(`margin-top: 0;`)}
  }

  ${_chunkKW3JYLRIcjs.bp.minSm(`
    ${_chunkRSHN4K6Ncjs.standardCardShadow.styles};
    padding: ${vCardPaddingPx}px 0;
    ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, _chunkRSHN4K6Ncjs.cardBorderRadiusPx)}
  `)}

  &:not(:last-child) {
    margin-bottom: 30px;
  }

  @keyframes rightSideExpand {
    0% {
      width: 50%;
    }
    100% {
      width: 100%;
    }
  }

  @keyframes rightSideCollapse {
    0% {
      width: 100%;
    }
    100% {
      width: 50%;
    }
  }

  @keyframes leftSideCollapse {
    0% {
      width: 50%;
      height: auto;
      opacity: 1;
    }
    30% {
      opacity: 0;
    }
    100% {
      height: 0px;
      width: 0%;
    }
  }

  @keyframes leftSideExpand {
    0% {
      width: 0%;
      opacity: 0;
    }
    50% {
      opacity: 0;
    }
    100% {
      width: 50%;
      opacity: 1;
    }
  }

  ${({ hasRightContent }) => hasRightContent && `
    display: flex;
    & > * {
      width: 50%;
      ${_chunkKW3JYLRIcjs.bp.sm(`width: 100%;`)}

      &:first-of-type > * {
        ${_chunkKW3JYLRIcjs.bp.minSmMaxLg(`
          width: calc(100% - ${_chunkRSHN4K6Ncjs.standardContentInset.minSmMaxLgPx * 2}px);
          margin-left: ${_chunkRSHN4K6Ncjs.standardContentInset.minSmMaxLgPx}px;
        `)}
        ${_chunkKW3JYLRIcjs.bp.lg(`
          width: calc(100% - ${_chunkRSHN4K6Ncjs.standardContentInset.lgPx * 3}px);
          margin-left: ${_chunkRSHN4K6Ncjs.standardContentInset.lgPx}px;
        `)}
      }
    }
  `}

  & > :not(${CardPageRightContent}) {
    ${({ expandRight, wasExpanded, initiallyExpanded }) => expandRight && wasExpanded ? _chunkKW3JYLRIcjs.bp.minSm(`
            width: 0%;
            height: 0px;
            ${initiallyExpanded ? "" : `animation: leftSideCollapse ${expandTiming};`}
            overflow: hidden;
            margin: 0%;
            opacity: 0;
          `) : wasExpanded ? _chunkKW3JYLRIcjs.bp.minSm(`
            width: 50%;
            animation: leftSideExpand ${expandTiming};
          `) : ""}
  }

  & > ${CardPageRightContent} {
    ${({ expandRight, wasExpanded, initiallyExpanded }) => expandRight && wasExpanded ? _chunkKW3JYLRIcjs.bp.minSm(`
            width: 100%;
            ${initiallyExpanded ? "" : `animation: rightSideExpand ${expandTiming};`}
            margin: 0%;
            & > ${CardPageRightContentInner.toString()} {
              border-radius: ${_chunkRSHN4K6Ncjs.cardBorderRadiusPx}px !important;
            }
          `) : wasExpanded ? _chunkKW3JYLRIcjs.bp.minSm(`
            width: 50%;
            animation: rightSideCollapse ${expandTiming};
          `) : ""}
  }
`;
var CardPageSubtitle = _styled2.default.p`
  color: ${({ theme }) => theme.mcNeutral};
  font-size: ${_chunkMFKERIW4cjs.size.px14};
  line-height: ${_chunkMFKERIW4cjs.size.px18};
  font-weight: 600;
  margin: 0;
`;
var CardPageHeader = _styled2.default.div`
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  position: relative;

  & + *:not(${CardPageSubtitle}):not(${_chunkTXDLUYVGcjs.StyledButtonRow}) {
    margin-top: ${_chunkRSHN4K6Ncjs.headingContentMarginPx}px !important;
  }

  & + ${CardPageSubtitle} {
    margin-top: 5px;
  }

  & + ${_chunkTXDLUYVGcjs.StyledButtonRow} {
    margin-top: 16px;
  }
`;
var CardPageContent = _styled2.default.div`
  ${({
  maxContentWidth,
  minContentHeight,
  minContentWidth,
  hasPreHeaderContent
}) => `
    max-width: ${maxContentWidth ? `${maxContentWidth}px` : "initial"};
    min-width: ${minContentWidth ? `${minContentWidth}px` : "initial"};
    ${CardPageHeader.toString()} {
      margin-top: ${hasPreHeaderContent ? "25px" : "0"};
    }
    min-height: ${minContentHeight !== void 0 && minContentHeight !== null ? `${minContentHeight}px` : "400px"};
  `}
`;








exports.CardPage = CardPage; exports.CardPageFullContent = CardPageFullContent; exports.CardPageFullWidth = CardPageFullWidth; exports.CardPageRightContentInner = CardPageRightContentInner; exports.CardPageSubtitle = CardPageSubtitle; exports.CardPageContent = CardPageContent;
