(this["webpackJsonp6th-street"]=this["webpackJsonp6th-street"]||[]).push([[53],{1504:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var r=n(356),a=function(e){return r.a.get("brands"+"?name=".concat(encodeURIComponent(e)))||{}},i=function(){return r.a.get("brands")||{}}},1885:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(11),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t?"#":"0-9";return e.reduce((function(e,a){var i,o,s=a.name,c=a.name_ar,u="";Object(r.h)()&&!t?u=Number.isNaN(+c[0])?null===(i=c[0])||void 0===i?void 0:i.toUpperCase():n:u=Number.isNaN(+s[0])?null===(o=s[0])||void 0===o?void 0:o.toUpperCase():n;return e[u]||(e[u]=[]),e[u].push(a),e}),{})}},2156:function(e,t,n){"use strict";(function(e,r){var a=n(10),i=n(5),o=n.n(i),s=n(12),c=n(3),u=n(4),d=n(19),l=n(7),p=n(6),h=n(0),b=n(16),v=n(37),f=n(2157),y=(n(95),n(344)),m=n(187),g=n(100),B=n(93),k=n(27),O=n(42),C=n(1885),j=n(59),L=n(11),R=n(49),S=n(17),F=n(148),I=n(1504),A=n(190),G=n(136),D=n(2546),w=n.e(0).then(n.bind(null,1323)),x=n(15).checkBEMProps,_=function(t){Object(l.a)(i,t);var n=Object(p.a)(i);function i(){var e;Object(c.a)(this,i);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return(e=n.call.apply(n,[this].concat(r))).state={brands:[],isLoading:!0,brandMapping:[],isArabic:Object(L.h)(),type:"",brandWidgetData:[]},e.containerFunctions={changeBrandType:e.changeBrandType.bind(Object(d.a)(e))},e.getGenderInAR=function(e){switch(e){case"men":return"\u0631\u062c\u0627\u0644";case"women":return"\u0646\u0633\u0627\u0621";case"kids":return"\u0623\u0637\u0641\u0627\u0644";case"Girl":return"\u0628\u0646\u0627\u062a";case"Boy":return"\u0623\u0648\u0644\u0627\u062f"}},e.getGenderInEn=function(e){switch(e){case"\u0631\u062c\u0627\u0644":return"men";case"\u0646\u0633\u0627\u0621":return"women";case"\u0623\u0637\u0641\u0627\u0644":return"kids";case"\u0628\u0646\u0627\u062a":return"Girl";case"\u0623\u0648\u0644\u0627\u062f":return"Boy"}},e.setLastTapItem=function(t){e.props.setLastTapItemOnHome(t)},e.containerProps=function(){var t=e.state,n=t.brands,r=t.isLoading,a=t.brandMapping,i=t.type,o=t.brandWidgetData;return{brands:n,isLoading:r,brandMapping:a,type:i,brandWidgetData:void 0===o?[]:o}},e}return Object(u.a)(i,[{key:"componentDidMount",value:function(){var e=this.state.isArabic,t=this.props,n=t.location,r=(t.history,"");r="/shop-by-brands"==n.pathname?"":n.pathname.split("/")[1];var a=e?this.getGenderInAR(r):r,i=e?"".concat(this.getGenderInAR("Boy"),",").concat(this.getGenderInAR("Girl")):"Boy,Girl";this.setState({type:a}),this.requestShopByBrandWidgetData(r),this.requestShopbyBrands("kids"===r?i:a),this.updateBreadcrumbs(),this.updateHeaderState(),this.setMetaData()}},{key:"getDevicePrefix",value:function(){return S.a.any()?"m/":"d/"}},{key:"requestShopByBrandWidgetData",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t,n,r,a,i=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:"",this.state.isArabic,n=t,""==t&&(n="all"),r=this.getDevicePrefix(),!n){e.next=19;break}return e.prev=6,e.next=9,Object(F.a)(y.b,{$FILE_NAME:"".concat(r).concat(n,"_shop_by_brand.json")});case 9:a=e.sent,Array.isArray(a)?this.setState({brandWidgetData:a||[]}):this.setState({brandWidgetData:[]}),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(6),this.setState({brandWidgetData:[]}),console.error(e.t0);case 17:e.next=20;break;case 19:this.setState({brandWidgetData:[]});case 20:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(){return e.apply(this,arguments)}}()},{key:"updateHeaderState",value:function(){(0,this.props.changeHeaderState)({name:G.a,isHiddenOnMobile:!0})}},{key:"updateBreadcrumbs",value:function(){var t=this.props.updateBreadcrumbs;t([{url:"",name:e("Shop by Brands")},{url:"/",name:e("Home")}])}},{key:"changeBrandType",value:function(e){var t=this.props,n=(t.location,t.history),r=this.state.isArabic,a=f.c.includes(e)?e:"",i=r?this.getGenderInEn(a):a,o=r?"".concat(this.getGenderInAR("Boy"),",").concat(this.getGenderInAR("Girl")):"Boy,Girl";i?n.push("/".concat(i,"/shop-by-brands")):n.push("/shop-by-brands"),this.requestShopByBrandWidgetData(i),this.requestShopbyBrands("kids"===e||"\u0623\u0637\u0641\u0627\u0644"===e?o:a),this.setState({type:a})}},{key:"requestShopbyBrands",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,r=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.requestBrands(t);case 3:n=e.sent,Object(I.a)().then((function(e){var t=Object(C.a)(e.result)||{},i=Object.entries(t).sort((function(e,t){var n=Object(a.a)(e,1)[0],r=Object(a.a)(t,1)[0];return"0-9"===n?1:"0-9"===r?-1:n!==r?n<r?-1:1:void 0})),o=[];i.map((function(e){var t=[],r=[];Object.values(e[1]).filter((function(e){var r=e.name,a=e.name_ar;(n.includes(r)||n.includes(a))&&t.push(e)})),t.length>0&&(r.push(e[0]),r.push(t),o.push(r))})),r.setState({brands:o,isLoading:!1})})),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),this.setState({brands:[]}),console.error(e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"requestBrands",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.props.showErrorNotification,this.setState({isLoading:!0}),e.abrupt("return",(new j.a).getBrands(t).then((function(e){return e})).catch((function(e){return n(e)})));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setMetaData",value:function(){(0,this.props.setMeta)({title:e("Brands | %s",A.a.displayName),keywords:e("brands"),description:"QA"===Object(R.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",A.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",A.a.displayName),twitter_title:e("Brands | %s",A.a.displayName),twitter_desc:"QA"===Object(R.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",A.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",A.a.displayName),og_title:e("Brands | %s",A.a.displayName),og_desc:"QA"===Object(R.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",A.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",A.a.displayName)})}},{key:"render",value:function(){return x(r,D.a,Object.assign({},this.containerFunctions,this.containerProps(),{setLastTapItem:this.setLastTapItem}))}}]),i}(h.PureComponent);t.a=Object(v.j)(Object(b.b)((function(){return{}}),(function(e){return{showErrorNotification:function(t){return e(Object(k.d)("error",t))},updateBreadcrumbs:function(t){w.then((function(n){return n.default.update(t,e)}))},changeHeaderState:function(t){return e(Object(g.c)(B.b,t))},setMeta:function(t){return e(Object(m.b)(t))},setLastTapItemOnHome:function(t){return e(Object(O.t)(t))}}}))(_))}).call(this,n(28),n(0))},2157:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return o}));var r=e("men"),a=e("women"),i=e("kids"),o=[a,r,i]}).call(this,n(28))},2158:function(e,t,n){"use strict";(function(e){var r=n(3),a=n(4),i=n(7),o=n(6),s=n(2548),c=n(0),u=(n(2160),n(2550),n(15).checkBEMProps),d=function(t){Object(i.a)(c,t);var n=Object(o.a)(c);function c(){var t;Object(r.a)(this,c);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(t=n.call.apply(n,[this].concat(i))).renderBrand=function(n){var r=t.props.type,a=n.name;return u(e,s.a,{key:a,brand:n,type:r})},t}return Object(a.a)(c,[{key:"renderBrands",value:function(){var e=this.props.brands;return(void 0===e?[]:e).map(this.renderBrand)}},{key:"render",value:function(){var t=this.props,n=t.letter,r=t.isFiltered;return u(e,"div",{block:"BrandGroup"},!r&&u(e,"h4",{block:"BrandGroup",elem:"Letter"},n),u(e,"div",{block:"BrandGroup",elem:"Group",mods:{isFiltered:r}},this.renderBrands()))}}]),c}(c.PureComponent);d.defaultProps={isFiltered:!1},t.a=d}).call(this,n(0))},2159:function(e,t,n){"use strict";(function(e){var r=n(3),a=n(4),i=n(7),o=n(6),s=n(29),c=n(0),u=(n(2160),n(73),n(11)),d=(n(2549),n(1)),l=n(14),p=n(13),h=n(33),b=n(15).checkBEMProps,v=function(t){Object(i.a)(c,t);var n=Object(o.a)(c);function c(){var e;Object(r.a)(this,c);for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];return(e=n.call.apply(n,[this].concat(a))).state={isArabic:Object(u.h)()},e}return Object(a.a)(c,[{key:"capitalizeFirstLetter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"renderName",value:function(){return this.props.brand.name}},{key:"sendMoeEvent",value:function(e){var t=p.a.getItem(h.a);Object(d.Ni)(d.bf,{country:Object(l.f)().toUpperCase(),language:Object(l.g)().toUpperCase(),brand_name:e||"",app6thstreet_platform:"Web",category:t.gender?t.gender.toUpperCase():""})}},{key:"render",value:function(){var t,n,r=this,a=this.props,i=a.brand,o=i.name,c=void 0===o?"":o,u=i.name_ar,d=void 0===u?"":u,l=i.url_path,p=void 0===l?"":l,h=a.type,v=this.state.isArabic,f=v?d:c;return h?(n="kids"===h?v?"\u0623\u0648\u0644\u0627\u062f,\u0628\u0646\u0627\u062a":"Boy,Girl":"\u0646\u0633\u0627\u0621"===h?"\u0646\u0633\u0627\u0621":"\u0631\u062c\u0627\u0644"===h?"\u0631\u062c\u0627\u0644":"\u0623\u0637\u0641\u0627\u0644"===h?"\u0623\u0648\u0644\u0627\u062f,\u0628\u0646\u0627\u062a":h,t=p?"/".concat(p,".html?q=").concat(encodeURIComponent(f),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(f),"&dFR[gender][0]=").concat(this.capitalizeFirstLetter(n),"&dFR[in_stock][0]=",1):"/catalogsearch/result/?q=".concat(encodeURIComponent(f),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(f),"&dFR[gender][0]=").concat(this.capitalizeFirstLetter(n),"&dFR[in_stock][0]=",1)):t=p?"/".concat(p,".html?q=").concat(encodeURIComponent(f),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(f),"&dFR[in_stock][0]=",1):"/catalogsearch/result/?q=".concat(encodeURIComponent(f),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(f),"&dFR[in_stock][0]=",1),b(e,"div",{block:"Brand"},b(e,s.a,{to:t,block:"BrandLink",onClick:function(){r.sendMoeEvent(f)}},f))}}]),c}(c.PureComponent);t.a=v}).call(this,n(0))},2160:function(e,t,n){"use strict";var r=n(8),a=n.n(r),i=a.a.shape({name:a.a.string.isRequired,count:a.a.number.isRequired}),o=a.a.arrayOf(i);a.a.objectOf(o)},2546:function(e,t,n){"use strict";(function(e,r){var a=n(10),i=n(3),o=n(4),s=n(7),c=n(6),u=n(2547),d=n(85),l=n(0),p=n(2157),h=(n(2551),n(431)),b=n(15).checkBEMProps,v=function(t){Object(s.a)(l,t);var n=Object(c.a)(l);function l(){var t;Object(i.a)(this,l);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return(t=n.call.apply(n,[this].concat(o))).state={filteredLetter:null},t.onBrandCategoryClick=function(e){return function(){(0,t.props.changeBrandType)(e)}},t.onBrandLetterClick=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(){t.setState({filteredLetter:e})}},t.renderBrandGroup=function(n){var r=Object(a.a)(n,2),i=r[0],o=r[1],s=t.props,c=s.type,d=s.brandMapping,l=t.state.filteredLetter,p=o.map((function(e){var t=d.find((function(t){var n,r;return(null===t||void 0===t||null===(n=t.en)||void 0===n?void 0:n.toUpperCase())===(null===e||void 0===e||null===(r=e.name)||void 0===r?void 0:r.toUpperCase())}));return Object.assign({},t,e)}));return b(e,u.a,{key:i,letter:i,brands:p,isFiltered:!!l,type:c})},t}return Object(o.a)(l,[{key:"renderCategorySelector",value:function(){var t=this.props,n=t.type,a=t.brandWidgetData;return n&&(n=decodeURIComponent(n)),b(e,"div",{block:"Brands",elem:"Categories",mods:{topContentAvaiableOnGenderSelect:a.length<=0&&!!n}},b(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:!n},onClick:this.onBrandCategoryClick("")},r("All")),b(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:n===p.d},onClick:this.onBrandCategoryClick(p.d)},r("Women")),b(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:n===p.b},onClick:this.onBrandCategoryClick(p.b)},r("Men")),b(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:n===p.a},onClick:this.onBrandCategoryClick(p.a)},r("Kids")))}},{key:"renderLetterSelector",value:function(){var t=this,n=this.props.brands,r=void 0===n?[]:n,i=this.state.filteredLetter;return b(e,"div",{block:"Brands",elem:"LetterFilter"},b(e,"button",{block:"Brands",elem:"LetterButton",mods:{isSelected:!i},onClick:this.onBrandLetterClick()},"#"),r.map((function(n){var r=Object(a.a)(n,1)[0];return b(e,"button",{key:r,block:"Brands",elem:"LetterButton",mods:{isSelected:i===r},onClick:t.onBrandLetterClick(r)},r)})))}},{key:"renderBrandGroups",value:function(){var e=this.props.brands,t=void 0===e?[]:e,n=this.state.filteredLetter;return n?t.filter((function(e){return Object(a.a)(e,1)[0]===n})).map(this.renderBrandGroup):t.map(this.renderBrandGroup)}},{key:"renderDynamicBanners",value:function(){var t=this.props,n=t.type,a=t.brandWidgetData,i=void 0===a?[]:a,o=t.setLastTapItem;return i.length?b(e,e.Fragment,null,b(e,"h2",{block:"Brands",elem:"Title"},r("Top Brands on AIVI")),b(e,h.a,{gender:n,content:i,setLastTapItemOnHome:o})):null}},{key:"renderDynamicTextContent",value:function(){var t,n,r,a,i,o,s,c=this.props.brandWidgetData,u=void 0===c?[]:c;return(null===u||void 0===u?void 0:u.length)&&(s=null===u||void 0===u?void 0:u.find((function(e){return"text"==e.type}))),b(e,"div",{block:"brands-bottom-content"},b(e,"h3",null,null===(t=s)||void 0===t||null===(n=t.header)||void 0===n?void 0:n.text),b(e,"p",null,null===(r=s)||void 0===r||null===(a=r.content)||void 0===a?void 0:a.text),b(e,"p",null,null===(i=s)||void 0===i||null===(o=i.footer)||void 0===o?void 0:o.text))}},{key:"render",value:function(){var t=this.props.isLoading,n=this.state.filteredLetter;return b(e,"div",{block:"Brands"},b(e,d.a,{isLoading:t}),b(e,"h1",{block:"Brands",elem:"Title"},r("Shop by Brands")),this.renderDynamicBanners(),b(e,"h2",{block:"Brands",elem:"Heading"},r("Brands A-Z")),this.renderCategorySelector(),this.renderLetterSelector(),b(e,"div",{block:"Brands",elem:"Groups",mods:{isFiltered:!!n}},this.renderBrandGroups()),this.renderDynamicTextContent())}}]),l}(l.PureComponent);v.defaultProps={type:null},t.a=v}).call(this,n(0),n(28))},2547:function(e,t,n){"use strict";var r=n(2158);n.d(t,"a",(function(){return r.a}))},2548:function(e,t,n){"use strict";var r=n(2159);n.d(t,"a",(function(){return r.a}))},2549:function(e,t,n){},2550:function(e,t,n){},2551:function(e,t,n){},2952:function(e,t,n){"use strict";n.r(t);var r=n(2156);n.d(t,"default",(function(){return r.a}))}}]);