// 选中button
function activeAnchor(_ref) {
  var _sidebarDOM$querySele, _sidebarDOM$querySele2;
  var anchor = _ref.anchor,
    sidebarDOM = _ref.sidebarDOM,
    tooltipDOM = _ref.tooltipDOM;
  var buttonsDOM = sidebarDOM === null || sidebarDOM === void 0 || (_sidebarDOM$querySele = sidebarDOM.querySelectorAll) === null || _sidebarDOM$querySele === void 0 ? void 0 : _sidebarDOM$querySele.call(sidebarDOM, '.indexbar-button');
  if (buttonsDOM && buttonsDOM.length) {
    for (var i = 0, buttonDOM; buttonDOM = buttonsDOM[i++];) {
      buttonDOM.classList.remove('active');
    }
  }
  var currentButtonDOM = sidebarDOM === null || sidebarDOM === void 0 || (_sidebarDOM$querySele2 = sidebarDOM.querySelector) === null || _sidebarDOM$querySele2 === void 0 ? void 0 : _sidebarDOM$querySele2.call(sidebarDOM, "[data-indexbar-anchor-button=\"".concat(anchor, "\"]"));
  if (currentButtonDOM) {
    currentButtonDOM.classList.add('active');
    tooltipDOM.innerHTML = anchor || '';
  }
}
export default activeAnchor;