/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const ANCHOR_SHARP_REGEXP = /#(\S+)$/;
function getOffsetTop(target, container) {
  const {
    top
  } = target.getBoundingClientRect();

  if (container === window) {
    return top - document.documentElement.clientTop;
  }

  return top - container.getBoundingClientRect().top;
}

exports.ANCHOR_SHARP_REGEXP = ANCHOR_SHARP_REGEXP;
exports.getOffsetTop = getOffsetTop;
//# sourceMappingURL=utils.js.map
