const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.client-Dym9mihY.js","assets/index-BDZD4X5K.js"])))=>i.map(i=>d[i]);
import{_ as p}from"./preload-helper-DECEsjER.js";import{j as e}from"./jsx-runtime-C_974cfT.js";import{r as t}from"./index-BDZD4X5K.js";import{d as f,e as x,i as a}from"./chunk-UIGDSWPH-fNK8sKgt.js";import{g as m}from"./misc-BOyXKFuR.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"3ea6c863933c57219be78eb06addfb47859d8df2"}}catch{}})();const j=await p(()=>import("./index.client-Dym9mihY.js"),__vite__mapDeps([0,1])).catch(r=>(console.warn("Failed to import @sentry/react-router:",r instanceof Error?r.message:String(r),"- Sentry monitoring will be disabled but the application will continue to work normally"),null)),y={400:({error:r})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Request"}),e.jsx("p",{children:r.data})]}),401:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Unauthorized"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),403:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Forbidden"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),404:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Not Found"}),e.jsx("p",{children:"Sorry, we couldn't find what you were looking for."})]}),500:({error:r})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Internal Server Error"}),e.jsx("p",{children:"Sorry, something went wrong on our end."}),e.jsx("p",{children:r.data})]}),502:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Gateway"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]}),503:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Service Unavailable"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]})};function b({className:r="container flex items-center justify-center p-20 text-h2 flex-col gap-6",defaultStatusHandler:o=({error:n})=>e.jsxs("p",{children:[n.status," ",n.data]}),statusHandlers:l,unexpectedErrorHandler:d=n=>e.jsx("p",{children:m(n)})}){const[n,c]=t.useState(!1),s=f(),h=x(),i=a(s),u={...y,...l};return t.useEffect(()=>{i||ENV.EPICSHOP_IS_PUBLISHED&&j?.captureException(s)},[s,i]),t.useEffect(()=>{s instanceof Error&&s.message.includes("Failed to fetch")&&fetch("/resources/healthcheck").catch(()=>{c(!0)})},[s]),typeof document<"u"&&console.error(s),e.jsxs("div",{className:r,children:[n?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6",children:[e.jsx("h1",{className:"text-h2 font-bold",children:"Server is down"}),e.jsx("p",{className:"text-body-md",children:ENV.EPICSHOP_DEPLOYED?"Sorry, we're having a temporary problem. Please try again later.":"Your server is not running. Please restart the workshop app."})]}):null,a(s)?(u?.[s.status]??o)({error:s,params:h}):d(s)]})}export{b as G};
//# sourceMappingURL=error-boundary-C5RUodgX.js.map
