PageSourceSearch

https://csalpha.net/assets/CalculatorPage-0vqAewq4.js

js csalpha.net collected 2026-10-02 02:01:15 UTC 21,574 bytes, 1 lines download raw bytes

1import{a as Ke,j as e}from"./index-B0XfmHxY.js";import{b as i}from"./vendor-CP3rGsdy.js";import{E as K,C as De,r as Ge,i as he,p as We,a as fe,b as ge,o as oe}from"./tradeup-to-calculator-C3LGxSAf.js";function Ve(o,n){const x=o.length;if(x===0)return[];const h=new Map;for(const u of o)h.set(u.collectionId,(h.get(u.collectionId)??0)+1);const f=new Map;for(const u of n){const s=f.get(u.collectionId)??[];s.push(u),f.set(u.collectionId,s)}for(const u of h.keys())if(!f.has(u))return[];const y=[];for(const[u,s]of f){const v=h.get(u)??0;if(v===0)continue;const F=v/x/s.length;for(const T of s)y.push({outcome:T,probability:F})}return y}function Xe(o,n,x){if(o.length===0)return n;let h=0;for(const u of o){const s=u.maxFloat-u.minFloat;h+=s>0?(u.floatValue-u.minFloat)/s:0}const f=h/o.length,y=n+f*(x-n);return Math.max(n,Math.min(x,y))}const He=[["Factory New",.07],["Minimal Wear",.15],["Field-Tested",.38],["Well-Worn",.45],["Battle-Scarred",1]];function Ye(o){for(const[n,x]of He)if(o<x)return n;return"Battle-Scarred"}function be(o){const n=Math.floor(o),x=o-n;return x<.5?n:x>.5?n+1:n%2===0?n:n+1}const qe=0,Qe=0,ze=.02;function Je(o){return Math.trunc(o+be(o*qe)+Qe)}function Ze(o){return Math.trunc(o-be(o*ze))}function ye(o,n,x){const h=Ve(o,n);if(h.length===0)return null;const f=x.reduce((l,b)=>l+Je(b),0),y=h.map(({outcome:l,probability:b})=>{const w=Xe(o,l.minFloat,l.maxFloat),N=Ye(w),I=l.priceCents!=null?Ze(l.priceCents):null,Q=I!=null?b*I:null;return{outcome:l,probability:b,predictedFloat:w,condition:N,priceCents:l.priceCents,netProceedsCents:I,evContributionCents:Q}}),s=y.every(l=>l.evContributionCents!=null)?y.reduce((l,b)=>l+(b.evContributionCents??0),0):null,v=s!=null&&f>0?(s-f)/f*100:null,S=y.every(l=>l.netProceedsCents!=null),F=S?Math.max(...y.map(l=>l.netProceedsCents??0)):null,T=S?Math.min(...y.map(l=>l.netProceedsCents??0)):null;return{totalCostCents:f,expectedValueCents:s,netRoiPct:v,bestCaseCents:F,worstCaseCents:T,outcomes:y}}const j="var(--pixel-ink)",O="var(--pixel-shadow)",Y="var(--foreground)",m="var(--card-foreground)",q="var(--primary)",p="var(--muted-foreground)",G="var(--muted)",W="var(--chip-warn-bg)",je="var(--profit)",Se="var(--profit-strong)",L="var(--destructive)",C="var(--card)",g=(o,n={})=>({fontFamily:"'Press Start 2P', monospace",fontSize:o,letterSpacing:"0.04em",lineHeight:1.5,...n}),d=(o,n={})=>({fontFamily:"'VT323', monospace",fontSize:o,lineHeight:1.4,fontVariantNumeric:"tabular-nums",...n}),ve=["Consumer Grade","Industrial Grade","Mil-Spec","Restricted","Classified"],et={"Consumer Grade":"Industrial Grade","Industrial Grade":"Mil-Spec","Mil-Spec":"Restricted",Restricted:"Classified",Classified:"Covert"},Fe={"Factory New":"FN","Minimal Wear":"MW","Field-Tested":"FT","Well-Worn":"WW","Battle-Scarred":"BS"};function E(o){return(o/100).toLocaleString("en-US",{style:"currency",currency:"USD"})}function ke({src:o,size:n=34}){return o?e.jsx("img",{src:o,alt:"",width:n,height:n,style:{width:n,height:n,objectFit:"contain",background:W,border:`1.5px solid ${j}`,flexShrink:0},loading:"lazy"}):e.jsx("div",{style:{width:n,height:n,background:W,border:`1.5px solid ${j}`,flexShrink:0}})}function Ce({index:o,slot:n,skinOptions:x,onChange:h}){const[f,y]=i.useState(n.skin?`${n.skin.name} · ${n.skin.collection_name}`:""),[u,s]=i.useState(!1);i.useEffect(()=>{y(n.skin?`${n.skin.name} · ${n.skin.collection_name}`:"")},[n.skin]);const v=f.toLowerCase(),S=x.filter(l=>l.name.toLowerCase().includes(v)||l.collection_name.toLowerCase().includes(v)).slice(0,25),F=parseFloat(n.floatStr),T=n.skin&&n.floatStr!==""&&Number.isFinite(F)&&(F<n.skin.min_float||F>n.skin.max_float)?`Must be ${n.skin.min_float.toFixed(4)}–${n.skin.max_float.toFixed(4)}`:null;return e.jsxs("div",{style:{border:`2px solid ${T?L:j}`,background:C,padding:11},children:[e.jsxs("div",{style:g(7,{color:p,marginBottom:6}),children:["INPUT ",o+1]}),e.jsxs("div",{className:"flex gap-2 items-start",children:[n.skin&&e.jsx(ke,{src:n.skin.image_url}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx("input",{value:f,onChange:l=>{y(l.target.value),s(!0),n.skin&&h({skin:null})},onFocus:()=>s(!0),onBlur:()=>setTimeout(()=>s(!1),150),placeholder:"Search any skin, any collection...",style:{...d(17,{color:m}),width:"100%",padding:"6px 8px",border:`1.5px solid ${j}`,background:C,outline:"none"}}),u&&S.length>0&&e.jsx("div",{style:{position:"absolute",zIndex:20,top:"100%",left:0,right:0,marginTop:3,maxHeight:260,overflowY:"auto",background:C,border:`2px solid ${j}`,boxShadow:`2px 2px 0 ${O}`},children:S.map(l=>e.jsxs("button",{onMouseDown:()=>{h({skin:l,floatStr:n.floatStr||l.min_float.toFixed(4)}),s(!1)},className:"flex items-center gap-2",style:{width:"100%",textAlign:"left",padding:"6px 8px",background:"transparent",curs
1or:"pointer"},onMouseEnter:b=>b.currentTarget.style.background=W,onMouseLeave:b=>b.currentTarget.style.background="transparent",children:[e.jsx(ke,{src:l.image_url,size:28}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{style:{...d(17,{color:m}),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.name}),e.jsx("div",{style:d(14,{color:p}),children:l.collection_name})]})]},`${l.name}|${l.collection_id}`))})]})]}),n.skin&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:g(6.5,{color:p,marginBottom:3}),children:"FLOAT"}),e.jsx("input",{type:"number",step:"0.0001",value:n.floatStr,onChange:l=>h({floatStr:l.target.value}),className:"num",style:{...d(17,{color:m}),width:"100%",padding:"5px 7px",border:`1.5px solid ${T?L:j}`,outline:"none"}})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:g(6.5,{color:p,marginBottom:3}),children:"PRICE ($)"}),e.jsx("input",{type:"number",step:"0.01",value:n.priceStr,onChange:l=>h({priceStr:l.target.value}),className:"num",style:{...d(17,{color:m}),width:"100%",padding:"5px 7px",border:`1.5px solid ${j}`,outline:"none"}})]})]}),T&&e.jsx("div",{style:d(15,{color:L,marginTop:4}),children:T})]})}function tt({result:o,filledCount:n,calculated:x,outcomeCount:h}){if(!x||n<10||!o){const s=n>=10&&h===0;return e.jsxs("div",{style:{border:`2px dashed ${p}`,padding:28,textAlign:"center"},children:[e.jsxs("div",{style:g(11,{color:p}),children:[n,"/10 INPUTS"]}),e.jsx("div",{style:d(19,{color:p,marginTop:10}),children:n<10?"Fill all 10 slots with a valid skin, float, and price -- from any collection, one shared rarity.":s?"These collections have no skins at the next rarity up, so this contract has no possible outcomes to price.":"Click CALCULATE to see live odds and EV."})]})}const f=o.netRoiPct,y=f!=null,u=y&&f>=0;return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:G,borderBottom:`2px solid ${j}`},children:["OUTCOME","ODDS","FLOAT / WEAR","PRICE","EV CONTRIB."].map(s=>e.jsx("th",{style:{...g(7,{color:m}),textAlign:"left",padding:"8px 10px"},children:s},s))})}),e.jsx("tbody",{children:o.outcomes.slice().sort((s,v)=>v.probability-s.probability).map(s=>e.jsxs("tr",{style:{borderBottom:`1.5px solid ${G}`},children:[e.jsx("td",{style:{...d(18,{color:m}),padding:"7px 10px"},children:s.outcome.name}),e.jsxs("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:[(s.probability*100).toFixed(2),"%"]}),e.jsxs("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:[s.predictedFloat.toFixed(4)," ",e.jsxs("span",{style:{color:p},children:["(",Fe[s.condition],")"]})]}),e.jsx("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:s.priceCents!=null?E(s.priceCents):"—"}),e.jsx("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:s.evContributionCents!=null?E(s.evContributionCents):"—"})]},s.outcome.name))})]})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,padding:14},children:[e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"TOTAL COST"}),e.jsx("div",{className:"num",style:d(24,{color:m}),children:E(o.totalCostCents)})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"EXPECTED VALUE"}),e.jsx("div",{className:"num",style:d(24,{color:m}),children:o.expectedValueCents!=null?E(o.expectedValueCents):"—"})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"NET ROI"}),e.jsx("div",{className:"num",style:d(24,{color:y?u?Se:L:m}),children:y?`${u?"▲":"▼"} ${f.toFixed(1)}%`:"—"})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"BEST / WORST"}),e.jsxs("div",{className:"num",style:d(20,{color:m}),children:[o.bestCaseCents!=null?E(o.bestCaseCents):"—"," / ",o.worstCaseCents!=null?E(o.worstCaseCents):"—"]})]})]})]})}function nt({filledCount:o,loading:n,error:x,tradeUp:h,stats:f}){if(n)return e.jsx("div",{style:{border:`2px dashed ${p}`,padding:28,textAlign:"center"},children:e.jsx("div",{style:g(11,{color:p}),children:"CALCULATING..."})});if(x)return e.jsx("div",{style:{border:`2px solid ${L}`,background:"var(--chip-loss-bg)",padding:20},children:e.jsx("div",{style:d(19,{color:L}),children:x})});if(!h||!f)return e.jsxs("div",{style:{border:`2px dashed ${p}`,padding:28,textAlign:"center"},children:[e.jsxs("div",{style:g(11,{color:p}),children:[o,"/5 INPUTS"]}),e.jsx("div",{style:d(19,{color:p,marginTop:10}),children:o<5?"Fill all 5 Covert-rarity inputs, then click CALCULATE.":"Click CALCULATE to run the real knife trade-up odds."})]});const y=h.roi_percentage,u=y>=0;return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:G,borderBottom:`2px solid ${j}`},children:["OUTCOME","COLLECTION","ODDS","FLOAT / WEAR","PRICE"].map(s=>e.jsx("th",{style:{...g(7,{color:m}),textAlign:"left",padding:"8px 10px"},children:s},s))})}),e.jsx("tbody",{children:h.outcomes.slice().sort((s,v)=>v.probability-s.probability).map(s=>e.jsxs("tr",{style:{borderBottom:`1.5px solid ${G}`}
1,children:[e.jsx("td",{style:{...d(18,{color:m}),padding:"7px 10px"},children:s.skin_name}),e.jsx("td",{style:{...d(16,{color:p}),padding:"7px 10px"},children:s.collection_name}),e.jsxs("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:[(s.probability*100).toFixed(2),"%"]}),e.jsxs("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:[s.predicted_float.toFixed(4)," ",e.jsxs("span",{style:{color:p},children:["(",Fe[s.predicted_condition]??s.predicted_condition,")"]})]}),e.jsx("td",{className:"num",style:{...d(18,{color:m}),padding:"7px 10px"},children:E(s.estimated_price_cents)})]},s.skin_id))})]})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,padding:14},children:[e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"TOTAL COST"}),e.jsx("div",{className:"num",style:d(24,{color:m}),children:E(h.total_cost_cents)})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"EXPECTED VALUE"}),e.jsx("div",{className:"num",style:d(24,{color:m}),children:E(h.expected_value_cents)})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"NET ROI"}),e.jsxs("div",{className:"num",style:d(24,{color:u?Se:L}),children:[u?"▲":"▼"," ",y.toFixed(1),"%"]})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(7,{color:p,marginBottom:4}),children:"BEST / WORST"}),e.jsxs("div",{className:"num",style:d(20,{color:m}),children:[E(f.best_case_cents)," / ",E(f.worst_case_cents)]})]})]})]})}function rt(){const[o,n]=i.useState("gun"),[x,h]=i.useState(ve[0]),[f,y]=i.useState([]),[u,s]=i.useState([]),[v,S]=i.useState(()=>Array.from({length:10},()=>({...K}))),[F,T]=i.useState(!1),[l,b]=i.useState({}),w=i.useRef(new Set),[N,I]=i.useState(!1),[Q,A]=i.useState(!1),[z,le]=i.useState([]),[V,J]=i.useState(()=>Array.from({length:5},()=>({...K}))),[$,re]=i.useState(!1),[Te,P]=i.useState(null),[U,M]=i.useState(null),[R,Z]=i.useState(null),[ie,ee]=i.useState(null),[ae,ce]=i.useState(!1),[de,Ee]=i.useState(!1),te=i.useRef(null);i.useEffect(()=>{if(!window.location.search.includes(De))return;
1const t=Ge();if(t){if(n(t.mode),t.mode==="gun"){const c=he(t.tradeUpType);c&&h(c)}I(t.stattrak===!0),Z(t),window.history.replaceState(null,"",window.location.pathname)}},[]);const ue=i.useRef(0);i.useEffect(()=>{const t=++ue.current,c=()=>t!==ue.current;S(Array.from({length:10},()=>({...K}))),A(!1),ce(!1),fetch(`/api/calculator/skins?rarity=${encodeURIComponent(x)}`).then(a=>a.json()).then(a=>{c()||(y(a.skins??[]),te.current=x)}).catch(()=>{c()||(y([]),te.current=x)}).finally(()=>{c()||ce(!0)})},[x]),i.useEffect(()=>{fetch("/api/calculator/skins?rarity=Covert").then(t=>t.json()).then(t=>le(t.skins??[])).catch(()=>le([])).finally(()=>Ee(!0))},[]),i.useEffect(()=>{if(!R)return;const t=We({mode:R.mode,inferredRarity:he(R.tradeUpType),gunLoaded:ae,gunLoadedRarity:te.current,knifeLoaded:de});if(t==="wait")return;if(t==="resolve-knife"){const a=fe(R,z);J(a.slots),M(null),P(null),ee(ge(a,"knife",R.tradeUpType)),Z(null);return}const c=fe(R,f);S(c.slots),A(!1),ee(ge(c,"gun",R.tradeUpType)),Z(null)},[R,f,ae,z,de]);const ne=v.filter(t=>t.skin),pe=i.useMemo(()=>Array.from(new Set(ne.map(t=>t.skin.collection_id))).sort(),[ne]),xe=pe.join(","),D=et[x];i.useEffect(()=>{if(pe.length===0||!D){s([]);return}fetch(`/api/calculator/skins?rarity=${encodeURIComponent(D)}&collections=${encodeURIComponent(xe)}`).then(t=>t.json()).then(t=>s((t.skins??[]).filter(c=>!c.name.startsWith("★")))).catch(()=>s([]))},[xe,D]);const Ne=i.useCallback((t,c)=>{S(a=>a.map((r,k)=>k===t?{...r,...c}:r))},[]),_e=i.useCallback((t,c)=>{J(a=>a.map((r,k)=>k===t?{...r,...c}:r)),M(null),P(null)},[]),Re=i.useCallback(async()=>{T(!0);try{const r=((await(await fetch(`/api/calculator/prefill?rarity=${encodeURIComponent(x)}`)).json()).picks??[]).slice(0,10).map(k=>({skin:{name:k.skin,weapon:k.weapon,min_float:k.min_float,max_float:k.max_float,image_url:k.image_url,collection_id:k.collection_id,collection_name:k.collection_name},floatStr:k.float!=null?k.float.toFixed(4):k.min_float.toFixed(4),priceStr:(k.price_cents/100).toFixed(2)}));for(;r.length<10;)r.push({...K});S(r),A(!1)}catch{}finally{T(!1)}},[x]),[we,Ae]=i.useState(0),$e=i.useCallback(()=>{S(Array.from({length:10},()=>({...K}))),A(!1),b({}),w.current.clear(),Ae(t=>t+1)},[]),B=ne.filter(t=>t.floatStr!==""&&t.priceStr!=="").length,_=i.useMemo(()=>{if(B<10||!D||u.length===0)return null;const t=v.map(r=>({collectionId:r.skin.collection_id,floatValue:parseFloat(r.floatStr),minFloat:r.skin.min_float,maxFloat:r.skin.max_float}));if(t.some(r=>!Number.isFinite(r.floatValue)))return null;const c=v.map(r=>Math.round(parseFloat(r.priceStr)*100)),a=u.map(r=>({collectionId:r.collection_id,name:r.name,minFloat:r.min_float,maxFloat:r.max_float,priceCents:null}));return ye(t,a,c)},[v,B,D,u]);i.useEffect(()=>{if(!_)return;const c=_.outcomes.map(a=>oe(a.outcome.name,a.condition,N)).filter(a=>!(a in l)&&!w.current.has(a));c.length!==0&&(c.forEach(a=>w.current.add(a)),fetch(`/api/calculator/outcome-prices?skins=${encodeURIComponent(c.join(","))}`).then(a=>a.json()).then(a=>b(r=>({...r,...a.prices??{}}
1))).catch(()=>{c.forEach(a=>w.current.delete(a))}))},[_,l,N]);const Le=i.useMemo(()=>{if(!_)return null;const t=v.map(r=>({collectionId:r.skin.collection_id,floatValue:parseFloat(r.floatStr),minFloat:r.skin.min_float,maxFloat:r.skin.max_float})),c=v.map(r=>Math.round(parseFloat(r.priceStr)*100)),a=u.map(r=>{const k=_.outcomes.find(Be=>Be.outcome.name===r.name),me=k==null?void 0:k.condition,se=me?oe(r.name,me,N):null,Me=se&&se in l?l[se]:null;return{collectionId:r.collection_id,name:r.name,minFloat:r.min_float,maxFloat:r.max_float,priceCents:Me}});return ye(t,a,c)},[_,v,u,l,N]),X=i.useMemo(()=>_?_.outcomes.filter(t=>!(oe(t.outcome.name,t.condition,N)in l)).length:0,[_,l,N]),[Oe,Ie]=i.useState(0),Pe=i.useCallback(()=>{J(Array.from({length:5},()=>({...K}))),M(null),P(null),Ie(t=>t+1)},[]),H=V.filter(t=>t.skin&&t.floatStr!==""&&t.priceStr!=="").length,Ue=i.useCallback(async()=>{re(!0),P(null);try{const t={inputs:V.map(r=>({skinName:r.skin.name,floatValue:parseFloat(r.floatStr),priceCents:Math.round(parseFloat(r.priceStr)*100)}))},c=await Ke("/api/calculator",t),a=await c.json();c.ok?M(a):(P(a.error??(Array.isArray(a.errors)?a.errors.join("; "):"Could not evaluate this trade-up.")),M(null))}catch{P("Network error -- please try again."),M(null)}finally{re(!1)}},[V]);return e.jsxs("div",{className:"max-w-[1400px] mx-auto px-4 sm:px-6 py-8 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{style:g(26,{color:Y,lineHeight:1.4,textShadow:`3px 3px 0 ${G}`}),children:"Trade-Up Calculator"}),e.jsx("p",{style:d(20,{color:Y,marginTop:8,maxWidth:"70ch"}),children:"Fill your inputs -- any skin, any collection, one shared rarity -- or prefill from the cheapest live listings, then hit CALCULATE. Same math as the trade-up finder."})]}),o==="gun"&&N&&X>0&&e.jsx("div",{role:"status",style:{border:`2px solid ${q}`,background:W,padding:"10px 12px"},children:e.jsxs("span",{style:d(19,{color:Y}),children:[X," outcome",X===1?" has":"s have"," no StatTrak market price and ",X===1?"is":"are"," excluded from EV. StatTrak listings are thinner than normal ones, so treat this valuation as a floor."]})}),ie&&e.jsxs("div",{role:"status",className:"flex items-start gap-3",style:{border:`2px solid ${q}`,background:W,padding:"10px 12px"},children:[e.jsxs("span",{style:{...d(19,{color:Y,flex:1})},children:["⚠ ",ie]}),e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>ee(null),style:g(9,{color:m,background:C,border:`2px solid ${j}`,padding:"4px 8px",cursor:"pointer",flexShrink:0}),children:"X"})]}),e.jsx("div",{className:"flex gap-2",children:["gun","knife"].map(t=>e.jsx("button",{onClick:()=>n(t),style:g(9,{color:o===t?"#FFFFFF":m,background:o===t?q:C,border:`2px solid ${j}`,padding:"10px 16px",cursor:"pointer"}),children:t==="gun"?"GUN TRADE-UP":"KNIFE TRADE-UP (5x COVERT)"},t))}),o==="gun"?e.jsxs("div",{className:"grid lg:grid-cols-[420px_1fr] gap-6 items-start",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,padding:16},className:"space-y-4",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",style:{userSelect:"none"},children:[e.jsx("input",{type:"checkbox",checked:N,onChange:t=>{I(t.target.checked),A(!1)},style:{width:16,height:16,accentColor:"var(--primary)",cursor:"pointer"}}),e.jsx("span",{style:g(8,{color:m}),children:"STATTRAK"}),e.jsx("span",{style:d(16,{color:p}),children:"prices outcomes as StatTrak"})]}),e.jsxs("div",{children:[e.jsx("div",{style:g(8,{color:p,marginBottom:6}),children:"RARITY"}),e.jsx("select",{value:x,onChange:t=>{h(t.target.value),A(!1)},style:{...d(19,{color:m}),width:"100%",padding:"9px 11px",border:`2px solid ${j}`,background:C},children:ve.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx("button",{onClick:Re,disabled:F,className:"w-full",style:g(10,{color:"#FFFFFF",background:F?p:q,border:`2px solid ${j}`,padding:"12px 14px",cursor:F?"not-allowed":"pointer"}),children:F?"LOADING...":"PREFILL FROM LIVE"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>A(!0),disabled:B<10,className:"flex-1",style:g(11,{color:"#FFFFFF",background:B<10?p:je,border:`2px solid ${j}`,padding:"14px",cursor:B<10?"not-allowed":"pointer"}),children:"CALCULATE"}),e.jsx("button",{onClick:$e,style:g(10,{color:m,background:C,border:`2px solid ${j}`,padding:"14px 16px",cursor:"pointer"}),children:"RESET"})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:v.map((t,c)=>e.jsx(Ce,{index:c,slot:t,skinOptions:f,onChange:a=>{Ne(c,a)}},`${c}-${we}`))})]}),e.jsx("div",{children:e.jsx(tt,{result:Le,filledCount:B,calculated:Q,outcomeCount:u.length})})]}):e.jsxs("div",{className:"grid lg:grid-cols-[420px_1fr] gap-6 items-start",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{style:{border:`3px solid ${j}`,boxShadow:`4px 4px 0 ${O}`,background:C,padding:16},className:"space-y-2",children:[e.jsx("div",{style:d(18,{color:p}),children:"5 Covert-rarity skins trade up into 1 random knife from the collections involved."}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("button",{onClick:Ue,disabled:H<5||$,className:"flex-1",style:g(11,{color:"#FFFFFF",background:H<5||$?p:je,border:`2px solid ${j}`,padding:"14px",cursor:H<5||$?"not-allowed":"pointer"}),children:$?"CALCULATING...":"CALCULATE"}),e.jsx("button",{onClick:Pe,disabled:$,style:g(10,{color:m,background:C,border:`2px solid ${j}`,padding:"14px 16px",cursor:$?"not-allowed":"pointer"}),children:"RESET"})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:V.map((t,c)=>e.jsx(Ce,{index:c,slot:t,skinOptions:z,onChange:a=>_e(c,a)},`${c}-${Oe}`))})]}),e.jsx("div",{children:e.jsx(nt,{filledCount:H,loading:$,error:Te,tradeUp:(U==null?void 0:U.trade_up)??null,stats:(U==null?void 0:U.stats)??null})})]})]})}export{rt as CalculatorPage};

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.