"use strict";

Liferay.Loader.define("product-navigation-control-menu$dom-helpers@5.2.0/cjs/offsetParent", ['module', 'exports', 'require', '@product-navigation-control-menu$babel/runtime/helpers/interopRequireDefault', './css', './ownerDocument'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    var _interopRequireDefault = require("@product-navigation-control-menu$babel/runtime/helpers/interopRequireDefault");

    exports.__esModule = true;
    exports.default = offsetParent;

    var _css = _interopRequireDefault(require("./css"));

    var _ownerDocument = _interopRequireDefault(require("./ownerDocument"));

    var isHTMLElement = function isHTMLElement(e) {
      return !!e && 'offsetParent' in e;
    };

    function offsetParent(node) {
      var doc = (0, _ownerDocument.default)(node);
      var parent = node && node.offsetParent;

      while (isHTMLElement(parent) && parent.nodeName !== 'HTML' && (0, _css.default)(parent, 'position') === 'static') {
        parent = parent.offsetParent;
      }

      return parent || doc.documentElement;
    }

    module.exports = exports["default"];
  }
});
//# sourceMappingURL=offsetParent.js.map