Module 993408

6,590 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{$W:()=>Y,$b:()=>J,Br:()=>D,Bs:()=>ec,CE:()=>eu,D0:()=>S,Dm:()=>B,G0:()=>O,HF:()=>et,MG:()=>X,P_:()=>k,R8:()=>y,V6:()=>eo,WD:()=>w,WU:()=>ee,Wj:()=>z,XS:()=>x,Zu:()=>el,aT:()=>en,aw:()=>ei,b_:()=>C,bf:()=>ed,c7:()=>es,f6:()=>H,fT:()=>U,gA:()=>L,hU:()=>Q,l8:()=>v,oj:()=>er,pA:()=>ea,ps:()=>W,rr:()=>P,sz:()=>Z,tt:()=>G,wo:()=>q,x9:()=>j,xM:()=>R,yt:()=>M,zd:()=>K}),n(321073);var i,r=n(735438),a=n(575593),s=n(441574),l=n(968671),o=n(349871),d=n(723702),c=n(428262),u=n(580630),_=n(898461),E=n(837015),A=n(203632),h=n(892118),I=n(719986),f=n(623373),p=n(758836),T=n(652215),m=n(818348),g=n(375708),S=((i={}).NITRO="nitro",i.THIRDPARTY="thirdparty",i);let N={nitro:"nitro",thirdparty:"xbox"};function C(e){return null!=e?N[e]:null}function R(e){if(!c.Ay.canUseShopDiscounts(e))return null;if(c.Ay.canUseCollectibles(e))return"nitro";let t=(0,o.kQ)(e?.perks,s.bb.SHOP_DISCOUNTS);return t?.includes(s.g$.SOURCE_NITRO)?"nitro":(0,l.f0)("getShopDiscountSource")&&t?.includes(s.g$.SOURCE_THIRDPARTY_CROISSANT)?"thirdparty":null}function O(e){return e?.premiumType!=null}function L(e){return e?.purchaseType===T.zF_.PREMIUM_PURCHASE}function D(e,t,n){return M(e,n?t?T.lid.MOBILE_PREMIUM_TIER_2:T.lid.MOBILE:t?T.lid.PREMIUM_TIER_2:T.lid.DEFAULT)}function y(e,t,n){let i=D(e,t,n);return null==i?"":(0,u.$g)(i?.amount,i?.currency)}function v(e){return(0,d.isAndroid)()||(0,d.isIOS)()?e?T.lid.MOBILE_PREMIUM_TIER_2:T.lid.MOBILE:e?T.lid.PREMIUM_TIER_2:T.lid.DEFAULT}function b(e){let t=e.bundledProducts;if(null==t)return 0;let n=v(!1);return t.reduce((e,t)=>{let i=M(t,n);return e+(i?.amount??0)},0)}function M(e,t){let n=e.prices[t]??null;return null!=n?n.countryPrices?.prices?.[0]:null}let P={original:-1,discountPercentage:-1};function U(e,t){if(null==e)return P;let n=b(e);if(n<=0)return P;let i=M(e,v(t));return null==i?P:{original:n,discountPercentage:Math.round((n-i.amount)/n*100)}}function w(e,t){let{hasShopDiscount:n,discount:i}=t,r=M(e,T.lid.DEFAULT);if(null==r)return null;if(r.amount<=0)return{defaultPrice:r,showDefaultPriceOnly:!0};let a=M(e,T.lid.PREMIUM_TIER_2),s=ei(e)&&n?{...r,amount:i.original}:r,l=n&&null!=a,o=l?a:s;return{defaultPrice:r,originalPrice:s,premiumPrice:a,finalPrice:o,showDiscountPrice:l,finalPriceIsDifferent:o.amount!==s.amount,showDefaultPriceOnly:!1}}function G(e){return M(e,T.lid.DEFAULT)?.amount===0}function x(e){return e.reduce((e,t)=>null!=t&&t.type===a.R.VARIANTS_GROUP&&null!=t.variants?(0,r.concat)(e,t.variants.map(e=>({...e,variantGroupStoreListingId:t.storeListingId,eligibleOffers:t.eligibleOffers}))):(e.push(t),e),[])}function k(e,t){let n=(0,r.flatMap)([...e.values()],"products");return(0,r.uniqBy)(t?x(n):n,"storeListingId")}function F(e,t){if(t===a.R.AVATAR_DECORATION){let t=(0,r.flatMap)([...e.values()],"items").filter(_.T);return(0,r.uniqBy)(t,"skuId")}if(t===a.R.NAMEPLATE){let t=(0,r.flatMap)([...e.values()],"items").filter(E.F);return(0,r.uniqBy)(t,"skuId")}if(t===a.R.PROFILE_EFFECT){let t=(0,r.flatMap)([...e.values()],"items").filter(A.C3);return(0,r.uniqBy)(t,"skuId")}if(t===a.R.PROFILE_FRAME){let t=(0,r.flatMap)([...e.values()],"items").filter(h.s);return(0,r.uniqBy)(t,"skuId")}return[]}function V(e,t){let n=k(e,!0);if(t===a.R.AVATAR_DECORATION){let e=(0,r.flatMap)(n,"items").filter(_.T);return(0,r.uniqBy)(e,"skuId")}if(t===a.R.NAMEPLATE){let e=(0,r.flatMap)(n,"items").filter(E.F);return(0,r.uniqBy)(e,"skuId")}if(t===a.R.PROFILE_EFFECT){let e=(0,r.flatMap)(n,"items").filter(A.C3);return(0,r.uniqBy)(e,"skuId")}if(t===a.R.PROFILE_FRAME){let e=(0,r.flatMap)(n,"items").filter(h.s);return(0,r.uniqBy)(e,"skuId")}return[]}function B(e){switch(e){case a.R.AVATAR_DECORATION:return g.intl.string(g.t["7v0T9P"]);case a.R.PROFILE_EFFECT:return g.intl.string(g.t.wR5wOo);case a.R.NAMEPLATE:return g.intl.string(g.t.x5CoXR);case a.R.PROFILE_FRAME:return g.intl.string(g.t.GWrZOd);default:return null}}function H(e){return null!=e?I.M.fromServer(e):void 0}function j(e){return F(e,a.R.AVATAR_DECORATION)}function W(e,t){return(0,r.uniqBy)([...j(e),...V(t,a.R.AVATAR_DECORATION)],"skuId")}function Y(e){return F(e,a.R.NAMEPLATE)}function K(e,t){return(0,r.uniqBy)([...Y(e),...V(t,a.R.NAMEPLATE)],"skuId")}function $(e){return F(e,a.R.PROFILE_EFFECT)}function z(e){return V(e,a.R.PROFILE_EFFECT)}function q(e,t){return(0,r.uniqBy)([...$(e),...z(t)],"skuId")}function Z(e,t){let n=$(t),i=z(e).filter(e=>{let{skuId:t}=e;return!n.some(e=>e.skuId===t)});return{purchased:n,shopPreviews:i}}function X(e,t){return(0,r.uniqBy)([...F(e,a.R.PROFILE_FRAME),...V(t,a.R.PROFILE_FRAME)],"skuId")}function Q(e){return e.applicationId===T.FYj}let J=e=>3.8*e;function ee(e){let t=new Date,n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.floor((Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())-n)/864e5)}function et(e){return null!=e&&ee(e)<=p.x3}function en(e){let t=p.Tq[e];return null!=t&&new Date().getTime()<t}function ei(e){return e?.type===a.R.BUNDLE}function er(e){if(null!=e)return e.type===a.R.BUNDLE?a.R.BUNDLE:e.items?.[0]?.type}function ea(e){let{invoicePreview:t,selectedSkuId:n,skusById:i}=e,r=t?.invoiceItems?.[0]?.unitPrice,a=null!=r?{amount:r.amount,currency:r.currency}:void 0;if(null==a&&null!=n){let e=i[n];e?.price!=null&&(a={amount:e.price.amount,currency:e.price.currency})}return a}function es(e,t,n){if(ei(e))return b(e);let i=M(e,t?n?T.lid.MOBILE:T.lid.DEFAULT:n?T.lid.MOBILE_PREMIUM_TIER_2:T.lid.PREMIUM_TIER_2);return i?.amount}function el(e){let{product:t,isPartiallyOwnedBundle:n,isPurchased:i}=e;return!n&&!(p.Dp.ORB_PROFILE_BADGE===t?.skuId&&i)}function eo(e,t){switch(e){case a.R.AVATAR_DECORATION:return"avatar decoration";case a.R.PROFILE_EFFECT:return"profile effect";case a.R.NAMEPLATE:return"nameplate";case a.R.PROFILE_FRAME:return"profile frame";case a.R.BUNDLE:return"bundle";case a.R.EXTERNAL_SKU:if(t===p.Dp.FRACTIONAL_PREMIUM)return"3-day nitro credit";if(t===p.Dp.FRACTIONAL_PREMIUM_1_DAY)return"1-day nitro credit";if(t===p.Dp.ORB_PROFILE_BADGE)return"orb profile badge";return"unknown";case a.R.VARIANTS_GROUP:return"variants group";default:return"unknown"}}function ed(e,t,n){return e.sort((e,i)=>{let r=n?(0,f.CW)({product:e,hasShopDiscount:t}):D(e,t,!1),a=n?(0,f.CW)({product:i,hasShopDiscount:t}):D(i,t,!1);return(r?.amount??0)-(a?.amount??0)})}function ec(e,t){if(0===t.length||0===e.length)return e;let n=t.map(e=>e.discountId);return e.sort((e,t)=>{let i=e.eligibleOffers?.some(e=>n.includes(e))??!1;return(t.eligibleOffers?.some(e=>n.includes(e))??!1)-i})}function eu(e){return e.filter(e=>!e.isCategoryReward)}m.Yr.KZT,m.Yr.NGN,m.Yr.EGP}