Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/app/contexts/CollectionActiveItemContext",["module","exports","require","liferay!frontend-js-react-web$react","../config/constants/itemTypes","../config/constants/layoutDataItemTypes","./CollectionItemContext","./ControlsContext","./StoreContext"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionActiveItemContextProvider=function CollectionActiveItemContextProvider({children:t}){const[o,r]=(0,n.useState)(c.INITIAL_STATE);return n.default.createElement(e.Provider,{value:r},n.default.createElement(u.Provider,{value:o},t))},t.useSetCollectionActiveItemContext=function useSetCollectionActiveItemContext(t){const o=(0,a.useActiveItemId)(),u=(0,a.useActiveItemType)(),s=(0,a.useIsActive)(),f=(0,n.useContext)(c.CollectionItemContext),d=(0,n.useContext)(e),C=(0,l.useSelectorCallback)((e=>e.layoutData.items[t]),[t]);(s(t)||C&&C.type===i.LAYOUT_DATA_ITEM_TYPES.fragment&&u===r.ITEM_TYPES.editable&&o&&o.startsWith(C.config.fragmentEntryLinkId))&&d(f)},t.useCollectionActiveItemContext=function useCollectionActiveItemContext(){return(0,n.useContext)(u)};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=n?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r]}o.default=e,t&&t.set(e,o);return o}(o("liferay!frontend-js-react-web$react")),r=o("../config/constants/itemTypes"),i=o("../config/constants/layoutDataItemTypes"),c=o("./CollectionItemContext"),a=o("./ControlsContext"),l=o("./StoreContext");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e=n.default.createContext((()=>{})),u=n.default.createContext(c.INITIAL_STATE)}}));
//# sourceMappingURL=CollectionActiveItemContext.js.map