1import{a as e}from"./DH_oPWig.js";import{D as t,E as n,at as r,nt as i,qt as a,st as o,w as s,wt as c,zt as l}from"./BaBhFZm2.js";import{t as u}from"./C1a0ecns.js";import{xt as d}from"./CdJD1KMg2.js";import"./Cfq-ywX32.js";import{t as f}from"./DPjApvqA2.js";var p={__name:`SNGVideos`,props:{theme:{type:String,default:`light-theme`,validator:function(e){return[`light-theme`,`dark-theme`].includes(e)}},wrapper:Boolean,moduleTitle:{type:String,required:!1,default:`All Videos`},id:{type:Number,required:!1},type:{type:String,default:`recent`,validator:function(e){return[`related`,`trending`,`recent`].includes(e)}},dataType:{type:String,default:`all`,validator:function(e){return[`sport`,`story`,`all`].includes(e)}},sponsorContentConfig:{type:Object,default:()=>({show:!1,src:``,content:``,position:3,backgroundColor:``})},sponsorLogoConfig:{type:Object,default:()=>({show:!0,src:null,stack:!1})},callToActionConfig:{type:Object,default:()=>({show:!0,text:`All Videos`,url:`/watch`})},orientationConfig:{type:Object,required:!1,default:()=>({mobile:{orientation:`top`,rows:1,count:4},tablet:{orientation:`top`,rows:2,count:4},desktopFull:{orientation:`top`,rows:1,count:4},desktopRail:{orientation:`left`,rows:1,count:4},desktopNoRail:{orientation:`top`,rows:1,count:4}})},hideOnEmpty:{type:Boolean,default:!1},loadMoreEnabled:Boolean,_id:String},setup(p){let m=f(),h=u(),{$customFetch:g}=e(),_=l(!1),v=p,y=l(v.type),b=l(v.dataType),x=s(()=>m.getLoadingVideosFlag),S=l(1),C=l(`top`),w=l(4),T=l(1),E=()=>{let e=w.value*S.value;return{id:v.id||0,count:e,page:T.value}},D=s(()=>{if(y.value===`related`){if(b.value===`sport`)return{sportId:v.id};if(b.value===`story`)return{storyId:v.id}}}),O=s(()=>{let e=y.value===`related`?b.value===`story`?m.getVideosByStoryId(v.id??0):m.getVideosBySport(v.id??0):m.getLatestVideos;return e?.items?.length?e?.items?.length?e.items:[]:m.getLatestVideos?.items?.length?m.getLatestVideos.items:[]});o(`videos`,s(()=>O.value)),o(`isLoading`,s(()=>x.value));let k=s(()=>m.getVideosSettings(D.value)),A=s(()=>({...v.callToActionConfig,url:k.value?.watchButtonUrl??`/watch`})),j=s(()=>h.getGoogle360Settings),M=s(()=>j?.value?.isRelatedVideosComponentEnabled??!0),N=async()=>{await m.fetchVideosBySport({payload:E(),fetch:g});let e=m.getVideosBySport(v.id??0);e&&(_.value=e&&e.items.length>0&&T.value<e.pages)},P=async()=>{await m.fetchVideosByStoryId({payload:E(),fetch:g});let e=m.getVideosByStoryId(v.id??0);e&&(_.value=e&&e.items.length>0&&T.value<e.pages)},F=async()=>{await m.fetchLatestVideos({payload:E(),fetch:g});let e=m.getLatestVideos;e&&(_.value=e&&e.items&&e.items.length>0&&T.value<e.pages)},I=async()=>{await m.fetchVideoSettings({payload:D.value,fetch:g})},L=async()=>{T.value+=1,await R(),await z()},R=async()=>{try{if(!M.value)return;y.value===`related`&&(b.value===`sport`&&await N(),b.value===`story`&&await P()),y.value===`recent`&&b.value===`all`&&await F()}catch{}},z=async()=>{M.value&&!O.value?.length&&y.value===`related`&&await F()};c(()=>v.id,async()=>{await Promise.all([I(),R()]),await z()}),i(async()=>{await Promise.all([I(),R()]),await z()});let B=s(()=>v.hideOnEmpty?O.value.length>0&&M.value:M.value);return(e,i)=>a(B)?(r(),n(a(d),{key:0,orientation:a(C),orientationConfig:p.orientationConfig,rows:a(S),count:a(w),moduleTitle:p.moduleTitle,sponsorLogoConfig:p.sponsorLogoConfig,sponsorContentConfig:p.sponsorContentConfig,callToActionConfig:a(A),hasMoreToLoad:a(_),wrapper:p.wrapper,loadMoreEnabled:p.loadMoreEnabled,onLoadMore:L},null,8,[`orientation`,`orientationConfig`,`rows`,`count`,`moduleTitle`,`sponsorLogoConfig`,`sponsorContentConfig`,`callToActionConfig`,`hasMoreToLoad`,`wrapper`,`loadMoreEnabled`])):t(``,!0)}};export{p as t};
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.