1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[105],{1362:(e,t,a)=>{"use strict";a.d(t,{D:()=>i,N:()=>c});var r=a(2115),s=(e,t,a,r,s,n,d,l)=>{let o=document.documentElement,i=["light","dark"];function c(t){var a;(Array.isArray(e)?e:[e]).forEach(e=>{let a="class"===e,r=a&&n?s.map(e=>n[e]||e):s;a?(o.classList.remove(...r),o.classList.add(n&&n[t]?n[t]:t)):o.setAttribute(e,t)}),a=t,l&&i.includes(a)&&(o.style.colorScheme=a)}if(r)c(r);else try{let e=localStorage.getItem(t)||a,r=d&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(r)}catch(e){}},n=["light","dark"],d="(prefers-color-scheme: dark)",l=r.createContext(void 0),o={setTheme:e=>{},themes:[]},i=()=>{var e;return null!=(e=r.useContext(l))?e:o},c=e=>r.useContext(l)?r.createElement(r.Fragment,null,e.children):r.createElement(m,{...e}),x=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:a=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:i="theme",themes:c=x,defaultTheme:m=s?"system":"light",attribute:v="data-theme",value:f,children:g,nonce:j,scriptProps:y}=e,[N,k]=r.useState(()=>h(i,m)),[w,S]=r.useState(()=>"system"===N?b():N),_=f?Object.values(f):c,T=r.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=b());let r=f?f[t]:t,d=a?p(j):null,l=document.documentElement,i=e=>{"class"===e?(l.classList.remove(..._),r&&l.classList.add(r)):e.startsWith("data-")&&(r?l.setAttribute(e,r):l.removeAttribute(e))};if(Array.isArray(v)?v.forEach(i):i(v),o){let e=n.includes(m)?m:null,a=n.includes(t)?t:e;l.style.colorScheme=a}null==d||d()},[j]),C=r.useCallback(e=>{let t="function"==typeof e?e(N):e;k(t);try{localStorage.setItem(i,t)}catch(e){}},[N]),L=r.useCallback(e=>{S(b(e)),"system"===N&&s&&!t&&T("system")},[N,t]);r.useEffect(()=>{let e=window.matchMedia(d);return e.addListener(L),L(e),()=>e.removeListener(L)},[L]),r.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?k(e.newValue):C(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),r.useEffect(()=>{T(null!=t?t:N)},[t,N]);let M=r.useMemo(()=>({theme:N,setTheme:C,forcedTheme:t,resolvedTheme:"system"===N?w:N,themes:s?[...c,"system"]:c,systemTheme:s?w:void 0}),[N,C,t,w,s,c]);return r.createElement(l.Provider,{value:M},r.createElement(u,{forcedTheme:t,storageKey:i,attribute:v,enableSystem:s,enableColorScheme:o,defaultTheme:m,value:f,themes:c,nonce:j,scriptProps:y}),g)},u=r.memo(e=>{let{forcedTheme:t,storageKey:a,attribute:n,enableSystem:d,enableColorScheme:l,defaultTheme:o,value:i,themes:c,nonce:x,scriptProps:m}=e,u=JSON.stringify([n,a,o,t,c,i,d,l]).slice(1,-1);return r.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(s.toString(),")(").concat(u,")")}})}),h=(e,t)=>{let a;try{a=localStorage.getItem(e)||void 0}catch(e){}return a||t},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(d)),e.matches?"dark":"light")},2592:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>F});var r,s=a(5155);a(9509);let n=(r="https://api-focus.omegatron.ai",r).replace(/\/$/,""),d=new Map;async function l(e,t){var a;if(!n)throw Error("SN24_API_URL is not configured");let r=(a=null==t?void 0:t.body)?"".concat(e,":").concat(JSON.stringify(a)):e;if(!(null==t?void 0:t.skipCache)){let e=function(e){let t=d.get(e);return t?Date.now()-t.timestamp>3e4?(d.delete(e),null):t.data:null}(r);if(e)return e}let s=(null==t?void 0:t.method)||"POST",l=(null==t?void 0:t.body)?JSON.stringify(t.body):void 0,o=await fetch("".concat(n).concat(e),{method:s,headers:{Accept:"application/json","Content-Type":"application/json"},body:l,next:{revalidate:30}});if(!o.ok)throw Error(await o.text()||"Request failed with status ".concat(o.status));let i=await o.json();return d.set(r,{data:i,timestamp:Date.now()}),i}var o=a(2115);let i=(0,o.memo)(function(e){let{formatTao:t,formatDate:a,getHotkeyPreview:r,enabled:n}=e,[d,i]=(0,o.useState)([]),[x,f]=(0,o.useState)(!1),[g,j]=(0,o.useState)(null),[y,N]=(0,o.useState)(null),k=(0,o.useRef)(null),w=(0,o.useCallback)(async e=>
1{if(!n){i([]),f(!1),j("SN24_API_URL is not configured.");return}k.current&&k.current.abort(),k.current=new AbortController,e&&f(!0),j(null);try{let e=await l("/miners/latest");i(e),N(new Date)}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;j(e instanceof Error?e.message:"Failed to load latest purchases.")}finally{e&&f(!1)}},[n]);(0,o.useEffect)(()=>{if(!n){i([]),f(!1),j("SN24_API_URL is not configured.");return}w(!0);let e=setInterval(()=>{w(!1)},12e4);return()=>{clearInterval(e),k.current&&k.current.abort()}},[n,w]);let S=(0,o.useMemo)(()=>{if(!d.length)return{headline:"Awaiting marketplace activity",minerCount:0,totalTao:"0"};let e=d.reduce((e,t)=>e+t.earned_reward_tao,0),a=new Set(d.map(e=>e.miner_hotkey)).size;return{headline:"".concat(d.length," recent purchases \xb7 ").concat(t(e)," TAO moved"),minerCount:a,totalTao:t(e)}},[d,t]),_=(0,o.useCallback)(()=>{w(!0)},[w]);return(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsx)(c,{lastUpdated:y,onRefresh:_}),(0,s.jsx)("div",{className:"dark:bg-black/30 bg-gray-50 border border-brand-600/30 rounded-2xl p-6 backdrop-blur-sm hover:border-brand-400/50 transition-all duration-300",children:(0,s.jsxs)("div",{className:"relative overflow-hidden",children:[(0,s.jsx)(m,{summary:S}),x&&0===d.length&&(0,s.jsx)(u,{}),!x&&g&&0===d.length&&(0,s.jsx)(h,{error:g}),!x&&!g&&0===d.length&&(0,s.jsx)(p,{}),d.length>0&&(0,s.jsx)(v,{purchases:d,formatTao:t,formatDate:a,getHotkeyPreview:r}),g&&d.length>0&&(0,s.jsx)(b,{error:g})]})})]})}),c=(0,o.memo)(function(e){let{lastUpdated:t,onRefresh:a}=e;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-bold",children:"Live Task Marketplace Feed"}),(0,s.jsx)("p",{className:"text-sm dark:text-[var(--text-secondary)]",children:"Last 20 purchased focus videos across all miners. Auto-refreshes every 2 minutes."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold uppercase tracking-wide",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1 rounded-lg bg-brand-400/20 dark:bg-black/40 border border-brand-400 dark:border-brand-400/30 px-3 py-1 text-brand-300",children:[(0,s.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,s.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-brand-500 opacity-75 animate-ping"}),(0,s.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-brand-500"})]}),"Live refresh"]}),t&&(0,s.jsxs)("span",{className:"rounded-lg border-brand-400 dark:bg-black/40 border dark:border-brand-600/30 px-3 py-1 text-brand-300 dark:text-[var(--text-secondary)]",children:["Updated"," ",t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]}),(0,s.jsxs)("button",{type:"button",onClick:a,className:"inline-flex items-center gap-2 rounded-lg dark:bg-black/40 dark:hover:bg-black/60 hover:bg-brand-300/40 border border-brand-400 dark:border-brand-400/30 dark:hover:border-brand-400/50 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-brand-300 dark:hover:text-brand-200 transition-all duration-200",children:[(0,s.jsx)(x,{}),"Refresh"]})]})]})}),x=(0,o.memo)(function(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M4.06189 13C4.02104 12.6724 4 12.3387 4 12C4 7.58172 7.58172 4 12 4C14.5006 4 16.7332 5.14727 18.2002 6.94416M19.9381 11C19.979 11.3276 20 11.6613 20 12C20 16.4183 16.4183 20 12 20C9.61061 20 7.46589 18.9525 6 17.2916M9 17H6V17.2916M18.2002 4V6.94416M18.2002 6.94416V6.99993L15.2002 7M6 20V17.2916",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"dark:stroke-white stroke-brand-300"})})}),m=(0,o.memo)(function(e){let{summary:t}=e;return(0,s.jsxs)("div",{className:"mb-6 flex flex-wrap items-center gap-3 text-xs font-semibold uppercase tracking-wide",children:[(0,s.jsx)("span",{className:"rounded-lg dark:bg-brand-900/40 border border-brand-400 dark:border-brand-400/30 px-3 py-1 text-brand-300",children:t.headline}),t.minerCount>0&&(0,s.jsxs)("span",{className:"rounded-lg dark:bg-brand-900/40 border border-brand-400 dark:border-brand-400/30 px-3 py-1 text-brand-300",children:[t.minerCount," miners active"]})]})}),u=(0,o.memo)(function(){return(0,s.jsx)("div",{className:"rounded-2xl dark:bg-black/20 border border-brand-600/30 px-6 py-10 text-center text-sm text-[var(--text-secondary)]",children:"Loading latest purchases..."})}),h=(0,o.memo)(function(e){let{error:t}=e;return(0,s.jsx)("div",{className:"rounded-2xl bg-red-900/20 border border-red-500/30 px-6 py-10 text-center text-sm text-red-400",children:t})}),p=(0,o.memo)(function(){return(0,s.jsx)("div",{className:"rounded-2xl dark:bg-black/20 border border-brand-600/30 px-6 py-10 text-center text-sm text-[var(--text-secondary)]",children:"No purchases recorded yet."})}),b=(0,o.memo)(function(e){let{error:t}=e;return(0,s.jsxs)("p",{className:"mt-4 rounded-lg bg-red-900/20 border border-red-500/30 px-4 py-2 text-center text-xs font-semibold text-red-400",children:["Unable to refresh feed: ",t]})}),v=(0,o.memo)(function(e){let{purchases:t,formatTao:a,formatDate:r,getHotkeyPreview:n}=e;return(0,s.jsx)("ul",{className:"space-y-3",children:t.map(e=>(0,s.jsx)(f,{purchase:e,formatTao:a,formatDate:r,getHotkeyPreview:n},"".concat(e.video_id,"-").concat(e.created_at)))})}),f=(0,o.memo)(function(e){let{purchase:t,formatTao:a,formatDate:r,getHotkeyPreview:n}=e;return(0,s.jsxs)("li",{className:"group relative overflow-hidden rounded-2xl bg-white dark:bg-black/20 border border-brand-600/20 hover:border-brand-400/40 px-5 py-4 transition-all duration-200 backdrop-blur-sm",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs font-semibold uppercase tracking-wide dark:text-[var(--text-tertiary)]",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"inline-flex h-2.5 w-2.5 rounded-full bg-brand-400"}),r(t.created_at)]}),(0,s.jsxs)("span",{className:"rounded-lg dark:bg-brand-900/40 border border-brand-400 dark:border-brand-400/30 px-2 py-0.5 text-brand-300",children:[a(t.earned_reward_tao)," TAO"]})]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"text-sm font-semibold",title:t.focusing_task,children:t.focusing_task||"Untitled task"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs dar
1k:text-[var(--text-secondary)]",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",title:t.miner_hotkey,children:["Miner",(0,s.jsx)("span",{className:"font-semibold",children:n(t.miner_hotkey)})]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:["Video",(0,s.jsx)("span",{className:"font-mono",children:t.video_id})]}),t.task_type&&(0,s.jsx)("span",{className:"rounded-lg dark:bg-brand-900/40 border border-brand-400 dark:border-brand-400/30 px-2 py-0.5 text-brand-300",children:t.task_type})]})]})]})});var g=a(6766),j=a(6874),y=a.n(j);function N(e){let{video:t,onClose:a}=e;return t?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:a}),(0,s.jsxs)("div",{className:"absolute right-0 top-0 h-full w-full max-w-2xl overflow-y-auto border-l border-brand-800/40 bg-panel shadow-strong",children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-brand-800/35 bg-panel px-6 py-5 backdrop-blur-xl",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-tertiary",children:"Evaluation"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-[var(--text-primary)]",children:"Video Details"})]}),(0,s.jsx)("button",{onClick:a,className:"rounded-full border border-brand-700/35 p-2 text-muted transition hover:-translate-y-0.5 hover:border-brand-500/45 hover:text-brand-200","aria-label":"Close video details",children:(0,s.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,s.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,s.jsxs)("div",{className:"space-y-6 px-6 py-8",children:[(0,s.jsxs)("section",{className:"rounded-2xl border border-brand-700/35 bg-panel p-5",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Metadata"}),(0,s.jsxs)("div",{className:"mt-4 grid gap-4 text-sm sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-tertiary",children:"Video ID"}),(0,s.jsx)("p",{className:"mt-1 font-medium text-[var(--text-primary)]",children:t.id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-tertiary",children:"Task Type"}),(0,s.jsx)("p",{className:"mt-1 font-medium capitalize text-[var(--text-primary)]",children:t.taskType})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-tertiary",children:"Duration"}),(0,s.jsxs)("p",{className:"mt-1 font-medium text-[var(--text-primary)]",children:[t.duration," seconds"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-tertiary",children:"Submitted"}),(0,s.jsx)("p",{className:"mt-1 font-medium text-[var(--text-primary)]",children:new Date(t.submittedAt).toLocaleString()})]}),t.walletId&&(0,s.jsxs)("div",{className:"sm:col-span-2",children:[(0,s.jsx)("p",{className:"text-tertiary",children:"Wallet ID"}),(0,s.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-[var(--text-primary)]",children:t.walletId})]})]})]}),t.validatorScores&&t.validatorScores.length>0&&(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Validator Scores"}),(0,s.jsx)("p",{className:"text-sm text-muted",children:"Detailed feedback from validators evaluating this submission."})]}),t.validatorScores.map((e,t)=>(0,s.jsxs)("div",{className:"rounded-2xl border border-brand-700/35 bg-panel p-5",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-[var(--text-primary)]",children:e.validatorName}),(0,s.jsx)("p",{className:"text-xs font-mono text-tertiary",children:e.validatorId})]}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wide text-tertiary",children:"Completion"}),(0,s.jsx)("p",{className:"text-lg font-semibold text-brand-600",children:e.completion.toFixed(1)})]}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wide text-tertiary",children:"Novelty"}),(0,s.jsx)("p",{className:"text-lg font-semibold text-info-500",children:e.novelty.toFixed(1)})]}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wide text-tertiary",children:"Relevance"}),(0,s.jsx)("p",{className:"text-lg font-semibold text-success-500",children:e.relevance.toFixed(1)})]})]})]}),e.flags.length>0&&(0,s.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-danger-500",children:"Flags"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:e.flags.map((e,t)=>(0,s.jsx)("span",{className:"rounded-full border border-danger-500/40 bg-danger-50 px-3 py-1 text-xs font-semibold text-danger-500",children:e},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-tertiary",children:"Reasoning"}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-[var(--text-primary)]",children:e.reasoning})]})]},t))]}),void 0!==t.consensusScore&&(0,s.jsxs)("section",{className:"rounded-2xl border border-brand-700/35 bg-panel p-5",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Consensus"}),(0,s.jsxs)("div",{className:"mt-4 flex items-center justify-between gap-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-tertiary",children:"Final Score"}),(0,s.jsx)("p",{className:"mt-2 text-3xl font-semibold text-brand-600",children:t.consensusScore.toFixed(2)})]}),void 0!==t.payout&&(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-tertiary",children:"Payout"}),(0,s.jsxs)("p",{className:"mt-2 text-3xl font-semibold text-success-500",children:[t.payout.toFixed(4)," TAO"]})]})]})]})]})]})]}):null}function k(e){var t;let{videos:a,apiAvailable:r}=e,[n,d]=(0,o.useState)(null),[i,c]=(0,o.useState)("date"),[x,m]=(0,o.useState)("desc"),[u,h]=(0,o.useState)(null),[p,b]=(0,o.useState)([]),[v,f]=(0,o.useState)(!1),[j,k]=(0,o.useState)(null),w=(0,o.useMemo)(()=>a.filter(e=>"finalized"===e.status),[a]),S=e=>void 0===e||Number.isNaN(e)?0:e>1?e/100:e,_=(0,o.useMemo)(()=>{let e=w.reduce((e,t)=>
1e+(t.payout||0),0),t=w.length>0?w.reduce((e,t)=>e+S(t.consensusScore),0)/w.length:0;return{total_videos:w.length,total_payout_tao:e,average_score:t}},[w]),T=(0,o.useMemo)(()=>w.map(e=>{var t,a;return{video_id:e.id,task_type:e.taskType,date:e.submittedAt,score:S(e.consensusScore),payout_tao:null!=(t=e.payout)?t:0,wallet:null!=(a=e.walletId)?a:"",sourceVideo:e}}),[w]),C=(0,o.useCallback)(async()=>{if(!r){h(null),b([]),k("SN24_API_URL is not configured."),f(!1);return}f(!0),k(null);try{let[e,t]=await Promise.all([l("/payouts/summary"),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return l("/payouts/recent",{body:{limit:e}})}(20)]);h(e),b(t)}catch(e){k(e instanceof Error?e.message:"Failed to load payouts data."),h(null),b([])}finally{f(!1)}},[r]);(0,o.useEffect)(()=>{C()},[C]);let L=null!=u?u:_,M=null!==u&&r&&null===j,A=[...M?p.map(e=>({video_id:e.video_id,task_type:e.task_type,date:e.date,score:e.score,payout_tao:e.payout_tao,wallet:e.wallet})):T].sort((e,t)=>{let a=0;return"date"===i?a=new Date(e.date).getTime()-new Date(t.date).getTime():"score"===i?a=e.score-t.score:"payout"===i&&(a=e.payout_tao-t.payout_tao),"asc"===x?a:-a}),P=e=>{i===e?m("asc"===x?"desc":"asc"):(c(e),m("desc"))},E=e=>(null==e?void 0:e.toFixed(2))||"0.00",D=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})},I=e=>"marketplace"===e.toLowerCase()?"MKT":e,V=e=>e?"".concat(e.slice(0,6),"...").concat(e.slice(-4)):"-";return(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[(0,s.jsxs)("div",{className:"border border-brand-600/20 dark:border-gray-800 dark:bg-transparent bg-white rounded-lg p-6 pb-20 dark:shadow-soft overflow-hidden relative",children:[(0,s.jsx)(g.default,{src:"/analytics-bg.png",alt:"Analytics BG",fill:!0,className:"w-full h-full absolute top-0 left-0 opacity-8 select-none pointer-events-none"}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-brand-400",children:"Finalized Videos"}),(0,s.jsx)("p",{className:"mt-3 text-3xl font-bold",children:L.total_videos.toLocaleString()}),(0,s.jsx)("p",{className:"mt-1 text-xs dark:text-[var(--text-muted)]",children:"Across all task types"})]}),(0,s.jsxs)("div",{className:"border border-brand-600/20 dark:border-gray-800 dark:bg-transparent bg-white rounded-lg p-6 pb-20 dark:shadow-soft overflow-hidden relative",children:[(0,s.jsx)(g.default,{src:"/analytics-bg.png",alt:"Analytics BG",fill:!0,className:"w-full h-full absolute top-0 left-0 opacity-8 select-none pointer-events-none"}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-brand-400",children:"Average Score"}),(0,s.jsx)("p",{className:"mt-3 text-3xl font-bold",children:E(L.average_score)}),(0,s.jsx)("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:"Network-wide consensus average"})]}),(0,s.jsxs)("div",{className:"border border-brand-600/20 dark:border-gray-800 dark:bg-transparent bg-white rounded-lg p-6 pb-20 dark:shadow-soft overflow-hidden relative",children:[(0,s.jsx)(g.default,{src:"/analytics-bg.png",alt:"Analytics BG",fill:!0,className:"w-full h-full absolute top-0 left-0 opacity-8 select-none pointer-events-none"}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-brand-400",children:"Total Payouts"}),(0,s.jsxs)("p",{className:"mt-3 text-3xl font-bold",children:[(null==(t=L.total_payout_tao)?void 0:t.toFixed(4))||"0.0000"," TAO"]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:"Issued to contributors"})]})]}),(0,s.jsxs)("div",{className:"border border-brand-600/20 dark:border-gray-800 rounded-lg dark:shadow-soft overflow-x-auto dark:bg-transparent bg-white",children:[(0,s.jsxs)("div",{className:"flex md:flex-row flex-col md:items-center md:gap-0 gap-4 justify-between border-b border-brand-600/20 dark:border-gray-800 px-6 py-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-bold dark:text-[var(--text-primary)]",children:"Recent Payouts"}),(0,s.jsx)("p",{className:"mt-1 text-sm dark:text-[var(--text-secondary)]",children:"Click any row to view video details"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[M&&(0,s.jsxs)("span",{className:"flex items-center gap-2 rounded-lg bg-[#0284c733] dark:text-white border border-brand-600 px-3 py-2 text-sm font-medium",children:[(0,s.jsx)("div",{className:"h-2 w-2 bg-brand-700 rounded-full animate-pulse"}),(0,s.jsxs)("span",{children:["Live ",(0,s.jsx)("p",{className:"md:inline hidden",children:"Data"})]})]}
1),v&&(0,s.jsx)("span",{className:"rounded-lg bg-color-layer-200 px-3 py-2 text-sm dark:text-[var(--text-secondary)]",children:"Loading..."}),(0,s.jsxs)("button",{type:"button",onClick:C,className:"flex items-center gap-2 rounded-lg bg-[#0284c733] dark:text-white border border-brand-600 px-3 py-2 text-sm font-medium transition-colors cursor-pointer hover:bg-brand-700",children:[(0,s.jsx)("svg",{width:"16x",height:"16px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M4.06189 13C4.02104 12.6724 4 12.3387 4 12C4 7.58172 7.58172 4 12 4C14.5006 4 16.7332 5.14727 18.2002 6.94416M19.9381 11C19.979 11.3276 20 11.6613 20 12C20 16.4183 16.4183 20 12 20C9.61061 20 7.46589 18.9525 6 17.2916M9 17H6V17.2916M18.2002 4V6.94416M18.2002 6.94416V6.99993L15.2002 7M6 20V17.2916","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"dark:stroke-white stroke-black"})}),"Refresh"]})]})]}),(0,s.jsx)("div",{className:"border-b border-brand-600/20 dark:border-gray-800 px-6 py-3 min-w-2xl",children:(0,s.jsxs)("div",{className:"grid grid-cols-6 gap-4 text-xs font-semibold uppercase tracking-wider text-[var(--text-tertiary)]",children:[(0,s.jsx)("div",{children:"Video ID"}),(0,s.jsx)("div",{children:"Task Type"}),(0,s.jsxs)("div",{className:"cursor-pointer hover:text-brand-600 transition-colors",onClick:()=>P("date"),children:["Date ","date"===i&&("asc"===x?"â":"â")]}),(0,s.jsxs)("div",{className:"cursor-pointer hover:text-brand-600 transition-colors",onClick:()=>P("score"),children:["Score ","score"===i&&("asc"===x?"â":"â")]}),(0,s.jsxs)("div",{className:"cursor-pointer hover:text-brand-600 transition-colors",onClick:()=>P("payout"),children:["Payout ","payout"===i&&("asc"===x?"â":"â")]}),(0,s.jsx)("div",{className:"text-right",children:"Wallet"})]})}),(0,s.jsx)("div",{className:"divide-y divide-brand-600/20 dark:divide-gray-700 min-w-2xl",children:A.map(e=>{var t,a;return M&&!e.sourceVideo?(0,s.jsx)(y(),{href:"/video/".concat(e.video_id),className:"block hover:bg-white/5 transition-colors",children:(0,s.jsx)("div",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"grid grid-cols-6 gap-4 items-center",children:[(0,s.jsx)("div",{className:"font-mono text-sm font-medium dark:text-[var(--text-primary)]",children:e.video_id}),(0,s.jsx)("div",{children:(0,s.jsxs)("span",{className:"inline-block rounded-full bg-brand-50 border border-brand-200 px-2 py-1 text-xs font-medium text-brand-700",children:[(0,s.jsx)("span",{className:"md:hidden",children:I(e.task_type)}),(0,s.jsx)("span",{className:"hidden md:inline",children:e.task_type})]})}),(0,s.jsx)("div",{className:"text-sm dark:text-[var(--text-secondary)]",children:D(e.date)}),(0,s.jsx)("div",{className:"text-sm font-medium dark:text-[var(--text-secondary)]",children:E(e.score)}),(0,s.jsxs)("div",{className:"text-sm font-medium dark:text-[var(--text-secondary)]",children:[(null==(t=e.payout_tao)?void 0:t.toFixed(4))||"0.0000"," TAO"]}),(0,s.jsx)("div",{className:"text-sm font-mono dark:text-[var(--text-secondary)] text-right",children:V(e.wallet)})]})})},"".concat(e.video_id,"-").concat(e.date)):(0,s.jsx)("div",{onClick:()=>e.sourceVideo&&d(e.sourceVideo),className:"cursor-pointer hover:bg-white/5 transition-colors",children:(0,s.jsx)("div",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"grid grid-cols-6 gap-4 items-center",children:[(0,s.jsx)("div",{className:"font-mono text-sm font-medium text-[var(--text-primary)]",children:e.video_id}),(0,s.jsx)("div",{children:(0,s.jsxs)("span",{className:"inline-block rounded-full bg-brand-100 border border-brand-200 px-2 py-1 text-xs font-medium text-brand-700",children:[(0,s.jsx)("span",{className:"md:hidden",children:I(e.task_type)}),(0,s.jsx)("span",{className:"hidden md:inline",children:e.task_type})]})}),(0,s.jsx)("div",{className:"text-sm text-[var(--text-secondary)]",children:D(e.date)}),(0,s.jsx)("div",{className:"text-sm font-medium text-[var(--text-secondary)]",children:E(e.score)}),(0,s.jsxs)("div",{className:"text-sm font-medium text-[var(--text-secondary)]",children:[(null==(a=e.payout_tao)?void 0:a.toFixed(4))||"0.0000"," TAO"]}),(0,s.jsx)("div",{className:"text-sm font-mono text-[var(--text-secondary)] text-right",children:V(e.w
1allet)})]})})},"".concat(e.video_id,"-").concat(e.date))})}),0===A.length&&(0,s.jsxs)("div",{className:"px-6 py-12 text-center",children:[(0,s.jsx)("div",{className:"text-lg font-medium text-[var(--text-secondary)] mb-2",children:"No finalized videos yet"}),(0,s.jsx)("p",{className:"text-sm text-[var(--text-muted)]",children:"Completed submissions will populate this ledger automatically"})]}),j&&(0,s.jsx)("div",{className:"border-t border-red-600/30 bg-red-900/20 px-6 py-4",children:(0,s.jsx)("p",{className:"text-sm font-medium text-red-300",children:j})})]}),(0,s.jsx)(N,{video:n,onClose:()=>d(null)})]})}function w(e){let{isOpen:t,minerHotkey:a,purchases:r,loading:n,error:d,onClose:l,formatTao:o,formatDate:i}=e;return t?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:e=>{e.stopPropagation(),l()}}),(0,s.jsx)("aside",{className:"absolute right-0 top-0 h-full w-full max-w-3xl overflow-hidden border-l border-brand-800/40 bg-panel shadow-strong",onClick:e=>e.stopPropagation(),children:(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-brand-800/35 bg-panel px-6 py-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-[var(--text-primary)]",children:a?"Purchase history":"Select a miner"}),a&&(0,s.jsx)("p",{className:"mt-1 font-mono text-xs text-[var(--text-secondary)]",title:a,children:a})]}),(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),l()},className:"rounded-full border border-brand-700/35 p-2 text-[var(--text-secondary)] transition hover:-translate-y-0.5 hover:border-brand-500/45 hover:text-brand-600","aria-label":"Close purchases",children:(0,s.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,s.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-8 scrollbar-neutral",children:[n&&(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-brand-700/35 px-6 py-12 text-center text-sm text-[var(--text-secondary)]",children:"Loading purchases..."}),!n&&d&&(0,s.jsx)("div",{className:"rounded-2xl border border-danger-500/40 bg-danger-50 px-6 py-12 text-center text-sm text-danger-500",children:d}),!n&&!d&&(!a||0===r.length)&&(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-brand-700/35 px-6 py-12 text-center text-sm text-[var(--text-secondary)]",children:a?"This miner has no purchases yet.":"Choose a miner from the leaderboard to view purchases."}),!n&&!d&&r.length>0&&a&&(0,s.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-brand-800/40",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-brand-900/20 text-sm",children:[(0,s.jsx)("thead",{className:"bg-panel-muted text-xs font-semibold uppercase tracking-wide text-[var(--text-tertiary)]",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Video ID"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Task ID"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-right",children:"Earned TAO"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Purchased At"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Focusing Task"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-brand-900/20 bg-panel",children:r.map(e=>(0,s.jsxs)("tr",{className:"transition hover:bg-panel-muted",children:[(0,s.jsx)("td",{className:"px-6 py-3 font-medium text-[var(--text-primary)]",children:e.video_id}),(0,s.jsx)("td",{className:"px-6 py-3 text-[var(--text-secondary)]",children:e.task_id}),(0,s.jsx)("td",{className:"px-6 py-3 text-right font-semibold text-brand-300",children:o(e.earned_reward_tao)}),(0,s.jsx)("td",{className:"px-6 py-3 text-[var(--text-secondary)]",children:i(e.created_at)}),(0,s.jsx)("td",{className:"px-6 py-3 text-[var(--text-secondary)]",children:e.focusing_task||"-"})]},"".concat(e.video_id,"-").concat(e.task_id,"-").concat(e.created_at)))})]})})]})]})})]}):null}let S=[{id:"activity",label:"Network Pulse",description:"Live validators & evaluations"},{id:"ledger",label:"Payout Ledger",description:"Historical rewards"},{id:"novelty",label:"Novelty Explorer",description:"Task similarity network"}];function _(e){let{tab:t}=e;switch(t){case"activity":return(0,s.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,s.jsx)("path",{d:"M4 12h3l2-7 4 14 2-7h3",strokeLinecap:"round",strokeLinejoin:"round"})});case"ledger":return(0,s.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[(0,s.jsx)("path",{d:"M6 4h8l4 4v12H6z",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 4v4h4",strokeLinecap:"round",strokeLinejoin:"round"})]});case"novelty":return(0,s.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12 1v6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12 17v6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"m4.2 4.2 4.9 4.9",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"m14.9 14.9 4.9 4.9",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1 12h6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M17 12h6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"m4.2 19.8 4.9-4.9",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"m14.9 9.1 4.9-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]});default:return null}}function T(e){let{activeTab:t,onTabChange:a,variant:r="default"}=e,n=S.map(e=>{let r=t===e.id;return(0,s.jsxs)("button",{onClick:()=>a(e.id),className:"cursor-pointer group flex items-center gap-2 rounded-xl text-sm transition-all duration-200 px-5 py-2 ".concat(r?"bg-[#0284c733] dark:text-white border border-brand-600":"bg-panel-muted/80 dark:text-[var(--text-secondary)] hover:bg-[#0284c733]"),children:[(0,s.jsx)("span",{className:"".concat(r?"dark:text-white":"text-brand-500 group-hover:text-brand-700"),children:(0,s.jsx)(_,{tab:e.id})}),(0,s.jsx)("span",{className:"md:inline hidden",children:e.label})]},e.id)});return"inline"===r?(0,s.jsx)("nav",{className:"ml-4 flex flex-nowrap items-center gap-2 whitespace-nowrap flex-shrink-0",children:n}):(0,s.jsx)("nav",{className:"border-b border-brand-700/35 bg-panel backdrop-blur-xl",children:(0,s.jsx)("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-end gap-2 px-4 py-4 sm:px-6 lg:px-8",children:n})})}function C(e){var t,a;let{formatTao:r,formatDate:d,enabled:i=!0}=e,[c,x]=(0,o.useState)([]),[m,u]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),[b,v]=(0,o.useState)(7),[f,g]=(0,o.useState)(null),j=!!n&&i;(0,o.useEffect)(()=>
1{if(!j){p("SN24_API_URL is not configured."),u(!1),x([]);return}let e=!1;return u(!0),p(null),l("/payouts/rewards-period").then(t=>{e||x(t)}).catch(t=>{e||p(t instanceof Error?t.message:"Failed to load rewards data.")}).finally(()=>{e||u(!1)}),()=>{e=!0}},[j]);let y=(0,o.useMemo)(()=>c.find(e=>e.period_days===b),[c,b]),N=(0,o.useMemo)(()=>{if(!y)return[];let e=y.total_rewards_tao/b,t=[];for(let a=0;a<b;a++){let r=new Date;r.setDate(r.getDate()-(b-1-a));let s=e*((Math.random()-.5)*.4+1);t.push({date:r.toISOString().split("T")[0],value:Math.max(0,s),cumulative:t.length>0?t[t.length-1].cumulative+s:s})}return t},[y,b]),k=Math.max(...N.map(e=>e.value),1),w=()=>(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Reward Distribution Over Time"}),(0,s.jsx)("p",{className:"text-sm dark:text-[var(--text-secondary)]",children:"TAO rewards distributed across the network over different time periods"})]});return m?(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:(0,s.jsx)(w,{})}),(0,s.jsx)("div",{className:"rounded-[28px] border border-dashed border-brand-600/40 px-6 py-12 text-center text-sm text-[var(--text-secondary)]",children:"Loading reward data..."})]}):h?(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:(0,s.jsx)(w,{})}),(0,s.jsx)("div",{className:"rounded-[28px] border border-danger-500/40 bg-danger-50 px-6 py-12 text-center text-sm text-danger-500",children:h})]}):(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[(0,s.jsx)(w,{}),(0,s.jsx)("div",{className:"flex items-center gap-3 text-xs font-semibold uppercase tracking-wide dark:text-[var(--text-secondary)]",children:y&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"rounded-full border border-slate-500/70 dark:border-brand-700/30 bg-panel-muted/70 px-3 py-1",children:["Total TAO \xb7 ",r(y.total_rewards_tao)]}),(0,s.jsxs)("span",{className:"rounded-full border border-slate-500/70 dark:border-brand-700/30 bg-panel-muted/70 px-3 py-1",children:["Videos \xb7 ",y.total_videos.toLocaleString()]}),(0,s.jsxs)("span",{className:"rounded-full border border-slate-500/70 dark:border-brand-700/30 bg-panel-muted/70 px-3 py-1",children:["Avg/Video \xb7 ",r(y.average_reward)]})]})})]}),(0,s.jsxs)("div",{className:"overflow-hidden rounded-[28px] border border-brand-700/35 dark:bg-transparent bg-gray-50 dark:shadow-soft",children:[(0,s.jsxs)("div",{className:"border-b border-brand-700/35 px-6 py-5",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Network Rewards Performance"}),(0,s.jsx)("p",{className:"text-xs dark:text-[var(--text-secondary)]",children:"Daily TAO distribution across the network"})]}),(0,s.jsx)("div",{className:"flex gap-2",children:[7,30,90].map(e=>(0,s.jsxs)("button",{onClick:()=>v(e),className:"rounded-lg px-3 py-1.5 text-xs font-medium transition cursor-pointer ".concat(b===e?"bg-brand-600 text-white":"dark:bg-panel-muted dark:text-[var(--text-secondary)] hover:bg-brand-600/20 dark:hover:bg-brand-700/20 dark:hover:text-[var(--text-primary)]"),children:["Last ",e," days"]},e))})]}),y&&(0,s.jsxs)("div",{className:"mt-4 flex items-center gap-6 text-xs dark:text-[var(--text-secondary)]",children:[(0,s.jsxs)("span",{children:["Started: ",d(y.start_date)]}),(0,s.jsxs)("span",{children:["Period: ",y.period_days," days of rewards"]})]})]}),(0,s.jsx)("div",{className:"p-6",children:0===N.length?(0,s.jsx)("div",{className:"flex h-48 items-center justify-center text-sm dark:text-[var(--text-secondary)]",children:"No reward data available for the selected period"}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between text-xs dar
1k:text-[var(--text-secondary)]",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"h-3 w-3 rounded-full bg-gradient-to-r from-brand-500 to-brand-400"}),"Daily Rewards"]}),(0,s.jsxs)("span",{children:[r(k)," TAO"]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-brand-900/20",children:[f&&(0,s.jsxs)("div",{className:"pointer-events-none absolute z-10 rounded-lg border border-brand-600/50 dark:bg-panel px-3 py-2 text-xs font-medium text-[var(--text-primary)] shadow-lg",style:{left:"".concat(f.x/1200*100,"%"),top:"".concat(f.y/300*100,"%"),transform:"translate(-50%, -100%) translateY(-8px)"},children:[(0,s.jsxs)("div",{className:"dark:text-brand-200 text-gray-700",children:[r(f.value)," TAO"]}),(0,s.jsx)("div",{className:"text-gray-600 dark:text-[var(--text-secondary)]",children:new Date(f.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]}),(0,s.jsxs)("svg",{width:"100%",height:300,viewBox:"0 0 1200 ".concat(300),className:"block w-full",preserveAspectRatio:"none",style:{backgroundColor:"var(--color-surface)"},onMouseLeave:()=>g(null),children:[(0,s.jsx)("defs",{children:(0,s.jsx)("pattern",{id:"grid",width:"100",height:"40",patternUnits:"userSpaceOnUse",children:(0,s.jsx)("path",{d:"M 100 0 L 0 0 0 40",fill:"none",stroke:"rgba(14, 165, 233, 0.2)",strokeWidth:"1",strokeDasharray:"2,2"})})}),(0,s.jsx)("rect",{width:"100%",height:"100%",fill:"url(#grid)"}),(0,s.jsxs)("g",{transform:"translate(80, 30)",children:[[0,.25,.5,.75,1].map(e=>(0,s.jsx)("g",{children:(0,s.jsx)("text",{x:"-10",y:240-200*e+4,textAnchor:"end",fontSize:"12",className:"dark:fill-white/60 fill-black",children:r(k*e)})},e)),(0,s.jsx)("path",{d:N.map((e,t)=>{let a=t/(N.length-1)*1040,r=240-e.value/k*200;return"".concat(0===t?"M":"L"," ").concat(a," ").concat(r)}).join(" "),stroke:"url(#lineGradient)",strokeWidth:"2.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:[N.map((e,t)=>{let a=t/(N.length-1)*1040,r=240-e.value/k*200;return"".concat(0===t?"M":"L"," ").concat(a," ").concat(r)}).join(" "),"L ".concat((N.length-1)/(N.length-1)*1040," 240"),"L 0 240","Z"].join(" "),fill:"url(#areaGradient)",opacity:"0.3"}),N.map((e,t)=>{let a=t/(N.length-1)*1040,r=240-e.value/k*200,n=f&&10>Math.abs(f.x-(a+80))&&10>Math.abs(f.y-(r+30));return(0,s.jsxs)("g",{children:[(0,s.jsx)("circle",{cx:a,cy:r,r:"12",fill:"transparent",className:"cursor-pointer",onMouseEnter:t=>{var s;(null==(s=t.currentTarget.ownerSVGElement)?void 0:s.getBoundingClientRect())&&g({x:a+80,y:r+30,value:e.value,date:e.date})}}),(0,s.jsx)("circle",{cx:a,cy:r,r:n?"6":"4",fill:"#0ea5e9",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:n?"3":"2",className:"pointer-events-none transition-all duration-200",style:{filter:n?"drop-shadow(0 0 8px rgba(14, 165, 233, 0.6))":"none"}})]},t)})]}),(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"lineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#0ea5e9"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#38bdf8"})]}),(0,s.jsxs)("linearGradient",{id:"areaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#0ea5e9",stopOpacity:"0.4"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#0ea5e9",stopOpacity:"0.1"})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-2 flex justify-between text-xs dark:text-[var(--text-secondary)]",children:[(0,s.jsx)("span",{children:(null==(t=N[0])?void 0:t.date)&&new Date(N[0].date).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),(0,s.jsx)("span",{children:(null==(a=N[N.length-1])?void 0:a.date)&&new Date(N[N.length-1].date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})})]})]})}let L={8:{name:"RoundTable21"},155:{name:"Owner24"},199:{name:"Opentensor Foundation"},68:{name:"Yuma, a DCG Company"},236:{name:"Crucible Labs"},46:{name:"Rizzo (Insured)"}};function M(){return(0,s.jsxs)("div",{className:"relative w-16 h-16",children:[(0,s.jsx)("div",{className:"absolute inset-0 border-4 border-transparent border-t-brand-400 border-r-brand-300/50 rounded-full animate-spin"}),(0,s.jsx)("div",{className:"absolute inset-2 border-2 border-transparent border-t-brand-500 border-l-brand-400/70 rounded-full animate-spin",style:{animationDirection:"reverse",animationDuration:"2s"}}),(0,s.jsx)("div",{className:"absolute inset-4 bg-brand-400/20 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"absolute inset-6 bg-brand-400 rounded-full animate-ping"})]})}function A(e){let{validator:t}=e,[a,r]=(0,o.useState)(()=>100*Math.random()),[n,d]=(0,o.useState)(()=>Math.floor(20*Math.random()*60)),l=L[t.validator_uid]||{name:"Validator ".concat(t.validator_uid)};return(0,o.useEffect)(()=>{let e=setInterval(()=>{d(e=>{if(e<=0)return r(100),0;let t=e-1;return r((1200-t)/1200*100),t})},1e3);return()=>clearInterval(e)},[]),(0,s.jsxs)("div",{className:"group relative overflow-hidden rounded-3xl border border-brand-700/35 dar
1k:bg-transparent bg-gray-50 dark:shadow-2xl transition-all duration-500 hover:border-brand-500/50 hover:shadow-brand-500/20",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-brand-500/5 via-transparent to-brand-400/5 opacity-0 transition-opacity duration-500 group-hover:opacity-100"}),(0,s.jsxs)("div",{className:"relative p-8",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-6",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-xl bg-gradient-to-r from-brand-500/20 to-brand-400/20 border border-brand-500/30 dark:shadow-lg",children:(0,s.jsx)("span",{className:"dark:text-brand-300 dark:font-bold text-lg",children:t.validator_uid})}),(0,s.jsx)("div",{children:(0,s.jsx)("h3",{className:"text-sm font-semibold ",children:l.name})})]})}),(0,s.jsx)("div",{className:"flex flex-col items-center",children:(0,s.jsx)(M,{})})]}),(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-xs font-semibold dark:text-[var(--text-secondary)] uppercase tracking-wide",children:"Scoring Progress"}),(0,s.jsx)("span",{className:"text-xs font-medium dark:text-brand-300",children:n>0?(e=>{let t=Math.floor(e/60);return"".concat(t,":").concat((e%60).toString().padStart(2,"0"))})(n):"Complete"})]}),(0,s.jsxs)("div",{className:"relative h-2 bg-brand-900/30 rounded-full overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute left-0 top-0 h-full bg-gradient-to-r from-brand-500 to-brand-400 rounded-full transition-all duration-1000 ease-out",style:{width:"".concat(Math.max(0,Math.min(100,a)),"%")}}),(0,s.jsx)("div",{className:"absolute left-0 top-0 h-full w-full bg-gradient-to-r from-transparent via-white/10 to-transparent animate-pulse"})]}),(0,s.jsx)("div",{className:"text-right mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-brand-400 font-semibold",children:[Math.round(a),"%"]})})]})]})]})}function P(e){let{enabled:t=!0}=e,[a,r]=(0,o.useState)(null),[d,i]=(0,o.useState)(!1),[c,x]=(0,o.useState)(null),m=!!n&&t,u=(0,o.useCallback)(async()=>{if(!m){x("SN24_API_URL is not configured."),i(!1),r(null);return}i(!0),x(null);try{let e=await function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1?arguments[1]:void 0,a={sync:e};return t&&(a.block_num=t),l("/miners/validators-weights",{body:a})}(!0);r(e)}catch(e){x(e instanceof Error?e.message:"Failed to load validator status.")}finally{i(!1)}},[m]);return((0,o.useEffect)(()=>{u();let e=setInterval(u,6e5);return()=>clearInterval(e)},[u]),m||d)?(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Validators"}),(0,s.jsx)("p",{className:"text-sm dark:text-[var(--text-secondary)]",children:"Network validator status and processing activity"})]}),a&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs font-semibold uppercase tracking-wide dark:text-[var(--text-secondary)]",children:[(0,s.jsxs)("span",{className:"rounded-full border border-slate-500/70 dark:border-brand-700/30 bg-panel-muted/70 px-3 py-1",children:["Block #",a.block_number.toLocaleString()]}),(0,s.jsxs)("span",{className:"rounded-full border border-green-500/30 bg-green-500/10 px-3 py-1 text-green-400",children:[a.validators.length," Active"]})]})]}),c&&(0,s.jsx)("div",{className:"rounded-2xl border border-danger-500/40 bg-danger-50 px-6 py-12 text-center text-sm text-danger-500",children:c}),d&&!a&&(0,s.jsxs)("div",{className:"rounded-2xl border border-dashed border-brand-600/40 px-6 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(M,{})}),(0,s.jsx)("p",{className:"text-sm text-[var(--text-secondary)] mt-4",children:"Connecting to validator network..."})]}),a&&(0,s.jsx)("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:a.validators.map(e=>(0,s.jsx)(A,{validator:e},e.validator_uid))})]}):(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Validators"}),(0,s.jsx)("p",{className:"text-sm dark:text-[var(--text-secondary)]",children:"Network validator status and processing activity"})]}),(0,s.jsx)("div",{className:"rounded-2xl border border-danger-500/40 bg-danger-50 px-6 py-12 text-center text-sm text-danger-500",children:"API endpoint not configured"})]})}let E=[{id:"vid-001",status:"finalized",submittedAt:"2025-09-28T10:30:00Z",duration:120,taskType:"coding",consensusScore:8.5,payout:.0245,latency:450,walletId:"5F3sa2TJAWMqDhXG6jhV4N8ko9SxwGy8TpaNS1repo5EYjQX",validatorScores:[{validatorId:"val-001",validatorName:"Validator Alpha",completion:9,novelty:8.5,relevance:8,flags:[],reasoning:"Well-structured code implementation with clear documentation."},{validatorId:"val-002",validatorName:"Validator Beta",completion:8.5,novelty:8,relevance:8.5,flags:[],reasoning:"Good task completion, slightly common pattern but well executed."},{validatorId:"val-003",validatorName:"Validator Gamma",completion:8,novelty:9,relevance:8.5,flags:[],reasoning:"Innovative approach to the problem, excellent novelty score."}]}
1,{id:"happyswan",status:"in_process",submittedAt:"2025-09-30T14:15:00Z",duration:90,taskType:"docs",progress:65,evaluationRuns:10,consensusScore:20,problems:[{name:"affine-cipher",difficulty:"Polyglot",status:"completed",time:"12:58 PM",score:100},{name:"beer-song",difficulty:"Polyglot",status:"completed",time:"12:56 PM",score:100},{name:"bowling",difficulty:"Polyglot",status:"sandbox_created",time:"12:38 PM"},{name:"connect",difficulty:"Polyglot",status:"failed",time:"01:08 PM"},{name:"dot-dsl",difficulty:"Polyglot",status:"failed",time:"12:55 PM"},{name:"astropy__astropy-13398",difficulty:"SWE-Bench Hard",status:"failed",time:"01:03 PM"},{name:"astropy__astropy-13579",difficulty:"SWE-Bench Hard",status:"failed",time:"12:53 PM"},{name:"django__django-11138",difficulty:"SWE-Bench Hard",status:"failed",time:"12:56 PM"},{name:"django__django-11400",difficulty:"SWE-Bench Hard",status:"failed",time:"12:59 PM"},{name:"django__django-12325",difficulty:"SWE-Bench Hard",status:"timed_out",time:"01:13 PM"}]},{id:"vid-003",status:"queue",submittedAt:"2025-09-30T15:00:00Z",duration:150,taskType:"browsing"},{id:"vid-004",status:"finalized",submittedAt:"2025-09-27T09:20:00Z",duration:180,taskType:"design",consensusScore:7.2,payout:.0189,latency:520,walletId:"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",validatorScores:[{validatorId:"val-001",validatorName:"Validator Alpha",completion:7.5,novelty:7,relevance:7,flags:[],reasoning:"Solid design work, some room for improvement in uniqueness."},{validatorId:"val-002",validatorName:"Validator Beta",completion:7,novelty:7.5,relevance:7.5,flags:[],reasoning:"Creative approach, task completed adequately."}]},{id:"vid-005",status:"finalized",submittedAt:"2025-09-29T11:45:00Z",duration:200,taskType:"browsing",consensusScore:9.1,payout:.0298,latency:380,walletId:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",validatorScores:[{validatorId:"val-001",validatorName:"Validator Alpha",completion:9.5,novelty:9,relevance:9,flags:[],reasoning:"Excellent browsing workflow, highly relevant to task."},{validatorId:"val-003",validatorName:"Validator Gamma",completion:9,novelty:9.5,relevance:8.5,flags:[],reasoning:"Very innovative navigation pattern, outstanding work."}]},{id:"vid-006",status:"in_process",submittedAt:"2025-09-30T16:30:00Z",duration:110,taskType:"coding",progress:35},{id:"vid-007",status:"finalized",submittedAt:"2025-09-26T13:00:00Z",duration:95,taskType:"docs",consensusScore:6.8,payout:.0156,latency:600,walletId:"5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy",validatorScores:[{validatorId:"val-002",validatorName:"Validator Beta",completion:7,novelty:6.5,relevance:7,flags:["too_short"],reasoning:"Documentation is clear but could be more comprehensive."},{validatorId:"val-003",validatorName:"Validator Gamma",completion:6.5,novelty:7,relevance:6.5,flags:[],reasoning:"Good start but needs more detail for higher score."}]}];E[0],E[3],E[4];var D=a(1362),I=a(5695);let V=(0,o.memo)(function(e){let{theme:t,setTheme:a}=e;return(0,s.jsx)("div",{children:"dark"===t?(0,s.jsx)("button",{onClick:()=>a("light"),className:"cursor-pointer hover:text-brand-400 transition-all duration-100 ease-in","aria-label":"Switch to light mode",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 472 472",children:(0,s.jsx)("path",{fill:"currentColor",d:"m123 95l-30 30l-39-38l30-30zM64 216v43H0v-43h64zM256 4v63h-43V4h43zm159 83l-38 38l-30-30l38-38zm-69 292l30-29l39 38l-30 30zm59-163h64v43h-64v-43zM235 109q53 0 90.5 37.5T363 237t-37.5 90.5T235 365t-90.5-37.5T107 237t37.5-90.5T235 109zm-22 362v-63h43v63h-43zM54 388l39-39l30 30l-39 39z"})})}):(0,s.jsx)("button",{onClick:()=>a("dark"),className:"cursor-pointer hover:text-brand-400 transition-all duration-100 ease-in","aria-label":"Switch to dark mode",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 1472 1536",children:(0,s.jsx)("path",{fill:"currentColor",d:"M1464 1090q-94 203-283 323.5T768 1536q-157-1-299-62t-244.5-163.5T61 1066T0 768q0-205 97.5-378t267-276.5T738 2q43-2 62 38q17 42-16 72q-176 164-176 400q0 111 43 211.5t115 173t172.5 116T1151 1056q119 0 228-51q41-18 72 13t13 72z"})})})})}),z=(0,o.memo)(function(e){let{totalPurchases:t,totalEarned:a,selectedEntry:r,getHotkeyPreview:n,formatTao:d}=e;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs font-semibold uppercase tracking-wide dark:text-[var(--text-secondary)]",children:[(0,s.jsxs)("span",{className:"rounded-full border border-slate-700/50 dark:border-brand-700/30 dark:bg-black/70 px-3 py-1",children:["Total purchases \xb7 ",t.toLocaleStr
1ing()]}),(0,s.jsxs)("span",{className:"rounded-full border border-slate-700/50 dark:border-brand-700/30 dark:bg-black/70 px-3 py-1",children:["Total TAO \xb7 ",d(a)]}),r&&(0,s.jsxs)("span",{className:"rounded-full border border-brand-400 dark:border-brand-400/50 dark:bg-brand-700/30 px-3 py-1 text-brand-300",children:["Viewing ",n(r.miner_hotkey)]})]})});function F(){let e=(0,I.useRouter)(),[t,a]=(0,o.useState)("activity"),[r,d]=(0,o.useState)(null),[c,x]=(0,o.useState)([]),[m,u]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),[b,v]=(0,o.useState)(null),[f,j]=(0,o.useState)([]),[y,S]=(0,o.useState)(!1),[_,L]=(0,o.useState)(null),[M,A]=(0,o.useState)(!1),{theme:F,setTheme:O}=(0,D.D)(),R=!!n,B=(0,o.useCallback)(e=>e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4}),[]),W=(0,o.useCallback)(e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})},[]),G=(0,o.useCallback)(e=>e.length<=10?e:"".concat(e.slice(0,5),"...").concat(e.slice(-5)),[]),H=(0,o.useCallback)(e=>{v(e),A(!0)},[]),U=(0,o.useCallback)(t=>{"novelty"===t?e.push("/dashboard/novelty"):a(t)},[e]);(0,o.useEffect)(()=>{if(!R){p("SN24_API_URL is not configured."),u(!1),x([]),v(null),A(!1);return}let e=!1;return u(!0),p(null),l("/miners/leaderboard").then(t=>{e||(x(t),v(e=>{var a,r;return null!=(r=null!=e?e:null==(a=t[0])?void 0:a.miner_hotkey)?r:null}))}).catch(t=>{e||p(t instanceof Error?t.message:"Failed to load leaderboard.")}).finally(()=>{e||u(!1)}),()=>{e=!0}},[R]),(0,o.useEffect)(()=>{if(!b){j([]),S(!1),L(null),A(!1);return}if(!R){L("SN24_API_URL is not configured."),S(!1),j([]);return}let e=!1;return S(!0),L(null),l("/miners/".concat(b,"/purchases")).then(t=>{e||j(t)}).catch(t=>{e||L(t instanceof Error?t.message:"Failed to load purchase history.")}).finally(()=>{e||S(!1)}),()=>{e=!0}},[b,R]);let{totalPurchases:q,totalEarned:Z,maxPurchases:X,selectedEntry:J}=(0,o.useMemo)(()=>{var e;let t=c.reduce((e,t)=>e+t.purchase_count,0),a=c.reduce((e,t)=>e+t.total_earned_tao,0);return{totalPurchases:t,totalEarned:a,maxPurchases:c.reduce((e,t)=>Math.max(e,t.purchase_count),0),selectedEntry:b&&null!=(e=c.find(e=>e.miner_hotkey===b))?e:null}},[c,b]);return(0,s.jsxs)("main",{className:"relative min-h-screen text-black dark:text-[var(--text-primary)] bg-white dark:bg-transparent",children:[(0,s.jsxs)("header",{className:"sticky top-0 z-50 border-b border-brand-200/40 bg-gray-50 dark:bg-transparent py-4 flex items-center px-4 sm:px-8 lg:px-12 justify-between",children:[(0,s.jsxs)("div",{className:"flex max-w-7xl flex-nowrap items-center gap-2 md:gap-4 text-sm",children:[(0,s.jsx)("div",{className:"relative h-9 w-9 md:h-11 md:w-11 flex-shrink-0 overflow-hidden rounded-full border border-brand-300/40 dark:shadow-soft",children:(0,s.jsx)(g.default,{src:"/sn-logo.svg",alt:"SN 24 mark",fill:!0,priority:!0,sizes:"44px",className:"object-cover"})}),(0,s.jsx)("span",{className:"flex-shrink-0 text-lg md:text-xl font-semibold tracking-tight text-black dark:text-[var(--text-primary)]",children:"SN 24"}),(0,s.jsx)("span",{className:"flex-shrink-0 dark:text-[var(--text-secondary)] font-medium md:inline hidden",children:"Dashboard"}),(0,s.jsx)(T,{activeTab:t,onTabChange:U,variant:"inline"})]}),(0,s.jsx)(V,{theme:F,setTheme:O})]}),(0,s.jsxs)("div",{className:"mx-auto max-w-7xl px-4 pb-16 pt-8 sm:px-6 lg:px-8",children:["activity"===t&&(0,s.jsxs)("div",{className:"space-y-10",children:[(0,s.jsx)(C,{formatTao:B,formatDate:W,enabled:R}),(0,s.jsx)(P,{enabled:R}),(0,s.jsx)(i,{formatTao:B,formatDate:W,getHotkeyPreview:G,enabled:R}),(0,s.jsxs)("section",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Miner Purchase Leaderboard"}),(0,s.jsx)("p",{className:"text-sm dark:text-[var(--text-secondary)]",children:"Top miners ranked by purchased video rewards. Select a miner to inspect their purchase history."})]}),(0,s.jsx)(z,{totalPurchases:q,totalEarned:Z,selectedEntry:J,getHotkeyPreview:G,formatTao:B})]}),m&&(0,s.jsx)("div",{className:"rounded-[28px] border border-dashed border-brand-600 dark:border-brand-600/40 dark:bg-black/60 px-6 py-12 text-center text-sm text-[var(--text-secondary)]",children:"Loading leaderboard..."}),!m&&h&&(0,s.jsx)("div",{className:"rounded-[28px] border border-danger-500/40 bg-danger-50 px-6 py-12 text-center text-sm text-danger-500",children:h}),!m&&!h&&0===c.length&&(0,s.jsx)("div",{className:"rounded-[28px] border border-dashed border-brand-600/40 bg-black/60 px-6 py-12 text-center text-sm dark:text-[var(--text-secondary)]",children:"No miner purchases recorded yet."}),!m&&!h&&c.length>0&&(0,s.jsxs)("div",{className:"overflow-hidden rounded-[28px] border border-brand-700/35 dar
1k:bg-black/70 dark:shadow-soft",children:[(0,s.jsxs)("div",{className:"grid gap-4 border-b border-brand-700/35 bg-gray-50 dark:bg-brand-700/10 px-6 py-5 text-xs font-semibold uppercase tracking-wide dark:text-[var(--text-tertiary)] sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:["Peak purchase volume",(0,s.jsxs)("p",{className:"mt-1 text-lg font-semibold",children:[X.toLocaleString()," buys"]})]}),(0,s.jsxs)("div",{children:["Avg TAO across top miners",(0,s.jsxs)("p",{className:"mt-1 text-lg font-semibold",children:[B(Z/c.length||0)," TAO"]})]})]}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-brand-900/20 text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 dark:bg-brand-700/10 text-xs font-semibold uppercase tracking-wide text-[var(--text-tertiary)]",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Rank"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-left",children:"Miner"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-right",children:"Purchases"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-right",children:"Earned TAO"}),(0,s.jsx)("th",{scope:"col",className:"px-6 py-3 text-right",children:"Actions"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-brand-900/20",children:c.map((e,t)=>{let a=b===e.miner_hotkey;return(0,s.jsxs)("tr",{className:"cursor-pointer transition dark:hover:bg-brand-700/20",onClick:()=>H(e.miner_hotkey),children:[(0,s.jsxs)("td",{className:"px-6 py-4 font-semibold",children:["#",t+1]}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"relative flex flex-col gap-1",children:[(0,s.jsx)("span",{className:"font-mono text-xs font-semibold",children:G(e.miner_hotkey)}),(0,s.jsxs)("span",{className:"font-mono text-xs dark:text-[var(--text-secondary)]",children:[e.purchase_count.toLocaleString()," ","purchases \xb7"," ",B(e.total_earned_tao)," TAO"]})]})}),(0,s.jsx)("td",{className:"px-6 py-4 text-right font-semibold",children:e.purchase_count.toLocaleString()}),(0,s.jsx)("td",{className:"px-6 py-4 text-right font-semibold text-brand-300",children:B(e.total_earned_tao)}),(0,s.jsx)("td",{className:"px-6 py-4 text-right",children:(0,s.jsxs)("button",{type:"button",className:"inline-flex items-center gap-2 rounded-full px-3 py-1.5 text-xs font-semibold uppercase tracking-wide transition cursor-pointer ".concat(a?"border border-brand-400/60 bg-gradient-to-r from-brand-500 to-brand-400 text-white shadow-lg":"border border-brand-700/30 dark:bg-panel-muted dark:text-[var(--text-secondary)] dark:hover:border-brand-500/40 hover:text-brand-600"),onClick:t=>{t.stopPropagation(),H(e.miner_hotkey)},children:["View purchases",(0,s.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)("path",{d:"M5 12h14",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M13 6l6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})})]},e.miner_hotkey)})})]})})]})]})]}),"ledger"===t&&(0,s.jsx)("div",{className:"space-y-10",children:(0,s.jsx)("div",{className:"rounded-card border border-brand-700/35 p-6 dark:shadow-soft dark:bg-transparent bg-gray-50",children:(0,s.jsx)(k,{videos:E,apiAvailable:R})})})]}),(0,s.jsx)(w,{isOpen:M,minerHotkey:b,purchases:f,loading:y,error:_,onClose:()=>A(!1),formatTao:B,formatDate:W}),(0,s.jsx)(N,{video:r,onClose:()=>d(null)}),(0,s.jsx)("footer",{className:"mt-auto border-t border-brand-800/40 bg-transparent",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-col gap-6 px-4 py-8 text-sm dark:text-[var(--text-secondary)] sm:px-6 lg:px-8 md:flex-row md:items-center md:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-semibold dark:text-[var(--text-primary)]",children:"Transparency:"})," ","SN24 currently blends centralized screening with validator audits while we iterate toward full decentralization."]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-5 text-sm font-medium dark:text-brand-600 text-brand-400",children:[(0,s.jsx)("a",{className:"transition hover:text-brand-700",href:"https://github.com/omegalabsinc/omegalabs-bittensor-subnet",children:"GitHub"}),(0,s.jsx)("a",{className:"transition hover:text-brand-700",href:"https://discord.gg/C46TQFdc",children:"Community"})]})]})})]})}},3095:(e,t,a)=>{Promise.resolve().then(a.bind(a,2592))},5695:(e,t,a)=>{"use strict";var r=a(8999);a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}})}},e=>{var t=t=>e(e.s=t);e.O(0,[766,874,441,684,358],()=>t(3095)),_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.