$(function(){window.routing=new Navigo(null,!1,"#");window.routing.on({"/Search/*":n=>{window.routing.dispatchSearchRouteChanged(n)},"/Search":()=>{window.routing.dispatchSearchRouteChanged()},"/":()=>{window.routing.dispatchSearchRouteChanged()}}).on("/Design/:stockCode",n=>{window.dispatchEvent(new CustomEvent("design:open",{detail:n}))}).on("/Moodboard/Shared/:id",n=>{Moodboard.loadById(n.data.id)}).on("/Moodboard/:guid",n=>{Moodboard.loadByGuid(n.data.guid)}).on("/Moodboard",()=>Moodboard.showMoodboard.check()).on("/Basket",()=>{var n=Alpine.store("basket");n.open()});window.routing.addLeaveHook("/Moodboard",n=>{Moodboard.close(),n()});window.routing.addLeaveHook("/Basket",n=>{var t=Alpine.store("basket");t.close();window.routing.dispatchSearchRouteChanged();n()});window.routing.addLeaveHook("/Design/:stockCode",n=>{window.dispatchEvent(new CustomEvent("design:close")),n()});window.routing.addLeaveHook("/Search/*",n=>{window.routing.lastSearchUrl=window.location.pathname+window.location.search,window.routing.lastSearchTitle=document.title,n()});window.routing.isFirst=function(){return window.routing.lastResolved()===null};window.routing.dispatchSearchRouteChanged=function(n){window.routing._suppress||window.dispatchEvent(new CustomEvent("search:route-changed",{detail:n}))};window.routing.navigateBackToLastSearch=function(n=true){function t(n,t){t&&window.routing.navigateSilently(n);window.routing.navigate(n)}window.routing.lastSearchUrl?(t(window.routing.lastSearchUrl,n),document.title=window.routing.lastSearchTitle):t("/",n)};window.routing.resolve();const n=window.routing.lastResolved();if(n&&n.length&&n[0].route.path==="Design/:stockCode"){const t=n[0].data.stockCode;window.dispatchEvent(new CustomEvent("search:initialise-for-design",{detail:{stockCode:t}}))}window.routing.navigateSilently=function(n){this._suppress=!0;this.navigate(n);setTimeout(()=>this._suppress=!1,50)}})