{"version":3,"file":"ProductListing-8297d8fb68c0d4ebeeeb.js","sources":["webpack:///ProductListing-8297d8fb68c0d4ebeeeb.js"],"sourcesContent":["(this.nextGenJsonpFunction=this.nextGenJsonpFunction||[]).push([[267],{1019:function(e,t,a){\"use strict\";a.r(t);var n=a(1),r=a(50),l=a(76),i=a(71),o=a(25),c=a(384),s=a(143),u=a(218),m=a(298),g=a(208),p=a(89),d=a(47),b=a(11),h=a(946),O=a(0),E=a.n(O),f=a(45),C=a(78),j=a(67),y=a(42),v=a(235),F=a(83);t.default=Object(l.a)(Object(i.a)(e=>{const t=Object(O.useRef)(null),a=Object(o.a)([Object(n.e)(n.a.DesktopSmall),Object(n.e)(n.a.TabletLarge),Object(n.e)(n.a.MobileLarge)],[80,50,30],20),{text:l,hasTruncated:i}=Object(c.a)(e.categoryDescription,a),[T,x]=E.a.useState(),k=Object(o.a)([Object(n.e)(n.a.DesktopSmall),Object(n.e)(n.a.TabletLarge),Object(n.e)(n.a.Tablet)],[10,6,5],3),{items:I,showCompare:M}=Object(f.c)(e=>e.compare),D=Object(O.useMemo)(()=>E.a.createElement(v.a,{title:e.categoryTitle,description:l,backText:e.categoryBackText,backUrl:e.categoryBackUrl,inView:!0,background:\"white\",showReadMore:i,readMoreText:e.translations[\"custom.read-more\"],readMoreOnClick:()=>{t.current&&t.current.scrollIntoView({behavior:\"smooth\"})}}),[l]),w=Object(O.useMemo)(()=>T&&0!==T.filterOptions.length?E.a.createElement(F.a.CategoryFiltersWrapper,null,E.a.createElement(b.a.Full,null,E.a.createElement(h.a,{transition:{duration:.45,ease:\"easeOut\"}},E.a.createElement(s.a,{count:T.filterOptions.length,paddingOffset:0,pageChildren:1},E.a.createElement(u.a,null,e=>{var t;return E.a.createElement(E.a.Fragment,null,E.a.createElement(F.a.CategoryFilters,null,E.a.createElement(F.a.Track,{\"data-center\":T.filterOptions.length>k,trackMutations:!0,enableCarousel:!0},T.filterOptions.map(e=>E.a.createElement(F.a.CategoryFilterItemWrapper,{key:e.name,onClick:()=>{window.location.href=e.value}},E.a.createElement(F.a.CategoryFilterItem,{href:e.value},E.a.createElement(F.a.CategoryFilterItemImageContainer,null,E.a.createElement(F.a.CategoryFilterItemImage,{src:e.listingImage,alt:e.name})),E.a.createElement(F.a.CategoryFilterItemTitle,null,e.name)))))),T.filterOptions.length>k&&E.a.createElement(F.a.ControlsContainer,null,E.a.createElement(F.a.LineContainer,{progress:(e.activeIndex+k)/T.filterOptions.length*100}),E.a.createElement(F.a.Controls,null,E.a.createElement(d.a,{direction:\"left\",disabled:0===e.activeIndex,theme:\"red\",hideLine:!0,onClick:t=>{t.preventDefault(),null==e||e.goToPrev()}}),E.a.createElement(d.a,{direction:\"right\",theme:\"red\",hideLine:!0,disabled:e.activeIndex+k>=(null===(t=T.filterOptions)||void 0===t?void 0:t.length),onClick:t=>{t.preventDefault(),null==e||e.goToNext()}}))))}))))):null,[T,k]),L=Object(O.useMemo)(()=>E.a.createElement(F.a.Wrapper,null,E.a.createElement(p.a.FiltersElement,{\"data-compare-open\":M&&I.length>0,\"data-filters-bar\":\"true\"}),E.a.createElement(g.default,Object.assign({},e,{showCards:!0,productListGuids:null,productListGuid:null,groupByCategory:!1,includeAllCategories:!1,listingType:e.listingType,promoCards:[],setChildCategories:x}))),[e,M,I.length]),S=Object(O.useMemo)(()=>i?E.a.createElement(F.a.FooterDescriptionContainer,null,E.a.createElement(F.a.FooterDescriptionInner,null,E.a.createElement(F.a.FooterDescription,{ref:t,dangerouslySetInnerHTML:{__html:e.categoryDescription||\"\"}}))):null,[i,e.categoryDescription]),R=Object(O.useMemo)(()=>e.enableCompare?E.a.createElement(m.a,{pageContext:e.pageContext,translations:e.translations,showUnpublished:!1}):null,[e.enableCompare,e.pageContext,e.translations]),_=E.a.createElement(E.a.Fragment,null,D,w,L,S,R);return r.a?E.a.createElement(C.d,null,E.a.createElement(y.c,{ReactRouterRoute:C.b},_)):E.a.createElement(j.a,null,E.a.createElement(y.c,{ReactRouterRoute:C.b},_))}))},384:function(e,t,a){\"use strict\";var n=a(0);t.a=function(e,t){const[a,r]=n.useState(e),[l,i]=n.useState(!1);return n.useEffect(()=>{if(e){const a=((e,t)=>{let a=e.split(\".\").map(e=>[e,e.split(\" \").length]);a=a.splice(0,a.length-1);let n=0,r=0,l=!1;const i=null!=t?t:80;return a.forEach((e,t)=>{l||(r>i?(l=!0,n=t===a.length-1?a.length:t):(n++,r+=e[1]))}),n===a.length?null:a.map(e=>e[0]).slice(0,n).join(\". \")+\".\"})(e,t);r(a||e),i(!!a)}else r(e),i(!1)},[e,t]),{text:a,hasTruncated:l}}},946:function(e,t,a){\"use strict\";a.d(t,\"a\",(function(){return c}));var n=a(26),r=a(0),l=a(185),i=a(525),o=a(119);function c(e){var t=e.children,a=e.isValidProp,c=Object(n.__rest)(e,[\"children\",\"isValidProp\"]);a&&Object(i.b)(a),(c=Object(n.__assign)(Object(n.__assign)({},Object(r.useContext)(l.a)),c)).isStatic=Object(o.a)((function(){return c.isStatic}));var s=Object(r.useMemo)((function(){return c}),[JSON.stringify(c.transition),c.transformPagePoint,c.reducedMotion]);return r.createElement(l.a.Provider,{value:s},t)}}}]);"],"mappings":"AAAA","sourceRoot":""}