Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/experience/reducers/utils",["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 a(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){i(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 i(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.addExperience=function(e,t){return a(a({},e),{},{availableSegmentsExperiences:a(a({},e.availableSegmentsExperiences),{},{[t.segmentsExperienceId]:t})})},t.deleteExperienceById=function(e,t){const n=a({},e.availableSegmentsExperiences);return delete n[t],a(a({},e),{},{availableSegmentsExperiences:n})},t.removeLayoutDataItemById=function(e,t){const n=e.layoutDataList.filter((e=>e.segmentsExperienceId!==t));return a(a({},e),{},{layoutDataList:n})},t.selectExperience=function(e,t){let n=e;e.loadedSegmentsExperiences.includes(t)||(n=a(a({},n),{},{loadedSegmentsExperiences:[...n.loadedSegmentsExperiences,t]}));return a(a({},n),{},{segmentsExperienceId:t})},t.setExperienceLock=function(e,t){const n=t.hasLockedSegmentsExperiment;return a(a({},e),{},{lockedSegmentsExperience:n})},t.setExperimentStatus=function(e,t){const n=e.availableSegmentsExperiences[t];return a(a({},e),{},{segmentsExperimentStatus:n.segmentsExperimentStatus})},t.storeNewLayoutData=function(e,t,n){const r=e;return r.layoutDataList.push({layoutData:n,segmentsExperienceId:t}),r},t.switchLayoutData=function(e,{currentExperienceId:t,targetExperienceId:n}){let r=e;const{layoutData:i,layoutDataList:s}=r,c=e.layoutDataList.find((e=>e.segmentsExperienceId===n));return r=a(a({},r),{},{layoutData:c.layoutData,layoutDataList:s.map((e=>t===e.segmentsExperienceId?a(a({},e),{},{layoutData:i}):e))}),r}}}));
//# sourceMappingURL=utils.js.map