1var DriSearchLib=function(e){var t={};function r(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(s,i,function(t){return e[t]}.bind(null,i));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),i=r(2),o=function(){function e(e,t,r){void 0===e&&(e=!1),this.lastLoggedKeyword="",this.searchWidgetPosition="Header middle",this.searchResults=[],this.productPages=[],this.categoryPages=[],this.otherPages=[],this.recentSearchTerms=null,this.enableMaxHeight=!1,this.statuses={search_bar_active:!1,search_in_progress:!1},this.search_count={other:4,product:8,category:4},this.keyword="",this.isLoggedIn=e,this.config=t,this.SearchService=new s.SearchService(t,r),this.config.product_search_count=this.config.product_search_count?this.config.product_search_count:this.search_count.product,this.config.category_search_count=this.config.category_search_count?this.config.category_search_count:this.search_count.category,this.config.other_search_count=this.config.other_search_count?this.config.other_search_count:this.search_count.other,this.config.enable_search_datalayer=!!this.config.enable_search_datalayer&&this.config.enable_search_datalayer,this.searchEvent=new i.EventEmitter,this.isLoggedIn?this.SearchService.getCustomerRecentSearches():this.SearchService.clearRecentSearches()}return e.prototype.setWidgetContainer=function(e){this.widgetContainer=document.getElementById(e)},e.prototype.setSearchWidgetPosition=function(e){this.searchWidgetPosition=e},e.prototype.clearSearch=function(e){var t=this;if(window.innerWidth<768&&this.widgetContainer.querySelector(".search-result-container")&&(this.widgetContainer.querySelector(".search-result-container").style.display="none"),this.statuses.search_in_progress&&(this.searchResource.http.abort(),this.statuses.search_in_progress=!0),this.keyword="",this.searchResults=[],this.categoryPages=[],this.productPages=[],this.otherPages=[],!this.config.close_search_after_clear){var r=this.isLoggedIn?this.SearchService.getRecentSearches():null;r&&r.then((function(e){e&&(t.recentSearchTerms=JSON.parse(e).reverse()),t.displayResults()})),setTimeout((function(){t.widgetContainer.querySelector(".search-bar").focus()}))}},e.prototype.searchKeyword=function(){var e=this;this.statuses.search_in_progress&&this.searchResource&&this.searchResource.http.abort(),this.statuses.search_in_progress=!0,this.searchResource=this.SearchService.search(this.keyword),this.searchResource.promise.then((function(t){var r=e.statuses.search_bar_active?3e3:0;e.processSearchResults(t.response),e.statuses.search_in_progress=!1,e.logTimeout&&clearTimeout(e.logTimeout),e.searchResults.length&&(e.statuses.search_bar_active=!0,e.setSearchResultsMaxHeight(),e.toggleBackdrop(!0)),e.searchEvent.emit("search","onSearchFinished",!0),e.widgetContainer.querySelector(".search-bar").focus(),e.logTimeout=setTimeout((function(){e.lastLoggedKeyword!=e.keyword&&e.keyword&&(e.lastLoggedKeyword=e.keyword,e.SearchService.log(e.keyword,e.searchResults.length>0,e.searchWidgetPosition).promise.then((function(e){})))}),r)}),(function(e){console.log(e)}))},e.prototype.toggleBackdrop=function(e){var t=this.widgetContainer.querySelector(".search-result-container");window.innerWidth<768?setTimeout((function(){t&&(t.style.display="block")})):e?(this.widgetContainer.querySelector(".search-widget-backdrop").classList.add("shown"),t&&t.classList.remove("hidden-result")):(this.widgetContainer.querySelector(".search-widget-backdrop").classList.remove("shown"),t&&t.classList.add("hidden-result"))},e.prototype.setSearchResultsMaxHeight=function(){var e=this;if(this.enableMaxHeight){var t=this.widgetContainer.offsetHeight;setTimeout((function(){if(e.widgetContainer.querySelector(".search-result-container").offsetHeight+t>window.innerHeight){var r=window.innerHeight-t-15;e.widgetContainer.querySelector(".search-result-container").style.maxHeight=r+"px"}}))}},e.prototype.searchBarKeyUpHandler=function(e){if(/^\s*$/.test(this.keyword))return e.target.value="",void this.clearSearch();this.SearchService.triggerDatalayer(this.keyword,this.lastLoggedKeyword,13==e.keyCode),-1!=[13,17,37,38,39,40].indexOf(e.keyCode)||e.ctrlKey||e.shiftKey||this.searchKeyword()},e.prototype.searchBarKeyDownHandler=function(e){var t=this,r=null,s=null,i="";if(-1!=[13,38,40].indexOf(e.keyCode)){e.preventDefault();var o=this.recentSearchTerms?this.recentSearchTerms.length-1:0;s=this.searchResults.length?this.searchResults.length-1:o;var n=this.recentSearchTerms?".recent-search":null;i=this.searchResults.length?".search-result":n,r=this.widgetContainer.querySelector(i+".active")?1*Number(this.widgetContainer.querySelector(i+".active").getAttribute("data-id")):null}switch(e.keyCode){case 13:if(this.searchResults.length){var c=this.widgetContainer.querySelector(".search-result.active"),a=c.getAttribute("data-url"),h=c.getAttribute("data-name");this.logTimeout&&clearTimeout(this.logTimeout),this.isLoggedIn&&void 0!==h&&h&&this.SearchService.addRecentSearch(h),this.lastLoggedKeyword=this.keyword,this.SearchService.log(this.keyword,this.searchResults.length>0,this.searchWidgetPosition,h,a).promise.then((function(e){void 0!==a&&(window.location.href=a)}))}else this.recentSearchTerms&&setTimeout((function(){t.widgetContainer.querySelector(".recent-search.active")&&t.widgetContainer.querySelector(".recent-search.active").click()}));break;case 40:if(null!=r){for(var u=r+1>s?0:r+1,l=this.widgetContainer.querySelectorAll(i),d=0;d<l.length;d++)l[d].classList.remove("active");this.widgetContainer.querySelector(i+'[data-id="'+u+'"]').classList.add("active"),l[r].id="",l[u].id="selected"}break;case 38:if(null!=r){for(u=r-1<0?s:r-1,l=this.widgetContainer.querySelectorAll(i),d=0;d<l.length;d++)l[d].classList.remove("active");this.widgetContainer.querySelector(i+'[data-id="'+u+'"]').classList.add("active"),l[r].id="",l[u].id="selected"}}},e.prototype.searchResultMouseEnterHandler=function(e){for(var t=this.widgetContainer.querySelectorAll(".search-result"),r=0;r<t.length;r++)t[r].classList.remove("active");e.currentTarget.classList.add("active")},e.prototype.searchResultMouseDownHandler=function(e,t,r){e.preventDefault(),3!=e.which&&(this.SearchService.triggerDatalayer(this.keyword,this.lastLoggedKeyword,!0),this.logTimeout&&clearTimeout(this.logTimeout),this.isLoggedIn&&2!=e.which&&this.searchResults.length>0&&void 0!==r&&this.SearchService.addRecentSearch(r),this.lastLoggedKeyword=this.keyword,this.SearchService.log(this.keyword,this.searchResults.length>0,this.searchWidgetPosition,r,t).promise.then((function(r){2!=e.which&&(window.location.href=t)})))}
1,e.prototype.focusInHandler=function(){var e=this,t=this.isLoggedIn?this.SearchService.getRecentSearches():null;!this.keyword&&t?t.then((function(t){t&&(e.recentSearchTerms=JSON.parse(t).reverse()),e.displayResults()})):this.displayResults()},e.prototype.displayResults=function(){var e=this;(this.searchResults.length||this.recentSearchTerms||this.keyword)&&(this.statuses.search_bar_active=!0,this.setSearchResultsMaxHeight(),this.displayTimeout&&clearTimeout(this.displayTimeout),this.toggleBackdrop(!0),this.searchEvent.emit("display","onDisplaySearch",!0),setTimeout((function(){e.widgetContainer.querySelector(".search-bar").focus()})))},e.prototype.focusOutHandler=function(e){var t=this;window.innerWidth>767&&(this.displayTimeout=setTimeout((function(){t.statuses.search_bar_active=!1}),400),this.toggleBackdrop(!1)),this.SearchService.triggerDatalayer(this.keyword,this.lastLoggedKeyword,!0)},e.prototype.onSelectRecentSearch=function(e,t){e.stopPropagation(),this.recentSearchTerms=null,this.keyword=t.replace(/[^\w\s]/gi,""),this.searchKeyword(),this.SearchService.triggerDatalayer(this.keyword,this.lastLoggedKeyword,!0)},e.prototype.recentSearchMouseEnterHandler=function(e){for(var t=this.widgetContainer.querySelectorAll(".recent-search"),r=0;r<t.length;r++)t[r].classList.remove("active");e.currentTarget.classList.add("active")},e.prototype.focusSearchBar=function(e){var t=this;e.stopPropagation(),setTimeout((function(){t.widgetContainer.querySelector(".search-bar").focus()}))},e.prototype.getDisplay=function(e){for(var t=e,r=0,s=this.keyword.trim().split(/\s+/g);r<s.length;r++){var i=s[r].replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=new RegExp(i+"(?!>)","gi");t=t.replace(o,(function(e){return"<b>"+e+"</b>"}))}return t},e.prototype.setIsLoggedIn=function(e){this.isLoggedIn=e},e.prototype.triggerDatalayer=function(e){this.SearchService.triggerDatalayer(this.keyword,this.lastLoggedKeyword,e)},e.prototype.processSearchResults=function(e){if(this.categoryPages=[],this.productPages=[],this.otherPages=[],this.searchResults=[],!e||void 0===e)return!1;for(var t=0,r=e;t<r.length;t++){var s=r[t];switch(s.page_group_code){case"PROD_PAGE":this.productPages.length<this.config.product_search_count&&(this.searchResults.push(s),this.productPages.push(s));break;case"CATEGORY_PAGE":this.categoryPages.length<this.config.category_search_count&&(this.searchResults.push(s),this.categoryPages.push(s));break;default:this.otherPages.length<this.config.other_search_count&&(this.searchResults.push(s),this.otherPages.push(s))}}},e}();t.SearchLib=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),window.dataLayer=window.dataLayer||[];var s=function(){function e(e,t){this.config=e,this.storageService=t}return e.prototype.log=function(e,t,r,s,i){void 0===s&&(s=""),void 0===i&&(i="");var o=this.config.visitor_id_field||"vid",n={url:document.URL,user_typed:e,search_results:t?1:0,user_selected_name:s,user_selected_url:i,visitor_id:this.readCookie(o),widget_position:r};return this.callAjax(this.config.search_log_url+"?website_code="+this.config.website_code,"POST",n)},e.prototype.search=function(e){return this.callAjax(this.config.search_url+"?website_code="+this.config.website_code,"POST",{search:e})},e.prototype.addRecentSearch=function(e){var t=this;if(this.isSafariBrowser())return!1;this.storageService.onConnect().then((function(){t.storageService.get("search_terms").then((function(r){var s=JSON.parse(r)||[],i=1;s.indexOf(e)>-1&&(s.indexOf(e)==s.length-1&&(i=0),s.splice(s.indexOf(e),1));if(void 0!==e&&s.push(e),s.length>3&&s.splice(0,1),t.storageService.set("search_terms",JSON.stringify(s)),i){var o={search_terms:s},n={},c=t.readCookie(t.config.access_token_field);return c&&(n={Authorization:"Bearer "+c}),t.callAjax(t.config.recent_search_url+"?website_code="+t.config.website_code,"post",o,n).promise.then((function(e){return!0})),!0}return!0}))}))},e.prototype.getRecentSearches=function(){var e=this;return!this.isSafariBrowser()&&this.storageService.onConnect().then((function(){return e.storageService.get("search_terms")}))},e.prototype.getCustomerRecentSearches=function(){var e=this;if(this.isSafariBrowser())return!1;this.storageService.onConnect().then((function(){e.storageService.get("fetched_searches").then((function(t){if(!t){var r={},s=e.readCookie(e.config.access_token_field);s&&(r={Authorization:"Bearer "+s}),e.callAjax(e.config.recent_search_url+"?website_code="+e.config.website_code,"GET",{},r).promise.then((function(t){t.success&&e.storageService.del("search_terms").then((function(){t.search_terms&&(e.storageService.set("search_terms",JSON.stringify(t.search_terms.search_terms)).then((function(){})),e.storageService.set("fetched_searches",!0).then((function(){})))})).catch((function(e){console.log(e)}))}))}})).catch((function(e){}))}))},e.prototype.clearRecentSearches=function(){var e=this;if(this.isSafariBrowser())return!1;this.storageService.onConnect().then((function(){e.storageService.del("search_terms","fetched_searches").then((function(){}))}))},e.prototype.callAjax=function(e,t,r,s){void 0===t&&(t="GET"),void 0===r&&(r={}),void 0===s&&(s={});var i=new XMLHttpRequest;return{promise:new Promise((function(o,n){if(i.open(t,e),i.setRequestHeader("Content-type","application/json"),s)for(var c in s)i.setRequestHeader(c,s[c]);i.onload=function(){4===i.readyState&&200===i.status?o(JSON.parse(this.responseText)):n(Error(i.statusText))},i.onerror=function(){n(Error("Network Error"))},i.send(JSON.stringify(r))})),http:i}},e.prototype.triggerDatalayer=function(e,t,r){if(this.config.enable_search_datalayer){var s="productSearchClick",i=1;r||(s="productSearch",i=3e3),e==t&&0!=t.length||clearTimeout(this.logTimeout),this.logTimeout=setTimeout((function(){e!=t&&window.dataLayer.push({event:s,search_term:null!=e?e:""})}),i)}},e.prototype.readCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),s=0;s<r.length;s++){for(var i=r[s];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},e.prototype.isSafariBrowser=function(){var e=navigator.userAgent.indexOf("Chrome")>-1;return!!(navigator.userAgent.indexOf("Safari")>-1)&&!e},e}();t.SearchService=s},function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(){this.events={},this.events={}}return e.prototype.subscribe=function(e,t,r){var s=this,i=e+":"+t;return this.events[i]||(this.events[i]=[]),this.events[i].push(r),function(){s.events[i]=s.events[i].filter((function(e){return r!==e}))}},e.prototype.emit=function(e,t,r){var s=e+":"+t,i=this.events[s];i&&i.forEach((function(e){e.call(null,r)}))},e.prototype.clear=function(){this.events={}},e}();t.EventEmitter=s}]);
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.