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