1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7859],{22711:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/money/rderby",function(){return r(67453)}])},43935:(e,t,r)=>{"use strict";r.d(t,{Q:()=>d});var a=r(26514),s=r(72122),l=r(46225),n=r(96456),i=r.n(n);r(75834);let d=e=>{let t,r,n,d=(0,s.c)(6),{children:o}=e,m=(0,l.useRouter)();return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=[{path:"/admin/money/miscellaneous",label:"Miscellaneous"},{path:"/admin/money/derby-balances",label:"Derby"},{path:"/admin/money/rderby",label:"rDerby"},{path:"/admin/money/crown-balances",label:"Crown"},{path:"/admin/money/corporate-withdrawal",label:"Corporate Withdrawal"},{path:"/admin/money/developer",label:"Developer"},{path:"/admin/money/earnings",label:"Earnings"},{path:"/admin/money/satellite-tickets",label:"Satellite Tickets"}],d[0]=t):t=d[0],d[1]!==m?(r=(0,a.jsx)("div",{className:"flex flex-wrap bg-[#0d343c] border-b border-primary-700 mb-6 rounded-sm",children:t.map(e=>{let{path:t,label:r}=e;return(0,a.jsx)("span",{className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${m.pathname===t?"border-secondary-400 text-secondary-400 bg-primary-800/50":"border-transparent text-gray-300 hover:text-white hover:bg-primary-800/30"}`,children:(0,a.jsx)(i(),{href:t,children:r})},t)})}),d[1]=m,d[2]=r):r=d[2],d[3]!==o||d[4]!==r?(n=(0,a.jsxs)(a.Fragment,{children:[r,o]}),d[3]=o,d[4]=r,d[5]=n):n=d[5],n}},67453:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>y,default:()=>g});var a=r(26514),s=r(72122),l=r(75834),n=r(8228),i=r(71837),d=r(43935),o=r(33989),m=r(31412);async function c(){return await (0,m.P)("https://api.photofinish.live/users/admin/restricted-derby/commitments",{method:"GET"})}var x=r(76073),p=r(17973);let h=e=>new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}).format(e),b=e=>new Intl.NumberFormat("en-US").format(e);var y=!0;let g=e=>{let t,r,m,y,g,u,j,N,w,v,_,D,S,A=(0,s.c)(23),{userRole:C,userName:k}=e,{data:E,isLoading:P,isError:T,error:I}=((S=(0,s.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(D={queryKey:["admin.restrictedDerby.commitments"],queryFn:c},S[0]=D):D=S[0],(0,o.I)(D));A[0]===Symbol.for("react.memo_cache_sentinel")?(t={},A[0]=t):t=A[0];let[$,L]=(0,l.useState)(t);A[1]===Symbol.for("react.memo_cache_sentinel")?(r={},A[1]=r):r=A[1];let[q,F]=(0,l.useState)(r);A[2]===Symbol.for("react.memo_cache_sentinel")?(m=e=>{L(t=>({...t,[e]:!t[e]}))},A[2]=m):m=A[2];let O=m;A[3]===Symbol.for("react.memo_cache_sentinel")?(y=e=>{F(t=>({...t,[e]:!t[e]}))},A[3]=y):y=A[3];let M=y;return A[4]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)("h1",{className:"text-xl pfmd:text-2xl font-bold text-white mb-2",children:"rDerby Commitments"}),u=(0,a.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:"Outstanding restricted Derby in player wallets, grouped by source and expiration date. Expand a source row to see when grants expire, or expand a stable row to see its rDerby breakdown by source."}),A[4]=g,A[5]=u):(g=A[4],u=A[5]),A[6]!==P?(j=P&&(0,a.jsx)("p",{className:"text-gray-400",children:"Loading rDerby commitment data..."}),A[6]=P,A[7]=j):j=A[7],A[8]!==I||A[9]!==T?(N=T&&(0,a.jsxs)("p",{className:"text-red-400",children:["Failed to load rDerby commitment data",I instanceof Error&&I.message?`: ${I.message}`:". Please try again."]}),A[8]=I,A[9]=T,A[10]=N):N=A[10],A[11]!==E||A[12]!==$||A[13]!==q?(w=E&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 pfsm:grid-cols-3 gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-primary-700 bg-primary-900/40 p-4",children:[(0,a.jsx)("p",{className:"text-gray-400 text-xs uppercase tracking-wide mb-1",children:"Total rDerby"}),(0,a.jsx)("p",{className:"text-white text-xl font-mono font-semibold",children:h(E.grandTotalDerby)})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-primary-700 bg-primary-900/40 p-4",children:[(0,a.jsx)("p",{className:"text-gray-400 text-xs uppercase tracking-wide mb-1",children:"Users"}),(0,a.jsx)("p",{className:"text-white text-xl font-mono font-semibold",children:b(E.totalUserCount)})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-primary-700 bg-primary-900/40 p-4",children:[(0,a.jsx)("p",{className:"text-gray-400 text-xs uppercase tracking-wide mb-1",children:"Grants"}),(0,a.jsx)("p",{className:"text-white text-xl font-mono font-semibold",children:b(E.totalGrantCount)})]})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg pfmd:text-xl font-semibold text-white mb-2",children:"Outstanding by Stable"}),(0,a.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:"Stables with outstanding restricted Derby, sorted by total balance. Click a row to expand its rDerby breakdown; click a stable ID to open their stable page."}),0===(E.stables??[]).length?(0,a.jsx)("p",{className:"text-gray-400",children:"No stables with outstanding restricted Derby found."}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg border border-primary-700",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-primary-900 text-gray-300 text-left",children:[(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700 w-8"}),(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700",children:"Stable Name"}),(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700",children:"Stable ID"}),(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700 text-right",children:"Total rDerby"}),(0,a.jsx)("th",{className:"hidden pfsm:table-cell px-4 py-3 font-semibold border-b border-primary-700 text-right",children:"Grants"})]})}),(0,a.jsx)("tbody",{children:(E.stables??[]).map((e,t)=>{let r=q[e.pf2Id]??!1,s=e.bySource??[];return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsxs)("tr",{className:`curs
1or-pointer hover:bg-primary-800/50 ${t%2==0?"bg-primary-800/30":"bg-primary-800/10"}`,onClick:()=>M(e.pf2Id),children:[(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3 text-gray-400",children:r?(0,a.jsx)(n.fK4,{"aria-hidden":!0}):(0,a.jsx)(n.fOo,{"aria-hidden":!0})}),(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3 text-white font-medium",children:e.stableName||e.pf2Id}),(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3",children:(0,a.jsx)(x.a,{href:(0,p.$d)(e.pf2Id),className:"text-secondary-400 hover:text-secondary-300 font-mono text-xs pfmd:text-sm",onClick:f,children:e.pf2Id})}),(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3 text-right text-white font-mono",children:h(e.totalDerby)}),(0,a.jsx)("td",{className:"hidden pfsm:table-cell px-4 py-3 text-right text-gray-300 font-mono",children:b(e.grantCount)})]}),r&&(0,a.jsx)("tr",{className:"bg-primary-900/60",children:(0,a.jsxs)("td",{colSpan:5,className:"px-3 pfmd:px-6 py-3",children:[(0,a.jsx)("div",{className:"text-xs text-gray-400 uppercase tracking-wide mb-2",children:"rDerby Breakdown by Source"}),0===s.length?(0,a.jsx)("p",{className:"text-gray-400 text-sm",children:"No source breakdown available."}):(0,a.jsxs)("table",{className:"w-full text-xs pfmd:text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-gray-400 text-left",children:[(0,a.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Source"}),(0,a.jsx)("th",{className:"pb-2 pr-4 font-medium text-right",children:"rDerby"}),(0,a.jsx)("th",{className:"hidden pfmd:table-cell pb-2 font-medium text-right",children:"Grants"})]})}),(0,a.jsx)("tbody",{children:s.map(t=>(0,a.jsxs)("tr",{className:"border-t border-primary-700/50",children:[(0,a.jsxs)("td",{className:"py-2 pr-4 text-gray-200",children:[(0,a.jsx)("div",{className:"font-medium",children:t.sourceLabel}),(0,a.jsx)("div",{className:"text-gray-500 text-xs mt-0.5",children:t.sourceType})]}),(0,a.jsx)("td",{className:"py-2 pr-4 text-right text-white font-mono",children:h(t.totalDerby)}),(0,a.jsx)("td",{className:"hidden pfmd:table-cell py-2 text-right text-gray-300 font-mono",children:b(t.grantCount)})]},`${e.pf2Id}-${t.sourceType}-${t.sourceLabel}`))})]})]})})]},e.pf2Id)})})]})})]}),0===E.sources.length?(0,a.jsx)("p",{className:"text-gray-400",children:"No outstanding restricted Derby grants found."}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg border border-primary-700",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-primary-900 text-gray-300 text-left",children:[(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700 w-8"}),(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700",children:"Earned From"}),(0,a.jsx)("th",{className:"px-3 pfmd:px-4 py-3 font-semibold border-b border-primary-700 text-right",children:"Total rDerby"}),(0,a.jsx)("th",{className:"hidden pfsm:table-cell px-4 py-3 font-semibold border-b border-primary-700 text-right",children:"Grants"}),(0,a.jsx)("th",{className:"hidden pfsm:table-cell px-4 py-3 font-semibold border-b border-primary-700 text-right",children:"Users"})]})}),(0,a.jsx)("tbody",{children:E.sources.map((e,t)=>{let r=$[e.grantId]??!1;return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsxs)("tr",{className:`cursor-pointer hover:bg-primary-800/50 ${t%2==0?"bg-primary-800/30":"bg-primary-800/10"}`,onClick:()=>O(e.grantId),children:[(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3 text-gray-400",children:r?(0,a.jsx)(n.fK4,{"aria-hidden":!0}):(0,a.jsx)(n.fOo,{"aria-hidden":!0})}),(0,a.jsxs)("td",{className:"px-3 pfmd:px-4 py-3",children:[(0,a.jsx)("div",{className:"text-white font-medium",children:e.sourceLabel}),(0,a.jsx)("div",{className:"text-gray-500 text-xs mt-0.5",children:e.sourceType})]}),(0,a.jsx)("td",{className:"px-3 pfmd:px-4 py-3 text-right text-white font-mono",children:h(e.totalDerby)}),(0,a.jsx)("td",{className:"hidden pfsm:table-cell px-4 py-3 text-right text-gray-300 font-mono",children:b(e.grantCount)}),(0,a.jsx)("td",{className:"hidden pfsm:table-cell px-4 py-3 text-right text-gray-300 font-mono",children:b(e.userCount)})]}),r&&(0,a.jsx)("tr",{className:"bg-primary-900/60",children:(0,a.jsxs)("td",{colSpan:5,className:"px-3 pfmd:px-6 py-3",children:[(0,a.jsx)("div",{className:"text-xs text-gray-400 uppercase tracking-wide mb-2",children:"Expiration Breakdown"}),(0,a.jsxs)("table",{className:"w-full text-xs pfmd:text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-gray-400 text-left",children:[(0,a.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Expiration Date"}),(0,a.jsx)("th",{className:"pb-2 pr-4 font-medium text-right",children:"rDerby"}),(0,a.jsx)("th",{className:"hidden pfmd:table-cell pb-2 pr-4 font-medium text-right",children:"Grants"}),(0,a.jsx)("th",{className:"hidden pfmd:table-cell pb-2 font-medium text-right",children:"Users"})]})}),(0,a.jsx)("tbody",{children:e.byExpiration.map(t=>{var r;let s;return(0,a.jsxs)("tr",{className:"border-t border-primary-700/50",children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-gray-200",children:Number.isNaN((s=new Date(r=t.expirationDate)).getTime())?r:s.toLocaleStr
1ing(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-right text-white font-mono",children:h(t.totalDerby)}),(0,a.jsx)("td",{className:"hidden pfmd:table-cell py-2 pr-4 text-right text-gray-300 font-mono",children:b(t.grantCount)}),(0,a.jsx)("td",{className:"hidden pfmd:table-cell py-2 text-right text-gray-300 font-mono",children:b(t.userCount)})]},`${e.grantId}-${t.expirationDate}`)})})]})]})})]},e.grantId)})})]})})]}),A[11]=E,A[12]=$,A[13]=q,A[14]=w):w=A[14],A[15]!==j||A[16]!==N||A[17]!==w?(v=(0,a.jsx)(d.Q,{children:(0,a.jsxs)("div",{className:"p-4 pfmd:p-6",children:[g,u,j,N,w]})}),A[15]=j,A[16]=N,A[17]=w,A[18]=v):v=A[18],A[19]!==v||A[20]!==k||A[21]!==C?(_=(0,a.jsx)(i.A,{userRole:C,userName:k,children:v}),A[19]=v,A[20]=k,A[21]=C,A[22]=_):_=A[22],_};function f(e){return e.stopPropagation()}},71837:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var a=r(26514),s=r(72122),l=r(75834),n=r(92375),i=r(1123),d=r(1455),o=r(46225),m=r(31950),c=r(21958),x=r(96456),p=r.n(x),h=r(69446),b=r(17472),y=r(33321);let g=[{path:"/admin/announcements",label:"Communications",role:h.eq.Agent,isActive:e=>"/admin"===e||"/admin/announcements"===e||"/admin/email-notifications"===e||"/admin/kill-switches"===e||"/admin/payouts"===e||"/admin/analytics"===e||"/admin/system-health"===e||"/admin/blog-editor"===e},{path:"/admin/misc/gameplay",label:"Misc",role:h.eq.Agent,isActive:e=>e.startsWith("/admin/misc")},{path:"/admin/user-management",label:"User Management",role:h.eq.Agent},{path:"/admin/horse-management",label:"Horse Management",role:h.eq.Agent},{path:"/admin/money/miscellaneous",label:"Money",role:h.eq.Agent},{path:"/admin/schedule/editor",label:"Schedule",role:h.eq.LiveOps,isActive:e=>e.startsWith("/admin/schedule")},{path:"/admin/promotions",label:"Promotions",role:h.eq.LiveOps},{path:"/admin/onboarding",label:"Onboarding",role:h.eq.LiveOps},{path:"/admin/cms",label:"CMS",role:h.eq.LiveOps},{path:"/admin/learntoplay",label:"Learn to Play",role:h.eq.LiveOps},{path:"/admin/archived/old-live-ops",label:"Archived",role:h.eq.Agent,isActive:e=>e.startsWith("/admin/archived")}],f=e=>{let t,r,m,c,x,f,u,j,N,w,v,_=(0,s.c)(31),{userRole:D,userName:S,rateLimited:A,children:C}=e,k=(0,o.useRouter)(),{data:E}=(0,y.E)(),[P,T]=(0,l.useState)(!1),[I,$]=(0,l.useState)(!1);_[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=()=>{$(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},r=[],_[0]=t,_[1]=r):(t=_[0],r=_[1]),(0,l.useEffect)(t,r),_[2]!==D?(m=e=>D<=e.role,_[2]=D,_[3]=m):m=_[3];let L=g.filter(m);if(_[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{T(!1)},_[4]=c):c=_[4],_[5]!==k.pathname?(x=[k.pathname],_[5]=k.pathname,_[6]=x):x=_[6],(0,l.useEffect)(c,x),A){let e,t,r,s;return _[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(n.Av,{pageTitle:"Admin Page",className:"mh_admin",children:(0,a.jsx)(i.sT,{description:"Please wait a moment",children:"Admin Console"})}),_[7]=e):e=_[7],_[8]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(d.EY.default,{className:"text-xl font-bold mb-2",children:"Too Many Requests"}),r=(0,a.jsx)(d.EY.default,{className:"text-gray-300 mb-4",children:"The authentication service is temporarily rate limited. Please wait a moment and refresh the page."}),_[8]=t,_[9]=r):(t=_[8],r=_[9]),_[10]!==k?(s=(0,a.jsxs)(n.Ay,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish⢠LIVE",hideMajor:!0,children:[e,(0,a.jsx)(n.Gv,{children:(0,a.jsx)(d.mc,{className:"py-8",children:(0,a.jsxs)("div",{className:"bg-yellow-900/50 border border-yellow-600 rounded-lg p-6 text-center",children:[t,r,(0,a.jsx)("button",{onClick:()=>k.reload(),className:"px-4 py-2 bg-primary-600 hover:bg-primary-500 rounded-md transition-colors",children:"Refresh Page"})]})})})]}),_[10]=k,_[11]=s):s=_[11],s}let q=n.Ay;_[12]!==D?(f=(0,h.pK)(D),_[12]=D,_[13]=f):f=_[13];let F=`User: ${S} | Role: ${f} | Season: ${E?.currentSeason||"..."}`;_[14]!==F?(u=(0,a.jsx)(n.Av,{pageTitle:"Admin Page",className:"mh_admin",children:(0,a.jsx)(i.sT,{description:F,children:"Admin Console"})}),_[14]=F,_[15]=u):u=_[15];let O=n.Gv;_[16]!==I||_[17]!==P?(j=I&&(0,a.jsxs)(d.Ye,{className:"justify-between items-center px-4 py-2 bg-[#11444d] border-b border-primary-700",children:[(0,a.jsx)(d.EY.default,{className:"font-bold text-lg",children:"Admin Navigation"}),(0,a.jsx)("button",{onClick:()=>T(!P),className:"p-2 focus:outline-none","aria-label":P?"Close menu":"Open menu",children:P?(0,a.jsx)(b.m6K,{size:24}):(0,a.jsx)(b.vIB,{size:24})})]}),_[16]=I,_[17]=P,_[18]=j):j=_[18];let M=(!I||P)&&(0,a.jsx)("div",{className:` 2 bg-[#11444d] border-b border-primary-700 3 ${I?"absolute z-50 w-full shadow-lg":""} 4 ${I?"flex flex-col":"flex flex-row flex-wrap justify-start items-center px-2 py-1.5"} 5 `,children:L.map(e=>{let t=e.isActive?e.isActive(k.pathname):k.pathname===e.path;return(0,a.jsx)(p(),{href:e.path,children:(0,a.jsx)("div",{className:` 6 ${t?"bg-primary-900 text-white border-primary-300":"text-gray-200 hover:bg-primary-700 border-transparent hover:border-primary-400"} 7 ${I?"py-3 px-4 w-full border-l-4":"py-1 px-2 mx-0.5 my-0.5 text-xs font-medium whitespace-nowrap border-b-2 roun
7ded-t-sm"} 8 transition-all duration-150 cursor-pointer 9 `,children:e.label})},e.path)})}),G=`${I?"mt-4":"mt-2"}`;return _[19]!==C||_[20]!==G?(N=(0,a.jsx)("div",{className:G,children:C}),_[19]=C,_[20]=G,_[21]=N):N=_[21],_[22]!==O||_[23]!==j||_[24]!==M||_[25]!==N?(w=(0,a.jsxs)(O,{children:[j,M,N]}),_[22]=O,_[23]=j,_[24]=M,_[25]=N,_[26]=w):w=_[26],_[27]!==q||_[28]!==u||_[29]!==w?(v=(0,a.jsxs)(q,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish⢠LIVE",hideMajor:!0,children:[u,w]}),_[27]=q,_[28]=u,_[29]=w,_[30]=v):v=_[30],v},u=e=>{let t,r=(0,s.c)(3),{authUser:l}=(0,m.wV)();if((0,c.gD)(l)){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(n.Ay,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish⢠LIVE",hideMajor:!0,children:(0,a.jsx)(d.mc,{})}),r[0]=e):e=r[0],e}return r[1]!==e?(t=(0,a.jsx)(f,{...e}),r[1]=e,r[2]=t):t=r[2],t}}},e=>{e.O(0,[8228,6593,636,8792],()=>e(e.s=22711)),_N_E=e.O()}]);
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.