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

var _chunk46AVXTFOcjs = require('./chunk-46AVXTFO.cjs');


var _chunk6DYK4XKYcjs = require('./chunk-6DYK4XKY.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');


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


var _chunkQQDRBCBYcjs = require('./chunk-QQDRBCBY.cjs');

// src/components/PageSection/PageSectionNav.tsx
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _core = require('@lightsparkdev/core');
var _jsxruntime = require('@emotion/react/jsx-runtime');
var StyledPageSectionNav = _styled2.default.div`
  display: none;
  flex-direction: column;
  margin-right: 32px;
  position: relative;

  ${_chunkKW3JYLRIcjs.bp.minMd(`
    display: flex;
    width: 150px;
  `)}

  ${_chunkKW3JYLRIcjs.bp.lg(`
    width: 200px;
  `)}
`;
var PageSectionList = _styled2.default.ul`
  margin: 0;
  padding: 0;
  position: sticky;
  top: ${({ top }) => top}px;
`;
var StyledPageSectionNavItem = _styled2.default.li`
  align-items: center;
  color: ${_chunkQQDRBCBYcjs.colors.gray40};
  display: flex;
  list-style: none;

  ${_chunkWF7Z2VITcjs.IconContainer}:not(:first-of-type) {
    visibility: hidden;
  }

  &:hover {
    color: ${({ theme }) => theme.hcNeutral};

    ${_chunkWF7Z2VITcjs.IconContainer} {
      visibility: visible;
    }
  }
`;
var PageSectionListItem = ({ leftIcon, label, sectionId }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledPageSectionNavItem, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
  _chunk6DYK4XKYcjs.TextButton,
  {
    text: label,
    padding: "8px 0",
    leftIcon: { name: leftIcon },
    onClick: () => {
      if (sectionId) {
        window.location.replace(`#${sectionId}`);
      } else {
        window.location.replace("#");
      }
    }
  }
) });
function PageSectionNav({
  headerOffset = 0,
  pageSectionNavItems
}) {
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledPageSectionNav, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionList, { top: headerOffset + _chunk46AVXTFOcjs.pageSectionScrollOffset, children: pageSectionNavItems.filter(_core.notNullUndefined).map((item) => {
    return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
      PageSectionListItem,
      {
        leftIcon: item.leftIcon,
        label: item.label,
        sectionId: item.sectionId
      },
      item.sectionId
    );
  }) }) });
}



exports.PageSectionNav = PageSectionNav;
