PageSourceSearch

https://readybet.com.au/assets/QuickInsights-BSHxT2ic.js

js readybet.com.au collected 2026-10-06 21:19:12 UTC 3,486 bytes, 1 lines download raw bytes

1import{bv as S,bH as v,w as o,ao as P,fg as j,j as n,I as y}from"./client-Bai4VJA1.js";import{f as O,v as N,x as E,y as R,V as _,W as F,X as I,g as T,p as k,h as M,Y as Q,u as C}from"./FeaturedSgmWidgetHeader-Bs5pMGp9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"97808a5afbf047a0a6f7534b79e8c9b165448d38"};var r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="00cabb5d-4d7a-4832-9a18-27175f644361",e._sentryDebugIdIdentifier="sentry-dbid-00cabb5d-4d7a-4832-9a18-27175f644361")}catch{}})();const $=(e,r)=>{const{locale:f}=S(),{data:c}=v({race_ids:[e],locale:f}),l=o.useMemo(()=>r?.map(({runnerId:t})=>t),[r]),a=o.useMemo(()=>{if(!c||!c.entities[e])return{};const{runners:t}=c.entities[e].race;if(!t)return{};const d=t.filter(({id:u})=>l.includes(u));return Object.fromEntries(d.map(u=>[u.id,u]))},[c?.entities?.[e]?.race.runners,l]),s=o.useMemo(()=>r?.filter(({runnerId:t})=>a[t]).map(t=>{const d=a[t.runnerId],u=d.prices,h=P("win",!0,u)?.[t.position-1];return{...t,runnerNumber:d.tab_no,selectionOdds:h?.decimal,selectionFractionalOdds:h?.fractional}})||[],[a,r]),i=s.map(t=>t.selectionOdds,[]),m=o.useRef([]),{data:g,refetch:x}=j({race_id:e,selections:s.map(({position:t,runnerNumber:d})=>({position:t,runnerNumber:d}))},{skip:!(s.length>1)});return o.useEffect(()=>{m.current&&i&&r?.length>1&&JSON.stringify(m.current)!==JSON.stringify(i)&&s.length>1&&x(),m.current=i},[i,x,s]),s.length===1?{decimal:s[0].selectionOdds,fractional:s[0].selectionFractionalOdds}:{decimal:g?.srmSelectionsPrice?.price,fractional:g?.srmSelectionsPrice?.fractional_price}},A=({content:e,children:r,placement:f="bottom",showOnMount:c,disabled:l=!1,onDismiss:a})=>{const[s,i]=o.useState(c??!1),m=o.useRef(null),{refs:g,floatingStyles:x,context:p}=O({open:s,onOpenChange:i,placement:f,middleware:[N(8),E(),R({padding:5}),_({element:m})]}),t=F(p),d=I(p),u=T(p),b=k(p,{role:"tooltip"});o.useEffect(()=>{l&&(i(!1),a?.())},[l,a]),o.useEffect(()=>{s||a?.()},[s,a]);const{getReferenceProps:h,getFloatingProps:w}=M([t,d,u,b]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:g.setReference,...h(),children:r}),!l&&s&&n.jsxs("div",{ref:g.setFloating,style:x,...w(),className:"bg-bg-tooltip text-xxs text-[var(--color-text-tooltip,var(--text-white))] z-50 max-w-[12.875rem] rounded-lg px-4 py-2 shadow-md",children:[n.jsx(Q,{ref:m,context:p,className:"fill-gray-800"}),e]})]})},D=e=>e>=80?"bg-ui-green-normal":e>=40?"bg-ui-orange-normal":"bg-ui-red-normal",G=({data:e,variant:r="default",inset:f,className:c})=>{const{t:l}=C(),a=e.slice(0,r==="tips"?3:6);return n.jsx("div",{className:y("grid w-full",{"grid-cols-3 gap-2 md:gap-x-8 md:gap-y-2":r==="default"&&!f,"grid-cols-3 gap-2 md:!grid-cols-6 md:gap-3":r==="default"&&f,"!grid-cols-1 gap-1":r==="tips"},c),children:a.map((s,i)=>n.jsxs("div",{className:"flex w-full flex-col gap-0.5",children:[n.jsx("div",{className:"text-xxs flex justify-between",children:n.jsx("span",{className:"text-text-primary overflow-hidden text-ellipsis whitespace-nowrap",children:l(`quickInsights.${s.key}`,{ns:"racing",defaultValue:s.name})})}),n.jsx("div",{className:"bg-surface-moderate h-1 w-full overflow-hidden rounded-full",children:n.jsx("div",{className:y("h-full rounded-full transition-all duration-300",D(s.percentage||0)),style:{width:`${s.percentage||0}%`}})})]},s.key||`insight-${i}`))})};export{G as Q,A as T,$ as u};

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.