
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a3646f0f-c3d3-5f76-9dcf-a578760d15cc")}catch(e){}}();
import{j as d}from"./jsx-runtime-C7NhH_hV.js";import{r as l}from"./index-Wp2u197Z.js";import{T as m}from"./index-DB8lN5GT.js";import{d as h}from"./components-Dt5xBELm.js";const f=l.createContext(null),u={didCatch:!1,error:null};class p extends l.Component{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=u}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(r!==null){for(var n,t,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];(n=(t=this.props).onReset)===null||n===void 0||n.call(t,{args:a,reason:"imperative-api"}),this.setState(u)}}componentDidCatch(r,n){var t,o;(t=(o=this.props).onError)===null||t===void 0||t.call(o,r,n)}componentDidUpdate(r,n){const{didCatch:t}=this.state,{resetKeys:o}=this.props;if(t&&n.error!==null&&y(r.resetKeys,o)){var a,s;(a=(s=this.props).onReset)===null||a===void 0||a.call(s,{next:o,prev:r.resetKeys,reason:"keys"}),this.setState(u)}}render(){const{children:r,fallbackRender:n,FallbackComponent:t,fallback:o}=this.props,{didCatch:a,error:s}=this.state;let i=r;if(a){const c={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(c);else if(t)i=l.createElement(t,c);else if(o!==void 0)i=o;else throw s}return l.createElement(f.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}}function y(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==r.length||e.some((n,t)=>!Object.is(n,r[t]))}function E({error:e}){return d.jsx("div",{className:"flex max-w-2xl flex-col space-y-2 py-8",children:d.jsx(m,{as:"p",type:"body",size:"md",className:"text-center leading-tight tracking-normal",children:e.message.split("Error: ")[1]})})}function B({children:e,fallbackRender:r}){function n({error:t}){return d.jsx(E,{error:t})}return d.jsx(p,{fallbackRender:r??n,children:e})}function j(){const e=h();return g(e.data),e}function g(e){if(e&&typeof e=="object"&&"$$error"in e)throw e?.$$error}export{B as C,E as D,j as u};
//# sourceMappingURL=index-lDWOplfq.js.map

//# debugId=a3646f0f-c3d3-5f76-9dcf-a578760d15cc
