1import{r as l,j as s}from"./app-BEEa5O0A.js";import{H}from"./SafeHead-C8V8d37x.js";import{s as S,L as R,w as T}from"./Layout-UTfqo7-Q.js";import{P as j}from"./index-DMnJEM9U.js";import $ from"./LearnWithMeGames-DCMJ4UDl.js";import k from"./ShowAssetsSection-C4HJgcHm.js";import L from"./ShowHero-Cq_VnZ89.js";import z from"./ShowListingsSection-CWZ4f685.js";import{a as B,b as C,c as P,d as D}from"./showPageUtils-dfT5hZw_.js";import"./underwriting-DCpMyqIl.js";import"./SeasonSelect-DTRoEE4k.js";import"./ShowTypeTabs-Bc-EVC8f.js";function Q(e){const[o,c]=l.useState(e.episodes),[h,y]=l.useState(!!e.episodesRefreshing);l.useEffect(()=>{c(e.episodes)},[e.episodes]),l.useEffect(()=>{if(!h)return;let i=!1,n;const g=async()=>{try{const m=await fetch(`/api/tv/shows/${e.show.slug}/episodes`,{headers:{Accept:"application/json"}});if(!m.ok)throw new Error(`Failed to load episodes for ${e.show.slug}`);const t=await m.json();if(i)return;Array.isArray(t==null?void 0:t.episodes)&&c(t.episodes);const f=!!(t!=null&&t.refreshing);y(f),f?n=window.setTimeout(g,5e3):n=window.setTimeout(async()=>{try{const p=await fetch(`/api/tv/shows/${e.show.slug}/episodes`,{headers:{Accept:"application/json"}});if(!p.ok||i)return;const a=await p.json();!i&&Array.isArray(a==null?void 0:a.episodes)&&c(a.episodes)}catch{}},1200)}catch{i||(n=window.setTimeout(g,1e4))}};return g(),()=>{i=!0,n!==void 0&&window.clearTimeout(n)}},[h,e.show.slug]);const r=e.show.background_url||e.show.mezzanine_url||null,b=r?` 2 linear-gradient(to right, rgba(30,32,48,1) 0%, rgba(30,32,48,0.0) 20%, rgba(30,32,48,0.0) 80%, rgba(30,32,48,1) 100%), 3 linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), 4 url('/storage/${r}') 5 `:void 0,d=j("tv.show",{slug:e.show.slug}),u=S(e.show.long_description||e.show.short_description,220),x=B(o),w=C(o),_=w.length>0?w[0]:null,E=P(o,_),v=D(o),A={"@type":"TVSeries",name:e.show.title,...u?{description:u}:{},url:d,...e.show.poster_url?{image:[`/storage/${e.show.poster_url}`]}:{},...e.show.kvcr_original?{productionCompany:{"@type":"Organization",name:"KVCR Public Media"}}:{}};return s.jsxs(R,{title:e.show.title,description:S(e.show.long_description||e.show.short_description,220),image:e.show.poster_url?`/storage/${e.show.poster_url}`:null,breadcrumbs:T([{name:"Shows",url:"/tv/shows"},{name:e.show.title,url:d}]),structuredData:A,children:[s.jsxs(H,{children:[s.jsx("meta",{name:"description",content:e.show.long_description}),r&&s.jsx("meta",{property:"og:image",content:j("home")+`/${r}`}),s.jsx("link",{rel:"canonical",href:d})]}),s.jsx(L,{show:e.show,backgroundImage:b,defaultType:x,highestEpisode:E,highestSpecial:v}),e.show.slug==="learn-me"&&s.jsx($,{}),s.jsx(z,{listings:e.listings}),s.jsx(k,{episodes:o,isLoading:h})]})}export{Q 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.