"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useBehaviour = exports.BehaviourProvider = void 0;
var _react = require("react");
const BehaviourContext = /*#__PURE__*/(0, _react.createContext)(undefined);
const BehaviourProvider = ({
  children,
  behaviour
}) => {
  const defaultBehaviour = (0, _react.useMemo)(() => ({
    AmitySocialHomePageBehaviour: {},
    AmityGlobalFeedComponentBehavior: {},
    AmityPostContentComponentBehavior: {},
    AmitySocialHomeTopNavigationComponentBehaviour: {},
    AmityCommunitySearchResultComponent: {},
    AmityEmptyNewsFeedComponent: {},
    AmityMyCommunitiesComponentBehaviour: {},
    AmityCreatePostMenuComponentBehavior: {},
    AmityPostTargetSelectionPageBehavior: {},
    AmityStoryTargetSelectionPageBehavior: {},
    AmityLivestreamPostTargetSelectionPageBehavior: {},
    AmityCommunityProfilePageBehavior: {},
    AmityPollTargetSelectionPageBehavior: {},
    AmityCommunitySetupPageBehavior: {},
    AmityCommunitySettingPageBehavior: {},
    AmityCommunityMembershipPageBehavior: {},
    AmityCommunityNotificationSettingPageBehavior: {},
    AmityPostComposerPageBehavior: {},
    AmityUserProfilePageBehavior: {},
    AmityBlockedUsersPageBehavior: {},
    AmityUserRelationshipPageBehavior: {},
    AmityUserProfileHeaderComponentBehavior: {},
    AmityUserPendingFollowRequestsPageBehavior: {},
    AmityUserFeedComponentBehavior: {}
  }), []);
  const customBehaviour = (0, _react.useMemo)(() => ({
    ...defaultBehaviour,
    ...behaviour
  }), [behaviour, defaultBehaviour]);
  return /*#__PURE__*/React.createElement(BehaviourContext.Provider, {
    value: customBehaviour
  }, children);
};
exports.BehaviourProvider = BehaviourProvider;
const useBehaviour = () => {
  const context = (0, _react.useContext)(BehaviourContext);
  if (!context) {
    throw new Error('useBehaviour must be used within a BehaviourProvider');
  }
  return context;
};
exports.useBehaviour = useBehaviour;
//# sourceMappingURL=BehaviourProvider.js.map