"use strict";var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/assertThisInitialized"),o=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),u=require("@babel/runtime/helpers/getPrototypeOf"),a=require("@babel/runtime/helpers/defineProperty"),l=require("react"),c=require("prop-types"),s=require("@rollbar/react"),p=require("./DevCenterAppErrorView/DevCenterAppErrorView.js"),f=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=h(e),d=h(r),y=h(t),v=h(n),m=h(o),O=h(i),j=h(u),q=h(a),E=h(c),w=["ErrorView","children"];function P(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function g(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=j.default(e);if(r){var o=j.default(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return O.default(this,t)}}var C=function(e){m.default(t,e);var r=g(t);function t(){var e;d.default(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return e=r.call.apply(r,[this].concat(o)),q.default(v.default(e),"state",{hasInternalError:!1}),e}return y.default(t,[{key:"componentDidCatch",value:function(e){var r,t;this.setState({hasInternalError:!0}),console.error(e),null===(r=(t=this.props).onError)||void 0===r||r.call(t,e);var n=s.getRollbarFromContext(this.context||{});n&&n.options.accessToken&&n.error(e)}},{key:"render",value:function(){if(!this.state.hasInternalError)return this.props.children;var e=this.props,r=e.ErrorView;e.children;var t=b.default(e,w);return f.jsx(r,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?P(Object(t),!0).forEach((function(r){q.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({},t))}}],[{key:"getDerivedStateFromError",value:function(){return{hasInternalError:!0}}}]),t}(l.Component);C.propTypes={children:E.default.node.isRequired,ErrorView:E.default.elementType},C.defaultProps={ErrorView:p},C.contextType=s.Context;var x=C;module.exports=x;
//# sourceMappingURL=ErrorBoundary.js.map
