import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";

function _templateObject7() {
  var data = _taggedTemplateLiteral(["\n  height: 100%;\n  ", ";\n\n  .next-menu {\n    height: 100%;\n  }\n"]);

  _templateObject7 = function _templateObject7() {
    return data;
  };

  return data;
}

function _templateObject6() {
  var data = _taggedTemplateLiteral(["\n  position: absolute;\n  height: 12px;\n  top: -20px;\n"]);

  _templateObject6 = function _templateObject6() {
    return data;
  };

  return data;
}

function _templateObject5() {
  var data = _taggedTemplateLiteral(["\n  &&& {\n    ", " {\n      padding: 0 16px 0 0;\n    }\n  }\n"]);

  _templateObject5 = function _templateObject5() {
    return data;
  };

  return data;
}

function _templateObject4() {
  var data = _taggedTemplateLiteral([""]);

  _templateObject4 = function _templateObject4() {
    return data;
  };

  return data;
}

function _templateObject3() {
  var data = _taggedTemplateLiteral([""]);

  _templateObject3 = function _templateObject3() {
    return data;
  };

  return data;
}

function _templateObject2() {
  var data = _taggedTemplateLiteral([""]);

  _templateObject2 = function _templateObject2() {
    return data;
  };

  return data;
}

function _templateObject() {
  var data = _taggedTemplateLiteral([""]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

import styled from 'styled-components';
import { Nav } from '@alicloud/console-components';
export var Item = styled(Nav.Item)(_templateObject());
export var Group = styled(Nav.Group)(_templateObject2());
export var PopupItem = styled(Nav.PopupItem)(_templateObject3());
export var SubMenu = styled(Nav.SubNav)(_templateObject4());
var Menu = styled(Nav)(_templateObject5(), Item);
export default Menu;
export var IntersectionGuard = styled.div(_templateObject6());

var getAdjustedHeight = function getAdjustedHeight(value) {
  if (typeof value === 'number') {
    return value;
  }

  if (typeof window === 'undefined' || typeof document === 'undefined') {
    // this is executed in SSR
    // document is not defined
    return 0;
  }

  if (typeof value === 'string') {
    var elem = document.getElementById(value) || document.querySelector(value);

    if (elem && elem.offsetHeight) {
      return elem.offsetHeight;
    }
  }

  return 0;
};

var stickyIfNonIntersecting = function stickyIfNonIntersecting(props) {
  return props.isIntersecting ? '' : "\n    position: sticky;\n    top: 0;\n    overflow-y: scroll;\n    height: calc(100vh - ".concat(getAdjustedHeight(props.adjustHeight), "px);\n  ");
};

export var IntersectionContainer = styled.div(_templateObject7(), stickyIfNonIntersecting);