PageSourceSearch

https://folsomfieldevents.com/_nuxt/DSQpoY6-2.js

js folsomfieldevents.com collected 2026-09-29 11:45:01 UTC 6,063 bytes, 1 lines download raw bytes

1import{a as e}from"./DH_oPWig.js";import{dt as t,nt as n,qt as r,w as i}from"./BaBhFZm2.js";import{n as a}from"./CU89Zi3L.js";import{nt as o}from"./DGJ9b2SS.js";import{I as s,Nt as c,Pt as l,a as u,n as d,nt as f,t as p}from"./BF2bkrIi.js";import{i as m,r as h}from"./Du7LGN_12.js";import{t as g}from"./Co-zLA7R2.js";import{t as _}from"./cSMOfzbK2.js";var v=e=>{let t=`props`in e?e.props:e;return{sportId:`sport_id`in t?t.sport_id==`0`?void 0:t.sport_id:`sportId`in t?t.sportId:void 0,locationIndicator:`extra`in t&&t.extra?.location_indicator?t.extra.location_indicator:`locationIndicator`in t?t.locationIndicator:void 0,gameId:`extra`in t&&t.extra?.game_id?t.extra.game_id:`gameId`in t?t.gameId:void 0,spotLight:`extra`in t&&t.extra?.spotlight?t.extra.spotlight:`spotLight`in t?t.spotLight:void 0,streamingProvider:`extra`in t&&t.extra?.streaming_provider?t.extra.streaming_provider:`streamingProvider`in t?t.streamingProvider:void 0,ticketedOnly:`ticketedOnly`in t?t.ticketedOnly:void 0,withCoverageOnly:`withCoverageOnly`in t?t.withCoverageOnly:void 0,groupedByDates:`groupedByDates`in t?t.groupedByDates:void 0,startDate:`startDate`in t?t.startDate:void 0,endDate:`endDate`in t?t.endDate:void 0,pageIndex:`pageIndex`in t?t.pageIndex:void 0,pageSize:`pageSize`in t?t.pageSize:void 0}},y=class{fetch;resource=`/api/v2.1/EventsResults/upcoming`;constructor({fetch:e}){this.fetch=e}async get(e){let t=v(e),n=`props`in e&&`start`in e.props?e.props.start:void 0,r=`props`in e&&`count`in e.props?e.props.count:void 0,i;return(n||r)&&(i=new p(n,r),t.pageIndex=i.pageIndex,t.pageSize=i.pageSize),this.fetch(this.resource,{params:t}).then(e=>{if(!e)return[];let t=e.items?.map(e=>c(e));return i?i.getData(t):t}).catch(e=>(console.error(`[EventRepo] get() Request error caught`,e),[]))}},b=class{fetch;resource=`/api/v2/LiveStats`;constructor({fetch:e}){this.fetch=e}async getLiveStats(){return this.fetch(this.resource,{timeout:5e3}).then(e=>s(e?.Games??[])).catch(e=>(console.error(`[LiveStatsRepo] getLiveStats() Request error failed`,e),null))}async getGameLiveStats(e){return this.fetch(`${this.resource}/details`,{params:{gameId:e},timeout:5e3}).then(e=>e).catch(e=>(console.error(`[LiveStatsRepo] getGameLiveStats() Request error failed`,e),null))}},x=a(`live-stats`,{state:()=>({liveStats:null,detailedLiveStats:{},isLoading:!1}),actions:{async fetchLiveStats({fetch:e}){if(!this?.liveStats){let t=await new b({fetch:e}).getLiveStats();this.liveStats=t}},async fetchDetailedLiveStats({gameId:e,fetch:t}){let n=o(`gameId_${e}`);if(!(n in this.detailedLiveStats)){let r=await new b({fetch:t}).getGameLiveStats(e);this.detailedLiveStats[n]=r}}},getters:{getLiveStats(e){return e.liveStats},getLoadingFlag(e){return e.isLoading},statsAvailable(e){return!!(e.liveStats&&Object.keys(e.liveStats)?.length)},getLiveStatsByGameId:e=>t=>{if(e.liveStats&&t in e.liveStats&&e.liveStats[t]&&e.liveStats[t]?.HasStarted&&!e.liveStats[t]?.IsComplete)return e.liveStats[t]},getDetailedLiveStatsByGameId:e=>t=>{let n=o(`gameId_${t}`);return n in e.detailedLiveStats?e.detailedLiveStats[n]:null}}}),S=a(`event`,{state:()=>({events:{},isLoading:{},isLoadingMore:{},moreToLoad:{}}),actions:{async fetchEvents(e){let{fetch:t,...n}=e;if(!(e.hash in this.events)){this.isLoading[e.hash]=!0;let r=await new y({fetch:t}).get(n);this.events[e.hash]=r,this.isLoading[e.hash]=!1}this.fetchGameCenterLiveGames({payload:n,fetch:t})},async fetchMoreEvents(e){let{fetch:t,...n}=e;this.isLoadingMore[e.hash]=!0;let r=await new y({fetch:t}).get(n),{props:i}=e;(!r||!r.length||r.length&&i.count&&r.length<i.count)&&(this.moreToLoad[e.hash]=!1),e.hash in this.events&&(this.events[e.hash]=[...this.events[e.hash]??[],...r]),this.isLoadingMore[e.hash]=!1},async fetchEventsLiveStats(e){let t=this.getEvents(e.hash);if(!t||!t?.length)return;let n=x();if(n.statsAvailable||await n.fetchLiveStats({fetch:e.fetch}),n.statsAvailable)for(let r of t){let t=n.getLiveStatsByGameId(r.id??0);if(!t||!Object.keys(t)?.length)continue;let i=null;e?.props?.extra&&Object?.keys(e.props.extra)?.length&&`detailedLiveStats`in e.props.extra&&e.props.extra.detailedLiveStats&&(await n.fetchDetailedLiveStats({gameId:r.id??0,fetch:e.fetch}),i=n.getDetailedLiveStatsByGameId(r.id??0));let a=this.events[e.hash]?.findIndex(e=>e&&e.id===r.id);if(a!==void 0&&a>-1){let n=this.events[e.hash]?.[a],r=f(t,n?.location_indicator);i&&(r=u(r,i)),this.events?.[e.hash]&&this.events[e.hash]?.length&&this.events?.[e.hash]?.[a]&&(this.events[e.hash][a]={...n,is_live:!0,livestats:r})}}},async fetchGameCenterLiveGames({payload:e,fetch:t}){let n=this.getEvents(e.hash);if(!n||!n?.length)return;let r=g();if(r.liveGamesAvailable||await r.fetchLiveGames({fetch:t}),r.liveGamesAvailable)for(let t of n){let n=r.getLiveGameById(t.id??0);if(!n||!Object.keys(n)?.length)continue;let i=this.events[e.hash]?.findIndex(e=>e&&e.id===t.id);if(i!==void 0&&i>-1){let t=this.events[e.hash]?.[i];this.events?.[e.hash]&&this.events[e.hash]?.length&&this.events?.[e.hash]?.[i]&&t&&(n.game_state===d.Live||t.game_state!==n.game_state)&&(this.events[e.hash][i]={...t,is_live:n.game_state===d.Live,livestats:n.game_state===d.Live?l(n):null})}}}},getters:{getEvents:e=>t=>t in e.events?e.events[t]:[],getLoadingMoreFlag:e=>t=>t in e.isLoadingMore?e.isLoadingMore[t]??!1:!1,getLoadingFlag:e=>t=>t in e.isLoading?e.isLoading[t]??!1:!1,getMoreToLoad:e=>t=>t in e.moreToLoad?e.moreToLoad[t]??!0:!0}}),C={__name:`EventsComponent`,props:{...h},setup(a){let o=S(),s=a,{$customFetch:c}=e(),{initialize:l,loadMore:u,getComponentData:d,currentSportId:f,config:p,hash:h}=m({props:s,fetch:c}),{sports:g,selectedSport:v,updateSport:y}=_(s,f,d,o.fetchEvents),b=i(()=>o.getEvents(h())),x=i(()=>o.getMoreToLoad(h())),C=i(()=>o.getLoadingMoreFlag(h())),w=i(()=>o.getLoadingFlag(h()));return n(async()=>{await d(o.fetchEvents),l(o.fetchMoreEvents)}),(e,n)=>t(e.$slots,`content`,{data:r(b),config:r(p),loadMore:r(u),moreToLoad:r(x
1),isLoadingMore:r(C),isLoading:r(w),currentSportId:r(f),sports:r(g),selectedSport:r(v),updateSport:r(y)})}};export{y as i,S as n,x as r,C 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.