8fbe26df70e484b0636be2db1ccf8f6949c4e133c3c8306989e99207da4f0019

Source Code:

(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("SimilaritiesDetailJS",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(f){var k=window.AmazonUIPageJS||window.P,n=k._namespace||k.attributeErrors,b=n?n("ProductAdsDetailPageAssets",""):k;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,k,n){f.when("A","a-carousel-framework","a-carousel-ajax-standard").register("AmazonClicks",function(b,f,k){function q(a,b,g){var m=a.getAttr("pageNumber"),c;c=a.getAttr("initialSeenAsins");for(var e=a.getAttr("fetchedItems").slice(c.length),d=0;d<e.length;d++)e[d]&&e[d].oid&&c.push(e[d].oid);
c=JSON.stringify(c);g.pg=m;g.tot=a.getAttr("set_size");g.start=g.offset;g.num=g.count;g.cc=1===m?0:g.offset;g.oData=c;k.getItems(a,b,g)}function c(a,r){Array.isArray(a)&&b.each(a,function(a){e[a]=r})}function t(a){b.each(e,function(b,g){b===a&&delete e[g]})}var d={},e={},h={},a={},p=[],l=b.extend([],k),u=function(a,b,g){return function(){a.apply(b,g)}};l.init=function(a){var c=a.getAttr("ajax");if(c&&c.params){var g=c.params;if((c=a.getAttr("fetchedItems"))&&c.length!==g.start){var m=0;c.forEach(function(a){a&&
m++});var d=[];a.dom.$carousel.children("li").each(function(a,c){if(a>=g.start)return!1;d.push(b.trim(c.innerHTML))});m!==d.length&&(g.offset=d.length,a.setAttr("fetchedItems",d))}}k.init(a)};l.getItems=function(c,d,g){var m=!1,e=c.getAttr("name");b.each(a,function(a,b){b!==e&&(m=m||a)});c=u(q,this,[c,d,g]);(d=h[e]!==n)&&m?p.push(c):(d&&(a[e]=!0),c())};f.registerStrategy("ajax","clicksCustomAjax",l);return{registerFeedbackEvents:function(a,c,d,e,p){var f=!0,h=function(){b.$("#"+c).text(e);f=!1;b.$("."+
p).each(function(){b.$(this).show()})},l=function(){b.$("#"+c).text(d);f=!0;b.$("."+p).each(function(){b.$(this).hide()})};b.$("#"+c).click(function(){f?h():l()});b.on("a:carousel:"+a+":change:pageNumber",l);l()},registerFeedbackEventsWithSponsoredLabel:function(a,c,d,e){var f=!0,p=function(){b.$("#"+d).show();f=!1;b.$("."+e).each(function(){b.$(this).show()})},l=function(){b.$("#"+d).hide();f=!0;b.$("."+e).each(function(){b.$(this).hide()})};b.$("#"+c).click(function(){f?p():l()});b.on("a:carousel:"+
a+":change:pageNumber",l);l()},truncateTitles:function(a){b.$("."+a).each(function(){var c=b.$(this);if("hidden"===c.css("overflow")){var d=c.html(),e=b.$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(c.width()).height("auto");c.after(e);for(e.html(d);0<d.length&&e.height()>c.height();)d=d.substr(0,d.length-1),e.html(d+"\x26#133;");c.html(e.html()).height("auto").removeClass(a);e.remove()}})},preventSpinners:function(a,c){d[a]===n&&(b.on("a:carousel:"+a+":ajaxSuccess",
function(a){b.delay(function(){var d=b.$("#"+c+" li.a-carousel-card-empty");0<d.length&&(a.carousel.setAttr("set_size",d[0].getAttribute("aria-posinset")-1),d.removeClass("a-carousel-card-empty"))},200)}),d[a]="defined")},registerCarouselToSaveAsins:function(d,e,f){t(d);c(f,d);a[d]=!1;h[d]===n&&(b.on("a:carousel:"+d+":ajaxSuccess",function(e){var f=e.carousel.getAttr("fetchedItems").slice(-1*e.params.count),g=[];b.each(f,function(a){g.push(a.oid)});c(g,d);a[e.carousel.getAttr("name")]=!1;0<p.length&&
p.shift()()}),h[d]=e)}}});(function(b,k,n){function q(){return b.P&&b.P.AUI_BUILD_DATE}q()?(f.when("jQuery").register("sponsored-products-truncator-jQuery",function(c){return c}),f.when("ready").register("sponsored-products-truncator-ready",function(){})):b.amznJQ&&(b.amznJQ.available("jQuery",function(){f.register("sponsored-products-truncator-jQuery",function(){return b.amznJQ.jQuery})}),b.amznJQ.onReady("jQuery",function(){f.register("sponsored-products-truncator-ready",function(){})}),b.amznJQ.available("amazonShoveler",
function(){f.register("sponsored-products-truncator-amznJQ-shoveler",function(){})}));f.register("sponsored-products-truncator-util",function(){function c(c,b){f({logLevel:c,attribution:"ProductAdsDetailPageAssets",message:"[sponsored-products-truncator] "+b})}var f=b.ueLogError;"function"!==typeof f&&(f=function(c,b){if(b&&b.message)throw Error(b.message);if(c&&c.message)throw Error(c.message);});return{constants:{FEATURE_NAME:"SponsoredProductsTitleTruncation"},count:b.ue&&b.ue.count||function(){},
isAUI:q,log:{warn:function(b){c("WARN",b)},error:function(b){c("ERROR",b)}}}})})(k,document);(function(b,k,n){f.when("A","sponsored-products-truncator-jQuery","sponsored-products-truncator-util").register("sponsored-products-truncator-line-truncator",function(b,c,f){function d(a){this.$element=a;this.$experimentElement=c("\x3cdiv\x3e").addClass("sponsored-products-truncator-offscreen-truncate");this.maxRows=a.attr("data-rows");this.text=a.attr("data-fulltext")?a.attr("data-fulltext"):this.$element.html();
this.lineHeight=this.getLineHeight();this.maxRows||f.log.error("Truncation element missing necessary line number data")}var e,h;e=/(?=[ \-\/])|(?=[\u3105-\u312F])|(?=[\u31A0-\u31BA])|(?=[\u4E00-\u9FD5])|(?=[\u3400-\u4DB5])|(?=[\uF900-\uFAFF])|(?=[\u3040-\u309F])|(?=[\u30A0-\u30FF])|(?=[\u3190-\u319F])/;h=/[^\/\-\[\]():\s]/;d.prototype.truncate=function(){var a=this.text,b,a=c.trim(a);this.$element.append(this.$experimentElement);this.checkLineFit(a)?this.text!==this.$element.html()&&this.$element.html(a):
(b=this.truncateByToken(a))?(this.$element.html(b),this.$element.attr({title:a})):f.log.error("Unable to successfully truncate line "+a);this.$experimentElement.remove()};d.prototype.getLineHeight=function(){var a=this.$element.html(),b;this.$element.html("\x26hellip;");b=this.$element.innerHeight();this.$element.html(a);return b};d.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return Math.round(a)<=this.maxRows};d.prototype.truncateByToken=
function(a){a=a.split(this.getTokenSeparatorRegex());var b=a.length,c=0,d,e,f;for(f=1;f!==b;)if(d=Math.floor((b+f)/2),e=a.slice(0,d).join("")+"\x26hellip;",this.checkLineFit(e)){if(1>=b-d){for(c=d;0<c&&!h.test(a[c-1]);)c--;break}f=d}else b=d;if(0!==c)return a.slice(0,c).join("")+"\x26hellip;"};d.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":e};return{truncateLines:function(a){a.find(".sponsored-products-truncator-truncate:visible, .sponsored-products-truncator-truncate-medium:visible").each(function(){(new d(c(this))).truncate();
c(this).addClass("sponsored-products-truncator-truncated").removeClass("sponsored-products-truncator-truncate sponsored-products-truncator-truncate-medium");c(this).removeClass(function(a,b){return(b.match(/sponsored-products-truncator-line-clamp-\d/g)||[]).join(" ")})});b.trigger("sponsored-products-truncator:linestruncated")}}});f.when("jQuery","A","sponsored-products-truncator-line-truncator","a-carousel-framework").register("sp-dp-carousel-truncation",function(b,c,f,d){function e(a){"string"===
typeof a?(f.truncateLines(c.$("#"+a)),d.getCarouselByName(a+"_carousel")&&c.trigger("spTruncationComplete",d.getCarouselByName(a+"_carousel"))):(f.truncateLines(a.carousel.dom.$container),c.trigger("spTruncationComplete",a.carousel))}var h="sp_detail sp_detail2 sp_detail_thematic sp_phone_detail sp_phone_detail2 sp_phoneapp_detail sp_phoneapp_detail2 sp_phone_detail_thematic sp_phoneapp_detail_thematic".split(" ");c.on("spCarouselNoTruncationRegistration",function(){var a=c.state("spTruncatorStatus");
if(!a||!a.truncationInitialized){for(a=h.length-1;0<=a;a--)e(h[a]),c.on("a:carousel:"+h[a]+"_carousel:change:animating",e),c.on("a:carousel:"+h[a]+"_carousel:change:loading",e),c.on("a:carousel:"+h[a]+"_carousel:change:pageSize",e);c.state("spTruncatorStatus",{truncationInitialized:!0})}});c.on("spMobileCarouselAjaxComplete",e);return{setUpTruncation:function(a){e(a);c.on("a:carousel:"+a+"_carousel:change:animating",e);c.on("a:carousel:"+a+"_carousel:change:loading",e);c.on("a:carousel:"+a+"_carousel:change:pageSize",
e)}}})})(k,document)});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,b=r?r("SponsoredProductsViewabilityAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,r){d.when("A","SponsoredProductsEventBatcher","SPHAT").register("SponsoredProductsViewability",function(b,l,h){function k(c,a){c="SPView-"+a+"-"+c;f.ue&&f.ue.count(c,(f.ue.count(c)||0)+1)}function n(c){return{qualifier:a("qualifier",c),id:a("id",c),widgetName:a("widgetName",c),
adId:a("adId",c),adIndex:a("adIndex",c),eventType:a("eventType",c)}}function a(c,a){return(c=(new RegExp("[?\x26]"+c+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(a))&&c[2]?decodeURIComponent(c[2].replace(/\+/g," ")):""}function e(c){g[c.selector].viewHandler=b.delay(function(){if(c){var a=c.data("viewpixelurl");a&&-1===d.indexOf(a)&&(l.sendRequest(n(a+"\x26eventType\x3d1")),d.push(a),g[c.selector]&&(g[c.selector].viewState="VIEWED",k("viewUrlSuccess",g[c.selector].placementId)),p())}},500)}function p(){for(var c in g)if("VIEWED"===
g[c].viewState)delete g[c];else{var a=b.$(c),m=g[a.selector].viewState;"VIEWED"!==m&&(b.onScreen(a,-.15*a.height())?"OFF"===m&&(g[a.selector].viewState="ON",e(a)):"ON"===m&&(g[a.selector].viewState="OFF",clearTimeout(g[a.selector].viewHandler)))}}var g={},d=[],q=[],m=[];b.on("spViewTrackingElementLoaded",p);return{registerViewTrackingElement:function(a,e){-1===d.indexOf(a.data("viewpixelurl"))&&(k("totalAds",e),g[a.selector]={viewState:"OFF",viewHandler:null,placementId:e},b.trigger("spViewTrackingElementLoaded"))},
registerAuiEvents:function(a){Array.isArray(a)&&a.forEach(function(a){if(-1===m.indexOf(a))b.on(a,p)})},loadImagePixel:function(a,b,e,m){!h.checkForHiddenElementsWithTargetList(b,e,m)&&Array.isArray(q)&&-1===q.indexOf(a)&&(q.push(a),l.sendRequest(n(a)))}}});d.when("A","SponsoredProductsViewabilityConfig").register("SponsoredProductsEventBatcher",function(b,l){function h(a,c){a||(q+=1,g+=c);p+=c;t+=1;k("avgRequestFailurePerPage",q/t);k("avgEventFailurePerPage",g/p)}function k(a,c){f.ue&&f.ue.count("SPBatch-"+
a,c)}function n(a){var c=[];b.each(a,function(a){c.push({data:a})});return{events:c}}function a(){if(0<e.length){var a=e.length,c=n(e);e=[];var g=/unagi-\w\w.amazon.com\/1\/events\/com.amazon.eel.SponsoredProductsEventTracking.(prod|gamma)/;l.eelEndpoint!==r&&g.test(l.eelEndpoint)?b.ajax(l.eelEndpoint,{method:"post",params:c,paramsFormat:"json",contentType:"application/json",accepts:"application/json",success:function(c,b,e){h(!0,a);k("batchSuccess",a)},error:function(c,b,e){d.log("Warning -- sushi response: "+
e+" | StatusText: "+b+" | xhrStatusCode: "+(c.http?c.http.status:"could not get xhr status code. ")+" | url: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets");h(!1,a);k("batchError",a)}}):(h(!1,a),k("batchError",a),d.log("Warning -- sushi endpoint incorrectly configured with: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets"))}}var e=[],p=0,g=0,t=0,q=0;b.interval(function(){a()},250);f.addEventListener("beforeunload",function(){a()});return{sendRequest:function(b){e.push(b);15<
e.length&&a()},_batchRequest:function(){a()}}});d.when("A","SponsoredProductsEventBatcher").register("SPHAT",function(b,d){function h(a,b){a&&f.ue&&f.ue.count&&f.ue.count(a,(f.ue.count(a)||0)+b?1:0)}function k(a,e){return a&&e?0<b.$(a).find(e.join(",")).filter(function(){return"hidden"===b.$(this).css("visibility")||"0"===b.$(this).css("opacity")||b.$(this).is(":hidden")}).length:!1}function n(a,e){var d=":hidden";b.$.each(e,function(a,b){d+=":not("+b+")"});return 0<b.$(a).children(d).length}return{checkForHiddenElementsWithTargetList:function(a,
b,d){a=k(a,b);h(d,a);return a},checkForHiddenElements:function(a,b,d){a=n(a,b);h(d,a);return a}}});d.when("A","ready").register("SponsoredProductsViewabilityConfigInitializer",function(b){function f(b){d.register("SponsoredProductsViewabilityConfig",function(){return{eelEndpoint:b,updateEelEndpoint:function(a){this.eelEndpoint=a}}})}var h=b.state("SpViewabilityConfigState"),k=!1;"undefined"!==typeof h&&null!==h&&"undefined"!==typeof h.eelEndpoint&&null!==h.eelEndpoint&&(k=!0,f(h.eelEndpoint));b.state.bind("SpViewabilityConfigState",
function(b,a){a.eelEndpoint&&"undefined"!==typeof b.eelEndpoint&&null!==b.eelEndpoint&&(k?d.when("SponsoredProductsViewabilityConfig").execute(function(a){a.updateEelEndpoint(b.eelEndpoint)}):(k=!0,f(b.eelEndpoint)))})})});
/* ******** */
(function(f){var e=window.AmazonUIPageJS||window.P,l=e._namespace||e.attributeErrors,c=l?l("CommonDetailPageScripts",""):e;c.guardFatal?c.guardFatal(f)(c,window):c.execute(function(){f(c,window)})})(function(f,e,l){f.when("jQuery","jumpLink").execute(function(c,a){var p=c("#miniATFUDP"),b=0;0<p.length&&(b=p.height()+9);1===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",1E3,b):2===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",
1200,b):3===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",1400,b):4===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",10,b):0<p.length&&(b=p.height()+9,a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",10,b));0<c("#reviewStarsLinkedCustomerReviews").length&&a.bind("#reviewStarsLinkedCustomerReviews",
10,b);0<c("#askATFLink").length&&a.bind("#askATFLink",10,b);f.when("cf").execute(function(f){0<c("#important-information a[href\x3d'#legal-disclaimer']").length&&a.bind("#important-information a[href\x3d'#legal-disclaimer']",10,b,!0)});a.bind("#seeMoreDetailsLink",300,b)});"use strict";f.when("A","jQuery","ImageBlockATF","jumpLink","cf").register("miniATFUtils",function(c,a,p,b){function l(m){t&&!m||u||(m=(new Date).getTime()-x,m=50>m?50-m:10,t=1,t=0,x=(new Date).getTime(),setTimeout(function(){var m=
q.scrollTop(),c=a("#miniATFUDP");if(0<c.length){var d=y;if("T1"===d){d=a("#sims_fbt");if(0>=d.length||0>=d.height())d=a("#buyxgety_feature_div");var b=d,d=Number.MAX_VALUE;if(b&&0<b.length){var h=b.height(),b=b.offset();h&&b&&(d=b.top+h)}d=Math.min(d,1200)}else if("T2"===d){d="#product-details-grid_feature_div #prodDetails #important-information_feature_div #importantInformation #detail-bullets #detail_bullets_id #technical-data #technicalSpecifications_feature_div #productDescription #product-description-iframe #dpx-btf-hlcx-comparison_feature_div #HLCXComparisonWidget_feature_div".split(" ");
b=Number.MAX_VALUE;for(h=0;h<d.length;h++){var g=a(d[h]);if(g&&0<g.length&&0<g.height()){var k;k=Number.MAX_VALUE;g&&0<g.length&&(g=g.offset())&&(k=g.top);k<b&&(b=k)}}d=Math.min(b,1700)-100}else d=void 0;m>d?!v&&c.is(":hidden")&&(c.removeClass("a-hidden"),c.slideDown(200)):(c.slideUp(200),v=0)}},m))}b=a("#miniATFUDP");var z=a("#miniATFPartialSelection")[0],n=a(".twister-dropdown-highlight")[0];if(!(0>=b.length)){var q,v=0,x=0,t=0,r={},u=0,w=0,y="T2";r.setMiniATFShowHeight=function(a){y=a};r.setMiniATFScrollUpHeight=
function(b){w=0;"T1"===b&&(b=a("#productTitle"),0<b.length&&(b=b.offset())&&(w=b.top-20))};a("body").delegate(".go-to-top","click",function(){a("body, html").animate({scrollTop:w},300);v=1;z&&n&&(a(n).removeClass("transparentTwisterDropdownBorder"),a(n).addClass("highlightTwisterDropdownBorder"));return!1});z&&n&&a(n).click(function(){a(this).addClass("transparentTwisterDropdownBorder");a(this).removeClass("highlightTwisterDropdownBorder")});q=a(e);q.scroll(function(){l(0)});q.resize(function(){l(1)});
f.when("ImageBlockBTF").execute(function(b){var f=function(k){var c=k.getState().selected_variations;if(c){var d="",e=k.getState().variation_display_labels;a.each(b.visualDimensions,function(a,k){a=1===b.gIsNewTwister?k:e[k];c[a]&&(d+=" "+c[a])});return d&&d.substring(1)}},e=b.defaultColor,d=e,l=b.landingAsinColor,h,g=a("#miniATF_image");0<g.length&&(h=g.attr("src"));r.updateMiniATFDiv=function(){u=0;var b=a("#miniATF_image");0<b.length&&h&&b.attr("src",h)};c.on("image-block-twister-swatch-click",
function(a,c,g,n){u=1;a=(a=n?n:f(c))&&""!==a?a:e;a===l&&(a=e);a!==d&&(h=(c=a!==e&&a!==l?b:p)&&c.colorImages&&c.colorImages[a]&&0<c.colorImages[a].length&&c.colorImages[a][0]?c.colorImages[a][0].large:null,d=a)})});return r}});"use strict";f.when("ueCount","jQuery").execute(function(c,a){a("#miniATF_BackToTopLink").click(function(){c.incrementCounterByOne("sl_back_to_top_button_click_count")})});"use strict";f.when("jQuery","dp-util-cookie","cf").execute(function(c,a){"000-0000000-8675309"===c("#addToCart").find('input[name\x3d"session-id"]').val()&&
c("#addToCart").find('input[name\x3d"session-id"]').val(a("session-id"))})});
/* ******** */
(function(e){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,b=k?k("DetailPageCommonScripts",""):f;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,f,k){e.when("A","jQuery").register("jumpLink",function(b,a){return{bind:function(b,d,m,h){try{d=d||1E3,m=m||0,a("body").delegate(b,"click",function(n){try{var e=a(b);if(e.get(0)){var g=e.attr("href");g&&"#"===g.charAt(0)&&(g=h&&0===a(g).length?"[name\x3d'"+g.substring(1)+"']":g,0!==a(g).length&&
(n.preventDefault(),a("html, body").animate({scrollTop:a(g).offset().top-m},d)))}}catch(l){f.ueLogError&&f.ueLogError(l,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in executing click handler]"})}})}catch(n){f.ueLogError&&f.ueLogError(n,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in binding click handler]"})}}}});"use strict";e.when("A").execute(function(b){b.declarative("mySummaryExpander_1","click",function(a){if(a=document.getElementById("summaryText"))a.style.display=
"block"===a.style.display?"none":"block"})});"use strict";e.when("A").register("dp-log-utils",function(b){b.on("dpLogFatalsEvent",function(a,b,d){f.ueLogError&&f.ueLogError({message:a},{logLevel:b,attribution:d})})});"use strict";e.register("dp-client-counter",function(){var b=function(){};f.ue&&f.ue.count&&"function"===typeof f.ue.count&&(b=f.ue.count);return{set:function(a,c){"undefined"!==typeof c&&b(a,c)},get:function(a){return b(a)},inc:function(a){b(a,(b(a)||0)+1)}}});"use strict";e.when("dp-client-counter").register("dp-click-counter",
function(b){return{record:function(a,c){a&&a.addEventListener("click",function(){b.inc(c+"-clicked")})}}});"use strict";e.when("A").register("cache",function(b){function a(a){d=this;this.data={};a&&(this.ttl=60*a);this.deleteTtlExpiredEntries=function(){if(d.ttl)for(var a in this.data)if(this.data.hasOwnProperty(a)){var b=this.data[a].timestamp;Math.round((new Date).getTime()/1E3)-b>this.ttl&&delete this.data[a]}}}function c(a){var d=a;if("object"===typeof a){var c="",d="";b.each(a,function(a,b){d+=
c+b+"\x3d"+a;c="\x26"})}return d}var d;a.prototype={put:function(a,b){a=c(a);b={timestamp:Math.round((new Date).getTime()/1E3),value:b};this.data[a]=b},get:function(a){this.deleteTtlExpiredEntries();if(this.exists(a))return a=c(a),this.data[a].value},exists:function(a){this.deleteTtlExpiredEntries();return c(a)in this.data}};return a});"use strict";e.register("dp-util-cookie",function(){return function(b){b+="\x3d";for(var a=decodeURIComponent(document.cookie).split(";"),c=0;c<a.length;c++){var d=
a[c],d=d.replace(/^\s+/,"");if(0===d.indexOf(b))return d.substring(b.length,d.length)}return""}});e.when("jQuery").register("quanityChangePriceUpdate",function(b){return{ajaxCall:function(a){}}});"use strict";e.when("A","jQuery","a-popover","a-dropdown","ready").register("moq-core",function(b,a,c,d){function e(a){return 0<a.length&&0<a.find("div[data-name\x3d'quantity.improvedMOQ']").length}function h(){return a(k.join(", "))}function f(a){return"locked"===a.find("div[data-name\x3d'quantity.improvedMOQ']").attr("moq-lock")}
function p(){return(a(g.join(", ")).length?g:a(l.join(", ")).length?l:a(q.join(", ")).length?q:["#buybox"]).map(function(b){return a(b)}).filter(e)}var g=["#newAccordionRow","#SecondNewAccordionRow"],l=["#oneTimeBuyBox","#snsBuyBox"],q=["#toggleBuyBox \x3e #sns","#toggleBuyBox \x3e #onetime"],k=["#snsBuyBox","#toggleBuyBox \x3e #sns"],r="#add-to-cart-button;#mobb\\.addToCart;#buy-now-button;#one-click-button;#oneClickBuyButton;#prime-toggle-main;#rcx-subscribe-submit-button input;#rcx-subscribe-submit-button button".split(";");
return{isSnsLocked:function(){var a=h();return f(a)},isLocked:f,getSnsSubscriptionContainer:h,offerContainerHasMoq:e,findMoqOfferContainers:p,findMoqOfferContainerWithDomElement:function(a){var b=p().filter(function(b){return b[0].contains(a)});return 0===b.length?null:b[0]},tweakDisplayTextForMoqQuantityDropdown:function(a){var b=d.getSelect(a).getOptions(0),c=b.info()[0];c.selected?b.update({text:c.value}):b.update({text:a.children("option[data-displayText]").attr("data-displayText")})},lockSubmission:function(b,
d,c){var e=b.find(r.join(", ")),h=b.find("div[data-name\x3d'quantity.improvedMOQ']");e.each(function(){"hidden"!==a(this).prop("type")&&(this.hasAttribute("moq-original-button-type")||a(this).attr("moq-original-button-type",a(this).prop("type")),h.attr("moq-lock","locked"),a(this).prop("type","button"),a(this).bind("click.moq",d),"function"===typeof c&&c(a(this)))})},unlockSubmission:function(b,d){var c=b.find(r.join(", ")),e=b.find("div[data-name\x3d'quantity.improvedMOQ']");c.each(function(){"button"===
a(this).prop("type")&&(e.attr("moq-lock","unlocked"),a(this).prop("type",a(this).attr("moq-original-button-type")),a(this).unbind("click.moq"),"function"===typeof d&&d(a(this)))})}}});"use strict";e.when("A","dp-pre-atc-monitor").execute("dp-pre-atc-execution",function(b,a){b.declarative("dp-pre-atc-declarative","click",function(c){var d=a.getInstance();b.$.isEmptyObject(d.preAddToCartHeroFunctionRegister.heroFunctionMap)||b.$.isEmptyObject(d.getHeroName())||d.triggerHeroFunction(c)})});"use strict";
e.when("A","ready").register("dp-pre-atc-hero-candidates",function(b){var a=void 0===b.state("dp-pre-atc-hero")?"":b.state("dp-pre-atc-hero").heroName;return{getHeroName:function(){return a},setHeroName:function(b){b&&(a=b)},hasHeroName:function(){return!b.$.isEmptyObject(a)},getHeroCandidates:void 0===b.state("dp-pre-atc-hero-candidates")?[]:b.state("dp-pre-atc-hero-candidates")}});"use strict";e.when("A").register("dp-pre-atc-hero-function-register",function(b){function a(){this.heroFunctionMap=
{};this.registerHero=function(a,b){if(a&&"function"===typeof b)this.heroFunctionMap[a]=b;else throw Error("PRE-ATC-ERROR-REGISTER-1 Failed to register as your Hero name might be invalid or triggerFunction is not function type.");}}var c;return{getInstance:function(){c||(c=new a);return c}}});"use strict";e.when("A","dp-pre-atc-hero-candidates","dp-pre-atc-hero-function-register").register("dp-pre-atc-monitor",function(b,a,c){function d(a,b){this.preAddToCartHeroCandidates=a;this.preAddToCartHeroFunctionRegister=
b;this.logAttribution="dp_pre_atc_monitor"}d.prototype={getHeroName:function(){return this.preAddToCartHeroCandidates.getHeroName()},updateHero:function(a){a?-1<this.preAddToCartHeroCandidates.getHeroCandidates.indexOf(a)?(this.preAddToCartHeroCandidates.setHeroName(a),b.state.replace("dp-pre-atc-hero",null),a=f.ue,"undefined"!==typeof a&&"undefined"!==typeof a.count&&a.count("dpOffers:preatc:updateHero",(a.count("dpOffers:preatc:updateHero")||0)+1)):b.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-1 Failed to update Hero to "+
a+" as it is not registered on DPX side.","ERROR",this.logAttribution):b.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-2 Empty Hero name, Hero has been deleted.","WARN",this.logAttribution)},triggerHeroFunction:function(a){if(!b.$.isEmptyObject(this.preAddToCartHeroFunctionRegister.heroFunctionMap)&&this.preAddToCartHeroCandidates.hasHeroName()){var d=this.getHeroName();try{this.preAddToCartHeroFunctionRegister.heroFunctionMap[d](a)}catch(c){b.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-3 PreAddToCartMonitor could not find Hero's function.",
"ERROR",this.logAttribution)}}else b.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-4 PreAddToCartMonitor tried to trigger Hero function when Hero does not exist.","ERROR",this.logAttribution)}};d.prototype.constructor=d;var e;return{getInstance:function(){e||(e=new d(a,c.getInstance()));return e}}});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids","ready").register("dp-accordion-click-counter",function(b,a,c){return{recordAccordionClick:function(d,e,f){(d=c.getAccordionRowIds(d))&&
d.length&&d.forEach(function(d){var c=e+":"+f+":"+d+":click";b.on("a:accordion:"+d+":select",function(b){a.inc(c)})})}}});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids","ready").register("dp-button-click-counter",function(b,a,c){var d=b.$;return{recordButtonClick:function(b,e,f){(b=c.getAccordionRowIds(b))&&b.length&&b.forEach(function(b){var g=c.getButtonIds(b);g&&g.length&&g.forEach(function(c){var g=e+":"+f+":"+b+":"+c+":click";d("#"+c).click(function(){a.inc(g)})})})}}});
"use strict";e.when("A","ready").register("dp-get-buybox-element-ids",function(b){function a(a){return c(a).length?c(a).map(function(){return this.id}).get():[]}var c=b.$;return{getAccordionRowIds:function(b){return a("#"+b+" [data-a-accordion-row-name]")},getButtonIds:function(b){return a("#"+b+" .a-button-input")}}})});
/* ******** */
(function(m){var g=window.AmazonUIPageJS||window.P,p=g._namespace||g.attributeErrors,d=p?p("DetailPageLatencyAssets",""):g;d.guardFatal?d.guardFatal(m)(d,window):d.execute(function(){m(d,window)})})(function(m,g,p){m.when("dp-interactive-feature-component-base","dp-click-to-ci-utils","A").register("dp-interactive-feature",function(d,e,b){function k(a,c){this.name=a;this._baseComponents={};this.getComponent("default",c)}function n(a){return h.isPlainObject(a)&&a.hasComponents&&h.isArray(a.components)}
var h=b.$;k.prototype={getTimeToInteractivity:function(a,c){a=a||{};var f,l,k=0,d=!1,g=[];n(a)?(b.each(a.components,function(a){h.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(f=this.getComponent(a.name,c),(l=f.getTimeToInteractivity(c,a.events))&&l.interactive?l.interactiveTime>k&&(k=l.interactiveTime):g.push(a.name))},this),g.length||(d=!0)):(l=this.getComponent("default",c).getTimeToInteractivity(c,a.events),d=l.interactive,k=l.interactiveTime);return{interactive:d,interactiveTime:d?k:0}},
getComponent:function(a,c){a=a.toLowerCase();this._baseComponents[a]||(this._baseComponents[a]=new d(a,c));return this._baseComponents[a]},updateFeatureInformation:function(a,c){var f={timestamp:a.timestamp,type:a.type,options:{}},l=!1;n(a.options)?b.each(a.options.components,function(a){h.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(f.options=a,a=this.getComponent(a.name,c).updateComponentInformation(f,c),l=l||a)},this):(f.options=a.options||{},l=this.getComponent("default",c).updateComponentInformation(f,
c));return l},updateRenderTime:function(a,c,f){a=a||{};var l;n(a)?b.each(a.components,function(a){h.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(l=this.getComponent(a.name))&&f&&l.updateRenderTime(f,c)},this):this.getComponent("default",f).updateRenderTime(f,c)},resetFeatureInfo:function(a,c){a=a||{};var f;n(a)?b.each(a.components,function(a){h.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(f=this.getComponent(a.name))&&c&&f.resetComponentInfo(c)},this):this.getComponent("default",c).resetComponentInfo(c)}};
return k});m.when("A","dp-interactive-feature","dp-click-to-ci","dp-critical-features","3p-promise","dp-click-to-ci-utils").register("dp-time-to-interactive",function(d,e,b,k,n,h){var a=d.$;return{_features:{},criticalFeatures:{},_clickToCI:{},pageType:"glance",getTimeToInteractivity:function(c,f){c=c||{};var l={features:c,longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1,nonInteractiveFeatures:[]},b=[];a.isPlainObject(c)&&!a.isEmptyObject(c)&&(d.each(c,function(a,f){f=f.toLowerCase();
var c=this._features[f];c?(c=c.getTimeToInteractivity(a,this.pageType),c.interactive?(a.interactiveTime=c.interactiveTime,c.interactiveTime>l.interactiveTime&&(l.interactiveTime=c.interactiveTime,l.longPoleFeatureName=f)):b.push(f)):b.push(f)},this),b.length||(l.allFeaturesInteractive=!0),l.nonInteractiveFeatures=b);return l},updateFeatures:function(c){c=c||[];var f=!1;a.isArray(c)&&(d.each(c,function(c){var b=!1;a.isPlainObject(c)&&h.isValidNonEmptyString(c.name)&&c.timestamp&&(b=this.getFeatureObject(c.name).updateFeatureInformation(c,
this.pageType));f=f||b},this),this._getClickToCIObj(this.pageType).getMetricInfo().allFeaturesInteractive||this.updateMetricInfo());return f},getFeatureObject:function(a){a=a.toLowerCase();this._features[a]||(this._features[a]=new e(a,this.pageType));return this._features[a]},updateRenderTime:function(c){if(c&&"twisterupdate"===this.pageType){var f=this.getCriticalFeatureObj().getCriticalFeaturesPromise(),b=this._getClickToCIObj(this.pageType).getMetricInfo(),k=this;f&&f.then(function(f){a.isPlainObject(f)&&
!a.isEmptyObject(f)&&d.each(f,function(a,f){f=f.toLowerCase();(f=k._features[f])&&f.updateRenderTime(a,c,k.pageType)},this);b.allFeaturesInteractive||k.updateMetricInfo(!0)})}},updatePage:function(a){if(a){var f=this.pageType;this.pageType=a.toLowerCase();var l=this.getCriticalFeatureObj().getCriticalFeatures();h.logCounter("ClickToCITwisterUpdateTotalCount");l&&this._clickToCI[f]&&!this._clickToCI[f].isResolved()&&this._clickToCI[f].reject(Error("ClicktoCI not available "));this._resetFeatureInfo(l,
a);this._clickToCI[this.pageType]=new b;this.criticalFeatures=new k;"twisterupdate"===this.pageType&&this.criticalFeatures.setIgnoreCriticalFeatures("twister")}},_resetFeatureInfo:function(c,f){f=f.toLowerCase();c=c||{};a.isPlainObject(c)&&!a.isEmptyObject(c)&&d.each(c,function(a,c){c=c.toLowerCase();(c=this._features[c])&&c.resetFeatureInfo(a,f)},this)},_getClickToCIObj:function(a){a=a.toLowerCase();this._clickToCI[a]||(this._clickToCI[a]=new b);return this._clickToCI[a]},getCriticalFeatureObj:function(){a.isEmptyObject(this.criticalFeatures)&&
(this.criticalFeatures=new k);return this.criticalFeatures},updateMetricInfo:function(a){var f=this._getClickToCIObj(this.pageType),b=this,k=this.getCriticalFeatureObj();k.getCriticalFeaturesPromise().then(function(d){k.isCriticalFeaturesKnown&&!f.getMetricInfo().allFeaturesInteractive&&f.setMetricInfo(b.getTimeToInteractivity(d,b.pageType));f.getMetricInfo().allFeaturesInteractive&&b._clickToCI[b.pageType]&&!b._clickToCI[b.pageType].isResolved()?(b._clickToCI[b.pageType].resolve(f.getMetricInfo()),
b._clickToCI[b.pageType].setResolved(!0),a&&h.logCounter("ClickToCITwisterUpdateSuccessCount")):a&&!f.getMetricInfo().allFeaturesInteractive&&h.logCounter("ClickToCITwisterUpdateFailureCount")})},getClickToCIPromise:function(a){if(a){if(a=a.toLowerCase(),this._clickToCI[a])return this._clickToCI[a].getPromiseObject()}else if(this._clickToCI[this.pageType])return this._clickToCI[this.pageType].getPromiseObject()},updateCriticalFeatures:function(){this.getCriticalFeatureObj().updateCriticalInteractiveFeatures();
this.updateMetricInfo()}}});m.when("A").register("dp-interactive-feature-component",function(d){function e(b){if(b instanceof e){var n={};this._renderTime=0;this._isInteractive=b._isInteractive;d.each(b._events,function(b){b.alwaysInteractive&&(n[b.name]={name:b.name,interactiveTime:b.interactiveTime,alwaysInteractive:!0})},this);this._events=n}else this._renderTime=0,this._isInteractive=!0,this._events={}}var b=d.$;e.prototype={updateComponentInformation:function(k){var d=!1;if(b.isPlainObject(k))switch(k.type){case "render":d=
this._updateRenderInformation(k);break;case "interactive":d=this._updateInteractiveInformation(k)}return d},_updateRenderInformation:function(b){var d=!1,e=b.options||{};this._renderTime||(this._renderTime=b.timestamp,this._isInteractive=void 0===e.isInteractive?!0:e.isInteractive,d=!0);return d},_updateInteractiveInformation:function(b){var e;e=b.options||{};var h=e.alwaysInteractive||!1,a=!1;this._isInteractive&&(e=e.events||["click"],d.each(e,function(c){this._events[c]||(this._events[c]={name:c,
interactiveTime:b.timestamp,alwaysInteractive:h},a=!0)},this));return a},getTimeToInteractivity:function(k){var e=0,h=!1,a=[];this.isRendered()&&(this._isInteractive?(b.isArray(k)||(k=["click"]),d.each(k,function(b){var f=this._events[b];f?f.interactiveTime>e&&(e=f.interactiveTime):a.push(b)},this),a.length||(h=!0,this._renderTime>e&&(e=this._renderTime))):(h=!0,e=this._renderTime));return{interactive:h,interactiveTime:h?e:0}},isRendered:function(){return!!this._renderTime},updateRenderTime:function(b){b&&
!this.isRendered()&&(this._renderTime=b);return this._renderTime}};return e});"use strict";m.when("A","ready").register("GlanceViewMetric",function(d){function e(a){g.ue&&g.ue.tag&&g.ue.tag(a)}function b(a,b){g.ue&&d.$.isFunction(g.ue.count)&&g.ue.count(a,b)}function k(){var a=decodeURIComponent(g.location.pathname).split("/").pop();if(a&&a.startsWith("ref\x3d"))return a.slice(4);if(g.URLSearchParams)return a=new URLSearchParams(g.location.search),a.get("ref_")||a.get("ref")}var n=!1,h=g.performance,
a={};"object"===typeof h&&(d.$.isFunction(h.getEntriesByType)?d.each(h.getEntriesByType("navigation"),function(a){"back_forward"===a.type&&(n=!0);e(a.type)}):"object"===typeof h.navigation&&(a[h.navigation.TYPE_RELOAD]="reload",a[h.navigation.TYPE_BACK_FORWARD]="back_forward",a[h.navigation.TYPE_NAVIGATE]="navigate",h.navigation.type===h.navigation.TYPE_BACK_FORWARD&&(n=!0),a[h.navigation.type]&&e(a[h.navigation.type])));var c=function(){g.ue&&"function"===typeof g.ue.pause&&g.ue.pause(!1);g.uex&&
"function"===typeof g.uex&&g.uex("ld")};return{clearTimeOuts:function(){if(d.capabilities.localStorage)try{for(var a=0;a<localStorage.length;a++){var b=localStorage.key(a);if(!b.indexOf("dp_timeout_")){var c=localStorage.getItem(b),e=Date.now();c<=e&&localStorage.removeItem(b)}}}catch(k){m.log("Exception while clearing localStorage "+k.message,"FATAL","CachedGlanceViewMetric")}},requestGVLogging:function(a,l){var h=!1;if(d.capabilities.localStorage&&l)try{var q="dp_timeout_"+l.key,r=Date.now()+1E3*
l.timeout;!n&&localStorage.getItem(q)?(d.post(a,{params:{landingASIN:l.landingASIN||"",pageTypeId:l.pageTypeId||"",pageType:l.pageType||"",subPageType:l.subPageType||"",productGlId:l.productGlId||"",groupingASIN:l.groupingASIN||"",productGroupId:l.productGroupId||"",pageAction:l.pageAction||"",isGlanceView:l.isGlanceView||"",viewID:l.viewID||"",hitType:l.hitType||"",pageAssemblyType:l.pageAssemblyType||"",weblabName:l.weblabName||"",weblabTreatment:l.weblabTreatment||"",ref_:k()||""},success:function(a){g.ue&&
"function"===typeof g.ue.reset&&"string"===typeof a&&a.trim()&&(g.ue.reset(a.trim()),e("cachedPage"),b("cachedDetailPage",1));c()},failure:function(a){b("glance_View_request_failed",1);m.log("GV logging service failed with HTTP status "+a.http.status,"FATAL","CachedGlanceViewMetric");c()}}),h=!0):(e("nonCachedPage"),b("nonCachedDetailPage",1),localStorage.setItem(q,r))}catch(t){e("nonCachedPage"),b("nonCachedDetailPage",1),m.log("Exception while logging glance views "+t.message,"FATAL","CachedGlanceViewMetric")}else e("nonCachedPage"),
b("nonCachedDetailPage",1),m.log("Browser does not support local storage.","WARN","CachedGlanceViewMetric");h||c()}}});"use strict";m.when("A","GlanceViewMetric").execute("ClearPreviousTimeouts",function(d,e){e.clearTimeOuts()});m.when("A","GlanceViewMetric","DetailPageLatencyCachedGlanceViewMetricData").execute("LogGVMetric",function(d,e){d.state.parse();d=d.state("dp_latency_page_cache_info");e.requestGVLogging("/gp/latency/metric-logging",d)});m.when("dp-time-to-interactive").register("dp-interactive-page-refresh-handler",
function(d){return{twisterStartTime:null,createInteractivityObjectForTwisterUpdate:function(){this.twisterStartTime=g.parseInt((new Date).getTime());d.updatePage("twisterUpdate")},updateCriticalFeatures:function(){d.updateCriticalFeatures()},updateRenderTime:function(){d.updateRenderTime(this.twisterStartTime)},getClickToCIMetric:function(){return d.getClickToCIPromise("twisterUpdate")}}});m.when("dp-interactive-feature-component").register("dp-interactive-feature-component-base",function(d){function e(b,
e){this.compName=b;this._pageType={};this.getComponentByPageType(e)}e.prototype={getComponentByPageType:function(b){if(b)return this._pageType[b]||(this._pageType[b]=this.getComponent(b)),this._pageType[b]},updateComponentInformation:function(b,e){return this.getComponentByPageType(e).updateComponentInformation(b)},getTimeToInteractivity:function(b,e){return b?this.getComponentByPageType(b).getTimeToInteractivity(e):{interactive:!1,interactiveTime:0}},resetComponentInfo:function(b){b&&this._pageType[b]&&
(this._pageType[b]=this.getComponent(b))},updateRenderTime:function(b,e){return this.getComponentByPageType(b).updateRenderTime(e)},getComponent:function(b){return this._pageType[b]?new d(this._pageType[b]):this._pageType.glance?new d(this._pageType.glance):new d}};return e});m.when("3p-promise").register("dp-click-to-ci",function(d){function e(){this.reject=this.resolve=null;this.resolved=!1;var b=this;this.promiseObject=new d(function(e,d){b.resolve=e;b.reject=d});this.metricInfo={features:{},longPoleFeatureName:"",
interactiveTime:0,allFeaturesInteractive:!1}}e.prototype={getMetricInfo:function(){return this.metricInfo},setMetricInfo:function(b){this.metricInfo=b},getPromiseObject:function(){return this.promiseObject},isResolved:function(){return this.resolved},setResolved:function(b){this.resolved=b}};return e});m.when("A","dp-time-to-interactive","dp-click-to-ci-utils").register("dp-clicktoci-metric-for-glanceview",function(d,e,b){function k(){var f=e.getClickToCIPromise("GLANCE");f&&f.then(function(b){h(b.features);
a(b.features);n(b)}).catch(function(a){b.logCounter("ClickToCIFailureCount")})}function n(a){b.addTag("DPCIFLongPole"+a.longPoleFeatureName);b.widgetTime("cf","clickToCI",{wb:1},a.interactiveTime);b.widgetTime("fn",void 0,void 0,a.interactiveTime);b.postCSMMetrics("ld","clickToCI",{wb:1});g.ue&&ue.isl&&b.postCSMMetrics("at")}function h(a){c.isPlainObject(a.atc)?(a=a.atc,b.addTag("DPCIFBuyable"),b.widgetTime("cf","dpATCTTI",{wb:1},a.interactiveTime),b.postCSMMetrics("ld","dpATCTTI",{wb:1}),a.hasComponents&&
c.isArray(a.components)&&(a=a.components[0],c.isPlainObject(a)&&b.isValidNonEmptyString(a.name)&&b.addTag("DPCIFBuyable-"+a.name))):b.addTag("DPCIFNonBuyable")}function a(a){if(c.isPlainObject(a)){var e=g.performance;"object"===typeof e&&"object"===typeof e.timing&&d.each(a,function(a,c){var f="DP"+c+"TTI";b.logCounter("DPCF"+c+"TTI",a.interactiveTime-e.timing.navigationStart);b.widgetTime("cf",f,{wb:1},a.interactiveTime);b.postCSMMetrics("ld",f,{wb:1})})}}var c=d.$;b.widgetTime("bb","dpATCTTI",{wb:1});
k();m.when("atf").execute("dp-get-critical-interactive-features",function(){e.updateCriticalFeatures()});return{markClickToCI:k,publishTTIOfCriticalFeatures:a,tagBuyablibity:h,publishTimeToInteractive:n}});m.when("A").register("dp-click-to-ci-utils",function(d){return{widgetTime:function(e,b,d,g){"function"===typeof uet&&uet(e,b,d,g)},addTag:function(e){g.ue&&g.ue.tag&&g.ue.tag(e)},logCounter:function(e,b){g.ue&&d.$.isFunction(g.ue.count)&&(b=b||(g.ue.count(e)||0)+1,g.ue.count(e,b))},isValidNonEmptyString:function(e){return"string"===
typeof e&&0<e.length},postCSMMetrics:function(e,b,d){"function"===typeof uex&&uex(e,b,d)}}});m.when("A","3p-promise","dp-click-to-ci-utils").register("dp-critical-features",function(d,e,b){function k(){this._resolve;this._reject=null;var a=this;this._promiseObj=new e(function(b,f){a._resolve=b;a._reject=f});this._features=null;this.isCriticalFeaturesKnown=!1}var g=d.$,h=[];k.prototype={getCriticalFeatures:function(){return this._features},getCriticalFeaturesPromise:function(){return this._promiseObj},
setCriticalFeatures:function(a){g.isPlainObject(a)&&!g.isEmptyObject(a)&&(this._features=a,this._resolve(a),this.isCriticalFeaturesKnown=!0)},setIgnoreCriticalFeatures:function(a){h.push(a)},updateCriticalInteractiveFeatures:function(){var a={},c=g(".dp-cif");c.length?(c.each(function(){var c=(g(this).data()||{}).featureDetails;if(g.isPlainObject(c)&&b.isValidNonEmptyString(c.name)){var e;e=h.length&&h.includes(c.name)?!1:!0;e&&(a[c.name]=c)}else b.logCounter("DPCIFInvalidData")}),this._parseCriticalFeatures(a)):
b.addTag("DPCIFNoData")},_parseCriticalFeatures:function(a){var c={};g.isPlainObject(a)?(d.each(a,function(a,b){c[b]={};g.isPlainObject(a)&&(c[b]=a)}),g.isEmptyObject(c)?b.addTag("DPCIFNoData"):this.setCriticalFeatures(c)):b.addTag("DPCIFNoData")},resetIgnoreCriticalFeatures:function(){h=[]}};return k});"use strict";m.when("A","load").execute("logDpAssetInjectionMetric",function(d){var e=d.state("dp_injected_meta_assets");if("undefined"!=typeof performance&&"undefined"!=typeof performance.getEntries){for(var b=
0,k=0,n=0,h=0,a=performance.getEntries(),c=0;c<a.length;c++){var f=a[c],l=f.initiatorType;f.name.match(/\.css\?AUIClients\/AmazonUI/g)&&l&&"link"===l&&f.duration+f.startTime>b+k&&(b=f.duration,k=f.startTime);if("undefined"!=typeof e&&"undefined"!=typeof e.assetNames&&0<e.assetNames.length)for(var m=0;m<e.assetNames.length;m++)if(f.name.match(new RegExp("\\.css\\?AUIClients/"+e.assetNames[m]))&&l&&"link"===l){if(0===n||n>f.startTime)n=f.startTime;h<f.startTime&&(h=f.startTime);break}}g.ue&&d.$.isFunction(g.ue.count)&&
(g.ue.count("aui.auiDuration",b),g.ue.count("aui.auiStartTime",k),0!==n&&0!==h&&(g.ue.count("dpcss.dpStartTimeMin",n),g.ue.count("dpcss.dpStartTimeMax",h),g.ue.count("dpcss.auiDiffMin",n-k),g.ue.count("dpcss.auiDiffMax",h-k)))}});m.when("A","load").execute("dp-asset-metric-logging",function(d){function e(a){g.ue&&ue.tag&&ue.tag(a)}function b(a,b){g.ue&&ue.count&&a&&ue.count(a,b)}function k(a,c,e){0<c&&(b(a+"EncodeSize",Math.round(c/1024)),b(a+"DecodeSize",Math.round(e/1024)))}function n(a,b,e){return d.filter(a,
function(a){if(a&&a.initiatorType===e&&a.name&&a.name.match(b))return!0})}function h(a,c,e,g){var k={encodedSize:0,decodedSize:0,httpProtocol:"",count:0};d.each(c,function(c){var h=n(a,new RegExp("\\."+e+"\\?AUIClients/"+c),g)||[];k.count+=h.length;d.each(h,function(d,g){g=c+(g+1);if(d&&0<d.encodedBodySize){var h;h=d&&0===d.transferSize?!0:void 0;h?b("DP"+e+"Cached"+g,1):b("DP"+e+"NotCached"+g,1)}g=k.encodedSize;h=d&&d.encodedBodySize?d.encodedBodySize:0;k.encodedSize=g+h;g=k.decodedSize;d=d&&d.decodedBodySize?
d.decodedBodySize:0;k.decodedSize=g+d;k.httpProtocol=a.nextHopProtocol||""})});return k}(function(){if(g.performance&&performance.getEntriesByType){var a=performance.getEntriesByType("navigation")[0];a&&(0<a.encodedBodySize&&(b("DPEncodedSize",Math.round(a.encodedBodySize/1024)),b("DPDecodedSize",Math.round(a.decodedBodySize/1024))),a.nextHopProtocol&&e("DPhttpProtocol"+a.nextHopProtocol))}})();(function(){if(g.performance&&performance.getEntries){var a=performance.getEntries(),c=d.state("dp_injected_meta_assets"),
f=[];c&&c.assetNames&&(f=c.assetNames||[]);var c=h(a,f,"js","script"),l=h(a,["AmazonUI","AmazonUIjQuery"],"js","script"),f=h(a,f,"css","link"),a=h(a,["AmazonUI"],"css","link");k("DPJS",c.encodedSize,c.decodedSize);k("AUIJS",l.encodedSize,l.decodedSize);k("DPCSS",f.encodedSize,f.decodedSize);k("AUICSS",a.encodedSize,a.decodedSize);b("DPCSSResourceCount",f.count);b("DPJSResourceCount",c.count);c.httpProtocol&&e("DPJSHttpProtocal"+c.httpProtocol);f.httpProtocol&&e("DPCSSHttpProtocal"+f.httpProtocol)}})()});
m.when("A").register("get-resource-time",function(d){return{getResourceTimeByName:function(e,b){var k=[];g.performance&&performance.getEntries&&e&&d.$.isArray(b)&&0<b.length&&(k=performance.getEntries(),k=d.filter(k,function(g){return g&&g.initiatorType===e?-1<d.indexOfArray(b,g.name):!1}));return k}}});m.when("A","dp-click-to-ci-utils").register("dp-interactivity-metric-utils",function(d,e){var b=d.$;return{calculateInteractivity:function(d){var g=d.type,h=b(d.target),a=h.closest("div[id$\x3d'_feature_div']");
e.logCounter("Total-"+g);a&&((a=b(a).data("feature-name"))?e.logCounter(a+"-"+g):e.logCounter(d.target.id+"-"+g));(d=h.closest(".a-declarative"))&&(d=b(d).data("action"))&&e.logCounter(d+"-"+g)}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageCommonOffersAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(f){var k=window.AmazonUIPageJS||window.P,l=k._namespace||k.attributeErrors,d=l?l("ListsCommonUtilityAssets",""):k;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,k,l){f.when("A").register("al-ajax-response-state-parser",function(d){var c=d.$;return{getState:function(e){e=c(e).filter("#listsAjaxResponseStateSection");var a=c("#listsAjaxResponseStateSection");a&&0<=a.length&&a.remove();c(e).appendTo("body");d.state.parse();e=d.state("listsAjaxResponseState")||
{};return{hasError:e.hasError,authRequired:e.authRequired,authUrl:e.authUrl,error:e.error}}}});"use strict";f.when("A","al-bottomsheet-with-fallback","iphone-x-detector").register("bottom-sheet-utils",function(d,c,e){var a=d.$;d.declarative("al-sheet-with-fallback","click",function(g){g.$event.preventDefault();var a=g.data;g=c.create(c.buildComponentParams(a.componentName,a.showCloseButton,e.getAdjustedHeightPx(a.bottomsheetHeight),a.popoverHeight,a.popoverWidth,a.headerForPopover,a.viewLabel,a.viewDescription?
a.viewDescription:a.viewLabel,a.paddingForPopover,a.closeMessage),g.$target);c.show(g)});return{raiseBottomsheet:function(c){c=a(c).parents(".a-sheet-web-container");c.css("z-index",1E4);c.siblings(".a-sheet-lightbox").css("z-index",8E3)}}});"use strict";f.when("A").register("al-bottomsheet-with-fallback",function(d){function c(b){k.ueLogError&&k.ueLogError({logLevel:"ERROR",message:b})}var e,a;f.when("a-sheet").execute(function(b){e=b});f.when("a-modal").execute(function(b){a=b});var g=function(b){if(b)return e?
e.get(b.name):a.get(b.name);c("No ComponentParams specified. Please generate componentParams using .create(component)")},m={IS_POPOVER_LABEL:"IS_POPOVER",IS_BOTTOMSHEET_LABEL:"IS_BOTTOMSHEET"};return{create:function(b,d){if(b)return e?e.create(b):a.create(d,b),b;c("No ComponentParams specified. Please generate componentParams using .create(component)")},show:function(b){(b=g(b))?b.show():c("No View Created. Please create a view first by calling .create(component)")},hide:function(b){(b=g(b))?b.hide():
c("No View Created. Please create a view first by calling .create(component)")},changeHeight:function(b,a,d){var f=g(b);f?e?(f.changeHeight({height:a,duration:d}),b.bottomsheetHeight=a):(f.update({height:a}),b.popoverHeight=a):c("No View Found. Please create a view first by calling .create(component)")},remove:function(b){(b=g(b))?b.$container.remove():c("No View Created. Please create a view first by calling .create(component)")},exists:function(b){return g(b)?!0:!1},onCloseExecute:function(b,a,
g){if("function"!==typeof a)c("Expected onCloseFunction to be of type function");else if(b)d.on((e?"a:sheet":"a:popover")+":"+(g?"beforeHide":"afterHide")+":"+b.name,a);else c("No ComponentParams specified. Please generate componentParams using .create(component)")},onOpenExecute:function(b,a,g){if("function"!==typeof a)c("Expected onOpenFunction to be of type function");else if(b)d.on((e?"a:sheet":"a:popover")+":"+(g?"beforeShow":"afterShow")+":"+b.name,a);else c("No ComponentParams specified. Please generate componentParams using .create(component)")},
buildComponentParams:function(a,c,d,g,f,k,n,t,p,q){var r=e!==l,h={viewTypeLabel:r?m.IS_BOTTOMSHEET_LABEL:m.IS_POPOVER_LABEL,name:a};r?(h.closeType=q?"message":c?"icon":l,h.closeMessage=q,h.height=d,h.sheetLabel=n,h.sheetDescription=t,h.preloadDomId=a):(h.closeButton=c,h.height=g,h.width=f,h.dataStrategy="preload",h.header=k,h.hideHeader=k===l,h.padding=p!==l?p:"none",h.popoverLabel=n);return h},VIEW_TYPE_LABELS:m}});"use strict";f.when("A").register("lists-dpx-common-utils",function(d){return{urlParamValue:function(c){for(var e=
k.location.search.substring(1).split("\x26"),a=0;a<e.length;a++){var d=e[a].split("\x3d");if(d[0]===c)return d[1]}}}});"use strict";f.when("A").register("iphone-x-detector",function(){function d(){try{var a=c();e.forEach(function(c){if(-1<a.indexOf(c))return!0})}catch(d){}return!1}function c(){try{var a;a:{for(var c=document.cookie.split(";"),d=0;d<c.length;d++){for(var b=c[d];" "===b.charAt(0);)b=b.substring(1,b.length);if(0===b.indexOf("amzn-app-ctxt\x3d")){a=b.substring(14,b.length);break a}}a=
null}if(a){var e=a.match(/"v":.*%2C*/);if(e)return e.toString().toLowerCase()}}catch(f){}return""}var e=["iphone10","iphone11"];return{isIphoneX:d,getDeviceType:c,getAdjustedHeightPx:function(a){try{if(a=parseInt(a,10),d())return a+40}catch(c){}return a}}});"use strict";f.when("A").register("amazon-lists-csrf-utils",function(d){return{addCsrfToken:function(c){var e=d.$("[data-amazon-lists-csrf-token]");0!==e.length&&(c["anti-csrftoken-a2z"]=e.attr("data-amazon-lists-csrf-token"))},hasCsrfToken:function(c){c=
c["anti-csrftoken-a2z"];return""!==c&&c!==l}}})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,l=e._namespace||e.attributeErrors,c=l?l("ListsCreateAssets",""):e;c.guardFatal?c.guardFatal(g)(c,window):c.execute(function(){g(c,window)})})(function(g,e,l){g.when("A","al-bottomsheet-with-fallback","al-ajax-response-state-parser","create-new-list-hz","bottom-sheet-utils","lists-dpx-common-utils").execute(function(c,f,z,v,m,d){function t(){m.raiseBottomsheet("#create-list-form-wrapper")}function b(a){n.ajax({type:"GET",url:"/hz/wishlist/create",
data:{createIngressName:a.createIngressName},success:A,error:function(a,b,c){r("Failed to fetch CreateList-Form. Status: "+b+"; Error: "+c)},timeout:2E4})}function A(a){var b=n(a).filter("#createlist-form-container");a=z.getState(a);a.authRequired&&a.authUrl?e.location.href=a.authUrl:a.hasError?r("CreateList form has error \x3d "+a.error):(n("#create-list-form-wrapper").html(b),p("#create-list-form-spinner"),u("#create-list-form-wrapper"))}function p(a){n(a).addClass("aok-hidden")}function u(a){n(a).removeClass("aok-hidden")}
function r(a){f.changeHeight(h,110);p("#create-list-form-spinner");p("#create-list-form-wrapper");u("#createlist-form-loading-error-section");e.ueLogError&&e.ueLogError({logLevel:"FATAL",message:a});if(!y())f.onCloseExecute(h,k,!1)}function k(){p("#createlist-form-loading-error-section");p("#create-list-form-wrapper");u("#create-list-form-spinner");e.location.reload()}function q(a,b,c){r("List creation failed. Status: "+b+"; Error: "+c)}function B(a){a.hasError?r("List creation failed with Error: "+
a.error):e.location="/hz/wishlist/ls/"+a.listExternalId}function y(){return"DETAIL_PAGE"===(c.state("createListIngressState")||{}).ingressName&&w}var n=c.$,w,x,h;c.declarative("awl-create-list-bottomsheet","click",function(a){var d=a.data||{};c.state("createListIngressState",{ingressName:d.ingressName});var e=d.componentName;e&&"function"==typeof uet&&uet("bb",e,{wb:1});e=a.data||{};h=f.create(f.buildComponentParams(e.componentName,!0,340,430,400,l,e.viewName,e.viewDescription,l,l),a.$target);f.show(h);
if(y())f.onOpenExecute(h,t);b(d);(a=d.componentName)&&"function"==typeof uet&&uet("cf",a,{wb:1});a&&"function"==typeof uex&&uex("ld",a,{wb:1})});c.declarative("create-list-bottomsheet-submit","click",function(a){a=a.data||{};var b=n("#createlist-list-name-textinput").val();b===l||0===b.length?n("#createlist-list-name-textinput").parent("div").addClass("a-form-error"):(p("#createlist-form-loading-error-section"),p("#create-list-form-wrapper"),u("#create-list-form-spinner"),a.listName=b,(b=d.urlParamValue("createAndAddAsin"))&&
0<b.length&&(a.asin=b),y()?((b=w.getAsin())&&0<b.length&&(a.asin=b),v(a,w.handleSuccess,w.handleError)):"HEARTS_BOTTOMSHEET"===(c.state("createListIngressState")||{}).ingressName&&x?(a.isDefault=!0,f.hide(h),v(a,x.onCreateSuccess,x.onCreateError)):v(a,B,q))});g.when("dp-create-list-handler").execute(function(a){w=a});g.when("hearts-create-list-handler").execute(function(a){x=a});c.on("a:expander:create-list-learn-more-popover:toggle:expand",function(){h.viewTypeLabel===f.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?
f.changeHeight(h,425):f.changeHeight(h,580)});c.on("a:expander:create-list-learn-more-popover:toggle:collapse",function(){f.changeHeight(h,340);h.viewTypeLabel===f.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?f.changeHeight(h,340):f.changeHeight(h,430)});c.declarative("createlist-list-name-validation",["keyup"],function(a){0!==a.$target.context.value.length&&n("#createlist-list-name-textinput").parent("div").hasClass("a-form-error")&&n("#createlist-list-name-textinput").parent("div").removeClass("a-form-error")})});
"use strict";g.when("A","create-new-list-hz","a-modal","lists-dpx-common-utils").register("create-utils",function(c,f,g,v){function m(b){b&&"function"==typeof uet&&uet("cf",b,{wb:1});b&&"function"==typeof uex&&uex("ld",b,{wb:1})}var d=c.$,t=function(b){b="#"+(b.formId||"addToCart");0===d(b).length&&(b="#atwl-form");return b};c.declarative("show-create-list",["click touchstart"],function(b){b.$event.preventDefault();var d=b.data;if(d.url||d.name)"function"==typeof uet&&uet("bb","create-list-dp-widget",
{wb:1}),g.create(b.$target,d).show({padding:"none"}),m("create-list-dp-widget");c.on("a:popover:afterHide:redesigned-create-list",function(){g.remove("redesigned-create-list")})});c.declarative("list-name-validation",["keyup"],function(b){0!==b.$target.context.value.length&&d("#alert-list-name").is(":visible")&&(d("#alert-list-name").addClass("aok-hidden"),d("#alert-list-name").parent("div").find("input").each(function(){d(this).removeClass("a-form-error")}))});return{submitCreate:function(b,g,p){b.$event.preventDefault();
var u=d("#create-list-form").closest(".a-popover"),r=d("#list-name").val();if(""===r)d("#alert-list-name").removeClass("aok-hidden"),d("#alert-list-name").parent("div").find("input").each(function(){d(this).addClass("a-form-error")});else{var k={},q=c.state("popoverState")||{},q=t(q),m=v.urlParamValue("createAndAddAsin");m&&1<m.length&&(k.asin=m);"1"===d("#is-create-and-add").val()&&(q=d(q).find("#ASIN, [name^\x3d'ASIN'], [name\x3d'a'], [name\x3d'asin']").val(),"undefined"!==q&&(k.asin=d.trim(q)));
d("#create-list-loading").removeClass("aok-hidden");u.find("#popover-spinner .a-popover-loading").show();d("#create-list-form").addClass("aok-hidden");k.listName=r;k.sid=b.data.sessionId;k.vendorId=b.data.sourceVendorId;k.privacyStatus=b.data.privacyStatus;k.listType=b.data.listType;if(b=e.ue?e.ue.rid:l)k.relatedRequestID=b;f(k,g,p)}}}});"use strict";g.when("A","amazon-lists-csrf-utils").register("create-new-list-hz",function(c,f){var g=c.$;return function(c,m,d){var t=[];f.addCsrfToken(t);var b=
e.ue?e.ue.rid:l;b&&(c.relatedRequestID=b);c.isJson=!0;return g.ajax("/hz/wishlist/create/newlist",{type:"POST",headers:t,data:c,success:m,error:d,timeout:1E4})}})});
/* ******** */
(function(f){var n=window.AmazonUIPageJS||window.P,p=n._namespace||n.attributeErrors,d=p?p("ListsDPXCommonAssets",""):n;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,n,p){f.when("A","a-dropdown","a-modal","legacy-create-utils").execute(function(d,u,b,h){var m=d.$;d.declarative("reg-create-change-privacy",["click"],function(b){h.changePrivacySetting(b)});d.declarative("list-privacy-toggle",["click"],function(b){h.togglePrivacy(b)});d.declarative("list-name-toggle",
["click"],function(b){h.toggleListName(b)});d.declarative("idea-list-toggle",["click"],function(b){h.toggleIdeaList(b)});d.on("a:popover:beforeShow:reg-create",function(b){m("#createCal").append(m("#popCal"))});d.on("a:popover:show:reg-create",function(b){h.onShow(b)});d.on("a:popover:ajaxContentLoaded:reg-create",function(b){b=b.popover.$popover;m("#createCal").append(m("#popCal"));b.hasClass("pop-create")||b.addClass("pop-create")});d.on("a:popover:beforeHide:reg-create",function(b){m("#createCalHolder").append(m("#popCal"))});
d.on("a:popover:hide:reg-create",function(b){h.onClose(b)});d.on("a:dropdown:select",function(b){h.onDropdownSelect(b)})});"use strict";f.when("A","create-new-list-hz").register("legacy-create-utils",function(d,u){var b=d.$;d.state.parse();d.state("pageInfo");d.state("createInfo");var h=d.state("popoverState")||{},m=0,f=function(a){a="#"+(a.formId||"addToCart");0===b(a).length&&(a="#atwl-form");return a},r=f(h),v=function(a){var c={};b.each(a.serializeArray(),function(a,b){b.name.match(/create-|next-/)&&
(c[b.name]=b.value)});return c},z=function(a){var c={},q={};c["create-sourceVendorId"]=a["create-sourceVendorId"];"undefined"!==typeof w("vendorId")&&(c["create-sourceVendorId"]=w("vendorId"));var k="wishlist";if(a["create-for"]){var e=a["create-for"];"friend"===e?k="giftlist":"child"===e&&(k="giftlist",c["create-isKidList_Registry"]=1)}h=d.state("popoverState")||{};r=f(h);"1"===b("#create-isCreateAndAdd").val()&&(c.isCreateAndAdd=!0,e=b(r).find("#ASIN, [name^\x3d'ASIN'], [name\x3d'a'], [name\x3d'asin']").val(),
c.asin=b.trim(e),e=d.state("wishlistDPState")||{},e.customizationToken&&(c.customizationToken=e.customizationToken));if("giftlist"!==k&&"1"===b("#create-isIdeaList").val())return e=b.trim(a["create-name-il"]),""!==e?c.name=e:q.list_name_il="empty",c.isIdeaList=!0,c.description=b.trim(a["create-description-il"]),{errors:q,userCreateArgs:c};c["create-registryType"]=k;if("wishlist"===k)e=b.trim(a["create-name"]),""!==e?c["create-name"]=e:q.list_name="empty";else{var g=b.trim(a["create-first-name"]),
l=b.trim(a["create-last-name"]),e=b.trim(a["create-participant_relationship"]);""!==g||""!==l?(c["create-participant2-givenName"]=g,c["create-participant2-surName"]=l,g=g+" "+l,c["create-participant2-name"]=g,c["create-name"]=g,c["create-participant2-relationship_Participant"]=e):q.recipient_name="empty"}e="N";g="wishlist"===k?"Y":"N";if(l=a["create-privacy"])"public"===l?("undefined"!==typeof a["create-recipient-name"]&&(c["create-recipient-name"]=b.trim(a["create-recipient-name"])),g="Y"):("hidden"!==
l&&(e="Y"),g="N");c["create-isPrivate"]=e;c["create-isSearchable"]=g;"wishlist"===k&&(c["create-persistence"]=b.trim(a["create-persistence"]));e=a["create-month"];g=a["create-day"];0<b("#popCal").length&&((l=b('[data-action\x3d"a-cal-input"]').val())?(e=l.split("/")[0],g=l.split("/")[1]):e=l="-1");e&&g&&("-1"!==e||"-1"!==g)&&(e=parseInt(e,10),g=parseInt(g,10),(l=new Date(1904,e-1,g),l.getMonth()+1===e)&&l.getDate()===g?(c["create-occasion1-fromDate_Month"]=e,c["create-occasion1-fromDate_Day"]=g,c["create-occasion1-fromDate_Year"]=
1904,"giftlist"===k&&(c["create-isKidList_Registry"]&&a["create-age"]&&"-1"!==a["create-age"]&&(c["create-occasion1-firstYear_Occasion"]=(new Date).getFullYear()-a["create-age"]),a["create-reminder"]&&(c["create-occasion1-reminderOffset_Occasion"]=a["create-reminder"]))):1<m||(q.occasion_date="invalid"));a["create-next"]&&(k=a["create-next"],c["next-action"]=k,"add"===k&&d.each(["asin","purchasedQty","requestedQty","purchaseDate","redirect"],function(b,e){b="next-"+b;a[b]&&(c[b]=a[b])}));return{errors:q,
userCreateArgs:c}},A=function(a){a.find("#WLNEW_error").addClass("a-hidden");a.find(".a-alert-inline").addClass("a-hidden");a.find(".a-form-error").removeClass("a-form-error");a.find(".reg-create-form").removeClass("a-hidden")},t=function(a){var b=a.find('select[name\x3d"create-month"]').val(),d=a.find('select[name\x3d"create-day"]').val();b&&"-1"!==b&&d&&"-1"!==d?a.find("#WLNEW_section_occAge").removeClass("a-hidden"):a.find("#WLNEW_section_occAge").addClass("a-hidden")},x=function(a,c){c.find("#WLNEW_input_privacy").val(a);
var d="";b("#a-popover-reg-create-privacy").find(".a-list-link li a").each(function(){b(this).removeClass("a-active");var c=b(this).data("reg-create-change-privacy");c&&c.type===a&&(d=c.triggerText,b(this).addClass("a-active"))});c.find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(d)},y=function(a){"private"===a?(b(".reg-create-form").find("#private_blurb").removeClass("a-hidden"),b(".reg-create-form").find("#public_blurb").addClass("a-hidden"),b(".reg-create-form").find("#public_recipient").addClass("a-hidden")):
(b(".reg-create-form").find("#private_blurb").addClass("a-hidden"),b(".reg-create-form").find("#public_blurb").removeClass("a-hidden"),b(".reg-create-form").find("#public_recipient").removeClass("a-hidden"))},w=function(a){for(var b=n.location.search.substring(1).split("\x26"),d=0;d<b.length;d++){var k=b[d].split("\x3d");if(k[0]===a)return k[1]}},B=function(a){a.each(function(){b.data(this,"default",this.value)}).focus(function(){this.select();this.onmouseup=function(){this.onmouseup=null;return!1}}).keyup(function(){b.data(this,
"edited",""!==b.trim(this.value))}).change(function(){b.data(this,"edited",""!==b.trim(this.value))}).blur(function(){b.data(this,"edited")||(this.value=b.data(this,"default"))})},C=function(a){a.delegate("input:text","keypress",function(a){13===a.which&&a.preventDefault()})};return{changePrivacySetting:function(a){a.$event.preventDefault();var c=a.$target.closest(".a-popover");a=a.data;var d=a.type;c.hide();b("#a-popover-reg-create-privacy").find(".a-active").removeClass("a-active");b("#a-popover-reg-create-privacy").find("#WLNEW_link_"+
d).addClass("a-active");b(".reg-create-form").find("#WLNEW_input_privacy").val(d);b(".reg-create-form").find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(a.triggerText);y(a.privacy)},togglePrivacy:function(a){a.$event.preventDefault();a=a.data;var c=a.privacy;b(".reg-create-form").find("#WLNEW_input_privacy").val(c);b(".reg-create-form").find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(a.triggerText);y(c)},toggleListName:function(a){var c=a.data;a=c.name;var d=c.privacy,k=c.persistence,e=c.isReorderList===
p?!1:c.isReorderList,c=c.isReorderListView===p?!1:c.isReorderListView;b(".reg-create-form").find("#WLNEW_section_wlName").show();b(".reg-create-form").find("#create-isIdeaList").val("0");b(".reg-create-form").find("#WLNEW_section_ideaList").hide();b(".reg-create-form").find("#WLNEW_list_name").val(a);b(".reg-create-form").find("#WLNEW_privacy_"+d).click();b(".reg-create-form").find("#WLNEW_input_privacy").val(d);b(".pop-create").find("#WLNEW_list_persistence").prop("checked",c?e:"persistent"===k);
c&&b(".reg-create-form").find("#WLNEW_list_persistence").val(e?"persistent":"non-persistent")},toggleIdeaList:function(a){b(".reg-create-form").find("#WLNEW_section_wlName").hide();b(".reg-create-form").find("#create-isIdeaList").val("1");b(".reg-create-form").find("#WLNEW_section_ideaList").removeClass("a-hidden").show()},onShow:function(a){var c=a.popover;a=a.popover.$popover;c.data.first&&a.find("#WLNEW_section_wlFor").addClass("a-hidden");c.data.forFriend&&(a.find("#WLNEW_section_wlName, #WLNEW_section_occAge, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_wlFor, #WLNEW_listtype_listname_divider, #WLNEW_section_ideaList").addClass("a-hidden"),
a.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occReminder, #WLNEW_privacy_gl").removeClass("a-hidden"),"child"===c.data.value&&t(a),b(".reg-create-form").find("#WLNEW_privacy_private").click(),b(".reg-create-form").find("#WLNEW_input_privacy").val("private"),a.find('select[name\x3d"create-for"]').val("friend"));c.data.sourceVendorId&&a.find('input[name\x3d"create-sourceVendorId"]').val(c.data.sourceVendorId);if(c.data.next){var h=c.data.next,k=a.find(".reg-create-form");k.find('input[name\x3d"create-next"]').val(h);
d.each(c.data,function(a,c){c.match(/^next-/)&&(a=b("\x3cinput/\x3e",{type:"hidden",name:c,value:a}),k.prepend(a))})}B(a.find("#WLNEW_list_name"));C(a)},onDropdownSelect:function(a){var c=b(a.selectNode).closest(".a-popover");if("create-for"===a.name){var d="public";if("self"===a.value)c.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occAge, #WLNEW_section_occReminder, #WLNEW_privacy_gl").addClass("a-hidden"),c.find("#WLNEW_section_wlName, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_ideaList").removeClass("a-hidden"),
"1"===b("#create-isIdeaList").val()?c.find("#WLNEW_section_wlName").hide():c.find("#WLNEW_section_ideaList").hide();else if("friend"===a.value||"child"===a.value)c.find("#WLNEW_section_wlName, #WLNEW_section_occAge, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_ideaList").addClass("a-hidden"),c.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occReminder, #WLNEW_privacy_gl").removeClass("a-hidden"),0===b("#popCal").length&&c.find("#WLNEW_occ_date").removeClass("a-hidden"),
"child"===a.value&&t(c),d="hidden",b(".reg-create-form").find("#WLNEW_privacy_private").click(),b(".reg-create-form").find("#WLNEW_input_privacy").val("private");x(d,c)}else"create-month"===a.name||"create-day"===a.name?(a=c.find('select[name\x3d"create-for"]').val())&&"child"===a&&t(c):"choose-relationship"===a.name&&(a=a.value,c.find("#create-participant_relationship").val(a))},onClose:function(a){x("public",a.popover.$popover);m=0},submitCreate:function(a,c,h,k,e){a.$event.preventDefault();var g=
a.$target.closest(".reg-create-form"),l=g.closest(".a-popover");A(g);m++;var f=v(g),f=z(f),p=!1;d.each(f.errors,function(a,c){a=l.find("#WLNEW_alert_"+c);a.removeClass("a-hidden");a.parent("div").find("input").each(function(){b(this).addClass("a-form-error")});p=!0});p||(a={sid:a.data.sid,createListToken:a.data.createListToken},b.extend(a,f.userCreateArgs),l.find("#WLNEW_loading").removeClass("a-hidden"),l.find("#popover-spinner .a-popover-loading").show(),g.addClass("a-hidden"),f.userCreateArgs.isIdeaList?
(c="/hz/wishlist/ajax/createlist?ref\x3ddl_create_list_lv",f.userCreateArgs.isCreateAndAdd&&(c="/hz/wishlist/ajax/createlistandadditem?ref\x3ddl_create_list_dp"),b.ajax(c,{type:"POST",data:a,success:k,error:e})):(k="Y"===a["create-isPrivate"]?"private":"public",e={},e.sid=a.sid,"undefined"!==typeof a.createListToken&&(e.createListToken=a.createListToken),e.listType=a["create-registryType"],e.privacyStatus=k,"undefined"!==typeof a["create-name"]&&(e.listName=a["create-name"]),"undefined"!==typeof a["create-persistence"]&&
(e.persistence=a["create-persistence"]),"undefined"!==typeof a["create-sourceVendorId"]&&(e.vendorId=a["create-sourceVendorId"]),"undefined"!==typeof a["create-participant2-name"]&&(e.participantName=a["create-participant2-name"]),"undefined"!==typeof a["create-participant2-surName"]&&(e.participantGivenName=a["create-participant2-surName"]),"undefined"!==typeof a["create-participant2-givenName"]&&(e.participantSurName=a["create-participant2-givenName"]),"undefined"!==typeof a["create-participant2-relationship_Participant"]&&
(e.relationship=a["create-participant2-relationship_Participant"]),"undefined"!==typeof a["create-occasion1-fromDate_Day"]&&(e.occasionFromDate=a["create-occasion1-fromDate_Day"]),"undefined"!==typeof a["create-occasion1-fromDate_Month"]&&(e.occasionFromMonth=a["create-occasion1-fromDate_Month"]),"undefined"!==typeof a["create-occasion1-fromDate_Year"]&&(e.occasionFromYear=a["create-occasion1-fromDate_Year"]),"undefined"!==typeof a["create-occasion1-reminderOffset_Occasion"]&&(e.occasionReminderOffset=
a["create-occasion1-reminderOffset_Occasion"]),"undefined"!==typeof a.asin&&(e.asin=a.asin),"undefined"!==typeof a.customizationToken&&(e.customizationToken=a.customizationToken),"undefined"!==typeof a["create-recipient-name"]&&(e.recipientName=a["create-recipient-name"]),u(e,c,h)))}}});"use strict";f.register("mash-capabilities",function(){var d;return{isDispatchEventAvailable:function(){if(d!==p)return d;var f;a:{f=document.cookie.split(";");for(var b=0;b<f.length;b++){for(var h=f[b];" "===h.charAt(0);)h=
h.substring(1,h.length);if(0===h.indexOf("amzn-app-ctxt\x3d")){f=h.substring(14,h.length);break a}}f=null}b=0;if(null!==f)try{var m=f.match(/"cp":[0-9]*/);null===m&&(m=decodeURIComponent(f).match(/"cp":[0-9]*/));if(null!==m&&0<m.length){var n=m[0].split(/:/);if(null!==n&&2===n.length){var r=parseInt(n[1],10);b="number"===typeof r?r&2048:0}}}catch(v){}return d=0!==b}}});"use strict";f.when("A").register("weblab-trigger",function(d){var f=d.$;return function(b){f.ajax({url:"/hz/wishlist/triggerweblab?name\x3d"+
b,success:function(d){d||n.ueLogError(p,{logLevel:"FATAL",attribution:"ListsDPXCommonAssets::"+b,message:"failed To trigger weblab "+b})},timeout:2E4})}})});
/* ******** */
(function(p){var m=window.AmazonUIPageJS||window.P,t=m._namespace||m.attributeErrors,a=t?t("RegistryDPAssets",""):m;a.guardFatal?a.guardFatal(p)(a,window):a.execute(function(){p(a,window)})})(function(p,m,t){p.when("A","b2b-lists-detail").execute(function(a,g){function e(){var b=a.$("#free-form-quantity-dropdown"),f=a.$("#quantity-update-text"),h=a.$("#quantity"),e=1;0<b.length&&b.is(":visible")?(e=b.val(),0===e.length&&(e=f.val())):0<f.length&&f.is(":visible")?e=f.val():0<h.length&&h.is(":visible")&&
(e=h.val());return e}g.isEnabled()&&(a.on("a:dropdown:selected:quantity",function(a){g.updateQuantity(a.value)}),a.on("a:dropdown:selected:free-form-quantity-dropdown",function(b){0<b.value.length?g.updateQuantity(b.value):g.updateQuantity(a.$("#quantity-update-text").val())}),a.$(document).delegate("#quantity-update-text","change",function(a){g.updateQuantity(a.target.value)}),a.on("a:pageUpdate",function(){var b=a.$("#ASIN").val();g.updateQuantityAndAsin(e(),b)}))});p.when("A","a-modal").register("b2b-lists-detail",
function(a,g){function e(){return g.get(a.$("#business-list-modal"))}function b(a,b,e){var g=new RegExp("([?\x26])"+b+"\x3d.*?(\x26|$)","i"),n=a;a.match(g)&&(n=a.replace(g,"$1"+b+"\x3d"+e+"$2"));return n}return{updateQuantityAndAsin:function(f,h){var g=(a.state("businessListPageState")||{}).businessListUrl;g&&(g=b(g,"quantity",f),f=g=b(g,"asin",h),e().update({url:f}))},updateQuantity:function(f){var h=(a.state("businessListPageState")||{}).businessListUrl;h&&(f=h=b(h,"quantity",f),e().update({url:f}))},
isEnabled:function(){return 0<a.$("#add-business-list-button").length}}});"use strict";p.when("A","a-popover","atwl-common-util","atwl-dropdown-util","atwl-util","atwl-inline-util","add-to-wish-list:plugin-registry").register("add-to-wish-list",function(a,g,e,b,f,h,r){"undefined"!==typeof a.state.parse&&a.state.parse();var l=a.$,n=e.getState("atwl"),d=e.getState("popoverState"),A=e.atwlFormSelector(),q=m.currentType,z=e.getState("wishlistDPState").eventsBound,v=n.showInlineLink||!1;m.setRegistryId=
e.setRegistryId;var k=[],w=function(){l("#wishListMainButton,#"+n.activePopoverButtonId).addClass("a-hidden");b.hideDropDown();l("#atwl-error-holder").removeClass("a-hidden")},u=function(a){B();a=function(){var c=e.getState("popoverState"),c=document.getElementById(c.formId||"addToCart");if("undefined"===typeof c||null===c)c=document.getElementById("addToWL");null!==c&&(c=l("#add-to-wishlist-button-submit"),e.forceFormSubmit(c))};var c=r.getPlugin();c&&c.addToList?c.addToList(a):a()},p=function(b){"undefined"!==
typeof b&&b.preventDefault();B();b=function(){var c,b=l(A).find(e.popCommandSelector).val();c=e.getState("wishlistDPState");if(b&&""!==b){b=b.split("_");q=b[2];if("wishlist"!==q&&"giftlist"!==q&&"supplylist"!==q||l("html").hasClass("a-lt-ie9")){f.redirectToHUCPage();return}c="new"===b[1]?"create":"default"===b[1]&&c.isFirstCreate?"create":"add"}else if(q="wishlist",c=c.isFirstCreate?"create":"add","add"===c&&l("html").hasClass("a-lt-ie9")){f.redirectToHUCPage();return}a.state("wishlistDPState",{action:c,
type:q});m.currentType=q;l("#add-wishlist-declarative").trigger("click")};var c=r.getPlugin();c&&c.addToList?c.addToList(b):b()};a.on("addFormSubmit",p);var x=function(a){try{if("undefined"!==typeof a){var c="";if("undefined"!==typeof a.pcompHtml&&""!==a.pcompHtml.trim())c=a.pcompHtml;else{w();return}l("#wishListMainButton").hasClass("a-hidden")||(l("#wishListMainButton,#"+n.activePopoverButtonId).addClass("a-hidden"),b.hideDropDown(),l("#atwl-output-holder").empty(),l("#atwl-output-holder").append(c),
l("#atwl-output-holder").removeClass("a-hidden"))}else w();for(c=0;c<k.length;c++)if("function"===typeof k[c])k[c](a)}catch(f){w()}},t=function(b){b.preventDefault();B();b=function(){var c=e.getState("wishlistDPState"),b=l(A).find("[name\x3d'wlPopCommand']").val(),k=c.action,f=c.type;b&&""!==b&&(b=b.split("_"),k="new"===b[1]?"create":"default"===b[1]&&c.isFirstCreate?"create":"add",q=b[2],a.state("wishlistDPState",{action:k,type:q}),m.currentType=q);"add"===k?(h.showSpinner(),k=h.parseParams(k,f),
c.customizationToken&&(k.customizationToken=c.customizationToken),a.ajax("/gp/registry/atwl/add.html",{method:"post",params:k,success:h.addItemResponseHandler,error:h.showError})):l("#add-wishlist-declarative").trigger("click")};var c=r.getPlugin();c&&c.addToList?c.addToList(b):b()},y=function(b){var c=document.createElement("input");c.type="hidden";c.id=b;c.name=b;"undefined"!==typeof l("#addItemForm")&&l("#addItemForm").append(c);return c},B=function(){var b=e.getState("wishlistDPState");delete b.customizationToken;
delete b.customizedPrice;a.state.replace("wishlistDPState",b)};g=function(){(d.showWishListDropDown||d.showBabyRegDropdown||d.isAddToWishListDropDownAuiEnabled||d.showPopover)&&d.showPopover&&(a.capabilities.touch?l("#add-to-wishlist-button-submit").unbind("click").bind("click",u):v?l("#add-to-wishlist-button-submit").unbind("click").bind("click",t):l("#add-to-wishlist-button-submit").unbind("click").bind("click",p),z||(a.state("wishlistDPState",{eventsBound:!0}),a.declarative("add-wishlist-declarative",
["click"],function(b){b=e.getState("wishlistDPState");var c=f.parsePostData(b.action,b.type),k=m.ue;k&&k.count("lists:dp:addtolist:click",(k.count("lists:dp:addtolist:click")||0)+1);l("#atwl-dd-no-title-holder").hasClass("a-hidden")||l("#atwl-dd-no-title-holder").addClass("a-hidden");if("undefined"!==typeof c.asin&&0!==c.asin.length||"undefined"!==typeof c.name&&0!==c.name.length)if("false"===b.custRecognized){if(null===b.asin){b=y("name.0");var c=y("imageUrl.0"),k=y("productUrl.0"),d=y("priceInput"),
h=y("quantity.0");b.value=document.getElementById("name").value;c.value=document.getElementById("imageUrl").value;k.value=document.getElementById("productUrl").value;d.value=document.getElementById("price").value;h.value=1}l("#addItemForm").submit()}else a.ajax(c.url,{method:"get",dataType:"json",cache:!1,params:c,success:x,error:w});else l("#atwl-dd-no-title-holder").removeClass("a-hidden")})))};g();a.on("atwl-trigger-onload-bindings",g);return{setPostAddSuccess:function(b){k.push(b)}}});"use strict";
p.when("A","a-popover","atwl-common-util").register("atwl-dropdown-util",function(a,g,e){var b=a.$;e.getState("popoverState");var f=0,h,r=e.CONST,l=e.ie8NoScroll,n=e.setAtwlState,d=function(){b("#wishListDropDown").removeClass("a-button-selected");b("#wishListMainButton").removeClass("a-button-selected")},A=function(){var c=e.getState("atwl"),b=c.activePopoverButtonId;return"undefined"!==b&&"add-to-baby-button-group"===b?c.babyDropDownHtml:c.dropDownHtml},q=function(c){var b=e.getState("atwl").activePopoverButtonId;
"undefined"!==b&&"add-to-baby-button-group"===b?n({babyDropDownHtml:c}):n({dropDownHtml:c})},z=function(){var c=b("#atwl-dd-ul").parent();if(c&&c.get(0)){var a=c.get(0).scrollHeight,k=c.height(),c=2*parseInt(c.css("padding-top"),10);return a>k+c}return!1},v=function(c){c.find(".a-button-close").hide();c.find(".a-popover-content").css({"margin-right":"0px"});c.css({padding:"0"});c.find(".a-popover-inner").css({padding:"0"});setTimeout(function(){c.find(".a-arrow-border").addClass("aok-hidden");b("#atwl-rich-content").css({"margin-bottom":"0px",
width:"auto"});var k=e.getState("atwl");if(k.hzPopover){var f=document.getElementById(k.activePopoverButtonId);if(null!==f&&"undefined"!==typeof f){var d=f.getBoundingClientRect().left;a.capabilities.rtl&&(d=b(m).width()-f.getBoundingClientRect().right);c.css({left:d+"px"})}}b.browser.msie&&(d=b("#"+k.wishlistButtonSubmitId),k=d.offset(),f=d.height(),d=k.left,k=k.top+f,l()&&(d+=document.body.parentElement.scrollLeft,k+=document.body.parentElement.scrollTop),z()&&(d-=17),c.css({left:d+"px",top:k+"px"}))},
50)},k=function(c){var a;a=l()?50:0;setTimeout(function(){var a=b("#atwl-popover-inner"),k=a.width(),d=e.getState("atwl"),f=document.getElementById(d.activePopoverButtonId);d.hzPopover&&null!==f&&"undefined"!==typeof f?k=f.getBoundingClientRect().width:z()?k+=r.overflowWidth:b(".atwl-dd-list-name").each(function(c){c=b(this);c.width(c.width()+r.noOverflowWidth)});d=c.find("ul li a.a-active").first();d.css("margin-left","1px");d.parent().focus();a.width(k)},a)},w=function(){if(h){var c=g.get(h);c&&
c.hide()}},u=function(c){var a=r.widthStaticPopovers;try{a=document.getElementById("add-to-wishlist-button-group").clientWidth}catch(k){}b("#"+c).children().first().width(a);w();if(g){var d=g.get(h),f=e.getState("atwl"),d=d?g.get(h):g.create(b("#"+f.activePopoverButtonId),{content:b("#"+c).html(),name:"atwl",skin:function(c){return c},activate:"onmouseclick",width:a,position:f.dropDownPosition||"triggerBottom"});d.update({width:a,content:b("#"+c).html()});h=d.id;d.show().updatePosition();v(d.$popover)}},
p=function(){d();f++;w();u("atwl-dd-error-holder")},x=function(){var c=e.getState("atwl");return g.create(b("#"+c.activePopoverButtonId),{content:A(),name:"atwl",skin:function(c){return c},activate:"onmouseclick",position:c.dropDownPosition||"triggerBottom"})},t=function(c){c.update({content:A(),width:"auto"});c.show();v(c.$popover);k(c.$popover)},y=function(){var c=g.get("atwl");c&&c.isActive()?c.hide():(c=x(),g.remove(c),c=x(),t(c),a.capabilities.touch&&setTimeout(function(){var c=b("#wishlistButtonStack"),
a=c.clone(),k=c.parent();c.remove();k.append(a)},300),"function"===typeof m.uet&&m.uet("cf","addToListDropdown",{wb:1}),"function"===typeof m.uex&&m.uex("ld","addToListDropdown",{wb:1}))},B=function(){var c=g.get("atwl");c&&c.isActive()&&c.hide()},C=function(c,b,a){c.append('\x3cinput type\x3d"hidden" id\x3d"'+b+'" name\x3d"'+b+'" value\x3d"'+a+'"\x3e')};return{makeDropDownArrowInactive:d,getDropDownHtml:A,setDropDownHtml:q,resetDropDownHtml:function(){q("")},resetAjaxFailCount:function(){this.ajaxFailCount=
0},hideDropdown:B,hideError:function(){w();var c=e.getState("atwl");return f>=c.maxAjaxFailureCount},showUnavail:function(){w();w();u("atwl-dd-unavail-holder")},showSpinner:function(){u("atwl-dd-spinner-holder")},parseAjaxResponse:function(c){d();w();var k;if("object"===typeof c)k=c;else try{k=a.parseJSON(c)}catch(f){p();return}"undefined"!==typeof k.html&&"undefined"!==k.css?(q(k.html),c=k.css,b("body").append(c),y()):p()},showError:p,showDropDown:y,setInputRegistryId:function(c,k){"undefined"===
typeof k&&(k="wishlist");var d="pop_"+c+"_"+k,f=b(e.atwlFormSelector()),h=f.find(e.popCommandSelector);h.length?h.attr("value",d):C(f,"sourceCustomerOrgListID",d);d=f.find("[name\x3d'registryID']");d.length?d.attr("value",c):C(f,"registryID",c);c=f.find("[name\x3d'registryType']");c.length?c.attr("value",k):C(f,"registryType",k);n({inSubmit:!0});k=f.find("[name\x3d'submit.add-to-registry.wishlist'],[name\x3d'submit.add-to-wishlist']").eq(0);k.length?k.click():a.trigger("addFormSubmit");B();return!1}}});
"use strict";p.when("A","a-popover","a-modal","atwl-dropdown-util","atwl-common-util","atwl-inline-util","kbp","amazon-lists-csrf-utils").execute("atwl-dropdown",function(a,g,e,b,f,h,r,l){var n=a.$;e=f.getState("popoverState");var d=f.getState("atwl"),A=d.wireDeclaratives,q=function(){var b=n("#"+d.wishlistButtonId),f=n("#"+d.wishlistButtonSubmitId);if(d.inlineJsFix)a.on("wl-drop-down",function(b){v(b)});else b.addClass("a-declarative"),b.attr("data-action","atwl-splitbutton-arrow");f.addClass("a-declarative");
f.attr("data-action","atwl-splitbutton-main");n("#wishListMainButton").addClass("a-declarative").attr("data-action","add-wishlist-declarative");m.atwlEc&&setTimeout(function(){b.click();n("#atwl-dd-spinner-holder").addClass("a-hidden");m.atwlEc=!1},1);m.atwlLoaded=!0};a.on("a:pageUpdate",function(){n("#wishListMainButton").hasClass("a-declarative")||(q(),a.trigger("atwl-trigger-onload-bindings"))});var z=function(){var b;b=m.atwlEc?"lists:dp:ech:early":"lists:dp:ech:late";var a=m.ue;a&&a.count(b,
(a.count(b)||0)+1)},v=function(a){a.$event&&a.$event.originalEvent&&a.$event.originalEvent.acknowledge&&a.$event.originalEvent.acknowledge(a.$currentTarget.get(0));"function"===typeof m.uet&&m.uet("bb","addToListDropdown",{wb:1});z();f.setAtwlState({activePopoverButtonId:"add-to-wishlist-button-group"});a.$event?a.$event.preventDefault():a.preventDefault();setTimeout(function(){b.makeDropDownArrowInactive()},0);if("not-allowed"===(a.$target?a.$target:n(a.target)).css("cursor"))return!1;if(b.hideError())return b.showUnavail(),
!1;if((a=b.getDropDownHtml())&&a.length)b.showDropDown();else{b.showSpinner();a=f.getState("wishlistDPState");var h="website.wishlist.detail.add";"undefined"!==typeof a.vendorId&&(h=a.vendorId);a={sortMethod:d.sortMethod||0,type:"wishlist",useAll:d.showAllTypes||0,sourceVendorId:h};h=d.hzPopover?"/hz/wishlist/addtolist":"/gp/registry/atwl/popover.html";h+="?"+n.param(a);n.ajax({url:h,cache:!1,success:b.parseAjaxResponse,error:b.showError})}return!1};if(e.showWishListDropDown||e.isAddToWishListDropDownAuiEnabled||
e.showPopover)q(),f.setAtwlState({resetDropDownHtml:b.resetDropDownHtml}),A||(a.declarative("atwl-splitbutton-arrow","click",v),a.declarative("atwl-dd","click",function(a){a.$event.preventDefault();a=a.data;b.setInputRegistryId(a.id,a.type);return!1}),a.declarative("atwl-dd-dl","click",function(d){d.$event.preventDefault();b.hideDropdown();h.showSpinner();var e=f.getAsin(),g=f.getSid(),e=n.extend({},{asin:e,sid:g},d.data),g=[];l.addCsrfToken(g);a.post("/hz/wishlist/ajax/additem?ref\x3didea_dp_ai",
{params:e,headers:g,success:function(a){a.registryName=d.data.listName;h.addItemResponseHandler(a)},error:h.showError,abort:h.showError});return!1}),a.declarative("atwl-dd-cl","click",function(d){d.$event.preventDefault();b.hideDropdown();h.showSpinner();var e=f.getAsin(),g=f.getSid();d={asin:e,sid:g,listId:d.data.id,listType:d.data.type};e=[];l.addCsrfToken(e);a.post("/hz/wishlist/addasin?ref\x3dsmi_cl_dp_add",{params:d,headers:e,success:function(a){h.addItemResponseHandlerHZCharityList(a)},error:h.showError,
abort:h.showError});return!1}),a.declarative("atwl-kbp-landing","click",function(a){a=a.data;var b=f.getAsin();m.open(a.url+("\x26asin\x3d"+b));return!1})),d&&"kbp"===d.sortMethod&&(a.state("atwl",{kbpPromo:{mouseOver:!1,countDown:!1}}),a.ajax("/gp/toys/birthday/atwl-dpx.html",{method:"get",cache:!1,params:{isAUI:1},success:r.showKbpPromoPopover,error:function(){}}),A||(a.declarative("atwl-kbp-promo-mouseover","mouseleave",function(){var b=f.getState("atwl").kbpPromo;b.mouseOver=!1;if(b.countDown){var d=
g.get("kbpPromoPopover");d&&(d.unlock().hide(),g.remove(d))}a.state("atwl",{kbpPromo:b})}),a.declarative("atwl-kbp-promo-mouseover","mouseenter",function(){var b=f.getState("atwl").kbpPromo;b.mouseOver=!0;a.state("atwl",{kbpPromo:b})}),a.on("a:popover:hide:kbpPromoPopover",function(){var a=g.get("kbpPromoPopover");a.unlock().hide();g.remove(a)}))),f.setAtwlState({wireDeclaratives:!0})});"use strict";(function(){var a=!1;p.when("cf").execute(function(){a||(a=!0,g())});p.when("atwl-cf").execute(function(){a||
(a=!0,g())});var g=function(){p.now("cf-or-atwl-cf").execute(function(a){"undefined"===typeof a&&m.P.register("cf-or-atwl-cf")})}})();p.when("A","cf-or-atwl-cf").register("atwl-common-util",function(a){var g=a.$,e=function(){return"#"+(b("popoverState").formId||"addToCart")+",#addToWL"},b=function(b){a.state.parse();return 0===g('script[data-a-state\x3d"{"key":"'+b+'"}"]').length?{}:a.state(b)||JSON.parse(g('script[data-a-state\x3d"{"key":"'+b+'"}"]').text())||{}};return{CONST:{widthStaticPopovers:230,
overflowWidth:10,noOverflowWidth:10,scrollbarWidth:17},getAsin:function(){var a=g(e()).find("#ASIN").val();"undefined"===typeof a&&(a=g(e()).find("[name^\x3d'ASIN'],[name^\x3d'ASIN.0']").val());return a},getSid:function(){var a=g(e()).find("#session-id").val();"undefined"===typeof a&&(a=g(e()).find("[name\x3d'session-id']").val());return a},ie8NoScroll:function(){return 9>parseInt(g.browser.version,10)&&document.body&&document.body.parentElement?!(!document.body.parentElement.scrollLeft&&!document.body.parentElement.scrollTop):
!1},setRegistryID:function(a){var b=g(e());b.find("[name\x3d'sourceCustomerOrgListID'],[name\x3d'colid'],[name\x3d'wlPopCommand']").attr("value",a);b.find("[name\x3d'submit.add-to-registry.wishlist'],[name\x3d'submit.add-to-wishlist']").eq(0).click();return!1},setAtwlState:function(b){a.state("atwl",g.extend(a.state("atwl")||{},b))},getState:b,clearText:function(a){a.value===a.defaultValue&&(a.value="")},forceFormSubmit:function(a){var b=a.attr("name");a=a.parents("form");b=g('\x3cinput type\x3d"hidden" /\x3e').attr("name",
b).val("1");a.append(g(b));a.submit()},clearPopCommandFields:function(){for(var a=["wlPopCommand","sourceCustomerOrgListID"],b=0;b<a.length;b++){var e=g('[name^\x3d"'+a[b]+'"]');e&&e.length&&e.val("")}},atwlFormSelector:e,popCommandSelector:"[name\x3d'sourceCustomerOrgListID'],[name\x3d'colid'],[name\x3d'wlPopCommand']"}});"use strict";p.when("A","a-popover","atwl-common-util").register("kbp",function(a,g,e){var b=a.$,f=e.getState("atwl"),h=b("#"+f.wishlistButtonSubmitId);return{showKbpPromoPopover:function(b){if(b&&
b.promoEnabled){var f=b.html;if(f){var n=g.create(h.parent(),{name:"kbpPromoPopover",content:f,position:"triggerBottom",width:b.width});n.show().lock();a.delay(function(){var b=e.getState("atwl").kbpPromo||{};b.mouseOver?b.countDown=!0:(n.unlock().hide(),g.remove(n));a.state("atwl",{kbpPromo:b})},1E4)}}}}});"use strict";p.when("A","atwl-util","atwl-dropdown-util","atwl-common-util").execute("atwl-huc",function(a,g,e,b){var f=a.$,h=b.getState("popoverState"),r=b.getState("wishlistDPState"),l=b.getState("createInfo")||
{},n="addCreateToWishlist";l.isHorizonte&&(n="reg-create");r=r.eventsBound;(h.showWishListDropDown||h.showBabyRegDropdown||h.isAddToWishListDropDownAuiEnabled||h.showPopover)&&!r&&(a.on("a:popover:show:"+n,function(d){var h=d.popover;d=h.$popover;var n=b.getState("wishlistDPState"),r=n.action;d.addClass("pop-huc-"+r);var v=h.$trigger.closest(".a-button").find("input");d=n.type;v.closest(".a-button-selected").removeClass("a-button-selected");d=g.parsePostData(r,d);n.customizationToken&&(d.customizationToken=
n.customizationToken);var k=d.url,p=d.streaming,u="ajax_"+p,t=new Date;m.ue&&m.uet("tc",u);var x=function(){h.hide();b.forceFormSubmit(v)},D=function(){h.$popover.find("#popover-spinner").addClass("a-hidden");b.clearPopCommandFields()},y=function(){m.ue&&(m.uet("be",u),m.uex("ld",u))},B=function(a,b,d){m.ue&&(m.ues("id",u,a),m.ues("t0",u,b),m.ues("ctb",u,d))};if("create"!==r&&p){var C=b.getState("atwl");a.ajax(d.url,{method:"post",params:d,error:x,success:function(b,d,g){try{var k=g.http;if(2<k.readyState&&
"undefined"!==typeof k.status&&200===k.status&&("undefined"!==typeof k.response||"undefined"!==typeof k.responseText&&"undefined"!==typeof k.responseText)){b=[];"undefined"!==typeof k.response&&null!==k.response?b=k.response.split(",,,"):"undefined"!==typeof k.responseText&&"undefined"!==typeof k.responseText&&null!==k.responseText&&(b=k.responseText.split(",,,"));for(d=0;d<b.length;d++){var v=b[d],l;try{l=a.parseJSON(v)}catch(r){break}0===d&&l&&"skeleton"===l.name?l&&l.html&&(B(l.requestId,new Date,
"1"),l.status&&"no-asins"===l.status?x():(D(),h.$popover.find("#WLHUC_result").html(l.html).removeClass("a-hidden"))):l&&l.name&&l.html&&"pcomp"===l.name?f("#wishListMainButton").hasClass("a-hidden")||(f("#wishListMainButton,#"+C.activePopoverButtonId).addClass("a-hidden"),e.hideDropDown(),f("#wishlistButtonStack").append(l.html)):l&&l.name&&l.html&&"js"!==l.name?(h.$popover.find("#"+l.name).html(l.html),n.customizedPrice&&h.$popover.find("#price-text").text(n.customizedPrice),1===d&&m.ue&&m.uet("cf",
u)):l&&l.html&&h.$popover.find("#WLHUC_result").append(l.html);h.updatePosition()}4===k.readyState&&y()}else"undefined"!==typeof k.status&&200!==k.status&&x()}catch(r){x()}}})}else l.isHorizonte?a.ajax(k,{method:"get",contentType:"text/html",success:function(b){h.$popover.find("#popover-spinner").addClass("a-hidden");h.$popover.find("#WLHUC_result").html(b).removeClass("a-hidden");h.updatePosition()},error:x}):a.ajax(k,{method:"post",params:d,success:function(a){a&&a.html?(B(a.requestId,t,"1"),a.status&&
"no-asins"===a.status?x():(D(),"add"===r?h.$popover.find("#WLHUC_result").html(a.html).removeClass("a-hidden"):(h.$popover.find("#WLNEW_main").html(a.html).removeClass("a-hidden"),(a=b.getState("atwl"))&&a.resetDropDownHtml&&a.resetDropDownHtml()),h.updatePosition()),y()):("create"===r&&b.forceFormSubmit(v),h.hide())},error:x})}),a.on("a:popover:beforeShow:"+n,function(a){a=a.popover;var h=b.getState("wishlistDPState");a.$popover.find("#popover-spinner").css({margin:"10% 40%"});a.$popover.find("#popover-spinner").removeClass("a-hidden");
a.$popover.find(".wlAddCreatePop").html("").addClass("a-hidden");var e=h.action,f=e+"Header";"create"===e&&h.isFirstCreate&&(f="first"+f);a.update({width:h[e+"Width"],header:h[f],height:h[e+"Height"]});a.updatePosition()}),a.on("a:popover:hide:"+n,function(a){f(".a-modal-scroller").css({visibility:"hidden"});b.clearPopCommandFields()}))});"use strict";p.when("A","atwl-common-util","add-to-wish-list:plugin-registry").register("atwl-util",function(a,g,e){var b=a.$,f=function(){return g.getState("atwl").inlineLinkWeblabTreatment};
return{redirectToHUCPage:function(){var a=b("#add-wishlist-declarative").closest(".a-button").find("input");g.forceFormSubmit(a)},parsePostData:function(a,b){var l=g.getState("popoverState"),l=document.getElementById(l.formId||"addToCart");if("undefined"===typeof l||null===l)l=document.getElementById("addToWL");var n=[];if("undefined"!==typeof l&&null!==l){var d=[],m=!1,n=l.elements;n||(n=l.querySelectorAll("input"),m=!0);for(var q=0;q<n.length;q++){var p;if(!(p=m)){p=n[q];var v=/^(?:checkbox|radio)$/i,
k=/^(?:submit|button|image|reset|file)$/i,w=/^(?:input|select|textarea|keygen)/i;if(p){var u=p.type;p=p.name&&!p.disabled&&w.test(p.nodeName)&&!k.test(u)&&(p.checked||!v.test(u))}else p=!1}p&&d.push(n[q])}n=d}d={};m=g.getState("wishlistDPState");"undefined"!==typeof m.asin&&null!==m.asin&&(d.asin=m.asin);for(q=0;q<n.length;q++)"submit"!==n[q].type&&(d[n[q].name]=n[q].value);d.requestedQty=d.quantity=null!==l&&"undefined"!==typeof l.quantity?l.quantity.value:1;d.sid="undefined"!==typeof d["session-id"]?
d["session-id"]:m.sid;d.cache=!1;d.url=m[a+"Url"];d.action=a;d.type=d.registryType||"wishlist";l=f();typeof l!==t&&(d.inlineLinkWeblabTreatment=l);"add"===a?(d.type=d.registryType||b,d.caller="aui",d.streaming=m.streaming,d.sourceVendorId="undefined"!==typeof m.vendorId?m.vendorId:"website.wishlist.detail.add"):"create"===a&&(d.create_sid=d.sid,d.create_type=d.registryType||b,d.create_nextAction="add",d.create_includeEmptyList=1,d.create_isFirst=m.isFirstCreate?1:0,d.caller="aui",d.create_sourceVendorId=
"undefined"!==typeof m.vendorId?m.vendorId:"website.wishlist.detail.add");(a=e.getPlugin())&&a.filterFormData&&a.filterFormData(d);return d},parseButtonType:function(a){a=a.attr("name");var b=a.split("."),e=new RegExp("submit"+String.fromCharCode(92)+".add-to-registry"+String.fromCharCode(92)+"."),f=new RegExp("submit"+String.fromCharCode(92)+".add-to-");return e.test(a)?b[2]:f.test(a)?b[1].split("-")[2]:""},hideAddToListButtonStack:function(){b("#add-to-wishlist-button-group").hasClass("a-hidden")||
b("#add-to-wishlist-button-group").addClass("a-hidden")},showAddToListButtonStack:function(){b("#add-to-wishlist-button-group").hasClass("a-hidden")&&b("#add-to-wishlist-button-group").removeClass("a-hidden")},getInlineWeblabTreatment:f}});"use strict";p.when("A","atwl-util","atwl-dropdown-util","cf").register("atwl-inline-util",function(a,g,e){var b=a.$,f=function(){b("#atwl-inline-spinner").addClass("a-hidden")},h=function(){g.hideAddToListButtonStack();b("#atwl-inline-spinner").removeClass("a-hidden")},
m=function(){f();b("#atwl-inline").addClass("a-hidden");g.showAddToListButtonStack();e.makeDropDownArrowInactive();b("#atwl-inline-error").removeClass("a-hidden")},l=function(a){b("#atwl-inline-error-msg").empty();b("#atwl-inline-error-msg").html(a)},n=function(a,d){var e="wl_inline_title",f="/gp/registry/wishlist/";d&&"giftlist"===d?f="/gp/registry/giftlist/":d&&"discoverlist"===d&&(f="/idea/",e="idea_dp_inline");f+=a+"/ref\x3d"+e;b("#atwl-inline-link").attr("href",f)},d=function(a){b("#atwl-inline-link-text").empty();
b("#atwl-inline-link-text").text(a)},p=function(){f();b("#atwl-inline-error").addClass("a-hidden");b("#atwl-inline").removeClass("a-hidden")},q=function(a){a&&a.message&&l(a.message);m();b(".reg-create-form").closest(".a-popover").find(".a-button-close").click()},z=function(a){h();b(".reg-create-form").closest(".a-popover").find(".a-button-close").click();d(a.listName)};return{showSpinner:h,showError:m,showErrorClosePopover:q,parseParams:function(a,b){a=g.parsePostData(a,b);b=a.ASIN||a["ASIN.0"];
var d=a["session-id"],e=a.sourceVendorId,f=a.type||"wishlist",h;h="create"===a.action?"newsl":a.wlPopCommand?a.wlPopCommand.split("_")[1]:a.sourceCustomerOrgListID?a.sourceCustomerOrgListID.split("_")[1]:"default";a={asin:b,sid:d,sourceVendorId:e,type:f,registryID:h,pcomp:0,action:a.action};b=g.getInlineWeblabTreatment();typeof b!==t&&(a.inlineLinkWeblabTreatment=b);return a},addItemResponseHandler:function(a){try{typeof a!==t?1===a.isValid||!0===a.updateSuccessful?(n(a.registryID,a.registryType),
d(a.registryName),p()):typeof a.message!==t&&(l(a.message),m()):m()}catch(b){m()}},addItemResponseHandlerHZ:function(a){try{typeof a!==t&&!1===a.hasError?(z(a),n(a.listExternalId,a.listType),p()):m()}catch(b){m()}},addItemResponseHandlerHZIdeaList:function(a){try{typeof a!==t&&a.updateSuccessful?(z(a),n(a.listId,"discoverlist"),p()):q(a)}catch(b){q(a)}},addItemResponseHandlerHZCharityList:function(a){try{if(typeof a!==t&&!1===a.hasError){z(a);var d="/hz/charitylist/ls/"+a.listExternalId+"/ref\x3dsmi_cl_dp_lcl_cl";
b("#atwl-inline-link").attr("href",d);p()}else a&&a.message&&l(a.message),m()}catch(e){m()}}}});"use strict";p.register("add-to-wish-list:plugin-registry",function(){var a=null;return{registerPlugin:function(g){if(null!==a)throw Error("Only a single plugin can be registered.");a=g},getPlugin:function(){return a}}});"use strict";p.when("A","legacy-create-utils","atwl-inline-util").execute(function(a,g,e){var b=a.$;a.state.parse();if((a.state("createInfo")||{}).isHorizonte){var f=function(){b("#WLNEW_error").removeClass("a-hidden")},
h=function(a){try{if(typeof a!==t&&!1===a.hasError){b("#WLNEW_loading").addClass("a-hidden");var e=b(".reg-create-form");e.addClass("a-hidden");a.htmlMessage?e.parent().append(a.htmlMessage):f()}else f()}catch(h){f()}};a.declarative("reg-create-submit",["click"],function(a){g.submitCreate(a,h,f,e.addItemResponseHandlerHZIdeaList,e.showErrorClosePopover)})}});"use strict";p.when("A","jQuery").execute(function(a,g){a.declarative("remaining-customizations-action","click",function(a){var b=a.$currentTarget.parent().find(".remaining_customization_info");
b.show();b.removeClass("aok-hidden");a.$currentTarget.hide();a.$event.preventDefault()})});"use strict";p.when("A","create-utils").execute(function(a,g){var e=a.$,b=function(a){e("#create-list-loading").addClass("aok-hidden");e("#create-list-error").removeClass("aok-hidden");a.message?e("#create-list-error").html(a.message):m.ueLogError&&m.ueLogError({message:"Redesigned Create List failed.",logLevel:"FATAL"})},f=function(a){a&&!a.hasError?a.htmlMessage?(e("#create-list-loading").addClass("aok-hidden"),
e("#create-list-form").parent().append(a.htmlMessage)):b():b()};a.declarative("create-list-submit",["click"],function(a){g.submitCreate(a,f,b)})})});
/* ******** */
(function(l){var e=window.AmazonUIPageJS||window.P,r=e._namespace||e.attributeErrors,c=r?r("GenericRegistryDPXAssets",""):e;c.guardFatal?c.guardFatal(l)(c,window):c.execute(function(){l(c,window)})})(function(l,e,r){"use strict";l.when("A","a-modal").register("add-to-br-util",function(c,l){function q(d){var n=encodeURIComponent(f("#ASIN").val());d=encodeURIComponent(d.sessionId);var p={};p.asin=n;p.sid=d;c.post("/baby-reg/button-action/atbr-dpx/ref\x3ddpx_atbr_dsk",{params:p,timeout:5E3,success:function(c){e.location.href=
c!==r&&"failure"!==c.result?"/baby-reg/huc/ref\x3ddpx_atbr_dsk_huc?asin\x3d"+n+"\x26dup\x3d"+("duplicate"===c.result?!0:!1):"/baby-reg/ref\x3ddpx_atbr_dsk_hp?asin\x3d"+n},error:function(){e.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_er?asin\x3d"+n}})}var f=c.$;c.state("atbrState");c.declarative("dpx-add-to-baby-registry-action",["click"],function(d){c.state.parse();d=c.state("atbrState");var n=d.hasBabyReg||!1,p="true"===f("#is-fully-selected-baby-reg").val()||!1,g=encodeURIComponent(f("#ASIN").val());
g!==r&&p&&(p=encodeURIComponent(d.sessionId),n?q(d):e.location.href="/baby-reg/signup/ref\x3ddp_create_br_desktop?asin\x3d"+g+"\x26sessionId\x3d"+p)})});"use strict";l.when("A","a-button","a-modal","ready").register("dpx-modal-add-to-wr-declarative-actions",function(c,l,q){var f=c.$,d=c.state("modal-add-to-wedding-registry-status");if(d&&d.weddingButtonId&&f("#"+d.weddingButtonId).length){var n={name:"wr-modal-add-to-reg-wedding-registry",header:d.modalHeader,url:""};f(document).delegate("#"+d.weddingButtonId,
"click",function(c){c.preventDefault();if(d.userSignedIn){var g=f("#quantity").val();g||(g=1);c=q.create(f("#"+d.weddingButtonId),n);var m=encodeURIComponent(f("#ASIN").val()),g=encodeURIComponent(g);d.hasWeddingRegistry?(c.update({cache:!1,url:"/wedding/modal/external-add-to-registry?asin\x3d"+m+"\x26quantity\x3d"+g+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop"}).show(),"undefined"!==typeof e.ue&&e.ue.count("wrAddToRegModalPopup",(e.ue.count("wrAddToRegModalPopup")||0)+1)):e.location.href="/wedding/new-registry?asin."+
m+"\x3d"+g+"\x26vendorId\x3dgr-dpx-new-reg\x26associateId\x3d\x26associateSubId\x3d"}else e.location.href="/wedding/nosignin"});c.declarative("wr-modal-add-to-reg-rec-add-to-registry-action","click",function(d){var g=d.data;d=f("#wr-modal-add-to-reg-wrapper").data("token");var m=l("#wr-modal-add-to-reg-add-to-wr-"+g.recItemAsin);m.isEnabled()&&(m.disable(),!0===f("#wr-modal-add-to-reg-rec-product-card-"+g.recItemAsin).data("exist-in-registry")?(m.hide(),f("#wr-modal-add-to-reg-item-exist-message-"+
g.recItemAsin).removeClass("aok-hidden")):(d={items:JSON.stringify([{asin:g.recItemAsin,requestedQuantity:1}]),token:d},c.post("/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa",{params:d,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(c){m.hide();c.success?f("#wr-modal-add-to-reg-item-added-message-"+g.recItemAsin).removeClass("aok-hidden"):"ITEM_ALREADY_EXIST"===c.errorCode?f("#wr-modal-add-to-reg-item-exist-message-"+g.recItemAsin).removeClass("aok-hidden"):
f("#wr-modal-add-to-reg-item-added-error-"+g.recItemAsin).removeClass("aok-hidden")},error:function(){f("#wr-modal-add-to-reg-item-added-error-"+g.recItemAsin).removeClass("aok-hidden");"undefined"!==typeof e.ue&&e.ue.count("wrAddToRegModalAddFromSimilaritiesError",(e.ue.count("wrAddToRegModalAddFromSimilaritiesError")||0)+1)}})),"undefined"!==typeof e.ue&&e.ue.count("wrAddToRegModalAddFromSimilarities",(e.ue.count("wrAddToRegModalAddFromSimilarities")||0)+1))});c.on("a:popover:beforeHide:wr-modal-add-to-reg-wedding-registry",
function(){"undefined"!==typeof e.ue&&e.ue.count("wrAddToRegModalDismissed",(e.ue.count("wrAddToRegModalDismissed")||0)+1)});c.declarative("wr-modal-add-to-reg-view-registry-action","click",function(c){"undefined"!==typeof e.ue&&e.ue.count("wrAddToRegModalViewRegistry",(e.ue.count("wrAddToRegModalViewRegistry")||0)+1);e.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";l.when("A","a-button","a-modal","a-dropdown","a-splitdropdown","ready").register("ggr-add-to-registry-desktop-util",
function(c,l,q,f,d){function n(a){var b=h(k.registryItemTemplate).html(),b=b.replace("{img-tag}",'\x3cimg alt\x3d"{registryName}" src\x3d"{imageUrl}" class\x3d"atwl-hz-dd-image"\x3e'),c={registryType:a.typeText,registryName:a.name,imageUrl:a.imageUrl};return b.replace(/\{([\w]*)\}/g,function(b,e){b=c[e];if("undefined"!==typeof b&&null!==b)a=b;else return"";return a})}function p(){var a=[],b=c.state("modal-add-to-registry-dropdown-state");h.each(b.registryList,function(b,c){a.push(c.registryType)});
b={dataType:"json",url:"/registries/dpx/desktop/list-registry?"+h.param({alreadyHave:a,defaultType:b.defaultType},!0),cache:!1,success:g,error:m};h.ajax(b)}function g(a){c.state("modal-add-to-registry-dropdown-state");var b;if("object"===typeof a)b=a.result;else try{b=c.parseJSON(a)}catch(e){m();return}h.isArray(b)?(f.getSelect("add-to-registry-button").getOption(0).remove(),h.each(b,function(b,a){f.getSelect("add-to-registry-button").addOption({html_content:n(a),text:w(a.name),value:a.type+":ID\x3d"+
a.id},b)}),f.getSelect("add-to-registry-button").addOption({html_content:h("#gr-create-a-registry-item").html(),text:"Create a Registry",value:"New:ID\x3dDUMMY"},b.length)):m();h(k.spinnerWrapper).addClass("aok-hidden");h("#add-to-registry-button-announce").length?h("#add-to-registry-button-announce")[0].click():h("#add-to-registry-button")[0].click()}function m(){h(k.spinnerWrapper).addClass("aok-hidden");h(k.ajaxError).removeClass("aok-hidden")}function v(a){var b=c.state("modal-add-to-registry-dropdown-state"),
d=h("#quantity").val();d||(d=1);if(-1!==a.value.indexOf(":ID")){var f=a.value.substr(0,a.value.indexOf(":ID"));a=a.value.substr(a.value.indexOf(":ID")+3+1);var g=encodeURIComponent(h("#ASIN").val()),d=encodeURIComponent(d);u(k.metrics.dropdownItemClicked+":"+f.toLowerCase());if("Wedding"===f)if(b.hasWeddingRegistry){var b={name:k.popoverModalName,header:b.weddingModalHeader,url:""},t=q.get(b.name);t||(t=q.create(h("#GR-DROPDOWN-MODAL-TRIGGER"),b));t.update({header:b.header,cache:!1,url:"/wedding/modal/external-add-to-registry?asin\x3d"+
g+"\x26quantity\x3d"+d+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop\x26sourceVendorId\x3damazon.wedding_registry.add.dpx.desktop"}).show()}else e.location.href="/wedding/new-registry?asin."+g+"\x3d"+d+"\x26vendorId\x3damazon.wedding_registry.add.dpx.desktop\x26associateId\x3d\x26associateSubId\x3d";else"Baby"===f?(f=c.state("modal-add-to-registry-dropdown-state"),a=f.hasBabyRegistry||!1,g=encodeURIComponent(h("#ASIN").val()),b=encodeURIComponent(f.sessionId),a?x(f):e.location.href="/baby-reg/signup/ref\x3ddp_create_br_desktop?asin\x3d"+
g+"\x26sourceVendorId\x3damazon.ggr.baby.add.dpx.desktop\x26sessionId\x3d"+b):"New"===f?e.location.href="/registries?ref\x3ddpx_create_registry_desktop\x26sessionId\x3d"+b.sessionId:b.hasGenericGiftRegistries?(b={name:k.popoverModalName,header:{Birthday:b.birthdayModalHeader,Custom:b.customModalHeader}[f],url:""},(t=q.get(b.name))||(t=q.create(h("#GR-DROPDOWN-MODAL-TRIGGER"),b)),t.update({header:b.header,cache:!1,url:"/registries/dpx-add-to-registry/"+f.toLowerCase()+"/"+a+"?asin\x3d"+g+"\x26quantity\x3d"+
d+"\x26ref_\x3dgr_ggr_dpx_mdl_pop\x26sourceid\x3damazon.ggr.add.dpx.desktop"}).show()):e.location.href="/registries/"+f.toLowerCase()+"/create?asin\x3d"+g+"\x26quantity\x3d"+d+"\x26sourceVendorId\x3damazon.ggr.add.dpx.desktop\x26ref_\x3dgr-dpx-"+f.toLowerCase()+"-reg"}}function w(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value}function x(a){var b=encodeURIComponent(h("#ASIN").val());a=encodeURIComponent(a.sessionId);var d={};d.asin=b;d.sid=a;d.sourceVendorId="amazon.ggr.baby.add.dpx.desktop";
c.post("/baby-reg/button-action/atbr-dpx/ref\x3ddpx_atbr_dsk",{params:d,timeout:5E3,success:function(a){e.location.href=a!==r&&"failure"!==a.result?"/baby-reg/huc/ref\x3ddpx_atbr_dsk_huc?asin\x3d"+b+"\x26dup\x3d"+("duplicate"===a.result):"/baby-reg/ref\x3ddpx_atbr_dsk_hp?asin\x3d"+b},error:function(){e.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_er?asin\x3d"+b}})}function u(a){"undefined"!==typeof e.ue&&(a=k.metrics.deviceType+":"+a,e.ue.count(a,(e.ue.count(a)||0)+1))}var h=c.$;if(d=c.state("modal-add-to-registry-dropdown-state")){var k=
{popoverModalName:"wr-modal-add-to-reg-wedding-registry",registryItemTemplate:"#gr-registry-item-template",addToRegistryButton:"#add-to-registry-button",modalAlreadyExist:".gr-already-exist-message",modalAddSuccess:".gr-add-success-message",modalAddError:".gr-add-error-message",ajaxError:"#gr-dd-error-holder",spinnerWrapper:"#gr-spinner-wrapper",metrics:{deviceType:"desktop",dropdownClicked:"dpx-ggr-dropdown-clicked",dropdownItemClicked:"dpx-ggr-dropdown-item-clicked",similarityClicked:"dpx-ggr-dropdown-similarity-clicked"}};
c.declarative("gr-nosignin-button-action","click",function(a){a=encodeURIComponent(e.location.href);e.location.href="/registries/product/nosignin?originURL\x3d"+a});c.on("a:dropdown:"+d.dropdownButtonId+":select",function(a){v(a)});c.on("a:splitdropdown:"+d.dropdownButtonId+":select",function(a){v(a)});h(document).delegate(".gr-modal-add-to-reg-rec-add-to-registry-action","click",function(a){var b=h(a.currentTarget);a=b.attr("data-asin");var d=b.data("type"),e=h("#gr-modal-add-to-reg-wrapper").data("token"),
f=l("#gr-modal-add-to-reg-add-to-wr-"+a);f.isEnabled()&&(f.disable(),!0===b.data("exist")?(f.hide(),b.find(k.modalAlreadyExist).removeClass("aok-hidden")):d&&"Wedding"!==d?(a={asin:a,desiredQuantity:1,registryId:b.data("id"),registryType:b.data("type"),itemType:"AMAZON_ITEM",vendorId:"amazon.ggr.add.dpx.desktop",token:e},c.post("/registries/registry-products/addProduct",{params:a,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(a){f.hide();a.success?b.find(k.modalAddSuccess).removeClass("aok-hidden"):
"ITEM_ALREADY_EXIST"===a.errorCode?b.find(k.modalAlreadyExist).removeClass("aok-hidden"):b.find(k.modalAddError).removeClass("aok-hidden")},error:function(){f.hide();b.find(k.modalAddError).removeClass("aok-hidden")}})):(a={items:JSON.stringify([{asin:a,requestedQuantity:1}]),token:e},c.post("/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa",{params:a,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(a){f.hide();a.success?b.find(k.modalAddSuccess).removeClass("aok-hidden"):
"ITEM_ALREADY_EXIST"===a.errorCode?b.find(k.modalAlreadyExist).removeClass("aok-hidden"):b.find(k.modalAddError).removeClass("aok-hidden")},error:function(){b.find(k.modalAddError).removeClass("aok-hidden")}})),u(k.metrics.similarityClicked))});f.getSelect(k.addToRegistryButton)&&f.getSelect(k.addToRegistryButton).update({status:"normal"});h(k.addToRegistryButton).one("click",function(a){h(k.spinnerWrapper).removeClass("aok-hidden");setTimeout(p,0);u(k.metrics.dropdownClicked);return!1});c.declarative("gr-modal-add-to-reg-view-registry-action",
"click",function(a){e.location.href=a.data&&a.data.type&&a.data.id?"/registries/"+a.data.type.toLowerCase()+"/owner-view?registryId\x3d"+a.data.id+"\x26ref_\x3dhit_gr_from_dpx":"/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}})});
/* ******** */
(function(g){var c=window.AmazonUIPageJS||window.P,m=c._namespace||c.attributeErrors,a=m?m("SoftlinesPWAssets",""):c;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,c,m){g.when("A","pw-metric-utils","softlines-common-utils","afterLoad","a-state").register("PWAddressValidator",function(a,f,d){var b;f.addCSMTag("pwAddressValidatorJSLoaded");f=function(){function e(){b=a.state("pwState")?a.state("pwState"):{}}function f(){b.hasOwnProperty("isTryState")&&(c.isTryState=
b.isTryState);b.hasOwnProperty("isPWEnabled")&&(c.isPWEnabled=b.isPWEnabled);var e=a.state("unifiedLocation")?a.state("unifiedLocation"):{},e=e.hasOwnProperty("urlParams")?e.urlParams:{},e=d.extendAndOverride(e,c);a.state("unifiedLocation",{urlParams:e})}var c={isTryState:!1,isPWExperienceEnabled:!0,isLocUXPageRefresh:!0,isPWEnabled:!1};e();f();a.state.bind("pwState",function(b,a){if(a.isTryState||a.isPWEnabled)e(),f()})};b=a.state("pwState")?a.state("pwState"):{};b.hasOwnProperty("isPWExperienceEnabled")&&
b.isPWExperienceEnabled&&f()});"use strict";g.when("A","pw-metric-utils","pw-common-utils").execute(function(a,f,d){var b=a.$;f.addCSMTag("pwBuyBoxJSLoaded");var e=function(){var a,e=b("#pwController_feature_div");d.isNotEmpty(e)&&(e=e.find("script"),d.isNotEmpty(e)&&(e=e.html())&&(a=b.parseJSON(e)));return a},k=function(a){var f=e();f&&(f=b.extend(f,a),(a=d.toString(f))&&b("#pwController_feature_div").find("script").html(a))},l=function(){a.state("pwState",{isTryState:!0,isPWChildState:!0});k({isTryState:!0})},
h=function(){b("#pwBuyBoxAccordionRow").hasClass("a-accordion-active")&&l()};h();d.registerTrySelectHandler(function(){l();f.addCount("pwSwitchToPWBuyBoxBCounter")});d.registerBuySelectHandler(function(){h();d.isPwBuyBoxVisible()&&(a.state("pwState",{isTryState:!1,isPWChildState:!0}),k({isTryState:!1}),f.addCount("pwSwitchToRetailBuyBoxCounter"))});g.when("a-modal","ready","a-state").execute(function(n){var g=function(){b(document).undelegate("#pw-add-to-cart-button","click.pwBuyboxAtc");b(document).delegate("#pw-add-to-cart-button",
"click.pwBuyboxAtc",function(){var a=n.get(b("#watchWarrantyModalPwAtc")),d=e();if(!a||a.isVisible())c.ue&&c.ue.log("LEWIS_ADD_TO_CART","PW_DUMMY_CSM_CHANNEL"),d.isAddressPWEligible?b("#pwAddToCart").submit():(b("#pw-unable-to-ship-message").removeClass("aok-hidden"),b("#pw-eligible-cities-popover").removeClass("aok-hidden"))})},h=function(){a.on("a:pageUpdate",function(){var c=e();c&&(c.isPWChildState=d.isPwBuyBoxVisible(),a.state("pwState",c),c.isPWChildState&&(b("#pw-unable-to-ship-message").addClass("aok-hidden"),
b("#pw-eligible-cities-popover").addClass("aok-hidden"),f.addCSMTagForPWFeature(c,"Ajax"),g()))})},k=a.state("pwState")?a.state("pwState"):{};k.hasOwnProperty("isPWExperienceEnabled")&&k.isPWExperienceEnabled&&(h(),g())})});g.declare("PWConfig",{buyBox:{auiEvents:{tryRowSelectEvent:"a:accordion:pwBuyBoxAccordion:tryAccordionRow:select",buyRowSelectEvent:"a:accordion:pwBuyBoxAccordion:buyAccordionRow:select",pwRowSelectEvent:"a:accordion:buybox-accordion:pwBuyBoxAccordionRow:select",newRowSelectEvent:"a:accordion:buybox-accordion:newAccordionRow:select",
pwInlineTwisterToggleOnEvent:"a:switch:inlineTwisterPrimeWardrobeToggle:on",pwInlineTwisterToggleOffEvent:"a:switch:inlineTwisterPrimeWardrobeToggle:off",pwRowSoftlinesSelectEvent:"a:accordion:buybox-accordion:pwBuyBoxAccordionRow_softlines:select",newRowSoftlinesSelectEvent:"a:accordion:buybox-accordion:newAccordionRow_softlines:select"},tryAccordionRowID:"#tryAccordionRow",pwAccordionRowID:"#pwBuyBoxAccordionRow",pwSoftlinesAccordionRowID:"#pwBuyBoxAccordionRow_softlines"}});g.declare("ScopingPWConfig",
{nodeId:"14807110011"});"use strict";g.when("A","pw-metric-utils").execute(function(a,c){var d=a.$;c.addCSMTag("pwFeatureToggleJSLoaded");a.state.bind("pwState",function(b,a){(a.isTryState||a.isPWEnabled)&&b.isPWChildState&&(b.isTryState&&b.isPWEnabled?(b=d(".pw-try-feature"),a=d(".pw-buy-feature")):(b=d(".pw-buy-feature"),a=d(".pw-try-feature")),0<b.length&&b.removeClass("pw-hidden"),0<a.length&&a.addClass("pw-hidden"))})});"use strict";g.when("A","pw-metric-utils","pw-common-utils","afterLoad").execute(function(a,
c,d){function b(b){var a=d.isPwBuyBoxVisible();b=!b.isTryState&&b.isPWEnabled&&a;!l&&b&&(b=k("#pwOnboardingHintPopoverTriggerId"))&&b.click()}function e(){return k(".pwOnboardingHintContent").parents(".a-popover-wrapper")}var k=a.$,l=!1,h;c.addCSMTag("pwOnBoardingHintJSLoaded");g.when("ready","a-state").execute(function(){var d=a.state("pwState")?a.state("pwState"):{},c=a.state("pwOnboardingHintState")?a.state("pwOnboardingHintState"):{};c.hasOwnProperty("deviceType")&&d.hasOwnProperty("isTryState")&&
d.hasOwnProperty("isPWEnabled")&&(h=c.deviceType,b(d))});a.state.bind("pwState",function(a){k(".a-popover:visible").length||a.isTryState||!a.isPWChildState||b(a)});a.on("a:popover:dismiss:pwOnboardingHint",function(b){l=!0;h||(a.state.parse(),h=(a.state("pwOnboardingHintState")||{}).deviceType||null);d.isNotEmpty(h)&&a.ajax("/gp/product/ajax-handlers/pw-onboarding-hint-shown.html?ie\x3dUTF8\x26",{method:"post",params:{deviceType:h}})});a.on("a:popover:beforeShow:pwOnboardingHint",function(b){(b=e())&&
b.addClass("pwOnboardingHintPopoverWrapper")});a.on("a:popover:afterShow:pwOnboardingHint",function(b){(b=e())&&(b=b.children(".a-popover-inner"))&&b.addClass("pwOnboardingHintPopoverInner")})});"use strict";g.when("A","PWConfig").register("pw-common-utils",function(a,c){var d=function(){};d.prototype.isNotEmpty=function(b){return b&&b.length};d.prototype.isPwBuyBoxVisible=function(){var b=c.buyBox;return this.isBuyboxRowVisible(b.tryAccordionRowID)||this.isBuyboxRowVisible(b.pwAccordionRowID)||this.isBuyboxRowVisible(b.pwSoftlinesAccordionRowID)};
d.prototype.isBuyboxRowVisible=function(b){b=a.$(b);return this.isNotEmpty(b)};d.prototype.registerTrySelectHandler=function(b){a.on(c.buyBox.auiEvents.tryRowSelectEvent,b);a.on(c.buyBox.auiEvents.pwRowSelectEvent,b);a.on(c.buyBox.auiEvents.pwRowSoftlinesSelectEvent,b);a.on(c.buyBox.auiEvents.pwInlineTwisterToggleOnEvent,b)};d.prototype.registerBuySelectHandler=function(b){a.on(c.buyBox.auiEvents.buyRowSelectEvent,b);a.on(c.buyBox.auiEvents.newRowSelectEvent,b);a.on(c.buyBox.auiEvents.newRowSoftlinesSelectEvent,
b);a.on(c.buyBox.auiEvents.pwInlineTwisterToggleOffEvent,b)};d.prototype.toString=function(b){var d=b;if("object"===typeof b){var c="",d="";a.each(b,function(b,a){d+=c+'"'+a+'":'+b;c=","});d&&(d="{"+d+"}")}return d};return new d});"use strict";g.when("A").register("pw-metric-utils",function(a){function f(a,b){if(c.ue&&c.ue.tag)if(a.hasOwnProperty("isPWExperienceEnabled")&&a.isPWExperienceEnabled){var e=a.hasOwnProperty("isPWEnabled")&&a.isPWEnabled;a=a.hasOwnProperty("isTryState")&&a.isTryState;c.ue.tag("isPWExperienceEnabled"+
b);e?c.ue.tag("isPWEnabled"+b):c.ue.tag("isNotPWEnabled"+b);a?c.ue.tag("isTryState"+b):c.ue.tag("isNotTryState"+b)}else c.ue.tag("isNotPWExperienceEnabled"+b)}g.when("ready","a-state").execute(function(){var d=a.state("pwState")?a.state("pwState"):{};f(d,"")});return{addCSMTagForPWFeature:f,addCSMTag:function(a){c.ue&&c.ue.tag&&c.ue.tag(a)},addCount:function(a){c.ue&&c.ue.count&&c.ue.count(a,c.ue.count(a)||1)}}});"use strict";g.when("A").register("try-state-param-util",function(){function a(){return c.location.search.replace(/(^\?)/,
"").split("\x26").reduce(function(a,b){b=b.split("\x3d");b[0]&&(a[b[0]]=b[1]);return a},{})}function f(a){if(!a)return"";var b=Object.keys(a).map(function(b){return b+"\x3d"+a[b]});return b?b.join("\x26"):""}return{isTryStateEnabled:function(){var c=a();return c&&"1"===c.isTryState},isTryStateDisabled:function(){var c=a();return c&&"0"===c.isTryState},setTryState:function(d){var b=a();b.isTryState=d?"1":"0";c.history.replaceState(c.history.state,document.title,c.location.pathname+"?"+f(b))}}});"use strict"});
/* ******** */
(function(h){var g=window.AmazonUIPageJS||window.P,r=g._namespace||g.attributeErrors,b=r?r("SoftlinesFeaturesAssets",""):g;b.guardFatal?b.guardFatal(h)(b,window):b.execute(function(){h(b,window)})})(function(h,g,r){h.when("jQuery","A","load").execute(function(b,c){var a=g.ue,n=function(b){a&&a.count&&a.count(b,(a.count(b)||0)+1)},f=function(a){return"undefined"===typeof a||null===a||""===a},d=function(a,b){var c=a.attr("href");if(!f(c)){var d;-1!==c.indexOf("#")&&(d=c.split("#"),c=d[0],d=d[1]);c+=
-1===c.indexOf("?")?"?":"\x26";c=c+"dpPl\x3d1\x26dpID\x3d"+b;f(d)||(c=c+"#"+d);a.attr("href",c);a.attr("data-isDpImgCached",1)}},u=function(a){if(!f(a)){var b=/[^\/]+$/,c;f(a)||(a=a.match(b))&&(c=a[0]);return c.split(".")[0]}};try{(function(){b(".dpLanImgCacheUrl").each(function(){var a=b(this),c=a.attr("data-isDpImgCached");if(f(c)){var c=a.attr("data-dpLanImgCachedUrl"),m=u(c);try{var h=new Image;h.src=c;b.isFunction(d)&&b(h).load(function(){d(a,m);n("dpCacheHit")})}catch(g){n("dpCacheEx")}}})})()}catch(k){n("dpPlEx")}});
"use strict";h.when("jQuery","ueCount","ImageBlockATF","atf").execute(function(b,c,a){if(a.isEnhancedImageBlockSize&&!0===a.isEnhancedImageBlockSize){a=function(){var a=b(g).height(),f=b("#landingImage"),d,h=0;if(f){if(d=f.offset())h=d.top;(f=h+f.height())&&a&&f>a&&c.incrementCounterByOne("sl_main_img_btf")}};try{(function(){var a=b(g).width();a&&(1366>=a?c.incrementCounterByOne("sl_vp_dim_1"):1367<=a&&1649>=a?c.incrementCounterByOne("sl_vp_dim_2"):1650<=a&&1859>=a?c.incrementCounterByOne("sl_vp_dim_3"):
c.incrementCounterByOne("sl_vp_dim_4"))})()}catch(n){c.incrementCounterByOne("err_sl_vp_dim")}try{a()}catch(n){c.incrementCounterByOne("err_sl_main_img_btf")}}});"use strict";h.when("atf").register("ueCount",function(){var b=g.ue;return{incrementCounterByOne:function(c){b&&b.count&&b.count(c,(b.count(c)||0)+1)},logCounter:function(c,a){b&&b.count&&b.count(c,a)}}});"use strict";h.when("jQuery").register("softlines-common-utils",function(b){var c=function(){};c.prototype.isNotNull=function(a){return"undefined"!==
b.type(a)&&"null"!==b.type(a)};c.prototype.isString=function(a){return this.isNotNull(a)&&"string"===b.type(a)};c.prototype.isStringNotEmpty=function(a){return this.isString(a)&&0<a.length};c.prototype.equalsIgnoreCase=function(a,b){var c=!1;this.isString(a)&&this.isString(b)&&a.toUpperCase()===b.toUpperCase()&&(c=!0);return c};c.prototype.getDeviceType=function(a){return this.getDataAttribute(a,"device-type")};c.prototype.getRegexOutput=function(a,b){var c,d=/^[A-Z0-9]*$/;this.isStringNotEmpty(a)&&
(a=a.match(b))&&a.forEach(function(a){a&&d.test(a)&&(c=a)});return c};c.prototype.getUrlParameterByName=function(a){return(a=(new RegExp("[?\x26]"+a+"\x3d([^$#\x26]*)|\x26|#|$")).exec(g.location.href))?a[1]?decodeURIComponent(a[1]):"":null};c.prototype.getCurrentAsin=function(){return this.getRegexOutput(g.location.href,/\/dp\/([^\/?]*)|\/gp\/product\/([^\/?]*)|\/gp\/aw\/d\/([^\/?]*)/)};c.prototype.getDataAttribute=function(a,c){var f=null;this.isStringNotEmpty(a)&&(a=b(a),this.isNotNull(a)&&0<a.length&&
(f=a.data(c)));return f};c.prototype.isMobileWeb=function(a){a=this.getDeviceType(a);return this.equalsIgnoreCase(a,"mobileWeb")?!0:!1};c.prototype.isMobileApp=function(a){a=this.getDeviceType(a);return this.equalsIgnoreCase(a,"mobileApp")?!0:!1};c.prototype.isPCOrTabletWeb=function(a){a=this.getDeviceType(a);return this.equalsIgnoreCase(a,"pcOrTabletWeb")?!0:!1};c.prototype.isTabletApp=function(a){a=this.getDeviceType(a);return this.equalsIgnoreCase(a,"tabletApp")?!0:!1};c.prototype.checkWeblabTreatment=
function(a,b,c){return this.getDataAttribute(a,b)===c};c.prototype.animationScroll=function(a,c){0===b(g).scrollTop()&&0!==a&&b("html, body").delay(500).animate({scrollTop:a},c)};c.prototype.isMacOs=function(){var a=!1,b=g.navigator.userAgent;b&&(a=/Mac OS/i.test(b));return a};c.prototype.extendAndOverride=function(a,b){a=a?a:{};if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a};return new c});"use strict";h.when("jQuery","ueCount").execute(function(b,c){b("#softlinesTechnicalSpecificationsLink").bind("click",
function(){c.incrementCounterByOne("sts_link",1)})});"use strict";h.when("jQuery","A").execute(function(b,c){c.on("a:popover:ajaxContentLoaded:g2s2SizeChartView",function(a){function c(a){return m+b.param({asin:p,sizeChartDept:a,deviceType:t})}function f(){var a=b("#sizechart_department_dropdown_native_select").children(":selected").attr("data-deptName"),a=c(a);d(a)}function d(a){b.ajax({url:a,cache:!0,beforeSend:function(){if(l.data(a)!==r)return l.html(l.data(a)),!1;l.addClass(g);return!0},complete:function(){l.removeClass(g)},
success:function(b){l.data(a,b);l.html(b)}})}function h(a){d(a.data.rwAjaxSizeChartUrl)}a=b("#spinnerContainer");var k=b("#sizeChartSpinnerUrl").attr("data-sizechart-spinner-url");a.css("background-image","url("+k+")");a=a.attr("data-showTab");k=b("#sizeChartHeight").attr("data-height");b(".heightG2S2SizeChartPC").css("height",k+"px");if("true"===a){var l=b("#tabContent"),m="/gp/product/ajax-handlers/apparel-sizing-chart.html/ref\x3ddp_sizechart?ie\x3dUTF8\x26isUDP\x3d1\x26",g="loadingSpinnerSizeChart",
p=l.attr("data-asin"),t=l.attr("data-deviceType");a=b("#dataForJs").attr("data-numberOfDepts");if("false"===b("#dataForJs").attr("data-show-department-dropdown"))for(k=0;k<a;k++){var e=b("#dept"+k).attr("data-deptName"),w=b("#dept"+k).attr("data-isActive"),e=c(e);"true"===w&&l.data(e,l.html());b("#dept"+k).click({rwAjaxSizeChartUrl:e},h)}else b("#sizechart_department_dropdown_native_select").change(f),e=b("#sizechart_department_dropdown_native_select").children(":selected").attr("data-deptName"),
e=c(e),l.data(e,l.html())}})});"use strict";h.when("A","imageBlockUtils","ImageBlockATF","ImageBlockBTF","a-modal","warrantyForesterLogging","ready").execute(function(b,c,a,n,f,d){function u(a,b){f.get(e(a)).hide();e("html,body").animate({scrollTop:e("#watchRecommendations").offset().top},"slow");d.foresterLog(b)}function k(a){e(document).delegate("#similarWatchRecommendationsLink","click.interstitial",function(){u(a,"simWatchRecOptClickedWR")});e(document).delegate("#otherWatchOfferLink","click.interstitial",
function(){u(a,"otherWatchOfferOptClickedWR")})}function l(){e(document).undelegate("#pw-add-to-cart-button","click.interstitial");e(document).delegate("#pw-add-to-cart-button","click.interstitial",function(){try{return t(),d.foresterLog("modelShown"+d.warrantyType+d.watchRecommendationsForesterSuffix),f.get(e("#watchWarrantyModalPwAtc")).show(),e(document).undelegate("#warrantyModalBtnPwAtc",q),x(e("#pw-add-to-cart-button"),"PwAtc"),k("#watchWarrantyModalPwAtc"),!1}catch(a){return!0}})}function m(a){e(document).undelegate(".interstitial");
a.click()}function x(a,c){e(document).delegate("#warrantyModalBtn"+c,q,function(){d.foresterLog("clickedContinue"+d.warrantyType+d.watchRecommendationsForesterSuffix);e("#watchWarrantyDoNotShowMessage"+c).is(":checked")?e.ajax(v,{complete:function(){m(a)},timeout:500}):m(a)});e(document).delegate("#warrantyModalCancelBtn"+c,q,function(){e("#watchWarrantyDoNotShowMessage"+c).is(":checked")&&(b.ajax(v,{}),e(document).undelegate(".interstitial"));d.foresterLog("clickedCancel"+d.warrantyType+d.watchRecommendationsForesterSuffix)})}
function p(a){e(document).delegate("#warrantyModalBtnPtc",q,function(){d.foresterLog("clickedContinue"+d.warrantyType+d.watchRecommendationsForesterSuffix);e("#watchWarrantyDoNotShowMessagePtc").is(":checked")?e.ajax(v,{complete:function(){m(a)},timeout:500}):m(a)});e(document).delegate("#warrantyModalCancelBtnPtc",q,function(){e("#watchWarrantyDoNotShowMessagePtc").is(":checked")&&(b.ajax(v,{}),e(document).undelegate(".interstitial"));d.foresterLog("clickedCancel"+d.warrantyType+d.watchRecommendationsForesterSuffix)})}
function t(){var b="";g.isTwisterPage?r&&(b=c.getColorFromState(r.selected_variations),b=n.colorImages[b][0].large):b=a.colorImages.initial[0].large;e("[id \x3d interstitialImage]").attr("src",b)}var e=b.$,w=b.state("watch-warranty-params");if(w&&w.showInterstitial){e(document).undelegate(".interstitial");var v="/gp/product/ajax-handlers/watch-warranty-sembu-setter.html?timeStamp\x3d"+(new Date).getTime()+"\x26WRSuffix\x3d"+d.watchRecommendationsForesterSuffix,q=navigator.userAgent.match(/ipad/i)?
"touchstart.interstitial":"click.interstitial",r;g.isTwisterPage&&h.when("twisterModule").execute(function(a){r=a.getState()});l();b.on("a:pageUpdate",function(){l()});e(document).delegate("#add-to-cart-button","click.interstitial",function(){try{return t(),d.foresterLog("modelShown"+d.warrantyType+d.watchRecommendationsForesterSuffix),f.get(e("#watchWarrantyModalAtc")).show(),x(e("#add-to-cart-button"),"Atc"),k("#watchWarrantyModalAtc"),!1}catch(a){return!0}});e(document).delegate("#one-click-button",
"click.interstitial",function(){try{t();d.foresterLog("modelShown"+d.warrantyType+d.watchRecommendationsForesterSuffix);f.get(e("#watchWarrantyModalPtc")).show();var a=e("#one-click-button");p(a);k("#watchWarrantyModalPtc");return!1}catch(b){return!0}});e(document).delegate("#oneClickBuyButton","click.interstitial",function(){try{t();d.foresterLog("modelShown"+d.warrantyType+d.watchRecommendationsForesterSuffix);f.get(e("#watchWarrantyModalPtc")).show();var a=e("#oneClickBuyButton");p(a);k("#watchWarrantyModalPtc");
return!1}catch(b){return!0}});e("#warrantyPdfInModal").click(function(){d.foresterLog("clicked"+d.watchRecommendationsForesterSuffix)});e("#warrantyFaqLink").click(function(){d.foresterLog("faqClicked"+d.warrantyType+d.watchRecommendationsForesterSuffix)})}});"use strict";h.when("A","ueCount","cf").register("warrantyForesterLogging",function(b,c){b=b.$;if((b=b("#warranty-div"))&&b.length){var a=b.attr("data-watchRecommendationsForesterSuffix");return{foresterLog:function(a){c&&c.incrementCounterByOne(a)},
warrantyType:b.find("#watchWarrantyText").attr("data-warrantyType"),watchRecommendationsForesterSuffix:a}}});h.when("A","warrantyForesterLogging").execute(function(b,c){b=b.$;var a=b("#warranty-div");a&&a.length&&(b=a.find("#watch-warranty-filelink"),a=a.find("#aboutWatchWarrantyLink"),b.length&&c.foresterLog("shown"),a.click(function(){c.foresterLog("aboutWatchWarrantyClickedWR")}),b.click(function(){c.foresterLog("clickedFromDP")}))});"use strict";h.when("jQuery","A","atf").execute(function(b,c){function a(){var a=
c.viewport().height,b=a-k.heightBuffer;g&&(a/=2,b=a-a*k.popupHeightBufferPercent/100);return Math.min(Math.max(b,k.minHeight),k.maxHeight)}function h(){var m=f.attr("data-header"),n="data-"+d,p=f.attr("href"),t=a(),p={name:"g2s2SizeChartView",url:p+"\x26height\x3d"+t};g?(m=c.viewport().width*k.widthPercent/100,b.extend(p,{width:Math.min(Math.max(m,k.minWidth),k.maxWidth).toString(),position:"triggerBottom"})):b.extend(p,{width:"800",header:m});m=JSON.stringify(p);l.attr(n,m)}var f=b("#size-chart-url"),
d=f.attr("data-sizeChartActionType"),g="a-popover"===d,k={widthPercent:70,minWidth:300,maxWidth:800,minHeight:300,maxHeight:700,popupHeightBufferPercent:5,heightBuffer:300},l=b("#size-chart-popover");c.on("resize",function(){var f=b("#fit-guide"),k=a();if(0===f.length){if(0<l.length){var f=l.data(d),h="",g=f.url.split("?"),e=g[0],g=g[1],n="";if(g)for(var g=g.split("\x26"),u=g.length,q=0;q<u;q++)"height"!==g[q].split("\x3d")[0]&&(h+=n+g[q],n="\x26");f.url=e+"?"+h+(n+"height\x3d"+k);l.data(d,f)}}else c.capabilities.ios||
f.height(k)});0<l.length&&h()});"use strict";h.when("jQuery","ueCount").execute(function(b,c){try{var a=b(".dp-heart-button"),h=b(".email"),f=b("#facebook"),d=b("#twitter"),g=b("#pinterest"),k=!1;1===b(".collect-and-share-buttons-wrapper").length&&(k=!0);b=function(a,b){a.bind("click",function(){c.incrementCounterByOne(b+"_"+(k?"T1":"C"))})};b(a,"rsw_heart");b(h,"rsw_email");b(f,"rsw_fb");b(d,"rsw_twitter");b(g,"rsw_pinterest")}catch(l){c.incrementCounterByOne("error_in_rsw_counter")}});"use strict";
h.when("jQuery","ready").execute(function(b){0<b("#brandFollow").length&&h.load.js("https://www.amazon.com/follow/follow_button.js")});"use strict";h.when("jQuery","ueCount","softlines-common-utils","atf").execute(function(b,c,a){var h=a.checkWeblabTreatment("div#shouldShowSizingAndFitInformationTogether","shouldshowsizingandfitinformationtogether",!0),f=b("#size-chart-url"),d=b("#fitRecommendationsLink");b=b("#native_dropdown_selected_size_name");var g="sizeChartLinkClickC",k="fitRecommendationsLinkClickC",
l="twisterSizeDropdownCLickC";h&&(g="sizeChartLinkClickT1",k="fitRecommendationsLinkClickT1",l="twisterSizeDropdownCLickT1");a.isNotNull(f)&&f.bind("click",function(){c.incrementCounterByOne(g)});a.isNotNull(d)&&d.bind("mouseenter",function(){c.incrementCounterByOne(k)});a.isNotNull(b)&&b.bind("click",function(){c.incrementCounterByOne(l)})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("SoftlinesRecommendationsAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("SoftlinesRecommendationsMobileAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("SoftlinesFlojoAssets",""):f;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,f,g){c.when("A","fj-countdown-helper-dpx","atf","cf").register("fj-countdown-clock-dpx",function(b,d){var a=b.state("fj-timerData"),k=b.state("fj-timerTitle"),c=null,h=null,e=null;a&&(c=a.releaseEnded,h=(new Date(a.eventEndTime)).getTime(),0<h&&!1===c?e=b.interval(function(){var a=(new Date).getTime(),
a=h-a,b=d.getDigits(a);0>=a&&clearInterval(e);d.setHtmlFields(b)},1E3):(d.setHtmlFields(d.getDigits(0)),d.setTitle(k,0)));return{interval:e}});"use strict";c.when("A","atf","cf","ready").register("fj-countdown-helper-dpx",function(b){function d(a){return 0>=a?"00":10>a?"0"+a.toString():a.toString()}return{getDigits:function(a){var b={},d=0,c=0,e=0;0<a&&(e=Math.floor(a/1E3),c=Math.floor(e/60),d=Math.floor(c/60),c%=60,e%=60);b.hours=d;b.minutes=c;b.seconds=e;return b},formatNumber:d,setHtmlFields:function(a){b.$("#fj-countdown-hours").html(d(a.hours));
b.$("#fj-countdown-minutes").html(d(a.minutes));b.$("#fj-countdown-seconds").html(d(a.seconds))},setTitle:function(a,c){a&&0>=c&&(b.$("#fj-timer-title").html(a.zerosTitle),b.$("#fj-countdown-box").css("background","#444444"))}}})});
/* ******** */
(function(e){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("SoftlinesRhapsodyAssets",""):c;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,c,d){e.when("A","a-modal","ready").execute(function(a,e){var b=a.$,f,d=b("#rhapsody-iframe"),h=!1,k=!1,g=b("#rhapsody-customize-now-desktop-button"),l=document.getElementById("rhapsody-customize-now-desktop-fake-button");a.declarative("rhapsody-modal-button","click",function(a){b("#rhapsody-error-message").hide();
f||(f=e.create(a.$target,{name:"rhapsody-modal-content",dataStrategy:"preload",hideHeader:!0}),f.attrs("id","rhapsody-modal"));f.show();h||(b("#rhapsody-modal-spinner").show(),b("#rhapsody-error-message").hide(),d.attr("src",d.data("src")),k=!0);c.setTimeout(function(){h||(k=!1,b("#rhapsody-modal-spinner").hide(),b("#rhapsody-error-message").show(),b("#rhapsody-error-message").click(function(){f.hide()}))},1E4);c.onmessage=function(a){a.origin===c.location.origin&&"Rhapsody loaded"===a.data&&k&&(b("#rhapsody-modal-spinner").hide(),
d.show(),h=!0)};document.querySelector("#a-popover-rhapsody-modal \x3e div \x3e button.a-button-close").addEventListener("click",function(){f.hide()})});l&&g&&(l.style.display="none",g.removeClass("aok-hidden"),a.declarative.create(g,"rhapsody-modal-button"),"true"===l.dataset.clicked&&g.trigger("click"))})});
/* ******** */
(function(a){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,c=d?d("DeliveryStaticPackard",""):b;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,b,d){a.when("A","GLUXWidget").execute(function(c,a){c.on("packard:glow:destinationChangeAll",function(){b.location.reload()})});a.when("A","GlowTriggerMetrics","a-modal").execute(function(c,b,e){c.declarative("dpContextualIngressPt","click",function(a){b.logGLOWTriggerCountFromIngress(b.getEvents().cip.desktop);
var d=e.get(c.$("#nav-global-location-slot"));d&&(a.$event.preventDefault(),d.show())})});a.when("A").register("GlowTriggerMetrics",function(c){var a={cip:{desktop:"cip.desktop",mobileWeb:"cip.mobileWeb",tabletApp:"cip.tabletApp",mobileApp:"cip.mobileApp",micron:"cip.micron"},glowTop:{tabletApp:"glow-top.tabletApp",mobileApp:"glow-top.mobileApp",micron:"glow-top.micron"},gpsOnLoad:{nativeApp:"gpsOnLoad.nativeApp"},unknown:{nativeApp:"unknown.nativeApp"}};return{getEvents:function(){return a},logGLOWTriggerCountFromIngress:function(a){a=
"GLOWTrigger."+a;b.ue?b.ue.count(a,1):(a="Failed to increment metrics counter: "+a+" because window.ue is not present.",b.ueLogError&&a&&b.ueLogError({message:a},{logLevel:"ERROR",attribution:"GLOWTrigger"}))}}})});
/* ******** */
(function(k){var m=window.AmazonUIPageJS||window.P,r=m._namespace||m.attributeErrors,b=r?r("DeliveryStatic",""):m;b.guardFatal?b.guardFatal(k)(b,window):b.execute(function(){k(b,window)})})(function(k,m,r){k.when("A","jQuery","ready").register("DeliveryCountdownComponent",function(b,a){function h(a,b,c,d,e){this.strings=a;this.asin=b;this.deliveryMessageSectionId=c;this.countdownElementId=d;this.secondsLeft=e;this.intervalHandle=null}m.DeliveryCountdownHandler=function(a){var b=a.strings,c=a.asin,
d=a.deliveryMessageSectionId,e=a.fastCountdownElementId,n=a.cheapCountdownElementId;this.cheapCountdownTimer=this.fastCountdownTimer=null;this.start=function(a,l){0<a&&(this.fastCountdownTimer=new h(b,c,d,e,a),this.fastCountdownTimer.start());0<l&&(this.cheapCountdownTimer=new h(b,c,d,n,l),this.cheapCountdownTimer.start())};this.stop=function(){this.fastCountdownTimer&&(this.fastCountdownTimer.stop(),this.fastCountdownTimer=null);this.cheapCountdownTimer&&(this.cheapCountdownTimer.stop(),this.cheapCountdownTimer=
null)}};h.prototype.start=function(){var a=this;this.intervalHandle=b.interval(function(){a&&a.updateCountdownText()},1E3)};h.prototype.stop=function(){this.intervalHandle&&m.clearInterval(this.intervalHandle)};h.prototype.updateCountdownText=function(){this.secondsLeft--;if(0<this.secondsLeft){var b=Math.floor(this.secondsLeft/60),g=b%60,b=Math.floor(b/60),c=this.secondsLeft%60,d=this.strings.inNext,e=1<b?this.strings.hours:this.strings.hour,n=1<g?this.strings.minutes:this.strings.minute,w=1<c?this.strings.seconds:
this.strings.second,h=this.strings.timeSeperator,g=0<b&&0<g?b+h+e+h+g+h+n+h+d:0<b&&0===g?b+h+e+d:0===b&&0<g?g+h+n+d:c+h+w+d;a(this.countdownElementId).html(g)}else this.stop(),g="\x3ca href\x3d'javacript:window.location.reload();'\x3e"+this.strings.refreshTimeout+"\x3c/a\x3e",a(this.deliveryMessageSectionId).html(g)}});k.when("A","jQuery","LUXContext").register("LUXController",function(b,a,h){function l(){return{addressLabel:n,addressId:w,obfuscatedId:y,countryCode:f,zipCode:t,state:u,city:x,district:p,
locationType:v}}function g(a){n=a.addressLabel;w=a.addressId;y=a.obfuscatedId;f=a.countryCode;t=a.zipCode;u=a.state;x=a.city;p=a.district;v=a.locationType}function c(a,f,d){a=b.copy(a);a.deviceType=h.deviceType;a.pageType=e;a.actionSource="locux";b.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:a,success:function(a){if(a.sembuUpdated){a.address&&g(a.address);var c=l();h.fullPageRefresh?(k.when("LUXMetrics").execute(function(a){a.logLocationChange(c.locationType)}),
m.location.reload()):(b.trigger("DeliveryAddressDropdown_OnSembuUpdateSuccess",c),b.trigger("DeliveryAddressDropdown_OnAddressChange",c),f&&f(),k.when("LUXMetrics").execute(function(a){a.logLocationChange(c.locationType)}))}else d&&d()},error:function(){b.trigger("DeliveryAddressDropdown_OnSembuUpdateFail",l());d&&d()}})}var d=!1,e=null,n,w,y,f,t,u,x,p,v;return{locationChangeEventName:"DeliveryAddressDropdown_OnAddressChange",locationTypes:{defaultAddress:"DEFAULT_ADDRESS",accountAddress:"ACCOUNT_ADDRESS",
lockerAddress:"LOCKER_ADDRESS",locationInput:"LOCATION_INPUT",realmDefault:"REALM_DEFAULT",region:"REGION",country:"COUNTRY",ip2location:"IP2LOCATION"},init:function(a){k.when("LUXResponder").execute(function(f){d?b.equals(a,l())||(g(a),f.refresh()):(g(a),f.activate(),d=!0)});k.when("LUXCustom").execute(function(a){a.activate()});k.when("LUXMetrics").execute(function(a){e=a.getPageType()})},getLocationData:function(){return l()},changeLocation:function(a,b,f){c(a,b,f)}}});k.when("A","LUXDPOnly").register("LUXDPRefreshController",
function(b){function a(a){e=a;h({addressId:e.addressId,zipCode:e.zipCode,city:e.city,state:e.state,district:e.district,countryCode:e.countryCode,relatedRequestId:e.relatedRequestId});var b={asin:e.asin,merchantId:e.merchantId,deviceType:e.deviceType,smid:e.smid,wdg:e.wdg,exMerchId:e.exMerchId,oneClick:e.oneClick};k.when("UnifiedLocationUpdateHandler").execute(function(a){a.init(b);d=a});l(e.obfuscatedId);g(e.obfuscatedId)}function h(a){var d=c('#buybox select[name\x3d"quantity"]').val()||1;b.state("unifiedLocation",
{addressId:a.addressId,zipCode:a.zipCode,city:a.city,state:a.state,district:a.district,countryCode:a.countryCode,quantity:d,relatedRequestId:a.relatedRequestId})}function l(a){if(e&&e.oneClick){var d="unifiedLocation1ClickAddress";e.deviceType&&"mobileApp"===e.deviceType&&(d="addressID");a||(a=c("#"+d).data("addnewaddress"))||(a="new");d='[id\x3d"'+d+'"]';0<c(d).length&&c(d).val(a);if(e.deviceType&&e.deviceType in n&&(d=b.state("buyNowInfo"))){var f=d.urlParams,f=0<f.indexOf("addressID\x3d")?f.replace(/(addressID=)[^&]*/,
"$1"+a):f+"\x26addressID\x3d"+a;d.urlParams=f;b.state("buyNowInfo",d)}}}function g(a){e&&!e.oneClick&&"T1"===e.updateAddressForNon1Click&&(a||(a=c("#unifiedLocationAddress").data("addnewaddress")),1===c("#unifiedLocationAddress").length&&c("#unifiedLocationAddress").val(a))}var c=b.$,d=null,e=null,n={tabletApp:1,tabletLargeApp:1,iPad:1};b.on("DeliveryAddressDropdown_OnAddressChange",function(a){var c=b.state("unifiedLocation")?b.state("unifiedLocation").relatedRequestId:r;a.relatedRequestId=c;h(a);
l(a.obfuscatedId);g(a.obfuscatedId);null!==d&&(d.refresh(),b.trigger("LocationUX_OnAddressChange",a))});b.on("UnifiedLocationPostRefresh",function(){b.trigger("diodeAjaxRefreshed")});return{init:function(d){a(d)},updateFeaturesForNewQuantitySelection:function(a){h(a);null!==d&&(d.refresh(),b.trigger("LocationUX_OnAddressChange",a))}}});k.when("A","LUXController","LUXDPRefreshController","LUXDPOnly").register("LUXDPQuantityRefresh",function(b,a,h){b.declarative("quantity-dropdown","change",function(b){b=
a.getLocationData();h.updateFeaturesForNewQuantitySelection(b)})});k.when("A","detailPage:RefreshHandler","LUXDPOnly","a-state").execute(function(b,a){k.register("TwisterUpdateHandler",function(){return{init:function(a){b.state("unifiedLocation",a)},refresh:function(){var h=a.getHandlerInstance("LocationUX"),l=[],g="addressId zipCode city state district countryCode relatedRequestId".split(" ");if(h){var c=b.state("unifiedLocation"),d;for(d in c)if(c.hasOwnProperty(d)&&-1<b.$.inArray(d,g)){var e=typeof c[d];
("number"===e||"boolean"===e||"string"===e||c[d]instanceof String)&&l.push(h.getURLParamObject(d,null===c[d]?"":c[d],1))}}0<l.length&&h.doPageRefresh(l)}}})});k.when("A","LUXDPOnly","a-state").execute(function(b){k.register("UnifiedLocationUpdateHandler",function(){return{init:function(a){b.state("unifiedLocation",a)},refresh:function(){a=2;h()}}});var a=0,h=function(){var a=b.state("unifiedLocation");a.urlParams=JSON.stringify(a.urlParams);for(var e in a)if(a.hasOwnProperty(e)){var n=typeof a[e];
"number"===n||"boolean"===n||"string"===n||a[e]instanceof String||(null===a[e]?a[e]="":delete a[e])}a&&a.asin&&a.merchantId&&(b.trigger("UnifiedLocationPreRefresh"),b.ajax("/gp/product/features/unified-location/udp/refresh-features.html?_encoding\x3dUTF-8",{params:a,method:"POST",success:l,error:g,abort:c}))},l=function(){b.trigger("UnifiedLocationPostRefresh",!0)},g=function(){b.trigger("UnifiedLocationPostRefresh",!1);0<--a&&h()},c=function(a){b.trigger("UnifiedLocationPostRefresh",!1)}});k.when("A",
"jQuery","a-popover","LUXWidgetConfig","ready").execute(function(b,a,h,l){function g(c){var d=!1,e=c.selectedAddressId,n=c.selectedObfuscatedId,h=c.selectedAddressLabel,g=c.selectedCountryCode,f=c.selectedZipCode,t=c.selectedState,u=c.selectedCity,x=c.selectedDistrict,p=c.addressPopover.name,v=c.addressPopover.type,r=l.initialAddressLoadCount,z=l.addressReloadCount,q=c.deviceType,N=c.isRecognized,C=0,A=!1;this.init=function(){d||(d=!0,O())};this.destroy=function(){b.off("a:popover:beforeShow:"+p,
D);b.off("a:popover:afterHide:"+p,E);b.capabilities.tablet&&a.isFunction(b.off.orientationchange)&&b.off.orientationchange(F);a(document).undelegate("#unifiedLocationAddrInput","focus");a(document).undelegate("#unifiedLocationAddrInput","input");a(document).undelegate("#unifiedLocationSignIn","click");a(document).undelegate("#unifiedLocationAddrUpdate","click");a(document).undelegate("#unifiedLocationAccountAddrList input[type\x3dradio], #unifiedLocationPopoverSelections ul li .a-touch-link.a-touch-select",
"click");a(document).undelegate("#unifiedLocationSeeMore","click")};var G=function(){k.when(v).execute(function(a){a.get(p)&&a.get(p).hide()})},O=function(){b.on("a:popover:beforeShow:"+p,D);b.on("a:popover:afterHide:"+p,E);b.capabilities.tablet&&a.isFunction(b.on.orientationchange)&&b.on.orientationchange(F);a(document).delegate("#unifiedLocationAddrInput","focus",function(a){H()});a(document).delegate("#unifiedLocationSignIn","click",function(){var a=!0;"mobileApp"===q&&k.now("mash").execute(function(b){b&&
(a=!1,b.navstack.begin().back().end(),b.showLoginDialog({successCallback:function(){b.navstack.begin().back().forward(m.location.href).end()}}))});a&&(m.location.href=c.addressPopover.signInURL+m.location.pathname)});a(document).delegate("#unifiedLocationAddrInput","keyup",function(a){I()});a(document).delegate("#unifiedLocationAddrInput","keypress",function(a){13===(a.keyCode||a.which)&&J()});a(document).delegate("#unifiedLocationAddrUpdate","click",function(a){J()});a(document).delegate("#unifiedLocationAccountAddrList input[type\x3dradio], #unifiedLocationPopoverSelections ul li .a-touch-link.a-touch-select",
"click",function(b){b=a.parseJSON(a(this).hasClass("a-touch-link")?a(this).find("input[type\x3dhidden]").val():a(this).val());if(a(this).hasClass("a-active"))G();else if(b){var f=b.id;f!==e&&K({addressId:f,isDefaultShippingAddress:b.isDefault,addressLabel:b.label,deviceType:q},!1,a(this))}});a(document).delegate("#unifiedLocationSeeMore","click",function(a){L()});"tabletApp"===q&&m.scrollBy(0,1)},P=a("#unifiedLocationAddrInput").attr("placeholder"),I=function(){"tabletApp"===q&&(a("#unifiedLocationAddrInput").val()?
a("#unifiedLocationAddrInput").removeAttr("placeholder"):a("#unifiedLocationAddrInput").attr("placeholder",P))},J=function(){var b=a("#unifiedLocationAddrInput").val();b&&b.match(/^\d{5}$/)?K({zipCode:b,deviceType:q},!0,null):M()},D=function(f){a("#unifiedLocationInvalidInputAlert").hasClass("aok-hidden")||(a("#unifiedLocationAddrInput").val(""),H());b.capabilities.tablet&&a("#a-popover-lgtbox")&&a("#a-popover-lgtbox").css({position:"absolute",top:"0px",left:"0px",width:"100%",height:a("#a-page").css("height")});
I();A||L()},E=function(){"tabletApp"===q&&document.activeElement.blur()},F=function(){k.when(v).execute(function(a){a.get(p)&&a.get(p).refresh()})},L=function(){N&&a.ajax({type:"POST",url:"/gp/delivery/ajax/get-customer-address-list.html",contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",data:{currentAddressCount:C,loadCount:A?z:r,selectedAddressId:e,deviceType:q},dataType:"json",success:function(b){if(b){var f=b.loadedAddressCount;if(0<f){var d=b.html;d&&(a("#unifiedLocationPopoverSelections").length?
(a("#unifiedLocationPopoverSelections ul li").has("span .a-touch-link.a-touch-select").remove(),a("#unifiedLocationPopoverSelections ul").html(d+a("#unifiedLocationPopoverSelections ul").html())):a("#unifiedLocationAccountAddrList").html(d),a("#unifiedLocationTitleSelectAddress").removeClass("a-hidden aok-hidden"),a("#unifiedLocationTitleNoAddress").addClass("aok-hidden"),a("#unifiedLocationSeeMoreDiv").removeClass("a-hidden aok-hidden"),k.when(v).execute(function(a){a.get(p)&&a.get(p).updatePosition()}),
b.hasMore?a("#unifiedLocationSeeMore").removeClass("a-hidden aok-hidden"):a("#unifiedLocationSeeMore").addClass("aok-hidden"),C=f)}}A=!0},error:function(){}})},M=function(){a("#unifiedLocationAddrInput").addClass("a-form-error");a("#unifiedLocationInvalidInputAlert").removeClass("a-hidden aok-hidden");"tabletApp"===q&&(document.activeElement.blur(),a("#unifiedLocationInvalidInputAlert")[0].scrollIntoView())},H=function(){a("#unifiedLocationAddrInput").removeClass("a-form-error");a("#unifiedLocationInvalidInputAlert").addClass("aok-hidden")},
K=function(b,d,c){a.ajax({type:"POST",url:"/gp/delivery/ajax/address-change.html",contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",data:b,dataType:"json",success:function(b){if(b.sembuUpdated){if(b=b.address)e=b.addressId,n=b.obfuscatedId,h=b.addressLabel,g=b.countryCode,f=b.zipCode,t=b.state,u=b.city,x=b.district,b=h?h:(u?u+", ":"")+(t?t+" ":"")+f,a("#unifiedLocationSelectedAddressText").html(b),d&&(a("#unifiedLocationAccountAddrList input[type\x3dradio]:checked").attr("checked",
!1),a("#unifiedLocationAddrInput").val("")),a("#unifiedLocationPopoverSelections ul li .a-touch-link.a-touch-select.a-active").removeClass("a-active"),c&&c.hasClass("a-touch-link")&&c.addClass("a-active");G();B("DeliveryAddressDropdown_OnSembuUpdateSuccess");B("DeliveryAddressDropdown_OnAddressChange")}else b.isValidAddress||M()},error:function(){B("DeliveryAddressDropdown_OnSembuUpdateFail")}})},B=function(a){b.trigger(a,{addressId:e,obfuscatedId:n,countryCode:g,zipCode:f,state:t,city:u,district:x})}}
k.register("DeliveryAddressDropdown",function(){var a;return{init:function(b){a&&a.destroy();(a=new g(b)).init()}}})});k.when("A","jQuery","LUXContext","LUXWidgetConfig","LUXUtils","LUXController","LUXMetrics","ready").register("LUXResponder",function(b,a,h,l,g,c,d){function e(b){a("#unifiedLocationAddrInput").trigger("updateAlerts",[b]);1===b?(a("#unifiedLocationAddrInput").addClass("a-form-error"),a("#LUXInvalidZipCodeAlert").width(a("#LUXInvalidZipCodeAlert").parent().width()).removeClass("aok-hidden"),
a("#LUXMilitaryZipCodeAlert").addClass("aok-hidden")):2===b?(a("#unifiedLocationAddrInput").removeClass("a-form-error"),a("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),a("#LUXMilitaryZipCodeAlert").width(a("#LUXMilitaryZipCodeAlert").parent().width()).removeClass("aok-hidden")):3===b&&(a("#unifiedLocationAddrInput").removeClass("a-form-error"),a("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),a("#LUXMilitaryZipCodeAlert").addClass("aok-hidden"))}function n(b){a(".lux-location-label").html(g.generateLocationLabel(b))}
function w(f){a("#LUXAddressSelections input[type\x3dradio]:checked").attr("checked",!1);var d=a("#LUXAddressSelections .a-declarative").has(".a-radio input[type\x3dradio]");f=f.addressId;for(var c=d.length-1;0<=c;c--)if(b.parseJSON(d[c].getAttribute("data-lux-address-selection")).addressId===f){a(".a-radio input[type\x3dradio]",d[c]).attr("checked",!0);break}}function y(b){b=b.locationType===c.locationTypes.locationInput&&b.zipCode?b.zipCode:"";a("#unifiedLocationAddrInput").trigger("updateZipCodeField",
b);a("#unifiedLocationAddrInput").val(b);e(3)}function f(a){k.when("a-dropdown").execute(function(f){f=f.getSelect(l.countrySelectorComponentName);b.objectIsEmpty(f)||(a.locationType===c.locationTypes.country||a.locationType===c.locationTypes.region||a.locationType===c.locationTypes.ip2location&&!a.state?f.setValue(g.mapLocationDataToCode(a)):f.setValue(""))})}function t(){b.post("/gp/delivery/ajax/get-country-selections.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:g.prepareCountrySelectionGeneratorInput(),
success:function(b){a("#unifiedLocationCountrySelectionDiv").html(b);f(c.getLocationData())}})}function u(a){c.changeLocation(a.data,null,function(){w(c.getLocationData())})}function x(a){c.changeLocation(g.mapCodeToLocationData(a.value),null,function(){f(c.getLocationData())})}function p(){var b=a("#unifiedLocationAddrInput").val();g.validateZipCode(b)?c.changeLocation({zipCode:g.preprocessZipCode(b),locationType:c.locationTypes.locationInput},function(){e(3)},function(){e(1)}):g.isMilitaryZipCode(b)?
e(2):e(1)}function v(){k.when(l.addressSelectorComponentType).execute(function(a){a.get(l.addressSelectorComponentName)&&a.get(l.addressSelectorComponentName).hide()})}function r(){var b=a("#LUXAddressSelections .a-radio"),f=a("#LUXAddressSelections .a-radio.aok-hidden"),b=b.length===f.length;f.slice(0,b?l.initialAddressLoadCount:l.addressReloadCount).removeClass("aok-hidden");0===a("#LUXAddressSelections .a-radio.aok-hidden").length&&(a("#LUXSeeMoreAddressLink").addClass("aok-hidden"),a("#LUXAddressActionSeparator").addClass("aok-hidden"));
b||d.logEvent(d.getEvents().click.seeMore)}function z(a){n(a);w(a);y(a);g.shouldPopulateCountrySelector()&&f(a);v()}function q(){var f=c.getLocationData();y(f);h.isRecognizedCustomer&&0===a("#LUXAddressSelections .a-radio").length&&0===a("#LUXNoAddressNote").length&&b.get("/gp/delivery/ajax/get-address-selections.html",{params:{currentAddressId:f.addressId,deviceType:h.deviceType,isOneClickFromContext:h.isOneClick,clientPage:h.clientPage},success:function(b){b&&(a("#unifiedLocationTitleNoAddress").remove(),
a("#unifiedLocationAccountAddrList").remove(),a("#unifiedLocationSeeMoreDiv").remove(),a("#unifiedLocationTitleSelectAddress").remove(),a(".lux-address-selector-divider").before(b),r())}});!a.trim(a("#unifiedLocationCountrySelectionDiv").html()).length&&g.shouldPopulateCountrySelector()&&t(f);d.logWidgetView(d.getEvents().view.addressSelector)}return{activate:function(){var f=c.getLocationData();d.logPageView(f.locationType);f.locationType===c.locationTypes.region&&n(f);b.on("a:popover:beforeShow:"+
l.addressSelectorComponentName,q);y(f);b.on(c.locationChangeEventName,z);b.declarative("lux-address-selection",["change"],u);a(document).delegate("#unifiedLocationAddrInput","keypress",function(a){13===a.which&&p()});a(document).delegate("#unifiedLocationAddrInput","focus",function(){e(3)});a(document).delegate("#unifiedLocationAddrUpdate","click",p);a(document).delegate("#unifiedLocationSignIn","click",function(){d.logEvent(d.getEvents().click.signIn);var a=l.signInURL+m.location.pathname;"Search"===
d.getPageType()&&(a+=m.location.search);m.location.href=a});a(document).delegate("#LUXSeeMoreAddressLink","click",r);a(document).delegate(".lux-manage-address-link","click",function(a){d.logEvent(d.getEvents().click.manageAddressBook);return!0});b.on("a:dropdown:"+l.countrySelectorComponentName+":select",x)},refresh:function(a){z(c.getLocationData())}}});k.declare("LUXWidgetConfig",{addressSelectorComponentName:"LUXAddressSelector",addressSelectorComponentType:"a-popover",countrySelectorComponentName:"LUXCountrySelector",
countrySelectorComponentType:"a-dropdown",initialAddressLoadCount:5,addressReloadCount:5,signInURL:"/gp/sign-in.html?ie\x3dUTF8\x26useRedirectOnSuccess\x3d1\x26path\x3d"});k.when("A","jQuery","LUXController","RegionNames","ready").register("LUXRegionData",function(b,a,h,l){function g(a){if(b.objectIsEmpty(a)||!a.countryCode||!a.zipCode)return null;for(var e in c)if(c.hasOwnProperty(e)&&b.reduce(c[e],function(n,h,g){return n&&!b.objectIsEmpty(a[g])&&b.equals(a[g],c[e][g])},!0))return e;return null}
var c={"GB-ML":{countryCode:"GB",zipCode:"KA10 6EB"},"GB-NI":{countryCode:"GB",zipCode:"BT1 3ES"},"GB-JE":{countryCode:"GB",zipCode:"JE2 4QA"},"GB-IS":{countryCode:"GB",zipCode:"ZE1 0BX"},"GB-BF":{countryCode:"GB",zipCode:"BFPO 204"},"GB-HI":{countryCode:"GB",zipCode:"PH41 4PU"},"DE-ML":{countryCode:"DE",zipCode:"60313"},"DE-GI":{countryCode:"DE",zipCode:"27498"},"FR-ML":{countryCode:"FR",zipCode:"75001"},"FR-CH":{countryCode:"FR",zipCode:"20000"},"FR-GP":{countryCode:"FR",zipCode:"97100"},"FR-GY":{countryCode:"FR",
zipCode:"97300"},"FR-MC":{countryCode:"FR",zipCode:"98000"},"FR-MQ":{countryCode:"FR",zipCode:"97200"},"FR-NC":{countryCode:"FR",zipCode:"98800"},"FR-PF":{countryCode:"FR",zipCode:"98700"},"FR-RE":{countryCode:"FR",zipCode:"97400"},"FR-SB":{countryCode:"FR",zipCode:"97133"},"FR-SM":{countryCode:"FR",zipCode:"97150"},"FR-SP":{countryCode:"FR",zipCode:"97500"},"FR-WF":{countryCode:"FR",zipCode:"98611"},"FR-YT":{countryCode:"FR",zipCode:"97600"},"IT-ML":{countryCode:"IT",zipCode:"20125"},"IT-II":{countryCode:"IT",
zipCode:"09121"},"ES-ML":{countryCode:"ES",zipCode:"28004"},"ES-BI":{countryCode:"ES",zipCode:"07003"},"ES-CI":{countryCode:"ES",zipCode:"35005"},"BR-SP":{countryCode:"BR",zipCode:"01319900"}};return{getRegions:function(){return c},mapLocationDataToRegionCode:function(a){return g(a)},mapRegionCodeToLocationData:function(b){b=c.hasOwnProperty(b)?a.extend({},{addressLabel:l[b],countryCode:c[b].countryCode,zipCode:c[b].zipCode,state:c[b].state,city:c[b].city,locationType:h.locationTypes.region}):null;
return b}}});k.when("A","jQuery","ready").register("LUXRegionConfig",function(b,a){var h=[],l="AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW".split(" "),
g=/^\d{5}([ \-]\d{4})?$/,c=/^[ \t]*([AFD](\.?)([ \t]?)P(\.?)([ \t]?)O(\.?)[ \t]*[A-Z]{2}[ \t]*[0-9]{5}([ \-][0-9]{4})?)[ \t]*$/;return{getPrimarySelections:function(){return h},getSecondarySelections:function(){return l},getZipCodePattern:function(){return g},getMilitaryZipCodePattern:function(){return c},preprocessZipCode:function(a){return a.toUpperCase().trim().substring(0,5)}}});k.declare("RegionNames",{"GB-ML":"UK - Mainland","GB-BF":"UK - BFPO","GB-JE":"UK - Channel Islands","GB-IS":"UK - Islands",
"GB-NI":"UK - Northern Ireland","GB-HI":"UK - Scottish Highlands","DE-ML":"Germany - Mainland","DE-GI":"German Islands","FR-ML":"France - Mainland","FR-CH":"Corsica","FR-GP":"Guadeloupe","FR-GY":"Guyane","FR-MC":"Monaco","FR-MQ":"Martinique","FR-NC":"New Caledonia","FR-PF":"French Polynesia","FR-RE":"Reunion","FR-SB":"Saint Barthélemy","FR-SM":"Saint Martin","FR-SP":"Saint Pierre and Miquelon","FR-WF":"Wallis and Futuna Islands","FR-YT":"Mayotte","IT-ML":"Italy - Mainland","IT-II":"Italian Islands",
"ES-ML":"Spain - Mainland","ES-BI":"Spain - Balearic Islands","ES-CI":"Spain - Canary Islands, Ceuta and Melilla","BR-SP":"Brazil"});k.declare("CountryNames",{AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AN:"Netherlands Antilles",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Aland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",
BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Saint Eustatius and Saba",BR:"Brazil",BS:"Bahamas, The",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, The Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote D'ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",
CO:"Colombia",CR:"Costa Rica",CS:"Serbia and Montenegro",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States of",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",
GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia, The",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and the McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic of",
IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"Korea, Democratic People's Republic of",KR:"Korea, Republic of",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao People's Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova, Republic of",
ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Macedonia, The Former Yugoslav Republic of",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",
OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestinian Territories",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",
SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic of",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",
US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",YU:"Yugoslavia",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"});k.when("A","jQuery","LUXController","LUXRegionData","LUXRegionConfig","LUXContext","CountryNames","RegionNames").register("LUXUtils",function(b,a,h,l,g,c,d,e){function n(a){return!b.objectIsEmpty(a)&&
a.countryCode&&d.hasOwnProperty(a.countryCode)?b.equals(a.locationType,h.locationTypes.country)?a.countryCode:b.equals(a.locationType,h.locationTypes.region)?l.mapLocationDataToRegionCode(a):l.mapLocationDataToRegionCode(a)||a.countryCode:null}function k(a){return d.hasOwnProperty(a)?d[a]:e.hasOwnProperty(a)?e[a]:null}function m(a){var c={};if(!b.objectIsEmpty(a))for(var d=a.length,e=0;e<d;e++)c[k(a[e])]=a[e];return c}return{getNameForCode:function(a){return k(a)},mapCodeToLocationData:function(a){a=
a?d.hasOwnProperty(a)?{countryCode:a,locationType:h.locationTypes.country,district:a}:l.mapRegionCodeToLocationData(a):null;return a},mapLocationDataToCode:function(a){return n(a)},generateLocationLabel:function(a){a.addressLabel?a=a.addressLabel:a.locationType!==h.locationTypes.region&&a.locationType!==h.locationTypes.country&&a.zipCode?(g.formatZipCodeForAddressLabel&&(a.zipCode=g.formatZipCodeForAddressLabel(a.zipCode)),a=a.city||a.state?g.generateDiffLocationLabelForZip?g.generateDiffLocationLabelForZip(a):
(a.city?a.city+", ":"")+(a.state?a.state+" ":"")+a.zipCode:g.formatZipCodeForAddressLabel?a.zipCode:k(n(a))):a=k(n(a));return a},prepareCountrySelectionGeneratorInput:function(){return{deviceType:c.deviceType,primarySelections:JSON.stringify(m(g.getPrimarySelections())),primarySelectionsOrder:JSON.stringify(g.getPrimarySelections()),secondarySelections:JSON.stringify(m(g.getSecondarySelections()))}},validateZipCode:function(a){return!b.objectIsEmpty(a)&&g.getZipCodePattern().test(a.toUpperCase())},
preprocessZipCode:function(a){return g.preprocessZipCode(a)},isMilitaryZipCode:function(a){return!b.objectIsEmpty(a)&&g.getMilitaryZipCodePattern().test(a.toUpperCase())},shouldPopulateCountrySelector:function(){var a=!0;"undefined"!==typeof c.shouldPopulateCountrySelector&&(a=c.shouldPopulateCountrySelector);return a}}});k.when("A","jQuery","LUXContext","ready").register("LUXMetrics",function(b,a,h){function l(a,b){m.ueLogError&&a&&m.ueLogError({message:a},{logLevel:b||"ERROR",attribution:"LocationUX"})}
function g(a){m.ue?m.ue.count(a,(m.ue.count(a)||0)+1):l("Failed to increment metrics counter: "+a+" because window.ue is not present.","ERROR")}function c(){var a;if(a=m.ue_pty)a:{a=m.ue_pty;for(var c in d)if(d.hasOwnProperty(c)&&-1!==b.indexOfArray(d[c],a)){a=!0;break a}a=!1}return a?m.ue_pty:"unrecognizedPage"}var d={detail:["Detail","DetailAW","DetailWebView","TabletUDP"],search:["Search","SearchAW"],offerListing:["OfferListing","OfferListingAW","OfferListingMobileAppAW"]},e={click:{signIn:"click.signIn",
seeMore:"click.seeMore",manageAddressBook:"click.manageAddressBook"},view:{page:"view.page",addressSelector:"view.addressSelector",countrySelector:"view.countrySelector"},selection:"selection",override:"override"};return{getPageType:function(){return c()},getEvents:function(){return e},logLocationChange:function(a){k.when("LUXController").execute(function(k){var l=c(),f="LocationUX."+l,f=b.equals(a,k.locationTypes.locationInput)||b.equals(a,k.locationTypes.realmDefault)||b.equals(a,k.locationTypes.ip2location)?
f+("."+e.override+"."+a):f+("."+e.selection+"."+a);b.equals(a,k.locationTypes.defaultAddress)||b.equals(a,k.locationTypes.accountAddress)||b.equals(a,k.locationTypes.lockerAddress)||(f+="."+(h.isRecognizedCustomer?"recognized":"unrecognized"));-1!==b.indexOfArray(d.detail,l)&&h.isRecognizedCustomer&&(f+="."+(h.isOneClick?"1Click":"Non1Click"));g(f)})},logPageView:function(a){k.when("LUXController").execute(function(k){var l=c(),f="LocationUX."+l+"."+e.view.page+"."+a;b.equals(a,k.locationTypes.defaultAddress)||
b.equals(a,k.locationTypes.accountAddress)||b.equals(a,k.locationTypes.lockerAddress)||(f+="."+(h.isRecognizedCustomer?"recognized":"unrecognized"));-1!==b.indexOfArray(d.detail,l)&&h.isRecognizedCustomer&&(f+="."+(h.isOneClick?"1Click":"Non1Click"));g(f)})},logWidgetView:function(a){var e=c();a="LocationUX."+e+"."+a+"."+(h.isRecognizedCustomer?"recognized":"unrecognized");-1!==b.indexOfArray(d.detail,e)&&h.isRecognizedCustomer&&(a+="."+(h.isOneClick?"1Click":"Non1Click"));g(a)},logEvent:function(a){a=
"LocationUX."+c()+"."+a;g(a)},logError:function(a,b){l(a,b)}}})});
/* ******** */
(function(h){var d=window.AmazonUIPageJS||window.P,p=d._namespace||d.attributeErrors,a=p?p("HLCXDetailPageAssets",""):d;a.guardFatal?a.guardFatal(h)(a,window):a.execute(function(){h(a,window)})})(function(h,d,p){h.when("A").register("BaseLinkKeyValuePairHelper",function(a){var e=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=16*Math.random()|0;return("x"===a?c:c&3|8).toString(16)})},c=function(a,c){this.key=a;this.value=c};return{getBaseLinkPairs:function(){var a=
e();return{ITEM_ASSOC:new c("itemAssoc",a),UNIQ_PARENT:new c("UNIQ-itemAssoc",a),UNIQ_WARRANTY:new c("UNIQ-lnkdWrrnty",a),ITEM_ASSOC_TYPE:new c("itemAssocType","AmazonProtect"),RENDER_TYPE:new c("itemAssocRenderType","renderAll")}}}});h.when("A","BaseLinkKeyValuePairHelper").register("BaseLinkFormHelper",function(a,e){var c=a.$,l=function(a,g){var b=0;g.find("input[name^\x3d'custom-name\\."+a+"\\.']").each(function(g,a){g=a.name.split(".")[2];isNaN(g)||(b=g>b?g:b)});return b+1},f=function(a,g,b){var k=
[],m=l(a,g);c.each(b,function(g,b){var c="custom-value."+a+"."+m;g=d("custom-name."+a+"."+m,b.key);b=d(c,b.value);k=k.concat([g,b]);m++});return k},d=function(a,g){var b=document.createElement("input");b.setAttribute("type","hidden");b.setAttribute("class","atcFormWarrantyData");b.setAttribute("id",a);b.setAttribute("name",a);b.setAttribute("value",g);return b},n=function(a){a.find(".atcFormWarrantyData").each(function(g,a){a.parentNode.removeChild(a)})};return{addBaseLinkFields:function(a,g){n(g);
if(!g.find("input[value\x3d'itemAssoc']").length){var b=e.getBaseLinkPairs(),k=f(1,g,[b.ITEM_ASSOC,b.UNIQ_PARENT,b.ITEM_ASSOC_TYPE]);a=f(a,g,[b.ITEM_ASSOC,b.UNIQ_WARRANTY,b.ITEM_ASSOC_TYPE,b.RENDER_TYPE]);k=k.concat(a);c.each(k,function(a,b){g.append(b)})}},removeBaseLinkFields:n,getMobileWarrantyIndex:function(a){var g=1;a.find("input[name\x3d'a']").each(function(a,c){c.value&&(a=c.value.split("|"))&&(g=a.length)});return g+1}}});h.when("A","BaseLinkKeyValuePairHelper").register("BaseLinkDeclarativeHelper",
function(a,e){var c=a.$,l=[],f=function(a){var b=!1;c.each(a,function(a,g){if("itemAssoc"===g)return b=!0,!1});return b},d=function(a,b,k){var f={},e=n(a,b);c.each(k,function(b,c){b=c.value;var k="custom-name."+a+"."+e,d="custom-value."+a+"."+e;f[k]=c.key;f[d]=b;l.push(k);l.push(d);e++});return f},n=function(a,b){var k=new RegExp("^custom-name[.]["+a+"]+[.]([0-9]+)$"),f=0;c.each(b,function(a){if(a=a.match(k))a=+a[1],a>f&&(f=a)});return f+1},h=function(a){c.each(l,function(b,c){a[c]&&delete a[c]});
l=[]};return{addBaseLinkFields:function(a){h(a);if(!f(a)){var b=e.getBaseLinkPairs(),k=d(1,a,[b.ITEM_ASSOC,b.UNIQ_PARENT,b.ITEM_ASSOC_TYPE]),b=[b.ITEM_ASSOC,b.UNIQ_WARRANTY,b.ITEM_ASSOC_TYPE,b.RENDER_TYPE],l=1;a.a&&(l=a.a.split("|").length);b=d(l+1,a,b);c.extend(a,k);c.extend(a,b)}},removeBaseLinkFields:h,getDeclarativeDataInputs:function(a){if(a=c(a)){var b=a.data("action");if((a=a.data(b))&&a.inputs)return a.inputs}}}});h.when("A","aw-mash").register("BaseLinkAddWarrantyHelper",function(a,e){var c=
function(a){d.ueLogError&&d.ueLogError({message:"msi - "+a},{logLevel:"ERROR",attribution:"Mobile_App_SI_Base_Link"})};return{addLinkedWarranty:function(d,f,h){a.ajax("/gp/product/amazon-protect/base-link/services/warranty-service.html",{method:"post",params:d,timeout:1E3,success:function(a){a&&a.status&&"OK"===a.status?(f(),a.numActiveItemsInCart&&(a=parseInt(a.numActiveItemsInCart,10),e.cart.didUpdate({newCartQuantity:a}))):c("Error while doing a call to warranty-service.html. Success but response not valid.")},
error:function(a,f,g){c("Error while doing a call to warranty-service.html. Status: "+f+" . Error: "+g);h()}})},obtainBaseItemCartid:function(d){a.ajax("/gp/product/amazon-protect/base-link/services/last-added-cart-item-id.html",{method:"post",timeout:1E3,cache:!1,success:function(a){a&&a.status&&a.lastAddedItemCartId?d(a.lastAddedItemCartId):c("Error while doing a call to last-added-cart-item-id.html. Status: "+a.status)},error:function(a,d,e){c("Error while doing a call to last-added-cart-item-id.html. Status: "+
d+" . Error: "+e)}})},mSilogError:c}});"use strict";h.when("A","ready").execute(function(a){function e(a){var c=d.ue;c&&c.count&&c.count(a,(c.count(a)||0)+1)}var c=a.$;a.on("a:expander:comparison_detail_expander:toggle:expand",function(a){e("ComparisonExpanderExpanded");c(".comparison_other_attribute_row").removeClass("aok-hidden")});a.on("a:expander:comparison_detail_expander:toggle:collapse",function(a){e("ComparisonExpanderCollapsed");c(".comparison_other_attribute_row").addClass("aok-hidden")})});
h.when("A","atf","ready").execute(function(a){function d(){var c,e=a.$("#HLCXComparisonJumplink_feature_div"),f=a.$("#HLCXComparisonWidget_feature_div");c=a.$("#HLCXComparisonJumplinkContent").length?f.find("#HLCXComparisonJumplinkContent"):f.find(".HLCXComparisonJumplinkContent");f=f.has("#HLCXComparisonTable").length;e.empty();f&&c.clone().removeClass("aok-hidden").appendTo(e)}a.declarative("hlcx-send-reftag","click",function(c){a.$.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+c.data.refTag)});
d();a.on("a:pageUpdate",d)});h.when("A","ready").execute("logCsmMetricsForComparisonTabs",function(a){var e;a.on("a:tabs:comparison_items_tabs:compare_to_similar_items_tab:select a:tabs:comparison_items_tabs:compare_to_recently_viewed_items_tab:select",a.throttle(function(a){e&&e===a.selectedTab.tabName||(e=a.selectedTab.tabName,d.ue&&d.ue.count&&d.ue.count(a.selectedTab.tabName,1))},100,{trailing:!1}))});h.when("A","3p-promise","ready").register("hlcx-table-csm",function(a,e,c){function h(c){return a.$(c?
".hlcx-cmp-title-col":".comparison_image_title_cell").filter(":visible").map(function(){return a.$(this).attr("data-asin")}).toArray()}function f(){try{var a=document.cookie.match("(^|[^;]+)\\s*(session-id|sessionId)\\s*\x3d\\s*([^;]+)");return a?a.pop():""}catch(b){return""}}function p(c,b){return new e(function(d,e){function f(){b.unbind("click auxclick",f);var c=a.now()-h;a.off("DOMContentLoaded load resize scroll",l);d({timeInView:c,clickedOff:!0})}var h=a.now(),l=a.throttle(function(){if(!a.onScreen(c)){var b=
a.now()-h;a.off("DOMContentLoaded load resize scroll",l);d({timeInView:b,clickedOff:!1})}},200);b.bind("click auxclick",f);a.on("DOMContentLoaded load resize scroll",l)})}function n(a,b,c){var e=h(c);a={pageAsin:a,comparableAsins:e.slice(1),sessionId:b,deviceType:c?"mobile":"desktop"};d.ue&&d.ue.event&&d.ue.event(a,"comparison","comparison.dpTableImpression.1")}function q(c,b,e){function m(){!t&&a.onScreen(r)&&(t=!0,p(r,e()).then(function(a){t=!1;if(!(2500>a.timeInView)){var e=h(b).slice(1),f=a.timeInView,
k=++q,m;m=d.location.href.endsWith("#HLCXComparisonWidget_feature_div");a={pageAsin:c,comparableAsins:e,sessionId:u,timeInView:f,viewOnPageCounter:k,deviceType:b?"mobile":"desktop",landedOnComparisonsTable:m,clickedOff:a.clickedOff};d.ue&&d.ue.event&&d.ue.event(a,"comparison","comparison.dpTableView.2")}}))}var r=a.$(b?"#hlcx_cmp_table":"#HLCXComparisonTable");if(r.length){var u=f();n(c,u,b);var t=!1,q=0;a.on("DOMContentLoaded load resize scroll",m);a.on("a:pageUpdate",function(){c!==a.$(b?".hlcx-cmp-title-col":
".comparison_image_title_cell").first().attr("data-asin")&&a.off("DOMContentLoaded load resize scroll",m)})}}return{setupClientSideLogging:function(c,b){var d;return function(){var e=a.$(c?".hlcx-cmp-title-col":".comparison_image_title_cell").first().attr("data-asin");d!==e&&"undefined"!==typeof e&&(d=e,q(d,c,b))}}}});h.when("A","hlcx-table-csm").execute(function(a,d){d=d.setupClientSideLogging(!1,function(){return a.$("td.comparison_add_to_cart_button span.a-button, th.comparison_image_title_cell a, #comparison_sold_by_row a, #comparison_custormer_rating_row a")});
a.on("a:pageUpdate",d);d()})});
/* ******** */
(function(d){var n=window.AmazonUIPageJS||window.P,l=n._namespace||n.attributeErrors,a=l?l("DetailPageWarrantyAssets",""):n;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,n,l){"use strict";"use strict";d.when("A").register("warranty-options-constants",function(a){return{featureRegistration:{featureName:"warrantyTwisterPlus",featureAttribution:"Retail/AppleCare/(de)activation",updateQtyAsBaseItem:1},selector:{expanderContainer:".warranty-twister-container",skeletonLoader:".warranty-twister-skeleton-loader",
checkmark:".warranty-twister-selected-checkmark",subtitle:".warranty-twister-subtitle",subtitleText:"#warranty-twister-subtitle",priceSubtitle:".warranty-twister-price-subtitle",priceSubtitleText:"#warranty-twister-price-subtitle",cardImage:".warranty-twister-selected-card-image",expanderIcon:".warranty-twister-expander-icon",learnMoreLink:"#learn-more-link",toggleButton:"#warranty-twister-toggle-button",expanderContent:".warranty-twister-expander-content",swatch:".warranty-twister-swatch",warrantyOption:".warranty-twister-box-group-warranty-option",
selectedWarrantyOption:".warranty-twister-selected-box-group.warranty-twister-box-group-warranty-option",warrantyOptionTitle:".warranty-twister-warranty-option-title",defaultOption:"#default-option-swatch",swatchBoxGroup:".warranty-twister-box-group",swatchHeading:".warranty-twister-box-group-heading",swatchBoxGroupDetail:".warranty-twister-box-group-detail",swatchBoxGroupDetailNoHeader:".warranty-twister-box-group-detail-no-header",popoverButtonRow:"#attach-warranty-popover-buttons-row",warrantyTwisterSecondaryView:"#a-popover-warrantyTwisterPlusSecondaryView"},
styles:{twisterPlusFadeIn:"twister-plus-cc-card-fadeIn",warrantyTwisterExpand:"warranty-twister-expander-content-expand",skeletonLoaderExpand:"warranty-twister-skeleton-loader-expand",selectedHeading:"warranty-twister-selected-heading",selectedBoxGroup:"warranty-twister-selected-box-group",unselectedHeading:"warranty-twister-unselected-heading"},animationTimeoutUnit:200,metricPrefix:"warranty-options"}});"use strict";d.when("A","warranty-options-constants").register("warranty-options-csm",function(a,
p){function f(a,f){"undefined"!==typeof b&&"undefined"!==typeof b.count&&a&&b.count(a,(b.count(a)||0)+f)}function h(a){if(a)this.timerName=a,this.startTime=0;else throw Error("timerName must be non empty string");}var b=n.ue;a=p.featureRegistration.featureName;a={ccExpanded:"twisterPlus.ccExpanded."+a,ccExpandedTime:"twisterPlus.ccExpandedTime."+a,ccScroll:"twisterPlus.ccScroll."+a,ccLearnMore:"twisterPlus.ccLearnMore."+a,ccItemCounts:"twisterPlus.ccItemsCount."+a,ccItemsSelectCount:"twisterPlus.ccItemsSelectCount."+
a,defaultOptionSelectCount:"twisterPlus.defaultSelectCount."+a,ccSVLoadingtime:"twisterPlus.ccSVLoadingtime."+a};h.prototype={isStarted:!1,start:function(){this.isStarted=!0;this.startTime=Date.now()},stop:function(){this.startTime&&f(this.timerName,Date.now()-this.startTime)}};return{increment:function(a){f(a,1)},incrementWithValue:f,Timer:h,MetricNames:a}});"use strict";d.when("A","warranty-twister-expander-state","warranty-options-constants","warranty-twister-swatch-actions","warranty-options-csm").register("warranty-twister-expander-actions",
function(a,p,f,h,b){function e(){var a=c(g.expanderContainer),b=a.offset().top+a.outerHeight();if(c(n).scrollTop()+c(n).height()<b){var b=a.offset().top,k=c(n).height(),a=a.height(),a=b-(k-a)/2;c("html, body").animate({scrollTop:a},p.animationTimeoutUnit)}}function m(a){a=a?d.expandedPriceSubtitle:d.loadingSubtitle;c(g.priceSubtitleText).text(a)}var c=a.$,g=f.selector,k=f.styles,d=p.expanderSubtitle,l=new b.Timer(b.MetricNames.ccExpandedTime);return{initSubtitle:function(a){d.collapsedSubtitle=a.data.defaultSubtitle;
d.expandedSubtitle=a.data.defaultSubtitle;d.collapsedPriceSubtitle=a.data.defaultPriceSubtitle;d.expandedPriceSubtitle=a.data.expandedPriceSubtitle},expandWarrantyOptions:function(d){b.increment(b.MetricNames.ccExpanded);l.start();c(g.expanderContent).addClass(k.warrantyTwisterExpand);c(g.expanderIcon).addClass("rotate");a.delay(function(){c(g.swatch).addClass(k.twisterPlusFadeIn);h.adjustWarrantyOptionHeight();m(d);e()},f.animationTimeoutUnit)},expandSkeletonLoader:function(){c(g.expanderContent).addClass(k.skeletonLoaderExpand);
c(g.expanderIcon).addClass("rotate");a.delay(function(){c(g.skeletonLoader).addClass(k.twisterPlusFadeIn);m(!1);e()},f.animationTimeoutUnit)},hideLoaderAnimation:function(b){b&&c(g.skeletonLoader).removeClass(k.twisterPlusFadeIn);a.delay(function(){c(g.skeletonLoader).hide();c(g.swatch).removeClass("invisible");b&&(c(g.expanderContent).addClass(k.warrantyTwisterExpand),a.delay(function(){c(g.swatch).addClass(k.twisterPlusFadeIn);h.adjustWarrantyOptionHeight();m(!0);e()},f.animationTimeoutUnit))},
f.animationTimeoutUnit)},collapseWarrantyOptions:function(b){l.stop();c(g.swatch).removeClass(k.twisterPlusFadeIn);b||c(g.skeletonLoader).removeClass(k.twisterPlusFadeIn);c(g.expanderIcon).removeClass("rotate");a.delay(function(){c(g.expanderContent).removeClass(k.warrantyTwisterExpand);c(g.expanderContent).removeClass(k.skeletonLoaderExpand);c(g.priceSubtitleText).text(d.collapsedPriceSubtitle)},f.animationTimeoutUnit)}}});"use strict";d.when("A").register("warranty-twister-expander-state",function(a){return{expanderSubtitle:{collapsedSubtitle:"",
expandedSubtitle:"",collapsedPriceSubtitle:"",expandedPriceSubtitle:"",loadingSubtitle:"Loading options..."},get isLoaded(){return this.property},set isLoaded(a){this.property=a}}});"use strict";d.when("A","warranty-twister-expander-state","warranty-options-constants").register("warranty-twister-swatch-actions",function(a,d,f){function h(){var a=b(e.warrantyOption).height();a===l||0>=a||b(e.swatchBoxGroupDetailNoHeader).height(a)}var b=a.$,e=f.selector,m=f.styles,c=d.expanderSubtitle;return{adjustWarrantyOptionHeight:function(){var a=
b(e.swatchBoxGroupDetail);if(a!==l&&0!==a.length){var c=0;b(a).each(function(){c=Math.max(c,b(this).height())});b(a).height(c);h()}},updateSwatchStyle:function(a){b(e.swatchBoxGroup).removeClass(m.selectedBoxGroup);b(e.swatchHeading).removeClass(m.selectedHeading);b(e.swatchHeading).addClass(m.unselectedHeading);var c=a.find(e.swatchHeading);a=a.find(e.swatchBoxGroup);c.removeClass(m.unselectedHeading);c.addClass(m.selectedHeading);a.addClass(m.selectedBoxGroup)},updateDefaultOptionPriceSubtitle:function(a,
d){c.collapsedPriceSubtitle=a;c.expandedPriceSubtitle=d;b(e.priceSubtitleText).text(d);b(e.priceSubtitle).removeClass("a-color-success");b(e.priceSubtitle).addClass("a-color-tertiary");b(e.checkmark).addClass("a-hidden")},updateWarrantyOptionPriceSubtitle:function(a,d){c.collapsedPriceSubtitle=a;c.expandedPriceSubtitle=a;b(e.priceSubtitleText).text(a);b(e.priceSubtitle).removeClass("a-color-tertiary");b(e.priceSubtitle).addClass("a-color-success");b(e.checkmark).removeClass("a-hidden");b(e.cardImage).attr("src",
d)}}});"use strict";d.when("A","warranty-twister-swatch-actions").execute(function(a,d){var f=a.$;a.declarative("warranty-twister-default-action","click",function(h){a.trigger("a:declarative:select-default-option:click");var b=f(h.$currentTarget);b!==l&&null!==b&&(d.updateSwatchStyle(b),d.updateDefaultOptionPriceSubtitle(h.data.defaultPriceSubtitle,h.data.expandedPriceSubtitle))});a.declarative("warranty-option-swatch-select","click",function(h){a.trigger("a:declarative:select-warranty-option:click",
h);var b=f(h.$currentTarget);b!==l&&null!==b&&(d.updateSwatchStyle(b),d.updateWarrantyOptionPriceSubtitle("+"+h.data.warrantyPrice+" ("+h.data.warrantyPlanTerm+" plan)",h.data.cardImageUrl))})})});
/* ******** */
(function(d){var c=window.AmazonUIPageJS||window.P,a=c._namespace||c.attributeErrors,b=a?a("DetailPageOffersMulticlickAssets",""):c;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,c,a){d.when("A","preventMulticlick:forceFormSubmit","atf").execute(function(b,d){function e(b){c.ue&&c.ue.count&&c.ue.count(b,1)}var f=!1,a=function(c){var a=b.$(document);a&&a.delegate(c,"click",function(){var a=b.$(c);if(!a||"submit"!==a.prop("type"))return!0;if(f)return e("oneClickDisableOneClickButton"),
a.attr("disabled",!0),!1;e("oneClickTriggerOneClickFormSubmit");d(a);f=!0;setTimeout(function(){e("oneClickEnableOneClickButtonAfterTimeout");f=!1;a.attr("disabled",!1)},3E4);return!0})};b.on("mash:willReappear",function(){e("oneClickEnableOneClickButtonOnMashReappear");f=!1});a("#one-click-button");a("#oneClickBuyButton");a("#prime-toggle-main");e("oneClickPreventMultiClickModuleCalled")});"use strict";d.when("A","atf").register("preventMulticlick:forceFormSubmit",function(a){return function(a){}})});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,g=d._namespace||d.attributeErrors,e=g?g("DetailPageDesktopOffersAssets",""):d;e.guardFatal?e.guardFatal(c)(e,window):e.execute(function(){c(e,window)})})(function(c,d,g){c.when("jQuery","a-popover","A","a-dropdown","moq-core","ready").register("moq",function(e,k,h,c,f){function d(a,b){0===c.getSelect(b).val().length?f.lockSubmission(a,e.noop,t):f.unlockSubmission(a,u)}function g(a){a=f.findMoqOfferContainerWithDomElement(a.nativeItemNode);if(null!==
a){var b=a.find("#quantity, #rcxsubsQuan");d(a,b);f.tweakDisplayTextForMoqQuantityDropdown(b)}}function l(a){return f.findMoqOfferContainerWithDomElement(a.popover.$trigger[0]).find("#quantity, #rcxsubsQuan")}function v(){n||(h.on("a:popover:beforeShow:moqAtcPopover",function(a){var b=l(a);0!==b.length&&(p(b),setTimeout(function(){b.addClass("highlightQuantityDropdownBorder")},20))}),h.on("a:popover:afterHide:moqAtcPopover",function(a){a=l(a);0!==a.length&&(a.removeClass("highlightQuantityDropdownBorder"),
q(a))}),h.on("a:popover:beforeShow:MOQPreLoadPopOver",function(a){a=l(a);0!==a.length&&p(a)}),h.on("a:popover:afterHide:MOQPreLoadPopOver",function(a){a=l(a);0!==a.length&&q(a)}),h.on("a:dropdown:rcxsubsQuan:select",g),h.on("a:dropdown:quantity:select",g),n=!0)}function r(a){var b=a.parent().parent("div").innerWidth()-a.prev("label").outerWidth()-5;100<b&&a.width(b)}function t(a){if(null===k.get(a)){var b=f.findMoqOfferContainerWithDomElement(a[0]).find("script#moqPopoverContent");0!==b.length&&(b=
b.html(),a.addClass("cursorDisabled"),k.create(a,{name:"moqAtcPopover",position:"triggerLeft",closeButton:"false",inlineContent:b}))}}function u(a){null!==k.get(a)&&(a.removeClass("cursorDisabled"),k.remove(a))}function q(a){setTimeout(function(){m--;0<m||(a.prop("disabled",!1),a.removeClass("quantityBarGrayOut"))},370)}function p(a){m++;0===c.getSelect(a).val().length&&(a.prop("disabled",!0),a.addClass("quantityBarGrayOut"))}function w(a){var b=a.find("#quantity, #rcxsubsQuan");0===b.length||b.hasClass("aok-hidden")||
(c.getSelect(b).setValue(""),r(b),x(a),d(a,b))}function x(a){if(0!==a.length){var b=a.find("#quantity, #rcxsubsQuan");a.click(function(){setTimeout(function(){r(b)},20)})}}var n=!1,m=0;return{initializeQuantitySelect:function(){var a=f.findMoqOfferContainers();0!==a.length&&(a.forEach(w),v())}}});"use strict";c.when("dp-click-counter").execute("dp-desktop-atc-click-counter",function(c){var d=document.getElementById("add-to-cart-button");d&&c.record(d,"dp-desktop-atc")})});
/* ******** */
(function(l){var k=window.AmazonUIPageJS||window.P,e=k._namespace||k.attributeErrors,n=e?e("GoldboxUDPAssets",""):k;n.guardFatal?n.guardFatal(l)(n,window):n.execute(function(){l(n,window)})})(function(l,k,e){(function(){function e(b){c.push(b)}function a(b){return-1<c.indexOf(b)}var c=[];k.gb=k.gb||{};k.gb.sharedModuleRegistry=k.gb.sharedModuleRegistry||{register:e,isRegistered:a}})();gb.sharedModuleRegistry.isRegistered("gb-csm-ajax-metric-logger")||(gb.sharedModuleRegistry.register("gb-csm-ajax-metric-logger"),
l.register("gb-csm-ajax-metric-logger",function(){function e(b){a[b]||(a[b]=0);return b+c.SEPARATOR+ ++a[b]}var a={},c={ID:"id",CLICK_TIME:"tc",START_TIME:"t0",CRITICAL_FEATURE:"cf",BODY_END:"be",PAGE_LOAD:"ld",REQUEST_ID:"x-amz-rid",SEPARATOR:"-"};return function(b){var a=e(b);return{recordStart:function(){"function"===typeof uet&&uet(c.CLICK_TIME,a);return this},recordComplete:function(b){"function"===typeof ues&&(b=b&&b.getResponseHeader&&b.getResponseHeader(c.REQUEST_ID)?b.getResponseHeader(c.REQUEST_ID):
!1,ues(c.ID,a,b),ues(c.START_TIME,a,new Date));return this},recordFeatureComplete:function(){"function"===typeof uet&&(uet(c.CRITICAL_FEATURE,a),uet(c.BODY_END,a));return this},publishAjaxMetrics:function(){"function"===typeof uex&&uex(c.PAGE_LOAD,a);return this}}}}));gb.sharedModuleRegistry.isRegistered("gb-csm-counter-metrics")||(gb.sharedModuleRegistry.register("gb-csm-counter-metrics"),l.register("gb-csm-counter-metrics",function(){function e(b,a){if(b&&k.ue&&ue.count)return ue.count(b,a)}function a(b){var a;
a=b&&k.ue&&ue.count?ue.count(b)||0:void 0;e(b,a+1)}function c(b,a){e(b+":time",a)}var b={};return{incrementCounter:a,recordLatency:c,recordImageMetricMarker:function(b,g,f){var e="ImgLoad";f&&(e+=":"+f);switch(b){case "load":a(e+":success");if(b=parseInt(g.getAttribute("data-render-start"),10))b=(new Date).getTime()-b,c(e,b);break;case "error":a(e+":error")}},recordMaxPageDepthReached:function(a,c){var f="widgetPageDepth";gb.widgets&&a&&gb.widgets[a]&&gb.widgets[a].viewPortManager&&!isNaN(gb.widgets[a].viewPortManager.subnavPage)&&
(f+=":SN:"+gb.widgets[a].viewPortManager.subnavPage);b[f]&&b[f]>=c||(b[f]=c,e(f,c))}}}));gb.sharedModuleRegistry.isRegistered("gb-csm-error-logger")||(gb.sharedModuleRegistry.register("gb-csm-error-logger"),l.register("gb-csm-error-logger",function(){function e(a,c,b){var d=k.ueLogError;d&&d(c,{logLevel:a,attribution:"GoldboxMobileAssets",message:b||""})}return{logError:function(a,c){e("ERROR",a,c)},logWarning:function(a,c){e("WARN",a,c)},logFatal:function(a,c){e("FATAL",a,c)}}}));gb.sharedModuleRegistry.isRegistered("gb-csm")||
(gb.sharedModuleRegistry.register("gb-csm"),l.when("gb-csm-ajax-metric-logger","gb-csm-counter-metrics","gb-csm-error-logger").register("gb-csm",function(e,a,c){return{getAjaxMetricLogger:e,counterMetricLogger:a,errorLogger:c}}));l.when("A").register("gb-udp-event-emitter",function(e){return e.createClass({init:function(){this._events=this._events||{}},on:function(a,c){this._events[a]=this._events[a]||[];this._events[a].push(c)},off:function(a,c){!1!==a in this._events&&this._events[a].splice(this._events[a].indexOf(c),
1)},trigger:function(a){if(!1!==a in this._events)for(var c=0;c<this._events[a].length;c++)this._events[a][c].apply(this,Array.prototype.slice.call(arguments,1))}})});l.when("A").execute("gb-udp-deal-resources",function(n){k.GBResources||function(){k.GBResources=new function(a,c){if(c===e)for(var b in c)a[b]=c[b];c=a&&a.__init__||function(){};c.prototype=a;return c}({__init__:function(a){this.strings={};this.images={};this.features={};this.customerData={};this.categories=[];this.dealDebug=!1;this.loadedUrls=
{};this.amznMerchantID=this.preload_img_div=null;this.nodeIdToCategoryMap={};this.apiConfigs={};this.registered={};null!=a&&(a.strings&&this.registerStrings(a.strings),a.images&&this.registerImages(a.images),a.features&&this.registerFeatures(a.features),a.apiConfigs&&this.registerApiConfigs(a.apiConfigs))},registerStrings:function(a){this.registerResources(this.strings,a)},registerApiConfigs:function(a){this.registerResources(this.apiConfigs,a)},getString:function(a,c){if(!(a in this.strings))return this.log('StringId "'+
a+'" does not exist in the strings repository.'),"";a=""+this.strings[a];if(null==c)return a;for(var b in c)a=a.replace(new RegExp("\\${"+b+"}","g"),c[b]);return a},registerImages:function(a){this.registerResources(this.images,a);for(var c in this.images)this.preloadImage(this.images[c])},preloadImage:function(a){this.preload_img_div||(this.preload_img_div=this.div({style:"display:none"}));this.preload_img_div.appendChild(this.img({src:a}))},getImage:function(a){return this.images[a]},registerFeatures:function(a){this.registerResources(this.features,
a)},getFeature:function(a){return this.features[a]},registerCustomerData:function(a){this.registerResources(this.customerData,a)},getCustomerData:function(a){return this.customerData[a]},getApiConfigs:function(a){return this.apiConfigs[a]},registerResources:function(a,c){if(null!==c&&null!==a)for(var b in c)a[b]=c[b]},setDealDebug:function(a){this.dealDebug=a},getDealDebug:function(){return this.dealDebug},registerFromJSON:function(a){a.GBStrings&&this.registerStrings(a.GBStrings);a.GBImages&&this.registerImages(a.GBImages);
a.GBWeblabs&&this.registerFeatures(a.GBWeblabs);a.GBCustomerData&&this.registerCustomerData(a.GBCustomerData);a.GBWidgetName&&this.registerFeatures(a.GBWidgetName);a.GBZone&&this.registerFeatures(a.GBZone);a.GBDealDebug&&this.setDealDebug(a.GBDealDebug)},img:function(a){a=a||{};a.border=a.border||0;return this.el("img",a)},div:function(a,c){return this.el("div",a,c)},el:function(a,c,b){a=document.createElement(a);c&&this.set_attributes(a,c);b&&this.appendChildren(a,b);return a},set_attributes:function(a,
c){for(var b in c)"style"==b?a.style.cssText=c[b]:a[{"class":"className",checked:"defaultChecked",usemap:"useMap","for":"htmlFor",readonly:"readOnly",colspan:"colSpan",bgcolor:"bgColor",cellspacing:"cellSpacing",cellpadding:"cellPadding",valign:"vAlign",nowrap:"noWrap"}[b]||b]=c[b]},log:function(a){a=new Date+": "+a;k.console&&k.console.log(a)},getParamValueFromUrl:function(a,c){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");return(a=(new RegExp("[\\?\x26]"+a+"\x3d([^\x26#]*)")).exec(c))?k.decodeURIComponent(a[1].replace(/\+/g,
" ")):""}})}();k.P&&k.P.AUI_BUILD_DATE&&(k.gbResources||(k.gbResources=new GBResources),k.gbRegistered=k.gbRegistered||{},k.gbResources.registered=k.gbResources.registered||{},k.gbRegistered.dealResources||k.gbResources.registered.dealResources||(k.gbRegistered.dealResources=!0,k.gbResources.registered.dealResources=!0,l.register("dealResources",function(){return k.GBResources})))});l.when("A").execute("gb-udp-widget-common",function(n){k.Deal||function(){k.Deal={};Deal.availableStr="Available";Deal.inCartStr=
"InCart";Deal.claimedStr="Claimed";Deal.expiredStr="Expired";Deal.waitInLineStr="WaitInLine";Deal.pendingAtcStr="PendingAddToCart";Deal.min=function(a){for(var c=arguments[0],b=1;b<arguments.length;b++)arguments[b]<c&&(c=arguments[b]);return c};Deal.max=function(a){for(var c=arguments[0],b=1;b<arguments.length;b++)arguments[b]>c&&(c=arguments[b]);return c};Deal.sortByAsinTimes=function(a,c){return a.status.purchaseStatus.expiresDate-c.status.purchaseStatus.expiresDate};Deal.filterAsinsByState=function(a,
c){for(var b=[],d=0;d<a.length;d++)for(var g=a[d],f=0;f<c.length;f++)if(g.status.purchaseStatus.state==c[f]){b.push(g);break}return b};Deal.stateAlertsEnum={ATC_EXPIRES_SOON:0,ATC_EXPIRED:1,WL_PATC:2,WL_PATC_EXPIRED:3,WL_SOLD_OUT:4,WL_DEAL_ENDED:5};Deal.pStateTypeEnum={CART:0,WAITLIST:1,EITHER:2,NO_ACTION:3};Deal.accessTypeEnum={PRIME_EARLY_ACCESS:"PRIME_EARLY_ACCESS",PRIME_ONLY_LD:"PRIME_ONLY_LD",PRIME_ONLY_DOTD:"PRIME_ONLY_DOTD",APP_EARLY_ACCESS:"APP_EARLY_ACCESS",APP_ONLY_LD:"APP_ONLY_LD"};Deal.pStateTypeMap=
{};Deal.pStateTypeMap[Deal.availableStr]=Deal.pStateTypeEnum.NO_ACTION;Deal.pStateTypeMap[Deal.inCartStr]=Deal.pStateTypeEnum.CART;Deal.pStateTypeMap[Deal.claimedStr]=Deal.pStateTypeEnum.NO_ACTION;Deal.pStateTypeMap[Deal.expiredStr]=Deal.pStateTypeEnum.EITHER;Deal.pStateTypeMap[Deal.waitInLineStr]=Deal.pStateTypeEnum.WAITLIST;Deal.pStateTypeMap[Deal.pendingAtcStr]=Deal.pStateTypeEnum.WAITLIST;Deal.Class=function(a,c){if(c===e)for(var b in c)a[b]=c[b];c=a&&a.__init__||function(){};c.prototype=a;return c};
Deal.Signal={methods:["connect","disconnectAll","signal"],init:function(a){var c,b;if(a.__signals__)throw Error("already registered");if(a.signals===e)throw Error("expected 'signals' attribute");for(c=0;c<this.methods.length;c++)if(b=this.methods[c],a[b]!==e)throw Error("method "+b+" is already defined");a.__signals__={};for(c=0;c<a.signals.length;c++)a.__signals__[a.signals[c]]={};for(c=0;c<this.methods.length;c++)b=this.methods[c],a[b]=this[b]},next_id:100,connect:function(a,c,b){var d=this;if(d.__signals__[a]===
e)throw Error("no such signal "+a);var g=Deal.Signal.next_id++,f={signals:["disconnect"],disconnect:function(){delete d.__signals__[a][g];this.signal("disconnect");this.disconnect=function(){}}};if(c instanceof Function)f.trigger=c;else{if(c[b]===e)throw Error("method '"+b+"' for obj "+c+" doesn't exist");if(!c[b]instanceof Function)throw Error("method '"+b+"' for obj "+c+" isn't a Function");f.trigger=function(){c[b].apply(c,arguments)}}d.__signals__[a][g]=f;Deal.Signal.init(f);return f},disconnectAll:function(a){var c;
if(a){if(this.__signals__[a]===e)throw Error("no such signal "+a);for(var b in this.__signals__[a])this.__signals__[a][b].disconnect()}else for(c in this.__signals__)this.disconnectAll(c)},signal:function(a){if(this.__signals__[a]===e)throw Error("no such signal "+a);var c=[],b=1;1==arguments.length&&(b=0);for(b;b<arguments.length;b++)c.push(arguments[b]);var b=[],d;for(d in this.__signals__[a]){var g=this.__signals__[a][d];try{g.trigger.apply(g,c)}catch(f){b.push(f)}}if(1<b.length)throw c=Error("multiple errors. See 'errors'"),
c.errors=b,c;if(1==b.length)throw b[0];}};Deal.Model={};Deal.Model.Metadata=Deal.Class({__init__:function(a,c){this.filters=a;for(var b in this.filters){a=this.filters[b];this.filters[b]={};for(var d=0;d<a.length;d++)this.filters[b][a[d]]=!0}this.orderings=c},get_deal_ids:function(a,c){a=this.filters[a];c=c?this.orderings[c]:[];var b=[],d={},g,f;for(g=0;g<c.length;g++)f=c[g],d[f]=!0,a[f]&&b.push(f);for(f in a)d[f]||b.push(f);return b}});Deal.Model.Deals=Deal.Class({__init__:function(a){this.deals=
{};for(var c=0;c<a.length;c++){var b=a[c];this.get_deal(b.dealID).load_from_deal(b)}},get_deal:function(a){this.deals[a]===e&&(this.deals[a]=new Deal.Model.Deal(a));return this.deals[a]}});Deal.Model.Deal=Deal.Class({signals:["change","expire","status_expire","pstatus_expires_soon","pstatus_expire"],__init__:function(a){Deal.Signal.init(this);this.dealID=a;this.timeouts={};this.expired=this.loading=!0;this.status={expired:!0};this.detail={};this.asins=[];this.asinExpiresSoonStack=[];this.asinExpiredStack=
[];this.purchaseStatusWarningThreshold=6E5},_init_status:function(a){var c=this;c.status.cacheExpiresDate=new Date(a.getTime()+parseInt(c.status.msToCacheExpires,10));c.status.expired=!1;c.status.startDate=new Date(a.getTime()+parseInt(c.status.msToStart,10));c.status.started=0>=c.status.msToStart;c.status.endDate=new Date(a.getTime()+parseInt(c.status.msToEnd,10));c.status.ended=0>=c.status.msToEnd;c.timeouts.start_timeout&&k.clearTimeout(c.timeouts.start_timeout);c.status.started||(c.timeouts.start_timeout=
n.delay(function(){c.status.started=!0;c.signal("change",c)},c.status.startDate.getTime()-(new Date).getTime()));c.timeouts.end_timeout&&k.clearTimeout(c.timeouts.end_timeout);c.status.ended||(c.timeouts.end_timeout=n.delay(function(){c.status.ended=!0;c.signal("change",c)},c.status.endDate.getTime()-(new Date).getTime()));c.timeouts.status_expire_timeout&&k.clearTimeout(c.timeouts.status_expire_timeout);c.timeouts.status_expire_timeout=n.delay(function(){c.status.expired=!0;c.signal("status_expire",
c)},c.status.cacheExpiresDate.getTime()-(new Date).getTime())},_init_asin_statuses:function(){var a=this;if(a.asins){for(var c=new Date,b=Deal.filterAsinsByState(a.asins,[Deal.inCartStr,Deal.expiredStr,Deal.waitInLineStr,Deal.pendingAtcStr]),d=0;d<b.length;d++){var g=b[d];a.purchaseStatusWarningThreshold&&(g.status.purchaseStatus.expiresDate=new Date(c.getTime()+parseInt(g.status.purchaseStatus.msToExpiry,10)))}b.sort(Deal.sortByAsinTimes);a.asinExpiresSoonStack=[];a.asinExpiredStack=[];for(d=0;d<
b.length;d++){g=b[d];a.timeouts.pstatus_exp_soon[g.asin]&&k.clearTimeout(a.timeouts.pstatus_exp_soon[g.asin]);var c=g.status.purchaseStatus.expiresDate.getTime()-(new Date).getTime(),f=c-a.purchaseStatusWarningThreshold;0>f&&(f=0);var e=""+g.asin;0<c&&g.status.purchaseStatus.state!=Deal.waitInLineStr&&g.status.purchaseStatus.state!=Deal.pendingAtcStr&&(a.asinExpiresSoonStack.push(e),a.timeouts.pstatus_exp_soon[e]=n.delay(function(){var b=a.asinExpiresSoonStack.shift();a.signal("pstatus_expires_soon",
a,b)},f));a.timeouts.pstatus_expire[g.asin]&&k.clearTimeout(a.timeouts.pstatus_expire[g.asin]);a.asinExpiredStack.push(e);a.timeouts.pstatus_expire[g.asin]=n.delay(function(){var b=a.asinExpiredStack.shift();a.signal("pstatus_expire",a,b);a.signal("change",a)},c)}}else Deal.log("No Asins, not initializing statuses.")},load_from_deal:function(a){var c=this,b=new Date,d;for(d in a)c[d]=a[d];c.loading=!1;c.startDate=new Date(1E3*c.startDate);c.endDate=new Date(1E3*c.endDate);c.cacheExpiresDate=new Date(b.getTime()+
parseInt(c.msToCacheExpires,10));c.expired=!1;c.timeouts.expire_timeout&&k.clearTimeout(c.timeouts.expire_timeout);c.timeouts.expire_timeout=n.delay(function(){c.expired=!0;c.signal("expire",c)},c.cacheExpiresDate.getTime()-(new Date).getTime());c.limitedQuantity="1"==c.limitedQuantity;c.customer&&(c.customer.claimed="1"==c.customer.claimed);if(c.asins)for(c.timeouts.pstatus_exp_soon||(c.timeouts.pstatus_exp_soon={}),c.timeouts.pstatus_expire||(c.timeouts.pstatus_expire={}),a=0;a<c.asins.length;a++)c.asins[a].offerServiceSoldOut=
"1"==c.asins[a].offerServiceSoldOut;c._init_status(b);c._init_asin_statuses();c.signal("change",c)},load_from_status:function(a){this.status=a;this._init_status(new Date);this.signal("change",this)},load_from_asin_status:function(a){if(null!=this.asins&&null!=a){for(var c=a.asin,b=0;b<this.asins.length;b++)if(this.asins[b].asin==c){this.asins[b].status=a;break}this._init_asin_statuses();this.signal("change",this)}},setPurchaseStatusWarningThreshold:function(a){self.purchaseStatusWarningThreshold=
0<a?a:12E4},getPurchaseStatusWarningThreshold:function(){return this.purchaseStatusWarningThreshold},load_from_deal_dao:function(a){this.loading=!1;this.marketplaceID=a.detail.marketplaceID;null!==a.auxiliaryData.merchantDetails&&a.auxiliaryData.merchantDetails!==e&&(this.merchantID=a.auxiliaryData.merchantDetails.merchantID,this.merchantName=a.auxiliaryData.merchantDetails.merchantName);var c=a.auxiliaryData.reviewData;c&&(this.reviews={},this.reviews.URL=c.reviewsURL,this.reviews.total=c.totalReviews,
this.reviews.rating=c.averageRating);this.dealID=a.dealID;this.startDate=a.status.startDate;this.endDate=a.status.endDate;this.limitedQuantity=a.isLimitedQuantity;this.parentAsin=a.parentAsin;this.msToCacheExpires=a.status.msToCacheExpires;this.cacheExpiresDate=a.status.cacheExpiresDate;this.expired=a.expired;this.status={marketplaceID:a.detail.marketplaceID,dealID:a.dealID,percentClaimed:a.status.percentClaimed,msToStart:a.status.msToStart,startDate:a.status.startDate,started:a.status.started,msToEnd:a.status.msToEnd,
endDate:a.status.endDate,ended:a.status.ended,msToCacheExpires:a.status.msToCacheExpires,cacheExpiresDate:a.status.cacheExpiresDate,expired:a.status.expired};this.detail={marketplaceID:a.detail.marketplaceID,dealID:a.dealID,title:a.detail.title,description:a.detail.description,imageAsin:a.detail.imageAsin,url:a.detail.URL,buyBoxUrl:a.detail.buyBoxURL};this.asins=[];for(var c=a.dealAsins,b=0;b<c.length;b++){var d=c[b];this.asins.push({marketplaceID:a.detail.marketplaceID,dealID:a.dealID,asin:d.ASIN,
basisPrice:d.basisPrice,basisKind:d.basisKind,dealPrice:d.dealPrice,percentOff:d.percentOff,offerServiceSoldOut:d.status.offerServiceSoldOut,variationData:d.variationData,imageURL:d.imageURL,status:{marketplaceID:a.detail.marketplaceID,dealID:a.dealID,asin:d.ASIN,percentClaimed:d.status.percentClaimed,percentSoldOut:d.status.percentSoldOut,itemState:d.status.itemState,offerServiceSoldOut:d.status.offerServiceSoldOut,currentlyUnavailable:d.status.currentlyUnavailable,purchaseStatus:{state:d.status.state,
msToExpiry:d.status.msToExpiry}}})}this.customer={marketplaceID:a.detail.marketplaceID,dealID:a.dealID,customerID:a.customerID,claimed:a.claimed}},load_status_from_deal_dao:function(a){var c=this,b=new Date;c.load_from_deal_dao(a);c.timeouts.expire_timeout&&k.clearTimeout(c.timeouts.expire_timeout);c.cacheExpiresDate&&(c.timeouts.expire_timeout=n.delay(function(){c.expired=!0;c.signal("expire",c)},c.cacheExpiresDate.getTime()-(new Date).getTime()));c.asins&&(c.timeouts.pstatus_exp_soon||(c.timeouts.pstatus_exp_soon=
{}),c.timeouts.pstatus_expire||(c.timeouts.pstatus_expire={}));c._init_status(b);c._init_asin_statuses();c.signal("change",c)}});Deal.Controller=Deal.Class({signals:["cell_change","page_change","metadata_change"],__init__:function(a){Deal.Signal.init(this);this.login_uri=a.login_uri;this.images=a.images;this.buying={};this.deals=new Deal.Model.Deals(a.deals);this.metadata=new Deal.Model.Metadata(a.filters,a.orderings);this.browseNodes=a.browseNodes;this.ordering=a.ordering;this.varPopCloseFunction=
null;this.connections=[];this.cells=1;this.cell_to_deal={};this.deal_id_to_cell={};this.pages=this.page=1;this.order=this.filter=e;this.deal_ids=[]},closeVarPopover:function(){this.varPopCloseFunction&&this.varPopCloseFunction()},setVarPopCloseFunction:function(a){this.closeVarPopover();this.varPopCloseFunction=a},_calc_deal_ids:function(){this.deal_ids=this.metadata.get_deal_ids(this.filter,this.order);this._calc_pages()},_calc_pages:function(){this.pages=Math.ceil(this.deal_ids.length/this.cells)},
disconnect_all:function(){for(var a=0;a<this.connections.length;a++)this.connections[a].disconnect();this.connections=[]}});Deal.DOM={set_attributes:function(a,c){for(var b in c)"style"==b?a.style.cssText=c[b]:a[{"class":"className",checked:"defaultChecked",usemap:"useMap","for":"htmlFor",readonly:"readOnly",colspan:"colSpan",bgcolor:"bgColor",cellspacing:"cellSpacing",cellpadding:"cellPadding",valign:"vAlign",nowrap:"noWrap"}[b]||b]=c[b]},el:function(a,c,b){a=document.createElement(a);c&&Deal.DOM.set_attributes(a,
c);b&&this.appendChildren(a,b);return a},img:function(a){a=a||{};a.border=a.border||0;return this.el("img",a)},div:function(a,c){return this.el("div",a,c)},span:function(a,c){return this.el("span",a,c)},p:function(a,c){return this.el("p",a,c)},a:function(a,c){return this.el("a",a,c)},table:function(a,c){a||(a={});a.cellpadding=a.cellpadding||0;a.cellspacing=a.cellspacing||0;a.border=a.border||0;return this.el("table",a,[this.el("tbody",null,c)])},tr:function(a,c){return this.el("tr",a,c)},td:function(a,
c){return this.el("td",a,c)},td_nowrap:function(a,c){return this.el("td",a,[this.span({style:"white-space:nowrap"},c)])},br:function(a,c){return this.el("br",a,c)},hr:function(a){return this.el("hr")},select:function(a,c){return this.el("select",a,c)},option:function(a,c){return this.el("option",a,c)},appendChildren:function(a,c){for(var b=0;b<c.length;b++){var d=c[b];if("string"==typeof d||"number"==typeof d)d=this.text(d);else if(d instanceof Array){this.appendChildren(a,d);continue}else if(null===
d||d===e)continue;a.appendChild(d)}},clearChildren:function(a){for(;a.firstChild;)a.removeChild(a.firstChild)},replaceChildren:function(a,c){this.clearChildren(a);this.appendChildren.call(this,a,c)},text:function(a){return document.createTextNode(a)}};Deal.Widget={};Deal.Widget.preload_img=function(a){Deal.Widget.preload_img.div||(Deal.Widget.preload_img.div=Deal.DOM.div({style:"display:none"}));Deal.Widget.preload_img.div.appendChild(Deal.DOM.img({src:a}))};Deal.clock={signals:["tick"]};Deal.Signal.init(Deal.clock);
Deal.clock.tick=function(){Deal.clock.signal("tick")};n.interval(Deal.clock.tick,250)}()});l.when("A").execute("gb-udp-utilities",function(n){Deal.constants={WIDGET_ID_START:100,GET_DEALS_MAX_JITTER:2,NON_RETRYABLE_QUANTITY_RESTRICTION_VIOLATION_ERROR:"4002"};Deal.rankingStrategies={PERSONALIZED:"PERSONALIZED",CLAIMED_RATE:"CLAIMED_RATE",TRENDING:"TRENDING",NEW_TO_GL_EXCLUSIVE:"NEW_TO_GL_EXCLUSIVE",NEW_TO_GL_INCLUSIVE:"NEW_TO_GL_INCLUSIVE"};Deal.statusFilters={AVAILABLE:"available",UPCOMING:"upcoming",
MISSED:"missed"};Deal.availableStr="Available";Deal.inCartStr="InCart";Deal.claimedStr="Claimed";Deal.expiredStr="Expired";Deal.waitInLineStr="WaitInLine";Deal.waitlistFullStr="WaitlistFull";Deal.pendingAtcStr="PendingAddToCart";Deal.dealTypes={BD:"BEST_DEAL",LD:"LIGHTNING_DEAL",DOTD:"DEAL_OF_THE_DAY",LOCAL:"LOCAL_DEAL",COUPON:"COUPON_DEAL"};Deal.savingsBasisKind={LIST_PRICE:"LP",OUR_PRICE:"OP",PREV_PUBLISHED_PRICE:"PPP",UVP_LIST_PRICE:"ULP",ORIGINAL_EDITION_PRICE:"OEP",RETAIL_PREV_PRICE:"REP",SEPARATE_PURCHASE_LIST_PRICE:"SPLP",
DIGITAL_LIST_PRICE:"DLP",PRINT_LIST_PRICE:"PLP",UNRECOGNIZED:"UNR"};Deal.categoryFilters={ALL:"all"};Deal.dealStateEnum={Available:1,Variation:2,WaitListed:3,WaitListFull:4,WaitListOnly:5,Claimed:6,InCart:7,PendingAddToCart:8,LearnMore:9,ClipCoupon:10,ViewDeal:11,Upcoming:12,SoldOut:13,Expired:14,InvalidPurchaseState:-1};Deal.itemTypes={SingleItem:"SINGLE_ITEM",MultiItem:"MULTI_ITEM",ContentOnly:"CONTENT_ONLY"};Deal.itemStates={Available:"AVAILABLE",Soldout:"SOLDOUT",Expired:"EXPIRED",Upcoming:"UPCOMING",
Waitlist:"WAITLISTAVAILABLE",WaitlistFull:"WAITLISTFULL",Suppressed:"SUPPRESSED"};Deal.responseItemTypeToItemType={NONE:"CONTENT_ONLY",SINGLE_ITEM:"SINGLE_ITEM",MULTI_ITEM:"MULTI_ITEM",VARIATION_ITEM:"MULTI_ITEM"};Deal.clientActions={ADD_TO_CART:"A",JOIN_WAITLIST:"J",LEARN_MORE:"L",TITLE:"T",IMAGE:"P",REVIEWS:"R",DISCUSSION_BOARD:"D",IMPRESSION:"I"};Deal.purchaseTypes={ADD_TO_CART:"add_to_cart",JOIN_WAITLIST:"join_waitlist"};Deal.stateBasedSubTemplates={available:"image price_block title checking_deal_status prime progress_bar percent_claimed prime_early_access time_remaining prime_only_access claimed reviews state variation_status_message button description total_coupons_count share_bar geo_display_location merchant_name deal_action_content deal_status_content badge fast_track".split(" "),
expired:"image price_block title prime progress_bar percent_claimed claimed reviews state button total_coupons_count merchant_name description geo_display_location deal_action_content deal_status_content badge".split(" "),soldout:"image price_block title prime progress_bar percent_claimed claimed reviews button total_coupons_count merchant_name description deal_action_content".split(" "),coming_soon:"image title merchant_name share_bar reviews prime description badge".split(" "),upcoming:"image teaser starts_in description early_access_message prime_only_message".split(" "),
loading:["checking_deal_status","available"],empty:[]};Deal.stateToTemplateMap={Available:"available",SoldOut:"soldout",Expired:"expired",Upcoming:"upcoming",Loading:"loading",ComingSoon:"coming_soon",Waitlist:"available",WaitlistFull:"available"};Deal.dealStates={AVAILABLE:"Available",SOLDOUT:"SoldOut",EXPIRED:"Expired",UPCOMING:"Upcoming",WAITLIST:"Waitlist",WAITLISTAVAILABLE:"Waitlist",WAITLISTFULL:"WaitlistFull"};Deal.customerStates={NONE:Deal.availableStr,INCART:Deal.inCartStr,CLAIMED:Deal.claimedStr,
INWAITLIST:Deal.waitInLineStr,PENDINGATC:Deal.pendingAtcStr,EXPIRED:Deal.expiredStr};Deal.itemStateToPurchaseStateMap={AVAILABLE:Deal.dealStateEnum.Available,WAITLIST:Deal.dealStateEnum.WaitListOnly,WAITLISTED:Deal.dealStateEnum.WaitListed,WAITLISTFULL:Deal.dealStateEnum.WaitListFull,WAITLISTONLY:Deal.dealStateEnum.WaitListOnly,WAITLISTAVAILABLE:Deal.dealStateEnum.WaitListOnly,UPCOMING:Deal.dealStateEnum.Upcoming,SOLDOUT:Deal.dealStateEnum.SoldOut,EXPIRED:Deal.dealStateEnum.Expired};Deal.customerStateToPurchaseStateMap=
{AVAILABLE:Deal.dealStateEnum.Available,CLAIMED:Deal.dealStateEnum.Claimed,INCART:Deal.dealStateEnum.InCart,PENDINGADDTOCART:Deal.dealStateEnum.PendingAddToCart,PENDINGATC:Deal.dealStateEnum.PendingAddToCart,INWAITLIST:Deal.dealStateEnum.WaitListed,EXPIRED:Deal.dealStateEnum.Expired};Deal.apiName={GET_DEAL_METADATA:"GetDealMetadata",GET_DEALS:"GetDeals",GET_DEAL_STATUS:"GetDealStatus",REDEEM_DEAL:"RedeemDeal",CLAIM_DEAL:"ClaimDeal"};Deal.apiShortName={GET_DEAL_STATUS:"GDS",CLAIM_DEAL:"CD"};Deal.Class=
function(a,c){if(c!==e)for(var b in c)a[b]=c[b];c=a&&a.__init__||function(){};c.prototype=a;return c};Deal.log=function(a){k.gbResources!==e&&null!==k.gbResources&&k.gbResources.getDealDebug()&&(a=new Date+": "+a,k.console&&k.console.log(a))};Deal.parseBool=function(a){return!0===a||1===a||"1"===a};Deal.getRandomNumber=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};Deal.areNestedKeysPresent=function(a,c){if(!_.isObject(a)||!_.isString(c))return!1;c=c.split(".");for(var b=0;b<c.length;b++){if(!a||
!a.hasOwnProperty(c[b]))return!1;a=a[c[b]]}return!0};Deal.checkIfDealExpired=function(a){return a===e||null===a?!1:a.status!==e&&null!==a.status&&a.status.msToEnd!==e&&null!==a.status.msToEnd&&0>=a.status.msToEnd||a.status.ended!==e&&null!==a.status.ended&&a.status.ended||a.status.endDate!==e&&null!==a.status.endDate&&a.status.endDate<new Date?!0:!1};Deal.sortByAsinTimes=function(a,c){return a.status.purchaseStatus.expiresDate-c.status.purchaseStatus.expiresDate};Deal.sortByDealAsinDAOTimes=function(a,
c){return a.status.expiresDate-c.status.expiresDate};Deal.setSafeTimeout=function(a,c){return a===e||null===a||c===e||null===c?(Deal.log("Cannot setTimeout on undefined/null fn/timeout."),null):2147483647<c?n.delay(a,1073741823):n.delay(a,10)};Deal.objectsIdentical=function(a,c){return a===e||c===e?(Deal.log("Cannot check for objectsIdentical for undefined requestArgs."),!1):_.isEqual(a,c)};Deal.filterAsinsByState=function(a,c){var b=[];_.each(a,function(a){_.each(c,function(c){a.status.purchaseStatus.state===
c&&b.push(a)})});return b};Deal.filterAsinsHashByState=function(a,c){var b=[];_.each(a,function(a){_.each(c,function(c){a.status.state===c&&b.push(a)})});return b};Deal.filterDealIdsByParams=function(a,c){var b=[];if(null===a||a===e||null===c||c===e)return b;for(var d=0;d<a.length;d++){var g=a[d];g in c&&(b=_.union(b,c[g]))}return b};Deal.getPaginationCellPositions=function(a,c,b,d){var g=[];a&&c&&b&&(g=1,d||(g=Math.ceil(b/c)),g=3>=g?_.range(0,b<g*c?b:g*c):1==a?_.union(_.range(0,2*c),_.range((g-1)*
c,b)):_.range((a-2)*c,b<(a+1)*c?b:(a+1)*c));return g};Deal.getCrypticPrice=function(a){return _.isNumber(a)?a.toString().split("").map(function(a){return String.fromCharCode(a.charCodeAt(0)+17).replace("?","X")}).join(""):null};Deal.hasPricingDetails=function(a){var c=!1;a=a.pricingData.dealPriceHash.max.price||a.pricingData.dealPriceHash.min.price;a!==e&&null!==a&&(c=!0);return c};Deal.Price={currencies:{USD:{decimals:2,format:function(a){return"$"+a}},MXN:{decimals:2,format:function(a){return"$"+
a}},BRL:{decimals:2,format:function(a){return"R$ "+a}},GBP:{decimals:2,format:function(a){return"\x26pound;"+a}},EUR:{decimals:2,format:function(a){return(a+" \x26euro;").replace(".",",")}},TRY:{decimals:2,format:function(a){return(a+" TL").replace(".",",")}},JPY:{decimals:0,format:function(a){return"\x26yen; "+a}},AUD:{decimals:2,format:function(a){return"$"+a}},CNY:{decimals:2,format:function(a){return"\x26yen;"+a}},CAD:{decimals:2,format:function(a){return("C$"+a).replace(",","")}},INR:{decimals:2,
format:function(a){return"\x26#8377;"+a}},other:{decimals:2,format:function(a){return a+" "+a.currency}}},make_price:function(a,c){return{currency:a,price:c}},test_same_currency:function(a,c){if(a.currency!=c.currency)throw Error("Currencies don't match: "+a.currency+" and "+c.currency);},minus:function(a,c){if(!a||!c)return e;this.test_same_currency(a,c);return this.make_price(a.currency,a.price-c.price)},percent_off:function(a,c){if(!a||!c||null===a.price||a.price===e||null===c.price||c.price===
e||0===c.price)return null;this.test_same_currency(a,c);var b=a.price-c.price;if(0>=b)return null;c=0;"CN"==gbResources.getCustomerData("realm")?(c=1,a=10*(1-b/a.price)):a=100*b/a.price;return Math.round(a*Math.pow(10,c))/Math.pow(10,c)},displayable_percent_off:function(a){return a&&"number"===typeof a?"CN"==gbResources.getCustomerData("realm")?(100-a)/10:a:null},format:function(a,c){if(!a)return c;c=this.currencies[a.currency]||this.currencies.other;a=c.format(Deal.commify(a.price,c.decimals));c=
Deal.DOM.span();c.innerHTML=a;return c.innerText||c.textContent},getEmptyPriceHash:function(){return{price:null,formattedPrice:null,currency:null}},getEmptyPriceObject:function(){return{maxBasisPrice:Deal.Price.getEmptyPriceHash(),minBasisPrice:Deal.Price.getEmptyPriceHash(),maxDealPrice:Deal.Price.getEmptyPriceHash(),minDealPrice:Deal.Price.getEmptyPriceHash()}},isEmptyPriceObject:function(a){var c=Deal.Price.getEmptyPriceObject();return _.isEqual(a,c)?!0:!1},findMaxMinPrices:function(a,c){if(a===
e||!a)return Deal.log("Cannot findMaxMinPrices on undefined/null deal obj"),{};if(!a.dealAsinsHash)return Deal.log("Cannot operate on undefined/null dealAsinsHash"),{};var b=null,d=null,g=null,f=null,m;for(m in a.dealAsinsHash){var p=a.dealAsinsHash[m];p.basisPrice&&(null===b?b=p.basisPrice:b.price<p.basisPrice.price&&(b=p.basisPrice),null===d?d=p.basisPrice:d.price>p.basisPrice.price&&(d=p.basisPrice));p.dealPrice&&(null===g?g=p.dealPrice:g.price<p.dealPrice.price&&(g=p.dealPrice),null===f?f=p.dealPrice:
f.price>p.dealPrice.price&&(f=p.dealPrice))}a.dealAsins&&0===a.dealAsins.length&&c&&c.currencyCode&&(null!==c.maxBAmount&&c.maxBAmount!==e&&null!==c.minBAmount&&c.minBAmount!==e&&(b={price:parseFloat(c.maxBAmount),currency:c.currencyCode},d={price:parseFloat(c.minBAmount),currency:c.currencyCode}),null!==c.maxDealPrice&&c.maxDealPrice!==e&&null!==c.minDealPrice&&c.minDealPrice!==e&&(g={price:parseFloat(c.maxDealPrice),currency:c.currencyCode},f={price:parseFloat(c.minDealPrice),currency:c.currencyCode}));
a=Deal.Price.getEmptyPriceObject();null!==b&&(a.maxBasisPrice={price:b.price,currency:b.currency,formattedPrice:Deal.Price.format(b)});null!==d&&(a.minBasisPrice={price:d.price,currency:d.currency,formattedPrice:Deal.Price.format(d)});null!==g&&(a.maxDealPrice={price:g.price,currency:g.currency,formattedPrice:Deal.Price.format(g)});null!==f&&(a.minDealPrice={price:f.price,currency:f.currency,formattedPrice:Deal.Price.format(f)});return a},hasPriceData:function(a){return a===e||null===a||a.max===e||
null===a.max||a.max.price===e||null===a.max.price||a.min===e||null===a.min||a.min.price===e||null===a.min.price||a.min.price>a.max.price?!1:!0},compareTo:function(a,c){if(a===e||null===a||c===e||null===c)return Deal.log("Cannot do compareTo on undefined/null prices"),2;var b=2;try{a==c?b=0:a>c?b=1:a<c&&(b=-1)}catch(d){Deal.log("Error caught during attempting compareTo"+d)}return b},maxEqualMin:function(a){return a!==e&&a?0===Deal.Price.compareTo(a.max.price,a.min.price)?!0:!1:(Deal.log("Cannot check if an undefined/null object has pricedata."),
!1)}};Deal.commify=function(a,c){a=parseFloat(a);a=c!==e?a.toFixed(c):a.toString();a=a.split(".");c=a[0];for(var b=c.length-3;0<b;b-=3)c=c.substr(0,b)+","+c.substr(b,c.length-b);return 2==a.length?c+"."+a[1]:c};Deal.amabotParams={pf_rd_p:"placementID",pf_rd_s:"slotName",pf_rd_t:"pageType",pf_rd_i:"pageIndent",pf_rd_m:"merchantID",pf_rd_r:"requestID"};Deal.reverseMapAmabotParams={placementID:"pf_rd_p",slotName:"pf_rd_s",pageType:"pf_rd_t",pageIndent:"pf_rd_i",merchantID:"pf_rd_m",requestID:"pf_rd_r"};
Deal.addAmabotRecordClickParameters=function(a,c){if(!a||!c)return Deal.log("Cannot add amabot record click params for undefined/null uri/params."),a;var b=Deal.reverseMapAmabotParams;c.merchantID&&(a=Deal.param_appender(a,b.merchantID+"\x3d"+c.merchantID));c.pageType&&(a=Deal.param_appender(a,b.pageType+"\x3d"+c.pageType));c.slotName&&(a=Deal.param_appender(a,b.slotName+"\x3d"+c.slotName));c.requestID&&(a=Deal.param_appender(a,b.requestID+"\x3d"+c.requestID));c.pageIndent&&(a=Deal.param_appender(a,
b.pageIndent+"\x3d"+c.pageIndent));c.placementID&&(a=Deal.param_appender(a,b.placementID+"\x3d"+c.placementID));return a};Deal.getSlotRefTag=function(a){if(!a)return Deal.log("Cannot get slot ref tag for undefined/null amabotParams."),"";if(a.slotName===e||null===a.slotName)return Deal.log("Cannot get slot ref tag for undefined/null slotName."),"";a=a.slotName;return 4>a.length?a+"_":a.substring(0,1)+a.substring(a.length-2,a.length)+"_"};Deal.getPlacementID=function(a){if(!a)return Deal.log("Cannot get placement id for undefined/null amabotParams."),
"";if(a.placementID===e||null===a.placementID)return Deal.log("Cannot get placement id for undefined/null slotName."),"";a=a.placementID;return 5>a.length?a+"_":a.substring(a.length-4,a.length)+"_"};Deal.addRefTag=function(a,c){var b=/^(.*)\?(.*)$/,d=/^(.*)#(.*)$/,g=/^(.*)\/$/,f=/^(.*)$/;c="ref\x3d"+c;b.test(a)?(g="/",/.*\/\?/.test(a)&&(g=""),a=a.replace(b,"$1"+g+c+"?$2")):d.test(a)?(g="/",/.*\/#/.test(a)&&(g=""),a=a.replace(d,"$1"+g+c+"#$2")):a=g.test(a)?a.replace(g,"$1/"+c):a.replace(f,"$1/"+c);
return a};Deal.param_appender=function(a,c){if(!a||!c)return Deal.log("Cannot apend refTags for undefined/null URI/refTag"),"";var b="?";a.match(/\?/)&&(b="?"===a.charAt(a.length-1)?"":"\x26");return a+b+c};Deal.getWidgetCDSRef=function(a){var c=Deal.controller.getAmabotParams(a);a=Deal.configManager[Deal.controller.widgetIdToWidgetNameMap[a]].widgetViewConfig.clickStreamRefMarker;_.isEmpty(c)||(a=a+"_"+Deal.getSlotRefTag(c),a+=Deal.getPlacementID(c));return a};Deal.shouldRecordClickAction=function(a){return null===
a||a===e?!1:Deal.controller.getDeal(a).impressionAsin?!0:!1};Deal.checkAndSetSSLImageUrl=function(a){if(null===a)return a;if("https:"===k.location.protocol){var c="images-na.ssl-images-amazon.com";"CN"===gbResources.getCustomerData("realm")&&(c="images-cn.ssl-images-amazon.com");var b=document.createElement("a");b.href=a;b.protocol="https:";b.hostname=c;a=b.href}return a};Deal.findBackBoneDealAsin=function(a,c){return a&&a.dealAsinsHash?_.find(a.dealAsinsHash,function(b){return!c||b.ASIN===c})||null:
null};Deal.PurchaseStatusGatherer=Deal.Class({__init__:function(a){a&&(this.deal=a,this.now=new Date,this.timeSensitiveStates={},this.timeSensitiveStates[Deal.inCartStr]=1,this.timeSensitiveStates[Deal.pendingAtcStr]=1,this.stateAsins={},this.gatherStates())},gatherStates:function(){if(this.deal&&this.deal.dealAsinsHash){for(var a in this.deal.dealAsinsHash){var c=this.deal.dealAsinsHash[a];if(c&&c.status){var b=c.status.state;b&&(this.stateAsins[b]===e&&(this.stateAsins[b]=[]),this.timeSensitiveStates[b]!==
e&&c&&c.status&&null!==c.status.expiresDate&&c.status.expiresDate<=this.now||this.stateAsins[b].push(c))}}for(var d in this.timeSensitiveStates)this.stateAsins[d]!==e&&null!==this.stateAsins[d]&&this.stateAsins[d].sort(Deal.sortByPurchaseStatusExpirations)}},hasTimeSensitiveState:function(){if(this.stateAsins===e||null===this.stateAsins)return Deal.log("Cannot check if a timesensitive stateexists on undefined/null stateAsins."),!1;var a=!1,c;for(c in this.stateAsins)if((c===Deal.inCartStr||c===Deal.pendingAtcStr||
c===Deal.waitInLineStr)&&this.stateAsins[c]!==e&&null!==this.stateAsins[c]&&0<this.stateAsins[c].length){a=!0;break}return a},getStateDisplayData:function(){var a={},c=!1,b=0,d;for(d in this.stateAsins){a[d]===e&&(a[d]=[]);d!=Deal.availableStr&&d!=Deal.expiredStr&&d!=Deal.claimedStr&&0<this.stateAsins[d].length&&(c=!0);var g=this.stateAsins[d],f;for(f=0;f<g.length;f++){b++;var m=g[f],p={asin:m.ASIN};1==this.timeSensitiveStates[d]&&m.status!==e&&m.status.expiresDate!==e&&(p.expiresDate=m.status.expiresDate);
a[d].push(p)}}a.hasActionableStatus=c;a.totalAsins=b;return a}});Deal.sortByPurchaseStatusExpirations=function(a,c){return a.status.expiresDate-c.status.expiresDate};Deal.UDPTimer=function(a,c,b){var d={};d.t=a;d.span=null;d.onTimeoutFunction=null;d.setOnTimeoutFunction=function(b){d.onTimeoutFunction=b};d.update=function(){var a=Deal.max(d.t.getTime()-(new Date).getTime(),0);if(0>=a){if(d.disconnect(),null!=d.onTimeoutFunction)d.onTimeoutFunction()}else d.timeString=Deal.getUDPTimeString(a,c,b),
null!=d.span&&d.span!=e&&(0<d.span.length?d.span.html(d.timeString):(l.when("A").execute(function(b){l.log("Price Block markup dump using A.$ - "+b.$("#price").html(),"WARN","GoldboxUDPAssets");l.log("A.$ Version - "+b.$.fn.jquery,"WARN","GoldboxUDPAssets")}),l.when("jQuery").execute(function(b){l.log("Price Block markup dump using jQuery - "+b("#price").html(),"WARN","GoldboxUDPAssets");l.log("jQuery Version - "+b.fn.jquery,"WARN","GoldboxUDPAssets")})))};d.disconnect=function(){d.cx.disconnect()};
d.cx=Deal.clock.connect("tick",d.update);d.update();return d};Deal.getUDPTimeString=function(a,c,b){var d=Math.floor(a/864E5),g=Math.floor(a/36E5),f=Math.floor(a/6E4%60);a=Math.floor(a/1E3%60);var e=gbResources.getString("gbd_ends_in_label"),p=gbResources.getString("gbd_prime_starts_in_label"),q=gbResources.getString("gb_starts_in"),r=gbResources.getString("gbd_hour_label"),n=gbResources.getString("gbd_min_label"),k=gbResources.getString("gbd_sec_label"),l=gbResources.getString("gbld-lbl-one-day"),
v=gbResources.getString("gbld-lbl-days");b=c?" ":b.detail.accessType===Deal.accessTypeEnum.PRIME_EARLY_ACCESS&&Deal.isDealInEarlyAccessWindow(b)&&!gbResources.getCustomerData("hasEarlyAccessBenefit")?p+" ":b.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS&&Deal.isDealInEarlyAccessWindow(b)?gbResources.getCustomerData("isApp")&&gbResources.getCustomerData("isMobile")?e+" ":q+" ":e+" ";0==c?(c=""!==l&&""!==v)&&1<d?b+=d+" "+v:c&&1==d?b+=l:(b=10>g?b+("0"+g+r+" "):b+(g+r+" "),b=10>f?b+("0"+f+
n+" "):b+(f+n+" "),b=10>a?b+("0"+a+k):b+(a+k)):(b+=f+":",b=10>a?b+("0"+a):b+a);return b};Deal.getOfferListingID=function(a,c){return a===e||null===a||a.dealAsinsHash===e||null===a.dealAsinsHash||a.dealAsinsHash[c]===e||null===a.dealAsinsHash[c]?a.offerListingID===e||null===a.offerListingID?null:a.offerListingID:a.dealAsinsHash[c].offerID};Deal.ConvertToPaladinUrl=function(a){return a===e||null===a?null:a.replace(/^https?:\/\/[a-z0-9\.\-]*\.amazon.com\//i,k.location.protocol+"//"+k.location.host+"/")};
Deal.digitalCategories={US:"16261631 2350149011 154606011 163856011 979455011 1233514011 2402172011".split(" ")};Deal.BookCategories={CN:["658390051"]};Deal.hasDigitalCategory=function(a){var c=gbResources.getCustomerData("realm");return _.intersection(a,Deal.digitalCategories[c]).length?!0:!1};Deal.getWhitelistedBookCategories=function(){var a=gbResources.getCustomerData("realm");return Deal.BookCategories[a]||[]};Deal.isDealInEarlyAccessWindow=function(a){var c=!1;a.detail&&(a.detail.accessType===
Deal.accessTypeEnum.PRIME_EARLY_ACCESS||a.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS)&&a.status&&0>=a.status.msToStart&&-a.status.msToStart<a.detail.accessDurationInMs&&(c=!0);return c};Deal.isPrimeEarlyAccessDeal=function(a){var c=!1;a.detail&&a.detail.accessType===Deal.accessTypeEnum.PRIME_EARLY_ACCESS&&(c=!0);return c};Deal.isPrimeOnlyDeal=function(a){var c=!1;!a.detail||a.detail.accessType!==Deal.accessTypeEnum.PRIME_ONLY_LD&&a.detail.accessType!==Deal.accessTypeEnum.PRIME_ONLY_DOTD&&
a.detail.accessType!==Deal.accessTypeEnum.PRIME_ONLY_BD||(c=!0);return c};Deal.isPrimeOnlyDotd=function(a){var c=!1;a.detail&&a.detail.accessType===Deal.accessTypeEnum.PRIME_ONLY_DOTD&&(c=!0);return c};Deal.getEarlyAccessEndTime=function(a){return new Date(a.detail.accessDurationInMs+a.status.startDate.getTime())};Deal.setURLParameter=function(a,c,b){if(a){var d=a.indexOf("#"),g=-1===d?"":a.substr(d);a=-1===d?a:a.substr(0,d);var d=new RegExp("([?\x26])"+c+"\x3d.*?(\x26|$)","i"),f=-1!==a.indexOf("?")?
"\x26":"?";a=a.match(d)?a.replace(d,"$1"+c+"\x3d"+b+"$2"):a+f+c+"\x3d"+b;return a+g}return null};Deal.getParameterByName=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?\x26]"+a+"\x3d([^\x26#]*)")).exec(location.search);return null===a?"":decodeURIComponent(a[1].replace(/\+/g," "))};Deal.isPEAEnabledMarketplace=function(a){return"US"===a||"UK"===a||"CA"===a||"DE"===a||"FR"===a||"ES"===a||"IT"===a||"JP"===a};Deal.incrementCounter=function(a){a&&k.ue&&"function"===typeof k.ue.count&&
ue.count(a,(ue.count(a)||0)+1)};Deal.setCounter=function(a,c){a&&k.ue&&"function"===typeof k.ue.count&&ue.count(a,c)};Deal._generateAPIMetricName=function(a){if(!a)return null;var c="goldbox";a.apiName&&(c+=":"+a.apiName,a.apiVersion&&(c+=":"+a.apiVersion));c+=":"+(a.isSuccess?"success":"error");c+=":"+(a.isRetry?"retry":"noretry");a.clientId&&(c+=":"+a.clientId);return c.toLowerCase()};Deal.recordAPIMetrics=function(a){if(a){var c=Deal._generateAPIMetricName(a);Deal.incrementCounter(c);a.latency&&
Deal.setCounter(c+":time",a.latency)}}});(function(){function e(b,a,c){if(b===a)return 0!==b||1/b==1/a;if(null==b||null==a)return b===a;b._chain&&(b=b._wrapped);a._chain&&(a=a._wrapped);if(b.isEqual&&h.isFunction(b.isEqual))return b.isEqual(a);if(a.isEqual&&h.isFunction(a.isEqual))return a.isEqual(b);var d=p.call(b);if(d!=p.call(a))return!1;switch(d){case "[object String]":return b==String(a);case "[object Number]":return b!=+b?a!=+a:0==b?1/b==1/a:b==+a;case "[object Date]":case "[object Boolean]":return+b==
+a;case "[object RegExp]":return b.source==a.source&&b.global==a.global&&b.multiline==a.multiline&&b.ignoreCase==a.ignoreCase}if("object"!=typeof b||"object"!=typeof a)return!1;for(var g=c.length;g--;)if(c[g]==b)return!0;c.push(b);var g=0,f=!0;if("[object Array]"==d){if(g=b.length,f=g==a.length)for(;g--&&(f=g in b==g in a&&e(b[g],a[g],c)););}else{if("constructor"in b!="constructor"in a||b.constructor!=a.constructor)return!1;for(var m in b)if(h.has(b,m)&&(g++,!(f=h.has(a,m)&&e(b[m],a[m],c))))break;
if(f){for(m in a)if(h.has(a,m)&&!g--)break;f=!g}}c.pop();return f}var a=this,c=a._,b={},d=Array.prototype,g=Object.prototype,f=d.slice,m=d.unshift,p=g.toString,q=g.hasOwnProperty,r=d.forEach,k=d.map,l=d.reduce,y=d.reduceRight,v=d.filter,x=d.every,t=d.some,z=d.indexOf,F=d.lastIndexOf,g=Array.isArray,J=Object.keys,A=Function.prototype.bind,h=function(b){return new w(b)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=h),exports._=h):a._=h;h.VERSION=
"1.3.1";var u=h.each=h.forEach=function(a,c,d){if(null!=a)if(r&&a.forEach===r)a.forEach(c,d);else if(a.length===+a.length)for(var g=0,f=a.length;g<f&&!(g in a&&c.call(d,a[g],g,a)===b);g++);else for(g in a)if(h.has(a,g)&&c.call(d,a[g],g,a)===b)break};h.map=h.collect=function(b,a,c){var d=[];if(null==b)return d;if(k&&b.map===k)return b.map(a,c);u(b,function(b,g,f){d[d.length]=a.call(c,b,g,f)});b.length===+b.length&&(d.length=b.length);return d};h.reduce=h.foldl=h.inject=function(b,a,c,d){var g=2<arguments.length;
null==b&&(b=[]);if(l&&b.reduce===l)return d&&(a=h.bind(a,d)),g?b.reduce(a,c):b.reduce(a);u(b,function(b,f,I){g?c=a.call(d,c,b,f,I):(c=b,g=!0)});if(!g)throw new TypeError("Reduce of empty array with no initial value");return c};h.reduceRight=h.foldr=function(b,a,c,d){var g=2<arguments.length;null==b&&(b=[]);if(y&&b.reduceRight===y)return d&&(a=h.bind(a,d)),g?b.reduceRight(a,c):b.reduceRight(a);var f=h.toArray(b).reverse();d&&!g&&(a=h.bind(a,d));return g?h.reduce(f,a,c,d):h.reduce(f,a)};h.find=h.detect=
function(b,a,c){var d;G(b,function(b,g,f){if(a.call(c,b,g,f))return d=b,!0});return d};h.filter=h.select=function(b,a,c){var d=[];if(null==b)return d;if(v&&b.filter===v)return b.filter(a,c);u(b,function(b,g,f){a.call(c,b,g,f)&&(d[d.length]=b)});return d};h.reject=function(b,a,c){var d=[];if(null==b)return d;u(b,function(b,g,f){a.call(c,b,g,f)||(d[d.length]=b)});return d};h.every=h.all=function(a,c,d){var g=!0;if(null==a)return g;if(x&&a.every===x)return a.every(c,d);u(a,function(a,f,e){if(!(g=g&&
c.call(d,a,f,e)))return b});return g};var G=h.some=h.any=function(a,c,d){c||(c=h.identity);var g=!1;if(null==a)return g;if(t&&a.some===t)return a.some(c,d);u(a,function(a,f,e){if(g||(g=c.call(d,a,f,e)))return b});return!!g};h.include=h.contains=function(b,a){var c=!1;return null==b?c:z&&b.indexOf===z?-1!=b.indexOf(a):c=G(b,function(b){return b===a})};h.invoke=function(b,a){var c=f.call(arguments,2);return h.map(b,function(b){return(h.isFunction(a)?a||b:b[a]).apply(b,c)})};h.pluck=function(b,a){return h.map(b,
function(b){return b[a]})};h.max=function(b,a,c){if(!a&&h.isArray(b))return Math.max.apply(Math,b);if(!a&&h.isEmpty(b))return-Infinity;var d={computed:-Infinity};u(b,function(b,g,f){g=a?a.call(c,b,g,f):b;g>=d.computed&&(d={value:b,computed:g})});return d.value};h.min=function(b,a,c){if(!a&&h.isArray(b))return Math.min.apply(Math,b);if(!a&&h.isEmpty(b))return Infinity;var d={computed:Infinity};u(b,function(b,g,f){g=a?a.call(c,b,g,f):b;g<d.computed&&(d={value:b,computed:g})});return d.value};h.shuffle=
function(b){var a=[],c;u(b,function(b,d,g){0==d?a[0]=b:(c=Math.floor(Math.random()*(d+1)),a[d]=a[c],a[c]=b)});return a};h.sortBy=function(b,a,c){return h.pluck(h.map(b,function(b,d,g){return{value:b,criteria:a.call(c,b,d,g)}}).sort(function(b,a){b=b.criteria;a=a.criteria;return b<a?-1:b>a?1:0}),"value")};h.groupBy=function(b,a){var c={},d=h.isFunction(a)?a:function(b){return b[a]};u(b,function(b,a){a=d(b,a);(c[a]||(c[a]=[])).push(b)});return c};h.sortedIndex=function(b,a,c){c||(c=h.identity);for(var d=
0,g=b.length;d<g;){var f=d+g>>1;c(b[f])<c(a)?d=f+1:g=f}return d};h.toArray=function(b){return b?b.toArray?b.toArray():h.isArray(b)||h.isArguments(b)?f.call(b):h.values(b):[]};h.size=function(b){return h.toArray(b).length};h.first=h.head=function(b,a,c){return null==a||c?b[0]:f.call(b,0,a)};h.initial=function(b,a,c){return f.call(b,0,b.length-(null==a||c?1:a))};h.last=function(b,a,c){return null==a||c?b[b.length-1]:f.call(b,Math.max(b.length-a,0))};h.rest=h.tail=function(b,a,c){return f.call(b,null==
a||c?1:a)};h.compact=function(b){return h.filter(b,function(b){return!!b})};h.flatten=function(b,a){return h.reduce(b,function(b,c){if(h.isArray(c))return b.concat(a?c:h.flatten(c));b[b.length]=c;return b},[])};h.without=function(b){return h.difference(b,f.call(arguments,1))};h.uniq=h.unique=function(b,a,c){c=c?h.map(b,c):b;var d=[];h.reduce(c,function(c,g,f){0!=f&&(!0===a?h.last(c)==g:h.include(c,g))||(c[c.length]=g,d[d.length]=b[f]);return c},[]);return d};h.union=function(){return h.uniq(h.flatten(arguments,
!0))};h.intersection=h.intersect=function(b){var a=f.call(arguments,1);return h.filter(h.uniq(b),function(b){return h.every(a,function(a){return 0<=h.indexOf(a,b)})})};h.difference=function(b){var a=h.flatten(f.call(arguments,1));return h.filter(b,function(b){return!h.include(a,b)})};h.zip=function(){for(var b=f.call(arguments),a=h.max(h.pluck(b,"length")),c=Array(a),d=0;d<a;d++)c[d]=h.pluck(b,""+d);return c};h.indexOf=function(b,a,c){if(null==b)return-1;var d;if(c)return c=h.sortedIndex(b,a),b[c]===
a?c:-1;if(z&&b.indexOf===z)return b.indexOf(a);c=0;for(d=b.length;c<d;c++)if(c in b&&b[c]===a)return c;return-1};h.lastIndexOf=function(b,a){if(null==b)return-1;if(F&&b.lastIndexOf===F)return b.lastIndexOf(a);for(var c=b.length;c--;)if(c in b&&b[c]===a)return c;return-1};h.range=function(b,a,c){1>=arguments.length&&(a=b||0,b=0);c=arguments[2]||1;for(var d=Math.max(Math.ceil((a-b)/c),0),g=0,f=Array(d);g<d;)f[g++]=b,b+=c;return f};var H=function(){};h.bind=function(b,a){var c,d;if(b.bind===A&&A)return A.apply(b,
f.call(arguments,1));if(!h.isFunction(b))throw new TypeError;d=f.call(arguments,2);return c=function(){if(!(this instanceof c))return b.apply(a,d.concat(f.call(arguments)));H.prototype=b.prototype;var g=new H,e=b.apply(g,d.concat(f.call(arguments)));return Object(e)===e?e:g}};h.bindAll=function(b){var a=f.call(arguments,1);0==a.length&&(a=h.functions(b));u(a,function(a){b[a]=h.bind(b[a],b)});return b};h.memoize=function(b,a){var c={};a||(a=h.identity);return function(){var d=a.apply(this,arguments);
return h.has(c,d)?c[d]:c[d]=b.apply(this,arguments)}};h.delay=function(b,a){var c=f.call(arguments,2);return setTimeout(function(){return b.apply(b,c)},a)};h.defer=function(b){return h.delay.apply(h,[b,1].concat(f.call(arguments,1)))};h.throttle=function(b,a){var c,d,g,f,e,m=h.debounce(function(){e=f=!1},a);return function(){c=this;d=arguments;g||(g=setTimeout(function(){g=null;e&&b.apply(c,d);m()},a));f?e=!0:b.apply(c,d);m();f=!0}};h.debounce=function(b,a){var c;return function(){var d=this,g=arguments;
clearTimeout(c);c=setTimeout(function(){c=null;b.apply(d,g)},a)}};h.once=function(b){var a=!1,c;return function(){if(a)return c;a=!0;return c=b.apply(this,arguments)}};h.wrap=function(b,a){return function(){var c=[b].concat(f.call(arguments,0));return a.apply(this,c)}};h.compose=function(){var b=arguments;return function(){for(var a=arguments,c=b.length-1;0<=c;c--)a=[b[c].apply(this,a)];return a[0]}};h.after=function(b,a){return 0>=b?a():function(){if(1>--b)return a.apply(this,arguments)}};h.keys=
J||function(b){if(b!==Object(b))throw new TypeError("Invalid object");var a=[],c;for(c in b)h.has(b,c)&&(a[a.length]=c);return a};h.values=function(b){return h.map(b,h.identity)};h.functions=h.methods=function(b){var a=[],c;for(c in b)h.isFunction(b[c])&&a.push(c);return a.sort()};h.extend=function(b){u(f.call(arguments,1),function(a){for(var c in a)b[c]=a[c]});return b};h.defaults=function(b){u(f.call(arguments,1),function(a){for(var c in a)null==b[c]&&(b[c]=a[c])});return b};h.clone=function(b){return h.isObject(b)?
h.isArray(b)?b.slice():h.extend({},b):b};h.tap=function(b,a){a(b);return b};h.isEqual=function(b,a){return e(b,a,[])};h.isEmpty=function(b){if(h.isArray(b)||h.isString(b))return 0===b.length;for(var a in b)if(h.has(b,a))return!1;return!0};h.isElement=function(b){return!(!b||1!=b.nodeType)};h.isArray=g||function(b){return"[object Array]"==p.call(b)};h.isObject=function(b){return b===Object(b)};h.isArguments=function(b){return"[object Arguments]"==p.call(b)};h.isArguments(arguments)||(h.isArguments=
function(b){return!(!b||!h.has(b,"callee"))});h.isFunction=function(b){return"[object Function]"==p.call(b)};h.isString=function(b){return"[object String]"==p.call(b)};h.isNumber=function(b){return"[object Number]"==p.call(b)};h.isNaN=function(b){return b!==b};h.isBoolean=function(b){return!0===b||!1===b||"[object Boolean]"==p.call(b)};h.isDate=function(b){return"[object Date]"==p.call(b)};h.isRegExp=function(b){return"[object RegExp]"==p.call(b)};h.isNull=function(b){return null===b};h.isUndefined=
function(b){return void 0===b};h.has=function(b,a){return q.call(b,a)};h.noConflict=function(){a._=c;return this};h.identity=function(b){return b};h.times=function(b,a,c){for(var d=0;d<b;d++)a.call(c,d)};h.escape=function(b){return(""+b).replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#x27;").replace(/\//g,"\x26#x2F;")};h.mixin=function(b){u(h.functions(b),function(a){K(a,h[a]=b[a])})};var L=0;h.uniqueId=function(b){var a=L++;return b?
b+a:a};h.templateSettings={evaluate:/<~([\s\S]+?)~>/g,interpolate:/\$\(([\s\S]+?)\)/g,escape:/~\$\(([\s\S]+?)\)/g};var B=/.^/,C=function(b){return b.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};h.template=function(b,a){var c=h.templateSettings;b="var __p\x3d[],print\x3dfunction(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+b.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.escape||B,function(b,a){return"',_.escape("+C(a)+"),'"}).replace(c.interpolate||B,function(b,a){return"',"+C(a)+
",'"}).replace(c.evaluate||B,function(b,a){return"');"+C(a).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";var d=new Function("obj","_",b);return a?d(a,h):function(b){return d.call(this,b,h)}};h.chain=function(b){return h(b).chain()};var w=function(b){this._wrapped=b};h.prototype=w.prototype;var D=function(b,a){return a?h(b).chain():b},K=function(b,a){w.prototype[b]=function(){var b=f.call(arguments);m.call(b,this._wrapped);
return D(a.apply(h,b),this._chain)}};h.mixin(h);u("pop push reverse shift sort splice unshift".split(" "),function(b){var a=d[b];w.prototype[b]=function(){var c=this._wrapped;a.apply(c,arguments);var d=c.length;"shift"!=b&&"splice"!=b||0!==d||delete c[0];return D(c,this._chain)}});u(["concat","join","slice"],function(b){var a=d[b];w.prototype[b]=function(){return D(a.apply(this._wrapped,arguments),this._chain)}});w.prototype.chain=function(){this._chain=!0;return this};w.prototype.value=function(){return this._wrapped}}).call(this);
l.when("A","gb-udp-event-emitter").register("gb-udp-deal-dao",function(n,a){return a.extend({init:function(a){this._super();if(!a)throw Error("Cannot create a DealDAO object with undefined dealID");this.timeouts={startTimeout:null,endTimeout:null,endTimeoutDelayed:null,statusExpireTimeout:null,expireTimeout:null,pstatusExpire:null,pstatusExpiresSoon:null};this.checkingDealStatus=!1;this.lastPstatusExpireState="";this.dealID=a;this.loading=!0;this.customerID=null;this.expired=!1;this.parentItems=this.parentAsin=
null;this.claimed=!1;this.itemType=this.dealType=null;this.dealState=Deal.stateToTemplateMap.Loading;this.offerListingID=this.impressionAsin=this.buyAsin=this.discussionBoardURL=this.cacheExpiresDate=this.msToCacheExpires=null;this.detail={title:null,description:null,marketplaceID:null,imageAsin:null,score:null,secondaryImages:null,URL:null,buyBoxURL:null,displayPriority:null,isFeatured:null,marketingMessage:null,geoDisplayName:null,accessType:null,isPrimeOnly:null,isPrimeEarly:null,accessDurationInMs:null};
this.pricingData={dealPriceHash:{isRange:null,max:{price:null,formattedPrice:null,currency:null},min:{price:null,formattedPrice:null,currency:null}},basisPriceHash:{isRange:null,max:{price:null,formattedPrice:null,currency:null},min:{price:null,formattedPrice:null,currency:null}}};this.percentOff={isRange:null,max:null,min:null};this.status={dealState:null,currentlyUnavailable:!1,percentClaimed:null,percentSoldOut:null,lastUpdated:null,totalCouponsCount:null,msToStart:null,msToEnd:null,startDate:null,
endDate:null,ended:null,msToCacheExpires:null,cacheExpiresDate:null,started:null,expired:null};this.isLimitedQuantity=null;this.teaser={teaserLine:null,teaserImage:null,teaserURL:null,teaserAsin:null};this.fastTrackMessage=this.swfContents=null;this.dealAsins=[];this.dealAsinsHash={};this.auxiliaryData={isPrimeEligible:null,breaksMAP:null,merchantDetails:{merchantID:null,merchantName:null},reviewData:{averageRating:null,totalReviews:null,reviewsURL:null}};this.purchaseStatusWarningThreshold=6E5},
validate:function(a){},setItemType:function(a){this.itemType=this.dealAsins&&1<this.dealAsins.length?Deal.itemTypes.MultiItem:this.dealAsins&&1===this.dealAsins.length?Deal.itemTypes.SingleItem:a?Deal.responseItemTypeToItemType[a]:Deal.itemTypes.ContentOnly},calculateStateData:function(){this.dealState=Deal.stateToTemplateMap.Available;0<this.status.msToStart&&!this.status.started?this.dealState=Deal.stateToTemplateMap.Upcoming:Deal.checkIfDealExpired(this)?this.dealState=Deal.stateToTemplateMap.Expired:
this.isDealSoldOut()&&(this.dealState=Deal.stateToTemplateMap.SoldOut)},calculateStatusData:function(a,b){if(a){this.status.currentlyUnavailable=a.currentlyUnavailable;this.status.percentClaimed=a.percentClaimed;var d;this.dealAsins&&(d=this.dealAsins.length);var g=0;if(d)for(var f=0;f<d;f++)100===this.dealAsins[f].status.percentClaimed&&g++;this.isDealSoldOut()&&(this.status.percentClaimed=100);this.status.percentSoldOut=a.percentSoldOut;this.status.totalCouponsCount=a.totalAvailable;this.status.msToCacheExpires=
a.msToCacheExpires;this.status.msToStart=a.msToStart;this.status.msToEnd=a.msToEnd;this.status.cacheExpiresDate=new Date(b.getTime()+parseInt(this.status.msToCacheExpires,10));this.status.endDate=new Date(b.getTime()+parseInt(this.status.msToEnd,10));this.status.startDate=new Date(b.getTime()+parseInt(this.status.msToStart,10))}else Deal.log("Cannot set Deal DAO status for undefined/null statusObj.")},isDealSoldOut:function(){if(!this.dealAsinsHash)return!1;for(var a in this.dealAsinsHash){var b=
this.dealAsinsHash[a];if(!b.status.offerServiceSoldOut&&100>b.status.percentSoldOut)return!1}return!0},calculatePriceData:function(a){var b=Deal.Price.findMaxMinPrices(this,a);Deal.Price.isEmptyPriceObject(b)||(this.pricingData.basisPriceHash.max=b.maxBasisPrice,this.pricingData.basisPriceHash.min=b.minBasisPrice,Deal.Price.maxEqualMin(this.pricingData.basisPriceHash)?this.pricingData.basisPriceHash.isRange=!1:this.pricingData.basisPriceHash.isRange=!0,this.pricingData.dealPriceHash.max=b.maxDealPrice,
this.pricingData.dealPriceHash.min=b.minDealPrice,Deal.Price.maxEqualMin(this.pricingData.dealPriceHash)?this.pricingData.dealPriceHash.isRange=!1:this.pricingData.dealPriceHash.isRange=!0);a&&(a.maxPercentOff&&(this.percentOff.max=parseInt(a.maxPercentOff)),a.minPercentOff&&(this.percentOff.min=parseInt(a.minPercentOff)),this.percentOff.isRange=this.percentOff.max===this.percentOff.min?!1:!0)},calculateAuxiliaryDataFromItem:function(){var a=Deal.findBackBoneDealAsin(this);if(a){if(null===this.auxiliaryData.isPrimeEligible||
this.auxiliaryData.isPrimeEligible===e)this.auxiliaryData.isPrimeEligible=a.auxiliaryData.isPrimeEligible;if(null===this.auxiliaryData.breaksMAP||this.auxiliaryData.breaksMAP===e)this.auxiliaryData.breaksMAP=a.auxiliaryData.breaksMAP;if(null===this.auxiliaryData.merchantDetails||this.auxiliaryData.merchantDetails===e)this.auxiliaryData.merchantDetails=a.auxiliaryData.merchantDetails;if(null===this.auxiliaryData.reviewData||this.auxiliaryData.reviewData===e)this.auxiliaryData.reviewData=a.auxiliaryData.reviewData}}})});
l.when("A","gb-udp-event-emitter").register("gb-udp-deal-asin-dao",function(n,a){return a.extend({init:function(a){this._super();if(a===e||!a)throw Error("Cannot create a DealAsinDAO object with undefined asin");Deal.log("Created DealAsinDAO instance for: "+a);this.ASIN=a;this.timeouts={};this.imageURL=this.basisKind=this.basisPriceFormatted=this.basisPrice=this.dealPriceFormatted=this.dealPrice=this.marketplaceID=this.parentDealDAO=this.dealID=null;this.isParent=!1;this.percentOff=this.percentOffBasisPrice=
this.totalAvailable=null;this.status={state:null,itemState:null,expiresDate:null,offerServiceSoldOut:null,currentlyUnavailable:null,percentClaimed:null,percentSoldOut:null,lastUpdated:null,msToExpiry:null,totalCouponsCount:null};this.isCustomerClaimed=!1;this.waitListStatus={position:null,chance:null,timeToWait:null};this.offerListingID=this.variationData=null;this.auxiliaryData={isPrimeEligible:null,breaksMAP:null,merchantDetails:{merchantID:null,merchantName:null},reviewData:{averageRating:null,
totalReviews:null,reviewsURL:null}};this.perCustomerAmount=this.offerID=this.isWaitlistable=this.isTimeLimited=this.isOneClickable=this.isParentItem=this.ingressUrl=this.egressUrl=null},validate:function(a){}})});l.when("A").register("deals-custom-integration-base",function(e){return e.createClass({isActive:!1,init:function(){this.isIntegrationActive()},isIntegrationActive:function(){throw Error("isIntegrationActive called from base");},appendArgumentsToEndpoint:function(){throw Error("appendArgumentsToEndpoint called from base");
},handleClaimDealSuccess:function(){throw Error("handleClaimDealSuccess called from base");},handleClaimDealError:function(){throw Error("handleClaimDealError called from base");},handleClaimDealRetry:function(){throw Error("handleClaimDealRetry called from base");},handleLDBuyBoxSelected:function(){throw Error("handleLDBuyBoxSelected called from base");},handleRegularBuyBoxSelected:function(){throw Error("handleRegularBuyBoxSelected called from base");}})});l.when("A","deals-custom-integration-base").register("deals-custom-integration-installments",
function(e,a){var c=e.$;return a.extend({init:function(){this._super()},isIntegrationActive:function(){var b=c('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),a=c('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');this.isActive=b.length&&a.length},appendArgumentsToEndpoint:function(){var b="",a=c('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),g=c('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');
g.length&&a.length&&a.is(":checked")&&(b="\x26installmentsProgramId\x3d"+g.val());return b},handleClaimDealSuccess:function(){c(".installments-checkbox-wrapper").hide()},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){var b=c(".installments-deal-breakdown");b.length&&b.addClass("aok-hidden");b=c(".price-installment-payment");b.length&&b.removeClass("aok-hidden")},handleRegularBuyBoxSelected:function(){var b=c(".installments-deal-breakdown");b.length&&
b.removeClass("aok-hidden");b=c(".price-installment-payment");b.length&&b.addClass("aok-hidden")}})});l.when("A","deals-custom-integration-base").register("deals-custom-integration-preRegistration",function(e,a){var c=e.$;return a.extend({init:function(){this._super()},isIntegrationActive:function(){this.isActive=c('#preRegistration-container-deals input[name\x3d"account-linking-deals"]').length},appendArgumentsToEndpoint:function(){var b="",a=c('#preRegistration-container-deals input[name\x3d"account-linking-deals"]');
a.length&&(b=a.is(":checked")&&!a.prop("disabled")?"\x26isDevicePreRegistered\x3dtrue":"\x26isDevicePreRegistered\x3dfalse");return b},handleClaimDealSuccess:function(){c("#preRegistration-container-deals").hide()},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){},handleRegularBuyBoxSelected:function(){}})});l.when("A","gb-udp-deal-asin-dao","gb-udp-event-emitter").register("gb-deal-content-service-translation-helper",function(n,a,c){return c.extend({init:function(b){this._super()},
validate:function(b){},populateFromGetDealMetadata:function(){},populateFromGetDeals:function(b,a){if(b&&a){b.loading=!1;b.legacyDeal||(b.legacyDeal=new Deal.Model.Deal(a.dealID));b.customerID=gbResources.getCustomerData("customerId");b.claimed=!1;b.dealID=a.dealID;b.parentAsin=null;b.dealType=a.type;if(a.parentItems){b.parentItems||(b.parentItems={});for(var c in a.parentItems)b.parentAsin||(b.parentAsin=c),b.parentItems[c]=a.parentItems[c]}b.isLimitedQuantity=!1;b.limitedQuantity=!1;a.quantity&&
(a.quantity=parseInt(a.quantity,10));if(b.dealType==Deal.dealTypes.LD||a.quantity&&0<a.quantity)b.isLimitedQuantity=!0,b.limitedQuantity=!0;b.detail.marketplaceID=null;b.detail.score=parseInt(a.score,10);b.detail.title=a.title;b.detail.description=a.description;b.detail.leakDescription=a.leakDescription;b.detail.marketingMessage=a.marketingMessage;b.detail.geoDisplayName=a.geoDisplayName;b.detail.imageAsin=Deal.checkAndSetSSLImageUrl(a.primaryImage);b.detail.secondaryImages=a.secondaryImages;b.detail.URL=
a.egressUrl;b.detail.buyBoxURL=a.ingressUrl;b.detail.displayPriority=parseInt(a.displayPriority,10);b.detail.isFeatured=Deal.parseBool(a.isFeatured);b.detail.imageAsin||(b.detail.imageAsin=gbResources.getImage("no_image"));a.impressionAsin&&(b.impressionAsin=a.impressionAsin);b.detail.isPrimeEarly=!1;b.detail.isPrimeOnly=!1;a.primeAccessType==Deal.accessTypeEnum.PRIME_EARLY_ACCESS?(b.detail.accessType=Deal.accessTypeEnum[a.primeAccessType],b.detail.accessDurationInMs=6E4*parseInt(a.primeAccessDuration,
10),b.detail.isPrimeEarly=!0):a.primeAccessType==Deal.accessTypeEnum.PRIME_ONLY_LD?(b.detail.isPrimeOnly=!0,b.detail.accessType=Deal.accessTypeEnum.PRIME_ONLY_LD):a.primeAccessType==Deal.accessTypeEnum.PRIME_ONLY_DOTD?(b.detail.isPrimeOnly=!0,b.detail.accessType=Deal.accessTypeEnum.PRIME_ONLY_DOTD):a.primeAccessType==Deal.accessTypeEnum.PRIME_ONLY_BD&&(b.detail.isPrimeOnly=!0,b.detail.accessType=Deal.accessTypeEnum.PRIME_ONLY_BD);b.discussionBoardURL="/gp/goldbox/discussion/"+b.dealID;b.auxiliaryData.isPrimeEligible=
Deal.parseBool(a.isPrimeEligible);b.auxiliaryData.breaksMAP=Deal.parseBool(a.isMAP);b.auxiliaryData.merchantDetails=a.merchantID||a.merchantName?{merchantID:a.merchantID,merchantName:a.merchantName}:null;a.reviewAsin?(b.buyAsin=a.reviewAsin,b.auxiliaryData.reviewData={averageRating:parseFloat(a.reviewRating),totalReviews:parseInt(a.totalReviews,10),reviewsURL:"/gp/product-reviews/"+a.reviewAsin}):b.auxiliaryData.reviewData=null;a.teaser&&(b.teaser.teaserLine=a.teaser,a.teaserImage&&(b.teaser.teaserImage=
Deal.checkAndSetSSLImageUrl(a.teaserImage)),a.teaserAsin&&(b.teaser.teaserAsin=a.teaserAsin,b.teaser.teaserURL="/gp/product/"+a.teaserAsin));a.items&&this.populateFromItems(b,a);this.executePostTranslationRules(b);b.legacyDeal.load_from_deal_dao(b)}else Deal.log("ERROR: DealContentServiceTranslationHelper: deal/jsonDeal object passed into populateFromGetDeals was null/undefined.")},translateClaimDealResponse:function(b,a,c){if(c!==e&&null!==c){var f=new Date;b.loading=!1;var m=_.find(b.dealAsins,
function(b){if(b.ASIN===a)return b}),p=c.dealItemStatus;m&&p!==e&&null!==p&&(m.status.itemState=c.dealItemStatus.itemState,m.status.state=Deal.customerStates[c.dealItemStatus.customerState],m.status.msToExpiry=c.dealItemStatus.msToCustomerStateExpiry);c.msCacheTtl!==e&&null!==c.msCacheTtl&&(b.status.msToCacheExpires=parseInt(c.msCacheTtl,10));b.legacyDeal=new Deal.Model.Deal(b.dealID);b.legacyDeal.load_from_deal_dao(b);this.initStatus(b,f);this.initAsinStatus(b)}},populateFromItems:function(b,c){if(b===
e||null==b||c==e||null==c){var g="";b?c||(g+="jsonDeal \x3d null. dealID \x3d "+b.dealID):g+="deal \x3d null";Deal.log("ERROR: DealContentServiceTranslationHelper: Deal object or jsonDeal object passed into populateFromItems was null or undefined. "+g)}else{var f=c.items,m;for(m=0;m<f.length;m++){var p=f[m],q=p.itemID;if(b.dealAsinsHash[q]===e||null===b.dealAsinsHash[q])p.itemID||(g="dealID \x3d "+b.dealID,Deal.log("ERROR: DealContentServiceTranslationHelper: populateFromItems: Null or undefined Asin passed. "+
g)),b.dealAsinsHash[q]=new a(p.itemID),b.dealAsins.push(b.dealAsinsHash[q]);b.dealAsinsHash[q].parentDealDAO=b;this.populateFromItem(b.dealAsinsHash[q],p,b.dealType)}b.setItemType(c.itemType);null!==b.itemType&&b.itemType!==e||b.itemType!=Deal.itemTypes.SingleItem||!b.dealAsins||1!=b.dealAsins.length||(b.buyAsin=b.dealAsins[0].ASIN);if(null===b.offerListingID||b.offerListingID===e)b.dealAsins&&1==b.dealAsins.length?b.offerListingID=b.dealAsins[0].offerID:b.itemType==Deal.itemTypes.SingleItem&&c.offerID&&
(b.offerListingID=c.offerID);b.calculatePriceData(c);b.calculateAuxiliaryDataFromItem();Deal.log("DealContentServiceTranslationHelper: Populate form Items Complete Pushed "+m+" DealAsins")}},populateFromItem:function(b,a,c){b.ASIN=a.itemID;b.dealID=a.dealID;a.variationDimensions&&(b.variationData=b.variationData||{},_.each(a.variationDimensions,function(c,g){c=c.replace(/\s+/g," ");a.variationDimensions[g]=c;b.variationData[g]=c}));a.dealPrice!==e&&null!==a.dealPrice&&(b.dealPrice={currency:a.currencyCode,
price:parseFloat(a.dealPrice)},b.dealPriceFormatted=Deal.Price.format(b.dealPrice));a.bAmount!==e&&null!==a.bAmount&&(b.basisPrice={currency:a.currencyCode,price:parseFloat(a.bAmount)},b.basisPriceFormatted=Deal.Price.format(b.basisPrice),b.basisKind=a.bKind);if(b.basisPrice&&b.dealPrice&&(b.percentOffBasisPrice=Deal.Price.percent_off(b.basisPrice,b.dealPrice),b.percentOffBasisPrice))try{b.percentOffBasisPriceFormatted=Math.round(b.percentOffBasisPrice)}catch(f){Deal.log("UnknownFormat percentageOffBasisPrice Object."+
f)}b.percentOff=Deal.Price.displayable_percent_off(parseInt(a.percentOff));b.egressUrl=a.egressUrl;b.ingressUrl=a.ingressUrl;b.isParentItem=a.isParentItem;b.imageURL=a.primaryImage;if(b.imageURL===e||null===b.imageURL)b.imageURL=gbResources.getImage("no_image");null!==a.isOneClickable&&a.isOneClickable!==e&&(b.isOneClickable=Deal.parseBool(a.isOneClickable));null!==a.isTimeLimited&&a.isTimeLimited!==e&&(b.isTimeLimited=Deal.parseBool(a.isTimeLimited));null!==a.isWaitlistable&&a.isWaitlistable!==e&&
(b.isWaitlistable=Deal.parseBool(a.isWaitlistable));b.offerID=a.offerID;null!==a.perCustomerAmount&&a.perCustomerAmount!==e&&(b.perCustomerAmount=parseInt(a.perCustomerAmount,10));b.auxiliaryData.isPrimeEligible=Deal.parseBool(a.isPrimeEligible);b.auxiliaryData.breaksMAP=Deal.parseBool(a.isMAP);b.auxiliaryData.merchantDetails={merchantID:a.merchantID,merchantName:a.merchantName};b.auxiliaryData.reviewData={averageRating:parseFloat(a.reviewRating),totalReviews:parseInt(a.totalReviews,10),reviewsURL:"/gp/product-reviews/"+
a.itemID};return b},populateFromSelectDealsMetadata:function(b,a){if(b===e||null===b)Deal.log("Cannot populate select deals metadata for undefined/null widgetID.");else if(a===e||null===a)Deal.log("Cannot populate select deals metadata for undefined/null data.");else{var c={};c.dealStateHash=a.dealsByState;c.dealCategoryHash=a.dealsByCategory;c.dealAccessTypeHash=a.dealsByAccessType;c.sortedDealList=a.sortedDealIDs;c.selectDealsPageSize=a.selectDealsPageSize;Deal.controller.metadata.registerResponseData(b,
c)}},populateFromGetDealStatuses:function(b,a){if(b===e||null===b)Deal.log("Cannot populateFromGetDealStatuses for undefined/null json obj.");else{var c,f;for(f in b)a.deals[f]!==e&&null!==a.deals[f]?(c=a.getDeal(f),this.populateFromGetDealStatus(c,b[f])):Deal.log("We cannot do a status update on a DealObject that doesn't exist.")}},populateFromGetDealStatus:function(b,c){var g=new Date;if(b===e||null===b)Deal.log("Cannot populateFromDealStatus for undefined/null deal obj.");else if(c===e||null===
c)Deal.log("Cannot populateFromDealStatus for undefined/null json obj.");else{if(c.lastUpdated!==e&&null!==c.lastUpdated){c.lastUpdated=parseInt(c.lastUpdated,10);if(b.status.lastUpdated!==e&&null!==b.status.lastUpdated&&b.status.lastUpdated>c.lastUpdated)return;b.status.lastUpdated=c.lastUpdated}if(!(b.dealType===Deal.dealTypes.LD&&b.status.cacheExpiresDate>g)){c.totalCouponCount!==e&&null!==c.totalCouponCount&&(b.status.totalCouponsCount=parseInt(c.totalCouponCount,10));if(c.dealState!==e&&null!==
c.dealState){b.status.dealState=c.dealState;var f=Deal.stateToTemplateMap[Deal.dealStates[c.dealState]];f!==e&&null!==f&&(b.dealState=f)}c.msToEnd!==e&&null!==c.msToEnd&&(b.status.msToEnd=parseInt(c.msToEnd,10));c.msToStart!==e&&null!==c.msToStart&&(b.status.msToStart=parseInt(c.msToStart,10),b.dealState===Deal.stateToTemplateMap.Upcoming&&0>=b.status.msToStart&&(b.dealState=Deal.stateToTemplateMap.ComingSoon));c.msCacheTtl!==e&&null!==c.msCacheTtl&&(b.status.msToCacheExpires=parseInt(c.msCacheTtl,
10));c.percentClaimed!==e&&null!==c.percentClaimed&&(b.status.percentClaimed=parseInt(c.percentClaimed,10));for(var m in c.dealItemStatus)if(null===b.dealAsinsHash[m]||b.dealAsinsHash[m]===e)f=new a(m),f.parentDealDAO=b,b.dealAsins.push(f),b.dealAsinsHash[m]=f;c.dealItemStatus!==e&&null!==c.dealItemStatus&&this.populateFromDealItemStatuses(b,c.dealItemStatus);this.initStatus(b,g);this.initAsinStatus(b);b.trigger("change",b);b.legacyDeal!==e&&null!==b.legacyDeal&&b.legacyDeal.load_status_from_deal_dao(b)}}},
populateFromDealItemStatuses:function(b,a){if(b===e||null===b)Deal.log("Cannot populateFromDealItemStatuses for undefined/null deal obj.");else if(a===e||null===a)Deal.log("Cannot populateFomDealItemStatuses for undefined/null json obj.");else{var c,f;for(f in a)b.dealAsinsHash[f]!==e&&null!==b.dealAsinsHash[f]?(c=b.dealAsinsHash[f],this.populateFromDealItemStatus(c,a[f])):Deal.log("Cannot populate itemStatus on a non-existed item for imte: "+f)}},populateFromDealItemStatus:function(b,a){if(b===e||
null===b)Deal.log("Cannot populateFromDealItemStatus for undefined/null dealAsin.");else if(a===e||null===a)Deal.log("Cannot populate DealItemStatus from undefined/null json obj.");else{if(a.lastUpdated!==e&&null!==a.lastUpdated){a.lastUpdated=parseInt(a.lastUpdated,10);if(b.status.lastUpdated!==e&&null!==b.status.lastUpdated&&b.status.lastUpdated>a.lastUpdated)return;b.status.lastUpdated=a.lastUpdated}a.totalCouponCount!==e&&null!==a.totalCouponCount&&(b.status.totalCouponsCount=parseInt(a.totalCouponCount,
10));a.customerState!==e&&null!==a.customerState&&(b.status.state=Deal.customerStates[a.customerState]);a.itemState!==e&&null!==a.itemState&&(b.status.itemState=a.itemState,Deal.itemStateToPurchaseStateMap[b.status.itemState]==Deal.dealStateEnum.SoldOut&&(b.status.percentSoldOut=100));a.msCacheTtl!==e&&null!==a.msCacheTtl&&(b.status.msToCacheExpires=parseInt(a.msCacheTtl,10));a.msToCustomerStateExpiry!==e&&null!==a.msToCustomerStateExpiry&&(b.status.msToExpiry=parseInt(a.msToCustomerStateExpiry,10));
a.percentClaimed!==e&&null!==a.percentClaimed&&(b.status.percentClaimed=parseInt(a.percentClaimed,10));a.waitlistChance!==e&&null!==a.waitlistChance&&(b.waitListStatus.chance=a.waitlistChance);a.waitlistPosition!==e&&null!==a.waitlistPosition&&(b.waitListStatus.position=parseInt(a.waitlistPosition,10));b.isCustomerClaimed=Deal.customerStates[a.customerState]===Deal.claimedStr?!0:!1}},initStatus:function(b,a){b.status.cacheExpiresDate=new Date(a.getTime()+parseInt(b.status.msToCacheExpires,10));b.status.expired=
!1;b.status.startDate=new Date(a.getTime()+parseInt(b.status.msToStart,10));b.status.started=0>=b.status.msToStart;b.status.endDate=new Date(a.getTime()+parseInt(b.status.msToEnd,10));b.status.ended=0>=b.status.msToEnd;b.claimed&&(b.claimed="1"==b.claimed);b.timeouts.startTimeout&&(k.clearTimeout(b.timeouts.startTimeout),Deal.log("DealContentServiceTranslationHelper._init_status: Clearing out deal.timeouts.startTimeout for deal: "+b.dealID));b.status.started||(b.timeouts.startTimeout=n.delay(function(){if(b.dealType===
Deal.dealTypes.LD&&Deal.hasPricingDetails(b))b.status.started=!0,b.status.msToStart=0,b.status.dealState=Deal.itemStates.Available,b.dealState=Deal.stateToTemplateMap[Deal.dealStates.AVAILABLE],_.each(b.dealAsinsHash,function(b,a,c){b.status.itemState=Deal.itemStates.Available}),b.trigger("change",b);else{var a=b.dealID;Deal.controller.dealServiceClients.DealContentService.dealsWithDetails[a]=!1;b.trigger("change",Deal.controller.getDeal("DummyDealID"));Deal.controller.dealServiceClients.DealContentService.addToGetDealsCache(a);
Deal.log("Triggering change signal on deal: "+b.dealID+" from deal.timeouts.startTimeout Trigger.")}},b.status.startDate.getTime()-(new Date).getTime()),Deal.log("DealContentServiceTranslationHelper._init_status: Setting deal.timeouts.startTimeout for deal: "+b.dealID));b.timeouts.endTimeout&&(k.clearTimeout(b.timeouts.endTimeout),Deal.log("DealContentServiceTranslationHelper._init_status: Clearing out deal.timeouts.endTimeout for deal: "+b.dealID));b.status.ended||(a=b.status.endDate.getTime()-(new Date).getTime(),
b.timeouts.endTimeoutDelayed&&k.clearTimeout(b.timeouts.endTimeoutDelayed),b.timeouts.endTimeoutDelayed=Deal.setSafeTimeout(function(){b.timeouts.endTimeout=n.delay(function(){b.status.ended=!0;b.trigger("change",b);Deal.log("Triggering change signal on deal: "+b.dealID+" from deal.timeouts.endTimeout Trigger.")},b.status.endDate.getTime()-(new Date).getTime())},a),Deal.log("DealContentServiceTranslationHelper._init_status: Setting deal.timeouts.endTimeOut for deal: "+b.dealID));b.timeouts.earlyAccessTimeOut&&
k.clearTimeout(b.timeouts.earlyAccessTimeOut);Deal.isDealInEarlyAccessWindow(b)&&(b.timeouts.earlyAccessTimeOut=n.delay(function(){b.status.msToStart=-b.detail.accessDurationInMs;b.trigger("change",b)},b.status.startDate.getTime()+b.detail.accessDurationInMs-(new Date).getTime()));b.timeouts.statusExpireTimeout&&(k.clearTimeout(b.timeouts.statusExpireTimeout),Deal.log("DealContentServiceTranslationHelper._init_status: Clearing out deal.timeouts.statusExpireTimeout for deal: "+b.dealID));a=b.status.cacheExpiresDate.getTime()-
(new Date).getTime();Deal.checkIfDealExpired(b)&&(new Deal.PurchaseStatusGatherer(b)).hasTimeSensitiveState()&&(a=12E3);b.timeouts.statusExpireTimeout=n.delay(function(){if(b.dealType!==Deal.dealTypes.LD||b.status.started||Deal.hasPricingDetails(b))b.status.expired=!0,b.trigger("status_expire",b),Deal.log("Triggering status_expire signal on deal: "+b.dealID+" from deal.timeouts.statusExpireTimeout Trigger.");else{var a=Deal.controller.dealServiceClients.DealContentService;a.dealsWithDetails[b.dealID]=
!1;a.addToGetDealsCache(b.dealID)}},a);Deal.log("DealContentServiceTranslationHelper._init_status: Setting deal.timeouts.statusExpireTimeout for deal: "+b.dealID+" for timeout: "+(b.status.cacheExpiresDate.getTime()-(new Date).getTime()));Deal.log("DealContentServiceTranslationHelper.initStatus completed.")},initAsinStatus:function(b){if(b===e||null===b)Deal.log("Cannot operate on undefined/null deal object.");else if(b.dealType===e||null===b.dealType)Deal.log("Cannot operate on undefined/null dealType.");
else if(b.dealType!==Deal.dealTypes.LD)Deal.log("Returning initAsinStatus as NO-OP for non-LD's.");else if(b.dealAsinsHash){b.timeouts.pstatusExpiresSoon||(b.timeouts.pstatusExpiresSoon={});b.timeouts.pstatusExpire||(b.timeouts.pstatusExpire={});_.each(b.dealAsins,function(b){Deal.dealStates[b.status.itemState]===Deal.waitlistFullStr&&(b.status.currentlyUnavailable=!0)});for(var a=Deal.filterAsinsHashByState(b.dealAsinsHash,[Deal.inCartStr,Deal.expiredStr,Deal.waitInLineStr,Deal.pendingAtcStr]),c=
new Date,f=0;f<a.length;f++){var m=a[f];b.purchaseStatusWarningThreshold&&(m.status.expiresDate=new Date(c.getTime()+parseInt(m.status.msToExpiry,10)))}a.sort(Deal.sortByDealAsinDAOTimes);b.asinExpiresSoonStack=[];b.asinExpiredStack=[];for(f=0;f<a.length;f++){m=a[f];b.timeouts.pstatusExpiresSoon[m.ASIN]&&(k.clearTimeout(b.timeouts.pstatusExpiresSoon[m.ASIN]),Deal.log("DealContentServiceTranslationHelper.initAsinStatus: Clearing deal.timeouts.pstatusExpiresSoon for  ASIN: "+m.ASIN));var p=m.status.expiresDate.getTime()-
(new Date).getTime(),c=p-b.purchaseStatusWarningThreshold;0>c&&(c=0);var q=""+m.ASIN;0<p&&m.status.state!=Deal.waitInLineStr&&m.status.state!=Deal.pendingAtcStr&&(b.asinExpiresSoonStack.push(q),b.timeouts.pstatusExpiresSoon[q]=n.delay(function(){var a=b.asinExpiresSoonStack.shift();Deal.log("DealContentServiceTranslationHelper.initAsinStatus: TimeOut completed for pstatusExpiresSoon: originalStaticAsin: "+q+" tmpAsin: "+a)},c),Deal.log("DealContentServiceTranslationHelper.initAsinStatus: Timeout set for pstatusExpiresSoon for ASIN : "+
q+" for endsSoonTimeout: "+c));b.timeouts.pstatusExpire[m.ASIN]&&(k.clearTimeout(b.timeouts.pstatusExpire[m.ASIN]),Deal.log("DealContentServiceTranslationHelper.initAsinStatus: Clearing pstatusExpire for ASIN: "+m.ASIN));b.asinExpiredStack.push(q);0<p&&(b.timeouts.pstatusExpire[m.ASIN]=n.delay(function(){var a=p,c=b.asinExpiredStack.shift();a!==e&&null!==a&&0<a?b.trigger("pstatus_expire",b,c):b.trigger("change",b);Deal.log("DealContentServiceTranslationHelper.initAsinStatus: TimeOut completed for: pstatusExpire for ASIN: "+
m.ASIN+" tmpAsin: "+c)},p));Deal.log("DealContentServiceTranslationHelper.initAsinStatus: Timeout set for pstatusExpire for ASIN: "+m.ASIN+" pStatusTimeout: "+p)}Deal.log("DealContentServiceTranslationHelper.initAsinStatus completed.")}else Deal.log("No Asins, not initializing asinStatuses")},executePostTranslationRules:function(b){if(b!==e&&null!==b){if("LOCAL_DEAL"===b.dealType&&b.detail){var a=b.detail.URL;if(a){var c=a.match(/:\/\/(.[^/]+)/)[1];if(c&&c.match(/^local\./)){var f=a.split(c),c=c.replace(/^local\./,
"www."),a=f[0],f=f[1];a&&f&&(b.detail.URL=a+c+"/local"+f)}}}if(k.Deal.isPaladin&&1===k.Deal.isPaladin&&(b.detail&&(b.detail.URL=Deal.ConvertToPaladinUrl(b.detail.URL),b.detail.buyBoxURL=Deal.ConvertToPaladinUrl(b.detail.buyBoxURL)),b.dealAsinsHash))for(var m in b.dealAsinsHash)c=b.dealAsinsHash[m],null!==c&&c!==e&&(c.egressUrl=Deal.ConvertToPaladinUrl(c.egressUrl),c.ingressUrl=Deal.ConvertToPaladinUrl(c.ingressUrl))}}})});l.when("A","gb-udp-event-emitter").register("gb-deals-interface",function(e,
a){return a.extend({defaults:{versionInfo:null},baseRetryInterval:6E4,continueRequests:!0,timeout:3E5,maxRetries:1,marketplace_id:"1",includeVariations:"True",customer_id:"",session_id:null,translationHelper:null,log_attribution_name:"GoldboxUDPAssets",log_level_error:"ERROR",response_error_handling:{service_not_available:{response_code:503},throttling_exception:{response_code:400,response_message_pattern:/Rate exceeded/},request_failed_message:"Request failed",retries_timed_out_message:"Retries timed out"},
filter:{},statuses:{},browseNodes:null,ordering:null,controllerReference:null,init:function(){this._super()},_execErrorCallback:function(a){var b;b="";try{b=JSON.stringify(a.errorResponse)}catch(d){l.log("Could not serialize object: "+d.toString(),this.log_level_error,this.log_attribution_name)}b=[a.messagePrefix," ",a.url,b].join("");a.error(Error(b))},ajax_with_retries:function(a,b){var d=this,g=new Date,f=0,m,p=a.retryInterval||this.baseRetryInterval||6E4;delete a.retryInterval;var q=a.error;delete a.error;
a.retry&&(m=a.retry,delete a.retry);var r=a.success;a.success=function(d,e,m){"function"===typeof m.getResponseHeader&&m.getResponseHeader("X-CSRFToken")&&gbResources&&"function"===typeof gbResources.registerCustomerData&&gbResources.registerCustomerData({csrfToken:m.getResponseHeader("X-CSRFToken")});d&&Deal.parseBool(d.retry)?a.error():(b&&(b.isRetry=0<f,b.isSuccess=!0,b.latency=(new Date).getTime()-g.getTime(),Deal.recordAPIMetrics(b)),r(d,m))};var k=function(){d.continueRequests?(a.url=Deal.setURLParameter(a.url,
"nocache",(new Date).getTime()),a.error=function(r){var l=!0;b&&(b.isRetry=0<f,b.isSuccess=!1,b.latency=(new Date).getTime()-g.getTime(),Deal.recordAPIMetrics(b));if(r&&r.status===d.response_error_handling.service_not_available.response_code||r&&r.status===d.response_error_handling.throttling_exception.response_code&&r.responseText&&r.responseText.match(d.response_error_handling.throttling_exception.response_message_pattern))return d._execErrorCallback({messagePrefix:d.response_error_handling.request_failed_message,
url:a.url,errorResponse:r,error:q});a.url=Deal.setURLParameter(a.url,"retrying",1);if(m){var v=d.getRetryInterval(++f);f>d.maxRetries&&(d._execErrorCallback({messagePrefix:d.response_error_handling.retries_timed_out_message,url:a.url,errorResponse:r,error:q}),l=!1)}else v=p*(1+Math.pow(2,f++)*Math.random()),v+(new Date).getTime()-g.getTime()>d.timeout&&(d._execErrorCallback({messagePrefix:d.response_error_handling.retries_timed_out_message,url:a.url,errorResponse:r,error:q}),l=!1);l&&(Deal.log("Retrying after "+
v+"ms"),"function"===typeof m&&m(),e.delay(k,v))},e.$.ajax(a)):q(Error("continueRequests is false. No more requests should be made "+a.url))};k()},next_id:100,getRetryInterval:function(a){return Math.pow(2,a-1)*(this.baseRetryInterval+Deal.getRandomNumber(-1E3,1E3))}})});l.when("A","gb-deals-interface","gb-deal-content-service-translation-helper","gb-deal-custom-integration-service").register("gb-deal-redemption-service",function(e,a,c,b){var d=e.$;return a.extend({baseRetryInterval:4E3,endPoint:"/gp/deal/ajax/v2/claimDeal.html",
maxRetries:1,translationHelper:null,dealCustomIntegrationService:null,clientId:"goldbox",init:function(a){this._super();d.extend(this,gbResources.getApiConfigs(Deal.apiShortName.CLAIM_DEAL));this.translationHelper=new c;this.dealCustomIntegrationService=new b},claimDeal:function(a,b,c,d,e,r,k){var n=this.endPoint,l;gbResources&&"function"===typeof gbResources.getCustomerData&&gbResources.getCustomerData("csrfToken")&&(l=function(a){a.setRequestHeader("X-CSRFToken",gbResources.getCustomerData("csrfToken"))});
n+="/ref\x3d"+c+"?dealId\x3d"+a+"\x26itemId\x3d"+b+"\x26quantity\x3d"+d+"\x26clientId\x3d"+this.clientId;n=this.dealCustomIntegrationService.appendCustomArgumentsToEndpoint(n);this.call(n,{},e,r,{apiName:Deal.apiName.CLAIM_DEAL,clientId:this.clientId},k,l)},call:function(a,b,c,d,e,r,k){a={success:function(a,b){c(a,b)},error:d,retry:r,url:a,type:"POST",data:JSON.stringify(b),dataType:"json"};k&&(a.beforeSend=k);this.ajax_with_retries(a,e)}})});l.when("A","jQuery","gb-udp-event-emitter").register("gb-mnss-service",
function(k,a,c){return c.extend({base_retry_interval:2E4,continue_requests:!0,customer_id:"",session_id:null,timeout:3E5,init:function(a){this._super();this.customer_id=gbResources.getCustomerData("customerId");this.session_id=gbResources.getCustomerData("sessionId")},ajax_with_retries:function(b){var c=this,g=new Date,f=0,e=b.retryInterval||this.base_retry_interval||6E4;delete b.retryInterval;var p=b.error;delete b.error;var q=function(){c.continue_requests?(-1==b.url.indexOf("?")?b.url=b.url+"?nocache\x3d"+
(new Date).getTime():b.url=b.url+"\x26nocache\x3d"+(new Date).getTime(),b.error=function(a){var b=e*(1+Math.pow(2,f++)*Math.random());b+(new Date).getTime()-g.getTime()>c.timeout?p(Error("Retries timed out"+JSON.stringify(a))):(Deal.log("retrying after "+b+"ms"),k.delay(q,b))},a.ajax(b)):p(Error("continue_requests is false: no more requests should be made."))};q()},call:function(a,c,g,f,m){a={success:g,error:f,url:a,type:"POST",data:JSON.stringify(c),dataType:"json"};m!==e&&(a.retryInterval=m);this.ajax_with_retries(a)},
register_for_notifications:function(a,c,g){this.call("/gp/deal/ajax/registerForNotifications.html/ref\x3dgb_mshop?customer\x3d"+this.customer_id+"\x26sessionId\x3d"+this.session_id+"\x26token\x3d"+a.pushToken+"\x26application\x3d"+a.appID+"\x26protocol\x3d"+a.protocol,{},c,g,this.base_retry_interval)}})});l.when("A","gb-deals-interface","gb-deal-content-service-translation-helper","gb-csm").register("gb-deal-content-service",function(n,a,c,b){var d=n.$;return a.extend({client_id:"goldbox",continueRequests:!0,
baseRetryInterval:6E4,timeout:3E5,maxRetries:0,customer_id:null,dealsPerPage:null,marketplace_id:null,page:1,session_id:null,translationHelper:null,getDealsMaxJitter:Deal.constants.GET_DEALS_MAX_JITTER,widgetMetadataCache:{},selectDealsRequestArgs:{},uniqueSelectDealsRequestArgs:[],onGoingSelectDealsRequest:{},widgetIdToArgs:{},firstGetDeals:{},dealsWithDetails:{},dealStateFilter:{available:["AVAILABLE"],missed:["EXPIRED","SOLDOUT"],expired:["EXPIRED"],upcoming:["UPCOMING"],soldout:["SOLDOUT"]},getDealsCache:[],
init:function(a){this._super();this.customer_id=gbResources.getCustomerData("customerId");this.marketplace_id=gbResources.getCustomerData("marketplaceId");this.session_id=gbResources.getCustomerData("sessionId");d.extend(this,gbResources.getApiConfigs(Deal.apiShortName.GET_DEAL_STATUS));a&&a.client_id&&(this.client_id=a.client_id);this.translationHelper=new c},addToGetDealsCache:function(a){var b=this;null===a||a===e?Deal.log("addToGetDealsCache called with null/undefined dealID"):_.contains(b.getDealsCache,
a)||(b.getDealsCache.push(a),1===b.getDealsCache.length&&n.delay(function(){var a=[];_.each(b.getDealsCache,function(c){b.dealsWithDetails[c]||a.push(c)});b.getDealsCache=[];a.length&&b.get_Deals(a,Deal.controller,!1)},Math.floor(Math.random()*b.getDealsMaxJitter*1E3)+500))},getMetadataCacheWidgets:function(){return _.map(_.keys(this.widgetMetadataCache),function(a){return parseInt(a,10)}).sort()},processWidgetMetadataCache:function(a){for(var b=this.getMetadataCacheWidgets(),c=0;c<b.length;c++){var d=
b[c];this.isReadyToLoadMetadata(d,a)&&this.processWidgetMetadataCacheEntry(d,a)}},processWidgetMetadataCacheEntry:function(a,b){b.trigger("process_selectdeals_metadata"+a,a,this.widgetMetadataCache[a]);delete this.widgetMetadataCache[a]},isReadyToLoadMetadata:function(a,b){if(b.disableDeduping[a])return!0;b=b.getWidgetsToLoadMetadata(a);b.push(a);for(a=0;a<b.length;a++)if(!(b[a]in this.widgetMetadataCache))return!1;return!0},call:function(a,b,c,d,q,r){a={success:function(a,b){c(a,b)},error:d,url:a,
type:"POST",data:JSON.stringify(b),dataType:"json"};q!==e&&(a.retryInterval=q);this.ajax_with_retries(a,r)},getDeals:function(a,b,c,p,q,r,k,n){if(a===e||null===a)Deal.log("Need a proper controller reference to getDeals.");else if(b===e||null===b)Deal.log("Cannot getDeals for an undefined/null widgetID.");else{this.firstGetDeals[b]===e&&(this.firstGetDeals[b]=!0);a.listOfDeals[b]=[];var l=this;a.on("startGetDealStatusesAdhoc",function(b){for(var c=[],d=0;d<b.length;d++){var f=b[d];l.dealsWithDetails[f]||
(c.push(f),l.dealsWithDetails[f]=!0)}c.length&&l.get_Deals(c,a)});var v=function(c){delete l.onGoingSelectDealsRequest[b];Deal.log("Select Deals call returned.");a.off("selectdeals_change"+b,v);c===e||null===c?Deal.log("Cannot populateGetDeals data with undefined/null data."):(a.on("process_selectdeals_metadata"+b,function(b,c){Deal.log("Processing SelectDealsMetadataResponse for widgetID "+b);if(b===e||null===b)Deal.log("Cannont processSelectDealsMetadataResponse for null/undefined widgetID");else if(c===
e||null===c)Deal.log("Cannont processSelectDealsMetadataResponse for null/undefined metadataCacheEntry");else{var d=c.callingParams;l.translationHelper.populateFromSelectDealsMetadata(b,c.responseData);a.hasMetadata[b]=!0;a.trigger("metadata_change"+b);a.setOrdering(b,d.ordering);a.setFilter(b,d.filter);a.setCells(b,d.cells);a.trigger("startGetDealsConnectionWiring"+b);a.setPage(b,d.page)}}),l.widgetMetadataCache[b]={responseData:c,callingParams:{ordering:q,filter:r,cells:p,page:k}},l.processWidgetMetadataCache(a))},
x=function(){var c=[],d=Deal.getPaginationCellPositions(k,p,a.dealIDs[b].length,a.disablePagination[b]);a.listOfDeals[b]=[];for(var e=0;e<d.length;e++){var m=d[e],h=a.dealIDs[b][m],q=a.getDeal(h);null!==q&&(c.push(h),Deal.connectionManager.connectDealExpire(a,b,q),m<p*k&&m>=p*(k-1)&&a.listOfDeals[b].push(q))}a.trigger("startGetDealStatusesAdhoc",c);a.off("startGetDealsConnectionWiring"+b);a.trigger("startCellChangeAndStatusConnectionWiring"+b,a.listOfDeals[b])},t=a.getWidgetParams(b);n!==e&&null!==
n&&d.extend(!0,t,n);this.selectDealsRequestArgs[b]===e&&(this.selectDealsRequestArgs[b]=t);n=this.requestArgsExist(t);n||(this.selectDealsRequestArgs[b]=t,this.uniqueSelectDealsRequestArgs.push(t));!1!==this.firstGetDeals[b]||n||(this.firstGetDeals[b]=!0);if(!0===this.firstGetDeals[b])if(this.firstGetDeals[b]=!1,n&&this.onGoingSelectDealsRequestForArgs(t)&&this.onGoingSelectDealsRequest[b]===e){if(this.onGoingSelectDealsRequest[b]=!0,c=function(c){delete l.onGoingSelectDealsRequest[b];a.trigger("selectdeals_change"+
b,c)},t=this.currentWidgetIdForArgs(t),t!==e||null!==t)a.on("selectdeals_change"+b,v),a.on("startGetDealsConnectionWiring"+b,x),a.on("selectdeals_change"+t,c)}else a.on("selectdeals_change"+b,v),a.on("startGetDealsConnectionWiring"+b,x),this.onGoingSelectDealsRequest[b]=!0,this.recordArgs(b,t),this.select_deals(b,p,t,a);else a.metadata.checkIfStatusFilterSeen(b,c)&&this.onGoingSelectDealsRequest[b]===e&&(a.on("startGetDealsConnectionWiring"+b,x),a.trigger("startGetDealsConnectionWiring"+b))}},get_deal_statuses:function(a,
c){var d=b.getAjaxMetricLogger("dcs-get-deal-status").recordStart(),e=this,q=e.get_getDealStatuses_request_data(a);e.call("/xa/dealcontent/v2/GetDealStatus",q,function(b,q){d.recordComplete(q);q={};var k,n;for(k in b.dealStatus)n=b.dealStatus[k],a[k][0](n),q[k]=!0;var l=e._deal_ids_to_item_ids_from_callbacks(a);for(n=0;n<l.length;n++)if(k=l[n].dealID,!q[k])a[k][1](Error("No status returned for dealID "+k));e.translationHelper.populateFromGetDealStatuses(b.dealStatus,c);d.recordFeatureComplete().publishAjaxMetrics()},
function(b){var c,d,f=e._deal_ids_to_item_ids_from_callbacks(a);for(c=0;c<f.length;c++)d=f[c].dealID,a[d][1](b)},null,{apiName:Deal.apiName.GET_DEAL_STATUS,clientId:e.client_id})},get_Deals:function(a,c,d){var e=b.getAjaxMetricLogger("dcs-get-deal").recordStart(),q=this;d=q.getDeals_request_Data(a,d);q.call("/xa/dealcontent/v2/GetDeals",d,function(a,b){e.recordComplete(b);for(var d in a.dealDetails)b=c.getDeal(d),q.translationHelper.populateFromGetDeals(b,a.dealDetails[d]);q.translationHelper.populateFromGetDealStatuses(a.dealStatus,
c);e.recordFeatureComplete().publishAjaxMetrics()},function(b){for(b=0;b<a.length;b++)q.dealsWithDetails[a[b]]=!1},null,{apiName:Deal.apiName.GET_DEALS,clientId:q.client_id})},get_getDealStatuses_request_data:function(a){a=this._deal_ids_to_item_ids_from_callbacks(a);a={requestMetadata:{marketplaceID:this.marketplace_id,clientID:this.client_id,sessionID:this.session_id},dealTargets:a,responseSize:"STATUS_ONLY",itemResponseSize:"NONE"};null!==this.customer_id&&""!==this.customer_id&&(a.requestMetadata.customerID=
this.customer_id);return a},getDeals_request_Data:function(a,b){var c=a.sort();a=[];for(var d=0;d<c.length;d++)a.push({dealID:c[d]});a={requestMetadata:{marketplaceID:this.marketplace_id,clientID:this.client_id,sessionID:this.session_id},dealTargets:a,responseSize:"ALL",itemResponseSize:"DEFAULT_WITH_PREEMPTIVE_LEAKING"};b||null===this.customer_id||""===this.customer_id||(a.requestMetadata.customerID=this.customer_id);return a},requestArgsExist:function(a){if(a===e||null===a)return Deal.log("Cannot check if request args exist for undefined/null args."),
!1;if(0===this.uniqueSelectDealsRequestArgs.length)return!1;for(var b,c=0;c<this.uniqueSelectDealsRequestArgs.length;c++)if(b=this.uniqueSelectDealsRequestArgs[c],Deal.objectsIdentical(b,a))return!0;return!1},onGoingSelectDealsRequestForArgs:function(a){if(a===e||null===a)return Deal.log("Cannot check if onGoingSelectDealsRequestForArgs exist for undefined/null args."),!1;a=this.currentWidgetIdForArgs(a);return this.onGoingSelectDealsRequest[a]?!0:!1},currentWidgetIdForArgs:function(a){if(a===e||
null===a)return Deal.log("Cannot check if request args exist for undefined/null args."),null;for(var b in this.widgetIdToArgs)for(var c=0;c<this.widgetIdToArgs[b].length;c++)if(Deal.objectsIdentical(a,this.widgetIdToArgs[b][c]))return b;return null},recordArgs:function(a,b){a===e||null===a?Deal.log("Cannot recordArgs for undefined/null widgetID."):b===e||null===b?Deal.log("Cannot recordArgs for undefined/null args."):(this.widgetIdToArgs[a]===e&&(this.widgetIdToArgs[a]=[]),this.widgetIdToArgs[a].push(b))},
_deal_ids_to_item_ids_from_callbacks:function(a){a=_.keys(a).sort();for(var b=[],c=0;c<a.length;c++)b.push({dealID:a[c],itemIDs:null});return b},get_deal_status:function(a,b,c,d){return this._add_request("get_deal_status",a,b,c,d)},next_id:100,_pending:{select_deals:{current:!1,timeout:e,deal_ids:{}},get_deal_status:{current:!1,timeout:e,deal_ids:{}}},_add_request:function(a,b,c,d,q){var k=this._pending[a];k.deal_ids[b]===e&&(k.deal_ids[b]={});var n=k.deal_ids[b],l=this.next_id++;b={cancel:function(){delete n[l];
this.cancel=function(){throw Error("already cancelled");}},success:c,error:d};n[l]=b;this._start_request_timer(a,q);return b},_start_request_timer:function(a,b){var c=this,d=c._pending[a];d.current||(d.timeout&&k.clearTimeout(d.timeout),d.timeout=n.delay(function(){d.timeout=e;c._start_request(a,b)},0))},_start_request:function(a,b){var c=this,d=c._pending[a];d.timeout&&(k.clearTimeout(d.timeout),d.timeout=e);if(!d.current){var q=[],n={},l;for(l in d.deal_ids){if(10<=q.length)break;var E=!1,y;for(y in d.deal_ids[l]){E=
!0;break}if(!E){delete d.deal_ids[l];break}d.deal_ids[l].current||(d.deal_ids[l].current=!0,q.push(l),function(d){n[d]=[function(e){c._request_success(a,d,e,b)},function(e){c._request_error(a,d,e,b)}]}(l))}0!==q.length&&"get_deal_status"==a&&c.get_deal_statuses(n,b)}},_request_success:function(a,b,c,d){var q=this._pending[a];q.current=!1;var k=q.deal_ids[b];if(k!==e){delete q.deal_ids[b];delete k.current;for(var n in k)k[n].success(c)}this._start_request_timer(a,d)},_request_error:function(a,b,c,
d){var k=this._pending[a];k.current=!1;var n=k.deal_ids[b];if(n!==e){delete k.deal_ids[b];delete n.current;for(var l in n)n[l].error(c)}this._start_request_timer(a,d)},get_deal_asin_status2:function(){return{cancel:function(){}}},get_deal:function(){return{cancel:function(){}}}})});l.when("A","deals-custom-integration-installments").register("gb-deal-custom-integration-service",function(e,a){var c=e.$;return e.createClass({requiredFunctions:"isIntegrationActive appendArgumentsToEndpoint handleClaimDealSuccess handleClaimDealError handleClaimDealRetry handleLDBuyBoxSelected handleRegularBuyBoxSelected".split(" "),
registeredIntegrations:[new a],init:function(){this.bindEvents()},bindEvents:function(){e.on("deals_claimDealSuccess",c.proxy(function(){this.executeEventHandler("handleClaimDealSuccess")},this));e.on("deals_claimDealError",c.proxy(function(){this.executeEventHandler("handleClaimDealError")},this));e.on("deals_claimDealRetry",c.proxy(function(){this.executeEventHandler("handleClaimDealRetry")},this));e.on("deals_onSelectLDBuybox",c.proxy(function(){this.executeEventHandler("handleLDBuyBoxSelected")},
this));e.on("deals_onSelectRegularBuybox",c.proxy(function(){this.executeEventHandler("handleRegularBuyBoxSelected")},this))},appendCustomArgumentsToEndpoint:function(a){var d=a;c.each(this.registeredIntegrations,function(a,b){b.isActive&&(d+=b.appendArgumentsToEndpoint())});return d},executeEventHandler:function(a){c.each(this.registeredIntegrations,function(c,g){if(g.isActive)g[a]()})}})});l.when("A","gb-udp-event-emitter").register("gb-deal-config-manager",function(e,a){return a.extend({init:function(a){this._super();
if(!a)throw Error("Cannot initialize configManager with empty params.");a.dealContentServiceConfig&&(this.dealContentServiceConfig=a.dealContentServiceConfig);a.controllerConfig&&(this.controllerConfig=a.controllerConfig)},getWidgetConfig:function(a){return this[a]},getControllerConfig:function(){return this.controllerConfig},getABTestingConfig:function(){return this.abTestingConfig},getDealContentServiceConfig:function(){return this.dealContentServiceConfig},getDealViewTemplate:function(a,b){var d=
"";return a&&b?Deal.configManager[a]&&Deal.configManager[a].dealViewConfig&&Deal.configManager[a].dealViewConfig.templates&&Deal.configManager[a].dealViewConfig.templates[b]?d=Deal.configManager[a].dealViewConfig.templates[b]:(Deal.log("No entry exists for specified widgetName/templateName"),d):(Deal.log("No widget or template name specified."),d)},getWidgetViewTemplate:function(a,b){var d="";return a&&b?Deal.configManager[a]&&Deal.configManager[a].templates&&Deal.configManager[a].templates[b]?d=
Deal.configManager[a].templates[b]:d:(Deal.log("No widget or template name specified."),d)}})});l.when("A").execute("gb-udp-connection-manager",function(l){k.Deal||(k.Deal={});Deal.connectionManager={connections:{},dealObjectToCallBacks:[],nextSignalID:100,signals:{cell_change:{},pstatus_expire:{},page_change:{},metadata_change:{}},registerWidgetConnections:function(a){_.each(this.signals,function(c){c[a]={}});this.connections[a]===e&&(this.connections[a]=[])},connectDealExpire:function(a,c,b){if(!Deal.watcher.doesCallBackExist(b.dealID,
"expire")){var d=function(b){var d=a.dealServiceInstance[c].get_deal(b.dealID,function(d){b.off("cancelGetDealRequest");a.dealServiceInstance[c].translationHelper.populateFromGetDeals(b,d)},function(a){Deal.log("Error getting deal: "+a+" stack: "+a.stack)});b.on("cancelGetDealRequest",function(){d.cancel();b.off("cancelGetDealRequest")})};b.on("expire",d);this.dealObjectToCallBacks.push({signalName:"expire",scope:b,callBackValue:d});Deal.watcher.addCallBack(b.dealID,"expire")}(b.expired||b.loading)&&
b.trigger("expire",b)},connectDealChange:function(a,c,b,d){var g=function(d){a.trigger("cell_change"+c,{cell:b,deal:d})};d.on("change",g);this.connections[c].push({signalName:"change",scope:d,callBackValue:g})},connectPstatusExpire:function(a,c,b,d){var g=function(d,g){if(d.dealAsinsHash!==e&&null!==d.dealAsinsHash&&1>=_.keys(d.dealAsinsHash).length){var k=Deal.findBackBoneDealAsin(d);k!==e&&null!==k&&k.status!==e&&null!==k.status&&k.status.state!==e&&null!==k.status.state&&(d.lastPstatusExpireState=
k.status.state,!Deal.checkIfDealExpired(d)||k.status.state!==Deal.inCartStr&&k.status.state!==Deal.pendingAtcStr||(k.status.state="Expired",d.trigger("change",d)));d.checkingDealStatusTimeout=l.delay(function(){d.lastPstatusExpireState="";delete d.checkingDealStatusTimeout},4E4)}d.trigger("status_expire",d);a.trigger("pstatus_expire"+c,{cell:b,deal:d,expiring_asin:g})};d.on("pstatus_expire",g);this.connections[c].push({signalName:"pstatus_expire",scope:d,callBackValue:g})},connectDealStatusExpire:function(a,
c,b){if(!Deal.watcher.isDealBeingWatched(b.dealID,c)){var d=function(b){var d=a.dealServiceInstance[c].get_deal_status(b.dealID,function(d){b.off("cancelGetDealStatusRequest");a.dealServiceInstance[c].translationHelper.populateFromGetDealStatus(b,d)},function(a){Deal.log("Error getting status: "+a+" stack: "+a.stack)},a);b.on("cancelGetDealStatusRequest",function(){d.cancel();b.off("cancelGetDealStatusRequest")});var e=a.dealServiceInstance[c].get_deal_asin_status2(b.dealID,function(d){b.off("cancelGetDealAsinStatusRequest");
a.dealServiceInstance[c].translationHelper.populateFromGetDealAsinStatus(b,d);b.trigger("change",b)},function(a){Deal.log("Error with GetDealAsinStatus("+b.dealID+"): "+a)});b.on("cancelGetDealAsinStatusRequest",function(){e.cancel();b.off("cancelGetDealAsinStatusRequest")})};b.on("status_expire",d);this.dealObjectToCallBacks.push({signalName:"status_expire",scope:b,callBackValue:d})}!b.status.expired||b.expired||b.loading||b.trigger("status_expire",b)},connectSignal:function(a,c,b,d,g){if(a===e||
null===a||c===e||null===c||b===e||null===b||d===e||null===d||g===e||null===g)throw Error("Please provide a valid scope, signalName, widgetID, functionName");if(this.signals[c]===e)throw Error("Please provide a valid scope, signalName, widgetID, functionName");if(this.signals[c][b]===e)throw Error("Please provide a valid scope, signalName, widgetID, functionName");var f=this.nextSignalID,k;g!==e&&(k=g[d],g.on(c+b,k),d=function(a){g.trigger(c+b,a)});a.on(c+b,d);this.signals[c][b][f]={callBackValue:d,
scope:g,scopeCallBackValue:k};this.nextSignalID++;return{widgetID:b,id:f}},disconnectCurrentPageSignals:function(a,c){_.each(a.dealsInCurrentView[c],function(a){Deal.watcher.unwatchDeal(a.dealID,c)});_.each(a.dealsInNextView[c],function(a){Deal.watcher.unwatchDeal(a.dealID,c)});a.dealsInCurrentView[c]=[];a.dealsInNextView[c]=[];for(a=0;a<this.dealObjectToCallBacks.length;a++){var b=this.dealObjectToCallBacks[a];if(b!==e&&null!==b&&b.scope&&b.signalName&&b.scope.dealID){var d=b.scope;Deal.watcher.isDealBeingWatched(d.dealID)||
("expire"===b.signalName&&Deal.watcher.doesCallBackExist(d.dealID,"expire")&&(d.trigger("cancelGetDealRequest"),Deal.watcher.removeCallBack(d.dealID,"expire")),"status_expire"===b.signalName&&(d.trigger("cancelGetDealStatusRequest"),d.trigger("cancelGetDealAsinStatusRequest")),d.off(b.signalName,b.callBackValue),this.dealObjectToCallBacks.splice(_.indexOf(this.dealObjectToCallBacks,b),1),--a)}}for(a=0;a<this.connections[c].length;a++)b=this.connections[c][a],b!==e&&null!==b&&b.scope&&b.signalName&&
b.scope.dealID&&("change"===b.signalName||"pstatus_expire"===b.signalName)&&(b.scope.off(b.signalName,b.callBackValue),this.connections[c].splice(_.indexOf(this.connections[c],b),1),--a)}}});l.when("A","gb-udp-deal-watcher","gb-mnss-service","gb-deal-content-service","gb-deal-content-service-translation-helper","gb-deal-redemption-service","gb-udp-deal-dao","gb-udp-event-emitter","gb-csm").register("gb-udp-controller",function(n,a,c,b,d,g,f,m,p){return m.extend({loginURI:null,deals:{},buying:{},connections:{},
cells:{},cellToDeal:{},page:{},pages:{},widgetIdToWidgetNameMap:{},dealIDs:{},dealsInCurrentView:{},dealsInNextView:{},dealServiceClass:null,dealServiceInstance:null,dealRedemptionServiceClient:null,mnssInstance:null,dealServiceConfig:null,dealServiceVersion:null,buyboxWidgetID:200,nextWidgetID:200,varRedemptionCallback:{},canCustomerClaimPrimeOnlyDOTD:!0,isCustomerClaimingPrimeOnlyDOTD:!1,init:function(f){this._super();if(f!==e&&0!==f.length){this.login_uri=f.login_uri;this.dealServiceConfig=Deal.configManager.getDealContentServiceConfig();
this.dealServiceInstance=new b(this.dealServiceConfig);this.dcsTranslationHelper=new d;this.dealRedemptionServiceClient=new g;this.mnssInstance=new c;Deal.watcher=new a;f=Deal.getParameterByName("updateCart");var k=Deal.getParameterByName("cartQuantity");"1"==f&&this._updateNavCartQty(k)}else Deal.log("Error: Cannot instantiate UDPDealController with no Model/Config data")},registerWidget:function(a){if(a===e||!a)return Deal.log("Cannot register undefined/null widgetID"),null;var b=this.nextWidgetID;
this.widgetIdToWidgetNameMap[b]=a;Deal.connectionManager.registerWidgetConnections(b);this.cellToDeal[b]===e&&(this.cellToDeal[b]={});this.dealServiceInstance[b]=this.dealServiceInstance;this.dealIDs[b]===e&&(this.dealIDs[b]=[]);this.dealsInCurrentView[b]===e&&(this.dealsInCurrentView[b]=[]);this.dealsInNextView[b]===e&&(this.dealsInNextView[b]=[]);this.varRedemptionCallback[b]===e&&(this.varRedemptionCallback[b]=null);this.page[b]=1;this.nextWidgetID++;return b},getWidget:function(a){for(var b in Deal.Widgets)if(Deal.Widgets[b].widgetName===
a)return Deal.Widgets[b];return null},getDeal:function(a){return this.deals!==e?(this.deals[a]===e&&(this.deals[a]=new f(a),Deal.log("UDPDealController.getDeal: Created a new DealDAO obj for dealID: "+a)),this.deals[a]):null},setPageDealID:function(a,b){Deal.log("UDPDealController.setPageDealID called");var c;c=b.dealId;a!==e&&a?c!==e&&c?(Deal.connectionManager.disconnectCurrentPageSignals(this,a),c=this.getDeal(c),this.cellToDeal[a][0]=c,this.dealsInCurrentView[a].push(c),Deal.connectionManager.connectDealChange(this,
a,0,c),Deal.connectionManager.connectPstatusExpire(this,a,0,c),Deal.connectionManager.connectDealStatusExpire(this,a,c),this.dcsTranslationHelper.populateFromGetDealStatuses(b.dealStatus,this),this.trigger("cell_change"+a,{cell:0,deal:c}),Deal.watcher.watchDeal(c,a)):Deal.log("Cannot setPageDealID on undefined dealID"):Deal.log("Cannot setPageDealID on undefined widgetID")},redemptionCallback:function(a,b){if(this.varRedemptionCallback[a])this.varRedemptionCallback[a](b)},setRedemptionCallback:function(a,
b){this.varRedemptionCallback[a]=b},registerForNotifications:function(a){this.mnssInstance.register_for_notifications(a,function(){Deal.log("Registered customer for notification")},function(){Deal.log("Error registering customer for notification")})},claimDeal:function(a,b,c,d,e){var g=this,f=g.cellToDeal[a][0];e||(e=1);if(!g.buying[f.dealID]){g.buying[f.dealID]=!0;var k=p.getAjaxMetricLogger("drs-claim-deal").recordStart();g.dealRedemptionServiceClient.claimDeal(b,c,d,e,function(b,d){k.recordComplete(d);
Deal.isPrimeOnlyDotd(f)&&(g.isCustomerClaimingPrimeOnlyDOTD=!0,b&&b.errorCode===Deal.constants.NON_RETRYABLE_QUANTITY_RESTRICTION_VIOLATION_ERROR&&(g.canCustomerClaimPrimeOnlyDOTD=!1,g._updateNavCartQty(b.currentCartQuantity)));if(b&&b.dealItemStatus){g.dealRedemptionServiceClient.translationHelper.translateClaimDealResponse(f,c,b);var e=Deal.customerStates[b.dealItemStatus.customerState];if(e===Deal.inCartStr||e===Deal.waitInLineStr)g.redemptionCallback(a,c),l.when("A").execute(function(a){a=a.$;
a("#gb_in_cart_co").trigger("redeemed",e)});g._updateNavCartQty(b.currentCartQuantity);f.legacyDeal&&g.registerDealWithNotifier(c,f.legacyDeal)}delete g.buying[f.dealID];d=b.errorCode===Deal.constants.NON_RETRYABLE_QUANTITY_RESTRICTION_VIOLATION_ERROR;"undefined"===typeof b.retry||d?f.trigger("change",f):g.redemptionCallback(a,null);k.recordFeatureComplete().publishAjaxMetrics();n.trigger("deals_claimDealSuccess")},function(b){var c=n.$,d=function(){g.redemptionCallback(a,null);delete g.buying[f.dealID];
f.trigger("change",f)};0<c(".deal_atc_progress").length&&0<c("#deal_redemption_retry_failure_msg").length?(c(".deal_atc_progress").addClass("a-hidden"),c("#deal_redemption_retry_failure_msg").removeClass("a-hidden"),n.delay(function(){c(".deal_atc_progress").addClass("a-hidden");c("#deal_processing_msg").removeClass("a-hidden");d()},3E3)):d();n.trigger("deals_claimDealError")},function(){l.when("A").execute(function(a){var b=a.$;0<b(".deal_atc_progress").length&&0<b("#deal_redemption_retry_msg").length&&
(b(".deal_atc_progress").addClass("a-hidden"),b("#deal_redemption_retry_msg").removeClass("a-hidden"));a.trigger("deals_claimDealRetry")})})}},_updateNavCartQty:function(a){l.when("nav.setCartCount").execute(function(b){b(a)});l.when("mash").execute(function(b){b.cart.didUpdate({newCartQuantity:parseInt(a,10)})})},registerDealWithNotifier:function(a,b){k.dealNotifier&&dealNotifier.registerDeal(a,b)}})});l.when("A","gb-udp-event-emitter").register("gb-udp-deal-watcher",function(k,a){return a.extend({activeDealsHash:{},
callbackHash:{},asinImpressionsHash:{},hasRendered:{},hasImpressions:[],init:function(){this._super()},doesCallBackExist:function(a,b){return a===e||null===a||b===e||null===b?(Deal.log("DealWatcher.doesCallBackExist called with null/undefined dealID/signalName"),!1):this.callbackHash[a]===e?!1:_.contains(this.callbackHash[a],b)},addCallBack:function(a,b){a===e||null===a||b===e||null===b?Deal.log("DealWatcher.addCallBack called with null/undefined dealID/signalName"):(this.callbackHash[a]===e&&(this.callbackHash[a]=
[]),_.contains(this.callbackHash[a],b)||this.callbackHash[a].push(b))},removeCallBack:function(a,b){a===e||null===a||b===e||null===b?Deal.log("DealWatcher.removeCallBack called with null/undefined dealID/signalName"):this.callbackHash[a]!==e&&_.contains(this.callbackHash[a],b)&&(this.callbackHash[a].splice(_.indexOf(this.callbackHash[a],b),1),0===this.callbackHash[a].length&&delete this.callbackHash[a])},isDealBeingWatched:function(a,b){return a===e||null===a?(Deal.log("DealWatcher.isDealBeingWatched called with null/undefined dealID"),
!1):this.activeDealsHash[a]===e?!1:b===e?!0:_.contains(this.activeDealsHash[a].widgetIDs,b)},watchDeal:function(a,b){var d=a.dealID;d===e||null===d||b===e||null===b?Deal.log("DealWatcher.watchDeal called with null/undefined dealID/widgetID"):(this.activeDealsHash[d]===e&&(this.activeDealsHash[d]={deal:a,widgetIDs:[]}),_.contains(this.activeDealsHash[d].widgetIDs,b)||this.activeDealsHash[d].widgetIDs.push(b))},unwatchDeal:function(a,b){a===e||null===a||b===e||null===b?Deal.log("DealWatcher.unwatchDeal called with null/undefined dealID/widgetID"):
this.activeDealsHash[a]!==e&&_.contains(this.activeDealsHash[a].widgetIDs,b)&&(this.activeDealsHash[a].widgetIDs.splice(_.indexOf(this.activeDealsHash[a].widgetIDs,b),1),0===this.activeDealsHash[a].widgetIDs.length&&delete this.activeDealsHash[a])}})});l.when("A","gb-udp-deal-view","gb-udp-deal-asin-dao","gb-udp-event-emitter").register("gb-udp-deal-widget",function(k,a,c,b){return b.extend({dealViews:{},widgetID:0,widgetName:"",pushNotificationDetails:{},init:function(a){this._super();a!==e&&null!==
a&&(this.widgetID=Deal.udpController.registerWidget(a),this.widgetName=a);this.registerSignals()},registerSignals:function(){Deal.connectionManager.connectSignal(Deal.udpController,"page_change",this.widgetID,"pageChange",this);Deal.connectionManager.connectSignal(Deal.udpController,"cell_change",this.widgetID,"cellChange",this);Deal.connectionManager.connectSignal(Deal.udpController,"pstatus_expire",this.widgetID,"purchaseStatusExpire",this)},purchaseStatusExpire:function(a){a!==e&&a||Deal.log("UDPDealWidget.cellChange: Null params.");
if(a.deal!==e&&a.deal)if(a.cell===e||null===a.cell)Deal.log("UDPDealWidget.purchaseStatusExpire: Null/undefined cell");else{var b=this.getViewId(a.cell);this.dealViews[b]!==e&&this.dealViews[b].updatePurchaseState(a.deal)}else Deal.log("UDPDealWidget.purchaseStatusExpire: Null deal object.")},getViewId:function(a){return this.widgetID+"_udpDealView_"+a},cellChange:function(a){if(a!==e&&a){var b;a.deal!==e&&a.deal?(Deal.log("UDPDealWidget.cellChange:  Cell: "+a.cell+" has new data change for deal: "+
a.deal.dealID),b="available"):(Deal.log("UDPDealWidget.cellChange: Null deal object Clearing the dealView."),b="empty");var c=this.getViewId(a.cell),k=Deal.udpController&&Deal.udpController.buying&&a.deal.dealID&&Deal.udpController.buying[a.deal.dealID];this.dealViews[c]===e||k||this.dealViews[c].trigger("change",{state:b,deal:a.deal})}else Deal.log("UDPDealWidget.cellChange: Null params.")},pageChange:function(a){if(a!==e&&a){var b;a.deal!==e&&a.deal?(Deal.log("UDPDealWidget.cellChange:  Cell: "+
a.cell+" has new data change for deal: "+a.deal.dealID),b="available"):(Deal.log("UDPDealWidget.cellChange: Null deal object Clearing the dealView."),b="empty");var c=this.getViewId(a.cell);this.dealViews[c]!==e&&(Deal.log("UDPDealWidget.pageChange:  Triggering change signal for dealView: "+c),this.dealViews[c].trigger("change",{state:b,deal:a.deal}))}else Deal.log("UDPDealWidget.cellChange: Null params.")},setDealId:function(b){var g=Deal.udpController.getDeal(b.dealId),f=b.asin;g.detail.accessType=
b.primeAccessType;g.detail.accessDurationInMs=b.primeAccessDurationInMs;if(null===g.dealType||g.dealType===e)g.dealType=b.dealType;if(f&&g.dealAsinsHash&&!g.dealAsinsHash[f]){var k=new c(f);k.parentDealDAO=g;g.dealAsins.push(k);g.dealAsinsHash[f]=k}g=this.getViewId(0);this.dealViews[g]===e?this.dealViews[g]=new a(this.widgetID,g,b):this.dealViews[g].setDealInfo(b.dealId,b.asin);Deal.udpController.setPageDealID(this.widgetID,b)},setPushNotificationDetails:function(a){this.pushNotificationDetails=a;
var b=this.getViewId(0);this.dealViews[b].setPushNotificationDetails(a)},registerEvents:function(){var a=this;l.when("jQuery","accordionBuyBoxJS").execute(function(b){var c=a.getViewId(0);a.dealViews[c]!==e&&(b("#usedBuySection").bind("click",a.dealViews[c].onSelectRegularBuybox),b("#buyNewSection").bind("click",a.dealViews[c].onSelectRegularBuybox),b("#lightningDealSection").bind("click",a.dealViews[c].onSelectLDBuybox))});l.when("jQuery").execute(function(b){b("#gb_in_cart_co").bind("redeemed",
function(b,c){b=a.getViewId(0);a.dealViews[b]!==e&&a.dealViews[b].showChangeOver(c)})})}})});"use strict";l.when("A","gb-udp-availability-message-controller").register("gb-udp-buybox-selector",function(k,a){return{onSelectLDBuybox:function(c){var b=k.$;c=Deal.udpController.dealsInCurrentView[Deal.udpController.buyboxWidgetID];c!==e&&null!==c&&(c=c[0],c!==e&&"LIGHTNING_DEAL"===c.dealType&&(0<b("#priceblock_businessprice").size()?(b("#priceblock_businessprice_row").addClass("aok-hidden"),b("#priceblock_dealprice_row").removeClass("aok-hidden")):
(b("#priceblock_ourprice").removeClass("a-size-medium").addClass("a-size-base").removeClass("a-color-price").addClass("a-color-secondary").addClass("a-text-strike"),b("#priceblock_saleprice").removeClass("a-size-medium").addClass("a-size-base").removeClass("a-color-price").addClass("a-color-secondary").addClass("a-text-strike")),b("#priceblock_dealprice").removeClass("a-size-base").addClass("a-size-medium").removeClass("a-color-secondary").addClass("a-color-price"),b("#ourprice_shippingmessage").addClass("a-hidden"),
b("#businessprice_shippingmessage").addClass("aok-hidden"),b("#saleprice_shippingmessage").addClass("a-hidden"),b("#dealprice_shippingmessage").removeClass("a-hidden"),!0===gbResources.getCustomerData("suppressMultipleStrikeThroughPrices")&&(b("#priceblock_ourprice_row").addClass("aok-hidden"),b("#ourprice_creturns_message").addClass("aok-hidden"),b("#priceblock_saleprice_row").addClass("aok-hidden"),b("#priceblock_dealprice_row").removeClass("aok-hidden"),b("#dealprice_creturns_message").removeClass("aok-hidden")),
b("#priceblock_dealprice_row").find(".priceblock_vat_inc_price").addClass("a-color-price").removeClass("a-color-secondary"),b("#priceblock_dealprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").removeClass("a-hidden"),b("#priceblock_ourprice_row").find(".priceblock_vat_inc_price").removeClass("a-color-price").addClass("a-color-secondary"),b("#priceblock_ourprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").addClass("a-hidden"),
b("#priceblock_saleprice_row").find(".priceblock_vat_inc_price").removeClass("a-color-price").addClass("a-color-secondary"),b("#priceblock_saleprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").addClass("a-hidden"),b("#atfRedesign_priceblock_priceToPay, #atfRedesign_priceToPay_savings").removeClass("a-hidden"),b("#atfRedesign_priceblock_buyingPrice, #atfRedesign_buyingPrice_savings").addClass("a-hidden"),b("#atfRedesign_pricePerUnit").removeClass("a-hidden"),
b("#atfRedesign_buyingPricePerUnit").addClass("a-hidden"),l.when("A").execute(function(a){a.state("strikeThroughPrice")!==e&&a.state("strikeThroughPrice").hideStrikeThroughPrice&&b("#atfRedesign_strikeThroughPrice").removeClass("a-hidden")}),b("#dealprice_savings").removeClass("a-hidden"),b("#regularprice_savings").addClass("a-hidden"),b("#b2bnewprice_savings").addClass("a-hidden"),b("#negotiatedprice_savings").addClass("a-hidden"),b("#gbld_header_message").addClass("a-hidden"),b("#ourprice_fbabadge").addClass("a-hidden"),
0<b("#deal_availability").length&&!Deal.isPrimeOnlyDotd(c)&&a.renderDealAvailabilityMessage(),b("#product-price").removeClass("a-size-medium").addClass("a-size-base").removeClass("a-color-price").addClass("a-color-secondary"),b("#ourprice_addonitem").addClass("a-hidden"),b("#ourprice_prime").addClass("a-hidden"),k.trigger("deals_onSelectLDBuybox")))},onSelectRegularBuybox:function(c){var b=k.$;c=Deal.udpController.dealsInCurrentView[Deal.udpController.buyboxWidgetID];c!==e&&null!==c&&(c=c[0],c!==
e&&"LIGHTNING_DEAL"===c.dealType&&(0<b("#priceblock_businessprice").size()?(b("#priceblock_businessprice_row").removeClass("aok-hidden"),b("#priceblock_dealprice_row").addClass("aok-hidden")):(b("#priceblock_ourprice").removeClass("a-size-base").addClass("a-size-medium").removeClass("a-color-secondary").addClass("a-color-price").removeClass("a-text-strike"),b("#priceblock_saleprice").removeClass("a-size-base").addClass("a-size-medium").removeClass("a-color-secondary").addClass("a-color-price").removeClass("a-text-strike")),
b("#priceblock_dealprice").removeClass("a-size-medium").addClass("a-size-base").removeClass("a-color-price").addClass("a-color-secondary"),b("#ourprice_shippingmessage").removeClass("a-hidden"),b("#businessprice_shippingmessage").removeClass("aok-hidden"),b("#saleprice_shippingmessage").removeClass("a-hidden"),b("#dealprice_shippingmessage").addClass("a-hidden"),!0===gbResources.getCustomerData("suppressMultipleStrikeThroughPrices")&&(b("#priceblock_ourprice_row").removeClass("aok-hidden"),b("#ourprice_creturns_message").removeClass("aok-hidden"),
b("#priceblock_saleprice_row").removeClass("aok-hidden"),b("#priceblock_dealprice_row").addClass("aok-hidden"),b("#dealprice_creturns_message").addClass("aok-hidden")),b("#priceblock_dealprice_row").find(".priceblock_vat_inc_price").removeClass("a-color-price").addClass("a-color-secondary"),b("#priceblock_dealprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").addClass("a-hidden"),b("#priceblock_ourprice_row").find(".priceblock_vat_inc_price").addClass("a-color-price").removeClass("a-color-secondary"),
b("#priceblock_ourprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").removeClass("a-hidden"),b("#priceblock_saleprice_row").find(".priceblock_vat_inc_price").addClass("a-color-price").removeClass("a-color-secondary"),b("#priceblock_saleprice_row").find(".priceblock_vat_excl_label, .priceblock_vat_excl_price, .priceblock_vat_inc_label ").removeClass("a-hidden"),b("#atfRedesign_priceblock_priceToPay, #atfRedesign_priceToPay_savings").addClass("a-hidden"),
b("#atfRedesign_priceblock_buyingPrice, #atfRedesign_buyingPrice_savings").removeClass("a-hidden"),b("#atfRedesign_pricePerUnit").addClass("a-hidden"),b("#atfRedesign_buyingPricePerUnit").removeClass("a-hidden"),l.when("A").execute(function(a){a.state("strikeThroughPrice")!==e&&a.state("strikeThroughPrice").hideStrikeThroughPrice&&b("#atfRedesign_strikeThroughPrice").addClass("a-hidden")}),b("#dealprice_savings").addClass("a-hidden"),b("#regularprice_savings").removeClass("a-hidden"),b("#b2bnewprice_savings").removeClass("a-hidden"),
b("#negotiatedprice_savings").removeClass("a-hidden"),b("#gbld_header_message").removeClass("a-hidden"),b("#ourprice_fbabadge").removeClass("a-hidden"),0<b("#deal_availability").length&&a.renderRegularAvailabilityMessage(),b("#product-price").removeClass("a-size-base").addClass("a-size-medium").removeClass("a-color-secondary").addClass("a-color-price"),b("#ourprice_addonitem").removeClass("a-hidden"),b("#ourprice_prime").removeClass("a-hidden"),k.trigger("deals_onSelectRegularBuybox")))},onSelectBuybox:function(a){}}});
l.when("A","gb-udp-event-emitter","gb-udp-buybox-selector").register("gb-udp-deal-view",function(k,a,c){return a.extend(c).extend({className:"udp-deal-view",attribution:"GoldboxUDPAssets",timers:[],dealId:null,asin:null,widgetId:null,viewId:null,pushNotificationDetails:{},viewSpanIds:{appOnlyAccessMessage:"",appEarlyAccessMessage:"",spanATC:"",spanJoinWaitlist:"",spanWillNotify:"",spanTurnNotifOn:"",spanSoldOut:"",spanInCart:"",spanWaitInLine:"",spanPendingAtc:"",spanClaimed:"",spanDealOver:"",spanWaitlistFull:"",
spanDealTimerContainer:"",spanSpinner:"",availability:"",dotdCountdownTimer:"",dotdExpired:"",primeEarlyAccessMessage:"",primeOnlyAccessMessage:"",spanShowProgress:"",spanShowQuantity:"",spanPrimeOnlyDotdCartMessage:""},viewTimerSpanIds:{spanDealTimer:"",spanCheckoutTimer:"",spanPendingATCTimer:"",spanDealStsProgBar:"",spanDealStsPercent:"",spanDealStsAvailMsg:"",spanDealStsClaimedText:""},viewHeaderMsgSpanIds:{spanJoinWaitlist:"",spanSoldOut:"",spanInCart:"",spanWaitInLine:"",spanPendingAtc:"",spanClaimed:"",
spanDealOver:"",spanWaitlistFull:"",spanHeaderPrice:""},viewChangeOverSpanIds:{spanWaitInLine:"",spanInCart:"",spanDealOrderQuantity:"",spanBooksAvailabilitySection:"",spanBooksFastTrackMessaging:""},init:function(a,c,e){this._super();var f=this;f.timers=[];f.widgetId=a;f.viewId=c;f.pushNotificationDetails=Deal.udpController.getWidget("udpDealLDWidget").pushNotificationDetails;f.setDealInfo(e.dealId,e.asin);f.on("change",f.cleanup);f.on("change",f.render);l.when("A","ready").execute(function(a){a.on("a:accordion:buybox_accordion:gb_ld_buybox:select",
f.onSelectLDBuybox);a.on("a:accordion:buybox_accordion:regular_buybox:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox_accordion:sampling-accordion:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox_accordion:select",f.onSelectBuybox);a.on("a:accordion:buybox-accordion:gb_ld_buybox:select",f.onSelectLDBuybox);a.on("a:accordion:buybox-accordion:onetime-accordion:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:sns-accordion:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:sampling-accordion:select",
f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:select",f.onSelectBuybox);a.declarative("a-accordion",["click"],f.handleAccordionSelection);a.on("a:accordion:buybox-accordion:dealsAccordionRow:select",f.onSelectLDBuybox);a.on("a:accordion:buybox-accordion:newAccordionRow:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:SecondNewAccordionRow:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:usedAccordionRow:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRow:select",
f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobile:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileApp:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMovedUp:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMovedUp:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMovedUp:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMiddle:select",
f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMiddle:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMiddle:select",f.onSelectRegularBuybox);a.on("a:accordion:buybox-accordion:select",f.onSelectBuybox);a.on("alohaLDBuyBox",function(){f.onSelectLDBuybox()});a.on("alohaNormalBuyBox",function(){f.onSelectRegularBuybox()})});l.when("accordionBuyBoxJS","ready").execute(function(){var a=k.$;a("#usedBuySection").bind("click",
f.onSelectRegularBuybox);a("#buyNewSection").bind("click",f.onSelectRegularBuybox);a("#lightningDealSection").bind("click",f.onSelectLDBuybox)})},setPushNotificationDetails:function(a){this.pushNotificationDetails=a},setDealInfo:function(a,c){var e=k.$;this.dealId=a;this.asin=c;this.viewSpanIds.spanATC=e("#gb_atc_"+this.dealId);this.viewSpanIds.spanJoinWaitlist=e("#gb_join_waitlist_"+this.dealId);this.viewSpanIds.spanSoldOut=e("#deal_soldout_"+this.dealId);this.viewSpanIds.spanInCart=e("#deal_in_cart_"+
this.dealId);this.viewSpanIds.spanWaitInLine=e("#deal_wait_in_line_"+this.dealId);this.viewSpanIds.spanWillNotify=e("#deal_waitlisted_will_notify_"+this.dealId);this.viewSpanIds.spanTurnNotifOn=e("#deal_waitlisted_turn_on_notif_"+this.dealId);this.viewSpanIds.spanPendingAtc=e("#deal_pending_atc_"+this.dealId);this.viewSpanIds.spanClaimed=e("#deal_claimed_"+this.dealId);this.viewSpanIds.spanDealOver=e("#deal_over_"+this.dealId);this.viewSpanIds.spanWaitlistFull=e("#deal_waitlist_full_"+this.dealId);
this.viewSpanIds.spanDealTimerContainer=e("#dealCountdownTimer_"+this.dealId);this.viewSpanIds.spanSpinner=e("#deal_processing_"+this.dealId);this.viewSpanIds.availability=e("#deal_availability_"+this.dealId);this.viewSpanIds.dotdCountdownTimer=e("#dotd_countdown_timer_"+this.dealId);this.viewSpanIds.dotdExpired=e("#dotd_expired_"+this.dealId);this.viewSpanIds.primeEarlyAccessMessage=e("#primeEarlyAccessMessage_"+this.dealId);this.viewSpanIds.primeOnlyAccessMessage=e("#primeOnlyAccessMessage_"+this.dealId);
this.viewSpanIds.appEarlyAccessMessage=e("#appEarlyAccessMessage_"+this.dealId);this.viewSpanIds.appOnlyAccessMessage=e("#appOnlyAccessMessage_"+this.dealId);this.viewSpanIds.primeEarlyAccessWaitlistAvailableMessage=e("#primeEarlyAccessWaitlistAvailableMessage_"+this.dealId);this.viewSpanIds.primeEarlyAccessWaitlistFullMessage=e("#primeEarlyAccessWaitlistFullMessage_"+this.dealId);this.viewSpanIds.primeEarlyAccessTryPrimeButton=e("#tryPrimeButton_"+this.dealId);this.viewSpanIds.appDownloadButton=
e("#appDownloadButton_"+this.dealId);this.viewSpanIds.spanShowProgress=e("#deal_status_progress_"+this.dealId);this.viewSpanIds.spanShowQuantity=e("#dealOrderQuantity");this.viewSpanIds.spanPrimeOnlyDotdCartMessage=e("#deal_podotd_cart_message_"+this.dealId);this.viewTimerSpanIds.spanDealTimer=e("#deal_expiry_timer_"+this.dealId);this.viewTimerSpanIds.spanDealStsProgBar=e("#dealStatusProgressBar_"+this.dealId);this.viewTimerSpanIds.spanDealStsPercent=e("#dealStatusPercentage_"+this.dealId);this.viewTimerSpanIds.spanDealStsAvailMsg=
e("#dealStatusAvailability_"+this.dealId);this.viewTimerSpanIds.spanCheckoutTimer=e("#deal_checkout_timer_"+this.dealId);this.viewTimerSpanIds.spanPendingATCTimer=e("#deal_pending_atc_timer_"+this.dealId);this.viewTimerSpanIds.spanDealStsClaimedText=e("#dealStatusClaimedText_"+this.dealId);this.viewHeaderMsgSpanIds.spanJoinWaitlist=e("#gbld_header_msg_waitlistonly");this.viewHeaderMsgSpanIds.spanSoldOut=e("#gbld_header_msg_soldout");this.viewHeaderMsgSpanIds.spanInCart=e("#gbld_header_msg_incart");
this.viewHeaderMsgSpanIds.spanWaitInLine=e("#gbld_header_msg_inwaitlist");this.viewHeaderMsgSpanIds.spanPendingAtc=e("#gbld_header_msg_pendingatc");this.viewHeaderMsgSpanIds.spanClaimed=e("#gbld_header_msg_claimed");this.viewHeaderMsgSpanIds.spanWaitlistFull=e("#gbld_header_msg_waitlistfull");this.viewChangeOverSpanIds.spanWaitInLine=e("#gb_wl_joined_co");this.viewChangeOverSpanIds.spanInCart=e("#gb_in_cart_co");this.viewChangeOverSpanIds.spanDealOrderQuantity=e("#dealOrderQuantity");this.viewChangeOverSpanIds.spanBooksAvailabilitySection=
e("#books_availability_section_"+this.dealId);this.viewChangeOverSpanIds.spanBooksFastTrackMessaging=e("#dp-fast-track_feature_div_"+this.dealId)},cleanup:function(){if(this.timers){for(var a=0;a<this.timers.length;a++)this.timers[a].disconnect();this.timers=[]}else Deal.log("No timers to clean up. Returning.")},render:function(a){a!==e&&a?a.state!==e&&a.deal!==e&&a.state&&a.deal?(this.cleanup(),this.renderDealDetails(a.deal)):Deal.log("DealView.render: Unknown state / Null deal object. params :"+
JSON.stringify(a)):Deal.log("DealView.render: Null params specified")},updatePurchaseState:function(a){Deal.checkIfDealExpired(a)&&(this.hideSpansExcept(["spanDealOver"]),this.viewTimerSpanIds.spanDealStsProgBar.addClass("a-inactive"));if(a.dealAsinsHash[a.dealAsins[0].ASIN].status.state===Deal.inCartStr||a.dealAsinsHash[a.dealAsins[0].ASIN].status.state===Deal.pendingAtcStr)a.dealAsinsHash[a.dealAsins[0].ASIN].status.msToExpiry=0;a.trigger("change",a)},showChangeOver:function(a){a===Deal.inCartStr?
this.viewChangeOverSpanIds.spanInCart.show():this.viewChangeOverSpanIds.spanWaitInLine.show()},renderDealDetails:function(a){Deal.isPrimeOnlyDotd(a)?this.renderPrimeOnlyDealOfTheDayBuybox(a):Deal.dealTypes.LD===a.dealType?this.renderLightningDealBuybox(a):Deal.dealTypes.DOTD===a.dealType?this.renderDealOfTheDay(a):Deal.log("UDPWidgetView: Unsupported deal type caught in renderDealDetails")},renderDealOfTheDay:function(a){if(Deal.checkIfDealExpired(a))this.viewSpanIds.dotdCountdownTimer.addClass("a-hidden"),
this.viewSpanIds.dotdExpired.removeClass("a-hidden");else if(a.status&&a.status.endDate){var c=Deal.UDPTimer(a.status.endDate,0,a);c.span=this.viewTimerSpanIds.spanDealTimer;36E5>a.status.msToEnd&&(c.span&&0<c.span.length?c.span.addClass("a-color-success"):(a=k.$("#deal_expiry_timer_"+this.dealId).html(),l.log(["No timer found. looking up element in dom now for deal id: ",this.dealId," found: ",a].join(""),"WARN",this.attribution)));this.timers.push(c)}},renderPrimeOnlyDealOfTheDayBuybox:function(a){var c=
Deal.udpController.canCustomerClaimPrimeOnlyDOTD,e=Deal.udpController.isCustomerClaimingPrimeOnlyDOTD;if(null!=a.dealAsinsHash){var f=a.dealAsinsHash[this.asin];null!=f&&null!=f.status&&(f.offerServiceSoldOut?(this.hideSpansExcept(["spanSoldOut","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanSoldOut")):Deal.checkIfDealExpired(a)?(this.hideSpansExcept(["spanDealOver","spanShowProgress","spanShowQuantity"]),this.viewTimerSpanIds.spanDealStsProgBar.addClass("a-inactive"),this.updateHeaderMessage()):
gbResources.getCustomerData("hasExclusiveAccessBenefit")?c?e?this.hideSpansExcept("spanATC primeOnlyAccessMessage spanDealTimerContainer spanShowProgress spanShowQuantity spanInCart".split(" ")):this.hideSpansExcept(["spanATC","primeOnlyAccessMessage","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]):(this.hideSpansExcept(["spanATC","primeOnlyAccessMessage","spanDealTimerContainer","spanShowProgress","spanPrimeOnlyDotdCartMessage"]),this.viewSpanIds.spanATC.removeClass("a-hidden").addClass("a-hidden")):
this.hideSpansExcept(["primeOnlyAccessMessage","spanShowProgress","spanDealTimerContainer","primeEarlyAccessTryPrimeButton"]),a.status&&a.status.endDate&&(c=Deal.UDPTimer(a.status.endDate,0,a),c.span=this.viewTimerSpanIds.spanDealTimer,36E5>a.status.msToEnd&&(c.span&&0<c.span.length?c.span.addClass("a-color-success"):(a=k.$("#deal_expiry_timer_"+this.dealId).html(),l.log(["No timer found. looking up element in dom now for deal id: ",this.dealId," found: ",a].join(""),"WARN",this.attribution))),this.timers.push(c)))}},
renderLightningDealBuybox:function(a){if(null!==a.dealAsinsHash&&a.dealAsinsHash!==e){var c=a.dealAsinsHash[this.asin];null!==c&&c!==e&&null!==c.status&&c.status!==e&&(c.status.state===Deal.claimedStr?(this.hideSpansExcept(["spanClaimed","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanClaimed")):c.status.state===Deal.inCartStr?0<c.status.msToExpiry?(this.hideSpansExcept(["spanInCart"]),this.updateHeaderMessage("spanInCart")):this.hideSpansExcept(["spanSpinner"]):
Deal.checkIfDealExpired(a)?(this.hideSpansExcept(["spanDealOver","spanShowProgress","spanShowQuantity"]),this.viewTimerSpanIds.spanDealStsProgBar.addClass("a-inactive"),this.updateHeaderMessage()):c.status.state===Deal.pendingAtcStr?0<c.status.msToExpiry?a.detail.accessType!==Deal.accessTypeEnum.APP_ONLY_LD||gbResources.getCustomerData("isApp")?(this.hideSpansExcept(["spanPendingAtc","spanATC"]),this.updateHeaderMessage("spanPendingAtc")):this.hideSpansExcept(["spanShowProgress","appOnlyAccessMessage",
"appDownloadButton","spanShowQuantity"]):this.hideSpansExcept(["spanSpinner"]):c.status.state===Deal.waitInLineStr?(this.pushNotificationDetails!==e&&null!==this.pushNotificationDetails&&this.pushNotificationDetails.pushToken!==e&&null!==this.pushNotificationDetails.pushToken?this.hideSpansExcept(["spanWaitInLine","spanWillNotify","spanDealTimerContainer","spanShowProgress"]):this.hideSpansExcept(["spanWaitInLine","spanTurnNotifOn","spanDealTimerContainer","spanShowProgress"]),this.updateHeaderMessage("spanWaitInLine")):
c.offerServiceSoldOut||100<=c.status.percentSoldOut?(this.hideSpansExcept(["spanSoldOut","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanSoldOut")):100<=c.status.percentClaimed?c.status.currentlyUnavailable?Deal.isDealInEarlyAccessWindow(a)?a.detail.accessType===Deal.accessTypeEnum.PRIME_EARLY_ACCESS?gbResources.getCustomerData("hasEarlyAccessBenefit")?(this.hideSpansExcept(["spanWaitlistFull","spanDealTimerContainer","spanShowProgress","primeEarlyAccessMessage","spanShowQuantity"]),
this.updateHeaderMessage("spanWaitlistFull")):this.hideSpansExcept(["primeEarlyAccessMessage","spanShowProgress","primeEarlyAccessWaitlistFullMessage","spanShowQuantity"]):a.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS&&(gbResources.getCustomerData("isApp")?(this.hideSpansExcept(["spanWaitlistFull","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanWaitlistFull")):this.hideSpansExcept(["spanDealTimerContainer","spanShowProgress","appEarlyAccessMessage",
"appDownloadButton","spanShowQuantity"])):Deal.isPrimeOnlyDeal(a)?gbResources.getCustomerData("hasExclusiveAccessBenefit")?(this.hideSpansExcept(["spanWaitlistFull","spanDealTimerContainer","spanShowProgress","primeOnlyAccessMessage","spanShowQuantity"]),this.updateHeaderMessage("spanWaitlistFull")):this.hideSpansExcept(["primeOnlyAccessMessage","spanShowProgress","primeEarlyAccessWaitlistFullMessage","spanShowQuantity"]):a.detail.accessType===Deal.accessTypeEnum.APP_ONLY_LD?gbResources.getCustomerData("isApp")?
(this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","spanWaitlistFull","spanShowQuantity"]),this.updateHeaderMessage("spanWaitlistFull")):this.hideSpansExcept(["appOnlyAccessMessage","appDownloadButton","spanShowProgress","spanShowQuantity"]):(this.hideSpansExcept(["spanWaitlistFull","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanWaitlistFull")):Deal.isDealInEarlyAccessWindow(a)?a.detail.accessType===Deal.accessTypeEnum.PRIME_EARLY_ACCESS&&
gbResources.getCustomerData("hasEarlyAccessBenefit")?(this.hideSpansExcept(["spanJoinWaitlist","spanDealTimerContainer","spanShowProgress","primeEarlyAccessMessage","spanShowQuantity"]),this.updateHeaderMessage("spanJoinWaitlist")):a.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS?gbResources.getCustomerData("isApp")?(this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","spanShowQuantity","spanJoinWaitlist"]),this.updateHeaderMessage("spanJoinWaitlist")):this.hideSpansExcept(["spanShowProgress",
"spanDealTimerContainer","appEarlyAccessMessage","appDownloadButton","spanShowQuantity"]):this.hideSpansExcept(["primeEarlyAccessMessage","spanShowProgress","spanShowQuantity","spanDealTimerContainer","primeEarlyAccessWaitlistAvailableMessage"]):Deal.isPrimeOnlyDeal(a)?gbResources.getCustomerData("hasExclusiveAccessBenefit")?(this.hideSpansExcept(["spanJoinWaitlist","spanDealTimerContainer","spanShowProgress","primeOnlyAccessMessage","spanShowQuantity"]),this.updateHeaderMessage("spanJoinWaitlist")):
this.hideSpansExcept(["primeOnlyAccessMessage","spanShowProgress","spanShowQuantity","spanDealTimerContainer","primeEarlyAccessWaitlistAvailableMessage"]):a.detail.accessType===Deal.accessTypeEnum.APP_ONLY_LD?gbResources.getCustomerData("isApp")?(this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","spanJoinWaitlist","spanShowQuantity"]),this.updateHeaderMessage("spanJoinWaitlist")):this.hideSpansExcept(["appOnlyAccessMessage","spanShowProgress","spanShowQuantity","appDownloadButton"]):
(this.hideSpansExcept(["spanJoinWaitlist","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage("spanJoinWaitlist")):null!=c.status.percentClaimed&&100>c.status.percentClaimed?(Deal.isDealInEarlyAccessWindow(a)||(this.viewSpanIds.primeEarlyAccessMessage.addClass("a-hidden"),this.viewSpanIds.appEarlyAccessMessage.addClass("a-hidden"),a.detail.accessType===Deal.accessTypeEnum.APP_ONLY_LD?gbResources.getCustomerData("isApp")?this.hideSpansExcept(["spanShowProgress",
"spanDealTimerContainer","spanATC","spanShowQuantity"]):this.hideSpansExcept(["spanShowProgress","appOnlyAccessMessage","appDownloadButton","spanShowQuantity"]):Deal.isPrimeOnlyDeal(a)?this.hideSpansExcept(["spanATC","primeOnlyAccessMessage","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]):this.hideSpansExcept(["spanATC","spanDealTimerContainer","spanShowProgress","spanShowQuantity"]),this.updateHeaderMessage()),Deal.isDealInEarlyAccessWindow(a)?a.detail.accessType!==Deal.accessTypeEnum.PRIME_EARLY_ACCESS||
gbResources.getCustomerData("hasEarlyAccessBenefit")?a.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS&&(gbResources.getCustomerData("isApp")?this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","spanATC","spanShowQuantity"]):this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","appEarlyAccessMessage","appDownloadButton","spanShowQuantity"])):this.hideSpansExcept(["primeEarlyAccessMessage","spanShowProgress","spanShowQuantity","spanDealTimerContainer","primeEarlyAccessTryPrimeButton"]):
Deal.isPrimeOnlyDeal(a)&&!gbResources.getCustomerData("hasExclusiveAccessBenefit")?this.hideSpansExcept(["primeOnlyAccessMessage","spanShowProgress","spanShowQuantity","spanDealTimerContainer","primeEarlyAccessTryPrimeButton"]):a.detail.accessType===Deal.accessTypeEnum.APP_ONLY_LD&&(gbResources.getCustomerData("isApp")?this.hideSpansExcept(["spanShowProgress","spanDealTimerContainer","spanATC","spanShowQuantity"]):this.hideSpansExcept(["spanShowProgress","appOnlyAccessMessage","appDownloadButton",
"spanShowQuantity"]))):Deal.log("UDPWidgetView: unhandled case in renderLightningDealBuybox"),this.updateDealStatus(a))}},hideSpansExcept:function(a){var c,e;for(e in this.viewSpanIds){c=!1;for(var f in a)if(a[f]===e){c=!0;this.viewSpanIds[e].removeClass("a-hidden");break}!1===c&&this.viewSpanIds[e].addClass("a-hidden")}},updateHeaderMessage:function(a){k.$("#gbld_header_message").children().addClass("a-hidden");a!==e&&null!==a&&this.viewHeaderMsgSpanIds[a].removeClass("a-hidden")},updateDealStatus:function(a){var c,
g=a.dealAsinsHash[this.asin],f=null,f=null;if(g.status.state===Deal.inCartStr)c=(new Date).getTime(),f=new Date(c+parseInt(g.status.msToExpiry)),f=Deal.UDPTimer(f,1,a),f.span=this.viewTimerSpanIds.spanCheckoutTimer,this.timers.push(f);else if(g.status.state===Deal.pendingAtcStr)c=(new Date).getTime(),f=new Date(c+parseInt(g.status.msToExpiry)),f=Deal.UDPTimer(f,1,a),f.span=this.viewTimerSpanIds.spanPendingATCTimer,this.timers.push(f);else if(a.status.endDate){c=this.viewTimerSpanIds.spanDealTimer;
var m=this.viewTimerSpanIds&&c&&0<c.length;m||(f=k.$("#deal_expiry_timer_"+this.dealId).html(),l.log(["No timer found. looking up element in dom now for deal id: ",this.dealId," found: ",f].join(""),"WARN",this.attribution));Deal.isDealInEarlyAccessWindow(a)?a.detail.accessType!==Deal.accessTypeEnum.PRIME_EARLY_ACCESS||gbResources.getCustomerData("hasEarlyAccessBenefit")?a.detail.accessType===Deal.accessTypeEnum.APP_EARLY_ACCESS?(f=Deal.getEarlyAccessEndTime(a),m&&c.addClass("a-color-success")):(f=
a.status.endDate,m&&c.removeClass("a-color-success").addClass("a-color-base")):f=Deal.getEarlyAccessEndTime(a):(f=a.status.endDate,m&&c.removeClass("a-color-success").addClass("a-color-base"));f=Deal.UDPTimer(f,0,a);f.span=c;36E5>a.status.msToEnd&&m&&f.span.addClass("a-color-success");this.timers.push(f)}(c=g.status.percentClaimed)&&0<=parseFloat(c)&&100>=parseFloat(c)&&(c=Math.round(c),m=this.viewTimerSpanIds.spanDealStsProgBar.find("#progBarBase"),f=this.viewTimerSpanIds.spanDealStsProgBar.find("#progBarTick"),
m.css("width",c+"%"),f.css("width",c+"%"),this.viewTimerSpanIds.spanDealStsPercent.html(c+"%"),this.viewTimerSpanIds.spanDealStsAvailMsg.html(c+"%"),89>=c?(this.viewTimerSpanIds.spanDealStsPercent.removeClass("a-color-error").removeClass("a-color-success").addClass("a-color-base"),this.viewTimerSpanIds.spanDealStsClaimedText.removeClass("a-color-error").removeClass("a-color-success").addClass("a-color-base")):99>=c?(this.viewTimerSpanIds.spanDealStsPercent.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-success"),
this.viewTimerSpanIds.spanDealStsClaimedText.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-success")):(this.viewTimerSpanIds.spanDealStsPercent.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-error"),this.viewTimerSpanIds.spanDealStsClaimedText.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-error")),g.offerServiceSoldOut||100<=g.status.percentSoldOut||Deal.checkIfDealExpired(a))&&(m.removeClass("progbar"),f.removeClass("progbartick"),
m.addClass("progbarmissed"),f.addClass("progbartickmissed"));l.when("A").execute(function(c){var d=c.$;if(c.state("offerBadges")!==e){var f=c.state("offerBadges").displayOfferBadge;c=c.state("offerBadges").lightningDealString;!f||Deal.checkIfDealExpired(a)||Deal.isDealInEarlyAccessWindow(a)||Deal.isPrimeOnlyDeal(a)||0<d("#sticker-label").length&&d("#sticker-label").html(c)}});Deal.isDealInEarlyAccessWindow(a)||Deal.isPrimeOnlyDeal(a)||g.status.state===Deal.waitInLineStr||g.status.state===Deal.inCartStr||
this.viewChangeOverSpanIds.spanDealOrderQuantity.removeClass("a-hidden");Deal.isDealInEarlyAccessWindow(a)||Deal.isPrimeOnlyDeal(a)||(this.viewChangeOverSpanIds.spanBooksAvailabilitySection.removeClass("a-hidden"),this.viewChangeOverSpanIds.spanBooksFastTrackMessaging.removeClass("a-hidden"));Deal.isDealInEarlyAccessWindow(a)&&l.when("A").execute(function(a){a.on("a:popover:show:primePopoverContent",function(a){a.popover.$container.find("button").css("display","block")})})},expandLDBuybox:function(){k.$("#gb_ld_buybox").trigger("click")},
expandRegularBuybox:function(){k.$("#regular_buybox").trigger("click")},handleAccordionSelection:function(a){l.when("A").execute(function(c){var e=a.$target.closest(".a-accordion"),f=a.$target.closest(".a-box");c=f.find(".a-accordion-row");var f=e.find(".a-box").not(f).find(".a-accordion-row"),e=f.find(".gb-accordion-active"),f=f.find(".a-color-price"),k=c.find(".gb-accordion-inactive");c=c.find(".a-color-secondary");e.removeClass("gb-accordion-active").addClass("gb-accordion-inactive");f.removeClass("a-color-price").addClass("a-color-secondary");
k.removeClass("gb-accordion-inactive").addClass("gb-accordion-active");c.removeClass("a-color-secondary").addClass("a-color-price")})}})});l.when("A").execute("gb-udp-bootstrap",function(e){k.Deal||(k.Deal={});k.gbResources||(k.gbResources=new GBResources);k.Deal.configManager||l.when("gb-deal-config-manager").execute(function(a){Deal.configManager=new a({controllerConfig:{versionInfo:"",login_uri:""},dealContentServiceConfig:{continueRequests:!0,timeout:"10",baseRetryInterval:6E4,baseURL:"http://internal.amazon.com/coral/com.amazon.dcs.model/",
client_id:"goldbox_udp"}})});k.Deal.Widgets||(k.Deal.Widgets=[])});"use strict";k.P&&k.P.AUI_BUILD_DATE&&l.when("gb-udp-controller","gb-udp-deal-widget").register("udp_ld_widget_js",function(e,a){k.UDPDealController=e;k.UDPDealWidget=a;k.Backbone={setDomLibrary:function(){}};return{dealUdpComponent:function(){}}});l.when("A").register("gb-udp-availability-message-controller",function(e){var a=e.$;return{renderDealAvailabilityMessage:function(){if(0<a("#dealsAccordionRow").length){a("#centerCol #deal_availability").removeClass("a-hidden");
a("#centerCol #availability").addClass("a-hidden");var c=a("#newAccordionRow, #SecondNewAccordionRow");c.find("#deal_availability").removeClass("a-hidden");c.find("#availability").addClass("a-hidden");c=a("#snsAccordionRow, #snsAccordionRowMobile, #snsAccordionRowMobileApp, #snsAccordionRowMovedUp, #snsAccordionRowMobileMovedUp, #snsAccordionRowMobileAppMovedUp, #snsAccordionRowMiddle, #snsAccordionRowMobileMiddle, #snsAccordionRowMobileAppMiddle");c.find("#deal_availability").removeClass("a-hidden");
c.find("#availability").addClass("a-hidden")}else a("#deal_availability").removeClass("a-hidden"),a("#availability").addClass("a-hidden")},renderRegularAvailabilityMessage:function(){if(0<a("#dealsAccordionRow").length){a("#centerCol #deal_availability").addClass("a-hidden");a("#centerCol #availability").removeClass("a-hidden");var c=a("#newAccordionRow, #SecondNewAccordionRow");c.find("#deal_availability").addClass("a-hidden");c.find("#availability").removeClass("a-hidden");c=a("#snsAccordionRow, #snsAccordionRowMobile, #snsAccordionRowMobileApp, #snsAccordionRowMovedUp, #snsAccordionRowMobileMovedUp, #snsAccordionRowMobileAppMovedUp, #snsAccordionRowMiddle, #snsAccordionRowMobileMiddle, #snsAccordionRowMobileAppMiddle");
c.find("#deal_availability").addClass("a-hidden");c.find("#availability").removeClass("a-hidden")}else a("#deal_availability").addClass("a-hidden"),a("#availability").removeClass("a-hidden")}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("SoftlinesRecsUDPAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(f){var p=window.AmazonUIPageJS||window.P,g=p._namespace||p.attributeErrors,b=g?g("BabyRegistryDPAssets"):p;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,p,g){f.when("A","jumpstart-popover-simulate-utils","jumpstart-carousel","ready").register("jumpstart-category-actions",function(b,d,e){var c=b.$;return{showSubCat:function(a){c(".js-widget-subcat-row").hide();c("#js-subcat-row-"+a).show();c(".jumpstart-category-item").removeClass("category-selected");
c("#jumpstart-category-"+a).addClass("category-selected")},showFirstAvailableSubCat:function(a){c(a).show()},simulatePopoverArrow:function(a){var b=d.getCategoryRowWidth(".js-widget-main-row");a=d.getPopoverLeftPosition(b,a);d.setPostion(a)},toggleJumpstartWidget:function(a,n){var d=this,e=c("#jumpstart-regular-expand"),g=c("#jumpstart-regular-collapse");b.slideToggle(c(".js-subCat-section"),100,"ease",function(){0===n?(d.initializeRegularJumpstartWidget(a.firstAvailableCategoryName,a.firstAvailableCategoryNumber,
a.dismissStatus),e.hide(),g.removeClass("a-hidden"),g.show()):(g.hide(),e.removeClass("a-hidden"),e.show())})},dismissJumpstart:function(a,e,d){var g=this;a.update("updateJumpstartDismissStatus",e,function(a){0!==a.ok&&1===a.hasUpdated&&(a=parseInt(a.newDismissStatus,10),b.state("jumpstart-init-state",{dismissedStatus:a}),g.dismissedStateDisplay(a),"regular"===d?g.toggleJumpstartWidget(e,a):"popover"===d&&(c("#js-widget-popover-box").hide(),c(".jumpstart-divider-class").hide()))})},initCarouselAfterAction:function(a){e.initializeCarousel();
e.updatePaginationForCarousel("jumpstart-"+(a-1))},dismissedStateDisplay:function(a){0===a?(c(".jumpstart-category-item").css("margin-bottom","0px"),c(".jumpstart-category-item").css("padding-bottom","0px")):1===a&&(c(".jumpstart-category-item").removeClass("category-selected"),c(".jumpstart-category-item").css("margin-bottom","-14px"),c(".jumpstart-category-item").css("padding-bottom","14px"))},initializeRegularJumpstartWidget:function(a,b,c){this.showSubCat(a);this.simulatePopoverArrow(b);this.dismissedStateDisplay(c);
this.initCarouselAfterAction(b)}}});f.when("A","jumpstart-category-actions","jumpstart-carousel","baby-reg-js-update","ready").register("jumpstart-declarative-actions",function(b,d,e,c){b.declarative("show-subcat-action","click",function(a){a=a.data;var e=b.state("jumpstart-init-state");e!==g&&1===e.dismissedStatus&&d.dismissJumpstart(c,{registryId:e.registryId,sid:e.sid,firstAvailableCategoryName:a.subcat_name,firstAvailableCategoryNumber:a.category_number,dismissStatus:0,isSable:1},"regular");d.showSubCat(a.subcat_name);
d.simulatePopoverArrow(a.category_number);d.initCarouselAfterAction(a.category_number)})});f.when("A","baby-reg-js-update","jumpstart-category-actions","ready").register("jumpstart-dismissed-actions",function(b,d,e){var c=b.$;b.on("pageStateReady",function(a){var n=c("#jumpstart-regular-expand"),f=c("#jumpstart-regular-collapse"),k="regular",l={isSable:1,dismissStatus:null,registryId:null,sid:null,firstAvailableCategoryName:null,firstAvailableCategoryNumber:null};a!==g&&(k=a.widgetType,0===a.dismissedStatus?
(c(".js-subCat-section").css("display","block"),f.removeClass("a-hidden"),f.show(),n.hide()):(c(".js-subCat-section").css("display","none"),n.show(),f.hide()));b.declarative("dismiss-jumpstart","click",function(a){a=b.state("jumpstart-init-state");l.registryId=a!==g?a.registryId:null;l.sid=a!==g?a.sid:null;l.firstAvailableCategoryName=a!==g?a.firstAvailableCategoryName:null;l.firstAvailableCategoryNumber=a!==g?a.firstAvailableCategoryNumber:null;a!==g&&(l.dismissStatus=0===a.dismissedStatus?1:0);
e.dismissJumpstart(d,l,k)})})});f.when("A","ready").register("jumpstart-popover-simulate-utils",function(b){var d=b.$;return{getCategoryRowWidth:function(b){return d(b).width()},getPopoverLeftPosition:function(b,c){var a=2*b/100,d=(b-10*a)/12;return Math.ceil(2*d+c*d+a*c-d/2)},setPostion:function(b){d("#js-popover-arrow").css({position:"absolute",top:"-7px",left:b})}}});f.when("A","baby-reg-js-update","jumpstart-carousel","jumpstart-widget-retrieval","ready").register("jumpstart-widget-init",function(b,
d,e,c){var a=b.$;d=b.state("jumpstart-init-state");if("regular"===(d!==g?d.widgetType:null)){d=b.state("baby-reg-util");var n={sid:d!==g?d.sid:null,isJumpstart:1,widgetType:"regular",isSync:"true"};c.getJumpstart(n);b.declarative("retrieve-jumpstart-action","click",function(b){a("#jumpstart-error").addClass("js-hidden");a("#jumpstart-spinner").show();c.getJumpstart(n)})}});f.when("A","baby-reg-js-update","jumpstart-category-actions","ready").register("jumpstart-widget-retrieval",function(b,d,e){var c=
b.$;return{getJumpstart:function(a){d.update("syncAndGetJumpstartContent",a,function(a){0!==a.ok&&1===a.isSync?(c("#jumpstart-widget-container").html(a.jumpstartNewContent),a={dismissedStatus:Number(c("#dismissedStatus").val()),completionStatus:Number(c("#completionStatus").val()),categorySize:Number(c("#categorySize").val()),registryId:c("#registryId").val(),firstAvailableCategoryNumber:Number(c("#firstAvailableCategoryNumber").val()),widgetType:c("#widgetType").val(),sid:c("#sid").val(),percent:Number(c("#percent").val()),
firstAvailableCategoryName:c("#firstAvailableCategoryName").val()},b.state("jumpstart-init-state",a),b.trigger("pageStateReady",a),e.initializeRegularJumpstartWidget(a.firstAvailableCategoryName,a.firstAvailableCategoryNumber,a.dismissedStatus)):(c("#jumpstart-spinner").hide(),c("#jumpstart-error").removeClass("js-hidden"))})}}});f.when("A","a-carousel-framework","ready").register("jumpstart-carousel",function(b,d){for(var e=b.$,c=0;10>c;c++)d.onInit("jumpstart-"+c,function(a){1===a.getAttr("totalPages")?
e(".jumpstart-carousel-pagination-buttons").css("visibility","hidden"):e(".jumpstart-carousel-pagination-buttons").css("visibility","visible")});return{updatePaginationForCarousel:function(a){1===d.getCarouselByName(a).getAttr("totalPages")?e(".jumpstart-carousel-pagination-buttons").css("visibility","hidden"):e(".jumpstart-carousel-pagination-buttons").css("visibility","visible")},initializeCarousel:function(){d.createAll();d.initializeAll()}}});f.when("A","ready").register("get-started-meter-animation",
function(b){b.on("pageStateReady",function(d){b.$(".animationMeterBar > .a-meter-bar").delay(400).animate({width:d.percent+"%"},600)})});f.when("A","baby-reg-js-update","ready").register("get-started-declarative-actions",function(b,d){b.declarative("start-jumpstart-action","click",function(e){var c=b.$;e=e.data;var a=b.state("baby-reg-util");e={isSable:1,completionStatus:1,update:"updateJumpstartCompletionStatus",registryId:e!==g?e.registryId:null,sid:a!==g?a.sid:null};c("#getStartedError").hasClass("js-hidden")||
c("#getStartedError").addClass("js-hidden");d.update("updateJumpstartCompletionStatus",e,function(a){a&&1===a.hasUpdated?(c("#js-widget-box").removeClass("js-hidden"),c("#getStartedBox").addClass("js-hidden")):c("#getStartedError").removeClass("js-hidden")})})});f.when("A").register("baby-reg-js-update",function(b){var d=b.$;return{update:function(e,c,a){e=d.extend({},{ref:"baby_reg_js_update_"+e,update:e,forceAjax:1},c);b.post("/gp/baby/api/update.html/ref="+e.ref,{params:e,success:function(b){a(b)},
failure:function(){a({ok:0})}})}}});f.when("A","a-popover","baby-reg-js-update","jumpstart-carousel","ready").register("jumpstart-mark-complete-actions",function(b,d,e,c){var a=b.$,f=!0,q=0,k=[],l=!1,p={},r=function(b,h){var c=a("#mark_complete_modal_item_"+b),d=a("#checkmarkBox_"+b),e=a("#checkmark-gray_"+b),g=a("#checkmark-orange_"+b);c.removeClass("item-mark-modal-gray");c.addClass("item-mark-modal-orange");d.removeClass("js-hidden");e.removeClass("js-hidden");g.addClass("js-hidden");
1!==h&&(d.removeClass("checkmark-box-gray"),d.addClass("checkmark-box-orange"),e.addClass("js-hidden"),g.removeClass("js-hidden"))},t=function(b,h){var c=a("#mark_complete_modal_item_"+b),d=a("#checkmarkBox_"+b),e=a("#checkmark-gray_"+b),g=a("#checkmark-orange_"+b);e.removeClass("js-hidden");g.addClass("js-hidden");d.removeClass("checkmark-box-orange");1===h&&(c.addClass("item-mark-modal-gray"),c.removeClass("item-mark-modal-orange"),e.addClass("js-hidden"),g.addClass("js-hidden"),d.addClass("js-hidden"));
d.addClass("checkmark-box-gray")},u=function(b){if(!1===l){var h=b.$currentTarget.closest(".a-popover");b=h.find(a("input[name=markedItemNumber]")).val();h=h.find(a("input[name=markedItems]")).val();q=b?b:0;b=h.substring(1,h.length-1);0<b.length&&(k=b.split(", "));l=!0}},w=function(b,h){var c=h.find(a("input[name=categoryName]")).val(),c=a("#mark-complete-modal-submit-button-"+c);-1===k.indexOf(b)&&(a("#mark_complete_modal_item_"+b),q++,k[k.length]=b,0<q&&c.hasClass("a-button-disabled")&&c.removeClass("a-button-disabled"),
r(b,0))},x=function(b,c){var d=c.find(a("input[name=categoryName]")).val(),d=c.find(a("#mark-complete-modal-submit-button-"+d)),e=k.indexOf(b);-1!==e&&(a("#mark_complete_modal_item_"+b),q--,k.splice(e,1),0<=q&&d.hasClass("a-button-disabled")&&d.removeClass("a-button-disabled"),t(b,1))},v=function(b){var c=b.$currentTarget.closest(".a-popover");b=c.find(".selected-count");c=c.find(a("input[name=selectQty]")).val();b.html(c.replace("{num}",q))},y=function(){q=0;k=[];l=!1};b.declarative("br-mark-action",
["mouseenter","mouseleave"],function(b){b.$event.preventDefault();if(b&&b.data){var c=b.data;u(b);b=b.$event.type;1===a("#mark_complete_modal_item_"+c).data("savedFromMarkModal")&&(f=!0,p[c]=0,a("#mark_complete_modal_item_"+c).data("savedFromMarkModal",0));if(f&&1!==p[c]){var d=k.indexOf(c);a("#mark_complete_modal_item_"+c);"mouseenter"===b?-1!==d?t(c,0):r(c,1):"mouseleave"===b&&(-1===d?t(c,1):r(c,0))}}});b.declarative("br-mark-action",["click"],function(a){a.$event.preventDefault();var b=a.data,
c=a.$currentTarget.closest(".a-popover");-1!==k.indexOf(b)?x(b,c):w(b,c);v(a)});b.declarative("br-mark-select-all",["click"],function(a){u(a);a.$event.preventDefault();for(var b=a.data,b=b.substring(1,b.length-1).split(","),c=a.$currentTarget.closest(".a-popover"),d=0;d<b.length;d++)w(b[d].trim(),c);v(a)});b.declarative("br-mark-select-none",["click"],function(a){u(a);a.$event.preventDefault();for(var b=a.$currentTarget.closest(".a-popover"),c=k.length-1;0<=c;c--)x(k[c],b);v(a)});b.declarative("mark-complete-save",
["click"],function(d){d.$event.preventDefault();var h=d.data,f=b.state("jumpstart-init-state"),m=d.$currentTarget.closest(".a-popover"),p=m.find(a("input[name=categoryName]")).val();if(!m.find(a("#mark-complete-modal-submit-button-"+p)).hasClass("a-button-disabled")){var n=f!==g?f.completionStatus:null,h={isRAW:1,customerId:h!==g?h.customerId:null,registryId:h!==g?h.registryId:null,categoryName:h!==g?h.category:null,sid:f!==g?f.sid:null,type:"baby",items:0<k.length?k:"",numItems:q},m=d.$currentTarget.closest(".a-popover");
m.find("#mark-complete-modal-loading").removeClass("js-hidden");m.find("#mark-complete-modal-content").addClass("js-hidden");e.update("markJumpstartItems",h,function(d){0!==d.ok?(q=0,k=[],l=!1,d={sid:null,isJumpstart:1,widgetType:null,isSync:"false"},d.sid=f!==g?f.sid:null,d.widgetType=f!==g?f.widgetType:null,e.update("syncAndGetJumpstartContent",d,function(d){0!==d.ok&&1===d.isSync?(a("#jumpstart-widget-container").html(d.jumpstartNewContent),m.find("#mark-complete-modal-content").html(""),f={dismissedStatus:Number(a("#dismissedStatus").val()),
completionStatus:Number(a("#completionStatus").val()),categorySize:Number(a("#categorySize").val()),registryId:a("#registryId").val(),firstAvailableCategoryNumber:Number(a("#firstAvailableCategoryNumber").val()),widgetType:a("#widgetType").val(),sid:a("#sid").val(),percent:Number(a("#percent").val()),firstAvailableCategoryName:a("#firstAvailableCategoryName").val()},b.state("jumpstart-init-state",f),(3!==n&&3===f.completionStatus||3===n&&3!==f.completionStatus)&&b.trigger("jumpstartComplete"),a("#jumpstart-category-"+
f.firstAvailableCategoryName).click(),a("#jumpstart-regular-expand").hide(),a("#js-widget-popover-box").removeClass("a-hidden"),c.initializeCarousel(),m.find(".a-button-close").click()):(m.find("#mark-complete-modal-loading").addClass("js-hidden"),m.find("#mark-complete-modal-error").removeClass("js-hidden"))})):(m.find("#mark-complete-modal-loading").addClass("js-hidden"),m.find("#mark-complete-modal-error").removeClass("js-hidden"))})}});b.on("pageStateReady",function(c){var d=a("#jumpstart-category-strings").val();
if(d!==g&&2<d.length&&(c=[],d=d.substring(1,d.length-1),0<d.length&&(c=d.split(", ")),0<c.length))for(d=0;d<c.length;d++)b.on("a:popover:beforeHide:mark-as-complete-"+c[d],y),b.on("a:popover:beforeUpdatePosition:mark-as-complete-"+c[d],y)})});f.when("A","a-popover","jumpstart-declarative-actions","ready").register("jumpstart-popover-actions",function(b,d,e){d=b.state("jumpstart-init-state");e=b.$;"popover"===(d!==g?d.widgetType:null)&&(b.trigger("pageStateReady",d),e("#js-widget-popover-box").removeClass("a-hidden"))})});
/* ******** */
(function(c){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,a=h?h("RetailPricingFeedbackAsset"):g;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,g,h){c.when("A","a-popover","tellMeMoreLinkData","ready").execute(function(a,c){function b(d){if(d!==h){var a=d.title,b=encodeURI("&originalURI="+g.location.pathname),b=d.url+b;d=d.trigger;d="#"+d;var k=e(d),l={url:b,header:a,width:450,activate:"onclick",position:"triggerLeft",closeButton:"true",
popoverLabel:a,closeButtonLabel:"Dismiss"};null!==a&&null!==b&&null!==d&&(null!==f&&c.remove(f),f=c.create(k,l).lock())}}var e=a.$,f=null;b(a.state("lowerPricePopoverData"));a.state.bind("lowerPricePopoverData",function(a,f){b(a)});e(document).delegate("button#pfw_close_close-announce","click",function(a){a.preventDefault();f.unlock().hide();f.lock()});e(document).delegate("button#pfw_cancel_close-announce","click",function(a){a.preventDefault();f.unlock().hide();f.lock()})});c.when("A","a-popover",
"ready").execute(function(a,c){var b=a.$,e=c.get(b("#pricingFeedbackPopup"));b(document).delegate("button#pfw_close_close-announce","click",function(a){a.preventDefault();e.unlock().hide();e.lock()});b(document).delegate("button#pfw_cancel_close-announce","click",function(a){a.preventDefault();e.unlock().hide();e.lock()})})});
/* ******** */
(function(p){var h=window.AmazonUIPageJS||window.P,r=h._namespace||h.attributeErrors,q=r?r("DetailPageCouponsAssets",""):h;q.guardFatal?q.guardFatal(p)(q,window):q.execute(function(){p(q,window)})})(function(p,h,r){p.when("A","ready").register("vpcCommonFunctions",function(a){return{clipAjax:function(l,b,f,m,d,e,k,c){c||(c="clip_coupon");a.$.ajax({type:"GET",url:"/gp/promotions/vpc/ref\x3d"+c+"?ie\x3dUTF8\x26promoId\x3d"+l+"\x26source\x3ddp_"+b+"\x26merchantID\x3d"+f+"\x26sku\x3d"+m+"\x26asin\x3d"+
b,headers:{"anti-csrftoken-a2z":d},success:e,error:k})},publishImpression:function(l,b,f,m,d){h.ue&&h.ue.tag&&h.ue.tag("digital_coupon_dp");var e=("https:"===location.protocol?"https://":"http://")+h.ue_furl+"/1/action-impressions/1/OP/vpc/promotion/";m=m||a.$("#couponFeature").attr("data-vpcpromoid");d=d||a.$("#couponFeature").attr("data-vpcasin");f="vpc_i_"+m+"_"+d+"_dp_"+f+"_";l=e+((b?l?f+"r":f+"nr":f+"nc")+":"+m);l=l+"?marketplaceId\x3d"+h.ue_mid+"\x26requestId\x3d"+h.ue.rid+"\x26session\x3d"+
h.ue_sid;(new Image).src=l},logException:function(a,b){b={logLevel:"FATAL",attribution:"digital_coupon_dp",message:b};h.ueLogError&&h.ueLogError(a,b)}}});"use strict";p.when("A","vpcCommonFunctions").register("vpc-ccx",function(a,l){return{initialize:function(b){var f=!1,m=function(){return a.$("#couponFeature").hasClass("vpc_clipped")},d=function(){return a.$("#couponFeature").hasClass("vpc_signedIn")},e=function(){a.$("#couponFeature").addClass("vpc_clip_error");a.$("#couponFeature").removeClass("vpc_clipped");
a.$("#couponFeature").removeClass("vpc_unclipped");f=!0},k=function(b){try{m()||(-1<b.indexOf("SUCCESS")||-1<b.indexOf("REDEEMED")?(a.$("#couponFeature").removeClass("vpc_unclipped"),a.$("#couponFeature").addClass("vpc_clipped")):e(),"function"===typeof h.displaySpecialOffersClipCouponResult&&h.displaySpecialOffersClipCouponResult(b))}catch(c){l.logException(c,"JS error when display clip coupon result")}};a.$("#couponFeature").length&&(h.displayClipCouponResult=k);var c=function(a,b,c){e()},n=function(g){try{d()?
l.clipAjax(a.$("#couponFeature").attr("data-vpcpromoid"),a.$("#couponFeature").attr("data-vpcasin"),a.$("#couponFeature").attr("data-vpcmerchantid"),a.$("#couponFeature").attr("data-vpcsku"),a.$("#couponFeature").attr("data-vpccsrftoken"),k,c):h.location=b.signinUrl?b.signinUrl:"/gp/sign-in.html/ref\x3dsr_1_1?ie\x3dUTF8\x26email\x3d\x26redirectASIN\x3d"+a.$("#couponFeature").attr("data-vpcasin")+"\x26disableCorpSignUp\x3d\x26path\x3d%2Fgp%2Fcoupon%2Fc%2F"+a.$("#couponFeature").attr("data-vpcpromoid")+
"\x26redirectProtocol\x3d\x26mode\x3d\x26useRedirectOnSuccess\x3d1",g.preventDefault()}catch(n){l.logException(n,"JS error when clipping coupon on CCX page")}},g=function(){f||(a.$("#couponFeature").addClass("vpc_oneTimeBuy"),a.$("#couponFeature").removeClass("vpc_sns"))},t=function(){f||(a.$("#couponFeature").removeClass("vpc_oneTimeBuy"),a.$("#couponFeature").addClass("vpc_sns"))};a.$("#couponFeature").length&&l.publishImpression(m(),d(),"db");a.$(".ccx_dpv2 #vpcButton").find(".a-button").click(n);
a.$(".ccx_dpv2 #vpcButtonSns").find(".a-button").click(n);b.snsOptIn&&(p.when("a-checkbox").execute(function(a){a("#snsOptInCheckbox").isChecked()?t():g()}),a.declarative("sns-opt-in-checked","change",function(a){a.$target.is(":checked")?"function"===typeof t&&t():"function"===typeof g&&g()}))}}});"use strict";p.when("A","vpcCommonFunctions").register("vpc-price-block",function(a,l){return{initialize:function(b){var f=b.loggedIn,m=!1,d=function(c){try{var g="#couponFeature"+b.vpc.id+" .vpc_unclipped";
a.$(g).hasClass("vpc_clipped")||(-1<c.indexOf("SUCCESS")||-1<c.indexOf("REDEEMED")?(a.$(g).addClass("vpc_clipped"),a.$(g).removeClass("vpc_unclipped")):(a.$(g).addClass("vpc_clip_error"),a.$(g).removeClass("vpc_unclipped"),a.$(g).removeClass("vpc_clipped"),m=!0),"function"===typeof h.displaySpecialOffersClipCouponResult&&h.displaySpecialOffersClipCouponResult(c))}catch(n){l.logException(n,"JS error when display clip coupon result")}},e=function(c){try{if(f)0<a.$(c.currentTarget).closest(".couponFeature").attr("id").indexOf(b.vpc.id)&&
(l.clipAjax(b.vpc.id,b.vpc.asin,b.vpc.merchantID,b.vpc.sku,b.vpc.csrfToken,d),c.preventDefault());else return h.location=b.signinUrl?b.signinUrl:"/gp/sign-in.html/ref\x3dsr_1_1?ie\x3dUTF8\x26email\x3d\x26redirectASIN\x3d${vendorPoweredCoupon.asin}\x26disableCorpSignUp\x3d\x26path\x3d%2Fgp%2Fcoupon%2Fc%2F${vendorPoweredCoupon.id}\x26redirectProtocol\x3d\x26mode\x3d\x26useRedirectOnSuccess\x3d1",c.preventDefault(),!0}catch(g){l.logException(g,"JS error when cliping coupon on UDP page")}},k=function(){m||
(a.$(".couponFeature").addClass("vpc_oneTimeBuy"),a.$(".couponFeature").removeClass("vpc_sns"),a.$(".couponFeature").removeClass("vpc_alm"))},c=function(){m||(a.$(".couponFeature").removeClass("vpc_oneTimeBuy"),a.$(".couponFeature").addClass("vpc_sns"),a.$(".couponFeature").removeClass("vpc_alm"))},n=function(){m||(a.$(".couponFeature").removeClass("vpc_oneTimeBuy"),a.$(".couponFeature").removeClass("vpc_sns"),a.$(".couponFeature").addClass("vpc_alm"))};l.publishImpression(b.clickedClipCoupon,f,"db");
a.$("#vpcButton").find(".a-button").click(e);a.$("#vpcButtonSns").find(".a-button").click(e);a.$("#vpcButton").find(".a-checkbox").click(e);a.$("#vpcButtonSns").find(".a-checkbox").click(e);a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#snsBuyBox")?c():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#oneTimeBuyBox")?k():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#LDBuybox")&&k();a.off("a:accordion:buybox-accordion:onetime-accordion:select",k);a.off("a:accordion:buybox-accordion:sns-accordion:select",
c);a.off("a:accordion:buybox-accordion:gb_ld_buybox:select",k);a.on("a:accordion:buybox-accordion:sns-accordion:select",c);a.on("a:accordion:buybox-accordion:onetime-accordion:select",k);a.on("a:accordion:buybox-accordion:gb_ld_buybox:select",k);a.$(".a-accordion-active").is("#newAccordionRow")?k():a.$(".a-accordion-active").is("#SecondNewAccordionRow")?k():a.$(".a-accordion-active").is("#dealsAccordionRow")?k():a.$(".a-accordion-active").is("#snsAccordionRow")?c():a.$(".a-accordion-active").is("#snsAccordionRowMovedUp")?
c():a.$(".a-accordion-active").is("#snsAccordionRowMiddle")&&c();a.off("a:accordion:buybox-accordion:newAccordionRow:select",k);a.off("a:accordion:buybox-accordion:SecondNewAccordionRow:select",k);a.off("a:accordion:buybox-accordion:dealsAccordionRow:select",k);a.off("a:accordion:buybox-accordion:snsAccordionRow:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMovedUp:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMiddle:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobile:select",
c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileApp:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileMovedUp:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileAppMovedUp:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileMiddle:select",c);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileAppMiddle:select",c);a.off("a:accordion:buybox-accordion:almAccordionRow:select",n);a.off("a:accordion:buybox-accordion:mobile_almAccordionRow:select",
n);a.off("a:accordion:buybox-accordion:mobileapp_almAccordionRow:select",n);a.on("a:accordion:buybox-accordion:newAccordionRow:select",k);a.on("a:accordion:buybox-accordion:SecondNewAccordionRow:select",k);a.on("a:accordion:buybox-accordion:dealsAccordionRow:select",k);a.on("a:accordion:buybox-accordion:snsAccordionRow:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMovedUp:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMiddle:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobile:select",
c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileApp:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMovedUp:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMovedUp:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMiddle:select",c);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMiddle:select",c);a.on("a:accordion:buybox-accordion:almAccordionRow:select",n);a.on("a:accordion:buybox-accordion:mobile_almAccordionRow:select",
n);a.on("a:accordion:buybox-accordion:mobileapp_almAccordionRow:select",n);b.snsOptIn&&(p.when("a-checkbox").execute(function(a){a("#snsOptInCheckbox").isChecked()?c():k()}),a.declarative("sns-opt-in-checked","change",function(a){a.$target.is(":checked")?"function"===typeof c&&c():"function"===typeof k&&k()}));var g=a.$(".couponTable");a.$("#usedBuySection").click(function(){g&&!g.hasClass("hideCoupon")&&g.addClass("hideCoupon")});a.$("#buyNewSection").click(function(){g&&g.hasClass("hideCoupon")&&
g.removeClass("hideCoupon")});a.$("#rentBuySection").click(function(){g&&!g.hasClass("hideCoupon")&&g.addClass("hideCoupon")})}}});p.when("A","vpcCommonFunctions").register("vpc-price-block-unified",function(a,l){return{initialize:function(b){var f=b.vpc.id,m=b.loggedIn,d=!1,e=function(b){try{var c=".couponFeature"+f+" .vpc_unclipped";a.$(c).hasClass("vpc_clipped")||(-1<b.indexOf("SUCCESS")||-1<b.indexOf("REDEEMED")?(a.$(c).addClass("vpc_clipped"),a.$(c).removeClass("vpc_unclipped")):(a.$(c).addClass("vpc_clip_error"),
a.$(c).removeClass("vpc_unclipped"),a.$(c).removeClass("vpc_clipped"),d=!0),"function"===typeof h.displaySpecialOffersClipCouponResult&&h.displaySpecialOffersClipCouponResult(b))}catch(g){l.logException(g,"JS error when display clip coupon result")}},k=function(a){try{if(h.ue&&"function"===typeof h.ue.count&&h.ue.count("COUPON_WITH_BUYING_OPTION:CLIPPED:WEB",1),m)l.clipAjax(b.vpc.id,b.vpc.asin,b.vpc.merchantID,b.vpc.sku,b.vpc.csrfToken,e,null,"clip_coupon_with_bo"),a.preventDefault();else return h.location=
b.signinUrl?b.signinUrl:"/gp/sign-in.html/ref\x3dsr_1_1?ie\x3dUTF8\x26email\x3d\x26redirectASIN\x3d${vendorPoweredCoupon.asin}\x26disableCorpSignUp\x3d\x26path\x3d%2Fgp%2Fcoupon%2Fc%2F${vendorPoweredCoupon.id}\x26redirectProtocol\x3d\x26mode\x3d\x26useRedirectOnSuccess\x3d1",a.preventDefault(),!0}catch(c){l.logException(c,"JS error when cliping coupon on UDP page")}},c=function(){d||(a.$(".couponFeature"+f).addClass("vpc_oneTimeBuy"),a.$(".couponFeature"+f).removeClass("vpc_sns"))},n=function(){d||
(a.$(".couponFeature"+f).removeClass("vpc_oneTimeBuy"),a.$(".couponFeature"+f).addClass("vpc_sns"))};l.publishImpression(b.clickedClipCoupon,m,"db");a.$(".couponFeature"+f+" .vpcButtonSns").find(".a-button").unbind("click").click(k);a.$(".couponFeature"+f+" .vpcButton").find(".a-button").unbind("click").click(k);a.$(".couponFeature"+f+" .vpcButton").find(".a-checkbox").unbind("click").click(k);a.$(".couponFeature"+f+" .vpcButtonSns").find(".a-checkbox").unbind("click").click(k);a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$(".snsBuyBox"))?
"function"===typeof n&&n():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$(".oneTimeBuyBox"))?"function"===typeof c&&c():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$("#LDBuybox"))&&"function"===typeof c&&c();a.off("a:accordion:buybox-accordion:onetime-accordion:select",c);a.off("a:accordion:buybox-accordion:sns-accordion:select",n);a.off("a:accordion:buybox-accordion:gb_ld_buybox:select",c);if("function"===typeof n)a.on("a:accordion:buybox-accordion:sns-accordion:select",
n);"function"===typeof c&&(a.on("a:accordion:buybox-accordion:onetime-accordion:select",c),a.on("a:accordion:buybox-accordion:gb_ld_buybox:select",c));b.snsOptIn&&(p.when("a-checkbox").execute(function(a){a("#snsOptInCheckbox").isChecked()?n():c()}),a.declarative("sns-opt-in-checked","change",function(a){a.$target.is(":checked")?"function"===typeof n&&n():"function"===typeof c&&c()}));var g=a.$(".couponTable");a.$("#usedBuySection").click(function(){g&&!g.hasClass("hideCoupon")&&g.addClass("hideCoupon")});
a.$("#buyNewSection").click(function(){g&&g.hasClass("hideCoupon")&&g.removeClass("hideCoupon")});a.$("#rentBuySection").click(function(){g&&!g.hasClass("hideCoupon")&&g.addClass("hideCoupon")})}}});"use strict";p.when("A","vpcCommonFunctions").register("vpc-mobile-ccx",function(a,l){return{initialize:function(b){var f=function(){return a.$("#couponFeature").hasClass("vpc_signedIn")},m=function(){return a.$("#couponFeature").hasClass("vpc_clipped")},d=function(){a.$("#couponFeature").addClass("vpc_clip_error");
a.$("#couponFeature").removeClass("vpc_clipped");a.$("#couponFeature").removeClass("vpc_unclipped")},e=function(b){try{m()||(-1<b.indexOf("SUCCESS")||-1<b.indexOf("REDEEMED")?(a.$("#couponFeature").removeClass("vpc_unclipped"),a.$("#couponFeature").addClass("vpc_clipped")):d(),"function"===typeof h.displaySpecialOffersClipCouponResult&&h.displaySpecialOffersClipCouponResult(b))}catch(c){l.logException(c,"JS error when display clip coupon result")}};a.$("#couponFeature").length&&(h.displayClipCouponResult=
e);var k=function(a,b,c){d()},c=function(c){try{f()?a.$.ajax({type:"GET",url:"/gp/promotions/vpc?ie\x3dUTF8\x26promoId\x3d"+a.$("#couponFeature").attr("data-vpcpromoid")+"\x26source\x3ddp_${deviceRef}_"+a.$("#couponFeature").attr("data-vpcasin")+"\x26asin\x3d"+a.$("#couponFeature").attr("data-vpcasin")+"\x26merchantID\x3d"+a.$("#couponFeature").attr("data-vpcmerchantid")+"\x26sku\x3d"+a.$("#couponFeature").attr("data-vpcsku"),headers:{"anti-csrftoken-a2z":a.$("#couponFeature").attr("data-vpccsrftoken")},
success:e,error:k}):h.location=b.signinUrl?b.signinUrl:"ma"===b.deviceRef?"/gp/aw/coupon/c/"+b.vpc.id+"?ie\x3dUTF8\x26vs\x3d1\x26email\x3d\x26redirectASIN\x3d"+b.vpc.asin+"\x26redirect\x3d1\x26source\x3ddp_"+b.deviceRef+"_"+b.vpc.asin+"\x26asin\x3d"+b.vpc.asin+"\x26merchantID\x3d"+b.vpc.merchantID+"\x26sku\x3d"+b.vpc.sku:"/gp/sign-in.html/ref\x3dsr_1_1?ie\x3dUTF8\x26email\x3d\x26redirectASIN\x3d"+a.$("#couponFeature").attr("data-vpcasin")+"\x26disableCorpSignUp\x3d\x26path\x3d%2Fgp%2Fcoupon%2Fc%2F"+
a.$("#couponFeature").attr("data-vpcpromoid")+"\x26redirectProtocol\x3d\x26mode\x3d\x26useRedirectOnSuccess\x3d1",c.preventDefault()}catch(g){l.logException(g,"JS error when clipping coupon on CCX page")}};a.$("#couponFeature").length&&l.publishImpression(m(),f(),b.deviceRef);a.$(".ccx_dpv2 #vpcButton").find(".a-button").click(c);a.$(".ccx_dpv2 #vpcButtonSns").find(".a-button").click(c)}}});var q=!1;p.when("A","vpcCommonFunctions").register("vpc-mobile",function(a,l){var b=a.$("#priceBlockCoupon"),
f=a.$(".priceBlockCoupon");a.on("a:accordion:buybox-accordion:usedAccordionRow:select",function(){b&&!b.hasClass("hideCoupon")&&(b.addClass("hideCoupon"),f.addClass("hideCoupon"))});a.on("a:accordion:buybox-accordion:newAccordionRow:select",function(){b&&b.hasClass("hideCoupon")&&(b.removeClass("hideCoupon"),f.removeClass("hideCoupon"))});a.on("a:accordion:buybox-accordion:rentAccordionRow:select",function(){b&&!b.hasClass("hideCoupon")&&(b.addClass("hideCoupon"),f.addClass("hideCoupon"))});return{initialize:function(b){function d(){q||
(a.$(".priceBlockCoupon").addClass("vpc_oneTimeBuy"),a.$(".priceBlockCoupon").removeClass("vpc_sns"),a.$("#priceBlockCoupon").addClass("vpc_oneTimeBuy"),a.$("#priceBlockCoupon").removeClass("vpc_sns"))}function e(){q||(a.$(".priceBlockCoupon").removeClass("vpc_oneTimeBuy"),a.$(".priceBlockCoupon").addClass("vpc_sns"),a.$("#priceBlockCoupon").removeClass("vpc_oneTimeBuy"),a.$("#priceBlockCoupon").addClass("vpc_sns"))}var f=function(b){try{var c=a.$("#priceBlockCoupon .vpc_unclipped, .priceBlockCoupon .vpc_unclipped, .standaloneCoupon.vpc_unclipped");
c.hasClass("vpc_clipped")||(-1<b.indexOf("SUCCESS")||-1<b.indexOf("REDEEMED")?(c.addClass("vpc_clipped"),c.removeClass("vpc_unclipped")):(c.addClass("vpc_clip_error"),c.removeClass("vpc_unclipped"),c.removeClass("vpc_clipped"),q=!0))}catch(d){l.logException(d,"JS error when display clip coupon result")}},c=function(c){try{if(b.loggedIn)a.$.ajax({type:"GET",url:"/gp/promotions/vpc/ref\x3dclip_coupon?ie\x3dUTF8\x26promoId\x3d"+b.vpc.id+"\x26source\x3ddp_"+b.deviceRef+"_"+b.vpc.asin+"\x26asin\x3d"+b.vpc.asin+
"\x26merchantID\x3d"+b.vpc.merchantID+"\x26sku\x3d"+b.vpc.sku,headers:{"anti-csrftoken-a2z":b.vpc.csrfToken},success:f}),c.preventDefault();else return h.location=b.clipAction,c.preventDefault(),!0}catch(g){l.logException(g,"JS error when clipping coupon on mobile")}};l.publishImpression(b.clickedClipCoupon,b.loggedIn,b.deviceRef,b.vpc.id,b.vpc.asin);a.$("#oneTimeBuyVpcButton").find(".a-button").click(c);a.$("#snsVpcButton").find(".a-button").click(c);a.$("#oneTimeBuyVpcButton").find(".a-checkbox").click(c);
a.$("#snsVpcButton").find(".a-checkbox").click(c);a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#snsBuyBox")?e():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#oneTimeBuyBox")?d():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is("#LDBuybox")&&d();a.off("a:accordion:buybox-accordion:onetime-accordion:select",d);a.off("a:accordion:buybox-accordion:sns-accordion:select",e);a.off("a:accordion:buybox-accordion:gb_ld_buybox:select",d);a.on("a:accordion:buybox-accordion:sns-accordion:select",
e);a.on("a:accordion:buybox-accordion:onetime-accordion:select",d);a.on("a:accordion:buybox-accordion:gb_ld_buybox:select",d);a.$(".a-accordion-active").is("#newAccordionRow")?d():a.$(".a-accordion-active").is("#SecondNewAccordionRow")?d():a.$(".a-accordion-active").is("#dealsAccordionRow")?d():a.$(".a-accordion-active").is("#snsAccordionRowMobile")?e():a.$(".a-accordion-active").is("#snsAccordionRowMobileApp")?e():a.$(".a-accordion-active").is("#snsAccordionRowMobileMovedUp")?e():a.$(".a-accordion-active").is("#snsAccordionRowMobileAppMovedUp")?
e():a.$(".a-accordion-active").is("#snsAccordionRowMobileMiddle")?e():a.$(".a-accordion-active").is("#snsAccordionRowMobileAppMiddle")&&e();a.off("a:accordion:buybox-accordion:newAccordionRow:select",d);a.off("a:accordion:buybox-accordion:SecondNewAccordionRow:select",d);a.off("a:accordion:buybox-accordion:dealsAccordionRow:select",d);a.off("a:accordion:buybox-accordion:snsAccordionRowMobile:select",e);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileApp:select",e);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileMovedUp:select",
e);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileAppMovedUp:select",e);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileMiddle:select",e);a.off("a:accordion:buybox-accordion:snsAccordionRowMobileAppMiddle:select",e);a.on("a:accordion:buybox-accordion:newAccordionRow:select",d);a.on("a:accordion:buybox-accordion:SecondNewAccordionRow:select",d);a.on("a:accordion:buybox-accordion:dealsAccordionRow:select",d);a.on("a:accordion:buybox-accordion:snsAccordionRowMobile:select",e);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileApp:select",
e);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMovedUp:select",e);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMovedUp:select",e);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileMiddle:select",e);a.on("a:accordion:buybox-accordion:snsAccordionRowMobileAppMiddle:select",e);b.snsOptIn&&(p.when("a-checkbox").execute(function(a){a("#snsOptInCheckbox").isChecked()?e():d()}),a.declarative("sns-opt-in-checked","change",function(a){a.$target.is(":checked")?"function"===typeof e&&
e():"function"===typeof d&&d()}))}}});p.when("A","vpcCommonFunctions").register("vpc-mobile-unified",function(a,l){return{initialize:function(b){function f(){q||(a.$(".couponFeature"+d).addClass("vpc_oneTimeBuy"),a.$(".couponFeature"+d).removeClass("vpc_sns"))}function m(){q||(a.$(".couponFeature"+d).removeClass("vpc_oneTimeBuy"),a.$(".couponFeature"+d).addClass("vpc_sns"))}var d=b.vpc.id,e=function(b){try{var c=a.$(".couponFeature"+d+".vpc_unclipped");c.hasClass("vpc_clipped")||(-1<b.indexOf("SUCCESS")||
-1<b.indexOf("REDEEMED")?(c.addClass("vpc_clipped"),c.removeClass("vpc_unclipped")):(c.addClass("vpc_clip_error"),c.removeClass("vpc_unclipped"),c.removeClass("vpc_clipped"),q=!0))}catch(e){l.logException(e,"JS error when display clip coupon result")}},k=function(c){try{if(h.ue&&"function"===typeof h.ue.count&&h.ue.count("COUPON_WITH_BUYING_OPTION:CLIPPED:MOBILE",1),b.loggedIn)a.$.ajax({type:"GET",url:"/gp/promotions/vpc/ref\x3dclip_coupon_with_bo?ie\x3dUTF8\x26promoId\x3d"+b.vpc.id+"\x26source\x3ddp_"+
b.deviceRef+"_"+b.vpc.asin+"\x26asin\x3d"+b.vpc.asin+"\x26merchantID\x3d"+b.vpc.merchantID+"\x26sku\x3d"+b.vpc.sku,headers:{"anti-csrftoken-a2z":b.vpc.csrfToken},success:e}),c.preventDefault();else return h.location=b.clipAction,c.preventDefault(),!0}catch(d){l.logException(d,"JS error when clipping coupon on mobile")}},c=".couponFeature"+d;l.publishImpression(b.clickedClipCoupon,b.loggedIn,b.deviceRef,b.vpc.id,b.vpc.asin);a.$(c+" .oneTimeBuyVpcButton").find(".a-button").unbind("click").click(k);
a.$(c+" .snsVpcButton").find(".a-button").unbind("click").click(k);a.$(c+" .oneTimeBuyVpcButton").find(".a-checkbox").unbind("click").click(k);a.$(c+" .snsVpcButton").find(".a-checkbox").unbind("click").click(k);a.off("a:accordion:buybox-accordion:onetime-accordion:select",f);a.off("a:accordion:buybox-accordion:sns-accordion:select",m);if("function"===typeof m)a.on("a:accordion:buybox-accordion:sns-accordion:select",m);if("function"===typeof f)a.on("a:accordion:buybox-accordion:onetime-accordion:select",
f);a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$(".snsBuyBox"))?m():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$(".oneTimeBuyBox"))?f():a.$("div#snsBuyBoxAccordion \x3e .a-accordion-active").is(a.$("#LDBuybox"))&&f();b.snsOptIn&&(p.when("a-checkbox").execute(function(a){a("#snsOptInCheckbox").isChecked()?m():f()}),a.declarative("sns-opt-in-checked","change",function(a){a.$target.is(":checked")?"function"===typeof m&&m():"function"===typeof f&&f()}))}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,a=e?e("OneClickDesktopAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,e){b.when("jQuery").register("oneclick-prefetcher",function(a){return{triggerPrefetch:function(b,d,c,e,f){a.ajax({type:"GET",url:b,data:d,contentType:"text/plain; charset\x3dUTF-8;",dataType:"json",success:function(a,b,d){c(a,d)},error:e,complete:f})}}});"use strict";b.when("A","jQuery","oneclick-desktop-csm",
"oneclick-desktop-service-counters").execute(function(a,b,d,c){b(".oneclick-guide:visible").length&&d.logCount(c.ONECLICK_GUIDE_VISIBLE_COUNTER);a.on("a:popover:show:oneclick-guide-modal",function(){d.logCount(c.ONECLICK_GUIDE_CLICK_COUNTER)});a.on("a:popover:hide:oneclick-guide-modal",function(){d.logCount(c.ONECLICK_GUIDE_CLOSE_COUNTER)})});"use strict";b.when("oneclick-desktop-page-ready").register("oneclick-desktop-csm",function(){return{logCount:function(a){c.ue&&c.ue.count&&c.ue.count(a,1)}}});
"use strict";b.when("oneclick-desktop-page-ready").register("oneclick-desktop-service-counters",function(){return{ONECLICK_GUIDE_VISIBLE_COUNTER:"oneClickGuideFatigueVisibleCount",ONECLICK_GUIDE_CLICK_COUNTER:"oneClickGuideFatigueClickCount",ONECLICK_GUIDE_CLOSE_COUNTER:"oneClickGuideFatigueCloseCount",ONECLICK_ADD_TO_CART_BUTTON_NOT_PRESENT:"oneClickDesktopAddToCartButtonNotPresent",ONECLICK_ADD_TO_CART_BUTTON_PRESENT:"oneClickDesktopAddToCartButtonPresent",ONECLICK_ONECLICK_BUTTON_PRESENT:"oneClickDesktopOneClickButtonPresent",
ONECLICK_BUYNOW_BUTTON_PRESENT:"oneClickDesktopBuyNowButtonPresent"}});"use strict";b.when("cf").register("oneclick-desktop-page-ready");"use strict";b.when("A","oneclick-desktop-csm","oneclick-desktop-service-counters","oneclick-desktop-page-ready").execute("oneclick-desktop-button-detection",function(a,b,c){a=a.$;a("#add-to-cart-button").is(":visible")?(b.logCount(c.ONECLICK_ADD_TO_CART_BUTTON_PRESENT),a("#one-click-button, #one-click-submit-btn, #oneClickBuyButton, .onml-one-click-button").is(":visible")&&
b.logCount(c.ONECLICK_ONECLICK_BUTTON_PRESENT),a("#buy-now-button").is(":visible")&&b.logCount(c.ONECLICK_BUYNOW_BUTTON_PRESENT)):b.logCount(c.ONECLICK_ADD_TO_CART_BUTTON_NOT_PRESENT)})});
/* ******** */
(function(d){var b=window.AmazonUIPageJS||window.P,g=b._namespace||b.attributeErrors,a=g?g("DetailPageSoftlinesFitPreloadAssets"):b;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,b,g){d.when("jQuery","cf").register("shoefitr-atf-data",function(a){a=a("#shoefitr-urls");return 0<a.length?a.data():{}});d.when("shoefitr-atf-data").register("shoefitr-loader",function(a){function d(a){return function(){"object"===typeof b.ue&&b.ue.count&&b.ue.count(a,1)}}function f(a){(document.getElementsByTagName("head")[0]||
document.getElementsByTagName("body")[0]).appendChild(a)}function k(a){var c=document.createElement("script");c.type="text/javascript";c.charset="UTF-8";c.onerror=d("shoefitrJSLoadError");c.src=a;c.async=!0;c.crossOrigin="anonymous";f(c)}function h(a){var c=document.createElement("link");c.type="text/css";c.rel="stylesheet";c.media="screen";c.charset="UTF-8";c.onerror=d("shoefitrCSSLoadError");c.href=a;f(c)}var e;"object"===typeof a&&a.urlJs&&a.urlCss&&(e=b.performance&&b.performance.now?b.performance.now():
new Date,k(a.urlJs),h(a.urlCss));return{getShoefitrJsLoadStartTimeStamp:function(){return e}}});d.when("jQuery","A").execute(function(a,b){function f(){var b=a("#sf-sg-loading"),h=a("#sf-sg-root"),e="block"===b.css("display");e||d.when("shoefitr-metrics").execute(function(a){a.count("LoadingScreenShown")});h.css("display",e?"block":"none");b.css("display",e?"none":"block")}a("#sf-sg-root, #sf-sg-loading").delegate(".sf-loading-toggle","click touchstart",function(a){f()});b.on("a:popover:show:Shoefitr",
function(a){d.when("shoefitr-metrics").execute(function(a){a.log("AuiModalOpened");a.count("AuiModalOpened")});b.ajax("/gp/shoefitr/refTag.html",{params:{ref_:"slps_cx_legacy_app_open"}})});b.on("a:popover:hide:Shoefitr",function(a){d.when("shoefitr-metrics").execute(function(a){a.log("AuiModalClosed")})})})});
/* ******** */
(function(f){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,d=h?h("MyFitDetailPageAssets"):e;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,e,h){f.when("A","a-button","a-popover","a-carousel-framework","cf","jQuery").execute(function(d,e,f,l,m,c){var a={retrySubmitting:function(b,d,e,f){e>f||c.ajax({url:b,type:"POST",data:d,timeout:4E3*e,error:function(){a.retrySubmitting(b,d,e+1,f)}})},submitRecommendationGivenFeedback:function(){a.retrySubmitting(a.baseURL+
"/ref=myfit_reco",{action:"reco",asin:a.pAsin},1,3)},submitLinkClickedFeedBack:function(){a.retrySubmitting(a.baseURL+"/ref=myfit_lh",{action:"linkHit",asin:a.pAsin},1,3)},popoverDisplayLinkHandler:function(b){a.submitLinkClickedFeedBack();a.$popoverDisplayLink.unbind("mouseover touchstart",a.popoverDisplayLinkHandler)},getSelectedSizeFromState:function(a){return a[0]},showFitFinder:function(b){a.$recFinderLink.hide();a.$recFinder.show();a.areCarouselsInitialized?(a.gotoPageInCarousel(a.$menCarousel,
a.$menCarouselSelectedPage),a.gotoPageInCarousel(a.$womenCarousel,a.$womenCarouselSelectedPage)):(a.setupCarousels(),a.areCarouselsInitialized=!0)},setupCarousels:function(){a.initCarousel();a.passSizeValueFromCarouselMen();a.passSizeValueFromCarouselWomen();a.passWidthValueFromCarouselMen();a.passWidthValueFromCarouselWomen()},initCarousel:function(){l.createAll();l.initializeAll();c("#myFitSizeCarouselMen").length&&(a.$menCarousel=l.getCarousel(c("#myFitSizeCarouselMen")),a.showPopularSizesInCarousel("myFitSizeCarouselMen",
3));c("#myFitSizeCarouselWomen").length&&(a.$womenCarousel=l.getCarousel(c("#myFitSizeCarouselWomen")),a.showPopularSizesInCarousel("myFitSizeCarouselWomen",3))},showPopularSizesInCarousel:function(b,c){l.onInit(b,function(b){a.gotoPageInCarousel(b,c)})},gotoPageInCarousel:function(a,c){a!==h&&c!==h&&a.gotoPage(c,{animationDuration:0,silent:!0})},carouselButtonSelectionStyling:function(a,d){c("#"+a+" #myFitCarouselAUIButton.a-button-selected").removeClass("a-button-selected");c("#"+a+" #myFitCarouselAUIButton.a-button-focus").removeClass("a-button-focus");
c(d).addClass("a-button-selected")},passSizeValueFromCarouselMen:function(){a.$carouselSizeButtonMen.bind("click",function(){a.carouselButtonSelectionStyling("myFitSizeCarouselMen",this);var b=c("#myFitSizeCarouselMen #myFitCarouselAUIButton.a-button-selected button#myFitCarouselButton").val();b!==a.menRegularSize&&("undefined"!==typeof a.$menCarousel&&null!==a.$menCarousel&&(a.$menCarouselSelectedPage=a.$menCarousel.getAttr("pageNumber")),a.menRegularSize=b,a.submitUserRegularSize(b))})},passSizeValueFromCarouselWomen:function(){a.$carouselSizeButtonWomen.bind("click",
function(){a.carouselButtonSelectionStyling("myFitSizeCarouselWomen",this);var b=c("#myFitSizeCarouselWomen #myFitCarouselAUIButton.a-button-selected button#myFitCarouselButton").val();b!==a.womenRegularSize&&("undefined"!==typeof a.$womenCarousel&&null!==a.$womenCarousel&&(a.$womenCarouselSelectedPage=a.$womenCarousel.getAttr("pageNumber")),a.womenRegularSize=b,a.submitUserRegularSize(b))})},passWidthValueFromCarouselMen:function(){a.$carouselWidthButtonMen.bind("click",function(){a.carouselButtonSelectionStyling("myFitWidthCarouselMen",
this);var b=c("#myFitWidthCarouselMen #myFitCarouselAUIButton.a-button-selected button#myFitCarouselButton").val();b!==a.menWidth&&(a.menWidth=b,a.submitUserWidth(b))})},passWidthValueFromCarouselWomen:function(){a.$carouselWidthButtonWomen.bind("click",function(){a.carouselButtonSelectionStyling("myFitWidthCarouselWomen",this);var b=c("#myFitWidthCarouselWomen #myFitCarouselAUIButton.a-button-selected button#myFitCarouselButton").val();b!==a.womenWidth&&(a.womenWidth=b,a.submitUserWidth(b))})},submitUserRegularSize:function(b){a.regularSize=
b;a.submitUserSize()},submitUserWidth:function(b){a.width=b;a.submitUserSize()},updateRecommendation:function(b){var d=null,d="true"===b.showRecommendation?b.popoverTitle:b.errorMessage;a.$recommendedSizeLinkText.text(b.recommendedSizeLinkText);a.$titleLinkTextWithFitZone.text(b.titleLinkTextWithFitZone);a.$recommendedSize.html(c(c("<textarea/>").html(b.titleRecommendation).text()));a.$popoverTitle.html(d).append(c(c("<textarea/>").html(b.recommendation).text()));a.$popoverBasisMessage.text(b.popoverBasisMessage);
a.$popoverExplanationMessage.text(b.popupMessageWithCustomerRegularSize);a.$recFinderLink.text(b.fitFinderLink);a.$recFinderAskRegularSize.removeClass("a-text-bold");a.$recommendationData.attr("algo",b.algo);a.$recommendationData.attr("rasin",b.recommendedAsin);a.$recommendationData.attr("size",b.size);a.$recommendationData.attr("rtype",b.recommendationMarker);a.$recommendationData.attr("category",b.category);a.$recommendationData.attr("directionality",b.directionality);a.populateRecommendationData();
a.setupBaseUrl();a.submitRecommendationGivenFeedback();a.$popoverHeader.show();a.myFitPopoverExplanationMessageSection.show()},submitUserSize:function(b){b=a.parentURL;var e=a.regularSize,f=a.width;"-1"!==e&&(e={asin:a.pAsin,regularSize:e,width:f},c.ajax({url:b+"/fit-finder/ref=myfit_reg_size",type:"POST",data:e,dataType:"json",timeout:5E3,beforeSend:function(){a.$recFinderLoadMessage.show();a.$recFinderClientErrorMessage.hide();a.$recFinderServerErrorMessage.hide()},success:function(b){a.updateRecommendation(b)},
error:function(b,c,d){c=/^([5][0-9][0-9])$/;0===b.status?a.$recFinderClientErrorMessage.show():c.test(b.status)&&a.$recFinderServerErrorMessage.show()},complete:function(){a.$recFinderLoadMessage.hide()}}),d.on("a:popover:afterHide:myfitPopover",function(){a.repaintFitFinder()}))},repaintFitFinder:function(){a.$recFinder.hide();a.$recFinderLink.show();a.$recFinderClientErrorMessage.hide();a.$recFinderServerErrorMessage.hide()},submitUserVoteFeedback:function(b){var c=a.baseURL;a.$recommendationSurvey.hide();
var d={action:"feedback",asin:a.pAsin,vote:b};b===a.yesVote?c+="/ref=myfit_fb_yes":b===a.noVote&&(c+="/ref=myfit_fb_no");a.vote=b;a.retrySubmitting(c,d,1,3);a.$recommendationSurveyComment.show()},submitUserComment:function(){var b=a.baseURL,c=a.$recommendationSurveyCommentBox.val();a.$recommendationSurveyComment.hide();c={action:"comment",asin:a.pAsin,vote:a.vote,comment:c};a.vote===a.yesVote?b+="/ref=myfit_fb_c_yes":a.vote===a.noVote&&(b+="/ref=myfit_fb_c_no");a.retrySubmitting(b,c,1,3);a.$recommendationSurveyThankYou.show();
d.on("a:popover:afterHide:myfitPopover",function(){a.$recommendationSurveyThankYou.hide()})},populateRecommendationData:function(){a.pAsin=a.$recommendationData.attr("asin");a.directionality=a.$recommendationData.attr("directionality");a.category=a.$recommendationData.attr("category");a.rtype=a.$recommendationData.attr("rtype");a.size=a.$recommendationData.attr("size");a.rasin=a.$recommendationData.attr("rasin");a.algo=a.$recommendationData.attr("algo")},setupBaseUrl:function(){a.baseURL=a.parentURL;
a.baseURL+="/rAsin/"+a.rasin+"/size/"+a.size+"/algo/"+a.algo+"/dirn/"+a.directionality+"/category/"+a.category+"/rtype/"+a.rtype},initialize:function(){a.$recommendationData=c("#myFitRecommendationData");a.populateRecommendationData();"undefined"!==typeof a.algo&&(a.parentURL="/gp/myfit/aj/log",a.yesVote="Yes",a.noVote="No",a.regularSize="-1",a.width="NOTSPECIFIED",a.womenRegularSize="-1",a.womenWidth="NOTSPECIFIED",a.menRegularSize="-1",a.menWidth="NOTSPECIFIED",a.areCarouselsInitialized=!1,a.$recommendedSizeLinkText=
c("#myfitRecommendedSizeLinkText"),a.$recommendedSize=c("#myFitRecommendedSize"),a.$titleLinkTextWithFitZone=c("#myFitTitleLinkTextWithFitZone"),a.$popoverDisplayLink=c("#myfitLink"),a.$popover=c("#myfitPopover"),a.$popoverHeader=c("#myFitPopoverHeader"),a.$popoverTitle=c("#myfitPopoverTitle"),a.$popoverBasisMessage=c("#myfitPopoverBasisMessage"),a.$popoverExplanationMessage=c("#myFitPopoverExplanationMessage"),a.myFitPopoverExplanationMessageSection=c("#myFitPopoverExplanationMessageSection"),a.$recFinder=
c("#myFitRecFinder"),a.$recFinderLink=c("#myFitRecFinderLink"),a.$recFinderAskRegularSize=c("#myFitRecFinderAskRegularSize"),a.$recFinderLoadMessage=c("#myFitRecFinderLoadMessage"),a.$recFinderClientErrorMessage=c("#myFitRecFinderClientErrorMessage"),a.$recFinderServerErrorMessage=c("#myFitRecFinderServerErrorMessage"),a.$recommendationSurvey=c("#myFitRecommendationSurvey"),a.$recommendationSurveyCommentBox=c("#myFitRecommendationSurveyCommentBox"),a.$recommendationSurveyThankYou=c("#myFitRecommendationSurveyThankYou"),
a.$recommendationSurveyComment=c("#myFitRecommendationSurveyComment"),a.$carouselSizeButtonMen=c("#myFitSizeCarouselMen #myFitCarouselAUIButton"),a.$carouselSizeButtonWomen=c("#myFitSizeCarouselWomen #myFitCarouselAUIButton"),a.$carouselWidthButtonMen=c("#myFitWidthCarouselMen #myFitCarouselAUIButton"),a.$carouselWidthButtonWomen=c("#myFitWidthCarouselWomen #myFitCarouselAUIButton"),a.$popoverDisplayLink.bind("mouseover touchstart",a.popoverDisplayLinkHandler),a.$recFinderLink.bind("click touchstart",
function(b){a.showFitFinder();b.preventDefault()}),d.on("a:tabs:myFitUnisexGenderSelector:myFitMen:select",function(b){a.width=a.menWidth;a.regularSize=a.menRegularSize;a.gotoPageInCarousel(a.$menCarousel,a.$menCarouselSelectedPage)}),d.on("a:tabs:myFitUnisexGenderSelector:myFitWomen:select",function(b){a.width=a.womenWidth;a.regularSize=a.womenRegularSize;a.gotoPageInCarousel(a.$womenCarousel,a.$womenCarouselSelectedPage)}),d.on("a:button-group:myFitWidthToggleGroupMen:toggle",function(b){b=b.selectedButton.buttonName;
b!==a.menWidth&&(a.menWidth=b,a.submitUserWidth(a.menWidth))}),d.on("a:button-group:myFitWidthToggleGroupWomen:toggle",function(b){b=b.selectedButton.buttonName;b!==a.womenWidth&&(a.womenWidth=b,a.submitUserWidth(a.womenWidth))}),c("#myFitRecommendationVoteNo").bind("click",function(){a.submitUserVoteFeedback(a.noVote)}),c("#myFitRecommendationVoteYes").bind("click",function(){a.submitUserVoteFeedback(a.yesVote)}),c("#myFitRecommendationSurveyCommentSubmit").bind("click",function(){a.submitUserComment()}),
a.setupCarousels(),a.setupBaseUrl(),a.submitRecommendationGivenFeedback())}};a.initialize()})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageCerberusAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","jQuery","ready","cf").execute(function(a,b){a.state("cerberus-twister-metrics-state",[]);a.on("afterLoad",function(){});a.on("a:pageUpdate",function(){})});b.when("A","jQuery","p13n-sc-line-truncator","ready","cf").execute(function(a,b,c){function d(){b(".cerberus-no-wrap").removeClass("cerberus-no-wrap");
c.truncateLines(b("#cerberus"))}a.on("load",function(){d()});a.on("a:pageUpdate",function(){d()})})});
/* ******** */
(function(b){var d=window.AmazonUIPageJS||window.P,e=d._namespace||d.attributeErrors,a=e?e("DigitalDashDetailPageAssets",""):d;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,d,e){b.register("DigitalDashUtils",function(){return{redirect:function(a){if(!a)throw"Must pass a target URL.";d.location.href=a}}});"use strict";b.when("A","DigitalDashCreateForm").register("DigitalDashAddListeners",function(a,b){a.declarative("digital-dash-create","click",function(a){a.$event.preventDefault();
var c;a.$target.data("DigitalDashCreateForm")?c=a.$target.data("DigitalDashCreateForm"):(c=new b({el:a.data.el,href:a.data.href}),a.$target.data("DigitalDashCreateForm",c));c.submit(a.data.data);return!1});a.on("digital-dash:auto-create",function(a){(new b({el:a.el,href:a.href})).submit(a.data)})});"use strict";b.when("A","DigitalDashUtils","a-alert").register("DigitalDashCreateForm",function(a,g,d){function c(a){f.extend(this,h,a);if(!this.el)throw"Must specify an el";if(!this.href)throw"Must specify an href to post to";
this.$el=f(this.el);this.$el.find(this.errorAlertSelector).removeClass("aok-hidden").end();this.$errorAlert=d(this.$el.find(this.errorAlertSelector));this.baseErrorText=this.$errorAlert.text();this.$changeover=this.$el.find(this.changeoverSelector)}var f=a.$,h={errorAlertSelector:"#digital-dash-create-error-message",ajaxFieldName:"isAjax",changeoverSelector:"#digital-dash-create-success-changeover"};c.prototype.submit=function(b){this.$el.removeClass("success").removeClass("error");b[this.ajaxFieldName]=
!0;a.ajax(this.href,{method:"POST",params:b,success:f.proxy(this.handleAjaxSuccess,this),error:f.proxy(this.handleAjaxError,this)})};c.prototype.handleAjaxSuccess=function(a){a.success||510===a.error.errorCode?(this.$changeover.show(),this.$el.addClass("success")):(a.error.errorTitle&&this.$errorAlert.heading(a.error.errorTitle),a.error.errorMessage?this.$errorAlert.text(a.error.errorMessage):this.$errorAlert.text(this.baseErrorText),this.$el.addClass("error"))};c.prototype.handleAjaxError=function(a){if(401===
a.http.status)try{return g.redirect(a.http.responseText)}catch(c){b.log("Error parsing unauth response: "+c,"ERROR","DigitalDashCreateForm")}else b.log("Create dash button call failed, could not recognize response from server.","FATAL","DigitalDashCreateForm");this.$el.addClass("error")};return c});"use strict";b.when("A","DigitalDashAddListeners","load").execute("DigitalDashAutoAction",function(a){var b=a.state("digital-dash-auto-action");if(b)a.trigger(b.actionName,b.data);else a.on("a:state:update:digital-dash-auto-action",
function(d){a.trigger(b.actionName,a.state("digital-dash-auto-action").data)})});"use strict";b.when("A","a-popover").execute("DigitalDashPopoverManager",function(a,d){var e=a.$,c=a.throttle(function(a){a.updatePosition()},500,{trailing:!1});a.on("a:popover:ajaxContentLoaded:dd-create-learn-more",function(a){var d=a.popover;a=e(d.getContent());a.html()?a.find("img").each(function(){e(this).bind("load",function(){c(d)})}):b.log("dd-create-learn-more lazyPositionPopover popover content not ready","WARN",
"DigitalDashPopoverManager")})})});
/* ******** */
(function(b){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,a=k?k("MiniSellerProfileAssets",""):f;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,f,k){b.when("A","jQuery","a-popover","ready").register("msp.setup",function(a,e,b){var m={init:function(a){e(a).each(function(){var d=e(this);if(void 0===d.data("msp-instance")){var a=d.data("merchant"),c=d.data("mkpl"),g=d.data("client");a&&(a=b.create(d,{url:"/suppliers/msp/content?merchant\x3d"+
a+"\x26marketplace\x3d"+c+"\x26client\x3d"+g+"\x26ref\x3dmsp_"+g,position:"triggerBottom",cache:!1}),d.append(e('\x3ci class\x3d"a-icon a-icon-popover"\x3e\x3c/i\x3e')),d.data("msp-instance",a),a=d.data("a-popover"),e.extend(!0,a,{allowLinkDefault:!0}),d.data("a-popover",a),d.bind("click",function(){d.data("msp-clicked",!0)}))}})}};a.declarative("msp-sign-in","click",function(){f.location.href="/ap/signin?_encoding\x3dUTF8\x26openid.assoc_handle\x3dusflex\x26openid.claimed_id\x3dhttp%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select\x26openid.identity\x3dhttp%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select\x26openid.mode\x3dcheckid_setup\x26openid.ns\x3dhttp%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0\x26openid.ns.pape\x3dhttp%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0\x26openid.pape.max_auth_age\x3d0\x26openid.return_to\x3d"+
encodeURIComponent(f.location.href)});m.init(".msp-trigger");return m});"use strict";b.when("A","jQuery","ready").execute("addSuppliersButton",function(a,e){function b(a,e){var c=a.closest(".save-unsave-suppliers-section"),g=c.data("merchant-id"),n=c.data("client");f(e,g,n,function(){"DELETE"===e?(c.find(".save-supplier-section").show(),c.find(".unsave-supplier-section").hide()):(c.find(".save-supplier-section").hide(),c.find(".unsave-supplier-section").show())})}function f(a,b,c,g){e.ajax({url:"/suppliers/ajax/followUnfollow?"+
e.param({sellerId:b,client:c}),type:a,success:function(a){a.status===h.SUCCESS&&g&&g()}})}var h={SUCCESS:"success"};a.declarative("saveSupplier","click",function(a){b(a.$currentTarget,"PUT")});a.declarative("unSaveSupplier","click",function(a){b(a.$currentTarget,"DELETE")})});"use strict";b.when("A","jQuery","a-popover","msp.setup","ready").execute("msp.events",function(a,b,k,m){var h=f.ue,d=[];a.on("a:popover:ajaxSuccess",function(a){l(a.popover)&&c("mspAjaxSuccess")});a.on("a:popover:ajaxFail",
function(a){l(a.popover)&&(a.popover.$trigger.data("msp-clicked")?c("mspAjaxAbortFail"):c("mspAjaxFail"),c("mspAjaxSuccess",0))});a.on("a:popover:show",function(a){a=a.popover;l(a)&&(c("mspOpen"),a.lastOpenTime=Date.now(),a.openCount||d.push(a),a.openCount=(a.openCount||0)+1)});a.on("a:popover:hide",function(a){a=a.popover;if(l(a)&&a.lastOpenTime){c("mspDuration",Date.now()-a.lastOpenTime);for(var b=a=0,e=0;e<d.length;e++)b+=d[e].openCount,a++;0<b&&c("mspOpenPerIns",(b/a).toFixed(2))}});a.on("a:pageUpdate",
function(){m.init(".sfsb-merchant-link.msp-trigger")});var l=function(a){return a&&b(a.$trigger).hasClass("msp-trigger")},c=function(a,b){a&&(void 0===b&&(b=1),h&&h.count&&h.count(a,b))}})});
/* ******** */
(function(e){var c=window.AmazonUIPageJS||window.P,g=c._namespace||c.attributeErrors,a=g?g("DetailPageCReturnsAssets",""):c;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,c,g){e.when("A").register("creturns-common-utils",function(a){return{isNotEmpty:function(b){return"undefined"!==a.$.type(b)&&"null"!==a.$.type(b)&&0<b.length},isShippingContentTooLong:function(b,a){var d=!1;this.isNotEmpty(a)&&this.isNotEmpty(b)&&(d=140<b.offset().left-(a.offset().left+a.width()));
return d},isShippingContentNotPresentInThisLine:function(b,a){var d=!1;this.isNotEmpty(a)&&this.isNotEmpty(b)&&(d=5>b.offset().left-a.offset().left);return d},areInTheSameLine:function(b,a){var d=!1;this.isNotEmpty(a)&&this.isNotEmpty(b)&&(d=a.offset().top+a.height()>b.offset().top);return d},incrementMetricsForKey:function(b){return function(){var a=c.ue;a&&a.count&&a.count(b,(a.count(b)||0)+1)}},hideReturnPolicySeparator:function(){var b=a.$("#creturns-return-policy-separator");this.isNotEmpty(b)&&
b.hide()},enableReturnPolicyLineBreak:function(){var b=a.$("#creturns-return-policy-linebreak");this.isNotEmpty(b)&&(b.removeClass("a-hidden"),b.addClass("a-block"))}}});"use strict";e.when("A","creturns-common-utils","atf","ready").execute(function(a,b){function e(){var f=a.$("#creturns-policy-url-text-pc");b.isNotEmpty(f)&&f.click(d);var f=a.$("#creturns-return-policy-content"),c=a.$("#priceblock_ourprice");b.isNotEmpty(f)&&b.isNotEmpty(c)&&(b.areInTheSameLine(f,c)?b.isShippingContentTooLong(f,
c):1)&&(b.hideReturnPolicySeparator(),b.enableReturnPolicyLineBreak())}function d(a){c.open(a.currentTarget.href,"AmazonHelp","width\x3d550,height\x3d550,resizable\x3d1,scrollbars\x3d1,toolbar\x3d0,status\x3d0").focus();return!1}var g=a.$("#creturns-return-policy-content");b.isNotEmpty(g)&&(a.on("a:popover:afterShow:cReturnsPolicyPopover",b.incrementMetricsForKey("cReturnsPolicy.pc")),a.on("a:popover:afterShow:cReturnsPolicyPopoverMiniAtf",b.incrementMetricsForKey("cReturnsPolicy.pc.miniATF")),a.on("a:pageUpdate",
e),e())})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageGiveawayAssets"):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,b=h?h("TAFCopyToClipboardAssets"):f;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,f,h){});
/* ******** */
(function(f){var n=window.AmazonUIPageJS||window.P,u=n._namespace||n.attributeErrors,b=u?u("ProductBundleUIAssets",""):n;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,n,u){f.when("A","ready").register("bundle-listing.model",function(b){function a(){this.asin="";this.isBundle=this.componentsPending=this.componentsAvailable=!1}var t=b.$,g,c=0,e,h,d,k,f,l=new a,p=function(a,c,r){if(h()&&!f()&&!k()){if(d()){var m={asin:d()};l.componentsPending=!0;return g=b.get("/gp/product/ajax-handlers/get-bundle-details.html",
{params:m,accepts:"text/html",timeout:2E3,indicator:r,success:function(q){null===q||t.trim(q).length?(l.componentsAvailable=!0,a(q)):e(a,c,r,p,"An empty Ajax response was received for bundleAsin: "+d(),null,!0)},error:function(q,b,d){e(a,c,r,p,b,d)}})}e(a,c,r,p)}};e=function(a,e,d,h,q,g,m){3>c?(l.componentsPending=!1,c+=1,m?h(a,e,d):b.delay(function(){h(a,e,d)},200)):(l.componentsPending=!0,e(q,g))};var m=function(){null!==g&&g!==u&&g.abort();l=new a;var b=t("#bundle-state");b.length&&(l.asin=b.data("asin"),
l.isBundle=b.data("isbundle"))};h=function(){return l.isBundle&&""!==d()};d=function(){return l.asin};k=function(){return l.componentsAvailable};f=function(){return l.componentsPending};m();return{isBundle:h,getBundleASIN:d,hasComponentsAvailable:k,hasComponentsPending:f,loadBundleComponents:p,refresh:m}});"use strict";f.when("A","bundle-constants","bundle-logger","bundle-state","ready").register("bundle-pricing",function(b,a,t,g){var c=b.$,e=!1,h="",d=0,k,f,l,p,m,v,w,r,n;b.on(a.BUNDLE_PRICING_AJAX_TRIGGER_EVENT,
function(){k(!1)});k=function(a){if(a||p())a={asin:g.getBundleASIN()},a.asin?l(a):(t.logWarning("Unable to find bundle asin, will retry","bundlePricingAjax"),f(!1))};l=function(a){b.get("/gp/product/ajax-handlers/get-bundle-pricing.html",{params:a,accepts:"text/html",timeout:2E3,success:m,failure:function(a,b,q){t.logWarning("Error in getBundlePricing, retrying.");f(!0,b,q)}})};f=function(a,c,e){3>d?(d+=1,b.delay(function(){k(!0)},200)):a&&t.logFatal(c,"bundlePricingAjax",e)};p=function(){var a=!e;
a||h===g.getBundleASIN()?(e=!0,h=g.getBundleASIN()):(a=!0,h=g.getBundleASIN(),d=0);return a};m=function(a){b.objectIsEmpty(a)||(w(a),n(a),r(a),v(a))};v=function(b){b[a.BUNDLE_LISTING_WIDGET_V2_PRIME_ELIGIBLE]&&c(a.BUNDLE_PRICEBLOCK_PRIME_ELIGIBLE).removeClass("aok-hidden")};w=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS],h=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS_LABEL],g=e[a.BUNDLE_LISTING_WIDGET_V2_YOU_SAVE],m=e[a.BUNDLE_LISTING_WIDGET_V2_YOU_SAVE_LABEL];e=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS_NO_YOU_SAVE_LABEL];
b.objectIsEmpty(d)||b.objectIsEmpty(h)||b.objectIsEmpty(g)||b.objectIsEmpty(m)?b.objectIsEmpty(d)||b.objectIsEmpty(h)||b.objectIsEmpty(m)?b.objectIsEmpty(g)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_PRICE).html(g.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_COLUMN).removeClass("aok-hidden")):(c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_LABEL).html(m.trim()),
c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(h.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_COLUMN).removeClass("aok-hidden")):(c(a.BUNDLE_PRICEBLOCK_SAVINGS_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_LABEL).html(m.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_PRICE).html(g.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(h.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_SAVINGS_YOU_SAVE_COLUMN).removeClass("aok-hidden"))};
r=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH];e=e[a.BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH_LABEL];b.objectIsEmpty(d)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_ROW).removeClass("aok-hidden"))};n=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_DEAL];e=e[a.BUNDLE_LISTING_WIDGET_V2_DEAL_LABEL];b.objectIsEmpty(d)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_DEAL_PRICE).html(d.trim()),
c(a.BUNDLE_PRICEBLOCK_DEAL_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_DEAL_ROW).removeClass("aok-hidden"))};return{parsePricingData:m,_retryCount:function(){return d}}});"use strict";f.when("A","ready").register("bundle-state",function(b){var a=b.$,f={bundleState:"#bundle-state"};return{elements:f,getBundleASIN:function(){var b=a(f.bundleState);if(b.length)return b.data("asin")}}});"use strict";f.when("A").register("bundle-logger",function(b){b=n.ue||!1;var a=b.count||!1,f=b.log||!1,g=n.ueLogError||
!1,c=function(a,b,c,k){"INFO"!==b&&g?(null!==k&&"object"===typeof k?k.message="["+a+"] "+k.message:k={message:"["+a+"]"},g(k,{logLevel:b,attribution:c,message:a})):"INFO"===b&&f&&f(a,c)};return{logCount:function(b,c){if(a)return a(b,c),a(b)},logInfo:function(a,b){c(a,"INFO",b,null)},logWarning:function(a,b,d){c(a,"WARN",b,d)},logError:function(a,b,d){c(a,"ERROR",b,d)},logFatal:function(a,b,d){c(a,"FATAL",b,d)}}});"use strict";f.when("A","ready").register("bundle-constants",function(){return{STRIKE_THROUGH_PRICE:"#bundle_strikethrough_price",
BUNDLE_PRICE:"#bundle_price",YOU_SAVE:"#bundle_you_save",BUNDLE_DEAL_PRICE:"#bundle_deal_price",TOTAL_BOUGHT_SEPARATELY:"#bundle_total_bought_separately",BUNDLE_PRICEBLOCK_DEAL_PRICE:"#priceblock-bundle-deal-price",BUNDLE_PRICEBLOCK_DEAL_LABEL:"#priceblock-bundle-deal-label",BUNDLE_PRICEBLOCK_DEAL_ROW:"#priceblock-bundle-deal-row",BUNDLE_PRICEBLOCK_SAVINGS_PRICE:"#priceblock-bundle-savings-price",BUNDLE_PRICEBLOCK_SAVINGS_ROW:"#priceblock-bundle-savings-row",BUNDLE_PRICEBLOCK_SAVINGS_LABEL:"#priceblock-bundle-savings-label",
BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL:"#bundle-v2-savings-atf-you-save-label",BUNDLE_PRICEBLOCK_YOU_SAVE_PRICE:"#priceblock-bundle-you-save-price",BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_PRICE:"#bundle-v2-savings-no-you-save-atf",BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_LABEL:"#bundle-v2-savings-no-you-save-label-atf",BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE:"#bundle-v2-price-strikethrough-atf",BUNDLE_PRICEBLOCK_STRIKETHROUGH_ROW:"#bundle-priceblock-strikethrough-row",BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE_LABEL:"#bundle-v2-price-strikethrough-atf-label",
BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_COLUMN:"#bundle-v2-savings-no-you-save-atf-column",BUNDLE_PRICEBLOCK_SAVINGS_YOU_SAVE_COLUMN:"#bundle-v2-you-save-atf-column",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_COLUMN:"#bundle-v2-you-save-no-savings-atf-column",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_LABEL:"#bundle-v2-you-save-no-savings-atf-label",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_PRICE:"#bundle-v2-you-save-no-savings-atf-price",BUNDLE_PRICEBLOCK_LESS_THAN_BUYING_SEPERATELY_PRICE:"#priceblock-bundle-less-than-buying-seperately-price",
BUNDLE_PRICEBLOCK_PRIME_ELIGIBLE:"#bundle-v2-atf-prime-logo",BUNDLE_TWISTER_PLUS_FEATURE:"#bundles-twister-plus",BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH:"bundle-listing-v2-strikethrough",BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH_LABEL:"bundle-listing-v2-strikethrough-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS:"bundle-listing-v2-savings",BUNDLE_LISTING_WIDGET_V2_YOU_SAVE:"bundle-listing-v2-you-save",BUNDLE_LISTING_WIDGET_V2_YOU_SAVE_LABEL:"bundle-listing-v2-you-save-label",BUNDLE_LISTING_WIDGET_V2_DEAL:"bundle-listing-v2-deal",
BUNDLE_LISTING_WIDGET_V2_DEAL_LABEL:"bundle-listing-v2-deal-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS_LABEL:"bundle-listing-v2-savings-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS_NO_YOU_SAVE_LABEL:"bundle-listing-v2-you-save-no-savings-label",BUNDLE_LISTING_WIDGET_V2_PRIME_ELIGIBLE:"bundle-listing-v2-prime-eligible",BUNDLE_LISTING_V2_READY_EVENT:"bundle-listing-V2:widget:ready",BUNDLE_LISTING_BOTTOM_SHEET_READY_EVENT:"bundle-listing:sheet:ready",BUNDLE_PRICING_AJAX_TRIGGER_EVENT:"bundle-pricing-ajax-trigger-event"}});
"use strict";f.when("A","ready").execute(function(b){var a=b.$,f=2,g,c,e=!1,h,d=!1,k,n=function(){return b.interval(function(){b.onScreen("#customizable-secondary-view")&&!d&&c();d&&clearInterval(k)},500)};k=n();var l=function(c){e=!0;f=2;var d=a("#customizable_bundle_state"),g=a(c);c=a(g).find("#customizable-add-to-cart-token");d.length&&c.length&&(d=d.data("tiers"),b.each(d,function(b,c){c=a(g).find("#customizable-tier-ajax-"+b);a("#asin-faceouts-tier-"+b).html(c.html())}),b.trigger("customizable-faceouts-loaded",
c))},p=function(c){var d=a("#customizable_bundle_state").data("tiers");b.each(d,function(b,d){d=a("#asin-faceouts-tier-"+b);b=d.find(".a-spinner-wrapper");d=d.find("p");c?(b.addClass("aok-hidden"),d.removeClass("aok-hidden")):(b.removeClass("aok-hidden"),d.addClass("aok-hidden"))})};c=function(){d=!0;var c=a("#customizable_bundle_state").attr("data-asin");e&&c===h||(e=!1,h=c,p(!1),b.get("/gp/product/ajax-handlers/get-product-grouping-tiers.html",{params:{asin:c},accepts:"text/html",timeout:4E3,success:l,
failure:g}))};g=function(a,d,e){0>=f?(b.trigger("customizable-faceouts-not-loaded"),p(!0)):(f--,c())};b.on("a:popover:beforeShow:customizable_bundle_secondary_view",c);b.on("a:popover:afterHide:customizable_bundle_secondary_view",function(){d=!1;f=2;k=n()})});"use strict";f.when("jQuery").register("list-of-bundles",function(b){var a=b("#pba-lob-carousel-container");a.length&&(a.removeClass("a-carousel-static"),f.when("a-carousel-framework","dp-time-to-interactive").execute(function(b,f){f.getClickToCIPromise().then(function(){a.addClass("a-carousel-static");
b.createAll()})}))})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageFeaturesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(d){var b=window.AmazonUIPageJS||window.P,f=b._namespace||b.attributeErrors,e=f?f("SlpsAjaxClient",""):b;e.guardFatal?e.guardFatal(d)(e,window):e.execute(function(){d(e,window)})})(function(d,b,f){d.when("A").register("slps-ajax-client-factory",function(e){function f(){}function g(){return b.performance&&b.performance.now?b.performance.now():(new Date).getTime()}function k(d,f){return function(a,m){"object"===typeof b.ue&&b.ue.count&&e.each(f(a,m),function(a){b.ue.count(a.key,a.value)});
d.apply(null,arguments)}}return function(b){var h=function(a,e,l){var c=function(a,c){return{key:[b,"ajax",a,e].join(":"),value:c}},h="function"===typeof a.error?a.error:f;a.success=d.guardFatal(k("function"===typeof a.success?a.success:f,function(){return[c("error",0),c("timeout",0),c("time",g()-l)]}));a.error=d.guardFatal(k(h,function(a){return[c("error",1),c("timeout",4>a.http.readyState?1:0),c("time",g()-l)]}));return a};return{ajax:function(a,b){var d=g(),c;(c=b.operationId)||(c=document.createElement("a"),
c.href=a,c=c.pathname.replace(/^\/|\/$/g,""));e.ajax(a,h(b,c,d))}}}})});
/* ******** */
(function(g){var l=window.AmazonUIPageJS||window.P,m=l._namespace||l.attributeErrors,a=m?m("DetailPageSlpsFitCxAssets",""):l;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,l,m){g.when("slps-ajax-client-factory").register("slps-ajax",function(a){return a("slps").ajax});"use strict";g.when("A","jQuery","fit-cx-device-utils","ready").register("fit-aui-utils",function(a,b,f){function e(c){var e=b("script[type\x3d'a-state']").filter(function(){return b(this).data("a-state").key===
c});return a.parseJSON(e.html())}function n(c,a){g.when(f.getPopoverType()).execute(function(b){b.get(c).hide();a()})}return{getTabSelector:function(a){return"[data-a-tab-name\x3d'"+a+"']"},clickTab:function(a){b("[data-a-tab-name\x3d'"+a+"']").click()},getHideClass:function(){return"aok-hidden"},getState:function(a){return e(a)},hidePopover:function(a,b){return n(a,b)}}});"use strict";g.when("A","jQuery","slps-ajax","fit-aui-utils","fit-cx-device-utils","fit-cx-metrics","ready","fit-cx-popover-ready").execute(function(a,
b,f,e,n,c){function d(){t=a.state(H);p=t.productInfo;t.customerProfile!==m&&(x=t.customerProfile)}function h(b){var e="a:popover:afterShow:"+r.name,d=function(){c.recordClick(b);a.off(e,d)};a.on(e,d)}function I(){(function(){a.on("a:tabs:FitCXTabSet:"+y.chart+":select",function(a){u();c.recordClick({counter:"TabSizeChart"})});a.on("a:tabs:FitCXTabSet:select",function(){c.recordClick({counter:"TabSelect",refTag:"slps_cx_tab_select"})})})();(function(){a.on("fit-cx:refresh-displayed-recommendation",
function(a,c,d,n){b("#"+k.ingressCold).remove();b("#"+k.ingressWarm).removeClass(e.getHideClass());a?(a=b("#"+k.ingressWarmRec),c=c+(d===m?"":" "+d)+" "+n,a.text()!==c&&(a.text(c),b("#"+k.ingressWarmWithRecText).removeClass(e.getHideClass()),b("#"+k.ingressWarmWithoutRecText).addClass(e.getHideClass()))):(b("#"+k.ingressWarmWithoutRecText).removeClass(e.getHideClass()),b("#"+k.ingressWarmWithRecText).addClass(e.getHideClass()));v()});a.on("a:pageUpdate",function(){var a=b("#"+k.name);!1===a.hasClass("initialized")&&
(d(),D=!1,l(),F(),v(),a.addClass("initialized"))});a.on("fit-cx-ingress-initialized",function(){b("#"+k.name).addClass("initialized")});a.on("fit-cx-popover-initialized",function(a){w=a})})()}function l(){b("#"+k.hif).click(a.debounce(function(){h({counter:"IngressHif",refTag:"slps_cx_dp_hif"});z(y.reviews);w.show()},200,!0))}function F(){var d=e.getTabSelector(y.chart),n=0<b(d).length;b("#"+E).click(a.debounce(function(){n?(h({counter:"IngressSizeChartWithTab"}),null===w&&c.recordClick({counter:"IngressSizeChartWithTabPopoverIsNull"}),
z(y.chart),w.show()):t.canShowSizeChart&&(h({counter:"IngressSizeChartWithoutTab"}),u(),null===w&&c.recordClick({counter:"IngressSizeChartWithoutTabPopoverIsNull"}),w.show())},200,!0))}function v(){b("#"+k.persFit).click(a.debounce(function(){h({counter:"IngressPersFit"});z(y.persFit);w.show()},200,!0))}function z(a){t.canShowPersFit&&!D&&J();e.clickTab(a)}function q(c){b("."+r.loading,c).addClass(A);(function(){var a=b("#"+B.cxContainer.errorAjax);a.remove().removeClass(A);c.append(a)})();(function(){a.declarative("fit-cx:error-action",
"click",function(a){e.hidePopover(r.name,C)})})()}function C(){b("#"+B.cxContainer.errorAjax).addClass(A)}function u(){var c=b("#"+r.sizeChartContent);b("."+r.loading,c).removeClass(A);a.ajax(t.sizeChartUrl,{method:"get",success:function(b){c.html(b);a.trigger("a:popover:ajaxContentLoaded:g2s2SizeChartView");n.adjustPopoverHeight(".heightG2S2SizeChartPC",400)},error:function(){q(c)}})}function J(){function c(a){b("."+r.loading,e).addClass(A);C();e.append(a);D=!0}var e=b(G);b("."+r.loading,e).removeClass(A);
t.isWarmStart?f("/slps/cx/shoes/getinputandrec",{params:{asin:p.asin,category:p.category,color:p.color,gender:x.gender,offset:x.offset,parentAsin:p.parentAsin,ref_:K,region:p.region,sizeInput:x.sizeInput,sizeScheme:x.sizeScheme,width:x.width},method:"get",operationId:"shoesGetInputAndRec",success:function(b){c(b);g.when("fit-cx-input-ready","fit-cx-recommendation-ready").execute(function(){a.trigger("fit-cx:new-rec-transition");a.trigger("fit-cx:new-input-transition")})},error:function(){q(e)}}):
f("/slps/cx/sub-controllers/shoes/input-screen",{params:{asin:p.asin,category:p.category,color:p.color,parentAsin:p.parentAsin,ref_:L,region:p.region},method:"get",operationId:"shoesInputScreen",success:function(b){c(b);g.when("fit-cx-input-ready").execute(function(){a.trigger("fit-cx:new-input-transition")})},error:function(){q(e)}})}function M(a){for(var c,e=0;e<a.length;e++)if(c=b(a[e]),0<c.length)return c;return!1}var H="fit-cx-dp-data",L="slps_cx_input_scrn_load",K="slps_cx_input_recs_scrn_load",
E=n.getSizeChartIngressSelector(),A=e.getHideClass(),B,r,y,G,k,t,p,x,D,w;(function(){var c;B=a.state("fit-cx-dp-selectors");B===m?c=!1:(r=B.cxContainer,y=r.tabHeaders,G="#"+r.persFitContent,k=B.ingress,c=void 0);!1!==c&&E&&(d(),D=!1,l(),F(),v(),I(),a.trigger("fit-cx-ingress-initialized",M(["#"+k.persFit,"#"+k.hif,"#"+E])))})()});"use strict";g.when("A","jQuery","fit-cx-rec-selectors","fit-visual-renderer","fit-aui-utils","fit-cx-metrics").register("fit-cx-recommendation-ready",function(a,b,f,e,n,
c){function d(){var a="."+f.sizeOptionToggle+":eq("+v+")",c=b("#"+f.sizeToggleGroup);b(a,c).click()}function h(){(function(){b("#"+f.editInputLink).click(function(c){c.preventDefault();b("#"+f.name).hide();d();a.trigger("fit-cx:edit-inputs")})})()}function g(){function h(){a.on("a:button-group:"+f.sizeToggleGroup+":toggle",function(a){a=a.selectedButton.buttonName.slice(-1);e.render(C[a].simplifiedShoeFeel,m);c.recordClick({counter:"RecToggle",refTag:"slps_cx_rec_toggle"})})}a.on("a:popover:beforeShow:"+
l.name,function(a){v=1;d()});(function(){a.on("fit-cx:input-to-same-rec-transition",function(){b("#"+f.name).show()});a.on("fit-cx:pre-input-to-new-rec-transition",function(){b("#"+f.name).remove()})})();(function(){a.declarative("fit-cx:confirm-rec-btn-action","click",function(a){n.hidePopover(l.name,d);c.recordClick({counter:"RecClose",refTag:"slps_cx_rec_close"})})})();u&&h()}var l=a.state("fit-cx-dp-selectors").cxContainer,m="#"+f.visual,v=1,z=!1,q,C,u=!1;a.on("fit-cx:new-rec-transition",function(c){var b;
q=n.getState("fit-cx-rec-data");u=!1;null!==q?(u=!a.objectIsEmpty(q.visualizationsJson),b=!0):b=!1;u&&(C=a.parseJSON(q.visualizationsJson),e.render(C[v].simplifiedShoeFeel,m));h();c&&(b?a.trigger("fit-cx:refresh-displayed-recommendation",b,q.recommendationSize,q.recommendationWidth,q.recommendationSizingScheme):a.trigger("fit-cx:refresh-displayed-recommendation",b));z||(g(),z=!0)})});"use strict";g.when("jQuery","ready").register("fit-visual-renderer",function(a){function b(a){a=a/2+.5;var b;b=f.length-
1;var c=a>=f[b][0],d;if(a<=f[0][0])d=[0,0];else if(c)d=[b,b];else for(var h=0;h<=b;h++)if(c=f[h][0],a===c){d=[h,h];break}else if(a<c){d=[h-1,h];break}b=d;if(b[0]===b[1])a=f[b[0]][1];else{d=f[b[0]];c=d[0];d=d[1];h=f[b[1]];b=h[1];h=h[0]-c;a-=c;for(var c=[],g=0;g<d.length;g++)c.push(d[g]+(b[g]-d[g])*a/h);a=c}b="#";for(d=0;d<a.length;d++)c=parseInt(a[d],10).toString(16),b+=1===c.length?"0"+c:c;return b}var f=[[0,[255,0,0]],[.1,[255,165,0]],[.4,[255,255,0]],[.5,[154,205,50]],[.6,[0,255,255]],[1,[0,0,255]]];
return{render:function(e,f){var c=b(e.lengthFeel),d=b(e.toeBoxFeel),h=b(e.midfootFeel),g=b(e.heelFeel),c=["linear-gradient(70deg,",c,"0%,",c,"10%,",d,"20%,",d,"40%,",h,"50%,",h,"70%,",g,"80%,",g,"100%)"];a(f).css("background",c.join(" "))}}});"use strict";g.when("fit-cx-device-utils","slps-ajax").register("fit-cx-metrics",function(a,b){var f=l.ue,e="object"===typeof f&&f.count,g="SlpsFitCx:"+a.getDeviceType()+":";return{recordClick:function(a){if("object"!==typeof a)throw"Opts is not an object";if(m!==
a.counter){var d=a.counter;d&&e&&f.count(g+d,1)}m!==a.refTag&&(a=a.refTag)&&b("/slps/cx/reftag",{params:{ref_:a}})}}})});
/* ******** */
(function(n){var q=window.AmazonUIPageJS||window.P,r=q._namespace||q.attributeErrors,e=r?r("DetailPageSnSAssets",""):q;e.guardFatal?e.guardFatal(n)(e,window):e.execute(function(){n(e,window)})})(function(n,q,r){n.when("sns-join-prime-endpoint").register("sns-buybox-constants",function(e){return{SNS_QUANTITY_FIELD:"#mobileQuantityDropDown, #tabletQuantityDropDown",SNS_FREQUENCY_NAME:"rcxOrdFreq",SNS_OPT_IN_NAME:"snsOptIn",QUANTITY_CONTAINER:"#selectQuantity, #mobileQuantitySelection, #sns",QUANTITY:"[name\x3dquantity]",
SNS_QUANTITY:"[name\x3drcxsubsQuan]",SNS_MOBILE_QUANTITY:".snsQuantityRadio input[name\x3d'quantity']:checked",SNS_FREQUENCY_FORM_FIELD:"[name\x3drcxOrdFreq]",SNS_FREQUENCY_FORM_FIELD_MOBILE:".rcxOrdFreq",SNS_ONMLV2_FREQUENCY_TRIGGER_DROPDOWN:"a:dropdown:rcxOrdFreq:select",SNS_ONMLV2_FREQUENCY_TRIGGER_RADIO_BUTTON:".snsOrdFreqRadio",SNS_ONMLV2_QUANTITY_TRIGGER_DROPDOWN:"a:dropdown:rcxsubsQuan:select",SNS_ONMLV2_QUANTITY_TRIGGER_RADIO_BUTTON:".snsQuantityRadio",SNS_ONMLV2_FREQUENCY_FORM_FIELD:"#onmlv2FormFields [name\x3d'rcxOrdFreq']",
SNS_SUBSCRIBE_BUTTON_FREQUENCY_FORM_FIELD:"#subscribeButtonFormFields [name\x3d'rcxOrdFreq']",SNS_ONMLV2_QUANTITY_FORM_FIELD:"#onmlv2FormFields [name\x3d'quantity']",SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD:"#subscribeButtonFormFields [name\x3d'quantity']",SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD:'#onmlv2FormFields [name\x3d"snsDeliveryOption"]',SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD:'#subscribeButtonFormFields [name\x3d"snsDeliveryOption"]',SNS_ONMLV2_QUANTITY_TRIGGER_DESKTOP:"#rcxsubsQuan",
SNS_ONMLV2_QUANTITY_TRIGGER_MOBILE:".snsQuantityRadio",SNS_DP_FREQUENCY_TRIGGER:"#sns-dp-frequency-trigger span",SNS_OPT_IN_CHECKBOX:"#snsOptInCheckbox",SNS_OFFER_LISTING_FIELD:"#snsOfferListingID",OFFER_LISTING_FIELD:"[name\x3dofferListingID]",SNS_FREQUENCY_SECTION:"#snsFrequencySection",SNS_SELECTED_FREQUENCY_LABEL:"#snsSelectedFrequencyLabel",SNS_FIRST_RECURRING_DELIVERY_DATE:"[id\x3dsnsFirstRecurringDeliveryDate]",SNS_BUY_NEW_BUTTON:"#buyNewSection, #newAccordionRow .a-accordion-row-a11y",SNS_BUY_USED_BUTTON:"#usedBuySection, #usedAccordionRow .a-accordion-row-a11y",
ONE_CLICK_BUTTON:".onml-one-click-button",ONE_CLICK_BUTTON_ICON:".onml-one-click-button i",ONE_CLICK_BUTTON_TEXT:".onml-one-click-button input+span",BUY_NOW_BUTTON:".onml-buy-now-button",BUY_NOW_BUTTON_ICON:".onml-buy-now-button i",BUY_NOW_BUTTON_TEXT:".onml-buy-now-button input+span",ADD_TO_CART_BUTTON:"#add-to-cart-button",ADD_TO_CART_DIV:"#addToCart",DSK_BB:"#sns",DSK_BB_DPV1:"#snsBuyBox",MOBILE_ADD_TO_CART_DIV:"#sns",MOBILE_SNS_BUYBOX:"#snsBuyBox",TABLET_ADD_TO_CART_DIV:"#snsTablet",NEW_ACCORDION_ROW_SUBMISSION_FORM:"#newAccordionRow #addToCart",
SNS_ACCORDION_ROW_SUBMISSION_FORM:"#snsAccordionRow #sns, #snsAccordionRowMobile #sns, #snsAccordionRowMobileApp #sns, #snsAccordionRowMovedUp #sns, #snsAccordionRowMobileMovedUp #sns, #snsAccordionRowMobileAppMovedUp #sns, #snsAccordionRowMiddle #sns, #snsAccordionRowMobileMiddle #sns, #snsAccordionRowMobileAppMiddle #sns",SNS_OPT_IN_FORM_FIELD:"[name\x3dsnsOptIn]",LEGACY_SPC_FORM_INPUT:"[name\x3d'submit.rcx-subscribe']",LEGACY_SPC_FORM_INPUT_X:"[name\x3d'submit.rcx-subscribe.x']",SNS_OFFER_FORM_FIELD:".snsONMLOffer",
SNS_DISCOUNT_PILL:"#snsDiscountPill",SNS_ONML_BUYBOX_UPSELL_MESSAGE_NON_TIERED:"#sns-onml-buybox-upsell-message-non-tiered",SNS_ONML_BUYBOX_UPSELL_MESSAGE_TIERED:"#sns-onml-buybox-upsell-message-tiered",SNS_ONML_FRDD:".sns-onml-frdd",SNS_ONMLV2_FRDD:".sns-onmlv2-frdd",SNS_FREQ_BOTTOMSHEET_SELECTOR:"[id\x3dsnsFrequencyBottomSheet]",SNS_OPT_IN_FEATURE_DIV:"#snsOptIn_div",SNS_OPT_IN_INPUT_ID:"[name\x3dsnsOptIn]",SNS_ONML_INIT_INPUT_ID:"isOnmlInitialized",SNS_ONML_INIT_INPUT_SELECTOR:"#isOnmlInitialized",
SNS_DATA_UPDATE_EVENT:"sns-declarative-data-update",SNS_ONML_MERCHANT_INFO:"#snsOnmlMerchantInfo",SNS_DISCOUNT_PILL_POPOVER_TIERED:".snsDiscountPillPopoverTiered",SNS_DISCOUNT_PILL_POPOVER_NON_TIERED:".snsDiscountPillPopoverNonTiered",SNS_BUY_NEW_PRICE:"#onml_snsBuyNew",CBB_BUY_NEW_PRICE:"#buyNew_cbb",NON_CBB_BUY_NEW_PRICE:"#buyNew_noncbb",SNS_PRICE_IN_BUY_USED_SECTION:"#usedBuySection #onml_snsBuyNew",CBB_SNS_BUY_NEW_PRICE:"#onml_snsBuyNew_cbb",SNS_CBB_ACCORDION_ROW:"#snsAccordionRow, #snsAccordionRowMobile, #snsAccordionRowMobileApp, #snsAccordionRowMovedUp, #snsAccordionRowMobileMovedUp, #snsAccordionRowMobileAppMovedUp, #snsAccordionRowMiddle, #snsAccordionRowMobileMiddle, #snsAccordionRowMobileAppMiddle",
SNS_ONMLV2_FORM_FIELDS:"#onmlv2FormFields",SUBSCRIBE_BUTTON_FORM_FIELDS:"#subscribeButtonFormFields",SNS_ACCORDION_HEADER_RADIO_BUTTON:'#snsAccordionRow [role\x3d"radio"], #snsAccordionRowMobile [role\x3d"radio"], #snsAccordionRowMobileApp [role\x3d"radio"], #snsAccordionRowMovedUp [role\x3d"radio"], #snsAccordionRowMobileMovedUp [role\x3d"radio"], #snsAccordionRowMobileAppMovedUp [role\x3d"radio"], #snsAccordionRowMiddle [role\x3d"radio"], #snsAccordionRowMobileMiddle [role\x3d"radio"], #snsAccordionRowMobileAppMiddle [role\x3d"radio"]',
SNS_CBB_PRIME_SHIPPING:"#sns-cbb-prime-shipping-header, #sns-cbb-prime-shipping-row",DPV2_BUY_NEW_PRICE:"#buyNew_dpv2",SUBSCRIBE_ONLY_LINK:"#subscribe-only",SUBSCRIBE_ONLY_FORM:"#sns-onml-subscribe-only",JUST_SUBSCRIBE_DIV:"#just-subscribe-button-container",GOLDBOX_DISCOUNT_MESSAGE:"#onml-goldbox-discount-message",SUBSCRIBE_ONLY_FORM_ATTRIBUTES:{name:"sns-onml-subscribe-only",id:"sns-onml-subscribe-only",method:"POST",action:"/gp/product/handle-buy-box/ref\x3donml_so_l"},SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES:{name:"sns-onmlv2-add-to-cart",
id:"sns-onmlv2-add-to-cart",method:"POST",action:"/gp/subscribe-and-save/atc/sns-atc.html"},JUST_SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-just-subscribe",id:"sns-onmlv2-just-subscribe",method:"POST",action:"/gp/subscribe-and-save/pipeline/subscribe.html"},BUY_NOW_FORM_ATTRIBUTES:{name:"sns-onmlv2-buy-now",id:"sns-onmlv2-buy-now",method:"POST",action:""},SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-legacy-subscribe",id:"sns-legacy-subscribe",method:"POST",action:"/gp/product/handle-buy-box"},
SNS_JOIN_PRIME_FORM_ATTRIBUTES:{name:"sns-join-prime",id:"sns-join-prime",method:"POST",action:""},SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF:{name:"sns-join-prime-vmf",id:"sns-join-prime-vmf",method:"POST",action:e.endpoint},SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-subscribe",id:"sns-onmlv2-subscribe",method:"POST",action:"/gp/subscribe-and-save/atc/sns-atc.html"},SNS_ATC_DECLARATIVE:"#addToCart_feature_div #atc-declarative",MOBB_ALTERNATE_OFFERS:"#SecondNewAccordionRow .a-accordion-row-a11y, #ThirdNewAccordionRow .a-accordion-row-a11y",
SNS_SUBMIT_SECTION_ID:"#snsSubmitSection",SNS_SWITCH_SUBMIT_SECTION_ID:"#snsSwitchSubmitSection",SNS_BUY_NOW_BUTTON:"#snsBuyNowSubmit",SNS_SUBSCRIBE_ONLY_BUTTON:"#snsSubscribeOnlySubmit",SNS_DECLARATIVE_ACTION:"#sns-submit-declarative",SNS_SUBSCRIBE_ONLY_ACTION:"sns-subscribe-only",SNS_BUY_BOX_PARAMS:"sns-buybox-message-params",SNS_BUY_BOX_PARAM_MAP:"buyboxMessageParamsMap",SNS_SELECT_DELIVERY_URL:"/gp/subscribe-and-save/dp/delivery.html/ref\x3drcxsubs_sns_delivery_url?app-nav-type\x3dmodal",SNS_SELECT_DELIVERY_OPTION_ID:"#snsDeliveryOption",
SNS_DELIVERY_OPTION_SNS:"sns",SNS_DELIVERY_OPTION_ONML:"onml",SNS_BASE_PRICE:"#sns-base-price",SNS_TIERED_PRICE:"#sns-tiered-price",SNS_DELIVERY_OPTION_DIV:"#snsDeliveryOpt",ONML_DELIVERY_OPTION_DIV:"#onmlDeliveryOpt",SNS_MOD_ACCORDION_HEADER_FEATURES:"#sns-cbb-prime-shipping-header-wrapper, #accordion-header-delivery-link",SNS_SUBSCRIPTION_PRICE:"#subscriptionPrice",SNS_DELIVERY_OPTION_SNS_LINK:"#sns-delivery-link",ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK:"#accordion-header-sns-delivery-link",SNS_DELIVERY_OPTION_ONML_LINK:"#onml-delivery-link",
ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK:"#accordion-header-onml-delivery-link",SNS_DELIVERY_BOTTOM_SHEET:"#snsDeliveryDateBottomSheet",SNS_DELIVERY_BOTTOM_SHEET_SPINNER:"#snsDeliveryDateBottomSheetSpinner",SNS_DELIVERY_BOTTOM_SHEET_CONTENT:"#snsDeliveryDateBottomSheetContent",SNS_SUBSCRIBE_SUBMIT_BUTTON:"#rcx-subscribe-submit-button",SNS_DELIVERY_UPSELL:"#sns-delivery-buybox-upsell-message",SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL:"#sns-delivery-buybox-upsell-message-new-or-unrecognized",SNS_DELIVERY_NON_TIERED_UPSELL:"#sns-delivery-buybox-upsell-message-non-tiered",
SNS_DELIVERY_TIERED_UPSELL:"#sns-delivery-buybox-upsell-message-tiered",ONML_DELIVERY_UPSELL:"#onml-delivery-buybox-upsell-message",ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL:"#onml-delivery-buybox-upsell-message-new-or-unrecognized-sns-customer",ONML_DELIVERY_NON_TIERED_UPSELL:"#onml-delivery-buybox-upsell-message-non-tiered",ONML_DELIVERY_TIERED_UPSELL:"#onml-delivery-buybox-upsell-message-tiered",SNS_ADD_TO_CART_FORM:"#sns-onmlv2-add-to-cart",SNS_SUBSCRIBE_FORM:"#sns-onmlv2-subscribe",JUST_SUBSCRIBE_FORM:"#sns-onmlv2-just-subscribe",
BUY_NOW_FORM:"#sns-onmlv2-buy-now",SNS_LEGACY_SUBSCRIBE_FORM:"#sns-legacy-subscribe",SNS_JOIN_PRIME_FORM:"#sns-join-prime",SNS_DELIVERY_PILL:"#sns-delivery-pill",SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL:"#sns-delivery-new-or-unrecognized-sns-customer-pill",SNS_DELIVERY_NON_TIERED_PILL:"#sns-delivery-non-tiered-pill",SNS_DELIVERY_TIERED_PILL:"#sns-delivery-tiered-pill",ONML_DELIVERY_PILL:"#onml-delivery-pill",ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL:"#onml-delivery-new-or-unrecognized-sns-customer-pill",
ONML_DELIVERY_NON_TIERED_PILL:"#onml-delivery-non-tiered-pill",ONML_DELIVERY_TIERED_PILL:"#onml-delivery-tiered-pill",SNS_TOGGLE_BUY_BOX:"[name\x3dtoggleBuyBox]",SNS_ONMLV2_JOIN_PRIME_UPSELL:"#momAEmsg",SNS_ONMLV2_JOIN_PRIME_CHECKBOX:"#chkMom",SNS_ONMLV2_JOIN_PRIME_BUTTON:"#mom-join-button",SNS_DELIVERY_BOTTOMSHEET_IN_BUYBOX:"#snsDeliveryDateBottomSheet",SNS_SWITCH_WIDGET_ONML_URL:"/auto-deliveries/switchWidgetMobile?",SNS_SWITCH_WIDGET_LEGACY_URL:"/auto-deliveries/switchWidgetLegacy?",SNS_SWITCH_WIDGET_LEGACY_CONTINUE_URL:"/gp/subscribe-and-save/pipeline/subscribe.html?",
SNS_SWITCH_WIDGET_ONML_DESKTOP_URL:"/auto-deliveries/ajax/switchWidgetAjax?",SNS_SWITCH_WIDGET_LEGACY_DESKTOP_URL:"/auto-deliveries/ajax/switchWidgetAjaxLegacy?",SNS_SWITCH_WIDGET_PARAMS:"sns-switch-message-params",SNS_SWITCH_WIDGET_PARAM_MAP:"switchMessageParamsMap",DISCOUNT_TYPE_ZERO_BASE:"ZERO_BASE",GET_MYD_RECOMMENDATIONS_URL:"/auto-deliveries/ajax/viewRecommendationsAjax",SOURCE_PAGE:"dp",VIEW_CART_URL:"/gp/cart/view.html",GO_TO_CHECKOUT_URL:"/gp/cart/desktop/go-to-checkout.html?proceedToCheckout\x3d1",
SNS_HUC_GET_TREATMENT_FORM_ID:"sns-get-huc-treatment"}});n.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-bottom-sheet",function(e,a,b,d,c,h){return{init:function(){function f(){var a=l(d.SNS_FREQUENCY_FORM_FIELD).val();l(d.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+a+"]").click()}var l=e.$;a.isMobileDevice()&&(a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,
f),e.declarative("sns-frequency-selected","click",function(g){var f=l(d.SNS_FREQUENCY_FORM_FIELD);g=g.$target;var k=g.val(),p={};p[d.SNS_FREQUENCY_NAME]=k;h.setOnmlDeclaratives(p);f.val(k);q.setTimeout(function(){e.trigger(d.SNS_DATA_UPDATE_EVENT)},0);l(d.SNS_FIRST_RECURRING_DELIVERY_DATE).html(g.data("frdd-label"));l(d.SNS_SELECTED_FREQUENCY_LABEL).html(g.data("freq-button-label"));c.updateMessages(k);a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY,k)}))}}});n.when("A","sns-constants","sns-utils",
"sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-popover",function(e,a,b,d,c,h){return{init:function(){function f(){var a=l(d.SNS_FREQUENCY_FORM_FIELD).val();l("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+(a-1)+"] a").click()}var l=e.$;b.isMobileDevice()||(b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),e.on("a:accordion:sns-dp-frequency-accordion:select",function(g){var f=l(d.SNS_FREQUENCY_FORM_FIELD),k=l(d.SNS_DP_FREQUENCY_TRIGGER),
p=l(g.selectedRow.$row[0]);g=p.data().frequencyLabel;var p=p.data().frequencyValue,t={};t[d.SNS_FREQUENCY_NAME]=p;h.setOnmlDeclaratives(t);f.val(p);q.setTimeout(function(){e.trigger(d.SNS_DATA_UPDATE_EVENT)},0);k.text(g);c.updateMessages(p);b.setOnmlUserPref(a.USER_PREFS_KEYS.SNS_FREQUENCY,p)}))}}});n.when("A","sns-utils","sns-constants","sns-buybox-utils","sns-buybox-constants","sns-atc-utils").register("sns-opt-in-checkbox",function(e,a,b,d,c,h){return{init:function(){function f(g){var f=e.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");
g=e.$(c.SNS_OPT_IN_FORM_FIELD);f&&(a.isMobileApp()||a.isTabletApp())&&h.getAddToCartStrings();var l={};l[c.SNS_OPT_IN_NAME]=f;h.setOnmlDeclaratives(l);g.val(f);q.setTimeout(function(){e.trigger(c.SNS_DATA_UPDATE_EVENT)},0);q.setTimeout(function(){d.updateAddToCartButtonLabel(f);d.updateOneClickButtonLabel(f);d.updateBuyNowButtonLabel(f)},0);d.showSnSMerchantInfoIfSnSOptInChecked(f);d.showGoldBoxDiscountMessageIfSnSOptInChecked(f);d.showSubscribeOnlyButtonIfSnSOptInChecked(f);a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,
f)}function l(){var b=function(){var a=e.$("#buybox").find(".a-declarative").has("#add-to-cart-button");if(1===a.length)return a;a=e.$("#atc-declarative");return 1===a.length?a:null}();b&&b.click(function(){var f=h.getAddToCartData();if(f.inputs[c.SNS_OPT_IN_NAME]!==r){var d=a.getAStateFromDom(c.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams"),l=e.$(c.SNS_OPT_IN_CHECKBOX).is(":checked"),t={},t=d||{};t[c.SNS_OPT_IN_NAME]=l;var q=b.data("awMash");Object.keys(t).forEach(function(a){q.inputs[a]!==
f.inputs[a]&&(q.inputs[a]=f.inputs[a])})}})}a.isSnSEligible()&&f({snsOnLoad:!0});e.declarative("sns-opt-in-checked","change",f);a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,f);a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,a.enableSnSOptIn);a.isMobileApp()&&(a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,l),l());a.enableSnSOptIn()}}});n.when("A","sns-constants","sns-buybox-constants","sns-utils").register("sns-messaging-utils",function(e,a,b,d){var c=function(a,
c){var d=a.firstRecurringDeliveryDates[c-1];e.$(b.SNS_ONML_FRDD).each(function(){e.$(this).html(d)})};return{updateMessages:function(h){var f=d.getAStateFromDom(b.SNS_OPT_IN_FEATURE_DIV,"sns-buybox-message-params","buyboxMessageParamsMap");if(f){var l=e.$(b.SNS_ONML_BUYBOX_UPSELL_MESSAGE_NON_TIERED),g=e.$(b.SNS_ONML_BUYBOX_UPSELL_MESSAGE_TIERED),m=e.$(b.SNS_DISCOUNT_PILL_POPOVER_TIERED),k=e.$(b.SNS_DISCOUNT_PILL_POPOVER_NON_TIERED);f.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED?(l.addClass("aok-hidden"),
g.removeClass("aok-hidden"),k.addClass("aok-hidden"),m.removeClass("aok-hidden")):(l.removeClass("aok-hidden"),g.addClass("aok-hidden"),k.removeClass("aok-hidden"),m.addClass("aok-hidden"));l=f.discountType;g=e.$(b.SNS_DISCOUNT_PILL);f.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED?(g.attr("data-tiered-level",a.PREMIUM),l===a.ZERO_BASE&&g.removeClass("aok-hidden")):(g.attr("data-tiered-level",a.BASE),l===a.ZERO_BASE&&g.addClass("aok-hidden"));c(f,h)}}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils",
"sns-moq-helper").register("sns-buy-now",function(e,a,b,d){var c=e.$;e.declarative("sns-buy-now","click",function(e){if(!d.isSnsLocked()&&!d.isSnsLocked()){e=c("\x3cform\x3e",{method:a.BUY_NOW_FORM_ATTRIBUTES.method,action:"/gp/subscribe-and-save/buynow/buy-now.html?ref\x3ddp_sns_bb_bn",id:a.BUY_NOW_FORM_ATTRIBUTES.id,name:a.BUY_NOW_FORM_ATTRIBUTES.name});var f="";if(b.isCbbTemplateEnabled())for(var l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"snsAddressId"},{name:"snsOnmlOfferId"},
{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],g=0;g<l.length;g++)var m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.getOnmlv2FormValueByName(k),f=f+b.createHiddenInput(m,k);else{b.removeFormFieldsIntroducedByCbb();l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(g=0;g<l.length;g++)m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.isMobileDevice()?
c(a.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():b.isWeb()?c(a.ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():c(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val(),f+=b.createHiddenInput(m,k);l=b.isMobileDevice()?c(a.SNS_MOBILE_QUANTITY):c(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);f+=b.createHiddenInput("quantity",l.val())}f+=b.createHiddenInput("submit.buy-now","1");e.html(f);c("body").append(e);c(a.BUY_NOW_FORM).submit();c(a.BUY_NOW_FORM).remove()}})});n.when("A","sns-buybox-constants","sns-onmlv2-utils",
"sns-moq-helper").register("sns-subscribe-only",function(e,a,b,d){var c=e.$;e.declarative("sns-subscribe-only","click",function(e){if(!d.isSnsLocked()){e=c("\x3cform\x3e",{method:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.method,action:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.name});var f="";if(b.isCbbTemplateEnabled())for(var l=[{name:"ASIN"},{name:"snsMerchantID"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"longShipAddressId",
fieldName:"snsAddressId"},{name:"rcxOrdFreq"},{name:"quantity"}],g=0;g<l.length;g++)var m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.getOnmlv2FormValueByName(k),f=f+b.createHiddenInput(m,k);else{b.removeFormFieldsIntroducedByCbb();l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsMerchantID"},{name:"longShipAddressId",fieldName:"snsAddressId"}];for(g=0;g<l.length;g++)m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.isMobileDevice()?c(a.MOBILE_ADD_TO_CART_DIV+
" [name\x3d"+k+"]").val():b.isWeb()?c(a.ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():c(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val(),f+=b.createHiddenInput(m,k);l=b.isMobileDevice()?c(a.SNS_MOBILE_QUANTITY):c(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);f+=b.createHiddenInput("quantity",l.val())}f+=b.createHiddenInput("ref","sns-subscribe-only");f+=b.createHiddenInput("submit.subscribe-only","1");e.html(f);c("body").append(e);c(a.JUST_SUBSCRIBE_FORM).submit();c(a.JUST_SUBSCRIBE_FORM).remove()}})});
n.when("A","a-dropdown","a-modal","sns-vmf-utils","sns-onmlv2-utils","sns-buybox-constants").register("sns-select-delivery",function(e,a,b,d,c,h){function f(){g("#sns-only-delivery-option-text").length&&(g("#sns-only-delivery-option-text").html(g("#sns-only-delivery-option-text").html().replace(/%_date_%/g,"\x3cspan class \x3d'sns-only-date'\x3e\x3c/span\x3e")),g("#sns-only-delivery-option-text").html(g("#sns-only-delivery-option-text").html().replace(/%_discount_%/g,"\x3cspan class \x3d'sns-only-discount'\x3e\x3c/span\x3e")),
g("#onml-later-delivery-option-text").html(g("#onml-later-delivery-option-text").html().replace(/%_date-more-later_%/g,"\x3cspan class \x3d'sns-ml-date'\x3e\x3c/span\x3e")),g("#onml-later-delivery-option-text").html(g("#onml-later-delivery-option-text").html().replace(/%_discount-more-later_%/g,"\x3cspan class \x3d'sns-ml-discount'\x3e\x3c/span\x3e")),g("#onml-now-delivery-option-text").html(g("#onml-now-delivery-option-text").html().replace(/%_date-one-now_%/g,"\x3cspan class \x3d'sns-one-now-date'\x3e\x3c/span\x3e")),
g("#onml-now-delivery-option-text").html(g("#onml-now-delivery-option-text").html().replace(/%_discount-one-now_%/g,"\x3cspan class \x3d'sns-one-now-discount'\x3e\x3c/span\x3e")));var a=c.getDeliveryInfoParam(),b=c.getDiscountOptionsParam(),f=c.getDiscountTypeParam(),d=c.getSnsFrequencyParam();c.getOnmlFrequencyParam();var l=c.getOnmlDateParam(),e=a.snsDates[g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")],a=a.onmlDates[g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex")],m=d[g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")].highlightedDiscount,
k=b[m],d=d[g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex")].highlightedDiscount,p=b[d],b=b[0];f===h.DISCOUNT_TYPE_ZERO_BASE&&0===d?(g(".onmlNextDeliveryDate").addClass("aok-hidden"),g(".onmlNextDeliveryDateNoDiscount").removeClass("aok-hidden")):(g(".onmlNextDeliveryDate").removeClass("aok-hidden"),g(".onmlNextDeliveryDateNoDiscount").addClass("aok-hidden"));f===h.DISCOUNT_TYPE_ZERO_BASE&&0===m?(g(".snsDeliveryDate").addClass("aok-hidden"),g(".snsDeliveryDateNoDiscount").removeClass("aok-hidden")):
(g(".snsDeliveryDate").removeClass("aok-hidden"),g(".snsDeliveryDateNoDiscount").addClass("aok-hidden"));g(".sns-only-date").html(e);g(".sns-only-discount").html(k);g(".sns-ml-date").html(a);g(".sns-ml-discount").html(p);g(".sns-one-now-date").html(l);g(".sns-one-now-discount").html(b)}function l(){var a,b,f;g(h.SNS_DELIVERY_OPTION_DIV).is(":checked")?(a=g("[name\x3drcxOrdFreqSns]").prop("selectedIndex"),b=c.getSnsFrequencyParam(),g("#rcxOrdFreqSnsWrapper").removeClass("aok-hidden"),g("#rcxOrdFreqOnmlWrapper").addClass("aok-hidden"),
f="sns"):(a=g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"),b=c.getOnmlFrequencyParam(),g("#rcxOrdFreqOnmlWrapper").removeClass("aok-hidden"),g("#rcxOrdFreqSnsWrapper").addClass("aok-hidden"),f="onml");d.selectFrequency(b[a],f)}var g=e.$,m,k,p;n.when("a-sheet").execute("sns-mobile-sheet",function(a){k=a});e.declarative("sns-delivery-date-bottom-sheet","click",function(a){g("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden")?d.updateFrequencyIndex(g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")):
d.updateFrequencyIndex(g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"));f();a={name:"sns_delivery_bottom_sheet",preloadDomId:"snsDeliveryDateBottomSheet",height:270,closeType:"message",closeMessage:g("#bottomSheetClose").val(),sheetType:"web"};m=k.create(a);m.show()});e.declarative("sns-delivery-date","click",function(a){g("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden")?d.updateFrequencyIndex(g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")):d.updateFrequencyIndex(g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"));
f();a=g(h.SNS_SUBMIT_SECTION_ID);var c={dataStrategy:"preload",header:g("#deliveryModalTitle").val(),name:"sns-delivery-modal"};p=b.create(a,c);p.show()});e.declarative("sns-delivery-cancel-btn","click",function(a){p.hide()});e.declarative("sns-delivery-change-btn","click",function(a){l();p.hide()});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){l()})});n.when("A","sns-buybox-constants","sns-priceblock-constants").register("sns-onmlv2-priceblock-utils",function(e,a,b){var d=e.$;return{updateDesktopPriceBlock:function(c){if(c){var e=
c.zeroBaseDiscount,f=0<d(a.SNS_TOGGLE_BUY_BOX).length,l=0<d(b.DP_STRIKE_PRICE).length;d(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(d(b.ONE_NOW_SHIPPING_MESSAGE).addClass("aok-hidden"),c.justSubscribeTieredStatus?(d(b.SNS_TIERED_PRICE).removeClass("aok-hidden"),d(b.SNS_BASED_PRICE).addClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).addClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden")):e?(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),
d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).addClass("aok-hidden")):(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"))):d(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(d(b.ONE_NOW_SHIPPING_MESSAGE).removeClass("aok-hidden"),e?(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),
d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).addClass("aok-hidden"),l&&(d(a.SNS_TIERED_PRICE).hasClass("aok-hidden")?(d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden")):d(a.SNS_BASE_PRICE).hasClass("aok-hidden")&&(d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),
d(b.SNS_BASED_SAVINGS).addClass("aok-hidden")))):(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden")));f&&d(b.SNS_SAVINGS_ROW).addClass("aok-hidden")}},updateBuyboxPriceBlock:function(c){c&&(d(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(c.oneNowDiscountEligible||d(b.SNS_STRIKETHROUGH_PRICE).removeClass("aok-hidden"),
c.justSubscribeTieredStatus?(d(a.SNS_BASE_PRICE).addClass("aok-hidden"),d(a.SNS_TIERED_PRICE).removeClass("aok-hidden")):(d(a.SNS_BASE_PRICE).removeClass("aok-hidden"),d(a.SNS_TIERED_PRICE).addClass("aok-hidden"))):d(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(d(a.SNS_BASE_PRICE).removeClass("aok-hidden"),d(a.SNS_TIERED_PRICE).addClass("aok-hidden"),c.oneNowDiscountEligible||(d(b.SNS_STRIKETHROUGH_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).addClass("aok-hidden"))))}}});n.when("A","sns-buybox-constants",
"sns-constants","sns-onmlv2-utils").register("sns-onmlv2-message-utils",function(e,a,b,d){function c(){f("#sns-delivery-buybox-upsell-message").find([a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,a.SNS_DELIVERY_NON_TIERED_UPSELL,a.SNS_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden");f("#onml-delivery-buybox-upsell-message").find([a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,a.ONML_DELIVERY_NON_TIERED_UPSELL,a.ONML_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden")}function h(){f("#sns-delivery-pill").find([a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,
a.SNS_DELIVERY_NON_TIERED_PILL,a.SNS_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden");f("#onml-delivery-pill").find([a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,a.ONML_DELIVERY_NON_TIERED_PILL,a.ONML_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden")}var f=e.$;return{updateFirstRecurringDeliveryDate:function(b,c){if(b&&c){var d=b.firstRecurringDeliveryDates[c-1];f(a.SNS_ONMLV2_FRDD).each(function(){f(this).html(d)})}},updateUpsellMessages:function(d,g,e){if(d&&g&&e){var h=g.snsCustomer,p=null==
g.snsJustSubscribeOptionEnabled?g.snsCustomer||!1:g.snsJustSubscribeOptionEnabled||!1,t=f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).length?!0:!1,q=g.suppressSnSOneNowOption||!1,n=g.justSubscribeTieredStatus;g=g.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED;d===b.DELIVERY_OPTION.SNS?(f(a.SNS_DELIVERY_UPSELL).removeClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),p||q?t&&!h?(c(),f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):n?(c(),f(a.SNS_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):
(c(),f(a.SNS_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):c()):d===b.DELIVERY_OPTION.ONML?(f(a.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).removeClass("aok-hidden"),p?t&&!h?(c(),f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):g?(c(),f(a.ONML_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):(c(),f(a.ONML_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):(c(),f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden"))):
(f(a.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),c())}},updateDiscountPill:function(c,d,e){if(c&&d&&e){var k=d.snsCustomer,p=null==d.snsJustSubscribeOptionEnabled?d.snsCustomer||!1:d.snsJustSubscribeOptionEnabled||!1,t=f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).length?!0:!1,q=d.suppressSnSOneNowOption||!1,n=d.justSubscribeTieredStatus;e=d.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED;d=d.zeroBaseDiscount;c===b.DELIVERY_OPTION.SNS?(f(a.SNS_DELIVERY_PILL).removeClass("aok-hidden"),
f(a.ONML_DELIVERY_PILL).addClass("aok-hidden"),p||q?t&&!k?(h(),d||f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):n?(h(),f(a.SNS_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):(h(),d||f(a.SNS_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):h()):c===b.DELIVERY_OPTION.ONML?(f(a.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(a.ONML_DELIVERY_PILL).removeClass("aok-hidden"),p?t&&!k?(h(),d||f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):e?(h(),f(a.ONML_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):
(h(),d||f(a.ONML_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):(h(),d||f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden"))):(h(),f(a.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(a.ONML_DELIVERY_PILL).addClass("aok-hidden"))}},updateBuyboxDeliveryOption:function(){f(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(e.declarative.remove(a.SNS_DECLARATIVE_ACTION),e.declarative.create(a.SNS_DECLARATIVE_ACTION,a.SNS_SUBSCRIBE_ONLY_ACTION),f(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_SNS),
f(a.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_SNS),f(a.SNS_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(a.SNS_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden")):f(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(e.declarative.remove(a.SNS_DECLARATIVE_ACTION),e.declarative.create(a.SNS_DECLARATIVE_ACTION,d.getOnmlDeclarativeAction()),
f(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_ONML),f(a.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_ONML),f(a.SNS_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(a.SNS_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"))}}});n.when("A","a-dropdown","sns-vmf-utils","sns-onmlv2-utils","sns-metrics-constants",
"ready").execute("sns-onmlv2-frequency-update",function(e,a,b,d,c){function h(a){q.ue&&q.ue.count(a,(ue.count(a)||0)+1)}var f=e.$;e.on("a:dropdown:rcxOrdFreqSns:select",function(a){d.getDeliveryOption();d.getBuyboxMessageParam();a=f("[name\x3drcxOrdFreqSns]").prop("selectedIndex");b.updateFrequencyIndex(a);var g=d.getSnsFrequencyParam();b.selectFrequency(g[a],"sns");0<f("[name\x3drcxOrdFreqSns]").val().search("W")?h(c.SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS):h(c.SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS)});
e.on("a:dropdown:rcxOrdFreqOnml:select",function(a){d.getDeliveryOption();d.getBuyboxMessageParam();a=f("[name\x3drcxOrdFreqOnml]").prop("selectedIndex");b.updateFrequencyIndex(a);var g=d.getOnmlFrequencyParam();b.selectFrequency(g[a],"onml");0<f("[name\x3drcxOrdFreqOnml]").val().search("W")?h(c.SNS_ONML_WEEKLY_FREQUENCY_SELECT_METRICS):h(c.SNS_ONML_MONTHLY_FREQUENCY_SELECT_METRICS)})});n.when("A","sns-buybox-constants").execute("sns-onmlv2-quantity-update",function(e,a){var b=e.$;e.on(a.SNS_ONMLV2_QUANTITY_TRIGGER_DROPDOWN,
function(d){d=d.value;b(a.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(d);b(a.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(d)});b(a.SNS_ONMLV2_QUANTITY_TRIGGER_RADIO_BUTTON).change(function(d){d=d.target.value;b(a.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(d);b(a.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(d)})});n.when("A","sns-constants","sns-buybox-constants","sns-onmlv2-utils").execute("sns-accordion-content-update",function(e,a,b,d){var c=e.$,h=function(){c(b.SNS_DELIVERY_OPTION_DIV).is(":checked")?c(b.SNS_CBB_PRIME_SHIPPING).addClass("aok-hidden"):
c(b.ONML_DELIVERY_OPTION_DIV).is(":checked")&&c(b.SNS_CBB_PRIME_SHIPPING).removeClass("aok-hidden")};e.declarative("sns-delivery-change-btn","click",function(a){h()});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){h()})});n.when("sns-marketplace-util").register("sns-join-prime-endpoint",function(e){switch(e.marketplace){case "IN":e="/amazonprime/";break;case "ES":case "IT":case "FR":case "AU":case "GB":case "DE":e="/gp/mom/pipeline/view-signup/";break;default:e="/gp/family/pipeline/"}return{endpoint:e}});
n.register("sns-priceblock-constants",function(){return{PRICEBLOCK_SNSPRICE_ROW:"#priceblock_snsprice_row",SNS_UPSELL:"#priceblock_snsupsell_row",SNS_SAVINGS:"#snsprice_savings",DP_OUR_PRICE:"#priceblock_ourprice",DP_OUR_PRICE_LABEL:"#priceblock_ourprice_lbl",DP_OUR_PRICE_SAVINGS:"#regularprice_savings",DP_OUR_PRICE_BADGING:"#ourprice_fbabadge",DP_OUR_PRICE_SHIPPING:"#ourprice_shippingmessage",DP_OUR_PRICE_PPU:"#priceblock_ourprice_row #priceblock_ourprice+.a-size-small",DP_STRIKE_PRICE:"#price .a-text-strike",
DP_SALE_PRICE:"#priceblock_saleprice",DP_SALE_PRICE_LABEL:"#priceblock_saleprice_lbl",DP_SALE_PRICE_SHIPPING:"#saleprice_shippingmessage",DP_SALE_PRICE_PPU:"#priceblock_saleprice_row #priceblock_saleprice+.a-size-small",DP_DEAL_PRICE:"#priceblock_dealprice",DP_DEAL_PRICE_SAVINGS:"#dealprice_savings",DP_DEAL_PRICE_SHIPPING:"#dealprice_shippingmessage",DP_DEAL_PRICE_PPU:"#priceblock_dealprice_row #priceblock_dealprice+.a-size-small",SNS_PITCH_PRICE_UPSELL_TEXT:"#onmlPriceBlockUpsellText",SNS_ATF_REDESIGN_UPSELL_UNCHECKED:"#onml-atf-redesign-upsell-unchecked",
SNS_ATF_REDESIGN_UPSELL_CHECKED:"#onml-atf-redesign-upsell-checked",ONML_ATF_REDESIGN_UPSELL:"#onml-atf-redesign-upsell",SNS_PITCH_PRICE_FEATURE:"#snsPitchPrice_feature_div",NEW_PITCH_PRICE_FEATURE:"#newPitchPriceWrapper_feature_div",MOBILE_OUR_PRICE_SHIPPING:"#ourPrice_availability",SHIPPING_DETAILS:'[data-a-sheet*\x3d"shippingDetailsDisplayContent"]',SNS_TIERED_PRICE:"#unifiedPrice_feature_div #priceblock_snsprice_Tiered, #snsPrice #priceblock_snsprice_Tiered",SNS_BASED_PRICE:"#unifiedPrice_feature_div #priceblock_snsprice_Based, #snsPrice #priceblock_snsprice_Based",
SNS_TIERED_SAVINGS:"#unifiedPrice_feature_div #snsSavings_Tiered, #snsPrice #snsSavings_Tiered",SNS_BASED_SAVINGS:"#unifiedPrice_feature_div #snsSavings_NonTiered, #snsPrice #snsSavings_NonTiered",SNS_SAVINGS_LABEL:"#unifiedPrice_feature_div #snsSavings_lbl",SNS_SAVINGS_ROW:"#unifiedPrice_feature_div #priceblock_snsSavings_row, #snsPrice #priceblock_snsSavings_row",ONE_NOW_SHIPPING_MESSAGE:"#priceblock_oneNowShippingMessage, #priceblock_oneNowShippingMessage_dpv2",SNS_STRIKETHROUGH_PRICE:"#snsStrikeThroughPrice"}});
n.when("A","sns-utils","sns-constants","sns-price-utils","sns-buybox-constants","sns-priceblock-constants").register("sns-price-refresh",function(e,a,b,d,c,h){return{init:function(){e.declarative("sns-opt-in-checked","change",function(){d.showSnSPriceIfSnSOptInChecked()});a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,d.showSnSPriceIfSnSOptInChecked);d.showSnSPriceIfSnSOptInChecked();e.$(c.SNS_BUY_NEW_BUTTON).click(function(){var d=c.SNS_OPT_IN_CHECKBOX,f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN),
m=h.SNS_UPSELL,k=h.SNS_PITCH_PRICE_UPSELL_TEXT,p=h.ONML_ATF_REDESIGN_UPSELL;e.$(d).is(":checked")!==f&&(e.$(d).click(),a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,f));e.$(p).removeClass("aok-hidden");!1===e.$(d).is(":checked")&&(e.$(m).removeClass("aok-hidden"),e.$(k).removeClass("aok-hidden"))});e.$(c.SNS_BUY_USED_BUTTON).click(function(){f()});e.$(c.MOBB_ALTERNATE_OFFERS).click(function(){f()});var f=function(){var d=c.SNS_OPT_IN_CHECKBOX,f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN),m=h.SNS_UPSELL,
k=h.SNS_PITCH_PRICE_UPSELL_TEXT,p=h.ONML_ATF_REDESIGN_UPSELL;!0===f&&(e.$(d).click(),a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,!0));e.$(p).addClass("aok-hidden");e.$(m).addClass("aok-hidden");e.$(k).addClass("aok-hidden")}}}});n.when("A","sns-utils","sns-priceblock-constants","sns-buybox-constants").register("sns-price-utils",function(e,a,b,d){var c=e.$,h=b.SNS_PITCH_PRICE_UPSELL_TEXT,f=b.SNS_PITCH_PRICE_FEATURE,l=b.NEW_PITCH_PRICE_FEATURE,g=b.PRICEBLOCK_SNSPRICE_ROW,m=d.SNS_OPT_IN_CHECKBOX,
k=b.SNS_UPSELL,p=b.SNS_SAVINGS,t=b.DP_OUR_PRICE,q=b.DP_OUR_PRICE_LABEL,n=b.DP_OUR_PRICE_SAVINGS,y=b.DP_OUR_PRICE_BADGING,z=b.DP_OUR_PRICE_SHIPPING,A=b.DP_SALE_PRICE,B=b.DP_SALE_PRICE_LABEL,C=b.DP_SALE_PRICE_SHIPPING,r=b.DP_DEAL_PRICE,u=b.DP_DEAL_PRICE_SAVINGS,v=b.DP_DEAL_PRICE_SHIPPING,D=b.MOBILE_OUR_PRICE_SHIPPING,E=b.SHIPPING_DETAILS,F=d.SNS_BUY_NEW_PRICE,G=d.NON_CBB_BUY_NEW_PRICE,H=d.CBB_BUY_NEW_PRICE,I=d.SNS_PRICE_IN_BUY_USED_SECTION,J=d.CBB_SNS_BUY_NEW_PRICE,K=d.DPV2_BUY_NEW_PRICE,L=b.SNS_ATF_REDESIGN_UPSELL_CHECKED,
M=b.SNS_ATF_REDESIGN_UPSELL_UNCHECKED;return{showSnSPriceIfSnSOptInChecked:function(){a.isSnSEligible()&&(c(m).is(":checked")?a.shouldShowPrice()&&(c(g).length?(c(g).removeClass("aok-hidden"),c(p).removeClass("a-hidden"),c(k).addClass("aok-hidden"),c(n).addClass("a-hidden"),c(y).addClass("a-hidden"),c(z).addClass("a-hidden"),c(D).addClass("a-hidden"),c(t).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),c(q).addClass("onml-price-inactive"),
c(A).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price "),c(B).addClass("onml-price-inactive"),c(C).addClass("a-hidden"),c(r).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),c(u).addClass("a-hidden"),c(v).addClass("a-hidden"),c(g).css({display:"table-row",visibility:"visible"}),c(g).prev().has(E).addClass("aok-hidden"),c(G).addClass("aok-hidden"),c(F).removeClass("aok-hidden"),
c(H).addClass("aok-hidden"),c(I).addClass("aok-hidden"),c(J).removeClass("aok-hidden"),c(K).addClass("aok-hidden")):(c(h).addClass("aok-hidden"),c(l).addClass("aok-hidden"),c(f).removeClass("aok-hidden"),c(f).css({display:"block",visibility:"visible"}),c(L).removeClass("aok-hidden"),c(M).addClass("aok-hidden"))):c(g).length?(c(g).addClass("aok-hidden"),c(p).addClass("a-hidden"),c(k).removeClass("aok-hidden"),c(n).removeClass("a-hidden"),c(y).removeClass("a-hidden"),c(z).removeClass("a-hidden"),c(D).removeClass("a-hidden"),
c(t).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(q).removeClass("onml-price-inactive"),c(A).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(B).removeClass("onml-price-inactive"),c(C).removeClass("a-hidden"),c(r).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(u).removeClass("a-hidden"),
c(v).removeClass("a-hidden"),c(g).prev().has(E).removeClass("aok-hidden"),c(G).removeClass("aok-hidden"),c(F).addClass("aok-hidden"),c(H).removeClass("aok-hidden"),c(I).addClass("aok-hidden"),c(J).addClass("aok-hidden"),c(K).removeClass("aok-hidden")):(c(h).removeClass("aok-hidden"),c(l).removeClass("aok-hidden"),c(f).addClass("aok-hidden"),c(h).css({display:"block",visibility:"visible"}),c(M).removeClass("aok-hidden"),c(L).addClass("aok-hidden")))}}});n.when("A","sns-constants","sns-buybox-constants",
"sns-states-loaded-in-dom").register("sns-utils",function(e,a,b){var d=e.$,c={},h={},f=function(a,b,c){var f,e=function(a){if(!a||"object"===typeof a)return a;var c=d.parseJSON;q.JSON&&q.JSON.parse&&(c=JSON.parse);try{return"string"===typeof a?c(a):null}catch(f){return q.ueLogError&&q.ueLogError(f,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),null}};a=d(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+
b+"']"))&&1<=a.length?(f=e(a.first().text()),e("object"===typeof f?f[c]:null)):f},l=function(a){var c=f(b.SNS_OPT_IN_FEATURE_DIV,"sns-onml-params","onmlParams");return a?c&&c[a]:c},g=function(){var c=l("deviceType"),b=h[a.USER_PREFS_KEYS.ONML_PARAMS],b=b&&b.deviceType;return c||b};return{isSnSEligible:function(){return l("snsEligible")},getAStateFromDom:f,getOnmlParam:l,shouldShowPrice:function(){return l("showPrice")},getDeviceType:g,registerCallbackForNameSpace:function(a,b){c[a]||(c[a]=[]);-1===
c[a].indexOf(b)&&c[a].push(b)},executeCallbacksForNameSpace:function(a){if((a=c[a])&&a.constructor===Array)for(var b=0;b<a.length;b++)a[b]()},setOnmlUserPref:function(a,b){h[a]=b},getOnmlUserPref:function(a){return h[a]},deleteOnmlUserPref:function(a){delete h[a]},isMobileDevice:function(){var a=g();return"mobile"===a||"mobileApp"===a},isMobileApp:function(){return"mobileApp"===g()},isTabletApp:function(){var a=g();return"iPad"===a||"tabletApp"===a||"tabletLargeApp"===a},isVerucaBuyNowEnabled:function(){return l("verucaBuyNowEnabled")},
isVerucaOneClickEnabled:function(){return l("verucaOneClickEnabled")},enableSnSOptIn:function(){d(b.SNS_OPT_IN_CHECKBOX).removeAttr("disabled")},isSnsCustomer:function(){return l("snsCustomer")}}});n.when("A","sns-buybox-constants","sns-constants").register("sns-onmlv2-utils",function(e,a,b){function d(a,b){return![0,1,3,4,5].includes(b)}var c=e.$,h,f=function(a,b,d){var f,e=function(a){if(!a||"object"===typeof a)return a;var f=c.parseJSON;q.JSON&&q.JSON.parse&&(f=JSON.parse);try{return"string"===
typeof a?f(a):null}catch(d){return q.ueLogError&&q.ueLogError(d,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),null}};a=c(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length?(f=e(a.first().text()),e("object"===typeof f?f[d]:null)):f},l=function(a,b,f){var d;a=c(a||"html");if(1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length){if((a=a.first().text())&&"object"!==
typeof a){var e=c.parseJSON;q.JSON&&q.JSON.parse&&(e=JSON.parse);try{d="string"===typeof a?e(a):null}catch(g){q.ueLogError&&q.ueLogError(g,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),d=null}}else d=a;return f="object"===typeof d?d[f]:null}return d},g=function(){return f(r,a.SNS_BUY_BOX_PARAMS,a.SNS_BUY_BOX_PARAM_MAP)},m=function(a){var b=g();return b?b.deviceType===a:!1},k=function(){return m("mobile")||m("mobileApp")},
p=function(){return m("web")},t=function(){return document.querySelector(a.SNS_ACCORDION_HEADER_RADIO_BUTTON)},n=function(a,c){return a&&c?a.tieredStatusOnRecurringDeliveryDates[c-1]===b.TIERED:!1},x=function(a,b){return a&&b?a.firstRecurringDeliveryDates[b-1]:""};return{getAStateFromDom:f,getDeliveryOption:function(){return c(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getSwitchDeliveryOption:function(){if(!h){var a=g();a&&(h=a.deliveryOption)}return h},getBuyboxMessageParam:g,isMobileDevice:k,
isMobileWeb:function(){return m("mobile")},isMobileApp:function(){return m("mobileApp")},isTabletApp:function(){return m("iPad")||m("tabletApp")||m("tabletLargeApp")},isWeb:p,getSnsFrequencyParam:function(){return f(r,"sns-frequency-params","snsFrequencyParamsMap")},getOnmlFrequencyParam:function(){return f(r,"sns-frequency-params","onmlFrequencyParamsMap")},getDeliveryInfoParam:function(){var a=Math.max(c("[name\x3drcxOrdFreqSns]").children("option").length,c("[name\x3drcxOrdFreqOnml]").children("option").length),
b=f(r,"sns-frequency-params","deliveryInfoParamsMap");6===a&&b.snsDates&&6<b.snsDates.length&&(a=b,a.snsDates=a.snsDates.filter(d),a.onmlDates=a.onmlDates.filter(d),b=a);return b},getDiscountOptionsParam:function(){return f(r,"sns-frequency-params","discountOptionsParamsMap")},getDiscountTypeParam:function(){return l(r,"sns-frequency-params","deliveryTypeParamsMap")},getOnmlDateParam:function(){return l(r,"sns-frequency-params","onmlDateParamsMap")},createHiddenInput:function(a,b){return'\x3cinput type\x3d"hidden" name\x3d"'+
a+'" value\x3d"'+b+'"\x3e'},getBuyNowAction:function(){return k()?c(a.MOBILE_ADD_TO_CART_DIV).attr("action"):p()?c(a.ADD_TO_CART_DIV).attr("action"):c(a.TABLET_ADD_TO_CART_DIV).attr("action")},getBuyNowActionFromCbbTemplate:function(){if(p())return c(a.NEW_ACCORDION_ROW_SUBMISSION_FORM).attr("action");if(k())return c(a.SNS_ACCORDION_ROW_SUBMISSION_FORM).attr("action")},getOnmlv2FormValueByName:function(b){return c(a.SNS_ONMLV2_FORM_FIELDS+" [name\x3d'"+b+"']").val()},getSubscribeButtonFormValueByName:function(b){return c(a.SUBSCRIBE_BUTTON_FORM_FIELDS+
" [name\x3d'"+b+"']").val()},isCbbTemplateEnabled:function(){return c(a.SNS_CBB_ACCORDION_ROW).length},removeFormFieldsIntroducedByCbb:function(){c(a.SNS_ONMLV2_FORM_FIELDS+" #ASIN").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #offerListingID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #snsOfferListingID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #snsMerchantID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #rcxOrdFreq").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #quantity").remove()},getCbbSnsAccordionRowRadioButton:t,isCbbSnsAccordionRowExpanded:function(){return"true"===
t().getAttribute("aria-checked")},isTiered:n,getOnmlFirstRecurringDeliveryDate:x,getOnmlDeclarativeAction:function(){return c("#onmlDeclarativeAction").val()},generateUrlParams:function(b){if(!b){var d=a.SNS_SELECT_DELIVERY_URL;return d}var f=(k()?c(a.SNS_FREQUENCY_FORM_FIELD_MOBILE):c(a.SNS_FREQUENCY_FORM_FIELD)).val(),e=[];e.subscribeOnlyDate=b.justSubscribeDeliveryDate;e.subscribeOnlyDateShort=b.justSubscribeShortDeliveryDate;e.subscribeOnlyDiscount=b.justSubscribeTieredStatus?b.tieredDiscountPercent:
b.baseDiscountPercent;e.onmlDate=b.oneTimeDeliveryDate;e.onmlDateShort=b.oneTimeShortDeliveryDate;e.onmlDiscount=b.baseDiscountPercent;e.onmlNextDate=x(b,f);e.onmlNextDiscount=n(b,f)?b.tieredDiscountPercent:b.baseDiscountPercent;e.snsDeliveryOption=c(a.SNS_SELECT_DELIVERY_OPTION_ID).val();e.isMobile=k();e.snscsrf=b.deliveryModalCSRFToken;d=a.SNS_SELECT_DELIVERY_URL;Object.keys(e).forEach(function(a){d+="\x26"+a+"\x3d"+encodeURI(e[a])});return d},createUrlParameter:function(a,b){b=encodeURIComponent(b);
return a+"\x3d"+b+"\x26"}}});n.when("A","a-dropdown","sns-onmlv2-utils","sns-buybox-constants").register("sns-vmf-utils",function(e,a,b,d){var c=e.$;return{updateFrequencyIndex:function(b){var d=c("[name\x3drcxOrdFreqSns]")[0].options[b].value;b=c("[name\x3drcxOrdFreqOnml]")[0].options[b].value;a.getSelect(c("[name\x3drcxOrdFreqSns]")).setValue(d);a.getSelect(c("[name\x3drcxOrdFreqOnml]")).setValue(b)},selectFrequency:function(a,f){c(".sns-delivery-buybox-upsell-message").html(a.upsellInformation.message);
c(".sns-delivery-buybox-upsell-additional-message-title").html(a.upsellInformation.additionalMessageTitle);c(".sns-delivery-buybox-upsell-additional-message").html(a.upsellInformation.additionalMessage);if("sns"===f){c(".onml-delivery-link").addClass("aok-hidden");if(-1<a.value.indexOf("W|")){c(".sns-delivery-link").addClass("aok-hidden");c(".sns-delivery-link-weekly").removeClass("aok-hidden");var e=c(".sns-delivery-link-weekly").html()}else c(".sns-delivery-link").removeClass("aok-hidden"),c(".sns-delivery-link-weekly").addClass("aok-hidden"),
e=c(".sns-delivery-link").html();c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).html(e);c(d.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden");c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden")}else c(".sns-delivery-link").addClass("aok-hidden"),c(".sns-delivery-link-weekly").addClass("aok-hidden"),c(".onml-delivery-link").removeClass("aok-hidden"),c(d.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden");
a=a.highlightedDiscount;e=b.getDiscountTypeParam();0===a?(c("#sns-base-price").removeClass("aok-hidden"),c("#sns-tiered-price").addClass("aok-hidden"),c(".discountPillLeft").addClass("pillLightUp"),c(".discountPillRight").removeClass("pillLightUp"),e===d.DISCOUNT_TYPE_ZERO_BASE?c("#snsDiscountPill").addClass("aok-hidden"):c("#snsDiscountPill").removeClass("aok-hidden")):(c("#sns-base-price").addClass("aok-hidden"),c("#sns-tiered-price").removeClass("aok-hidden"),c(".discountPillLeft").removeClass("pillLightUp"),
c(".discountPillRight").addClass("pillLightUp"),e===d.DISCOUNT_TYPE_ZERO_BASE&&"onml"===f?c("#snsDiscountPill").addClass("aok-hidden"):c("#snsDiscountPill").removeClass("aok-hidden"))}}});n.when("ready").register("sns-stringify-util",function(){return JSON&&"function"===typeof JSON.stringify?JSON.stringify:function(){var e={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},a=/[\\"\u0000-\u001F\u2028\u2029]/g,b=Object.prototype.toString,d=Array.isArray||function(a){return"[object Array]"===
b.call(a)},c=function(a){return e[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)};return function f(e){if(null===e)return"null";if("number"===typeof e)return isFinite(e)?e.toString():"null";if("boolean"===typeof e)return e.toString();if("object"===typeof e){if("function"===typeof e.toJSON)return f(e.toJSON());if(d(e)){for(var g="[",m=0;m<e.length;m++)g+=(m?", ":"")+f(e[m]);return g+"]"}if("[object Object]"===b.call(e)){g=[];for(m in e)e.hasOwnProperty(m)&&g.push(f(m)+": "+f(e[m]));return"{"+
g.join(", ")+"}"}}return'"'+e.toString().replace(a,c)+'"'}}()});n.when("A","sns-stringify-util","ready").register("sns-declarative-util",function(e,a){function b(a){return a&&("object"===typeof a||"object"===typeof a.prototype)}function d(){for(var a=0;a<arguments.length;a++)if("string"!==typeof arguments[a])throw"Function parameter must be of type string.";}function c(){for(var a=Object.prototype.toString,b=Array.isArray||function(b){return"[object Array]"===a.call(b)},c=0;c<arguments.length;c++){var e=
arguments[c];if(b(e)&&0<e.length)for(var h=0;h<e.length;h++)d(e[h]);else throw"Function parameter must be a non empty array.";}}function h(c){var d="data-"+c.getAttribute("data-action"),g=function(){var b=c.getAttribute(d),g=b?e.parseJSON(b):{};g.save=function(){var b=g.save;delete g.save;var e=a(g);c.setAttribute(d,e);g.save=b};return g};return{hasExactKeyHeirarchy:function(a,c){var d=g();a=a.split(".");for(var e=0<a.length,f=0;f<a.length&&e;f++)var h=a[f],e=b(d)&&d.hasOwnProperty(h),d=d[h];e&&c!==
r&&(e=d===c);return e},hasParsableJSON:function(){try{return g().save(),!0}catch(a){return!1}},put:function(a){var c=g();b(c.inputs)||(c.inputs={});e.$.each(a,function(a,b){c.inputs[a]=b});c.save()},getData:g}}return{query:function(a){c(a);var l=[],g=[],m=[],k,p,q=function(){return{numberOfMatchingActions:l.length,allMatchKeyValue:function(a,b){d(a);for(var c=0<this.numberOfMatchingActions,e=0;e<this.numberOfMatchingActions&&c;e++)c=(c=l[e])&&c.hasExactKeyHeirarchy(a,b);return c},putAll:function(a){for(var b=
0;b<this.numberOfMatchingActions;b++)l[b].put(a)},getStrings:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=l[a];if(b.getData().strings)return b.getData().strings}return[]},getData:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=l[a];if(b.getData())return b.getData()}return[]}}},n=function(){for(var c=e.$("#buybox").find(".a-declarative").get(),d=0<g.length,k=0;k<c.length;k++){var p=c[k],n;a:{n=p;for(var r=a,w=0;w<r.length;w++){var u;var v=n;u=r[w];b(v)&&"string"===
typeof u?(v=v.getAttribute("data-action")||"",u=0===u.localeCompare(v)):u=!1;if(u){n=!0;break a}}n=!1}if(n&&(p=h(p),p.hasParsableJSON()))if(d){n=!0;for(r=0;r<g.length&&n;r++)n=p.hasExactKeyHeirarchy(g[r],m[r]);n&&l.push(p)}else l.push(p)}return q()};k=function(a){d(a);g.push(a);return{equals:p,equalsAny:function(){return p(r)}}};p=function(a){m.push(a);return{where:k,execute:n}};return{where:k,execute:n}}}});n.when("A","sns-utils","sns-buybox-constants","sns-declarative-util").register("sns-atc-utils",
function(e,a,b,d){var c=e.$,h=["aw-mash","add-to-cart","one-click","show-services-interstitial"],f=function(a){d.query(h).where("buttonID").equals("add-to-cart").execute().putAll(a);d.query(h).where("buttonID").equals("buy-now").execute().putAll(a);d.query(h).where("buttonID").equals("buy-now-one-click").execute().putAll(a)};return{initializeOnmlDeclaratives:function(){if(a.isSnSEligible()){var d=a.getAStateFromDom(b.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams");f(d||{});c("\x3cinput type\x3dhidden value\x3dtrue \x3e").prop("id",
b.SNS_ONML_INIT_INPUT_ID).appendTo(b.SNS_OPT_IN_FEATURE_DIV)}},setOnmlDeclaratives:f,getAddToCartStrings:function(){return d.query(h).where("buttonID").equals("add-to-cart").execute().getStrings()},getAddToCartData:function(){return d.query(h).where("buttonID").equals("add-to-cart").execute().getData()}}});n.when("A","sns-utils","sns-constants","sns-atc-utils").register("sns-atc",function(e,a,b,d){return{init:function(){a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,d.initializeOnmlDeclaratives);
d.initializeOnmlDeclaratives()}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-onmlv2-atc",function(e,a,b,d){function c(c){if(!d.isSnsLocked()){var e=h("\x3cform\x3e",{method:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.method,action:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.action,id:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.id,name:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.name}),g="";if(b.isCbbTemplateEnabled())for(var m=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},
{name:"snsAddressId"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],k=0;k<m.length;k++)var p=m[k].name,n=m[k].fieldName?m[k].fieldName:p,n=b.getOnmlv2FormValueByName(n),g=g+b.createHiddenInput(p,n);else{b.removeFormFieldsIntroducedByCbb();m=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(k=0;k<m.length;k++)p=m[k].name,n=m[k].fieldName?
m[k].fieldName:p,n=b.isMobileDevice()?h(a.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():b.isWeb()?h(a.ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():h(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val(),g+=b.createHiddenInput(p,n);m=b.isMobileDevice()?h(a.SNS_MOBILE_QUANTITY):h(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);g+=b.createHiddenInput("quantity",m.val())}g+=b.createHiddenInput("ref",c);g+=b.createHiddenInput("submit.add-to-cart","1");e.html(g);h("body").append(e);h(a.SNS_ADD_TO_CART_FORM).submit();
h(a.SNS_ADD_TO_CART_FORM).remove()}}var h=e.$;e.declarative("sns-add-to-cart","click",function(a){c("onmlv2_atc")});return{createAndSubmitAddToCartForm:c}});n.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-atc-utils").register("sns-buybox-utils",function(e,a,b,d){var c=function(a){if(0<a.length)return a.innerWidth()<a[0].scrollWidth},h=function(c,d,g){d=c+"_"+(g?"checkedLabel":"uncheckedLabel")+"_"+("oneClick"===c?d:"all");c=a.getOnmlParam(d);d=(g=a.getOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS))&&
g[d];if(c=c||d)return e.$("\x3cp\x3e"+c+"\x3c/p\x3e").text()};return{updateOneClickButtonLabel:function(b){if(a.isVerucaOneClickEnabled()){b="boolean"===typeof b?b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.ONE_CLICK_BUTTON),g=e.$(d.ONE_CLICK_BUTTON_ICON),m=e.$(d.ONE_CLICK_BUTTON_TEXT),k=a.getDeviceType(),p=h("oneClick",k,!0),k=h("oneClick",k,!1);p&&k&&(b?(m.text(p),c(m)&&(g.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(m.text(k),g.length&&(l.addClass("a-button-icon"),g.removeClass("aok-hidden"))))}},
updateBuyNowButtonLabel:function(b){if(a.isVerucaBuyNowEnabled()){b="boolean"===typeof b?b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.BUY_NOW_BUTTON),g=e.$(d.BUY_NOW_BUTTON_ICON),m=e.$(d.BUY_NOW_BUTTON_TEXT),k=a.getDeviceType(),p=h("buyNow",k,!0),k=h("buyNow",k,!1);p&&k&&(b?(m.text(p),c(m)&&(g.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(m.text(k),g.length&&(l.addClass("a-button-icon"),g.removeClass("aok-hidden"))))}},updateAddToCartButtonLabel:function(b){b="boolean"===typeof b?
b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.ADD_TO_CART_BUTTON).closest(".a-button"),g=l.find(".a-button-inner"),m=l.find("i.a-icon"),k=l.find("span.a-button-text"),p=a.getDeviceType(),n=h("addToCart",p,!0),p=h("addToCart",p,!1);n&&p&&(b?(k.text(n),g.addClass("sns-onml-sky-button-inner"),k.addClass("sns-onml-sky-button-text"),c(k)&&(m.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(k.text(p),g.removeClass("sns-onml-sky-button-inner"),k.removeClass("sns-onml-sky-button-text"),
m.length&&(l.addClass("a-button-icon"),m.removeClass("aok-hidden"))))},showSnSMerchantInfoIfSnSOptInChecked:function(a){var b=e.$(d.SNS_ONML_MERCHANT_INFO);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showGoldBoxDiscountMessageIfSnSOptInChecked:function(a){var b=e.$(d.GOLDBOX_DISCOUNT_MESSAGE);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showSubscribeOnlyButtonIfSnSOptInChecked:function(a){var b=
e.$(d.JUST_SUBSCRIBE_DIV);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils","ready").execute("sns-onmlv2-join-prime",function(e,a,b){var d=e.$,c=function(){d(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).length&&(d(a.SNS_ONMLV2_JOIN_PRIME_UPSELL).removeClass("aok-hidden"),d(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).is(":checked")?(d(a.SNS_ONMLV2_JOIN_PRIME_BUTTON).removeClass("aok-hidden"),d(a.SNS_SUBSCRIBE_SUBMIT_BUTTON).addClass("aok-hidden")):
(d(a.SNS_ONMLV2_JOIN_PRIME_BUTTON).addClass("aok-hidden"),d(a.SNS_SUBSCRIBE_SUBMIT_BUTTON).removeClass("aok-hidden")))};c();d(document).delegate(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX,"change",function(a){c()});e.declarative("sns-join-prime","click",function(c){c=e.state("momJoinPrimeEndpointState");c=d("\x3cform\x3e",{method:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.method,action:c&&c.endpoint?c.endpoint:"/gp/prime/pipeline/membersignup/",id:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.id,name:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.name});
for(var f="",l=[{name:"session-id"},{name:"momAsin"},{name:"ref"}],g=0;g<l.length;g++)var m=l[g].name,k=b.getSubscribeButtonFormValueByName(m),f=f+b.createHiddenInput(m,k);c.html(f);d("body").append(c);d(a.SNS_JOIN_PRIME_FORM).submit();d(a.SNS_JOIN_PRIME_FORM).remove()})});n.when("A","sns-buybox-constants","sns-onmlv2-utils").execute("sns-legacy-subscribe",function(e,a,b){var d=e.$;e.declarative("sns-legacy-subscribe","click",function(c){c=d("\x3cform\x3e",{method:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.method,
action:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.name});for(var e="",f=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"snsOfferListingID"},{name:"snsMerchantID"},{name:"rcxOrdFreq"},{name:"quantity"}],l=0;l<f.length;l++)var g=f[l].name,m=b.getSubscribeButtonFormValueByName(g),e=e+b.createHiddenInput(g,m);e+=b.createHiddenInput("ref","sns-legacy-subscribe");e+=b.createHiddenInput("submit.rcx-subscribe",
"1");c.html(e);d("body").append(c);d(a.SNS_LEGACY_SUBSCRIBE_FORM).submit();d(a.SNS_LEGACY_SUBSCRIBE_FORM).remove()})});n.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-subscribe-button",function(e,a,b,d){function c(c){if(!d.isSnsLocked()){var l,g;h("#chkMom").length&&h("#chkMom").is(":checked")?(l=h("\x3cform\x3e",{method:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.method,action:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.action,id:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id,name:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.name}),
g=a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id):(l=h("\x3cform\x3e",{method:a.SUBSCRIBE_FORM_ATTRIBUTES.method,action:a.SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.SUBSCRIBE_FORM_ATTRIBUTES.name}),g=a.SUBSCRIBE_FORM_ATTRIBUTES.id);for(var m="",k=[{name:"snsAsin"},{name:"rcxOrdFreqOnml"},{name:"rcxOrdFreqSns"}],p=0;p<k.length;p++)var n=k[p].name,q=h("[name\x3d'"+(k[p].fieldName?k[p].fieldName:n)+"']").val(),m=m+b.createHiddenInput(n,q);k=e.$(a.SNS_MOBILE_QUANTITY);if(k===r||
k.val()===r)k=h("[name\x3d'rcxsubsQuan']");p=!h("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden");p||(n=b.getDeliveryInfoParam().snsDates[h("[name\x3drcxOrdFreqSns]").prop("selectedIndex")],m+=b.createHiddenInput("snsDate",n));m+=b.createHiddenInput("onmlSelected",p);m+=b.createHiddenInput("vmfEnabled","true");m+=b.createHiddenInput("quantity",k.val());m+=b.createHiddenInput("ref",c+(p?"onml":"sns"));m+=b.createHiddenInput("submit.subscribe","1");l.html(m);h("body").append(l);h("#"+g).submit();h("#"+
g).remove()}}var h=e.$;e.declarative("sns-submit-btn-declarative","click",function(a){c("sns-subscribe-btn-dp-vmf-")});e.declarative("sns-mom-submit-btn-declarative","click",function(a){c("sns-mom-btn-dp-vmf-")})});n.register("sns-constants",function(){return{TIERED:"tiered",NON_TIERED:"nonTiered",BASE:"BASE",PREMIUM:"PREMIUM",ZERO_BASE:"ZERO_BASE",EVENT_NAMESPACE:{PAGE_UPDATE:"pageUpdate",FREQUENCY_HIDDEN_INPUT_CHANGE:"frequencyHiddenInputChange"},USER_PREFS_KEYS:{SNS_OPT_IN:"snsOptIn",SNS_FREQUENCY:"rcxOrdFreq",
ONML_PARAMS:"onmlParams"},DELIVERY_OPTION:{SNS:"sns",ONML:"onml"}}});n.when("A","sns-utils","sns-constants","sns-buybox-constants").register("sns-event-handler",function(e,a,b,d){return{init:function(){function c(a){for(var b=e.$("\x3cform\x3e",{method:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.method,action:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.action,id:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.id,name:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.name}),c=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"rcxOrdFreq"},
{name:"snsOfferListingID"},{name:"snsMerchantID"}],g="",m=0;m<c.length;m++)var k=c[m].name,p=e.$("[name\x3d"+k+"]").val(),g=g+('\x3cinput type\x3d"hidden" name\x3d"'+k+'" value\x3d"'+p+'"\x3e');g=g+('\x3cinput type\x3d"hidden" name\x3d"ref" value\x3d"'+a+'"\x3e')+'\x3cinput type\x3d"hidden" name\x3d"submit.rcx-subscribe" value\x3d"1"\x3e';a=e.$(d.QUANTITY_CONTAINER).find(d.QUANTITY);g+='\x3cinput type\x3d"hidden" name\x3d"quantity" value\x3d"'+a.val()+'"\x3e';b.html(g);e.$("body").append(b);e.$(d.SUBSCRIBE_ONLY_FORM).submit()}
a.isSnSEligible()&&a.setOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS,a.getOnmlParam());a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,function(){var c=a.getOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS)||{},f=c.asin,l=a.getOnmlParam("asin");c.asin=l;a.setOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS,c);c=f!==l;f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN);"undefined"!==typeof f&&e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked")!==f&&(a.enableSnSOptIn(),e.$(d.SNS_OPT_IN_CHECKBOX).click());(f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY))&&
!c?a.isMobileDevice()?e.$(d.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+f+"]").click():e.$("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+(f-1)+"] a").click():a.deleteOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY)});e.$(d.SNS_FREQUENCY_FORM_FIELD).change(function(){a.executeCallbacksForNameSpace(b.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE)});e.on("a:pageUpdate",function(){a.executeCallbacksForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE)});e.declarative("subscribe-only","click",function(a){c("onml_so_l")});
e.declarative("just-subscribe","click",function(a){c("onml_justsub_l")})}}});n.register("sns-metrics-constants",function(){return{SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS:"snsOnmlExistingSnsCustomerCheck",SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS:"snsOnmlNewSnsCustomerCheck",SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS:"snsOnmlExistingSnsCustomerUncheck",SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS:"snsOnmlNewSnsCustomerUncheck",SNS_SIGN_IN_IF_NOT_ALREADY_SIGNED_IN_METRICS:"snsSignInIfNotAlreadySignedIn",
SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS:"snsOnmlFrequencyLabelClick",SNS_ONML_FREQUENCY_CHANGE_METRICS:"snsOnmlFrequencyChange",SNS_ONML_WEEKLY_FREQUENCY_SELECT_METRICS:"snsOnmlWeeklyFrequencySelectMetrics",SNS_ONML_MONTHLY_FREQUENCY_SELECT_METRICS:"snsOnmlMonthlyFrequencySelectMetrics",SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS:"snsLegacyWeeklyFrequencySelectMetrics",SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS:"snsLegacyMonthlyFrequencySelectMetrics",SNS_ONML_UPSELL_MESSAGE_METRICS:"snsOnmlUpsellMessage",
SNS_ONML_SUBSCRIBE_ONLY_METRICS:"snsOnmlSubscribeOnly",SNS_CUSTOMER_RECOGNIZED_BUT_NOT_SIGNED_IN:"snsOnmlCustomerRecognizedButNotSignedIn",SNS_REQUIRE_SIGN_IN_STATUS_FAILED:"snsOnmlRequireSignInStatusFailed",SNS_ONMLV2_POPOVER_TRIGGERS:"justSubscribeLearnMorePopoverNonTiered justSubscribeLearnMorePopoverTiered onmlv2LearnMorePopoverNonTiered onmlv2LearnMorePopoverTiered onmlv2LearnMorePopoverNewOrUnrecognized justSubscribePillPopoverNonTiered justSubscribePillPopoverTiered onmlv2PillPopoverNonTiered onmlv2PillPopoverTiered onmlv2PillPopoverNewOrUnrecognized".split(" "),
SNS_ONMLV2_BOTTOMSHEET_TRIGGERS:"justSubscribeLearnMoreBottomsheetNonTiered justSubscribeLearnMoreBottomsheetTiered onmlv2LearnMoreBottomsheetNonTiered onmlv2LearnMoreBottomsheetTiered onmlv2LearnMoreBottomsheetNewOrUnrecognized justSubscribePillBottomsheetNonTiered justSubscribePillBottomsheetTiered onmlv2PillBottomsheetNonTiered onmlv2PillBottomsheetTiered onmlv2PillBottomsheetNewOrUnrecognized".split(" "),SNS_ONMLV2_DESKTOP_POPOVER_SHOW_METRICS:"snsOnmlv2DesktopPopoverShow",SNS_ONMLV2_MOBILE_BOTTOMSHEET_SHOW_METRICS:"snsOnmlv2MobileBottomsheetShow",
SNS_ONMLV2_DELIVERY_OPTION_CLICK_METRICS:"snsOnmlv2DeliveryOptionClick",SNS_ONMLV2_DELIVERY_OPTION_CLICK_MOBILE_METRICS:"snsOnmlv2DeliveryOptionClickMobile",SNS_ONMLV2_SWITCH_TO_SNS_METRICS:"snsOnmlv2SwitchToSns",SNS_ONMLV2_SWITCH_TO_ONML_METRICS:"snsOnmlv2SwitchToOnml",SNS_ONMLV2_SWITCH_TO_SNS_MOBILE_METRICS:"snsOnmlv2SwitchToSnsMobile",SNS_ONMLV2_SWITCH_TO_ONML_MOBILE_METRICS:"snsOnmlv2SwitchToOnmlMobile",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_METRICS:"snsOnmlv2SubscribeNowWithOnmlDelivery",
SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_METRICS:"snsOnmlv2SubscribeNowWithSnsDelivery",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_MOBILE_METRICS:"snsOnmlv2SubscribeNowWithOnmlDeliveryMobile",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_MOBILE_METRICS:"snsOnmlv2SubscribeNowWithSnsDeliveryMobile",SNS_QUANTITY_SELECT_DESKTOP:"snsQuantitySelectDesktop",SNS_QUANTITY_SELECT_MOBILE:"snsQuantitySelectMobile",SNS_SWITCH_WIDGET_SEE_PRODUCTS_ONMLV2_METRICS:"snsSwitchWidgetSeeProductsOnmlv2",SNS_SWITCH_WIDGET_SEE_PRODUCTS_LEGACY_METRICS:"snsSwitchWidgetSeeProductsLegacy",
SNS_SWITCH_WIDGET_CONTINUE_LEGACY_METRICS:"snsSwitchWidgetContinueLegacy",SNS_SWITCH_WIDGET_CONTINUE_WITH_ONE_NOW_METRICS:"snsSwitchWidgetContinueWithOneNow",SNS_SWITCH_WIDGET_CONTINUE_WITH_SNS_METRICS:"snsSwitchWidgetContinueWithSns",SNS_SWITCH_WIDGET_BOTTOMSHEET_TOTAL_COUNT_METRICS:"snsSwitchWidgetBottomsheetTotalCount"}});n.when("A","sns-utils","sns-metrics-constants","sns-buybox-constants").register("sns-metrics-helper",function(e,a,b,d){return{init:function(){e.declarative("sns-opt-in-checked",
"change",function(){var c=e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");q.ue&&(c?a.isSnsCustomer()?q.ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS,(ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS)||0)+1):q.ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS,(ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS)||0)+1):a.isSnsCustomer()?q.ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS,(ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1):q.ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS,
(ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1))});e.$(document).delegate(".sns-buybox-upsell-trigger","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_UPSELL_MESSAGE_METRICS,(ue.count(b.SNS_ONML_UPSELL_MESSAGE_METRICS)||0)+1)});e.$(document).delegate("#sns-dp-frequency-trigger","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});e.$(document).delegate("#snsSelectedFrequencyLabel","click",function(a){q.ue&&
q.ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});e.on("a:accordion:sns-dp-frequency-accordion:select",function(){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});e.$(document).delegate("#snsFrequencyBottomSheet button","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});e.$(document).delegate("#subscribe-only",
"click",function(a){q.ue&&q.ue.count(b.SNS_ONML_SUBSCRIBE_ONLY_METRICS,(ue.count(b.SNS_ONML_SUBSCRIBE_ONLY_METRICS)||0)+1)})}}});n.when("A","sns-onmlv2-utils","sns-metrics-constants","sns-buybox-constants","sns-constants","sns-onmlv2-cache").register("sns-onmlv2-metrics-helper",function(e,a,b,d,c,h){var f=e.$,l="",g="";b.SNS_ONMLV2_POPOVER_TRIGGERS.forEach(function(a){l+=" a:popover:beforeShow:"+a});b.SNS_ONMLV2_BOTTOMSHEET_TRIGGERS.forEach(function(a){g+=" a:sheet:beforeShow:"+a});e.declarative("sns-delivery-date",
"click",function(a){h.incrementDeliveryOptionClickCounter()});e.declarative("sns-delivery-date-bottom-sheet","click",function(a){h.incrementDeliveryOptionClickCounterMobile()});e.declarative("sns-delivery-change-btn","click",function(a){f(d.SNS_DELIVERY_OPTION_DIV).is(":checked")?h.incrementDeliveryOptionSwitchToSnsCounter():f(d.ONML_DELIVERY_OPTION_DIV).is(":checked")&&h.incrementDeliveryOptionSwitchToOnmlCounter()});e.on("a:popover:beforeHide:sns-delivery-modal",function(a){k(b.SNS_ONMLV2_DELIVERY_OPTION_CLICK_METRICS,
h.getDeliveryOptionClickCounter());k(b.SNS_ONMLV2_SWITCH_TO_SNS_METRICS,h.getDeliveryOptionSwitchToSnsCounter());k(b.SNS_ONMLV2_SWITCH_TO_ONML_METRICS,h.getDeliveryOptionSwitchToOnmlCounter());k(b.SNS_QUANTITY_SELECT_DESKTOP,h.getQuantityClickCounterDesktop())});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){k(b.SNS_ONMLV2_DELIVERY_OPTION_CLICK_MOBILE_METRICS,h.getDeliveryOptionClickCounterMobile());f(d.SNS_DELIVERY_OPTION_DIV).is(":checked")?h.incrementDeliveryOptionSwitchToSnsCounterMobile():
f(d.ONML_DELIVERY_OPTION_DIV).is(":checked")&&h.incrementDeliveryOptionSwitchToOnmlCounterMobile();k(b.SNS_ONMLV2_SWITCH_TO_SNS_MOBILE_METRICS,h.getDeliveryOptionSwitchToSnsCounterMobile());k(b.SNS_ONMLV2_SWITCH_TO_ONML_MOBILE_METRICS,h.getDeliveryOptionSwitchToOnmlCounterMobile());k(b.SNS_QUANTITY_SELECT_MOBILE,h.getQuantityClickCounterMobile())});e.on(l,function(){m(b.SNS_ONMLV2_DESKTOP_POPOVER_SHOW_METRICS)});e.on(g,function(){m(b.SNS_ONMLV2_MOBILE_BOTTOMSHEET_SHOW_METRICS)});e.$(document).delegate("#sns-submit-declarative",
"click",function(d){d=h.getDeliveryOption();var e=a.isMobileDevice();d===c.DELIVERY_OPTION.SNS?e?m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_MOBILE_METRICS):m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_METRICS):d===c.DELIVERY_OPTION.ONML&&(e?m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_MOBILE_METRICS):m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_METRICS))});e.$(document).delegate(d.SNS_ONMLV2_QUANTITY_TRIGGER_DESKTOP,"change",function(a){h.incrementQuantityClickCounterDesktop();k(b.SNS_QUANTITY_SELECT_DESKTOP,
h.getQuantityClickCounterDesktop())});e.$(document).delegate(d.SNS_ONMLV2_QUANTITY_TRIGGER_MOBILE,"change",function(a){h.incrementQuantityClickCounterMobile();k(b.SNS_QUANTITY_SELECT_MOBILE,h.getQuantityClickCounterMobile())});var m=function(a){q.ue&&q.ue.count(a,(ue.count(a)||0)+1)},k=function(a,b){q.ue&&q.ue.count(a,b)}});n.when("A","sns-onmlv2-utils","sns-buybox-constants").register("sns-onmlv2-cache",function(e,a,b){var d=e.$,c=0,h=0,f=0,l=0,g=0,m=0,k=0,n=0;return{getDeliveryOptionClickCounter:function(){return c},
incrementDeliveryOptionClickCounter:function(){c++},getDeliveryOptionClickCounterMobile:function(){return h},incrementDeliveryOptionClickCounterMobile:function(){h++},getDeliveryOptionSwitchToSnsCounter:function(){return f},incrementDeliveryOptionSwitchToSnsCounter:function(){f++},getDeliveryOptionSwitchToSnsCounterMobile:function(){return l},incrementDeliveryOptionSwitchToSnsCounterMobile:function(){l++},getDeliveryOptionSwitchToOnmlCounterMobile:function(){return m},incrementDeliveryOptionSwitchToOnmlCounterMobile:function(){m++},
getDeliveryOptionSwitchToOnmlCounter:function(){return g},incrementDeliveryOptionSwitchToOnmlCounter:function(){g++},getDeliveryOption:function(){return d(b.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getQuantityClickCounterDesktop:function(){return k},incrementQuantityClickCounterDesktop:function(a){k++},getQuantityClickCounterMobile:function(){return n},incrementQuantityClickCounterMobile:function(a){n++}}});n.when("sns-atc","sns-frequency-bottom-sheet","sns-frequency-popover","sns-opt-in-checkbox",
"sns-event-handler","sns-metrics-helper","sns-price-refresh").execute("sns-execute",function(e,a,b,d,c,h,f){e.init();a.init();b.init();d.init();c.init();h.init();f.init()});n.when("moq-core").register("sns-moq-helper",function(e){return{isSnsLocked:e.isSnsLocked}});n.register("sns-marketplace-util",function(){return{marketplace:"US"}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("AmazonsChoiceAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","a-popover","ready").execute(function(a,b){var g=a.$;g(document).delegate("#why-we-love-this-product-link","click mouseenter",function(a){b.get(g("#ac-badge-popover-declarative")).show();a.preventDefault()})});"use strict";b.when("A","atf","dp-refresh-handler","twisterModule","ac-state-utils").execute(function(a,
b,g,c,d){d.addACStateParamsToPageRefreshAjaxUrl()});"use strict";b.when("A","atf","dp-refresh-handler","ready").register("ac-state-utils",function(a,b,c){return{addACStateParamsToPageRefreshAjaxUrl:function(){var b={featureName:"acBadge"},d=a.$,e=a.state("acState");if(e){var f={};e.acAsin&&(f.acAsin=e.acAsin);e.modalityMetadata&&(f.ac_md=e.modalityMetadata);d.isEmptyObject(f)||(new c(b)).addParams(f)}}}})});
/* ******** */
(function(e){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,a=k?k("BadgingMessagingAssets",""):f;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,f,k){e.when("A").register("PromiseBasedBadgeCutoff",function(a){function c(b,a,e,c){a=Math.floor(e-a);if(0>=a||!c())return null;var d={hours:Math.floor(a/3600),minutes:Math.floor(a%3600/60),seconds:a%60};c="";c=1<d.hours?1<d.minutes?b.hoursMinutes:1===d.minutes?b.hoursMinute:b.hours:1===d.hours?
1<d.minutes?b.hourMinutes:1===d.minutes?b.hourMinute:b.hour:1<d.minutes?b.minutes:0<d.minutes?b.minute:1<d.seconds?b.seconds:b.second;return c.replace(/{{hours}}|{{minutes}}|{{seconds}}/gi,function(a){return d[a.substring(2,a.length-2)]})}function e(a,c,g){null===a?c():g(a)}return{_calculateNewMessage:c,_messageUpdater:e,run:function(b,f,g,k){var d=0,h=a.state(g);h&&h.timerId&&clearTimeout(h.timerId);var l=function(){return 0!==a.$(g).length},m=function(b){a.$(k).html("");clearTimeout(d)},n=function(b){a.$(g).html(b)},
h=function(){var a=Math.floor((new Date).getTime()/1E3),a=c(b,a,f,l);e(a,m,n)},d=setInterval(h,1E3);h();a.state(g,{timerId:d})}}});e.when("PromiseBasedBadgeCutoff","A","ready").execute(function(a,c){c.$(".promiseBasedBadgeWrapper").each(function(e,b){e=c.$(this).data("template");b=c.$(this).data("cutoff");var f=c.$(this).data("willBeHidden");a.run(e,b,this,f)})})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPagePRSubsWidgetAssets",""):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","jQuery","ready","cf").execute(function(b,d){function a(){d(".prsubswidget-asin-title, .prsubswidget-asin-image").unbind("mousedown.prsubswidget");d(".prsubswidget-asin-title, .prsubswidget-asin-image").bind("mousedown.prsubswidget",function(a){if(c.ue&&c.ue.event&&d(a.target).parents("a")){var b=
d(a.target).parents("a").data("subsAsin");a=d(a.target).parents("a").data("surfacedAsinRequestId");b&&a&&c.ue.event({producerId:"prservices_subs_feedback_loop",schemaId:"prservices.ClickedSubstituteEvent.3",subsAsin:b,surfacedAsinRequestId:a},"producer","schema")}})}a();b.on("a:pageUpdate",a)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("PrimeOneClickAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.register("PrimeOneClickCountdown",function(){function a(e,a,b,c,d){if(!(1>e)){var f=this;this.endTime=this.getCurrentTime()+e;this.expirationCallback=a;this.displayElement=b;this.displayEnabled=!!d;this.formatFunction=c;this.update();this.currentTimer=setInterval(function(){f.update()},6E4)}}
a.prototype.update=function(){var a=this.endTime-this.getCurrentTime();0>a&&(a=0);this.updateDisplay(a);0===a&&("function"===typeof this.expirationCallback&&this.expirationCallback(),this.destroy())};a.prototype.updateDisplay=function(a){this.displayElement&&this.displayEnabled&&(this.displayElement.innerHTML=this.getCountdownDisplay(Math.floor(a/3600),Math.floor(a%3600/60),a%60))};a.prototype.getCountdownDisplay=function(a,b,c){return"function"===typeof this.formatFunction?this.formatFunction(a,
b,c):a+"h "+b+"m "+c+"s"};a.prototype.enableDisplay=function(){this.displayEnabled=!0;this.update()};a.prototype.disableDisplay=function(a){this.displayEnabled=!1;a&&this.displayElement&&(this.displayElement.innerHTML="")};a.prototype.getCurrentTime=function(){return Math.floor(+new Date/1E3)};a.prototype.destroy=function(){clearTimeout(this.currentTimer)};return{Countdown:a}})});
/* ******** */
(function(q){var f=window.AmazonUIPageJS||window.P,p=f._namespace||f.attributeErrors,b=p?p("ABPricingFreeFormQuantityPickerAssets",""):f;b.guardFatal?b.guardFatal(q)(b,window):b.execute(function(){q(b,window)})})(function(q,f,p){q.when("jQuery","A","ready").execute(function(b,h){function r(b){f.ue!==p&&f.ue.count!==p&&f.ue.count(b,(f.ue.count(b)||0)+1)}function t(b,a,c){null===c&&(c="");var u=new RegExp("\\b("+a+"\x3d).*?(\x26|#|$)");if(0<=b.search(u))return b.replace(u,"$1"+c+"$2");b=b.replace(/[?#]$/,
"");return b+(0<b.indexOf("?")?"\x26":"?")+a+"\x3d"+c}function m(){return h.state("ABPricingFreeFormQuantityPicker")}function l(b,a){return 0!==b.find('option[value\x3d"'+a.toString()+'"]').length}function e(){n||m()===p||(n=!0,q.register("abPricingFfqp_utils",function(){return{PACKAGE_PREFIX:"ABPricingFreeFormQuantityPicker",getPageState:m,incrementMetricByOne:r,replaceUrlParam:t,dropdownContainsQuantity:l}}))}var n=!1;e();q.register("abPricingFfqp_lazyInitializer",function(){return{tryInitialize:e}})});
"use strict";q.when("jQuery","ready").register("abPricingFfqp_metrics",function(b){var h=!0,r=!0;return{updateReftagTriggering:function(b){h=b},updateCounterTriggering:function(b){r=b},register:function(b){b.reftag&&this.registerReftag(b.reftag);b.counter&&this.registerCounter(b.counter)},registerCounter:function(b){r&&f.ue&&f.ue.count&&f.ue.count(b,(f.ue.count(b)||0)+1)},registerReftag:function(f){h&&b.ajax("/gp/product/ajax-handlers/reftag.html/ref\x3d"+f,{type:"GET",cache:!1,timeout:500,retryCount:0,
retryLimit:3,retryInterval:500,retryExponentialBase:2,error:function(){this.retryCount++;this.retryCount<=this.retryLimit&&setTimeout(function(){b.ajax(this)}.bind(this),Math.pow(this.retryExponentialBase,this.retryCount)*this.retryInterval)}})}}});"use strict";q.when("jQuery","A","abPricingFfqp_utils","abPricingFfqp_metrics").register("abPricingFfqp_quantityManager",function(b,h,r,t){function m(a){for(var b="",c=0;c<a;c++)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*
Math.random()));return b}function l(a,b){return(a=(new RegExp("(?:^|\\?|\x26)"+b+"\x3d(?:([^\x26#]*)|\x26|#|$)")).exec(a))?a[1]?decodeURIComponent(a[1].replace(/\+/g," ")):"":p}function e(a,b,c){var d=a.split("#");a=d[0];a="?"===a[0]?a.substr(1):a;d=d[1];"undefined"!==typeof c&&null!==c?(c=b+"\x3d"+c,b=new RegExp("(^|\x26)("+b+"\x3d[^\x26]*)"),a=b.test(a)?a.replace(b,"$1"+c):a+((0!==a.length?"\x26":"")+c)):(b=new RegExp("(^|\x26)("+b+"\x3d[^\x26]*)"),b.test(a)&&(a=a.replace(b,""),"\x26"===a[0]&&(a=
a.substr(1))));return"?"+a+("undefined"!==typeof d?"#"+d:"")}function n(a){var b=f.location.protocol+"//"+f.location.host+f.location.pathname,c=f.location.search,d;for(d in a)a.hasOwnProperty(d)&&(c=e(c,d,a[d]));return b+c}function d(a){if(f.history!==p&&f.history.pushState!==p){var b={};b.qty=a;f.history.pushState({},"",n(b))}}function a(){var a=parseInt(l(f.location.search,"qty"));this.currentQuantity=isNaN(a)?1:a;this.wireUpSelectorBasedEvents()}var c=r.PACKAGE_PREFIX+".QuantityRefreshCheckError";
a.prototype.getCurrentQuantity=function(){return this.currentQuantity};a.prototype.wireUpSelectorBasedEvents=function(){var a=this;q.when("A","jQuery","quanityChangePriceUpdate").execute(function(b,c,d){a.quantityChangePriceUpdater=d;b.on("a:pageUpdate",function(){a.handleTwisterPageRefresh()})})};a.prototype.update3PPriceBlock=function(){if(!(this.leastMinimumOrderQuantity===p||1>=this.leastMinimumOrderQuantity)){var a=b(".price3P");a.hasClass("updatedPrice3P")||(a.addClass("updatedPrice3P"),this.quantityChangePriceUpdater.ajaxCall({qt:this.leastMinimumOrderQuantity,
quantityPriceField:"quantity_price"}))}};a.prototype.handleTwisterPageRefresh=function(){this.update3PPriceBlock()};a.prototype.reloadPageForQuantity=function(a,b){var c={};c.qty=a;c.psc=1;"undefined"!==typeof b&&("undefined"!==typeof b.refTag&&(c.ref_=b.refTag),"undefined"!==typeof b.activeBuyBoxId&&(c.selectObb=b.activeBuyBoxId),"undefined"!==typeof b.merchantId&&(c.smid=b.merchantId));f.location.href=n(c)};a.prototype.isPageRefreshNotRequired=function(a){return this.currentQuantity===parseInt(a)};
a.prototype.notifyQuantityChanged=function(a,b){h.trigger("buyBoxQuantityChanged",b.senderId,a);h.trigger("notifyBuyingInBulkOptionClicked",a);if(!this.isPageRefreshNotRequired(a)&&(this.currentQuantity=parseInt(a),d(a),!0!==b.preventRefreshCheck)){var e=this,m=r.getPageState(),m={asin:m.asin,quantity:a,refreshData:m.lastRefreshData,activeBuyBoxId:b.activeBuyBoxId};if(b.qdsForLockedMerchantEnabled){var n=l(f.location.search,"smid");"undefined"!==typeof n&&(m.merchantId=n)}h.trigger("quantityRefreshCheckStarted");
h.get("/gp/product/ajax-handlers/quantity-page-refresh.html",{params:m,timeout:4E3,error:function(){r.incrementMetricByOne(c);e.reloadPageForQuantity(a,{activeBuyBoxId:b.activeBuyBoxId})},success:function(){h.trigger("quantityRefreshCheckFinished")}})}};a.prototype.fetchAllTiersForQuantityDiscountTable=function(a){var b=r.getPageState(),c=this.isQPTBuyBoxAwareEnabled(a),b=c?{ref:"b2b_vqp_tiers",asin:b.asin,cb:m(20),qptResponseFormat:"json",selectObb:a.activeBuyBoxId}:{ref:"b2b_vqp_tiers",asin:b.asin,
cb:m(20),qptResponseFormat:"json"};if(a.qdsForLockedMerchantEnabled){var d=l(f.location.search,"smid");"undefined"!==typeof d&&(b.merchantId=d)}var e=this;this.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableStarted",a);h.get("/gp/product/ajax-handlers/quantity-price-table.html",{params:b,timeout:4E3,error:function(){e.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableError",a)},success:function(b){b.hasError?e.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableError",a):c?h.trigger("fetchQuantityDiscountTableCompleted",
b.entries,a.senderId):h.trigger("fetchQuantityDiscountTableCompleted",b.entries)}})};a.prototype.updateLimitedAvailabilityMessageVisibility=function(a){h.trigger("updateLimitedAvailabilityMessageVisibility",a.hasAvailability)};a.prototype.isQPTBuyBoxAwareEnabled=function(a){return a&&a.senderId&&a.activeBuyBoxId};a.prototype.triggerBuyBoxAwareEvent=function(a,b){this.isQPTBuyBoxAwareEnabled(b)?h.trigger(a,b.senderId):h.trigger(a)};a.prototype.notifyBuyingInBulkOptionClicked=function(a){h.trigger("notifyBuyingInBulkOptionClicked",
a)};return{EVENT__BUY_BOX_QUANTITY_CHANGED:"buyBoxQuantityChanged",EVENT__QUANTITY_REFRESH_CHECK_STARTED:"quantityRefreshCheckStarted",EVENT__QUANTITY_REFRESH_CHECK_FINISHED:"quantityRefreshCheckFinished",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED:"fetchQuantityDiscountTableStarted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED:"fetchQuantityDiscountTableCompleted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR:"fetchQuantityDiscountTableError",EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY:"updateLimitedAvailabilityMessageVisibility",
EVENT__NOTIFY_BUYING_IN_BULK_OPTION_CLICKED:"notifyBuyingInBulkOptionClicked",getUrlParameter:l,replaceUrlParameter:e,singleton:new a}});"use strict";q.when("jQuery","A","a-dropdown","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager").register("abPricingFfqp_quantityPickerLogic",function(b,h,f,t,m,l){function e(a){return a.prop("selectedIndex")+1===a.prop("length")}function n(a,b){if(!m.dropdownContainsQuantity(a,b)){var d=document.createElement("option");d.value=b;d.text=b.toString();
a.append(d)}}function d(a){this.id=a.id;this.buyBoxId=a.buyBoxId;this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;this.predefinedQuantitiesDropdownSelector=a.predefinedQuantitiesDropdownSelector;this.predefinedQuantitiesDropdownContainerSelector=a.predefinedQuantitiesDropdownContainerSelector;this.freeQuantityTextInputSelector=a.freeQuantityTextInputSelector;this.freeQuantityTextInputOuterSelector=a.freeQuantityTextInputOuterSelector;
this.updateButtonSelector=a.updateButtonSelector;this.addToCartButtonSelector=a.addToCartButtonSelector;this.initialQuantity=a.initialQuantity;this.buyingOptionPosition=a.buyingOptionPosition;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector;this.initialQuantity&&this.updateQuantityHiddenField(this.initialQuantity);this.wireUpSelectorBasedEvents()}d.prototype.wireUpSelectorBasedEvents=function(){var a=this,c=b(this.predefinedQuantitiesDropdownSelector);h.on("a:dropdown:"+
c[0].id+":select",function(b){a.handleDropdownOptionClicked(b.value)});h.on(l.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,c){a.handleQuantityChangedOnOtherBuyBox(b,c)});h.on(l.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});h.on(l.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()});h.on(l.EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY,function(b){a.updateLimitedAvailabilityMessageVisibility(b)})};d.prototype.wireUpReferenceBasedEvents=
function(){var a=this,c=b(this.freeQuantityTextInputSelector),d=b(this.updateButtonSelector);c.keydown(function(b){a.handleTextInputKeyDown(b)});c.keyup(function(b){a.handleTextInputKeyUp(b)});c.focus(function(){a.handleTextInputFocused()});d.click(function(){a.handleButtonClick()})};d.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();e(b(this.predefinedQuantitiesDropdownSelector))?this.switchToFreeQuantityUI():this.switchToPredefinedQuantitiesUI();this.enableUI();this.lastSelectedQuantity=
this.getCurrentQuantity();l.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};d.prototype.getCurrentQuantity=function(){if(this.isTextInputVisible()){var a=b(this.freeQuantityTextInputSelector);return parseInt(a.val())}return this.isDropdownVisible()?(a=b(this.predefinedQuantitiesDropdownSelector),parseInt(a.find(":selected").val())):p};d.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&&this.disableUI()};d.prototype.handleQuantityRefreshCheckFinished=function(){this.doesDOMExist()&&
this.enableUI()};d.prototype.handleDropdownOptionClicked=function(a){var c=b(this.predefinedQuantitiesDropdownSelector);e(c)?(a=b(this.freeQuantityTextInputSelector),a.val(this.lastSelectedQuantity.toString()),this.switchToFreeQuantityUI(),a.focus(),m.incrementMetricByOne("freeFormQtyPickerMaxQtySelected")):(this.lastSelectedQuantity=a=parseInt(a),this.updateQuantityHiddenField(a),l.singleton.notifyQuantityChanged(a,{senderId:this.id,activeBuyBoxId:this.buyBoxId}))};d.prototype.handleTextInputFocused=
function(){b(this.freeQuantityTextInputSelector).select()};d.prototype.handleTextInputKeyUp=function(a){13!==a.keyCode&&t(this.updateButtonSelector).show()};d.prototype.handleTextInputKeyDown=function(a){13===a.keyCode&&(a.preventDefault(),b(this.updateButtonSelector).click(),b(this.addToCartButtonSelector).focus())};d.prototype.clampQuantity=function(a){999<a&&(a=999);this.leastMinimumOrderQuantity!==p&&a<this.leastMinimumOrderQuantity&&(a=this.leastMinimumOrderQuantity);return a};d.prototype.handleButtonClick=
function(){var a=b(this.predefinedQuantitiesDropdownSelector),c=f.getSelect(a[0]),d=b(this.freeQuantityTextInputSelector),h=d.val(),e=parseInt,n=h.match(/[1-9][0-9]*/),e=e(null===n?"1":n[0]),e=this.clampQuantity(e);m.dropdownContainsQuantity(a,e)?(this.switchToPredefinedQuantitiesUI(),c.setValue(e.toString()),this.handleDropdownOptionClicked(e)):(a=e.toString(),a!==h&&d.val(a),t(this.updateButtonSelector).hide(),this.updateQuantityHiddenField(e),l.singleton.notifyQuantityChanged(e,{senderId:this.id,
activeBuyBoxId:this.buyBoxId}))};d.prototype.doesDOMExist=function(){return 0<b(this.predefinedQuantitiesDropdownSelector).length&&0<b(this.freeQuantityTextInputSelector).length&&0<b(this.updateButtonSelector).length};d.prototype.handleQuantityChangedOnOtherBuyBox=function(a,c){if(a!==this.id&&this.doesDOMExist()&&this.getCurrentQuantity()!==c){a=b(this.predefinedQuantitiesDropdownSelector);var d=f.getSelect(a[0]);m.dropdownContainsQuantity(a,c)?(d.setValue(c.toString()),this.lastSelectedQuantity=
c,this.switchToPredefinedQuantitiesUI()):(b(this.freeQuantityTextInputSelector).val(c.toString()),this.switchToFreeQuantityUI());this.updateQuantityHiddenField(c)}};d.prototype.showDropdown=function(){b(this.predefinedQuantitiesDropdownContainerSelector).removeClass("aok-hidden")};d.prototype.hideDropdown=function(){b(this.predefinedQuantitiesDropdownContainerSelector).addClass("aok-hidden")};d.prototype.isDropdownVisible=function(){return!b(this.predefinedQuantitiesDropdownContainerSelector).hasClass("aok-hidden")};
d.prototype.showTextInput=function(){"mobile"===m.getPageState().platform?b(this.freeQuantityTextInputOuterSelector).removeClass("aok-hidden"):b(this.freeQuantityTextInputSelector).removeClass("aok-hidden")};d.prototype.hideTextInput=function(){"mobile"===m.getPageState().platform?b(this.freeQuantityTextInputOuterSelector).addClass("aok-hidden"):b(this.freeQuantityTextInputSelector).addClass("aok-hidden")};d.prototype.isTextInputVisible=function(){return"mobile"===m.getPageState().platform?!b(this.freeQuantityTextInputOuterSelector).hasClass("aok-hidden"):
!b(this.freeQuantityTextInputSelector).hasClass("aok-hidden")};d.prototype.disableTextInput=function(){if("mobile"===m.getPageState().platform){var a=b(this.freeQuantityTextInputSelector),c=b(this.freeQuantityTextInputOuterSelector);a.prop("disabled","disabled");c.addClass("a-form-disabled")}else a=b(this.freeQuantityTextInputSelector),a.prop("disabled","disabled"),a.addClass("a-form-disabled")};d.prototype.enableTextInput=function(){if("mobile"===m.getPageState().platform){var a=b(this.freeQuantityTextInputSelector),
c=b(this.freeQuantityTextInputOuterSelector);a.removeProp("disabled");c.removeClass("a-form-disabled")}else a=b(this.freeQuantityTextInputSelector),a.removeProp("disabled"),a.removeClass("a-form-disabled")};d.prototype.switchToFreeQuantityUI=function(){this.hideDropdown();this.showTextInput();t(this.updateButtonSelector).hide()};d.prototype.switchToPredefinedQuantitiesUI=function(){this.showDropdown();this.hideTextInput();t(this.updateButtonSelector).hide()};d.prototype.disableUI=function(){var a=
f.getSelect(this.predefinedQuantitiesDropdownSelector),b=t(this.updateButtonSelector);a.update({status:"disabled"});this.disableTextInput();b.disable()};d.prototype.enableUI=function(){var a=f.getSelect(this.predefinedQuantitiesDropdownSelector),b=t(this.updateButtonSelector);a.update({status:"normal"});this.enableTextInput();b.enable()};d.prototype.updateQuantityHiddenField=function(a){var c=b(this.quantityHiddenFieldSelector);c.is("select")?(n(c,a),f.getSelect(c).val(a)):c.val(a.toString());c="select#mobileQuantityDropDown";
1==this.buyingOptionPosition&&(c="#SecondNewAccordionRow "+c);"mobile"===m.getPageState().platform&&this.quantityHiddenFieldSelector!==c&&(c=b(c))&&c.is("select")&&(n(c,a),f.getSelect(c).val(a))};d.prototype.updateLimitedAvailabilityMessageVisibility=function(a){var c=b(this.addToCartButtonSelector).closest(".a-button"),c=t(c);a?(b(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),c.enable()):(b(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden"),c.disable())};return{QuantityPickerLogic:d}});
"use strict";q.when("jQuery","A","a-dropdown","a-modal","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager","abPricingFfqp_metrics").register("abPricingFfqpV2_quantityPickerLogic",function(b,h,r,t,m,l,e,n){function d(a,b){if(!l.dropdownContainsQuantity(a,b)){var k=document.createElement("option");k.value=b;k.text=b.toString();a.append(k)}}function a(a){this.id=a.id;this.buyBoxId=a.buyBoxId;this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;
this.quantityPickerSelector=a.quantityPickerSelector;this.quantityDiscountTableSelector=this.quantityPickerSelector+" .quantity-discount-table";this.quantityTextInputLabelSelector=this.quantityPickerSelector+" .quantity-text-input-label";this.accordionRowContainerSelector=a.accordionRowContainerSelector;this.buyboxAccordionContainerSelector=a.buyboxAccordionContainerSelector;this.loadMoreMessage=a.loadMoreMessage;this.fetchTheBestPricesMessage=a.fetchTheBestPricesMessage;this.qdtErrorMessage=a.qdtErrorMessage;
this.includeRfqdLinkInNewPicker=a.includeRfqdLinkInNewPicker;this.requestForQuantityDiscountModalSelector=a.requestForQuantityDiscountModalSelector;this.requestForQuantityDiscountMessage=a.requestForQuantityDiscountMessage;this.bbtLinkSelector=a.bbtLinkSelector;this.preloadQuantityPriceTable=a.preloadQuantityPriceTable;this.addToCartButtonSelector=a.addToCartButtonSelector;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector;this.fetchQuantityDiscountTableCompleted=this.fetchQuantityDiscountTableStarted=
this.isLoadMoreButtonClicked=!1;this.quantityTextInputSelector=this.quantityPickerSelector;this.quantityTextInputSelector+=" .quantity-text-input-with-label";this.loadMoreButtonForUncompetitiveTiersPresence=this.hasError=!1;this.quantityPricingTableSummaryEnabled=a.quantityPricingTableSummaryEnabled;this.qdsForLockedMerchantEnabled=a.qdsForLockedMerchantEnabled;this.isAODLinkEnabled=!0===a.isAODLinkEnabled;this.wireUpSelectorBasedEvents();this.initializeQuantityHiddenField()}var c=l.PACKAGE_PREFIX+
".PriceTableLoadError",q=l.PACKAGE_PREFIX+".QuantityPriceTableRender",v=l.PACKAGE_PREFIX+".QuantityPriceTableView",w=l.PACKAGE_PREFIX+".QuantityPriceTableRenderWithLockedMerchant",x=l.PACKAGE_PREFIX+".QuantityPriceTableViewWithLockedMerchant",y=l.PACKAGE_PREFIX+".QuantityPriceTableRenderWithUncompetitiveTiers",z=l.PACKAGE_PREFIX+".QuantityPriceTableViewWithUncompetitiveTiers",A=l.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClicked",B=l.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClickedWithUncompetitiveTiers",
C=l.PACKAGE_PREFIX+".QuantityPriceTableBBTLinkRender",D=l.PACKAGE_PREFIX+".QuantityPriceTableBBTLinkClick",E=l.PACKAGE_PREFIX+".QuantityPriceTableRFQDBBTLinkClick",F=l.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageRender",G=l.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageView";a.prototype.wireUpSelectorBasedEvents=function(){var a=this;h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableStarted()});h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED,
function(b,k){k&&k!==a.id||a.handleFetchQuantityDiscountTableCompleted(b)});h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableError()});h.on(e.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,k){a.handleQuantityChangedOnOtherBuyBox(b,k)});h.on(e.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});h.on(e.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()});h.on(e.EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY,
function(b){a.updateLimitedAvailabilityMessageVisibility(b)})};a.prototype.initializeQuantityHiddenField=function(){var a=e.singleton.currentQuantity,b=parseInt(this.leastMinimumOrderQuantity);b&&b>a&&(a=b);this.updateQuantityHiddenField(a)};a.prototype.handleFetchQuantityDiscountTableCompleted=function(a){this.wireUpQuantityDiscountTableData(a);this.generateQuantityDiscountTable();this.fetchQuantityDiscountTableCompleted=!0};a.prototype.handleFetchQuantityDiscountTableStarted=function(){this.fetchQuantityDiscountTableStarted=
!0};a.prototype.wireUpQuantityDiscountTableData=function(a){this.priceTiers=a;this.buildQptRenderMetrics();this.buildQptForLockedMerchantMetrics(w);this.buildQptUncompetitiveTiersMetrics(y);this.buildAvailabilityMessageMetrics(F)};a.prototype.handleFetchQuantityDiscountTableError=function(){l.incrementMetricByOne(c);this.fetchQuantityDiscountTableStarted=!1;this.hasError=!0;this.generateQuantityDiscountTable()};a.prototype.wireUpReferenceBasedEvents=function(){var a=this,g=b(this.quantityTextInputSelector),
k=b(this.quantityTextInputLabelSelector);k.click(function(){g.focus();g.click()});g.focus(function(){k.hide();a.showQuantityDiscountTable()});g.blur(function(){a.updateQuantityAndHideQuantityDiscountTable();k.show()});g.live("keypress input",function(b){a.isValidQuantityTextInputKeyCode(b);this.value=this.value.replace(/[^0-9]/g,"")});g.live("keydown",function(b){a.isValidQuantityTextPressKeyCode(b)});g.live("click change paste keyup",function(){a.clampQuantity(g.val());a.generateQuantityDiscountTable()})};
a.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();this.enableUI();e.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};a.prototype.isValidQuantityTextPressKeyCode=function(a){var b={left:37,up:38,right:39,down:40},k=f.event?a.keyCode:a.which,c;for(c in b)b[c]===k&&a.preventDefault()};a.prototype.isValidQuantityTextInputKeyCode=function(a){var b=f.event?a.keyCode:a.which;8!==b&&46!==b&&(13===b?(this.updateQuantityAndHideQuantityDiscountTable(),a.preventDefault()):
(b=String.fromCharCode(b),/\d/.test(b)||a.preventDefault()))};a.prototype.getCurrentQuantity=function(){var a=b(this.quantityTextInputSelector);return this.clampQuantity(a.val())};a.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&&this.disableUI()};a.prototype.handleQuantityRefreshCheckFinished=function(){this.doesDOMExist()&&this.enableUI()};a.prototype.clampQuantity=function(a){var b=a;999<a&&(b=999);this.leastMinimumOrderQuantity!==p&&a<this.leastMinimumOrderQuantity&&
(b=this.leastMinimumOrderQuantity);return b};a.prototype.doesDOMExist=function(){return 0<b(this.quantityTextInputSelector).length};a.prototype.handleQuantityChangedOnOtherBuyBox=function(a,g){a!==this.id&&this.doesDOMExist()&&this.getCurrentQuantity()!==g&&(b(this.quantityTextInputSelector).val(g),this.updateQuantityHiddenField(g))};a.prototype.showQuantityDiscountTable=function(){this.buildQptViewMetrics();this.preloadQuantityPriceTable||this.fetchQuantityDiscountTableStarted||e.singleton.fetchAllTiersForQuantityDiscountTable({senderId:this.id,
activeBuyBoxId:this.buyBoxId,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled});this.fetchQuantityDiscountTableCompleted&&(this.buildQptForLockedMerchantMetrics(x),this.buildQptUncompetitiveTiersMetrics(z,this.getStartIndexOfQuantityDiscountTierTable(),3),this.buildAvailabilityMessageMetrics(G));var a=b(this.quantityPickerSelector),g=b(this.accordionRowContainerSelector),k=b(this.buyboxAccordionContainerSelector);0<g.length&&(g.get(0).setAttribute("style","overflow:visible"),g=g.find(".a-accordion-inner.accordion-row-content"),
0<g.length&&g.get(0).setAttribute("style","overflow:visible"));0<k.length&&(k.get(0).setAttribute("style","overflow:visible"),k=k.find(".a-accordion-inner"),0<k.length&&k.get(0).setAttribute("style","overflow:visible"));a.addClass("open")};a.prototype.hideQuantityDiscountTable=function(){b(this.quantityPickerSelector).removeClass("open")};a.prototype.updateQuantityAndHideQuantityDiscountTable=function(){var a=b(this.quantityDiscountTableSelector),g=b(this.quantityTextInputSelector),k=this.clampQuantity(g.val());
g.val(k);this.updateQuantityHiddenField(k);e.singleton.notifyQuantityChanged(k,{senderId:this.id,activeBuyBoxId:this.buyBoxId,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled});this.isLoadMoreButtonClicked=!1;this.hideQuantityDiscountTable();a.empty()};a.prototype.disableUI=function(){var a=b(this.quantityTextInputSelector),g=b(this.quantityDiscountTableSelector);a.attr("disabled",!0);a.addClass("quantity-text-input-disabled");g.attr("disabled",!0)};a.prototype.enableUI=function(){var a=
b(this.quantityTextInputSelector),g=b(this.quantityDiscountTableSelector);a.attr("disabled",!1);a.removeClass("quantity-text-input-disabled");g.attr("disabled",!1);this.hideQuantityDiscountTable()};a.prototype._isMobileQuantityHiddenFieldSelector=function(){return"string"===typeof this.quantityHiddenFieldSelector&&-1<this.quantityHiddenFieldSelector.indexOf("select#mobileQuantityDropDown")};a.prototype._mobileQuantityHiddenFieldSelector=function(){return this.quantityHiddenFieldSelector.replace("select#quantity",
"select#mobileQuantityDropDown")};a.prototype.updateQuantityHiddenField=function(a){var g=b(this.quantityHiddenFieldSelector).first();g.is("select")&&(d(g,a),r.getSelect(g).val(a));g.val(a.toString());"mobile"!==l.getPageState().platform||this._isMobileQuantityHiddenFieldSelector()||(g=b(this._mobileQuantityHiddenFieldSelector()))&&g.is("select")&&(d(g,a),r.getSelect(g).val(a),g.val(a.toString()))};a.prototype.generateVisibleTiersList=function(a,b){for(var k=[],c=0;b<this.priceTiers.length&&(this.isLoadMoreButtonClicked||
3>c);){var d=this.priceTiers[b];if(this.isLoadMoreButtonClicked||0===c||!d.isUncompetitive)k.push({quantity:0===c?Math.max(a,d.quantity):d.quantity,savingsMessage:d.savingsMessage,availabilityMessage:d.availabilityMessage,quantityPickerPriceText:d.quantityPickerPriceText,isDiscountUnlocked:0===c?0===b&&"BUSINESS_VOLUME_AWARE_PRICING"===d.program:!1,isFirstTier:0===c}),c++;b++}return k};a.prototype.findStartIndexOfQuantityDiscountTierTable=function(a){for(var b=0,k=this.priceTiers.length-1;b<=k;){var c=
parseInt((b+k)/2),d;d=this.priceTiers[c].quantity;d=0===d.length?0:parseInt(d);if(d===a)return c;d>a?k=c-1:b=c+1}return Math.max(0,k)};a.prototype.getStartIndexOfQuantityDiscountTierTable=function(){var a=this.getCurrentQuantity();return this.findStartIndexOfQuantityDiscountTierTable(a)};a.prototype.generateQuantityDiscountTable=function(){this.cleanOutQuantityDiscountTable();var a=b(this.quantityDiscountTableSelector);this.hasError?a.append(this.generateSingleTierDiscountTableUnorderedList(this.generateQdtErrorMessage())):
this.priceTiers===p?a.append(this.generateFetchInProcessTableUnorderedList()):0===this.priceTiers.length?a.append(this.generateSingleTierDiscountTableUnorderedList()):a.append(this.generateQuantityDiscountTableUnorderedList())};a.prototype.cleanOutQuantityDiscountTable=function(){b(this.quantityDiscountTableSelector).empty()};a.prototype.areUncompetitiveTiersPresent=function(a,b){"undefined"===typeof a&&(a=0);b="undefined"===typeof b?this.priceTiers.length:Math.min(a+b,this.priceTiers.length);var c=
!1;for(a+=1;a<b;a++)if(this.priceTiers[a].isUncompetitive){c=!0;break}return c};a.prototype.isAvailabilityMessagePresent=function(){return this.priceTiers[0].availabilityMessage!=p};a.prototype.showLoadMoreButton=function(a){this.loadMoreButtonForUncompetitiveTiersPresence=this.areUncompetitiveTiersPresent(a);return!this.isLoadMoreButtonClicked&&(3<this.priceTiers.length-a||this.loadMoreButtonForUncompetitiveTiersPresence)};a.prototype.showBuyingInBulkLink=function(a){return"undefined"!==typeof this.priceTiers[a].buyingInBulkLink};
a.prototype.generateQuantityDiscountTableUnorderedList=function(){var a=this.getCurrentQuantity(),g=this.findStartIndexOfQuantityDiscountTierTable(a),a=this.generateVisibleTiersList(a,g),c=document.createElement("ul");c.setAttribute("class","qdt-ul");for(var d=b(c),e=0;e<a.length;e++)d.append(this.generateQuantityDiscountTierOption(a[e]));this.showLoadMoreButton(g)?d.append(this.generateLoadMoreOption()):this.showBuyingInBulkLink(g)?d.append(this.generateBuyingInBulkOption(g)):1!=this.includeRfqdLinkInNewPicker&&
"true"!=this.includeRfqdLinkInNewPicker||d.append(this.generateRequestForQuantityDiscountOption());return c};a.prototype.generateSingleTierDiscountTableUnorderedList=function(a){var g=this.getCurrentQuantity(),g=this.generateSingleTierQuantityList(g),c=document.createElement("ul");c.setAttribute("class","qdt-ul");for(var d=b(c),e=0;e<g.length;e++)d.append(this.generateQuantityDiscountTierOption(g[e]));a&&d.append(a);return c};a.prototype.generateSingleTierQuantityList=function(a){var b=[];b.push({quantity:Math.max(a,
1),savingsMessage:null,availabilityMessage:null,quantityPickerPriceText:"",isDiscountUnlocked:!1,isFirstTier:!0});return b};a.prototype.generateFetchInProcessTableUnorderedList=function(){var a=document.createElement("ul");a.setAttribute("class","qdt-ul");b(a).append(this.generateFetchInProcessOption());return a};a.prototype._removeINRSymbol=function(a){a=a.split("\x3e");return a[a.length-1]};a.prototype._populateOptionPriceContent=function(a,b){if("string"===typeof a.quantityPickerPriceText&&-1!==
a.quantityPickerPriceText.search("currencyINR")){var c=document.createElement("span");c.setAttribute("class","currencyINR");c.textContent="  ";b.appendChild(c);a=this._removeINRSymbol(a.quantityPickerPriceText);b.appendChild(document.createTextNode(a))}else b.textContent=a.quantityPickerPriceText};a.prototype.generateQuantityDiscountTierOption=function(a){var b=this,c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div");a.isFirstTier?
(e.textContent=a.quantity,c.setAttribute("class","qdt-dropdown-item qdt-active")):(e.textContent=a.quantity+"+",c.setAttribute("class","qdt-dropdown-item"));b._populateOptionPriceContent(a,f);e.setAttribute("class","option-tier");f.setAttribute("class","option-price");a.availabilityMessage!=p?this.generateTierWithAvailabilityMessageContent(d,e,f,a.availabilityMessage):a.savingsMessage!=p?this.generateTierWithSavingsMessageContent(d,e,f,a):(d.setAttribute("class","qdt-dropdown-option-no-saving-message"),
d.appendChild(e),d.appendChild(f));c.appendChild(d);c.addEventListener("mousedown",function(){b.handleQuantityDiscountTableOptionClicked(a.quantity)});return c};a.prototype.generateTierWithAvailabilityMessageContent=function(a,b,c,d){var e=document.createElement("div");e.textContent=d;e.setAttribute("class","option-availability-message");this.generateTierWithMessageContent(a,b,c,e)};a.prototype.generateTierWithSavingsMessageContent=function(a,c,d,e){var f=document.createElement("div");f.textContent=
e.savingsMessage;e.isDiscountUnlocked?(e=document.createElement("div"),e.setAttribute("class","option-unlocked-saving-message-icon"),b(f).prepend(e),f.setAttribute("class","option-unlocked-saving-message")):f.setAttribute("class","option-saving-message");this.generateTierWithMessageContent(a,c,d,f)};a.prototype.generateTierWithMessageContent=function(a,b,c,d){var e=document.createElement("div");a.setAttribute("class","qdt-dropdown-option-regular");e.setAttribute("class","option-price-and-message");
e.appendChild(c);e.appendChild(d);a.appendChild(b);a.appendChild(e)};a.prototype.generateLoadMoreOption=function(){var a=this,b=document.createElement("li"),c=document.createElement("div");c.textContent=this.loadMoreMessage;b.setAttribute("class","qdt-dropdown-item");c.setAttribute("class","qdt-dropdown-option-load-more");b.setAttribute("id","qdt-dropdown-load-more");b.appendChild(c);b.addEventListener("mousedown",function(b){a.handleLoadMoreOptionClicked(b)});return b};a.prototype.generateRequestForQuantityDiscountOption=
function(){var a=this,b=document.createElement("a");b.textContent=this.requestForQuantityDiscountMessage;b.setAttribute("class","a-link-normal qdt-dropdown-request-for-quantity-discount");b.addEventListener("mousedown",function(b){a.handleRequestForQuantityDiscountOptionClicked(b)});return this.generateLinkOption(b)};a.prototype.generateBuyingInBulkOption=function(a){var b=this;a={container:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk"},link:{element:document.createElement("a"),
class:"a-link-normal qdt-dropdown-buying-in-bulk-link",text:b.priceTiers[a].buyingInBulkLink},message:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk-message",text:b.priceTiers[a].buyingInBulkMessage}};for(var c in a)a[c].element.setAttribute("class",a[c].class),"undefined"!==typeof a[c].text&&(a[c].element.textContent=a[c].text);a.container.element.appendChild(a.link.element);a.container.element.appendChild(a.message.element);a.link.element.addEventListener("mousedown",
function(a){b.handleBuyingInBulkOptionClicked(b.bbtLinkSelector,D,a)});n.registerCounter(C);return this.generateLinkOption(a.container.element)};a.prototype.generateLinkOption=function(a){var b=document.createElement("li"),c=document.createElement("div");b.setAttribute("class","qdt-dropdown-item qdt-inactive");c.setAttribute("class","qdt-dropdown-option-link");c.appendChild(a);b.appendChild(c);return b};a.prototype.generateFetchInProcessOption=function(){var a=document.createElement("li"),b=document.createElement("div"),
c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("img");e.src="https://m.media-amazon.com/images/G/01/AmazonBusiness/vapLoading3._CB1556651073_.gif";c.textContent=this.fetchTheBestPricesMessage;e.setAttribute("class","fetching-in-progress-img");a.setAttribute("class","qdt-dropdown-item qdt-inactive");b.setAttribute("class","qdt-dropdown-option-fetch-in-progress");d.appendChild(e);b.appendChild(d);b.appendChild(c);a.setAttribute("id","qdt-dropdown-fetch-in-progress");
a.appendChild(b);return a};a.prototype.generateQdtErrorMessage=function(){var a=document.createElement("li"),b=document.createElement("div");if(this.isAODLinkEnabled){var c=document.createElement("span");c.setAttribute("class","a-declarative");c.setAttribute("data-action","show-all-offers-display");c.setAttribute("data-show-all-offers-display","{}");c.innerHTML=this.qdtErrorMessage;b.appendChild(c)}else b.innerHTML=this.qdtErrorMessage;a.setAttribute("class","qdt-dropdown-item qdt-inactive");b.setAttribute("class",
"qdt-dropdown-option-request-for-olp");a.setAttribute("id","qdt-dropdown-error-message");a.appendChild(b);var d=b.getElementsByTagName("a")[0];d.addEventListener("mousedown",function(a){d.click()});return a};a.prototype.handleLoadMoreOptionClicked=function(a){this.isLoadMoreButtonClicked=!0;this.buildLoadMoreButtonMetrics();this.generateQuantityDiscountTable();a.preventDefault()};a.prototype.handleQuantityDiscountTableOptionClicked=function(a){b(this.quantityTextInputSelector).val(a);this.updateQuantityAndHideQuantityDiscountTable();
b(this.quantityTextInputLabelSelector).show()};a.prototype.handleRequestForQuantityDiscountOptionClicked=function(a){var c=b(this.requestForQuantityDiscountModalSelector).find(".a-declarative");(c=t.get(c))&&c.show();this.handleBuyingInBulkOptionClicked(this.requestForQuantityDiscountModalSelector,E,a)};a.prototype.handleBuyingInBulkOptionClicked=function(a,b,c){if(a=document.querySelector(a+" .a-link-normal"))n.registerCounter(b),b=this.getCurrentQuantity(),e.singleton.notifyBuyingInBulkOptionClicked(b),
a.click();c.preventDefault()};a.prototype.updateLimitedAvailabilityMessageVisibility=function(a){var c=b(this.addToCartButtonSelector).closest(".a-button"),c=m(c);a?(b(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),c.enable()):(b(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden"),c.disable())};a.prototype.buildQptReftagPrefix=function(){return this.quantityPricingTableSummaryEnabled?"qpts":"qpt"};a.prototype.buildQptRenderMetrics=function(){var a={};a.reftag=this.buildQptReftagPrefix();
a.counter=q+(this.quantityPricingTableSummaryEnabled?".QPTS":"");n.register(a)};a.prototype.buildQptViewMetrics=function(){var a={};a.reftag=this.buildQptReftagPrefix()+"_c";a.counter=v+(this.quantityPricingTableSummaryEnabled?".QPTS":"");n.register(a)};a.prototype.buildQptForLockedMerchantMetrics=function(a){this.qdsForLockedMerchantEnabled&&n.registerCounter(a)};a.prototype.buildQptUncompetitiveTiersMetrics=function(a,b,c){this.areUncompetitiveTiersPresent(b,c)&&n.registerCounter(a)};a.prototype.buildLoadMoreButtonMetrics=
function(){this.loadMoreButtonForUncompetitiveTiersPresence?n.registerCounter(B):n.registerCounter(A)};a.prototype.buildAvailabilityMessageMetrics=function(a){this.isAvailabilityMessagePresent()&&n.registerCounter(a)};return{QuantityPickerLogicV2:a}})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,d=e._namespace||e.attributeErrors,a=d?d("PantryAddressWidgetAsset",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,d){var a="undefined"===typeof a?"UnknownDevice":a;c.when("A","ready","pantry-page","enable-pantry-dp-paw-asset").execute("paw-cia",function(b){var c=function(a){a&&0!==Number(a.isValidAddress)?b.$("form#add-zip").unbind("submit").submit():d(a)},d=function(a){a&&0===Number(a.isValidAddress)?
b.$("div#paw-form-invalid-zip-error").removeClass("aok-hidden"):b.$("div#paw-form-general-error").removeClass("aok-hidden");b.$("form#add-zip input[name\x3d'zip']").removeAttr("disabled");b.$("form#add-zip .a-button").removeClass("a-button-disabled");b.$("div#paw-button-spinner").addClass("aok-hidden")};b.$("form#add-zip").submit(function(f){f.preventDefault();b.$("form#add-zip input[name\x3d'zip']").attr("disabled","disabled");b.$("form#add-zip .a-button").addClass("a-button-disabled");b.$("div#paw-form-invalid-zip-error").addClass("aok-hidden");
b.$("div#paw-form-general-error").addClass("aok-hidden");b.$("div#paw-button-spinner").removeClass("aok-hidden");f={locationType:"LOCATION_INPUT",zipCode:b.$("form#add-zip input[name\x3d'zip']").val().toUpperCase(),deviceType:a,pageType:e.ue_pty,actionSource:"pantry-detail-page"};b.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:f,success:c,error:d})})});a="web";"use strict";c.when("A","atf").execute("pantry-enable-pantry-dp-paw-asset-gate",
function(a){c.declare("enable-pantry-dp-paw-asset",!0)})});
/* ******** */
(function(q){var n=window.AmazonUIPageJS||window.P,t=n._namespace||n.attributeErrors,e=t?t("PantryCDListAssets",""):n;e.guardFatal?e.guardFatal(q)(e,window):e.execute(function(){q(e,window)})})(function(q,n,t){q.when("A","a-dropdown","a-button","pantry-product-tile-utils","pantry-product-tile-quantity","enable-pantry-cd-list-asset","ready").execute(function(e,q,n,r,f,u){var l=e.$;u=r.prefix;var g=r.selectors,c=r.controlClasses,t=r.formUrls,x=r.ajaxUrls;e.declarative(u+"-cdlist-delete","click",function(k){var a=
r.getItemContainerByElement(k.$target);if(n(a.find(g.itemCDListDeleteButton)).isEnabled()){var p=n(a.find(g.itemATCButton));f.getQuantity(a);var b=k.data,m=b.asin,d=b.cdListId;if(d){var h=f.getQuantity(a);f.setQuantity(a,0);f.disableQuantities(a);p.disable();a.addClass(c.cdListExecuting);e.post(x.deleteFromCDListUrl,{params:{asin:m,cdListId:d,quantity:h},success:function(b){if(0===Number(b.status))a.find(g.itemMessaging).html(b.messaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListDeleteSuccess),
l(".p-cdlist-"+d+"-item-count").html(b.itemCountString);else{var v=a.find(g.itemMessaging);a.removeClass(c.cdListExecuting);a.addClass(c.cdListActionError);v.find(g.itemCDListActionError).remove();v.append(b.messaging);e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)}},error:function(b){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+d+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"deleteItem",cdListId:d,asin:m,quantity:h},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});a.append(c);c.submit()}});k.$event.preventDefault()}}});e.declarative(u+"-cdlist-delete-undo","click",function(k){var a=k.data,p=a.quantity,b=r.getItemContainerByElement(k.$target),m=n(b.find(g.itemATCButton)),a=k.data,d=a.asin,h=a.cdListId;h&&(b.addClass(c.cdListUndoingDelete),e.post(x.undoDeleteFromCDListUrl,{params:{asin:d,cdListId:h,quantity:p},success:function(a){if(0===Number(a.status))b.removeClass(c.cdListUndoingDelete),b.removeClass(c.cdListDeleteSuccess),f.enableQuantities(b),
f.setQuantity(b,p),m.enable(),l(".p-cdlist-"+h+"-item-count").html(a.itemCountString);else{var d=b.find(g.itemMessaging);b.removeClass(c.cdListUndoingDelete);b.removeClass(c.cdListDeleteSuccess);b.addClass(c.cdListActionError);d.find(g.itemCDListActionError).remove();d.append(a.messaging);e.delay(function(){b.removeClass(c.cdListActionError);b.addClass(c.cdListDeleteSuccess);f.enableQuantities(b);m.enable()},3E3)}},error:function(a){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+h+'" method\x3d"POST"\x3e\x3c/form\x3e');
e.each({action:"addItem",cdListId:h,asin:d,quantity:p},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});b.append(c);c.submit()}}),k.$event.preventDefault())});e.declarative(u+"-cdlist-move","change",function(k){var a=r.getItemContainerByElement(k.$target),p=n(a.find(g.itemATCButton)),b=f.getQuantity(a),m=a.find(g.itemCDListMoveToSelect),d=q.getSelect(m),h=d.val(),u=m.find('option[value\x3d"'+h+'"]').text();d.update({status:"disabled"});d.setValue("");d.update({status:"normal"});
var m=k.data,v=m.asin,w=m.cdListId;w&&(f.disableQuantities(a),p.disable(),a.addClass(c.cdListExecuting),e.post(x.moveToCDListUrl,{params:{asin:v,cdListId:w,moveToCDListId:h,quantity:b},success:function(b){if(0===Number(b.status)){var d=l(b.messaging);d.find(g.itemCDListMovedTo).html('\x3ca href\x3d"/gp/pantry/yourlists/'+h+'"\x3e'+u+"\x3c/a\x3e");a.find(g.itemMessaging).html(d);a.removeClass(c.cdListExecuting);a.addClass(c.cdListMoveSuccess);f.enableQuantities(a);f.setQuantity(a,0);f.disableQuantities(a);
l(".p-cdlist-"+w+"-item-count").html(b.itemCountString);l(".p-cdlist-"+h+"-item-count").html(b.moveToListItemCountString)}else a.find(g.itemMessaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListActionError),a.find(g.itemMessaging).html(b.messaging),e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)},error:function(c){var d=l('\x3cform action\x3d"'+t.cdListUrl+"/"+w+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"moveItem",cdListId:w,moveToCDListId:h,
asin:v,quantity:b},function(a,b){d.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});a.append(d);d.submit()}}),k.$event.preventDefault())})});"use strict";q.when("A").execute("pantry-enable-pantry-cd-list-asset-gate",function(e){q.declare("enable-pantry-cd-list-asset",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("PantryCPIAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","atf").execute("pantry-enable-pantry-dp-cpi-asset-gate",function(a){c.declare("enable-pantry-dp-cpi-asset",!0)});"use strict";c.when("A","pantry-cpi-atc","enable-pantry-dp-cpi-asset","ready").execute(function(a,b){var d=a.throttle(function(a){b.itemsAddedToCart(a)},2500,{trailing:!1});
a.on("pantryAtcSuccess",function(a){d(a)});a.on("pantryAtcClick",function(a){b.positionBar()});c.when("ewc.app").execute(function(a){a.on("ewc:cartUpdate:success",function(a){d({});b.positionBar()})});b.hideGenericMessage()})});
/* ******** */
(function(d){var h=window.AmazonUIPageJS||window.P,r=h._namespace||h.attributeErrors,c=r?r("PantryCommonUtilsAssets",""):h;c.guardFatal?c.guardFatal(d)(c,window):c.execute(function(){d(c,window)})})(function(d,h,r){d.when("A","a-dropdown","a-button","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-common-utils",function(c,u,v){var f=c.$,m=f(h),l={itemContainer:".p-prod-tile",itemQuantitySelect:".p-prod-tile-quantity-select",itemQuantityDisplay:".p-prod-tile-quantity",itemQuantityInput:".p-prod-tile-quantity-input",
itemButtons:".p-prod-tile-buttons",itemATC:".p-prod-tile-atc",itemPromo:".p-prod-tile-promo",itemInCart:".p-prod-tile-in-cart",itemMessaging:".p-prod-tile-messaging",itemInlineUpsell:".p-prod-tile-inline-upsell",itemMessageOverImg:".p-prod-tile-message-over-img",itemDetail:".p-prod-tile-detail",itemCarousel:".p-prod-tile-carousel",itemCDListActions:".p-prod-tile-cdlist-actions",itemCDListMoveToSelect:".p-prod-tile-cdlist-move-dropdown",itemCDListDeleteButton:".p-prod-tile-cdlist-delete-button",itemCDListMovedTo:".p-prod-tile-cdlist-moved-to",
itemCDListActionError:".p-prod-tile-cdlist-action-error",aoosButton:".p-prod-tile-aoos-button",aoosError:".p-prod-tile-aoos-error"},n=f("body"),p={addToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",deleteFromCDListUrl:"/gp/pantry/ajax/product/delete-item-from-cdlist.html",moveToCDListUrl:"/gp/pantry/ajax/product/move-item-to-cdlist.html",undoDeleteFromCDListUrl:"/gp/pantry/ajax/product/undo-delete-item-from-cdlist.html",updateCDListItemQuantityUrl:"/gp/pantry/ajax/product/change-cdlist-item-quantity.html",
viewSimilarItemsUrl:"/gp/pantry/ajax/product/mobile/get-mobile-aoos-carousel.html",cxVersionErrorMetricUrl:"/gp/pantry/ajax/product/cxVersionErrorMetric.html"},q=function(a,b){b=b||n;return b.find(".p-prod-tile-asin-"+a)},w=function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-type-"))return c.substring(17)}},e=function(a,b,t){var k={tileType:b,mode:t,ref_:"p_prod_tile_atc_"+b};c.each(a,function(a,b){c.each(a,function(a,c){"sessionId"===
c?k[c]=a:"refTag"===c?k.ref_=a:k[b+"."+c]=a})});return k},x=c.state("pantry-strings")||{},g=function(){var a=c.state("cpi_hybrid_pages");if(!a)return!0;var b="excludedPathList"in a?a.excludedPathList:[],t="includedQueryParamList"in a?a.includedQueryParamList:[];if(!("disableHybridPages"in a&&a.disableHybridPages))return!0;var k=h.location.pathname;"/"!==k.substr(-1)&&(k+="/");for(a=0;a<b.length;a++)if(0<=k.indexOf(b[a])){b=h.location.search;for(a=0;a<t.length;a++)if(0<=b.indexOf(t[a]))return!0;return!1}return!0};
return{commonAPI:{$window:m,prefix:"p-prod-tile",resultsContainer:n,ajaxTriggeringOffset:1200,ajaxUrls:p,formUrls:{addToCartUrl:"/gp/pantry/actions/add-items.html",cdListUrl:"/gp/pantry/yourlists"},tileTypes:{CDLIST:"cdlist",LIST:"list",SIMILAR_ITEM:"similarItem",CAROUSEL:"carousel",MOBILE_LIST:"mobile-list",MOBILE_CDLIST:"mobile-cdlist"},atcModes:{SINGLE:"single",MULTI:"multi"},popoverFeatures:{"default":{timeout:5E3},minimumOrderValue:{timeout:1E4},inlineUpsell:{timeout:15E3}},ajaxAddToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",
formAddToCartUrl:"/gp/pantry/actions/add-items.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",dpAddToCartURL:"/gp/pantry/ajax/product/add-to-cart-dp.html",elementTopAboveWindowBottom:function(a,b){a=f(a).offset().top;var c=m.scrollTop()+m.height();b&&(a+=b);return a<=c},elementTopBelowWindowTop:function(a,b){a=f(a).offset().top;var c=m.scrollTop();b&&(a+=b);return a>=c},updateNavCartCount:function(a){a&&h.$Nav&&h.$Nav.when("api.setCartCount").run(function(b){b(a)})},getItemContainersByAsin:q,
getItemContainerByElement:function(a,b){return f(a).closest(l.itemContainer)},getItemContainerType:w,getItemContainerAsin:function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-asin-"))return c.substring(17)}},roundToDecimal:function(a,b){return+parseFloat(a).toFixed(b)||0},createParamsForAjaxHandler:e,extendParamsForAjaxHandler:function(a,b,c,k){b=e(b,c,k);b.isAddAnother=a;return b},updateUrlParameters:function(a,b){c.each(b,function(b,
c){var e=new RegExp("([?\x26])"+c+"\x3d[^\x26#]*");a=a.match(e)?a.replace(e,"$1"+c+"\x3d"+b):a+((-1===a.indexOf("?")?"?":"\x26")+c+"\x3d"+b)});return a},submitToFormHandler:function(a){var b={"submit.addToCart":"addToCart",ref_:"p_prod_tile_atc_form"},e=f('\x3cform action\x3d"/gp/pantry/actions/add-items.html" method\x3d"POST"\x3e\x3c/form\x3e'),k=1;c.each(a,function(a,c){b["offeringID."+k]=a.offeringId;b["pantryRegion."+k]=a.pantryRegion;b["quantity."+k]=a.quantity;b["asin."+k]=c;b["session-id"]=
a.sessionId;b["anti-csrftoken-a2z"]=a.csrftoken;k++});c.each(b,function(a,b){e.append(f('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});n.append(e);e.submit()},disableCDListActions:function(a){var b=u.getSelect(a.find(l.itemCDListMoveToSelect));b&&b.update({status:"disabled"});(a=v(a.find(l.itemCDListDeleteButton)))&&a.disable()},enableCDListActions:function(a){var b=u.getSelect(a.find(l.itemCDListMoveToSelect));b&&b.update({status:"normal"});(a=v(a.find(l.itemCDListDeleteButton)))&&a.enable()},
getTileTypesByAsin:function(a){var b={};q(a).each(function(a,c){a=w(c);b[a]=!0});var e=[];c.each(b,function(a,b){e.push(b)});return e},getString:function(a){return x[a]},addATCHanlder:function(a){c.on("pantryTileItemATCSuccess",a)},logCXVersionError:function(a){c.post(p.cxVersionErrorMetricUrl,{cache:!1,params:{tileType:a}})},showCPIWidget:function(){d.when("pantry-cpi-mobile-message-provider").execute(function(a){g()&&a.showCPIWidget()})},isValidUrlForCPI:g,getActionUrl:function(a,b,e){return a+
"?"+c.$.param({ref_:b,"discoveredAsins.0":e})}},selectors:l,controlClasses:{itemZero:"p-prod-tile-zero",atcExecuting:"p-prod-tile-atc-executing",atcSuccess:"p-prod-tile-atc-success",inuSuccess:"p-prod-tile-inu-success",cdListExecuting:"p-prod-tile-cdlist-executing",cdListDeleteSuccess:"p-prod-tile-cdlist-delete-success",cdListActionError:"p-prod-tile-cdlist-action-error",cdListUndoingDelete:"p-prod-tile-cdlist-undoing-delete",cdListUndoError:"p-prod-tile-cdlist-delete-undo-error",cdListMoveSuccess:"p-prod-tile-cdlist-move-success",
aoosViewSimilarToggle:"p-prod-tile-aoos-view-similar-toggle",aoosCollapsed:"p-prod-tile-aoos-collapsed",aoosExpanded:"p-prod-tile-aoos-expanded",aoosSlidedOut:"p-prod-tile-aoos-slidedOut",aoosExecuting:"p-prod-tile-aoos-executing",aoosSuccess:"p-prod-tile-aoos-success"}}});"use strict";d.when("A","enable-pantry-common-utils-asset").register("pantry-product-tile-metrics",function(c){return{addCounter:function(c){var d=h.ue;"undefined"!==typeof d&&d.count(c,1)}}});"use strict";d.when("A","pantry-product-tile-utils",
"pantry-product-tile-atc-base","a-popover","enable-pantry-common-utils-asset","ready").execute(function(c,d,h,f){var m=c.$,l=m("body");c.declarative("mini-dp-sims-select","click",function(c){c.$currentTarget.parent().find("img").removeClass("current");c.$target.addClass("current");var e=c.data;c=e.asin;var e=e.primaryAsin,d=document.getElementsByClassName("p-prod-tile-mini-dp-details-row-primary-"+e),g=document.getElementsByClassName("p-prod-tile-mini-dp-details-"+e+"-"+c),d=d[0],g=g[0];m(".p-prod-tile-mini-dp-box-fill-confirmation-"+
e+"-"+c).removeClass("p-prod-tile-mini-dp-percent-section-show");d.innerHTML=g.innerHTML});var n=function(h){var e={"submit.addToCart":"addToCart",ref_:"p-mini-dp-form"},f=m('\x3cform action\x3d"'+d.formAddToCartUrl+'" method\x3d"POST"\x3e\x3c/form\x3e'),g=1;c.each(h,function(a,b){e["offeringID."+g]=a.offeringId;e["pantryRegion."+g]=a.pantryRegion;e["quantity."+g]=a.quantity;e["asin."+g]=b;e["session-id"]=a.sessionId;g++});c.each(e,function(a,b){f.append(m('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});l.append(f);f.submit()},p=function(d){var e={ref_:"p-mini-dp"};c.each(d,function(d,g){c.each(d,function(a,b){"sessionId"===b?e[b]=a:e[g+"."+b]=a})});return e},q=function(c){n(c)};c.declarative("p-prod-tile-mini-dp-atc","click",function(f){var e=f.data,l=f.$target.closest("form");d.getItemContainerByElement(l);var g=e.asin,a={};f.$event.preventDefault();e.quantity=1;a[g]=e;c.post(d.miniDpaddToCartUrl,{params:p(a),success:function(b){var c=b.pantryBox,e=b.cartCount,f=b.itemMessagings,l=
b.wayfinderBoxHtml,p=b.enableWayfinderSavingInfo,q=b.pantrySavingInfo,r=b.wayfinderSavingHtml;!b.error&&c&&e&&l?(b=".p-prod-tile-mini-dp-atc-confirm-"+a[g].primaryAsin+"-"+g,p?h.updateWayfinderSavingInfo(q,r):h.updateWayfinder(c,l),d.updateNavCartCount(e),m(b).addClass("p-prod-tile-mini-dp-atc-confirm-success"),c=".p-prod-tile-mini-dp-box-fill-confirmation-"+a[g].primaryAsin+"-"+g,f=f[g],m(c).html(f),m(c).addClass("p-prod-tile-mini-dp-percent-section-show")):n(a)},error:function(){"undefined"!==typeof q&&
n(a)}})})});"use strict";d.when("A","pantry-product-tile-utils","enable-pantry-common-utils-asset","ready").execute(function(c,d){var h=c.$,f=d.prefix;c.declarative(f+"-similar-pagination","click",function(d){var l=function(c){c=h(c);p.empty().append(c);p.css("opacity",1)},n=d.$target.closest("li"),p=n.closest(".a-pagination").closest("."+f+"-popover-content");d.$event.preventDefault();d.$event.stopPropagation();n.hasClass("a-disabled")||n.hasClass("a-selected")||(d=n.find("a").attr("href"),p.css("opacity",
.5),c.get(d,{success:l}));return!1})});"use strict";d.when("A","pantry-product-tile-common-utils","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-utils",function(c,d){return c.$.extend({selectors:d.selectors,controlClasses:d.controlClasses},d.commonAPI)});"use strict";d.when("A").execute("pantry-enable-pantry-common-utils-asset-gate",function(c){d.declare("enable-pantry-common-utils-asset",!0)})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,q=e._namespace||e.attributeErrors,a=q?q("PantryDetailPageATCAssets",""):e;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,e,q){g.when("A","a-button","inlinue-upsell-util","pantry-inu-atc-base","atf").execute(function(a,e,h,f){var l=0;g.when("pantry-wayfinder-cpi-util").execute(function(a){l=a.shouldUpdateCPI()});var m=function(){g.when("pantry-wayfinder-cpi-util").execute(function(a){a.updateCPI()})},n=function(d){var c=
{ref_:h.refTag};f.isRecommendationVisible()||(c.sendUpsellRecommendations=1);c.triggerINUWeblab=1;a.each(d,function(b,d){a.each(b,function(b,a){"session-id"===a||"sessionId"===a||"verificationSessionID"===a?c.sessionId=b:"refTag"===a?c.ref_=b:c[d+"."+a]=b})});return c},p=function(d){var c={};a.each(d.serializeArray(),function(b){"ASIN"===b.name||"a"===b.name?c.asin=b.value:"quantity"===b.name?(b=parseInt(b.value,10),isNaN(b)&&(b=1),c.quantity=b):"offerListingID"===b.name||"oid"===b.name?c.offeringId=
b.value:c[b.name]=b.value});d={};d[c.asin]=c;return n(d)},k=function(d){a.$("form#addToCart").unbind("submit").submit()};a.declarative("pantry-inu-click","click",function(a){var c=a.data.ref.substring(a.data.ref.lastIndexOf("ref\x3d")+4,a.data.ref.lastIndexOf("?"));f.logINUNexusMessage("click",c,a.data.text)});h.initATCHandler(function(d){a.trigger("pantryAtcClick",d);a.$("#pantryInlineUpsellWrapper");d.preventDefault();d=a.$(this);var c=e("#submit\\.add-to-cart");c.disable();a.ajax(h.getActionUrl(h.dpAddToCartURL,
h.refTag,h.getASIN()),{method:d.attr("method"),cache:!1,params:p(d),success:function(b){var d=b.cartCount,r=b.enableInlineUpsell;!b.error&&d&&r&&(f.isRecommendationVisible()||b.upsellRecommendations)?(f.showConfirmation(),f.showRecommendation(b.upsellRecommendations,b.enableNexusLog),f.updateNavbarCartCount(d),f.updateFreeShipping(),l&&m(),h.successHandler(b),a.trigger("pantryAtcSuccess",b)):k(b);c.enable()},error:function(a){c.enable();k(a)}})})});"use strict";g.when("A","pantry-product-tile-common-utils",
"atf","pantry-page","enable-pantry-dp-atc-asset").register("inlinue-upsell-util",function(a,e){return a.$.extend({refTag:"pantry_dp_bb_inu",getASIN:function(){return a.$("#ASIN").val()},successHandler:function(h){var f=a.$("#wayfinder-message-provider-wrapper"),e=a.$(".pantry-wayfinder-sticky-bar");!f.length&&e.length&&a.$("html, body").animate({scrollTop:a.$("#addToCart").offset().top-e.height()-18},1E3);g.when("pantry-wayfinder-box-info").execute(function(a){a.setBoxInfo(h.pantryBox);a.updateBoxDisplay(h.wayfinderBoxHtml)})},
initATCHandler:function(e){a.ajax("/gp/pantry/cart/json?nextPage\x3dgetActivePantryCartQuantity",{method:"GET",success:function(f){0<f.getActivePantryCartQuantity&&a.$("form#addToCart").unbind("submit").submit(e)}})}},e.commonAPI)});"use strict";g.when("A","a-button","inlinue-upsell-util","atf").register("pantry-inu-atc-base",function(a,g,h){var f=function(){return a.$("#pantryInlineUpsellWrapper").is(":visible")},l=function(a,b,d,e){b<d&&a.clone().appendTo(".inu-list");a.html(e.textToShow);a.attr("href",
e.URL);a.attr("title",e.textToShow)},m=function(a,b,d,e,f){d<e&&(b.clone().appendTo(".inu-list"),a.clone().appendTo(".inu-list"));e={ref:f.URL,text:f.textToShow};b.attr("data-action","pantry-inu-click");b.attr("data-pantry-inu-click",JSON.stringify(e));b.attr("id","pantry-inu-click-"+d);a.appendTo(b.find("#pantry-inu-link"));a.html(f.textToShow);a.attr("href",f.URL);a.attr("title",f.textToShow)},n=0,p=function(c,b,d){n&&(c={pageType:"Detail",subPageType:"InlineUpsell",eventData:JSON.stringify({pageType:"Detail",
pageWidget:"InlineUpsell",uiAction:c,itemDescription:b,advertisementId:d})},a.post("/gp/pantry/ajax/log-nexus-message.html",{params:c}))},k=function(a,b,d){e.ueLogError&&e.ueLogError(a,{logLevel:"ERROR",attribution:b,message:d})},d=function(c,b){if(!f()){var d=h.getASIN(),e=a.$("#pantry-inu-action"),g=a.$(".inu-item");c=c[d];var k=c.length-1;a.$.each(c,function(c,d){1===b&&null!==e?(m(g,e,c,k,d),e=a.$("#pantry-inu-action:last")):l(g,c,k,d);g=a.$(".inu-item:last")});n=b;p("PageUpdate",d,"");a.$("#pantryInlineUpsellWrapper").slideDown()}};
return{updateNavbarCartCount:function(a){a&&e.$Nav&&e.$Nav.when("api.setCartCount").run(function(b){b(a)})},updateFreeShipping:function(){a.ajax("/gp/pantry/wayfinder/free-shipping-promo-bar.html",{cache:!1,method:"get",success:function(c){c.trim()&&a.$("#pantry-wayfinder-free-shipping-promo-bar").html(c)}})},isRecommendationVisible:f,appendRecommendation:l,appendRecommendationWithAction:m,logINUNexusMessage:p,showRecommendation:function(a,b){try{d(a,b)}catch(e){k(e,"PantryInlineUpsell","Show recommendation failed on Desktop or Mobile DP:")}},
showConfirmation:function(){var c=a.$("#pantry-inu-confirmation");c&&c.show()},logError:k,doShowRecommendation:d}});"use strict";g.when("A","atf").execute("pantry-enable-pantry-dp-atc-asset-gate",function(a){g.declare("enable-pantry-dp-atc-asset",!0)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("PantryDetailPageCommonAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","atf").execute("pantry-page-detector",function(a){(a.$("#pantryStoreInfo_feature_div").text()||a.$("#pantryBuyBox_feature_div").length||a.$(".a-declarative[data-action\x3d'aw-mash-pantry']").length)&&b.declare("pantry-page",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageSoftlinesPSSAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageSoftlinesPDPAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(g){var d=window.AmazonUIPageJS||window.P,r=d._namespace||d.attributeErrors,a=r?r("FreshDetailPageCommonAssets",""):d;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,d,r){g.when("A","jQuery","a-modal","afx-dp-uatc-proxy","afx-update-cart-count","a-dropdown","fresh-dp-double-click","afx-dp-csm-metrics-utils","fresh-show-atc-changeover","fresh-dp-quantity","afx-utils","ready").register("fresh-atc-handler",function(a,f,n,c,d,q,m,b,h,u,e){var p;g.when("EWC").execute(function(b){p=
b});g.when("nav.getFlyout").execute(function(b){b("ewc")});var F={"itemPrice:priceUnavailable:1":"PRICE_UNAVAILABLE","itemDeleted:itemCountOverflow:6":"QUANTITY_OVERFLOW"};return{addToFreshCart:function(q){function l(b,a,f,e){w(b);q.error(b,a,f,e)}function w(e,c){c=c||{};var d=e.data.sessionID;c.title=D(e.data.title);c.asin=e.data.asin;c.offerListingID=e.data.offerListingID;c.sessionID=d;switch(c.reasonCode?c.reasonCode:r){case t.itemNotAvailable:b.increment(k.freshUATCItemNotAvailableErrorCountMetric);
break;case t.itemPartiallyAvailable:b.increment(k.freshUATCItemPartiallyAvailableErrorCountMetric);break;case t.itemPartiallyAvailableForReservation:b.increment(k.freshUATCItemPartiallyAvailableForReservationErrorCountMetric);break;case t.itemNotAvailableForReservation:b.increment(k.freshUATCItemNotAvailableForReservationErrorCountMetric);break;case t.itemPriceUnavailable:b.increment(k.freshUATCItemPriceUnavailableErrorCountMetric);break;case t.itemCountOverflow:b.increment(k.freshUATCItemCountOverflowErrorCountMetric);
break;default:b.increment(k.freshUATCEmptyItemStatusCodeErrorCountMetric),g.log("fresh-atc-handler: No error status code.","ERROR")}c=f.param(c);n.create(e.$currentTarget,{name:"fresh-add-to-cart-modal",sessionID:d,url:"/afx/cart/reservation_conflict?"+c}).show();a.on("a:popover:afterHide:fresh-add-to-cart-modal",function(b){E(d);n.remove(b.popover)})}function D(b){var a={"\x26amp;":"\x26"},e;for(e in a)a.hasOwnProperty(e)&&(b=b.replace(e,a[e]));return b}function C(b){return b.filter(function(b){return b.statusKey in
F})}function x(b,a,e){e+=" returned by UATC is not an array";g.log(e,"Error",a);l(b,"","",e)}function y(e,f,d){d||(d=function(){});try{var n=e.data.asin;if(n)if(e.data.title){var h=e.data.offerListingID;if(h){var q=e.data.sessionID;if(q){var m=u.val();m||(g.log('fresh-atc-handler: "quantity" action parameter is missing.',"ERROR"),m=1);b.setWidgetClickTimestamp(k.freshUATCTCallScope);c({asin:n,offerListingID:h,sessionID:q,quantity:m,reftag:"afx-dp-addtocart",success:function(c){try{b.sendWidgetMetrics(k.freshUATCTCallScope);
var n;if(c&&c.isOK){var h=c.extraErrorInfos;if(h&&h.constructor===Array&&0<h.length)n=!0;else{var u=c.statusList,z;if(u&&u.constructor===Array&&0<u.length){var A=C(u);z=A&&0<A.length}else z=!1;n=z?!0:!1}}else n=!0;if(n)if(b.increment(k.freshUATCInvalidErrorResponseCountMetric),c)if(c.isOK){var t=c.extraErrorInfos,p=c.statusList;if(t&&t.constructor!==Array)x(e,t,"extraErrorInfos");else if(0<t.length){if(t&&!(0>=t.length)){var v=t[0];"ADDRESS_NOT_SELECTED"===v.statusCode?(b.increment(k.freshUATCAddressNotSelectedErrorCountMetric),
g.log("fresh-atc-handler: Address is not selected.","INFO")):w(e,{reasonCode:v.itemStatusCode,quantityAdded:v.availableQuantity,quantityRequested:v.requestedQuantity})}}else if(p&&p.constructor!==Array)x(e,p,"statusList");else if(0<p.length&&p&&!(0>=p.length)){var r=C(p);r&&0<r.length&&w(e,{reasonCode:F[r[0].statusKey]})}}else b.increment(k.freshUATCFailureCountMetric),l(e,"","","isOK returned by UATC is false");else b.increment(k.freshUATCFailureCountMetric),l(e,"","","No response from UATC");else b.increment(k.freshUATCSuccessCountMetric),
f(c,q,m)}catch(y){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+y,"ERROR")}finally{a.delay(d,B.reEnableDelay)}},error:function(c,f,n){try{b.sendWidgetMetrics(k.freshUATCTCallScope),b.increment(k.freshUATCFailureCountMetric),l(e,c,f,n)}catch(h){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+h,"ERROR")}finally{a.delay(d,B.reEnableDelay)}}})}else g.log('fresh-atc-handler: Required "sessionID" action parameter is missing.',
"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e)}else g.log('fresh-atc-handler: Required "offerListingID" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e)}else g.log('fresh-atc-handler: Required "title" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e);else g.log('fresh-atc-handler: Required "asin" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),
l(e)}catch(z){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+z,"ERROR"),a.delay(d,B.reEnableDelay)}}function E(b){p&&"function"===typeof p.refresh?p.refresh():d(b)}var B={reEnableDelay:1E3},k={freshAddToCartClickCountMetric:"freshAddToCartClickCount",freshAddToCartMissingParameterCountMetric:"freshAddToCartMissingParameterCount",freshAddToCartExceptionCountMetric:"freshAddToCartExceptionCount",freshUATCTCallScope:"freshUATCCall",freshUATCSuccessCountMetric:"freshUATCSuccessCount",
freshUATCFailureCountMetric:"freshUATCFailureCount",freshUATCInvalidErrorResponseCountMetric:"freshUATCInvalidErrorResponseCount",freshUATCAddressNotSelectedErrorCountMetric:"freshUATCAddressNotSelectedErrorCount",freshUATCItemPartiallyAvailableErrorCountMetric:"freshUATCItemPartiallyAvailableErrorCount",freshUATCItemPartiallyAvailableForReservationErrorCountMetric:"freshUATCItemPartiallyAvailableForReservationErrorCount",freshUATCItemNotAvailableErrorCountMetric:"freshUATCItemNotAvailableErrorCount",
freshUATCItemNotAvailableForReservationErrorCountMetric:"freshUATCItemNotAvailableForReservationErrorCount",freshUATCEmptyItemStatusCodeErrorCountMetric:"freshUATCEmptyItemStatusCodeErrorCount",freshUATCItemPriceUnavailableErrorCountMetric:"freshUATCItemPriceUnavailableErrorCount",freshUATCItemCountOverflowErrorCountMetric:"freshUATCItemCountOverflowErrorCount"},t={itemNotAvailable:"ITEM_NOT_AVAILABLE",itemPartiallyAvailable:"ITEM_PARTIALLY_AVAILABLE",itemPartiallyAvailableForReservation:"ITEM_PARTIALLY_AVAILABLE_FOR_RESERVATION",
itemNotAvailableForReservation:"ITEM_NOT_AVAILABLE_FOR_RESERVATION",itemPriceUnavailable:"PRICE_UNAVAILABLE",itemCountOverflow:"QUANTITY_OVERFLOW"},z=function(b,e,a){h(a);E(e);q.success(b)};a.declarative("fresh-atc-handler","click",m(function(a,c){u.valid()?(e.vibrate(),b.increment(k.freshAddToCartClickCountMetric),y(a,z,c)):c()}))}}});"use strict";g.when("A","jQuery","a-button","fresh-show-atl-changeover","ready").register("FreshAddToShoppingList",function(a,f,d,c){function A(b){f("#"+b.asin+"-afx-atl-dropdown").change(function(a){b.$alreadyInMessage.addClass("aok-hidden");
b.$errorMessage.addClass("aok-hidden")})}function q(b){var f=(a.state("baseWidgetState")||{}).csrfToken;a.post("/afx/lists/json/shoppinglists/additem",{cache:!1,timeout:5E3,params:{asin:b.asin,listID:b.shoppingListID,token:f},success:function(a){b.addButtonInstance.enable();a.successful?(b.$modalParent.find("#"+b.cancelButtonID).click(),c()):1===a.errorCodes[0]?b.$alreadyInMessage.removeClass("aok-hidden"):m(b)},error:function(){b.addButtonInstance.enable();m(b)}})}function m(b){b.$errorMessage.removeClass("aok-hidden");
g.log("Failed to add asin "+b.asin+" to shopping list "+b.shoppingListID,"ERROR")}a.declarative("add-to-list","click",function(b){var a=b.$currentTarget.closest(".a-popover-wrapper");if(1>a.length)g.log("Could not find the element that parents this modal (it should contain class a-popover wrapper)","FATAL");else{var c=a.find("#"+b.data.addButtonID),e;1>c.length?(g.log("Could not find the button that will add the item. This is required for preventing double clicks","ERROR"),e=!1):b.data.asin?e=!0:
(g.log("ASIN was blank. Please supply the ASIN you wish to add to the list.","ERROR"),e=!1);e&&(c=d(c),c.isEnabled()&&(c.disable(),b={asin:b.data.asin,addButtonInstance:c,$modalParent:a,cancelButtonID:b.data.cancelButtonID,shoppingListID:a.find("#"+b.data.asin+"-afx-atl-dropdown").val(),$alreadyInMessage:a.find("#afx-atl-already-in"),$errorMessage:a.find("#afx-atl-service-error")},b.$alreadyInMessage.addClass("aok-hidden"),b.$errorMessage.addClass("aok-hidden"),A(b),q(b)))}})});"use strict";g.when("A",
"jQuery","fresh-add-to-cart","fresh-dp-quantity","fresh-show-atc-changeover").execute(function(a,f,d,c,A){d.addToFreshCart({success:function(a,c){A(a.data.renderableSellingQuantity?a.data.renderableSellingQuantity:a.data.quantity);a=c.couponClipStatus;if("CLIP_SUCCESSFUL"===a||"ALREADY_CLIPPED"===a)f("#unclippedCoupon").hide(),f("#clippedCoupon").show()},error:function(a,c,b,f){}});c.init();a.on("a:pageUpdate",function(){c.init();d.updateQuantity("freshAddToCartButton",c.val())});d.updateQuantity("freshAddToCartButton",
c.val());a.declarative("freshDetailPageQuantityUpdate","change",function(a){d.updateQuantity("freshAddToCartButton",c.val())});g.when("fresh-atfc-hook").execute(function(a){a.callback()})});g.when("A","jQuery","a-dropdown","fresh-dp-constants","fresh-add-to-cart","a-button").register("fresh-dp-quantity",function(a,f,d,c,g,q){return function(){var m,b,h,u,e,p,r,v,l,w,D,C,x,y=function(){if(!m){b=f(c.addToCartButtonSelector);e=d.getSelect(c.dropdownID);if(h=!!e){u=f(c.dropdownDivSelector);var a=e.getOptions().size();
a&&(r=a-1)}v=f(c.freeTextDivSelector);if(p=0!==v.length)l=f(c.freeTextInputSelector),w=f(c.freeTextErrorDivsSelector),D=f(c.freeTextErrorMsgMin),C=f(c.freeTextErrorMsgMax)}},E=function(){a.on(c.dropdownSelectedID,function(a){f(a.nativeItemNode).index()===r?(l.attr("validValue",x),l.val(x),v.show(),w.hide(),u.hide(),l.focus().select(),e.val("1")):x=e.val()});var d=function(){var a=l.attr("validValue");a&&(e.val(a),e.val()===a?(x=a,u.show(),v.hide()):(g.updateQuantity("freshAddToCartButton",a),b.focus()))},
n=function(){var a=B(l.val());l.attr("validValue",a?a:"")};l.change(n);l.keyup(n);l.keypress(function(a){if(0===a.which||8===a.which||a.ctrlKey||a.altKey||c.rxNumbersOnly.test(String.fromCharCode(a.which)))return!0;13===a.which&&(d(),b.click());return!1});l.blur(d)},B=function(){var a;a:{a=l.val();if(c.rxNumbersOnly.test(a)&&(a=parseInt(a,10),!isNaN(a)))break a;a=!1}w.hide();var b=q(c.addToCartButtonSelector);if(!1===a||0>=a)D.show(),b.isEnabled()&&b.disable();else if(1E3<=a)C.show();else return b.isEnabled()||
b.enable(),String(a);return!1};return{init:function(){m=!1;y();m=!0;if(p){v.hide().removeClass(c.auiHiddenClass);w.hide().removeClass(c.auiHiddenClass);var a=e.getOption(r),b=a.info()[0].text;a.update({value:"0",text:f.trim(b)+"+"});x=e.val();E()}},valid:function(){y();return p&&v.is(":visible")?!1!==B():!0},val:function(){y();return p&&v.is(":visible")?l.attr("validValue"):h?e.val():1}}}()});g.register("fresh-dp-constants",function(){return{actionPanelStateData:"apstate",actionPanelFreshState:"fresh",
mobileNavSearchFormSelector:'#nav-search-form, form[role\x3d"search"], #searchForm',rxNumbersOnly:/^\d+$/,auiHiddenClass:"aok-hidden",addToCartButtonSelector:"#freshAddToCartButton",dropdownID:"freshQuantity",dropdownSelectedID:"a:dropdown:selected:freshQuantity",dropdownDivSelector:"#quantitySelect",freeTextDivSelector:"#quantityText",freeTextInputSelector:"#quantityTextInput",freeTextErrorDivsSelector:"#quantityTextErrors \x3e div",freeTextErrorMsgMin:"#quantityFreeTextErrorMsgMin",freeTextErrorMsgMax:"#quantityFreeTextErrorMsgMax"}});
g.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,f){a.on("a:expander:ingredients-expander:toggle:expand",function(a){f.increment("almIngredientsExpand")});a.on("a:expander:ingredients-expander:toggle:collapse",function(a){f.increment("almIngredientsCollapse")})});g.when("A","ready").register("fresh-dp-prevent-atc-default",function(a){return{init:function(){a.$("#addToFreshCart").submit(function(a){a.preventDefault()})}}});"use strict";g.when("A","jQuery","a-button","ready").register("fresh-multiselleroffers-pagination-handler",
function(a,f,d){function c(a){var e=parseInt(m.attr("data-currentPage"),10),c=parseInt(m.attr("data-pageCount"),10),e="next"===a?e+1:e-1;m.attr("data-currentPage",e);0===e?b.disable():b.enable();e===c-1?h.disable():h.enable();f(".freshMultiSellerOffer").addClass("hidden");f('.freshMultiSellerOffer[data-page\x3d"'+e+'"]').removeClass("hidden")}var g=f("#freshMultiSellerOffersPreviousPage"),q=f("#freshMultiSellerOffersNextPage"),m=f("#freshMultiSellerOffersPagination"),b=d(g),h=d(q);a.declarative.create(g,
"fresh-multiselleroffers-previous-page",{});a.declarative.create(q,"fresh-multiselleroffers-next-page",{});a.declarative("fresh-multiselleroffers-previous-page","click",function(a){b.isEnabled()&&c("previous")});a.declarative("fresh-multiselleroffers-next-page","click",function(a){h.isEnabled()&&c("next")})});"use strict";g.when("A").register("afx-dp-uatc-proxy",function(a){return function(f){var d="/gp/add-to-cart/json";f.reftag!==r&&(d+="/ref\x3d"+f.reftag);a.post(d,{timeout:5E3,params:{"session-id":f.sessionID,
clientName:"SharedFreshHandler",nextPage:"cartitems",ASIN:f.asin,offerListingID:f.offerListingID,useUber:"1",source:"Fresh",ruleSet:"FreshGet",quantity:f.quantity},success:f.success,error:f.error})}});"use strict";g.when("A").register("afx-dp-get-cart-count",function(a){return function(f){a.get("/gp/api/cart/1.0/get-cart-count.json",{timeout:5E3,params:{sessionID:f.sessionID,clientName:"sharedFreshHandler"},success:f.success,error:f.error})}});"use strict";g.when("A").register("afx-dp-get-cart-item-count",
function(a){return function(a,d){if(d&&d.items){var c;for(c=0;c<d.items.length;++c){var g=d.items[c];if(g&&g.ASIN===a)return g.quantity}}}});"use strict";g.register("afx-dp-csm-metrics-utils",function(){return{setWidgetClickTimestamp:function(a){d.ue&&d.uet&&a&&d.uet("bb",a,{wb:1})},setWidgetTimestamp:function(a,f){d.ue&&d.uet&&a&&f&&d.uet(a,f,{wb:1})},increment:function(a){d.ue&&d.ue.count&&a&&d.ue.count(a,(d.ue.count(a)||0)+1)},setCount:function(a,f){d.ue&&d.ue.count&&a&&f&&d.ue.count(a,f)},sendWidgetMetrics:function(a){d.ue&&
d.uex&&a&&d.uex("ld",a,{wb:1})}}});"use strict";g.when("A","jQuery","a-button","ready").register("fresh-dp-double-click",function(a,d,g){return function(c){var d={disabled:"true"},f={};return function(g){var b=a.state("fresh-atc-status");b&&b.disabled||(b&&a.state("fresh-atc-status",d),c(g,function(){(b=a.state("fresh-atc-status"))&&a.state.replace("fresh-atc-status",f)}))}}});"use strict";g.register("afx-utils",function(){return{isFunction:function(a){return"function"===typeof a},isDefined:function(a){return"undefined"!==
typeof a},vibrate:function(){return d.amazon&&d.amazon.cordova&&d.amazon.cordova.notification&&d.amazon.cordova.notification.vibrate&&d.amazon.cordova.notification.vibrate(50)}}});"use strict";g.when("A","jQuery","fresh-show-atl-changeover","afx-dp-csm-metrics-utils","ready").register("FreshAddToAlexaLists",function(a,f,n,c){function r(a){c.increment(h.countAddToAlexaList);c.setWidgetClickTimestamp(h.addToAlexaListCallTime);q(a);f.ajax({url:a.data.url,type:"POST",contentType:"application/json",Accept:"application/json",
timeout:5E3,dataType:"json",data:JSON.stringify({value:b(a)}),headers:{"x-amzn-as-metadata":"{}"},success:function(b){c.sendWidgetMetrics(h.addToAlexaListCallTime);c.increment(h.addToAlexaListCallSuccess);n();m(a)},error:function(b,f,n){c.sendWidgetMetrics(h.addToAlexaListCallTime);c.increment(h.addToAlexaListCallFail);g.log("Error response: "+b.responseText,"ERROR");b.status===u?a&&a.data&&a.data.signInURL&&(d.location=a.data.signInURL):g.log("Failed to add item to shopping list "+a.data.title+", url : "+
a.data.url,"ERROR");m(a)}})}function q(a){a.$currentTarget.find(".afx-dp-add-to-alexa-list-link").addClass("aok-hidden");a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-spinner").removeClass("aok-hidden")}function m(a){a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-spinner").addClass("aok-hidden");a.$currentTarget.find(".afx-dp-add-to-alexa-list-link").removeClass("aok-hidden")}function b(a){a=a.data.title;return a.substring(0,Math.max(a.length,256))}a.declarative("add-to-alexa-lists",
"click",function(a){m(a);r(a)});var h={countAddToAlexaList:"countAddToAlexaList",addToAlexaListCallTime:"addToAlexaListCallTime",addToAlexaListCallSuccess:"addToAlexaListCallSuccess",addToAlexaListCallFail:"addToAlexaListCallFail"},u=401})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageSellerProfileDesktopAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("seller-profile-treatment",function(){return"C"})});
/* ******** */
(function(a){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,c=d?d("DetailPageAToZGuaranteeAssets",""):b;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,b,d){a.when("A").register("atoz-csm-counters",function(c){var a=function(a){return ue.count(a)||0},b=function(a,b){ue.count(a,b)};return{getCounter:a,setCounter:b,incrementCounter:function(c,d){d=d||1;b(c,a(c)+d)}}})});
/* ******** */
(function(a){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,b=k?k("WestlakeAssets",""):f;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,f,k){a.when("A").register("alw-asin-impression",function(b){var a={};b.on("skycity-image-loaded",function(){for(var e=document.getElementsByClassName("skycity-alw-item-container"),h=[],c=e.length,d=0;d<c;d++){var g=e[d].getElementsByClassName("a-link-normal");0<g.length&&"undefined"!==typeof g[0].href&&
(g=g[0].href.split("/dp/")[1].split("/")[0],10===g.length&&g===g.toUpperCase()&&h.push(g))}if(0<h.length&&f.ue){e=[];for(c=0;c<h.length;c++)d=h[c],"undefined"===typeof a[d]&&(e.push({id:d}),a[d]=!0);0<e.length&&(f.ue.impression({programGroup:"brightbuy",impressionType:"asin",impressionData:[{featureName:"alw-dt",resources:e}],foresterChannel:"action-impressions"}),b.trigger("skycity-asin-impression-sent"))}})});"use strict";a.when("A","jQuery").register("alw-delay-load-images",function(b,f){function e(){if(null!==
document.getElementById("skycity-soft-merge"))for(var a=document.querySelectorAll(".skycity-image-html"),c=0;c<a.length;c++){var d=f(a[c]);d.hasClass("skycity-image-loaded")||(a[c].insertAdjacentHTML("afterend",a[c].getAttribute("data-html")),d.addClass("skycity-image-loaded"))}b.trigger("skycity-image-loaded")}b.on("a:pageUpdate",e);a.when("atf").execute("alw-load-images",e)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageInteractiveBadgesAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("interactive-badges-treatment",function(){return"C"})});
/* ******** */
(function(f){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,b=h?h("DetailPageFluxComponents",""):g;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,g,h){f.when("dp-flux-utils").register("dp-flux-action",function(b){function e(d,a,c){if(b.isNonEmptyString(d)&&b.isNonEmptyString(a))this._name=d,this._source=a,this._metadata=c;else throw Error("Action(...): Action must be created with valid name and source");}e.prototype={getName:function(){return this._name},
getSource:function(){return this._source},getMetaData:function(){return this._metadata}};return e.prototype.constructor=e});f.when("dp-flux-utils").register("dp-flux-attribution",function(b){function e(d,a,c,k){if(b.isNonEmptyString(d)&&b.isNonEmptyString(a)&&b.isNonEmptyString(c)&&b.isNonEmptyString(k))this._name=d,this._category=a,this._type=c,this._item=k;else throw Error("All parameters (name, categoty, type, item) must be a non-empty string");}e.prototype={getName:function(){return this._name},
getAttribution:function(){return"name: "+this._name+"; CTI\x3d "+this._category+"/"+this._type+"/"+this._item}};return e.prototype.constructor=e});f.when("A","dp-flux-action","dp-flux-attribution").register("dp-flux-dispatcher",function(b,e,d){function a(){this._callbacks={};this._isDispatching=!1;this._pendingAction=null;this._lastID=1}var c=b.$;a.prototype={register:function(a,b){if(!(a instanceof d))throw Error("Dispatch.register(...): attribution must be instance of Attribution");if(!c.isFunction(b))throw Error("Dispatch.register(...): callback must be a function");
var e="ID_"+this._lastID++;this._callbacks[e]={attribution:a,callback:b,_isCallbackExecutionStarted:!1,_isCallbackExecutionCompleted:!1};return e},unregister:function(a){if(this._callbacks[a])delete this._callbacks[a];else throw Error("Dispatcher.unregister(...): "+a+" does not map to a registered callback");},dispatch:function(a){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch");if(!(a instanceof e))throw Error("Dispatch.dispatch(...): action param must be of type Action");
this._startDispatching(a);for(var c in this._callbacks)this._callbacks[c]._isCallbackExecutionStarted||this._invokeCallback(c);this._stopDispatching()},waitFor:function(a){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching");if(!c.isArray(a))throw Error("Dispatcher.waitFor(...): dispatchTokenList must be an array");for(var b=0;b<a.length;b++){var d=a[b];if(!this._callbacks[d])throw Error("Dispatcher.waitFor(...): "+d+" does not map to a registered callback. ");
if(this._callbacks[d]._isCallbackExecutionStarted)if(this._callbacks[d]._isCallbackExecutionCompleted)continue;else throw Error("Dispatcher.waitFor(...): Circular dependency detected while waiting for "+d);this._invokeCallback(d)}},_invokeCallback:function(a){this._callbacks[a]._isCallbackExecutionStarted=!0;try{this._callbacks[a].callback(this._pendingAction)}catch(c){f.log("Dispatcher._invokeCallback(...): Error while calling dispatcher callback: error message \x3d "+c.message,"FATAL",this._callbacks[a].attribution.getAttribution())}this._callbacks[a]._isCallbackExecutionCompleted=
!0},_startDispatching:function(a){for(var c in this._callbacks)this._callbacks[c]._isCallbackExecutionStarted=!1,this._callbacks[c]._isCallbackExecutionCompleted=!1;this._pendingAction=a;this._isDispatching=!0},_stopDispatching:function(){this._pendingAction=null;this._isDispatching=!1}};return a.prototype.constructor=a});f.when("A","dp-flux-utils").register("dp-flux-emitter",function(b,e){function d(){this._subscriptions={}}var a=b.$;d.prototype={emit:function(a){if(e.isNonEmptyString(a))b.each(this._subscriptions[a]||
[],function(a){a()});else throw Error("Emitter.emit()...: eventType must be a non empty string");},addListener:function(c,b){if(e.isNonEmptyString(c)&&a.isFunction(b))this._subscriptions[c]=this._subscriptions[c]||[],this._subscriptions[c].push(b);else throw Error("Emitter.addListener()...: Invalid arguments - eventType must be a non empty string \x26 callback must be a function ");},removeListener:function(c,b){if(e.isNonEmptyString(c)&&a.isFunction(b)){if(c=this._subscriptions[c])b=a.inArray(b,
c),-1!==b&&c.splice(b,1)}else throw Error("Emitter.removeListener()...: Invalid arguments - eventType must be a non empty string \x26 callback must be a function");}};return d});f.when("A","dp-flux-emitter","dp-flux-attribution","dp-flux-dispatcher","dp-flux-utils").register("dp-flux-store",function(b,e,d,a,c){function f(b,k,g,h){if(!(b instanceof d))throw Error("storeAttribution should be instance of Attribution");if(!(g instanceof a))throw Error("dispatcher must be an instance of Dispatcher");if(!l.isFunction(k))throw Error("Store must provide a reduce callback method");
this.reduce=k;this.dispatcher=g;this._storeAttribution=b;this._state=h||{};c.deepFreeze(this._state);this._dispatchToken=this.dispatcher.register(this._storeAttribution,this._invokeOnDispatch.bind(this));this._changed=!1;this._changeEvent=this._storeAttribution.getName()+":change";this._emitter=new e}var l=b.$;f.prototype={addListener:function(a){return this._emitter.addListener(this._changeEvent,a)},removeListener:function(a){this._emitter.removeListener(this._changeEvent,a)},getDispatcher:function(){return this.dispatcher},
getDispatchToken:function(){return this._dispatchToken},getState:function(){return this._state},getStoreAttribution:function(){return this._storeAttribution},_invokeOnDispatch:function(a){this._changed=!1;var b=this._state;(a=this.reduce(this._state,a)||b)&&a!==b&&(this._state=a,c.deepFreeze(this._state),this._changed=!0,this._emitter.emit(this._changeEvent))}};return f.prototype.constructor=f});f.when("A","dp-flux-attribution").register("dp-flux-store-group",function(b){function e(b,a,c){this._stores=
a;this._callBack=c;this._attribution=b;this._registerStoreGroup()}e.prototype={_registerStoreGroup:function(){var b=this._getUniformDispatcher();this._dispatchToken=b.register(this._attribution,function(){b.waitFor(this._getStoreTokens());this._callBack()}.bind(this))},unregisterStoreGroup:function(){this._getUniformDispatcher().unregister(this._dispatchToken)},_getUniformDispatcher:function(){var d=this._stores[0].getDispatcher();b.each(this._stores,function(a){if(d!==a.getDispatcher())throw Error("All stores must have common dispatcher");
});return d},_getStoreTokens:function(){return b.map(this._stores,function(b){return b.getDispatchToken()})}};return e.prototype.constructor=e});f.when("A","dp-flux-store-group").register("dp-flux-store-subscription",function(b,e){function d(a,b,d){this._stores=b;this._changed=!1;this._updatedStores=[];this._viewUpdateCallBack=d;this._viewAttribution=a;this._allListeners=[];this._addListenerToAllStores();this._storeGroup=new e(a,b,this._viewCallBack.bind(this))}d.prototype={_storeListener:function(a){this._changed=
!0;this._updatedStores.push(a)},_addListenerToAllStores:function(){var a;b.each(this._stores,function(b){a=this._storeListener.bind(this,b);this._allListeners.push({listener:a,store:b});b.addListener(a)},this)},_removeListenerFromAllStores:function(){b.each(this._allListeners,function(a){a.store.removeListener(a.listener)})},_viewCallBack:function(){if(this._changed){try{this._viewUpdateCallBack(this._updatedStores)}catch(a){f.log("StoreSubscription._viewCallBack(...): view callback failed "+a,"WARN",
this._viewAttribution.getAttribution())}this._changed=!1;this._updatedStores=[]}},reset:function(){this._removeListenerFromAllStores();this._storeGroup.unregisterStoreGroup()}};return d.prototype.constructor=d});f.when("A").register("dp-flux-utils",function(b){function e(a){return"string"===typeof a||"[object String]"===Object.prototype.toString.call(a)}function d(a){if(!Object.isFrozen(a)){var c=Object.getOwnPropertyNames(a);b.each(c,function(b){var c=a[b];a[b]=c&&"object"===typeof c?d(c):c});Object.freeze(a)}return a}
return{isString:e,isNonEmptyString:function(a){return!(!e(a)||!b.trim(a).length)},deepFreeze:function(a){return Object.freeze&&Object.getOwnPropertyNames&&Object.isFrozen?(d(a),!0):!1}}});f.when("A","dp-flux-attribution","dp-flux-store","dp-flux-store-subscription").register("dp-flux-view",function(b,e,d,a){function c(c,g,h){if(!(c instanceof e))throw Error("View(...): viewAttribution should be an instance of Attribution");if(f.isArray(g)&&1<=g.length)b.each(g,function(a){if(!(a instanceof d))throw Error("View(...): storeList contains an object which is not of type Store");
});else throw Error("View(...): View must listen on at least one store");if(!f.isFunction(h))throw Error("View(...): View must provide update callback method");this._viewAttribution=c;this._storeSubscription=new a(c,g,h)}var f=b.$;c.prototype.getViewAttribution=function(){return this._viewAttribution};c.prototype.unregisterStores=function(){this._storeSubscription.reset()};return c})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageCCXUSSProductInfoAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var y=window.AmazonUIPageJS||window.P,t=y._namespace||y.attributeErrors,z=t?t("DetailPageUSSAssets",""):y;z.guardFatal?z.guardFatal(c)(z,window):z.execute(function(){c(z,window)})})(function(c,y,t){c.when("A").register("uss-constants-common",function(c){return{classList:{SHOW_ELEMENT:"aok-block",HIDE_ELEMENT:"aok-hidden",STOP_SCROLLING:"uss-u-no-scroll",LIGHT_BOX_JS_HOOK:"js-light-box",LIGHT_BOX_IDENTIFIER:"uss-o-light-box",RIGHT_SIDE_SHEET:"uss-o-right-side-sheet",RIGHT_SIDE_SHEET_LAYOUT:"uss-l-right-side-sheet",
SHEET_OPEN:"is-open",SHEET_CLOSE:"is-close",USS_SHEET_VIEW_IDENTIFIER:"uss-sheet-view",CLOSE_ICON:"uss-o-close-icon",CLOSE_ICON_MEDIUM:"uss-o-close-icon-medium",USS_SHEET_VIEW_CLOSE_ICON:"uss-sheet-view-close-icon",PROMISING_UI_ELEMENT:"uss-o-promising-ui-element",PROMISING_UI_ELEMENT_ANIMATION:"uss-o-promising-ui-element-animation",IS_LOADING:"is-loading",IS_RESOLVED:"is-resolved",UI_PROMISE:"ui-promise",UI_VALUE:"ui-value",TEMPLATE_STORE:"uss-template-store",TEMPLATE:"uss-template",TEMPLATE_NAME:"template-name",
ATC_ACKNOWLEDGEMENT_MESSAGE:"atc-acknowledgement-message",ATC_GENERIC_ERROR:"atc-generic-error",ATC_STATUS_MESSAGE_COMPONENT:"uss-c-atc-status-msg",ATC_SUCCESS:"atc-success",ATC_ERROR:"atc-error",ITEM_IN_CART:"item-in-cart",CART_STATUS_MESSAGE_COMPONENT:"uss-c-cart-status-msg",CART_SUB_TOTAL:"cart-sub-total",CART_COUNT:"cart-count",SHIPPING_DETAILS:"uss-c-shipping-details",SHIPPING_MESSAGE_PLACEHOLDER:"shipping-message-placeholder",MAIN_IMAGE:"main-image",SUB_NAV:"uss-c-sub-nav",CHECKOUT_BUTTON:"checkout-btn",
CART_BUTTON:"cart-btn",CHECKOUT_FORM:"checkout-form",FACEOUT_IMAGE:"p13n-sc-dynamic-image",FACEOUT_TITLE:"uss-asin-title",FACEOUT_REVIEW_STARS:"uss-review-stars",FACEOUT_BEST_SELLER:"p13n-best-seller",FACEOUT_PRICE:"uss-price",CONTINUE_SHOPPING_LINK:"continue-shopping",SUCCESS_ELEMENT:".p13n-sc-atc-success",ERROR_ELEMENT:".p13n-sc-atc-error",BUTTON_ELEMENT:".a-button-primary",DISABLE_BUTTON:"a-button-disabled"},fatalMessagesList:{INVALID_SHEET_ID:"sheetID must be valid string",INVALID_CONSTRUCTOR_USAGE:"Constructor needs to be called with 'new' keyword",
INCORRECT_PARAMETER_PASSED:"Incorrect parameter passed."},widgetType:{WIDGET:"uss-widget",RECOMMENDATION_WIDGET:"uss-recommendation-widget",NO_RECOMMENDATION_WIDGET:"uss-no-recommendation-widget",LIST_RECOMMENDATION:"uss-list-recommendation-widget",CAROUSEL_RECOMMENDATION:"uss-carousel-recommendation-widget",PRIMARY_ACTION_STATUS_WIDGET:"uss-primary-action-status-widget",ATCStatusWidget:"uss-c-atc-status-widget",ATC_STATUS_IMB_WIDGET:"atc-status-imb-widget",MAPLE_WIDGET:"maple-recommendation-widget"},
layout:{defaultLayout:{DEFAULT_LAYOUT:"uss-l-default-layout",HEAD:"uss-c-head",BODY:"uss-c-body",HEAD_DIVIDER:"uss-c-head-divider",BOTTOM_MARGIN_BETWEEN_WIDGETS:"a-spacing-medium",TOP_MARGIN_BETWEEN_WIDGETS:"a-spacing-top-medium",SKELETON_LOADER:"uss-loading-skeleton",RECOMMENDATION_LOADING_MESSAGE:"loading-message",RECOMMENDATION_LOADED_MESSAGE:"uss-recommendations-loaded-message"}},actionSources:{DP_ATC_CLICK:"dp-atc-click",USS_INGRESS_CLICK:"uss-ingress-click",USS_INLINE_ATC_CLICK:"uss-inline-atc-click",
SHEET_CLOSE_BUTTON_CLICK:"sheet-close",CONTINUE_SHOPPING_CLICK:"continue-shopping-click"},stores:{ATC_STATUS_STORE:"uss-atc-status-store",RECOMMENDATION_DATA_STORE:"uss-recommendation-data-store",USS_SHEET_STORE:"uss-sheet-store"},actions:{USS_OPEN:"uss-open",USS_CLOSE:"uss-close",RECOMMENDATION_DATA_RECEIVE:"recommendation-data-receive",ATC_RECEIVE:"atc-receive"},metrics:{ATC_PROMISE_RESOLVED_TIMER:"atcPromiseResolve",PERCOLATE_DATA_PROMISE_RESOLVED_TIMER:"percolateDataPromiseResolve",ATC_PROMISE_REJECTED_COUNTER:"atcPromiseRejected",
PERCOLATE_DATA_PROMISE_REJECTED_COUNTER:"percolateDataPromiseRejected",SECONDARY_ADD_TO_CART_CLICK_COUNTER:"secondaryAtcClick",COMPATIBLE_BROWSER_COUNTER:"compatibleBrowser",NON_COMPATIBLE_BROWSER_COUNTER:"nonCompatibleBrowser",FACEOUT_IMAGE_CLICK_COUNTER:"faceout:imageClick",FACEOUT_REVIEW_STARS_CLICK_COUNTER:"faceout:reviewStarClick",FACEOUT_TITLE_CLICK_COUNTER:"faceout:titleClick",FACEOUT_PRICE_CLICK_COUNTER:"faceout:priceClick",FACEOUT_BEST_SELLER_CLICK_COUNTER:"faceout:bestSellerClick",SEE_MORE_EXISTENCE_COUNTER:"ussListWidget:seeMore",
SEE_MORE_CLICK_COUNTER:"ussListWidget:seeMoreClick",SEE_LESS_CLICK_COUNTER:"ussListWidget:seeLessClick",CHECKOUT_FORM_CLICK_COUNTER:"checkoutFormClick",CART_BUTTON_CLICK_COUNTER:"cartButtonClick",CONTINUE_SHOPPING_CLICK:"continueShoppingClick",PAGE_LANDING_PRECONDITIONS_PASSED:"pageLandingPreconditionsPassed",POST_ATC_PRECONDITIONS_FAILED:"postATCPreconditionsFailed",PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN:"programEligibilityRegistryOverwritten"},transitionTimingFunction:{EVEN_EASE:"cubic-bezier(0.4, 0, 0.6, 1)",
ENTER_EASE:"cubic-bezier(0, 0, 0.2, 1)",EXIT_EASE:"cubic-bezier(0.4, 0, 1, 1)",EASE_IN:"ease-in",EASE_OUT:"ease-out"},animationType:{FADE_IN:"fadeIn",NO_ANIMATION:"noAnimation"}}});c.when("dp-flux-attribution","uss-constants-common").register("uss-constants",function(c,n){n.ussCTI={CATEGORY:"Website",TYPE:"Detail Page",ITEM:"USS"};n.metrics.PREFIX="uss:";n.ajaxParams={BASE_URL:"/gp/product/handle-buy-box",REFTAG:"dp_start-bbf_1_glance",ASIN:"ASIN",OFFER_LISTING_ID:"offerListingID",AJAX_TIMEOUT:1E4};
n.actionSources.SHEET_CLOSE_BUTTON_CLICK="sheet-close-button-click";n.ussCommonAttribution=new c("uss-common",n.ussCTI.CATEGORY,n.ussCTI.TYPE,n.ussCTI.ITEM);n.defaultAtcAnimationType=n.animationType.FADE_IN;n.atcAnimationStatusEvent="uss:atc:animation:status:resolved";return n});c.when("dp-flux-utils","uss-constants").register("uss-logger-service",function(c,n){function r(a,b){if(c.isNonEmptyString(a))a=n.metrics.PREFIX+a,ue&&ue.count&&(b===t&&(b=(ue.count(a)||0)+1),ue.count(a,b));else throw Error("counterKey must be non empty string");
}function v(a){if(c.isNonEmptyString(a))this._timerName=a,this._startTime=0;else throw Error("timerName must be non empty string");}v.prototype={start:function(){this._startTime=Date.now()},stop:function(){this._startTime&&r(this._timerName,Date.now()-this._startTime)}};return{logCounter:r,Timer:v}});c.when("A","uss-utils","uss-logger-service","uss-constants").register("uss-preconditions",function(c,n,r,v){function a(a){a=c.$("#"+a+"_feature_div").html();null!==a&&(a=a.trim());return null!==a&&0<
a.length}function b(){return c.capabilities.transform&&c.capabilities.transition&&n.isFlexBoxSupported()}function g(){return c.$("#uss-weblabTreatment").val()}var d=/^T[0-9]+$/;b()?r.logCounter(v.metrics.COMPATIBLE_BROWSER_COUNTER):r.logCounter(v.metrics.NON_COMPATIBLE_BROWSER_COUNTER);return{isUssConditionsPassed:function(){return"true"===c.$("#uss-serverPreconditionsPassed").val()&&b()&&!a("scheduledDelivery")&&!a("simpleBundle")&&!a("partialStateBuyBox")},isUssWeblabInTreatment:function(){return d.test(g())},
triggerUSSWeblabValue:function(){return d.test(c.$("#uss-miniFrameworkWeblabTreatment").val())?c.$("#uss-weblabValue").val():1},ussWeblabTreatmentValue:g,isBrowserUssCompatible:b}});c.when("A","3p-promise","uss-constants","uss-logger-service").register("uss-utils",function(c,n,r,v){var a=c.$,b=r.classList,g=a("body"),d={},m=["isPreview","forceWidgets","previewCampaigns","auditEnabled"];(function(){var a=y.location.search,a=a.substr(1);a.split("\x26").forEach(function(f){f=f.split("\x3d");2===f.length&&
(d[f[0]]=f[1])})})();return{loadImage:function(h,f){return new n(function(e,k){f=f||"";var q=a("\x3cimg src\x3d'"+h+"' alt\x3d'"+f+"'\x3e");q.load(function(){e(q)});q.error(function(f){k(f)});q[0].complete&&e(q)})},isFlexBoxSupported:function(){var a=c.$("\x3cdiv\x3e\x3c/div\x3e")[0];return""===a.style.flex||""===a.style.webkitFlex||""===a.style.msFlex||""===a.style.MozBoxFlex||""===a.style.webkitBoxFlex?!0:!1},disablePageScroll:function(){g.addClass(b.STOP_SCROLLING)},enablePageScroll:function(){g.removeClass(b.STOP_SCROLLING)},
isMobileApp:function(){return"true"===c.$("#uss-mobileApp").val()},getDebugParams:function(){var a={};m.forEach(function(f){var e;e=null;d.hasOwnProperty(f)&&(e=d[f]);e&&(a[f]=e)});return a},shouldFireAndForgetWeblabTrigger:function(){var h=!1;0!=a("#uss-shouldFireAndForgetWeblabTrigger").length&&(h="true"===a("#uss-shouldFireAndForgetWeblabTrigger").val());return h},fireAndForgetWeblabTrigger:function(a,f){var e="/gp/uss/weblab-trigger.html?",e=/^T[0-9]+$/.test(c.$("#uss-miniFrameworkWeblabTreatment").val())?
e+("weblabValue\x3d"+a+"\x26treatment\x3d"+f):e+("triggerWeblab\x3d"+a+"\x26treatment\x3d"+f);y.navigator&&navigator.sendBeacon?navigator.sendBeacon(e)||c.$.ajax({url:e}):c.$.ajax({url:e})},showATCSuccess:function(){c.$("#atc-toast").length&&c.$("#atc-success").length&&(c.$("#atc-toast").css("display","block"),c.$("#atc-toast").addClass("atc-toast-success-styles"),c.$("#atc-success").css("display","block"),setTimeout(function(){c.$("#atc-success").css("display","none");c.$("#atc-toast").css("display",
"none");c.$("#atc-toast").removeClass("atc-toast-success-styles")},1500))},showATCFailure:function(){c.$("#atc-toast").length&&c.$("#atc-failed").length&&(c.$("#atc-toast").css("display","block"),c.$("#atc-toast").addClass("atc-toast-failure-styles"),c.$("#atc-failed").css("display","block"),setTimeout(function(){c.$("#atc-failed").css("display","none");c.$("#atc-toast").css("display","none");c.$("#atc-toast").removeClass("atc-toast-failure-styles")},1500))}}});c.when("A","atf","uss-utils").register("uss-init-helper",
function(z,n,r,v){return{loadUssCommonAssetsAfterPreload:function(){c.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",function(a,b,g,d){function m(){z.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(h,f){var e=new b(a.actions.USS_OPEN,a.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:h});f.percolateData.then(function(k){var q={isContainsRecommendation:!1,widgets:[]};k.recommendationData&&(q.widgets=k.recommendationData.widgets||
[]);m();q.widgets.length||(q.widgets.push({widgetType:a.widgetType.NO_RECOMMENDATION_WIDGET}),q.recommendationBaseIdentifier=h);g.dispatch(e);f.atcData.then(function(f){var k={};1===f.isOk?k=f.atcStatusData:k.isAtcGenericError=!0;f=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,k);g.dispatch(f)},function(){var f=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});g.dispatch(f)});q.recommendationBaseIdentifier=h;k=new b(a.actions.RECOMMENDATION_DATA_RECEIVE,a.actionSources.DP_ATC_CLICK,
q);g.dispatch(k)},function(){f.atcData.then(function(a){m();1===a.isOk?d.showATCSuccess():d.showATCFailure()},function(){d.showATCFailure()})})},secondaryATCClick:function(h,f){h.atcData.then(function(e){var k={};1===e.isOk?k=e.atcStatusData:k.isAtcGenericError=!0;k.params=f;e=new b(a.actions.ATC_RECEIVE,a.actionSources.USS_INLINE_ATC_CLICK,k);g.dispatch(e)},function(){})}}})},loadUssCommonAssets:function(){c.when("dp-flux-dispatcher").register("uss-dispatcher",function(a){return new a});c.when("A",
"uss-constants").register("promising-ui-element",function(a,b){var g=b.classList;return a.createClass({_element:null,_uiPromiseElement:null,_uiValueElement:null,_isResolved:!1,init:function(a){var b=a.find("."+g.UI_PROMISE),h=a.find("."+g.UI_VALUE);if((a.hasClass(g.PROMISING_UI_ELEMENT)||a.hasClass(g.PROMISING_UI_ELEMENT_ANIMATION))&&b.length&&h.length)this._uiPromiseElement=b,this._uiValueElement=h,this._element=a,this.showUIPromise();else throw Error("PromisingUIElement.init()...: HTML structure is not compatible with PromisingUIElement");
},showUIPromise:function(){this._element.addClass(g.IS_LOADING);this._element.removeClass(g.IS_RESOLVED);this._isResolved=!1},showUIValue:function(){this._element.addClass(g.IS_RESOLVED);this._element.removeClass(g.IS_LOADING);this._isResolved=!0},getValueElement:function(){return this._uiValueElement},getElement:function(){return this._element},isResolved:function(){return this._isResolved}})});c.when("A","uss-sheet-component","uss-constants","uss-store-repository","dp-flux-attribution","uss-layout",
"dp-flux-view","widget-creation-helper","dp-flux-action","uss-dispatcher").register("uss-sheet-view",function(a,b,g,d,m,h,f,e,k,q){function l(){p=!0;var a=g.classList,l=g.ussCTI,u=d.getStore(g.stores.USS_SHEET_STORE),w=d.getStore(g.stores.RECOMMENDATION_DATA_STORE),A=[u,w],l=new m("uss-sheet-view",l.CATEGORY,l.TYPE,l.ITEM),x=new b(a.USS_SHEET_VIEW_IDENTIFIER,{beforeClose:function(){q.dispatch(new k(g.actions.USS_CLOSE,g.actionSources.SHEET_CLOSE_BUTTON_CLICK))}}),a=x.getSheetElement(),D=new h(a);
new f(l,A,function(a){var f;if(-1!==c.inArray(u,a))if(f=u.getState(),f.isSheetOpen()){if(f.getActionSource()===g.actionSources.DP_ATC_CLICK){D.reset();var k=e.createAtcStatusWidget();f=e.createIMBWidget(f.getActionSource());D.renderWidgets([k,f])}x.open()}else f.getActionSource()!==g.actionSources.SHEET_CLOSE_BUTTON_CLICK&&x.close();-1!==c.inArray(w,a)&&D.renderWidgets(e.createRecommendationWidget(w))})}var c=a.$,p=!1;return{initializeUSSSheetView:function(){p||l()}}});c.when("A","uss-constants",
"uss-template-store","uss-widget-factory").register("widget-creation-helper",function(a,b,g,d){return{createAtcStatusWidget:function(){var a={content:g.getTemplate(b.widgetType.ATCStatusWidget),widgetType:b.widgetType.ATCStatusWidget};return d.getWidget(a)},createRecommendationWidget:function(b){var h,f=[];b=b.getState().getNewRecommendations();a.each(b,function(a){(h=d.getWidget(a))&&f.push(h)});return f},createIMBWidget:function(){return d.getWidget({content:"\x3cdiv\x3e\x3c/div\x3e",widgetType:b.widgetType.ATC_STATUS_IMB_WIDGET})}}});
c.when("A","dp-flux-store","uss-dispatcher").register("uss-store-repository",function(a,b,g){var d={};return{registerStore:function(a,h,f){h=new b(a,h,g,f);return d[a.getName()]=h},getStore:function(a){return d[a]},getDispatcher:function(){return g}}});c.when("A","uss-store-repository","dp-flux-attribution","uss-sheet-store","uss-constants").register("uss-recommendation-data-store",function(a,b,g,d,c){function h(a,f,e){this._unprocessedChunkIndex=e||0;this._recommendationBaseIdentifier=a;this._dataChunks=
f||[]}var f=a.$,e=c.ussCTI;g=new g(c.stores.RECOMMENDATION_DATA_STORE,e.CATEGORY,e.TYPE,e.ITEM);d=b.getStore(c.stores.USS_SHEET_STORE);h.prototype={_getRecommendations:function(f){var e=[];f<this._dataChunks.length&&a.each(this._dataChunks,function(h,b){b>=f&&a.each(h,function(a){e.push(a)})});return e},getAllRecommendations:function(){return this._getRecommendations(0)},getNewRecommendations:function(){return this._getRecommendations(this._unprocessedChunkIndex)},getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier},
addRecommendationChunk:function(k){var e=[];a.each(k,function(a){a.widgetType=a.widgetType||c.widgetType.RECOMMENDATION_WIDGET});e=f.merge(e,this._dataChunks);e=f.merge(e,[k]);return new h(this._recommendationBaseIdentifier,e,this._dataChunks.length)}};e=new h;return b.registerStore(g,function(a,f){var e=a,g=c.actions;switch(f.getName()){case g.USS_OPEN:b.getDispatcher().waitFor([d.getDispatchToken()]);d.getState().getActionSource()===c.actionSources.DP_ATC_CLICK&&(e=new h(d.getState().getRecommendationBaseIdentifier()));
break;case g.RECOMMENDATION_DATA_RECEIVE:g=d.getState().getRecommendationBaseIdentifier(),f=f._metadata,f.recommendationBaseIdentifier===g&&(e=a.addRecommendationChunk(f.widgets))}return e},e)});c.when("uss-store-repository","dp-flux-attribution","uss-constants").register("uss-sheet-store",function(a,b,g){function d(a,e,k){this._isSheetOpen=a||!1;this._actionSource=e;this._recommendationBaseIdentifier=k}var c=g.actions,h=g.ussCTI;b=new b(g.stores.USS_SHEET_STORE,h.CATEGORY,h.TYPE,h.ITEM);d.prototype=
{isSheetOpen:function(){return this._isSheetOpen},getActionSource:function(){return this._actionSource},getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier}};h=new d(!1);return a.registerStore(b,function(a,e){var k=a;switch(e.getName()){case c.USS_OPEN:a.isSheetOpen()||(e.getSource()===g.actionSources.DP_ATC_CLICK?k=new d(!0,e.getSource(),e.getMetaData().recommendationBaseIdentifier):e.getSource()===g.actionSources.USS_INGRESS_CLICK&&a.getRecommendationBaseIdentifier()&&
(k=new d(!0,e.getSource(),a.getRecommendationBaseIdentifier())));break;case c.USS_CLOSE:a.isSheetOpen()&&(k=new d(!1,e.getSource(),a.getRecommendationBaseIdentifier()))}return k},h)});c.when("A","uss-store-repository","dp-flux-attribution","uss-constants","dp-flux-utils").register("uss-atc-status-store",function(a,b,g,d,c){function h(){this.status=t;this.cart={subTotal:{}};this.mainImage={};this.isAtcGenericError=this.shippingMessageHTML=this.imbHTML=t}a=new g("uss-atc-status-store",d.ussCTI.CATEGORY,
d.ussCTI.TYPE,d.ussCTI.ITEM);h.prototype={setStatus:function(a){this.status=1===a||a===d.classList.ATC_SUCCESS?d.classList.ATC_SUCCESS:d.classList.ATC_ERROR},setCart:function(a,e,k){c.isNonEmptyString(a)&&(this.cart.count=parseInt(a));e&&(this.cart.subTotal=e);c.isNonEmptyString(k)&&(this.cart.checkoutUrl=k)},setMainImage:function(a,e){c.isNonEmptyString(a)&&(this.mainImage.src=a,c.isNonEmptyString(e)?this.mainImage.altText:this.mainImage.altText="")},setImbHTML:function(a){c.isNonEmptyString(a)&&
(this.imbHTML=a)},setShippingMessageHTML:function(a){c.isNonEmptyString(a)&&(this.shippingMessageHTML=a)},setIsAtcGenericError:function(a){this.isAtcGenericError=a}};g=new h;b.registerStore(a,function(a,e){var k=a;switch(e.getName()){case d.actions.ATC_RECEIVE:var b=e.getMetaData();e.getSource()===d.actionSources.DP_ATC_CLICK?(k=new h,b.isAtcGenericError?k.setIsAtcGenericError(!0):(k.setStatus(b.status),k.setCart(b.cart.count,b.cart.subTotal,b.cart.checkoutUrl),k.setMainImage(b.mainImage.src,b.mainImage.altText),
k.setImbHTML(b.imbHTML),k.setShippingMessageHTML(b.shippingMessageHTML))):e.getSource()!==d.actionSources.USS_INLINE_ATC_CLICK||b.isAtcGenericError||(k=new h,k.setStatus(a.status),k.setMainImage(a.mainImage.src,a.mainImage.altText),k.setImbHTML(a.imbHTML),k.setShippingMessageHTML(a.shippingMessageHTML),b.cart&&k.setCart(b.cart.count,b.cart.subTotal,a.cart.checkoutUrl));break;case d.actions.USS_OPEN:e.getSource()===d.actionSources.DP_ATC_CLICK&&(k=new h)}return k},g)});c.when("A","uss-constants").register("uss-template-store",
function(a,b){var g=a.$,d=b.classList,c={};return{init:function(){var a=g("."+d.TEMPLATE_STORE),f;1===a.length&&a.find("."+d.TEMPLATE).each(function(a,b){f=g("\x3cdiv\x3e\x3c/div\x3e");b=g(b);f.append(b);(a=b.data(d.TEMPLATE_NAME))&&(c[a]=f.html())})},getTemplate:function(a){return c[a]},_nameToTemplateMap:c}});c.when("A","dp-flux-attribution","dp-flux-utils","uss-store-repository","uss-widget","uss-constants").register("uss-widget-factory",function(a,b,g,d,m,h){var f=a.$,e={};e[h.widgetType.WIDGET]=
m;a=h.ussCTI;var k=new b("uss-widget-factory",a.CATEGORY,a.TYPE,a.ITEM);return{registerWidgetType:function(a,b){if(!g.isNonEmptyString(a))throw Error("uss-widget-factory.registerWidgetType()... : name parameter must be valid string. provided name param is \x3d "+a);if(!(b.prototype instanceof m))throw Error("uss-widget-factory.registerWidgetType()... : constructor.prototype must be instance of Widget. provided constructor param is \x3d "+b);e[a]=b},getWidgetType:function(a){return e[a]},getWidget:function(a){var g,
d=k;try{var m=a.widgetType||h.widgetType.WIDGET,C=e[m];if(!C)return c.log("Widget.getWidget()... : Constructor not exist for type : "+m,"FATAL",d.getAttribution()),g;var E=C.getAttribution&&C.getAttribution();E&&(d=E);if(a.attribution)var u=a.attribution,d=new b(u.name,u.category,u.type,u.item);var w=f(a.content),A=f("\x3cdiv\x3e\x3c/div\x3e");A.append(w);g=new C(d,A)}catch(x){c.log("Widget.getWidget()... : "+x.message,"FATAL",d.getAttribution&&d.getAttribution())}return g}}});c.when("A","uss-constants",
"dp-flux-view","uss-store-repository","uss-dispatcher").register("uss-widget",function(a,b,g,d,c){function h(b){var f=[];a.each(b,function(a){var b=d.getStore(a);if(b)f.push(b);else throw Error("Widget.getWidget().getStores()... : store with name \x3d "+a+" not exists");});return f}var f=b.classList,e=b.widgetType;return a.createClass({init:function(a,b){this._element=b;this._element.addClass(e.WIDGET);this._element.addClass(f.HIDE_ELEMENT);this._attribution=a;this._dispacther=c;this.getStoreNames().length&&
(b=h(this.getStoreNames()),this._fluxView=new g(a,b,this.update.bind(this)),this.update(b))},show:function(e){e=e||{};e=e.showWidgetAnimation||{};var h=b.animationType;e.animationType=e.animationType||h.NO_ANIMATION;switch(e.animationType){case h.FADE_IN:a.fadeIn(this._element,e.timeDuration||100,e.transitionTimingFunction||b.transitionTimingFunction.EVEN_EASE);break;case h.NO_ANIMATION:this._element.addClass(f.SHOW_ELEMENT),this._element.removeClass(f.HIDE_ELEMENT)}},hide:function(){this._element.addClass(f.HIDE_ELEMENT);
this._element.removeClass(f.SHOW_ELEMENT)},beforeRender:function(){},afterRender:function(){},getElement:function(){return this._element},getAttribution:function(){return this._attribution},getDispatcher:function(){return this._dispacther},update:function(a){},getStoreNames:function(){return[]},deleteWidget:function(){this._element.remove();this._fluxView&&this._fluxView.unregisterStores()}})});c.when("A","uss-constants","uss-widget-factory","uss-logger-service").register("uss-recommendation-widget",
function(a,b,g,d){var c=b.widgetType;a=g.getWidgetType(c.WIDGET);var h=b.classList,f=b.metrics;b=a.extend({init:function(a,b){this._super(a,b);this._element.addClass(c.RECOMMENDATION_WIDGET);this._addTrackingMetrics()},_addTrackingMetrics:function(){this._element.find("."+h.FACEOUT_IMAGE).click(function(){d.logCounter(f.FACEOUT_IMAGE_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_REVIEW_STARS).click(function(){d.logCounter(f.FACEOUT_REVIEW_STARS_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_PRICE).click(function(){d.logCounter(f.FACEOUT_PRICE_CLICK_COUNTER)});
this._element.find("."+h.FACEOUT_TITLE).click(function(){d.logCounter(f.FACEOUT_TITLE_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_BEST_SELLER).click(function(){d.logCounter(f.FACEOUT_BEST_SELLER_CLICK_COUNTER)})}});g.registerWidgetType(c.RECOMMENDATION_WIDGET,b);return b});c.when("A","uss-constants","uss-widget-factory","dp-flux-attribution","uss-template-store","dp-flux-action","uss-logger-service").register("uss-no-recommendation-widget",function(a,b,g,d,c,h,f){var e=b.widgetType;a=g.getWidgetType(e.WIDGET);
var k=b.ussCTI,q=new d(b.widgetType.NO_RECOMMENDATION_WIDGET,k.CATEGORY,k.TYPE,k.ITEM);d=a.extend({init:function(a,d){this._super(a,d);this._element.addClass(e.NO_RECOMMENDATION_WIDGET);a=c.getTemplate(b.widgetType.NO_RECOMMENDATION_WIDGET);this._element.append(a);this._continueShoppingLink=this._element.find("."+b.classList.CONTINUE_SHOPPING_LINK);this._continueShoppingLink.click(function(a){a.preventDefault();f.logCounter(b.metrics.CONTINUE_SHOPPING_CLICK);this.getDispatcher().dispatch(new h(b.actions.USS_CLOSE,
b.actionSources.CONTINUE_SHOPPING_CLICK))}.bind(this))}});d.getAttribution=function(){return q};g.registerWidgetType(e.NO_RECOMMENDATION_WIDGET,d);return d});c.when("A","uss-constants","uss-widget-factory").register("primary-action-status-widget",function(a,b,g){var d=b.widgetType;a=g.getWidgetType(d.WIDGET).extend({init:function(a,b){this._super(a,b);this.getElement().addClass(d.PRIMARY_ACTION_STATUS_WIDGET)}});g.registerWidgetType(d.PRIMARY_ACTION_STATUS_WIDGET,a);return a});c.when("A","promising-ui-element",
"uss-utils","uss-constants").register("promising-image",function(a,b,g,d){var m=a.$,h=d.classList;return b.extend({init:function(a,b){this._element=m(b);this._attribution=a;this._super(this._element);this._eventHandle=t},_showTickMarkImage:function(b){switch(b){case h.ATC_SUCCESS:this._showSuccessTickMark();break;case h.ATC_ERROR:this._showErrorTickMark();break;default:return}a.off(this._eventHandle.event,this._eventHandle.callback)},_showSuccessTickMark:function(){m(".main-image").find(".success-tick-mark-placeholder").addClass("success-tick-mark-image")},
_showErrorTickMark:function(){var b=m(".main-image").find(".error-tick-mark-placeholder");b.addClass("error-tick-mark-image");a.fadeIn(b,200,d.transitionTimingFunction.EASE_OUT)},showUIValue:function(b,e,h){var q=this,l=d.defaultAtcAnimationType,B=this._super.bind(this);l===d.animationType.FADE_IN&&(this._eventHandle=a.on(d.atcAnimationStatusEvent,this._showTickMarkImage.bind(this,h)));return g.loadImage(b,e).then(function(b){if(l===d.animationType.FADE_IN){var e=m(".main-image").find(".ui-promise");
a.fadeOut(e,200,d.transitionTimingFunction.EASE_IN,function(){q._appendImageToUIValue(b);B();var e=m(".main-image").find(".ui-value");a.fadeIn(e,200,d.transitionTimingFunction.EASE_OUT)})}else this._appendImageToUIValue(b),B();return!0}.bind(this),function(){c.log("PromisingImage.showUIValue() ... : failed to load image","FATAL",this._attribution.getAttribution());return!1}.bind(this))},_appendImageToUIValue:function(a){this.getValueElement().empty();this.getValueElement().append(a)}})});c.when("A",
"promising-ui-element","uss-constants").register("atc-status-msg",function(a,b,g){var d=g.classList;return b.extend({init:function(a){this._atcStatusElement=a;this._super(this._atcStatusElement)},_showSuccessMessage:function(){this._atcStatusElement.addClass(d.ATC_SUCCESS);this._atcStatusElement.removeClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ITEM_IN_CART)},_showFailureMessage:function(){this._atcStatusElement.addClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ATC_SUCCESS);this._atcStatusElement.removeClass(d.ITEM_IN_CART)},
_showItemInCartMessage:function(){this._atcStatusElement.addClass(d.ITEM_IN_CART);this._atcStatusElement.removeClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ATC_SUCCESS)},showUIValue:function(b){var h=this,f=g.defaultAtcAnimationType;switch(b){case d.ATC_SUCCESS:this._showSuccessMessage();break;case d.ATC_ERROR:this._showFailureMessage();break;case d.ITEM_IN_CART:this._showItemInCartMessage();break;default:return}this._super();f===g.animationType.FADE_IN&&(b=this._atcStatusElement.find("."+
d.UI_PROMISE),a.fadeOut(b,200,g.transitionTimingFunction.EASE_IN,function(){var b=h._atcStatusElement.find("."+d.UI_VALUE);a.fadeIn(b,200,g.transitionTimingFunction.EASE_OUT,function(){a.trigger(g.atcAnimationStatusEvent)})}))}})});c.when("A","promising-ui-element","uss-constants","dp-flux-utils").register("cart-status-message",function(a,b,g,d){var c=g.classList;return b.extend({init:function(a){this._cartStatusElement=a;this._subTotalElement=this._cartStatusElement.find("."+c.CART_SUB_TOTAL);this._cartCountElement=
this._cartStatusElement.find("."+c.CART_COUNT);this._cartCountSingularTemplate=this._cartCountElement.data("cart-count-singular-template");this._cartCountPluralTemplate=this._cartCountElement.data("cart-count-plural-template");this._super(this._cartStatusElement);this._eventHandle=t},_atcAnimationStatusResolved:function(){setTimeout(function(){this._cartStatusElement.addClass("uss-c-cart-status-msg-transition");a.off(this._eventHandle.event,this._eventHandle.callback)}.bind(this),200)},showUIValue:function(b,
f){var e=g.defaultAtcAnimationType;if("number"===typeof b&&d.isNonEmptyString(f)){var c;1===b?c=this._cartCountSingularTemplate.replace("###cartCount",b):1<b&&(c=this._cartCountPluralTemplate.replace("###cartCount",b));this._cartCountElement.html(c);this._subTotalElement.html(f);this._super();e===g.animationType.FADE_IN&&(this._eventHandle=a.on(g.atcAnimationStatusEvent,this._atcAnimationStatusResolved.bind(this)))}}})});c.when("A","a-button","uss-constants","uss-logger-service").register("uss-sub-nav",
function(a,b,c,d){var m=c.classList,h=c.metrics;return{getInstance:function(f){var e={},k=f.find("."+m.CHECKOUT_FORM);b("."+m.CHECKOUT_BUTTON,f);var q=f.find("."+m.CART_BUTTON),l=t;k.submit(function(){d.logCounter(h.CHECKOUT_FORM_CLICK_COUNTER)});q.click(function(){d.logCounter(h.CART_BUTTON_CLICK_COUNTER)});e.updateCheckoutUrl=function(a){k.attr("action",a)};e.hide=function(){a.$(f).addClass("is-hidden")};e.atcAnimationStatusResolved=function(){setTimeout(function(){a.$(f).addClass("uss-c-sub-nav-margin");
a.$(f).addClass("uss-c-sub-nav-transition");a.off(l.event,l.callback)}.bind(),200)};e.show=function(){a.$(f).removeClass("is-hidden");c.defaultAtcAnimationType===c.animationType.FADE_IN&&(l=a.on(c.atcAnimationStatusEvent,e.atcAnimationStatusResolved.bind()))};e.preInitiate=function(){var a=k.parent();a.find("iframe#ussCheckoutPrefetch").remove();var b=(new Date).getTime(),e="/gp/checkoutprefetch/checkout-prefetch.html?cartInitiateId\x3d"+b,f=document.createElement("iframe");f.setAttribute("src",e);
f.setAttribute("style","width:0px;height:0px;display:none;position:absolute;");f.setAttribute("name","ussCheckoutPrefetch");f.setAttribute("id","ussCheckoutPrefetch");a.append(f);a=k.find("#cartInitiateId");a.length?a.val(b):k.append("\x3cinput type\x3d'hidden' name\x3d'cartInitiateId' id\x3d'cartInitiateId' value\x3d'"+b+"'\x3e")};e.hide();return e}}});c.when("A","uss-constants").register("uss-shipping-details",function(a,b){var c=a.$;return{getInstance:function(d){var m=d.find("."+b.classList.SHIPPING_DETAILS),
h=m.find("."+b.classList.SHIPPING_MESSAGE_PLACEHOLDER),f=b.defaultAtcAnimationType,e=t,k=function(){var a=h.find(".a-row").find("a"),b=a.attr("onclick");if("undefined"!==typeof b&&b.includes("amz_js_PopWin")){var e=[];c.each(a[0].attributes,function(a,b){e.push(b.name)});c.each(e,function(b,e){a.removeAttr(e)});a.attr("href","/gp/help/customer/display.html?nodeId\x3d527692")}},q={hide:function(){m.addClass(b.classList.HIDE_ELEMENT);m.removeClass(b.classList.SHOW_ELEMENT)},atcAnimationStatusResolved:function(){setTimeout(function(){m.addClass("uss-c-shipping-details-transition");
a.off(e.event,e.callback)}.bind(),200)},show:function(c){h.empty();h.append(a.$(c));k();m.addClass(b.classList.SHOW_ELEMENT);m.removeClass(b.classList.HIDE_ELEMENT);f===b.animationType.FADE_IN&&(e=a.on(b.atcAnimationStatusEvent,q.atcAnimationStatusResolved.bind()))}};q.hide();return q}}});c.when("A","uss-constants","primary-action-status-widget","dp-flux-attribution","uss-widget-factory","atc-status-msg","cart-status-message","promising-image","uss-sub-nav","uss-shipping-details").register("atc-status-widget",
function(a,b,c,d,m,h,f,e,k,q){var l=b.ussCTI,B=b.widgetType,p=b.classList,n=new d(b.widgetType.ATCStatusWidget,l.CATEGORY,l.TYPE,l.ITEM);c=c.extend({init:function(a,b){this._atcGenericError=b.find("."+p.ATC_GENERIC_ERROR);this._atcAcknowledgementMessage=b.find("."+p.ATC_ACKNOWLEDGEMENT_MESSAGE);this._mainImage=new e(a,this._atcAcknowledgementMessage.find("."+p.MAIN_IMAGE));this._atcStatusMessage=new h(this._atcAcknowledgementMessage.find("."+p.ATC_STATUS_MESSAGE_COMPONENT));this._cartStatusMessage=
new f(this._atcAcknowledgementMessage.find("."+p.CART_STATUS_MESSAGE_COMPONENT));this._subNav=k.getInstance(this._atcAcknowledgementMessage.find("."+p.SUB_NAV));this._shippingDetails=q.getInstance(this._atcAcknowledgementMessage);this._viewState={};this._super(a,b)},update:function(e){var c;a.each(e,function(e){if(e.getStoreAttribution().getName()===b.stores.ATC_STATUS_STORE){var f=e.getDispatcher()._pendingAction;f&&f.getName()===b.actions.ATC_RECEIVE&&this._subNav.preInitiate();c=e.getState();c.isAtcGenericError?
this.showGenericError():(e=a.diff(this._viewState,c),e.status&&c.status&&this._atcStatusMessage.showUIValue(c.status),e.cart.count&&c.cart.count&&(this._cartStatusMessage.showUIValue(c.cart.count,c.cart&&c.cart.subTotal&&c.cart.subTotal.displayString||""),e.cart.checkoutUrl&&c.cart.checkoutUrl&&this._subNav.updateCheckoutUrl(c.cart.checkoutUrl),this._subNav.show()),e.mainImage.src&&c.mainImage.src&&this._mainImage.showUIValue(c.mainImage.src,c.mainImage.altText,c.status),e.shippingMessageHTML&&c.shippingMessageHTML&&
this._shippingDetails.show(c.shippingMessageHTML));this._viewState=c}}.bind(this))},showGenericError:function(){this._atcAcknowledgementMessage.addClass(p.HIDE_ELEMENT);this._atcAcknowledgementMessage.removeClass(p.SHOW_ELEMENT);this._atcGenericError.removeClass(p.HIDE_ELEMENT);this._atcGenericError.addClass(p.SHOW_ELEMENT)},getStoreNames:function(){return[b.stores.ATC_STATUS_STORE]}});c.getAttribution=function(){return n};m.registerWidgetType(B.ATCStatusWidget,c);return c});c.when("A","uss-constants",
"dp-flux-attribution","uss-widget-factory").register("atc-status-imb-widget",function(a,b,g,d){var m=d.getWidgetType(b.widgetType.WIDGET),h=b.ussCTI,f=new g("atc-status-imb-widget",h.CATEGORY,h.TYPE,h.ITEM);g=m.extend({init:function(a,c){c.addClass(b.widgetType.ATC_STATUS_IMB_WIDGET);this._super(a,c)},update:function(e){var d;a.each(e,function(e){if(e.getStoreAttribution().getName()===b.stores.ATC_STATUS_STORE)if(d=e.getState(),d.imbHTML){this.getElement().empty();e=a.$(d.imbHTML);var h=e.children().length;
if(1<=h){e.find(".a-declarative a").unwrap();var g=e.find(".a-declarative span");g.removeClass("a-color-link huc-cursor-pointer");g.unwrap();this.getElement().append(e);this.show();1<h&&c.log("ImbWidget.update(...): More than one IMB message exist : html \x3d "+d.imbHTML,"WARN",f.getAttribution())}else this.hide()}else this.hide()}.bind(this))},afterRender:function(){this.hide()},getStoreNames:function(){return[b.stores.ATC_STATUS_STORE]}});g.getAttribution=function(){return f};d.registerWidgetType(b.widgetType.ATC_STATUS_IMB_WIDGET,
g);return g});c.when("A").register("uss-base-layout",function(a){return a.createClass({init:function(a){this._ussSheetElement=a},renderWidgets:function(a){throw Error("Layout.renderWidgets()...: Subclass must implement update method");},reset:function(){throw Error("Layout.reset()...: Subclass must implement reset method");},getUssSheetElement:function(){return this._ussSheetElement}})});c.when("A","uss-base-layout","promising-ui-element","uss-constants","primary-action-status-widget","atc-status-imb-widget").register("uss-default-layout",
function(a,b,c,d,m,h){var f=d.layout.defaultLayout;return b.extend({init:function(b){this._super(b);this._element=b.find("."+f.DEFAULT_LAYOUT);this._ussHead=this._element.find("."+f.HEAD);this._ussBody=this._element.find("."+f.BODY);this._widgetList=[];this._recommendationLoader=a.$("."+f.SKELETON_LOADER);this._recommendationLoadingMessage=a.$("."+f.RECOMMENDATION_LOADING_MESSAGE);this._recommendationLoadedMessage=a.$("."+f.RECOMMENDATION_LOADED_MESSAGE);this._ussBody.append(this._recommendationLoader);
this._recommendationLoaderFadeOutOptions={timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_IN};this._recommendationLoaderFadeInOptions={timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_OUT};this._recommendationWidgetOptions={showWidgetAnimation:{animationType:d.animationType.FADE_IN,timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_OUT}}},renderWidgets:function(b){var c,d=!1;a.each(b,function(b){c={};b.beforeRender();this._widgetList.push(b);
if(b instanceof m)this._ussHead.prepend(b.getElement());else if(b.getElement().addClass(f.BOTTOM_MARGIN_BETWEEN_WIDGETS),b.getElement().addClass(f.TOP_MARGIN_BETWEEN_WIDGETS),b instanceof h)this._ussBody.prepend(b.getElement());else{if(!d){d=!0;var e=this;a.fadeOut(this._recommendationLoader,this._recommendationLoaderFadeOutOptions.timeDuration,this._recommendationLoaderFadeOutOptions.transitionTimingFunction,function(){a.fadeIn(e._recommendationLoadedMessage,e._recommendationLoaderFadeInOptions.timeDuration,
e._recommendationLoaderFadeInOptions.transitionTimingFunction)})}c=this._recommendationWidgetOptions;this._ussBody.append(b.getElement())}b.show(c);b.afterRender()}.bind(this))},reset:function(){a.each(this._widgetList,function(a){a.deleteWidget()});this._widgetList=[];this._ussBody.empty();this._ussBody.append(this._recommendationLoader);this._ussBody.append(this._recommendationLoadedMessage);this._recommendationLoader.css({display:"block"});this._recommendationLoadingMessage.css({display:"none"});
this._recommendationLoadedMessage.css({display:"none"});this.resetScrollPosition()},resetScrollPosition:function(){this._ussBody.scrollTop(0)}})});c.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",function(a,b,c,d){function m(){z.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(h,f){var e=new b(a.actions.USS_OPEN,a.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:h});f.percolateData.then(function(d){var q=
{isContainsRecommendation:!1,widgets:[]};d.recommendationData&&(q.widgets=d.recommendationData.widgets||[]);m();q.widgets.length||(q.widgets.push({widgetType:a.widgetType.NO_RECOMMENDATION_WIDGET}),q.recommendationBaseIdentifier=h);c.dispatch(e);f.atcData.then(function(e){var f={};1===e.isOk?f=e.atcStatusData:f.isAtcGenericError=!0;e=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,f);c.dispatch(e)},function(){var e=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});
c.dispatch(e)});q.recommendationBaseIdentifier=h;d=new b(a.actions.RECOMMENDATION_DATA_RECEIVE,a.actionSources.DP_ATC_CLICK,q);c.dispatch(d)},function(){f.atcData.then(function(a){m();1===a.isOk?d.showATCSuccess():d.showATCFailure()},function(){d.showATCFailure()})})},secondaryATCClick:function(d,f){d.atcData.then(function(e){var d={};1===e.isOk?d=e.atcStatusData:d.isAtcGenericError=!0;d.params=f;e=new b(a.actions.ATC_RECEIVE,a.actionSources.USS_INLINE_ATC_CLICK,d);c.dispatch(e)},function(){})}}})},
initializeUSSComponents:function(){c.when("uss-template-store","uss-sheet-store","uss-recommendation-data-store","uss-store-repository","uss-widget","uss-recommendation-widget","primary-action-status-widget","uss-widget-factory","uss-sheet-view","uss-layout").register("uss-framework-ready",function(a){a.init()});c.when("uss-sheet-view","uss-framework-ready").register("uss-sheet-view-ready",function(a){a.initializeUSSSheetView()})},initializeBuyBox:function(){c.when("buy-box-override","atc-status-widget",
"atc-status-imb-widget","uss-atc-status-store","uss-framework-ready","uss-sheet-view-ready").execute(function(a){a.init()})}}});c.when("A","uss-constants","uss-logger-service").register("uss-eligibility",function(c,n,r){var v=n.metrics,a={};return{getUssEligibility:function(b,c){return{primaryAsinData:{asin:b,offerListingId:c},eligibility:a}},registerProgramEligibility:function(b,c){b&&(a[b]&&r.logCounter(v.PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN+"."+programName),a[b]=c)}}});c.when("A","atf","uss-init-helper",
"uss-preconditions","uss-logger-service","uss-constants").register("uss-init",function(t,n,r,v,a,b){function g(){r.loadUssCommonAssets();c.when("A","3p-promise","uss-light-box","uss-constants","uss-logger-service").register("uss-sheet-component",function(a,b,c,d,g){function l(b,f){if(!(this instanceof l))throw Error(r.INVALID_CONSTRUCTOR_USAGE);if("string"===typeof b)if(this._sheet=m("#"+b),1===this._sheet.length)this._sheetID=b,this._sheet.addClass(p.RIGHT_SIDE_SHEET),this._sheet.addClass(p.RIGHT_SIDE_SHEET_LAYOUT),
this._sheet.addClass(p.SHEET_CLOSE),this._sheet.attr("role","dialog"),this._sheet.appendTo(w),this._closeIcon=this._createCloseIcon(),this._closeIcon.click(function(){var a=this.close();f.beforeClose&&f.beforeClose(a);g.logCounter(this._sheetID+":closeIconClick")}.bind(this)),this._sheet.append(this._closeIcon),c.getElement().click(function(){var a=this.close();f.beforeClose&&f.beforeClose(a);g.logCounter(this._sheetID+":lightBoxClick")}.bind(this)),this._sheet.removeClass(p.HIDE_ELEMENT),a.on(d.atcAnimationStatusEvent,
function(){A.is(":visible")&&a.fadeIn(x,200,n.EASE_OUT)});else throw Error("Unique element with id '"+b+"' must exist inside a DOM");else throw Error(r.INVALID_SHEET_ID);}var m=a.$,p=d.classList,n=d.transitionTimingFunction,r=d.fatalMessagesList,u=d.layout.defaultLayout,w=m("body"),A=m("."+u.SKELETON_LOADER),x=m("."+u.RECOMMENDATION_LOADING_MESSAGE);l.prototype.open=function(){var d=this;return new b(function(b){var f=d._getSheetSize();d._sheet.css({right:"-"+f+"px"});c.show();a.animationFrameDelay(function(){a.animate(d._sheet,
{right:0},400,n.ENTER_EASE,function(){d._sheet.removeClass(p.SHEET_CLOSE);d._sheet.addClass(p.SHEET_OPEN);d.showCloseIcon();b(!0);g.logCounter(d._sheetID+":open")})});d._closeIcon.css({right:f+15+"px"})})};l.prototype.close=function(){return new b(function(b){var d="-"+this._getSheetSize()+"px";a.animate(this._sheet,{right:d},300,n.EXIT_EASE,function(){this._sheet.removeClass(p.SHEET_OPEN);this._sheet.addClass(p.SHEET_CLOSE);b(!0);g.logCounter(this._sheetID+":close")}.bind(this));this.hideCloseIcon();
c.hide()}.bind(this))};l.prototype.getSheetElement=function(){return this._sheet};l.prototype._getSheetSize=function(){return this._sheet.outerWidth()};l.prototype._createCloseIcon=function(){return m("\x3cdiv class \x3d '"+(p.CLOSE_ICON+" "+p.CLOSE_ICON_MEDIUM+"  "+p.HIDE_ELEMENT)+"'\x3e\x3c/div\x3e")};l.prototype.showCloseIcon=function(){a.fadeIn(this._closeIcon,200,n.EVEN_EASE)};l.prototype.hideCloseIcon=function(){a.fadeOut(this._closeIcon,200,n.EVEN_EASE)};return l});c.when("A","uss-constants",
"uss-utils").register("uss-light-box",function(a,b,c){var d=a.$,g=b.classList,l=d("\x3cdiv class\x3d'"+g.LIGHT_BOX_IDENTIFIER+" "+g.LIGHT_BOX_JS_HOOK+" "+g.HIDE_ELEMENT+"'\x3e\x3c/div\x3e");d("body").append(l);return{show:function(){l.addClass(g.SHOW_ELEMENT);l.removeClass(g.HIDE_ELEMENT);c.disablePageScroll();a.animationFrameDelay(function(){a.animate(l,{opacity:.6},400,b.transitionTimingFunction.EVEN_EASE)})},hide:function(){l.removeClass(g.SHOW_ELEMENT);a.animate(l,{opacity:0},300,b.transitionTimingFunction.EVEN_EASE,
function(){l.addClass(g.HIDE_ELEMENT);l.removeClass(g.SHOW_ELEMENT);c.enablePageScroll()})},getElement:function(){return l}}});c.when("A","uss-constants","dp-flux-attribution","dp-flux-view","uss-store-repository","uss-atc-status-store").register("nav-bar-cart-count-view",function(a,b,c,d,g,l){var m=a.$;a=b.ussCTI;c=new c("nav-bar-cart-count-view",a.CATEGORY,a.TYPE,a.ITEM);l=g.getStore(b.stores.ATC_STATUS_STORE);new d(c,[l],function(a){if(-1!==m.inArray(l,a)){var b=l.getState();y.$Nav.when("api.setCartCount").run(function(a){b.cart.count&&
a(b.cart.count)})}})});c.when("A").register("buy-box-utility",function(a){var b=a.$;return{isWarrantySelectedInBuyBox:function(){var a=!1;b("#abbWrapper .abbListItem input[type\x3dcheckbox]").each(function(){a=a||b(this).prop("checked")});return a}}});c.when("A","uss-action-creator-helper","uss-preconditions","uss-logger-service","uss-constants","uss-utils","uss-eligibility").register("uss-atc",function(a,b,c,d,g,l,m){function p(a){this.widgetName=a;this.isPrimaryAtc="DetailPageBuyBox"===a}var n=
a.$,r=g.ajaxParams.AJAX_TIMEOUT,u=g.ajaxParams.BASE_URL,w={};p.prototype._getAtcUrl=function(a){var b=u;a.hasOwnProperty("ref")&&(b=b+"/ref\x3d"+a.ref);(a=a.linkParams)&&""!==a.trim()&&("\x26"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),b=b+"?"+a);return b};p.prototype._addUssParameters=function(a){a.params.isUSSAjax=1;this.isPrimaryAtc&&(a.params.isPrimaryATC=1,l.shouldFireAndForgetWeblabTrigger()||(a.params.triggerUSSWeblab=c.triggerUSSWeblabValue()));a=this._addEligibilityParameters(a);
var b=l.getDebugParams();Object.keys(b).forEach(function(c){a.params[c]=b[c]});return a};p.prototype._addEligibilityParameters=function(a){var b=m.getUssEligibility(a.params[g.ajaxParams.ASIN],a.params[g.ajaxParams.OFFER_LISTING_ID]);a.params.ussEligibility=JSON.stringify(b);return a};p.prototype._callback=function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);"function"===typeof a&&a.apply(this,b)};p.prototype._addToCart=function(b,d){this.isPrimaryAtc&&c.isUssWeblabInTreatment()&&
a.$("#add-to-cart-button").attr("disabled",!0);var f=this;b=this._getAtcUrl(b);d=this._addUssParameters(d);var g=n.Deferred(),k=n.Deferred(),l={};a.post(b,{params:d.params,success:function(b,c,e){d.hasOwnProperty("success")&&f._callback(d.success,b,c,e);a.trigger("USS ATC: Success")},error:function(b,c,e){g.reject();k.reject();d.hasOwnProperty("error")&&f._callback(d.error,b,c,e);a.trigger("USS ATC : Failure")},abort:function(a){g.reject();k.reject();d.hasOwnProperty("abort")&&f._callback(d.abort,
a)},chunk:function(a){if(a&&a.hasOwnProperty("name")){switch(a.name){case "atc-data":g.resolve(a.response);break;case "percolate-data":k.resolve(a.response);break;default:var b={message:"ATC Failed for widget "+f.widgetName+". Unrecognized chunk name found. ",logLevel:"FATAL"};y.ueLogError&&y.ueLogError("USS ATC Failure for widget "+f.widgetName,b)}d.hasOwnProperty("chunk")&&f._callback(d.chunk,a)}},timeout:d.timeout||r});l.atcData=g;this.isPrimaryAtc&&(l.percolateData=k);return l};return{addToCart:function(a,
c,e){if(!a||!a.trim().length||"object"!==typeof c)throw g.fatalMessagesList.INCORRECT_PARAMETER_PASSED;var h="DetailPageBuyBox"===a;w[a]||(w[a]=new p(a));a=w[a]._addToCart(e,c);h||(h={},h.baseAsin=c.params.ASIN||c.params.a,h.baseReftag=e.ref,d.logCounter(g.metrics.SECONDARY_ADD_TO_CART_CLICK_COUNTER),b.secondaryATCClick(a,h));return a}}});c.when("A","uss-atc","uss-action-creator-helper","uss-preconditions","uss-logger-service","uss-constants","buy-box-utility","uss-utils").register("buy-box-override",
function(a,b,c,d,g,l,m,p){var n=a.$,r=l.metrics;a={actionButton:null,whitelistedActions:{"submit.add-to-cart":1},init:function(){this.checkPreconditionsAndManipulateBuyBox()},checkPreconditionsAndManipulateBuyBox:function(){this.buyBoxForm=n("#addToCart");d.isUssConditionsPassed()&&this.attachFormHandler()},attachFormHandler:function(){this.buyBoxForm.submit(this.submitForm.bind(this));this.buyBoxForm.find("input[type\x3dsubmit], input[type\x3dbutton]").click(function(a){this.actionButton=a.target}.bind(this))},
isValidAction:function(){return this.actionButton&&this.actionButton.name in this.whitelistedActions},submitForm:function(a){if(!m.isWarrantySelectedInBuyBox()&&this.isValidAction())if(d.isUssWeblabInTreatment()){a.preventDefault();a=this.getAddToCartParameters();var h={params:a},n={ref:l.ajaxParams.REFTAG};p.shouldFireAndForgetWeblabTrigger()&&p.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),d.ussWeblabTreatmentValue());var h=b.addToCart("DetailPageBuyBox",h,n),x=new g.Timer(r.ATC_PROMISE_RESOLVED_TIMER),
t=new g.Timer(r.PERCOLATE_DATA_PROMISE_RESOLVED_TIMER);x.start();t.start();h.atcData.then(function(a){1===a.isOk&&x.stop()},function(){g.logCounter(r.ATC_PROMISE_REJECTED_COUNTER)});h.percolateData.then(function(){t.stop()},function(){g.logCounter(r.PERCOLATE_DATA_PROMISE_REJECTED_COUNTER)});c.primaryATCClick(a[l.ajaxParams.ASIN],h)}else g.logCounter(l.metrics.POST_ATC_PRECONDITIONS_FAILED),this.addHiddenUSSField("isUSSControl",1),p.shouldFireAndForgetWeblabTrigger()?p.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),
d.ussWeblabTreatmentValue()):this.addHiddenUSSField("triggerUSSWeblab",d.triggerUSSWeblabValue());else g.logCounter(l.metrics.POST_ATC_PRECONDITIONS_FAILED)},addHiddenUSSField:function(a,b){n("\x3cinput\x3e").attr({type:"hidden",id:a,name:a,value:b}).appendTo(this.buyBoxForm)},getAddToCartParameters:function(){var a={},b=this.buyBoxForm.serializeArray();n.each(b,function(b,c){a[c.name]=c.value});return a}};return{init:a.init.bind(a)}})}function d(){v.isUssConditionsPassed()&&(a.logCounter(b.metrics.PAGE_LANDING_PRECONDITIONS_PASSED),
m||(g(),m=!0,r.initializeUSSComponents()),r.initializeBuyBox())}var m=!1;t.on("PageRefresh:ATF",function(){d()});d()})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("InteractionTrackingAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,d=e._namespace||e.attributeErrors,a=d?d("DetailPageUpsellDownsellWidgetAssets",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,d){c.when("A","jQuery","beforeLoad").execute("r4m-csm-metrics-load",function(a,b){function c(){if(!h){var g=b("#r4mCstTop"),d=b("#r4mCstBottom");if(a.onScreen(g,0)||a.onScreen(d,0))f&&f.hasOwnProperty("productWeblab")&&f.hasOwnProperty("productWeblabTreatment")&&(g=e.ue)&&g.trigger(f.productWeblab,
f.productWeblabTreatment),h=!0}}function d(a){var b=e.ue;if(b){var c=b.count(a)||0;b.count(a,c+1)}}var h=!1,f=a.state("r4mCstState");a.constants&&a.constants.BROWSER_EVENTS&&a.constants.BROWSER_EVENTS.SCROLL&&a.constants.BROWSER_EVENTS.ORIENTATION_CHANGE&&(a.on(a.constants.BROWSER_EVENTS.SCROLL,c),a.on(a.constants.BROWSER_EVENTS.ORIENTATION_CHANGE,c));b("[id^\x3dr4m_udw_][id$\x3d_product_img]").click(function(){var a=b(this).attr("id").replace("_product_img","");d(a)});b("[id^\x3dr4m_udw_][id$\x3d_product_title]").click(function(){var a=
b(this).attr("id").replace("_product_title","");d(a)});b("[id^\x3dr4m_udw_][id$\x3d_reviews]").click(function(){var a=b(this).attr("id");d(a)})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPagePaymentOptionsJavascript",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(a){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,c=h?h("DetailPageUssStrxAssets",""):e;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,e,h){a.when("A","uss-strx-constants","uss-strx-metrics-logger","atf").register("uss-strx-metrics",function(e,a,k){var g;return{init:function(){g=new k(a.logging.METRIC_PREFIX)},updateAndLogCounter:function(b,f){g.updateAndLogCounter(b,f)},logCounter:function(b,f){g.logCounter(b,f)}}});a.when("A",
"atf").register("uss-strx-metrics-logger",function(a){return function(a){function c(f,d){null!==d&&"number"===typeof d&&e.ue&&e.ue.count&&e.ue.count(b.attribution+f,d)}function g(f){var d=0;e.ue&&e.ue.count&&(d=e.ue.count(b.attribution+f));return d}var b=this;b.attribution=a||"";b.logCounter=c;b.getCounter=g;b.updateAndLogCounter=function(b,d){var l=g(b);null!==l&&"number"===typeof l?c(b,l+d):c(b,d)}}});a.when("A","atf").register("uss-strx-constants",function(a){return{eligibility:{ELIGIBILITY_TYPE:"STRX"},
logging:{METRIC_PREFIX:"USS.STRX."},metrics:{MISSING_ASIN:"MissingASIN",MISSING_DISPLAYABLE:"MissingDisplayableFlag",MISSING_OFFERLISTING:"MissingOfferListingId",MISSING_MARKETPLACE:"MissingMarketplaceId",MISSING_LANGUAGE_HEADER:"MissingLanguageHeader"}}});a.when("A","uss-strx-constants","uss-strx-metrics","uss-eligibility","atf").register("uss-strx-eligibility",function(a,e,k,g){function b(b,a){typeof b!==typeof h&&!1!==b||k.updateAndLogCounter(a,1)}var f=a.$,d=e.metrics;k.init();(function(){var a,
c=null;a=f("#strx-uss-widget-container");if(a.length){var c=a.attr("data-asin"),h=a.attr("data-displayable"),k=a.attr("data-offer-listing-id"),m=a.attr("data-marketplace-id");a=a.attr("data-language-header");b(c,d.MISSING_ASIN);b(h,d.MISSING_DISPLAYABLE);b(k,d.MISSING_OFFERLISTING);b(m,d.MISSING_MARKETPLACE);b(a,d.MISSING_LANGUAGE_HEADER);c={asin:c,displayable:h,offerListingId:k,marketplaceId:m,languageHeader:a}}(a=c)&&g.registerProgramEligibility(e.eligibility.ELIGIBILITY_TYPE,a)})();return{}})});
/* ******** */
(function(l){var p=window.AmazonUIPageJS||window.P,B=p._namespace||p.attributeErrors,b=B?B("DetailPageAlohaAssets",""):p;b.guardFatal?b.guardFatal(l)(b,window):b.execute(function(){l(b,window)})})(function(l,p,B){l.when("A","a-modal","a-checkbox","aloha-simplebundle-common","ready").execute(function(b,p,l,k){function y(){b.declarative("show-review-tab","click",function(g){b.$(g.$target).closest(a.AUI_PAGE_ROOT).find(".popoverReviewsTab").click()});b.declarative("add-to-cart","click",function(g){b.$(a.SB_ROOT+
" "+a.SB_BUYBOX_ITEM_CHECKBOX+" "+a.INPUT_TYPE_CHECKBOX).filter(function(){return b.$(this).data("asin")===g.data.asin}).prop("checked",!0).change();b.$("[id^\x3dpopover-simpleBundle-]").each(function(){var a=p.get(b.$(this));a.isActive()&&a.hide()})});b.declarative("focus-image","mouseenter",function(b){var f=b.$target,k=f.parents(a.AUI_PAGE_ROOT);b=b.data;k.find("#productImageMain-"+b.asin).attr("src",b.imageUrl);k.find(".thumbnail-group").removeClass("a-button-selected");k.find("#"+f.prop("name")).addClass("a-button-selected")})}
var a={BUYBOX_ACCORDION:"#buyBoxAccordion",ADD_TO_CART_FORM:"#addToCart",ADD_TO_CART_ATTACH_BUTTON:"#add-to-cart-button.attach-dss-atc:button",SESSION_ID:"#session-id",OFFER_LISTING_ID:"#offerListingID",AUI_MODAL_SCROLLER:".a-modal-scroller",AUI_PAGE_ROOT:"#a-page",INPUT_TYPE_CHECKBOX:"input[type\x3d'checkbox']",BASE_PRODUCT_PRICE:"#base-product-price",BASE_PRODUCT_PRICE_DATA:"base-product-price",SB_ROOT:".showBundleAsins.simpleBundleFeatureContainer",SB_EXPANDED_MODAL_EXPANDER_HEADER_PREFIX:".simple-bundle-item-expand-header-",
SB_EXPANDED_MODAL_EXPANDER_CONTENT_PREFIX:".simple-bundle-item-expander-content-",SB_EXPANDED_MODAL_LINK:".simple-bundle-buybox-expanded-modal-link",SB_EXPANDED_MODAL_ITEM_LINK_PREFIX:".simple-bundle-item-link-",SB_ACCESSORY_ITEM_LINK_PREFIX:".popover-simpleBundle-link-",SB_BUYBOX_ITEM_CHECKBOX:".simple-bundle-buybox-item-checkbox",SB_BUYBOX_CHECKBOX_PREFIX:".simple-bundle-item-",SB_EXPANDED_CHECKBOX_PREFIX:".simple-bundle-modal-item-",SB_EXPANDER_TITLE:".aloha-simple-bundle-expand-header-title"},
f=!1,n=b.debounce(function(){var g=b.$(a.SB_ROOT);if(g.length){var h=b.$(a.ADD_TO_CART_FORM),n=h.find(":submit").length&&h.find(a.OFFER_LISTING_ID).val(),p=b.$(a.ADD_TO_CART_ATTACH_BUTTON),l=p.length;if(n||l){y();var q=k.getSimpleBundlePageState()||{},x=q.expandedBuyboxEnabled,H=q.selectionMode||"SINGLE",c=q.items||[],A=[],t=b.$(a.SESSION_ID).val(),F=g.find(a.SB_EXPANDED_MODAL_LINK),m,e={baseAsin:q.baseAsin,marketplaceId:q.marketPlaceId,baseItemPrice:b.$(a.BASE_PRODUCT_PRICE).data(a.BASE_PRODUCT_PRICE_DATA),
clientType:"aloha-simplebundle-desktop",currencyOfPreferenceSupported:q.currencyOfPreferenceSupported||!1},u=k.createMetricsLogger(e);f||(f=!0,b.defer(function(){u.logNexusImpression(c);u.logImpressionRefTag()}));F.click(function(b){b.originalEvent&&u.logExpandedLink()});c.forEach(function(e,d){function c(){var e=!1;h.click(function(){e=!e});g.find(a.SB_EXPANDED_MODAL_ITEM_LINK_PREFIX+d).click(function(){e||h.click();F.click();m=m||b.$(a.AUI_MODAL_SCROLLER);m.scrollTop(h.offset().top-m.offset().top+
m.scrollTop())})}function f(){var c=g.find(a.SB_EXPANDED_MODAL_EXPANDER_CONTENT_PREFIX+d),I="/gp/product/features/aloha-ppd/udp-ajax-handler/minidp.html?asin\x3d"+e.asin+"\x26marketplaceId\x3d"+q.marketPlaceId+"\x26offerId\x3d"+e.offerListingId+"\x26activeTab\x3d0",m="a:expander:simple-bundle-item-expander-"+d+":toggle",x=b.once(function(){c.load(I,null,function(e,a,d){b.$.trim(c.html())?(c.find(".a-span-last \x3e .a-spacing-top-base").remove(),c.find(".popover-add-to-cart-button").remove(),e=c.find("#a-page \x3e div \x3e div.a-row"),
a=c.find(".popover-in-stock"),a.remove(),a.addClass("aloha-simple-bundle-modal-detailed-info-header-row-text"),e.append(a),a=c.find(".popover-ship-sold-by"),a.remove(),a.addClass("aloha-simple-bundle-modal-detailed-info-header-row-text"),e.append(a),a=c.find(".popover-retail-domain"),a.remove(),e.append(a),e=c.find("#a-page \x3e div \x3e div.a-column.a-span9"),e.removeClass("a-span9"),e.addClass("a-span12")):c.text(q.ajaxFailMsg)})}),w=m+":expand";b.off(w);b.on(w,function(e){u.logItemLink(d);h.find(a.SB_EXPANDER_TITLE).removeClass("aloha-simple-bundle-expand-header-title-truncate");
b.$.trim(c.html())||x()});m+=":collapse";b.off(m);b.on(m,function(e){h.find(a.SB_EXPANDER_TITLE).addClass("aloha-simple-bundle-expand-header-title-truncate")})}var h=g.find(a.SB_EXPANDED_MODAL_EXPANDER_HEADER_PREFIX+d);if(x)c(),f();else{var n=g.find(a.SB_ACCESSORY_ITEM_LINK_PREFIX+d);n.unbind("click.MiniDpClickHandler");n.bind("click.MiniDpClickHandler",function(){u.logItemLink(d);u.logNexusOpenMiniDP(d,e);u.logMiniDPRefTag(d)})}k.setupCheckboxes(A,d,x,e.asin,q.maxBuyboxItemsDesktop,a.SB_BUYBOX_CHECKBOX_PREFIX+
d+" "+a.INPUT_TYPE_CHECKBOX,a.SB_EXPANDED_CHECKBOX_PREFIX+d+" "+a.INPUT_TYPE_CHECKBOX,a.SB_BUYBOX_CHECKBOX_PREFIX+d,a.SB_EXPANDED_CHECKBOX_PREFIX+d,H)});e=b.$(a.BUYBOX_ACCORDION);e.length?e.children().each(function(){h=b.$(this).find(a.ADD_TO_CART_FORM);var e=h.find(a.ADD_TO_CART_ATTACH_BUTTON),d=e.length,q=h.find(a.SB_ROOT).length,m=h.find(":submit").length&&h.find(a.OFFER_LISTING_ID).val();q&&m&&k.setupAddToCart(h,A,c,u,t,x);d&&k.setupAddToCartForButton(e,A,c,u,t,x,h)}):(n&&k.setupAddToCart(h,A,
c,u,t,x),l&&k.setupAddToCartForButton(p,A,c,u,t,x,h))}else g.hide()}},200);n();b.on("a:pageUpdate",n);b.on("attach:dss:initialized",function(){b.off("a:pageUpdate",n);n()})});"use strict";l.when("A","a-checkbox","aloha-uatc","aloha-buy-now-integration","aloha-buybox-form-util").register("aloha-simplebundle-common",function(b,v,D,k,y){function a(a,f){var h=b.$(a);h.change(function(){h.prop("checked",this.checked)});var c=b.$(f);c.length||(c=h);return{$element:h,$container:c,api:v(a),show:function(){c.hasClass(z.AUI_HIDDEN)&&
c.removeClass(z.AUI_HIDDEN);c.show()},hide:function(){c.hasClass(z.AUI_HIDDEN)||c.addClass(z.AUI_HIDDEN)},isVisible:function(){return!c.hasClass(z.AUI_HIDDEN)}}}function f(a,b,h){b.forEach(function(b){a.addItem(b.asin,b.offerListingId,b.quantity);h.logCheckboxSelected(b.index,b.quantity);h.logAddToCartRefTag(b.index)})}function n(b,a,h){var c=[],f=[];a.forEach(function(a,g){var m=b[g];a.api.isChecked()?c.push({asin:m.asin,offerListingId:m.offerListingId,ourPrice:m.ourPrice,ourPriceAmount:m.ourPriceAmount,
ourPriceSymbol:m.ourPriceSymbol,ourPriceCode:m.ourPriceCode,index:g,quantity:h}):f.push({asin:m.asin,ourPrice:m.ourPrice,ourPriceAmount:m.ourPriceAmount,ourPriceSymbol:m.ourPriceSymbol,ourPriceCode:m.ourPriceCode,index:g,isVisible:a.isVisible()})});return{selectedLineItems:c,unselectedItems:f}}var g=/[^\d,\.]/g,h=/,/g,E=/\./g,G=/(^\D+|\D+$)/,z={AUI_HIDDEN:"aok-hidden"};return{createMetricsLogger:function(a){function f(a,b){p.ue&&p.ue.count&&p.ue.count("aloha-simplebundle-"+a,b)}function n(){var e;
e=a.currencyOfPreferenceSupported?{priceFormatted:a.baseItemPrice,priceDecimal:null,currencySymbol:null}:l(a.baseItemPrice);return{baseAsin:a.baseAsin,baseItemPrice:e.priceFormatted,baseItemCurrencySymbol:e.currencySymbol,baseItemPriceDecimal:e.priceDecimal,clientType:a.clientType,feature:"abb"}}function c(e,b){p.ue&&p.ue.event&&(e.requestId=m,e.producerId="atch",e.obfuscatedMarketplaceId=a.marketplaceId,p.ue.event(e,"atch",b,{ssd:!0}))}function k(a){b.ajax("/gp/product/ajax-handlers/reftag.html?ref_\x3d"+
a,{method:"get"})}function t(b){return a.currencyOfPreferenceSupported?{priceFormatted:b.ourPrice,priceDecimal:parseFloat(b.ourPriceAmount)||null,currencySymbol:b.ourPriceSymbol}:l(b.ourPrice)}function l(a){a=a||"";var b=a.lastIndexOf(","),c=a.lastIndexOf("."),d;b>c?(c=E,d=h):(c=h,d=E);(b=a.match(G))&&(b=b[0].trim());c=a.replace(g,"").replace(c,"").replace(d,".");c=parseFloat(c);return{priceFormatted:a,currencySymbol:b,priceDecimal:c}}var m=Date.now().toString(10)+Math.random().toString(16).substring(2,
13);b.defer(function(){f("view",1)});return{logAddToCart:function(a){f("addtocart",a)},logExpandedLink:function(){f("buybox-expanded-link",1)},logCheckboxSelected:function(a,b){f("checkbox-"+(a+1),b)},logItemLink:function(a){f("link-"+(a+1),1)},logImpressionRefTag:function(){k("dp_atch_abb_i")},logAddToCartRefTag:function(a){k("dp_atch_abb_atc_"+(a+1))},logMiniDPRefTag:function(a){k("dp_atch_abb_smdp_"+(a+1))},logNexusImpression:function(a){var b=n();b.accessories=a.map(function(a,b){var c=t(a);return{asin:a.asin,
displayPosition:b+1,price:c.priceFormatted,currencySymbol:c.currencySymbol,priceDecimal:c.priceDecimal}});c(b,"attach.ABBImpression.5")},logNexusAddBaseToCart:function(a,b,f){var d=n();d.baseQuantity=Number(f);d.accessoriesAdded=a.map(function(a){var b=t(a);return{asin:a.asin,displayPosition:a.index+1,quantity:Number(a.quantity),price:b.priceFormatted,currencySymbol:b.currencySymbol,priceDecimal:b.priceDecimal}});d.accessoriesNotAdded=b.map(function(a){var b=t(a);return{asin:a.asin,displayPosition:a.index+
1,price:b.priceFormatted,currencySymbol:b.currencySymbol,priceDecimal:b.priceDecimal}});c(d,"attach.ABBAddBaseToCart.9")},logNexusOpenMiniDP:function(a,b){var f=t(b),d=n();d.accessoryAsin=b.asin;d.accessoryDisplayPosition=Number(a)+1;d.accessoryPrice=f.priceFormatted;d.accessoryItemCurrencySymbol=f.currencySymbol;d.accessoryItemPriceDecimal=f.priceDecimal;c(d,"attach.ABBShowMiniDP.4")}}},getSimpleBundlePageState:function(){var a=b.$(".simpleBundleJavascriptParameters").find("script").html();return b.parseJSON(a)},
getCheckboxCollectionObject:a,setupAddToCart:function(a,h,g,c,l,t){function v(a,r){if(m){var d=b.$(a.currentTarget);if(k.isBuyNow(d)){var q=t?1:e.find("*[name\x3d'quantity']").val()||1,w=n(g,h,q);k.checkoutWith(w.selectedLineItems,d)}else return}var C=D.createAddToCartRequest(l,function(){r()},function(){p.ueLogError&&p.ueLogError({message:"[There was an error while adding items to the cart using the universal add to cart api.]"},{logLevel:"ERROR",attribution:"SimpleBundle"});r()}),q=t?1:e.find("*[name\x3d'quantity']").val()||
1,w=n(g,h,q);f(C,w.selectedLineItems,c);d=w.unselectedItems.filter(function(a){return a.isVisible});c.logNexusAddBaseToCart(w.selectedLineItems,d,q);q=C.count();0!==q&&(d=b.$(a.currentTarget),k.isBuyNow(d)?k.checkoutWith(w.selectedLineItems,d):(m=!0,a.preventDefault(),c.logAddToCart(q),C.call()))}var m=!1,e=a;a.unbind("submit.SimpleBundleSubmitHandler");a.bind("submit.SimpleBundleSubmitHandler",function(a){var c=b.$(this);v(a,function(){c.submit()})});a.find(":submit").unbind("click.SBB");a.find(":submit").bind("click.SBB",
function(a){var c=b.$(this),d=c.closest(".a-accordion-row-container");d.length&&(e=d,v(a,function(){c.click()}))})},setupAddToCartForDeclarative:function(a,b,h,c,g,k,v){a.unbind("click.SimpleBundleClickHandler");a.bind("click.SimpleBundleClickHandler",function(a){a=D.createAddToCartRequest(g,function(){l.now("attach-external-atc-interceptor").execute(function(a){a&&q.selectedLineItems.forEach(function(b){a.updateAttachModule(b.asin)})})},function(){p.ueLogError&&p.ueLogError({message:"[There was an error while adding items to the cart using the universal add to cart api.]"},
{logLevel:"ERROR",attribution:"SimpleBundle"})});var e=k?1:v.find("*[name\x3d'quantity']").val()||1,q=n(h,b,e);f(a,q.selectedLineItems,c);var r=q.unselectedItems.filter(function(a){return a.isVisible});c.logNexusAddBaseToCart(q.selectedLineItems,r,e);if(e=a.count())c.logAddToCart(e),a.call()})},setupCheckboxes:function(b,f,h,c,g,k,n,m,e,l){var r=a(k,m);b.push(r);r.api.enable();r.$element.data("asin",c);if(h){var d=a(n,e);d.api.enable();d.api.check(r.api.isChecked());d.$element.change(function(){var a=
d.api.isChecked();r.api.check(a)});r.$element.change(function(){var a=r.api.isChecked();d.api.check(a);var c=0;b.forEach(function(a){c<g&&a.api.isChecked()?(c++,a.show()):a.hide()});c<g&&b.forEach(function(a){c<g&&a.api.isUnchecked()&&(c++,a.show())})})}else"SINGLE"===l&&r.$element.change(function(){r.api.isChecked()&&b.forEach(function(a,b){f!==b&&a.api.uncheck()})});0<b.length&&b[0].$element.change()},setupAddToCartForButton:function(a,f,h,c,g,k,p){function m(){var a=k?1:e.find("*[name\x3d'quantity']").val()||
1,b=n(h,f,a);y.addItems(p,b.selectedLineItems,c);var d=b.unselectedItems.filter(function(a){return a.isVisible});l.now("attach-external-atc-interceptor").execute(function(a){a&&b.selectedLineItems.forEach(function(b){a.updateAttachModule(b.asin)})});c.logNexusAddBaseToCart(b.selectedLineItems,d,a);c.logAddToCart(b.selectedLineItems.length)}var e=p;a.unbind("click.button.SBB");a.bind("click.button.SBB",function(){var a=b.$(this).closest(".a-accordion-row-container");a.length&&(e=a);m()})}}});"use strict";
l.when("A").register("aloha-uatc",function(b){function l(p,k,v,a,f){var n=0;f=f||5E3;a=a||v;var g={clientName:"AmazonWireless"};g.verificationSessionID=p;return{count:function(){return n},call:function(){n&&b.post("/gp/add-to-cart/json",{timeout:f,params:g,success:k,error:v,abort:a})},addItem:function(a,b,f){g["ASIN."+n]=a;g["offerListingID."+n]=b;g["quantity."+n]=f||1;n++}}}return{createAddToCartRequest:l,createSingleFinalCallbackAddToCartRequest:function(b,k){return l(b,k,k,k)}}});"use strict";
l.when("ready").register("aloha-buy-now-integration",function(){var b={};l.when("turbo-checkout-buy-now-integration").execute(function(l){b=l});return{isBuyNow:function(l){return"function"===typeof b.isBuyNow&&b.isBuyNow(l)},checkoutWith:function(l,p){return b.checkoutWith(l,p)}}});"use strict";l.when("A").register("aloha-buybox-form-util",function(b){function l(a){for(var b=2;0<a.find('input[name\x3d"asin.'+b+'"]').length||0<a.find('input[name\x3d"offeringID.'+b+'"]').length;)b++;return b}function p(a,
b){for(;0<a.find('input[name\x3d"asin.'+b+'"]').length||0<a.find('input[name\x3d"offeringID.'+b+'"]').length;)b++;return b}function k(a,f){return[b.$("\x3cinput /\x3e",{type:"hidden",name:"asin."+f,value:a.asin,class:"aloha-accessory-form-input"}),b.$("\x3cinput /\x3e",{type:"hidden",name:"offeringID."+f,value:a.offerListingId,class:"aloha-accessory-form-input"}),b.$("\x3cinput /\x3e",{type:"hidden",name:"quantity."+f,value:a.quantity||1,class:"aloha-accessory-form-input"})]}var y=[];b.on("aloha:detailPage:reappear",
function(){y=[];b.$(".aloha-accessory-form-input").remove()});return{addItems:function(a,b,n){var g=l(a);b.forEach(function(b){if(b!==B&&b.asin&&b.offerListingId){g=p(a,g);var f=k(b,g);f.forEach(function(b){a.append(b)});y.push(f);g++;n&&(n.logCheckboxSelected(b.index,b.quantity),n.logAddToCartRefTag(b.index))}});b=a.find('input[name\x3d"itemCount"]');0===b.length?a.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+g+'"\x3e'):b[0].value=g}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageClimatePledgeFriendlyNewAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","climate-pledge-friendly-csm-counters","cf").execute(function(a,e){function f(){return a.capabilities.isAmazonApp?"map":a.capabilities.tablet?"twb":a.capabilities.mobile?"mwb":"dsk"}a.declarative("CPF-ATF-Badge","click",function(a){e.incrementCounter("cpf_dp_"+
f()+"_dppb_bgck")});a.declarative("CPF-BTF-CallToAction","click",function(a){e.incrementCounter("cpf_dp_"+f()+"_dpcd_lmlk")});a.declarative("a-modal","click",function(a){a=a.$currentTarget[0].id;-1!==a.indexOf("CPF-BTF-Certificate-Name")?e.incrementCounter("cpf_dp_"+f()+"_dpcd_cfnm"):-1!==a.indexOf("CPF-BTF-Certificate-Logo")&&e.incrementCounter("cpf_dp_"+f()+"_dpcd_cflg")});a.declarative("CPF-OpenExternalLink","click",function(l){e.incrementCounter("cpf_dp_"+f()+"_dpcd_excf");var k=l.$currentTarget[0].firstChild.href;
a.capabilities.isAmazonApp?b.when("mash").execute(function(a){a.openInExternalBrowser({url:k})}):c.open(k,"_blank")});b.when("A","a-sheet").execute("dp-cpf-bottom-sheet-declarative-action",function(a,b){var c=a.$,g;a.declarative("dp-cpf-sheet","click",function(d){var h=d&&d.data||{};g&&g.destroy();g=b.create({name:"dp-cpf-bottom-sheet",preloadDomId:"dp-cpf-bottom-sheet",height:1,closeType:"icon",sheetLabel:h.sheetLabel,sheetDescription:h.sheetDescription});b.showSheet(g);a.on("a:sheet:afterShow:dp-cpf-bottom-sheet",
function(a){var b=c("#"+h.preloadDomId).clone().removeAttr("id");b.find(".dp-cpf-container-bottom-sheet").attr("id","dp-cpf-bottom-sheet-content");g.getContentContainer().append(b.html());a.sheet.changeHeight({height:document.querySelector("#dp-cpf-bottom-sheet-content").offsetHeight,duration:.3});e.incrementCounter("cpf_dp_"+f()+"_dpcd_cfcd")})})})});"use strict";b.when("A").register("climate-pledge-friendly-csm-counters",function(a){return{incrementCounter:function(a,b){b=b||1;b=(ue.count(a)||0)+
b;ue.count(a,b)}}})});
/* ******** */
(function(p){var q=window.AmazonUIPageJS||window.P,u=q._namespace||q.attributeErrors,d=u?u("QuantitySelectorAssets",""):q;d.guardFatal?d.guardFatal(p)(d,window):d.execute(function(){p(d,window)})})(function(p,q,u){p.when("A","QuantitySelectorConstants","a-util").execute("qsAUIDeps-main",function(d,a,c){function e(){b&&b.enableCheckoutCompatibility&&g()}function g(){d.$('span[id^\x3d"'+a.getQsWidgetSummaryPriceId("")+'"][data-a-color\x3d"price"]').each(function(){d.$(this)[0].style.color="#B12704"});
d.$('span[id^\x3d"'+a.getQsWidgetButtonId("")+'"]').each(function(){var a=d.$(this);a.hasClass("a-button-dropdown")&&a.hasClass("a-button-small")&&(a=a.attr("id"),d.$('button[id^\x3d"'+a+'-announce"]').each(function(){d.$(this)[0].style.paddingRight="17px"}))})}function m(a){function b(a){return d.$(a+"-announce")}return function(a){return new b(a)}}function D(b){var e=function(a,f){var e=a+"-extradata",c=b.state(e);if(null==f)return e=b.state(a),f=d.$.extend({},e,c);c=d.$.extend({},c,f);b.state(e,
c)};e.parse=function(){for(var e=d.$(a.getQsWidgetGenericStateSelectorQuery()),f=a.getQsWidgetConfigurationId(""),n=0;n<e.length;n++){var g=e[n].getAttribute("data-a-state");if((g=c.parseJSON(g).key)&&g.substring(0,f.length)==f){var r=b.state(g);r&&r.id||(r=c.parseJSON(e[n].innerHTML),b.state(g,r))}}};e.replace=function(a,e){a+="-extradata";"function"===typeof b.state.replace?b.state.replace(a,e):b.state(a,e)};return{state:e}}var b;p.when("QuantitySelectorAUIDeps_AState","QuantitySelectorAUIDeps_AButton").execute("qsAUIDeps-register",
function(a,b){p.register("QuantitySelectorAUIDeps",function(){return{aUtil:c,aState:a.object,aButton:b.object,initialize:e}})});(function(){for(var e=d.$(a.getQsWidgetGenericStateSelectorQuery()),g=a.getQsWidgetGlobalConfigurationId(),h=0;h<e.length;h++){var f=e[h].getAttribute("data-a-state");if((f=c.parseJSON(f).key)&&f.substring(0,g.length)==g){b=c.parseJSON(e[h].innerHTML);break}}})();(function(){b&&b.enableCheckoutCompatibility?(p.when("a-state").execute("qsAUIDeps-checkout-compat-a-state-register",
function(a){p.register("QuantitySelectorAUIDeps_AState",function(){return{object:D(a)}})}),p.when("a-buttons").execute("qsAUIDeps-checkout-compat-a-button-register",function(a){p.register("QuantitySelectorAUIDeps_AButton",function(){return{object:m(a)}})}),d.on("checkout:afterReload",function(){d.trigger(a.getQsWidgetEventInitialize(),!1)})):(p.when("a-state").execute("qsAUIDeps-a-state-register",function(a){p.register("QuantitySelectorAUIDeps_AState",function(){return{object:a}})}),p.when("a-button").execute("qsAUIDeps-a-button-register",
function(a){p.register("QuantitySelectorAUIDeps_AButton",function(){return{object:a}})}));d.on("a:pageUpdate ready",function(){d.trigger(a.getQsWidgetEventInitialize(),!1)})})();e()});"use strict";p.when("A").register("QuantitySelectorConstants",function(d){var a={height:303,heightWithAtc:355,disclaimerTextAdjustment:41,disclaimerTextAdjustmentWithAtc:40},c={scrollEventStop:200,constant:19,increment:45,adjustment:20};return{getQsWidgetEventInitialize:function(){return"quantity-selector-widget:initialize"},
getQsWidgetEventLoadStatesAndInitialize:function(){return"quantity-selector-widget:loadStatesAndInitialize"},getQsWidgetEventTriggerAction:function(){return"quantity-selector-widget:triggerAction"},getQsWidgetVariationEventTriggerAction:function(){return"quantity-selector-widget-variation-selector:triggerAction"},getQsWidgetEventConfigureList:function(){return"quantity-selector-widget:configure:list"},getQsWidgetEventConfigureEnable:function(){return"quantity-selector-widget:configure:enable"},getQsWidgetEventConfigureDisable:function(){return"quantity-selector-widget:configure:disable"},
getQsWidgetEventConfigureReset:function(){return"quantity-selector-widget:configure:reset"},getQsWidgetEventConfigureGet:function(){return"quantity-selector-widget:configure:get"},getQsWidgetEventConfigureSet:function(){return"quantity-selector-widget:configure:set"},getQsWidgetEventSelectId:function(){return"quantity-selector-widget:selectId"},getQsWidgetVariationEventSelectId:function(){return"quantity-selector-widget-variation-selector:selectId"},getQsWidgetEventSelectQuantity:function(){return"quantity-selector-widget:selectQuantity"},
getQsWidgetEventAction:function(a){return"quantity-selector-widget:action:"+a},getQsWidgetAuiInputTextWrapperClass:function(){return"a-input-text-wrapper"},getQsWidgetActivateDebounce:function(){return 100},getQsWidgetInitialViewDropdown:function(){return"dropdown"},getQsWidgetInitialViewTextLink:function(){return"text_link"},getQsWidgetActionTriggerOnConfirmation:function(){return"on_confirmation"},getQsWidgetActionTriggerOnSelect:function(){return"on_select"},getQsWidgetGlobalConfigurationId:function(){return"qs-widget-global-configuration"},
getQsWidgetConfigurationId:function(a){return"qs-widget-configuration-"+a},getQsWidgetStateScriptSelectorQuery:function(a){return"script[data-a-state*\x3d'qs-widget-configuration-"+a+"'], "+("div[data-a-state*\x3d'qs-widget-configuration-"+a+"']")},getQsWidgetGenericStateSelectorQuery:function(){return"script[type\x3d'a-state'], div[data-a-state]"},getQsWidgetContainerId:function(a){return"qs-widget-container-"+a},getQsWidgetDivSelectorQueryForWidgetContainers:function(){return"div[id^\x3dqs-widget-container-]"},
getQsWidgetSpinnerId:function(a){return"qs-widget-spinner-"+a},getQsWidgetDivSelectorQueryForSpinners:function(){return"div[id^\x3dqs-widget-spinner-]"},getQsWidgetCheckboxId:function(a){return"qs-widget-checkbox-"+a},getQsWidgetInputSelectorQueryForCheckboxes:function(){return"input[id^\x3dqs-widget-checkbox-]"},getQsWidgetButtonContainerId:function(a){return"qs-widget-button-container-"+a},getQsWidgetButtonId:function(a){return"qs-widget-button-"+a},getQsWidgetDropdownContainerId:function(a){return"qs-widget-dropdown-container-"+
a},getQsWidgetDropdownId:function(a){return"qs-widget-dropdown-"+a},getQsWidgetDropdownViewId:function(a){return"qs-widget-dropdown-view-"+a},getQsWidgetVariationDropdownViewId:function(a){return"qs-widget-dropdown-view-variation-"+a},getQsWidgetDropdownItemId:function(a,c){return"qs-widget-dropdown-item-"+c+"-"+a},getQsWidgetDropdownItemAriaId:function(a,c){return"qs-widget-dropdown-item-aria-"+c+"-"+a},getQsWidgetDropdownItemQuantitySuffixId:function(a,c){return"qs-widget-dropdown-item-quantitySuffix-"+
c+"-"+a},getQsWidgetDropdownUnorderedListId:function(a){return"qs-widget-dropdown-unorderedlist-"+a},getQsWidgetDropdownVariationUnorderedListId:function(a){return"qs-widget-dropdown-variation-unorderedlist-"+a},getQsWidgetTextInputId:function(a){return"qs-widget-text-input-"+a},getQsWidgetTextInputContainerId:function(a){return"qs-widget-text-input-container-"+a},getQsWidgetTextInputUpdateButtonId:function(a){return"qs-widget-text-input-updatelink-"+a},getQsWidgetTextInputUpdateButtonContainerId:function(a){return"qs-widget-text-input-updatelink-container-"+
a},getQsWidgetTextInputUpdateButtonDecl:function(){return"qs-widget-text-input-updatelink-decl"},getQsWidgetTextInputDecl:function(){return"qs-widget-text-input-decl"},getQsWidgetQuantityContainerId:function(a){return"qs-widget-quantity-container-"+a},getQsWidgetQuantityId:function(a){return"qs-widget-quantity-"+a},getQsWidgetQuantitySuffixId:function(a){return"qs-widget-quantity-suffix-"+a},getQsWidgetInitialViewSuffixId:function(a){return"qs-widget-initialView-suffix-"+a},getQsWidgetSummaryId:function(){return"qs-widget-summary-"},
getQsWidgetSummaryPriceId:function(a){return"qs-widget-summary-price-"+a},getQsWidgetSummaryPriceSymbolId:function(a){return"qs-widget-summary-price-symbol-"+a},getQsWidgetSummaryPriceWholeId:function(a){return"qs-widget-summary-price-whole-"+a},getQsWidgetSummaryPriceFractionId:function(a){return"qs-widget-summary-price-fraction-"+a},getQsWidgetSummaryPriceDecimalId:function(a){return"qs-widget-summary-price-decimal-"+a},getQsWidgetSummaryAtcId:function(a){return"qs-widget-summary-atc-"+a},getQsWidgetFooterPriceContainerId:function(a){return"qs-widget-footer-price-container-"+
a},getQsWidgetFooterPriceSymbolId:function(a){return"qs-widget-footer-price-symbol-"+a},getQsWidgetFooterPriceWholeId:function(a){return"qs-widget-footer-price-whole-"+a},getQsWidgetFooterPriceFractionId:function(a){return"qs-widget-footer-price-fraction-"+a},getQsWidgetFooterPriceDecimalId:function(a){return"qs-widget-footer-price-decimal-"+a},getQsWidgetFooterQuantitySuffixContainerId:function(a){return"qs-widget-footer-quantitySuffix-container-"+a},getQsWidgetFooterQuantitySuffixId:function(a){return"qs-widget-footer-quantitySuffix-"+
a},getQsWidgetButtonDecl:function(){return"qs-widget-button-decl"},getQsWidgetSummaryAtcDecl:function(){return"qs-widget-summary-atc-decl"},getQsWidgetQuantityChangelinkId:function(a){return"qs-widget-quantity-changelink-"+a},getQsWidgetQuantityChangelinkDecl:function(){return"qs-widget-quantity-changelink-decl"},getQsWidgetDropdownItemDecl:function(){return"qs-widget-dropdown-item-decl"},getQsWidgetVariationDropdownItemDecl:function(){return"qs-widget-dropdown-variation-item-decl"},getQsWidgetDropdownDecl:function(){return"qs-widget-dropdown-decl"},
getQsWidgetDropdownScrollMetricThreshold:function(){return 20},getQsWidgetBottomSheetId:function(a){return"qs-widget-bottom-sheet-"+a},getQsWidgetBottomSheetContainerId:function(a){return"qs-widget-bottom-sheet-container-"+a},getQsWidgetBottomSheetQuantitySuffixId:function(a){return"qs-widget-bottom-sheet-quantitySuffix-"+a},getQsWidgetInitialViewTextLinkId:function(a){return"qs-widget-link-"+a},getQsWidgetBottomSheetHeightConfig:function(){return a},getQsWidgetBottomSheetDropDownScrollFactor:function(){return c},
getQsWidget1DBottomSheetSelectorCssClass:function(){return"qs-widget-new-1d-dropdown-li"},getQsWidget2DBottomSheetSelectorCssClass:function(){return"qs-widget-new-2d-dropdown-li"},getQsWidgetVariationSelectorListMapKey:function(){return"variationSelectorListsMap"},getQsWidgetVariationSelectorSelectedIdKey:function(){return"selectedId"},getQsWidgetVariationSelectorDisplayTextKey:function(){return"displayText"},getQsWidgetVariationSelectorDisplayTextWithQuantityKey:function(){return"displayTextWithQuantity"}}});
"use strict";p.when("A","QuantitySelectorState","QuantitySelectorAUIDeps").register("QuantitySelectorMetadata",function(d,a,c){function e(d){return(d=a.getQsWidgetConfiguration(d).metadata)?c.aUtil.parseJSON(d):null}return{isWeblabEnabled:function(a,c,d){a:{if((a=e(a))&&a.weblabs)for(var b=0;b<a.weblabs.length;b++){var k=a.weblabs[b];if(k.weblabName==c){c=k.treatment;break a}}c=null}return null==c?d:"T1"==c?!0:!1},getMetaConfiguration:function(a,c){return(a=e(a))?a[c]:null}}});"use strict";p.when("A",
"QuantitySelectorAUIDeps","QuantitySelectorConstants").register("QuantitySelectorMetrics",function(d,a,c){function e(a){q.ue&&q.ue.count&&a&&ue.count(a,(ue.count(a)||0)+1)}var g=Infinity;p.when("ready").execute(function(){g=d.now()});var m=new Set;return{incrementInitializeCount:function(a,b){var c="QuantitySelector-Initialize",c=a?c+"-Success-Count":c+"-Failed-Count";e(b?c+":mobile":c+":desktop")},incrementInvalidIdCount:function(){e("QuantitySelector-InvalidID")},incrementTriggerActionCount:function(a,
b,c){a="QuantitySelector-TriggerAction-"+a;a=b?a+"-Success-Count":a+"-Failed-Count";e(c?a+":mobile":a+":desktop")},incrementChangeLinkCount:function(){e("QuantitySelector-ChangeLink-Count")},incrementShowPopup:function(a){var b="QuantitySelector-ShowPopup-Count";e(a?b+":mobile":b+":desktop")},logLatencyMetric:function(a,b,c){"WidgetParsed"==a||"WidgetReady"==a?("WidgetParsed"==a&&b>=g?(m.add(c),c=!0):c="WidgetReady"==a?m.has(c):!1,c=!c):c=!0;c&&(a="QuantitySelector-TimeTo-"+a,q.ue&&q.ue.count&&a&&
"undefined"!==typeof q.ue_t0&&(b-=q.ue_t0,ue.count(a,b),ue.count(a+"Hundredths",Math.floor(b/10))))},logCsm:function(d,b){var k=a.aState.state(c.getQsWidgetConfigurationId(d));if(k&&(d="mobile"==k.viewType.toLowerCase()?"mob":"dsk",(k=k.qsCsm)&&k.almBrandRefMarker&&k.pageRefMarker)){var e;a:{e=k.sellingUomDimension;var h=k.pricingUomDimension;if(e&&h){var f="s";switch(e){case "count":f+="u";break;case "weight":f+="w";break;default:e=void 0;break a}f+="p";switch(h){case "count":f+="u";break;case "weight":f+=
"w";break;default:e=void 0;break a}e=f}else e=void 0}e&&(b={pageType:k.pageType,subPageType:k.subPageType,pageTypeId:k.pageTypeId,storeName:k.tabId,programRegionId:k.programRegionId,hitType:k.hitType,refMarker:k.almBrandRefMarker+"_"+d+"_"+k.pageRefMarker+"_qs_"+b+"_"+e},q.ue&&q.ue.event&&ue.event(b,"quantityselector_attr","quantityselector.QuantityselectorMetrics.1"))}}}});"use strict";p.when("A","QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps").register("QuantitySelectorState",
function(d,a,c,e){function g(b){var c=e.aState.state(a.getQsWidgetConfigurationId(b));c&&c.id||(m(b),c=e.aState.state(a.getQsWidgetConfigurationId(b)));return c}function m(b){var c=a.getQsWidgetConfigurationId(b);b=a.getQsWidgetStateScriptSelectorQuery(b);b=d.$(b).first();b=e.aUtil.parseJSON(b.html());e.aState.state(c,b)}function p(){for(var b=[],c=d.$(a.getQsWidgetGenericStateSelectorQuery()),g=a.getQsWidgetConfigurationId(""),h=0;h<c.length;h++){var f=c[h].getAttribute("data-a-state");(f=e.aUtil.parseJSON(f).key)&&
f.substring(0,g.length)==g&&(f=f.substring(g.length),b.push(f))}return b}d.on(a.getQsWidgetEventConfigureList(),function(a){"function"===typeof a&&a(p())});d.on(a.getQsWidgetEventConfigureGet(),function(a,c){a=g(a);"function"===typeof c&&c(a)});d.on(a.getQsWidgetEventConfigureSet(),function(b,c){e.aState.state.replace(a.getQsWidgetConfigurationId(b),c);d.trigger(a.getQsWidgetEventInitialize(),!0,b)});return{getQsWidgetConfiguration:g,loadQsWidgetStateConfiguration:m,saveOriginalSettings:function(b,
c){var d=a.getQsWidgetConfigurationId(b)+"-original",h=e.aState.state(d);!c&&h&&h.id||(b=g(b),e.aState.state(d,b))},loadOriginalSettings:function(b){var c=a.getQsWidgetConfigurationId(b)+"-original";(c=e.aState.state(c))&&c.id&&e.aState.state.replace(a.getQsWidgetConfigurationId(b),c)},setEnable:function(b,c){c={enable:c};e.aState.state(a.getQsWidgetConfigurationId(b),c)},setInitialized:function(b){e.aState.state(a.getQsWidgetConfigurationId(b),{initialized:!0})},setSelectedId:function(b,c){c={selectedId:c,
selectedQuantity:null};e.aState.state(a.getQsWidgetConfigurationId(b),c)},setSelectedQuantity:function(b,c){c={selectedId:null,selectedQuantity:c};e.aState.state(a.getQsWidgetConfigurationId(b),c)},setData:function(c,d){e.aState.state(a.getQsWidgetConfigurationId(c),d)},getQsUIDs:p}});"use strict";p.when("A","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorAUIDeps","QuantitySelectorMetrics").register("QuantitySelectorUtils",function(d,a,c,e,g){function m(a){return"true"==a||1==
a?!0:!1}function p(l){return"mobile"==a.getQsWidgetConfiguration(l).viewType.toLowerCase()?!0:!1}function b(l){l=a.getQsWidgetConfiguration(l);return m(l.showConfirmationView)?!0:!1}function k(l){l=a.getQsWidgetConfiguration(l);return m(l.allowZeroQuantity)?!0:!1}function r(a){var b=d.$("#"+c.getQsWidgetQuantityChangelinkId(a));a=d.$("#"+c.getQsWidgetTextInputUpdateButtonId(a));b.attr("draggable","false");a.attr("draggable","false")}function h(a){return d.$("#"+c.getQsWidgetContainerId(a))}function f(a){return e.aButton("#"+
c.getQsWidgetButtonId(a))}function n(a){return d.$("#"+c.getQsWidgetDropdownContainerId(a))}function t(a){return d.$("#"+c.getQsWidgetDropdownViewId(a))}function v(a){return d.$("#"+c.getQsWidgetDropdownUnorderedListId(a))}function q(a){return d.$("#"+c.getQsWidgetTextInputId(a))}function w(l,c){l=a.getQsWidgetConfiguration(l);for(var b=0;b<l.qsItems.length;b++)if(l.qsItems[b].id==c)return l.qsItems[b]}function A(l){var c=a.getQsWidgetConfiguration(l).selectedId;return c?c:y(l)}function y(l){l=a.getQsWidgetConfiguration(l);
if(l.qsItems)for(var c=0;c<l.qsItems.length;c++)if(m(l.qsItems[c].isSelected))return l.qsItems[c].id}function u(l){return a.getQsWidgetConfiguration(l).selectedQuantity}function B(a,c){return(k(a)?/^(([0-9]\d{0,2}))$/:/^(([1-9]\d{0,2})|(0[1-9]\d?)|(00[1-9]))$/).test(c)}function C(a){if(a){var b=d.$("#"+c.getQsWidgetCheckboxId(a)),f=h(a);a=d.$("#"+c.getQsWidgetSpinnerId(a))}else b=d.$(c.getQsWidgetInputSelectorQueryForCheckboxes()),a=d.$(c.getQsWidgetDivSelectorQueryForSpinners()),f=d.$(c.getQsWidgetDivSelectorQueryForWidgetContainers());
b.remove();a.removeClass("qs-widget-visible");a.addClass("qs-widget-hidden");f.removeClass("qs-widget-hidden")}var x=[];d.on(c.getQsWidgetEventTriggerAction(),function(l,b,f){var n=a.getQsWidgetConfiguration(l),h=n.selectedId,k=n.selectedQuantity;b||(b=n.actionId);var t="mobile"==n.viewType.toLowerCase(),r=!1;if(h)for(var m=0;m<n.qsItems.length;m++)if(n.qsItems[m].id==h){var r=e.aUtil.parseJSON(n.staticData),p=e.aUtil.parseJSON(n.qsItems[m].data),r=d.$.extend({qsUID:l,tunneledData:f},r,p);d.trigger(c.getQsWidgetEventAction(b),
r);g.incrementTriggerActionCount(b,!0,t);r=!0}k&&(r=e.aUtil.parseJSON(n.staticData),r=d.$.extend({qsUID:l,tunneledData:f},r,{quantity:k}),d.trigger(c.getQsWidgetEventAction(b),r),g.incrementTriggerActionCount(b,!0,t),r=!0);r||g.incrementTriggerActionCount(b,!1,t)});return{isInitialized:function(l){return(l=a.getQsWidgetConfiguration(l))?l.initialized:!1},isMobile:p,isQsWidgetEnabled:function(l){l=a.getQsWidgetConfiguration(l);return l.hasOwnProperty("enable")?m(l.enable):!0},isConfirmationViewEnabled:b,
isAllowZeroQuantityEnabled:k,isInitialViewDropdown:function(l){return a.getQsWidgetConfiguration(l).initialView.toLowerCase()==c.getQsWidgetInitialViewDropdown()?!0:!1},isInitialViewTextLink:function(l){return a.getQsWidgetConfiguration(l).initialView.toLowerCase()==c.getQsWidgetInitialViewTextLink()?!0:!1},isVariationSelectorEnabled:function(a){return!1},getQsWidgetBottomSheetConfig:function(l){var f=a.getQsWidgetConfiguration(l),d=c.getQsWidgetBottomSheetHeightConfig(),n=0;f.summaryDisclaimerText||
(n=b(l)?d.disclaimerTextAdjustmentWithAtc:d.disclaimerTextAdjustment);return b(l)?{closeMessage:f.bottomSheetCancelText,height:d.heightWithAtc-n}:{closeMessage:f.bottomSheetDoneText,height:d.height-n}},isActionTriggerOnConfirmation:function(l){return a.getQsWidgetConfiguration(l).actionTrigger.toLowerCase()==c.getQsWidgetActionTriggerOnConfirmation()?!0:!1},isActionTriggerOnSelect:function(l){return a.getQsWidgetConfiguration(l).actionTrigger.toLowerCase()==c.getQsWidgetActionTriggerOnSelect()?!0:
!1},isTextInputRequired:function(a,c){a=w(a,c).quantityText;return"+"==a.substr(a.length-1)?{result:!0,initialQuantityText:a.substr(0,a.length-1)}:{result:!1}},initializeWidget:function(a){var b=A(a);b?d.trigger(c.getQsWidgetEventSelectId(),a,b,!1,function(){r(a)}):(b=u(a))&&d.trigger(c.getQsWidgetEventSelectQuantity(),a,b,!1,function(){r(a)});C(a)},activateWidget:function(a){var b=x.indexOf(a);-1<b&&x.splice(b,1);setTimeout(function(){x.push(a)},c.getQsWidgetActivateDebounce())},deactivateWidget:function(a){a=
x.indexOf(a);-1<a&&x.splice(a,1)},getActivatedQsWidgets:function(){return x},hideComponent:function(a,b){a.addClass("aok-hidden")},showComponent:function(a){a.removeClass("aok-hidden")},isComponentVisible:function(a){return!a.hasClass("aok-hidden")},setComponentVisibility:function(a,b){b?a.css("visibility","visible"):a.css("visibility","hidden")},setHtml:function(a,b){a.html(b)},setQsWidgetContainerMinWidthAndHeight:function(a){a=h(a);a.css("min-width",a.width()+"px");a.css("min-height",a.height()+
"px")},resetQsWidgetContainerMinWidthAndHeight:function(a){a=h(a);a.css("min-width","0px");a.css("min-height","0px")},enableQsWidget:function(b){var c=f(b),d=q(b);c.enable();d.removeClass("a-form-disabled");d.addClass("a-form-normal");d.removeAttr("disabled");a.setEnable(b,!0)},disableQsWidget:function(b){var c=f(b),d=q(b);c.disable();d.removeClass("a-form-normal");d.addClass("a-form-disabled");d.attr("disabled","disabled");a.setEnable(b,!1)},popOutDropDownContainer:function(a){var b=h(a).offset();
a=n(a);a.appendTo(document.body);a.css({left:b.left,top:b.top})},getQsWidgetButtonContainer:function(a){return d.$("#"+c.getQsWidgetButtonContainerId(a))},getQsWidgetButtonAsComponent:f,getQsWidgetButton:function(a){return d.$("#"+c.getQsWidgetButtonId(a)+"-announce")},getQsWidgetDropdownContainer:n,getQsWidgetDropdownElement:function(a){return d.$("#"+c.getQsWidgetDropdownId(a))},getQsWidgetDropdownViewSelector:t,getQsWidgetDropdownUnorderedListElement:v,getQsWidgetDropdownVariationUnorderedListElement:function(a){return d.$("#"+
c.getQsWidgetDropdownVariationUnorderedListId(a))},getQsWidgetDropdownItemElement:function(a,b){return d.$("#"+c.getQsWidgetDropdownItemAriaId(a,b))},getQsWidgetTextInputContainer:function(a){return d.$("#"+c.getQsWidgetTextInputContainerId(a))},getQsWidgetTextInputElement:q,getQsWidgetTextInputUpdateButtonContainer:function(a){return d.$("#"+c.getQsWidgetTextInputUpdateButtonContainerId(a))},getQsWidgetQuantityContainer:function(a){return d.$("#"+c.getQsWidgetQuantityContainerId(a))},getQsWidgetQuantityElement:function(a){return d.$("#"+
c.getQsWidgetQuantityId(a))},getQsWidgetQuantitySuffixElement:function(a){return d.$("#"+c.getQsWidgetQuantitySuffixId(a))},getQsWidgetInitialViewSuffixElement:function(a){return d.$("#"+c.getQsWidgetInitialViewSuffixId(a))},getQsWidgetSummaryAtcButton:function(a){return d.$("#"+c.getQsWidgetSummaryAtcId(a))},getQsWidgetSummaryContainer:function(a){return d.$("#"+c.getQsWidgetSummaryPriceId(a))},getQsWidgetSummaryPriceSymbolElement:function(a){return d.$("#"+c.getQsWidgetSummaryPriceSymbolId(a))},
getQsWidgetSummaryPriceWholeElement:function(a){return d.$("#"+c.getQsWidgetSummaryPriceWholeId(a))},getQsWidgetSummaryPriceFractionElement:function(a){return d.$("#"+c.getQsWidgetSummaryPriceFractionId(a))},getQsWidgetSummaryPriceDecimalElement:function(a){return d.$("#"+c.getQsWidgetSummaryPriceDecimalId(a))},getQsWidgetFooterPriceContainer:function(a){return d.$("#"+c.getQsWidgetFooterPriceContainerId(a))},getQsWidgetFooterPriceSymbolElement:function(a){return d.$("#"+c.getQsWidgetFooterPriceSymbolId(a))},
getQsWidgetFooterPriceWholeElement:function(a){return d.$("#"+c.getQsWidgetFooterPriceWholeId(a))},getQsWidgetFooterPriceFractionElement:function(a){return d.$("#"+c.getQsWidgetFooterPriceFractionId(a))},getQsWidgetFooterPriceDecimalElement:function(a){return d.$("#"+c.getQsWidgetFooterPriceDecimalId(a))},getQsWidgetFooterQuantitySuffixContainer:function(a){return d.$("#"+c.getQsWidgetFooterQuantitySuffixContainerId(a))},getQsWidgetFooterQuantitySuffixElement:function(a){return d.$("#"+c.getQsWidgetFooterQuantitySuffixId(a))},
getQsWidgetBottomSheetQuantitySuffixElement:function(a){return d.$("#"+c.getQsWidgetBottomSheetQuantitySuffixId(a))},getQsWidgetInitialViewTextLinkElement:function(a){return d.$("#"+c.getQsWidgetInitialViewTextLinkId(a))},getQsItem:w,getSelectedQsItemId:A,getInitialSelectedQsItemId:y,getSelectedQuantity:u,getQsItemFromQuantityText:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;if(!b)return null;for(var f=0;f<b.length;f++)if(c.toLowerCase()==b[f].quantityText.toLowerCase()||parseFloat(c)==parseFloat(b[f].quantityText))return b[f]},
getFocusedQsItemIdInBottomSheet:function(b){var f=t(b).scrollTop(),d=c.getQsWidgetBottomSheetDropDownScrollFactor();f=parseInt((f-d.constant+d.adjustment)/d.increment);b=a.getQsWidgetConfiguration(b).qsItems;b=0>f?b[0].id:f>=b.length?b[b.length-1].id:b[f].id;return b},getIndexFromIdInBottomSheet:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;if(!b)return 0;for(var f=0;f<b.length;f++)if(c==b[f].id)return f},saveQsWidgetDropdownTopPosition:function(b){var c=v(b);c&&(c=c.position().top,a.setData(b,
{scrollTop:c}));return!1},setQsWidgetDropdownScrolled:function(b){a.setData(b,{scrollTop:-65536})},clearQsWidgetDropdownScrolled:function(b){a.setData(b,{scrollTop:c.getQsWidgetDropdownScrollMetricThreshold()})},isQsWidgetDropdownScrolled:function(b){var f=v(b);return f?(f=f.position().top,(b=a.getQsWidgetConfiguration(b).scrollTop)?Math.abs(f-b)>c.getQsWidgetDropdownScrollMetricThreshold():!1):!1},generateQsDropdownDOM:function(b){var f="",d=a.getQsWidgetConfiguration(b),n=d.qsItems,d=d.selectedId,
e=p(b);if(!n)return"";for(var h=0;h<n.length;h++){var k,g=n[h].id,t=n[h].quantityText;if(e){k=b;var r=c.getQsWidgetDropdownItemId(k,g),m=c.getQsWidgetDropdownItemAriaId(k,g),v=c.getQsWidgetDropdownItemDecl();k='\x3cspan class\x3d"a-declarative" data-action\x3d"'+v+'" data-'+v+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+k+"\x26quot;,\x26quot;id\x26quot;:"+g+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+r+'" aria-labelledby\x3d"'+m+'" class\x3d"qs-widget-dropdown-li"\x3e'+t+"\x3c/li\x3e\x3c/span\x3e"}else{k=
b;var q=n[h].quantityTextAbbreviatedSuffix,r=n[h].id==d,m=c.getQsWidgetDropdownItemId(k,g),v=c.getQsWidgetDropdownItemAriaId(k,g),w=c.getQsWidgetDropdownItemQuantitySuffixId(k,g),z=c.getQsWidgetDropdownDecl(k),u="";q&&(u='\x3cspan id\x3d"'+w+'" class\x3d"a-size-mini a-color-tertiary"\x3e'+q+"\x3c/span\x3e");q="false";w="qs-widget-dropdown-link";r&&(q="true",w+=" qs-widget-dropdown-link-active aok-block aok-nowrap");k='\x3cspan class\x3d"a-declarative" data-action\x3d"'+z+'" data-'+z+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+
k+"\x26quot;,\x26quot;id\x26quot;:"+g+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+m+'" aria-labelledby\x3d"'+v+'" aria-checked\x3d"'+q+'" class\x3d"qs-widget-dropdown-item"\x3e\x3ca tabindex\x3d"0" href\x3d"javascript:void(0)" draggable\x3d"false" id\x3d"'+v+'" class\x3d"'+w+'"\x3e'+t+"\x26nbsp;\x26nbsp;"+u+"\x3c/a\x3e\x3c/li\x3e\x3c/span\x3e"}f+=k}return f},generateVariationSelectorDOM:function(a){return""},isQsWidgetTextInputValid:B,validateQsWidgetTextInput:function(a){var b=q(a),
f=b.val();a=B(a,f);var d=b.parent().hasClass(c.getQsWidgetAuiInputTextWrapperClass())?b.parent():b;if(a)return b.val(f.replace(/^0{2,}$/,"0").replace(/^0+(\d+)/g,"$1")),d.removeClass("a-form-error"),d.addClass("a-form-normal"),!0;d.removeClass("a-form-normal");d.addClass("a-form-error");return!1},isUserClickInSummary:function(a){var b=c.getQsWidgetSummaryId();for(a=null==a?null:a.target;null!=a;){if(a.id.substring(0,b.length)==b)return!0;a=a.parentElement}return!1},hideSpinner:C}});"use strict";p.when("A",
"QuantitySelectorUtils","QuantitySelectorState","QuantitySelectorConstants").register("QuantitySelectorWidget",function(d,a,c,e){function g(b){a.deactivateWidget(b);var c=a.getQsWidgetButtonContainer(b),d=a.getQsWidgetDropdownContainer(b),e=a.getQsWidgetDropdownElement(b),f=a.getQsWidgetQuantityContainer(b),n=a.getQsWidgetSummaryAtcButton(b),g=a.getQsWidgetFooterPriceContainer(b),m=a.getQsWidgetFooterQuantitySuffixContainer(b);a.setComponentVisibility(g,!0);a.setComponentVisibility(m,!0);g=a.getQsWidgetTextInputContainer(b);
a.isComponentVisible(g)||a.showComponent(c);a.hideComponent(d);a.hideComponent(e);a.hideComponent(f);a.hideComponent(n);a.resetQsWidgetContainerMinWidthAndHeight(b)}function m(b,k,g){var h=a.getQsItem(b,k),f=h.quantityText,n=h.quantityTextAbbreviatedSuffix,t=h.quantityTextFullSuffix,m=h.selectedText,h=h.price,p=a.getQsWidgetSummaryPriceSymbolElement(b),q=a.getQsWidgetSummaryPriceWholeElement(b),u=a.getQsWidgetSummaryPriceFractionElement(b),y=a.getQsWidgetSummaryPriceDecimalElement(b);a.setHtml(p,
h.currencySymbol);a.setHtml(q,h.wholeValue);a.setHtml(u,h.fractionValue);a.setHtml(y,h.decimalSeparator);p=a.getQsWidgetQuantityElement(b);a.setHtml(p,f);f=a.getQsWidgetQuantitySuffixElement(b);n&&t?(a.setHtml(f,n),n=a.getQsWidgetInitialViewSuffixElement(b),a.setHtml(n,t)):a.setHtml(f,"");n=a.getQsWidgetFooterPriceSymbolElement(b);f=a.getQsWidgetFooterPriceWholeElement(b);p=a.getQsWidgetFooterPriceFractionElement(b);q=a.getQsWidgetFooterPriceDecimalElement(b);a.setHtml(n,h.currencySymbol);a.setHtml(f,
h.wholeValue);a.setHtml(p,h.fractionValue);a.setHtml(q,h.decimalSeparator);t&&(h=a.getQsWidgetFooterQuantitySuffixElement(b),a.setHtml(h,t));t="Current quantity "+m+". Click to change quantity";a.isInitialViewDropdown(b)?(a.getQsWidgetButtonAsComponent(b).text(m),a.getQsWidgetButton(b).attr("aria-label",t)):a.isInitialViewTextLink(b)&&(h=a.getQsWidgetInitialViewTextLinkElement(b),h.text(m),h.attr("aria-label",t));c.setSelectedId(b,k);g&&d.trigger(e.getQsWidgetEventTriggerAction(),b)}function p(b,
k){var g=a.getQsWidgetTextInputElement(b),h=g.val(),f=a.getQsWidgetButtonContainer(b),n=a.getQsWidgetTextInputContainer(b),t=a.getQsWidgetTextInputUpdateButtonContainer(b),q=a.getQsItemFromQuantityText(b,h);a.hideComponent(t);q?(a.hideComponent(n),a.showComponent(f),m(b,q.id,k)):(a.hideComponent(f),a.showComponent(n),g.blur(),c.setSelectedQuantity(b,h),k&&d.trigger(e.getQsWidgetEventTriggerAction(),b))}d.on(e.getQsWidgetEventSelectId(),function(b,c,d,e){m(b,c,d);c=a.getQsWidgetButtonContainer(b);
d=a.getQsWidgetTextInputContainer(b);b=a.getQsWidgetTextInputUpdateButtonContainer(b);a.hideComponent(b);a.hideComponent(d);a.showComponent(c);e&&e()});d.on(e.getQsWidgetEventSelectQuantity(),function(b,c,d,e){a.getQsWidgetTextInputElement(b).val(c);p(b,d);e&&e()});return{hideAllPopover:function(){for(var b=a.getActivatedQsWidgets(),c=0;c<b.length;c++)g(b[c])},showPopover:function(b){a.activateWidget(b);a.setQsWidgetContainerMinWidthAndHeight(b);var d=a.getQsWidgetDropdownUnorderedListElement(b),
e=a.getQsWidgetButtonContainer(b),h=a.getQsWidgetDropdownContainer(b),f=a.getQsWidgetDropdownElement(b),n=a.getQsWidgetQuantityContainer(b),g=a.getQsWidgetSummaryAtcButton(b);a.setHtml(d,a.generateQsDropdownDOM(b));var d=a.getQsWidgetFooterPriceContainer(b),m=a.getQsWidgetFooterQuantitySuffixContainer(b);a.setComponentVisibility(d,!1);a.setComponentVisibility(m,!1);a.showComponent(f);a.hideComponent(n);a.hideComponent(g);a.showComponent(h);a.hideComponent(e);a.popOutDropDownContainer(b);h=c.getQsWidgetConfiguration(b);
if(e=h.qsItems)h=h.selectedId,null===h&&(h=e[0].id),a.getQsWidgetDropdownItemElement(b,h).focus()},showConfirmation:function(b){a.activateWidget(b);var c=a.getQsWidgetButtonContainer(b),d=a.getQsWidgetDropdownContainer(b),e=a.getQsWidgetDropdownElement(b),f=a.getQsWidgetQuantityContainer(b);b=a.getQsWidgetSummaryAtcButton(b);a.hideComponent(e);a.showComponent(f);a.showComponent(b);a.showComponent(d);a.hideComponent(c)},showPrice:function(b,c){c=a.getQsItem(b,c).price;var d=a.getQsWidgetSummaryPriceSymbolElement(b),
e=a.getQsWidgetSummaryPriceWholeElement(b),f=a.getQsWidgetSummaryPriceFractionElement(b);b=a.getQsWidgetSummaryPriceDecimalElement(b);a.setHtml(d,c.currencySymbol);a.setHtml(e,c.wholeValue);a.setHtml(f,c.fractionValue);a.setHtml(b,c.decimalSeparator)},selectOption:m,showTextInput:function(b,c){var d=a.getQsWidgetTextInputContainer(b),e=a.getQsWidgetTextInputUpdateButtonContainer(b),f=a.getQsWidgetButtonContainer(b);a.hideComponent(f);a.showComponent(d);var n=a.getQsWidgetTextInputElement(b);c&&n.val(c);
c=n.val();a.isQsWidgetTextInputValid(b,c)&&a.getSelectedQuantity(b)!==c?a.showComponent(e):a.hideComponent(e);setTimeout(function(){n.focus()},200)},validateAndSelectQuantity:p,selectConfirmation:function(b){a.isActionTriggerOnConfirmation(b)&&d.trigger(e.getQsWidgetEventTriggerAction(),b);g(b)}}});"use strict";p.when("A","QuantitySelectorWidget","QuantitySelectorUtils","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps","QuantitySelectorMetadata").register("QuantitySelector",
function(d,a,c,e,g,m,p,b){function k(a,d){try{var g=c.isMobile(d)}catch(h){h instanceof TypeError&&m.incrementInvalidIdCount();return}try{if(!c.isInitialized(d)||a)eval(b.getMetaConfiguration(d,"script")),e.setInitialized(d),e.saveOriginalSettings(d),c.initializeWidget(d),c.isQsWidgetEnabled(d)?c.enableQsWidget(d):c.disableQsWidget(d),m.incrementInitializeCount(!0,g)}catch(h){m.incrementInitializeCount(!1,g)}}function r(a){e.loadQsWidgetStateConfiguration(a);k(!0,a)}d.declarative(g.getQsWidgetButtonDecl(),
"click",function(b){var d=b.data.qsUID;(b=c.isMobile(d))?a.showBottomSheet(d):a.showPopover(d);m.incrementShowPopup(b);c.isInitialViewDropdown(d)?m.logCsm(d,"cqd"):m.logCsm(d,"ccq");setTimeout(function(){c.saveQsWidgetDropdownTopPosition(d)},250)});d.declarative(g.getQsWidgetDropdownDecl(),"click",function(b){var d=b.data.qsUID;b=b.data.id;var e=c.isActionTriggerOnSelect(d),g=c.isTextInputRequired(d,b),h=c.isConfirmationViewEnabled(d),k=c.isQsWidgetDropdownScrolled(d);h?k?(c.setQsWidgetDropdownScrolled(d),
m.logCsm(d,"dcq_scl")):(c.clearQsWidgetDropdownScrolled(d),m.logCsm(d,"dcq")):k?m.logCsm(d,"dsq_scl"):m.logCsm(d,"dsq");a.selectOption(d,b,e&&!g.result);g.result?a.showTextInput(d,g.initialQuantityText):h&&a.showConfirmation(d)});d.declarative(g.getQsWidgetDropdownItemDecl(),"click",function(b){a.alignQsItem(b.data.qsUID,b.data.id)});d.declarative(g.getQsWidgetVariationDropdownItemDecl(),"click",function(b){a.alignVariationSelectorItem(b.data.qsUID,b.data.id)});d.declarative(g.getQsWidgetDropdownDecl(),
"focusin",function(b){a.showPrice(b.data.qsUID,b.data.id)});d.declarative(g.getQsWidgetDropdownDecl(),"mouseenter",function(b){a.showPrice(b.data.qsUID,b.data.id)});d.declarative(g.getQsWidgetDropdownDecl(),"mouseleave",function(b){b=b.data.qsUID;var c=e.getQsWidgetConfiguration(b).selectedId;a.showPrice(b,c)});d.declarative(g.getQsWidgetQuantityChangelinkDecl(),"click",function(b){b=b.data.qsUID;a.showPopover(b);m.incrementChangeLinkCount();c.saveQsWidgetDropdownTopPosition(b);m.logCsm(b,"ccl")});
d.declarative(g.getQsWidgetSummaryAtcDecl(),"click",function(b){b=b.data.qsUID;a.selectConfirmation(b);c.isQsWidgetDropdownScrolled(b)?m.logCsm(b,"atc_scl"):m.logCsm(b,"atc")});d.declarative(g.getQsWidgetTextInputDecl(),"keydown",function(a){var b=a.data.qsUID,d=a.$event.which;8==d||9==d||13==d||37<=d&&40>=d||46==d||(!(48<=d&&57>=d||96<=d&&105>=d)||a.$event.shiftKey||a.$event.altKey||a.$event.ctrlKey||a.$event.metaKey?a.$event.preventDefault():3<=c.getQsWidgetTextInputElement(b).val().length&&a.$event.preventDefault())});
d.declarative(g.getQsWidgetTextInputDecl(),"keyup",function(b){var d=b.data.qsUID;c.validateQsWidgetTextInput(d)&&13==b.$event.keyCode?(b=c.isActionTriggerOnSelect(d),a.validateAndSelectQuantity(d,b)):a.showTextInput(d)});d.declarative(g.getQsWidgetTextInputDecl(),"focusout",function(b){b=b.data.qsUID;if(""===c.getQsWidgetTextInputElement(b).val()){var d;d=(d=e.getQsWidgetConfiguration(b).selectedId)?c.getQsItem(b,d).selectedText:c.getSelectedQuantity(b);a.showTextInput(b,d);c.validateQsWidgetTextInput(b)}});
d.declarative(g.getQsWidgetTextInputDecl(),"change",function(b){a.showTextInput(b.data.qsUID)});d.declarative(g.getQsWidgetTextInputUpdateButtonDecl(),"click",function(b){var d=b.data.qsUID;c.validateQsWidgetTextInput(d)&&(d=b.data.qsUID,b=c.isActionTriggerOnSelect(d),a.validateAndSelectQuantity(d,b))});d.$(document).click(function(b){0!=c.getActivatedQsWidgets().length&&(c.isUserClickInSummary(b)||a.hideAllPopover())});d.$(q).resize(function(){a.hideAllPopover()});d.on(g.getQsWidgetEventInitialize(),
function(a,b){p.initialize();if("string"==typeof b)k(a,b);else{b=e.getQsUIDs();for(var c=0;c<b.length;c++)k(a,b[c])}});d.on(g.getQsWidgetEventLoadStatesAndInitialize(),function(){for(var a=e.getQsUIDs(),b=0;b<a.length;b++){var d=a[b];c.isInitialized(d)||r(d)}});d.on(g.getQsWidgetEventConfigureEnable(),function(a){c.enableQsWidget(a)});d.on(g.getQsWidgetEventConfigureDisable(),function(a){c.disableQsWidget(a)});d.on(g.getQsWidgetEventConfigureReset(),function(a){for(var b=e.getQsUIDs(),c=0;c<b.length;c++){var h=
b[c];if("string"!==typeof a||a==h)e.loadOriginalSettings(h),d.trigger(g.getQsWidgetEventInitialize(),!0,h)}});var h=d.now();m.logLatencyMetric("JSReady",h);return{loadStateAndInitializeWidget:r}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("ConsumablesATCActionAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(l){var p=window.AmazonUIPageJS||window.P,u=p._namespace||p.attributeErrors,a=u?u("QuantitySliderAssets",""):p;a.guardFatal?a.guardFatal(l)(a,window):a.execute(function(){l(a,window)})})(function(l,p,u){l.when("A").register("qs-cart-count-handler",function(a){var d=a.$,f={DEFAULT:function(g,e,b,h,f){a.post("/gp/api/cart/1.0/get-cart-count.json",{timeout:5E3,params:{sessionID:g,clientName:e},success:function(a){a&&a.isOK&&a.total?d.isFunction(h)&&h(a.total.numActiveItem):l.log("Malformed get-cart-count response for sessionId\x3d"+
g,"ERROR",b)},error:function(){l.log("Failed to retrieve get-cart-count response for sessionId\x3d"+g,"ERROR",b);d.isFunction(f)&&f()}})},UFG:function(d,a,b,h,f){}};return{getTotalCartCount:function(a,e){return(d.isFunction(f[e])?f[e]:f.DEFAULT)(a.request.sessionId,a.clientName,a.attribution,a.onSuccess,a.onError)}}});"use strict";l.when("A","quantity-slider-utils","qs-cart-update-utils").register("qs-cart-update-handler",function(a,d,f){function g(a){n||(n="quantity-slider-widget-"+a);return n}function e(a,
h){if(!h.atcFormSubmitDisabled){if((a=a.$target&&a.$target.closest(".qs-atc-form"))&&0!==a.length)return a;l.log("Missing $form object","ERROR",g(h.clientName))}}function b(b,r,f){a.trigger(d.ACTIONS.ADD_TO_CART_SUBMIT_START,{asin:b,cartType:r.cartType,clientName:r.clientName,isQSAction:f,request:r});h(b,r,!0,f)}function h(h,b,e,c){var q=b.cartType,n=JSON.stringify(c?f.getQSRequestObject(b,e,q):f.getATCRequestObject(b,q)),m=f.getAjaxUrl(b,e,q);m&&k.ajax({url:m,type:f.getHttpMethodType(e,q),data:n,
headers:f.getHeadersForRequest(b,e,q),xhrFields:{withCredentials:!0},success:function(m,q,k){m.jqXHR=k;delete t[h];(m=f.adaptResponseObject(m,b,e,b.cartType))?(d.setUpdatedQSParamsForAsin(h,{quantityInCart:m.quantity,cartItemId:m.itemId}),a.trigger(e?d.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS:d.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS,{asin:h,cartType:b.cartType,request:b,response:m,clientName:b.clientName,attribution:g(b.clientName),isQSAction:c,isDecreaseQuantityAction:!e}),d.logUrl(b.loggingUrl)):l.log("Invalid Response from the server",
"ERROR",g(b.clientName))},error:function(m){delete t[h];m=m||{};l.log("Ajax request failed with type: "+(e?"addItems":"modifyItems")+", status code: "+m.status+", error: "+m.responseText,"ERROR",g(b.clientName));a.trigger(d.ACTIONS.QS_CART_SUBMIT_ERROR,{asin:h,cartType:q,clientName:b.clientName,isQSAction:c,isDecreaseQuantityAction:!e,isMaxOrderQuantityReached:b.quantityInCart>=b.maxOrderQuantity,response:m,request:b});e&&b.$form&&b.$form.submit()}})}var k=a.$,n="",t={};a.declarative("qs-add-to-cart-trigger",
"click",function(a){var h=a.data&&a.data.asin,f=d.getQSParamsForAsin(h);a.$event&&a.$event.preventDefault();t[h]||(t[h]=!0,f.isMultipleAsinsSubmitting=1<Object.keys(t).length,f.$form=e(a,f),f.triggeringEvent=a,b(h,f,!1))});a.declarative("qs-slider-widget-trigger","click",function(f){var g=f.data&&f.data.asin,k=d.getQSParamsForAsin(g),c=f.$target[0]&&f.$target[0].className||"",q=a.contains(c,"qs-increase-quantity")||a.contains(c,"qs-decrease-quantity"),c=a.contains(c,"qs-decrease-quantity");f.$event&&
f.$event.preventDefault();q&&!t[g]&&(t[g]=!0,k.isMultipleAsinsSubmitting=1<Object.keys(t).length,k.triggeringEvent=f,c?(a.trigger(d.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,{asin:g,cartType:k.cartType,clientName:k.clientName,isQSAction:!0,isDecreaseQuantityAction:!0,request:k}),h(g,k,!1,!0)):(k.$form=e(f,k),b(g,k,!0)))});return{setAttribution:function(b){n=b}}});"use strict";l.when("A","qs-fresh-cart-update-utils","ready").register("qs-cart-update-utils",function(a,d){function f(c){var b=c.quantityInCart||
0;return{items:[{asin:c.asinId,offerListingId:c.offerListingId,quantity:b<c.minOrderQuantity?c.minOrderQuantity-b:1}]}}function g(c,b,a){return(e.isFunction(b[a])?b[a]:b.DEFAULT)(c)}var e=a.$,b={DEFAULT:f,UFG:d.getUfgCartRequestObject},h={DEFAULT:f,UFG:d.getUfgCartRequestObject},k={DEFAULT:function(c){var b=c.quantityInCart||0,a;a=c.cartItemId;a=!a||"C"!==a[0]&&"S"!==a[0]?a:a.substring(1);return{items:[{id:a,quantity:b<=c.minOrderQuantity?0:b-1}]}},UFG:d.getUfgCartRequestObject},n={DEFAULT:function(c){return c.ajaxCartUrl},
UFG:function(c){return c.addToCartUrl}},l={DEFAULT:function(c){return c.ajaxCartUrl}},p={DEFAULT:function(c){return(c=c.entity&&c.entity.items&&c.entity.items[0])?{itemId:c.id,quantity:c.quantity,isTotal:!0}:null},UFG:d.ufgCartResponseAdapter},r={DEFAULT:function(c,b){c=(b.quantityInCart||0)-1;return 0>c?null:{itemId:c?b.cartItemId:"",quantity:c,isTotal:!0}},UFG:d.ufgCartResponseAdapter},u={DEFAULT:"POST",UFG:"POST"},c={DEFAULT:"PUT",UFG:"POST"},q={DEFAULT:function(c){return{"x-api-csrf-token":c.csrfToken,
Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"'}},UFG:function(c){return{"Content-Type":"application/json"}}},w={DEFAULT:function(c){return{"x-api-csrf-token":c.csrfToken,Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.modify-items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.modify-items.request/v1"'}},UFG:function(c){return{"Content-Type":"application/json"}}};
return{getATCRequestObject:function(c,a){return g(c,b,a)},getQSRequestObject:function(c,b,a){return g(c,b?h:k,a)},adaptResponseObject:function(c,b,a,h){a=a?p:r;return(e.isFunction(a[h])?a[h]:a.DEFAULT)(c,b)},getHttpMethodType:function(b,a){b=b?u:c;return b[a]?b[a]:b.DEFAULT},getHeadersForRequest:function(c,b,a){b=b?q:w;return(e.isFunction(b[a])?b[a]:b.DEFAULT)(c)},getAjaxUrl:function(c,b,a){return g(c,b?n:l,a)}}});"use strict";l.when("A","ready").register("qs-fresh-cart-update-utils",function(a){function d(a,
d){return d&&d.items?d.items.find(function(d){return d.ASIN===a}):null}return{getUfgCartRequestObject:function(a){return a.additionalInput},ufgCartResponseAdapter:function(a,g){return(g=d(g.asinId,a.clientResponseModel))?{itemId:g.itemId,quantity:g.quantity,isTotal:!0,rawResponse:a}:{itemId:"invalidItemId",quantity:0,isTotal:!0,rawResponse:a}}}});"use strict";l.when("A","quantity-slider-utils").register("quantity-slider-metrics-handler",function(a,d){function f(a,b){return"QuantitySliderWidget::"+
a+"::"+(b?b+"::":"")}function g(b){var a=p.ue;"undefined"!==typeof a&&a.count(b,1)}function e(a,e){d.assert(a&&e.clientName,"Missing required properties while logging metrics");var n=e.isQSAction?e.isDecreaseQuantityAction?b.QS_DECREASE:b.QS_INCREASE:b.ATC;a=f(e.clientName,e.cartType)+a+"::"+n;g(a)}var b={ATC:"ATC",QS_INCREASE:"QSIncrease",QS_DECREASE:"QSDecrease"};return{logRequestStartMetrics:function(a){e("CountStart",a)},logRequestSuccessMetrics:function(a){e("CountSuccess",a)},logRequestErrorMetrics:function(a){e("CountError",
a)},logMaxQuantityReachedMetric:function(a){a=f(a.clientName,a.cartType)+"MaxQuantityReached";g(a)},logMultipleAsinsSubmittingMetric:function(a){a=f(a.clientName,a.cartType)+"MultipleAsinsSubmitting";g(a)}}});"use strict";l.when("A","quantity-slider-utils","qs-cart-update-handler","quantity-slider-metrics-handler").register("quantity-slider-widget",function(a,d,f,g){function e(c){return"."+c+"-qs-slider-button"}function b(c,a){c=e(c)+" .qs-decrease-quantity";a?d.disableButton(c):d.enableButton(c)}
function h(c,a){c=e(c)+" .qs-increase-quantity";a?d.disableButton(c):d.enableButton(c)}function k(c,a){c="."+c+"-qs-add-to-cart-button .qs-slider-atc-button";a?d.disableButton(c):d.enableButton(c)}function n(c){c.isQSAction&&(c.isDecreaseQuantityAction?d.deselectButton(e(c.asin)+" .qs-decrease-quantity"):d.deselectButton(e(c.asin)+" .qs-increase-quantity"))}function l(c){d.toggleDomNodeVisibility("."+c.asin+"-qs-slider-spinner",!1);var a=c.asin;c.isQSAction?(b(a,!1),h(a,!1)):k(a,!1);n(c);d.assert(c.asin&&
c.request&&c.response&&c.response.quantity!==u,"Required properties missing in payload object for UpdateQSWidget");r(c.asin,c.response.quantity,c.request.maxOrderQuantity);c.request.enableQuantityLimitMessage&&d.toggleDomNodeVisibility("."+c.asin+"-qs-quantity-limit-message",c.response.quantity>=c.request.maxOrderQuantity);d.updateTotalCartCountOnUI(c,c.cartType);g.logRequestSuccessMetrics(c)}function p(a){d.toggleDomNodeVisibility("."+a.asin+"-qs-slider-spinner",!0);var e=a.asin;a.isQSAction?(b(e,
!0),h(e,!0)):k(e,!0);g.logRequestStartMetrics(a);a.request&&a.request.isMultipleAsinsSubmitting&&g.logMultipleAsinsSubmittingMetric(a)}function r(a,b,f){var g="."+a+"-qs-add-to-cart-button",k=e(a);0<b?(d.changeATCtoQS(g,k),g=v("."+a+"-qs-qty-present-in-cart"),Number.isInteger(b)&&g.html(b),h(a,b>=f)):(d.changeQStoATC(g,k),h(a,!1))}var v=a.$;Number.isInteger||(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&-9007199254740992<a&&9007199254740992>a&&Math.floor(a)===a});a.on(d.ACTIONS.ADD_TO_CART_SUBMIT_START,
function(a){p(a)});a.on(d.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS,function(a){setTimeout(function(){l(a)},1500);a.response.quantity===a.request.maxOrderQuantity&&g.logMaxQuantityReachedMetric(a)});a.on(d.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,function(a){p(a)});a.on(d.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS,function(a){setTimeout(function(){l(a)},1500)});a.on(d.ACTIONS.QS_CART_SUBMIT_ERROR,function(a){d.toggleDomNodeVisibility("."+a.asin+"-qs-slider-spinner",!1);if(a.isQSAction&&a.isMaxOrderQuantityReached)b(a.asin,
!1);else{var e=a.asin;a.isQSAction?(b(e,!1),h(e,!1)):k(e,!1)}n(a);g.logRequestErrorMetrics(a)});return{ACTIONS:d.ACTIONS,CART_IDEMPOTENT_REQUEST_DELAY:1500,setAttribution:f.setAttribution,updateQuantitySliderWidget:r}});"use strict";l.when("A","qs-cart-count-handler","a-button").register("quantity-slider-utils",function(a,d,f){function g(a){return e("."+a+"-qs-slider-data").first().data("qs-model")}var e=a.$;return{ACTIONS:{ADD_TO_CART_SUBMIT_START:"quantity-slider:add-to-cart-start",ADD_TO_CART_SUBMIT_SUCCESS:"quantity-slider:add-to-cart-success",
REMOVE_FROM_CART_SUBMIT_START:"quantity-slider:remove-from-cart-start",REMOVE_FROM_CART_SUBMIT_SUCCESS:"quantity-slider:remove-from-cart-success",QS_CART_SUBMIT_ERROR:"quantity-slider:cart-submit-error"},assert:function(a,d){if(!a)throw Error(d);},changeATCtoQS:function(b,d){e(b).hasClass("aok-hidden")||(a.hide(b),a.show(d))},changeQStoATC:function(b,d){e(d).hasClass("aok-hidden")||(a.hide(d),a.show(b))},disableButton:function(a){f(e(a)).disable()},deselectButton:function(a){a=f(e(a));a.isEnabled()&&
a.setStatus("normal")},enableButton:function(a){f(e(a)).enable()},getQSParamsForAsin:g,setUpdatedQSParamsForAsin:function(b,d){var f=g(b);e("."+b+"-qs-slider-data").data(a.extend(f,d))},toggleDomNodeVisibility:function(b,d){d?a.show(b):a.hide(b)},updateTotalCartCountOnUI:function(b,f){b=a.extend({},b);b.onSuccess=function(a){p.$Nav&&p.$Nav.when("api.setCartCount").run(function(b){b(a)});l.when("mash").execute("quantity-slider-mash-update",function(b){b.cart&&e.isFunction(b.cart.didUpdate)&&b.cart.didUpdate({newCartQuantity:a})})};
d.getTotalCartCount(b,f)},logUrl:function(b){b&&a.post(b)}}})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,b=r?r("ALMCartActionAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,r){d.when("A").register("alm-cart-action-query-string-utils",function(b){function c(c,m){var h=e(c),g=a(c);h?m["discoveredAsins.0"]=c.asin:g&&(c=b.filter(c.items,function(a){return e(a)}),c=b.map(c,function(a){return a.asin}),b.each(c,function(a,e){m["discoveredAsins."+e.toString()]=a}));return m}
function a(a){return a&&a.items&&b.$.isArray(a.items)&&0<a.items.length}function e(a){return a&&a.asin&&"string"===typeof a.asin&&""!==a.asin}return{addQueryStringParamsToUrl:function(a,e){var h={};if(e&&e.reftag){var g=e.reftag;"string"===typeof g&&""!==g&&(h.ref_=g)}if(e&&e.queryLogInfoParams){var g=e.queryLogInfoParams,k;for(k in g)g.hasOwnProperty(k)&&"string"===typeof k&&""!==k&&"string"===typeof g[k]&&""!==g[k]&&(h[k]=g[k])}c(e,h);(e=b.$.param(h))&&"string"===typeof e&&""!==e&&(a+="?"+e);return a}}});
"use strict";d.when("A","jQuery").register("afx-add-all-helper",function(b,c){return{updateQuantityForAsin:function(a,e,b){a&&e&&!isNaN(b)&&c("#"+a).closest("form").find("#afx-add-all-"+e+"-quantity").attr("value",b)}}});"use strict";d.when("A","jQuery","a-button").register("fx-atfc-button-utils",function(b,c,a){function e(a){return"atfc-spinner-"+(a.asin?a.asin:a.clientId?a.clientId:"noAsin")}var q=!1;return{hideButtonAndRenderSpinner:function(a){var b=a.$currentTarget.find(".a-button");b&&b.length&&
(q=!0,a=e(a.data),b.wrap('\x3cdiv id\x3d"'+a+'" class\x3d"atfc-spinner"\x3e\x3c/div\x3e'),c("#"+a).css({width:b.outerWidth()+"px"}),c("#"+a).css({height:b.outerHeight()+"px"}),b.css("visibility","hidden"))},showButtonAndRemoveSpinner:function(a){var b=a.$currentTarget.find(".a-button");a=e(a.data);a=c("#"+a);b&&b.length&&a&&a.length&&(q=!1,b.css("visibility","visible"),b.unwrap())},shouldDisableButtonClicks:function(){return q}}});"use strict";d.when("fresh-shared-add-to-cart-v2","qs-fresh-shared-add-to-cart").register("fresh-add-to-cart",
function(b,c){function a(a){b.attachCallbacks(a)}b.initialize("desktop");c.initialize("desktop");return{addToFreshCart:function(b){a(b)},attachCallbacks:a,updateAddAllQuantityForAsin:b.updateAddAllQuantityForAsin,updateQuantity:b.updateQuantity}});"use strict";d.when("shared-alm-multi-add-to-cart").register("alm-multi-add-to-cart",function(b){function c(a){b.attachCallbacks(a)}b.initialize("desktop");return{multiAddToCart:function(a){c(a)},attachCallbacks:c,attachPreHandler:function(a){b.attachPreHandler(a)}}});
"use strict";d.when("A","alm-cart-action-query-string-utils").register("afx-atfc-v2-proxy",function(b,c){return{addToFreshCart:function(a){var e=c.addQueryStringParamsToUrl("/alm/addtofreshcart",a.data);b.$.ajax(e,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)},showGenericErrorModal:function(a){b.post("/alm/atfcGenericErrorModal/",{timeout:5E3,success:a.success,error:a.error})}}});"use strict";d.when("A").register("fx-atfo-proxy",function(b){return{addToFreshOrder:function(c){var a=
"/fom/add-to-fresh-order";c.reftag!==r&&(a+="/ref\x3d"+c.reftag);c.data!==r&&c.data.csrfToken&&(a+="?csrf\x3d"+encodeURIComponent(c.data.csrfToken));b.post(a,{success:c.success,error:c.error,params:JSON.stringify(c.data),paramsFormat:"json",contentType:"application/json"})},getFallbackErrorModalHtml:function(){return{header:"Item was not added to the order",errorMessage:"We're sorry, there was an error and \x3cb\x3ethis item was not added to your order.\x3c/b\x3e Please try again.",footer:"\x3cspan class\x3d'a-declarative' data-action\x3d'a-popover-close'data-a-popover-close\x3d'{}'\x3e\n\x3cspan class\x3d'a-button primary-fresh-btn'\x3e\x3cspan class\x3d'a-button-inner'\x3e\x3cinput class\x3d'a-button-input'type\x3d'submit'\x3e\x3cspan class\x3d'a-button-text' aria-hidden\x3d'true'\x3eOK\n\x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e"}}}});
"use strict";d.when("A").register("afx-atfc-cart-conflicts-proxy",function(b){function c(a){a.ref=a.reftag;a.client="atfc";return a}return{getConflictSummary:function(a){var e=c(a.data);b.post("/afx/cartconflicts/getconflictsummary",{timeout:5E3,success:a.success,error:a.error,params:e})},resolve:function(a){var e=c(a.data);b.post("/afx/cartconflicts/resolve",{timeout:5E3,success:a.success,error:a.error,params:e})},substitute:function(a){a=c(a.data);a.sourceUrl=f.location.pathname+f.location.search;
a=b.$.param(a);f.location.href="/afx/cartconflicts/resolve/substitute?"+a}}});"use strict";d.when("A").register("afx-get-cart-count",function(b){return function(c){b.post("/gp/api/cart/1.0/get-cart-count.json",{timeout:5E3,params:{sessionID:c.sessionID,clientName:"SharedFreshHandler"},success:c.success,error:c.error})}});"use strict";d.when("A","alm-cart-action-query-string-utils").register("alm-multi-add-to-cart-proxy",function(b,c){return{multiAddToCart:function(a){var e=c.addQueryStringParamsToUrl("/alm/addtocart/multiple",
a.data);b.$.ajax(e,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)}}});"use strict";d.register("afx-callbacks-helper",function(b){function c(b){var c=b in a;!c&&d.log("Unable to retrieve callback for "+b,"Error");return c}var a={};return{addCallbacks:function(b){a[b.clientID||"default"]=b},success:function(b,d,m){b=b in a?b:"default";c(b)&&a[b].success&&a[b].success(d,m)},error:function(b,d,m,h){b=b in a?b:"default";c(b)&&a[b].error&&a[b].error(d,
m,h)}}});"use strict";d.register("afx-preHandler-helper",function(b){var c={};return{addPreHandler:function(a){c[a.clientID||"default"]=a},getPreHandler:function(a){return c[a]}}});"use strict";d.register("afx-csm-metrics-utils",function(){var b={},c=function(a,b){f.ue&&f.ue.count&&a&&b&&f.ue.count(a,b)};return{startWidgetTimer:function(a){b[a]=Date.now()},endWidgetTimer:function(a,e){a=Date.now()-b[a];c(e,a)},setWidgetClickTimestamp:function(a){f.ue&&f.uet&&a&&f.uet("tc",a,{wb:1})},setWidgetTimestamp:function(a,
b){f.ue&&f.uet&&a&&b&&f.uet(a,b,{wb:1})},increment:function(a){f.ue&&f.ue.count&&a&&f.ue.count(a,(f.ue.count(a)||0)+1)},setCount:c,sendWidgetMetrics:function(a){f.ue&&f.uex&&a&&f.uex("ld",a,{wb:1})}}});"use strict";d.register("add-to-cart-common-utils",function(){return{vibrate:function(){return f.amazon&&f.amazon.cordova&&f.amazon.cordova.notification&&f.amazon.cordova.notification.vibrate&&f.amazon.cordova.notification.vibrate(50)}}});"use strict";d.when("A","a-modal").register("fresh-atfc-modal-utils",
function(b,c){return{removeModal:function(){var a=c.get("fresh-add-to-cart-modal");a&&c.remove(a)},showModal:function(a,e,d){e&&(e={name:"fresh-add-to-cart-modal",header:e.header,inlineContent:e.body,footer:e.footer},"desktop"===d&&(e.width=325),c.create(a.$currentTarget,e).show(),b.on("a:popover:afterHide:".concat("fresh-add-to-cart-modal"),function(a){c.remove(a.popover)}))}}});"use strict";d.when("A","jQuery","afx-atfc-v2-proxy","afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper",
"fresh-atfc-ewc-helper").register("fresh-atfc-error-modal-utils",function(b,c,a,e,q,f,h){function g(a,c,e,g){d.when("a-modal").execute("showModal",function(d){c||k(a);a.data.quantity&&(f.updateQuantity("fresh-clear-slot-button",a.data.quantity),f.updateQuantity("alcohol-warning-fresh-add-to-cart-button",a.data.quantity));var n={name:"fresh-add-to-cart-error-modal",header:c.header,inlineContent:c.errorMessage,footer:c.footer,data:{event:a,response:g}};"desktop"===e&&(n.width=325);d.create(a.$currentTarget,
n).show();b.on("a:popover:afterHide:".concat("fresh-add-to-cart-error-modal"),function(b){h.refreshCart(a.data.sessionID);d.remove(b.popover)})})}function k(b,e){a.showGenericErrorModal({success:function(a,k,d){a&&(a=c.parseJSON(d.http.response),n(b,a,e))},error:function(){d.log("Failed to get the generic error modal","Error");g(b,{header:"Item was not added to the cart",errorMessage:"We're sorry, there was an error and \x3cb\x3ethis item was not added to your cart.\x3c/b\x3e Please try again.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
e)}})}function n(a,b,c){var k=b.errorModalHtml,d=q.getMetricsForDevice(c);b.clientResponseModel&&b.clientResponseModel.uberCartStatus&&b.clientResponseModel.uberCartStatus.errorStatusCode in d&&e.increment(d[b.clientResponseModel.uberCartStatus.errorStatusCode]);g(a,k,c,b)}return{removeModal:function(){d.when("a-modal").execute("removeModal",function(a){var b=a.get("fresh-add-to-cart-error-modal");b&&a.remove(b)})},showModal:g,showGenericErrorModal:k,parseResponseAndShowErrorModal:n}});"use strict";
d.when("A","jQuery","afx-atfc-v2-proxy","afx-get-cart-count").register("fresh-atfc-ewc-helper",function(b,c,a,e){function q(a){e({sessionID:a,success:function(a){a&&a.isOK&&a.total&&f(a.total.numActiveItem)},error:function(){d.log("Failed to get cart count","Error",a)}})}function f(a){d.when("nav.setCartCount").execute(function(b){b(a)});d.when("mash").execute(function(b){b.cart&&"function"===typeof b.cart.didUpdate&&b.cart.didUpdate({newCartQuantity:a})})}var h;d.when("EWC").execute("add-to-cart-refresh",
function(a){h=a});d.when("nav.getFlyout").execute(function(a){a("ewc")});return{refreshCart:function(a){h!==r&&"function"===typeof h.refresh?h.refresh():q(a)}}});"use strict";d.when("A","afx-storeIntroductionSheet-helper","afx-cpi-helper").register("f3-consumables-atc-helper",function(b,c,a){return{handleAddToCart:function(e,d,f){d.storeIntroductionSheetHtml&&d.storeIntroductionSheetHtml.content?c.render(e,d,f):d.renderUFGCartProgressIndicator?a.render(e):b.trigger("fresh-atfc:success","false",{almBrandId:e.brandId})}}});
"use strict";d.register("afx-metrics-helper",function(){var b={ATFC_COUNT:"afxAddToFreshCartCount",ALM_MULTI_ATC_COUNT:"almMultiAddToCartCount",ATFC_SUCCESSFUL_ADD_COUNT:"afxAddToFreshCartSuccessfulAddCount",ALM_MULTI_ATC_COUNT_SUCCESS:"almMultiAddToCartCountSuccess",ATFC_ERROR_MODAL_COUNT:"afxAddToFreshCartErrorModalCount",ALM_MULTI_ATC_COUNT_ERROR_MODAL:"almMultiAddToCartCountErrorModal",ATFC_UNEXPECTED_ERROR_COUNT:"afxAddToFreshCartUnexpectedErrorCount",ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED:"almMultiAddToCartCountErrorUnexpected",
ATFC_LATENCY_SCOPE:"afxAddToFreshCartLatencyScope",ATFC_ERROR_MODAL_LATENCY_SCOPE:"afxAddToFreshCartErrorModalLatencyScope",ATFC_CTCF:"afxAddToFreshCartCTCF",ATFC_STORE_INTRODUCTION_SHEET:"afxStoreIntroductionSheet",ATFC_OCX_STORE_INTRODUCTION_SHEET:"afxOfferComparisonStoreIntroductionSheet",CLEAR_SLOT_ATFC_CTCF:"afxClearSlotAndAddToFreshCartCTFC",CART_SERVICE_RESPONSE_FALSE:"afxCartServiceResponseIsNotOKErrorCount",ITEM_NOT_AVAILABLE:"afxItemNotAvailableErrorModalCount",ITEM_PARTIALLY_AVAILABLE:"afxItemPartiallyAvailableErrorModalCount",
ITEM_PARTIALLY_AVAILABLE_FOR_RESERVATION:"afxItemPartiallyAvailableErrorModalCount",ADDRESS_NOT_SELECTED:"afxAddressNotSelectedErrorCount",INPUT_INVALID:"afxGeneralErrorModalCount",ITEM_NOT_AVAILABLE_FOR_RESERVATION:"afxItemNotAvailableForReservationErrorModalCount",INTERNAL_SERVER_ERROR:"afxGeneralErrorModalCount",PRICE_UNAVAILABLE:"afxItemNotAvailableErrorModalCount",QUANTITY_OVERFLOW:"afxUniqueItemQuantityOverflowErrorModalCount"};return{getMetricsForDevice:function(c){var a={};Object.keys(b).forEach(function(e){a[e]=
b[e]+":"+c});return a}}});"use strict";d.when("A").register("afx-quantity-helper",function(b){var c={};return{updateQuantity:function(a,b){"undefined"!==typeof a&&null!==a&&!isNaN(b)&&0<b&&(c[a]=b||1)},getQuantity:function(a){a=a.closest(".a-button");return 0<a.length?c[a.attr("id")]||1:1}}});"use strict";d.when("A","afx-csm-metrics-utils","afx-metrics-helper").register("afx-storeIntroductionSheet-helper",function(b,c,a){function e(a,b){var c=b?400:190;d.when("a-sheet").execute(function(e){e.create({inlineContent:a,
closeType:"icon",height:c}).show();f("mobile",b)})}function f(b,e){b=a.getMetricsForDevice(b);e?c.increment(b.ATFC_OCX_STORE_INTRODUCTION_SHEET):c.increment(b.ATFC_STORE_INTRODUCTION_SHEET)}function m(){b.show(b.$("#sis-background"));b.$("body").css({overflow:"hidden"});b.$("#offer-comparison-store-introduction-side-sheet-container").show(function(){g({right:"0px"})});f("desktop",!0)}function h(){var a=b.$("#offer-comparison-store-introduction-side-sheet-container").width()+30;g({right:"-"+a+"px"},
function(){b.$("#offer-comparison-store-introduction-side-sheet-container").remove()});b.$("body").css({overflow:"scroll"});b.hide(b.$("#sis-background"));b.$("#offer-comparison-store-introduction-side-sheet-background-container").remove()}function g(a,c){b.animate(b.$("#offer-comparison-store-introduction-side-sheet-container"),a,300,"ease-out",c)}b.declarative("close-offer-comparison-store-introduction-side-sheet","click",function(a){h()});return{render:function(a,c,d){c=c.storeIntroductionSheetHtml.content;
a=a.additionalParams&&a.additionalParams.shouldRenderSIS;"mobile"===d?e(c,a):"desktop"===d&&(b.$("body").append(c),m())}}});"use strict";d.when("A").register("afx-cpi-helper",function(b){return{render:function(c){b.trigger("consumables-atc:success",{atcAction:{ASIN:c.asin,numberOfItems:c.quantity,operationType:"ADDED"},programDetails:{programType:"UFG",brandId:c.brandId,storeId:c.storeId},requestOverrides:{responseType:"HTML","cart-progress-indicator":{messageType:"topsheet"}}})}}});"use strict";
d.when("A","afx-atfc-cart-conflicts-proxy").register("afx-atfc-cart-conflicts-executor",function(b,c){return{execute:function(a){c.getConflictSummary({data:a.data,success:function(e,d,f){!0===e.isSuccess?!0===e.hasConflicts?c.substitute({data:a.data}):c.resolve({data:a.data,success:function(){b.trigger("fresh-cart-conflict-resolution:success");location.reload()},error:a.error}):a.error(f,d,"Failed to call getconflictsummary")},error:a.error})}}});"use strict";d.when("A","afx-atfc-v2-proxy","fx-atfo-proxy",
"fx-atfc-button-utils","afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper","afx-callbacks-helper","afx-atfc-cart-conflicts-executor","fresh-atfc-error-modal-utils","fresh-atfc-ewc-helper","afx-add-all-helper","f3-consumables-atc-helper","add-to-cart-common-utils").register("fresh-shared-add-to-cart-v2",function(b,c,a,e,f,m,h,g,k,n,x,l,y,t){return{updateQuantity:h.updateQuantity,attachCallbacks:g.addCallbacks,updateAddAllQuantityForAsin:l.updateQuantityForAsin,initialize:function(l){function w(a){return a.isItemSoldByCount?
!JSON.parse(a.isItemSoldByCount):a.pickingStrategy?"bulk"===a.pickingStrategy||"catch"===a.pickingStrategy:!1}function p(a,b,d,k){t.vibrate();a.data.amountInUom===r&&w(a.data)&&(a.data.amountInUom=a.data.quantity,a.data.quantity=1);c.addToFreshCart({data:a.data,success:function(c,k,h){200===h.status&&(f.increment(u.ATFC_SUCCESSFUL_ADD_COUNT),k=u.ATFC_CTCF+":lineItemBucket:"+z(c),f.endWidgetTimer(b,k),x.refreshCart(a.data.sessionID),g.success(a.data.clientID,a,c.clientResponseModel),y.handleAddToCart(a.data,
c,l));n.removeModal();e.showButtonAndRemoveSpinner(a);d&&d()},error:function(c,d,h){var w=u.ATFC_CTCF,m=c.responseText,p;n.removeModal();m&&(p=JSON.parse(m),w=u.ATFC_CTCF+":lineItemBucket:"+z(p.clientResponseModel));400===c.status&&p?(f.increment(u.ATFC_ERROR_MODAL_COUNT),n.parseResponseAndShowErrorModal(a,p,l)):403===c.status?location.reload():(f.increment(u.ATFC_UNEXPECTED_ERROR_COUNT),n.showGenericErrorModal(a,l),g.error(a.data.clientID,a,c,d,h));f.endWidgetTimer(b,w);e.showButtonAndRemoveSpinner(a);
k&&k()}})}function A(a,c){f.startWidgetTimer(c);b.post("/afx/slotselection/cancel",{timeout:5E3,params:{token:a.data.additionalParams.csrfToken},success:function(){a.data.quantity=h.getQuantity(a.$target);p(a,c,function(){location.reload()})},error:function(){d.log("Failed to clear reservation");n.showGenericErrorModal(a,l)}})}function z(a){return a.items&&Math.ceil(a.items.length/5)}var u=m.getMetricsForDevice(l),v=u.ATFC_LATENCY_SCOPE+Date.now();b.on("quantity-selector-widget:action:AddToCartAction",
function(a){a.additionalParams&&(a.additionalParams=b.$.parseJSON(a.additionalParams));a.queryLogInfoParams&&(a.queryLogInfoParams=b.$.parseJSON(a.queryLogInfoParams));var c={data:a};if(a.tunneledData&&a.tunneledData.$target){var d=a.tunneledData.$target,c=b.$.extend(c,{$target:d,$currentTarget:d,$declarativeTarget:d});delete a.tunneledData}else a=b.$("#qs-widget-button-container-"+a.qsUID),c=b.$.extend(c,{$target:a,$currentTarget:a,$declarativeTarget:a}),e.hideButtonAndRenderSpinner(c);p(c,v)});
b.declarative("fresh-clear-slot","click",function(a){a.$currentTarget.context.disabled=!0;A(a,v)});b.declarative("fresh-add-to-cart","click",function(a){f.startWidgetTimer(v);f.increment(u.ATFC_COUNT);e.shouldDisableButtonClicks()||a.$currentTarget.find("input").is(":disabled")||(e.hideButtonAndRenderSpinner(a),a.data.qsUID?b.trigger("quantity-selector-widget:triggerAction",a.data.qsUID,"AddToCartAction",{$target:a.$currentTarget}):(a.data.quantity=h.getQuantity(a.$target),p(a,v)))});b.declarative("fresh-add-to-cart-alcohol",
"click",function(a){a.$currentTarget.context.disabled=!0;f.startWidgetTimer(v);a.data.quantity=h.getQuantity(a.$target);p(a,v)});b.declarative("fresh-add-to-cart-regions-resolve","click",function(a){a.$currentTarget.context.disabled=!0;n.removeModal();k.execute({data:a.data,error:function(b,c,e){n.showGenericErrorModal(a,l);g.error(a.data.clientID,a,b,c,e)}})});b.declarative("fresh-add-to-order","click",function(b){e.shouldDisableButtonClicks()||(e.hideButtonAndRenderSpinner(b),t.vibrate(),a.addToFreshOrder({data:b.data,
success:function(a,c,d){200===d.http.status&&g.success(b.data.clientID,b,a.clientResponseModel);e.showButtonAndRemoveSpinner(b)},error:function(c,d,f){n.removeModal();if(400===c.http.status)c=JSON.parse(c.responseText),n.parseResponseAndShowErrorModal(b,c,l);else if(401===c.http.status)location.reload();else{var k=a.getFallbackErrorModalHtml();n.showModal(b,k,l);g.error(b.data.clientID,b,c,d,f)}e.showButtonAndRemoveSpinner(b)}}))})}}});"use strict";d.when("A","alm-multi-add-to-cart-proxy","fx-atfc-button-utils",
"afx-csm-metrics-utils","afx-metrics-helper","afx-callbacks-helper","afx-preHandler-helper","fresh-atfc-error-modal-utils","fresh-atfc-ewc-helper","f3-consumables-atc-helper","add-to-cart-common-utils").register("shared-alm-multi-add-to-cart",function(b,c,a,e,d,f,h,g,k,n,x){return{attachCallbacks:f.addCallbacks,attachPreHandler:h.addPreHandler,initialize:function(l){function y(b,d,h,q){x.vibrate();c.multiAddToCart({data:b.data,success:function(c,d,p){200===p.status&&(e.increment(t.ALM_MULTI_ATC_COUNT_SUCCESS),
k.refreshCart(b.data.sessionID),f.success(b.data.clientId,b,c),n.handleAddToCart(b.data,c,l));g.removeModal();a.showButtonAndRemoveSpinner(b);h&&h()},error:function(c,d,k){a.showButtonAndRemoveSpinner(b);var h;g.removeModal();c.responseText&&(h=JSON.parse(c.responseText));400===c.status&&h?(e.increment(t.ALM_MULTI_ATC_COUNT_ERROR_MODAL),g.parseResponseAndShowErrorModal(b,h,l)):403===c.status?location.reload():(e.increment(t.ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED),g.showGenericErrorModal(b,l));f.error(b.data.clientId,
b,c,d,k);q&&q()}})}var t=d.getMetricsForDevice(l),r=t.ATFC_LATENCY_SCOPE+Date.now();b.declarative("alm-multi-add-to-cart","click",function(b){e.increment(t.ALM_MULTI_ATC_COUNT);var c=h.getPreHandler(b.data.clientId);c&&c.preHandle&&(c=c.preHandle(b))&&(b=c);c=b.$currentTarget.find("input");!b.data.items||1>b.data.items.length||a.shouldDisableButtonClicks()||c.is(":disabled")||(a.hideButtonAndRenderSpinner(b),y(b,r))})}}});d.when("A","f3-consumables-atc-helper","fresh-atfc-ewc-helper","afx-callbacks-helper",
"fresh-atfc-error-modal-utils","add-to-cart-common-utils").register("qs-fresh-shared-add-to-cart",function(b,c,a,e,d,f){return{initialize:function(h){function g(b){var f=b.response.rawResponse,g=f.jqXHR,l=b.request,m=l.triggeringEvent;m.data=l.additionalInput;200===g.status&&(a.refreshCart(l.sessionId),e.success(b.clientName,m,f.clientResponseModel),c.handleAddToCart(m.data,f,h));d.removeModal()}b.on("quantity-slider:add-to-cart-start",function(a){f.vibrate()});b.on("quantity-slider:remove-from-cart-start",
function(a){f.vibrate()});b.on("quantity-slider:remove-from-cart-success",function(a){g(a)});b.on("quantity-slider:add-to-cart-success",function(a){g(a)});b.on("quantity-slider:cart-submit-error",function(a){var b=a.request.triggeringEvent,c=a.response,f=c.responseText,g;d.removeModal();f&&(g=JSON.parse(f));b.data=a.request.additionalInput;400===c.status&&g?d.showModal(b,g.errorModalHtml,h):403===c.status?location.reload():(d.showGenericErrorModal(b,h),e.error(a.clientName,b,c,"error",c.statusText))})}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageICartAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,f=d._namespace||d.attributeErrors,b=f?f("AllOffersDisplayIngressAssets",""):d;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,d,f){c.execute("all-offers-display-ingress-init",function(){c.when("A","jQuery","all_offers_display_ingress_utils","all-offers-display-register-state").execute("all_offers_display_ingress_load_AOD_assets",function(b,a,e,g){function h(b){c.now().execute(function(a){a!==f||g.isMarkerOverrideRegistered()||
(c.register("aodIngressClick"),c.register("aodDeclarativeEvent",function(){return b}),g.setMarkerOverrideTriggered())})}b.state("aod:assetsLoaded",{isAodAssetsLoaded:!0});b.declarative("show-all-offers-display","click",function(a){a.$event.preventDefault();a.$event.stopPropagation();b.state("aod:assets2Loaded")||(e.isClickOnAODIngressSupported(a)?(h(a),c.when("aod-load-event-handler","aodDeclarativeEvent").execute(function(a,b){a.renderAodAction(b)})):e.redirectToOlp(a))});b.declarative("s-show-all-offers-display",
"click",function(a){a.$event.preventDefault();a.$event.stopPropagation();b.state("aod:assets2Loaded")||(e.isClickOnAODIngressSupported(a)?(h(a),c.when("search-all-offers-display-util","aodDeclarativeEvent").execute(function(a,b){a.searchOnClickHandler(b)})):e.redirectToOlp(a))})});c.when("A","jQuery","all-offers-display-register-state").execute("all-offers-display-enable-compare",function(b,a,e){b.state("aod:assets2Loaded")||-1===d.location.href.indexOf("#aod")&&-1===d.location.href.indexOf("#AOD")||
c.now().execute(function(a){a!==f||e.isMarkerOverrideRegistered()||(c.register("aodIngressClick"),e.setMarkerOverrideTriggered())})});c.when("A","jQuery","all_offers_display_ingress_olp_hyperlink").register("all_offers_display_ingress_utils",function(b,a,c){return{isClickOnAODIngressSupported:function(a){return c.getOlpHyperlink(a)?!0:!1},redirectToOlp:function(a){(a=c.getOlpHyperlink(a))?d.location.href=a:d.ueLogError&&d.ueLogError({logLevel:"ERROR",attribution:"aod_no_href",message:"[Redirection failed since href is null]"})}}});
c.register("all_offers_display_ingress_csm_counters",function(){var b=d.ue;return{incrementAndTriggerCounter:function(a){b&&b.count&&b.count(a,(b.count(a)||0)+1)},triggerUnitCounter:function(a){b&&b.count&&b.count(a,1)}}});c.when("all_offers_display_ingress_csm_counters").register("all_offers_display_ingress_aod_supported",function(b){return{isPropertySupported:function(a,e,g){var h=typeof a[e]===g;if(!h){var d={};a.tagName&&(d.tagName=a.tagName);a.getAttribute&&"function"===typeof a.getAttribute&&
(a.getAttribute("id")&&(d.id=a.getAttribute("id")),a.getAttribute("class")&&(d.class=a.getAttribute("class")),a.getAttribute("href")&&(d.href=a.getAttribute("href")));a="aodPropertyUnsupportedMessage, element: "+JSON.stringify(d);c.log(a+(", propertyName: "+e+", propertyType: "+g),"WARN","aodPropertyUnsupportedMessage");b.triggerUnitCounter("aodPropertyUnsupportedMessage")}return h}}});c.when("A","jQuery","all_offers_display_ingress_aod_supported").register("all_offers_display_ingress_olp_hyperlink",
function(b,a,c){return{getOlpHyperlink:function(b){if(b&&b.$event&&b.$event.target){var d=b.$event.target;if("A"===d.nodeName&&d.href)return d.href;if(c.isPropertySupported(b.$event.target,"closest","function"))return(b=d.closest("a"))?b.href:null;if(b=a(d).closest("a"))return b.attr("href")}return null}}});c.when("A","jQuery").register("all-offers-display-register-state",function(b,a){var c=!1;return{isMarkerOverrideRegistered:function(){return c},setMarkerOverrideTriggered:function(){c=!0}}})})});
/* ******** */
(function(c){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,b=d?d("NpxBuyNowAssets@Shared","NpxBuyNowAssets"):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,d){"use strict";c.when("ready").register("npx-buynow-csm",function(){return{logCount:function(b){a.ue&&a.ue.count&&a.ue.count(b,1)}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("NpxBuyNowAssets@Desktop","NpxBuyNowAssets"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){"use strict";b.when("A","npx-buynow-csm","ready").register("npx-buynow-education-desktop-logger",function(a,b){a.on("a:popover:show:buynow-education-popover",function(){b.logCount("desktopBuyNowEducationPopoverShow")})})});
/* ******** */
(function(k){var m=window.AmazonUIPageJS||window.P,y=m._namespace||m.attributeErrors,d=y?y("TurboCheckoutBaseAssets",""):m;d.guardFatal?d.guardFatal(k)(d,window):d.execute(function(){k(d,window)})})(function(k,m,y){"use strict";k.register("turbo-function-adapter",function(){return{adapt:function(d){return function(){if("function"!==typeof d)throw"Parameter 'property' is invalid. Expected a function but got "+typeof d;return d.apply(d,arguments)}}}});"use strict";k.when("turbo-configuration","turbo-function-adapter").execute("turbo-signin-adapter-factory",
function(d,c){k.when(d.get(d.KEYS.SHOW_SIGN_IN_INTERFACE)).register("turbo-signin-adapter",function(a){return{show:c.adapt(a.show)}})});"use strict";k.when("turbo-configuration","turbo-function-adapter").execute("turbo-view-adapter-factory",function(d,c){k.when(d.get(d.KEYS.VIEW_ADAPTER)).register("turbo-view-adapter",function(a){return{registerCallbacks:c.adapt(a.registerCallbacks),close:c.adapt(a.close),show:c.adapt(a.show),removeContent:c.adapt(a.removeContent),setContent:c.adapt(a.setContent),
closeImmediatelyThenExecute:c.adapt(a.closeImmediatelyThenExecute),closeAndNavigate:c.adapt(a.closeAndNavigate),closeToFullscreen:c.adapt(a.closeToFullscreen),updateBounds:c.adapt(a.updateBounds)}})});"use strict";k.when("turbo-checkout-page-ready").execute(function(){k.declare("turbo-eligibility-override",!1)});"use strict";k.when("A","turbo-checkout-csm","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-address-id",function(d,c,a){function b(a){for(var b=0;b<a.length;b++){var d=
e(a[b]);if(0<d.length)return c.logCount("turboCheckoutAddressSelectorIndex"+b),d}c.logCount("turboCheckoutAddressSelectorMissing");return e()}var e=d.$;return{getAddressId:function(){return b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val()||""},set:function(c){b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val()!==c&&b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val(c).trigger("change",[c])}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-configuration","turbo-checkout-load-events",
"turbo-checkout-page-ready").register("turbo-checkbox-exclusion-listener",function(d,c,a,b,e){function f(a){var c=p;p=!1;for(var b=0;b<l.length;b++){var d=r(l[b]).find("input[type\x3dcheckbox]");a(d)}c!==p&&(q("Exclusion checkbox state changed"),n.callAll("exclusionCheckbox"))}function h(a){var c;if(!(c=p)){c=!1;for(var b=0;b<a.length&&!c;b++){var d=r(a[b]);(c=d.prop("checked"))&&q("Exclusion checkbox is checked",d)}}p=c}function q(a,b){c.logDebug("turbo-checkbox-exclusion-listener",a,b)}function g(){f(h)}
var l=b.get(b.KEYS.CHECKBOX_EXCLUSION_ROOT_NODES),r=d.$,n=a.create(),p=!1;e.bind(function(){f(function(a){q("Listening for change events on:",a);a.unbind("change",g).bind("change",g);h(a)})});return{onStateChange:function(a){n.push(a)},isAnyCheckboxChecked:function(){return p}}});"use strict";k.when("A","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-custom-price-input",function(d,c,a){function b(){var a=e();q!==a&&(q=a,h.callAll())}function e(){return f("#gcPriceOverride").val()||
""}var f=d.$,h=c.create(),q;a.bind(function(){q=e();f("#gcPriceOverride").unbind("change",b).bind("change",b)});return{getCustomPrice:e,onChange:function(a){h.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-quantity-input",function(d,c,a,b,e,f){function h(c){var b;b=c?c.value?parseInt(c.value,10):c.target&&c.target.value?parseInt(c.target.value,
10):void 0:void 0;p===b?a.logDebug("turbo-checkout-quantity-input","Quantity change event does NOT have new quantity. Suppressing callbacks",void 0):(p=b,a.logDebug("turbo-checkout-quantity-input","Quantity change event",c),l.callAll())}function q(a){a=a.val();(a=parseInt(a,10))||c.logCount("turboCheckoutNoQuantityFromPage");return a}var g=d.$,l=e.create(),r=b.get(b.KEYS.QUANTITY_SELECT_SELECTOR),n="Multiple quantity nodes present on the page. This may lead to an incorrect quantity being used in Turbo! Selector \x3d "+
r,p;f.bind(function(){var b=g(r);p=q(b);b.unbind("change",h).bind("change",h);1<b.length&&(a.logError(n,"turbo-checkout-quantity-input"),a.logDebug("turbo-checkout-quantity-input",n,b));c.logCount("turboCheckoutQuantityNodes",b.length)});return{getQuantity:function(){return q(g(r))},setQuantity:function(a){var c=g(r),b=q(c);a=parseInt(a,10);b!==a&&c.val(a).change()},onChange:function(a){l.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-callback-list","turbo-configuration",
"turbo-checkout-quantity-input","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-warranty-input",function(d,c,a,b,e,f,h){var q=d.$,g=b.create(),l=e.get(e.KEYS.WARRANTY_CHECKBOX_INPUT_SELECTOR),r=e.get(e.KEYS.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR),n=e.get(e.KEYS.WARRANTY_ASIN_INPUT_NAME),p=e.get(e.KEYS.WARRANTY_OFFER_INPUT_SELECTOR);h.bind(function(){q(l).unbind("click",g.callAll).bind("click",g.callAll)});return{select:function(a){a&&q(r+" input[name^\x3d"+n+
"][value\x3d"+a+"]").parents(r).find(l).click()},onChange:function(a){g.push(a)},getLineItem:function(b){if(q(l+":checked").length){var d=q(l+":checked").first().parents(r).find("input[name^\x3d"+n+"]").val()||"",e=q(p).val()||"";b=parseInt(b,10)||f.getQuantity()||1;if(d&&e)return{asin:d,offerListingId:e,quantity:b,isDiscoveredAsin:!0};c.logCount("turboCheckoutIncompleteWarrantyInputs");a.logError("Incomplete input data for the selected warranty checkbox - asin:"+d+", offerId:"+e+", quantity:"+b)}else a.logDebug("turbo-checkout-warranty-input",
"No warranty checkbox is selected",void 0)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-callback-list","turbo-configuration","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-vas-input",function(d,c,a,b,e){function f(){return l(q).prop("checked")||!1}function h(){var a=n;n=f();a!==n&&r.callAll(n)}var q=b.get(b.KEYS.VAS_CHECKBOX_SELCTOR),g=b.get(b.KEYS.VAS_CHANGE_EVENTS),l=d.$,r=a.create(),n;e.bind(function(){n=f();g.forEach(function(a){d.off(a,h);d.on(a,
h)})});return{isSelected:f,onChange:function(a){r.push(a)}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-csm","turbo-checkout-aui-page-state-parser","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-accessories-input",function(d,c,a,b,e,f,h){function q(){var a=t;t=z();t!==a&&u.callAll()}function g(){if(k===y&&w(v).length){var a=f.parse("simpleBundleParameterMap",".simpleBundleFeatureContainer");0===a.length?
(e.logCount("Turbo:Accessories:No:State"),k={}):l(a)}}function l(a){k={};a[0].items.forEach(function(a){k[a.asin]={asin:a.asin,offerListingId:a.offerListingId,isDiscoveredAsin:!0}})}function r(){return w(v).find("input[type\x3dcheckbox]")}function n(){r().unbind("change",q).bind("change",q)}function p(){return w(v).length?1>=t:0===t}function z(){var a=0;r().each(function(){w(this).prop("checked")&&a++});c.logDebug("turbo-checkout-accessories-input","Accessories selected "+a);return a}var w=d.$,u=
a.create(),t=0,k,v=h.get(h.KEYS.ENABLED_ACCESSORIES_SELECTOR);g();n();b.bind(function(){g();n();z()});return{isEligible:p,registerCallback:function(a){u.push(a)},getLineItem:function(){if(p()){var a;a=r().filter(":checked").val();a=k?k[a]:void 0;return a||y}return y},select:function(a){a&&w(v+" input[type\x3dcheckbox][value\x3d"+a+"]").click()}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-form","turbo-checkout-ref-tagger","turbo-checkout-page-state","turbo-checkout-product-state",
"turbo-checkout-page-ready").register("turbo-checkout-joined-state",function(d,c,a,b,e,f,h){function q(a,c,b){c&&(b&&(c.quantity=b),a.push(c))}function g(a,n){function f(){var b=a.turboWeblab;b||c.logCount("turboCheckoutWeblabNameNotDefinedInState");return b}function h(){return a.turboWeblabTreatment}this.pageState=a;this.productStates=n;this.getLineItems=function(){return g.lineItemInputs};this.getActiveId=function(){return g.id};this.getHeaderText=function(){return g?g.turboHeaderText||a.turboHeaderText:
a.turboHeaderText};this.getLoadingText=function(){return a.turboLoadingText};this.getAddressId=function(){return a.addressId};this.getRequestId=function(){return a.requestId};this.getSessionId=function(){return a.sessionId};this.getInitiateSelector=function(){return a.initiateSelector};this.getWeblab=f;this.getWeblabTreatment=h;this.isTurboLaunched=function(){return!f()&&"C"!==h()};this.isProductStateEligible=function(){return n.isTurboEligible};this.getRefTag=function(){if(!g)throw"Turbo checkout product state is NOT resolved. Cannot generate ref tag";
var a=d.$("#"+g.id),a=b.getRefTag(a);return e.generateJoinedValue(a)};this.resolve=function(a){if(a){g=n.states[a];if(!g)throw a="Resolved turbo checkout product state is undefined. Id \x3d "+a,l(a,n),a;l("Resolved new product state",g);d.trigger("turbo:checkout:state:product:resolved")}};var g=1!==n.states.length?y:n.states[0]}function l(c,b){a.logDebug("turbo-checkout-joined-state",c,b)}return{createTurboState:function(a,b,d,e,w,u){if(e&&d)throw"Custom item price is NOT supported with warranty";
var l=f.get();b&&(l.addressId=b);b=h.get();if(a||e||d||u)a=parseInt(a,10),b.states.forEach(function(b){b.lineItemInputs.forEach(function(b){a&&(b.quantity=a);e?(b.customItemPrice=e,c.logCount("turboCheckoutItemPriceOverrided")):b.customItemPrice&&c.logCount("turboCheckoutItemPriceSelectorFallBackToTurboState")});q(b.lineItemInputs,u,a);q(b.lineItemInputs,d,a)});l=new g(l,b);l.resolve(w);return l}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser",
"turbo-checkout-page-ready").register("turbo-checkout-page-state",function(d,c,a,b,e){function f(a,c,b,d,e,f,g,h,q){this.version=a;this.turboWeblab=c;this.turboWeblabTreatment=b;this.initiateSelector=d;this.turboLoadingText=e;this.turboHeaderText=f;this.addressId=g;this.requestId=h;this.sessionId=q}function h(c,b){a.logDebug("turbo-checkout-page-state",c,b)}var q=b.get(b.KEYS.TURBO_PAGE_STATE_KEY),g=b.get(b.KEYS.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR),l=new f("0","","C","#buy-now-button","","","",
"","");return{get:function(b,d){b=b||q;d=d||g;d=e.parse(b,d);c.logCount("turboCheckoutPageStates",d.length);1<d.length?(a.logError("Multiple turbo checkout page states found! Turbo will NOT show","turbo-checkout-page-state",void 0),h("PageStates",d),b=void 0):(0===d.length&&h("Turbo checkout page state ["+b+"] is NOT present"),b=d[0]);if(b)if(b.version)b=new f(b.version,b.turboWeblab||"",b.turboWeblabTreatment||"C",b.initiateSelector||".buy-now-button",b.turboLoadingText||"",b.turboHeaderText||"",
b.addressId||"",b.requestId||"",b.sessionId||"");else{d=b.inputs||{};var p=b.strings||{};b=new f("1",b.turboWeblab||"",b.turboWeblabTreatment||"C",(b.configurations||{}).initiateSelector||"#buy-now-button",p.TURBO_LOADING_TEXT||"",p.TURBO_CHECKOUT_HEADER||"",d.addressId||"",d.requestId||"",d.sessionId||"")}else c.logCount("turboCheckoutStateNotDefined"),b=l;h("Turbo Checkout PageState",b);return b}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser",
"turbo-checkout-page-ready").register("turbo-checkout-product-state",function(d,c,a,b,e){function f(a,b){this.isTurboEligible=a;this.states=b}function h(a,b,c,d){this.id=a;this.isTurboEligible=b;this.lineItemInputs=c;this.turboHeaderText=d||""}function q(a,b,c,d,e,f,n,g,h){this.asin=b||"";this.offerListingId=c||"";this.quantity=parseInt(d,10)||1;this.isTurboEligible=!!this.asin&&!!this.offerListingId&&a;this.productTitle=e||"";this.customItemPrice=f||"";this.addToCartTimeAsUnixEpochMilliseconds=n||
"";this.addToCartSessionId=g||"";this.isDiscoveredAsin=!!h}function g(b,c){a.logDebug("turbo-checkout-product-state",b,c)}function l(a){if(!a.lineItemInputs||!a.lineItemInputs.length||!a.id)return g('Versioned product state is invalid. Expected non empty "id" and "lineItemInputs". Turbo may NOT show',a),p;var b=!0,c=d.map(a.lineItemInputs,function(a){a=new q(a.isTurboEligible,a.asin,a.offerListingId,a.quantity,a.productTitle,a.customItemPrice,a.addToCartTimeAsUnixEpochMilliseconds,a.addToCartSessionId,
a.isDiscoveredAsin);b=b&&a.isTurboEligible;return a});return new h(a.id,b,c,a.turboHeaderText)}var r=b.get(b.KEYS.TURBO_PRODUCT_STATE_KEY),n=b.get(b.KEYS.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR),p=new h("buy-now-button",!1,[],""),z=new f(!1,[p]);return{get:function(b,d){b=b||r;d=d||n;d=e.parse(b,d);c.logCount("turboCheckoutProductStates",d.length);1<d.length&&"turbo-checkout-page-state"===b?(a.logError("turbo-checkout-page-state only supports the single item use case! Turbo will NOT show","turbo-checkout-product-state",
void 0),b=[]):b=d;if((d=b)&&d.length){var t=!1;b=[];for(var k=0;k<d.length;k++){var v;var m=d[k];m?m.version?v=l(m):m.inputs&&m.eligibility?(v=m.strings||{},m=new q(m.eligibility.isEligible,m.inputs.a,m.inputs.oid,m.inputs.quantity,v.TURBO_CHECKOUT_HEADER,m.inputs.customItemPrice),v=new h("buy-now-button",m.isTurboEligible,[m],v.TURBO_CHECKOUT_HEADER)):(g('Legacy product state is missing "inputs" or "eligibility". Turbo will NOT show',m),v=p):(g("Product state parsed DOM object is invalid. Turbo may NOT show",
m),v=p);t=t||v.isTurboEligible||!1;m=v.id;if(b[m])throw d="Duplicate product state found. id \x3d "+m,g(d,b),d;b.push(v);b[v.id]=v}b=new f(t,b)}else g("Parsed states are invalid. Turbo will NOT show",d),b=z;g("Turbo Checkout Product State(s)",b);return b}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-auto-open","turbo-checkout-address-id","turbo-checkout-quantity-input","turbo-checkout-warranty-input","turbo-checkout-custom-price-input",
"turbo-callback-list","turbo-checkout-joined-state","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-state-handler",function(d,c,a,b,e,f,h,q,g,l,r,n){function p(a,b,c,d,e,p){a=a||h.getQuantity();b=b||f.getAddressId();c=c||q.getLineItem(a);d=d||g.getCustomPrice();p=p||n.getLineItem();return r.createTurboState(a,b,c,d,e,p)}function z(a,c){b.logDebug("turbo-checkout-state-handler",a,c)}function w(a,b,c,d,e){x=p(a,b,c,y,d,e)}function u(){d.trigger("turbo:checkout:product:onChange");
m.callAll()}function t(){var a=p();b.isDeepEquals(x,a)||(x=a,z("New Turbo State",x),u())}var k=d.$,v=c.get(c.KEYS.AJAX_PAGE_UPDATE_EVENT),m=l.create(),x,B=!1;x=p();return{isProductTurboEligible:function(){return!B&&x.isProductStateEligible()||c.get(c.KEYS.OVERRIDE_ELIGIBILITY)},getLineItems:function(){return x.getLineItems()},getAddressId:function(){return x.getAddressId()},getWeblabAllocation:function(){return x.getWeblabTreatment()},registerCallback:function(a){m.push(a)},startMonitoringPage:function(){e.updateInputsAndThen(w);
h.onChange(t);q.onChange(t);g.onChange(t);n.registerCallback(t);d.off(v,t);d.on(v,t);u()},getRequestId:function(){return x.getRequestId()},getSessionId:function(){return x.getSessionId()},getExperimentName:function(){return x.getWeblab()},getStrings:function(){return{TURBO_LOADING_TEXT:x.getLoadingText(),TURBO_CHECKOUT_HEADER:x.getHeaderText()}},getInitiateSelector:function(){return x.getInitiateSelector()},isTurboLaunched:function(){return x.isTurboLaunched()},isPhysicalGiftCardExperimentEligible:function(){var b=
0!==k("#giftcardcustomtwister_feature_div").length;b&&(z("Physical Gift Card use case"),a.logCount("turboCheckoutGiftCardUseCase"));return b},setTurboStateNotEligible:function(){B=!0},resolveProductState:function(a){x.resolve(a)},getActiveId:function(){return x.getActiveId()},getRefTag:function(){return x.getRefTag()}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-aui-page-state-parser",function(d,c){var a=d.$;return{parse:function(b,d){b="script[data-a-state*\x3d'"+
b+"'], #"+b;d=d?a(d).find(b):a(b);b=[];for(var f=0;f<d.length;f++){var h;a:{try{var q=a(d[f]).text();h=JSON.parse(q);break a}catch(g){c.logError("JSON::parse exception. Exception \x3d "+g,"turbo-checkout-aui-page-state-parser",void 0)}h=void 0}h&&b.push(h)}return b}}});"use strict";k.when("jQuery","turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-page-load-spinner",function(d,c){function a(){0!==d("#turbo-checkout-auto-load-spinner-container").length&&(d("#turbo-checkout-auto-load-spinner-container").remove(),
e.unbind("touchmove touchstart touchend touchcancel click scroll",b))}function b(a){a.preventDefault();a.stopPropagation()}var e=d("body");c.isAutoOpenEligible()&&(e.bind("touchmove touchstart touchend touchcancel click scroll",b),e.append("\x3cdiv id\x3d'turbo-checkout-auto-load-spinner-container' class\x3d'turbo-checkout-auto-load-spinner-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-circle-container' class\x3d'turbo-checkout-auto-load-circle-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-spinner' class\x3d'a-spinner a-spinner-medium turbo-checkout-auto-load-spinner'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e"),
setTimeout(a,5E3));return{removePageLoadSpinner:a}});"use strict";k.when("turbo-configuration","turbo-checkout-ref-tagger","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-urls",function(d,c,a){function b(a,b){var c=d.get(d.KEYS.DEVICE_OVERRIDE);return"\x26pipelineType\x3dturbo\x26clientId\x3dretailwebsite"+(c?"\x26devicestring-override\x3d"+c:"")+g(a,b)}function e(a){var b=d.get(d.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return"ref_\x3d"+a+"\x26referrer\x3d"+b}function f(b){return a.isNonEmptyString(b)?
"\x26weblab\x3d"+b:""}function h(){return d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)?"\x26temporaryAddToCart\x3d1":""}function q(b){if(!b||!b.length)return"";d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)||a.logError('Discovered asins present but add to cart is disabled? This will generate a "clickstream_ignore" hit on the server side and cause the hit to be ignored by clickstream and the attribution lost!',"turbo-checkout-urls");var c="";b.forEach(function(a,b){c+="\x26discoveredAsins."+b+"\x3d"+a});return c}function g(b,
c){var d="";a.isNonEmptyString(b)&&(d+="\x26pageRequestId\x3d"+b);a.isNonEmptyString(c)&&(d+="\x26pageSessionId\x3d"+c);return d}function l(){return r("auiDebug","auiDebug")+r("ds_user","ds_user")+r("ds_turbo_workspace","ds_workspace")+r("stringDebug","stringDebug")}function r(b,c){var d="";b=a.getUrlQueryParam(b);a.isNonEmptyString(b)&&(d="\x26"+c+"\x3d"+b);return d}return{buildInitiatePathWith:function(a,c,d,g){return"/checkout/turbo-initiate?"+e(a)+b(d,g)+f(c)+h()+l()},buildEligibilityPathWith:function(a,
c,d,g){return"/checkout/turbo-initiate?"+e(a)+b(d,g)+f(c)+"\x26checkEligibilityOnly\x3dtrue"+h()+l()},buildConfirmPathWith:function(a,c,d,g,r){return"/checkout/turbo-initiate/confirm?"+e(a)+b(d,g)+f(c)+h()+q(r)},buildLogPageHitPathWith:function(a,d){return"/checkout/log-page-hit?"+c.generateRefTag(a,c.ACTIONS.CLOSE,d)+b()},buildTriggerWeblabPathWith:function(a,b,c,d,h){return"/checkout/triggerWeblab?"+e(a)+f(b)+"\x26weblabAllocation\x3d"+c+g(d,h)},buildTriggerWeblabPathWithoutWeblab:function(a,b,
c){return"/checkout/triggerWeblab?"+e(a)+g(b,c)}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-callback-list",function(){function d(){var c=[];this.callAll=function(){for(var a=0;a<c.length;a++){var b=c[a];b.apply(b,arguments)}};this.push=function(a){if("function"!==typeof a)throw"Invalid callback. Expected typeof 'callback' to be 'function'. typeof \x3d "+typeof a;-1===c.indexOf(a)&&c.push(a)};this.remove=function(a){a=c.indexOf(a);-1!==a&&c.splice(a,1)}}return{create:function(){return new d}}});
"use strict";k.when("turbo-callback-list","turbo-checkout-page-ready").register("turbo-filtered-callback-list",function(d){function c(a){var b=d.create();this.callAll=b.callAll;this.remove=b.remove;this.push=function(c){(c=c[a])&&"function"===typeof c&&b.push(c)}}return{create:function(a){if(!a||"string"!==typeof a)throw"Invalid filter parameter. Expected 'filter' to be a non empty string. typeof \x3d "+typeof a+" value \x3d "+a;return new c(a)}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-utils",
"turbo-checkout-page-ready").register("turbo-checkout-form",function(d,c,a){function b(a){var b=c.get(c.KEYS.FORM_SELECTOR_OVERRIDE);if(b&&0<e(b).length)return e(b);b=c.get(c.KEYS.FORM_TYPE);if("link"===b)return a.find("a");if("form"===b)return a.closest("form");throw"Unsupported FORM_TYPE is configured. value \x3d "+b;}var e=d.$,f=/[\/?&]ref_?=([^?&]+)/;return{getForms:b,getRefTag:function(c){if(1!==c.length)return a.logError("Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",
"turbo-checkout-form"),a.logDebug("turbo-checkout-form","Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",c),"";c=b(c);c=((c.attr("action")||c.attr("href")||"")+"\x26"+c.serialize()).match(f)||{};return 2===c.length?c[1]:""}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-page-ready").register("turbo-checkout-ajax-wrapper",function(d,c){return{load:function(a,b){b.hasOwnProperty("timeout")||(b.timeout=2E4);return d.ajax(a,b)},
loadWithJQXHR:function(a,b){b.hasOwnProperty("timeout")||(b.timeout=2E4);return d.$.ajax(a,b)},createXHRRequest:function(){var a=new XMLHttpRequest;a.timeout=2E4;return a}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-session-storage","turbo-checkout-quantity-input","turbo-checkout-address-id","turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-auto-open",function(d,c,a,b,e,f,h,q){function g(b,
c){a.logDebug("turbo-checkout-auto-open",b,c)}function l(){return r()&&0!==k}function r(){var d;if(d="1"===t.trb_open||"1"===a.getUrlQueryParam("trb_open"))(d=b.isPresent("hasTurboAutoOpened"))&&c.logCount("turboCheckoutAutoOpenLoopPrevented"),d=!d;return d}function n(){return 1===k&&r()}function p(){n()&&(l()&&(k=2,b.set("hasTurboAutoOpened","1")),A(t.trb_bid),d.trigger("turbo:checkout:auto:open"))}var z=d.$,k=0,u="trb_open trb_addr trb_qty trb_warrAsin trb_auth trb_sid trb_bid trb_accessoryAsin trb_accessoryOffer".split(" "),
t={},A=function(){};return{setup:function(b,c){if(r()){k=1;var e=m.location.href;z.each(u,function(b,c){b=a.getUrlQueryParam(c);t[c]=b;e=a.removeQueryParam(c,b,e)});g("Parameters:",t);a.replaceHistory(e);"function"===typeof b?A=b:a.logError("Initiate action must be supplied, and it must be a function.");d.on("turbo:checkout:prefetcher:state:dataStale",p);c()}else k=0,g("Disabled")},reset:function(){b.remove("hasTurboAutoOpened")},isAutoOpenEligible:r,isAutoOpenEnabled:l,isAutoOpenReadyToBeOpened:n,
updateInputsAndThen:function(a){var b=t.trb_qty,c=t.trb_addr,d=t.trb_warrAsin,g=t.trb_bid,n=t.trb_accessoryAsin,r=t.trb_accessoryOffer;if(b||c||d||g||n||r){b&&e.setQuantity(b);c&&f.set(c);var p;d&&(h.select(d),p=h.getLineItem(b));var l;n&&r&&(q.select(n),l=q.getLineItem());a(b,c,p,g,l)}}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-checkout-utils",function(){function d(){return navigator.userAgent}function c(a,b){if(a===b||"function"===typeof a&&"function"===typeof b)return!0;
if(typeof a!==typeof b)return!1;if("object"!==typeof a||null===a||null===b)return a===b||a!==a&&b!==b;var d=Object.getOwnPropertyNames(a);if(d.length!==Object.getOwnPropertyNames(b).length)return!1;for(var f=0;f<d.length;f++){var h=d[f];if(!a.hasOwnProperty(h)||!b.hasOwnProperty(h)||!c(a[h],b[h]))return!1}return!0}return{logError:function(a,b){k.log(a,"ERROR",b||"turbo-checkout-utils")},logWarning:function(a,b){k.log(a,"WARN",b||"turbo-checkout-utils")},logDebug:function(){},getUserAgent:d,isAndroid:function(){return!!d().match(/[a|A]ndroid/)},
isIPhone:function(){return!!d().match(/iPhone/)},isIPad:function(){return!!d().match(/iPad/)},isInternetExplorer:function(){return!!d().match(/MSIE/)},createFQDN:function(a){/^http/.test(a)||(a=m.location.origin?m.location.origin+a:m.location.protocol+"//"+m.location.hostname+":"+m.location.port+a);return a},getUrlQueryParam:function(a,b){b||(b=m.location.href);a=a.replace(/[\[\]]/g,"\\$\x26");return(a=(new RegExp("[?\x26]"+a+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(b))?a[2]?decodeURIComponent(a[2].replace(/\+/g,
" ")):"":y},removeQueryParam:function(a,b,c){var d=c;a&&b&&c&&(a=a+"\x3d"+b,d=c.replace(new RegExp("\\?"+a+"[\x26]?","g"),"?"),d=d.replace(new RegExp("[\x26]?"+a,"g"),""));return d},replaceHistory:function(a){m.history.pushState&&m.history.replaceState(null,m.title,a)},isNonEmptyString:function(a){return"string"===typeof a&&0<a.length},isDeepEquals:c}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-csm",function(d){function c(a,c,d,e){return"function"===
typeof m.uet?m.uet.apply(m.uet,arguments):e||b()}function a(a,b,c){return"function"===typeof m.ues?m.ues.apply(m.ues,arguments):c}function b(){return+new Date}function e(d){function e(){q&&f&&p&&h&&!k&&"function"===typeof u&&(u(q,f,p,h),k=!0)}var f,h,p,q,k=!1,u;this.getId=function(){return d};this.markClick=function(){q=c("tc",d)};this.markFirstByte=function(){f=a("t0",d,b())};this.markAboveTheFold=function(){p=c("af",d);e()};this.markCriticalFeature=function(){h=c("cf",d);e()};this.whenDataSet=function(a){u=
a;e()}}function f(a){"undefined"!==typeof m.ue_t0&&m.ue.count(a,Date.now()-m.ue_t0)}var h=0,q=[];return{createScope:function(){return new e("chk_turbo_"+ ++h)},logCount:function(a,b){b=b||1;d.logDebug("Logging counter "+a+" with value "+b);if(m.ue&&m.ue.count){var c=a+"_time";m.ue.count(a,b);f(c);for(var e=0;e<q.length;++e)m.ue.count(a+"."+q[e],b),f(c+"."+q[e])}},addCounterExtraSuffix:function(a){q.push(a)},timestamp:b}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-page-ready").register("turbo-checkout-counter",
function(d,c){var a=0,b=0,e=0,f=0,h=0,q=0,g="u";d.on("turbo:checkout:sheet:beforeOpen",function(){c.logCount("turboCheckoutSheetOpen",a);"u"!==g?(++h,c.logCount("turboCheckoutPrefetchUsed",h),"p"===g?c.logCount("turboCheckoutPrefetchUsedInProgress",h):c.logCount("turboCheckoutPrefetchUsedFull",h)):(++q,c.logCount("turboCheckoutPrefetchMissing",q))});d.on("turbo:checkout:sheet:beforeClose",function(){++b;c.logCount("turboCheckoutSheetClose",b)});d.on("turbo:checkout:prefetcher:state:dataPrefetching",
function(){c.logCount("turboCheckoutPrefetchRequested",e);g="p"});d.on("turbo:checkout:prefetcher:state:dataFresh",function(){++f;c.logCount("turboCheckoutPrefetchAvailable",f);g="a"});d.on("turbo:checkout:prefetcher:state:dataStale",function(){g="u"});return{incrementSheetOpenedCounter:function(){a++},incrementPrefetchCounter:function(){e++},getSheetOpenCount:function(){return a},getPrefetchCount:function(){return e}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-checkout-cacher",
function(){return{createCache:function(d){var c=!1,a;return function(){c||(a=d(),c=!0);return a}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-utils","turbo-checkout-counter","turbo-checkout-page-ready").register("turbo-checkout-ref-tagger",function(d,c,a,b){function e(a,c,d){a="chk_"+a+"_"+(c+"_"+b.getPrefetchCount()+"-"+b.getSheetOpenCount());return f(d?a+"_"+d:a)}function f(a){if(!("string"===typeof a&&0<a.length&&64>=a.length&&q.test(a))||g.test(a))throw"Invalid ref tag. This would be filtered and replaced in clickstream. Value \x3d "+
a;return a}var h={ELIGIBILITY:"eligibility",BUY_NOW:"buyNow",CLOSE:"close"},q=/(^[A-z]$|^[A-z][A-z0-9_-]*[A-Za-z0-9]$)/,g=/[_-]{2,}/,l=c.get(c.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return{generateRefTag:function(a,b,c){return"ref_\x3d"+e(a,b,c)},generateValue:e,generateJoinedValue:function(c){if(!c)return e(l,h.BUY_NOW,"fallback");try{var d=c+"_"+(h.BUY_NOW+"_"+b.getPrefetchCount()+"-"+b.getSheetOpenCount());return f(d)}catch(g){return a.logError(g,"turbo-checkout-ref-tagger"),e(l,h.BUY_NOW,"fallback")}},
generateEligibilityValue:function(){return e(l,h.ELIGIBILITY)},ACTIONS:h,TAGS:{TOUCH:"touch",TOUCH_X:"touchX",BACK:"back",ROTATION:"rotation"}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-prefetch-timer",function(d){function c(){f||(f=!0,d.trigger("turbo:checkout:timer:onTimeout"))}function a(){if(f)return!0;var a=(new Date).getTime();return e?6E5<=a-e:!1}var b,e,f=!1;return{startTimer:function(){b||(b=m.setTimeout(c,6E5));e||(e=(new Date).getTime())},isTimeout:a,
resetTimer:function(){m.clearTimeout(b);f=!1;e=b=null},checkTimeout:function(){a()&&c()}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-form","turbo-checkout-buy-now-onclick-handler","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-buy-now-button",function(d,c,a,b,e,f,h,q){function g(a,c){b.logDebug("turbo-checkout-buy-now-button",a,c)}function l(a){return a?r(a):c(e.getInitiateSelector())}function r(d){var e=
c("#"+d),f=q.get(q.KEYS.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID);if(!f)return e;var h=c("[id\x3d"+d+"]");if(2>h.length)return e;a.logCount("turboCheckoutBuyNowDuplicateIdPresent");g("Duplicate nodes present for BuyNow button ID: #"+d+". Resolving BuyNow button with CSS: "+f);h=h.filter(f);return 1!==h.length?(a.logCount("turboCheckoutBuyNowUnableToResolveButtonIdWithCss"),b.logError("Unable to resolve a unique BuyNow button with CSS: "+f+". Defaulting to first button with ID: #"+d,"turbo-checkout-buy-now-button",
void 0),e):h}function n(b){g("Buy now button clicked");a.logCount("turboCheckoutBuyNowClicked");h.isConflictingOnClickListenerPresent(c(b.currentTarget))&&(F=!0);b&&b.currentTarget&&b.currentTarget.id||(g("Click event target is INVALID. Expected event target with an id. Turbo will NOT show",b),F=!0);if(F)F=!1,g("Buy now button callbacks supressed");else{e.resolveProductState(b.currentTarget.id);var d;g("Calling buy now button callbacks...");d=!1;for(var n=0;n<v.length;n++)d=d||v[n]();d?(g("Supressing default buy now button action"),
b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),d=!0):d=void 0;if(d)return!1}f.getForms(c(b.currentTarget)).attr("data-action",p());g("Calling default BuyNow action. User will be sent to Checkout SPC. Turbo will NOT show.");a.logCount("turboCheckoutBuyNowDefault");h.callCachedOnClickListenerIfPresent(b.currentTarget,b);return!0}function p(){return l().attr("name")||"submit.buy-now"}function k(a){for(var b=v.length-1;0<=b;--b)v[b]===a&&v.splice(b,1)}function m(a){if(!a&&1<l().length)throw"Button id parameter is NOT present. Cannot execute action without a button id on a page with multiple buy now buttons!";
}function u(a){a=l(a);t(a);a.click()}function t(b){for(var d=q.get(q.KEYS.CONFLICTING_INITIATE_LISTENERS),e=0;e<d.length;e++){var f=d[e];g("Unbound configured event '"+f+"' from buy now button");a.logCount("turboCheckoutBuyNowButtonConflictingListeners");b.unbind(f);c(document.body).undelegate(b.selector,f)}}var A=q.get(q.KEYS.BUY_NOW_CLICK_EVENT),v=[],F=!1;d.on("turbo:checkout:clickInitiate",u);a.logCount("turboCheckoutBuyNowButtonBound");return{registerOnClickCallback:function(a){k(a);v.push(a)},
deregisterOnClickCallback:k,executeOriginalBuyNowAction:function(a){m(a);F=!0;d.trigger("turbo:checkout:buyNowDisabled");d.trigger("turbo:checkout:clickInitiate",a)},executeTurboBuyNowAction:function(a){m(a);F=!1;u(a)},getSubmitAction:p,bindTurboClickEvent:function(a){a=a||l();h.removeConflictingOnClickListenerIfPresentAndCacheIt(a);a.unbind(A).bind(A,n)},removeConflictingListeners:t,getBuyNowButtons:l}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-buy-now-onclick-handler",
function(d,c,a,b){function e(a,b){a.each(function(a,d){c(d).removeProp(b)})}function f(a,b){var d=!1;a.each(function(){var a=c(this),e=a.find("[onclick]"),f=a.prop("onclick"),h=e.prop("onclick");return g(f)&&g(h)||1<e.length||!g(f||h)||q(a)!==b?(d=!0,!1):!0});return d}function h(a){return a.prop("onclick")||a.find("[onclick]").prop("onclick")}function q(a){return a.attr("onclick")||a.find("[onclick]").attr("onclick")}function g(a){return"function"===typeof a}function l(a,c){b.logDebug("turbo-checkout-buy-now-onclick-handler",
a,c)}var r;return{callCachedOnClickListenerIfPresent:function(b,c){g(r)&&(l("BuyNow button onclick listener function called."),a.logCount("turboCheckoutBuyNowButtonOnClickListenerCalled"),r.call(b,c.originalEvent))},removeConflictingOnClickListenerIfPresentAndCacheIt:function(b){var c=h(b),d=q(b);g(c)&&d&&(f(b,d)?(l("[DOM ERROR] Turbo will NOT show. BuyNow button node has INVALID 'onclick' DOM structure.",b),a.logCount("turboCheckoutBuyNowButtonInvalidOnClickDOM")):(l("BuyNow button node has 'onclick' attribute. Removing its listener and caching it.",
b),a.logCount("turboCheckoutBuyNowButtonOnClickListenerRemoveAndCache"),r=c,c=b.find("[onclick]"),e(b,"onclick"),e(c,"onclick")))},isConflictingOnClickListenerPresent:function(b){if(b=g(h(b)))l("Turbo will NOT show. BuyNow button node has conflicting 'onclick' listener."),a.logCount("turboCheckoutBuyNowButtonConflictingOnClickListener");return b}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-checkout-page-ready").register("turbo-checkout-buy-now-integration",
function(d,c,a){function b(a,b){c.logDebug(a,"turbo-checkout-buy-now-integration",b)}var e=d.$,f=[];d.on("turbo:checkout:page:reappear",function(){b("Removing additional form inputs from form",f);for(var a;(a=f.shift())!==y;)a.remove()});return{isBuyNow:function(b){return b instanceof e&&b.attr("data-action")===a.getSubmitAction()},checkoutWith:function(a,d){if(Array.isArray(a)&&d instanceof e){var g;g=d;for(var l=1;0<g.find('input[name\x3d"asin.'+l+'"]').length||0<g.find('input[name\x3d"offeringID.'+
l+'"]').length;)l++;g=l;for(var l=[],r=0;r<a.length;r++){var n=a[r];if(n!==y&&n.asin&&n.offerListingId){var p=g,n=[e("\x3cinput /\x3e",{type:"hidden",name:"asin."+p,value:n.asin}),e("\x3cinput /\x3e",{type:"hidden",name:"offeringID."+p,value:n.offerListingId}),e("\x3cinput /\x3e",{type:"hidden",name:"quantity."+p,value:n.quantity||1})];Array.prototype.push.apply(l,n);g++}else b('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!',n),
c.logError('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!')}r=d.find('input[name\x3d"itemCount"]');1===r.length?r.val(g):d.append(e("\x3cinput /\x3e",{type:"hidden",name:"itemCount",value:g}));b("Appended additional buy now inputs.",l);d.append.apply(d,l);f=l}else g="Inputs are invalid. Expected array and jQuery object. lineItems \x3d "+a+" $form \x3d "+d,b(g,arguments),c.logError(g)}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-configuration-keys",
function(d){var c={HOST_PAGE_TYPE_IDENTIFIER:"HOST_PAGE_TYPE_IDENTIFIER",FORM_TYPE:"FORM_TYPE",FORM_SELECTOR_OVERRIDE:"FORM_SELECTOR_OVERRIDE",BUY_NOW_BUTTON_SELECTOR:"BUY_NOW_BUTTON_SELECTOR",BUY_NOW_BUTTON_V2_SELECTOR:"BUY_NOW_BUTTON_V2_SELECTOR",BUY_NOW_CLICK_EVENT:"BUY_NOW_CLICK_EVENT",BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID:"BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID",QUANTITY_SELECT_SELECTOR:"QUANTITY_SELECT_SELECTOR",ADDRESS_INPUT_SELECTORS:"ADDRESS_INPUT_SELECTORS",WARRANTY_CHECKBOX_INPUT_SELECTOR:"WARRANTY_CHECKBOX_INPUT_SELECTOR",
WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR:"WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR",WARRANTY_ASIN_INPUT_NAME:"WARRANTY_ASIN_INPUT_NAME",WARRANTY_OFFER_INPUT_SELECTOR:"WARRANTY_OFFER_INPUT_SELECTOR",AJAX_PAGE_UPDATE_EVENT:"AJAX_PAGE_UPDATE_EVENT",PREFETCH_TREATMENT:"PREFETCH_TREATMENT",NO_PREFETCH_TREATMENT:"NO_PREFETCH_TREATMENT",BUY_NOW_ONLY_TREATMENT:"BUY_NOW_ONLY_TREATMENT",IS_DEVICE_FILTER_REQUIRED:"IS_DEVICE_FILTER_REQUIRED",IS_SIGN_IN_SUPPORTED:"IS_SIGN_IN_SUPPORTED",USES_MASH_WILL_REAPPEAR:"USES_MASH_WILL_REAPPEAR",
SHOW_SIGN_IN_INTERFACE:"SHOW_SIGN_IN_INTERFACE",IFRAME_ID:"IFRAME_ID",EXTEND_ELIGIBLE_STATE:"EXTEND_ELIGIBLE_STATE",VIEW_ADAPTER:"VIEW_ADAPTER",PAGE_STATE_PARSING_ROOT_NODE_SELECTOR:"PAGE_STATE_PARSING_ROOT_NODE_SELECTOR",PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR:"PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR",TURBO_PAGE_STATE_KEY:"TURBO_PAGE_STATE_KEY",TURBO_PRODUCT_STATE_KEY:"TURBO_PRODUCT_STATE_KEY",DEVICE_OVERRIDE:"DEVICE_OVERRIDE",CONFLICTING_INITIATE_LISTENERS:"CONFLICTING_INITIATE_LISTENERS",VAS_CHANGE_EVENTS:"VAS_CHANGE_EVENTS",
VAS_CHECKBOX_SELCTOR:"VAS_CHECKBOX_SELCTOR",CHECKBOX_EXCLUSION_ROOT_NODES:"CHECKBOX_EXCLUSION_ROOT_NODES",MASH_ADAPTER:"MASH_ADAPTER",IS_ADD_TO_CART_ENABLED:"IS_ADD_TO_CART_ENABLED",IS_BUYNOW_ENABLED_FOR_SCREENREADER:"IS_BUYNOW_ENABLED_FOR_SCREENREADER",BACKGROUND_SCROLL_TARGET_SELECTOR:"BACKGROUND_SCROLL_TARGET_SELECTOR",NO_PREFETCH_EXPERIMENT_WEBLABS:"NO_PREFETCH_EXPERIMENT_WEBLABS",ENABLED_ACCESSORIES_SELECTOR:"ENABLED_ACCESSORIES_SELECTOR",OVERRIDE_ELIGIBILITY:"OVERRIDE_ELIGIBILITY",validate:function(a){if("string"!==
typeof a||!c[a])throw"The key '"+a+"' is not defined within 'turbo-configuration-keys'.";}};return c});"use strict";k.when("A","turbo-configuration-keys","turbo-device-configuration","turbo-client-configuration","turbo-eligibility-override","turbo-checkout-page-ready").register("turbo-configuration",function(d,c,a,b,e){function f(a,b){var c=h(a);l[a]=c===y?b:c}function h(c){var d=b[c];c=a[c];if(q(d))return d;if(q(c))return c}function q(a){return"boolean"===typeof a||a}function g(c){if(!q(b[c])&&!q(a[c]))throw"Required configuration override for key '"+
c+"' is missing";l[c]=h(c)}var l;return{get:function(a){c.validate(a);var b;l||(l={},g(c.HOST_PAGE_TYPE_IDENTIFIER),g(c.SHOW_SIGN_IN_INTERFACE),g(c.EXTEND_ELIGIBLE_STATE),g(c.VIEW_ADAPTER),f(c.FORM_TYPE,"form"),f(c.FORM_SELECTOR_OVERRIDE,""),f(c.BUY_NOW_BUTTON_SELECTOR,"#buy-now-button"),f(c.BUY_NOW_BUTTON_V2_SELECTOR,".checkout-buy-now"),f(c.BUY_NOW_CLICK_EVENT,"click.turboCheckout"),f(c.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID,""),f(c.QUANTITY_SELECT_SELECTOR,'select[name\x3d"quantity"]'),
f(c.ADDRESS_INPUT_SELECTORS,["#unifiedLocation1ClickAddress","#unifiedLocationAddress"]),f(c.WARRANTY_CHECKBOX_INPUT_SELECTOR,".mbb-checkbox input[name\x3dmbba]"),f(c.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR,".mbb-checkbox-column"),f(c.WARRANTY_ASIN_INPUT_NAME,"mbba"),f(c.WARRANTY_OFFER_INPUT_SELECTOR,"#mbb-offering-id"),f(c.AJAX_PAGE_UPDATE_EVENT,"a:pageUpdate"),f(c.PREFETCH_TREATMENT,"PREFETCH_DISABLED"),f(c.NO_PREFETCH_TREATMENT,"T1"),f(c.BUY_NOW_ONLY_TREATMENT,"BUY_NOW_LAUNCHED"),f(c.IS_DEVICE_FILTER_REQUIRED,
!1),f(c.IS_SIGN_IN_SUPPORTED,!0),f(c.USES_MASH_WILL_REAPPEAR,!1),f(c.IFRAME_ID,"turbo-checkout-iframe"),f(c.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),f(c.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),f(c.TURBO_PAGE_STATE_KEY,"turbo-checkout-page-state"),f(c.TURBO_PRODUCT_STATE_KEY,"turbo-checkout-page-state"),f(c.DEVICE_OVERRIDE,""),f(c.CONFLICTING_INITIATE_LISTENERS,[]),f(c.CHECKBOX_EXCLUSION_ROOT_NODES,"#simpleBundle_feature_div #monthlyPayments_feature_div #bbg_feature_div #addons_feature_div #mobile-accessory-upsell #detailPageGifting_feature_div #twister-plus-feature".split(" ")),
f(c.ENABLED_ACCESSORIES_SELECTOR,".simpleBundleCheckBoxArea"),f(c.MASH_ADAPTER,""),f(c.IS_ADD_TO_CART_ENABLED,!0),f(c.IS_BUYNOW_ENABLED_FOR_SCREENREADER,!0),f(c.BACKGROUND_SCROLL_TARGET_SELECTOR,"#productTitleGroupAnchor"),f(c.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),f(c.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),f(c.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),f(c.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),f(c.NO_PREFETCH_EXPERIMENT_WEBLABS,["RCX_CHECKOUT_TURBO_PRIME_UPSELL_222066"]),
f(c.OVERRIDE_ELIGIBILITY,e));b=l;return b[a]},KEYS:d.copy(c)}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","turbo-checkbox-exclusion-listener","turbo-checkout-content-loader","turbo-checkout-device-filter","turbo-callback-list","turbo-checkout-auto-open","turbo-checkout-vas-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-base-eligible-state",function(d,c,a,b,e,f,h,q,g,l){function k(){A=!0}function n(){A=
!1}function p(){var d=new m;f.isDeviceTurboEligible()||d.invalidate("Device is NOT eligible");e.isError()&&!c.isNoPrefetch()&&d.invalidate("Prefetch failed");a.isProductTurboEligible()||d.invalidate("Product is NOT eligible");q.isAutoOpenEnabled()||A||d.invalidate("Cheetah eligibility response is false");c.isControl()&&d.invalidate("Weblab is in CONTROL");c.isBuyNowOnly()&&d.invalidate("Weblab is in buy now only treatment");g.isSelected()&&d.invalidate("Value added service is selected and NOT supported");
l.isEligible()||d.invalidate("Accessory selection was not eligible");b.isAnyCheckboxChecked()&&d.invalidate("Exclusion case checkbox is checked");u.callAll(d);d.logInvalidState();return d.canShow()}function m(){var a=!0,b=[];this.invalidate=function(c){a=!1;b.push(c)};this.logInvalidState=function(){a||d.logDebug("turbo-base-eligible-state","Cannot show turbo because: "+b)};this.canShow=function(){return a}}function w(a){t.callAll(p(),a)}var u=h.create(),t=h.create(),A=!1;return{addStateCheck:function(a){u.push(a)},
canShow:p,registerStateChangeCallback:function(a){t.push(a)},onStateChange:w,setup:function(){e.registerCallback({onTurboEligible:k,onFinish:k,onTurboIneligible:n});a.registerCallback(w);b.onStateChange(w);g.onChange(w);l.registerCallback(w)}}});"use strict";k.when("A","turbo-callback-list","turbo-checkout-page-ready").register("turbo-checkout-base-view",function(d,c){function a(a){if("string"!==typeof a)throw"Parameter 'iFrameContainerSelector' is not a string.";this.onBoundsAdjustedCallbacks=c.create();
this.IFRAME_CONTAINER_SELECTOR=a}var b=d.$;a.prototype.updateBounds=function(a,b){if("number"!==typeof a)throw'Parameter "iFrameContainerHeightInPixels" is not a number. Cannot validate bounds.';var c=this.$getIFrameContainer().height(),d=a-c,g=c+d;0!==d&&(this.$getIFrameContainer().height(g),b&&a!==b?(this.$getIFrame().height(b),this.$getIFrameContainer().css("overflow-y","scroll"),this.$getIFrameContainer().css("-webkit-overflow-scrolling","touch")):(this.$getIFrame().height("100%"),this.$getIFrameContainer().css("overflow-y",
""),this.$getIFrameContainer().css("-webkit-overflow-scrolling","")),a=parseInt(this.$getIFrameContainer().css("min-height"),10),g=g>a?g:a,c!==g&&this.onBoundsAdjustedCallbacks.callAll(g))};a.prototype.$getIFrameContainer=function(){return b(this.IFRAME_CONTAINER_SELECTOR)};a.prototype.$getIFrame=function(){return b(this.IFRAME_CONTAINER_SELECTOR+" iframe")};a.prototype.pushBoundsAdjustedCallback=function(a){this.onBoundsAdjustedCallbacks.push(a)};return{extend:function(){function b(){a.apply(this,
arguments)}b.prototype=Object.create(a.prototype);return b.prototype.constructor=b}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-eligible-state-check",function(d){d.get(d.KEYS.EXTEND_ELIGIBLE_STATE)||k.when("turbo-base-eligible-state").register("turbo-checkout-eligible-state",function(c){return{canShow:c.canShow,registerStateChangeCallback:c.registerStateChangeCallback,setup:c.setup}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-configuration",
"turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-weblab-allocation",function(d,c,a){function b(){return c.getWeblabAllocation()}function e(){return c.getExperimentName()}function f(){return"C"===b()}function h(){var b=a.get(a.KEYS.NO_PREFETCH_EXPERIMENT_WEBLABS);return Array.isArray(b)&&-1!==b.indexOf(e())&&!f()}return{getAllocation:b,getExperimentName:e,isControl:f,isBuyNowOnly:function(){return b()===a.get(a.KEYS.BUY_NOW_ONLY_TREATMENT)},isPrefetch:function(){return!h()&&
b()===a.get(a.KEYS.PREFETCH_TREATMENT)},isNoPrefetch:function(){var c=a.get(a.KEYS.NO_PREFETCH_TREATMENT);return h()||!!b().match(c)}}});"use strict";k.when("A","jQuery","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-buy-now-button","turbo-checkout-form","turbo-configuration","turbo-checkout-state-handler","turbo-checkout-eligibility-response-weblabs","turbo-checkout-page-ready").register("turbo-checkout-weblab-trigger",
function(d,c,a,b,e,f,h,q,g,l,k,n){function p(){d.on("turbo:checkout:prefetch:onTurboEligible",function(){D=!0;t()})}function z(){d.on("turbo:checkout:prefetch:onTurboIneligible",function(){D=!1;t()})}function w(){d.on("a:pageUpdate",function(){t()})}function u(){d.on("turbo:checkout:auto:open",function(){F()})}function t(){0===A().length?f.logCount("turboCheckoutBuyNowButtonMissing"):0===g.getForms(A()).length&&f.logCount("turboCheckoutBuyNowFormMissing");0<g.getForms(A()).length&&(D?(b.logDebug("turbo-checkout-weblab-trigger",
"Adding trigger to form: "+h.getAllocation()),B.val(h.getAllocation()),y.val(h.getExperimentName()),G.val(k.getRequestId()),C.val(k.getSessionId()),g.getForms(A()).append(B,y,G,C)):(b.logDebug("turbo-checkout-weblab-trigger","Removing trigger from form: "+h.getAllocation()),B.remove(),y.remove(),G.remove(),C.remove()))}function A(){var a=l.get(l.KEYS.BUY_NOW_BUTTON_SELECTOR),b=l.get(l.KEYS.BUY_NOW_BUTTON_V2_SELECTOR);return 0===c(a).length?c(b):c(a)}function v(){if(n.get()&&0<n.get().length||D&&!k.isTurboLaunched())b.logDebug("turbo-checkout-weblab-trigger",
"Calling cheetah to trigger: "+h.getAllocation()),0<g.getForms(A()).find(B).length||f.logCount("turboCheckoutTriggerMissing"),F(!D||k.isTurboLaunched())}function F(a){a=a?e.buildTriggerWeblabPathWithoutWeblab(k.getRefTag,k.getRequestId(),k.getSessionId()):e.buildTriggerWeblabPathWith(k.getRefTag(),h.getExperimentName(),h.getAllocation(),k.getRequestId(),k.getSessionId());var b={additionalWeblabsToTrigger:JSON.stringify(n.get())},d="function"===typeof m.Blob;"function"===typeof m.navigator.sendBeacon&&
d?(b=new Blob([c.param(b)],{type:"application/x-www-form-urlencoded"}),m.navigator.sendBeacon(a,b)||f.logCount("turboCheckoutTriggerRecordingFailed")):x(a,b)}function x(b,c){a.load(b,{method:"POST",params:c,error:function(a,b,c){a&&204===a.http.status||f.logCount("turboCheckoutTriggerRecordingFailed")},abort:function(a){f.logCount("turboCheckoutTriggerRecordingFailed")}})}var B,y,G,C,D=!1;return{setup:function(){B=c("\x3cinput/\x3e",{type:"hidden",name:"triggerTurboWeblab",value:""});y=c("\x3cinput/\x3e",
{type:"hidden",name:"triggerTurboWeblabName",value:""});G=c("\x3cinput/\x3e",{type:"hidden",name:"turboPageRequestId",value:""});C=c("\x3cinput/\x3e",{type:"hidden",name:"turboPageSessionId",value:""});w();p();z();q.registerOnClickCallback(v);u()}}});"use strict";k.when("A","turbo-checkout-form","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-page-filter",function(d,c,a,b){function e(b,c){a.logDebug("turbo-checkout-page-filter",b,c)}return{isCurrentViewTurboEligible:function(){var a=
d.$(b.getInitiateSelector()),h=c.getForms(a),k=0<a.length&&a.length===h.length;k||(e("Page is NOT turbo eligible. Parent forms / nested links do not match the number of initiate selectors",a),e("Forms",h));return k}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-device-filter-check",function(d){d.get(d.KEYS.IS_DEVICE_FILTER_REQUIRED)||k.when("turbo-checkout-cacher","turbo-checkout-page-ready").register("turbo-checkout-device-filter",function(c){var a=function(){return!0};
return{isDeviceTurboEligible:c.createCache(a),isSignInSupported:c.createCache(a)}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-page-filter","turbo-checkout-weblab-allocation","turbo-checkout-page-ready").register("turbo-checkout-eligibility-aggregator",function(d,c,a,b,e){return{isTurboEligible:function(){return b.isCurrentViewTurboEligible()&&c.isProductTurboEligible()&&!e.isBuyNowOnly()},isSignInSupported:function(){return a.isSignInSupported()&&
!e.isBuyNowOnly()},shouldAttemptPrefetch:function(){return a.isDeviceTurboEligible()&&!e.isBuyNowOnly()}}});"use strict";k.when("A","turbo-checkout-ref-tagger","turbo-filtered-callback-list","turbo-checkout-state-handler","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-eligibility-aggregator","turbo-checkout-eligibility-response-weblabs","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-content-loader",
function(d,c,a,b,e,f,h,k,g,l,r){function n(a){k.logCount("turboCheckoutInitiate");K();M=!1;L=Date.now();u("Notifying loading callbacks");E="started";P.callAll();d.trigger("turbo:checkout:prefetch:onStart");k.logCount("turboCheckoutPrefetchStart");var f=a?c.generateEligibilityValue():b.getRefTag(),f=(a?h.buildEligibilityPathWith:h.buildInitiatePathWith)(f,b.getExperimentName(),b.getRequestId(),b.getSessionId());D=e.loadWithJQXHR(f,{type:"POST",data:p(a),headers:z(),xhr:w,success:v,error:F})}function p(a){var c=
{isAsync:1};b.getAddressId()&&(c.addressID=b.getAddressId());b.isPhysicalGiftCardExperimentEligible()&&(c.isPhysicalGiftCard=b.isPhysicalGiftCardExperimentEligible());if(a&&r.isEligible()&&r.getLineItem()){var d=r.getLineItem();c["asin.1"]=d.asin;c["offerListing.1"]=d.offerListingId;c["requiresEligibilityCheck.1"]="true"}a||b.getLineItems().forEach(function(a,b){b+=1;c["asin."+b]=a.asin;c["offerListing."+b]=a.offerListingId;c["quantity."+b]=a.quantity;a.customItemPrice&&(c["customItemPrice."+b]=a.customItemPrice,
c.customItemPrice=a.customItemPrice);var d=a.addToCartTimeAsUnixEpochMilliseconds;d&&(c["addToCartTimeAsUnixEpochMilliseconds."+b]=d);(a=a.addToCartSessionId)&&(c["addToCartSessionId."+b]=a)});return c}function z(){var a={"x-amz-support-custom-signin":1};a["x-amz-turbo-checkout-dp-url"]=m.location.href;a["x-amz-checkout-entry-referer-url"]=m.location.href;return a}function w(){var a=e.createXHRRequest();a.addEventListener("readystatechange",function(){if(M||!a.readyState||2>a.readyState)u("Ignoring ready state changed event because headers already received or missing xhr");
else if(M=!0,k.logCount("turboCheckoutPrefetchHeadersReceived"),k.logCount("turboCheckoutPrefetchHeadersReceivedDuration",Date.now()-L),x(a)){u("Headers received: Turbo eligible");k.logCount("turboCheckoutTurboEligibleAfterCheetahChecks");var b=t(a),c=g.isSignInSupported();b&&(u("Headers received: Signin required"),k.logCount("turboCheckoutSigninRequired"),c||(u("Sign-in required but it is disabled or not supported."),k.logCount("turboCheckoutSigninNotSupported")));if(c||!b)u("Notifying turbo eligible callbacks"),
I.callAll(),d.trigger("turbo:checkout:prefetch:onTurboEligible");A(a)&&R.callAll(a.getResponseHeader("x-amzn-checkout-login-provider"))}else u("Headers received: Not turbo eligible"),S.callAll(),d.trigger("turbo:checkout:prefetch:onTurboIneligible")});return a}function u(a,b){f.logDebug("turbo-checkout-content-loader",a,b)}function t(a){return a&&a.getResponseHeader("x-amzn-checkout-login-required")}function A(a){return g.isSignInSupported()&&t(a)}function v(a,b,c){k.logCount("turboCheckoutPrefetchEnd",
Date.now()-L);D=null;b=x(c);var e,g=a&&a.match(G);if(g&&0<g.length)try{var h=C(g[0]);e=C.parseJSON(h.text())}catch(p){f.logError("Could not extract page state from cheetah page: "+p)}else u("Could not extract page state from response data");var h=e&&"turbo"===e.pipelineType,g=e&&e.currentPurchaseId&&0<String(e.currentPurchaseId).trim().length,n=c.getResponseHeader("x-amzn-experiment-weblabs-to-trigger");if(n!==y){var m=[];try{m=JSON.parse(n)}catch(p){console.error("Error parsing additional weblabs from xhr response header: ",
p)}l.set(m)}h&&!g&&f.logError("No purchaseid provided, cannot show turbo");b&&h&&g?("started"!==E&&f.logError("turbo-checkout-content-loader","Error processing turbo available callbacks. Expected state to be started but was "+E),u("Notifying turbo available callbacks"),E="success",Q.callAll(a,e),d.trigger("turbo:checkout:prefetch:onSuccess"),k.logCount("turboCheckoutTurboPrefetchSuccess")):b&&A(c)?u("Body received: Eligible and sign-in is supported and required."):(u("Body received: No turbo page or not eligible: isTurboEligible: "+
b+" isTurboPage: "+h+" hasPurchaseId: "+g),B(),k.logCount("turboCheckoutTurboPrefetchFail"))}function F(a,b,c){k.logCount("turboCheckoutPrefetchEnd");D=null;u("Error while initiate",c);k.logCount("turboCheckoutTurboPrefetchError");"timeout"===b&&k.logCount("turboCheckoutInitiateTimeOut");B()}function x(a){return a&&a.getResponseHeader("x-amz-turbo-checkout-eligible")}function B(){"started"!==E&&f.logError("turbo-checkout-content-loader","Error processing turbo not available callbacks. Expected state to be started but was "+
E);u("Notifying error callbacks");E="error";O.callAll();d.trigger("turbo:checkout:prefetch:onError")}function K(){D&&D.abort&&(u("Aborting running request..."),D.abort())}var G=/<script.*data-a-state.*checkout:conductor:page.*>.*<\/script>/,C=d.$,D,E="stopped",L,M=!1,P=a.create("onStart"),Q=a.create("onFinish"),O=a.create("onError"),I=a.create("onTurboEligible"),S=a.create("onTurboIneligible"),R=a.create("onSigninRequired");d.on("turbo:checkout:signInController:onDoSignIn",B);return{registerCallback:function(a){P.push(a);
Q.push(a);O.push(a);I.push(a);R.push(a);S.push(a)},callInitiate:function(){u("Calling turbo initiate");n()},checkEligibility:function(){u("Calling turbo eligibility check only");n(!0)},abortCall:K,isSuccess:function(){return"success"===E},isError:function(){return"error"===E},isStarted:function(){return"started"===E}}});"use strict";k.when("A","jQuery","turbo-checkout-ref-tagger","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-history-manager",function(d,c,a,b){function e(){if(m.history.state&&
m.history.state.turboAction)return m.history.state.turboAction}c(m).bind("popstate.turbo",function(c){e();e()?(b.logDebug("turbo-checkout-history-manager","Trigger sheet open"),d.trigger("turbo:checkout:sheet:doOpen")):(b.logDebug("turbo-checkout-history-manager","Trigger sheet close"),d.trigger("turbo:checkout:sheet:doClose",{immediate:!1,reason:a.TAGS.BACK}))});return{sheetOpened:function(){e();e()||(b.logDebug("turbo-checkout-history-manager","Adding turbo history state"),m.history.pushState({turboAction:"popover"},
document.title+" Turbo open"))},sheetClosed:function(){e();e()&&(b.logDebug("turbo-checkout-history-manager","Removing turbo history state"),m.history.back())}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-base-visibility-manager",function(d){function c(){d.trigger("turbo:checkout:page:gone")}return{setup:function(){d.on("turbo:checkout:sheet:onNavigateAway",c)}}});k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-mash-will-reappear-check",function(d){d.get(d.KEYS.USES_MASH_WILL_REAPPEAR)||
k.when("turbo-base-visibility-manager").register("turbo-checkout-page-visibility-manager",function(c){return c})});"use strict";k.when("A","jQuery","turbo-checkout-view-state","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","turbo-checkout-content-loader","turbo-checkout-prefetch-timer","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-utils","turbo-checkout-eligibility-aggregator","turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-prefetcher",
function(d,c,a,b,e,f,h,k,g,l,m,n){function p(a){var b=w;w=a;l.logDebug("turbo-checkout-prefetcher","Transitioning from "+b.name+" to "+a.name);if(b.onExit)b.onExit(a.name);if(a.onEnter)a.onEnter(b.name);d.trigger("turbo:checkout:prefetcher:state:"+a.name);d.trigger("turbo:checkout:prefetcher:state",a.name)}var z,w,u=function(){var a=f.isError(),b=!m.isTurboEligible(),c=h.isTimeout(),d=0===z;l.logDebug("turbo-checkout-prefetcher","Test is data stale: isStaleWhenCheetahReturnsError: "+a+" isStaleWhenProductNotEligiblie: "+
b+" isStaleWhenTimeoutOccurs: "+c+" isStaleWhenNoMorePrefetchesAvailable: "+d);return a||b||c||d},t=function(){var a=m.isTurboEligible()&&!h.isTimeout()&&0<z;l.logDebug("turbo-checkout-prefetcher","Test should prefetch: eligibilityAggregator.isTurboEligible(): "+m.isTurboEligible()+" !timer.isTimeout(): "+!h.isTimeout()+" _prefetchesAvailable: "+z);return a},A={name:"start",onEvent:function(a){m.shouldAttemptPrefetch()?"controller:onPageLoaded"===a&&p(v):p(B)},onExit:function(){e.startMonitoringPage()}},
v={name:"dataStale",onEvent:function(a){"page:gone"!==a&&"prefetch:onError"!==a&&"sheet:afterClose"!==a&&t()&&p(y)}},y={name:"dataPrefetching",onEnter:function(){g.incrementPrefetchCounter();b.isPrefetch()||a.isOpeningOrOpen()||n.isAutoOpenReadyToBeOpened()?f.callInitiate():f.checkEligibility();--z},onEvent:function(a){if("page:gone"===a)p(v);else{var c=f.isSuccess()&&b.isPrefetch(),d=f.isSuccess()&&b.isNoPrefetch();l.logDebug("turbo-checkout-prefetcher","Test is data fresh: isFreshWhenPrefetchResultOKInT1: "+
c+" isFreshWhenPrefetchResultOKInT4: "+d);c||d?p(x):u()?p(v):"product:onChange"===a&&t()&&p(y)}},onExit:function(a){"dataFresh"!==a&&f.abortCall()}},x={name:"dataFresh",onEnter:function(){h.startTimer()},onEvent:function(b){"page:gone"===b?p(v):u()?p(v):(a.isClosed()||"product:onChange"===b)&&t()&&p(y)},onExit:function(){h.resetTimer()}},B={name:"end"},K="controller:onPageLoaded sheet:beforeOpen sheet:afterClose product:onChange prefetch:onSuccess prefetch:onError timer:onTimeout page:gone page:reappear".split(" "),
G={"sheet:beforeOpen":function(){z=10}};return{setup:function(){z=10;w=A;c.each(K,function(a,b){var c=G[b];d.on("turbo:checkout:"+b,function(a){l.logDebug("turbo-checkout-prefetcher","Processing "+b);c&&c();if(w.onEvent)w.onEvent(b)})})},getState:function(){return w.name}}});"use strict";k.when("A","turbo-signin-adapter","turbo-checkout-content-loader","turbo-checkout-buy-now-button","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-utils","turbo-callback-list","turbo-checkout-state-handler",
"turbo-checkout-eligible-state","turbo-checkout-page-ready").register("turbo-checkout-signin-controller",function(d,c,a,b,e,f,h,k,g,l){function m(){t=!1}function n(a){t=!0;A=a;e.logCount("turboCheckoutSigninRequired")}function p(){var a=t&&l.canShow();a&&(h.logDebug("turbo-checkout-signin-controller","Showing sign in dialog"),e.logCount("turboCheckoutSigninPopup"),c.show(A,z,w),d.trigger("turbo:checkout:signInController:onDoSignIn"));return a}function z(){h.logDebug("turbo-checkout-signin-controller",
"Signin success");e.logCount("turboCheckoutSigninSuccess");u.callAll()}function w(){h.logDebug("turbo-checkout-signin-controller","Signin failed");e.logCount("turboCheckoutSigninFailed")}var u=k.create(),t=!1,A;return{setup:function(){a.registerCallback({onStart:m,onSigninRequired:n});b.registerOnClickCallback(p)},registerCallback:u.push}});"use strict";k.when("A","turbo-configuration","turbo-callback-list","turbo-filtered-callback-list","turbo-checkout-page-ready").register("turbo-checkout-iframe",
function(d,c,a,b){function e(){return d.$("#"+l)}function f(){if(!(0<e().length))throw"Attempted to read / write the iFrame without it being in the DOM. This would result in an undefined iFrame document.";var a=e()[0];return a.contentDocument||a.contentWindow.document}function h(){if(0<e().length)throw"Attempted to insert multiple Turbo Checkout iFrames";}function k(){return d.$("\x3ciframe/\x3e",{id:l,src:"about:blank",scrolling:"no","class":"turbo-checkout-blank"})}function g(a){p.push(a)}var l=
c.get(c.KEYS.IFRAME_ID),m=b.create("beforeFramePopulated"),n=b.create("afterFramePopulated"),p=a.create();g(function(a){a.addClass("turbo-checkout-shown")});d.on("turbo:checkout:iframe:document:loaded",function(){p.callAll(e())});return{write:function(a){m.callAll();a+='\x3cscript\x3e"use strict";window.parent.P.now("turbo-checkout-controller").execute("callbackPageController", function callbackPageController(controller) {controller.frameHtmlRendered();});P.when("load").execute("onTurboDocumentLoaded", function onTurboDocumentLoaded() {window.parent.P.when("A").execute("triggerTurboDocumentLoaded", function triggerTurboDocumentLoaded(A) {A.trigger("turbo:checkout:iframe:document:loaded");});});\x3c/script\x3e';
if("string"!==typeof a)throw"Attempted to write non-string value to iFrame. typeof \x3d "+typeof a;var b=f();b.open();b.write(a);b.close();n.callAll(e()[0])},remove:function(){e().remove()},appendTo:function(a){h();a.append(k())},insertInto:function(a){h();a.html(k())},hasContent:function(){var a=0<e().length&&f();return a&&(a.body.hasChildNodes()||a.head.hasChildNodes())},registerCallbacks:function(a){m.push(a);n.push(a)},onContentLoaded:g}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-view-state",
function(d){function c(a,b){return function(){return e===a||e===b}}function a(a){return function(){e=a;b.apply(b,arguments)}}function b(a,b){a&&"string"===typeof a&&d.trigger(a,b)}var e=0;return{isClosed:c(0),isClosing:c(1),isOpen:c(2),isOpening:c(3),isClosingOrClosed:c(1,0),isOpeningOrOpen:c(3,2),setToOpen:a(2),setToOpening:a(3),setToClosed:a(0),setToClosing:a(1)}});"use strict";k.when("A","turbo-view-adapter","turbo-checkout-view-state","turbo-checkout-eligible-state","turbo-checkout-content-loader",
"turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-weblab-trigger","turbo-checkout-csm","turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-ajax-wrapper","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-prefetcher","turbo-checkout-prefetch-timer","turbo-checkout-buy-now-button","turbo-checkout-signin-controller","turbo-checkout-auto-open","turbo-checkout-urls","turbo-checkout-ref-tagger","turbo-configuration","turbo-checkout-event-verification",
"turbo-checkout-page-ready").register("turbo-checkout-controller",function(d,c,a,b,e,f,h,k,g,l,m,n,p,z,w,u,t,A,v,y,x,B,K){function G(){t.bindTurboClickEvent();d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",function(a){a()})}function C(a,b){f.logDebug("turbo-checkout-controller",a,b)}function D(a,b){I();a||c.close({reason:b})}function E(){C("Handling signin success");M()}function L(){C("Handling buy now button click");M();return!0}function M(){W=setTimeout(P,2E4);J=g.createScope();
J.markClick();N="loading";T=!1;u.checkTimeout();z.incrementSheetOpenedCounter();c.show()}function P(){g.logCount("turboCheckoutContenLoadTimeout")}function Q(){I();c.removeContent()}function O(){I();K.logBuyNowButtonClickHandlerMetrics()}function I(){b.canShow()?(C("Registering with buy now button"),d.trigger("turbo:checkout:buyNowEnabled"),t.registerOnClickCallback(L)):(C("Unregistering from buy now button"),d.trigger("turbo:checkout:buyNowDisabled"),t.deregisterOnClickCallback(L))}function S(a,
b){g.logCount("turboCheckoutPrefetchSuccess");a&&(h.isControl()||h.isBuyNowOnly())&&(C("Received content in control: "+a.substring(0,255)),g.logCount("turboCheckoutControlContentReceived"));U=b;c.setContent(a);I()}function R(){I();a.isOpeningOrOpen()&&(g.logCount("turboCheckoutYieldNewPurchase"),c.closeImmediatelyThenExecute(V))}function Y(){clearTimeout(W);N="unknown";!H||H.isResolved()||H.isRejected()||(C("Initiate confirm called for "+U.currentPurchaseId+" with existing confirm still executing. Aborting"),
g.logCount("turboCheckoutConfirmPending"),H._supersedByNewPurchase=!0,H.abort());aa()}function Z(){var a=l.getLineItems().filter(function(a){return a&&a.isDiscoveredAsin}).map(function(a,b){return a.asin});g.logCount("turboCheckoutDiscoveredAsins",a.length);return a}function aa(){g.logCount("turboCheckoutConfirm");var a=U.currentPurchaseId,b=y.buildConfirmPathWith(l.getRefTag(),h.getExperimentName(),l.getRequestId(),l.getSessionId(),Z());H=n.loadWithJQXHR(b,{type:"POST",data:{pid:a},success:function(a,
b,c){g.logCount("turboCheckoutConfirmSuccess")},error:function(b,d,e){"abort"===d?g.logCount("turboCheckoutConfirmAborted"):("timeout"===d&&g.logCount("turboCheckoutConfirmTimeOut"),g.logCount("turboCheckoutConfirmFailed"));b._supersedByNewPurchase||(f.logError("Issue confirming turbo initiate prefetch for pid "+a+": "+e+", "+d),g.logCount("turboCheckoutYieldNewPurchase"),c.closeImmediatelyThenExecute(V))}})}function ba(){J.markFirstByte()}function V(){t.executeOriginalBuyNowAction(l.getActiveId())}
function ca(a){d.trigger("turbo:checkout:embedded:page:showSpinner");H.done(a)}function ea(a,b,c){N=c;T=!1}function fa(){T=!0}function da(a){d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",function(a){a()});a&&a.doNotLog||(a&&!a.doNotLog?X(N,a.reason):X(N,!1));N="closed"}function X(a,b){var c=y.buildLogPageHitPathWith(T?a+"2":a,b);C("Logging page hit from "+a+" to "+B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER)+" reason "+b);n.load(c,{method:"POST",params:{pageType:B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER),
referrer:a},timeout:4E3})}function ga(){a.isOpeningOrOpen()&&g.logCount("turboCheckoutProductChangedWhileOpening")}var J,N,U,T;x=B.get(B.KEYS.AJAX_PAGE_UPDATE_EVENT);var W,H;d.on(x,G);G();return{pageLoaded:function(){var a=h.getExperimentName();if(a){var f=h.getAllocation();g.addCounterExtraSuffix("wl:"+f);g.addCounterExtraSuffix(a+":"+f)}m.isDeviceTurboEligible()&&(b.setup(),b.registerStateChangeCallback(D),p.setup(),e.registerCallback({onStart:Q,onTurboEligible:O,onFinish:S,onError:R}),k.setup(),
A.setup(),A.registerCallback(E),J=g.createScope(),c.registerCallbacks({beforeFramePopulated:Y,afterFramePopulated:ba}),l.registerCallback(ga),d.on("turbo:checkout:sheet:beforeClose",da),d.on("turbo:checkout:embedded:page:beforeReload",ea),d.on("turbo:checkout:embedded:page:animation:start",fa),v.setup(t.executeTurboBuyNowAction,O),w.setup(),d.trigger("turbo:checkout:controller:onPageLoaded"))},loadFullscreen:function(a,b){function d(){a=f.createFQDN(a);"thankyou"===b?(g.logCount("turboCheckoutYieldTYP"),
c.closeAndNavigate(a)):(g.logCount("turboCheckoutYield"),c.closeToFullscreen(a))}!H||H.isResolved()||H.isRejected()?d():(g.logCount("turboCheckoutWaitYield"),ca(d))},frameContentReady:function(a,b,c){d.trigger("turbo:checkout:embedded:page:ready",a,b);(function(){var a=function(){J.markCriticalFeature();c.confirmHit(B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER),l.getRefTag());J.whenDataSet(c.recordClientSideMetrics);b.off("checkout:afterReload",a)};b.on("checkout:afterReload",a)})();(function(){b.on("checkout:beforeReload",
function(c){d.trigger("turbo:checkout:embedded:page:beforeReload",a,b,c)});b.on("checkout:reload",function(c){d.trigger("turbo:checkout:embedded:page:reload",a,b,c)});b.on("checkout:afterReload",function(c){d.trigger("turbo:checkout:embedded:page:afterReload",a,b,c)});b.on("turbo:checkout:animation:start",function(){d.trigger("turbo:checkout:embedded:page:animation:start")});d.on("turbo:checkout:embedded:page:showSpinner",function(){c.showSpinner()});d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",
function(a){b.trigger("turbo:checkout:dimmer:clicked:iFrame",a)});b.on("turbo:checkout:update:dimmer",function(a){d.trigger("turbo:checkout:update:dimmer:afterReload",a)});b.on("turbo:checkout:update:modal:header",function(a){d.trigger("turbo:checkout:update:modal:header:afterReload",a)})})()},frameHtmlRendered:function(){J.markAboveTheFold()},updateBounds:function(a,b){c.updateBounds(a,b)}}});"use strict";k.when("turbo-checkout-page-load-spinner","turbo-checkout-controller","turbo-checkout-csm",
"turbo-checkout-page-ready").register("turbo-checkout-startup",function(d,c,a){d.removePageLoadSpinner();a.logCount("turboCheckoutControllerPageLoaded");c.pageLoaded()});"use strict";k.when("turbo-checkout-assets-load-trigger").register("turbo-checkout-page-ready",function(){m.ue&&m.ue.count&&"undefined"!==typeof m.ue_t0&&m.ue.count("turboCheckoutPageReady",Date.now()-m.ue_t0)});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-quantity-input",
"turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-authportal-return-query",function(d,c,a,b,e,f,h){function k(b){a.logDebug("turbo-checkout-authportal-return-query",b)}function g(a){return!!a.match("trb_auth\x3d1")}function l(d){if(g(d)){d=((d||"").match(p)||[])[1]||"";var e=b.getSessionId();a.isNonEmptyString(d)||c.logCount("turboCheckoutPostAuthEmptySessionParameter");a.isNonEmptyString(e)||c.logCount("turboCheckoutPostAuthEmptySessionPageState");
a.isNonEmptyString(d)&&a.isNonEmptyString(e)&&d!==e&&(a.logWarning("Turbo Session Flip Detected. Post authentication sessionId \x3d "+e+", Expected \x3d "+d,"turbo-checkout-authportal-return-query"),c.logCount("turboCheckoutPostAuthSessionFlip"))}}var r=/&?(openid|aToken|serial)[^&]*/g,n=/&?trb_(open|auth|qty|warrAsin|sid|accessory(Asin|Offer))=[^&]*/g,p=/&?trb_sid=([^&]*)/,z=/\?[?&]*/,w=/[?&]{2,}/g;l(m.location.search);return{buildFrom:function(a){k("Initial Query \x3d "+a);a=(a||"?").replace(r,
"");a=a.replace(n,"");a+="\x26trb_auth\x3d1\x26trb_open\x3d1";var c=e.getQuantity();a+=1<c?"\x26trb_qty\x3d"+c:"";c=f.getLineItem();a+=c&&c.asin?"\x26trb_warrAsin\x3d"+c.asin:"";c=b.getSessionId();a+=0<c.length?"\x26trb_sid\x3d"+c:"";c=b.getActiveId();a+=c?"\x26trb_bid\x3d"+c:"";c=h.getLineItem();a+=c&&c.asin&&c.offerListingId?"\x26trb_accessoryAsin\x3d"+c.asin+"\x26trb_accessoryOffer\x3d"+c.offerListingId:"";a=a.replace(z,"?").replace(w,"\x26");k("Final Query \x3d "+a);return a},isReturningFromAuthPortal:g,
validateSession:l}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-csm","turbo-checkout-auto-open","turbo-checkout-authportal-return-query","turbo-checkout-page-ready").register("turbo-checkout-browser-signin",function(d,c,a,b){function e(a){if(f(a)){c.logCount("turboCheckoutForceMobileClaimCollection");var b=a.match(g)[1],e=decodeURIComponent(b);b===e&&d.logError("The pre-defined returnTo seems to be un-encoded");e=encodeURIComponent(e+(-1===e.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+
h());return a.replace(b,e)}return a+(-1===a.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+h()}function f(a){return null!==a.match(g)}function h(){var a=b.buildFrom(m.location.search);return encodeURIComponent("https://"+m.location.hostname+m.location.pathname.replace(r,"/ref\x3dtrb_chk_auth")+a)}function k(){var a=m.location.search.match(l)?"turboCheckoutSigninSuccess":"turboCheckoutSigninFailed";c.logCount(a)}var g=/openid\.return_to=([^&$]+)/,l=/openid\.mode=id_res/,r=/(\/ref=[^/]*\/?$|\/?$)/;
b.isReturningFromAuthPortal(m.location.search)&&(c.logCount("turboCheckoutAuthPortalReturn"),k());return{show:function(b){b=e(b);c.logCount("turboCheckoutSignInUrlSize",b.length);a.reset();m.location.href=b},_encodeSignInUrl:e,_isReturnToParameterPredefined:f}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-strings",function(d,c){function a(a){return function(){var e=c.getStrings()[a];if(e)return e;d.logDebug("turbo-checkout-strings",
'String for key "'+a+'" is undefined! Returning empty string.');return""}}return{getHeaderText:a("TURBO_CHECKOUT_HEADER"),getLoadingText:a("TURBO_LOADING_TEXT")}});"use strict";k.when("jQuery","turbo-checkout-page-ready").register("turbo-checkout-loading-spinner",function(d){function c(){return d("#turbo-loading-container")}function a(a){var c=d("\x3cdiv\x3e",{id:"turbo-loading-content"}).append(d("\x3cdiv\x3e",{id:"turbo-loading-spinner","class":"a-spinner a-spinner-medium"}));"string"===typeof a&&
a&&c.append(d("\x3cdiv\x3e",{id:"turbo-loading-text",text:a}));return c}return{create:function(b){return d("\x3cdiv\x3e",{id:"turbo-loading-container"}).append(a(b))},get:c,show:function(){c().addClass("turbo-checkout-shown")}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-eligibility-response-weblabs",function(d,c){var a=[];return{set:function(b){d.$.isArray(b)&&(a=b)},get:function(){return a}}});"use strict";k.when("turbo-checkout-csm","turbo-checkout-utils",
"turbo-checkout-page-ready").register("turbo-checkout-session-storage",function(d,c){function a(a,d){c.logDebug("turbo-checkout-session-storage",a,d)}return{isPresent:function(b){var c;a:{try{c=m.sessionStorage.getItem(b);break a}catch(f){d.logCount("turboCheckoutSessionStorageExceptionGet"),a("get() exception",f)}c=null}return null!==c&&c!==y},set:function(b,c){try{m.sessionStorage.setItem(b,c)}catch(f){d.logCount("turboCheckoutSessionStorageExceptionSet"),a("set() exception",f)}},remove:function(b){try{return m.sessionStorage.removeItem(b)}catch(c){d.logCount("turboCheckoutSessionStorageExceptionRemove"),
a("remove() exception",c)}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-load-events",function(d,c){var a=c.get(c.KEYS.AJAX_PAGE_UPDATE_EVENT);return{bind:function(b){d.off(a,b);d.off("turbo:checkout:controller:onPageLoaded",b);d.on(a,b);d.on("turbo:checkout:controller:onPageLoaded",b)}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-event-verification",
function(d,c,a,b,e,f){function h(){var a=f.get(f.KEYS.BUY_NOW_CLICK_EVENT).split(".");return 1<a.length?a[1]:"turboCheckout"}function k(b){var c=b.map(function(a){return a.namespace}).filter(function(a,b,c){return c.indexOf(a)===b});b.length!==c.length&&a.logCount("turboCheckoutBuyNowButtonDuplicateClickHandler")}function g(b){if((b=b.filter(function(a){return a!==y&&"click"===a.type&&0<=n.indexOf(a.namespace)}))&&0<b.length){var c=0;b.forEach(function(b){b.namespace!==h()&&(a.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelisted:"+
b.namespace),c++)});0<c&&a.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelistedQuantity:"+c)}}function l(b){if((b=b.filter(function(a){return a!==y&&"click"===a.type&&0>n.indexOf(a.namespace)}))&&0<b.length){var c=0;b.forEach(function(){a.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelisted");c++});a.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelistedQuantity:"+c)}}var m=!1,n=[h(),"accessoryUpsellInterstitial","makoPreRegistration","moq","siatc","hctpDFL","bbg","vasBuyNow",
"ppdBundles","makoGiftingMetrics","financialOptionsCheckout"];return{logBuyNowButtonClickHandlerMetrics:function(){var d=e.getBuyNowButtons();if(!m&&d&&0<d.length){for(var f=0;f<d.length;f++){var h=c._data(d[f],"events");if(!h||!h.click){a.logCount("turboCheckoutBuyNowButtonNoBoundHandlers");return}var n=(h=h.click)?h.length:0;1<n&&(b.logDebug("turbo-checkout-event-verification","Multiple handlers bound to 'click' in Buy Now button. Number of handlers: "+n,void 0),a.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBound"),
a.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBoundQuantity:"+n));k(h);l(h);g(h)}m=!0}}}})});
/* ******** */
(function(f){var p=window.AmazonUIPageJS||window.P,r=p._namespace||p.attributeErrors,a=r?r("TurboCheckoutDesktopAssets",""):p;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,p,r){f.when("turbo-configuration-keys","turbo-checkout-page-ready").register("turbo-device-configuration",function(a){var c;c||(c={},c[a.SHOW_SIGN_IN_INTERFACE]="turbo-checkout-browser-signin",c[a.EXTEND_ELIGIBLE_STATE]=!1,c[a.IS_DEVICE_FILTER_REQUIRED]=!0,c[a.VIEW_ADAPTER]="turbo-checkout-modal",
c[a.WARRANTY_CHECKBOX_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]",c[a.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR]=".abbListItem",c[a.WARRANTY_OFFER_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]:checked",c[a.WARRANTY_ASIN_INPUT_NAME]="asin");return c});"use strict";f.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-device-variant","turbo-checkout-is-touch-and-orientation-enabled","turbo-checkout-page-ready").register("turbo-checkout-device-filter",function(a,
c,k,f,g,p){function h(a){var b=!1;this.countOnce=function(){b||(c.logCount(a),b=!0)}}function d(a){k.logDebug("turbo-checkout-device-filter",a)}var r="turboCheckoutDisabledDesktopAuiVariant"+g,l,b,u,v,t,m,w;return{isDeviceTurboEligible:function(){l=l||new h("Desktop"===g?"turboCheckoutDesktopAuiVariantEligible":r);var e;(e=b)||(e=k.isInternetExplorer()?"turboCheckoutDisabledDesktopIE":k.isIPad()?"turboCheckoutDisabledDesktopIPad":k.isIPhone()?"turboCheckoutDisabledDesktopIPhone":k.isAndroid()?"turboCheckoutDisabledDesktopAndroid":
"turboCheckoutDesktopUserAgentEligible",e=new h(e));b=e;u=u||new h("turboCheckoutDisabledDesktopTouch");v=v||new h("turboCheckoutDisabledDesktopOrientation");t=t||new h("turboCheckoutDisabledDesktopTouchAndOrientation");m=m||new h("turboCheckoutDisabledTurboDesktopOnDevice");w=w||new h("turboCheckoutEnabledTurboDesktopOnDevice");l.countOnce();"Desktop"===g||d("Aui device variant is NOT Desktop. Turbo will NOT show. Variant is "+g);(e="Desktop"!==g)||(b.countOnce(),e=!!(k.isInternetExplorer()||k.isIPad()||
k.isAndroid()||k.isIPhone()));if(e)return m.countOnce(),!1;if(e=a.capabilities.touch)u.countOnce(),d("Touch enabled device. Turbo will NOT show");var c=a.capabilities.orientation;c&&(v.countOnce(),d("Orientation enabled device. Turbo will NOT show"));e&&c&&t.countOnce();if((e||c)&&!p)return m.countOnce(),!1;w.countOnce();return!0},isSignInSupported:function(){return f.get(f.KEYS.IS_SIGN_IN_SUPPORTED)}}});"use strict";f.when("turbo-checkout-page-ready").execute(function(){f.declare("turbo-checkout-device-variant",
"Desktop")});"use strict";f.when("A","a-modal","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-iframe","turbo-checkout-base-view","turbo-checkout-loading-spinner","turbo-checkout-view-state","turbo-checkout-ref-tagger","turbo-checkout-strings","turbo-checkout-page-ready").register("turbo-checkout-modal",function(a,c,f,E,g,F,h,d,z,l){function b(a){E.logDebug("turbo-checkout-modal",a)}function u(){!A()||d.isOpeningOrOpen()?b("show() suppressed. View is null or undefined or view state is opening or open"):
(d.setToOpening(),m().show())}function v(){x&&d.isOpeningOrOpen()&&(g.appendTo(e()),g.write(x))}function t(){g.remove();if(0<e().length)b("Modal frame is in DOM. Inserting Spinner"),e().height("").html(h.create(l.getLoadingText())).append(w()),q("#turbo-checkout-modal-header").text(l.getHeaderText());else{b("Modal frame is NOT in DOM. Resetting Modal");var a={inlineContent:q("\x3cdiv\x3e",{id:"turbo-checkout-frame"}).html(h.create(l.getLoadingText())).append(w()).prop("outerHTML"),padding:"none",
dataStrategy:"inline",header:'\x3cdiv id\x3d"turbo-checkout-modal-header"\x3e'+l.getHeaderText()+"\x3c/div\x3e"};m().update(a)}}function m(){return B=B||c.get(q("#turbo-checkout-modal"))}function w(){return q("\x3cscript/\x3e",{type:"text/javascript",html:'P.when("A").execute(function turboFrameReady(A) { A.trigger("turbo:checkout:frame:ready"); });'})}function e(){return q("#turbo-checkout-frame")}function y(a){!A()||d.isClosingOrClosed()?b("close() suppressed. View is undefined or null or view state is closing or closed"):
(n=a||n,n.notify=!0===n.notify||n.notify===r,d.setToClosing(),m().hide())}function A(){var a=m();a||b("Modal is undefined or null. Modal \x3d "+a);return a?!0:!1}function C(b){q(document.body).unbind("click");b();a.trigger("turbo:checkout:sheet:onNavigateAway");y({notify:!1,immediate:!0,doNotLog:!0})}function D(a){b("onDismiss");n={notify:!0,reason:a}}var q=a.$,n={},x,B,G=new (F.extend())("#turbo-checkout-frame");g.onContentLoaded(function(a){h.get().remove()});a.on("a:popover:dismiss:turbo",function(){b("onClick_X");
D(z.TAGS.TOUCH_X)});a.declarative("a-popover-floating-close","click",function(){b("onDimmerClicked");D(z.TAGS.TOUCH)});a.on("a:popover:beforeShow:turbo",function(){b("onBeforeOpen");d.setToOpening("turbo:checkout:sheet:beforeOpen");t()});a.on("a:popover:show:turbo",function(){b("onOpen");d.setToOpen();x||h.show()});a.on("a:popover:beforeHide:turbo",function(){b("onBeforeClose");d.setToClosing.apply(d,!0===n.notify?["turbo:checkout:sheet:beforeClose",n]:r);e().removeClass("turbo-checkout-shown")});
a.on("a:popover:hide:turbo",function(){b("onClose");d.setToClosed("turbo:checkout:sheet:afterClose");n={}});a.on("a:popover:afterHide:turbo",t);a.on("turbo:checkout:sheet:doOpen",u);a.on("turbo:checkout:sheet:doClose",y);a.on("turbo:checkout:frame:ready",v);a.on(a.constants.BROWSER_EVENTS.ORIENTATION_CHANGE,function(){f.logCount("turboCheckoutDesktopOrientationChange");d.isOpen()&&f.logCount("turboCheckoutDesktopOrientationChangeWhenModalOpen")});a.on("turbo:checkout:state:product:resolved",function(){q("#turbo-checkout-modal-header").text(l.getHeaderText())});
a.on("turbo:checkout:update:modal:header:afterReload",function(a){null!==a&&q("#turbo-checkout-modal-header").text(a)});return{show:u,setContent:function(a){x=a;b("iFrame content saved");d.isOpeningOrOpen()?v():(b("setFrameContent NOT called"),b("viewState is not opening? isOpeningOrOpen \x3d "+d.isOpeningOrOpen()),b("iFrame already has content? iFrame.hasContent \x3d "+g.hasContent()))},removeContent:function(){x="";t()},close:y,closeToFullscreen:function(a){C(function(){p.location.href=a})},closeImmediatelyThenExecute:C,
closeAndNavigate:function(b){p.location.href=b;a.trigger("turbo:checkout:sheet:onNavigateAway");y({notify:!1,doNotLog:!0})},registerCallbacks:g.registerCallbacks,updateBounds:function(a){G.updateBounds(a)}}});"use strict";f.declare("turbo-checkout-is-touch-and-orientation-enabled",!1)});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,e=d._namespace||d.attributeErrors,a=e?e("DetailPageTurboCheckoutDesktopAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,e){c.when("turbo-configuration-keys","turbo-checkout-page-ready").register("turbo-client-configuration",function(a){var b;b||(b={},b[a.HOST_PAGE_TYPE_IDENTIFIER]="detail",b[a.BUY_NOW_ONLY_TREATMENT]="T1",b[a.NO_PREFETCH_TREATMENT]=/T[2-9]/,b[a.ADDRESS_INPUT_SELECTORS]=["#unifiedLocation1ClickAddress",
"#addToCart input[name\x3d'dropdown-selection']","#unifiedLocationAddress","input[name\x3d'dropdown-selection']"],b[a.QUANTITY_SELECT_SELECTOR]="#quantity",b[a.CONFLICTING_INITIATE_LISTENERS]=["click.siatc"],b[a.VAS_CHANGE_EVENTS]=["vas:remove-service-asin-buybox-event","vas:add-service-asin-buybox-event"],b[a.VAS_CHECKBOX_SELCTOR]="#ppdb-add-service-checkbox");return b})});
/* ******** */