(this["webpackJsonp6th-street"]=this["webpackJsonp6th-street"]||[]).push([[134],{1559:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(12);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=t?"#":"0-9";return e.reduce((e,a)=>{const{name:s,name_ar:i}=a;let o="";var d,c;Object(r.h)()&&!t?o=Number.isNaN(+i[0])?null===(d=i[0])||void 0===d?void 0:d.toUpperCase():n:o=Number.isNaN(+s[0])?null===(c=s[0])||void 0===c?void 0:c.toUpperCase():n;return e[o]||(e[o]=[]),e[o].push(a),e},{})}},1870:function(e,t,n){"use strict";(function(e,r){var a=n(0),s=n(14),i=n(21),o=n(1871),d=(n(63),n(137)),c=n(70),l=n(48),u=n(41),p=n(18),h=n(25),b=n(1559),m=n(38),g=n(12),y=n(24),B=n(15),v=n(87),f=n(812),C=n(194),k=n(77),O=n(2303);const R=n.e(2).then(n.bind(null,428));var L=n(11).checkBEMProps;class S extends a.PureComponent{constructor(){super(...arguments),this.state={brands:[],isLoading:!0,brandMapping:[],isArabic:Object(g.h)(),type:"",brandWidgetData:[]},this.containerFunctions={changeBrandType:this.changeBrandType.bind(this)},this.getGenderInAR=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"}},this.getGenderInEn=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"}},this.setLastTapItem=e=>{this.props.setLastTapItemOnHome(e)},this.containerProps=()=>{const{brands:e,isLoading:t,brandMapping:n,type:r,brandWidgetData:a=[]}=this.state;return{brands:e,isLoading:t,brandMapping:n,type:r,brandWidgetData:a}}}componentDidMount(){const{isArabic:e}=this.state,{location:t,history:n}=this.props;let r="";r="/shop-by-brands"==t.pathname?"":t.pathname.split("/")[1];const a=e?this.getGenderInAR(r):r,s=e?"".concat(this.getGenderInAR("Boy"),",").concat(this.getGenderInAR("Girl")):"Boy,Girl";this.setState({type:a}),this.requestShopByBrandWidgetData(r),this.requestShopbyBrands("kids"===r?s:a),this.updateBreadcrumbs(),this.updateHeaderState(),this.setMetaData()}getDevicePrefix(){return B.a.any()?"m/":"d/"}async requestShopByBrandWidgetData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{isArabic:t}=this.state;let n=e;""==e&&(n="all");const r=this.getDevicePrefix();if(n)try{const e=await Object(v.a)(d.b,{$FILE_NAME:"".concat(r).concat(n,"_shop_by_brand.json")});Array.isArray(e)?this.setState({brandWidgetData:e||[]}):this.setState({brandWidgetData:[]})}catch(a){this.setState({brandWidgetData:[]}),console.error(a)}else this.setState({brandWidgetData:[]})}updateHeaderState(){const{changeHeaderState:e}=this.props;e({name:k.a,isHiddenOnMobile:!0})}updateBreadcrumbs(){const{updateBreadcrumbs:t}=this.props;t([{url:"",name:e("\u062a\u0633\u0648\u0642 \u062d\u0633\u0628 \u0627\u0644\u0645\u0627\u0631\u0643\u0629")},{url:"/",name:e("\u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629")}])}changeBrandType(e){const{location:t,history:n}=this.props,{isArabic:r}=this.state,a=o.c.includes(e)?e:"";let s=r?this.getGenderInEn(a):a;const i=r?"".concat(this.getGenderInAR("Boy"),",").concat(this.getGenderInAR("Girl")):"Boy,Girl";s?n.push("/".concat(s,"/shop-by-brands")):n.push("/shop-by-brands"),this.requestShopByBrandWidgetData(s),this.requestShopbyBrands("kids"===e||"\u0623\u0637\u0641\u0627\u0644"===e?i:a),this.setState({type:a})}async requestShopbyBrands(e){try{const t=await this.requestBrands(e);Object(f.a)().then(e=>{const n=Object(b.a)(e.result)||{},r=Object.entries(n).sort((e,t)=>{let[n]=e,[r]=t;return"0-9"===n?1:"0-9"===r?-1:n!==r?n<r?-1:1:void 0}),a=[];r.map(e=>{let n=[],r=[];Object.values(e[1]).filter(e=>{const{name:r,name_ar:a}=e;(t.includes(r)||t.includes(a))&&n.push(e)}),n.length>0&&(r.push(e[0]),r.push(n),a.push(r))}),this.setState({brands:a,isLoading:!1})})}catch(t){this.setState({brands:[]}),console.error(t)}}async requestBrands(e){const{showErrorNotification:t}=this.props;return this.setState({isLoading:!0}),(new m.a).getBrands(e).then(e=>e).catch(e=>t(e))}setMetaData(){const{setMeta:t}=this.props;t({title:e("Brands | %s",C.a.displayName),keywords:e("\u0645\u0627\u0631\u0643\u0627\u062a"),description:"QA"===Object(y.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",C.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",C.a.displayName),twitter_title:e("Brands | %s",C.a.displayName),twitter_desc:"QA"===Object(y.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",C.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",C.a.displayName),og_title:e("Brands | %s",C.a.displayName),og_desc:"QA"===Object(y.g)()?e("Buy & Explore your favourite brands \u272f Free Receiving \u272f Cash On Receiving \u272f 100% original brands | %s.",C.a.displayName):e("Buy & Explore your favourite brands \u272f Free delivery \u272f Cash On Delivery \u272f 100% original brands | %s.",C.a.displayName)})}render(){return L(r,O.a,Object.assign({},this.containerFunctions,this.containerProps(),{setLastTapItem:this.setLastTapItem}))}}t.a=Object(i.j)(Object(s.b)(()=>({}),e=>({showErrorNotification:t=>e(Object(p.d)("error",t)),updateBreadcrumbs:t=>{R.then(n=>{let{default:r}=n;return r.update(t,e)})},changeHeaderState:t=>e(Object(l.c)(u.b,t)),setMeta:t=>e(Object(c.b)(t)),setLastTapItemOnHome:t=>e(Object(h.t)(t))}))(S))}).call(this,n(29),n(0))},1871: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 s})),n.d(t,"c",(function(){return i}));const r=e("\u0631\u062c\u0627\u0644"),a=e("\u0646\u0633\u0627\u0621"),s=e("\u0623\u0637\u0641\u0627\u0644"),i=[a,r,s]}).call(this,n(29))},1872:function(e,t,n){"use strict";(function(e){var r=n(2305),a=n(0),s=(n(1874),n(2307),n(11).checkBEMProps);class i extends a.PureComponent{constructor(){super(...arguments),this.renderBrand=t=>{const{type:n}=this.props,{name:a}=t;return s(e,r.a,{key:a,brand:t,type:n})}}renderBrands(){const{brands:e=[]}=this.props;return e.map(this.renderBrand)}render(){const{letter:t,isFiltered:n}=this.props;return s(e,"div",{block:"BrandGroup"},!n&&s(e,"h4",{block:"BrandGroup",elem:"Letter"},t),s(e,"div",{block:"BrandGroup",elem:"Group",mods:{isFiltered:n}},this.renderBrands()))}}i.defaultProps={isFiltered:!1},t.a=i}).call(this,n(0))},1873:function(e,t,n){"use strict";(function(e){var r=n(75),a=n(0),s=(n(1874),n(110),n(12)),i=(n(2306),n(7)),o=n(9),d=n(1),c=n(47),l=n(11).checkBEMProps;class u extends a.PureComponent{constructor(){super(...arguments),this.state={isArabic:Object(s.h)()}}capitalizeFirstLetter(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.charAt(0).toUpperCase()+e.slice(1)}renderName(){const{brand:{name:e}}=this.props;return e}sendMoeEvent(e){const t=d.a.getItem(c.a);Object(i.Ri)(i.ff,{country:Object(o.f)().toUpperCase(),language:Object(o.i)().toUpperCase(),brand_name:e||"",app6thstreet_platform:"Web",category:t.gender?t.gender.toUpperCase():""})}render(){const{brand:{name:t="",name_ar:n="",url_path:a=""},type:s}=this.props,{isArabic:i}=this.state;let o,d,c=i?n:t;return s?(d="kids"===s?i?"\u0623\u0648\u0644\u0627\u062f,\u0628\u0646\u0627\u062a":"Boy,Girl":"\u0646\u0633\u0627\u0621"===s?"\u0646\u0633\u0627\u0621":"\u0631\u062c\u0627\u0644"===s?"\u0631\u062c\u0627\u0644":"\u0623\u0637\u0641\u0627\u0644"===s?"\u0623\u0648\u0644\u0627\u062f,\u0628\u0646\u0627\u062a":s,o=a?"/".concat(a,".html?q=").concat(encodeURIComponent(c),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(c),"&dFR[gender][0]=").concat(this.capitalizeFirstLetter(d),"&dFR[in_stock][0]=",1):"/catalogsearch/result/?q=".concat(encodeURIComponent(c),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(c),"&dFR[gender][0]=").concat(this.capitalizeFirstLetter(d),"&dFR[in_stock][0]=",1)):o=a?"/".concat(a,".html?q=").concat(encodeURIComponent(c),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(c),"&dFR[in_stock][0]=",1):"/catalogsearch/result/?q=".concat(encodeURIComponent(c),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(c),"&dFR[in_stock][0]=",1),l(e,"div",{block:"Brand"},l(e,r.default,{to:o,block:"BrandLink",title:c,onClick:()=>{this.sendMoeEvent(c)}},c))}}t.a=u}).call(this,n(0))},1874:function(e,t,n){"use strict";var r=n(4),a=n.n(r);const s=a.a.shape({name:a.a.string.isRequired,count:a.a.number.isRequired}),i=a.a.arrayOf(s);a.a.objectOf(i)},2303:function(e,t,n){"use strict";(function(e,r){var a=n(0),s=n(2304),i=n(108),o=n(1871);n(2308);const d=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(10),n.e(24)]).then(n.bind(null,429)));var c=n(11).checkBEMProps;class l extends a.PureComponent{constructor(){var t;super(...arguments),t=this,this.state={filteredLetter:null},this.onBrandCategoryClick=e=>()=>{const{changeBrandType:t}=this.props;t(e)},this.onBrandLetterClick=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return()=>{t.setState({filteredLetter:e})}},this.renderBrandGroup=t=>{let[n,r]=t;const{type:a,brandMapping:i}=this.props,{filteredLetter:o}=this.state,d=r.map(e=>{const t=i.find(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 c(e,s.a,{key:n,letter:n,brands:d,isFiltered:!!o,type:a})}}renderCategorySelector(){let{type:t,brandWidgetData:n}=this.props;return t&&(t=decodeURIComponent(t)),c(e,"div",{block:"Brands",elem:"Categories",mods:{topContentAvaiableOnGenderSelect:n.length<=0&&!!t}},c(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:!t},onClick:this.onBrandCategoryClick("")},r("\u0627\u0644\u0643\u0644")),c(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:t===o.d},onClick:this.onBrandCategoryClick(o.d)},r("\u0627\u0644\u0646\u0633\u0627\u0621")),c(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:t===o.b},onClick:this.onBrandCategoryClick(o.b)},r("\u0627\u0644\u0631\u062c\u0627\u0644")),c(e,"button",{block:"Brands",elem:"CategoryButton",mods:{isSelected:t===o.a},onClick:this.onBrandCategoryClick(o.a)},r("\u0623\u0637\u0641\u0627\u0644")))}renderLetterSelector(){const{brands:t=[]}=this.props,{filteredLetter:n}=this.state;return c(e,"div",{block:"Brands",elem:"LetterFilter"},c(e,"button",{block:"Brands",elem:"LetterButton",mods:{isSelected:!n},onClick:this.onBrandLetterClick()},"#"),t.map(t=>{let[r]=t;return c(e,"button",{key:r,block:"Brands",elem:"LetterButton",mods:{isSelected:n===r},onClick:this.onBrandLetterClick(r)},r)}))}renderBrandGroups(){const{brands:e=[]}=this.props,{filteredLetter:t}=this.state;return t?e.filter(e=>{let[n]=e;return n===t}).map(this.renderBrandGroup):e.map(this.renderBrandGroup)}renderDynamicBanners(){const{type:t,brandWidgetData:n=[],setLastTapItem:s}=this.props;return n.length?c(e,a.Suspense,{fallback:null},c(e,"h2",{block:"Brands",elem:"Title"},r("\u0623\u0628\u0631\u0632 \u0627\u0644\u0639\u0644\u0627\u0645\u0627\u062a \u0627\u0644\u062a\u062c\u0627\u0631\u064a\u0629 \u0639\u0644\u0649 \u0622\u064a\u0641\u064a")),c(e,d,{gender:t,content:n,setLastTapItemOnHome:s})):null}renderDynamicTextContent(){var t,n,r,a,s,i;const{brandWidgetData:o=[]}=this.props;let d;return(null===o||void 0===o?void 0:o.length)&&(d=null===o||void 0===o?void 0:o.find((function(e){return"text"==e.type}))),c(e,"div",{block:"brands-bottom-content"},c(e,"h3",null,null===(t=d)||void 0===t||null===(n=t.header)||void 0===n?void 0:n.text),c(e,"p",null,null===(r=d)||void 0===r||null===(a=r.content)||void 0===a?void 0:a.text),c(e,"p",null,null===(s=d)||void 0===s||null===(i=s.footer)||void 0===i?void 0:i.text))}render(){const{isLoading:t}=this.props,{filteredLetter:n}=this.state;return c(e,"div",{block:"Brands"},c(e,i.a,{isLoading:t}),c(e,"h1",{block:"Brands",elem:"Title"},r("\u062a\u0633\u0648\u0642 \u062d\u0633\u0628 \u0627\u0644\u0645\u0627\u0631\u0643\u0629")),this.renderDynamicBanners(),c(e,"h2",{block:"Brands",elem:"Heading"},r("\u0627\u0644\u0645\u0627\u0631\u0643\u0627\u062a")),this.renderCategorySelector(),this.renderLetterSelector(),c(e,"div",{block:"Brands",elem:"Groups",mods:{isFiltered:!!n}},this.renderBrandGroups()),this.renderDynamicTextContent())}}l.defaultProps={type:null},t.a=l}).call(this,n(0),n(29))},2304:function(e,t,n){"use strict";var r=n(1872);n.d(t,"a",(function(){return r.a}))},2305:function(e,t,n){"use strict";var r=n(1873);n.d(t,"a",(function(){return r.a}))},2306:function(e,t,n){},2307:function(e,t,n){},2308:function(e,t,n){},2880:function(e,t,n){"use strict";n.r(t);var r=n(1870);n.d(t,"default",(function(){return r.a}))},812:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(140);const a=e=>r.a.get("brands"+"?name=".concat(encodeURIComponent(e)))||{},s=()=>r.a.get("brands")||{}}}]);