Liferay.Loader.define("data-engine-js-components-web@1.0.79/js/core/components/PageRenderer/Page.es",["module","exports","require","@frontend-taglib-clay$clayui/icon","frontend-js-web","liferay!frontend-js-react-web$react","../../../custom/form/renderer/MultiPagesVariant.es","../../../custom/form/renderer/PaginatedVariant.es","../../../custom/form/renderer/SuccessVariant.es","../../../custom/form/renderer/WizardVariant.es","../../../utils/visitors.es","../../hooks/usePage.es","../../utils/merge-variants.es","./DefaultVariant.es","./Layout.es","./TabbedVariant.es","./VariantsContext.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=v(r("@frontend-taglib-clay$clayui/icon")),n=r("frontend-js-web"),i=v(r("liferay!frontend-js-react-web$react")),o=P(r("../../../custom/form/renderer/MultiPagesVariant.es")),s=P(r("../../../custom/form/renderer/PaginatedVariant.es")),c=P(r("../../../custom/form/renderer/SuccessVariant.es")),l=P(r("../../../custom/form/renderer/WizardVariant.es")),d=r("../../../utils/visitors.es"),u=r("../../hooks/usePage.es"),f=r("../../utils/merge-variants.es"),p=P(r("./DefaultVariant.es")),g=r("./Layout.es"),m=P(r("./TabbedVariant.es")),b=r("./VariantsContext.es");function y(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return y=function(){return e},e}function P(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=y();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function v(e){return e&&e.__esModule?e:{default:e}}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function E(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){j(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 j(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={MULTI_PAGES:"multi-pages",PAGINATED:"paginated",SINGLE_PAGE:"single-page",SUCCESS:"success",TABBED:"tabbed",WIZARD:"wizard"},_={[e.MULTI_PAGES]:o,[e.PAGINATED]:s,[e.SINGLE_PAGE]:{Container:p.Container},[e.SUCCESS]:c,[e.TABBED]:m,[e.WIZARD]:l},A="_com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormPortlet_",D=({rows:e})=>{let t=!1;return t=!e||!e.length||!e.some((({columns:e})=>{let t=!0;return t=!!e&&e.some((e=>e.fields.length)),t})),t},M=(e,t)=>((0,n.isObject)(e.description)&&(e=E(E({},e),{},{description:e.description[t]})),(0,n.isObject)(e.title)&&(e=E(E({},e),{},{title:e.title[t]})),e),V=({page:t,pages:r,paginationMode:a})=>t.contentRenderer&&null!==t.contentRenderer&&""!==t.contentRenderer?t.contentRenderer:null===a||""===a?r.length>1?e.WIZARD:e.SINGLE_PAGE:a,S=({activePage:t=0,editable:r=!1,editingLanguageId:n,forceAriaUpdate:o,invalidFormMessage:s,overrides:c={},page:l,pageIndex:u=0,pages:m,paginationMode:y,portletNamespace:P,readOnly:v,strings:O,viewMode:E})=>{const j=D(l),w=M(l,n),S=V({page:w,pages:m,paginationMode:y}),I=_[S]||{},L={defaults:p,overrides:c,variant:I},h=(0,f.mergeVariants)(r,L);let G=!1;if(null==m?void 0:m[t]){G=!!new d.PagesVisitor([m[t]]).findField((e=>e.required))}const C=P.includes(A);return i.default.createElement(b.VariantsProvider,{components:L},i.default.createElement(h.Container,{activePage:t,editable:r,empty:j,page:w,pageIndex:u,pages:m,readOnly:v,strings:O},i.default.createElement(h.Page,{activePage:t,editable:r,empty:j,forceAriaUpdate:o,header:S===e.SINGLE_PAGE?null:i.default.createElement(h.PageHeader,w),invalidFormMessage:s,page:w,pageIndex:u},G&&C&&i.default.createElement("p",{"aria-hidden":"true",className:"text-secondary"},i.default.createElement("span",{className:"c-mr-1 reference-mark"},i.default.createElement(a.default,{symbol:"asterisk"})),Liferay.Language.get("indicates-required-fields")),i.default.createElement(g.Layout,{components:h,editable:r,rows:w.rows,viewMode:E}))))};var w=e=>i.default.createElement(u.PageProvider,{value:e},i.default.createElement(S,e));t.default=w}}));
//# sourceMappingURL=Page.es.js.map