'use strict';(function(u){var e=window.AmazonUIPageJS||window.P,q=e._namespace||e.attributeErrors,b=q?q("DetailPageBTFSubNavDesktopAsset",""):e;b.guardFatal?b.guardFatal(u)(b,window):b.execute(function(){u(b,window)})})(function(u,e,q){u.when("ready").register("hit-btf-sub-nav-desktop-metrics-logger",function(){return{incrementMetricCount:function(b){if("undefined"!==typeof b){var g=e.ue;g&&"function"===typeof g.count&&g.count(b,(g.count(b)||0)+1)}}}});"use strict";u.when("A","ready").register("btf-sub-nav-desktop-utils",
function(b){function g(){d("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs .sub-nav-desktop-tab").removeClass("active");d("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs .sub-nav-desktop-tab").removeAttr("aria-current")}var d=b.$;return{processTargetIds:function(r,c){var a={};b.each(c,function(c,b){a:{if(c!==q)for(var f=0;f<c.length;f++)if(d(c[f]).length&&1<d(c[f]).height()){c=c[f];break a}c=!1}c?a[b]=c:d(r+" ."+b).hide()});return a},activateTab:function(b){g();b="#btfSubNavDesktopCopy ."+b;d(b).addClass("active");
d(b).attr("aria-current","location")},deactivateTabs:g,getTargetDivCoordinates:function(b){var c=[];d(b).length&&d(b).offset()&&(c.push(d(b).offset().top),"#owner_zone_btf_header"===b?c.push(d("#owner_zone_btf_footer").offset().top+d("#owner_zone_btf_footer").height()):c.push(d(b).offset().top+d(b).height()-10));return c},onScreen:function(b,c){var a=d(e);c=a.scrollTop()+c;a=e.innerHeight?e.innerHeight:a.height();var f=c+a,t=b[0]-100;b=b[1];return b>c&&b<=f||b-t>a&&t<=c&&b>=f}}});u.when("A","btf-sub-nav-desktop-utils",
"ready").execute(function(b,g){function d(){u.register("btf-sub-nav-desktop-configs",function(){function a(){l=[];for(var a in h)h.hasOwnProperty(a)&&l.push({tab:a,topOffset:c(h[a]).offset().top});l.sort(function(a,c){return a.topOffset-c.topOffset})}var d=b.state("btf-sub-nav-desktop-context"),e=[],l=[],k={},n=!1,p=!1,x=!1;d&&(n=d["btf-sub-nav-desktop-leftAligned"],p=d["btf-sub-nav-desktop-lateActivation"],x=d["btf-sub-nav-desktop-subNavPhase1Enabled"]);var v={btfSubNavDesktopAboutThisItemTab:d["btf-sub-nav-desktop-about-this-item-tab"],
btfSubNavDesktopSimilarTab:d["btf-sub-nav-desktop-similar-tab"],btfSubNavDesktopProductInfoTab:d["btf-sub-nav-desktop-product-info-tab"],btfSubNavDesktopQuestionsTab:d["btf-sub-nav-desktop-questions-tab"],btfSubNavDesktopCustomerReviewsTab:d["btf-sub-nav-desktop-customer-reviews-tab"]},h=g.processTargetIds("#btfSubNavDesktop_feature_div",v);b.objectIsEmpty(h)&&c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-wrapper").hide();d=c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-tabs").outerHeight()-
2;return{tabTargets:v,isLeftAligned:n,isLateActivation:p,isSubNavPhase1Enabled:x,btfSubNavJQElemHeight:d,tabsArray:["btfSubNavDesktopAboutThisItemTab","btfSubNavDesktopSimilarTab","btfSubNavDesktopProductInfoTab","btfSubNavDesktopQuestionsTab","btfSubNavDesktopCustomerReviewsTab"],persistentHeaderClass:"persistent-header",fixedAmazonNavJQElem:"#nav-belt",fixedAmazonNavBodyClass:"nav-updated-pinned-config",animationDuration:500,atfCustomerRatingScrollDuration:800,navigateTopElements:["btfSubNavDesktopTopTab",
"btfSubNavDesktopAboutThisItemTab"],initialize:function(){h=g.processTargetIds("#btfSubNavDesktop_feature_div",v);e=[];for(var b in h)h.hasOwnProperty(b)&&e.push(b);a();k={btfSubNavDesktopTopTab:"btfSubNavDesktopTopTab"};for(b=0;b<e.length;++b)k[e[b]]=l[b].tab;if(0<l.length){b=c("\x3cdiv\x3e");var d=c("#btfSubNavDesktop_feature_div .btfSubNavDesktopTopTab");null!==d&&0<d.length&&c(b).append(d.clone(!0));for(d=0;d<l.length;d++){var n=c("#btfSubNavDesktop_feature_div ."+l[d].tab);null!==n&&0<n.length&&
c(b).append(n.clone(!0))}c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-tabs").html(b.html())}},getSubNavDesktopTabToActualTabMap:function(){return k},getTabsArray:function(){return e}}})}function e(){c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-tabs").length&&(d(),b.off("a:pageUpdate",e))}var c=b.$;if(c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-tabs").length)d();else b.on("a:pageUpdate",e)});u.when("A","hit-btf-sub-nav-desktop-metrics-logger","btf-sub-nav-desktop-configs",
"btf-sub-nav-desktop-utils").execute(function(b,g,d,r){if(!d)return!1;var c=b.$,a={},f=d.btfSubNavJQElemHeight,t=0,l=null;a.isSubNavImpressionsMetricEmitted=!1;a.isSubNavHiddenMetricEmitted=!1;a.isSubNavRenderable=!1;a.isLeftAligned=d.isLeftAligned;a.isLateActivation=d.isLateActivation;a.isSubNavPhase1Enabled=d.isSubNavPhase1Enabled;a.tabTargets=d.tabTargets;a.tabCoordinates={};a.jqSubNav=null;a.topOffset=f+t;a.animationDuration=d.animationDuration;a.THIRD_PARTY_JUMP_LINKS="#acrCustomerReviewLink #askATFLink #owner_zone_atf_jumplink #customerReviewsAttributeSeeAllRatings #seeMoreDetailsLink #HLCXComparisonJumplink_feature_div #climatePledgeFriendlyATF_feature_div #rich_product_information-learn_more_link".split(" ");
a.showTab=function(c){a.jqSubNav.css({top:a.getAmazonNavBarHeight(),position:"",opacity:c});a.jqSubNav.addClass(d.persistentHeaderClass)};a.hideTab=function(){a.jqSubNav.css({top:-100,position:"absolute",opacity:0});a.jqSubNav.removeClass(d.persistentHeaderClass)};a.fixNarBarWidth=function(){if(c("#btfSubNavDesktopCopy").length){var k=c("#btfSubNavDesktopCopy").width();a.jqSubNav.width(k)}};a.emitSubNavImpressionsMetric=function(){if(!a.isSubNavImpressionsMetricEmitted&&a.isSubNavRenderable){a.logMetric("visible",
"");for(var c in a.tabs)a.tabs.hasOwnProperty(c)&&a.logMetric("visible",c);a.isSubNavImpressionsMetricEmitted=!0}};a.logMetric=function(a,c){""!==c?g.incrementMetricCount("hit-btf-sub-nav-desktop:"+c+":"+a):g.incrementMetricCount("hit-btf-sub-nav-desktop:"+a)};a.emitSubNavHiddenMetric=function(c){a.isSubNavHiddenMetricEmitted||(a.logMetric("hidden",c),a.isSubNavHiddenMetricEmitted=!0)};a.applyCenterTabStyling=function(){a.isLeftAligned||a.jqSubNav.css({"justify-content":"center"})};a.attachTwisterUpdateHandler=
function(){b.on("PageRefresh:ATF ready",a.initialize);b.on("PageRefresh:ATF ready",a.attachWidgetsHeightObserver)};a.attachScreenResizeHandler=function(){b.on("resize",a.initialize);b.on("orientationChange",a.initialize)};a.refreshTabCoordinates=function(){b.each(a.tabs,function(c,b){a.tabCoordinates[b]=r.getTargetDivCoordinates(c)})};a.processTabChecks=function(){for(var c=!1,b=d.getTabsArray(),p=d.getSubNavDesktopTabToActualTabMap(),e=0;e<b.length;e++){var v=p[b[e]];if(a.tabCoordinates[v]&&r.onScreen(a.tabCoordinates[v],
a.topOffset)){c=!0;r.activateTab(v);break}}c||r.deactivateTabs()};a.setTopOffset=function(){t=a.getAmazonNavBarHeight();a.topOffset=f+t};a.getAmazonNavBarHeight=function(){var a=0;c(d.fixedAmazonNavJQElem).length&&c(d.fixedAmazonNavJQElem).hasClass(d.fixedAmazonNavBodyClass)&&(a=c(d.fixedAmazonNavJQElem).css("top"),a=parseFloat(a,10)+c(d.fixedAmazonNavJQElem).outerHeight());return a};a.findFeatureDivHeights=function(b,d){var k=!0,n=!1,e=q;try{for(var h=b.children[Symbol.iterator](),g;!(k=(g=h.next()).done);k=
!0){var m=g.value;if(m.matches("[data-feature-name]")){if(m.matches("div")&&m.id&&0<m.children.length&&m.matches("[data-feature-name]")){var f=(c(m).offset().top+c(m).height())/c(document).height();d.push({node:m,nodePageRatio:f})}0<m.children.length&&m.matches("[data-feature-name]")&&a.findFeatureDivHeights(m,d)}}}catch(w){n=!0,e=w}finally{try{!k&&h.return&&h.return()}finally{if(n)throw e;}}};a.copyFeatureDivToPost35Percent=function(){var b=document.querySelector("#dp-container");if(b){var d=[];
if(0<b.children.length&&Array.from(b.children).every(function(a){return!a.matches("[data-feature-name]")}))a.logMetric("missing-data-feature-name","");else{a.findFeatureDivHeights(b,d);d.sort(function(a,c){return a.nodePageRatio-c.nodePageRatio});b=void 0;var p=!0,e=!1,g=q;try{for(var h=d[Symbol.iterator](),f;!(p=(f=h.next()).done);p=!0){var m=f.value,l=m.node;if(.35<m.nodePageRatio){b=l;break}}}catch(w){e=!0,g=w}finally{try{!p&&h.return&&h.return()}finally{if(e)throw g;}}b&&"btfSubNavDesktopCopy"!==
b.id&&c("#btfSubNavDesktop_feature_div").clone().attr("id","btfSubNavDesktopCopy").insertAfter(c(b))}}else a.logMetric("missing-dp-container","")};a.copyFeatureDivToTopOfBtf=function(){var a=void 0;0<c("#bottomRow").length?a=c("#bottomRow"):0<c("#ATFCriticalFeaturesDataContainer").length&&(a=c("#ATFCriticalFeaturesDataContainer"));a!==q&&0<a.length&&c("#btfSubNavDesktop_feature_div").clone().attr("id","btfSubNavDesktopCopy").insertAfter(c(a))};a.scrollHandler=function(){var b=d.getTabsArray();if(!a.isSubNavPhase1Enabled&&
3>b.length)a.disableKeyboardFocusOnTabs(),a.emitSubNavHiddenMetric("less-than-3-tabs");else{a.setTopOffset();b=c(e).scrollTop()+t;var n=b+e.innerHeight,p=c(document).height(),g=c("#bottomRow"),f=c("#ATFCriticalFeaturesDataContainer");if(a.isLateActivation)var h=.35*p;else if(0<g.length?h=g:0<f.length&&(h=f),h!==q&&0<h.length)h=h.offset().top+h.innerHeight();else{a.emitSubNavHiddenMetric("no-triggering-element");return}b=(n-h)/(n-b)*100;a.refreshTabCoordinates();100<=b?(a.showTab(1),a.processTabChecks(),
a.emitSubNavImpressionsMetric()):90<=b&&100>b?(a.showTab((b-90)/25),a.processTabChecks(),a.emitSubNavImpressionsMetric()):(a.hideTab(),a.processTabChecks())}};a.clickHandler=function(d){d.preventDefault();b.off("scroll",a.scrollHandler);a.jqSubNav.css({opacity:1});d=d.currentTarget.className.split(" ")[1];var k=a.tabs[d];a.logMetric("click",d);"btfSubNavDesktopTopTab"===d?(c("html,body").animate({scrollTop:0},a.animationDuration),b.on("scroll",a.scrollHandler),a.setKeyboardFocus("#"+a.getTopTabTargetId())):
(r.activateTab(d),a.animationHelperForPinnedNavbar(k,f),b.delay(function(){b.on("scroll",a.scrollHandler);a.showTab(1)},a.animationDuration+100),a.setKeyboardFocus(k))};a.animationHelperForPinnedNavbar=function(b,d){c(b).offset()&&c("html,body").stop(!0,!1).animate({scrollTop:c(b).offset().top-d},{duration:a.animationDuration,step:function(k,e){a.setTopOffset();k=c(b).offset().top-d-t;e.end!==k&&(e.end=k)},complete:function(){c("html, body").animate({scrollTop:c(b).offset().top-d-t},{duration:0})}})};
a.animationHelper=function(b,d){c(b).offset()&&c("html,body").stop(!0,!1).animate({scrollTop:c(b).offset().top-d},{duration:a.animationDuration,step:function(a,k){a=c(b).offset().top-d;k.end!==a&&(k.end=a)},complete:function(){c("html, body").animate({scrollTop:c(b).offset().top-d},{duration:0})}})};a.handleThirdPartyJumpLinks=function(){b.off("scroll",a.scrollHandler);b.off("a:pageUpdate",a.initialize);b.delay(function(){b.on("scroll",a.scrollHandler);b.on("a:pageUpdate",a.initialize)},d.atfCustomerRatingScrollDuration)};
a.detachThirdPartyJumpLinksHandlers=function(){a.THIRD_PARTY_JUMP_LINKS.forEach(function(b){c(b).length&&c(b).unbind("click",a.handleThirdPartyJumpLinks)})};a.attachThirdPartyJumpLinksHandlers=function(){a.THIRD_PARTY_JUMP_LINKS.forEach(function(b){c(b).length&&c(b).click(a.handleThirdPartyJumpLinks)})};a.detachHandlers=function(){b.off("scroll",a.scrollHandler);a.detachThirdPartyJumpLinksHandlers();c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs .sub-nav-desktop-tab").unbind("click",a.clickHandler)};
a.attachHandlers=function(){b.on("scroll",a.scrollHandler);a.attachThirdPartyJumpLinksHandlers();c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs .sub-nav-desktop-tab").click(a.clickHandler)};a.setHyperlinkDestinations=function(a){c.each(a,function(a,b){c("#btfSubNavDesktopCopy ."+a).attr("href",b)})};a.setKeyboardFocus=function(a){0!==c(a).length&&(c(a).attr("tabindex","-1"),c(a)[0].focus({preventScroll:!0}),c(a).removeAttr("tabindex"))};a.getTopTabTargetId=function(){return 0<c("#nav-top").length?
"nav-top":0<c("#navbar-main").length?"navbar-main":"nav-logo"};a.disableKeyboardFocusOnTabs=function(){c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs .sub-nav-desktop-tab").attr("tabindex","-1")};a.removeHiddenClassAndHideTabs=function(){a.jqSubNav.hasClass("aok-hidden")&&a.hideTab();a.jqSubNav.removeClass("aok-hidden")};a.removeSubNavDivCopyIfExists=function(){c("#btfSubNavDesktopCopy").length&&c("#btfSubNavDesktopCopy").remove()};a.initialize=function(){a.removeSubNavDivCopyIfExists();d.initialize();
a.tabs=r.processTargetIds("#btfSubNavDesktop_feature_div",a.tabTargets);b.objectIsEmpty(a.tabs)?(a.detachHandlers(),c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs").hide(),a.emitSubNavHiddenMetric("empty-tabs-list")):(a.isLateActivation?a.copyFeatureDivToPost35Percent():a.copyFeatureDivToTopOfBtf(),a.jqSubNav=c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs"),a.setHyperlinkDestinations(a.tabs),a.applyCenterTabStyling(),a.isSubNavRenderable=!0,a.setTopOffset(),a.fixNarBarWidth(),a.scrollHandler(),
a.refreshTabCoordinates(),a.detachHandlers(),a.attachHandlers(),a.removeHiddenClassAndHideTabs(),document.removeEventListener("focusin",a.focusHandler),document.addEventListener("focusin",a.focusHandler),document.removeEventListener("focusout",a.focusOutHandler),document.addEventListener("focusout",a.focusOutHandler),c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs").is("[aria-label]")||c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs").attr("aria-label","Navigate within the product detail page"))};
a.attachWidgetsHeightObserver=function(){var b=new e.ResizeObserver(function(b){b.forEach(function(b){1>=b.contentRect.height&&a.updateTabs()})});c.each(a.tabs,function(a,c){b.observe(document.querySelector(c))})};a.updateTabs=function(){d.initialize();c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs").html(c("#btfSubNavDesktop_feature_div .btf-sub-nav-desktop-tabs").html());a.tabs=r.processTargetIds("#btfSubNavDesktopCopy",a.tabTargets);b.objectIsEmpty(a.tabs)?(a.detachHandlers(),c("#btfSubNavDesktopCopy .btf-sub-nav-desktop-tabs").hide(),
a.emitSubNavHiddenMetric("empty-tabs-list")):(a.setHyperlinkDestinations(a.tabs),a.scrollHandler(),a.refreshTabCoordinates(),a.detachHandlers(),a.attachHandlers(),a.removeHiddenClassAndHideTabs(),document.removeEventListener("focusin",a.focusHandler),document.addEventListener("focusin",a.focusHandler),document.removeEventListener("focusout",a.focusOutHandler),document.addEventListener("focusout",a.focusOutHandler))};a.focusHandler=function(b){if(b.target&&b.target.classList&&b.target.classList.contains("sub-nav-desktop-tab")){l||
(l=c(document).height());b=c("#bottomRow");var g=c("#ATFCriticalFeaturesDataContainer");if(a.isLateActivation)var f=.35*l;else if(0<b.length?f=b:0<g.length&&(f=g),f!==q&&0<f.length)f=f.offset().top+f.innerHeight();else return;a.jqSubNav.hasClass(d.persistentHeaderClass)||e.scroll({top:Math.ceil(f)})}else l=null};a.focusOutHandler=function(){b.delay(function(){a.jqSubNav.css({top:a.getAmazonNavBarHeight()})},50)};a.initialize();a.attachTwisterUpdateHandler();a.attachScreenResizeHandler();a.attachWidgetsHeightObserver()})});