1"use strict";(this.webpackChunkgoodwood_ui=this.webpackChunkgoodwood_ui||[]).push([[7470],{7470(e,t,n){n.d(t,{default:()=>j});var i=n(2078),o=n(4804),r=n(6701);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}const u=function(){return e=function e(t){var n=t.menuDimensions,i=t.anchorElement,o=t.mouseX,r=t.mouseY;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.menuDimensions=n,this.anchorElement=i,this.mouseX=o,this.mouseY=r},(t=[{key:"create",value:function(){var e="http://www.w3.org/2000/svg";return this.svg=document.createElementNS(e,"svg"),this.svg.style.position="fixed",this.svg.style.pointerEvents="none",this.safePath=document.createElementNS(e,"path"),this.safePath.setAttributeNS(null,"pointer-events","auto"),this.safePath.setAttributeNS(null,"fill","transparent"),this.svg.appendChild(this.safePath),this.svg}},{key:"update",value:function(){var e=this.menuDimensions,t=e.height,n=e.x,i=e.y,o=n-this.anchorElement.getBoundingClientRect().x+5-this.anchorElement.getBoundingClientRect().width/2,r=t;this.svg.style.width="".concat(o,"px"),this.svg.style.height="".concat(r,"px");var a=this.anchorElement.getBoundingClientRect();this.svg.style.top="".concat(i-58,"px"),this.svg.style.left="".concat(a.left+a.width/2+25,"px"),this.safePath.setAttributeNS(null,"d","M 0, ".concat(a.top-60,"\n L ").concat(o,",").concat(r,"\n L ").concat(o,",0 z"))}},{key:"draw",value:function(){this.anchorElement.prepend(this.create()),this.update()}},{key:"destroy",value:function(){this.svg.remove()}}])&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function v(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var m;const d=new(function(){return e=function e(){var t,n,i,o=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,i=function(e){o.x=e.clientX,o.y=e.clientY},(n=v(n="onMouseMove"))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,m)throw new Error("New instance cannot be created!!");m=this,this.x=0,this.y=0},(t=[{key:"position",get:function(){return{x:this.x,y:this.y}}},{key:"start",value:function(){window.addEventListener("mousemove",this.onMouseMove)}},{key:"stop",value:function(){window.removeEventListener("mousemove",this.onMouseMove)}}])&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());var f=n(253),p=n(706);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function b(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}function g(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=y(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}var L=function(e,t){var n=Array.prototype.filter.call(e.children,function(e){return e.matches(t)});return n.length>0?n[0]:null},S=function(){function e(t){var n,i,o=this,r=t.container,a=t.graphicContainer,s=t.prev,c=t.next,u=t.columnController,l=t.columnIndex,h=t.onMenuActive,v=t.onMenuEnter,m=t.focusLockedContainer;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),g(this,"handleMouseEnter",function(){o.onMenuEnter()}),g(this,"handleKeydown",function(e){("Space"===e.code&&(o.onMenuEnter(),o.handleMouseOver({target:e.target})),"ArrowDown"===e.code)&&(o.activeIndex+1===o.options.length?o.options[o.activeIndex=0]:o.options[++o.activeIndex]).focus();"ArrowUp"===e.code&&(o.activeIndex-1<0?o.options[o.activeIndex=o.options.length-1]:o.options[--o.activeIndex]).focus();"ArrowRight"===e.code&&o.next&&o.next.focusFirstItem(),"ArrowLeft"===e.code&&o.prev&&o.prev.focusActiveItem()}),g(this,"handleMouseOver",function(e){o.activeIndex=o.options.indexOf(e.target);var t=e.target;t.classList.contains(f.Uw.isActive)||o.activeHoveredItem&&o.activeHoveredItem.contains(t)||(o.showNextMenu(t),o.replaceGraphic(t))}),this.container=r,this.title=null!==(n=this.container.dataset.menuTitle)&&void 0!==n?n:null,this.titleUrl=null!==(i=this.container.dataset.menuTitleUrl)&&void 0!==i?i:"/",this.graphicContainer=a,this.columnController=u,this.columnIndex=l,this.activeIndex=0,this.prev=s,this.next=c,this.onMenuActive=h||function(){},this.onMenuEnter=v||function(){},this.focusLockedContainer=m,this.hasIntialActiveOptions=!1;var d=this.container.querySelectorAll('[data-mega-menu-item="'.concat(this.columnIndex,'"] > a'));this.options=d?Array.from(d):[],this.addTitleToMenu(this.title,this.titleUrl),this.handleMouseOver=(0,p.AS)(this.handleMouseOver,"a"),this.handleKeydown=(0,p.AS)(this.handleKeydown,"a"),this.bindEvents(),this.checkIfInitialActive(),this.show()}return t=e,n=[{key:"bindEvents",value:function(){this.container.addEventListener("mouseover",this.handleMouseOver),this.container.addEventListener("keydown",this.handleKeydown),this.container.addEventListener("mouseenter",this.handleMouseEnter)}},{key:"unbindEvents",value:function(){this.container.removeEventListener("mouseover",this.handleMouseOver),this.container.removeEventListener("keydown",this.handleKeydown),this.container.removeEventListener("mouseenter",this.handleMouseEnter)}},{key:"addTitleToMenu",value:function(e,t){if(e){var n=document.createElement("div"),i=document.createElement("div");i.innerHTML='\n<div class="after:content-[\'\'] after:w-[32px] after:h-[1px] after:bg-white-20 after:block after:ml-5 sm:after:ml-[min(50px,12%)] after:mt-4 after:mb-4">\n <h3 class="heading-20 capitalize block py-3 px-5 sm:px-[min(50px,12%)]">\n <a class="no-underline focus-visible:outline-none hover:text-white-100 text-white-50 transition-all duration-200" href="{{titleUrl}}">{{title}}</a>\n </h3>\n</div>'.replace("{{title}}",e).replace("{{titleUrl}}",t),n.appendChild(i),n.appendChild(this.container),this.container.classList.remove("hidden"),this.container=n}}},{key:"checkIfInitialActive",value:function(){var e=this;this.focusLockedContainer.classList.contains("is-initial-render")&&this.options.forEach(function(t){t.classList.contains("is-initial-active")&&(e.hasIntialActiveOptions=!0,e.showNextMenu(t))})}},{key:"focusFirstItem",value:function(){var e=this.container.querySelector("a");e&&e.focus()}},{key:"focusActiveItem",value:function(){this.activeHoveredItem&&this.activeHoveredItem.focus()}},{key:"replaceGraphic",value:function(e){this.replaceGraphicContent();var t=L(e.parentElement,f.Xz.subMenuGraphic);t&&this.columnController.add(t.cloneNode(!0),3)}},{key:"showNextMenu",value:function(t){var n=L(t.parentElement,f.Xz.subMenu),i=L(t.parentElement,f.Xz.subMenuGraphic);this.clearAdjacentColumns(),this.activeHoveredItem&&this.activeHoveredItem.classList.remove(f.Uw.isActive),this.activeHoveredItem=t,this.activeHoveredItem.classList.add(f.Uw.isActive),n&&(this.onMenuActive(),this.next=new e({prev:this,container:n.cloneNode(!0),graphicContainer:i?i.cloneNode(!0):void 0,focusLockedContainer:this.focusLockedContainer,columnController:this.columnController,columnIndex:this.columnIndex+1}),this.hoverTriangle=new u({anchorElement:t,menuDimensions:this.next.getDimensions(),mouseX:d.x,mouseY:d.y}),this.hoverTriangle.draw())}},{key:"clearAdjacentColumns",value:function(){this.hoverTriangle&&this.hoverTriangle.destroy();for(var e=this.next;e;)e.activeHoveredItem&&(e.activeHoveredItem.classList.remove(f.Uw.isActive),e.activeHoveredItem=null),e.hide(),e=e.next}},{key:"getDimensions",value:function(){return this.container.getBoundingClientRect()}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.clearAdjacentColumns(),this.activeHoveredItem&&(this.activeHoveredItem.classList.remove(f.Uw.isActive),this.activeHoveredItem=null),e||this.unbindEvents()}},{key:"show",value:function(){0!==this.columnIndex&&(this.columnController.add(this.container,this.columnIndex),this.graphicContainer&&this.columnController.add(this.graphicContainer,this.columnIndex+1))}},{key:"hide",value:function(){this.columnController.clear(this.columnIndex),this.graphicContainer&&this.columnController.clear(this.columnIndex+1)}},{key:"replaceGraphicContent",value:function(){this.graphicContainer&&this.columnController.clear(3)}}],n&&b(t.prototype,n),i&&b(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();const C=S;function E(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,O(i.key),i)}}function x(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O(e){var t=function(e,t){if("object"!=k(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=k(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k(t)?t:t+""}var A=function(){return x(function e(t){I(this,e),this.element=t},[{key:"add",value:function(e){e.classList.add(f.Xz.menuColumnInner,"h-full"),this.currentActiveElement!==e&&(e.classList.remove("hidden"),this.clearColumn(),this.element.appendChild(e),this.currentActiveElement=e,this.element.animate([{opacity:0}
1,{opacity:1}],{duration:150,fill:"forwards"}),this.menuDimensions=e.getBoundingClientRect())}},{key:"clear",value:function(){var e=this.element.querySelector(".".concat(f.Uw.isActive));e&&e.classList.remove(f.Uw.isActive),this.element.innerHTML="",this.currentActiveElement=null}},{key:"getMenuDimensions",value:function(){return this.menuDimensions}},{key:"clearColumn",value:function(){var e=this.element.querySelector(".".concat(f.Uw.isActive));e&&e.classList.remove(f.Uw.isActive),this.element.innerHTML=""}},{key:"isActive",value:function(){return null!==this.currentActiveElement}}])}(),U=function(){return x(function e(t,n){var i=this;I(this,e),E(this,"onMouseLeave",function(e){e.target.classList.contains(f.Xz.menuColumnInner)&&(i.enteredColumn=!1,setTimeout(function(){if(!i.enteredColumn){var e=new CustomEvent("menu:show-homescreen",{detail:{count:i.activeColumnCount}});window.dispatchEvent(e)}}))}),E(this,"onMouseEnter",function(e){e.target.classList.contains(f.Xz.menuColumnInner)&&(i.enteredColumn=!0)});var o=Array.from(t.querySelectorAll(n));this.columns=o.map(function(e){return new A(e)}),this.activeColumnCount=1,this.enteredColumn=!1,document.body.addEventListener("mouseleave",this.onMouseLeave,!0),document.body.addEventListener("mouseenter",this.onMouseEnter,!0)},[{key:"add",value:function(e,t){this.columns[t].add(e)}},{key:"getColumn",value:function(e){return this.columns[e]}},{key:"clear",value:function(e){this.columns[e].clear()}},{key:"destroy",value:function(){this.columns.forEach(function(e,t){t>0&&e.clear()})}}])}();function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function N(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,P(i.key),i)}}function H(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!=T(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=T(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==T(t)?t:t+""}const j=function(){return e=function e(t,n,a){var s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),H(this,"handleMouseEnter",function(){s.isOverHeroImage&&s.mainNavigationWrapper.classList.add(f.Uw.isSolid)}),H(this,"handleMouseLeave",function(e){s.container.classList.contains(f.Uw.isOpen)||s.isOverHeroImage&&(s.mainNavigationWrapper.contains(e.relatedTarget)||s.mainNavigationWrapper.classList.remove(f.Uw.isSolid))}),H(this,"showSearchView",function(){s.searchBar.classList.contains("active")&&(s.container.classList.remove(f.Uw.isOpen),s.mainNavigationWrapper.classList.remove(f.Uw.isSolid))}),H(this,"closeOverMenu",function(){s.container.classList.remove(f.Uw.isOpen),s.menuToggle.classList.remove(f.Uw.isOpen),(0,r.Tl)(s.container),s.trap.deactivate(),s.rootMenu.reset(),s.focusLockedContainer.classList.add(f.Uw.isInitialRender)}),H(this,"handleMenuToggleClick",function(e){s.container.classList.contains(f.Uw.isOpen)?s.closeOverMenu():(s.rootMenu=new C({container:s.rootMenuHtmlElement,columnController:s.columnController,focusLockedContainer:s.focusLockedContainer,columnIndex:0,onMenuActive:function(){s.hideHomeScreen()},onMenuEnter:function(){s.focusLockedContainer.classList.remove(f.Uw.isInitialRender)}}),s.container.classList.add(f.Uw.isOpen),s.mainNavigationWrapper.classList.add(f.Uw.isSolid),s.menuToggle.classList.add(f.Uw.isOpen),(0,r.s2)(s.container),s.currentModalOpenedId&&o.A.close(s.currentModalOpenedId),s.currentModalOpenedId=null,s.rootMenu.hasIntialActiveOptions||s.showHomeScreen(),0===e.detail&&s.trap.activate())}),this.container=t,this.menuToggle=n,this.heroImage=a,this.openedIndex=1,this.focusLockedContainer=this.container.querySelector(f.Xz.focusLockedContainer),this.mainNavigationWrapper=document.querySelector(f.Xz.navigationWrapper),this.columnController=new
1U(this.container,f.Xz.menuColumn),this.homeScreen=this.container.querySelector(f.Xz.homeScreen),this.trap=i.K(this.focusLockedContainer),this.isOverHeroImage=!0,this.rootMenuHtmlElement=this.container.querySelector(f.Xz.rootMenu),this.focusLockedContainer.classList.add(f.Uw.isInitialRender),this.searchBar=document.querySelector(".search-bar"),this.searchButton=document.querySelector("[data-open-search-bar]"),this.currentModalOpenedId=null,this.bindEvents()},t=[{key:"bindEvents",value:function(){var e,t=this;this.mainNavigationWrapper.addEventListener("mouseenter",this.handleMouseEnter),this.mainNavigationWrapper.addEventListener("mouseleave",this.handleMouseLeave),this.menuToggle.addEventListener("click",this.handleMenuToggleClick),null===(e=this.searchButton)||void 0===e||e.addEventListener("click",this.showSearchView),window.addEventListener("menu:show-homescreen",function(){t.showHomeScreen(),t.rootMenu&&t.rootMenu.reset(!0)}),d.start(),this.heroImage&&(new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting?(t.isOverHeroImage=!0,t.mainNavigationWrapper.classList.remove(f.Uw.isSolid)):(t.isOverHeroImage=!1,t.mainNavigationWrapper.classList.add(f.Uw.isSolid))})},{rootMargin:"-".concat(this.mainNavigationWrapper.offsetHeight,"px")}).observe(this.heroImage),this.mainNavigationWrapper.addEventListener("mouseenter",function(){t.mainNavigationWrapper.classList.add(f.Uw.isSolid)}),this.mainNavigationWrapper.addEventListener("mouseleave",function(e){t.container.classList.contains(f.Uw.isOpen)||t.isOverHeroImage&&(t.mainNavigationWrapper.contains(e.relatedTarget)||t.mainNavigationWrapper.classList.remove(f.Uw.isSolid))}))}},{key:"destroy",value:function(){this.container.classList.remove(f.Uw.isOpen),this.mainNavigationWrapper.classList.remove(f.Uw.isSolid),this.menuToggle.classList.remove(f.Uw.isOpen),this.rootMenu&&this.rootMenu.reset(),this.menuToggle.removeEventListener("click",this.handleMenuToggleClick),this.columnController.destroy(),d.stop()}},{key:"showHomeScreen",value:function(){this.homeScreen.classList.remove("!hidden"),this.homeScreen.animate([{opacity:1}],{duration:540,fill:"forwards"})}},{key:"hideHomeScreen",value:function(){var e=this;this.homeScreen.classList.add("!hidden"),this.homeScreen.animate([{opacity:1},{opacity:0}],{duration:250,fill:"forwards"}).finished.then(function(){e.homeScreen.classList.add("!hidden")})}}],t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.