(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{Vx7I:function(e,n,t){"use strict";t.r(n),t.d(n,"HeaderSearch",(function(){return bn}));var r,o,a,c,i,s,l,d,u,h,p,b=t("zygG"),m=t("cxan"),g=t("KD1n"),f=t("ERkP"),v=t("NqqM"),S=t("VU4M"),y=t("booI"),w=t("jiAW"),x=t("jt0n"),k=t("9xD9"),O=t("AU4o"),j=t.n(O),T=t("fYnN"),I=t("KD7D"),P=t("7asP"),C=t("135/"),D=f.createElement,R=S.b.div(r||(r=Object(g.a)(["\n background-color: ",";\n padding: "," "," ",";\n margin-top: 1px;\n\n "," {\n padding: "," ",";\n margin-top: 0;\n }\n"])),(function(e){return e.theme.colors.palette.greys.white}),Object(w.i)(3),Object(w.i)(2),Object(w.i)(2),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"md")}),Object(w.i)(3),Object(w.i)(2)),F=S.b.a(o||(o=Object(g.a)(["\n ",";\n ","\n display: flex;\n gap: ",";\n width: 100%;\n align-items: center;\n\n &:focus {\n outline: none;\n border: 2px solid ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n }\n"])),(function(e){return Object(C.a)(e.theme.patterns.header.search.linkFont.entry,e.theme.patterns.header.search.linkFont.style)}),(function(e){return"\n text-decoration: ".concat(e.theme.patterns.header.search.linkFont.textDecoration||"underline",";\n text-transform: ").concat(e.theme.patterns.header.search.linkFont.transform||"none",";\n color: ").concat(e.theme.patterns.header.search.linkFont.textColor||"inherit",";\n ")}),Object(w.i)(1),(function(e){return e.theme.colors.palette.brand.base}),(function(e){return e.theme.colors.palette.greys.lighter})),B=S.b.p(a||(a=Object(g.a)(["\n ",";\n"])),Object(C.a)("bodyText","alternate")),E=S.b.span(c||(c=Object(g.a)(["\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 80%;\n"]))),A=Object(S.b)(P.a)(i||(i=Object(g.a)(["\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n border: 2px solid ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n }\n"])),(function(e){return e.theme.colors.palette.brand.base}),(function(e){return e.theme.colors.palette.greys.lighter})),V=function(e){return D(R,null,D("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:Object(w.i)(3),alignItems:"center"}},D(B,null,e.recentlySearchedTitle),D(A,{sizing:"regular",emphasis:"low",renderedAs:"a",href:"",onClick:function(n){n.stopPropagation(),e.onClick&&e.onClick()}},e.clearRecentSearch)),D("div",{style:{display:"flex",gap:Object(w.i)(1),flexDirection:"column"}},e.recentlySearched&&e.recentlySearched.map((function(n,t){return n.itemName?D("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},key:t},D(F,{key:t,href:"/elysium.search?search=".concat(n.itemName)},D(E,null,n.itemName)),D(A,{sizing:"regular",emphasis:"low",renderedAs:"a",href:"",onClick:function(){return e.removeIndividualSearch&&e.removeIndividualSearch(n.itemName)},onKeyDown:e.recentlySearched&&t===e.recentlySearched.length-1?function(n){"Tab"!==n.key||n.shiftKey||e.movePastInput&&e.movePastInput()}:void 0},D(v.f,null))):null}))))},H=t("xWKk"),L=t("zjfJ"),N=t("KkYj"),M=f.createElement;function K(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}var Q,U,W,J,z,G,Y,q,X,Z,$,_,ee,ne,te,re,oe,ae,ce,ie,se,le,de,ue,he,pe,be,me,ge=S.b.div(s||(s=Object(g.a)(["\n background-color: ",";\n margin-top: ",";\n padding: "," 0;\n"])),(function(e){return e.theme.colors.palette.greys.white}),Object(w.i)(1),Object(w.i)(1)),fe=S.b.li(l||(l=Object(g.a)(["\n position: relative;\n padding: ",";\n border: 2px solid transparent;\n margin: 0;\n overflow: hidden;\n &:hover,\n &:active,\n &:focus {\n background-color: ",";\n }\n\n &:focus-within {\n border-color: ",";\n }\n\n ","\n"])),Object(w.i)(2),(function(e){return e.theme.colors.palette.greys.lighter}),(function(e){return e.theme.colors.palette.brand.base}),(function(e){return e.isSelected&&"\n background-color: ".concat(e.theme.colors.palette.greys.lighter,";\n display: flex;\n justify-content: space-between;\n ")})),ve=S.b.div(d||(d=Object(g.a)(["\n display: flex;\n position: absolute;\n height: 100%;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n padding-right: ",";\n"])),Object(w.i)(2)),Se=S.b.p(u||(u=Object(g.a)(["\n ",";\n ","\n padding: ",";\n"])),(function(e){return Object(C.a)(e.theme.patterns.header.search.dropdownHeaderFont.entry,e.theme.patterns.header.search.dropdownHeaderFont.style)}),(function(e){return"\n text-decoration: ".concat(e.theme.patterns.header.search.dropdownHeaderFont.textDecoration,";\n text-transform: ").concat(e.theme.patterns.header.search.dropdownHeaderFont.transform,";\n color: ").concat(e.theme.patterns.header.search.dropdownHeaderFont.textColor,";\n ")}),Object(w.i)(2)),ye=Object(S.b)(v.j)(h||(h=Object(g.a)(["\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n g {\n fill: ",";\n }\n"])),(function(e){return e.theme.colors.palette.brand.base})),we=Object(S.b)(N.a)(p||(p=Object(g.a)(["\n &:focus {\n border-color: transparent;\n }\n"]))),xe=function(e){return M(ge,null,M(Se,null,e.productsTitle),M("ul",{"aria-label":e.productsTitle},e.products.map((function(n,t){var r=e.currentIndex===t,o=0!==n.reviews.averageScore||0!==n.reviews.total?function(e){for(var n=1;n=1200?e.theme.patterns.header.search.width:"".concat(e.pageWidth,"px")}),Object(w.i)(.25),(function(e){return e.cutBottom?"200":"100"}),(function(e){return Object(w.i)(e.paddingTop)}),(function(e){return e.theme.colors.palette.greys.lighter}),Object(w.n)(H.d.Dropdown),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"lg")}),(function(e){return e.slimHeader&&!e.theme.patterns.header.mobileSearch?"0":"auto"})),Ke=S.b.div(ne||(ne=Object(g.a)(["\n display: flex;\n height: ",";\n\n "," {\n display: inline-block;\n height: ",";\n\n ",";\n }\n\n ","\n flex-direction: column;\n flex: 1;\n"])),(function(e){return e.theme.patterns.header.search.height.mobile}),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"lg")}),(function(e){return e.theme.patterns.header.search.height.desktop}),(function(e){var n;return(null===(n=e.theme.patterns.header.search.margin)||void 0===n?void 0:n.bottom)&&"margin-bottom: ".concat(e.theme.patterns.header.search.margin.bottom)}),(function(e){return e.mobileSearch&&"width: 100%"})),Qe=S.b.form(te||(te=Object(g.a)(["\n display: flex;\n justify-content: center;\n height: 100%;\n ","\n ","\n\n "," {\n max-width: 458px;\n width: ",";\n\n border-radius: ",";\n }\n\n &:focus-within {\n ","\n }\n"])),(function(e){return e.inputFocused&&"".concat(Object(w.n)(H.d.Dropdown),";\n")}),(function(e){return"border-radius: ".concat(e.theme.patterns.header.search.searchBorders.inactive.radius,";\n\n border-top: ").concat(e.theme.patterns.header.search.searchBorders.inactive.top.display&&"".concat(e.theme.patterns.header.search.searchBorders.inactive.top.width," solid ").concat(e.theme.patterns.header.search.searchBorders.inactive.top.color),";\n border-left: ").concat(e.theme.patterns.header.search.searchBorders.inactive.left.display&&"".concat(e.theme.patterns.header.search.searchBorders.inactive.left.width," solid ").concat(e.theme.patterns.header.search.searchBorders.inactive.left.color),";\n border-right: ").concat(e.theme.patterns.header.search.searchBorders.inactive.right.display&&"".concat(e.theme.patterns.header.search.searchBorders.inactive.right.width," solid ").concat(e.theme.patterns.header.search.searchBorders.inactive.right.color),";\n border-bottom: ").concat(e.theme.patterns.header.search.searchBorders.inactive.bottom.display&&"".concat(e.theme.patterns.header.search.searchBorders.inactive.bottom.width," solid ").concat(e.theme.patterns.header.search.searchBorders.inactive.bottom.color),";\n")}),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"lg")}),(function(e){return e.mobileSearch?"100%":e.theme.patterns.header.search.width}),(function(e){return e.theme.patterns.header.search.searchBorders.inactive.radius}),(function(e){return"border-width: 0;\n outline: 2px solid ".concat(e.theme.colors.palette.brand.base,";\n ")})),Ue=S.b.div(re||(re=Object(g.a)(["\n ","\n display: flex;\n width: 100%;\n background-color: ",";\n\n border-radius: ",";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n "," {\n background-color: ",";\n width: 410px;\n\n &:focus-within {\n outline: none;\n padding: 0;\n }\n }\n"])),(function(e){return e.inputFocused&&"".concat(Object(w.n)(H.d.Dropdown),";")}),(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive}),(function(e){return e.theme.patterns.header.search.searchBorders.inactive.radius}),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"lg")}),(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive})),We=Object(S.a)(oe||(oe=Object(g.a)(["\n ",";\n ","\n"])),(function(e){return Object(C.a)(e.theme.patterns.header.search.placeholderFont.entry,e.theme.patterns.header.search.placeholderFont.style)}),(function(e){return"\n text-transform: ".concat(e.theme.patterns.header.search.placeholderFont.transform,";\n text-decoration: ").concat(e.theme.patterns.header.search.placeholderFont.textDecoration,";\n color: ").concat(e.theme.patterns.header.search.placeholderFont.textColor,";\n")})),Je=S.b.input(ae||(ae=Object(g.a)(["\n ",";\n ","\n background-color: ",";\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n border-radius: ",";\n padding: ",";\n\n ::placeholder {\n ","\n background-color: ",";\n }\n ::-webkit-input-placeholder {\n ","\n background-color: ",";\n }\n :-ms-input-placeholder {\n ","\n background-color: ",";\n }\n\n &:focus {\n outline: none;\n }\n"])),(function(e){return Object(C.a)(e.theme.patterns.header.search.activeFont.entry,e.theme.patterns.header.search.activeFont.style)}),(function(e){return"\n text-transform: ".concat(e.theme.patterns.header.search.activeFont.transform,";\n text-decoration: ").concat(e.theme.patterns.header.search.activeFont.textDecoration,";\n color: ").concat(e.theme.patterns.header.search.activeFont.textColor,";\n ")}),(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive}),(function(e){return e.theme.patterns.header.search.searchBorders.inactive.radius}),(function(e){return e.theme.patterns.header.search.placeHolderPadding}),We,(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive}),We,(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive}),We,(function(e){return""!==e.value?e.theme.patterns.header.search.backgroundColor.active:e.theme.patterns.header.search.backgroundColor.inactive})),ze=S.b.label(ce||(ce=Object(g.a)(["\n width: 100%;\n"]))),Ge=S.b.button(ie||(ie=Object(g.a)(["\n ","\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: ",";\n width: ",";\n height: ",";\n flex: 0;\n height: 100%;\n background-color: ",";\n\n border-radius: ",";\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n\n ","\n\n svg {\n fill: ",";\n }\n\n &:focus {\n outline: none;\n outline-offset: -4px;\n ",";\n }\n\n &:hover,\n &:active,\n &:focus {\n background-color: ",";\n padding: 0 ",";\n }\n\n svg {\n fill: ",";\n }\n"])),(function(e){return e.inputFocused&&"".concat(Object(w.n)(H.d.Dropdown),";")}),Object(w.i)(6),Object(w.i)(6),Object(w.i)(6),(function(e){return e.active?e.theme.patterns.header.search.buttonBackgroundColor.active:e.theme.patterns.header.search.buttonBackgroundColor.inactive}),(function(e){return e.theme.patterns.header.search.searchBorders.inactive.radius}),(function(e){return e.theme.patterns.header.search.buttonBorder.inactive.radius}),(function(e){return e.theme.patterns.header.search.buttonBorder.inactive.radius}),(function(e){return"\n border-top: ".concat(e.theme.patterns.header.search.buttonBorder.inactive.top.display&&"".concat(e.theme.patterns.header.search.buttonBorder.inactive.top.width," solid ").concat(e.theme.patterns.header.search.buttonBorder.inactive.top.color),";\n border-left: ").concat(e.theme.patterns.header.search.buttonBorder.inactive.left.display&&"".concat(e.theme.patterns.header.search.buttonBorder.inactive.left.width," solid ").concat(e.theme.patterns.header.search.buttonBorder.inactive.left.color),";\n border-right: ").concat(e.theme.patterns.header.search.buttonBorder.inactive.right.display&&"".concat(e.theme.patterns.header.search.buttonBorder.inactive.right.width," solid ").concat(e.theme.patterns.header.search.buttonBorder.inactive.right.color),";\n border-bottom: ").concat(e.theme.patterns.header.search.buttonBorder.inactive.bottom.display&&"".concat(e.theme.patterns.header.search.buttonBorder.inactive.bottom.width," solid ").concat(e.theme.patterns.header.search.buttonBorder.inactive.bottom.color),";\n")}),(function(e){return e.theme.patterns.header.search.mobileIcon.color}),(function(e){return e.active?"outline: 2px solid ".concat(e.theme.colors.palette.greys.white):"border: 2px solid ".concat(e.theme.patterns.header.search.focusBorderColor||e.theme.colors.palette.brand.base)}),(function(e){return e.active?e.theme.patterns.header.search.buttonBackgroundColor.active:e.theme.patterns.header.search.buttonBackgroundColor.inactive}),Object(w.i)(1),(function(e){return e.active?e.theme.patterns.header.search.iconColor.active:e.theme.patterns.header.search.iconColor.inactive})),Ye=Object(S.b)((function(e){var n,t,r,o=document.documentElement.clientWidth,a=f.useRef(null),c=f.useRef(null);f.useEffect((function(){if(c.current&&a.current){var e=a.current.offsetHeight/2,n=c.current.offsetTop,t=e>n?0:n-e;a.current.scrollTo(0,t)}}),[e.correctionsIndex,e.suggestionsIndex,e.productsIndex]);var i=(null===(n=e.searchResults.corrections)||void 0===n?void 0:n.length)>0;return Ne("div",{style:{position:"relative",display:"flex",justifyContent:"center"},"data-testid":"header-search-results-dropdown"},Ne(Me,Object(m.a)({pageWidth:o,cutBottom:y.a,ref:a,"aria-label":e.searchI18nText.searchResultsAria,onKeyDown:function(n){return"Escape"===n.key&&e.clearInput()},paddingTop:e.isDesktop?0:2},e),i&&Ne(De,Object(m.a)({currentIndex:e.correctionsIndex,corrections:e.searchResults.corrections,correctionsTitle:e.searchI18nText.correctionsTitle,autocompleteLink:e.autocompleteLink,selectedRef:c},e.onClickSearchSuggestions&&{onClickSearchSuggestions:e.onClickSearchSuggestions})),(null===(t=e.searchResults.suggestedSearchQueries)||void 0===t?void 0:t.length)>0&&Ne(Le,Object(m.a)({currentIndex:e.suggestionsIndex,showTitle:i,suggestions:e.searchResults.suggestedSearchQueries,suggestionsTitle:e.searchI18nText.suggestionsTitle,autocompleteLink:e.autocompleteLink,selectedRef:c},e.onClickSearchSuggestions&&{onClickSearchSuggestions:e.onClickSearchSuggestions})),(null===(r=e.searchResults.products)||void 0===r?void 0:r.length)>0&&Ne(xe,{currentIndex:e.productsIndex,products:e.searchResults.products,productsTitle:e.searchI18nText.productsTitle,selectedRef:c,fromText:e.fromText,rrpText:e.rrpText,freeText:e.freeText,movePastInput:e.movePastInput,inputValue:e.inputValue,showPowerReview:e.showPowerReview})))}))(se||(se=Object(g.a)(["\n ",";\n display: ",";\n ",";\n"])),(function(e){return e.mobileSearch&&"top:15px; max-height: 500px; overflow-y: auto;"}),(function(e){return e.shouldDisplay?"initial":"none"}),(function(e){return e.mobileSearch?" width: 470px":null})),qe=S.b.button(le||(le=Object(g.a)(["\n ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: ",";\n border: 2px solid transparent;\n color: ",";\n\n &:hover,\n &:active,\n &:focus {\n opacity: 0.8;\n cursor: pointer;\n outline: none;\n }\n\n &:focus {\n border-color: ",";\n }\n\n svg {\n path {\n fill: ",";\n }\n }\n"])),(function(e){return Object(C.a)(e.theme.formgroup.icon.scale,e.theme.formgroup.icon.style)}),Object(w.i)(1),(function(e){return e.theme.colors.palette.greys.darker}),(function(e){return e.theme.colors.palette.brand.base}),(function(e){return e.theme.patterns.header.search.clearTextIcon})),Xe=Object(S.b)(I.b)(de||(de=Object(g.a)(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n display: block;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n ",";\n"])),Object(w.n)(H.d.Overlay)),Ze=(Object(S.b)(Me)(ue||(ue=Object(g.a)(["\n display: flex;\n align-items: center;\n flex-direction: column;\n width: 100%;\n min-width: 393px;\n padding: 0 ",";\n"])),Object(w.i)(2)),S.b.div(he||(he=Object(g.a)(["\n position: relative;\n display: flex;\n justify-content: center;\n z-index: ",";\n border-top: 1px solid ",";\n "," {\n border-top: 0;\n }\n"])),w.d.Highest,(function(e){return e.theme.colors.palette.greys.light}),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"md")}))),$e=function(e){return e.up="UP",e.down="DOWN",e}($e||{}),_e=function(e,n,t,r,o,a,c,i,s){var l,d,u,h,p,b,m,g,f;(null===n||void 0===n?void 0:null===(l=n.corrections)||void 0===l?void 0:l.length)?h=null===n||void 0===n?void 0:null===(m=n.corrections)||void 0===m?void 0:m.length:h=0;(null===n||void 0===n?void 0:null===(d=n.suggestedSearchQueries)||void 0===d?void 0:d.length)?p=null===n||void 0===n?void 0:null===(g=n.suggestedSearchQueries)||void 0===g?void 0:g.length:p=0;(null===n||void 0===n?void 0:null===(u=n.products)||void 0===u?void 0:u.length)?b=null===n||void 0===n?void 0:null===(f=n.products)||void 0===f?void 0:f.length:b=0;switch(e){case $e.up:!function(e,n,t,r,o,a,c,i,s){e||(n>-1?t(n-1):c>-1?(0===c&&t(a-1),r(c-1)):s>-1&&(0===s&&r(i-1),o(s-1)))}(t,r,o,c,i,h,s,p,a);break;case $e.down:!function(e,n,t,r,o,a,c,i,s){e!==n-1&&(t>-1?t===r-1?(i(0),s(-1)):o(e+1):a>-1?a===c-1?(o(0),i(-1)):i(a+1):e>-1&&o(e+1))}(a,b,r,h,i,s,p,c,o)}},en=function(e,n){var t=T.getJSON("recentlySearchedProducts")||[];t.push({itemName:e,itemCategory:null!==n&&void 0!==n?n:"",timeStamp:(new Date).getTime()});var r=t.slice(-5).reduce((function(e,n){return e.some((function(e){return e.itemName===n.itemName}))||e.push(n),e}),[]).filter((function(e){return""!==e.itemName.trim()}));0!==r.length&&T.set("recentlySearchedProducts",JSON.stringify(r))},nn=function(){T.remove("recentlySearchedProducts")},tn=f.createElement,rn=j()((function(){return t.e(252).then(t.bind(null,"e8UE")).then((function(e){return e.SearchComponentsDropdown}))}),{ssr:!0,loadableGenerated:{webpack:function(){return["e8UE"]},modules:["../HeaderSearch/SearchComponentsDropdown"]}}),on=function(e){var n=e.execSearchQuery,t=e.placeholder,r=e.data,o=e.setValue,a=e.setInstantSearchResults,c=e.inputValue,i=e.inputRef,s=e.restartIndexes,l=e.setAnnounceMessage,d=e.resultsAvailable,u=e.onKeyDown,h=e.debounceDelay,p=e.minSearchLength,m=e.onFocusDropdown,g=e.currency,v=e.shippingDestination,S=e.concessionCode,y=e.vipPriceEnabled,w=e.showOutOfStockVariants,x=e.showPriceForDisplayedVariant;if(!n)return null;var k=p||1,O=function(e,n){var t=f.useState(e),r=Object(b.a)(t,2),o=r[0],a=r[1];return f.useEffect((function(){var t=setTimeout((function(){a(e)}),n);return function(){clearTimeout(t)}}),[e,n]),o}(c,h||25);return f.useEffect((function(){var e=O.length>=k?O:"";n({variables:{concessionCode:S,vipPriceEnabled:y,showOutOfStockVariants:w,showPriceForDisplayedVariant:x,currency:g||"GBP",shippingDestination:v||"GB",query:O,limit:5}}),e||(a(null),s())}),[O]),f.useEffect((function(){(null===r||void 0===r?void 0:r.instantSearch)&&O.length>=k&&(a(r.instantSearch),l(d))}),[r]),tn(Je,{type:"text","aria-label":t,placeholder:t,onChange:function(e){o(e.target.value)},value:c,ref:i,"data-testid":"header-search-form-input",title:t,onKeyDown:u,onFocus:m})},an=function(e){var n,t,r,o,a,c=e.placeholder,i=e.searchButtonAriaLabel,s=e.clearAriaLabel,l=e.setScrollLock,d=f.useState(""),u=Object(b.a)(d,2),h=u[0],p=u[1],g=f.useState(null),S=Object(b.a)(g,2),y=S[0],w=S[1],x=f.useState(-1),k=Object(b.a)(x,2),O=k[0],j=k[1],I=f.useState(-1),P=Object(b.a)(I,2),C=P[0],D=P[1],R=f.useState(-1),F=Object(b.a)(R,2),B=F[0],E=F[1],A=f.useState(!1),V=Object(b.a)(A,2),H=V[0],L=V[1],N=f.useState([]),M=Object(b.a)(N,2),K=M[0],Q=M[1],U=f.useRef(null),W=f.createRef(),J=f.useState(null),z=Object(b.a)(J,2),G=z[0],Y=z[1];f.useEffect((function(){var e=T.get("recentlySearchedProducts");e&&e.length>0&&Q(JSON.parse(e))}),[]),f.useEffect((function(){var n;(Y(null),-1!==O&&(null===y||void 0===y?void 0:y.corrections))&&Y("".concat(e.searchI18nText.correctionsTitle,": ").concat(null===y||void 0===y?void 0:null===(n=y.corrections[O])||void 0===n?void 0:n.correction));if(-1!==C&&(null===y||void 0===y?void 0:y.suggestedSearchQueries)&&Y("".concat(e.searchI18nText.suggestionsTitle,": ").concat(null===y||void 0===y?void 0:y.suggestedSearchQueries[C])),-1!==B&&(null===y||void 0===y?void 0:y.products)){var t=(null===y||void 0===y?void 0:y.products.length)-1===B,r=null===y||void 0===y?void 0:y.products[B];Y(t?"".concat(e.searchI18nText.lastResult,", ").concat(e.searchI18nText.productsTitle,": ").concat(r.title):"".concat(e.searchI18nText.productsTitle,": ").concat(r.title))}}),[O,C,B]);var q=-1===O&&-1===C&&-1===B,X=function(){j(-1),D(-1),E(-1)};f.useEffect((function(){""!==h&&e.isDesktop&&"undefined"!==typeof document&&l(!0,document,window)}),[h]);var Z=function(){p(""),e.isDesktop&&"undefined"!==typeof document&&l(!1,document,window),w(null),X()},$=function(n){var t;"undefined"!==typeof document&&l(!0,document,window),(null===(t=U.current)||void 0===t?void 0:t.contains(n.currentTarget))&&(L(!0),e.onFocus&&e.onFocus(n))};f.useEffect((function(){var n;e.focusOnMount&&(null===(n=U.current)||void 0===n||n.focus())}),[]);var _=function(){var n,t,r;-1!==O&&(null===y||void 0===y?void 0:y.corrections)&&(e.enableRecentSearches&&en(null===y||void 0===y?void 0:null===(n=y.corrections[O])||void 0===n?void 0:n.correction),window.location.assign("".concat(e.autocompleteLink,"correction&search=").concat(null===y||void 0===y?void 0:null===(t=y.corrections[O])||void 0===t?void 0:t.correction)));(-1!==C&&(null===y||void 0===y?void 0:y.suggestedSearchQueries)&&(e.enableRecentSearches&&en(null===y||void 0===y?void 0:y.suggestedSearchQueries[C]),window.location.assign("".concat(e.autocompleteLink,"searchsuggestion&search=").concat(null===y||void 0===y?void 0:y.suggestedSearchQueries[C]))),-1!==B&&(null===y||void 0===y?void 0:y.products))&&window.location.assign(null===y||void 0===y?void 0:null===(r=y.products[B])||void 0===r?void 0:r.url)},ee=e.InstantSearchInjector;return tn(Ke,{ref:W,mobileSearch:e.mobileSearch},tn(Qe,{onSubmit:function(n){n.preventDefault(),e.onSubmit(h),e.enableRecentSearches&&en(h)},inputFocused:!e.isDesktop&&H,mobileSearch:e.mobileSearch},tn(Ue,{inputFocused:e.isDesktop&&H,value:h},tn(ze,null,tn(ee,null,(function(n){return tn(on,{placeholder:c,setValue:p,setInstantSearchResults:w,inputValue:h,inputRef:U,restartIndexes:X,setAnnounceMessage:Y,resultsAvailable:e.searchI18nText.resultsAvailable,onKeyDown:function(n){return function(e,n,t,r,o,a,c,i,s,l,d,u,h,p,b){var m,g,f,v,S,y=0;switch(v=(null===n||void 0===n?void 0:null===(m=n.corrections)||void 0===m?void 0:m.length)?n.corrections.length:0,S=(null===n||void 0===n?void 0:null===(g=n.suggestedSearchQueries)||void 0===g?void 0:g.length)?n.suggestedSearchQueries.length:0,(null===n||void 0===n?void 0:null===(f=n.products)||void 0===f?void 0:f.length)&&(y=n.products.length),e.key){case"Escape":t(),r&&o(!0,document,window);break;case"Enter":i||(e.preventDefault(),b());break;case"ArrowUp":-1===s&&-1===p&&-1===d||e.preventDefault(),_e($e.up,n,i,s,l,d,u,h,p);break;case"ArrowDown":!function(e,n,t,r,o,a,c){e&&(n>0?t(0):r>0?o(0):a>0&&c(0))}(i,v,l,S,u,y,h),_e($e.down,n,i,s,l,d,u,h,p);break;case"Tab":e.shiftKey?(t(),c(!1)):a()}}(n,y,Z,e.isDesktop,l,X,L,q,O,j,B,D,E,C,_)},data:n.data,execSearchQuery:n.execSearchQuery,onFocusDropdown:$,currency:e.currency,concessionCode:e.concessionCode,shippingDestination:e.shippingDestination,vipPriceEnabled:null===e||void 0===e?void 0:e.vipPriceEnabled,showOutOfStockVariants:null===e||void 0===e?void 0:e.showOutOfStockVariants,showPriceForDisplayedVariant:null===e||void 0===e?void 0:e.showPriceForDisplayedVariant})}))),h&&tn(qe,{"data-testid":"clear-button",type:"button",onKeyPress:function(e){var n;"Enter"===e.key&&(Z(),null===(n=U.current)||void 0===n||n.focus())},onClick:function(){var e;Z(),null===(e=U.current)||void 0===e||e.focus()},"aria-label":s,title:s},tn(v.i,{"data-testid":"input-delete-icon"}))),tn(Ge,{type:"submit","aria-label":i,active:Boolean(h),"data-testid":"header-search-form-submit-button",inputFocused:e.isDesktop&&H,onKeyDown:function(n){return function(e,n,t,r,o,a,c,i){"Tab"===e.key&&""===n&&(a||c||i)&&(t(),r(!0),o&&o()),"Tab"!==e.key||""!==n||a&&c&&i||(t(),r(!1),o&&o())}(n,h,Z,L,e.externalClose,e.enableRecentSearches,e.enablePromotionalSearch,e.trendingTerms)}},""!==(null===(n=e.icon)||void 0===n?void 0:n.svgPath)?tn("svg",{width:null===(t=e.icon)||void 0===t?void 0:t.width,height:null===(r=e.icon)||void 0===r?void 0:r.height,viewBox:null===(o=e.icon)||void 0===o?void 0:o.viewBox,xmlns:"http://www.w3.org/2000/svg"},tn("path",{d:null===(a=e.icon)||void 0===a?void 0:a.svgPath,"fill-rule":"evenodd"})):tn(v.k,null))),tn(sn,Object(m.a)({},e,{instantSearchResults:y,movePastInput:function(){p(""),e.isDesktop&&l(!1,document,window),w(null),X(),L(!1),e.externalClose&&e.externalClose()},inputValue:h,correctionsIndex:O,productsIndex:B,suggestionsIndex:C,clearInput:Z,inputFocused:H,clickAway:function(){Z(),L(!1)}},e.enableRecentSearches&&{setRecentSearches:Q,enableRecentSearches:e.enableRecentSearches,recentlySRenderAnnouncerTypeearched:K,recentlySearchedTitle:e.recentlySearchedTitle,recentlySearchedText:e.recentlySearchedText,onClick:nn,clearRecentSearch:e.clearRecentSearch,onClickSearchSuggestions:function(e){return en(e)}},{promotionalProducts:e.promotionalProducts,enablePromotionalSearch:e.enablePromotionalSearch,trendingTerms:e.trendingTerms,enableTrendingSearch:e.enableTrendingSearch,onClickSearchComponent:function(n){e.enableRecentSearches&&en(n)},displaySocialEngagement:e.displaySocialEngagement})),G&&e.renderAnnouncer("assertive",G))},cn=function(e){var n="undefined"!==typeof document&&document?document.documentElement.clientWidth:0;return tn(Ze,null,tn(Me,{pageWidth:n,cutBottom:y.a,slimHeader:e.slimHeader,style:{overflow:"auto"},paddingTop:e.isDesktop?0:2},e.enableRecentSearches&&e.recentlySearched&&e.recentlySearched.length>0&&tn(V,Object(m.a)({recentlySearched:e.recentlySearched,recentlySearchedTitle:e.recentlySearchedTitle,recentlySearchedText:e.recentlySearchedText,onClick:nn,clearRecentSearch:e.clearRecentSearch},!e.enablePromotionalSearch&&!e.trendingTerms&&{movePastInput:e.movePastInput},{removeIndividualSearch:function(n){!function(e,n){var t=JSON.parse(T.get("recentlySearchedProducts")).filter((function(n){return n.itemName!==e}));T.set("recentlySearchedProducts",JSON.stringify(t)),n&&n(t)}(n,e.setRecentSearches)}})),tn(rn,{promotionalProducts:e.promotionalProducts,enablePromotionalSearch:e.enablePromotionalSearch,trendingTerms:e.trendingTerms,movePastInput:e.movePastInput,onClickSearchComponent:e.onClickSearchComponent,enableTrendingSearch:e.enableTrendingSearch})))},sn=function(e){var n=f.useState(null),t=Object(b.a)(n,2),r=t[0],o=t[1];f.useEffect((function(){o(e.instantSearchResults)}),[e.instantSearchResults]);var a,c,i,s,l,d,u=(a=e.enableTrendingSearch,c=e.enablePromotionalSearch,i=e.enableRecentSearches,s=e.inputFocused,l=e.inputValue,d=e.displaySocialEngagement,(a||c||i)&&(s||d)&&(!l||(null===l||void 0===l?void 0:l.length)<=2));return tn(I.a,null,tn(f.Fragment,null,r&&!u&&tn(Ye,{shouldDisplay:Boolean(e.inputValue&&e.instantSearchResults),isDesktop:e.isDesktop,searchResults:r,searchI18nText:e.searchI18nText,autocompleteLink:e.autocompleteLink,inputValue:e.inputValue,correctionsIndex:e.correctionsIndex,suggestionsIndex:e.suggestionsIndex,productsIndex:e.productsIndex,clearInput:e.clearInput,movePastInput:e.movePastInput,rrpText:e.searchI18nText.rrpText,freeText:e.searchI18nText.freeText,fromText:(null===e||void 0===e?void 0:e.showOutOfStockVariants)?e.searchI18nText.fromText:"",mobileSearch:e.mobileSearch,slimHeader:e.slimHeader,showPowerReview:e.showPowerReview,onClickSearchSuggestions:e.onClickSearchSuggestions&&e.onClickSearchSuggestions})),u&&tn(cn,{inputFocused:e.inputFocused,inputValue:e.inputValue,isDesktop:e.isDesktop,slimHeader:e.slimHeader,movePastInput:e.movePastInput,recentlySearched:e.recentlySearched,recentlySearchedTitle:e.recentlySearchedTitle,recentlySearchedText:e.recentlySearchedText,clearRecentSearch:e.clearRecentSearch,enablePromotionalSearch:e.enablePromotionalSearch,trendingTerms:e.trendingTerms,setRecentSearches:e.setRecentSearches,promotionalProducts:e.promotionalProducts,onClickSearchComponent:e.onClickSearchComponent,enableRecentSearches:e.enableRecentSearches,enableTrendingSearch:e.enableTrendingSearch}),e.isDesktop&&e.inputFocused&&tn(Xe,{onClick:e.clickAway,onTouchStart:e.clickAway,key:"search-overlay","data-testid":"search-overlay",variants:{enter:{opacity:0},center:{opacity:1},exit:{opacity:0}},initial:"enter",animate:"center",exit:"exit",transition:{ease:"easeInOut",duration:.3}}))},ln=f.createElement,dn=S.b.div(pe||(pe=Object(g.a)(["\n ","\n"])),(function(e){return e.removePadding?"\n border-bottom: ".concat(e.theme.patterns.header.navigation.borderBottom,";\n\n form {\n border: none;\n }"):"padding: ".concat(Object(w.i)(2),";\n background-color: ").concat(e.theme.colors.palette.greys.lighter,";")})),un=S.b.div(be||(be=Object(g.a)(["\n visibility: ",";\n\n "," {\n visibility: visible;\n }\n"])),(function(e){return e.mobileVisible?"visible":"hidden"}),(function(e){return Object(x.d)(e.theme.breakpointUtils.map,"lg")})),hn=S.b.div(me||(me=Object(g.a)(["\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n\n svg {\n fill: ",";\n }\n"])),(function(e){return e.theme.patterns.header.search.mobileIcon.color})),pn=function(e){var n=Object(y.b)();return ln(dn,{removePadding:e.showExposedSearch},ln(an,Object(m.a)({setScrollLock:n,placeholder:e.headerSearchI18nText.placeholder,searchButtonAriaLabel:e.headerSearchI18nText.searchButtonAriaLabel,clearAriaLabel:e.headerSearchI18nText.clearAriaLabel,isDesktop:!e.isMobile,InstantSearchInjector:e.InstantSearchInjector,searchI18nText:e.searchI18nText,onSubmit:e.onSubmit,autocompleteLink:e.autocompleteLink,renderAnnouncer:e.renderAnnouncer,currency:e.currency,shippingDestination:e.shippingDestination,externalClose:e.close,icon:e.mobileIcon,concessionCode:e.concessionCode,onFocus:e.onFocus,mobileSearch:e.mobileSearch,slimHeader:e.slimHeader,focusOnMount:e.focusOnMount,vipPriceEnabled:null===e||void 0===e?void 0:e.vipPriceEnabled,showPowerReview:e.showPowerReview,showOutOfStockVariants:null===e||void 0===e?void 0:e.showOutOfStockVariants,showPriceForDisplayedVariant:null===e||void 0===e?void 0:e.showPriceForDisplayedVariant},e.enableRecentSearches&&{enableRecentSearches:e.enableRecentSearches,recentlySearchedTitle:e.recentlySearchedTitle,recentlySearchedText:e.recentlySearchedText,clearRecentSearch:e.clearRecentSearch},e.promotionalProducts&&{promotionalProducts:e.promotionalProducts},{enablePromotionalSearch:e.enablePromotionalSearch,trendingTerms:e.trendingTerms,enableTrendingSearch:e.enableTrendingSearch,displaySocialEngagement:e.displaySocialEngagement})))},bn=function(e){var n,t,r,o,a,c=f.useState(!1),i=Object(b.a)(c,2),s=i[0],l=i[1],d=f.useState(!1),u=Object(b.a)(d,2),h=u[0],p=u[1],g=Object(y.b)();return f.useEffect((function(){s&&l(!1),g(!1,document,window)}),[e.isMobile]),e.isMobile||e.mobileSearch?ln(k.a,{dropdownType:H.a.SEARCH,tabIndex:e.isMobile?3:e.mobileSearch?void 0:0,i18nAriaLabels:{close:e.triggerAriaLabels.close,trigger:e.triggerAriaLabels.search},isMobile:e.isMobile||e.mobileSearch,isDesktop:!e.isMobile,dropdownWidth:e.mobileSearch?"470px":void 0,trigger:{icon:ln(hn,{"data-testid":"search-icon-wrapper"},""!==(null===(n=e.mobileIcon)||void 0===n?void 0:n.svgPath)?ln("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:null===(t=e.mobileIcon)||void 0===t?void 0:t.viewBox,height:null===(r=e.mobileIcon)||void 0===r?void 0:r.height,width:null===(o=e.mobileIcon)||void 0===o?void 0:o.width},ln("path",{d:null===(a=e.mobileIcon)||void 0===a?void 0:a.svgPath,"fill-rule":"evenodd"})):ln(v.k,null)),text:"",triggerHref:""},disableFocusLogic:!0,disableAnimation:!0,content:function(n){return ln(pn,Object(m.a)({close:n,focusOnMount:!1,displaySocialEngagement:h},e))},mobileSearch:e.mobileSearch,setDisplaySocialEngagement:p}):ln(un,{mobileVisible:e.showExposedSearch},ln(an,Object(m.a)({setScrollLock:g,placeholder:e.headerSearchI18nText.placeholder,searchButtonAriaLabel:e.headerSearchI18nText.searchButtonAriaLabel,clearAriaLabel:e.headerSearchI18nText.clearAriaLabel,isDesktop:!e.isMobile||!e.mobileSearch,InstantSearchInjector:e.InstantSearchInjector,searchI18nText:e.searchI18nText,onSubmit:e.onSubmit,autocompleteLink:e.autocompleteLink,renderAnnouncer:e.renderAnnouncer,currency:e.currency,shippingDestination:e.shippingDestination,icon:e.mobileIcon,onFocus:e.onFocus,mobileSearch:e.mobileSearch,slimHeader:e.slimHeader,vipPriceEnabled:e.vipPriceEnabled,showPowerReview:e.showPowerReview,showOutOfStockVariants:e.showOutOfStockVariants,showPriceForDisplayedVariant:e.showPriceForDisplayedVariant},e.enableRecentSearches&&{enableRecentSearches:e.enableRecentSearches,recentlySearchedTitle:e.recentlySearchedTitle,recentlySearchedText:e.recentlySearchedText,clearRecentSearch:e.clearRecentSearch},{promotionalProducts:e.promotionalProducts,enablePromotionalSearch:e.enablePromotionalSearch,trendingTerms:e.trendingTerms,enableTrendingSearch:e.enableTrendingSearch,displaySocialEngagement:h})))}}}]); //# sourceMappingURL=41.7dca8e672c640191729c.js.map