const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.client-B4Gezg7M.js","assets/index-CFdT0RIo.js"])))=>i.map(i=>d[i]);
import{_ as f}from"./preload-helper-DLdknYSj.js";import{j as e}from"./jsx-runtime-hUI6LOBV.js";import{r as o}from"./index-CFdT0RIo.js";import{h as p,i as x,j as d}from"./chunk-EVOBXE3Y-Bmgys8-c.js";import{g as j}from"./misc-BNcbB3dR.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:"66e9b849450b819e11683314a547a341cb57f7d0"};var t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="4a2bfe0b-e58e-4012-b973-81f9214d9ff7",r._sentryDebugIdIdentifier="sentry-dbid-4a2bfe0b-e58e-4012-b973-81f9214d9ff7")}catch{}})();const m=await f(()=>import("./index.client-B4Gezg7M.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 S({className:r="container flex items-center justify-center p-20 text-h2 flex-col gap-6",defaultStatusHandler:t=({error:n})=>e.jsxs("p",{children:[n.status," ",n.data]}),statusHandlers:i,unexpectedErrorHandler:l=n=>e.jsx("p",{children:j(n)})}){const[n,c]=o.useState(!1),s=p(),h=x(),a=d(s),u={...y,...i};return o.useEffect(()=>{a||ENV.EPICSHOP_IS_PUBLISHED&&m?.captureException(s)},[s,a]),o.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,d(s)?(u?.[s.status]??t)({error:s,params:h}):l(s)]})}export{S as G};
//# sourceMappingURL=error-boundary-C8cCfAXR.js.map
