{"version":3,"sources":["_703-product-cta-bar.js"],"names":["e","t","n","r","s","o","u","a","require","i","Error","f","exports","call","length","1","module","global","factory","document","w","window","this","noGlobal","isFunction","obj","nodeType","item","isWindow","arr","getProto","Object","getPrototypeOf","slice","flat","array","concat","apply","push","indexOf","class2type","toString","hasOwn","hasOwnProperty","fnToString","ObjectFunctionString","support","preservedScriptAttributes","type","src"],"mappings":"AAAA,CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,GAAA,GAAA,CAAAJ,EAAAG,GAAA,CAAA,GAAA,CAAAJ,EAAAI,GAAA,CAAA,IAAAE,EAAA,YAAA,OAAAC,SAAAA,QAAA,GAAA,CAAAF,GAAAC,EAAA,OAAAA,EAAAF,EAAA,CAAA,CAAA,EAAA,GAAAI,EAAA,OAAAA,EAAAJ,EAAA,CAAA,CAAA,EAAA,MAAA,IAAAK,MAAA,uBAAAL,EAAA,GAAA,CAAA,CAAAM,EAAAT,EAAAG,GAAA,CAAAO,QAAA,EAAA,EAAAX,EAAAI,GAAA,GAAAQ,KAAAF,EAAAC,QAAA,SAAAZ,GAAA,IAAAE,EAAAD,EAAAI,GAAA,GAAAL,GAAA,OAAAI,EAAAF,GAAAF,CAAA,CAAA,EAAAW,EAAAA,EAAAC,QAAAZ,EAAAC,EAAAC,EAAAC,CAAA,CAAA,CAAA,OAAAD,EAAAG,GAAAO,OAAA,CAAA,IAAA,IAAAH,EAAA,YAAA,OAAAD,SAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAW,OAAAT,CAAA,GAAAD,EAAAD,EAAAE,EAAA,EAAA,OAAAD,CAAA,EAAA,CAAAW,EAAA,CAAA,SAAAP,EAAAQ,EAAAJ,GAWA,CAAA,SAAAK,EAAAC,GAEA,aAEA,UAAA,OAAAF,GAAA,UAAA,OAAAA,EAAAJ,QASAI,EAAAJ,QAAAK,EAAAE,SACAD,EAAAD,EAAA,CAAA,CAAA,EACA,SAAAG,GACA,GAAAA,EAAAD,SAGA,OAAAD,EAAAE,CAAA,EAFA,MAAA,IAAAV,MAAA,0CAAA,CAGA,EAEAQ,EAAAD,CAAA,CAIA,EAAA,aAAA,OAAAI,OAAAA,OAAAC,KAAA,SAAAD,EAAAE,GAMA,aA+BA,SAAAC,EAAAC,GASA,MAAA,YAAA,OAAAA,GAAA,UAAA,OAAAA,EAAAC,UACA,YAAA,OAAAD,EAAAE,IACA,CAGA,SAAAC,EAAAH,GACA,OAAA,MAAAA,GAAAA,IAAAA,EAAAJ,MACA,CA7CA,IAAAQ,EAAA,GAEAC,EAAAC,OAAAC,eAEAC,EAAAJ,EAAAI,MAEAC,EAAAL,EAAAK,KAAA,SAAAC,GACA,OAAAN,EAAAK,KAAArB,KAAAsB,CAAA,CACA,EAAA,SAAAA,GACA,OAAAN,EAAAO,OAAAC,MAAA,GAAAF,CAAA,CACA,EAGAG,EAAAT,EAAAS,KAEAC,EAAAV,EAAAU,QAEAC,EAAA,GAEAC,EAAAD,EAAAC,SAEAC,EAAAF,EAAAG,eAEAC,EAAAF,EAAAD,SAEAI,EAAAD,EAAA/B,KAAAkB,MAAA,EAEAe,EAAA,GAqBA3B,EAAAE,EAAAF,SAIA4B,EAAA,CACAC,KAAA,CAAA,EACAC,IAAA,CAAA","file":"703-product-bar.min.js","sourcesContent":["var $ = require('jquery');\r\n\r\n$(document).ready(function () {\r\n headerStickyWith703Bar();\r\n});\r\n\r\nfunction headerStickyWith703Bar() {\r\n var deviceViewport = 991;\r\n var headerBottomGap = 80;\r\n if ($(\".cc-productbarposition\").length) {\r\n var headerHeight = $('.header')[0].clientHeight;\r\n\r\n if ($('.breadcrumb').innerHeight()) {\r\n var productBarHeight = $('.cc-productbarposition').innerHeight();\r\n\r\n $('.cc-productbarposition').css({\r\n 'top': headerHeight + 'px'\r\n });\r\n\r\n if ($(\".header__position\").css(\"position\") == \"fixed\" && $('.header-wrapper')) {\r\n $('.header-wrapper').css({\r\n 'height': ($(window).width() > deviceViewport) ? headerHeight + productBarHeight : headerHeight + 'px'\r\n });\r\n }\r\n } else {\r\n $('.cc-productbarposition').css({\r\n 'top': headerHeight + 'px'\r\n });\r\n $('.header-wrapper').css({ 'margin-bottom': ($(window).width() > deviceViewport) ? headerBottomGap : 0 + 'px' });\r\n }\r\n }\r\n}\r\n\r\n$(function () {\r\n var prevScrollpos = window.pageYOffset;\r\n var scrollTimer, lastScrollFireTime = 0;\r\n var headerHeight = $('.header')[0].clientHeight;\r\n\r\n $(window).on('resize orientationchange', function () {\r\n $('.cc-productbarposition').css({\r\n 'top': 0 + 'px'\r\n });\r\n\r\n setTimeout(function() {\r\n headerHeight = $('.header')[0].clientHeight;\r\n $('.cc-productbarposition').css({\r\n 'top': headerHeight + 'px'\r\n });\r\n headerStickyWith703Bar();\r\n }, 300);\r\n });\r\n\r\n $(window).scroll(function() {\r\n var minScrollTime = 100;\r\n var now = new Date().getTime();\r\n\r\n function processScroll() {\r\n var currentScrollPos = window.pageYOffset;\r\n if (document.getElementById('header') && document.getElementById('header').scrollHeight) {\r\n if (document.getElementById('header').scrollHeight < prevScrollpos) {\r\n //scroll up vs down\r\n if (prevScrollpos >= currentScrollPos) {\r\n $('.cc-productbarposition').css({\r\n 'top': headerHeight + 'px'\r\n });\r\n } else {\r\n $('.cc-productbarposition').css({\r\n 'top': '0px'\r\n });\r\n }\r\n } else {\r\n $('.cc-productbarposition').css({\r\n 'top': headerHeight + 'px'\r\n });\r\n }\r\n prevScrollpos = currentScrollPos;\r\n }\r\n }\r\n\r\n if (navigator.userAgent.match(/Trident\\/7\\./)) { // if IE\r\n //ie11 keeps firing multiple scroll events that cause inconsistency in scroll height. Have to throttle the events\r\n if (!scrollTimer) {\r\n if (now - lastScrollFireTime > (3 * minScrollTime)) {\r\n processScroll(); // fire immediately on first scroll\r\n lastScrollFireTime = now;\r\n }\r\n scrollTimer = setTimeout(function() {\r\n scrollTimer = null;\r\n lastScrollFireTime = new Date().getTime();\r\n processScroll();\r\n },\r\n minScrollTime);\r\n }\r\n } else {\r\n processScroll();\r\n }\r\n });\r\n});\r\n\r\n"]}