PageSourceSearch

https://delphigrc.org/assets/SlugResolver-BcTAMnkU.js

js delphigrc.org collected 2026-09-25 20:48:44 UTC 2,847 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CourseDetail-DfG6mFxv.js","assets/vendor-react-BH6F5oQJ.js","assets/index-C_oSc_qP.js","assets/vendor-ui-B4WC06Sp.js","assets/vendor-icons-CaI5__By.js","assets/vendor-query-CC4VRGyP.js","assets/vendor-supabase-COwyE4EW.js","assets/index-DBuFE-63.css"])))=>i.map(i=>d[i]);
2import{s as e,r as s,W as r,S as t,_ as a}from"./index-C_oSc_qP.js";import{u as l,j as n,N as o,r as i}from"./vendor-react-BH6F5oQJ.js";import{a as c}from"./vendor-query-CC4VRGyP.js";import"./vendor-ui-B4WC06Sp.js";import"./vendor-icons-CaI5__By.js";import"./vendor-supabase-COwyE4EW.js";const u=e=>"PGRST116"===e||"406"===e;function d(e,r){return s(e,r.publication_type)}async function p(s){const{data:r,error:t}=await e.from("courses").select("id, slug").eq("slug",s).eq("is_active",!0).maybeSingle();if(t&&!u(t.code))throw t;return r}async function f(s){const{data:r,error:t}=await e.from("articles").select("id, slug, template_type, publication_type, template_settings").eq("slug",s).eq("status","published").maybeSingle();if(t&&!u(t.code))throw t;return r}async function m(s){const{data:r,error:t}=await e.from("fellows_public").select("slug").eq("slug",s).eq("is_active",!0).maybeSingle();if(t&&!u(t.code))throw t;return r}async function y(s){const{data:r,error:t}=await e.from("leadership").select("slug").eq("slug",s).maybeSingle();if(t&&!u(t.code))throw t;return r}function j(e){return c({queryKey:["slug-resolution",e],queryFn:async()=>e?async function(e){const[s,r,t,a]=await Promise.all([p(e),f(e),m(e),y(e)]);return(null==s?void 0:s.slug)?{type:"course"}:(null==r?void 0:r.slug)?{type:"article",path:d(e,r)}:(null==t?void 0:t.slug)?{type:"fellow"}:(null==a?void 0:a.slug)?{type:"leadership"}:{type:"not_found"}}(e):{type:"not_found"},enabled:Boolean(e),staleTime:3e5,retry:1})}const x=i.lazy(()=>a(()=>import("./CourseDetail-DfG6mFxv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])));function h(){return n.jsx("div",{className:"flex min-h-screen flex-col",children:n.jsx("main",{className:"flex-1 py-20",children:n.jsx("div",{className:"container",children:n.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 animate-pulse",children:[n.jsx(t,{className:"h-16 w-3/4"}),n.jsx(t,{className:"h-8 w-1/2"}),n.jsx(t,{className:"h-64 w-full"})]})})})})}const g=()=>{const{slug:e}=l(),{data:s,isLoading:t,isError:a}=j(e);if(!e)return n.jsx(o,{to:"/404",replace:!0});if(t)return n.jsx(h,{});if(a||!s)return n.jsx(o,{to:"/404",replace:!0});switch(s.type){case"course":return n.jsx(i.Suspense,{fallback:n.jsx(r,{}),children:n.jsx(x,{})});case"article":return n.jsx(o,{to:s.path,replace:!0});case"fellow":return n.jsx(o,{to:`/fellows/${e}`,replace:!0});case"leadership":return n.jsx(o,{to:`/leadership/${e}`,replace:!0});case"not_found":return n.jsx(o,{to:"/404",replace:!0});default:return s}};export{g 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.