(this["webpackJsonp6th-street"]=this["webpackJsonp6th-street"]||[]).push([[23],{1286:function(e,t,i){"use strict";(function(e){var o=i(621),r=(i(508),i(581)),n=i(0),l=i.n(n),s=i(12),d=(i(5),i(1)),a=i(7),c=i(1287),u=i(475),p=(i(1288),i(14)),v=i(75),g=i(24),h=i(46);i(470);var m=i(11).checkBEMProps;class b extends n.PureComponent{constructor(e){super(e),this.handleIntersect=(e,t)=>{const{impressionSent:i,isViewPromotionCalled:o}=this.state;i||o||e.forEach(e=>{e.isIntersecting&&this.widgetGetLoadEvent()})},this.getProducts=()=>{const{products:e,sliderLength:t}=this.props;let i=(null===e||void 0===e?void 0:e.length)>t?[...e.slice(0,t)]:[...e];return i.length>t&&(i.length=t),[...i]},this.handleScroll=e=>{const t=e.nativeEvent.target,i=[...this.cmpRef.current.childNodes].filter(e=>"ScrollWrapper"==e.id)[0];i&&(i.scrollLeft=t.scrollLeft)},this.renderScrollbar=()=>{let e=this.getProducts();const t=(this.itemRef&&this.itemRef.current&&this.itemRef.current.childRef.current.clientWidth)*e.length+7*e.length*2-690;return m(l.a,"div",{block:"VueProductSlider",elem:"SliderContainer",ref:this.scrollerRef,mods:{isArabic:Object(s.h)(),Hidden:this.scrollerRef.current&&this.scrollerRef.current.clientWidth>=t},onScroll:this.handleScroll},m(l.a,"div",{block:"Outer",style:{width:t},elem:"Inner"}))},this.itemRef=l.a.createRef(),this.cmpRef=l.a.createRef(),this.indexRef=l.a.createRef(0),this.scrollerRef=l.a.createRef(),this.state={customScrollWidth:null,isArabic:Object(s.h)(),impressionSent:!1,eventRegistered:!1,isViewPromotionCalled:!1,items:[]}}componentDidMount(){this.state.customScrollWidth<0&&this.renderScrollbar(),this.updateItemsState(),this.registerViewPortEvent()}getPageType(){const{urlRewrite:e,currentRouteName:t}=window;return"url-rewrite"===t?"undefined"===typeof e?"":e.notFound?"notfound":(e.type||"").toLowerCase():(t||"").toLowerCase()}updateItemsState(){const{products:e,widgetID:t,language:i="",product:{gender:o=""}}=this.props,r=sessionStorage.getItem("currentScreen")||"",n=t?"".concat(r,"-").concat(o?null===o||void 0===o?void 0:o.join("-").toLowerCase():"","-").concat(i,"-").concat(t):"",{items:l}=this.state;e.map(e=>{var t,i,o,r,s,d;let a="";(null===(t=e.price)||void 0===t?void 0:t.length)>0&&(a=null===e||void 0===e?void 0:e.price[0][Object.keys(null===e||void 0===e?void 0:e.price[0])[0]]["6s_special_price"]),l.push({item_id:null!==(i=null===e||void 0===e?void 0:e.sku)&&void 0!==i?i:"",item_name:null!==(o=null===e||void 0===e?void 0:e.name)&&void 0!==o?o:"",item_brand:null!==(r=null===e||void 0===e?void 0:e.brand_name)&&void 0!==r?r:"",item_list_name:n,item_category:null!==(s=null===e||void 0===e?void 0:e.category)&&void 0!==s?s:"",price:null!==(d=a)&&void 0!==d?d:""})})}widgetGetLoadEvent(){var e,t,i,o;const r=d.a.getItem(h.a),n=null===r||void 0===r||null===(e=r.gender)||void 0===e?void 0:e.toLowerCase(),{product:{brand_name:l,sku:s,gender:c},widgetID:p,language:v="",widget_position:g="on-page"}=this.props,m=c?[c]:[n],{product:b={},products:f}=this.props,{items:w}=this.state,_=this.getPageType()||"",S=p?"".concat(_,"-").concat(m?m.join("-").toLowerCase():"","-").concat(v,"-").concat(p):"",P={isFromVueProductSlider:!0,isSkipMOEEvent:!0,brand_name:null!==l&&void 0!==l?l:"",product_sku:null!==s&&void 0!==s?s:"",promotion_id:null!==S&&void 0!==S?S:"",promotion_name:null!==S&&void 0!==S?S:"",items:w,widget_position:null!==g&&void 0!==g?g:"on-page"},I={widget_name:null!==p&&void 0!==p?p:"",main_sku:null!==(t=null===b||void 0===b?void 0:b.sku)&&void 0!==t?t:0,main_brand_name:null!==(i=null===b||void 0===b?void 0:b.brand_name)&&void 0!==i?i:0,main_product_name:null!==(o=null===b||void 0===b?void 0:b.name)&&void 0!==o?o:0};a.hj.dispatch(u.b,[P]),Object(a.Ri)(a.Qf,{...I}),this.setState({isViewPromotionCalled:!0})}registerViewPortEvent(){const{index:e=0}=this.props;let t;const i=document.querySelector("#productSlider-".concat(e));t=new IntersectionObserver(this.handleIntersect,{root:null,rootMargin:"0px",threshold:.5}),t.observe(i),this.setState({eventRegistered:!0})}async handleContainerScroll(e,t){const{isArabic:i}=this.state,{pageType:o="home",sourceProdID:n=null,sourceCatgID:l=null}=this.props,s=t.nativeEvent.target;this.scrollerRef&&this.scrollerRef.current&&(this.scrollerRef.current.scrollLeft=i?Math.abs(s.scrollLeft):s.scrollLeft);let d=0;d=screen.width>1024?245:220;let a=Math.floor(Math.abs(s.scrollLeft)/d);if(this.indexRef.current!==a){var c;this.indexRef.current=a;null===(c=this.getProducts()[a])||void 0===c||c.link;r.a.getLocaleFromUrl()}}viewAllBtn(){var t,i,o,r,n,c;const{withViewAll:u=!0,widgetID:p="",products:b=[],product:f={},data_url:w,heading:_="",pageType:S="",sliderLength:P,gender:I,language:y="",widget_position:k="on-page"}=this.props;let O="/viewall/?q=".concat(null===p||void 0===p||null===(t=p.toLowerCase())||void 0===t?void 0:t.replace(/^(vue_)/,""));const j=w||{pathname:(null===f||void 0===f?void 0:f.sku)?O.concat("&product_id=".concat(f.sku)):O,state:{widgetIDOnViewAllBtn:p,product:f,pageType:S,widgetID:p}},R=d.a.getItem(h.a),D=null===R||void 0===R||null===(i=R.gender)||void 0===i?void 0:i.toLowerCase(),{product:{brand_name:C,sku:A}}=this.props,L=I?[I]:[D],{items:V}=this.state,T=this.getPageType()||"",W=p?"".concat(T,"-").concat(L?L.join("-").toLowerCase():"","-").concat(y,"-").concat(p):"",H={brand_name:null!==C&&void 0!==C?C:"",product_sku:null!==A&&void 0!==A?A:"",widget_name:null!==W&&void 0!==W?W:"",widget_position:null!==k&&void 0!==k?k:"on-page"};let E=0;if(f&&(null===f||void 0===f?void 0:f.price)){const e=Object.keys(null===f||void 0===f?void 0:f.price[0])[0];E=null===f||void 0===f?void 0:f.price[0][e]["6s_special_price"]}const M={widget_name:null!==p&&void 0!==p?p:0,main_sku:null!==(o=null===f||void 0===f?void 0:f.sku)&&void 0!==o?o:0,main_brand_name:null!==(r=null===f||void 0===f?void 0:f.brand_name)&&void 0!==r?r:0,main_product_name:null!==(n=null===f||void 0===f?void 0:f.name)&&void 0!==n?n:0,main_price:null!==(c=E)&&void 0!==c?c:0};return u&&(null===b||void 0===b?void 0:b.length)>=P?m(l.a,"div",{block:"VueProductSlider",elem:"ViewAllBtn",mods:{isArabic:Object(s.h)()}},m(l.a,v.default,{to:j,onClick:()=>{Object(g.z)(window.location.href),a.hj.dispatch(a.Hd,H),Object(a.Ri)(a.Rf,{...M}),localStorage.setItem("RecentViwedType",JSON.stringify({pageType:S,gender:I}))}},m(l.a,"span",null,e("View All")))):null}renderHeader(){const{isHome:t,products:i,heading:o,header:r}=this.props;return m(l.a,"div",{block:"VueProductSlider",elem:"HeaderContainer",mods:{isHome:t,isArabic:Object(s.h)()}},m(l.a,"div",{className:"productWidgetTitleRow"},m(l.a,"h2",{className:"productWidgetHeading",style:(null===r||void 0===r?void 0:r.title_color)?{color:r.title_color}:void 0},e(o)),(null===i||void 0===i?void 0:i.length)>0?this.viewAllBtn():null),((null===r||void 0===r?void 0:r.subtitle)||(null===r||void 0===r?void 0:r.button_label))&&m(l.a,"div",{className:"productWidgetMeta"},(null===r||void 0===r?void 0:r.subtitle)&&m(l.a,"p",{className:"productWidgetSubtitle",style:(null===r||void 0===r?void 0:r.subtitle_color)?{color:r.subtitle_color}:void 0},r.subtitle),(null===r||void 0===r?void 0:r.button_label)&&m(l.a,"a",{href:(null===r||void 0===r?void 0:r.button_link)||void 0,className:"productWidgetButton",style:(null===r||void 0===r?void 0:r.button_label_color)?{color:r.button_label_color}:void 0,title:null===r||void 0===r?void 0:r.button_label},r.button_label)))}renderSliderContainer(){const e=this.getProducts(),{isHome:t,renderMySignInPopup:i,index:r,setLastTapItemOnHome:n,closeCartPopup:d}=this.props,{widgetID:a="",pageType:u="",sourceProdID:p=null,sourceCatgID:v=null,widget_position:g="",heading:h="",product:b={},products:f=[]}=this.props;return m(l.a,o.default,{data:{rootClass:"ScrollWrapper",ref:this.cmpRef}},m(l.a,l.a.Fragment,null,m(l.a,"div",{block:"VueProductSlider",elem:"SliderContainer",id:"ScrollWrapper",ref:this.cmpRef,mods:{isHome:t,isArabic:Object(s.h)()},onScroll:e=>{this.handleContainerScroll(a,e)}},t&&m(l.a,"div",{block:"SliderHelper",mods:{isHome:t}}),e.length>0?e.map((e,t)=>{const{sku:o}=e;return m(l.a,c.a,{renderMySignInPopup:i,key:o,setLastTapItemOnHome:n,data:e,product:b,products:f,index:r,posofreco:t,ref:this.itemRef,widgetID:a,pageType:u,sourceProdID:p,sourceCatgID:v,closeCartPopup:d,widgetPosition:g,widgetheading:h})}):null,t&&m(l.a,"div",{block:"SliderHelper",mods:{isHome:t}})),this.renderScrollbar()))}render(){const{index:e=null}=this.props;return m(l.a,"div",{id:"productSlider"},m(l.a,"div",{ref:e=>{this.viewElement=e},id:"productSlider-".concat(e),block:"VueProductSlider",elem:"Container",mods:{isArabic:Object(s.h)()}},this.renderHeader(),this.renderSliderContainer()))}}t.a=Object(p.b)(e=>({prevPath:e.PLP.prevPath,language:e.AppState.language}),e=>({setPrevPath:t=>e(Object(g.z)(t)),setLastTapItemOnHome:t=>e(Object(g.t)(t))}))(b)}).call(this,i(29))},1287:function(e,t,i){"use strict";(function(e){var o=i(475),r=i(122),n=i(75),l=i(473),s=i(523),d=i(23),a=(i(581),i(0)),c=i.n(a),u=i(14),p=i(12),v=(i(189),i(5),i(7)),g=(i(470),i(22)),h=i(522),m=i(1),b=i(46),f=i(514),w=i(566),_=i(38),S=i(529),P=i(193),I=i(843);var y=i(11).checkBEMProps;class k extends a.PureComponent{constructor(e){super(e),this.handleIntersect=e=>{const{impressionSent:t}=this.state;t||e.forEach(e=>{if(!e.isIntersecting)return;const{data:t}=this.props;this.isAlgoliaProduct(t)&&Object(S.a)(this.getAlgoliaObjectID(t)),this.setState({impressionSent:!0}),this.intersectionObserver&&this.childRef.current&&this.intersectionObserver.unobserve(this.childRef.current)})},this.logAlgoliaClickEvent=()=>{var e,t;const{data:i,posofreco:o}=this.props;if(!this.isAlgoliaProduct(i))return;const r=this.getAlgoliaObjectID(i);if(!r)return;const n=(null===i||void 0===i?void 0:i.queryID)||(null===i||void 0===i?void 0:i.search_query_id)||"",l=null!==(e=null!==(t=null===i||void 0===i?void 0:i.position)&&void 0!==t?t:null===i||void 0===i?void 0:i.product_Position)&&void 0!==e?e:null!=o?Number(o)+1:null;null!=n&&""!==n&&l&&Number(l)>0?(new _.a).logInsightsAlgoliaAnalytics("click",v.Wi,{objectIDs:[String(r)],queryID:String(n),positions:[Number(l)]}):(new _.a).logInsightsAlgoliaAnalytics("click",v.Zi,{objectIDs:[String(r)]})},this.onclick=(e,t)=>{Object(P.a)();const{pageType:i,data:o,posofreco:r,sourceProdID:n,sourceCatgID:l,index:s,setPDPData:a,language:c,widgetheading:u="",widgetPosition:p="on-page",product:g={},products:h=[]}=this.props,{brand_name:f,category:w,sku:_,link:S,price:I,name:y,gender:k}=o;try{var O,j,R,D,C,A,L,V;const t=m.a.getItem(b.a),i=null===t||void 0===t||null===(O=t.gender)||void 0===O?void 0:O.toLowerCase(),o=k||[i],r=sessionStorage.getItem("currentScreen"),n=e?"".concat(r,"-").concat(o?[o].join("-").toLowerCase():"","-").concat(c,"-").concat(e):"",l={brand_name:null!==(j=g.brand_name)&&void 0!==j?j:"",product_sku:null!==(R=g.sku)&&void 0!==R?R:"",promotion_id:null!==n&&void 0!==n?n:"",promotion_name:null!==n&&void 0!==n?n:"",widget_position:null!==p&&void 0!==p?p:"on-page",item:[{item_id:_||"",item_name:y||"",item_brand:f||"",item_list_name:n,item_category:w||"",price:I||""}]};let d=0;if(g&&(null===g||void 0===g?void 0:g.price)){const e=Object.keys(null===g||void 0===g?void 0:g.price[0])[0];d=null===g||void 0===g?void 0:g.price[0][e]["6s_special_price"]}let u=0;if(I){const e=Object.keys(I[0])[0];u=I[0][e]["6s_special_price"]}const h={widget_name:null!==e&&void 0!==e?e:"",main_sku:null!==(D=null===g||void 0===g?void 0:g.sku)&&void 0!==D?D:0,main_brand_name:null!==(C=null===g||void 0===g?void 0:g.brand_name)&&void 0!==C?C:0,main_product_name:null!==(A=null===g||void 0===g?void 0:g.name)&&void 0!==A?A:0,main_price:null!==(L=d)&&void 0!==L?L:0,selected_sku:null!==_&&void 0!==_?_:0,selected_brand_name:null!==f&&void 0!==f?f:0,selected_product_name:null!==y&&void 0!==y?y:0,selected_price:null!==(V=u)&&void 0!==V?V:0};v.hj.dispatch(v.eh,l),Object(v.Ri)(v.Pf,{...h}),this.logAlgoliaClickEvent(),this.props.setLastTapItemOnHome("VeuSliderWrapper".concat(s)),a({},{})}catch(T){d.a.log(T)}},this.renderExpressDeliveryTag=e=>y(c.a,h.a,{productInfo:e}),this.childRef=c.a.createRef(),this.intersectionObserver=null,this.state={isArabic:Object(p.h)(),impressionSent:!1}}componentDidMount(){this.registerViewPortEvent()}componentWillUnmount(){this.intersectionObserver&&this.childRef.current&&(this.intersectionObserver.unobserve(this.childRef.current),this.intersectionObserver.disconnect())}registerViewPortEvent(){this.childRef.current&&(this.intersectionObserver=new IntersectionObserver(this.handleIntersect,{root:null,rootMargin:"0px",threshold:.5}),this.intersectionObserver.observe(this.childRef.current))}getAlgoliaObjectID(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null===e||void 0===e?void 0:e.objectID)||(null===e||void 0===e?void 0:e.objectId)||null}isAlgoliaProduct(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!!this.getAlgoliaObjectID(e)}getPageType(){const{urlRewrite:e,currentRouteName:t}=window;return"url-rewrite"===t?"undefined"===typeof e?"":e.notFound?"notfound":(e.type||"").toLowerCase():(t||"").toLowerCase()}sendBannerClickImpression(e){v.hj.dispatch(o.a,[e])}renderPrice(e){const{isArabic:t}=this.state;return e&&e.length>0?y(c.a,"div",{block:"VueProductSlider",elem:"SpecialPriceCon",mods:{isArabic:t}},y(c.a,l.default,{price:e,renderSpecialPrice:!0,cart:!0})):null}renderIsNew(t){return t?y(c.a,"div",{block:"VueProductSlider",elem:"VueIsNewTag"},y(c.a,"span",null,e("New"))):null}renderProductTag(t){return y(c.a,"div",{block:"VueProductSlider",elem:"VueProductTag"},y(c.a,"span",null,e(t)))}render(){const{data:{category:e,thumbnail_url:t,name:i,brand_name:o,price:l,is_new_in:d=!1,sku:a,link:u="",promotion_bts:p=""},data:v,widgetID:g,pageType:h,renderMySignInPopup:m,closeCartPopup:b,widgetPosition:_}=this.props,{isArabic:S}=this.state,P=Object(I.b)(v),k=Object(I.a)(u,v);let O=this.props.data.product_tag?this.props.data.product_tag:"";return y(c.a,"div",{block:"VueProductSlider",elem:"VueProductContainer",mods:{isArabic:S},"data-sku":a,"data-category":e,ref:this.childRef},y(c.a,n.default,{to:k,"data-banner-type":"vueSlider",block:"VueProductSlider-Link",title:i||"",onClick:()=>{this.onclick(g,v)}},y(c.a,"div",{style:{position:"relative"}},y(c.a,w.a,{type:"plp",rotateSpeed:2e3,category:"recent",product:v}),y(c.a,r.default,{lazyLoad:!0,block:"VueProductSlider",elem:"VueProductImage",src:t,alt:i}),O?this.renderProductTag(O):null),y(c.a,f.a,{brandName:o,productName:i,price:l,isArabic:S,page:"",pageType:h,renderSpecialPrice:!0,promotionBts:p})),y(c.a,s.a,{renderMySignInPopup:m,sku:a,data:v,pageType:h,closeCartPopup:b,widgetName:g,widgetPosition:_,qid:P||""}),this.renderExpressDeliveryTag(v))}}t.a=Object(u.b)(e=>({country:e.AppState.country,language:e.AppState.language}),e=>({setPDPData:(t,i)=>e(Object(g.u)(t,i))}),null,{forwardRef:!0})(k)}).call(this,i(29))},1288:function(e,t,i){},1289:function(e,t,i){},694:function(e,t,i){"use strict";i.r(t);var o=i(948);i.d(t,"default",(function(){return o.a}))},948:function(e,t,i){"use strict";var o=i(0),r=i.n(o),n=i(14),l=i(224),s=i(12),d=(i(1),i(23),i(969)),a=(i(1289),i(5)),c=i(135),u=i(38);var p=i(11).checkBEMProps;class v extends o.PureComponent{constructor(e){super(e),this.timerStartRef=Object(o.createRef)(),this.timerEndRef=Object(o.createRef)(),this.showWidgetPostRender=()=>{const e=(new Date).toUTCString(),{end_time:t,start_time:i}=this.props,o=t,r=Date.parse(o)-Date.parse(e),n=Date.parse(i)-Date.parse(e);n>0&&(this.timerStartRef.current=setTimeout(()=>{this.setState({isHideWidget:!1})},n),this.timerEndRef.current=setTimeout(()=>{this.setState({isHideWidget:!0})},r)),r<=0?this.setState({isHideWidget:!0}):Date.parse(i)<Date.parse(e)&&Date.parse(e)<Date.parse(o)&&(this.setState({isHideWidget:!1}),this.timerEndRef.current=setTimeout(()=>{this.setState({isHideWidget:!0})},r))},this.getRecentViewedWidgetData=(e,t)=>{const{gender:i,country:o,config:r,recentViewedWidgetData:n={},product:d,pageType:a="",customer:c}=this.props,{widgetPageSize:p,viewAllpageSize:v}=this.state,g=t,h=e,m=g?"recentProductsLogIn":"recentProductsLogOut",b="pdp"===a&&d&&"object"===typeof d&&0!==Object.keys(d).length,f=e=>{if(!b)return;const t=(null===e||void 0===e?void 0:e.gender)?Object(s.g)(null===e||void 0===e?void 0:e.gender)[0].toLowerCase().trim():i.toLowerCase().trim();let o=[];try{o=JSON.parse(localStorage.getItem(m))||[]}catch(a){console.error("Failed to parse recent products from localStorage",a)}const r=e.objectID||e.objectId||e.sku,n={category:t,sku:e.sku,objectId:r,timeStamp:(new Date).toISOString(),promotion_tags:e.promotion_tags||[]};o=o.filter(e=>(e.objectId||e.objectID)!==r),o.unshift(n);const l={};o.forEach(e=>{const t=e.category;l[t]||(l[t]=[]),l[t]=l[t].filter(t=>t.objectId!==e.objectId),l[t].unshift(e),l[t]=l[t].slice(0,v)});const d=Object.keys(l).reduce((e,t)=>e.concat(l[t]),[]).sort((e,t)=>new Date(t.timeStamp)-new Date(e.timeStamp));localStorage.setItem(m,JSON.stringify(d))},w=(e,t,i,o)=>{const r="cart"===o?"cart":(null===t||void 0===t?void 0:t.gender)?Object(s.g)(null===t||void 0===t?void 0:t.gender)[0].toLowerCase().trim():i.toLowerCase().trim(),n=Object(s.c)(t);return e[r]||(e[r]=[]),e[r]=e[r].filter(e=>e.sku!==n.sku),e[r].unshift(n),e};if(h&&g){const e=(null===d||void 0===d?void 0:d.gender)?Object(s.g)(null===d||void 0===d?void 0:d.gender)[0].toLowerCase().trim():i.toLowerCase().trim(),t="cart"===a?{userId:h,pageSize:p+1}:{category:e,userId:h,pageSize:p+1};let o={};Object(l.b)(t).then(e=>{var t;const r=(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.result)||[];b&&d&&f(d),"cart"===a?r.reverse().forEach(e=>{o=w(o,e,i,"cart")}):r.reverse().forEach(e=>{o=w(o,e,i,"")}),this.props.getRecentViewedData(o)}).catch(e=>{console.error("Fetch error for logged-in user",e),this.props.getRecentViewedData({})})}else if(!g){let e=JSON.parse(localStorage.getItem(m))||[];const t=!!Object.keys(n).length,o=(null===e||void 0===e?void 0:e.length)>0;let r={...n};if(!t&&o){const t=e.map(e=>{var t;return null===e||void 0===e||null===(t=e.objectId)||void 0===t?void 0:t.toString()});(new u.a).getWishlistProduct(t).then(t=>{((null===t||void 0===t?void 0:t.results)||[]).reverse().forEach(t=>{e.find(e=>(null===e||void 0===e?void 0:e.objectId)===(null===t||void 0===t?void 0:t.objectID))&&(r=w(r,t,i,""))}),b&&d&&(f(d),r=w(r,d,i)),this.props.getRecentViewedData(r)}).catch(e=>{console.error("Guest fetch error",e),this.props.getRecentViewedData({})})}b&&d&&(f(d),r=w(r,d,i),this.props.getRecentViewedData(r))}},this.state={data:[],isArabic:Object(s.h)(),isHideWidget:!0,isSignedIn:Object(a.h)(),widgetPageSize:10,viewAllpageSize:30}}componentDidMount(){var e,t;const{config:i,country:o,customer:r}=this.props,{recently_viewed_enabled:n=!1,widgetPageSize:l=10,viewAllpageSize:s=30}=(null===i||void 0===i||null===(e=i.countries)||void 0===e||null===(t=e[o])||void 0===t?void 0:t.inhouse_widget_config)||{},d=Object(a.h)(),c=null===r||void 0===r?void 0:r.id;this.setState({recently_viewed_enabled:n,widgetPageSize:l,viewAllpageSize:s}),n&&(this.getRecentViewedWidgetData(c,d),this.showWidgetPostRender())}componentDidUpdate(e){var t;const{customer:i,pageType:o}=this.props,r=Object(a.h)(),n=null===(t=e.customer)||void 0===t?void 0:t.id,l=null===i||void 0===i?void 0:i.id;n!==l&&("pdp"===o||"cart"===o)&&(r||this.props.getRecentViewedData({}),this.getRecentViewedWidgetData(l||null,r))}componentWillUnmount(){this.timerStartRef.current&&clearTimeout(this.timerStartRef.current),this.timerEndRef.current&&clearTimeout(this.timerEndRef.current)}render(){var e,t,i,o,n,l,a;const{isArabic:c,widgetPageSize:u,viewAllpageSize:v,recently_viewed_enabled:g,isSignedIn:h}=this.state,{renderMySignInPopup:m,closeCartPopup:b,index:f,setLastTapItemOnHome:w,widgetID:_,start_time:S="",end_time:P="",pageType:I,isHomePage:y=!1,productId:k,recentViewedWidgetData:O={},product:j,gender:R,widget_position:D="on-page"}=this.props,C="pdp"===I&&j&&"object"===typeof j&&0!==Object.keys(j).length?Object(s.g)(j.gender)[0].toLowerCase().trim():R.toLowerCase().trim();let A=[];if("cart"===I){const e=JSON.parse(localStorage.getItem("recentProductsLogOut"))||[],t=Object.values(O).flat();let i=[];i=!h&&e.length?e.map(e=>t.find(t=>t.sku===e.sku)).filter(e=>void 0!==e&&0!==(null===e||void 0===e?void 0:e.in_stock)):t.filter(e=>void 0!==e&&0!==(null===e||void 0===e?void 0:e.in_stock)),A=i}else{var L,V;A=j?null===(L=O[C])||void 0===L?void 0:L.filter(e=>(null===e||void 0===e?void 0:e.sku)!==j.sku&&0!==(null===e||void 0===e?void 0:e.in_stock)):null===(V=O[C])||void 0===V?void 0:V.filter(e=>0!==(null===e||void 0===e?void 0:e.in_stock))}return g&&0!==(null===(e=A)||void 0===e?void 0:e.length)&&void 0!==A?S&&P?this.state.isHideWidget?p(r.a,"div",null):p(r.a,"div",{block:"recentProductWrapper",mods:{isArabic:c},id:"recentProductWrapper".concat(f)},(null===(T=A)||void 0===T?void 0:T.length)>0&&p(r.a,d.a,{products:A,productId:k,product:j,setLastTapItemOnHome:w,renderMySignInPopup:m,closeCartPopup:b,heading:null!==(W=null===(H=this.props)||void 0===H||null===(E=H.header)||void 0===E?void 0:E.title)&&void 0!==W?W:"",header:null!==(M=null===(N=this.props)||void 0===N?void 0:N.header)&&void 0!==M?M:null,isHome:y,pageType:I,index:f,widgetID:_,sliderLength:u,gender:C,widget_position:D})):p(r.a,"div",{block:"recentProductWrapper",mods:{isArabic:c},id:"recentProductWrapper".concat(f)},(null===(t=A)||void 0===t?void 0:t.length)>0&&p(r.a,d.a,{products:A,productId:k,product:j,setLastTapItemOnHome:w,renderMySignInPopup:m,closeCartPopup:b,heading:null!==(i=null===(o=this.props)||void 0===o||null===(n=o.header)||void 0===n?void 0:n.title)&&void 0!==i?i:"",header:null!==(l=null===(a=this.props)||void 0===a?void 0:a.header)&&void 0!==l?l:null,isHome:y,pageType:I,index:f,widgetID:_,sliderLength:u,gender:C,widget_position:D})):null;var T,W,H,E,M,N}}t.a=Object(n.b)(e=>({gender:e.AppState.gender,country:e.AppState.country,config:e.AppConfig.config,customer:e.MyAccountReducer.customer,recentViewedWidgetData:e.PDP.recentViewedWidget}),e=>({getRecentViewedData:t=>c.a.getRecentViewedData(e,t)}))(v)},969:function(e,t,i){"use strict";(function(e){var o=i(0),r=i(14),n=i(1286);i(5);var l=i(11).checkBEMProps;class s extends o.PureComponent{render(){return l(e,n.a,this.props)}}s.defaultProps={sliderLength:10,withViewAll:!0,product:{},heading:"",data_url:"",pageType:""},t.a=Object(r.b)(e=>({}),null)(s)}).call(this,i(0))}}]);