Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.84/admin/js/config/initialState.es",["module","exports","require","data-engine-js-components-web","data-engine-js-components-web/js/core/config/index.es"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.initState=function(e,{view:t}){var n;let{pages:a,paginationMode:l,rules:c,successPageSettings:g}=e,d=o(e,["pages","paginationMode","rules","successPageSettings"]);const p=a.length?u(a):r.INITIAL_PAGES,f=c.length?i.RulesSupport.formatRules(p,c):c,b="fieldSets"===t?"single-page":l,y={body:(null==g?void 0:g.body)?null==g?void 0:g.body:{[themeDisplay.getDefaultLanguageId()]:Liferay.Language.get("your-information-was-successfully-received-thank-you-for-filling-out-the-form")},enabled:"fieldSets"!==t&&(null===(n=null==g?void 0:g.enabled)||void 0===n||n),title:(null==g?void 0:g.title)?null==g?void 0:g.title:{[themeDisplay.getDefaultLanguageId()]:Liferay.Language.get("thank-you")}};return s({pages:[...p.map(((e,t)=>s(s({},e),{},{id:(0,i.getUid)(),pageIndex:t,total:p.length}))),!!y.enabled&&{contentRenderer:"success",id:(0,i.getUid)(),paginationItemRenderer:"".concat(b,"_success"),rows:[],successPageSettings:y}].filter(Boolean),paginationMode:b,rules:f,successPageSettings:y},d)},t.BUILDER_INITIAL_STATE=void 0;var i=n("data-engine-js-components-web"),r=n("data-engine-js-components-web/js/core/config/index.es");function o(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e=s(s({},r.INITIAL_STATE),{},{currentRuleLoc:null,editingLanguageId:themeDisplay.getDefaultLanguageId(),fieldSets:[],fieldTypes:[],formInstanceId:0,functionsMetadata:{},objectFields:[],paginationMode:"multi-pages",rules:[]});t.BUILDER_INITIAL_STATE=e;const u=e=>new i.PagesVisitor(e).mapFields((e=>{let{settingsContext:t}=e,n=o(e,["settingsContext"]);const r=new i.PagesVisitor(t.pages);return s(s({},n),{},{localizedValue:{},settingsContext:s(s({},t),{},{pages:r.mapFields((e=>{if("options"===e.type){const t=Object.keys(e.value);return s(s({},e),{},{value:t.reduce(((t,n)=>s(s({},t),{},{[n]:e.value[n].map((e=>s(s({},e),{},{edited:!0})))})),{})})}return e}))}),value:void 0})}),!0,!0)}}));
//# sourceMappingURL=initialState.es.js.map