import{r as S,z as r,j as e,S as $t,F as n,a3 as U,K as pt,a1 as Gt,a5 as zt}from"./vendor-CT-JknSv.chunk.js";import{a5 as R,i as $,a6 as J,a7 as Ft,a8 as Nt,a9 as Mt,aa as Ot,ab as Y,ac as Ut,r as C,v as D,l as M,W as ut,ad as Vt,ae as jt,a3 as K,a4 as Z,af as Kt,ag as ht,ah as mt,D as wt,u as bt,ai as Qt,aj as Yt,ak as Xt,B as tt,b as xt,al as X,I as et,J as vt,G as ft,P,R as V,C as St,V as B,a1 as Ct,a2 as it,am as T,an as _t,ao as qt,ap as Jt,aq as Zt,ar as te,as as yt,at,au as ee,av as ie,aw as oe,ax as re,ay as kt,j as m,az as ae,aA as Tt,aB as se,aC as st,Y as ne,aD as q,k as le,a0 as de,H as ce,z as ge,F as pe,E as ue,aE as he}from"./index-DDZqnj79.js";import{u as me,S as we,a as Bt,b as Rt,c as At,d as It,e as Lt}from"./index-xdlqZ4JJ.chunk.js";import{C as be,W as xe}from"./WatchLaterIcon-DB7Vx4yd.chunk.js";import{g as Et}from"./getTwitterHandleFromUrl-CbZURkQ2.chunk.js";import{C as j}from"./LoadingConveyorSection-B4xh3KQa.chunk.js";import{B as ve}from"./Badge-DbIO_94P.chunk.js";const fe=t=>S.createElement("svg",{width:28,height:28,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},S.createElement("g",{clipPath:"url(#0cwcf5az0a)",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("path",{d:"M4.665 7.001a2.333 2.333 0 0 1 2.333-2.333h14a2.333 2.333 0 0 1 2.334 2.333v14a2.333 2.333 0 0 1-2.334 2.334h-14A2.333 2.333 0 0 1 4.665 21v-14zM9.335 4.668v18.667M18.665 4.668v18.667M4.665 9.332h4.667M4.665 14h4.667M4.665 18.668h4.667M18.665 9.332h4.667M18.665 14h4.667M18.665 18.668h4.667"})),S.createElement("defs",null,S.createElement("clipPath",{id:"0cwcf5az0a"},S.createElement("path",{fill:"currentColor",d:"M0 0h28v28H0z"}))));function Se({title:t,banner:i}){return i?e(R,{name:t!=null?t:"",image:i,widthDefinition:`${Mt} calc(100vw - 140px), ${Ot} calc(100vw - 140px), ${Y} calc(100vw - 120px), ${Ut} 100vw`,css:lt.image}):e(Nt,{heightToWidthRatio:J,css:lt.placeholder,children:e(Ft,{})})}const nt={width:"100%",maxHeight:"calc(100vw / 6)",[C]:{maxHeight:"100%"},[D]:{maxHeight:300,height:"calc(100vw / 2)"}},lt={placeholder:r(nt),image:r([{[R.fallbackSelector]:{transition:"all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1)",backgroundColor:$.secondarySystemBackground,objectFit:"cover",verticalAlign:"middle"}},{[R.fallbackSelector]:nt}])};function Ce({children:t,...i}){return e("h2",{css:{gridArea:"category",fontWeight:M.weight.book,fontSize:"14px",marginTop:"0px",color:$.label400},...i,children:t})}function _e({children:t,...i}){return e("div",{css:{display:"grid",position:"relative",gridTemplateColumns:"86px auto 1fr auto",gridTemplateRows:"43px 43px",gridColumnGap:10,gridTemplateAreas:'"avatar title . follow" "avatar category . follow"',padding:"30px 0px 10px",transition:"all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1)",[D]:{paddingTop:0,marginTop:-38,gridTemplateColumns:"76px 1fr 1fr auto",gridTemplateRows:"76px auto",gridTemplateAreas:`
            "avatar . . follow" 
            "title title title title"
            "category category category category"
          `},[C]:{paddingTop:0,marginTop:-38,gridTemplateColumns:"76px 1fr 1fr auto",gridTemplateRows:"76px auto",gridTemplateAreas:`
            "avatar . . follow" 
            "title title title title"
            "category category category category"
          `}},...i,children:t})}function ye({playlists:t}){return t?e(ut,{view:"creator_playlist",children:e("div",{children:t.map(i=>e(ke,{...i},i.id))})}):null}function ke({id:t,title:i}){const{episodes:o,isInitialLoading:a}=Vt({id:t});return!a&&!(o!=null&&o.length)?null:e(Z,{contentId:t,title:i,css:{marginTop:0,padding:0},children:a||!o?e(j,{size:"medium",children:$t(5).map(l=>e(jt,{index:l,heightToWidthRatio:J,withAvatar:!0},l))}):e(j,{size:"medium",children:o.map(l=>e(K,{item:l,showDate:!0},l.id))})})}function Wt({handle:t}){const{products:i,isInitialLoading:o}=me(t);return t?o?e(ht,{heightToWidthRatio:Kt}):i?e(mt,{render:()=>i.map(a=>{var l;return e(we,{url:a.url,image:(l=a.images)==null?void 0:l[0],title:a.title,price:a.price},a.id)})}):null:null}function Te({children:t}){return e("h1",{css:{gridArea:"title",fontWeight:M.weight.medium,fontSize:"22px",lineHeight:"22px",marginBottom:"0px",alignSelf:"flex-end",color:$.label,[D]:{fontSize:"20px",marginTop:10},[C]:{fontSize:"18px",marginTop:10}},children:t})}const Q=["-published_at","published_at"],Be=["unwatched"],Re=["tab",...yt];function Ae({channel:t,isLoadingFullChannel:i}){var A,I,L,E,W;const{channel:o}=wt({id:t==null?void 0:t.id}),a=o==null?void 0:o.exclusivity,l=bt(),b=S.useMemo(()=>[...l?Be:[],...a!=null?a:[]],[a,l]),[c]=Qt(Q[0],Q),[d]=Yt(b),{episodes:p,error:g,hasMore:w,loadMore:x}=Xt({id:t==null?void 0:t.id,ordering:c,isPlus:d.has("plus")||void 0,isFirst:d.has("first")||void 0,isOriginal:d.has("original")||void 0,progress:d.has("unwatched")?"unwatched":void 0}),{data:u}=tt(t),[y,h]=xt("tab",{defaultValue:"videos",allowedValues:["videos",i||(A=t==null?void 0:t.playlists)!=null&&A.length?"playlists":null,i||t!=null&&t.merch_collection?"store":null].filter(X)}),k=d.size>0,G=S.useMemo(()=>{var v;return[{key:"videos",label:"Videos",to:h("videos")},...(v=t==null?void 0:t.playlists)!=null&&v.length?[{key:"playlists",label:"Playlists",to:h("playlists")}]:[],...t!=null&&t.merch_collection?[{key:"store",label:"Store",to:h("store")}]:[]]},[t==null?void 0:t.merch_collection,(I=t==null?void 0:t.playlists)==null?void 0:I.length,h]),z=et({url:`/${t.slug}`,title:t.title,description:t.description,image:{src:vt({image:(L=t.images)==null?void 0:L.featured,width:1280,format:"jpeg"}),width:1280,height:720},twitter:t.twitter?{creator:Et(t.twitter)}:void 0,canonicalQueryParams:Re});return g?n(P,{children:[e(U,{defer:!1,children:e("title",{children:"Error"})}),e(ft,{error:g})]}):t?n(P,{children:[n(U,{defer:!1,children:[e("title",{children:t.title}),z,e("link",{rel:"alternate",type:"application/rss+xml",href:new URL(`video/channels/${t.slug}.rss`,V.NEBULA_RSS_BASE_URL).toString(),title:`Latest Videos of ${t.title}`}),e("link",{rel:"alternate",type:"application/rss+xml",href:new URL(`video/channels/${t.slug}.rss?plus=true`,V.NEBULA_RSS_BASE_URL).toString(),title:`Latest Plus Videos of ${t.title}`})]}),e(Se,{title:t==null?void 0:t.title,banner:(E=t==null?void 0:t.images)==null?void 0:E.banner}),n(St,{as:"main",css:{paddingLeft:B,paddingRight:B,[C]:{paddingLeft:B,paddingRight:B}},children:[n(_e,{children:[e(be,{name:"Avatar",image:(W=t.images)==null?void 0:W.avatar,size:86}),e(Te,{children:t.title}),e(Ce,{children:t.genre_category_title}),Ct(u)&&e(it,{id:t.id,css:{gridArea:"follow",width:"auto",alignSelf:"center"},isFollowing:!!(u!=null&&u.following)})]}),t.description&&e("p",{css:{color:$.label,margin:0,maxWidth:750,padding:"18px 0 0",fontSize:"14px",lineHeight:"20px"},children:t.description}),n("div",{css:{display:"flex",flexDirection:"row",marginTop:30},children:[t.twitter&&e(T,{to:t.twitter,children:e(Bt,{title:"twitter"})}),t.patreon&&e(T,{to:t.patreon,children:e(Rt,{title:"patreon"})}),t.instagram&&e(T,{to:t.instagram,children:e(At,{title:"instagram"})}),t.facebook&&e(T,{to:t.facebook,children:e(It,{title:"facebook"})}),t.website&&e(T,{to:t.website,children:e(Lt,{title:"channel website"})})]}),e(_t,{activeTabKey:y!=null?y:"videos",tabs:G.map(v=>({key:v.key,to:v.to,label:v.label}))}),y==="videos"?n("div",{role:"tabpanel",children:[e("div",{css:{display:"flex"},children:e(qt,{filters:b,activeFilters:d,sortings:Q,activeSorting:c})}),k&&(p==null?void 0:p.length)===0?e(Jt,{css:{width:"100%",minHeight:0,marginBottom:"55px"}}):(p==null?void 0:p.length)===0?e(Zt,{to:"/explore/channels",header:"No videos",buttonText:"Browse All Channels",css:{width:"100%",minHeight:0,marginBottom:"55px"}}):p&&p.length>0?e(ut,{view:"channel",id:t.id,children:e(mt,{render:()=>p.map(v=>e(K,{role:"listitem",item:v,showMeta:!1,showChannelAvatar:!1,showDate:!0},v.slug))})}):e(ht,{heightToWidthRatio:J}),e(te,{hasMore:!!w,loadMore:x})]}):null,y==="playlists"?e("div",{role:"tabpanel",children:e(ye,{playlists:t.playlists})}):null,y==="store"?e("div",{role:"tabpanel",children:e(Wt,{handle:t.merch_collection})}):null]})]}):e(P,{})}const Ie=573,Le=`(max-width: ${Ie}px)`,f=`@media only screen and ${Le}`,dt=56,ct=3;function Ee({channel:t,film:i,engagement:o}){var A,I,L,E,W,v,O,_;const{user:a}=Tt(),l=a==null?void 0:a.is_subscribed,b=(A=i==null?void 0:i.trailers)==null?void 0:A[0],c=i==null?void 0:i.video,{data:d,isInitialLoading:p}=tt(c),g=We({film:i,engagement:d,isLoading:p}),w=i!=null&&i.images.creator_logo?i.images.creator_logo.width*.2:void 0,x=i!=null&&i.images.creator_logo?i.images.creator_logo.width*.325:void 0,u=i!=null&&i.images.title_image?i.images.title_image.width*.2:void 0,y=i!=null&&i.images.title_image?i.images.title_image.width*.325:void 0,h=(I=i==null?void 0:i.video)==null?void 0:I.duration,k=(L=d==null?void 0:d.progress)==null?void 0:L.value,G=(E=d==null?void 0:d.progress)==null?void 0:E.completed,z=(g==="progress"||g==="release")&&c&&l;return e("div",{css:s.wrapper,children:n("div",{css:s.heroWrapper,children:[i?e(R,{name:(v=(W=i.images.background_wide)==null?void 0:W.alt_text)!=null?v:"",image:i.images.background_wide,mobileImageBreakpoint:se,mobileImage:i.images.background_narrow,widthDefinition:"100vw",css:s.heroImage}):null,e("div",{css:s.mobileBottomRadialGradient}),e("div",{css:s.bottomLeftRadialGradient}),e("div",{css:s.bottomLinearGradient}),e("div",{css:s.ultraWideCurtainGradient}),e("div",{css:s.channelOverlayContentContainer,children:n("div",{css:s.channelOverlayContent,children:[i!=null&&i.images.creator_logo?e(R,{name:i.images.creator_logo.alt_text||"",image:i.images.creator_logo,widthDefinition:`${f} ${w}px, ${Y} ${w}px, ${x}px`,style:{"--image-width-narrow":`${w}px`,"--image-width-wide":`${x}px`},css:s.creatorLogo}):null,i!=null&&i.images.title_image?e(R,{name:i.title_image_alt_text||"",image:i.images.title_image,widthDefinition:`${f} ${u}px, ${Y} ${u}px, ${y}px`,style:{"--image-width-narrow":`${u}px`,"--image-width-wide":`${y}px`},css:s.titleImage}):e("h1",{css:s.channelTitleFallback,children:t.title}),(O=t.attributes)!=null&&O.length?e(ve,{attributes:t.attributes,css:s.channelBadge}):null,i!=null&&i.tagline?e("p",{css:s.tagline,children:i.tagline}):null,i?n("div",{css:s.metaWrapper,children:[h?n(pt,{children:[e(st,{value:h,format:"approx"}),e("span",{css:s.metaSeparator,children:"•"})]}):null,g==="billboard"||g==="trailer"?e("p",{css:s.metaAnnouncement,children:i.announcement}):(_=i.video)!=null&&_.published_at?e(ne,{value:i.video.published_at,format:"short_textdate"}):null]}):null,h&&k&&!G?n("div",{css:s.progressWrapper,children:[e("progress",{css:s.progressBar,value:Gt(k,h*ct/100,h*(1-ct/100)),max:h}),n("p",{css:s.timeLeftWrapper,children:[e(st,{value:h-k,format:"approx"})," ","left"]})]}):null,n("div",{css:s.buttonSection,children:[n("div",{css:s.actionButtonGroup,children:[e(De,{mode:g,channel:t,film:i,engagement:o,primaryMediaEngagement:d}),!z&&b?e(q,{to:`/videos/${b.slug}`,theme:"secondary",css:s.trailerButton,children:i==null?void 0:i.trailer_mode_action_text}):null]}),z?n("div",{css:s.iconButtonGroup,children:[b?e(le,{to:`/videos/${b.slug}`,css:s.iconButton,children:e(fe,{})}):null,d?e(xe,{id:c.id,bookmarked:!!d.watch_later,css:s.iconButton,tooltipEnabled:!1}):null,Ct(o)?e(it,{id:t.id,isFollowing:!!(o!=null&&o.following),variant:"icon",css:s.iconButton}):null]}):null]})]})})]})})}const s={wrapper:r({width:"100%"}),heroWrapper:r({position:"relative",minHeight:600,maxHeight:720,height:[`calc(100vh - ${dt}px)`,`calc(100svh - ${dt}px)`],maxWidth:1440,overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"flex-end",[at]:{margin:"0 auto"}}),heroImage:r({[R.fallbackSelector]:{height:"100%",objectFit:"cover",position:"absolute",top:0,left:0,width:"100%",objectPosition:"77.75% center",[f]:{objectPosition:"bottom"}}}),mobileBottomRadialGradient:r({position:"absolute",bottom:0,left:0,width:"100%",height:"100%",background:ee,display:"none",[f]:{display:"block"}}),bottomLeftRadialGradient:r({position:"absolute",top:0,left:0,width:"100%",height:"100%",background:ie,[f]:{display:"none"}}),bottomLinearGradient:r({position:"absolute",top:0,left:0,width:"100%",height:"100%",background:oe}),ultraWideCurtainGradient:r({display:"none",[at]:{display:"block"},position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:1440,height:2160,background:re}),creatorLogo:r({marginBottom:8,[R.fallbackSelector]:{maxWidth:"var(--image-width-wide)",[f]:{maxWidth:"var(--image-width-narrow)"}}}),titleImage:r({marginBottom:32,[R.fallbackSelector]:{maxWidth:"var(--image-width-wide)",[f]:{maxWidth:"var(--image-width-narrow)"}}}),channelOverlayContentContainer:r({maxWidth:kt,width:"100%",position:"relative",display:"flex",alignItems:"flex-end",paddingLeft:B,paddingRight:B}),channelOverlayContent:r({width:"100%",maxWidth:420,[f]:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:"inherit"}}),channelTitleFallback:r({marginBottom:32}),channelBadge:r({height:16,marginBottom:12,marginTop:32}),tagline:r({marginBottom:20,fontSize:14,[f]:{textAlign:"center"}}),metaWrapper:r({display:"flex",color:m.neutral0_60,lineHeight:"18px",fontSize:"14px"}),metaSeparator:r({margin:"0 8px"}),metaAnnouncement:r({color:m.neutral0,fontSize:"17px",fontWeight:M.weight.semibold}),progressWrapper:r({marginTop:24,width:"100%",display:"flex",alignItems:"center"}),progressBar:r({backgroundColor:m.neutral0_20,borderRadius:"999px",overflow:"hidden",flex:1,height:"8px",marginRight:8,"&::-webkit-progress-bar":{backgroundColor:m.neutral0_20},"&::-webkit-progress-value":{backgroundColor:m.neutral0},"&::-moz-progress-bar":{backgroundColor:m.neutral0}}),timeLeftWrapper:r({whiteSpace:"nowrap",color:m.neutral0_60,fontSize:"14px",lineHeight:"18px"}),buttonSection:r({marginTop:24,paddingBottom:8,display:"flex",alignItems:"center",width:"100%",[f]:{flexDirection:"column"}}),actionButtonGroup:r({display:"flex",flex:0,alignItems:"center",width:"100%",[f]:{flexDirection:"column-reverse"}}),actionButton:r({height:48,fontSize:"14px",lineHeight:"18px",padding:"0 44px",backgroundColor:m.neutral0,borderColor:m.neutral0,color:m.neutral950,justifyContent:"center",whiteSpace:"nowrap","> svg":{marginRight:4,color:m.neutral950},[`&:hover, ${ae}`]:{backgroundColor:m.neutral50,borderColor:m.neutral0,color:m.neutral950},"&:active":{backgroundColor:m.neutral100},[f]:{width:"100%",marginRight:0,marginBottom:20}}),trailerButton:r({marginLeft:8,height:48,fontSize:"14px",lineHeight:"18px",padding:"0 44px",borderColor:"white",color:"white",marginRight:20,whiteSpace:"nowrap","&:hover":{backgroundColor:m.neutral0_05},[f]:{width:"100%",marginLeft:0,marginRight:0,marginBottom:20}}),iconButtonGroup:r({marginLeft:20,display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:20,[f]:{width:"100%",justifyItems:"center"}}),iconButton:r({width:48,height:48,padding:0,background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:"none",color:m.neutral0,"&:hover, &:focus-visible":{background:"transparent"}})};function We({film:t,engagement:i,isLoading:o}){var a;if(!(!t||o))return t.video?(a=i==null?void 0:i.progress)!=null&&a.value?"progress":"release":t.trailers.length?"trailer":"billboard"}function De({mode:t,channel:i,film:o,engagement:a,primaryMediaEngagement:l}){var x;const b=bt(),{user:c}=Tt(),d=c==null?void 0:c.is_subscribed,p=(x=l==null?void 0:l.progress)==null?void 0:x.completed,g=o==null?void 0:o.video,w=(t==="progress"||t==="release")&&g;if(!b)return e(q,{to:"/join",theme:"hero",css:s.actionButton,children:"Sign Up"});if(!d||t==="billboard"||t==="trailer")return e(it,{id:i.id,isFollowing:!!(a!=null&&a.following),variant:"icon_and_text",css:s.actionButton});if(w){let u="";return t==="progress"&&p?u=o==null?void 0:o.release_mode_watch_again_action_text:t==="progress"?u=o==null?void 0:o.progress_mode_action_text:u=o==null?void 0:o.release_mode_action_text,e(q,{to:`/videos/${g.slug}`,theme:"hero",css:s.actionButton,children:u})}return null}const ot=S.forwardRef(function({title:i,children:o,...a},l){return n("div",{ref:l,...a,children:[e("h2",{css:He.title,children:i}),o]})}),He={title:r({marginTop:0,marginBottom:"16px",fontSize:"17px",lineHeight:"21px",fontWeight:M.weight.semibold})},gt=4;function Pe({title:t,entries:i,className:o}){const a=i.length>gt,[l,b]=S.useState(!1),c=S.useId(),d=S.useRef(null),p=S.useContext(ce);return e(ot,{title:t,className:o,ref:d,style:{scrollMarginTop:p},children:n("div",{css:F.wrapper,id:c,"aria-expanded":l,children:[i.map((g,w)=>n("div",{css:w>=gt?F.collapsableEntry:void 0,children:[e("h5",{css:F.role,children:g.role}),e("div",{children:g.people.map((x,u)=>n(S.Fragment,{children:[n("span",{css:F.name,children:[x,u===g.people.length-1?"":","]})," "]},x))})]},g.role)),a?e("div",{css:F.collapseButtonCell,children:e("button",{onClick:()=>{var g;l&&((g=d.current)==null||g.scrollIntoView({block:"nearest"})),b(w=>!w)},css:F.collapseButton,"aria-controls":c,type:"button",children:l?"Show less":"Show all"})}):null]})})}const F={wrapper:r({display:"grid",gap:"16px 24px",gridTemplateColumns:"1fr 1fr",[C]:{gap:"16px 16px",gridTemplateColumns:"1fr"}}),role:r({marginTop:0,marginBottom:"8px",color:$.label400,fontSize:"14px",lineHeight:"18px",fontWeight:M.weight.medium}),name:r({display:"inline-block"}),collapseButtonCell:r({gridColumn:"1/-1",[C]:{display:"none"},[D]:{display:"none"}}),collapseButton:r({textTransform:"uppercase",fontSize:"12px",color:m.blue400,fontWeight:M.weight.medium,lineHeight:"16px",[de]:{"&:hover":{color:m.blue600}}}),collapsableEntry:r({display:"none",'[aria-expanded="true"] &':{display:"block"},[C]:{display:"block"},[D]:{display:"block"}})};function $e({playlists:t}){return t?e(pt,{children:t.filter(i=>i.items.length).map(i=>e(Z,{title:i.title,css:Ge.conveyorSection,children:e(j,{size:i.size,children:i.items.map((o,a)=>e(K,{item:o,"aria-setsize":i.items.length,"aria-posinset":a,engagementUI:i.size==="large"?"followButton":"contextMenu",role:"listitem"},o.id))})},i.id))}):null}const Ge={conveyorSection:r({padding:0,marginBottom:"40px",[C]:{marginBottom:"20px"}})};function ze({channel:t,className:i}){return e(ot,{title:"Social Links",className:i,children:n("div",{css:N.wrapper,children:[t.twitter&&e(T,{to:t.twitter,css:N.linkIcon,children:e(Bt,{title:"twitter"})}),t.patreon&&e(T,{to:t.patreon,css:N.linkIcon,children:e(Rt,{title:"patreon"})}),t.instagram&&e(T,{to:t.instagram,css:N.linkIcon,children:e(At,{title:"instagram"})}),t.facebook&&e(T,{to:t.facebook,css:N.linkIcon,children:e(It,{title:"facebook"})}),t.website&&e(T,{to:t.website,css:N.linkIcon,children:e(Lt,{title:"channel website"})})]})})}function Fe(t){return!!t&&!!(t.twitter||t.patreon||t.instagram||t.facebook||t.website)}const N={wrapper:r({marginBottom:"40px",display:"flex",flexFlow:"row wrap",[C]:{marginBottom:"20px"}}),linkIcon:r({backgroundColor:$.systemFill,borderColor:$.systemFill,":last-of-type":{marginRight:0}})},Ne=["tab"];function Me({channel:t,isLoadingFullChannel:i}){var A,I,L,E,W,v,O;const{channel:o,error:a,isInitialLoading:l,isPlaceholderData:b}=wt({id:t==null?void 0:t.id,ssrEnabled:!0}),c=l||b,{data:d}=tt(t),p=Fe(t),g=!!((A=o==null?void 0:o.channel_playlists)!=null&&A.length),w=!!(t!=null&&t.description)||!!((L=(I=o==null?void 0:o.film)==null?void 0:I.credits)!=null&&L.entries.length)||p||g,x=!!((W=(E=o==null?void 0:o.film)==null?void 0:E.extras)!=null&&W.some(_=>_.items.length)),u=!!(t!=null&&t.merch_collection),y=i||c||w?"details":x?"extras":u?"store":void 0,[h,k]=xt("tab",{defaultValue:y,allowedValues:[i||c||w?"details":null,i||c||x?"extras":null,i||c||u?"store":null].filter(X)}),G=S.useMemo(()=>[w?{key:"details",label:"Details",to:k("details")}:null,x?{key:"extras",label:"Extras",to:k("extras")}:null,u?{key:"store",label:"Store",to:k("store")}:null].filter(X),[k,w,x,u]),z=et({url:`/${t.slug}`,title:t.title,description:((v=o==null?void 0:o.film)==null?void 0:v.tagline)||t.description,image:{src:vt({image:(O=t.images)==null?void 0:O.featured,width:1280,format:"jpeg"}),width:1280,height:720},twitter:t.twitter?{creator:Et(t.twitter)}:void 0,canonicalQueryParams:Ne});return a?n(P,{colorScheme:"dark",children:[e(U,{defer:!1,children:e("title",{children:"Error"})}),e(ft,{error:a})]}):!t||!(o!=null&&o.film)?e(P,{colorScheme:"dark"}):n(P,{colorScheme:"dark",children:[n(U,{defer:!1,children:[e("title",{children:t.title}),z,e("link",{rel:"alternate",type:"application/rss+xml",href:new URL(`video/channels/${t.slug}.rss`,V.NEBULA_RSS_BASE_URL).toString(),title:`Latest Videos of ${t.title}`}),e("link",{rel:"alternate",type:"application/rss+xml",href:new URL(`video/channels/${t.slug}.rss?plus=true`,V.NEBULA_RSS_BASE_URL).toString(),title:`Latest Plus Videos of ${t.title}`})]}),e(Ee,{channel:t,film:o==null?void 0:o.film,engagement:d}),n(St,{as:"main",css:H.belowHeroContainer,children:[G.length>1?e(_t,{activeTabKey:h!=null?h:"details",css:H.linkTabs,tabs:G.map(_=>({key:_.key,to:_.to,label:_.label}))}):e("div",{css:H.emptyTabsSpacer}),h==="details"?n("div",{role:"tabpanel",children:[n("div",{css:H.descriptionAndCreditsGroup,children:[t.description?e(ot,{title:"Description",css:H.description,children:e("div",{children:t.description})}):null,o.film.credits?e(Pe,{title:o.film.credits.title,entries:o.film.credits.entries,css:H.credits}):null,p?e(ze,{channel:t}):null]}),g?e($e,{playlists:o.channel_playlists}):null]}):null,h==="extras"?e("div",{role:"tabpanel",children:o.film.extras.filter(_=>_.items.length).map(({id:_,title:Dt,items:Ht,size:Pt})=>e(Z,{contentId:_,title:Dt,css:H.conveyorSection,children:e(j,{size:Pt,children:Ht.map(rt=>e(K,{item:rt,showDate:!0},rt.id))})},_))}):null,h==="store"?e("div",{role:"tabpanel",children:e(Wt,{handle:t.merch_collection})}):null]})]})}const H={belowHeroContainer:r({paddingLeft:B,paddingRight:B,maxWidth:kt,width:"100%",[C]:{paddingLeft:B,paddingRight:B}}),linkTabs:r({"> nav":{[f]:{display:"flex",justifyContent:"center"}}}),emptyTabsSpacer:r({height:"24px"}),conveyorSection:r({padding:0,marginBottom:"40px",[C]:{marginBottom:"20px"}}),descriptionAndCreditsGroup:r({marginBottom:"40px",display:"grid",gap:"20px",gridTemplateColumns:"1fr 1fr",gridTemplateRows:"max-content",[C]:{marginBottom:"20px",gridTemplateColumns:"1fr"},[D]:{marginBottom:"20px",gridTemplateColumns:"1fr"}}),description:r({paddingRight:"40px",[C]:{paddingRight:0},[D]:{paddingRight:0}}),credits:r({gridColumn:"2",gridRow:"1/3",[C]:{gridColumn:"auto",gridRow:"auto"},[D]:{gridColumn:"auto",gridRow:"auto"}})},Oe=300,Ue=["tab",...yt];function Je({staticContext:t}){t&&(t.cacheDuration=Oe);const{slug:i}=zt(),{data:o,error:a,isInitialLoading:l,isPlaceholderData:b}=ge({slug:i}),c=(o==null?void 0:o.type)==="video_channel"?o:void 0,d=l||b;pe(a),ue({refContent:c});const p=et({url:`/${i}`,canonicalQueryParams:Ue}),g=he("channel-work");return c?g&&c.channel_type==="film"?e(Me,{channel:c,isLoadingFullChannel:d}):e(Ae,{channel:c,isLoadingFullChannel:d}):e(P,{children:e(U,{defer:!1,children:p})})}export{Je as default};