Liferay.Loader.define("@liferay/frontend-data-set-web@1.0.31/views/viewsReducer",["module","exports","require"],(function(e,t,n){window;{function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.updateActiveView=function(t){return{type:e,value:t}},t.updateViewComponent=function(e,t){return{type:n,value:{component:t,name:e}}},t.updateVisibleFieldNames=function(e){return{type:c,value:e}},t.viewsReducer=function(t,{type:r,value:o}){const{activeView:u,views:a}=t;if(r===e)return i(i({},t),{},{activeView:a.find((({name:e})=>e===o))});if(r===n){const{component:e,name:n}=o;return i(i({},t),{},{activeView:n===(null==u?void 0:u.name)?i(i({},u),{},{component:e}):u,views:a.map((t=>t.name===n?i(i({},t),{},{component:e}):t))})}if(r===c)return i(i({},t),{},{visibleFieldNames:o});return t},t.ACTION_UPDATE_VISIBLE_FIELD_NAMES=t.ACTION_UPDATE_VIEW_COMPONENT=t.ACTION_UPDATE_ACTIVE_VIEW=void 0;const e="ACTION_UPDATE_ACTIVE_VIEW";t.ACTION_UPDATE_ACTIVE_VIEW=e;const n="ACTION_UPDATE_VIEW_COMPONENT";t.ACTION_UPDATE_VIEW_COMPONENT=n;const c="ACTION_UPDATE_VISIBLE_FIELD_NAMES";t.ACTION_UPDATE_VISIBLE_FIELD_NAMES=c}}));
//# sourceMappingURL=viewsReducer.js.map