PageSourceSearch

https://fourcastapp.vercel.app/_next/static/chunks/3686-48dc347b98f3b162.js

js fourcastapp.vercel.app collected 2026-10-03 06:58:22 UTC 9,476 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3686],{3686:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(95155),l=a(12115),o=a(98500),n=a(90467),s=a(17615),c=a(22462);function i(){let[e,r]=(0,l.useState)(null),[a,i]=(0,l.useState)(null),d=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=!0,a=()=>fetch("/api/arena/feed?limit=40").then(e=>e.ok?e.json():null).then(a=>{if(!e||!a?.success)return;r(a);let t=a.latest||null;i(t);let l=t?.timestamp||null;if(l&&d.current&&l!==d.current){let e=(t?.decisions||[])[0]?.verdict?.toLowerCase(),r={pass:c.CB.sealed,paper:c.CB.review,reconciled:c.CB.reconciled,breach:c.CB.breach,review:c.CB.review};(0,c.PN)({state:r[e]||c.CB.scanning})}d.current=l}).catch(()=>{});a();let t=setInterval(a,6e4);return()=>{e=!1,clearInterval(t)}},[]);let u=e?.runs||[],p=function(e){let r=[];for(let a of e||[]){for(let e of a.decisions||[])r.push({kind:e.verdict||"LOGGED",outcome:e.outcome,question:e.question,yourProb:e.yourProb,marketProb:e.marketProb,source:e.source,ts:a.timestamp});for(let e of a.executions||[])("executed"===e.status||"paper"===e.status)&&r.push({kind:"executed"===e.status?"EXEC":"PAPER",outcome:e.outcome,question:e.question,shares:e.shares,cost:e.cost,ts:a.timestamp})}return r.sort((e,r)=>new Date(r.ts)-new Date(e.ts)),r.slice(0,20)}(u),b=a?.summary?.dryRun,m=(0,s.p9)({timestamp:a?.timestamp,staleFlag:e?.stale,dryRun:b,laneMode:e?.laneMode}),g=[];if(u.length>0){g.push(`${u.length} cycles`);let e=u.reduce((e,r)=>e+(r.decisions?.length||0),0);e>0&&g.push(`${e} decisions`);let r=u.reduce((e,r)=>e+(r.summary?.tradesExecuted||0),0),a=u.reduce((e,r)=>e+(r.summary?.tradesPaper||0),0);r>0&&g.push(`${r} live${1===r?"":"s"}`),a>0&&g.push(`${a} paper`)}let h=(a?.decisions||[])[0];return(0,t.jsxs)("div",{className:"border-b border-[var(--color-rule)]","aria-label":"Agent live feed",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 px-2 py-1.5 sm:px-3",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-semibold",style:{color:m.color},title:m.stale?"paused"===m.laneMode?"Agent lane paused by operator — showing the last recorded cycles as archive":"No fresh cycle in the last 30 minutes — showing the last recorded state":void 0,children:[(0,t.jsx)("span",{className:`mc-lamp ${m.animated?"mc-lamp--live ":""}inline-block h-1.5 w-1.5 rounded-full`,style:{background:"currentColor"}}),m.label]}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-[var(--color-ink-faint)]",children:["cycle \xb7 ",(0,s.KN)(a.timestamp)]}),a.balances?.tokenBalance!=null&&(0,t.jsxs)("span",{className:"font-mono text-[10px] text-[var(--color-ink-muted)]",children:[a.balances.tokenBalance.toFixed(0)," ",a.balances.tokenSymbol]}),(0,t.jsx)("span",{className:"ml-auto hidden font-mono text-[10px] text-[var(--color-ink-faint)] sm:inline",children:g.join(" \xb7 ")})]}):(0,t.jsx)("span",{className:"font-mono text-[10px] text-[var(--color-ink-faint)]",children:"no agent cycle recorded yet"})}),h&&(0,t.jsxs)(o,{href:"/arena",className:"group flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-[var(--color-rule)] px-2 py-1 sm:px-3",children:[(0,t.jsx)("span",{className:"px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-[0.1em]",style:{color:s.ZT[h.verdict]||"var(--color-ink-faint)",border:`1px solid ${s.ZT[h.verdict]||"var(--color-rule)"}`},children:h.verdict}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12px] text-[var(--color-ink)]",children:[(0,t.jsx)("span",{className:"text-[var(--color-accent)]",children:h.outcome}),(0,t.jsx)("span",{className:"text-[var(--color-ink-faint)]",children:" \xb7 "}),(0,t.jsx)("span",{className:"truncate",children:h.question?.slice(0,50)})]}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-[var(--color-ink-muted)]",children:[Math.round((h.yourProb??0)*100),"% vs ",Math.round((h.marketProb??0)*100),"%"]}),(0,t.jsx)(n.A,{className:"h-3 w-3 text-[var(--color-accent)] transition-transform group-hover:translate-x-0.5"})]}),p.length>0&&(0,t.jsx)("div",{className:"hidden sm:block fc-marquee border-t border-[var(--color-rule)]",children:(0,t.jsx)("div",{className:"fc-marquee__track",children:p.slice(0,12).concat(p.slice(0,12)).map((e,r)=>(0,t.jsxs)("span",{className:"fc-marquee__item",children:[(0,t.jsx)("span",{className:"fc-marquee__dot",style:{background:s.ZT[e.kind]||"var(--color-ink-faint)"}}),(0,t.jsx)("span",{style:{color:s.ZT[e.kind],fontWeight:700},children:e.kind}),(0,t.jsx)("span",{children:e.outcome}),(0,t.jsx)("span",{style:{color:"var(--color-ink-faint)"},children:(0,s.KN)(e.ts)})]},r))})})]})}},17615:(e,r,a)=>{a.d(r,{KN:()=>n,QF:()=>c,ZT:()=>l,fF:()=>s,p9:()=>o,yA:()=>t});let t={ALLOCATE:{color:"var(--color-accent)",border:"var(--color-accent)",label:"ALLOCATE"},PASS:{color:"var(--color-ink-faint)",border:"var(--color-rule-strong)",label:"PASS"},PAPER:{color:"var(--color-review)",border:"var(--color-review)",label:"PAPER"},EXEC:{color:"var(--color-accent)",border:"var(--color-accent)",label:"EXEC"},EXECUTED:{color:"var(--color-accent)",border:"var(--color-accent)",label:"EXECUTED"},executed:{color:"var(--color-accent)",border:"var(--color-accent)",label:"EXECUTED"},dry_run:{color:"var(--color-ink-faint)",border:"var(--color-rule-strong)",label:"SIMULATED"},paper:{color:"var(--color-review)",border:"var(--color-review)",label:"PAPER"},skipped_slippage:{color:"var(--color-sealed)",border:"var(--color-sealed)",label:"SLIPPAGE-SKIP"}},l=Object.fromEntries(Object.entries(t).map(([e,r])=>[e,r.color]));function o({timestamp:e,staleFlag:r=!1,dryRun:a=!1,now:t=Date.now(),laneMode:l="live"}={}){if("paused"===l)return{ageMs:e?Math.max(0,t-new Date(e).getTime()):null,
1stalled:!1,stale:!0,animated:!1,label:"PAUSED",color:"var(--color-sealed)",laneMode:"paused"};let n=function({timestamp:e,staleFlag:r=!1,now:a=Date.now()}={}){let t=e?Math.max(0,a-new Date(e).getTime()):null,l=null!=t&&t>18e5,o=!!r||l;return{ageMs:t,stalled:l,stale:o,animated:null!=t&&!o}}({timestamp:e,staleFlag:r,now:t}),s=n.stale?n.stalled?"STALLED":"STALE":a?"PAPER":"LIVE",c=n.stale||a?"var(--color-sealed)":"var(--color-accent)";return{...n,label:s,color:c,laneMode:"live"}}function n(e){let r=Math.max(0,(Date.now()-new Date(e).getTime())/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${(r/3600).toFixed(1)}h`:`${Math.floor(r/86400)}d`}function s(e){return`${n(e)} ago`}function c({liveEnabled:e=!1}={}){return!0===e}},22462:(e,r,a)=>{a.d(r,{CB:()=>o,Cj:()=>p,PN:()=>d,Vp:()=>i,cG:()=>b});var t=a(95155),l=a(12115);let o={idle:"idle",scanning:"scanning",sealed:"sealed",breach:"breach",review:"review",reconciled:"reconciled"},n={idle:"rgba(121, 245, 183, 0.15)",scanning:"rgba(121, 245, 183, 0.18)",sealed:"rgba(245, 197, 107, 0.15)",breach:"rgba(255, 122, 111, 0.22)",review:"rgba(196, 181, 253, 0.18)",reconciled:"rgba(121, 245, 183, 0.25)"},s={idle:{glow:"rgba(121, 245, 183, 0.05)",glow2:"rgba(245, 197, 107, 0.03)",grid:"rgba(243, 240, 231, 0.035)",grid2:"rgba(243, 240, 231, 0.035)",breatheMin:.25,breatheMax:.4},scanning:{glow:"rgba(121, 245, 183, 0.1)",glow2:"rgba(121, 245, 183, 0.04)",grid:"rgba(243, 240, 231, 0.06)",grid2:"rgba(243, 240, 231, 0.055)",breatheMin:.35,breatheMax:.55},sealed:{glow:"rgba(245, 197, 107, 0.08)",glow2:"rgba(245, 197, 107, 0.04)",grid:"rgba(245, 197, 107, 0.05)",grid2:"rgba(243, 240, 231, 0.04)",breatheMin:.3,breatheMax:.5},breach:{glow:"rgba(255, 122, 111, 0.1)",glow2:"rgba(255, 122, 111, 0.05)",grid:"rgba(255, 122, 111, 0.05)",grid2:"rgba(255, 150, 140, 0.03)",breatheMin:.4,breatheMax:.7},review:{glow:"rgba(196, 181, 253, 0.1)",glow2:"rgba(196, 181, 253, 0.05)",grid:"rgba(196, 181, 253, 0.045)",grid2:"rgba(243, 240, 231, 0.03)",breatheMin:.3,breatheMax:.55},reconciled:{glow:"rgba(121, 245, 183, 0.14)",glow2:"rgba(121, 245, 183, 0.06)",grid:"rgba(121, 245, 183, 0.07)",grid2:"rgba(243, 240, 231, 0.05)",breatheMin:.35,breatheMax:.6}},c=new Set;function i(e){return c.add(e),()=>c.delete(e)}function d({x:e,y:r,state:a}={}){for(let t of c)try{t({x:e,y:r,state:a})}catch{}if("u"<typeof document)return;let t=document.createElement("div");t.className="fc-backdrop-pulse",t.style.setProperty("--pulse-x",null!=e?`${e}px`:"50%"),t.style.setProperty("--pulse-y",null!=r?`${r}px`:"50%"),a&&t.style.setProperty("--pulse-color",n[a]??n.scanning),document.body.appendChild(t),t.addEventListener("animationend",()=>t.remove(),{once:!0}),setTimeout(()=>t.remove(),1200)}window.__emitBackdropPulse=d;let u=(0,l.createContext)(null);function p(){let e=(0,l.useContext)(u);if(!e)throw Error("useBackdrop must be used within BackdropProvider");return e}function b({children:e}){let[r,a]=(0,l.useState)(o.scanning),[n,c]=(0,l.useState)(s[o.scanning]),i=(0,l.useCallback)(e=>{a(r=>r===e?r:(c(s[e]??s.idle),e))},[]);(0,l.useEffect)(()=>{let e=document.documentElement;return e.style.setProperty("--backdrop-glow",n.glow),e.style.setProperty("--backdrop-glow2",n.glow2),e.style.setProperty("--backdrop-grid",n.grid),e.style.setProperty("--backdrop-grid2",n.grid2),e.style.setProperty("--backdrop-breathe-min",String(n.breatheMin)),e.style.setProperty("--backdrop-breathe-max",String(n.breatheMax)),e.setAttribute("data-backdrop-state",r),()=>{Object.keys(n).forEach(r=>{e.style.removeProperty(`--backdrop-${r}`)})}},[r,n]);let p=(0,l.useCallback)(e=>{d({...e,state:e.state||r})},[r]);return(0,t.jsx)(u.Provider,{value:{state:r,setState:i,emitPulse:p},children:e})}}}]);

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.