Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/selectors/selectFormConfiguration",["module","exports","require","../config/constants/formMappingSources","../config/constants/layoutDataItemTypes","../config/constants/layoutTypes","../config/index"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function selectFormConfiguration(e,t){if(!e)return{};const findFormConfiguration=e=>{const n=t.items[null==e?void 0:e.parentId];if(!n)return{};if(n.type===r.LAYOUT_DATA_ITEM_TYPES.form){var a,s;const e=null===(a=n.config)||void 0===a?void 0:a.classNameId,t=null===(s=n.config)||void 0===s?void 0:s.formConfig;if(e&&"0"!==e)return _objectSpread(_objectSpread({},n.config),{},{formId:n.itemId});if(c.config.layoutType!==i.LAYOUT_TYPES.display||t&&t!==o.FORM_MAPPING_SOURCES.displayPage)return{};{const{selectedMappingTypes:e}=c.config;return{classNameId:null==e?void 0:e.type.id,classTypeId:null==e?void 0:e.subtype.id,formId:n.itemId}}}return findFormConfiguration(n)};return findFormConfiguration(t.items[e.itemId])};var o=n("../config/constants/formMappingSources"),r=n("../config/constants/layoutDataItemTypes"),i=n("../config/constants/layoutTypes"),c=n("../config/index");function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=selectFormConfiguration.js.map