1import{b6 as j,u as g,W as p,r as y,j as e,L as o,C as l,K as d,N as u,aa as h,a as x,B as c}from"./index-tc5-nNLC.js";import{L as b}from"./lock-CWiCoas5.js";function N(){const[,i]=j("/c/:slug"),[,r]=g(),t=i==null?void 0:i.slug,{data:n,isLoading:m,isError:f,error:v}=p({queryKey:["/api/chains/by-slug",t],queryFn:async()=>{const s=await fetch(`/api/chains/by-slug/${t}`);if(s.status===403)return{__private:!0,chainId:(await s.json()).chainId};if(!s.ok)throw new Error("Chain not found");return s.json()},enabled:!!t,retry:!1});return y.useEffect(()=>{var a;if(!n||n.__private)return;const s=(a=n.thread)==null?void 0:a.id;s&&r(`/chains/${s}`,{replace:!0})},[n,r]),m?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(o,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):f||n&&!n.__private&&!n.thread?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(l,{className:"max-w-md w-full text-center",children:[e.jsxs(d,{children:[e.jsx(u,{children:"Chain not found"}),e.jsx(h,{children:"This link may have expired or the chain no longer exists."})]}),e.jsx(x,{children:e.jsx(c,{onClick:()=>r("/"),children:"Go home"})})]})}):n!=null&&n.__private?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(l,{className:"max-w-md w-full text-center",children:[e.jsxs(d,{children:[e.jsx("div",{className:"flex justify-center mb-3",children:e.jsx("div",{className:"w-12 h-12 rounded-full bg-muted flex items-center justify-center",children:e.jsx(b,{className:"w-6 h-6 text-muted-foreground"})})}),e.jsx(u,{children:"Private Chain"}),e.jsx(h,{children:"This chain is invite-only. Sign in to check if you have access, or contact the chain creator to request an invitation."})]}),e.jsxs(x,{className:"flex flex-col gap-3",children:[e.jsx(c,{onClick:()=>r("/api/login?returnTo="+encodeURIComponent(window.location.pathname)),children:"Sign in to check access"}),e.jsx(c,{variant:"outline",onClick:()=>r("/"),children:"Go home"})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(o,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}export{N as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.