"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1834],{56913:function(e,t,n){n.d(t,{ix:function(){return o},nS:function(){return r}});var i=n(7002),o=function(e,t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=(0,i.Z)("endpoint.assets")||"https://www-europe.nissan-cdn.net";if(1===n.length){var r,a,l=(r=n[0],a=(e("dynamicHeroModelCode")||[]).indexOf(r),function(t,n){var i=e(t)||[],o=e(n)||[];return -1!==a?i[a]:null==o?void 0:o[a]});return{title:t("dynamicHeroTitles")?l("dynamicHeroTitles","genericHeroTitle"):"genericHeroTitle",subtitle:l("dynamicHeroDescriptions","genericHeroDescription"),url:"".concat(o).concat(l("dynamicHeroModelImagesDesktop","genericHeroImageDesktop")),mobileUrl:"".concat(o).concat(l("dynamicHeroAreaModelImagesMobile","genericHeroImageMobile"))}}return{title:t("genericHeroTitle")?e("genericHeroTitle"):"",subtitle:t("genericHeroDescription")?e("genericHeroDescription"):"",url:"".concat(o).concat(e("genericHeroImageDesktop")),mobileUrl:"".concat(o).concat(e("genericHeroImageMobile"))}}},r=function(e,t){var n=(0,i.Z)("endpoint.assets")||"https://www-europe.nissan-cdn.net";return[{icon:"".concat(n).concat(e("plpHeroStepOneIcon")),subtitle:t("plpHeroStepOne")?e("plpHeroStepOne"):""},{icon:"".concat(n).concat(e("plpHeroStepTwoIcon")),subtitle:t("plpHeroStepTwo")?e("plpHeroStepTwo"):""},{icon:"".concat(n).concat(e("plpHeroStepThreeIcon")),subtitle:t("plpHeroStepThree")?e("plpHeroStepThree"):""},{icon:"".concat(n).concat(e("plpHeroStepFourIcon")),subtitle:t("plpHeroStepFour")?e("plpHeroStepFour"):""}]}},52692:function(e,t,n){n.d(t,{Z:function(){return p}});var i=n(67294),o=n(95637),r=n(27638),a=n(19521),l=a.default.div.withConfig({displayName:"PageLoaderstyles__Loader",componentId:"sc-s6wq19-0"})(["display:",";visibility:",";flex-direction:column;align-items:center;justify-content:flex-start;position:fixed;top:0;width:100vw;height:100vh;background:white;z-index:80;overflow:hidden;h2{margin-top:56px;font-family:'Nissan Regular';font-weight:400;margin-bottom:40px;width:100%;text-align:center;@media screen and (min-width:960px){margin-top:105px;}}button{background:transparent !important;padding:0;color:black !important;width:100%;div{div{background:black;}}}"],function(e){return e.isLoading?"flex":"none"},function(e){return e.isLoading?"visible":"hidden"}),c=a.default.div.withConfig({displayName:"PageLoaderstyles__Container",componentId:"sc-s6wq19-1"})(["margin-top:171px;"]),s=a.default.div.withConfig({displayName:"PageLoaderstyles__Placeholder",componentId:"sc-s6wq19-2"})(["display:",";visibility:",";background:white;width:100%;z-index:99;height:105px;"],function(e){return e.isLoading?"flex":"none"},function(e){return e.isLoading?"visible":"hidden"}),d=n(85893),u=function(e){var t=e.className,n=e.isLoading,a=e.noTitle,u=e.placeholder,p=e.withScroll,f=void 0!==p&&p,h=(0,r.Z)().t;return(0,i.useEffect)(function(){return n&&!f?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[n,f]),(0,d.jsxs)(d.Fragment,{children:[u&&(0,d.jsx)(s,{isLoading:n}),(0,d.jsx)(l,{className:t,isLoading:n,children:(0,d.jsxs)(c,{children:[!a&&(0,d.jsx)(o.Text,{variant:"heading2",fontWeight:"400",label:h("loadingAdditionalText"),type:"h2"}),(0,d.jsx)(o.Button,{buttonType:"primary",label:h("loadingText"),isLoading:!0})]})})]})};u.defaultProps={className:"",noTitle:!1,placeholder:!0};var p=u},24706:function(e,t,n){n.d(t,{Ko:function(){return a},LH:function(){return p},Tj:function(){return u},y5:function(){return c},yC:function(){return l}});var i=n(59499);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.filter(function(e){return e.enabled}).map(function(n){var i=n.sortBy;return{label:e(i),value:i,selected:i===t}})}},l=function(e,t){return!!e&&!!t&&t.includes(e)},c=function(e,t,n,i){var o=e||{},r=o.fueltypes,a=o.modelCodes,l=o.grades,c=o.location,s=o.colorCodes,d=o.gearboxes,u=o.maxPayload,p=o.minPayload,f=o.maxLength,h=o.minLength,v=o.maxHeight,g=o.minHeight,m=o.maxWidth,y=o.minWidth,b=o.maxCargoVolume,x=o.minCargoVolume,C=(void 0===s?[]:s).map(function(e){var t;return(null==i||null===(t=i.find(function(t){return t.code===e}))||void 0===t?void 0:t.label)||e});return[{key:"fueltypes[]",values:void 0===r?[]:r},{key:"modelCodes[]",values:(void 0===a?[]:a).map(function(e){return"".concat(t("modelFilterLabel").charAt(0).toUpperCase()+t("modelFilterLabel").toLowerCase().slice(1),": ").concat(e)})},{key:"grades[]",values:(void 0===l?[]:l).map(function(e){return"".concat(t("gradeFilter").charAt(0).toUpperCase()+t("gradeFilter").toLowerCase().slice(1),": ").concat(e)})},{key:"colorCodes[]",values:C},{key:"gearboxes[]",values:void 0===d?[]:d},{key:"location",values:c?[n]:[]},{key:"minWidth",values:y&&m?["".concat(t("totalWidthFilterLabel"),": ").concat(y," - ").concat(m)]:[]},{key:"minLength",values:h&&f?["".concat(t("totalLenghFilterLabel"),": ").concat(h," - ").concat(f)]:[]},{key:"minHeight",values:g&&v?["".concat(t("totalHeightFilterLabel"),": ").concat(g," - ").concat(v)]:[]},{key:"minPayload",values:p&&u?["".concat(t("payloadFilterLabel"),": ").concat(p," - ").concat(u)]:[]},{key:"minCargoVolume",values:x&&b?["".concat(t("cargoVolumeFilterLabel"),": ").concat(x," - ").concat(b)]:[]}].flatMap(function(e){var t=e.key;return e.values.map(function(e){return{key:t,value:e}})})},s=function(e,t,n){var i=t.find(function(t){return t.label===e.slice("".concat(n,": ").length)});return i?i.code:e},d=function(e,t,n){var i=t.find(function(t){return t.code===e.slice("".concat(n,": ").length)});return i?"".concat(n.charAt(0).toUpperCase()+n.toLowerCase().slice(1),": ").concat(i.label):e},u=function(e,t,n){return e.flatMap(function(e){return"modelCodes[]"===e.key?[{key:"modelCodes[]",value:d(e.value,t,n)}]:e})},p=function(e,t,n,o,a,l,c,d){var u=null==e?void 0:e.value;switch(e.key){case"modelCodes[]":f=(u=s(e.value,c||[],l||"")).replace(/^.*:\s*/,""),Array.isArray(null==t?void 0:t.modelCodes)&&(u=t.modelCodes.filter(function(e){return e!==f}));break;case"grades[]":u=e.value.split(": ")[1]||e.value;break;case"colorCodes[]":u=(null==d||null===(p=d.find(function(t){return t.label===e.value}))||void 0===p?void 0:p.code)||e.value}if("modelCodes[]"===e.key&&f){var p,f,h,v=(null==t||null===(h=t.modelCodes)||void 0===h?void 0:h.filter(function(e){return e===f}))||[],g=r(r({},t),{},{modelCodes:v});["dealerId","location","minWidth","maxWidth","minPayload","maxPayload","minCargoVolume","maxCargoVolume","minLength","maxLength","minHeight","maxHeight"].forEach(function(e){return delete g[e]}),null==a||a("plp-side-bar-model-filter-clear-all",g)}else if(["fueltypes[]","grades[]","colorCodes[]","gearboxes[]"].includes(e.key)){var m=new Map([["fueltypes[]","fueltype"],["grades[]","grade"],["colorCodes[]","exteriorcolour"],["gearboxes[]","gearbox"]]);null==a||a("plp-side-bar-".concat(m.get(e.key),"-filter-clear-all"),(0,i.Z)({},e.key.replace("[]",""),[u.replace(/^.*:\s*/,"")]))}else"location"===e.key&&(null==a||a("plp-side-bar-location-unfilter"));var y={minWidth:[{name:"minWidth",value:void 0},{name:"maxWidth",value:void 0}],minLength:[{name:"minLength",value:void 0},{name:"maxLength",value:void 0}],minHeight:[{name:"minHeight",value:void 0},{name:"maxHeight",value:void 0}],minPayload:[{name:"minPayload",value:void 0},{name:"maxPayload",value:void 0}],minCargoVolume:[{name:"minCargoVolume",value:void 0},{name:"maxCargoVolume",value:void 0}]};"location"===e.key?(null==o||o([{name:"placeId",value:void 0},{name:"long",value:void 0},{name:"lat",value:void 0},{name:"radius",value:void 0}]),n(!0)):y[e.key]?null==o||o(y[e.key]):null==o||o([{name:e.key,value:u}])}},76197:function(e,t,n){n.d(t,{B$:function(){return c},BV:function(){return l},WQ:function(){return a},ZQ:function(){return s}});var i=n(96673),o=n(77878),r=n(15227),a=function(e,t){return{successUrl:(0,i.c7)(e.basePath,t("dashboard",{queryParams:{payment:"success"}})),cancelUrl:(0,i.c7)(e.basePath,"".concat(t("checkout/form"),"?paymentStatus=cancelled")),failureUrl:(0,i.c7)(e.basePath,"".concat(t("checkout/form"),"?paymentStatus=error"))}},l=function(e,t,n){return{successUrl:(0,i.c7)(e.basePath,t("dashboard",{queryParams:{payment:"success",dealerId:n}})),cancelUrl:(0,i.c7)(e.basePath,"".concat(t("accessory/checkout/payment"),"?paymentStatus=cancelled")),failureUrl:(0,i.c7)(e.basePath,"".concat(t("accessory/checkout/payment"),"?paymentStatus=error"))}},c=function(){(0,o.cl)(o.iV),(0,o.cl)(o.TE),(0,o.cl)(o.dw),(0,o.cl)(o.qX),(0,o.cl)(o.V9),(0,o.cl)(o.by),(0,o.cl)(o.lr),(0,r.cl)(r.Oo),(0,r.cl)(o.Kj)},s=function(){c(),(0,r.cl)(r.$L),(0,r.cl)(r.Ue),(0,r.cl)(r.vf),(0,r.cl)(r.xN),(0,r.cl)(r.AR),(0,o.cl)(o.AX),(0,o.cl)(o.F8),(0,o.cl)(o.c1),(0,o.cl)(o.k2),(0,o.cl)(o.cz),(0,o.cl)(o.Gv),(0,o.cl)(o.HO),(0,o.cl)(o.YA)}},48182:function(e,t,n){n.d(t,{Z:function(){return n6}});var i=n(59499),o=n(90116),r=n(67294),a=n(11163),l=n(97368),c=n(88767),s=n(43697),d=n(96673),u=n(46512),p=n(40241);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var v=function(e){var t=(0,a.useRouter)(),n=(0,u.Z)(),i=(0,r.useContext)(p.Z),o=(null==i?void 0:i.meta)||e,l=null==i?void 0:i.vehicleType,c=(0,r.useRef)(null==o?void 0:o.nextPageSearchCriteria);return(0,r.useEffect)(function(){c.current=null==o?void 0:o.nextPageSearchCriteria},[null==o?void 0:o.nextPageSearchCriteria]),{onFacetChange:function(e){var i=!!e.find(function(e){return(null==e?void 0:e.name)==="lat"&&(null==e?void 0:e.value)})&&n("makeSortByDistanceDefault"),o=(0,d.as)().placeId,r=c.current;(null==r?void 0:r.sortBy)!==s.rf||e.find(function(e){return"radius"===e.name&&e.value})||(r.sortBy=s.lt);var a=h(h(h(h({},r),i&&{sortBy:s.rf}),((null==r?void 0:r.location)||o)&&{location:h(h({},null==r?void 0:r.location),{},{placeId:o})}),!!l&&{vehicleType:l}),u=(0,s.Y5)(a,t,e);return t.push(u,void 0,{shallow:!0})}}},g=n(27638),m=n(54244),y=n(39906),b=n(10638),x=n(76328),C=n(77878),w=n(92773),j=n(27872),O=n(78519),_=n(7838),P=n(58867),k=n(59658),I=n(50029),F=n(64687),S=n.n(F),N=n(4298),L=n.n(N),T=n(64457),Z=n(95637),D=n(7002),V=n(19521),E=V.default.div.withConfig({displayName:"ModalHardGatestyles__SearchContainer",componentId:"sc-h2lehb-0"})(["margin:20px auto;"]),A=(0,V.default)(Z.Search).withConfig({displayName:"ModalHardGatestyles__CustomSearch",componentId:"sc-h2lehb-1"})(["border:1px solid rgba(0,0,0,0.25);border-radius:4px;& div div{border-bottom:0;padding:5px 8px;display:flex;}& div ul{&::-webkit-scrollbar{width:10px;}&::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px;}&::-webkit-scrollbar-thumb{background:#888;border-radius:10px;}&::-webkit-scrollbar-thumb:hover{background:#555;}}"]),B=(0,V.default)(Z.Text).withConfig({displayName:"ModalHardGatestyles__Title",componentId:"sc-h2lehb-2"})(["font-size:28px;line-height:26px;font-family:'Nissan Light';text-align:center;"]),R=(0,V.default)(Z.Text).withConfig({displayName:"ModalHardGatestyles__Description",componentId:"sc-h2lehb-3"})(["font-size:14px;line-height:26px;margin-top:24px;font-family:'Nissan Regular';text-align:center;@media screen and (min-width:960px){}"]),z=V.default.div.withConfig({displayName:"ModalHardGatestyles__CTAContainer",componentId:"sc-h2lehb-4"})(["text-align:center;"]),H=V.default.button.attrs({type:"button"}).withConfig({displayName:"ModalHardGatestyles__CTAButton",componentId:"sc-h2lehb-5"})(["margin-left:6px;font-size:14px;line-height:26px;font-family:'Nissan Regular';text-decoration:underline;background:none;border:none;"]),M=n(39658),W=n(85893),q=function(e){var t,n=e.isOpen,i=e.onClose,o=e.getLocation,l=e.resetSearchInput,s=(0,g.Z)().t,d=(0,a.useRouter)(),u=(0,c.useQueryClient)(),f=v().onFacetChange,h=(0,r.useContext)(p.Z),y=null==h?void 0:h.meta,b=d.locale,x=s("defaultSearchRadius"),w=(0,r.useState)(""),j=w[0],O=w[1],_=(0,r.useState)(),P=_[0],F=_[1];(0,r.useEffect)(function(){O("")},[l]);var N=(0,c.useQuery)(["getPlacesAutocompletedSuggestions",b,j],function(){return(0,k.Gm)(b,j)},{enabled:(0,M.dk)(j)}).data,V=(0,m.Y)(),q=(t=(0,I.Z)(S().mark(function e(t){var n,i,o,r;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=null==t?void 0:t.id,e.next=3,u.fetchQuery(["getCoordinatesFromPlaceId",n],function(){return(0,k.ck)(n)});case 3:o=(i=e.sent).lng,r=i.lat,(0,C.LS)(C.Kj,t.label),F(t),f([{name:"placeId",value:n},{name:"long",value:o},{name:"lat",value:r},{name:"radius",value:x}],y),V({action:"plp inventory search",searchType:"plp-location-popup-filter",searchTerm:"".concat(j,"|").concat(t.label)});case 10:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)});return(0,W.jsxs)(Z.Modal,{isOpen:n,close:i,isHardGate:!0,children:[(0,W.jsx)(B,{children:s("hardGateTitle")}),(0,W.jsx)(R,{children:s("hardGateDescription")}),(0,W.jsxs)(E,{children:[(0,W.jsx)(L(),{src:"https://maps.googleapis.com/maps/api/js?key=".concat((0,D.Z)("geoloc.apiKey"),"&libraries=places")}),(0,W.jsx)(A,{placeholder:s("hardGatePlaceholder"),items:(0,M.k$)(j,N),selectedItem:P,onChange:function(e){O(e.target.value)},onResultSelect:q,onClear:function(){O(""),F(null),(0,C.cl)(C.Kj),f([{name:"placeId",value:void 0},{name:"long",value:void 0},{name:"lat",value:void 0},{name:"radius",value:void 0}],y)},showNoResults:(0,M.dk)(j)&&(0,T.Z)(N),noResultsMessage:s("noMatchFound")})]}),(0,W.jsxs)(z,{children:[(0,W.jsx)(Z.Compass,{width:12,height:12}),(0,W.jsx)(H,{onClick:function(){return o(V)},children:s("hardGateGeolocalize")})]})]})};q.defaultProps={isOpen:!1,onClose:function(){},getLocation:function(){},resetSearchInput:!1};var U=n(17674),Y=n(4730),G=n(31955),K=n(59779),$=n(50637),Q=n(11223),X=function(e){var t=e.price,n=e.monthlyPrice,i=e.totalLabel,o=e.monthlyLabel;return[{label:i,value:"maxPrice",price:t,disabled:!(null!=t&&t.maxPrice)||(null==t?void 0:t.maxPrice)<=0,step:1e3,min:null==t?void 0:t.minPrice,max:null==t?void 0:t.maxPrice,currentPrice:t&&(null==t?void 0:t.currentPrice)&&(null==t?void 0:t.maxPrice)&&((null==t?void 0:t.currentPrice)>(null==t?void 0:t.maxPrice)?null==t?void 0:t.maxPrice:null==t?void 0:t.currentPrice),selected:null==t?void 0:t.selected,currencyCode:null==t?void 0:t.currencyCode},{label:o,value:"maxMonthlyPrice",monthlyPrice:n,disabled:!(null!=n&&n.maxPrice)||(null==n?void 0:n.maxPrice)<=0,step:10,min:null==n?void 0:n.minPrice,max:null==n?void 0:n.maxPrice,currentPrice:null==n?void 0:n.currentPrice,selected:null==n?void 0:n.selected,currencyCode:null==n?void 0:n.currencyCode}]},J=function(e){var t,n,i,o,r,a,l=e.options,c=void 0===l?[]:l,s=e.price,d=e.monthlyPrice;return(null===(t=c[0])||void 0===t||null===(t=t.price)||void 0===t?void 0:t.minPrice)!==(null==s?void 0:s.minPrice)||(null===(n=c[0])||void 0===n||null===(n=n.price)||void 0===n?void 0:n.maxPrice)!==(null==s?void 0:s.maxPrice)||(null===(i=c[0])||void 0===i||null===(i=i.price)||void 0===i?void 0:i.selected)!==(null==s?void 0:s.selected)||(null===(o=c[1])||void 0===o||null===(o=o.monthlyPrice)||void 0===o?void 0:o.minPrice)!==(null==d?void 0:d.minPrice)||(null===(r=c[1])||void 0===r||null===(r=r.monthlyPrice)||void 0===r?void 0:r.maxPrice)!==(null==d?void 0:d.maxPrice)||(null===(a=c[1])||void 0===a||null===(a=a.monthlyPrice)||void 0===a?void 0:a.selected)!==(null==d?void 0:d.selected)},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find(function(e){return e.selected})},et=(0,V.default)(Z.Expander).withConfig({displayName:"PriceFacetstyles__PriceExpander",componentId:"sc-1dm0ddz-0"})(["padding:"," 0;p{font-family:Nissan Regular;text-transform:capitalize;}"],Z.spacers.spacing_4),en=V.default.div.withConfig({displayName:"PriceFacetstyles__SliderContainer",componentId:"sc-1dm0ddz-1"})(["padding-top:",";"],Z.spacers.spacing_2),ei=(0,V.default)(Z.Switch).withConfig({displayName:"PriceFacetstyles__StyledSwitch",componentId:"sc-1dm0ddz-2"})(["margin:12px 0 "," 0;border-radius:4px;border:1px solid ",";"],Z.spacers.spacing_4,Z.colors.grey),eo=(0,V.default)(Z.Text).attrs({fontWeight:"light"}).withConfig({displayName:"PriceFacetstyles__Price",componentId:"sc-1dm0ddz-3"})(["padding-bottom:0;padding-top:",";text-align:right;span > span{font-size:14px;line-height:24px;}"],Z.spacers.spacing_2);function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?er(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var el=function(){var e,t,n,i,o,a,l,c=(0,g.Z)().t,s=(0,u.Z)(),d=(0,m.Z)().onEvent,f=(0,r.useContext)(p.Z),h=(0,Q.Z)(),y=v().onFacetChange,b=null==f||null===(e=f.facets)||void 0===e?void 0:e.price,x=null==f||null===(t=f.facets)||void 0===t?void 0:t.monthlyPrice,C=(null==f?void 0:f.isB2B)||!1,w=null==f?void 0:f.vatStatus,_=null==f?void 0:f.isLoadingVehiclesAndFacets,P=(0,r.useState)(!1),k=P[0],I=P[1],F=(0,r.useState)(X({price:b,monthlyPrice:x,totalLabel:c("totalPrice"),monthlyLabel:c("monthlyPrice")})),S=F[0],N=F[1];J({options:S,price:b,monthlyPrice:x})&&N(X({price:b,monthlyPrice:x,totalLabel:c("totalPrice"),monthlyLabel:c("monthlyPrice")}));var L=(0,m.Y)(),T=function(e){I(!0),N(function(t){return t.map(function(t){return ea(ea({},t),!0===t.selected?{currentPrice:e}:{})})})},D=ee(S)||{},V=function(e){var t;L({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-price-slider-filter",searchFilter:null!==(t=new Map([["maxPrice","total price"],["maxMonthlyPrice","monthly price"]]).get(D.value||""))&&void 0!==t?t:D.value,searchFilterValue:h(null!=e?e:0,D.currencyCode)}),null==y||y([{name:D.value,value:e,selected:!0}])},E=h(null!==(n=null==D?void 0:D.currentPrice)&&void 0!==n?n:0,null==D?void 0:D.currencyCode)||"";return(0,r.useEffect)(function(){_||I(!1)},[_]),(0,W.jsxs)(et,{title:c(w===j.bl?"priceFilterTextWithoutVAT":"priceFilterText"),withIcon:!0,isOpen:!0,isLoading:_&&k,children:[(0,O.KT)(C,s)&&(0,W.jsx)(ei,{options:S,selectedOption:D,onChange:function(e){I(!0);var t=ee(S);null==y||y([{name:null==t?void 0:t.value,value:void 0,selected:!1},{name:e.value,value:e.currentPrice,selected:!0}]),N(function(t){return t.map(function(t){return ea(ea({},t),{},{selected:t.value===e.value})})}),d({interactionType:"price-toggle",buttonText:"Price",locationInpage:"side-bar",interactionValue:e.label,destination:"product-list-page"})},testId:["switch-price","switch-left-price","switch-right-price"],fullRounded:!1}),(0,W.jsx)(en,{children:(0,W.jsx)(Z.Slider,{min:null!==(i=D.min)&&void 0!==i?i:0,max:null!==(o=D.max)&&void 0!==o?o:0,step:null!==(a=D.step)&&void 0!==a?a:0,value:null!==(l=D.currentPrice)&&void 0!==l?l:0,onChange:function(e){return e&&T(e)},onAfterChange:function(){var e;return V(null!==(e=null==D?void 0:D.currentPrice)&&void 0!==e?e:0)},trackStyle:"thin"})}),(0,W.jsx)(eo,{textWithHtml:w===j.bl?c("priceTitleWithoutVAT",{"price-value":E}):E})]})},ec=n(179),es=n(19302),ed=(0,V.default)(Z.Search).withConfig({displayName:"DealerSearchstyles__CustomSearch",componentId:"sc-11mvmn2-0"})(["div[role='button']{text-transform:none;}padding-top:",";"],Z.spacers.spacing_2),eu=V.default.span.withConfig({displayName:"DealerSearchstyles__DealerName",componentId:"sc-11mvmn2-1"})(["display:block;"]),ep=V.default.span.withConfig({displayName:"DealerSearchstyles__DealerInfo",componentId:"sc-11mvmn2-2"})(["display:block;font-size:12px;"]),ef=function(e){var t=e.label,n=e.city,i=e.postCode;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(eu,{children:t}),(0,W.jsxs)(ep,{children:[n,", ",i]})]})},eh=(0,r.forwardRef)(function(e,t){var n=e.dealer,i=e.className,o=e.setIsLoadingDealer,s=(0,g.Z)().t,d=(0,x.Z)(),u=(0,a.useRouter)(),p=u.locale,f=v().onFacetChange,h=(0,r.useState)(""),y=h[0],b=h[1],C=(0,r.useState)(n),w=C[0],j=C[1],O=(0,r.useState)(n),_=O[0],P=O[1],k=(0,r.useState)(!1),I=k[0],F=k[1],S=(0,c.useQuery)(["getDealer",null==w?void 0:w.dealerId],function(){return(0,ec.i6)(u.locale)(null==w?void 0:w.dealerId)},{enabled:!!I}).data;(0,r.useEffect)(function(){I&&S&&(null==f||f([{name:"dealerId",value:null==w?void 0:w.dealerId}]),F(!1))},[S,w,f,I,o]),(0,l.Z)(n,_)||(j(n),P(n));var N=(0,es.Z)(function(e){return b(e.target.value)},500),L=(0,c.useQuery)(["getDealers",p,y],function(){return(0,ec.lf)(p)(y,!0,s("plpDealerFilter"))},{enabled:(0,M.dk)(y)}).data,Z=(0,m.Z)().onEvent,D=(0,m.Y)(),V=(0,m.Y)();return(0,r.useImperativeHandle)(t,function(){return{selectedItem:w}}),(0,W.jsx)(ed,{className:i,placeholder:s("searchByDealerPlaceholder"),backLabel:s("backLabel"),items:(0,M.rP)(y,L),selectedItem:w,renderItem:ef,onChange:N,onClear:function(){b(""),j(null),null==f||f([{name:"dealerId",value:void 0},{name:"long",value:void 0},{name:"lat",value:void 0}]),V({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-dealer-unfilter",searchFilter:"dealer selection",searchFilterValue:(null==w?void 0:w.label)||""})},onResultSelect:function(e){o(!0),j(e),F(!0),null==f||f([{name:"dealerId",value:e.id}]),D({action:"plp inventory search",searchType:"plp-side-bar-dealerlocator-filter",searchTerm:y}),Z({dealerAction:"list",dealerAddress:"".concat(e.addressLine1,", ").concat(e.city,", ").concat(e.postCode),dealerId:e.dealerId,dealerName:e.label},"dealerInteraction")},showNoResults:(0,M.dk)(y)&&(0,T.Z)(L),onCancel:function(){b(""),j(null),Z({interactionType:"button-click",buttonText:s("backLabel"),destination:"plp-inventory-filters-overlay-portable-ui",locationInpage:"plp-inventory-filters-dealer-portable-ui",interactionValue:"back to filters"})},noResultsMessage:s("noMatchFound"),isMobile:d})});eh.displayName="DealerSearch";var ev=["name"];function eg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var em=function(e){if(e)return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eg(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({label:e.name},(0,Y.Z)(e,ev))},ey=(0,r.forwardRef)(function(e,t){var n,i,o=e.className,l=e.setIsLoadingDealer,s=(0,a.useRouter)(),d=(0,r.useContext)(p.Z),u=(null==d||null===(n=d.facets)||void 0===n||null===(n=n.dealer)||void 0===n?void 0:n.dealerId)||(null===(i=s.query)||void 0===i?void 0:i.dealerId),f=(0,c.useQuery)(["getDealer",u],function(){return(0,ec.i6)(s.locale)(u)},{enabled:!!u}).data;return(0,W.jsx)(eh,{className:o,dealer:em(f),ref:t,setIsLoadingDealer:l})});ey.displayName="DealerFetcher";var eb=n(53456),ex=(0,V.default)(Z.Search).withConfig({displayName:"GeolocSearchstyles__CustomSearch",componentId:"sc-oi0rm5-0"})(["padding-top:",";div[role='button']{text-transform:none;}input{font-family:Nissan Light;}"],Z.spacers.spacing_2),eC=V.default.div.withConfig({displayName:"GeolocSearchstyles__Container",componentId:"sc-oi0rm5-1"})([""]),ew=(0,V.default)(Z.Text).attrs({type:"p"}).withConfig({displayName:"GeolocSearchstyles__RadiusLabel",componentId:"sc-oi0rm5-2"})(["padding:"," 0px "," 0px;"],Z.spacers.spacing_4,Z.spacers.spacing_3),ej=(0,V.default)(Z.Text).attrs({type:"p",fontWeight:"light"}).withConfig({displayName:"GeolocSearchstyles__RadiusValue",componentId:"sc-oi0rm5-3"})(["padding-top:",";text-align:right;"],Z.spacers.spacing_2),eO=(0,r.forwardRef)(function(e,t){var n,i,o=e.className,l=e.placeId,s=e.setIsLoadingDealer,d=(0,x.Z)(),u=(0,g.Z)().t,f=(0,a.useRouter)(),h=(0,c.useQueryClient)(),y=(0,r.useContext)(p.Z),b=v().onFacetChange,j=(0,eb.C)(),O=(0,m.Z)().onEvent,_=null==y||null===(i=y.facets)||void 0===i?void 0:i.location,P=null==y?void 0:y.resetLocation,F=null==_?void 0:_.radius,N=f.locale,V=u("defaultSearchRadius"),E=(0,r.useState)(""),A=E[0],B=E[1],R=(0,r.useState)(),z=R[0],H=R[1],q=(0,r.useState)(F||V),U=q[0],Y=q[1],G=(0,r.useState)(),K=G[0],$=G[1],Q=(0,es.Z)(function(e){return B(e.target.value)},500),X=(0,c.useQuery)(["getPlacesAutocompletedSuggestions",N,A],function(){return(0,k.Gm)(N,A)},{enabled:(0,M.dk)(A)}).data;(0,r.useEffect)(function(){var e,t=l,n=(e=(0,I.Z)(S().mark(function e(){var n,i,o;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s(!0),!(!t&&f.query.lat&&f.query.long)){e.next=12;break}return e.prev=2,e.next=5,(0,k._7)(Number(f.query.lat),Number(f.query.long));case 5:t=null==(n=e.sent)?void 0:n.place_id,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),w.Z.error("something went wrong with getPlace - error => ",e.t0);case 12:if(!t){e.next=26;break}return e.prev=13,e.next=16,h.fetchQuery(["getCoordinatesFromPlaceId",t],function(){return(0,k.ck)(t)});case 16:i=e.sent.description,o=(0,M.p0)(i),H({id:t,label:o}),(0,C.LS)(C.Kj,o),e.next=26;break;case 23:e.prev=23,e.t1=e.catch(13),w.Z.error("something went wrong with getCoordinatesFromPlaceId - error => ",e.t1);case 26:s(!1);case 27:case"end":return e.stop()}},e,null,[[2,9],[13,23]])})),function(){return e.apply(this,arguments)});j&&""===A&&n()},[f.query,j]);var J=(0,m.Y)(),ee=(0,m.Y)(),et=(n=(0,I.Z)(S().mark(function e(t){var n,i,o,r;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),n=null==t?void 0:t.id,e.next=4,h.fetchQuery(["getCoordinatesFromPlaceId",n],function(){return(0,k.ck)(n)});case 4:o=(i=e.sent).lng,r=i.lat,(0,C.LS)(C.Kj,t.label),H(t),null==b||b([{name:"placeId",value:n},{name:"long",value:o},{name:"lat",value:r},{name:"radius",value:U}]),$({lat:r,long:o}),J({action:"plp inventory search",searchType:"plp-side-bar-location-filter",searchTerm:"".concat(A,"|").concat(t.label)});case 12:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)}),en=(0,r.useCallback)(function(){B(""),H(void 0),Y(V),(0,C.cl)(C.Kj),P||null==b||b([{name:"placeId",value:void 0},{name:"long",value:void 0},{name:"lat",value:void 0},{name:"radius",value:void 0}])},[V,b,P]),ei=(0,m.Y)();(0,r.useEffect)(function(){P&&en()},[en,P]);var eo=function(e){s(!0),Y(e)},er=function(e){if(s(!0),d){var t,n;null==b||b([{name:"radius",value:200===e?void 0:e},{name:"long",value:null!=K&&K.long?null==K?void 0:K.long:null==y||null===(t=y.facets)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.long},{name:"lat",value:null!=K&&K.lat?null==K?void 0:K.lat:null==y||null===(n=y.facets)||void 0===n||null===(n=n.location)||void 0===n?void 0:n.lat},{name:"placeId",value:null!=z&&z.id?z.id:l}])}else null==b||b([{name:"radius",value:200===e?void 0:e}]);ee({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-distance-filter",searchFilter:"distance",searchFilterValue:"".concat(e).concat(200===e?" + ":" ").concat(u("distanceUnitLabel")[0])})};return(0,r.useImperativeHandle)(t,function(){return{selectedItem:z}}),(0,W.jsxs)(eC,{className:o,children:[(0,W.jsx)(L(),{src:"https://maps.googleapis.com/maps/api/js?key=".concat((0,D.Z)("geoloc.apiKey"),"&libraries=places")}),(0,W.jsx)(ex,{placeholder:u("postcode"),backLabel:u("backLabel"),items:(0,M.k$)(A,X),selectedItem:z,onChange:Q,onResultSelect:et,onClear:function(){en(),ei({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-location-unfilter",searchFilter:"location selection",searchFilterValue:(null==z?void 0:z.label)||""})},showNoResults:(0,M.dk)(A)&&((0,T.Z)(X)||!X),noResultsMessage:u("noMatchFound"),isMobile:d,onCancel:function(){O({interactionType:"button-click",buttonText:u("backLabel"),destination:"plp-inventory-filters-overlay-portable-ui",locationInpage:"plp-inventory-filters-location-portable-ui",interactionValue:"back to filters"})}}),z&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ew,{children:u("maxDistanceLabel")}),(0,W.jsx)(Z.Slider,{min:5,max:200,step:10,value:U,onChange:function(e){return e&&eo(e)},onAfterChange:function(){return er(U)},trackStyle:"thin"}),(0,W.jsxs)(ej,{children:[(0,W.jsx)("span",{children:U}),200===U?" + ":" ",u("distanceUnitLabel")[0]]})]})]})});eO.displayName="GeolocSearch";var e_=(0,V.default)(Z.Expander).withConfig({displayName:"DealerFacetstyles__DealerExpander",componentId:"sc-1rvua1v-0"})(["padding:"," 0;p{font-family:Nissan Regular;text-transform:capitalize;}"],Z.spacers.spacing_4),eP=(0,V.default)(Z.Switch).withConfig({displayName:"DealerFacetstyles__StyledSwitch",componentId:"sc-1rvua1v-1"})(["margin:12px 0 "," 0;border-radius:4px;border:1px solid ",";"],Z.spacers.spacing_4,Z.colors.grey),ek=function(){var e,t=(0,g.Z)().t,n=(0,m.Z)().onEvent,i=(0,u.Z)(),o=(0,a.useRouter)(),l=(0,x.Z)(),c=v().onFacetChange,s=((0,r.useContext)(p.Z)||{}).isLoadingVehiclesAndFacets,f=(0,r.useRef)(null),h=(0,r.useRef)(null),y=(0,m.Y)(),b=[{label:t("locationText"),value:"location"},{label:t("dealerSearch"),value:"dealer"}],C=(0,r.useState)(null!==(e=o.query)&&void 0!==e&&e.dealerId?b[1]:b[0]),w=C[0],j=C[1],O=(0,r.useState)(!1),_=O[0],P=O[1],k=((0,d.as)()||{}).placeId;return(0,r.useEffect)(function(){s||P(!1)},[s]),(0,W.jsxs)(e_,{title:t("searchByText"),withIcon:!0,isOpen:!0,isLoading:s&&_,children:[i("plp_dealer_search")&&(0,W.jsx)(eP,{options:b,selectedOption:w,onChange:function(e){if(P(!0),j(e),!l){var t,i,o,r;null==c||c([{name:"dealerId",value:void 0},{name:"placeId",value:void 0},{name:"long",value:void 0},{name:"lat",value:void 0},{name:"radius",value:void 0}]),"dealer"===e.value&&null!==(t=f.current)&&void 0!==t&&t.selectedItem&&y({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-location-unfilter",searchFilter:"location selection",searchFilterValue:(null===(o=f.current)||void 0===o||null===(o=o.selectedItem)||void 0===o?void 0:o.label)||""}),"location"===e.value&&null!==(i=h.current)&&void 0!==i&&i.selectedItem&&y({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-dealer-unfilter",searchFilter:"dealer selection",searchFilterValue:(null===(r=h.current)||void 0===r||null===(r=r.selectedItem)||void 0===r?void 0:r.label)||""})}n({interactionType:"searchby-toggle",buttonText:"Search-by",locationInpage:"side-bar",interactionValue:e.value,destination:"product-list-page"})},testId:["switch-search","switch-left-search","switch-right-search"],fullRounded:!1}),(null==w?void 0:w.value)==="location"&&(0,W.jsx)(eO,{placeId:k,ref:f,setIsLoadingDealer:P}),(null==w?void 0:w.value)==="dealer"&&(0,W.jsx)(ey,{ref:h,setIsLoadingDealer:P})]})},eI=n(25675),eF=n.n(eI),eS=V.default.div.withConfig({displayName:"CheckboxFacetsstyles__Container",componentId:"sc-14jdw41-0"})([""]),eN=V.default.div.withConfig({displayName:"CheckboxFacetsstyles__CheckboxesContainer",componentId:"sc-14jdw41-1"})(["display:flex;flex-direction:column;gap:",";margin-top:",";"],Z.spacers.spacing_4,Z.spacers.spacing_4),eL=V.default.div.withConfig({displayName:"CheckboxFacetsstyles__CheckboxContainer",componentId:"sc-14jdw41-2"})(["display:flex;align-items:center;justify-content:space-between;"]),eT=(0,V.default)(Z.Button).withConfig({displayName:"CheckboxFacetsstyles__ButtonClear",componentId:"sc-14jdw41-3"})(["text-transform:initial;margin-top:",";"],Z.spacers.spacing_4),eZ=(0,V.default)(Z.Checkbox).withConfig({displayName:"CheckboxFacetsstyles__Checkbox",componentId:"sc-14jdw41-4"})([""]),eD=function(e){var t=e.facetOptions,n=void 0===t?[]:t,i=e.onCheckboxChange,o=e.onCheckboxClear,a=(0,g.Z)().t,l=(0,r.useContext)(p.Z),c=null==n?void 0:n.some(function(e){return(null==e?void 0:e.selected)&&(null==e?void 0:e.label)!=="allModels"});return(0,W.jsxs)(eS,{children:[c&&(0,W.jsx)(eT,{label:a("plpClearFiltersLabel"),buttonType:"link",onClick:o}),(0,W.jsx)(eN,{children:!!n&&n.map(function(e){return e&&(0,W.jsxs)(eL,{children:[(0,W.jsx)(eZ,{label:a(e.label),checked:e.selected,callBack:function(){return i(e)},disabled:!e.enabled||(null==l?void 0:l.isLoadingVehiclesAndFacets)}),e.thumbnail&&(0,W.jsx)(eF(),{src:"".concat((0,D.Z)("endpoint.assets")).concat(e.thumbnail),alt:e.label,width:70,height:38})]},e.label)})})]})};function eV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function eE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eV(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eA=function(e,t){if(!Array.isArray(e))return Array.isArray(t)?t:[];if(!Array.isArray(t))return[];var n=t[0],i=t.slice(1).map(function(t){var n="";if(null!=t&&t.code){var i=t.code.toLowerCase();if((i.includes("-")||i.includes("-x-"))&&"x-trail"!==i){var o=i.split("-"),r=(0,U.Z)(o,2)[1];n=e.find(function(e){return e.toLowerCase().includes("new")&&e.toLowerCase().includes(r)})||""}else n=e.find(function(e){return e.toLowerCase().includes(i)})||"";return eE(eE({},t),{},{thumbnail:n})}return t});return[n].concat((0,o.Z)(i))},eB=(0,V.default)(Z.Expander).withConfig({displayName:"ModelsFacetsstyles__Expander",componentId:"sc-q58f0r-0"})(["padding:"," 0;p{font-family:Nissan Regular;text-transform:capitalize;}"],Z.spacers.spacing_4);function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ez(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eH=function(){var e,t=(0,g.Z)(),n=t.t,i=t.tOrEmpty,a=(0,r.useContext)(p.Z),l=v().onFacetChange,c=(0,m.Y)(),s=(0,m.Y)(),d=null==a||null===(e=a.facets)||void 0===e?void 0:e.models,u=null==a?void 0:a.isLoadingVehiclesAndFacets,f=(0,r.useState)(d),h=f[0],y=f[1],b=(0,r.useState)(!1),x=b[0],C=b[1],w=i("overrideModelsName");(0,r.useEffect)(function(){if(d){var e=null==d?void 0:d.some(function(e){return e.selected}),t=d.map(function(e){return ez(ez({},e),{},{label:(0,_.aB)(null==e?void 0:e.label,w)})});y([{label:"allModels",enabled:!1,selected:!e}].concat((0,o.Z)(t)))}},[w,d]),(0,r.useEffect)(function(){u||C(!1)},[u]);var j=h&&eA(n("plpFiltersThumbnailsPath"),h);return(0,W.jsx)(eB,{title:n("modelFilterLabel"),withIcon:!0,isOpen:!0,isLoading:u&&x,children:(0,W.jsx)(eD,{facetOptions:j,onCheckboxChange:function(e){C(!0);var t=h&&h.map(function(t){return t.code===e.code?ez(ez({},t),{},{selected:!t.selected}):"allModels"===t.label?ez(ez({},t),{},{selected:!1}):t}),n=t.filter(function(e){return e.selected}).map(function(e){return e.code});y(t),null==l||l([{name:"modelCodes[]",value:n}]),c({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-checkbox-filter",searchFilter:"model ".concat(e.selected?"deselected":"selected"),searchFilterValue:e.label})},onCheckboxClear:function(){C(!0);var e=d&&d.map(function(e){return ez(ez({},e),{},{selected:!1})});y([{label:"allModels",enabled:!1,selected:!0}].concat((0,o.Z)(e)));var t=(null==h?void 0:h.filter(function(e){return e.selected}))||[];s({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-model-filter-clear-all",searchFilter:(0,o.Z)(Array(t.length)).fill("model").join(","),searchFilterValue:null==t?void 0:t.map(function(e){return e.label}).join(",")}),null==l||l([{name:"modelCodes[]",value:[]}])}})})},eM=V.default.div.withConfig({displayName:"BottomFacetsstyles__Container",componentId:"sc-lbnhwa-0"})([""]),eW=(0,V.default)(Z.Expander).withConfig({displayName:"BottomFacetsstyles__Expander",componentId:"sc-lbnhwa-1"})(["padding:"," 0;p{text-transform:lowercase;font-family:Nissan Regular;&:first-letter{text-transform:uppercase;}}"],Z.spacers.spacing_4);function eq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function eU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eq(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eY=function(e,t,n,i){var a=(0,r.useState)(e||[]),l=a[0],c=a[1],s=(0,r.useState)(!1),d=s[0],u=s[1],p=v().onFacetChange;(0,r.useEffect)(function(){c(e||[])},[e]),(0,r.useEffect)(function(){t||u(!1)},[t]);var f=(0,m.Y)(),h=(0,m.Y)();return{facetState:l,setFacetState:c,isLoadingFacet:d,setIsLoadingFacet:u,handleCheckboxChange:function(e,t){u(!0),c(l&&l.map(function(t){return t.label===e.label?eU(eU({},t),{},{selected:!t.selected}):t})),null==p||p([{name:"".concat(n),value:t}]),f({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-checkbox-filter",searchFilter:"".concat(i," ").concat(e.selected?"deselected":"selected"),searchFilterValue:e.label})},handleCheckboxClear:function(){u(!0),c(l&&l.map(function(e){return eU(eU({},e),{},{selected:!1})})),null==p||p([{name:"".concat(n),value:[]}]);var e=(null==l?void 0:l.filter(function(e){return e.selected}))||[];h({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-".concat(i,"-filter-clear-all"),searchFilter:(0,o.Z)(Array(e.length)).fill(i).join(","),searchFilterValue:e.map(function(e){return e.label}).join(",")})}}},eG=function(e){return["expander-".concat(e),"expander-title-".concat(e),"expander-results-".concat(e),"expander-content-".concat(e)]},eK=V.default.ul.withConfig({displayName:"ColorsFacetstyles__List",componentId:"sc-1cuw1cy-0"})(["display:flex;flex-wrap:wrap;list-style-type:none;margin:0 -10px;padding-top:",";padding-bottom:6px;"],Z.spacers.spacing_4),e$=V.default.li.withConfig({displayName:"ColorsFacetstyles__ListItem",componentId:"sc-1cuw1cy-1"})(["margin:15px 14px 2px 12px;"]),eQ=function(){var e,t=(0,g.Z)().t,n=(0,r.useContext)(p.Z),i=null==n||null===(e=n.facets)||void 0===e?void 0:e.colors,o=null==n?void 0:n.isLoadingVehiclesAndFacets,a=eY(i,o,"colorCodes[]","exteriorcolour"),l=a.facetState,c=a.isLoadingFacet,s=a.handleCheckboxChange,d=a.handleCheckboxClear,u=function(e){var t=l.find(function(t){return t.code===e});t&&s(t,t.code)},f=null==l?void 0:l.some(function(e){return e.selected});return(0,W.jsxs)(eW,{title:t("exteriorColourFilter"),withIcon:!0,isOpen:!0,testId:eG("color"),isLoading:o&&c,children:[f&&(0,W.jsx)(eT,{label:t("plpClearFiltersLabel"),buttonType:"link",onClick:function(){return d()}}),(0,W.jsx)(eK,{"data-testid":"facets-colors",children:l&&(null==l?void 0:l.filter(function(e){return e.enabled}).map(function(e){var t=e.code,n=e.label,i=e.cssBackground,o=e.selected;return(0,W.jsx)(e$,{children:(0,W.jsx)(Z.ColorButton,{code:t,label:n,cssBackground:i,selected:o,onClick:u})},t)}))})]})},eX=function(){var e,t=(0,g.Z)().t,n=(0,r.useContext)(p.Z),i=null==n||null===(e=n.facets)||void 0===e?void 0:e.fueltypes,o=null==n?void 0:n.isLoadingVehiclesAndFacets,a=eY(i,o,"fueltypes[]","fueltype"),l=a.facetState,c=a.isLoadingFacet,s=a.handleCheckboxChange,d=a.handleCheckboxClear;return(0,W.jsx)(eW,{title:t("fuelTypeFilter"),withIcon:!0,isOpen:!0,testId:eG("fueltypes"),isLoading:o&&c,children:(0,W.jsx)(eD,{facetOptions:l,onCheckboxChange:function(e){return s(e,e.label)},onCheckboxClear:function(){return d()}})})},eJ=function(){var e,t=(0,g.Z)().t,n=(0,r.useContext)(p.Z),i=null==n||null===(e=n.facets)||void 0===e?void 0:e.gearboxes,o=null==n?void 0:n.isLoadingVehiclesAndFacets,a=eY(i,o,"gearboxes[]","gearbox"),l=a.facetState,c=a.isLoadingFacet,s=a.handleCheckboxChange,d=a.handleCheckboxClear;return(0,W.jsx)(eW,{title:t("gearbox"),withIcon:!0,isOpen:!0,testId:eG("gearboxes"),isLoading:o&&c,children:(0,W.jsx)(eD,{facetOptions:l,onCheckboxChange:function(e){return s(e,e.label)},onCheckboxClear:function(){return d()}})})},e0=function(){var e,t=(0,g.Z)().t,n=(0,r.useContext)(p.Z),i=null==n||null===(e=n.facets)||void 0===e?void 0:e.grades,o=null==n?void 0:n.isLoadingVehiclesAndFacets,a=eY(i,o,"grades[]","grade"),l=a.facetState,c=a.isLoadingFacet,s=a.handleCheckboxChange,d=a.handleCheckboxClear;return(0,W.jsx)(eW,{title:t("gradeFilter"),withIcon:!0,isOpen:!0,testId:eG("grades"),isLoading:o&&c,children:(0,W.jsx)(eD,{facetOptions:l,onCheckboxChange:function(e){return s(e,e.label)},onCheckboxClear:function(){return d()}})})},e1=n(63649);function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function e5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var e6=function(e){var t={thin:{top:"6px",height:"1px",color:"#cccccc"},large:{top:"6px",height:"1px",color:"#EFEFEF"}};return t[e]||t.large},e3=V.default.div.withConfig({displayName:"DoubleSliderstyles__Container",componentId:"sc-hu0fit-0"})(["margin-top:",";"],Z.spacers.spacing_4),e4=(0,V.default)(e1.Z).withConfig({displayName:"DoubleSliderstyles__Slider",componentId:"sc-hu0fit-1"})(["width:100%;div{paddin-top:",";}"],Z.spacers.spacing_4);(0,V.default)(Z.Expander).withConfig({displayName:"DoubleSliderstyles__Expander",componentId:"sc-hu0fit-2"})(["padding:"," 0;"],Z.spacers.spacing_4);var e9=V.default.div.withConfig({displayName:"DoubleSliderstyles__StyledThumb",componentId:"sc-hu0fit-3"})(["top:-2px;width:18px;height:18px;line-height:38px;border-radius:50px;font-size:0.9em;text-align:center;background-color:black;color:white;cursor:pointer;box-sizing:border-box;"]),e7=function(e){return(0,W.jsx)(e9,e5({},e))},e8=V.default.div.withConfig({displayName:"DoubleSliderstyles__StyledTrack",componentId:"sc-hu0fit-4"})(["top:",";height:",";position:relative;background:",";"],function(e){return e6(e.trackStyle).top},function(e){return e6(e.trackStyle).height},function(e){var t=e.index,n=e.value,i=e.min,o=e.max,r=e.trackStyle;return 0===t?n[0]===i?e6(r).color:"#cccccc":1===t?"#000000":2===t?n[1]===o?e6(r).color:"#cccccc":e6(r).color}),te=function(e,t){var n=t.index,i=t.value;return(0,W.jsx)(e8,e5(e5({},e),{},{"data-testid":"slider-track-".concat(n),index:n,value:i}))};V.default.span.withConfig({displayName:"DoubleSliderstyles__Mark",componentId:"sc-hu0fit-5"})(["top:31px;font-family:'Nissan Regular';font-style:normal;font-weight:300;font-size:16px;line-height:26px;text-align:center;letter-spacing:0.9px;"]);var tt=(0,V.default)(Z.Text).withConfig({displayName:"DoubleSliderstyles__Label",componentId:"sc-hu0fit-6"})(["padding-bottom:",";"],Z.spacers.spacing_2),tn=V.default.div.withConfig({displayName:"DoubleSliderstyles__LabelContainer",componentId:"sc-hu0fit-7"})(["display:flex;justify-content:space-between;padding-top:",";"],Z.spacers.spacing_2),ti=(0,V.default)(tt).attrs({fontWeight:"light"}).withConfig({displayName:"DoubleSliderstyles__LabelFilterLeft",componentId:"sc-hu0fit-8"})(["padding-bottom:0;padding-top:",";text-align:left;"],Z.spacers.spacing_2),to=(0,V.default)(tt).attrs({fontWeight:"light"}).withConfig({displayName:"DoubleSliderstyles__LabelFilterRight",componentId:"sc-hu0fit-9"})(["padding-bottom:0;padding-top:",";text-align:right;"],Z.spacers.spacing_2);function tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tl=function(e){var t=e.min,n=e.max,i=e.onAfterChange,o=e.reset,a=void 0!==o&&o,l=(0,r.useContext)(p.Z),c=null==l?void 0:l.isLoadingVehiclesAndFacets,s=(0,r.useState)([t,n]),d=s[0],u=s[1];return(0,r.useEffect)(function(){a&&u([t,n])},[a,t,n]),(0,W.jsxs)(e3,{children:[(0,W.jsx)(e4,{min:t,max:n,value:d,renderThumb:e7,renderTrack:function(e,t){return te(ta(ta({},e),{},{values:d}),t)},onChange:function(e){e[0]>e[1]||u(e)},onAfterChange:function(e){i(e)},disabled:c}),(0,W.jsxs)(tn,{children:[(0,W.jsx)(ti,{children:d[0]}),(0,W.jsx)(to,{children:d[1]})]})]})},tc=function(){var e,t,n=(0,r.useContext)(p.Z),i=v().onFacetChange,o=(0,g.Z)().t,a=(0,m.Y)(),l=(0,r.useState)(!1),c=l[0],s=l[1],d=(null==n||null===(e=n.facets)||void 0===e?void 0:e.cargoVolume)||[0,0],u=null==n?void 0:n.isLoadingVehiclesAndFacets;return(0,r.useEffect)(function(){u||s(!1)},[u]),(0,W.jsx)(eW,{title:o("cargoVolumeFilterLabel"),withIcon:!0,isOpen:!0,isLoading:u&&c,testId:eG("cargoVolume"),children:(0,W.jsx)(tl,{min:Number(d[0]),max:Number(d[1]),onAfterChange:function(e){s(!0),null==i||i([{name:"minCargoVolume",value:e[0],selected:!0},{name:"maxCargoVolume",value:e[1],selected:!0}]),a({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-cargo-volume-filter",searchFilter:"cargo-volume",searchFilterValue:"min-".concat(e[0],":max-").concat(e[1])})},reset:!(null!=n&&null!==(t=n.selectedFacets)&&void 0!==t&&t.minCargoVolume)})})},ts=function(){var e,t,n=(0,r.useContext)(p.Z),i=v().onFacetChange,o=(0,g.Z)().t,a=(0,m.Y)(),l=(0,r.useState)(!1),c=l[0],s=l[1],d=(null==n||null===(e=n.facets)||void 0===e?void 0:e.length)||[],u=null==n?void 0:n.isLoadingVehiclesAndFacets;return(0,r.useEffect)(function(){u||s(!1)},[u]),(0,W.jsx)(eW,{title:o("totalLenghFilterLabel"),withIcon:!0,isOpen:!0,isLoading:u&&c,testId:eG("length"),children:(0,W.jsx)(tl,{min:Number(d[0]),max:Number(d[1]),onAfterChange:function(e){s(!0),null==i||i([{name:"minLength",value:e[0],selected:!0},{name:"maxLength",value:e[1],selected:!0}]),a({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-total-length-filter",searchFilter:"total-length",searchFilterValue:"min-".concat(e[0],":max-").concat(e[1])})},reset:!(null!=n&&null!==(t=n.selectedFacets)&&void 0!==t&&t.minLength)})})},td=function(){var e,t,n=(0,r.useContext)(p.Z),i=v().onFacetChange,o=(0,g.Z)().t,a=(0,m.Y)(),l=(0,r.useState)(!1),c=l[0],s=l[1],d=(null==n||null===(e=n.facets)||void 0===e?void 0:e.height)||[],u=null==n?void 0:n.isLoadingVehiclesAndFacets;return(0,r.useEffect)(function(){u||s(!1)},[u]),(0,W.jsx)(eW,{title:o("totalHeightFilterLabel"),withIcon:!0,isOpen:!0,isLoading:u&&c,testId:eG("height"),children:(0,W.jsx)(tl,{min:Number(d[0]),max:Number(d[1]),onAfterChange:function(e){s(!0),null==i||i([{name:"minHeight",value:e[0],selected:!0},{name:"maxHeight",value:e[1],selected:!0}]),a({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-total-height-filter",searchFilter:"total-height",searchFilterValue:"min-".concat(e[0],":max-").concat(e[1])})},reset:!(null!=n&&null!==(t=n.selectedFacets)&&void 0!==t&&t.minHeight)})})},tu=function(){var e,t,n=(0,r.useContext)(p.Z),i=v().onFacetChange,o=(0,g.Z)().t,a=(0,m.Y)(),l=(null==n||null===(e=n.facets)||void 0===e?void 0:e.width)||[0,0],c=null==n?void 0:n.isLoadingVehiclesAndFacets,s=(0,r.useState)(!1),d=s[0],u=s[1];return(0,r.useEffect)(function(){c||u(!1)},[c]),(0,W.jsx)(eW,{title:o("totalWidthFilterLabel"),withIcon:!0,isOpen:!0,isLoading:c&&d,testId:eG("width"),children:(0,W.jsx)(tl,{min:Number(l[0]),max:Number(l[1]),onAfterChange:function(e){null==i||i([{name:"minWidth",value:e[0],selected:!0},{name:"maxWidth",value:e[1],selected:!0}]),a({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-total-width-filter",searchFilter:"total-width",searchFilterValue:"min-".concat(e[0],":max-").concat(e[1])})},reset:!(null!=n&&null!==(t=n.selectedFacets)&&void 0!==t&&t.minWidth)})})},tp=function(){var e,t,n=(0,r.useContext)(p.Z),i=v().onFacetChange,o=(0,g.Z)().t,a=(0,m.Y)(),l=(0,r.useState)(!1),c=l[0],s=l[1],d=(null==n||null===(e=n.facets)||void 0===e?void 0:e.payload)||[],u=null==n?void 0:n.isLoadingVehiclesAndFacets;return(0,r.useEffect)(function(){u||s(!1)},[u]),(0,W.jsx)(eW,{title:o("payloadFilterLabel"),withIcon:!0,isOpen:!0,isLoading:u&&c,testId:eG("payload"),children:(0,W.jsx)(tl,{min:Number(d[0]),max:Number(d[1]),onAfterChange:function(e){s(!0),null==i||i([{name:"minPayload",value:e[0],selected:!0},{name:"maxPayload",value:e[1],selected:!0}]),a({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-payload-filter",searchFilter:"payload",searchFilterValue:"min-".concat(e[0],":max-").concat(e[1])})},reset:!(null!=n&&null!==(t=n.selectedFacets)&&void 0!==t&&t.minPayload)})})},tf=function(){var e=(0,g.Z)(),t=e.t,n=e.exists,i=(0,r.useContext)(p.Z),o=(null==i?void 0:i.vehicleType)===P._3,a={fueltypes:(0,W.jsx)(eX,{}),grades:(0,W.jsx)(e0,{}),gearboxes:(0,W.jsx)(eJ,{}),payload:(0,W.jsx)(tp,{}),cargoVolume:(0,W.jsx)(tc,{}),length:(0,W.jsx)(ts,{}),height:(0,W.jsx)(td,{}),width:(0,W.jsx)(tu,{}),colors:(0,W.jsx)(eQ,{})},l=n("displayOrderForLCVPlpFilters")?t("displayOrderForLCVPlpFilters"):Object.keys(a),c=o?l:t("displayOrderForPlpFilters");return(0,W.jsx)(eM,{"data-testid":"facets-bottom",children:c&&Array.isArray(c)?c.map(function(e){return(0,W.jsx)(r.Fragment,{children:a[e]},e)}):null})},th=V.default.div.withConfig({displayName:"VehicleTypeFacetstyles__Container",componentId:"sc-35369j-0"})(["margin-top:",";"],Z.spacers.spacing_5),tv=(0,V.default)(Z.Switch).withConfig({displayName:"VehicleTypeFacetstyles__StyledSwitch",componentId:"sc-35369j-1"})(["margin:"," 0 "," 0;border-radius:4px;border:1px solid ",";"],Z.spacers.spacing_1,Z.spacers.spacing_4,Z.colors.grey),tg=(0,V.default)(Z.Text).withConfig({displayName:"VehicleTypeFacetstyles__Label",componentId:"sc-35369j-2"})(["padding-bottom:",";"],Z.spacers.spacing_2),tm=function(){var e=(0,g.Z)().t,t=(0,r.useContext)(p.Z),n=(0,m.Y)(),i=null==t?void 0:t.isB2B,o=null==t?void 0:t.vehicleType,a=null==t?void 0:t.setPageNumber,l=null==t?void 0:t.selectedFacets,c=null==t?void 0:t.handleClearAllFilters,d=null==t?void 0:t.onHandleVehicleTypeChange,u=[{label:e("plpTabPCLabel"),value:P.Vx},{label:e("plpTabLCVLabel"),value:P._3}],f=(0,r.useState)(i||o===P._3?u[1]:u[0]),h=f[0],v=f[1];return(0,W.jsxs)(th,{children:[(0,W.jsx)(tg,{children:e("vehicleTypeFilter")}),(0,W.jsx)(tv,{options:u,selectedOption:h,onChange:function(e){a({PC:s.Kp,LCV:s.Kp}),Object.keys(l).length>0&&c&&c(),v(e),null==d||d(e.value),n({action:"plp-inventory-vehicle-filter",searchType:"plp-side-bar-vehicle-category-filter",searchFilter:"vehicle type",searchFilterValue:"LCV"===e.value?"light commercial vehicles":"passenger cars"})},testId:["switch-vehicle-type","switch-left-vehicle-type","switch-right-vehicle-type"],fullRounded:!1})]})},ty=n(69368),tb=n.n(ty),tx=n(12081),tC=V.default.div.withConfig({displayName:"UserTypeFacetstyles__Container",componentId:"sc-10mvh29-0"})(["margin-top:",";"],Z.spacers.spacing_5),tw=(0,V.default)(Z.Switch).withConfig({displayName:"UserTypeFacetstyles__StyledSwitch",componentId:"sc-10mvh29-1"})(["margin:"," 0 "," 0;border-radius:4px;border:1px solid ",";"],Z.spacers.spacing_1,Z.spacers.spacing_4,Z.colors.grey),tj=V.default.div.withConfig({displayName:"UserTypeFacetstyles__TitleContainer",componentId:"sc-10mvh29-2"})(["display:flex;"]),tO=(0,V.default)(Z.Text).withConfig({displayName:"UserTypeFacetstyles__Label",componentId:"sc-10mvh29-3"})(["padding-bottom:",";"],Z.spacers.spacing_2),t_=function(){var e=(0,a.useRouter)(),t=(0,g.Z)().t,n=(0,tx.Z)("tablet"),i=(0,m.Z)().onEvent,o=(0,y.Z)().getPath,l=(0,r.useContext)(p.Z)||{},c=l.isLoadingB2B,s=l.setIsLoadingB2B,d=l.isB2B,u=(0,O.l7)(t),f=(0,r.useState)(d?u[1]:u[0]),h=f[0],v=f[1];return(0,W.jsxs)(tC,{children:[(0,W.jsxs)(tj,{children:[(0,W.jsx)(tO,{children:t("userTypeFilter")}),c&&!n&&(0,W.jsx)(tb(),{dark:!0})]}),(0,W.jsx)(tw,{options:u,selectedOption:h,onChange:function(t){i({toggleType:"type of user",toggleValue:t.value},"toggle"),s(!0),v(t);var n,r=null==e||null===(n=e.query)||void 0===n?void 0:n.segmentType;e.push(o(r===O.fC||t.value===O.fC?"business":"cars-for-sale"))},testId:["switch-user-type","switch-left-user-type","switch-right-user-type"],fullRounded:!1})]})},tP=function(e){var t,n;return!!((null==e||null===(t=e.price)||void 0===t?void 0:t.maxPrice)||(null==e||null===(n=e.monthlyPrice)||void 0===n?void 0:n.maxPrice))},tk=V.default.div.withConfig({displayName:"Facetsstyles__Container",componentId:"sc-flt7ng-0"})([""]),tI=V.default.div.withConfig({displayName:"Facetsstyles__FacetsBottomContainer",componentId:"sc-flt7ng-1"})([""]),tF=(0,V.default)(Z.Text).withConfig({displayName:"Facetsstyles__FilterTitle",componentId:"sc-flt7ng-2"})(["text-align:center;"]),tS=V.default.div.withConfig({displayName:"Facetsstyles__TitleContainer",componentId:"sc-flt7ng-3"})(["margin:20px 0 "," 0;"],Z.spacers.spacing_5),tN=V.default.div.withConfig({displayName:"Facetsstyles__ModelsContainer",componentId:"sc-flt7ng-4"})(["",""],function(e){return e.$withBorder&&"\n    border-top: 1px solid ".concat(Z.colors.grey_5,";\n  ")}),tL=V.default.div.withConfig({displayName:"Facetsstyles__PriceContainer",componentId:"sc-flt7ng-5"})([""]),tT=V.default.div.withConfig({displayName:"Facetsstyles__SearchContainer",componentId:"sc-flt7ng-6"})([""]),tZ=function(){var e=(0,g.Z)().t,t=(0,u.Z)(),n=(0,r.useContext)(p.Z),i=(0,tx.Z)("tablet"),o=null==n?void 0:n.facets,a=t((null==n?void 0:n.isB2B)?"showLCVInSTOforB2B":"showLCVInSTOforB2C");return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(tk,{"data-testid":"facets-top",children:[i&&(0,W.jsx)(tS,{children:(0,W.jsx)(tF,{variant:"heading5",fontWeight:"light",label:e("searchTitle")})}),t("showB2bB2cToggle")&&(0,W.jsx)(t_,{}),a&&(0,W.jsx)(tm,{}),(0,W.jsx)(tN,{"data-testid":"facets-models",$withBorder:a,children:(0,W.jsx)(eH,{})}),tP(o)&&(0,W.jsx)(tL,{"data-testid":"facets-price",children:(0,W.jsx)(el,{})}),(0,W.jsx)(tT,{"data-testid":"facets-search",children:(0,W.jsx)(ek,{})})]}),(0,W.jsx)(tI,{children:(0,W.jsx)(tf,{})})]})},tD=n(76197),tV=V.default.div.withConfig({displayName:"FootNotesstyles__FootNotesContainer",componentId:"sc-4dyxw7-0"})(["display:",";box-sizing:content-box;margin:0;background-color:#e5e5e5;padding:20px;@media screen and ","{padding:",";}"],function(e){return e.$isStickyNavOpen?"none":"block"},Z.devices.desktop,function(e){return e.$isFiltersOpen?"".concat(Z.spacers.spacing_10," 0"):"".concat(Z.spacers.spacing_10," 190px")}),tE=(0,V.default)(Z.Text).attrs({variant:"bodyCards",type:"p"}).withConfig({displayName:"FootNotesstyles__FootNoteText",componentId:"sc-4dyxw7-1"})(["line-height:inherit;letter-spacing:inherit;"]),tA=function(e){var t=e.notes,n=e.isStickyNavOpen,i=e.isFiltersOpen;return Array.isArray(t)&&!(0,T.Z)(t)&&t.some(function(e){return""!==e})?(0,W.jsx)(tV,{$isStickyNavOpen:n,$isFiltersOpen:i,children:t.map(function(e,t){var n=e.split("|"),i=n[1]?"<sup>".concat(n[1],"</sup> ").concat(n[0]):"<sup>".concat(t+1,"</sup> ").concat(n[0]);return(0,W.jsx)(tE,{id:"footnote".concat(t),textWithHtml:i},"footnote".concat(e))})}):null},tB=n(40681),tR=n(16233),tz=n(23901),tH=n(54582),tM=function(e,t){var n,i=(0,tH.Z)(),o=i.provider,a=i.channelCodes,l=i.defaultSettings,c=(0,tB.Z)((0,C.rV)(C.TE)),s=(0,tR.d3)(void 0===a?{}:a,void 0===l?{}:l,null==c||null===(n=c.data)||void 0===n?void 0:n.value,!1);return(0,r.useRef)(o===tz.Nh?s(e)(t):null)},tW=n(80547),tq=n(86846),tU=n(33131),tY=V.default.div.withConfig({displayName:"OfferCardstyles__Container",componentId:"sc-1jacsye-0"})(["position:relative;display:flex;flex-direction:column;height:100%;padding:"," "," "," ",";border-radius:",";min-height:550px;z-index:0;"],Z.spacers.spacing_4,Z.spacers.spacing_4,Z.spacers.spacing_5,Z.spacers.spacing_4,Z.spacers.spacing_1),tG=V.default.img.withConfig({displayName:"OfferCardstyles__Image",componentId:"sc-1jacsye-1"})(["position:absolute;top:0;left:0;width:100%;height:100%;border-radius:",";object-fit:cover;z-index:1;"],Z.spacers.spacing_1),tK=(0,V.default)(Z.Text).attrs({variant:"heading3"}).withConfig({displayName:"OfferCardstyles__Title",componentId:"sc-1jacsye-2"})(["font-size:32px;line-height:42px;z-index:2;color:",";margin-top:",";letter-spacing:1.5px;"],Z.colors.white,Z.spacers.spacing_3),t$=(0,V.default)(Z.Text).withConfig({displayName:"OfferCardstyles__SubTitle",componentId:"sc-1jacsye-3"})(["font-size:16px;line-height:26px;z-index:2;color:",";margin-top:",";letter-spacing:1.5px;"],Z.colors.white,Z.spacers.spacing_4),tQ=(0,V.default)(Z.Disclaimer).withConfig({displayName:"OfferCardstyles__Disclaimer",componentId:"sc-1jacsye-4"})(["z-index:3;margin-top:",";div[role='button']{color:",";span{flex:0;min-width:220px;}}div[role='tooltip']{width:300px;margin-right:-8px;@media screen and ","{margin-right:6px;}}.offerCardDisclaimerLabel{color:",";font-size:32px;line-height:42px;letter-spacing:1.5px;font-family:'Nissan bold';}.offerCardDisclaimerIcon{margin-top:76px;path{fill:",";}svg{width:26px;height:26px;}}"],Z.spacers.spacing_3,Z.colors.white,Z.devices.tablet,Z.colors.white,Z.colors.white),tX=(0,V.default)(Z.Button).withConfig({displayName:"OfferCardstyles__Button",componentId:"sc-1jacsye-5"})(["z-index:2;background-color:transparent;margin-top:auto;color:",";box-shadow:inset 0 0 0 2px ",";&:hover:not(:disabled):not(.disabled){box-shadow:inset 0 0 0 4px ",";}"],Z.colors.white,Z.colors.white,Z.colors.white),tJ=V.default.div.withConfig({displayName:"OfferCardstyles__CardServiceContainer",componentId:"sc-1jacsye-6"})(["margin-top:auto;display:flex;flex-direction:column;z-index:2;"]),t0=V.default.img.withConfig({displayName:"OfferCardstyles__CardServiceSticker",componentId:"sc-1jacsye-7"})(["z-index:2;width:24px;height:24px;"]),t1=V.default.div.withConfig({displayName:"OfferCardstyles__CardServiceTextContent",componentId:"sc-1jacsye-8"})(["display:flex;flex-wrap:wrap;flex-direction:column;margin-left:",";z-index:2;"],Z.spacers.spacing_4),t2=V.default.div.withConfig({displayName:"OfferCardstyles__CardServiceContent",componentId:"sc-1jacsye-9"})(["display:flex;align-items:center;margin-top:",";z-index:2;"],Z.spacers.spacing_3),t5=(0,V.default)(Z.Text).withConfig({displayName:"OfferCardstyles__CardServiceTitle",componentId:"sc-1jacsye-10"})(["color:",";z-index:2;font-family:'Nissan bold';"],Z.colors.white),t6=(0,V.default)(t5).withConfig({displayName:"OfferCardstyles__CardServiceDescription",componentId:"sc-1jacsye-11"})(["font-family:'Nissan light';"]),t3=function(e){var t,n=e.index,i=(0,g.Z)(),o=i.t,r=i.exists,a=(0,tx.Z)("tablet"),l=(0,tx.Z)("mobile"),c=(0,m.Z)().onEvent,s=(null===(t=o("plpOfferCardTitle"))||void 0===t?void 0:t.length)-1||0,d=n<=s?n:s,u=o("plpOfferCardTooltipDescription")[d],p=o("plpOfferCardTitle")[d],f=o("plpOfferCardCTALabel")[d],h=l?o("plpOfferCardMobileImage")[d]:a?o("plpOfferCardTabletImage")[d]:o("plpOfferCardDesktopImage")[d],v=o("plpOfferCardCTARedirectionURL")[d],y=o("plpFallBackCardServiceStickers"),b=o("plpFallBackCardServiceTitles"),x=o("plpFallBackCardServiceDescriptions"),C=function(){c({interactionType:"button-click",buttonText:f,destination:o("plpOfferCardCTARedirectionURL")[d],locationInpage:"plp-offer-encart-card-cta",interactionValue:f})};return(0,W.jsxs)(tY,{children:[u?(0,W.jsx)(tQ,{label:p,labelClassName:"offerCardDisclaimerLabel",iconClassName:"offerCardDisclaimerIcon",iconToTheRight:!0,placement:"bottom-right",title:" ",toggleOpen:function(){c({tooltipTitle:p},"tooltipDisplay")},children:u}):(0,W.jsx)(tK,{children:p}),(0,W.jsx)(t$,{children:o("plpOfferCardSubTitle")[d]}),r("plpOfferCardCTALabel")&&f?(0,W.jsx)(tX,{label:f,href:v,buttonType:"secondary",onClick:function(e){e.preventDefault(),window.open(v,"_blank"),C()}}):r("plpFallBackCardServiceTitles")&&Array.isArray(b)&&b.length>0?(0,W.jsx)(tJ,{children:b.map(function(e,t){return(0,W.jsxs)(t2,{children:[r("plpFallBackCardServiceStickers")&&(0,W.jsx)(t0,{src:"".concat((0,D.Z)("endpoint.assets")).concat(y[t])}),(0,W.jsxs)(t1,{children:[(0,W.jsx)(t5,{children:e}),(0,W.jsx)(t6,{children:x[t]})]})]},"".concat(e,"-").concat(x[t]))})}):null,(0,W.jsx)(tG,{src:"".concat((0,D.Z)("endpoint.assets")).concat(h),alt:o("plpOfferCardImagesAltText")[d]})]})},t4=function(e,t,n){var i=n.t;if(!i)return{};if(i("noResultsMappingKeyPLP")){var o=t===P._3,r="generic";e&&(r=e),o&&(r="generic-lcv");var a=i("noResultsMessagePLP"),l=i("noResultsCtaLabelPLP"),c=i("noResultsCtaLinkPLP"),s=i("noResultsMappingKeyPLP").indexOf(r);return r&&s>-1?{noResultsMessage:a[s],noResultsCtaLabel:l[s],noResultsCtaLink:c[s]}:{noResultsMessage:a[0],noResultsCtaLabel:l[0],noResultsCtaLink:c[0]}}return{}},t9=(0,V.default)(Z.Button).withConfig({displayName:"FacetsResultsstyles__Button",componentId:"sc-79dcau-0"})(["margin-bottom:",";@media screen and ","{margin-bottom:0px;}"],Z.spacers.spacing_8,Z.devices.desktop),t7=V.default.div.withConfig({displayName:"FacetsResultsstyles__NoDataContainer",componentId:"sc-79dcau-1"})(["display:flex;flex-direction:column;align-items:center;margin-top:",";@media screen and ","{margin-top:",";}"],Z.spacers.spacing_7,Z.devices.desktop,Z.spacers.spacing_12),t8=V.default.div.withConfig({displayName:"FacetsResultsstyles__CardsContainer",componentId:"sc-79dcau-2"})(["display:flex;flex-direction:column;gap:20px;@media screen and ","{display:grid;grid-template-columns:repeat(2,1fr);}@media screen and (min-width:1200px){display:grid;grid-template-columns:repeat(3,1fr);}"],Z.devices.tablet),ne=V.default.div.withConfig({displayName:"FacetsResultsstyles__VehicleCardContainer",componentId:"sc-79dcau-3"})(["min-width:0;position:relative;"]),nt=V.default.div.withConfig({displayName:"FacetsResultsstyles__TitleContainer",componentId:"sc-79dcau-4"})(["display:flex;width:100%;justify-content:center;"]),nn=(0,V.default)(Z.Text).attrs({variant:"heading4"}).withConfig({displayName:"FacetsResultsstyles__Title",componentId:"sc-79dcau-5"})(["width:100%;margin-bottom:",";text-align:center;letter-spacing:2px;@media screen and ","{width:70%;margin-bottom:",";}"],Z.spacers.spacing_5,Z.devices.desktop,Z.spacers.spacing_9);function ni(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ni(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var nr=function(){var e,t,n=(0,g.Z)().t,i=(0,u.Z)(),o=(0,m.Z)().onEvent,l=(0,a.useRouter)().query.modelName,c=(0,b.Z)().useMultiSimulators,s=null!==(e=(0,r.useContext)(p.Z))&&void 0!==e?e:{},d=s.vehicles,f=s.santanderOffers,h=s.santanderFinanceOptions,v=s.vehicleType,y=(0,r.useState)(!1),x=y[0],C=y[1],w=((null==h||null===(t=h.financeProduct)||void 0===t?void 0:t.find(function(e){var t;return(null==e?void 0:e.productId)===(null==h||null===(t=h.defaultValues)||void 0===t?void 0:t.productId)}))||{assetIds:[],vatIncluded:!0}).vatIncluded;(0,r.useEffect)(function(){C(!0),(0,T.Z)(d)&&x&&o({},"no-inventory-results")},[x,o,d]);var O=t4(l,v,{t:n}),_=O.noResultsMessage,P=O.noResultsCtaLabel,k=O.noResultsCtaLink,I=tM("product_listing",null==d?void 0:d[0]),F=c("product_listing",d,I),S=F.isLoading,N=void 0===S?{}:S,L=F.error,Z=void 0===L?{}:L,D=F.financeOffers,V=void 0===D?{}:D;return d&&!(0,T.Z)(d)?(0,W.jsx)(t8,{children:d.map(function(e,t){var n,o,r,a=w?null==e||null===(n=e.prices)||void 0===n?void 0:n[j.eH]:null==e||null===(o=e.prices)||void 0===o?void 0:o[j.bl];a&&(r=a.hasDiscount&&i("all_discount_STO")?a.discountedPrice:a.price);var l=null==f?void 0:f.find(function(t){var n;return(null==t?void 0:t.retailPrice)===r&&(null==t||null===(n=t.auto)||void 0===n?void 0:n.assetId)===(null==e?void 0:e.eimCode)}),c=V[null==e?void 0:e.vin];return(0,W.jsx)(ne,{"data-testid":"vehicle-result-".concat(t),children:(null==e?void 0:e.offerIndex)!==void 0?(0,W.jsx)(t3,{index:e.offerIndex}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tU.Z,{vehicle:no(no(no({},e),!(0,T.Z)(f)&&{santanderOffer:l}),c&&{rciOffer:c}),isErrorRCI:Z[null==e?void 0:e.vin],isLoadingRCI:N[null==e?void 0:e.vin]}),(0,W.jsx)(tq.Z,{id:(0,tR.cI)(null==e?void 0:e.vin)})]})},"".concat(null==e?void 0:e.vin,"-").concat(null==e?void 0:e.offerIndex))})}):(0,W.jsxs)(t7,{children:[(0,W.jsx)(nt,{children:(0,W.jsx)(nn,{type:"h3",label:_})}),!!P&&!!k&&(0,W.jsx)(t9,{label:P,onClick:function(){o({interactionType:"button-click",buttonText:"".concat(P),locationInpage:"middle-content",interactionValue:"find-another-car-configurator",destination:"".concat(k)}),(0,tW.l6)(k||"")}})]})},na=V.default.div.withConfig({displayName:"StickyFacetsNavstyles__StickyNav",componentId:"sc-1plng8r-0"})(["position:fixed;bottom:0;left:0;width:100%;background-color:black;z-index:100000000;display:flex;flex-direction:",";flex-wrap:wrap;@media screen and ","{display:none;}"],function(e){return e.$isStickyNavOpen?"column":"row"},Z.devices.desktop),nl=V.default.button.withConfig({displayName:"StickyFacetsNavstyles__Button",componentId:"sc-1plng8r-1"})(["height:52px;width:50%;border:none;background-color:transparent;font-family:Nissan Regular;font-size:12px;letter-spacing:1px;color:white;position:relative;align-items:center;display:flex;justify-content:center;cursor:pointer;"]),nc=(0,V.default)(nl).withConfig({displayName:"StickyFacetsNavstyles__ButtonClose",componentId:"sc-1plng8r-2"})(["background-color:white;color:black;position:relative;font-size:12px;width:100%;text-decoration:underline;"]),ns=(0,V.default)(nl).withConfig({displayName:"StickyFacetsNavstyles__ButtonApplyFilters",componentId:"sc-1plng8r-3"})(["width:100%;font-size:16px;&:after{content:'';display:block;height:52px;position:absolute;top:0;left:0;}"]),nd=(0,V.default)(ns).withConfig({displayName:"StickyFacetsNavstyles__ButtonFilter",componentId:"sc-1plng8r-4"})(["position:relative;i{position:relative;top:2px;left:5px;svg{width:12px !important;}}"]),nu=V.default.span.withConfig({displayName:"StickyFacetsNavstyles__Arrow",componentId:"sc-1plng8r-5"})(["position:relative;i{position:relative;top:2px;left:5px;}"]),np=(0,V.default)(nu).withConfig({displayName:"StickyFacetsNavstyles__ArrowRight",componentId:"sc-1plng8r-6"})(["i{transform:rotate(180deg);top:-1px;left:-3px;}"]),nf=(0,V.default)(nl).withConfig({displayName:"StickyFacetsNavstyles__ButtonSort",componentId:"sc-1plng8r-7"})(["width:100%;padding:0 16px;&:after{content:'';display:block;height:52px;position:absolute;top:0;left:0;}"]),nh=(0,V.default)(Z.Dropdown).withConfig({displayName:"StickyFacetsNavstyles__SortDropdown",componentId:"sc-1plng8r-8"})(["background-color:white;width:100%;button{color:black;font-size:12px;text-decoration:underline;path{fill:black;}}"]),nv=function(){return window.scrollTo({top:0,behavior:"smooth"})},ng=function(e){var t=e.sorts,n=e.isStickyNavOpen,i=e.setStickyNavOpen,o=e.onSortSelect,l=e.onCloseModal,c=e.openModal,s=e.setResetLocation,d=e.onCancel,u=(0,a.useRouter)(),f=(0,y.Z)().getPath,h=(0,g.Z)().t,v=(0,r.useContext)(p.Z),b=(0,m.Z)().onEvent,x=null==v?void 0:v.setSelectedFacets,C=null==v?void 0:v.meta,w=h("applyFiltersButton",{number:"".concat((null==C?void 0:C.totalCount)||0)}),j=t.find(function(e){return e.selected});return(0,W.jsx)(na,{"data-testid":"facets-mobile-nav",$isStickyNavOpen:n,children:n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ns,{type:"button",onClick:function(){l(),i(!1),nv(),b({interactionType:"button-click",buttonText:w,destination:"product-list-page",locationInpage:"plp-inventory-filters-overlay-portable-ui",interactionValue:"see the results"})},children:w}),(0,W.jsx)(nc,{type:"button",onClick:function(){i(!1),s(!0),u.push(f("cars-for-sale"),void 0,{shallow:!0}),x({}),l(),null==d||d(),nv()},children:h("closeLabel")})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(nd,{type:"button",onClick:function(){c(),i(!0)},children:[h("filterByText"),(0,W.jsx)(Z.FilterIcon,{})]}),(0,W.jsx)(nh,{options:t,renderButton:function(e){var t=e.toggleMenu;return(0,W.jsxs)(nf,{type:"button",onClick:t,"aria-label":h("sortByText"),children:[null==j?void 0:j.label,(0,W.jsx)(nu,{children:(0,W.jsx)(Z.ArrowIcon,{})}),(0,W.jsx)(np,{children:(0,W.jsx)(Z.ArrowIcon,{})})]})},onSelect:o,isMobile:!0,extraPaddingBottom:!0})]})})},nm=n(99853),ny=n(24706),nb=n(56913),nx=V.default.div.withConfig({displayName:"Herostyles__Container",componentId:"sc-9e3zvd-0"})(["position:relative;height:182px;overflow:hidden;@media screen and (min-width:960px){height:196px;}"]),nC=V.default.div.withConfig({displayName:"Herostyles__ContainerImg",componentId:"sc-9e3zvd-1"})(["position:absolute;top:0;left:0;width:100%;height:100%;img{object-fit:cover;width:100%;height:100%;}"]),nw=V.default.div.withConfig({displayName:"Herostyles__Content",componentId:"sc-9e3zvd-2"})(["position:relative;left:20px;top:38px;@media screen and (min-width:960px){left:222px;top:48px;}"]),nj=(0,V.default)(Z.Text).attrs({type:"h2"}).withConfig({displayName:"Herostyles__Title",componentId:"sc-9e3zvd-3"})(["font-size:18px;line-height:22px;letter-spacing:1.5px;width:50%;color:white;@media screen and (min-width:960px){width:100%;font-size:24px;line-height:34px;letter-spacing:2px;}"]),nO=V.default.div.withConfig({displayName:"Herostyles__ContainerCta",componentId:"sc-9e3zvd-4"})(["margin-top:32px;"]),n_=(0,V.default)(Z.Text).attrs({type:"p"}).withConfig({displayName:"Herostyles__LinkHome",componentId:"sc-9e3zvd-5"})(["font-size:16px;line-height:22px;letter-spacing:1px;color:white;border-bottom:2px solid white;display:inline-block;"]),nP=V.default.a.withConfig({displayName:"Herostyles__Link",componentId:"sc-9e3zvd-6"})(["font-size:16px;line-height:22px;letter-spacing:1px;display:inline-block;color:grey;margin-left:20px;text-decoration:none;"]),nk=function(e){var t,n=e.modelCodes,i=e.usedCarsUrl,o=(0,r.useContext)(p.Z),a=(0,g.Z)(null==o?void 0:o.isB2B),l=a.t,c=a.exists,s=(0,u.Z)(),d=(0,x.Z)(),f=null!==(t=(0,D.Z)("endpoint.assets"))&&void 0!==t?t:"https://www-europe.nissan-cdn.net",h="".concat(f,"/").concat(l(d?"genericHeroImageMobile":"genericHeroImageLargeDesktop")),v=(0,nb.ix)(l,c)(void 0===n?[]:n).title;return(0,W.jsxs)(nx,{children:[(0,W.jsx)(nC,{children:(0,W.jsxs)("picture",{children:[(0,W.jsx)("source",{srcSet:encodeURI(h)}),(0,W.jsx)(eF(),{fill:!0,alt:"Nissan Hero",src:h,priority:!0})]})}),(0,W.jsxs)(nw,{children:[(0,W.jsx)(nj,{children:v}),s("display_used_cars_tab")&&(0,W.jsxs)(nO,{children:[(0,W.jsx)(n_,{children:l("plpNewCarsTab")}),(0,W.jsx)(nP,{href:void 0===i?"":i,children:l("plpUsedCarsTab")})]})]})]})},nI=n(35120),nF=n(52692),nS=(0,V.css)(["position:sticky;z-index:99;height:",";top:",";"],function(e){var t=e.$bannerHeight;return t?"calc(100vh - ".concat(t,"px)"):"100vh"},function(e){var t=e.$bannerHeight;return t?"".concat(t,"px"):"0"}),nN=(0,V.css)(["display:block;padding:20px 20px 0 0;"]),nL=(0,V.default)(nI.Z).withConfig({displayName:"FacetsAndVehiclesstyles__Container",componentId:"sc-1pomzh5-0"})(["background-color:#e5e5e5;z-index:",";&.filtering{padding-bottom:",";}padding:",";@media screen and ","{display:grid;grid-template-columns:repeat(12,1fr);gap:20px;padding:0;min-height:100vh;}"],function(e){return e.isOpen?"111":"1"},Z.spacers.spacing_6,Z.spacers.spacing_4,Z.devices.desktop),nT=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__FilterSection",componentId:"sc-1pomzh5-1"})(["width:100%;position:fixed;top:0;left:0;height:calc(100% - 104px);background-color:white;padding:0 20px 20px 20px;overflow-y:auto;z-index:20000;display:",";@media screen and ","{"," grid-column:auto / span 4;}@media screen and (min-width:1200px){"," grid-column:auto / span 3;}"],function(e){return e.$isOpen?"block":"none"},Z.devices.desktop,nS,nS),nZ=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__CardsColumn",componentId:"sc-1pomzh5-2"})(["display:",";@media screen and ","{"," grid-column:auto / span 8;}@media screen and (min-width:1200px){"," grid-column:auto / span 9;}"],function(e){return e.isStickyNavOpen?"none":"initial"},Z.devices.desktop,nN,nN),nD=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__FacetsBannerContainer",componentId:"sc-1pomzh5-3"})(["display:block;@media screen and ","{background-color:white;border-bottom:1px solid ",";position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:20px;}"],Z.devices.desktop,Z.colors.grey),nV=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__FilterChipsContainer",componentId:"sc-1pomzh5-4"})(["width:100%;"]),nE=(0,V.default)(Z.DesktopFilterChips).withConfig({displayName:"FacetsAndVehiclesstyles__DesktopFilterChips",componentId:"sc-1pomzh5-5"})(["width:100%;"]),nA=(0,V.default)(Z.MobileFilterChips).withConfig({displayName:"FacetsAndVehiclesstyles__MobileFilterChips",componentId:"sc-1pomzh5-6"})([""]),nB=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__InventoryHeader",componentId:"sc-1pomzh5-7"})(["display:flex;flex-direction:column;@media screen and ","{flex-direction:row;justify-content:space-between;align-items:center;}"],Z.devices.desktop),nR=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__InventoryFooter",componentId:"sc-1pomzh5-8"})(["display:flex;align-items:center;justify-content:center;margin:"," 0 ",";@media screen and ","{margin:"," 0 0 0;}"],Z.spacers.spacing_7,Z.spacers.spacing_7,Z.devices.desktop,Z.spacers.spacing_7),nz=(0,V.default)(Z.Dropdown).withConfig({displayName:"FacetsAndVehiclesstyles__Dropdown",componentId:"sc-1pomzh5-9"})(["display:none;@media screen and ","{display:block;border:1px solid black;border-radius:4px;button{padding:"," 0px;}span{white-space:nowrap;margin-left:",";margin-right:",";}i{float:right;}}"],Z.devices.desktop,Z.spacers.spacing_2,Z.spacers.spacing_2,Z.spacers.spacing_2),nH=(0,V.default)(Z.Text).attrs({variant:"body-small"}).withConfig({displayName:"FacetsAndVehiclesstyles__Counter",componentId:"sc-1pomzh5-10"})(["order:2;opacity:0.6;letter-spacing:1.5px;margin-top:",";@media screen and ","{order:1;margin-top:0;}"],Z.spacers.spacing_4,Z.devices.desktop),nM=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__DropdownContainer",componentId:"sc-1pomzh5-11"})(["order:3;"]),nW=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__Inventory",componentId:"sc-1pomzh5-12"})(["@media screen and ","{margin-top:20px;}"],Z.devices.desktop);(0,V.default)(Z.HeroV2).withConfig({displayName:"FacetsAndVehiclesstyles__HeroV2",componentId:"sc-1pomzh5-13"})(["display:",";@media screen and ","{border-top:1px solid ",";margin-top:",";padding:"," ",";}"],function(e){return e.isStickyNavOpen?"none":"block"},Z.devices.desktop,Z.colors.grey,Z.spacers.spacing_3,Z.spacers.spacing_6,Z.spacers.spacing_10);var nq=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__DisclaimerTop",componentId:"sc-1pomzh5-14"})(["margin-top:",";margin-bottom:",";@media screen and ","{margin-top:",";}"],Z.spacers.spacing_4,Z.spacers.spacing_6,Z.devices.desktop,Z.spacers.spacing_6);(0,V.default)(nI.Z).withConfig({displayName:"FacetsAndVehiclesstyles__Disclaimer",componentId:"sc-1pomzh5-15"})(["margin:0;padding-top:",";padding-bottom:",";@media screen and ","{padding:"," 190px;}"],Z.spacers.spacing_10,Z.spacers.spacing_10,Z.devices.desktop,Z.spacers.spacing_12);var nU=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__DisclaimerBottom",componentId:"sc-1pomzh5-16"})(["border-top:1px solid #cccccc;margin-top:",";padding-top:",";margin-bottom:",";@media screen and ","{margin-top:",";padding-top:",";margin-bottom:0;}"],Z.spacers.spacing_7,Z.spacers.spacing_5,Z.spacers.spacing_10,Z.devices.desktop,Z.spacers.spacing_12,Z.spacers.spacing_8),nY=(0,V.default)(Z.Text).attrs({type:"p",fontWeight:"light"}).withConfig({displayName:"FacetsAndVehiclesstyles__DisclaimerBottomText",componentId:"sc-1pomzh5-17"})(["font-size:10px;line-height:18px;margin-bottom:12px;word-wrap:break-word;@media screen and ","{font-size:12px;}"],Z.devices.desktop),nG=(0,V.default)(nF.Z).withConfig({displayName:"FacetsAndVehiclesstyles__PageLoader",componentId:"sc-1pomzh5-18"})(["position:relative;width:100%;height:",";background:transparent;top:0;> div{margin-top:0;margin-bottom:200px;h2{margin-top:0;}@media screen and ","{margin-top:",";margin-bottom:0;}}"],function(e){var t=e.$bannerHeight;return t?"calc(100vh - ".concat(t,"px)"):"100vh"},Z.devices.desktop,function(e){return e.$isLoadingB2B?"10%":"20%"}),nK=(0,V.default)(Z.CloseIcon).withConfig({displayName:"FacetsAndVehiclesstyles__CloseIcon",componentId:"sc-1pomzh5-19"})(["display:block;position:absolute;top:24px;right:20px;cursor:pointer;svg{width:18px;height:18px;}"]),n$=V.default.div.withConfig({displayName:"FacetsAndVehiclesstyles__CloseIconContainer",componentId:"sc-1pomzh5-20"})([""]),nQ=["sortBy"];function nX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function nJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nX(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var n0=function(e){var t,n,i,l,c,f=e.page,h=e.isError,b=e.onShowMoreClick,C=(0,a.useRouter)(),j=!!(null!=C&&null!==(t=C.query)&&void 0!==t&&t.displayKeys),k=(0,g.Z)(),I=k.t,F=k.tOrEmpty,S=(0,u.Z)(),N=(0,tx.Z)("tablet"),L=(0,x.Z)(),D=(0,m.Z)(),V=D.onEvent,E=D.onPageLoad,A=(0,y.Z)().getPath,B=(0,r.useContext)(p.Z),R=v().onFacetChange,z=(0,nm.Z)(!L),H=z.isOpen,M=z.closeModal,q=z.toggleModal,Q=(0,m.Y)(),X=null==B?void 0:B.vehicles,J=(null==B||null===(n=B.facets)||void 0===n?void 0:n.models)||[],ee=null==B?void 0:B.meta,et=null==B?void 0:B.isB2B,en=(null==B?void 0:B.vehicleType)===P._3,ei=null==B?void 0:B.isLoadingVehiclesAndFacets,eo=null==B?void 0:B.hasNextPage,er=null==B?void 0:B.setResetLocation,ea=null==B?void 0:B.resetLocation,el=(null==B?void 0:B.handleClearAllFilters)||function(){},ec=null==B?void 0:B.location,es=null==B?void 0:B.setSelectedFacets,ed=null==B?void 0:B.selectedFacets,eu=(null==B||null===(i=B.facets)||void 0===i?void 0:i.colors)||[],ep=null==B?void 0:B.isLoadingB2B,ef=G.Z.get("OptanonAlertBoxClosed"),eh=I("modelFilterLabel")||"",ev=(0,r.useState)(!1),eg=ev[0],em=ev[1],ey=(0,r.useState)(null==ed?void 0:ed.modelCodes),eb=ey[0],ex=ey[1],eC=(0,r.useState)(!1),ew=eC[0],ej=eC[1],eO=(0,r.useState)(!1),e_=eO[0],eP=eO[1],ek=(0,r.useState)(0),eI=ek[0],eF=ek[1],eS=(0,r.useRef)(null),eN=(0,r.useCallback)(function(){eS.current&&eF(eS.current.getBoundingClientRect().height)},[]),eL=(0,r.useCallback)(function(e,t,n){var i=new Map([["fueltypes","fueltype"],["modelCodes","model"],["grades","grade"],["colorCodes","exteriorcolour"],["gearboxes","gearbox"],["location","location selection"]]),r=t||{},a=nJ(nJ({},(r.sortBy,(0,Y.Z)(r,nQ))),ec&&{location:ec}),l=Object.keys(a).length>0,c=Object.entries(a).map(function(e){var t=(0,U.Z)(e,2),n=t[0],r=t[1],a=i.get(n)||n;return Array.isArray(r)?(0,o.Z)(Array(r.length)).fill(a).join(","):a}).join(":"),s=Object.values(a).map(function(e){return Array.isArray(e)?e.join(","):e}).join(":");l?Q(nJ(nJ({action:"plp-inventory-vehicle-filter",searchType:e,locationInpage:n},c&&{searchFilter:c}),s&&{searchFilterValue:s})):V({action:"plp-inventory-vehicle-filter",searchType:"plp-portable-ui-filter-close-icon",searchFilter:"no-filters",searchFilterValue:"no-values"},"search")},[Q,ec,V]),eT=function(){eL("plp-top-filter-panel-clear-all",ed),el()},eZ="PlpFootNotes"!==I("PlpFootNotes")?I("PlpFootNotes"):[],eD=function(){V({interactionType:"explore",buttonText:"more-results",locationInpage:"footer-extend-list",interactionValue:"show-more-results",destination:"product-list-page"}),b()},eV=function(e){var t=e.value;null==R||R([{name:"sortBy",value:t}]),V({interactionType:"sorting-filter",buttonText:"sorting-list",locationInpage:"top-sorting-list",interactionValue:"distance"===t?"distance closest first":t,destination:"product-list-page"})},eE=(0,ny.Ko)(I)((null==ee||null===(l=ee.nextPageSearchCriteria)||void 0===l?void 0:l.sortBy)||"",null==ee?void 0:ee.sorts);(0,r.useEffect)(function(){(0,tD.ZQ)()},[]),(0,r.useEffect)(function(){eN();var e=new MutationObserver(eN);return eS.current&&e.observe(eS.current,{childList:!0,subtree:!0,characterData:!0}),function(){return e.disconnect()}},[eN]),(0,r.useEffect)(function(){var e=document.querySelector("footer"),t=document.querySelector("[data-testid='inventory']");e&&t&&(e.style.display=eg?"none":"block",t.classList.toggle("filtering",eg))},[eg]),(0,r.useEffect)(function(){var e,t={loginStatus:"logged out",personalitySegment:et?O.fC:O.Su,vehicleCategory:en?P._3.toLowerCase():"passenger cars"},n=(null==eb?void 0:eb.toString())!==(null==ed||null===(e=ed.modelCodes)||void 0===e?void 0:e.toString());if((0,T.Z)(X)&&!h&&(!e_||n)&&ef&&(E(nJ({pageName:"ecommerce|out-of-stock",pageType:"out-of-stock"},t)),ex(null==ed?void 0:ed.modelCodes),eP(!0)),(!ew||e_||n)&&!h&&!(0,T.Z)(X)&&ef){var i=setTimeout(function(){var e;E(nJ({pageName:"ecommerce|product-list-page".concat(null!=ed&&ed.modelCodes?"|".concat(null==ed||null===(e=ed.modelCodes)||void 0===e?void 0:e.toString()):""),pageType:"product-list-page"},t)),ex(null==ed?void 0:ed.modelCodes),eP(!1),ej(!0)},1e3);return function(){return clearTimeout(i)}}return function(){}},[et,en,h,ew,e_,E,eb,null==ed?void 0:ed.modelCodes,X,ef]);var eA=function(){em(!1),M()},eB=function(e){(0,ny.LH)(e,ed,er,R,eL,eh,J,eu)};(0,r.useEffect)(function(){ea&&er(!1)},[ea,er]);var eR=J.map(function(e){return e.code}),ez=I("dynamicHeroModelCode")||[],eH=Array.from(new Set([].concat((0,o.Z)(ez),(0,o.Z)(eR))));(0,r.useEffect)(function(){var e=(null==C?void 0:C.query["modelCodes[0]"])||(null==C?void 0:C.query.modelName);e&&!(0,ny.yC)(e,eH)&&(w.Z.info("redirect to 404 page because of invalid model query param"),C.push(A("not-found")))},[A,eH,C]);var eM=function(e){q(),V(nJ({interactionType:"button-click",buttonText:I("filterByText"),destination:"products-list-page-filters-overlay-open"},e),"genericClick")},eW=F("overrideModelsName"),eq=null==J?void 0:J.map(function(e){return nJ(nJ({},e),{},{label:(0,_.aB)(null==e?void 0:e.label,eW)})}),eU=(0,ny.Tj)((0,ny.y5)(ed,I,ec,eu),eq,eh),eY=(0,d.sP)(I("plpUsedCarsUrl"),null==C?void 0:C.query);return(0,W.jsxs)($.default,{children:[(0,W.jsx)(nk,{usedCarsUrl:eY,modelCodes:null==ee||null===(c=ee.nextPageSearchCriteria)||void 0===c?void 0:c.modelCodes}),(0,W.jsx)(nD,{ref:eS,children:N?(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(nV,{children:(0,W.jsx)(nA,{selectedFacets:eU,filterLabel:I("plpClearFiltersLabel")||"",onDeleteFacetFilter:eB,onClearAllFilters:eT,isLoading:ei})})}):(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(nV,{children:(0,W.jsx)(nE,{selectedFacets:eU,filterLabel:I("plpClearFiltersLabel")||"",onDeleteFacetFilter:eB,onClearAllFilters:eT,isLoading:ei})})})}),(0,W.jsx)(nL,{"data-testid":"inventory",isOpen:eg,pageType:"no-header",children:ei&&N&&f===s.Kp&&!H?(0,W.jsx)(nG,{isLoading:!0,placeholder:!1}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ng,{sorts:eE,isStickyNavOpen:eg,setStickyNavOpen:em,onSortSelect:eV,onCloseModal:eA,openModal:function(){return eM({locationInpage:"plp-inventory-portable-ui-bottom-left",interactionValue:"filter by"})},setResetLocation:er,onCancel:function(){return eL("plp-portable-ui-filter-clear-filters",ed)}}),(0,W.jsxs)(nT,{$isOpen:H,$bannerHeight:eI,children:[N&&(0,W.jsx)(n$,{onClick:function(){er(!0),C.push(A("cars-for-sale"),void 0,{shallow:!0}),es({}),eA(),eL("plp-portable-ui-filter-close-icon",ed,L?"plp-inventory-filters-overlay-portable-ui":"plp-inventory-side-bar-filters-overlay")},children:(0,W.jsx)(nK,{})}),(0,W.jsx)(tZ,{})]}),(0,W.jsxs)(nZ,{isStickyNavOpen:eg,children:[ei&&!N&&f===s.Kp?(0,W.jsx)(nG,{isLoading:!0,placeholder:!1}):(0,W.jsxs)(W.Fragment,{children:[!N&&!ep&&(0,W.jsxs)(nB,{children:[(0,W.jsx)(nH,{"data-testid":"vehicles-counter",children:I("resultCountLabel",{number:"".concat((null==ee?void 0:ee.totalCount)||0)})}),eE&&!(0,T.Z)(X)&&!N&&(0,W.jsx)(nM,{"data-testid":"vehicles-sort",children:(0,W.jsx)(nz,{options:eE,onSelect:eV,withBorder:!1})})]}),I("topDisclaimer")&&"topDisclaimer"!==I("topDisclaimer")&&(0,W.jsx)(nq,{children:(0,W.jsx)(Z.Text,{variant:"disclaimer",fontWeight:"light",children:I("topDisclaimer")})}),(0,W.jsx)(nW,{children:ep?(0,W.jsx)(nG,{isLoading:!0,placeholder:!1,$isLoadingB2B:ep}):(0,W.jsx)(nr,{})}),(null==ee?void 0:ee.hasMorePages)&&!ep&&(0,W.jsx)(nR,{children:(0,W.jsx)(Z.LoaderButton,{buttonType:"withIcon",label:I("showMoreResultsLabel"),onClick:function(){return eD()},isLoading:ei,disabled:!eo,loaderText:I("loadingText")})})]}),S("showVoc")&&(0,W.jsx)(K.Z,{}),j?(0,W.jsx)("p",{children:"bottomDisclaimer"}):Array.isArray(I("bottomDisclaimer"))&&I("bottomDisclaimer").length>0&&!ep&&(0,W.jsx)(nU,{children:I("bottomDisclaimer").map(function(e){return(0,W.jsx)(nY,{textWithHtml:e},e)})}),j?(0,W.jsx)("p",{children:"PlpFootNotes"}):(0,W.jsx)(tA,{notes:eZ,isStickyNavOpen:eg,isFiltersOpen:H})]})]})})]})},n1=n(76862);function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function n5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?n2(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var n6=function(e){var t,n,d,f,h,I,F,S,N,L,T=e.pageNumber,Z=e.setPageNumber,D=e.selectedFacets,V=e.setSelectedFacets,E=e.pcData,A=e.lcvData,B=(0,a.useRouter)(),R=(0,u.Z)(),z=(0,g.Z)(),H=z.t,M=z.getIndexBy,U=z.tOrEmpty,Y=(0,b.Z)().useSimulator,G=(0,y.Z)().getPath,K=(0,m.Y)(),$=(0,x.Z)(),Q=null==B||null===(t=B.pathname)||void 0===t?void 0:t.includes("business"),X=null===(n=B.query)||void 0===n?void 0:n.vehicleType,J=Q&&R("showLCVInSTOforB2B")?P._3:P.Vx,ee=Q?O.fC:O.Su,et=R("plpOfferCardEnabled")?s.rZ:s.L8,en=Number(H("plpOfferCardLocation")),ei=(0,r.useState)(X||J),eo=ei[0],er=ei[1],ea=function(e){return R("plpOfferCardEnabled")?(0,n1.XA)(e,null==T?void 0:T[eo],en,$,H):e},el=(0,r.useState)({PC:{vehicles:ea(null==E?void 0:E.vehicles),facets:null==E?void 0:E.facets,meta:null==E?void 0:E.meta},LCV:{vehicles:ea(null==A?void 0:A.vehicles),facets:null==A?void 0:A.facets,meta:null==A?void 0:A.meta}}),ec=el[0],es=el[1],ed=(0,r.useState)((0,n1.Ef)(null==ec||null===(d=ec[eo])||void 0===d?void 0:d.facets,null==ec||null===(f=ec[eo])||void 0===f?void 0:f.meta)),eu=ed[0],ep=ed[1],ef=(0,r.useState)(!1),eh=ef[0],ev=ef[1],eg=(0,r.useState)(!1),em=eg[0],ey=eg[1],eb=(0,r.useState)(!em),ex=eb[0],eC=eb[1],ew=(0,r.useState)([]),ej=ew[0],eO=ew[1],e_=(0,r.useState)(!1),eP=e_[0],ek=e_[1],eI=(0,r.useState)(!1),eF=eI[0],eS=eI[1],eN=(0,r.useState)(!1),eL=eN[0],eT=eN[1],eZ=(0,r.useState)(!1),eD=eZ[0],eV=eZ[1],eE=v(null==ec||null===(h=ec[eo])||void 0===h?void 0:h.meta).onFacetChange,eA=(0,r.useRef)({}),eB=(0,C.rV)(C.Kj),eR=R("plp_hard_gate_show"),ez=R("plp_hard_gate_closable"),eH=H("defaultSearchRadius"),eM=B.query,eW=(0,j.pn)(Q,eo,H,M),eq=eW===j.bl,eU=(0,r.useMemo)(function(){return{hasPricesWithoutVAT:eq,pageSize:et}},[eq,et]),eY=(0,n1.Yu)(null==ec||null===(I=ec[eo])||void 0===I?void 0:I.vehicles,eo,R),eG=Y(null==eY?void 0:eY.slice(-15)),eK=eG.isLoading,e$=eG.error,eQ=eG.financialOffer,eX=eG.financeOptions,eJ=function(e){eO(function(t){var n=[].concat((0,o.Z)(t),(0,o.Z)(e));return Array.from(new Set(n.map(function(e){return e.retailPrice}))).map(function(e){return n.find(function(t){return t.retailPrice===e})})})},e0=(0,r.useRef)(null);(0,r.useEffect)(function(){(null==eQ?void 0:eQ.length)>0&&!(0,l.Z)(e0.current,eQ)&&(eJ(eQ),e0.current=eQ)},[eQ]);var e1=(0,r.useCallback)(function(){return(0,P.Nh)(B.locale)(D,null==T?void 0:T[eo],eU,eo,ee)},[B.locale,D,T,eo,eU,ee]),e2=(0,c.useInfiniteQuery)({queryKey:[n1.z7,eo,D,null==T?void 0:T[eo]],queryFn:e1,onSuccess:function(e){es(function(t){var n,r,a,l;return n5(n5({},t),{},(0,i.Z)({},eo,{vehicles:ea([].concat((0,o.Z)(eL&&null!==(n=null===(r=t[eo])||void 0===r?void 0:r.vehicles)&&void 0!==n?n:[]),(0,o.Z)(e.pages.flatMap(function(e){var t;return null!==(t=null==e?void 0:e.vehicles)&&void 0!==t?t:[]})))),facets:null===(a=e.pages[0])||void 0===a?void 0:a.facets,meta:null===(l=e.pages[0])||void 0===l?void 0:l.meta}))}),ek(!1),eT(!1)},getNextPageParam:function(e){var t,n,i=null==e||null===(t=e.meta)||void 0===t||null===(t=t.nextPageSearchCriteria)||void 0===t?void 0:t.pageNumber;return null!=e&&null!==(n=e.meta)&&void 0!==n&&n.hasMorePages?i:void 0},onError:function(e){return w.Z.error("Error fetching vehicles and facets",e)},enabled:eP&&!R("noSTO"),keepPreviousData:!0}),e5=e2.data,e6=e2.hasNextPage,e3=e2.isFetching,e4=e2.refetch,e9=e2.isError;(0,r.useEffect)(function(){(Object.keys(D).length>0||!(0,l.Z)(eA.current,D))&&(e4(),eA.current=D)},[D,e4]),(0,r.useEffect)(function(){(!eR||null!=eM&&eM.long||null!=eM&&eM.lat)&&(eC(!1),ey(!0),ev(!0))},[eR,eM]),(0,r.useEffect)(function(){return sessionStorage.setItem(C.J8,B.asPath)});var e7=function(e,t){(0,k._7)(e.coords.latitude,e.coords.longitude).then(function(n){if(eE([{name:"long",value:e.coords.longitude},{name:"lat",value:e.coords.latitude},{name:"radius",value:eH},{name:"placeId",value:n.place_id}]),ey(!0),["prompt","granted"].includes(t)){var i=n.address_components.find(function(e){return e.types.includes("locality")}).long_name,o=n.address_components.find(function(e){return e.types.includes("country")}).long_name,r="prompt"===t?"geolocation":"autoadjust",a="".concat(i,", ").concat(o);K({action:"plp inventory search",searchType:"plp-location-popup-filter",searchTerm:"".concat(r,"|").concat(a)})}})},e8=(0,n1.Ef)(null==ec||null===(F=ec[eo])||void 0===F?void 0:F.facets,null==ec||null===(S=ec[eo])||void 0===S?void 0:S.meta);(0,l.Z)(eu,e8)||(ep(e8),es(function(e){var t;return n5(n5({},e),{},(0,i.Z)({},eo,{vehicles:ea(null==e5?void 0:e5.pages.flatMap(function(e){var t;return null!==(t=null==e?void 0:e.vehicles)&&void 0!==t?t:[]})),facets:e8,meta:null==e5||null===(t=e5.pages[0])||void 0===t?void 0:t.meta}))}));var te={vehicles:null==ec||null===(N=ec[eo])||void 0===N||null===(N=N.vehicles)||void 0===N?void 0:N.map(function(e){return n5(n5({},e),{},{modelNameWithOverride:(0,_.aB)(null==e?void 0:e.modelName,U("overrideModelsName"))})}),facets:e8,meta:null==ec||null===(L=ec[eo])||void 0===L?void 0:L.meta,selectedFacets:D,setSelectedFacets:V,hasNextPage:e6,isLoadingVehiclesAndFacets:e3,isB2B:Q,isLoadingSantanderOffers:eK,isErrorSantanderOffers:e$,santanderOffers:ej,setSantanderOffers:eO,santanderFinanceOptions:eX,vehicleType:eo,setPageNumber:Z,vatStatus:eW,handleClearAllFilters:function(){B.push(G(Q?"business":"cars-for-sale"),void 0,{shallow:!0}),V({}),null!=D&&D.location&&eS(!0)},resetLocation:eF,setResetLocation:eS,onHandleVehicleTypeChange:function(e){er(e),ek(!0)},location:eB,setIsLoadingB2B:eV,isLoadingB2B:eD};return(0,W.jsxs)(p.Z.Provider,{value:te,children:[(0,W.jsx)(n0,{page:T[eo],onShowMoreClick:function(){Z(function(e){return n5(n5({},e),{},(0,i.Z)({},eo,e[eo]+1))}),eT(!0),ek(!0)},isError:e9}),eR&&(0,W.jsx)(q,{isOpen:ex,onClose:function(){if(eC(!1),ev(!0),ez){ey(!0);return}em||setTimeout(function(){ev(!1),eC(!0)},300)},getLocation:function(){var e="";navigator.permissions&&navigator.permissions.query({name:"geolocation"}).then(function(t){e=t.state}),navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){return e7(t,e)},function(e){return w.Z.info("HardGate - getCurrentLocation =>",e)})},resetSearchInput:eh})]})}},76862:function(e,t,n){n.d(t,{Ef:function(){return d},XA:function(){return p},Yu:function(){return u},z7:function(){return s}});var i=n(90116),o=n(59499),r=n(43697),a=n(19789);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,o.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s="vehicles-facets",d=function(e,t){var n,i,o;return c(c({},e),{},{price:c(c({},null==e?void 0:e.price),{},{selected:(null==t||null===(n=t.nextPageSearchCriteria)||void 0===n?void 0:n.maxPrice)!==void 0||(null==t||null===(i=t.nextPageSearchCriteria)||void 0===i?void 0:i.maxMonthlyPrice)===void 0}),monthlyPrice:c(c({},null==e?void 0:e.monthlyPrice),{},{selected:(null==t||null===(o=t.nextPageSearchCriteria)||void 0===o?void 0:o.maxMonthlyPrice)!==void 0})})},u=function(e,t,n){return null==e?void 0:e.map(function(e){var i=(0,a.Sb)(e,null,n),o=i.rrpPrice,r=i.rrpPriceWithoutVat,l=i.discountedPrice,s=i.discountedPriceWithoutVat,d=i.hasDiscount,u=i.hasDiscountWithoutVat;return c(c({},e),{},{vehicleType:t,rrpPrice:o,rrpPriceWithoutVat:r,discountedPrice:l,discountedPriceWithoutVat:s,hasDiscount:d,hasDiscountWithoutVat:u,allDiscountSTO:n("all_discount_STO"),inPLP:!0})})},p=function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4?arguments[4]:void 0;if(!e)return e;for(var c=[],s=(0,i.Z)(e),d=(null===(n=l("plpOfferCardTitle"))||void 0===n?void 0:n.length)||0,u=(null==e?void 0:e.length)===1?null==e?void 0:e.length:o,p=a?d:1/0;u<=e.length&&c.length<p;)c.push(u),u+=r.L8;var f=c.slice(0,t),h=new Set(s.map(function(e,t){return(null==e?void 0:e.offerIndex)!==void 0?t:null}).filter(function(e){return null!==e}));return f.forEach(function(e,t){h.has(e)||(s.splice(e,0,{offerIndex:t}),h.add(e))}),s}},39658:function(e,t,n){n.d(t,{WV:function(){return g},cY:function(){return h},dk:function(){return y},gv:function(){return f},k$:function(){return b},nD:function(){return m},p0:function(){return C},pe:function(){return v},rP:function(){return x}});var i,o,r,a=n(59499),l=n(4730),c=n(76573),s=["place_id","description"],d=["place_id","dealerName"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){(0,a.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(){return i||(i=new google.maps.places.AutocompleteService),{getPlacePredictions:function(e){return function(t){return new Promise(function(n,o){return i.getPlacePredictions({input:t,componentRestrictions:{country:e}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"OK"===t?n(e):o(t)})})}}}},h=function(){return o||(o=new google.maps.Geocoder),{getPlaceDetails:function(e){return new Promise(function(t,n){o&&o.geocode({placeId:e},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;"OK"===i&&e?t(e[0]):n(i)})})}}},v=function(){return r||(r=new google.maps.DirectionsService),{getDirections:function(e){return new Promise(function(t,n){return r.route(e,function(e,i){return"OK"===i?t(e):n(i)})})}}},g=function(e,t){return new google.maps.LatLng(e,t)},m=function(e,t){return o||(o=new google.maps.Geocoder),new Promise(function(n,i){return o.geocode({location:g(e,t)},function(e,t){return"OK"===t?n(e):i(t)})})},y=function(e){return(0,c.Z)(e)>2},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return y(e)?t.map(function(e){return p({id:e.place_id,label:e.description},(0,l.Z)(e,s))}):[]},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return y(e)?t.map(function(e){return p({id:e.place_id,label:e.dealerName},(0,l.Z)(e,d))}):[]},C=function(e){var t=e.split(",").map(function(e){return e.trim()});if(t.length<=1)return t.join(", ");var n=t.slice(-2);return[n[0].replace(/^\d{5}\s*/,"").trim(),n[1]].join(", ")}},53456:function(e,t,n){n.d(t,{C:function(){return o}});var i=n(67294),o=function(){var e=(0,i.useState)(!1),t=e[0],n=e[1];return(0,i.useEffect)(function(){var e=setInterval(function(){window.google&&(n(!0),clearInterval(e))},100);return function(){return clearInterval(e)}},[]),t}},76328:function(e,t,n){var i=n(67294),o=n(53630),r=n(22254);t.Z=function(){var e=(0,i.useContext)(r.Z);window.matchMedia=window.matchMedia||function(){return{matches:!1,media:"",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}}};var t=(0,i.useState)(window.matchMedia("screen and (max-width: 960px)").matches),n=t[0],a=t[1];return(0,i.useEffect)(function(){var e=function(){a(window.matchMedia("screen and (max-width: 960px)").matches)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),!!n||(0,o.Z)(e).phone}},30216:function(e,t,n){var i=n(67294);t.Z=function(e){var t=(0,i.useRef)();return(0,i.useEffect)(function(){t.current=e}),t.current}},179:function(e,t,n){n.d(t,{H2:function(){return d},i6:function(){return s},lf:function(){return c}});var i=n(59499),o=n(56082),r=n(96673);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,o.U2)("dealers.search",{locale:e,debugId:t,pathParams:l({},(0,r.B1)(e)),queryParams:l(l(l({searchToken:n,dealerWithInventory:i},a[0]&&{categories:a[0]}),a[1]&&{services:a[1]}),a[2]&&{outletType:a[2]})}).then(function(e){return e.data})}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(n){return(0,o.U2)("dealer",{locale:e,debugId:t,pathParams:l(l({},(0,r.B1)(e)),{},{dealerId:n})})}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.v_)("dealers.search.geolocation",n,{locale:e,debugId:t,pathParams:l({},(0,r.B1)(e))}).then(function(e){return e.data})}}},59658:function(e,t,n){n.d(t,{FY:function(){return u},Gm:function(){return l},_7:function(){return s},ck:function(){return c},sN:function(){return d}});var i=n(72593),o=n(90178),r=n(39658),a=n(96673),l=function(e,t){var n=(0,a.B1)(e).countryCode;return(0,r.gv)().getPlacePredictions(n)(t).then((0,i.Z)((0,o.Z)(["description","place_id"])))},c=function(e){return(0,r.cY)().getPlaceDetails(e).then(function(e){return{description:e.formatted_address,lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}})},s=function(e,t){return(0,r.nD)(e,t).then(function(e){return e[0]})},d=function(e){return(0,r.pe)().getDirections(e).then(function(e){var t;return(0,i.Z)((0,o.Z)(["start_address","end_address"]))(null==e||null===(t=e.routes)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.legs)})},u=function(e,t){return(0,r.WV)(e,t)}}}]);