Liferay.Loader.define("layout-content-page-editor-web@2.0.157/page_editor/app/utils/getFragmentEntryLinkIdsFromItemId", ['module', 'exports', 'require', '../config/constants/layoutDataItemTypes'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = getFragmentEntryLinkIdsFromItemId;

    var _layoutDataItemTypes = require("../config/constants/layoutDataItemTypes");

    function _toConsumableArray(arr) {
      return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
    }

    function _nonIterableSpread() {
      throw new TypeError("Invalid attempt to spread non-iterable instance");
    }

    function _iterableToArray(iter) {
      if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
    }

    function _arrayWithoutHoles(arr) {
      if (Array.isArray(arr)) {
        for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
          arr2[i] = arr[i];
        }return arr2;
      }
    }

    function getFragmentEntryLinkIdsFromItemId(_ref) {
      var _item$config;

      var itemId = _ref.itemId,
          layoutData = _ref.layoutData;
      var item = layoutData === null || layoutData === void 0 ? void 0 : layoutData.items[itemId];
      return (item === null || item === void 0 ? void 0 : item.type) === _layoutDataItemTypes.LAYOUT_DATA_ITEM_TYPES.fragment ? [item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.fragmentEntryLinkId] : item === null || item === void 0 ? void 0 : item.children.reduce(function (acc, childId) {
        return [].concat(_toConsumableArray(acc), _toConsumableArray(getFragmentEntryLinkIdsFromItemId({
          itemId: childId,
          layoutData: layoutData
        })));
      }, []);
    }
    //# sourceMappingURL=getFragmentEntryLinkIdsFromItemId.js.map
  }
});
//# sourceMappingURL=getFragmentEntryLinkIdsFromItemId.js.map