PageSourceSearch

https://cfdcapitals-customer-staging.pages.dev/assets/EventDetail-700ff253.js

js cfdcapitals-customer-staging.pages.dev collected 2026-10-03 05:39:13 UTC 12,344 bytes, 1 lines download raw bytes

1import{k as e,w as p,r as S,aj as U,bd as L,u as F}from"./vendor-fde08b4e.js";import{cz as f,cA as z,cq as R,cp as V}from"./index-16e63008.js";import{f as G,u as H,c as P,C as w}from"./BettingShell-68d0b89f.js";import{u as Q}from"./useCountdown-54b4e83b.js";import"./lodash-28086013.js";import"./analytics-33c9f049.js";import"./gsap-54c24ddd.js";const W=s=>s>=1e3?`$${(s/1e3).toFixed(1)}k`:`$${s.toFixed(0)}`;function _({outcome:s,isSelected:a,onClick:r,disabled:t,isPoolMode:m}){const g=s.poolOdds!=null,h=g||m,u=g?s.poolOdds:s.odds;return e.jsxs("button",{onClick:r,disabled:t,className:p("flex flex-col items-center justify-center rounded-xl border px-3 py-2.5 transition-all text-center min-w-0 min-h-[48px]",{"bg-[#B0D136] border-[#A0C516]":a&&!t,"bg-gray-100 dark:bg-[#2e2e2e] border-gray-200 dark:border-[#2e2e2e] hover:bg-gray-200 dark:hover:bg-[#2e2e2e]":!a&&!t,"bg-gray-50 dark:bg-[#242424]/50 border-gray-200 dark:border-[#2e2e2e] cursor-not-allowed opacity-50":t}),children:[e.jsx("span",{className:p("text-xs truncate w-full",{"text-[#103A06]":a&&!t,"text-gray-500 dark:text-white/60":!a&&!t,"text-gray-400 dark:text-white/30":t}),children:s.name}),e.jsx("span",{className:p("text-sm font-bold mt-0.5",{"text-[#103A06]":a&&!t,"text-gray-900 dark:text-white":!a&&!t,"text-gray-400 dark:text-white/30":t}),children:G(u)}),h&&s.totalBetAmount!=null&&s.totalBetAmount>0&&e.jsxs("span",{className:p("text-[10px] mt-0.5",{"text-[#103A06]/70":a&&!t,"text-gray-400 dark:text-white/30":!a&&!t,"text-gray-300 dark:text-white/30":t}),children:["Pool: ",W(s.totalBetAmount)]})]})}const q={[f.OPEN]:void 0,[f.SUSPENDED]:{label:"Suspended",className:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300"},[f.CLOSED]:{label:"Closed",className:"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"},[f.SETTLED]:{label:"Settled",className:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300"},[f.VOID]:{label:"Void",className:"bg-red-100 text-red-600 dark:bg-red-900/40 dark:text-red-300"}},K=s=>s>=1e3?`$${(s/1e3).toFixed(1)}k`:`$${s.toFixed(0)}`;function Y({market:s,selectedOutcomeIds:a,pendingBetMarketIds:r,onSelectOutcome:t,defaultExpanded:m=!0,isBettingDisabled:g}){const[h,u]=S.useState(m),b=q[s.status],j=(r==null?void 0:r.has(s.id))??!1,x=s.status!==f.OPEN||j||!!g,o=s.poolCutPercentage!=null&&s.poolCutPercentage>0||s.outcomes.some(d=>d.poolOdds!=null),N=s.outcomes.length,v=N===2?2:N===3?3:2;return e.jsxs("div",{className:"rounded-xl border border-gray-200 dark:border-[#2e2e2e] bg-white dark:bg-[#242424] overflow-hidden",children:[e.jsxs("button",{onClick:()=>u(d=>!d),className:"flex w-full items-center justify-between px-4 py-3 hover:bg-gray-100 dark:hover:bg-[#2e2e2e] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:s.name}),b&&e.jsx("span",{className:p("px-2 py-0.5 rounded-full text-xs font-medium",b.className),children:b.label}),o&&e.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",children:"Pool"}),j&&e.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-[#B0D136]/25 text-[#103A06] dark:bg-[#103A06]/40 dark:text-[#B0D136]",children:"Pending bet"})]}),e.jsx(U,{className:p("h-5 w-5 text-gray-400 dark:text-white/30 transition-transform duration-200",h?"-rotate-180":"rotate-0")})]}),h&&e.jsxs("div",{className:"px-4 pb-4",children:[e.jsx("div",{className:p("grid gap-2",{"grid-cols-2":v===2,"grid-cols-3":v===3}),children:s.outcomes.map(d=>e.jsx(_,{outcome:d,isSelected:a.has(d.id),onClick:()=>t(d),disabled:x,isPoolMode:o},d.id))}),o&&s.totalPool!=null&&e.jsxs("div",{className:"mt-2 text-xs text-gray-400 dark:text-white/30 text-right",children:["Total pool: ",K(s.totalPool)]})]})]})}function J({categories:s,activeCategory:a,onSelect:r}){return e.jsx("div",{className:"flex gap-0 bg-white dark:bg-[#242424] border-b border-gray-200 dark:border-[#2e2e2e] px-3 overflow-x-auto scrollbar-hide",children:s.map(t=>e.jsx("button",{onClick:()=>r(t),className:p("px-3 py-2.5 text-[11px] font-medium whitespace-nowrap transition-colors",{"text-[#103A06] dark:text-[#B0D136] font-bold border-b-2 border-[#B0D136]":t===a,"text-gray-400 dark:text-white/30 hover:text-gray-600 dark:hover:text-white/80":t!==a}),children:t},t))})}const X=["All","Innings","Overs","Player","Specials"],Z=[{pattern:/1st Half/i,category:"Innings"},{pattern:/Opening Partnership/i,category:"Innings"},{pattern:/Fall of/i,category:"Overs"},{pattern:/Handicap/i,category:"Overs"},{pattern:/Top Performer/i,category:"Player"},{pattern:/Player/i,category:"Player"},{pattern:/Super Over/i,category:"Specials"},{pattern:/Odd.*Even/i,category:"Specials"},{pattern:/Winning Margin/i,category:"Specials"}];function ee(s){for(const a of Z)if(a.pattern.test(s))return a.category;return"Specials"}function te(s){const a=new Map;a.set("All",[...s]);for(const r of s){const t=ee(r.name),m=a.get(t);m?m.push(r):a.set(t,[r])}return X.filter(r=>a.has(r)&&a.get(r).length>0).map(r=>({category:r,markets:a.get(r)}))}const se=s=>new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function ce({oddsKey:s=0}){var O,E;const{eventId:a}=L(),r=F(),{data:t,isLoading:m}=z(Number(a)||0),{data:g}=R(),{selections:h,toggleSelection:u}=H(),[b,j]=S.useState("All"),x=t?new Date>new Date(t.bettingEndTime):!1,o=t?t.isBettingOpen===!1:!1,N=S.useCallback((i,y)=>{x||o||u({outcome:i,eventName:(t==null?void 0:t.name)??"",marketName:y})},[t==null?void 0:t.name,u,x,o]),v=new Set(h.map(i=>i.outcome.id)),d=new Set(g??[]),B=t?te(t.markets):[],k=B.map(i=>i.category),C=k.includes(b)?b:k[0]??"All",A=B.filter(i=>i.category===C),n=t?P(t.homeClub):null,l=t?P(t.awayClub):null,D=((O=t==null?void 0:t.homeClub)==null?void 0:O.name)||"",I=((E=t==null?void 0:t.awayClub)==null?void 0:E.name)||"",$=(t==null?void 0:t.status)===V.LIVE,c=Q(t==null?void 0:t.bettingEndTime),T=!x&&!o&&c.total>0;return m?e.jsxs("div",{className:"p-4 animate-pulse space-y-4",children:[e.jsx("div",{className:"h-40 bg-white dark:bg-[#242424] rounded-2xl"}),e.jsx("div",{className:"h-10 bg-white dark:bg-[#242424] rounded-lg w-3/4"}),e.jsx("div",{className:"h-28 bg-white dark:bg-[#242424] rounded-xl"}),e.jsx("div",{className:"h-28 bg-white dark:bg-[#242424] rounded-xl"})]}):t?e.jsxs(e.Fragment,{children:[n&&l&&e.jsxs("div",{className:"mx-3 mt-3 rounded-2xl overflow-hidden relative",style:{background:`linear-gradient(135deg, ${n.primary} 0%, ${n.primary} 45%, ${l.primary} 55%, ${l.primary} 100%)`},children:[e.jsx("div",{className:"absolute inset-0 bg-black/65"}),e.jsxs("div",{className:"relative px-3 py-2.5 sm:px-4 sm:py-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"min-w-0",children:[$?e.jsxs("span",{className:"inline-flex items-center gap-1 bg-red-600 text-white text-[10px] font-bold px-2 py-0.5 rounded",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"LIVE"]}):e.jsx("span",{className:"text-white/60 text-[10px] font-medium",children:se(t.startTime)}),t.venue&&e.jsx("p",{className:"text-white/40 text-[9px] truncate mt-0.5",children:t.venue.split(",")[0]})]}),T?e.jsx("div",{className:`flex items-center rounded-lg px-1.5 py-1 sm:px-2.5 sm:py-1.5 border ${c.total<3e5?"bg-red-600/30 border-red-400/40":"bg-black/30 border-white/10"} backdrop-blur-sm flex-shrink-0`,children:e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:`text-[7px] sm:text-[8px] font-semibold uppercase tracking-wider ${c.total<3e5?"text-red-300":"text-amber-400"}`,children:"Bets close in"}),e.jsxs("div",{className:"flex items-center gap-0.5 font-mono text-[11px] sm:text-[12px] font-bold text-white tabular-nums",children:[c.d>0&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:[c.d,e.jsx("span",{className:"text-white/50 text-[9px] sm:text-[10px] font-normal",children:"d"})]}),e.jsx("span",{className:"text-white/30",children:":"})]}),e.jsxs("span",{children:[String(c.h).padStart(2,"0"),e.jsx("span",{className:"text-white/50 text-[9px] sm:text-[10px] font-normal",children:"h"})]}),e.jsx("span",{className:"text-white/30",children:":"}),e.jsxs("span",{children:[String(c.m).padStart(2,"0"),e.jsx("span",{className:"text-white/50 text-[9px] sm:text-[10px] font-normal",children:"m"})]}),e.jsx("span",{className:"text-white/30",children:":"}),e.jsxs("span",{className:c.total<3e5?"text-red-400":"",children:[String(c.s).padStart(2,"0"),e.jsx("span",{className:"text-white/50 text-[9px] sm:text-[10px] font-normal",children:"s"})]})]})]})}):x?e.jsx("span",{className:"text-red-300/80 text-[10px] font-medium flex-shrink-0",children:"Betting closed"}):o?e.jsx("span",{className:"text-[#B0D136]/80 text-[10px] font-medium flex-shrink-0",children:"Betting opens soon"}):null]}),e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex-1 text-center min-w-0",children:[e.jsxs("div",{className:"flex justify-center",children:[e.jsx("div",{className:"hidden sm:block",children:e.jsx(w,{abbreviation:n.abbreviation,primaryColor:n.primary,textColor:n.text,size:"xl",logoUrl:n.logoUrl})}),e.jsx("div",{className:"sm:hidden",children:e.jsx(w,{abbreviation:n.abbreviation,primaryColor:n.primary,textColor:n.text,size:"lg",logoUrl:n.logoUrl})})]}),e.jsx("div",{className:"text-[10px] sm:text-[11px] font-medium mt
1-1 truncate px-1",style:{color:n.text},children:D})]}),e.jsxs("div",{className:"text-center px-2 sm:px-3 flex-shrink-0",children:[e.jsx("div",{className:"text-xs sm:text-sm text-white/50 font-semibold",children:"VS"}),e.jsx("div",{className:"text-base sm:text-lg font-extrabold text-white",children:"—"})]}),e.jsxs("div",{className:"flex-1 text-center min-w-0",children:[e.jsxs("div",{className:"flex justify-center",children:[e.jsx("div",{className:"hidden sm:block",children:e.jsx(w,{abbreviation:l.abbreviation,primaryColor:l.primary,textColor:l.text,size:"xl",logoUrl:l.logoUrl})}),e.jsx("div",{className:"sm:hidden",children:e.jsx(w,{abbreviation:l.abbreviation,primaryColor:l.primary,textColor:l.text,size:"lg",logoUrl:l.logoUrl})})]}),e.jsx("div",{className:"text-[10px] sm:text-[11px] font-medium mt-1 truncate px-1",style:{color:l.text},children:I})]})]})]})]}),k.length>0&&e.jsx("div",{className:"sticky top-[45px] z-10",children:e.jsx(J,{categories:k,activeCategory:C,onSelect:j})}),o&&!x&&e.jsx("div",{className:"mx-3 mt-3 rounded-lg bg-[#B0D136]/10 dark:bg-[#103A06]/30 border border-[#B0D136]/40 dark:border-[#103A06] px-4 py-2.5 text-center",children:e.jsx("p",{className:"text-sm font-medium text-[#103A06] dark:text-[#B0D136]",children:"Betting will open soon for this event"})}),x&&e.jsx("div",{className:"mx-3 mt-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 px-4 py-2.5 text-center",children:e.jsx("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Betting is currently closed for this event"})}),e.jsx("div",{className:"p-3 space-y-4 pb-20",children:t.markets.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-sm text-gray-400 dark:text-white/30",children:"No markets available for this event."})}):A.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-sm text-gray-400 dark:text-white/30",children:"No markets in this category."})}):A.map(i=>e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wider mb-2 px-1",children:i.category}),e.jsx("div",{className:"space-y-3",children:i.markets.map(y=>e.jsx(Y,{market:y,selectedOutcomeIds:v,pendingBetMarketIds:d,onSelectOutcome:M=>N(M,y.name),defaultExpanded:C==="All",isBettingDisabled:o||x},y.id))})]},i.category))},s)]}):e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-gray-500 dark:text-white/60",children:"Event not found."}),e.jsx("button",{onClick:()=>r("/betting"),className:"mt-4 text-sm font-medium text-[#A0C516] hover:underline",children:"Back to Sports Betting"})]})})}export{ce 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.