Liferay.Loader.define("product-navigation-control-menu@5.0.19/js/addLoadingAnimation", ['module', 'exports', 'require', './constants/positions'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports["default"] = void 0;

    var _positions = require("./constants/positions");

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    var addLoadingAnimation = function addLoadingAnimation(targetItem, targetPosition) {
      var itemIsDropzone = targetItem.classList.contains('portlet-dropzone');
      var loading = document.createElement('div');
      loading.classList.add('loading-animation');

      if (itemIsDropzone) {
        targetItem.appendChild(loading);
      } else {
        var parent = targetItem.parentElement;
        var item = targetPosition === _positions.POSITIONS.top ? targetItem : targetItem.nextSibling;
        parent.insertBefore(loading, item);
      }

      return loading;
    };

    var _default = addLoadingAnimation;
    exports["default"] = _default;
    //# sourceMappingURL=addLoadingAnimation.js.map
  }
});
//# sourceMappingURL=addLoadingAnimation.js.map