/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

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

var utils_dom = require('../../utils/dom.js');
require('../../_chunks/dep-f4db2590.js');
require('lodash/isString');
require('lodash/isFunction');
require('lodash/isArray');
require('../../utils/easing.js');

function scrollToElm(elm) {
  var rect = elm.getBoundingClientRect();
  if (!utils_dom.elementInViewport(elm)) {
    var winHeight = utils_dom.getWindowSize().height;
    utils_dom.scrollTo(rect.top - (winHeight / 2 - rect.height / 2), {});
  }
}

exports["default"] = scrollToElm;
//# sourceMappingURL=scrollToElm.js.map
