Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/fragments-widgets/components/TabCollection",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/config/constants/fragmentsDisplayStyles","../../../app/config/index","../../../common/components/Collapse","../../../core/hooks/useSessionState","./TabItem"],(function(e,t,l){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var a=c(l("liferay!frontend-js-react-web$prop-types")),n=c(l("liferay!frontend-js-react-web$react")),o=l("../../../app/config/constants/fragmentsDisplayStyles"),i=l("../../../app/config/index"),s=c(l("../../../common/components/Collapse")),r=l("../../../core/hooks/useSessionState"),d=c(l("./TabItem"));function c(e){return e&&e.__esModule?e:{default:e}}function f({collection:t,displayStyle:l,initialOpen:a,isSearchResult:o}){const[c,u]=(0,r.useSessionState)("".concat(i.config.portletNamespace,"_fragment-collection_").concat(t.collectionId,"_open"),a);return n.default.createElement(s.default,{key:t.collectionId,label:t.label,onOpen:e=>{u(e)},open:o||c},t.collections&&t.collections.map(((e,t)=>n.default.createElement(f,{collection:e,displayStyle:l,initialOpen:!1,isSearchResult:o,key:t}))),n.default.createElement("ul",{className:"list-unstyled page-editor__fragments-widgets__tab-collection-".concat(l," pb-2 w-100")},t.children.map((t=>{var a;return n.default.createElement(n.default.Fragment,{key:t.itemId},n.default.createElement(d.default,{displayStyle:l,item:t,key:t.itemId}),(null===(a=t.portletItems)||void 0===a?void 0:a.length)&&n.default.createElement(e,{item:t}))}))))}f.proptypes={collection:a.default.shape({children:a.default.array,collectionId:a.default.string,label:a.default.string}).isRequired,displayStyle:a.default.oneOf(Object.values(o.FRAGMENTS_DISPLAY_STYLES)),isSearchResult:a.default.bool,open:a.default.bool};const e=({item:e})=>n.default.createElement("ul",{className:"d-flex flex-wrap list-unstyled w-100"},e.portletItems.map(((e,t)=>n.default.createElement(d.default,{item:e,key:t}))));e.proptypes={data:a.default.shape({instanceable:a.default.bool,portletId:a.default.string,portletItemId:a.default.string,used:a.default.bool}).isRequired,disabled:a.default.bool,icon:a.default.string,itemId:a.default.string,label:a.default.string,portletItems:a.default.array,preview:a.default.string,type:a.default.string}}}));
//# sourceMappingURL=TabCollection.js.map