var wtbManager=function(){function e(t){return void 0!==t&&null!=t&&""!=t?!0:!1}function c(t){var o={swaven:{},storeLocator:{}};return o.swaven.action=t.action,o.swaven.productId=void 0,o.swaven.productName=void 0,o.swaven.productVariant=void 0,o.storeLocator.city=void 0,o.storeLocator.zipCode=void 0,o.storeLocator.country=void 0,o.storeLocator.storeId=void 0,o.storeLocator.storeName=void 0,e(t.compat)&&t.compat||e(t.prd)?(console.log("Swaven V1 detected"),e(t.prd)&&(e(t.prd.pid)&&(o.swaven.productId=t.prd.pid),e(t.prd.pname)&&(o.swaven.productName=t.prd.pname),e(t.prd.ppckg))&&(o.swaven.productVariant=t.prd.ppckg),e(t.store)&&(e(t.store.pr)&&(o.swaven.productPrice=t.store.pr),e(t.store.scity)&&(o.storeLocator.city=t.store.scity),e(t.store.szc)&&(o.storeLocator.zipCode=t.store.szc),e(t.store.country)&&(o.storeLocator.country=t.store.country),e(t.store.rid)&&(o.storeLocator.storeId=t.store.rid),e(t.store.rname))&&(o.storeLocator.storeName=t.store.rname)):(console.log("Swaven V2 detected"),e(t.product)&&(e(t.product.id)&&(o.swaven.productId=t.product.id),e(t.product.name)&&(o.swaven.productName=t.product.name),e(t.product.pkg)&&(o.swaven.productVariant=t.product.pkg),e(t.product.price))&&(o.swaven.productPrice=t.product.price),e(t.store)&&(e(t.store.location)&&(e(t.store.location.country)&&(o.storeLocator.country=t.store.location.country),e(t.store.location.city)&&(o.storeLocator.city=t.store.location.city),e(t.store.location.zipCode))&&(o.storeLocator.zipCode=t.store.location.zipCode),e(t.store.id)&&(o.storeLocator.storeId=t.store.id),e(t.store.name))&&(o.storeLocator.storeName=t.store.name),e(t.retailer)&&(e(t.retailer.id)&&(o.storeLocator.storeId=t.retailer.id),e(t.retailer.name))&&(o.storeLocator.storeName=t.retailer.name)),o}return{init:function(){var t=null,o=null;document.head.getAttribute("data-countryCode")&&document.head.getAttribute("languageCode")&&(t=document.head.dataset.countrycode.toUpperCase(),o=document.head.dataset.languagecode.toLowerCase()+"-"+t),null!=o&&(window.swnDataLayer.locale=o),null!=t&&(window.swnDataLayer.country=t);try{var e=window.swnDataLayer=window.swnDataLayer||{},r=(e.appId="60dc895b342d874b2e245d98",e.eventBuffer=e.eventBuffer||[],e.loadBuffer=e.loadBuffer||[],e.push=e.push||function(t){e.eventBuffer.push(t)},e.load=e.load||function(t){e.loadBuffer.push(t)},document.getElementsByTagName("script")[0]),a=document.createElement("script");a.async=!0,a.src="//wtb-tag.swaven.com/scripts/"+e.appId+"/tag.min.js",r.parentNode.insertBefore(a,r)}catch(t){console.log(t)}swnDataLayer.widget_callback=function(t){var o,e;document.head.getAttribute("data-currencyCode")&&document.head.dataset.currencycode,"undefined"!=typeof track&&("dploy"==t.action&&((o={swaven:{}}).swaven.action=t.action,track.push(e={event:"storeLocatorOpen",interaction:o})),"close"==t.action&&((o={swaven:{}}).swaven.action=t.action,e={event:"storeLocatorClose",interaction:o},track.push(e)),"clk"==t.action&&(e={event:"storeLocatorProductDetail",interaction:o=c(t)},track.push(e)),"buy"==t.action&&(e={event:"storeLocatorEtailerClick",interaction:o=c(t)},track.push(e)),"clkloc"==t.action&&(e={event:"storeLocatorViewInfo",interaction:o=c(t)},track.push(e)),"clkRoute"==t.action&&(e={event:"storeLocatorGetDirections",interaction:o=c(t)},track.push(e)),"geoloc"==t.action)&&(e={event:"storeLocatorSearchSubmission",interaction:o=c(t)},track.push(e))}}}};(wtbM=wtbManager()).init();