1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="23ce492a-9a02-58c4-8e15-4205ce271758")}catch(e){}}(); 3import{da as Se,d1 as w,d0 as e,fv as Q,d4 as A,l0 as tt,ig as Re,dl as Ee,l1 as Pe,l2 as at,l3 as rt,l4 as nt,l5 as st,dd as Ie,hj as it,df as De,l6 as ot,l7 as lt}from"./main-Wiv2Ylbr.js";import{B as ct}from"./blueprints-logo-CL8GYwKz.js";import{f as dt,a as ut,b as ft,c as mt,d as ht,e as pt}from"./command-CPTvu1Wz.js";import{c as ae}from"./chart-colors-C6vG_sdT.js";import{R as gt,Y as xt}from"./CartesianChart-BKMcszhY.js";import{A as bt,a as yt}from"./AreaChart-DHeXZKZI.js";import{C as vt}from"./CartesianGrid-CGkL_LCS.js";import{C as wt}from"./calendar-vFWQWzrh.js";import{C as jt}from"./chart-column-8Sd1aN5C.js";import{L as Nt}from"./list-checks-D4UUtcb6.js";import{f as re,A as de}from"./focus-tour-next-button-Rkq0hXgS.js";import{P as kt}from"./prince-CwF1DDwg.js";import"./search-BQSHhHsW.js";const Ct=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Mt=Se("flame",Ct);const Tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],St=Se("image",Tt);var fe={};(function a(n,s,o,l){var c=!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL),y=typeof Path2D=="function"&&typeof DOMMatrix=="function",m=(function(){if(!n.OffscreenCanvas)return!1;try{var r=new OffscreenCanvas(1,1),t=r.getContext("2d");t.fillRect(0,0,1,1);var d=r.transferToImageBitmap();t.createPattern(d,"no-repeat")}catch{return!1}return!0})();function j(){}function g(r){var t=s.exports.Promise,d=t!==void 0?t:n.Promise;return typeof d=="function"?new d(r):(r(j,j),null)}var C=(function(r,t){return{transform:function(d){if(r)return d;if(t.has(d))return t.get(d);var f=new OffscreenCanvas(d.width,d.height),h=f.getContext("2d");return h.drawImage(d,0,0),t.set(d,f),f},clear:function(){t.clear()}}})(m,new Map),N=(function(){var r=Math.floor(16.666666666666668),t,d,f={},h=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(t=function(p){var x=Math.random();return f[x]=requestAnimationFrame(function u(b){h===b||h+r-1<b?(h=b,delete f[x],p()):f[x]=requestAnimationFrame(u)}),x},d=function(p){f[p]&&cancelAnimationFrame(f[p])}):(t=function(p){return setTimeout(p,r)},d=function(p){return clearTimeout(p)}),{frame:t,cancel:d}})(),v=(function(){var r,t,d={};function f(h){function p(x,u){h.postMessage({options:x||{},callback:u})}h.init=function(u){var b=u.transferControlToOffscreen();h.postMessage({canvas:b},[b])},h.fire=function(u,b,T){if(t)return p(u,null),t;var E=Math.random().toString(36).slice(2);return t=g(function(S){function P($){$.data.callback===E&&(delete d[E],h.removeEventListener("message",P),t=null,C.clear(),T(),S())}h.addEventListener("message",P),p(u,E),d[E]=P.bind(null,{data:{callback:E}})}),t},h.reset=function(){h.postMessage({reset:!0});for(var u in d)d[u](),delete d[u]}}return function(){if(r)return r;if(!o&&c){var h=["var CONFETTI, SIZE = {}, module = {};","("+a.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 4`);try{r=new Worker(URL.createObjectURL(new Blob([h])))}catch(p){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",p),null}f(r)}return r}})(),D={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function R(r,t){return t?t(r):r}function M(r){return r!=null}function i(r,t,d){return R(r&&M(r[t])?r[t]:D[t],d)}function O(r){return r<0?0:Math.floor(r)}function B(r,t){return Math.floor(Math.random()*(t-r))+r}function L(r){return parseInt(r,16)}function I(r){return r.map(q)}function q(r){var t=String(r).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:L(t.substring(0,2)),g:L(t.substring(2,4)),b:L(t.substring(4,6))}}function K(r){var t=i(r,"origin",Object);return t.x=i(t,"x",Number),t.y=i(t,"y",Number),t}function G(r){r.width=document.documentElement.clientWidth,r.height=document.documentElement.clientHeight}function V(r){var t=r.getBoundingClientRect();r.width=t.width,r.height=t.height}function _e(r){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=r,t}function Fe(r,t,d,f,h,p,x,u,b){r.save(),r.translate(t,d),r.rotate(p),r.scale(f,h),r.arc(0,0,1,x,u,b),r.restore(
vendor: 3,198 bytes, line 4
4)}function ze(r){var t=r.angle*(Math.PI/180),d=r.spread*(Math.PI/180);return{x:r.x,y:r.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:r.startVelocity*.5+Math.random()*r.startVelocity,angle2D:-t+(.5*d-Math.random()*d),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:r.color,shape:r.shape,tick:0,totalTicks:r.ticks,decay:r.decay,drift:r.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:r.gravity*3,ovalScalar:.6,scalar:r.scalar,flat:r.flat}}function Ge(r,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var d=t.tick++/t.totalTicks,f=t.x+t.random*t.tiltCos,h=t.y+t.random*t.tiltSin,p=t.wobbleX+t.random*t.tiltCos,x=t.wobbleY+t.random*t.tiltSin;if(r.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-d)+")",r.beginPath(),y&&t.shape.type==="path"&&typeof t.shape.path=="string"&&Array.isArray(t.shape.matrix))r.fill(He(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(p-f)*.1,Math.abs(x-h)*.1,Math.PI/10*t.wobble));else if(t.shape.type==="bitmap"){var u=Math.PI/10*t.wobble,b=Math.abs(p-f)*.1,T=Math.abs(x-h)*.1,E=t.shape.bitmap.width*t.scalar,S=t.shape.bitmap.height*t.scalar,P=new DOMMatrix([Math.cos(u)*b,Math.sin(u)*b,-Math.sin(u)*T,Math.cos(u)*T,t.x,t.y]);P.multiplySelf(new DOMMatrix(t.shape.matrix));var $=r.createPattern(C.transform(t.shape.bitmap),"no-repeat");$.setTransform(P),r.globalAlpha=1-d,r.fillStyle=$,r.fillRect(t.x-E/2,t.y-S/2,E,S),r.globalAlpha=1}else if(t.shape==="circle")r.ellipse?r.ellipse(t.x,t.y,Math.abs(p-f)*t.ovalScalar,Math.abs(x-h)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):Fe(r,t.x,t.y,Math.abs(p-f)*t.ovalScalar,Math.abs(x-h)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape==="star")for(var k=Math.PI/2*3,_=4*t.scalar,F=8*t.scalar,z=t.x,U=t.y,Z=5,W=Math.PI/Z;Z--;)z=t.x+Math.cos(k)*F,U=t.y+Math.sin(k)*F,r.lineTo(z,U),k+=W,z=t.x+Math.cos(k)*_,U=t.y+Math.sin(k)*_,r.lineTo(z,U),k+=W;else r.moveTo(Math.floor(t.x),Math.floor(t.y)),r.lineTo(Math.floor(t.wobbleX),Math.floor(h)),r.lineTo(Math.floor(p),Math.floor(x)),r.lineTo(Math.floor(f),Math.floor(t.wobbleY));return r.closePath(),r.fill(),t.tick<t.totalTicks}function We(r,t,d,f,h){var p=t.slice(),x=r.getContext("2d"),u,b,T=g(function(E){function S(){u=b=null,x.clearRect(0,0,f.width,f.height),C.clear(),h(),E()}function P(){o&&!(f.width===l.width&&f.height===l.height)&&(f.width=r.width=l.width,f.height=r.height=l.height),!f.width&&!f.height&&(d(r),f.width=r.width,f.height=r.height),x.clearRect(0,0,f.width,f.height),p=p.filter(function($){return Ge(x,$)}),p.length?u=N.frame(P):S()}u=N.frame(P),b=S});return{addFettis:function(E){return p=p.concat(E),T},canvas:r,promise:T,reset:function(){u&&N.cancel(u),b&&b()}}}function he(r,t){var d=!r,f=!!i(t||{},"resize"),h=!1,p=i(t,"disableForReducedMotion",Boolean),x=c&&!!i(t||{}
4,"useWorker"),u=x?v():null,b=d?G:V,T=r&&u?!!r.__confetti_initialized:!1,E=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,S;function P(k,_,F){for(var z=i(k,"particleCount",O),U=i(k,"angle",Number),Z=i(k,"spread",Number),W=i(k,"startVelocity",Number),Ue=i(k,"decay",Number),qe=i(k,"gravity",Number),Ke=i(k,"drift",Number),ge=i(k,"colors",I),Ze=i(k,"ticks",Number),xe=i(k,"shapes"),Je=i(k,"scalar"),Xe=!!i(k,"flat"),be=K(k),ye=z,ce=[],Qe=r.width*be.x,et=r.height*be.y;ye--;)ce.push(ze({x:Qe,y:et,angle:U,spread:Z,startVelocity:W,color:ge[ye%ge.length],shape:xe[B(0,xe.length)],ticks:Ze,decay:Ue,gravity:qe,drift:Ke,scalar:Je,flat:Xe}));return S?S.addFettis(ce):(S=We(r,ce,b,_,F),S.promise)}function $(k){var _=p||i(k,"disableForReducedMotion",Boolean),F=i(k,"zIndex",Number);if(_&&E)return g(function(W){W()});d&&S?r=S.canvas:d&&!r&&(r=_e(F),document.body.appendChild(r)),f&&!T&&b(r);var z={width:r.width,height:r.height};u&&!T&&u.init(r),T=!0,u&&(r.__confetti_initialized=!0);function U(){if(u){var W={getBoundingClientRect:function(){if(!d)return r.getBoundingClientRect()}};b(W),u.postMessage({resize:{width:W.width,height:W.height}});return}z.width=z.height=null}function Z(){S=null,f&&(h=!1,n.removeEventListener("resize",U)),d&&r&&(document.body.contains(r)&&document.body.removeChild(r),r=null,T=!1)}return f&&!h&&(h=!0,n.addEventListener("resize",U,!1)),u?u.fire(k,z,Z):P(k,z,Z)}return $.reset=function(){u&&u.reset(),S&&S.reset()},$}var le;function pe(){return le||(le=he(null,{useWorker:!0,resize:!0})),le}function He(r,t,d,f,h,p,x){var u=new Path2D(r),b=new Path2D;b.addPath(u,new DOMMatrix(t));var T=new Path2D;return T.addPath(b,new DOMMatrix([Math.cos(x)*h,Math.sin(x)*h,-Math.sin(x)*p,Math.cos(x)*p,d,f])),T}function Ye(r){if(!y)throw new Error("path confetti are not supported in this browser");var t,d;typeof r=="string"?t=r:(t=r.path,d=r.matrix);var f=new Path2D(t),h=document.createElement("canvas"),p=h.getContext("2d");if(!d){for(var x=1e3,u=x,b=x,T=0,E=0,S,P,$=0;$<x;$+=2)for(var k=0;k<x;k+=2)p.isPointInPath(f,$,k,"nonzero")&&(u=Math.min(u,$),b=Math.min(b,k),T=Math.max(T,$),E=Math.max(E,k));S=T-u,P=E-b;var _=10,F=Math.min(_/S,_/P);d=[F,0,0,F,-Math.round(S/2+u)*F,-Math.round(P/2+b)*F]}return{type:"path",path:t,matrix:d}}function Ve(r){var t,d=1,f="#000000",h='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof r=="string"?t=r:(t=r.text,d="scalar"in r?r.scalar:d,h="fontFamily"in r?r.fontFamily:h,f="color"in r?r.color:f);var p=10*d,x=""+p+"px "+h,u=new OffscreenCanvas(p,p),b=u.getContext("2d");b.font=x;var T=b.measureText(t),E=Math.ceil(T.actualBoundingBoxRight+T.actualBoundingBoxLeft),S=Math.ceil(T.actualBoundingBoxAscent+T.actualBoundingBoxDescent),P=2,$=T.actualBoundingBoxLeft+P,k=T.actualBoundingBoxAscent+P;E+=P+P,S+=P+P,u=new OffscreenCanvas(E,S),b=u.getContext("2d"),b.font=x,b.fillStyle=f,b.fillText(t,$,k);var _=1/d;return{type:"bitmap",bitmap:u.transferToImageBitmap(),matrix:[_,0,0,_,-E*_/2,-S*_/2]}}s.exports=function(){return pe().apply(this,arguments)},s.exports.reset=function(){pe().reset()},s.exports.create=he,s.exports.shapeFromPath=Ye,s.exports.shapeFromText=Ve})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),fe,!1);const Rt=fe.exports;fe.exports.create;function Et({markets:a,answerSlug:n,answerTitle:s,wrongSlugs:o,lockedSlug:l,done:c,onPick:y}){const[m,j]=w.useState(""),[g,C]=w.useState(!1),N=w.useRef(null),v=w.useMemo(()=>new Set(o),[o]),D=w.useMemo(()=>{const M=new Map;for(const i of a)M.set(i.slug,i);return M},[a]),R=w.useMemo(()=>a.filter(M=>!v.has(M.slug)),[a,v]);return w.useEffect(()=>{if(!g)return;function M(i){N.current&&!N.current.contains(i.target)&&C(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[g]),e.jsxs("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-col",children:[e.jsx(It,{wrongSlugs:o,lockedSlug:l,answerSlug:n,answerTitle:s,titleBySlug:D}),!c&&e.jsx("div",{ref:N,"data-tour":"search",children:e.jsxs("div",{className:"relative w-full overflow-hidden rounded-lg bg-border p-px",children:[o.length===0&&!g&&e.jsx("span",{"aria-hidden":!0,
4className:"pointer-events-none absolute left-1/2 top-1/2 aspect-square w-[400%] -translate-x-1/2 -translate-y-1/2 animate-[spin_5s_linear_infinite] motion-reduce:animate-none",style:{background:"conic-gradient(from 0deg, transparent 0deg, transparent 70deg, rgba(18,160,240,0.55) 90deg, transparent 110deg, transparent 250deg, rgba(18,160,240,0.55) 270deg, transparent 290deg)"}}),e.jsxs(dt,{shouldFilter:!0,className:"relative overflow-hidden rounded-[7px] bg-surface shadow-well",onKeyDown:M=>{M.key==="Escape"&&C(!1)},children:[e.jsx(ut,{placeholder:"Search marketsâ¦",value:m,onValueChange:M=>{j(M),M&&C(!0)},onFocus:()=>C(!0),className:"text-[16px] sm:text-[13px]"}),e.jsx(Q,{initial:!1,children:g&&e.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:[.32,.72,.3,1]},className:"overflow-hidden",children:e.jsxs(ft,{maxHeight:"md",children:[e.jsx(mt,{children:"No markets match."}),e.jsx(ht,{children:R.map(M=>e.jsxs(pt,{value:`${M.displayTitle} ${M.slug}`,onSelect:()=>{y(M.slug),j(""),C(!1)},className:"gap-2.5",children:[e.jsx("img",{src:M.image,alt:"",className:"size-7 shrink-0 self-start rounded-md object-cover ring-1 ring-inset ring-fg/10"}),e.jsx("span",{className:"text-wrap text-[12px] leading-snug text-fg",children:M.displayTitle})]},M.slug))})]})},"list")})]})]})})]})}const Pt={correct:{bg:"rgba(52,211,153,0.10)",ring:"rgba(52,211,153,0.35)",color:"var(--color-pass)"},"near-miss":{bg:"rgba(245,166,35,0.08)",ring:"rgba(245,166,35,0.30)",color:"var(--color-warning)"},wrong:{bg:"rgba(248,113,113,0.05)",ring:"rgba(248,113,113,0.18)",color:"var(--color-fail)"}};function It({wrongSlugs:a,lockedSlug:n,answerSlug:s,answerTitle:o,titleBySlug:l}){const c=n&&n===s?l.get(n)??null:null,y=[];for(const m of a){const j=l.get(m);if(!j)continue;const g=tt(j.displayTitle,o)?"near-miss":"wrong";y.push({market:j,kind:g})}return c&&y.push({market:c,kind:"correct"}),y.length===0?null:e.jsxs("div",{className:"flex w-full flex-col gap-1.5",children:[e.jsxs("div",{"aria-hidden":!0,className:"flex items-center gap-2 pt-0.5 text-[9px] font-semibold uppercase tracking-[0.12em] text-fg-disabled",children:[e.jsx("span",{className:"h-px flex-1 bg-gradient-to-r from-transparent via-border to-border"}),"Your guesses",e.jsx("span",{className:"h-px flex-1 bg-gradient-to-l from-transparent via-border to-border"})]}),y.map(({market:m,kind:j},g)=>e.jsx(Dt,{market:m,kind:j,index:g},m.slug))]})}function Dt({market:a,kind:n,index:s}
4){const o=Pt[n];return e.jsxs(A.div,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},transition:{duration:.22,delay:s*.06},className:"flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2",style:{background:o.bg,boxShadow:`inset 0 0 0 1px ${o.ring}`},children:[e.jsx("span",{"aria-hidden":!0,className:"w-4 shrink-0 text-center font-mono text-[10px] font-semibold tabular-nums text-fg-muted",children:s+1}),e.jsx("img",{src:a.image,alt:"",className:"size-8 shrink-0 rounded-md object-cover ring-1 ring-inset ring-fg/10",style:{filter:n==="correct"?"none":"grayscale(0.85)"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[12px] font-medium text-fg",style:{textDecoration:n==="wrong"?"line-through":"none"},children:a.displayTitle}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 text-[10px] text-fg-muted",children:[e.jsx("span",{className:"font-mono tabular-nums",children:Bt(a.yesPrice)}),e.jsx("span",{className:"text-fg-disabled",children:"·"}),e.jsx("span",{className:"font-mono tabular-nums",children:Lt(a.volume)})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[n==="near-miss"&&e.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider",style:{background:"rgba(245,166,35,0.18)",color:o.color},children:"Close"}),e.jsx(At,{kind:n})]})]})}function At({kind:a}){return a==="correct"?e.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-pass/20",children:e.jsx(Re,{className:"size-3 text-pass",strokeWidth:3})}):a==="wrong"?e.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-fail/15",children:e.jsx(Ee,{className:"size-3 text-fail",strokeWidth:3})}):null}function Bt(a){return a===void 0||!Number.isFinite(a)?"â":`${Math.round(a*100)}¢`}function Lt(a){return!a||a<=0?"â":a>=1e6?`$${(a/1e6).toFixed(a>=1e7?0:1)}M`:a>=1e3?`$${Math.round(a/1e3)}K`:`$${Math.round(a)}`}const H={top:6,right:4,bottom:14,left:22};function Ot({series:a,revealed:n,height:s=80}){const o=w.useId(),l=w.useMemo(()=>(a??[]).map(g=>({...g})),[a]);if(!a||a.length===0)return e.jsx("div",{className:"w-full rounded-md border border-dashed border-border/60",style:{height:s},children:e.jsx("div",{className:"h-full w-full animate-pulse rounded-md",style:{background:"linear-gradient(90deg, rgba(18,160,240,0.05) 0%, rgba(18,160,240,0.12) 50%, rgba(18,160,240,0.05) 100%)"}})});const c=s-H.top-H.bottom,y=[0,50,100],m=a[0].t,j=a[a.length-1].t;return e.jsxs("div",{className:"relative w-full",style:{height:s},children:[e.jsx("div",{className:"absolute inset-0","aria-hidden":"true",style:{filter:n?"none":"blur(10px) saturate(1.2)",opacity:n?1:.55,transition:"filter 0.4s ease, opacity 0.4s ease"},children:e.jsx(gt,{width:"100%",height:"100%",children:e.jsxs(bt,{data:l,margin:{top:H.top,right:H.right,bottom:H.bottom,left:H.left},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ae.accent,stopOpacity:.35}),e.jsx("stop",{offset:"100%",stopColor:ae.accent,stopOpacity:0})]})}),e.jsx(vt,{horizontal:!0,vertical:!1,stroke:ae.gridline,strokeDasharray:"2 3"}),e.jsx(xt,{hide:!0,domain:[0,1],ticks:[0,.5,1]}),e.jsx(yt,{type:"linear",dataKey:"p",stroke:ae.accent,strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",fill:`url(#${o})`,isAnimationActive:!1,dot:!1})]})})}),e.jsxs("div",{className:"pointer-events-none absolute inset-0 font-mono text-[9px] leading-none text-fg-muted",children:[y.map(g=>{const C=H.top+(1-g/100)*c;return e.jsxs("span",{className:"absolute tabular-nums",style:{top:C,left:H.left-4,transform:"translate(-100%, -50%)"},children:[g,"%"]},g)}),e.jsx("span",{className:"absolute tabular-nums",style:{bottom:0,left:H.left},children:ve(m)}),e.jsx("span",{className:"absolute tabular-nums",style:{bottom:0,right:H.right},children:ve(j)})]})]})}const $t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ve(a){const n=new Date(a*1e3);return Number.isNaN(n.getTime())?"":`${$t[n.getMonth()]} ${n.getDate()}`}
4const _t=["price","category","resolution","volume","image","title"],Ae="blur(10px) saturate(1.3)",Ft="repeating-linear-gradient(90deg, rgba(0,0,0,0.12) 0 3px, rgba(0,0,0,0.04) 3px 6px)",zt="repeating-linear-gradient(90deg, rgba(0,0,0,0.14) 0 3px, rgba(0,0,0,0.05) 3px 6px)";function Gt({market:a,revealLevel:n,unmasked:s=!1,dayKey:o}){const l=R=>{if(s)return!0;const M=_t.indexOf(R);return M>=0&&M<n},c=l("category"),y=l("resolution"),m=l("volume"),j=l("price"),g=l("image"),C=l("title"),N=Pe(a.category),v=at(a.displayTitle,2,o),D=rt(a.description,a.displayTitle);return e.jsxs("div",{"data-tour":"card",className:"relative w-full rounded-xl border border-border bg-surface font-sans shadow-overlay",children:[e.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-4 py-4",children:[e.jsxs("div",{className:"relative size-12 shrink-0 overflow-hidden rounded-md bg-surface-3 ring-1 ring-inset ring-fg/10",children:[e.jsx(Q,{mode:"wait",children:g?e.jsx(A.img,{src:a.image,alt:"",className:"size-full object-cover",initial:{filter:"blur(10px)",opacity:.3,scale:1.08},animate:{filter:"blur(0px)",opacity:1,scale:1},transition:{duration:.6,ease:[.32,.72,.3,1]}},"img-real"):e.jsxs(A.div,{initial:{opacity:0}
4,animate:{opacity:1},exit:{opacity:0},className:"size-full",style:{background:`linear-gradient(135deg, 5 ${N.bg.replace("0.12",c?"0.3":"0.12")} 0%, 6 rgba(0,0,0,0.04) 100%)`},children:[c?null:e.jsx(Be,{rows:3}),e.jsx(oe,{ariaLabel:"Image clue",className:"absolute inset-0 z-10 m-auto"})]},"img-placeholder")}),!g&&e.jsx("div",{className:"pointer-events-none absolute inset-0 backdrop-blur-md"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Ht,{tokens:v.tokens,showTitle:C,fullTitle:a.displayTitle,showAll:s})}),j&&a.yesPrice!==void 0&&e.jsxs(A.span,{"data-tour":"price-chip",initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.35},className:"shrink-0 font-mono text-[18px] font-bold leading-none tabular-nums tracking-tight text-brand",children:[Math.round(a.yesPrice*100),"¢"]})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx(Wt,{category:a.category,revealed:c})})]})]}),e.jsx("div",{className:"border-b border-border px-4 py-3",children:e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{series:a.priceSeries,revealed:m,height:92}),!m&&e.jsx(oe,{ariaLabel:"Graph clue",className:"absolute inset-0 z-10 m-auto"})]})}),e.jsx(we,{icon:e.jsx(wt,{className:"size-3 text-fg-muted"}),label:"Resolves",clueLabel:"Resolves clue",revealed:y,redactedWidth:96,children:nt(a.endDate)}),e.jsx(Yt,{text:D,revealed:y}),e.jsx(we,{icon:e.jsx(jt,{className:"size-3 text-fg-muted"}),label:"Volume",clueLabel:"Volume clue",revealed:m,redactedWidth:104,children:st(a.volume)})]})}function Wt({category:a,revealed:n}){const s=Pe(a);return e.jsxs(A.div,{layout:!0,"data-tour":"category",className:"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider transition-colors",style:{background:n?s.bg:"rgba(0,0,0,0.05)",color:n?s.text:"var(--color-fg-muted)"},animate:{opacity:1},children:[e.jsx(A.span,{className:"size-1.5 rounded-full",style:{background:n?s.dot:"var(--color-fg-muted)"},animate:n?{scale:[1,1.4,1]}:{scale:1},transition:{duration:.5}}),e.jsx(Q,{mode:"wait",initial:!1,children:n?e.jsx(A.span,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25},children:a},`cat-${a}`):e.jsx(A.span,{initial:{opacity:0}
6,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:"Category"},"cat-hidden")})]})}function Ht({tokens:a,showTitle:n,fullTitle:s,showAll:o}){return o?e.jsx(A.h2,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.3},className:"font-display text-[14px] font-bold leading-snug tracking-tight text-balance text-fg",children:s}):e.jsx("h2",{className:"font-display text-[14px] font-bold leading-snug tracking-tight text-balance text-fg",children:n?e.jsx("span",{className:"inline-flex flex-wrap items-baseline gap-x-1.5 gap-y-1",children:a.map((l,c)=>l===null?e.jsx(X,{height:12,width:28+c%3*14,strong:!0,className:"inline-block align-middle"},`gap-${c}`):e.jsx(A.span,{initial:{opacity:0,filter:"blur(6px)",y:4},animate:{opacity:1,filter:"blur(0px)",y:0},transition:{duration:.35,delay:c*.04},className:"inline-block",children:l},`word-${c}-${l}`))}):e.jsx(Be,{rows:2,inline:!1})})}function Yt({text:a,revealed:n}){return e.jsxs("div",{className:"relative flex items-start gap-2 border-t border-border px-4 py-1.5",children:[e.jsxs("span",{className:"mt-px flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-wide text-fg-muted",children:[e.jsx(Nt,{className:"size-3 text-fg-muted"}),"Criteria"]}),e.jsx("div",{className:"min-h-[16px] min-w-0 flex-1 text-right",children:e.jsx(Q,{mode:"wait",initial:!1,children:n&&a?e.jsx(A.span,{initial:{opacity:0,filter:"blur(8px)",y:4},animate:{opacity:1,filter:"blur(0px)",y:0},transition:{duration:.4,ease:[.32,.72,.3,1]},className:"block text-[11px] leading-snug text-fg text-pretty text-right",children:a},"crit-real"):e.jsxs(A.span,{initial:{opacity:0}
6,animate:{opacity:1},exit:{opacity:0},className:"relative block",children:[e.jsxs("span",{className:"block space-y-1",style:{filter:Ae},children:[e.jsx(X,{height:8,className:"ml-auto"}),e.jsx(X,{height:8,width:"70%",className:"ml-auto"})]}),e.jsx(oe,{ariaLabel:"Criteria clue",className:"absolute top-1/2 right-1 z-10 -translate-y-1/2"})]},"crit-hidden")})})]})}function we({icon:a,label:n,clueLabel:s,revealed:o,redactedWidth:l,children:c}){return e.jsxs("div",{className:"relative flex items-center justify-between border-t border-border px-4 py-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-fg-muted",children:[a,n]}),e.jsx("div",{className:"min-h-[16px] text-right",children:e.jsx(Q,{mode:"wait",initial:!1,children:o?e.jsx(A.span,{initial:{opacity:0,filter:"blur(8px)",y:4},animate:{opacity:1,filter:"blur(0px)",y:0},transition:{duration:.4,ease:[.32,.72,.3,1]},className:"block text-[11px] font-medium text-fg",children:c},"stat-real"):e.jsxs(A.span,{initial:{opacity:0}
6,animate:{opacity:1},exit:{opacity:0},className:"relative inline-block align-middle",style:{width:l},children:[e.jsx("span",{className:"block",style:{filter:Ae},children:e.jsx(X,{})}),e.jsx(oe,{ariaLabel:s,className:"absolute top-1/2 right-1 z-10 -translate-y-1/2"})]},"stat-hidden")})})]})}function X({height:a=10,width:n="100%",strong:s=!1,className:o}){return e.jsx("span",{"aria-hidden":!0,className:Ie("block rounded-sm",o),style:{height:a,width:n,background:s?zt:Ft}})}function oe({ariaLabel:a,className:n}){return e.jsx("span",{role:"img","aria-label":a,className:Ie("inline-flex size-5 items-center justify-center rounded-full border border-border bg-fg/10 shadow-tooltip backdrop-blur-sm",n)})}function Be({rows:a=2,words:n=0,inline:s=!1}){return s&&n>0?e.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center gap-1 align-baseline",children:Array.from({length:n}).map((o,l)=>e.jsx(X,{height:12,width:32+l%3*14,strong:!0,className:"inline-block"},`w-${l}`))}):e.jsx("span",{className:"block space-y-1.5",children:Array.from({length:a}).map((o,l)=>e.jsx(X,{width:l===a-1?"65%":"100%"},`r-${l}`))})}function Vt({correct:a,streak:n,attemptsUsed:s,maxGuesses:o,dayKey:l}){const c=qt({correct:a,attemptsUsed:s,maxGuesses:o}),y=Le({correct:a,attemptsUsed:s,maxGuesses:o});return e.jsx("div",{role:"img","aria-label":"Share image preview",className:"w-full rounded-2xl bg-bg px-4 pt-4 shadow-card",children:e.jsx("div",{className:"overflow-hidden rounded-xl bg-bg",children:e.jsxs("div",{className:"px-7 pt-7 pb-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"inline-flex items-center rounded-full bg-brand/15 px-3 py-1.5 text-[12px] font-medium text-brand",children:e.jsx("span",{children:"The Daily Market"})}),e.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-muted",children:l})]}),e.jsx("div",{className:"mt-7 font-display text-[42px] font-bold leading-none tracking-[-0.04em] text-fg",children:y}),e.jsx("div",{className:"mt-4 flex gap-2",children:c.map(m=>e.jsx("div",{className:`h-3 flex-1 rounded-[4px] ${m.state==="hit"?"bg-pass":m.state==="miss"?"bg-brand":"bg-surface-3"}`},m.key))}),e.jsx("div",{className:"mt-5 border-t border-border pt-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[12px] text-fg-muted",children:`ð¥ ${n}`}),e.jsx("div",{className:"font-mono text-[12px] text-fg",children:"thedailymarket.dev"})]})})]})})})}function Le({correct:a,attemptsUsed:n,maxGuesses:s}){return a?`${n}/${s}`:`X/${s}`}function Ut({correct:a,attemptsUsed:n,maxGuesses:s}){return Array.from({length:s},(o,l)=>l>=n?"â¬":l===n-1&&a?"ð©":"ð¥").join("")}function Oe({correct:a,attemptsUsed:n,maxGuesses:s}){return Array.from({length:s},(o,l)=>l>=n?"empty":l===n-1&&a?"hit":"miss")}function qt({correct:a,attemptsUsed:n,maxGuesses:s}){return Oe({correct:a,attemptsUsed:n,maxGuesses:s}).map((o,l)=>({key:`guess-slot-${l+1}`,state:o}))}const J=720,ee=16,Kt=24,Zt=18,Y=44,ne=28,je=12,Ne=10;async function Jt({correct:a,streak:n,attemptsUsed:s,maxGuesses:o,dayKey:l}){const c=Oe({correct:a,attemptsUsed:s,maxGuesses:o}),y=Le({correct:a,attemptsUsed:s,maxGuesses:o}),m=document.createElement("canvas");if(m.width=J,m.height=520,!m.getContext("2d"))throw new Error("Canvas context unavailable");const C=ne+34+62,N=C+30,v=N+je+16,D=v+18,R=Math.max(238,D+4-ee),M=R+ee*2;m.height=M;const i=m.getContext("2d");if(!i)throw new Error("Canvas context unavailable");i.fillStyle="#232323",se(i,0,0,J,M,Kt),i.fill(),i.fillStyle="#191919",se(i,ee,ee,J-ee*2,R,Zt),i.fill(),i.fillStyle="#0c3a5c",se(i,Y,ne,186,34,17),i.fill(),i.font="500 17px Inter, ui-sans-serif, sans-serif",i.fillStyle="#12A0F0",i.fillText("The Daily Market",Y+18,ne+21),i.font='500 18px "Geist Mono", ui-monospace, monospace',i.fillStyle="#7a7a77";const O=i.measureText(l).width;i.fillText(l,J-Y-O,ne+22),i.font='700 60px "Bricolage Grotesque", ui-sans-serif, sans-serif',i.fillStyle="#ffffff",i.fillText(y,Y,C);const B=`ð¥ ${n}`;i.font="500 17px Inter, ui-sans-serif, sans-serif",i.fillStyle="#7a7a77",i.fillText(B,Y,D);const I=(J-Y*2-Ne*(c.length-1))/c.length;
6c.forEach((G,V)=>{i.fillStyle=G==="hit"?"#34d399":G==="miss"?"#12A0F0":"#2E2E2C",se(i,Y+V*(I+Ne),N,I,je,4),i.fill()}),i.strokeStyle="#3e3e3c",i.lineWidth=1,i.beginPath(),i.moveTo(Y,v),i.lineTo(J-Y,v),i.stroke(),i.font='600 18px "Geist Mono", ui-monospace, monospace',i.fillStyle="#ffffff";const q="thedailymarket.dev",K=i.measureText(q).width;return i.fillText(q,J-Y-K,D),Xt(m)}function Xt(a){return new Promise((n,s)=>{a.toBlob(o=>{if(o){n(o);return}s(new Error("Canvas export failed"))},"image/png")})}function se(a,n,s,o,l,c){a.beginPath(),a.moveTo(n+c,s),a.arcTo(n+o,s,n+o,s+l,c),a.arcTo(n+o,s+l,n,s+l,c),a.arcTo(n,s+l,n,s,c),a.arcTo(n,s,n+o,s,c),a.closePath()}function Qt(){const[a,n]=w.useState(()=>Date.now());w.useEffect(()=>{const y=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(y)},[]);const s=new Date(a);s.setUTCHours(24,0,0,0);const o=Math.max(0,s.getTime()-a),l=Math.floor(o/36e5),c=Math.floor(o%36e5/6e4);return{hours:l,minutes:c}}function ea({correct:a,streak:n,attemptsUsed:s,maxGuesses:o,dayKey:l,marketTitle:c}){const[y,m]=w.useState(null),{hours:j,minutes:g}=Qt(),C=Ut({correct:a,attemptsUsed:s,maxGuesses:o}),N=a?`Solved in ${s}/${o} · streak ${n}`:`Missed · ${s}/${o}`,v=async()=>{const R=[`Blueprints · Daily Market · ${l}`,C,N,"useblueprints.ai/daily"];try{await navigator.clipboard.writeText(R.join(` 7`)),ke("text",m)}catch{}},D=async()=>{if(!(!navigator.clipboard?.write||typeof ClipboardItem>"u"))try{const R=await Jt({correct:a,streak:n,attemptsUsed:s,maxGuesses:o,dayKey:l,marketTitle:c,blocks:C,statusLine:N});await navigator.clipboard.write([new ClipboardItem({"image/png":R})]),ke("image",m)}catch{}};return e.jsxs(A.div,{"data-tour":"result",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.35,ease:[.32,.72,.3,1]}
7,className:"flex w-full flex-col gap-4 rounded-2xl border border-border bg-bg p-5",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2.5 text-center",children:[e.jsx(A.span,{initial:{scale:0,rotate:-20},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:240,damping:14},className:`flex size-11 items-center justify-center rounded-full ${a?"bg-pass":"bg-fail"}`,children:a?e.jsx(Re,{className:"size-5 text-fg",strokeWidth:3}):e.jsx(Ee,{className:"size-5 text-fg",strokeWidth:3})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-display text-[20px] font-bold leading-tight tracking-tight text-balance text-fg",children:a?"Nailed it":"Out of guesses"}),e.jsx("div",{className:"mt-1 text-[12px] text-pretty text-fg-muted",children:a?`Solved in ${s} ${s===1?"guess":"guesses"}.`:"The real market is highlighted above."})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(Me,{label:"Streak",value:n.toString(),accent:a&&n>0,suffix:n>0?e.jsx(Mt,{className:"size-3.5 text-warning"}):null}),e.jsx(Me,{label:"Guesses",value:`${s}/${o}`})]}),e.jsx(Vt,{correct:a,streak:n,attemptsUsed:s,maxGuesses:o,dayKey:l,marketTitle:c,blocks:C,statusLine:N}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(Ce,{icon:e.jsx(St,{className:"size-3.5"}),label:"Copy image",copiedLabel:"Image copied!",copied:y==="image",variant:"outline",onClick:D}),e.jsx(Ce,{icon:e.jsx(it,{className:"size-3.5"}),label:"Copy result",copiedLabel:"Copied!",copied:y==="text",onClick:v})]}),e.jsxs("p",{className:"text-center text-[10px] text-fg-disabled",children:["Next market in"," ",e.jsxs("span",{className:"font-mono tabular-nums text-fg-muted",children:[j,"h ",g,"m"]})]})]})}function ke(a,n){n(a),window.setTimeout(()=>n(null),1500)}function Ce({icon:a,label:n,copiedLabel:s,copied:o,onClick:l,variant:c="default"}){return e.jsxs(De,{variant:c,size:"sm",className:"relative flex w-full items-center justify-center gap-1.5 rounded-lg px-4 py-2.5 text-[12px] font-semibold transition-[background-color,scale] active:scale-[0.96]",type:"button",onClick:l,children:[a,e.jsx(Q,{mode:"wait",initial:!1,children:e.jsx(A.span,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.2},children:o?s:n},o?`${n}-copied`:n)})]})}function Me({label:a,value:n,accent:s,suffix:o}){return e.jsxs("div",{className:"rounded-lg border border-border bg-surface px-3 py-2.5",children:[e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-fg-muted",children:a}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[e.jsx("span",{className:`font-mono tabular-nums text-[20px] font-bold leading-none tracking-tight ${s?"text-brand":"text-fg"}`,children:n}),o]})]})}const $e="blueprints_daily_v4",te=6;function ie(a){return{day:a,guesses:[],done:null,streak:0,lastCompletedDay:null}}function Te(a){if(typeof window>"u")return ie(a);try{const n=window.localStorage.getItem($e);if(!n)return ie(a);const s=JSON.parse(n);return s.day===a?s:{day:a,guesses:[],done:null,streak:s.streak??0,lastCompletedDay:s.lastCompletedDay??null}}catch{return ie(a)}}function ta(a){if(!(typeof window>"u"))try{window.localStorage.setItem($e,JSON.stringify(a))}catch{}}function aa(a,n){const s=new Date(`${a}T00:00:00`),o=new Date(`${n}T00:00:00`);return Number.isNaN(s.getTime())||Number.isNaN(o.getTime())?!1:Math.round((o.getTime()-s.getTime())/(1e3*60*60*24))===1}function ra(a){const[n,s]=w.useState(()=>Te(a));w.useEffect(()=>{n.day!==a&&s(Te(a))},[a,n.day]),w.useEffect(()=>{ta(n)},[n]);const o=w.useMemo(()=>n.done?.correct?n.guesses.slice(0,-1):n.guesses,[n.guesses,n.done?.correct]),l=Math.min(te,1+o.length),c=n.guesses.length,y=Math.max(0,te-c),m=n.done,j=w.useCallback((C,N)=>{s(v=>{if(v.done||v.guesses.includes(C)||v.guesses.length>=te)return v;const D=[...v.guesses,C],R=C===N,M=D.length>=te;if(!R&&!M)return{...v,guesses:D};const i=R?v.lastCompletedDay&&aa(v.lastCompletedDay,v.day)?v.streak+1:1:0;return{...v,guesses:D,done:{correct:R,pickedSlug:C}
7,streak:i,lastCompletedDay:R?v.day:v.lastCompletedDay}})},[]),g=w.useCallback(()=>{s(ie(a))},[a]);return{guesses:n.guesses,wrongSlugs:o,revealLevel:l,attemptsUsed:c,attemptsLeft:y,maxGuesses:te,done:m,streak:n.streak,submitGuess:j,resetForDebug:g}}const me="bp_daily_tour_seen_v1";function na(){if(typeof window>"u")return!0;try{return window.localStorage.getItem(me)==="1"}catch{return!0}}function ue(){if(!(typeof window>"u"))try{window.localStorage.setItem(me,"1")}catch{}}function sa(){if(!(typeof window>"u"))try{window.localStorage.removeItem(me)}catch{}}function ia({ready:a,wrongCount:n,done:s,yesPrice:o}){const l=w.useRef(null),c=w.useRef("idle"),y=w.useRef(null),m=w.useRef("idle"),j=w.useCallback(()=>{if(y.current){const i=y.current.root,O=y.current.container;y.current=null,queueMicrotask(()=>{i.unmount(),O.remove()})}},[]),g=w.useCallback((i,O)=>{let B=y.current;if(B&&B.popover!==i&&(j(),B=null),!B){const L=document.createElement("div");L.className="daily-tour-prince",i.insertBefore(L,i.firstChild);const I=ot.createRoot(L);B={container:L,root:I,popover:i},y.current=B}if(m.current!==O||B!==y.current){m.current=O;const I=["building","searching","writing","success","warning","error","sleeping"].includes(O)?78:44;B.root.render(e.jsx(kt,{state:O,size:I,ariaHidden:!0}))}},[j]),C=w.useCallback(i=>{const O=i!==void 0&&Number.isFinite(i)?`${Math.round(i*100)}¢`:"a fixed cents value",B=()=>{c.current="done",l.current?.destroy()},L=(I,q,K,G)=>({...G?{element:G}:{},popover:{title:q,description:K,popoverClass:"daily-tour-popover",showButtons:["previous","next","close"],prevBtnText:"Skip",onPrevClick:B,onPopoverRender:V=>{g(V.wrapper,I),re(V)}}});return[L("writing","Welcome to Daily Market!","Guess one live Polymarket event every day. You get six tries â clues unlock as you go."),L("thinking","Guess the mystery market.","Initially, almost everything is hidden. Your job is to figure out which of the top ~500 Polymarket events it is.",'[data-tour="card"]'),L("searching","Your starting clue...",`You always begin knowing the live <b>YES</b> price. Today, it's <code>${O}</code>.`,'[data-tour="price-chip"]'),{element:'[data-tour="search"]',popover:{title:"Guess a market!",description:"Each wrong guess unlocks more clues. Try guessing a market right now!",popoverClass:"daily-tour-popover",showButtons:["previous","next","close"],prevBtnText:"Skip",nextBtnText:"Got it",doneBtnText:"Got it",onPrevClick:B,onPopoverRender:I=>{g(I.wrapper,"idle"),re(I)},onNextClick:()=>{c.current="waiting-for-guess",l.current?.destroy()},onCloseClick:()=>{c.current="done",l.current?.destroy()}}}]},[g]),N=w.useCallback(()=>{l.current?.isActive()&&l.current.destroy(),l.current=null,j()},[j]),v=w.useCallback(()=>{N();const i=['[data-tour="price-chip"]','[data-tour="category"]'],O=()=>{for(const I of i)document.querySelector(I)?.classList.add("daily-tour-spotlight")},B=()=>{for(const I of i)document.querySelector(I)?.classList.remove("daily-tour-spotlight")},L=de({animate:!0,allowClose:!0,showProgress:!1,smoothScroll:!0,stagePadding:6,stageRadius:12,overlayOpacity:.4,popoverClass:"daily-tour-popover",onDestroyed:()=>{B(),j()},steps:[{element:'[data-tour="card"]',popover:{title:"Unlucky...",description:"You can now see <b>the price and the market category</b>. Each wrong guess unlocks more.",showButtons:["next","close"],nextBtnText:"Keep going",doneBtnText:"Keep going",popoverClass:"daily-tour-popover",onPopoverRender:I=>{g(I.wrapper,"warning"),O(),re(I)}}}]});l.current=L,L.drive()},[j,g,N]),D=w.useCallback((i,O)=>{N();const q=`${O?"Wow! I guess you don't need any more help from me.":i?"Nice job!":"Unlucky!"} Come back tomorrow for another live market.${O?"<br/><br/>":" "}Liked this? Check out Blueprints â a way to turn your convictions about the world into real strategies.<a class="daily-tour-cta" href="https://useblueprints.ai" target="_blank" rel="noreferrer noopener">Check out Blueprints â</a>`,K=document.querySelector('[data-tour="result"]'),G=de({animate:!0,allowClose:!0,showProgress:!1,smoothScroll:!0,stagePadding:6,stageRadius:16,overlayOpacity:.4,popoverClass:"daily-tour-popover",onDestroyed:()=>{ue(),c.current="done",j()},steps:[{...K?{element:'[data-tour="result"]'}:{},popover:{title:i?"See you tomorrow!":"Unlucky...",description:q,showButtons:["close"],popoverClass:"daily-tour-popover",onPopoverRe
7nder:V=>{g(V.wrapper,i?"success":"error"),re(V)}}}]});l.current=G,G.drive()},[j,g,N]),R=w.useCallback(()=>{N(),ue(),c.current="intro";const i=de({animate:!0,allowClose:!0,showProgress:!1,smoothScroll:!0,stagePadding:6,stageRadius:12,overlayOpacity:.4,popoverClass:"daily-tour-popover",onDestroyed:()=>{j()},steps:C(o)});l.current=i,i.drive()},[C,j,a,N,o]);return w.useEffect(()=>{if(na())return;if(n>0||s){ue();return}if(c.current!=="idle")return;const i=window.setTimeout(R,350);return()=>window.clearTimeout(i)},[s,a,R,n]),w.useEffect(()=>{if(c.current==="waiting-for-guess"){if(s?.correct){c.current="final",D(!0,!0);return}if(n>=1){c.current="after-first-guess",v();return}}c.current==="after-first-guess"&&s&&(c.current="final",D(s.correct,!1))},[s,n,v,D]),w.useEffect(()=>()=>N(),[N]),{replay:w.useCallback(()=>{sa(),c.current="idle",R()},[R])}}function oa(){const a=lt(),n=w.useRef(null);return a.state==="loading"?e.jsx(ca,{}):a.state==="error"?e.jsx(da,{}):e.jsxs(e.Fragment,{children:[e.jsx("canvas",{ref:n,className:"pointer-events-none fixed inset-0 z-30 h-full w-full"}),e.jsx(la,{canvasRef:n,dayKey:a.data.dayKey,market:a.data})]})}function la({canvasRef:a,dayKey:n,market:s}){const{wrongSlugs:o,revealLevel:l,attemptsUsed:c,maxGuesses:y,done:m,streak:j,submitGuess:g}=ra(n);w.useEffect(()=>{if(!m?.correct||!a.current)return;const N=Rt.create(a.current,{resize:!0}),v=["#12A0F0","#38bdf8","#60a5fa","#818cf8"];N({particleCount:80,angle:90,spread:90,origin:{x:.5,y:.45},colors:v,startVelocity:50,gravity:.9,ticks:180}),N({particleCount:40,angle:55,spread:50,origin:{x:.2,y:.6},colors:v,startVelocity:55,gravity:.9,ticks:160}),N({particleCount:40,angle:125,spread:50,origin:{x:.8,y:.6},colors:v,startVelocity:55,gravity:.9,ticks:160})},[m?.correct,a]);const C=!!m;return ia({ready:!0,wrongCount:o.length,done:m?{correct:m.correct}:null,yesPrice:s.answer.yesPrice}),e.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-4",children:[e.jsxs("div",{className:"flex w-full flex-col",children:[e.jsx("div",{className:"flex w-full items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-display text-[26px] font-bold leading-[1.05] tracking-tight text-fg",children:"Daily Market"}),e.jsx("div",{className:"mt-1 text-[11px] leading-none text-fg-muted",children:e.jsxs("a",{href:"https://useblueprints.ai",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 transition-opacity hover:opacity-80",children:[e.jsx("span",{children:"by"}),e.jsx(ct,{size:14,mode:"light"}),e.jsx("span",{className:"font-display font-semibold text-fg",children:"Blueprints"})]})})]})}),e.jsx("div",{className:"mt-2 text-[10px] leading-snug text-fg-muted",children:"Guess the live Polymarket. Clues reveal with each wrong pick."})]}),e.jsx(A.div,{layout:!0,transition:{duration:.35,ease:[.32,.72,.3,1]},className:"flex w-full justify-center",children:e.jsx(Gt,{market:s.answer,revealLevel:l,unmasked:C,dayKey:n})}),e.jsx(Et,{markets:s.markets,answerSlug:s.answer.slug,answerTitle:s.answer.displayTitle,wrongSlugs:o,lockedSlug:m?.pickedSlug??null,done:!!m,onPick:N=>g(N,s.answer.slug)}),m&&e.jsx(ea,{correct:m.correct,streak:j,attemptsUsed:c,maxGuesses:y,dayKey:n,marketTitle:s.answer.displayTitle})]})}function ca(){return e.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-5",children:[e.jsx("div",{className:"h-8 w-full max-w-sm animate-pulse rounded-lg bg-bg"}),e.jsx("div",{className:"h-[340px] w-full animate-pulse rounded-xl bg-bg"}),e.jsx("div",{className:"h-16 w-full max-w-sm animate-pulse rounded-lg bg-bg"})]})}function da(){return e.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-3 rounded-xl border border-border bg-surface p-6 text-center",children:[e.jsx("div",{className:"font-display text-[16px] font-bold text-fg",children:"Couldn't load today's market"}),e.jsx("p",{className:"text-[12px] text-fg-muted",children:"Polymarket's feed is being moody. Try again in a moment."}),e.jsx(De,{variant:"ghost",size:"sm",type:"button",onClick:()=>window.location.reload(),className:"mt-1 rounded-lg bg-brand px-4 py-2 text-[12px] font-semibold text-brand-foreground transition-[background-color,scale] hover:bg-brand-hover active:scale-[0.96]",children:"Retry"})]})}function ka(){return e.jsx("div",{className:"relative flex min-h-dvh flex-col items-center justify-start bg-bg px-4 pb-16 pt-8 sm:pt-12",style:{backgroundImage:"radial-gradient(color-mix(in srgb, var(--color-fg) 6%, transparent) 1p
7x, transparent 1px)",backgroundSize:"22px 22px"},children:e.jsx("main",{className:"relative z-10 flex w-full flex-col items-center",children:e.jsx(oa,{})})})}export{ka as component}; 8 9//# debugId=23ce492a-9a02-58c4-8e15-4205ce271758
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.