/* side-nav-content.tsx generated by @compiled/babel-plugin v0.38.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SideNavContent = void 0;
require("./side-nav-content.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _react = _interopRequireWildcard(require("react"));
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
/**
 * The main content of the side nav, filling up the middle section. It acts as a scroll container.
 *
 * It will grow to take up the available space in the side nav — this is used to push the footer to the
 * bottom of the side nav.
 */
var SideNavContent = exports.SideNavContent = /*#__PURE__*/(0, _react.forwardRef)(_SideNavContent);

// Placing this const below the function breaks Compiled!
var styles = {
  scrollContainer: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo1wug _18m91wug",
  paddingContainer: "_1q51utpp _y4tiutpp _85i5utpp _bozgutpp"
};

/**
 * Using CSS scroll-driven animations to apply a scrolled indicator border.
 *
 * This approach is better for SSR, as some apps like Confluence will apply the
 * initial scroll position of the side nav content using JS before hydration.
 *
 * If we applied the border through React state it would only appear after hydration,
 * whereas this CSS approach should show even before hydration.
 */
var scrolledBorder = null;
var scrollTimelineVar = '--sNcst';
var fullHeightSidebarStyles = {
  scrollContainer: "_1un9baqb _21o1gc9s _j7hq1ysc"
};
function _SideNavContent(_ref, forwardedRef) {
  var children = _ref.children,
    testId = _ref.testId;
  var internalRef = (0, _react.useRef)(null);
  var mergedRef = (0, _react.useMemo)(function () {
    return (0, _mergeRefs.default)([internalRef, forwardedRef]);
  }, [forwardedRef]);
  return /*#__PURE__*/_react.default.createElement("div", {
    ref: (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') ? mergedRef : forwardedRef,
    "data-testid": testId,
    className: (0, _runtime.ax)([styles.scrollContainer, (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && fullHeightSidebarStyles.scrollContainer])
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _runtime.ax)([styles.paddingContainer])
  }, children));
}