/*! This file includes third-party software, governed by the licenses described here: https://store.steampowered.com/public/javascript/applications/interactive_recommender/main.licenses.txt */ /**** (c) Valve Corporation. Use is governed by the terms of the Steam Subscriber Agreement http://store.steampowered.com/subscriber_agreement/. ****/ !function(l){function e(e){for(var t,a,r=e[0],n=e[1],o=e[2],i=0,c=[];i=2*h.PerYear?B(a+"XYears",Math.floor(e/h.PerYear)):e>=h.PerYear?(e-=h.PerYear)>=2*h.PerMonth?B(a+"1YearXMonths",Math.floor(e/h.PerMonth)):B(a+"1Year"):e>=2*h.PerMonth?B(a+"XMonths",Math.floor(e/h.PerMonth)):e>=2*h.PerWeek?B(a+"XWeeks",Math.floor(e/h.PerWeek)):e>=h.PerWeek?B(a+"1Week",Math.floor(e/h.PerWeek)):e>=2*h.PerDay?B(a+"XDays",Math.floor(e/h.PerDay)):e>=h.PerDay?(e-=h.PerDay)>=2*h.PerHour?B(a+"1DayXHours",Math.floor(e/h.PerHour)):B(a+"1Day"):e>=2*h.PerHour?B(a+"XHours",Math.floor(e/h.PerHour)):e>=h.PerHour?(e-=h.PerHour)>=2*h.PerMinute?B(a+"1HourXMinutes",Math.floor(e/h.PerMinute)):B(a+"1Hour"):e>=2*h.PerMinute?B(a+"XMinutes",Math.floor(e/h.PerMinute)):e>=h.PerMinute?B(a+"1Minute"):B(a+"LessThanAMinute")}(o)),A.a.createElement("div",{className:w.a.PlayedGame},A.a.createElement("img",{className:w.a.Logo,src:n}),A.a.createElement("div",{className:w.a.PlaytimeInfo},A.a.createElement("div",{className:w.a.HoursPlayed},B("#PlaytimeList_Hours",a)),A.a.createElement("div",{className:w.a.LastPlayed},i)))},X=function(a){function e(e){var t=a.call(this,e)||this;return t.state={},t}return i.d(e,a),e.prototype.render=function(){var a=[];return Object.keys(d).map(function(e){var t=d[e];a.push(A.a.createElement(Q,{key:"PlayedGame_"+t.a,appID:t.a,hours:t.p,lastPlayed:t.l}))}),A.a.createElement("div",{className:w.a.PlaytimeList},A.a.createElement("div",{className:w.a.Header},B("#PlaytimeList_Header")),A.a.createElement(Y,{accountID:this.props.accountID}),A.a.createElement("div",{className:w.a.List},a))},e}(A.a.Component),q=function(e){var t=e.titleLabel,a=e.minLabel,r=e.maxLabel,n=e.minValue,o=e.maxValue,i=e.value,c=e.onChange,l=e.sliderLabels,s=l?Math.round((l.length-1)*((i-n)/(o-n))):void 0,u=l?l[s]:"";return A.a.createElement("div",{className:w.a.OptionSlider},A.a.createElement("div",{className:w.a.Title},t),A.a.createElement("div",{className:w.a.Labels},A.a.createElement("div",{className:w.a.Min},a),A.a.createElement("div",{className:w.a.Max},r)),A.a.createElement("input",{type:"range",min:n,max:o,step:(o-n)/100,value:i,onChange:c}),A.a.createElement("div",{className:w.a.OptionalLabel},u))},z=function(e){var t=e.titleLabel,a=e.checked,r=e.onChange;return A.a.createElement("label",{className:w.a.OptionCheckbox},A.a.createElement("input",{type:"checkbox",className:w.a.Checkbox,checked:a,onChange:r}),t)},J=function(e){for(var t=e.title,a=e.options,r=e.value,n=e.onChange,o=[],i=0,c=a;i=this.nExpirationTime&&!e&&(this.eState=M.Pending,a().then(function(e){if(n.eState==M.Rerequest)return n.expireData(),void n.getData(t,a,r);n.eState=e?(n.data=r?r(e):e,n.nExpirationTime=o+t,M.Valid):M.Failed})),this.data},e.prototype.clearData=function(){var e=Date.now()/1e3;this.eState=M.Unrequested,this.data=null,this.nExpirationTime=e},e.prototype.expireData=function(){var e=Date.now()/1e3;this.nExpirationTime=e},e.prototype.delayNewData=function(e){var t=Date.now()/1e3;this.nExpirationTime=t+e},e.prototype.rerequestDataIfPending=function(){this.eState==M.Pending&&(this.eState=M.Rerequest)},i.c([te.v],e.prototype,"data",void 0),e}();(ne=re||(re={}))[ne.ClickThrough=1]="ClickThrough",ne[ne.AddToWishlist=2]="AddToWishlist",ne[ne.AddToCart=3]="AddToCart";var ie=function(){function e(){var e=this;this.m_mapAppDetailsCache=new Map,this.m_fPopularityValue=window.history.state?window.history.state.popularity:.25,this.m_fRecencyValue=window.history.state?window.history.state.recency:0,this.m_nTagFilterValue=window.history.state?window.history.state.tagfilter:0,this.m_nTagExcludeValue=window.history.state?window.history.state.tagexclude:0,this.m_bExcludeWishlisted=!!window.history.state&&window.history.state.excludewishlisted,this.m_fQueuedPopularityValue=this.m_fPopularityValue,this.m_fQueuedRecencyValue=this.m_fRecencyValue,this.m_bStateUpdated=!1,this.m_bShouldMute=!0,setInterval(function(){e.m_bStateUpdated&&(window.history.replaceState({popularity:e.m_fPopularityValue,recency:e.m_fRecencyValue,tagfilter:e.m_nTagFilterValue,tagexclude:e.m_nTagExcludeValue,excludewishlisted:e.m_bExcludeWishlisted},""),e.m_bStateUpdated=!1)},1e3),setInterval(function(){e.m_fPopularityValue==e.m_fQueuedPopularityValue&&e.m_fQueuedRecencyValue==e.m_fRecencyValue||(e.m_fPopularityValue=e.m_fQueuedPopularityValue,e.m_fRecencyValue=e.m_fQueuedRecencyValue,e.m_bStateUpdated=!0)},400)}return e.prototype.Init=function(){ae.render(s.createElement(ee,{app:this}),document.getElementById("recommender_root")),O.RESET_OPTIONS&&(this.m_fPopularityValue=1/(O.NUM_POPULARITY_STEPS-1),this.m_fRecencyValue=0,this.m_nTagFilterValue=0,this.m_nTagExcludeValue=0,this.m_bExcludeWishlisted=!1,this.m_bStateUpdated=!0)},e.prototype.getDetails=function(t){var e=this;return this.m_mapAppDetailsCache.has(t)||this.m_mapAppDetailsCache.set(t,new oe),this.m_mapAppDetailsCache.get(t).getData(60,function(){return i.b(e,void 0,void 0,function(){return i.e(this,function(e){switch(e.label){case 0:return[4,c.a.get(O.BASE_URL+"recommender/"+O.STEAM_ID+"/details?appid="+t+"&sessionid="+O.SESSION_ID)];case 1:return[2,e.sent()]}})})},function(e){return e.data})},e.prototype.onPopularityChanged=function(e){this.m_fQueuedPopularityValue=Number(e.target.value)},e.prototype.onRecencyChanged=function(e){this.m_fQueuedRecencyValue=Number(e.target.value)},e.prototype.onTagFilterChanged=function(e){this.m_nTagFilterValue=Number(e.target.value),this.m_bStateUpdated=!0},e.prototype.onTagExcludeChanged=function(e){this.m_nTagExcludeValue=Number(e.target.value),this.m_bStateUpdated=!0},e.prototype.onExcludeWishlistedToggled=function(e){this.m_bExcludeWishlisted=!this.m_bExcludeWishlisted,this.m_bStateUpdated=!0},e.prototype.onAppClicked=function(a,r){return i.b(this,void 0,void 0,function(){var t;return i.e(this,function(e){switch(e.label){case 0:return t={account_id:O.ACCOUNT_ID,session_id:O.SESSION_ID,app_id:a,app_rank:r,action:re.ClickThrough,algorithm:1,setting_1:100*this.m_fPopularityValue,setting_2:100*this.m_fRecencyValue,setting_3:this.m_nTagFilterValue,setting_4:this.m_nTagExcludeValue},[4,c.a.post(O.BASE_URL+"recommender/"+O.STEAM_ID+"/stats",t)];case 1:return e.sent(),[2]}})})},e.prototype.onAddToWishlist=function(n,o){return i.b(this,void 0,void 0,function(){var t,a,r;return i.e(this,function(e){switch(e.label){case 0:return D[n].w=!0,t={sessionid:O.SESSION_ID,appid:n},[4,c.a.post(O.BASE_URL+"recommender/"+O.STEAM_ID+"/wishlist",t)];case 1:return a=e.sent(),r={account_id:O.ACCOUNT_ID,session_id:O.SESSION_ID,app_id:n,app_rank:o,action:re.AddToWishlist,algorithm:1,setting_1:100*this.m_fPopularityValue,setting_2:100*this.m_fRecencyValue,setting_3:this.m_nTagFilterValue,setting_4:this.m_nTagExcludeValue},[4,c.a.post(O.BASE_URL+"recommender/"+O.STEAM_ID+"/stats",r)];case 2:return e.sent(),[2,a]}})})},e.prototype.onGoToWishlist=function(){window.location.href=O.COMMUNITY_BASE_URL+"profiles/"+O.STEAM_ID+"/wishlist"},e.prototype.onAddToCart=function(r,n){return i.b(this,void 0,void 0,function(){var t,a;return i.e(this,function(e){switch(e.label){case 0:return t={sessionid:O.SESSION_ID,appid:r},[4,c.a.post(O.BASE_URL+"recommender/"+O.STEAM_ID+"/cart",t)];case 1:return e.sent(),a={account_id:O.ACCOUNT_ID,session_id:O.SESSION_ID,app_id:r,app_rank:n,action:re.AddToCart,algorithm:1,setting_1:100*this.m_fPopularityValue,setting_2:100*this.m_fRecencyValue,setting_3:this.m_nTagFilterValue,setting_4:this.m_nTagExcludeValue},[4,c.a.post(O.BASE_URL+"recommender/"+O.STEAM_ID+"/stats",a)];case 2:return e.sent(),window.location.href=O.STORE_BASE_URL+"cart",[2]}})})},e.prototype.onMuteClicked=function(){this.m_bShouldMute=!0},e.prototype.onUnMuteClicked=function(){this.m_bShouldMute=!1},e.prototype.shouldMute=function(){return this.m_bShouldMute},i.c([te.v],e.prototype,"m_fPopularityValue",void 0),i.c([te.v],e.prototype,"m_fRecencyValue",void 0),i.c([te.v],e.prototype,"m_nTagFilterValue",void 0),i.c([te.v],e.prototype,"m_nTagExcludeValue",void 0),i.c([te.v],e.prototype,"m_fQueuedPopularityValue",void 0),i.c([te.v],e.prototype,"m_fQueuedRecencyValue",void 0),i.c([te.v],e.prototype,"m_bExcludeWishlisted",void 0),i.c([te.v],e.prototype,"m_bShouldMute",void 0),i.c([l],e.prototype,"onPopularityChanged",null),i.c([l],e.prototype,"onRecencyChanged",null),i.c([l],e.prototype,"onTagFilterChanged",null),i.c([l],e.prototype,"onTagExcludeChanged",null),i.c([l],e.prototype,"onExcludeWishlistedToggled",null),i.c([l],e.prototype,"onAppClicked",null),i.c([l],e.prototype,"onAddToWishlist",null),i.c([l],e.prototype,"onGoToWishlist",null),i.c([l],e.prototype,"onAddToCart",null),i.c([l],e.prototype,"onMuteClicked",null),i.c([l],e.prototype,"onUnMuteClicked",null),i.c([l],e.prototype,"shouldMute",null),e}();a.d(t,"g_App",function(){return ue});var ce,le,se,ue=new ie;document.addEventListener("DOMContentLoaded",function(){p(),Object.assign(P,window.gRecommendations),Object.assign(D,window.gAppInfo),Object.assign(d,window.gInputApps),Object.assign(U,window.gTags),ue.Init()}),window.LocalizationReady=function(e,t,a){if("english"!==t)"main"==e?ce=a:"shared"==e&&(le=a);else if("shared"==e)se=a;else{var r=void 0,n=null,o=void 0,i=null;void 0!==ce?(r=ce,n=a):r=a,void 0!==le?(o=le,i=se):o=se,N.InitFromObjects(r,n,o,i),se=le=ce=void 0}}}});