PageSourceSearch

https://trackly.gg/_nuxt/4HddwZqx.js

js trackly.gg collected 2026-09-25 15:05:24 UTC 7,645 bytes, 1 lines download raw bytes

1import{Bt as e,Ln as t,kr as n,li as r,pt as i}from"./Drwmof8L.js";import{n as a}from"./AXXVI0vt.js";import{n as o}from"./CiKLECuj.js";import{t as s}from"./YKjgeWBU.js";import{t as c}from"./DWPrLpgZ.js";import{t as l}from"./5JpO9VT7.js";import{t as u}from"./BsMPiHjd.js";import{t as d}from"./CkMjRnCx.js";import{t as f}from"./Dse3xOI2.js";import{t as p}from"./CTWypuBT2.js";import{H as m}from"./D2VNzsUK.js";import{t as h}from"./DiveMiQV.js";var g=class extends Error{code;constructor(e,t){super(t),this.name=`CartApiError`,this.code=e}},_=/own (listing|trade offer|item)|cannot add your own|can't add your own|cannot buy your own|You cannot buy your own|сво[ейй]|свой (листинг|предмет)/i;function v(e){if(typeof e!=`object`||!e)return;let t=e;if(t.data!=null)return t.data;if(t._data!=null)return t._data;let n=t.response;if(n?._data!=null)return n._data}function y(e){if(typeof e==`string`)return e.trim();if(typeof e!=`object`||!e)return``;let t=e;return typeof t.message==`string`?t.message:Array.isArray(t.message)?t.message.filter(e=>typeof e==`string`).join(` `).trim():typeof t.error==`string`?t.error:``}function b(e){let t=y(v(e));if(t)return t;if(typeof e==`object`&&e&&typeof e.message==`string`){let t=e.message;if(!t.startsWith(`[POST]`)&&!t.startsWith(`[GET]`))return t}return``}function x(e){let t=y(e);return t?_.test(t):!1}function S(e){let t=Number(p(e)??0),n=v(e),r=b(e),i=`${r} ${JSON.stringify(n??``)}`;return _.test(i)||t===400&&/own/i.test(i)||t===400?new g(`OWN_LISTING`,r):new g(`UNKNOWN`,r)}function C(e){return e instanceof g?e.code===`OWN_LISTING`:S(e).code===`OWN_LISTING`}function w(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.listingId==`string`?t.listing===null||typeof t.listing==`object`&&t.listing!==null:!1}function T(){let{$fetchInstance:t}=e();async function n(){return t(`/api/v1/cart`)}async function r(e){let n=e.skinId;try{let r=await t(`/api/v1/cart`,{method:`POST`,body:e});if(w(r))return l.addToCart(n??0,r.card?.name,r.listing?.price),r;let i=E(r);throw x(r),new g(`OWN_LISTING`,i)}catch(e){throw e instanceof g?e:S(e)}}async function i(e){return t(`/api/v1/cart/${typeof e==`string`?encodeURIComponent(e):e}`,{method:`DELETE`})}async function a(){return t(`/api/v1/cart`,{method:`DELETE`})}return{list:n,add:r,remove:i,clear:a}}function E(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.message==`string`?t.message:Array.isArray(t.message)?t.message.filter(e=>typeof e==`string`).join(` `):``}function D(e){let[t,n]=e.trim().split(` | `);return{weapon:t??``,skin:n??``}}function O(e){let t=e.card,{weapon:n,skin:r}=D(t.name??``),i=e.listing==null;return{listingId:e.listingId,listingKind:e.listingKind,skinId:e.skinId,name:t.name??``,weapon:n,skin:r,imageUrl:t.imageUrl?h(t.imageUrl):null,condition:t.condition??null,rarity:t.rarity??null,floatValue:t.floatValue??null,pattern:t.pattern??null,stickers:t.stickers??[],keychains:t.keychains??[],price:e.listing?.price??t.price??0,quantity:1,unavailable:i,weaponType:t.weaponType??null,itemType:t.type??null,catalogKind:t.catalog?.kind??null}}function k(e,t){let n=e.listingKind===`PLATFORM`,r=e.listingId??(n?``:`t:${t}`),{weapon:i,skin:a}=D(e.name??``);return{listingId:r,listingKind:n?`PLATFORM`:`USER`,skinId:n?null:t,name:e.name??``,weapon:i,skin:a,imageUrl:e.imageUrl?h(e.imageUrl):null,condition:e.condition??null,rarity:e.rarity??null,floatValue:e.floatValue??null,pattern:e.pattern??null,stickers:e.stickers??[],keychains:e.keychains??[],price:e.price??0,quantity:1,unavailable:!1,weaponType:e.weaponType??null,itemType:e.type??null,catalogKind:e.catalog?.kind??null}}function A(e){return C(e)}function j(){let e=s(`cart-items`,()=>[]),i=s(`cart-items-hydrated`,()=>!1),o=s(`cart-items-hydrating`,()=>null),{user:d}=c(),{t:f}=a(),{addDangerMessage:p}=u(),h=T(),g=t(()=>e.value.filter(e=>!e.unavailable)),_=t(()=>g.value.reduce((e,t)=>e+(t.quantity||0),0)),v=t(()=>Math.round(g.value.reduce((e,t)=>e+(t.price||0)*(t.quantity||1),0)*100)/100);function y(){p(f(`cart.cannotAddOwnListing`))}async function b(){if(i.value)return;if(o.value){await o.value;return}if(!d.value){e.value=[],i.value=!0;return}let t=(async()=>{try{let t=await h.list();e.value=t.items.map(O)}catch{e.value=[]}finally{i.value=!0,o.value=null}})();o.value=t,await t}async function x(t){if(!d.value)return;if(t.listingKind===`PLATFORM`){let n=t.listingId;if(!n||e.value.some(e=>e.listingId===n))return;let r=k(t,0);e.value=[r,...e.value];try{let t=O(await h.add({listingId:n}));e.value=e.value.map(e=>e.listingId===n?t:e)}catch(t){throw e.value=e.value.filter(e=>e.listingId!==n),S(t)}return}
1let n=t.id,r=typeof n==`number`?n:Number(n);if(!Number.isFinite(r))return;let i=t.listingId??`t:${r}`;if(e.value.some(e=>e.listingId===i))return;if(m(t,d.value.id)){y();return}let a=k(t,r);e.value=[a,...e.value];try{let t=O(await h.add({skinId:r}));e.value=e.value.map(e=>e.listingId===i?t:e)}catch(t){if(e.value=e.value.filter(e=>e.listingId!==i),A(t)){y();return}throw S(t)}}async function C(t,n={}){if(!d.value)return;let r=e.value,i=r.find(e=>e.listingId===t);if(i){e.value=r.filter(e=>e.listingId!==t);try{await h.remove(t),n.track!==!1&&l.removeFromCart([{id:i.skinId??0,name:i.name,price:i.price}])}catch(t){throw e.value=r,t}}}async function w(){if(!d.value||e.value.length===0)return;let t=e.value;e.value=[];try{await h.clear(),l.removeFromCart(t.map(e=>({id:e.skinId??0,name:e.name,price:e.price})))}catch(n){throw e.value=t,n}}function E(t){e.value=e.value.map(e=>e.listingId===t?{...e,unavailable:!0}:e)}return n(()=>{b()}),r(()=>d.value?.id??null,(t,n)=>{t!==n&&(i.value=!1,e.value=[],b())}),{items:e,availableItems:g,hydrated:i,count:_,total:v,addFromSkin:x,remove:C,clear:w,hydrate:b,markUnavailable:E}}function M(){let{t:e}=a(),t=o(),{addSuccessMessage:n}=u();async function r(){n(e(`listing.partnerPurchaseSuccess`)),await i(t(d.TRADE_CENTER_TRADES))}return{goToTradesAfterPurchase:r}}function N(e){let t=e?.data;return typeof t==`string`?t:typeof t==`object`&&t&&`message`in t?String(t.message??``):String(e?.message??``)}function P(e){return Number(e?.statusCode??0)===403&&N(e)===`login_required`}function F(){let{openContinueWithSteamModal:e}=f();function t(){e()}function n(e){return P(e)?(t(),!0):!1}return{promptLoginRequired:t,handleLoginRequiredError:n,isLoginRequiredError:P}}function I(e){return e?.trim()||null}function L(e){return`id:${e}`}function R(){let e=s(`catalog:gone-listing-keys`,()=>new Set);function t(t){let n=new Set(e.value),r=I(t.listingId);r&&n.add(r),t.skinId!=null&&Number.isFinite(t.skinId)&&t.skinId>0&&n.add(L(t.skinId)),n.size!==e.value.size&&(e.value=n)}function n(t){let n=I(t.listingId);return n&&e.value.has(n)?!0:e.value.has(L(t.id))}return{goneKeys:e,markGone:t,isGone:n}}var z=/no longer available|not available for purchase|больше недоступен|недоступен для покупки|уже\s+(?:кто-то\s+)?купил|already (?:been )?bought|already sold|someone already bought/i;function B(e){return z.test(e?.trim()??``)}function V(e){let t=e;return!t||typeof t!=`object`?!1:t.code===`LISTING_SOLD`?!0:t.code!==`CONFLICT`&&t.code!==`NOT_FOUND`?!1:B(t.message)}function H(e,t){if(V(e))return t(`listing.alreadySoldMessage`);let n=e,r=n?.message?.trim();if(r)return r;switch(n?.code){case`OWN_OFFER`:return t(`listing.cannotBuyOwn`);case`CONFLICT`:return t(`listing.offerConflict`);case`NOT_FOUND`:return t(`listing.offerNotFound`);case`UNAVAILABLE`:return t(`listing.externalSupplyUnavailable`);case`BUY_RESPONSE_INVALID`:return t(`listing.buyResponseInvalid`);default:return null}}export{P as a,F as i,V as n,M as o,R as r,j as s,H as t};

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.