Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/app/reducers/layoutDataReducer",["module","exports","require","../actions/types","../utils/setIn"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t=e,r){switch(r.type){case n.UPDATE_COL_SIZE:case n.UPDATE_COLLECTION_DISPLAY_COLLECTION:case n.UPDATE_LAYOUT_DATA:case n.ADD_FRAGMENT_ENTRY_LINKS:case n.ADD_ITEM:case n.DELETE_ITEM:case n.DUPLICATE_ITEM:case n.MOVE_ITEM:case n.UPDATE_FRAGMENT_ENTRY_LINK_CONFIGURATION:case n.UPDATE_ROW_COLUMNS:return r.layoutData;case n.UPDATE_FORM_ITEM_CONFIG:case n.UPDATE_ITEM_CONFIG:{const{itemId:e,layoutData:n}=r,i=n.items[e]||{},o=t.items[e]||{};return c(c({},n),{},{items:c(c({},n.items),{},{[e]:c(c({},i),{},{config:c(c({},r.overridePreviousConfig?{}:o.config),i.config)})})})}case n.UPDATE_ITEM_LOCAL_CONFIG:{const{itemConfig:e,itemId:n}=r,i=t.items[n]||{};return c(c({},t),{},{items:c(c({},t.items),{},{[n]:c(c({},i),{},{config:c(c({},r.overridePreviousConfig?{}:i.config),e)})})})}case n.UPDATE_PREVIEW_IMAGE:{const e=Object.fromEntries(Object.entries(t.items).map((([e,t])=>{var n,o,c;return[e,(null===(n=t.config)||void 0===n||null===(o=n.styles)||void 0===o||null===(c=o.backgroundImage)||void 0===c?void 0:c.classPK)===r.fileEntryId?(0,i.setIn)(t,["config","styles","backgroundImage","url"],r.previewURL):t]})));return c(c({},t),{},{items:e})}default:return t}},t.INITIAL_STATE=void 0;var n=r("../actions/types"),i=r("../utils/setIn");function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e={items:{}};t.INITIAL_STATE=e}}));
//# sourceMappingURL=layoutDataReducer.js.map