1!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]="69b080ae-94df-488a-b539-cc9797d1de69",e._sentryDebugIdIdentifier="sentry-dbid-69b080ae-94df-488a-b539-cc9797d1de69")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7029],{13180:(e,n,t)=>{t.d(n,{Fg:()=>l,G6:()=>c,Qt:()=>i,kr:()=>d,oZ:()=>o,yA:()=>s});var a=t(95155),r=t(12890);let o="new",l="card",i="klarna";function s(e){return e===l||e===i}function c(e){return e===i}function u(e){return e.expMonth&&e.expYear?"Expires ".concat(String(e.expMonth).padStart(2,"0"),"/").concat(String(e.expYear).slice(-2)):null}function d(e){let{savedCards:n,selectedCardId:t,onSelectCard:i,offerToSave:s=!1,saveCard:c=!1,onChangeSaveCard:d,disabled:p=!1,billingDetails:h="never",selectedMethod:m=l,onSelectMethod:f,onReady:b,onCompleteChange:y}=e,g=t===o||0===n.length;return(0,a.jsxs)(a.Fragment,{children:[n.length>0&&(0,a.jsxs)("div",{className:"co-choices",role:"radiogroup","aria-label":"Payment method",children:[n.map(e=>{var n;return(0,a.jsxs)("label",{className:"co-choice".concat(t===e.id?" is-active":""),children:[(0,a.jsx)("input",{type:"radio",name:"co-card-choice",value:e.id,checked:t===e.id,disabled:p,onChange:()=>i(e.id)}),(0,a.jsxs)("span",{className:"co-choice-body",children:[(0,a.jsxs)("span",{className:"co-choice-title",children:["amex"===(n=e.brand).toLowerCase()?"Amex":n.replace(/^\w/,e=>e.toUpperCase())," ending ",e.last4]}),u(e)&&(0,a.jsx)("span",{className:"co-choice-sub",children:u(e)})]})]},e.id)}),(0,a.jsxs)("label",{className:"co-choice".concat(g?" is-active":""),children:[(0,a.jsx)("input",{type:"radio",name:"co-card-choice",value:o,checked:g,disabled:p,onChange:()=>i(o)}),(0,a.jsx)("span",{className:"co-choice-body",children:(0,a.jsx)("span",{className:"co-choice-title",children:"Use another payment method"})})]})]}),(0,a.jsxs)("div",{className:"co-card-form".concat(g?"":" is-hidden"),"aria-hidden":!g,children:[(0,a.jsx)(r.He,{options:{layout:"tabs",fields:{billingDetails:h},wallets:{applePay:"never",googlePay:"never"}},onReady:b,onChange:e=>{null==y||y(e.complete),null==f||f(e.value.type)}}),m===l&&s&&d&&(0,a.jsxs)("label",{className:"co-check",children:[(0,a.jsx)("input",{type:"checkbox",checked:c,disabled:p,onChange:e=>d(e.target.checked)}),(0,a.jsx)("span",{children:"Save this card for next time"})]})]})]})}},22237:(e,n,t)=>{t.d(n,{F4:()=>f,NN:()=>s,eO:()=>u,g7:()=>l,gD:()=>b,r7:()=>d,r9:()=>m});var a=t(34051),r=t(33552),o=t(64767);let l=/^[a-z0-9_]{3,20}$/,i="id, username, full_name, avatar_url, plan, default_shipping_price, currency";function s(e,n){if(e){let n=e.trim().split(/\s+/);return n.length>=2?"".concat(n[0][0]).concat(n[n.length-1][0]).toUpperCase():n[0].slice(0,1).toUpperCase()}return n?n.slice(0,1).toUpperCase():""}function c(e){return e?{...e,default_shipping_price:(0,r.tV)(e.default_shipping_price),currency:(0,a.NF)(e.currency)?e.currency:null}:null}async function u(e){let{data:n,error:t}=await (0,o.b)().from("profiles").select(i).eq("id",e).maybeSingle();if(t)throw t;return c(n)}async function d(e,n){let{data:t,error:a}=await (0,o.b)().from("profiles").update(n).eq("id",e).select(i).single();if(a){if("23505"===a.code)throw Error("That username is already taken.");throw a}return c(t)}let p="avatars",h={"image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/gif":"gif"},m=Object.keys(h).join(",");async function f(e,n){let t=h[n.type];if(!t)throw Error("Pick a JPG, PNG, WebP or GIF image.");if(n.size>5242880)throw Error("Pick an image under 5 MB.");let a="".concat(e,"/avatar.").concat(t),{error:r}=await (0,o.b)().storage.from(p).upload(a,n,{contentType:n.type,upsert:!0});if(r)throw Error(r.message);let{data:l}=(0,o.b)().storage.from(p).getPublicUrl(a);return d(e,{avatar_url:"".concat(l.publicUrl,"?v=").concat(Date.now())})}async function b(e){return d(e,{avatar_url:null})}},31570:(e,n,t)=>{t.d(n,{V:()=>o,i:()=>a});let a="7Yc5Ujah8qzHBotPJfNQ8G",r=new Set;function o(e){var n,t,o;if(!a)return;let l=null!=(o=e.once)?o:e.eventId?"".concat(e.event,":").concat(e.eventId):null;if(l){if(r.has(l))return;r.add(l)}let i=null!=e.value&&e.currency?{amount:Math.round(100*e.value),currency:e.currency.toUpperCase()}:{},s="subscription_created"===e.event?{type:"plan_enrollment",plan_id:e.planId,...i}:{type:"contents",...i,...e.contents?{contents:e.contents}:{}};null==(n=(t=window).oaiq)||n.call(t,"measure",e.event,s,e.eventId?{event_id:e.eventId}:void 0)}},33552:(e,n,t)=>{t.d(n,{He:()=>i,aX:()=>r,lz:()=>a,ns:()=>l,tV:()=>o});let a=5,r=100;function o(e){let n="number"==typeof e?e:Number(e);return!Number.isFinite(n)||n<=0?0:Math.min(Math.round(100*n)/100,r)}function l(e,n){return null==n||!Number.isFinite(n)||n<=0||n>=e?e:n}function i(e,n){return!(l(e,n)<e)||e<=0?null:Math.round((e-l(e,n))/e*100)}},34051:(e,n,t)=>{t.d(n,{CY:()=>d,NF:()=>l,OS:()=>r,S1:()=>c,dJ:()=>u,ec:()=>h,en:()=>s,fF:()=>m,hP:()=>f,vu:()=>i,yR:()=>a});
1let a=[{code:"USD",name:"US dollar",symbol:"$",countries:["US","PR","GU","VI","AS","EC","SV","PA"]},{code:"GBP",name:"British pound",symbol:"\xa3",countries:["GB","GG","JE","IM"]},{code:"EUR",name:"Euro",symbol:"â¬",countries:["AT","BE","HR","CY","EE","FI","FR","DE","GR","IE","IT","LV","LT","LU","MT","NL","PT","SK","SI","ES","AD","MC","SM","VA","ME","XK"]},{code:"AUD",name:"Australian dollar",symbol:"A$",countries:["AU","CX","CC","NF","KI","NR","TV"]},{code:"CAD",name:"Canadian dollar",symbol:"CA$",countries:["CA"]},{code:"SGD",name:"Singapore dollar",symbol:"S$",countries:["SG"]}],r="USD",o=a.map(e=>e.code);function l(e){return"string"==typeof e&&o.includes(e)}function i(e){let n="string"==typeof e?e.trim().toUpperCase():"";return l(n)?n:r}function s(e){var n;return null!=(n=a.find(n=>n.code===e))?n:a[0]}function c(e){var n,t;let r=e.toUpperCase();return null!=(t=null==(n=a.find(e=>e.code===r))?void 0:n.symbol)?t:"".concat(r," ")}let u={USD:1,GBP:.79,EUR:.92,AUD:1.52,CAD:1.37,SGD:1.29};function d(e,n,t){return e*function(e,n){var t;let a=n.toUpperCase();if("USD"===a)return 1;let r=null!=(t=null==e?void 0:e[a])?t:u[a];return Number.isFinite(r)&&r>0?r:1}(t,n)}function p(e,n,t){return"".concat(t?"-":"").concat(c(e)).concat(n)}function h(e,n,t){if(null==e||!Number.isFinite(e))return null;var a=d(e,n,t);if(null==a||!Number.isFinite(a))return null;let r=Math.round(a);return p(n,Math.abs(r).toLocaleString("en-US"),r<0)}function m(e,n,t){var a=d(Number.isFinite(e)?e:0,n,t);let r=Number.isFinite(a)?a:0;return p(n,Math.abs(r).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),r<0&&0!==Math.round(100*r))}function f(e,n,t){var a=d(e,n,t);let r=Math.abs(a),o=a<0;return r>=1e6?p(n,"".concat((r/1e6).toFixed(2),"M"),o):r>=1e5?p(n,"".concat(Math.round(r/1e3),"K"),o):r>=1e3?p(n,"".concat((r/1e3).toFixed(1),"K"),o):p(n,String(Math.round(r)),o)}},57052:(e,n,t)=>{t.d(n,{Cv:()=>o,VR:()=>l});var a=t(94511);let r=null;function o(){let e="pk_live_51U2vwIDTDhAmdjltq6MFi4noL9ZnhxOTOPwALMRpeLj5itzahA2uXZt52yJx9laMx7Pt0zwOFPyxypsFh9yX75lA00HWnAqR2F";return e?(r||(r=(0,a.c)(e)),r):null}let l={theme:"stripe",variables:{colorPrimary:"#3a5eff",colorBackground:"#ffffff",colorText:"#12131a",colorTextSecondary:"#5b6172",colorDanger:"#e5484d",borderRadius:"12px",fontSizeBase:"15px",spacingUnit:"4px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"},rules:{".Input":{border:"1px solid #e6e8ef",boxShadow:"none",padding:"11px 12px"},".Input:focus":{border:"1px solid #3a5eff",boxShadow:"0 0 0 3px rgba(58, 94, 255, 0.14)"},".Label":{fontSize:"13px",fontWeight:"600",color:"#5b6172",marginBottom:"6px"}}}},73387:(e,n,t)=>{t.d(n,{G:()=>a,y:()=>o});let a={purchase:"AW-18385943570/es3sCPOf5eAcEJL4jL9E",pro:"AW-18385943570/es3sCPOf5eAcEJL4jL9E"},r=new Set;function o(e){var n,t;let a="".concat(e.sendTo,":").concat(e.transactionId);r.has(a)||(r.add(a),null==(n=(t=window).gtag)||n.call(t,"event","conversion",{send_to:e.sendTo,value:e.value,currency:e.currency.toUpperCase(),transaction_id:e.transactionId}))}},79440:(e,n,t)=>{t.d(n,{CP:()=>l,IS:()=>s,QK:()=>u,VC:()=>d,bO:()=>h,ji:()=>p,lH:()=>i,oE:()=>c});var a=t(90960),r=t(98328),o=t(64767);function l(){return(0,a.$P)("/api/pro/quote",{})}function i(e){return(0,a.$P)("/api/pro/subscribe",{...e,...(0,r.eI)()})}function s(e){return(0,a.$P)("/api/pro/activate",{subscriptionId:e,...(0,r.eI)()})}function c(){return(0,a.$P)("/api/pro/portal",{})}async function u(e){let{data:n,error:t}=await (0,o.b)().from("subscriptions").select("is_active, store, product_id, expires_at, will_renew").eq("user_id",e).maybeSingle();return t||!n?null:{active:n.is_active,store:n.store,interval:n.product_id,expiresAt:n.expires_at,willRenew:n.will_renew,manageable:"STRIPE"===n.store}}function d(e){let n=e instanceof a.hD?e.body:null,t="string"==typeof(null==n?void 0:n.error)?n.error:null,r="string"==typeof(null==n?void 0:n.message)?n.message:null,o="string"==typeof(null==n?void 0:n.storeLabel)?n.storeLabel:null;switch(t){case"card_declined":case"card_failed":return null!=r?r:"Your card was declined. Try another card.";case"subscription_failed":return null!=r?r:"The subscription could not be started. Nothing has been charged.";case"already_subscribed":return o?"You already have Pro through ".concat(o,". Manage it there â you have not been charged again."):"You already have Pro.";case"managed_elsewhere":return o?"Your subscription is billed through ".concat(o,", so it has to be changed there."):"This subscription is managed outside the web app.";case"not_configured":return"Pro is not available to buy here yet.";case"card_not_yours":case"card_unknown":return"That card could not be used. Try entering it again.";case"customer_failed":return"We could not set up billing for your account. Try again in a moment.";case"email_required":return"Your account needs an email address before you can subscribe.";case"unauthorized":return"Sign in to upgrade.";case"no_customer":return"There is no billing history on this account yet.";default:return"Something went wrong starting your subscription. Nothing has been charged â try again."}}function p(e){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency.toUpperCase(),minimumFractionDigits:2*(e.amount%1!=0)}).format(e.amount)}catch(n){return"$".concat(e.amount.toFixed(2))}}function h(e){let n="yearly"===e.interval?e.amount/12:e.amount;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency.toUpperCase()}).format(n)}catch(e){return"$".concat(n.toFixed(2))}}},90960:(e,n,t)=>{t.d(n,{$P:()=>l,VX:()=>c,hD:()=>r});var a=t(64767);
1class r extends Error{constructor(e,n){super("API request failed (".concat(e,")")),this.status=e,this.body=n,this.name="ApiError"}}async function o(e,n,t){let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:"Bearer ".concat(t)}:{}},body:JSON.stringify(n)}),o=await a.json().catch(()=>null);if(!a.ok)throw new r(a.status,o);return o}async function l(e,n){var t;let{data:r}=await (0,a.b)().auth.getSession();return o(e,n,null==(t=r.session)?void 0:t.access_token)}let i=null;async function s(){var e;let n=(0,a.b)(),{data:t}=await n.auth.getSession();return(null==(e=t.session)?void 0:e.access_token)?t.session.access_token:(i||(i=n.auth.signInAnonymously().then(e=>{var n;let{data:t}=e;return null==(n=t.session)?void 0:n.access_token}).catch(()=>void 0).finally(()=>{i=null})),i)}async function c(e,n){return o(e,n,await s())}},97029:(e,n,t)=>{t.d(n,{O:()=>A,A:()=>T});var a=t(95155),r=t(12115),o=t(30895),l=t(12890),i=t(15239),s=t(47650),c=t(13180),u=t(5141),d=t(79440),p=t(31570),h=t(73387),m=t(98328);let f=[{icon:"scan-line",title:"Unlimited card scans",description:"Scan unlimited cards anytime."},{icon:"receipt",title:"Recent sold comps",description:"View the latest sold prices."},{icon:"sparkles",title:"AI market assistant",description:"Get instant AI card and market data insights."},{icon:"chart",title:"Market movers and trending cards",description:"Track top gainers and trending cards."},{icon:"pie",title:"Portfolio value tracking",description:"Monitor your portfolio value."},{icon:"dollar",title:"Liquidation value estimates",description:"Estimate your instant sell value."},{icon:"scan",title:"Unlimited AI card grading",description:"Grade cards from photos, front and back."},{icon:"award",title:"Grade ROI insights",description:"Know if grading is worth it."},{icon:"tag",title:"Deal alerts",description:"Get notified about great deals."},{icon:"bell",title:"Watchlist alerts",description:"Receive price and listing alerts."}],b="Cancel anytime.";var y=t(57052);let g={"scan-line":u.fe,receipt:u.KB,sparkles:u.BZ,chart:u.SC,pie:u.cI,dollar:u.zI,scan:u.d8,award:u.f2,tag:u.gq,bell:u.XF};function v(e){return"monthly"===e?"/month":"/year"}function x(){return(0,a.jsxs)("aside",{className:"pro-perks-panel",children:[(0,a.jsxs)("span",{className:"pro-pill",children:[(0,a.jsx)(u.pw,{size:14}),"Card Index Pro"]}),(0,a.jsx)("h2",{className:"pro-pitch-title",children:"Unlock the full card market"}),(0,a.jsx)("p",{className:"pro-pitch-sub",children:"Collect smarter. Invest with confidence."}),(0,a.jsx)("ul",{className:"pro-perks",children:f.map(e=>{let n=g[e.icon];return(0,a.jsxs)("li",{className:"pro-perk",children:[(0,a.jsx)("span",{className:"pro-perk-icon","aria-hidden":"true",children:(0,a.jsx)(n,{size:16})}),(0,a.jsxs)("span",{className:"pro-perk-body",children:[(0,a.jsx)("span",{className:"pro-perk-title",children:e.title}),(0,a.jsx)("span",{className:"pro-perk-desc",children:e.description})]})]},e.title)})})]})}function w(e){let{plan:n,selected:t,badge:r,disabled:o,onSelect:l}=e,i="yearly"===n.interval;return(0,a.jsxs)("label",{className:"pro-plan".concat(t?" is-active":""),children:[r&&(0,a.jsx)("span",{className:"pro-plan-badge",children:r}),(0,a.jsx)("input",{type:"radio",name:"pro-plan",value:n.interval,checked:t,disabled:o,onChange:l}),(0,a.jsx)("span",{className:"pro-plan-head",children:(0,a.jsx)("span",{className:"pro-plan-name",children:i?"Annual":"Monthly"})}),(0,a.jsx)("span",{className:"pro-plan-sub",children:i?"Only ".concat((0,d.bO)(n),"/mo"):"Flexible \xb7 billed every month"}),(0,a.jsxs)("span",{className:"pro-plan-price",children:[(0,d.ji)(n),(0,a.jsx)("span",{className:"pro-plan-period",children:v(n.interval)})]})]})}function j(e){var n,t,o;let{quote:i,interval:s,onChangeInterval:f,onDone:y}=e,g=(0,l.t2)(),x=(0,l.HH)(),{profile:j}=T(),S=null!=(t=null==j?void 0:j.full_name)?t:null,[N,C]=(0,r.useState)(null!=(o=null==(n=i.savedCards[0])?void 0:n.id)?o:c.oZ),[k,_]=(0,r.useState)(!1),[I,P]=(0,r.useState)(null),[M,E]=(0,r.useState)(!1),U="monthly"===s?i.plans.monthly:i.plans.yearly,A=N===c.oZ||0===i.savedCards.length,D=!!g&&!!x&&(!A||k),F=async()=>
1{if(!M&&g&&x){P(null),E(!0);try{var e,n,t,a,r,o;let l=A?null:N;if(!l){let a=await x.submit();if(a.error){P(null!=(e=a.error.message)?e:"Check your card details."),E(!1);return}let r=await g.createPaymentMethod({elements:x,params:{billing_details:{name:S,email:i.email,phone:null}}});if(r.error||!r.paymentMethod){P(null!=(t=null==(n=r.error)?void 0:n.message)?t:"That card could not be used."),E(!1);return}l=r.paymentMethod.id}let c=await (0,d.lH)({interval:s,paymentMethodId:l});if(!c){P("Something went wrong starting your subscription."),E(!1);return}if("requires_action"===c.status&&c.clientSecret){let e=await g.handleNextAction({clientSecret:c.clientSecret});if(e.error){P(null!=(a=e.error.message)?a:"Your bank did not approve the payment."),E(!1);return}}let u="active"===c.status;if(c.subscriptionId)try{let e=await (0,d.IS)(c.subscriptionId);u=null!=(r=null==e?void 0:e.active)?r:u}catch(e){console.error("pro activation check failed",e)}!c.alreadyActive&&((0,h.y)({sendTo:h.G.pro,value:U.amount,currency:U.currency,transactionId:null!=(o=c.subscriptionId)?o:""}),c.subscriptionId&&((0,m.Eb)({event:"Subscribe",eventId:c.subscriptionId,params:{value:U.amount,currency:U.currency.toUpperCase(),predicted_ltv:U.amount,content_ids:["pro-".concat(s)],content_name:"Card Index Pro (".concat(s,")"),content_type:"product"}}),(0,p.V)({event:"subscription_created",eventId:c.subscriptionId,planId:"pro-".concat(s),value:U.amount,currency:U.currency}))),y(u)}catch(e){P((0,d.VC)(e)),E(!1)}}};return(0,a.jsxs)("div",{className:"pro-buy",children:[(0,a.jsx)("h3",{className:"pro-buy-title",children:"Complete your upgrade"}),(0,a.jsxs)("p",{className:"pro-buy-sub",children:["Youâll be charged ",(0,d.ji)(U),v(s),". ",b]}),i.testMode&&(0,a.jsx)("p",{className:"co-testmode",children:"Test mode â use card 4242 4242 4242 4242."}),(0,a.jsx)("span",{className:"pro-field-label",children:"Choose your plan"}),(0,a.jsxs)("div",{className:"pro-plans",role:"radiogroup","aria-label":"Choose your plan",children:[(0,a.jsx)(w,{plan:i.plans.monthly,selected:"monthly"===s,badge:null,disabled:M,onSelect:()=>f("monthly")}),(0,a.jsx)(w,{plan:i.plans.yearly,selected:"yearly"===s,badge:i.plans.yearlySavingsPercent?"Save ".concat(i.plans.yearlySavingsPercent,"%"):"Best value",disabled:M,onSelect:()=>f("yearly")})]}),(0,a.jsx)(c.kr,{savedCards:i.savedCards,selectedCardId:N,onSelectCard:C,offerToSave:!1,billingDetails:{name:"never",email:"never",phone:"never",address:"if_required"},disabled:M,onCompleteChange:_}),I&&(0,a.jsx)("div",{className:"co-notice is-error",role:"alert",children:I}),(0,a.jsx)("button",{type:"button",className:"pro-submit",disabled:!D||M,onClick:()=>void F(),children:M?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"pro-submit-spinner","aria-hidden":"true"}),"Processing"]}):"Subscribe \xb7 ".concat((0,d.ji)(U)).concat(v(s))}),(0,a.jsxs)("p",{className:"pro-secure",children:[(0,a.jsx)(u.XA,{size:13}),"Secure payment. ",b]})]})}let S=["#3a5eff","#7d97ff","#ffc53d","#1f9e5b","#ff6b8a","#a855f7"];function N(){let e=(0,r.useMemo)(()=>Array.from({length:70},(e,n)=>({id:n,style:{left:"".concat(100*Math.random(),"%"),width:"".concat(6+Math.round(4*Math.random()),"px"),height:"".concat(10+Math.round(6*Math.random()),"px"),background:S[n%S.length],animationDelay:"".concat(1.1*Math.random(),"s"),animationDuration:"".concat(2.4+1.8*Math.random(),"s"),"--drift":"".concat(Math.round(220*Math.random()-110),"px"),"--spin":"".concat(Math.round(1080*Math.random()-540),"deg")}})),[]);return(0,a.jsx)("div",{className:"pro-confetti","aria-hidden":"true",children:e.map(e=>(0,a.jsx)("span",{className:"pro-confetti-piece",style:e.style},e.id))})}function C(e){let{state:n,onClose:t}=e,r="active"===n;return(0,a.jsxs)("div",{className:"pro-overlay",role:"presentation",onMouseDown:e=>{e.target===e.currentTarget&&t()},children:[r&&(0,a.jsx)(N,{}),(0,a.jsxs)("section",{className:"pro-won",role:"dialog","aria-modal":"true","aria-labelledby":"pro-won-title",children:[(0,a.jsx)("button",{type:"button",className:"pro-close","aria-label":"Close",onClick:t,children:"\xd7"}),(0,a.jsx)("span",{className:"pro-won-mark","aria-hidden":"true",children:r?(0,a.jsx)(u.pw,{size:26}):(0,a.jsx)(u.Sr,{size:26})}),(0,a.jsx)("h2",{className:"pro-won-title",id:"pro-won-title",children:r?"Your account has been upgraded":"Payment received"}),(0,a.jsx)("p",{className:"pro-won-sub",children:r?"Everything is unlocked on this account, on the web and in the app.":"Your subscription is being switched on. It usually takes a few seconds â refresh if anything still looks locked."}),(0,a.jsx)("button",{type:"button",className:"pro-submit",onClick:t,children:r?"Start exploring":"Close"})]})]})}function k(e){var n;let{quote:t,onClose:r}=e,o=t.current,l=function(e){if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?null:n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}
1(null!=(n=null==o?void 0:o.expiresAt)?n:null);return(0,a.jsxs)("div",{className:"pro-buy",children:[(0,a.jsx)("span",{className:"pro-done-mark","aria-hidden":"true",children:(0,a.jsx)(u.Sr,{size:24})}),(0,a.jsx)("h3",{className:"pro-buy-title",children:"Youâre on Pro"}),(0,a.jsx)("p",{className:"pro-buy-sub",children:(null==o?void 0:o.manageable)===!1&&(null==o?void 0:o.storeLabel)?"Your subscription is billed through ".concat(o.storeLabel,", so it has to be changed there."):(null==o?void 0:o.willRenew)===!1&&l?"Pro is active until ".concat(l," and will not renew."):l?"Your plan renews on ".concat(l,"."):"Everything is unlocked on this account."}),(0,a.jsx)("button",{type:"button",className:"pro-submit",onClick:r,children:"Got it"})]})}function _(e){let{open:n,reason:t,onClose:o}=e,{refreshProfile:c}=T(),[u,p]=(0,r.useState)(null),[h,m]=(0,r.useState)(null),[f,b]=(0,r.useState)(null),[g,v]=(0,r.useState)("yearly"),w=(0,r.useCallback)(async()=>{m(null);try{p(await (0,d.CP)())}catch(e){m((0,d.VC)(e))}},[]);(0,r.useEffect)(()=>{n&&w()},[n,w]),(0,r.useEffect)(()=>{n||(p(null),b(null),m(null))},[n]),(0,r.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"===e.key&&o()};document.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=t}},[n,o]);let S=(0,y.Cv)(),N=(null==u?void 0:u.available)===!0&&!u.alreadyPro,_=(null==u?void 0:u.available)===!0?u.plans:null,I=_?"monthly"===g?_.monthly:_.yearly:null,P=(0,r.useMemo)(()=>I?{mode:"subscription",amount:Math.max(50,Math.round(100*I.amount)),currency:I.currency.toLowerCase(),paymentMethodCreation:"manual",paymentMethodTypes:["card"],appearance:y.VR}:null,[I]);return n?f?(0,s.createPortal)((0,a.jsx)(C,{state:f,onClose:o}),document.body):(0,s.createPortal)((0,a.jsx)("div",{className:"pro-overlay",role:"presentation",onMouseDown:e=>{e.target===e.currentTarget&&o()},children:(0,a.jsxs)("section",{className:"pro-card",role:"dialog","aria-modal":"true","aria-label":null!=t?t:"Upgrade to Card Index Pro",children:[(0,a.jsx)("button",{type:"button",className:"pro-close","aria-label":"Close",onClick:o,children:"\xd7"}),(0,a.jsx)(x,{}),(0,a.jsxs)("div",{className:"pro-panel",children:[t&&(0,a.jsx)("p",{className:"pro-reason",children:t}),h&&(0,a.jsx)("div",{className:"co-notice is-error",role:"alert",children:h}),!u&&!h&&(0,a.jsx)("div",{className:"co-loading",children:"Loading plansâ¦"}),(null==u?void 0:u.available)===!1&&(0,a.jsxs)("div",{className:"pro-buy",children:[(0,a.jsx)("h3",{className:"pro-buy-title",children:"Pro isnât on sale here yet"}),(0,a.jsx)("p",{className:"pro-buy-sub",children:"Subscriptions are not switched on for this site. You can still upgrade in the Card Index mobile app, and it unlocks here automatically."}),(0,a.jsx)("button",{type:"button",className:"pro-submit",onClick:o,children:"Got it"})]}),(null==u?void 0:u.available)===!0&&u.alreadyPro&&(0,a.jsx)(k,{quote:u,onClose:o}),N&&(null==u?void 0:u.available)===!0&&P&&S&&(0,a.jsx)(l.S8,{stripe:S,options:P,children:(0,a.jsx)(j,{quote:u,interval:g,onChangeInterval:v,onDone:e=>{b(e?"active":"pending"),c(),e||window.setTimeout(()=>void c(),3e3)}})}),(0,a.jsxs)("footer",{className:"pro-foot",children:[(0,a.jsx)(i.default,{src:"/logo-icon.png",alt:"",width:16,height:21,"aria-hidden":"true"}),(0,a.jsxs)("span",{children:["\xa9 ",new Date().getFullYear()," Cardindex Inc"]}),(0,a.jsx)("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy"}),(0,a.jsx)("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms"})]})]})]})}),document.body):null}let I="pdnhcmifniijadnhlbhblalmnibhbhdo".split(",").map(e=>e.trim()).filter(Boolean),P=/^[a-p]{32}$/;var M=t(22237),E=t(64767);let U=(0,r.createContext)({session:null,loading:!0,profile:null,isSignedIn:!1,isPaid:!1,refreshProfile:async()=>{},openAuth:()=>{},openUpgrade:()=>{},requirePro:()=>!1,signOut:async()=>{}});function A(e){var n;let{children:t}=e,[l,i]=(0,r.useState)(null),[s,c]=(0,r.useState)(!0),[u,d]=(0,r.useState)(null),[p,h]=(0,r.useState)(!1),[m,f]=(0,r.useState)("signin"),[b,y]=(0,r.useState)(!1),[g,v]=(0,r.useState)(void 0),[x,w]=(0,r.useState)(!1),j=(0,r.useRef)(!1),S=(0,r.useRef)(null),N=(0,r.useRef)(!1),[C,k]=(0,r.useState)("idle"),A=(0,r.useRef)(null),[T,D]=(0,r.useState)(null),F=null==l||null==(n=l.user)?void 0:n.id,L=(0,r.useCallback)(async()=>
1{if(!F)return void d(null);try{d(await (0,M.eO)(F))}catch(e){console.warn("Failed to load profile",e)}},[F]);(0,r.useEffect)(()=>{let e=(0,E.b)();e.auth.getSession().then(e=>{let{data:n}=e;i(n.session),c(!1)});let{data:n}=e.auth.onAuthStateChange((e,n)=>{i(n),c(!1)});return()=>n.subscription.unsubscribe()},[]),(0,r.useEffect)(()=>{let e=!1;return(l&&!l.user.is_anonymous&&F?(0,M.eO)(F):Promise.resolve(null)).then(n=>{e||d(n)}).catch(e=>console.warn("Failed to load profile",e)).finally(()=>{e||w(!0)}),()=>{e=!0}},[F,l]);let R=!!l&&!l.user.is_anonymous,G=R&&(null==u?void 0:u.plan)==="paid",O=(0,r.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signin",n=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0;A.current=null!=n?n:null,D(null!=t?t:null),f(e),h(!0)},[]),Y=(0,r.useCallback)(e=>{v(e),y(!0)},[]),q=(0,r.useCallback)(e=>!!G||(R?Y(e):O("signup"),!1),[G,R,O,Y]);(0,r.useEffect)(()=>{if(s||N.current)return;let e=new URLSearchParams(window.location.search),n=e.get("auth");if("signin"!==n&&"signup"!==n)return;for(let t of(N.current=!0,S.current=function(e){let n=new URLSearchParams(e).get("ext");return n&&P.test(n)?I.length>0&&!I.includes(n)?(console.warn('Ignoring session hand-off for extension "'.concat(n,'": add it to NEXT_PUBLIC_EXTENSION_IDS to allow it.')),null):n:null}(window.location.search),R||O(n),["auth","ext","source"]))e.delete(t);let t=e.toString();window.history.replaceState(null,"","".concat(window.location.pathname).concat(t?"?".concat(t):"").concat(window.location.hash))},[s,R,O]),(0,r.useEffect)(()=>{let e=S.current;if(!e||!R||!l||"idle"!==C)return;let n=!1;return(function(e,n){var t;let a=null==(t=window.chrome)?void 0:t.runtime;return(null==a?void 0:a.sendMessage)?new Promise(t=>{let r=setTimeout(()=>t(!1),3e3);try{a.sendMessage(e,{type:"cardindex:session",...n},e=>{clearTimeout(r),t(!a.lastError&&(null==e?void 0:e.ok)===!0)})}catch(e){clearTimeout(r),t(!1)}}):Promise.resolve(!1)})(e,{access_token:l.access_token,refresh_token:l.refresh_token}).then(e=>{n||(S.current=null,k(e?"sent":"failed"))}),()=>{n=!0}},[R,l,C]),(0,r.useEffect)(()=>{var e;if(s||!x||j.current)return;let n=new URLSearchParams(window.location.search);if("1"!==n.get("upgrade"))return;for(let t of(j.current=!0,q(null!=(e=n.get("reason"))?e:void 0),["upgrade","reason","source"]))n.delete(t);let t=n.toString();window.history.replaceState(null,"","".concat(window.location.pathname).concat(t?"?".concat(t):"").concat(window.location.hash))},[s,x,q]);let z=(0,r.useCallback)(async()=>{await (0,E.b)().auth.signOut({scope:"local"}),d(null)},[]),B=(0,r.useMemo)(()=>({session:l,loading:s,profile:u,isSignedIn:R,isPaid:G,refreshProfile:L,openAuth:O,openUpgrade:Y,requirePro:q,signOut:z}),[l,s,u,R,G,L,O,Y,q,z]);return(0,a.jsxs)(U.Provider,{value:B,children:[t,(0,a.jsx)(o.U,{open:p,initialMode:m,onGuest:(null==T?void 0:T.guest)?()=>{let e=T.guest;A.current=null,D(null),h(!1),null==e||e()}:void 0,onClose:()=>{let e=null==T?void 0:T.onDismiss;A.current=null,D(null),h(!1),null==e||e()},onAuthed:()=>{h(!1),L();let e=A.current;A.current=null,D(null),null==e||e()}}),(0,a.jsx)(_,{open:b,reason:g,onClose:()=>y(!1)}),"idle"!==C&&(0,a.jsxs)("div",{className:"extension-handoff".concat("failed"===C?" is-failed":""),role:"status",children:[(0,a.jsx)("span",{children:"sent"===C?"Youâre signed in. Switch back to your Whatnot tab to start scanning.":"Signed in here, but the Card Index extension didnât answer. Check itâs installed and enabled, then click Log in from the overlay again."}),(0,a.jsx)("button",{type:"button","aria-label":"Dismiss",onClick:()=>k("idle"),children:"\xd7"})]})]})}function T(){return(0,r.useContext)(U)}},98328:(e,n,t)=>{t.d(n,{Eb:()=>o,Zk:()=>a,eI:()=>i});let a="925722463345969",r=new Set;function o(e){var n,t,a,o;let l=null!=(a=e.once)?a:e.eventId?"".concat(e.event,":").concat(e.eventId):null;if(l){if(r.has(l))return;r.add(l)}null==(n=(t=window).fbq)||n.call(t,"track",e.event,null!=(o=e.params)?o:{},e.eventId?{eventID:e.eventId}:void 0)}function l(e){let n=document.cookie.match(new RegExp("(?:^|;\\s*)".concat(e,"=([^;]*)")));return n?decodeURIComponent(n[1]):null}function i(){if("undefined"==typeof document)return{fbp:null,fbc:null};let e=l("_fbp"),n=l("_fbc");if(n)return{fbp:e,fbc:n};let t=new URLSearchParams(window.location.search).get("fbclid");return{fbp:e,fbc:t?"fb.1.".concat(Date.now(),".").concat(t):null}}}}]);
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.