PageSourceSearch

https://igitems.com/build/en/q-B5T522yG.js

js igitems.com collected 2026-10-09 21:59:01 UTC 16,567 bytes, 1 lines download raw bytes

1import{v as _,ag as F,b as c,aq as W,ar as z,a1 as P,L as w,aw as j,ab as e,A as v,e as r,R as h,az as f,ax as N,x as b}from"./q-DLsrMAIP.js";import{_ as d}from"./q-BKZ00VYc.js";import{B as V}from"./q-CQXkgE2j.js";import{C as X,c as A}from"./q-BsvrZ_Xn.js";import{C as U,a as H}from"./q-C4zCxSVJ.js";import{P as G,L as $,G as Y,H as K,F as J}from"./q-BCKFJsN0.js";import{f as Q,j as Z,d as q}from"./q-BUOMHTQ-.js";import"./q-my4VGyRH.js";import{c as ee}from"./q-Nwereb0n.js";const te=()=>{const[l,n]=_();n.value=l},le=Object.freeze(Object.defineProperty({__proto__:null,s_x0eK07gAXRU:te},Symbol.toStringTag,{value:"Module"})),ne=()=>{const[l]=_();return l.value.find(n=>n.skin)?.skin?.rarity??null},oe=Object.freeze(Object.defineProperty({__proto__:null,s_OvRRYXFvWSA:ne},Symbol.toStringTag,{value:"Module"})),se=()=>{const[l,n,s]=_();s.value!==n&&l(n),s.value=-1},ae=Object.freeze(Object.defineProperty({__proto__:null,s_5u4jcALj0EQ:se},Symbol.toStringTag,{value:"Module"})),k=W(z("s_BxApXlt0GGg")),O=()=>({skin:null,float:"",search:"",results:[],open:!1}),x={"Consumer Grade":"#b0c3d9","Industrial Grade":"#5e98d9","Mil-Spec Grade":"#4b69ff",Restricted:"#8847ff",Classified:"#d32ce6",Covert:"#eb4b4b"};function C(l){return l<.07?"FN":l<.15?"MW":l<.38?"FT":l<.45?"WW":"BS"}function y(l,n=2){return l==null?"N/A":`$${l.toFixed(n)}`}const re=F(c(()=>d(()=>Promise.resolve().then(()=>ce),void 0),"s_n0XajaZDtlI")),ue=({resolveValue:l})=>{const s=l(k)?.config;return{title:s?.metaTitle||"CS2 Tradeup Calculator | igitems",meta:[{name:"description",content:s?.metaDescription||"Calculate your CS2 tradeup contract output — see all possible skins, exact output float, probability per outcome, and expected vs. input value."},{name:"robots",content:"index, follow"},{name:"author",content:"igitems"}]}},Ue=Object.freeze(Object.defineProperty({__proto__:null,_auto_RARITY_COLORS:x,_auto_emptySlot:O,_auto_floatToWear:C,_auto_fmt:y,default:re,head:ue,useGameTypeConfig:k},Symbol.toStringTag,{value:"Module"})),ie=()=>{P();const l=k(),n=Q(),s=w(!1),o=w(null),u=l.value.gameType,i=l.value.config,a=w(Array.from({length:10},O)),p=j(c(()=>d(()=>Promise.resolve().then(()=>oe),void 0),"s_OvRRYXFvWSA",[a])),S=j(c(()=>d(()=>Promise.resolve().then(()=>Se),void 0),"s_A52VOt7GnrU",[a])),I=c(()=>d(()=>Promise.resolve().then(()=>Oe),void 0),"s_bO60N0v7Pco",[p,a,n]),E=c(()=>d(()=>Promise.resolve().then(()=>Pe),void 0),"s_ZFN909JtHMs",[o,a]),L=c(()=>d(()=>Promise.resolve().then(()=>Ae),void 0),"s_aA49gXwf9dI",[o,a]),R=c(()=>d(()=>Promise.resolve().then(()=>xe),void 0),"s_sAUNuf0E9rI",[o,a]),M=c(()=>d(()=>Promise.resolve().then(()=>fe),void 0),"s_7tmBYTquy44",[a]),T=w(-1),D=c(()=>d(()=>Promise.resolve().then(()=>Ee),void 0),"s_t6PyKDzeW9M",[S,s,o,a,n]),B=[{label:"How does the CS2 tradeup contract work?",description:"A tradeup contract takes 10 skins of the same rarity and produces 1 skin of the next rarity tier. The output skin comes from one of the same collections as your input skins, weighted by how many inputs you put from each collection."},{label:"How is the output float calculated?",description:"The output float is: avg_input_float × (output_max_float − output_min_float) + output_min_float. Lowering your average input float gives you lower (better) output floats."},{label:"How are probabilities calculated?",description:"Each possible output skin has an equal chance within its collection. The chance of getting a skin from a given collection equals the proportion of your 10 inputs that came from that collection."},{label:"What is the expected value?",description:"Expected value is the probability-weighted average of all possible output skin prices. A positive difference vs. total input cost means the tradeup is theoretically profitable — though variance is high."},{label:"Can I use StatTrak™ skins?",description:"In-game, 10 StatTrak inputs produce a StatTrak output. This calculator does not distinguish StatTrak variants — factor in the StatTrak premium separately when evaluating profitability."}];return e("div",null,null,[v(X,{title:i?.label||"CS2 Tradeup Calculator",description:i?.description||"Calculate the outcome of your CS2 tradeup contract — output float, probabilities, and expected value.",gameName:u?.label},3,"5B_0"),v(G,{label:i?.label||"CS2 Tradeup Calculator",description:i?.description||"Calculate the outcome of your CS2 tradeup contract — output float, probabilities, and expected value.",bgImg:u?.backgroundImg,bgImgMobile:u?.backgroundImgMobile,isProductTypeSelector:!0,gameType:u,[r]:{isProductTypeSelector:r}},3,"5B_1"),e("div",null,{class:"container mt-8 pb-24 space-y-10"},[p.value&&e("div",null,{class:"flex items-center gap-2 text-sm text-muted"},[e("div",{style:{background:x[p.value]||"#fff"}},{class:"h-2.5 w-2.5 rounded-full"},null,3,null),e("span",null,null,["Locked to ",e("strong",null,{class:"text-highlighted"},h(t=>t.value,[p]),3,null)," — all 10 skins must match"],3,null)],1,"5B_2"),e("div",null,{class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},a.value.map((t,m)=>P(v(H,{class:"relative overflow-visible",children:v(U,{class:"p-3 space-y-2",children:[e("div",null,{class:"flex items-center gap-2 mb-1"},[e("span",null,{class:"text-xs text-muted font-medium w-5"},["#",m+1],1,null),t.skin&&e("div",{style:{background:x[t.skin.rarity]||"#fff"}},{class:"h-2 w-2 rounded-full shrink-0"},null,3,"5B_3"),e("span",null,{class:"text-xs text-muted truncate flex-1"},t.skin?.category_name??"",1,null),t.skin&&e("button",{onClick$:c(()=>d(()=>Promise.resolve().then(()=>ge),void 0),"s_zm009mwoXp8",[R,m])},{class:"text-muted hover:text-highlighted p-0.5","aria-label":"Clear slot"},v(ee,{class:"h-3.5 w-3.5",[r]:{class:r}},3,"5B_4"),0,"5B_5")],1,null),e("div",null,{class:"relative"},[v($,{class:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted pointer-events-none",[r]:{class:r}},3,"5B_6"),e("input",{value:f(t,"search"),onInput$:c(()=>d(()=>Promise.resolve().then(()=>Re),void 0),"s_aNWSuJSc3eo",[I,m]),onFocus$:c(()=>d(()=>Promise.resolve().then(()=>me),void 0),"s_hSYWrksUlXU",[m,t,a]),onBlur$:c(()=>d(()=>Promise.resolve().then(()=>ae),void 0),"s_5u4jcALj0EQ",[M,m,T])},{type:"text",class:"w-full pl-8 pr-3 py-2 bg-white/[0.04] border border-white/[0.08] rounded-lg text-sm text-highlighted placeholder:text-muted focus:outline-none focus:ring-1 focus:ring-primary/40",placeholder:"Search skin name…"},null,2,null),t.open&&t.results.length>0&&e("div",null,{class:"absolute left-0 right-0 top-full mt-1 z-50 rounded-lg border border-white/[0.08] bg-[#0f0f14] 
1shadow-xl max-h-56 overflow-y-auto"},t.results.map(g=>e("button",{onMouseDown$:c(()=>d(()=>Promise.resolve().then(()=>le),void 0),"s_x0eK07gAXRU",[m,T]),onClick$:c(()=>d(()=>Promise.resolve().then(()=>Ce),void 0),"s_AG2r0c040L8",[m,E,g])},{class:"w-full text-left px-3 py-2 hover:bg-white/[0.06] flex items-center gap-2 text-sm"},[e("div",{style:{background:x[g.rarity]||"#aaa"}},{class:"h-2 w-2 rounded-full shrink-0"},null,3,null),e("span",null,{class:"truncate text-highlighted"},f(g,"name"),1,null),e("span",null,{class:"text-xs text-muted ml-auto shrink-0"},[g.min_float.toFixed(2),"–",g.max_float.toFixed(2)],1,null)],0,g.marketHashName)),1,"5B_7")],1,null),t.skin&&e("div",null,{class:"flex items-center gap-2"},[e("label",null,{class:"text-xs text-muted shrink-0"},"Float",3,null),e("input",{min:f(t.skin,"min_float"),max:f(t.skin,"max_float"),value:f(t,"float"),onInput$:c(()=>d(()=>Promise.resolve().then(()=>_e),void 0),"s_Ohfn7Nn0j2w",[m,L])},{type:"number",step:"0.00001",class:"w-full px-2 py-1.5 bg-white/[0.04] border border-white/[0.08] rounded-lg text-sm text-highlighted focus:outline-none focus:ring-1 focus:ring-primary/40"},null,2,null),e("span",null,{class:"text-xs text-muted shrink-0 w-7"},C(parseFloat(t.float)||0),1,null)],1,"5B_8"),t.skin?.price!=null&&e("div",null,{class:"text-xs text-muted text-right"},y(t.skin.price/100),1,"5B_9")],[r]:{class:r}},1,"5B_10"),[r]:{class:r}},1,m))),1,null),e("div",null,{class:"flex flex-col items-center gap-3"},[e("div",null,{class:"text-sm text-muted"},[h(t=>t.value,[S]),"/10 skins filled"],3,null),v(V,{size:"lg",onClick$:D,get disabled(){return s.value},class:"min-w-48",children:h(t=>t.value?"Calculating…":"Calculate Tradeup",[s]),[r]:{size:r,onClick$:r,disabled:h(t=>t.value,[s]),class:r}},3,"5B_11")],1,null),o.value&&e("div",null,{id:"tradeup-results",class:"space-y-6 scroll-mt-8"},[e("div",null,{class:"grid grid-cols-2 sm:grid-cols-4 gap-4"},[e("div",null,{class:"rounded-xl border border-white/5 bg-muted p-4 text-center"},[e("p",null,{class:"text-xs text-muted mb-1"},"Avg Input Float",3,null),e("p",null,{class:"font-title text-xl font-bold text-primary"},h(t=>t.value.avgFloat,[o]),3,null),e("p",null,{class:"text-xs text-muted mt-1"},C(o.value.avgFloat),1,null)],1,null),e("div",null,{class:"rounded-xl border border-white/5 bg-muted p-4 text-center"},[e("p",null,{class:"text-xs text-muted mb-1"},"Output Rarity",3,null),e("p",{style:{color:x[o.value.outputRarity]||"#fff"}},{class:"font-title text-sm font-bold mt-1"},h(t=>t.value.outputRarity,[o]),3,null)],1,null),e("div",null,{class:"rounded-xl border border-white/5 bg-muted p-4 text-center"},[e("p",null,{class:"text-xs text-muted mb-1"},"Input Cost",3,null),e("p",null,{class:"font-title text-xl font-bold text-highlighted"},y(o.value.totalInputCost),1,null)],1,null),e("div",null,{class:"rounded-xl border border-white/5 bg-muted p-4 text-center"},[e("p",null,{class:"text-xs text-muted mb-1"},"Expected Value",3,null),e("p",null,{class:h(t=>["font-title text-xl font-bold",t.value.expectedValue>=t.value.totalInputCost?"text-success":"text-red-400"],[o])},y(o.value.expectedValue),1,null)],1,null)],1,null),Object.keys(o.value.collectionWeights).length>1&&e("div",null,{class:"rounded-xl border border-white/5 bg-muted p-4 space-y-2"},[e("p",null,{class:"text-sm font-semibold text-highlighted mb-3"},"Collection Weights",3,null),Object.entries(o.value.collectionWeights).map(([t,m])=>e("div",null,{class:"flex items-center gap-3 text-sm"},[e("span",null,{class:"text-muted truncate flex-1"},t,1,null),e("div",null,{class:"w-32 h-1.5 rounded-full bg-white/[0.08] overflow-hidden"},e("div",{style:{width:`${m}%`}},{class:"h-full bg-primary rounded-full"},null,3,null),1,null),e("span",null,{class:"text-highlighted w-10 text-right"},[m,"%"],1,null)],1,t))],1,"5B_12"),e("div",null,null,[e("h3",null,{class:"text-lg font-semibold text-highlighted mb-4"},["Possible Outcomes (",h(t=>t.value.outcomes.length,[o]),")"],3,null),e("div",null,{class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},o.value.outcomes.map(t=>e("div",{style:{borderLeftColor:t.rarityColor||void 0,borderLeftWidth:"3px"}},{class:"rounded-xl border border-white/[0.06] bg-muted p-4 space-y-2"},[e("p",null,{class:"text-sm font-semibold text-highlighted leading-snug"},f(t,"name"),1,null),e("p",null,{class:"text-xs text-muted"},f(t,"collection"),1,null),e("div",null,{class:"flex items-center justify-between text-xs mt-2"},[e("span",null,{class:"text-muted"},"Probability",3,null),e("span",null,{class:"text-highlighted font-medium"},[f(t,"probability"),"%"],1,null)],1,null),e("div",null,{class:"w-full h-1 rounded-full bg-white/[0.08]"},e("div",{style:{width:`${Math.min(t.probability,100)}%`}},{class:"h-full rounded-full bg-primary"},null,3,null),1,null),e("div",null,{class:"flex items-center justify-between text-xs"},[e("span",null,{class:"text-muted"},"Output Float",3,null),e("span",null,{class:"text-highlighted"},[f(t,"outputFloat")," (",C(t.outputFloat),")"],1,null)],1,null),e("div",null,{class:"flex items-center justify-between text-xs"},[e("span",null,{class:"text-muted"},"Market Price",3,null),e("span",null,{class:"text-highlighted font-medium"},y(t.price),1,null)],1,null)],1,t.marketHashName)),1,null)],1,null),e("div",null,{class:"flex items-start gap-2 text-xs text-muted rounded-lg border border-white/[0.06] bg-white/[0.02] p-3"},[v(Z,{class:"h-4 w-4 shrink-0 mt-0.5",[r]:{class:r}},3,"5B_13"),e("span",null,null,"Expected value is theoretical — individual results vary significantly. Prices sourced from igitems market data and may not reflect current Steam Market rates.",3,null)],1,null)],1,"5B_14"),e("div",null,{class:"mt-12 space-y-3"},[e("h2",null,{class:"text-xl font-bold text-highlighted mb-4"},"FAQ",3,null),B.map((t,m)=>e("div",null,{class:"rounded-xl border border-white/[0.06] bg-muted p-4"},[e("p",null,{class:"text-sm font-semibold text-highlighted mb-1"},f(t,"label"),1,null),e("p",null,{class:"text-sm text-muted"}
1,f(t,"description"),1,null)],1,m))],1,null),i?.secondaryDescription&&v(Y,{get description(){return i.secondaryDescription},[r]:{description:N(i,"secondaryDescription")}},3,"5B_15")],1,null),u?.value&&e("div",null,{class:"container mt-16"},v(K,{gameType:u,get itemCount(){return l.value.hubLinkCount??0},[r]:{itemCount:h(t=>t.value.hubLinkCount??0,[l])}},3,"5B_16"),1,"5B_17"),v(J,{gameName:"CS2",browseHref:"/cs",browseLabel:"Browse CS2",[r]:{gameName:r,browseHref:r,browseLabel:r}},3,"5B_18")],1,"5B_19")},ce=Object.freeze(Object.defineProperty({__proto__:null,s_n0XajaZDtlI:ie},Symbol.toStringTag,{value:"Module"})),de=l=>{const[n,s]=_();return s(n,l.target.value)},_e=Object.freeze(Object.defineProperty({__proto__:null,s_Ohfn7Nn0j2w:de},Symbol.toStringTag,{value:"Module"})),pe=()=>{const[l,n,s]=_();n.results.length>0&&(s.value=s.value.map((o,u)=>u===l?{...o,open:!0}:o))},me=Object.freeze(Object.defineProperty({__proto__:null,s_hSYWrksUlXU:pe},Symbol.toStringTag,{value:"Module"})),ve=l=>{const[n]=_();n.value=n.value.map((s,o)=>o===l?{...s,open:!1,results:[]}:s)},fe=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_7tmBYTquy44:ve},Symbol.toStringTag,{value:"Module"})),he=()=>{const[l,n]=_();return l(n)},ge=Object.freeze(Object.defineProperty({__proto__:null,s_zm009mwoXp8:he},Symbol.toStringTag,{value:"Module"})),be=l=>{const[n,s]=_();s.value=s.value.map((o,u)=>u===l?O():o),n.value=null},xe=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_sAUNuf0E9rI:be},Symbol.toStringTag,{value:"Module"})),ye=()=>{const[l]=_();return l.value.filter(n=>n.skin&&n.float).length},Se=Object.freeze(Object.defineProperty({__proto__:null,s_A52VOt7GnrU:ye},Symbol.toStringTag,{value:"Module"})),we=()=>{const[l,n,s]=_();return n(l,s)},Ce=Object.freeze(Object.defineProperty({__proto__:null,s_AG2r0c040L8:we},Symbol.toStringTag,{value:"Module"})),ke=async(l,n)=>{const[s,o,u]=_();if(o.value=o.value.map((a,p)=>p===l?{...a,search:n,open:!0}:a),n.length<2){o.value=o.value.map((a,p)=>p===l?{...a,results:[]}:a);return}const i=s.value??void 0;try{const a=await A.searchSkins(n,i);o.value=o.value.map((p,S)=>S===l?{...p,results:a??[]}:p)}catch(a){console.error("Skin search failed:",a),u.toast({title:"Skin search unavailable — backend not yet deployed",variant:"destructive"})}},Oe=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_bO60N0v7Pco:ke},Symbol.toStringTag,{value:"Module"})),Te=(l,n)=>{const[s,o]=_(),u=((n.min_float+n.max_float)/2).toFixed(5);o.value=o.value.map((i,a)=>a===l?{...i,skin:n,float:u,search:n.name,results:[],open:!1}:i),s.value=null},Pe=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_ZFN909JtHMs:Te},Symbol.toStringTag,{value:"Module"})),je=(l,n)=>{const[s,o]=_();o.value=o.value.map((u,i)=>i===l?{...u,float:n}:u),s.value=null},Ae=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_aA49gXwf9dI:je},Symbol.toStringTag,{value:"Module"})),Ie=async()=>{const[l,n,s,o,u]=_();if(l.value!==10){u.toast({title:"Fill all 10 skin slots before calculating",variant:"destructive"});return}n.value=!0,s.value=null;try{const i=o.value.map(p=>({marketHashName:p.skin.marketHashName,float:parseFloat(p.float)})),a=await A.calculate("cs2-tradeup",{skins:i});s.value=a,setTimeout(()=>{document.getElementById("tradeup-results")?.scrollIntoView({behavior:"smooth",block:"start"})},100)}catch(i){u.toast({title:q(i),variant:"destructive"})}finally{n.value=!1}},Ee=Object.freeze(Object.defineProperty({__proto__:null,_hW:b,s_t6PyKDzeW9M:Ie},Symbol.toStringTag,{value:"Module"})),Le=l=>{const[n,s]=_();return n(s,l.target.value)},Re=Object.freeze(Object.defineProperty({__proto__:null,s_aNWSuJSc3eo:Le},Symbol.toStringTag,{value:"Module"}));export{b as _hW,Ue as i,se as s_5u4jcALj0EQ,ve as s_7tmBYTquy44,ye as s_A52VOt7GnrU,we as s_AG2r0c040L8,de as s_Ohfn7Nn0j2w,ne as s_OvRRYXFvWSA,Te as s_ZFN909JtHMs,je as s_aA49gXwf9dI,Le as s_aNWSuJSc3eo,ke as s_bO60N0v7Pco,pe as s_hSYWrksUlXU,ie as s_n0XajaZDtlI,be as s_sAUNuf0E9rI,Ie as s_t6PyKDzeW9M,te as s_x0eK07gAXRU,he as s_zm009mwoXp8};

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.