'use strict';

var React = require('react');
var react = require('@honeybadger-io/react');
var initializers_honeybadger_index = require('../../initializers/honeybadger/index.js');
var reactUtils_HoneybadgerErrorBoundary_FallbackComponent = require('./FallbackComponent.js');
var jsxRuntime = require('react/jsx-runtime');
require('../../defineProperty-COGyJ6Og.js');
require('../../toPropertyKey-DW-YC76_.js');
require('../../typeof-D4ZZ_FlZ.js');
require('../../initializers/honeybadger/constants.js');
require('../../initializers/honeybadger/utils.js');
require('dompurify');
require('@bigbinary/neetoui/Button');
require('@bigbinary/neetoui/Typography');
require('ramda');
require('react-i18next');

var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
  var children = _ref.children,
    _ref$ErrorComponent = _ref.ErrorComponent,
    ErrorComponent = _ref$ErrorComponent === void 0 ? reactUtils_HoneybadgerErrorBoundary_FallbackComponent : _ref$ErrorComponent,
    _ref$filterErrors = _ref.filterErrors,
    filterErrors = _ref$filterErrors === void 0 ? undefined : _ref$filterErrors,
    config = _ref.config;
  initializers_honeybadger_index.setHoneybadgerErrorFilter(filterErrors);
  React.useEffect(function () {
    if (config) initializers_honeybadger_index.default(config);
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  React.useEffect(function () {
    return function () {
      initializers_honeybadger_index.setHoneybadgerErrorFilter(null);
    };
  }, []);
  return /*#__PURE__*/jsxRuntime.jsx(react.HoneybadgerErrorBoundary, {
    ErrorComponent: ErrorComponent,
    honeybadger: react.Honeybadger,
    children: children
  });
};

module.exports = HoneybadgerErrorBoundary;
//# sourceMappingURL=HoneybadgerErrorBoundary.js.map
