1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[3711],{5465(e,t,r){r.r(t),r.d(t,{default:()=>te});var i=r(77810),a=r(62539),l=r(62241),n=r(73448),o=r(64965),s=r(28407),c=r(10939),g=r(29188),u=r(68066),d=r(48201),h=r(17477),p=r(90031),y=r(18124),m=r(83501),f=r(17749);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){(0,c.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}const k=({slug:e},t)=>{var r,i,a;const{locale:l}=(0,u.A)(),{shopperProducts:n}=(0,p.useCommerceApi)(),{getTokenWhenReady:c}=(0,y.w)(),v=(0,o.useLocation)(),{timeline:k}=(0,f.A)(),w=(0,g.I)(P({queryKey:["useCommerceContentfulCategoryListPage","pageCategoryListingPage","pageUrl",e,l.id,k],meta:{displayName:"useCommerceContentfulProductListPage"},queryFn:(b=(0,s.A)(function*(){try{var t,r,i;const a=yield(0,h.Yu)({slug:e,locale:l,timeline:k}),o=null==a||null===(t=a.items)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.fields;if(!a||!a.items||0===a.items.length||null==o||!o.categoryId)return Promise.reject({name:"Category Not Found",response:{status:404}});const s=o.categoryId.split("/").shift().split(":").pop(),g=yield c(),[u,d]=yield Promise.all([(0,h.UH)({categoryId:o.categoryId,contentTypeId:"pageProductListingPage",locale:l,level:6,timeline:k}),n.getCategory({parameters:{id:s,levels:0},headers:{Authorization:`Bearer ${g}`}})]);return d?{contentfulProductListPage:P(P({},u),{},{items:null===(i=u.items)||void 0===i?void 0:i.map((e,t)=>0===t?P(P({},e),{},{fields:P(P({},e.fields),o)}):e)}),category:d,urlMappingFields:o}:((0,m.Oz)("Category Not Found","404","Contentful",null==v?void 0:v.pathname,"API_Error"),Promise.reject({name:"Category Not Found",response:{status:404}}))}catch(e){return(0,m.Oz)(e.name,e.status||"404","Contentful",null==v?void 0:v.pathname,"API_Error"),Promise.reject({name:e.name,response:{status:e.status||404}})}}),function(){return b.apply(this,arguments)})},t));var b;const C=(0,d.A)(null===(r=w.data)||void 0===r?void 0:r.contentfulProductListPage,{fetchProducts:!0});return P(P({},w),{},{data:{contentfulProductListPage:C,category:null===(i=w.data)||void 0===i?void 0:i.category,urlMappingFields:null===(a=w.data)||void 0===a?void 0:a.urlMappingFields}})},w=e=>{const t={};return t.id=e.id,t.contentType=e.contentType,t.internalName=e.internalName,t},b=e=>{const t=w(e);return t.text=e.text,t.type=e.type,t.status=e.status,t.link=e.link,t.disableAutoClose=e.disableAutoClose,t.showOnly=e.showOnly,t.excludePages=e.excludePages,t.customerGroup=e.customerGroup,t.dyCampaignName=e.dyCampaignName,t},C=e=>{const t=w(e);return t.title=e.title,t.categories=e.categories||[],t.fallbackImage=e.fallbackImage||{},t},E=e=>{const t=w(e);return t.headline=e.headline,t.video=e.video,t.image=e.image,t.links=e.links||[],t},A=e=>{const t=w(e);return t.highlightVariation=e.highlightVariation,t.highlights=e.highlights,t},O=e=>{const t=w(e);return t.highlightVariation=e.highlightVariation,t.highlights=e.highlights,t},T=e=>{const t=w(e);return t.products=e.products||[],t.cta=e.cta,t.alignment=e.alignment,t.media=e.media,t.title=e.title,t},L=e=>{const t=w(e);return t.title=e.title,t.headline=e.headline,t.links=e.links,t.colorTheme=e.colorTheme,t},S=e=>{const t=w(e);return t.title=e.title,t.headline=e.headline,t.links=e.links,t},$=e=>{const t=w(e);return t.title=e.title,t.widgetType="highlight-product-single",t.assets=e.assets.map(e=>({productId:e.productId,productData:e.sfccProductData,imageViewType:e.imageViewType,title:e.title,media:e.image,url:e.url,video:e.video})),t};var j=r(75826),_=r.n(j),H=r(75240),V=r(28640),D=r(5381),I=r(45209),N=r(48361),F=r(36819),M=r(61158),x=r(97069),U=r(64116);const q=({contentSlots:e})=>i.createElement(i.Fragment,null,e.map((e,t)=>{const r=0===t;switch(e.contentType){case"widgetHero":return i.createElement(I.A,{key:`${e.id}-${t}`,slot:e,highPrioritySlot:r});case"widgetHighlight":if("highlight-light-double"===e.highlightVariation)return i.createElement(V.A,{key:`${e.id}-${t}`,slot:e});if("highlight-single"===e.highlightVariation||"highlight-double"===e.highlightVariation)return i.createElement(D.A,{key:`${e.id}-${t}`,slot:e});break;case"widgetProductHighlightMulti":return i.createElement(N.A,{key:`${e.id}-${t}`,slot:e});case"widgetCategoryList":return i.createElement(H.A,{key:e.id,slot:e});case"widgetSaleModule":return i.createElement(F.A,{key:`${e.id}-${t}`,slot:e});case"widgetSaleGantClub":return i.createElement(M.A,{key:`${e.id}-${t}`,slot:e});case"widgetSnackbar":return i.createElement(x.A,{key:`${e.id}-${t}`,slot:e});case"widgetHighlightProductSingle":return i.createElement(U.A,{key:`${e.id}-${t}`,assets:e.assets,widgetType:e.widgetType});default:return i.createElement("div",{key:e.id},e.internalName)}}));q.propTypes={contentSlots:_().arrayOf(_().shape({id:_().string.isRequired,contentType:_().string.isRequired,internalName:_().string,highlightVariation:_().string,highlights:_().array})).isRequired};const z=q;
1var B=r(2219),G=r(66653),R=r(85399),K=r(54752),W=r(4026),Y=r(86250),J=r(76730),Q=r(1714),X=r(33563),Z=r(65376),ee=r(50054);const te=()=>{var e,t,r,s;const{res:c}=(0,l.useServerContext)(),{setDynamicYieldContext:g}=(0,J.ur)(),u=(0,o.useLocation)(),{app:d}=(0,W.getConfig)();c&&c.set("Cache-Control",`s-maxage=${n.kB}, stale-while-revalidate=86400`);let{category:h}=(0,o.useParams)();const{data:y,error:f}=k({slug:h}),{contentfulProductListPage:v,category:P}=y||{},j=(0,i.useMemo)(()=>(e=>{let t=[];if(e&&e.contentSlots){const r=e.contentSlots;for(let e=0;e<r.length;e++){let i={};const a=r[e];switch(a.contentType){case"widgetHero":i=E(a),t.push(i);break;case"widgetHighlight":"highlight-light-double"===a.highlightVariation?(i=A(a),t.push(i)):"highlight-single"!==a.highlightVariation&&"highlight-double"!==a.highlightVariation||(i=O(a),t.push(i));break;case"widgetProductHighlightMulti":i=T(a),t.push(i);break;case"widgetCategoryList":i=C(a),t.push(i);break;case"widgetSaleModule":i=L(a),t.push(i);break;case"widgetSaleGantClub":i=S(a),t.push(i);break;case"widgetSnackbar":i=b(a),t.push(i);break;case"widgetHighlightProductSingle":i=$(a),t.push(i);break;default:i=w(a),t.push(i)}}}return t})(v),[v]),_=(0,Z.A)(),{data:H}=(0,p.useCategory)({parameters:{id:null==y||null===(e=y.category)||void 0===e?void 0:e.id,levels:1}},{enabled:!0}),V=(0,R.A)({localizedUrls:null==y||null===(t=y.category)||void 0===t?void 0:t.c_categoryURLs,pageType:"category",product:null,currentLocale:null});(0,i.useEffect)(()=>{_.sendViewPage(u.pathname)},[u]),(0,i.useEffect)(()=>{var e,t;if(null!=y&&y.category&&(0,Q.Wr)(y.category.id))return;const{pageGTMType:r}=(0,m.kP)(u),i=(0,m.Uj)(null==H?void 0:H.parentCategoryTree);var a;if(i&&(0,m.nh)(r,i),(null==H||null===(e=H.parentCategoryTree)||void 0===e?void 0:e.length)>0&&g({type:J.gS.Category,data:null==H||null===(a=H.parentCategoryTree)||void 0===a?void 0:a.map(e=>e.id)}),"undefined"==typeof window)return;const l=null==H||null===(t=H.parentCategoryTree)||void 0===t?void 0:t[0];l&&(0,Y.q)(H,l)},[null==H?void 0:H.parentCategoryTree,null==y?void 0:y.category,u]);const D=null==f||null===(r=f.response)||void 0===r?void 0:r.status;switch(D){case void 0:break;case 404:return i.createElement(G.A,null);default:throw new B.HTTPError(D,`HTTP Error ${D} occurred.`)}return null!=y&&y.category&&(0,Q.Wr)(y.category.id)?i.createElement(X.default,null):i.createElement(i.Fragment,null,i.createElement(ee.A,{type:"category",data:{category:P}}),(null==V?void 0:V.length)>0&&i.createElement(K.Helmet,null,V.filter(Boolean).map(({locale:e,href:t})=>i.createElement("link",{key:e,rel:"alternate",hrefLang:e,href:t})),i.createElement("link",{rel:"alternate",hrefLang:"x-default",href:(null===(s=V.find(e=>"en-gb"===e.locale))||void 0===s?void 0:s.href)||`${d.siteOrigin}/`})),i.createElement(a.az,{"data-testid":"category-list-page"},i.createElement(z,{contentSlots:j})))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.