PageSourceSearch

https://www.cardindex.co/_next/static/chunks/0oe1750qmmih2.js?dpl=dpl_E1vddyibMy3tkedV1b422vXQ7h7i

js cardindex.co collected 2026-10-02 15:25:41 UTC 44,127 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62813,e=>{"use strict";var a=e.i(99724),t=e.i(84428),l=e.i(87444);let r=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),s=t.forwardRef((e,a)=>t.createElement(l.default,{ref:a,...e,weights:r}));s.displayName="MinusIcon";var n=e.i(98237),i=e.i(6626),c=e.i(40595);e.s(["NumberInput",0,function({value:e,onChange:t,min:l,max:r,step:d=1}){return(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(i.Button,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>{let a=e-d;void 0!==l&&a<l||t(a)},disabled:void 0!==l&&e<=l,children:(0,a.jsx)(s,{})}),(0,a.jsx)(c.Input,{type:"number",value:e,onChange:e=>{let a=parseInt(e.target.value,10);if(Number.isNaN(a))return;let s=a;void 0!==l&&(s=Math.max(l,s)),void 0!==r&&(s=Math.min(r,s)),t(s)},min:l,max:r,step:d,className:"h-6 w-14 text-center text-sm [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),(0,a.jsx)(i.Button,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>{let a=e+d;void 0!==r&&a>r||t(a)},disabled:void 0!==r&&e>=r,children:(0,a.jsx)(n.PlusIcon,{})})]})}],62813)},79860,e=>{"use strict";var a=e.i(99724),t=e.i(56813),l=e.i(76716),r=e.i(84428),s=e.i(7883),n=e.i(6626),i=e.i(4267),c=e.i(40595),d=e.i(62813),o=e.i(60620);e.i(9738);var u=e.i(7782);e.i(31786);var m=e.i(76180);let x=[{value:"",label:"Raw (ungraded)"},{value:"PSA",label:"PSA"},{value:"BGS",label:"BGS"},{value:"CGC",label:"CGC"},{value:"SGC",label:"SGC"}],h=[{value:"10.7",label:"10 Perfect",companies:["CGC"]},{value:"10.5",label:"10 Pristine",companies:["CGC","BGS"]},{value:"10",label:"10",companies:null},{value:"9.5",label:"9.5",companies:null},{value:"9",label:"9",companies:null},{value:"8.5",label:"8.5",companies:null},{value:"8",label:"8",companies:null},{value:"7.5",label:"7.5",companies:null},{value:"7",label:"7",companies:null},{value:"6.5",label:"6.5",companies:null},{value:"6",label:"6",companies:null},{value:"5.5",label:"5.5",companies:null},{value:"5",label:"5",companies:null},{value:"4.5",label:"4.5",companies:null},{value:"4",label:"4",companies:null},{value:"3.5",label:"3.5",companies:null},{value:"3",label:"3",companies:null},{value:"2.5",label:"2.5",companies:null},{value:"2",label:"2",companies:null},{value:"1.5",label:"1.5",companies:null},{value:"1",label:"1",companies:null},{value:"0.3",label:"Authentic",companies:["PSA","CGC","SGC"]}],p=[{id:"S",name:"Sealed"},{id:"NM",name:"Near Mint"},{id:"LP",name:"Lightly Played"},{id:"MP",name:"Moderately Played"},{id:"HP",name:"Heavily Played"},{id:"DMG",name:"Damaged"}];e.s(["AddToCollectionDialog",0,function({cardId:e,cardName:g,cardVariantId:b,trigger:f,source:v}){let{isAuthenticated:j}=(0,s.useAuth)(),N=(0,l.useRouter)(),[C,S]=(0,r.useState)(!1),[y,w]=(0,r.useState)(!1),[A,P]=(0,r.useState)(null),[I,T]=(0,r.useState)(1),[H,k]=(0,r.useState)("PSA"),[M,V]=(0,r.useState)("10"),[E,F]=(0,r.useState)("NM"),[Z,D]=(0,r.useState)(""),[R,$]=(0,r.useState)("USD"),[U,L]=(0,r.useState)(""),G=async()=>{w(!0),P(null);try{await m.api.collection.create({cardId:e,quantity:I,gradeCompanyCode:H||void 0,gradeValue:M?parseFloat(M
1):void 0,conditionId:E||void 0,purchasePrice:Z?parseFloat(Z):void 0,purchaseCurrency:Z?R:void 0,notes:U||void 0,cardVariantId:b}),(0,u.trackEvent)("add_to_collection",{source:v,card_id:e,card_name:g,card_variant_id:b,quantity:I,grading_company:H||"raw",grade_value:M?parseFloat(M):void 0,condition_id:E||void 0,purchase_price:Z?parseFloat(Z):void 0,purchase_currency:Z?R:void 0,has_notes:!!U}),S(!1)}catch(e){P(e instanceof Error?e.message:"Failed to add to collection")}finally{w(!1)}};return(0,a.jsxs)(i.Dialog,{open:C,onOpenChange:e=>{e&&!j?N.push("/sign-in"):(S(e),e&&(P(null),T(1),k("PSA"),V("10"),F("NM"),D(""),$("USD"),L("")))},children:[(0,a.jsx)(i.DialogTrigger,{render:(0,a.jsx)("span",{}),children:f}),(0,a.jsxs)(i.DialogContent,{className:"sm:max-w-md",children:[(0,a.jsxs)(i.DialogHeader,{children:[(0,a.jsx)(i.DialogTitle,{children:"Add to Collection"}),(0,a.jsxs)(i.DialogDescription,{children:["Add ",g," to your collection."]})]}),(0,a.jsxs)("div",{className:"grid gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Quantity"}),(0,a.jsx)(d.NumberInput,{value:I,onChange:T,min:1})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Grading Company"}),(0,a.jsxs)(o.Select,{value:H,onValueChange:e=>{k("raw"===e?"":e),("raw"===e||""===e)&&V("")},children:[(0,a.jsx)(o.SelectTrigger,{children:(0,a.jsx)(o.SelectValue,{placeholder:"Raw"})}),(0,a.jsx)(o.SelectContent,{children:x.map(e=>(0,a.jsx)(o.SelectItem,{value:e.value||"raw",children:e.label},e.value||"raw"))})]})]}),H&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Grade"}),(0,a.jsxs)(o.Select,{value:M,onValueChange:e=>{let a;V(e),F((a=parseFloat(e))>=9?"NM":a>=7?"LP":a>=5?"MP":a>=3?"HP":"DMG")},children:[(0,a.jsx)(o.SelectTrigger,{children:(0,a.jsx)(o.SelectValue,{placeholder:"Select grade"})}),(0,a.jsx)(o.SelectContent,{children:h.filter(e=>!e.companies||e.companies.includes(H)).map(e=>(0,a.jsx)(o.SelectItem,{value:e.value,children:e.label},e.value))})]})]})]}),!H&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Condition"}),(0,a.jsxs)(o.Select,{value:E,onValueChange:F,children:[(0,a.jsx)(o.SelectTrigger,{children:(0,a.jsx)(o.SelectValue,{placeholder:"Select condition"})}),(0,a.jsx)(o.SelectContent,{children:p.map(e=>(0,a.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_80px] gap-2",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Purchase Price"}),(0,a.jsx)(c.Input,{type:"number",placeholder:"0.00",width:"full",value:Z,onChange:e=>D(e.target.value),min:0,step:"0.01"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Currency"}),(0,a.jsxs)(o.Select,{value:R,onValueChange:$,children:[(0,a.jsx)(o.SelectTrigger,{children:(0,a.jsx)(o.SelectValue,{})}),(0,a.jsxs)(o.SelectContent,{children:[(0,a.jsx)(o.SelectItem,{value:"USD",children:"USD"}),(0,a.jsx)(o.SelectItem,{value:"EUR",children:"EUR"}),(0,a.jsx)(o.SelectItem,{value:"GBP",children:"GBP"})]})]})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:"Notes"}),(0,a.jsx)("textarea",{value:U,onChange:e=>L(e.target.value),placeholder:"Personal notes...",rows:2,className:"flex w-full rounded-md border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"})]}),A&&(0,a.jsx)("p",{className:"text-xs text-destructive",children:A})]}),(0,a.jsx)(i.DialogFooter,{children:(0,a.jsxs)(n.Button,{onClick:G,disabled:y,children:[y&&(0,a.jsx)(t.SpinnerIcon,{className:"animate-spin"}),"Add to Collection"]})})]})]})}])},50808,e=>{"use strict";var a=e.i(99724),t=e.i(84428),l=e.i(22668);let r=(e,a=3)=>parseFloat(e.toFixed(a)),s=(e,a=0,t=100)=>Math.min(Math.max(e,a),t),n=(e,a,t,l,s)=>r(l+(s-l)*(e-a)/(t-a)),i={"--pointer-x":"50%","--pointer-y":"50%","--pointer-from-center":0,"--pointer-from-top":.5,"--pointer-from-left":.5,"--card-opacity":0,"--rotate-x":"0deg","--rotate-y":"0deg","--background-x":"50%","--background-y":"50%"};e.s(["HoloCard",0,function({children:e,className:c,holo:d=!0,intensity:o=.6}){let u=(0,t.useRef)(null),[m,x]=(0,t.useState)(i),[h,p]=(0,t.useState)(!1),g=(0,t.useRef)(null),b=(0,t.useCallback)((e,a)=>{g.current||(g.current=requestAnimationFrame(()=>{g.current=null;let t=u.current;if(!t)return;let l=t.getBoundingClientRect(),i={x:e-l.left,y:a-l.top},c={x:s(r(100/l.width*i.x)),y:s(r(100/l.height*i.y))},d={x:c.x-50,y:c.y-50},m=s(Math.sqrt((c.y-50)*(c.y-50)+(c.x-50)*(c.x-50))/50,0,1);x({"--pointer-x":`${r(c.x)}%`,"--pointer-y":`${r(c.y)}
1%`,"--pointer-from-center":m,"--pointer-from-top":c.y/100,"--pointer-from-left":c.x/100,"--card-opacity":o,"--rotate-x":`${r(-(d.x/3.5))}deg`,"--rotate-y":`${r(d.y/3.5)}deg`,"--background-x":`${n(c.x,0,100,37,63)}%`,"--background-y":`${n(c.y,0,100,33,67)}%`})}))},[o]),f=(0,t.useCallback)(e=>{p(!0),b(e.clientX,e.clientY)},[b]),v=(0,t.useCallback)(e=>{e.touches[0]&&(p(!0),b(e.touches[0].clientX,e.touches[0].clientY))},[b]),j=(0,t.useCallback)(()=>{g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1),x(i)},[]);return(0,a.jsxs)("div",{ref:u,className:(0,l.cn)("holo-card",h&&"holo-card--interacting",c),style:m,onMouseMove:f,onMouseLeave:j,onTouchMove:v,onTouchEnd:j,children:[e,d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"holo-card__shine","aria-hidden":"true"}),(0,a.jsx)("div",{className:"holo-card__glare","aria-hidden":"true"})]})]})}])},89900,e=>{"use strict";var a=e.i(84428);e.s(["useInfiniteScrollSentinel",0,function({enabled:e,onIntersect:t,rootMargin:l="400px"}){let r=(0,a.useRef)(t),s=(0,a.useRef)(e);(0,a.useEffect)(()=>{r.current=t,s.current=e});let n=(0,a.useRef)(null);return(0,a.useCallback)(e=>{if(n.current&&(n.current.disconnect(),n.current=null),!e)return;let a=new IntersectionObserver(e=>{e[0]?.isIntersecting&&s.current&&r.current()},{rootMargin:l});a.observe(e),n.current=a},[l])}])},95119,64295,e=>{"use strict";var a=e.i(99724),t=e.i(29458);let l=[{label:"Browse Cards",href:"/cards?gameId=pokemon"},{label:"Browse Listings",href:"/listings"},{label:"Browse Sets",href:"/sets/pokemon"},{label:"Trending Cards",href:"/trending-pokemon-cards"}];e.s(["EmptyResults",0,function({query:e,message:r,links:s=l}){let n=e?`No results for \u201c${e}\u201d`:r??"No results found";return(0,a.jsx)("div",{className:"py-2",children:(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-card p-5",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:n}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e?"Nothing matched across cards, listings, or sets. Try a broader term or browse directly:":"Try adjusting your filters or browse directly:"}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:s.map(e=>(0,a.jsx)(t.Link,{href:e.href,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium hover:bg-accent",children:e.label},e.href))})]})})}],95119);var r=e.i(62528);e.s(["TableSkeleton",0,function({rows:e=25,columns:t}){return(0,a.jsxs)("div",{className:"animate-pulse rounded-md border border-border",children:[(0,a.jsx)("div",{className:"h-10 bg-muted/50"}),Array.from({length:e}).map((e,l)=>(0,a.jsx)("div",{className:"flex items-center gap-2.5 px-4 py-2 border-t border-border",children:t.map((e,t)=>(0,a.jsx)(r.Skeleton,{className:`h-4 shrink-0 rounded ${e}`},t))},l))]})}],64295)},91782,e=>{"use strict";var a=e.i(99724),t=e.i(22668);e.s(["Table",0,function({className:e,...l}){return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,t.cn)("w-full caption-bottom text-xs",e),...l})})},"TableBody",0,function({className:e,...l}){return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,t.cn)("[&_tr:last-child]:border-0",e),...l})},"TableCell",0,function({className:e,...l}){return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,t.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...l})},"TableHead",0,function({className:e,...l}){return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,t.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...l})},"TableHeader",0,function({className:e,...l}){return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,t.cn)("[&_tr]:border-b",e),...l})},"TableRow",0,function({className:e,...l}){return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,t.cn)("hover:bg-muted/50 dark:hover:bg-primary/[0.04] data-[state=selected]:bg-muted border-b transition-colors",e),...l})}])},95602,56373,65349,e=>{"use strict";var a=e.i(84428),t=e.i(87444);let l=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M234.29,47.91A20,20,0,0,0,216,36H40A20,20,0,0,0,25.2,69.45l.12.14L92,140.75V216a20,20,0,0,0,31.1,16.64l32-21.33A20,20,0,0,0,164,194.66V140.75l66.67-71.16.12-.14A20,20,0,0,0,234.29,47.91Zm-91,79.89A12,12,0,0,0,140,136v56.52l-24,16V136a12,12,0,0,0-3.25-8.2L49.23,60H2
106.77Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M221.9,61.38,152,136v58.65a8,8,0,0,1-3.56,6.66l-32,21.33A8,8,0,0,1,104,216V136L34.1,61.38A8,8,0,0,1,40,48H216A8,8,0,0,1,221.9,61.38Z",opacity:"0.2"}),a.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227.81,66.76l-.08.09L160,139.17v55.49A16,16,0,0,1,152.87,208l-32,21.34A16,16,0,0,1,96,216V139.17L28.27,66.85l-.08-.09A16,16,0,0,1,40,40H216a16,16,0,0,1,11.84,26.76Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M228.77,50.34A13.8,13.8,0,0,0,216,42H40A14,14,0,0,0,29.67,65.42l.06.07L98,138.38V216a14,14,0,0,0,21.77,11.64l32-21.33A14,14,0,0,0,158,194.66V138.38l68.33-73A13.82,13.82,0,0,0,228.77,50.34Zm-11.26,6.94L147.62,131.9A6,6,0,0,0,146,136v58.66a2,2,0,0,1-.89,1.67l-32,21.33A2,2,0,0,1,110,216V136a6,6,0,0,0-1.62-4.1L38.53,57.32A2,2,0,0,1,40,54H216a1.9,1.9,0,0,1,1.83,1.19A1.86,1.86,0,0,1,217.51,57.28Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227,51.15A11.85,11.85,0,0,0,216,44H40a12,12,0,0,0-8.88,20.07l.05.05L100,137.59V216a12,12,0,0,0,18.66,10l32-21.33a12,12,0,0,0,5.35-10V137.59l68.86-73.52A11.85,11.85,0,0,0,227,51.15Zm-8,7.5-69.9,74.62A4,4,0,0,0,148,136v58.65a4,4,0,0,1-1.78,3.33l-32,21.33A4,4,0,0,1,108,216V136a4,4,0,0,0-1.08-2.74L37.05,58.67A4,4,0,0,1,40,52H216a4,4,0,0,1,3,6.65Z"}))]]),r=a.forwardRef((e,r)=>a.createElement(t.default,{ref:r,...e,weights:l}));r.displayName="FunnelIcon",e.s(["FunnelIcon",0,r],95602);let s=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),a.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),n=a.forwardRef((e,l)=>a.createElement(t.default,{ref:l,...e,weights:s}));n.displayName="GridFourIcon",e.s(["GridFourIcon",0,n],56373);var i=e.i(99724),c=e.i(32706),d=e.i(40595),o=e.i(22668);let u=a.forwardRef(({className:e,size:a,...t},l)=>(0,i.jsxs)("div",{className:(0,o.cn)("relative",e),children:[(0,i.jsx)(c.MagnifyingGlassIcon,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground pointer-events-none"}),(0,i.jsx)(d.Input,{ref:l,className:"pl-8 w-full",size:a,width:"full",...t})]}));u.displayName="SearchInput",e.s(["SearchInput",0,u],65349)},10196,42783,e=>{"use strict";var a=e.i(99724);e.s(["FilterPill",0,function({label:e,active:t,onClick:l}){return(0,a.jsx)("button",{type:"button",className:`rounded-full px-2.5 py-1 text-xs font-medium border transition-colors ${t?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:border-foreground
1/30 hover:text-foreground"}`,onClick:l,children:e})}],10196);var t=e.i(84428),l=e.i(40595);e.s(["DebouncedTextInput",0,function({placeholder:e,value:r,onChange:s,width:n}){let[i,c]=(0,t.useState)(r),d=(0,t.useRef)(null);(0,t.useEffect)(()=>{c(r)},[r]);let o=(0,t.useCallback)(e=>{let a=e.target.value;c(a),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{s(a)},500)},[s]);return(0,a.jsx)(l.Input,{placeholder:e,value:i,onChange:o,className:"h-7 text-xs",width:n??void 0})}],42783)},83365,e=>{"use strict";e.s(["mapSearchResultToCard",0,function(e){return{id:e.cardId,language:"en",category:e.category,productType:e.productType??"single",name:e.name,slug:e.cardSlug??null,year:e.setYear,set:e.setCode?{code:e.setCode,name:e.setName??e.setCode,slug:e.setSlug??null,series:e.setSeries??null,gameId:e.gameId??null,totalCards:e.setTotalCards}:null,setCode:e.setCode,cardNumber:e.cardNumber,collectorNumber:null,parallelName:null,primaryVariantId:null,isHolo:null,imageUrl:e.imageUrl,smallImageUrl:e.smallImageUrl,pokemonTcgId:null,description:null,variant:{id:e.cardVariantId,code:e.variantCode,name:e.variantName,type:""},allVariants:[],avgPriceUsd:e.rawMarketPrice,gemrateId:null,data:null,lastSales:{raw:e.rawMarketPrice?{price:e.rawMarketPrice,date:null,unit:"USD",variant:e.variantCode,source:"market"}:null,10:null,9:null,8:null}}}])},43659,e=>{"use strict";var a=e.i(99724),t=e.i(30745),l=e.i(53916),r=e.i(76002),s=e.i(82425),n=e.i(29458),i=e.i(91782);e.i(22668);var c=e.i(40485),d=e.i(45763);function o({field:e,activeField:s,dir:n}){return e!==s?(0,a.jsx)(l.ArrowsDownUpIcon,{className:"h-3 w-3 opacity-0 group-hover/th:opacity-100"}):"asc"===n?(0,a.jsx)(r.ArrowUpIcon,{className:"h-3 w-3"}):(0,a.jsx)(t.ArrowDownIcon,{className:"h-3 w-3"})}function u(e){if(!e.cardNumber)return"—";let a=e.set?.denominator??e.set?.totalCards;return a?`${e.cardNumber}/${a}`:e.cardNumber}function m(e,a,t){let l=e.fmv;if(l){let e=null;switch(a){case"raw":e=l.raw;break;case"PSA:9":e=l.grade9;break;case"PSA:10":e=l.psa10}if(null!=e)return{price:e,source:"FMV",unit:"USD"}}let r=t&&"normal"!==t?`${a}:${t}`:a,s=e.prices?.[r];return s?.saleAvgPrice!=null?{price:s.saleAvgPrice,source:"Avg Sale",unit:s.unit??"USD"}:s?.listingAvgPrice!=null?{price:s.listingAvgPrice,source:"Avg Listing",unit:s.unit??"USD"}:null}e.s(["CardsTable",0,function({items:e,onFilterBySet:t,sortField:l,sortDir:r,onSort:x}){return(0,a.jsx)("div",{className:"rounded-md border border-border",children:(0,a.jsxs)(i.Table,{className:"table-fixed",children:[(0,a.jsx)(i.TableHeader,{children:(0,a.jsxs)(i.TableRow,{className:"bg-muted/50 select-none",children:[(0,a.jsx)(i.TableHead,{className:"w-[52%] sm:w-[30%] font-normal text-muted-foreground cursor-pointer group/th hover:text-foreground",onClick:()=>x?.("name"),children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Card",(0,a.jsx)(o,{field:"name",activeField:l,dir:r})]})}),(0,a.jsx)(i.TableHead,{className:"hidden sm:table-cell w-[10%] font-normal text-muted-foreground",children:"Variant"}),(0,a.jsx)(i.TableHead,{className:"w-[33%] sm:w-[20%] font-normal text-muted-foreground cursor-pointer group/th hover:text-foreground",onClick:()=>x?.("setName"),children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Set",(0,a.jsx)(o,{field:"setName",activeField:l,dir:r})]})}),(0,a.jsx)(i.TableHead,{className:"hidden sm:table-cell font-normal text-muted-foreground cursor-pointer group/th hover:text-foreground",onClick:()=>x?.("cardNumber"),children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Number",(0,a.jsx)(o,{field:"cardNumber",activeField:l,dir:r})]})}),(0,a.jsx)(i.TableHead,{className:"hidden sm:table-cell font-normal text-muted-foreground cursor-pointer group/th hover:text-foreground",onClick:()=>x?.("year"),children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Year",(0,a.jsx)(o,{field:"year",activeField:l,dir:r})]})}),(0,a.jsx)(i.TableHead,{className:"hidden sm:table-cell text-right font-normal text-muted-foreground",children:"Raw"}),(0,a.jsx)(i.TableHead,{className:"hidden sm:table-cell text-right font-normal text-muted-foreground",children:"Grade 9"}),(0,a.jsxs)(i.TableHead,{className:"w-[15%] sm:w-auto text-right font-normal text-muted-foreground",children:[(0,a.jsx)("span",{className:"sm:hidden",children:"Price"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Grade 10"})]})]})}),(0,a.jsx)(i.TableBody,{children:e.map((e,l)=>{let r,o,x,h;return(0,a.jsxs)(i.TableRow,{className:l%2==0?"bg-card":"bg-(--card-alternate)",children:[(0,a.jsx)(i.TableCell,{className:"py-2 overflow-hidden",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)("div",{className:"relative h-10 w-8 shrink-0 overflow-hidden rounded-md bg-muted",children:(0,a.jsx)(s.ImageWithFallback,{src:e.smallImageUrl||e.imageUrl||s.CARD_PLACEHOLDER_SRC,fallbackSrc:e.imageUrl,alt:e.name||"Card",fill:!0,className:"object-contain",sizes:"32px",unoptimized:!0})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)(n.Link,{href:(0,c.buildCardUrl)({id:e.id,slug:e.slug,gameId:e.set?.gameId,setSlug:e.set?.slug,variant:e.variant?.code}),className:"font-medium truncate block hover:text-primary transition-colors",children:e.name||"Unknown"}),(0,a.jsx)("p",{className:"sm:hidden text-xs text-muted-foreground truncate",children:e.variant?.name??"—"})]})]})}),(0,a.jsx)(i.TableCell,{className:"hidden sm:table-cell py-1.5 truncate text-muted-foreground",children:e.variant?.name??"—"}),(0,a.jsx)(i.TableCell,{className:"py-1.5 truncate",children:e.setCode?(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-primary transition-colors truncate cursor-pointer",onClick:()=>
1t?.(e.setCode),children:e.set?.name||e.setCode}),(0,a.jsx)("p",{className:"sm:hidden text-xs text-muted-foreground truncate",children:u(e)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"—"})}),(0,a.jsx)(i.TableCell,{className:"hidden sm:table-cell py-1.5 text-muted-foreground",children:(0,a.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-primary transition-colors truncate cursor-pointer",onClick:()=>t?.(e.setCode,e.cardNumber??void 0),children:u(e)})}),(0,a.jsx)(i.TableCell,{className:"hidden sm:table-cell py-1.5 text-muted-foreground",children:function(e){if(e.year)return String(e.year);if(e.set?.releaseDate){let a=new Date(e.set.releaseDate).getFullYear();if(!Number.isNaN(a))return String(a)}return"—"}(e)}),(0,a.jsx)(i.TableCell,{className:"hidden sm:table-cell py-1.5 text-right",children:(r=m(e,"raw",e.variant?.code))?(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-medium",children:(0,d.formatPrice)(r.price,r.unit)}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:r.source})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"—"})}),(0,a.jsx)(i.TableCell,{className:"hidden sm:table-cell py-1.5 text-right",children:(o=m(e,"PSA:9",e.variant?.code))?(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-medium",children:(0,d.formatPrice)(o.price,o.unit)}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:o.source})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"—"})}),(0,a.jsx)(i.TableCell,{className:"py-1.5 text-right",children:(x=m(e,"PSA:10",e.variant?.code),h=m(e,"PSA:9",e.variant?.code),(0,a.jsxs)("div",{children:[x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium",children:(0,d.formatPrice)(x.price,x.unit)}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:x.source})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"—"}),h?(0,a.jsxs)("p",{className:"sm:hidden text-[10px] text-muted-foreground mt-0.5",children:["G9:"," ",(0,d.formatPrice)(h.price,h.unit)]}):null]}))})]},e.id)})})]})})}])},73336,e=>{"use strict";var a=e.i(99724),t=e.i(84428),l=e.i(40595),r=e.i(22668);e.s(["DebouncedNumberInput",0,function({placeholder:e,value:s,onChange:n,width:i,className:c}){let[d,o]=(0,t.useState)(s?.toString()??""),u=(0,t.useRef)(null);(0,t.useEffect)(()=>{o(s?.toString()??"")},[s]);let m=(0,t.useCallback)(e=>{let a=e.target.value;o(a),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{let e=""===a?null:Number(a);null!==e&&Number.isNaN(e)||n(e)},500)},[n]);return(0,a.jsx)(l.Input,{type:"number",placeholder:e,value:d,onChange:m,className:(0,r.cn)("h-7 text-xs [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",c),width:i??void 0})}])},17817,e=>{"use strict";var a=e.i(99724),t=e.i(53916),l=e.i(6437),r=e.i(95602),s=e.i(56373),n=e.i(92678),i=e.i(98237),c=e.i(56813),d=e.i(76716),o=e.i(84428),u=e.i(79860),m=e.i(95119),x=e.i(6626),h=e.i(65349),p=e.i(50808),g=e.i(82425),b=e.i(29458),f=e.i(37837),v=e.i(62528),j=e.i(64295),N=e.i(75005);e.i(9738);var C=e.i(7782);e.i(31786);var S=e.i(90711),y=e.i(76180),w=e.i(89900),A=e.i(22668),P=e.i(40485),I=e.i(45763),T=e.i(83365),H=e.i(26454),k=e.i(7271),M=e.i(10196),V=e.i(73336),E=e.i(42783),F=e.i(96738);function Z({title:e,children:t,defaultOpen:l=!1}){let[r,s]=(0,o.useState)(l);return(0,a.jsxs)("div",{className:"border-b border-border pb-3",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between py-2 text-sm font-medium hover:text-foreground text-muted-foreground transition-colors",onClick:()=>s(!r),children:[e,(0,a.jsx)(H.CaretDownIcon,{className:`h-4 w-4 transition-transform ${r?"rotate-180":""}`})]}),r&&(0,a.jsx)("div",{className:"space-y-2 pt-1",children:t})]})}function D({filters:e,onFilterChange:t,onClose:l,sets:r,games:s}){let n=(0,o.useCallback)(a=>{t({...e,...a})},[e,t]),i=r.map(e=>({value:e.code,label:e.name,hint:null!=e.totalCards?`(${e.totalCards})`:void 0})),c=+!!e.cardNumber+ +!!e.gameId+ +!!e.minPrice+ +!!e.maxPrice+e.selectedSetCodes.length;return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-border pb-3 mb-3",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold",children:["Filters",c>0&&(0,a.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:["(",c,")"]})]}),(0,a.jsx)(x.Button,{variant:"ghost",size:"icon-xs",onClick:l,children:(0,a.jsx)(k.XIcon,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"flex-1 space-y-3 overflow-y-auto overflow-x-hidden",children:[(0,a.jsx)(Z,{title:"Set",defaultOpen:!0,children:(0,a.jsx)(F.MultiSelect,{options:i,selected:e.selectedSetCodes,onChange:e=>n({selectedSetCodes:e}),placeholder:"All Sets",noun:"set",searchPlaceholder:"Search sets...",emptyMessage:"No sets found.",showSelectedBadges:!0,triggerClassName:"w-full text-xs"})}),(0,a.jsx)(Z,{title:"Card Number",children:(0,a.jsx)(E.DebouncedTextInput,{placeholder:"e.g. 25",value:e.cardNumber,onChange:e=>n({cardNumber:e}),width:"sm"})}),(0,a.jsx)(Z,{title:"Category",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,a.jsx)(M.FilterPill,{label:"All",active:!e.gameId,onClick:()=>n({gameId:""})}),s.map(t=>(0,a.jsx)(M.FilterPill,{label:t.name,active:e.gameId===t.id,onClick:()=>n({gameId:t.id})},t.id))]})}),(0,a.jsxs)(Z,{title:"Price Range",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:"$"}),(0,a.jsx)(V.DebouncedNumberInput,{placeholder:"Min",value:e.minPrice?Number(e.minPrice):null,onChange:e=>n({minPrice:e?String(e):""}),width:"full",className:"min-w-0 pl-5"})]}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:"–"}),(0,a.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:"$"}),(0,a.jsx)(V.DebouncedNumberInput,{placeholder:"Max",value:e.maxPrice?Number(e.maxPrice):null,onChange:e=>n({maxPrice:e?String(e):""}),width:"full",className:"min-w-0 pl-5"})]})]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[{label:"Under $10",min:"",max:"10"},{label:"$10–$50",min:"10",max:"50"},{label:"$50–$200",min:"50",max:"200"},{label:"$200+",min:"200",max:""}].map(t=>{let l=e.minPrice===t.min&&e.maxPrice===t.max;return(0,a.jsx)("button",{type:"button",onClick:()=>n({minPrice:l?"":t.min,maxPrice:l?"":t.max}),className:(0,A.cn)("rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors",l?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-foreground
1/20 hover:text-foreground"),children:t.label},t.label)})})]})]})]})}var R=e.i(43659);let $=[{value:"createdAt-desc",label:"Date Added"},{value:"price-desc",label:"Price: High to Low"},{value:"price-asc",label:"Price: Low to High"},{value:"name-asc",label:"Name"},{value:"setName-asc",label:"Set"},{value:"year-desc",label:"Year"}];function U({sortIndex:e,onSortChange:r,sortOptions:s}){let[n,i]=(0,o.useState)(!1);return(0,a.jsxs)(f.Popover,{open:n,onOpenChange:i,children:[(0,a.jsx)(f.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline","aria-label":"Sort cards",children:[(0,a.jsx)(t.ArrowsDownUpIcon,{className:"mr-1 h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,a.jsx)(f.PopoverContent,{align:"end",className:"w-56 p-1",children:s.map((t,s)=>{let n=e===String(s);return(0,a.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-xs hover:bg-accent hover:text-accent-foreground transition-colors",onClick:()=>{r(String(s)),i(!1)},children:[(0,a.jsx)(l.CheckIcon,{className:`h-3.5 w-3.5 shrink-0 ${n?"opacity-100":"opacity-0"}`}),t.label]},s)})})]})}e.s(["CardListView",0,function({initialSetCode:e,lockSetCode:t,hideHeading:l}={}){let f=(0,d.useSearchParams)(),A=(0,d.useRouter)(),H=e?[e]:f.get("setCode")?.split(",").filter(Boolean)||[],k=f.get("search")||"",M=f.get("cardNumber")||"",V=f.get("gameId")||"",E=f.get("productType")||"",F=f.get("minPrice")||"",Z=f.get("maxPrice")||"",L=f.get("sort")||"name",G=f.get("dir")||"asc",_=`${L}-${G}`,[B,z]=(0,o.useState)(k),[O,Y]=(0,o.useState)($.some(e=>e.value===_)?_:"name-asc"),[q,X]=(0,o.useState)("table"),[K,W]=(0,o.useState)(!1);(0,o.useEffect)(()=>{window.matchMedia("(max-width: 639px)").matches&&X("grid"),window.matchMedia("(max-width: 1023px)").matches||W(!0)},[]);let[Q,J]=(0,o.useState)([]),[ee,ea]=(0,o.useState)([]),[et,el]=(0,o.useState)(!0),[er,es]=(0,o.useState)(!1),[en,ei]=(0,o.useState)(!0),[ec,ed]=(0,o.useState)(k),[eo,eu]=(0,o.useState)(null),[em,ex]=(0,o.useState)({cardNumber:M,gameId:V,minPrice:F,maxPrice:Z,selectedSetCodes:H,productType:E}),[eh,ep]=(0,o.useState)(M),[eg,eb]=(0,o.useState)(F),[ef,ev]=(0,o.useState)(Z),ej=(0,o.useRef)(0),eN=(0,o.useRef)(!1),eC=(0,o.useRef)(f.toString());(0,o.useEffect)(()=>{if(t)return;let e=f.toString();if(e===eC.current)return;eC.current=e;let a=f.get("search")||"",l=f.get("sort")||"name",r=f.get("dir")||"asc",s=`${l}-${r}`,n=f.get("setCode")?.split(",").filter(Boolean)||[],i=f.get("cardNumber")||"",c=f.get("gameId")||"",d=f.get("productType")||"",o=f.get("minPrice")||"",u=f.get("maxPrice")||"";z(a),ed(a),Y($.some(e=>e.value===s)?s:"name-asc"),ex({cardNumber:i,gameId:c,minPrice:o,maxPrice:u,selectedSetCodes:n,productType:d}),ep(i),eb(o),ev(u)},[f,t]),(0,o.useEffect)(()=>{let e=new AbortController;return y.api.sets.getAll({limit:200,sort:"name",dir:"asc"},{signal:e.signal}).then(e=>ea(e.items||[])).catch(a=>{e.signal.aborted||console.error("Failed to load sets:",a)}),()=>e.abort()},[]),(0,o.useEffect)(()=>{let e=setTimeout(()=>{ed(B)},300);return()=>clearTimeout(e)},[B]),(0,o.useEffect)(()=>{let e=setTimeout(()=>{ep(em.cardNumber)},300);return()=>clearTimeout(e)},[em.cardNumber]),(0,o.useEffect)(()=>{let e=setTimeout(()=>{eb(em.minPrice),ev(em.maxPrice)},500);return()=>clearTimeout(e)},[em.minPrice,em.maxPrice]);let eS=ee.reduce((e,a)=>(a.gameId&&!e.some(e=>e.id===a.gameId)&&e.push({id:a.gameId,name:a.gameName||a.gameId}),e),[]),ey=(0,o.useCallback)((e,a,t,l,r,s,n,i)=>{let c=new URLSearchParams;if(e.length>0&&c.set("setCode",e.join(",")),a&&c.set("search",a),t&&c.set("cardNumber",t),l&&c.set("gameId",l),i&&c.set("productType",i),r&&c.set("minPrice",r),s&&c.set("maxPrice",s),"name-asc"!==n){let[e,a]=n.split("-");c.set("sort",e),c.set("dir",a)}let d=c.toString();eC.current=d,A.replace(`/cards${d?`?${d}`:""}`,{scroll:!1})},[A]),ew=(0,o.useCallback)(e=>{let[a,t]=O.split("-");return{limit:50,offset:e,setCode:em.selectedSetCodes.length>0?em.selectedSetCodes.join(","):void 0,search:ec||void 0,cardNumber:eh||void 0,gameId:em.gameId||void 0,productType:em.productType||void 0,minPrice:eg?Number(eg):void 0,maxPrice:ef?Number(ef):void 0,sort:a,dir:t}},[em.selectedSetCodes,em.gameId,em.productType,ec,eh,eg,ef,O]),eA=(0,o.useCallback)(async(e,a)=>{let t=ew(e);return t.search?(await y.api.search.searchCards({q:t.search,setCode:t.setCode,gameId:t.gameId,productType:t.productType,cardNumber:t.cardNumber,minPrice:t.minPrice,maxPrice:t.maxPrice,limit:t.limit,offset:e,sort:t.sort,dir:t.dir},{signal:a})).items.map(T.mapSearchResultToCard):(await y.api.cards.getAll(t,{signal:a})).items||[]},[ew]);(0,o.useEffect)(()=>{let e=new AbortController;return el(!0),ei(!0),eu(null),ej.current=0,eN.current=!0,eA(0,e.signal).then(e=>{let a=new Set,l=e.filter(e=>!a.has(e.id)&&(a.add(e.id),!0));J(l),ei(50===e.length),ej.current=e.length;let r=t?void 0:em.selectedSetCodes.join(",")||void 0;if(ec||r||eh||em.gameId||eg||ef||"name-asc"!==O){let[e,a]=O.split("-");(0,C.trackEvent)("card_search",{query:ec||void 0,set_codes:r,game_id:em.gameId||void 0,card_number:eh||void 0,min_price:eg?Number(eg):void 0,max_price:ef?Number(ef):void 0,sort:e,dir:a,result_count:l.length})}}).catch(a=>{e.signal.aborted||(J([]),ei(!1),a instanceof S.ApiError?eu(a.isServerError?"Server error. Please try again later.":a.message):eu("Failed to load cards. Please check your connection."),console.error("Failed to load cards:",a))}).finally(()=>{e.signal.aborted||(el(!1),eN.current=!1)}),t||ey(em.selectedSetCodes,ec,eh,em.gameId,eg,ef,O,em.productType),()=>e.abort()},[em.selectedSetCodes,em.gameId,em.productType,ec,eh,eg,ef,O,eA,ey,t]);let eP=(0,o.useCallback)(()=>
1{if(eN.current||!en)return;eN.current=!0,es(!0);let e=new AbortController;eA(ej.current,e.signal).then(e=>{J(a=>{let t=new Set(a.map(e=>e.id));return[...a,...e.filter(e=>!t.has(e.id))]}),ei(50===e.length),ej.current+=e.length}).catch(a=>{e.signal.aborted||(ei(!1),console.error("Failed to load more cards:",a))}).finally(()=>{es(!1),eN.current=!1})},[en,eA]),eI=(0,w.useInfiniteScrollSentinel)({enabled:!et,onIntersect:eP,rootMargin:"200px"}),eT=(0,o.useCallback)(e=>{ex(e)},[]),eH=(0,o.useCallback)(e=>{let a=$[Number(e)];a&&Y(a.value)},[]),[ek,eM]=O.split("-"),eV=(0,o.useCallback)(e=>{if(e===ek){let a="asc"===eM?"desc":"asc";Y(`${e}-${a}`)}else Y(`${e}-${{name:"asc",setName:"asc",cardNumber:"asc",year:"desc"}[e]}`)},[ek,eM]),eE=$.findIndex(e=>e.value===O),eF=+!!em.cardNumber+ +!!em.gameId+ +!!em.minPrice+ +!!em.maxPrice+em.selectedSetCodes.length,eZ="single"===em.productType?"cards":"sealed"===em.productType?"sealed":"all";return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[!l&&(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Cards"}),(0,a.jsx)(h.SearchInput,{className:"order-last w-full sm:order-none sm:w-auto sm:min-w-56 sm:flex-1 sm:max-w-xs",placeholder:"Search cards...",size:"lg",value:B,onChange:e=>z(e.target.value)}),(0,a.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,a.jsxs)(N.ToggleGroup,{variant:"outline",value:[eZ],onValueChange:e=>{let a=e.find(e=>e!==eZ);if(!a)return;let t="cards"===a?"single":"sealed"===a?"sealed":"";ex(e=>({...e,productType:t}))},children:[(0,a.jsx)(N.ToggleGroupItem,{value:"all","aria-label":"All products",children:"All"}),(0,a.jsx)(N.ToggleGroupItem,{value:"cards","aria-label":"Cards only",children:"Cards"}),(0,a.jsx)(N.ToggleGroupItem,{value:"sealed","aria-label":"Sealed products",children:"Sealed"})]}),(0,a.jsxs)(N.ToggleGroup,{variant:"outline",value:[q],onValueChange:e=>{let a=e.find(e=>e!==q);a&&X(a)},children:[(0,a.jsx)(N.ToggleGroupItem,{value:"grid","aria-label":"Grid view",children:(0,a.jsx)(s.GridFourIcon,{className:"h-4 w-4"})}),(0,a.jsx)(N.ToggleGroupItem,{value:"table","aria-label":"Table view",children:(0,a.jsx)(n.ListIcon,{className:"h-4 w-4"})})]}),(0,a.jsx)(U,{sortIndex:String(eE),onSortChange:eH,sortOptions:$.map(e=>({label:e.label}))}),(0,a.jsxs)(x.Button,{variant:K?"default":"outline",onClick:()=>W(!K),children:[(0,a.jsx)(r.FunnelIcon,{className:"mr-1 h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Filters"}),eF>0&&(0,a.jsx)("span",{className:"ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-primary text-[10px] font-medium text-primary-foreground px-1",children:eF})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row gap-4",children:[(0,a.jsx)("div",{className:"min-w-0 flex-1 space-y-4",children:et?"grid"===q?(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6",children:Array.from({length:20}).map((e,t)=>(0,a.jsx)(v.Skeleton,{className:"h-72 rounded-lg"},t))}):(0,a.jsx)(j.TableSkeleton,{columns:["h-10 w-8","w-40","w-28 ml-auto"]}):eo?(0,a.jsx)("div",{className:"flex flex-col text-muted-foreground",children:(0,a.jsx)("p",{className:"text-lg text-destructive",children:"Error loading cards.."})}):0===Q.length?(0,a.jsx)(m.EmptyResults,{message:"No cards found"}):(0,a.jsxs)(a.Fragment,{children:["grid"===q?(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6",children:Q.map(e=>{let t;return(0,a.jsxs)("div",{className:"group/card relative",children:[(0,a.jsxs)(b.Link,{href:(0,P.buildCardUrl)({id:e.id,slug:e.slug,gameId:e.set?.gameId,setSlug:e.set?.slug,variant:e.variant?.code}),className:"group flex flex-col overflow-hidden rounded-lg border border-border bg-card transition-colors hover:border-primary/50",children:[(0,a.jsx)(p.HoloCard,{className:"relative aspect-[2.5/3.5] w-full bg-muted rounded-t-lg overflow-hidden",children:(0,a.jsx)(g.ImageWithFallback,{src:e.imageUrl||e.smallImageUrl||g.CARD_PLACEHOLDER_SRC,fallbackSrc:e.smallImageUrl,alt:e.name||"Card",fill:!0,className:"object-contain p-2",sizes:"(max-width: 640px) 50vw, (max-width: 768px) 33vw, (max-width: 1024px) 25vw, 20vw",unoptimized:!0})}),(0,a.jsxs)("div",{className:"p-3 space-y-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium line-clamp-2 leading-tight",title:e.name||void 0,children:e.name||"Unknown"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground truncate",children:[e.set?.name||e.setCode,e.cardNumber?` #${e.cardNumber}`:""]}),(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(t=function(e){let a=e.fmv;if(a){if(null!=a.psa10)return{price:a.psa10,source:"PSA 10 FMV",unit:"USD"};if(null!=a.grade9)return{price:a.grade9,source:"PSA 9 FMV",unit:"USD"}}let t=e.variant?.code;for(let a of["PSA:10","PSA:9"]){let l=t&&"normal"!==t?`${a}:${t}`:a,r=e.prices?.[l];if(r?.saleAvgPrice!=null)return{price:r.saleAvgPrice,source:`${a.replace("PSA:","PSA ")} Avg`,unit:r.unit??"USD"};if(r?.listingAvgPrice!=null)return{price:r.listingAvgPrice,source:`${a.replace("PSA:","PSA ")} Avg`,unit:r.unit??"USD"}}return null}(e))?(0,a.jsx)("p",{className:"text-lg font-bold",children:(0,I.formatPrice)(t.price,t.unit)}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No price"}),e.variant?.name&&(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground shrink-0",children:e.variant.name})]})]})]}),(0,a.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover/card:opacity-100 z-10",children:(0,a.jsx)(u.AddToCollectionDialog,{cardId:e.id,cardName:e.n
1ame||"Unknown",source:"cards-list",trigger:(0,a.jsx)(x.Button,{variant:"secondary",size:"icon-sm",title:"Add to Collection",children:(0,a.jsx)(i.PlusIcon,{})})})})]},e.id)})}):(0,a.jsx)(R.CardsTable,{items:Q,sortField:ek,sortDir:eM,onSort:eV,onFilterBySet:(e,a)=>{em.selectedSetCodes.includes(e)||ex(t=>({...t,selectedSetCodes:[...t.selectedSetCodes,e],...a?{cardNumber:a}:{}}))}}),(0,a.jsxs)("div",{ref:eI,className:"flex justify-center py-8",children:[er&&(0,a.jsx)(c.SpinnerIcon,{className:"h-6 w-6 animate-spin text-muted-foreground"}),!en&&Q.length>0&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No more cards"})]})]})}),K&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("aside",{className:"fixed inset-0 z-50 flex flex-col bg-background p-4 overflow-y-auto lg:hidden",children:(0,a.jsx)(D,{filters:em,onFilterChange:eT,onClose:()=>W(!1),sets:ee,games:eS})}),(0,a.jsx)("aside",{className:"hidden lg:block w-64 shrink-0",children:(0,a.jsx)("div",{className:"rounded-lg border border-border bg-card p-4 sticky top-[4.5rem] max-h-[calc(100vh-5.5rem)] overflow-y-auto",children:(0,a.jsx)(D,{filters:em,onFilterChange:eT,onClose:()=>W(!1),sets:ee,games:eS})})})]})]})]})}],17817)}]);

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.